From f489fc821db8a81d63903898b3e5b6919d39c586 Mon Sep 17 00:00:00 2001 From: what Date: Wed, 12 Aug 2026 11:16:01 +0800 Subject: [PATCH] v0.7.6 --- dist/button.js | 2 +- .../{main-ChLfL4hx.js => main-uvtyIdqt.js} | 444 +++++++++--------- dist/components.js | 2 +- dist/container.js | 2 +- dist/data-converter.js | 2 +- dist/data-list.js | 2 +- dist/data-list/utils.js | 2 +- dist/grid-layout-form.js | 2 +- dist/grid-layout-form/utils.js | 2 +- dist/grid-layout.js | 2 +- dist/grid-layout/utils.js | 2 +- dist/hooks.js | 2 +- dist/iconfont.js | 2 +- dist/index.js | 2 +- dist/pages.js | 2 +- dist/res-ws.js | 2 +- dist/utils.js | 2 +- dist/virtual-fs.js | 2 +- package.json | 2 +- 19 files changed, 240 insertions(+), 240 deletions(-) rename dist/common/{main-ChLfL4hx.js => main-uvtyIdqt.js} (87%) diff --git a/dist/button.js b/dist/button.js index 6e97080..63e4ddd 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-ChLfL4hx.js"; +import { am as s, al as u, an as e } from "./common/main-uvtyIdqt.js"; export { s as auth, u as default, diff --git a/dist/common/main-ChLfL4hx.js b/dist/common/main-uvtyIdqt.js similarity index 87% rename from dist/common/main-ChLfL4hx.js rename to dist/common/main-uvtyIdqt.js index d0f31d5..015ae42 100644 --- a/dist/common/main-ChLfL4hx.js +++ b/dist/common/main-uvtyIdqt.js @@ -6,18 +6,18 @@ var Ti = (t, e, n) => e in t ? Ni(t, e, { enumerable: !0, configurable: !0, writ var O = (t, e, n) => Ti(t, typeof e != "symbol" ? e + "" : e, n), yn = (t, e, n) => e.has(t) || fn("Cannot " + n); var d = (t, e, n) => (yn(t, e, "read from private field"), n ? n.call(t) : e.get(t)), v = (t, e, n) => e.has(t) ? fn("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, n), _ = (t, e, n, i) => (yn(t, e, "write to private field"), i ? i.call(t, n) : e.set(t, n), n); import { jsx as h, jsxs as A } from "react/jsx-runtime"; -import x, { useEffect as W, useState as L, useCallback as J, useRef as H, useContext as pe, useMemo as B, useId as Lt, isValidElement as Oi, useLayoutEffect as Ri } from "react"; -import ge from "pathe"; +import x, { useEffect as W, useState as L, useCallback as J, useRef as H, useContext as de, useMemo as B, useId as Lt, isValidElement as Oi, useLayoutEffect as Ri } from "react"; +import ue from "pathe"; import C from "prop-types"; import j from "classnames"; import { useNotification as Fi } from "rc-notification"; import w from "lodash"; import { useMountedState as ji, useDeepCompareEffect as Gt, useUpdateEffect as Yt, usePrevious as Fn } from "react-use"; -import ae, { Field as Xt, FieldContext as jn } from "rc-field-form"; +import re, { Field as Xt, FieldContext as jn } from "rc-field-form"; import { _ as wn, C as Qt, L as Ii, M as Rt, N as Xe, b as Le, o as Vt, c as Ai, S as Li } from "./vender-C5RbewOc.js"; import Vi from "rc-util/lib/hooks/useMergedState"; import In from "immutability-helper"; -import { Space as Mt, Form as ft, Input as Mi, Button as wt, Pagination as Di, Tree as Ui, Breadcrumb as zi, Empty as Dt, Table as bn, Popover as Bi, Popconfirm as Wi, Tooltip as qi, Divider as _i } from "antd"; +import { Space as Mt, Form as ft, Input as Mi, Button as wt, Pagination as Di, Tree as zi, Breadcrumb as Ui, Empty as Dt, Table as bn, Popover as Bi, Popconfirm as Wi, Tooltip as qi, Divider as _i } from "antd"; import { useMergedState as Ki } from "rc-util"; import { generatePath as Hi, useInRouterContext as An, useParams as Ji, useLocation as Gi, createBrowserRouter as Yi, Navigate as Xi } from "react-router-dom"; import Qi from "rc-drawer"; @@ -56,32 +56,32 @@ class er { We = new WeakMap(), Ze = new WeakMap(), qe = new WeakMap(), Ee = new WeakMap(), Ve = new WeakMap(), Me = new WeakMap(); const xo = () => h("div", { children: "Empty" }), ut = x.createContext({ ele: {}, mount: () => { }, unmount: () => { -} }), ie = ({ rootClassName: t, className: e, children: n, actions: i, title: r, subTitle: o, extras: a, style: s = {} }) => { +} }), te = ({ rootClassName: t, className: e, children: n, actions: i, title: r, subTitle: o, extras: a, style: s = {} }) => { const { mount: l, unmount: c } = x.useContext(ut); - return ie.Action({ children: i }), ie.Title({ children: r }), ie.SubTitle({ children: o }), ie.Extra({ children: a }), W(() => (l("rootClassName", t), () => c(t)), [t]), h("div", { className: j("ff-container", e), style: s, children: n }); + return te.Action({ children: i }), te.Title({ children: r }), te.SubTitle({ children: o }), te.Extra({ children: a }), W(() => (l("rootClassName", t), () => c(t)), [t]), h("div", { className: j("ff-container", e), style: s, children: n }); }, mt = (t) => ({ children: e, className: n }) => { const { mount: i, unmount: r } = x.useContext(ut); return W(() => (e && i(t, x.createElement("div", { key: `ff-${t}`, className: j(`ff-popup-${t}`, n) }, e)), () => r(t)), [n, e]), null; }; -ie.Action = mt("actions"), ie.Title = mt("title"), ie.SubTitle = mt("sub-title"), ie.Extra = mt("extras"), ie.propTypes = { className: C.string, style: C.object, title: C.any, subTitle: C.any, actions: C.any, extras: C.any }; -const Eo = () => h(ie, { className: "ff-loading", children: A("div", { className: "loader", children: [A("div", { className: "square", children: [h("span", {}), h("span", {}), h("span", {})] }), A("div", { className: "square", children: [h("span", {}), h("span", {}), h("span", {})] }), A("div", { className: "square", children: [h("span", {}), h("span", {}), h("span", {})] }), A("div", { className: "square", children: [h("span", {}), h("span", {}), h("span", {})] })] }) }), $o = () => h("div", { children: "NotFound" }), Ln = ({ children: t }) => { +te.Action = mt("actions"), te.Title = mt("title"), te.SubTitle = mt("sub-title"), te.Extra = mt("extras"), te.propTypes = { className: C.string, style: C.object, title: C.any, subTitle: C.any, actions: C.any, extras: C.any }; +const Eo = () => h(te, { className: "ff-loading", children: A("div", { className: "loader", children: [A("div", { className: "square", children: [h("span", {}), h("span", {}), h("span", {})] }), A("div", { className: "square", children: [h("span", {}), h("span", {}), h("span", {})] }), A("div", { className: "square", children: [h("span", {}), h("span", {}), h("span", {})] }), A("div", { className: "square", children: [h("span", {}), h("span", {}), h("span", {})] })] }) }), $o = () => h("div", { children: "NotFound" }), Ln = ({ children: t }) => { const [e, n] = L({}), i = J((o, a) => n((s) => ({ ...s, [o]: a })), []), r = J((o) => n((a) => ({ ...a, [o]: void 0 })), []); return typeof (t == null ? void 0 : t.type) == "string" ? t : h(ut.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 }) }); }; Ln.propTypes = { children: C.element.isRequired }; -const kn = { 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"] }, Zt = ({ type: t, props: e }) => h("i", { ...e, children: h("svg", { viewBox: "0 0 1024 1024", width: "1em", height: "1em", fill: "currentColor", children: (kn[t] || kn.info).map((n, i) => h("path", { d: n }, i)) }) }), Vn = ({ className: t, content: e, icon: n, $close: i }) => A(x.Fragment, { children: [n && h("div", { className: j("ff-notification-icon", t), children: h(Zt, { type: n }) }), e] }), tr = ({}) => h(ie, { children: "Confirm" }); +const kn = { 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"] }, Zt = ({ type: t, props: e }) => h("i", { ...e, children: h("svg", { viewBox: "0 0 1024 1024", width: "1em", height: "1em", fill: "currentColor", children: (kn[t] || kn.info).map((n, i) => h("path", { d: n }, i)) }) }), Vn = ({ className: t, content: e, icon: n, $close: i }) => A(x.Fragment, { children: [n && h("div", { className: j("ff-notification-icon", t), children: h(Zt, { type: n }) }), e] }), tr = ({}) => h(te, { children: "Confirm" }); var Te, _e; -const he = class he { +const pe = class pe { constructor() { v(this, _e, /* @__PURE__ */ new Map()); O(this, "init", (e) => _(this, _e, new Map(e))); O(this, "check", (e) => !d(this, _e).has(e) || d(this, _e).get(e)); - if (d(he, Te)) return d(he, Te); + if (d(pe, Te)) return d(pe, Te); } }; -Te = new WeakMap(), _e = new WeakMap(), v(he, Te, null), O(he, "getInstance", () => (d(he, Te) || _(he, Te, new he()), d(he, Te))); -let Ut = he; -const Mn = Ut.getInstance(), nr = (t, e, n = "children") => { +Te = new WeakMap(), _e = new WeakMap(), v(pe, Te, null), O(pe, "getInstance", () => (d(pe, Te) || _(pe, Te, new pe()), d(pe, Te))); +let zt = pe; +const Mn = zt.getInstance(), nr = (t, e, n = "children") => { if (w.isEmpty(t)) return {}; const i = w.find(t, ["value", e]); if (!w.isEmpty(i)) return i; @@ -93,17 +93,17 @@ const Mn = Ut.getInstance(), nr = (t, e, n = "children") => { return {}; }, Dn = (t = "Input", e = "@pkg/ff/grid-layout-forms") => t != null && t.startsWith("@") || t != null && t.startsWith("blob:") ? t : `${e}/${t}`; var Oe, et; -const me = class me { +const ge = class ge { constructor() { v(this, et, null); O(this, "init", (e) => _(this, et, e)); O(this, "get", (e, n) => w.get(d(this, et), e, n)); - if (d(me, Oe)) return d(me, Oe); + if (d(ge, Oe)) return d(ge, Oe); } }; -Oe = new WeakMap(), et = new WeakMap(), v(me, Oe, null), O(me, "getInstance", () => (d(me, Oe) || _(me, Oe, new me()), d(me, Oe))); -let zt = me; -const ze = zt.getInstance(); +Oe = new WeakMap(), et = new WeakMap(), v(ge, Oe, null), O(ge, "getInstance", () => (d(ge, Oe) || _(ge, Oe, new ge()), d(ge, Oe))); +let Ut = ge; +const Ue = Ut.getInstance(); var Ke, kt, tt, nt, St; const Ne = class Ne { constructor(...e) { @@ -139,7 +139,7 @@ const Ne = class Ne { }; Ke = new WeakMap(), kt = new WeakMap(), tt = new WeakMap(), nt = new WeakMap(), St = new WeakMap(), v(Ne, Ke, null), v(Ne, kt, w.memoize((e, n) => { if (typeof e == "function") return e(n); - if (typeof e == "string") return re.getWidgetComponent(e).then((i) => { + if (typeof e == "string") return ne.getWidgetComponent(e).then((i) => { var r; return ((r = i.default) == null ? void 0 : r.call(i, n)) || ((o) => o); }); @@ -149,7 +149,7 @@ Ke = new WeakMap(), kt = new WeakMap(), tt = new WeakMap(), nt = new WeakMap(), return d(Ne, Ke) || _(Ne, Ke, Or()), d(n = Ne, Ke).call(n, ...e); })); let bt = Ne; -const se = x.createContext({ listCode: "", classNames: {}, getBase62params: (t, e) => { +const oe = x.createContext({ listCode: "", classNames: {}, getBase62params: (t, e) => { }, getSelectedRows: () => [], onReload: () => { }, onClickCallback: () => { }, onConditionChange: () => { @@ -168,25 +168,25 @@ const se = x.createContext({ listCode: "", classNames: {}, getBase62params: (t, } }), Sn = ({ 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: Un, 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: zn, 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 }); -}, Un = ({ record: t, column: e, $close: n, $setting: i }) => { - const r = H(Nr(w.get(t, e == null ? void 0 : e.dataIndex))), { listCode: o, onClickCallback: a } = pe(se), [s] = ae.useForm(), { formSetting: l, widgetSetting: c } = i, { primaryKey: u = "id", help: p, validators: m } = l || {}, g = () => { +}, zn = ({ record: t, column: e, $close: n, $setting: i }) => { + const r = H(Nr(w.get(t, e == null ? void 0 : e.dataIndex))), { listCode: o, onClickCallback: a } = de(oe), [s] = re.useForm(), { formSetting: l, widgetSetting: c } = i, { primaryKey: u = "id", help: p, validators: m } = l || {}, g = () => { s.setFieldsValue({ value: w.get(t, e == null ? void 0 : e.dataIndex), __PROPS__: t }); }; - return vt(() => g(), [t, e == null ? void 0 : e.dataIndex, o]), h(ie, { actions: A(x.Fragment, { children: [h(R, { size: "small", onClick: g, children: "重置" }), A(Mt.Compact, { block: !0, children: [h(R, { size: "small", widget: n, children: "取消" }), h(R, { type: "primary", size: "small", widget: () => s.validateFields().then(({ value: f }) => { + return vt(() => g(), [t, e == null ? void 0 : e.dataIndex, o]), h(te, { actions: A(x.Fragment, { children: [h(R, { size: "small", onClick: g, children: "重置" }), A(Mt.Compact, { block: !0, children: [h(R, { size: "small", widget: n, children: "取消" }), h(R, { type: "primary", size: "small", widget: () => s.validateFields().then(({ value: f }) => { const y = w.get(t, u.substring(u.indexOf(".") + 1)); if (!y) throw "获取更新主键失败!"; - U.put(`/api/${o}-storeBy-${e == null ? void 0 : e.uuid}/${y}`, { value: f }).msg(() => a(2, t)).then(n); - }).catch(console.warn), children: "保存" })] })] }), children: A(ae, { form: s, children: [h(nn, { label: "", code: "value", type: r.current, widget: e == null ? void 0 : e.editableByJs, help: p, extras: c, validators: m }), h(Xt, { noStyle: !0, name: ["__PROPS__"], children: () => { + z.put(`/api/${o}-storeBy-${e == null ? void 0 : e.uuid}/${y}`, { value: f }).msg(() => a(2, t)).then(n); + }).catch(console.warn), children: "保存" })] })] }), children: A(re, { form: s, children: [h(nn, { label: "", code: "value", type: r.current, widget: e == null ? void 0 : e.editableByJs, help: p, extras: c, validators: m }), h(Xt, { noStyle: !0, name: ["__PROPS__"], children: () => { } })] }) }); }; -Un.displayName = "DataListCellEditableContainer"; +zn.displayName = "DataListCellEditableContainer"; const ir = (t) => function(e) { return t(e, getRecord()); }, rr = async ({ widgetByJs: t, widgetByJsSetting: e }) => { - const n = await re.getWidgetComponent(t).then((i) => i.default || ((r) => r)); + const n = await ne.getWidgetComponent(t).then((i) => i.default || ((r) => r)); return function(i) { return h(n, { value: i, $setting: e }); }; @@ -203,15 +203,15 @@ const ir = (t) => function(e) { const [e, n] = L({}); return W(() => { let i = !1; - return t && U.get(`/api/_/${t}`).then((r) => w.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; + return t && z.get(`/api/_/${t}`).then((r) => w.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; }, vo = (t, e = {}) => { const [n, i] = L({ dataSource: [] }); return pt(() => { let r = !1; - return t && U.get(`/api/${t}/${U.encode({ page: 1, ...e })}`).then((o) => !r && i(o)), () => r = !0; + return t && z.get(`/api/${t}/${z.encode({ page: 1, ...e })}`).then((o) => !r && i(o)), () => r = !0; }, [t, e]), n; -}, zn = (t = [], e = /* @__PURE__ */ new Map(), n = "id", i) => { +}, Un = (t = [], e = /* @__PURE__ */ new Map(), n = "id", i) => { const r = J(i ? (o) => w.get(o, n, w.get(o, [i, n])) : (o) => w.get(o, n), [n, i]); return J((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]); }, Bt = (t = [], e = /* @__PURE__ */ new Map(), n = [], i = "id", r) => { @@ -230,7 +230,7 @@ const ir = (t) => function(e) { if (l === 2) { const m = w.get(c, "__PARENT_ID__", ""), g = w.get(c, n, w.get(c, [i, n], "")), f = w.findIndex(a.current, ["__PARENT_ID__", m]), y = w.findIndex(f > -1 ? w.get(a.current, [f, "children"]) : a.current, [n, g]); if (y === -1) return (p = t.onReload) == null ? void 0 : p.call(t); - Promise.all([U.get(`/api/${e}/detail/${g}`), U.post(`/api/${e}/list-operations-access`, { ids: g })]).then(([S, b]) => { + Promise.all([z.get(`/api/${e}/detail/${g}`), z.post(`/api/${e}/list-operations-access`, { ids: g })]).then(([S, b]) => { const E = w.get(a.current, f > -1 ? [f, "children", y, "children"] : [y, "children"]); a.current = In(a.current, f > -1 ? { [f]: { children: { $splice: [[y, 1, { ...S, children: E }]] } } } : { $splice: [[y, 1, { ...S, children: E }]] }); const k = new Map(b); @@ -247,7 +247,7 @@ const ir = (t) => function(e) { }]; }, lr = (t, e) => { const n = Pt(), i = H(e), r = H(/* @__PURE__ */ new Map()), o = H([]), a = w.throttle((l) => { - o.current = [], U.list(t, w.pick({ ...i.current, ...l }, ["tab", "page", "pageSize", "condition", "sider", "keyword"])).then(({ keyword: c, condition: u, total: p, tab: m, sider: g, page: f, pageSize: y, operationsAccess: S, dataSource: b }) => { + o.current = [], z.list(t, w.pick({ ...i.current, ...l }, ["tab", "page", "pageSize", "condition", "sider", "keyword"])).then(({ keyword: c, condition: u, total: p, tab: m, sider: g, page: f, pageSize: y, operationsAccess: S, dataSource: b }) => { i.current = { tab: m, condition: u, sider: g, keyword: c, total: p, pageSize: y, page: b != null && b.length ? f : 1 }, o.current = b, r.current = new Map(S), n(); }); }, 380, { leading: !1, trailing: !0 }); @@ -257,10 +257,10 @@ const ir = (t) => function(e) { const s = B(() => w.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: In(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 }); }, cr = ({ 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: f, tabs: y, isConditionFormLayout: S, isTreeSider: b, treeSiderConfig: E, rowSelection: k }) => { - const { classNames: $, onClickCallback: F } = pe(se), I = w.pick(f, ["column", "colWidth", "beforeRender", "afterRender", "style", "itemMargin", "containerPadding"]), T = f == null ? void 0 : f.isMarkSelected, N = zn(l, c, p, u), M = J((P, V, D) => h(dr, { isMarkSelected: T, className: j("ff-data-list-framework-item", $ == null ? void 0 : $.item), operations: o ? N(V) : [], data: u ? { [u]: V } : V, children: P, onClickCallback: F }), [T, u, p, o, F, l, c]); + const { classNames: $, onClickCallback: F } = de(oe), I = w.pick(f, ["column", "colWidth", "beforeRender", "afterRender", "style", "itemMargin", "containerPadding"]), T = f == null ? void 0 : f.isMarkSelected, N = Un(l, c, p, u), M = J((P, V, D) => h(dr, { isMarkSelected: T, className: j("ff-data-list-framework-item", $ == null ? void 0 : $.item), operations: o ? N(V) : [], data: u ? { [u]: V } : V, children: P, onClickCallback: F }), [T, u, p, o, F, l, c]); return A("div", { className: j("ff-data-list-framework", e), children: [h(n.sider, { isTreeSider: b, ...E }), A("div", { className: j("ff-data-list-container", $ == null ? void 0 : $.container), children: [h(n.filter, { isConditionFormLayout: S }), h(n.toolbar, { title: m, tabs: y }), h(Er, { ...g, ...I, rowSelection: k, empty: h(n.empty, { className: $ == null ? void 0 : $.empty }), primaryKey: p, itemRender: M, dataSource: i }), h(n.footer, { isPaginate: r, isOperations: a, operations: s })] })] }); }, dr = ({ className: t, operations: e, children: n, data: i, onClickCallback: r, onSelect: o, isMarkSelected: a, isSelected: s, selectionType: l }) => A("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 || Lt()) }, (c == null ? void 0 : c.uuid) || Lt())) })] }), ur = ({ 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: f, rowSelection: y, isTreeSider: S, treeSiderConfig: b, isConditionFormLayout: E, ...k }) => { - const { classNames: $, onClickCallback: F } = pe(se), I = zn(l, c, p, u), T = Bt(l, c, i, p, u); + const { classNames: $, onClickCallback: F } = de(oe), I = Un(l, c, p, u), T = Bt(l, c, i, p, u); return A("div", { className: j("ff-data-table-framework", e), children: [h(n.sider, { isTreeSider: S, ...b }), A("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(wr, { ...k, primaryKey: p, className: "ff-data-table-content", columns: r, dataSource: i, rowSelection: y, operationRender: T ? (N) => { var M; return h("div", { className: "ff-data-table-actions", children: (M = I(N)) == null ? void 0 : M.map((P, V) => h(R, { size: "small", uuid: P.uuid, type: P.type, name: P.name, widget: P.widget, widgetType: P.widgetType, widgetProps: P.widgetProps, widgetData: P.widgetData, widgetSetting: P.widgetSetting, widgetContainerProps: P.widgetContainerSetting, data: N, confirm: P.confirm, onAfterClick: (D) => D !== !1 && (F == null ? void 0 : F(P.isRefresh, N)) }, P.uuid || V)) }); @@ -273,9 +273,9 @@ const ir = (t) => function(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"] = xn(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"] = xn(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; }, xn = (t, e, n, i) => `${t || 0}px ${e || 0}px ${n || 0}px ${i || 0}px`, No = (t = "Text", e = "@pkg/ff/grid-layouts") => t != null && t.startsWith("@") || t != null && t.startsWith("blob:") ? t : `${e}/${t}`, Wn = (t) => Object.keys(t).reduce((e, n) => (/^on[A-Z]/.test(n) && (e[n] = t[n]), e), {}), qn = ({ className: t, isConditionFormLayout: e }) => { var m, g; - const [n, i] = L({}), { listCode: r, onKeywordChange: o, onConditionChange: a, getBase62params: s, classNames: l } = x.useContext(se), { keyword: c, condition: u } = (s == null ? void 0 : s()) || {}, [p] = ft.useForm(); + const [n, i] = L({}), { listCode: r, onKeywordChange: o, onConditionChange: a, getBase62params: s, classNames: l } = x.useContext(oe), { keyword: c, condition: u } = (s == null ? void 0 : s()) || {}, [p] = ft.useForm(); return W(() => { - r && e && U.get(`/api/_/${r}/list-condition-form-layout`).then(({ resource: f, marginX: y, marginY: S, rowHeight: b, cols: E, fields: k }) => { + r && e && z.get(`/api/_/${r}/list-condition-form-layout`).then(({ resource: f, marginX: y, marginY: S, rowHeight: b, cols: E, fields: k }) => { i({ resource: f, itemMargin: [y, S], rowHeight: b, cols: E, fields: k }); }).catch(() => i({})); }, [r, e]), W(() => { @@ -293,39 +293,39 @@ const ir = (t) => function(e) { }; 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 gr = ({ className: t, operations: e, isOperations: n, isPaginate: i }) => { - const { onPageChange: r, onPageSizeChange: o, onClickCallback: a, getBase62params: s } = x.useContext(se), { total: l, page: c, pageSize: u } = (s == null ? void 0 : s()) || {}; + const { onPageChange: r, onPageSizeChange: o, onClickCallback: a, getBase62params: s } = x.useContext(oe), { total: l, page: c, pageSize: u } = (s == null ? void 0 : s()) || {}; return n && !w.isEmpty(e) || i ? A("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(Di, { size: "small", total: l, pageSize: u, showSizeChanger: !1, showTotal: (p) => `第 ${c} 页 / 总共 ${p} 条`, onChange: r, onShowSizeChange: o })] }) : null; }, hr = [{ 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" }] }] }], mr = ({ className: t, width: e = 280, isTreeSider: n }) => { - const { classNames: i } = pe(se); - return n ? h(Ui.DirectoryTree, { className: j("ff-data-list-sider", i.sider, t), style: { "--sider-width": e }, showLine: !0, showIcon: !1, treeData: hr }) : null; + const { classNames: i } = de(oe); + return n ? h(zi.DirectoryTree, { className: j("ff-data-list-sider", i.sider, t), style: { "--sider-width": e }, showLine: !0, showIcon: !1, treeData: hr }) : null; }, fr = ({ className: t, title: e, tabs: n }) => { - const { getBase62params: i, onTabChange: r, onReload: o, classNames: a } = pe(se), { tab: s } = (i == null ? void 0 : i()) || {}, [l, c] = Ki((n == null ? void 0 : n[0].value) ?? (n == null ? void 0 : n[0].code), { value: s, onChange: r }); - return A("div", { className: j("ff-data-list-toolbar", a.toolbar, t), children: [h("div", { className: "ff-data-list-title", children: e }), h(zi, { 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 }), A("div", { className: "ff-data-list-actions", children: [h(R.Link, { icon: "icon-reload", widget: () => o() }), h(R.Link, { icon: "icon-setting" })] })] }); + const { getBase62params: i, onTabChange: r, onReload: o, classNames: a } = de(oe), { tab: s } = (i == null ? void 0 : i()) || {}, [l, c] = Ki((n == null ? void 0 : n[0].value) ?? (n == null ? void 0 : n[0].code), { value: s, onChange: r }); + return A("div", { className: j("ff-data-list-toolbar", a.toolbar, t), children: [h("div", { className: "ff-data-list-title", children: e }), h(Ui, { 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 }), A("div", { className: "ff-data-list-actions", children: [h(R.Link, { icon: "icon-reload", widget: () => o() }), h(R.Link, { icon: "icon-setting" })] })] }); }, yr = ({ className: t, ...e }) => h(Dt, { className: j(t, "ff-data-list-empty"), image: Dt.PRESENTED_IMAGE_SIMPLE, ...e }), _n = ({ 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: f, condition: y, onConditionChange: S, sider: b, onSiderChange: E, layouts: k, classNames: $ = {}, payload: F = {}, dataSource: I = [], rowSelection: T, getSelectedRows: N, primaryKey: M, ...P }) => { - const [V, D] = L(), z = N ?? (() => I), X = J((q, le) => { + const [V, D] = L(), U = N ?? (() => I), X = J((q, ae) => { const K = { tab: p, page: s, pageSize: c, keyword: g, sider: b, condition: y, total: a, payload: F }; - return q && q != "init" ? w.get(K, q, le) : K; + return q && q != "init" ? w.get(K, q, ae) : K; }, [JSON.stringify(y), JSON.stringify(F), p, s, c, g, b, a]), xe = B(() => { let q = { sider: mr, filter: qn, footer: gr, toolbar: fr, empty: yr }; k === !1 ? q = { sider: null, filter: null, footer: null, toolbar: null, empty: null } : w.isPlainObject(k) && (q = Object.assign({}, q, k)); - for (const le in q) if (q[le]) { - if (Oi(q[le])) { - const K = q[le]; - q[le] = (ht) => x.cloneElement(K, ht); + for (const ae in q) if (q[ae]) { + if (Oi(q[ae])) { + const K = q[ae]; + q[ae] = (ht) => x.cloneElement(K, ht); } - } else q[le] = () => h(x.Fragment, {}); + } else q[ae] = () => h(x.Fragment, {}); return q; }, [k]); return W(() => { - e ? re.getWidgetComponent(e).then((q) => { + e ? ne.getWidgetComponent(e).then((q) => { if (!q) throw `${e} not found`; return q; }).catch((q) => ({ default: () => `${q}` })).then((q) => D(x.createElement(q.default, { ...P, layouts: xe, $setting: n }))) : D(h(t ? cr : ur, { ...P, layouts: xe, $setting: n })); - }, [e, n]), h(se.Provider, { value: { classNames: $, listCode: o, onClickCallback: i, onReload: r, getBase62params: X, onPageChange: l, onPageSizeChange: u, onTabChange: m, onSiderChange: E, onKeywordChange: f, onConditionChange: S, setPage: l, setPageSize: u, setTab: m, setSider: E, setKeyword: f, setCondition: S, getSelectedRows: z }, children: V && x.cloneElement(V, { dataSource: I, primaryKey: M, rowSelection: T, ...P }) }); + }, [e, n]), h(oe.Provider, { value: { classNames: $, listCode: o, onClickCallback: i, onReload: r, getBase62params: X, onPageChange: l, onPageSizeChange: u, onTabChange: m, onSiderChange: E, onKeywordChange: f, onConditionChange: S, setPage: l, setPageSize: u, setTab: m, setSider: E, setKeyword: f, setCondition: S, getSelectedRows: U }, children: V && x.cloneElement(V, { dataSource: I, primaryKey: M, rowSelection: T, ...P }) }); }; _n.propTypes = { classNames: C.exact({ sider: C.string, filter: C.string, footer: C.string, toolbar: C.string, container: C.string, content: C.string, item: C.string, empty: C.string }), layouts: C.oneOfType([C.exact({ sider: C.oneOfType([C.elementType, C.element]), filter: C.oneOfType([C.elementType, C.element]), footer: C.oneOfType([C.elementType, C.element]), toolbar: C.oneOfType([C.elementType, C.element]), empty: C.oneOfType([C.elementType, C.element]) }), C.bool]) }; var Re, $e, De, xt; -const fe = class fe { +const he = class he { constructor() { v(this, $e, null); v(this, De, /* @__PURE__ */ new Map()); @@ -336,39 +336,39 @@ const fe = class fe { (n = e.data) != null && n.uuid ? d(this, De).forEach((r, o) => { var a; (r == "*" || (a = r == null ? void 0 : r.includes) != null && a.call(r, e.data.uuid)) && o(e.data); - }) : ((i = e.data) == null ? void 0 : i.readyState) == WebSocket.CLOSED && U.get("/api/user-api-token").then(({ token: r, expire_at: o }) => { - d(this, $e).port.postMessage({ command: "initWs", data: [`ws${w.trimStart(U.appUrl, "http")}api/user-resource-status-ws?token=${r}`] }); + }) : ((i = e.data) == null ? void 0 : i.readyState) == WebSocket.CLOSED && z.get("/api/user-api-token").then(({ token: r, expire_at: o }) => { + d(this, $e).port.postMessage({ command: "initWs", data: [`ws${w.trimStart(z.appUrl, "http")}api/user-resource-status-ws?token=${r}`] }); }); }, d(this, $e).port.postMessage({ command: "status", data: [] }); }); O(this, "subscribe", (e, n = []) => (n ? Array.isArray(n) && n.length == 0 ? n = "*" : Array.isArray(n) || (n = [n].flat()) : n = "*", d(this, De).set(e, n), d(this, De).size == 1 && d(this, xt).call(this), () => this.unsubscribe(e))); O(this, "unsubscribe", (e) => d(this, De).delete(e)); - if (d(fe, Re)) return d(fe, Re); + if (d(he, Re)) return d(he, Re); } }; -Re = new WeakMap(), $e = new WeakMap(), De = new WeakMap(), xt = new WeakMap(), v(fe, Re, null), O(fe, "getInstance", () => (d(fe, Re) || _(fe, Re, new fe()), d(fe, Re))); -let Wt = fe; +Re = new WeakMap(), $e = new WeakMap(), De = new WeakMap(), xt = new WeakMap(), v(he, Re, null), O(he, "getInstance", () => (d(he, Re) || _(he, Re, new he()), d(he, Re))); +let Wt = he; const Kn = Wt.getInstance(), tn = 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: f = [], isConditionFormLayout: y = !1, isTreeSider: S, treeSiderConfig: b, theme: E, themeConfig: k, isItemGridLayout: $, itemGridLayout: { themeConfig: F, ...I } = {}, title: T, isPaginate: N, tabs: M, selectionType: P }, V] = L({ isItemGridLayout: !1, itemGridLayout: {} }), { type: D = P, selectedRowKeys: z, defaultSelectedRowKeys: X, onChange: xe, ...q } = s ?? {}, le = lr(t, e), [{ dataSource: K, itemOperationsAccess: ht, condition: li, tab: ci, keyword: di, page: sn, total: ln, pageSize: cn, sider: ui, onConditionChange: pi, onTabChange: gi, onKeywordChange: hi, onPageChange: mi, onPageSizeChange: fi, onSiderChange: yi, onReload: Tt, payload: wi }, dn] = sr(le, t, p, u), bi = wn(l); + const [{ resource: u, primaryKey: p, batchOperations: m = [], itemOperations: g = [], columns: f = [], isConditionFormLayout: y = !1, isTreeSider: S, treeSiderConfig: b, theme: E, themeConfig: k, isItemGridLayout: $, itemGridLayout: { themeConfig: F, ...I } = {}, title: T, isPaginate: N, tabs: M, selectionType: P }, V] = L({ isItemGridLayout: !1, itemGridLayout: {} }), { type: D = P, selectedRowKeys: U, defaultSelectedRowKeys: X, onChange: xe, ...q } = s ?? {}, ae = lr(t, e), [{ dataSource: K, itemOperationsAccess: ht, condition: li, tab: ci, keyword: di, page: sn, total: ln, pageSize: cn, sider: ui, onConditionChange: pi, onTabChange: gi, onKeywordChange: hi, onPageChange: mi, onPageSizeChange: fi, onSiderChange: yi, onReload: Tt, payload: wi }, dn] = sr(ae, t, p, u), bi = wn(l); Yt(() => { bi(K, { primaryKey: p, page: sn, pageSize: cn, total: ln }); }, [K]); - const [un, Ci] = Vi([], { defaultValue: X ?? [], value: z }), [pn, ki] = L([]), gn = J(() => D ? pn : K, [D, pn, K]), Si = Bt(g, ht, K, p), xi = Bt(m); + const [un, Ci] = Vi([], { defaultValue: X ?? [], value: U }), [pn, ki] = L([]), gn = J(() => D ? pn : K, [D, pn, K]), Si = Bt(g, ht, K, p), xi = Bt(m); W(() => { let Q = null; - return t && U.get(`/api/_/${t}`).resp(({ data: Ae, res: Ot }) => { + return t && z.get(`/api/_/${t}`).resp(({ data: Ae, res: Ot }) => { Ae != null && Ae.isDynamicRefresh && (Q = Kn.subscribe(() => Tt(), Ot)), V(Ae); }).catch(() => V({})), () => Q == null ? void 0 : Q(); }, [t]), x.useImperativeHandle(c, () => ({ onReload: Tt, onClickCallback: dn, getSelectedRows: gn })); const hn = wn((Q, Ae) => { ki((Ot) => { - const mn = new Map(Ot.map((ce) => [ce == null ? void 0 : ce[p], ce])); - return Ae.forEach((ce) => mn.set(ce == null ? void 0 : ce[p], ce)), Q.map((ce) => mn.get(ce)).filter(Boolean); + const mn = new Map(Ot.map((se) => [se == null ? void 0 : se[p], se])); + return Ae.forEach((se) => mn.set(se == null ? void 0 : se[p], se)), Q.map((se) => mn.get(se)).filter(Boolean); }), Ci(Q), xe == null || xe(Q, Ae); }), Ei = B(() => D ? { columnWidth: 80, ...q, type: D, selectedRowKeys: un, onChange: hn } : void 0, [D, un, hn, s]), $i = B(() => w.merge({}, k, r), [k, r]), Pi = B(() => g == null ? void 0 : g.map((Q) => w.isEmpty(Q == null ? void 0 : Q.confirm) ? Q : { ...Q, confirm: Object.assign({}, Q.confirm, { getPopupContainer: () => document.body }) }), [g]), vi = B(() => ({ ...I, themeProps: F }), [I, F]); return h(_n, { listCode: t, title: T, classNames: a, layouts: o, resource: u, primaryKey: p, theme: i || E, themeProps: $i, isTreeSider: S, treeSiderConfig: b, isPaginate: N, rowSelection: Ei, getSelectedRows: gn, tabs: M, isItemOperations: Si, itemOperations: Pi, isBatchOperations: xi, batchOperations: m, isItemGridLayout: $, columns: f, itemGridLayout: vi, isConditionFormLayout: y, itemOperationsAccess: ht, dataSource: K, onConditionChange: pi, onTabChange: gi, onKeywordChange: hi, onPageChange: mi, onPageSizeChange: fi, onSiderChange: yi, condition: li, tab: ci, keyword: di, page: sn, total: ln, pageSize: cn, sider: ui, payload: wi, className: j("ff-data-list-helper", n), onReload: Tt, onClickCallback: dn }); }), Hn = (t, e, n = !0) => n !== !0 && n-- <= 0 ? [] : w.isArray(t) && !w.isEmpty(t) ? t.reduce((i, r) => (Reflect.has(r, e) && Reflect.has(r, "children") && i.push(r[e]), Reflect.has(r, "children") && !w.isEmpty(r.children) ? i.concat(Hn(r.children, e, n)) : i), []) : [], wr = ({ className: t, primaryKey: e, columns: n = [], dataSource: i = [], operationRender: r, operationWidth: o = 180, components: a = {}, rowSelection: s, ...l }) => { - const { classNames: c } = pe(se), u = H(null), p = H(null), [m, g] = L([]), [f, y] = L({ width: 0, height: 0 }); + const { classNames: c } = de(oe), u = H(null), p = H(null), [m, g] = L([]), [f, y] = L({ width: 0, height: 0 }); W(() => { g(Hn(i, e)); }, [i, e]), Ri(() => { @@ -395,34 +395,34 @@ const Kn = Wt.getInstance(), tn = x.forwardRef(({ listCode: t, base62params: e, }, br = "RC_FORM_INTERNAL_HOOKS", Cr = (t) => { const [e, n] = x.useState({ items: [] }); return W(() => { - t && U.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: f, groups: y }) => ({ uuid: i, code: r, name: o, resource: a, primaryKey: s, marginX: l, marginY: c, cols: u, rowHeight: p, theme: g, themeProps: f, groups: y, items: m })).then(n); + t && z.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: f, groups: y }) => ({ uuid: i, code: r, name: o, resource: a, primaryKey: s, marginX: l, marginY: c, cols: u, rowHeight: p, theme: g, themeProps: f, groups: y, items: m })).then(n); }, [t]), e; }, kr = (t, { initialValue: e, initialValueLanguage: n, convertJs: i, convertJsSetting: r, type: o = "string" }, a = null) => { - const s = H(!1), l = pe(jn), [c, u] = L(), [p, m] = L(n != "javascript" && t ? l.getFieldValue(t) : void 0), { registerWatch: g } = l.getInternalHooks(br) || {}; + const s = H(!1), l = de(jn), [c, u] = L(), [p, m] = L(n != "javascript" && t ? l.getFieldValue(t) : void 0), { registerWatch: g } = l.getInternalHooks(br) || {}; return W(() => g == null ? void 0 : g((f, y, S) => { if (!s.current) return; const b = w.get(y, t); - w.isEqual(b, p) || m(ue(b, o)); + w.isEqual(b, p) || m(ce(b, o)); }), [p]), W(() => { - n == "javascript" && e ? Be.exec(e, {}, { getFieldValueForBasicForm: (f) => a ? a.getFieldValue(f) : l.getFieldValue(f), getFieldValue: (f) => l.getFieldValue(f) }).then((f) => m(ue(f, o))).catch((f) => notification.error({ message: `布局数据错误: ${JSON.stringify(f)}` })).finally(() => s.current = !0) : (e && m(ue(e ?? l.getFieldValue(t), o)), s.current = !0); + n == "javascript" && e ? Be.exec(e, {}, { getFieldValueForBasicForm: (f) => a ? a.getFieldValue(f) : l.getFieldValue(f), getFieldValue: (f) => l.getFieldValue(f) }).then((f) => m(ce(f, o))).catch((f) => notification.error({ message: `布局数据错误: ${JSON.stringify(f)}` })).finally(() => s.current = !0) : (e && m(ce(e ?? l.getFieldValue(t), o)), s.current = !0); }, [e, n]), pt(() => { s.current && i && new bt([i, r]).toValue(p, l.getFieldsValue(!0)).then(u).catch((f) => { u(f), console.error("布局数据转换错误: ", f, i); }); }, [p, i, r]), [c ?? p, p]; }, To = (t, e, n = null) => B(() => en(t, e, n), [t]), Jn = (t, e, n = {}, i = {}, r = {}, o = null) => { - const a = pe(jn), s = Pt(), l = H(!0), c = H([]), [u, p] = L(e), [m, g] = L(), f = ae.useWatch((y) => JSON.stringify(w.pick(y, c.current)), a) || "{}"; + const a = de(jn), s = Pt(), l = H(!0), c = H([]), [u, p] = L(e), [m, g] = L(), f = re.useWatch((y) => JSON.stringify(w.pick(y, c.current)), a) || "{}"; return vt(() => { t && Be.exec(t, n, { ...i, getFieldValueForBasicForm: (y) => r ? r.getFieldValue(y) : null, getFieldValue: w.wrap(a.getFieldValue, (y, S) => (c.current.some((b) => w.isEqual(b, S)) || (c.current.push(S), s()), y == null ? void 0 : y(S))), isFieldTouched: a.isFieldTouched, isFieldsTouched: a.isFieldsTouched }).then((y) => { l.current && (p(y), g(null)); }).catch((y) => { l.current && (p(e), g(y)); }); - }, [t, f, a, n, i]), W(() => () => l.current = !1, []), t ? [o ? ue(u, o) : u, m] : [o ? ue(e, o) : e, null]; + }, [t, f, a, n, i]), W(() => () => l.current = !1, []), t ? [o ? ce(u, o) : u, m] : [o ? ce(e, o) : e, null]; }, Sr = ({ 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 W(() => { - r && re.getWidgetComponent(r).then(({ defaultProps: s = {}, default: l }) => ({ default: xr(l, s, n) })).catch((s) => ({ default: () => `${s}` })).then((s) => a(x.createElement(s.default, i))); + r && ne.getWidgetComponent(r).then(({ defaultProps: s = {}, default: l }) => ({ default: xr(l, s, n) })).catch((s) => ({ default: () => `${s}` })).then((s) => a(x.createElement(s.default, i))); }, [r]), o; }, xr = (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 } = w.merge({}, e, i), [f, y] = kr(s ? null : r, { initialValue: l, initialValueLanguage: c, convertJs: u, convertJsSetting: p, type: (g == null ? void 0 : g.type) || "string" }, n), S = B(() => { @@ -433,7 +433,7 @@ const Kn = Wt.getInstance(), tn = x.forwardRef(({ listCode: t, base62params: e, }, Gn = ({ theme: t, basicForm: e, items: n = [{ key: "default", label: "默认" }], fields: i = [], itemRender: r, chunks: o = [], children: a, $setting: s = {}, ...l }) => { const [c, u] = L(); W(() => { - t ? re.getWidgetComponent(t).then((m) => { + t ? ne.getWidgetComponent(t).then((m) => { if (!(m != null && m.default)) throw "not found"; return m; }).catch((m) => ({ default: () => `${t} ${m}` })).then((m) => u(x.createElement(m.default, {}))) : u(null); @@ -441,56 +441,56 @@ const Kn = Wt.getInstance(), tn = x.forwardRef(({ listCode: t, base62params: e, const p = B(() => 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 } }); }, Yn = ({ 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: f = {}, groups: y = [{ key: "default", label: "默认" }], children: S, ...b }) => { - const [E] = ae.useForm(e), k = B(() => [{ name: "__PROPS__", value: c }].concat(u), [c, u]); + const [E] = re.useForm(e), k = B(() => [{ name: "__PROPS__", value: c }].concat(u), [c, u]); pt(() => (E.setFieldsValue(m), () => E.resetFields()), [m]); const $ = (F, I, T) => { const N = en(I, Sr, n), M = Wn(b); return A("div", { ...M, 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: [N, T && x.cloneElement(T, { cols: o, rowHeight: a, itemMargin: l, containerPadding: s, fields: I, basicForm: n })] }); }; - return h(ae, { ...b, fields: k, form: E, component: !1, children: g ? h(Gn, { ...f, items: y, theme: g, itemRender: $, fields: p, children: S, basicForm: n }) : $(0, p, S) }); + return h(re, { ...b, fields: k, form: E, component: !1, children: g ? h(Gn, { ...f, items: y, theme: g, itemRender: $, fields: p, children: S, basicForm: n }) : $(0, p, S) }); }, Oo = /* @__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: f } = Cr(e) || {}, y = B(() => [{ 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: f, ...i, fields: a, formFields: y, rowHeight: l, cols: p, itemMargin: [c, u], data: o ? { [o]: n } : n }); })(Yn), Er = ({ 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, I) => $, empty: g = h(Dt, { description: null }), className: f, style: y = {}, theme: S, themeProps: b = {}, groups: E = [{ key: "default", label: "默认" }], rowSelection: k }) => { - const { classNames: $ } = pe(se), F = J((N) => { + const { classNames: $ } = de(oe), F = J((N) => { if (!k) return; const { selectedRowKeys: M = [], onChange: P, type: V = "checkbox" } = k, D = N == null ? void 0 : N[s]; - let z; - z = V === "radio" ? [D] : M.includes(D) ? M.filter((X) => X !== D) : [...M, D], P == null || P(z, l.filter((X) => z.includes(X == null ? void 0 : X[s]))); + let U; + U = V === "radio" ? [D] : M.includes(D) ? M.filter((X) => X !== D) : [...M, D], P == null || P(U, l.filter((X) => U.includes(X == null ? void 0 : X[s]))); }, [k, s, l]), I = B(() => h(Yn, { 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]), T = w.isEmpty(l); return A("div", { className: j("ff-data-list-content", $.content, f), style: Object.assign({}, y, t && { "--col-num": t }, e && { "--col-width": e }), children: [c == null ? void 0 : c(l), T ? g : l.map((N, M) => { - var z; + var U; const P = (N == null ? void 0 : N[s]) ?? M, V = `${P}-${Tr(N)}`, D = m(x.cloneElement(I, { data: N }), N, M); - return x.cloneElement(D, { key: V, ...k && { isSelected: (z = k == null ? void 0 : k.selectedRowKeys) == null ? void 0 : z.includes(P), selectionType: k.type ?? "checkbox", onSelect: () => F(N) } }); + return x.cloneElement(D, { key: V, ...k && { isSelected: (U = k == null ? void 0 : k.selectedRowKeys) == null ? void 0 : U.includes(P), selectionType: k.type ?? "checkbox", onSelect: () => F(N) } }); }), u == null ? void 0 : u(l)] }); }, $r = ({ component: t, $props: e }) => { const { base62params: n } = $t(e, {}); - return h(ie, { children: h(tn, { listCode: t, base62params: U.decode(n) }) }); + return h(te, { children: h(tn, { listCode: t, base62params: z.decode(n) }) }); }, Ro = () => h(Xn, {}), Xn = () => "Empty", Pr = ({ component: t, $setting: e, $props: n }) => { const [i, r] = L(), [o, a] = ni(n); return W(() => { if (!t) return r(h(Xn, { description: null })); - re.getWidgetComponent(t).catch((s) => ({ default: () => `${s}` })).then((s) => x.createElement(s.default, { $setting: e })).then(r); + ne.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; }, Fo = () => "NotFoundPage"; -var Fe, de, je, be, it, rt; -const ye = class ye { +var Fe, le, je, ye, it, rt; +const me = class me { constructor() { - v(this, de, /* @__PURE__ */ new Map()); + v(this, le, /* @__PURE__ */ new Map()); v(this, je, {}); - v(this, be, null); + v(this, ye, null); O(this, "init", (e, n) => { - _(this, de, e), _(this, je, n); + _(this, le, e), _(this, je, n); }); - O(this, "get", (e) => (d(this, de).has(e) || (e = Array.from(d(this, de).keys()).find((n) => d(this, de).get(n).uri === e)), d(this, de).get(e) || {})); + O(this, "get", (e) => (d(this, le).has(e) || (e = Array.from(d(this, le).keys()).find((n) => d(this, le).get(n).uri === e)), d(this, le).get(e) || {})); O(this, "redirect", (e, n, i = {}) => { var f; 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 = U.encode(u != null && u.base62params ? u.base62params : u)); + o == "list" && (u.base62params = z.encode(u != null && u.base62params ? u.base62params : u)); let m = Hi(r || e, u); const g = new URLSearchParams(); for (const y in a || {}) ((f = a[y]) == null ? void 0 : f.type) == "query" && Object.has(p, y) && g.append(y, JSON.stringify(p[y])); - return g.size > 0 && (m = `${m}?${g.toString()}`), i != null && i.isOpenWindow ? window.open(m) : d(this, be).navigate(m, { replace: !!(i != null && i.isReplaceRouteHistory) }); + return g.size > 0 && (m = `${m}?${g.toString()}`), i != null && i.isOpenWindow ? window.open(m) : d(this, ye).navigate(m, { replace: !!(i != null && i.isReplaceRouteHistory) }); }); O(this, "getMenus", (e) => { var n; @@ -524,14 +524,14 @@ const ye = class ye { }); O(this, "getCurrentRoute", (e = 0) => { var i; - const n = (i = d(this, be).state.matches[d(this, be).state.matches.length - 1 - e]) == null ? void 0 : i.route; + const n = (i = d(this, ye).state.matches[d(this, ye).state.matches.length - 1 - e]) == null ? void 0 : i.route; if (!n) return null; - for (let [r, o] of d(this, de)) if (o.uri === n.path) return o; + for (let [r, o] of d(this, le)) if (o.uri === n.path) return o; return null; }); O(this, "getPageParams", (e) => { var a, s; - const { location: n = {}, matches: i = [] } = ((a = d(this, be)) == null ? void 0 : a.state) || {}, r = { ...((s = i[i.length - 1]) == null ? void 0 : s.params) || {} }, o = n.search; + const { location: n = {}, matches: i = [] } = ((a = d(this, ye)) == 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 ? w.get(r, e) : r; @@ -542,11 +542,11 @@ const ye = class ye { return e ? w.get(n, e) : n; }); O(this, "createBrowserRouter", (e = {}) => { - if (d(this, de).size == 0) return null; - if (d(this, be)) return d(this, be); - const n = ze.get("Common.WEBSITE_DEFAULT_THEME", "@pkg/ff/frameworks/DefaultTheme"), i = ze.get(re.checkUserToken() ? "Common.WEBSITE_LOGIN_REDIRECT" : "Common.WEBSITE_DEFAULT", "/index"), r = { [n]: 0 }, o = (s, l) => () => Promise.all([re.getWidgetComponent(s), $t(l)]).then(([c, u]) => [c.default || function() { + if (d(this, le).size == 0) return null; + if (d(this, ye)) return d(this, ye); + const n = Ue.get("Common.WEBSITE_DEFAULT_THEME", "@pkg/ff/frameworks/DefaultTheme"), i = Ue.get(ne.checkUserToken() ? "Common.WEBSITE_LOGIN_REDIRECT" : "Common.WEBSITE_DEFAULT", "/index"), r = { [n]: 0 }, o = (s, l) => () => Promise.all([ne.getWidgetComponent(s), $t(l)]).then(([c, u]) => [c.default || function() { return `${s}`; - }, u]).then(([c, u]) => ({ Component: () => x.createElement(Ln, {}, x.createElement(c, { $setting: u })) })), a = Array.from(d(this, de).values()).reduce((s, { uuid: l, uri: c, name: u, type: p, component: m, widgetSetting: g, widgetProps: f, isLogin: y, isLayout: S, extra: b }) => { + }, u]).then(([c, u]) => ({ Component: () => x.createElement(Ln, {}, x.createElement(c, { $setting: u })) })), a = Array.from(d(this, le).values()).reduce((s, { uuid: l, uri: c, name: u, type: p, component: m, widgetSetting: g, widgetProps: f, isLogin: y, isLayout: S, extra: b }) => { let E = {}, k = 0; switch (p) { case "list": @@ -563,17 +563,17 @@ const ye = class ye { } 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(vr, { to: i, replace: !0 }) }), _(this, be, Yi(a, e)); + return a.push({ index: !0, element: x.createElement(vr, { to: i, replace: !0 }) }), _(this, ye, Yi(a, e)); }); - if (d(ye, Fe)) return d(ye, Fe); + if (d(me, Fe)) return d(me, Fe); } }; -Fe = new WeakMap(), de = new WeakMap(), je = new WeakMap(), be = new WeakMap(), it = new WeakMap(), rt = new WeakMap(), v(ye, Fe, null), O(ye, "getInstance", () => (d(ye, Fe) || _(ye, Fe, new ye()), d(ye, Fe))); -let qt = ye; -const vr = ({ to: t, replace: e }) => An() ? x.createElement(Xi, { to: t, replace: e }) : (window.document.location = t, "redirect"), te = qt.getInstance(); +Fe = new WeakMap(), le = new WeakMap(), je = new WeakMap(), ye = new WeakMap(), it = new WeakMap(), rt = new WeakMap(), v(me, Fe, null), O(me, "getInstance", () => (d(me, Fe) || _(me, Fe, new me()), d(me, Fe))); +let qt = me; +const vr = ({ to: t, replace: e }) => An() ? x.createElement(Xi, { to: t, replace: e }) : (window.document.location = t, "redirect"), ke = qt.getInstance(); Qt.chainableTypes = [Ii]; const Be = Qt.getInstance(new URL("/ff-worker-pipe/worker.js", self.location), { type: "module" }); -Qt.fns = { http: U, generateUUID: () => Fr(), user: { logout: () => re.logout(() => window.location.replace(ze.get("Common.WEBSITE_LOGIN_PAGE", "/index"))), getUserInfo: (t = !0) => re.getUserInfo(t), checkUserToken: () => re.checkUserToken(), getUserToken: () => re.getUserToken() }, getConfigure: (t) => ze.get(t), route: { redirect: (...t) => te.redirect(...t), getPageParams: (...t) => te.getPageParams(...t), getCurrentRoute: () => te.getCurrentRoute(), get: (t) => te.get(t), getMenus: (t) => te.getMenus(t), findMenuPathByUuid: (t) => te.findMenuPathByUuid(t) }, 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) } }; +Qt.fns = { http: Object.fromEntries(["get", "post", "put", "del", "list", "decode", "encode", "cache", "refreshCache"].map((t) => [t, (...e) => z[t](...e)])), generateUUID: () => Fr(), user: { logout: () => ne.logout(() => window.location.replace(Ue.get("Common.WEBSITE_LOGIN_PAGE", "/index"))), getUserInfo: (t = !0) => ne.getUserInfo(t), checkUserToken: () => ne.checkUserToken(), getUserToken: () => ne.getUserToken() }, getConfigure: (t) => Ue.get(t), route: Object.fromEntries(["redirect", "getPageParams", "getCurrentRoute", "get", "getMenus", "findMenuPathByUuid"].map((t) => [t, (...e) => ke[t](...e)])), popup: Object.fromEntries(["notification", "success", "error", "form", "modal", "confirm"].map((t) => [t, (...e) => Se[t](...e)])) }; const En = { 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": @@ -583,7 +583,7 @@ const En = { null2json: (t) => Object.create(), null2array: (t) => [], null2numb return !1; } return !!t; -}, string2string: (t) => t, json2json: (t) => t, json2array: (t) => t ? Object.values(t) : [], json2number: (t) => Object.keys(t).length, json2integer: (t) => Object.keys(t).length, json2float: (t) => Object.keys(t).length, json2bool: (t) => Object.keys(t).length > 0, json2string: (t) => t ? JSON.stringify(t) : "", array2json: (t) => ({ ...t }), array2array: (t) => t, array2number: (t) => t.length, array2integer: (t) => t.length, array2float: (t) => t.length, array2bool: (t) => t.length > 0, array2string: (t) => JSON.stringify(t), number2json: (t) => ({}), number2array: (t) => [t], number2number: (t) => t, number2integer: (t) => t, number2float: (t) => t, number2bool: (t) => !!t, number2string: (t) => t.toString(), boolean2json: (t) => ({}), boolean2array: (t) => [], boolean2number: (t) => +t, boolean2integer: (t) => +t, boolean2float: (t) => +t, boolean2bool: (t) => t, boolean2string: (t) => t ? "true" : "false" }, ue = (t, e) => { +}, string2string: (t) => t, json2json: (t) => t, json2array: (t) => t ? Object.values(t) : [], json2number: (t) => Object.keys(t).length, json2integer: (t) => Object.keys(t).length, json2float: (t) => Object.keys(t).length, json2bool: (t) => Object.keys(t).length > 0, json2string: (t) => t ? JSON.stringify(t) : "", array2json: (t) => ({ ...t }), array2array: (t) => t, array2number: (t) => t.length, array2integer: (t) => t.length, array2float: (t) => t.length, array2bool: (t) => t.length > 0, array2string: (t) => JSON.stringify(t), number2json: (t) => ({}), number2array: (t) => [t], number2number: (t) => t, number2integer: (t) => t, number2float: (t) => t, number2bool: (t) => !!t, number2string: (t) => t.toString(), boolean2json: (t) => ({}), boolean2array: (t) => [], boolean2number: (t) => +t, boolean2integer: (t) => +t, boolean2float: (t) => +t, boolean2bool: (t) => t, boolean2string: (t) => t ? "true" : "false" }, ce = (t, e) => { let n = "string"; n = Array.isArray(t) ? "array" : typeof t, w.isObject(t) && (n = "json"); const i = `${n}2${e}`; @@ -607,7 +607,7 @@ const En = { null2json: (t) => Object.create(), null2array: (t) => [], null2numb break; case "router": case "query": - a = te.getPageParams(l); + a = ke.getPageParams(l); break; case "string": a = l; @@ -628,7 +628,7 @@ const En = { null2json: (t) => Object.create(), null2array: (t) => [], null2numb break; case "router": case "query": - o = te.getPageParams(s); + o = ke.getPageParams(s); break; case "string": o = s; @@ -694,19 +694,19 @@ const En = { null2json: (t) => Object.create(), null2array: (t) => [], null2numb }, vt = pt, ti = (t, e = "string") => { var n; if (!Array.isArray(t)) return t; - for (let i = 0; i < t.length; i++) t[i].value = ue((n = t[i]) == null ? void 0 : n.value, e), t[i] && Reflect.has(t[i], "children") && (t[i].children = ti(t[i].children, e)); + for (let i = 0; i < t.length; i++) t[i].value = ce((n = t[i]) == null ? void 0 : n.value, e), t[i] && Reflect.has(t[i], "children") && (t[i].children = ti(t[i].children, e)); return t; }, Do = (t, e = "json", n = "string", i = null, r = null) => { - const [o] = ae.useForm(i), [a, s] = L([{ label: "无", value: "", disabled: !0 }]), l = H([]), c = ae.useWatch((u) => l.current.length === 0 ? null : w.pick(u, l.current), o) || null; + const [o] = re.useForm(i), [a, s] = L([{ label: "无", value: "", disabled: !0 }]), l = H([]), c = re.useWatch((u) => l.current.length === 0 ? null : w.pick(u, l.current), o) || null; return W(() => { Array.isArray(t) ? s(t) : e === "javascript" && t ? Be.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(ue(u, "array")); - }).catch((u) => console.error("useOptions", u)) : t && s(ue(t, "array")); + s(ce(u, "array")); + }).catch((u) => console.error("useOptions", u)) : t && s(ce(t, "array")); }, [t, e, c]), ti(a, n); -}, Uo = (t) => { +}, zo = (t) => { const [e, n] = L(), i = { type: "GET" }; if (typeof t == "string" ? i.url = t : w.isPlainObject(t) && Object.assign(i, t), !(i != null && i.url)) throw "url is required"; - const r = (o) => U.request(i, !1).resp((a) => (console.log("useSubscribeRequest", o), n(a), a)); + const r = (o) => z.request(i, !1).resp((a) => (console.log("useSubscribeRequest", o), n(a), a)); return pt(() => { let o = null; return r().then((a) => { @@ -718,13 +718,13 @@ const En = { null2json: (t) => Object.create(), null2array: (t) => [], null2numb for (const [r, o] of Object.entries(n)) { const a = t == null ? void 0 : t[r]; if ((a == null ? void 0 : a.type) === "router" || (a == null ? void 0 : a.type) === "query") { - const s = te.getCurrentRoute(); - s != null && s.uuid && te.redirect(s.uuid, { ...te.getPageParams(), [a.type]: { [a.value || r]: o } }, { isReplaceRouteHistory: !0 }); + const s = ke.getCurrentRoute(); + s != null && s.uuid && ke.redirect(s.uuid, { ...ke.getPageParams(), [a.type]: { [a.value || r]: o } }, { isReplaceRouteHistory: !0 }); } else i[r] = o; } Object.keys(i).length > 0 && e(i); }, [t, e]), ni = (t, e = {}, n = {}, i = []) => { - const [r, o] = L({}), [a, s] = L({}), l = Fn(a), c = te.usePageParams(); + const [r, o] = L({}), [a, s] = L({}), l = Fn(a), c = ke.usePageParams(); Gt(() => { Promise.resolve($t(t, e, n)).then(s); }, [t, e, c, ...i]), Yt(() => { @@ -738,7 +738,7 @@ const En = { null2json: (t) => Object.create(), null2array: (t) => [], null2numb }, Ir = (t) => { const [e, n] = x.useState({ items: [], hides: [] }); return x.useEffect(() => { - t && U.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: f, theme: y, themeSetting: S, groups: b }) => ({ pk: i, uuid: r, code: o, resource: a, align: s, cols: l, rowHeight: c, marginX: u, marginY: p, theme: y, themeProps: S, groups: b, listenChangeFields: m, listenChangeFieldsFunc: g, ...f.reduce((E, k) => { + t && z.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: f, theme: y, themeSetting: S, groups: b }) => ({ pk: i, uuid: r, code: o, resource: a, align: s, cols: l, rowHeight: c, marginX: u, marginY: p, theme: y, themeProps: S, groups: b, listenChangeFields: m, listenChangeFieldsFunc: g, ...f.reduce((E, k) => { var $; 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); @@ -781,14 +781,14 @@ const En = { null2json: (t) => Object.create(), null2array: (t) => [], null2numb const [i, r] = L(null); return W(() => { const { initDataUri: o = `/api/${t}`, initDataMethod: a = "GET" } = n || {}; - e && U.request({ method: a, url: w.trimEnd(`${o}/${e}`, "/") }).then((s) => { + e && z.request({ method: a, url: w.trimEnd(`${o}/${e}`, "/") }).then((s) => { r(s); }); }, [t, e, n]), i; }, Vr = (t, e, n) => J((i, r = { serialize: (o) => o, onSuccess: () => { -}, onFail: (o) => (o == null ? void 0 : o.errorFields) && ne.error("请先完善表单信息", { duration: 2e3 }) }) => { +}, onFail: (o) => (o == null ? void 0 : o.errorFields) && Se.error("请先完善表单信息", { duration: 2e3 }) }) => { const o = i.getFieldValue("__RESOURCE__"), { submitDataUri: a = `/api/${t}`, submitDataMethod: s = "POST" } = n || {}; - return i.validateFields().then((l) => o ? w.pick(l, [o]) : l).then(r.serialize).then((l) => U.request({ method: s, url: w.trimEnd(`${a}/${e || ""}`, "/"), data: l }).msg(r.onSuccess)).catch(r.onFail); + return i.validateFields().then((l) => o ? w.pick(l, [o]) : l).then(r.serialize).then((l) => z.request({ method: s, url: w.trimEnd(`${a}/${e || ""}`, "/"), data: l }).msg(r.onSuccess)).catch(r.onFail); }, [t, e, n]), Mr = (t, e, n, i) => { const r = Lr(e, n, i); W(() => { @@ -806,8 +806,8 @@ const En = { null2json: (t) => Object.create(), null2array: (t) => [], null2numb t = Dn(m, g), r.current = w.merge(f, w.pick(r.current, s)); } return [t, r.current]; -}, $n = (t) => t === void 0 || t === !1 ? "" : (Array.isArray(t) ? t : [t]).join("_"), zo = ({ value: t, onChange: e }, n = null) => { - const i = H(), [r] = ae.useForm(n), o = H({}); +}, $n = (t) => t === void 0 || t === !1 ? "" : (Array.isArray(t) ? t : [t]).join("_"), Uo = ({ value: t, onChange: e }, n = null) => { + const i = H(), [r] = re.useForm(n), o = H({}); return vt(() => { w.isEqual(i.current, t) || r.setFieldsValue(t); }, [t]), W(() => () => r.resetFields(), []), [B(() => r.__INTERNAL__ ? r : { ...r, __INTERNAL__: { itemRef: (a) => (s) => { @@ -826,32 +826,32 @@ const En = { null2json: (t) => Object.create(), null2array: (t) => [], null2numb }, nn = ({ widget: t = "Input", widgetPrefix: e = "@pkg/ff/grid-layout-forms", widgetDecorator: n, subWidgets: i = [], basicForm: r, ...o }) => { const a = Dn(t, e), [s, l] = Dr(a, n, i, r), [c, u] = L(); return W(() => { - s && re.getWidgetComponent(s).then(({ defaultProps: p = {}, default: m }) => ({ default: Ur(m, p, r) })).catch((p) => ({ default: () => `${p}` })).then((p) => u(x.createElement(p.default, o))); + s && ne.getWidgetComponent(s).then(({ defaultProps: p = {}, default: m }) => ({ default: zr(m, p, r) })).catch((p) => ({ default: () => `${p}` })).then((p) => u(x.createElement(p.default, o))); }, [s]), c && x.cloneElement(c, { ...o, ...l }); -}, Ur = (t, e = {}, n = null) => (i) => { +}, zr = (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: f, $isReserved: y, initialValue: S, initialValueLanguage: b, ...E } = w.omit(w.merge({}, e, i), ["convertJs", "convertJsSetting", "widget", "widgetPerfix", "widgetDecorator", "subWidgets", "boxStyle"]), k = Ar(Object.assign({}, m, u ? { required: !0 } : {}), o, r), $ = B(() => { const M = Object.keys((e == null ? void 0 : e.extras) || {}); return w.over([w.partialRight(w.pick, M), w.partialRight(w.omit, M)]); - }, [e == null ? void 0 : e.extras]), [F, I] = $(E), T = { label: a, noStyle: s, style: l, colon: !1, layout: "vertical" }, N = J((M) => M == null ? void 0 : ue(M, r), [r]); + }, [e == null ? void 0 : e.extras]), [F, I] = $(E), T = { label: a, noStyle: s, style: l, colon: !1, layout: "vertical" }, N = J((M) => M == null ? void 0 : ce(M, r), [r]); return h(Xt, { name: o, rules: k, initialValue: N(S), normalize: N, children: (M, P, V) => { var D; return h(t, { type: r, rcform: V, basicForm: n, itemProps: { validateStatus: P.errors.length > 0 ? "error" : "success", tooltip: g || null, help: P.errors.length > 0 ? P.errors.join("、") : null, required: ((D = k == null ? void 0 : k[0]) == null ? void 0 : D.required) || !1, ...T }, fieldProps: { placeholder: c, ...I, ...M }, $setting: Object.assign({}, p, F) }); } }); }, rn = ({ 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: f, listenChangeFieldsFunc: y, onValuesChange: S, theme: b, themeProps: E = {}, groups: k = [{ key: "default", label: "默认" }], children: $, ...F }) => { - const [I] = ae.useForm(e), T = J((P, V) => { + const [I] = re.useForm(e), T = J((P, V) => { S == null || S(P, V), y && Array.isArray(f) && Be.exec(y, { changedValues: P, allValues: V }, { getFieldValue: I.getFieldValue, setFieldValue: I.setFieldValue, setFieldsValue: I.setFieldsValue, isFieldTouched: I.isFieldTouched, isFieldsTouched: I.isFieldsTouched }).catch((D) => console.error("onFormValuesChange", t, D)); }, [t, I, S, f, y]), N = B(() => [{ name: "__PROPS__", value: m }, { name: "__PRIMARY_KEY__", value: p }].concat(g), [p, m, g]), M = (P, V, D) => { - const z = en(V, nn, n), X = Wn(F); - return A("div", { ...X, 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: [z, D && x.cloneElement(D, { cols: o, rowHeight: a, itemMargin: s, containerPadding: l, fields: V, basicForm: n })] }); + const U = en(V, nn, n), X = Wn(F); + return A("div", { ...X, 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: [U, D && x.cloneElement(D, { cols: o, rowHeight: a, itemMargin: s, containerPadding: l, fields: V, basicForm: n })] }); }; - return A(ae, { ...F, form: I, fields: N, onValuesChange: T, children: [b ? h(Gn, { ...E, items: k, theme: b, itemRender: M, fields: c, children: $, basicForm: n }) : M(0, c, $), u == null ? void 0 : u.map((P) => { + return A(re, { ...F, form: I, fields: N, onValuesChange: T, children: [b ? h(Gn, { ...E, items: k, theme: b, itemRender: M, fields: c, children: $, basicForm: n }) : M(0, c, $), u == null ? void 0 : u.map((P) => { var V; - return h(Xt, { name: P.code, children: h(zr, { form: I, basicForm: n, name: P.code, type: P.type, initialValue: P.initialValue, initialValueLanguage: (V = P.extras) == null ? void 0 : V.initialValueLanguage }) }, JSON.stringify(P.code)); + return h(Xt, { name: P.code, children: h(Ur, { form: I, basicForm: n, name: P.code, type: P.type, initialValue: P.initialValue, initialValueLanguage: (V = P.extras) == null ? void 0 : V.initialValueLanguage }) }, JSON.stringify(P.code)); })] }); -}, zr = ({ type: t, initialValue: e, initialValueLanguage: n, onChange: i, basicForm: r }) => { +}, Ur = ({ type: t, initialValue: e, initialValueLanguage: n, onChange: i, basicForm: r }) => { const [o, a] = Jn(n == "javascript" && e, n == "javascript" ? void 0 : e, {}, {}, r); return W(() => { - n == "javascript" ? i(ue(o, t)) : e && i(ue(e, t)); + n == "javascript" ? i(ce(o, t)) : e && i(ce(e, t)); }, [t, e, o]), null; }; rn.propTypes = { fields: C.array, hides: C.array }; @@ -859,8 +859,8 @@ const Br = /* @__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: f, pk: y, uuid: S, theme: b, themeProps: E, groups: k } = Ir(e), $ = B(() => [{ name: "__PK__", value: y }, { name: "__RESOURCE__", value: a }, { name: "__LAYOUT_KEY__", value: e }, { name: "__LAYOUT_UUID__", value: S }], [y, e, S, a]); return h(t, { name: e, autoComplete: o, theme: b, themeProps: E, groups: k, ...i, formFields: $, listenChangeFields: g, listenChangeFieldsFunc: f, fields: s, hides: l, cols: m, rowHeight: c, itemMargin: [u, p] }); })(rn), ii = ({ $setting: t, $close: e, extras: n, code: i, primaryKey: r, ...o }) => { - const [a] = ae.useForm(), s = Mr(a, i, r, t); - return h(ie, { actions: A(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(Br, { form: a, code: i, primaryKey: r, ...o }) }); + const [a] = re.useForm(), s = Mr(a, i, r, t); + return h(te, { actions: A(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(Br, { form: a, code: i, primaryKey: r, ...o }) }); }, Pn = /* @__PURE__ */ new Set(), Kt = (t = [], e = 0) => { const n = t[e]; if (n.length && !Pn.has(n)) { @@ -873,21 +873,21 @@ const Br = /* @__PURE__ */ ((t) => ({ code: e, isPreview: n = !1, ...i }) => { } }, Ct = ({ 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}` }) }) }); Ct.propTypes = { className: C.string, type: C.string.isRequired, style: C.object }, Ct.init = Kt; -const Wr = (t, e, n, i) => te.redirect(n, e, i), qr = (t, e = {}, n, i = {}) => { +const Wr = (t, e, n, i) => ke.redirect(n, e, i), qr = (t, e = {}, n, i = {}) => { var o; const r = (o = i.router) == null ? void 0 : o.reduce((a, [s, l, c]) => { const u = w.get(e, ["router", s]); if (!u && u !== 0 && l) throw `请传入 ${c}`; return `${a}/${u}`; }, `/api/${n}`); - return U.del(r, e.param).msg(); + return z.del(r, e.param).msg(); }, vn = (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 w.isFunction(n) ? n.call(null, e, s) : w.isString(n) && n ? Be.exec(n, e, s) : null; -}, Nn = (t, e, n, i, r) => w.isString(n) && n ? re.getWidgetComponent(n).then(({ default: o }) => ne.modal(o, { ...e, $setting: i }, r != null && r.title ? { ...r, title: w.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: w.template(r.title)(t) } : r), _r = (t, e, n, i, r) => ne.modal(ii, { ...e, $setting: i, code: n }, r != null && r.title ? { ...r, title: w.template(r.title)(t) } : r), Kr = (t, e, n, i, r) => ne.modal(tn, { ...i, base62params: e, listCode: n }, r != null && r.title ? { ...r, title: w.template(r.title)(t) } : r), Hr = ({ widget: t, widgetType: e, widgetData: n, widgetProps: i, widgetSetting: r, widgetContainerProps: o }, { onAfterClick: a, onBeforeClick: s } = {}) => { - const l = pe(se), [c, u] = L({ leading: !0, trailing: !1 }), p = H(null), [m, g] = B(() => { +}, Nn = (t, e, n, i, r) => w.isString(n) && n ? ne.getWidgetComponent(n).then(({ default: o }) => Se.modal(o, { ...e, $setting: i }, r != null && r.title ? { ...r, title: w.template(r.title)(t) } : r)).catch((o) => { + Se.error(n, { content: o.toString() }); +}) : Se.modal(n, { ...e, $setting: i }, r != null && r.title ? { ...r, title: w.template(r.title)(t) } : r), _r = (t, e, n, i, r) => Se.modal(ii, { ...e, $setting: i, code: n }, r != null && r.title ? { ...r, title: w.template(r.title)(t) } : r), Kr = (t, e, n, i, r) => Se.modal(tn, { ...i, base62params: e, listCode: n }, r != null && r.title ? { ...r, title: w.template(r.title)(t) } : r), Hr = ({ widget: t, widgetType: e, widgetData: n, widgetProps: i, widgetSetting: r, widgetContainerProps: o }, { onAfterClick: a, onBeforeClick: s } = {}) => { + const l = de(oe), [c, u] = L({ leading: !0, trailing: !1 }), p = H(null), [m, g] = B(() => { switch (e) { case "redirect": return [w.partialRight(Wr, t, r), null]; @@ -919,16 +919,16 @@ const Wr = (t, e, n, i) => te.redirect(n, e, i), qr = (t, e = {}, n, i = {}) => 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(Ct, { type: i })), e && (s.children = e), s; }, [a, t, n, i, r]), Nt = ({ 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 = pe(se), [m, g] = L(!1), [f, y] = L("hover"), [S, b] = ni(r, t, { list: p }, [p.getBase62params, p.getSelectedRows]), [E, k] = L(), { placement: $, align: F, zIndex: I, arrow: T = { pointAtCenter: !0 }, getPopupContainer: N, isPopupMountBodyContainer: M = !0, ...P } = a || {}; + const p = de(oe), [m, g] = L(!1), [f, y] = L("hover"), [S, b] = ni(r, t, { list: p }, [p.getBase62params, p.getSelectedRows]), [E, k] = L(), { placement: $, align: F, zIndex: I, arrow: T = { pointAtCenter: !0 }, getPopupContainer: N, isPopupMountBodyContainer: M = !0, ...P } = a || {}; W(() => { - n == "grid-layout-form" ? k(x.createElement(ii, { ...i, $setting: o, code: e })) : n == "data-list" ? k(x.createElement(tn, { base62params: t, $setting: o, listCode: e })) : w.isString(e) ? re.getWidgetComponent(e).then(({ default: z }) => { - k(x.createElement(z, { ...i, $setting: o })); - }).catch((z) => k(z.toString())) : x.isValidElement(e) ? k(x.cloneElement(e, { ...i, $setting: o })) : (si(e) || w.isFunction(e) && ["component", "fsdpf-component"].includes(n)) && k(x.createElement(e, { ...i, $setting: o })); + n == "grid-layout-form" ? k(x.createElement(ii, { ...i, $setting: o, code: e })) : n == "data-list" ? k(x.createElement(tn, { base62params: t, $setting: o, listCode: e })) : w.isString(e) ? ne.getWidgetComponent(e).then(({ default: U }) => { + k(x.createElement(U, { ...i, $setting: o })); + }).catch((U) => k(U.toString())) : x.isValidElement(e) ? k(x.cloneElement(e, { ...i, $setting: o })) : (si(e) || w.isFunction(e) && ["component", "fsdpf-component"].includes(n)) && k(x.createElement(e, { ...i, $setting: o })); }, [e, n, i]); - const V = (z, X = !1) => (g(z), !z && y("hover"), z ? l == null ? void 0 : l(S) : s == null ? void 0 : s(X)), D = (z) => { + const V = (U, X = !1) => (g(U), !U && y("hover"), U ? l == null ? void 0 : l(S) : s == null ? void 0 : s(X)), D = (U) => { g(!0), y("click"); }; - return h(Bi, { zIndex: I, placement: $, onPopupClick: D, onClick: D, open: m, align: F, arrow: T, trigger: f, getPopupContainer: N || M ? void 0 : (z) => z, content: h(Jr, { ...P, extras: u, children: E && x.cloneElement(E, { ...S, $setProps: b, $close: (z) => V(!1, z) }) }), children: c, onOpenChange: V }); + return h(Bi, { zIndex: I, placement: $, onPopupClick: D, onClick: D, open: m, align: F, arrow: T, trigger: f, getPopupContainer: N || M ? void 0 : (U) => U, content: h(Jr, { ...P, extras: u, children: E && x.cloneElement(E, { ...S, $setProps: b, $close: (U) => V(!1, U) }) }), children: c, onOpenChange: V }); }, Jr = ({ title: t, className: e, classNames: n, children: i, extras: r, width: o, height: a, ...s }) => { const [l, c] = L({}), u = J((f, y) => c((S) => ({ ...S, [f]: y })), []), p = J((f) => c((y) => ({ ...y, [f]: 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(ut.Provider, { value: { ele: l, mount: u, unmount: p }, children: A("div", { className: j("ff-popup ff-popover", e, l.rootClassName), style: { width: o ?? 260, height: a }, ...s, children: [A("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 }), A("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] })] }) }); @@ -938,15 +938,15 @@ const gt = (t) => function({ className: e, variant: n, children: i, name: r, ico }, widgetType: b, widgetData: E, widgetProps: k, widgetSetting: $, widgetContainerProps: F, ...I }) { const { mode: T, ...N } = F || {}, M = ri({ className: e, name: r, type: a, icon: o, iconPosition: s }, n ?? t), P = h(wt, { ...M, ...I, children: i || r }); if (T === "popover" && !["destroy", "redirect", "func"].includes(b)) return h(Nt, { data: p, widget: S, widgetType: b, widgetData: E, widgetProps: k, widgetSetting: $, widgetContainerProps: N, onAfterClick: c, onBeforeClick: u, children: P }); - const V = w.isEmpty(f) || !f.enabled ? {} : f, D = w.isEmpty(y) ? { enabled: !1 } : Object.assign({ enabled: !0 }, y), [z, X] = L(!1), [xe, { disabled: q, loading: le }] = Hr({ widget: S, widgetType: b, widgetData: E, widgetProps: k, widgetSetting: $, widgetContainerProps: N }, { onAfterClick: c, onBeforeClick: u }); - return h(Wi, { okText: "确定", cancelText: "取消", getPopupContainer: (K) => K, ...D, disabled: q || g, open: z, onOpenChange: (K) => { + const V = w.isEmpty(f) || !f.enabled ? {} : f, D = w.isEmpty(y) ? { enabled: !1 } : Object.assign({ enabled: !0 }, y), [U, X] = L(!1), [xe, { disabled: q, loading: ae }] = Hr({ widget: S, widgetType: b, widgetData: E, widgetProps: k, widgetSetting: $, widgetContainerProps: N }, { onAfterClick: c, onBeforeClick: u }); + return h(Wi, { okText: "确定", cancelText: "取消", getPopupContainer: (K) => K, ...D, disabled: q || g, open: U, onOpenChange: (K) => { if (!K) return X(K); D.enabled ? X(K) : xe(p); }, onConfirm: (K) => { xe(p, K); }, onClick: (K) => { K.stopPropagation(); - }, children: h(qi, { getPopupContainer: (K) => K, ...V, title: z ? null : V == null ? void 0 : V.title, trigger: ["hover", "click"], children: x.cloneElement(P, { loading: le || m, disabled: q || g }) }) }); + }, children: h(qi, { getPopupContainer: (K) => K, ...V, title: U ? null : V == null ? void 0 : V.title, trigger: ["hover", "click"], children: x.cloneElement(P, { loading: ae || m, disabled: q || g }) }) }); }, R = gt("default"); R.propTypes = { type: C.oneOf(["primary", "default", "danger", ""]), size: C.oneOf(["large", "middle", "small"]), name: C.string, icon: C.string, iconPosition: C.oneOf(["start", "end"]), data: C.any, widget: C.any, widgetType: C.oneOf(["destroy", "redirect", "func", "component", "fsdpf-component", "grid-layout-form", "grid-layout", "data-list"]), widgetData: C.object, widgetProps: C.object, widgetSetting: C.object, widgetContainerProps: C.object, tooltip: C.exact({ title: C.string.isRequired, placement: C.oneOf(["top", "left", "right", "bottom", "topLeft", "topRight", "bottomLeft", "bottomRight", "leftTop", "leftBottom", "rightTop", "rightBottom"]), enabled: C.oneOfType([C.bool, C.number]), getPopupContainer: C.func }), confirm: C.exact({ title: C.string.isRequired, cancelText: C.string, okText: C.string, okType: C.oneOf(["primary", "default", "danger", ""]), placement: C.oneOf(["top", "left", "right", "bottom", "topLeft", "topRight", "bottomLeft", "bottomRight", "leftTop", "leftBottom", "rightTop", "rightBottom"]), enabled: C.oneOfType([C.bool, C.number]), getPopupContainer: C.func, arrow: C.oneOfType([C.bool, C.exact({ pointAtCenter: C.bool })]) }) }; const Gr = gt("link"), Yr = gt("circle"), Xr = gt("round"), Qr = gt("dashed"), Tn = ({ options: t = [], triggerWeights: e = ["grid-layout-form", "grid-layout", "fsdpf-component", "print"], onAfterClick: n = (g, f, y) => { @@ -965,8 +965,8 @@ const Gr = gt("link"), Yr = gt("circle"), Xr = gt("round"), Qr = gt("dashed"), T }; Tn.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 = Gr, R.Link.defaultProps = R.defaultProps, R.Link.propTypes = R.propTypes, R.Circle = Yr, R.Circle.defaultProps = R.defaultProps, R.Circle.propTypes = R.propTypes, R.Round = Xr, R.Round.defaultProps = R.defaultProps, R.Round.propTypes = R.propTypes, R.Dashed = Qr, R.Dashed.defaultProps = R.defaultProps, R.Dashed.propTypes = R.propTypes, R.Popover = Nt, R.GroupPopover = Tn; const Zr = ({ fields: t, formProps: e, $close: n }) => { - const [i] = ae.useForm(), r = B(() => [{ name: "__PROPS__", value: e }], [e]); - return h(ie, { actions: A(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(nn, { code: o, ...a }, o)) }) }); + const [i] = re.useForm(), r = B(() => [{ name: "__PROPS__", value: e }], [e]); + return h(te, { actions: A(x.Fragment, { children: [h(R, { name: "取消", widget: () => n(!1) }), h(R, { name: "确定", type: "primary", widget: () => i.validateFields(!0).then(n) })] }), children: h(re, { fields: r, form: i, className: "ff-modal-form", children: t == null ? void 0 : t.map(({ code: o, ...a }) => h(nn, { code: o, ...a }, o)) }) }); }, eo = ({ className: t, classNames: e, $close: n, children: i, title: r, subTitle: o, actions: a, extras: s, ...l }) => A(Qi, { ...l, prefixCls: "ff-drawer", className: j("ff-popup", t), maskMotion: { motionAppear: !0, motionName: "mask-motion" }, motion: (c) => ({ motionAppear: !0, motionName: `panel-motion-${c}` }), children: [A("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(Zt, { type: "close" }) }), r, o] }), h("div", { className: j("ff-popup-body", "ff-drawer-body", e == null ? void 0 : e.body), children: i }), A("div", { className: j("ff-popup-footer", "ff-drawer-footer", e == null ? void 0 : e.footer), children: [s, a] })] }), to = ({ 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 } = ((f, y = ["height", "width", "style"]) => { const S = { ...f }, b = {}; @@ -1029,7 +1029,7 @@ Y.$popups = /* @__PURE__ */ new Map(), Y.$index = 0, Y.$queue = [], Y.$onClick = }); return e; }; -const On = (t, e, n = {}) => Y.$onClick(t, e, n), jt = (t, { showProgress: e, duration: n, ...i } = { duration: 1.5 }) => Y.$onClick(Vn, { content: t, ...i }, { showProgress: e, duration: n }), ne = { modal: On, confirm: (t, e = {}) => Y.$onClick(tr, { content: t, ...e }, { placement: "center" }), form: (t, e = {}, n = {}) => On(Zr, { formProps: n, fields: t }, { placement: "center", ...e }).then((i) => { +const On = (t, e, n = {}) => Y.$onClick(t, e, n), jt = (t, { showProgress: e, duration: n, ...i } = { duration: 1.5 }) => Y.$onClick(Vn, { content: t, ...i }, { showProgress: e, duration: n }), Se = { modal: On, confirm: (t, e = {}) => Y.$onClick(tr, { content: t, ...e }, { placement: "center" }), form: (t, e = {}, n = {}) => On(Zr, { formProps: n, fields: t }, { placement: "center", ...e }).then((i) => { if (i === !1) throw !1; return i; }), notification: jt, success: (t, e = { duration: 1.5 }) => jt(t, { ...e, className: "ff-notification-success", icon: "check" }), error: (t, e = { duration: 1.5 }) => jt(t, { ...e, className: "ff-notification-error", icon: "close" }) }; @@ -1040,19 +1040,19 @@ const ai = () => { }; Le.interceptors.request.use((t) => (Object.assign(t.headers, ai()), Xe.inc(), t), (t) => (Xe.done(), Promise.reject({ code: -1, msg: t }))), Le.interceptors.response.use(({ data: t, headers: e }) => (Xe.done(), { ...t, res: e == null ? void 0 : e.res }), function(t) { return Xe.done(), Promise.reject(t.message); -}), window.addEventListener("unhandledrejection", Vt.onUnhandledRejection), Vt.onMsg = (t, e) => ne[[0, 1].includes(t) ? "success" : "error"](e).then(() => t === 20300 && te.redirect(ze.get("Common.WEBSITE_LOGIN_PAGE"))); -var He, Ue, Je; +}), window.addEventListener("unhandledrejection", Vt.onUnhandledRejection), Vt.onMsg = (t, e) => Se[[0, 1].includes(t) ? "success" : "error"](e).then(() => t === 20300 && ke.redirect(Ue.get("Common.WEBSITE_LOGIN_PAGE"))); +var He, ze, Je; const Z = class Z { constructor() { O(this, "appUrl", ""); v(this, He, null); - return d(Z, Ue) || (_(Z, Je, new Vt()), _(Z, Ue, new Proxy(this, { get(e, n) { + return d(Z, ze) || (_(Z, Je, new Vt()), _(Z, ze, 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]; } return d(Z, Je)[n]; - } }))), d(Z, Ue); + } }))), d(Z, ze); } init(e, n, i) { Le.defaults.baseURL = this.appUrl = i, Le.defaults.timeout = 15e3, d(Z, Je).init(e, n, Le); @@ -1071,9 +1071,9 @@ const Z = class Z { (e = d(this, He)) == null || e.restore(), _(this, He, null); } }; -He = new WeakMap(), Ue = new WeakMap(), Je = new WeakMap(), v(Z, Ue), v(Z, Je), O(Z, "getInstance", () => d(Z, Ue) ?? _(Z, Ue, new Z())); +He = new WeakMap(), ze = new WeakMap(), Je = new WeakMap(), v(Z, ze), v(Z, Je), O(Z, "getInstance", () => d(Z, ze) ?? _(Z, ze, new Z())); let Ht = Z; -const U = Ht.getInstance(); +const z = Ht.getInstance(); class on extends Error { constructor(e, n) { super(n), Error.captureStackTrace && Error.captureStackTrace(this, on), !n instanceof Qe && (this.name = `${e} Error Runtime`); @@ -1086,7 +1086,7 @@ class Qe extends Error { } const It = "mine", yt = "token", At = "user-login-intended-url"; var Ie, Ge, ot; -const we = class we { +const fe = class fe { constructor() { v(this, Ge, /* @__PURE__ */ new Map()); v(this, ot, (/* @__PURE__ */ new Date()).toISOString().slice(0, 10)); @@ -1110,16 +1110,16 @@ const we = class we { const [, n] = e == null ? void 0 : e.split("@pkg/"); if (!n) throw new Qe(e); try { - return d(this, Ge).has("pkg") ? await d(this, Ge).get("pkg").get(n) : await import(`${U.appUrl}/api/pkg-import/web?name=${e}&v=${d(this, ot)}`); + return d(this, Ge).has("pkg") ? await d(this, Ge).get("pkg").get(n) : await import(`${z.appUrl}/api/pkg-import/web?name=${e}&v=${d(this, ot)}`); } catch (i) { throw new on(e, i); } }); - O(this, "getRoutes", () => U.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))); - O(this, "getMenus", () => U.get("/api/my-menu")); - O(this, "getConfigure", () => U.get("api/init-configure")); - O(this, "getWidgetOperationAuth", () => U.get("/api/init-widget-operation-auth").then((e) => e.reduce((n, { uuid: i, auth: r }) => [...n, [i, r]], []))); - O(this, "getPhoneNumber", (e) => U.get(`/api/user-wx-phone-number/${e}`)); + O(this, "getRoutes", () => z.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))); + O(this, "getMenus", () => z.get("/api/my-menu")); + O(this, "getConfigure", () => z.get("api/init-configure")); + O(this, "getWidgetOperationAuth", () => z.get("/api/init-widget-operation-auth").then((e) => e.reduce((n, { uuid: i, auth: r }) => [...n, [i, r]], []))); + O(this, "getPhoneNumber", (e) => z.get(`/api/user-wx-phone-number/${e}`)); O(this, "getUserToken", () => { const e = window.localStorage.getItem(yt); if (!e) return ""; @@ -1141,14 +1141,14 @@ const we = class we { 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 } = U.decode(window.localStorage.getItem(It) || "", {}); - return o === r ? Promise.resolve(a) : U.get("/api/mine-info").then(({ User: s = null }) => (window.localStorage.setItem(It, U.encode({ ...s, iat: r })), s)).catch((s) => (console.error(s), e && ne.error("请登录").then(this.logout), null)); + const { iat: r } = JSON.parse(window.atob((n = i == null ? void 0 : i.split(".")) == null ? void 0 : n[1])), { iat: o, ...a } = z.decode(window.localStorage.getItem(It) || "", {}); + return o === r ? Promise.resolve(a) : z.get("/api/mine-info").then(({ User: s = null }) => (window.localStorage.setItem(It, z.encode({ ...s, iat: r })), s)).catch((s) => (console.error(s), e && Se.error("请登录").then(this.logout), null)); } catch (i) { - console.error(i), e && ne.error("请登录").then(this.logout); + console.error(i), e && Se.error("请登录").then(this.logout); } return Promise.resolve(null); }); - O(this, "login", (e, n, i = {}) => U.post("/api/user-token", { username: e, passwd: Li.hash(n), platform: "web", ...i }).then(({ token: r }) => (window.localStorage.setItem(yt, r), r)).then(async (r) => (await this.initAppEnv(), r))); + O(this, "login", (e, n, i = {}) => z.post("/api/user-token", { username: e, passwd: Li.hash(n), platform: "web", ...i }).then(({ token: r }) => (window.localStorage.setItem(yt, r), r)).then(async (r) => (await this.initAppEnv(), r))); O(this, "setLoginIntendedUrl", (e) => sessionStorage.setItem(At, e)); O(this, "getLoginIntendedUrl", (e = !1) => { const n = sessionStorage.getItem(At); @@ -1157,14 +1157,14 @@ const we = class we { O(this, "logout", (e) => (window.localStorage.removeItem(It), window.localStorage.removeItem(yt), e == null ? void 0 : e())); O(this, "initAppEnv", async () => { const [e, n, i, r] = await Promise.all([this.getWidgetOperationAuth(), this.getRoutes(), this.getMenus(), this.getConfigure()]); - return Mn.init(e), ze.init(r), te.init(n, i), Ct.init(ze.get("Common.ICONFONT")), { widgetOperationAuth: e, routes: n, menus: i, configures: r }; + return Mn.init(e), Ue.init(r), ke.init(n, i), Ct.init(Ue.get("Common.ICONFONT")), { widgetOperationAuth: e, routes: n, menus: i, configures: r }; }); - if (d(we, Ie)) return d(we, Ie); + if (d(fe, Ie)) return d(fe, Ie); } }; -Ie = new WeakMap(), Ge = new WeakMap(), ot = new WeakMap(), v(we, Ie, null), O(we, "getInstance", () => (d(we, Ie) || _(we, Ie, new we()), d(we, Ie))); -let Jt = we; -const re = Jt.getInstance(), Bo = x.createContext({ user: {}, initUser: () => { +Ie = new WeakMap(), Ge = new WeakMap(), ot = new WeakMap(), v(fe, Ie, null), O(fe, "getInstance", () => (d(fe, Ie) || _(fe, Ie, new fe()), d(fe, Ie))); +let Jt = fe; +const ne = Jt.getInstance(), Bo = x.createContext({ user: {}, initUser: () => { }, initUserComplete: !1 }), Wo = x.createContext({ set: () => { }, get: () => { }, assign: () => { @@ -1182,7 +1182,7 @@ const re = Jt.getInstance(), Bo = x.createContext({ user: {}, initUser: () => { 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); }; -var Pe, Ye, ve, Ce, ke, oe, ee, G, Se, at, st, lt, ct, Et, dt; +var Pe, Ye, ve, we, be, ie, ee, G, Ce, at, st, lt, ct, Et, dt; const an = class an { constructor(e, n = "/") { v(this, Pe, "/"); @@ -1194,7 +1194,7 @@ const an = class an { console.error("Error in VirtualFS event listener:", i); } }); - v(this, Ce, (e) => { + v(this, we, (e) => { const n = Date.now(); if (e && (e.lastModified = n), d(this, Pe) != "/") { const i = d(this, G).call(this, d(this, Pe)); @@ -1202,22 +1202,22 @@ const an = class an { } this.root.lastModified = n; }); - v(this, ke, (e) => { - let n = ge.normalize(e); + v(this, be, (e) => { + let n = ue.normalize(e); return n.startsWith("/") || (n = "/" + n), n.length > 1 && n.endsWith("/") && (n = n.slice(0, -1)), n; }); - v(this, oe, (e) => { - const n = ge.join(d(this, Pe), e); - return d(this, ke).call(this, n); + v(this, ie, (e) => { + const n = ue.join(d(this, Pe), e); + return d(this, be).call(this, n); }); v(this, ee, (e) => { if (!e || typeof e != "string") return !1; - const n = d(this, ke).call(this, e); + const n = d(this, be).call(this, e); return !n.includes("..") && n.startsWith("/"); }); v(this, G, (e) => { var o; - const n = d(this, ke).call(this, e); + const n = d(this, be).call(this, e); if (n === "/") return this.root; const i = n.split("/").filter((a) => a); let r = this.root; @@ -1229,11 +1229,11 @@ const an = class an { } return r; }); - v(this, Se, (e) => { - const n = d(this, ke).call(this, e), i = ge.basename(n), r = ge.dirname(n); + v(this, Ce, (e) => { + const n = d(this, be).call(this, e), i = ue.basename(n), r = ue.dirname(n); return { parent: d(this, G).call(this, r), name: i }; }); - v(this, at, (e, n, i) => i === !1 ? e : i === "root" ? e.map((r) => ge.join(n, r)) : i === !0 || i === "working" ? e.map((r) => ge.relative(d(this, Pe), ge.join(n, r))) : e); + v(this, at, (e, n, i) => i === !1 ? e : i === "root" ? e.map((r) => ue.join(n, r)) : i === !0 || i === "working" ? e.map((r) => ue.relative(d(this, Pe), ue.join(n, r))) : e); v(this, st, async (e, n, i, r = "") => { const o = [], a = d(this, G).call(this, e); if (!a || a.type !== "dir") return o; @@ -1260,7 +1260,7 @@ const an = class an { const u = await d(this, Et).call(this, e, c); o.push(...u); } else { - const u = ge.join(e, c), p = d(this, ke).call(this, u); + const u = ue.join(e, c), p = d(this, be).call(this, u); d(this, G).call(this, p) && o.push(c); } return o; @@ -1302,14 +1302,14 @@ const an = class an { _(this, Pe, 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, oe).call(this, e); + const n = d(this, ie).call(this, e); if (!d(this, ee).call(this, n)) throw new Error(`EINVAL: invalid path '${e}'`); const i = d(this, G).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, oe).call(this, e); + const n = d(this, ie).call(this, e); if (!d(this, ee).call(this, n)) throw new Error(`EINVAL: invalid path '${e}'`); const i = d(this, G).call(this, n); if (!i) throw new Error(`ENOENT: no such file or directory, scandir '${e}'`); @@ -1317,7 +1317,7 @@ const an = class an { return i.children.map((r) => r.name); } async readFile(e) { - const n = d(this, oe).call(this, e); + const n = d(this, ie).call(this, e); if (!d(this, ee).call(this, n)) throw new Error(`EINVAL: invalid path '${e}'`); const i = d(this, G).call(this, n); if (!i) throw new Error(`ENOENT: no such file or directory, open '${e}'`); @@ -1325,73 +1325,73 @@ const an = class an { return i.content || ""; } async writeFile(e, n) { - const i = d(this, oe).call(this, e); + const i = d(this, ie).call(this, e); if (!d(this, ee).call(this, i)) throw new Error(`EINVAL: invalid path '${e}'`); - const { parent: r, name: o } = d(this, Se).call(this, i); + const { parent: r, name: o } = d(this, Ce).call(this, i); if (!r) throw new Error(`ENOENT: no such file or directory, open '${e}'`); if (r.type !== "dir") throw new Error("ENOTDIR: not a directory"); const a = r.children.findIndex((c) => c.name === o), s = a >= 0, l = { name: o, type: "file", content: n, lastModified: Date.now() }; - s ? r.children[a] = l : r.children.push(l), d(this, Ce).call(this, r), d(this, ve).call(this, { action: s ? "update" : "create", path: i, type: "file", timestamp: Date.now() }); + s ? r.children[a] = l : r.children.push(l), d(this, we).call(this, r), d(this, ve).call(this, { action: s ? "update" : "create", path: i, type: "file", timestamp: Date.now() }); } async mkdir(e, n = {}) { - const i = d(this, oe).call(this, e); + const i = d(this, ie).call(this, e); if (!d(this, ee).call(this, i)) throw new Error(`EINVAL: invalid path '${e}'`); const { recursive: r } = n; if (r) { const o = i.split("/").filter((s) => s); let a = "/"; for (const s of o) - if (a = ge.join(a, s), !d(this, G).call(this, a)) { - const { parent: l, name: c } = d(this, Se).call(this, a); + if (a = ue.join(a, s), !d(this, G).call(this, a)) { + const { parent: l, name: c } = d(this, Ce).call(this, a); if (l && l.type === "dir") { const u = { name: c, type: "dir", children: [], lastModified: Date.now() }; - l.children.push(u), d(this, Ce).call(this, l), d(this, ve).call(this, { action: "create", path: d(this, ke).call(this, a), type: "dir", timestamp: Date.now() }); + l.children.push(u), d(this, we).call(this, l), d(this, ve).call(this, { action: "create", path: d(this, be).call(this, a), type: "dir", timestamp: Date.now() }); } } } else { - const { parent: o, name: a } = d(this, Se).call(this, i); + const { parent: o, name: a } = d(this, Ce).call(this, i); if (!o) throw new Error(`ENOENT: no such file or directory, mkdir '${e}'`); if (o.type !== "dir") throw new Error("ENOTDIR: not a directory"); if (o.children.find((l) => l.name === a)) throw new Error(`EEXIST: file already exists, mkdir '${e}'`); const s = { name: a, type: "dir", children: [], lastModified: Date.now() }; - o.children.push(s), d(this, Ce).call(this, o), d(this, ve).call(this, { action: "create", path: i, type: "dir", timestamp: Date.now() }); + o.children.push(s), d(this, we).call(this, o), d(this, ve).call(this, { action: "create", path: i, type: "dir", timestamp: Date.now() }); } } async unlink(e) { - const n = d(this, oe).call(this, e); + const n = d(this, ie).call(this, e); if (!d(this, ee).call(this, n)) throw new Error(`EINVAL: invalid path '${e}'`); - const { parent: i, name: r } = d(this, Se).call(this, n); + const { parent: i, name: r } = d(this, Ce).call(this, n); if (!i) throw new Error(`ENOENT: no such file or directory, unlink '${e}'`); const o = i.children.findIndex((a) => a.name === r); if (o < 0) throw new Error(`ENOENT: no such file or directory, unlink '${e}'`); if (i.children[o].type !== "file") throw new Error(`EISDIR: illegal operation on a directory, unlink '${e}'`); - i.children.splice(o, 1), d(this, Ce).call(this, i), d(this, ve).call(this, { action: "delete", path: n, type: "file", timestamp: Date.now() }); + i.children.splice(o, 1), d(this, we).call(this, i), d(this, ve).call(this, { action: "delete", path: n, type: "file", timestamp: Date.now() }); } async rmdir(e, n = {}) { - const i = d(this, oe).call(this, e); + const i = d(this, ie).call(this, e); if (!d(this, ee).call(this, i)) throw new Error(`EINVAL: invalid path '${e}'`); - const { parent: r, name: o } = d(this, Se).call(this, i); + const { parent: r, name: o } = d(this, Ce).call(this, i); if (!r) throw new Error(`ENOENT: no such file or directory, rmdir '${e}'`); const a = r.children.findIndex((l) => l.name === o); if (a < 0) throw new Error(`ENOENT: no such file or directory, rmdir '${e}'`); const s = r.children[a]; if (s.type !== "dir") throw new Error(`ENOTDIR: not a directory, rmdir '${e}'`); if (!n.recursive && s.children.length > 0) throw new Error(`ENOTEMPTY: directory not empty, rmdir '${e}'`); - r.children.splice(a, 1), d(this, Ce).call(this, r), d(this, ve).call(this, { action: "delete", path: i, type: "dir", timestamp: Date.now() }); + r.children.splice(a, 1), d(this, we).call(this, r), d(this, ve).call(this, { action: "delete", path: i, type: "dir", timestamp: Date.now() }); } async rename(e, n) { - const i = d(this, oe).call(this, e), r = d(this, oe).call(this, n); + const i = d(this, ie).call(this, e), r = d(this, ie).call(this, n); if (!d(this, ee).call(this, i)) throw new Error(`EINVAL: invalid path '${e}'`); if (!d(this, ee).call(this, r)) throw new Error(`EINVAL: invalid path '${n}'`); if (!d(this, G).call(this, i)) throw new Error(`ENOENT: no such file or directory, rename '${e}' -> '${n}'`); - const { parent: o, name: a } = d(this, Se).call(this, i), { parent: s, name: l } = d(this, Se).call(this, r); + const { parent: o, name: a } = d(this, Ce).call(this, i), { parent: s, name: l } = d(this, Ce).call(this, r); if (!s) throw new Error(`ENOENT: no such file or directory, rename '${e}' -> '${n}'`); if (d(this, G).call(this, r)) throw new Error(`EEXIST: file already exists, rename '${e}' -> '${n}'`); const c = o.children.findIndex((p) => p.name === a), u = { ...o.children[c], name: l, lastModified: Date.now() }; - o.children.splice(c, 1), s.children.push(u), d(this, Ce).call(this, o), o !== s && d(this, Ce).call(this, s), d(this, ve).call(this, { action: "rename", path: r, oldPath: i, type: u.type, timestamp: Date.now() }); + o.children.splice(c, 1), s.children.push(u), d(this, we).call(this, o), o !== s && d(this, we).call(this, s), d(this, ve).call(this, { action: "rename", path: r, oldPath: i, type: u.type, timestamp: Date.now() }); } async exists(e) { - const n = d(this, oe).call(this, e); + const n = d(this, ie).call(this, e); return d(this, ee).call(this, n) ? d(this, G).call(this, n) !== null : !1; } getLastModified() { @@ -1407,7 +1407,7 @@ const an = class an { return d(this, Pe); } scope(e = "/") { - const n = d(this, ke).call(this, e); + const n = d(this, be).call(this, e); if (!d(this, ee).call(this, n)) throw new Error(`EINVAL: invalid path '${e}'`); const i = d(this, G).call(this, n); if (!i) throw new Error(`ENOENT: no such file or directory '${e}'`); @@ -1415,7 +1415,7 @@ const an = class an { return i.children ?? (i.children = []), i.lastModified ?? (i.lastModified = Date.now()), new an(this.root, n); } async findFiles(e, n, i = {}) { - const r = d(this, oe).call(this, e); + const r = d(this, ie).call(this, e); if (!d(this, ee).call(this, r)) throw new Error(`EINVAL: invalid path '${e}'`); const o = d(this, G).call(this, r); if (!o) throw new Error(`ENOENT: no such file or directory '${e}'`); @@ -1429,11 +1429,11 @@ const an = class an { return d(this, at).call(this, l, r, s); } }; -Pe = new WeakMap(), Ye = new WeakMap(), ve = new WeakMap(), Ce = new WeakMap(), ke = new WeakMap(), oe = new WeakMap(), ee = new WeakMap(), G = new WeakMap(), Se = new WeakMap(), at = new WeakMap(), st = new WeakMap(), lt = new WeakMap(), ct = new WeakMap(), Et = new WeakMap(), dt = new WeakMap(); +Pe = new WeakMap(), Ye = new WeakMap(), ve = new WeakMap(), we = new WeakMap(), be = new WeakMap(), ie = new WeakMap(), ee = new WeakMap(), G = new WeakMap(), Ce = new WeakMap(), at = new WeakMap(), st = new WeakMap(), lt = new WeakMap(), ct = new WeakMap(), Et = new WeakMap(), dt = new WeakMap(); let Rn = an; const io = async (t, e = "/", n = "") => { try { - const i = await t.stat(e), r = e === "/" ? "/" : ge.basename(e), o = { title: r, key: n ? `${n}${e}` : e, isLeaf: i.isFile() }; + const i = await t.stat(e), r = e === "/" ? "/" : ue.basename(e), o = { title: r, key: n ? `${n}${e}` : e, isLeaf: i.isFile() }; if (i.isDirectory()) { const a = await t.dir(e); if (a.length > 0) { @@ -1470,7 +1470,7 @@ export { Po as B, vo as C, bt as D, - zn as E, + Un as E, Bt as F, Oo as G, br as H, @@ -1480,7 +1480,7 @@ export { Pr as L, Ro as M, Fo as N, - ue as O, + ce as O, Nr as P, $t as Q, Kn as R, @@ -1500,14 +1500,14 @@ export { pt as a3, vt as a4, Do as a5, - Uo as a6, + zo as a6, jr as a7, ni as a8, Br as a9, er as aA, - ze as aB, + Ue as aB, Be as aC, - te as aD, + ke as aD, Bo as aE, Wo as aF, Rn as aG, @@ -1522,23 +1522,23 @@ export { Vr as ag, Mr as ah, Dr as ai, - zo as aj, + Uo as aj, Ct as ak, R as al, Mn as am, Hr as an, - ie as ao, + te as ao, ut as ap, Ln as aq, Y as ar, - ne as as, + Se as as, xo as at, Eo as au, $o as av, - re as aw, + ne as aw, si as ax, qo as ay, - U as az, + z as az, Bn as b, No as c, Wn as d, @@ -1557,7 +1557,7 @@ export { mr as q, gr as r, tn as s, - se as t, + oe as t, Cr as u, wr as v, Er as w, diff --git a/dist/components.js b/dist/components.js index 5ff0baa..0844719 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-ChLfL4hx.js"; +import { at as s, ak as p, au as r, av as t, as as e, aI as n } from "./common/main-uvtyIdqt.js"; export { s as Empty, p as Icon, diff --git a/dist/container.js b/dist/container.js index 4dc5113..d9b492a 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-ChLfL4hx.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-uvtyIdqt.js"; export { s as Context, e as Empty, diff --git a/dist/data-converter.js b/dist/data-converter.js index 5e2bcb4..1882cb9 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-ChLfL4hx.js"; +import { D as i } from "./common/main-uvtyIdqt.js"; import "react-use"; export { i as default diff --git a/dist/data-list.js b/dist/data-list.js index 54e4f83..7ab4159 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-ChLfL4hx.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-uvtyIdqt.js"; export { t as DataListContent, e as DataListContext, diff --git a/dist/data-list/utils.js b/dist/data-list/utils.js index f6c78fd..70a2ccf 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-ChLfL4hx.js"; +import { f as a } from "../common/main-uvtyIdqt.js"; export { a as getDefaultExpandRowKeys }; diff --git a/dist/grid-layout-form.js b/dist/grid-layout-form.js index 5b4b855..519f535 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-ChLfL4hx.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-uvtyIdqt.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 ccb968e..4b4e90b 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-ChLfL4hx.js"; +import { a as o, g } from "../common/main-uvtyIdqt.js"; export { o as getNormalizeWidget, g as getOptionItemByValue diff --git a/dist/grid-layout.js b/dist/grid-layout.js index 698b0b1..58d55b3 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-ChLfL4hx.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-uvtyIdqt.js"; export { u as GridLayout, e as GridLayoutFramework, diff --git a/dist/grid-layout/utils.js b/dist/grid-layout/utils.js index b12ab1a..faf5e1f 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-ChLfL4hx.js"; +import { b as a, d as o, e as s, c as g } from "../common/main-uvtyIdqt.js"; export { a as getBoxStyle, o as getEventProps, diff --git a/dist/hooks.js b/dist/hooks.js index ee98d35..e713baa 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-ChLfL4hx.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-uvtyIdqt.js"; import { default as b } from "rc-util/lib/hooks/useMergedState"; import { a as x } from "./common/vender-C5RbewOc.js"; export { diff --git a/dist/iconfont.js b/dist/iconfont.js index cc630d7..35415a6 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-ChLfL4hx.js"; +import { ak as a } from "./common/main-uvtyIdqt.js"; export { a as default }; diff --git a/dist/index.js b/dist/index.js index b30ca60..54fcd1d 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-ChLfL4hx.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-uvtyIdqt.js"; export { t as AppContext, e as AppGlobalParamsContext, diff --git a/dist/pages.js b/dist/pages.js index e53e5c4..80d018d 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-ChLfL4hx.js"; +import { L as t, K as e, M as o, N as g } from "./common/main-uvtyIdqt.js"; export { t as CustomPage, e as DataListPage, diff --git a/dist/res-ws.js b/dist/res-ws.js index 0102fa6..23101f4 100644 --- a/dist/res-ws.js +++ b/dist/res-ws.js @@ -1,5 +1,5 @@ import "lodash"; -import { R as a } from "./common/main-ChLfL4hx.js"; +import { R as a } from "./common/main-uvtyIdqt.js"; export { a as default }; diff --git a/dist/utils.js b/dist/utils.js index 267729f..c9c25b6 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-ChLfL4hx.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-uvtyIdqt.js"; import "./common/vender-C5RbewOc.js"; export { r as deepSome, diff --git a/dist/virtual-fs.js b/dist/virtual-fs.js index 2e476b3..98e50ca 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-ChLfL4hx.js"; +import { aG as o, aH as r } from "./common/main-uvtyIdqt.js"; export { o as default, r as toTreePaths diff --git a/package.json b/package.json index cb6cec7..4add489 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "ff", "private": true, - "version": "0.7.5", + "version": "0.7.6", "author": "www.fsdpf.com", "type": "module", "main": "./dist/index.js",