diff --git a/dist/button.js b/dist/button.js index a4c2cfe..a730951 100644 --- a/dist/button.js +++ b/dist/button.js @@ -1,4 +1,4 @@ -import { a4 as s, a3 as u, a5 as e } from "./common/main-BpRlLf9Z.js"; +import { a4 as s, a3 as u, a5 as e } from "./common/main-ZEPPjpKL.js"; export { s as auth, u as default, diff --git a/dist/common/main-BpRlLf9Z.js b/dist/common/main-ZEPPjpKL.js similarity index 72% rename from dist/common/main-BpRlLf9Z.js rename to dist/common/main-ZEPPjpKL.js index 7a2140f..fd661c0 100644 --- a/dist/common/main-BpRlLf9Z.js +++ b/dist/common/main-ZEPPjpKL.js @@ -1,11 +1,11 @@ -var $i = Object.defineProperty; +var Ti = Object.defineProperty; var Ot = (e) => { throw TypeError(e); }; -var Ti = (e, t, i) => t in e ? $i(e, t, { enumerable: !0, configurable: !0, writable: !0, value: i }) : e[t] = i; -var v = (e, t, i) => Ti(e, typeof t != "symbol" ? t + "" : t, i), Lt = (e, t, i) => t.has(e) || Ot("Cannot " + i); +var Ni = (e, t, i) => t in e ? Ti(e, t, { enumerable: !0, configurable: !0, writable: !0, value: i }) : e[t] = i; +var v = (e, t, i) => Ni(e, typeof t != "symbol" ? t + "" : t, i), Lt = (e, t, i) => t.has(e) || Ot("Cannot " + i); var y = (e, t, i) => (Lt(e, t, "read from private field"), i ? i.call(e) : t.get(e)), R = (e, t, i) => t.has(e) ? Ot("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, i), W = (e, t, i, n) => (Lt(e, t, "write to private field"), n ? n.call(e, i) : t.set(e, i), i); -var At = (e, t, i, n) => ({ +var jt = (e, t, i, n) => ({ set _(r) { W(e, t, r, i); }, @@ -13,102 +13,102 @@ var At = (e, t, i, n) => ({ return y(e, t, n); } }); -import { jsx as g, jsxs as A } from "react/jsx-runtime"; -import k, { useEffect as j, useState as F, useCallback as Y, useMemo as H, useRef as U, useContext as le, useId as Le, isValidElement as Ni, useLayoutEffect as Fi } from "react"; +import { jsx as g, jsxs as j } from "react/jsx-runtime"; +import k, { useEffect as A, useState as F, useCallback as Y, useMemo as H, useRef as U, useContext as ce, useId as je, isValidElement as Fi, useLayoutEffect as Ei } from "react"; import c from "lodash"; import _t from "immutability-helper"; -import { Form as Ye, Input as Ei, Button as Qe, Pagination as Ri, Tree as Oi, Breadcrumb as Li, Table as Ai, Empty as ji, Popconfirm as Vi, Tooltip as Ii, Popover as Mi } from "antd"; -import { useMergedState as zi } from "rc-util"; +import { Form as Ye, Input as Ri, Button as Qe, Pagination as Oi, Tree as Li, Breadcrumb as ji, Table as Ai, Empty as Vi, Popconfirm as Ii, Tooltip as Mi, Popover as zi } from "antd"; +import { useMergedState as Bi } from "rc-util"; import z from "classnames"; -import ee, { FieldContext as Gt, Field as Yt } from "rc-field-form"; +import te, { FieldContext as Gt, Field as Yt } from "rc-field-form"; import w from "prop-types"; -import * as jt from "react-is"; -import { useNotification as Bi } from "rc-notification"; -import { N as Re, a as Oe, P as pt, S as Di } from "./vender-C0IfHU5B.js"; -import { generatePath as qi, useInRouterContext as Xt, useParams as Ui, useLocation as Wi, createBrowserRouter as Hi, Navigate as Ki } from "react-router-dom"; +import * as At from "react-is"; +import { useNotification as Di } from "rc-notification"; +import { N as Oe, a as Le, P as pt, S as qi } from "./vender-C0IfHU5B.js"; +import { generatePath as Ui, useInRouterContext as Xt, useParams as Wi, useLocation as Hi, createBrowserRouter as Ki, Navigate as Ji } from "react-router-dom"; import "rc-util/lib/hooks/useMergedState"; -import Ji from "rc-drawer"; -import _i from "rc-dialog"; -var $e, Ve, Te, ce, ke, xe; +import _i from "rc-drawer"; +import Gi from "rc-dialog"; +var Te, Ie, Ne, de, xe, Se; class Qt { constructor(t, i) { - R(this, $e, /* @__PURE__ */ new Map()); - R(this, Ve, !0); - R(this, Te, []); - R(this, ce); - R(this, ke, () => y(this, ce)); - R(this, xe, () => Promise.resolve()); + R(this, Te, /* @__PURE__ */ new Map()); + R(this, Ie, !0); + R(this, Ne, []); + R(this, de); + R(this, xe, () => y(this, de)); + R(this, Se, () => Promise.resolve()); v(this, "get", (...t) => new Promise((i, n) => { const r = JSON.stringify(t); - if (y(this, $e).has(r)) return i(y(this, xe).call(this, y(this, ce), ...t)); - if (y(this, ce) === void 0) y(this, Te).push([t, i, n]), y(this, Ve) && (W(this, Ve, !1), Promise.resolve(typeof y(this, ke) == "function" ? y(this, ke).call(this) : y(this, ke)).then((a) => W(this, ce, a || null)).finally(() => { - y(this, Te).forEach(([a, o, s]) => { + if (y(this, Te).has(r)) return i(y(this, Se).call(this, y(this, de), ...t)); + if (y(this, de) === void 0) y(this, Ne).push([t, i, n]), y(this, Ie) && (W(this, Ie, !1), Promise.resolve(typeof y(this, xe) == "function" ? y(this, xe).call(this) : y(this, xe)).then((a) => W(this, de, a || null)).finally(() => { + y(this, Ne).forEach(([a, o, s]) => { try { - const l = y(this, xe).call(this, y(this, ce), ...a); - y(this, $e).set(JSON.stringify(a), l), o(l); + const l = y(this, Se).call(this, y(this, de), ...a); + y(this, Te).set(JSON.stringify(a), l), o(l); } catch (l) { s(l); } - }), y(this, Te).length = 0; + }), y(this, Ne).length = 0; })); else { - const a = y(this, xe).call(this, y(this, ce), ...t); - y(this, $e).set(r, a), i(a); + const a = y(this, Se).call(this, y(this, de), ...t); + y(this, Te).set(r, a), i(a); } })); - W(this, xe, i), W(this, ke, t); + W(this, Se, i), W(this, xe, t); } } -$e = new WeakMap(), Ve = new WeakMap(), Te = new WeakMap(), ce = new WeakMap(), ke = new WeakMap(), xe = new WeakMap(); -const sr = () => g("div", { children: "Empty" }), qe = k.createContext({ ele: {}, mount: () => { +Te = new WeakMap(), Ie = new WeakMap(), Ne = new WeakMap(), de = new WeakMap(), xe = new WeakMap(), Se = new WeakMap(); +const or = () => g("div", { children: "Empty" }), Ue = k.createContext({ ele: {}, mount: () => { }, unmount: () => { } }), G = ({ rootClassName: e, className: t, children: i, actions: n, title: r, subTitle: a, extras: o, style: s = {} }) => { - const { mount: l, unmount: d } = k.useContext(qe); - return G.Action({ children: n }), G.Title({ children: r }), G.SubTitle({ children: a }), G.Extra({ children: o }), j(() => (l("rootClassName", e), () => d(e)), [e]), g("div", { className: z("ff-container", t), style: s, children: i }); + const { mount: l, unmount: d } = k.useContext(Ue); + return G.Action({ children: n }), G.Title({ children: r }), G.SubTitle({ children: a }), G.Extra({ children: o }), A(() => (l("rootClassName", e), () => d(e)), [e]), g("div", { className: z("ff-container", t), style: s, children: i }); }, Ge = (e) => ({ children: t, className: i }) => { - const { mount: n, unmount: r } = k.useContext(qe); - return j(() => (t && n(e, k.createElement("div", { key: `ff-${e}`, className: z(`ff-popup-${e}`, i) }, t)), () => r(e)), [i, t]), null; + const { mount: n, unmount: r } = k.useContext(Ue); + return A(() => (t && n(e, k.createElement("div", { key: `ff-${e}`, className: z(`ff-popup-${e}`, i) }, t)), () => r(e)), [i, t]), null; }; G.Action = Ge("actions"), G.Title = Ge("title"), G.SubTitle = Ge("sub-title"), G.Extra = Ge("extras"), G.propTypes = { className: w.string, style: w.object, title: w.any, subTitle: w.any, actions: w.any, extras: w.any }; -const or = () => g(G, { className: "ff-loading", children: A("div", { className: "loader", children: [A("div", { className: "square", children: [g("span", {}), g("span", {}), g("span", {})] }), A("div", { className: "square", children: [g("span", {}), g("span", {}), g("span", {})] }), A("div", { className: "square", children: [g("span", {}), g("span", {}), g("span", {})] }), A("div", { className: "square", children: [g("span", {}), g("span", {}), g("span", {})] })] }) }), lr = () => g("div", { children: "NotFound" }), Zt = ({ children: e }) => { +const lr = () => g(G, { className: "ff-loading", children: j("div", { className: "loader", children: [j("div", { className: "square", children: [g("span", {}), g("span", {}), g("span", {})] }), j("div", { className: "square", children: [g("span", {}), g("span", {}), g("span", {})] }), j("div", { className: "square", children: [g("span", {}), g("span", {}), g("span", {})] }), j("div", { className: "square", children: [g("span", {}), g("span", {}), g("span", {})] })] }) }), cr = () => g("div", { children: "NotFound" }), Zt = ({ children: e }) => { const [t, i] = F({}), n = Y((a, o) => i((s) => ({ ...s, [a]: o })), []), r = Y((a) => i((o) => ({ ...o, [a]: void 0 })), []); - return typeof (e == null ? void 0 : e.type) == "string" ? e : g(qe.Provider, { value: { ele: t, mount: n, unmount: r }, children: k.cloneElement(e, { className: t.rootClassName, title: t.title, subTitle: t["sub-title"], actions: t.actions, extras: t.extras }) }); + return typeof (e == null ? void 0 : e.type) == "string" ? e : g(Ue.Provider, { value: { ele: t, mount: n, unmount: r }, children: k.cloneElement(e, { className: t.rootClassName, title: t.title, subTitle: t["sub-title"], actions: t.actions, extras: t.extras }) }); }; Zt.propTypes = { children: w.element.isRequired }; -const Vt = { 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"] }, vt = ({ type: e, props: t }) => g("i", { ...t, children: g("svg", { viewBox: "0 0 1024 1024", width: "1em", height: "1em", fill: "currentColor", children: (Vt[e] || Vt.info).map((i, n) => g("path", { d: i }, n)) }) }), ei = ({ className: e, content: t, icon: i, $close: n }) => A(k.Fragment, { children: [i && g("div", { className: z("ff-notification-icon", e), children: g(vt, { type: i }) }), t] }), Gi = ({}) => g(G, { children: "Confirm" }); -var ue, Ne; -const ie = class ie { +const Vt = { 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"] }, vt = ({ type: e, props: t }) => g("i", { ...t, children: g("svg", { viewBox: "0 0 1024 1024", width: "1em", height: "1em", fill: "currentColor", children: (Vt[e] || Vt.info).map((i, n) => g("path", { d: i }, n)) }) }), ei = ({ className: e, content: t, icon: i, $close: n }) => j(k.Fragment, { children: [i && g("div", { className: z("ff-notification-icon", e), children: g(vt, { type: i }) }), t] }), Yi = ({}) => g(G, { children: "Confirm" }); +var ge, Fe; +const ne = class ne { constructor() { - R(this, Ne, /* @__PURE__ */ new Map()); - v(this, "init", (t) => W(this, Ne, new Map(t))); - v(this, "check", (t) => !y(this, Ne).has(t) || y(this, Ne).get(t)); - if (y(ie, ue)) return y(ie, ue); + R(this, Fe, /* @__PURE__ */ new Map()); + v(this, "init", (t) => W(this, Fe, new Map(t))); + v(this, "check", (t) => !y(this, Fe).has(t) || y(this, Fe).get(t)); + if (y(ne, ge)) return y(ne, ge); } }; -ue = new WeakMap(), Ne = new WeakMap(), R(ie, ue, null), v(ie, "getInstance", () => (y(ie, ue) || W(ie, ue, new ie()), y(ie, ue))); -let mt = ie; -const Yi = mt.getInstance(), Xi = (e, t, i = "children") => { +ge = new WeakMap(), Fe = new WeakMap(), R(ne, ge, null), v(ne, "getInstance", () => (y(ne, ge) || W(ne, ge, new ne()), y(ne, ge))); +let mt = ne; +const Xi = mt.getInstance(), Qi = (e, t, i = "children") => { if (c.isEmpty(e)) return {}; const n = c.find(e, ["value", t]); if (!c.isEmpty(n)) return n; const r = e.length; for (let a = 0; a < r; a++) { - const { [i]: o } = e[a], s = Xi(o, t, i); + const { [i]: o } = e[a], s = Qi(o, t, i); if (!c.isEmpty(s)) return s; } return {}; }, ti = (e = "Input", t = "@pkg/ff/grid-layout-forms") => e != null && e.startsWith("@") || e != null && e.startsWith("blob:") ? e : `${t}/${e}`; -var ge, Ie; -const ne = class ne { +var pe, Me; +const re = class re { constructor() { - R(this, Ie, null); - v(this, "init", (t) => W(this, Ie, t)); - v(this, "get", (t, i) => c.get(y(this, Ie), t, i)); - if (y(ne, ge)) return y(ne, ge); + R(this, Me, null); + v(this, "init", (t) => W(this, Me, t)); + v(this, "get", (t, i) => c.get(y(this, Me), t, i)); + if (y(re, pe)) return y(re, pe); } }; -ge = new WeakMap(), Ie = new WeakMap(), R(ne, ge, null), v(ne, "getInstance", () => (y(ne, ge) || W(ne, ge, new ne()), y(ne, ge))); -let ht = ne; +pe = new WeakMap(), Me = new WeakMap(), R(re, pe, null), v(re, "getInstance", () => (y(re, pe) || W(re, pe, new re()), y(re, pe))); +let ht = re; const Ae = ht.getInstance(), It = { 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": @@ -118,12 +118,12 @@ const Ae = ht.getInstance(), It = { 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" }, Z = (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" }, ee = (e, t) => { let i = "string"; i = Array.isArray(e) ? "array" : typeof e, c.isObject(e) && (i = "json"); const n = `${i}2${t}`; return Reflect.has(It, n) ? It[n](e) : e; -}, Ue = (e = {}, t = {}, i = {}, n = "") => ii(e, (r, a) => a === "type" && r === "code") ? ni(e, t, i, n) : ri(e, t, n), ii = (e, t = () => !1) => c.some(e, (i) => !!c.some(i, t) || (c.isEmpty(i) || !c.isPlainObject(i) && !c.isArray(i) ? void 0 : ii(i, t))), ni = async (e = {}, t = {}, i = {}, n = "") => { +}, We = (e = {}, t = {}, i = {}, n = "") => ii(e, (r, a) => a === "type" && r === "code") ? ni(e, t, i, n) : ri(e, t, n), ii = (e, t = () => !1) => c.some(e, (i) => !!c.some(i, t) || (c.isEmpty(i) || !c.isPlainObject(i) && !c.isArray(i) ? void 0 : ii(i, t))), ni = async (e = {}, t = {}, i = {}, n = "") => { let r = /* @__PURE__ */ Object.create(null); for (let a in e) { let o; @@ -131,14 +131,14 @@ const Ae = ht.getInstance(), It = { null2json: (e) => Object.create(), null2arra const { type: s, value: l = "", default: d = n } = e[a]; switch (s) { case "code": - o = await Ce.exec(l, t, i); + o = await ke.exec(l, t, i); break; case "field": o = c.get(t, l) ?? c.get(t, l.substring(l.indexOf(".") + 1)); break; case "router": case "query": - o = be.getPageParams(l); + o = Ce.getPageParams(l); break; case "string": o = l; @@ -159,7 +159,7 @@ const Ae = ht.getInstance(), It = { null2json: (e) => Object.create(), null2arra break; case "router": case "query": - a = be.getPageParams(s); + a = Ce.getPageParams(s); break; case "string": a = s; @@ -169,30 +169,30 @@ const Ae = ht.getInstance(), It = { null2json: (e) => Object.create(), null2arra c.set(n, r, a); } return n; -}, {}), dt = (e, t) => e && typeof e == "object" ? Array.isArray(e) ? e.map((i) => dt(i, t)) : Object.keys(e).reduce((i, n) => (t[n] ? i[t[n]] = dt(e[n], t) : i[n] = dt(e[n], t), i), {}) : e, cr = () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (e) => { +}, {}), dt = (e, t) => e && typeof e == "object" ? Array.isArray(e) ? e.map((i) => dt(i, t)) : Object.keys(e).reduce((i, n) => (t[n] ? i[t[n]] = dt(e[n], t) : i[n] = dt(e[n], t), i), {}) : e, dr = () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (e) => { const t = 16 * Math.random() | 0; return (e === "x" ? t : 3 & t | 8).toString(16); -}), dr = (e) => { +}), ur = (e) => { var t, i; return e ? (i = (t = e.match(/^@pkg(?:[^\/]*\/){3}(?[^\/]+)/)) == null ? void 0 : t.groups) == null ? void 0 : i.name : ""; -}, ur = (e) => { +}, gr = (e) => { var t, i; return e ? (i = (t = e.match(/^@pkg(?:[^\/]*\/){2}(?[^\/]+)/)) == null ? void 0 : t.groups) == null ? void 0 : i.category : ""; -}, gr = (e) => { +}, pr = (e) => { var t, i; return e ? (i = (t = e.match(/^@pkg(?:[^\/]*\/){1}(?[^\/]+)/)) == null ? void 0 : t.groups) == null ? void 0 : i.owner : ""; }; -var et, Me, ze, tt; +var et, ze, Be, tt; const it = class it { constructor(...t) { - R(this, Me, []); - R(this, ze, (t) => { + R(this, ze, []); + R(this, Be, (t) => { var i; - for (let n of t) Array.isArray(n[0]) ? y(this, ze).call(this, n) : y(this, Me).push(y(i = it, et).call(i, n[0], n[1])); + for (let n of t) Array.isArray(n[0]) ? y(this, Be).call(this, n) : y(this, ze).push(y(i = it, et).call(i, n[0], n[1])); }); v(this, "toValue", async (t, i = null) => { const n = { getValue: () => t, getRecord: () => i }; - return await y(this, Me).reduce(async (r, a) => { + return await y(this, ze).reduce(async (r, a) => { try { const o = await r; return (await a).call(n, o); @@ -206,26 +206,26 @@ const it = class it { const [r, a] = F(n); return st(() => { let o = !1; - return a(n), this.toValue(t, i).then((s) => Z(s, "string")).then((s) => !o && a(s)).catch((s) => !o && a(`${s}`)), () => o = !0; + return a(n), this.toValue(t, i).then((s) => ee(s, "string")).then((s) => !o && a(s)).catch((s) => !o && a(`${s}`)), () => o = !0; }, [t, i]), r; }); - y(this, ze).call(this, t); + y(this, Be).call(this, t); } }; -et = new WeakMap(), Me = new WeakMap(), ze = new WeakMap(), tt = new WeakMap(), R(it, et, c.memoize((t, i) => oe.getWidgetComponent(t).then((n) => { +et = new WeakMap(), ze = new WeakMap(), Be = new WeakMap(), tt = new WeakMap(), R(it, et, c.memoize((t, i) => le.getWidgetComponent(t).then((n) => { var r; return ((r = n.default) == null ? void 0 : r.call(n, i)) || ((a) => a); -}), (t, i) => `${t}::${Z(i, "string")}`)); +}), (t, i) => `${t}::${ee(i, "string")}`)); let Ze = it; -const Qi = (e, t = {}) => H(() => e == null ? void 0 : e.map(({ widgetByJs: i, widgetByJsSetting: n, ...r }, a) => i ? { ...r, render: (o, s) => new Ze([i, n]).toRender(o, s, "-") } : r), [e, t]), pr = (e) => { +const Zi = (e, t = {}) => H(() => e == null ? void 0 : e.map(({ widgetByJs: i, widgetByJsSetting: n, ...r }, a) => i ? { ...r, render: (o, s) => new Ze([i, n]).toRender(o, s, "-") } : r), [e, t]), mr = (e) => { const [t, i] = F({}); - return j(() => { + return A(() => { let n = !1; return e && L.get(`/api/_/${e}`).then((r) => c.pick(r, ["uuid", "name", "code", "resource", "marginX", "marginY", "cols", "rowHeight", "primaryKey", "columns", "itemOperations", "batchOperations", "isConditionFormLayout", "layout", "tabs", "pageSize", "layoutConfig"])).then((r) => !n && i(r)), () => n = !0; }, [e]), t; -}, mr = (e, t = {}) => { +}, hr = (e, t = {}) => { const [i, n] = F({ dataSource: [] }); - return We(() => { + return He(() => { let r = !1; return e && L.get(`/api/${e}/${L.encode({ page: 1, ...t })}`).then((a) => !r && n(a)), () => r = !0; }, [e, t]), i; @@ -235,14 +235,14 @@ const Qi = (e, t = {}) => H(() => e == null ? void 0 : e.map(({ widgetByJs: i, w }, ft = (e = [], t = /* @__PURE__ */ new Map(), i = [], n = "id", r) => { const a = Y(r ? (o) => c.get(o, n, c.get(o, [r, n])) : (o) => c.get(o, n), [n, r]); return H(() => { - if (c.isEmpty(e) || !e.some(({ uuid: s }) => Yi.check(s))) return !1; + if (c.isEmpty(e) || !e.some(({ uuid: s }) => Xi.check(s))) return !1; if (c.isEmpty(t) || c.isEmpty(i)) return !0; const o = i.map((s) => a(s)); return e.some(({ uuid: s }) => !s || !t.has(s) || t.get(s).some((l) => o.some((d) => d == l))); }, [e, i, t, a]); -}, Zi = (e, t, i = "id", n = null) => { +}, en = (e, t, i = "id", n = null) => { const r = at(), a = U(!1), o = U(e.dataSource), s = U(e.itemOperationsAccess); - return j(() => (o.current = e.dataSource, s.current = e.itemOperationsAccess, () => a.current = !1), [e.dataSource, e.itemOperationsAccess]), a.current && (e.dataSource = o.current, e.itemOperationsAccess = s.current), [e, (l = 0, d = null) => { + return A(() => (o.current = e.dataSource, s.current = e.itemOperationsAccess, () => a.current = !1), [e.dataSource, e.itemOperationsAccess]), a.current && (e.dataSource = o.current, e.itemOperationsAccess = s.current), [e, (l = 0, d = null) => { var p, u; if (a.current = !1, l === 1) return (p = e.onReload) == null ? void 0 : p.call(e); if (l === 2) { @@ -263,7 +263,7 @@ const Qi = (e, t = {}) => H(() => e == null ? void 0 : e.map(({ widgetByJs: i, w }); } }]; -}, en = (e, t) => { +}, tn = (e, t) => { const i = at(), n = U(t), r = U(/* @__PURE__ */ new Map()), a = U([]), o = c.throttle((l) => { a.current = [], L.list(e, c.pick({ ...n.current, ...l }, ["tab", "page", "pageSize", "condition", "sider", "keyword"])).then(({ keyword: d, condition: p, total: u, tab: f, sider: m, page: h, pageSize: b, operationsAccess: C, dataSource: x }) => { n.current = { tab: f, condition: p, sider: m, keyword: d, total: u, pageSize: b, page: x != null && x.length ? h : 1 }, a.current = x, r.current = new Map(C), i(); @@ -274,16 +274,16 @@ const Qi = (e, t = {}) => H(() => e == null ? void 0 : e.map(({ widgetByJs: i, w }, [e, t]); const s = H(() => c.pick(n.current, ["total", "tab", "page", "pageSize", "condition", "sider", "keyword"]), [n.current]); return Object.assign(s, { onTabChange: (l) => o({ tab: l, page: 1 }), onPageChange: (l, d) => o({ page: l, pageSize: d }), onPageSizeChange: (l) => o({ pageSize: l, page: 1 }), onConditionChange: (l, d) => o({ keyword: d, condition: _t(n.current.condition || {}, { $merge: l || {} }), page: 1 }), onSiderChange: (l) => o({ sider: l, page: 1 }), onKeywordChange: (l) => o({ keyword: l, page: 1 }), itemOperationsAccess: r.current, dataSource: a.current, onReload: o }); -}, tn = ({ listCode: e, className: t, layouts: i, dataSource: n, isPaginate: r, isItemOperations: a, isBatchOperations: o, batchOperations: s, itemOperations: l, itemOperationsAccess: d, resource: p, primaryKey: u, title: f, itemGridLayout: m, $setting: h, tabs: b, isConditionFormLayout: C, isTreeSider: x, treeSiderConfig: T }) => { - const { classNames: P, onClickCallback: O } = le(te), V = ai(l, d, u, p), q = Y((I, M, N) => g(nn, { className: z("ff-data-list-framework-item", P.item), operations: a ? V(M) : [], data: p ? { [p]: M } : M, children: I, onClickCallback: O }), [p, u, a, O, l, d]); - return A("div", { className: z("ff-data-list-framework", t), children: [g(i.sider, { isTreeSider: x, ...T }), A("div", { className: z("ff-data-list-container", P == null ? void 0 : P.container), children: [g(i.filter, { isConditionFormLayout: C }), g(i.toolbar, { title: f, tabs: b }), g(hn, { ...m, style: { "--col-num": (h == null ? void 0 : h.colNum) || 1 }, primaryKey: u, itemRender: q, dataSource: n }), g(i.footer, { isPaginate: r, isOperations: o, operations: s })] })] }); -}, nn = ({ className: e, operations: t, children: i, data: n, onClickCallback: r }) => A("div", { className: z("data-list-grid-layout-item-container", e), children: [i, !!(t != null && t.length) && g("div", { className: "data-list-grid-layout-item-actions", children: t.map((a) => g("span", { className: "data-list-grid-layout-item-action", children: g($.Link, { uuid: a.uuid, type: a.type, name: a.name, widget: a.widget, widgetType: a.widgetType, widgetProps: a.widgetProps, widgetSetting: a.widgetSetting, widgetContainerProps: a.widgetContainerSetting, data: n, confirm: a.confirm, onAfterClick: (o) => o !== !1 && (r == null ? void 0 : r(a.isRefresh, n)) }, a.uuid || Le()) }, (a == null ? void 0 : a.uuid) || Le())) })] }), rn = ({ listCode: e, className: t, layouts: i, dataSource: n, columns: r, isItemOperations: a, isBatchOperations: o, batchOperations: s, itemOperations: l, itemOperationsAccess: d, resource: p, primaryKey: u, title: f, tabs: m, isPaginate: h, isTreeSider: b, treeSiderConfig: C, isConditionFormLayout: x, ...T }) => { - const { classNames: P, onClickCallback: O } = le(te), V = ai(l, d, u, p), q = ft(l, d, n, u, p); - return A("div", { className: z("ff-data-table-framework", t), children: [g(i.sider, { isTreeSider: b, ...C }), A("div", { className: z("ff-data-table-container", P == null ? void 0 : P.container), children: [g(i.filter, { isConditionFormLayout: x }), g(i.toolbar, { title: f, tabs: m }), g(dn, { ...T, primaryKey: u, className: "ff-data-table-content", columns: r, dataSource: n, operationRender: q ? (I) => { +}, nn = ({ listCode: e, className: t, layouts: i, dataSource: n, isPaginate: r, isItemOperations: a, isBatchOperations: o, batchOperations: s, itemOperations: l, itemOperationsAccess: d, resource: p, primaryKey: u, title: f, itemGridLayout: m, $setting: h, tabs: b, isConditionFormLayout: C, isTreeSider: x, treeSiderConfig: T }) => { + const { classNames: P, onClickCallback: O } = ce(ie), V = ai(l, d, u, p), q = Y((I, M, N) => g(rn, { className: z("ff-data-list-framework-item", P.item), operations: a ? V(M) : [], data: p ? { [p]: M } : M, children: I, onClickCallback: O }), [p, u, a, O, l, d]); + return j("div", { className: z("ff-data-list-framework", t), children: [g(i.sider, { isTreeSider: x, ...T }), j("div", { className: z("ff-data-list-container", P == null ? void 0 : P.container), children: [g(i.filter, { isConditionFormLayout: C }), g(i.toolbar, { title: f, tabs: b }), g(fn, { ...m, style: { "--col-num": (h == null ? void 0 : h.colNum) || 1 }, primaryKey: u, itemRender: q, dataSource: n }), g(i.footer, { isPaginate: r, isOperations: o, operations: s })] })] }); +}, rn = ({ className: e, operations: t, children: i, data: n, onClickCallback: r }) => j("div", { className: z("data-list-grid-layout-item-container", e), children: [i, !!(t != null && t.length) && g("div", { className: "data-list-grid-layout-item-actions", children: t.map((a) => g("span", { className: "data-list-grid-layout-item-action", children: g($.Link, { uuid: a.uuid, type: a.type, name: a.name, widget: a.widget, widgetType: a.widgetType, widgetProps: a.widgetProps, widgetSetting: a.widgetSetting, widgetContainerProps: a.widgetContainerSetting, data: n, confirm: a.confirm, onAfterClick: (o) => o !== !1 && (r == null ? void 0 : r(a.isRefresh, n)) }, a.uuid || je()) }, (a == null ? void 0 : a.uuid) || je())) })] }), an = ({ listCode: e, className: t, layouts: i, dataSource: n, columns: r, isItemOperations: a, isBatchOperations: o, batchOperations: s, itemOperations: l, itemOperationsAccess: d, resource: p, primaryKey: u, title: f, tabs: m, isPaginate: h, isTreeSider: b, treeSiderConfig: C, isConditionFormLayout: x, ...T }) => { + const { classNames: P, onClickCallback: O } = ce(ie), V = ai(l, d, u, p), q = ft(l, d, n, u, p); + return j("div", { className: z("ff-data-table-framework", t), children: [g(i.sider, { isTreeSider: b, ...C }), j("div", { className: z("ff-data-table-container", P == null ? void 0 : P.container), children: [g(i.filter, { isConditionFormLayout: x }), g(i.toolbar, { title: f, tabs: m }), g(un, { ...T, primaryKey: u, className: "ff-data-table-content", columns: r, dataSource: n, operationRender: q ? (I) => { var M; return g("div", { className: "ff-data-table-actions", children: (M = V(I)) == null ? void 0 : M.map((N, S) => g($.Link, { size: "small", uuid: N.uuid, type: N.type, name: N.name, widget: N.widget, widgetType: N.widgetType, widgetProps: N.widgetProps, widgetData: N.widgetData, widgetSetting: N.widgetSetting, widgetContainerProps: N.widgetContainerSetting, data: I, confirm: N.confirm, onAfterClick: (E) => E !== !1 && (O == null ? void 0 : O(N.isRefresh, I)) }, N.uuid || S)) }); } : null }), g(i.footer, { isPaginate: h, isOperations: o, operations: s })] })] }); -}, te = k.createContext({ listCode: "", classNames: {}, getBase62params: (e, t) => { +}, ie = k.createContext({ listCode: "", classNames: {}, getBase62params: (e, t) => { }, onReload: () => { }, onClickCallback: () => { }, onConditionChange: () => { @@ -295,98 +295,100 @@ const Qi = (e, t = {}) => H(() => e == null ? void 0 : e.map(({ widgetByJs: i, w } }), si = (e, t, i, n, r = {}, a = 0) => { const o = { "--grid-layout-h": `${n}`, "--grid-layout-w": `${i}`, "--grid-layout-x": `${e}`, "--grid-layout-y": `${t}`, "--grid-layout-row-height-offset": "0px" }; return r != null && r.autoHeight ? o.height = "fit-content" : o["--grid-layout-row"] = `${n}`, r != null && r.alignItems && (o["--grid-layout-box-align-items"] = r.alignItems), r != null && r.justifyContent && (o["--grid-layout-box-justify-content"] = r.justifyContent), o["--grid-layout-box-margin"] = Mt(r == null ? void 0 : r.marginTop, r == null ? void 0 : r.marginRight, r == null ? void 0 : r.marginBottom, r == null ? void 0 : r.marginLeft), o["--grid-layout-box-padding"] = Mt(r == null ? void 0 : r.paddingTop, r == null ? void 0 : r.paddingRight, r == null ? void 0 : r.paddingBottom, r == null ? void 0 : r.paddingLeft), a && (o.height = `${a}px`), o; -}, Mt = (e, t, i, n) => `${e || 0}px ${t || 0}px ${i || 0}px ${n || 0}px`, hr = (e = "Text", t = "@pkg/ff/grid-layouts") => e != null && e.startsWith("@") || e != null && e.startsWith("blob:") ? e : `${t}/${e}`, oi = ({ className: e, isConditionFormLayout: t }) => { +}, Mt = (e, t, i, n) => `${e || 0}px ${t || 0}px ${i || 0}px ${n || 0}px`, fr = (e = "Text", t = "@pkg/ff/grid-layouts") => e != null && e.startsWith("@") || e != null && e.startsWith("blob:") ? e : `${t}/${e}`, oi = ({ className: e, isConditionFormLayout: t }) => { var f, m; - const [i, n] = F({}), { listCode: r, onKeywordChange: a, onConditionChange: o, getBase62params: s, classNames: l } = k.useContext(te), { keyword: d, condition: p } = (s == null ? void 0 : s()) || {}, [u] = Ye.useForm(); - return j(() => { + const [i, n] = F({}), { listCode: r, onKeywordChange: a, onConditionChange: o, getBase62params: s, classNames: l } = k.useContext(ie), { keyword: d, condition: p } = (s == null ? void 0 : s()) || {}, [u] = Ye.useForm(); + return A(() => { r && t && L.get(`/api/_/${r}/list-condition-form-layout`).then(({ resource: h, marginX: b, marginY: C, rowHeight: x, cols: T, fields: P }) => { n({ resource: h, itemMargin: [b, C], rowHeight: x, cols: T, fields: P }); }).catch(() => n({})); - }, [r, t]), j(() => { + }, [r, t]), A(() => { u.setFieldsValue({ keyword: d, ...p }); }, [JSON.stringify([d, p])]), g("div", { className: z("ff-data-list-filter", l.filter, e), children: g(Ye, { form: u, layout: "vertical", autoComplete: "off", onFinish: ((f = i.fields) == null ? void 0 : f.length) > 1 ? (h) => o({ [i.resource]: h[i.resource] }, h.keyword) : () => { }, onValuesChange: (h) => { c.isEmpty(c.omit(h, ["keyword"])) || u.submit(); - }, children: ((m = i.fields) == null ? void 0 : m.length) > 1 ? g($t, { ...i, children: g(an, { onReset: () => { + }, children: ((m = i.fields) == null ? void 0 : m.length) > 1 ? g($t, { ...i, children: g(sn, { onReset: () => { const { keyword: h, condition: b } = s("init") || {}; u.setFieldsValue({ keyword: h, ...b }); - } }) }) : g("div", { className: "ff-data-list-filter-default-form ff-grid-layout-form", children: g("div", { className: "grid-layout-item", style: si(20, 0, 5, 2), children: g(Ye.Item, { name: ["keyword"], children: g(Ei.Search, { allowClear: !0, enterButton: "搜索", placeholder: "多关键字 | 分割", onSearch: (h) => a(h) }) }) }) }) }) }); -}, an = ({ cols: e, fields: t, onReset: i }) => { + } }) }) : g("div", { className: "ff-data-list-filter-default-form ff-grid-layout-form", children: g("div", { className: "grid-layout-item", style: si(20, 0, 5, 2), children: g(Ye.Item, { name: ["keyword"], children: g(Ri.Search, { allowClear: !0, enterButton: "搜索", placeholder: "多关键字 | 分割", onSearch: (h) => a(h) }) }) }) }) }) }); +}, sn = ({ cols: e, fields: t, onReset: i }) => { const [n, r] = F(!1), a = H(() => t == null ? void 0 : t.toReversed().some((o) => o.y > 1 || o.x + o.w >= e - 5), [e, t]); - return A(Ye.Item, { label: " ", style: { "--item-span": 5 }, className: z("ff-data-list-filter-actions", { expanded: n }), children: [g(Qe, { onClick: i, children: "重置" }), g(Qe, { type: "primary", htmlType: "submit", children: "查询" }), a && g($.Link, { className: "ff-data-list-filter-expanded-button", widget: () => r((o) => !o), type: "primary", name: n ? "关闭" : "展开", icon: n ? "icon-up" : "icon-down", iconPosition: "end" })] }); + return j(Ye.Item, { label: " ", style: { "--item-span": 5 }, className: z("ff-data-list-filter-actions", { expanded: n }), children: [g(Qe, { onClick: i, children: "重置" }), g(Qe, { type: "primary", htmlType: "submit", children: "查询" }), a && g($.Link, { className: "ff-data-list-filter-expanded-button", widget: () => r((o) => !o), type: "primary", name: n ? "关闭" : "展开", icon: n ? "icon-up" : "icon-down", iconPosition: "end" })] }); }; oi.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 sn = ({ className: e, operations: t, isOperations: i, isPaginate: n }) => { - const { onPageChange: r, onPageSizeChange: a, onClickCallback: o, getBase62params: s } = k.useContext(te), { total: l, page: d, pageSize: p } = (s == null ? void 0 : s()) || {}; - return i && !c.isEmpty(t) || n ? A("div", { className: z("ff-data-list-footer", e), children: [g("div", { className: "ff-data-list-actions", children: t == null ? void 0 : t.map((u, f) => g($, { 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)) }), n && g(Ri, { size: "small", total: l, pageSize: p, showSizeChanger: !1, showTotal: (u) => `第 ${d} 页 / 总共 ${u} 条`, onChange: r, onShowSizeChange: a })] }) : null; -}, on = [{ 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" }] }] }], ln = ({ className: e, width: t = 280, isTreeSider: i }) => { - const { classNames: n } = le(te); - return i ? g(Oi.DirectoryTree, { className: z("ff-data-list-sider", n.sider, e), style: { "--sider-width": t }, showLine: !0, showIcon: !1, treeData: on }) : null; -}, cn = ({ className: e, title: t, tabs: i }) => { - const { getBase62params: n, onTabChange: r, onReload: a, classNames: o } = le(te), { tab: s } = (n == null ? void 0 : n()) || {}, [l, d] = zi((i == null ? void 0 : i[0].value) ?? (i == null ? void 0 : i[0].code), { value: s, onChange: r }); - return A("div", { className: z("ff-data-list-toolbar", o.toolbar, e), children: [g("div", { className: "ff-data-list-title", children: t }), g(Li, { className: "ff-data-list-tabs", itemRender: ({ label: p, code: u, value: f }) => g("span", { onClick: () => d(f ?? u), className: z("ff-data-list-tab", { active: (f ?? u) == l }), children: p }), items: i }), A("div", { className: "ff-data-list-actions", children: [g($.Link, { icon: "icon-reload", widget: () => a() }), g($.Link, { icon: "icon-setting" })] })] }); +const on = ({ className: e, operations: t, isOperations: i, isPaginate: n }) => { + const { onPageChange: r, onPageSizeChange: a, onClickCallback: o, getBase62params: s } = k.useContext(ie), { total: l, page: d, pageSize: p } = (s == null ? void 0 : s()) || {}; + return i && !c.isEmpty(t) || n ? j("div", { className: z("ff-data-list-footer", e), children: [g("div", { className: "ff-data-list-actions", children: t == null ? void 0 : t.map((u, f) => g($, { 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)) }), n && g(Oi, { size: "small", total: l, pageSize: p, showSizeChanger: !1, showTotal: (u) => `第 ${d} 页 / 总共 ${u} 条`, onChange: r, onShowSizeChange: a })] }) : null; +}, ln = [{ 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" }] }] }], cn = ({ className: e, width: t = 280, isTreeSider: i }) => { + const { classNames: n } = ce(ie); + return i ? g(Li.DirectoryTree, { className: z("ff-data-list-sider", n.sider, e), style: { "--sider-width": t }, showLine: !0, showIcon: !1, treeData: ln }) : null; +}, dn = ({ className: e, title: t, tabs: i }) => { + const { getBase62params: n, onTabChange: r, onReload: a, classNames: o } = ce(ie), { tab: s } = (n == null ? void 0 : n()) || {}, [l, d] = Bi((i == null ? void 0 : i[0].value) ?? (i == null ? void 0 : i[0].code), { value: s, onChange: r }); + return j("div", { className: z("ff-data-list-toolbar", o.toolbar, e), children: [g("div", { className: "ff-data-list-title", children: t }), g(ji, { className: "ff-data-list-tabs", itemRender: ({ label: p, code: u, value: f }) => g("span", { onClick: () => d(f ?? u), className: z("ff-data-list-tab", { active: (f ?? u) == l }), children: p }), items: i }), j("div", { className: "ff-data-list-actions", children: [g($.Link, { icon: "icon-reload", widget: () => a() }), g($.Link, { icon: "icon-setting" })] })] }); }, li = ({ isItemGridLayout: e, theme: t, themeProps: i, onClickCallback: n, onReload: r, listCode: a, total: o = 0, page: s = 0, onPageChange: l, pageSize: d = 30, onPageSizeChange: p, tab: u, onTabChange: f, keyword: m, onKeywordChange: h, condition: b, onConditionChange: C, sider: x, onSiderChange: T, layouts: P, classNames: O = {}, ...V }) => { const [q, I] = F(), M = Y((S, E) => { const D = { tab: u, page: s, pageSize: d, keyword: m, sider: x, condition: b, total: o }; return S && S != "init" ? c.get(D, S, E) : D; }, [JSON.stringify(b), u, s, d, m, x, o]), N = H(() => { - let S = { sider: ln, filter: oi, footer: sn, toolbar: cn }; + let S = { sider: cn, filter: oi, footer: on, toolbar: dn }; P === !1 ? S = { sider: null, filter: null, footer: null, toolbar: null } : c.isPlainObject(P) && (S = Object.assign({}, S, P)); for (const E in S) if (S[E]) { - if (Ni(S[E])) { + if (Fi(S[E])) { const D = S[E]; S[E] = (X) => k.cloneElement(D, X); } } else S[E] = () => g(k.Fragment, {}); return S; }, [P]); - return j(() => { - t ? oe.getWidgetComponent(t).then((S) => { + return A(() => { + t ? le.getWidgetComponent(t).then((S) => { if (!S) throw `${t} not found`; return S; - }).catch((S) => ({ default: () => `${S}` })).then((S) => I(k.createElement(S.default, { ...V, layouts: N, $setting: i }))) : I(g(e ? tn : rn, { ...V, layouts: N, $setting: i })); - }, [t, i]), g(te.Provider, { value: { classNames: O, listCode: a, onClickCallback: n, onReload: r, getBase62params: M, onPageChange: l, onPageSizeChange: p, onTabChange: f, onSiderChange: T, onKeywordChange: h, onConditionChange: C }, children: q && k.cloneElement(q, V) }); + }).catch((S) => ({ default: () => `${S}` })).then((S) => I(k.createElement(S.default, { ...V, layouts: N, $setting: i }))) : I(g(e ? nn : an, { ...V, layouts: N, $setting: i })); + }, [t, i]), g(ie.Provider, { value: { classNames: O, listCode: a, onClickCallback: n, onReload: r, getBase62params: M, onPageChange: l, onPageSizeChange: p, onTabChange: f, onSiderChange: T, onKeywordChange: h, onConditionChange: C }, children: q && k.cloneElement(q, V) }); }; li.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 pe, de, Se, nt; -const re = class re { +var me, ue, ve, nt; +const ae = class ae { constructor() { - R(this, de, null); - R(this, Se, /* @__PURE__ */ new Map()); + R(this, ue, null); + R(this, ve, /* @__PURE__ */ new Map()); R(this, nt, () => { - if (y(this, de)) return y(this, de).port.postMessage({ command: "status", data: [] }); - W(this, de, new SharedWorker(new URL("/ff-worker/res-ws.js", self.location))), y(this, de).port.onmessage = (t) => { + 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) => { var i, n; - (i = t.data) != null && i.uuid ? y(this, Se).forEach((r, a) => { + (i = t.data) != null && i.uuid ? y(this, ve).forEach((r, a) => { var o; (r == "*" || (o = r == null ? void 0 : r.includes) != null && o.call(r, t.data.uuid)) && a(t.data); }) : ((n = t.data) == null ? void 0 : n.readyState) == WebSocket.CLOSED && L.get("/api/user-api-token").then(({ token: r, expire_at: a }) => { - y(this, de).port.postMessage({ command: "initWs", data: [`ws${c.trimStart(L.appUrl, "http")}api/user-resource-status-ws?token=${r}`] }); + y(this, ue).port.postMessage({ command: "initWs", data: [`ws${c.trimStart(L.appUrl, "http")}api/user-resource-status-ws?token=${r}`] }); }); - }, y(this, de).port.postMessage({ command: "status", data: [] }); + }, y(this, ue).port.postMessage({ command: "status", data: [] }); }); - v(this, "subscribe", (t, i = []) => (i ? Array.isArray(i) && i.length == 0 ? i = "*" : Array.isArray(i) || (i = [i].flat()) : i = "*", y(this, Se).set(t, i), y(this, Se).size == 1 && y(this, nt).call(this), () => this.unsubscribe(t))); - v(this, "unsubscribe", (t) => y(this, Se).delete(t)); - if (y(re, pe)) return y(re, pe); + v(this, "subscribe", (t, i = []) => (i ? Array.isArray(i) && i.length == 0 ? i = "*" : Array.isArray(i) || (i = [i].flat()) : i = "*", y(this, ve).set(t, i), y(this, ve).size == 1 && y(this, nt).call(this), () => this.unsubscribe(t))); + v(this, "unsubscribe", (t) => y(this, ve).delete(t)); + if (y(ae, me)) return y(ae, me); } }; -pe = new WeakMap(), de = new WeakMap(), Se = new WeakMap(), nt = new WeakMap(), R(re, pe, null), v(re, "getInstance", () => (y(re, pe) || W(re, pe, new re()), y(re, pe))); -let yt = re; +me = new WeakMap(), ue = new WeakMap(), ve = new WeakMap(), nt = new WeakMap(), R(ae, me, null), v(ae, "getInstance", () => (y(ae, me) || W(ae, me, new ae()), y(ae, me))); +let yt = ae; const ci = yt.getInstance(), Pt = k.forwardRef(({ listCode: e, base62params: t, className: i, theme: n, themeProps: r, layouts: a, classNames: o }, s) => { - const [{ resource: l, primaryKey: d, batchOperations: p = [], itemOperations: u = [], columns: f = [], themeConfig: m, theme: h, isConditionFormLayout: b = !1, isTreeSider: C, treeSiderConfig: x, isItemGridLayout: T, itemGridLayout: P, title: O, isPaginate: V, tabs: q }, I] = F({ isItemGridLayout: !1, itemGridLayout: {} }), M = en(e, t), [{ dataSource: N, itemOperationsAccess: S, condition: E, tab: D, keyword: X, page: ve, total: K, pageSize: ot, sider: Ke, onConditionChange: lt, onTabChange: Et, onKeywordChange: bi, onPageChange: Ci, onPageSizeChange: ki, onSiderChange: xi, onReload: ct }, Rt] = Zi(M, e, d, l), Si = ft(u, S, N, d), vi = ft(p); - return j(() => { - let Je = null; - return e && L.get(`/api/_/${e}`).resp(({ data: _e, res: Pi }) => { - _e != null && _e.isDynamicRefresh && (Je = ci.subscribe(() => ct(), Pi)), I(_e); - }).catch(() => I({})), () => Je == null ? void 0 : Je(); - }, [e]), k.useImperativeHandle(s, () => ({ onReload: ct, onClickCallback: Rt })), g(li, { listCode: e, title: O, classNames: o, layouts: a, resource: l, primaryKey: d, theme: n || h, themeProps: r || m, isTreeSider: C, treeSiderConfig: x, isPaginate: V, tabs: q, isItemOperations: Si, isBatchOperations: vi, batchOperations: p, itemOperations: u, isItemGridLayout: T, columns: f, itemGridLayout: P, isConditionFormLayout: b, itemOperationsAccess: S, dataSource: N, onConditionChange: lt, onTabChange: Et, onKeywordChange: bi, onPageChange: Ci, onPageSizeChange: ki, onSiderChange: xi, condition: E, tab: D, keyword: X, page: ve, total: K, pageSize: ot, sider: Ke, className: z("ff-data-list-helper", i), onReload: ct, onClickCallback: Rt }); -}), di = (e, t, i = !0) => i !== !0 && i-- <= 0 ? [] : c.isArray(e) && !c.isEmpty(e) ? e.reduce((n, r) => (Reflect.has(r, t) && Reflect.has(r, "children") && n.push(r[t]), Reflect.has(r, "children") && !c.isEmpty(r.children) ? n.concat(di(r.children, t, i)) : n), []) : [], dn = ({ className: e, primaryKey: t, columns: i = [], dataSource: n = [], operationRender: r, operationWidth: a = 180, ...o }) => { - const { classNames: s } = le(te); - Le(); + const [{ resource: l, primaryKey: d, batchOperations: p = [], itemOperations: u = [], columns: f = [], themeConfig: m, theme: h, isConditionFormLayout: b = !1, isTreeSider: C, treeSiderConfig: x, isItemGridLayout: T, itemGridLayout: P, title: O, isPaginate: V, tabs: q }, I] = F({ isItemGridLayout: !1, itemGridLayout: {} }), M = tn(e, t), [{ dataSource: N, itemOperationsAccess: S, condition: E, tab: D, keyword: X, page: Pe, total: K, pageSize: ot, sider: Je, onConditionChange: lt, onTabChange: Et, onKeywordChange: bi, onPageChange: Ci, onPageSizeChange: ki, onSiderChange: xi, onReload: ct }, Rt] = en(M, e, d, l), Si = ft(u, S, N, d), vi = ft(p); + A(() => { + let Q = null; + return e && L.get(`/api/_/${e}`).resp(({ data: _e, res: $i }) => { + _e != null && _e.isDynamicRefresh && (Q = ci.subscribe(() => ct(), $i)), I(_e); + }).catch(() => I({})), () => Q == null ? void 0 : Q(); + }, [e]), k.useImperativeHandle(s, () => ({ onReload: ct, onClickCallback: Rt })); + const Pi = { listCode: e, title: O, classNames: o, layouts: a, resource: l, primaryKey: d, theme: n || h, themeProps: r || m, isTreeSider: C, treeSiderConfig: x, isPaginate: V, tabs: q, isItemOperations: Si, itemOperations: u.map((Q) => c.isEmpty(Q == null ? void 0 : Q.confirm) ? Q : { ...Q, confirm: Object.assign({}, Q.confirm, { getPopupContainer: () => document.body }) }), isBatchOperations: vi, batchOperations: p, isItemGridLayout: T, columns: f, itemGridLayout: P, isConditionFormLayout: b, itemOperationsAccess: S, dataSource: N, onConditionChange: lt, onTabChange: Et, onKeywordChange: bi, onPageChange: Ci, onPageSizeChange: ki, onSiderChange: xi, condition: E, tab: D, keyword: X, page: Pe, total: K, pageSize: ot, sider: Je }; + return g(li, { ...Pi, className: z("ff-data-list-helper", i), onReload: ct, onClickCallback: Rt }); +}), di = (e, t, i = !0) => i !== !0 && i-- <= 0 ? [] : c.isArray(e) && !c.isEmpty(e) ? e.reduce((n, r) => (Reflect.has(r, t) && Reflect.has(r, "children") && n.push(r[t]), Reflect.has(r, "children") && !c.isEmpty(r.children) ? n.concat(di(r.children, t, i)) : n), []) : [], un = ({ className: e, primaryKey: t, columns: i = [], dataSource: n = [], operationRender: r, operationWidth: a = 180, ...o }) => { + const { classNames: s } = ce(ie); + je(); const l = U(null), d = U(null), [p, u] = F([]), [f, m] = F({ width: 0, height: 0 }); - j(() => { + A(() => { u(di(n, t)); - }, [n, t]), Fi(() => { + }, [n, t]), Ei(() => { const b = new ResizeObserver(() => { var C; m({ width: ((C = l.current) == null ? void 0 : C.nativeElement.querySelector(".ant-table-body").scrollWidth) || d.current.offsetWidth, height: d.current.offsetHeight }); @@ -395,17 +397,17 @@ const ci = yt.getInstance(), Pt = k.forwardRef(({ listCode: e, base62params: t, d.current && b.unobserve(d.current); }; }, []); - const h = Qi(i); + const h = Zi(i); return g("div", { ref: d, className: z("ff-data-list-table", s.content, e), children: f.height ? g(Ai, { ...o, ref: l, rowKey: (b) => (b == null ? void 0 : b[t]) ?? Math.random(), columns: h == null ? void 0 : h.concat(r ? [{ title: "操作", align: "center", fixed: "right", width: `${Math.ceil(a / f.width * 100).toFixed(2)}%`, render: (b, C, x) => r(C, x) }] : []), dataSource: n, size: "middle", scroll: { x: "max-content", y: f.height - 50 }, pagination: !1, expandable: { defaultExpandAllRows: !0, expandRowByClick: !0, onExpandedRowsChange: u, expandedRowKeys: p } }) : null }); -}, un = "RC_FORM_INTERNAL_HOOKS", gn = (e, { initialValue: t, initialValueLanguage: i, convertJs: n, convertJsSetting: r, type: a = "string" }, o = null) => { - const s = U(!1), l = le(Gt), [d, p] = F(), [u, f] = F(i != "javascript" && e ? l.getFieldValue(e) : void 0), { registerWatch: m } = l.getInternalHooks(un) || {}; - return j(() => m == null ? void 0 : m((h, b, C) => { +}, gn = "RC_FORM_INTERNAL_HOOKS", pn = (e, { initialValue: t, initialValueLanguage: i, convertJs: n, convertJsSetting: r, type: a = "string" }, o = null) => { + const s = U(!1), l = ce(Gt), [d, p] = F(), [u, f] = F(i != "javascript" && e ? l.getFieldValue(e) : void 0), { registerWatch: m } = l.getInternalHooks(gn) || {}; + return A(() => m == null ? void 0 : m((h, b, C) => { if (!s.current) return; const x = c.get(b, e); - c.isEqual(x, u) || f(Z(x, a)); - }), [u]), j(() => { - i == "javascript" && t ? Ce.exec(t, {}, { getFieldValueForBasicForm: (h) => o ? o.getFieldValue(h) : l.getFieldValue(h), getFieldValue: (h) => l.getFieldValue(h) }).then((h) => f(Z(h, a))).catch((h) => notification.error({ message: `布局数据错误: ${JSON.stringify(h)}` })).finally(() => s.current = !0) : (t && f(Z(t ?? l.getFieldValue(e), a)), s.current = !0); - }, [t, i]), We(() => { + c.isEqual(x, u) || f(ee(x, a)); + }), [u]), A(() => { + i == "javascript" && t ? ke.exec(t, {}, { getFieldValueForBasicForm: (h) => o ? o.getFieldValue(h) : l.getFieldValue(h), getFieldValue: (h) => l.getFieldValue(h) }).then((h) => f(ee(h, a))).catch((h) => notification.error({ message: `布局数据错误: ${JSON.stringify(h)}` })).finally(() => s.current = !0) : (t && f(ee(t ?? l.getFieldValue(e), a)), s.current = !0); + }, [t, i]), He(() => { s.current && n && new Ze([n, r]).toValue(u, l.getFieldsValue(!0)).then(p).catch((h) => { p(h), console.error("布局数据转换错误: ", h, n); }); @@ -413,84 +415,84 @@ const ci = yt.getInstance(), Pt = k.forwardRef(({ listCode: e, base62params: t, }, ui = (e, t, i = null) => H(() => { var n; return (n = c.sortBy(e, ["y", "x"])) == null ? void 0 : n.map(({ i: r, x: a, y: o, w: s, h: l, field: { boxStyle: d, ...p } }, u) => g("div", { className: "grid-layout-item", style: si(a, o, s, l, d), children: g(t, { ...p, basicForm: i }) }, r ?? u)); -}, [e]), pn = ({ widget: e, widgetPrefix: t = "@pkg/ff/grid-layouts", basicForm: i, ...n }) => { +}, [e]), mn = ({ widget: e, widgetPrefix: t = "@pkg/ff/grid-layouts", basicForm: i, ...n }) => { const r = e != null && e.startsWith("@") || e != null && e.startsWith("blob:") ? e : `${t}/${e}`, [a, o] = F(); - return j(() => { - r && oe.getWidgetComponent(r).then(({ defaultProps: s = {}, default: l }) => ({ default: mn(l, s, i) })).catch((s) => ({ default: () => `${s}` })).then((s) => o(k.createElement(s.default, n))); + return A(() => { + r && le.getWidgetComponent(r).then(({ defaultProps: s = {}, default: l }) => ({ default: hn(l, s, i) })).catch((s) => ({ default: () => `${s}` })).then((s) => o(k.createElement(s.default, n))); }, [r]), a; -}, mn = (e, t = {}, i = null) => (n) => { - const { code: r, label: a, extras: o, isVirtual: s, initialValue: l, initialValueLanguage: d, convertJs: p, convertJsSetting: u, value: f, ...m } = c.merge({}, t, n), [h, b] = gn(s ? null : r, { initialValue: l, initialValueLanguage: d, convertJs: p, convertJsSetting: u, type: (m == null ? void 0 : m.type) || "string" }, i), C = H(() => { +}, hn = (e, t = {}, i = null) => (n) => { + const { code: r, label: a, extras: o, isVirtual: s, initialValue: l, initialValueLanguage: d, convertJs: p, convertJsSetting: u, value: f, ...m } = c.merge({}, t, n), [h, b] = pn(s ? null : r, { initialValue: l, initialValueLanguage: d, convertJs: p, convertJsSetting: u, type: (m == null ? void 0 : m.type) || "string" }, i), C = H(() => { const P = Object.keys((t == null ? void 0 : t.extras) || {}); return c.over([c.partialRight(c.pick, P), c.partialRight(c.omit, P)]); }, [t == null ? void 0 : t.extras]), [x, T] = C(m); return g(e, { ...T, value: h, rawValue: b, $setting: Object.assign({}, o, x) }); }, gi = ({ className: e, cols: t = 12, rowHeight: i = 21, containerPadding: n = [0, 0], itemMargin: r = [4, 0], formProps: a = {}, fields: o = [], data: s, basicForm: l = null, ...d }) => { - const [p] = ee.useForm(), u = ui(o, pn, l), f = H(() => [{ name: "__PROPS__", value: a }], [a]); - return We(() => (p.setFieldsValue(s), () => p.resetFields()), [s]), g(ee, { fields: f, form: p, component: !1, children: g("div", { ...d, className: z("ff-grid-layout", e), style: { "--grid-layout-item-margin-y": `${(r == null ? void 0 : r[0]) || 0}px`, "--grid-layout-item-margin-x": `${(r == null ? void 0 : r[1]) || 0}px`, "--grid-layout-container-padding-y": `${(n == null ? void 0 : n[0]) || 0}px`, "--grid-layout-container-padding-x": `${(n == null ? void 0 : n[1]) || 0}px`, "--grid-layout-cols": t, "--grid-layout-row-height": `${i}px` }, children: u }) }); -}, fr = (zt = gi, function({ code: e, data: t, ...i }) { + const [p] = te.useForm(), u = ui(o, mn, l), f = H(() => [{ name: "__PROPS__", value: a }], [a]); + return He(() => (p.setFieldsValue(s), () => p.resetFields()), [s]), g(te, { fields: f, form: p, component: !1, children: g("div", { ...d, className: z("ff-grid-layout", e), style: { "--grid-layout-item-margin-y": `${(r == null ? void 0 : r[0]) || 0}px`, "--grid-layout-item-margin-x": `${(r == null ? void 0 : r[1]) || 0}px`, "--grid-layout-container-padding-y": `${(n == null ? void 0 : n[0]) || 0}px`, "--grid-layout-container-padding-x": `${(n == null ? void 0 : n[1]) || 0}px`, "--grid-layout-cols": t, "--grid-layout-row-height": `${i}px` }, children: u }) }); +}, yr = (zt = gi, function({ code: e, data: t, ...i }) { const [n, r] = F({ resource: null, cols: 12, rowHeight: 21, fields: [] }); - return j(() => { + return A(() => { e && L.get(`/api/_/${e}`).then((a) => r(c.pick(a, ["resource", "cols", "rowHeight", "fields"]))); }, [e]), (n == null ? void 0 : n.resource) && g(zt, { ...i, rowHeight: n.rowHeight, cols: n.cols, fields: n.fields, data: n != null && n.resource ? { [n == null ? void 0 : n.resource]: t } : {} }); }); var zt; -const hn = ({ cols: e, rowHeight: t, itemMargin: i, fields: n, primaryKey: r, dataSource: a, itemClassName: o, itemRender: s = (u, f, m) => u, empty: l = g(ji, { description: null }), className: d, style: p = {} }) => { - const { classNames: u } = le(te), f = Le(), m = H(() => g(gi, { cols: e, rowHeight: t, itemMargin: i, fields: n, className: o }), [n, e, t, i]); +const fn = ({ cols: e, rowHeight: t, itemMargin: i, fields: n, primaryKey: r, dataSource: a, itemClassName: o, itemRender: s = (u, f, m) => u, empty: l = g(Vi, { description: null }), className: d, style: p = {} }) => { + const { classNames: u } = ce(ie), f = je(), m = H(() => g(gi, { cols: e, rowHeight: t, itemMargin: i, fields: n, className: o }), [n, e, t, i]); return g("div", { className: z("ff-data-list-content", u.content, d), style: p, children: c.isEmpty(a) ? l : a.map((h, b) => { const C = s(k.cloneElement(m, { data: h }), h, b); return k.cloneElement(C, { key: `${f}-${(h == null ? void 0 : h[r]) || b}` }); }) }); -}, fn = ({ component: e, $props: t }) => { - const { base62params: i } = Ue(t, {}); +}, yn = ({ component: e, $props: t }) => { + const { base62params: i } = We(t, {}); return g(G, { children: g(Pt, { listCode: e, base62params: L.decode(i) }) }); -}, yn = () => "Empty", wn = ({ component: e, $setting: t, $props: i }) => { +}, wn = () => "Empty", bn = ({ component: e, $setting: t, $props: i }) => { const [n, r] = F(); - j(() => { - if (!e) return r(g(yn, { description: null })); - oe.getWidgetComponent(e).catch((o) => ({ default: () => `${o}` })).then((o) => k.createElement(o.default, { $setting: t })).then(r); + A(() => { + if (!e) return r(g(wn, { description: null })); + le.getWidgetComponent(e).catch((o) => ({ default: () => `${o}` })).then((o) => k.createElement(o.default, { $setting: t })).then(r); }, [e]); - const a = Ue(i, {}); + const a = We(i, {}); return n ? k.cloneElement(n, a) : null; }; -var me, Q, he, fe, Be, De; -const ae = class ae { +var he, Z, fe, ye, De, qe; +const se = class se { constructor() { - R(this, Q, /* @__PURE__ */ new Map()); - R(this, he, {}); - R(this, fe, null); + R(this, Z, /* @__PURE__ */ new Map()); + R(this, fe, {}); + R(this, ye, null); v(this, "init", (t, i) => { - W(this, Q, t), W(this, he, i); + W(this, Z, t), W(this, fe, i); }); - v(this, "get", (t) => (y(this, Q).has(t) || (t = Array.from(y(this, Q).keys()).find((i) => y(this, Q).get(i).uri === t)), y(this, Q).get(t) || {})); + v(this, "get", (t) => (y(this, Z).has(t) || (t = Array.from(y(this, Z).keys()).find((i) => y(this, Z).get(i).uri === t)), y(this, Z).get(t) || {})); v(this, "redirect", (t, i, n = {}) => { const { uri: r, type: a, widgetProps: o } = this.get(t) || {}; - let s = qi(r || t, a != "list" ? i : c.mapValues(i, (d) => L.encode(d))); + let s = Ui(r || t, a != "list" ? i : c.mapValues(i, (d) => L.encode(d))); const l = new URLSearchParams(); for (const d in o || {}) (o == null ? void 0 : o.type) == "query" && l.append(d, i[d]); - return l.size > 0 && (s = `${s}?${l.toString()}`), y(this, fe).navigate(s, n); + return l.size > 0 && (s = `${s}?${l.toString()}`), y(this, ye).navigate(s, n); }); v(this, "getMenus", (t) => { var i; - return ((i = y(this, he)) == null ? void 0 : i[t]) || []; + return ((i = y(this, fe)) == null ? void 0 : i[t]) || []; }); v(this, "findMenuPathByUuid", (t) => { let i = []; - for (const n in y(this, he)) if (i = y(this, Be).call(this, y(this, he)[n], t, [n]), i.length > 1) return i; + for (const n in y(this, fe)) if (i = y(this, De).call(this, y(this, fe)[n], t, [n]), i.length > 1) return i; return i; }); - v(this, "getMenusByRouteUuid", (t) => y(this, De).call(this, t, Object.values(y(this, he)).flat())); - R(this, Be, (t, i, n = []) => { + v(this, "getMenusByRouteUuid", (t) => y(this, qe).call(this, t, Object.values(y(this, fe)).flat())); + R(this, De, (t, i, n = []) => { if (c.isEmpty(t)) return n; for (const { uuid: r, children: a } of t) { if (r == i) return n.concat(r); - if (!c.isEmpty(a)) return n.concat(r, y(this, Be).call(this, a, i)); + if (!c.isEmpty(a)) return n.concat(r, y(this, De).call(this, a, i)); } return n; }); - R(this, De, (t, i) => { + R(this, qe, (t, i) => { var r; let n = []; - for (const a of i) a.widgetType == "redirect" && (a.uuid == t || a.widget == t ? n.push(a) : (r = a.children) != null && r.length && (n = n.concat(y(this, De).call(this, t, a.children)))); + for (const a of i) a.widgetType == "redirect" && (a.uuid == t || a.widget == t ? n.push(a) : (r = a.children) != null && r.length && (n = n.concat(y(this, qe).call(this, t, a.children)))); return n; }); v(this, "getCurrentMenu", () => { @@ -501,17 +503,17 @@ const ae = class ae { }); v(this, "getCurrentRoute", (t = 0) => { var n; - const i = (n = y(this, fe).state.matches[y(this, fe).state.matches.length - 1 - t]) == null ? void 0 : n.route; + const i = (n = y(this, ye).state.matches[y(this, ye).state.matches.length - 1 - t]) == null ? void 0 : n.route; if (!i) return null; - for (let [r, a] of y(this, Q)) if (a.uri === i.path) return a; + for (let [r, a] of y(this, Z)) if (a.uri === i.path) return a; return null; }); v(this, "getPageParams", (t) => { var r, a, o; let i = "", n = {}; - if (Xt()) n = Ui(), i = (r = Wi()) == null ? void 0 : r.search; + if (Xt()) n = Wi(), i = (r = Hi()) == null ? void 0 : r.search; else { - const { location: s = {}, matches: l = [] } = ((a = y(this, fe)) == null ? void 0 : a.state) || {}; + const { location: s = {}, matches: l = [] } = ((a = y(this, ye)) == null ? void 0 : a.state) || {}; n = ((o = l[l.length - 1]) == null ? void 0 : o.params) || {}, i = s.search; } return i && new URLSearchParams(i).forEach((s, l) => { @@ -519,17 +521,17 @@ const ae = class ae { }), t ? c.get(n, t) : n; }); v(this, "createBrowserRouter", (t = {}) => { - if (y(this, Q).size == 0) return null; - const i = Ae.get("Common.WEBSITE_DEFAULT_THEME", "@pkg/ff/frameworks/DefaultTheme"), n = Ae.get(oe.checkUserToken() ? "Common.WEBSITE_LOGIN_REDIRECT" : "Common.WEBSITE_DEFAULT", "/index"), r = { [i]: 0 }, a = (s, l) => () => Promise.all([oe.getWidgetComponent(s), Ue(l)]).then(([d, p]) => [d.default || function() { + if (y(this, Z).size == 0) return null; + const i = Ae.get("Common.WEBSITE_DEFAULT_THEME", "@pkg/ff/frameworks/DefaultTheme"), n = Ae.get(le.checkUserToken() ? "Common.WEBSITE_LOGIN_REDIRECT" : "Common.WEBSITE_DEFAULT", "/index"), r = { [i]: 0 }, a = (s, l) => () => Promise.all([le.getWidgetComponent(s), We(l)]).then(([d, p]) => [d.default || function() { return `${s}`; - }, p]).then(([d, p]) => ({ Component: () => k.createElement(Zt, {}, k.createElement(d, { $setting: p })) })), o = Array.from(y(this, Q).values()).reduce((s, { uuid: l, uri: d, name: p, type: u, component: f, widgetSetting: m, widgetProps: h, isLogin: b, isLayout: C, extra: x }) => { + }, p]).then(([d, p]) => ({ Component: () => k.createElement(Zt, {}, k.createElement(d, { $setting: p })) })), o = Array.from(y(this, Z).values()).reduce((s, { uuid: l, uri: d, name: p, type: u, component: f, widgetSetting: m, widgetProps: h, isLogin: b, isLayout: C, extra: x }) => { let T = {}, P = 0; switch (u) { case "list": - T.element = k.createElement(fn, { component: f, $props: h }); + T.element = k.createElement(yn, { component: f, $props: h }); break; case "fsdpf-component": - T.element = k.createElement(wn, { key: f, component: f, $setting: m, $props: h }); + T.element = k.createElement(bn, { key: f, component: f, $setting: m, $props: h }); } const O = (x == null ? void 0 : x.theme) ?? (x == null ? void 0 : x.layout); if (O) { @@ -539,86 +541,86 @@ const ae = class ae { } return C && P > -1 ? (s[P].children.push({ path: d, ...T }), s) : [...s, { path: d, ...T }]; }, [{ path: "/", lazy: a(i, {}), children: [] }]); - return o.push({ index: !0, element: k.createElement(bn, { to: n, replace: !0 }) }), W(this, fe, Hi(o, t)); + return o.push({ index: !0, element: k.createElement(Cn, { to: n, replace: !0 }) }), W(this, ye, Ki(o, t)); }); - if (y(ae, me)) return y(ae, me); + if (y(se, he)) return y(se, he); } }; -me = new WeakMap(), Q = new WeakMap(), he = new WeakMap(), fe = new WeakMap(), Be = new WeakMap(), De = new WeakMap(), R(ae, me, null), v(ae, "getInstance", () => (y(ae, me) || W(ae, me, new ae()), y(ae, me))); -let wt = ae; -const bn = ({ to: e, replace: t }) => Xt() ? k.createElement(Ki, { to: e, replace: t }) : (window.document.location = e, "redirect"), be = wt.getInstance(), Pe = new Worker(new URL("/ff-worker/index.js", self.location)), Bt = { getConfigure: (e) => Ae.get(e), route: { redirect: (...e) => be.redirect(...e), getPageParams: (...e) => be.getPageParams(...e), getCurrentRoute: () => be.getCurrentRoute() }, popup: { notification: (...e) => _.notification(...e), success: (...e) => _.success(...e), error: (...e) => _.error(...e), form: (...e) => _.form(...e), modal: (...e) => _.modal(...e), confirm: (...e) => _.confirm(...e) } }; -var rt, Fe, ye; +he = new WeakMap(), Z = new WeakMap(), fe = new WeakMap(), ye = new WeakMap(), De = new WeakMap(), qe = new WeakMap(), R(se, he, null), v(se, "getInstance", () => (y(se, he) || W(se, he, new se()), y(se, he))); +let wt = se; +const Cn = ({ to: e, replace: t }) => Xt() ? k.createElement(Ji, { to: e, replace: t }) : (window.document.location = e, "redirect"), Ce = wt.getInstance(), $e = new Worker(new URL("/ff-worker/index.js", self.location)), Bt = { getConfigure: (e) => Ae.get(e), route: { redirect: (...e) => Ce.redirect(...e), getPageParams: (...e) => Ce.getPageParams(...e), getCurrentRoute: () => Ce.getCurrentRoute() }, popup: { notification: (...e) => _.notification(...e), success: (...e) => _.success(...e), error: (...e) => _.error(...e), form: (...e) => _.form(...e), modal: (...e) => _.modal(...e), confirm: (...e) => _.confirm(...e) } }; +var rt, Ee, we; const B = class B { constructor() { v(this, "exec", (t, i = {}, n = {}, r = "") => new Promise((a, o) => { if (!/^(?!\s*(\/\/|\/\*|\*)).*?\S+/m.test(t)) return a(); - const s = At(B, rt)._++; - y(B, Fe).set(s, n), B.mQueue.set(s, [a, o]), Pe.postMessage({ id: s, session: r, category: "eval", method: t, args: i }); + const s = jt(B, rt)._++; + y(B, Ee).set(s, n), B.mQueue.set(s, [a, o]), $e.postMessage({ id: s, session: r, category: "eval", method: t, args: i }); })); - v(this, "clear", (t) => Pe.postMessage({ session: t, category: "clear" })); - if (y(B, ye)) return y(B, ye); - Promise.resolve().then(() => Un).then((t) => { + v(this, "clear", (t) => $e.postMessage({ session: t, category: "clear" })); + if (y(B, we)) return y(B, we); + Promise.resolve().then(() => Wn).then((t) => { Bt.http = t.http; - }), Pe.addEventListener("message", ({ data: { id: t, task_id: i, method: n, args: r, category: a, data: o, error: s, session: l } }) => { - if (a === "eval" && B.mQueue.has(t)) s !== null ? B.mQueue.get(t)[1](s) : B.mQueue.get(t)[0](o), y(B, Fe).delete(t), B.mQueue.delete(t); + }), $e.addEventListener("message", ({ data: { id: t, task_id: i, method: n, args: r, category: a, data: o, error: s, session: l } }) => { + if (a === "eval" && B.mQueue.has(t)) s !== null ? B.mQueue.get(t)[1](s) : B.mQueue.get(t)[0](o), y(B, Ee).delete(t), B.mQueue.delete(t); else if (a === "util") try { - const d = c.get(Bt, n.split("/")) || c.get(y(B, Fe).get(i), n.split("/")); + const d = c.get(Bt, n.split("/")) || c.get(y(B, Ee).get(i), n.split("/")); if (!c.isFunction(d)) throw `${n} not found`; Promise.resolve(Reflect.apply(d, void 0, r)).then((p) => { - Pe.postMessage({ id: t, task_id: i, category: a, method: n, args: r, session: l, data: p, error: null }); + $e.postMessage({ id: t, task_id: i, category: a, method: n, args: r, session: l, data: p, error: null }); }).catch((p) => { - Pe.postMessage({ id: t, task_id: i, category: a, method: n, args: r, session: l, data: null, error: p }); + $e.postMessage({ id: t, task_id: i, category: a, method: n, args: r, session: l, data: null, error: p }); }); } catch (d) { - Pe.postMessage({ id: t, task_id: i, category: a, method: n, args: r, session: l, data: null, error: d }); + $e.postMessage({ id: t, task_id: i, category: a, method: n, args: r, session: l, data: null, error: d }); } }, !1); } }; -rt = new WeakMap(), Fe = new WeakMap(), ye = new WeakMap(), v(B, "mQueue", /* @__PURE__ */ new Map()), R(B, rt, 0), R(B, Fe, /* @__PURE__ */ new Map()), R(B, ye, null), v(B, "getInstance", () => (y(B, ye) || W(B, ye, new B()), y(B, ye))); +rt = new WeakMap(), Ee = new WeakMap(), we = new WeakMap(), v(B, "mQueue", /* @__PURE__ */ new Map()), R(B, rt, 0), R(B, Ee, /* @__PURE__ */ new Map()), R(B, we, null), v(B, "getInstance", () => (y(B, we) || W(B, we, new B()), y(B, we))); let bt = B; -const Ce = bt.getInstance(), at = () => { +const ke = bt.getInstance(), at = () => { const e = U(!0), [, t] = k.useReducer((i) => i + 1, 0); - return j(() => () => e.current = !1, []), () => e.current && t(); -}, yr = (e) => { + return A(() => () => e.current = !1, []), () => e.current && t(); +}, wr = (e) => { const t = U(); - return j(() => { + return A(() => { t.current = e; }, [e]), t.current; -}, wr = (e) => { +}, br = (e) => { const [t, i] = F(e), n = U(null), r = Y((a, o) => { n.current = o, i(a); }, []); - return j(() => { + return A(() => { n.current && (n.current(t), n.current = null); }, [t]), [t, r]; -}, We = (e = (n) => { +}, He = (e = (n) => { }, t, i = c.isEqual) => { const n = k.useRef(); i(t, n.current) || (n.current = c.cloneDeep(t)), k.useEffect(e, [n.current]); -}, st = We, pi = (e, t = "string") => { +}, st = He, pi = (e, t = "string") => { var i; if (!Array.isArray(e)) return e; - for (let n = 0; n < e.length; n++) e[n].value = Z((i = e[n]) == null ? void 0 : i.value, t), e[n] && Reflect.has(e[n], "children") && (e[n].children = pi(e[n].children, t)); + for (let n = 0; n < e.length; n++) e[n].value = ee((i = e[n]) == null ? void 0 : i.value, t), e[n] && Reflect.has(e[n], "children") && (e[n].children = pi(e[n].children, t)); return e; -}, br = (e, t = "json", i = "string", n, r = null) => { - const [a] = ee.useForm(n), [o, s] = F([{ label: "无", value: "", disabled: !0 }]), l = U([]), d = ee.useWatch((p) => l.current.length === 0 ? null : c.pick(p, l.current), a) || null; - return j(() => { - Array.isArray(e) ? s(e) : t === "javascript" && e ? Ce.exec(e, {}, { getFieldValue: (p) => (l.current.includes(p) || l.current.push(p), a.getFieldValue(p)), getFieldValueForBasicForm: (p) => (l.current.includes(p) || l.current.push(p), r ? r.getFieldValue(p) : a.getFieldValue(p)) }).then((p) => { - s(Z(p, "array")); - }) : e && s(Z(e, "array")); +}, Cr = (e, t = "json", i = "string", n, r = null) => { + const [a] = te.useForm(n), [o, s] = F([{ label: "无", value: "", disabled: !0 }]), l = U([]), d = te.useWatch((p) => l.current.length === 0 ? null : c.pick(p, l.current), a) || null; + return A(() => { + Array.isArray(e) ? s(e) : t === "javascript" && e ? ke.exec(e, {}, { getFieldValue: (p) => (l.current.includes(p) || l.current.push(p), a.getFieldValue(p)), getFieldValueForBasicForm: (p) => (l.current.includes(p) || l.current.push(p), r ? r.getFieldValue(p) : a.getFieldValue(p)) }).then((p) => { + s(ee(p, "array")); + }) : e && s(ee(e, "array")); }, [e, t, d]), pi(o, i); -}, Cr = (e) => { +}, kr = (e) => { const [t, i] = F(), n = { type: "GET" }; if (typeof e == "string" ? n.url = e : c.isPlainObject(e) && Object.assign(n, e), !(n != null && n.url)) throw "url is required"; const r = (a) => L.request(n, !1).resp((o) => (console.log("useSubscribeRequest", a), i(o), o)); - return We(() => { + return He(() => { let a = null; return r().then((o) => { a = ci.subscribe(c.throttle(r, 180, { leading: !1, trailing: !0 }), o.res); }), () => a == null ? void 0 : a(); }, n), t; -}, Cn = (e) => { +}, kn = (e) => { const [t, i] = k.useState({ gridItems: [], hideItems: [] }); return k.useEffect(() => { e && L.get(`/api/_/${e}`).then(({ pk: n, uuid: r, code: a, resource: o, align: s, cols: l, rowHeight: d, marginX: p, marginY: u, listenChangeFields: f, listenChangeFieldsFunc: m, fields: h }) => ({ pk: n, uuid: r, code: a, resource: o, align: s, cols: l, rowHeight: d, marginX: p, marginY: u, listenChangeFields: f, listenChangeFieldsFunc: m, ...h.reduce((b, C) => { @@ -626,9 +628,9 @@ const Ce = bt.getInstance(), at = () => { return (x = C == null ? void 0 : C.field) != null && x.hidden ? b.hides.push(C == null ? void 0 : C.field) : b.items.push(C), b; }, { items: [], hides: [] }) })).then(i); }, [e]), t; -}, kn = ({ max: e = 0, min: t = 0, type: i = "", message: n, pattern: r, required: a = !1, validator: o } = {}, s, l) => { +}, xn = ({ max: e = 0, min: t = 0, type: i = "", message: n, pattern: r, required: a = !1, validator: o } = {}, s, l) => { const [d, p] = F([]); - return j(() => { + return A(() => { const u = []; if (a) { let f = l; @@ -654,26 +656,26 @@ const Ce = bt.getInstance(), at = () => { break; case "validator": o && u.push(({ getFieldValue: f }) => ({ validator: async (m, h) => { - const b = await Ce.exec(o, { value: h, fieldName: s }, { getFieldValue: f }); + const b = await ke.exec(o, { value: h, fieldName: s }, { getFieldValue: f }); return c.isString(b) && b ? Promise.reject(b) : c.isBoolean(b) && !b ? Promise.reject(n) : Promise.resolve(); } })); } p(u); }, [e, t, i, n, r, a, o]), d; -}, xn = (e, t, i) => { +}, Sn = (e, t, i) => { const [n, r] = F(null); - return j(() => { + return A(() => { const { initDataUri: a = `/api/${e}`, initDataMethod: o = "GET" } = i || {}; t && L.request({ method: o, url: c.trimEnd(`${a}/${t}`, "/") }).then((s) => { r(s); }); }, [e, t, i]), n; }, mi = (e, t, i = {}, n = {}, r = {}) => { - const a = le(Gt), o = at(), s = U(!0), l = U([]), [d, p] = F(t), u = ee.useWatch((f) => JSON.stringify(c.pick(f, l.current)), a) || "{}"; + const a = ce(Gt), o = at(), s = U(!0), l = U([]), [d, p] = F(t), u = te.useWatch((f) => JSON.stringify(c.pick(f, l.current)), a) || "{}"; return st(() => { - e && Ce.exec(e, i, { ...n, getFieldValueForBasicForm: (f) => r ? r.getFieldValue(f) : null, getFieldValue: c.wrap(a.getFieldValue, (f, m) => (l.current.some((h) => c.isEqual(h, m)) || (l.current.push(m), o()), f == null ? void 0 : f(m))), isFieldTouched: a.isFieldTouched, isFieldsTouched: a.isFieldsTouched }).then((f) => s.current && p(f)); - }, [e, u, a, i, n]), j(() => () => s.current = !1, []), d; -}, Sn = (e, t, i = [], n = {}) => { + e && ke.exec(e, i, { ...n, getFieldValueForBasicForm: (f) => r ? r.getFieldValue(f) : null, getFieldValue: c.wrap(a.getFieldValue, (f, m) => (l.current.some((h) => c.isEqual(h, m)) || (l.current.push(m), o()), f == null ? void 0 : f(m))), isFieldTouched: a.isFieldTouched, isFieldsTouched: a.isFieldsTouched }).then((f) => s.current && p(f)); + }, [e, u, a, i, n]), A(() => () => s.current = !1, []), d; +}, vn = (e, t, i = [], n = {}) => { const r = U({}); if (!t) return [e, r.current]; const a = U(), o = c.debounce(at(), 180), s = ["disabled", "required"], l = (u, f) => { @@ -685,11 +687,11 @@ const Ce = bt.getInstance(), at = () => { e = ti(u, f), r.current = c.merge(m, c.pick(r.current, s)); } return [e, r.current]; -}, Dt = (e) => e === void 0 || e === !1 ? "" : (Array.isArray(e) ? e : [e]).join("_"), kr = ({ value: e, onChange: t }, i = null) => { - const n = U(), [r] = ee.useForm(i), a = U({}); +}, Dt = (e) => e === void 0 || e === !1 ? "" : (Array.isArray(e) ? e : [e]).join("_"), xr = ({ value: e, onChange: t }, i = null) => { + const n = U(), [r] = te.useForm(i), a = U({}); return st(() => { c.isEqual(n.current, e) || r.setFieldsValue(e); - }, [e]), j(() => () => r.resetFields(), []), [H(() => r.__INTERNAL__ ? r : { ...r, __INTERNAL__: { itemRef: (o) => (s) => { + }, [e]), A(() => () => r.resetFields(), []), [H(() => r.__INTERNAL__ ? r : { ...r, __INTERNAL__: { itemRef: (o) => (s) => { const l = Dt(o); s ? a.current[l] = s : delete a.current[l]; } }, scrollToField: (o, s = {}) => { @@ -702,49 +704,49 @@ const Ce = bt.getInstance(), at = () => { } }, [r]), (o, s) => { n.current = s, t == null || t(s); }]; -}, vn = ({ type: e, initialValue: t, initialValueLanguage: i, onChange: n, basicForm: r }) => { +}, Pn = ({ type: e, initialValue: t, initialValueLanguage: i, onChange: n, basicForm: r }) => { const a = mi(i == "javascript" && t, i == "javascript" ? void 0 : t, {}, {}, r); - return j(() => { - i == "javascript" ? n(Z(a, e)) : t && n(Z(t, e)); + return A(() => { + i == "javascript" ? n(ee(a, e)) : t && n(ee(t, e)); }, [e, t, a]), null; }, hi = ({ widget: e = "Input", widgetPrefix: t = "@pkg/ff/grid-layout-forms", widgetDecorator: i, subWidgets: n = [], basicForm: r, ...a }) => { - const o = ti(e, t), [s, l] = Sn(o, i, n, r), [d, p] = F(); - return j(() => { - s && oe.getWidgetComponent(s).then(({ defaultProps: u = {}, default: f }) => ({ default: Pn(f, u, r) })).catch((u) => ({ default: () => `${u}` })).then((u) => p(k.createElement(u.default, a))); + const o = ti(e, t), [s, l] = vn(o, i, n, r), [d, p] = F(); + return A(() => { + s && le.getWidgetComponent(s).then(({ defaultProps: u = {}, default: f }) => ({ default: $n(f, u, r) })).catch((u) => ({ default: () => `${u}` })).then((u) => p(k.createElement(u.default, a))); }, [s]), d && k.cloneElement(d, { ...a, ...l }); -}, Pn = (e, t = {}, i = null) => (n) => { - const { type: r, code: a, label: o, noStyle: s, placeholder: l, required: d = !1, extras: p, validators: u, help: f, isVirtual: m, $isReserved: h, initialValue: b, initialValueLanguage: C, ...x } = c.omit(c.merge({}, t, n), ["convertJs", "convertJsSetting", "widget", "widgetPerfix", "widgetDecorator", "subWidgets", "boxStyle"]), T = kn(Object.assign({}, u, d ? { required: !0 } : {}), a, r), P = H(() => { +}, $n = (e, t = {}, i = null) => (n) => { + const { type: r, code: a, label: o, noStyle: s, placeholder: l, required: d = !1, extras: p, validators: u, help: f, isVirtual: m, $isReserved: h, initialValue: b, initialValueLanguage: C, ...x } = c.omit(c.merge({}, t, n), ["convertJs", "convertJsSetting", "widget", "widgetPerfix", "widgetDecorator", "subWidgets", "boxStyle"]), T = xn(Object.assign({}, u, d ? { required: !0 } : {}), a, r), P = H(() => { const M = Object.keys((t == null ? void 0 : t.extras) || {}); return c.over([c.partialRight(c.pick, M), c.partialRight(c.omit, M)]); - }, [t == null ? void 0 : t.extras]), [O, V] = P(x), q = { label: o, noStyle: s, colon: !1, layout: "vertical" }, I = Y((M) => M == null ? void 0 : Z(M, r), [r]); + }, [t == null ? void 0 : t.extras]), [O, V] = P(x), q = { label: o, noStyle: s, colon: !1, layout: "vertical" }, I = Y((M) => M == null ? void 0 : ee(M, r), [r]); return g(Yt, { name: a, rules: T, initialValue: I(b), normalize: I, children: (M, N, S) => { var E; return g(e, { type: r, rcform: S, basicForm: i, itemProps: { validateStatus: N.errors.length > 0 ? "error" : "success", tooltip: f, help: N.errors.length > 0 ? N.errors.join("、") : null, required: ((E = T == null ? void 0 : T[0]) == null ? void 0 : E.required) || !1, ...q }, fieldProps: { placeholder: l, ...V, ...M }, $setting: Object.assign({}, p, O) }); } }); }, $t = ({ cols: e = 24, rowHeight: t = 16, itemMargin: i = [8, 16], containerPadding: n = [0, 0], fields: r = [], children: a, basicForm: o = null }) => { const s = ui(r, hi, o); - return A("div", { className: "ff-grid-layout-form", style: { "--grid-layout-item-margin-x": `${(i == null ? void 0 : i[0]) ?? 8}px`, "--grid-layout-item-margin-y": `${(i == null ? void 0 : i[1]) ?? 16}px`, "--grid-layout-container-padding-y": `${(n == null ? void 0 : n[0]) || 0}px`, "--grid-layout-container-padding-x": `${(n == null ? void 0 : n[1]) || 0}px`, "--grid-layout-cols": e, "--grid-layout-row-height": `${t}px` }, children: [s, a && k.cloneElement(a, { cols: e, rowHeight: t, itemMargin: i, containerPadding: n, fields: r })] }); + return j("div", { className: "ff-grid-layout-form", style: { "--grid-layout-item-margin-x": `${(i == null ? void 0 : i[0]) ?? 8}px`, "--grid-layout-item-margin-y": `${(i == null ? void 0 : i[1]) ?? 16}px`, "--grid-layout-container-padding-y": `${(n == null ? void 0 : n[0]) || 0}px`, "--grid-layout-container-padding-x": `${(n == null ? void 0 : n[1]) || 0}px`, "--grid-layout-cols": e, "--grid-layout-row-height": `${t}px` }, children: [s, a && k.cloneElement(a, { cols: e, rowHeight: t, itemMargin: i, containerPadding: n, fields: r })] }); }; $t.propTypes = { fields: w.array }; -const $n = (qt = $t, ({ code: e, layout: t, name: i, primaryKey: n = 0, style: r = {}, formProps: a = {}, form: o, basicForm: s, isPreview: l = !1, className: d, onFinish: p, onValuesChange: u = () => { +const Tn = (qt = $t, ({ code: e, layout: t, name: i, primaryKey: n = 0, style: r = {}, formProps: a = {}, form: o, basicForm: s, isPreview: l = !1, className: d, onFinish: p, onValuesChange: u = () => { }, ...f }) => { - const { align: m, autoComplete: h, resource: b, items: C, hides: x, rowHeight: T, marginX: P, marginY: O, cols: V, listenChangeFields: q, listenChangeFieldsFunc: I, pk: M, uuid: N } = Cn(e), [S] = ee.useForm(o), E = H(() => [{ name: "__PK__", value: M }, { name: "__PROPS__", value: a }, { name: "__RESOURCE__", value: b }, { name: "__LAYOUT_KEY__", value: e }, { name: "__LAYOUT_UUID__", value: N }, { name: "__PRIMARY_KEY__", value: n }], [M, e, N, b, n, a]); - return A(ee, { className: d, name: i || e, layout: t || m, fields: E, form: S, autoComplete: h, style: { ...r, position: "relative" }, onFinish: p, onValuesChange: (D, X) => (({ changedValues: ve, allValues: K, listenChangeFields: ot, listenChangeFieldsFunc: Ke, onValuesChange: lt, code: Et }) => { - lt(ve, K), Ke && Array.isArray(ot) && Ce.exec(Ke, { changedValues: ve, allValues: K }, { getFieldValue: S.getFieldValue, setFieldValue: S.setFieldValue, setFieldsValue: S.setFieldsValue, isFieldTouched: S.isFieldTouched, isFieldsTouched: S.isFieldsTouched }); + const { align: m, autoComplete: h, resource: b, items: C, hides: x, rowHeight: T, marginX: P, marginY: O, cols: V, listenChangeFields: q, listenChangeFieldsFunc: I, pk: M, uuid: N } = kn(e), [S] = te.useForm(o), E = H(() => [{ name: "__PK__", value: M }, { name: "__PROPS__", value: a }, { name: "__RESOURCE__", value: b }, { name: "__LAYOUT_KEY__", value: e }, { name: "__LAYOUT_UUID__", value: N }, { name: "__PRIMARY_KEY__", value: n }], [M, e, N, b, n, a]); + return j(te, { className: d, name: i || e, layout: t || m, fields: E, form: S, autoComplete: h, style: { ...r, position: "relative" }, onFinish: p, onValuesChange: (D, X) => (({ changedValues: Pe, allValues: K, listenChangeFields: ot, listenChangeFieldsFunc: Je, onValuesChange: lt, code: Et }) => { + lt(Pe, K), Je && Array.isArray(ot) && ke.exec(Je, { changedValues: Pe, allValues: K }, { getFieldValue: S.getFieldValue, setFieldValue: S.setFieldValue, setFieldsValue: S.setFieldsValue, isFieldTouched: S.isFieldTouched, isFieldsTouched: S.isFieldsTouched }); })({ changedValues: D, allValues: X, listenChangeFields: q, listenChangeFieldsFunc: I, onValuesChange: u, code: e }), children: [g(qt, { ...f, form: S, basicForm: s, code: e, fields: C, cols: V, rowHeight: T, itemMargin: [P, O] }), x == null ? void 0 : x.map((D) => { var X; - return g(Yt, { name: D.code, children: g(vn, { form: S, basicForm: s, name: D.code, type: D.type, initialValue: D.initialValue, initialValueLanguage: (X = D.extras) == null ? void 0 : X.initialValueLanguage }) }, JSON.stringify(D.code)); + return g(Yt, { name: D.code, children: g(Pn, { form: S, basicForm: s, name: D.code, type: D.type, initialValue: D.initialValue, initialValueLanguage: (X = D.extras) == null ? void 0 : X.initialValueLanguage }) }, JSON.stringify(D.code)); })] }, e); }); var qt; const fi = ({ $setting: e, $close: t, extras: i, code: n, primaryKey: r, ...a }) => { - const [o] = ee.useForm(), s = xn(n, r, e); - return j(() => { + const [o] = te.useForm(), s = Sn(n, r, e); + return A(() => { s && o.setFieldsValue(s); - }, [s]), g(G, { actions: A(k.Fragment, { children: [g($, { name: "保存", type: "primary", widget: () => { + }, [s]), g(G, { actions: j(k.Fragment, { children: [g($, { name: "保存", type: "primary", widget: () => { const l = o.getFieldValue("__RESOURCE__"), { initDataUri: d = `/api/${n}` } = e || {}; o.validateFields(!0).then((p) => l ? c.pick(p, [l]) : p).then((p) => L.post(r ? `${d}/${r}` : `${d}`, p).msg(t)).catch(() => _.error("请先完善表单信息", { duration: 2e3 })); - } }), g($, { name: "取消", widget: () => t(!1) })] }), extras: i, children: g($n, { form: o, code: n, primaryKey: r, ...a }) }); + } }), g($, { name: "取消", widget: () => t(!1) })] }), extras: i, children: g(Tn, { form: o, code: n, primaryKey: r, ...a }) }); }, Ut = /* @__PURE__ */ new Set(), Ct = (e = [], t = 0) => { const i = e[t]; if (i.length && !Ut.has(i)) { @@ -757,7 +759,7 @@ const fi = ({ $setting: e, $close: t, extras: i, code: n, primaryKey: r, ...a }) } }, kt = ({ className: e, type: t, style: i = {}, ...n }) => g("span", { role: "img", className: z("ff-iconfont", e), style: i, ...n, children: g("svg", { style: { width: "1em", height: "1em", fill: "currentColor", overflow: "hidden" }, viewBox: "0 0 1024 1024", children: g("use", { xlinkHref: `#${t}` }) }) }); kt.propTypes = { className: w.string, type: w.string.isRequired, style: w.object }, kt.init = Ct; -const Tn = (e, t, i, { isReplaceRouteHistory: n = !1 } = {}) => be.redirect(i, t, { replace: n }), Nn = (e, t = {}, i, n = {}) => { +const Nn = (e, t, i, { isReplaceRouteHistory: n = !1 } = {}) => Ce.redirect(i, t, { replace: n }), Fn = (e, t = {}, i, n = {}) => { var a; const r = (a = n.router) == null ? void 0 : a.reduce((o, [s, l, d]) => { const p = c.get(t, ["router", s]); @@ -767,68 +769,68 @@ const Tn = (e, t, i, { isReplaceRouteHistory: n = !1 } = {}) => be.redirect(i, t return L.del(r, t.param).msg(); }, Wt = (e, t, i, { status: { loading: n, disabled: r }, setStatus: a }) => { const o = { loading: (s) => s === void 0 ? n : a((l) => ({ ...l, loading: s })), disabled: (s) => s === void 0 ? r : a((l) => ({ ...l, disabled: s })) }; - return c.isFunction(i) ? i.call(null, { ...t, ...o }) : c.isString(i) && i ? Ce.exec(i, t, o) : null; -}, Ht = (e, t, i, n, r) => c.isString(i) && i ? oe.getWidgetComponent(i).then(({ default: a }) => _.modal(a, { ...t, $setting: n }, r != null && r.title ? { ...r, title: c.template(r.title)(e) } : r)).catch((a) => { + return c.isFunction(i) ? i.call(null, { ...t, ...o }) : c.isString(i) && i ? ke.exec(i, t, o) : null; +}, Ht = (e, t, i, n, r) => c.isString(i) && i ? le.getWidgetComponent(i).then(({ default: a }) => _.modal(a, { ...t, $setting: n }, r != null && r.title ? { ...r, title: c.template(r.title)(e) } : r)).catch((a) => { _.error(i, { content: a.toString() }); -}) : _.modal(i, { ...t, $setting: n }, r != null && r.title ? { ...r, title: c.template(r.title)(e) } : r), Fn = (e, t, i, n, r) => _.modal(fi, { ...t, $setting: n, code: i }, r != null && r.title ? { ...r, title: c.template(r.title)(e) } : r), En = (e, t, i, n, r) => _.modal(Pt, { base62params: t, $setting: n, listCode: i }, r != null && r.title ? { ...r, title: c.template(r.title)(e) } : r), Rn = ({ widget: e, widgetType: t, widgetData: i, widgetProps: n, widgetSetting: r, widgetContainerProps: a }, { onAfterClick: o, onBeforeClick: s }) => { - const l = le(te), [d, p] = F({ leading: !0, trailing: !1 }), u = H(() => { +}) : _.modal(i, { ...t, $setting: n }, r != null && r.title ? { ...r, title: c.template(r.title)(e) } : r), En = (e, t, i, n, r) => _.modal(fi, { ...t, $setting: n, code: i }, r != null && r.title ? { ...r, title: c.template(r.title)(e) } : r), Rn = (e, t, i, n, r) => _.modal(Pt, { base62params: t, $setting: n, listCode: i }, r != null && r.title ? { ...r, title: c.template(r.title)(e) } : r), On = ({ widget: e, widgetType: t, widgetData: i, widgetProps: n, widgetSetting: r, widgetContainerProps: a }, { onAfterClick: o, onBeforeClick: s }) => { + const l = ce(ie), [d, p] = F({ leading: !0, trailing: !1 }), u = H(() => { switch (t) { case "redirect": - return c.partialRight(Tn, e, r); + return c.partialRight(Nn, e, r); case "func": return c.partialRight(Wt, (r == null ? void 0 : r.code) ?? e, { status: d, setStatus: p }); case "fsdpf-component": return c.partialRight(Ht, e, r, a); case "grid-layout-form": - return c.partialRight(Fn, e, r, a); - case "data-list": return c.partialRight(En, e, r, a); + case "data-list": + return c.partialRight(Rn, e, r, a); case "destroy": - return c.partialRight(Nn, e, r, a); + return c.partialRight(Fn, e, r, a); default: if (Ft(e) || k.isValidElement(e)) return c.partialRight(Ht, e, r, a); if (c.isFunction(e)) return c.partialRight(Wt, (r == null ? void 0 : r.code) || e, { status: d, setStatus: p }); } return (...f) => console.error("useButton unknown widgetType", t, ...f); }, [e, t]); - return [c.debounce((f) => (s == null || s(f), Promise.resolve(Ue(n, f, { list: l })).then((m) => u(f, { ...i, ...m })).then((m) => o == null ? void 0 : o(m)).catch(console.error)), 300, { leading: !0, trailing: !1 }), d]; + return [c.debounce((f) => (s == null || s(f), Promise.resolve(We(n, f, { list: l })).then((m) => u(f, { ...i, ...m })).then((m) => o == null ? void 0 : o(m)).catch(console.error)), 300, { leading: !0, trailing: !1 }), d]; }, yi = ({ type: e, name: t, className: i, icon: n, iconPosition: r, size: a }, o = "default") => H(() => { const s = { type: "primary", className: z("ff-button", i), iconPosition: r, size: a }; return e === "danger" ? s.danger = !0 : e === "default" && (s.type = e), o === "link" || o === "dashed" ? (s.type = o, e === "default" && (s.className = z(s.className, "ff-default"))) : o !== "circle" && o !== "round" || (s.shape = o), n && (s.icon = g(kt, { type: n })), t && (s.children = t), s; -}, [o, e, i, n, r]), He = (e) => function({ className: t, variant: i, children: n, name: r, icon: a, type: o = "default", iconPosition: s = "start", noAuthType: l, onAfterClick: d, onBeforeClick: p, data: u, loading: f, disabled: m, tooltip: h, confirm: b, widget: C = () => { +}, [o, e, i, n, r]), Ke = (e) => function({ className: t, variant: i, children: n, name: r, icon: a, type: o = "default", iconPosition: s = "start", noAuthType: l, onAfterClick: d, onBeforeClick: p, data: u, loading: f, disabled: m, tooltip: h, confirm: b, widget: C = () => { }, widgetType: x, widgetData: T, widgetProps: P, widgetSetting: O, widgetContainerProps: V, ...q }) { - const I = c.isEmpty(h) || !h.enabled ? {} : h, M = c.isEmpty(b) ? { enabled: !1 } : Object.assign({ enabled: !0 }, b), N = yi({ className: t, name: r, type: o, icon: a, iconPosition: s }, i ?? e), [S, E] = F(!1), [D, { disabled: X, loading: ve }] = Rn({ widget: C, widgetType: x, widgetData: T, widgetProps: P, widgetSetting: O, widgetContainerProps: V }, { onAfterClick: d, onBeforeClick: p }); - return g(Vi, { okText: "确定", cancelText: "取消", getPopupContainer: (K) => K, ...M, disabled: X || m, open: S, onOpenChange: (K) => { + const I = c.isEmpty(h) || !h.enabled ? {} : h, M = c.isEmpty(b) ? { enabled: !1 } : Object.assign({ enabled: !0 }, b), N = yi({ className: t, name: r, type: o, icon: a, iconPosition: s }, i ?? e), [S, E] = F(!1), [D, { disabled: X, loading: Pe }] = On({ widget: C, widgetType: x, widgetData: T, widgetProps: P, widgetSetting: O, widgetContainerProps: V }, { onAfterClick: d, onBeforeClick: p }); + return g(Ii, { okText: "确定", cancelText: "取消", getPopupContainer: (K) => K, ...M, disabled: X || m, open: S, onOpenChange: (K) => { if (!K) return E(K); M.enabled ? E(K) : D(u); }, onConfirm: () => { D(u); }, onClick: (K) => { K.stopPropagation(); - }, children: g(Ii, { getPopupContainer: (K) => K, ...I, title: S ? null : I == null ? void 0 : I.title, trigger: ["hover", "click"], children: g(Qe, { loading: ve || f, disabled: X || m, ...N, ...q, children: n || r }) }) }); -}, $ = He("default"); + }, children: g(Mi, { getPopupContainer: (K) => K, ...I, title: S ? null : I == null ? void 0 : I.title, trigger: ["hover", "click"], children: g(Qe, { loading: Pe || f, disabled: X || m, ...N, ...q, children: n || r }) }) }); +}, $ = Ke("default"); $.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", "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 On = He("link"), Ln = He("circle"), An = He("round"), jn = He("dashed"), Tt = ({ data: e, widget: t, widgetType: i = "fsdpf-component", widgetData: n, widgetProps: r, widgetSetting: a, widgetContainerProps: o, onAfterClick: s, onBeforeClick: l, children: d, extras: p }) => { - const u = le(te), [f, m] = F(!1), [h, b] = F("hover"), [C, x] = F({}), [T, P] = F(), { placement: O, align: V, arrow: q = { pointAtCenter: !0 }, getPopupContainer: I, ...M } = o || {}; - j(() => { - i == "grid-layout-form" ? P(k.createElement(fi, { ...n, $setting: a, code: t })) : i == "data-list" ? P(k.createElement(Pt, { base62params: e, $setting: a, listCode: t })) : c.isString(t) ? oe.getWidgetComponent(t).then(({ default: E }) => { +const Ln = Ke("link"), jn = Ke("circle"), An = Ke("round"), Vn = Ke("dashed"), Tt = ({ data: e, widget: t, widgetType: i = "fsdpf-component", widgetData: n, widgetProps: r, widgetSetting: a, widgetContainerProps: o, onAfterClick: s, onBeforeClick: l, children: d, extras: p }) => { + const u = ce(ie), [f, m] = F(!1), [h, b] = F("hover"), [C, x] = F({}), [T, P] = F(), { placement: O, align: V, arrow: q = { pointAtCenter: !0 }, getPopupContainer: I, ...M } = o || {}; + A(() => { + i == "grid-layout-form" ? P(k.createElement(fi, { ...n, $setting: a, code: t })) : i == "data-list" ? P(k.createElement(Pt, { base62params: e, $setting: a, listCode: t })) : c.isString(t) ? le.getWidgetComponent(t).then(({ default: E }) => { P(k.createElement(E, { ...n, $setting: a })); }).catch((E) => P(E.toString())) : Ft(t) ? P(k.createElement(t, { ...n, $setting: a })) : k.isValidElement(t) && P(k.cloneElement(t, { ...n, $setting: a })); - }, [t, i, n]), j(() => { - Promise.resolve(Ue(r, e, { list: u })).then(x); + }, [t, i, n]), A(() => { + Promise.resolve(We(r, e, { list: u })).then(x); }, [r, e, u.getBase62params]); const N = (E, D = !1) => (m(E), !E && b("hover"), E ? l == null ? void 0 : l(C) : s == null ? void 0 : s(D)), S = (E) => { m(!0), b("click"); }; - return g(Mi, { zIndex: 1080, placement: O, onPopupClick: S, onClick: S, open: f, align: V, arrow: q, trigger: h, getPopupContainer: I, content: g(Vn, { ...M, extras: p, children: T && k.cloneElement(T, { ...C, $close: (E) => N(!1, E) }) }), children: d, onOpenChange: N }); -}, Vn = ({ title: e, className: t, children: i, extras: n, width: r, height: a, ...o }) => { + return g(zi, { zIndex: 1080, placement: O, onPopupClick: S, onClick: S, open: f, align: V, arrow: q, trigger: h, getPopupContainer: I, content: g(In, { ...M, extras: p, children: T && k.cloneElement(T, { ...C, $close: (E) => N(!1, E) }) }), children: d, onOpenChange: N }); +}, In = ({ title: e, className: t, children: i, extras: n, width: r, height: a, ...o }) => { const [s, l] = F({}), d = Y((m, h) => l((b) => ({ ...b, [m]: h })), []), p = Y((m) => l((h) => ({ ...h, [m]: void 0 })), []), u = e ? k.createElement("div", { className: "ff-popup-title" }, e) : s == null ? void 0 : s.title, f = n ?? k.createElement("div", { className: "ff-popup-reserved-extras" }, n); - return g(qe.Provider, { value: { ele: s, mount: d, unmount: p }, children: A("div", { className: z("ff-popup ff-popover", t, s.rootClassName), style: { width: r, height: a }, ...o, children: [A("div", { className: "ff-popup-header", children: [u, s == null ? void 0 : s["sub-title"]] }), i, A("div", { className: "ff-popup-footer", children: [f, s == null ? void 0 : s.extras, s == null ? void 0 : s.actions] })] }) }); + return g(Ue.Provider, { value: { ele: s, mount: d, unmount: p }, children: j("div", { className: z("ff-popup ff-popover", t, s.rootClassName), style: { width: r, height: a }, ...o, children: [j("div", { className: "ff-popup-header", children: [u, s == null ? void 0 : s["sub-title"]] }), i, j("div", { className: "ff-popup-footer", children: [f, s == null ? void 0 : s.extras, s == null ? void 0 : s.actions] })] }) }); }; Tt.propTypes = { widgetType: w.oneOf(["fsdpf-component", "grid-layout-form", "data-list"]) }; const Kt = ({ options: e = [], triggerWeights: t = ["grid-layout-form", "grid-layout", "fsdpf-component", "print"], onAfterClick: i = (m, h, b) => { }, onBeforeClick: n = (m, h, b) => { -}, labelVariant: r = "link", labelSize: a, labelRender: o, btnVariant: s, btnSize: l, btnRender: d = (m, h) => g($, { ...m, data: h }, m.uuid || Le()), widgetContainerProps: p = {}, children: u, data: f }) => { +}, labelVariant: r = "link", labelSize: a, labelRender: o, btnVariant: s, btnSize: l, btnRender: d = (m, h) => g($, { ...m, data: h }, m.uuid || je()), widgetContainerProps: p = {}, children: u, data: f }) => { if (c.isEmpty(e)) return u; const [m, h] = H(() => (e || []).reduce((C, x) => { const T = t.indexOf(x.widgetType); @@ -838,28 +840,28 @@ const Kt = ({ options: e = [], triggerWeights: t = ["grid-layout-form", "grid-la const b = h.map((C) => d(Object.assign({ uuid: C.uuid, type: C.type, name: C.name, widget: C.widget, widgetType: C.widgetType, widgetProps: C.widgetProps, widgetData: C.widgetData, widgetSetting: C.widgetSetting, widgetContainerProps: C.widgetContainerSetting, confirm: C.confirm, onAfterClick: c.partialRight(i, C, f), onBeforeClick: c.partialRight(n, C, f) }, { size: l, variant: s }), f)); return g(Tt, { 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({}, p, m == null ? void 0 : m.widgetContainerProps), data: f, widgetData: m == null ? void 0 : m.widgetData, extras: b, onAfterClick: c.partialRight(i, m, f), onBeforeClick: c.partialRight(n, m, f), children: u }); }; -Kt.propTypes = { triggerWeights: w.array, options: w.arrayOf(w.shape({ ...$.propTypes, widgetType: $.propTypes.widgetType.isRequired })), btnSize: $.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: $.propTypes.size, onAfterClick: w.func, onBeforeClick: w.func, widgetContainerProps: $.propTypes.widgetContainerProps, data: $.propTypes.data }, $.Link = On, $.Link.defaultProps = $.defaultProps, $.Link.propTypes = $.propTypes, $.Circle = Ln, $.Circle.defaultProps = $.defaultProps, $.Circle.propTypes = $.propTypes, $.Round = An, $.Round.defaultProps = $.defaultProps, $.Round.propTypes = $.propTypes, $.Dashed = jn, $.Dashed.defaultProps = $.defaultProps, $.Dashed.propTypes = $.propTypes, $.Popover = Tt, $.GroupPopover = Kt; -const In = ({ fields: e, formProps: t, $close: i }) => { - const [n] = ee.useForm(), r = H(() => [{ name: "__PROPS__", value: t }], [t]); - return g(G, { actions: A(k.Fragment, { children: [g($, { name: "取消", widget: () => i(!1) }), g($, { name: "确定", type: "primary", widget: () => n.validateFields(!0).then(i) })] }), children: g(ee, { fields: r, form: n, className: "ff-modal-form", children: e == null ? void 0 : e.map(({ code: a, ...o }) => g(hi, { code: a, ...o }, a)) }) }); -}, Mn = ({ className: e, $close: t, children: i, title: n, subTitle: r, actions: a, extras: o, zIndex: s, ...l }) => A(Ji, { ...l, prefixCls: "ff-drawer", className: z("ff-popup", e), maskMotion: { motionAppear: !0, motionName: "mask-motion" }, motion: (d) => ({ motionAppear: !0, motionName: `panel-motion-${d}` }), children: [A("div", { className: "ff-popup-header", children: [g("button", { "aria-label": "Close", className: "ff-popup-close", onClick: l.onClose, children: g(vt, { type: "close" }) }), n, r] }), g("div", { className: "ff-popup-body", children: i }), A("div", { className: "ff-popup-footer", children: [o, a] })] }), zn = ({ className: e, $close: t, $event: i, children: n, title: r, subTitle: a, actions: o, extras: s, zIndex: l, placement: d, ...p }) => { +Kt.propTypes = { triggerWeights: w.array, options: w.arrayOf(w.shape({ ...$.propTypes, widgetType: $.propTypes.widgetType.isRequired })), btnSize: $.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: $.propTypes.size, onAfterClick: w.func, onBeforeClick: w.func, widgetContainerProps: $.propTypes.widgetContainerProps, data: $.propTypes.data }, $.Link = Ln, $.Link.defaultProps = $.defaultProps, $.Link.propTypes = $.propTypes, $.Circle = jn, $.Circle.defaultProps = $.defaultProps, $.Circle.propTypes = $.propTypes, $.Round = An, $.Round.defaultProps = $.defaultProps, $.Round.propTypes = $.propTypes, $.Dashed = Vn, $.Dashed.defaultProps = $.defaultProps, $.Dashed.propTypes = $.propTypes, $.Popover = Tt, $.GroupPopover = Kt; +const Mn = ({ fields: e, formProps: t, $close: i }) => { + const [n] = te.useForm(), r = H(() => [{ name: "__PROPS__", value: t }], [t]); + return g(G, { actions: j(k.Fragment, { children: [g($, { name: "取消", widget: () => i(!1) }), g($, { name: "确定", type: "primary", widget: () => n.validateFields(!0).then(i) })] }), children: g(te, { fields: r, form: n, className: "ff-modal-form", children: e == null ? void 0 : e.map(({ code: a, ...o }) => g(hi, { code: a, ...o }, a)) }) }); +}, zn = ({ className: e, $close: t, children: i, title: n, subTitle: r, actions: a, extras: o, zIndex: s, ...l }) => j(_i, { ...l, prefixCls: "ff-drawer", className: z("ff-popup", e), maskMotion: { motionAppear: !0, motionName: "mask-motion" }, motion: (d) => ({ motionAppear: !0, motionName: `panel-motion-${d}` }), children: [j("div", { className: "ff-popup-header", children: [g("button", { "aria-label": "Close", className: "ff-popup-close", onClick: l.onClose, children: g(vt, { type: "close" }) }), n, r] }), g("div", { className: "ff-popup-body", children: i }), j("div", { className: "ff-popup-footer", children: [o, a] })] }), Bn = ({ className: e, $close: t, $event: i, children: n, title: r, subTitle: a, actions: o, extras: s, zIndex: l, placement: d, ...p }) => { const u = (i == null ? void 0 : i.pageX) === void 0 ? { animation: null, maskAnimation: null, mousePosition: { x: null, y: null } } : { animation: "zoom", maskAnimation: "fade", mousePosition: { x: i == null ? void 0 : i.pageX, y: i == null ? void 0 : i.pageY } }; - return g(_i, { ...p, ...u, prefixCls: "ff-modal", modalRender: () => A("div", { className: z("ff-modal-content ff-popup", e), children: [A("div", { className: "ff-popup-header", children: [g("button", { "aria-label": "Close", className: "ff-popup-close", onClick: p.onClose, children: g(vt, { type: "close" }) }), r, a] }), g("div", { className: "ff-popup-body", children: n }), A("div", { className: "ff-popup-footer", children: [s, o] })] }) }); + return g(Gi, { ...p, ...u, prefixCls: "ff-modal", modalRender: () => j("div", { className: z("ff-modal-content ff-popup", e), children: [j("div", { className: "ff-popup-header", children: [g("button", { "aria-label": "Close", className: "ff-popup-close", onClick: p.onClose, children: g(vt, { type: "close" }) }), r, a] }), g("div", { className: "ff-popup-body", children: n }), j("div", { className: "ff-popup-footer", children: [s, o] })] }) }); }, wi = ({ placement: e, $close: t, $event: i, children: n, title: r, ...a }) => { const [o, s] = F({}), [l, d] = F(!0), p = Y((h, b) => s((C) => ({ ...C, [h]: b })), []), u = Y((h) => s((b) => ({ ...b, [h]: void 0 })), []); let f = { ...a, className: o.rootClassName, title: o.title || r && k.createElement("div", { className: z("ff-popup-title") }, r), subTitle: o["sub-title"], actions: o.actions, extras: o.extras, children: n, $close: t, $event: i, onClose: () => d(!1) }; const m = () => { t(!1); }; - return g(qe.Provider, { value: { ele: o, mount: p, unmount: u }, children: e && e !== "center" ? g(Mn, { ...f, placement: e, open: l, afterOpenChange: (h) => !h && m() }) : g(zn, { ...f, visible: l, afterClose: m }) }); + return g(Ue.Provider, { value: { ele: o, mount: p, unmount: u }, children: e && e !== "center" ? g(zn, { ...f, placement: e, open: l, afterOpenChange: (h) => !h && m() }) : g(Bn, { ...f, visible: l, afterClose: m }) }); }; wi.propTypes = { placement: w.oneOf(["center", "left", "top", "right", "bottom"]) }; const J = () => { - const [e, t] = Bi({ maxCount: 6, motion: { motionName: "ff-notification-fade", motionAppear: !0, motionEnter: !0, motionLeave: !0, onLeaveStart: (a) => { + const [e, t] = Di({ maxCount: 6, motion: { motionName: "ff-notification-fade", motionAppear: !0, motionEnter: !0, motionLeave: !0, onLeaveStart: (a) => { const { offsetHeight: o } = a; return { height: o }; }, onLeaveActive: () => ({ height: 0, opacity: 0, margin: 0 }) }, prefixCls: "ff-notification" }), [, i] = k.useReducer((a) => a + 1, 0); - j(() => { + A(() => { J.$onClick = n, J.$queue.forEach(([a, o, s], l, d) => { r([o, s], ...a), delete d[l]; }); @@ -867,43 +869,43 @@ const J = () => { const n = (a, o = {}, s = {}) => new Promise((l, d) => r([l, d], a, o, s)), r = ([a, o], s, l = {}, d = {}) => { const p = J.$index++, u = (f) => ((m, h) => (J.$popups.delete(m), i(), h == null ? void 0 : h()))(p, () => a(f)); if (s === ei) return e.open({ ...d, key: p, content: k.createElement(s, { ...l, $close: () => e.close(p) }) }); - J.$popups.set(p, k.createElement(wi, { zIndex: p, maskClosable: !1, $event: l == null ? void 0 : l.$event, ...d, key: p, $close: u }, k.isValidElement(s) ? k.cloneElement(s, { ...l, $close: u }) : s != null && s.name || jt.isForwardRef(s) || (s == null ? void 0 : s.$$typeof) === jt.ForwardRef ? k.createElement(s, { ...l, $close: u }) : s)), i(); + J.$popups.set(p, k.createElement(wi, { zIndex: p, maskClosable: !1, $event: l == null ? void 0 : l.$event, ...d, key: p, $close: u }, k.isValidElement(s) ? k.cloneElement(s, { ...l, $close: u }) : s != null && s.name || At.isForwardRef(s) || (s == null ? void 0 : s.$$typeof) === At.ForwardRef ? k.createElement(s, { ...l, $close: u }) : s)), i(); }; - return A(k.Fragment, { children: [Array.from(J.$popups).map(([a, o]) => o), t] }); + return j(k.Fragment, { children: [Array.from(J.$popups).map(([a, o]) => o), t] }); }; J.$popups = /* @__PURE__ */ new Map(), J.$index = 0, J.$queue = [], J.$onClick = (...e) => new Promise((t, i) => { J.$queue.push([e, t, i]); }); -const Jt = (e, t, i = {}) => J.$onClick(e, t, i), ut = (e, { showProgress: t, duration: i, ...n } = { duration: 1.5 }) => J.$onClick(ei, { content: e, ...n }, { showProgress: t, duration: i }), _ = { modal: Jt, confirm: (e, t = {}) => J.$onClick(Gi, { content: e, ...t }, { placement: "center" }), form: (e, t = {}, i = {}) => Jt(In, { formProps: i, fields: e }, { placement: "center", ...t }).then((n) => { +const Jt = (e, t, i = {}) => J.$onClick(e, t, i), ut = (e, { showProgress: t, duration: i, ...n } = { duration: 1.5 }) => J.$onClick(ei, { content: e, ...n }, { showProgress: t, duration: i }), _ = { modal: Jt, confirm: (e, t = {}) => J.$onClick(Yi, { content: e, ...t }, { placement: "center" }), form: (e, t = {}, i = {}) => Jt(Mn, { formProps: i, fields: e }, { placement: "center", ...t }).then((n) => { if (n === !1) throw !1; return n; }), notification: ut, success: (e, t = { duration: 1.5 }) => ut(e, { ...t, className: "ff-notification-success", icon: "check" }), error: (e, t = { duration: 1.5 }) => ut(e, { ...t, className: "ff-notification-error", icon: "close" }) }; -Re.configure({ showSpinner: !1 }), Oe.interceptors.request.use((e) => { +Oe.configure({ showSpinner: !1 }), Le.interceptors.request.use((e) => { e.headers.Platform = "web", e.headers.SaaS = window.localStorage.getItem("SaaS"); const t = window.localStorage.getItem(Xe); - return e.headers.Authorization = t ? `Bearer ${t} ` : void 0, Re.inc(), e; -}, (e) => (Re.done(), Promise.reject({ code: -1, msg: e }))), Oe.interceptors.response.use(({ data: e, headers: t }) => (Re.done(), { ...e, res: t == null ? void 0 : t.res }), function(e) { - return Re.done(), Promise.reject(e.message); -}), window.addEventListener("unhandledrejection", pt.onUnhandledRejection), pt.onMsg = (e, t) => _[[0, 1].includes(e) ? "success" : "error"](t).then(() => e === 20300 && be.redirect(Ae.get("Common.WEBSITE_LOGIN_PAGE"))); + return e.headers.Authorization = t ? `Bearer ${t} ` : void 0, Oe.inc(), e; +}, (e) => (Oe.done(), Promise.reject({ code: -1, msg: e }))), Le.interceptors.response.use(({ data: e, headers: t }) => (Oe.done(), { ...e, res: t == null ? void 0 : t.res }), function(e) { + return Oe.done(), Promise.reject(e.message); +}), window.addEventListener("unhandledrejection", pt.onUnhandledRejection), pt.onMsg = (e, t) => _[[0, 1].includes(e) ? "success" : "error"](t).then(() => e === 20300 && Ce.redirect(Ae.get("Common.WEBSITE_LOGIN_PAGE"))); const xt = { appUrl: "", init: (e, t, i) => { - xt.appUrl = i, Oe.defaults.baseURL = i, Oe.defaults.timeout = 15e3, Object.assign(xt, new pt(e, t, Oe)); + xt.appUrl = i, Le.defaults.baseURL = i, Le.defaults.timeout = 15e3, Object.assign(xt, new pt(e, t, Le)); } }, L = xt; class Nt extends Error { constructor(t, i) { - super(i), Error.captureStackTrace && Error.captureStackTrace(this, Nt), !i instanceof je && (this.name = `${t} Error Runtime`); + super(i), Error.captureStackTrace && Error.captureStackTrace(this, Nt), !i instanceof Ve && (this.name = `${t} Error Runtime`); } } -class je extends Error { +class Ve extends Error { constructor(t, ...i) { - super(...i), Error.captureStackTrace && Error.captureStackTrace(this, je), this.name = `${t} Not Found`; + super(...i), Error.captureStackTrace && Error.captureStackTrace(this, Ve), this.name = `${t} Not Found`; } } const gt = "mine", Xe = "token"; -var we, Ee; -const se = class se { +var be, Re; +const oe = class oe { constructor() { - R(this, Ee, /* @__PURE__ */ new Map()); - v(this, "setVendor", (t, i) => y(this, Ee).set(t, new Qt(i, async (n, r) => { + R(this, Re, /* @__PURE__ */ new Map()); + v(this, "setVendor", (t, i) => y(this, Re).set(t, new Qt(i, async (n, r) => { var o, s; if (!(n != null && n.default)) throw "@pkg not found"; let a = () => r; @@ -912,15 +914,15 @@ const se = class se { case typeof (a = (s = n.default) == null ? void 0 : s[`./${r}/index.js`]): return a(); } - throw new je(r); + throw new Ve(r); }))); v(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 [, i] = t == null ? void 0 : t.split("@pkg/"); - if (!i) throw new je(t); + if (!i) throw new Ve(t); try { - return y(this, Ee).has("pkg") ? await y(this, Ee).get("pkg").get(i) : await import(`${L.appUrl}/api/pkg-import/web?name=${t}`); + return y(this, Re).has("pkg") ? await y(this, Re).get("pkg").get(i) : await import(`${L.appUrl}/api/pkg-import/web?name=${t}`); } catch (n) { throw new Nt(t, n); } @@ -958,100 +960,100 @@ const se = class se { } return Promise.resolve(null); }); - v(this, "login", (t, i, n = {}) => L.post("/api/user-token", { username: t, passwd: Di.hash(i), platform: "web", ...n }).then(({ token: r }) => (window.localStorage.setItem(Xe, r), r))); + v(this, "login", (t, i, n = {}) => L.post("/api/user-token", { username: t, passwd: qi.hash(i), platform: "web", ...n }).then(({ token: r }) => (window.localStorage.setItem(Xe, r), r))); v(this, "logout", (t) => (window.localStorage.removeItem(gt), window.localStorage.removeItem(Xe), t == null ? void 0 : t())); - if (y(se, we)) return y(se, we); + if (y(oe, be)) return y(oe, be); } }; -we = new WeakMap(), Ee = new WeakMap(), R(se, we, null), v(se, "getInstance", () => (y(se, we) || W(se, we, new se()), y(se, we))); -let St = se; -const oe = St.getInstance(), Bn = k.createContext({ user: {}, initUser: () => { -}, initUserComplete: !1 }), Dn = k.createContext({ set: () => { +be = new WeakMap(), Re = new WeakMap(), R(oe, be, null), v(oe, "getInstance", () => (y(oe, be) || W(oe, be, new oe()), y(oe, be))); +let St = oe; +const le = St.getInstance(), Dn = k.createContext({ user: {}, initUser: () => { +}, initUserComplete: !1 }), qn = k.createContext({ set: () => { }, get: () => { }, assign: () => { }, currentRoute: () => { -} }), Ft = (e) => !!(e != null && e.name) && (e.prototype instanceof k.Component || /^[A-Z]/.test(e.name)), qn = (e, t) => { +} }), Ft = (e) => !!(e != null && e.name) && (e.prototype instanceof k.Component || /^[A-Z]/.test(e.name)), Un = (e, t) => { if (!e || typeof window > "u") return; let i = document.querySelector(`style[ff-style-token="${t}"]`); return i ? (i.innerHTML = e, e) : (i = document.createElement("style"), i.setAttribute("ff-style-token", t), i.setAttribute("type", "text/css"), i.innerHTML = e, document.head.appendChild(i), e); -}, Un = Object.freeze(Object.defineProperty({ __proto__: null, AppContext: Bn, AppGlobalParamsContext: Dn, cache: Qt, configure: Ae, default: oe, func: Ce, http: L, insertStyle: qn, isReactComponent: Ft, route: be }, Symbol.toStringTag, { value: "Module" })); +}, Wn = Object.freeze(Object.defineProperty({ __proto__: null, AppContext: Dn, AppGlobalParamsContext: qn, cache: Qt, configure: Ae, default: le, func: ke, http: L, insertStyle: Un, isReactComponent: Ft, route: Ce }, Symbol.toStringTag, { value: "Module" })); export { mi as $, - tn as A, - rn as B, - Qi as C, + nn as A, + an as B, + Zi as C, Ze as D, - pr as E, - mr as F, - fr as G, - un as H, + mr as E, + hr as F, + yr as G, + gn as H, ai as I, ft as J, - Zi as K, - en as L, + en as K, + tn as L, at as M, - yr as N, - wr as O, - We as P, + wr as N, + br as O, + He as P, st as Q, ci as R, - br as S, - Cr as T, - $n as U, + Cr as S, + kr as T, + Tn as U, $t as V, hi as W, fi as X, - Cn as Y, - kn as Z, - xn as _, + kn as Y, + xn as Z, + Sn as _, ti as a, - Sn as a0, - kr as a1, + vn as a0, + xr as a1, kt as a2, $ as a3, - Yi as a4, - Rn as a5, + Xi as a4, + On as a5, G as a6, - qe as a7, + Ue as a7, Zt as a8, J as a9, _ as aa, - sr as ab, - or as ac, - lr as ad, - oe as ae, + or as ab, + lr as ac, + cr as ad, + le as ae, Ft as af, - qn as ag, + Un as ag, L as ah, Qt as ai, Ae as aj, - Ce as ak, - be as al, - Bn as am, - Dn as an, - Ue as b, - dr as c, + ke as ak, + Ce as al, + Dn as am, + qn as an, + We as b, + ur as c, ii as d, - ur as e, - gr as f, - Xi as g, + gr as e, + pr as f, + Qi as g, si as h, - hr as i, + fr as i, di as j, gi as k, - pn as l, - gn as m, + mn as l, + pn as m, ui as n, li as o, oi as p, - cn as q, + dn as q, dt as r, - ln as s, - Z as t, - cr as u, - sn as v, + cn as s, + ee as t, + dr as u, + on as v, Pt as w, - te as x, - dn as y, - hn as z + ie as x, + un as y, + fn as z }; diff --git a/dist/components.js b/dist/components.js index a4bfaf1..97f8c0c 100644 --- a/dist/components.js +++ b/dist/components.js @@ -1,4 +1,4 @@ -import { ab as s, a2 as p, ac as d, ad as n, aa as t } from "./common/main-BpRlLf9Z.js"; +import { ab as s, a2 as p, ac as d, ad as n, aa as t } from "./common/main-ZEPPjpKL.js"; export { s as Empty, p as Icon, diff --git a/dist/container.js b/dist/container.js index d434d9f..cc2f798 100644 --- a/dist/container.js +++ b/dist/container.js @@ -1,4 +1,4 @@ -import { a7 as o, ab as s, ac as d, ad as p, a8 as t, aa as n, a9 as r, a6 as u } from "./common/main-BpRlLf9Z.js"; +import { a7 as o, ab as s, ac as d, ad as p, a8 as t, aa as n, a9 as r, a6 as u } from "./common/main-ZEPPjpKL.js"; export { o as Context, s as Empty, diff --git a/dist/data-converter.js b/dist/data-converter.js index 46f937d..b29c8bd 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-BpRlLf9Z.js"; +import { D as p } from "./common/main-ZEPPjpKL.js"; export { p as default }; diff --git a/dist/data-list.js b/dist/data-list.js index 374a63b..60ae6ea 100644 --- a/dist/data-list.js +++ b/dist/data-list.js @@ -1,4 +1,4 @@ -import { z as t, x as e, p as r, v as o, A as i, w as u, s as D, y as l, q as L, B as n, o as p, C as m, L as C, F as c, J as F, I as b, K as d, E as k } from "./common/main-BpRlLf9Z.js"; +import { z as t, x as e, p as r, v as o, A as i, w as u, s as D, y as l, q as L, B as n, o as p, C as m, L as C, F as c, J as F, I as b, K as d, E as k } from "./common/main-ZEPPjpKL.js"; export { t as DataListContent, e as DataListContext, diff --git a/dist/data-list/utils.js b/dist/data-list/utils.js index 4704d27..90b51ed 100644 --- a/dist/data-list/utils.js +++ b/dist/data-list/utils.js @@ -1,5 +1,5 @@ import "lodash"; -import { j as a } from "../common/main-BpRlLf9Z.js"; +import { j as a } from "../common/main-ZEPPjpKL.js"; export { a as getDefaultExpandRowKeys }; diff --git a/dist/grid-layout-form.js b/dist/grid-layout-form.js index d9f2fda..53ab39c 100644 --- a/dist/grid-layout-form.js +++ b/dist/grid-layout-form.js @@ -1,4 +1,4 @@ -import { V as s, X as r, W as u, U as o, $ as t, _ as d, a1 as m, Z as F, Y as i, a0 as g } from "./common/main-BpRlLf9Z.js"; +import { V as s, X as r, W as u, U as o, $ as t, _ as d, a1 as m, Z as F, Y as i, a0 as g } from "./common/main-ZEPPjpKL.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 20e3140..17742bc 100644 --- a/dist/grid-layout-form/utils.js +++ b/dist/grid-layout-form/utils.js @@ -1,5 +1,5 @@ import "lodash"; -import { g as o, a as g } from "../common/main-BpRlLf9Z.js"; +import { g as o, a as g } from "../common/main-ZEPPjpKL.js"; export { o as getOptionItemByValue, g as getWidgetByNormalize diff --git a/dist/grid-layout.js b/dist/grid-layout.js index 9211fbe..a551555 100644 --- a/dist/grid-layout.js +++ b/dist/grid-layout.js @@ -1,4 +1,4 @@ -import { k as d, l as e, H as i, G as t, m as u, n as o } from "./common/main-BpRlLf9Z.js"; +import { k as d, l as e, H as i, G as t, m as u, n as o } from "./common/main-ZEPPjpKL.js"; export { d as GridLayout, e as GridLayoutWidget, diff --git a/dist/grid-layout/utils.js b/dist/grid-layout/utils.js index b454b76..762d4b9 100644 --- a/dist/grid-layout/utils.js +++ b/dist/grid-layout/utils.js @@ -1,4 +1,4 @@ -import { h as o, i as a } from "../common/main-BpRlLf9Z.js"; +import { h as o, i as a } from "../common/main-ZEPPjpKL.js"; export { o as getBoxStyle, a as getWidgetByNormalize diff --git a/dist/hooks.js b/dist/hooks.js index ad4b939..b442dfc 100644 --- a/dist/hooks.js +++ b/dist/hooks.js @@ -1,7 +1,7 @@ import "lodash"; import "rc-field-form"; import "react"; -import { Q as r, P as o, S as p, N as f, O as i, T as m, M as c } from "./common/main-BpRlLf9Z.js"; +import { Q as r, P as o, S as p, N as f, O as i, T as m, M as c } from "./common/main-ZEPPjpKL.js"; import { default as S } from "rc-util/lib/hooks/useMergedState"; export { r as useDeepEffect, diff --git a/dist/iconfont.js b/dist/iconfont.js index 898f5e3..3dda402 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 { a2 as a } from "./common/main-BpRlLf9Z.js"; +import { a2 as a } from "./common/main-ZEPPjpKL.js"; export { a as default }; diff --git a/dist/index.js b/dist/index.js index 2ab8893..bcb81ae 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1,4 +1,4 @@ -import { am as t, an as e, ai as o, aj as n, ae as p, ak as r, ah as c, ag as f, af as l, al as i } from "./common/main-BpRlLf9Z.js"; +import { am as t, an as e, ai as o, aj as n, ae as p, ak as r, ah as c, ag as f, af as l, al as i } from "./common/main-ZEPPjpKL.js"; export { t as AppContext, e as AppGlobalParamsContext, diff --git a/dist/res-ws.js b/dist/res-ws.js index 195809d..825cd9d 100644 --- a/dist/res-ws.js +++ b/dist/res-ws.js @@ -1,5 +1,5 @@ import "lodash"; -import { R as a } from "./common/main-BpRlLf9Z.js"; +import { R as a } from "./common/main-ZEPPjpKL.js"; export { a as default }; diff --git a/dist/utils.js b/dist/utils.js index 12e8d3e..a7e48c0 100644 --- a/dist/utils.js +++ b/dist/utils.js @@ -1,5 +1,5 @@ import "lodash"; -import { d as s, e as g, c as r, f as o, b as i, r as m, t as p, u as P } from "./common/main-BpRlLf9Z.js"; +import { d as s, e as g, c as r, f as o, b as i, r as m, t as p, u as P } from "./common/main-ZEPPjpKL.js"; export { s as deepSome, g as getPkgCategory, diff --git a/package.json b/package.json index 863122d..b69cbab 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "ff", "private": true, - "version": "0.4.70", + "version": "0.4.71", "author": "www.fsdpf.com", "type": "module", "main": "./dist/index.js",