diff --git a/dist/button.js b/dist/button.js index 118a769..b0a3fdc 100644 --- a/dist/button.js +++ b/dist/button.js @@ -1,4 +1,4 @@ -import { am as s, al as u, an as e } from "./common/main-Db_1Xesq.js"; +import { am as s, al as u, an as e } from "./common/main-TLNRXor8.js"; export { s as auth, u as default, diff --git a/dist/common/main-Db_1Xesq.js b/dist/common/main-TLNRXor8.js similarity index 76% rename from dist/common/main-Db_1Xesq.js rename to dist/common/main-TLNRXor8.js index 04f9119..9604d30 100644 --- a/dist/common/main-Db_1Xesq.js +++ b/dist/common/main-TLNRXor8.js @@ -1,11 +1,11 @@ -var Ii = Object.defineProperty; -var kn = (t) => { +var Li = Object.defineProperty; +var Sn = (t) => { throw TypeError(t); }; -var Li = (t, e, n) => e in t ? Ii(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n; -var N = (t, e, n) => Li(t, typeof e != "symbol" ? e + "" : e, n), Sn = (t, e, n) => e.has(t) || kn("Cannot " + n); -var d = (t, e, n) => (Sn(t, e, "read from private field"), n ? n.call(t) : e.get(t)), P = (t, e, n) => e.has(t) ? kn("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, n), K = (t, e, n, i) => (Sn(t, e, "write to private field"), i ? i.call(t, n) : e.set(t, n), n); -var xn = (t, e, n, i) => ({ +var Mi = (t, e, n) => e in t ? Li(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n; +var v = (t, e, n) => Mi(t, typeof e != "symbol" ? e + "" : e, n), xn = (t, e, n) => e.has(t) || Sn("Cannot " + n); +var d = (t, e, n) => (xn(t, e, "read from private field"), n ? n.call(t) : e.get(t)), P = (t, e, n) => e.has(t) ? Sn("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, n), K = (t, e, n, i) => (xn(t, e, "write to private field"), i ? i.call(t, n) : e.set(t, n), n); +var En = (t, e, n, i) => ({ set _(r) { K(t, e, r, n); }, @@ -14,44 +14,44 @@ var xn = (t, e, n, i) => ({ } }); import { jsx as h, jsxs as I } from "react/jsx-runtime"; -import x, { useEffect as U, useState as L, useCallback as G, useRef as J, useContext as ge, useMemo as z, useId as Wt, isValidElement as Mi, useLayoutEffect as Vi } from "react"; +import x, { useEffect as U, useState as L, useCallback as G, useRef as _, useContext as ge, useMemo as z, useId as Bt, isValidElement as Vi, useLayoutEffect as Di } from "react"; import he from "pathe"; import C from "prop-types"; import j from "classnames"; -import { useNotification as Di } from "rc-notification"; +import { useNotification as Wi } from "rc-notification"; import y from "lodash"; -import { useMountedState as Wi, useDeepCompareEffect as en, useUpdateEffect as tn, usePrevious as Dn } from "react-use"; -import ae, { Field as nn, FieldContext as Wn } from "rc-field-form"; -import { _ as En, M as Lt, N as tt, b as De, i as Bt, c as Bi, S as zi } from "./vender-hQk7ADWo.js"; -import Ui from "rc-util/lib/hooks/useMergedState"; -import Bn from "immutability-helper"; -import { Space as zt, Form as Ct, Input as qi, Button as St, Pagination as Ki, Tree as Hi, Breadcrumb as _i, Empty as Ut, Table as $n, Popover as Ji, Popconfirm as Gi, Tooltip as Yi, Divider as Xi } from "antd"; -import { useMergedState as Qi } from "rc-util"; -import { generatePath as Zi, useInRouterContext as zn, useParams as er, useLocation as tr, createBrowserRouter as nr, Navigate as ir } from "react-router-dom"; -import rr from "rc-drawer"; -import or from "rc-dialog"; -import * as Pn from "react-is"; -var He, it, _e, $e, We, Be; -class Un { +import { useMountedState as Bi, useDeepCompareEffect as tn, useUpdateEffect as nn, usePrevious as Wn } from "react-use"; +import ae, { Field as rn, FieldContext as Bn } from "rc-field-form"; +import { _ as $n, M as Lt, N as tt, b as De, i as zt, c as zi, S as Ui } from "./vender-hQk7ADWo.js"; +import qi from "rc-util/lib/hooks/useMergedState"; +import zn from "immutability-helper"; +import { Space as Ut, Form as Ct, Input as Ki, Button as St, Pagination as Hi, Tree as Ji, Breadcrumb as _i, Empty as qt, Table as Pn, Popover as Gi, Popconfirm as Yi, Tooltip as Xi, Divider as Qi } from "antd"; +import { useMergedState as Zi } from "rc-util"; +import { generatePath as er, useInRouterContext as Un, useParams as tr, useLocation as nr, createBrowserRouter as ir, Navigate as rr } from "react-router-dom"; +import or from "rc-drawer"; +import ar from "rc-dialog"; +import * as vn from "react-is"; +var He, it, Je, $e, We, Be; +class qn { constructor(e, n) { P(this, He, /* @__PURE__ */ new Map()); P(this, it, !0); - P(this, _e, []); + P(this, Je, []); P(this, $e); P(this, We, () => d(this, $e)); P(this, Be, () => Promise.resolve()); - N(this, "get", (...e) => new Promise((n, i) => { + v(this, "get", (...e) => new Promise((n, i) => { const r = JSON.stringify(e); if (d(this, He).has(r)) return n(d(this, Be).call(this, d(this, $e), ...e)); - if (d(this, $e) === void 0) d(this, _e).push([e, n, i]), d(this, it) && (K(this, it, !1), Promise.resolve(typeof d(this, We) == "function" ? d(this, We).call(this) : d(this, We)).then((o) => K(this, $e, o || null)).finally(() => { - d(this, _e).forEach(([o, a, s]) => { + if (d(this, $e) === void 0) d(this, Je).push([e, n, i]), d(this, it) && (K(this, it, !1), Promise.resolve(typeof d(this, We) == "function" ? d(this, We).call(this) : d(this, We)).then((o) => K(this, $e, o || null)).finally(() => { + d(this, Je).forEach(([o, a, s]) => { try { const l = d(this, Be).call(this, d(this, $e), ...o); d(this, He).set(JSON.stringify(o), l), a(l); } catch (l) { s(l); } - }), d(this, _e).length = 0; + }), d(this, Je).length = 0; })); else { const o = d(this, Be).call(this, d(this, $e), ...e); @@ -61,41 +61,41 @@ class Un { K(this, Be, n), K(this, We, e); } } -He = new WeakMap(), it = new WeakMap(), _e = new WeakMap(), $e = new WeakMap(), We = new WeakMap(), Be = new WeakMap(); -const Fo = () => h("div", { children: "Empty" }), mt = x.createContext({ ele: {}, mount: () => { +He = new WeakMap(), it = new WeakMap(), Je = new WeakMap(), $e = new WeakMap(), We = new WeakMap(), Be = new WeakMap(); +const jo = () => h("div", { children: "Empty" }), mt = x.createContext({ ele: {}, mount: () => { }, unmount: () => { -} }), ne = ({ rootClassName: t, className: e, children: n, actions: i, title: r, subTitle: o, extras: a, style: s = {} }) => { +} }), ie = ({ rootClassName: t, className: e, children: n, actions: i, title: r, subTitle: o, extras: a, style: s = {} }) => { const { mount: l, unmount: c } = x.useContext(mt); - return ne.Action({ children: i }), ne.Title({ children: r }), ne.SubTitle({ children: o }), ne.Extra({ children: a }), U(() => (l("rootClassName", t), () => c(t)), [t]), h("div", { className: j("ff-container", e), style: s, children: n }); + return ie.Action({ children: i }), ie.Title({ children: r }), ie.SubTitle({ children: o }), ie.Extra({ children: a }), U(() => (l("rootClassName", t), () => c(t)), [t]), h("div", { className: j("ff-container", e), style: s, children: n }); }, bt = (t) => ({ children: e, className: n }) => { const { mount: i, unmount: r } = x.useContext(mt); return U(() => (e && i(t, x.createElement("div", { key: `ff-${t}`, className: j(`ff-popup-${t}`, n) }, e)), () => r(t)), [n, e]), null; }; -ne.Action = bt("actions"), ne.Title = bt("title"), ne.SubTitle = bt("sub-title"), ne.Extra = bt("extras"), ne.propTypes = { className: C.string, style: C.object, title: C.any, subTitle: C.any, actions: C.any, extras: C.any }; -const jo = () => h(ne, { className: "ff-loading", children: I("div", { className: "loader", children: [I("div", { className: "square", children: [h("span", {}), h("span", {}), h("span", {})] }), I("div", { className: "square", children: [h("span", {}), h("span", {}), h("span", {})] }), I("div", { className: "square", children: [h("span", {}), h("span", {}), h("span", {})] }), I("div", { className: "square", children: [h("span", {}), h("span", {}), h("span", {})] })] }) }), Ao = () => h("div", { children: "NotFound" }), qn = ({ children: t }) => { +ie.Action = bt("actions"), ie.Title = bt("title"), ie.SubTitle = bt("sub-title"), ie.Extra = bt("extras"), ie.propTypes = { className: C.string, style: C.object, title: C.any, subTitle: C.any, actions: C.any, extras: C.any }; +const Ao = () => h(ie, { className: "ff-loading", children: I("div", { className: "loader", children: [I("div", { className: "square", children: [h("span", {}), h("span", {}), h("span", {})] }), I("div", { className: "square", children: [h("span", {}), h("span", {}), h("span", {})] }), I("div", { className: "square", children: [h("span", {}), h("span", {}), h("span", {})] }), I("div", { className: "square", children: [h("span", {}), h("span", {}), h("span", {})] })] }) }), Io = () => h("div", { children: "NotFound" }), Kn = ({ children: t }) => { const [e, n] = L({}), i = G((o, a) => n((s) => ({ ...s, [o]: a })), []), r = G((o) => n((a) => ({ ...a, [o]: void 0 })), []); return typeof (t == null ? void 0 : t.type) == "string" ? t : h(mt.Provider, { value: { ele: e, mount: i, unmount: r }, children: x.cloneElement(t, { className: e.rootClassName, title: e.title, subTitle: e["sub-title"], actions: e.actions, extras: e.extras }) }); }; -qn.propTypes = { children: C.element.isRequired }; -const vn = { 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"] }, rn = ({ type: t, props: e }) => h("i", { ...e, children: h("svg", { viewBox: "0 0 1024 1024", width: "1em", height: "1em", fill: "currentColor", children: (vn[t] || vn.info).map((n, i) => h("path", { d: n }, i)) }) }), Kn = ({ className: t, content: e, icon: n, $close: i }) => I(x.Fragment, { children: [n && h("div", { className: j("ff-notification-icon", t), children: h(rn, { type: n }) }), e] }), ar = ({}) => h(ne, { children: "Confirm" }); -var Oe, Je; +Kn.propTypes = { children: C.element.isRequired }; +const Nn = { 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"] }, on = ({ type: t, props: e }) => h("i", { ...e, children: h("svg", { viewBox: "0 0 1024 1024", width: "1em", height: "1em", fill: "currentColor", children: (Nn[t] || Nn.info).map((n, i) => h("path", { d: n }, i)) }) }), Hn = ({ className: t, content: e, icon: n, $close: i }) => I(x.Fragment, { children: [n && h("div", { className: j("ff-notification-icon", t), children: h(on, { type: n }) }), e] }), sr = ({}) => h(ie, { children: "Confirm" }); +var Oe, _e; const me = class me { constructor() { - P(this, Je, /* @__PURE__ */ new Map()); - N(this, "init", (e) => K(this, Je, new Map(e))); - N(this, "check", (e) => !d(this, Je).has(e) || d(this, Je).get(e)); + P(this, _e, /* @__PURE__ */ new Map()); + v(this, "init", (e) => K(this, _e, new Map(e))); + v(this, "check", (e) => !d(this, _e).has(e) || d(this, _e).get(e)); if (d(me, Oe)) return d(me, Oe); } }; -Oe = new WeakMap(), Je = new WeakMap(), P(me, Oe, null), N(me, "getInstance", () => (d(me, Oe) || K(me, Oe, new me()), d(me, Oe))); -let qt = me; -const Hn = qt.getInstance(), sr = (t, e, n = "children") => { +Oe = new WeakMap(), _e = new WeakMap(), P(me, Oe, null), v(me, "getInstance", () => (d(me, Oe) || K(me, Oe, new me()), d(me, Oe))); +let Kt = me; +const Jn = Kt.getInstance(), lr = (t, e, n = "children") => { if (y.isEmpty(t)) return {}; const i = y.find(t, ["value", e]); if (!y.isEmpty(i)) return i; const r = t.length; for (let o = 0; o < r; o++) { - const { [n]: a } = t[o], s = sr(a, e, n); + const { [n]: a } = t[o], s = lr(a, e, n); if (!y.isEmpty(s)) return s; } return {}; @@ -104,14 +104,14 @@ var Re, rt; const fe = class fe { constructor() { P(this, rt, null); - N(this, "init", (e) => K(this, rt, e)); - N(this, "get", (e, n) => y.get(d(this, rt), e, n)); + v(this, "init", (e) => K(this, rt, e)); + v(this, "get", (e, n) => y.get(d(this, rt), e, n)); if (d(fe, Re)) return d(fe, Re); } }; -Re = new WeakMap(), rt = new WeakMap(), P(fe, Re, null), N(fe, "getInstance", () => (d(fe, Re) || K(fe, Re, new fe()), d(fe, Re))); -let Kt = fe; -const qe = Kt.getInstance(); +Re = new WeakMap(), rt = new WeakMap(), P(fe, Re, null), v(fe, "getInstance", () => (d(fe, Re) || K(fe, Re, new fe()), d(fe, Re))); +let Ht = fe; +const qe = Ht.getInstance(); var Ge, $t, ot, at, Pt; const Te = class Te { constructor(...e) { @@ -120,7 +120,7 @@ const Te = class Te { var n; for (let i of e) Array.isArray(i[0]) ? d(this, at).call(this, i) : d(this, ot).push(d(n = Te, $t).call(n, i[0], i[1])); }); - N(this, "toValue", async (e, n = null) => { + v(this, "toValue", async (e, n = null) => { const i = { getValue: () => e, getRecord: () => n }; let r = e; for (const o of d(this, ot)) try { @@ -135,10 +135,10 @@ const Te = class Te { } return r; }); - N(this, "toRender", (e, n, i = null) => x.createElement(d(this, Pt), { value: e, record: n }, i)); + v(this, "toRender", (e, n, i = null) => x.createElement(d(this, Pt), { value: e, record: n }, i)); P(this, Pt, ({ value: e, record: n, children: i }) => { - const [r, o] = L(i), a = Wi(); - return en(() => { + const [r, o] = L(i), a = Bi(); + return tn(() => { o(i), this.toValue(e, n).then((s) => a() && o(s)).catch((s) => a() && o(`${s}`)); }, [e, n]), r; }); @@ -154,7 +154,7 @@ Ge = new WeakMap(), $t = new WeakMap(), ot = new WeakMap(), at = new WeakMap(), throw new TypeError("middleware must be a string or a function"); }, (...e) => { var n; - return d(Te, Ge) || K(Te, Ge, Ir()), d(n = Te, Ge).call(n, ...e); + return d(Te, Ge) || K(Te, Ge, Lr()), d(n = Te, Ge).call(n, ...e); })); let xt = Te; const le = x.createContext({ listCode: "", classNames: {}, getBase62params: (t, e) => { @@ -173,65 +173,65 @@ const le = x.createContext({ listCode: "", classNames: {}, getBase62params: (t, }, setSider: () => { }, setKeyword: () => { }, setCondition: () => { -} }), Nn = ({ className: t, record: e, column: n, ...i }) => { +} }), Tn = ({ className: t, record: e, column: n, ...i }) => { if (n != null && n.editableByJs && (n != null && n.uuid)) { const { formSetting: r = { primaryKey: "id" }, widgetSetting: o = {}, widgetContainerSetting: a = {} } = (n == null ? void 0 : n.editableByJsSetting) || {}; - return h(R.Popover, { widget: Jn, widgetData: { record: e, column: n }, widgetSetting: { widgetSetting: o, formSetting: r }, widgetContainerProps: { title: n != null && n.title ? `${n.title} - 编辑` : "编辑", width: 260, zIndex: 1050, arrow: !0, ...a }, children: h("td", { className: j("ff-data-list-cell-editable", t), ...i }) }); + return h(R.Popover, { widget: Gn, widgetData: { record: e, column: n }, widgetSetting: { widgetSetting: o, formSetting: r }, widgetContainerProps: { title: n != null && n.title ? `${n.title} - 编辑` : "编辑", width: 260, zIndex: 1050, arrow: !0, ...a }, children: h("td", { className: j("ff-data-list-cell-editable", t), ...i }) }); } return h("td", { className: t, ...i }); -}, Jn = ({ record: t, column: e, $close: n, $setting: i }) => { - const r = J(jr(y.get(t, e == null ? void 0 : e.dataIndex))), { listCode: o, onClickCallback: a } = ge(le), [s] = ae.useForm(), { formSetting: l, widgetSetting: c } = i, { primaryKey: u = "id", help: p, validators: m } = l || {}, g = () => { +}, Gn = ({ record: t, column: e, $close: n, $setting: i }) => { + const r = _(Ar(y.get(t, e == null ? void 0 : e.dataIndex))), { listCode: o, onClickCallback: a } = ge(le), [s] = ae.useForm(), { formSetting: l, widgetSetting: c } = i, { primaryKey: u = "id", help: p, validators: m } = l || {}, g = () => { s.setFieldsValue({ value: y.get(t, e == null ? void 0 : e.dataIndex), __PROPS__: t }); }; - return Ft(() => g(), [t, e == null ? void 0 : e.dataIndex, o]), h(ne, { actions: I(x.Fragment, { children: [h(R, { size: "small", onClick: g, children: "重置" }), I(zt.Compact, { block: !0, children: [h(R, { size: "small", widget: n, children: "取消" }), h(R, { type: "primary", size: "small", widget: () => s.validateFields().then(({ value: w }) => { + return Ft(() => g(), [t, e == null ? void 0 : e.dataIndex, o]), h(ie, { actions: I(x.Fragment, { children: [h(R, { size: "small", onClick: g, children: "重置" }), I(Ut.Compact, { block: !0, children: [h(R, { size: "small", widget: n, children: "取消" }), h(R, { type: "primary", size: "small", widget: () => s.validateFields().then(({ value: w }) => { const f = y.get(t, u.substring(u.indexOf(".") + 1)); if (!f) throw "获取更新主键失败!"; W.put(`/api/${o}-storeBy-${e == null ? void 0 : e.uuid}/${f}`, { value: w }).msg(() => a(2, t)).then(n); - }).catch(console.warn), children: "保存" })] })] }), children: I(ae, { form: s, children: [h(sn, { label: "", code: "value", type: r.current, widget: e == null ? void 0 : e.editableByJs, help: p, extras: c, validators: m }), h(nn, { noStyle: !0, name: ["__PROPS__"], children: () => { + }).catch(console.warn), children: "保存" })] })] }), children: I(ae, { form: s, children: [h(ln, { label: "", code: "value", type: r.current, widget: e == null ? void 0 : e.editableByJs, help: p, extras: c, validators: m }), h(rn, { noStyle: !0, name: ["__PROPS__"], children: () => { } })] }) }); }; -Jn.displayName = "DataListCellEditableContainer"; -const lr = (t) => function(e) { +Gn.displayName = "DataListCellEditableContainer"; +const cr = (t) => function(e) { return t(e, getRecord()); -}, cr = async ({ widgetByJs: t, widgetByJsSetting: e }) => { +}, dr = async ({ widgetByJs: t, widgetByJsSetting: e }) => { const n = await se.getWidgetComponent(t).then((i) => i.default || ((r) => r)); return function(i) { return h(n, { value: i, $setting: e }); }; -}, dr = (t, e = {}) => z(() => { +}, ur = (t, e = {}) => z(() => { var n; return (n = t == null ? void 0 : t.filter(Boolean)) == null ? void 0 : n.map(({ widgetByJs: i, widgetByJsSetting: r, middlewares: o, ...a }, s) => { const l = (c) => ({ record: c, column: a }); - return o || (o = []), i && o.push([cr, { widgetByJs: i, widgetByJsSetting: r }]), o.length > 0 ? (a != null && a.render && o.push([lr, a.render]), { ...a, onCell: l, render: (c, u) => new xt(o).toRender(c, u, "-") }) : { ...a, onCell: l }; + return o || (o = []), i && o.push([dr, { widgetByJs: i, widgetByJsSetting: r }]), o.length > 0 ? (a != null && a.render && o.push([cr, a.render]), { ...a, onCell: l, render: (c, u) => new xt(o).toRender(c, u, "-") }) : { ...a, onCell: l }; }); -}, [t, e]), ur = (t = {}) => z(() => { +}, [t, e]), pr = (t = {}) => z(() => { var e; - return t.body ?? (t.body = { cell: Nn }), (e = t.body).cell ?? (e.cell = Nn), t; -}, [t]), Io = (t) => { + return t.body ?? (t.body = { cell: Tn }), (e = t.body).cell ?? (e.cell = Tn), t; +}, [t]), Lo = (t) => { const [e, n] = L({}); return U(() => { let i = !1; return t && W.get(`/api/_/${t}`).then((r) => y.pick(r, ["uuid", "name", "code", "resource", "marginX", "marginY", "cols", "rowHeight", "primaryKey", "columns", "itemOperations", "batchOperations", "isConditionFormLayout", "layout", "tabs", "pageSize", "layoutConfig", "selectionType"])).then((r) => !i && n(r)), () => i = !0; }, [t]), e; -}, Lo = (t, e = {}) => { +}, Mo = (t, e = {}) => { const [n, i] = L({ dataSource: [] }); return ft(() => { let r = !1; return t && W.get(`/api/${t}/${W.encode({ page: 1, ...e })}`).then((o) => !r && i(o)), () => r = !0; }, [t, e]), n; -}, Gn = (t = [], e = /* @__PURE__ */ new Map(), n = "id", i) => { +}, Yn = (t = [], e = /* @__PURE__ */ new Map(), n = "id", i) => { const r = G(i ? (o) => y.get(o, n, y.get(o, [i, n])) : (o) => y.get(o, n), [n, i]); return G((o) => t == null ? void 0 : t.filter((a) => !a.uuid || !e.has(a.uuid) || e.get(a.uuid).some((s) => s == r(o))), [t, e, r]); -}, Ht = (t = [], e = /* @__PURE__ */ new Map(), n = [], i = "id", r) => { +}, Jt = (t = [], e = /* @__PURE__ */ new Map(), n = [], i = "id", r) => { const o = G(r ? (a) => y.get(a, i, y.get(a, [r, i])) : (a) => y.get(a, i), [i, r]); return z(() => { - if (y.isEmpty(t) || !t.some(({ uuid: s }) => Hn.check(s))) return !1; + if (y.isEmpty(t) || !t.some(({ uuid: s }) => Jn.check(s))) return !1; if (y.isEmpty(e) || y.isEmpty(n)) return !0; const a = n.map((s) => o(s)); return t.some(({ uuid: s }) => !s || !e.has(s) || e.get(s).some((l) => a.some((c) => c == l))); }, [t, n, e, o]); -}, pr = (t, e, n = "id", i = null) => { - const r = Rt(), o = J(!1), a = J(t.dataSource), s = J(t.itemOperationsAccess); +}, gr = (t, e, n = "id", i = null) => { + const r = Rt(), o = _(!1), a = _(t.dataSource), s = _(t.itemOperationsAccess); return U(() => (a.current = t.dataSource, s.current = t.itemOperationsAccess, () => o.current = !1), [t.dataSource, t.itemOperationsAccess]), o.current && (t.dataSource = a.current, t.itemOperationsAccess = s.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); @@ -240,7 +240,7 @@ const lr = (t) => function(e) { if (f === -1) return (p = t.onReload) == null ? void 0 : p.call(t); Promise.all([W.get(`/api/${e}/detail/${g}`), W.post(`/api/${e}/list-operations-access`, { ids: g })]).then(([S, b]) => { const E = y.get(a.current, w > -1 ? [w, "children", f, "children"] : [f, "children"]); - a.current = Bn(a.current, w > -1 ? { [w]: { children: { $splice: [[f, 1, { ...S, children: E }]] } } } : { $splice: [[f, 1, { ...S, children: E }]] }); + a.current = zn(a.current, w > -1 ? { [w]: { children: { $splice: [[f, 1, { ...S, children: E }]] } } } : { $splice: [[f, 1, { ...S, children: E }]] }); const k = new Map(b); s.current.forEach(($, F) => { var A; @@ -253,8 +253,8 @@ const lr = (t) => function(e) { }); } }]; -}, gr = (t, e) => { - const n = Rt(), i = J(e), r = J(/* @__PURE__ */ new Map()), o = J([]), a = y.throttle((l) => { +}, hr = (t, e) => { + const n = Rt(), i = _(e), r = _(/* @__PURE__ */ new Map()), o = _([]), a = y.throttle((l) => { o.current = [], W.list(t, y.pick({ ...i.current, ...l }, ["tab", "page", "pageSize", "condition", "sider", "keyword"])).then(({ keyword: c, condition: u, total: p, tab: m, sider: g, page: w, pageSize: f, operationsAccess: S, dataSource: b }) => { i.current = { tab: m, condition: u, sider: g, keyword: c, total: p, pageSize: f, page: b != null && b.length ? w : 1 }, o.current = b, r.current = new Map(S), n(); }); @@ -263,23 +263,23 @@ const lr = (t) => function(e) { o.current = [], t && a(e); }, [t, e]); const s = z(() => y.pick(i.current, ["total", "tab", "page", "pageSize", "condition", "sider", "keyword", "primaryKey"]), [i.current]); - return Object.assign(s, { onTabChange: (l) => a({ tab: l, page: 1 }), onPageChange: (l, c) => a({ page: l, pageSize: c }), onPageSizeChange: (l) => a({ pageSize: l, page: 1 }), onConditionChange: (l, c) => a({ keyword: c, condition: Bn(i.current.condition || {}, { $merge: l || {} }), page: 1 }), onSiderChange: (l) => a({ sider: l, page: 1 }), onKeywordChange: (l) => a({ keyword: l, page: 1 }), itemOperationsAccess: r.current, dataSource: o.current, onReload: a, payload: e == null ? void 0 : e.payload }); -}, hr = ({ listCode: t, className: e, layouts: n = {}, dataSource: i, isPaginate: r, isItemOperations: o, isBatchOperations: a, batchOperations: s, itemOperations: l, itemOperationsAccess: c, resource: u, primaryKey: p, title: m, itemGridLayout: g, $setting: w, tabs: f, isConditionFormLayout: S, isTreeSider: b, treeSiderConfig: E, rowSelection: k }) => { - const { classNames: $, onClickCallback: F } = ge(le), A = y.pick(w, ["column", "colWidth", "beforeRender", "afterRender", "style", "itemMargin", "containerPadding"]), O = w == null ? void 0 : w.isMarkSelected, T = Gn(l, c, p, u), V = G((v, M, D) => h(mr, { isMarkSelected: O, className: j("ff-data-list-framework-item", $ == null ? void 0 : $.item), operations: o ? T(M) : [], data: u ? { [u]: M } : M, children: v, onClickCallback: F }), [O, u, p, o, F, l, c]); - return I("div", { className: j("ff-data-list-framework", e), children: [h(n.sider, { isTreeSider: b, ...E }), I("div", { className: j("ff-data-list-container", $ == null ? void 0 : $.container), children: [h(n.filter, { isConditionFormLayout: S }), h(n.toolbar, { title: m, tabs: f }), h(Tr, { ...g, ...A, rowSelection: k, empty: h(n.empty, { className: $ == null ? void 0 : $.empty }), primaryKey: p, itemRender: V, dataSource: i }), h(n.footer, { isPaginate: r, isOperations: a, operations: s })] })] }); -}, mr = ({ className: t, operations: e, children: n, data: i, onClickCallback: r, onSelect: o, isMarkSelected: a, isSelected: s, selectionType: l }) => I("div", { className: j("data-list-grid-layout-item", { "is-mark-selected": a, "is-selected": s, "is-selectable": !!l }, t), onClick: o, children: [h("div", { className: "data-list-grid-layout-item-container", children: n }), !!(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: i, confirm: c.confirm, onAfterClick: (u) => u !== !1 && (r == null ? void 0 : r(c.isRefresh, i)) }, c.uuid || Wt()) }, (c == null ? void 0 : c.uuid) || Wt())) })] }), fr = ({ listCode: t, className: e, layouts: n = {}, dataSource: i, columns: r, isItemOperations: o, isBatchOperations: a, batchOperations: s, itemOperations: l, itemOperationsAccess: c, resource: u, primaryKey: p, title: m, tabs: g, isPaginate: w, rowSelection: f, isTreeSider: S, treeSiderConfig: b, isConditionFormLayout: E, ...k }) => { - const { classNames: $, onClickCallback: F } = ge(le), A = Gn(l, c, p, u), O = Ht(l, c, i, p, u); - return I("div", { className: j("ff-data-table-framework", e), children: [h(n.sider, { isTreeSider: S, ...b }), I("div", { className: j("ff-data-table-container", $ == null ? void 0 : $.container), children: [h(n.filter, { isConditionFormLayout: E }), h(n.toolbar, { title: m, tabs: g }), h(xr, { ...k, primaryKey: p, className: "ff-data-table-content", columns: r, dataSource: i, rowSelection: f, operationRender: O ? (T) => { + return Object.assign(s, { onTabChange: (l) => a({ tab: l, page: 1 }), onPageChange: (l, c) => a({ page: l, pageSize: c }), onPageSizeChange: (l) => a({ pageSize: l, page: 1 }), onConditionChange: (l, c) => a({ keyword: c, condition: zn(i.current.condition || {}, { $merge: l || {} }), page: 1 }), onSiderChange: (l) => a({ sider: l, page: 1 }), onKeywordChange: (l) => a({ keyword: l, page: 1 }), itemOperationsAccess: r.current, dataSource: o.current, onReload: a, payload: e == null ? void 0 : e.payload }); +}, mr = ({ listCode: t, className: e, layouts: n = {}, dataSource: i, isPaginate: r, isItemOperations: o, isBatchOperations: a, batchOperations: s, itemOperations: l, itemOperationsAccess: c, resource: u, primaryKey: p, title: m, itemGridLayout: g, $setting: w, tabs: f, isConditionFormLayout: S, isTreeSider: b, treeSiderConfig: E, rowSelection: k }) => { + const { classNames: $, onClickCallback: F } = ge(le), A = y.pick(w, ["column", "colWidth", "beforeRender", "afterRender", "style", "itemMargin", "containerPadding"]), O = w == null ? void 0 : w.isMarkSelected, T = Yn(l, c, p, u), V = G((N, M, D) => h(fr, { isMarkSelected: O, className: j("ff-data-list-framework-item", $ == null ? void 0 : $.item), operations: o ? T(M) : [], data: u ? { [u]: M } : M, children: N, onClickCallback: F }), [O, u, p, o, F, l, c]); + return I("div", { className: j("ff-data-list-framework", e), children: [h(n.sider, { isTreeSider: b, ...E }), I("div", { className: j("ff-data-list-container", $ == null ? void 0 : $.container), children: [h(n.filter, { isConditionFormLayout: S }), h(n.toolbar, { title: m, tabs: f }), h(Or, { ...g, ...A, rowSelection: k, empty: h(n.empty, { className: $ == null ? void 0 : $.empty }), primaryKey: p, itemRender: V, dataSource: i }), h(n.footer, { isPaginate: r, isOperations: a, operations: s })] })] }); +}, fr = ({ className: t, operations: e, children: n, data: i, onClickCallback: r, onSelect: o, isMarkSelected: a, isSelected: s, selectionType: l }) => I("div", { className: j("data-list-grid-layout-item", { "is-mark-selected": a, "is-selected": s, "is-selectable": !!l }, t), onClick: o, children: [h("div", { className: "data-list-grid-layout-item-container", children: n }), !!(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: i, confirm: c.confirm, onAfterClick: (u) => u !== !1 && (r == null ? void 0 : r(c.isRefresh, i)) }, c.uuid || Bt()) }, (c == null ? void 0 : c.uuid) || Bt())) })] }), yr = ({ listCode: t, className: e, layouts: n = {}, dataSource: i, columns: r, isItemOperations: o, isBatchOperations: a, batchOperations: s, itemOperations: l, itemOperationsAccess: c, resource: u, primaryKey: p, title: m, tabs: g, isPaginate: w, rowSelection: f, isTreeSider: S, treeSiderConfig: b, isConditionFormLayout: E, ...k }) => { + const { classNames: $, onClickCallback: F } = ge(le), A = Yn(l, c, p, u), O = Jt(l, c, i, p, u); + return I("div", { className: j("ff-data-table-framework", e), children: [h(n.sider, { isTreeSider: S, ...b }), I("div", { className: j("ff-data-table-container", $ == null ? void 0 : $.container), children: [h(n.filter, { isConditionFormLayout: E }), h(n.toolbar, { title: m, tabs: g }), h(Er, { ...k, primaryKey: p, className: "ff-data-table-content", columns: r, dataSource: i, rowSelection: f, operationRender: O ? (T) => { var V; - return h("div", { className: "ff-data-table-actions", children: (V = A(T)) == null ? void 0 : V.map((v, M) => h(R, { size: "small", uuid: v.uuid, type: v.type, name: v.name, widget: v.widget, widgetType: v.widgetType, widgetProps: v.widgetProps, widgetData: v.widgetData, widgetSetting: v.widgetSetting, widgetContainerProps: v.widgetContainerSetting, data: T, confirm: v.confirm, onAfterClick: (D) => D !== !1 && (F == null ? void 0 : F(v.isRefresh, T)) }, v.uuid || M)) }); + return h("div", { className: "ff-data-table-actions", children: (V = A(T)) == null ? void 0 : V.map((N, M) => h(R, { size: "small", uuid: N.uuid, type: N.type, name: N.name, widget: N.widget, widgetType: N.widgetType, widgetProps: N.widgetProps, widgetData: N.widgetData, widgetSetting: N.widgetSetting, widgetContainerProps: N.widgetContainerSetting, data: T, confirm: N.confirm, onAfterClick: (D) => D !== !1 && (F == null ? void 0 : F(N.isRefresh, T)) }, N.uuid || M)) }); } : null }), h(n.footer, { isPaginate: w, isOperations: a, operations: s })] })] }); -}, on = (t = [], e, n = null) => { +}, an = (t = [], e, n = null) => { var i; - return (i = y.sortBy(t, ["y", "x"])) == null ? void 0 : i.map(({ i: r, x: o, y: a, w: s, h: l, field: { boxStyle: c, ...u } = {} }, p) => h("div", { className: "grid-layout-item", style: Yn(o, a, s, l, c), children: h(e, { ...u, basicForm: n }) }, r ?? p)); -}, Yn = (t, e, n, i, r = {}, o = 0) => { + return (i = y.sortBy(t, ["y", "x"])) == null ? void 0 : i.map(({ i: r, x: o, y: a, w: s, h: l, field: { boxStyle: c, ...u } = {} }, p) => h("div", { className: "grid-layout-item", style: Xn(o, a, s, l, c), children: h(e, { ...u, basicForm: n }) }, r ?? p)); +}, Xn = (t, e, n, i, r = {}, o = 0) => { const a = { "--grid-layout-h": `${i}`, "--grid-layout-w": `${n}`, "--grid-layout-x": `${t}`, "--grid-layout-y": `${e}`, "--grid-layout-row-height-offset": "0px" }; - return r != null && r.autoHeight ? a.height = "fit-content" : a["--grid-layout-row"] = `${i}`, r != null && r.alignItems && (a["--grid-layout-box-align-items"] = r.alignItems), r != null && r.justifyContent && (a["--grid-layout-box-justify-content"] = r.justifyContent), a["--grid-layout-box-margin"] = Tn(r == null ? void 0 : r.marginTop, r == null ? void 0 : r.marginRight, r == null ? void 0 : r.marginBottom, r == null ? void 0 : r.marginLeft), a["--grid-layout-box-padding"] = Tn(r == null ? void 0 : r.paddingTop, r == null ? void 0 : r.paddingRight, r == null ? void 0 : r.paddingBottom, r == null ? void 0 : r.paddingLeft), o && (a.height = `${o}px`), a; -}, Tn = (t, e, n, i) => `${t || 0}px ${e || 0}px ${n || 0}px ${i || 0}px`, Mo = (t = "Text", e = "@pkg/ff/grid-layouts") => t != null && t.startsWith("@") || t != null && t.startsWith("blob:") ? t : `${e}/${t}`, Xn = (t) => Object.keys(t).reduce((e, n) => (/^on[A-Z]/.test(n) && (e[n] = t[n]), e), {}), Qn = ({ className: t, isConditionFormLayout: e }) => { + return r != null && r.autoHeight ? a.height = "fit-content" : a["--grid-layout-row"] = `${i}`, r != null && r.alignItems && (a["--grid-layout-box-align-items"] = r.alignItems), r != null && r.justifyContent && (a["--grid-layout-box-justify-content"] = r.justifyContent), a["--grid-layout-box-margin"] = On(r == null ? void 0 : r.marginTop, r == null ? void 0 : r.marginRight, r == null ? void 0 : r.marginBottom, r == null ? void 0 : r.marginLeft), a["--grid-layout-box-padding"] = On(r == null ? void 0 : r.paddingTop, r == null ? void 0 : r.paddingRight, r == null ? void 0 : r.paddingBottom, r == null ? void 0 : r.paddingLeft), o && (a.height = `${o}px`), a; +}, On = (t, e, n, i) => `${t || 0}px ${e || 0}px ${n || 0}px ${i || 0}px`, Vo = (t = "Text", e = "@pkg/ff/grid-layouts") => t != null && t.startsWith("@") || t != null && t.startsWith("blob:") ? t : `${e}/${t}`, Qn = (t) => Object.keys(t).reduce((e, n) => (/^on[A-Z]/.test(n) && (e[n] = t[n]), e), {}), Zn = ({ className: t, isConditionFormLayout: e }) => { var m, g; const [n, i] = L({}), { listCode: r, onKeywordChange: o, onConditionChange: a, getBase62params: s, classNames: l } = x.useContext(le), { keyword: c, condition: u } = (s == null ? void 0 : s()) || {}, [p] = Ct.useForm(); return U(() => { @@ -291,33 +291,33 @@ const lr = (t) => function(e) { }, [JSON.stringify([c, u])]), h("div", { className: j("ff-data-list-filter", l.filter, t), children: h(Ct, { form: p, layout: "vertical", autoComplete: "off", onFinish: ((m = n.fields) == null ? void 0 : m.length) > 1 ? (w) => a({ [n.resource]: w[n.resource] }, w.keyword) : () => { }, onValuesChange: (w) => { y.isEmpty(y.omit(w, ["keyword"])) || p.submit(); - }, children: ((g = n.fields) == null ? void 0 : g.length) > 1 ? h(ln, { ...n, children: h(yr, { onReset: () => { + }, children: ((g = n.fields) == null ? void 0 : g.length) > 1 ? h(cn, { ...n, children: h(wr, { onReset: () => { const { keyword: w, condition: f } = s("init") || {}; p.setFieldsValue({ keyword: w, ...f }); - } }) }) : h("div", { className: "ff-data-list-filter-default-form ff-grid-layout-form", children: h("div", { className: "grid-layout-item", style: Yn(20, 0, 5, 2), children: h(Ct.Item, { name: ["keyword"], children: h(qi.Search, { allowClear: !0, enterButton: "搜索", placeholder: "多关键字 | 分割", onSearch: (w) => o(w) }) }) }) }) }) }); -}, yr = ({ cols: t, fields: e, onReset: n }) => { + } }) }) : h("div", { className: "ff-data-list-filter-default-form ff-grid-layout-form", children: h("div", { className: "grid-layout-item", style: Xn(20, 0, 5, 2), children: h(Ct.Item, { name: ["keyword"], children: h(Ki.Search, { allowClear: !0, enterButton: "搜索", placeholder: "多关键字 | 分割", onSearch: (w) => o(w) }) }) }) }) }) }); +}, wr = ({ cols: t, fields: e, onReset: n }) => { const [i, r] = L(!1), o = z(() => e == null ? void 0 : e.toReversed().some((a) => a.y > 1 || a.x + a.w >= t - 5), [t, e]); return I(Ct.Item, { label: " ", style: { "--item-span": 5 }, className: j("ff-data-list-filter-actions", { expanded: i }), children: [h(St, { onClick: n, children: "重置" }), h(St, { type: "primary", htmlType: "submit", children: "查询" }), o && h(R.Link, { className: "ff-data-list-filter-expanded-button", widget: () => r((a) => !a), type: "primary", name: i ? "关闭" : "展开", icon: i ? "icon-up" : "icon-down", iconPosition: "end" })] }); }; -Qn.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 wr = ({ className: t, operations: e, isOperations: n, isPaginate: i }) => { +Zn.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 br = ({ className: t, operations: e, isOperations: n, isPaginate: i }) => { const { onPageChange: r, onPageSizeChange: o, onClickCallback: a, getBase62params: s } = x.useContext(le), { total: l, page: c, pageSize: u } = (s == null ? void 0 : s()) || {}; - return n && !y.isEmpty(e) || i ? I("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 && (a == null ? void 0 : a(p.isRefresh, null)) }, p.uuid || m)) }), i && h(Ki, { size: "small", total: l, pageSize: u, showSizeChanger: !1, showTotal: (p) => `第 ${c} 页 / 总共 ${p} 条`, onChange: r, onShowSizeChange: o })] }) : null; -}, br = [{ 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" }] }] }], Cr = ({ className: t, width: e = 280, isTreeSider: n }) => { + return n && !y.isEmpty(e) || i ? I("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 && (a == null ? void 0 : a(p.isRefresh, null)) }, p.uuid || m)) }), i && h(Hi, { size: "small", total: l, pageSize: u, showSizeChanger: !1, showTotal: (p) => `第 ${c} 页 / 总共 ${p} 条`, onChange: r, onShowSizeChange: o })] }) : null; +}, Cr = [{ 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" }] }] }], kr = ({ className: t, width: e = 280, isTreeSider: n }) => { const { classNames: i } = ge(le); - return n ? h(Hi.DirectoryTree, { className: j("ff-data-list-sider", i.sider, t), style: { "--sider-width": e }, showLine: !0, showIcon: !1, treeData: br }) : null; -}, kr = ({ className: t, title: e, tabs: n }) => { - const { getBase62params: i, onTabChange: r, onReload: o, classNames: a } = ge(le), { tab: s } = (i == null ? void 0 : i()) || {}, [l, c] = Qi((n == null ? void 0 : n[0].value) ?? (n == null ? void 0 : n[0].code), { value: s, onChange: r }); + return n ? h(Ji.DirectoryTree, { className: j("ff-data-list-sider", i.sider, t), style: { "--sider-width": e }, showLine: !0, showIcon: !1, treeData: Cr }) : null; +}, Sr = ({ className: t, title: e, tabs: n }) => { + const { getBase62params: i, onTabChange: r, onReload: o, classNames: a } = ge(le), { tab: s } = (i == null ? void 0 : i()) || {}, [l, c] = Zi((n == null ? void 0 : n[0].value) ?? (n == null ? void 0 : n[0].code), { value: s, onChange: r }); return I("div", { className: j("ff-data-list-toolbar", a.toolbar, t), children: [h("div", { className: "ff-data-list-title", children: e }), h(_i, { 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: n }), I("div", { className: "ff-data-list-actions", children: [h(R.Link, { icon: "icon-reload", widget: () => o() }), h(R.Link, { icon: "icon-setting" })] })] }); -}, Sr = ({ className: t, ...e }) => h(Ut, { className: j(t, "ff-data-list-empty"), image: Ut.PRESENTED_IMAGE_SIMPLE, ...e }), Zn = ({ isItemGridLayout: t, theme: e, themeProps: n, onClickCallback: i, onReload: r, listCode: o, total: a = 0, page: s = 0, onPageChange: l, pageSize: c = 30, onPageSizeChange: u, tab: p, onTabChange: m, keyword: g, onKeywordChange: w, condition: f, onConditionChange: S, sider: b, onSiderChange: E, layouts: k, classNames: $ = {}, payload: F = {}, dataSource: A = [], rowSelection: O, getSelectedRows: T, primaryKey: V, ...v }) => { +}, xr = ({ className: t, ...e }) => h(qt, { className: j(t, "ff-data-list-empty"), image: qt.PRESENTED_IMAGE_SIMPLE, ...e }), ei = ({ isItemGridLayout: t, theme: e, themeProps: n, onClickCallback: i, onReload: r, listCode: o, total: a = 0, page: s = 0, onPageChange: l, pageSize: c = 30, onPageSizeChange: u, tab: p, onTabChange: m, keyword: g, onKeywordChange: w, condition: f, onConditionChange: S, sider: b, onSiderChange: E, layouts: k, classNames: $ = {}, payload: F = {}, dataSource: A = [], rowSelection: O, getSelectedRows: T, primaryKey: V, ...N }) => { const [M, D] = L(), B = T ?? (() => A), Q = G((q, ce) => { const H = { tab: p, page: s, pageSize: c, keyword: g, sider: b, condition: f, total: a, payload: F }; return q && q != "init" ? y.get(H, q, ce) : H; }, [JSON.stringify(f), JSON.stringify(F), p, s, c, g, b, a]), Ee = z(() => { - let q = { sider: Cr, filter: Qn, footer: wr, toolbar: kr, empty: Sr }; + let q = { sider: kr, filter: Zn, footer: br, toolbar: Sr, empty: xr }; k === !1 ? q = { sider: null, filter: null, footer: null, toolbar: null, empty: null } : y.isPlainObject(k) && (q = Object.assign({}, q, k)); for (const ce in q) if (q[ce]) { - if (Mi(q[ce])) { + if (Vi(q[ce])) { const H = q[ce]; q[ce] = (wt) => x.cloneElement(H, wt); } @@ -328,10 +328,10 @@ const wr = ({ className: t, operations: e, isOperations: n, isPaginate: i }) => e ? se.getWidgetComponent(e).then((q) => { if (!q) throw `${e} not found`; return q; - }).catch((q) => ({ default: () => `${q}` })).then((q) => D(x.createElement(q.default, { ...v, layouts: Ee, $setting: n }))) : D(h(t ? hr : fr, { ...v, layouts: Ee, $setting: n })); - }, [e, n]), h(le.Provider, { value: { classNames: $, listCode: o, onClickCallback: i, onReload: r, getBase62params: Q, onPageChange: l, onPageSizeChange: u, onTabChange: m, onSiderChange: E, onKeywordChange: w, onConditionChange: S, setPage: l, setPageSize: u, setTab: m, setSider: E, setKeyword: w, setCondition: S, getSelectedRows: B }, children: M && x.cloneElement(M, { dataSource: A, primaryKey: V, rowSelection: O, ...v }) }); + }).catch((q) => ({ default: () => `${q}` })).then((q) => D(x.createElement(q.default, { ...N, layouts: Ee, $setting: n }))) : D(h(t ? mr : yr, { ...N, layouts: Ee, $setting: n })); + }, [e, n]), h(le.Provider, { value: { classNames: $, listCode: o, onClickCallback: i, onReload: r, getBase62params: Q, onPageChange: l, onPageSizeChange: u, onTabChange: m, onSiderChange: E, onKeywordChange: w, onConditionChange: S, setPage: l, setPageSize: u, setTab: m, setSider: E, setKeyword: w, setCondition: S, getSelectedRows: B }, children: M && x.cloneElement(M, { dataSource: A, primaryKey: V, rowSelection: O, ...N }) }); }; -Zn.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]) }; +ei.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 Fe, Pe, ze, vt; const ye = class ye { constructor() { @@ -349,37 +349,37 @@ const ye = class ye { }); }, d(this, Pe).port.postMessage({ command: "status", data: [] }); }); - N(this, "subscribe", (e, n = []) => (n ? Array.isArray(n) && n.length == 0 ? n = "*" : Array.isArray(n) || (n = [n].flat()) : n = "*", d(this, ze).set(e, n), d(this, ze).size == 1 && d(this, vt).call(this), () => this.unsubscribe(e))); - N(this, "unsubscribe", (e) => d(this, ze).delete(e)); + v(this, "subscribe", (e, n = []) => (n ? Array.isArray(n) && n.length == 0 ? n = "*" : Array.isArray(n) || (n = [n].flat()) : n = "*", d(this, ze).set(e, n), d(this, ze).size == 1 && d(this, vt).call(this), () => this.unsubscribe(e))); + v(this, "unsubscribe", (e) => d(this, ze).delete(e)); if (d(ye, Fe)) return d(ye, Fe); } }; -Fe = new WeakMap(), Pe = new WeakMap(), ze = new WeakMap(), vt = new WeakMap(), P(ye, Fe, null), N(ye, "getInstance", () => (d(ye, Fe) || K(ye, Fe, new ye()), d(ye, Fe))); +Fe = new WeakMap(), Pe = new WeakMap(), ze = new WeakMap(), vt = new WeakMap(), P(ye, Fe, null), v(ye, "getInstance", () => (d(ye, Fe) || K(ye, Fe, new ye()), d(ye, Fe))); let _t = ye; -const ei = _t.getInstance(), an = x.forwardRef(({ listCode: t, base62params: e, className: n, theme: i, themeProps: r, layouts: o, classNames: a, rowSelection: s = null, onDataSourceChange: l }, c) => { - const [{ resource: u, primaryKey: p, batchOperations: m = [], itemOperations: g = [], columns: w = [], isConditionFormLayout: f = !1, isTreeSider: S, treeSiderConfig: b, theme: E, themeConfig: k, isItemGridLayout: $, itemGridLayout: { themeConfig: F, ...A } = {}, title: O, isPaginate: T, tabs: V, selectionType: v }, M] = L({ isItemGridLayout: !1, itemGridLayout: {} }), { type: D = v, selectedRowKeys: B, defaultSelectedRowKeys: Q, onChange: Ee, ...q } = s ?? {}, ce = gr(t, e), [{ dataSource: H, itemOperationsAccess: wt, condition: mi, tab: fi, keyword: yi, page: pn, total: gn, pageSize: hn, sider: wi, onConditionChange: bi, onTabChange: Ci, onKeywordChange: ki, onPageChange: Si, onPageSizeChange: xi, onSiderChange: Ei, onReload: At, payload: $i }, mn] = pr(ce, t, p, u), Pi = En(l); - tn(() => { - Pi(H, { primaryKey: p, page: pn, pageSize: hn, total: gn }); +const ti = _t.getInstance(), sn = x.forwardRef(({ listCode: t, base62params: e, className: n, theme: i, themeProps: r, layouts: o, classNames: a, rowSelection: s = null, onDataSourceChange: l }, c) => { + const [{ resource: u, primaryKey: p, batchOperations: m = [], itemOperations: g = [], columns: w = [], isConditionFormLayout: f = !1, isTreeSider: S, treeSiderConfig: b, theme: E, themeConfig: k, isItemGridLayout: $, itemGridLayout: { themeConfig: F, ...A } = {}, title: O, isPaginate: T, tabs: V, selectionType: N }, M] = L({ isItemGridLayout: !1, itemGridLayout: {} }), { type: D = N, selectedRowKeys: B, defaultSelectedRowKeys: Q, onChange: Ee, ...q } = s ?? {}, ce = hr(t, e), [{ dataSource: H, itemOperationsAccess: wt, condition: fi, tab: yi, keyword: wi, page: gn, total: hn, pageSize: mn, sider: bi, onConditionChange: Ci, onTabChange: ki, onKeywordChange: Si, onPageChange: xi, onPageSizeChange: Ei, onSiderChange: $i, onReload: At, payload: Pi }, fn] = gr(ce, t, p, u), vi = $n(l); + nn(() => { + vi(H, { primaryKey: p, page: gn, pageSize: mn, total: hn }); }, [H]); - const [fn, vi] = Ui([], { defaultValue: Q ?? [], value: B }), [yn, Ni] = L([]), wn = G(() => D ? yn : H, [D, yn, H]), Ti = Ht(g, wt, H, p), Oi = Ht(m); + const [yn, Ni] = qi([], { defaultValue: Q ?? [], value: B }), [wn, Ti] = L([]), bn = G(() => D ? wn : H, [D, wn, H]), Oi = Jt(g, wt, H, p), Ri = Jt(m); U(() => { let Z = null; return t && W.get(`/api/_/${t}`).resp(({ data: Ve, res: It }) => { - Ve != null && Ve.isDynamicRefresh && (Z = ei.subscribe(() => At(), It)), M(Ve); + Ve != null && Ve.isDynamicRefresh && (Z = ti.subscribe(() => At(), It)), M(Ve); }).catch(() => M({})), () => Z == null ? void 0 : Z(); - }, [t]), x.useImperativeHandle(c, () => ({ onReload: At, onClickCallback: mn, getSelectedRows: wn })); - const bn = En((Z, Ve) => { - Ni((It) => { - const Cn = new Map(It.map((de) => [de == null ? void 0 : de[p], de])); - return Ve.forEach((de) => Cn.set(de == null ? void 0 : de[p], de)), Z.map((de) => Cn.get(de)).filter(Boolean); - }), vi(Z), Ee == null || Ee(Z, Ve); - }), Ri = z(() => D ? { columnWidth: 80, ...q, type: D, selectedRowKeys: fn, onChange: bn } : void 0, [D, fn, bn, s]), Fi = z(() => y.merge({}, k, r), [k, r]), ji = z(() => g == null ? void 0 : g.map((Z) => y.isEmpty(Z == null ? void 0 : Z.confirm) ? Z : { ...Z, confirm: Object.assign({}, Z.confirm, { getPopupContainer: () => document.body }) }), [g]), Ai = z(() => ({ ...A, themeProps: F }), [A, F]); - return h(Zn, { listCode: t, title: O, classNames: a, layouts: o, resource: u, primaryKey: p, theme: i || E, themeProps: Fi, isTreeSider: S, treeSiderConfig: b, isPaginate: T, rowSelection: Ri, getSelectedRows: wn, tabs: V, isItemOperations: Ti, itemOperations: ji, isBatchOperations: Oi, batchOperations: m, isItemGridLayout: $, columns: w, itemGridLayout: Ai, isConditionFormLayout: f, itemOperationsAccess: wt, dataSource: H, onConditionChange: bi, onTabChange: Ci, onKeywordChange: ki, onPageChange: Si, onPageSizeChange: xi, onSiderChange: Ei, condition: mi, tab: fi, keyword: yi, page: pn, total: gn, pageSize: hn, sider: wi, payload: $i, className: j("ff-data-list-helper", n), onReload: At, onClickCallback: mn }); -}), ti = (t, e, n = !0) => n !== !0 && n-- <= 0 ? [] : y.isArray(t) && !y.isEmpty(t) ? t.reduce((i, r) => (Reflect.has(r, e) && Reflect.has(r, "children") && i.push(r[e]), Reflect.has(r, "children") && !y.isEmpty(r.children) ? i.concat(ti(r.children, e, n)) : i), []) : [], xr = ({ className: t, primaryKey: e, columns: n = [], dataSource: i = [], operationRender: r, operationWidth: o = 180, components: a = {}, rowSelection: s, ...l }) => { - const { classNames: c } = ge(le), u = J(null), p = J(null), [m, g] = L([]), [w, f] = L({ width: 0, height: 0 }); + }, [t]), x.useImperativeHandle(c, () => ({ onReload: At, onClickCallback: fn, getSelectedRows: bn })); + const Cn = $n((Z, Ve) => { + Ti((It) => { + const kn = new Map(It.map((de) => [de == null ? void 0 : de[p], de])); + return Ve.forEach((de) => kn.set(de == null ? void 0 : de[p], de)), Z.map((de) => kn.get(de)).filter(Boolean); + }), Ni(Z), Ee == null || Ee(Z, Ve); + }), Fi = z(() => D ? { columnWidth: 80, ...q, type: D, selectedRowKeys: yn, onChange: Cn } : void 0, [D, yn, Cn, s]), ji = z(() => y.merge({}, k, r), [k, r]), Ai = z(() => g == null ? void 0 : g.map((Z) => y.isEmpty(Z == null ? void 0 : Z.confirm) ? Z : { ...Z, confirm: Object.assign({}, Z.confirm, { getPopupContainer: () => document.body }) }), [g]), Ii = z(() => ({ ...A, themeProps: F }), [A, F]); + return h(ei, { listCode: t, title: O, classNames: a, layouts: o, resource: u, primaryKey: p, theme: i || E, themeProps: ji, isTreeSider: S, treeSiderConfig: b, isPaginate: T, rowSelection: Fi, getSelectedRows: bn, tabs: V, isItemOperations: Oi, itemOperations: Ai, isBatchOperations: Ri, batchOperations: m, isItemGridLayout: $, columns: w, itemGridLayout: Ii, isConditionFormLayout: f, itemOperationsAccess: wt, dataSource: H, onConditionChange: Ci, onTabChange: ki, onKeywordChange: Si, onPageChange: xi, onPageSizeChange: Ei, onSiderChange: $i, condition: fi, tab: yi, keyword: wi, page: gn, total: hn, pageSize: mn, sider: bi, payload: Pi, className: j("ff-data-list-helper", n), onReload: At, onClickCallback: fn }); +}), ni = (t, e, n = !0) => n !== !0 && n-- <= 0 ? [] : y.isArray(t) && !y.isEmpty(t) ? t.reduce((i, r) => (Reflect.has(r, e) && Reflect.has(r, "children") && i.push(r[e]), Reflect.has(r, "children") && !y.isEmpty(r.children) ? i.concat(ni(r.children, e, n)) : i), []) : [], Er = ({ className: t, primaryKey: e, columns: n = [], dataSource: i = [], operationRender: r, operationWidth: o = 180, components: a = {}, rowSelection: s, ...l }) => { + const { classNames: c } = ge(le), u = _(null), p = _(null), [m, g] = L([]), [w, f] = L({ width: 0, height: 0 }); U(() => { - g(ti(i, e)); - }, [i, e]), Vi(() => { + g(ni(i, e)); + }, [i, e]), Di(() => { const k = new ResizeObserver(() => { var $; f({ width: (($ = u.current) == null ? void 0 : $.nativeElement.querySelector(".ant-table-body").scrollWidth) || p.current.offsetWidth, height: p.current.offsetHeight }); @@ -394,19 +394,19 @@ const ei = _t.getInstance(), an = x.forwardRef(({ listCode: t, base62params: e, if ($ + F + k >= w.width) return n; const A = w.width - $ - k; return n.map((O) => O != null && O.isWidthFixed ? O : { ...O, width: Math.floor(A * ((O == null ? void 0 : O.width) ?? 100) / F) }); - }, [n, w.width, s, r, o]), b = dr(S), E = ur(a); - return h("div", { ref: p, className: j("ff-data-list-table", c.content, t), children: w.height ? h($n, { bordered: !0, ...l, components: E, ref: u, rowKey: (k) => (k == null ? void 0 : k[e]) ?? Math.random(), rowSelection: s, columns: (() => { + }, [n, w.width, s, r, o]), b = ur(S), E = pr(a); + return h("div", { ref: p, className: j("ff-data-list-table", c.content, t), children: w.height ? h(Pn, { bordered: !0, ...l, components: E, ref: u, rowKey: (k) => (k == null ? void 0 : k[e]) ?? Math.random(), rowSelection: s, columns: (() => { var $, F; const k = [...b ?? []]; - return s && k.splice((F = ($ = k[0]) == null ? void 0 : $.key) != null && F.startsWith("__") ? 1 : 0, 0, $n.SELECTION_COLUMN), r && k.push({ title: "操作", align: "center", fixed: "right", className: "ff-data-list-table-operations", width: `${Math.ceil(o / w.width * 100).toFixed(2)}%`, render: (A, O, T) => r(O, T) }), k; + return s && k.splice((F = ($ = k[0]) == null ? void 0 : $.key) != null && F.startsWith("__") ? 1 : 0, 0, Pn.SELECTION_COLUMN), r && k.push({ title: "操作", align: "center", fixed: "right", className: "ff-data-list-table-operations", width: `${Math.ceil(o / w.width * 100).toFixed(2)}%`, render: (A, O, T) => r(O, T) }), k; })(), dataSource: i, size: "middle", scroll: { x: "max-content", y: w.height - 50 }, pagination: !1, expandable: { defaultExpandAllRows: !0, expandRowByClick: !0, onExpandedRowsChange: g, expandedRowKeys: m } }) : null }); -}, Er = "RC_FORM_INTERNAL_HOOKS", $r = (t) => { +}, $r = "RC_FORM_INTERNAL_HOOKS", Pr = (t) => { const [e, n] = x.useState({ items: [] }); return U(() => { t && W.get(`/api/_/${t}`).then(({ uuid: i, code: r, name: o, resource: a, primaryKey: s, marginX: l, marginY: c, cols: u, rowHeight: p, fields: m, theme: g, themeSetting: w, groups: f }) => ({ uuid: i, code: r, name: o, resource: a, primaryKey: s, marginX: l, marginY: c, cols: u, rowHeight: p, theme: g, themeProps: w, groups: f, items: m })).then(n); }, [t]), e; -}, Pr = (t, { initialValue: e, initialValueLanguage: n, convertJs: i, convertJsSetting: r, type: o = "string" }, a = null) => { - const s = J(!1), l = ge(Wn), [c, u] = L(), [p, m] = L(n != "javascript" && t ? l.getFieldValue(t) : void 0), { registerWatch: g } = l.getInternalHooks(Er) || {}; +}, vr = (t, { initialValue: e, initialValueLanguage: n, convertJs: i, convertJsSetting: r, type: o = "string" }, a = null) => { + const s = _(!1), l = ge(Bn), [c, u] = L(), [p, m] = L(n != "javascript" && t ? l.getFieldValue(t) : void 0), { registerWatch: g } = l.getInternalHooks($r) || {}; return U(() => g == null ? void 0 : g((w, f, S) => { if (!s.current) return; const b = y.get(f, t); @@ -418,8 +418,8 @@ const ei = _t.getInstance(), an = x.forwardRef(({ listCode: t, base62params: e, u(w), console.error("布局数据转换错误: ", w, i); }); }, [p, i, r]), [c ?? p, p]; -}, Vo = (t, e, n = null) => z(() => on(t, e, n), [t]), ni = (t, e, n = {}, i = {}, r = {}, o = null) => { - const a = ge(Wn), s = Rt(), l = J(!0), c = J([]), [u, p] = L(e), [m, g] = L(), w = ae.useWatch((f) => JSON.stringify(y.pick(f, c.current)), a) || "{}"; +}, Do = (t, e, n = null) => z(() => an(t, e, n), [t]), ii = (t, e, n = {}, i = {}, r = {}, o = null) => { + const a = ge(Bn), s = Rt(), l = _(!0), c = _([]), [u, p] = L(e), [m, g] = L(), w = ae.useWatch((f) => JSON.stringify(y.pick(f, c.current)), a) || "{}"; return Ft(() => { t && Me.exec(t, n, { ...i, getFieldValueForBasicForm: (f) => r ? r.getFieldValue(f) : null, getFieldValue: y.wrap(a.getFieldValue, (f, S) => (c.current.some((b) => y.isEqual(b, S)) || (c.current.push(S), s()), f == null ? void 0 : f(S))), isFieldTouched: a.isFieldTouched, isFieldsTouched: a.isFieldsTouched }).then((f) => { l.current && (p(f), g(null)); @@ -427,18 +427,18 @@ const ei = _t.getInstance(), an = x.forwardRef(({ listCode: t, base62params: e, l.current && (p(e), g(f)); }); }, [t, w, a, n, i]), U(() => () => l.current = !1, []), t ? [o ? pe(u, o) : u, m] : [o ? pe(e, o) : e, null]; -}, vr = ({ widget: t, widgetPrefix: e = "@pkg/ff/grid-layouts", basicForm: n, ...i }) => { +}, Nr = ({ widget: t, widgetPrefix: e = "@pkg/ff/grid-layouts", basicForm: n, ...i }) => { const r = t != null && t.startsWith("@") || t != null && t.startsWith("blob:") ? t : `${e}/${t}`, [o, a] = L(); return U(() => { - r && se.getWidgetComponent(r).then(({ defaultProps: s = {}, default: l }) => ({ default: Nr(l, s, n) })).catch((s) => ({ default: () => `${s}` })).then((s) => a(x.createElement(s.default, i))); + r && se.getWidgetComponent(r).then(({ defaultProps: s = {}, default: l }) => ({ default: Tr(l, s, n) })).catch((s) => ({ default: () => `${s}` })).then((s) => a(x.createElement(s.default, i))); }, [r]), o; -}, Nr = (t, e = {}, n = null) => (i) => { - const { code: r, label: o, extras: a, isVirtual: s, initialValue: l, initialValueLanguage: c, convertJs: u, convertJsSetting: p, value: m, ...g } = y.merge({}, e, i), [w, f] = Pr(s ? null : r, { initialValue: l, initialValueLanguage: c, convertJs: u, convertJsSetting: p, type: (g == null ? void 0 : g.type) || "string" }, n), S = z(() => { +}, Tr = (t, e = {}, n = null) => (i) => { + const { code: r, label: o, extras: a, isVirtual: s, initialValue: l, initialValueLanguage: c, convertJs: u, convertJsSetting: p, value: m, ...g } = y.merge({}, e, i), [w, f] = vr(s ? null : r, { initialValue: l, initialValueLanguage: c, convertJs: u, convertJsSetting: p, type: (g == null ? void 0 : g.type) || "string" }, n), S = z(() => { const k = Object.keys((e == null ? void 0 : e.extras) || {}); return y.over([y.partialRight(y.pick, k), y.partialRight(y.omit, k)]); }, [e == null ? void 0 : e.extras]), [b, E] = S(g); return h(t, { ...E, value: w, rawValue: f, $setting: Object.assign({}, a, b) }); -}, ii = ({ theme: t, basicForm: e, items: n = [{ key: "default", label: "默认" }], fields: i = [], itemRender: r, chunks: o = [], children: a, $setting: s = {}, ...l }) => { +}, ri = ({ theme: t, basicForm: e, items: n = [{ key: "default", label: "默认" }], fields: i = [], itemRender: r, chunks: o = [], children: a, $setting: s = {}, ...l }) => { const [c, u] = L(); U(() => { t ? se.getWidgetComponent(t).then((m) => { @@ -448,68 +448,68 @@ const ei = _t.getInstance(), an = x.forwardRef(({ listCode: t, base62params: e, }, [t]); const p = z(() => n == null ? void 0 : n.map((m) => ({ ...m, children: r(m, i == null ? void 0 : i.filter((g) => !(g != null && g.group) && m.key == "default" || g.group == m.key), m.key == "default" ? a : null) })).concat(o), [n, a, o]); return c && x.cloneElement(c, { items: p, basicForm: e, $setting: { ...s, ...l } }); -}, ri = ({ name: t, form: e = null, basicForm: n = null, style: i = {}, className: r, cols: o = 12, rowHeight: a = 21, containerPadding: s = [0, 0], itemMargin: l = [4, 0], formProps: c = {}, formFields: u = [], fields: p = [], data: m, theme: g, themeProps: w = {}, groups: f = [{ key: "default", label: "默认" }], children: S, ...b }) => { +}, oi = ({ name: t, form: e = null, basicForm: n = null, style: i = {}, className: r, cols: o = 12, rowHeight: a = 21, containerPadding: s = [0, 0], itemMargin: l = [4, 0], formProps: c = {}, formFields: u = [], fields: p = [], data: m, theme: g, themeProps: w = {}, groups: f = [{ key: "default", label: "默认" }], children: S, ...b }) => { const [E] = ae.useForm(e), k = z(() => [{ name: "__PROPS__", value: c }].concat(u), [c, u]); ft(() => (E.setFieldsValue(m), () => E.resetFields()), [m]); const $ = (F, A, O) => { - const T = on(A, vr, n), V = Xn(b); + const T = an(A, Nr, n), V = Qn(b); return I("div", { ...V, className: j("ff-grid-layout", r), style: { ...i, "--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": `${(s == null ? void 0 : s[0]) || 0}px`, "--grid-layout-container-padding-x": `${(s == null ? void 0 : s[1]) || 0}px`, "--grid-layout-cols": o, "--grid-layout-row-height": `${a}px` }, children: [T, O && x.cloneElement(O, { cols: o, rowHeight: a, itemMargin: l, containerPadding: s, fields: A, basicForm: n })] }); }; - return h(ae, { ...b, fields: k, form: E, component: !1, children: g ? h(ii, { ...w, items: f, theme: g, itemRender: $, fields: p, children: S, basicForm: n }) : $(0, p, S) }); -}, Do = /* @__PURE__ */ ((t) => function({ code: e, data: n, ...i }) { - const { uuid: r, resource: o, items: a, hides: s, rowHeight: l, marginX: c, marginY: u, cols: p, theme: m, themeProps: g, groups: w } = $r(e) || {}, f = z(() => [{ name: "__RESOURCE__", value: o }, { name: "__LAYOUT_KEY__", value: e }, { name: "__LAYOUT_UUID__", value: r }], [e, r, o]); + return h(ae, { ...b, fields: k, form: E, component: !1, children: g ? h(ri, { ...w, items: f, theme: g, itemRender: $, fields: p, children: S, basicForm: n }) : $(0, p, S) }); +}, Wo = /* @__PURE__ */ ((t) => function({ code: e, data: n, ...i }) { + const { uuid: r, resource: o, items: a, hides: s, rowHeight: l, marginX: c, marginY: u, cols: p, theme: m, themeProps: g, groups: w } = Pr(e) || {}, f = z(() => [{ name: "__RESOURCE__", value: o }, { name: "__LAYOUT_KEY__", value: e }, { name: "__LAYOUT_UUID__", value: r }], [e, r, o]); return o && h(t, { name: e, theme: m, themeProps: g, groups: w, ...i, fields: a, formFields: f, rowHeight: l, cols: p, itemMargin: [c, u], data: o ? { [o]: n } : n }); -})(ri), Tr = ({ column: t = 0, colWidth: e = 0, cols: n, rowHeight: i, itemMargin: r, containerPadding: o, fields: a, primaryKey: s, dataSource: l, beforeRender: c = null, afterRender: u = null, itemClassName: p, itemRender: m = ($, F, A) => $, empty: g = h(Ut, { description: null }), className: w, style: f = {}, theme: S, themeProps: b = {}, groups: E = [{ key: "default", label: "默认" }], rowSelection: k }) => { +})(oi), Or = ({ column: t = 0, colWidth: e = 0, cols: n, rowHeight: i, itemMargin: r, containerPadding: o, fields: a, primaryKey: s, dataSource: l, beforeRender: c = null, afterRender: u = null, itemClassName: p, itemRender: m = ($, F, A) => $, empty: g = h(qt, { description: null }), className: w, style: f = {}, theme: S, themeProps: b = {}, groups: E = [{ key: "default", label: "默认" }], rowSelection: k }) => { const { classNames: $ } = ge(le), F = G((T) => { if (!k) return; - const { selectedRowKeys: V = [], onChange: v, type: M = "checkbox" } = k, D = T == null ? void 0 : T[s]; + const { selectedRowKeys: V = [], onChange: N, type: M = "checkbox" } = k, D = T == null ? void 0 : T[s]; let B; - B = M === "radio" ? [D] : V.includes(D) ? V.filter((Q) => Q !== D) : [...V, D], v == null || v(B, l.filter((Q) => B.includes(Q == null ? void 0 : Q[s]))); - }, [k, s, l]), A = z(() => h(ri, { groups: E, theme: S, themeProps: b, cols: n, rowHeight: i, itemMargin: r, containerPadding: o, fields: a, className: p }), [a, n, i, r, o, E, S, b]), O = y.isEmpty(l); + B = M === "radio" ? [D] : V.includes(D) ? V.filter((Q) => Q !== D) : [...V, D], N == null || N(B, l.filter((Q) => B.includes(Q == null ? void 0 : Q[s]))); + }, [k, s, l]), A = z(() => h(oi, { groups: E, theme: S, themeProps: b, cols: n, rowHeight: i, itemMargin: r, containerPadding: o, fields: a, className: p }), [a, n, i, r, o, E, S, b]), O = y.isEmpty(l); return I("div", { className: j("ff-data-list-content", $.content, w), style: Object.assign({}, f, t && { "--col-num": t }, e && { "--col-width": e }), children: [c == null ? void 0 : c(l), O ? g : l.map((T, V) => { var B; - const v = (T == null ? void 0 : T[s]) ?? V, M = `${v}-${Ar(T)}`, D = m(x.cloneElement(A, { data: T }), T, V); - return x.cloneElement(D, { key: M, ...k && { isSelected: (B = k == null ? void 0 : k.selectedRowKeys) == null ? void 0 : B.includes(v), selectionType: k.type ?? "checkbox", onSelect: () => F(T) } }); + const N = (T == null ? void 0 : T[s]) ?? V, M = `${N}-${Ir(T)}`, D = m(x.cloneElement(A, { data: T }), T, V); + return x.cloneElement(D, { key: M, ...k && { isSelected: (B = k == null ? void 0 : k.selectedRowKeys) == null ? void 0 : B.includes(N), selectionType: k.type ?? "checkbox", onSelect: () => F(T) } }); }), u == null ? void 0 : u(l)] }); -}, Or = ({ component: t, $props: e }) => { +}, Rr = ({ component: t, $props: e }) => { const { base62params: n } = Ot(e, {}); - return h(ne, { children: h(an, { listCode: t, base62params: W.decode(n) }) }); -}, Wo = () => h(oi, {}), oi = () => "Empty", Rr = ({ component: t, $setting: e, $props: n }) => { - const [i, r] = L(), [o, a] = di(n); + return h(ie, { children: h(sn, { listCode: t, base62params: W.decode(n) }) }); +}, Bo = () => h(ai, {}), ai = () => "Empty", Fr = ({ component: t, $setting: e, $props: n }) => { + const [i, r] = L(), [o, a] = ui(n); return U(() => { - if (!t) return r(h(oi, { description: null })); + if (!t) return r(h(ai, { description: null })); se.getWidgetComponent(t).catch((s) => ({ default: () => `${s}` })).then((s) => x.createElement(s.default, { $setting: e })).then(r); }, [t]), i ? x.cloneElement(i, { ...o, $setProps: a }) : null; -}, Bo = () => "NotFoundPage"; +}, zo = () => "NotFoundPage"; var je, ue, Ae, Ce, st, lt; const we = class we { constructor() { P(this, ue, /* @__PURE__ */ new Map()); P(this, Ae, {}); P(this, Ce, null); - N(this, "init", (e, n) => { + v(this, "init", (e, n) => { K(this, ue, e), K(this, Ae, n); }); - N(this, "get", (e) => (d(this, ue).has(e) || (e = Array.from(d(this, ue).keys()).find((n) => d(this, ue).get(n).uri === e)), d(this, ue).get(e) || {})); - N(this, "redirect", (e, n, i = {}) => { + v(this, "get", (e) => (d(this, ue).has(e) || (e = Array.from(d(this, ue).keys()).find((n) => d(this, ue).get(n).uri === e)), d(this, ue).get(e) || {})); + v(this, "redirect", (e, n, i = {}) => { var w; const { uri: r, type: o, widgetProps: a } = this.get(e) || {}, { router: s, query: l, ...c } = n || {}, u = Object.assign({}, c, s), p = Object.assign({}, c, l); o == "list" && (u.base62params = W.encode(u != null && u.base62params ? u.base62params : u)); - let m = Zi(r || e, u); + let m = er(r || e, u); const g = new URLSearchParams(); for (const f in a || {}) ((w = a[f]) == null ? void 0 : w.type) == "query" && Object.has(p, f) && g.append(f, JSON.stringify(p[f])); return g.size > 0 && (m = `${m}?${g.toString()}`), i != null && i.isOpenWindow ? window.open(m) : d(this, Ce).navigate(m, { replace: !!(i != null && i.isReplaceRouteHistory) }); }); - N(this, "getMenus", (e) => { + v(this, "getMenus", (e) => { var n; return ((n = d(this, Ae)) == null ? void 0 : n[e]) || []; }); - N(this, "findMenuPathByUuid", (e) => { + v(this, "findMenuPathByUuid", (e) => { let n = []; for (const i in d(this, Ae)) if (n = d(this, st).call(this, d(this, Ae)[i], e, [i]), n.length > 1) return n; return n; }); - N(this, "getMenusByRouteUuid", (e) => d(this, lt).call(this, e, Object.values(d(this, Ae)).flat())); + v(this, "getMenusByRouteUuid", (e) => d(this, lt).call(this, e, Object.values(d(this, Ae)).flat())); P(this, st, (e, n, i = []) => { if (y.isEmpty(e)) return i; for (const { uuid: r, children: o } of e) { @@ -524,44 +524,44 @@ const we = class we { for (const o of n) o.widgetType == "redirect" && (o.uuid == e || o.widget == e ? i.push(o) : (r = o.children) != null && r.length && (i = i.concat(d(this, lt).call(this, e, o.children)))); return i; }); - N(this, "getCurrentMenu", () => { + v(this, "getCurrentMenu", () => { const { uuid: e } = this.getCurrentRoute() || {}; if (!e) return; const n = this.getMenusByRouteUuid(e); return y.isEmpty(n) ? void 0 : n[0]; }); - N(this, "getCurrentRoute", (e = 0) => { + v(this, "getCurrentRoute", (e = 0) => { var i; const n = (i = d(this, Ce).state.matches[d(this, Ce).state.matches.length - 1 - e]) == null ? void 0 : i.route; if (!n) return null; for (let [r, o] of d(this, ue)) if (o.uri === n.path) return o; return null; }); - N(this, "getPageParams", (e) => { + v(this, "getPageParams", (e) => { var a, s; const { location: n = {}, matches: i = [] } = ((a = d(this, Ce)) == null ? void 0 : a.state) || {}, r = { ...((s = i[i.length - 1]) == null ? void 0 : s.params) || {} }, o = n.search; return o && new URLSearchParams(o).forEach((l, c) => { r[c] = l; }), e ? y.get(r, e) : r; }); - N(this, "usePageParams", (e) => { + v(this, "usePageParams", (e) => { var i; - let n = zn() ? { ...er(), ...Object.fromEntries(new URLSearchParams(((i = tr()) == null ? void 0 : i.search) ?? "")) } : this.getPageParams(); + let n = Un() ? { ...tr(), ...Object.fromEntries(new URLSearchParams(((i = nr()) == null ? void 0 : i.search) ?? "")) } : this.getPageParams(); return e ? y.get(n, e) : n; }); - N(this, "createBrowserRouter", (e = {}) => { + v(this, "createBrowserRouter", (e = {}) => { if (d(this, ue).size == 0) return null; if (d(this, Ce)) return d(this, Ce); const n = qe.get("Common.WEBSITE_DEFAULT_THEME", "@pkg/ff/frameworks/DefaultTheme"), i = qe.get(se.checkUserToken() ? "Common.WEBSITE_LOGIN_REDIRECT" : "Common.WEBSITE_DEFAULT", "/index"), r = { [n]: 0 }, o = (s, l) => () => Promise.all([se.getWidgetComponent(s), Ot(l)]).then(([c, u]) => [c.default || function() { return `${s}`; - }, u]).then(([c, u]) => ({ Component: () => x.createElement(qn, {}, x.createElement(c, { $setting: u })) })), a = Array.from(d(this, ue).values()).reduce((s, { uuid: l, uri: c, name: u, type: p, component: m, widgetSetting: g, widgetProps: w, isLogin: f, isLayout: S, extra: b }) => { + }, u]).then(([c, u]) => ({ Component: () => x.createElement(Kn, {}, x.createElement(c, { $setting: u })) })), a = Array.from(d(this, ue).values()).reduce((s, { uuid: l, uri: c, name: u, type: p, component: m, widgetSetting: g, widgetProps: w, isLogin: f, isLayout: S, extra: b }) => { let E = {}, k = 0; switch (p) { case "list": - E.element = x.createElement(Or, { component: m, $props: w }); + E.element = x.createElement(Rr, { component: m, $props: w }); break; case "fsdpf-component": - E.element = x.createElement(Rr, { key: c, component: m, $setting: g, $props: w }); + E.element = x.createElement(Fr, { key: c, component: m, $setting: g, $props: w }); } const $ = (b == null ? void 0 : b.theme) ?? (b == null ? void 0 : b.layout); if ($) { @@ -571,30 +571,30 @@ const we = class we { } return S && k > -1 ? (s[k].children.push({ path: c, ...E }), s) : [...s, { path: c, ...E }]; }, [{ path: "/", lazy: o(n, {}), children: [] }]); - return a.push({ index: !0, element: x.createElement(Fr, { to: i, replace: !0 }) }), K(this, Ce, nr(a, e)); + return a.push({ index: !0, element: x.createElement(jr, { to: i, replace: !0 }) }), K(this, Ce, ir(a, e)); }); if (d(we, je)) return d(we, je); } }; -je = new WeakMap(), ue = new WeakMap(), Ae = new WeakMap(), Ce = new WeakMap(), st = new WeakMap(), lt = new WeakMap(), P(we, je, null), N(we, "getInstance", () => (d(we, je) || K(we, je, new we()), d(we, je))); -let Jt = we; -const Fr = ({ to: t, replace: e }) => zn() ? x.createElement(ir, { to: t, replace: e }) : (window.document.location = t, "redirect"), oe = Jt.getInstance(), Ke = new Worker(new URL("/ff-worker/index.js", self.location)), On = { generateUUID: () => Mr(), getConfigure: (t) => qe.get(t), route: { redirect: (...t) => oe.redirect(...t), getPageParams: (...t) => oe.getPageParams(...t), getCurrentRoute: () => oe.getCurrentRoute() }, popup: { notification: (...t) => re.notification(...t), success: (...t) => re.success(...t), error: (...t) => re.error(...t), form: (...t) => re.form(...t), modal: (...t) => re.modal(...t), confirm: (...t) => re.confirm(...t) } }; +je = new WeakMap(), ue = new WeakMap(), Ae = new WeakMap(), Ce = new WeakMap(), st = new WeakMap(), lt = new WeakMap(), P(we, je, null), v(we, "getInstance", () => (d(we, je) || K(we, je, new we()), d(we, je))); +let Gt = we; +const jr = ({ to: t, replace: e }) => Un() ? x.createElement(rr, { to: t, replace: e }) : (window.document.location = t, "redirect"), oe = Gt.getInstance(), Ke = new Worker(new URL("/ff-worker/index.js", self.location)), Rn = { generateUUID: () => Vr(), getConfigure: (t) => qe.get(t), route: { redirect: (...t) => oe.redirect(...t), getPageParams: (...t) => oe.getPageParams(...t), getCurrentRoute: () => oe.getCurrentRoute() }, popup: { notification: (...t) => ne.notification(...t), success: (...t) => ne.success(...t), error: (...t) => ne.error(...t), form: (...t) => ne.form(...t), modal: (...t) => ne.modal(...t), confirm: (...t) => ne.confirm(...t) } }; var Nt, Ye, Ie; -const _ = class _ { +const J = class J { constructor() { - N(this, "exec", (e, n = {}, i = {}, r = "") => new Promise((o, a) => { + v(this, "exec", (e, n = {}, i = {}, r = "") => new Promise((o, a) => { if (!/^(?!\s*(\/\/|\/\*|\*)).*?\S+/m.test(e)) return o(); - const s = xn(_, Nt)._++; - d(_, Ye).set(s, i), _.mQueue.set(s, [o, a]), Ke.postMessage({ id: s, session: r, category: "eval", method: e, args: n }); + const s = En(J, Nt)._++; + d(J, Ye).set(s, i), J.mQueue.set(s, [o, a]), Ke.postMessage({ id: s, session: r, category: "eval", method: e, args: n }); })); - N(this, "clear", (e) => Ke.postMessage({ session: e, category: "clear" })); - if (d(_, Ie)) return d(_, Ie); - Promise.resolve().then(() => po).then((e) => { - On.http = e.http; + v(this, "clear", (e) => Ke.postMessage({ session: e, category: "clear" })); + if (d(J, Ie)) return d(J, Ie); + Promise.resolve().then(() => go).then((e) => { + Rn.http = e.http; }), Ke.addEventListener("message", ({ data: { id: e, task_id: n, method: i, args: r, category: o, data: a, error: s, session: l } }) => { - if (o === "eval" && _.mQueue.has(e)) s !== null ? _.mQueue.get(e)[1](s) : _.mQueue.get(e)[0](a), d(_, Ye).delete(e), _.mQueue.delete(e); + if (o === "eval" && J.mQueue.has(e)) s !== null ? J.mQueue.get(e)[1](s) : J.mQueue.get(e)[0](a), d(J, Ye).delete(e), J.mQueue.delete(e); else if (o === "util") try { - const c = y.get(On, i.split("/")) || y.get(d(_, Ye).get(n), i.split("/")); + const c = y.get(Rn, i.split("/")) || y.get(d(J, Ye).get(n), i.split("/")); if (!y.isFunction(c)) throw `${i} not found`; Promise.resolve(Reflect.apply(c, void 0, r)).then((u) => { Ke.postMessage({ id: e, task_id: n, category: o, method: i, args: r, session: l, data: u, error: null }); @@ -607,9 +607,9 @@ const _ = class _ { }, !1); } }; -Nt = new WeakMap(), Ye = new WeakMap(), Ie = new WeakMap(), N(_, "mQueue", /* @__PURE__ */ new Map()), P(_, Nt, 0), P(_, Ye, /* @__PURE__ */ new Map()), P(_, Ie, null), N(_, "getInstance", () => (d(_, Ie) || K(_, Ie, new _()), d(_, Ie))); -let Gt = _; -const Me = Gt.getInstance(), Rn = { 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) => { +Nt = new WeakMap(), Ye = new WeakMap(), Ie = new WeakMap(), v(J, "mQueue", /* @__PURE__ */ new Map()), P(J, Nt, 0), P(J, Ye, /* @__PURE__ */ new Map()), P(J, Ie, null), v(J, "getInstance", () => (d(J, Ie) || K(J, Ie, new J()), d(J, Ie))); +let Yt = J; +const Me = Yt.getInstance(), Fn = { 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": @@ -622,8 +622,8 @@ const Me = Gt.getInstance(), Rn = { null2json: (t) => Object.create(), null2arra let n = "string"; n = Array.isArray(t) ? "array" : typeof t, y.isObject(t) && (n = "json"); const i = `${n}2${e}`; - return Reflect.has(Rn, i) ? Rn[i](t) : t; -}, jr = (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, Ot = (t = {}, e = {}, n = {}, i = "") => ai(t, (r, o) => o === "type" && r === "code") ? si(t, e, n, i) : li(t, e, i), ai = (t, e = () => !1) => y.some(t, (n) => !!y.some(n, e) || (y.isEmpty(n) || !y.isPlainObject(n) && !y.isArray(n) ? void 0 : ai(n, e))), si = async (t = {}, e = {}, n = {}, i = "") => { + return Reflect.has(Fn, i) ? Fn[i](t) : t; +}, Ar = (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, Ot = (t = {}, e = {}, n = {}, i = "") => si(t, (r, o) => o === "type" && r === "code") ? li(t, e, n, i) : ci(t, e, i), si = (t, e = () => !1) => y.some(t, (n) => !!y.some(n, e) || (y.isEmpty(n) || !y.isPlainObject(n) && !y.isArray(n) ? void 0 : si(n, e))), li = async (t = {}, e = {}, n = {}, i = "") => { let r = /* @__PURE__ */ Object.create(null); for (let o in t) { let a; @@ -648,11 +648,11 @@ const Me = Gt.getInstance(), Rn = { null2json: (t) => Object.create(), null2arra a = l; } a ?? (a = c); - } else a = await si(t[o], e, n, i); + } else a = await li(t[o], e, n, i); y.set(r, o, a); } return r; -}, li = (t = {}, e = {}, n = "") => Object.keys(t || {}).reduce((i, r) => { +}, ci = (t = {}, e = {}, n = "") => Object.keys(t || {}).reduce((i, r) => { if (y.isPlainObject(t[r])) { let o; if (Reflect.has(t[r], "type") && ["field", "router", "query", "string"].includes(t[r].type)) { @@ -669,35 +669,35 @@ const Me = Gt.getInstance(), Rn = { null2json: (t) => Object.create(), null2arra o = s; } o ?? (o = l); - } else o = li(t[r], e, n); + } else o = ci(t[r], e, n); y.set(i, r, o); } return i; -}, {}), Mt = (t, e) => t && typeof t == "object" ? Array.isArray(t) ? t.map((n) => Mt(n, e)) : Object.keys(t).reduce((n, i) => (e[i] ? n[e[i]] = Mt(t[i], e) : n[i] = Mt(t[i], e), n), {}) : t, zo = () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (t) => { +}, {}), Mt = (t, e) => t && typeof t == "object" ? Array.isArray(t) ? t.map((n) => Mt(n, e)) : Object.keys(t).reduce((n, i) => (e[i] ? n[e[i]] = Mt(t[i], e) : n[i] = Mt(t[i], e), n), {}) : t, Uo = () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (t) => { const e = 16 * Math.random() | 0; return (t === "x" ? e : 3 & e | 8).toString(16); -}), Uo = (t) => { +}), qo = (t) => { var e, n; return t ? (n = (e = t.match(/^@pkg(?:[^\/]*\/){3}(?[^\/]+)/)) == null ? void 0 : e.groups) == null ? void 0 : n.name : ""; -}, qo = (t) => { - var e, n; - return t ? (n = (e = t.match(/^@pkg(?:[^\/]*\/){2}(?[^\/]+)/)) == null ? void 0 : e.groups) == null ? void 0 : n.category : ""; }, Ko = (t) => { + var e, n; + return t ? (n = (e = t.match(/^@pkg(?:[^\/]*\/){2}(?[^\/]+)/)) == null ? void 0 : e.groups) == null ? void 0 : n.category : ""; +}, Ho = (t) => { var e, n; return t ? (n = (e = t.match(/^@pkg(?:[^\/]*\/){1}(?[^\/]+)/)) == null ? void 0 : e.groups) == null ? void 0 : n.owner : ""; -}, Ar = (t, e = 32, n = "auto") => { - const i = Yt(t), r = n === "auto" ? "x64" : n; +}, Ir = (t, e = 32, n = "auto") => { + const i = Xt(t), r = n === "auto" ? "x64" : n; if (e === 32) return Lt.x86.hash32(i).toString(); if (e === 128) return r === "x64" ? Lt.x64.hash128(i) : Lt.x86.hash128(i); throw new Error("bits 只能是 32 或 128"); -}, Yt = (t) => t == null ? "null" : typeof t == "string" ? t : typeof t == "number" || typeof t == "boolean" ? String(t) : typeof t == "function" ? t.toString() : Array.isArray(t) ? "[" + t.map(Yt).join(",") + "]" : typeof t == "object" ? "{" + Object.keys(t).sort().map((e) => `${e}:${Yt(t[e])}`).join(",") + "}" : String(t), Ir = () => { +}, Xt = (t) => t == null ? "null" : typeof t == "string" ? t : typeof t == "number" || typeof t == "boolean" ? String(t) : typeof t == "function" ? t.toString() : Array.isArray(t) ? "[" + t.map(Xt).join(",") + "]" : typeof t == "object" ? "{" + Object.keys(t).sort().map((e) => `${e}:${Xt(t[e])}`).join(",") + "}" : String(t), Lr = () => { let t = 1; const e = /* @__PURE__ */ new WeakMap(), n = /* @__PURE__ */ new Map(); return (...i) => i.length === 0 ? "" : i.map((r) => { return String((o = r) === null || typeof o != "object" && typeof o != "function" ? (n.has(o) || n.set(o, t++), n.get(o)) : (e.has(o) || e.set(o, t++), e.get(o))); var o; }).join("::"); -}, Lr = (t) => { +}, Mr = (t) => { if (!t || typeof t != "string" || t.startsWith("/") || t.startsWith("./") || t.startsWith("../")) return !1; try { let e = t.startsWith("//") ? `http:${t}` : t; @@ -705,18 +705,18 @@ const Me = Gt.getInstance(), Rn = { null2json: (t) => Object.create(), null2arra } catch { return !1; } -}, Ho = (t, e = "") => { - if (!t || typeof t != "string" || Lr(t)) return t; +}, Jo = (t, e = "") => { + if (!t || typeof t != "string" || Mr(t)) return t; let n = e; return !n && typeof window < "u" && window.location && (n = `${window.location.protocol}//${window.location.host}`), t.startsWith("/") ? n ? `${n}${t}` : t : n ? `${n}/${t}` : t; -}, Mr = () => typeof crypto < "u" && crypto.randomUUID ? crypto.randomUUID() : typeof crypto < "u" && crypto.getRandomValues ? "10000000-1000-4000-8000-100000000000".replace(/[018]/g, (t) => (+t ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> +t / 4).toString(16)) : "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (t) => { +}, Vr = () => typeof crypto < "u" && crypto.randomUUID ? crypto.randomUUID() : typeof crypto < "u" && crypto.getRandomValues ? "10000000-1000-4000-8000-100000000000".replace(/[018]/g, (t) => (+t ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> +t / 4).toString(16)) : "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (t) => { const e = 16 * Math.random() | 0; return (t === "x" ? e : 3 & e | 8).toString(16); }), Rt = () => { - const t = J(!0), [, e] = x.useReducer((n) => n + 1, 0); + const t = _(!0), [, e] = x.useReducer((n) => n + 1, 0); return U(() => () => t.current = !1, []), () => t.current && e(); }, _o = (t) => { - const [e, n] = L(t), i = J(null), r = G((o, a) => { + const [e, n] = L(t), i = _(null), r = G((o, a) => { i.current = a, n(o); }, []); return U(() => { @@ -726,29 +726,29 @@ const Me = Gt.getInstance(), Rn = { null2json: (t) => Object.create(), null2arra }, e, n = y.isEqual) => { const i = x.useRef(); n(e, i.current) || (i.current = y.cloneDeep(e)), x.useEffect(t, [i.current]); -}, Ft = ft, ci = (t, e = "string") => { +}, Ft = ft, di = (t, e = "string") => { var n; if (!Array.isArray(t)) return t; - for (let i = 0; i < t.length; i++) t[i].value = pe((n = t[i]) == null ? void 0 : n.value, e), t[i] && Reflect.has(t[i], "children") && (t[i].children = ci(t[i].children, e)); + for (let i = 0; i < t.length; i++) t[i].value = pe((n = t[i]) == null ? void 0 : n.value, e), t[i] && Reflect.has(t[i], "children") && (t[i].children = di(t[i].children, e)); return t; -}, Jo = (t, e = "json", n = "string", i, r = null) => { - const [o] = ae.useForm(i), [a, s] = L([{ label: "无", value: "", disabled: !0 }]), l = J([]), c = ae.useWatch((u) => l.current.length === 0 ? null : y.pick(u, l.current), o) || null; +}, Go = (t, e = "json", n = "string", i, r = null) => { + const [o] = ae.useForm(i), [a, s] = L([{ label: "无", value: "", disabled: !0 }]), l = _([]), c = ae.useWatch((u) => l.current.length === 0 ? null : y.pick(u, l.current), o) || null; return U(() => { Array.isArray(t) ? s(t) : e === "javascript" && t ? Me.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), r ? r.getFieldValue(u) : o.getFieldValue(u)) }).then((u) => { s(pe(u, "array")); }).catch((u) => console.error("useOptions", u)) : t && s(pe(t, "array")); - }, [t, e, c]), ci(a, n); -}, Go = (t) => { + }, [t, e, c]), di(a, n); +}, Yo = (t) => { const [e, n] = L(), i = { type: "GET" }; if (typeof t == "string" ? i.url = t : y.isPlainObject(t) && Object.assign(i, t), !(i != null && i.url)) throw "url is required"; const r = (o) => W.request(i, !1).resp((a) => (console.log("useSubscribeRequest", o), n(a), a)); return ft(() => { let o = null; return r().then((a) => { - o = ei.subscribe(y.throttle(r, 180, { leading: !1, trailing: !0 }), a.res); + o = ti.subscribe(y.throttle(r, 180, { leading: !1, trailing: !0 }), a.res); }), () => o == null ? void 0 : o(); }, i), e; -}, Vr = (t, e) => G((n) => { +}, Dr = (t, e) => G((n) => { const i = {}; for (const [r, o] of Object.entries(n)) { const a = t == null ? void 0 : t[r]; @@ -758,19 +758,19 @@ const Me = Gt.getInstance(), Rn = { null2json: (t) => Object.create(), null2arra } else i[r] = o; } Object.keys(i).length > 0 && e(i); -}, [t, e]), di = (t, e = {}, n = {}, i = []) => { - const [r, o] = L({}), [a, s] = L({}), l = Dn(a), c = oe.usePageParams(); - en(() => { +}, [t, e]), ui = (t, e = {}, n = {}, i = []) => { + const [r, o] = L({}), [a, s] = L({}), l = Wn(a), c = oe.usePageParams(); + tn(() => { Promise.resolve(Ot(t, e, n)).then(s); - }, [t, e, c, ...i]), tn(() => { + }, [t, e, c, ...i]), nn(() => { const m = l ?? {}, g = Object.keys({ ...m, ...a }).reduce((w, f) => (m[f] !== a[f] && (w[f] = a[f]), w), {}); Object.keys(g).length > 0 && o((w) => ({ ...w, ...g })); }, [a]); - const u = Vr(t, (m) => { + const u = Dr(t, (m) => { o((g) => ({ ...g, ...m })); }), p = z(() => Object.fromEntries(Object.entries(r).filter(([m, g]) => g !== a[m])), [r, a]); return [r, u, p]; -}, Dr = (t) => { +}, Wr = (t) => { const [e, n] = x.useState({ items: [], hides: [] }); return x.useEffect(() => { t && W.get(`/api/_/${t}`).then(({ pk: i, uuid: r, code: o, resource: a, align: s, cols: l, rowHeight: c, marginX: u, marginY: p, listenChangeFields: m, listenChangeFieldsFunc: g, fields: w, theme: f, themeSetting: S, groups: b }) => ({ pk: i, uuid: r, code: o, resource: a, align: s, cols: l, rowHeight: c, marginX: u, marginY: p, theme: f, themeProps: S, groups: b, listenChangeFields: m, listenChangeFieldsFunc: g, ...w.reduce((E, k) => { @@ -778,7 +778,7 @@ const Me = Gt.getInstance(), Rn = { null2json: (t) => Object.create(), null2arra return ($ = k == null ? void 0 : k.field) != null && $.hidden ? E.hides.push(k == null ? void 0 : k.field) : E.items.push(k), E; }, { items: [], hides: [] }) })).then(n); }, [t]), e; -}, Wr = ({ max: t = 0, min: e = 0, type: n = "", message: i, pattern: r, required: o = !1, validator: a } = {}, s, l) => { +}, Br = ({ max: t = 0, min: e = 0, type: n = "", message: i, pattern: r, required: o = !1, validator: a } = {}, s, l) => { const [c, u] = L([]); return U(() => { const p = []; @@ -812,7 +812,7 @@ const Me = Gt.getInstance(), Rn = { null2json: (t) => Object.create(), null2arra } u(p); }, [t, e, n, i, r, o, a]), c; -}, Br = (t, e, n) => { +}, zr = (t, e, n) => { const [i, r] = L(null); return U(() => { const { initDataUri: o = `/api/${t}`, initDataMethod: a = "GET" } = n || {}; @@ -820,95 +820,95 @@ const Me = Gt.getInstance(), Rn = { null2json: (t) => Object.create(), null2arra r(s); }); }, [t, e, n]), i; -}, zr = (t, e, n) => G((i, r = { serialize: (o) => o, onSuccess: () => { -}, onFail: (o) => (o == null ? void 0 : o.errorFields) && re.error("请先完善表单信息", { duration: 2e3 }) }) => { +}, Ur = (t, e, n) => G((i, r = { serialize: (o) => o, onSuccess: () => { +}, onFail: (o) => (o == null ? void 0 : o.errorFields) && ne.error("请先完善表单信息", { duration: 2e3 }) }) => { const o = i.getFieldValue("__RESOURCE__"), { submitDataUri: a = `/api/${t}`, submitDataMethod: s = "POST" } = n || {}; return i.validateFields().then((l) => o ? y.pick(l, [o]) : l).then(r.serialize).then((l) => W.request({ method: s, url: y.trimEnd(`${a}/${e || ""}`, "/"), data: l }).msg(r.onSuccess)).catch(r.onFail); -}, [t, e, n]), Ur = (t, e, n, i) => { - const r = Br(e, n, i); +}, [t, e, n]), qr = (t, e, n, i) => { + const r = zr(e, n, i); U(() => { r ? t.setFieldsValue(r) : t.resetFields(); }, [t, r]); - const o = zr(e, n, i); + const o = Ur(e, n, i); return y.partial(o, t); -}, qr = (t, e, n = [], i = {}) => { - const r = J({}), o = J(), a = y.debounce(Rt(), 180), s = ["disabled", "required"], l = (m, g) => { +}, Kr = (t, e, n = [], i = {}) => { + const r = _({}), o = _(), a = y.debounce(Rt(), 180), s = ["disabled", "required"], l = (m, g) => { s.includes(m) && (r.current[m] = g), a(); - }, c = z(() => ({ setDisabled: (m) => l("disabled", m), setRequired: (m) => l("required", m), getDisabled: () => r.current.disabled, getRequired: () => r.current.required }), [e]), [u, p] = ni(e, -1, {}, c, i); + }, c = z(() => ({ setDisabled: (m) => l("disabled", m), setRequired: (m) => l("required", m), getDisabled: () => r.current.disabled, getRequired: () => r.current.required }), [e]), [u, p] = ii(e, -1, {}, c, i); if (!p && o.current != u && (u >= 0 || !y.isEmpty(n == null ? void 0 : n[u]))) { o.current = u; const { widget: m, widgetPrefix: g, props: w } = n == null ? void 0 : n[u]; t = _n(m, g), r.current = y.merge(w, y.pick(r.current, s)); } return [t, r.current]; -}, Fn = (t) => t === void 0 || t === !1 ? "" : (Array.isArray(t) ? t : [t]).join("_"), Yo = ({ value: t, onChange: e }, n = null) => { - const i = J(), [r] = ae.useForm(n), o = J({}); +}, jn = (t) => t === void 0 || t === !1 ? "" : (Array.isArray(t) ? t : [t]).join("_"), Xo = ({ value: t, onChange: e }, n = null) => { + const i = _(), [r] = ae.useForm(n), o = _({}); return Ft(() => { y.isEqual(i.current, t) || r.setFieldsValue(t); }, [t]), U(() => () => r.resetFields(), []), [z(() => r.__INTERNAL__ ? r : { ...r, __INTERNAL__: { itemRef: (a) => (s) => { - const l = Fn(a); + const l = jn(a); s ? o.current[l] = s : delete o.current[l]; } }, scrollToField: (a, s = {}) => { console.warn("useMergedFormValuesChange scrollToField not work, unreferenced antd form"); }, focusField: (a) => { console.warn("useMergedFormValuesChange focusField not work, unreferenced antd form"); }, getFieldInstance: (a) => { - const s = Fn(a); + const s = jn(a); return o.current[s]; } }, [r]), (a, s) => { i.current = s, e == null || e(s); }]; -}, sn = ({ widget: t = "Input", widgetPrefix: e = "@pkg/ff/grid-layout-forms", widgetDecorator: n, subWidgets: i = [], basicForm: r, ...o }) => { - const a = _n(t, e), [s, l] = qr(a, n, i, r), [c, u] = L(); +}, ln = ({ widget: t = "Input", widgetPrefix: e = "@pkg/ff/grid-layout-forms", widgetDecorator: n, subWidgets: i = [], basicForm: r, ...o }) => { + const a = _n(t, e), [s, l] = Kr(a, n, i, r), [c, u] = L(); return U(() => { - s && se.getWidgetComponent(s).then(({ defaultProps: p = {}, default: m }) => ({ default: Kr(m, p, r) })).catch((p) => ({ default: () => `${p}` })).then((p) => u(x.createElement(p.default, o))); + s && se.getWidgetComponent(s).then(({ defaultProps: p = {}, default: m }) => ({ default: Hr(m, p, r) })).catch((p) => ({ default: () => `${p}` })).then((p) => u(x.createElement(p.default, o))); }, [s]), c && x.cloneElement(c, { ...o, ...l }); -}, Kr = (t, e = {}, n = null) => (i) => { - const { type: r, code: o, label: a, noStyle: s, style: l, placeholder: c, required: u = !1, extras: p, validators: m, help: g, isVirtual: w, $isReserved: f, initialValue: S, initialValueLanguage: b, ...E } = y.omit(y.merge({}, e, i), ["convertJs", "convertJsSetting", "widget", "widgetPerfix", "widgetDecorator", "subWidgets", "boxStyle"]), k = Wr(Object.assign({}, m, u ? { required: !0 } : {}), o, r), $ = z(() => { +}, Hr = (t, e = {}, n = null) => (i) => { + const { type: r, code: o, label: a, noStyle: s, style: l, placeholder: c, required: u = !1, extras: p, validators: m, help: g, isVirtual: w, $isReserved: f, initialValue: S, initialValueLanguage: b, ...E } = y.omit(y.merge({}, e, i), ["convertJs", "convertJsSetting", "widget", "widgetPerfix", "widgetDecorator", "subWidgets", "boxStyle"]), k = Br(Object.assign({}, m, u ? { required: !0 } : {}), o, r), $ = z(() => { const V = Object.keys((e == null ? void 0 : e.extras) || {}); return y.over([y.partialRight(y.pick, V), y.partialRight(y.omit, V)]); }, [e == null ? void 0 : e.extras]), [F, A] = $(E), O = { label: a, noStyle: s, style: l, colon: !1, layout: "vertical" }, T = G((V) => V == null ? void 0 : pe(V, r), [r]); - return h(nn, { name: o, rules: k, initialValue: T(S), normalize: T, children: (V, v, M) => { + return h(rn, { name: o, rules: k, initialValue: T(S), normalize: T, children: (V, N, M) => { var D; - return h(t, { type: r, rcform: M, basicForm: n, itemProps: { validateStatus: v.errors.length > 0 ? "error" : "success", tooltip: g || null, help: v.errors.length > 0 ? v.errors.join("、") : null, required: ((D = k == null ? void 0 : k[0]) == null ? void 0 : D.required) || !1, ...O }, fieldProps: { placeholder: c, ...A, ...V }, $setting: Object.assign({}, p, F) }); + return h(t, { type: r, rcform: M, basicForm: n, itemProps: { validateStatus: N.errors.length > 0 ? "error" : "success", tooltip: g || null, help: N.errors.length > 0 ? N.errors.join("、") : null, required: ((D = k == null ? void 0 : k[0]) == null ? void 0 : D.required) || !1, ...O }, fieldProps: { placeholder: c, ...A, ...V }, $setting: Object.assign({}, p, F) }); } }); -}, ln = ({ name: t, form: e = null, basicForm: n = null, style: i = {}, className: r, cols: o = 24, rowHeight: a = 16, itemMargin: s = [8, 16], containerPadding: l = [0, 0], fields: c = [], hides: u = [], primaryKey: p = 0, formProps: m = {}, formFields: g = [], listenChangeFields: w, listenChangeFieldsFunc: f, onValuesChange: S, theme: b, themeProps: E = {}, groups: k = [{ key: "default", label: "默认" }], children: $, ...F }) => { - const [A] = ae.useForm(e), O = G((v, M) => { - S == null || S(v, M), f && Array.isArray(w) && Me.exec(f, { changedValues: v, allValues: M }, { getFieldValue: A.getFieldValue, setFieldValue: A.setFieldValue, setFieldsValue: A.setFieldsValue, isFieldTouched: A.isFieldTouched, isFieldsTouched: A.isFieldsTouched }).catch((D) => console.error("onFormValuesChange", t, D)); - }, [t, A, S, w, f]), T = z(() => [{ name: "__PROPS__", value: m }, { name: "__PRIMARY_KEY__", value: p }].concat(g), [p, m, g]), V = (v, M, D) => { - const B = on(M, sn, n), Q = Xn(F); +}, cn = ({ name: t, form: e = null, basicForm: n = null, style: i = {}, className: r, cols: o = 24, rowHeight: a = 16, itemMargin: s = [8, 16], containerPadding: l = [0, 0], fields: c = [], hides: u = [], primaryKey: p = 0, formProps: m = {}, formFields: g = [], listenChangeFields: w, listenChangeFieldsFunc: f, onValuesChange: S, theme: b, themeProps: E = {}, groups: k = [{ key: "default", label: "默认" }], children: $, ...F }) => { + const [A] = ae.useForm(e), O = G((N, M) => { + S == null || S(N, M), f && Array.isArray(w) && Me.exec(f, { changedValues: N, allValues: M }, { getFieldValue: A.getFieldValue, setFieldValue: A.setFieldValue, setFieldsValue: A.setFieldsValue, isFieldTouched: A.isFieldTouched, isFieldsTouched: A.isFieldsTouched }).catch((D) => console.error("onFormValuesChange", t, D)); + }, [t, A, S, w, f]), T = z(() => [{ name: "__PROPS__", value: m }, { name: "__PRIMARY_KEY__", value: p }].concat(g), [p, m, g]), V = (N, M, D) => { + const B = an(M, ln, n), Q = Qn(F); return I("div", { ...Q, className: j("ff-grid-layout-form", r), style: { ...i, "--grid-layout-item-margin-x": `${(s == null ? void 0 : s[0]) ?? 8}px`, "--grid-layout-item-margin-y": `${(s == null ? void 0 : s[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": `${a}px` }, children: [B, D && x.cloneElement(D, { cols: o, rowHeight: a, itemMargin: s, containerPadding: l, fields: M, basicForm: n })] }); }; - return I(ae, { ...F, form: A, fields: T, onValuesChange: O, children: [b ? h(ii, { ...E, items: k, theme: b, itemRender: V, fields: c, children: $, basicForm: n }) : V(0, c, $), u == null ? void 0 : u.map((v) => { + return I(ae, { ...F, form: A, fields: T, onValuesChange: O, children: [b ? h(ri, { ...E, items: k, theme: b, itemRender: V, fields: c, children: $, basicForm: n }) : V(0, c, $), u == null ? void 0 : u.map((N) => { var M; - return h(nn, { name: v.code, children: h(Hr, { form: A, basicForm: n, name: v.code, type: v.type, initialValue: v.initialValue, initialValueLanguage: (M = v.extras) == null ? void 0 : M.initialValueLanguage }) }, JSON.stringify(v.code)); + return h(rn, { name: N.code, children: h(Jr, { form: A, basicForm: n, name: N.code, type: N.type, initialValue: N.initialValue, initialValueLanguage: (M = N.extras) == null ? void 0 : M.initialValueLanguage }) }, JSON.stringify(N.code)); })] }); -}, Hr = ({ type: t, initialValue: e, initialValueLanguage: n, onChange: i, basicForm: r }) => { - const [o, a] = ni(n == "javascript" && e, n == "javascript" ? void 0 : e, {}, {}, r); +}, Jr = ({ type: t, initialValue: e, initialValueLanguage: n, onChange: i, basicForm: r }) => { + const [o, a] = ii(n == "javascript" && e, n == "javascript" ? void 0 : e, {}, {}, r); return U(() => { n == "javascript" ? i(pe(o, t)) : e && i(pe(e, t)); }, [t, e, o]), null; }; -ln.propTypes = { fields: C.array, hides: C.array }; +cn.propTypes = { fields: C.array, hides: C.array }; const _r = /* @__PURE__ */ ((t) => ({ code: e, isPreview: n = !1, ...i }) => { - const { align: r, autoComplete: o, resource: a, items: s, hides: l, rowHeight: c, marginX: u, marginY: p, cols: m, listenChangeFields: g, listenChangeFieldsFunc: w, pk: f, uuid: S, theme: b, themeProps: E, groups: k } = Dr(e), $ = z(() => [{ name: "__PK__", value: f }, { name: "__RESOURCE__", value: a }, { name: "__LAYOUT_KEY__", value: e }, { name: "__LAYOUT_UUID__", value: S }], [f, e, S, a]); + const { align: r, autoComplete: o, resource: a, items: s, hides: l, rowHeight: c, marginX: u, marginY: p, cols: m, listenChangeFields: g, listenChangeFieldsFunc: w, pk: f, uuid: S, theme: b, themeProps: E, groups: k } = Wr(e), $ = z(() => [{ name: "__PK__", value: f }, { name: "__RESOURCE__", value: a }, { name: "__LAYOUT_KEY__", value: e }, { name: "__LAYOUT_UUID__", value: S }], [f, e, S, a]); return h(t, { name: e, autoComplete: o, theme: b, themeProps: E, groups: k, ...i, formFields: $, listenChangeFields: g, listenChangeFieldsFunc: w, fields: s, hides: l, cols: m, rowHeight: c, itemMargin: [u, p] }); -})(ln), ui = ({ $setting: t, $close: e, extras: n, code: i, primaryKey: r, ...o }) => { - const [a] = ae.useForm(), s = Ur(a, i, r, t); - return h(ne, { actions: I(x.Fragment, { children: [h(R, { name: (t == null ? void 0 : t.okText) || "保存", type: "primary", widget: () => s({ onSuccess: e }) }), h(R, { name: (t == null ? void 0 : t.cancelText) || "取消", widget: () => e(!1) })] }), extras: n, children: h(_r, { form: a, code: i, primaryKey: r, ...o }) }); -}, jn = /* @__PURE__ */ new Set(), Xt = (t = [], e = 0) => { +})(cn), pi = ({ $setting: t, $close: e, extras: n, code: i, primaryKey: r, ...o }) => { + const [a] = ae.useForm(), s = qr(a, i, r, t); + return h(ie, { actions: I(x.Fragment, { children: [h(R, { name: (t == null ? void 0 : t.okText) || "保存", type: "primary", widget: () => s({ onSuccess: e }) }), h(R, { name: (t == null ? void 0 : t.cancelText) || "取消", widget: () => e(!1) })] }), extras: n, children: h(_r, { form: a, code: i, primaryKey: r, ...o }) }); +}, An = /* @__PURE__ */ new Set(), Qt = (t = [], e = 0) => { const n = t[e]; - if (n.length && !jn.has(n)) { + if (n.length && !An.has(n)) { const i = document.createElement("script"); i.setAttribute("src", n), i.setAttribute("data-namespace", n), t.length > e + 1 && (i.onload = () => { - Xt(t, e + 1); + Qt(t, e + 1); }, i.onerror = () => { - Xt(t, e + 1); - }), jn.add(n), document.body.appendChild(i); + Qt(t, e + 1); + }), An.add(n), document.body.appendChild(i); } }, Et = ({ className: t, type: e, style: n = {}, ...i }) => h("span", { role: "img", className: j("ff-iconfont", t), style: n, ...i, children: h("svg", { style: { width: "1em", height: "1em", fill: "currentColor", overflow: "hidden" }, viewBox: "0 0 1024 1024", children: h("use", { xlinkHref: `#${e}` }) }) }); -Et.propTypes = { className: C.string, type: C.string.isRequired, style: C.object }, Et.init = Xt; -const Jr = (t, e, n, i) => oe.redirect(n, e, i), Gr = (t, e = {}, n, i = {}) => { +Et.propTypes = { className: C.string, type: C.string.isRequired, style: C.object }, Et.init = Qt; +const Gr = (t, e, n, i) => oe.redirect(n, e, i), Yr = (t, e = {}, n, i = {}) => { var o; const r = (o = i.router) == null ? void 0 : o.reduce((a, [s, l, c]) => { const u = y.get(e, ["router", s]); @@ -916,120 +916,120 @@ const Jr = (t, e, n, i) => oe.redirect(n, e, i), Gr = (t, e = {}, n, i = {}) => return `${a}/${u}`; }, `/api/${n}`); return W.del(r, e.param).msg(); -}, An = (t, e, n, { status: { loading: i, disabled: r }, setStatus: o, listFn: a }) => { +}, In = (t, e, n, { status: { loading: i, disabled: r }, setStatus: o, listFn: a }) => { const s = { loading: (l) => l === void 0 ? i : o((c) => ({ ...c, loading: l })), disabled: (l) => l === void 0 ? r : o((c) => ({ ...c, disabled: l })), list: a }; return y.isFunction(n) ? n.call(null, e, s) : y.isString(n) && n ? Me.exec(n, e, s) : null; -}, In = (t, e, n, i, r) => y.isString(n) && n ? se.getWidgetComponent(n).then(({ default: o }) => re.modal(o, { ...e, $setting: i }, r != null && r.title ? { ...r, title: y.template(r.title)(t) } : r)).catch((o) => { - re.error(n, { content: o.toString() }); -}) : re.modal(n, { ...e, $setting: i }, r != null && r.title ? { ...r, title: y.template(r.title)(t) } : r), Yr = (t, e, n, i, r) => re.modal(ui, { ...e, $setting: i, code: n }, r != null && r.title ? { ...r, title: y.template(r.title)(t) } : r), Xr = (t, e, n, i, r) => re.modal(an, { ...i, base62params: e, listCode: n }, r != null && r.title ? { ...r, title: y.template(r.title)(t) } : r), Qr = ({ widget: t, widgetType: e, widgetData: n, widgetProps: i, widgetSetting: r, widgetContainerProps: o }, { onAfterClick: a, onBeforeClick: s } = {}) => { - const l = ge(le), [c, u] = L({ leading: !0, trailing: !1 }), p = J(null), [m, g] = z(() => { +}, Ln = (t, e, n, i, r) => y.isString(n) && n ? se.getWidgetComponent(n).then(({ default: o }) => ne.modal(o, { ...e, $setting: i }, r != null && r.title ? { ...r, title: y.template(r.title)(t) } : r)).catch((o) => { + ne.error(n, { content: o.toString() }); +}) : ne.modal(n, { ...e, $setting: i }, r != null && r.title ? { ...r, title: y.template(r.title)(t) } : r), Xr = (t, e, n, i, r) => ne.modal(pi, { ...e, $setting: i, code: n }, r != null && r.title ? { ...r, title: y.template(r.title)(t) } : r), Qr = (t, e, n, i, r) => ne.modal(sn, { ...i, base62params: e, listCode: n }, r != null && r.title ? { ...r, title: y.template(r.title)(t) } : r), Zr = ({ widget: t, widgetType: e, widgetData: n, widgetProps: i, widgetSetting: r, widgetContainerProps: o }, { onAfterClick: a, onBeforeClick: s } = {}) => { + const l = ge(le), [c, u] = L({ leading: !0, trailing: !1 }), p = _(null), [m, g] = z(() => { switch (e) { case "redirect": - return [y.partialRight(Jr, t, r), null]; + return [y.partialRight(Gr, t, r), null]; case "func": - return [y.partialRight(An, (r == null ? void 0 : r.code) ?? t, { status: c, setStatus: u, listFn: l }), null]; + return [y.partialRight(In, (r == null ? void 0 : r.code) ?? t, { status: c, setStatus: u, listFn: l }), null]; case "component": case "fsdpf-component": - return [y.partialRight(In, t, r, o), (f) => ({ $setting: f })]; + return [y.partialRight(Ln, t, r, o), (f) => ({ $setting: f })]; case "grid-layout-form": - return [y.partialRight(Yr, t, r, o), (f) => ({ $setting: f })]; + return [y.partialRight(Xr, t, r, o), (f) => ({ $setting: f })]; case "data-list": - return [y.partialRight(Xr, t, r, o), (f) => f]; + return [y.partialRight(Qr, t, r, o), (f) => f]; case "destroy": - return [y.partialRight(Gr, t, r, o), null]; + return [y.partialRight(Yr, t, r, o), null]; default: - if (dn(t) || x.isValidElement(t)) return [y.partialRight(In, t, r, o), (f) => ({ $setting: f })]; - if (y.isFunction(t)) return [y.partialRight(An, (r == null ? void 0 : r.code) || t, { status: c, setStatus: u }), null]; + if (un(t) || x.isValidElement(t)) return [y.partialRight(Ln, t, r, o), (f) => ({ $setting: f })]; + if (y.isFunction(t)) return [y.partialRight(In, (r == null ? void 0 : r.code) || t, { status: c, setStatus: u }), null]; } return [(...f) => console.error("useButton unknown widgetType", e, ...f), null]; }, [t, e, r, o, l.getBase62params, l.getSelectedRows]), w = y.debounce((f) => (s == null || s(f), Promise.resolve(Ot(i, f, { list: l })).then((S) => { const b = m(f, { ...n, ...S }); return b != null && b.update && g && (p.current = (E, k) => b.update(g(E), k)), b; }).then((S) => a == null ? void 0 : a(S)).catch(console.error)), 300, { leading: !0, trailing: !1 }); - return tn(() => { + return nn(() => { var f; (f = p.current) == null || f.call(p, r, o); }, [r, o]), [w, c]; -}, pi = ({ type: t, name: e, className: n, icon: i, iconPosition: r, size: o }, a = "default") => z(() => { +}, gi = ({ type: t, name: e, className: n, icon: i, iconPosition: r, size: o }, a = "default") => z(() => { const s = { type: "primary", className: j("ff-button", n), iconPosition: r, size: o }; return t === "danger" ? s.danger = !0 : t === "default" && (s.type = t), a === "link" || a === "dashed" ? (s.type = a, t === "default" && (s.className = j(s.className, "ff-default"))) : a !== "circle" && a !== "round" || (s.shape = a), i && (s.icon = h(Et, { type: i })), e && (s.children = e), s; }, [a, t, n, i, r]), jt = ({ data: t, widget: e, widgetType: n = "fsdpf-component", widgetData: i, widgetProps: r, widgetSetting: o, widgetContainerProps: a, onAfterClick: s, onBeforeClick: l, children: c, extras: u }) => { - const p = ge(le), [m, g] = L(!1), [w, f] = L("hover"), [S, b] = di(r, t, { list: p }, [p.getBase62params, p.getSelectedRows]), [E, k] = L(), { placement: $, align: F, zIndex: A, arrow: O = { pointAtCenter: !0 }, getPopupContainer: T, isPopupMountBodyContainer: V = !0, ...v } = a || {}; + const p = ge(le), [m, g] = L(!1), [w, f] = L("hover"), [S, b] = ui(r, t, { list: p }, [p.getBase62params, p.getSelectedRows]), [E, k] = L(), { placement: $, align: F, zIndex: A, arrow: O = { pointAtCenter: !0 }, getPopupContainer: T, isPopupMountBodyContainer: V = !0, ...N } = a || {}; U(() => { - n == "grid-layout-form" ? k(x.createElement(ui, { ...i, $setting: o, code: e })) : n == "data-list" ? k(x.createElement(an, { base62params: t, $setting: o, listCode: e })) : y.isString(e) ? se.getWidgetComponent(e).then(({ default: B }) => { + n == "grid-layout-form" ? k(x.createElement(pi, { ...i, $setting: o, code: e })) : n == "data-list" ? k(x.createElement(sn, { base62params: t, $setting: o, listCode: e })) : y.isString(e) ? se.getWidgetComponent(e).then(({ default: B }) => { k(x.createElement(B, { ...i, $setting: o })); - }).catch((B) => k(B.toString())) : x.isValidElement(e) ? k(x.cloneElement(e, { ...i, $setting: o })) : (dn(e) || y.isFunction(e) && ["component", "fsdpf-component"].includes(n)) && k(x.createElement(e, { ...i, $setting: o })); + }).catch((B) => k(B.toString())) : x.isValidElement(e) ? k(x.cloneElement(e, { ...i, $setting: o })) : (un(e) || y.isFunction(e) && ["component", "fsdpf-component"].includes(n)) && k(x.createElement(e, { ...i, $setting: o })); }, [e, n, i]); const M = (B, Q = !1) => (g(B), !B && f("hover"), B ? l == null ? void 0 : l(S) : s == null ? void 0 : s(Q)), D = (B) => { g(!0), f("click"); }; - return h(Ji, { zIndex: A, placement: $, onPopupClick: D, onClick: D, open: m, align: F, arrow: O, trigger: w, getPopupContainer: T || V ? void 0 : (B) => B, content: h(Zr, { ...v, extras: u, children: E && x.cloneElement(E, { ...S, $setProps: b, $close: (B) => M(!1, B) }) }), children: c, onOpenChange: M }); -}, Zr = ({ title: t, className: e, classNames: n, children: i, extras: r, width: o, height: a, ...s }) => { + return h(Gi, { zIndex: A, placement: $, onPopupClick: D, onClick: D, open: m, align: F, arrow: O, trigger: w, getPopupContainer: T || V ? void 0 : (B) => B, content: h(eo, { ...N, extras: u, children: E && x.cloneElement(E, { ...S, $setProps: b, $close: (B) => M(!1, B) }) }), children: c, onOpenChange: M }); +}, eo = ({ title: t, className: e, classNames: n, children: i, extras: r, width: o, height: a, ...s }) => { const [l, c] = L({}), u = G((w, f) => c((S) => ({ ...S, [w]: f })), []), p = G((w) => c((f) => ({ ...f, [w]: void 0 })), []), m = t ? x.createElement("div", { className: "ff-popup-title" }, t) : l == null ? void 0 : l.title, g = r ?? x.createElement("div", { className: "ff-popup-reserved-extras" }, r); return h(mt.Provider, { value: { ele: l, mount: u, unmount: p }, children: I("div", { className: j("ff-popup ff-popover", e, l.rootClassName), style: { width: o ?? 260, height: a }, ...s, children: [I("div", { className: j("ff-popup-header", "ff-popover-header", n == null ? void 0 : n.header), children: [m, l == null ? void 0 : l["sub-title"]] }), h("div", { className: j("ff-popup-body", "ff-popover-body", n == null ? void 0 : n.body), children: i }), I("div", { className: j("ff-popup-footer", "ff-popover-footer", n == null ? void 0 : n.footer), children: [g, l == null ? void 0 : l.extras, l == null ? void 0 : l.actions] })] }) }); }; jt.propTypes = { widgetType: C.oneOf(["fsdpf-component", "grid-layout-form", "data-list"]) }; const yt = (t) => function({ className: e, variant: n, children: i, name: r, icon: o, type: a = "default", iconPosition: s = "start", noAuthType: l, onAfterClick: c, onBeforeClick: u, data: p, loading: m, disabled: g, tooltip: w, confirm: f, widget: S = () => { }, widgetType: b, widgetData: E, widgetProps: k, widgetSetting: $, widgetContainerProps: F, ...A }) { - const { mode: O, ...T } = F || {}, V = pi({ className: e, name: r, type: a, icon: o, iconPosition: s }, n ?? t), v = h(St, { ...V, ...A, children: i || r }); - if (O === "popover" && !["destroy", "redirect", "func"].includes(b)) return h(jt, { data: p, widget: S, widgetType: b, widgetData: E, widgetProps: k, widgetSetting: $, widgetContainerProps: T, onAfterClick: c, onBeforeClick: u, children: v }); - const M = y.isEmpty(w) || !w.enabled ? {} : w, D = y.isEmpty(f) ? { enabled: !1 } : Object.assign({ enabled: !0 }, f), [B, Q] = L(!1), [Ee, { disabled: q, loading: ce }] = Qr({ widget: S, widgetType: b, widgetData: E, widgetProps: k, widgetSetting: $, widgetContainerProps: T }, { onAfterClick: c, onBeforeClick: u }); - return h(Gi, { okText: "确定", cancelText: "取消", getPopupContainer: (H) => H, ...D, disabled: q || g, open: B, onOpenChange: (H) => { + const { mode: O, ...T } = F || {}, V = gi({ className: e, name: r, type: a, icon: o, iconPosition: s }, n ?? t), N = h(St, { ...V, ...A, children: i || r }); + if (O === "popover" && !["destroy", "redirect", "func"].includes(b)) return h(jt, { data: p, widget: S, widgetType: b, widgetData: E, widgetProps: k, widgetSetting: $, widgetContainerProps: T, onAfterClick: c, onBeforeClick: u, children: N }); + const M = y.isEmpty(w) || !w.enabled ? {} : w, D = y.isEmpty(f) ? { enabled: !1 } : Object.assign({ enabled: !0 }, f), [B, Q] = L(!1), [Ee, { disabled: q, loading: ce }] = Zr({ widget: S, widgetType: b, widgetData: E, widgetProps: k, widgetSetting: $, widgetContainerProps: T }, { onAfterClick: c, onBeforeClick: u }); + return h(Yi, { okText: "确定", cancelText: "取消", getPopupContainer: (H) => H, ...D, disabled: q || g, open: B, onOpenChange: (H) => { if (!H) return Q(H); D.enabled ? Q(H) : Ee(p); }, onConfirm: (H) => { Ee(p, H); }, onClick: (H) => { H.stopPropagation(); - }, children: h(Yi, { getPopupContainer: (H) => H, ...M, title: B ? null : M == null ? void 0 : M.title, trigger: ["hover", "click"], children: x.cloneElement(v, { loading: ce || m, disabled: q || g }) }) }); + }, children: h(Xi, { getPopupContainer: (H) => H, ...M, title: B ? null : M == null ? void 0 : M.title, trigger: ["hover", "click"], children: x.cloneElement(N, { loading: ce || m, disabled: q || g }) }) }); }, R = yt("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 eo = yt("link"), to = yt("circle"), no = yt("round"), io = yt("dashed"), Ln = ({ options: t = [], triggerWeights: e = ["grid-layout-form", "grid-layout", "fsdpf-component", "print"], onAfterClick: n = (g, w, f) => { +const to = yt("link"), no = yt("circle"), io = yt("round"), ro = yt("dashed"), Mn = ({ options: t = [], triggerWeights: e = ["grid-layout-form", "grid-layout", "fsdpf-component", "print"], onAfterClick: n = (g, w, f) => { }, onBeforeClick: i = (g, w, f) => { -}, labelVariant: r = "link", labelSize: o, labelRender: a, btnVariant: s, btnSize: l, btnRender: c = (g, w) => h(R, { ...g, data: w }, g.uuid || Wt()), widgetContainerProps: u = {}, children: p, data: m }) => { +}, labelVariant: r = "link", labelSize: o, labelRender: a, btnVariant: s, btnSize: l, btnRender: c = (g, w) => h(R, { ...g, data: w }, g.uuid || Bt()), widgetContainerProps: u = {}, children: p, data: m }) => { if (y.isEmpty(t)) return p; l ?? (l = o), s ?? (s = r); const [g, w] = z(() => (t || []).reduce((b, E) => { const k = e.indexOf(E.widgetType); return k === -1 ? b[1].push(E) : b[0] ? k < e.indexOf(b[0].widgetType) ? (b[1].push(b[0]), b[0] = E) : b[1].push(E) : b[0] = E, b; }, [null, []]), [t, e]); - a ? p = a(g, m) || p : p || (p = h(St, { ...pi(Object.assign(g != null && g.name || g != null && g.icon ? {} : { icon: "icon-location" }, g, { size: o }), r) })); + a ? p = a(g, m) || p : p || (p = h(St, { ...gi(Object.assign(g != null && g.name || g != null && g.icon ? {} : { icon: "icon-location" }, g, { size: o }), r) })); const f = w.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: y.partialRight(n, b, m), onBeforeClick: y.partialRight(i, b, m) }, { size: l, variant: s }), m)); let S = f; - return (f == null ? void 0 : f.length) > 1 && (S = s == "link" ? h(zt, { split: h(Xi, { type: "vertical" }), size: l, children: f }) : h(zt.Compact, { size: l, children: f })), g ? h(jt, { 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: S, onAfterClick: y.partialRight(n, g, m), onBeforeClick: y.partialRight(i, g, m), children: p }) : S; + return (f == null ? void 0 : f.length) > 1 && (S = s == "link" ? h(Ut, { split: h(Qi, { type: "vertical" }), size: l, children: f }) : h(Ut.Compact, { size: l, children: f })), g ? h(jt, { 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: S, onAfterClick: y.partialRight(n, g, m), onBeforeClick: y.partialRight(i, g, m), children: p }) : S; }; -Ln.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 = eo, R.Link.defaultProps = R.defaultProps, R.Link.propTypes = R.propTypes, R.Circle = to, R.Circle.defaultProps = R.defaultProps, R.Circle.propTypes = R.propTypes, R.Round = no, R.Round.defaultProps = R.defaultProps, R.Round.propTypes = R.propTypes, R.Dashed = io, R.Dashed.defaultProps = R.defaultProps, R.Dashed.propTypes = R.propTypes, R.Popover = jt, R.GroupPopover = Ln; -const ro = ({ fields: t, formProps: e, $close: n }) => { +Mn.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 = to, R.Link.defaultProps = R.defaultProps, R.Link.propTypes = R.propTypes, R.Circle = no, R.Circle.defaultProps = R.defaultProps, R.Circle.propTypes = R.propTypes, R.Round = io, R.Round.defaultProps = R.defaultProps, R.Round.propTypes = R.propTypes, R.Dashed = ro, R.Dashed.defaultProps = R.defaultProps, R.Dashed.propTypes = R.propTypes, R.Popover = jt, R.GroupPopover = Mn; +const oo = ({ fields: t, formProps: e, $close: n }) => { const [i] = ae.useForm(), r = z(() => [{ name: "__PROPS__", value: e }], [e]); - return h(ne, { actions: I(x.Fragment, { children: [h(R, { name: "取消", widget: () => n(!1) }), h(R, { name: "确定", type: "primary", widget: () => i.validateFields(!0).then(n) })] }), children: h(ae, { fields: r, form: i, className: "ff-modal-form", children: t == null ? void 0 : t.map(({ code: o, ...a }) => h(sn, { code: o, ...a }, o)) }) }); -}, oo = ({ className: t, classNames: e, $close: n, children: i, title: r, subTitle: o, actions: a, extras: s, ...l }) => I(rr, { ...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: [h("button", { "aria-label": "Close", className: j("ff-popup-close", "ff-drawer-close", e == null ? void 0 : e.close), onClick: l.onClose, children: h(rn, { type: "close" }) }), r, o] }), h("div", { className: j("ff-popup-body", "ff-drawer-body", e == null ? void 0 : e.body), children: i }), I("div", { className: j("ff-popup-footer", "ff-drawer-footer", e == null ? void 0 : e.footer), children: [s, a] })] }), ao = ({ className: t, classNames: e, $close: n, $event: i, children: r, title: o, subTitle: a, actions: s, extras: l, placement: c, ...u }) => { + return h(ie, { actions: I(x.Fragment, { children: [h(R, { name: "取消", widget: () => n(!1) }), h(R, { name: "确定", type: "primary", widget: () => i.validateFields(!0).then(n) })] }), children: h(ae, { fields: r, form: i, className: "ff-modal-form", children: t == null ? void 0 : t.map(({ code: o, ...a }) => h(ln, { code: o, ...a }, o)) }) }); +}, ao = ({ className: t, classNames: e, $close: n, children: i, title: r, subTitle: o, actions: a, extras: s, ...l }) => I(or, { ...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: [h("button", { "aria-label": "Close", className: j("ff-popup-close", "ff-drawer-close", e == null ? void 0 : e.close), onClick: l.onClose, children: h(on, { type: "close" }) }), r, o] }), h("div", { className: j("ff-popup-body", "ff-drawer-body", e == null ? void 0 : e.body), children: i }), I("div", { className: j("ff-popup-footer", "ff-drawer-footer", e == null ? void 0 : e.footer), children: [s, a] })] }), so = ({ className: t, classNames: e, $close: n, $event: i, children: r, title: o, subTitle: a, actions: s, extras: l, placement: c, ...u }) => { const { style: p, rest: m } = ((w, f = ["height", "width", "style"]) => { const S = { ...w }, b = {}; for (const E of f) E === "style" ? Object.assign(b, S.style) : S[E] !== void 0 && (b[E] = S[E]), delete S[E]; return { style: b, rest: S }; })(u), g = (i == null ? void 0 : i.pageX) === void 0 ? { animation: null, maskAnimation: null, mousePosition: { x: null, y: null } } : { animation: "zoom", maskAnimation: "fade", mousePosition: { x: i == null ? void 0 : i.pageX, y: i == null ? void 0 : i.pageY } }; - return h(or, { ...m, ...g, prefixCls: "ff-modal", className: j("ff-popup", t), modalRender: () => I(x.Fragment, { children: [h("button", { className: j("ff-popup-close", "ff-modal-close", e == null ? void 0 : e.close), onClick: m.onClose, children: h(rn, { 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, a] }), h("div", { className: j("ff-popup-body", "ff-modal-body", e == null ? void 0 : e.body), children: r }), I("div", { className: j("ff-popup-footer", "ff-modal-footer", e == null ? void 0 : e.footer), children: [l, s] })] })] }) }); -}, gi = ({ placement: t, $close: e, $event: n, children: i, title: r, ...o }) => { + return h(ar, { ...m, ...g, prefixCls: "ff-modal", className: j("ff-popup", t), modalRender: () => I(x.Fragment, { children: [h("button", { className: j("ff-popup-close", "ff-modal-close", e == null ? void 0 : e.close), onClick: m.onClose, children: h(on, { 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, a] }), h("div", { className: j("ff-popup-body", "ff-modal-body", e == null ? void 0 : e.body), children: r }), I("div", { className: j("ff-popup-footer", "ff-modal-footer", e == null ? void 0 : e.footer), children: [l, s] })] })] }) }); +}, hi = ({ placement: t, $close: e, $event: n, children: i, title: r, ...o }) => { const [a, s] = L({}), [l, c] = L(!0), u = G((w, f) => s((S) => ({ ...S, [w]: f })), []), p = G((w) => s((f) => ({ ...f, [w]: void 0 })), []); let m = { ...o, className: a.rootClassName, title: a.title || r && x.createElement("div", { className: j("ff-popup-title") }, r), subTitle: a["sub-title"], actions: a.actions, extras: a.extras, children: i, $close: e, $event: n, onClose: () => c(!1) }; const g = () => { e(!1); }; - return h(mt.Provider, { value: { ele: a, mount: u, unmount: p }, children: t && t !== "center" ? h(oo, { ...m, placement: t, open: l, afterOpenChange: (w) => !w && g() }) : h(ao, { ...m, visible: l, afterClose: g }) }); + return h(mt.Provider, { value: { ele: a, mount: u, unmount: p }, children: t && t !== "center" ? h(ao, { ...m, placement: t, open: l, afterOpenChange: (w) => !w && g() }) : h(so, { ...m, visible: l, afterClose: g }) }); }; -gi.propTypes = { placement: C.oneOf(["center", "left", "top", "right", "bottom"]) }; -const so = ({ widget: t, widgetProps: e, $close: n, onSetProps: i }) => { - const [r, o] = L(e || {}), a = Dn(e); - en(() => { +hi.propTypes = { placement: C.oneOf(["center", "left", "top", "right", "bottom"]) }; +const lo = ({ widget: t, widgetProps: e, $close: n, onSetProps: i }) => { + const [r, o] = L(e || {}), a = Wn(e); + tn(() => { const l = a ?? {}, 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 s = G((l) => { o((c) => ({ ...c, ...l })), i == null || i(l); }, [i]); - return x.isValidElement(t) ? x.cloneElement(t, { ...r, $close: n, $setProps: s }) : t != null && t.name || Pn.isForwardRef(t) || (t == null ? void 0 : t.$$typeof) === Pn.ForwardRef ? x.createElement(t, { ...r, $close: n, $setProps: s }) : t; + return x.isValidElement(t) ? x.cloneElement(t, { ...r, $close: n, $setProps: s }) : t != null && t.name || vn.isForwardRef(t) || (t == null ? void 0 : t.$$typeof) === vn.ForwardRef ? x.createElement(t, { ...r, $close: n, $setProps: s }) : t; }, X = () => { - const [t, e] = Di({ maxCount: 6, motion: { motionName: "ff-notification-fade", motionAppear: !0, motionEnter: !0, motionLeave: !0, onLeaveStart: (o) => { + const [t, e] = Wi({ maxCount: 6, motion: { motionName: "ff-notification-fade", motionAppear: !0, motionEnter: !0, motionLeave: !0, onLeaveStart: (o) => { const { offsetHeight: a } = o; return { height: a }; }, onLeaveActive: () => ({ height: 0, opacity: 0, margin: 0 }) }, prefixCls: "ff-notification" }), [, n] = x.useReducer((o) => o + 1, 0); @@ -1046,7 +1046,7 @@ const so = ({ widget: t, widgetProps: e, $close: n, onSetProps: i }) => { return c.update = l, c; }, r = ([o, a], s, l = {}, c = {}) => { const u = X.$index++; - if (s === Kn) return t.open({ ...c, key: u, content: x.createElement(s, { ...l, $close: () => t.close(u) }) }), () => { + if (s === Hn) return t.open({ ...c, key: u, content: x.createElement(s, { ...l, $close: () => t.close(u) }) }), () => { }; const { $setProps: p, ...m } = l; return X.$popups.set(u, { widget: s, widgetProps: m, widgetContainerProps: c, $close: (g) => ((w, f) => (X.$popups.delete(w), n(), f == null ? void 0 : f()))(u, () => o(g)), onSetProps: p }), n(), (g, w) => { @@ -1054,7 +1054,7 @@ const so = ({ widget: t, widgetProps: e, $close: n, onSetProps: i }) => { f && (X.$popups.set(u, { ...f, widgetProps: g ? { ...f.widgetProps, ...g } : f.widgetProps, widgetContainerProps: w ? { ...f.widgetContainerProps, ...w } : f.widgetContainerProps }), n()); }; }; - return I(x.Fragment, { children: [Array.from(X.$popups).map(([o, { widget: a, widgetProps: s, widgetContainerProps: l, $close: c, onSetProps: u }]) => h(gi, { maskClosable: !1, $event: s == null ? void 0 : s.$event, ...l, $close: c, children: h(so, { widget: a, widgetProps: s, $close: c, onSetProps: u }) }, o)), e] }); + return I(x.Fragment, { children: [Array.from(X.$popups).map(([o, { widget: a, widgetProps: s, widgetContainerProps: l, $close: c, onSetProps: u }]) => h(hi, { maskClosable: !1, $event: s == null ? void 0 : s.$event, ...l, $close: c, children: h(lo, { widget: a, widgetProps: s, $close: c, onSetProps: u }) }, o)), e] }); }; X.$popups = /* @__PURE__ */ new Map(), X.$index = 0, X.$queue = [], X.$onClick = (...t) => { const e = new Promise((n, i) => { @@ -1064,24 +1064,24 @@ X.$popups = /* @__PURE__ */ new Map(), X.$index = 0, X.$queue = [], X.$onClick = }); return e; }; -const Mn = (t, e, n = {}) => X.$onClick(t, e, n), Vt = (t, { showProgress: e, duration: n, ...i } = { duration: 1.5 }) => X.$onClick(Kn, { content: t, ...i }, { showProgress: e, duration: n }), re = { modal: Mn, confirm: (t, e = {}) => X.$onClick(ar, { content: t, ...e }, { placement: "center" }), form: (t, e = {}, n = {}) => Mn(ro, { formProps: n, fields: t }, { placement: "center", ...e }).then((i) => { +const Vn = (t, e, n = {}) => X.$onClick(t, e, n), Vt = (t, { showProgress: e, duration: n, ...i } = { duration: 1.5 }) => X.$onClick(Hn, { content: t, ...i }, { showProgress: e, duration: n }), ne = { modal: Vn, confirm: (t, e = {}) => X.$onClick(sr, { content: t, ...e }, { placement: "center" }), form: (t, e = {}, n = {}) => Vn(oo, { formProps: n, fields: t }, { placement: "center", ...e }).then((i) => { if (i === !1) throw !1; return i; }), notification: Vt, success: (t, e = { duration: 1.5 }) => Vt(t, { ...e, className: "ff-notification-success", icon: "check" }), error: (t, e = { duration: 1.5 }) => Vt(t, { ...e, className: "ff-notification-error", icon: "close" }) }; tt.configure({ showSpinner: !1 }); -const hi = () => { +const mi = () => { const t = window.localStorage.getItem(kt); return Object.freeze({ Platform: "web", SaaS: window.localStorage.getItem("SaaS"), Authorization: t ? `Bearer ${t} ` : void 0 }); }; -De.interceptors.request.use((t) => (Object.assign(t.headers, hi()), tt.inc(), t), (t) => (tt.done(), Promise.reject({ code: -1, msg: t }))), De.interceptors.response.use(({ data: t, headers: e }) => (tt.done(), { ...t, res: e == null ? void 0 : e.res }), function(t) { +De.interceptors.request.use((t) => (Object.assign(t.headers, mi()), tt.inc(), t), (t) => (tt.done(), Promise.reject({ code: -1, msg: t }))), De.interceptors.response.use(({ data: t, headers: e }) => (tt.done(), { ...t, res: e == null ? void 0 : e.res }), function(t) { return tt.done(), Promise.reject(t.message); -}), window.addEventListener("unhandledrejection", Bt.onUnhandledRejection), Bt.onMsg = (t, e) => re[[0, 1].includes(t) ? "success" : "error"](e).then(() => t === 20300 && oe.redirect(qe.get("Common.WEBSITE_LOGIN_PAGE"))); +}), window.addEventListener("unhandledrejection", zt.onUnhandledRejection), zt.onMsg = (t, e) => ne[[0, 1].includes(t) ? "success" : "error"](e).then(() => t === 20300 && oe.redirect(qe.get("Common.WEBSITE_LOGIN_PAGE"))); var Xe, Ue, Qe; const ee = class ee { constructor() { - N(this, "appUrl", ""); + v(this, "appUrl", ""); P(this, Xe, null); - return d(ee, Ue) || (K(ee, Qe, new Bt()), K(ee, Ue, new Proxy(this, { get(e, n) { + return d(ee, Ue) || (K(ee, Qe, new zt()), K(ee, Ue, new Proxy(this, { get(e, n) { if (n in e) { const i = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(e), n); return i != null && i.get ? Reflect.get(e, n, e) : typeof e[n] == "function" ? e[n].bind(e) : e[n]; @@ -1096,22 +1096,22 @@ const ee = class ee { return De; } get headers() { - return hi(); + return mi(); } mock(e = {}) { - return d(this, Xe) ?? K(this, Xe, new Bi(De, { onNoMatch: "passthrough", ...e })); + return d(this, Xe) ?? K(this, Xe, new zi(De, { onNoMatch: "passthrough", ...e })); } unmock() { var e; (e = d(this, Xe)) == null || e.restore(), K(this, Xe, null); } }; -Xe = new WeakMap(), Ue = new WeakMap(), Qe = new WeakMap(), P(ee, Ue), P(ee, Qe), N(ee, "getInstance", () => d(ee, Ue) ?? K(ee, Ue, new ee())); -let Qt = ee; -const W = Qt.getInstance(); -class cn extends Error { +Xe = new WeakMap(), Ue = new WeakMap(), Qe = new WeakMap(), P(ee, Ue), P(ee, Qe), v(ee, "getInstance", () => d(ee, Ue) ?? K(ee, Ue, new ee())); +let Zt = ee; +const W = Zt.getInstance(); +class dn extends Error { constructor(e, n) { - super(n), Error.captureStackTrace && Error.captureStackTrace(this, cn), !n instanceof nt && (this.name = `${e} Error Runtime`); + super(n), Error.captureStackTrace && Error.captureStackTrace(this, dn), !n instanceof nt && (this.name = `${e} Error Runtime`); } } class nt extends Error { @@ -1119,16 +1119,16 @@ class nt extends Error { super(...n), Error.captureStackTrace && Error.captureStackTrace(this, nt), this.name = `${e} Not Found`; } } -const Dt = "mine", kt = "token"; +const Dt = "mine", kt = "token", Wt = "user-login-intended-url"; var Le, Ze, ct; const be = class be { constructor() { P(this, Ze, /* @__PURE__ */ new Map()); P(this, ct, (/* @__PURE__ */ new Date()).toISOString().slice(0, 10)); - N(this, "setPkgVersion", (e) => { + v(this, "setPkgVersion", (e) => { K(this, ct, e); }); - N(this, "setVendor", (e, n) => d(this, Ze).set(e, new Un(n, async (i, r) => { + v(this, "setVendor", (e, n) => d(this, Ze).set(e, new qn(n, async (i, r) => { var a, s; if (!(i != null && i.default)) throw "@pkg not found"; let o = () => r; @@ -1139,7 +1139,7 @@ const be = class be { } throw new nt(r); }))); - N(this, "getWidgetComponent", async (e) => { + v(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 [, n] = e == null ? void 0 : e.split("@pkg/"); @@ -1147,15 +1147,15 @@ const be = class be { try { return d(this, Ze).has("pkg") ? await d(this, Ze).get("pkg").get(n) : await import(`${W.appUrl}/api/pkg-import/web?name=${e}&v=${d(this, ct)}`); } catch (i) { - throw new cn(e, i); + throw new dn(e, i); } }); - N(this, "getRoutes", () => W.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: n, ...i }) => [n, { uuid: n, ...i }])).then((e) => new Map(e))); - N(this, "getMenus", () => W.get("/api/my-menu")); - N(this, "getConfigure", () => W.get("api/init-configure")); - N(this, "getWidgetOperationAuth", () => W.get("/api/init-widget-operation-auth").then((e) => e.reduce((n, { uuid: i, auth: r }) => [...n, [i, r]], []))); - N(this, "getPhoneNumber", (e) => W.get(`/api/user-wx-phone-number/${e}`)); - N(this, "getUserToken", () => { + v(this, "getRoutes", () => W.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: n, ...i }) => [n, { uuid: n, ...i }])).then((e) => new Map(e))); + v(this, "getMenus", () => W.get("/api/my-menu")); + v(this, "getConfigure", () => W.get("api/init-configure")); + v(this, "getWidgetOperationAuth", () => W.get("/api/init-widget-operation-auth").then((e) => e.reduce((n, { uuid: i, auth: r }) => [...n, [i, r]], []))); + v(this, "getPhoneNumber", (e) => W.get(`/api/user-wx-phone-number/${e}`)); + v(this, "getUserToken", () => { const e = window.localStorage.getItem(kt); if (!e) return ""; const n = e.split("."); @@ -1164,42 +1164,47 @@ const be = class be { if (Math.floor((/* @__PURE__ */ new Date()).getTime() / 1e3) - i > 2592e3) throw "登录令牌已过期, 请重新登录!"; return e; }); - N(this, "checkUserToken", () => { + v(this, "checkUserToken", () => { try { return !!this.getUserToken(); } catch { return !1; } }); - N(this, "getUserInfo", (e = !0) => { + v(this, "getUserInfo", (e = !0) => { var n; try { const i = this.getUserToken(); if (!i) return Promise.resolve(null); const { iat: r } = JSON.parse(window.atob((n = i == null ? void 0 : i.split(".")) == null ? void 0 : n[1])), { iat: o, ...a } = W.decode(window.localStorage.getItem(Dt) || "", {}); - return o === r ? Promise.resolve(a) : W.get("/api/mine-info").then(({ User: s = null }) => (window.localStorage.setItem(Dt, W.encode({ ...s, iat: r })), s)); + return o === r ? Promise.resolve(a) : W.get("/api/mine-info").then(({ User: s = null }) => (window.localStorage.setItem(Dt, W.encode({ ...s, iat: r })), s)).catch((s) => (console.error(s), e && ne.error("请登录").then(this.logout), null)); } catch (i) { - console.error(i), e && re.error("请登录").then(this.logout); + console.error(i), e && ne.error("请登录").then(this.logout); } return Promise.resolve(null); }); - N(this, "login", (e, n, i = {}) => W.post("/api/user-token", { username: e, passwd: zi.hash(n), platform: "web", ...i }).then(({ token: r }) => (window.localStorage.setItem(kt, r), r)).then(async (r) => (await this.initAppEnv(), r))); - N(this, "logout", (e) => (window.localStorage.removeItem(Dt), window.localStorage.removeItem(kt), e == null ? void 0 : e())); - N(this, "initAppEnv", async () => { + v(this, "login", (e, n, i = {}) => W.post("/api/user-token", { username: e, passwd: Ui.hash(n), platform: "web", ...i }).then(({ token: r }) => (window.localStorage.setItem(kt, r), r)).then(async (r) => (await this.initAppEnv(), r))); + v(this, "setLoginIntendedUrl", (e) => sessionStorage.setItem(Wt, e)); + v(this, "getLoginIntendedUrl", (e = !1) => { + const n = sessionStorage.getItem(Wt); + return e && sessionStorage.removeItem(Wt), n; + }); + v(this, "logout", (e) => (window.localStorage.removeItem(Dt), window.localStorage.removeItem(kt), e == null ? void 0 : e())); + v(this, "initAppEnv", async () => { const [e, n, i, r] = await Promise.all([this.getWidgetOperationAuth(), this.getRoutes(), this.getMenus(), this.getConfigure()]); - return Hn.init(e), qe.init(r), oe.init(n, i), Et.init(qe.get("Common.ICONFONT")), { widgetOperationAuth: e, routes: n, menus: i, configures: r }; + return Jn.init(e), qe.init(r), oe.init(n, i), Et.init(qe.get("Common.ICONFONT")), { widgetOperationAuth: e, routes: n, menus: i, configures: r }; }); if (d(be, Le)) return d(be, Le); } }; -Le = new WeakMap(), Ze = new WeakMap(), ct = new WeakMap(), P(be, Le, null), N(be, "getInstance", () => (d(be, Le) || K(be, Le, new be()), d(be, Le))); -let Zt = be; -const se = Zt.getInstance(), lo = x.createContext({ user: {}, initUser: () => { -}, initUserComplete: !1 }), co = x.createContext({ set: () => { +Le = new WeakMap(), Ze = new WeakMap(), ct = new WeakMap(), P(be, Le, null), v(be, "getInstance", () => (d(be, Le) || K(be, Le, new be()), d(be, Le))); +let en = be; +const se = en.getInstance(), co = x.createContext({ user: {}, initUser: () => { +}, initUserComplete: !1 }), uo = x.createContext({ set: () => { }, get: () => { }, assign: () => { }, currentRoute: () => { -} }), dn = (t) => { +} }), un = (t) => { if (!t) return !1; if (t.prototype instanceof x.Component || t.$$typeof) return !0; if (typeof t == "function") { @@ -1207,13 +1212,13 @@ const se = Zt.getInstance(), lo = x.createContext({ user: {}, initUser: () => { return !e || /^[A-Z]/.test(e); } return !1; -}, uo = (t, e) => { +}, po = (t, e) => { if (!t || typeof window > "u") return; let n = document.querySelector(`style[ff-style-token="${e}"]`); return n ? (n.innerHTML = t, t) : (n = document.createElement("style"), n.setAttribute("ff-style-token", e), n.setAttribute("type", "text/css"), n.innerHTML = t, document.head.appendChild(n), t); -}, po = Object.freeze(Object.defineProperty({ __proto__: null, AppContext: lo, AppGlobalParamsContext: co, cache: Un, configure: qe, default: se, func: Me, http: W, insertStyle: uo, isReactComponent: dn, route: oe }, Symbol.toStringTag, { value: "Module" })); -var ve, et, Ne, ke, Se, ie, te, Y, xe, dt, ut, pt, gt, Tt, ht; -const un = class un { +}, go = Object.freeze(Object.defineProperty({ __proto__: null, AppContext: co, AppGlobalParamsContext: uo, cache: qn, configure: qe, default: se, func: Me, http: W, insertStyle: po, isReactComponent: un, route: oe }, Symbol.toStringTag, { value: "Module" })); +var ve, et, Ne, ke, Se, re, te, Y, xe, dt, ut, pt, gt, Tt, ht; +const pn = class pn { constructor(e, n = "/") { P(this, ve, "/"); P(this, et, /* @__PURE__ */ new Set()); @@ -1236,7 +1241,7 @@ const un = class un { let n = he.normalize(e); return n.startsWith("/") || (n = "/" + n), n.length > 1 && n.endsWith("/") && (n = n.slice(0, -1)), n; }); - P(this, ie, (e) => { + P(this, re, (e) => { const n = he.join(d(this, ve), e); return d(this, Se).call(this, n); }); @@ -1332,14 +1337,14 @@ const un = class un { K(this, ve, n), this.root = { name: "/", type: "dir", children: [], lastModified: Date.now() }, Array.isArray(e) ? this.root.children = e : e && typeof e == "object" && (e.name && e.name !== "/" ? this.root.children.push(e) : (this.root = e, (i = this.root).name ?? (i.name = "/"), (r = this.root).children ?? (r.children = []), (o = this.root).lastModified ?? (o.lastModified = Date.now()))); } async stat(e) { - const n = d(this, ie).call(this, e); + const n = d(this, re).call(this, e); if (!d(this, te).call(this, n)) throw new Error(`EINVAL: invalid path '${e}'`); const i = d(this, Y).call(this, n); if (!i) throw new Error(`ENOENT: no such file or directory, stat '${e}'`); return { isFile: () => i.type === "file", isDirectory: () => i.type === "dir", lastModified: i.lastModified }; } async dir(e) { - const n = d(this, ie).call(this, e); + const n = d(this, re).call(this, e); if (!d(this, te).call(this, n)) throw new Error(`EINVAL: invalid path '${e}'`); const i = d(this, Y).call(this, n); if (!i) throw new Error(`ENOENT: no such file or directory, scandir '${e}'`); @@ -1347,7 +1352,7 @@ const un = class un { return i.children.map((r) => r.name); } async readFile(e) { - const n = d(this, ie).call(this, e); + const n = d(this, re).call(this, e); if (!d(this, te).call(this, n)) throw new Error(`EINVAL: invalid path '${e}'`); const i = d(this, Y).call(this, n); if (!i) throw new Error(`ENOENT: no such file or directory, open '${e}'`); @@ -1355,7 +1360,7 @@ const un = class un { return i.content || ""; } async writeFile(e, n) { - const i = d(this, ie).call(this, e); + const i = d(this, re).call(this, e); if (!d(this, te).call(this, i)) throw new Error(`EINVAL: invalid path '${e}'`); const { parent: r, name: o } = d(this, xe).call(this, i); if (!r) throw new Error(`ENOENT: no such file or directory, open '${e}'`); @@ -1364,7 +1369,7 @@ const un = class un { s ? r.children[a] = l : r.children.push(l), d(this, ke).call(this, r), d(this, Ne).call(this, { action: s ? "update" : "create", path: i, type: "file", timestamp: Date.now() }); } async mkdir(e, n = {}) { - const i = d(this, ie).call(this, e); + const i = d(this, re).call(this, e); if (!d(this, te).call(this, i)) throw new Error(`EINVAL: invalid path '${e}'`); const { recursive: r } = n; if (r) { @@ -1388,7 +1393,7 @@ const un = class un { } } async unlink(e) { - const n = d(this, ie).call(this, e); + const n = d(this, re).call(this, e); if (!d(this, te).call(this, n)) throw new Error(`EINVAL: invalid path '${e}'`); const { parent: i, name: r } = d(this, xe).call(this, n); if (!i) throw new Error(`ENOENT: no such file or directory, unlink '${e}'`); @@ -1398,7 +1403,7 @@ const un = class un { i.children.splice(o, 1), d(this, ke).call(this, i), d(this, Ne).call(this, { action: "delete", path: n, type: "file", timestamp: Date.now() }); } async rmdir(e, n = {}) { - const i = d(this, ie).call(this, e); + const i = d(this, re).call(this, e); if (!d(this, te).call(this, i)) throw new Error(`EINVAL: invalid path '${e}'`); const { parent: r, name: o } = d(this, xe).call(this, i); if (!r) throw new Error(`ENOENT: no such file or directory, rmdir '${e}'`); @@ -1410,7 +1415,7 @@ const un = class un { r.children.splice(a, 1), d(this, ke).call(this, r), d(this, Ne).call(this, { action: "delete", path: i, type: "dir", timestamp: Date.now() }); } async rename(e, n) { - const i = d(this, ie).call(this, e), r = d(this, ie).call(this, n); + const i = d(this, re).call(this, e), r = d(this, re).call(this, n); if (!d(this, te).call(this, i)) throw new Error(`EINVAL: invalid path '${e}'`); if (!d(this, te).call(this, r)) throw new Error(`EINVAL: invalid path '${n}'`); if (!d(this, Y).call(this, i)) throw new Error(`ENOENT: no such file or directory, rename '${e}' -> '${n}'`); @@ -1421,7 +1426,7 @@ const un = class un { o.children.splice(c, 1), s.children.push(u), d(this, ke).call(this, o), o !== s && d(this, ke).call(this, s), d(this, Ne).call(this, { action: "rename", path: r, oldPath: i, type: u.type, timestamp: Date.now() }); } async exists(e) { - const n = d(this, ie).call(this, e); + const n = d(this, re).call(this, e); return d(this, te).call(this, n) ? d(this, Y).call(this, n) !== null : !1; } getLastModified() { @@ -1442,10 +1447,10 @@ const un = class un { const i = d(this, Y).call(this, n); if (!i) throw new Error(`ENOENT: no such file or directory '${e}'`); if (i.type !== "dir") throw new Error(`ENOTDIR: not a directory '${e}'`); - return i.children ?? (i.children = []), i.lastModified ?? (i.lastModified = Date.now()), new un(this.root, n); + return i.children ?? (i.children = []), i.lastModified ?? (i.lastModified = Date.now()), new pn(this.root, n); } async findFiles(e, n, i = {}) { - const r = d(this, ie).call(this, e); + const r = d(this, re).call(this, e); if (!d(this, te).call(this, r)) throw new Error(`EINVAL: invalid path '${e}'`); const o = d(this, Y).call(this, r); if (!o) throw new Error(`ENOENT: no such file or directory '${e}'`); @@ -1459,9 +1464,9 @@ const un = class un { return d(this, dt).call(this, l, r, s); } }; -ve = new WeakMap(), et = new WeakMap(), Ne = new WeakMap(), ke = new WeakMap(), Se = new WeakMap(), ie = new WeakMap(), te = new WeakMap(), Y = new WeakMap(), xe = new WeakMap(), dt = new WeakMap(), ut = new WeakMap(), pt = new WeakMap(), gt = new WeakMap(), Tt = new WeakMap(), ht = new WeakMap(); -let Vn = un; -const go = async (t, e = "/", n = "") => { +ve = new WeakMap(), et = new WeakMap(), Ne = new WeakMap(), ke = new WeakMap(), Se = new WeakMap(), re = new WeakMap(), te = new WeakMap(), Y = new WeakMap(), xe = new WeakMap(), dt = new WeakMap(), ut = new WeakMap(), pt = new WeakMap(), gt = new WeakMap(), Tt = new WeakMap(), ht = new WeakMap(); +let Dn = pn; +const ho = async (t, e = "/", n = "") => { try { const i = await t.stat(e), r = e === "/" ? "/" : he.basename(e), o = { title: r, key: n ? `${n}${e}` : e, isLeaf: i.isFile() }; if (i.isDirectory()) { @@ -1481,7 +1486,7 @@ const go = async (t, e = "/", n = "") => { for (const c of [...s, ...l]) { const u = e === "/" ? `/${c}` : `${e}/${c}`; try { - const p = await go(t, u, n); + const p = await ho(t, u, n); o.children.push(p); } catch (p) { console.warn(`Failed to process ${u}:`, p.message); @@ -1495,103 +1500,103 @@ const go = async (t, e = "/", n = "") => { } }; export { - Ho as $, - ur as A, - Io as B, - Lo as C, + Jo as $, + pr as A, + Lo as B, + Mo as C, xt as D, - Gn as E, - Ht as F, - Do as G, - Er as H, - pr as I, - gr as J, - Or as K, - Rr as L, - Wo as M, - Bo as N, + Yn as E, + Jt as F, + Wo as G, + $r as H, + gr as I, + hr as J, + Rr as K, + Fr as L, + Bo as M, + zo as N, pe as O, - jr as P, + Ar as P, Ot as Q, - ei as R, - ai as S, + ti as R, + si as S, Mt as T, - zo as U, - Uo as V, - qo as W, - Ko as X, - Ar as Y, - Ir as Z, - Lr as _, + Uo as U, + qo as V, + Ko as W, + Ho as X, + Ir as Y, + Lr as Z, + Mr as _, _n as a, - Mr as a0, + Vr as a0, Rt as a1, _o as a2, ft as a3, Ft as a4, - Jo as a5, - Go as a6, - Vr as a7, - di as a8, + Go as a5, + Yo as a6, + Dr as a7, + ui as a8, _r as a9, - Un as aA, + qn as aA, qe as aB, Me as aC, oe as aD, - lo as aE, - co as aF, - Vn as aG, - go as aH, - so as aI, - ln as aa, - sn as ab, - ui as ac, - Dr as ad, - Wr as ae, - Br as af, - zr as ag, - Ur as ah, - qr as ai, - Yo as aj, + co as aE, + uo as aF, + Dn as aG, + ho as aH, + lo as aI, + cn as aa, + ln as ab, + pi as ac, + Wr as ad, + Br as ae, + zr as af, + Ur as ag, + qr as ah, + Kr as ai, + Xo as aj, Et as ak, R as al, - Hn as am, - Qr as an, - ne as ao, + Jn as am, + Zr as an, + ie as ao, mt as ap, - qn as aq, + Kn as aq, X as ar, - re as as, - Fo as at, - jo as au, - Ao as av, + ne as as, + jo as at, + Ao as au, + Io as av, se as aw, - dn as ax, - uo as ay, + un as ax, + po as ay, W as az, - Yn as b, - Mo as c, - Xn as d, - on as e, - ti as f, - sr as g, - ri as h, - vr as i, - ii as j, - Pr as k, - Vo as l, - ni as m, - Zn as n, - Qn as o, - kr as p, - Cr as q, - wr as r, - an as s, + Xn as b, + Vo as c, + Qn as d, + an as e, + ni as f, + lr as g, + oi as h, + Nr as i, + ri as j, + vr as k, + Do as l, + ii as m, + ei as n, + Zn as o, + Sr as p, + kr as q, + br as r, + sn as s, le as t, - $r as u, - xr as v, - Tr as w, - hr as x, - fr as y, - dr as z + Pr as u, + Er as v, + Or as w, + mr as x, + yr as y, + ur as z }; diff --git a/dist/components.js b/dist/components.js index b7fdbe3..fcb9702 100644 --- a/dist/components.js +++ b/dist/components.js @@ -1,4 +1,4 @@ -import { at as s, ak as p, au as r, av as t, as as e, aI as n } from "./common/main-Db_1Xesq.js"; +import { at as s, ak as p, au as r, av as t, as as e, aI as n } from "./common/main-TLNRXor8.js"; export { s as Empty, p as Icon, diff --git a/dist/container.js b/dist/container.js index ff37b2e..bbdb9dd 100644 --- a/dist/container.js +++ b/dist/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-Db_1Xesq.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-TLNRXor8.js"; export { s as Context, e as Empty, diff --git a/dist/data-converter.js b/dist/data-converter.js index ccb336f..dee7346 100644 --- a/dist/data-converter.js +++ b/dist/data-converter.js @@ -1,6 +1,6 @@ import "lodash"; import "react"; -import { D as i } from "./common/main-Db_1Xesq.js"; +import { D as i } from "./common/main-TLNRXor8.js"; import "react-use"; export { i as default diff --git a/dist/data-list.js b/dist/data-list.js index 41c605d..a94cf10 100644 --- a/dist/data-list.js +++ b/dist/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-Db_1Xesq.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-TLNRXor8.js"; export { t as DataListContent, e as DataListContext, diff --git a/dist/data-list/utils.js b/dist/data-list/utils.js index 9f972e7..f3bd0a5 100644 --- a/dist/data-list/utils.js +++ b/dist/data-list/utils.js @@ -1,5 +1,5 @@ import "lodash"; -import { f as a } from "../common/main-Db_1Xesq.js"; +import { f as a } from "../common/main-TLNRXor8.js"; export { a as getDefaultExpandRowKeys }; diff --git a/dist/grid-layout-form.js b/dist/grid-layout-form.js index 28f4807..c0169cc 100644 --- a/dist/grid-layout-form.js +++ b/dist/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-Db_1Xesq.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-TLNRXor8.js"; export { s as GridLayoutForm, r as GridLayoutFormHelper, diff --git a/dist/grid-layout-form/utils.js b/dist/grid-layout-form/utils.js index 39120bc..1ea434d 100644 --- a/dist/grid-layout-form/utils.js +++ b/dist/grid-layout-form/utils.js @@ -1,5 +1,5 @@ import "lodash"; -import { a as o, g } from "../common/main-Db_1Xesq.js"; +import { a as o, g } from "../common/main-TLNRXor8.js"; export { o as getNormalizeWidget, g as getOptionItemByValue diff --git a/dist/grid-layout.js b/dist/grid-layout.js index 7cf6562..2216657 100644 --- a/dist/grid-layout.js +++ b/dist/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-Db_1Xesq.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-TLNRXor8.js"; export { u as GridLayout, e as GridLayoutFramework, diff --git a/dist/grid-layout/utils.js b/dist/grid-layout/utils.js index 6511137..8c67cf7 100644 --- a/dist/grid-layout/utils.js +++ b/dist/grid-layout/utils.js @@ -1,4 +1,4 @@ -import { b as a, d as o, e as s, c as g } from "../common/main-Db_1Xesq.js"; +import { b as a, d as o, e as s, c as g } from "../common/main-TLNRXor8.js"; export { a as getBoxStyle, o as getEventProps, diff --git a/dist/hooks.js b/dist/hooks.js index d7eb3c8..f56fc73 100644 --- a/dist/hooks.js +++ b/dist/hooks.js @@ -2,7 +2,7 @@ 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-Db_1Xesq.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-TLNRXor8.js"; import { default as b } from "rc-util/lib/hooks/useMergedState"; import { a as x } from "./common/vender-hQk7ADWo.js"; export { diff --git a/dist/iconfont.js b/dist/iconfont.js index ee4a166..090a6b0 100644 --- a/dist/iconfont.js +++ b/dist/iconfont.js @@ -2,7 +2,7 @@ import "react/jsx-runtime"; import "react"; import "prop-types"; import "classnames"; -import { ak as a } from "./common/main-Db_1Xesq.js"; +import { ak as a } from "./common/main-TLNRXor8.js"; export { a as default }; diff --git a/dist/index.js b/dist/index.js index ede7f6d..109191e 100644 --- a/dist/index.js +++ b/dist/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-Db_1Xesq.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-TLNRXor8.js"; export { t as AppContext, e as AppGlobalParamsContext, diff --git a/dist/pages.js b/dist/pages.js index 622369f..aa8b9b3 100644 --- a/dist/pages.js +++ b/dist/pages.js @@ -1,4 +1,4 @@ -import { L as t, K as e, M as o, N as g } from "./common/main-Db_1Xesq.js"; +import { L as t, K as e, M as o, N as g } from "./common/main-TLNRXor8.js"; export { t as CustomPage, e as DataListPage, diff --git a/dist/res-ws.js b/dist/res-ws.js index af22a00..ac8b2b0 100644 --- a/dist/res-ws.js +++ b/dist/res-ws.js @@ -1,5 +1,5 @@ import "lodash"; -import { R as a } from "./common/main-Db_1Xesq.js"; +import { R as a } from "./common/main-TLNRXor8.js"; export { a as default }; diff --git a/dist/utils.js b/dist/utils.js index 5dda07f..af8f8fc 100644 --- a/dist/utils.js +++ b/dist/utils.js @@ -1,5 +1,5 @@ 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-Db_1Xesq.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-TLNRXor8.js"; import "./common/vender-hQk7ADWo.js"; export { r as deepSome, diff --git a/dist/virtual-fs.js b/dist/virtual-fs.js index cd57369..582a1ac 100644 --- a/dist/virtual-fs.js +++ b/dist/virtual-fs.js @@ -1,5 +1,5 @@ import "pathe"; -import { aG as o, aH as r } from "./common/main-Db_1Xesq.js"; +import { aG as o, aH as r } from "./common/main-TLNRXor8.js"; export { o as default, r as toTreePaths diff --git a/package.json b/package.json index 15cc8ee..9d5c4d3 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "ff", "private": true, - "version": "0.6.57", + "version": "0.6.58", "author": "www.fsdpf.com", "type": "module", "main": "./dist/index.js",