From 4961a5c606f5cceb19e476f282e257a7725b1468 Mon Sep 17 00:00:00 2001 From: what Date: Wed, 16 Sep 2026 16:11:51 +0800 Subject: [PATCH] v0.7.12 --- .DS_Store | Bin 6148 -> 0 bytes .gitignore | 1 - README.md | 0 dist/button.d.ts => button.d.ts | 0 button.js | 6 + .../common/main-DCysVEHh.js => common/main.js | 1011 +++++++++-------- .../vender-CIG7ep61.js => common/vendor.js | 0 dist/components.d.ts => components.d.ts | 28 +- dist/components.js => components.js | 2 +- dist/container.d.ts => container.d.ts | 0 dist/container.js => container.js | 2 +- ...data-converter.d.ts => data-converter.d.ts | 0 dist/data-converter.js => data-converter.js | 2 +- dist/data-list.d.ts => data-list.d.ts | 0 dist/data-list.js => data-list.js | 2 +- {dist/data-list => data-list}/utils.d.ts | 0 {dist/data-list => data-list}/utils.js | 2 +- dist/button.js | 6 - dist/res-ws.js | 5 - ...-layout-form.d.ts => grid-layout-form.d.ts | 0 ...grid-layout-form.js => grid-layout-form.js | 2 +- .../utils.d.ts | 0 .../utils.js | 2 +- dist/grid-layout.d.ts => grid-layout.d.ts | 0 dist/grid-layout.js => grid-layout.js | 2 +- {dist/grid-layout => grid-layout}/utils.d.ts | 0 {dist/grid-layout => grid-layout}/utils.js | 2 +- dist/hooks.d.ts => hooks.d.ts | 0 dist/hooks.js => hooks.js | 4 +- dist/iconfont.d.ts => iconfont.d.ts | 0 dist/iconfont.js => iconfont.js | 2 +- dist/index.d.ts => index.d.ts | 0 dist/index.js => index.js | 2 +- dist/pages.d.ts => pages.d.ts | 0 dist/pages.js => pages.js | 2 +- dist/res-ws.d.ts => res-ws.d.ts | 0 res-ws.js | 5 + dist/style.css => style.css | 0 dist/utils.d.ts => utils.d.ts | 0 dist/utils.js => utils.js | 4 +- dist/virtual-fs.d.ts => virtual-fs.d.ts | 0 dist/virtual-fs.js => virtual-fs.js | 2 +- 42 files changed, 560 insertions(+), 536 deletions(-) delete mode 100644 .DS_Store delete mode 100644 .gitignore mode change 100644 => 100755 README.md rename dist/button.d.ts => button.d.ts (100%) create mode 100644 button.js rename dist/common/main-DCysVEHh.js => common/main.js (61%) rename dist/common/vender-CIG7ep61.js => common/vendor.js (100%) rename dist/components.d.ts => components.d.ts (78%) rename dist/components.js => components.js (81%) rename dist/container.d.ts => container.d.ts (100%) rename dist/container.js => container.js (79%) rename dist/data-converter.d.ts => data-converter.d.ts (100%) rename dist/data-converter.js => data-converter.js (60%) rename dist/data-list.d.ts => data-list.d.ts (100%) rename dist/data-list.js => data-list.js (90%) rename {dist/data-list => data-list}/utils.d.ts (100%) rename {dist/data-list => data-list}/utils.js (53%) delete mode 100644 dist/button.js delete mode 100644 dist/res-ws.js rename dist/grid-layout-form.d.ts => grid-layout-form.d.ts (100%) rename dist/grid-layout-form.js => grid-layout-form.js (94%) rename {dist/grid-layout-form => grid-layout-form}/utils.d.ts (100%) rename {dist/grid-layout-form => grid-layout-form}/utils.js (60%) rename dist/grid-layout.d.ts => grid-layout.d.ts (100%) rename dist/grid-layout.js => grid-layout.js (83%) rename {dist/grid-layout => grid-layout}/utils.d.ts (100%) rename {dist/grid-layout => grid-layout}/utils.js (58%) rename dist/hooks.d.ts => hooks.d.ts (100%) rename dist/hooks.js => hooks.js (81%) rename dist/iconfont.d.ts => iconfont.d.ts (100%) rename dist/iconfont.js => iconfont.js (68%) rename dist/index.d.ts => index.d.ts (100%) rename dist/index.js => index.js (78%) rename dist/pages.d.ts => pages.d.ts (100%) rename dist/pages.js => pages.js (54%) rename dist/res-ws.d.ts => res-ws.d.ts (100%) create mode 100644 res-ws.js rename dist/style.css => style.css (100%) rename dist/utils.d.ts => utils.d.ts (100%) rename dist/utils.js => utils.js (87%) rename dist/virtual-fs.d.ts => virtual-fs.d.ts (100%) rename dist/virtual-fs.js => virtual-fs.js (50%) diff --git a/.DS_Store b/.DS_Store deleted file mode 100644 index 9498e50bca478ef0f2ba7e5825a2b5c01a58d1cb..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeH~F^&@<^#q<|Dyh64V5D0F8{w$Au;FvJKz4lIXp9kT>kyg=4u>tuyyIXzgm zT8trHk9M-;bv4;Kdpj(L56e57Pcby>?XbdxW;LK71*E`CfmP2(KmYgizvlm0i&7~d z1>Q^n8+M1?mM@iO>&xqT{g_o>H#!-YGd%qSF!7^!Ll5JA@da6vt& { throw TypeError(t); }; -var Tn = (t, e, r) => e in t ? Nn(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r; -var N = (t, e, r) => Tn(t, typeof e != "symbol" ? e + "" : e, r), yr = (t, e, r) => e.has(t) || fr("Cannot " + r); +var On = (t, e, r) => e in t ? Tn(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r; +var O = (t, e, r) => On(t, typeof e != "symbol" ? e + "" : e, r), yr = (t, e, r) => e.has(t) || fr("Cannot " + r); var d = (t, e, r) => (yr(t, e, "read from private field"), r ? r.call(t) : e.get(t)), v = (t, e, r) => e.has(t) ? fr("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, r), K = (t, e, r, n) => (yr(t, e, "write to private field"), n ? n.call(t, r) : e.set(t, r), r); -import { jsx as m, jsxs as I } from "react/jsx-runtime"; -import E, { useEffect as z, useState as L, useCallback as H, useRef as J, useContext as de, useMemo as W, useId as Lt, isValidElement as On, useLayoutEffect as Rn, Suspense as Fn } from "react"; +import { jsx as h, jsxs as D } from "react/jsx-runtime"; +import x, { useEffect as z, useState as V, useCallback as J, useRef as H, useContext as de, useMemo as W, useId as Lt, isValidElement as Rn, useLayoutEffect as Fn } from "react"; import ue from "pathe"; -import C from "prop-types"; +import S from "prop-types"; import j from "classnames"; import { useNotification as jn } from "rc-notification"; import w from "lodash"; -import { useMountedState as An, useDeepCompareEffect as Yt, useUpdateEffect as Gt, usePrevious as Fr } from "react-use"; -import ie, { Field as Xt, FieldContext as jr } from "rc-field-form"; -import { _ as wr, C as Zt, L as In, M as Rt, N as Xe, b as Le, s as Vt, c as Ln, S as Vn } from "./vender-CIG7ep61.js"; +import { useMountedState as An, useDeepCompareEffect as Yt, useUpdateEffect as Gt, usePrevious as jr, useAsync as wr } from "react-use"; +import ie, { Field as Xt, FieldContext as Ar } from "rc-field-form"; +import { _ as br, C as Zt, L as In, M as Rt, N as Ze, b as Le, s as Vt, c as Ln, S as Vn } from "./vendor.js"; import Dn from "rc-util/lib/hooks/useMergedState"; -import Ar from "immutability-helper"; -import { Space as Dt, Form as ft, Input as Mn, Button as wt, Pagination as Bn, Tree as Un, Breadcrumb as Wn, Empty as Mt, Table as br, Popover as zn, Popconfirm as qn, Tooltip as Kn, Divider as _n } from "antd"; +import Ir from "immutability-helper"; +import { Space as Dt, Form as ft, Input as Mn, Button as wt, Pagination as Bn, Tree as Un, Breadcrumb as Wn, Empty as Mt, Table as Cr, Popover as zn, Popconfirm as qn, Tooltip as Kn, Divider as _n } from "antd"; import { useMergedState as Jn } from "rc-util"; -import { generatePath as Hn, useInRouterContext as Ir, useParams as Yn, useLocation as Gn, createBrowserRouter as Xn, Navigate as Zn } from "react-router-dom"; +import { generatePath as Hn, useInRouterContext as Lr, useParams as Yn, useLocation as Gn, createBrowserRouter as Xn, Navigate as Zn } from "react-router-dom"; import Qn from "rc-drawer"; import ei from "rc-dialog"; -import * as Cr from "react-is"; -var ze, Qe, qe, xe, Ve, De; +import * as kr from "react-is"; +var ze, et, qe, Ee, Ve, De; class ti { constructor(e, r) { v(this, ze, /* @__PURE__ */ new Map()); - v(this, Qe, !0); + v(this, et, !0); v(this, qe, []); - v(this, xe); - v(this, Ve, () => d(this, xe)); + v(this, Ee); + v(this, Ve, () => d(this, Ee)); v(this, De, () => Promise.resolve()); - N(this, "get", (...e) => new Promise((r, n) => { + O(this, "get", (...e) => new Promise((r, n) => { const i = JSON.stringify(e); - if (d(this, ze).has(i)) return r(d(this, De).call(this, d(this, xe), ...e)); - if (d(this, xe) === void 0) d(this, qe).push([e, r, n]), d(this, Qe) && (K(this, Qe, !1), Promise.resolve(typeof d(this, Ve) == "function" ? d(this, Ve).call(this) : d(this, Ve)).then((o) => K(this, xe, o || null)).finally(() => { + if (d(this, ze).has(i)) return r(d(this, De).call(this, d(this, Ee), ...e)); + if (d(this, Ee) === void 0) d(this, qe).push([e, r, n]), d(this, et) && (K(this, et, !1), Promise.resolve(typeof d(this, Ve) == "function" ? d(this, Ve).call(this) : d(this, Ve)).then((o) => K(this, Ee, o || null)).finally(() => { d(this, qe).forEach(([o, s, a]) => { try { - const l = d(this, De).call(this, d(this, xe), ...o); + const l = d(this, De).call(this, d(this, Ee), ...o); d(this, ze).set(JSON.stringify(o), l), s(l); } catch (l) { a(l); @@ -46,42 +46,42 @@ class ti { }), d(this, qe).length = 0; })); else { - const o = d(this, De).call(this, d(this, xe), ...e); + const o = d(this, De).call(this, d(this, Ee), ...e); d(this, ze).set(i, o), r(o); } })); K(this, De, r), K(this, Ve, e); } } -ze = new WeakMap(), Qe = new WeakMap(), qe = new WeakMap(), xe = new WeakMap(), Ve = new WeakMap(), De = new WeakMap(); -const ri = () => m("div", { children: "Empty" }), ut = E.createContext({ ele: {}, mount: () => { +ze = new WeakMap(), et = new WeakMap(), qe = new WeakMap(), Ee = new WeakMap(), Ve = new WeakMap(), De = new WeakMap(); +const ri = () => h("div", { children: "Empty" }), Xe = x.createContext({ ele: {}, mount: () => { }, unmount: () => { } }), re = ({ rootClassName: t, className: e, children: r, actions: n, title: i, subTitle: o, extras: s, style: a = {} }) => { - const { mount: l, unmount: c } = E.useContext(ut); - return re.Action({ children: n }), re.Title({ children: i }), re.SubTitle({ children: o }), re.Extra({ children: s }), z(() => (l("rootClassName", t), () => c(t)), [t]), m("div", { className: j("ff-container", e), style: a, children: r }); -}, ht = (t) => ({ children: e, className: r }) => { - const { mount: n, unmount: i } = E.useContext(ut); - return z(() => (e && n(t, E.createElement("div", { key: `ff-${t}`, className: j(`ff-popup-${t}`, r) }, e)), () => i(t)), [r, e]), null; + const { mount: l, unmount: c } = x.useContext(Xe); + return re.Action({ children: n }), re.Title({ children: i }), re.SubTitle({ children: o }), re.Extra({ children: s }), z(() => (l("rootClassName", t), () => c("rootClassName")), [t]), h("div", { className: j("ff-container", e), style: a, children: r }); +}, mt = (t) => ({ children: e, className: r }) => { + const { mount: n, unmount: i } = x.useContext(Xe); + return z(() => (e && n(t, x.createElement("div", { key: `ff-${t}`, className: j(`ff-popup-${t}`, r) }, e)), () => i(t)), [r, e]), null; }; -re.Action = ht("actions"), re.Title = ht("title"), re.SubTitle = ht("sub-title"), re.Extra = ht("extras"), re.propTypes = { className: C.string, style: C.object, title: C.any, subTitle: C.any, actions: C.any, extras: C.any }; -const Po = () => m(re, { className: "ff-loading", children: I("div", { className: "loader", children: [I("div", { className: "square", children: [m("span", {}), m("span", {}), m("span", {})] }), I("div", { className: "square", children: [m("span", {}), m("span", {}), m("span", {})] }), I("div", { className: "square", children: [m("span", {}), m("span", {}), m("span", {})] }), I("div", { className: "square", children: [m("span", {}), m("span", {}), m("span", {})] })] }) }), vo = () => m("div", { children: "NotFound" }), Lr = ({ children: t }) => { - const [e, r] = L({}), n = H((o, s) => r((a) => ({ ...a, [o]: s })), []), i = H((o) => r((s) => ({ ...s, [o]: void 0 })), []); - return typeof (t == null ? void 0 : t.type) == "string" ? t : m(ut.Provider, { value: { ele: e, mount: n, unmount: i }, children: E.cloneElement(t, { className: e.rootClassName, title: e.title, subTitle: e["sub-title"], actions: e.actions, extras: e.extras }) }); +re.Action = mt("actions"), re.Title = mt("title"), re.SubTitle = mt("subTitle"), re.Extra = mt("extras"), re.propTypes = { className: S.string, style: S.object, title: S.any, subTitle: S.any, actions: S.any, extras: S.any }; +const Po = () => h(re, { className: "ff-loading", children: D("div", { className: "loader", children: [D("div", { className: "square", children: [h("span", {}), h("span", {}), h("span", {})] }), D("div", { className: "square", children: [h("span", {}), h("span", {}), h("span", {})] }), D("div", { className: "square", children: [h("span", {}), h("span", {}), h("span", {})] }), D("div", { className: "square", children: [h("span", {}), h("span", {}), h("span", {})] })] }) }), No = () => h("div", { children: "NotFound" }), Vr = ({ children: t }) => { + const [e, r] = V({}), n = J((o, s) => r((a) => ({ ...a, [o]: s })), []), i = J((o) => r((s) => ({ ...s, [o]: void 0 })), []); + return typeof (t == null ? void 0 : t.type) == "string" ? t : h(Xe.Provider, { value: { ele: e, mount: n, unmount: i }, children: x.cloneElement(t, { className: e.rootClassName, title: e.title, subTitle: e.subTitle, actions: e.actions, extras: e.extras }) }); }; -Lr.propTypes = { children: C.element.isRequired }; -const kr = { close: ["M563.8 512l262.5-312.9c4.4-5.2 0.7-13.1-6.1-13.1h-79.8c-4.7 0-9.2 2.1-12.3 5.7L511.6 449.8 295.1 191.7c-3-3.6-7.5-5.7-12.3-5.7H203c-6.8 0-10.5 7.9-6.1 13.1L459.4 512 196.9 824.9c-4.4 5.2-0.7 13.1 6.1 13.1h79.8c4.7 0 9.2-2.1 12.3-5.7l216.5-258.1 216.5 258.1c3 3.6 7.5 5.7 12.3 5.7h79.8c6.8 0 10.5-7.9 6.1-13.1L563.8 512z"], check: ["M912 190h-69.9c-9.8 0-19.1 4.5-25.1 12.2L404.7 724.5 207 474c-6.1-7.7-15.3-12.2-25.1-12.2H112c-6.7 0-10.4 7.7-6.3 12.9l273.9 347c12.8 16.2 37.4 16.2 50.3 0l488.4-618.9c4.1-5.1 0.4-12.8-6.3-12.8z"], info: ["M512 224m-64 0a64 64 0 1 0 128 0 64 64 0 1 0-128 0Z", "M544 392h-64c-4.4 0-8 3.6-8 8v464c0 4.4 3.6 8 8 8h64c4.4 0 8-3.6 8-8V400c0-4.4-3.6-8-8-8z"] }, Qt = ({ type: t, props: e }) => m("i", { ...e, children: m("svg", { viewBox: "0 0 1024 1024", width: "1em", height: "1em", fill: "currentColor", children: (kr[t] || kr.info).map((r, n) => m("path", { d: r }, n)) }) }), Vr = ({ className: t, content: e, icon: r, $close: n }) => I(E.Fragment, { children: [r && m("div", { className: j("ff-notification-icon", t), children: m(Qt, { type: r }) }), e] }), ni = ({}) => m(re, { children: "Confirm" }); +Vr.propTypes = { children: S.element.isRequired }; +const Sr = { close: ["M563.8 512l262.5-312.9c4.4-5.2 0.7-13.1-6.1-13.1h-79.8c-4.7 0-9.2 2.1-12.3 5.7L511.6 449.8 295.1 191.7c-3-3.6-7.5-5.7-12.3-5.7H203c-6.8 0-10.5 7.9-6.1 13.1L459.4 512 196.9 824.9c-4.4 5.2-0.7 13.1 6.1 13.1h79.8c4.7 0 9.2-2.1 12.3-5.7l216.5-258.1 216.5 258.1c3 3.6 7.5 5.7 12.3 5.7h79.8c6.8 0 10.5-7.9 6.1-13.1L563.8 512z"], check: ["M912 190h-69.9c-9.8 0-19.1 4.5-25.1 12.2L404.7 724.5 207 474c-6.1-7.7-15.3-12.2-25.1-12.2H112c-6.7 0-10.4 7.7-6.3 12.9l273.9 347c12.8 16.2 37.4 16.2 50.3 0l488.4-618.9c4.1-5.1 0.4-12.8-6.3-12.8z"], info: ["M512 224m-64 0a64 64 0 1 0 128 0 64 64 0 1 0-128 0Z", "M544 392h-64c-4.4 0-8 3.6-8 8v464c0 4.4 3.6 8 8 8h64c4.4 0 8-3.6 8-8V400c0-4.4-3.6-8-8-8z"] }, Qt = ({ type: t, props: e }) => h("i", { ...e, children: h("svg", { viewBox: "0 0 1024 1024", width: "1em", height: "1em", fill: "currentColor", children: (Sr[t] || Sr.info).map((r, n) => h("path", { d: r }, n)) }) }), Dr = ({ className: t, content: e, icon: r, $close: n }) => D(x.Fragment, { children: [r && h("div", { className: j("ff-notification-icon", t), children: h(Qt, { type: r }) }), e] }), ni = ({}) => h(re, { children: "Confirm" }); var Te, Ke; const pe = class pe { constructor() { v(this, Ke, /* @__PURE__ */ new Map()); - N(this, "init", (e) => K(this, Ke, new Map(e))); - N(this, "check", (e) => !d(this, Ke).has(e) || d(this, Ke).get(e)); + O(this, "init", (e) => K(this, Ke, new Map(e))); + O(this, "check", (e) => !d(this, Ke).has(e) || d(this, Ke).get(e)); if (d(pe, Te)) return d(pe, Te); } }; -Te = new WeakMap(), Ke = new WeakMap(), v(pe, Te, null), N(pe, "getInstance", () => (d(pe, Te) || K(pe, Te, new pe()), d(pe, Te))); +Te = new WeakMap(), Ke = new WeakMap(), v(pe, Te, null), O(pe, "getInstance", () => (d(pe, Te) || K(pe, Te, new pe()), d(pe, Te))); let Bt = pe; -const Dr = Bt.getInstance(), ii = (t, e, r = "children") => { +const Mr = Bt.getInstance(), ii = (t, e, r = "children") => { if (w.isEmpty(t)) return {}; const n = w.find(t, ["value", e]); if (!w.isEmpty(n)) return n; @@ -91,31 +91,31 @@ const Dr = Bt.getInstance(), ii = (t, e, r = "children") => { if (!w.isEmpty(a)) return a; } return {}; -}, Mr = (t = "Input", e = "@pkg/ff/grid-layout-forms") => t != null && t.startsWith("@") || t != null && t.startsWith("blob:") ? t : `${e}/${t}`; -var Oe, et; +}, Br = (t = "Input", e = "@pkg/ff/grid-layout-forms") => t != null && t.startsWith("@") || t != null && t.startsWith("blob:") ? t : `${e}/${t}`; +var Oe, tt; const ge = class ge { constructor() { - v(this, et, null); - N(this, "init", (e) => K(this, et, e)); - N(this, "get", (e, r) => w.get(d(this, et), e, r)); + v(this, tt, null); + O(this, "init", (e) => K(this, tt, e)); + O(this, "get", (e, r) => w.get(d(this, tt), e, r)); if (d(ge, Oe)) return d(ge, Oe); } }; -Oe = new WeakMap(), et = new WeakMap(), v(ge, Oe, null), N(ge, "getInstance", () => (d(ge, Oe) || K(ge, Oe, new ge()), d(ge, Oe))); +Oe = new WeakMap(), tt = new WeakMap(), v(ge, Oe, null), O(ge, "getInstance", () => (d(ge, Oe) || K(ge, Oe, new ge()), d(ge, Oe))); let Ut = ge; const Ue = Ut.getInstance(); -var _e, kt, tt, rt, St; -const Ne = class Ne { +var _e, kt, rt, nt, St; +const ve = class ve { constructor(...e) { - v(this, tt, []); - v(this, rt, (e) => { + v(this, rt, []); + v(this, nt, (e) => { var r; - for (let n of e) Array.isArray(n[0]) ? d(this, rt).call(this, n) : d(this, tt).push(d(r = Ne, kt).call(r, n[0], n[1])); + for (let n of e) Array.isArray(n[0]) ? d(this, nt).call(this, n) : d(this, rt).push(d(r = ve, kt).call(r, n[0], n[1])); }); - N(this, "toValue", async (e, r = null) => { + O(this, "toValue", async (e, r = null) => { const n = { getValue: () => e, getRecord: () => r }; let i = e; - for (const o of d(this, tt)) try { + for (const o of d(this, rt)) try { const s = await o; if (typeof s != "function") { console.warn("middleware is not a function, skip:", s); @@ -127,29 +127,29 @@ const Ne = class Ne { } return i; }); - N(this, "toRender", (e, r, n = null) => E.createElement(d(this, St), { value: e, record: r }, n)); + O(this, "toRender", (e, r, n = null) => x.createElement(d(this, St), { value: e, record: r }, n)); v(this, St, ({ value: e, record: r, children: n }) => { - const [i, o] = L(n), s = An(); + const [i, o] = V(n), s = An(); return Yt(() => { o(n), this.toValue(e, r).then((a) => s() && o(a)).catch((a) => s() && o(`${a}`)); }, [e, r]), i; }); - d(this, rt).call(this, e); + d(this, nt).call(this, e); } }; -_e = new WeakMap(), kt = new WeakMap(), tt = new WeakMap(), rt = new WeakMap(), St = new WeakMap(), v(Ne, _e, null), v(Ne, kt, w.memoize((e, r) => { +_e = new WeakMap(), kt = new WeakMap(), rt = new WeakMap(), nt = new WeakMap(), St = new WeakMap(), v(ve, _e, null), v(ve, kt, w.memoize((e, r) => { if (typeof e == "function") return e(r); - if (typeof e == "string") return Z.getWidgetComponent(e).then((n) => { + if (typeof e == "string") return X.getWidgetComponent(e).then((n) => { var i; return ((i = n.default) == null ? void 0 : i.call(n, r)) || ((o) => o); }); throw new TypeError("middleware must be a string or a function"); }, (...e) => { var r; - return d(Ne, _e) || K(Ne, _e, Fi()), d(r = Ne, _e).call(r, ...e); + return d(ve, _e) || K(ve, _e, Fi()), d(r = ve, _e).call(r, ...e); })); -let bt = Ne; -const oe = E.createContext({ listCode: "", classNames: {}, getBase62params: (t, e) => { +let bt = ve; +const oe = x.createContext({ listCode: "", classNames: {}, getBase62params: (t, e) => { }, getSelectedRows: () => [], onReload: () => { }, onClickCallback: () => { }, onConditionChange: () => { @@ -165,30 +165,30 @@ const oe = E.createContext({ listCode: "", classNames: {}, getBase62params: (t, }, setSider: () => { }, setKeyword: () => { }, setCondition: () => { -} }), Sr = ({ className: t, record: e, column: r, ...n }) => { +} }), xr = ({ className: t, record: e, column: r, ...n }) => { if (r != null && r.editableByJs && (r != null && r.uuid)) { const { formSetting: i = { primaryKey: "id" }, widgetSetting: o = {}, widgetContainerSetting: s = {} } = (r == null ? void 0 : r.editableByJsSetting) || {}; - return m(R.Popover, { widget: Br, widgetData: { record: e, column: r }, widgetSetting: { widgetSetting: o, formSetting: i }, widgetContainerProps: { title: r != null && r.title ? `${r.title} - 编辑` : "编辑", width: 260, zIndex: 1050, arrow: !0, ...s }, children: m("td", { className: j("ff-data-list-cell-editable", t), ...n }) }); + return h(R.Popover, { widget: Ur, widgetData: { record: e, column: r }, widgetSetting: { widgetSetting: o, formSetting: i }, widgetContainerProps: { title: r != null && r.title ? `${r.title} - 编辑` : "编辑", width: 260, zIndex: 1050, arrow: !0, ...s }, children: h("td", { className: j("ff-data-list-cell-editable", t), ...n }) }); } - return m("td", { className: t, ...n }); -}, Br = ({ record: t, column: e, $close: r, $setting: n }) => { - const i = J(Oi(w.get(t, e == null ? void 0 : e.dataIndex))), { listCode: o, onClickCallback: s } = de(oe), [a] = ie.useForm(), { formSetting: l, widgetSetting: c } = n, { primaryKey: u = "id", help: p, validators: h } = l || {}, g = () => { + return h("td", { className: t, ...n }); +}, Ur = ({ record: t, column: e, $close: r, $setting: n }) => { + const i = H(Oi(w.get(t, e == null ? void 0 : e.dataIndex))), { listCode: o, onClickCallback: s } = de(oe), [a] = ie.useForm(), { formSetting: l, widgetSetting: c } = n, { primaryKey: u = "id", help: p, validators: m } = l || {}, g = () => { a.setFieldsValue({ value: w.get(t, e == null ? void 0 : e.dataIndex), __PROPS__: t }); }; - return vt(() => g(), [t, e == null ? void 0 : e.dataIndex, o]), m(re, { actions: I(E.Fragment, { children: [m(R, { size: "small", onClick: g, children: "重置" }), I(Dt.Compact, { block: !0, children: [m(R, { size: "small", widget: r, children: "取消" }), m(R, { type: "primary", size: "small", widget: () => a.validateFields().then(({ value: f }) => { + return Nt(() => g(), [t, e == null ? void 0 : e.dataIndex, o]), h(re, { actions: D(x.Fragment, { children: [h(R, { size: "small", onClick: g, children: "重置" }), D(Dt.Compact, { block: !0, children: [h(R, { size: "small", widget: r, children: "取消" }), h(R, { type: "primary", size: "small", widget: () => a.validateFields().then(({ value: f }) => { const y = w.get(t, u.substring(u.indexOf(".") + 1)); if (!y) throw "获取更新主键失败!"; B.put(`/api/${o}-storeBy-${e == null ? void 0 : e.uuid}/${y}`, { value: f }).msg(() => s(2, t)).then(r); - }).catch(console.warn), children: "保存" })] })] }), children: I(ie, { form: a, children: [m(nr, { label: "", code: "value", type: i.current, widget: e == null ? void 0 : e.editableByJs, help: p, extras: c, validators: h }), m(Xt, { noStyle: !0, name: ["__PROPS__"], children: () => { + }).catch(console.warn), children: "保存" })] })] }), children: D(ie, { form: a, children: [h(rr, { label: "", code: "value", type: i.current, widget: e == null ? void 0 : e.editableByJs, help: p, extras: c, validators: m }), h(Xt, { noStyle: !0, name: ["__PROPS__"], children: () => { } })] }) }); }; -Br.displayName = "DataListCellEditableContainer"; +Ur.displayName = "DataListCellEditableContainer"; const oi = (t) => function(e) { return t(e, getRecord()); }, si = async ({ widgetByJs: t, widgetByJsSetting: e }) => { - const r = await Z.getWidgetComponent(t).then((n) => n.default || ((i) => i)); + const r = await X.getWidgetComponent(t).then((n) => n.default || ((i) => i)); return function(n) { - return m(r, { value: n, $setting: e }); + return h(r, { value: n, $setting: e }); }; }, ai = (t, e = {}) => W(() => { var r; @@ -198,46 +198,46 @@ const oi = (t) => function(e) { }); }, [t, e]), li = (t = {}) => W(() => { var e; - return t.body ?? (t.body = { cell: Sr }), (e = t.body).cell ?? (e.cell = Sr), t; -}, [t]), No = (t) => { - const [e, r] = L({}); + return t.body ?? (t.body = { cell: xr }), (e = t.body).cell ?? (e.cell = xr), t; +}, [t]), vo = (t) => { + const [e, r] = V({}); return z(() => { let n = !1; return t && B.get(`/api/_/${t}`).then((i) => w.pick(i, ["uuid", "name", "code", "resource", "marginX", "marginY", "cols", "rowHeight", "primaryKey", "columns", "itemOperations", "batchOperations", "isConditionFormLayout", "layout", "tabs", "pageSize", "layoutConfig", "selectionType"])).then((i) => !n && r(i)), () => n = !0; }, [t]), e; }, To = (t, e = {}) => { - const [r, n] = L({ dataSource: [] }); + const [r, n] = V({ dataSource: [] }); return pt(() => { let i = !1; return t && B.get(`/api/${t}/${B.encode({ page: 1, ...e })}`).then((o) => !i && n(o)), () => i = !0; }, [t, e]), r; -}, Ur = (t = [], e = /* @__PURE__ */ new Map(), r = "id", n) => { - const i = H(n ? (o) => w.get(o, r, w.get(o, [n, r])) : (o) => w.get(o, r), [r, n]); - return H((o) => t == null ? void 0 : t.filter((s) => !s.uuid || !e.has(s.uuid) || e.get(s.uuid).some((a) => a == i(o))), [t, e, i]); +}, Wr = (t = [], e = /* @__PURE__ */ new Map(), r = "id", n) => { + const i = J(n ? (o) => w.get(o, r, w.get(o, [n, r])) : (o) => w.get(o, r), [r, n]); + return J((o) => t == null ? void 0 : t.filter((s) => !s.uuid || !e.has(s.uuid) || e.get(s.uuid).some((a) => a == i(o))), [t, e, i]); }, Wt = (t = [], e = /* @__PURE__ */ new Map(), r = [], n = "id", i) => { - const o = H(i ? (s) => w.get(s, n, w.get(s, [i, n])) : (s) => w.get(s, n), [n, i]); + const o = J(i ? (s) => w.get(s, n, w.get(s, [i, n])) : (s) => w.get(s, n), [n, i]); return W(() => { - if (w.isEmpty(t) || !t.some(({ uuid: a }) => Dr.check(a))) return !1; + if (w.isEmpty(t) || !t.some(({ uuid: a }) => Mr.check(a))) return !1; if (w.isEmpty(e) || w.isEmpty(r)) return !0; const s = r.map((a) => o(a)); return t.some(({ uuid: a }) => !a || !e.has(a) || e.get(a).some((l) => s.some((c) => c == l))); }, [t, r, e, o]); }, ci = (t, e, r = "id", n = null) => { - const i = Pt(), o = J(!1), s = J(t.dataSource), a = J(t.itemOperationsAccess); + const i = Pt(), o = H(!1), s = H(t.dataSource), a = H(t.itemOperationsAccess); return z(() => (s.current = t.dataSource, a.current = t.itemOperationsAccess, () => o.current = !1), [t.dataSource, t.itemOperationsAccess]), o.current && (t.dataSource = s.current, t.itemOperationsAccess = a.current), [t, (l = 0, c = null) => { var u, p; if (o.current = !1, l === 1) return (u = t.onReload) == null ? void 0 : u.call(t); if (l === 2) { - const h = w.get(c, "__PARENT_ID__", ""), g = w.get(c, r, w.get(c, [n, r], "")), f = w.findIndex(s.current, ["__PARENT_ID__", h]), y = w.findIndex(f > -1 ? w.get(s.current, [f, "children"]) : s.current, [r, g]); + const m = w.get(c, "__PARENT_ID__", ""), g = w.get(c, r, w.get(c, [n, r], "")), f = w.findIndex(s.current, ["__PARENT_ID__", m]), y = w.findIndex(f > -1 ? w.get(s.current, [f, "children"]) : s.current, [r, g]); if (y === -1) return (p = t.onReload) == null ? void 0 : p.call(t); Promise.all([B.get(`/api/${e}/detail/${g}`), B.post(`/api/${e}/list-operations-access`, { ids: g })]).then(([k, b]) => { - const x = w.get(s.current, f > -1 ? [f, "children", y, "children"] : [y, "children"]); - s.current = Ar(s.current, f > -1 ? { [f]: { children: { $splice: [[y, 1, { ...k, children: x }]] } } } : { $splice: [[y, 1, { ...k, children: x }]] }); - const S = new Map(b); + const E = w.get(s.current, f > -1 ? [f, "children", y, "children"] : [y, "children"]); + s.current = Ir(s.current, f > -1 ? { [f]: { children: { $splice: [[y, 1, { ...k, children: E }]] } } } : { $splice: [[y, 1, { ...k, children: E }]] }); + const C = new Map(b); a.current.forEach(($, F) => { - var A; - (A = S.get(F)) != null && A.some((O) => O == g) || a.current.set(F, $.filter((O) => O !== g)); - }), S.forEach(($, F) => { + var I; + (I = C.get(F)) != null && I.some((T) => T == g) || a.current.set(F, $.filter((T) => T !== g)); + }), C.forEach(($, F) => { a.current.has(F) ? a.current.set(F, w.uniq([...a.current.get(F) || [], ...$])) : a.current.set(F, $); }); }).then(() => { @@ -246,90 +246,90 @@ const oi = (t) => function(e) { } }]; }, di = (t, e) => { - const r = Pt(), n = J(e), i = J(/* @__PURE__ */ new Map()), o = J([]), s = w.throttle((l) => { - o.current = [], B.list(t, w.pick({ ...n.current, ...l }, ["tab", "page", "pageSize", "condition", "sider", "keyword"])).then(({ keyword: c, condition: u, total: p, tab: h, sider: g, page: f, pageSize: y, operationsAccess: k, dataSource: b }) => { - n.current = { tab: h, condition: u, sider: g, keyword: c, total: p, pageSize: y, page: b != null && b.length ? f : 1 }, o.current = b, i.current = new Map(k), r(); + const r = Pt(), n = H(e), i = H(/* @__PURE__ */ new Map()), o = H([]), s = w.throttle((l) => { + o.current = [], B.list(t, w.pick({ ...n.current, ...l }, ["tab", "page", "pageSize", "condition", "sider", "keyword"])).then(({ keyword: c, condition: u, total: p, tab: m, sider: g, page: f, pageSize: y, operationsAccess: k, dataSource: b }) => { + n.current = { tab: m, condition: u, sider: g, keyword: c, total: p, pageSize: y, page: b != null && b.length ? f : 1 }, o.current = b, i.current = new Map(k), r(); }); }, 380, { leading: !1, trailing: !0 }); - vt(() => { + Nt(() => { o.current = [], t && s(e); }, [t, e]); const a = W(() => w.pick(n.current, ["total", "tab", "page", "pageSize", "condition", "sider", "keyword", "primaryKey"]), [n.current]); - return Object.assign(a, { onTabChange: (l) => s({ tab: l, page: 1 }), onPageChange: (l, c) => s({ page: l, pageSize: c }), onPageSizeChange: (l) => s({ pageSize: l, page: 1 }), onConditionChange: (l, c) => s({ keyword: c, condition: Ar(n.current.condition || {}, { $merge: l || {} }), page: 1 }), onSiderChange: (l) => s({ sider: l, page: 1 }), onKeywordChange: (l) => s({ keyword: l, page: 1 }), itemOperationsAccess: i.current, dataSource: o.current, onReload: s, payload: e == null ? void 0 : e.payload }); -}, ui = ({ listCode: t, className: e, layouts: r = {}, dataSource: n, isPaginate: i, isItemOperations: o, isBatchOperations: s, batchOperations: a, itemOperations: l, itemOperationsAccess: c, resource: u, primaryKey: p, title: h, itemGridLayout: g, $setting: f, tabs: y, isConditionFormLayout: k, isTreeSider: b, treeSiderConfig: x, rowSelection: S }) => { - const { classNames: $, onClickCallback: F } = de(oe), A = w.pick(f, ["column", "colWidth", "beforeRender", "afterRender", "style", "itemMargin", "containerPadding"]), O = f == null ? void 0 : f.isMarkSelected, T = Ur(l, c, p, u), D = H((P, V, M) => m(pi, { isMarkSelected: O, className: j("ff-data-list-framework-item", $ == null ? void 0 : $.item), operations: o ? T(V) : [], data: u ? { [u]: V } : V, children: P, onClickCallback: F }), [O, u, p, o, F, l, c]); - return I("div", { className: j("ff-data-list-framework", e), children: [m(r.sider, { isTreeSider: b, ...x }), I("div", { className: j("ff-data-list-container", $ == null ? void 0 : $.container), children: [m(r.filter, { isConditionFormLayout: k }), m(r.toolbar, { title: h, tabs: y }), m(Pi, { ...g, ...A, rowSelection: S, empty: m(r.empty, { className: $ == null ? void 0 : $.empty }), primaryKey: p, itemRender: D, dataSource: n }), m(r.footer, { isPaginate: i, isOperations: s, operations: a })] })] }); -}, pi = ({ className: t, operations: e, children: r, data: n, onClickCallback: i, onSelect: o, isMarkSelected: s, isSelected: a, selectionType: l }) => I("div", { className: j("data-list-grid-layout-item", { "is-mark-selected": s, "is-selected": a, "is-selectable": !!l }, t), onClick: o, children: [m("div", { className: "data-list-grid-layout-item-container", children: r }), !!(e != null && e.length) && m("div", { className: "data-list-grid-layout-item-actions", children: e.map((c) => m("span", { className: "data-list-grid-layout-item-action", children: m(R.Link, { uuid: c.uuid, type: c.type, name: c.name, widget: c.widget, widgetType: c.widgetType, widgetProps: c.widgetProps, widgetSetting: c.widgetSetting, widgetContainerProps: c.widgetContainerSetting, data: n, confirm: c.confirm, onAfterClick: (u) => u !== !1 && (i == null ? void 0 : i(c.isRefresh, n)) }, c.uuid || Lt()) }, (c == null ? void 0 : c.uuid) || Lt())) })] }), gi = ({ listCode: t, className: e, layouts: r = {}, dataSource: n, columns: i, isItemOperations: o, isBatchOperations: s, batchOperations: a, itemOperations: l, itemOperationsAccess: c, resource: u, primaryKey: p, title: h, tabs: g, isPaginate: f, rowSelection: y, isTreeSider: k, treeSiderConfig: b, isConditionFormLayout: x, ...S }) => { - const { classNames: $, onClickCallback: F } = de(oe), A = Ur(l, c, p, u), O = Wt(l, c, n, p, u); - return I("div", { className: j("ff-data-table-framework", e), children: [m(r.sider, { isTreeSider: k, ...b }), I("div", { className: j("ff-data-table-container", $ == null ? void 0 : $.container), children: [m(r.filter, { isConditionFormLayout: x }), m(r.toolbar, { title: h, tabs: g }), m(Ci, { ...S, primaryKey: p, className: "ff-data-table-content", columns: i, dataSource: n, rowSelection: y, operationRender: O ? (T) => { - var D; - return m("div", { className: "ff-data-table-actions", children: (D = A(T)) == null ? void 0 : D.map((P, V) => m(R, { size: "small", uuid: P.uuid, type: P.type, name: P.name, widget: P.widget, widgetType: P.widgetType, widgetProps: P.widgetProps, widgetData: P.widgetData, widgetSetting: P.widgetSetting, widgetContainerProps: P.widgetContainerSetting, data: T, confirm: P.confirm, onAfterClick: (M) => M !== !1 && (F == null ? void 0 : F(P.isRefresh, T)) }, P.uuid || V)) }); - } : null }), m(r.footer, { isPaginate: f, isOperations: s, operations: a })] })] }); + return Object.assign(a, { onTabChange: (l) => s({ tab: l, page: 1 }), onPageChange: (l, c) => s({ page: l, pageSize: c }), onPageSizeChange: (l) => s({ pageSize: l, page: 1 }), onConditionChange: (l, c) => s({ keyword: c, condition: Ir(n.current.condition || {}, { $merge: l || {} }), page: 1 }), onSiderChange: (l) => s({ sider: l, page: 1 }), onKeywordChange: (l) => s({ keyword: l, page: 1 }), itemOperationsAccess: i.current, dataSource: o.current, onReload: s, payload: e == null ? void 0 : e.payload }); +}, ui = ({ listCode: t, className: e, layouts: r = {}, dataSource: n, isPaginate: i, isItemOperations: o, isBatchOperations: s, batchOperations: a, itemOperations: l, itemOperationsAccess: c, resource: u, primaryKey: p, title: m, itemGridLayout: g, $setting: f, tabs: y, isConditionFormLayout: k, isTreeSider: b, treeSiderConfig: E, rowSelection: C }) => { + const { classNames: $, onClickCallback: F } = de(oe), I = w.pick(f, ["column", "colWidth", "beforeRender", "afterRender", "style", "itemMargin", "containerPadding"]), T = f == null ? void 0 : f.isMarkSelected, N = Wr(l, c, p, u), A = J((P, L, M) => h(pi, { isMarkSelected: T, className: j("ff-data-list-framework-item", $ == null ? void 0 : $.item), operations: o ? N(L) : [], data: u ? { [u]: L } : L, children: P, onClickCallback: F }), [T, u, p, o, F, l, c]); + return D("div", { className: j("ff-data-list-framework", e), children: [h(r.sider, { isTreeSider: b, ...E }), D("div", { className: j("ff-data-list-container", $ == null ? void 0 : $.container), children: [h(r.filter, { isConditionFormLayout: k }), h(r.toolbar, { title: m, tabs: y }), h(Pi, { ...g, ...I, rowSelection: C, empty: h(r.empty, { className: $ == null ? void 0 : $.empty }), primaryKey: p, itemRender: A, dataSource: n }), h(r.footer, { isPaginate: i, isOperations: s, operations: a })] })] }); +}, pi = ({ className: t, operations: e, children: r, data: n, onClickCallback: i, onSelect: o, isMarkSelected: s, isSelected: a, selectionType: l }) => D("div", { className: j("data-list-grid-layout-item", { "is-mark-selected": s, "is-selected": a, "is-selectable": !!l }, t), onClick: o, children: [h("div", { className: "data-list-grid-layout-item-container", children: r }), !!(e != null && e.length) && h("div", { className: "data-list-grid-layout-item-actions", children: e.map((c) => h("span", { className: "data-list-grid-layout-item-action", children: h(R.Link, { uuid: c.uuid, type: c.type, name: c.name, widget: c.widget, widgetType: c.widgetType, widgetProps: c.widgetProps, widgetSetting: c.widgetSetting, widgetContainerProps: c.widgetContainerSetting, data: n, confirm: c.confirm, onAfterClick: (u) => u !== !1 && (i == null ? void 0 : i(c.isRefresh, n)) }, c.uuid || Lt()) }, (c == null ? void 0 : c.uuid) || Lt())) })] }), gi = ({ listCode: t, className: e, layouts: r = {}, dataSource: n, columns: i, isItemOperations: o, isBatchOperations: s, batchOperations: a, itemOperations: l, itemOperationsAccess: c, resource: u, primaryKey: p, title: m, tabs: g, isPaginate: f, rowSelection: y, isTreeSider: k, treeSiderConfig: b, isConditionFormLayout: E, ...C }) => { + const { classNames: $, onClickCallback: F } = de(oe), I = Wr(l, c, p, u), T = Wt(l, c, n, p, u); + return D("div", { className: j("ff-data-table-framework", e), children: [h(r.sider, { isTreeSider: k, ...b }), D("div", { className: j("ff-data-table-container", $ == null ? void 0 : $.container), children: [h(r.filter, { isConditionFormLayout: E }), h(r.toolbar, { title: m, tabs: g }), h(Ci, { ...C, primaryKey: p, className: "ff-data-table-content", columns: i, dataSource: n, rowSelection: y, operationRender: T ? (N) => { + var A; + return h("div", { className: "ff-data-table-actions", children: (A = I(N)) == null ? void 0 : A.map((P, L) => h(R, { size: "small", uuid: P.uuid, type: P.type, name: P.name, widget: P.widget, widgetType: P.widgetType, widgetProps: P.widgetProps, widgetData: P.widgetData, widgetSetting: P.widgetSetting, widgetContainerProps: P.widgetContainerSetting, data: N, confirm: P.confirm, onAfterClick: (M) => M !== !1 && (F == null ? void 0 : F(P.isRefresh, N)) }, P.uuid || L)) }); + } : null }), h(r.footer, { isPaginate: f, isOperations: s, operations: a })] })] }); }, er = (t = [], e, r = null) => { var n; - return (n = w.sortBy(t, ["y", "x"])) == null ? void 0 : n.map(({ i, x: o, y: s, w: a, h: l, field: { boxStyle: c, ...u } = {} }, p) => m("div", { className: "grid-layout-item", style: Wr(o, s, a, l, c), children: m(e, { ...u, basicForm: r }) }, i ?? p)); -}, Wr = (t, e, r, n, i = {}, o = 0) => { + return (n = w.sortBy(t, ["y", "x"])) == null ? void 0 : n.map(({ i, x: o, y: s, w: a, h: l, field: { boxStyle: c, ...u } = {} }, p) => h("div", { className: "grid-layout-item", style: zr(o, s, a, l, c), children: h(e, { ...u, basicForm: r }) }, i ?? p)); +}, zr = (t, e, r, n, i = {}, o = 0) => { const s = { "--grid-layout-h": `${n}`, "--grid-layout-w": `${r}`, "--grid-layout-x": `${t}`, "--grid-layout-y": `${e}`, "--grid-layout-row-height-offset": "0px" }; return i != null && i.autoHeight ? s.height = "fit-content" : s["--grid-layout-row"] = `${n}`, i != null && i.alignItems && (s["--grid-layout-box-align-items"] = i.alignItems), i != null && i.justifyContent && (s["--grid-layout-box-justify-content"] = i.justifyContent), s["--grid-layout-box-margin"] = Er(i == null ? void 0 : i.marginTop, i == null ? void 0 : i.marginRight, i == null ? void 0 : i.marginBottom, i == null ? void 0 : i.marginLeft), s["--grid-layout-box-padding"] = Er(i == null ? void 0 : i.paddingTop, i == null ? void 0 : i.paddingRight, i == null ? void 0 : i.paddingBottom, i == null ? void 0 : i.paddingLeft), o && (s.height = `${o}px`), s; -}, Er = (t, e, r, n) => `${t || 0}px ${e || 0}px ${r || 0}px ${n || 0}px`, Oo = (t = "Text", e = "@pkg/ff/grid-layouts") => t != null && t.startsWith("@") || t != null && t.startsWith("blob:") ? t : `${e}/${t}`, zr = (t) => Object.keys(t).reduce((e, r) => (/^on[A-Z]/.test(r) && (e[r] = t[r]), e), {}), qr = ({ className: t, isConditionFormLayout: e }) => { - var h, g; - const [r, n] = L({}), { listCode: i, onKeywordChange: o, onConditionChange: s, getBase62params: a, classNames: l } = E.useContext(oe), { keyword: c, condition: u } = (a == null ? void 0 : a()) || {}, [p] = ft.useForm(); +}, Er = (t, e, r, n) => `${t || 0}px ${e || 0}px ${r || 0}px ${n || 0}px`, Oo = (t = "Text", e = "@pkg/ff/grid-layouts") => t != null && t.startsWith("@") || t != null && t.startsWith("blob:") ? t : `${e}/${t}`, qr = (t) => Object.keys(t).reduce((e, r) => (/^on[A-Z]/.test(r) && (e[r] = t[r]), e), {}), Kr = ({ className: t, isConditionFormLayout: e }) => { + var m, g; + const [r, n] = V({}), { listCode: i, onKeywordChange: o, onConditionChange: s, getBase62params: a, classNames: l } = x.useContext(oe), { keyword: c, condition: u } = (a == null ? void 0 : a()) || {}, [p] = ft.useForm(); return z(() => { - i && e && B.get(`/api/_/${i}/list-condition-form-layout`).then(({ resource: f, marginX: y, marginY: k, rowHeight: b, cols: x, fields: S }) => { - n({ resource: f, itemMargin: [y, k], rowHeight: b, cols: x, fields: S }); + i && e && B.get(`/api/_/${i}/list-condition-form-layout`).then(({ resource: f, marginX: y, marginY: k, rowHeight: b, cols: E, fields: C }) => { + n({ resource: f, itemMargin: [y, k], rowHeight: b, cols: E, fields: C }); }).catch(() => n({})); }, [i, e]), z(() => { p.setFieldsValue({ keyword: c, ...u }); - }, [JSON.stringify([c, u])]), m("div", { className: j("ff-data-list-filter", l.filter, t), children: m(ft, { form: p, layout: "vertical", autoComplete: "off", onFinish: ((h = r.fields) == null ? void 0 : h.length) > 1 ? (f) => s({ [r.resource]: f[r.resource] }, f.keyword) : () => { + }, [JSON.stringify([c, u])]), h("div", { className: j("ff-data-list-filter", l.filter, t), children: h(ft, { form: p, layout: "vertical", autoComplete: "off", onFinish: ((m = r.fields) == null ? void 0 : m.length) > 1 ? (f) => s({ [r.resource]: f[r.resource] }, f.keyword) : () => { }, onValuesChange: (f) => { w.isEmpty(w.omit(f, ["keyword"])) || p.submit(); - }, children: ((g = r.fields) == null ? void 0 : g.length) > 1 ? m(ir, { ...r, children: m(mi, { onReset: () => { + }, children: ((g = r.fields) == null ? void 0 : g.length) > 1 ? h(nr, { ...r, children: h(hi, { onReset: () => { const { keyword: f, condition: y } = a("init") || {}; p.setFieldsValue({ keyword: f, ...y }); - } }) }) : m("div", { className: "ff-data-list-filter-default-form ff-grid-layout-form", children: m("div", { className: "grid-layout-item", style: Wr(20, 0, 5, 2), children: m(ft.Item, { name: ["keyword"], children: m(Mn.Search, { allowClear: !0, enterButton: "搜索", placeholder: "多关键字 | 分割", onSearch: (f) => o(f) }) }) }) }) }) }); -}, mi = ({ cols: t, fields: e, onReset: r }) => { - const [n, i] = L(!1), o = W(() => e == null ? void 0 : e.toReversed().some((s) => s.y > 1 || s.x + s.w >= t - 5), [t, e]); - return I(ft.Item, { label: " ", style: { "--item-span": 5 }, className: j("ff-data-list-filter-actions", { expanded: n }), children: [m(wt, { onClick: r, children: "重置" }), m(wt, { type: "primary", htmlType: "submit", children: "查询" }), o && m(R.Link, { className: "ff-data-list-filter-expanded-button", widget: () => i((s) => !s), type: "primary", name: n ? "关闭" : "展开", icon: n ? "icon-up" : "icon-down", iconPosition: "end" })] }); + } }) }) : h("div", { className: "ff-data-list-filter-default-form ff-grid-layout-form", children: h("div", { className: "grid-layout-item", style: zr(20, 0, 5, 2), children: h(ft.Item, { name: ["keyword"], children: h(Mn.Search, { allowClear: !0, enterButton: "搜索", placeholder: "多关键字 | 分割", onSearch: (f) => o(f) }) }) }) }) }) }); +}, hi = ({ cols: t, fields: e, onReset: r }) => { + const [n, i] = V(!1), o = W(() => e == null ? void 0 : e.toReversed().some((s) => s.y > 1 || s.x + s.w >= t - 5), [t, e]); + return D(ft.Item, { label: " ", style: { "--item-span": 5 }, className: j("ff-data-list-filter-actions", { expanded: n }), children: [h(wt, { onClick: r, children: "重置" }), h(wt, { type: "primary", htmlType: "submit", children: "查询" }), o && h(R.Link, { className: "ff-data-list-filter-expanded-button", widget: () => i((s) => !s), type: "primary", name: n ? "关闭" : "展开", icon: n ? "icon-up" : "icon-down", iconPosition: "end" })] }); }; -qr.reservedFields = [{ x: 0, y: 0, h: 3, w: 5, field: { isVirtual: !0, widgetPrefix: "@pkg/ff/grid-layout-forms", widget: "Input", code: "keyword", label: "关键字", placeholder: "多关键字 | 分割", extras: { prefix: "icon-search" } } }]; -const hi = ({ className: t, operations: e, isOperations: r, isPaginate: n }) => { - const { onPageChange: i, onPageSizeChange: o, onClickCallback: s, getBase62params: a } = E.useContext(oe), { total: l, page: c, pageSize: u } = (a == null ? void 0 : a()) || {}; - return r && !w.isEmpty(e) || n ? I("div", { className: j("ff-data-list-footer", t), children: [m("div", { className: "ff-data-list-actions", children: e == null ? void 0 : e.map((p, h) => m(R, { uuid: p.uuid, type: p.type, name: p.name, widget: p.widget, widgetType: p.widgetType, widgetProps: p.widgetProps, widgetData: p.widgetData, widgetSetting: p.widgetSetting, widgetContainerProps: p.widgetContainerSetting, onAfterClick: (g) => g !== !1 && (s == null ? void 0 : s(p.isRefresh, null)) }, p.uuid || h)) }), n && m(Bn, { size: "small", total: l, pageSize: u, showSizeChanger: !1, showTotal: (p) => `第 ${c} 页 / 总共 ${p} 条`, onChange: i, onShowSizeChange: o })] }) : null; -}, fi = [{ title: "parent 1", key: "0-0", children: [{ title: "parent 1-0", key: "0-0-0", disabled: !0, children: [{ title: "leaf", key: "0-0-0-0", disableCheckbox: !0 }, { title: "leaf", key: "0-0-0-1" }] }, { title: "parent 1-1", key: "0-0-1", children: [{ title: m("span", { style: { color: "#1677ff" }, children: "sss" }), key: "0-0-1-0" }] }] }], yi = ({ className: t, width: e = 280, isTreeSider: r }) => { +Kr.reservedFields = [{ x: 0, y: 0, h: 3, w: 5, field: { isVirtual: !0, widgetPrefix: "@pkg/ff/grid-layout-forms", widget: "Input", code: "keyword", label: "关键字", placeholder: "多关键字 | 分割", extras: { prefix: "icon-search" } } }]; +const mi = ({ className: t, operations: e, isOperations: r, isPaginate: n }) => { + const { onPageChange: i, onPageSizeChange: o, onClickCallback: s, getBase62params: a } = x.useContext(oe), { total: l, page: c, pageSize: u } = (a == null ? void 0 : a()) || {}; + return r && !w.isEmpty(e) || n ? D("div", { className: j("ff-data-list-footer", t), children: [h("div", { className: "ff-data-list-actions", children: e == null ? void 0 : e.map((p, m) => h(R, { uuid: p.uuid, type: p.type, name: p.name, widget: p.widget, widgetType: p.widgetType, widgetProps: p.widgetProps, widgetData: p.widgetData, widgetSetting: p.widgetSetting, widgetContainerProps: p.widgetContainerSetting, onAfterClick: (g) => g !== !1 && (s == null ? void 0 : s(p.isRefresh, null)) }, p.uuid || m)) }), n && h(Bn, { size: "small", total: l, pageSize: u, showSizeChanger: !1, showTotal: (p) => `第 ${c} 页 / 总共 ${p} 条`, onChange: i, onShowSizeChange: o })] }) : null; +}, fi = [{ title: "parent 1", key: "0-0", children: [{ title: "parent 1-0", key: "0-0-0", disabled: !0, children: [{ title: "leaf", key: "0-0-0-0", disableCheckbox: !0 }, { title: "leaf", key: "0-0-0-1" }] }, { title: "parent 1-1", key: "0-0-1", children: [{ title: h("span", { style: { color: "#1677ff" }, children: "sss" }), key: "0-0-1-0" }] }] }], yi = ({ className: t, width: e = 280, isTreeSider: r }) => { const { classNames: n } = de(oe); - return r ? m(Un.DirectoryTree, { className: j("ff-data-list-sider", n.sider, t), style: { "--sider-width": e }, showLine: !0, showIcon: !1, treeData: fi }) : null; + return r ? h(Un.DirectoryTree, { className: j("ff-data-list-sider", n.sider, t), style: { "--sider-width": e }, showLine: !0, showIcon: !1, treeData: fi }) : null; }, wi = ({ className: t, title: e, tabs: r }) => { const { getBase62params: n, onTabChange: i, onReload: o, classNames: s } = de(oe), { tab: a } = (n == null ? void 0 : n()) || {}, [l, c] = Jn((r == null ? void 0 : r[0].value) ?? (r == null ? void 0 : r[0].code), { value: a, onChange: i }); - return I("div", { className: j("ff-data-list-toolbar", s.toolbar, t), children: [m("div", { className: "ff-data-list-title", children: e }), m(Wn, { className: "ff-data-list-tabs", itemRender: ({ label: u, code: p, value: h }) => m("span", { onClick: () => c(h ?? p), className: j("ff-data-list-tab", { active: (h ?? p) == l }), children: u }), items: r }), I("div", { className: "ff-data-list-actions", children: [m(R.Link, { icon: "icon-reload", widget: () => o() }), m(R.Link, { icon: "icon-setting" })] })] }); -}, bi = ({ className: t, ...e }) => m(Mt, { className: j(t, "ff-data-list-empty"), image: Mt.PRESENTED_IMAGE_SIMPLE, ...e }), Kr = ({ isItemGridLayout: t, theme: e, themeProps: r, onClickCallback: n, onReload: i, listCode: o, total: s = 0, page: a = 0, onPageChange: l, pageSize: c = 30, onPageSizeChange: u, tab: p, onTabChange: h, keyword: g, onKeywordChange: f, condition: y, onConditionChange: k, sider: b, onSiderChange: x, layouts: S, classNames: $ = {}, payload: F = {}, dataSource: A = [], rowSelection: O, getSelectedRows: T, primaryKey: D, ...P }) => { - const [V, M] = L(), U = T ?? (() => A), X = H((q, se) => { + return D("div", { className: j("ff-data-list-toolbar", s.toolbar, t), children: [h("div", { className: "ff-data-list-title", children: e }), h(Wn, { className: "ff-data-list-tabs", itemRender: ({ label: u, code: p, value: m }) => h("span", { onClick: () => c(m ?? p), className: j("ff-data-list-tab", { active: (m ?? p) == l }), children: u }), items: r }), D("div", { className: "ff-data-list-actions", children: [h(R.Link, { icon: "icon-reload", widget: () => o() }), h(R.Link, { icon: "icon-setting" })] })] }); +}, bi = ({ className: t, ...e }) => h(Mt, { className: j(t, "ff-data-list-empty"), image: Mt.PRESENTED_IMAGE_SIMPLE, ...e }), _r = ({ isItemGridLayout: t, theme: e, themeProps: r, onClickCallback: n, onReload: i, listCode: o, total: s = 0, page: a = 0, onPageChange: l, pageSize: c = 30, onPageSizeChange: u, tab: p, onTabChange: m, keyword: g, onKeywordChange: f, condition: y, onConditionChange: k, sider: b, onSiderChange: E, layouts: C, classNames: $ = {}, payload: F = {}, dataSource: I = [], rowSelection: T, getSelectedRows: N, primaryKey: A, ...P }) => { + const [L, M] = V(), U = N ?? (() => I), Z = J((q, se) => { const _ = { tab: p, page: a, pageSize: c, keyword: g, sider: b, condition: y, total: s, payload: F }; return q && q != "init" ? w.get(_, q, se) : _; - }, [JSON.stringify(y), JSON.stringify(F), p, a, c, g, b, s]), Ee = W(() => { - let q = { sider: yi, filter: qr, footer: hi, toolbar: wi, empty: bi }; - S === !1 ? q = { sider: null, filter: null, footer: null, toolbar: null, empty: null } : w.isPlainObject(S) && (q = Object.assign({}, q, S)); + }, [JSON.stringify(y), JSON.stringify(F), p, a, c, g, b, s]), xe = W(() => { + let q = { sider: yi, filter: Kr, footer: mi, toolbar: wi, empty: bi }; + C === !1 ? q = { sider: null, filter: null, footer: null, toolbar: null, empty: null } : w.isPlainObject(C) && (q = Object.assign({}, q, C)); for (const se in q) if (q[se]) { - if (On(q[se])) { + if (Rn(q[se])) { const _ = q[se]; - q[se] = (mt) => E.cloneElement(_, mt); + q[se] = (ht) => x.cloneElement(_, ht); } - } else q[se] = () => m(E.Fragment, {}); + } else q[se] = () => h(x.Fragment, {}); return q; - }, [S]); + }, [C]); return z(() => { - e ? Z.getWidgetComponent(e).then((q) => { + e ? X.getWidgetComponent(e).then((q) => { if (!q) throw `${e} not found`; return q; - }).catch((q) => ({ default: () => `${q}` })).then((q) => M(E.createElement(q.default, { ...P, layouts: Ee, $setting: r }))) : M(m(t ? ui : gi, { ...P, layouts: Ee, $setting: r })); - }, [e, r]), m(oe.Provider, { value: { classNames: $, listCode: o, onClickCallback: n, onReload: i, getBase62params: X, onPageChange: l, onPageSizeChange: u, onTabChange: h, onSiderChange: x, onKeywordChange: f, onConditionChange: k, setPage: l, setPageSize: u, setTab: h, setSider: x, setKeyword: f, setCondition: k, getSelectedRows: U }, children: V && E.cloneElement(V, { dataSource: A, primaryKey: D, rowSelection: O, ...P }) }); + }).catch((q) => ({ default: () => `${q}` })).then((q) => M(x.createElement(q.default, { ...P, layouts: xe, $setting: r }))) : M(h(t ? ui : gi, { ...P, layouts: xe, $setting: r })); + }, [e, r]), h(oe.Provider, { value: { classNames: $, listCode: o, onClickCallback: n, onReload: i, getBase62params: Z, onPageChange: l, onPageSizeChange: u, onTabChange: m, onSiderChange: E, onKeywordChange: f, onConditionChange: k, setPage: l, setPageSize: u, setTab: m, setSider: E, setKeyword: f, setCondition: k, getSelectedRows: U }, children: L && x.cloneElement(L, { dataSource: I, primaryKey: A, rowSelection: T, ...P }) }); }; -Kr.propTypes = { classNames: C.exact({ sider: C.string, filter: C.string, footer: C.string, toolbar: C.string, container: C.string, content: C.string, item: C.string, empty: C.string }), layouts: C.oneOfType([C.exact({ sider: C.oneOfType([C.elementType, C.element]), filter: C.oneOfType([C.elementType, C.element]), footer: C.oneOfType([C.elementType, C.element]), toolbar: C.oneOfType([C.elementType, C.element]), empty: C.oneOfType([C.elementType, C.element]) }), C.bool]) }; -var Re, $e, Me, Et; -const me = class me { +_r.propTypes = { classNames: S.exact({ sider: S.string, filter: S.string, footer: S.string, toolbar: S.string, container: S.string, content: S.string, item: S.string, empty: S.string }), layouts: S.oneOfType([S.exact({ sider: S.oneOfType([S.elementType, S.element]), filter: S.oneOfType([S.elementType, S.element]), footer: S.oneOfType([S.elementType, S.element]), toolbar: S.oneOfType([S.elementType, S.element]), empty: S.oneOfType([S.elementType, S.element]) }), S.bool]) }; +var Re, $e, Me, xt; +const he = class he { constructor() { v(this, $e, null); v(this, Me, /* @__PURE__ */ new Map()); - v(this, Et, () => { + v(this, xt, () => { if (d(this, $e)) return d(this, $e).port.postMessage({ command: "status", data: [] }); K(this, $e, new SharedWorker(new URL("/ff-worker/res-ws.js", self.location))), d(this, $e).port.onmessage = (e) => { var r, n; @@ -341,240 +341,240 @@ const me = class me { }); }, d(this, $e).port.postMessage({ command: "status", data: [] }); }); - N(this, "subscribe", (e, r = []) => (r ? Array.isArray(r) && r.length == 0 ? r = "*" : Array.isArray(r) || (r = [r].flat()) : r = "*", d(this, Me).set(e, r), d(this, Me).size == 1 && d(this, Et).call(this), () => this.unsubscribe(e))); - N(this, "unsubscribe", (e) => d(this, Me).delete(e)); - if (d(me, Re)) return d(me, Re); + O(this, "subscribe", (e, r = []) => (r ? Array.isArray(r) && r.length == 0 ? r = "*" : Array.isArray(r) || (r = [r].flat()) : r = "*", d(this, Me).set(e, r), d(this, Me).size == 1 && d(this, xt).call(this), () => this.unsubscribe(e))); + O(this, "unsubscribe", (e) => d(this, Me).delete(e)); + if (d(he, Re)) return d(he, Re); } }; -Re = new WeakMap(), $e = new WeakMap(), Me = new WeakMap(), Et = new WeakMap(), v(me, Re, null), N(me, "getInstance", () => (d(me, Re) || K(me, Re, new me()), d(me, Re))); -let zt = me; -const _r = zt.getInstance(), tr = E.forwardRef(({ listCode: t, base62params: e, className: r, theme: n, themeProps: i, layouts: o, classNames: s, rowSelection: a = null, onDataSourceChange: l }, c) => { - const [{ resource: u, primaryKey: p, batchOperations: h = [], itemOperations: g = [], columns: f = [], isConditionFormLayout: y = !1, isTreeSider: k, treeSiderConfig: b, theme: x, themeConfig: S, isItemGridLayout: $, itemGridLayout: { themeConfig: F, ...A } = {}, title: O, isPaginate: T, tabs: D, selectionType: P }, V] = L({ isItemGridLayout: !1, itemGridLayout: {} }), { type: M = P, selectedRowKeys: U, defaultSelectedRowKeys: X, onChange: Ee, ...q } = a ?? {}, se = di(t, e), [{ dataSource: _, itemOperationsAccess: mt, condition: ln, tab: cn, keyword: dn, page: ar, total: lr, pageSize: cr, sider: un, onConditionChange: pn, onTabChange: gn, onKeywordChange: mn, onPageChange: hn, onPageSizeChange: fn, onSiderChange: yn, onReload: Tt, payload: wn }, dr] = ci(se, t, p, u), bn = wr(l); +Re = new WeakMap(), $e = new WeakMap(), Me = new WeakMap(), xt = new WeakMap(), v(he, Re, null), O(he, "getInstance", () => (d(he, Re) || K(he, Re, new he()), d(he, Re))); +let zt = he; +const Jr = zt.getInstance(), tr = x.forwardRef(({ listCode: t, base62params: e, className: r, theme: n, themeProps: i, layouts: o, classNames: s, rowSelection: a = null, onDataSourceChange: l }, c) => { + const [{ resource: u, primaryKey: p, batchOperations: m = [], itemOperations: g = [], columns: f = [], isConditionFormLayout: y = !1, isTreeSider: k, treeSiderConfig: b, theme: E, themeConfig: C, isItemGridLayout: $, itemGridLayout: { themeConfig: F, ...I } = {}, title: T, isPaginate: N, tabs: A, selectionType: P }, L] = V({ isItemGridLayout: !1, itemGridLayout: {} }), { type: M = P, selectedRowKeys: U, defaultSelectedRowKeys: Z, onChange: xe, ...q } = a ?? {}, se = di(t, e), [{ dataSource: _, itemOperationsAccess: ht, condition: cn, tab: dn, keyword: un, page: ar, total: lr, pageSize: cr, sider: pn, onConditionChange: gn, onTabChange: hn, onKeywordChange: mn, onPageChange: fn, onPageSizeChange: yn, onSiderChange: wn, onReload: Tt, payload: bn }, dr] = ci(se, t, p, u), Cn = br(l); Gt(() => { - bn(_, { primaryKey: p, page: ar, pageSize: cr, total: lr }); + Cn(_, { primaryKey: p, page: ar, pageSize: cr, total: lr }); }, [_]); - const [ur, Cn] = Dn([], { defaultValue: X ?? [], value: U }), [pr, kn] = L([]), gr = H(() => M ? pr : _, [M, pr, _]), Sn = Wt(g, mt, _, p), En = Wt(h); + const [ur, kn] = Dn([], { defaultValue: Z ?? [], value: U }), [pr, Sn] = V([]), gr = J(() => M ? pr : _, [M, pr, _]), xn = Wt(g, ht, _, p), En = Wt(m); z(() => { let Q = null; return t && B.get(`/api/_/${t}`).resp(({ data: Ie, res: Ot }) => { - Ie != null && Ie.isDynamicRefresh && (Q = _r.subscribe(() => Tt(), Ot)), V(Ie); - }).catch(() => V({})), () => Q == null ? void 0 : Q(); - }, [t]), E.useImperativeHandle(c, () => ({ onReload: Tt, onClickCallback: dr, getSelectedRows: gr })); - const mr = wr((Q, Ie) => { - kn((Ot) => { - const hr = new Map(Ot.map((ae) => [ae == null ? void 0 : ae[p], ae])); - return Ie.forEach((ae) => hr.set(ae == null ? void 0 : ae[p], ae)), Q.map((ae) => hr.get(ae)).filter(Boolean); - }), Cn(Q), Ee == null || Ee(Q, Ie); - }), xn = W(() => M ? { columnWidth: 80, ...q, type: M, selectedRowKeys: ur, onChange: mr } : void 0, [M, ur, mr, a]), $n = W(() => w.merge({}, S, i), [S, i]), Pn = W(() => g == null ? void 0 : g.map((Q) => w.isEmpty(Q == null ? void 0 : Q.confirm) ? Q : { ...Q, confirm: Object.assign({}, Q.confirm, { getPopupContainer: () => document.body }) }), [g]), vn = W(() => ({ ...A, themeProps: F }), [A, F]); - return m(Kr, { listCode: t, title: O, classNames: s, layouts: o, resource: u, primaryKey: p, theme: n || x, themeProps: $n, isTreeSider: k, treeSiderConfig: b, isPaginate: T, rowSelection: xn, getSelectedRows: gr, tabs: D, isItemOperations: Sn, itemOperations: Pn, isBatchOperations: En, batchOperations: h, isItemGridLayout: $, columns: f, itemGridLayout: vn, isConditionFormLayout: y, itemOperationsAccess: mt, dataSource: _, onConditionChange: pn, onTabChange: gn, onKeywordChange: mn, onPageChange: hn, onPageSizeChange: fn, onSiderChange: yn, condition: ln, tab: cn, keyword: dn, page: ar, total: lr, pageSize: cr, sider: un, payload: wn, className: j("ff-data-list-helper", r), onReload: Tt, onClickCallback: dr }); -}), Jr = (t, e, r = !0) => r !== !0 && r-- <= 0 ? [] : w.isArray(t) && !w.isEmpty(t) ? t.reduce((n, i) => (Reflect.has(i, e) && Reflect.has(i, "children") && n.push(i[e]), Reflect.has(i, "children") && !w.isEmpty(i.children) ? n.concat(Jr(i.children, e, r)) : n), []) : [], Ci = ({ className: t, primaryKey: e, columns: r = [], dataSource: n = [], operationRender: i, operationWidth: o = 180, components: s = {}, rowSelection: a, ...l }) => { - const { classNames: c } = de(oe), u = J(null), p = J(null), [h, g] = L([]), [f, y] = L({ width: 0, height: 0 }); + Ie != null && Ie.isDynamicRefresh && (Q = Jr.subscribe(() => Tt(), Ot)), L(Ie); + }).catch(() => L({})), () => Q == null ? void 0 : Q(); + }, [t]), x.useImperativeHandle(c, () => ({ onReload: Tt, onClickCallback: dr, getSelectedRows: gr })); + const hr = br((Q, Ie) => { + Sn((Ot) => { + const mr = new Map(Ot.map((ae) => [ae == null ? void 0 : ae[p], ae])); + return Ie.forEach((ae) => mr.set(ae == null ? void 0 : ae[p], ae)), Q.map((ae) => mr.get(ae)).filter(Boolean); + }), kn(Q), xe == null || xe(Q, Ie); + }), $n = W(() => M ? { columnWidth: 80, ...q, type: M, selectedRowKeys: ur, onChange: hr } : void 0, [M, ur, hr, a]), Pn = W(() => w.merge({}, C, i), [C, i]), Nn = W(() => g == null ? void 0 : g.map((Q) => w.isEmpty(Q == null ? void 0 : Q.confirm) ? Q : { ...Q, confirm: Object.assign({}, Q.confirm, { getPopupContainer: () => document.body }) }), [g]), vn = W(() => ({ ...I, themeProps: F }), [I, F]); + return h(_r, { listCode: t, title: T, classNames: s, layouts: o, resource: u, primaryKey: p, theme: n || E, themeProps: Pn, isTreeSider: k, treeSiderConfig: b, isPaginate: N, rowSelection: $n, getSelectedRows: gr, tabs: A, isItemOperations: xn, itemOperations: Nn, isBatchOperations: En, batchOperations: m, isItemGridLayout: $, columns: f, itemGridLayout: vn, isConditionFormLayout: y, itemOperationsAccess: ht, dataSource: _, onConditionChange: gn, onTabChange: hn, onKeywordChange: mn, onPageChange: fn, onPageSizeChange: yn, onSiderChange: wn, condition: cn, tab: dn, keyword: un, page: ar, total: lr, pageSize: cr, sider: pn, payload: bn, className: j("ff-data-list-helper", r), onReload: Tt, onClickCallback: dr }); +}), Hr = (t, e, r = !0) => r !== !0 && r-- <= 0 ? [] : w.isArray(t) && !w.isEmpty(t) ? t.reduce((n, i) => (Reflect.has(i, e) && Reflect.has(i, "children") && n.push(i[e]), Reflect.has(i, "children") && !w.isEmpty(i.children) ? n.concat(Hr(i.children, e, r)) : n), []) : [], Ci = ({ className: t, primaryKey: e, columns: r = [], dataSource: n = [], operationRender: i, operationWidth: o = 180, components: s = {}, rowSelection: a, ...l }) => { + const { classNames: c } = de(oe), u = H(null), p = H(null), [m, g] = V([]), [f, y] = V({ width: 0, height: 0 }); z(() => { - g(Jr(n, e)); - }, [n, e]), Rn(() => { - const S = new ResizeObserver(() => { + g(Hr(n, e)); + }, [n, e]), Fn(() => { + const C = new ResizeObserver(() => { var $; y({ width: (($ = u.current) == null ? void 0 : $.nativeElement.querySelector(".ant-table-body").scrollWidth) || p.current.offsetWidth, height: p.current.offsetHeight }); }); - return p.current && S.observe(p.current), () => { - p.current && S.unobserve(p.current); + return p.current && C.observe(p.current), () => { + p.current && C.unobserve(p.current); }; }, []); const k = W(() => { if (!(f != null && f.width) || !(r != null && r.length)) return r; - const S = (a ? a.columnWidth ?? 32 : 0) + (i ? o : 0), $ = r.reduce((O, T) => O + (T != null && T.isWidthFixed && T.width ? T.width : 0), 0), F = r.filter((O) => !(O != null && O.isWidthFixed)).reduce((O, T) => O + ((T == null ? void 0 : T.width) ?? 100), 0); - if ($ + F + S >= f.width) return r; - const A = f.width - $ - S; - return r.map((O) => O != null && O.isWidthFixed ? O : { ...O, width: Math.floor(A * ((O == null ? void 0 : O.width) ?? 100) / F) }); - }, [r, f.width, a, i, o]), b = ai(k), x = li(s); - return m("div", { ref: p, className: j("ff-data-list-table", c.content, t), children: f.height ? m(br, { bordered: !0, ...l, components: x, ref: u, rowKey: (S) => (S == null ? void 0 : S[e]) ?? Math.random(), rowSelection: a, columns: (() => { + const C = (a ? a.columnWidth ?? 32 : 0) + (i ? o : 0), $ = r.reduce((T, N) => T + (N != null && N.isWidthFixed && N.width ? N.width : 0), 0), F = r.filter((T) => !(T != null && T.isWidthFixed)).reduce((T, N) => T + ((N == null ? void 0 : N.width) ?? 100), 0); + if ($ + F + C >= f.width) return r; + const I = f.width - $ - C; + return r.map((T) => T != null && T.isWidthFixed ? T : { ...T, width: Math.floor(I * ((T == null ? void 0 : T.width) ?? 100) / F) }); + }, [r, f.width, a, i, o]), b = ai(k), E = li(s); + return h("div", { ref: p, className: j("ff-data-list-table", c.content, t), children: f.height ? h(Cr, { bordered: !0, ...l, components: E, ref: u, rowKey: (C) => (C == null ? void 0 : C[e]) ?? Math.random(), rowSelection: a, columns: (() => { var $, F; - const S = [...b ?? []]; - return a && S.splice((F = ($ = S[0]) == null ? void 0 : $.key) != null && F.startsWith("__") ? 1 : 0, 0, br.SELECTION_COLUMN), i && S.push({ title: "操作", align: "center", fixed: "right", className: "ff-data-list-table-operations", width: `${Math.ceil(o / f.width * 100).toFixed(2)}%`, render: (A, O, T) => i(O, T) }), S; - })(), dataSource: n, size: "middle", scroll: { x: "max-content", y: f.height - 50 }, pagination: !1, expandable: { defaultExpandAllRows: !0, expandRowByClick: !0, onExpandedRowsChange: g, expandedRowKeys: h } }) : null }); + const C = [...b ?? []]; + return a && C.splice((F = ($ = C[0]) == null ? void 0 : $.key) != null && F.startsWith("__") ? 1 : 0, 0, Cr.SELECTION_COLUMN), i && C.push({ title: "操作", align: "center", fixed: "right", className: "ff-data-list-table-operations", width: `${Math.ceil(o / f.width * 100).toFixed(2)}%`, render: (I, T, N) => i(T, N) }), C; + })(), dataSource: n, size: "middle", scroll: { x: "max-content", y: f.height - 50 }, pagination: !1, expandable: { defaultExpandAllRows: !0, expandRowByClick: !0, onExpandedRowsChange: g, expandedRowKeys: m } }) : null }); }, ki = "RC_FORM_INTERNAL_HOOKS", Si = (t) => { - const [e, r] = E.useState({ items: [] }); + const [e, r] = x.useState({ items: [] }); return z(() => { - t && B.get(`/api/_/${t}`).then(({ uuid: n, code: i, name: o, resource: s, primaryKey: a, marginX: l, marginY: c, cols: u, rowHeight: p, fields: h, theme: g, themeSetting: f, groups: y }) => ({ uuid: n, code: i, name: o, resource: s, primaryKey: a, marginX: l, marginY: c, cols: u, rowHeight: p, theme: g, themeProps: f, groups: y, items: h })).then(r); + t && B.get(`/api/_/${t}`).then(({ uuid: n, code: i, name: o, resource: s, primaryKey: a, marginX: l, marginY: c, cols: u, rowHeight: p, fields: m, theme: g, themeSetting: f, groups: y }) => ({ uuid: n, code: i, name: o, resource: s, primaryKey: a, marginX: l, marginY: c, cols: u, rowHeight: p, theme: g, themeProps: f, groups: y, items: m })).then(r); }, [t]), e; -}, Ei = (t, { initialValue: e, initialValueLanguage: r, convertJs: n, convertJsSetting: i, type: o = "string" }, s = null) => { - const a = J(!1), l = de(jr), [c, u] = L(), [p, h] = L(r != "javascript" && t ? l.getFieldValue(t) : void 0), { registerWatch: g } = l.getInternalHooks(ki) || {}; +}, xi = (t, { initialValue: e, initialValueLanguage: r, convertJs: n, convertJsSetting: i, type: o = "string" }, s = null) => { + const a = H(!1), l = de(Ar), [c, u] = V(), [p, m] = V(r != "javascript" && t ? l.getFieldValue(t) : void 0), { registerWatch: g } = l.getInternalHooks(ki) || {}; return z(() => g == null ? void 0 : g((f, y, k) => { if (!a.current) return; const b = w.get(y, t); - w.isEqual(b, p) || h(ce(b, o)); + w.isEqual(b, p) || m(ce(b, o)); }), [p]), z(() => { - r == "javascript" && e ? We.exec(e, {}, { getFieldValueForBasicForm: (f) => s ? s.getFieldValue(f) : l.getFieldValue(f), getFieldValue: (f) => l.getFieldValue(f) }).then((f) => h(ce(f, o))).catch((f) => notification.error({ message: `布局数据错误: ${JSON.stringify(f)}` })).finally(() => a.current = !0) : (e && h(ce(e ?? l.getFieldValue(t), o)), a.current = !0); + r == "javascript" && e ? We.exec(e, {}, { getFieldValueForBasicForm: (f) => s ? s.getFieldValue(f) : l.getFieldValue(f), getFieldValue: (f) => l.getFieldValue(f) }).then((f) => m(ce(f, o))).catch((f) => notification.error({ message: `布局数据错误: ${JSON.stringify(f)}` })).finally(() => a.current = !0) : (e && m(ce(e ?? l.getFieldValue(t), o)), a.current = !0); }, [e, r]), pt(() => { a.current && n && new bt([n, i]).toValue(p, l.getFieldsValue(!0)).then(u).catch((f) => { u(f), console.error("布局数据转换错误: ", f, n); }); }, [p, n, i]), [c ?? p, p]; -}, Ro = (t, e, r = null) => W(() => er(t, e, r), [t]), Hr = (t, e, r = {}, n = {}, i = {}, o = null) => { - const s = de(jr), a = Pt(), l = J(!0), c = J([]), [u, p] = L(e), [h, g] = L(), f = ie.useWatch((y) => JSON.stringify(w.pick(y, c.current)), s) || "{}"; - return vt(() => { +}, Ro = (t, e, r = null) => W(() => er(t, e, r), [t]), Yr = (t, e, r = {}, n = {}, i = {}, o = null) => { + const s = de(Ar), a = Pt(), l = H(!0), c = H([]), [u, p] = V(e), [m, g] = V(), f = ie.useWatch((y) => JSON.stringify(w.pick(y, c.current)), s) || "{}"; + return Nt(() => { t && We.exec(t, r, { ...n, getFieldValueForBasicForm: (y) => i ? i.getFieldValue(y) : null, getFieldValue: w.wrap(s.getFieldValue, (y, k) => (c.current.some((b) => w.isEqual(b, k)) || (c.current.push(k), a()), y == null ? void 0 : y(k))), isFieldTouched: s.isFieldTouched, isFieldsTouched: s.isFieldsTouched }).then((y) => { l.current && (p(y), g(null)); }).catch((y) => { l.current && (p(e), g(y)); }); - }, [t, f, s, r, n]), z(() => () => l.current = !1, []), t ? [o ? ce(u, o) : u, h] : [o ? ce(e, o) : e, null]; -}, xi = ({ widget: t, widgetPrefix: e = "@pkg/ff/grid-layouts", basicForm: r, ...n }) => { - const i = t != null && t.startsWith("@") || t != null && t.startsWith("blob:") ? t : `${e}/${t}`, [o, s] = L(); + }, [t, f, s, r, n]), z(() => () => l.current = !1, []), t ? [o ? ce(u, o) : u, m] : [o ? ce(e, o) : e, null]; +}, Ei = ({ widget: t, widgetPrefix: e = "@pkg/ff/grid-layouts", basicForm: r, ...n }) => { + const i = t != null && t.startsWith("@") || t != null && t.startsWith("blob:") ? t : `${e}/${t}`, [o, s] = V(); return z(() => { - i && Z.getWidgetComponent(i).then(({ defaultProps: a = {}, default: l }) => ({ default: $i(l, a, r) })).catch((a) => ({ default: () => `${a}` })).then((a) => s(E.createElement(a.default, n))); + i && X.getWidgetComponent(i).then(({ defaultProps: a = {}, default: l }) => ({ default: $i(l, a, r) })).catch((a) => ({ default: () => `${a}` })).then((a) => s(x.createElement(a.default, n))); }, [i]), o; }, $i = (t, e = {}, r = null) => (n) => { - const { code: i, label: o, extras: s, isVirtual: a, initialValue: l, initialValueLanguage: c, convertJs: u, convertJsSetting: p, value: h, ...g } = w.merge({}, e, n), [f, y] = Ei(a ? null : i, { initialValue: l, initialValueLanguage: c, convertJs: u, convertJsSetting: p, type: (g == null ? void 0 : g.type) || "string" }, r), k = W(() => { - const S = Object.keys((e == null ? void 0 : e.extras) || {}); - return w.over([w.partialRight(w.pick, S), w.partialRight(w.omit, S)]); - }, [e == null ? void 0 : e.extras]), [b, x] = k(g); - return m(t, { ...x, value: f, rawValue: y, $setting: Object.assign({}, s, b) }); -}, Yr = ({ theme: t, basicForm: e, items: r = [{ key: "default", label: "默认" }], fields: n = [], itemRender: i, chunks: o = [], children: s, $setting: a = {}, ...l }) => { - const [c, u] = L(); + const { code: i, label: o, extras: s, isVirtual: a, initialValue: l, initialValueLanguage: c, convertJs: u, convertJsSetting: p, value: m, ...g } = w.merge({}, e, n), [f, y] = xi(a ? null : i, { initialValue: l, initialValueLanguage: c, convertJs: u, convertJsSetting: p, type: (g == null ? void 0 : g.type) || "string" }, r), k = W(() => { + const C = Object.keys((e == null ? void 0 : e.extras) || {}); + return w.over([w.partialRight(w.pick, C), w.partialRight(w.omit, C)]); + }, [e == null ? void 0 : e.extras]), [b, E] = k(g); + return h(t, { ...E, value: f, rawValue: y, $setting: Object.assign({}, s, b) }); +}, Gr = ({ theme: t, basicForm: e, items: r = [{ key: "default", label: "默认" }], fields: n = [], itemRender: i, chunks: o = [], children: s, $setting: a = {}, ...l }) => { + const [c, u] = V(); z(() => { - t ? Z.getWidgetComponent(t).then((h) => { - if (!(h != null && h.default)) throw "not found"; - return h; - }).catch((h) => ({ default: () => `${t} ${h}` })).then((h) => u(E.createElement(h.default, {}))) : u(null); + t ? X.getWidgetComponent(t).then((m) => { + if (!(m != null && m.default)) throw "not found"; + return m; + }).catch((m) => ({ default: () => `${t} ${m}` })).then((m) => u(x.createElement(m.default, {}))) : u(null); }, [t]); - const p = W(() => r == null ? void 0 : r.map((h) => ({ ...h, children: i(h, n == null ? void 0 : n.filter((g) => !(g != null && g.group) && h.key == "default" || g.group == h.key), h.key == "default" ? s : null) })).concat(o), [r, s, o]); - return c && E.cloneElement(c, { items: p, basicForm: e, $setting: { ...a, ...l } }); -}, Gr = ({ name: t, form: e = null, basicForm: r = null, style: n = {}, className: i, cols: o = 12, rowHeight: s = 21, containerPadding: a = [0, 0], itemMargin: l = [4, 0], formProps: c = {}, formFields: u = [], fields: p = [], data: h, theme: g, themeProps: f = {}, groups: y = [{ key: "default", label: "默认" }], children: k, ...b }) => { - const [x] = ie.useForm(e), S = W(() => [{ name: "__PROPS__", value: c }].concat(u), [c, u]); - pt(() => (x.setFieldsValue(h), () => x.resetFields()), [h]); - const $ = (F, A, O) => { - const T = er(A, xi, r), D = zr(b); - return I("div", { ...D, className: j("ff-grid-layout", i), style: { ...n, "--grid-layout-item-margin-y": `${(l == null ? void 0 : l[0]) || 0}px`, "--grid-layout-item-margin-x": `${(l == null ? void 0 : l[1]) || 0}px`, "--grid-layout-container-padding-y": `${(a == null ? void 0 : a[0]) || 0}px`, "--grid-layout-container-padding-x": `${(a == null ? void 0 : a[1]) || 0}px`, "--grid-layout-cols": o, "--grid-layout-row-height": `${s}px` }, children: [T, O && E.cloneElement(O, { cols: o, rowHeight: s, itemMargin: l, containerPadding: a, fields: A, basicForm: r })] }); + const p = W(() => r == null ? void 0 : r.map((m) => ({ ...m, children: i(m, n == null ? void 0 : n.filter((g) => !(g != null && g.group) && m.key == "default" || g.group == m.key), m.key == "default" ? s : null) })).concat(o), [r, s, o]); + return c && x.cloneElement(c, { items: p, basicForm: e, $setting: { ...a, ...l } }); +}, Xr = ({ name: t, form: e = null, basicForm: r = null, style: n = {}, className: i, cols: o = 12, rowHeight: s = 21, containerPadding: a = [0, 0], itemMargin: l = [4, 0], formProps: c = {}, formFields: u = [], fields: p = [], data: m, theme: g, themeProps: f = {}, groups: y = [{ key: "default", label: "默认" }], children: k, ...b }) => { + const [E] = ie.useForm(e), C = W(() => [{ name: "__PROPS__", value: c }].concat(u), [c, u]); + pt(() => (E.setFieldsValue(m), () => E.resetFields()), [m]); + const $ = (F, I, T) => { + const N = er(I, Ei, r), A = qr(b); + return D("div", { ...A, className: j("ff-grid-layout", i), style: { ...n, "--grid-layout-item-margin-y": `${(l == null ? void 0 : l[0]) || 0}px`, "--grid-layout-item-margin-x": `${(l == null ? void 0 : l[1]) || 0}px`, "--grid-layout-container-padding-y": `${(a == null ? void 0 : a[0]) || 0}px`, "--grid-layout-container-padding-x": `${(a == null ? void 0 : a[1]) || 0}px`, "--grid-layout-cols": o, "--grid-layout-row-height": `${s}px` }, children: [N, T && x.cloneElement(T, { cols: o, rowHeight: s, itemMargin: l, containerPadding: a, fields: I, basicForm: r })] }); }; - return m(ie, { ...b, fields: S, form: x, component: !1, children: g ? m(Yr, { ...f, items: y, theme: g, itemRender: $, fields: p, children: k, basicForm: r }) : $(0, p, k) }); + return h(ie, { ...b, fields: C, form: E, component: !1, children: g ? h(Gr, { ...f, items: y, theme: g, itemRender: $, fields: p, children: k, basicForm: r }) : $(0, p, k) }); }, Fo = /* @__PURE__ */ ((t) => function({ code: e, data: r, ...n }) { - const { uuid: i, resource: o, items: s, hides: a, rowHeight: l, marginX: c, marginY: u, cols: p, theme: h, themeProps: g, groups: f } = Si(e) || {}, y = W(() => [{ name: "__RESOURCE__", value: o }, { name: "__LAYOUT_KEY__", value: e }, { name: "__LAYOUT_UUID__", value: i }], [e, i, o]); - return o && m(t, { name: e, theme: h, themeProps: g, groups: f, ...n, fields: s, formFields: y, rowHeight: l, cols: p, itemMargin: [c, u], data: o ? { [o]: r } : r }); -})(Gr), Pi = ({ column: t = 0, colWidth: e = 0, cols: r, rowHeight: n, itemMargin: i, containerPadding: o, fields: s, primaryKey: a, dataSource: l, beforeRender: c = null, afterRender: u = null, itemClassName: p, itemRender: h = ($, F, A) => $, empty: g = m(Mt, { description: null }), className: f, style: y = {}, theme: k, themeProps: b = {}, groups: x = [{ key: "default", label: "默认" }], rowSelection: S }) => { - const { classNames: $ } = de(oe), F = H((T) => { - if (!S) return; - const { selectedRowKeys: D = [], onChange: P, type: V = "checkbox" } = S, M = T == null ? void 0 : T[a]; + const { uuid: i, resource: o, items: s, hides: a, rowHeight: l, marginX: c, marginY: u, cols: p, theme: m, themeProps: g, groups: f } = Si(e) || {}, y = W(() => [{ name: "__RESOURCE__", value: o }, { name: "__LAYOUT_KEY__", value: e }, { name: "__LAYOUT_UUID__", value: i }], [e, i, o]); + return o && h(t, { name: e, theme: m, themeProps: g, groups: f, ...n, fields: s, formFields: y, rowHeight: l, cols: p, itemMargin: [c, u], data: o ? { [o]: r } : r }); +})(Xr), Pi = ({ column: t = 0, colWidth: e = 0, cols: r, rowHeight: n, itemMargin: i, containerPadding: o, fields: s, primaryKey: a, dataSource: l, beforeRender: c = null, afterRender: u = null, itemClassName: p, itemRender: m = ($, F, I) => $, empty: g = h(Mt, { description: null }), className: f, style: y = {}, theme: k, themeProps: b = {}, groups: E = [{ key: "default", label: "默认" }], rowSelection: C }) => { + const { classNames: $ } = de(oe), F = J((N) => { + if (!C) return; + const { selectedRowKeys: A = [], onChange: P, type: L = "checkbox" } = C, M = N == null ? void 0 : N[a]; let U; - U = V === "radio" ? [M] : D.includes(M) ? D.filter((X) => X !== M) : [...D, M], P == null || P(U, l.filter((X) => U.includes(X == null ? void 0 : X[a]))); - }, [S, a, l]), A = W(() => m(Gr, { groups: x, theme: k, themeProps: b, cols: r, rowHeight: n, itemMargin: i, containerPadding: o, fields: s, className: p }), [s, r, n, i, o, x, k, b]), O = w.isEmpty(l); - return I("div", { className: j("ff-data-list-content", $.content, f), style: Object.assign({}, y, t && { "--col-num": t }, e && { "--col-width": e }), children: [c == null ? void 0 : c(l), O ? g : l.map((T, D) => { + U = L === "radio" ? [M] : A.includes(M) ? A.filter((Z) => Z !== M) : [...A, M], P == null || P(U, l.filter((Z) => U.includes(Z == null ? void 0 : Z[a]))); + }, [C, a, l]), I = W(() => h(Xr, { groups: E, theme: k, themeProps: b, cols: r, rowHeight: n, itemMargin: i, containerPadding: o, fields: s, className: p }), [s, r, n, i, o, E, k, b]), T = w.isEmpty(l); + return D("div", { className: j("ff-data-list-content", $.content, f), style: Object.assign({}, y, t && { "--col-num": t }, e && { "--col-width": e }), children: [c == null ? void 0 : c(l), T ? g : l.map((N, A) => { var U; - const P = (T == null ? void 0 : T[a]) ?? D, V = `${P}-${Ri(T)}`, M = h(E.cloneElement(A, { data: T }), T, D); - return E.cloneElement(M, { key: V, ...S && { isSelected: (U = S == null ? void 0 : S.selectedRowKeys) == null ? void 0 : U.includes(P), selectionType: S.type ?? "checkbox", onSelect: () => F(T) } }); + const P = (N == null ? void 0 : N[a]) ?? A, L = `${P}-${Ri(N)}`, M = m(x.cloneElement(I, { data: N }), N, A); + return x.cloneElement(M, { key: L, ...C && { isSelected: (U = C == null ? void 0 : C.selectedRowKeys) == null ? void 0 : U.includes(P), selectionType: C.type ?? "checkbox", onSelect: () => F(N) } }); }), u == null ? void 0 : u(l)] }); -}, vi = ({ component: t, $props: e }) => { +}, Ni = ({ component: t, $props: e }) => { const { base62params: r } = $t(e, {}); - return m(re, { children: m(tr, { listCode: t, base62params: B.decode(r) }) }); -}, jo = () => m(Xr, {}), Xr = () => "Empty", Ni = ({ component: t, $setting: e, $props: r }) => { - const [n, i] = L(), [o, s] = rr(r); + return h(re, { children: h(tr, { listCode: t, base62params: B.decode(r) }) }); +}, jo = () => h(Zr, {}), Zr = () => "Empty", vi = ({ component: t, $setting: e, $props: r }) => { + const [n, i] = V(), [o, s] = nn(r); return z(() => { - if (!t) return i(m(Xr, { description: null })); - Z.getWidgetComponent(t).catch((a) => ({ default: () => `${a}` })).then((a) => E.createElement(a.default, { $setting: e })).then(i); - }, [t]), n ? E.cloneElement(n, { ...o, $setProps: s }) : null; + if (!t) return i(h(Zr, { description: null })); + X.getWidgetComponent(t).catch((a) => ({ default: () => `${a}` })).then((a) => x.createElement(a.default, { $setting: e })).then(i); + }, [t]), n ? x.cloneElement(n, { ...o, $setProps: s }) : null; }, Ao = () => "NotFoundPage"; -var Fe, le, je, ye, nt, it; -const he = class he { +var Fe, le, je, ye, it, ot; +const me = class me { constructor() { v(this, le, /* @__PURE__ */ new Map()); v(this, je, {}); v(this, ye, null); - N(this, "init", (e, r) => { + O(this, "init", (e, r) => { K(this, le, e), K(this, je, r); }); - N(this, "get", (e) => (d(this, le).has(e) || (e = Array.from(d(this, le).keys()).find((r) => d(this, le).get(r).uri === e)), d(this, le).get(e) || {})); - N(this, "redirect", (e, r, n = {}) => { + O(this, "get", (e) => (d(this, le).has(e) || (e = Array.from(d(this, le).keys()).find((r) => d(this, le).get(r).uri === e)), d(this, le).get(e) || {})); + O(this, "redirect", (e, r, n = {}) => { var f; const { uri: i, type: o, widgetProps: s } = this.get(e) || {}, { router: a, query: l, ...c } = r || {}, u = Object.assign({}, c, a), p = Object.assign({}, c, l); o == "list" && (u.base62params = B.encode(u != null && u.base62params ? u.base62params : u)); - let h = Hn(i || e, u); + let m = Hn(i || e, u); const g = new URLSearchParams(); for (const y in s || {}) ((f = s[y]) == null ? void 0 : f.type) == "query" && Object.has(p, y) && g.append(y, JSON.stringify(p[y])); - return g.size > 0 && (h = `${h}?${g.toString()}`), n != null && n.isOpenWindow ? window.open(h) : d(this, ye).navigate(h, { replace: !!(n != null && n.isReplaceRouteHistory) }); + return g.size > 0 && (m = `${m}?${g.toString()}`), n != null && n.isOpenWindow ? window.open(m) : d(this, ye).navigate(m, { replace: !!(n != null && n.isReplaceRouteHistory) }); }); - N(this, "getMenus", (e) => { + O(this, "getMenus", (e) => { var r; return ((r = d(this, je)) == null ? void 0 : r[e]) || []; }); - N(this, "findMenuPathByUuid", (e) => { + O(this, "findMenuPathByUuid", (e) => { let r = []; - for (const n in d(this, je)) if (r = d(this, nt).call(this, d(this, je)[n], e, [n]), r.length > 1) return r; + for (const n in d(this, je)) if (r = d(this, it).call(this, d(this, je)[n], e, [n]), r.length > 1) return r; return r; }); - N(this, "getMenusByRouteUuid", (e) => d(this, it).call(this, e, Object.values(d(this, je)).flat())); - v(this, nt, (e, r, n = []) => { + O(this, "getMenusByRouteUuid", (e) => d(this, ot).call(this, e, Object.values(d(this, je)).flat())); + v(this, it, (e, r, n = []) => { if (w.isEmpty(e)) return n; for (const { uuid: i, children: o } of e) { if (i == r) return n.concat(i); - if (!w.isEmpty(o)) return n.concat(i, d(this, nt).call(this, o, r)); + if (!w.isEmpty(o)) return n.concat(i, d(this, it).call(this, o, r)); } return n; }); - v(this, it, (e, r) => { + v(this, ot, (e, r) => { var i; let n = []; - for (const o of r) o.widgetType == "redirect" && (o.uuid == e || o.widget == e ? n.push(o) : (i = o.children) != null && i.length && (n = n.concat(d(this, it).call(this, e, o.children)))); + for (const o of r) o.widgetType == "redirect" && (o.uuid == e || o.widget == e ? n.push(o) : (i = o.children) != null && i.length && (n = n.concat(d(this, ot).call(this, e, o.children)))); return n; }); - N(this, "getCurrentMenu", () => { + O(this, "getCurrentMenu", () => { const { uuid: e } = this.getCurrentRoute() || {}; if (!e) return; const r = this.getMenusByRouteUuid(e); return w.isEmpty(r) ? void 0 : r[0]; }); - N(this, "getCurrentRoute", (e = 0) => { + O(this, "getCurrentRoute", (e = 0) => { var n; const r = (n = d(this, ye).state.matches[d(this, ye).state.matches.length - 1 - e]) == null ? void 0 : n.route; if (!r) return null; for (let [i, o] of d(this, le)) if (o.uri === r.path) return o; return null; }); - N(this, "getPageParams", (e) => { + O(this, "getPageParams", (e) => { var s, a; const { location: r = {}, matches: n = [] } = ((s = d(this, ye)) == null ? void 0 : s.state) || {}, i = { ...((a = n[n.length - 1]) == null ? void 0 : a.params) || {} }, o = r.search; return o && new URLSearchParams(o).forEach((l, c) => { i[c] = l; }), e ? w.get(i, e) : i; }); - N(this, "usePageParams", (e) => { + O(this, "usePageParams", (e) => { var n; - let r = Ir() ? { ...Yn(), ...Object.fromEntries(new URLSearchParams(((n = Gn()) == null ? void 0 : n.search) ?? "")) } : this.getPageParams(); + let r = Lr() ? { ...Yn(), ...Object.fromEntries(new URLSearchParams(((n = Gn()) == null ? void 0 : n.search) ?? "")) } : this.getPageParams(); return e ? w.get(r, e) : r; }); - N(this, "createBrowserRouter", (e = {}) => { + O(this, "createBrowserRouter", (e = {}) => { if (d(this, le).size == 0) return null; if (d(this, ye)) return d(this, ye); - const r = Ue.get("Common.WEBSITE_DEFAULT_THEME", "@pkg/ff/frameworks/DefaultTheme"), n = Ue.get(Z.checkUserToken() ? "Common.WEBSITE_LOGIN_REDIRECT" : "Common.WEBSITE_DEFAULT", "/index"), i = { [r]: 0 }, o = (a, l) => () => Promise.all([Z.getWidgetComponent(a), $t(l)]).then(([c, u]) => [c.default || function() { + const r = Ue.get("Common.WEBSITE_DEFAULT_THEME", "@pkg/ff/frameworks/DefaultTheme"), n = Ue.get(X.checkUserToken() ? "Common.WEBSITE_LOGIN_REDIRECT" : "Common.WEBSITE_DEFAULT", "/index"), i = { [r]: 0 }, o = (a, l) => () => Promise.all([X.getWidgetComponent(a), $t(l)]).then(([c, u]) => [c.default || function() { return `${a}`; - }, u]).then(([c, u]) => ({ Component: () => E.createElement(Lr, {}, E.createElement(c, { $setting: u })) })), s = Array.from(d(this, le).values()).reduce((a, { uuid: l, uri: c, name: u, type: p, component: h, widgetSetting: g, widgetProps: f, isLogin: y, isLayout: k, extra: b }) => { - let x = {}, S = 0; + }, u]).then(([c, u]) => ({ Component: () => x.createElement(Vr, {}, x.createElement(c, { $setting: u })) })), s = Array.from(d(this, le).values()).reduce((a, { uuid: l, uri: c, name: u, type: p, component: m, widgetSetting: g, widgetProps: f, isLogin: y, isLayout: k, extra: b }) => { + let E = {}, C = 0; switch (p) { case "list": - x.element = E.createElement(vi, { component: h, $props: f }); + E.element = x.createElement(Ni, { component: m, $props: f }); break; case "fsdpf-component": - x.element = E.createElement(Ni, { key: c, component: h, $setting: g, $props: f }); + E.element = x.createElement(vi, { key: c, component: m, $setting: g, $props: f }); } const $ = (b == null ? void 0 : b.theme) ?? (b == null ? void 0 : b.layout); if ($) { const F = (b == null ? void 0 : b.themeProps) ?? (b == null ? void 0 : b.layoutProps); - if (!i[$]) return i[$] = a.length, [...a, { path: "/", lazy: o($, F), children: [{ path: c, ...x }] }]; - S = i[$]; + if (!i[$]) return i[$] = a.length, [...a, { path: "/", lazy: o($, F), children: [{ path: c, ...E }] }]; + C = i[$]; } - return k && S > -1 ? (a[S].children.push({ path: c, ...x }), a) : [...a, { path: c, ...x }]; + return k && C > -1 ? (a[C].children.push({ path: c, ...E }), a) : [...a, { path: c, ...E }]; }, [{ path: "/", lazy: o(r, {}), children: [] }]); - return s.push({ index: !0, element: E.createElement(Ti, { to: n, replace: !0 }) }), K(this, ye, Xn(s, e)); + return s.push({ index: !0, element: x.createElement(Ti, { to: n, replace: !0 }) }), K(this, ye, Xn(s, e)); }); - if (d(he, Fe)) return d(he, Fe); + if (d(me, Fe)) return d(me, Fe); } }; -Fe = new WeakMap(), le = new WeakMap(), je = new WeakMap(), ye = new WeakMap(), nt = new WeakMap(), it = new WeakMap(), v(he, Fe, null), N(he, "getInstance", () => (d(he, Fe) || K(he, Fe, new he()), d(he, Fe))); -let qt = he; -const Ti = ({ to: t, replace: e }) => Ir() ? E.createElement(Zn, { to: t, replace: e }) : (window.document.location = t, "redirect"), ke = qt.getInstance(); +Fe = new WeakMap(), le = new WeakMap(), je = new WeakMap(), ye = new WeakMap(), it = new WeakMap(), ot = new WeakMap(), v(me, Fe, null), O(me, "getInstance", () => (d(me, Fe) || K(me, Fe, new me()), d(me, Fe))); +let qt = me; +const Ti = ({ to: t, replace: e }) => Lr() ? x.createElement(Zn, { to: t, replace: e }) : (window.document.location = t, "redirect"), ke = qt.getInstance(); Zt.chainableTypes = [In]; const We = Zt.getInstance(new URL("/ff-worker-pipe/worker.js", self.location), { type: "module" }); -Zt.fns = { http: Object.fromEntries(["get", "post", "put", "del", "list", "decode", "encode", "cache", "refreshCache"].map((t) => [t, (...e) => B[t](...e)])), generateUUID: () => Ai(), user: { logout: () => Z.logout(() => window.location.replace(Ue.get("Common.WEBSITE_LOGIN_PAGE", "/index"))), getUserInfo: (t = !0) => Z.getUserInfo(t), checkUserToken: () => Z.checkUserToken(), getUserToken: () => Z.getUserToken() }, getConfigure: (t) => Ue.get(t), route: Object.fromEntries(["redirect", "getPageParams", "getCurrentRoute", "get", "getMenus", "findMenuPathByUuid"].map((t) => [t, (...e) => ke[t](...e)])), popup: Object.fromEntries(["notification", "success", "error", "form", "modal", "confirm"].map((t) => [t, (...e) => Se[t](...e)])) }; -const xr = { null2json: (t) => Object.create(), null2array: (t) => [], null2number: (t) => 0, null2bool: (t) => !1, null2string: (t) => "", null2integer: (t) => 0, null2float: (t) => 0, string2json: (t) => t ? JSON.parse(t) : "{}", string2array: (t) => t.substr(0, 1) === "[" && t.substr(-1) === "]" ? JSON.parse(t) : t.split(","), string2number: (t) => t == "" ? 0 : +t, string2integer: (t) => t == "" ? 0 : +t, string2float: (t) => t == "" ? 0 : +t, string2bool: (t) => { +Zt.fns = { http: Object.fromEntries(["get", "post", "put", "del", "list", "decode", "encode", "cache", "refreshCache"].map((t) => [t, (...e) => B[t](...e)])), generateUUID: () => Ai(), user: { logout: () => X.logout(() => window.location.replace(Ue.get("Common.WEBSITE_LOGIN_PAGE", "/index"))), getUserInfo: (t = !0) => X.getUserInfo(t), checkUserToken: () => X.checkUserToken(), getUserToken: () => X.getUserToken() }, getConfigure: (t) => Ue.get(t), route: Object.fromEntries(["redirect", "getPageParams", "getCurrentRoute", "get", "getMenus", "findMenuPathByUuid"].map((t) => [t, (...e) => ke[t](...e)])), popup: Object.fromEntries(["notification", "success", "error", "form", "modal", "confirm"].map((t) => [t, (...e) => Se[t](...e)])) }; +const $r = { null2json: (t) => Object.create(), null2array: (t) => [], null2number: (t) => 0, null2bool: (t) => !1, null2string: (t) => "", null2integer: (t) => 0, null2float: (t) => 0, string2json: (t) => t ? JSON.parse(t) : "{}", string2array: (t) => t.substr(0, 1) === "[" && t.substr(-1) === "]" ? JSON.parse(t) : t.split(","), string2number: (t) => t == "" ? 0 : +t, string2integer: (t) => t == "" ? 0 : +t, string2float: (t) => t == "" ? 0 : +t, string2bool: (t) => { switch (`${t}`.toLowerCase()) { case "0": case "false": @@ -587,8 +587,8 @@ const xr = { null2json: (t) => Object.create(), null2array: (t) => [], null2numb let r = "string"; r = Array.isArray(t) ? "array" : typeof t, w.isObject(t) && (r = "json"); const n = `${r}2${e}`; - return Reflect.has(xr, n) ? xr[n](t) : t; -}, Oi = (t) => t === null ? "null" : Array.isArray(t) ? "array" : typeof t == "object" ? "json" : typeof t == "boolean" ? "bool" : typeof t == "string" ? "string" : typeof t == "number" ? Number.isInteger(t) ? "integer" : "float" : typeof t, $t = (t = {}, e = {}, r = {}, n = "") => Zr(t, (i, o) => o === "type" && i === "code") ? Qr(t, e, r, n) : en(t, e, n), Zr = (t, e = () => !1) => w.some(t, (r) => !!w.some(r, e) || (w.isEmpty(r) || !w.isPlainObject(r) && !w.isArray(r) ? void 0 : Zr(r, e))), Qr = async (t = {}, e = {}, r = {}, n = "") => { + return Reflect.has($r, n) ? $r[n](t) : t; +}, Oi = (t) => t === null ? "null" : Array.isArray(t) ? "array" : typeof t == "object" ? "json" : typeof t == "boolean" ? "bool" : typeof t == "string" ? "string" : typeof t == "number" ? Number.isInteger(t) ? "integer" : "float" : typeof t, $t = (t = {}, e = {}, r = {}, n = "") => Qr(t, (i, o) => o === "type" && i === "code") ? en(t, e, r, n) : tn(t, e, n), Qr = (t, e = () => !1) => w.some(t, (r) => !!w.some(r, e) || (w.isEmpty(r) || !w.isPlainObject(r) && !w.isArray(r) ? void 0 : Qr(r, e))), en = async (t = {}, e = {}, r = {}, n = "") => { let i = /* @__PURE__ */ Object.create(null); for (let o in t) { let s; @@ -613,11 +613,11 @@ const xr = { null2json: (t) => Object.create(), null2array: (t) => [], null2numb s = l; } s ?? (s = c); - } else s = await Qr(t[o], e, r, n); + } else s = await en(t[o], e, r, n); w.set(i, o, s); } return i; -}, en = (t = {}, e = {}, r = "") => Object.keys(t || {}).reduce((n, i) => { +}, tn = (t = {}, e = {}, r = "") => Object.keys(t || {}).reduce((n, i) => { if (w.isPlainObject(t[i])) { let o; if (Reflect.has(t[i], "type") && ["field", "router", "query", "string"].includes(t[i].type)) { @@ -634,7 +634,7 @@ const xr = { null2json: (t) => Object.create(), null2array: (t) => [], null2numb o = a; } o ?? (o = l); - } else o = en(t[i], e, r); + } else o = tn(t[i], e, r); w.set(n, i, o); } return n; @@ -678,10 +678,10 @@ const xr = { null2json: (t) => Object.create(), null2array: (t) => [], null2numb const e = 16 * Math.random() | 0; return (t === "x" ? e : 3 & e | 8).toString(16); }), Pt = () => { - const t = J(!0), [, e] = E.useReducer((r) => r + 1, 0); + const t = H(!0), [, e] = x.useReducer((r) => r + 1, 0); return z(() => () => t.current = !1, []), () => t.current && e(); }, Bo = (t) => { - const [e, r] = L(t), n = J(null), i = H((o, s) => { + const [e, r] = V(t), n = H(null), i = J((o, s) => { n.current = s, r(o); }, []); return z(() => { @@ -689,31 +689,31 @@ const xr = { null2json: (t) => Object.create(), null2array: (t) => [], null2numb }, [e]), [e, i]; }, pt = (t = (n) => { }, e, r = w.isEqual) => { - const n = E.useRef(); - r(e, n.current) || (n.current = w.cloneDeep(e)), E.useEffect(t, [n.current]); -}, vt = pt, tn = (t, e = "string") => { + const n = x.useRef(); + r(e, n.current) || (n.current = w.cloneDeep(e)), x.useEffect(t, [n.current]); +}, Nt = pt, rn = (t, e = "string") => { var r; if (!Array.isArray(t)) return t; - for (let n = 0; n < t.length; n++) t[n].value = ce((r = t[n]) == null ? void 0 : r.value, e), t[n] && Reflect.has(t[n], "children") && (t[n].children = tn(t[n].children, e)); + for (let n = 0; n < t.length; n++) t[n].value = ce((r = t[n]) == null ? void 0 : r.value, e), t[n] && Reflect.has(t[n], "children") && (t[n].children = rn(t[n].children, e)); return t; }, Uo = (t, e = "json", r = "string", n = null, i = null) => { - const [o] = ie.useForm(n), [s, a] = L([{ label: "无", value: "", disabled: !0 }]), l = J([]), c = ie.useWatch((u) => l.current.length === 0 ? null : w.pick(u, l.current), o) || null; + const [o] = ie.useForm(n), [s, a] = V([{ label: "无", value: "", disabled: !0 }]), l = H([]), c = ie.useWatch((u) => l.current.length === 0 ? null : w.pick(u, l.current), o) || null; return z(() => { Array.isArray(t) ? a(t) : e === "javascript" && t ? We.exec(t, {}, { getFieldValue: (u) => (l.current.includes(u) || l.current.push(u), o.getFieldValue(u)), getFieldValueForBasicForm: (u) => (l.current.includes(u) || l.current.push(u), i ? i.getFieldValue(u) : o.getFieldValue(u)) }).then((u) => { a(ce(u, "array")); }).catch((u) => console.error("useOptions", u)) : t && a(ce(t, "array")); - }, [t, e, c]), tn(s, r); + }, [t, e, c]), rn(s, r); }, Wo = (t) => { - const [e, r] = L(), n = { type: "GET" }; + const [e, r] = V(), n = { type: "GET" }; if (typeof t == "string" ? n.url = t : w.isPlainObject(t) && Object.assign(n, t), !(n != null && n.url)) throw "url is required"; const i = (o) => B.request(n, !1).resp((s) => (console.log("useSubscribeRequest", o), r(s), s)); return pt(() => { let o = null; return i().then((s) => { - o = _r.subscribe(w.throttle(i, 180, { leading: !1, trailing: !0 }), s.res); + o = Jr.subscribe(w.throttle(i, 180, { leading: !1, trailing: !0 }), s.res); }), () => o == null ? void 0 : o(); }, n), e; -}, Ii = (t, e) => H((r) => { +}, Ii = (t, e) => J((r) => { const n = {}; for (const [i, o] of Object.entries(r)) { const s = t == null ? void 0 : t[i]; @@ -723,44 +723,44 @@ const xr = { null2json: (t) => Object.create(), null2array: (t) => [], null2numb } else n[i] = o; } Object.keys(n).length > 0 && e(n); -}, [t, e]), rr = (t, e = {}, r = {}, n = []) => { - const [i, o] = L({}), [s, a] = L({}), l = Fr(s), c = ke.usePageParams(); +}, [t, e]), nn = (t, e = {}, r = {}, n = []) => { + const [i, o] = V({}), [s, a] = V({}), l = jr(s), c = ke.usePageParams(); Yt(() => { Promise.resolve($t(t, e, r)).then(a); }, [t, e, c, ...n]), Gt(() => { - const h = l ?? {}, g = Object.keys({ ...h, ...s }).reduce((f, y) => (h[y] !== s[y] && (f[y] = s[y]), f), {}); + const m = l ?? {}, g = Object.keys({ ...m, ...s }).reduce((f, y) => (m[y] !== s[y] && (f[y] = s[y]), f), {}); Object.keys(g).length > 0 && o((f) => ({ ...f, ...g })); }, [s]); - const u = Ii(t, (h) => { - o((g) => ({ ...g, ...h })); - }), p = W(() => Object.fromEntries(Object.entries(i).filter(([h, g]) => g !== s[h])), [i, s]); + const u = Ii(t, (m) => { + o((g) => ({ ...g, ...m })); + }), p = W(() => Object.fromEntries(Object.entries(i).filter(([m, g]) => g !== s[m])), [i, s]); return [i, u, p]; }, Li = (t) => { - const [e, r] = E.useState({ items: [], hides: [] }); - return E.useEffect(() => { - t && B.get(`/api/_/${t}`).then(({ pk: n, uuid: i, code: o, resource: s, align: a, cols: l, rowHeight: c, marginX: u, marginY: p, listenChangeFields: h, listenChangeFieldsFunc: g, fields: f, theme: y, themeSetting: k, groups: b }) => ({ pk: n, uuid: i, code: o, resource: s, align: a, cols: l, rowHeight: c, marginX: u, marginY: p, theme: y, themeProps: k, groups: b, listenChangeFields: h, listenChangeFieldsFunc: g, ...f.reduce((x, S) => { + const [e, r] = x.useState({ items: [], hides: [] }); + return x.useEffect(() => { + t && B.get(`/api/_/${t}`).then(({ pk: n, uuid: i, code: o, resource: s, align: a, cols: l, rowHeight: c, marginX: u, marginY: p, listenChangeFields: m, listenChangeFieldsFunc: g, fields: f, theme: y, themeSetting: k, groups: b }) => ({ pk: n, uuid: i, code: o, resource: s, align: a, cols: l, rowHeight: c, marginX: u, marginY: p, theme: y, themeProps: k, groups: b, listenChangeFields: m, listenChangeFieldsFunc: g, ...f.reduce((E, C) => { var $; - return ($ = S == null ? void 0 : S.field) != null && $.hidden ? x.hides.push(S == null ? void 0 : S.field) : x.items.push(S), x; + return ($ = C == null ? void 0 : C.field) != null && $.hidden ? E.hides.push(C == null ? void 0 : C.field) : E.items.push(C), E; }, { items: [], hides: [] }) })).then(r); }, [t]), e; }, Vi = ({ max: t = 0, min: e = 0, type: r = "", message: n, pattern: i, required: o = !1, validator: s } = {}, a, l) => { - const [c, u] = L([]); + const [c, u] = V([]); return z(() => { const p = []; if (o) { - let h = l; + let m = l; switch (l) { case "number": case "string": case "array": break; case "bool": - h = "boolean"; + m = "boolean"; break; case "json": - h = "object"; + m = "object"; } - p.push({ type: h, required: !0, whitespace: !0, message: "该项必填" }); + p.push({ type: m, required: !0, whitespace: !0, message: "该项必填" }); } switch (r) { case "string": @@ -770,22 +770,22 @@ const xr = { null2json: (t) => Object.create(), null2array: (t) => [], null2numb p.push({ type: "string", pattern: i, message: n }); break; case "validator": - s && p.push(({ getFieldValue: h }) => ({ validator: async (g, f) => { - const y = await We.exec(s, { value: f, fieldName: a }, { getFieldValue: h }); + s && p.push(({ getFieldValue: m }) => ({ validator: async (g, f) => { + const y = await We.exec(s, { value: f, fieldName: a }, { getFieldValue: m }); return w.isString(y) && y ? Promise.reject(y) : w.isBoolean(y) && !y ? Promise.reject(n) : Promise.resolve(); } })); } u(p); }, [t, e, r, n, i, o, s]), c; }, Di = (t, e, r) => { - const [n, i] = L(null); + const [n, i] = V(null); return z(() => { const { initDataUri: o = `/api/${t}`, initDataMethod: s = "GET" } = r || {}; e && B.request({ method: s, url: w.trimEnd(`${o}/${e}`, "/") }).then((a) => { i(a); }); }, [t, e, r]), n; -}, Mi = (t, e, r) => H((n, i = { serialize: (o) => o, onSuccess: () => { +}, Mi = (t, e, r) => J((n, i = { serialize: (o) => o, onSuccess: () => { }, onFail: (o) => (o == null ? void 0 : o.errorFields) && Se.error("请先完善表单信息", { duration: 2e3 }) }) => { const o = n.getFieldValue("__RESOURCE__"), { submitDataUri: s = `/api/${t}`, submitDataMethod: a = "POST" } = r || {}; return n.validateFields().then((l) => o ? w.pick(l, [o]) : l).then(i.serialize).then((l) => B.request({ method: a, url: w.trimEnd(`${s}/${e || ""}`, "/"), data: l }).msg(i.onSuccess)).catch(i.onFail); @@ -797,82 +797,82 @@ const xr = { null2json: (t) => Object.create(), null2array: (t) => [], null2numb const o = Mi(e, r, n); return w.partial(o, t); }, Ui = (t, e, r = [], n = {}) => { - const i = J({}), o = J(), s = w.debounce(Pt(), 180), a = ["disabled", "required"], l = (h, g) => { - a.includes(h) && (i.current[h] = g), s(); - }, c = W(() => ({ setDisabled: (h) => l("disabled", h), setRequired: (h) => l("required", h), getDisabled: () => i.current.disabled, getRequired: () => i.current.required }), [e]), [u, p] = Hr(e, -1, {}, c, n); + const i = H({}), o = H(), s = w.debounce(Pt(), 180), a = ["disabled", "required"], l = (m, g) => { + a.includes(m) && (i.current[m] = g), s(); + }, c = W(() => ({ setDisabled: (m) => l("disabled", m), setRequired: (m) => l("required", m), getDisabled: () => i.current.disabled, getRequired: () => i.current.required }), [e]), [u, p] = Yr(e, -1, {}, c, n); if (!p && o.current != u && (u >= 0 || !w.isEmpty(r == null ? void 0 : r[u]))) { o.current = u; - const { widget: h, widgetPrefix: g, props: f } = r == null ? void 0 : r[u]; - t = Mr(h, g), i.current = w.merge(f, w.pick(i.current, a)); + const { widget: m, widgetPrefix: g, props: f } = r == null ? void 0 : r[u]; + t = Br(m, g), i.current = w.merge(f, w.pick(i.current, a)); } return [t, i.current]; -}, $r = (t) => t === void 0 || t === !1 ? "" : (Array.isArray(t) ? t : [t]).join("_"), zo = ({ value: t, onChange: e }, r = null) => { - const n = J(), [i] = ie.useForm(r), o = J({}); - return vt(() => { +}, Pr = (t) => t === void 0 || t === !1 ? "" : (Array.isArray(t) ? t : [t]).join("_"), zo = ({ value: t, onChange: e }, r = null) => { + const n = H(), [i] = ie.useForm(r), o = H({}); + return Nt(() => { w.isEqual(n.current, t) || i.setFieldsValue(t); }, [t]), z(() => () => i.resetFields(), []), [W(() => i.__INTERNAL__ ? i : { ...i, __INTERNAL__: { itemRef: (s) => (a) => { - const l = $r(s); + const l = Pr(s); a ? o.current[l] = a : delete o.current[l]; } }, scrollToField: (s, a = {}) => { console.warn("useMergedFormValuesChange scrollToField not work, unreferenced antd form"); }, focusField: (s) => { console.warn("useMergedFormValuesChange focusField not work, unreferenced antd form"); }, getFieldInstance: (s) => { - const a = $r(s); + const a = Pr(s); return o.current[a]; } }, [i]), (s, a) => { n.current = a, e == null || e(a); }]; -}, nr = ({ widget: t = "Input", widgetPrefix: e = "@pkg/ff/grid-layout-forms", widgetDecorator: r, subWidgets: n = [], basicForm: i, ...o }) => { - const s = Mr(t, e), [a, l] = Ui(s, r, n, i), [c, u] = L(); +}, rr = ({ widget: t = "Input", widgetPrefix: e = "@pkg/ff/grid-layout-forms", widgetDecorator: r, subWidgets: n = [], basicForm: i, ...o }) => { + const s = Br(t, e), [a, l] = Ui(s, r, n, i), [c, u] = V(); return z(() => { - a && Z.getWidgetComponent(a).then(({ defaultProps: p = {}, default: h }) => ({ default: Wi(h, p, i) })).catch((p) => ({ default: () => `${p}` })).then((p) => u(E.createElement(p.default, o))); - }, [a]), c && E.cloneElement(c, { ...o, ...l }); + a && X.getWidgetComponent(a).then(({ defaultProps: p = {}, default: m }) => ({ default: Wi(m, p, i) })).catch((p) => ({ default: () => `${p}` })).then((p) => u(x.createElement(p.default, o))); + }, [a]), c && x.cloneElement(c, { ...o, ...l }); }, Wi = (t, e = {}, r = null) => (n) => { - const { type: i, code: o, label: s, noStyle: a, style: l, placeholder: c, required: u = !1, extras: p, validators: h, help: g, isVirtual: f, $isReserved: y, initialValue: k, initialValueLanguage: b, ...x } = w.omit(w.merge({}, e, n), ["convertJs", "convertJsSetting", "widget", "widgetPerfix", "widgetDecorator", "subWidgets", "boxStyle"]), S = Vi(Object.assign({}, h, u ? { required: !0 } : {}), o, i), $ = W(() => { - const D = Object.keys((e == null ? void 0 : e.extras) || {}); - return w.over([w.partialRight(w.pick, D), w.partialRight(w.omit, D)]); - }, [e == null ? void 0 : e.extras]), [F, A] = $(x), O = { label: s, noStyle: a, style: l, colon: !1, layout: "vertical" }, T = H((D) => D == null ? void 0 : ce(D, i), [i]); - return m(Xt, { name: o, rules: S, initialValue: T(k), normalize: T, children: (D, P, V) => { + const { type: i, code: o, label: s, noStyle: a, style: l, placeholder: c, required: u = !1, extras: p, validators: m, help: g, isVirtual: f, $isReserved: y, initialValue: k, initialValueLanguage: b, ...E } = w.omit(w.merge({}, e, n), ["convertJs", "convertJsSetting", "widget", "widgetPerfix", "widgetDecorator", "subWidgets", "boxStyle"]), C = Vi(Object.assign({}, m, u ? { required: !0 } : {}), o, i), $ = W(() => { + const A = Object.keys((e == null ? void 0 : e.extras) || {}); + return w.over([w.partialRight(w.pick, A), w.partialRight(w.omit, A)]); + }, [e == null ? void 0 : e.extras]), [F, I] = $(E), T = { label: s, noStyle: a, style: l, colon: !1, layout: "vertical" }, N = J((A) => A == null ? void 0 : ce(A, i), [i]); + return h(Xt, { name: o, rules: C, initialValue: N(k), normalize: N, children: (A, P, L) => { var M; - return m(t, { type: i, rcform: V, basicForm: r, itemProps: { validateStatus: P.errors.length > 0 ? "error" : "success", tooltip: g || null, help: P.errors.length > 0 ? P.errors.join("、") : null, required: ((M = S == null ? void 0 : S[0]) == null ? void 0 : M.required) || !1, ...O }, fieldProps: { placeholder: c, ...A, ...D }, $setting: Object.assign({}, p, F) }); + return h(t, { type: i, rcform: L, basicForm: r, itemProps: { validateStatus: P.errors.length > 0 ? "error" : "success", tooltip: g || null, help: P.errors.length > 0 ? P.errors.join("、") : null, required: ((M = C == null ? void 0 : C[0]) == null ? void 0 : M.required) || !1, ...T }, fieldProps: { placeholder: c, ...I, ...A }, $setting: Object.assign({}, p, F) }); } }); -}, ir = ({ name: t, form: e = null, basicForm: r = null, style: n = {}, className: i, cols: o = 24, rowHeight: s = 16, itemMargin: a = [8, 16], containerPadding: l = [0, 0], fields: c = [], hides: u = [], primaryKey: p = 0, formProps: h = {}, formFields: g = [], listenChangeFields: f, listenChangeFieldsFunc: y, onValuesChange: k, theme: b, themeProps: x = {}, groups: S = [{ key: "default", label: "默认" }], children: $, ...F }) => { - const [A] = ie.useForm(e), O = H((P, V) => { - k == null || k(P, V), y && Array.isArray(f) && We.exec(y, { changedValues: P, allValues: V }, { getFieldValue: A.getFieldValue, setFieldValue: A.setFieldValue, setFieldsValue: A.setFieldsValue, isFieldTouched: A.isFieldTouched, isFieldsTouched: A.isFieldsTouched }).catch((M) => console.error("onFormValuesChange", t, M)); - }, [t, A, k, f, y]), T = W(() => [{ name: "__PROPS__", value: h }, { name: "__PRIMARY_KEY__", value: p }].concat(g), [p, h, g]), D = (P, V, M) => { - const U = er(V, nr, r), X = zr(F); - return I("div", { ...X, className: j("ff-grid-layout-form", i), style: { ...n, "--grid-layout-item-margin-x": `${(a == null ? void 0 : a[0]) ?? 8}px`, "--grid-layout-item-margin-y": `${(a == null ? void 0 : a[1]) ?? 16}px`, "--grid-layout-container-padding-y": `${(l == null ? void 0 : l[0]) || 0}px`, "--grid-layout-container-padding-x": `${(l == null ? void 0 : l[1]) || 0}px`, "--grid-layout-cols": o, "--grid-layout-row-height": `${s}px` }, children: [U, M && E.cloneElement(M, { cols: o, rowHeight: s, itemMargin: a, containerPadding: l, fields: V, basicForm: r })] }); +}, nr = ({ name: t, form: e = null, basicForm: r = null, style: n = {}, className: i, cols: o = 24, rowHeight: s = 16, itemMargin: a = [8, 16], containerPadding: l = [0, 0], fields: c = [], hides: u = [], primaryKey: p = 0, formProps: m = {}, formFields: g = [], listenChangeFields: f, listenChangeFieldsFunc: y, onValuesChange: k, theme: b, themeProps: E = {}, groups: C = [{ key: "default", label: "默认" }], children: $, ...F }) => { + const [I] = ie.useForm(e), T = J((P, L) => { + k == null || k(P, L), y && Array.isArray(f) && We.exec(y, { changedValues: P, allValues: L }, { getFieldValue: I.getFieldValue, setFieldValue: I.setFieldValue, setFieldsValue: I.setFieldsValue, isFieldTouched: I.isFieldTouched, isFieldsTouched: I.isFieldsTouched }).catch((M) => console.error("onFormValuesChange", t, M)); + }, [t, I, k, f, y]), N = W(() => [{ name: "__PROPS__", value: m }, { name: "__PRIMARY_KEY__", value: p }].concat(g), [p, m, g]), A = (P, L, M) => { + const U = er(L, rr, r), Z = qr(F); + return D("div", { ...Z, className: j("ff-grid-layout-form", i), style: { ...n, "--grid-layout-item-margin-x": `${(a == null ? void 0 : a[0]) ?? 8}px`, "--grid-layout-item-margin-y": `${(a == null ? void 0 : a[1]) ?? 16}px`, "--grid-layout-container-padding-y": `${(l == null ? void 0 : l[0]) || 0}px`, "--grid-layout-container-padding-x": `${(l == null ? void 0 : l[1]) || 0}px`, "--grid-layout-cols": o, "--grid-layout-row-height": `${s}px` }, children: [U, M && x.cloneElement(M, { cols: o, rowHeight: s, itemMargin: a, containerPadding: l, fields: L, basicForm: r })] }); }; - return I(ie, { ...F, form: A, fields: T, onValuesChange: O, children: [b ? m(Yr, { ...x, items: S, theme: b, itemRender: D, fields: c, children: $, basicForm: r }) : D(0, c, $), u == null ? void 0 : u.map((P) => { - var V; - return m(Xt, { name: P.code, children: m(zi, { form: A, basicForm: r, name: P.code, type: P.type, initialValue: P.initialValue, initialValueLanguage: (V = P.extras) == null ? void 0 : V.initialValueLanguage }) }, JSON.stringify(P.code)); + return D(ie, { ...F, form: I, fields: N, onValuesChange: T, children: [b ? h(Gr, { ...E, items: C, theme: b, itemRender: A, fields: c, children: $, basicForm: r }) : A(0, c, $), u == null ? void 0 : u.map((P) => { + var L; + return h(Xt, { name: P.code, children: h(zi, { form: I, basicForm: r, name: P.code, type: P.type, initialValue: P.initialValue, initialValueLanguage: (L = P.extras) == null ? void 0 : L.initialValueLanguage }) }, JSON.stringify(P.code)); })] }); }, zi = ({ type: t, initialValue: e, initialValueLanguage: r, onChange: n, basicForm: i }) => { - const [o, s] = Hr(r == "javascript" && e, r == "javascript" ? void 0 : e, {}, {}, i); + const [o, s] = Yr(r == "javascript" && e, r == "javascript" ? void 0 : e, {}, {}, i); return z(() => { r == "javascript" ? n(ce(o, t)) : e && n(ce(e, t)); }, [t, e, o]), null; }; -ir.propTypes = { fields: C.array, hides: C.array }; +nr.propTypes = { fields: S.array, hides: S.array }; const qi = /* @__PURE__ */ ((t) => ({ code: e, isPreview: r = !1, ...n }) => { - const { align: i, autoComplete: o, resource: s, items: a, hides: l, rowHeight: c, marginX: u, marginY: p, cols: h, listenChangeFields: g, listenChangeFieldsFunc: f, pk: y, uuid: k, theme: b, themeProps: x, groups: S } = Li(e), $ = W(() => [{ name: "__PK__", value: y }, { name: "__RESOURCE__", value: s }, { name: "__LAYOUT_KEY__", value: e }, { name: "__LAYOUT_UUID__", value: k }], [y, e, k, s]); - return m(t, { name: e, autoComplete: o, theme: b, themeProps: x, groups: S, ...n, formFields: $, listenChangeFields: g, listenChangeFieldsFunc: f, fields: a, hides: l, cols: h, rowHeight: c, itemMargin: [u, p] }); -})(ir), rn = ({ $setting: t, $close: e, extras: r, code: n, primaryKey: i, ...o }) => { + const { align: i, autoComplete: o, resource: s, items: a, hides: l, rowHeight: c, marginX: u, marginY: p, cols: m, listenChangeFields: g, listenChangeFieldsFunc: f, pk: y, uuid: k, theme: b, themeProps: E, groups: C } = Li(e), $ = W(() => [{ name: "__PK__", value: y }, { name: "__RESOURCE__", value: s }, { name: "__LAYOUT_KEY__", value: e }, { name: "__LAYOUT_UUID__", value: k }], [y, e, k, s]); + return h(t, { name: e, autoComplete: o, theme: b, themeProps: E, groups: C, ...n, formFields: $, listenChangeFields: g, listenChangeFieldsFunc: f, fields: a, hides: l, cols: m, rowHeight: c, itemMargin: [u, p] }); +})(nr), on = ({ $setting: t, $close: e, extras: r, code: n, primaryKey: i, ...o }) => { const [s] = ie.useForm(), a = Bi(s, n, i, t); - return m(re, { actions: I(E.Fragment, { children: [m(R, { name: (t == null ? void 0 : t.okText) || "保存", type: "primary", widget: () => a({ onSuccess: e }) }), m(R, { name: (t == null ? void 0 : t.cancelText) || "取消", widget: () => e(!1) })] }), extras: r, children: m(qi, { form: s, code: n, primaryKey: i, ...o }) }); -}, Pr = /* @__PURE__ */ new Set(), _t = (t = [], e = 0) => { + return h(re, { actions: D(x.Fragment, { children: [h(R, { name: (t == null ? void 0 : t.okText) || "保存", type: "primary", widget: () => a({ onSuccess: e }) }), h(R, { name: (t == null ? void 0 : t.cancelText) || "取消", widget: () => e(!1) })] }), extras: r, children: h(qi, { form: s, code: n, primaryKey: i, ...o }) }); +}, Nr = /* @__PURE__ */ new Set(), _t = (t = [], e = 0) => { const r = t[e]; - if (r.length && !Pr.has(r)) { + if (r.length && !Nr.has(r)) { const n = document.createElement("script"); n.setAttribute("src", r), n.setAttribute("data-namespace", r), t.length > e + 1 && (n.onload = () => { _t(t, e + 1); }, n.onerror = () => { _t(t, e + 1); - }), Pr.add(r), document.body.appendChild(n); + }), Nr.add(r), document.body.appendChild(n); } -}, Ct = ({ className: t, type: e, style: r = {}, rotate: n, spin: i, twoToneColor: o, compact: s, ...a }) => m("span", { role: "img", className: j("ff-iconfont", s && "ff-iconfont--compact", t), style: r, ...a, children: m("svg", { style: { width: "1em", height: "1em", fill: "currentColor", overflow: "hidden", ...n != null && { transform: `rotate(${n}deg)` }, ...i && { animation: "ff-iconfont-spin 1s linear infinite" }, ...o && { "--ff-icon-second-color": o } }, viewBox: "0 0 1024 1024", children: m("use", { xlinkHref: `#${e}` }) }) }); -Ct.propTypes = { className: C.string, type: C.string.isRequired, style: C.object }, Ct.init = _t; +}, Ct = ({ className: t, type: e, style: r = {}, rotate: n, spin: i, twoToneColor: o, compact: s, ...a }) => h("span", { role: "img", className: j("ff-iconfont", s && "ff-iconfont--compact", t), style: r, ...a, children: h("svg", { style: { width: "1em", height: "1em", fill: "currentColor", overflow: "hidden", ...n != null && { transform: `rotate(${n}deg)` }, ...i && { animation: "ff-iconfont-spin 1s linear infinite" }, ...o && { "--ff-icon-second-color": o } }, viewBox: "0 0 1024 1024", children: h("use", { xlinkHref: `#${e}` }) }) }); +Ct.propTypes = { className: S.string, type: S.string.isRequired, style: S.object }, Ct.init = _t; const Ki = (t, e, r, n) => ke.redirect(r, e, n), _i = (t, e = {}, r, n = {}) => { var o; const i = (o = n.router) == null ? void 0 : o.reduce((s, [a, l, c]) => { @@ -884,10 +884,10 @@ const Ki = (t, e, r, n) => ke.redirect(r, e, n), _i = (t, e = {}, r, n = {}) => }, vr = (t, e, r, { status: { loading: n, disabled: i }, setStatus: o, listFn: s }) => { const a = { loading: (l) => l === void 0 ? n : o((c) => ({ ...c, loading: l })), disabled: (l) => l === void 0 ? i : o((c) => ({ ...c, disabled: l })), list: s }; return w.isFunction(r) ? r.call(null, e, a) : w.isString(r) && r ? We.exec(r, e, a) : null; -}, Nr = (t, e, r, n, i) => w.isString(r) && r ? Z.getWidgetComponent(r).then(({ default: o }) => Se.modal(o, { ...e, $setting: n }, i != null && i.title ? { ...i, title: w.template(i.title)(t) } : i)).catch((o) => { +}, Tr = (t, e, r, n, i) => w.isString(r) && r ? X.getWidgetComponent(r).then(({ default: o }) => Se.modal(o, { ...e, $setting: n }, i != null && i.title ? { ...i, title: w.template(i.title)(t) } : i)).catch((o) => { Se.error(r, { content: o.toString() }); -}) : Se.modal(r, { ...e, $setting: n }, i != null && i.title ? { ...i, title: w.template(i.title)(t) } : i), Ji = (t, e, r, n, i) => Se.modal(rn, { ...e, $setting: n, code: r }, i != null && i.title ? { ...i, title: w.template(i.title)(t) } : i), Hi = (t, e, r, n, i) => Se.modal(tr, { ...n, base62params: e, listCode: r }, i != null && i.title ? { ...i, title: w.template(i.title)(t) } : i), Yi = ({ widget: t, widgetType: e, widgetData: r, widgetProps: n, widgetSetting: i, widgetContainerProps: o }, { onAfterClick: s, onBeforeClick: a } = {}) => { - const l = de(oe), [c, u] = L({ leading: !0, trailing: !1 }), p = J(null), [h, g] = W(() => { +}) : Se.modal(r, { ...e, $setting: n }, i != null && i.title ? { ...i, title: w.template(i.title)(t) } : i), Ji = (t, e, r, n, i) => Se.modal(on, { ...e, $setting: n, code: r }, i != null && i.title ? { ...i, title: w.template(i.title)(t) } : i), Hi = (t, e, r, n, i) => Se.modal(tr, { ...n, base62params: e, listCode: r }, i != null && i.title ? { ...i, title: w.template(i.title)(t) } : i), Yi = ({ widget: t, widgetType: e, widgetData: r, widgetProps: n, widgetSetting: i, widgetContainerProps: o }, { onAfterClick: s, onBeforeClick: a } = {}) => { + const l = de(oe), [c, u] = V({ leading: !0, trailing: !1 }), p = H(null), [m, g] = W(() => { switch (e) { case "redirect": return [w.partialRight(Ki, t, i), null]; @@ -895,7 +895,7 @@ const Ki = (t, e, r, n) => ke.redirect(r, e, n), _i = (t, e = {}, r, n = {}) => return [w.partialRight(vr, (i == null ? void 0 : i.code) ?? t, { status: c, setStatus: u, listFn: l }), null]; case "component": case "fsdpf-component": - return [w.partialRight(Nr, t, i, o), (y) => ({ $setting: y })]; + return [w.partialRight(Tr, t, i, o), (y) => ({ $setting: y })]; case "grid-layout-form": return [w.partialRight(Ji, t, i, o), (y) => ({ $setting: y })]; case "data-list": @@ -903,101 +903,101 @@ const Ki = (t, e, r, n) => ke.redirect(r, e, n), _i = (t, e = {}, r, n = {}) => case "destroy": return [w.partialRight(_i, t, i, o), null]; default: - if (an(t) || E.isValidElement(t)) return [w.partialRight(Nr, t, i, o), (y) => ({ $setting: y })]; + if (or(t) || x.isValidElement(t)) return [w.partialRight(Tr, t, i, o), (y) => ({ $setting: y })]; if (w.isFunction(t)) return [w.partialRight(vr, (i == null ? void 0 : i.code) || t, { status: c, setStatus: u }), null]; } return [(...y) => console.error("useButton unknown widgetType", e, ...y), null]; }, [t, e, i, o, l.getBase62params, l.getSelectedRows]), f = w.debounce((y) => (a == null || a(y), Promise.resolve($t(n, y, { list: l })).then((k) => { - const b = h(y, { ...r, ...k }); - return b != null && b.update && g && (p.current = (x, S) => b.update(g(x), S)), b; + const b = m(y, { ...r, ...k }); + return b != null && b.update && g && (p.current = (E, C) => b.update(g(E), C)), b; }).then((k) => s == null ? void 0 : s(k)).catch(console.error)), 300, { leading: !0, trailing: !1 }); return Gt(() => { var y; (y = p.current) == null || y.call(p, i, o); }, [i, o]), [f, c]; -}, nn = ({ type: t, name: e, className: r, icon: n, iconPosition: i, size: o }, s = "default") => W(() => { +}, sn = ({ type: t, name: e, className: r, icon: n, iconPosition: i, size: o }, s = "default") => W(() => { const a = { type: "primary", className: j("ff-button", r), iconPosition: i, size: o }; - return t === "danger" ? a.danger = !0 : t === "default" && (a.type = t), s === "link" || s === "dashed" ? (a.type = s, t === "default" && (a.className = j(a.className, "ff-default"))) : s !== "circle" && s !== "round" || (a.shape = s), n && (a.icon = m(Ct, { type: n })), e && (a.children = e), a; -}, [s, t, r, n, i]), Nt = ({ data: t, widget: e, widgetType: r = "fsdpf-component", widgetData: n, widgetProps: i, widgetSetting: o, widgetContainerProps: s, onAfterClick: a, onBeforeClick: l, children: c, extras: u }) => { - const p = de(oe), [h, g] = L(!1), [f, y] = L("hover"), [k, b] = rr(i, t, { list: p }, [p.getBase62params, p.getSelectedRows]), [x, S] = L(), { placement: $, align: F, zIndex: A, arrow: O = { pointAtCenter: !0 }, getPopupContainer: T, isPopupMountBodyContainer: D = !0, ...P } = s || {}; + return t === "danger" ? a.danger = !0 : t === "default" && (a.type = t), s === "link" || s === "dashed" ? (a.type = s, t === "default" && (a.className = j(a.className, "ff-default"))) : s !== "circle" && s !== "round" || (a.shape = s), n && (a.icon = h(Ct, { type: n })), e && (a.children = e), a; +}, [s, t, r, n, i]), vt = ({ data: t, widget: e, widgetType: r = "fsdpf-component", widgetData: n, widgetProps: i, widgetSetting: o, widgetContainerProps: s, onAfterClick: a, onBeforeClick: l, children: c, extras: u }) => { + const p = de(oe), [m, g] = V(!1), [f, y] = V("hover"), [k, b] = nn(i, t, { list: p }, [p.getBase62params, p.getSelectedRows]), [E, C] = V(), { placement: $, align: F, zIndex: I, arrow: T = { pointAtCenter: !0 }, getPopupContainer: N, isPopupMountBodyContainer: A = !0, ...P } = s || {}; z(() => { - r == "grid-layout-form" ? S(E.createElement(rn, { ...n, $setting: o, code: e })) : r == "data-list" ? S(E.createElement(tr, { base62params: t, $setting: o, listCode: e })) : w.isString(e) ? Z.getWidgetComponent(e).then(({ default: U }) => { - S(E.createElement(U, { ...n, $setting: o })); - }).catch((U) => S(U.toString())) : E.isValidElement(e) ? S(E.cloneElement(e, { ...n, $setting: o })) : (an(e) || w.isFunction(e) && ["component", "fsdpf-component"].includes(r)) && S(E.createElement(e, { ...n, $setting: o })); + r == "grid-layout-form" ? C(x.createElement(on, { ...n, $setting: o, code: e })) : r == "data-list" ? C(x.createElement(tr, { base62params: t, $setting: o, listCode: e })) : w.isString(e) ? X.getWidgetComponent(e).then(({ default: U }) => { + C(x.createElement(U, { ...n, $setting: o })); + }).catch((U) => C(U.toString())) : x.isValidElement(e) ? C(x.cloneElement(e, { ...n, $setting: o })) : (or(e) || w.isFunction(e) && ["component", "fsdpf-component"].includes(r)) && C(x.createElement(e, { ...n, $setting: o })); }, [e, r, n]); - const V = (U, X = !1) => (g(U), !U && y("hover"), U ? l == null ? void 0 : l(k) : a == null ? void 0 : a(X)), M = (U) => { + const L = (U, Z = !1) => (g(U), !U && y("hover"), U ? l == null ? void 0 : l(k) : a == null ? void 0 : a(Z)), M = (U) => { g(!0), y("click"); }; - return m(zn, { zIndex: A, placement: $, onPopupClick: M, onClick: M, open: h, align: F, arrow: O, trigger: f, getPopupContainer: T || D ? void 0 : (U) => U, content: m(Gi, { ...P, extras: u, children: x && E.cloneElement(x, { ...k, $setProps: b, $close: (U) => V(!1, U) }) }), children: c, onOpenChange: V }); + return h(zn, { zIndex: I, placement: $, onPopupClick: M, onClick: M, open: m, align: F, arrow: T, trigger: f, getPopupContainer: N || A ? void 0 : (U) => U, content: h(Gi, { ...P, extras: u, children: E && x.cloneElement(E, { ...k, $setProps: b, $close: (U) => L(!1, U) }) }), children: c, onOpenChange: L }); }, Gi = ({ title: t, className: e, classNames: r, children: n, extras: i, width: o, height: s, style: a, ...l }) => { - const [c, u] = L({}), p = H((y, k) => u((b) => ({ ...b, [y]: k })), []), h = H((y) => u((k) => ({ ...k, [y]: void 0 })), []), g = t ? E.createElement("div", { className: "ff-popup-title" }, t) : c == null ? void 0 : c.title, f = i ?? E.createElement("div", { className: "ff-popup-reserved-extras" }, i); - return m(ut.Provider, { value: { ele: c, mount: p, unmount: h }, children: I("div", { className: j("ff-popup ff-popover", e, c.rootClassName), style: { ...a, width: o ?? 260, height: s }, ...l, children: [I("div", { className: j("ff-popup-header", "ff-popover-header", r == null ? void 0 : r.header), children: [g, c == null ? void 0 : c["sub-title"]] }), m("div", { className: j("ff-popup-body", "ff-popover-body", r == null ? void 0 : r.body), children: n }), I("div", { className: j("ff-popup-footer", "ff-popover-footer", r == null ? void 0 : r.footer), children: [f, c == null ? void 0 : c.extras, c == null ? void 0 : c.actions] })] }) }); + const [c, u] = V({}), p = J((y, k) => u((b) => ({ ...b, [y]: k })), []), m = J((y) => u((k) => ({ ...k, [y]: void 0 })), []), g = t ? x.createElement("div", { className: "ff-popup-title" }, t) : c == null ? void 0 : c.title, f = i ?? x.createElement("div", { className: "ff-popup-reserved-extras" }, i); + return h(Xe.Provider, { value: { ele: c, mount: p, unmount: m }, children: D("div", { className: j("ff-popup ff-popover", e, c.rootClassName), style: { ...a, width: o ?? 260, height: s }, ...l, children: [D("div", { className: j("ff-popup-header", "ff-popover-header", r == null ? void 0 : r.header), children: [g, c == null ? void 0 : c.subTitle] }), h("div", { className: j("ff-popup-body", "ff-popover-body", r == null ? void 0 : r.body), children: n }), D("div", { className: j("ff-popup-footer", "ff-popover-footer", r == null ? void 0 : r.footer), children: [f, c == null ? void 0 : c.extras, c == null ? void 0 : c.actions] })] }) }); }; -Nt.propTypes = { widgetType: C.oneOf(["fsdpf-component", "grid-layout-form", "data-list"]) }; -const gt = (t) => function({ className: e, variant: r, children: n, name: i, icon: o, type: s = "default", iconPosition: a = "start", noAuthType: l, onAfterClick: c, onBeforeClick: u, data: p, loading: h, disabled: g, tooltip: f, confirm: y, widget: k = () => { -}, widgetType: b, widgetData: x, widgetProps: S, widgetSetting: $, widgetContainerProps: F, ...A }) { - const { mode: O, ...T } = F || {}, D = nn({ className: e, name: i, type: s, icon: o, iconPosition: a }, r ?? t), P = m(wt, { ...D, ...A, children: n || i }); - if (O === "popover" && !["destroy", "redirect", "func"].includes(b)) return m(Nt, { data: p, widget: k, widgetType: b, widgetData: x, widgetProps: S, widgetSetting: $, widgetContainerProps: T, onAfterClick: c, onBeforeClick: u, children: P }); - const V = w.isEmpty(f) || !f.enabled ? {} : f, M = w.isEmpty(y) ? { enabled: !1 } : Object.assign({ enabled: !0 }, y), [U, X] = L(!1), [Ee, { disabled: q, loading: se }] = Yi({ widget: k, widgetType: b, widgetData: x, widgetProps: S, widgetSetting: $, widgetContainerProps: T }, { onAfterClick: c, onBeforeClick: u }); - return m(qn, { okText: "确定", cancelText: "取消", getPopupContainer: (_) => _, ...M, disabled: q || g, open: U, onOpenChange: (_) => { - if (!_) return X(_); - M.enabled ? X(_) : Ee(p); +vt.propTypes = { widgetType: S.oneOf(["fsdpf-component", "grid-layout-form", "data-list"]) }; +const gt = (t) => function({ className: e, variant: r, children: n, name: i, icon: o, type: s = "default", iconPosition: a = "start", noAuthType: l, onAfterClick: c, onBeforeClick: u, data: p, loading: m, disabled: g, tooltip: f, confirm: y, widget: k = () => { +}, widgetType: b, widgetData: E, widgetProps: C, widgetSetting: $, widgetContainerProps: F, ...I }) { + const { mode: T, ...N } = F || {}, A = sn({ className: e, name: i, type: s, icon: o, iconPosition: a }, r ?? t), P = h(wt, { ...A, ...I, children: n || i }); + if (T === "popover" && !["destroy", "redirect", "func"].includes(b)) return h(vt, { data: p, widget: k, widgetType: b, widgetData: E, widgetProps: C, widgetSetting: $, widgetContainerProps: N, onAfterClick: c, onBeforeClick: u, children: P }); + const L = w.isEmpty(f) || !f.enabled ? {} : f, M = w.isEmpty(y) ? { enabled: !1 } : Object.assign({ enabled: !0 }, y), [U, Z] = V(!1), [xe, { disabled: q, loading: se }] = Yi({ widget: k, widgetType: b, widgetData: E, widgetProps: C, widgetSetting: $, widgetContainerProps: N }, { onAfterClick: c, onBeforeClick: u }); + return h(qn, { okText: "确定", cancelText: "取消", getPopupContainer: (_) => _, ...M, disabled: q || g, open: U, onOpenChange: (_) => { + if (!_) return Z(_); + M.enabled ? Z(_) : xe(p); }, onConfirm: (_) => { - Ee(p, _); + xe(p, _); }, onClick: (_) => { _.stopPropagation(); - }, children: m(Kn, { getPopupContainer: (_) => _, ...V, title: U ? null : V == null ? void 0 : V.title, trigger: ["hover", "click"], children: E.cloneElement(P, { loading: se || h, disabled: q || g }) }) }); + }, children: h(Kn, { getPopupContainer: (_) => _, ...L, title: U ? null : L == null ? void 0 : L.title, trigger: ["hover", "click"], children: x.cloneElement(P, { loading: se || m, disabled: q || g }) }) }); }, R = gt("default"); -R.propTypes = { type: C.oneOf(["primary", "default", "danger", ""]), size: C.oneOf(["large", "middle", "small"]), name: C.string, icon: C.string, iconPosition: C.oneOf(["start", "end"]), data: C.any, widget: C.any, widgetType: C.oneOf(["destroy", "redirect", "func", "component", "fsdpf-component", "grid-layout-form", "grid-layout", "data-list"]), widgetData: C.object, widgetProps: C.object, widgetSetting: C.object, widgetContainerProps: C.object, tooltip: C.exact({ title: C.string.isRequired, placement: C.oneOf(["top", "left", "right", "bottom", "topLeft", "topRight", "bottomLeft", "bottomRight", "leftTop", "leftBottom", "rightTop", "rightBottom"]), enabled: C.oneOfType([C.bool, C.number]), getPopupContainer: C.func }), confirm: C.exact({ title: C.string.isRequired, cancelText: C.string, okText: C.string, okType: C.oneOf(["primary", "default", "danger", ""]), placement: C.oneOf(["top", "left", "right", "bottom", "topLeft", "topRight", "bottomLeft", "bottomRight", "leftTop", "leftBottom", "rightTop", "rightBottom"]), enabled: C.oneOfType([C.bool, C.number]), getPopupContainer: C.func, arrow: C.oneOfType([C.bool, C.exact({ pointAtCenter: C.bool })]) }) }; -const Xi = gt("link"), Zi = gt("circle"), Qi = gt("round"), eo = gt("dashed"), Tr = ({ options: t = [], triggerWeights: e = ["grid-layout-form", "grid-layout", "fsdpf-component", "print"], onAfterClick: r = (g, f, y) => { +R.propTypes = { type: S.oneOf(["primary", "default", "danger", ""]), size: S.oneOf(["large", "middle", "small"]), name: S.string, icon: S.string, iconPosition: S.oneOf(["start", "end"]), data: S.any, widget: S.any, widgetType: S.oneOf(["destroy", "redirect", "func", "component", "fsdpf-component", "grid-layout-form", "grid-layout", "data-list"]), widgetData: S.object, widgetProps: S.object, widgetSetting: S.object, widgetContainerProps: S.object, tooltip: S.exact({ title: S.string.isRequired, placement: S.oneOf(["top", "left", "right", "bottom", "topLeft", "topRight", "bottomLeft", "bottomRight", "leftTop", "leftBottom", "rightTop", "rightBottom"]), enabled: S.oneOfType([S.bool, S.number]), getPopupContainer: S.func }), confirm: S.exact({ title: S.string.isRequired, cancelText: S.string, okText: S.string, okType: S.oneOf(["primary", "default", "danger", ""]), placement: S.oneOf(["top", "left", "right", "bottom", "topLeft", "topRight", "bottomLeft", "bottomRight", "leftTop", "leftBottom", "rightTop", "rightBottom"]), enabled: S.oneOfType([S.bool, S.number]), getPopupContainer: S.func, arrow: S.oneOfType([S.bool, S.exact({ pointAtCenter: S.bool })]) }) }; +const Xi = gt("link"), Zi = gt("circle"), Qi = gt("round"), eo = gt("dashed"), Or = ({ options: t = [], triggerWeights: e = ["grid-layout-form", "grid-layout", "fsdpf-component", "print"], onAfterClick: r = (g, f, y) => { }, onBeforeClick: n = (g, f, y) => { -}, labelVariant: i = "link", labelSize: o, labelRender: s, btnVariant: a, btnSize: l, btnRender: c = (g, f) => m(R, { ...g, data: f }, g.uuid || Lt()), widgetContainerProps: u = {}, children: p, data: h }) => { +}, labelVariant: i = "link", labelSize: o, labelRender: s, btnVariant: a, btnSize: l, btnRender: c = (g, f) => h(R, { ...g, data: f }, g.uuid || Lt()), widgetContainerProps: u = {}, children: p, data: m }) => { if (w.isEmpty(t)) return p; l ?? (l = o), a ?? (a = i); - const [g, f] = W(() => (t || []).reduce((b, x) => { - const S = e.indexOf(x.widgetType); - return S === -1 ? b[1].push(x) : b[0] ? S < e.indexOf(b[0].widgetType) ? (b[1].push(b[0]), b[0] = x) : b[1].push(x) : b[0] = x, b; + const [g, f] = W(() => (t || []).reduce((b, E) => { + const C = e.indexOf(E.widgetType); + return C === -1 ? b[1].push(E) : b[0] ? C < e.indexOf(b[0].widgetType) ? (b[1].push(b[0]), b[0] = E) : b[1].push(E) : b[0] = E, b; }, [null, []]), [t, e]); - s ? p = s(g, h) || p : p || (p = m(wt, { ...nn(Object.assign(g != null && g.name || g != null && g.icon ? {} : { icon: "icon-location" }, g, { size: o }), i) })); - const y = f.map((b) => c(Object.assign({ uuid: b.uuid, type: b.type, name: b.name, widget: b.widget, widgetType: b.widgetType, widgetProps: b.widgetProps, widgetData: b.widgetData, widgetSetting: b.widgetSetting, widgetContainerProps: b.widgetContainerSetting, confirm: b.confirm, onAfterClick: w.partialRight(r, b, h), onBeforeClick: w.partialRight(n, b, h) }, { size: l, variant: a }), h)); + s ? p = s(g, m) || p : p || (p = h(wt, { ...sn(Object.assign(g != null && g.name || g != null && g.icon ? {} : { icon: "icon-location" }, g, { size: o }), i) })); + const y = f.map((b) => c(Object.assign({ uuid: b.uuid, type: b.type, name: b.name, widget: b.widget, widgetType: b.widgetType, widgetProps: b.widgetProps, widgetData: b.widgetData, widgetSetting: b.widgetSetting, widgetContainerProps: b.widgetContainerSetting, confirm: b.confirm, onAfterClick: w.partialRight(r, b, m), onBeforeClick: w.partialRight(n, b, m) }, { size: l, variant: a }), m)); let k = y; - return (y == null ? void 0 : y.length) > 1 && (k = a == "link" ? m(Dt, { split: m(_n, { type: "vertical" }), size: l, children: y }) : m(Dt.Compact, { size: l, children: y })), g ? m(Nt, { widget: g == null ? void 0 : g.widget, widgetType: g == null ? void 0 : g.widgetType, widgetProps: g == null ? void 0 : g.widgetProps, widgetSetting: g == null ? void 0 : g.widgetSetting, widgetContainerProps: Object.assign({}, u, g == null ? void 0 : g.widgetContainerProps), data: h, widgetData: g == null ? void 0 : g.widgetData, extras: k, onAfterClick: w.partialRight(r, g, h), onBeforeClick: w.partialRight(n, g, h), children: p }) : k; + return (y == null ? void 0 : y.length) > 1 && (k = a == "link" ? h(Dt, { split: h(_n, { type: "vertical" }), size: l, children: y }) : h(Dt.Compact, { size: l, children: y })), g ? h(vt, { widget: g == null ? void 0 : g.widget, widgetType: g == null ? void 0 : g.widgetType, widgetProps: g == null ? void 0 : g.widgetProps, widgetSetting: g == null ? void 0 : g.widgetSetting, widgetContainerProps: Object.assign({}, u, g == null ? void 0 : g.widgetContainerProps), data: m, widgetData: g == null ? void 0 : g.widgetData, extras: k, onAfterClick: w.partialRight(r, g, m), onBeforeClick: w.partialRight(n, g, m), children: p }) : k; }; -Tr.propTypes = { triggerWeights: C.array, options: C.arrayOf(C.shape({ ...R.propTypes, widgetType: R.propTypes.widgetType.isRequired })), btnSize: R.propTypes.size, btnRender: C.func, btnVariant: C.oneOf(["", "default", "link", "circle", "round", "dashed"]), labelVariant: C.oneOf(["", "default", "link", "circle", "round", "dashed"]), labelRender: C.func, labelSize: R.propTypes.size, onAfterClick: C.func, onBeforeClick: C.func, widgetContainerProps: R.propTypes.widgetContainerProps, data: R.propTypes.data }, R.Link = Xi, R.Link.defaultProps = R.defaultProps, R.Link.propTypes = R.propTypes, R.Circle = Zi, R.Circle.defaultProps = R.defaultProps, R.Circle.propTypes = R.propTypes, R.Round = Qi, R.Round.defaultProps = R.defaultProps, R.Round.propTypes = R.propTypes, R.Dashed = eo, R.Dashed.defaultProps = R.defaultProps, R.Dashed.propTypes = R.propTypes, R.Popover = Nt, R.GroupPopover = Tr; +Or.propTypes = { triggerWeights: S.array, options: S.arrayOf(S.shape({ ...R.propTypes, widgetType: R.propTypes.widgetType.isRequired })), btnSize: R.propTypes.size, btnRender: S.func, btnVariant: S.oneOf(["", "default", "link", "circle", "round", "dashed"]), labelVariant: S.oneOf(["", "default", "link", "circle", "round", "dashed"]), labelRender: S.func, labelSize: R.propTypes.size, onAfterClick: S.func, onBeforeClick: S.func, widgetContainerProps: R.propTypes.widgetContainerProps, data: R.propTypes.data }, R.Link = Xi, R.Link.defaultProps = R.defaultProps, R.Link.propTypes = R.propTypes, R.Circle = Zi, R.Circle.defaultProps = R.defaultProps, R.Circle.propTypes = R.propTypes, R.Round = Qi, R.Round.defaultProps = R.defaultProps, R.Round.propTypes = R.propTypes, R.Dashed = eo, R.Dashed.defaultProps = R.defaultProps, R.Dashed.propTypes = R.propTypes, R.Popover = vt, R.GroupPopover = Or; const to = ({ fields: t, formProps: e, $close: r }) => { const [n] = ie.useForm(), i = W(() => [{ name: "__PROPS__", value: e }], [e]); - return m(re, { actions: I(E.Fragment, { children: [m(R, { name: "取消", widget: () => r(!1) }), m(R, { name: "确定", type: "primary", widget: () => n.validateFields(!0).then(r) })] }), children: m(ie, { fields: i, form: n, className: "ff-modal-form", children: t == null ? void 0 : t.map(({ code: o, ...s }) => m(nr, { code: o, ...s }, o)) }) }); -}, ro = ({ className: t, classNames: e, $close: r, children: n, title: i, subTitle: o, actions: s, extras: a, ...l }) => I(Qn, { ...l, prefixCls: "ff-drawer", className: j("ff-popup", t), maskMotion: { motionAppear: !0, motionName: "mask-motion" }, motion: (c) => ({ motionAppear: !0, motionName: `panel-motion-${c}` }), children: [I("div", { className: j("ff-popup-header", "ff-drawer-header", e == null ? void 0 : e.header), children: [m("button", { "aria-label": "Close", className: j("ff-popup-close", "ff-drawer-close", e == null ? void 0 : e.close), onClick: l.onClose, children: m(Qt, { type: "close" }) }), i, o] }), m("div", { className: j("ff-popup-body", "ff-drawer-body", e == null ? void 0 : e.body), children: n }), I("div", { className: j("ff-popup-footer", "ff-drawer-footer", e == null ? void 0 : e.footer), children: [a, s] })] }), no = ({ className: t, classNames: e, $close: r, $event: n, children: i, title: o, subTitle: s, actions: a, extras: l, placement: c, ...u }) => { - const { style: p, rest: h } = ((f, y = ["height", "width", "style"]) => { + return h(re, { actions: D(x.Fragment, { children: [h(R, { name: "取消", widget: () => r(!1) }), h(R, { name: "确定", type: "primary", widget: () => n.validateFields(!0).then(r) })] }), children: h(ie, { fields: i, form: n, className: "ff-modal-form", children: t == null ? void 0 : t.map(({ code: o, ...s }) => h(rr, { code: o, ...s }, o)) }) }); +}, ro = ({ className: t, classNames: e, $close: r, children: n, title: i, subTitle: o, actions: s, extras: a, ...l }) => D(Qn, { ...l, prefixCls: "ff-drawer", className: j("ff-popup", t), maskMotion: { motionAppear: !0, motionName: "mask-motion" }, motion: (c) => ({ motionAppear: !0, motionName: `panel-motion-${c}` }), children: [D("div", { className: j("ff-popup-header", "ff-drawer-header", e == null ? void 0 : e.header), children: [h("button", { "aria-label": "Close", className: j("ff-popup-close", "ff-drawer-close", e == null ? void 0 : e.close), onClick: l.onClose, children: h(Qt, { type: "close" }) }), i, o] }), h("div", { className: j("ff-popup-body", "ff-drawer-body", e == null ? void 0 : e.body), children: n }), D("div", { className: j("ff-popup-footer", "ff-drawer-footer", e == null ? void 0 : e.footer), children: [a, s] })] }), no = ({ className: t, classNames: e, $close: r, $event: n, children: i, title: o, subTitle: s, actions: a, extras: l, placement: c, ...u }) => { + const { style: p, rest: m } = ((f, y = ["height", "width", "style"]) => { const k = { ...f }, b = {}; - for (const x of y) x === "style" ? Object.assign(b, k.style) : k[x] !== void 0 && (b[x] = k[x]), delete k[x]; + for (const E of y) E === "style" ? Object.assign(b, k.style) : k[E] !== void 0 && (b[E] = k[E]), delete k[E]; return { style: b, rest: k }; })(u), g = (n == null ? void 0 : n.pageX) === void 0 ? { animation: null, maskAnimation: null, mousePosition: { x: null, y: null } } : { animation: "zoom", maskAnimation: "fade", mousePosition: { x: n == null ? void 0 : n.pageX, y: n == null ? void 0 : n.pageY } }; - return m(ei, { ...h, ...g, prefixCls: "ff-modal", className: j("ff-popup", t), modalRender: () => I(E.Fragment, { children: [m("button", { className: j("ff-popup-close", "ff-modal-close", e == null ? void 0 : e.close), onClick: h.onClose, children: m(Qt, { type: "close" }) }), I("div", { className: j("ff-modal-content"), style: p, children: [I("div", { className: j("ff-popup-header", "ff-modal-header", e == null ? void 0 : e.header), children: [o, s] }), m("div", { className: j("ff-popup-body", "ff-modal-body", e == null ? void 0 : e.body), children: i }), I("div", { className: j("ff-popup-footer", "ff-modal-footer", e == null ? void 0 : e.footer), children: [l, a] })] })] }) }); -}, on = ({ placement: t, $close: e, $event: r, children: n, title: i, ...o }) => { - const [s, a] = L({}), [l, c] = L(!0), u = H((f, y) => a((k) => ({ ...k, [f]: y })), []), p = H((f) => a((y) => ({ ...y, [f]: void 0 })), []); - let h = { ...o, className: s.rootClassName, title: s.title || i && E.createElement("div", { className: j("ff-popup-title") }, i), subTitle: s["sub-title"], actions: s.actions, extras: s.extras, children: n, $close: e, $event: r, onClose: () => c(!1) }; + return h(ei, { ...m, ...g, prefixCls: "ff-modal", className: j("ff-popup", t), modalRender: () => D(x.Fragment, { children: [h("button", { className: j("ff-popup-close", "ff-modal-close", e == null ? void 0 : e.close), onClick: m.onClose, children: h(Qt, { type: "close" }) }), D("div", { className: j("ff-modal-content"), style: p, children: [D("div", { className: j("ff-popup-header", "ff-modal-header", e == null ? void 0 : e.header), children: [o, s] }), h("div", { className: j("ff-popup-body", "ff-modal-body", e == null ? void 0 : e.body), children: i }), D("div", { className: j("ff-popup-footer", "ff-modal-footer", e == null ? void 0 : e.footer), children: [l, a] })] })] }) }); +}, an = ({ placement: t, $close: e, $event: r, children: n, title: i, ...o }) => { + const [s, a] = V({}), [l, c] = V(!0), u = J((f, y) => a((k) => ({ ...k, [f]: y })), []), p = J((f) => a((y) => ({ ...y, [f]: void 0 })), []); + let m = { ...o, className: s.rootClassName, title: s.title || i && x.createElement("div", { className: j("ff-popup-title") }, i), subTitle: s.subTitle, actions: s.actions, extras: s.extras, children: n, $close: e, $event: r, onClose: () => c(!1) }; const g = () => { e(!1); }; - return m(ut.Provider, { value: { ele: s, mount: u, unmount: p }, children: t && t !== "center" ? m(ro, { ...h, placement: t, open: l, afterOpenChange: (f) => !f && g() }) : m(no, { ...h, visible: l, afterClose: g }) }); + return h(Xe.Provider, { value: { ele: s, mount: u, unmount: p }, children: t && t !== "center" ? h(ro, { ...m, placement: t, open: l, afterOpenChange: (f) => !f && g() }) : h(no, { ...m, visible: l, afterClose: g }) }); }; -on.propTypes = { placement: C.oneOf(["center", "left", "top", "right", "bottom"]) }; +an.propTypes = { placement: S.oneOf(["center", "left", "top", "right", "bottom"]) }; const io = ({ widget: t, widgetProps: e, $close: r, onSetProps: n }) => { - const [i, o] = L(e || {}), s = Fr(e); + const [i, o] = V(e || {}), s = jr(e); Yt(() => { - const l = s ?? {}, c = e ?? {}, u = Object.keys({ ...l, ...c }).reduce((p, h) => (l[h] !== c[h] && (p[h] = c[h]), p), {}); + const l = s ?? {}, c = e ?? {}, u = Object.keys({ ...l, ...c }).reduce((p, m) => (l[m] !== c[m] && (p[m] = c[m]), p), {}); Object.keys(u).length > 0 && o((p) => ({ ...p, ...u })); }, [e]); - const a = H((l) => { + const a = J((l) => { o((c) => ({ ...c, ...l })), n == null || n(l); }, [n]); - return E.isValidElement(t) ? E.cloneElement(t, { ...i, $close: r, $setProps: a }) : t != null && t.name || Cr.isForwardRef(t) || (t == null ? void 0 : t.$$typeof) === Cr.ForwardRef ? E.createElement(t, { ...i, $close: r, $setProps: a }) : t; + return x.isValidElement(t) ? x.cloneElement(t, { ...i, $close: r, $setProps: a }) : t != null && t.name || kr.isForwardRef(t) || (t == null ? void 0 : t.$$typeof) === kr.ForwardRef ? x.createElement(t, { ...i, $close: r, $setProps: a }) : t; }, G = () => { const [t, e] = jn({ maxCount: 6, motion: { motionName: "ff-notification-fade", motionAppear: !0, motionEnter: !0, motionLeave: !0, onLeaveStart: (o) => { const { offsetHeight: s } = o; return { height: s }; - }, onLeaveActive: () => ({ height: 0, opacity: 0, margin: 0 }) }, prefixCls: "ff-notification" }), [, r] = E.useReducer((o) => o + 1, 0); + }, onLeaveActive: () => ({ height: 0, opacity: 0, margin: 0 }) }, prefixCls: "ff-notification" }), [, r] = x.useReducer((o) => o + 1, 0); z(() => { G.$onClick = n, G.$queue.forEach(([o, s, a, l]) => { l == null || l(i([s, a], ...o)); @@ -1011,15 +1011,15 @@ const io = ({ widget: t, widgetProps: e, $close: r, onSetProps: n }) => { return c.update = l, c; }, i = ([o, s], a, l = {}, c = {}) => { const u = G.$index++, p = (f) => ((y, k) => (G.$popups.delete(y), r(), k == null ? void 0 : k()))(u, () => o(f)); - if (a === Vr) return t.open({ ...c, key: u, content: E.createElement(a, { ...l, $close: () => t.close(u) }), onClose: () => p() }), () => { + if (a === Dr) return t.open({ ...c, key: u, content: x.createElement(a, { ...l, $close: () => t.close(u) }), onClose: () => p() }), () => { }; - const { $setProps: h, ...g } = l; - return G.$popups.set(u, { widget: a, widgetProps: g, widgetContainerProps: c, $close: p, onSetProps: h }), r(), (f, y) => { + const { $setProps: m, ...g } = l; + return G.$popups.set(u, { widget: a, widgetProps: g, widgetContainerProps: c, $close: p, onSetProps: m }), r(), (f, y) => { const k = G.$popups.get(u); k && (G.$popups.set(u, { ...k, widgetProps: f ? { ...k.widgetProps, ...f } : k.widgetProps, widgetContainerProps: y ? { ...k.widgetContainerProps, ...y } : k.widgetContainerProps }), r()); }; }; - return I(E.Fragment, { children: [Array.from(G.$popups).map(([o, { widget: s, widgetProps: a, widgetContainerProps: l, $close: c, onSetProps: u }]) => m(on, { maskClosable: !1, $event: a == null ? void 0 : a.$event, ...l, $close: c, children: m(io, { widget: s, widgetProps: a, $close: c, onSetProps: u }) }, o)), e] }); + return D(x.Fragment, { children: [Array.from(G.$popups).map(([o, { widget: s, widgetProps: a, widgetContainerProps: l, $close: c, onSetProps: u }]) => h(an, { maskClosable: !1, $event: a == null ? void 0 : a.$event, ...l, $close: c, children: h(io, { widget: s, widgetProps: a, $close: c, onSetProps: u }) }, o)), e] }); }; G.$popups = /* @__PURE__ */ new Map(), G.$index = 0, G.$queue = [], G.$onClick = (...t) => { const e = new Promise((r, n) => { @@ -1029,22 +1029,22 @@ G.$popups = /* @__PURE__ */ new Map(), G.$index = 0, G.$queue = [], G.$onClick = }); return e; }; -const Or = (t, e, r = {}) => G.$onClick(t, e, r), jt = (t, { showProgress: e, duration: r, ...n } = { duration: 1.5 }) => G.$onClick(Vr, { content: t, ...n }, { showProgress: e, duration: r }), Se = { modal: Or, confirm: (t, e = {}) => G.$onClick(ni, { content: t, ...e }, { placement: "center" }), form: (t, e = {}, r = {}) => Or(to, { formProps: r, fields: t }, { placement: "center", ...e }).then((n) => { +const Rr = (t, e, r = {}) => G.$onClick(t, e, r), jt = (t, { showProgress: e, duration: r, ...n } = { duration: 1.5 }) => G.$onClick(Dr, { content: t, ...n }, { showProgress: e, duration: r }), Se = { modal: Rr, confirm: (t, e = {}) => G.$onClick(ni, { content: t, ...e }, { placement: "center" }), form: (t, e = {}, r = {}) => Rr(to, { formProps: r, fields: t }, { placement: "center", ...e }).then((n) => { if (n === !1) throw !1; return n; }), notification: jt, success: (t, e = { duration: 1.5 }) => jt(t, { ...e, className: "ff-notification-success", icon: "check" }), error: (t, e = { duration: 1.5 }) => jt(t, { ...e, className: "ff-notification-error", icon: "close" }) }; -Xe.configure({ showSpinner: !1 }); -const sn = () => { +Ze.configure({ showSpinner: !1 }); +const ln = () => { const t = window.localStorage.getItem(yt); return Object.freeze({ Platform: "web", SaaS: window.localStorage.getItem("SaaS"), Authorization: t ? `Bearer ${t} ` : void 0 }); }; -Le.interceptors.request.use((t) => (Object.assign(t.headers, sn()), Xe.inc(), t), (t) => (Xe.done(), Promise.reject({ code: -1, msg: t }))), Le.interceptors.response.use(({ data: t, headers: e }) => (Xe.done(), { ...t, res: e == null ? void 0 : e.res }), function(t) { - return Xe.done(), Promise.reject(t.message); +Le.interceptors.request.use((t) => (Object.assign(t.headers, ln()), Ze.inc(), t), (t) => (Ze.done(), Promise.reject({ code: -1, msg: t }))), Le.interceptors.response.use(({ data: t, headers: e }) => (Ze.done(), { ...t, res: e == null ? void 0 : e.res }), function(t) { + return Ze.done(), Promise.reject(t.message); }), window.addEventListener("unhandledrejection", Vt.onUnhandledRejection), Vt.onMsg = (t, e) => Se[[0, 1].includes(t) ? "success" : "error"](e).then(() => t === 20300 && ke.redirect(Ue.get("Common.WEBSITE_LOGIN_PAGE"))); var Je, Be, He; const ee = class ee { constructor() { - N(this, "appUrl", ""); + O(this, "appUrl", ""); v(this, Je, null); return d(ee, Be) || (K(ee, He, new Vt()), K(ee, Be, new Proxy(this, { get(e, r) { if (r in e) { @@ -1061,7 +1061,7 @@ const ee = class ee { return Le; } get headers() { - return sn(); + return ln(); } mock(e = {}) { return d(this, Je) ?? K(this, Je, new Ln(Le, { onNoMatch: "passthrough", ...e })); @@ -1071,29 +1071,29 @@ const ee = class ee { (e = d(this, Je)) == null || e.restore(), K(this, Je, null); } }; -Je = new WeakMap(), Be = new WeakMap(), He = new WeakMap(), v(ee, Be), v(ee, He), N(ee, "getInstance", () => d(ee, Be) ?? K(ee, Be, new ee())); +Je = new WeakMap(), Be = new WeakMap(), He = new WeakMap(), v(ee, Be), v(ee, He), O(ee, "getInstance", () => d(ee, Be) ?? K(ee, Be, new ee())); let Jt = ee; const B = Jt.getInstance(); -class or extends Error { +class ir extends Error { constructor(e, r) { - super(r), Error.captureStackTrace && Error.captureStackTrace(this, or), !r instanceof Ze && (this.name = `${e} Error Runtime`); + super(r), Error.captureStackTrace && Error.captureStackTrace(this, ir), !r instanceof Qe && (this.name = `${e} Error Runtime`); } } -class Ze extends Error { +class Qe extends Error { constructor(e, ...r) { - super(...r), Error.captureStackTrace && Error.captureStackTrace(this, Ze), this.name = `${e} Not Found`; + super(...r), Error.captureStackTrace && Error.captureStackTrace(this, Qe), this.name = `${e} Not Found`; } } const At = "mine", yt = "token", It = "user-login-intended-url"; -var Ae, Ye, ot; +var Ae, Ye, st; const fe = class fe { constructor() { v(this, Ye, /* @__PURE__ */ new Map()); - v(this, ot, (/* @__PURE__ */ new Date()).toISOString().slice(0, 10)); - N(this, "setPkgVersion", (e) => { - K(this, ot, e); + v(this, st, (/* @__PURE__ */ new Date()).toISOString().slice(0, 10)); + O(this, "setPkgVersion", (e) => { + K(this, st, e); }); - N(this, "setVendor", (e, r) => d(this, Ye).set(e, new ti(r, async (n, i) => { + O(this, "setVendor", (e, r) => d(this, Ye).set(e, new ti(r, async (n, i) => { var s, a; if (!(n != null && n.default)) throw "@pkg not found"; let o = () => i; @@ -1102,25 +1102,25 @@ const fe = class fe { case typeof (o = (a = n.default) == null ? void 0 : a[`./${i}/index.js`]): return o(); } - throw new Ze(i); + throw new Qe(i); }))); - N(this, "getWidgetComponent", async (e) => { + O(this, "getWidgetComponent", async (e) => { if (!e) throw "getWidgetComponent widget is required"; if (e != null && e.startsWith("blob:") || e != null && e.startsWith("http:") || e != null && e.startsWith("https:")) return await import(e); const [, r] = e == null ? void 0 : e.split("@pkg/"); - if (!r) throw new Ze(e); + if (!r) throw new Qe(e); try { - return d(this, Ye).has("pkg") ? await d(this, Ye).get("pkg").get(r) : await import(`${B.appUrl}/api/pkg-import/web?name=${e}&v=${d(this, ot)}`); + return d(this, Ye).has("pkg") ? await d(this, Ye).get("pkg").get(r) : await import(`${B.appUrl}/api/pkg-import/web?name=${e}&v=${d(this, st)}`); } catch (n) { - throw new or(e, n); + throw new ir(e, n); } }); - N(this, "getRoutes", () => B.get("/api/my-router").then((e) => [...e, { uuid: "data-list-setting", isLayout: !0, uri: "/data-list-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/ff-design/components/DataListSetting", extra: { layout: "@pkg/ff-design/frameworks/DesignTheme" } }, { uuid: "grid-layout-setting", isLayout: !0, uri: "/grid-layout-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/ff-design/components/GridLayoutSetting", extra: { layout: "@pkg/ff-design/frameworks/DesignTheme" } }, { uuid: "grid-layout-form-setting", isLayout: !0, uri: "/grid-layout-form-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/ff-design/components/GridLayoutFormSetting", extra: { layout: "@pkg/ff-design/frameworks/DesignTheme" } }, { uuid: "resource-api-setting", isLayout: !0, uri: "/resource-api-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/ff-design/components/ResourceApiSetting", extra: { layout: "@pkg/ff-design/frameworks/DesignTheme" } }, { uuid: "charts-setting", isLayout: !0, uri: "/resource-api-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/ff-design/components/ChartsSetting", extra: { layout: "@pkg/ff-design/frameworks/DesignTheme" } }, { uuid: "fsm-setting", isLayout: !0, uri: "/fsm-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/ff-design/components/FsmSetting", extra: { layout: "@pkg/ff-design/frameworks/DesignTheme" } }, { uuid: "component-setting", isLayout: !0, uri: "/component-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/ff-design/components/ComponentSetting", extra: { layout: "@pkg/ff-design/frameworks/DesignTheme" } }, { uuid: "login", uri: "/login", name: "登录", type: "fsdpf-component", isLogin: !1, component: "@pkg/ff/components/Login" }, { uuid: "not-found", uri: "*", name: "Not Found", type: "fsdpf-component", isLogin: !1, component: "@pkg/ff/components/NotFound" }].map(({ uuid: r, ...n }) => [r, { uuid: r, ...n }])).then((e) => new Map(e))); - N(this, "getMenus", () => B.get("/api/my-menu")); - N(this, "getConfigure", () => B.get("api/init-configure")); - N(this, "getWidgetOperationAuth", () => B.get("/api/init-widget-operation-auth").then((e) => e.reduce((r, { uuid: n, auth: i }) => [...r, [n, i]], []))); - N(this, "getPhoneNumber", (e) => B.get(`/api/user-wx-phone-number/${e}`)); - N(this, "getUserToken", () => { + O(this, "getRoutes", () => B.get("/api/my-router").then((e) => [...e, { uuid: "data-list-setting", isLayout: !0, uri: "/data-list-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/ff-design/components/DataListSetting", extra: { layout: "@pkg/ff-design/frameworks/DesignTheme" } }, { uuid: "grid-layout-setting", isLayout: !0, uri: "/grid-layout-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/ff-design/components/GridLayoutSetting", extra: { layout: "@pkg/ff-design/frameworks/DesignTheme" } }, { uuid: "grid-layout-form-setting", isLayout: !0, uri: "/grid-layout-form-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/ff-design/components/GridLayoutFormSetting", extra: { layout: "@pkg/ff-design/frameworks/DesignTheme" } }, { uuid: "resource-api-setting", isLayout: !0, uri: "/resource-api-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/ff-design/components/ResourceApiSetting", extra: { layout: "@pkg/ff-design/frameworks/DesignTheme" } }, { uuid: "charts-setting", isLayout: !0, uri: "/resource-api-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/ff-design/components/ChartsSetting", extra: { layout: "@pkg/ff-design/frameworks/DesignTheme" } }, { uuid: "fsm-setting", isLayout: !0, uri: "/fsm-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/ff-design/components/FsmSetting", extra: { layout: "@pkg/ff-design/frameworks/DesignTheme" } }, { uuid: "component-setting", isLayout: !0, uri: "/component-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/ff-design/components/ComponentSetting", extra: { layout: "@pkg/ff-design/frameworks/DesignTheme" } }, { uuid: "login", uri: "/login", name: "登录", type: "fsdpf-component", isLogin: !1, component: "@pkg/ff/components/Login" }, { uuid: "not-found", uri: "*", name: "Not Found", type: "fsdpf-component", isLogin: !1, component: "@pkg/ff/components/NotFound" }].map(({ uuid: r, ...n }) => [r, { uuid: r, ...n }])).then((e) => new Map(e))); + O(this, "getMenus", () => B.get("/api/my-menu")); + O(this, "getConfigure", () => B.get("api/init-configure")); + O(this, "getWidgetOperationAuth", () => B.get("/api/init-widget-operation-auth").then((e) => e.reduce((r, { uuid: n, auth: i }) => [...r, [n, i]], []))); + O(this, "getPhoneNumber", (e) => B.get(`/api/user-wx-phone-number/${e}`)); + O(this, "getUserToken", () => { const e = window.localStorage.getItem(yt); if (!e) return ""; const r = e.split("."); @@ -1129,14 +1129,14 @@ const fe = class fe { if (Math.floor((/* @__PURE__ */ new Date()).getTime() / 1e3) - n > 2592e3) throw "登录令牌已过期, 请重新登录!"; return e; }); - N(this, "checkUserToken", () => { + O(this, "checkUserToken", () => { try { return !!this.getUserToken(); } catch { return !1; } }); - N(this, "getUserInfo", (e = !0) => { + O(this, "getUserInfo", (e = !0) => { var r; try { const n = this.getUserToken(); @@ -1148,30 +1148,30 @@ const fe = class fe { } return Promise.resolve(null); }); - N(this, "login", (e, r, n = {}) => B.post("/api/user-token", { username: e, passwd: Vn.hash(r), platform: "web", ...n }).then(({ token: i }) => (window.localStorage.setItem(yt, i), i)).then(async (i) => (await this.initAppEnv(), i))); - N(this, "setLoginIntendedUrl", (e) => sessionStorage.setItem(It, e)); - N(this, "getLoginIntendedUrl", (e = !1) => { + O(this, "login", (e, r, n = {}) => B.post("/api/user-token", { username: e, passwd: Vn.hash(r), platform: "web", ...n }).then(({ token: i }) => (window.localStorage.setItem(yt, i), i)).then(async (i) => (await this.initAppEnv(), i))); + O(this, "setLoginIntendedUrl", (e) => sessionStorage.setItem(It, e)); + O(this, "getLoginIntendedUrl", (e = !1) => { const r = sessionStorage.getItem(It); return e && sessionStorage.removeItem(It), r; }); - N(this, "logout", (e) => (window.localStorage.removeItem(At), window.localStorage.removeItem(yt), e == null ? void 0 : e())); - N(this, "initAppEnv", async () => { + O(this, "logout", (e) => (window.localStorage.removeItem(At), window.localStorage.removeItem(yt), e == null ? void 0 : e())); + O(this, "initAppEnv", async () => { const [e, r, n, i] = await Promise.all([this.getWidgetOperationAuth(), this.getRoutes(), this.getMenus(), this.getConfigure()]); - return Dr.init(e), Ue.init(i), ke.init(r, n), Ct.init(Ue.get("Common.ICONFONT")), { widgetOperationAuth: e, routes: r, menus: n, configures: i }; + return Mr.init(e), Ue.init(i), ke.init(r, n), Ct.init(Ue.get("Common.ICONFONT")), { widgetOperationAuth: e, routes: r, menus: n, configures: i }; }); if (d(fe, Ae)) return d(fe, Ae); } }; -Ae = new WeakMap(), Ye = new WeakMap(), ot = new WeakMap(), v(fe, Ae, null), N(fe, "getInstance", () => (d(fe, Ae) || K(fe, Ae, new fe()), d(fe, Ae))); +Ae = new WeakMap(), Ye = new WeakMap(), st = new WeakMap(), v(fe, Ae, null), O(fe, "getInstance", () => (d(fe, Ae) || K(fe, Ae, new fe()), d(fe, Ae))); let Ht = fe; -const Z = Ht.getInstance(), qo = E.createContext({ user: {}, initUser: () => { -}, initUserComplete: !1 }), Ko = E.createContext({ set: () => { +const X = Ht.getInstance(), qo = x.createContext({ user: {}, initUser: () => { +}, initUserComplete: !1 }), Ko = x.createContext({ set: () => { }, get: () => { }, assign: () => { }, currentRoute: () => { -} }), an = (t) => { +} }), or = (t) => { if (!t) return !1; - if (t.prototype instanceof E.Component || t.$$typeof) return !0; + if (t.prototype instanceof x.Component || t.$$typeof) return !0; if (typeof t == "function") { const e = t.displayName || t.name; return !e || /^[A-Z]/.test(e); @@ -1182,12 +1182,12 @@ const Z = Ht.getInstance(), qo = E.createContext({ user: {}, initUser: () => { let r = document.querySelector(`style[ff-style-token="${e}"]`); return r ? (r.innerHTML = t, t) : (r = document.createElement("style"), r.setAttribute("ff-style-token", e), r.setAttribute("type", "text/css"), r.innerHTML = t, document.head.appendChild(r), t); }; -var Pe, Ge, ve, we, be, ne, te, Y, Ce, st, at, lt, ct, xt, dt; +var Pe, Ge, Ne, we, be, ne, te, Y, Ce, at, lt, ct, dt, Et, ut; const sr = class sr { constructor(e, r = "/") { v(this, Pe, "/"); v(this, Ge, /* @__PURE__ */ new Set()); - v(this, ve, (e) => { + v(this, Ne, (e) => { for (const r of d(this, Ge)) try { r(e); } catch (n) { @@ -1233,8 +1233,8 @@ const sr = class sr { const r = d(this, be).call(this, e), n = ue.basename(r), i = ue.dirname(r); return { parent: d(this, Y).call(this, i), name: n }; }); - v(this, st, (e, r, n) => n === !1 ? e : n === "root" ? e.map((i) => ue.join(r, i)) : n === !0 || n === "working" ? e.map((i) => ue.relative(d(this, Pe), ue.join(r, i))) : e); - v(this, at, async (e, r, n, i = "") => { + v(this, at, (e, r, n) => n === !1 ? e : n === "root" ? e.map((i) => ue.join(r, i)) : n === !0 || n === "working" ? e.map((i) => ue.relative(d(this, Pe), ue.join(r, i))) : e); + v(this, lt, async (e, r, n, i = "") => { const o = [], s = d(this, Y).call(this, e); if (!s || s.type !== "dir") return o; const a = s.children; @@ -1243,8 +1243,8 @@ const sr = class sr { try { if (l.type === "file") r(n ? p : c) && o.push(p); else if (l.type === "dir" && n) { - const h = await d(this, at).call(this, u, r, n, p); - o.push(...h); + const m = await d(this, lt).call(this, u, r, n, p); + o.push(...m); } } catch { continue; @@ -1252,12 +1252,12 @@ const sr = class sr { } return o; }); - v(this, lt, async (e, r, n, i = "") => { + v(this, ct, async (e, r, n, i = "") => { const o = [], s = Array.isArray(r) ? r : [r], a = d(this, Y).call(this, e); if (!a || a.type !== "dir") return o; if (!n) { - for (const c of s) if (d(this, ct).call(this, c)) { - const u = await d(this, xt).call(this, e, c); + for (const c of s) if (d(this, dt).call(this, c)) { + const u = await d(this, Et).call(this, e, c); o.push(...u); } else { const u = ue.join(e, c), p = d(this, be).call(this, u); @@ -1267,17 +1267,17 @@ const sr = class sr { } const l = a.children; for (const c of l) { - const u = c.name, p = e === "/" ? `/${u}` : `${e}/${u}`, h = i ? `${i}/${u}` : u; + const u = c.name, p = e === "/" ? `/${u}` : `${e}/${u}`, m = i ? `${i}/${u}` : u; try { if (c.type === "file") for (const g of s) { let f = !1; - if (f = d(this, ct).call(this, g) ? d(this, dt).call(this, u, g) : u === g, f) { - o.push(h); + if (f = d(this, dt).call(this, g) ? d(this, ut).call(this, u, g) : u === g, f) { + o.push(m); break; } } else if (c.type === "dir") { - const g = await d(this, lt).call(this, p, r, n, h); + const g = await d(this, ct).call(this, p, r, n, m); o.push(...g); } } catch { @@ -1286,15 +1286,15 @@ const sr = class sr { } return o; }); - v(this, ct, (e) => /[*?[\]{}]/.test(e)); - v(this, xt, async (e, r) => { + v(this, dt, (e) => /[*?[\]{}]/.test(e)); + v(this, Et, async (e, r) => { const n = [], i = d(this, Y).call(this, e); if (!i || i.type !== "dir") return n; const o = i.children.map((s) => s.name); - for (const s of o) d(this, dt).call(this, s, r) && n.push(s); + for (const s of o) d(this, ut).call(this, s, r) && n.push(s); return n; }); - v(this, dt, (e, r) => { + v(this, ut, (e, r) => { const n = r.replace(/\./g, "\\.").replace(/\*/g, ".*").replace(/\?/g, ".").replace(/\{([^}]+)\}/g, (i, o) => "(" + o.split(",").join("|") + ")"); return new RegExp(`^${n}$`).test(e); }); @@ -1331,7 +1331,7 @@ const sr = class sr { if (!i) throw new Error(`ENOENT: no such file or directory, open '${e}'`); if (i.type !== "dir") throw new Error("ENOTDIR: not a directory"); const s = i.children.findIndex((c) => c.name === o), a = s >= 0, l = { name: o, type: "file", content: r, lastModified: Date.now() }; - a ? i.children[s] = l : i.children.push(l), d(this, we).call(this, i), d(this, ve).call(this, { action: a ? "update" : "create", path: n, type: "file", timestamp: Date.now() }); + a ? i.children[s] = l : i.children.push(l), d(this, we).call(this, i), d(this, Ne).call(this, { action: a ? "update" : "create", path: n, type: "file", timestamp: Date.now() }); } async mkdir(e, r = {}) { const n = d(this, ne).call(this, e); @@ -1345,7 +1345,7 @@ const sr = class sr { const { parent: l, name: c } = d(this, Ce).call(this, s); if (l && l.type === "dir") { const u = { name: c, type: "dir", children: [], lastModified: Date.now() }; - l.children.push(u), d(this, we).call(this, l), d(this, ve).call(this, { action: "create", path: d(this, be).call(this, s), type: "dir", timestamp: Date.now() }); + l.children.push(u), d(this, we).call(this, l), d(this, Ne).call(this, { action: "create", path: d(this, be).call(this, s), type: "dir", timestamp: Date.now() }); } } } else { @@ -1354,7 +1354,7 @@ const sr = class sr { if (o.type !== "dir") throw new Error("ENOTDIR: not a directory"); if (o.children.find((l) => l.name === s)) throw new Error(`EEXIST: file already exists, mkdir '${e}'`); const a = { name: s, type: "dir", children: [], lastModified: Date.now() }; - o.children.push(a), d(this, we).call(this, o), d(this, ve).call(this, { action: "create", path: n, type: "dir", timestamp: Date.now() }); + o.children.push(a), d(this, we).call(this, o), d(this, Ne).call(this, { action: "create", path: n, type: "dir", timestamp: Date.now() }); } } async unlink(e) { @@ -1365,7 +1365,7 @@ const sr = class sr { const o = n.children.findIndex((s) => s.name === i); if (o < 0) throw new Error(`ENOENT: no such file or directory, unlink '${e}'`); if (n.children[o].type !== "file") throw new Error(`EISDIR: illegal operation on a directory, unlink '${e}'`); - n.children.splice(o, 1), d(this, we).call(this, n), d(this, ve).call(this, { action: "delete", path: r, type: "file", timestamp: Date.now() }); + n.children.splice(o, 1), d(this, we).call(this, n), d(this, Ne).call(this, { action: "delete", path: r, type: "file", timestamp: Date.now() }); } async rmdir(e, r = {}) { const n = d(this, ne).call(this, e); @@ -1377,7 +1377,7 @@ const sr = class sr { const a = i.children[s]; if (a.type !== "dir") throw new Error(`ENOTDIR: not a directory, rmdir '${e}'`); if (!r.recursive && a.children.length > 0) throw new Error(`ENOTEMPTY: directory not empty, rmdir '${e}'`); - i.children.splice(s, 1), d(this, we).call(this, i), d(this, ve).call(this, { action: "delete", path: n, type: "dir", timestamp: Date.now() }); + i.children.splice(s, 1), d(this, we).call(this, i), d(this, Ne).call(this, { action: "delete", path: n, type: "dir", timestamp: Date.now() }); } async rename(e, r) { const n = d(this, ne).call(this, e), i = d(this, ne).call(this, r); @@ -1388,7 +1388,7 @@ const sr = class sr { if (!a) throw new Error(`ENOENT: no such file or directory, rename '${e}' -> '${r}'`); if (d(this, Y).call(this, i)) throw new Error(`EEXIST: file already exists, rename '${e}' -> '${r}'`); const c = o.children.findIndex((p) => p.name === s), u = { ...o.children[c], name: l, lastModified: Date.now() }; - o.children.splice(c, 1), a.children.push(u), d(this, we).call(this, o), o !== a && d(this, we).call(this, a), d(this, ve).call(this, { action: "rename", path: i, oldPath: n, type: u.type, timestamp: Date.now() }); + o.children.splice(c, 1), a.children.push(u), d(this, we).call(this, o), o !== a && d(this, we).call(this, a), d(this, Ne).call(this, { action: "rename", path: i, oldPath: n, type: u.type, timestamp: Date.now() }); } async exists(e) { const r = d(this, ne).call(this, e); @@ -1422,15 +1422,15 @@ const sr = class sr { if (o.type !== "dir") throw new Error(`ENOTDIR: not a directory '${e}'`); const { recursive: s = !1, fullPath: a = !1 } = n; if (typeof r == "function") { - const c = await d(this, at).call(this, i, r, s); - return d(this, st).call(this, c, i, a); + const c = await d(this, lt).call(this, i, r, s); + return d(this, at).call(this, c, i, a); } - const l = await d(this, lt).call(this, i, r, s); - return d(this, st).call(this, l, i, a); + const l = await d(this, ct).call(this, i, r, s); + return d(this, at).call(this, l, i, a); } }; -Pe = new WeakMap(), Ge = new WeakMap(), ve = new WeakMap(), we = new WeakMap(), be = new WeakMap(), ne = new WeakMap(), te = new WeakMap(), Y = new WeakMap(), Ce = new WeakMap(), st = new WeakMap(), at = new WeakMap(), lt = new WeakMap(), ct = new WeakMap(), xt = new WeakMap(), dt = new WeakMap(); -let Rr = sr; +Pe = new WeakMap(), Ge = new WeakMap(), Ne = new WeakMap(), we = new WeakMap(), be = new WeakMap(), ne = new WeakMap(), te = new WeakMap(), Y = new WeakMap(), Ce = new WeakMap(), at = new WeakMap(), lt = new WeakMap(), ct = new WeakMap(), dt = new WeakMap(), Et = new WeakMap(), ut = new WeakMap(); +let Fr = sr; const oo = async (t, e = "/", r = "") => { try { const n = await t.stat(e), i = e === "/" ? "/" : ue.basename(e), o = { title: i, key: r ? `${r}${e}` : e, isLeaf: n.isFile() }; @@ -1464,11 +1464,11 @@ const oo = async (t, e = "/", r = "") => { return null; } }; -class so extends E.Component { +class so extends x.Component { constructor() { super(...arguments); - N(this, "state", { error: null }); - N(this, "reset", () => { + O(this, "state", { error: null }); + O(this, "reset", () => { var r, n; (n = (r = this.props).onReset) == null || n.call(r), this.setState({ error: null }); }); @@ -1496,31 +1496,46 @@ class so extends E.Component { return this.props.children; } } -const Jo = ({ widget: t, widgetSetting: e, widgetProps: r, fallback: n = null, fallbackOnError: i, onError: o }) => { - const [s, a] = rr(r), l = W(() => t ? E.lazy(() => Z.getWidgetComponent(t).catch((c) => ({ default: () => `${c}` }))) : null, [t]); - return l ? m(so, { fallback: i, onError: o, children: m(Fn, { fallback: n, children: m(l, { ...s, $setProps: a, $setting: e }) }) }) : m(ri, {}); +const Jo = ({ widget: t, widgetProps: e, widgetSetting: r, theme: n, themeProps: i, className: o, classNames: s, style: a, styles: l, fallback: c = null, fallbackOnError: u, onError: p }) => { + const [m, g] = V({}), f = J((A, P) => g((L) => ({ ...L, [A]: P })), []), y = J((A) => g((P) => ({ ...P, [A]: void 0 })), []), { loading: k, value: b, error: E } = wr(async () => { + if (!t) return null; + if (x.isValidElement(t)) return t; + if (or(t)) return x.createElement(t); + const { default: A } = await X.getWidgetComponent(t); + return x.createElement(A); + }, [t]), { value: C } = wr(async () => { + if (!n) return null; + if (typeof n == "function") return n; + const { default: A } = await X.getWidgetComponent(n); + return (P) => x.createElement(A, P); + }, [n]); + if (k) return c; + if (!t || b === null) return h(ri, {}); + if (E) return p == null || p(E, null), typeof u == "function" ? u(E, null) : u ?? String(E); + const $ = x.cloneElement(b, { ...e, $setting: r }), F = { ele: m, mount: f, unmount: y }, { rootClassName: I, ...T } = m, N = { ...T, children: $, className: j(o, I), classNames: s, style: a, styles: l, $setting: i }; + return h(so, { fallback: u, onError: p, children: h(Xe.Provider, { value: F, children: C ? C(N) : $ }) }); }; export { Mo as $, li as A, - No as B, + vo as B, To as C, bt as D, - Ur as E, + Wr as E, Wt as F, Fo as G, ki as H, ci as I, di as J, - vi as K, - Ni as L, + Ni as K, + vi as L, jo as M, Ao as N, ce as O, Oi as P, $t as Q, - _r as R, - Zr as S, + Jr as R, + Qr as S, Ft as T, Io as U, Lo as V, @@ -1529,16 +1544,16 @@ export { Ri as Y, Fi as Z, ji as _, - Mr as a, + Br as a, Ai as a0, Pt as a1, Bo as a2, pt as a3, - vt as a4, + Nt as a4, Uo as a5, Wo as a6, Ii as a7, - rr as a8, + nn as a8, qi as a9, ti as aA, Ue as aB, @@ -1546,14 +1561,14 @@ export { ke as aD, qo as aE, Ko as aF, - Rr as aG, + Fr as aG, oo as aH, io as aI, so as aJ, Jo as aK, - ir as aa, - nr as ab, - rn as ac, + nr as aa, + rr as ab, + on as ac, Li as ad, Vi as ae, Di as af, @@ -1563,37 +1578,37 @@ export { zo as aj, Ct as ak, R as al, - Dr as am, + Mr as am, Yi as an, re as ao, - ut as ap, - Lr as aq, + Xe as ap, + Vr as aq, G as ar, Se as as, ri as at, Po as au, - vo as av, - Z as aw, - an as ax, + No as av, + X as aw, + or as ax, _o as ay, B as az, - Wr as b, + zr as b, Oo as c, - zr as d, + qr as d, er as e, - Jr as f, + Hr as f, ii as g, - Gr as h, - xi as i, - Yr as j, - Ei as k, + Xr as h, + Ei as i, + Gr as j, + xi as k, Ro as l, - Hr as m, - Kr as n, - qr as o, + Yr as m, + _r as n, + Kr as o, wi as p, yi as q, - hi as r, + mi as r, tr as s, oe as t, Si as u, diff --git a/dist/common/vender-CIG7ep61.js b/common/vendor.js similarity index 100% rename from dist/common/vender-CIG7ep61.js rename to common/vendor.js diff --git a/dist/components.d.ts b/components.d.ts similarity index 78% rename from dist/components.d.ts rename to components.d.ts index 5c7d110..8f6255c 100644 --- a/dist/components.d.ts +++ b/components.d.ts @@ -1,5 +1,5 @@ import * as React from 'react'; -import React__default from 'react'; +import React__default, { ReactElement, ComponentType } from 'react'; import PropTypes from 'prop-types'; /** @@ -72,16 +72,26 @@ declare class ErrorBoundary extends React__default.Component { render(): any; } +/** widget 支持的三种形式 */ +type WidgetInput = string | ReactElement | ComponentType + /** - * 按组件名动态加载并渲染组件 - * @param {string} [props.widget] 组件名(@pkg/xxx 格式) - * @param {Object} [props.widgetSetting] 传给目标组件的 $setting - * @param {Object} [props.widgetProps] props 来源配置(经 useWidgetProps 解析) - * @param {*} [props.fallback] Suspense fallback,不传则为 null - * @param {ReactNode|((error, reset) => ReactNode)} [props.fallbackOnError] ErrorBoundary 错误时的 UI - * @param {Function} [props.onError] 错误回调 (error, info) => void + * 按组件名动态加载并渲染组件,支持 theme 容器框架(string 异步加载 或 function render prop) + * @param {WidgetInput} [props.widget] 组件名(@pkg/xxx)、ReactElement 或组件函数/类 + * @param {Object} [props.widgetProps] 直接 spread 给 widget 的 props + * @param {Object} [props.widgetSetting] 传给 widget 的 $setting + * @param {string | ThemeRenderer} [props.theme] + * 容器框架:string 异步加载,function render prop(接收 {@link ThemeContext}) + * @param {Object} [props.themeProps] 传给 theme 的 $setting(即 ThemeContext.$setting) + * @param {string} [props.className] 透传给 theme 的根节点 className + * @param {Partial>} [props.classNames] 各布局区块的 className + * @param {CSSProperties} [props.style] 透传给 theme 的根节点行内样式 + * @param {Partial>} [props.styles] 各布局区块的行内样式 + * @param {*} [props.fallback] 加载中占位 UI,默认 null + * @param {ReactNode | FallbackOnError} [props.fallbackOnError] + * @param {(error: Error, info: null) => void} [props.onError] */ -declare function ImportWidgetComponent({ widget, widgetSetting, widgetProps, fallback, fallbackOnError, onError }?: string): React__default.JSX.Element; +declare function ImportWidgetComponent({ widget, widgetProps, widgetSetting, theme, themeProps, className, classNames, style, styles, fallback, fallbackOnError, onError, }?: WidgetInput): any; /** 空状态占位组件 */ declare function Empty(): React__default.JSX.Element; diff --git a/dist/components.js b/components.js similarity index 81% rename from dist/components.js rename to components.js index d3d9500..74bf94d 100644 --- a/dist/components.js +++ b/components.js @@ -1,4 +1,4 @@ -import { at as r, aJ as s, ak as p, aK as t, au as n, av as e, as as d, aI as m } from "./common/main-DCysVEHh.js"; +import { at as r, aJ as s, ak as p, aK as t, au as n, av as e, as as d, aI as m } from "./common/main.js"; export { r as Empty, s as ErrorBoundary, diff --git a/dist/container.d.ts b/container.d.ts similarity index 100% rename from dist/container.d.ts rename to container.d.ts diff --git a/dist/container.js b/container.js similarity index 79% rename from dist/container.js rename to container.js index f06abb3..f45b107 100644 --- a/dist/container.js +++ b/container.js @@ -1,4 +1,4 @@ -import { ap as s, at as e, au as p, av as t, aq as d, as as n, ar as r, ao as u } from "./common/main-DCysVEHh.js"; +import { ap as s, at as e, au as p, av as t, aq as d, as as n, ar as r, ao as u } from "./common/main.js"; export { s as Context, e as Empty, diff --git a/dist/data-converter.d.ts b/data-converter.d.ts similarity index 100% rename from dist/data-converter.d.ts rename to data-converter.d.ts diff --git a/dist/data-converter.js b/data-converter.js similarity index 60% rename from dist/data-converter.js rename to data-converter.js index 2f1a2fe..e21cade 100644 --- a/dist/data-converter.js +++ b/data-converter.js @@ -1,6 +1,6 @@ import "lodash"; import "react"; -import { D as i } from "./common/main-DCysVEHh.js"; +import { D as i } from "./common/main.js"; import "react-use"; export { i as default diff --git a/dist/data-list.d.ts b/data-list.d.ts similarity index 100% rename from dist/data-list.d.ts rename to data-list.d.ts diff --git a/dist/data-list.js b/data-list.js similarity index 90% rename from dist/data-list.js rename to data-list.js index 86927ca..a64469d 100644 --- a/dist/data-list.js +++ b/data-list.js @@ -1,4 +1,4 @@ -import { w as t, t as e, o as r, r as o, x as i, s as l, q as u, v as n, p as D, y as L, n as p, A as C, z as m, J as b, C as c, F, E as d, I as k, B as w } from "./common/main-DCysVEHh.js"; +import { w as t, t as e, o as r, r as o, x as i, s as l, q as u, v as n, p as D, y as L, n as p, A as C, z as m, J as b, C as c, F, E as d, I as k, B as w } from "./common/main.js"; export { t as DataListContent, e as DataListContext, diff --git a/dist/data-list/utils.d.ts b/data-list/utils.d.ts similarity index 100% rename from dist/data-list/utils.d.ts rename to data-list/utils.d.ts diff --git a/dist/data-list/utils.js b/data-list/utils.js similarity index 53% rename from dist/data-list/utils.js rename to data-list/utils.js index 5f721b7..f466f3c 100644 --- a/dist/data-list/utils.js +++ b/data-list/utils.js @@ -1,5 +1,5 @@ import "lodash"; -import { f as a } from "../common/main-DCysVEHh.js"; +import { f as a } from "../common/main.js"; export { a as getDefaultExpandRowKeys }; diff --git a/dist/button.js b/dist/button.js deleted file mode 100644 index ac7315d..0000000 --- a/dist/button.js +++ /dev/null @@ -1,6 +0,0 @@ -import { am as s, al as u, an as e } from "./common/main-DCysVEHh.js"; -export { - s as auth, - u as default, - e as useButton -}; diff --git a/dist/res-ws.js b/dist/res-ws.js deleted file mode 100644 index 8e684a8..0000000 --- a/dist/res-ws.js +++ /dev/null @@ -1,5 +0,0 @@ -import "lodash"; -import { R as a } from "./common/main-DCysVEHh.js"; -export { - a as default -}; diff --git a/dist/grid-layout-form.d.ts b/grid-layout-form.d.ts similarity index 100% rename from dist/grid-layout-form.d.ts rename to grid-layout-form.d.ts diff --git a/dist/grid-layout-form.js b/grid-layout-form.js similarity index 94% rename from dist/grid-layout-form.js rename to grid-layout-form.js index 36fb54f..6debd7c 100644 --- a/dist/grid-layout-form.js +++ b/grid-layout-form.js @@ -1,4 +1,4 @@ -import { aa as s, ac as r, ab as u, a9 as o, m as t, ah as m, af as d, ag as i, aj as F, ae as g, ad as c, ai as l } from "./common/main-DCysVEHh.js"; +import { aa as s, ac as r, ab as u, a9 as o, m as t, ah as m, af as d, ag as i, aj as F, ae as g, ad as c, ai as l } from "./common/main.js"; export { s as GridLayoutForm, r as GridLayoutFormHelper, diff --git a/dist/grid-layout-form/utils.d.ts b/grid-layout-form/utils.d.ts similarity index 100% rename from dist/grid-layout-form/utils.d.ts rename to grid-layout-form/utils.d.ts diff --git a/dist/grid-layout-form/utils.js b/grid-layout-form/utils.js similarity index 60% rename from dist/grid-layout-form/utils.js rename to grid-layout-form/utils.js index 71ffe72..6241c2a 100644 --- a/dist/grid-layout-form/utils.js +++ b/grid-layout-form/utils.js @@ -1,5 +1,5 @@ import "lodash"; -import { a as o, g } from "../common/main-DCysVEHh.js"; +import { a as o, g } from "../common/main.js"; export { o as getNormalizeWidget, g as getOptionItemByValue diff --git a/dist/grid-layout.d.ts b/grid-layout.d.ts similarity index 100% rename from dist/grid-layout.d.ts rename to grid-layout.d.ts diff --git a/dist/grid-layout.js b/grid-layout.js similarity index 83% rename from dist/grid-layout.js rename to grid-layout.js index a60a953..94c2c36 100644 --- a/dist/grid-layout.js +++ b/grid-layout.js @@ -1,4 +1,4 @@ -import { h as u, j as e, i as r, H as t, G as d, k as i, m as o, l as G, u as l } from "./common/main-DCysVEHh.js"; +import { h as u, j as e, i as r, H as t, G as d, k as i, m as o, l as G, u as l } from "./common/main.js"; export { u as GridLayout, e as GridLayoutFramework, diff --git a/dist/grid-layout/utils.d.ts b/grid-layout/utils.d.ts similarity index 100% rename from dist/grid-layout/utils.d.ts rename to grid-layout/utils.d.ts diff --git a/dist/grid-layout/utils.js b/grid-layout/utils.js similarity index 58% rename from dist/grid-layout/utils.js rename to grid-layout/utils.js index fa0895c..41bb84b 100644 --- a/dist/grid-layout/utils.js +++ b/grid-layout/utils.js @@ -1,4 +1,4 @@ -import { b as a, d as o, e as s, c as g } from "../common/main-DCysVEHh.js"; +import { b as a, d as o, e as s, c as g } from "../common/main.js"; export { a as getBoxStyle, o as getEventProps, diff --git a/dist/hooks.d.ts b/hooks.d.ts similarity index 100% rename from dist/hooks.d.ts rename to hooks.d.ts diff --git a/dist/hooks.js b/hooks.js similarity index 81% rename from dist/hooks.js rename to hooks.js index e798554..fb7d1d8 100644 --- a/dist/hooks.js +++ b/hooks.js @@ -2,9 +2,9 @@ import "lodash"; import "rc-field-form"; import "react"; import "react-use"; -import { a4 as u, a3 as o, a5 as i, a2 as f, a6 as m, a1 as d, a8 as c, a7 as l } from "./common/main-DCysVEHh.js"; +import { a4 as u, a3 as o, a5 as i, a2 as f, a6 as m, a1 as d, a8 as c, a7 as l } from "./common/main.js"; import { default as b } from "rc-util/lib/hooks/useMergedState"; -import { a as x } from "./common/vender-CIG7ep61.js"; +import { a as x } from "./common/vendor.js"; export { u as useDeepEffect, o as useDeepEqualEffect, diff --git a/dist/iconfont.d.ts b/iconfont.d.ts similarity index 100% rename from dist/iconfont.d.ts rename to iconfont.d.ts diff --git a/dist/iconfont.js b/iconfont.js similarity index 68% rename from dist/iconfont.js rename to iconfont.js index 3921deb..f359b92 100644 --- a/dist/iconfont.js +++ b/iconfont.js @@ -2,7 +2,7 @@ import "react/jsx-runtime"; import "react"; import "prop-types"; import "classnames"; -import { ak as a } from "./common/main-DCysVEHh.js"; +import { ak as a } from "./common/main.js"; export { a as default }; diff --git a/dist/index.d.ts b/index.d.ts similarity index 100% rename from dist/index.d.ts rename to index.d.ts diff --git a/dist/index.js b/index.js similarity index 78% rename from dist/index.js rename to index.js index 5701862..d17be30 100644 --- a/dist/index.js +++ b/index.js @@ -1,4 +1,4 @@ -import { aE as t, aF as e, aA as o, aB as n, aw as p, aC as r, az as c, ay as f, ax as l, aD as u } from "./common/main-DCysVEHh.js"; +import { aE as t, aF as e, aA as o, aB as n, aw as p, aC as r, az as c, ay as f, ax as l, aD as u } from "./common/main.js"; export { t as AppContext, e as AppGlobalParamsContext, diff --git a/dist/pages.d.ts b/pages.d.ts similarity index 100% rename from dist/pages.d.ts rename to pages.d.ts diff --git a/dist/pages.js b/pages.js similarity index 54% rename from dist/pages.js rename to pages.js index ff30e3a..831ec8d 100644 --- a/dist/pages.js +++ b/pages.js @@ -1,4 +1,4 @@ -import { L as t, K as e, M as o, N as g } from "./common/main-DCysVEHh.js"; +import { L as t, K as e, M as o, N as g } from "./common/main.js"; export { t as CustomPage, e as DataListPage, diff --git a/dist/res-ws.d.ts b/res-ws.d.ts similarity index 100% rename from dist/res-ws.d.ts rename to res-ws.d.ts diff --git a/res-ws.js b/res-ws.js new file mode 100644 index 0000000..874336b --- /dev/null +++ b/res-ws.js @@ -0,0 +1,5 @@ +import "lodash"; +import { R as a } from "./common/main.js"; +export { + a as default +}; diff --git a/dist/style.css b/style.css similarity index 100% rename from dist/style.css rename to style.css diff --git a/dist/utils.d.ts b/utils.d.ts similarity index 100% rename from dist/utils.d.ts rename to utils.d.ts diff --git a/dist/utils.js b/utils.js similarity index 87% rename from dist/utils.js rename to utils.js index e046a03..bd3d363 100644 --- a/dist/utils.js +++ b/utils.js @@ -1,6 +1,6 @@ import "lodash"; -import { S as r, a0 as i, W as g, V as o, X as P, P as m, $ as p, Q as U, _ as d, Y as h, Z as k, T as n, O as f, U as l } from "./common/main-DCysVEHh.js"; -import "./common/vender-CIG7ep61.js"; +import { S as r, a0 as i, W as g, V as o, X as P, P as m, $ as p, Q as U, _ as d, Y as h, Z as k, T as n, O as f, U as l } from "./common/main.js"; +import "./common/vendor.js"; export { r as deepSome, i as generateUUID, diff --git a/dist/virtual-fs.d.ts b/virtual-fs.d.ts similarity index 100% rename from dist/virtual-fs.d.ts rename to virtual-fs.d.ts diff --git a/dist/virtual-fs.js b/virtual-fs.js similarity index 50% rename from dist/virtual-fs.js rename to virtual-fs.js index b77f7b3..6daca71 100644 --- a/dist/virtual-fs.js +++ b/virtual-fs.js @@ -1,5 +1,5 @@ import "pathe"; -import { aG as o, aH as r } from "./common/main-DCysVEHh.js"; +import { aG as o, aH as r } from "./common/main.js"; export { o as default, r as toTreePaths