diff --git a/dist/button.js b/dist/button.js index 88c613f..8f1a8d6 100644 --- a/dist/button.js +++ b/dist/button.js @@ -1,4 +1,4 @@ -import { aj as s, ai as u, ak as e } from "./common/main-ROZ7DqNn.js"; +import { aj as s, ai as u, ak as e } from "./common/main-BEaQ6Xnt.js"; export { s as auth, u as default, diff --git a/dist/common/main-ROZ7DqNn.js b/dist/common/main-BEaQ6Xnt.js similarity index 53% rename from dist/common/main-ROZ7DqNn.js rename to dist/common/main-BEaQ6Xnt.js index 308de2e..9130ab9 100644 --- a/dist/common/main-ROZ7DqNn.js +++ b/dist/common/main-BEaQ6Xnt.js @@ -1,115 +1,115 @@ -var Vn = Object.defineProperty; +var In = Object.defineProperty; var zt = (e) => { throw TypeError(e); }; -var In = (e, t, n) => t in e ? Vn(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n; -var N = (e, t, n) => In(e, typeof t != "symbol" ? t + "" : t, n), Bt = (e, t, n) => t.has(e) || zt("Cannot " + n); -var y = (e, t, n) => (Bt(e, t, "read from private field"), n ? n.call(e) : t.get(e)), j = (e, t, n) => t.has(e) ? zt("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, n), U = (e, t, n, a) => (Bt(e, t, "write to private field"), a ? a.call(e, n) : t.set(e, n), n); +var Mn = (e, t, n) => t in e ? In(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n; +var $ = (e, t, n) => Mn(e, typeof t != "symbol" ? t + "" : t, n), Bt = (e, t, n) => t.has(e) || zt("Cannot " + n); +var y = (e, t, n) => (Bt(e, t, "read from private field"), n ? n.call(e) : t.get(e)), A = (e, t, n) => t.has(e) ? zt("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, n), U = (e, t, n, a) => (Bt(e, t, "write to private field"), a ? a.call(e, n) : t.set(e, n), n); var Wt = (e, t, n, a) => ({ - set _(r) { - U(e, t, r, n); + set _(i) { + U(e, t, i, n); }, get _() { return y(e, t, a); } }); import { jsx as u, jsxs as O } from "react/jsx-runtime"; -import S, { useEffect as I, useState as A, useCallback as G, useRef as K, useContext as ie, useMemo as q, useId as yt, isValidElement as Mn, useLayoutEffect as zn } from "react"; +import S, { useEffect as I, useState as j, useCallback as G, useRef as K, useContext as re, useMemo as q, useId as wt, isValidElement as zn, useLayoutEffect as Bn } from "react"; import b from "prop-types"; import F from "classnames"; import * as Dt from "react-is"; -import { useNotification as Bn } from "rc-notification"; +import { useNotification as Wn } from "rc-notification"; import m from "lodash"; import Z, { Field as Rt, FieldContext as en } from "rc-field-form"; -import { M as pt, N as Le, a as Ve, _ as wt, S as Wn } from "./vender-FNiQWFaA.js"; +import { M as mt, N as Ve, a as Ie, _ as bt, S as Dn } from "./vender-FNiQWFaA.js"; import tn from "immutability-helper"; -import { Space as Dn, Form as et, Input as Un, Button as nt, Pagination as qn, Tree as _n, Breadcrumb as Kn, Table as Hn, Empty as Jn, Popover as Gn, Popconfirm as Yn, Tooltip as Xn } from "antd"; -import { useMergedState as Qn } from "rc-util"; -import { generatePath as Zn, useInRouterContext as nn, useParams as ea, useLocation as ta, createBrowserRouter as na, Navigate as aa } from "react-router-dom"; +import { Space as Un, Form as et, Input as qn, Button as nt, Pagination as _n, Tree as Kn, Breadcrumb as Hn, Table as Jn, Empty as Gn, Popover as Yn, Popconfirm as Xn, Tooltip as Qn } from "antd"; +import { useMergedState as Zn } from "rc-util"; +import { generatePath as ea, useInRouterContext as nn, useParams as ta, useLocation as na, createBrowserRouter as aa, Navigate as ia } from "react-router-dom"; import "rc-util/lib/hooks/useMergedState"; import ra from "rc-drawer"; -import ia from "rc-dialog"; -var Fe, ze, Re, ue, xe, Pe; +import oa from "rc-dialog"; +var Re, ze, Oe, ue, ve, Pe; class an { constructor(t, n) { - j(this, Fe, /* @__PURE__ */ new Map()); - j(this, ze, !0); - j(this, Re, []); - j(this, ue); - j(this, xe, () => y(this, ue)); - j(this, Pe, () => Promise.resolve()); - N(this, "get", (...t) => new Promise((n, a) => { - const r = JSON.stringify(t); - if (y(this, Fe).has(r)) return n(y(this, Pe).call(this, y(this, ue), ...t)); - if (y(this, ue) === void 0) y(this, Re).push([t, n, a]), y(this, ze) && (U(this, ze, !1), Promise.resolve(typeof y(this, xe) == "function" ? y(this, xe).call(this) : y(this, xe)).then((i) => U(this, ue, i || null)).finally(() => { - y(this, Re).forEach(([i, o, s]) => { + A(this, Re, /* @__PURE__ */ new Map()); + A(this, ze, !0); + A(this, Oe, []); + A(this, ue); + A(this, ve, () => y(this, ue)); + A(this, Pe, () => Promise.resolve()); + $(this, "get", (...t) => new Promise((n, a) => { + const i = JSON.stringify(t); + if (y(this, Re).has(i)) return n(y(this, Pe).call(this, y(this, ue), ...t)); + if (y(this, ue) === void 0) y(this, Oe).push([t, n, a]), y(this, ze) && (U(this, ze, !1), Promise.resolve(typeof y(this, ve) == "function" ? y(this, ve).call(this) : y(this, ve)).then((r) => U(this, ue, r || null)).finally(() => { + y(this, Oe).forEach(([r, o, s]) => { try { - const l = y(this, Pe).call(this, y(this, ue), ...i); - y(this, Fe).set(JSON.stringify(i), l), o(l); + const l = y(this, Pe).call(this, y(this, ue), ...r); + y(this, Re).set(JSON.stringify(r), l), o(l); } catch (l) { s(l); } - }), y(this, Re).length = 0; + }), y(this, Oe).length = 0; })); else { - const i = y(this, Pe).call(this, y(this, ue), ...t); - y(this, Fe).set(r, i), n(i); + const r = y(this, Pe).call(this, y(this, ue), ...t); + y(this, Re).set(i, r), n(r); } })); - U(this, Pe, n), U(this, xe, t); + U(this, Pe, n), U(this, ve, t); } } -Fe = new WeakMap(), ze = new WeakMap(), Re = new WeakMap(), ue = new WeakMap(), xe = new WeakMap(), Pe = new WeakMap(); -const Pr = () => u("div", { children: "Empty" }), _e = S.createContext({ ele: {}, mount: () => { +Re = new WeakMap(), ze = new WeakMap(), Oe = new WeakMap(), ue = new WeakMap(), ve = new WeakMap(), Pe = new WeakMap(); +const Pi = () => u("div", { children: "Empty" }), _e = S.createContext({ ele: {}, mount: () => { }, unmount: () => { -} }), J = ({ rootClassName: e, className: t, children: n, actions: a, title: r, subTitle: i, extras: o, style: s = {} }) => { +} }), J = ({ rootClassName: e, className: t, children: n, actions: a, title: i, subTitle: r, extras: o, style: s = {} }) => { const { mount: l, unmount: d } = S.useContext(_e); - return J.Action({ children: a }), J.Title({ children: r }), J.SubTitle({ children: i }), J.Extra({ children: o }), I(() => (l("rootClassName", e), () => d(e)), [e]), u("div", { className: F("ff-container", t), style: s, children: n }); + return J.Action({ children: a }), J.Title({ children: i }), J.SubTitle({ children: r }), J.Extra({ children: o }), I(() => (l("rootClassName", e), () => d(e)), [e]), u("div", { className: F("ff-container", t), style: s, children: n }); }, Ze = (e) => ({ children: t, className: n }) => { - const { mount: a, unmount: r } = S.useContext(_e); - return I(() => (t && a(e, S.createElement("div", { key: `ff-${e}`, className: F(`ff-popup-${e}`, n) }, t)), () => r(e)), [n, t]), null; + const { mount: a, unmount: i } = S.useContext(_e); + return I(() => (t && a(e, S.createElement("div", { key: `ff-${e}`, className: F(`ff-popup-${e}`, n) }, t)), () => i(e)), [n, t]), null; }; J.Action = Ze("actions"), J.Title = Ze("title"), J.SubTitle = Ze("sub-title"), J.Extra = Ze("extras"), J.propTypes = { className: b.string, style: b.object, title: b.any, subTitle: b.any, actions: b.any, extras: b.any }; -const $r = () => u(J, { className: "ff-loading", children: O("div", { className: "loader", children: [O("div", { className: "square", children: [u("span", {}), u("span", {}), u("span", {})] }), O("div", { className: "square", children: [u("span", {}), u("span", {}), u("span", {})] }), O("div", { className: "square", children: [u("span", {}), u("span", {}), u("span", {})] }), O("div", { className: "square", children: [u("span", {}), u("span", {}), u("span", {})] })] }) }), Nr = () => u("div", { children: "NotFound" }), rn = ({ children: e }) => { - const [t, n] = A({}), a = G((i, o) => n((s) => ({ ...s, [i]: o })), []), r = G((i) => n((o) => ({ ...o, [i]: void 0 })), []); - return typeof (e == null ? void 0 : e.type) == "string" ? e : u(_e.Provider, { value: { ele: t, mount: a, unmount: r }, children: S.cloneElement(e, { className: t.rootClassName, title: t.title, subTitle: t["sub-title"], actions: t.actions, extras: t.extras }) }); +const $i = () => u(J, { className: "ff-loading", children: O("div", { className: "loader", children: [O("div", { className: "square", children: [u("span", {}), u("span", {}), u("span", {})] }), O("div", { className: "square", children: [u("span", {}), u("span", {}), u("span", {})] }), O("div", { className: "square", children: [u("span", {}), u("span", {}), u("span", {})] }), O("div", { className: "square", children: [u("span", {}), u("span", {}), u("span", {})] })] }) }), Ni = () => u("div", { children: "NotFound" }), rn = ({ children: e }) => { + const [t, n] = j({}), a = G((r, o) => n((s) => ({ ...s, [r]: o })), []), i = G((r) => n((o) => ({ ...o, [r]: void 0 })), []); + return typeof (e == null ? void 0 : e.type) == "string" ? e : u(_e.Provider, { value: { ele: t, mount: a, unmount: i }, children: S.cloneElement(e, { className: t.rootClassName, title: t.title, subTitle: t["sub-title"], actions: t.actions, extras: t.extras }) }); }; rn.propTypes = { children: b.element.isRequired }; -const Ut = { 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"] }, Ot = ({ type: e, props: t }) => u("i", { ...t, children: u("svg", { viewBox: "0 0 1024 1024", width: "1em", height: "1em", fill: "currentColor", children: (Ut[e] || Ut.info).map((n, a) => u("path", { d: n }, a)) }) }), on = ({ className: e, content: t, icon: n, $close: a }) => O(S.Fragment, { children: [n && u("div", { className: F("ff-notification-icon", e), children: u(Ot, { type: n }) }), t] }), oa = ({}) => u(J, { children: "Confirm" }); -var me, Oe; +const Ut = { 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"] }, Ot = ({ type: e, props: t }) => u("i", { ...t, children: u("svg", { viewBox: "0 0 1024 1024", width: "1em", height: "1em", fill: "currentColor", children: (Ut[e] || Ut.info).map((n, a) => u("path", { d: n }, a)) }) }), on = ({ className: e, content: t, icon: n, $close: a }) => O(S.Fragment, { children: [n && u("div", { className: F("ff-notification-icon", e), children: u(Ot, { type: n }) }), t] }), sa = ({}) => u(J, { children: "Confirm" }); +var he, Ee; const oe = class oe { constructor() { - j(this, Oe, /* @__PURE__ */ new Map()); - N(this, "init", (t) => U(this, Oe, new Map(t))); - N(this, "check", (t) => !y(this, Oe).has(t) || y(this, Oe).get(t)); - if (y(oe, me)) return y(oe, me); + A(this, Ee, /* @__PURE__ */ new Map()); + $(this, "init", (t) => U(this, Ee, new Map(t))); + $(this, "check", (t) => !y(this, Ee).has(t) || y(this, Ee).get(t)); + if (y(oe, he)) return y(oe, he); } }; -me = new WeakMap(), Oe = new WeakMap(), j(oe, me, null), N(oe, "getInstance", () => (y(oe, me) || U(oe, me, new oe()), y(oe, me))); -let bt = oe; -const sa = bt.getInstance(), la = (e, t, n = "children") => { +he = new WeakMap(), Ee = new WeakMap(), A(oe, he, null), $(oe, "getInstance", () => (y(oe, he) || U(oe, he, new oe()), y(oe, he))); +let Ct = oe; +const sn = Ct.getInstance(), la = (e, t, n = "children") => { if (m.isEmpty(e)) return {}; const a = m.find(e, ["value", t]); if (!m.isEmpty(a)) return a; - const r = e.length; - for (let i = 0; i < r; i++) { - const { [n]: o } = e[i], s = la(o, t, n); + const i = e.length; + for (let r = 0; r < i; r++) { + const { [n]: o } = e[r], s = la(o, t, n); if (!m.isEmpty(s)) return s; } return {}; -}, sn = (e = "Input", t = "@pkg/ff/grid-layout-forms") => e != null && e.startsWith("@") || e != null && e.startsWith("blob:") ? e : `${t}/${e}`; -var he, Be; +}, ln = (e = "Input", t = "@pkg/ff/grid-layout-forms") => e != null && e.startsWith("@") || e != null && e.startsWith("blob:") ? e : `${t}/${e}`; +var fe, Be; const se = class se { constructor() { - j(this, Be, null); - N(this, "init", (t) => U(this, Be, t)); - N(this, "get", (t, n) => m.get(y(this, Be), t, n)); - if (y(se, he)) return y(se, he); + A(this, Be, null); + $(this, "init", (t) => U(this, Be, t)); + $(this, "get", (t, n) => m.get(y(this, Be), t, n)); + if (y(se, fe)) return y(se, fe); } }; -he = new WeakMap(), Be = new WeakMap(), j(se, he, null), N(se, "getInstance", () => (y(se, he) || U(se, he, new se()), y(se, he))); -let Ct = se; -const Ie = Ct.getInstance(), qt = { null2json: (e) => Object.create(), null2array: (e) => [], null2number: (e) => 0, null2bool: (e) => !1, null2string: (e) => "", null2integer: (e) => 0, null2float: (e) => 0, string2json: (e) => e ? JSON.parse(e) : "{}", string2array: (e) => e.substr(0, 1) === "[" && e.substr(-1) === "]" ? JSON.parse(e) : e.split(","), string2number: (e) => e == "" ? 0 : +e, string2integer: (e) => e == "" ? 0 : +e, string2float: (e) => e == "" ? 0 : +e, string2bool: (e) => { +fe = new WeakMap(), Be = new WeakMap(), A(se, fe, null), $(se, "getInstance", () => (y(se, fe) || U(se, fe, new se()), y(se, fe))); +let kt = se; +const Te = kt.getInstance(), qt = { null2json: (e) => Object.create(), null2array: (e) => [], null2number: (e) => 0, null2bool: (e) => !1, null2string: (e) => "", null2integer: (e) => 0, null2float: (e) => 0, string2json: (e) => e ? JSON.parse(e) : "{}", string2array: (e) => e.substr(0, 1) === "[" && e.substr(-1) === "]" ? JSON.parse(e) : e.split(","), string2number: (e) => e == "" ? 0 : +e, string2integer: (e) => e == "" ? 0 : +e, string2float: (e) => e == "" ? 0 : +e, string2bool: (e) => { switch (`${e}`.toLowerCase()) { case "0": case "false": @@ -123,16 +123,16 @@ const Ie = Ct.getInstance(), qt = { null2json: (e) => Object.create(), null2arra n = Array.isArray(e) ? "array" : typeof e, m.isObject(e) && (n = "json"); const a = `${n}2${t}`; return Reflect.has(qt, a) ? qt[a](e) : e; -}, ca = (e) => e === null ? "null" : Array.isArray(e) ? "array" : typeof e == "object" ? "json" : typeof e == "boolean" ? "bool" : typeof e == "string" ? "string" : typeof e == "number" ? Number.isInteger(e) ? "integer" : "float" : typeof e, Ke = (e = {}, t = {}, n = {}, a = "") => ln(e, (r, i) => i === "type" && r === "code") ? cn(e, t, n, a) : dn(e, t, a), ln = (e, t = () => !1) => m.some(e, (n) => !!m.some(n, t) || (m.isEmpty(n) || !m.isPlainObject(n) && !m.isArray(n) ? void 0 : ln(n, t))), cn = async (e = {}, t = {}, n = {}, a = "") => { - let r = /* @__PURE__ */ Object.create(null); - for (let i in e) { +}, ca = (e) => e === null ? "null" : Array.isArray(e) ? "array" : typeof e == "object" ? "json" : typeof e == "boolean" ? "bool" : typeof e == "string" ? "string" : typeof e == "number" ? Number.isInteger(e) ? "integer" : "float" : typeof e, Ke = (e = {}, t = {}, n = {}, a = "") => cn(e, (i, r) => r === "type" && i === "code") ? dn(e, t, n, a) : un(e, t, a), cn = (e, t = () => !1) => m.some(e, (n) => !!m.some(n, t) || (m.isEmpty(n) || !m.isPlainObject(n) && !m.isArray(n) ? void 0 : cn(n, t))), dn = async (e = {}, t = {}, n = {}, a = "") => { + let i = /* @__PURE__ */ Object.create(null); + for (let r in e) { let o; - if (Reflect.has(e[i], "type") && ["code", "field", "router", "query", "string"].includes(e[i].type)) { - const { type: s, value: l = "", default: d = a } = e[i]; + if (Reflect.has(e[r], "type") && ["code", "field", "router", "query", "string"].includes(e[r].type)) { + const { type: s, value: l = "", default: d = a } = e[r]; switch (s) { case "code": try { - o = await ve.exec(l, t, n); + o = await xe.exec(l, t, n); } catch (c) { console.error("getWidgetPropsData", c); } @@ -142,60 +142,60 @@ const Ie = Ct.getInstance(), qt = { null2json: (e) => Object.create(), null2arra break; case "router": case "query": - o = Se.getPageParams(l); + o = pe.getPageParams(l); break; case "string": o = l; } o ?? (o = d); - } else o = await cn(e[i], t, n, a); - m.set(r, i, o); + } else o = await dn(e[r], t, n, a); + m.set(i, r, o); } - return r; -}, dn = (e = {}, t = {}, n = "") => Object.keys(e || {}).reduce((a, r) => { - if (m.isPlainObject(e[r])) { - let i; - if (Reflect.has(e[r], "type") && ["field", "router", "query", "string"].includes(e[r].type)) { - const { type: o, value: s = "", default: l = n } = e[r]; + return i; +}, un = (e = {}, t = {}, n = "") => Object.keys(e || {}).reduce((a, i) => { + if (m.isPlainObject(e[i])) { + let r; + if (Reflect.has(e[i], "type") && ["field", "router", "query", "string"].includes(e[i].type)) { + const { type: o, value: s = "", default: l = n } = e[i]; switch (o) { case "field": - i = m.get(t, s) ?? m.get(t, s.substring(s.indexOf(".") + 1)); + r = m.get(t, s) ?? m.get(t, s.substring(s.indexOf(".") + 1)); break; case "router": case "query": - i = Se.getPageParams(s); + r = pe.getPageParams(s); break; case "string": - i = s; + r = s; } - i ?? (i = l); - } else i = dn(e[r], t, n); - m.set(a, r, i); + r ?? (r = l); + } else r = un(e[i], t, n); + m.set(a, i, r); } return a; -}, {}), mt = (e, t) => e && typeof e == "object" ? Array.isArray(e) ? e.map((n) => mt(n, t)) : Object.keys(e).reduce((n, a) => (t[a] ? n[t[a]] = mt(e[a], t) : n[a] = mt(e[a], t), n), {}) : e, Tr = () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (e) => { +}, {}), ht = (e, t) => e && typeof e == "object" ? Array.isArray(e) ? e.map((n) => ht(n, t)) : Object.keys(e).reduce((n, a) => (t[a] ? n[t[a]] = ht(e[a], t) : n[a] = ht(e[a], t), n), {}) : e, Ti = () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (e) => { const t = 16 * Math.random() | 0; return (e === "x" ? t : 3 & t | 8).toString(16); -}), Fr = (e) => { +}), Fi = (e) => { var t, n; return e ? (n = (t = e.match(/^@pkg(?:[^\/]*\/){3}(?[^\/]+)/)) == null ? void 0 : t.groups) == null ? void 0 : n.name : ""; -}, Rr = (e) => { +}, Ri = (e) => { var t, n; return e ? (n = (t = e.match(/^@pkg(?:[^\/]*\/){2}(?[^\/]+)/)) == null ? void 0 : t.groups) == null ? void 0 : n.category : ""; -}, Or = (e) => { +}, Oi = (e) => { var t, n; return e ? (n = (t = e.match(/^@pkg(?:[^\/]*\/){1}(?[^\/]+)/)) == null ? void 0 : t.groups) == null ? void 0 : n.owner : ""; }, da = (e, t = 32, n = "auto") => { - const a = kt(e), r = n === "auto" ? "x64" : n; - if (t === 32) return pt.x86.hash32(a).toString(); - if (t === 128) return r === "x64" ? pt.x64.hash128(a) : pt.x86.hash128(a); + const a = St(e), i = n === "auto" ? "x64" : n; + if (t === 32) return mt.x86.hash32(a).toString(); + if (t === 128) return i === "x64" ? mt.x64.hash128(a) : mt.x86.hash128(a); throw new Error("bits 只能是 32 或 128"); -}, kt = (e) => e == null ? "null" : typeof e == "string" ? e : typeof e == "number" || typeof e == "boolean" ? String(e) : typeof e == "function" ? e.toString() : Array.isArray(e) ? "[" + e.map(kt).join(",") + "]" : typeof e == "object" ? "{" + Object.keys(e).sort().map((t) => `${t}:${kt(e[t])}`).join(",") + "}" : String(e), ua = () => { +}, St = (e) => e == null ? "null" : typeof e == "string" ? e : typeof e == "number" || typeof e == "boolean" ? String(e) : typeof e == "function" ? e.toString() : Array.isArray(e) ? "[" + e.map(St).join(",") + "]" : typeof e == "object" ? "{" + Object.keys(e).sort().map((t) => `${t}:${St(e[t])}`).join(",") + "}" : String(e), ua = () => { let e = 1; const t = /* @__PURE__ */ new WeakMap(), n = /* @__PURE__ */ new Map(); - return (...a) => a.length === 0 ? "" : a.map((r) => { - return String((i = r) === null || typeof i != "object" && typeof i != "function" ? (n.has(i) || n.set(i, e++), n.get(i)) : (t.has(i) || t.set(i, e++), t.get(i))); - var i; + return (...a) => a.length === 0 ? "" : a.map((i) => { + return String((r = i) === null || typeof r != "object" && typeof r != "function" ? (n.has(r) || n.set(r, e++), n.get(r)) : (t.has(r) || t.set(r, e++), t.get(r))); + var r; }).join("::"); }, ga = (e) => { if (!e || typeof e != "string" || e.startsWith("/") || e.startsWith("./") || e.startsWith("../")) return !1; @@ -205,54 +205,54 @@ const Ie = Ct.getInstance(), qt = { null2json: (e) => Object.create(), null2arra } catch { return !1; } -}, Er = (e, t = "") => { +}, Ei = (e, t = "") => { if (!e || typeof e != "string" || ga(e)) return e; let n = t; return !n && typeof window < "u" && window.location && (n = `${window.location.protocol}//${window.location.host}`), e.startsWith("/") ? n ? `${n}${e}` : e : n ? `${n}/${e}` : e; }; -var rt, We, De, it; -const ot = class ot { +var rt, We, De, ot; +const st = class st { constructor(...t) { - j(this, We, []); - j(this, De, (t) => { + A(this, We, []); + A(this, De, (t) => { var n; - for (let a of t) Array.isArray(a[0]) ? y(this, De).call(this, a) : y(this, We).push(y(n = ot, rt).call(n, a[0], a[1])); + for (let a of t) Array.isArray(a[0]) ? y(this, De).call(this, a) : y(this, We).push(y(n = st, rt).call(n, a[0], a[1])); }); - N(this, "toValue", async (t, n = null) => { + $(this, "toValue", async (t, n = null) => { const a = { getValue: () => t, getRecord: () => n }; - let r = t; - for (const i of y(this, We)) try { - const o = await i; + let i = t; + for (const r of y(this, We)) try { + const o = await r; if (typeof o != "function") { console.warn("middleware is not a function, skip:", o); continue; } - r = await o.call(a, r); + i = await o.call(a, i); } catch (o) { console.error("middleware error, skip:", o); } - return r; + return i; }); - N(this, "toRender", (t, n, a = null) => S.createElement(y(this, it), { value: t, record: n }, a)); - j(this, it, ({ value: t, record: n, children: a }) => { - const [r, i] = A(a); + $(this, "toRender", (t, n, a = null) => S.createElement(y(this, ot), { value: t, record: n }, a)); + A(this, ot, ({ value: t, record: n, children: a }) => { + const [i, r] = j(a); return Je(() => { let o = !1; - return i(a), this.toValue(t, n).then((s) => !o && i(s)).catch((s) => !o && i(`${s}`)), () => o = !0; - }, [t, n]), r; + return r(a), this.toValue(t, n).then((s) => !o && r(s)).catch((s) => !o && r(`${s}`)), () => o = !0; + }, [t, n]), i; }); y(this, De).call(this, t); } }; -rt = new WeakMap(), We = new WeakMap(), De = new WeakMap(), it = new WeakMap(), j(ot, rt, m.memoize((t, n) => { +rt = new WeakMap(), We = new WeakMap(), De = new WeakMap(), ot = new WeakMap(), A(st, rt, m.memoize((t, n) => { if (typeof t == "function") return t(n); - if (typeof t == "string") return re.getWidgetComponent(t).then((a) => { - var r; - return ((r = a.default) == null ? void 0 : r.call(a, n)) || ((i) => i); + if (typeof t == "string") return ie.getWidgetComponent(t).then((a) => { + var i; + return ((i = a.default) == null ? void 0 : i.call(a, n)) || ((r) => r); }); throw new TypeError("middleware must be a string or a function"); }, ua())); -let at = ot; +let at = st; const ee = S.createContext({ listCode: "", classNames: {}, getBase62params: (e, t) => { }, onReload: () => { }, onClickCallback: () => { @@ -271,112 +271,112 @@ const ee = S.createContext({ listCode: "", classNames: {}, getBase62params: (e, }, setCondition: () => { } }), _t = ({ className: e, record: t, column: n, ...a }) => { if (n != null && n.editableByJs && (n != null && n.uuid)) { - const { formSetting: r = { primaryKey: "id" }, widgetSetting: i = {}, widgetContainerSetting: o = {} } = (n == null ? void 0 : n.editableByJsSetting) || {}; - return u($.Popover, { widget: pa, widgetData: { record: t, column: n }, widgetSetting: { widgetSetting: i, formSetting: r }, widgetContainerProps: { title: n != null && n.title ? `${n.title} - 编辑` : "编辑", ...o, width: (o == null ? void 0 : o.width) || 260, arrow: !0 }, children: u("td", { className: F("ff-data-list-cell-editable", e), ...a }) }); + const { formSetting: i = { primaryKey: "id" }, widgetSetting: r = {}, widgetContainerSetting: o = {} } = (n == null ? void 0 : n.editableByJsSetting) || {}; + return u(N.Popover, { widget: pa, widgetData: { record: t, column: n }, widgetSetting: { widgetSetting: r, formSetting: i }, widgetContainerProps: { title: n != null && n.title ? `${n.title} - 编辑` : "编辑", ...o, width: (o == null ? void 0 : o.width) || 260, arrow: !0 }, children: u("td", { className: F("ff-data-list-cell-editable", e), ...a }) }); } return u("td", { className: e, ...a }); }, pa = ({ record: e, column: t, $close: n, $setting: a }) => { - const r = K(ca(m.get(e, t == null ? void 0 : t.dataIndex))), { listCode: i, onClickCallback: o } = ie(ee), [s] = Z.useForm(), { formSetting: l, widgetSetting: d } = a, c = (l == null ? void 0 : l.primaryKey) || "id", g = () => { + const i = K(ca(m.get(e, t == null ? void 0 : t.dataIndex))), { listCode: r, onClickCallback: o } = re(ee), [s] = Z.useForm(), { formSetting: l, widgetSetting: d } = a, c = (l == null ? void 0 : l.primaryKey) || "id", g = () => { s.setFieldsValue({ value: m.get(e, t == null ? void 0 : t.dataIndex), __PROPS__: e }); }; - return Je(() => g(), [e, t == null ? void 0 : t.dataIndex, i]), u(J, { actions: O(S.Fragment, { children: [u($, { size: "small", onClick: g, children: "重置" }), O(Dn.Compact, { block: !0, children: [u($, { size: "small", widget: n, children: "取消" }), u($, { type: "primary", size: "small", widget: () => s.validateFields().then(({ value: h }) => { + return Je(() => g(), [e, t == null ? void 0 : t.dataIndex, r]), u(J, { actions: O(S.Fragment, { children: [u(N, { size: "small", onClick: g, children: "重置" }), O(Un.Compact, { block: !0, children: [u(N, { size: "small", widget: n, children: "取消" }), u(N, { type: "primary", size: "small", widget: () => s.validateFields().then(({ value: h }) => { const p = m.get(e, c.substring(c.indexOf(".") + 1)); if (!p) throw "获取更新主键失败!"; - V.put(`/api/${i}-storeBy-${t == null ? void 0 : t.uuid}/${p}`, { value: h }).msg(() => o(2, e)).then(n); - }).catch(console.warn), children: "保存" })] })] }), children: O(Z, { form: s, children: [u(At, { label: "", type: r.current, code: "value", widget: t == null ? void 0 : t.editableByJs, extras: d }), u(Rt, { noStyle: !0, name: ["__PROPS__"], children: () => { + V.put(`/api/${r}-storeBy-${t == null ? void 0 : t.uuid}/${p}`, { value: h }).msg(() => o(2, e)).then(n); + }).catch(console.warn), children: "保存" })] })] }), children: O(Z, { form: s, children: [u(jt, { label: "", type: i.current, code: "value", widget: t == null ? void 0 : t.editableByJs, extras: d }), u(Rt, { noStyle: !0, name: ["__PROPS__"], children: () => { } })] }) }); }, ma = (e) => function(t) { return e(t, getRecord()); }, ha = (e, t = {}) => q(() => { var n; - return (n = e == null ? void 0 : e.filter(Boolean)) == null ? void 0 : n.map(({ widgetByJs: a, widgetByJsSetting: r, ...i }, o) => { - const s = (d) => ({ record: d, column: i }); + return (n = e == null ? void 0 : e.filter(Boolean)) == null ? void 0 : n.map(({ widgetByJs: a, widgetByJsSetting: i, ...r }, o) => { + const s = (d) => ({ record: d, column: r }); let l = []; - return a && l.push([a, r]), l.length > 0 ? (i != null && i.render && l.push([ma, i.render]), { ...i, onCell: s, render: (d, c) => new at(l).toRender(d, c, "-") }) : { ...i, onCell: s }; + return a && l.push([a, i]), l.length > 0 ? (r != null && r.render && l.push([ma, r.render]), { ...r, onCell: s, render: (d, c) => new at(l).toRender(d, c, "-") }) : { ...r, onCell: s }; }); }, [e, t]), fa = (e = {}) => q(() => { var t; return e.body ?? (e.body = { cell: _t }), (t = e.body).cell ?? (t.cell = _t), e; -}, [e]), jr = (e) => { - const [t, n] = A({}); +}, [e]), Ai = (e) => { + const [t, n] = j({}); return I(() => { let a = !1; - return e && V.get(`/api/_/${e}`).then((r) => m.pick(r, ["uuid", "name", "code", "resource", "marginX", "marginY", "cols", "rowHeight", "primaryKey", "columns", "itemOperations", "batchOperations", "isConditionFormLayout", "layout", "tabs", "pageSize", "layoutConfig"])).then((r) => !a && n(r)), () => a = !0; + return e && V.get(`/api/_/${e}`).then((i) => m.pick(i, ["uuid", "name", "code", "resource", "marginX", "marginY", "cols", "rowHeight", "primaryKey", "columns", "itemOperations", "batchOperations", "isConditionFormLayout", "layout", "tabs", "pageSize", "layoutConfig"])).then((i) => !a && n(i)), () => a = !0; }, [e]), t; -}, Ar = (e, t = {}) => { - const [n, a] = A({ dataSource: [] }); +}, ji = (e, t = {}) => { + const [n, a] = j({ dataSource: [] }); return He(() => { - let r = !1; - return e && V.get(`/api/${e}/${V.encode({ page: 1, ...t })}`).then((i) => !r && a(i)), () => r = !0; + let i = !1; + return e && V.get(`/api/${e}/${V.encode({ page: 1, ...t })}`).then((r) => !i && a(r)), () => i = !0; }, [e, t]), n; -}, un = (e = [], t = /* @__PURE__ */ new Map(), n = "id", a) => { - const r = G(a ? (i) => m.get(i, n, m.get(i, [a, n])) : (i) => m.get(i, n), [n, a]); - return G((i) => e == null ? void 0 : e.filter((o) => !o.uuid || !t.has(o.uuid) || t.get(o.uuid).some((s) => s == r(i))), [e, t, r]); -}, St = (e = [], t = /* @__PURE__ */ new Map(), n = [], a = "id", r) => { - const i = G(r ? (o) => m.get(o, a, m.get(o, [r, a])) : (o) => m.get(o, a), [a, r]); +}, gn = (e = [], t = /* @__PURE__ */ new Map(), n = "id", a) => { + const i = G(a ? (r) => m.get(r, n, m.get(r, [a, n])) : (r) => m.get(r, n), [n, a]); + return G((r) => e == null ? void 0 : e.filter((o) => !o.uuid || !t.has(o.uuid) || t.get(o.uuid).some((s) => s == i(r))), [e, t, i]); +}, xt = (e = [], t = /* @__PURE__ */ new Map(), n = [], a = "id", i) => { + const r = G(i ? (o) => m.get(o, a, m.get(o, [i, a])) : (o) => m.get(o, a), [a, i]); return q(() => { - if (m.isEmpty(e) || !e.some(({ uuid: s }) => sa.check(s))) return !1; + if (m.isEmpty(e) || !e.some(({ uuid: s }) => sn.check(s))) return !1; if (m.isEmpty(t) || m.isEmpty(n)) return !0; - const o = n.map((s) => i(s)); + const o = n.map((s) => r(s)); return e.some(({ uuid: s }) => !s || !t.has(s) || t.get(s).some((l) => o.some((d) => d == l))); - }, [e, n, t, i]); + }, [e, n, t, r]); }, ya = (e, t, n = "id", a = null) => { - const r = ct(), i = K(!1), o = K(e.dataSource), s = K(e.itemOperationsAccess); - return I(() => (o.current = e.dataSource, s.current = e.itemOperationsAccess, () => i.current = !1), [e.dataSource, e.itemOperationsAccess]), i.current && (e.dataSource = o.current, e.itemOperationsAccess = s.current), [e, (l = 0, d = null) => { + const i = dt(), r = K(!1), o = K(e.dataSource), s = K(e.itemOperationsAccess); + return I(() => (o.current = e.dataSource, s.current = e.itemOperationsAccess, () => r.current = !1), [e.dataSource, e.itemOperationsAccess]), r.current && (e.dataSource = o.current, e.itemOperationsAccess = s.current), [e, (l = 0, d = null) => { var c, g; - if (i.current = !1, l === 1) return (c = e.onReload) == null ? void 0 : c.call(e); + if (r.current = !1, l === 1) return (c = e.onReload) == null ? void 0 : c.call(e); if (l === 2) { const h = m.get(d, "__PARENT_ID__", ""), p = m.get(d, n, m.get(d, [a, n], "")), f = m.findIndex(o.current, ["__PARENT_ID__", h]), w = m.findIndex(f > -1 ? m.get(o.current, [f, "children"]) : o.current, [n, p]); if (w === -1) return (g = e.onReload) == null ? void 0 : g.call(e); Promise.all([V.get(`/api/${t}/detail/${p}`), V.post(`/api/${t}/list-operations-access`, { ids: p })]).then(([C, k]) => { - const x = m.get(o.current, f > -1 ? [f, "children", w, "children"] : [w, "children"]); - o.current = tn(o.current, f > -1 ? { [f]: { children: { $splice: [[w, 1, { ...C, children: x }]] } } } : { $splice: [[w, 1, { ...C, children: x }]] }); - const v = new Map(k); + const v = m.get(o.current, f > -1 ? [f, "children", w, "children"] : [w, "children"]); + o.current = tn(o.current, f > -1 ? { [f]: { children: { $splice: [[w, 1, { ...C, children: v }]] } } } : { $splice: [[w, 1, { ...C, children: v }]] }); + const x = new Map(k); s.current.forEach((T, R) => { var E; - (E = v.get(R)) != null && E.some((M) => M == p) || s.current.set(R, T.filter((M) => M !== p)); - }), v.forEach((T, R) => { + (E = x.get(R)) != null && E.some((M) => M == p) || s.current.set(R, T.filter((M) => M !== p)); + }), x.forEach((T, R) => { s.current.has(R) ? s.current.set(R, m.uniq([...s.current.get(R) || [], ...T])) : s.current.set(R, T); }); }).then(() => { - i.current = !0, r(); + r.current = !0, i(); }); } }]; }, wa = (e, t) => { - const n = ct(), a = K(t), r = K(/* @__PURE__ */ new Map()), i = K([]), o = m.throttle((l) => { - i.current = [], V.list(e, m.pick({ ...a.current, ...l }, ["tab", "page", "pageSize", "condition", "sider", "keyword"])).then(({ keyword: d, condition: c, total: g, tab: h, sider: p, page: f, pageSize: w, operationsAccess: C, dataSource: k }) => { - a.current = { tab: h, condition: c, sider: p, keyword: d, total: g, pageSize: w, page: k != null && k.length ? f : 1 }, i.current = k, r.current = new Map(C), n(); + const n = dt(), a = K(t), i = K(/* @__PURE__ */ new Map()), r = K([]), o = m.throttle((l) => { + r.current = [], V.list(e, m.pick({ ...a.current, ...l }, ["tab", "page", "pageSize", "condition", "sider", "keyword"])).then(({ keyword: d, condition: c, total: g, tab: h, sider: p, page: f, pageSize: w, operationsAccess: C, dataSource: k }) => { + a.current = { tab: h, condition: c, sider: p, keyword: d, total: g, pageSize: w, page: k != null && k.length ? f : 1 }, r.current = k, i.current = new Map(C), n(); }); }, 380, { leading: !1, trailing: !0 }); Je(() => { - i.current = [], e && o(t); + r.current = [], e && o(t); }, [e, t]); const s = q(() => m.pick(a.current, ["total", "tab", "page", "pageSize", "condition", "sider", "keyword"]), [a.current]); - return Object.assign(s, { onTabChange: (l) => o({ tab: l, page: 1 }), onPageChange: (l, d) => o({ page: l, pageSize: d }), onPageSizeChange: (l) => o({ pageSize: l, page: 1 }), onConditionChange: (l, d) => o({ keyword: d, condition: tn(a.current.condition || {}, { $merge: l || {} }), page: 1 }), onSiderChange: (l) => o({ sider: l, page: 1 }), onKeywordChange: (l) => o({ keyword: l, page: 1 }), itemOperationsAccess: r.current, dataSource: i.current, onReload: o, payload: t == null ? void 0 : t.payload }); -}, ba = ({ listCode: e, className: t, layouts: n = {}, dataSource: a, isPaginate: r, isItemOperations: i, isBatchOperations: o, batchOperations: s, itemOperations: l, itemOperationsAccess: d, resource: c, primaryKey: g, title: h, itemGridLayout: p, $setting: f, tabs: w, isConditionFormLayout: C, isTreeSider: k, treeSiderConfig: x }) => { - const { classNames: v, onClickCallback: T } = ie(ee), R = m.pick(f, ["column", "colWidth", "beforeRender", "afterRender", "style"]), E = un(l, d, g, c), M = G((z, L, B) => u(Ca, { className: F("ff-data-list-framework-item", v.item), operations: i ? E(L) : [], data: c ? { [c]: L } : L, children: z, onClickCallback: T }), [c, g, i, T, l, d]); - return O("div", { className: F("ff-data-list-framework", t), children: [u(n.sider, { isTreeSider: k, ...x }), O("div", { className: F("ff-data-list-container", v == null ? void 0 : v.container), children: [u(n.filter, { isConditionFormLayout: C }), u(n.toolbar, { title: h, tabs: w }), u(ja, { ...R, ...p, primaryKey: g, itemRender: M, dataSource: a }), u(n.footer, { isPaginate: r, isOperations: o, operations: s })] })] }); -}, Ca = ({ className: e, operations: t, children: n, data: a, onClickCallback: r }) => O("div", { className: F("data-list-grid-layout-item", e), children: [u("div", { className: "data-list-grid-layout-item-container", children: n }), !!(t != null && t.length) && u("div", { className: "data-list-grid-layout-item-actions", children: t.map((i) => u("span", { className: "data-list-grid-layout-item-action", children: u($.Link, { uuid: i.uuid, type: i.type, name: i.name, widget: i.widget, widgetType: i.widgetType, widgetProps: i.widgetProps, widgetSetting: i.widgetSetting, widgetContainerProps: i.widgetContainerSetting, data: a, confirm: i.confirm, onAfterClick: (o) => o !== !1 && (r == null ? void 0 : r(i.isRefresh, a)) }, i.uuid || yt()) }, (i == null ? void 0 : i.uuid) || yt())) })] }), ka = ({ listCode: e, className: t, layouts: n = {}, dataSource: a, columns: r, isItemOperations: i, isBatchOperations: o, batchOperations: s, itemOperations: l, itemOperationsAccess: d, resource: c, primaryKey: g, title: h, tabs: p, isPaginate: f, isTreeSider: w, treeSiderConfig: C, isConditionFormLayout: k, ...x }) => { - const { classNames: v, onClickCallback: T } = ie(ee), R = un(l, d, g, c), E = St(l, d, a, g, c); - return O("div", { className: F("ff-data-table-framework", t), children: [u(n.sider, { isTreeSider: w, ...C }), O("div", { className: F("ff-data-table-container", v == null ? void 0 : v.container), children: [u(n.filter, { isConditionFormLayout: k }), u(n.toolbar, { title: h, tabs: p }), u(Na, { ...x, primaryKey: g, className: "ff-data-table-content", columns: r, dataSource: a, operationRender: E ? (M) => { + return Object.assign(s, { onTabChange: (l) => o({ tab: l, page: 1 }), onPageChange: (l, d) => o({ page: l, pageSize: d }), onPageSizeChange: (l) => o({ pageSize: l, page: 1 }), onConditionChange: (l, d) => o({ keyword: d, condition: tn(a.current.condition || {}, { $merge: l || {} }), page: 1 }), onSiderChange: (l) => o({ sider: l, page: 1 }), onKeywordChange: (l) => o({ keyword: l, page: 1 }), itemOperationsAccess: i.current, dataSource: r.current, onReload: o, payload: t == null ? void 0 : t.payload }); +}, ba = ({ listCode: e, className: t, layouts: n = {}, dataSource: a, isPaginate: i, isItemOperations: r, isBatchOperations: o, batchOperations: s, itemOperations: l, itemOperationsAccess: d, resource: c, primaryKey: g, title: h, itemGridLayout: p, $setting: f, tabs: w, isConditionFormLayout: C, isTreeSider: k, treeSiderConfig: v }) => { + const { classNames: x, onClickCallback: T } = re(ee), R = m.pick(f, ["column", "colWidth", "beforeRender", "afterRender", "style"]), E = gn(l, d, g, c), M = G((z, L, B) => u(Ca, { className: F("ff-data-list-framework-item", x.item), operations: r ? E(L) : [], data: c ? { [c]: L } : L, children: z, onClickCallback: T }), [c, g, r, T, l, d]); + return O("div", { className: F("ff-data-list-framework", t), children: [u(n.sider, { isTreeSider: k, ...v }), O("div", { className: F("ff-data-list-container", x == null ? void 0 : x.container), children: [u(n.filter, { isConditionFormLayout: C }), u(n.toolbar, { title: h, tabs: w }), u(Aa, { ...R, ...p, primaryKey: g, itemRender: M, dataSource: a }), u(n.footer, { isPaginate: i, isOperations: o, operations: s })] })] }); +}, Ca = ({ className: e, operations: t, children: n, data: a, onClickCallback: i }) => O("div", { className: F("data-list-grid-layout-item", e), children: [u("div", { className: "data-list-grid-layout-item-container", children: n }), !!(t != null && t.length) && u("div", { className: "data-list-grid-layout-item-actions", children: t.map((r) => u("span", { className: "data-list-grid-layout-item-action", children: u(N.Link, { uuid: r.uuid, type: r.type, name: r.name, widget: r.widget, widgetType: r.widgetType, widgetProps: r.widgetProps, widgetSetting: r.widgetSetting, widgetContainerProps: r.widgetContainerSetting, data: a, confirm: r.confirm, onAfterClick: (o) => o !== !1 && (i == null ? void 0 : i(r.isRefresh, a)) }, r.uuid || wt()) }, (r == null ? void 0 : r.uuid) || wt())) })] }), ka = ({ listCode: e, className: t, layouts: n = {}, dataSource: a, columns: i, isItemOperations: r, isBatchOperations: o, batchOperations: s, itemOperations: l, itemOperationsAccess: d, resource: c, primaryKey: g, title: h, tabs: p, isPaginate: f, isTreeSider: w, treeSiderConfig: C, isConditionFormLayout: k, ...v }) => { + const { classNames: x, onClickCallback: T } = re(ee), R = gn(l, d, g, c), E = xt(l, d, a, g, c); + return O("div", { className: F("ff-data-table-framework", t), children: [u(n.sider, { isTreeSider: w, ...C }), O("div", { className: F("ff-data-table-container", x == null ? void 0 : x.container), children: [u(n.filter, { isConditionFormLayout: k }), u(n.toolbar, { title: h, tabs: p }), u(Na, { ...v, primaryKey: g, className: "ff-data-table-content", columns: i, dataSource: a, operationRender: E ? (M) => { var z; - return u("div", { className: "ff-data-table-actions", children: (z = R(M)) == null ? void 0 : z.map((L, B) => u($.Link, { size: "small", uuid: L.uuid, type: L.type, name: L.name, widget: L.widget, widgetType: L.widgetType, widgetProps: L.widgetProps, widgetData: L.widgetData, widgetSetting: L.widgetSetting, widgetContainerProps: L.widgetContainerSetting, data: M, confirm: L.confirm, onAfterClick: (P) => P !== !1 && (T == null ? void 0 : T(L.isRefresh, M)) }, L.uuid || B)) }); + return u("div", { className: "ff-data-table-actions", children: (z = R(M)) == null ? void 0 : z.map((L, B) => u(N.Link, { size: "small", uuid: L.uuid, type: L.type, name: L.name, widget: L.widget, widgetType: L.widgetType, widgetProps: L.widgetProps, widgetData: L.widgetData, widgetSetting: L.widgetSetting, widgetContainerProps: L.widgetContainerSetting, data: M, confirm: L.confirm, onAfterClick: (P) => P !== !1 && (T == null ? void 0 : T(L.isRefresh, M)) }, L.uuid || B)) }); } : null }), u(n.footer, { isPaginate: f, isOperations: o, operations: s })] })] }); }, Et = (e = [], t, n = null) => { var a; - return (a = m.sortBy(e, ["y", "x"])) == null ? void 0 : a.map(({ i: r, x: i, y: o, w: s, h: l, field: { boxStyle: d, ...c } = {} }, g) => u("div", { className: "grid-layout-item", style: gn(i, o, s, l, d), children: u(t, { ...c, basicForm: n }) }, r ?? g)); -}, gn = (e, t, n, a, r = {}, i = 0) => { + return (a = m.sortBy(e, ["y", "x"])) == null ? void 0 : a.map(({ i, x: r, y: o, w: s, h: l, field: { boxStyle: d, ...c } = {} }, g) => u("div", { className: "grid-layout-item", style: pn(r, o, s, l, d), children: u(t, { ...c, basicForm: n }) }, i ?? g)); +}, pn = (e, t, n, a, i = {}, r = 0) => { const o = { "--grid-layout-h": `${a}`, "--grid-layout-w": `${n}`, "--grid-layout-x": `${e}`, "--grid-layout-y": `${t}`, "--grid-layout-row-height-offset": "0px" }; - return r != null && r.autoHeight ? o.height = "fit-content" : o["--grid-layout-row"] = `${a}`, r != null && r.alignItems && (o["--grid-layout-box-align-items"] = r.alignItems), r != null && r.justifyContent && (o["--grid-layout-box-justify-content"] = r.justifyContent), o["--grid-layout-box-margin"] = Kt(r == null ? void 0 : r.marginTop, r == null ? void 0 : r.marginRight, r == null ? void 0 : r.marginBottom, r == null ? void 0 : r.marginLeft), o["--grid-layout-box-padding"] = Kt(r == null ? void 0 : r.paddingTop, r == null ? void 0 : r.paddingRight, r == null ? void 0 : r.paddingBottom, r == null ? void 0 : r.paddingLeft), i && (o.height = `${i}px`), o; -}, Kt = (e, t, n, a) => `${e || 0}px ${t || 0}px ${n || 0}px ${a || 0}px`, Lr = (e = "Text", t = "@pkg/ff/grid-layouts") => e != null && e.startsWith("@") || e != null && e.startsWith("blob:") ? e : `${t}/${e}`, pn = ({ className: e, isConditionFormLayout: t }) => { + return i != null && i.autoHeight ? o.height = "fit-content" : o["--grid-layout-row"] = `${a}`, i != null && i.alignItems && (o["--grid-layout-box-align-items"] = i.alignItems), i != null && i.justifyContent && (o["--grid-layout-box-justify-content"] = i.justifyContent), o["--grid-layout-box-margin"] = Kt(i == null ? void 0 : i.marginTop, i == null ? void 0 : i.marginRight, i == null ? void 0 : i.marginBottom, i == null ? void 0 : i.marginLeft), o["--grid-layout-box-padding"] = Kt(i == null ? void 0 : i.paddingTop, i == null ? void 0 : i.paddingRight, i == null ? void 0 : i.paddingBottom, i == null ? void 0 : i.paddingLeft), r && (o.height = `${r}px`), o; +}, Kt = (e, t, n, a) => `${e || 0}px ${t || 0}px ${n || 0}px ${a || 0}px`, Li = (e = "Text", t = "@pkg/ff/grid-layouts") => e != null && e.startsWith("@") || e != null && e.startsWith("blob:") ? e : `${t}/${e}`, mn = ({ className: e, isConditionFormLayout: t }) => { var h, p; - const [n, a] = A({}), { listCode: r, onKeywordChange: i, onConditionChange: o, getBase62params: s, classNames: l } = S.useContext(ee), { keyword: d, condition: c } = (s == null ? void 0 : s()) || {}, [g] = et.useForm(); + const [n, a] = j({}), { listCode: i, onKeywordChange: r, onConditionChange: o, getBase62params: s, classNames: l } = S.useContext(ee), { keyword: d, condition: c } = (s == null ? void 0 : s()) || {}, [g] = et.useForm(); return I(() => { - r && t && V.get(`/api/_/${r}/list-condition-form-layout`).then(({ resource: f, marginX: w, marginY: C, rowHeight: k, cols: x, fields: v }) => { - a({ resource: f, itemMargin: [w, C], rowHeight: k, cols: x, fields: v }); + i && t && V.get(`/api/_/${i}/list-condition-form-layout`).then(({ resource: f, marginX: w, marginY: C, rowHeight: k, cols: v, fields: x }) => { + a({ resource: f, itemMargin: [w, C], rowHeight: k, cols: v, fields: x }); }).catch(() => a({})); - }, [r, t]), I(() => { + }, [i, t]), I(() => { g.setFieldsValue({ keyword: d, ...c }); }, [JSON.stringify([d, c])]), u("div", { className: F("ff-data-list-filter", l.filter, e), children: u(et, { form: g, layout: "vertical", autoComplete: "off", onFinish: ((h = n.fields) == null ? void 0 : h.length) > 1 ? (f) => o({ [n.resource]: f[n.resource] }, f.keyword) : () => { }, onValuesChange: (f) => { @@ -384,350 +384,350 @@ const ee = S.createContext({ listCode: "", classNames: {}, getBase62params: (e, }, children: ((p = n.fields) == null ? void 0 : p.length) > 1 ? u(Lt, { ...n, children: u(Sa, { onReset: () => { const { keyword: f, condition: w } = s("init") || {}; g.setFieldsValue({ keyword: f, ...w }); - } }) }) : u("div", { className: "ff-data-list-filter-default-form ff-grid-layout-form", children: u("div", { className: "grid-layout-item", style: gn(20, 0, 5, 2), children: u(et.Item, { name: ["keyword"], children: u(Un.Search, { allowClear: !0, enterButton: "搜索", placeholder: "多关键字 | 分割", onSearch: (f) => i(f) }) }) }) }) }) }); + } }) }) : u("div", { className: "ff-data-list-filter-default-form ff-grid-layout-form", children: u("div", { className: "grid-layout-item", style: pn(20, 0, 5, 2), children: u(et.Item, { name: ["keyword"], children: u(qn.Search, { allowClear: !0, enterButton: "搜索", placeholder: "多关键字 | 分割", onSearch: (f) => r(f) }) }) }) }) }) }); }, Sa = ({ cols: e, fields: t, onReset: n }) => { - const [a, r] = A(!1), i = q(() => t == null ? void 0 : t.toReversed().some((o) => o.y > 1 || o.x + o.w >= e - 5), [e, t]); - return O(et.Item, { label: " ", style: { "--item-span": 5 }, className: F("ff-data-list-filter-actions", { expanded: a }), children: [u(nt, { onClick: n, children: "重置" }), u(nt, { type: "primary", htmlType: "submit", children: "查询" }), i && u($.Link, { className: "ff-data-list-filter-expanded-button", widget: () => r((o) => !o), type: "primary", name: a ? "关闭" : "展开", icon: a ? "icon-up" : "icon-down", iconPosition: "end" })] }); + const [a, i] = j(!1), r = q(() => t == null ? void 0 : t.toReversed().some((o) => o.y > 1 || o.x + o.w >= e - 5), [e, t]); + return O(et.Item, { label: " ", style: { "--item-span": 5 }, className: F("ff-data-list-filter-actions", { expanded: a }), children: [u(nt, { onClick: n, children: "重置" }), u(nt, { type: "primary", htmlType: "submit", children: "查询" }), r && u(N.Link, { className: "ff-data-list-filter-expanded-button", widget: () => i((o) => !o), type: "primary", name: a ? "关闭" : "展开", icon: a ? "icon-up" : "icon-down", iconPosition: "end" })] }); }; -pn.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 va = ({ className: e, operations: t, isOperations: n, isPaginate: a }) => { - const { onPageChange: r, onPageSizeChange: i, onClickCallback: o, getBase62params: s } = S.useContext(ee), { total: l, page: d, pageSize: c } = (s == null ? void 0 : s()) || {}; - return n && !m.isEmpty(t) || a ? O("div", { className: F("ff-data-list-footer", e), children: [u("div", { className: "ff-data-list-actions", children: t == null ? void 0 : t.map((g, h) => u($, { uuid: g.uuid, type: g.type, name: g.name, widget: g.widget, widgetType: g.widgetType, widgetProps: g.widgetProps, widgetData: g.widgetData, widgetSetting: g.widgetSetting, widgetContainerProps: g.widgetContainerSetting, onAfterClick: (p) => p !== !1 && (o == null ? void 0 : o(g.isRefresh, null)) }, g.uuid || h)) }), a && u(qn, { size: "small", total: l, pageSize: c, showSizeChanger: !1, showTotal: (g) => `第 ${d} 页 / 总共 ${g} 条`, onChange: r, onShowSizeChange: i })] }) : null; -}, xa = [{ 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: u("span", { style: { color: "#1677ff" }, children: "sss" }), key: "0-0-1-0" }] }] }], Pa = ({ className: e, width: t = 280, isTreeSider: n }) => { - const { classNames: a } = ie(ee); - return n ? u(_n.DirectoryTree, { className: F("ff-data-list-sider", a.sider, e), style: { "--sider-width": t }, showLine: !0, showIcon: !1, treeData: xa }) : null; +mn.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 xa = ({ className: e, operations: t, isOperations: n, isPaginate: a }) => { + const { onPageChange: i, onPageSizeChange: r, onClickCallback: o, getBase62params: s } = S.useContext(ee), { total: l, page: d, pageSize: c } = (s == null ? void 0 : s()) || {}; + return n && !m.isEmpty(t) || a ? O("div", { className: F("ff-data-list-footer", e), children: [u("div", { className: "ff-data-list-actions", children: t == null ? void 0 : t.map((g, h) => u(N, { uuid: g.uuid, type: g.type, name: g.name, widget: g.widget, widgetType: g.widgetType, widgetProps: g.widgetProps, widgetData: g.widgetData, widgetSetting: g.widgetSetting, widgetContainerProps: g.widgetContainerSetting, onAfterClick: (p) => p !== !1 && (o == null ? void 0 : o(g.isRefresh, null)) }, g.uuid || h)) }), a && u(_n, { size: "small", total: l, pageSize: c, showSizeChanger: !1, showTotal: (g) => `第 ${d} 页 / 总共 ${g} 条`, onChange: i, onShowSizeChange: r })] }) : null; +}, va = [{ 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: u("span", { style: { color: "#1677ff" }, children: "sss" }), key: "0-0-1-0" }] }] }], Pa = ({ className: e, width: t = 280, isTreeSider: n }) => { + const { classNames: a } = re(ee); + return n ? u(Kn.DirectoryTree, { className: F("ff-data-list-sider", a.sider, e), style: { "--sider-width": t }, showLine: !0, showIcon: !1, treeData: va }) : null; }, $a = ({ className: e, title: t, tabs: n }) => { - const { getBase62params: a, onTabChange: r, onReload: i, classNames: o } = ie(ee), { tab: s } = (a == null ? void 0 : a()) || {}, [l, d] = Qn((n == null ? void 0 : n[0].value) ?? (n == null ? void 0 : n[0].code), { value: s, onChange: r }); - return O("div", { className: F("ff-data-list-toolbar", o.toolbar, e), children: [u("div", { className: "ff-data-list-title", children: t }), u(Kn, { className: "ff-data-list-tabs", itemRender: ({ label: c, code: g, value: h }) => u("span", { onClick: () => d(h ?? g), className: F("ff-data-list-tab", { active: (h ?? g) == l }), children: c }), items: n }), O("div", { className: "ff-data-list-actions", children: [u($.Link, { icon: "icon-reload", widget: () => i() }), u($.Link, { icon: "icon-setting" })] })] }); -}, mn = ({ isItemGridLayout: e, theme: t, themeProps: n, onClickCallback: a, onReload: r, listCode: i, total: o = 0, page: s = 0, onPageChange: l, pageSize: d = 30, onPageSizeChange: c, tab: g, onTabChange: h, keyword: p, onKeywordChange: f, condition: w, onConditionChange: C, sider: k, onSiderChange: x, layouts: v, classNames: T = {}, payload: R = {}, ...E }) => { - const [M, z] = A(), L = G((P, _) => { + const { getBase62params: a, onTabChange: i, onReload: r, classNames: o } = re(ee), { tab: s } = (a == null ? void 0 : a()) || {}, [l, d] = Zn((n == null ? void 0 : n[0].value) ?? (n == null ? void 0 : n[0].code), { value: s, onChange: i }); + return O("div", { className: F("ff-data-list-toolbar", o.toolbar, e), children: [u("div", { className: "ff-data-list-title", children: t }), u(Hn, { className: "ff-data-list-tabs", itemRender: ({ label: c, code: g, value: h }) => u("span", { onClick: () => d(h ?? g), className: F("ff-data-list-tab", { active: (h ?? g) == l }), children: c }), items: n }), O("div", { className: "ff-data-list-actions", children: [u(N.Link, { icon: "icon-reload", widget: () => r() }), u(N.Link, { icon: "icon-setting" })] })] }); +}, hn = ({ isItemGridLayout: e, theme: t, themeProps: n, onClickCallback: a, onReload: i, listCode: r, total: o = 0, page: s = 0, onPageChange: l, pageSize: d = 30, onPageSizeChange: c, tab: g, onTabChange: h, keyword: p, onKeywordChange: f, condition: w, onConditionChange: C, sider: k, onSiderChange: v, layouts: x, classNames: T = {}, payload: R = {}, ...E }) => { + const [M, z] = j(), L = G((P, _) => { const W = { tab: g, page: s, pageSize: d, keyword: p, sider: k, condition: w, total: o, payload: R }; return P && P != "init" ? m.get(W, P, _) : W; }, [JSON.stringify(w), JSON.stringify(R), g, s, d, p, k, o]), B = q(() => { - let P = { sider: Pa, filter: pn, footer: va, toolbar: $a }; - v === !1 ? P = { sider: null, filter: null, footer: null, toolbar: null } : m.isPlainObject(v) && (P = Object.assign({}, P, v)); + let P = { sider: Pa, filter: mn, footer: xa, toolbar: $a }; + x === !1 ? P = { sider: null, filter: null, footer: null, toolbar: null } : m.isPlainObject(x) && (P = Object.assign({}, P, x)); for (const _ in P) if (P[_]) { - if (Mn(P[_])) { + if (zn(P[_])) { const W = P[_]; - P[_] = (pe) => S.cloneElement(W, pe); + P[_] = (me) => S.cloneElement(W, me); } } else P[_] = () => u(S.Fragment, {}); return P; - }, [v]); + }, [x]); return I(() => { - t ? re.getWidgetComponent(t).then((P) => { + t ? ie.getWidgetComponent(t).then((P) => { if (!P) throw `${t} not found`; return P; }).catch((P) => ({ default: () => `${P}` })).then((P) => z(S.createElement(P.default, { ...E, layouts: B, $setting: n }))) : z(u(e ? ba : ka, { ...E, layouts: B, $setting: n })); - }, [t, n]), u(ee.Provider, { value: { classNames: T, listCode: i, onClickCallback: a, onReload: r, getBase62params: L, onPageChange: l, onPageSizeChange: c, onTabChange: h, onSiderChange: x, onKeywordChange: f, onConditionChange: C, setPage: l, setPageSize: c, setTab: h, setSider: x, setKeyword: f, setCondition: C }, children: M && S.cloneElement(M, E) }); + }, [t, n]), u(ee.Provider, { value: { classNames: T, listCode: r, onClickCallback: a, onReload: i, getBase62params: L, onPageChange: l, onPageSizeChange: c, onTabChange: h, onSiderChange: v, onKeywordChange: f, onConditionChange: C, setPage: l, setPageSize: c, setTab: h, setSider: v, setKeyword: f, setCondition: C }, children: M && S.cloneElement(M, E) }); }; -mn.propTypes = { classNames: b.exact({ sider: b.string, filter: b.string, footer: b.string, toolbar: b.string, container: b.string, content: b.string, item: b.string }), layouts: b.oneOfType([b.exact({ sider: b.oneOfType([b.elementType, b.element]), filter: b.oneOfType([b.elementType, b.element]), footer: b.oneOfType([b.elementType, b.element]), toolbar: b.oneOfType([b.elementType, b.element]) }), b.bool]) }; -var fe, ge, $e, st; +hn.propTypes = { classNames: b.exact({ sider: b.string, filter: b.string, footer: b.string, toolbar: b.string, container: b.string, content: b.string, item: b.string }), layouts: b.oneOfType([b.exact({ sider: b.oneOfType([b.elementType, b.element]), filter: b.oneOfType([b.elementType, b.element]), footer: b.oneOfType([b.elementType, b.element]), toolbar: b.oneOfType([b.elementType, b.element]) }), b.bool]) }; +var ye, ge, $e, lt; const le = class le { constructor() { - j(this, ge, null); - j(this, $e, /* @__PURE__ */ new Map()); - j(this, st, () => { + A(this, ge, null); + A(this, $e, /* @__PURE__ */ new Map()); + A(this, lt, () => { if (y(this, ge)) return y(this, ge).port.postMessage({ command: "status", data: [] }); U(this, ge, new SharedWorker(new URL("/ff-worker/res-ws.js", self.location))), y(this, ge).port.onmessage = (t) => { var n, a; - (n = t.data) != null && n.uuid ? y(this, $e).forEach((r, i) => { + (n = t.data) != null && n.uuid ? y(this, $e).forEach((i, r) => { var o; - (r == "*" || (o = r == null ? void 0 : r.includes) != null && o.call(r, t.data.uuid)) && i(t.data); - }) : ((a = t.data) == null ? void 0 : a.readyState) == WebSocket.CLOSED && V.get("/api/user-api-token").then(({ token: r, expire_at: i }) => { - y(this, ge).port.postMessage({ command: "initWs", data: [`ws${m.trimStart(V.appUrl, "http")}api/user-resource-status-ws?token=${r}`] }); + (i == "*" || (o = i == null ? void 0 : i.includes) != null && o.call(i, t.data.uuid)) && r(t.data); + }) : ((a = t.data) == null ? void 0 : a.readyState) == WebSocket.CLOSED && V.get("/api/user-api-token").then(({ token: i, expire_at: r }) => { + y(this, ge).port.postMessage({ command: "initWs", data: [`ws${m.trimStart(V.appUrl, "http")}api/user-resource-status-ws?token=${i}`] }); }); }, y(this, ge).port.postMessage({ command: "status", data: [] }); }); - N(this, "subscribe", (t, n = []) => (n ? Array.isArray(n) && n.length == 0 ? n = "*" : Array.isArray(n) || (n = [n].flat()) : n = "*", y(this, $e).set(t, n), y(this, $e).size == 1 && y(this, st).call(this), () => this.unsubscribe(t))); - N(this, "unsubscribe", (t) => y(this, $e).delete(t)); - if (y(le, fe)) return y(le, fe); + $(this, "subscribe", (t, n = []) => (n ? Array.isArray(n) && n.length == 0 ? n = "*" : Array.isArray(n) || (n = [n].flat()) : n = "*", y(this, $e).set(t, n), y(this, $e).size == 1 && y(this, lt).call(this), () => this.unsubscribe(t))); + $(this, "unsubscribe", (t) => y(this, $e).delete(t)); + if (y(le, ye)) return y(le, ye); } }; -fe = new WeakMap(), ge = new WeakMap(), $e = new WeakMap(), st = new WeakMap(), j(le, fe, null), N(le, "getInstance", () => (y(le, fe) || U(le, fe, new le()), y(le, fe))); +ye = new WeakMap(), ge = new WeakMap(), $e = new WeakMap(), lt = new WeakMap(), A(le, ye, null), $(le, "getInstance", () => (y(le, ye) || U(le, ye, new le()), y(le, ye))); let vt = le; -const hn = vt.getInstance(), jt = S.forwardRef(({ listCode: e, base62params: t, className: n, theme: a, themeProps: r, layouts: i, classNames: o }, s) => { - const [{ resource: l, primaryKey: d, batchOperations: c = [], itemOperations: g = [], columns: h = [], themeConfig: p, theme: f, isConditionFormLayout: w = !1, isTreeSider: C, treeSiderConfig: k, isItemGridLayout: x, itemGridLayout: { themeConfig: v, ...T } = {}, title: R, isPaginate: E, tabs: M }, z] = A({ isItemGridLayout: !1, itemGridLayout: {} }), L = wa(e, t), [{ dataSource: B, itemOperationsAccess: P, condition: _, tab: W, keyword: pe, page: Ye, total: Xe, pageSize: ut, sider: Q, onConditionChange: Pn, onTabChange: $n, onKeywordChange: Nn, onPageChange: Tn, onPageSizeChange: Fn, onSiderChange: Rn, onReload: gt, payload: On }, Mt] = ya(L, e, d, l), En = St(g, P, B, d), jn = St(c); +const fn = vt.getInstance(), At = S.forwardRef(({ listCode: e, base62params: t, className: n, theme: a, themeProps: i, layouts: r, classNames: o }, s) => { + const [{ resource: l, primaryKey: d, batchOperations: c = [], itemOperations: g = [], columns: h = [], themeConfig: p, theme: f, isConditionFormLayout: w = !1, isTreeSider: C, treeSiderConfig: k, isItemGridLayout: v, itemGridLayout: { themeConfig: x, ...T } = {}, title: R, isPaginate: E, tabs: M }, z] = j({ isItemGridLayout: !1, itemGridLayout: {} }), L = wa(e, t), [{ dataSource: B, itemOperationsAccess: P, condition: _, tab: W, keyword: me, page: Ye, total: Xe, pageSize: gt, sider: Q, onConditionChange: $n, onTabChange: Nn, onKeywordChange: Tn, onPageChange: Fn, onPageSizeChange: Rn, onSiderChange: On, onReload: pt, payload: En }, Mt] = ya(L, e, d, l), An = xt(g, P, B, d), jn = xt(c); I(() => { let te = null; - return e && V.get(`/api/_/${e}`).resp(({ data: Qe, res: Ln }) => { - Qe != null && Qe.isDynamicRefresh && (te = hn.subscribe(() => gt(), Ln)), z(Qe); + return e && V.get(`/api/_/${e}`).resp(({ data: Qe, res: Vn }) => { + Qe != null && Qe.isDynamicRefresh && (te = fn.subscribe(() => pt(), Vn)), z(Qe); }).catch(() => z({})), () => te == null ? void 0 : te(); - }, [e]), S.useImperativeHandle(s, () => ({ onReload: gt, onClickCallback: Mt })); - const An = { listCode: e, title: R, classNames: o, layouts: i, resource: l, primaryKey: d, theme: a || f, themeProps: r || p, isTreeSider: C, treeSiderConfig: k, isPaginate: E, tabs: M, isItemOperations: En, itemOperations: g == null ? void 0 : g.map((te) => m.isEmpty(te == null ? void 0 : te.confirm) ? te : { ...te, confirm: Object.assign({}, te.confirm, { getPopupContainer: () => document.body }) }), isBatchOperations: jn, batchOperations: c, isItemGridLayout: x, columns: h, itemGridLayout: { ...T, themeProps: v }, isConditionFormLayout: w, itemOperationsAccess: P, dataSource: B, onConditionChange: Pn, onTabChange: $n, onKeywordChange: Nn, onPageChange: Tn, onPageSizeChange: Fn, onSiderChange: Rn, condition: _, tab: W, keyword: pe, page: Ye, total: Xe, pageSize: ut, sider: Q, payload: On }; - return u(mn, { ...An, className: F("ff-data-list-helper", n), onReload: gt, onClickCallback: Mt }); -}), fn = (e, t, n = !0) => n !== !0 && n-- <= 0 ? [] : m.isArray(e) && !m.isEmpty(e) ? e.reduce((a, r) => (Reflect.has(r, t) && Reflect.has(r, "children") && a.push(r[t]), Reflect.has(r, "children") && !m.isEmpty(r.children) ? a.concat(fn(r.children, t, n)) : a), []) : [], Na = ({ className: e, primaryKey: t, columns: n = [], dataSource: a = [], operationRender: r, operationWidth: i = 180, components: o = {}, ...s }) => { - const { classNames: l } = ie(ee), d = K(null), c = K(null), [g, h] = A([]), [p, f] = A({ width: 0, height: 0 }); + }, [e]), S.useImperativeHandle(s, () => ({ onReload: pt, onClickCallback: Mt })); + const Ln = { listCode: e, title: R, classNames: o, layouts: r, resource: l, primaryKey: d, theme: a || f, themeProps: i || p, isTreeSider: C, treeSiderConfig: k, isPaginate: E, tabs: M, isItemOperations: An, itemOperations: g == null ? void 0 : g.map((te) => m.isEmpty(te == null ? void 0 : te.confirm) ? te : { ...te, confirm: Object.assign({}, te.confirm, { getPopupContainer: () => document.body }) }), isBatchOperations: jn, batchOperations: c, isItemGridLayout: v, columns: h, itemGridLayout: { ...T, themeProps: x }, isConditionFormLayout: w, itemOperationsAccess: P, dataSource: B, onConditionChange: $n, onTabChange: Nn, onKeywordChange: Tn, onPageChange: Fn, onPageSizeChange: Rn, onSiderChange: On, condition: _, tab: W, keyword: me, page: Ye, total: Xe, pageSize: gt, sider: Q, payload: En }; + return u(hn, { ...Ln, className: F("ff-data-list-helper", n), onReload: pt, onClickCallback: Mt }); +}), yn = (e, t, n = !0) => n !== !0 && n-- <= 0 ? [] : m.isArray(e) && !m.isEmpty(e) ? e.reduce((a, i) => (Reflect.has(i, t) && Reflect.has(i, "children") && a.push(i[t]), Reflect.has(i, "children") && !m.isEmpty(i.children) ? a.concat(yn(i.children, t, n)) : a), []) : [], Na = ({ className: e, primaryKey: t, columns: n = [], dataSource: a = [], operationRender: i, operationWidth: r = 180, components: o = {}, ...s }) => { + const { classNames: l } = re(ee), d = K(null), c = K(null), [g, h] = j([]), [p, f] = j({ width: 0, height: 0 }); I(() => { - h(fn(a, t)); - }, [a, t]), zn(() => { + h(yn(a, t)); + }, [a, t]), Bn(() => { const k = new ResizeObserver(() => { - var x; - f({ width: ((x = d.current) == null ? void 0 : x.nativeElement.querySelector(".ant-table-body").scrollWidth) || c.current.offsetWidth, height: c.current.offsetHeight }); + var v; + f({ width: ((v = d.current) == null ? void 0 : v.nativeElement.querySelector(".ant-table-body").scrollWidth) || c.current.offsetWidth, height: c.current.offsetHeight }); }); return c.current && k.observe(c.current), () => { c.current && k.unobserve(c.current); }; }, []); const w = ha(n), C = fa(o); - return u("div", { ref: c, className: F("ff-data-list-table", l.content, e), children: p.height ? u(Hn, { bordered: !0, ...s, components: C, ref: d, rowKey: (k) => (k == null ? void 0 : k[t]) ?? Math.random(), columns: w == null ? void 0 : w.concat(r ? [{ title: "操作", align: "center", fixed: "right", width: `${Math.ceil(i / p.width * 100).toFixed(2)}%`, render: (k, x, v) => r(x, v) }] : []), dataSource: a, size: "middle", scroll: { x: "max-content", y: p.height - 50 }, pagination: !1, expandable: { defaultExpandAllRows: !0, expandRowByClick: !0, onExpandedRowsChange: h, expandedRowKeys: g } }) : null }); + return u("div", { ref: c, className: F("ff-data-list-table", l.content, e), children: p.height ? u(Jn, { bordered: !0, ...s, components: C, ref: d, rowKey: (k) => (k == null ? void 0 : k[t]) ?? Math.random(), columns: w == null ? void 0 : w.concat(i ? [{ title: "操作", align: "center", fixed: "right", width: `${Math.ceil(r / p.width * 100).toFixed(2)}%`, render: (k, v, x) => i(v, x) }] : []), dataSource: a, size: "middle", scroll: { x: "max-content", y: p.height - 50 }, pagination: !1, expandable: { defaultExpandAllRows: !0, expandRowByClick: !0, onExpandedRowsChange: h, expandedRowKeys: g } }) : null }); }, Ta = "RC_FORM_INTERNAL_HOOKS", Fa = (e) => { const [t, n] = S.useState({ items: [] }); return I(() => { - e && V.get(`/api/_/${e}`).then(({ uuid: a, code: r, name: i, resource: o, primaryKey: s, marginX: l, marginY: d, cols: c, rowHeight: g, fields: h, theme: p, themeSetting: f, groups: w }) => ({ uuid: a, code: r, name: i, resource: o, primaryKey: s, marginX: l, marginY: d, cols: c, rowHeight: g, theme: p, themeProps: f, groups: w, items: h })).then(n); + e && V.get(`/api/_/${e}`).then(({ uuid: a, code: i, name: r, resource: o, primaryKey: s, marginX: l, marginY: d, cols: c, rowHeight: g, fields: h, theme: p, themeSetting: f, groups: w }) => ({ uuid: a, code: i, name: r, resource: o, primaryKey: s, marginX: l, marginY: d, cols: c, rowHeight: g, theme: p, themeProps: f, groups: w, items: h })).then(n); }, [e]), t; -}, Ra = (e, { initialValue: t, initialValueLanguage: n, convertJs: a, convertJsSetting: r, type: i = "string" }, o = null) => { - const s = K(!1), l = ie(en), [d, c] = A(), [g, h] = A(n != "javascript" && e ? l.getFieldValue(e) : void 0), { registerWatch: p } = l.getInternalHooks(Ta) || {}; +}, Ra = (e, { initialValue: t, initialValueLanguage: n, convertJs: a, convertJsSetting: i, type: r = "string" }, o = null) => { + const s = K(!1), l = re(en), [d, c] = j(), [g, h] = j(n != "javascript" && e ? l.getFieldValue(e) : void 0), { registerWatch: p } = l.getInternalHooks(Ta) || {}; return I(() => p == null ? void 0 : p((f, w, C) => { if (!s.current) return; const k = m.get(w, e); - m.isEqual(k, g) || h(ae(k, i)); + m.isEqual(k, g) || h(ae(k, r)); }), [g]), I(() => { - n == "javascript" && t ? ve.exec(t, {}, { getFieldValueForBasicForm: (f) => o ? o.getFieldValue(f) : l.getFieldValue(f), getFieldValue: (f) => l.getFieldValue(f) }).then((f) => h(ae(f, i))).catch((f) => notification.error({ message: `布局数据错误: ${JSON.stringify(f)}` })).finally(() => s.current = !0) : (t && h(ae(t ?? l.getFieldValue(e), i)), s.current = !0); + n == "javascript" && t ? xe.exec(t, {}, { getFieldValueForBasicForm: (f) => o ? o.getFieldValue(f) : l.getFieldValue(f), getFieldValue: (f) => l.getFieldValue(f) }).then((f) => h(ae(f, r))).catch((f) => notification.error({ message: `布局数据错误: ${JSON.stringify(f)}` })).finally(() => s.current = !0) : (t && h(ae(t ?? l.getFieldValue(e), r)), s.current = !0); }, [t, n]), He(() => { - s.current && a && new at([a, r]).toValue(g, l.getFieldsValue(!0)).then(c).catch((f) => { + s.current && a && new at([a, i]).toValue(g, l.getFieldsValue(!0)).then(c).catch((f) => { c(f), console.error("布局数据转换错误: ", f, a); }); - }, [g, a, r]), [d ?? g, g]; -}, Vr = (e, t, n = null) => q(() => Et(e, t, n), [e]), yn = (e, t, n = {}, a = {}, r = {}, i = null) => { - const o = ie(en), s = ct(), l = K(!0), d = K([]), [c, g] = A(t), [h, p] = A(), f = Z.useWatch((w) => JSON.stringify(m.pick(w, d.current)), o) || "{}"; + }, [g, a, i]), [d ?? g, g]; +}, Vi = (e, t, n = null) => q(() => Et(e, t, n), [e]), wn = (e, t, n = {}, a = {}, i = {}, r = null) => { + const o = re(en), s = dt(), l = K(!0), d = K([]), [c, g] = j(t), [h, p] = j(), f = Z.useWatch((w) => JSON.stringify(m.pick(w, d.current)), o) || "{}"; return Je(() => { - e && ve.exec(e, n, { ...a, getFieldValueForBasicForm: (w) => r ? r.getFieldValue(w) : null, getFieldValue: m.wrap(o.getFieldValue, (w, C) => (d.current.some((k) => m.isEqual(k, C)) || (d.current.push(C), s()), w == null ? void 0 : w(C))), isFieldTouched: o.isFieldTouched, isFieldsTouched: o.isFieldsTouched }).then((w) => { + e && xe.exec(e, n, { ...a, getFieldValueForBasicForm: (w) => i ? i.getFieldValue(w) : null, getFieldValue: m.wrap(o.getFieldValue, (w, C) => (d.current.some((k) => m.isEqual(k, C)) || (d.current.push(C), s()), w == null ? void 0 : w(C))), isFieldTouched: o.isFieldTouched, isFieldsTouched: o.isFieldsTouched }).then((w) => { l.current && (g(w), p(null)); }).catch((w) => { l.current && (g(t), p(w)); }); - }, [e, f, o, n, a]), I(() => () => l.current = !1, []), e ? [i ? ae(c, i) : c, h] : [i ? ae(t, i) : t, null]; + }, [e, f, o, n, a]), I(() => () => l.current = !1, []), e ? [r ? ae(c, r) : c, h] : [r ? ae(t, r) : t, null]; }, Oa = ({ widget: e, widgetPrefix: t = "@pkg/ff/grid-layouts", basicForm: n, ...a }) => { - const r = e != null && e.startsWith("@") || e != null && e.startsWith("blob:") ? e : `${t}/${e}`, [i, o] = A(); + const i = e != null && e.startsWith("@") || e != null && e.startsWith("blob:") ? e : `${t}/${e}`, [r, o] = j(); return I(() => { - r && re.getWidgetComponent(r).then(({ defaultProps: s = {}, default: l }) => ({ default: Ea(l, s, n) })).catch((s) => ({ default: () => `${s}` })).then((s) => o(S.createElement(s.default, a))); - }, [r]), i; + i && ie.getWidgetComponent(i).then(({ defaultProps: s = {}, default: l }) => ({ default: Ea(l, s, n) })).catch((s) => ({ default: () => `${s}` })).then((s) => o(S.createElement(s.default, a))); + }, [i]), r; }, Ea = (e, t = {}, n = null) => (a) => { - const { code: r, label: i, extras: o, isVirtual: s, initialValue: l, initialValueLanguage: d, convertJs: c, convertJsSetting: g, value: h, ...p } = m.merge({}, t, a), [f, w] = Ra(s ? null : r, { initialValue: l, initialValueLanguage: d, convertJs: c, convertJsSetting: g, type: (p == null ? void 0 : p.type) || "string" }, n), C = q(() => { - const v = Object.keys((t == null ? void 0 : t.extras) || {}); - return m.over([m.partialRight(m.pick, v), m.partialRight(m.omit, v)]); - }, [t == null ? void 0 : t.extras]), [k, x] = C(p); - return u(e, { ...x, value: f, rawValue: w, $setting: Object.assign({}, o, k) }); -}, wn = ({ theme: e, basicForm: t, items: n = [{ key: "default", label: "默认" }], fields: a = [], itemRender: r, chunks: i = [], children: o, $setting: s = {}, ...l }) => { - const [d, c] = A(); + const { code: i, label: r, extras: o, isVirtual: s, initialValue: l, initialValueLanguage: d, convertJs: c, convertJsSetting: g, value: h, ...p } = m.merge({}, t, a), [f, w] = Ra(s ? null : i, { initialValue: l, initialValueLanguage: d, convertJs: c, convertJsSetting: g, type: (p == null ? void 0 : p.type) || "string" }, n), C = q(() => { + const x = Object.keys((t == null ? void 0 : t.extras) || {}); + return m.over([m.partialRight(m.pick, x), m.partialRight(m.omit, x)]); + }, [t == null ? void 0 : t.extras]), [k, v] = C(p); + return u(e, { ...v, value: f, rawValue: w, $setting: Object.assign({}, o, k) }); +}, bn = ({ theme: e, basicForm: t, items: n = [{ key: "default", label: "默认" }], fields: a = [], itemRender: i, chunks: r = [], children: o, $setting: s = {}, ...l }) => { + const [d, c] = j(); I(() => { - e ? re.getWidgetComponent(e).then((h) => { + e ? ie.getWidgetComponent(e).then((h) => { if (!(h != null && h.default)) throw "not found"; return h; }).catch((h) => ({ default: () => `${e} ${h}` })).then((h) => c(S.createElement(h.default, {}))) : c(null); }, [e]); - const g = q(() => n == null ? void 0 : n.map((h) => ({ ...h, children: r(h, a == null ? void 0 : a.filter((p) => !(p != null && p.group) && h.key == "default" || p.group == h.key), h.key == "default" ? o : null) })).concat(i), [n, o, i]); + const g = q(() => n == null ? void 0 : n.map((h) => ({ ...h, children: i(h, a == null ? void 0 : a.filter((p) => !(p != null && p.group) && h.key == "default" || p.group == h.key), h.key == "default" ? o : null) })).concat(r), [n, o, r]); return d && S.cloneElement(d, { items: g, basicForm: t, $setting: { ...s, ...l } }); -}, bn = ({ name: e, form: t = null, basicForm: n = null, style: a = {}, className: r, cols: i = 12, rowHeight: o = 21, containerPadding: s = [0, 0], itemMargin: l = [4, 0], formProps: d = {}, formFields: c = [], fields: g = [], data: h, theme: p, themeProps: f = {}, groups: w = [{ key: "default", label: "默认" }], children: C, ...k }) => { - const [x] = Z.useForm(t), v = q(() => [{ name: "__PROPS__", value: d }].concat(c), [d, c]); - He(() => (x.setFieldsValue(h), () => x.resetFields()), [h]); +}, Cn = ({ name: e, form: t = null, basicForm: n = null, style: a = {}, className: i, cols: r = 12, rowHeight: o = 21, containerPadding: s = [0, 0], itemMargin: l = [4, 0], formProps: d = {}, formFields: c = [], fields: g = [], data: h, theme: p, themeProps: f = {}, groups: w = [{ key: "default", label: "默认" }], children: C, ...k }) => { + const [v] = Z.useForm(t), x = q(() => [{ name: "__PROPS__", value: d }].concat(c), [d, c]); + He(() => (v.setFieldsValue(h), () => v.resetFields()), [h]); const T = (R, E, M) => { const z = Et(E, Oa, n); - return O("div", { className: F("ff-grid-layout", r), style: { ...a, "--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": i, "--grid-layout-row-height": `${o}px` }, children: [z, M && S.cloneElement(M, { cols: i, rowHeight: o, itemMargin: l, containerPadding: s, fields: E, basicForm: n })] }); + return O("div", { className: F("ff-grid-layout", i), style: { ...a, "--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": r, "--grid-layout-row-height": `${o}px` }, children: [z, M && S.cloneElement(M, { cols: r, rowHeight: o, itemMargin: l, containerPadding: s, fields: E, basicForm: n })] }); }; - return u(Z, { ...k, fields: v, form: x, component: !1, children: p ? u(wn, { ...f, items: w, theme: p, itemRender: T, fields: g, children: C, basicForm: n }) : T(0, g, C) }); -}, Ir = /* @__PURE__ */ ((e) => function({ code: t, data: n, ...a }) { - const { uuid: r, resource: i, items: o, hides: s, rowHeight: l, marginX: d, marginY: c, cols: g, theme: h, themeProps: p, groups: f } = Fa(t) || {}, w = q(() => [{ name: "__RESOURCE__", value: i }, { name: "__LAYOUT_KEY__", value: t }, { name: "__LAYOUT_UUID__", value: r }], [t, r, i]); - return i && u(e, { name: t, theme: h, themeProps: p, groups: f, ...a, fields: o, formFields: w, rowHeight: l, cols: g, itemMargin: [d, c], data: i ? { [i]: n } : n }); -})(bn), ja = ({ column: e = 0, colWidth: t = 0, cols: n, rowHeight: a, itemMargin: r, fields: i, primaryKey: o, dataSource: s, itemClassName: l, beforeRender: d = null, afterRender: c = null, itemRender: g = (x, v, T) => x, empty: h = u(Jn, { description: null }), className: p, style: f = {}, theme: w, themeProps: C = {}, groups: k = [{ key: "default", label: "默认" }] }) => { - const { classNames: x } = ie(ee), v = q(() => u(bn, { groups: k, theme: w, themeProps: C, cols: n, rowHeight: a, itemMargin: r, fields: i, className: l }), [i, n, a, r, k, w, C]), T = m.isEmpty(s); - return O("div", { className: F("ff-data-list-content", x.content, p), style: Object.assign({}, f, e && { "--col-num": e }, t && { "--col-width": t }), children: [d == null ? void 0 : d(s), T ? h : s.map((R, E) => { - const M = g(S.cloneElement(v, { data: R }), R, E); + return u(Z, { ...k, fields: x, form: v, component: !1, children: p ? u(bn, { ...f, items: w, theme: p, itemRender: T, fields: g, children: C, basicForm: n }) : T(0, g, C) }); +}, Ii = /* @__PURE__ */ ((e) => function({ code: t, data: n, ...a }) { + const { uuid: i, resource: r, items: o, hides: s, rowHeight: l, marginX: d, marginY: c, cols: g, theme: h, themeProps: p, groups: f } = Fa(t) || {}, w = q(() => [{ name: "__RESOURCE__", value: r }, { name: "__LAYOUT_KEY__", value: t }, { name: "__LAYOUT_UUID__", value: i }], [t, i, r]); + return r && u(e, { name: t, theme: h, themeProps: p, groups: f, ...a, fields: o, formFields: w, rowHeight: l, cols: g, itemMargin: [d, c], data: r ? { [r]: n } : n }); +})(Cn), Aa = ({ column: e = 0, colWidth: t = 0, cols: n, rowHeight: a, itemMargin: i, fields: r, primaryKey: o, dataSource: s, itemClassName: l, beforeRender: d = null, afterRender: c = null, itemRender: g = (v, x, T) => v, empty: h = u(Gn, { description: null }), className: p, style: f = {}, theme: w, themeProps: C = {}, groups: k = [{ key: "default", label: "默认" }] }) => { + const { classNames: v } = re(ee), x = q(() => u(Cn, { groups: k, theme: w, themeProps: C, cols: n, rowHeight: a, itemMargin: i, fields: r, className: l }), [r, n, a, i, k, w, C]), T = m.isEmpty(s); + return O("div", { className: F("ff-data-list-content", v.content, p), style: Object.assign({}, f, e && { "--col-num": e }, t && { "--col-width": t }), children: [d == null ? void 0 : d(s), T ? h : s.map((R, E) => { + const M = g(S.cloneElement(x, { data: R }), R, E); return S.cloneElement(M, { key: `${(R == null ? void 0 : R[o]) ?? E}-${da(R)}` }); }), c == null ? void 0 : c(s)] }); -}, Aa = ({ component: e, $props: t }) => { +}, ja = ({ component: e, $props: t }) => { const { base62params: n } = Ke(t, {}); - return u(J, { children: u(jt, { listCode: e, base62params: V.decode(n) }) }); -}, Mr = () => u(Cn, {}), Cn = () => "Empty", La = ({ component: e, $setting: t, $props: n }) => { - const [a, r] = A(); + return u(J, { children: u(At, { listCode: e, base62params: V.decode(n) }) }); +}, Mi = () => u(kn, {}), kn = () => "Empty", La = ({ component: e, $setting: t, $props: n }) => { + const [a, i] = j(); I(() => { - if (!e) return r(u(Cn, { description: null })); - re.getWidgetComponent(e).catch((o) => ({ default: () => `${o}` })).then((o) => S.createElement(o.default, { $setting: t })).then(r); + if (!e) return i(u(kn, { description: null })); + ie.getWidgetComponent(e).catch((o) => ({ default: () => `${o}` })).then((o) => S.createElement(o.default, { $setting: t })).then(i); }, [e]); - const i = Ke(n, {}); - return a ? S.cloneElement(a, i) : null; -}, zr = () => "NotFoundPage"; -var ye, ne, we, be, Ue, qe; + const r = Ke(n, {}); + return a ? S.cloneElement(a, r) : null; +}, zi = () => "NotFoundPage"; +var we, ne, be, Ce, Ue, qe; const ce = class ce { constructor() { - j(this, ne, /* @__PURE__ */ new Map()); - j(this, we, {}); - j(this, be, null); - N(this, "init", (t, n) => { - U(this, ne, t), U(this, we, n); + A(this, ne, /* @__PURE__ */ new Map()); + A(this, be, {}); + A(this, Ce, null); + $(this, "init", (t, n) => { + U(this, ne, t), U(this, be, n); }); - N(this, "get", (t) => (y(this, ne).has(t) || (t = Array.from(y(this, ne).keys()).find((n) => y(this, ne).get(n).uri === t)), y(this, ne).get(t) || {})); - N(this, "redirect", (t, n, a = {}) => { - const { uri: r, type: i, widgetProps: o } = this.get(t) || {}, { router: s, query: l, ...d } = n || {}, c = Object.assign({}, d, s), g = Object.assign({}, d, l); - i == "list" && (c.base62params = V.encode(c != null && c.base62params ? c.base62params : c)); - let h = Zn(r || t, c); + $(this, "get", (t) => (y(this, ne).has(t) || (t = Array.from(y(this, ne).keys()).find((n) => y(this, ne).get(n).uri === t)), y(this, ne).get(t) || {})); + $(this, "redirect", (t, n, a = {}) => { + const { uri: i, type: r, widgetProps: o } = this.get(t) || {}, { router: s, query: l, ...d } = n || {}, c = Object.assign({}, d, s), g = Object.assign({}, d, l); + r == "list" && (c.base62params = V.encode(c != null && c.base62params ? c.base62params : c)); + let h = ea(i || t, c); const p = new URLSearchParams(); for (const f in o || {}) (o == null ? void 0 : o.type) == "query" && Object.has(g, f) && p.append(f, JSON.stringify(g[f])); - return p.size > 0 && (h = `${h}?${p.toString()}`), a != null && a.isOpenWindow ? window.open(h) : y(this, be).navigate(h, { replace: !!(a != null && a.isReplaceRouteHistory) }); + return p.size > 0 && (h = `${h}?${p.toString()}`), a != null && a.isOpenWindow ? window.open(h) : y(this, Ce).navigate(h, { replace: !!(a != null && a.isReplaceRouteHistory) }); }); - N(this, "getMenus", (t) => { + $(this, "getMenus", (t) => { var n; - return ((n = y(this, we)) == null ? void 0 : n[t]) || []; + return ((n = y(this, be)) == null ? void 0 : n[t]) || []; }); - N(this, "findMenuPathByUuid", (t) => { + $(this, "findMenuPathByUuid", (t) => { let n = []; - for (const a in y(this, we)) if (n = y(this, Ue).call(this, y(this, we)[a], t, [a]), n.length > 1) return n; + for (const a in y(this, be)) if (n = y(this, Ue).call(this, y(this, be)[a], t, [a]), n.length > 1) return n; return n; }); - N(this, "getMenusByRouteUuid", (t) => y(this, qe).call(this, t, Object.values(y(this, we)).flat())); - j(this, Ue, (t, n, a = []) => { + $(this, "getMenusByRouteUuid", (t) => y(this, qe).call(this, t, Object.values(y(this, be)).flat())); + A(this, Ue, (t, n, a = []) => { if (m.isEmpty(t)) return a; - for (const { uuid: r, children: i } of t) { - if (r == n) return a.concat(r); - if (!m.isEmpty(i)) return a.concat(r, y(this, Ue).call(this, i, n)); + for (const { uuid: i, children: r } of t) { + if (i == n) return a.concat(i); + if (!m.isEmpty(r)) return a.concat(i, y(this, Ue).call(this, r, n)); } return a; }); - j(this, qe, (t, n) => { - var r; + A(this, qe, (t, n) => { + var i; let a = []; - for (const i of n) i.widgetType == "redirect" && (i.uuid == t || i.widget == t ? a.push(i) : (r = i.children) != null && r.length && (a = a.concat(y(this, qe).call(this, t, i.children)))); + for (const r of n) r.widgetType == "redirect" && (r.uuid == t || r.widget == t ? a.push(r) : (i = r.children) != null && i.length && (a = a.concat(y(this, qe).call(this, t, r.children)))); return a; }); - N(this, "getCurrentMenu", () => { + $(this, "getCurrentMenu", () => { const { uuid: t } = this.getCurrentRoute() || {}; if (!t) return; const n = this.getMenusByRouteUuid(t); return m.isEmpty(n) ? void 0 : n[0]; }); - N(this, "getCurrentRoute", (t = 0) => { + $(this, "getCurrentRoute", (t = 0) => { var a; - const n = (a = y(this, be).state.matches[y(this, be).state.matches.length - 1 - t]) == null ? void 0 : a.route; + const n = (a = y(this, Ce).state.matches[y(this, Ce).state.matches.length - 1 - t]) == null ? void 0 : a.route; if (!n) return null; - for (let [r, i] of y(this, ne)) if (i.uri === n.path) return i; + for (let [i, r] of y(this, ne)) if (r.uri === n.path) return r; return null; }); - N(this, "getPageParams", (t) => { - var r, i, o; + $(this, "getPageParams", (t) => { + var i, r, o; let n = "", a = {}; - if (nn()) a = ea(), n = (r = ta()) == null ? void 0 : r.search; + if (nn()) a = ta(), n = (i = na()) == null ? void 0 : i.search; else { - const { location: s = {}, matches: l = [] } = ((i = y(this, be)) == null ? void 0 : i.state) || {}; + const { location: s = {}, matches: l = [] } = ((r = y(this, Ce)) == null ? void 0 : r.state) || {}; a = ((o = l[l.length - 1]) == null ? void 0 : o.params) || {}, n = s.search; } return n && new URLSearchParams(n).forEach((s, l) => { a[l] = s; }), t ? m.get(a, t) : a; }); - N(this, "createBrowserRouter", (t = {}) => { + $(this, "createBrowserRouter", (t = {}) => { if (y(this, ne).size == 0) return null; - const n = Ie.get("Common.WEBSITE_DEFAULT_THEME", "@pkg/ff/frameworks/DefaultTheme"), a = Ie.get(re.checkUserToken() ? "Common.WEBSITE_LOGIN_REDIRECT" : "Common.WEBSITE_DEFAULT", "/index"), r = { [n]: 0 }, i = (s, l) => () => Promise.all([re.getWidgetComponent(s), Ke(l)]).then(([d, c]) => [d.default || function() { + const n = Te.get("Common.WEBSITE_DEFAULT_THEME", "@pkg/ff/frameworks/DefaultTheme"), a = Te.get(ie.checkUserToken() ? "Common.WEBSITE_LOGIN_REDIRECT" : "Common.WEBSITE_DEFAULT", "/index"), i = { [n]: 0 }, r = (s, l) => () => Promise.all([ie.getWidgetComponent(s), Ke(l)]).then(([d, c]) => [d.default || function() { return `${s}`; }, c]).then(([d, c]) => ({ Component: () => S.createElement(rn, {}, S.createElement(d, { $setting: c })) })), o = Array.from(y(this, ne).values()).reduce((s, { uuid: l, uri: d, name: c, type: g, component: h, widgetSetting: p, widgetProps: f, isLogin: w, isLayout: C, extra: k }) => { - let x = {}, v = 0; + let v = {}, x = 0; switch (g) { case "list": - x.element = S.createElement(Aa, { component: h, $props: f }); + v.element = S.createElement(ja, { component: h, $props: f }); break; case "fsdpf-component": - x.element = S.createElement(La, { key: h, component: h, $setting: p, $props: f }); + v.element = S.createElement(La, { key: h, component: h, $setting: p, $props: f }); } const T = (k == null ? void 0 : k.theme) ?? (k == null ? void 0 : k.layout); if (T) { const R = (k == null ? void 0 : k.themeProps) ?? (k == null ? void 0 : k.layoutProps); - if (!r[T]) return r[T] = s.length, [...s, { path: "/", lazy: i(T, R), children: [{ path: d, ...x }] }]; - v = r[T]; + if (!i[T]) return i[T] = s.length, [...s, { path: "/", lazy: r(T, R), children: [{ path: d, ...v }] }]; + x = i[T]; } - return C && v > -1 ? (s[v].children.push({ path: d, ...x }), s) : [...s, { path: d, ...x }]; - }, [{ path: "/", lazy: i(n, {}), children: [] }]); - return o.push({ index: !0, element: S.createElement(Va, { to: a, replace: !0 }) }), U(this, be, na(o, t)); + return C && x > -1 ? (s[x].children.push({ path: d, ...v }), s) : [...s, { path: d, ...v }]; + }, [{ path: "/", lazy: r(n, {}), children: [] }]); + return o.push({ index: !0, element: S.createElement(Va, { to: a, replace: !0 }) }), U(this, Ce, aa(o, t)); }); - if (y(ce, ye)) return y(ce, ye); + if (y(ce, we)) return y(ce, we); } }; -ye = new WeakMap(), ne = new WeakMap(), we = new WeakMap(), be = new WeakMap(), Ue = new WeakMap(), qe = new WeakMap(), j(ce, ye, null), N(ce, "getInstance", () => (y(ce, ye) || U(ce, ye, new ce()), y(ce, ye))); -let xt = ce; -const Va = ({ to: e, replace: t }) => nn() ? S.createElement(aa, { to: e, replace: t }) : (window.document.location = e, "redirect"), Se = xt.getInstance(), Te = new Worker(new URL("/ff-worker/index.js", self.location)), Ht = { getConfigure: (e) => Ie.get(e), route: { redirect: (...e) => Se.redirect(...e), getPageParams: (...e) => Se.getPageParams(...e), getCurrentRoute: () => Se.getCurrentRoute() }, popup: { notification: (...e) => X.notification(...e), success: (...e) => X.success(...e), error: (...e) => X.error(...e), form: (...e) => X.form(...e), modal: (...e) => X.modal(...e), confirm: (...e) => X.confirm(...e) } }; -var lt, Ee, Ce; +we = new WeakMap(), ne = new WeakMap(), be = new WeakMap(), Ce = new WeakMap(), Ue = new WeakMap(), qe = new WeakMap(), A(ce, we, null), $(ce, "getInstance", () => (y(ce, we) || U(ce, we, new ce()), y(ce, we))); +let Pt = ce; +const Va = ({ to: e, replace: t }) => nn() ? S.createElement(ia, { to: e, replace: t }) : (window.document.location = e, "redirect"), pe = Pt.getInstance(), Fe = new Worker(new URL("/ff-worker/index.js", self.location)), Ht = { getConfigure: (e) => Te.get(e), route: { redirect: (...e) => pe.redirect(...e), getPageParams: (...e) => pe.getPageParams(...e), getCurrentRoute: () => pe.getCurrentRoute() }, popup: { notification: (...e) => X.notification(...e), success: (...e) => X.success(...e), error: (...e) => X.error(...e), form: (...e) => X.form(...e), modal: (...e) => X.modal(...e), confirm: (...e) => X.confirm(...e) } }; +var ct, Ae, ke; const D = class D { constructor() { - N(this, "exec", (t, n = {}, a = {}, r = "") => new Promise((i, o) => { - if (!/^(?!\s*(\/\/|\/\*|\*)).*?\S+/m.test(t)) return i(); - const s = Wt(D, lt)._++; - y(D, Ee).set(s, a), D.mQueue.set(s, [i, o]), Te.postMessage({ id: s, session: r, category: "eval", method: t, args: n }); + $(this, "exec", (t, n = {}, a = {}, i = "") => new Promise((r, o) => { + if (!/^(?!\s*(\/\/|\/\*|\*)).*?\S+/m.test(t)) return r(); + const s = Wt(D, ct)._++; + y(D, Ae).set(s, a), D.mQueue.set(s, [r, o]), Fe.postMessage({ id: s, session: i, category: "eval", method: t, args: n }); })); - N(this, "clear", (t) => Te.postMessage({ session: t, category: "clear" })); - if (y(D, Ce)) return y(D, Ce); - Promise.resolve().then(() => lr).then((t) => { + $(this, "clear", (t) => Fe.postMessage({ session: t, category: "clear" })); + if (y(D, ke)) return y(D, ke); + Promise.resolve().then(() => li).then((t) => { Ht.http = t.http; - }), Te.addEventListener("message", ({ data: { id: t, task_id: n, method: a, args: r, category: i, data: o, error: s, session: l } }) => { - if (i === "eval" && D.mQueue.has(t)) s !== null ? D.mQueue.get(t)[1](s) : D.mQueue.get(t)[0](o), y(D, Ee).delete(t), D.mQueue.delete(t); - else if (i === "util") try { - const d = m.get(Ht, a.split("/")) || m.get(y(D, Ee).get(n), a.split("/")); + }), Fe.addEventListener("message", ({ data: { id: t, task_id: n, method: a, args: i, category: r, data: o, error: s, session: l } }) => { + if (r === "eval" && D.mQueue.has(t)) s !== null ? D.mQueue.get(t)[1](s) : D.mQueue.get(t)[0](o), y(D, Ae).delete(t), D.mQueue.delete(t); + else if (r === "util") try { + const d = m.get(Ht, a.split("/")) || m.get(y(D, Ae).get(n), a.split("/")); if (!m.isFunction(d)) throw `${a} not found`; - Promise.resolve(Reflect.apply(d, void 0, r)).then((c) => { - Te.postMessage({ id: t, task_id: n, category: i, method: a, args: r, session: l, data: c, error: null }); + Promise.resolve(Reflect.apply(d, void 0, i)).then((c) => { + Fe.postMessage({ id: t, task_id: n, category: r, method: a, args: i, session: l, data: c, error: null }); }).catch((c) => { - Te.postMessage({ id: t, task_id: n, category: i, method: a, args: r, session: l, data: null, error: c }); + Fe.postMessage({ id: t, task_id: n, category: r, method: a, args: i, session: l, data: null, error: c }); }); } catch (d) { - Te.postMessage({ id: t, task_id: n, category: i, method: a, args: r, session: l, data: null, error: d }); + Fe.postMessage({ id: t, task_id: n, category: r, method: a, args: i, session: l, data: null, error: d }); } }, !1); } }; -lt = new WeakMap(), Ee = new WeakMap(), Ce = new WeakMap(), N(D, "mQueue", /* @__PURE__ */ new Map()), j(D, lt, 0), j(D, Ee, /* @__PURE__ */ new Map()), j(D, Ce, null), N(D, "getInstance", () => (y(D, Ce) || U(D, Ce, new D()), y(D, Ce))); -let Pt = D; -const ve = Pt.getInstance(), ct = () => { +ct = new WeakMap(), Ae = new WeakMap(), ke = new WeakMap(), $(D, "mQueue", /* @__PURE__ */ new Map()), A(D, ct, 0), A(D, Ae, /* @__PURE__ */ new Map()), A(D, ke, null), $(D, "getInstance", () => (y(D, ke) || U(D, ke, new D()), y(D, ke))); +let $t = D; +const xe = $t.getInstance(), dt = () => { const e = K(!0), [, t] = S.useReducer((n) => n + 1, 0); return I(() => () => e.current = !1, []), () => e.current && t(); -}, Br = (e) => { +}, Bi = (e) => { const t = K(); return I(() => { t.current = e; }, [e]), t.current; -}, Wr = (e) => { - const [t, n] = A(e), a = K(null), r = G((i, o) => { - a.current = o, n(i); +}, Wi = (e) => { + const [t, n] = j(e), a = K(null), i = G((r, o) => { + a.current = o, n(r); }, []); return I(() => { a.current && (a.current(t), a.current = null); - }, [t]), [t, r]; + }, [t]), [t, i]; }, He = (e = (a) => { }, t, n = m.isEqual) => { const a = S.useRef(); n(t, a.current) || (a.current = m.cloneDeep(t)), S.useEffect(e, [a.current]); -}, Je = He, kn = (e, t = "string") => { +}, Je = He, Sn = (e, t = "string") => { var n; if (!Array.isArray(e)) return e; - for (let a = 0; a < e.length; a++) e[a].value = ae((n = e[a]) == null ? void 0 : n.value, t), e[a] && Reflect.has(e[a], "children") && (e[a].children = kn(e[a].children, t)); + for (let a = 0; a < e.length; a++) e[a].value = ae((n = e[a]) == null ? void 0 : n.value, t), e[a] && Reflect.has(e[a], "children") && (e[a].children = Sn(e[a].children, t)); return e; -}, Dr = (e, t = "json", n = "string", a, r = null) => { - const [i] = Z.useForm(a), [o, s] = A([{ label: "无", value: "", disabled: !0 }]), l = K([]), d = Z.useWatch((c) => l.current.length === 0 ? null : m.pick(c, l.current), i) || null; +}, Di = (e, t = "json", n = "string", a, i = null) => { + const [r] = Z.useForm(a), [o, s] = j([{ label: "无", value: "", disabled: !0 }]), l = K([]), d = Z.useWatch((c) => l.current.length === 0 ? null : m.pick(c, l.current), r) || null; return I(() => { - Array.isArray(e) ? s(e) : t === "javascript" && e ? ve.exec(e, {}, { getFieldValue: (c) => (l.current.includes(c) || l.current.push(c), i.getFieldValue(c)), getFieldValueForBasicForm: (c) => (l.current.includes(c) || l.current.push(c), r ? r.getFieldValue(c) : i.getFieldValue(c)) }).then((c) => { + Array.isArray(e) ? s(e) : t === "javascript" && e ? xe.exec(e, {}, { getFieldValue: (c) => (l.current.includes(c) || l.current.push(c), r.getFieldValue(c)), getFieldValueForBasicForm: (c) => (l.current.includes(c) || l.current.push(c), i ? i.getFieldValue(c) : r.getFieldValue(c)) }).then((c) => { s(ae(c, "array")); }).catch((c) => console.error("useOptions", c)) : e && s(ae(e, "array")); - }, [e, t, d]), kn(o, n); -}, Ur = (e) => { - const [t, n] = A(), a = { type: "GET" }; + }, [e, t, d]), Sn(o, n); +}, Ui = (e) => { + const [t, n] = j(), a = { type: "GET" }; if (typeof e == "string" ? a.url = e : m.isPlainObject(e) && Object.assign(a, e), !(a != null && a.url)) throw "url is required"; - const r = (i) => V.request(a, !1).resp((o) => (console.log("useSubscribeRequest", i), n(o), o)); + const i = (r) => V.request(a, !1).resp((o) => (console.log("useSubscribeRequest", r), n(o), o)); return He(() => { - let i = null; - return r().then((o) => { - i = hn.subscribe(m.throttle(r, 180, { leading: !1, trailing: !0 }), o.res); - }), () => i == null ? void 0 : i(); + let r = null; + return i().then((o) => { + r = fn.subscribe(m.throttle(i, 180, { leading: !1, trailing: !0 }), o.res); + }), () => r == null ? void 0 : r(); }, a), t; }, Ia = (e) => { const [t, n] = S.useState({ items: [], hides: [] }); return S.useEffect(() => { - e && V.get(`/api/_/${e}`).then(({ pk: a, uuid: r, code: i, resource: o, align: s, cols: l, rowHeight: d, marginX: c, marginY: g, listenChangeFields: h, listenChangeFieldsFunc: p, fields: f, theme: w, themeSetting: C, groups: k }) => ({ pk: a, uuid: r, code: i, resource: o, align: s, cols: l, rowHeight: d, marginX: c, marginY: g, theme: w, themeProps: C, groups: k, listenChangeFields: h, listenChangeFieldsFunc: p, ...f.reduce((x, v) => { + e && V.get(`/api/_/${e}`).then(({ pk: a, uuid: i, code: r, resource: o, align: s, cols: l, rowHeight: d, marginX: c, marginY: g, listenChangeFields: h, listenChangeFieldsFunc: p, fields: f, theme: w, themeSetting: C, groups: k }) => ({ pk: a, uuid: i, code: r, resource: o, align: s, cols: l, rowHeight: d, marginX: c, marginY: g, theme: w, themeProps: C, groups: k, listenChangeFields: h, listenChangeFieldsFunc: p, ...f.reduce((v, x) => { var T; - return (T = v == null ? void 0 : v.field) != null && T.hidden ? x.hides.push(v == null ? void 0 : v.field) : x.items.push(v), x; + return (T = x == null ? void 0 : x.field) != null && T.hidden ? v.hides.push(x == null ? void 0 : x.field) : v.items.push(x), v; }, { items: [], hides: [] }) })).then(n); }, [e]), t; -}, Ma = ({ max: e = 0, min: t = 0, type: n = "", message: a, pattern: r, required: i = !1, validator: o } = {}, s, l) => { - const [d, c] = A([]); +}, Ma = ({ max: e = 0, min: t = 0, type: n = "", message: a, pattern: i, required: r = !1, validator: o } = {}, s, l) => { + const [d, c] = j([]); return I(() => { const g = []; - if (i) { + if (r) { let h = l; switch (l) { case "number": @@ -747,254 +747,254 @@ const ve = Pt.getInstance(), ct = () => { g.push({ type: n, max: e, min: t, message: a || (t && e ? `字符必须在 ${t} ~ ${e} 之间` : `${e ? "最多能有" : "最少要有"} ${t || e} 个字符`) }); break; case "pattern": - g.push({ type: "string", pattern: r, message: a }); + g.push({ type: "string", pattern: i, message: a }); break; case "validator": o && g.push(({ getFieldValue: h }) => ({ validator: async (p, f) => { - const w = await ve.exec(o, { value: f, fieldName: s }, { getFieldValue: h }); + const w = await xe.exec(o, { value: f, fieldName: s }, { getFieldValue: h }); return m.isString(w) && w ? Promise.reject(w) : m.isBoolean(w) && !w ? Promise.reject(a) : Promise.resolve(); } })); } c(g); - }, [e, t, n, a, r, i, o]), d; + }, [e, t, n, a, i, r, o]), d; }, za = (e, t, n) => { - const [a, r] = A(null); + const [a, i] = j(null); return I(() => { - const { initDataUri: i = `/api/${e}`, initDataMethod: o = "GET" } = n || {}; - t && V.request({ method: o, url: m.trimEnd(`${i}/${t}`, "/") }).then((s) => { - r(s); + const { initDataUri: r = `/api/${e}`, initDataMethod: o = "GET" } = n || {}; + t && V.request({ method: o, url: m.trimEnd(`${r}/${t}`, "/") }).then((s) => { + i(s); }); }, [e, t, n]), a; -}, Ba = (e, t, n) => G((a, r = { serialize: (i) => i, onSuccess: () => { -}, onFail: (i) => (i == null ? void 0 : i.errorFields) && X.error("请先完善表单信息", { duration: 2e3 }) }) => { - const i = a.getFieldValue("__RESOURCE__"), { submitDataUri: o = `/api/${e}`, submitDataMethod: s = "POST" } = n || {}; - return a.validateFields().then((l) => i ? m.pick(l, [i]) : l).then(r.serialize).then((l) => V.request({ method: s, url: m.trimEnd(`${o}/${t || ""}`, "/"), data: l }).msg(r.onSuccess)).catch(r.onFail); +}, Ba = (e, t, n) => G((a, i = { serialize: (r) => r, onSuccess: () => { +}, onFail: (r) => (r == null ? void 0 : r.errorFields) && X.error("请先完善表单信息", { duration: 2e3 }) }) => { + const r = a.getFieldValue("__RESOURCE__"), { submitDataUri: o = `/api/${e}`, submitDataMethod: s = "POST" } = n || {}; + return a.validateFields().then((l) => r ? m.pick(l, [r]) : l).then(i.serialize).then((l) => V.request({ method: s, url: m.trimEnd(`${o}/${t || ""}`, "/"), data: l }).msg(i.onSuccess)).catch(i.onFail); }, [e, t, n]), Wa = (e, t, n, a) => { - const r = za(t, n, a); + const i = za(t, n, a); I(() => { - r ? e.setFieldsValue(r) : e.resetFields(); - }, [e, r]); - const i = Ba(t, n, a); - return m.partial(i, e); + i ? e.setFieldsValue(i) : e.resetFields(); + }, [e, i]); + const r = Ba(t, n, a); + return m.partial(r, e); }, Da = (e, t, n = [], a = {}) => { - const r = K({}), i = K(), o = m.debounce(ct(), 180), s = ["disabled", "required"], l = (h, p) => { - s.includes(h) && (r.current[h] = p), o(); - }, d = q(() => ({ setDisabled: (h) => l("disabled", h), setRequired: (h) => l("required", h), getDisabled: () => r.current.disabled, getRequired: () => r.current.required }), [t]), [c, g] = yn(t, -1, {}, d, a); - if (!g && i.current != c && (c >= 0 || !m.isEmpty(n == null ? void 0 : n[c]))) { - i.current = c; + const i = K({}), r = K(), o = m.debounce(dt(), 180), s = ["disabled", "required"], l = (h, p) => { + s.includes(h) && (i.current[h] = p), o(); + }, d = q(() => ({ setDisabled: (h) => l("disabled", h), setRequired: (h) => l("required", h), getDisabled: () => i.current.disabled, getRequired: () => i.current.required }), [t]), [c, g] = wn(t, -1, {}, d, a); + if (!g && r.current != c && (c >= 0 || !m.isEmpty(n == null ? void 0 : n[c]))) { + r.current = c; const { widget: h, widgetPrefix: p, props: f } = n == null ? void 0 : n[c]; - e = sn(h, p), r.current = m.merge(f, m.pick(r.current, s)); + e = ln(h, p), i.current = m.merge(f, m.pick(i.current, s)); } - return [e, r.current]; -}, Jt = (e) => e === void 0 || e === !1 ? "" : (Array.isArray(e) ? e : [e]).join("_"), qr = ({ value: e, onChange: t }, n = null) => { - const a = K(), [r] = Z.useForm(n), i = K({}); + return [e, i.current]; +}, Jt = (e) => e === void 0 || e === !1 ? "" : (Array.isArray(e) ? e : [e]).join("_"), qi = ({ value: e, onChange: t }, n = null) => { + const a = K(), [i] = Z.useForm(n), r = K({}); return Je(() => { - m.isEqual(a.current, e) || r.setFieldsValue(e); - }, [e]), I(() => () => r.resetFields(), []), [q(() => r.__INTERNAL__ ? r : { ...r, __INTERNAL__: { itemRef: (o) => (s) => { + m.isEqual(a.current, e) || i.setFieldsValue(e); + }, [e]), I(() => () => i.resetFields(), []), [q(() => i.__INTERNAL__ ? i : { ...i, __INTERNAL__: { itemRef: (o) => (s) => { const l = Jt(o); - s ? i.current[l] = s : delete i.current[l]; + s ? r.current[l] = s : delete r.current[l]; } }, scrollToField: (o, s = {}) => { console.warn("useMergedFormValuesChange scrollToField not work, unreferenced antd form"); }, focusField: (o) => { console.warn("useMergedFormValuesChange focusField not work, unreferenced antd form"); }, getFieldInstance: (o) => { const s = Jt(o); - return i.current[s]; - } }, [r]), (o, s) => { + return r.current[s]; + } }, [i]), (o, s) => { a.current = s, t == null || t(s); }]; -}, At = ({ widget: e = "Input", widgetPrefix: t = "@pkg/ff/grid-layout-forms", widgetDecorator: n, subWidgets: a = [], basicForm: r, ...i }) => { - const o = sn(e, t), [s, l] = Da(o, n, a, r), [d, c] = A(); +}, jt = ({ widget: e = "Input", widgetPrefix: t = "@pkg/ff/grid-layout-forms", widgetDecorator: n, subWidgets: a = [], basicForm: i, ...r }) => { + const o = ln(e, t), [s, l] = Da(o, n, a, i), [d, c] = j(); return I(() => { - s && re.getWidgetComponent(s).then(({ defaultProps: g = {}, default: h }) => ({ default: Ua(h, g, r) })).catch((g) => ({ default: () => `${g}` })).then((g) => c(S.createElement(g.default, i))); - }, [s]), d && S.cloneElement(d, { ...i, ...l }); + s && ie.getWidgetComponent(s).then(({ defaultProps: g = {}, default: h }) => ({ default: Ua(h, g, i) })).catch((g) => ({ default: () => `${g}` })).then((g) => c(S.createElement(g.default, r))); + }, [s]), d && S.cloneElement(d, { ...r, ...l }); }, Ua = (e, t = {}, n = null) => (a) => { - const { type: r, code: i, label: o, noStyle: s, placeholder: l, required: d = !1, extras: c, validators: g, help: h, isVirtual: p, $isReserved: f, initialValue: w, initialValueLanguage: C, ...k } = m.omit(m.merge({}, t, a), ["convertJs", "convertJsSetting", "widget", "widgetPerfix", "widgetDecorator", "subWidgets", "boxStyle"]), x = Ma(Object.assign({}, g, d ? { required: !0 } : {}), i, r), v = q(() => { + const { type: i, code: r, label: o, noStyle: s, placeholder: l, required: d = !1, extras: c, validators: g, help: h, isVirtual: p, $isReserved: f, initialValue: w, initialValueLanguage: C, ...k } = m.omit(m.merge({}, t, a), ["convertJs", "convertJsSetting", "widget", "widgetPerfix", "widgetDecorator", "subWidgets", "boxStyle"]), v = Ma(Object.assign({}, g, d ? { required: !0 } : {}), r, i), x = q(() => { const z = Object.keys((t == null ? void 0 : t.extras) || {}); return m.over([m.partialRight(m.pick, z), m.partialRight(m.omit, z)]); - }, [t == null ? void 0 : t.extras]), [T, R] = v(k), E = { label: o, noStyle: s, colon: !1, layout: "vertical" }, M = G((z) => z == null ? void 0 : ae(z, r), [r]); - return u(Rt, { name: i, rules: x, initialValue: M(w), normalize: M, children: (z, L, B) => { + }, [t == null ? void 0 : t.extras]), [T, R] = x(k), E = { label: o, noStyle: s, colon: !1, layout: "vertical" }, M = G((z) => z == null ? void 0 : ae(z, i), [i]); + return u(Rt, { name: r, rules: v, initialValue: M(w), normalize: M, children: (z, L, B) => { var P; - return u(e, { type: r, rcform: B, basicForm: n, itemProps: { validateStatus: L.errors.length > 0 ? "error" : "success", tooltip: h || null, help: L.errors.length > 0 ? L.errors.join("、") : null, required: ((P = x == null ? void 0 : x[0]) == null ? void 0 : P.required) || !1, ...E }, fieldProps: { placeholder: l, ...R, ...z }, $setting: Object.assign({}, c, T) }); + return u(e, { type: i, rcform: B, basicForm: n, itemProps: { validateStatus: L.errors.length > 0 ? "error" : "success", tooltip: h || null, help: L.errors.length > 0 ? L.errors.join("、") : null, required: ((P = v == null ? void 0 : v[0]) == null ? void 0 : P.required) || !1, ...E }, fieldProps: { placeholder: l, ...R, ...z }, $setting: Object.assign({}, c, T) }); } }); -}, Lt = ({ name: e, form: t = null, basicForm: n = null, style: a = {}, className: r, cols: i = 24, rowHeight: o = 16, itemMargin: s = [8, 16], containerPadding: l = [0, 0], fields: d = [], hides: c = [], primaryKey: g = 0, formProps: h = {}, formFields: p = [], listenChangeFields: f, listenChangeFieldsFunc: w, onValuesChange: C, theme: k, themeProps: x = {}, groups: v = [{ key: "default", label: "默认" }], children: T, ...R }) => { +}, Lt = ({ name: e, form: t = null, basicForm: n = null, style: a = {}, className: i, cols: r = 24, rowHeight: o = 16, itemMargin: s = [8, 16], containerPadding: l = [0, 0], fields: d = [], hides: c = [], primaryKey: g = 0, formProps: h = {}, formFields: p = [], listenChangeFields: f, listenChangeFieldsFunc: w, onValuesChange: C, theme: k, themeProps: v = {}, groups: x = [{ key: "default", label: "默认" }], children: T, ...R }) => { const [E] = Z.useForm(t), M = G((B, P) => { - C == null || C(B, P), w && Array.isArray(f) && ve.exec(w, { changedValues: B, allValues: P }, { getFieldValue: E.getFieldValue, setFieldValue: E.setFieldValue, setFieldsValue: E.setFieldsValue, isFieldTouched: E.isFieldTouched, isFieldsTouched: E.isFieldsTouched }).catch((_) => console.error("onFormValuesChange", e, _)); + C == null || C(B, P), w && Array.isArray(f) && xe.exec(w, { changedValues: B, allValues: P }, { getFieldValue: E.getFieldValue, setFieldValue: E.setFieldValue, setFieldsValue: E.setFieldsValue, isFieldTouched: E.isFieldTouched, isFieldsTouched: E.isFieldsTouched }).catch((_) => console.error("onFormValuesChange", e, _)); }, [e, E, C, f, w]), z = q(() => [{ name: "__PROPS__", value: h }, { name: "__PRIMARY_KEY__", value: g }].concat(p), [g, h, p]), L = (B, P, _) => { - const W = Et(P, At, n); - return O("div", { className: F("ff-grid-layout-form", r), style: { ...a, "--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": i, "--grid-layout-row-height": `${o}px` }, children: [W, _ && S.cloneElement(_, { cols: i, rowHeight: o, itemMargin: s, containerPadding: l, fields: P, basicForm: n })] }); + const W = Et(P, jt, n); + return O("div", { className: F("ff-grid-layout-form", i), style: { ...a, "--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": r, "--grid-layout-row-height": `${o}px` }, children: [W, _ && S.cloneElement(_, { cols: r, rowHeight: o, itemMargin: s, containerPadding: l, fields: P, basicForm: n })] }); }; - return O(Z, { ...R, form: E, fields: z, onValuesChange: M, children: [k ? u(wn, { ...x, items: v, theme: k, itemRender: L, fields: d, children: T, basicForm: n }) : L(0, d, T), c == null ? void 0 : c.map((B) => { + return O(Z, { ...R, form: E, fields: z, onValuesChange: M, children: [k ? u(bn, { ...v, items: x, theme: k, itemRender: L, fields: d, children: T, basicForm: n }) : L(0, d, T), c == null ? void 0 : c.map((B) => { var P; return u(Rt, { name: B.code, children: u(qa, { form: E, basicForm: n, name: B.code, type: B.type, initialValue: B.initialValue, initialValueLanguage: (P = B.extras) == null ? void 0 : P.initialValueLanguage }) }, JSON.stringify(B.code)); })] }); -}, qa = ({ type: e, initialValue: t, initialValueLanguage: n, onChange: a, basicForm: r }) => { - const [i, o] = yn(n == "javascript" && t, n == "javascript" ? void 0 : t, {}, {}, r); +}, qa = ({ type: e, initialValue: t, initialValueLanguage: n, onChange: a, basicForm: i }) => { + const [r, o] = wn(n == "javascript" && t, n == "javascript" ? void 0 : t, {}, {}, i); return I(() => { - n == "javascript" ? a(ae(i, e)) : t && a(ae(t, e)); - }, [e, t, i]), null; + n == "javascript" ? a(ae(r, e)) : t && a(ae(t, e)); + }, [e, t, r]), null; }; Lt.propTypes = { fields: b.array, hides: b.array }; const _a = /* @__PURE__ */ ((e) => ({ code: t, isPreview: n = !1, ...a }) => { - const { align: r, autoComplete: i, resource: o, items: s, hides: l, rowHeight: d, marginX: c, marginY: g, cols: h, listenChangeFields: p, listenChangeFieldsFunc: f, pk: w, uuid: C, theme: k, themeProps: x, groups: v } = Ia(t), T = q(() => [{ name: "__PK__", value: w }, { name: "__RESOURCE__", value: o }, { name: "__LAYOUT_KEY__", value: t }, { name: "__LAYOUT_UUID__", value: C }], [w, t, C, o]); - return u(e, { name: t, autoComplete: i, theme: k, themeProps: x, groups: v, ...a, formFields: T, listenChangeFields: p, listenChangeFieldsFunc: f, fields: s, hides: l, cols: h, rowHeight: d, itemMargin: [c, g] }); -})(Lt), Sn = ({ $setting: e, $close: t, extras: n, code: a, primaryKey: r, ...i }) => { - const [o] = Z.useForm(), s = Wa(o, a, r, e); - return u(J, { actions: O(S.Fragment, { children: [u($, { name: (e == null ? void 0 : e.okText) || "保存", type: "primary", widget: () => s({ onSuccess: t }) }), u($, { name: (e == null ? void 0 : e.cancelText) || "取消", widget: () => t(!1) })] }), extras: n, children: u(_a, { form: o, code: a, primaryKey: r, ...i }) }); -}, Gt = /* @__PURE__ */ new Set(), $t = (e = [], t = 0) => { + const { align: i, autoComplete: r, resource: o, items: s, hides: l, rowHeight: d, marginX: c, marginY: g, cols: h, listenChangeFields: p, listenChangeFieldsFunc: f, pk: w, uuid: C, theme: k, themeProps: v, groups: x } = Ia(t), T = q(() => [{ name: "__PK__", value: w }, { name: "__RESOURCE__", value: o }, { name: "__LAYOUT_KEY__", value: t }, { name: "__LAYOUT_UUID__", value: C }], [w, t, C, o]); + return u(e, { name: t, autoComplete: r, theme: k, themeProps: v, groups: x, ...a, formFields: T, listenChangeFields: p, listenChangeFieldsFunc: f, fields: s, hides: l, cols: h, rowHeight: d, itemMargin: [c, g] }); +})(Lt), xn = ({ $setting: e, $close: t, extras: n, code: a, primaryKey: i, ...r }) => { + const [o] = Z.useForm(), s = Wa(o, a, i, e); + return u(J, { actions: O(S.Fragment, { children: [u(N, { name: (e == null ? void 0 : e.okText) || "保存", type: "primary", widget: () => s({ onSuccess: t }) }), u(N, { name: (e == null ? void 0 : e.cancelText) || "取消", widget: () => t(!1) })] }), extras: n, children: u(_a, { form: o, code: a, primaryKey: i, ...r }) }); +}, Gt = /* @__PURE__ */ new Set(), Nt = (e = [], t = 0) => { const n = e[t]; if (n.length && !Gt.has(n)) { const a = document.createElement("script"); a.setAttribute("src", n), a.setAttribute("data-namespace", n), e.length > t + 1 && (a.onload = () => { - $t(e, t + 1); + Nt(e, t + 1); }, a.onerror = () => { - $t(e, t + 1); + Nt(e, t + 1); }), Gt.add(n), document.body.appendChild(a); } -}, Nt = ({ className: e, type: t, style: n = {}, ...a }) => u("span", { role: "img", className: F("ff-iconfont", e), style: n, ...a, children: u("svg", { style: { width: "1em", height: "1em", fill: "currentColor", overflow: "hidden" }, viewBox: "0 0 1024 1024", children: u("use", { xlinkHref: `#${t}` }) }) }); -Nt.propTypes = { className: b.string, type: b.string.isRequired, style: b.object }, Nt.init = $t; -const Ka = (e, t, n, a) => Se.redirect(n, t, a), Ha = (e, t = {}, n, a = {}) => { - var i; - const r = (i = a.router) == null ? void 0 : i.reduce((o, [s, l, d]) => { +}, it = ({ className: e, type: t, style: n = {}, ...a }) => u("span", { role: "img", className: F("ff-iconfont", e), style: n, ...a, children: u("svg", { style: { width: "1em", height: "1em", fill: "currentColor", overflow: "hidden" }, viewBox: "0 0 1024 1024", children: u("use", { xlinkHref: `#${t}` }) }) }); +it.propTypes = { className: b.string, type: b.string.isRequired, style: b.object }, it.init = Nt; +const Ka = (e, t, n, a) => pe.redirect(n, t, a), Ha = (e, t = {}, n, a = {}) => { + var r; + const i = (r = a.router) == null ? void 0 : r.reduce((o, [s, l, d]) => { const c = m.get(t, ["router", s]); if (!c && c !== 0 && l) throw `请传入 ${d}`; return `${o}/${c}`; }, `/api/${n}`); - return V.del(r, t.param).msg(); -}, Yt = (e, t, n, { status: { loading: a, disabled: r }, setStatus: i }) => { - const o = { loading: (s) => s === void 0 ? a : i((l) => ({ ...l, loading: s })), disabled: (s) => s === void 0 ? r : i((l) => ({ ...l, disabled: s })) }; - return m.isFunction(n) ? n.call(null, { ...t, ...o }) : m.isString(n) && n ? ve.exec(n, t, o) : null; -}, Xt = (e, t, n, a, r) => m.isString(n) && n ? re.getWidgetComponent(n).then(({ default: i }) => X.modal(i, { ...t, $setting: a }, r != null && r.title ? { ...r, title: m.template(r.title)(e) } : r)).catch((i) => { - X.error(n, { content: i.toString() }); -}) : X.modal(n, { ...t, $setting: a }, r != null && r.title ? { ...r, title: m.template(r.title)(e) } : r), Ja = (e, t, n, a, r) => X.modal(Sn, { ...t, $setting: a, code: n }, r != null && r.title ? { ...r, title: m.template(r.title)(e) } : r), Ga = (e, t, n, a, r) => X.modal(jt, { base62params: t, $setting: a, listCode: n }, r != null && r.title ? { ...r, title: m.template(r.title)(e) } : r), Ya = ({ widget: e, widgetType: t, widgetData: n, widgetProps: a, widgetSetting: r, widgetContainerProps: i }, { onAfterClick: o, onBeforeClick: s } = {}) => { - const l = ie(ee), [d, c] = A({ leading: !0, trailing: !1 }), g = q(() => { + return V.del(i, t.param).msg(); +}, Yt = (e, t, n, { status: { loading: a, disabled: i }, setStatus: r }) => { + const o = { loading: (s) => s === void 0 ? a : r((l) => ({ ...l, loading: s })), disabled: (s) => s === void 0 ? i : r((l) => ({ ...l, disabled: s })) }; + return m.isFunction(n) ? n.call(null, { ...t, ...o }) : m.isString(n) && n ? xe.exec(n, t, o) : null; +}, Xt = (e, t, n, a, i) => m.isString(n) && n ? ie.getWidgetComponent(n).then(({ default: r }) => X.modal(r, { ...t, $setting: a }, i != null && i.title ? { ...i, title: m.template(i.title)(e) } : i)).catch((r) => { + X.error(n, { content: r.toString() }); +}) : X.modal(n, { ...t, $setting: a }, i != null && i.title ? { ...i, title: m.template(i.title)(e) } : i), Ja = (e, t, n, a, i) => X.modal(xn, { ...t, $setting: a, code: n }, i != null && i.title ? { ...i, title: m.template(i.title)(e) } : i), Ga = (e, t, n, a, i) => X.modal(At, { base62params: t, $setting: a, listCode: n }, i != null && i.title ? { ...i, title: m.template(i.title)(e) } : i), Ya = ({ widget: e, widgetType: t, widgetData: n, widgetProps: a, widgetSetting: i, widgetContainerProps: r }, { onAfterClick: o, onBeforeClick: s } = {}) => { + const l = re(ee), [d, c] = j({ leading: !0, trailing: !1 }), g = q(() => { switch (t) { case "redirect": - return m.partialRight(Ka, e, r); + return m.partialRight(Ka, e, i); case "func": - return m.partialRight(Yt, (r == null ? void 0 : r.code) ?? e, { status: d, setStatus: c }); + return m.partialRight(Yt, (i == null ? void 0 : i.code) ?? e, { status: d, setStatus: c }); case "component": case "fsdpf-component": - return m.partialRight(Xt, e, r, i); + return m.partialRight(Xt, e, i, r); case "grid-layout-form": - return m.partialRight(Ja, e, r, i); + return m.partialRight(Ja, e, i, r); case "data-list": - return m.partialRight(Ga, e, r, i); + return m.partialRight(Ga, e, i, r); case "destroy": - return m.partialRight(Ha, e, r, i); + return m.partialRight(Ha, e, i, r); default: - if (It(e) || S.isValidElement(e)) return m.partialRight(Xt, e, r, i); - if (m.isFunction(e)) return m.partialRight(Yt, (r == null ? void 0 : r.code) || e, { status: d, setStatus: c }); + if (It(e) || S.isValidElement(e)) return m.partialRight(Xt, e, i, r); + if (m.isFunction(e)) return m.partialRight(Yt, (i == null ? void 0 : i.code) || e, { status: d, setStatus: c }); } return (...h) => console.error("useButton unknown widgetType", t, ...h); }, [e, t]); return [m.debounce((h) => (s == null || s(h), Promise.resolve(Ke(a, h, { list: l })).then((p) => g(h, { ...n, ...p })).then((p) => o == null ? void 0 : o(p)).catch(console.error)), 300, { leading: !0, trailing: !1 }), d]; -}, vn = ({ type: e, name: t, className: n, icon: a, iconPosition: r, size: i }, o = "default") => q(() => { - const s = { type: "primary", className: F("ff-button", n), iconPosition: r, size: i }; - return e === "danger" ? s.danger = !0 : e === "default" && (s.type = e), o === "link" || o === "dashed" ? (s.type = o, e === "default" && (s.className = F(s.className, "ff-default"))) : o !== "circle" && o !== "round" || (s.shape = o), a && (s.icon = u(Nt, { type: a })), t && (s.children = t), s; -}, [o, e, n, a, r]), dt = ({ data: e, widget: t, widgetType: n = "fsdpf-component", widgetData: a, widgetProps: r, widgetSetting: i, widgetContainerProps: o, onAfterClick: s, onBeforeClick: l, children: d, extras: c }) => { - const g = ie(ee), [h, p] = A(!1), [f, w] = A("hover"), [C, k] = A({}), [x, v] = A(), { placement: T, align: R, zIndex: E, arrow: M = { pointAtCenter: !0 }, getPopupContainer: z, isPopupMountBodyContainer: L = !0, ...B } = o || {}; +}, vn = ({ type: e, name: t, className: n, icon: a, iconPosition: i, size: r }, o = "default") => q(() => { + const s = { type: "primary", className: F("ff-button", n), iconPosition: i, size: r }; + return e === "danger" ? s.danger = !0 : e === "default" && (s.type = e), o === "link" || o === "dashed" ? (s.type = o, e === "default" && (s.className = F(s.className, "ff-default"))) : o !== "circle" && o !== "round" || (s.shape = o), a && (s.icon = u(it, { type: a })), t && (s.children = t), s; +}, [o, e, n, a, i]), ut = ({ data: e, widget: t, widgetType: n = "fsdpf-component", widgetData: a, widgetProps: i, widgetSetting: r, widgetContainerProps: o, onAfterClick: s, onBeforeClick: l, children: d, extras: c }) => { + const g = re(ee), [h, p] = j(!1), [f, w] = j("hover"), [C, k] = j({}), [v, x] = j(), { placement: T, align: R, zIndex: E, arrow: M = { pointAtCenter: !0 }, getPopupContainer: z, isPopupMountBodyContainer: L = !0, ...B } = o || {}; I(() => { - n == "grid-layout-form" ? v(S.createElement(Sn, { ...a, $setting: i, code: t })) : n == "data-list" ? v(S.createElement(jt, { base62params: e, $setting: i, listCode: t })) : m.isString(t) ? re.getWidgetComponent(t).then(({ default: W }) => { - v(S.createElement(W, { ...a, $setting: i })); - }).catch((W) => v(W.toString())) : It(t) ? v(S.createElement(t, { ...a, $setting: i })) : S.isValidElement(t) && v(S.cloneElement(t, { ...a, $setting: i })); + n == "grid-layout-form" ? x(S.createElement(xn, { ...a, $setting: r, code: t })) : n == "data-list" ? x(S.createElement(At, { base62params: e, $setting: r, listCode: t })) : m.isString(t) ? ie.getWidgetComponent(t).then(({ default: W }) => { + x(S.createElement(W, { ...a, $setting: r })); + }).catch((W) => x(W.toString())) : It(t) ? x(S.createElement(t, { ...a, $setting: r })) : S.isValidElement(t) && x(S.cloneElement(t, { ...a, $setting: r })); }, [t, n, a]), I(() => { - Promise.resolve(Ke(r, e, { list: g })).then(k); - }, [r, e, g.getBase62params]); - const P = (W, pe = !1) => (p(W), !W && w("hover"), W ? l == null ? void 0 : l(C) : s == null ? void 0 : s(pe)), _ = (W) => { + Promise.resolve(Ke(i, e, { list: g })).then(k); + }, [i, e, g.getBase62params]); + const P = (W, me = !1) => (p(W), !W && w("hover"), W ? l == null ? void 0 : l(C) : s == null ? void 0 : s(me)), _ = (W) => { p(!0), w("click"); }; - return u(Gn, { zIndex: E, placement: T, onPopupClick: _, onClick: _, open: h, align: R, arrow: M, trigger: f, getPopupContainer: z || L ? void 0 : (W) => W, content: u(Xa, { ...B, extras: c, children: x && S.cloneElement(x, { ...C, $close: (W) => P(!1, W) }) }), children: d, onOpenChange: P }); -}, Xa = ({ title: e, className: t, classNames: n, children: a, extras: r, width: i, height: o, ...s }) => { - const [l, d] = A({}), c = G((f, w) => d((C) => ({ ...C, [f]: w })), []), g = G((f) => d((w) => ({ ...w, [f]: void 0 })), []), h = e ? S.createElement("div", { className: "ff-popup-title" }, e) : l == null ? void 0 : l.title, p = r ?? S.createElement("div", { className: "ff-popup-reserved-extras" }, r); - return u(_e.Provider, { value: { ele: l, mount: c, unmount: g }, children: O("div", { className: F("ff-popup ff-popover", t, l.rootClassName), style: { width: i ?? 260, height: o }, ...s, children: [O("div", { className: F("ff-popup-header", "ff-popover-header", n == null ? void 0 : n.header), children: [h, l == null ? void 0 : l["sub-title"]] }), u("div", { className: F("ff-popup-body", "ff-popover-body", n == null ? void 0 : n.body), children: a }), O("div", { className: F("ff-popup-footer", "ff-popover-footer", n == null ? void 0 : n.footer), children: [p, l == null ? void 0 : l.extras, l == null ? void 0 : l.actions] })] }) }); + return u(Yn, { zIndex: E, placement: T, onPopupClick: _, onClick: _, open: h, align: R, arrow: M, trigger: f, getPopupContainer: z || L ? void 0 : (W) => W, content: u(Xa, { ...B, extras: c, children: v && S.cloneElement(v, { ...C, $close: (W) => P(!1, W) }) }), children: d, onOpenChange: P }); +}, Xa = ({ title: e, className: t, classNames: n, children: a, extras: i, width: r, height: o, ...s }) => { + const [l, d] = j({}), c = G((f, w) => d((C) => ({ ...C, [f]: w })), []), g = G((f) => d((w) => ({ ...w, [f]: void 0 })), []), h = e ? S.createElement("div", { className: "ff-popup-title" }, e) : l == null ? void 0 : l.title, p = i ?? S.createElement("div", { className: "ff-popup-reserved-extras" }, i); + return u(_e.Provider, { value: { ele: l, mount: c, unmount: g }, children: O("div", { className: F("ff-popup ff-popover", t, l.rootClassName), style: { width: r ?? 260, height: o }, ...s, children: [O("div", { className: F("ff-popup-header", "ff-popover-header", n == null ? void 0 : n.header), children: [h, l == null ? void 0 : l["sub-title"]] }), u("div", { className: F("ff-popup-body", "ff-popover-body", n == null ? void 0 : n.body), children: a }), O("div", { className: F("ff-popup-footer", "ff-popover-footer", n == null ? void 0 : n.footer), children: [p, l == null ? void 0 : l.extras, l == null ? void 0 : l.actions] })] }) }); }; -dt.propTypes = { widgetType: b.oneOf(["fsdpf-component", "grid-layout-form", "data-list"]) }; -const Ge = (e) => function({ className: t, variant: n, children: a, name: r, icon: i, type: o = "default", iconPosition: s = "start", noAuthType: l, onAfterClick: d, onBeforeClick: c, data: g, loading: h, disabled: p, tooltip: f, confirm: w, widget: C = () => { -}, widgetType: k, widgetData: x, widgetProps: v, widgetSetting: T, widgetContainerProps: R, ...E }) { - const { mode: M, ...z } = R || {}, L = vn({ className: t, name: r, type: o, icon: i, iconPosition: s }, n ?? e), B = u(nt, { ...L, ...E, children: a || r }); - if (M === "popover" && !["destroy", "redirect", "func"].includes(k)) return u(dt, { data: g, widget: C, widgetType: k, widgetData: x, widgetProps: v, widgetSetting: T, widgetContainerProps: z, onAfterClick: d, onBeforeClick: c, children: B }); - const P = m.isEmpty(f) || !f.enabled ? {} : f, _ = m.isEmpty(w) ? { enabled: !1 } : Object.assign({ enabled: !0 }, w), [W, pe] = A(!1), [Ye, { disabled: Xe, loading: ut }] = Ya({ widget: C, widgetType: k, widgetData: x, widgetProps: v, widgetSetting: T, widgetContainerProps: z }, { onAfterClick: d, onBeforeClick: c }); - return u(Yn, { okText: "确定", cancelText: "取消", getPopupContainer: (Q) => Q, ..._, disabled: Xe || p, open: W, onOpenChange: (Q) => { - if (!Q) return pe(Q); - _.enabled ? pe(Q) : Ye(g); +ut.propTypes = { widgetType: b.oneOf(["fsdpf-component", "grid-layout-form", "data-list"]) }; +const Ge = (e) => function({ className: t, variant: n, children: a, name: i, icon: r, type: o = "default", iconPosition: s = "start", noAuthType: l, onAfterClick: d, onBeforeClick: c, data: g, loading: h, disabled: p, tooltip: f, confirm: w, widget: C = () => { +}, widgetType: k, widgetData: v, widgetProps: x, widgetSetting: T, widgetContainerProps: R, ...E }) { + const { mode: M, ...z } = R || {}, L = vn({ className: t, name: i, type: o, icon: r, iconPosition: s }, n ?? e), B = u(nt, { ...L, ...E, children: a || i }); + if (M === "popover" && !["destroy", "redirect", "func"].includes(k)) return u(ut, { data: g, widget: C, widgetType: k, widgetData: v, widgetProps: x, widgetSetting: T, widgetContainerProps: z, onAfterClick: d, onBeforeClick: c, children: B }); + const P = m.isEmpty(f) || !f.enabled ? {} : f, _ = m.isEmpty(w) ? { enabled: !1 } : Object.assign({ enabled: !0 }, w), [W, me] = j(!1), [Ye, { disabled: Xe, loading: gt }] = Ya({ widget: C, widgetType: k, widgetData: v, widgetProps: x, widgetSetting: T, widgetContainerProps: z }, { onAfterClick: d, onBeforeClick: c }); + return u(Xn, { okText: "确定", cancelText: "取消", getPopupContainer: (Q) => Q, ..._, disabled: Xe || p, open: W, onOpenChange: (Q) => { + if (!Q) return me(Q); + _.enabled ? me(Q) : Ye(g); }, onConfirm: (Q) => { Ye(g, Q); }, onClick: (Q) => { Q.stopPropagation(); - }, children: u(Xn, { getPopupContainer: (Q) => Q, ...P, title: W ? null : P == null ? void 0 : P.title, trigger: ["hover", "click"], children: S.cloneElement(B, { loading: ut || h, disabled: Xe || p }) }) }); -}, $ = Ge("default"); -$.propTypes = { type: b.oneOf(["primary", "default", "danger", ""]), size: b.oneOf(["large", "middle", "small"]), name: b.string, icon: b.string, iconPosition: b.oneOf(["start", "end"]), data: b.any, widget: b.any, widgetType: b.oneOf(["destroy", "redirect", "func", "component", "fsdpf-component", "grid-layout-form", "grid-layout", "data-list"]), widgetData: b.object, widgetProps: b.object, widgetSetting: b.object, widgetContainerProps: b.object, tooltip: b.exact({ title: b.string.isRequired, placement: b.oneOf(["top", "left", "right", "bottom", "topLeft", "topRight", "bottomLeft", "bottomRight", "leftTop", "leftBottom", "rightTop", "rightBottom"]), enabled: b.oneOfType([b.bool, b.number]), getPopupContainer: b.func }), confirm: b.exact({ title: b.string.isRequired, cancelText: b.string, okText: b.string, okType: b.oneOf(["primary", "default", "danger", ""]), placement: b.oneOf(["top", "left", "right", "bottom", "topLeft", "topRight", "bottomLeft", "bottomRight", "leftTop", "leftBottom", "rightTop", "rightBottom"]), enabled: b.oneOfType([b.bool, b.number]), getPopupContainer: b.func, arrow: b.oneOfType([b.bool, b.exact({ pointAtCenter: b.bool })]) }) }; -const Qa = Ge("link"), Za = Ge("circle"), er = Ge("round"), tr = Ge("dashed"), Qt = ({ options: e = [], triggerWeights: t = ["grid-layout-form", "grid-layout", "fsdpf-component", "print"], onAfterClick: n = (p, f, w) => { + }, children: u(Qn, { getPopupContainer: (Q) => Q, ...P, title: W ? null : P == null ? void 0 : P.title, trigger: ["hover", "click"], children: S.cloneElement(B, { loading: gt || h, disabled: Xe || p }) }) }); +}, N = Ge("default"); +N.propTypes = { type: b.oneOf(["primary", "default", "danger", ""]), size: b.oneOf(["large", "middle", "small"]), name: b.string, icon: b.string, iconPosition: b.oneOf(["start", "end"]), data: b.any, widget: b.any, widgetType: b.oneOf(["destroy", "redirect", "func", "component", "fsdpf-component", "grid-layout-form", "grid-layout", "data-list"]), widgetData: b.object, widgetProps: b.object, widgetSetting: b.object, widgetContainerProps: b.object, tooltip: b.exact({ title: b.string.isRequired, placement: b.oneOf(["top", "left", "right", "bottom", "topLeft", "topRight", "bottomLeft", "bottomRight", "leftTop", "leftBottom", "rightTop", "rightBottom"]), enabled: b.oneOfType([b.bool, b.number]), getPopupContainer: b.func }), confirm: b.exact({ title: b.string.isRequired, cancelText: b.string, okText: b.string, okType: b.oneOf(["primary", "default", "danger", ""]), placement: b.oneOf(["top", "left", "right", "bottom", "topLeft", "topRight", "bottomLeft", "bottomRight", "leftTop", "leftBottom", "rightTop", "rightBottom"]), enabled: b.oneOfType([b.bool, b.number]), getPopupContainer: b.func, arrow: b.oneOfType([b.bool, b.exact({ pointAtCenter: b.bool })]) }) }; +const Qa = Ge("link"), Za = Ge("circle"), ei = Ge("round"), ti = Ge("dashed"), Qt = ({ options: e = [], triggerWeights: t = ["grid-layout-form", "grid-layout", "fsdpf-component", "print"], onAfterClick: n = (p, f, w) => { }, onBeforeClick: a = (p, f, w) => { -}, labelVariant: r = "link", labelSize: i, labelRender: o, btnVariant: s, btnSize: l, btnRender: d = (p, f) => u($, { ...p, data: f }, p.uuid || yt()), widgetContainerProps: c = {}, children: g, data: h }) => { +}, labelVariant: i = "link", labelSize: r, labelRender: o, btnVariant: s, btnSize: l, btnRender: d = (p, f) => u(N, { ...p, data: f }, p.uuid || wt()), widgetContainerProps: c = {}, children: g, data: h }) => { if (m.isEmpty(e)) return g; const [p, f] = q(() => (e || []).reduce((C, k) => { - const x = t.indexOf(k.widgetType); - return x === -1 ? C[1].push(k) : C[0] ? x < t.indexOf(C[0].widgetType) ? (C[1].push(C[0]), C[0] = k) : C[1].push(k) : C[0] = k, C; + const v = t.indexOf(k.widgetType); + return v === -1 ? C[1].push(k) : C[0] ? v < t.indexOf(C[0].widgetType) ? (C[1].push(C[0]), C[0] = k) : C[1].push(k) : C[0] = k, C; }, [null, []]), [e, t]); - o ? g = o(p, h) || g : g || (g = u(nt, { ...vn(Object.assign(p != null && p.name || p != null && p.icon ? {} : { icon: "icon-location" }, p, { size: i }), r) })); + o ? g = o(p, h) || g : g || (g = u(nt, { ...vn(Object.assign(p != null && p.name || p != null && p.icon ? {} : { icon: "icon-location" }, p, { size: r }), i) })); const w = f.map((C) => d(Object.assign({ uuid: C.uuid, type: C.type, name: C.name, widget: C.widget, widgetType: C.widgetType, widgetProps: C.widgetProps, widgetData: C.widgetData, widgetSetting: C.widgetSetting, widgetContainerProps: C.widgetContainerSetting, confirm: C.confirm, onAfterClick: m.partialRight(n, C, h), onBeforeClick: m.partialRight(a, C, h) }, { size: l, variant: s }), h)); - return u(dt, { widget: p == null ? void 0 : p.widget, widgetType: p == null ? void 0 : p.widgetType, widgetProps: p == null ? void 0 : p.widgetProps, widgetSetting: p == null ? void 0 : p.widgetSetting, widgetContainerProps: Object.assign({}, c, p == null ? void 0 : p.widgetContainerProps), data: h, widgetData: p == null ? void 0 : p.widgetData, extras: w, onAfterClick: m.partialRight(n, p, h), onBeforeClick: m.partialRight(a, p, h), children: g }); + return u(ut, { widget: p == null ? void 0 : p.widget, widgetType: p == null ? void 0 : p.widgetType, widgetProps: p == null ? void 0 : p.widgetProps, widgetSetting: p == null ? void 0 : p.widgetSetting, widgetContainerProps: Object.assign({}, c, p == null ? void 0 : p.widgetContainerProps), data: h, widgetData: p == null ? void 0 : p.widgetData, extras: w, onAfterClick: m.partialRight(n, p, h), onBeforeClick: m.partialRight(a, p, h), children: g }); }; -Qt.propTypes = { triggerWeights: b.array, options: b.arrayOf(b.shape({ ...$.propTypes, widgetType: $.propTypes.widgetType.isRequired })), btnSize: $.propTypes.size, btnRender: b.func, btnVariant: b.oneOf(["", "default", "link", "circle", "round", "dashed"]), labelVariant: b.oneOf(["", "default", "link", "circle", "round", "dashed"]), labelRender: b.func, labelSize: $.propTypes.size, onAfterClick: b.func, onBeforeClick: b.func, widgetContainerProps: $.propTypes.widgetContainerProps, data: $.propTypes.data }, $.Link = Qa, $.Link.defaultProps = $.defaultProps, $.Link.propTypes = $.propTypes, $.Circle = Za, $.Circle.defaultProps = $.defaultProps, $.Circle.propTypes = $.propTypes, $.Round = er, $.Round.defaultProps = $.defaultProps, $.Round.propTypes = $.propTypes, $.Dashed = tr, $.Dashed.defaultProps = $.defaultProps, $.Dashed.propTypes = $.propTypes, $.Popover = dt, $.GroupPopover = Qt; -const nr = ({ fields: e, formProps: t, $close: n }) => { - const [a] = Z.useForm(), r = q(() => [{ name: "__PROPS__", value: t }], [t]); - return u(J, { actions: O(S.Fragment, { children: [u($, { name: "取消", widget: () => n(!1) }), u($, { name: "确定", type: "primary", widget: () => a.validateFields(!0).then(n) })] }), children: u(Z, { fields: r, form: a, className: "ff-modal-form", children: e == null ? void 0 : e.map(({ code: i, ...o }) => u(At, { code: i, ...o }, i)) }) }); -}, ar = ({ className: e, classNames: t, $close: n, children: a, title: r, subTitle: i, actions: o, extras: s, ...l }) => O(ra, { ...l, prefixCls: "ff-drawer", className: F("ff-popup", e), maskMotion: { motionAppear: !0, motionName: "mask-motion" }, motion: (d) => ({ motionAppear: !0, motionName: `panel-motion-${d}` }), children: [O("div", { className: F("ff-popup-header", "ff-drawer-header", t == null ? void 0 : t.header), children: [u("button", { "aria-label": "Close", className: F("ff-popup-close", "ff-drawer-close", t == null ? void 0 : t.close), onClick: l.onClose, children: u(Ot, { type: "close" }) }), r, i] }), u("div", { className: F("ff-popup-body", "ff-drawer-body", t == null ? void 0 : t.body), children: a }), O("div", { className: F("ff-popup-footer", "ff-drawer-footer", t == null ? void 0 : t.footer), children: [s, o] })] }), rr = ({ className: e, classNames: t, $close: n, $event: a, children: r, title: i, subTitle: o, actions: s, extras: l, placement: d, ...c }) => { +Qt.propTypes = { triggerWeights: b.array, options: b.arrayOf(b.shape({ ...N.propTypes, widgetType: N.propTypes.widgetType.isRequired })), btnSize: N.propTypes.size, btnRender: b.func, btnVariant: b.oneOf(["", "default", "link", "circle", "round", "dashed"]), labelVariant: b.oneOf(["", "default", "link", "circle", "round", "dashed"]), labelRender: b.func, labelSize: N.propTypes.size, onAfterClick: b.func, onBeforeClick: b.func, widgetContainerProps: N.propTypes.widgetContainerProps, data: N.propTypes.data }, N.Link = Qa, N.Link.defaultProps = N.defaultProps, N.Link.propTypes = N.propTypes, N.Circle = Za, N.Circle.defaultProps = N.defaultProps, N.Circle.propTypes = N.propTypes, N.Round = ei, N.Round.defaultProps = N.defaultProps, N.Round.propTypes = N.propTypes, N.Dashed = ti, N.Dashed.defaultProps = N.defaultProps, N.Dashed.propTypes = N.propTypes, N.Popover = ut, N.GroupPopover = Qt; +const ni = ({ fields: e, formProps: t, $close: n }) => { + const [a] = Z.useForm(), i = q(() => [{ name: "__PROPS__", value: t }], [t]); + return u(J, { actions: O(S.Fragment, { children: [u(N, { name: "取消", widget: () => n(!1) }), u(N, { name: "确定", type: "primary", widget: () => a.validateFields(!0).then(n) })] }), children: u(Z, { fields: i, form: a, className: "ff-modal-form", children: e == null ? void 0 : e.map(({ code: r, ...o }) => u(jt, { code: r, ...o }, r)) }) }); +}, ai = ({ className: e, classNames: t, $close: n, children: a, title: i, subTitle: r, actions: o, extras: s, ...l }) => O(ra, { ...l, prefixCls: "ff-drawer", className: F("ff-popup", e), maskMotion: { motionAppear: !0, motionName: "mask-motion" }, motion: (d) => ({ motionAppear: !0, motionName: `panel-motion-${d}` }), children: [O("div", { className: F("ff-popup-header", "ff-drawer-header", t == null ? void 0 : t.header), children: [u("button", { "aria-label": "Close", className: F("ff-popup-close", "ff-drawer-close", t == null ? void 0 : t.close), onClick: l.onClose, children: u(Ot, { type: "close" }) }), i, r] }), u("div", { className: F("ff-popup-body", "ff-drawer-body", t == null ? void 0 : t.body), children: a }), O("div", { className: F("ff-popup-footer", "ff-drawer-footer", t == null ? void 0 : t.footer), children: [s, o] })] }), ii = ({ className: e, classNames: t, $close: n, $event: a, children: i, title: r, subTitle: o, actions: s, extras: l, placement: d, ...c }) => { const g = (a == null ? void 0 : a.pageX) === void 0 ? { animation: null, maskAnimation: null, mousePosition: { x: null, y: null } } : { animation: "zoom", maskAnimation: "fade", mousePosition: { x: a == null ? void 0 : a.pageX, y: a == null ? void 0 : a.pageY } }; - return u(ia, { ...c, ...g, prefixCls: "ff-modal", modalRender: () => O("div", { className: F("ff-modal-content ff-popup", e), children: [O("div", { className: F("ff-popup-header", "ff-modal-header", t == null ? void 0 : t.header), children: [u("button", { "aria-label": "Close", className: F("ff-popup-close", "ff-modal-close", t == null ? void 0 : t.close), onClick: c.onClose, children: u(Ot, { type: "close" }) }), i, o] }), u("div", { className: F("ff-popup-body", "ff-modal-body", t == null ? void 0 : t.body), children: r }), O("div", { className: F("ff-popup-footer", "ff-modal-footer", t == null ? void 0 : t.footer), children: [l, s] })] }) }); -}, xn = ({ placement: e, $close: t, $event: n, children: a, title: r, ...i }) => { - const [o, s] = A({}), [l, d] = A(!0), c = G((f, w) => s((C) => ({ ...C, [f]: w })), []), g = G((f) => s((w) => ({ ...w, [f]: void 0 })), []); - let h = { ...i, className: o.rootClassName, title: o.title || r && S.createElement("div", { className: F("ff-popup-title") }, r), subTitle: o["sub-title"], actions: o.actions, extras: o.extras, children: a, $close: t, $event: n, onClose: () => d(!1) }; + return u(oa, { ...c, ...g, prefixCls: "ff-modal", modalRender: () => O("div", { className: F("ff-modal-content ff-popup", e), children: [O("div", { className: F("ff-popup-header", "ff-modal-header", t == null ? void 0 : t.header), children: [u("button", { "aria-label": "Close", className: F("ff-popup-close", "ff-modal-close", t == null ? void 0 : t.close), onClick: c.onClose, children: u(Ot, { type: "close" }) }), r, o] }), u("div", { className: F("ff-popup-body", "ff-modal-body", t == null ? void 0 : t.body), children: i }), O("div", { className: F("ff-popup-footer", "ff-modal-footer", t == null ? void 0 : t.footer), children: [l, s] })] }) }); +}, Pn = ({ placement: e, $close: t, $event: n, children: a, title: i, ...r }) => { + const [o, s] = j({}), [l, d] = j(!0), c = G((f, w) => s((C) => ({ ...C, [f]: w })), []), g = G((f) => s((w) => ({ ...w, [f]: void 0 })), []); + let h = { ...r, className: o.rootClassName, title: o.title || i && S.createElement("div", { className: F("ff-popup-title") }, i), subTitle: o["sub-title"], actions: o.actions, extras: o.extras, children: a, $close: t, $event: n, onClose: () => d(!1) }; const p = () => { t(!1); }; - return u(_e.Provider, { value: { ele: o, mount: c, unmount: g }, children: e && e !== "center" ? u(ar, { ...h, placement: e, open: l, afterOpenChange: (f) => !f && p() }) : u(rr, { ...h, visible: l, afterClose: p }) }); + return u(_e.Provider, { value: { ele: o, mount: c, unmount: g }, children: e && e !== "center" ? u(ai, { ...h, placement: e, open: l, afterOpenChange: (f) => !f && p() }) : u(ii, { ...h, visible: l, afterClose: p }) }); }; -xn.propTypes = { placement: b.oneOf(["center", "left", "top", "right", "bottom"]) }; +Pn.propTypes = { placement: b.oneOf(["center", "left", "top", "right", "bottom"]) }; const Y = () => { - const [e, t] = Bn({ maxCount: 6, motion: { motionName: "ff-notification-fade", motionAppear: !0, motionEnter: !0, motionLeave: !0, onLeaveStart: (i) => { - const { offsetHeight: o } = i; + const [e, t] = Wn({ maxCount: 6, motion: { motionName: "ff-notification-fade", motionAppear: !0, motionEnter: !0, motionLeave: !0, onLeaveStart: (r) => { + const { offsetHeight: o } = r; return { height: o }; - }, onLeaveActive: () => ({ height: 0, opacity: 0, margin: 0 }) }, prefixCls: "ff-notification" }), [, n] = S.useReducer((i) => i + 1, 0); + }, onLeaveActive: () => ({ height: 0, opacity: 0, margin: 0 }) }, prefixCls: "ff-notification" }), [, n] = S.useReducer((r) => r + 1, 0); I(() => { - Y.$onClick = a, Y.$queue.forEach(([i, o, s], l, d) => { - r([o, s], ...i), delete d[l]; + Y.$onClick = a, Y.$queue.forEach(([r, o, s], l, d) => { + i([o, s], ...r), delete d[l]; }); }, []); - const a = (i, o = {}, s = {}) => new Promise((l, d) => r([l, d], i, o, s)), r = ([i, o], s, l = {}, d = {}) => { - const c = Y.$index++, g = (h) => ((p, f) => (Y.$popups.delete(p), n(), f == null ? void 0 : f()))(c, () => i(h)); + const a = (r, o = {}, s = {}) => new Promise((l, d) => i([l, d], r, o, s)), i = ([r, o], s, l = {}, d = {}) => { + const c = Y.$index++, g = (h) => ((p, f) => (Y.$popups.delete(p), n(), f == null ? void 0 : f()))(c, () => r(h)); if (s === on) return e.open({ ...d, key: c, content: S.createElement(s, { ...l, $close: () => e.close(c) }) }); - Y.$popups.set(c, S.createElement(xn, { maskClosable: !1, $event: l == null ? void 0 : l.$event, ...d, key: c, $close: g }, S.isValidElement(s) ? S.cloneElement(s, { ...l, $close: g }) : s != null && s.name || Dt.isForwardRef(s) || (s == null ? void 0 : s.$$typeof) === Dt.ForwardRef ? S.createElement(s, { ...l, $close: g }) : s)), n(); + Y.$popups.set(c, S.createElement(Pn, { maskClosable: !1, $event: l == null ? void 0 : l.$event, ...d, key: c, $close: g }, S.isValidElement(s) ? S.cloneElement(s, { ...l, $close: g }) : s != null && s.name || Dt.isForwardRef(s) || (s == null ? void 0 : s.$$typeof) === Dt.ForwardRef ? S.createElement(s, { ...l, $close: g }) : s)), n(); }; - return O(S.Fragment, { children: [Array.from(Y.$popups).map(([i, o]) => o), t] }); + return O(S.Fragment, { children: [Array.from(Y.$popups).map(([r, o]) => o), t] }); }; Y.$popups = /* @__PURE__ */ new Map(), Y.$index = 0, Y.$queue = [], Y.$onClick = (...e) => new Promise((t, n) => { Y.$queue.push([e, t, n]); }); -const Zt = (e, t, n = {}) => Y.$onClick(e, t, n), ht = (e, { showProgress: t, duration: n, ...a } = { duration: 1.5 }) => Y.$onClick(on, { content: e, ...a }, { showProgress: t, duration: n }), X = { modal: Zt, confirm: (e, t = {}) => Y.$onClick(oa, { content: e, ...t }, { placement: "center" }), form: (e, t = {}, n = {}) => Zt(nr, { formProps: n, fields: e }, { placement: "center", ...t }).then((a) => { +const Zt = (e, t, n = {}) => Y.$onClick(e, t, n), ft = (e, { showProgress: t, duration: n, ...a } = { duration: 1.5 }) => Y.$onClick(on, { content: e, ...a }, { showProgress: t, duration: n }), X = { modal: Zt, confirm: (e, t = {}) => Y.$onClick(sa, { content: e, ...t }, { placement: "center" }), form: (e, t = {}, n = {}) => Zt(ni, { formProps: n, fields: e }, { placement: "center", ...t }).then((a) => { if (a === !1) throw !1; return a; -}), notification: ht, success: (e, t = { duration: 1.5 }) => ht(e, { ...t, className: "ff-notification-success", icon: "check" }), error: (e, t = { duration: 1.5 }) => ht(e, { ...t, className: "ff-notification-error", icon: "close" }) }; -Le.configure({ showSpinner: !1 }), Ve.interceptors.request.use((e) => { +}), notification: ft, success: (e, t = { duration: 1.5 }) => ft(e, { ...t, className: "ff-notification-success", icon: "check" }), error: (e, t = { duration: 1.5 }) => ft(e, { ...t, className: "ff-notification-error", icon: "close" }) }; +Ve.configure({ showSpinner: !1 }), Ie.interceptors.request.use((e) => { e.headers.Platform = "web", e.headers.SaaS = window.localStorage.getItem("SaaS"); const t = window.localStorage.getItem(tt); - return e.headers.Authorization = t ? `Bearer ${t} ` : void 0, Le.inc(), e; -}, (e) => (Le.done(), Promise.reject({ code: -1, msg: e }))), Ve.interceptors.response.use(({ data: e, headers: t }) => (Le.done(), { ...e, res: t == null ? void 0 : t.res }), function(e) { - return Le.done(), Promise.reject(e.message); -}), window.addEventListener("unhandledrejection", wt.onUnhandledRejection), wt.onMsg = (e, t) => X[[0, 1].includes(e) ? "success" : "error"](t).then(() => e === 20300 && Se.redirect(Ie.get("Common.WEBSITE_LOGIN_PAGE"))); + return e.headers.Authorization = t ? `Bearer ${t} ` : void 0, Ve.inc(), e; +}, (e) => (Ve.done(), Promise.reject({ code: -1, msg: e }))), Ie.interceptors.response.use(({ data: e, headers: t }) => (Ve.done(), { ...e, res: t == null ? void 0 : t.res }), function(e) { + return Ve.done(), Promise.reject(e.message); +}), window.addEventListener("unhandledrejection", bt.onUnhandledRejection), bt.onMsg = (e, t) => X[[0, 1].includes(e) ? "success" : "error"](t).then(() => e === 20300 && pe.redirect(Te.get("Common.WEBSITE_LOGIN_PAGE"))); var Ne, je; const H = class H { constructor() { - N(this, "appUrl", ""); - return y(H, Ne) || (U(H, je, new wt()), U(H, Ne, new Proxy(this, { get: (t, n) => n === "init" ? t.init : n === "appUrl" ? t.appUrl : y(H, je)[n] }))), y(H, Ne); + $(this, "appUrl", ""); + return y(H, Ne) || (U(H, je, new bt()), U(H, Ne, new Proxy(this, { get: (t, n) => n === "init" ? t.init : n === "appUrl" ? t.appUrl : y(H, je)[n] }))), y(H, Ne); } init(t, n, a) { - Ve.defaults.baseURL = this.appUrl = a, Ve.defaults.timeout = 15e3, y(H, je).init(t, n, Ve); + Ie.defaults.baseURL = this.appUrl = a, Ie.defaults.timeout = 15e3, y(H, je).init(t, n, Ie); } }; -Ne = new WeakMap(), je = new WeakMap(), j(H, Ne, null), j(H, je, null), N(H, "getInstance", () => y(H, Ne) ?? U(H, Ne, new H())); +Ne = new WeakMap(), je = new WeakMap(), A(H, Ne, null), A(H, je, null), $(H, "getInstance", () => y(H, Ne) ?? U(H, Ne, new H())); let Tt = H; const V = Tt.getInstance(); class Vt extends Error { @@ -1007,39 +1007,39 @@ class Me extends Error { super(...n), Error.captureStackTrace && Error.captureStackTrace(this, Me), this.name = `${t} Not Found`; } } -const ft = "mine", tt = "token"; -var ke, Ae; +const yt = "mine", tt = "token"; +var Se, Le; const de = class de { constructor() { - j(this, Ae, /* @__PURE__ */ new Map()); - N(this, "setVendor", (t, n) => y(this, Ae).set(t, new an(n, async (a, r) => { + A(this, Le, /* @__PURE__ */ new Map()); + $(this, "setVendor", (t, n) => y(this, Le).set(t, new an(n, async (a, i) => { var o, s; if (!(a != null && a.default)) throw "@pkg not found"; - let i = () => r; + let r = () => i; switch ("function") { - case typeof (i = (o = a.default) == null ? void 0 : o[`./${r}/index.jsx`]): - case typeof (i = (s = a.default) == null ? void 0 : s[`./${r}/index.js`]): - return i(); + case typeof (r = (o = a.default) == null ? void 0 : o[`./${i}/index.jsx`]): + case typeof (r = (s = a.default) == null ? void 0 : s[`./${i}/index.js`]): + return r(); } - throw new Me(r); + throw new Me(i); }))); - N(this, "getWidgetComponent", async (t) => { + $(this, "getWidgetComponent", async (t) => { if (!t) throw "getWidgetComponent widget is required"; if (t != null && t.startsWith("blob:") || t != null && t.startsWith("http:") || t != null && t.startsWith("https:")) return await import(t); const [, n] = t == null ? void 0 : t.split("@pkg/"); if (!n) throw new Me(t); try { - return y(this, Ae).has("pkg") ? await y(this, Ae).get("pkg").get(n) : await import(`${V.appUrl}/api/pkg-import/web?name=${t}`); + return y(this, Le).has("pkg") ? await y(this, Le).get("pkg").get(n) : await import(`${V.appUrl}/api/pkg-import/web?name=${t}`); } catch (a) { throw new Vt(t, a); } }); - N(this, "getRoutes", () => V.get("/api/my-router").then((t) => [...t, { 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, ...a }) => [n, { uuid: n, ...a }])).then((t) => new Map(t))); - N(this, "getMenus", () => V.get("/api/my-menu")); - N(this, "getConfigure", () => V.get("api/init-configure")); - N(this, "getWidgetOperationAuth", () => V.get("/api/init-widget-operation-auth").then((t) => t.reduce((n, { uuid: a, auth: r }) => [...n, [a, r]], []))); - N(this, "getPhoneNumber", (t) => V.get(`/api/user-wx-phone-number/${t}`)); - N(this, "getUserToken", () => { + $(this, "getRoutes", () => V.get("/api/my-router").then((t) => [...t, { 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, ...a }) => [n, { uuid: n, ...a }])).then((t) => new Map(t))); + $(this, "getMenus", () => V.get("/api/my-menu")); + $(this, "getConfigure", () => V.get("api/init-configure")); + $(this, "getWidgetOperationAuth", () => V.get("/api/init-widget-operation-auth").then((t) => t.reduce((n, { uuid: a, auth: i }) => [...n, [a, i]], []))); + $(this, "getPhoneNumber", (t) => V.get(`/api/user-wx-phone-number/${t}`)); + $(this, "getUserToken", () => { const t = window.localStorage.getItem(tt); if (!t) return ""; const n = t.split("."); @@ -1048,134 +1048,138 @@ const de = class de { if (Math.floor((/* @__PURE__ */ new Date()).getTime() / 1e3) - a > 2592e3) throw "登录令牌已过期, 请重新登录!"; return t; }); - N(this, "checkUserToken", () => { + $(this, "checkUserToken", () => { try { return !!this.getUserToken(); } catch { return !1; } }); - N(this, "getUserInfo", (t = !0) => { + $(this, "getUserInfo", (t = !0) => { var n; try { const a = this.getUserToken(); if (!a) return Promise.resolve(null); - const { iat: r } = JSON.parse(window.atob((n = a == null ? void 0 : a.split(".")) == null ? void 0 : n[1])), { iat: i, ...o } = V.decode(window.localStorage.getItem(ft) || "", {}); - return i === r ? Promise.resolve(o) : V.get("/api/mine-info").then(({ User: s = null }) => (window.localStorage.setItem(ft, V.encode({ ...s, iat: r })), s)); + const { iat: i } = JSON.parse(window.atob((n = a == null ? void 0 : a.split(".")) == null ? void 0 : n[1])), { iat: r, ...o } = V.decode(window.localStorage.getItem(yt) || "", {}); + return r === i ? Promise.resolve(o) : V.get("/api/mine-info").then(({ User: s = null }) => (window.localStorage.setItem(yt, V.encode({ ...s, iat: i })), s)); } catch (a) { console.error(a), t && X.error("请登录").then(this.logout); } return Promise.resolve(null); }); - N(this, "login", (t, n, a = {}) => V.post("/api/user-token", { username: t, passwd: Wn.hash(n), platform: "web", ...a }).then(({ token: r }) => (window.localStorage.setItem(tt, r), r))); - N(this, "logout", (t) => (window.localStorage.removeItem(ft), window.localStorage.removeItem(tt), t == null ? void 0 : t())); - if (y(de, ke)) return y(de, ke); + $(this, "login", (t, n, a = {}) => V.post("/api/user-token", { username: t, passwd: Dn.hash(n), platform: "web", ...a }).then(({ token: i }) => (window.localStorage.setItem(tt, i), i)).then(async (i) => (await this.initAppEnv(), i))); + $(this, "logout", (t) => (window.localStorage.removeItem(yt), window.localStorage.removeItem(tt), t == null ? void 0 : t())); + $(this, "initAppEnv", async () => { + const [t, n, a, i] = await Promise.all([this.getWidgetOperationAuth(), this.getRoutes(), this.getMenus(), this.getConfigure()]); + return sn.init(t), Te.init(i), pe.init(n, a), it.init(Te.get("Common.ICONFONT")), { widgetOperationAuth: t, routes: n, menus: a, configures: i }; + }); + if (y(de, Se)) return y(de, Se); } }; -ke = new WeakMap(), Ae = new WeakMap(), j(de, ke, null), N(de, "getInstance", () => (y(de, ke) || U(de, ke, new de()), y(de, ke))); +Se = new WeakMap(), Le = new WeakMap(), A(de, Se, null), $(de, "getInstance", () => (y(de, Se) || U(de, Se, new de()), y(de, Se))); let Ft = de; -const re = Ft.getInstance(), ir = S.createContext({ user: {}, initUser: () => { -}, initUserComplete: !1 }), or = S.createContext({ set: () => { +const ie = Ft.getInstance(), ri = S.createContext({ user: {}, initUser: () => { +}, initUserComplete: !1 }), oi = S.createContext({ set: () => { }, get: () => { }, assign: () => { }, currentRoute: () => { -} }), It = (e) => !!(e != null && e.name) && (e.prototype instanceof S.Component || /^[A-Z]/.test(e.name)), sr = (e, t) => { +} }), It = (e) => !!(e != null && e.name) && (e.prototype instanceof S.Component || /^[A-Z]/.test(e.name)), si = (e, t) => { if (!e || typeof window > "u") return; let n = document.querySelector(`style[ff-style-token="${t}"]`); return n ? (n.innerHTML = e, e) : (n = document.createElement("style"), n.setAttribute("ff-style-token", t), n.setAttribute("type", "text/css"), n.innerHTML = e, document.head.appendChild(n), e); -}, lr = Object.freeze(Object.defineProperty({ __proto__: null, AppContext: ir, AppGlobalParamsContext: or, cache: an, configure: Ie, default: re, func: ve, http: V, insertStyle: sr, isReactComponent: It, route: Se }, Symbol.toStringTag, { value: "Module" })); +}, li = Object.freeze(Object.defineProperty({ __proto__: null, AppContext: ri, AppGlobalParamsContext: oi, cache: an, configure: Te, default: ie, func: xe, http: V, insertStyle: si, isReactComponent: It, route: pe }, Symbol.toStringTag, { value: "Module" })); export { - ct as $, - mn as A, - pn as B, + dt as $, + hn as A, + mn as B, $a as C, at as D, Pa as E, - va as F, - Ir as G, + xa as F, + Ii as G, Ta as H, - jt as I, + At as I, ee as J, Na as K, - ja as L, + Aa as L, ba as M, ka as N, ha as O, fa as P, - jr as Q, - hn as R, - Ar as S, - un as T, - St as U, + Ai as Q, + fn as R, + ji as S, + gn as T, + xt as U, ya as V, wa as W, - Aa as X, + ja as X, La as Y, - Mr as Z, - zr as _, - sn as a, - Br as a0, - Wr as a1, + Mi as Z, + zi as _, + ln as a, + Bi as a0, + Wi as a1, He as a2, Je as a3, - Dr as a4, - Ur as a5, + Di as a4, + Ui as a5, _a as a6, Lt as a7, - At as a8, - Sn as a9, - Se as aA, - ir as aB, - or as aC, + jt as a8, + xn as a9, + pe as aA, + ri as aB, + oi as aC, Ia as aa, Ma as ab, za as ac, Ba as ad, Wa as ae, Da as af, - qr as ag, - Nt as ah, - $ as ai, - sa as aj, + qi as ag, + it as ah, + N as ai, + sn as aj, Ya as ak, J as al, _e as am, rn as an, Y as ao, X as ap, - Pr as aq, - $r as ar, - Nr as as, - re as at, + Pi as aq, + $i as ar, + Ni as as, + ie as at, It as au, - sr as av, + si as av, V as aw, an as ax, - Ie as ay, - ve as az, + Te as ay, + xe as az, ca as b, Ke as c, - ln as d, - Fr as e, - Rr as f, + cn as d, + Fi as e, + Ri as f, la as g, - Or as h, + Oi as h, da as i, ga as j, - Er as k, - gn as l, + Ei as k, + pn as l, ua as m, - Lr as n, + Li as n, Et as o, - fn as p, - bn as q, - mt as r, + yn as p, + Cn as q, + ht as r, Oa as s, ae as t, - Tr as u, - wn as v, + Ti as u, + bn as v, Fa as w, Ra as x, - Vr as y, - yn as z + Vi as y, + wn as z }; diff --git a/dist/components.js b/dist/components.js index 8b34d77..cd104f7 100644 --- a/dist/components.js +++ b/dist/components.js @@ -1,4 +1,4 @@ -import { aq as s, ah as p, ar as n, as as r, ap as t } from "./common/main-ROZ7DqNn.js"; +import { aq as s, ah as p, ar as n, as as r, ap as t } from "./common/main-BEaQ6Xnt.js"; export { s as Empty, p as Icon, diff --git a/dist/container.js b/dist/container.js index bfa68c8..0b85c37 100644 --- a/dist/container.js +++ b/dist/container.js @@ -1,4 +1,4 @@ -import { am as s, aq as e, ar as p, as as n, an as t, ap as d, ao as r, al as u } from "./common/main-ROZ7DqNn.js"; +import { am as s, aq as e, ar as p, as as n, an as t, ap as d, ao as r, al as u } from "./common/main-BEaQ6Xnt.js"; export { s as Context, e as Empty, diff --git a/dist/data-converter.js b/dist/data-converter.js index bebcad0..bad7710 100644 --- a/dist/data-converter.js +++ b/dist/data-converter.js @@ -1,6 +1,6 @@ import "lodash"; import "react"; -import { D as p } from "./common/main-ROZ7DqNn.js"; +import { D as p } from "./common/main-BEaQ6Xnt.js"; export { p as default }; diff --git a/dist/data-list.js b/dist/data-list.js index 4dedfda..0117478 100644 --- a/dist/data-list.js +++ b/dist/data-list.js @@ -1,4 +1,4 @@ -import { L as t, J as e, B as r, F as o, M as i, I as l, E as u, K as D, C as n, N as L, A as C, P as m, O as p, W as b, S as c, U as F, T as d, V as O, Q as S } from "./common/main-ROZ7DqNn.js"; +import { L as t, J as e, B as r, F as o, M as i, I as l, E as u, K as D, C as n, N as L, A as C, P as m, O as p, W as b, S as c, U as F, T as d, V as O, Q as S } from "./common/main-BEaQ6Xnt.js"; export { t as DataListContent, e as DataListContext, diff --git a/dist/data-list/utils.js b/dist/data-list/utils.js index 37827d3..dcbc4fe 100644 --- a/dist/data-list/utils.js +++ b/dist/data-list/utils.js @@ -1,5 +1,5 @@ import "lodash"; -import { p as t } from "../common/main-ROZ7DqNn.js"; +import { p as t } from "../common/main-BEaQ6Xnt.js"; export { t as getDefaultExpandRowKeys }; diff --git a/dist/grid-layout-form.js b/dist/grid-layout-form.js index 37332f5..ceaedf1 100644 --- a/dist/grid-layout-form.js +++ b/dist/grid-layout-form.js @@ -1,4 +1,4 @@ -import { a7 as s, a9 as r, a8 as u, a6 as o, z as t, ae as m, ac as d, ad as F, ag as i, ab as g, aa as c, af as l } from "./common/main-ROZ7DqNn.js"; +import { a7 as s, a9 as r, a8 as u, a6 as o, z as t, ae as m, ac as d, ad as F, ag as i, ab as g, aa as c, af as l } from "./common/main-BEaQ6Xnt.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 31fe828..b223971 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-ROZ7DqNn.js"; +import { a as o, g } from "../common/main-BEaQ6Xnt.js"; export { o as getNormalizeWidget, g as getOptionItemByValue diff --git a/dist/grid-layout.js b/dist/grid-layout.js index 9826c95..52c10f5 100644 --- a/dist/grid-layout.js +++ b/dist/grid-layout.js @@ -1,4 +1,4 @@ -import { q as u, v as e, s as r, H as t, G as d, x as i, z as o, y, w as G } from "./common/main-ROZ7DqNn.js"; +import { q as u, v as e, s as r, H as t, G as d, x as i, z as o, y, w as G } from "./common/main-BEaQ6Xnt.js"; export { u as GridLayout, e as GridLayoutFramework, diff --git a/dist/grid-layout/utils.js b/dist/grid-layout/utils.js index 50a7dca..6aacd59 100644 --- a/dist/grid-layout/utils.js +++ b/dist/grid-layout/utils.js @@ -1,4 +1,4 @@ -import { l as t, o as a, n as l } from "../common/main-ROZ7DqNn.js"; +import { l as t, o as a, n as l } from "../common/main-BEaQ6Xnt.js"; export { t as getBoxStyle, a as getNormalizeFields, diff --git a/dist/hooks.js b/dist/hooks.js index f734edb..e06c1f3 100644 --- a/dist/hooks.js +++ b/dist/hooks.js @@ -1,7 +1,7 @@ import "lodash"; import "rc-field-form"; import "react"; -import { a3 as r, a2 as o, a4 as p, a0 as f, a1 as i, a5 as m, $ as c } from "./common/main-ROZ7DqNn.js"; +import { a3 as r, a2 as o, a4 as p, a0 as f, a1 as i, a5 as m, $ as c } from "./common/main-BEaQ6Xnt.js"; import { default as b } from "rc-util/lib/hooks/useMergedState"; export { r as useDeepEffect, diff --git a/dist/iconfont.js b/dist/iconfont.js index f3b8fcd..3215f7d 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 { ah as a } from "./common/main-ROZ7DqNn.js"; +import { ah as a } from "./common/main-BEaQ6Xnt.js"; export { a as default }; diff --git a/dist/index.js b/dist/index.js index c2d105d..071c8e0 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1,4 +1,4 @@ -import { aB as s, aC as e, ax as o, ay as n, at as p, az as r, aw as c, av as u, au as f, aA as l } from "./common/main-ROZ7DqNn.js"; +import { aB as s, aC as e, ax as o, ay as n, at as p, az as r, aw as c, av as u, au as f, aA as l } from "./common/main-BEaQ6Xnt.js"; export { s as AppContext, e as AppGlobalParamsContext, diff --git a/dist/pages.js b/dist/pages.js index 6cab771..50db286 100644 --- a/dist/pages.js +++ b/dist/pages.js @@ -1,4 +1,4 @@ -import { Y as t, X as e, Z as o, _ as g } from "./common/main-ROZ7DqNn.js"; +import { Y as t, X as e, Z as o, _ as g } from "./common/main-BEaQ6Xnt.js"; export { t as CustomPage, e as DataListPage, diff --git a/dist/res-ws.js b/dist/res-ws.js index 7b8d7af..b129d93 100644 --- a/dist/res-ws.js +++ b/dist/res-ws.js @@ -1,5 +1,5 @@ import "lodash"; -import { R as a } from "./common/main-ROZ7DqNn.js"; +import { R as a } from "./common/main-BEaQ6Xnt.js"; export { a as default }; diff --git a/dist/utils.js b/dist/utils.js index b5259be..698b070 100644 --- a/dist/utils.js +++ b/dist/utils.js @@ -1,5 +1,5 @@ import "lodash"; -import { d as s, f as i, e as g, h as m, b as o, k as P, c as p, j as d, i as h, m as k, r as f, t as u, u as l } from "./common/main-ROZ7DqNn.js"; +import { d as s, f as i, e as g, h as m, b as o, k as P, c as p, j as d, i as h, m as k, r as f, t as u, u as l } from "./common/main-BEaQ6Xnt.js"; import "./common/vender-FNiQWFaA.js"; export { s as deepSome, diff --git a/package.json b/package.json index b7d1127..259d042 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "ff", "private": true, - "version": "0.6.20", + "version": "0.6.21", "author": "www.fsdpf.com", "type": "module", "main": "./dist/index.js",