From 53ccb1415188f304658c10321900676d3c339e89 Mon Sep 17 00:00:00 2001 From: what Date: Sun, 28 Sep 2025 14:49:17 +0800 Subject: [PATCH] v0.5.15 --- dist/button.js | 2 +- dist/common/main-BgoRXiKU.js | 1073 ------------------------------- dist/common/main-DdIS_WOJ.js | 1079 ++++++++++++++++++++++++++++++++ dist/components.js | 2 +- dist/container.js | 2 +- dist/data-converter.js | 2 +- dist/data-list.js | 2 +- dist/data-list/utils.js | 2 +- dist/grid-layout-form.js | 13 +- dist/grid-layout-form/utils.js | 2 +- dist/grid-layout.js | 2 +- dist/grid-layout/utils.js | 2 +- dist/hooks.js | 2 +- dist/iconfont.js | 2 +- dist/index.js | 2 +- dist/pages.js | 2 +- dist/res-ws.js | 2 +- dist/utils.js | 2 +- package.json | 2 +- 19 files changed, 1102 insertions(+), 1095 deletions(-) delete mode 100644 dist/common/main-BgoRXiKU.js create mode 100644 dist/common/main-DdIS_WOJ.js diff --git a/dist/button.js b/dist/button.js index 17fc0c0..ba51d52 100644 --- a/dist/button.js +++ b/dist/button.js @@ -1,4 +1,4 @@ -import { a9 as s, a8 as u, aa as e } from "./common/main-BgoRXiKU.js"; +import { aa as s, a9 as u, ab as e } from "./common/main-DdIS_WOJ.js"; export { s as auth, u as default, diff --git a/dist/common/main-BgoRXiKU.js b/dist/common/main-BgoRXiKU.js deleted file mode 100644 index 026aefd..0000000 --- a/dist/common/main-BgoRXiKU.js +++ /dev/null @@ -1,1073 +0,0 @@ -var Oi = Object.defineProperty; -var At = (e) => { - throw TypeError(e); -}; -var Ei = (e, t, i) => t in e ? Oi(e, t, { enumerable: !0, configurable: !0, writable: !0, value: i }) : e[t] = i; -var P = (e, t, i) => Ei(e, typeof t != "symbol" ? t + "" : t, i), Lt = (e, t, i) => t.has(e) || At("Cannot " + i); -var y = (e, t, i) => (Lt(e, t, "read from private field"), i ? i.call(e) : t.get(e)), E = (e, t, i) => t.has(e) ? At("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, i), U = (e, t, i, n) => (Lt(e, t, "write to private field"), n ? n.call(e, i) : t.set(e, i), i); -var Vt = (e, t, i, n) => ({ - set _(r) { - U(e, t, r, i); - }, - get _() { - return y(e, t, n); - } -}); -import { jsx as g, jsxs as j } from "react/jsx-runtime"; -import x, { useEffect as L, useState as O, useCallback as X, useMemo as H, useRef as W, useContext as ce, useId as mt, isValidElement as ji, useLayoutEffect as Ai } from "react"; -import w from "prop-types"; -import I from "classnames"; -import * as It from "react-is"; -import { useNotification as Li } from "rc-notification"; -import d from "lodash"; -import te, { FieldContext as Yt, Field as Xt } from "rc-field-form"; -import { M as dt, N as Le, a as Ve, P as ft, S as Vi } from "./vender-CtjyT19B.js"; -import Qt from "immutability-helper"; -import { Form as Xe, Input as Ii, Button as Ze, Pagination as Mi, Tree as zi, Breadcrumb as Bi, Table as Di, Empty as qi, Popover as Wi, Popconfirm as Ui, Tooltip as Hi } from "antd"; -import { useMergedState as Ji } from "rc-util"; -import { generatePath as Ki, useInRouterContext as Zt, useParams as _i, useLocation as Gi, createBrowserRouter as Yi, Navigate as Xi } from "react-router-dom"; -import "rc-util/lib/hooks/useMergedState"; -import Qi from "rc-drawer"; -import Zi from "rc-dialog"; -var Fe, ze, Oe, ue, Se, Pe; -class ei { - constructor(t, i) { - E(this, Fe, /* @__PURE__ */ new Map()); - E(this, ze, !0); - E(this, Oe, []); - E(this, ue); - E(this, Se, () => y(this, ue)); - E(this, Pe, () => Promise.resolve()); - P(this, "get", (...t) => new Promise((i, n) => { - const r = JSON.stringify(t); - if (y(this, Fe).has(r)) return i(y(this, Pe).call(this, y(this, ue), ...t)); - if (y(this, ue) === void 0) y(this, Oe).push([t, i, n]), y(this, ze) && (U(this, ze, !1), Promise.resolve(typeof y(this, Se) == "function" ? y(this, Se).call(this) : y(this, Se)).then((a) => U(this, ue, a || null)).finally(() => { - y(this, Oe).forEach(([a, o, s]) => { - try { - const l = y(this, Pe).call(this, y(this, ue), ...a); - y(this, Fe).set(JSON.stringify(a), l), o(l); - } catch (l) { - s(l); - } - }), y(this, Oe).length = 0; - })); - else { - const a = y(this, Pe).call(this, y(this, ue), ...t); - y(this, Fe).set(r, a), i(a); - } - })); - U(this, Pe, i), U(this, Se, t); - } -} -Fe = new WeakMap(), ze = new WeakMap(), Oe = new WeakMap(), ue = new WeakMap(), Se = new WeakMap(), Pe = new WeakMap(); -const ur = () => g("div", { children: "Empty" }), He = x.createContext({ ele: {}, mount: () => { -}, unmount: () => { -} }), Y = ({ rootClassName: e, className: t, children: i, actions: n, title: r, subTitle: a, extras: o, style: s = {} }) => { - const { mount: l, unmount: u } = x.useContext(He); - return Y.Action({ children: n }), Y.Title({ children: r }), Y.SubTitle({ children: a }), Y.Extra({ children: o }), L(() => (l("rootClassName", e), () => u(e)), [e]), g("div", { className: I("ff-container", t), style: s, children: i }); -}, Ye = (e) => ({ children: t, className: i }) => { - const { mount: n, unmount: r } = x.useContext(He); - return L(() => (t && n(e, x.createElement("div", { key: `ff-${e}`, className: I(`ff-popup-${e}`, i) }, t)), () => r(e)), [i, t]), null; -}; -Y.Action = Ye("actions"), Y.Title = Ye("title"), Y.SubTitle = Ye("sub-title"), Y.Extra = Ye("extras"), Y.propTypes = { className: w.string, style: w.object, title: w.any, subTitle: w.any, actions: w.any, extras: w.any }; -const gr = () => g(Y, { 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", {})] })] }) }), pr = () => g("div", { children: "NotFound" }), ti = ({ children: e }) => { - const [t, i] = O({}), n = X((a, o) => i((s) => ({ ...s, [a]: o })), []), r = X((a) => i((o) => ({ ...o, [a]: void 0 })), []); - return typeof (e == null ? void 0 : e.type) == "string" ? e : g(He.Provider, { value: { ele: t, mount: n, unmount: r }, children: x.cloneElement(e, { className: t.rootClassName, title: t.title, subTitle: t["sub-title"], actions: t.actions, extras: t.extras }) }); -}; -ti.propTypes = { children: w.element.isRequired }; -const Mt = { 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"] }, Tt = ({ type: e, props: t }) => g("i", { ...t, children: g("svg", { viewBox: "0 0 1024 1024", width: "1em", height: "1em", fill: "currentColor", children: (Mt[e] || Mt.info).map((i, n) => g("path", { d: i }, n)) }) }), ii = ({ className: e, content: t, icon: i, $close: n }) => j(x.Fragment, { children: [i && g("div", { className: I("ff-notification-icon", e), children: g(Tt, { type: i }) }), t] }), en = ({}) => g(Y, { children: "Confirm" }); -var pe, Ee; -const ne = class ne { - constructor() { - E(this, Ee, /* @__PURE__ */ new Map()); - P(this, "init", (t) => U(this, Ee, new Map(t))); - P(this, "check", (t) => !y(this, Ee).has(t) || y(this, Ee).get(t)); - if (y(ne, pe)) return y(ne, pe); - } -}; -pe = new WeakMap(), Ee = new WeakMap(), E(ne, pe, null), P(ne, "getInstance", () => (y(ne, pe) || U(ne, pe, new ne()), y(ne, pe))); -let ht = ne; -const tn = ht.getInstance(), nn = (e, t, i = "children") => { - if (d.isEmpty(e)) return {}; - const n = d.find(e, ["value", t]); - if (!d.isEmpty(n)) return n; - const r = e.length; - for (let a = 0; a < r; a++) { - const { [i]: o } = e[a], s = nn(o, t, i); - if (!d.isEmpty(s)) return s; - } - return {}; -}, ni = (e = "Input", t = "@pkg/ff/grid-layout-forms") => e != null && e.startsWith("@") || e != null && e.startsWith("blob:") ? e : `${t}/${e}`; -var me, Be; -const re = class re { - constructor() { - E(this, Be, null); - P(this, "init", (t) => U(this, Be, t)); - P(this, "get", (t, i) => d.get(y(this, Be), t, i)); - if (y(re, me)) return y(re, me); - } -}; -me = new WeakMap(), Be = new WeakMap(), E(re, me, null), P(re, "getInstance", () => (y(re, me) || U(re, me, new re()), y(re, me))); -let yt = re; -const Ie = yt.getInstance(), zt = { null2json: (e) => Object.create(), null2array: (e) => [], null2number: (e) => 0, null2bool: (e) => !1, null2string: (e) => "", null2integer: (e) => 0, null2float: (e) => 0, string2json: (e) => e ? JSON.parse(e) : "{}", string2array: (e) => e.substr(0, 1) === "[" && e.substr(-1) === "]" ? JSON.parse(e) : e.split(","), string2number: (e) => e == "" ? 0 : +e, string2integer: (e) => e == "" ? 0 : +e, string2float: (e) => e == "" ? 0 : +e, string2bool: (e) => { - switch (`${e}`.toLowerCase()) { - case "0": - case "false": - case "[]": - case "{}": - 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" }, ee = (e, t) => { - let i = "string"; - i = Array.isArray(e) ? "array" : typeof e, d.isObject(e) && (i = "json"); - const n = `${i}2${t}`; - return Reflect.has(zt, n) ? zt[n](e) : e; -}, Je = (e = {}, t = {}, i = {}, n = "") => ri(e, (r, a) => a === "type" && r === "code") ? ai(e, t, i, n) : si(e, t, n), ri = (e, t = () => !1) => d.some(e, (i) => !!d.some(i, t) || (d.isEmpty(i) || !d.isPlainObject(i) && !d.isArray(i) ? void 0 : ri(i, t))), ai = async (e = {}, t = {}, i = {}, n = "") => { - let r = /* @__PURE__ */ Object.create(null); - for (let a in e) { - let o; - if (Reflect.has(e[a], "type") && ["code", "field", "router", "query", "string"].includes(e[a].type)) { - const { type: s, value: l = "", default: u = n } = e[a]; - switch (s) { - case "code": - o = await xe.exec(l, t, i); - break; - case "field": - o = d.get(t, l) ?? d.get(t, l.substring(l.indexOf(".") + 1)); - break; - case "router": - case "query": - o = ke.getPageParams(l); - break; - case "string": - o = l; - } - o ?? (o = u); - } else o = await ai(e[a], t, i, n); - d.set(r, a, o); - } - return r; -}, si = (e = {}, t = {}, i = "") => Object.keys(e || {}).reduce((n, r) => { - if (d.isPlainObject(e[r])) { - let a; - if (Reflect.has(e[r], "type") && ["field", "router", "query", "string"].includes(e[r].type)) { - const { type: o, value: s = "", default: l = i } = e[r]; - switch (o) { - case "field": - a = d.get(t, s) ?? d.get(t, s.substring(s.indexOf(".") + 1)); - break; - case "router": - case "query": - a = ke.getPageParams(s); - break; - case "string": - a = s; - } - a ?? (a = l); - } else a = si(e[r], t, i); - d.set(n, r, a); - } - return n; -}, {}), ut = (e, t) => e && typeof e == "object" ? Array.isArray(e) ? e.map((i) => ut(i, t)) : Object.keys(e).reduce((i, n) => (t[n] ? i[t[n]] = ut(e[n], t) : i[n] = ut(e[n], t), i), {}) : e, mr = () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (e) => { - const t = 16 * Math.random() | 0; - return (e === "x" ? t : 3 & t | 8).toString(16); -}), fr = (e) => { - var t, i; - return e ? (i = (t = e.match(/^@pkg(?:[^\/]*\/){3}(?[^\/]+)/)) == null ? void 0 : t.groups) == null ? void 0 : i.name : ""; -}, hr = (e) => { - var t, i; - return e ? (i = (t = e.match(/^@pkg(?:[^\/]*\/){2}(?[^\/]+)/)) == null ? void 0 : t.groups) == null ? void 0 : i.category : ""; -}, yr = (e) => { - var t, i; - return e ? (i = (t = e.match(/^@pkg(?:[^\/]*\/){1}(?[^\/]+)/)) == null ? void 0 : t.groups) == null ? void 0 : i.owner : ""; -}, rn = (e, t = 32, i = "auto") => { - const n = wt(e), r = i === "auto" ? "x64" : i; - if (t === 32) return dt.x86.hash32(n).toString(); - if (t === 128) return r === "x64" ? dt.x64.hash128(n) : dt.x86.hash128(n); - throw new Error("bits 只能是 32 或 128"); -}, wt = (e) => e == null ? "null" : typeof e == "string" ? e : typeof e == "number" || typeof e == "boolean" ? String(e) : typeof e == "function" ? e.toString() : Array.isArray(e) ? "[" + e.map(wt).join(",") + "]" : typeof e == "object" ? "{" + Object.keys(e).sort().map((t) => `${t}:${wt(e[t])}`).join(",") + "}" : String(e); -var tt, De, qe, it; -const nt = class nt { - constructor(...t) { - E(this, De, []); - E(this, qe, (t) => { - var i; - for (let n of t) Array.isArray(n[0]) ? y(this, qe).call(this, n) : y(this, De).push(y(i = nt, tt).call(i, n[0], n[1])); - }); - P(this, "toValue", async (t, i = null) => { - const n = { getValue: () => t, getRecord: () => i }; - return await y(this, De).reduce(async (r, a) => { - try { - const o = await r; - return (await a).call(n, o); - } catch (o) { - return console.error(o), r; - } - }, t); - }); - P(this, "toRender", (t, i, n = null) => x.createElement(y(this, it), { value: t, record: i }, n)); - E(this, it, ({ value: t, record: i, children: n }) => { - const [r, a] = O(n); - return ot(() => { - let o = !1; - 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, qe).call(this, t); - } -}; -tt = new WeakMap(), De = new WeakMap(), qe = new WeakMap(), it = new WeakMap(), E(nt, tt, d.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}::${ee(i, "string")}`)); -let et = nt; -const an = (e, t = {}) => H(() => e == null ? void 0 : e.map(({ widgetByJs: i, widgetByJsSetting: n, ...r }, a) => i ? { ...r, render: (o, s) => new et([i, n]).toRender(o, s, "-") } : r), [e, t]), wr = (e) => { - const [t, i] = O({}); - return L(() => { - let n = !1; - return e && A.get(`/api/_/${e}`).then((r) => d.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; -}, br = (e, t = {}) => { - const [i, n] = O({ dataSource: [] }); - return Ke(() => { - let r = !1; - return e && A.get(`/api/${e}/${A.encode({ page: 1, ...t })}`).then((a) => !r && n(a)), () => r = !0; - }, [e, t]), i; -}, oi = (e = [], t = /* @__PURE__ */ new Map(), i = "id", n) => { - const r = X(n ? (a) => d.get(a, i, d.get(a, [n, i])) : (a) => d.get(a, i), [i, n]); - return X((a) => e == null ? void 0 : e.filter((o) => !o.uuid || !t.has(o.uuid) || t.get(o.uuid).some((s) => s == r(a))), [e, t, r]); -}, bt = (e = [], t = /* @__PURE__ */ new Map(), i = [], n = "id", r) => { - const a = X(r ? (o) => d.get(o, n, d.get(o, [r, n])) : (o) => d.get(o, n), [n, r]); - return H(() => { - if (d.isEmpty(e) || !e.some(({ uuid: s }) => tn.check(s))) return !1; - if (d.isEmpty(t) || d.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((u) => u == l))); - }, [e, i, t, a]); -}, sn = (e, t, i = "id", n = null) => { - const r = st(), a = W(!1), o = W(e.dataSource), s = W(e.itemOperationsAccess); - return L(() => (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, u = null) => { - var c, p; - if (a.current = !1, l === 1) return (c = e.onReload) == null ? void 0 : c.call(e); - if (l === 2) { - const h = d.get(u, "__PARENT_ID__", ""), m = d.get(u, i, d.get(u, [n, i], "")), f = d.findIndex(o.current, ["__PARENT_ID__", h]), b = d.findIndex(f > -1 ? d.get(o.current, [f, "children"]) : o.current, [i, m]); - if (b === -1) return (p = e.onReload) == null ? void 0 : p.call(e); - Promise.all([A.get(`/api/${t}/detail/${m}`), A.post(`/api/${t}/list-operations-access`, { ids: m })]).then(([C, k]) => { - const S = d.get(o.current, f > -1 ? [f, "children", b, "children"] : [b, "children"]); - o.current = Qt(o.current, f > -1 ? { [f]: { children: { $splice: [[b, 1, { ...C, children: S }]] } } } : { $splice: [[b, 1, { ...C, children: S }]] }); - const v = new Map(k); - s.current.forEach((N, V) => { - var q; - (q = v.get(V)) != null && q.some((B) => B == m) || s.current.set(V, N.filter((B) => B !== m)); - }), v.forEach((N, V) => { - s.current.has(V) ? s.current.set(V, d.uniq([...s.current.get(V) || [], ...N])) : s.current.set(V, N); - }); - }).then(() => { - a.current = !0, r(); - }); - } - }]; -}, on = (e, t) => { - const i = st(), n = W(t), r = W(/* @__PURE__ */ new Map()), a = W([]), o = d.throttle((l) => { - a.current = [], A.list(e, d.pick({ ...n.current, ...l }, ["tab", "page", "pageSize", "condition", "sider", "keyword"])).then(({ keyword: u, condition: c, total: p, tab: h, sider: m, page: f, pageSize: b, operationsAccess: C, dataSource: k }) => { - n.current = { tab: h, condition: c, sider: m, keyword: u, total: p, pageSize: b, page: k != null && k.length ? f : 1 }, a.current = k, r.current = new Map(C), i(); - }); - }, 380, { leading: !1, trailing: !0 }); - ot(() => { - a.current = [], e && o(t); - }, [e, t]); - const s = H(() => d.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, u) => o({ page: l, pageSize: u }), onPageSizeChange: (l) => o({ pageSize: l, page: 1 }), onConditionChange: (l, u) => o({ keyword: u, condition: Qt(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, payload: t == null ? void 0 : t.payload }); -}, ln = ({ listCode: e, className: t, layouts: i, dataSource: n, isPaginate: r, isItemOperations: a, isBatchOperations: o, batchOperations: s, itemOperations: l, itemOperationsAccess: u, resource: c, primaryKey: p, title: h, itemGridLayout: m, $setting: f, tabs: b, isConditionFormLayout: C, isTreeSider: k, treeSiderConfig: S }) => { - const { classNames: v, onClickCallback: N } = ce(ie), V = d.pick(f, ["column", "colWidth", "beforeRender", "afterRender", "style"]), q = oi(l, u, p, c), B = X((M, R, z) => g(cn, { className: I("ff-data-list-framework-item", v.item), operations: a ? q(R) : [], data: c ? { [c]: R } : R, children: M, onClickCallback: N }), [c, p, a, N, l, u]); - return j("div", { className: I("ff-data-list-framework", t), children: [g(i.sider, { isTreeSider: k, ...S }), j("div", { className: I("ff-data-list-container", v == null ? void 0 : v.container), children: [g(i.filter, { isConditionFormLayout: C }), g(i.toolbar, { title: h, tabs: b }), g(kn, { ...V, ...m, primaryKey: p, itemRender: B, dataSource: n }), g(i.footer, { isPaginate: r, isOperations: o, operations: s })] })] }); -}, cn = ({ className: e, operations: t, children: i, data: n, onClickCallback: r }) => j("div", { className: I("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 || mt()) }, (a == null ? void 0 : a.uuid) || mt())) })] }), dn = ({ listCode: e, className: t, layouts: i, dataSource: n, columns: r, isItemOperations: a, isBatchOperations: o, batchOperations: s, itemOperations: l, itemOperationsAccess: u, resource: c, primaryKey: p, title: h, tabs: m, isPaginate: f, isTreeSider: b, treeSiderConfig: C, isConditionFormLayout: k, ...S }) => { - const { classNames: v, onClickCallback: N } = ce(ie), V = oi(l, u, p, c), q = bt(l, u, n, p, c); - return j("div", { className: I("ff-data-table-framework", t), children: [g(i.sider, { isTreeSider: b, ...C }), j("div", { className: I("ff-data-table-container", v == null ? void 0 : v.container), children: [g(i.filter, { isConditionFormLayout: k }), g(i.toolbar, { title: h, tabs: m }), g(hn, { ...S, primaryKey: p, className: "ff-data-table-content", columns: r, dataSource: n, operationRender: q ? (B) => { - var M; - return g("div", { className: "ff-data-table-actions", children: (M = V(B)) == null ? void 0 : M.map((R, z) => g($.Link, { size: "small", uuid: R.uuid, type: R.type, name: R.name, widget: R.widget, widgetType: R.widgetType, widgetProps: R.widgetProps, widgetData: R.widgetData, widgetSetting: R.widgetSetting, widgetContainerProps: R.widgetContainerSetting, data: B, confirm: R.confirm, onAfterClick: (T) => T !== !1 && (N == null ? void 0 : N(R.isRefresh, B)) }, R.uuid || z)) }); - } : null }), g(i.footer, { isPaginate: f, isOperations: o, operations: s })] })] }); -}, ie = x.createContext({ listCode: "", classNames: {}, getBase62params: (e, t) => { -}, onReload: () => { -}, onClickCallback: () => { -}, onConditionChange: () => { -}, onTabChange: () => { -}, onSiderChange: () => { -}, onKeywordChange: () => { -}, onPageChange: () => { -}, onPageSizeChange: () => { -} }), li = (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"] = Bt(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"] = Bt(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; -}, Bt = (e, t, i, n) => `${e || 0}px ${t || 0}px ${i || 0}px ${n || 0}px`, Cr = (e = "Text", t = "@pkg/ff/grid-layouts") => e != null && e.startsWith("@") || e != null && e.startsWith("blob:") ? e : `${t}/${e}`, ci = ({ className: e, isConditionFormLayout: t }) => { - var h, m; - const [i, n] = O({}), { listCode: r, onKeywordChange: a, onConditionChange: o, getBase62params: s, classNames: l } = x.useContext(ie), { keyword: u, condition: c } = (s == null ? void 0 : s()) || {}, [p] = Xe.useForm(); - return L(() => { - r && t && A.get(`/api/_/${r}/list-condition-form-layout`).then(({ resource: f, marginX: b, marginY: C, rowHeight: k, cols: S, fields: v }) => { - n({ resource: f, itemMargin: [b, C], rowHeight: k, cols: S, fields: v }); - }).catch(() => n({})); - }, [r, t]), L(() => { - p.setFieldsValue({ keyword: u, ...c }); - }, [JSON.stringify([u, c])]), g("div", { className: I("ff-data-list-filter", l.filter, e), children: g(Xe, { form: p, layout: "vertical", autoComplete: "off", onFinish: ((h = i.fields) == null ? void 0 : h.length) > 1 ? (f) => o({ [i.resource]: f[i.resource] }, f.keyword) : () => { - }, onValuesChange: (f) => { - d.isEmpty(d.omit(f, ["keyword"])) || p.submit(); - }, children: ((m = i.fields) == null ? void 0 : m.length) > 1 ? g(Rt, { ...i, children: g(un, { onReset: () => { - const { keyword: f, condition: b } = s("init") || {}; - p.setFieldsValue({ keyword: f, ...b }); - } }) }) : g("div", { className: "ff-data-list-filter-default-form ff-grid-layout-form", children: g("div", { className: "grid-layout-item", style: li(20, 0, 5, 2), children: g(Xe.Item, { name: ["keyword"], children: g(Ii.Search, { allowClear: !0, enterButton: "搜索", placeholder: "多关键字 | 分割", onSearch: (f) => a(f) }) }) }) }) }) }); -}, un = ({ cols: e, fields: t, onReset: i }) => { - const [n, r] = O(!1), a = H(() => t == null ? void 0 : t.toReversed().some((o) => o.y > 1 || o.x + o.w >= e - 5), [e, t]); - return j(Xe.Item, { label: " ", style: { "--item-span": 5 }, className: I("ff-data-list-filter-actions", { expanded: n }), children: [g(Ze, { onClick: i, children: "重置" }), g(Ze, { 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" })] }); -}; -ci.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 gn = ({ className: e, operations: t, isOperations: i, isPaginate: n }) => { - const { onPageChange: r, onPageSizeChange: a, onClickCallback: o, getBase62params: s } = x.useContext(ie), { total: l, page: u, pageSize: c } = (s == null ? void 0 : s()) || {}; - return i && !d.isEmpty(t) || n ? j("div", { className: I("ff-data-list-footer", e), children: [g("div", { className: "ff-data-list-actions", children: t == null ? void 0 : t.map((p, h) => g($, { uuid: p.uuid, type: p.type, name: p.name, widget: p.widget, widgetType: p.widgetType, widgetProps: p.widgetProps, widgetData: p.widgetData, widgetSetting: p.widgetSetting, widgetContainerProps: p.widgetContainerSetting, onAfterClick: (m) => m !== !1 && (o == null ? void 0 : o(p.isRefresh, null)) }, p.uuid || h)) }), n && g(Mi, { size: "small", total: l, pageSize: c, showSizeChanger: !1, showTotal: (p) => `第 ${u} 页 / 总共 ${p} 条`, onChange: r, onShowSizeChange: a })] }) : null; -}, pn = [{ 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" }] }] }], mn = ({ className: e, width: t = 280, isTreeSider: i }) => { - const { classNames: n } = ce(ie); - return i ? g(zi.DirectoryTree, { className: I("ff-data-list-sider", n.sider, e), style: { "--sider-width": t }, showLine: !0, showIcon: !1, treeData: pn }) : null; -}, fn = ({ 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, u] = Ji((i == null ? void 0 : i[0].value) ?? (i == null ? void 0 : i[0].code), { value: s, onChange: r }); - return j("div", { className: I("ff-data-list-toolbar", o.toolbar, e), children: [g("div", { className: "ff-data-list-title", children: t }), g(Bi, { className: "ff-data-list-tabs", itemRender: ({ label: c, code: p, value: h }) => g("span", { onClick: () => u(h ?? p), className: I("ff-data-list-tab", { active: (h ?? p) == l }), children: c }), items: i }), j("div", { className: "ff-data-list-actions", children: [g($.Link, { icon: "icon-reload", widget: () => a() }), g($.Link, { icon: "icon-setting" })] })] }); -}, di = ({ isItemGridLayout: e, theme: t, themeProps: i, onClickCallback: n, onReload: r, listCode: a, total: o = 0, page: s = 0, onPageChange: l, pageSize: u = 30, onPageSizeChange: c, tab: p, onTabChange: h, keyword: m, onKeywordChange: f, condition: b, onConditionChange: C, sider: k, onSiderChange: S, layouts: v, classNames: N = {}, payload: V = {}, ...q }) => { - const [B, M] = O(), R = X((T, F) => { - const J = { tab: p, page: s, pageSize: u, keyword: m, sider: k, condition: b, total: o, payload: V }; - return T && T != "init" ? d.get(J, T, F) : J; - }, [JSON.stringify(b), JSON.stringify(V), p, s, u, m, k, o]), z = H(() => { - let T = { sider: mn, filter: ci, footer: gn, toolbar: fn }; - v === !1 ? T = { sider: null, filter: null, footer: null, toolbar: null } : d.isPlainObject(v) && (T = Object.assign({}, T, v)); - for (const F in T) if (T[F]) { - if (ji(T[F])) { - const J = T[F]; - T[F] = (de) => x.cloneElement(J, de); - } - } else T[F] = () => g(x.Fragment, {}); - return T; - }, [v]); - return L(() => { - t ? le.getWidgetComponent(t).then((T) => { - if (!T) throw `${t} not found`; - return T; - }).catch((T) => ({ default: () => `${T}` })).then((T) => M(x.createElement(T.default, { ...q, layouts: z, $setting: i }))) : M(g(e ? ln : dn, { ...q, layouts: z, $setting: i })); - }, [t, i]), g(ie.Provider, { value: { classNames: N, listCode: a, onClickCallback: n, onReload: r, getBase62params: R, onPageChange: l, onPageSizeChange: c, onTabChange: h, onSiderChange: S, onKeywordChange: f, onConditionChange: C }, children: B && x.cloneElement(B, q) }); -}; -di.propTypes = { classNames: w.exact({ sider: w.string, filter: w.string, footer: w.string, toolbar: w.string, container: w.string, content: w.string, item: w.string }), layouts: w.oneOfType([w.exact({ sider: w.oneOfType([w.elementType, w.element]), filter: w.oneOfType([w.elementType, w.element]), footer: w.oneOfType([w.elementType, w.element]), toolbar: w.oneOfType([w.elementType, w.element]) }), w.bool]) }; -var fe, ge, $e, rt; -const ae = class ae { - constructor() { - E(this, ge, null); - E(this, $e, /* @__PURE__ */ new Map()); - E(this, rt, () => { - if (y(this, ge)) return y(this, ge).port.postMessage({ command: "status", data: [] }); - U(this, ge, new SharedWorker(new URL("/ff-worker/res-ws.js", self.location))), y(this, ge).port.onmessage = (t) => { - var i, n; - (i = t.data) != null && i.uuid ? y(this, $e).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 && A.get("/api/user-api-token").then(({ token: r, expire_at: a }) => { - y(this, ge).port.postMessage({ command: "initWs", data: [`ws${d.trimStart(A.appUrl, "http")}api/user-resource-status-ws?token=${r}`] }); - }); - }, y(this, ge).port.postMessage({ command: "status", data: [] }); - }); - P(this, "subscribe", (t, i = []) => (i ? Array.isArray(i) && i.length == 0 ? i = "*" : Array.isArray(i) || (i = [i].flat()) : i = "*", y(this, $e).set(t, i), y(this, $e).size == 1 && y(this, rt).call(this), () => this.unsubscribe(t))); - P(this, "unsubscribe", (t) => y(this, $e).delete(t)); - if (y(ae, fe)) return y(ae, fe); - } -}; -fe = new WeakMap(), ge = new WeakMap(), $e = new WeakMap(), rt = new WeakMap(), E(ae, fe, null), P(ae, "getInstance", () => (y(ae, fe) || U(ae, fe, new ae()), y(ae, fe))); -let Ct = ae; -const ui = Ct.getInstance(), Nt = x.forwardRef(({ listCode: e, base62params: t, className: i, theme: n, themeProps: r, layouts: a, classNames: o }, s) => { - const [{ resource: l, primaryKey: u, batchOperations: c = [], itemOperations: p = [], columns: h = [], themeConfig: m, theme: f, isConditionFormLayout: b = !1, isTreeSider: C, treeSiderConfig: k, isItemGridLayout: S, itemGridLayout: v, title: N, isPaginate: V, tabs: q }, B] = O({ isItemGridLayout: !1, itemGridLayout: {} }), M = on(e, t), [{ dataSource: R, itemOperationsAccess: z, condition: T, tab: F, keyword: J, page: de, total: ve, pageSize: Te, sider: Ne, onConditionChange: K, onTabChange: Et, onKeywordChange: xi, onPageChange: vi, onPageSizeChange: Si, onSiderChange: Pi, onReload: ct, payload: $i }, jt] = sn(M, e, u, l), Ti = bt(p, z, R, u), Ni = bt(c); - L(() => { - let Q = null; - return e && A.get(`/api/_/${e}`).resp(({ data: Ge, res: Fi }) => { - Ge != null && Ge.isDynamicRefresh && (Q = ui.subscribe(() => ct(), Fi)), B(Ge); - }).catch(() => B({})), () => Q == null ? void 0 : Q(); - }, [e]), x.useImperativeHandle(s, () => ({ onReload: ct, onClickCallback: jt })); - const Ri = { listCode: e, title: N, classNames: o, layouts: a, resource: l, primaryKey: u, theme: n || f, themeProps: r || m, isTreeSider: C, treeSiderConfig: k, isPaginate: V, tabs: q, isItemOperations: Ti, itemOperations: p == null ? void 0 : p.map((Q) => d.isEmpty(Q == null ? void 0 : Q.confirm) ? Q : { ...Q, confirm: Object.assign({}, Q.confirm, { getPopupContainer: () => document.body }) }), isBatchOperations: Ni, batchOperations: c, isItemGridLayout: S, columns: h, itemGridLayout: v, isConditionFormLayout: b, itemOperationsAccess: z, dataSource: R, onConditionChange: K, onTabChange: Et, onKeywordChange: xi, onPageChange: vi, onPageSizeChange: Si, onSiderChange: Pi, condition: T, tab: F, keyword: J, page: de, total: ve, pageSize: Te, sider: Ne, payload: $i }; - return g(di, { ...Ri, className: I("ff-data-list-helper", i), onReload: ct, onClickCallback: jt }); -}), gi = (e, t, i = !0) => i !== !0 && i-- <= 0 ? [] : d.isArray(e) && !d.isEmpty(e) ? e.reduce((n, r) => (Reflect.has(r, t) && Reflect.has(r, "children") && n.push(r[t]), Reflect.has(r, "children") && !d.isEmpty(r.children) ? n.concat(gi(r.children, t, i)) : n), []) : [], hn = ({ className: e, primaryKey: t, columns: i = [], dataSource: n = [], operationRender: r, operationWidth: a = 180, ...o }) => { - const { classNames: s } = ce(ie), l = W(null), u = W(null), [c, p] = O([]), [h, m] = O({ width: 0, height: 0 }); - L(() => { - p(gi(n, t)); - }, [n, t]), Ai(() => { - const b = new ResizeObserver(() => { - var C; - m({ width: ((C = l.current) == null ? void 0 : C.nativeElement.querySelector(".ant-table-body").scrollWidth) || u.current.offsetWidth, height: u.current.offsetHeight }); - }); - return u.current && b.observe(u.current), () => { - u.current && b.unobserve(u.current); - }; - }, []); - const f = an(i); - return g("div", { ref: u, className: I("ff-data-list-table", s.content, e), children: h.height ? g(Di, { ...o, ref: l, rowKey: (b) => (b == null ? void 0 : b[t]) ?? Math.random(), columns: f == null ? void 0 : f.concat(r ? [{ title: "操作", align: "center", fixed: "right", width: `${Math.ceil(a / h.width * 100).toFixed(2)}%`, render: (b, C, k) => r(C, k) }] : []), dataSource: n, size: "middle", scroll: { x: "max-content", y: h.height - 50 }, pagination: !1, expandable: { defaultExpandAllRows: !0, expandRowByClick: !0, onExpandedRowsChange: p, expandedRowKeys: c } }) : null }); -}, yn = "RC_FORM_INTERNAL_HOOKS", wn = (e, { initialValue: t, initialValueLanguage: i, convertJs: n, convertJsSetting: r, type: a = "string" }, o = null) => { - const s = W(!1), l = ce(Yt), [u, c] = O(), [p, h] = O(i != "javascript" && e ? l.getFieldValue(e) : void 0), { registerWatch: m } = l.getInternalHooks(yn) || {}; - return L(() => m == null ? void 0 : m((f, b, C) => { - if (!s.current) return; - const k = d.get(b, e); - d.isEqual(k, p) || h(ee(k, a)); - }), [p]), L(() => { - i == "javascript" && t ? xe.exec(t, {}, { getFieldValueForBasicForm: (f) => o ? o.getFieldValue(f) : l.getFieldValue(f), getFieldValue: (f) => l.getFieldValue(f) }).then((f) => h(ee(f, a))).catch((f) => notification.error({ message: `布局数据错误: ${JSON.stringify(f)}` })).finally(() => s.current = !0) : (t && h(ee(t ?? l.getFieldValue(e), a)), s.current = !0); - }, [t, i]), Ke(() => { - s.current && n && new et([n, r]).toValue(p, l.getFieldsValue(!0)).then(c).catch((f) => { - c(f), console.error("布局数据转换错误: ", f, n); - }); - }, [p, n, r]), [u ?? p, p]; -}, pi = (e, t, i = null) => H(() => { - var n; - return (n = d.sortBy(e, ["y", "x"])) == null ? void 0 : n.map(({ i: r, x: a, y: o, w: s, h: l, field: { boxStyle: u, ...c } }, p) => g("div", { className: "grid-layout-item", style: li(a, o, s, l, u), children: g(t, { ...c, basicForm: i }) }, r ?? p)); -}, [e]), bn = ({ 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] = O(); - return L(() => { - r && le.getWidgetComponent(r).then(({ defaultProps: s = {}, default: l }) => ({ default: Cn(l, s, i) })).catch((s) => ({ default: () => `${s}` })).then((s) => o(x.createElement(s.default, n))); - }, [r]), a; -}, Cn = (e, t = {}, i = null) => (n) => { - const { code: r, label: a, extras: o, isVirtual: s, initialValue: l, initialValueLanguage: u, convertJs: c, convertJsSetting: p, value: h, ...m } = d.merge({}, t, n), [f, b] = wn(s ? null : r, { initialValue: l, initialValueLanguage: u, convertJs: c, convertJsSetting: p, type: (m == null ? void 0 : m.type) || "string" }, i), C = H(() => { - const v = Object.keys((t == null ? void 0 : t.extras) || {}); - return d.over([d.partialRight(d.pick, v), d.partialRight(d.omit, v)]); - }, [t == null ? void 0 : t.extras]), [k, S] = C(m); - return g(e, { ...S, value: f, rawValue: b, $setting: Object.assign({}, o, k) }); -}, mi = ({ 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, ...u }) => { - const [c] = te.useForm(), p = pi(o, bn, l), h = H(() => [{ name: "__PROPS__", value: a }], [a]); - return Ke(() => (c.setFieldsValue(s), () => c.resetFields()), [s]), g(te, { fields: h, form: c, component: !1, children: g("div", { ...u, className: I("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: p }) }); -}, kr = (Dt = mi, function({ code: e, data: t, ...i }) { - const [n, r] = O({ resource: null, cols: 12, rowHeight: 21, fields: [] }); - return L(() => { - e && A.get(`/api/_/${e}`).then((a) => r(d.pick(a, ["resource", "cols", "rowHeight", "fields"]))); - }, [e]), (n == null ? void 0 : n.resource) && g(Dt, { ...i, rowHeight: n.rowHeight, cols: n.cols, fields: n.fields, data: n != null && n.resource ? { [n == null ? void 0 : n.resource]: t } : {} }); -}); -var Dt; -const kn = ({ column: e = 0, colWidth: t = 0, cols: i, rowHeight: n, itemMargin: r, fields: a, primaryKey: o, dataSource: s, itemClassName: l, beforeRender: u = null, afterRender: c = null, itemRender: p = (b, C, k) => b, empty: h = g(qi, { description: null }), className: m, style: f = {} }) => { - const { classNames: b } = ce(ie), C = H(() => g(mi, { cols: i, rowHeight: n, itemMargin: r, fields: a, className: l }), [a, i, n, r]), k = d.isEmpty(s); - return j("div", { className: I("ff-data-list-content", b.content, m), style: Object.assign({}, f, e && { "--col-num": e }, t && { "--col-width": t }), children: [u == null ? void 0 : u(s), k ? h : s.map((S, v) => { - const N = p(x.cloneElement(C, { data: S }), S, v); - return x.cloneElement(N, { key: `${(S == null ? void 0 : S[o]) ?? v}-${rn(S)}` }); - }), c == null ? void 0 : c(s)] }); -}, xn = ({ component: e, $props: t }) => { - const { base62params: i } = Je(t, {}); - return g(Y, { children: g(Nt, { listCode: e, base62params: A.decode(i) }) }); -}, xr = () => g(fi, {}), fi = () => "Empty", vn = ({ component: e, $setting: t, $props: i }) => { - const [n, r] = O(); - L(() => { - if (!e) return r(g(fi, { description: null })); - le.getWidgetComponent(e).catch((o) => ({ default: () => `${o}` })).then((o) => x.createElement(o.default, { $setting: t })).then(r); - }, [e]); - const a = Je(i, {}); - return n ? x.cloneElement(n, a) : null; -}, vr = () => "NotFoundPage"; -var he, Z, ye, we, We, Ue; -const se = class se { - constructor() { - E(this, Z, /* @__PURE__ */ new Map()); - E(this, ye, {}); - E(this, we, null); - P(this, "init", (t, i) => { - U(this, Z, t), U(this, ye, i); - }); - P(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) || {})); - P(this, "redirect", (t, i, n = {}) => { - const { uri: r, type: a, widgetProps: o } = this.get(t) || {}, { router: s, query: l, ...u } = i || {}, c = Object.assign({}, u, s), p = Object.assign({}, u, l); - a == "list" && (c.base62params = A.encode(c != null && c.base62params ? c.base62params : c)); - let h = Ki(r || t, c); - const m = new URLSearchParams(); - for (const f in o || {}) (o == null ? void 0 : o.type) == "query" && Object.has(p, f) && m.append(f, JSON.stringify(p[f])); - return m.size > 0 && (h = `${h}?${m.toString()}`), n != null && n.isOpenWindow ? window.open(h) : y(this, we).navigate(h, { replace: !!(n != null && n.isReplaceRouteHistory) }); - }); - P(this, "getMenus", (t) => { - var i; - return ((i = y(this, ye)) == null ? void 0 : i[t]) || []; - }); - P(this, "findMenuPathByUuid", (t) => { - let i = []; - for (const n in y(this, ye)) if (i = y(this, We).call(this, y(this, ye)[n], t, [n]), i.length > 1) return i; - return i; - }); - P(this, "getMenusByRouteUuid", (t) => y(this, Ue).call(this, t, Object.values(y(this, ye)).flat())); - E(this, We, (t, i, n = []) => { - if (d.isEmpty(t)) return n; - for (const { uuid: r, children: a } of t) { - if (r == i) return n.concat(r); - if (!d.isEmpty(a)) return n.concat(r, y(this, We).call(this, a, i)); - } - return n; - }); - E(this, Ue, (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, Ue).call(this, t, a.children)))); - return n; - }); - P(this, "getCurrentMenu", () => { - const { uuid: t } = this.getCurrentRoute() || {}; - if (!t) return; - const i = this.getMenusByRouteUuid(t); - return d.isEmpty(i) ? void 0 : i[0]; - }); - P(this, "getCurrentRoute", (t = 0) => { - var n; - const i = (n = y(this, we).state.matches[y(this, we).state.matches.length - 1 - t]) == null ? void 0 : n.route; - if (!i) return null; - for (let [r, a] of y(this, Z)) if (a.uri === i.path) return a; - return null; - }); - P(this, "getPageParams", (t) => { - var r, a, o; - let i = "", n = {}; - if (Zt()) n = _i(), i = (r = Gi()) == null ? void 0 : r.search; - else { - const { location: s = {}, matches: l = [] } = ((a = y(this, we)) == 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) => { - n[l] = s; - }), t ? d.get(n, t) : n; - }); - P(this, "createBrowserRouter", (t = {}) => { - if (y(this, Z).size == 0) return null; - const i = Ie.get("Common.WEBSITE_DEFAULT_THEME", "@pkg/ff/frameworks/DefaultTheme"), n = Ie.get(le.checkUserToken() ? "Common.WEBSITE_LOGIN_REDIRECT" : "Common.WEBSITE_DEFAULT", "/index"), r = { [i]: 0 }, a = (s, l) => () => Promise.all([le.getWidgetComponent(s), Je(l)]).then(([u, c]) => [u.default || function() { - return `${s}`; - }, c]).then(([u, c]) => ({ Component: () => x.createElement(ti, {}, x.createElement(u, { $setting: c })) })), o = Array.from(y(this, Z).values()).reduce((s, { uuid: l, uri: u, name: c, type: p, component: h, widgetSetting: m, widgetProps: f, isLogin: b, isLayout: C, extra: k }) => { - let S = {}, v = 0; - switch (p) { - case "list": - S.element = x.createElement(xn, { component: h, $props: f }); - break; - case "fsdpf-component": - S.element = x.createElement(vn, { key: h, component: h, $setting: m, $props: f }); - } - const N = (k == null ? void 0 : k.theme) ?? (k == null ? void 0 : k.layout); - if (N) { - const V = (k == null ? void 0 : k.themeProps) ?? (k == null ? void 0 : k.layoutProps); - if (!r[N]) return r[N] = s.length, [...s, { path: "/", lazy: a(N, V), children: [{ path: u, ...S }] }]; - v = r[N]; - } - return C && v > -1 ? (s[v].children.push({ path: u, ...S }), s) : [...s, { path: u, ...S }]; - }, [{ path: "/", lazy: a(i, {}), children: [] }]); - return o.push({ index: !0, element: x.createElement(Sn, { to: n, replace: !0 }) }), U(this, we, Yi(o, t)); - }); - if (y(se, he)) return y(se, he); - } -}; -he = new WeakMap(), Z = new WeakMap(), ye = new WeakMap(), we = new WeakMap(), We = new WeakMap(), Ue = new WeakMap(), E(se, he, null), P(se, "getInstance", () => (y(se, he) || U(se, he, new se()), y(se, he))); -let kt = se; -const Sn = ({ to: e, replace: t }) => Zt() ? x.createElement(Xi, { to: e, replace: t }) : (window.document.location = e, "redirect"), ke = kt.getInstance(), Re = new Worker(new URL("/ff-worker/index.js", self.location)), qt = { getConfigure: (e) => Ie.get(e), route: { redirect: (...e) => ke.redirect(...e), getPageParams: (...e) => ke.getPageParams(...e), getCurrentRoute: () => ke.getCurrentRoute() }, popup: { notification: (...e) => G.notification(...e), success: (...e) => G.success(...e), error: (...e) => G.error(...e), form: (...e) => G.form(...e), modal: (...e) => G.modal(...e), confirm: (...e) => G.confirm(...e) } }; -var at, je, be; -const D = class D { - constructor() { - P(this, "exec", (t, i = {}, n = {}, r = "") => new Promise((a, o) => { - if (!/^(?!\s*(\/\/|\/\*|\*)).*?\S+/m.test(t)) return a(); - const s = Vt(D, at)._++; - y(D, je).set(s, n), D.mQueue.set(s, [a, o]), Re.postMessage({ id: s, session: r, category: "eval", method: t, args: i }); - })); - P(this, "clear", (t) => Re.postMessage({ session: t, category: "clear" })); - if (y(D, be)) return y(D, be); - Promise.resolve().then(() => _n).then((t) => { - qt.http = t.http; - }), Re.addEventListener("message", ({ data: { id: t, task_id: i, method: n, args: r, category: a, data: o, error: s, session: l } }) => { - if (a === "eval" && D.mQueue.has(t)) s !== null ? D.mQueue.get(t)[1](s) : D.mQueue.get(t)[0](o), y(D, je).delete(t), D.mQueue.delete(t); - else if (a === "util") try { - const u = d.get(qt, n.split("/")) || d.get(y(D, je).get(i), n.split("/")); - if (!d.isFunction(u)) throw `${n} not found`; - Promise.resolve(Reflect.apply(u, void 0, r)).then((c) => { - Re.postMessage({ id: t, task_id: i, category: a, method: n, args: r, session: l, data: c, error: null }); - }).catch((c) => { - Re.postMessage({ id: t, task_id: i, category: a, method: n, args: r, session: l, data: null, error: c }); - }); - } catch (u) { - Re.postMessage({ id: t, task_id: i, category: a, method: n, args: r, session: l, data: null, error: u }); - } - }, !1); - } -}; -at = new WeakMap(), je = new WeakMap(), be = new WeakMap(), P(D, "mQueue", /* @__PURE__ */ new Map()), E(D, at, 0), E(D, je, /* @__PURE__ */ new Map()), E(D, be, null), P(D, "getInstance", () => (y(D, be) || U(D, be, new D()), y(D, be))); -let xt = D; -const xe = xt.getInstance(), st = () => { - const e = W(!0), [, t] = x.useReducer((i) => i + 1, 0); - return L(() => () => e.current = !1, []), () => e.current && t(); -}, Sr = (e) => { - const t = W(); - return L(() => { - t.current = e; - }, [e]), t.current; -}, Pr = (e) => { - const [t, i] = O(e), n = W(null), r = X((a, o) => { - n.current = o, i(a); - }, []); - return L(() => { - n.current && (n.current(t), n.current = null); - }, [t]), [t, r]; -}, Ke = (e = (n) => { -}, t, i = d.isEqual) => { - const n = x.useRef(); - i(t, n.current) || (n.current = d.cloneDeep(t)), x.useEffect(e, [n.current]); -}, ot = Ke, hi = (e, t = "string") => { - var i; - if (!Array.isArray(e)) return e; - 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 = hi(e[n].children, t)); - return e; -}, $r = (e, t = "json", i = "string", n, r = null) => { - const [a] = te.useForm(n), [o, s] = O([{ label: "无", value: "", disabled: !0 }]), l = W([]), u = te.useWatch((c) => l.current.length === 0 ? null : d.pick(c, l.current), a) || null; - return L(() => { - Array.isArray(e) ? s(e) : t === "javascript" && e ? xe.exec(e, {}, { getFieldValue: (c) => (l.current.includes(c) || l.current.push(c), a.getFieldValue(c)), getFieldValueForBasicForm: (c) => (l.current.includes(c) || l.current.push(c), r ? r.getFieldValue(c) : a.getFieldValue(c)) }).then((c) => { - s(ee(c, "array")); - }) : e && s(ee(e, "array")); - }, [e, t, u]), hi(o, i); -}, Tr = (e) => { - const [t, i] = O(), n = { type: "GET" }; - if (typeof e == "string" ? n.url = e : d.isPlainObject(e) && Object.assign(n, e), !(n != null && n.url)) throw "url is required"; - const r = (a) => A.request(n, !1).resp((o) => (console.log("useSubscribeRequest", a), i(o), o)); - return Ke(() => { - let a = null; - return r().then((o) => { - a = ui.subscribe(d.throttle(r, 180, { leading: !1, trailing: !0 }), o.res); - }), () => a == null ? void 0 : a(); - }, n), t; -}, Pn = (e) => { - const [t, i] = x.useState({ gridItems: [], hideItems: [] }); - return x.useEffect(() => { - e && A.get(`/api/_/${e}`).then(({ pk: n, uuid: r, code: a, resource: o, align: s, cols: l, rowHeight: u, marginX: c, marginY: p, listenChangeFields: h, listenChangeFieldsFunc: m, fields: f }) => ({ pk: n, uuid: r, code: a, resource: o, align: s, cols: l, rowHeight: u, marginX: c, marginY: p, listenChangeFields: h, listenChangeFieldsFunc: m, ...f.reduce((b, C) => { - var k; - return (k = C == null ? void 0 : C.field) != null && k.hidden ? b.hides.push(C == null ? void 0 : C.field) : b.items.push(C), b; - }, { items: [], hides: [] }) })).then(i); - }, [e]), t; -}, $n = ({ max: e = 0, min: t = 0, type: i = "", message: n, pattern: r, required: a = !1, validator: o } = {}, s, l) => { - const [u, c] = O([]); - return L(() => { - const p = []; - if (a) { - let h = l; - switch (l) { - case "number": - case "string": - case "array": - break; - case "bool": - h = "boolean"; - break; - case "json": - h = "object"; - } - p.push({ type: h, required: !0, whitespace: !0, message: "该项必填" }); - } - switch (i) { - case "string": - p.push({ type: i, max: e, min: t, message: n || (t && e ? `字符必须在 ${t} ~ ${e} 之间` : `${e ? "最多能有" : "最少要有"} ${t || e} 个字符`) }); - break; - case "pattern": - p.push({ type: "string", pattern: r, message: n }); - break; - case "validator": - o && p.push(({ getFieldValue: h }) => ({ validator: async (m, f) => { - const b = await xe.exec(o, { value: f, fieldName: s }, { getFieldValue: h }); - return d.isString(b) && b ? Promise.reject(b) : d.isBoolean(b) && !b ? Promise.reject(n) : Promise.resolve(); - } })); - } - c(p); - }, [e, t, i, n, r, a, o]), u; -}, Tn = (e, t, i) => { - const [n, r] = O(null); - return L(() => { - const { initDataUri: a = `/api/${e}`, initDataMethod: o = "GET" } = i || {}; - t && A.request({ method: o, url: d.trimEnd(`${a}/${t}`, "/") }).then((s) => { - r(s); - }); - }, [e, t, i]), n; -}, yi = (e, t, i = {}, n = {}, r = {}) => { - const a = ce(Yt), o = st(), s = W(!0), l = W([]), [u, c] = O(t), [p, h] = O(), m = te.useWatch((f) => JSON.stringify(d.pick(f, l.current)), a) || "{}"; - return ot(() => { - e && xe.exec(e, i, { ...n, getFieldValueForBasicForm: (f) => r ? r.getFieldValue(f) : null, getFieldValue: d.wrap(a.getFieldValue, (f, b) => (l.current.some((C) => d.isEqual(C, b)) || (l.current.push(b), o()), f == null ? void 0 : f(b))), isFieldTouched: a.isFieldTouched, isFieldsTouched: a.isFieldsTouched }).then((f) => { - s.current && (c(f), h(null)); - }).catch((f) => { - s.current && (c(t), h(f)); - }); - }, [e, m, a, i, n]), L(() => () => s.current = !1, []), e ? [u, p] : [t, null]; -}, Nn = (e, t, i = [], n = {}) => { - const r = W({}), a = W(), o = d.debounce(st(), 180), s = ["disabled", "required"], l = (h, m) => { - s.includes(h) && (r.current[h] = m), o(); - }, u = H(() => ({ setDisabled: (h) => l("disabled", h), setRequired: (h) => l("required", h), getDisabled: () => r.current.disabled, getRequired: () => r.current.required }), [t]), [c, p] = yi(t, -1, {}, u, n); - if (!p && a.current != c && (c >= 0 || !d.isEmpty(i == null ? void 0 : i[c]))) { - a.current = c; - const { widget: h, widgetPrefix: m, props: f } = i == null ? void 0 : i[c]; - e = ni(h, m), r.current = d.merge(f, d.pick(r.current, s)); - } - return [e, r.current]; -}, Wt = (e) => e === void 0 || e === !1 ? "" : (Array.isArray(e) ? e : [e]).join("_"), Nr = ({ value: e, onChange: t }, i = null) => { - const n = W(), [r] = te.useForm(i), a = W({}); - return ot(() => { - d.isEqual(n.current, e) || r.setFieldsValue(e); - }, [e]), L(() => () => r.resetFields(), []), [H(() => r.__INTERNAL__ ? r : { ...r, __INTERNAL__: { itemRef: (o) => (s) => { - const l = Wt(o); - s ? a.current[l] = s : delete a.current[l]; - } }, scrollToField: (o, s = {}) => { - console.warn("useMergedFormValuesChange scrollToField not work, unreferenced antd form"); - }, focusField: (o) => { - console.warn("useMergedFormValuesChange focusField not work, unreferenced antd form"); - }, getFieldInstance: (o) => { - const s = Wt(o); - return a.current[s]; - } }, [r]), (o, s) => { - n.current = s, t == null || t(s); - }]; -}, Rn = ({ type: e, initialValue: t, initialValueLanguage: i, onChange: n, basicForm: r }) => { - const [a, o] = yi(i == "javascript" && t, i == "javascript" ? void 0 : t, {}, {}, r); - return L(() => { - i == "javascript" ? n(ee(a, e)) : t && n(ee(t, e)); - }, [e, t, a]), null; -}, wi = ({ widget: e = "Input", widgetPrefix: t = "@pkg/ff/grid-layout-forms", widgetDecorator: i, subWidgets: n = [], basicForm: r, ...a }) => { - const o = ni(e, t), [s, l] = Nn(o, i, n, r), [u, c] = O(); - return L(() => { - s && le.getWidgetComponent(s).then(({ defaultProps: p = {}, default: h }) => ({ default: Fn(h, p, r) })).catch((p) => ({ default: () => `${p}` })).then((p) => c(x.createElement(p.default, a))); - }, [s]), u && x.cloneElement(u, { ...a, ...l }); -}, Fn = (e, t = {}, i = null) => (n) => { - const { type: r, code: a, label: o, noStyle: s, placeholder: l, required: u = !1, extras: c, validators: p, help: h, isVirtual: m, $isReserved: f, initialValue: b, initialValueLanguage: C, ...k } = d.omit(d.merge({}, t, n), ["convertJs", "convertJsSetting", "widget", "widgetPerfix", "widgetDecorator", "subWidgets", "boxStyle"]), S = $n(Object.assign({}, p, u ? { required: !0 } : {}), a, r), v = H(() => { - const M = Object.keys((t == null ? void 0 : t.extras) || {}); - return d.over([d.partialRight(d.pick, M), d.partialRight(d.omit, M)]); - }, [t == null ? void 0 : t.extras]), [N, V] = v(k), q = { label: o, noStyle: s, colon: !1, layout: "vertical" }, B = X((M) => M == null ? void 0 : ee(M, r), [r]); - return g(Xt, { name: a, rules: S, initialValue: B(b), normalize: B, children: (M, R, z) => { - var T; - return g(e, { type: r, rcform: z, basicForm: i, itemProps: { validateStatus: R.errors.length > 0 ? "error" : "success", tooltip: h || null, help: R.errors.length > 0 ? R.errors.join("、") : null, required: ((T = S == null ? void 0 : S[0]) == null ? void 0 : T.required) || !1, ...q }, fieldProps: { placeholder: l, ...V, ...M }, $setting: Object.assign({}, c, N) }); - } }); -}, Rt = ({ cols: e = 24, rowHeight: t = 16, itemMargin: i = [8, 16], containerPadding: n = [0, 0], fields: r = [], children: a, basicForm: o = null }) => { - const s = pi(r, wi, o); - 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 && x.cloneElement(a, { cols: e, rowHeight: t, itemMargin: i, containerPadding: n, fields: r })] }); -}; -Rt.propTypes = { fields: w.array }; -const On = (Ut = Rt, ({ code: e, layout: t, name: i, primaryKey: n = 0, style: r = {}, formProps: a = {}, form: o, basicForm: s, isPreview: l = !1, className: u, onFinish: c, onValuesChange: p = () => { -}, ...h }) => { - const { align: m, autoComplete: f, resource: b, items: C, hides: k, rowHeight: S, marginX: v, marginY: N, cols: V, listenChangeFields: q, listenChangeFieldsFunc: B, pk: M, uuid: R } = Pn(e), [z] = te.useForm(o), T = H(() => [{ name: "__PK__", value: M }, { name: "__PROPS__", value: a }, { name: "__RESOURCE__", value: b }, { name: "__LAYOUT_KEY__", value: e }, { name: "__LAYOUT_UUID__", value: R }, { name: "__PRIMARY_KEY__", value: n }], [M, e, R, b, n, a]); - return j(te, { className: u, name: i || e, layout: t || m, fields: T, form: z, autoComplete: f, style: { ...r, position: "relative" }, onFinish: c, onValuesChange: (F, J) => (({ changedValues: de, allValues: ve, listenChangeFields: Te, listenChangeFieldsFunc: Ne, onValuesChange: K, code: Et }) => { - K(de, ve), Ne && Array.isArray(Te) && xe.exec(Ne, { changedValues: de, allValues: ve }, { getFieldValue: z.getFieldValue, setFieldValue: z.setFieldValue, setFieldsValue: z.setFieldsValue, isFieldTouched: z.isFieldTouched, isFieldsTouched: z.isFieldsTouched }); - })({ changedValues: F, allValues: J, listenChangeFields: q, listenChangeFieldsFunc: B, onValuesChange: p, code: e }), children: [g(Ut, { ...h, form: z, basicForm: s, code: e, fields: C, cols: V, rowHeight: S, itemMargin: [v, N] }), k == null ? void 0 : k.map((F) => { - var J; - return g(Xt, { name: F.code, children: g(Rn, { form: z, basicForm: s, name: F.code, type: F.type, initialValue: F.initialValue, initialValueLanguage: (J = F.extras) == null ? void 0 : J.initialValueLanguage }) }, JSON.stringify(F.code)); - })] }, e); -}); -var Ut; -const bi = ({ $setting: e, $close: t, extras: i, code: n, primaryKey: r, ...a }) => { - const [o] = te.useForm(), s = Tn(n, r, e); - return L(() => { - s ? o.setFieldsValue(s) : o.resetFields(); - }, [s]), g(Y, { actions: j(x.Fragment, { children: [g($, { name: "保存", type: "primary", widget: () => { - const l = o.getFieldValue("__RESOURCE__"), { submitDataUri: u = `/api/${n}` } = e || {}; - o.validateFields(!0).then((c) => l ? d.pick(c, [l]) : c).then((c) => A.post(r ? `${u}/${r}` : `${u}`, c).msg(t)).catch(() => G.error("请先完善表单信息", { duration: 2e3 })); - } }), g($, { name: "取消", widget: () => t(!1) })] }), extras: i, children: g(On, { form: o, code: n, primaryKey: r, ...a }) }); -}, Ht = /* @__PURE__ */ new Set(), vt = (e = [], t = 0) => { - const i = e[t]; - if (i.length && !Ht.has(i)) { - const n = document.createElement("script"); - n.setAttribute("src", i), n.setAttribute("data-namespace", i), e.length > t + 1 && (n.onload = () => { - vt(e, t + 1); - }, n.onerror = () => { - vt(e, t + 1); - }), Ht.add(i), document.body.appendChild(n); - } -}, St = ({ className: e, type: t, style: i = {}, ...n }) => g("span", { role: "img", className: I("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}` }) }) }); -St.propTypes = { className: w.string, type: w.string.isRequired, style: w.object }, St.init = vt; -const En = (e, t, i, n) => ke.redirect(i, t, n), jn = (e, t = {}, i, n = {}) => { - var a; - const r = (a = n.router) == null ? void 0 : a.reduce((o, [s, l, u]) => { - const c = d.get(t, ["router", s]); - if (!c && c !== 0 && l) throw `请传入 ${u}`; - return `${o}/${c}`; - }, `/api/${i}`); - return A.del(r, t.param).msg(); -}, Jt = (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 d.isFunction(i) ? i.call(null, { ...t, ...o }) : d.isString(i) && i ? xe.exec(i, t, o) : null; -}, Kt = (e, t, i, n, r) => d.isString(i) && i ? le.getWidgetComponent(i).then(({ default: a }) => G.modal(a, { ...t, $setting: n }, r != null && r.title ? { ...r, title: d.template(r.title)(e) } : r)).catch((a) => { - G.error(i, { content: a.toString() }); -}) : G.modal(i, { ...t, $setting: n }, r != null && r.title ? { ...r, title: d.template(r.title)(e) } : r), An = (e, t, i, n, r) => G.modal(bi, { ...t, $setting: n, code: i }, r != null && r.title ? { ...r, title: d.template(r.title)(e) } : r), Ln = (e, t, i, n, r) => G.modal(Nt, { base62params: t, $setting: n, listCode: i }, r != null && r.title ? { ...r, title: d.template(r.title)(e) } : r), Vn = ({ widget: e, widgetType: t, widgetData: i, widgetProps: n, widgetSetting: r, widgetContainerProps: a }, { onAfterClick: o, onBeforeClick: s }) => { - const l = ce(ie), [u, c] = O({ leading: !0, trailing: !1 }), p = H(() => { - switch (t) { - case "redirect": - return d.partialRight(En, e, r); - case "func": - return d.partialRight(Jt, (r == null ? void 0 : r.code) ?? e, { status: u, setStatus: c }); - case "component": - case "fsdpf-component": - return d.partialRight(Kt, e, r, a); - case "grid-layout-form": - return d.partialRight(An, e, r, a); - case "data-list": - return d.partialRight(Ln, e, r, a); - case "destroy": - return d.partialRight(jn, e, r, a); - default: - if (Ot(e) || x.isValidElement(e)) return d.partialRight(Kt, e, r, a); - if (d.isFunction(e)) return d.partialRight(Jt, (r == null ? void 0 : r.code) || e, { status: u, setStatus: c }); - } - return (...h) => console.error("useButton unknown widgetType", t, ...h); - }, [e, t]); - return [d.debounce((h) => (s == null || s(h), Promise.resolve(Je(n, h, { list: l })).then((m) => p(h, { ...i, ...m })).then((m) => o == null ? void 0 : o(m)).catch(console.error)), 300, { leading: !0, trailing: !1 }), u]; -}, Ci = ({ type: e, name: t, className: i, icon: n, iconPosition: r, size: a }, o = "default") => H(() => { - const s = { type: "primary", className: I("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 = I(s.className, "ff-default"))) : o !== "circle" && o !== "round" || (s.shape = o), n && (s.icon = g(St, { type: n })), t && (s.children = t), s; -}, [o, e, i, n, r]), lt = ({ data: e, widget: t, widgetType: i = "fsdpf-component", widgetData: n, widgetProps: r, widgetSetting: a, widgetContainerProps: o, onAfterClick: s, onBeforeClick: l, children: u, extras: c }) => { - const p = ce(ie), [h, m] = O(!1), [f, b] = O("hover"), [C, k] = O({}), [S, v] = O(), { placement: N, align: V, zIndex: q, arrow: B = { pointAtCenter: !0 }, getPopupContainer: M, ...R } = o || {}; - L(() => { - i == "grid-layout-form" ? v(x.createElement(bi, { ...n, $setting: a, code: t })) : i == "data-list" ? v(x.createElement(Nt, { base62params: e, $setting: a, listCode: t })) : d.isString(t) ? le.getWidgetComponent(t).then(({ default: F }) => { - v(x.createElement(F, { ...n, $setting: a })); - }).catch((F) => v(F.toString())) : Ot(t) ? v(x.createElement(t, { ...n, $setting: a })) : x.isValidElement(t) && v(x.cloneElement(t, { ...n, $setting: a })); - }, [t, i, n]), L(() => { - Promise.resolve(Je(r, e, { list: p })).then(k); - }, [r, e, p.getBase62params]); - const z = (F, J = !1) => (m(F), !F && b("hover"), F ? l == null ? void 0 : l(C) : s == null ? void 0 : s(J)), T = (F) => { - m(!0), b("click"); - }; - return g(Wi, { zIndex: q, placement: N, onPopupClick: T, onClick: T, open: h, align: V, arrow: B, trigger: f, getPopupContainer: M, content: g(In, { ...R, extras: c, children: S && x.cloneElement(S, { ...C, $close: (F) => z(!1, F) }) }), children: u, onOpenChange: z }); -}, In = ({ title: e, className: t, children: i, extras: n, width: r, height: a, ...o }) => { - const [s, l] = O({}), u = X((m, f) => l((b) => ({ ...b, [m]: f })), []), c = X((m) => l((f) => ({ ...f, [m]: void 0 })), []), p = e ? x.createElement("div", { className: "ff-popup-title" }, e) : s == null ? void 0 : s.title, h = n ?? x.createElement("div", { className: "ff-popup-reserved-extras" }, n); - return g(He.Provider, { value: { ele: s, mount: u, unmount: c }, children: j("div", { className: I("ff-popup ff-popover", t, s.rootClassName), style: { width: r, height: a }, ...o, children: [j("div", { className: "ff-popup-header", children: [p, s == null ? void 0 : s["sub-title"]] }), i, j("div", { className: "ff-popup-footer", children: [h, s == null ? void 0 : s.extras, s == null ? void 0 : s.actions] })] }) }); -}; -lt.propTypes = { widgetType: w.oneOf(["fsdpf-component", "grid-layout-form", "data-list"]) }; -const _e = (e) => function({ className: t, variant: i, children: n, name: r, icon: a, type: o = "default", iconPosition: s = "start", noAuthType: l, onAfterClick: u, onBeforeClick: c, data: p, loading: h, disabled: m, tooltip: f, confirm: b, widget: C = () => { -}, widgetType: k, widgetData: S, widgetProps: v, widgetSetting: N, widgetContainerProps: V, ...q }) { - const { mode: B, ...M } = V || {}, R = Ci({ className: t, name: r, type: o, icon: a, iconPosition: s }, i ?? e), z = g(Ze, { ...R, ...q, children: n || r }); - if (B === "popover" && !["destroy", "redirect", "func"].includes(k)) return g(lt, { data: p, widget: C, widgetType: k, widgetData: S, widgetProps: v, widgetSetting: N, widgetContainerProps: M, onAfterClick: u, onBeforeClick: c, children: z }); - const T = d.isEmpty(f) || !f.enabled ? {} : f, F = d.isEmpty(b) ? { enabled: !1 } : Object.assign({ enabled: !0 }, b), [J, de] = O(!1), [ve, { disabled: Te, loading: Ne }] = Vn({ widget: C, widgetType: k, widgetData: S, widgetProps: v, widgetSetting: N, widgetContainerProps: M }, { onAfterClick: u, onBeforeClick: c }); - return g(Ui, { okText: "确定", cancelText: "取消", getPopupContainer: (K) => K, ...F, disabled: Te || m, open: J, onOpenChange: (K) => { - if (!K) return de(K); - F.enabled ? de(K) : ve(p); - }, onConfirm: (K) => { - ve(p, K); - }, onClick: (K) => { - K.stopPropagation(); - }, children: g(Hi, { getPopupContainer: (K) => K, ...T, title: J ? null : T == null ? void 0 : T.title, trigger: ["hover", "click"], children: x.cloneElement(z, { loading: Ne || h, disabled: Te || m }) }) }); -}, $ = _e("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", "component", "fsdpf-component", "grid-layout-form", "grid-layout", "data-list"]), widgetData: w.object, widgetProps: w.object, widgetSetting: w.object, widgetContainerProps: w.object, tooltip: w.exact({ title: w.string.isRequired, placement: w.oneOf(["top", "left", "right", "bottom", "topLeft", "topRight", "bottomLeft", "bottomRight", "leftTop", "leftBottom", "rightTop", "rightBottom"]), enabled: w.oneOfType([w.bool, w.number]), getPopupContainer: w.func }), confirm: w.exact({ title: w.string.isRequired, cancelText: w.string, okText: w.string, okType: w.oneOf(["primary", "default", "danger", ""]), placement: w.oneOf(["top", "left", "right", "bottom", "topLeft", "topRight", "bottomLeft", "bottomRight", "leftTop", "leftBottom", "rightTop", "rightBottom"]), enabled: w.oneOfType([w.bool, w.number]), getPopupContainer: w.func, arrow: w.oneOfType([w.bool, w.exact({ pointAtCenter: w.bool })]) }) }; -const Mn = _e("link"), zn = _e("circle"), Bn = _e("round"), Dn = _e("dashed"), _t = ({ options: e = [], triggerWeights: t = ["grid-layout-form", "grid-layout", "fsdpf-component", "print"], onAfterClick: i = (m, f, b) => { -}, onBeforeClick: n = (m, f, b) => { -}, labelVariant: r = "link", labelSize: a, labelRender: o, btnVariant: s, btnSize: l, btnRender: u = (m, f) => g($, { ...m, data: f }, m.uuid || mt()), widgetContainerProps: c = {}, children: p, data: h }) => { - if (d.isEmpty(e)) return p; - const [m, f] = H(() => (e || []).reduce((C, k) => { - const S = t.indexOf(k.widgetType); - return S === -1 ? C[1].push(k) : C[0] ? S < t.indexOf(C[0].widgetType) ? (C[1].push(C[0]), C[0] = k) : C[1].push(k) : C[0] = k, C; - }, [null, []]), [e, t]); - o ? p = o(m, h) || p : p || (p = g(Ze, { ...Ci(Object.assign(m != null && m.name || m != null && m.icon ? {} : { icon: "icon-location" }, m, { size: a }), r) })); - const b = f.map((C) => u(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: d.partialRight(i, C, h), onBeforeClick: d.partialRight(n, C, h) }, { size: l, variant: s }), h)); - return g(lt, { widget: m == null ? void 0 : m.widget, widgetType: m == null ? void 0 : m.widgetType, widgetProps: m == null ? void 0 : m.widgetProps, widgetSetting: m == null ? void 0 : m.widgetSetting, widgetContainerProps: Object.assign({}, c, m == null ? void 0 : m.widgetContainerProps), data: h, widgetData: m == null ? void 0 : m.widgetData, extras: b, onAfterClick: d.partialRight(i, m, h), onBeforeClick: d.partialRight(n, m, h), children: p }); -}; -_t.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 = Mn, $.Link.defaultProps = $.defaultProps, $.Link.propTypes = $.propTypes, $.Circle = zn, $.Circle.defaultProps = $.defaultProps, $.Circle.propTypes = $.propTypes, $.Round = Bn, $.Round.defaultProps = $.defaultProps, $.Round.propTypes = $.propTypes, $.Dashed = Dn, $.Dashed.defaultProps = $.defaultProps, $.Dashed.propTypes = $.propTypes, $.Popover = lt, $.GroupPopover = _t; -const qn = ({ fields: e, formProps: t, $close: i }) => { - const [n] = te.useForm(), r = H(() => [{ name: "__PROPS__", value: t }], [t]); - return g(Y, { actions: j(x.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(wi, { code: a, ...o }, a)) }) }); -}, Wn = ({ className: e, $close: t, children: i, title: n, subTitle: r, actions: a, extras: o, ...s }) => j(Qi, { ...s, prefixCls: "ff-drawer", className: I("ff-popup", e), maskMotion: { motionAppear: !0, motionName: "mask-motion" }, motion: (l) => ({ motionAppear: !0, motionName: `panel-motion-${l}` }), children: [j("div", { className: "ff-popup-header", children: [g("button", { "aria-label": "Close", className: "ff-popup-close", onClick: s.onClose, children: g(Tt, { type: "close" }) }), n, r] }), g("div", { className: "ff-popup-body", children: i }), j("div", { className: "ff-popup-footer", children: [o, a] })] }), Un = ({ className: e, $close: t, $event: i, children: n, title: r, subTitle: a, actions: o, extras: s, placement: l, ...u }) => { - const c = (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(Zi, { ...u, ...c, prefixCls: "ff-modal", modalRender: () => j("div", { className: I("ff-modal-content ff-popup", e), children: [j("div", { className: "ff-popup-header", children: [g("button", { "aria-label": "Close", className: "ff-popup-close", onClick: u.onClose, children: g(Tt, { type: "close" }) }), r, a] }), g("div", { className: "ff-popup-body", children: n }), j("div", { className: "ff-popup-footer", children: [s, o] })] }) }); -}, ki = ({ placement: e, $close: t, $event: i, children: n, title: r, ...a }) => { - const [o, s] = O({}), [l, u] = O(!0), c = X((f, b) => s((C) => ({ ...C, [f]: b })), []), p = X((f) => s((b) => ({ ...b, [f]: void 0 })), []); - let h = { ...a, className: o.rootClassName, title: o.title || r && x.createElement("div", { className: I("ff-popup-title") }, r), subTitle: o["sub-title"], actions: o.actions, extras: o.extras, children: n, $close: t, $event: i, onClose: () => u(!1) }; - const m = () => { - t(!1); - }; - return g(He.Provider, { value: { ele: o, mount: c, unmount: p }, children: e && e !== "center" ? g(Wn, { ...h, placement: e, open: l, afterOpenChange: (f) => !f && m() }) : g(Un, { ...h, visible: l, afterClose: m }) }); -}; -ki.propTypes = { placement: w.oneOf(["center", "left", "top", "right", "bottom"]) }; -const _ = () => { - const [e, t] = Li({ 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] = x.useReducer((a) => a + 1, 0); - L(() => { - _.$onClick = n, _.$queue.forEach(([a, o, s], l, u) => { - r([o, s], ...a), delete u[l]; - }); - }, []); - const n = (a, o = {}, s = {}) => new Promise((l, u) => r([l, u], a, o, s)), r = ([a, o], s, l = {}, u = {}) => { - const c = _.$index++, p = (h) => ((m, f) => (_.$popups.delete(m), i(), f == null ? void 0 : f()))(c, () => a(h)); - if (s === ii) return e.open({ ...u, key: c, content: x.createElement(s, { ...l, $close: () => e.close(c) }) }); - _.$popups.set(c, x.createElement(ki, { maskClosable: !1, $event: l == null ? void 0 : l.$event, ...u, key: c, $close: p }, x.isValidElement(s) ? x.cloneElement(s, { ...l, $close: p }) : s != null && s.name || It.isForwardRef(s) || (s == null ? void 0 : s.$$typeof) === It.ForwardRef ? x.createElement(s, { ...l, $close: p }) : s)), i(); - }; - return j(x.Fragment, { children: [Array.from(_.$popups).map(([a, o]) => o), t] }); -}; -_.$popups = /* @__PURE__ */ new Map(), _.$index = 0, _.$queue = [], _.$onClick = (...e) => new Promise((t, i) => { - _.$queue.push([e, t, i]); -}); -const Gt = (e, t, i = {}) => _.$onClick(e, t, i), gt = (e, { showProgress: t, duration: i, ...n } = { duration: 1.5 }) => _.$onClick(ii, { content: e, ...n }, { showProgress: t, duration: i }), G = { modal: Gt, confirm: (e, t = {}) => _.$onClick(en, { content: e, ...t }, { placement: "center" }), form: (e, t = {}, i = {}) => Gt(qn, { formProps: i, fields: e }, { placement: "center", ...t }).then((n) => { - if (n === !1) throw !1; - return n; -}), notification: gt, success: (e, t = { duration: 1.5 }) => gt(e, { ...t, className: "ff-notification-success", icon: "check" }), error: (e, t = { duration: 1.5 }) => gt(e, { ...t, className: "ff-notification-error", icon: "close" }) }; -Le.configure({ showSpinner: !1 }), Ve.interceptors.request.use((e) => { - e.headers.Platform = "web", e.headers.SaaS = window.localStorage.getItem("SaaS"); - const t = window.localStorage.getItem(Qe); - return e.headers.Authorization = t ? `Bearer ${t} ` : void 0, Le.inc(), e; -}, (e) => (Le.done(), Promise.reject({ code: -1, msg: e }))), Ve.interceptors.response.use(({ data: e, headers: t }) => (Le.done(), { ...e, res: t == null ? void 0 : t.res }), function(e) { - return Le.done(), Promise.reject(e.message); -}), window.addEventListener("unhandledrejection", ft.onUnhandledRejection), ft.onMsg = (e, t) => G[[0, 1].includes(e) ? "success" : "error"](t).then(() => e === 20300 && ke.redirect(Ie.get("Common.WEBSITE_LOGIN_PAGE"))); -const Pt = { appUrl: "", init: (e, t, i) => { - Pt.appUrl = i, Ve.defaults.baseURL = i, Ve.defaults.timeout = 15e3, Object.assign(Pt, new ft(e, t, Ve)); -} }, A = Pt; -class Ft extends Error { - constructor(t, i) { - super(i), Error.captureStackTrace && Error.captureStackTrace(this, Ft), !i instanceof Me && (this.name = `${t} Error Runtime`); - } -} -class Me extends Error { - constructor(t, ...i) { - super(...i), Error.captureStackTrace && Error.captureStackTrace(this, Me), this.name = `${t} Not Found`; - } -} -const pt = "mine", Qe = "token"; -var Ce, Ae; -const oe = class oe { - constructor() { - E(this, Ae, /* @__PURE__ */ new Map()); - P(this, "setVendor", (t, i) => y(this, Ae).set(t, new ei(i, async (n, r) => { - var o, s; - if (!(n != null && n.default)) throw "@pkg not found"; - let a = () => r; - switch ("function") { - case typeof (a = (o = n.default) == null ? void 0 : o[`./${r}/index.jsx`]): - case typeof (a = (s = n.default) == null ? void 0 : s[`./${r}/index.js`]): - return a(); - } - throw new Me(r); - }))); - P(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 Me(t); - try { - return y(this, Ae).has("pkg") ? await y(this, Ae).get("pkg").get(i) : await import(`${A.appUrl}/api/pkg-import/web?name=${t}`); - } catch (n) { - throw new Ft(t, n); - } - }); - P(this, "getRoutes", () => A.get("/api/my-router").then((t) => [...t, { uuid: "data-list-setting", isLayout: !0, uri: "/data-list-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/ff-design/components/DataListSetting", extra: { layout: "@pkg/ff-design/frameworks/DesignTheme" } }, { uuid: "grid-layout-setting", isLayout: !0, uri: "/grid-layout-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/ff-design/components/GridLayoutSetting", extra: { layout: "@pkg/ff-design/frameworks/DesignTheme" } }, { uuid: "grid-layout-form-setting", isLayout: !0, uri: "/grid-layout-form-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/ff-design/components/GridLayoutFormSetting", extra: { layout: "@pkg/ff-design/frameworks/DesignTheme" } }, { uuid: "resource-api-setting", isLayout: !0, uri: "/resource-api-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/ff-design/components/ResourceApiSetting", extra: { layout: "@pkg/ff-design/frameworks/DesignTheme" } }, { uuid: "charts-setting", isLayout: !0, uri: "/resource-api-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/ff-design/components/ChartsSetting", extra: { layout: "@pkg/ff-design/frameworks/DesignTheme" } }, { uuid: "fsm-setting", isLayout: !0, uri: "/fsm-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/ff-design/components/FsmSetting", extra: { layout: "@pkg/ff-design/frameworks/DesignTheme" } }, { uuid: "component-setting", isLayout: !0, uri: "/component-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/ff-design/components/ComponentSetting", extra: { layout: "@pkg/ff-design/frameworks/DesignTheme" } }, { uuid: "login", uri: "/login", name: "登录", type: "fsdpf-component", isLogin: !1, component: "@pkg/ff/components/Login" }, { uuid: "not-found", uri: "*", name: "Not Found", type: "fsdpf-component", isLogin: !1, component: "@pkg/ff/components/NotFound" }].map(({ uuid: i, ...n }) => [i, { uuid: i, ...n }])).then((t) => new Map(t))); - P(this, "getMenus", () => A.get("/api/my-menu")); - P(this, "getConfigure", () => A.get("api/init-configure")); - P(this, "getWidgetOperationAuth", () => A.get("/api/init-widget-operation-auth").then((t) => t.reduce((i, { uuid: n, auth: r }) => [...i, [n, r]], []))); - P(this, "getPhoneNumber", (t) => A.get(`/api/user-wx-phone-number/${t}`)); - P(this, "getUserToken", () => { - const t = window.localStorage.getItem(Qe); - if (!t) return ""; - const i = t.split("."); - if (!Array.isArray(i) || i.length !== 3) throw "登录令牌无效!"; - const { iat: n } = JSON.parse(window.atob(i[1])); - if (Math.floor((/* @__PURE__ */ new Date()).getTime() / 1e3) - n > 2592e3) throw "登录令牌已过期, 请重新登录!"; - return t; - }); - P(this, "checkUserToken", () => { - try { - return !!this.getUserToken(); - } catch { - return !1; - } - }); - P(this, "getUserInfo", (t = !0) => { - var i; - try { - const n = this.getUserToken(); - if (!n) return Promise.resolve(null); - const { iat: r } = JSON.parse(window.atob((i = n == null ? void 0 : n.split(".")) == null ? void 0 : i[1])), { iat: a, ...o } = A.decode(window.localStorage.getItem(pt) || "", {}); - return a === r ? Promise.resolve(o) : A.get("/api/mine-info").then(({ User: s = null }) => (window.localStorage.setItem(pt, A.encode({ ...s, iat: r })), s)); - } catch (n) { - console.error(n), t && G.error("请登录").then(this.logout); - } - return Promise.resolve(null); - }); - P(this, "login", (t, i, n = {}) => A.post("/api/user-token", { username: t, passwd: Vi.hash(i), platform: "web", ...n }).then(({ token: r }) => (window.localStorage.setItem(Qe, r), r))); - P(this, "logout", (t) => (window.localStorage.removeItem(pt), window.localStorage.removeItem(Qe), t == null ? void 0 : t())); - if (y(oe, Ce)) return y(oe, Ce); - } -}; -Ce = new WeakMap(), Ae = new WeakMap(), E(oe, Ce, null), P(oe, "getInstance", () => (y(oe, Ce) || U(oe, Ce, new oe()), y(oe, Ce))); -let $t = oe; -const le = $t.getInstance(), Hn = x.createContext({ user: {}, initUser: () => { -}, initUserComplete: !1 }), Jn = x.createContext({ set: () => { -}, get: () => { -}, assign: () => { -}, currentRoute: () => { -} }), Ot = (e) => !!(e != null && e.name) && (e.prototype instanceof x.Component || /^[A-Z]/.test(e.name)), Kn = (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); -}, _n = Object.freeze(Object.defineProperty({ __proto__: null, AppContext: Hn, AppGlobalParamsContext: Jn, cache: ei, configure: Ie, default: le, func: xe, http: A, insertStyle: Kn, isReactComponent: Ot, route: ke }, Symbol.toStringTag, { value: "Module" })); -export { - wi as $, - kn as A, - ln as B, - dn as C, - et as D, - an as E, - wr as F, - kr as G, - yn as H, - br as I, - oi as J, - bt as K, - sn as L, - on as M, - xn as N, - vn as O, - xr as P, - vr as Q, - ui as R, - st as S, - Sr as T, - Pr as U, - Ke as V, - ot as W, - $r as X, - Tr as Y, - On as Z, - Rt as _, - ni as a, - bi as a0, - Pn as a1, - $n as a2, - Tn as a3, - yi as a4, - Nn as a5, - Nr as a6, - St as a7, - $ as a8, - tn as a9, - Vn as aa, - Y as ab, - He as ac, - ti as ad, - _ as ae, - G as af, - ur as ag, - gr as ah, - pr as ai, - le as aj, - Ot as ak, - Kn as al, - A as am, - ei as an, - Ie as ao, - xe as ap, - ke as aq, - Hn as ar, - Jn as as, - Je as b, - fr as c, - ri as d, - hr as e, - yr as f, - nn as g, - rn as h, - li as i, - Cr as j, - gi as k, - mi as l, - bn as m, - wn as n, - pi as o, - di as p, - ci as q, - ut as r, - fn as s, - ee as t, - mr as u, - mn as v, - gn as w, - Nt as x, - ie as y, - hn as z -}; diff --git a/dist/common/main-DdIS_WOJ.js b/dist/common/main-DdIS_WOJ.js new file mode 100644 index 0000000..0a5001d --- /dev/null +++ b/dist/common/main-DdIS_WOJ.js @@ -0,0 +1,1079 @@ +var En = Object.defineProperty; +var Lt = (e) => { + throw TypeError(e); +}; +var jn = (e, t, n) => t in e ? En(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n; +var P = (e, t, n) => jn(e, typeof t != "symbol" ? t + "" : t, n), Vt = (e, t, n) => t.has(e) || Lt("Cannot " + n); +var y = (e, t, n) => (Vt(e, t, "read from private field"), n ? n.call(e) : t.get(e)), E = (e, t, n) => t.has(e) ? Lt("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, n), U = (e, t, n, i) => (Vt(e, t, "write to private field"), i ? i.call(e, n) : t.set(e, n), n); +var It = (e, t, n, i) => ({ + set _(r) { + U(e, t, r, n); + }, + get _() { + return y(e, t, i); + } +}); +import { jsx as u, jsxs as j } from "react/jsx-runtime"; +import x, { useEffect as L, useState as O, useCallback as X, useMemo as H, useRef as W, useContext as ce, useId as ht, isValidElement as An, useLayoutEffect as Ln } from "react"; +import w from "prop-types"; +import I from "classnames"; +import * as Mt from "react-is"; +import { useNotification as Vn } from "rc-notification"; +import d from "lodash"; +import te, { FieldContext as Xt, Field as Qt } from "rc-field-form"; +import { M as ut, N as Le, a as Ve, P as ft, S as In } from "./vender-CtjyT19B.js"; +import Zt from "immutability-helper"; +import { Form as Xe, Input as Mn, Button as Ze, Pagination as zn, Tree as Bn, Breadcrumb as Dn, Table as qn, Empty as Wn, Popover as Un, Popconfirm as Hn, Tooltip as Jn } from "antd"; +import { useMergedState as Kn } from "rc-util"; +import { generatePath as _n, useInRouterContext as en, useParams as Gn, useLocation as Yn, createBrowserRouter as Xn, Navigate as Qn } from "react-router-dom"; +import "rc-util/lib/hooks/useMergedState"; +import Zn from "rc-drawer"; +import ei from "rc-dialog"; +var Fe, ze, Oe, ue, ve, Pe; +class tn { + constructor(t, n) { + E(this, Fe, /* @__PURE__ */ new Map()); + E(this, ze, !0); + E(this, Oe, []); + E(this, ue); + E(this, ve, () => y(this, ue)); + E(this, Pe, () => Promise.resolve()); + P(this, "get", (...t) => new Promise((n, i) => { + const r = JSON.stringify(t); + if (y(this, Fe).has(r)) return n(y(this, Pe).call(this, y(this, ue), ...t)); + if (y(this, ue) === void 0) y(this, Oe).push([t, n, i]), y(this, ze) && (U(this, ze, !1), Promise.resolve(typeof y(this, ve) == "function" ? y(this, ve).call(this) : y(this, ve)).then((a) => U(this, ue, a || null)).finally(() => { + y(this, Oe).forEach(([a, o, s]) => { + try { + const l = y(this, Pe).call(this, y(this, ue), ...a); + y(this, Fe).set(JSON.stringify(a), l), o(l); + } catch (l) { + s(l); + } + }), y(this, Oe).length = 0; + })); + else { + const a = y(this, Pe).call(this, y(this, ue), ...t); + y(this, Fe).set(r, a), n(a); + } + })); + U(this, Pe, n), U(this, ve, t); + } +} +Fe = new WeakMap(), ze = new WeakMap(), Oe = new WeakMap(), ue = new WeakMap(), ve = new WeakMap(), Pe = new WeakMap(); +const gr = () => u("div", { children: "Empty" }), He = x.createContext({ ele: {}, mount: () => { +}, unmount: () => { +} }), Y = ({ rootClassName: e, className: t, children: n, actions: i, title: r, subTitle: a, extras: o, style: s = {} }) => { + const { mount: l, unmount: g } = x.useContext(He); + return Y.Action({ children: i }), Y.Title({ children: r }), Y.SubTitle({ children: a }), Y.Extra({ children: o }), L(() => (l("rootClassName", e), () => g(e)), [e]), u("div", { className: I("ff-container", t), style: s, children: n }); +}, Ye = (e) => ({ children: t, className: n }) => { + const { mount: i, unmount: r } = x.useContext(He); + return L(() => (t && i(e, x.createElement("div", { key: `ff-${e}`, className: I(`ff-popup-${e}`, n) }, t)), () => r(e)), [n, t]), null; +}; +Y.Action = Ye("actions"), Y.Title = Ye("title"), Y.SubTitle = Ye("sub-title"), Y.Extra = Ye("extras"), Y.propTypes = { className: w.string, style: w.object, title: w.any, subTitle: w.any, actions: w.any, extras: w.any }; +const pr = () => u(Y, { className: "ff-loading", children: j("div", { className: "loader", children: [j("div", { className: "square", children: [u("span", {}), u("span", {}), u("span", {})] }), j("div", { className: "square", children: [u("span", {}), u("span", {}), u("span", {})] }), j("div", { className: "square", children: [u("span", {}), u("span", {}), u("span", {})] }), j("div", { className: "square", children: [u("span", {}), u("span", {}), u("span", {})] })] }) }), mr = () => u("div", { children: "NotFound" }), nn = ({ children: e }) => { + const [t, n] = O({}), i = X((a, o) => n((s) => ({ ...s, [a]: o })), []), r = X((a) => n((o) => ({ ...o, [a]: void 0 })), []); + return typeof (e == null ? void 0 : e.type) == "string" ? e : u(He.Provider, { value: { ele: t, mount: i, unmount: r }, children: x.cloneElement(e, { className: t.rootClassName, title: t.title, subTitle: t["sub-title"], actions: t.actions, extras: t.extras }) }); +}; +nn.propTypes = { children: w.element.isRequired }; +const zt = { close: ["M563.8 512l262.5-312.9c4.4-5.2 0.7-13.1-6.1-13.1h-79.8c-4.7 0-9.2 2.1-12.3 5.7L511.6 449.8 295.1 191.7c-3-3.6-7.5-5.7-12.3-5.7H203c-6.8 0-10.5 7.9-6.1 13.1L459.4 512 196.9 824.9c-4.4 5.2-0.7 13.1 6.1 13.1h79.8c4.7 0 9.2-2.1 12.3-5.7l216.5-258.1 216.5 258.1c3 3.6 7.5 5.7 12.3 5.7h79.8c6.8 0 10.5-7.9 6.1-13.1L563.8 512z"], check: ["M912 190h-69.9c-9.8 0-19.1 4.5-25.1 12.2L404.7 724.5 207 474c-6.1-7.7-15.3-12.2-25.1-12.2H112c-6.7 0-10.4 7.7-6.3 12.9l273.9 347c12.8 16.2 37.4 16.2 50.3 0l488.4-618.9c4.1-5.1 0.4-12.8-6.3-12.8z"], info: ["M512 224m-64 0a64 64 0 1 0 128 0 64 64 0 1 0-128 0Z", "M544 392h-64c-4.4 0-8 3.6-8 8v464c0 4.4 3.6 8 8 8h64c4.4 0 8-3.6 8-8V400c0-4.4-3.6-8-8-8z"] }, Nt = ({ type: e, props: t }) => u("i", { ...t, children: u("svg", { viewBox: "0 0 1024 1024", width: "1em", height: "1em", fill: "currentColor", children: (zt[e] || zt.info).map((n, i) => u("path", { d: n }, i)) }) }), rn = ({ className: e, content: t, icon: n, $close: i }) => j(x.Fragment, { children: [n && u("div", { className: I("ff-notification-icon", e), children: u(Nt, { type: n }) }), t] }), ti = ({}) => u(Y, { children: "Confirm" }); +var pe, Ee; +const ie = class ie { + constructor() { + E(this, Ee, /* @__PURE__ */ new Map()); + P(this, "init", (t) => U(this, Ee, new Map(t))); + P(this, "check", (t) => !y(this, Ee).has(t) || y(this, Ee).get(t)); + if (y(ie, pe)) return y(ie, pe); + } +}; +pe = new WeakMap(), Ee = new WeakMap(), E(ie, pe, null), P(ie, "getInstance", () => (y(ie, pe) || U(ie, pe, new ie()), y(ie, pe))); +let yt = ie; +const ni = yt.getInstance(), ii = (e, t, n = "children") => { + if (d.isEmpty(e)) return {}; + const i = d.find(e, ["value", t]); + if (!d.isEmpty(i)) return i; + const r = e.length; + for (let a = 0; a < r; a++) { + const { [n]: o } = e[a], s = ii(o, t, n); + if (!d.isEmpty(s)) return s; + } + return {}; +}, an = (e = "Input", t = "@pkg/ff/grid-layout-forms") => e != null && e.startsWith("@") || e != null && e.startsWith("blob:") ? e : `${t}/${e}`; +var me, Be; +const re = class re { + constructor() { + E(this, Be, null); + P(this, "init", (t) => U(this, Be, t)); + P(this, "get", (t, n) => d.get(y(this, Be), t, n)); + if (y(re, me)) return y(re, me); + } +}; +me = new WeakMap(), Be = new WeakMap(), E(re, me, null), P(re, "getInstance", () => (y(re, me) || U(re, me, new re()), y(re, me))); +let wt = re; +const Ie = wt.getInstance(), Bt = { null2json: (e) => Object.create(), null2array: (e) => [], null2number: (e) => 0, null2bool: (e) => !1, null2string: (e) => "", null2integer: (e) => 0, null2float: (e) => 0, string2json: (e) => e ? JSON.parse(e) : "{}", string2array: (e) => e.substr(0, 1) === "[" && e.substr(-1) === "]" ? JSON.parse(e) : e.split(","), string2number: (e) => e == "" ? 0 : +e, string2integer: (e) => e == "" ? 0 : +e, string2float: (e) => e == "" ? 0 : +e, string2bool: (e) => { + switch (`${e}`.toLowerCase()) { + case "0": + case "false": + case "[]": + case "{}": + 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" }, ee = (e, t) => { + let n = "string"; + n = Array.isArray(e) ? "array" : typeof e, d.isObject(e) && (n = "json"); + const i = `${n}2${t}`; + return Reflect.has(Bt, i) ? Bt[i](e) : e; +}, Je = (e = {}, t = {}, n = {}, i = "") => sn(e, (r, a) => a === "type" && r === "code") ? on(e, t, n, i) : ln(e, t, i), sn = (e, t = () => !1) => d.some(e, (n) => !!d.some(n, t) || (d.isEmpty(n) || !d.isPlainObject(n) && !d.isArray(n) ? void 0 : sn(n, t))), on = async (e = {}, t = {}, n = {}, i = "") => { + let r = /* @__PURE__ */ Object.create(null); + for (let a in e) { + let o; + if (Reflect.has(e[a], "type") && ["code", "field", "router", "query", "string"].includes(e[a].type)) { + const { type: s, value: l = "", default: g = i } = e[a]; + switch (s) { + case "code": + try { + o = await xe.exec(l, t, n); + } catch (c) { + console.error("getWidgetPropsData", c); + } + break; + case "field": + o = d.get(t, l) ?? d.get(t, l.substring(l.indexOf(".") + 1)); + break; + case "router": + case "query": + o = ke.getPageParams(l); + break; + case "string": + o = l; + } + o ?? (o = g); + } else o = await on(e[a], t, n, i); + d.set(r, a, o); + } + return r; +}, ln = (e = {}, t = {}, n = "") => Object.keys(e || {}).reduce((i, r) => { + if (d.isPlainObject(e[r])) { + let a; + if (Reflect.has(e[r], "type") && ["field", "router", "query", "string"].includes(e[r].type)) { + const { type: o, value: s = "", default: l = n } = e[r]; + switch (o) { + case "field": + a = d.get(t, s) ?? d.get(t, s.substring(s.indexOf(".") + 1)); + break; + case "router": + case "query": + a = ke.getPageParams(s); + break; + case "string": + a = s; + } + a ?? (a = l); + } else a = ln(e[r], t, n); + d.set(i, r, a); + } + return i; +}, {}), gt = (e, t) => e && typeof e == "object" ? Array.isArray(e) ? e.map((n) => gt(n, t)) : Object.keys(e).reduce((n, i) => (t[i] ? n[t[i]] = gt(e[i], t) : n[i] = gt(e[i], t), n), {}) : e, hr = () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (e) => { + const t = 16 * Math.random() | 0; + return (e === "x" ? t : 3 & t | 8).toString(16); +}), fr = (e) => { + var t, n; + return e ? (n = (t = e.match(/^@pkg(?:[^\/]*\/){3}(?[^\/]+)/)) == null ? void 0 : t.groups) == null ? void 0 : n.name : ""; +}, yr = (e) => { + var t, n; + return e ? (n = (t = e.match(/^@pkg(?:[^\/]*\/){2}(?[^\/]+)/)) == null ? void 0 : t.groups) == null ? void 0 : n.category : ""; +}, wr = (e) => { + var t, n; + return e ? (n = (t = e.match(/^@pkg(?:[^\/]*\/){1}(?[^\/]+)/)) == null ? void 0 : t.groups) == null ? void 0 : n.owner : ""; +}, ri = (e, t = 32, n = "auto") => { + const i = bt(e), r = n === "auto" ? "x64" : n; + if (t === 32) return ut.x86.hash32(i).toString(); + if (t === 128) return r === "x64" ? ut.x64.hash128(i) : ut.x86.hash128(i); + throw new Error("bits 只能是 32 或 128"); +}, bt = (e) => e == null ? "null" : typeof e == "string" ? e : typeof e == "number" || typeof e == "boolean" ? String(e) : typeof e == "function" ? e.toString() : Array.isArray(e) ? "[" + e.map(bt).join(",") + "]" : typeof e == "object" ? "{" + Object.keys(e).sort().map((t) => `${t}:${bt(e[t])}`).join(",") + "}" : String(e); +var tt, De, qe, nt; +const it = class it { + constructor(...t) { + E(this, De, []); + E(this, qe, (t) => { + var n; + for (let i of t) Array.isArray(i[0]) ? y(this, qe).call(this, i) : y(this, De).push(y(n = it, tt).call(n, i[0], i[1])); + }); + P(this, "toValue", async (t, n = null) => { + const i = { getValue: () => t, getRecord: () => n }; + return await y(this, De).reduce(async (r, a) => { + try { + const o = await r; + return (await a).call(i, o); + } catch (o) { + return console.error(o), r; + } + }, t); + }); + P(this, "toRender", (t, n, i = null) => x.createElement(y(this, nt), { value: t, record: n }, i)); + E(this, nt, ({ value: t, record: n, children: i }) => { + const [r, a] = O(i); + return ot(() => { + let o = !1; + return a(i), this.toValue(t, n).then((s) => ee(s, "string")).then((s) => !o && a(s)).catch((s) => !o && a(`${s}`)), () => o = !0; + }, [t, n]), r; + }); + y(this, qe).call(this, t); + } +}; +tt = new WeakMap(), De = new WeakMap(), qe = new WeakMap(), nt = new WeakMap(), E(it, tt, d.memoize((t, n) => le.getWidgetComponent(t).then((i) => { + var r; + return ((r = i.default) == null ? void 0 : r.call(i, n)) || ((a) => a); +}), (t, n) => `${t}::${ee(n, "string")}`)); +let et = it; +const ai = (e, t = {}) => H(() => e == null ? void 0 : e.map(({ widgetByJs: n, widgetByJsSetting: i, ...r }, a) => n ? { ...r, render: (o, s) => new et([n, i]).toRender(o, s, "-") } : r), [e, t]), br = (e) => { + const [t, n] = O({}); + return L(() => { + let i = !1; + return e && A.get(`/api/_/${e}`).then((r) => d.pick(r, ["uuid", "name", "code", "resource", "marginX", "marginY", "cols", "rowHeight", "primaryKey", "columns", "itemOperations", "batchOperations", "isConditionFormLayout", "layout", "tabs", "pageSize", "layoutConfig"])).then((r) => !i && n(r)), () => i = !0; + }, [e]), t; +}, Cr = (e, t = {}) => { + const [n, i] = O({ dataSource: [] }); + return Ke(() => { + let r = !1; + return e && A.get(`/api/${e}/${A.encode({ page: 1, ...t })}`).then((a) => !r && i(a)), () => r = !0; + }, [e, t]), n; +}, cn = (e = [], t = /* @__PURE__ */ new Map(), n = "id", i) => { + const r = X(i ? (a) => d.get(a, n, d.get(a, [i, n])) : (a) => d.get(a, n), [n, i]); + return X((a) => e == null ? void 0 : e.filter((o) => !o.uuid || !t.has(o.uuid) || t.get(o.uuid).some((s) => s == r(a))), [e, t, r]); +}, Ct = (e = [], t = /* @__PURE__ */ new Map(), n = [], i = "id", r) => { + const a = X(r ? (o) => d.get(o, i, d.get(o, [r, i])) : (o) => d.get(o, i), [i, r]); + return H(() => { + if (d.isEmpty(e) || !e.some(({ uuid: s }) => ni.check(s))) return !1; + if (d.isEmpty(t) || d.isEmpty(n)) return !0; + const o = n.map((s) => a(s)); + return e.some(({ uuid: s }) => !s || !t.has(s) || t.get(s).some((l) => o.some((g) => g == l))); + }, [e, n, t, a]); +}, si = (e, t, n = "id", i = null) => { + const r = st(), a = W(!1), o = W(e.dataSource), s = W(e.itemOperationsAccess); + return L(() => (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, g = null) => { + var c, p; + if (a.current = !1, l === 1) return (c = e.onReload) == null ? void 0 : c.call(e); + if (l === 2) { + const f = d.get(g, "__PARENT_ID__", ""), m = d.get(g, n, d.get(g, [i, n], "")), h = d.findIndex(o.current, ["__PARENT_ID__", f]), b = d.findIndex(h > -1 ? d.get(o.current, [h, "children"]) : o.current, [n, m]); + if (b === -1) return (p = e.onReload) == null ? void 0 : p.call(e); + Promise.all([A.get(`/api/${t}/detail/${m}`), A.post(`/api/${t}/list-operations-access`, { ids: m })]).then(([C, k]) => { + const v = d.get(o.current, h > -1 ? [h, "children", b, "children"] : [b, "children"]); + o.current = Zt(o.current, h > -1 ? { [h]: { children: { $splice: [[b, 1, { ...C, children: v }]] } } } : { $splice: [[b, 1, { ...C, children: v }]] }); + const S = new Map(k); + s.current.forEach((N, V) => { + var q; + (q = S.get(V)) != null && q.some((B) => B == m) || s.current.set(V, N.filter((B) => B !== m)); + }), S.forEach((N, V) => { + s.current.has(V) ? s.current.set(V, d.uniq([...s.current.get(V) || [], ...N])) : s.current.set(V, N); + }); + }).then(() => { + a.current = !0, r(); + }); + } + }]; +}, oi = (e, t) => { + const n = st(), i = W(t), r = W(/* @__PURE__ */ new Map()), a = W([]), o = d.throttle((l) => { + a.current = [], A.list(e, d.pick({ ...i.current, ...l }, ["tab", "page", "pageSize", "condition", "sider", "keyword"])).then(({ keyword: g, condition: c, total: p, tab: f, sider: m, page: h, pageSize: b, operationsAccess: C, dataSource: k }) => { + i.current = { tab: f, condition: c, sider: m, keyword: g, total: p, pageSize: b, page: k != null && k.length ? h : 1 }, a.current = k, r.current = new Map(C), n(); + }); + }, 380, { leading: !1, trailing: !0 }); + ot(() => { + a.current = [], e && o(t); + }, [e, t]); + const s = H(() => d.pick(i.current, ["total", "tab", "page", "pageSize", "condition", "sider", "keyword"]), [i.current]); + return Object.assign(s, { onTabChange: (l) => o({ tab: l, page: 1 }), onPageChange: (l, g) => o({ page: l, pageSize: g }), onPageSizeChange: (l) => o({ pageSize: l, page: 1 }), onConditionChange: (l, g) => o({ keyword: g, condition: Zt(i.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, payload: t == null ? void 0 : t.payload }); +}, li = ({ listCode: e, className: t, layouts: n, dataSource: i, isPaginate: r, isItemOperations: a, isBatchOperations: o, batchOperations: s, itemOperations: l, itemOperationsAccess: g, resource: c, primaryKey: p, title: f, itemGridLayout: m, $setting: h, tabs: b, isConditionFormLayout: C, isTreeSider: k, treeSiderConfig: v }) => { + const { classNames: S, onClickCallback: N } = ce(ne), V = d.pick(h, ["column", "colWidth", "beforeRender", "afterRender", "style"]), q = cn(l, g, p, c), B = X((M, R, z) => u(ci, { className: I("ff-data-list-framework-item", S.item), operations: a ? q(R) : [], data: c ? { [c]: R } : R, children: M, onClickCallback: N }), [c, p, a, N, l, g]); + return j("div", { className: I("ff-data-list-framework", t), children: [u(n.sider, { isTreeSider: k, ...v }), j("div", { className: I("ff-data-list-container", S == null ? void 0 : S.container), children: [u(n.filter, { isConditionFormLayout: C }), u(n.toolbar, { title: f, tabs: b }), u(ki, { ...V, ...m, primaryKey: p, itemRender: B, dataSource: i }), u(n.footer, { isPaginate: r, isOperations: o, operations: s })] })] }); +}, ci = ({ className: e, operations: t, children: n, data: i, onClickCallback: r }) => j("div", { className: I("data-list-grid-layout-item-container", e), children: [n, !!(t != null && t.length) && u("div", { className: "data-list-grid-layout-item-actions", children: t.map((a) => u("span", { className: "data-list-grid-layout-item-action", children: u(T.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: i, confirm: a.confirm, onAfterClick: (o) => o !== !1 && (r == null ? void 0 : r(a.isRefresh, i)) }, a.uuid || ht()) }, (a == null ? void 0 : a.uuid) || ht())) })] }), di = ({ listCode: e, className: t, layouts: n, dataSource: i, columns: r, isItemOperations: a, isBatchOperations: o, batchOperations: s, itemOperations: l, itemOperationsAccess: g, resource: c, primaryKey: p, title: f, tabs: m, isPaginate: h, isTreeSider: b, treeSiderConfig: C, isConditionFormLayout: k, ...v }) => { + const { classNames: S, onClickCallback: N } = ce(ne), V = cn(l, g, p, c), q = Ct(l, g, i, p, c); + return j("div", { className: I("ff-data-table-framework", t), children: [u(n.sider, { isTreeSider: b, ...C }), j("div", { className: I("ff-data-table-container", S == null ? void 0 : S.container), children: [u(n.filter, { isConditionFormLayout: k }), u(n.toolbar, { title: f, tabs: m }), u(fi, { ...v, primaryKey: p, className: "ff-data-table-content", columns: r, dataSource: i, operationRender: q ? (B) => { + var M; + return u("div", { className: "ff-data-table-actions", children: (M = V(B)) == null ? void 0 : M.map((R, z) => u(T.Link, { size: "small", uuid: R.uuid, type: R.type, name: R.name, widget: R.widget, widgetType: R.widgetType, widgetProps: R.widgetProps, widgetData: R.widgetData, widgetSetting: R.widgetSetting, widgetContainerProps: R.widgetContainerSetting, data: B, confirm: R.confirm, onAfterClick: ($) => $ !== !1 && (N == null ? void 0 : N(R.isRefresh, B)) }, R.uuid || z)) }); + } : null }), u(n.footer, { isPaginate: h, isOperations: o, operations: s })] })] }); +}, ne = x.createContext({ listCode: "", classNames: {}, getBase62params: (e, t) => { +}, onReload: () => { +}, onClickCallback: () => { +}, onConditionChange: () => { +}, onTabChange: () => { +}, onSiderChange: () => { +}, onKeywordChange: () => { +}, onPageChange: () => { +}, onPageSizeChange: () => { +} }), dn = (e, t, n, i, r = {}, a = 0) => { + const o = { "--grid-layout-h": `${i}`, "--grid-layout-w": `${n}`, "--grid-layout-x": `${e}`, "--grid-layout-y": `${t}`, "--grid-layout-row-height-offset": "0px" }; + return r != null && r.autoHeight ? o.height = "fit-content" : o["--grid-layout-row"] = `${i}`, 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"] = Dt(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"] = Dt(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; +}, Dt = (e, t, n, i) => `${e || 0}px ${t || 0}px ${n || 0}px ${i || 0}px`, kr = (e = "Text", t = "@pkg/ff/grid-layouts") => e != null && e.startsWith("@") || e != null && e.startsWith("blob:") ? e : `${t}/${e}`, un = ({ className: e, isConditionFormLayout: t }) => { + var f, m; + const [n, i] = O({}), { listCode: r, onKeywordChange: a, onConditionChange: o, getBase62params: s, classNames: l } = x.useContext(ne), { keyword: g, condition: c } = (s == null ? void 0 : s()) || {}, [p] = Xe.useForm(); + return L(() => { + r && t && A.get(`/api/_/${r}/list-condition-form-layout`).then(({ resource: h, marginX: b, marginY: C, rowHeight: k, cols: v, fields: S }) => { + i({ resource: h, itemMargin: [b, C], rowHeight: k, cols: v, fields: S }); + }).catch(() => i({})); + }, [r, t]), L(() => { + p.setFieldsValue({ keyword: g, ...c }); + }, [JSON.stringify([g, c])]), u("div", { className: I("ff-data-list-filter", l.filter, e), children: u(Xe, { form: p, layout: "vertical", autoComplete: "off", onFinish: ((f = n.fields) == null ? void 0 : f.length) > 1 ? (h) => o({ [n.resource]: h[n.resource] }, h.keyword) : () => { + }, onValuesChange: (h) => { + d.isEmpty(d.omit(h, ["keyword"])) || p.submit(); + }, children: ((m = n.fields) == null ? void 0 : m.length) > 1 ? u(Ft, { ...n, children: u(ui, { onReset: () => { + const { keyword: h, condition: b } = s("init") || {}; + p.setFieldsValue({ keyword: h, ...b }); + } }) }) : u("div", { className: "ff-data-list-filter-default-form ff-grid-layout-form", children: u("div", { className: "grid-layout-item", style: dn(20, 0, 5, 2), children: u(Xe.Item, { name: ["keyword"], children: u(Mn.Search, { allowClear: !0, enterButton: "搜索", placeholder: "多关键字 | 分割", onSearch: (h) => a(h) }) }) }) }) }) }); +}, ui = ({ cols: e, fields: t, onReset: n }) => { + const [i, r] = O(!1), a = H(() => t == null ? void 0 : t.toReversed().some((o) => o.y > 1 || o.x + o.w >= e - 5), [e, t]); + return j(Xe.Item, { label: " ", style: { "--item-span": 5 }, className: I("ff-data-list-filter-actions", { expanded: i }), children: [u(Ze, { onClick: n, children: "重置" }), u(Ze, { type: "primary", htmlType: "submit", children: "查询" }), a && u(T.Link, { className: "ff-data-list-filter-expanded-button", widget: () => r((o) => !o), type: "primary", name: i ? "关闭" : "展开", icon: i ? "icon-up" : "icon-down", iconPosition: "end" })] }); +}; +un.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 gi = ({ className: e, operations: t, isOperations: n, isPaginate: i }) => { + const { onPageChange: r, onPageSizeChange: a, onClickCallback: o, getBase62params: s } = x.useContext(ne), { total: l, page: g, pageSize: c } = (s == null ? void 0 : s()) || {}; + return n && !d.isEmpty(t) || i ? j("div", { className: I("ff-data-list-footer", e), children: [u("div", { className: "ff-data-list-actions", children: t == null ? void 0 : t.map((p, f) => u(T, { uuid: p.uuid, type: p.type, name: p.name, widget: p.widget, widgetType: p.widgetType, widgetProps: p.widgetProps, widgetData: p.widgetData, widgetSetting: p.widgetSetting, widgetContainerProps: p.widgetContainerSetting, onAfterClick: (m) => m !== !1 && (o == null ? void 0 : o(p.isRefresh, null)) }, p.uuid || f)) }), i && u(zn, { size: "small", total: l, pageSize: c, showSizeChanger: !1, showTotal: (p) => `第 ${g} 页 / 总共 ${p} 条`, onChange: r, onShowSizeChange: a })] }) : null; +}, pi = [{ title: "parent 1", key: "0-0", children: [{ title: "parent 1-0", key: "0-0-0", disabled: !0, children: [{ title: "leaf", key: "0-0-0-0", disableCheckbox: !0 }, { title: "leaf", key: "0-0-0-1" }] }, { title: "parent 1-1", key: "0-0-1", children: [{ title: u("span", { style: { color: "#1677ff" }, children: "sss" }), key: "0-0-1-0" }] }] }], mi = ({ className: e, width: t = 280, isTreeSider: n }) => { + const { classNames: i } = ce(ne); + return n ? u(Bn.DirectoryTree, { className: I("ff-data-list-sider", i.sider, e), style: { "--sider-width": t }, showLine: !0, showIcon: !1, treeData: pi }) : null; +}, hi = ({ className: e, title: t, tabs: n }) => { + const { getBase62params: i, onTabChange: r, onReload: a, classNames: o } = ce(ne), { tab: s } = (i == null ? void 0 : i()) || {}, [l, g] = Kn((n == null ? void 0 : n[0].value) ?? (n == null ? void 0 : n[0].code), { value: s, onChange: r }); + return j("div", { className: I("ff-data-list-toolbar", o.toolbar, e), children: [u("div", { className: "ff-data-list-title", children: t }), u(Dn, { className: "ff-data-list-tabs", itemRender: ({ label: c, code: p, value: f }) => u("span", { onClick: () => g(f ?? p), className: I("ff-data-list-tab", { active: (f ?? p) == l }), children: c }), items: n }), j("div", { className: "ff-data-list-actions", children: [u(T.Link, { icon: "icon-reload", widget: () => a() }), u(T.Link, { icon: "icon-setting" })] })] }); +}, gn = ({ isItemGridLayout: e, theme: t, themeProps: n, onClickCallback: i, onReload: r, listCode: a, total: o = 0, page: s = 0, onPageChange: l, pageSize: g = 30, onPageSizeChange: c, tab: p, onTabChange: f, keyword: m, onKeywordChange: h, condition: b, onConditionChange: C, sider: k, onSiderChange: v, layouts: S, classNames: N = {}, payload: V = {}, ...q }) => { + const [B, M] = O(), R = X(($, F) => { + const J = { tab: p, page: s, pageSize: g, keyword: m, sider: k, condition: b, total: o, payload: V }; + return $ && $ != "init" ? d.get(J, $, F) : J; + }, [JSON.stringify(b), JSON.stringify(V), p, s, g, m, k, o]), z = H(() => { + let $ = { sider: mi, filter: un, footer: gi, toolbar: hi }; + S === !1 ? $ = { sider: null, filter: null, footer: null, toolbar: null } : d.isPlainObject(S) && ($ = Object.assign({}, $, S)); + for (const F in $) if ($[F]) { + if (An($[F])) { + const J = $[F]; + $[F] = (de) => x.cloneElement(J, de); + } + } else $[F] = () => u(x.Fragment, {}); + return $; + }, [S]); + return L(() => { + t ? le.getWidgetComponent(t).then(($) => { + if (!$) throw `${t} not found`; + return $; + }).catch(($) => ({ default: () => `${$}` })).then(($) => M(x.createElement($.default, { ...q, layouts: z, $setting: n }))) : M(u(e ? li : di, { ...q, layouts: z, $setting: n })); + }, [t, n]), u(ne.Provider, { value: { classNames: N, listCode: a, onClickCallback: i, onReload: r, getBase62params: R, onPageChange: l, onPageSizeChange: c, onTabChange: f, onSiderChange: v, onKeywordChange: h, onConditionChange: C }, children: B && x.cloneElement(B, q) }); +}; +gn.propTypes = { classNames: w.exact({ sider: w.string, filter: w.string, footer: w.string, toolbar: w.string, container: w.string, content: w.string, item: w.string }), layouts: w.oneOfType([w.exact({ sider: w.oneOfType([w.elementType, w.element]), filter: w.oneOfType([w.elementType, w.element]), footer: w.oneOfType([w.elementType, w.element]), toolbar: w.oneOfType([w.elementType, w.element]) }), w.bool]) }; +var he, ge, Te, rt; +const ae = class ae { + constructor() { + E(this, ge, null); + E(this, Te, /* @__PURE__ */ new Map()); + E(this, rt, () => { + if (y(this, ge)) return y(this, ge).port.postMessage({ command: "status", data: [] }); + U(this, ge, new SharedWorker(new URL("/ff-worker/res-ws.js", self.location))), y(this, ge).port.onmessage = (t) => { + var n, i; + (n = t.data) != null && n.uuid ? y(this, Te).forEach((r, a) => { + var o; + (r == "*" || (o = r == null ? void 0 : r.includes) != null && o.call(r, t.data.uuid)) && a(t.data); + }) : ((i = t.data) == null ? void 0 : i.readyState) == WebSocket.CLOSED && A.get("/api/user-api-token").then(({ token: r, expire_at: a }) => { + y(this, ge).port.postMessage({ command: "initWs", data: [`ws${d.trimStart(A.appUrl, "http")}api/user-resource-status-ws?token=${r}`] }); + }); + }, y(this, ge).port.postMessage({ command: "status", data: [] }); + }); + P(this, "subscribe", (t, n = []) => (n ? Array.isArray(n) && n.length == 0 ? n = "*" : Array.isArray(n) || (n = [n].flat()) : n = "*", y(this, Te).set(t, n), y(this, Te).size == 1 && y(this, rt).call(this), () => this.unsubscribe(t))); + P(this, "unsubscribe", (t) => y(this, Te).delete(t)); + if (y(ae, he)) return y(ae, he); + } +}; +he = new WeakMap(), ge = new WeakMap(), Te = new WeakMap(), rt = new WeakMap(), E(ae, he, null), P(ae, "getInstance", () => (y(ae, he) || U(ae, he, new ae()), y(ae, he))); +let kt = ae; +const pn = kt.getInstance(), Rt = x.forwardRef(({ listCode: e, base62params: t, className: n, theme: i, themeProps: r, layouts: a, classNames: o }, s) => { + const [{ resource: l, primaryKey: g, batchOperations: c = [], itemOperations: p = [], columns: f = [], themeConfig: m, theme: h, isConditionFormLayout: b = !1, isTreeSider: C, treeSiderConfig: k, isItemGridLayout: v, itemGridLayout: S, title: N, isPaginate: V, tabs: q }, B] = O({ isItemGridLayout: !1, itemGridLayout: {} }), M = oi(e, t), [{ dataSource: R, itemOperationsAccess: z, condition: $, tab: F, keyword: J, page: de, total: Se, pageSize: $e, sider: Ne, onConditionChange: K, onTabChange: jt, onKeywordChange: ct, onPageChange: vn, onPageSizeChange: Pn, onSiderChange: Tn, onReload: dt, payload: $n }, At] = si(M, e, g, l), Nn = Ct(p, z, R, g), Rn = Ct(c); + L(() => { + let Q = null; + return e && A.get(`/api/_/${e}`).resp(({ data: Ge, res: On }) => { + Ge != null && Ge.isDynamicRefresh && (Q = pn.subscribe(() => dt(), On)), B(Ge); + }).catch(() => B({})), () => Q == null ? void 0 : Q(); + }, [e]), x.useImperativeHandle(s, () => ({ onReload: dt, onClickCallback: At })); + const Fn = { listCode: e, title: N, classNames: o, layouts: a, resource: l, primaryKey: g, theme: i || h, themeProps: r || m, isTreeSider: C, treeSiderConfig: k, isPaginate: V, tabs: q, isItemOperations: Nn, itemOperations: p == null ? void 0 : p.map((Q) => d.isEmpty(Q == null ? void 0 : Q.confirm) ? Q : { ...Q, confirm: Object.assign({}, Q.confirm, { getPopupContainer: () => document.body }) }), isBatchOperations: Rn, batchOperations: c, isItemGridLayout: v, columns: f, itemGridLayout: S, isConditionFormLayout: b, itemOperationsAccess: z, dataSource: R, onConditionChange: K, onTabChange: jt, onKeywordChange: ct, onPageChange: vn, onPageSizeChange: Pn, onSiderChange: Tn, condition: $, tab: F, keyword: J, page: de, total: Se, pageSize: $e, sider: Ne, payload: $n }; + return u(gn, { ...Fn, className: I("ff-data-list-helper", n), onReload: dt, onClickCallback: At }); +}), mn = (e, t, n = !0) => n !== !0 && n-- <= 0 ? [] : d.isArray(e) && !d.isEmpty(e) ? e.reduce((i, r) => (Reflect.has(r, t) && Reflect.has(r, "children") && i.push(r[t]), Reflect.has(r, "children") && !d.isEmpty(r.children) ? i.concat(mn(r.children, t, n)) : i), []) : [], fi = ({ className: e, primaryKey: t, columns: n = [], dataSource: i = [], operationRender: r, operationWidth: a = 180, ...o }) => { + const { classNames: s } = ce(ne), l = W(null), g = W(null), [c, p] = O([]), [f, m] = O({ width: 0, height: 0 }); + L(() => { + p(mn(i, t)); + }, [i, t]), Ln(() => { + const b = new ResizeObserver(() => { + var C; + m({ width: ((C = l.current) == null ? void 0 : C.nativeElement.querySelector(".ant-table-body").scrollWidth) || g.current.offsetWidth, height: g.current.offsetHeight }); + }); + return g.current && b.observe(g.current), () => { + g.current && b.unobserve(g.current); + }; + }, []); + const h = ai(n); + return u("div", { ref: g, className: I("ff-data-list-table", s.content, e), children: f.height ? u(qn, { ...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, k) => r(C, k) }] : []), dataSource: i, size: "middle", scroll: { x: "max-content", y: f.height - 50 }, pagination: !1, expandable: { defaultExpandAllRows: !0, expandRowByClick: !0, onExpandedRowsChange: p, expandedRowKeys: c } }) : null }); +}, yi = "RC_FORM_INTERNAL_HOOKS", wi = (e, { initialValue: t, initialValueLanguage: n, convertJs: i, convertJsSetting: r, type: a = "string" }, o = null) => { + const s = W(!1), l = ce(Xt), [g, c] = O(), [p, f] = O(n != "javascript" && e ? l.getFieldValue(e) : void 0), { registerWatch: m } = l.getInternalHooks(yi) || {}; + return L(() => m == null ? void 0 : m((h, b, C) => { + if (!s.current) return; + const k = d.get(b, e); + d.isEqual(k, p) || f(ee(k, a)); + }), [p]), L(() => { + n == "javascript" && t ? xe.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, n]), Ke(() => { + s.current && i && new et([i, r]).toValue(p, l.getFieldsValue(!0)).then(c).catch((h) => { + c(h), console.error("布局数据转换错误: ", h, i); + }); + }, [p, i, r]), [g ?? p, p]; +}, hn = (e, t, n = null) => H(() => { + var i; + return (i = d.sortBy(e, ["y", "x"])) == null ? void 0 : i.map(({ i: r, x: a, y: o, w: s, h: l, field: { boxStyle: g, ...c } }, p) => u("div", { className: "grid-layout-item", style: dn(a, o, s, l, g), children: u(t, { ...c, basicForm: n }) }, r ?? p)); +}, [e]), bi = ({ widget: e, widgetPrefix: t = "@pkg/ff/grid-layouts", basicForm: n, ...i }) => { + const r = e != null && e.startsWith("@") || e != null && e.startsWith("blob:") ? e : `${t}/${e}`, [a, o] = O(); + return L(() => { + r && le.getWidgetComponent(r).then(({ defaultProps: s = {}, default: l }) => ({ default: Ci(l, s, n) })).catch((s) => ({ default: () => `${s}` })).then((s) => o(x.createElement(s.default, i))); + }, [r]), a; +}, Ci = (e, t = {}, n = null) => (i) => { + const { code: r, label: a, extras: o, isVirtual: s, initialValue: l, initialValueLanguage: g, convertJs: c, convertJsSetting: p, value: f, ...m } = d.merge({}, t, i), [h, b] = wi(s ? null : r, { initialValue: l, initialValueLanguage: g, convertJs: c, convertJsSetting: p, type: (m == null ? void 0 : m.type) || "string" }, n), C = H(() => { + const S = Object.keys((t == null ? void 0 : t.extras) || {}); + return d.over([d.partialRight(d.pick, S), d.partialRight(d.omit, S)]); + }, [t == null ? void 0 : t.extras]), [k, v] = C(m); + return u(e, { ...v, value: h, rawValue: b, $setting: Object.assign({}, o, k) }); +}, fn = ({ className: e, cols: t = 12, rowHeight: n = 21, containerPadding: i = [0, 0], itemMargin: r = [4, 0], formProps: a = {}, fields: o = [], data: s, basicForm: l = null, ...g }) => { + const [c] = te.useForm(), p = hn(o, bi, l), f = H(() => [{ name: "__PROPS__", value: a }], [a]); + return Ke(() => (c.setFieldsValue(s), () => c.resetFields()), [s]), u(te, { fields: f, form: c, component: !1, children: u("div", { ...g, className: I("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": `${(i == null ? void 0 : i[0]) || 0}px`, "--grid-layout-container-padding-x": `${(i == null ? void 0 : i[1]) || 0}px`, "--grid-layout-cols": t, "--grid-layout-row-height": `${n}px` }, children: p }) }); +}, xr = (qt = fn, function({ code: e, data: t, ...n }) { + const [i, r] = O({ resource: null, cols: 12, rowHeight: 21, fields: [] }); + return L(() => { + e && A.get(`/api/_/${e}`).then((a) => r(d.pick(a, ["resource", "cols", "rowHeight", "fields"]))); + }, [e]), (i == null ? void 0 : i.resource) && u(qt, { ...n, rowHeight: i.rowHeight, cols: i.cols, fields: i.fields, data: i != null && i.resource ? { [i == null ? void 0 : i.resource]: t } : {} }); +}); +var qt; +const ki = ({ column: e = 0, colWidth: t = 0, cols: n, rowHeight: i, itemMargin: r, fields: a, primaryKey: o, dataSource: s, itemClassName: l, beforeRender: g = null, afterRender: c = null, itemRender: p = (b, C, k) => b, empty: f = u(Wn, { description: null }), className: m, style: h = {} }) => { + const { classNames: b } = ce(ne), C = H(() => u(fn, { cols: n, rowHeight: i, itemMargin: r, fields: a, className: l }), [a, n, i, r]), k = d.isEmpty(s); + return j("div", { className: I("ff-data-list-content", b.content, m), style: Object.assign({}, h, e && { "--col-num": e }, t && { "--col-width": t }), children: [g == null ? void 0 : g(s), k ? f : s.map((v, S) => { + const N = p(x.cloneElement(C, { data: v }), v, S); + return x.cloneElement(N, { key: `${(v == null ? void 0 : v[o]) ?? S}-${ri(v)}` }); + }), c == null ? void 0 : c(s)] }); +}, xi = ({ component: e, $props: t }) => { + const { base62params: n } = Je(t, {}); + return u(Y, { children: u(Rt, { listCode: e, base62params: A.decode(n) }) }); +}, Sr = () => u(yn, {}), yn = () => "Empty", Si = ({ component: e, $setting: t, $props: n }) => { + const [i, r] = O(); + L(() => { + if (!e) return r(u(yn, { description: null })); + le.getWidgetComponent(e).catch((o) => ({ default: () => `${o}` })).then((o) => x.createElement(o.default, { $setting: t })).then(r); + }, [e]); + const a = Je(n, {}); + return i ? x.cloneElement(i, a) : null; +}, vr = () => "NotFoundPage"; +var fe, Z, ye, we, We, Ue; +const se = class se { + constructor() { + E(this, Z, /* @__PURE__ */ new Map()); + E(this, ye, {}); + E(this, we, null); + P(this, "init", (t, n) => { + U(this, Z, t), U(this, ye, n); + }); + P(this, "get", (t) => (y(this, Z).has(t) || (t = Array.from(y(this, Z).keys()).find((n) => y(this, Z).get(n).uri === t)), y(this, Z).get(t) || {})); + P(this, "redirect", (t, n, i = {}) => { + const { uri: r, type: a, widgetProps: o } = this.get(t) || {}, { router: s, query: l, ...g } = n || {}, c = Object.assign({}, g, s), p = Object.assign({}, g, l); + a == "list" && (c.base62params = A.encode(c != null && c.base62params ? c.base62params : c)); + let f = _n(r || t, c); + const m = new URLSearchParams(); + for (const h in o || {}) (o == null ? void 0 : o.type) == "query" && Object.has(p, h) && m.append(h, JSON.stringify(p[h])); + return m.size > 0 && (f = `${f}?${m.toString()}`), i != null && i.isOpenWindow ? window.open(f) : y(this, we).navigate(f, { replace: !!(i != null && i.isReplaceRouteHistory) }); + }); + P(this, "getMenus", (t) => { + var n; + return ((n = y(this, ye)) == null ? void 0 : n[t]) || []; + }); + P(this, "findMenuPathByUuid", (t) => { + let n = []; + for (const i in y(this, ye)) if (n = y(this, We).call(this, y(this, ye)[i], t, [i]), n.length > 1) return n; + return n; + }); + P(this, "getMenusByRouteUuid", (t) => y(this, Ue).call(this, t, Object.values(y(this, ye)).flat())); + E(this, We, (t, n, i = []) => { + if (d.isEmpty(t)) return i; + for (const { uuid: r, children: a } of t) { + if (r == n) return i.concat(r); + if (!d.isEmpty(a)) return i.concat(r, y(this, We).call(this, a, n)); + } + return i; + }); + E(this, Ue, (t, n) => { + var r; + let i = []; + for (const a of n) a.widgetType == "redirect" && (a.uuid == t || a.widget == t ? i.push(a) : (r = a.children) != null && r.length && (i = i.concat(y(this, Ue).call(this, t, a.children)))); + return i; + }); + P(this, "getCurrentMenu", () => { + const { uuid: t } = this.getCurrentRoute() || {}; + if (!t) return; + const n = this.getMenusByRouteUuid(t); + return d.isEmpty(n) ? void 0 : n[0]; + }); + P(this, "getCurrentRoute", (t = 0) => { + var i; + const n = (i = y(this, we).state.matches[y(this, we).state.matches.length - 1 - t]) == null ? void 0 : i.route; + if (!n) return null; + for (let [r, a] of y(this, Z)) if (a.uri === n.path) return a; + return null; + }); + P(this, "getPageParams", (t) => { + var r, a, o; + let n = "", i = {}; + if (en()) i = Gn(), n = (r = Yn()) == null ? void 0 : r.search; + else { + const { location: s = {}, matches: l = [] } = ((a = y(this, we)) == null ? void 0 : a.state) || {}; + i = ((o = l[l.length - 1]) == null ? void 0 : o.params) || {}, n = s.search; + } + return n && new URLSearchParams(n).forEach((s, l) => { + i[l] = s; + }), t ? d.get(i, t) : i; + }); + P(this, "createBrowserRouter", (t = {}) => { + if (y(this, Z).size == 0) return null; + const n = Ie.get("Common.WEBSITE_DEFAULT_THEME", "@pkg/ff/frameworks/DefaultTheme"), i = Ie.get(le.checkUserToken() ? "Common.WEBSITE_LOGIN_REDIRECT" : "Common.WEBSITE_DEFAULT", "/index"), r = { [n]: 0 }, a = (s, l) => () => Promise.all([le.getWidgetComponent(s), Je(l)]).then(([g, c]) => [g.default || function() { + return `${s}`; + }, c]).then(([g, c]) => ({ Component: () => x.createElement(nn, {}, x.createElement(g, { $setting: c })) })), o = Array.from(y(this, Z).values()).reduce((s, { uuid: l, uri: g, name: c, type: p, component: f, widgetSetting: m, widgetProps: h, isLogin: b, isLayout: C, extra: k }) => { + let v = {}, S = 0; + switch (p) { + case "list": + v.element = x.createElement(xi, { component: f, $props: h }); + break; + case "fsdpf-component": + v.element = x.createElement(Si, { key: f, component: f, $setting: m, $props: h }); + } + const N = (k == null ? void 0 : k.theme) ?? (k == null ? void 0 : k.layout); + if (N) { + const V = (k == null ? void 0 : k.themeProps) ?? (k == null ? void 0 : k.layoutProps); + if (!r[N]) return r[N] = s.length, [...s, { path: "/", lazy: a(N, V), children: [{ path: g, ...v }] }]; + S = r[N]; + } + return C && S > -1 ? (s[S].children.push({ path: g, ...v }), s) : [...s, { path: g, ...v }]; + }, [{ path: "/", lazy: a(n, {}), children: [] }]); + return o.push({ index: !0, element: x.createElement(vi, { to: i, replace: !0 }) }), U(this, we, Xn(o, t)); + }); + if (y(se, fe)) return y(se, fe); + } +}; +fe = new WeakMap(), Z = new WeakMap(), ye = new WeakMap(), we = new WeakMap(), We = new WeakMap(), Ue = new WeakMap(), E(se, fe, null), P(se, "getInstance", () => (y(se, fe) || U(se, fe, new se()), y(se, fe))); +let xt = se; +const vi = ({ to: e, replace: t }) => en() ? x.createElement(Qn, { to: e, replace: t }) : (window.document.location = e, "redirect"), ke = xt.getInstance(), Re = new Worker(new URL("/ff-worker/index.js", self.location)), Wt = { getConfigure: (e) => Ie.get(e), route: { redirect: (...e) => ke.redirect(...e), getPageParams: (...e) => ke.getPageParams(...e), getCurrentRoute: () => ke.getCurrentRoute() }, popup: { notification: (...e) => G.notification(...e), success: (...e) => G.success(...e), error: (...e) => G.error(...e), form: (...e) => G.form(...e), modal: (...e) => G.modal(...e), confirm: (...e) => G.confirm(...e) } }; +var at, je, be; +const D = class D { + constructor() { + P(this, "exec", (t, n = {}, i = {}, r = "") => new Promise((a, o) => { + if (!/^(?!\s*(\/\/|\/\*|\*)).*?\S+/m.test(t)) return a(); + const s = It(D, at)._++; + y(D, je).set(s, i), D.mQueue.set(s, [a, o]), Re.postMessage({ id: s, session: r, category: "eval", method: t, args: n }); + })); + P(this, "clear", (t) => Re.postMessage({ session: t, category: "clear" })); + if (y(D, be)) return y(D, be); + Promise.resolve().then(() => Gi).then((t) => { + Wt.http = t.http; + }), Re.addEventListener("message", ({ data: { id: t, task_id: n, method: i, args: r, category: a, data: o, error: s, session: l } }) => { + if (a === "eval" && D.mQueue.has(t)) s !== null ? D.mQueue.get(t)[1](s) : D.mQueue.get(t)[0](o), y(D, je).delete(t), D.mQueue.delete(t); + else if (a === "util") try { + const g = d.get(Wt, i.split("/")) || d.get(y(D, je).get(n), i.split("/")); + if (!d.isFunction(g)) throw `${i} not found`; + Promise.resolve(Reflect.apply(g, void 0, r)).then((c) => { + Re.postMessage({ id: t, task_id: n, category: a, method: i, args: r, session: l, data: c, error: null }); + }).catch((c) => { + Re.postMessage({ id: t, task_id: n, category: a, method: i, args: r, session: l, data: null, error: c }); + }); + } catch (g) { + Re.postMessage({ id: t, task_id: n, category: a, method: i, args: r, session: l, data: null, error: g }); + } + }, !1); + } +}; +at = new WeakMap(), je = new WeakMap(), be = new WeakMap(), P(D, "mQueue", /* @__PURE__ */ new Map()), E(D, at, 0), E(D, je, /* @__PURE__ */ new Map()), E(D, be, null), P(D, "getInstance", () => (y(D, be) || U(D, be, new D()), y(D, be))); +let St = D; +const xe = St.getInstance(), st = () => { + const e = W(!0), [, t] = x.useReducer((n) => n + 1, 0); + return L(() => () => e.current = !1, []), () => e.current && t(); +}, Pr = (e) => { + const t = W(); + return L(() => { + t.current = e; + }, [e]), t.current; +}, Tr = (e) => { + const [t, n] = O(e), i = W(null), r = X((a, o) => { + i.current = o, n(a); + }, []); + return L(() => { + i.current && (i.current(t), i.current = null); + }, [t]), [t, r]; +}, Ke = (e = (i) => { +}, t, n = d.isEqual) => { + const i = x.useRef(); + n(t, i.current) || (i.current = d.cloneDeep(t)), x.useEffect(e, [i.current]); +}, ot = Ke, wn = (e, t = "string") => { + var n; + if (!Array.isArray(e)) return e; + for (let i = 0; i < e.length; i++) e[i].value = ee((n = e[i]) == null ? void 0 : n.value, t), e[i] && Reflect.has(e[i], "children") && (e[i].children = wn(e[i].children, t)); + return e; +}, $r = (e, t = "json", n = "string", i, r = null) => { + const [a] = te.useForm(i), [o, s] = O([{ label: "无", value: "", disabled: !0 }]), l = W([]), g = te.useWatch((c) => l.current.length === 0 ? null : d.pick(c, l.current), a) || null; + return L(() => { + Array.isArray(e) ? s(e) : t === "javascript" && e ? xe.exec(e, {}, { getFieldValue: (c) => (l.current.includes(c) || l.current.push(c), a.getFieldValue(c)), getFieldValueForBasicForm: (c) => (l.current.includes(c) || l.current.push(c), r ? r.getFieldValue(c) : a.getFieldValue(c)) }).then((c) => { + s(ee(c, "array")); + }).catch((c) => console.error("useOptions", c)) : e && s(ee(e, "array")); + }, [e, t, g]), wn(o, n); +}, Nr = (e) => { + const [t, n] = O(), i = { type: "GET" }; + if (typeof e == "string" ? i.url = e : d.isPlainObject(e) && Object.assign(i, e), !(i != null && i.url)) throw "url is required"; + const r = (a) => A.request(i, !1).resp((o) => (console.log("useSubscribeRequest", a), n(o), o)); + return Ke(() => { + let a = null; + return r().then((o) => { + a = pn.subscribe(d.throttle(r, 180, { leading: !1, trailing: !0 }), o.res); + }), () => a == null ? void 0 : a(); + }, i), t; +}, Pi = (e) => { + const [t, n] = x.useState({ gridItems: [], hideItems: [] }); + return x.useEffect(() => { + e && A.get(`/api/_/${e}`).then(({ pk: i, uuid: r, code: a, resource: o, align: s, cols: l, rowHeight: g, marginX: c, marginY: p, listenChangeFields: f, listenChangeFieldsFunc: m, fields: h }) => ({ pk: i, uuid: r, code: a, resource: o, align: s, cols: l, rowHeight: g, marginX: c, marginY: p, listenChangeFields: f, listenChangeFieldsFunc: m, ...h.reduce((b, C) => { + var k; + return (k = C == null ? void 0 : C.field) != null && k.hidden ? b.hides.push(C == null ? void 0 : C.field) : b.items.push(C), b; + }, { items: [], hides: [] }) })).then(n); + }, [e]), t; +}, Ti = ({ max: e = 0, min: t = 0, type: n = "", message: i, pattern: r, required: a = !1, validator: o } = {}, s, l) => { + const [g, c] = O([]); + return L(() => { + const p = []; + if (a) { + let f = l; + switch (l) { + case "number": + case "string": + case "array": + break; + case "bool": + f = "boolean"; + break; + case "json": + f = "object"; + } + p.push({ type: f, required: !0, whitespace: !0, message: "该项必填" }); + } + switch (n) { + case "string": + p.push({ type: n, max: e, min: t, message: i || (t && e ? `字符必须在 ${t} ~ ${e} 之间` : `${e ? "最多能有" : "最少要有"} ${t || e} 个字符`) }); + break; + case "pattern": + p.push({ type: "string", pattern: r, message: i }); + break; + case "validator": + o && p.push(({ getFieldValue: f }) => ({ validator: async (m, h) => { + const b = await xe.exec(o, { value: h, fieldName: s }, { getFieldValue: f }); + return d.isString(b) && b ? Promise.reject(b) : d.isBoolean(b) && !b ? Promise.reject(i) : Promise.resolve(); + } })); + } + c(p); + }, [e, t, n, i, r, a, o]), g; +}, $i = (e, t, n) => { + const [i, r] = O(null); + return L(() => { + const { initDataUri: a = `/api/${e}`, initDataMethod: o = "GET" } = n || {}; + t && A.request({ method: o, url: d.trimEnd(`${a}/${t}`, "/") }).then((s) => { + r(s); + }); + }, [e, t, n]), i; +}, Ni = (e, t, n) => X((i, r = { serialize: (a) => a, onSuccess: () => { +}, onFail: (a) => (a == null ? void 0 : a.errorFields) && G.error("请先完善表单信息", { duration: 2e3 }) }) => { + const a = i.getFieldValue("__RESOURCE__"), { submitDataUri: o = `/api/${e}`, submitDataMethod: s = "POST" } = n || {}; + return i.validateFields().then((l) => a ? d.pick(l, [a]) : l).then(r.serialize).then((l) => A.request({ method: s, url: d.trimEnd(`${o}/${t || ""}`, "/"), data: l }).msg(r.onSuccess)).catch(r.onFail); +}, [e, t, n]), bn = (e, t, n = {}, i = {}, r = {}) => { + const a = ce(Xt), o = st(), s = W(!0), l = W([]), [g, c] = O(t), [p, f] = O(), m = te.useWatch((h) => JSON.stringify(d.pick(h, l.current)), a) || "{}"; + return ot(() => { + e && xe.exec(e, n, { ...i, getFieldValueForBasicForm: (h) => r ? r.getFieldValue(h) : null, getFieldValue: d.wrap(a.getFieldValue, (h, b) => (l.current.some((C) => d.isEqual(C, b)) || (l.current.push(b), o()), h == null ? void 0 : h(b))), isFieldTouched: a.isFieldTouched, isFieldsTouched: a.isFieldsTouched }).then((h) => { + s.current && (c(h), f(null)); + }).catch((h) => { + s.current && (c(t), f(h)); + }); + }, [e, m, a, n, i]), L(() => () => s.current = !1, []), e ? [g, p] : [t, null]; +}, Ri = (e, t, n = [], i = {}) => { + const r = W({}), a = W(), o = d.debounce(st(), 180), s = ["disabled", "required"], l = (f, m) => { + s.includes(f) && (r.current[f] = m), o(); + }, g = H(() => ({ setDisabled: (f) => l("disabled", f), setRequired: (f) => l("required", f), getDisabled: () => r.current.disabled, getRequired: () => r.current.required }), [t]), [c, p] = bn(t, -1, {}, g, i); + if (!p && a.current != c && (c >= 0 || !d.isEmpty(n == null ? void 0 : n[c]))) { + a.current = c; + const { widget: f, widgetPrefix: m, props: h } = n == null ? void 0 : n[c]; + e = an(f, m), r.current = d.merge(h, d.pick(r.current, s)); + } + return [e, r.current]; +}, Ut = (e) => e === void 0 || e === !1 ? "" : (Array.isArray(e) ? e : [e]).join("_"), Rr = ({ value: e, onChange: t }, n = null) => { + const i = W(), [r] = te.useForm(n), a = W({}); + return ot(() => { + d.isEqual(i.current, e) || r.setFieldsValue(e); + }, [e]), L(() => () => r.resetFields(), []), [H(() => r.__INTERNAL__ ? r : { ...r, __INTERNAL__: { itemRef: (o) => (s) => { + const l = Ut(o); + s ? a.current[l] = s : delete a.current[l]; + } }, scrollToField: (o, s = {}) => { + console.warn("useMergedFormValuesChange scrollToField not work, unreferenced antd form"); + }, focusField: (o) => { + console.warn("useMergedFormValuesChange focusField not work, unreferenced antd form"); + }, getFieldInstance: (o) => { + const s = Ut(o); + return a.current[s]; + } }, [r]), (o, s) => { + i.current = s, t == null || t(s); + }]; +}, Fi = ({ type: e, initialValue: t, initialValueLanguage: n, onChange: i, basicForm: r }) => { + const [a, o] = bn(n == "javascript" && t, n == "javascript" ? void 0 : t, {}, {}, r); + return L(() => { + n == "javascript" ? i(ee(a, e)) : t && i(ee(t, e)); + }, [e, t, a]), null; +}, Cn = ({ widget: e = "Input", widgetPrefix: t = "@pkg/ff/grid-layout-forms", widgetDecorator: n, subWidgets: i = [], basicForm: r, ...a }) => { + const o = an(e, t), [s, l] = Ri(o, n, i, r), [g, c] = O(); + return L(() => { + s && le.getWidgetComponent(s).then(({ defaultProps: p = {}, default: f }) => ({ default: Oi(f, p, r) })).catch((p) => ({ default: () => `${p}` })).then((p) => c(x.createElement(p.default, a))); + }, [s]), g && x.cloneElement(g, { ...a, ...l }); +}, Oi = (e, t = {}, n = null) => (i) => { + const { type: r, code: a, label: o, noStyle: s, placeholder: l, required: g = !1, extras: c, validators: p, help: f, isVirtual: m, $isReserved: h, initialValue: b, initialValueLanguage: C, ...k } = d.omit(d.merge({}, t, i), ["convertJs", "convertJsSetting", "widget", "widgetPerfix", "widgetDecorator", "subWidgets", "boxStyle"]), v = Ti(Object.assign({}, p, g ? { required: !0 } : {}), a, r), S = H(() => { + const M = Object.keys((t == null ? void 0 : t.extras) || {}); + return d.over([d.partialRight(d.pick, M), d.partialRight(d.omit, M)]); + }, [t == null ? void 0 : t.extras]), [N, V] = S(k), q = { label: o, noStyle: s, colon: !1, layout: "vertical" }, B = X((M) => M == null ? void 0 : ee(M, r), [r]); + return u(Qt, { name: a, rules: v, initialValue: B(b), normalize: B, children: (M, R, z) => { + var $; + return u(e, { type: r, rcform: z, basicForm: n, itemProps: { validateStatus: R.errors.length > 0 ? "error" : "success", tooltip: f || null, help: R.errors.length > 0 ? R.errors.join("、") : null, required: (($ = v == null ? void 0 : v[0]) == null ? void 0 : $.required) || !1, ...q }, fieldProps: { placeholder: l, ...V, ...M }, $setting: Object.assign({}, c, N) }); + } }); +}, Ft = ({ cols: e = 24, rowHeight: t = 16, itemMargin: n = [8, 16], containerPadding: i = [0, 0], fields: r = [], children: a, basicForm: o = null }) => { + const s = hn(r, Cn, o); + return j("div", { className: "ff-grid-layout-form", style: { "--grid-layout-item-margin-x": `${(n == null ? void 0 : n[0]) ?? 8}px`, "--grid-layout-item-margin-y": `${(n == null ? void 0 : n[1]) ?? 16}px`, "--grid-layout-container-padding-y": `${(i == null ? void 0 : i[0]) || 0}px`, "--grid-layout-container-padding-x": `${(i == null ? void 0 : i[1]) || 0}px`, "--grid-layout-cols": e, "--grid-layout-row-height": `${t}px` }, children: [s, a && x.cloneElement(a, { cols: e, rowHeight: t, itemMargin: n, containerPadding: i, fields: r })] }); +}; +Ft.propTypes = { fields: w.array }; +const Ei = (Ht = Ft, ({ code: e, layout: t, name: n, primaryKey: i = 0, style: r = {}, formProps: a = {}, form: o, basicForm: s, isPreview: l = !1, className: g, onFinish: c, onValuesChange: p = () => { +}, ...f }) => { + const { align: m, autoComplete: h, resource: b, items: C, hides: k, rowHeight: v, marginX: S, marginY: N, cols: V, listenChangeFields: q, listenChangeFieldsFunc: B, pk: M, uuid: R } = Pi(e), [z] = te.useForm(o), $ = H(() => [{ name: "__PK__", value: M }, { name: "__PROPS__", value: a }, { name: "__RESOURCE__", value: b }, { name: "__LAYOUT_KEY__", value: e }, { name: "__LAYOUT_UUID__", value: R }, { name: "__PRIMARY_KEY__", value: i }], [M, e, R, b, i, a]); + return j(te, { className: g, name: n || e, layout: t || m, fields: $, form: z, autoComplete: h, style: { ...r, position: "relative" }, onFinish: c, onValuesChange: (F, J) => (({ changedValues: de, allValues: Se, listenChangeFields: $e, listenChangeFieldsFunc: Ne, onValuesChange: K, code: jt }) => { + K(de, Se), Ne && Array.isArray($e) && xe.exec(Ne, { changedValues: de, allValues: Se }, { getFieldValue: z.getFieldValue, setFieldValue: z.setFieldValue, setFieldsValue: z.setFieldsValue, isFieldTouched: z.isFieldTouched, isFieldsTouched: z.isFieldsTouched }).catch((ct) => console.error("onFormValuesChange", ct)); + })({ changedValues: F, allValues: J, listenChangeFields: q, listenChangeFieldsFunc: B, onValuesChange: p, code: e }), children: [u(Ht, { ...f, form: z, basicForm: s, code: e, fields: C, cols: V, rowHeight: v, itemMargin: [S, N] }), k == null ? void 0 : k.map((F) => { + var J; + return u(Qt, { name: F.code, children: u(Fi, { form: z, basicForm: s, name: F.code, type: F.type, initialValue: F.initialValue, initialValueLanguage: (J = F.extras) == null ? void 0 : J.initialValueLanguage }) }, JSON.stringify(F.code)); + })] }, e); +}); +var Ht; +const kn = ({ $setting: e, $close: t, extras: n, code: i, primaryKey: r, ...a }) => { + const [o] = te.useForm(), s = $i(i, r, e), l = Ni(i, r, e); + return L(() => { + s ? o.setFieldsValue(s) : o.resetFields(); + }, [s]), u(Y, { actions: j(x.Fragment, { children: [u(T, { name: (e == null ? void 0 : e.okText) || "保存", type: "primary", widget: () => l(o, { onSuccess: t }) }), u(T, { name: (e == null ? void 0 : e.cancelText) || "取消", widget: () => t(!1) })] }), extras: n, children: u(Ei, { form: o, code: i, primaryKey: r, ...a }) }); +}, Jt = /* @__PURE__ */ new Set(), vt = (e = [], t = 0) => { + const n = e[t]; + if (n.length && !Jt.has(n)) { + const i = document.createElement("script"); + i.setAttribute("src", n), i.setAttribute("data-namespace", n), e.length > t + 1 && (i.onload = () => { + vt(e, t + 1); + }, i.onerror = () => { + vt(e, t + 1); + }), Jt.add(n), document.body.appendChild(i); + } +}, Pt = ({ className: e, type: t, style: n = {}, ...i }) => u("span", { role: "img", className: I("ff-iconfont", e), style: n, ...i, children: u("svg", { style: { width: "1em", height: "1em", fill: "currentColor", overflow: "hidden" }, viewBox: "0 0 1024 1024", children: u("use", { xlinkHref: `#${t}` }) }) }); +Pt.propTypes = { className: w.string, type: w.string.isRequired, style: w.object }, Pt.init = vt; +const ji = (e, t, n, i) => ke.redirect(n, t, i), Ai = (e, t = {}, n, i = {}) => { + var a; + const r = (a = i.router) == null ? void 0 : a.reduce((o, [s, l, g]) => { + const c = d.get(t, ["router", s]); + if (!c && c !== 0 && l) throw `请传入 ${g}`; + return `${o}/${c}`; + }, `/api/${n}`); + return A.del(r, t.param).msg(); +}, Kt = (e, t, n, { status: { loading: i, disabled: r }, setStatus: a }) => { + const o = { loading: (s) => s === void 0 ? i : a((l) => ({ ...l, loading: s })), disabled: (s) => s === void 0 ? r : a((l) => ({ ...l, disabled: s })) }; + return d.isFunction(n) ? n.call(null, { ...t, ...o }) : d.isString(n) && n ? xe.exec(n, t, o) : null; +}, _t = (e, t, n, i, r) => d.isString(n) && n ? le.getWidgetComponent(n).then(({ default: a }) => G.modal(a, { ...t, $setting: i }, r != null && r.title ? { ...r, title: d.template(r.title)(e) } : r)).catch((a) => { + G.error(n, { content: a.toString() }); +}) : G.modal(n, { ...t, $setting: i }, r != null && r.title ? { ...r, title: d.template(r.title)(e) } : r), Li = (e, t, n, i, r) => G.modal(kn, { ...t, $setting: i, code: n }, r != null && r.title ? { ...r, title: d.template(r.title)(e) } : r), Vi = (e, t, n, i, r) => G.modal(Rt, { base62params: t, $setting: i, listCode: n }, r != null && r.title ? { ...r, title: d.template(r.title)(e) } : r), Ii = ({ widget: e, widgetType: t, widgetData: n, widgetProps: i, widgetSetting: r, widgetContainerProps: a }, { onAfterClick: o, onBeforeClick: s }) => { + const l = ce(ne), [g, c] = O({ leading: !0, trailing: !1 }), p = H(() => { + switch (t) { + case "redirect": + return d.partialRight(ji, e, r); + case "func": + return d.partialRight(Kt, (r == null ? void 0 : r.code) ?? e, { status: g, setStatus: c }); + case "component": + case "fsdpf-component": + return d.partialRight(_t, e, r, a); + case "grid-layout-form": + return d.partialRight(Li, e, r, a); + case "data-list": + return d.partialRight(Vi, e, r, a); + case "destroy": + return d.partialRight(Ai, e, r, a); + default: + if (Et(e) || x.isValidElement(e)) return d.partialRight(_t, e, r, a); + if (d.isFunction(e)) return d.partialRight(Kt, (r == null ? void 0 : r.code) || e, { status: g, setStatus: c }); + } + return (...f) => console.error("useButton unknown widgetType", t, ...f); + }, [e, t]); + return [d.debounce((f) => (s == null || s(f), Promise.resolve(Je(i, f, { list: l })).then((m) => p(f, { ...n, ...m })).then((m) => o == null ? void 0 : o(m)).catch(console.error)), 300, { leading: !0, trailing: !1 }), g]; +}, xn = ({ type: e, name: t, className: n, icon: i, iconPosition: r, size: a }, o = "default") => H(() => { + const s = { type: "primary", className: I("ff-button", n), 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 = I(s.className, "ff-default"))) : o !== "circle" && o !== "round" || (s.shape = o), i && (s.icon = u(Pt, { type: i })), t && (s.children = t), s; +}, [o, e, n, i, r]), lt = ({ data: e, widget: t, widgetType: n = "fsdpf-component", widgetData: i, widgetProps: r, widgetSetting: a, widgetContainerProps: o, onAfterClick: s, onBeforeClick: l, children: g, extras: c }) => { + const p = ce(ne), [f, m] = O(!1), [h, b] = O("hover"), [C, k] = O({}), [v, S] = O(), { placement: N, align: V, zIndex: q, arrow: B = { pointAtCenter: !0 }, getPopupContainer: M, ...R } = o || {}; + L(() => { + n == "grid-layout-form" ? S(x.createElement(kn, { ...i, $setting: a, code: t })) : n == "data-list" ? S(x.createElement(Rt, { base62params: e, $setting: a, listCode: t })) : d.isString(t) ? le.getWidgetComponent(t).then(({ default: F }) => { + S(x.createElement(F, { ...i, $setting: a })); + }).catch((F) => S(F.toString())) : Et(t) ? S(x.createElement(t, { ...i, $setting: a })) : x.isValidElement(t) && S(x.cloneElement(t, { ...i, $setting: a })); + }, [t, n, i]), L(() => { + Promise.resolve(Je(r, e, { list: p })).then(k); + }, [r, e, p.getBase62params]); + const z = (F, J = !1) => (m(F), !F && b("hover"), F ? l == null ? void 0 : l(C) : s == null ? void 0 : s(J)), $ = (F) => { + m(!0), b("click"); + }; + return u(Un, { zIndex: q, placement: N, onPopupClick: $, onClick: $, open: f, align: V, arrow: B, trigger: h, getPopupContainer: M, content: u(Mi, { ...R, extras: c, children: v && x.cloneElement(v, { ...C, $close: (F) => z(!1, F) }) }), children: g, onOpenChange: z }); +}, Mi = ({ title: e, className: t, children: n, extras: i, width: r, height: a, ...o }) => { + const [s, l] = O({}), g = X((m, h) => l((b) => ({ ...b, [m]: h })), []), c = X((m) => l((h) => ({ ...h, [m]: void 0 })), []), p = e ? x.createElement("div", { className: "ff-popup-title" }, e) : s == null ? void 0 : s.title, f = i ?? x.createElement("div", { className: "ff-popup-reserved-extras" }, i); + return u(He.Provider, { value: { ele: s, mount: g, unmount: c }, children: j("div", { className: I("ff-popup ff-popover", t, s.rootClassName), style: { width: r, height: a }, ...o, children: [j("div", { className: "ff-popup-header", children: [p, s == null ? void 0 : s["sub-title"]] }), n, j("div", { className: "ff-popup-footer", children: [f, s == null ? void 0 : s.extras, s == null ? void 0 : s.actions] })] }) }); +}; +lt.propTypes = { widgetType: w.oneOf(["fsdpf-component", "grid-layout-form", "data-list"]) }; +const _e = (e) => function({ className: t, variant: n, children: i, name: r, icon: a, type: o = "default", iconPosition: s = "start", noAuthType: l, onAfterClick: g, onBeforeClick: c, data: p, loading: f, disabled: m, tooltip: h, confirm: b, widget: C = () => { +}, widgetType: k, widgetData: v, widgetProps: S, widgetSetting: N, widgetContainerProps: V, ...q }) { + const { mode: B, ...M } = V || {}, R = xn({ className: t, name: r, type: o, icon: a, iconPosition: s }, n ?? e), z = u(Ze, { ...R, ...q, children: i || r }); + if (B === "popover" && !["destroy", "redirect", "func"].includes(k)) return u(lt, { data: p, widget: C, widgetType: k, widgetData: v, widgetProps: S, widgetSetting: N, widgetContainerProps: M, onAfterClick: g, onBeforeClick: c, children: z }); + const $ = d.isEmpty(h) || !h.enabled ? {} : h, F = d.isEmpty(b) ? { enabled: !1 } : Object.assign({ enabled: !0 }, b), [J, de] = O(!1), [Se, { disabled: $e, loading: Ne }] = Ii({ widget: C, widgetType: k, widgetData: v, widgetProps: S, widgetSetting: N, widgetContainerProps: M }, { onAfterClick: g, onBeforeClick: c }); + return u(Hn, { okText: "确定", cancelText: "取消", getPopupContainer: (K) => K, ...F, disabled: $e || m, open: J, onOpenChange: (K) => { + if (!K) return de(K); + F.enabled ? de(K) : Se(p); + }, onConfirm: (K) => { + Se(p, K); + }, onClick: (K) => { + K.stopPropagation(); + }, children: u(Jn, { getPopupContainer: (K) => K, ...$, title: J ? null : $ == null ? void 0 : $.title, trigger: ["hover", "click"], children: x.cloneElement(z, { loading: Ne || f, disabled: $e || m }) }) }); +}, T = _e("default"); +T.propTypes = { type: w.oneOf(["primary", "default", "danger", ""]), size: w.oneOf(["large", "middle", "small"]), name: w.string, icon: w.string, iconPosition: w.oneOf(["start", "end"]), data: w.any, widget: w.any, widgetType: w.oneOf(["destroy", "redirect", "func", "component", "fsdpf-component", "grid-layout-form", "grid-layout", "data-list"]), widgetData: w.object, widgetProps: w.object, widgetSetting: w.object, widgetContainerProps: w.object, tooltip: w.exact({ title: w.string.isRequired, placement: w.oneOf(["top", "left", "right", "bottom", "topLeft", "topRight", "bottomLeft", "bottomRight", "leftTop", "leftBottom", "rightTop", "rightBottom"]), enabled: w.oneOfType([w.bool, w.number]), getPopupContainer: w.func }), confirm: w.exact({ title: w.string.isRequired, cancelText: w.string, okText: w.string, okType: w.oneOf(["primary", "default", "danger", ""]), placement: w.oneOf(["top", "left", "right", "bottom", "topLeft", "topRight", "bottomLeft", "bottomRight", "leftTop", "leftBottom", "rightTop", "rightBottom"]), enabled: w.oneOfType([w.bool, w.number]), getPopupContainer: w.func, arrow: w.oneOfType([w.bool, w.exact({ pointAtCenter: w.bool })]) }) }; +const zi = _e("link"), Bi = _e("circle"), Di = _e("round"), qi = _e("dashed"), Gt = ({ options: e = [], triggerWeights: t = ["grid-layout-form", "grid-layout", "fsdpf-component", "print"], onAfterClick: n = (m, h, b) => { +}, onBeforeClick: i = (m, h, b) => { +}, labelVariant: r = "link", labelSize: a, labelRender: o, btnVariant: s, btnSize: l, btnRender: g = (m, h) => u(T, { ...m, data: h }, m.uuid || ht()), widgetContainerProps: c = {}, children: p, data: f }) => { + if (d.isEmpty(e)) return p; + const [m, h] = H(() => (e || []).reduce((C, k) => { + const v = t.indexOf(k.widgetType); + return v === -1 ? C[1].push(k) : C[0] ? v < t.indexOf(C[0].widgetType) ? (C[1].push(C[0]), C[0] = k) : C[1].push(k) : C[0] = k, C; + }, [null, []]), [e, t]); + o ? p = o(m, f) || p : p || (p = u(Ze, { ...xn(Object.assign(m != null && m.name || m != null && m.icon ? {} : { icon: "icon-location" }, m, { size: a }), r) })); + const b = h.map((C) => g(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: d.partialRight(n, C, f), onBeforeClick: d.partialRight(i, C, f) }, { size: l, variant: s }), f)); + return u(lt, { widget: m == null ? void 0 : m.widget, widgetType: m == null ? void 0 : m.widgetType, widgetProps: m == null ? void 0 : m.widgetProps, widgetSetting: m == null ? void 0 : m.widgetSetting, widgetContainerProps: Object.assign({}, c, m == null ? void 0 : m.widgetContainerProps), data: f, widgetData: m == null ? void 0 : m.widgetData, extras: b, onAfterClick: d.partialRight(n, m, f), onBeforeClick: d.partialRight(i, m, f), children: p }); +}; +Gt.propTypes = { triggerWeights: w.array, options: w.arrayOf(w.shape({ ...T.propTypes, widgetType: T.propTypes.widgetType.isRequired })), btnSize: T.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: T.propTypes.size, onAfterClick: w.func, onBeforeClick: w.func, widgetContainerProps: T.propTypes.widgetContainerProps, data: T.propTypes.data }, T.Link = zi, T.Link.defaultProps = T.defaultProps, T.Link.propTypes = T.propTypes, T.Circle = Bi, T.Circle.defaultProps = T.defaultProps, T.Circle.propTypes = T.propTypes, T.Round = Di, T.Round.defaultProps = T.defaultProps, T.Round.propTypes = T.propTypes, T.Dashed = qi, T.Dashed.defaultProps = T.defaultProps, T.Dashed.propTypes = T.propTypes, T.Popover = lt, T.GroupPopover = Gt; +const Wi = ({ fields: e, formProps: t, $close: n }) => { + const [i] = te.useForm(), r = H(() => [{ name: "__PROPS__", value: t }], [t]); + return u(Y, { actions: j(x.Fragment, { children: [u(T, { name: "取消", widget: () => n(!1) }), u(T, { name: "确定", type: "primary", widget: () => i.validateFields(!0).then(n) })] }), children: u(te, { fields: r, form: i, className: "ff-modal-form", children: e == null ? void 0 : e.map(({ code: a, ...o }) => u(Cn, { code: a, ...o }, a)) }) }); +}, Ui = ({ className: e, $close: t, children: n, title: i, subTitle: r, actions: a, extras: o, ...s }) => j(Zn, { ...s, prefixCls: "ff-drawer", className: I("ff-popup", e), maskMotion: { motionAppear: !0, motionName: "mask-motion" }, motion: (l) => ({ motionAppear: !0, motionName: `panel-motion-${l}` }), children: [j("div", { className: "ff-popup-header", children: [u("button", { "aria-label": "Close", className: "ff-popup-close", onClick: s.onClose, children: u(Nt, { type: "close" }) }), i, r] }), u("div", { className: "ff-popup-body", children: n }), j("div", { className: "ff-popup-footer", children: [o, a] })] }), Hi = ({ className: e, $close: t, $event: n, children: i, title: r, subTitle: a, actions: o, extras: s, placement: l, ...g }) => { + const c = (n == null ? void 0 : n.pageX) === void 0 ? { animation: null, maskAnimation: null, mousePosition: { x: null, y: null } } : { animation: "zoom", maskAnimation: "fade", mousePosition: { x: n == null ? void 0 : n.pageX, y: n == null ? void 0 : n.pageY } }; + return u(ei, { ...g, ...c, prefixCls: "ff-modal", modalRender: () => j("div", { className: I("ff-modal-content ff-popup", e), children: [j("div", { className: "ff-popup-header", children: [u("button", { "aria-label": "Close", className: "ff-popup-close", onClick: g.onClose, children: u(Nt, { type: "close" }) }), r, a] }), u("div", { className: "ff-popup-body", children: i }), j("div", { className: "ff-popup-footer", children: [s, o] })] }) }); +}, Sn = ({ placement: e, $close: t, $event: n, children: i, title: r, ...a }) => { + const [o, s] = O({}), [l, g] = O(!0), c = X((h, b) => s((C) => ({ ...C, [h]: b })), []), p = X((h) => s((b) => ({ ...b, [h]: void 0 })), []); + let f = { ...a, className: o.rootClassName, title: o.title || r && x.createElement("div", { className: I("ff-popup-title") }, r), subTitle: o["sub-title"], actions: o.actions, extras: o.extras, children: i, $close: t, $event: n, onClose: () => g(!1) }; + const m = () => { + t(!1); + }; + return u(He.Provider, { value: { ele: o, mount: c, unmount: p }, children: e && e !== "center" ? u(Ui, { ...f, placement: e, open: l, afterOpenChange: (h) => !h && m() }) : u(Hi, { ...f, visible: l, afterClose: m }) }); +}; +Sn.propTypes = { placement: w.oneOf(["center", "left", "top", "right", "bottom"]) }; +const _ = () => { + const [e, t] = Vn({ 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" }), [, n] = x.useReducer((a) => a + 1, 0); + L(() => { + _.$onClick = i, _.$queue.forEach(([a, o, s], l, g) => { + r([o, s], ...a), delete g[l]; + }); + }, []); + const i = (a, o = {}, s = {}) => new Promise((l, g) => r([l, g], a, o, s)), r = ([a, o], s, l = {}, g = {}) => { + const c = _.$index++, p = (f) => ((m, h) => (_.$popups.delete(m), n(), h == null ? void 0 : h()))(c, () => a(f)); + if (s === rn) return e.open({ ...g, key: c, content: x.createElement(s, { ...l, $close: () => e.close(c) }) }); + _.$popups.set(c, x.createElement(Sn, { maskClosable: !1, $event: l == null ? void 0 : l.$event, ...g, key: c, $close: p }, x.isValidElement(s) ? x.cloneElement(s, { ...l, $close: p }) : s != null && s.name || Mt.isForwardRef(s) || (s == null ? void 0 : s.$$typeof) === Mt.ForwardRef ? x.createElement(s, { ...l, $close: p }) : s)), n(); + }; + return j(x.Fragment, { children: [Array.from(_.$popups).map(([a, o]) => o), t] }); +}; +_.$popups = /* @__PURE__ */ new Map(), _.$index = 0, _.$queue = [], _.$onClick = (...e) => new Promise((t, n) => { + _.$queue.push([e, t, n]); +}); +const Yt = (e, t, n = {}) => _.$onClick(e, t, n), pt = (e, { showProgress: t, duration: n, ...i } = { duration: 1.5 }) => _.$onClick(rn, { content: e, ...i }, { showProgress: t, duration: n }), G = { modal: Yt, confirm: (e, t = {}) => _.$onClick(ti, { content: e, ...t }, { placement: "center" }), form: (e, t = {}, n = {}) => Yt(Wi, { formProps: n, fields: e }, { placement: "center", ...t }).then((i) => { + if (i === !1) throw !1; + return i; +}), notification: pt, success: (e, t = { duration: 1.5 }) => pt(e, { ...t, className: "ff-notification-success", icon: "check" }), error: (e, t = { duration: 1.5 }) => pt(e, { ...t, className: "ff-notification-error", icon: "close" }) }; +Le.configure({ showSpinner: !1 }), Ve.interceptors.request.use((e) => { + e.headers.Platform = "web", e.headers.SaaS = window.localStorage.getItem("SaaS"); + const t = window.localStorage.getItem(Qe); + return e.headers.Authorization = t ? `Bearer ${t} ` : void 0, Le.inc(), e; +}, (e) => (Le.done(), Promise.reject({ code: -1, msg: e }))), Ve.interceptors.response.use(({ data: e, headers: t }) => (Le.done(), { ...e, res: t == null ? void 0 : t.res }), function(e) { + return Le.done(), Promise.reject(e.message); +}), window.addEventListener("unhandledrejection", ft.onUnhandledRejection), ft.onMsg = (e, t) => G[[0, 1].includes(e) ? "success" : "error"](t).then(() => e === 20300 && ke.redirect(Ie.get("Common.WEBSITE_LOGIN_PAGE"))); +const Tt = { appUrl: "", init: (e, t, n) => { + Tt.appUrl = n, Ve.defaults.baseURL = n, Ve.defaults.timeout = 15e3, Object.assign(Tt, new ft(e, t, Ve)); +} }, A = Tt; +class Ot extends Error { + constructor(t, n) { + super(n), Error.captureStackTrace && Error.captureStackTrace(this, Ot), !n instanceof Me && (this.name = `${t} Error Runtime`); + } +} +class Me extends Error { + constructor(t, ...n) { + super(...n), Error.captureStackTrace && Error.captureStackTrace(this, Me), this.name = `${t} Not Found`; + } +} +const mt = "mine", Qe = "token"; +var Ce, Ae; +const oe = class oe { + constructor() { + E(this, Ae, /* @__PURE__ */ new Map()); + P(this, "setVendor", (t, n) => y(this, Ae).set(t, new tn(n, async (i, r) => { + var o, s; + if (!(i != null && i.default)) throw "@pkg not found"; + let a = () => r; + switch ("function") { + case typeof (a = (o = i.default) == null ? void 0 : o[`./${r}/index.jsx`]): + case typeof (a = (s = i.default) == null ? void 0 : s[`./${r}/index.js`]): + return a(); + } + throw new Me(r); + }))); + P(this, "getWidgetComponent", async (t) => { + if (!t) throw "getWidgetComponent widget is required"; + if (t != null && t.startsWith("blob:") || t != null && t.startsWith("http:") || t != null && t.startsWith("https:")) return await import(t); + const [, n] = t == null ? void 0 : t.split("@pkg/"); + if (!n) throw new Me(t); + try { + return y(this, Ae).has("pkg") ? await y(this, Ae).get("pkg").get(n) : await import(`${A.appUrl}/api/pkg-import/web?name=${t}`); + } catch (i) { + throw new Ot(t, i); + } + }); + P(this, "getRoutes", () => A.get("/api/my-router").then((t) => [...t, { uuid: "data-list-setting", isLayout: !0, uri: "/data-list-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/ff-design/components/DataListSetting", extra: { layout: "@pkg/ff-design/frameworks/DesignTheme" } }, { uuid: "grid-layout-setting", isLayout: !0, uri: "/grid-layout-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/ff-design/components/GridLayoutSetting", extra: { layout: "@pkg/ff-design/frameworks/DesignTheme" } }, { uuid: "grid-layout-form-setting", isLayout: !0, uri: "/grid-layout-form-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/ff-design/components/GridLayoutFormSetting", extra: { layout: "@pkg/ff-design/frameworks/DesignTheme" } }, { uuid: "resource-api-setting", isLayout: !0, uri: "/resource-api-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/ff-design/components/ResourceApiSetting", extra: { layout: "@pkg/ff-design/frameworks/DesignTheme" } }, { uuid: "charts-setting", isLayout: !0, uri: "/resource-api-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/ff-design/components/ChartsSetting", extra: { layout: "@pkg/ff-design/frameworks/DesignTheme" } }, { uuid: "fsm-setting", isLayout: !0, uri: "/fsm-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/ff-design/components/FsmSetting", extra: { layout: "@pkg/ff-design/frameworks/DesignTheme" } }, { uuid: "component-setting", isLayout: !0, uri: "/component-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/ff-design/components/ComponentSetting", extra: { layout: "@pkg/ff-design/frameworks/DesignTheme" } }, { uuid: "login", uri: "/login", name: "登录", type: "fsdpf-component", isLogin: !1, component: "@pkg/ff/components/Login" }, { uuid: "not-found", uri: "*", name: "Not Found", type: "fsdpf-component", isLogin: !1, component: "@pkg/ff/components/NotFound" }].map(({ uuid: n, ...i }) => [n, { uuid: n, ...i }])).then((t) => new Map(t))); + P(this, "getMenus", () => A.get("/api/my-menu")); + P(this, "getConfigure", () => A.get("api/init-configure")); + P(this, "getWidgetOperationAuth", () => A.get("/api/init-widget-operation-auth").then((t) => t.reduce((n, { uuid: i, auth: r }) => [...n, [i, r]], []))); + P(this, "getPhoneNumber", (t) => A.get(`/api/user-wx-phone-number/${t}`)); + P(this, "getUserToken", () => { + const t = window.localStorage.getItem(Qe); + if (!t) return ""; + const n = t.split("."); + if (!Array.isArray(n) || n.length !== 3) throw "登录令牌无效!"; + const { iat: i } = JSON.parse(window.atob(n[1])); + if (Math.floor((/* @__PURE__ */ new Date()).getTime() / 1e3) - i > 2592e3) throw "登录令牌已过期, 请重新登录!"; + return t; + }); + P(this, "checkUserToken", () => { + try { + return !!this.getUserToken(); + } catch { + return !1; + } + }); + P(this, "getUserInfo", (t = !0) => { + var n; + try { + const i = this.getUserToken(); + if (!i) return Promise.resolve(null); + const { iat: r } = JSON.parse(window.atob((n = i == null ? void 0 : i.split(".")) == null ? void 0 : n[1])), { iat: a, ...o } = A.decode(window.localStorage.getItem(mt) || "", {}); + return a === r ? Promise.resolve(o) : A.get("/api/mine-info").then(({ User: s = null }) => (window.localStorage.setItem(mt, A.encode({ ...s, iat: r })), s)); + } catch (i) { + console.error(i), t && G.error("请登录").then(this.logout); + } + return Promise.resolve(null); + }); + P(this, "login", (t, n, i = {}) => A.post("/api/user-token", { username: t, passwd: In.hash(n), platform: "web", ...i }).then(({ token: r }) => (window.localStorage.setItem(Qe, r), r))); + P(this, "logout", (t) => (window.localStorage.removeItem(mt), window.localStorage.removeItem(Qe), t == null ? void 0 : t())); + if (y(oe, Ce)) return y(oe, Ce); + } +}; +Ce = new WeakMap(), Ae = new WeakMap(), E(oe, Ce, null), P(oe, "getInstance", () => (y(oe, Ce) || U(oe, Ce, new oe()), y(oe, Ce))); +let $t = oe; +const le = $t.getInstance(), Ji = x.createContext({ user: {}, initUser: () => { +}, initUserComplete: !1 }), Ki = x.createContext({ set: () => { +}, get: () => { +}, assign: () => { +}, currentRoute: () => { +} }), Et = (e) => !!(e != null && e.name) && (e.prototype instanceof x.Component || /^[A-Z]/.test(e.name)), _i = (e, t) => { + if (!e || typeof window > "u") return; + let n = document.querySelector(`style[ff-style-token="${t}"]`); + return n ? (n.innerHTML = e, e) : (n = document.createElement("style"), n.setAttribute("ff-style-token", t), n.setAttribute("type", "text/css"), n.innerHTML = e, document.head.appendChild(n), e); +}, Gi = Object.freeze(Object.defineProperty({ __proto__: null, AppContext: Ji, AppGlobalParamsContext: Ki, cache: tn, configure: Ie, default: le, func: xe, http: A, insertStyle: _i, isReactComponent: Et, route: ke }, Symbol.toStringTag, { value: "Module" })); +export { + Cn as $, + ki as A, + li as B, + di as C, + et as D, + ai as E, + br as F, + xr as G, + yi as H, + Cr as I, + cn as J, + Ct as K, + si as L, + oi as M, + xi as N, + Si as O, + Sr as P, + vr as Q, + pn as R, + st as S, + Pr as T, + Tr as U, + Ke as V, + ot as W, + $r as X, + Nr as Y, + Ei as Z, + Ft as _, + an as a, + kn as a0, + Pi as a1, + Ti as a2, + $i as a3, + Ni as a4, + bn as a5, + Ri as a6, + Rr as a7, + Pt as a8, + T as a9, + ni as aa, + Ii as ab, + Y as ac, + He as ad, + nn as ae, + _ as af, + G as ag, + gr as ah, + pr as ai, + mr as aj, + le as ak, + Et as al, + _i as am, + A as an, + tn as ao, + Ie as ap, + xe as aq, + ke as ar, + Ji as as, + Ki as at, + Je as b, + fr as c, + sn as d, + yr as e, + wr as f, + ii as g, + ri as h, + dn as i, + kr as j, + mn as k, + fn as l, + bi as m, + wi as n, + hn as o, + gn as p, + un as q, + gt as r, + hi as s, + ee as t, + hr as u, + mi as v, + gi as w, + Rt as x, + ne as y, + fi as z +}; diff --git a/dist/components.js b/dist/components.js index a1c42cf..e9c5c58 100644 --- a/dist/components.js +++ b/dist/components.js @@ -1,4 +1,4 @@ -import { ag as s, a7 as p, ah as n, ai as t, af as d } from "./common/main-BgoRXiKU.js"; +import { ah as s, a8 as p, ai as n, aj as t, ag as d } from "./common/main-DdIS_WOJ.js"; export { s as Empty, p as Icon, diff --git a/dist/container.js b/dist/container.js index 85f98b3..b5e96e4 100644 --- a/dist/container.js +++ b/dist/container.js @@ -1,4 +1,4 @@ -import { ac as o, ag as s, ah as d, ai as p, ad as t, af as n, ae as r, ab as u } from "./common/main-BgoRXiKU.js"; +import { ad as o, ah as s, ai as d, aj as p, ae as t, ag as n, af as r, ac as u } from "./common/main-DdIS_WOJ.js"; export { o as Context, s as Empty, diff --git a/dist/data-converter.js b/dist/data-converter.js index 498f270..a3eb6e5 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-BgoRXiKU.js"; +import { D as p } from "./common/main-DdIS_WOJ.js"; export { p as default }; diff --git a/dist/data-list.js b/dist/data-list.js index 4d8cd99..cd6179a 100644 --- a/dist/data-list.js +++ b/dist/data-list.js @@ -1,4 +1,4 @@ -import { A as t, y as e, q as r, w as o, B as i, x as u, v as D, z as l, s as L, C as n, p, E as m, M as C, I as c, K as F, J as b, L as d, F as k } from "./common/main-BgoRXiKU.js"; +import { A as t, y as e, q as r, w as o, B as i, x as u, v as D, z as l, s as L, C as n, p, E as m, M as C, I as c, K as F, J as b, L as d, F as k } from "./common/main-DdIS_WOJ.js"; export { t as DataListContent, e as DataListContext, diff --git a/dist/data-list/utils.js b/dist/data-list/utils.js index 85c010a..0647b71 100644 --- a/dist/data-list/utils.js +++ b/dist/data-list/utils.js @@ -1,5 +1,5 @@ import "lodash"; -import { k as a } from "../common/main-BgoRXiKU.js"; +import { k as a } from "../common/main-DdIS_WOJ.js"; export { a as getDefaultExpandRowKeys }; diff --git a/dist/grid-layout-form.js b/dist/grid-layout-form.js index 34a3e25..55c8a4a 100644 --- a/dist/grid-layout-form.js +++ b/dist/grid-layout-form.js @@ -1,13 +1,14 @@ -import { _ as s, a0 as r, $ as u, Z as o, a4 as t, a3 as d, a6 as m, a2 as F, a1 as i, a5 as g } from "./common/main-BgoRXiKU.js"; +import { _ as s, a0 as r, $ as u, Z as o, a5 as t, a3 as m, a4 as d, a7 as F, a2 as i, a1 as g, a6 as l } from "./common/main-DdIS_WOJ.js"; export { s as GridLayoutForm, r as GridLayoutFormHelper, u as GridLayoutFormWidget, o as default, t as useFnRun, - d as useFormData, - m as useMergedFormValuesChange, - F as useRules, - i as useStructure, - g as useWidgetDecorator + m as useFormData, + d as useFormSubmit, + F as useMergedFormValuesChange, + i as useRules, + g as useStructure, + l as useWidgetDecorator }; diff --git a/dist/grid-layout-form/utils.js b/dist/grid-layout-form/utils.js index 9bf1acd..2443ca6 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-BgoRXiKU.js"; +import { g as o, a as g } from "../common/main-DdIS_WOJ.js"; export { o as getOptionItemByValue, g as getWidgetByNormalize diff --git a/dist/grid-layout.js b/dist/grid-layout.js index fc09e1c..82cf68e 100644 --- a/dist/grid-layout.js +++ b/dist/grid-layout.js @@ -1,4 +1,4 @@ -import { l as d, m as e, H as i, G as o, n as t, o as u } from "./common/main-BgoRXiKU.js"; +import { l as d, m as e, H as i, G as o, n as t, o as u } from "./common/main-DdIS_WOJ.js"; export { d as GridLayout, e as GridLayoutWidget, diff --git a/dist/grid-layout/utils.js b/dist/grid-layout/utils.js index 70d016a..49dd320 100644 --- a/dist/grid-layout/utils.js +++ b/dist/grid-layout/utils.js @@ -1,4 +1,4 @@ -import { i as o, j as a } from "../common/main-BgoRXiKU.js"; +import { i as o, j as a } from "../common/main-DdIS_WOJ.js"; export { o as getBoxStyle, a as getWidgetByNormalize diff --git a/dist/hooks.js b/dist/hooks.js index 30a3ce6..3830fab 100644 --- a/dist/hooks.js +++ b/dist/hooks.js @@ -1,7 +1,7 @@ import "lodash"; import "rc-field-form"; import "react"; -import { W as r, V as o, X as p, T as f, U as i, Y as m, S as c } from "./common/main-BgoRXiKU.js"; +import { W as r, V as o, X as p, T as f, U as i, Y as m, S as c } from "./common/main-DdIS_WOJ.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 93329e6..540576c 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 { a7 as a } from "./common/main-BgoRXiKU.js"; +import { a8 as a } from "./common/main-DdIS_WOJ.js"; export { a as default }; diff --git a/dist/index.js b/dist/index.js index 58b2490..ed3f37c 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1,4 +1,4 @@ -import { ar as t, as as e, an as o, ao as n, aj as p, ap as r, am as c, al as l, ak as f, aq as m } from "./common/main-BgoRXiKU.js"; +import { as as t, at as e, ao as o, ap as n, ak as p, aq as r, an as c, am as l, al as f, ar as m } from "./common/main-DdIS_WOJ.js"; export { t as AppContext, e as AppGlobalParamsContext, diff --git a/dist/pages.js b/dist/pages.js index 6a2f033..b2e57ea 100644 --- a/dist/pages.js +++ b/dist/pages.js @@ -1,4 +1,4 @@ -import { O as t, N as e, P as o, Q as P } from "./common/main-BgoRXiKU.js"; +import { O as t, N as e, P as o, Q as P } from "./common/main-DdIS_WOJ.js"; export { t as CustomPage, e as DataListPage, diff --git a/dist/res-ws.js b/dist/res-ws.js index 5d4ef54..61c08c2 100644 --- a/dist/res-ws.js +++ b/dist/res-ws.js @@ -1,5 +1,5 @@ import "lodash"; -import { R as a } from "./common/main-BgoRXiKU.js"; +import { R as a } from "./common/main-DdIS_WOJ.js"; export { a as default }; diff --git a/dist/utils.js b/dist/utils.js index e4f626b..9696efe 100644 --- a/dist/utils.js +++ b/dist/utils.js @@ -1,5 +1,5 @@ import "lodash"; -import { d as r, e as g, c as o, f as i, b as m, h as p, r as P, t as d, u as h } from "./common/main-BgoRXiKU.js"; +import { d as r, e as g, c as o, f as i, b as m, h as p, r as P, t as d, u as h } from "./common/main-DdIS_WOJ.js"; import "./common/vender-CtjyT19B.js"; export { r as deepSome, diff --git a/package.json b/package.json index bfab8ed..dcd9b3c 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "ff", "private": true, - "version": "0.5.13", + "version": "0.5.15", "author": "www.fsdpf.com", "type": "module", "main": "./dist/index.js",