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