From 9d4fc692f0981bd476988e3e4ade5aeaf23a5f40 Mon Sep 17 00:00:00 2001 From: what Date: Fri, 6 Feb 2026 11:43:41 +0800 Subject: [PATCH] v0.6.23 --- dist/button.js | 2 +- dist/common/main-C0CYfBDd.js | 1456 ------------------------------- dist/common/main-D7to3RZo.js | 1470 ++++++++++++++++++++++++++++++++ dist/components.js | 2 +- dist/container.js | 2 +- dist/data-converter.js | 2 +- dist/data-list.js | 2 +- dist/data-list/utils.js | 2 +- dist/grid-layout-form.js | 2 +- dist/grid-layout-form/utils.js | 2 +- dist/grid-layout.js | 2 +- dist/grid-layout/utils.js | 2 +- dist/hooks.js | 2 +- dist/iconfont.js | 2 +- dist/index.js | 2 +- dist/pages.js | 2 +- dist/res-ws.js | 2 +- dist/utils.js | 2 +- dist/virtual-fs.js | 2 +- package.json | 2 +- 20 files changed, 1488 insertions(+), 1474 deletions(-) delete mode 100644 dist/common/main-C0CYfBDd.js create mode 100644 dist/common/main-D7to3RZo.js diff --git a/dist/button.js b/dist/button.js index 0a93e47..72e37cf 100644 --- a/dist/button.js +++ b/dist/button.js @@ -1,4 +1,4 @@ -import { aj as s, ai as u, ak as e } from "./common/main-C0CYfBDd.js"; +import { aj as s, ai as u, ak as e } from "./common/main-D7to3RZo.js"; export { s as auth, u as default, diff --git a/dist/common/main-C0CYfBDd.js b/dist/common/main-C0CYfBDd.js deleted file mode 100644 index 822c17f..0000000 --- a/dist/common/main-C0CYfBDd.js +++ /dev/null @@ -1,1456 +0,0 @@ -var Zn = Object.defineProperty; -var en = (t) => { - throw TypeError(t); -}; -var ei = (t, e, n) => e in t ? Zn(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n; -var P = (t, e, n) => ei(t, typeof e != "symbol" ? e + "" : e, n), tn = (t, e, n) => e.has(t) || en("Cannot " + n); -var c = (t, e, n) => (tn(t, e, "read from private field"), n ? n.call(t) : e.get(t)), x = (t, e, n) => e.has(t) ? en("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, n), B = (t, e, n, i) => (tn(t, e, "write to private field"), i ? i.call(t, n) : e.set(t, n), n); -var nn = (t, e, n, i) => ({ - set _(r) { - B(t, e, r, n); - }, - get _() { - return c(t, e, i); - } -}); -import { jsx as h, jsxs as F } from "react/jsx-runtime"; -import E, { useEffect as V, useState as L, useCallback as X, useRef as _, useContext as le, useMemo as q, useId as Ft, isValidElement as ti, useLayoutEffect as ni } from "react"; -import ce from "pathe"; -import b from "prop-types"; -import O from "classnames"; -import * as rn from "react-is"; -import { useNotification as ii } from "rc-notification"; -import m from "lodash"; -import ne, { Field as qt, FieldContext as yn } from "rc-field-form"; -import { M as Nt, N as qe, a as Ke, _ as At, S as ri } from "./vender-FNiQWFaA.js"; -import wn from "immutability-helper"; -import { Space as ai, Form as gt, Input as oi, Button as mt, Pagination as si, Tree as li, Breadcrumb as ci, Table as di, Empty as ui, Popover as pi, Popconfirm as gi, Tooltip as hi } from "antd"; -import { useMergedState as mi } from "rc-util"; -import { generatePath as fi, useInRouterContext as bn, useParams as yi, useLocation as wi, createBrowserRouter as bi, Navigate as Ci } from "react-router-dom"; -import "rc-util/lib/hooks/useMergedState"; -import ki from "rc-drawer"; -import Ei from "rc-dialog"; -var Me, He, De, ye, Fe, Ae; -class Cn { - constructor(e, n) { - x(this, Me, /* @__PURE__ */ new Map()); - x(this, He, !0); - x(this, De, []); - x(this, ye); - x(this, Fe, () => c(this, ye)); - x(this, Ae, () => Promise.resolve()); - P(this, "get", (...e) => new Promise((n, i) => { - const r = JSON.stringify(e); - if (c(this, Me).has(r)) return n(c(this, Ae).call(this, c(this, ye), ...e)); - if (c(this, ye) === void 0) c(this, De).push([e, n, i]), c(this, He) && (B(this, He, !1), Promise.resolve(typeof c(this, Fe) == "function" ? c(this, Fe).call(this) : c(this, Fe)).then((a) => B(this, ye, a || null)).finally(() => { - c(this, De).forEach(([a, o, s]) => { - try { - const l = c(this, Ae).call(this, c(this, ye), ...a); - c(this, Me).set(JSON.stringify(a), l), o(l); - } catch (l) { - s(l); - } - }), c(this, De).length = 0; - })); - else { - const a = c(this, Ae).call(this, c(this, ye), ...e); - c(this, Me).set(r, a), n(a); - } - })); - B(this, Ae, n), B(this, Fe, e); - } -} -Me = new WeakMap(), He = new WeakMap(), De = new WeakMap(), ye = new WeakMap(), Fe = new WeakMap(), Ae = new WeakMap(); -const Ur = () => h("div", { children: "Empty" }), rt = E.createContext({ ele: {}, mount: () => { -}, unmount: () => { -} }), G = ({ rootClassName: t, className: e, children: n, actions: i, title: r, subTitle: a, extras: o, style: s = {} }) => { - const { mount: l, unmount: u } = E.useContext(rt); - return G.Action({ children: i }), G.Title({ children: r }), G.SubTitle({ children: a }), G.Extra({ children: o }), V(() => (l("rootClassName", t), () => u(t)), [t]), h("div", { className: O("ff-container", e), style: s, children: n }); -}, pt = (t) => ({ children: e, className: n }) => { - const { mount: i, unmount: r } = E.useContext(rt); - return V(() => (e && i(t, E.createElement("div", { key: `ff-${t}`, className: O(`ff-popup-${t}`, n) }, e)), () => r(t)), [n, e]), null; -}; -G.Action = pt("actions"), G.Title = pt("title"), G.SubTitle = pt("sub-title"), G.Extra = pt("extras"), G.propTypes = { className: b.string, style: b.object, title: b.any, subTitle: b.any, actions: b.any, extras: b.any }; -const qr = () => h(G, { className: "ff-loading", children: F("div", { className: "loader", children: [F("div", { className: "square", children: [h("span", {}), h("span", {}), h("span", {})] }), F("div", { className: "square", children: [h("span", {}), h("span", {}), h("span", {})] }), F("div", { className: "square", children: [h("span", {}), h("span", {}), h("span", {})] }), F("div", { className: "square", children: [h("span", {}), h("span", {}), h("span", {})] })] }) }), Kr = () => h("div", { children: "NotFound" }), kn = ({ children: t }) => { - const [e, n] = L({}), i = X((a, o) => n((s) => ({ ...s, [a]: o })), []), r = X((a) => n((o) => ({ ...o, [a]: void 0 })), []); - return typeof (t == null ? void 0 : t.type) == "string" ? t : h(rt.Provider, { value: { ele: e, mount: i, unmount: r }, children: E.cloneElement(t, { className: e.rootClassName, title: e.title, subTitle: e["sub-title"], actions: e.actions, extras: e.extras }) }); -}; -kn.propTypes = { children: b.element.isRequired }; -const an = { 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"] }, Kt = ({ type: t, props: e }) => h("i", { ...e, children: h("svg", { viewBox: "0 0 1024 1024", width: "1em", height: "1em", fill: "currentColor", children: (an[t] || an.info).map((n, i) => h("path", { d: n }, i)) }) }), En = ({ className: t, content: e, icon: n, $close: i }) => F(E.Fragment, { children: [n && h("div", { className: O("ff-notification-icon", t), children: h(Kt, { type: n }) }), e] }), $i = ({}) => h(G, { children: "Confirm" }); -var $e, ze; -const de = class de { - constructor() { - x(this, ze, /* @__PURE__ */ new Map()); - P(this, "init", (e) => B(this, ze, new Map(e))); - P(this, "check", (e) => !c(this, ze).has(e) || c(this, ze).get(e)); - if (c(de, $e)) return c(de, $e); - } -}; -$e = new WeakMap(), ze = new WeakMap(), x(de, $e, null), P(de, "getInstance", () => (c(de, $e) || B(de, $e, new de()), c(de, $e))); -let Lt = de; -const $n = Lt.getInstance(), vi = (t, e, n = "children") => { - if (m.isEmpty(t)) return {}; - const i = m.find(t, ["value", e]); - if (!m.isEmpty(i)) return i; - const r = t.length; - for (let a = 0; a < r; a++) { - const { [n]: o } = t[a], s = vi(o, e, n); - if (!m.isEmpty(s)) return s; - } - return {}; -}, vn = (t = "Input", e = "@pkg/ff/grid-layout-forms") => t != null && t.startsWith("@") || t != null && t.startsWith("blob:") ? t : `${e}/${t}`; -var ve, Je; -const ue = class ue { - constructor() { - x(this, Je, null); - P(this, "init", (e) => B(this, Je, e)); - P(this, "get", (e, n) => m.get(c(this, Je), e, n)); - if (c(ue, ve)) return c(ue, ve); - } -}; -ve = new WeakMap(), Je = new WeakMap(), x(ue, ve, null), P(ue, "getInstance", () => (c(ue, ve) || B(ue, ve, new ue()), c(ue, ve))); -let jt = ue; -const Ie = jt.getInstance(), on = { null2json: (t) => Object.create(), null2array: (t) => [], null2number: (t) => 0, null2bool: (t) => !1, null2string: (t) => "", null2integer: (t) => 0, null2float: (t) => 0, string2json: (t) => t ? JSON.parse(t) : "{}", string2array: (t) => t.substr(0, 1) === "[" && t.substr(-1) === "]" ? JSON.parse(t) : t.split(","), string2number: (t) => t == "" ? 0 : +t, string2integer: (t) => t == "" ? 0 : +t, string2float: (t) => t == "" ? 0 : +t, string2bool: (t) => { - switch (`${t}`.toLowerCase()) { - case "0": - case "false": - case "[]": - case "{}": - return !1; - } - return !!t; -}, string2string: (t) => t, json2json: (t) => t, json2array: (t) => t ? Object.values(t) : [], json2number: (t) => Object.keys(t).length, json2integer: (t) => Object.keys(t).length, json2float: (t) => Object.keys(t).length, json2bool: (t) => Object.keys(t).length > 0, json2string: (t) => t ? JSON.stringify(t) : "", array2json: (t) => ({ ...t }), array2array: (t) => t, array2number: (t) => t.length, array2integer: (t) => t.length, array2float: (t) => t.length, array2bool: (t) => t.length > 0, array2string: (t) => JSON.stringify(t), number2json: (t) => ({}), number2array: (t) => [t], number2number: (t) => t, number2integer: (t) => t, number2float: (t) => t, number2bool: (t) => !!t, number2string: (t) => t.toString(), boolean2json: (t) => ({}), boolean2array: (t) => [], boolean2number: (t) => +t, boolean2integer: (t) => +t, boolean2float: (t) => +t, boolean2bool: (t) => t, boolean2string: (t) => t ? "true" : "false" }, oe = (t, e) => { - let n = "string"; - n = Array.isArray(t) ? "array" : typeof t, m.isObject(t) && (n = "json"); - const i = `${n}2${e}`; - return Reflect.has(on, i) ? on[i](t) : t; -}, Si = (t) => t === null ? "null" : Array.isArray(t) ? "array" : typeof t == "object" ? "json" : typeof t == "boolean" ? "bool" : typeof t == "string" ? "string" : typeof t == "number" ? Number.isInteger(t) ? "integer" : "float" : typeof t, at = (t = {}, e = {}, n = {}, i = "") => Sn(t, (r, a) => a === "type" && r === "code") ? xn(t, e, n, i) : Pn(t, e, i), Sn = (t, e = () => !1) => m.some(t, (n) => !!m.some(n, e) || (m.isEmpty(n) || !m.isPlainObject(n) && !m.isArray(n) ? void 0 : Sn(n, e))), xn = async (t = {}, e = {}, n = {}, i = "") => { - let r = /* @__PURE__ */ Object.create(null); - for (let a in t) { - let o; - if (Reflect.has(t[a], "type") && ["code", "field", "router", "query", "string"].includes(t[a].type)) { - const { type: s, value: l = "", default: u = i } = t[a]; - switch (s) { - case "code": - try { - o = await Re.exec(l, e, n); - } catch (d) { - console.error("getWidgetPropsData", d); - } - break; - case "field": - o = m.get(e, l) ?? m.get(e, 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 xn(t[a], e, n, i); - m.set(r, a, o); - } - return r; -}, Pn = (t = {}, e = {}, n = "") => Object.keys(t || {}).reduce((i, r) => { - if (m.isPlainObject(t[r])) { - let a; - if (Reflect.has(t[r], "type") && ["field", "router", "query", "string"].includes(t[r].type)) { - const { type: o, value: s = "", default: l = n } = t[r]; - switch (o) { - case "field": - a = m.get(e, s) ?? m.get(e, s.substring(s.indexOf(".") + 1)); - break; - case "router": - case "query": - a = ke.getPageParams(s); - break; - case "string": - a = s; - } - a ?? (a = l); - } else a = Pn(t[r], e, n); - m.set(i, r, a); - } - return i; -}, {}), Tt = (t, e) => t && typeof t == "object" ? Array.isArray(t) ? t.map((n) => Tt(n, e)) : Object.keys(t).reduce((n, i) => (e[i] ? n[e[i]] = Tt(t[i], e) : n[i] = Tt(t[i], e), n), {}) : t, _r = () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (t) => { - const e = 16 * Math.random() | 0; - return (t === "x" ? e : 3 & e | 8).toString(16); -}), Hr = (t) => { - var e, n; - return t ? (n = (e = t.match(/^@pkg(?:[^\/]*\/){3}(?[^\/]+)/)) == null ? void 0 : e.groups) == null ? void 0 : n.name : ""; -}, Jr = (t) => { - var e, n; - return t ? (n = (e = t.match(/^@pkg(?:[^\/]*\/){2}(?[^\/]+)/)) == null ? void 0 : e.groups) == null ? void 0 : n.category : ""; -}, Yr = (t) => { - var e, n; - return t ? (n = (e = t.match(/^@pkg(?:[^\/]*\/){1}(?[^\/]+)/)) == null ? void 0 : e.groups) == null ? void 0 : n.owner : ""; -}, xi = (t, e = 32, n = "auto") => { - const i = It(t), r = n === "auto" ? "x64" : n; - if (e === 32) return Nt.x86.hash32(i).toString(); - if (e === 128) return r === "x64" ? Nt.x64.hash128(i) : Nt.x86.hash128(i); - throw new Error("bits 只能是 32 或 128"); -}, It = (t) => t == null ? "null" : typeof t == "string" ? t : typeof t == "number" || typeof t == "boolean" ? String(t) : typeof t == "function" ? t.toString() : Array.isArray(t) ? "[" + t.map(It).join(",") + "]" : typeof t == "object" ? "{" + Object.keys(t).sort().map((e) => `${e}:${It(t[e])}`).join(",") + "}" : String(t), Pi = () => { - let t = 1; - const e = /* @__PURE__ */ new WeakMap(), n = /* @__PURE__ */ new Map(); - return (...i) => i.length === 0 ? "" : i.map((r) => { - return String((a = r) === null || typeof a != "object" && typeof a != "function" ? (n.has(a) || n.set(a, t++), n.get(a)) : (e.has(a) || e.set(a, t++), e.get(a))); - var a; - }).join("::"); -}, Ni = (t) => { - if (!t || typeof t != "string" || t.startsWith("/") || t.startsWith("./") || t.startsWith("../")) return !1; - try { - let e = t.startsWith("//") ? `http:${t}` : t; - return e.includes("://") || e.startsWith("//") || (e = `http://${e}`), !!new URL(e).hostname; - } catch { - return !1; - } -}, Gr = (t, e = "") => { - if (!t || typeof t != "string" || Ni(t)) return t; - let n = e; - return !n && typeof window < "u" && window.location && (n = `${window.location.protocol}//${window.location.host}`), t.startsWith("/") ? n ? `${n}${t}` : t : n ? `${n}/${t}` : t; -}; -var wt, Ye, Ge, bt; -const Ct = class Ct { - constructor(...e) { - x(this, Ye, []); - x(this, Ge, (e) => { - var n; - for (let i of e) Array.isArray(i[0]) ? c(this, Ge).call(this, i) : c(this, Ye).push(c(n = Ct, wt).call(n, i[0], i[1])); - }); - P(this, "toValue", async (e, n = null) => { - const i = { getValue: () => e, getRecord: () => n }; - let r = e; - for (const a of c(this, Ye)) try { - const o = await a; - if (typeof o != "function") { - console.warn("middleware is not a function, skip:", o); - continue; - } - r = await o.call(i, r); - } catch (o) { - console.error("middleware error, skip:", o); - } - return r; - }); - P(this, "toRender", (e, n, i = null) => E.createElement(c(this, bt), { value: e, record: n }, i)); - x(this, bt, ({ value: e, record: n, children: i }) => { - const [r, a] = L(i); - return st(() => { - let o = !1; - return a(i), this.toValue(e, n).then((s) => !o && a(s)).catch((s) => !o && a(`${s}`)), () => o = !0; - }, [e, n]), r; - }); - c(this, Ge).call(this, e); - } -}; -wt = new WeakMap(), Ye = new WeakMap(), Ge = new WeakMap(), bt = new WeakMap(), x(Ct, wt, m.memoize((e, n) => { - if (typeof e == "function") return e(n); - if (typeof e == "string") return se.getWidgetComponent(e).then((i) => { - var r; - return ((r = i.default) == null ? void 0 : r.call(i, n)) || ((a) => a); - }); - throw new TypeError("middleware must be a string or a function"); -}, Pi())); -let ft = Ct; -const ie = E.createContext({ listCode: "", classNames: {}, getBase62params: (t, e) => { -}, onReload: () => { -}, onClickCallback: () => { -}, onConditionChange: () => { -}, onTabChange: () => { -}, onSiderChange: () => { -}, onKeywordChange: () => { -}, onPageChange: () => { -}, onPageSizeChange: () => { -}, reload: () => { -}, setPage: () => { -}, setPageSize: () => { -}, setTab: () => { -}, setSider: () => { -}, setKeyword: () => { -}, setCondition: () => { -} }), sn = ({ className: t, record: e, column: n, ...i }) => { - if (n != null && n.editableByJs && (n != null && n.uuid)) { - const { formSetting: r = { primaryKey: "id" }, widgetSetting: a = {}, widgetContainerSetting: o = {} } = (n == null ? void 0 : n.editableByJsSetting) || {}; - return h(N.Popover, { widget: Ti, widgetData: { record: e, column: n }, widgetSetting: { widgetSetting: a, formSetting: r }, widgetContainerProps: { title: n != null && n.title ? `${n.title} - 编辑` : "编辑", ...o, width: (o == null ? void 0 : o.width) || 260, arrow: !0 }, children: h("td", { className: O("ff-data-list-cell-editable", t), ...i }) }); - } - return h("td", { className: t, ...i }); -}, Ti = ({ record: t, column: e, $close: n, $setting: i }) => { - const r = _(Si(m.get(t, e == null ? void 0 : e.dataIndex))), { listCode: a, onClickCallback: o } = le(ie), [s] = ne.useForm(), { formSetting: l, widgetSetting: u } = i, d = (l == null ? void 0 : l.primaryKey) || "id", p = () => { - s.setFieldsValue({ value: m.get(t, e == null ? void 0 : e.dataIndex), __PROPS__: t }); - }; - return st(() => p(), [t, e == null ? void 0 : e.dataIndex, a]), h(G, { actions: F(E.Fragment, { children: [h(N, { size: "small", onClick: p, children: "重置" }), F(ai.Compact, { block: !0, children: [h(N, { size: "small", widget: n, children: "取消" }), h(N, { type: "primary", size: "small", widget: () => s.validateFields().then(({ value: f }) => { - const g = m.get(t, d.substring(d.indexOf(".") + 1)); - if (!g) throw "获取更新主键失败!"; - I.put(`/api/${a}-storeBy-${e == null ? void 0 : e.uuid}/${g}`, { value: f }).msg(() => o(2, t)).then(n); - }).catch(console.warn), children: "保存" })] })] }), children: F(ne, { form: s, children: [h(Jt, { label: "", type: r.current, code: "value", widget: e == null ? void 0 : e.editableByJs, extras: u }), h(qt, { noStyle: !0, name: ["__PROPS__"], children: () => { - } })] }) }); -}, Oi = (t) => function(e) { - return t(e, getRecord()); -}, Ri = (t, e = {}) => q(() => { - var n; - return (n = t == null ? void 0 : t.filter(Boolean)) == null ? void 0 : n.map(({ widgetByJs: i, widgetByJsSetting: r, ...a }, o) => { - const s = (u) => ({ record: u, column: a }); - let l = []; - return i && l.push([i, r]), l.length > 0 ? (a != null && a.render && l.push([Oi, a.render]), { ...a, onCell: s, render: (u, d) => new ft(l).toRender(u, d, "-") }) : { ...a, onCell: s }; - }); -}, [t, e]), Fi = (t = {}) => q(() => { - var e; - return t.body ?? (t.body = { cell: sn }), (e = t.body).cell ?? (e.cell = sn), t; -}, [t]), Xr = (t) => { - const [e, n] = L({}); - return V(() => { - let i = !1; - return t && I.get(`/api/_/${t}`).then((r) => m.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; - }, [t]), e; -}, Qr = (t, e = {}) => { - const [n, i] = L({ dataSource: [] }); - return ot(() => { - let r = !1; - return t && I.get(`/api/${t}/${I.encode({ page: 1, ...e })}`).then((a) => !r && i(a)), () => r = !0; - }, [t, e]), n; -}, Nn = (t = [], e = /* @__PURE__ */ new Map(), n = "id", i) => { - const r = X(i ? (a) => m.get(a, n, m.get(a, [i, n])) : (a) => m.get(a, n), [n, i]); - return X((a) => t == null ? void 0 : t.filter((o) => !o.uuid || !e.has(o.uuid) || e.get(o.uuid).some((s) => s == r(a))), [t, e, r]); -}, Vt = (t = [], e = /* @__PURE__ */ new Map(), n = [], i = "id", r) => { - const a = X(r ? (o) => m.get(o, i, m.get(o, [r, i])) : (o) => m.get(o, i), [i, r]); - return q(() => { - if (m.isEmpty(t) || !t.some(({ uuid: s }) => $n.check(s))) return !1; - if (m.isEmpty(e) || m.isEmpty(n)) return !0; - const o = n.map((s) => a(s)); - return t.some(({ uuid: s }) => !s || !e.has(s) || e.get(s).some((l) => o.some((u) => u == l))); - }, [t, n, e, a]); -}, Ai = (t, e, n = "id", i = null) => { - const r = vt(), a = _(!1), o = _(t.dataSource), s = _(t.itemOperationsAccess); - return V(() => (o.current = t.dataSource, s.current = t.itemOperationsAccess, () => a.current = !1), [t.dataSource, t.itemOperationsAccess]), a.current && (t.dataSource = o.current, t.itemOperationsAccess = s.current), [t, (l = 0, u = null) => { - var d, p; - if (a.current = !1, l === 1) return (d = t.onReload) == null ? void 0 : d.call(t); - if (l === 2) { - const f = m.get(u, "__PARENT_ID__", ""), g = m.get(u, n, m.get(u, [i, n], "")), y = m.findIndex(o.current, ["__PARENT_ID__", f]), w = m.findIndex(y > -1 ? m.get(o.current, [y, "children"]) : o.current, [n, g]); - if (w === -1) return (p = t.onReload) == null ? void 0 : p.call(t); - Promise.all([I.get(`/api/${e}/detail/${g}`), I.post(`/api/${e}/list-operations-access`, { ids: g })]).then(([C, k]) => { - const v = m.get(o.current, y > -1 ? [y, "children", w, "children"] : [w, "children"]); - o.current = wn(o.current, y > -1 ? { [y]: { children: { $splice: [[w, 1, { ...C, children: v }]] } } } : { $splice: [[w, 1, { ...C, children: v }]] }); - const $ = new Map(k); - s.current.forEach((T, R) => { - var A; - (A = $.get(R)) != null && A.some((M) => M == g) || s.current.set(R, T.filter((M) => M !== g)); - }), $.forEach((T, R) => { - s.current.has(R) ? s.current.set(R, m.uniq([...s.current.get(R) || [], ...T])) : s.current.set(R, T); - }); - }).then(() => { - a.current = !0, r(); - }); - } - }]; -}, Li = (t, e) => { - const n = vt(), i = _(e), r = _(/* @__PURE__ */ new Map()), a = _([]), o = m.throttle((l) => { - a.current = [], I.list(t, m.pick({ ...i.current, ...l }, ["tab", "page", "pageSize", "condition", "sider", "keyword"])).then(({ keyword: u, condition: d, total: p, tab: f, sider: g, page: y, pageSize: w, operationsAccess: C, dataSource: k }) => { - i.current = { tab: f, condition: d, sider: g, keyword: u, total: p, pageSize: w, page: k != null && k.length ? y : 1 }, a.current = k, r.current = new Map(C), n(); - }); - }, 380, { leading: !1, trailing: !0 }); - st(() => { - a.current = [], t && o(e); - }, [t, e]); - const s = q(() => m.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, u) => o({ page: l, pageSize: u }), onPageSizeChange: (l) => o({ pageSize: l, page: 1 }), onConditionChange: (l, u) => o({ keyword: u, condition: wn(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: e == null ? void 0 : e.payload }); -}, ji = ({ listCode: t, className: e, layouts: n = {}, dataSource: i, isPaginate: r, isItemOperations: a, isBatchOperations: o, batchOperations: s, itemOperations: l, itemOperationsAccess: u, resource: d, primaryKey: p, title: f, itemGridLayout: g, $setting: y, tabs: w, isConditionFormLayout: C, isTreeSider: k, treeSiderConfig: v }) => { - const { classNames: $, onClickCallback: T } = le(ie), R = m.pick(y, ["column", "colWidth", "beforeRender", "afterRender", "style"]), A = Nn(l, u, p, d), M = X((D, j, z) => h(Ii, { className: O("ff-data-list-framework-item", $.item), operations: a ? A(j) : [], data: d ? { [d]: j } : j, children: D, onClickCallback: T }), [d, p, a, T, l, u]); - return F("div", { className: O("ff-data-list-framework", e), children: [h(n.sider, { isTreeSider: k, ...v }), F("div", { className: O("ff-data-list-container", $ == null ? void 0 : $.container), children: [h(n.filter, { isConditionFormLayout: C }), h(n.toolbar, { title: f, tabs: w }), h(Yi, { ...R, ...g, primaryKey: p, itemRender: M, dataSource: i }), h(n.footer, { isPaginate: r, isOperations: o, operations: s })] })] }); -}, Ii = ({ className: t, operations: e, children: n, data: i, onClickCallback: r }) => F("div", { className: O("data-list-grid-layout-item", t), children: [h("div", { className: "data-list-grid-layout-item-container", children: n }), !!(e != null && e.length) && h("div", { className: "data-list-grid-layout-item-actions", children: e.map((a) => h("span", { className: "data-list-grid-layout-item-action", children: h(N.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 || Ft()) }, (a == null ? void 0 : a.uuid) || Ft())) })] }), Vi = ({ listCode: t, className: e, layouts: n = {}, dataSource: i, columns: r, isItemOperations: a, isBatchOperations: o, batchOperations: s, itemOperations: l, itemOperationsAccess: u, resource: d, primaryKey: p, title: f, tabs: g, isPaginate: y, isTreeSider: w, treeSiderConfig: C, isConditionFormLayout: k, ...v }) => { - const { classNames: $, onClickCallback: T } = le(ie), R = Nn(l, u, p, d), A = Vt(l, u, i, p, d); - return F("div", { className: O("ff-data-table-framework", e), children: [h(n.sider, { isTreeSider: w, ...C }), F("div", { className: O("ff-data-table-container", $ == null ? void 0 : $.container), children: [h(n.filter, { isConditionFormLayout: k }), h(n.toolbar, { title: f, tabs: g }), h(Ui, { ...v, primaryKey: p, className: "ff-data-table-content", columns: r, dataSource: i, operationRender: A ? (M) => { - var D; - return h("div", { className: "ff-data-table-actions", children: (D = R(M)) == null ? void 0 : D.map((j, z) => h(N.Link, { size: "small", uuid: j.uuid, type: j.type, name: j.name, widget: j.widget, widgetType: j.widgetType, widgetProps: j.widgetProps, widgetData: j.widgetData, widgetSetting: j.widgetSetting, widgetContainerProps: j.widgetContainerSetting, data: M, confirm: j.confirm, onAfterClick: (S) => S !== !1 && (T == null ? void 0 : T(j.isRefresh, M)) }, j.uuid || z)) }); - } : null }), h(n.footer, { isPaginate: y, isOperations: o, operations: s })] })] }); -}, _t = (t = [], e, n = null) => { - var i; - return (i = m.sortBy(t, ["y", "x"])) == null ? void 0 : i.map(({ i: r, x: a, y: o, w: s, h: l, field: { boxStyle: u, ...d } = {} }, p) => h("div", { className: "grid-layout-item", style: Tn(a, o, s, l, u), children: h(e, { ...d, basicForm: n }) }, r ?? p)); -}, Tn = (t, e, n, i, r = {}, a = 0) => { - const o = { "--grid-layout-h": `${i}`, "--grid-layout-w": `${n}`, "--grid-layout-x": `${t}`, "--grid-layout-y": `${e}`, "--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"] = ln(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"] = ln(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; -}, ln = (t, e, n, i) => `${t || 0}px ${e || 0}px ${n || 0}px ${i || 0}px`, Zr = (t = "Text", e = "@pkg/ff/grid-layouts") => t != null && t.startsWith("@") || t != null && t.startsWith("blob:") ? t : `${e}/${t}`, On = ({ className: t, isConditionFormLayout: e }) => { - var f, g; - const [n, i] = L({}), { listCode: r, onKeywordChange: a, onConditionChange: o, getBase62params: s, classNames: l } = E.useContext(ie), { keyword: u, condition: d } = (s == null ? void 0 : s()) || {}, [p] = gt.useForm(); - return V(() => { - r && e && I.get(`/api/_/${r}/list-condition-form-layout`).then(({ resource: y, marginX: w, marginY: C, rowHeight: k, cols: v, fields: $ }) => { - i({ resource: y, itemMargin: [w, C], rowHeight: k, cols: v, fields: $ }); - }).catch(() => i({})); - }, [r, e]), V(() => { - p.setFieldsValue({ keyword: u, ...d }); - }, [JSON.stringify([u, d])]), h("div", { className: O("ff-data-list-filter", l.filter, t), children: h(gt, { form: p, layout: "vertical", autoComplete: "off", onFinish: ((f = n.fields) == null ? void 0 : f.length) > 1 ? (y) => o({ [n.resource]: y[n.resource] }, y.keyword) : () => { - }, onValuesChange: (y) => { - m.isEmpty(m.omit(y, ["keyword"])) || p.submit(); - }, children: ((g = n.fields) == null ? void 0 : g.length) > 1 ? h(Yt, { ...n, children: h(Mi, { onReset: () => { - const { keyword: y, condition: w } = s("init") || {}; - p.setFieldsValue({ keyword: y, ...w }); - } }) }) : h("div", { className: "ff-data-list-filter-default-form ff-grid-layout-form", children: h("div", { className: "grid-layout-item", style: Tn(20, 0, 5, 2), children: h(gt.Item, { name: ["keyword"], children: h(oi.Search, { allowClear: !0, enterButton: "搜索", placeholder: "多关键字 | 分割", onSearch: (y) => a(y) }) }) }) }) }) }); -}, Mi = ({ cols: t, fields: e, onReset: n }) => { - const [i, r] = L(!1), a = q(() => e == null ? void 0 : e.toReversed().some((o) => o.y > 1 || o.x + o.w >= t - 5), [t, e]); - return F(gt.Item, { label: " ", style: { "--item-span": 5 }, className: O("ff-data-list-filter-actions", { expanded: i }), children: [h(mt, { onClick: n, children: "重置" }), h(mt, { type: "primary", htmlType: "submit", children: "查询" }), a && h(N.Link, { className: "ff-data-list-filter-expanded-button", widget: () => r((o) => !o), type: "primary", name: i ? "关闭" : "展开", icon: i ? "icon-up" : "icon-down", iconPosition: "end" })] }); -}; -On.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 Di = ({ className: t, operations: e, isOperations: n, isPaginate: i }) => { - const { onPageChange: r, onPageSizeChange: a, onClickCallback: o, getBase62params: s } = E.useContext(ie), { total: l, page: u, pageSize: d } = (s == null ? void 0 : s()) || {}; - return n && !m.isEmpty(e) || i ? F("div", { className: O("ff-data-list-footer", t), children: [h("div", { className: "ff-data-list-actions", children: e == null ? void 0 : e.map((p, f) => h(N, { uuid: p.uuid, type: p.type, name: p.name, widget: p.widget, widgetType: p.widgetType, widgetProps: p.widgetProps, widgetData: p.widgetData, widgetSetting: p.widgetSetting, widgetContainerProps: p.widgetContainerSetting, onAfterClick: (g) => g !== !1 && (o == null ? void 0 : o(p.isRefresh, null)) }, p.uuid || f)) }), i && h(si, { size: "small", total: l, pageSize: d, showSizeChanger: !1, showTotal: (p) => `第 ${u} 页 / 总共 ${p} 条`, onChange: r, onShowSizeChange: a })] }) : null; -}, zi = [{ title: "parent 1", key: "0-0", children: [{ title: "parent 1-0", key: "0-0-0", disabled: !0, children: [{ title: "leaf", key: "0-0-0-0", disableCheckbox: !0 }, { title: "leaf", key: "0-0-0-1" }] }, { title: "parent 1-1", key: "0-0-1", children: [{ title: h("span", { style: { color: "#1677ff" }, children: "sss" }), key: "0-0-1-0" }] }] }], Wi = ({ className: t, width: e = 280, isTreeSider: n }) => { - const { classNames: i } = le(ie); - return n ? h(li.DirectoryTree, { className: O("ff-data-list-sider", i.sider, t), style: { "--sider-width": e }, showLine: !0, showIcon: !1, treeData: zi }) : null; -}, Bi = ({ className: t, title: e, tabs: n }) => { - const { getBase62params: i, onTabChange: r, onReload: a, classNames: o } = le(ie), { tab: s } = (i == null ? void 0 : i()) || {}, [l, u] = mi((n == null ? void 0 : n[0].value) ?? (n == null ? void 0 : n[0].code), { value: s, onChange: r }); - return F("div", { className: O("ff-data-list-toolbar", o.toolbar, t), children: [h("div", { className: "ff-data-list-title", children: e }), h(ci, { className: "ff-data-list-tabs", itemRender: ({ label: d, code: p, value: f }) => h("span", { onClick: () => u(f ?? p), className: O("ff-data-list-tab", { active: (f ?? p) == l }), children: d }), items: n }), F("div", { className: "ff-data-list-actions", children: [h(N.Link, { icon: "icon-reload", widget: () => a() }), h(N.Link, { icon: "icon-setting" })] })] }); -}, Rn = ({ isItemGridLayout: t, theme: e, themeProps: n, onClickCallback: i, onReload: r, listCode: a, total: o = 0, page: s = 0, onPageChange: l, pageSize: u = 30, onPageSizeChange: d, tab: p, onTabChange: f, keyword: g, onKeywordChange: y, condition: w, onConditionChange: C, sider: k, onSiderChange: v, layouts: $, classNames: T = {}, payload: R = {}, ...A }) => { - const [M, D] = L(), j = X((S, K) => { - const W = { tab: p, page: s, pageSize: u, keyword: g, sider: k, condition: w, total: o, payload: R }; - return S && S != "init" ? m.get(W, S, K) : W; - }, [JSON.stringify(w), JSON.stringify(R), p, s, u, g, k, o]), z = q(() => { - let S = { sider: Wi, filter: On, footer: Di, toolbar: Bi }; - $ === !1 ? S = { sider: null, filter: null, footer: null, toolbar: null } : m.isPlainObject($) && (S = Object.assign({}, S, $)); - for (const K in S) if (S[K]) { - if (ti(S[K])) { - const W = S[K]; - S[K] = (Ee) => E.cloneElement(W, Ee); - } - } else S[K] = () => h(E.Fragment, {}); - return S; - }, [$]); - return V(() => { - e ? se.getWidgetComponent(e).then((S) => { - if (!S) throw `${e} not found`; - return S; - }).catch((S) => ({ default: () => `${S}` })).then((S) => D(E.createElement(S.default, { ...A, layouts: z, $setting: n }))) : D(h(t ? ji : Vi, { ...A, layouts: z, $setting: n })); - }, [e, n]), h(ie.Provider, { value: { classNames: T, listCode: a, onClickCallback: i, onReload: r, getBase62params: j, onPageChange: l, onPageSizeChange: d, onTabChange: f, onSiderChange: v, onKeywordChange: y, onConditionChange: C, setPage: l, setPageSize: d, setTab: f, setSider: v, setKeyword: y, setCondition: C }, children: M && E.cloneElement(M, A) }); -}; -Rn.propTypes = { classNames: b.exact({ sider: b.string, filter: b.string, footer: b.string, toolbar: b.string, container: b.string, content: b.string, item: b.string }), layouts: b.oneOfType([b.exact({ sider: b.oneOfType([b.elementType, b.element]), filter: b.oneOfType([b.elementType, b.element]), footer: b.oneOfType([b.elementType, b.element]), toolbar: b.oneOfType([b.elementType, b.element]) }), b.bool]) }; -var Se, we, Le, kt; -const pe = class pe { - constructor() { - x(this, we, null); - x(this, Le, /* @__PURE__ */ new Map()); - x(this, kt, () => { - if (c(this, we)) return c(this, we).port.postMessage({ command: "status", data: [] }); - B(this, we, new SharedWorker(new URL("/ff-worker/res-ws.js", self.location))), c(this, we).port.onmessage = (e) => { - var n, i; - (n = e.data) != null && n.uuid ? c(this, Le).forEach((r, a) => { - var o; - (r == "*" || (o = r == null ? void 0 : r.includes) != null && o.call(r, e.data.uuid)) && a(e.data); - }) : ((i = e.data) == null ? void 0 : i.readyState) == WebSocket.CLOSED && I.get("/api/user-api-token").then(({ token: r, expire_at: a }) => { - c(this, we).port.postMessage({ command: "initWs", data: [`ws${m.trimStart(I.appUrl, "http")}api/user-resource-status-ws?token=${r}`] }); - }); - }, c(this, we).port.postMessage({ command: "status", data: [] }); - }); - P(this, "subscribe", (e, n = []) => (n ? Array.isArray(n) && n.length == 0 ? n = "*" : Array.isArray(n) || (n = [n].flat()) : n = "*", c(this, Le).set(e, n), c(this, Le).size == 1 && c(this, kt).call(this), () => this.unsubscribe(e))); - P(this, "unsubscribe", (e) => c(this, Le).delete(e)); - if (c(pe, Se)) return c(pe, Se); - } -}; -Se = new WeakMap(), we = new WeakMap(), Le = new WeakMap(), kt = new WeakMap(), x(pe, Se, null), P(pe, "getInstance", () => (c(pe, Se) || B(pe, Se, new pe()), c(pe, Se))); -let Mt = pe; -const Fn = Mt.getInstance(), Ht = E.forwardRef(({ listCode: t, base62params: e, className: n, theme: i, themeProps: r, layouts: a, classNames: o }, s) => { - const [{ resource: l, primaryKey: u, batchOperations: d = [], itemOperations: p = [], columns: f = [], themeConfig: g, theme: y, isConditionFormLayout: w = !1, isTreeSider: C, treeSiderConfig: k, isItemGridLayout: v, itemGridLayout: { themeConfig: $, ...T } = {}, title: R, isPaginate: A, tabs: M }, D] = L({ isItemGridLayout: !1, itemGridLayout: {} }), j = Li(t, e), [{ dataSource: z, itemOperationsAccess: S, condition: K, tab: W, keyword: Ee, page: ct, total: dt, pageSize: xt, sider: te, onConditionChange: Bn, onTabChange: Un, onKeywordChange: qn, onPageChange: Kn, onPageSizeChange: _n, onSiderChange: Hn, onReload: Pt, payload: Jn }, Zt] = Ai(j, t, u, l), Yn = Vt(p, S, z, u), Gn = Vt(d); - V(() => { - let re = null; - return t && I.get(`/api/_/${t}`).resp(({ data: ut, res: Qn }) => { - ut != null && ut.isDynamicRefresh && (re = Fn.subscribe(() => Pt(), Qn)), D(ut); - }).catch(() => D({})), () => re == null ? void 0 : re(); - }, [t]), E.useImperativeHandle(s, () => ({ onReload: Pt, onClickCallback: Zt })); - const Xn = { listCode: t, title: R, classNames: o, layouts: a, resource: l, primaryKey: u, theme: i || y, themeProps: r || g, isTreeSider: C, treeSiderConfig: k, isPaginate: A, tabs: M, isItemOperations: Yn, itemOperations: p == null ? void 0 : p.map((re) => m.isEmpty(re == null ? void 0 : re.confirm) ? re : { ...re, confirm: Object.assign({}, re.confirm, { getPopupContainer: () => document.body }) }), isBatchOperations: Gn, batchOperations: d, isItemGridLayout: v, columns: f, itemGridLayout: { ...T, themeProps: $ }, isConditionFormLayout: w, itemOperationsAccess: S, dataSource: z, onConditionChange: Bn, onTabChange: Un, onKeywordChange: qn, onPageChange: Kn, onPageSizeChange: _n, onSiderChange: Hn, condition: K, tab: W, keyword: Ee, page: ct, total: dt, pageSize: xt, sider: te, payload: Jn }; - return h(Rn, { ...Xn, className: O("ff-data-list-helper", n), onReload: Pt, onClickCallback: Zt }); -}), An = (t, e, n = !0) => n !== !0 && n-- <= 0 ? [] : m.isArray(t) && !m.isEmpty(t) ? t.reduce((i, r) => (Reflect.has(r, e) && Reflect.has(r, "children") && i.push(r[e]), Reflect.has(r, "children") && !m.isEmpty(r.children) ? i.concat(An(r.children, e, n)) : i), []) : [], Ui = ({ className: t, primaryKey: e, columns: n = [], dataSource: i = [], operationRender: r, operationWidth: a = 180, components: o = {}, ...s }) => { - const { classNames: l } = le(ie), u = _(null), d = _(null), [p, f] = L([]), [g, y] = L({ width: 0, height: 0 }); - V(() => { - f(An(i, e)); - }, [i, e]), ni(() => { - const k = new ResizeObserver(() => { - var v; - y({ width: ((v = u.current) == null ? void 0 : v.nativeElement.querySelector(".ant-table-body").scrollWidth) || d.current.offsetWidth, height: d.current.offsetHeight }); - }); - return d.current && k.observe(d.current), () => { - d.current && k.unobserve(d.current); - }; - }, []); - const w = Ri(n), C = Fi(o); - return h("div", { ref: d, className: O("ff-data-list-table", l.content, t), children: g.height ? h(di, { bordered: !0, ...s, components: C, ref: u, rowKey: (k) => (k == null ? void 0 : k[e]) ?? Math.random(), columns: w == null ? void 0 : w.concat(r ? [{ title: "操作", align: "center", fixed: "right", width: `${Math.ceil(a / g.width * 100).toFixed(2)}%`, render: (k, v, $) => r(v, $) }] : []), dataSource: i, size: "middle", scroll: { x: "max-content", y: g.height - 50 }, pagination: !1, expandable: { defaultExpandAllRows: !0, expandRowByClick: !0, onExpandedRowsChange: f, expandedRowKeys: p } }) : null }); -}, qi = "RC_FORM_INTERNAL_HOOKS", Ki = (t) => { - const [e, n] = E.useState({ items: [] }); - return V(() => { - t && I.get(`/api/_/${t}`).then(({ uuid: i, code: r, name: a, resource: o, primaryKey: s, marginX: l, marginY: u, cols: d, rowHeight: p, fields: f, theme: g, themeSetting: y, groups: w }) => ({ uuid: i, code: r, name: a, resource: o, primaryKey: s, marginX: l, marginY: u, cols: d, rowHeight: p, theme: g, themeProps: y, groups: w, items: f })).then(n); - }, [t]), e; -}, _i = (t, { initialValue: e, initialValueLanguage: n, convertJs: i, convertJsSetting: r, type: a = "string" }, o = null) => { - const s = _(!1), l = le(yn), [u, d] = L(), [p, f] = L(n != "javascript" && t ? l.getFieldValue(t) : void 0), { registerWatch: g } = l.getInternalHooks(qi) || {}; - return V(() => g == null ? void 0 : g((y, w, C) => { - if (!s.current) return; - const k = m.get(w, t); - m.isEqual(k, p) || f(oe(k, a)); - }), [p]), V(() => { - n == "javascript" && e ? Re.exec(e, {}, { getFieldValueForBasicForm: (y) => o ? o.getFieldValue(y) : l.getFieldValue(y), getFieldValue: (y) => l.getFieldValue(y) }).then((y) => f(oe(y, a))).catch((y) => notification.error({ message: `布局数据错误: ${JSON.stringify(y)}` })).finally(() => s.current = !0) : (e && f(oe(e ?? l.getFieldValue(t), a)), s.current = !0); - }, [e, n]), ot(() => { - s.current && i && new ft([i, r]).toValue(p, l.getFieldsValue(!0)).then(d).catch((y) => { - d(y), console.error("布局数据转换错误: ", y, i); - }); - }, [p, i, r]), [u ?? p, p]; -}, ea = (t, e, n = null) => q(() => _t(t, e, n), [t]), Ln = (t, e, n = {}, i = {}, r = {}, a = null) => { - const o = le(yn), s = vt(), l = _(!0), u = _([]), [d, p] = L(e), [f, g] = L(), y = ne.useWatch((w) => JSON.stringify(m.pick(w, u.current)), o) || "{}"; - return st(() => { - t && Re.exec(t, n, { ...i, getFieldValueForBasicForm: (w) => r ? r.getFieldValue(w) : null, getFieldValue: m.wrap(o.getFieldValue, (w, C) => (u.current.some((k) => m.isEqual(k, C)) || (u.current.push(C), s()), w == null ? void 0 : w(C))), isFieldTouched: o.isFieldTouched, isFieldsTouched: o.isFieldsTouched }).then((w) => { - l.current && (p(w), g(null)); - }).catch((w) => { - l.current && (p(e), g(w)); - }); - }, [t, y, o, n, i]), V(() => () => l.current = !1, []), t ? [a ? oe(d, a) : d, f] : [a ? oe(e, a) : e, null]; -}, Hi = ({ widget: t, widgetPrefix: e = "@pkg/ff/grid-layouts", basicForm: n, ...i }) => { - const r = t != null && t.startsWith("@") || t != null && t.startsWith("blob:") ? t : `${e}/${t}`, [a, o] = L(); - return V(() => { - r && se.getWidgetComponent(r).then(({ defaultProps: s = {}, default: l }) => ({ default: Ji(l, s, n) })).catch((s) => ({ default: () => `${s}` })).then((s) => o(E.createElement(s.default, i))); - }, [r]), a; -}, Ji = (t, e = {}, n = null) => (i) => { - const { code: r, label: a, extras: o, isVirtual: s, initialValue: l, initialValueLanguage: u, convertJs: d, convertJsSetting: p, value: f, ...g } = m.merge({}, e, i), [y, w] = _i(s ? null : r, { initialValue: l, initialValueLanguage: u, convertJs: d, convertJsSetting: p, type: (g == null ? void 0 : g.type) || "string" }, n), C = q(() => { - const $ = Object.keys((e == null ? void 0 : e.extras) || {}); - return m.over([m.partialRight(m.pick, $), m.partialRight(m.omit, $)]); - }, [e == null ? void 0 : e.extras]), [k, v] = C(g); - return h(t, { ...v, value: y, rawValue: w, $setting: Object.assign({}, o, k) }); -}, jn = ({ theme: t, basicForm: e, items: n = [{ key: "default", label: "默认" }], fields: i = [], itemRender: r, chunks: a = [], children: o, $setting: s = {}, ...l }) => { - const [u, d] = L(); - V(() => { - t ? se.getWidgetComponent(t).then((f) => { - if (!(f != null && f.default)) throw "not found"; - return f; - }).catch((f) => ({ default: () => `${t} ${f}` })).then((f) => d(E.createElement(f.default, {}))) : d(null); - }, [t]); - const p = q(() => n == null ? void 0 : n.map((f) => ({ ...f, children: r(f, i == null ? void 0 : i.filter((g) => !(g != null && g.group) && f.key == "default" || g.group == f.key), f.key == "default" ? o : null) })).concat(a), [n, o, a]); - return u && E.cloneElement(u, { items: p, basicForm: e, $setting: { ...s, ...l } }); -}, In = ({ name: t, form: e = null, basicForm: n = null, style: i = {}, className: r, cols: a = 12, rowHeight: o = 21, containerPadding: s = [0, 0], itemMargin: l = [4, 0], formProps: u = {}, formFields: d = [], fields: p = [], data: f, theme: g, themeProps: y = {}, groups: w = [{ key: "default", label: "默认" }], children: C, ...k }) => { - const [v] = ne.useForm(e), $ = q(() => [{ name: "__PROPS__", value: u }].concat(d), [u, d]); - ot(() => (v.setFieldsValue(f), () => v.resetFields()), [f]); - const T = (R, A, M) => { - const D = _t(A, Hi, n); - return F("div", { className: O("ff-grid-layout", r), style: { ...i, "--grid-layout-item-margin-y": `${(l == null ? void 0 : l[0]) || 0}px`, "--grid-layout-item-margin-x": `${(l == null ? void 0 : l[1]) || 0}px`, "--grid-layout-container-padding-y": `${(s == null ? void 0 : s[0]) || 0}px`, "--grid-layout-container-padding-x": `${(s == null ? void 0 : s[1]) || 0}px`, "--grid-layout-cols": a, "--grid-layout-row-height": `${o}px` }, children: [D, M && E.cloneElement(M, { cols: a, rowHeight: o, itemMargin: l, containerPadding: s, fields: A, basicForm: n })] }); - }; - return h(ne, { ...k, fields: $, form: v, component: !1, children: g ? h(jn, { ...y, items: w, theme: g, itemRender: T, fields: p, children: C, basicForm: n }) : T(0, p, C) }); -}, ta = /* @__PURE__ */ ((t) => function({ code: e, data: n, ...i }) { - const { uuid: r, resource: a, items: o, hides: s, rowHeight: l, marginX: u, marginY: d, cols: p, theme: f, themeProps: g, groups: y } = Ki(e) || {}, w = q(() => [{ name: "__RESOURCE__", value: a }, { name: "__LAYOUT_KEY__", value: e }, { name: "__LAYOUT_UUID__", value: r }], [e, r, a]); - return a && h(t, { name: e, theme: f, themeProps: g, groups: y, ...i, fields: o, formFields: w, rowHeight: l, cols: p, itemMargin: [u, d], data: a ? { [a]: n } : n }); -})(In), Yi = ({ column: t = 0, colWidth: e = 0, cols: n, rowHeight: i, itemMargin: r, fields: a, primaryKey: o, dataSource: s, itemClassName: l, beforeRender: u = null, afterRender: d = null, itemRender: p = (v, $, T) => v, empty: f = h(ui, { description: null }), className: g, style: y = {}, theme: w, themeProps: C = {}, groups: k = [{ key: "default", label: "默认" }] }) => { - const { classNames: v } = le(ie), $ = q(() => h(In, { groups: k, theme: w, themeProps: C, cols: n, rowHeight: i, itemMargin: r, fields: a, className: l }), [a, n, i, r, k, w, C]), T = m.isEmpty(s); - return F("div", { className: O("ff-data-list-content", v.content, g), style: Object.assign({}, y, t && { "--col-num": t }, e && { "--col-width": e }), children: [u == null ? void 0 : u(s), T ? f : s.map((R, A) => { - const M = p(E.cloneElement($, { data: R }), R, A); - return E.cloneElement(M, { key: `${(R == null ? void 0 : R[o]) ?? A}-${xi(R)}` }); - }), d == null ? void 0 : d(s)] }); -}, Gi = ({ component: t, $props: e }) => { - const { base62params: n } = at(e, {}); - return h(G, { children: h(Ht, { listCode: t, base62params: I.decode(n) }) }); -}, na = () => h(Vn, {}), Vn = () => "Empty", Xi = ({ component: t, $setting: e, $props: n }) => { - const [i, r] = L(); - V(() => { - if (!t) return r(h(Vn, { description: null })); - se.getWidgetComponent(t).catch((o) => ({ default: () => `${o}` })).then((o) => E.createElement(o.default, { $setting: e })).then(r); - }, [t]); - const a = at(n, {}); - return i ? E.cloneElement(i, a) : null; -}, ia = () => "NotFoundPage"; -var xe, ae, Pe, Ne, Xe, Qe; -const ge = class ge { - constructor() { - x(this, ae, /* @__PURE__ */ new Map()); - x(this, Pe, {}); - x(this, Ne, null); - P(this, "init", (e, n) => { - B(this, ae, e), B(this, Pe, n); - }); - P(this, "get", (e) => (c(this, ae).has(e) || (e = Array.from(c(this, ae).keys()).find((n) => c(this, ae).get(n).uri === e)), c(this, ae).get(e) || {})); - P(this, "redirect", (e, n, i = {}) => { - const { uri: r, type: a, widgetProps: o } = this.get(e) || {}, { router: s, query: l, ...u } = n || {}, d = Object.assign({}, u, s), p = Object.assign({}, u, l); - a == "list" && (d.base62params = I.encode(d != null && d.base62params ? d.base62params : d)); - let f = fi(r || e, d); - const g = new URLSearchParams(); - for (const y in o || {}) (o == null ? void 0 : o.type) == "query" && Object.has(p, y) && g.append(y, JSON.stringify(p[y])); - return g.size > 0 && (f = `${f}?${g.toString()}`), i != null && i.isOpenWindow ? window.open(f) : c(this, Ne).navigate(f, { replace: !!(i != null && i.isReplaceRouteHistory) }); - }); - P(this, "getMenus", (e) => { - var n; - return ((n = c(this, Pe)) == null ? void 0 : n[e]) || []; - }); - P(this, "findMenuPathByUuid", (e) => { - let n = []; - for (const i in c(this, Pe)) if (n = c(this, Xe).call(this, c(this, Pe)[i], e, [i]), n.length > 1) return n; - return n; - }); - P(this, "getMenusByRouteUuid", (e) => c(this, Qe).call(this, e, Object.values(c(this, Pe)).flat())); - x(this, Xe, (e, n, i = []) => { - if (m.isEmpty(e)) return i; - for (const { uuid: r, children: a } of e) { - if (r == n) return i.concat(r); - if (!m.isEmpty(a)) return i.concat(r, c(this, Xe).call(this, a, n)); - } - return i; - }); - x(this, Qe, (e, n) => { - var r; - let i = []; - for (const a of n) a.widgetType == "redirect" && (a.uuid == e || a.widget == e ? i.push(a) : (r = a.children) != null && r.length && (i = i.concat(c(this, Qe).call(this, e, a.children)))); - return i; - }); - P(this, "getCurrentMenu", () => { - const { uuid: e } = this.getCurrentRoute() || {}; - if (!e) return; - const n = this.getMenusByRouteUuid(e); - return m.isEmpty(n) ? void 0 : n[0]; - }); - P(this, "getCurrentRoute", (e = 0) => { - var i; - const n = (i = c(this, Ne).state.matches[c(this, Ne).state.matches.length - 1 - e]) == null ? void 0 : i.route; - if (!n) return null; - for (let [r, a] of c(this, ae)) if (a.uri === n.path) return a; - return null; - }); - P(this, "getPageParams", (e) => { - var r, a, o; - let n = "", i = {}; - if (bn()) i = yi(), n = (r = wi()) == null ? void 0 : r.search; - else { - const { location: s = {}, matches: l = [] } = ((a = c(this, Ne)) == 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; - }), e ? m.get(i, e) : i; - }); - P(this, "createBrowserRouter", (e = {}) => { - if (c(this, ae).size == 0) return null; - const n = Ie.get("Common.WEBSITE_DEFAULT_THEME", "@pkg/ff/frameworks/DefaultTheme"), i = Ie.get(se.checkUserToken() ? "Common.WEBSITE_LOGIN_REDIRECT" : "Common.WEBSITE_DEFAULT", "/index"), r = { [n]: 0 }, a = (s, l) => () => Promise.all([se.getWidgetComponent(s), at(l)]).then(([u, d]) => [u.default || function() { - return `${s}`; - }, d]).then(([u, d]) => ({ Component: () => E.createElement(kn, {}, E.createElement(u, { $setting: d })) })), o = Array.from(c(this, ae).values()).reduce((s, { uuid: l, uri: u, name: d, type: p, component: f, widgetSetting: g, widgetProps: y, isLogin: w, isLayout: C, extra: k }) => { - let v = {}, $ = 0; - switch (p) { - case "list": - v.element = E.createElement(Gi, { component: f, $props: y }); - break; - case "fsdpf-component": - v.element = E.createElement(Xi, { key: f, component: f, $setting: g, $props: y }); - } - const T = (k == null ? void 0 : k.theme) ?? (k == null ? void 0 : k.layout); - if (T) { - const R = (k == null ? void 0 : k.themeProps) ?? (k == null ? void 0 : k.layoutProps); - if (!r[T]) return r[T] = s.length, [...s, { path: "/", lazy: a(T, R), children: [{ path: u, ...v }] }]; - $ = r[T]; - } - return C && $ > -1 ? (s[$].children.push({ path: u, ...v }), s) : [...s, { path: u, ...v }]; - }, [{ path: "/", lazy: a(n, {}), children: [] }]); - return o.push({ index: !0, element: E.createElement(Qi, { to: i, replace: !0 }) }), B(this, Ne, bi(o, e)); - }); - if (c(ge, xe)) return c(ge, xe); - } -}; -xe = new WeakMap(), ae = new WeakMap(), Pe = new WeakMap(), Ne = new WeakMap(), Xe = new WeakMap(), Qe = new WeakMap(), x(ge, xe, null), P(ge, "getInstance", () => (c(ge, xe) || B(ge, xe, new ge()), c(ge, xe))); -let Dt = ge; -const Qi = ({ to: t, replace: e }) => bn() ? E.createElement(Ci, { to: t, replace: e }) : (window.document.location = t, "redirect"), ke = Dt.getInstance(), Ve = new Worker(new URL("/ff-worker/index.js", self.location)), cn = { getConfigure: (t) => Ie.get(t), route: { redirect: (...t) => ke.redirect(...t), getPageParams: (...t) => ke.getPageParams(...t), getCurrentRoute: () => ke.getCurrentRoute() }, popup: { notification: (...t) => ee.notification(...t), success: (...t) => ee.success(...t), error: (...t) => ee.error(...t), form: (...t) => ee.form(...t), modal: (...t) => ee.modal(...t), confirm: (...t) => ee.confirm(...t) } }; -var Et, We, Te; -const U = class U { - constructor() { - P(this, "exec", (e, n = {}, i = {}, r = "") => new Promise((a, o) => { - if (!/^(?!\s*(\/\/|\/\*|\*)).*?\S+/m.test(e)) return a(); - const s = nn(U, Et)._++; - c(U, We).set(s, i), U.mQueue.set(s, [a, o]), Ve.postMessage({ id: s, session: r, category: "eval", method: e, args: n }); - })); - P(this, "clear", (e) => Ve.postMessage({ session: e, category: "clear" })); - if (c(U, Te)) return c(U, Te); - Promise.resolve().then(() => vr).then((e) => { - cn.http = e.http; - }), Ve.addEventListener("message", ({ data: { id: e, task_id: n, method: i, args: r, category: a, data: o, error: s, session: l } }) => { - if (a === "eval" && U.mQueue.has(e)) s !== null ? U.mQueue.get(e)[1](s) : U.mQueue.get(e)[0](o), c(U, We).delete(e), U.mQueue.delete(e); - else if (a === "util") try { - const u = m.get(cn, i.split("/")) || m.get(c(U, We).get(n), i.split("/")); - if (!m.isFunction(u)) throw `${i} not found`; - Promise.resolve(Reflect.apply(u, void 0, r)).then((d) => { - Ve.postMessage({ id: e, task_id: n, category: a, method: i, args: r, session: l, data: d, error: null }); - }).catch((d) => { - Ve.postMessage({ id: e, task_id: n, category: a, method: i, args: r, session: l, data: null, error: d }); - }); - } catch (u) { - Ve.postMessage({ id: e, task_id: n, category: a, method: i, args: r, session: l, data: null, error: u }); - } - }, !1); - } -}; -Et = new WeakMap(), We = new WeakMap(), Te = new WeakMap(), P(U, "mQueue", /* @__PURE__ */ new Map()), x(U, Et, 0), x(U, We, /* @__PURE__ */ new Map()), x(U, Te, null), P(U, "getInstance", () => (c(U, Te) || B(U, Te, new U()), c(U, Te))); -let zt = U; -const Re = zt.getInstance(), vt = () => { - const t = _(!0), [, e] = E.useReducer((n) => n + 1, 0); - return V(() => () => t.current = !1, []), () => t.current && e(); -}, ra = (t) => { - const e = _(); - return V(() => { - e.current = t; - }, [t]), e.current; -}, aa = (t) => { - const [e, n] = L(t), i = _(null), r = X((a, o) => { - i.current = o, n(a); - }, []); - return V(() => { - i.current && (i.current(e), i.current = null); - }, [e]), [e, r]; -}, ot = (t = (i) => { -}, e, n = m.isEqual) => { - const i = E.useRef(); - n(e, i.current) || (i.current = m.cloneDeep(e)), E.useEffect(t, [i.current]); -}, st = ot, Mn = (t, e = "string") => { - var n; - if (!Array.isArray(t)) return t; - for (let i = 0; i < t.length; i++) t[i].value = oe((n = t[i]) == null ? void 0 : n.value, e), t[i] && Reflect.has(t[i], "children") && (t[i].children = Mn(t[i].children, e)); - return t; -}, oa = (t, e = "json", n = "string", i, r = null) => { - const [a] = ne.useForm(i), [o, s] = L([{ label: "无", value: "", disabled: !0 }]), l = _([]), u = ne.useWatch((d) => l.current.length === 0 ? null : m.pick(d, l.current), a) || null; - return V(() => { - Array.isArray(t) ? s(t) : e === "javascript" && t ? Re.exec(t, {}, { getFieldValue: (d) => (l.current.includes(d) || l.current.push(d), a.getFieldValue(d)), getFieldValueForBasicForm: (d) => (l.current.includes(d) || l.current.push(d), r ? r.getFieldValue(d) : a.getFieldValue(d)) }).then((d) => { - s(oe(d, "array")); - }).catch((d) => console.error("useOptions", d)) : t && s(oe(t, "array")); - }, [t, e, u]), Mn(o, n); -}, sa = (t) => { - const [e, n] = L(), i = { type: "GET" }; - if (typeof t == "string" ? i.url = t : m.isPlainObject(t) && Object.assign(i, t), !(i != null && i.url)) throw "url is required"; - const r = (a) => I.request(i, !1).resp((o) => (console.log("useSubscribeRequest", a), n(o), o)); - return ot(() => { - let a = null; - return r().then((o) => { - a = Fn.subscribe(m.throttle(r, 180, { leading: !1, trailing: !0 }), o.res); - }), () => a == null ? void 0 : a(); - }, i), e; -}, Zi = (t) => { - const [e, n] = E.useState({ items: [], hides: [] }); - return E.useEffect(() => { - t && I.get(`/api/_/${t}`).then(({ pk: i, uuid: r, code: a, resource: o, align: s, cols: l, rowHeight: u, marginX: d, marginY: p, listenChangeFields: f, listenChangeFieldsFunc: g, fields: y, theme: w, themeSetting: C, groups: k }) => ({ pk: i, uuid: r, code: a, resource: o, align: s, cols: l, rowHeight: u, marginX: d, marginY: p, theme: w, themeProps: C, groups: k, listenChangeFields: f, listenChangeFieldsFunc: g, ...y.reduce((v, $) => { - var T; - return (T = $ == null ? void 0 : $.field) != null && T.hidden ? v.hides.push($ == null ? void 0 : $.field) : v.items.push($), v; - }, { items: [], hides: [] }) })).then(n); - }, [t]), e; -}, er = ({ max: t = 0, min: e = 0, type: n = "", message: i, pattern: r, required: a = !1, validator: o } = {}, s, l) => { - const [u, d] = L([]); - return V(() => { - 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: t, min: e, message: i || (e && t ? `字符必须在 ${e} ~ ${t} 之间` : `${t ? "最多能有" : "最少要有"} ${e || t} 个字符`) }); - break; - case "pattern": - p.push({ type: "string", pattern: r, message: i }); - break; - case "validator": - o && p.push(({ getFieldValue: f }) => ({ validator: async (g, y) => { - const w = await Re.exec(o, { value: y, fieldName: s }, { getFieldValue: f }); - return m.isString(w) && w ? Promise.reject(w) : m.isBoolean(w) && !w ? Promise.reject(i) : Promise.resolve(); - } })); - } - d(p); - }, [t, e, n, i, r, a, o]), u; -}, tr = (t, e, n) => { - const [i, r] = L(null); - return V(() => { - const { initDataUri: a = `/api/${t}`, initDataMethod: o = "GET" } = n || {}; - e && I.request({ method: o, url: m.trimEnd(`${a}/${e}`, "/") }).then((s) => { - r(s); - }); - }, [t, e, n]), i; -}, nr = (t, e, n) => X((i, r = { serialize: (a) => a, onSuccess: () => { -}, onFail: (a) => (a == null ? void 0 : a.errorFields) && ee.error("请先完善表单信息", { duration: 2e3 }) }) => { - const a = i.getFieldValue("__RESOURCE__"), { submitDataUri: o = `/api/${t}`, submitDataMethod: s = "POST" } = n || {}; - return i.validateFields().then((l) => a ? m.pick(l, [a]) : l).then(r.serialize).then((l) => I.request({ method: s, url: m.trimEnd(`${o}/${e || ""}`, "/"), data: l }).msg(r.onSuccess)).catch(r.onFail); -}, [t, e, n]), ir = (t, e, n, i) => { - const r = tr(e, n, i); - V(() => { - r ? t.setFieldsValue(r) : t.resetFields(); - }, [t, r]); - const a = nr(e, n, i); - return m.partial(a, t); -}, rr = (t, e, n = [], i = {}) => { - const r = _({}), a = _(), o = m.debounce(vt(), 180), s = ["disabled", "required"], l = (f, g) => { - s.includes(f) && (r.current[f] = g), o(); - }, u = q(() => ({ setDisabled: (f) => l("disabled", f), setRequired: (f) => l("required", f), getDisabled: () => r.current.disabled, getRequired: () => r.current.required }), [e]), [d, p] = Ln(e, -1, {}, u, i); - if (!p && a.current != d && (d >= 0 || !m.isEmpty(n == null ? void 0 : n[d]))) { - a.current = d; - const { widget: f, widgetPrefix: g, props: y } = n == null ? void 0 : n[d]; - t = vn(f, g), r.current = m.merge(y, m.pick(r.current, s)); - } - return [t, r.current]; -}, dn = (t) => t === void 0 || t === !1 ? "" : (Array.isArray(t) ? t : [t]).join("_"), la = ({ value: t, onChange: e }, n = null) => { - const i = _(), [r] = ne.useForm(n), a = _({}); - return st(() => { - m.isEqual(i.current, t) || r.setFieldsValue(t); - }, [t]), V(() => () => r.resetFields(), []), [q(() => r.__INTERNAL__ ? r : { ...r, __INTERNAL__: { itemRef: (o) => (s) => { - const l = dn(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 = dn(o); - return a.current[s]; - } }, [r]), (o, s) => { - i.current = s, e == null || e(s); - }]; -}, Jt = ({ widget: t = "Input", widgetPrefix: e = "@pkg/ff/grid-layout-forms", widgetDecorator: n, subWidgets: i = [], basicForm: r, ...a }) => { - const o = vn(t, e), [s, l] = rr(o, n, i, r), [u, d] = L(); - return V(() => { - s && se.getWidgetComponent(s).then(({ defaultProps: p = {}, default: f }) => ({ default: ar(f, p, r) })).catch((p) => ({ default: () => `${p}` })).then((p) => d(E.createElement(p.default, a))); - }, [s]), u && E.cloneElement(u, { ...a, ...l }); -}, ar = (t, e = {}, n = null) => (i) => { - const { type: r, code: a, label: o, noStyle: s, placeholder: l, required: u = !1, extras: d, validators: p, help: f, isVirtual: g, $isReserved: y, initialValue: w, initialValueLanguage: C, ...k } = m.omit(m.merge({}, e, i), ["convertJs", "convertJsSetting", "widget", "widgetPerfix", "widgetDecorator", "subWidgets", "boxStyle"]), v = er(Object.assign({}, p, u ? { required: !0 } : {}), a, r), $ = q(() => { - const D = Object.keys((e == null ? void 0 : e.extras) || {}); - return m.over([m.partialRight(m.pick, D), m.partialRight(m.omit, D)]); - }, [e == null ? void 0 : e.extras]), [T, R] = $(k), A = { label: o, noStyle: s, colon: !1, layout: "vertical" }, M = X((D) => D == null ? void 0 : oe(D, r), [r]); - return h(qt, { name: a, rules: v, initialValue: M(w), normalize: M, children: (D, j, z) => { - var S; - return h(t, { type: r, rcform: z, basicForm: n, itemProps: { validateStatus: j.errors.length > 0 ? "error" : "success", tooltip: f || null, help: j.errors.length > 0 ? j.errors.join("、") : null, required: ((S = v == null ? void 0 : v[0]) == null ? void 0 : S.required) || !1, ...A }, fieldProps: { placeholder: l, ...R, ...D }, $setting: Object.assign({}, d, T) }); - } }); -}, Yt = ({ name: t, form: e = null, basicForm: n = null, style: i = {}, className: r, cols: a = 24, rowHeight: o = 16, itemMargin: s = [8, 16], containerPadding: l = [0, 0], fields: u = [], hides: d = [], primaryKey: p = 0, formProps: f = {}, formFields: g = [], listenChangeFields: y, listenChangeFieldsFunc: w, onValuesChange: C, theme: k, themeProps: v = {}, groups: $ = [{ key: "default", label: "默认" }], children: T, ...R }) => { - const [A] = ne.useForm(e), M = X((z, S) => { - C == null || C(z, S), w && Array.isArray(y) && Re.exec(w, { changedValues: z, allValues: S }, { getFieldValue: A.getFieldValue, setFieldValue: A.setFieldValue, setFieldsValue: A.setFieldsValue, isFieldTouched: A.isFieldTouched, isFieldsTouched: A.isFieldsTouched }).catch((K) => console.error("onFormValuesChange", t, K)); - }, [t, A, C, y, w]), D = q(() => [{ name: "__PROPS__", value: f }, { name: "__PRIMARY_KEY__", value: p }].concat(g), [p, f, g]), j = (z, S, K) => { - const W = _t(S, Jt, n); - return F("div", { className: O("ff-grid-layout-form", r), style: { ...i, "--grid-layout-item-margin-x": `${(s == null ? void 0 : s[0]) ?? 8}px`, "--grid-layout-item-margin-y": `${(s == null ? void 0 : s[1]) ?? 16}px`, "--grid-layout-container-padding-y": `${(l == null ? void 0 : l[0]) || 0}px`, "--grid-layout-container-padding-x": `${(l == null ? void 0 : l[1]) || 0}px`, "--grid-layout-cols": a, "--grid-layout-row-height": `${o}px` }, children: [W, K && E.cloneElement(K, { cols: a, rowHeight: o, itemMargin: s, containerPadding: l, fields: S, basicForm: n })] }); - }; - return F(ne, { ...R, form: A, fields: D, onValuesChange: M, children: [k ? h(jn, { ...v, items: $, theme: k, itemRender: j, fields: u, children: T, basicForm: n }) : j(0, u, T), d == null ? void 0 : d.map((z) => { - var S; - return h(qt, { name: z.code, children: h(or, { form: A, basicForm: n, name: z.code, type: z.type, initialValue: z.initialValue, initialValueLanguage: (S = z.extras) == null ? void 0 : S.initialValueLanguage }) }, JSON.stringify(z.code)); - })] }); -}, or = ({ type: t, initialValue: e, initialValueLanguage: n, onChange: i, basicForm: r }) => { - const [a, o] = Ln(n == "javascript" && e, n == "javascript" ? void 0 : e, {}, {}, r); - return V(() => { - n == "javascript" ? i(oe(a, t)) : e && i(oe(e, t)); - }, [t, e, a]), null; -}; -Yt.propTypes = { fields: b.array, hides: b.array }; -const sr = /* @__PURE__ */ ((t) => ({ code: e, isPreview: n = !1, ...i }) => { - const { align: r, autoComplete: a, resource: o, items: s, hides: l, rowHeight: u, marginX: d, marginY: p, cols: f, listenChangeFields: g, listenChangeFieldsFunc: y, pk: w, uuid: C, theme: k, themeProps: v, groups: $ } = Zi(e), T = q(() => [{ name: "__PK__", value: w }, { name: "__RESOURCE__", value: o }, { name: "__LAYOUT_KEY__", value: e }, { name: "__LAYOUT_UUID__", value: C }], [w, e, C, o]); - return h(t, { name: e, autoComplete: a, theme: k, themeProps: v, groups: $, ...i, formFields: T, listenChangeFields: g, listenChangeFieldsFunc: y, fields: s, hides: l, cols: f, rowHeight: u, itemMargin: [d, p] }); -})(Yt), Dn = ({ $setting: t, $close: e, extras: n, code: i, primaryKey: r, ...a }) => { - const [o] = ne.useForm(), s = ir(o, i, r, t); - return h(G, { actions: F(E.Fragment, { children: [h(N, { name: (t == null ? void 0 : t.okText) || "保存", type: "primary", widget: () => s({ onSuccess: e }) }), h(N, { name: (t == null ? void 0 : t.cancelText) || "取消", widget: () => e(!1) })] }), extras: n, children: h(sr, { form: o, code: i, primaryKey: r, ...a }) }); -}, un = /* @__PURE__ */ new Set(), Wt = (t = [], e = 0) => { - const n = t[e]; - if (n.length && !un.has(n)) { - const i = document.createElement("script"); - i.setAttribute("src", n), i.setAttribute("data-namespace", n), t.length > e + 1 && (i.onload = () => { - Wt(t, e + 1); - }, i.onerror = () => { - Wt(t, e + 1); - }), un.add(n), document.body.appendChild(i); - } -}, yt = ({ className: t, type: e, style: n = {}, ...i }) => h("span", { role: "img", className: O("ff-iconfont", t), style: n, ...i, children: h("svg", { style: { width: "1em", height: "1em", fill: "currentColor", overflow: "hidden" }, viewBox: "0 0 1024 1024", children: h("use", { xlinkHref: `#${e}` }) }) }); -yt.propTypes = { className: b.string, type: b.string.isRequired, style: b.object }, yt.init = Wt; -const lr = (t, e, n, i) => ke.redirect(n, e, i), cr = (t, e = {}, n, i = {}) => { - var a; - const r = (a = i.router) == null ? void 0 : a.reduce((o, [s, l, u]) => { - const d = m.get(e, ["router", s]); - if (!d && d !== 0 && l) throw `请传入 ${u}`; - return `${o}/${d}`; - }, `/api/${n}`); - return I.del(r, e.param).msg(); -}, pn = (t, e, 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 m.isFunction(n) ? n.call(null, { ...e, ...o }) : m.isString(n) && n ? Re.exec(n, e, o) : null; -}, gn = (t, e, n, i, r) => m.isString(n) && n ? se.getWidgetComponent(n).then(({ default: a }) => ee.modal(a, { ...e, $setting: i }, r != null && r.title ? { ...r, title: m.template(r.title)(t) } : r)).catch((a) => { - ee.error(n, { content: a.toString() }); -}) : ee.modal(n, { ...e, $setting: i }, r != null && r.title ? { ...r, title: m.template(r.title)(t) } : r), dr = (t, e, n, i, r) => ee.modal(Dn, { ...e, $setting: i, code: n }, r != null && r.title ? { ...r, title: m.template(r.title)(t) } : r), ur = (t, e, n, i, r) => ee.modal(Ht, { base62params: e, $setting: i, listCode: n }, r != null && r.title ? { ...r, title: m.template(r.title)(t) } : r), pr = ({ widget: t, widgetType: e, widgetData: n, widgetProps: i, widgetSetting: r, widgetContainerProps: a }, { onAfterClick: o, onBeforeClick: s } = {}) => { - const l = le(ie), [u, d] = L({ leading: !0, trailing: !1 }), p = q(() => { - switch (e) { - case "redirect": - return m.partialRight(lr, t, r); - case "func": - return m.partialRight(pn, (r == null ? void 0 : r.code) ?? t, { status: u, setStatus: d }); - case "component": - case "fsdpf-component": - return m.partialRight(gn, t, r, a); - case "grid-layout-form": - return m.partialRight(dr, t, r, a); - case "data-list": - return m.partialRight(ur, t, r, a); - case "destroy": - return m.partialRight(cr, t, r, a); - default: - if (Xt(t) || E.isValidElement(t)) return m.partialRight(gn, t, r, a); - if (m.isFunction(t)) return m.partialRight(pn, (r == null ? void 0 : r.code) || t, { status: u, setStatus: d }); - } - return (...f) => console.error("useButton unknown widgetType", e, ...f); - }, [t, e]); - return [m.debounce((f) => (s == null || s(f), Promise.resolve(at(i, f, { list: l })).then((g) => p(f, { ...n, ...g })).then((g) => o == null ? void 0 : o(g)).catch(console.error)), 300, { leading: !0, trailing: !1 }), u]; -}, zn = ({ type: t, name: e, className: n, icon: i, iconPosition: r, size: a }, o = "default") => q(() => { - const s = { type: "primary", className: O("ff-button", n), iconPosition: r, size: a }; - return t === "danger" ? s.danger = !0 : t === "default" && (s.type = t), o === "link" || o === "dashed" ? (s.type = o, t === "default" && (s.className = O(s.className, "ff-default"))) : o !== "circle" && o !== "round" || (s.shape = o), i && (s.icon = h(yt, { type: i })), e && (s.children = e), s; -}, [o, t, n, i, r]), St = ({ data: t, widget: e, widgetType: n = "fsdpf-component", widgetData: i, widgetProps: r, widgetSetting: a, widgetContainerProps: o, onAfterClick: s, onBeforeClick: l, children: u, extras: d }) => { - const p = le(ie), [f, g] = L(!1), [y, w] = L("hover"), [C, k] = L({}), [v, $] = L(), { placement: T, align: R, zIndex: A, arrow: M = { pointAtCenter: !0 }, getPopupContainer: D, isPopupMountBodyContainer: j = !0, ...z } = o || {}; - V(() => { - n == "grid-layout-form" ? $(E.createElement(Dn, { ...i, $setting: a, code: e })) : n == "data-list" ? $(E.createElement(Ht, { base62params: t, $setting: a, listCode: e })) : m.isString(e) ? se.getWidgetComponent(e).then(({ default: W }) => { - $(E.createElement(W, { ...i, $setting: a })); - }).catch((W) => $(W.toString())) : Xt(e) ? $(E.createElement(e, { ...i, $setting: a })) : E.isValidElement(e) && $(E.cloneElement(e, { ...i, $setting: a })); - }, [e, n, i]), V(() => { - Promise.resolve(at(r, t, { list: p })).then(k); - }, [r, t, p.getBase62params]); - const S = (W, Ee = !1) => (g(W), !W && w("hover"), W ? l == null ? void 0 : l(C) : s == null ? void 0 : s(Ee)), K = (W) => { - g(!0), w("click"); - }; - return h(pi, { zIndex: A, placement: T, onPopupClick: K, onClick: K, open: f, align: R, arrow: M, trigger: y, getPopupContainer: D || j ? void 0 : (W) => W, content: h(gr, { ...z, extras: d, children: v && E.cloneElement(v, { ...C, $close: (W) => S(!1, W) }) }), children: u, onOpenChange: S }); -}, gr = ({ title: t, className: e, classNames: n, children: i, extras: r, width: a, height: o, ...s }) => { - const [l, u] = L({}), d = X((y, w) => u((C) => ({ ...C, [y]: w })), []), p = X((y) => u((w) => ({ ...w, [y]: void 0 })), []), f = t ? E.createElement("div", { className: "ff-popup-title" }, t) : l == null ? void 0 : l.title, g = r ?? E.createElement("div", { className: "ff-popup-reserved-extras" }, r); - return h(rt.Provider, { value: { ele: l, mount: d, unmount: p }, children: F("div", { className: O("ff-popup ff-popover", e, l.rootClassName), style: { width: a ?? 260, height: o }, ...s, children: [F("div", { className: O("ff-popup-header", "ff-popover-header", n == null ? void 0 : n.header), children: [f, l == null ? void 0 : l["sub-title"]] }), h("div", { className: O("ff-popup-body", "ff-popover-body", n == null ? void 0 : n.body), children: i }), F("div", { className: O("ff-popup-footer", "ff-popover-footer", n == null ? void 0 : n.footer), children: [g, l == null ? void 0 : l.extras, l == null ? void 0 : l.actions] })] }) }); -}; -St.propTypes = { widgetType: b.oneOf(["fsdpf-component", "grid-layout-form", "data-list"]) }; -const lt = (t) => function({ className: e, variant: n, children: i, name: r, icon: a, type: o = "default", iconPosition: s = "start", noAuthType: l, onAfterClick: u, onBeforeClick: d, data: p, loading: f, disabled: g, tooltip: y, confirm: w, widget: C = () => { -}, widgetType: k, widgetData: v, widgetProps: $, widgetSetting: T, widgetContainerProps: R, ...A }) { - const { mode: M, ...D } = R || {}, j = zn({ className: e, name: r, type: o, icon: a, iconPosition: s }, n ?? t), z = h(mt, { ...j, ...A, children: i || r }); - if (M === "popover" && !["destroy", "redirect", "func"].includes(k)) return h(St, { data: p, widget: C, widgetType: k, widgetData: v, widgetProps: $, widgetSetting: T, widgetContainerProps: D, onAfterClick: u, onBeforeClick: d, children: z }); - const S = m.isEmpty(y) || !y.enabled ? {} : y, K = m.isEmpty(w) ? { enabled: !1 } : Object.assign({ enabled: !0 }, w), [W, Ee] = L(!1), [ct, { disabled: dt, loading: xt }] = pr({ widget: C, widgetType: k, widgetData: v, widgetProps: $, widgetSetting: T, widgetContainerProps: D }, { onAfterClick: u, onBeforeClick: d }); - return h(gi, { okText: "确定", cancelText: "取消", getPopupContainer: (te) => te, ...K, disabled: dt || g, open: W, onOpenChange: (te) => { - if (!te) return Ee(te); - K.enabled ? Ee(te) : ct(p); - }, onConfirm: (te) => { - ct(p, te); - }, onClick: (te) => { - te.stopPropagation(); - }, children: h(hi, { getPopupContainer: (te) => te, ...S, title: W ? null : S == null ? void 0 : S.title, trigger: ["hover", "click"], children: E.cloneElement(z, { loading: xt || f, disabled: dt || g }) }) }); -}, N = lt("default"); -N.propTypes = { type: b.oneOf(["primary", "default", "danger", ""]), size: b.oneOf(["large", "middle", "small"]), name: b.string, icon: b.string, iconPosition: b.oneOf(["start", "end"]), data: b.any, widget: b.any, widgetType: b.oneOf(["destroy", "redirect", "func", "component", "fsdpf-component", "grid-layout-form", "grid-layout", "data-list"]), widgetData: b.object, widgetProps: b.object, widgetSetting: b.object, widgetContainerProps: b.object, tooltip: b.exact({ title: b.string.isRequired, placement: b.oneOf(["top", "left", "right", "bottom", "topLeft", "topRight", "bottomLeft", "bottomRight", "leftTop", "leftBottom", "rightTop", "rightBottom"]), enabled: b.oneOfType([b.bool, b.number]), getPopupContainer: b.func }), confirm: b.exact({ title: b.string.isRequired, cancelText: b.string, okText: b.string, okType: b.oneOf(["primary", "default", "danger", ""]), placement: b.oneOf(["top", "left", "right", "bottom", "topLeft", "topRight", "bottomLeft", "bottomRight", "leftTop", "leftBottom", "rightTop", "rightBottom"]), enabled: b.oneOfType([b.bool, b.number]), getPopupContainer: b.func, arrow: b.oneOfType([b.bool, b.exact({ pointAtCenter: b.bool })]) }) }; -const hr = lt("link"), mr = lt("circle"), fr = lt("round"), yr = lt("dashed"), hn = ({ options: t = [], triggerWeights: e = ["grid-layout-form", "grid-layout", "fsdpf-component", "print"], onAfterClick: n = (g, y, w) => { -}, onBeforeClick: i = (g, y, w) => { -}, labelVariant: r = "link", labelSize: a, labelRender: o, btnVariant: s, btnSize: l, btnRender: u = (g, y) => h(N, { ...g, data: y }, g.uuid || Ft()), widgetContainerProps: d = {}, children: p, data: f }) => { - if (m.isEmpty(t)) return p; - const [g, y] = q(() => (t || []).reduce((C, k) => { - const v = e.indexOf(k.widgetType); - return v === -1 ? C[1].push(k) : C[0] ? v < e.indexOf(C[0].widgetType) ? (C[1].push(C[0]), C[0] = k) : C[1].push(k) : C[0] = k, C; - }, [null, []]), [t, e]); - o ? p = o(g, f) || p : p || (p = h(mt, { ...zn(Object.assign(g != null && g.name || g != null && g.icon ? {} : { icon: "icon-location" }, g, { size: a }), r) })); - const w = y.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: m.partialRight(n, C, f), onBeforeClick: m.partialRight(i, C, f) }, { size: l, variant: s }), f)); - return h(St, { widget: g == null ? void 0 : g.widget, widgetType: g == null ? void 0 : g.widgetType, widgetProps: g == null ? void 0 : g.widgetProps, widgetSetting: g == null ? void 0 : g.widgetSetting, widgetContainerProps: Object.assign({}, d, g == null ? void 0 : g.widgetContainerProps), data: f, widgetData: g == null ? void 0 : g.widgetData, extras: w, onAfterClick: m.partialRight(n, g, f), onBeforeClick: m.partialRight(i, g, f), children: p }); -}; -hn.propTypes = { triggerWeights: b.array, options: b.arrayOf(b.shape({ ...N.propTypes, widgetType: N.propTypes.widgetType.isRequired })), btnSize: N.propTypes.size, btnRender: b.func, btnVariant: b.oneOf(["", "default", "link", "circle", "round", "dashed"]), labelVariant: b.oneOf(["", "default", "link", "circle", "round", "dashed"]), labelRender: b.func, labelSize: N.propTypes.size, onAfterClick: b.func, onBeforeClick: b.func, widgetContainerProps: N.propTypes.widgetContainerProps, data: N.propTypes.data }, N.Link = hr, N.Link.defaultProps = N.defaultProps, N.Link.propTypes = N.propTypes, N.Circle = mr, N.Circle.defaultProps = N.defaultProps, N.Circle.propTypes = N.propTypes, N.Round = fr, N.Round.defaultProps = N.defaultProps, N.Round.propTypes = N.propTypes, N.Dashed = yr, N.Dashed.defaultProps = N.defaultProps, N.Dashed.propTypes = N.propTypes, N.Popover = St, N.GroupPopover = hn; -const wr = ({ fields: t, formProps: e, $close: n }) => { - const [i] = ne.useForm(), r = q(() => [{ name: "__PROPS__", value: e }], [e]); - return h(G, { actions: F(E.Fragment, { children: [h(N, { name: "取消", widget: () => n(!1) }), h(N, { name: "确定", type: "primary", widget: () => i.validateFields(!0).then(n) })] }), children: h(ne, { fields: r, form: i, className: "ff-modal-form", children: t == null ? void 0 : t.map(({ code: a, ...o }) => h(Jt, { code: a, ...o }, a)) }) }); -}, br = ({ className: t, classNames: e, $close: n, children: i, title: r, subTitle: a, actions: o, extras: s, ...l }) => F(ki, { ...l, prefixCls: "ff-drawer", className: O("ff-popup", t), maskMotion: { motionAppear: !0, motionName: "mask-motion" }, motion: (u) => ({ motionAppear: !0, motionName: `panel-motion-${u}` }), children: [F("div", { className: O("ff-popup-header", "ff-drawer-header", e == null ? void 0 : e.header), children: [h("button", { "aria-label": "Close", className: O("ff-popup-close", "ff-drawer-close", e == null ? void 0 : e.close), onClick: l.onClose, children: h(Kt, { type: "close" }) }), r, a] }), h("div", { className: O("ff-popup-body", "ff-drawer-body", e == null ? void 0 : e.body), children: i }), F("div", { className: O("ff-popup-footer", "ff-drawer-footer", e == null ? void 0 : e.footer), children: [s, o] })] }), Cr = ({ className: t, classNames: e, $close: n, $event: i, children: r, title: a, subTitle: o, actions: s, extras: l, placement: u, ...d }) => { - const p = (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 h(Ei, { ...d, ...p, prefixCls: "ff-modal", modalRender: () => F("div", { className: O("ff-modal-content ff-popup", t), children: [F("div", { className: O("ff-popup-header", "ff-modal-header", e == null ? void 0 : e.header), children: [h("button", { "aria-label": "Close", className: O("ff-popup-close", "ff-modal-close", e == null ? void 0 : e.close), onClick: d.onClose, children: h(Kt, { type: "close" }) }), a, o] }), h("div", { className: O("ff-popup-body", "ff-modal-body", e == null ? void 0 : e.body), children: r }), F("div", { className: O("ff-popup-footer", "ff-modal-footer", e == null ? void 0 : e.footer), children: [l, s] })] }) }); -}, Wn = ({ placement: t, $close: e, $event: n, children: i, title: r, ...a }) => { - const [o, s] = L({}), [l, u] = L(!0), d = X((y, w) => s((C) => ({ ...C, [y]: w })), []), p = X((y) => s((w) => ({ ...w, [y]: void 0 })), []); - let f = { ...a, className: o.rootClassName, title: o.title || r && E.createElement("div", { className: O("ff-popup-title") }, r), subTitle: o["sub-title"], actions: o.actions, extras: o.extras, children: i, $close: e, $event: n, onClose: () => u(!1) }; - const g = () => { - e(!1); - }; - return h(rt.Provider, { value: { ele: o, mount: d, unmount: p }, children: t && t !== "center" ? h(br, { ...f, placement: t, open: l, afterOpenChange: (y) => !y && g() }) : h(Cr, { ...f, visible: l, afterClose: g }) }); -}; -Wn.propTypes = { placement: b.oneOf(["center", "left", "top", "right", "bottom"]) }; -const Z = () => { - const [t, e] = ii({ 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] = E.useReducer((a) => a + 1, 0); - V(() => { - Z.$onClick = i, Z.$queue.forEach(([a, o, s], l, u) => { - r([o, s], ...a), delete u[l]; - }); - }, []); - const i = (a, o = {}, s = {}) => new Promise((l, u) => r([l, u], a, o, s)), r = ([a, o], s, l = {}, u = {}) => { - const d = Z.$index++, p = (f) => ((g, y) => (Z.$popups.delete(g), n(), y == null ? void 0 : y()))(d, () => a(f)); - if (s === En) return t.open({ ...u, key: d, content: E.createElement(s, { ...l, $close: () => t.close(d) }) }); - Z.$popups.set(d, E.createElement(Wn, { maskClosable: !1, $event: l == null ? void 0 : l.$event, ...u, key: d, $close: p }, E.isValidElement(s) ? E.cloneElement(s, { ...l, $close: p }) : s != null && s.name || rn.isForwardRef(s) || (s == null ? void 0 : s.$$typeof) === rn.ForwardRef ? E.createElement(s, { ...l, $close: p }) : s)), n(); - }; - return F(E.Fragment, { children: [Array.from(Z.$popups).map(([a, o]) => o), e] }); -}; -Z.$popups = /* @__PURE__ */ new Map(), Z.$index = 0, Z.$queue = [], Z.$onClick = (...t) => new Promise((e, n) => { - Z.$queue.push([t, e, n]); -}); -const mn = (t, e, n = {}) => Z.$onClick(t, e, n), Ot = (t, { showProgress: e, duration: n, ...i } = { duration: 1.5 }) => Z.$onClick(En, { content: t, ...i }, { showProgress: e, duration: n }), ee = { modal: mn, confirm: (t, e = {}) => Z.$onClick($i, { content: t, ...e }, { placement: "center" }), form: (t, e = {}, n = {}) => mn(wr, { formProps: n, fields: t }, { placement: "center", ...e }).then((i) => { - if (i === !1) throw !1; - return i; -}), notification: Ot, success: (t, e = { duration: 1.5 }) => Ot(t, { ...e, className: "ff-notification-success", icon: "check" }), error: (t, e = { duration: 1.5 }) => Ot(t, { ...e, className: "ff-notification-error", icon: "close" }) }; -qe.configure({ showSpinner: !1 }), Ke.interceptors.request.use((t) => { - t.headers.Platform = "web", t.headers.SaaS = window.localStorage.getItem("SaaS"); - const e = window.localStorage.getItem(ht); - return t.headers.Authorization = e ? `Bearer ${e} ` : void 0, qe.inc(), t; -}, (t) => (qe.done(), Promise.reject({ code: -1, msg: t }))), Ke.interceptors.response.use(({ data: t, headers: e }) => (qe.done(), { ...t, res: e == null ? void 0 : e.res }), function(t) { - return qe.done(), Promise.reject(t.message); -}), window.addEventListener("unhandledrejection", At.onUnhandledRejection), At.onMsg = (t, e) => ee[[0, 1].includes(t) ? "success" : "error"](e).then(() => t === 20300 && ke.redirect(Ie.get("Common.WEBSITE_LOGIN_PAGE"))); -var je, Be; -const J = class J { - constructor() { - P(this, "appUrl", ""); - return c(J, je) || (B(J, Be, new At()), B(J, je, new Proxy(this, { get: (e, n) => n === "init" ? e.init : n === "appUrl" ? e.appUrl : c(J, Be)[n] }))), c(J, je); - } - init(e, n, i) { - Ke.defaults.baseURL = this.appUrl = i, Ke.defaults.timeout = 15e3, c(J, Be).init(e, n, Ke); - } -}; -je = new WeakMap(), Be = new WeakMap(), x(J, je, null), x(J, Be, null), P(J, "getInstance", () => c(J, je) ?? B(J, je, new J())); -let Bt = J; -const I = Bt.getInstance(); -class Gt extends Error { - constructor(e, n) { - super(n), Error.captureStackTrace && Error.captureStackTrace(this, Gt), !n instanceof _e && (this.name = `${e} Error Runtime`); - } -} -class _e extends Error { - constructor(e, ...n) { - super(...n), Error.captureStackTrace && Error.captureStackTrace(this, _e), this.name = `${e} Not Found`; - } -} -const Rt = "mine", ht = "token"; -var Oe, Ue; -const he = class he { - constructor() { - x(this, Ue, /* @__PURE__ */ new Map()); - P(this, "setVendor", (e, n) => c(this, Ue).set(e, new Cn(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 _e(r); - }))); - P(this, "getWidgetComponent", async (e) => { - if (!e) throw "getWidgetComponent widget is required"; - if (e != null && e.startsWith("blob:") || e != null && e.startsWith("http:") || e != null && e.startsWith("https:")) return await import(e); - const [, n] = e == null ? void 0 : e.split("@pkg/"); - if (!n) throw new _e(e); - try { - return c(this, Ue).has("pkg") ? await c(this, Ue).get("pkg").get(n) : await import(`${I.appUrl}/api/pkg-import/web?name=${e}`); - } catch (i) { - throw new Gt(e, i); - } - }); - P(this, "getRoutes", () => I.get("/api/my-router").then((e) => [...e, { uuid: "data-list-setting", isLayout: !0, uri: "/data-list-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/ff-design/components/DataListSetting", extra: { layout: "@pkg/ff-design/frameworks/DesignTheme" } }, { uuid: "grid-layout-setting", isLayout: !0, uri: "/grid-layout-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/ff-design/components/GridLayoutSetting", extra: { layout: "@pkg/ff-design/frameworks/DesignTheme" } }, { uuid: "grid-layout-form-setting", isLayout: !0, uri: "/grid-layout-form-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/ff-design/components/GridLayoutFormSetting", extra: { layout: "@pkg/ff-design/frameworks/DesignTheme" } }, { uuid: "resource-api-setting", isLayout: !0, uri: "/resource-api-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/ff-design/components/ResourceApiSetting", extra: { layout: "@pkg/ff-design/frameworks/DesignTheme" } }, { uuid: "charts-setting", isLayout: !0, uri: "/resource-api-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/ff-design/components/ChartsSetting", extra: { layout: "@pkg/ff-design/frameworks/DesignTheme" } }, { uuid: "fsm-setting", isLayout: !0, uri: "/fsm-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/ff-design/components/FsmSetting", extra: { layout: "@pkg/ff-design/frameworks/DesignTheme" } }, { uuid: "component-setting", isLayout: !0, uri: "/component-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/ff-design/components/ComponentSetting", extra: { layout: "@pkg/ff-design/frameworks/DesignTheme" } }, { uuid: "login", uri: "/login", name: "登录", type: "fsdpf-component", isLogin: !1, component: "@pkg/ff/components/Login" }, { uuid: "not-found", uri: "*", name: "Not Found", type: "fsdpf-component", isLogin: !1, component: "@pkg/ff/components/NotFound" }].map(({ uuid: n, ...i }) => [n, { uuid: n, ...i }])).then((e) => new Map(e))); - P(this, "getMenus", () => I.get("/api/my-menu")); - P(this, "getConfigure", () => I.get("api/init-configure")); - P(this, "getWidgetOperationAuth", () => I.get("/api/init-widget-operation-auth").then((e) => e.reduce((n, { uuid: i, auth: r }) => [...n, [i, r]], []))); - P(this, "getPhoneNumber", (e) => I.get(`/api/user-wx-phone-number/${e}`)); - P(this, "getUserToken", () => { - const e = window.localStorage.getItem(ht); - if (!e) return ""; - const n = e.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 e; - }); - P(this, "checkUserToken", () => { - try { - return !!this.getUserToken(); - } catch { - return !1; - } - }); - P(this, "getUserInfo", (e = !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 } = I.decode(window.localStorage.getItem(Rt) || "", {}); - return a === r ? Promise.resolve(o) : I.get("/api/mine-info").then(({ User: s = null }) => (window.localStorage.setItem(Rt, I.encode({ ...s, iat: r })), s)); - } catch (i) { - console.error(i), e && ee.error("请登录").then(this.logout); - } - return Promise.resolve(null); - }); - P(this, "login", (e, n, i = {}) => I.post("/api/user-token", { username: e, passwd: ri.hash(n), platform: "web", ...i }).then(({ token: r }) => (window.localStorage.setItem(ht, r), r)).then(async (r) => (await this.initAppEnv(), r))); - P(this, "logout", (e) => (window.localStorage.removeItem(Rt), window.localStorage.removeItem(ht), e == null ? void 0 : e())); - P(this, "initAppEnv", async () => { - const [e, n, i, r] = await Promise.all([this.getWidgetOperationAuth(), this.getRoutes(), this.getMenus(), this.getConfigure()]); - return $n.init(e), Ie.init(r), ke.init(n, i), yt.init(Ie.get("Common.ICONFONT")), { widgetOperationAuth: e, routes: n, menus: i, configures: r }; - }); - if (c(he, Oe)) return c(he, Oe); - } -}; -Oe = new WeakMap(), Ue = new WeakMap(), x(he, Oe, null), P(he, "getInstance", () => (c(he, Oe) || B(he, Oe, new he()), c(he, Oe))); -let Ut = he; -const se = Ut.getInstance(), kr = E.createContext({ user: {}, initUser: () => { -}, initUserComplete: !1 }), Er = E.createContext({ set: () => { -}, get: () => { -}, assign: () => { -}, currentRoute: () => { -} }), Xt = (t) => !!(t != null && t.name) && (t.prototype instanceof E.Component || /^[A-Z]/.test(t.name)), $r = (t, e) => { - if (!t || typeof window > "u") return; - let n = document.querySelector(`style[ff-style-token="${e}"]`); - return n ? (n.innerHTML = t, t) : (n = document.createElement("style"), n.setAttribute("ff-style-token", e), n.setAttribute("type", "text/css"), n.innerHTML = t, document.head.appendChild(n), t); -}, vr = Object.freeze(Object.defineProperty({ __proto__: null, AppContext: kr, AppGlobalParamsContext: Er, cache: Cn, configure: Ie, default: se, func: Re, http: I, insertStyle: $r, isReactComponent: Xt, route: ke }, Symbol.toStringTag, { value: "Module" })); -var be, me, Ce, Q, Y, H, fe, Ze, et, tt, nt, $t, it; -const Qt = class Qt { - constructor(e, n = "/") { - x(this, be, "/"); - x(this, me, (e) => { - const n = Date.now(); - if (e && (e.lastModified = n), c(this, be) != "/") { - const i = c(this, H).call(this, c(this, be)); - i && (i.lastModified = n); - } - this.root.lastModified = n; - }); - x(this, Ce, (e) => { - let n = ce.normalize(e); - return n.startsWith("/") || (n = "/" + n), n.length > 1 && n.endsWith("/") && (n = n.slice(0, -1)), n; - }); - x(this, Q, (e) => { - const n = ce.join(c(this, be), e); - return c(this, Ce).call(this, n); - }); - x(this, Y, (e) => { - if (!e || typeof e != "string") return !1; - const n = c(this, Ce).call(this, e); - return !n.includes("..") && n.startsWith("/"); - }); - x(this, H, (e) => { - var a; - const n = c(this, Ce).call(this, e); - if (n === "/") return this.root; - const i = n.split("/").filter((o) => o); - let r = this.root; - for (const o of i) { - if (r.type !== "dir") return null; - const s = (a = r.children) == null ? void 0 : a.find((l) => l.name === o); - if (!s) return null; - r = s; - } - return r; - }); - x(this, fe, (e) => { - const n = c(this, Ce).call(this, e), i = ce.basename(n), r = ce.dirname(n); - return { parent: c(this, H).call(this, r), name: i }; - }); - x(this, Ze, (e, n, i) => i === !1 ? e : i === "root" ? e.map((r) => ce.join(n, r)) : i === !0 || i === "working" ? e.map((r) => ce.relative(c(this, be), ce.join(n, r))) : e); - x(this, et, async (e, n, i, r = "") => { - const a = [], o = c(this, H).call(this, e); - if (!o || o.type !== "dir") return a; - const s = o.children; - for (const l of s) { - const u = l.name, d = e === "/" ? `/${u}` : `${e}/${u}`, p = r ? `${r}/${u}` : u; - try { - if (l.type === "file") n(i ? p : u) && a.push(p); - else if (l.type === "dir" && i) { - const f = await c(this, et).call(this, d, n, i, p); - a.push(...f); - } - } catch { - continue; - } - } - return a; - }); - x(this, tt, async (e, n, i, r = "") => { - const a = [], o = Array.isArray(n) ? n : [n], s = c(this, H).call(this, e); - if (!s || s.type !== "dir") return a; - if (!i) { - for (const u of o) if (c(this, nt).call(this, u)) { - const d = await c(this, $t).call(this, e, u); - a.push(...d); - } else { - const d = ce.join(e, u), p = c(this, Ce).call(this, d); - c(this, H).call(this, p) && a.push(u); - } - return a; - } - const l = s.children; - for (const u of l) { - const d = u.name, p = e === "/" ? `/${d}` : `${e}/${d}`, f = r ? `${r}/${d}` : d; - try { - if (u.type === "file") for (const g of o) { - let y = !1; - if (y = c(this, nt).call(this, g) ? c(this, it).call(this, d, g) : d === g, y) { - a.push(f); - break; - } - } - else if (u.type === "dir") { - const g = await c(this, tt).call(this, p, n, i, f); - a.push(...g); - } - } catch { - continue; - } - } - return a; - }); - x(this, nt, (e) => /[*?[\]{}]/.test(e)); - x(this, $t, async (e, n) => { - const i = [], r = c(this, H).call(this, e); - if (!r || r.type !== "dir") return i; - const a = r.children.map((o) => o.name); - for (const o of a) c(this, it).call(this, o, n) && i.push(o); - return i; - }); - x(this, it, (e, n) => { - const i = n.replace(/\./g, "\\.").replace(/\*/g, ".*").replace(/\?/g, ".").replace(/\{([^}]+)\}/g, (r, a) => "(" + a.split(",").join("|") + ")"); - return new RegExp(`^${i}$`).test(e); - }); - var i, r, a; - B(this, be, n), this.root = { name: "/", type: "dir", children: [], lastModified: Date.now() }, Array.isArray(e) ? this.root.children = e : e && typeof e == "object" && (e.name && e.name !== "/" ? this.root.children.push(e) : (this.root = e, (i = this.root).name ?? (i.name = "/"), (r = this.root).children ?? (r.children = []), (a = this.root).lastModified ?? (a.lastModified = Date.now()))); - } - async stat(e) { - const n = c(this, Q).call(this, e); - if (!c(this, Y).call(this, n)) throw new Error(`EINVAL: invalid path '${e}'`); - const i = c(this, H).call(this, n); - if (!i) throw new Error(`ENOENT: no such file or directory, stat '${e}'`); - return { isFile: () => i.type === "file", isDirectory: () => i.type === "dir", lastModified: i.lastModified }; - } - async dir(e) { - const n = c(this, Q).call(this, e); - if (!c(this, Y).call(this, n)) throw new Error(`EINVAL: invalid path '${e}'`); - const i = c(this, H).call(this, n); - if (!i) throw new Error(`ENOENT: no such file or directory, scandir '${e}'`); - if (i.type !== "dir") throw new Error(`ENOTDIR: not a directory, scandir '${e}'`); - return i.children.map((r) => r.name); - } - async readFile(e) { - const n = c(this, Q).call(this, e); - if (!c(this, Y).call(this, n)) throw new Error(`EINVAL: invalid path '${e}'`); - const i = c(this, H).call(this, n); - if (!i) throw new Error(`ENOENT: no such file or directory, open '${e}'`); - if (i.type !== "file") throw new Error("EISDIR: illegal operation on a directory, read"); - return i.content || ""; - } - async writeFile(e, n) { - const i = c(this, Q).call(this, e); - if (!c(this, Y).call(this, i)) throw new Error(`EINVAL: invalid path '${e}'`); - const { parent: r, name: a } = c(this, fe).call(this, i); - if (!r) throw new Error(`ENOENT: no such file or directory, open '${e}'`); - if (r.type !== "dir") throw new Error("ENOTDIR: not a directory"); - const o = r.children.findIndex((l) => l.name === a), s = { name: a, type: "file", content: n, lastModified: Date.now() }; - o >= 0 ? r.children[o] = s : r.children.push(s), c(this, me).call(this, r); - } - async mkdir(e, n = {}) { - const i = c(this, Q).call(this, e); - if (!c(this, Y).call(this, i)) throw new Error(`EINVAL: invalid path '${e}'`); - const { recursive: r } = n; - if (r) { - const a = i.split("/").filter((s) => s); - let o = "/"; - for (const s of a) - if (o = ce.join(o, s), !c(this, H).call(this, o)) { - const { parent: l, name: u } = c(this, fe).call(this, o); - if (l && l.type === "dir") { - const d = { name: u, type: "dir", children: [], lastModified: Date.now() }; - l.children.push(d), c(this, me).call(this, l); - } - } - } else { - const { parent: a, name: o } = c(this, fe).call(this, i); - if (!a) throw new Error(`ENOENT: no such file or directory, mkdir '${e}'`); - if (a.type !== "dir") throw new Error("ENOTDIR: not a directory"); - if (a.children.find((l) => l.name === o)) throw new Error(`EEXIST: file already exists, mkdir '${e}'`); - const s = { name: o, type: "dir", children: [], lastModified: Date.now() }; - a.children.push(s), c(this, me).call(this, a); - } - } - async unlink(e) { - const n = c(this, Q).call(this, e); - if (!c(this, Y).call(this, n)) throw new Error(`EINVAL: invalid path '${e}'`); - const { parent: i, name: r } = c(this, fe).call(this, n); - if (!i) throw new Error(`ENOENT: no such file or directory, unlink '${e}'`); - const a = i.children.findIndex((o) => o.name === r); - if (a < 0) throw new Error(`ENOENT: no such file or directory, unlink '${e}'`); - if (i.children[a].type !== "file") throw new Error(`EISDIR: illegal operation on a directory, unlink '${e}'`); - i.children.splice(a, 1), c(this, me).call(this, i); - } - async rmdir(e, n = {}) { - const i = c(this, Q).call(this, e); - if (!c(this, Y).call(this, i)) throw new Error(`EINVAL: invalid path '${e}'`); - const { parent: r, name: a } = c(this, fe).call(this, i); - if (!r) throw new Error(`ENOENT: no such file or directory, rmdir '${e}'`); - const o = r.children.findIndex((l) => l.name === a); - if (o < 0) throw new Error(`ENOENT: no such file or directory, rmdir '${e}'`); - const s = r.children[o]; - if (s.type !== "dir") throw new Error(`ENOTDIR: not a directory, rmdir '${e}'`); - if (!n.recursive && s.children.length > 0) throw new Error(`ENOTEMPTY: directory not empty, rmdir '${e}'`); - r.children.splice(o, 1), c(this, me).call(this, r); - } - async rename(e, n) { - const i = c(this, Q).call(this, e), r = c(this, Q).call(this, n); - if (!c(this, Y).call(this, i)) throw new Error(`EINVAL: invalid path '${e}'`); - if (!c(this, Y).call(this, r)) throw new Error(`EINVAL: invalid path '${n}'`); - if (!c(this, H).call(this, i)) throw new Error(`ENOENT: no such file or directory, rename '${e}' -> '${n}'`); - const { parent: a, name: o } = c(this, fe).call(this, i), { parent: s, name: l } = c(this, fe).call(this, r); - if (!s) throw new Error(`ENOENT: no such file or directory, rename '${e}' -> '${n}'`); - if (c(this, H).call(this, r)) throw new Error(`EEXIST: file already exists, rename '${e}' -> '${n}'`); - const u = a.children.findIndex((p) => p.name === o), d = { ...a.children[u], name: l, lastModified: Date.now() }; - a.children.splice(u, 1), s.children.push(d), c(this, me).call(this, a), a !== s && c(this, me).call(this, s); - } - async exists(e) { - const n = c(this, Q).call(this, e); - return c(this, Y).call(this, n) ? c(this, H).call(this, n) !== null : !1; - } - getLastModified() { - return this.root.lastModified; - } - getWorkingDirectory() { - return c(this, be); - } - scope(e = "/") { - const n = c(this, Ce).call(this, e); - if (!c(this, Y).call(this, n)) throw new Error(`EINVAL: invalid path '${e}'`); - const i = c(this, H).call(this, n); - if (!i) throw new Error(`ENOENT: no such file or directory '${e}'`); - if (i.type !== "dir") throw new Error(`ENOTDIR: not a directory '${e}'`); - return i.children ?? (i.children = []), i.lastModified ?? (i.lastModified = Date.now()), new Qt(this.root, n); - } - async findFiles(e, n, i = {}) { - const r = c(this, Q).call(this, e); - if (!c(this, Y).call(this, r)) throw new Error(`EINVAL: invalid path '${e}'`); - const a = c(this, H).call(this, r); - if (!a) throw new Error(`ENOENT: no such file or directory '${e}'`); - if (a.type !== "dir") throw new Error(`ENOTDIR: not a directory '${e}'`); - const { recursive: o = !1, fullPath: s = !1 } = i; - if (typeof n == "function") { - const u = await c(this, et).call(this, r, n, o); - return c(this, Ze).call(this, u, r, s); - } - const l = await c(this, tt).call(this, r, n, o); - return c(this, Ze).call(this, l, r, s); - } -}; -be = new WeakMap(), me = new WeakMap(), Ce = new WeakMap(), Q = new WeakMap(), Y = new WeakMap(), H = new WeakMap(), fe = new WeakMap(), Ze = new WeakMap(), et = new WeakMap(), tt = new WeakMap(), nt = new WeakMap(), $t = new WeakMap(), it = new WeakMap(); -let fn = Qt; -const Sr = async (t, e = "/", n = "") => { - try { - const i = await t.stat(e), r = e === "/" ? "/" : ce.basename(e), a = { title: r, key: n ? `${n}${e}` : e, isLeaf: i.isFile() }; - if (i.isDirectory()) { - const o = await t.dir(e); - if (o.length > 0) { - a.children = []; - const s = [], l = []; - for (const u of o) { - const d = e === "/" ? `/${u}` : `${e}/${u}`; - try { - (await t.stat(d)).isDirectory() ? s.push(u) : l.push(u); - } catch (p) { - console.warn(`Failed to stat ${d}:`, p.message); - } - } - s.sort(), l.sort(); - for (const u of [...s, ...l]) { - const d = e === "/" ? `/${u}` : `${e}/${u}`; - try { - const p = await Sr(t, d, n); - a.children.push(p); - } catch (p) { - console.warn(`Failed to process ${d}:`, p.message); - } - } - } - } - return a; - } catch { - return null; - } -}; -export { - vt as $, - Rn as A, - On as B, - Bi as C, - ft as D, - Wi as E, - Di as F, - ta as G, - qi as H, - Ht as I, - ie as J, - Ui as K, - Yi as L, - ji as M, - Vi as N, - Ri as O, - Fi as P, - Xr as Q, - Fn as R, - Qr as S, - Nn as T, - Vt as U, - Ai as V, - Li as W, - Gi as X, - Xi as Y, - na as Z, - ia as _, - vn as a, - ra as a0, - aa as a1, - ot as a2, - st as a3, - oa as a4, - sa as a5, - sr as a6, - Yt as a7, - Jt as a8, - Dn as a9, - ke as aA, - kr as aB, - Er as aC, - fn as aD, - Sr as aE, - Zi as aa, - er as ab, - tr as ac, - nr as ad, - ir as ae, - rr as af, - la as ag, - yt as ah, - N as ai, - $n as aj, - pr as ak, - G as al, - rt as am, - kn as an, - Z as ao, - ee as ap, - Ur as aq, - qr as ar, - Kr as as, - se as at, - Xt as au, - $r as av, - I as aw, - Cn as ax, - Ie as ay, - Re as az, - Si as b, - at as c, - Sn as d, - Hr as e, - Jr as f, - vi as g, - Yr as h, - xi as i, - Ni as j, - Gr as k, - Tn as l, - Pi as m, - Zr as n, - _t as o, - An as p, - In as q, - Tt as r, - Hi as s, - oe as t, - _r as u, - jn as v, - Ki as w, - _i as x, - ea as y, - Ln as z -}; diff --git a/dist/common/main-D7to3RZo.js b/dist/common/main-D7to3RZo.js new file mode 100644 index 0000000..10bdb76 --- /dev/null +++ b/dist/common/main-D7to3RZo.js @@ -0,0 +1,1470 @@ +var en = Object.defineProperty; +var ii = (t) => { + throw TypeError(t); +}; +var tn = (t, e, i) => e in t ? en(t, e, { enumerable: !0, configurable: !0, writable: !0, value: i }) : t[e] = i; +var P = (t, e, i) => tn(t, typeof e != "symbol" ? e + "" : e, i), ni = (t, e, i) => e.has(t) || ii("Cannot " + i); +var c = (t, e, i) => (ni(t, e, "read from private field"), i ? i.call(t) : e.get(t)), v = (t, e, i) => e.has(t) ? ii("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, i), W = (t, e, i, n) => (ni(t, e, "write to private field"), n ? n.call(t, i) : e.set(t, i), i); +var ri = (t, e, i, n) => ({ + set _(r) { + W(t, e, r, i); + }, + get _() { + return c(t, e, n); + } +}); +import { jsx as h, jsxs as F } from "react/jsx-runtime"; +import $, { useEffect as V, useState as L, useCallback as X, useRef as _, useContext as le, useMemo as q, useId as Lt, isValidElement as nn, useLayoutEffect as rn } from "react"; +import ce from "pathe"; +import b from "prop-types"; +import R from "classnames"; +import * as ai from "react-is"; +import { useNotification as an } from "rc-notification"; +import m from "lodash"; +import ie, { Field as _t, FieldContext as wi } from "rc-field-form"; +import { M as Rt, N as _e, a as He, _ as jt, S as on } from "./vender-FNiQWFaA.js"; +import bi from "immutability-helper"; +import { Space as sn, Form as mt, Input as ln, Button as yt, Pagination as cn, Tree as dn, Breadcrumb as un, Table as pn, Empty as gn, Popover as hn, Popconfirm as mn, Tooltip as fn } from "antd"; +import { useMergedState as yn } from "rc-util"; +import { generatePath as wn, useInRouterContext as Ci, useParams as bn, useLocation as Cn, createBrowserRouter as kn, Navigate as $n } from "react-router-dom"; +import "rc-util/lib/hooks/useMergedState"; +import En from "rc-drawer"; +import Sn from "rc-dialog"; +var De, Ye, ze, we, Ae, Le; +class ki { + constructor(e, i) { + v(this, De, /* @__PURE__ */ new Map()); + v(this, Ye, !0); + v(this, ze, []); + v(this, we); + v(this, Ae, () => c(this, we)); + v(this, Le, () => Promise.resolve()); + P(this, "get", (...e) => new Promise((i, n) => { + const r = JSON.stringify(e); + if (c(this, De).has(r)) return i(c(this, Le).call(this, c(this, we), ...e)); + if (c(this, we) === void 0) c(this, ze).push([e, i, n]), c(this, Ye) && (W(this, Ye, !1), Promise.resolve(typeof c(this, Ae) == "function" ? c(this, Ae).call(this) : c(this, Ae)).then((a) => W(this, we, a || null)).finally(() => { + c(this, ze).forEach(([a, o, s]) => { + try { + const l = c(this, Le).call(this, c(this, we), ...a); + c(this, De).set(JSON.stringify(a), l), o(l); + } catch (l) { + s(l); + } + }), c(this, ze).length = 0; + })); + else { + const a = c(this, Le).call(this, c(this, we), ...e); + c(this, De).set(r, a), i(a); + } + })); + W(this, Le, i), W(this, Ae, e); + } +} +De = new WeakMap(), Ye = new WeakMap(), ze = new WeakMap(), we = new WeakMap(), Ae = new WeakMap(), Le = new WeakMap(); +const Kr = () => h("div", { children: "Empty" }), ot = $.createContext({ ele: {}, mount: () => { +}, unmount: () => { +} }), G = ({ rootClassName: t, className: e, children: i, actions: n, title: r, subTitle: a, extras: o, style: s = {} }) => { + const { mount: l, unmount: u } = $.useContext(ot); + return G.Action({ children: n }), G.Title({ children: r }), G.SubTitle({ children: a }), G.Extra({ children: o }), V(() => (l("rootClassName", t), () => u(t)), [t]), h("div", { className: R("ff-container", e), style: s, children: i }); +}, ht = (t) => ({ children: e, className: i }) => { + const { mount: n, unmount: r } = $.useContext(ot); + return V(() => (e && n(t, $.createElement("div", { key: `ff-${t}`, className: R(`ff-popup-${t}`, i) }, e)), () => r(t)), [i, e]), null; +}; +G.Action = ht("actions"), G.Title = ht("title"), G.SubTitle = ht("sub-title"), G.Extra = ht("extras"), G.propTypes = { className: b.string, style: b.object, title: b.any, subTitle: b.any, actions: b.any, extras: b.any }; +const _r = () => h(G, { className: "ff-loading", children: F("div", { className: "loader", children: [F("div", { className: "square", children: [h("span", {}), h("span", {}), h("span", {})] }), F("div", { className: "square", children: [h("span", {}), h("span", {}), h("span", {})] }), F("div", { className: "square", children: [h("span", {}), h("span", {}), h("span", {})] }), F("div", { className: "square", children: [h("span", {}), h("span", {}), h("span", {})] })] }) }), Hr = () => h("div", { children: "NotFound" }), $i = ({ children: t }) => { + const [e, i] = L({}), n = X((a, o) => i((s) => ({ ...s, [a]: o })), []), r = X((a) => i((o) => ({ ...o, [a]: void 0 })), []); + return typeof (t == null ? void 0 : t.type) == "string" ? t : h(ot.Provider, { value: { ele: e, mount: n, unmount: r }, children: $.cloneElement(t, { className: e.rootClassName, title: e.title, subTitle: e["sub-title"], actions: e.actions, extras: e.extras }) }); +}; +$i.propTypes = { children: b.element.isRequired }; +const oi = { 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"] }, Ht = ({ type: t, props: e }) => h("i", { ...e, children: h("svg", { viewBox: "0 0 1024 1024", width: "1em", height: "1em", fill: "currentColor", children: (oi[t] || oi.info).map((i, n) => h("path", { d: i }, n)) }) }), Ei = ({ className: t, content: e, icon: i, $close: n }) => F($.Fragment, { children: [i && h("div", { className: R("ff-notification-icon", t), children: h(Ht, { type: i }) }), e] }), vn = ({}) => h(G, { children: "Confirm" }); +var Se, Be; +const de = class de { + constructor() { + v(this, Be, /* @__PURE__ */ new Map()); + P(this, "init", (e) => W(this, Be, new Map(e))); + P(this, "check", (e) => !c(this, Be).has(e) || c(this, Be).get(e)); + if (c(de, Se)) return c(de, Se); + } +}; +Se = new WeakMap(), Be = new WeakMap(), v(de, Se, null), P(de, "getInstance", () => (c(de, Se) || W(de, Se, new de()), c(de, Se))); +let It = de; +const Si = It.getInstance(), xn = (t, e, i = "children") => { + if (m.isEmpty(t)) return {}; + const n = m.find(t, ["value", e]); + if (!m.isEmpty(n)) return n; + const r = t.length; + for (let a = 0; a < r; a++) { + const { [i]: o } = t[a], s = xn(o, e, i); + if (!m.isEmpty(s)) return s; + } + return {}; +}, vi = (t = "Input", e = "@pkg/ff/grid-layout-forms") => t != null && t.startsWith("@") || t != null && t.startsWith("blob:") ? t : `${e}/${t}`; +var ve, Ge; +const ue = class ue { + constructor() { + v(this, Ge, null); + P(this, "init", (e) => W(this, Ge, e)); + P(this, "get", (e, i) => m.get(c(this, Ge), e, i)); + if (c(ue, ve)) return c(ue, ve); + } +}; +ve = new WeakMap(), Ge = new WeakMap(), v(ue, ve, null), P(ue, "getInstance", () => (c(ue, ve) || W(ue, ve, new ue()), c(ue, ve))); +let Vt = ue; +const Ve = Vt.getInstance(), si = { null2json: (t) => Object.create(), null2array: (t) => [], null2number: (t) => 0, null2bool: (t) => !1, null2string: (t) => "", null2integer: (t) => 0, null2float: (t) => 0, string2json: (t) => t ? JSON.parse(t) : "{}", string2array: (t) => t.substr(0, 1) === "[" && t.substr(-1) === "]" ? JSON.parse(t) : t.split(","), string2number: (t) => t == "" ? 0 : +t, string2integer: (t) => t == "" ? 0 : +t, string2float: (t) => t == "" ? 0 : +t, string2bool: (t) => { + switch (`${t}`.toLowerCase()) { + case "0": + case "false": + case "[]": + case "{}": + return !1; + } + return !!t; +}, string2string: (t) => t, json2json: (t) => t, json2array: (t) => t ? Object.values(t) : [], json2number: (t) => Object.keys(t).length, json2integer: (t) => Object.keys(t).length, json2float: (t) => Object.keys(t).length, json2bool: (t) => Object.keys(t).length > 0, json2string: (t) => t ? JSON.stringify(t) : "", array2json: (t) => ({ ...t }), array2array: (t) => t, array2number: (t) => t.length, array2integer: (t) => t.length, array2float: (t) => t.length, array2bool: (t) => t.length > 0, array2string: (t) => JSON.stringify(t), number2json: (t) => ({}), number2array: (t) => [t], number2number: (t) => t, number2integer: (t) => t, number2float: (t) => t, number2bool: (t) => !!t, number2string: (t) => t.toString(), boolean2json: (t) => ({}), boolean2array: (t) => [], boolean2number: (t) => +t, boolean2integer: (t) => +t, boolean2float: (t) => +t, boolean2bool: (t) => t, boolean2string: (t) => t ? "true" : "false" }, oe = (t, e) => { + let i = "string"; + i = Array.isArray(t) ? "array" : typeof t, m.isObject(t) && (i = "json"); + const n = `${i}2${e}`; + return Reflect.has(si, n) ? si[n](t) : t; +}, Pn = (t) => t === null ? "null" : Array.isArray(t) ? "array" : typeof t == "object" ? "json" : typeof t == "boolean" ? "bool" : typeof t == "string" ? "string" : typeof t == "number" ? Number.isInteger(t) ? "integer" : "float" : typeof t, st = (t = {}, e = {}, i = {}, n = "") => xi(t, (r, a) => a === "type" && r === "code") ? Pi(t, e, i, n) : Ni(t, e, n), xi = (t, e = () => !1) => m.some(t, (i) => !!m.some(i, e) || (m.isEmpty(i) || !m.isPlainObject(i) && !m.isArray(i) ? void 0 : xi(i, e))), Pi = async (t = {}, e = {}, i = {}, n = "") => { + let r = /* @__PURE__ */ Object.create(null); + for (let a in t) { + let o; + if (Reflect.has(t[a], "type") && ["code", "field", "router", "query", "string"].includes(t[a].type)) { + const { type: s, value: l = "", default: u = n } = t[a]; + switch (s) { + case "code": + try { + o = await Fe.exec(l, e, i); + } catch (d) { + console.error("getWidgetPropsData", d); + } + break; + case "field": + o = m.get(e, l) ?? m.get(e, l.substring(l.indexOf(".") + 1)); + break; + case "router": + case "query": + o = $e.getPageParams(l); + break; + case "string": + o = l; + } + o ?? (o = u); + } else o = await Pi(t[a], e, i, n); + m.set(r, a, o); + } + return r; +}, Ni = (t = {}, e = {}, i = "") => Object.keys(t || {}).reduce((n, r) => { + if (m.isPlainObject(t[r])) { + let a; + if (Reflect.has(t[r], "type") && ["field", "router", "query", "string"].includes(t[r].type)) { + const { type: o, value: s = "", default: l = i } = t[r]; + switch (o) { + case "field": + a = m.get(e, s) ?? m.get(e, s.substring(s.indexOf(".") + 1)); + break; + case "router": + case "query": + a = $e.getPageParams(s); + break; + case "string": + a = s; + } + a ?? (a = l); + } else a = Ni(t[r], e, i); + m.set(n, r, a); + } + return n; +}, {}), Ot = (t, e) => t && typeof t == "object" ? Array.isArray(t) ? t.map((i) => Ot(i, e)) : Object.keys(t).reduce((i, n) => (e[n] ? i[e[n]] = Ot(t[n], e) : i[n] = Ot(t[n], e), i), {}) : t, Jr = () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (t) => { + const e = 16 * Math.random() | 0; + return (t === "x" ? e : 3 & e | 8).toString(16); +}), Yr = (t) => { + var e, i; + return t ? (i = (e = t.match(/^@pkg(?:[^\/]*\/){3}(?[^\/]+)/)) == null ? void 0 : e.groups) == null ? void 0 : i.name : ""; +}, Gr = (t) => { + var e, i; + return t ? (i = (e = t.match(/^@pkg(?:[^\/]*\/){2}(?[^\/]+)/)) == null ? void 0 : e.groups) == null ? void 0 : i.category : ""; +}, Xr = (t) => { + var e, i; + return t ? (i = (e = t.match(/^@pkg(?:[^\/]*\/){1}(?[^\/]+)/)) == null ? void 0 : e.groups) == null ? void 0 : i.owner : ""; +}, Nn = (t, e = 32, i = "auto") => { + const n = Mt(t), r = i === "auto" ? "x64" : i; + if (e === 32) return Rt.x86.hash32(n).toString(); + if (e === 128) return r === "x64" ? Rt.x64.hash128(n) : Rt.x86.hash128(n); + throw new Error("bits 只能是 32 或 128"); +}, Mt = (t) => t == null ? "null" : typeof t == "string" ? t : typeof t == "number" || typeof t == "boolean" ? String(t) : typeof t == "function" ? t.toString() : Array.isArray(t) ? "[" + t.map(Mt).join(",") + "]" : typeof t == "object" ? "{" + Object.keys(t).sort().map((e) => `${e}:${Mt(t[e])}`).join(",") + "}" : String(t), Tn = () => { + let t = 1; + const e = /* @__PURE__ */ new WeakMap(), i = /* @__PURE__ */ new Map(); + return (...n) => n.length === 0 ? "" : n.map((r) => { + return String((a = r) === null || typeof a != "object" && typeof a != "function" ? (i.has(a) || i.set(a, t++), i.get(a)) : (e.has(a) || e.set(a, t++), e.get(a))); + var a; + }).join("::"); +}, Rn = (t) => { + if (!t || typeof t != "string" || t.startsWith("/") || t.startsWith("./") || t.startsWith("../")) return !1; + try { + let e = t.startsWith("//") ? `http:${t}` : t; + return e.includes("://") || e.startsWith("//") || (e = `http://${e}`), !!new URL(e).hostname; + } catch { + return !1; + } +}, Qr = (t, e = "") => { + if (!t || typeof t != "string" || Rn(t)) return t; + let i = e; + return !i && typeof window < "u" && window.location && (i = `${window.location.protocol}//${window.location.host}`), t.startsWith("/") ? i ? `${i}${t}` : t : i ? `${i}/${t}` : t; +}; +var Ct, Xe, Qe, kt; +const $t = class $t { + constructor(...e) { + v(this, Xe, []); + v(this, Qe, (e) => { + var i; + for (let n of e) Array.isArray(n[0]) ? c(this, Qe).call(this, n) : c(this, Xe).push(c(i = $t, Ct).call(i, n[0], n[1])); + }); + P(this, "toValue", async (e, i = null) => { + const n = { getValue: () => e, getRecord: () => i }; + let r = e; + for (const a of c(this, Xe)) try { + const o = await a; + if (typeof o != "function") { + console.warn("middleware is not a function, skip:", o); + continue; + } + r = await o.call(n, r); + } catch (o) { + console.error("middleware error, skip:", o); + } + return r; + }); + P(this, "toRender", (e, i, n = null) => $.createElement(c(this, kt), { value: e, record: i }, n)); + v(this, kt, ({ value: e, record: i, children: n }) => { + const [r, a] = L(n); + return ct(() => { + let o = !1; + return a(n), this.toValue(e, i).then((s) => !o && a(s)).catch((s) => !o && a(`${s}`)), () => o = !0; + }, [e, i]), r; + }); + c(this, Qe).call(this, e); + } +}; +Ct = new WeakMap(), Xe = new WeakMap(), Qe = new WeakMap(), kt = new WeakMap(), v($t, Ct, m.memoize((e, i) => { + if (typeof e == "function") return e(i); + if (typeof e == "string") return se.getWidgetComponent(e).then((n) => { + var r; + return ((r = n.default) == null ? void 0 : r.call(n, i)) || ((a) => a); + }); + throw new TypeError("middleware must be a string or a function"); +}, Tn())); +let wt = $t; +const ne = $.createContext({ listCode: "", classNames: {}, getBase62params: (t, e) => { +}, onReload: () => { +}, onClickCallback: () => { +}, onConditionChange: () => { +}, onTabChange: () => { +}, onSiderChange: () => { +}, onKeywordChange: () => { +}, onPageChange: () => { +}, onPageSizeChange: () => { +}, reload: () => { +}, setPage: () => { +}, setPageSize: () => { +}, setTab: () => { +}, setSider: () => { +}, setKeyword: () => { +}, setCondition: () => { +} }), li = ({ className: t, record: e, column: i, ...n }) => { + if (i != null && i.editableByJs && (i != null && i.uuid)) { + const { formSetting: r = { primaryKey: "id" }, widgetSetting: a = {}, widgetContainerSetting: o = {} } = (i == null ? void 0 : i.editableByJsSetting) || {}; + return h(N.Popover, { widget: On, widgetData: { record: e, column: i }, widgetSetting: { widgetSetting: a, formSetting: r }, widgetContainerProps: { title: i != null && i.title ? `${i.title} - 编辑` : "编辑", ...o, width: (o == null ? void 0 : o.width) || 260, arrow: !0 }, children: h("td", { className: R("ff-data-list-cell-editable", t), ...n }) }); + } + return h("td", { className: t, ...n }); +}, On = ({ record: t, column: e, $close: i, $setting: n }) => { + const r = _(Pn(m.get(t, e == null ? void 0 : e.dataIndex))), { listCode: a, onClickCallback: o } = le(ne), [s] = ie.useForm(), { formSetting: l, widgetSetting: u } = n, d = (l == null ? void 0 : l.primaryKey) || "id", p = () => { + s.setFieldsValue({ value: m.get(t, e == null ? void 0 : e.dataIndex), __PROPS__: t }); + }; + return ct(() => p(), [t, e == null ? void 0 : e.dataIndex, a]), h(G, { actions: F($.Fragment, { children: [h(N, { size: "small", onClick: p, children: "重置" }), F(sn.Compact, { block: !0, children: [h(N, { size: "small", widget: i, children: "取消" }), h(N, { type: "primary", size: "small", widget: () => s.validateFields().then(({ value: f }) => { + const g = m.get(t, d.substring(d.indexOf(".") + 1)); + if (!g) throw "获取更新主键失败!"; + I.put(`/api/${a}-storeBy-${e == null ? void 0 : e.uuid}/${g}`, { value: f }).msg(() => o(2, t)).then(i); + }).catch(console.warn), children: "保存" })] })] }), children: F(ie, { form: s, children: [h(Gt, { label: "", type: r.current, code: "value", widget: e == null ? void 0 : e.editableByJs, extras: u }), h(_t, { noStyle: !0, name: ["__PROPS__"], children: () => { + } })] }) }); +}, Fn = (t) => function(e) { + return t(e, getRecord()); +}, An = (t, e = {}) => q(() => { + var i; + return (i = t == null ? void 0 : t.filter(Boolean)) == null ? void 0 : i.map(({ widgetByJs: n, widgetByJsSetting: r, ...a }, o) => { + const s = (u) => ({ record: u, column: a }); + let l = []; + return n && l.push([n, r]), l.length > 0 ? (a != null && a.render && l.push([Fn, a.render]), { ...a, onCell: s, render: (u, d) => new wt(l).toRender(u, d, "-") }) : { ...a, onCell: s }; + }); +}, [t, e]), Ln = (t = {}) => q(() => { + var e; + return t.body ?? (t.body = { cell: li }), (e = t.body).cell ?? (e.cell = li), t; +}, [t]), Zr = (t) => { + const [e, i] = L({}); + return V(() => { + let n = !1; + return t && I.get(`/api/_/${t}`).then((r) => m.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; + }, [t]), e; +}, ea = (t, e = {}) => { + const [i, n] = L({ dataSource: [] }); + return lt(() => { + let r = !1; + return t && I.get(`/api/${t}/${I.encode({ page: 1, ...e })}`).then((a) => !r && n(a)), () => r = !0; + }, [t, e]), i; +}, Ti = (t = [], e = /* @__PURE__ */ new Map(), i = "id", n) => { + const r = X(n ? (a) => m.get(a, i, m.get(a, [n, i])) : (a) => m.get(a, i), [i, n]); + return X((a) => t == null ? void 0 : t.filter((o) => !o.uuid || !e.has(o.uuid) || e.get(o.uuid).some((s) => s == r(a))), [t, e, r]); +}, Dt = (t = [], e = /* @__PURE__ */ new Map(), i = [], n = "id", r) => { + const a = X(r ? (o) => m.get(o, n, m.get(o, [r, n])) : (o) => m.get(o, n), [n, r]); + return q(() => { + if (m.isEmpty(t) || !t.some(({ uuid: s }) => Si.check(s))) return !1; + if (m.isEmpty(e) || m.isEmpty(i)) return !0; + const o = i.map((s) => a(s)); + return t.some(({ uuid: s }) => !s || !e.has(s) || e.get(s).some((l) => o.some((u) => u == l))); + }, [t, i, e, a]); +}, jn = (t, e, i = "id", n = null) => { + const r = xt(), a = _(!1), o = _(t.dataSource), s = _(t.itemOperationsAccess); + return V(() => (o.current = t.dataSource, s.current = t.itemOperationsAccess, () => a.current = !1), [t.dataSource, t.itemOperationsAccess]), a.current && (t.dataSource = o.current, t.itemOperationsAccess = s.current), [t, (l = 0, u = null) => { + var d, p; + if (a.current = !1, l === 1) return (d = t.onReload) == null ? void 0 : d.call(t); + if (l === 2) { + const f = m.get(u, "__PARENT_ID__", ""), g = m.get(u, i, m.get(u, [n, i], "")), y = m.findIndex(o.current, ["__PARENT_ID__", f]), w = m.findIndex(y > -1 ? m.get(o.current, [y, "children"]) : o.current, [i, g]); + if (w === -1) return (p = t.onReload) == null ? void 0 : p.call(t); + Promise.all([I.get(`/api/${e}/detail/${g}`), I.post(`/api/${e}/list-operations-access`, { ids: g })]).then(([C, k]) => { + const S = m.get(o.current, y > -1 ? [y, "children", w, "children"] : [w, "children"]); + o.current = bi(o.current, y > -1 ? { [y]: { children: { $splice: [[w, 1, { ...C, children: S }]] } } } : { $splice: [[w, 1, { ...C, children: S }]] }); + const E = new Map(k); + s.current.forEach((T, O) => { + var A; + (A = E.get(O)) != null && A.some((M) => M == g) || s.current.set(O, T.filter((M) => M !== g)); + }), E.forEach((T, O) => { + s.current.has(O) ? s.current.set(O, m.uniq([...s.current.get(O) || [], ...T])) : s.current.set(O, T); + }); + }).then(() => { + a.current = !0, r(); + }); + } + }]; +}, In = (t, e) => { + const i = xt(), n = _(e), r = _(/* @__PURE__ */ new Map()), a = _([]), o = m.throttle((l) => { + a.current = [], I.list(t, m.pick({ ...n.current, ...l }, ["tab", "page", "pageSize", "condition", "sider", "keyword"])).then(({ keyword: u, condition: d, total: p, tab: f, sider: g, page: y, pageSize: w, operationsAccess: C, dataSource: k }) => { + n.current = { tab: f, condition: d, sider: g, keyword: u, total: p, pageSize: w, page: k != null && k.length ? y : 1 }, a.current = k, r.current = new Map(C), i(); + }); + }, 380, { leading: !1, trailing: !0 }); + ct(() => { + a.current = [], t && o(e); + }, [t, e]); + const s = q(() => m.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: bi(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: e == null ? void 0 : e.payload }); +}, Vn = ({ listCode: t, className: e, layouts: i = {}, dataSource: n, isPaginate: r, isItemOperations: a, isBatchOperations: o, batchOperations: s, itemOperations: l, itemOperationsAccess: u, resource: d, primaryKey: p, title: f, itemGridLayout: g, $setting: y, tabs: w, isConditionFormLayout: C, isTreeSider: k, treeSiderConfig: S }) => { + const { classNames: E, onClickCallback: T } = le(ne), O = m.pick(y, ["column", "colWidth", "beforeRender", "afterRender", "style"]), A = Ti(l, u, p, d), M = X((D, j, z) => h(Mn, { className: R("ff-data-list-framework-item", E.item), operations: a ? A(j) : [], data: d ? { [d]: j } : j, children: D, onClickCallback: T }), [d, p, a, T, l, u]); + return F("div", { className: R("ff-data-list-framework", e), children: [h(i.sider, { isTreeSider: k, ...S }), F("div", { className: R("ff-data-list-container", E == null ? void 0 : E.container), children: [h(i.filter, { isConditionFormLayout: C }), h(i.toolbar, { title: f, tabs: w }), h(Xn, { ...O, ...g, primaryKey: p, itemRender: M, dataSource: n }), h(i.footer, { isPaginate: r, isOperations: o, operations: s })] })] }); +}, Mn = ({ className: t, operations: e, children: i, data: n, onClickCallback: r }) => F("div", { className: R("data-list-grid-layout-item", t), children: [h("div", { className: "data-list-grid-layout-item-container", children: i }), !!(e != null && e.length) && h("div", { className: "data-list-grid-layout-item-actions", children: e.map((a) => h("span", { className: "data-list-grid-layout-item-action", children: h(N.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 || Lt()) }, (a == null ? void 0 : a.uuid) || Lt())) })] }), Dn = ({ listCode: t, className: e, layouts: i = {}, dataSource: n, columns: r, isItemOperations: a, isBatchOperations: o, batchOperations: s, itemOperations: l, itemOperationsAccess: u, resource: d, primaryKey: p, title: f, tabs: g, isPaginate: y, isTreeSider: w, treeSiderConfig: C, isConditionFormLayout: k, ...S }) => { + const { classNames: E, onClickCallback: T } = le(ne), O = Ti(l, u, p, d), A = Dt(l, u, n, p, d); + return F("div", { className: R("ff-data-table-framework", e), children: [h(i.sider, { isTreeSider: w, ...C }), F("div", { className: R("ff-data-table-container", E == null ? void 0 : E.container), children: [h(i.filter, { isConditionFormLayout: k }), h(i.toolbar, { title: f, tabs: g }), h(Kn, { ...S, primaryKey: p, className: "ff-data-table-content", columns: r, dataSource: n, operationRender: A ? (M) => { + var D; + return h("div", { className: "ff-data-table-actions", children: (D = O(M)) == null ? void 0 : D.map((j, z) => h(N.Link, { size: "small", uuid: j.uuid, type: j.type, name: j.name, widget: j.widget, widgetType: j.widgetType, widgetProps: j.widgetProps, widgetData: j.widgetData, widgetSetting: j.widgetSetting, widgetContainerProps: j.widgetContainerSetting, data: M, confirm: j.confirm, onAfterClick: (x) => x !== !1 && (T == null ? void 0 : T(j.isRefresh, M)) }, j.uuid || z)) }); + } : null }), h(i.footer, { isPaginate: y, isOperations: o, operations: s })] })] }); +}, Jt = (t = [], e, i = null) => { + var n; + return (n = m.sortBy(t, ["y", "x"])) == null ? void 0 : n.map(({ i: r, x: a, y: o, w: s, h: l, field: { boxStyle: u, ...d } = {} }, p) => h("div", { className: "grid-layout-item", style: Ri(a, o, s, l, u), children: h(e, { ...d, basicForm: i }) }, r ?? p)); +}, Ri = (t, e, i, n, r = {}, a = 0) => { + const o = { "--grid-layout-h": `${n}`, "--grid-layout-w": `${i}`, "--grid-layout-x": `${t}`, "--grid-layout-y": `${e}`, "--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"] = ci(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"] = ci(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; +}, ci = (t, e, i, n) => `${t || 0}px ${e || 0}px ${i || 0}px ${n || 0}px`, ta = (t = "Text", e = "@pkg/ff/grid-layouts") => t != null && t.startsWith("@") || t != null && t.startsWith("blob:") ? t : `${e}/${t}`, Oi = ({ className: t, isConditionFormLayout: e }) => { + var f, g; + const [i, n] = L({}), { listCode: r, onKeywordChange: a, onConditionChange: o, getBase62params: s, classNames: l } = $.useContext(ne), { keyword: u, condition: d } = (s == null ? void 0 : s()) || {}, [p] = mt.useForm(); + return V(() => { + r && e && I.get(`/api/_/${r}/list-condition-form-layout`).then(({ resource: y, marginX: w, marginY: C, rowHeight: k, cols: S, fields: E }) => { + n({ resource: y, itemMargin: [w, C], rowHeight: k, cols: S, fields: E }); + }).catch(() => n({})); + }, [r, e]), V(() => { + p.setFieldsValue({ keyword: u, ...d }); + }, [JSON.stringify([u, d])]), h("div", { className: R("ff-data-list-filter", l.filter, t), children: h(mt, { form: p, layout: "vertical", autoComplete: "off", onFinish: ((f = i.fields) == null ? void 0 : f.length) > 1 ? (y) => o({ [i.resource]: y[i.resource] }, y.keyword) : () => { + }, onValuesChange: (y) => { + m.isEmpty(m.omit(y, ["keyword"])) || p.submit(); + }, children: ((g = i.fields) == null ? void 0 : g.length) > 1 ? h(Xt, { ...i, children: h(zn, { onReset: () => { + const { keyword: y, condition: w } = s("init") || {}; + p.setFieldsValue({ keyword: y, ...w }); + } }) }) : h("div", { className: "ff-data-list-filter-default-form ff-grid-layout-form", children: h("div", { className: "grid-layout-item", style: Ri(20, 0, 5, 2), children: h(mt.Item, { name: ["keyword"], children: h(ln.Search, { allowClear: !0, enterButton: "搜索", placeholder: "多关键字 | 分割", onSearch: (y) => a(y) }) }) }) }) }) }); +}, zn = ({ cols: t, fields: e, onReset: i }) => { + const [n, r] = L(!1), a = q(() => e == null ? void 0 : e.toReversed().some((o) => o.y > 1 || o.x + o.w >= t - 5), [t, e]); + return F(mt.Item, { label: " ", style: { "--item-span": 5 }, className: R("ff-data-list-filter-actions", { expanded: n }), children: [h(yt, { onClick: i, children: "重置" }), h(yt, { type: "primary", htmlType: "submit", children: "查询" }), a && h(N.Link, { className: "ff-data-list-filter-expanded-button", widget: () => r((o) => !o), type: "primary", name: n ? "关闭" : "展开", icon: n ? "icon-up" : "icon-down", iconPosition: "end" })] }); +}; +Oi.reservedFields = [{ x: 0, y: 0, h: 3, w: 5, field: { isVirtual: !0, widgetPrefix: "@pkg/ff/grid-layout-forms", widget: "Input", code: "keyword", label: "关键字", placeholder: "多关键字 | 分割", extras: { prefix: "icon-search" } } }]; +const Bn = ({ className: t, operations: e, isOperations: i, isPaginate: n }) => { + const { onPageChange: r, onPageSizeChange: a, onClickCallback: o, getBase62params: s } = $.useContext(ne), { total: l, page: u, pageSize: d } = (s == null ? void 0 : s()) || {}; + return i && !m.isEmpty(e) || n ? F("div", { className: R("ff-data-list-footer", t), children: [h("div", { className: "ff-data-list-actions", children: e == null ? void 0 : e.map((p, f) => h(N, { uuid: p.uuid, type: p.type, name: p.name, widget: p.widget, widgetType: p.widgetType, widgetProps: p.widgetProps, widgetData: p.widgetData, widgetSetting: p.widgetSetting, widgetContainerProps: p.widgetContainerSetting, onAfterClick: (g) => g !== !1 && (o == null ? void 0 : o(p.isRefresh, null)) }, p.uuid || f)) }), n && h(cn, { size: "small", total: l, pageSize: d, showSizeChanger: !1, showTotal: (p) => `第 ${u} 页 / 总共 ${p} 条`, onChange: r, onShowSizeChange: a })] }) : null; +}, Wn = [{ title: "parent 1", key: "0-0", children: [{ title: "parent 1-0", key: "0-0-0", disabled: !0, children: [{ title: "leaf", key: "0-0-0-0", disableCheckbox: !0 }, { title: "leaf", key: "0-0-0-1" }] }, { title: "parent 1-1", key: "0-0-1", children: [{ title: h("span", { style: { color: "#1677ff" }, children: "sss" }), key: "0-0-1-0" }] }] }], Un = ({ className: t, width: e = 280, isTreeSider: i }) => { + const { classNames: n } = le(ne); + return i ? h(dn.DirectoryTree, { className: R("ff-data-list-sider", n.sider, t), style: { "--sider-width": e }, showLine: !0, showIcon: !1, treeData: Wn }) : null; +}, qn = ({ className: t, title: e, tabs: i }) => { + const { getBase62params: n, onTabChange: r, onReload: a, classNames: o } = le(ne), { tab: s } = (n == null ? void 0 : n()) || {}, [l, u] = yn((i == null ? void 0 : i[0].value) ?? (i == null ? void 0 : i[0].code), { value: s, onChange: r }); + return F("div", { className: R("ff-data-list-toolbar", o.toolbar, t), children: [h("div", { className: "ff-data-list-title", children: e }), h(un, { className: "ff-data-list-tabs", itemRender: ({ label: d, code: p, value: f }) => h("span", { onClick: () => u(f ?? p), className: R("ff-data-list-tab", { active: (f ?? p) == l }), children: d }), items: i }), F("div", { className: "ff-data-list-actions", children: [h(N.Link, { icon: "icon-reload", widget: () => a() }), h(N.Link, { icon: "icon-setting" })] })] }); +}, Fi = ({ isItemGridLayout: t, theme: e, themeProps: i, onClickCallback: n, onReload: r, listCode: a, total: o = 0, page: s = 0, onPageChange: l, pageSize: u = 30, onPageSizeChange: d, tab: p, onTabChange: f, keyword: g, onKeywordChange: y, condition: w, onConditionChange: C, sider: k, onSiderChange: S, layouts: E, classNames: T = {}, payload: O = {}, ...A }) => { + const [M, D] = L(), j = X((x, K) => { + const B = { tab: p, page: s, pageSize: u, keyword: g, sider: k, condition: w, total: o, payload: O }; + return x && x != "init" ? m.get(B, x, K) : B; + }, [JSON.stringify(w), JSON.stringify(O), p, s, u, g, k, o]), z = q(() => { + let x = { sider: Un, filter: Oi, footer: Bn, toolbar: qn }; + E === !1 ? x = { sider: null, filter: null, footer: null, toolbar: null } : m.isPlainObject(E) && (x = Object.assign({}, x, E)); + for (const K in x) if (x[K]) { + if (nn(x[K])) { + const B = x[K]; + x[K] = (Ee) => $.cloneElement(B, Ee); + } + } else x[K] = () => h($.Fragment, {}); + return x; + }, [E]); + return V(() => { + e ? se.getWidgetComponent(e).then((x) => { + if (!x) throw `${e} not found`; + return x; + }).catch((x) => ({ default: () => `${x}` })).then((x) => D($.createElement(x.default, { ...A, layouts: z, $setting: i }))) : D(h(t ? Vn : Dn, { ...A, layouts: z, $setting: i })); + }, [e, i]), h(ne.Provider, { value: { classNames: T, listCode: a, onClickCallback: n, onReload: r, getBase62params: j, onPageChange: l, onPageSizeChange: d, onTabChange: f, onSiderChange: S, onKeywordChange: y, onConditionChange: C, setPage: l, setPageSize: d, setTab: f, setSider: S, setKeyword: y, setCondition: C }, children: M && $.cloneElement(M, A) }); +}; +Fi.propTypes = { classNames: b.exact({ sider: b.string, filter: b.string, footer: b.string, toolbar: b.string, container: b.string, content: b.string, item: b.string }), layouts: b.oneOfType([b.exact({ sider: b.oneOfType([b.elementType, b.element]), filter: b.oneOfType([b.elementType, b.element]), footer: b.oneOfType([b.elementType, b.element]), toolbar: b.oneOfType([b.elementType, b.element]) }), b.bool]) }; +var xe, be, je, Et; +const pe = class pe { + constructor() { + v(this, be, null); + v(this, je, /* @__PURE__ */ new Map()); + v(this, Et, () => { + if (c(this, be)) return c(this, be).port.postMessage({ command: "status", data: [] }); + W(this, be, new SharedWorker(new URL("/ff-worker/res-ws.js", self.location))), c(this, be).port.onmessage = (e) => { + var i, n; + (i = e.data) != null && i.uuid ? c(this, je).forEach((r, a) => { + var o; + (r == "*" || (o = r == null ? void 0 : r.includes) != null && o.call(r, e.data.uuid)) && a(e.data); + }) : ((n = e.data) == null ? void 0 : n.readyState) == WebSocket.CLOSED && I.get("/api/user-api-token").then(({ token: r, expire_at: a }) => { + c(this, be).port.postMessage({ command: "initWs", data: [`ws${m.trimStart(I.appUrl, "http")}api/user-resource-status-ws?token=${r}`] }); + }); + }, c(this, be).port.postMessage({ command: "status", data: [] }); + }); + P(this, "subscribe", (e, i = []) => (i ? Array.isArray(i) && i.length == 0 ? i = "*" : Array.isArray(i) || (i = [i].flat()) : i = "*", c(this, je).set(e, i), c(this, je).size == 1 && c(this, Et).call(this), () => this.unsubscribe(e))); + P(this, "unsubscribe", (e) => c(this, je).delete(e)); + if (c(pe, xe)) return c(pe, xe); + } +}; +xe = new WeakMap(), be = new WeakMap(), je = new WeakMap(), Et = new WeakMap(), v(pe, xe, null), P(pe, "getInstance", () => (c(pe, xe) || W(pe, xe, new pe()), c(pe, xe))); +let zt = pe; +const Ai = zt.getInstance(), Yt = $.forwardRef(({ listCode: t, base62params: e, className: i, theme: n, themeProps: r, layouts: a, classNames: o }, s) => { + const [{ resource: l, primaryKey: u, batchOperations: d = [], itemOperations: p = [], columns: f = [], themeConfig: g, theme: y, isConditionFormLayout: w = !1, isTreeSider: C, treeSiderConfig: k, isItemGridLayout: S, itemGridLayout: { themeConfig: E, ...T } = {}, title: O, isPaginate: A, tabs: M }, D] = L({ isItemGridLayout: !1, itemGridLayout: {} }), j = In(t, e), [{ dataSource: z, itemOperationsAccess: x, condition: K, tab: B, keyword: Ee, page: ut, total: pt, pageSize: Nt, sider: te, onConditionChange: Ui, onTabChange: qi, onKeywordChange: Ki, onPageChange: _i, onPageSizeChange: Hi, onSiderChange: Ji, onReload: Tt, payload: Yi }, ti] = jn(j, t, u, l), Gi = Dt(p, x, z, u), Xi = Dt(d); + V(() => { + let re = null; + return t && I.get(`/api/_/${t}`).resp(({ data: gt, res: Zi }) => { + gt != null && gt.isDynamicRefresh && (re = Ai.subscribe(() => Tt(), Zi)), D(gt); + }).catch(() => D({})), () => re == null ? void 0 : re(); + }, [t]), $.useImperativeHandle(s, () => ({ onReload: Tt, onClickCallback: ti })); + const Qi = { listCode: t, title: O, classNames: o, layouts: a, resource: l, primaryKey: u, theme: n || y, themeProps: r || g, isTreeSider: C, treeSiderConfig: k, isPaginate: A, tabs: M, isItemOperations: Gi, itemOperations: p == null ? void 0 : p.map((re) => m.isEmpty(re == null ? void 0 : re.confirm) ? re : { ...re, confirm: Object.assign({}, re.confirm, { getPopupContainer: () => document.body }) }), isBatchOperations: Xi, batchOperations: d, isItemGridLayout: S, columns: f, itemGridLayout: { ...T, themeProps: E }, isConditionFormLayout: w, itemOperationsAccess: x, dataSource: z, onConditionChange: Ui, onTabChange: qi, onKeywordChange: Ki, onPageChange: _i, onPageSizeChange: Hi, onSiderChange: Ji, condition: K, tab: B, keyword: Ee, page: ut, total: pt, pageSize: Nt, sider: te, payload: Yi }; + return h(Fi, { ...Qi, className: R("ff-data-list-helper", i), onReload: Tt, onClickCallback: ti }); +}), Li = (t, e, i = !0) => i !== !0 && i-- <= 0 ? [] : m.isArray(t) && !m.isEmpty(t) ? t.reduce((n, r) => (Reflect.has(r, e) && Reflect.has(r, "children") && n.push(r[e]), Reflect.has(r, "children") && !m.isEmpty(r.children) ? n.concat(Li(r.children, e, i)) : n), []) : [], Kn = ({ className: t, primaryKey: e, columns: i = [], dataSource: n = [], operationRender: r, operationWidth: a = 180, components: o = {}, ...s }) => { + const { classNames: l } = le(ne), u = _(null), d = _(null), [p, f] = L([]), [g, y] = L({ width: 0, height: 0 }); + V(() => { + f(Li(n, e)); + }, [n, e]), rn(() => { + const k = new ResizeObserver(() => { + var S; + y({ width: ((S = u.current) == null ? void 0 : S.nativeElement.querySelector(".ant-table-body").scrollWidth) || d.current.offsetWidth, height: d.current.offsetHeight }); + }); + return d.current && k.observe(d.current), () => { + d.current && k.unobserve(d.current); + }; + }, []); + const w = An(i), C = Ln(o); + return h("div", { ref: d, className: R("ff-data-list-table", l.content, t), children: g.height ? h(pn, { bordered: !0, ...s, components: C, ref: u, rowKey: (k) => (k == null ? void 0 : k[e]) ?? Math.random(), columns: w == null ? void 0 : w.concat(r ? [{ title: "操作", align: "center", fixed: "right", width: `${Math.ceil(a / g.width * 100).toFixed(2)}%`, render: (k, S, E) => r(S, E) }] : []), dataSource: n, size: "middle", scroll: { x: "max-content", y: g.height - 50 }, pagination: !1, expandable: { defaultExpandAllRows: !0, expandRowByClick: !0, onExpandedRowsChange: f, expandedRowKeys: p } }) : null }); +}, _n = "RC_FORM_INTERNAL_HOOKS", Hn = (t) => { + const [e, i] = $.useState({ items: [] }); + return V(() => { + t && I.get(`/api/_/${t}`).then(({ uuid: n, code: r, name: a, resource: o, primaryKey: s, marginX: l, marginY: u, cols: d, rowHeight: p, fields: f, theme: g, themeSetting: y, groups: w }) => ({ uuid: n, code: r, name: a, resource: o, primaryKey: s, marginX: l, marginY: u, cols: d, rowHeight: p, theme: g, themeProps: y, groups: w, items: f })).then(i); + }, [t]), e; +}, Jn = (t, { initialValue: e, initialValueLanguage: i, convertJs: n, convertJsSetting: r, type: a = "string" }, o = null) => { + const s = _(!1), l = le(wi), [u, d] = L(), [p, f] = L(i != "javascript" && t ? l.getFieldValue(t) : void 0), { registerWatch: g } = l.getInternalHooks(_n) || {}; + return V(() => g == null ? void 0 : g((y, w, C) => { + if (!s.current) return; + const k = m.get(w, t); + m.isEqual(k, p) || f(oe(k, a)); + }), [p]), V(() => { + i == "javascript" && e ? Fe.exec(e, {}, { getFieldValueForBasicForm: (y) => o ? o.getFieldValue(y) : l.getFieldValue(y), getFieldValue: (y) => l.getFieldValue(y) }).then((y) => f(oe(y, a))).catch((y) => notification.error({ message: `布局数据错误: ${JSON.stringify(y)}` })).finally(() => s.current = !0) : (e && f(oe(e ?? l.getFieldValue(t), a)), s.current = !0); + }, [e, i]), lt(() => { + s.current && n && new wt([n, r]).toValue(p, l.getFieldsValue(!0)).then(d).catch((y) => { + d(y), console.error("布局数据转换错误: ", y, n); + }); + }, [p, n, r]), [u ?? p, p]; +}, ia = (t, e, i = null) => q(() => Jt(t, e, i), [t]), ji = (t, e, i = {}, n = {}, r = {}, a = null) => { + const o = le(wi), s = xt(), l = _(!0), u = _([]), [d, p] = L(e), [f, g] = L(), y = ie.useWatch((w) => JSON.stringify(m.pick(w, u.current)), o) || "{}"; + return ct(() => { + t && Fe.exec(t, i, { ...n, getFieldValueForBasicForm: (w) => r ? r.getFieldValue(w) : null, getFieldValue: m.wrap(o.getFieldValue, (w, C) => (u.current.some((k) => m.isEqual(k, C)) || (u.current.push(C), s()), w == null ? void 0 : w(C))), isFieldTouched: o.isFieldTouched, isFieldsTouched: o.isFieldsTouched }).then((w) => { + l.current && (p(w), g(null)); + }).catch((w) => { + l.current && (p(e), g(w)); + }); + }, [t, y, o, i, n]), V(() => () => l.current = !1, []), t ? [a ? oe(d, a) : d, f] : [a ? oe(e, a) : e, null]; +}, Yn = ({ widget: t, widgetPrefix: e = "@pkg/ff/grid-layouts", basicForm: i, ...n }) => { + const r = t != null && t.startsWith("@") || t != null && t.startsWith("blob:") ? t : `${e}/${t}`, [a, o] = L(); + return V(() => { + r && se.getWidgetComponent(r).then(({ defaultProps: s = {}, default: l }) => ({ default: Gn(l, s, i) })).catch((s) => ({ default: () => `${s}` })).then((s) => o($.createElement(s.default, n))); + }, [r]), a; +}, Gn = (t, e = {}, i = null) => (n) => { + const { code: r, label: a, extras: o, isVirtual: s, initialValue: l, initialValueLanguage: u, convertJs: d, convertJsSetting: p, value: f, ...g } = m.merge({}, e, n), [y, w] = Jn(s ? null : r, { initialValue: l, initialValueLanguage: u, convertJs: d, convertJsSetting: p, type: (g == null ? void 0 : g.type) || "string" }, i), C = q(() => { + const E = Object.keys((e == null ? void 0 : e.extras) || {}); + return m.over([m.partialRight(m.pick, E), m.partialRight(m.omit, E)]); + }, [e == null ? void 0 : e.extras]), [k, S] = C(g); + return h(t, { ...S, value: y, rawValue: w, $setting: Object.assign({}, o, k) }); +}, Ii = ({ theme: t, basicForm: e, items: i = [{ key: "default", label: "默认" }], fields: n = [], itemRender: r, chunks: a = [], children: o, $setting: s = {}, ...l }) => { + const [u, d] = L(); + V(() => { + t ? se.getWidgetComponent(t).then((f) => { + if (!(f != null && f.default)) throw "not found"; + return f; + }).catch((f) => ({ default: () => `${t} ${f}` })).then((f) => d($.createElement(f.default, {}))) : d(null); + }, [t]); + const p = q(() => i == null ? void 0 : i.map((f) => ({ ...f, children: r(f, n == null ? void 0 : n.filter((g) => !(g != null && g.group) && f.key == "default" || g.group == f.key), f.key == "default" ? o : null) })).concat(a), [i, o, a]); + return u && $.cloneElement(u, { items: p, basicForm: e, $setting: { ...s, ...l } }); +}, Vi = ({ name: t, form: e = null, basicForm: i = null, style: n = {}, className: r, cols: a = 12, rowHeight: o = 21, containerPadding: s = [0, 0], itemMargin: l = [4, 0], formProps: u = {}, formFields: d = [], fields: p = [], data: f, theme: g, themeProps: y = {}, groups: w = [{ key: "default", label: "默认" }], children: C, ...k }) => { + const [S] = ie.useForm(e), E = q(() => [{ name: "__PROPS__", value: u }].concat(d), [u, d]); + lt(() => (S.setFieldsValue(f), () => S.resetFields()), [f]); + const T = (O, A, M) => { + const D = Jt(A, Yn, i); + return F("div", { className: R("ff-grid-layout", r), style: { ...n, "--grid-layout-item-margin-y": `${(l == null ? void 0 : l[0]) || 0}px`, "--grid-layout-item-margin-x": `${(l == null ? void 0 : l[1]) || 0}px`, "--grid-layout-container-padding-y": `${(s == null ? void 0 : s[0]) || 0}px`, "--grid-layout-container-padding-x": `${(s == null ? void 0 : s[1]) || 0}px`, "--grid-layout-cols": a, "--grid-layout-row-height": `${o}px` }, children: [D, M && $.cloneElement(M, { cols: a, rowHeight: o, itemMargin: l, containerPadding: s, fields: A, basicForm: i })] }); + }; + return h(ie, { ...k, fields: E, form: S, component: !1, children: g ? h(Ii, { ...y, items: w, theme: g, itemRender: T, fields: p, children: C, basicForm: i }) : T(0, p, C) }); +}, na = /* @__PURE__ */ ((t) => function({ code: e, data: i, ...n }) { + const { uuid: r, resource: a, items: o, hides: s, rowHeight: l, marginX: u, marginY: d, cols: p, theme: f, themeProps: g, groups: y } = Hn(e) || {}, w = q(() => [{ name: "__RESOURCE__", value: a }, { name: "__LAYOUT_KEY__", value: e }, { name: "__LAYOUT_UUID__", value: r }], [e, r, a]); + return a && h(t, { name: e, theme: f, themeProps: g, groups: y, ...n, fields: o, formFields: w, rowHeight: l, cols: p, itemMargin: [u, d], data: a ? { [a]: i } : i }); +})(Vi), Xn = ({ column: t = 0, colWidth: e = 0, cols: i, rowHeight: n, itemMargin: r, fields: a, primaryKey: o, dataSource: s, itemClassName: l, beforeRender: u = null, afterRender: d = null, itemRender: p = (S, E, T) => S, empty: f = h(gn, { description: null }), className: g, style: y = {}, theme: w, themeProps: C = {}, groups: k = [{ key: "default", label: "默认" }] }) => { + const { classNames: S } = le(ne), E = q(() => h(Vi, { groups: k, theme: w, themeProps: C, cols: i, rowHeight: n, itemMargin: r, fields: a, className: l }), [a, i, n, r, k, w, C]), T = m.isEmpty(s); + return F("div", { className: R("ff-data-list-content", S.content, g), style: Object.assign({}, y, t && { "--col-num": t }, e && { "--col-width": e }), children: [u == null ? void 0 : u(s), T ? f : s.map((O, A) => { + const M = p($.cloneElement(E, { data: O }), O, A); + return $.cloneElement(M, { key: `${(O == null ? void 0 : O[o]) ?? A}-${Nn(O)}` }); + }), d == null ? void 0 : d(s)] }); +}, Qn = ({ component: t, $props: e }) => { + const { base62params: i } = st(e, {}); + return h(G, { children: h(Yt, { listCode: t, base62params: I.decode(i) }) }); +}, ra = () => h(Mi, {}), Mi = () => "Empty", Zn = ({ component: t, $setting: e, $props: i }) => { + const [n, r] = L(); + V(() => { + if (!t) return r(h(Mi, { description: null })); + se.getWidgetComponent(t).catch((o) => ({ default: () => `${o}` })).then((o) => $.createElement(o.default, { $setting: e })).then(r); + }, [t]); + const a = st(i, {}); + return n ? $.cloneElement(n, a) : null; +}, aa = () => "NotFoundPage"; +var Pe, ae, Ne, Te, Ze, et; +const ge = class ge { + constructor() { + v(this, ae, /* @__PURE__ */ new Map()); + v(this, Ne, {}); + v(this, Te, null); + P(this, "init", (e, i) => { + W(this, ae, e), W(this, Ne, i); + }); + P(this, "get", (e) => (c(this, ae).has(e) || (e = Array.from(c(this, ae).keys()).find((i) => c(this, ae).get(i).uri === e)), c(this, ae).get(e) || {})); + P(this, "redirect", (e, i, n = {}) => { + const { uri: r, type: a, widgetProps: o } = this.get(e) || {}, { router: s, query: l, ...u } = i || {}, d = Object.assign({}, u, s), p = Object.assign({}, u, l); + a == "list" && (d.base62params = I.encode(d != null && d.base62params ? d.base62params : d)); + let f = wn(r || e, d); + const g = new URLSearchParams(); + for (const y in o || {}) (o == null ? void 0 : o.type) == "query" && Object.has(p, y) && g.append(y, JSON.stringify(p[y])); + return g.size > 0 && (f = `${f}?${g.toString()}`), n != null && n.isOpenWindow ? window.open(f) : c(this, Te).navigate(f, { replace: !!(n != null && n.isReplaceRouteHistory) }); + }); + P(this, "getMenus", (e) => { + var i; + return ((i = c(this, Ne)) == null ? void 0 : i[e]) || []; + }); + P(this, "findMenuPathByUuid", (e) => { + let i = []; + for (const n in c(this, Ne)) if (i = c(this, Ze).call(this, c(this, Ne)[n], e, [n]), i.length > 1) return i; + return i; + }); + P(this, "getMenusByRouteUuid", (e) => c(this, et).call(this, e, Object.values(c(this, Ne)).flat())); + v(this, Ze, (e, i, n = []) => { + if (m.isEmpty(e)) return n; + for (const { uuid: r, children: a } of e) { + if (r == i) return n.concat(r); + if (!m.isEmpty(a)) return n.concat(r, c(this, Ze).call(this, a, i)); + } + return n; + }); + v(this, et, (e, i) => { + var r; + let n = []; + for (const a of i) a.widgetType == "redirect" && (a.uuid == e || a.widget == e ? n.push(a) : (r = a.children) != null && r.length && (n = n.concat(c(this, et).call(this, e, a.children)))); + return n; + }); + P(this, "getCurrentMenu", () => { + const { uuid: e } = this.getCurrentRoute() || {}; + if (!e) return; + const i = this.getMenusByRouteUuid(e); + return m.isEmpty(i) ? void 0 : i[0]; + }); + P(this, "getCurrentRoute", (e = 0) => { + var n; + const i = (n = c(this, Te).state.matches[c(this, Te).state.matches.length - 1 - e]) == null ? void 0 : n.route; + if (!i) return null; + for (let [r, a] of c(this, ae)) if (a.uri === i.path) return a; + return null; + }); + P(this, "getPageParams", (e) => { + var r, a, o; + let i = "", n = {}; + if (Ci()) n = bn(), i = (r = Cn()) == null ? void 0 : r.search; + else { + const { location: s = {}, matches: l = [] } = ((a = c(this, Te)) == 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; + }), e ? m.get(n, e) : n; + }); + P(this, "createBrowserRouter", (e = {}) => { + if (c(this, ae).size == 0) return null; + const i = Ve.get("Common.WEBSITE_DEFAULT_THEME", "@pkg/ff/frameworks/DefaultTheme"), n = Ve.get(se.checkUserToken() ? "Common.WEBSITE_LOGIN_REDIRECT" : "Common.WEBSITE_DEFAULT", "/index"), r = { [i]: 0 }, a = (s, l) => () => Promise.all([se.getWidgetComponent(s), st(l)]).then(([u, d]) => [u.default || function() { + return `${s}`; + }, d]).then(([u, d]) => ({ Component: () => $.createElement($i, {}, $.createElement(u, { $setting: d })) })), o = Array.from(c(this, ae).values()).reduce((s, { uuid: l, uri: u, name: d, type: p, component: f, widgetSetting: g, widgetProps: y, isLogin: w, isLayout: C, extra: k }) => { + let S = {}, E = 0; + switch (p) { + case "list": + S.element = $.createElement(Qn, { component: f, $props: y }); + break; + case "fsdpf-component": + S.element = $.createElement(Zn, { key: f, component: f, $setting: g, $props: y }); + } + const T = (k == null ? void 0 : k.theme) ?? (k == null ? void 0 : k.layout); + if (T) { + const O = (k == null ? void 0 : k.themeProps) ?? (k == null ? void 0 : k.layoutProps); + if (!r[T]) return r[T] = s.length, [...s, { path: "/", lazy: a(T, O), children: [{ path: u, ...S }] }]; + E = r[T]; + } + return C && E > -1 ? (s[E].children.push({ path: u, ...S }), s) : [...s, { path: u, ...S }]; + }, [{ path: "/", lazy: a(i, {}), children: [] }]); + return o.push({ index: !0, element: $.createElement(er, { to: n, replace: !0 }) }), W(this, Te, kn(o, e)); + }); + if (c(ge, Pe)) return c(ge, Pe); + } +}; +Pe = new WeakMap(), ae = new WeakMap(), Ne = new WeakMap(), Te = new WeakMap(), Ze = new WeakMap(), et = new WeakMap(), v(ge, Pe, null), P(ge, "getInstance", () => (c(ge, Pe) || W(ge, Pe, new ge()), c(ge, Pe))); +let Bt = ge; +const er = ({ to: t, replace: e }) => Ci() ? $.createElement($n, { to: t, replace: e }) : (window.document.location = t, "redirect"), $e = Bt.getInstance(), Me = new Worker(new URL("/ff-worker/index.js", self.location)), di = { getConfigure: (t) => Ve.get(t), route: { redirect: (...t) => $e.redirect(...t), getPageParams: (...t) => $e.getPageParams(...t), getCurrentRoute: () => $e.getCurrentRoute() }, popup: { notification: (...t) => ee.notification(...t), success: (...t) => ee.success(...t), error: (...t) => ee.error(...t), form: (...t) => ee.form(...t), modal: (...t) => ee.modal(...t), confirm: (...t) => ee.confirm(...t) } }; +var St, We, Re; +const U = class U { + constructor() { + P(this, "exec", (e, i = {}, n = {}, r = "") => new Promise((a, o) => { + if (!/^(?!\s*(\/\/|\/\*|\*)).*?\S+/m.test(e)) return a(); + const s = ri(U, St)._++; + c(U, We).set(s, n), U.mQueue.set(s, [a, o]), Me.postMessage({ id: s, session: r, category: "eval", method: e, args: i }); + })); + P(this, "clear", (e) => Me.postMessage({ session: e, category: "clear" })); + if (c(U, Re)) return c(U, Re); + Promise.resolve().then(() => xr).then((e) => { + di.http = e.http; + }), Me.addEventListener("message", ({ data: { id: e, task_id: i, method: n, args: r, category: a, data: o, error: s, session: l } }) => { + if (a === "eval" && U.mQueue.has(e)) s !== null ? U.mQueue.get(e)[1](s) : U.mQueue.get(e)[0](o), c(U, We).delete(e), U.mQueue.delete(e); + else if (a === "util") try { + const u = m.get(di, n.split("/")) || m.get(c(U, We).get(i), n.split("/")); + if (!m.isFunction(u)) throw `${n} not found`; + Promise.resolve(Reflect.apply(u, void 0, r)).then((d) => { + Me.postMessage({ id: e, task_id: i, category: a, method: n, args: r, session: l, data: d, error: null }); + }).catch((d) => { + Me.postMessage({ id: e, task_id: i, category: a, method: n, args: r, session: l, data: null, error: d }); + }); + } catch (u) { + Me.postMessage({ id: e, task_id: i, category: a, method: n, args: r, session: l, data: null, error: u }); + } + }, !1); + } +}; +St = new WeakMap(), We = new WeakMap(), Re = new WeakMap(), P(U, "mQueue", /* @__PURE__ */ new Map()), v(U, St, 0), v(U, We, /* @__PURE__ */ new Map()), v(U, Re, null), P(U, "getInstance", () => (c(U, Re) || W(U, Re, new U()), c(U, Re))); +let Wt = U; +const Fe = Wt.getInstance(), xt = () => { + const t = _(!0), [, e] = $.useReducer((i) => i + 1, 0); + return V(() => () => t.current = !1, []), () => t.current && e(); +}, oa = (t) => { + const e = _(); + return V(() => { + e.current = t; + }, [t]), e.current; +}, sa = (t) => { + const [e, i] = L(t), n = _(null), r = X((a, o) => { + n.current = o, i(a); + }, []); + return V(() => { + n.current && (n.current(e), n.current = null); + }, [e]), [e, r]; +}, lt = (t = (n) => { +}, e, i = m.isEqual) => { + const n = $.useRef(); + i(e, n.current) || (n.current = m.cloneDeep(e)), $.useEffect(t, [n.current]); +}, ct = lt, Di = (t, e = "string") => { + var i; + if (!Array.isArray(t)) return t; + for (let n = 0; n < t.length; n++) t[n].value = oe((i = t[n]) == null ? void 0 : i.value, e), t[n] && Reflect.has(t[n], "children") && (t[n].children = Di(t[n].children, e)); + return t; +}, la = (t, e = "json", i = "string", n, r = null) => { + const [a] = ie.useForm(n), [o, s] = L([{ label: "无", value: "", disabled: !0 }]), l = _([]), u = ie.useWatch((d) => l.current.length === 0 ? null : m.pick(d, l.current), a) || null; + return V(() => { + Array.isArray(t) ? s(t) : e === "javascript" && t ? Fe.exec(t, {}, { getFieldValue: (d) => (l.current.includes(d) || l.current.push(d), a.getFieldValue(d)), getFieldValueForBasicForm: (d) => (l.current.includes(d) || l.current.push(d), r ? r.getFieldValue(d) : a.getFieldValue(d)) }).then((d) => { + s(oe(d, "array")); + }).catch((d) => console.error("useOptions", d)) : t && s(oe(t, "array")); + }, [t, e, u]), Di(o, i); +}, ca = (t) => { + const [e, i] = L(), n = { type: "GET" }; + if (typeof t == "string" ? n.url = t : m.isPlainObject(t) && Object.assign(n, t), !(n != null && n.url)) throw "url is required"; + const r = (a) => I.request(n, !1).resp((o) => (console.log("useSubscribeRequest", a), i(o), o)); + return lt(() => { + let a = null; + return r().then((o) => { + a = Ai.subscribe(m.throttle(r, 180, { leading: !1, trailing: !0 }), o.res); + }), () => a == null ? void 0 : a(); + }, n), e; +}, tr = (t) => { + const [e, i] = $.useState({ items: [], hides: [] }); + return $.useEffect(() => { + t && I.get(`/api/_/${t}`).then(({ pk: n, uuid: r, code: a, resource: o, align: s, cols: l, rowHeight: u, marginX: d, marginY: p, listenChangeFields: f, listenChangeFieldsFunc: g, fields: y, theme: w, themeSetting: C, groups: k }) => ({ pk: n, uuid: r, code: a, resource: o, align: s, cols: l, rowHeight: u, marginX: d, marginY: p, theme: w, themeProps: C, groups: k, listenChangeFields: f, listenChangeFieldsFunc: g, ...y.reduce((S, E) => { + var T; + return (T = E == null ? void 0 : E.field) != null && T.hidden ? S.hides.push(E == null ? void 0 : E.field) : S.items.push(E), S; + }, { items: [], hides: [] }) })).then(i); + }, [t]), e; +}, ir = ({ max: t = 0, min: e = 0, type: i = "", message: n, pattern: r, required: a = !1, validator: o } = {}, s, l) => { + const [u, d] = L([]); + return V(() => { + 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 (i) { + case "string": + p.push({ type: i, max: t, min: e, message: n || (e && t ? `字符必须在 ${e} ~ ${t} 之间` : `${t ? "最多能有" : "最少要有"} ${e || t} 个字符`) }); + break; + case "pattern": + p.push({ type: "string", pattern: r, message: n }); + break; + case "validator": + o && p.push(({ getFieldValue: f }) => ({ validator: async (g, y) => { + const w = await Fe.exec(o, { value: y, fieldName: s }, { getFieldValue: f }); + return m.isString(w) && w ? Promise.reject(w) : m.isBoolean(w) && !w ? Promise.reject(n) : Promise.resolve(); + } })); + } + d(p); + }, [t, e, i, n, r, a, o]), u; +}, nr = (t, e, i) => { + const [n, r] = L(null); + return V(() => { + const { initDataUri: a = `/api/${t}`, initDataMethod: o = "GET" } = i || {}; + e && I.request({ method: o, url: m.trimEnd(`${a}/${e}`, "/") }).then((s) => { + r(s); + }); + }, [t, e, i]), n; +}, rr = (t, e, i) => X((n, r = { serialize: (a) => a, onSuccess: () => { +}, onFail: (a) => (a == null ? void 0 : a.errorFields) && ee.error("请先完善表单信息", { duration: 2e3 }) }) => { + const a = n.getFieldValue("__RESOURCE__"), { submitDataUri: o = `/api/${t}`, submitDataMethod: s = "POST" } = i || {}; + return n.validateFields().then((l) => a ? m.pick(l, [a]) : l).then(r.serialize).then((l) => I.request({ method: s, url: m.trimEnd(`${o}/${e || ""}`, "/"), data: l }).msg(r.onSuccess)).catch(r.onFail); +}, [t, e, i]), ar = (t, e, i, n) => { + const r = nr(e, i, n); + V(() => { + r ? t.setFieldsValue(r) : t.resetFields(); + }, [t, r]); + const a = rr(e, i, n); + return m.partial(a, t); +}, or = (t, e, i = [], n = {}) => { + const r = _({}), a = _(), o = m.debounce(xt(), 180), s = ["disabled", "required"], l = (f, g) => { + s.includes(f) && (r.current[f] = g), o(); + }, u = q(() => ({ setDisabled: (f) => l("disabled", f), setRequired: (f) => l("required", f), getDisabled: () => r.current.disabled, getRequired: () => r.current.required }), [e]), [d, p] = ji(e, -1, {}, u, n); + if (!p && a.current != d && (d >= 0 || !m.isEmpty(i == null ? void 0 : i[d]))) { + a.current = d; + const { widget: f, widgetPrefix: g, props: y } = i == null ? void 0 : i[d]; + t = vi(f, g), r.current = m.merge(y, m.pick(r.current, s)); + } + return [t, r.current]; +}, ui = (t) => t === void 0 || t === !1 ? "" : (Array.isArray(t) ? t : [t]).join("_"), da = ({ value: t, onChange: e }, i = null) => { + const n = _(), [r] = ie.useForm(i), a = _({}); + return ct(() => { + m.isEqual(n.current, t) || r.setFieldsValue(t); + }, [t]), V(() => () => r.resetFields(), []), [q(() => r.__INTERNAL__ ? r : { ...r, __INTERNAL__: { itemRef: (o) => (s) => { + const l = ui(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 = ui(o); + return a.current[s]; + } }, [r]), (o, s) => { + n.current = s, e == null || e(s); + }]; +}, Gt = ({ widget: t = "Input", widgetPrefix: e = "@pkg/ff/grid-layout-forms", widgetDecorator: i, subWidgets: n = [], basicForm: r, ...a }) => { + const o = vi(t, e), [s, l] = or(o, i, n, r), [u, d] = L(); + return V(() => { + s && se.getWidgetComponent(s).then(({ defaultProps: p = {}, default: f }) => ({ default: sr(f, p, r) })).catch((p) => ({ default: () => `${p}` })).then((p) => d($.createElement(p.default, a))); + }, [s]), u && $.cloneElement(u, { ...a, ...l }); +}, sr = (t, e = {}, i = null) => (n) => { + const { type: r, code: a, label: o, noStyle: s, placeholder: l, required: u = !1, extras: d, validators: p, help: f, isVirtual: g, $isReserved: y, initialValue: w, initialValueLanguage: C, ...k } = m.omit(m.merge({}, e, n), ["convertJs", "convertJsSetting", "widget", "widgetPerfix", "widgetDecorator", "subWidgets", "boxStyle"]), S = ir(Object.assign({}, p, u ? { required: !0 } : {}), a, r), E = q(() => { + const D = Object.keys((e == null ? void 0 : e.extras) || {}); + return m.over([m.partialRight(m.pick, D), m.partialRight(m.omit, D)]); + }, [e == null ? void 0 : e.extras]), [T, O] = E(k), A = { label: o, noStyle: s, colon: !1, layout: "vertical" }, M = X((D) => D == null ? void 0 : oe(D, r), [r]); + return h(_t, { name: a, rules: S, initialValue: M(w), normalize: M, children: (D, j, z) => { + var x; + return h(t, { type: r, rcform: z, basicForm: i, itemProps: { validateStatus: j.errors.length > 0 ? "error" : "success", tooltip: f || null, help: j.errors.length > 0 ? j.errors.join("、") : null, required: ((x = S == null ? void 0 : S[0]) == null ? void 0 : x.required) || !1, ...A }, fieldProps: { placeholder: l, ...O, ...D }, $setting: Object.assign({}, d, T) }); + } }); +}, Xt = ({ name: t, form: e = null, basicForm: i = null, style: n = {}, className: r, cols: a = 24, rowHeight: o = 16, itemMargin: s = [8, 16], containerPadding: l = [0, 0], fields: u = [], hides: d = [], primaryKey: p = 0, formProps: f = {}, formFields: g = [], listenChangeFields: y, listenChangeFieldsFunc: w, onValuesChange: C, theme: k, themeProps: S = {}, groups: E = [{ key: "default", label: "默认" }], children: T, ...O }) => { + const [A] = ie.useForm(e), M = X((z, x) => { + C == null || C(z, x), w && Array.isArray(y) && Fe.exec(w, { changedValues: z, allValues: x }, { getFieldValue: A.getFieldValue, setFieldValue: A.setFieldValue, setFieldsValue: A.setFieldsValue, isFieldTouched: A.isFieldTouched, isFieldsTouched: A.isFieldsTouched }).catch((K) => console.error("onFormValuesChange", t, K)); + }, [t, A, C, y, w]), D = q(() => [{ name: "__PROPS__", value: f }, { name: "__PRIMARY_KEY__", value: p }].concat(g), [p, f, g]), j = (z, x, K) => { + const B = Jt(x, Gt, i); + return F("div", { className: R("ff-grid-layout-form", r), style: { ...n, "--grid-layout-item-margin-x": `${(s == null ? void 0 : s[0]) ?? 8}px`, "--grid-layout-item-margin-y": `${(s == null ? void 0 : s[1]) ?? 16}px`, "--grid-layout-container-padding-y": `${(l == null ? void 0 : l[0]) || 0}px`, "--grid-layout-container-padding-x": `${(l == null ? void 0 : l[1]) || 0}px`, "--grid-layout-cols": a, "--grid-layout-row-height": `${o}px` }, children: [B, K && $.cloneElement(K, { cols: a, rowHeight: o, itemMargin: s, containerPadding: l, fields: x, basicForm: i })] }); + }; + return F(ie, { ...O, form: A, fields: D, onValuesChange: M, children: [k ? h(Ii, { ...S, items: E, theme: k, itemRender: j, fields: u, children: T, basicForm: i }) : j(0, u, T), d == null ? void 0 : d.map((z) => { + var x; + return h(_t, { name: z.code, children: h(lr, { form: A, basicForm: i, name: z.code, type: z.type, initialValue: z.initialValue, initialValueLanguage: (x = z.extras) == null ? void 0 : x.initialValueLanguage }) }, JSON.stringify(z.code)); + })] }); +}, lr = ({ type: t, initialValue: e, initialValueLanguage: i, onChange: n, basicForm: r }) => { + const [a, o] = ji(i == "javascript" && e, i == "javascript" ? void 0 : e, {}, {}, r); + return V(() => { + i == "javascript" ? n(oe(a, t)) : e && n(oe(e, t)); + }, [t, e, a]), null; +}; +Xt.propTypes = { fields: b.array, hides: b.array }; +const cr = /* @__PURE__ */ ((t) => ({ code: e, isPreview: i = !1, ...n }) => { + const { align: r, autoComplete: a, resource: o, items: s, hides: l, rowHeight: u, marginX: d, marginY: p, cols: f, listenChangeFields: g, listenChangeFieldsFunc: y, pk: w, uuid: C, theme: k, themeProps: S, groups: E } = tr(e), T = q(() => [{ name: "__PK__", value: w }, { name: "__RESOURCE__", value: o }, { name: "__LAYOUT_KEY__", value: e }, { name: "__LAYOUT_UUID__", value: C }], [w, e, C, o]); + return h(t, { name: e, autoComplete: a, theme: k, themeProps: S, groups: E, ...n, formFields: T, listenChangeFields: g, listenChangeFieldsFunc: y, fields: s, hides: l, cols: f, rowHeight: u, itemMargin: [d, p] }); +})(Xt), zi = ({ $setting: t, $close: e, extras: i, code: n, primaryKey: r, ...a }) => { + const [o] = ie.useForm(), s = ar(o, n, r, t); + return h(G, { actions: F($.Fragment, { children: [h(N, { name: (t == null ? void 0 : t.okText) || "保存", type: "primary", widget: () => s({ onSuccess: e }) }), h(N, { name: (t == null ? void 0 : t.cancelText) || "取消", widget: () => e(!1) })] }), extras: i, children: h(cr, { form: o, code: n, primaryKey: r, ...a }) }); +}, pi = /* @__PURE__ */ new Set(), Ut = (t = [], e = 0) => { + const i = t[e]; + if (i.length && !pi.has(i)) { + const n = document.createElement("script"); + n.setAttribute("src", i), n.setAttribute("data-namespace", i), t.length > e + 1 && (n.onload = () => { + Ut(t, e + 1); + }, n.onerror = () => { + Ut(t, e + 1); + }), pi.add(i), document.body.appendChild(n); + } +}, bt = ({ className: t, type: e, style: i = {}, ...n }) => h("span", { role: "img", className: R("ff-iconfont", t), style: i, ...n, children: h("svg", { style: { width: "1em", height: "1em", fill: "currentColor", overflow: "hidden" }, viewBox: "0 0 1024 1024", children: h("use", { xlinkHref: `#${e}` }) }) }); +bt.propTypes = { className: b.string, type: b.string.isRequired, style: b.object }, bt.init = Ut; +const dr = (t, e, i, n) => $e.redirect(i, e, n), ur = (t, e = {}, i, n = {}) => { + var a; + const r = (a = n.router) == null ? void 0 : a.reduce((o, [s, l, u]) => { + const d = m.get(e, ["router", s]); + if (!d && d !== 0 && l) throw `请传入 ${u}`; + return `${o}/${d}`; + }, `/api/${i}`); + return I.del(r, e.param).msg(); +}, gi = (t, e, 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 m.isFunction(i) ? i.call(null, { ...e, ...o }) : m.isString(i) && i ? Fe.exec(i, e, o) : null; +}, hi = (t, e, i, n, r) => m.isString(i) && i ? se.getWidgetComponent(i).then(({ default: a }) => ee.modal(a, { ...e, $setting: n }, r != null && r.title ? { ...r, title: m.template(r.title)(t) } : r)).catch((a) => { + ee.error(i, { content: a.toString() }); +}) : ee.modal(i, { ...e, $setting: n }, r != null && r.title ? { ...r, title: m.template(r.title)(t) } : r), pr = (t, e, i, n, r) => ee.modal(zi, { ...e, $setting: n, code: i }, r != null && r.title ? { ...r, title: m.template(r.title)(t) } : r), gr = (t, e, i, n, r) => ee.modal(Yt, { base62params: e, $setting: n, listCode: i }, r != null && r.title ? { ...r, title: m.template(r.title)(t) } : r), hr = ({ widget: t, widgetType: e, widgetData: i, widgetProps: n, widgetSetting: r, widgetContainerProps: a }, { onAfterClick: o, onBeforeClick: s } = {}) => { + const l = le(ne), [u, d] = L({ leading: !0, trailing: !1 }), p = q(() => { + switch (e) { + case "redirect": + return m.partialRight(dr, t, r); + case "func": + return m.partialRight(gi, (r == null ? void 0 : r.code) ?? t, { status: u, setStatus: d }); + case "component": + case "fsdpf-component": + return m.partialRight(hi, t, r, a); + case "grid-layout-form": + return m.partialRight(pr, t, r, a); + case "data-list": + return m.partialRight(gr, t, r, a); + case "destroy": + return m.partialRight(ur, t, r, a); + default: + if (Zt(t) || $.isValidElement(t)) return m.partialRight(hi, t, r, a); + if (m.isFunction(t)) return m.partialRight(gi, (r == null ? void 0 : r.code) || t, { status: u, setStatus: d }); + } + return (...f) => console.error("useButton unknown widgetType", e, ...f); + }, [t, e]); + return [m.debounce((f) => (s == null || s(f), Promise.resolve(st(n, f, { list: l })).then((g) => p(f, { ...i, ...g })).then((g) => o == null ? void 0 : o(g)).catch(console.error)), 300, { leading: !0, trailing: !1 }), u]; +}, Bi = ({ type: t, name: e, className: i, icon: n, iconPosition: r, size: a }, o = "default") => q(() => { + const s = { type: "primary", className: R("ff-button", i), iconPosition: r, size: a }; + return t === "danger" ? s.danger = !0 : t === "default" && (s.type = t), o === "link" || o === "dashed" ? (s.type = o, t === "default" && (s.className = R(s.className, "ff-default"))) : o !== "circle" && o !== "round" || (s.shape = o), n && (s.icon = h(bt, { type: n })), e && (s.children = e), s; +}, [o, t, i, n, r]), Pt = ({ data: t, widget: e, widgetType: i = "fsdpf-component", widgetData: n, widgetProps: r, widgetSetting: a, widgetContainerProps: o, onAfterClick: s, onBeforeClick: l, children: u, extras: d }) => { + const p = le(ne), [f, g] = L(!1), [y, w] = L("hover"), [C, k] = L({}), [S, E] = L(), { placement: T, align: O, zIndex: A, arrow: M = { pointAtCenter: !0 }, getPopupContainer: D, isPopupMountBodyContainer: j = !0, ...z } = o || {}; + V(() => { + i == "grid-layout-form" ? E($.createElement(zi, { ...n, $setting: a, code: e })) : i == "data-list" ? E($.createElement(Yt, { base62params: t, $setting: a, listCode: e })) : m.isString(e) ? se.getWidgetComponent(e).then(({ default: B }) => { + E($.createElement(B, { ...n, $setting: a })); + }).catch((B) => E(B.toString())) : Zt(e) ? E($.createElement(e, { ...n, $setting: a })) : $.isValidElement(e) && E($.cloneElement(e, { ...n, $setting: a })); + }, [e, i, n]), V(() => { + Promise.resolve(st(r, t, { list: p })).then(k); + }, [r, t, p.getBase62params]); + const x = (B, Ee = !1) => (g(B), !B && w("hover"), B ? l == null ? void 0 : l(C) : s == null ? void 0 : s(Ee)), K = (B) => { + g(!0), w("click"); + }; + return h(hn, { zIndex: A, placement: T, onPopupClick: K, onClick: K, open: f, align: O, arrow: M, trigger: y, getPopupContainer: D || j ? void 0 : (B) => B, content: h(mr, { ...z, extras: d, children: S && $.cloneElement(S, { ...C, $close: (B) => x(!1, B) }) }), children: u, onOpenChange: x }); +}, mr = ({ title: t, className: e, classNames: i, children: n, extras: r, width: a, height: o, ...s }) => { + const [l, u] = L({}), d = X((y, w) => u((C) => ({ ...C, [y]: w })), []), p = X((y) => u((w) => ({ ...w, [y]: void 0 })), []), f = t ? $.createElement("div", { className: "ff-popup-title" }, t) : l == null ? void 0 : l.title, g = r ?? $.createElement("div", { className: "ff-popup-reserved-extras" }, r); + return h(ot.Provider, { value: { ele: l, mount: d, unmount: p }, children: F("div", { className: R("ff-popup ff-popover", e, l.rootClassName), style: { width: a ?? 260, height: o }, ...s, children: [F("div", { className: R("ff-popup-header", "ff-popover-header", i == null ? void 0 : i.header), children: [f, l == null ? void 0 : l["sub-title"]] }), h("div", { className: R("ff-popup-body", "ff-popover-body", i == null ? void 0 : i.body), children: n }), F("div", { className: R("ff-popup-footer", "ff-popover-footer", i == null ? void 0 : i.footer), children: [g, l == null ? void 0 : l.extras, l == null ? void 0 : l.actions] })] }) }); +}; +Pt.propTypes = { widgetType: b.oneOf(["fsdpf-component", "grid-layout-form", "data-list"]) }; +const dt = (t) => function({ className: e, variant: i, children: n, name: r, icon: a, type: o = "default", iconPosition: s = "start", noAuthType: l, onAfterClick: u, onBeforeClick: d, data: p, loading: f, disabled: g, tooltip: y, confirm: w, widget: C = () => { +}, widgetType: k, widgetData: S, widgetProps: E, widgetSetting: T, widgetContainerProps: O, ...A }) { + const { mode: M, ...D } = O || {}, j = Bi({ className: e, name: r, type: o, icon: a, iconPosition: s }, i ?? t), z = h(yt, { ...j, ...A, children: n || r }); + if (M === "popover" && !["destroy", "redirect", "func"].includes(k)) return h(Pt, { data: p, widget: C, widgetType: k, widgetData: S, widgetProps: E, widgetSetting: T, widgetContainerProps: D, onAfterClick: u, onBeforeClick: d, children: z }); + const x = m.isEmpty(y) || !y.enabled ? {} : y, K = m.isEmpty(w) ? { enabled: !1 } : Object.assign({ enabled: !0 }, w), [B, Ee] = L(!1), [ut, { disabled: pt, loading: Nt }] = hr({ widget: C, widgetType: k, widgetData: S, widgetProps: E, widgetSetting: T, widgetContainerProps: D }, { onAfterClick: u, onBeforeClick: d }); + return h(mn, { okText: "确定", cancelText: "取消", getPopupContainer: (te) => te, ...K, disabled: pt || g, open: B, onOpenChange: (te) => { + if (!te) return Ee(te); + K.enabled ? Ee(te) : ut(p); + }, onConfirm: (te) => { + ut(p, te); + }, onClick: (te) => { + te.stopPropagation(); + }, children: h(fn, { getPopupContainer: (te) => te, ...x, title: B ? null : x == null ? void 0 : x.title, trigger: ["hover", "click"], children: $.cloneElement(z, { loading: Nt || f, disabled: pt || g }) }) }); +}, N = dt("default"); +N.propTypes = { type: b.oneOf(["primary", "default", "danger", ""]), size: b.oneOf(["large", "middle", "small"]), name: b.string, icon: b.string, iconPosition: b.oneOf(["start", "end"]), data: b.any, widget: b.any, widgetType: b.oneOf(["destroy", "redirect", "func", "component", "fsdpf-component", "grid-layout-form", "grid-layout", "data-list"]), widgetData: b.object, widgetProps: b.object, widgetSetting: b.object, widgetContainerProps: b.object, tooltip: b.exact({ title: b.string.isRequired, placement: b.oneOf(["top", "left", "right", "bottom", "topLeft", "topRight", "bottomLeft", "bottomRight", "leftTop", "leftBottom", "rightTop", "rightBottom"]), enabled: b.oneOfType([b.bool, b.number]), getPopupContainer: b.func }), confirm: b.exact({ title: b.string.isRequired, cancelText: b.string, okText: b.string, okType: b.oneOf(["primary", "default", "danger", ""]), placement: b.oneOf(["top", "left", "right", "bottom", "topLeft", "topRight", "bottomLeft", "bottomRight", "leftTop", "leftBottom", "rightTop", "rightBottom"]), enabled: b.oneOfType([b.bool, b.number]), getPopupContainer: b.func, arrow: b.oneOfType([b.bool, b.exact({ pointAtCenter: b.bool })]) }) }; +const fr = dt("link"), yr = dt("circle"), wr = dt("round"), br = dt("dashed"), mi = ({ options: t = [], triggerWeights: e = ["grid-layout-form", "grid-layout", "fsdpf-component", "print"], onAfterClick: i = (g, y, w) => { +}, onBeforeClick: n = (g, y, w) => { +}, labelVariant: r = "link", labelSize: a, labelRender: o, btnVariant: s, btnSize: l, btnRender: u = (g, y) => h(N, { ...g, data: y }, g.uuid || Lt()), widgetContainerProps: d = {}, children: p, data: f }) => { + if (m.isEmpty(t)) return p; + const [g, y] = q(() => (t || []).reduce((C, k) => { + const S = e.indexOf(k.widgetType); + return S === -1 ? C[1].push(k) : C[0] ? S < e.indexOf(C[0].widgetType) ? (C[1].push(C[0]), C[0] = k) : C[1].push(k) : C[0] = k, C; + }, [null, []]), [t, e]); + o ? p = o(g, f) || p : p || (p = h(yt, { ...Bi(Object.assign(g != null && g.name || g != null && g.icon ? {} : { icon: "icon-location" }, g, { size: a }), r) })); + const w = y.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: m.partialRight(i, C, f), onBeforeClick: m.partialRight(n, C, f) }, { size: l, variant: s }), f)); + return h(Pt, { widget: g == null ? void 0 : g.widget, widgetType: g == null ? void 0 : g.widgetType, widgetProps: g == null ? void 0 : g.widgetProps, widgetSetting: g == null ? void 0 : g.widgetSetting, widgetContainerProps: Object.assign({}, d, g == null ? void 0 : g.widgetContainerProps), data: f, widgetData: g == null ? void 0 : g.widgetData, extras: w, onAfterClick: m.partialRight(i, g, f), onBeforeClick: m.partialRight(n, g, f), children: p }); +}; +mi.propTypes = { triggerWeights: b.array, options: b.arrayOf(b.shape({ ...N.propTypes, widgetType: N.propTypes.widgetType.isRequired })), btnSize: N.propTypes.size, btnRender: b.func, btnVariant: b.oneOf(["", "default", "link", "circle", "round", "dashed"]), labelVariant: b.oneOf(["", "default", "link", "circle", "round", "dashed"]), labelRender: b.func, labelSize: N.propTypes.size, onAfterClick: b.func, onBeforeClick: b.func, widgetContainerProps: N.propTypes.widgetContainerProps, data: N.propTypes.data }, N.Link = fr, N.Link.defaultProps = N.defaultProps, N.Link.propTypes = N.propTypes, N.Circle = yr, N.Circle.defaultProps = N.defaultProps, N.Circle.propTypes = N.propTypes, N.Round = wr, N.Round.defaultProps = N.defaultProps, N.Round.propTypes = N.propTypes, N.Dashed = br, N.Dashed.defaultProps = N.defaultProps, N.Dashed.propTypes = N.propTypes, N.Popover = Pt, N.GroupPopover = mi; +const Cr = ({ fields: t, formProps: e, $close: i }) => { + const [n] = ie.useForm(), r = q(() => [{ name: "__PROPS__", value: e }], [e]); + return h(G, { actions: F($.Fragment, { children: [h(N, { name: "取消", widget: () => i(!1) }), h(N, { name: "确定", type: "primary", widget: () => n.validateFields(!0).then(i) })] }), children: h(ie, { fields: r, form: n, className: "ff-modal-form", children: t == null ? void 0 : t.map(({ code: a, ...o }) => h(Gt, { code: a, ...o }, a)) }) }); +}, kr = ({ className: t, classNames: e, $close: i, children: n, title: r, subTitle: a, actions: o, extras: s, ...l }) => F(En, { ...l, prefixCls: "ff-drawer", className: R("ff-popup", t), maskMotion: { motionAppear: !0, motionName: "mask-motion" }, motion: (u) => ({ motionAppear: !0, motionName: `panel-motion-${u}` }), children: [F("div", { className: R("ff-popup-header", "ff-drawer-header", e == null ? void 0 : e.header), children: [h("button", { "aria-label": "Close", className: R("ff-popup-close", "ff-drawer-close", e == null ? void 0 : e.close), onClick: l.onClose, children: h(Ht, { type: "close" }) }), r, a] }), h("div", { className: R("ff-popup-body", "ff-drawer-body", e == null ? void 0 : e.body), children: n }), F("div", { className: R("ff-popup-footer", "ff-drawer-footer", e == null ? void 0 : e.footer), children: [s, o] })] }), $r = ({ className: t, classNames: e, $close: i, $event: n, children: r, title: a, subTitle: o, actions: s, extras: l, placement: u, ...d }) => { + const p = (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 h(Sn, { ...d, ...p, prefixCls: "ff-modal", modalRender: () => F("div", { className: R("ff-modal-content ff-popup", t), children: [F("div", { className: R("ff-popup-header", "ff-modal-header", e == null ? void 0 : e.header), children: [h("button", { "aria-label": "Close", className: R("ff-popup-close", "ff-modal-close", e == null ? void 0 : e.close), onClick: d.onClose, children: h(Ht, { type: "close" }) }), a, o] }), h("div", { className: R("ff-popup-body", "ff-modal-body", e == null ? void 0 : e.body), children: r }), F("div", { className: R("ff-popup-footer", "ff-modal-footer", e == null ? void 0 : e.footer), children: [l, s] })] }) }); +}, Wi = ({ placement: t, $close: e, $event: i, children: n, title: r, ...a }) => { + const [o, s] = L({}), [l, u] = L(!0), d = X((y, w) => s((C) => ({ ...C, [y]: w })), []), p = X((y) => s((w) => ({ ...w, [y]: void 0 })), []); + let f = { ...a, className: o.rootClassName, title: o.title || r && $.createElement("div", { className: R("ff-popup-title") }, r), subTitle: o["sub-title"], actions: o.actions, extras: o.extras, children: n, $close: e, $event: i, onClose: () => u(!1) }; + const g = () => { + e(!1); + }; + return h(ot.Provider, { value: { ele: o, mount: d, unmount: p }, children: t && t !== "center" ? h(kr, { ...f, placement: t, open: l, afterOpenChange: (y) => !y && g() }) : h($r, { ...f, visible: l, afterClose: g }) }); +}; +Wi.propTypes = { placement: b.oneOf(["center", "left", "top", "right", "bottom"]) }; +const Z = () => { + const [t, e] = an({ 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] = $.useReducer((a) => a + 1, 0); + V(() => { + Z.$onClick = n, Z.$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 d = Z.$index++, p = (f) => ((g, y) => (Z.$popups.delete(g), i(), y == null ? void 0 : y()))(d, () => a(f)); + if (s === Ei) return t.open({ ...u, key: d, content: $.createElement(s, { ...l, $close: () => t.close(d) }) }); + Z.$popups.set(d, $.createElement(Wi, { maskClosable: !1, $event: l == null ? void 0 : l.$event, ...u, key: d, $close: p }, $.isValidElement(s) ? $.cloneElement(s, { ...l, $close: p }) : s != null && s.name || ai.isForwardRef(s) || (s == null ? void 0 : s.$$typeof) === ai.ForwardRef ? $.createElement(s, { ...l, $close: p }) : s)), i(); + }; + return F($.Fragment, { children: [Array.from(Z.$popups).map(([a, o]) => o), e] }); +}; +Z.$popups = /* @__PURE__ */ new Map(), Z.$index = 0, Z.$queue = [], Z.$onClick = (...t) => new Promise((e, i) => { + Z.$queue.push([t, e, i]); +}); +const fi = (t, e, i = {}) => Z.$onClick(t, e, i), Ft = (t, { showProgress: e, duration: i, ...n } = { duration: 1.5 }) => Z.$onClick(Ei, { content: t, ...n }, { showProgress: e, duration: i }), ee = { modal: fi, confirm: (t, e = {}) => Z.$onClick(vn, { content: t, ...e }, { placement: "center" }), form: (t, e = {}, i = {}) => fi(Cr, { formProps: i, fields: t }, { placement: "center", ...e }).then((n) => { + if (n === !1) throw !1; + return n; +}), notification: Ft, success: (t, e = { duration: 1.5 }) => Ft(t, { ...e, className: "ff-notification-success", icon: "check" }), error: (t, e = { duration: 1.5 }) => Ft(t, { ...e, className: "ff-notification-error", icon: "close" }) }; +_e.configure({ showSpinner: !1 }), He.interceptors.request.use((t) => { + t.headers.Platform = "web", t.headers.SaaS = window.localStorage.getItem("SaaS"); + const e = window.localStorage.getItem(ft); + return t.headers.Authorization = e ? `Bearer ${e} ` : void 0, _e.inc(), t; +}, (t) => (_e.done(), Promise.reject({ code: -1, msg: t }))), He.interceptors.response.use(({ data: t, headers: e }) => (_e.done(), { ...t, res: e == null ? void 0 : e.res }), function(t) { + return _e.done(), Promise.reject(t.message); +}), window.addEventListener("unhandledrejection", jt.onUnhandledRejection), jt.onMsg = (t, e) => ee[[0, 1].includes(t) ? "success" : "error"](e).then(() => t === 20300 && $e.redirect(Ve.get("Common.WEBSITE_LOGIN_PAGE"))); +var Ie, Ue; +const J = class J { + constructor() { + P(this, "appUrl", ""); + return c(J, Ie) || (W(J, Ue, new jt()), W(J, Ie, new Proxy(this, { get: (e, i) => i === "init" ? e.init : i === "appUrl" ? e.appUrl : c(J, Ue)[i] }))), c(J, Ie); + } + init(e, i, n) { + He.defaults.baseURL = this.appUrl = n, He.defaults.timeout = 15e3, c(J, Ue).init(e, i, He); + } +}; +Ie = new WeakMap(), Ue = new WeakMap(), v(J, Ie, null), v(J, Ue, null), P(J, "getInstance", () => c(J, Ie) ?? W(J, Ie, new J())); +let qt = J; +const I = qt.getInstance(); +class Qt extends Error { + constructor(e, i) { + super(i), Error.captureStackTrace && Error.captureStackTrace(this, Qt), !i instanceof Je && (this.name = `${e} Error Runtime`); + } +} +class Je extends Error { + constructor(e, ...i) { + super(...i), Error.captureStackTrace && Error.captureStackTrace(this, Je), this.name = `${e} Not Found`; + } +} +const At = "mine", ft = "token"; +var Oe, qe; +const he = class he { + constructor() { + v(this, qe, /* @__PURE__ */ new Map()); + P(this, "setVendor", (e, i) => c(this, qe).set(e, new ki(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 Je(r); + }))); + P(this, "getWidgetComponent", async (e) => { + if (!e) throw "getWidgetComponent widget is required"; + if (e != null && e.startsWith("blob:") || e != null && e.startsWith("http:") || e != null && e.startsWith("https:")) return await import(e); + const [, i] = e == null ? void 0 : e.split("@pkg/"); + if (!i) throw new Je(e); + try { + return c(this, qe).has("pkg") ? await c(this, qe).get("pkg").get(i) : await import(`${I.appUrl}/api/pkg-import/web?name=${e}`); + } catch (n) { + throw new Qt(e, n); + } + }); + P(this, "getRoutes", () => I.get("/api/my-router").then((e) => [...e, { uuid: "data-list-setting", isLayout: !0, uri: "/data-list-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/ff-design/components/DataListSetting", extra: { layout: "@pkg/ff-design/frameworks/DesignTheme" } }, { uuid: "grid-layout-setting", isLayout: !0, uri: "/grid-layout-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/ff-design/components/GridLayoutSetting", extra: { layout: "@pkg/ff-design/frameworks/DesignTheme" } }, { uuid: "grid-layout-form-setting", isLayout: !0, uri: "/grid-layout-form-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/ff-design/components/GridLayoutFormSetting", extra: { layout: "@pkg/ff-design/frameworks/DesignTheme" } }, { uuid: "resource-api-setting", isLayout: !0, uri: "/resource-api-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/ff-design/components/ResourceApiSetting", extra: { layout: "@pkg/ff-design/frameworks/DesignTheme" } }, { uuid: "charts-setting", isLayout: !0, uri: "/resource-api-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/ff-design/components/ChartsSetting", extra: { layout: "@pkg/ff-design/frameworks/DesignTheme" } }, { uuid: "fsm-setting", isLayout: !0, uri: "/fsm-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/ff-design/components/FsmSetting", extra: { layout: "@pkg/ff-design/frameworks/DesignTheme" } }, { uuid: "component-setting", isLayout: !0, uri: "/component-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/ff-design/components/ComponentSetting", extra: { layout: "@pkg/ff-design/frameworks/DesignTheme" } }, { uuid: "login", uri: "/login", name: "登录", type: "fsdpf-component", isLogin: !1, component: "@pkg/ff/components/Login" }, { uuid: "not-found", uri: "*", name: "Not Found", type: "fsdpf-component", isLogin: !1, component: "@pkg/ff/components/NotFound" }].map(({ uuid: i, ...n }) => [i, { uuid: i, ...n }])).then((e) => new Map(e))); + P(this, "getMenus", () => I.get("/api/my-menu")); + P(this, "getConfigure", () => I.get("api/init-configure")); + P(this, "getWidgetOperationAuth", () => I.get("/api/init-widget-operation-auth").then((e) => e.reduce((i, { uuid: n, auth: r }) => [...i, [n, r]], []))); + P(this, "getPhoneNumber", (e) => I.get(`/api/user-wx-phone-number/${e}`)); + P(this, "getUserToken", () => { + const e = window.localStorage.getItem(ft); + if (!e) return ""; + const i = e.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 e; + }); + P(this, "checkUserToken", () => { + try { + return !!this.getUserToken(); + } catch { + return !1; + } + }); + P(this, "getUserInfo", (e = !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 } = I.decode(window.localStorage.getItem(At) || "", {}); + return a === r ? Promise.resolve(o) : I.get("/api/mine-info").then(({ User: s = null }) => (window.localStorage.setItem(At, I.encode({ ...s, iat: r })), s)); + } catch (n) { + console.error(n), e && ee.error("请登录").then(this.logout); + } + return Promise.resolve(null); + }); + P(this, "login", (e, i, n = {}) => I.post("/api/user-token", { username: e, passwd: on.hash(i), platform: "web", ...n }).then(({ token: r }) => (window.localStorage.setItem(ft, r), r)).then(async (r) => (await this.initAppEnv(), r))); + P(this, "logout", (e) => (window.localStorage.removeItem(At), window.localStorage.removeItem(ft), e == null ? void 0 : e())); + P(this, "initAppEnv", async () => { + const [e, i, n, r] = await Promise.all([this.getWidgetOperationAuth(), this.getRoutes(), this.getMenus(), this.getConfigure()]); + return Si.init(e), Ve.init(r), $e.init(i, n), bt.init(Ve.get("Common.ICONFONT")), { widgetOperationAuth: e, routes: i, menus: n, configures: r }; + }); + if (c(he, Oe)) return c(he, Oe); + } +}; +Oe = new WeakMap(), qe = new WeakMap(), v(he, Oe, null), P(he, "getInstance", () => (c(he, Oe) || W(he, Oe, new he()), c(he, Oe))); +let Kt = he; +const se = Kt.getInstance(), Er = $.createContext({ user: {}, initUser: () => { +}, initUserComplete: !1 }), Sr = $.createContext({ set: () => { +}, get: () => { +}, assign: () => { +}, currentRoute: () => { +} }), Zt = (t) => !!(t != null && t.name) && (t.prototype instanceof $.Component || /^[A-Z]/.test(t.name)), vr = (t, e) => { + if (!t || typeof window > "u") return; + let i = document.querySelector(`style[ff-style-token="${e}"]`); + return i ? (i.innerHTML = t, t) : (i = document.createElement("style"), i.setAttribute("ff-style-token", e), i.setAttribute("type", "text/css"), i.innerHTML = t, document.head.appendChild(i), t); +}, xr = Object.freeze(Object.defineProperty({ __proto__: null, AppContext: Er, AppGlobalParamsContext: Sr, cache: ki, configure: Ve, default: se, func: Fe, http: I, insertStyle: vr, isReactComponent: Zt, route: $e }, Symbol.toStringTag, { value: "Module" })); +var Ce, Ke, ke, me, fe, Q, Y, H, ye, tt, it, nt, rt, vt, at; +const ei = class ei { + constructor(e, i = "/") { + v(this, Ce, "/"); + v(this, Ke, /* @__PURE__ */ new Set()); + v(this, ke, (e) => { + for (const i of c(this, Ke)) try { + i(e); + } catch (n) { + console.error("Error in VirtualFS event listener:", n); + } + }); + v(this, me, (e) => { + const i = Date.now(); + if (e && (e.lastModified = i), c(this, Ce) != "/") { + const n = c(this, H).call(this, c(this, Ce)); + n && (n.lastModified = i); + } + this.root.lastModified = i; + }); + v(this, fe, (e) => { + let i = ce.normalize(e); + return i.startsWith("/") || (i = "/" + i), i.length > 1 && i.endsWith("/") && (i = i.slice(0, -1)), i; + }); + v(this, Q, (e) => { + const i = ce.join(c(this, Ce), e); + return c(this, fe).call(this, i); + }); + v(this, Y, (e) => { + if (!e || typeof e != "string") return !1; + const i = c(this, fe).call(this, e); + return !i.includes("..") && i.startsWith("/"); + }); + v(this, H, (e) => { + var a; + const i = c(this, fe).call(this, e); + if (i === "/") return this.root; + const n = i.split("/").filter((o) => o); + let r = this.root; + for (const o of n) { + if (r.type !== "dir") return null; + const s = (a = r.children) == null ? void 0 : a.find((l) => l.name === o); + if (!s) return null; + r = s; + } + return r; + }); + v(this, ye, (e) => { + const i = c(this, fe).call(this, e), n = ce.basename(i), r = ce.dirname(i); + return { parent: c(this, H).call(this, r), name: n }; + }); + v(this, tt, (e, i, n) => n === !1 ? e : n === "root" ? e.map((r) => ce.join(i, r)) : n === !0 || n === "working" ? e.map((r) => ce.relative(c(this, Ce), ce.join(i, r))) : e); + v(this, it, async (e, i, n, r = "") => { + const a = [], o = c(this, H).call(this, e); + if (!o || o.type !== "dir") return a; + const s = o.children; + for (const l of s) { + const u = l.name, d = e === "/" ? `/${u}` : `${e}/${u}`, p = r ? `${r}/${u}` : u; + try { + if (l.type === "file") i(n ? p : u) && a.push(p); + else if (l.type === "dir" && n) { + const f = await c(this, it).call(this, d, i, n, p); + a.push(...f); + } + } catch { + continue; + } + } + return a; + }); + v(this, nt, async (e, i, n, r = "") => { + const a = [], o = Array.isArray(i) ? i : [i], s = c(this, H).call(this, e); + if (!s || s.type !== "dir") return a; + if (!n) { + for (const u of o) if (c(this, rt).call(this, u)) { + const d = await c(this, vt).call(this, e, u); + a.push(...d); + } else { + const d = ce.join(e, u), p = c(this, fe).call(this, d); + c(this, H).call(this, p) && a.push(u); + } + return a; + } + const l = s.children; + for (const u of l) { + const d = u.name, p = e === "/" ? `/${d}` : `${e}/${d}`, f = r ? `${r}/${d}` : d; + try { + if (u.type === "file") for (const g of o) { + let y = !1; + if (y = c(this, rt).call(this, g) ? c(this, at).call(this, d, g) : d === g, y) { + a.push(f); + break; + } + } + else if (u.type === "dir") { + const g = await c(this, nt).call(this, p, i, n, f); + a.push(...g); + } + } catch { + continue; + } + } + return a; + }); + v(this, rt, (e) => /[*?[\]{}]/.test(e)); + v(this, vt, async (e, i) => { + const n = [], r = c(this, H).call(this, e); + if (!r || r.type !== "dir") return n; + const a = r.children.map((o) => o.name); + for (const o of a) c(this, at).call(this, o, i) && n.push(o); + return n; + }); + v(this, at, (e, i) => { + const n = i.replace(/\./g, "\\.").replace(/\*/g, ".*").replace(/\?/g, ".").replace(/\{([^}]+)\}/g, (r, a) => "(" + a.split(",").join("|") + ")"); + return new RegExp(`^${n}$`).test(e); + }); + var n, r, a; + W(this, Ce, i), this.root = { name: "/", type: "dir", children: [], lastModified: Date.now() }, Array.isArray(e) ? this.root.children = e : e && typeof e == "object" && (e.name && e.name !== "/" ? this.root.children.push(e) : (this.root = e, (n = this.root).name ?? (n.name = "/"), (r = this.root).children ?? (r.children = []), (a = this.root).lastModified ?? (a.lastModified = Date.now()))); + } + async stat(e) { + const i = c(this, Q).call(this, e); + if (!c(this, Y).call(this, i)) throw new Error(`EINVAL: invalid path '${e}'`); + const n = c(this, H).call(this, i); + if (!n) throw new Error(`ENOENT: no such file or directory, stat '${e}'`); + return { isFile: () => n.type === "file", isDirectory: () => n.type === "dir", lastModified: n.lastModified }; + } + async dir(e) { + const i = c(this, Q).call(this, e); + if (!c(this, Y).call(this, i)) throw new Error(`EINVAL: invalid path '${e}'`); + const n = c(this, H).call(this, i); + if (!n) throw new Error(`ENOENT: no such file or directory, scandir '${e}'`); + if (n.type !== "dir") throw new Error(`ENOTDIR: not a directory, scandir '${e}'`); + return n.children.map((r) => r.name); + } + async readFile(e) { + const i = c(this, Q).call(this, e); + if (!c(this, Y).call(this, i)) throw new Error(`EINVAL: invalid path '${e}'`); + const n = c(this, H).call(this, i); + if (!n) throw new Error(`ENOENT: no such file or directory, open '${e}'`); + if (n.type !== "file") throw new Error("EISDIR: illegal operation on a directory, read"); + return n.content || ""; + } + async writeFile(e, i) { + const n = c(this, Q).call(this, e); + if (!c(this, Y).call(this, n)) throw new Error(`EINVAL: invalid path '${e}'`); + const { parent: r, name: a } = c(this, ye).call(this, n); + if (!r) throw new Error(`ENOENT: no such file or directory, open '${e}'`); + if (r.type !== "dir") throw new Error("ENOTDIR: not a directory"); + const o = r.children.findIndex((u) => u.name === a), s = o >= 0, l = { name: a, type: "file", content: i, lastModified: Date.now() }; + s ? r.children[o] = l : r.children.push(l), c(this, me).call(this, r), c(this, ke).call(this, { action: s ? "update" : "create", path: n, type: "file", timestamp: Date.now() }); + } + async mkdir(e, i = {}) { + const n = c(this, Q).call(this, e); + if (!c(this, Y).call(this, n)) throw new Error(`EINVAL: invalid path '${e}'`); + const { recursive: r } = i; + if (r) { + const a = n.split("/").filter((s) => s); + let o = "/"; + for (const s of a) + if (o = ce.join(o, s), !c(this, H).call(this, o)) { + const { parent: l, name: u } = c(this, ye).call(this, o); + if (l && l.type === "dir") { + const d = { name: u, type: "dir", children: [], lastModified: Date.now() }; + l.children.push(d), c(this, me).call(this, l), c(this, ke).call(this, { action: "create", path: c(this, fe).call(this, o), type: "dir", timestamp: Date.now() }); + } + } + } else { + const { parent: a, name: o } = c(this, ye).call(this, n); + if (!a) throw new Error(`ENOENT: no such file or directory, mkdir '${e}'`); + if (a.type !== "dir") throw new Error("ENOTDIR: not a directory"); + if (a.children.find((l) => l.name === o)) throw new Error(`EEXIST: file already exists, mkdir '${e}'`); + const s = { name: o, type: "dir", children: [], lastModified: Date.now() }; + a.children.push(s), c(this, me).call(this, a), c(this, ke).call(this, { action: "create", path: n, type: "dir", timestamp: Date.now() }); + } + } + async unlink(e) { + const i = c(this, Q).call(this, e); + if (!c(this, Y).call(this, i)) throw new Error(`EINVAL: invalid path '${e}'`); + const { parent: n, name: r } = c(this, ye).call(this, i); + if (!n) throw new Error(`ENOENT: no such file or directory, unlink '${e}'`); + const a = n.children.findIndex((o) => o.name === r); + if (a < 0) throw new Error(`ENOENT: no such file or directory, unlink '${e}'`); + if (n.children[a].type !== "file") throw new Error(`EISDIR: illegal operation on a directory, unlink '${e}'`); + n.children.splice(a, 1), c(this, me).call(this, n), c(this, ke).call(this, { action: "delete", path: i, type: "file", timestamp: Date.now() }); + } + async rmdir(e, i = {}) { + const n = c(this, Q).call(this, e); + if (!c(this, Y).call(this, n)) throw new Error(`EINVAL: invalid path '${e}'`); + const { parent: r, name: a } = c(this, ye).call(this, n); + if (!r) throw new Error(`ENOENT: no such file or directory, rmdir '${e}'`); + const o = r.children.findIndex((l) => l.name === a); + if (o < 0) throw new Error(`ENOENT: no such file or directory, rmdir '${e}'`); + const s = r.children[o]; + if (s.type !== "dir") throw new Error(`ENOTDIR: not a directory, rmdir '${e}'`); + if (!i.recursive && s.children.length > 0) throw new Error(`ENOTEMPTY: directory not empty, rmdir '${e}'`); + r.children.splice(o, 1), c(this, me).call(this, r), c(this, ke).call(this, { action: "delete", path: n, type: "dir", timestamp: Date.now() }); + } + async rename(e, i) { + const n = c(this, Q).call(this, e), r = c(this, Q).call(this, i); + if (!c(this, Y).call(this, n)) throw new Error(`EINVAL: invalid path '${e}'`); + if (!c(this, Y).call(this, r)) throw new Error(`EINVAL: invalid path '${i}'`); + if (!c(this, H).call(this, n)) throw new Error(`ENOENT: no such file or directory, rename '${e}' -> '${i}'`); + const { parent: a, name: o } = c(this, ye).call(this, n), { parent: s, name: l } = c(this, ye).call(this, r); + if (!s) throw new Error(`ENOENT: no such file or directory, rename '${e}' -> '${i}'`); + if (c(this, H).call(this, r)) throw new Error(`EEXIST: file already exists, rename '${e}' -> '${i}'`); + const u = a.children.findIndex((p) => p.name === o), d = { ...a.children[u], name: l, lastModified: Date.now() }; + a.children.splice(u, 1), s.children.push(d), c(this, me).call(this, a), a !== s && c(this, me).call(this, s), c(this, ke).call(this, { action: "rename", path: r, oldPath: n, type: d.type, timestamp: Date.now() }); + } + async exists(e) { + const i = c(this, Q).call(this, e); + return c(this, Y).call(this, i) ? c(this, H).call(this, i) !== null : !1; + } + getLastModified() { + return this.root.lastModified; + } + subscribe(e) { + if (typeof e != "function") throw new Error("Callback must be a function"); + return c(this, Ke).add(e), () => { + c(this, Ke).delete(e); + }; + } + getWorkingDirectory() { + return c(this, Ce); + } + scope(e = "/") { + const i = c(this, fe).call(this, e); + if (!c(this, Y).call(this, i)) throw new Error(`EINVAL: invalid path '${e}'`); + const n = c(this, H).call(this, i); + if (!n) throw new Error(`ENOENT: no such file or directory '${e}'`); + if (n.type !== "dir") throw new Error(`ENOTDIR: not a directory '${e}'`); + return n.children ?? (n.children = []), n.lastModified ?? (n.lastModified = Date.now()), new ei(this.root, i); + } + async findFiles(e, i, n = {}) { + const r = c(this, Q).call(this, e); + if (!c(this, Y).call(this, r)) throw new Error(`EINVAL: invalid path '${e}'`); + const a = c(this, H).call(this, r); + if (!a) throw new Error(`ENOENT: no such file or directory '${e}'`); + if (a.type !== "dir") throw new Error(`ENOTDIR: not a directory '${e}'`); + const { recursive: o = !1, fullPath: s = !1 } = n; + if (typeof i == "function") { + const u = await c(this, it).call(this, r, i, o); + return c(this, tt).call(this, u, r, s); + } + const l = await c(this, nt).call(this, r, i, o); + return c(this, tt).call(this, l, r, s); + } +}; +Ce = new WeakMap(), Ke = new WeakMap(), ke = new WeakMap(), me = new WeakMap(), fe = new WeakMap(), Q = new WeakMap(), Y = new WeakMap(), H = new WeakMap(), ye = new WeakMap(), tt = new WeakMap(), it = new WeakMap(), nt = new WeakMap(), rt = new WeakMap(), vt = new WeakMap(), at = new WeakMap(); +let yi = ei; +const Pr = async (t, e = "/", i = "") => { + try { + const n = await t.stat(e), r = e === "/" ? "/" : ce.basename(e), a = { title: r, key: i ? `${i}${e}` : e, isLeaf: n.isFile() }; + if (n.isDirectory()) { + const o = await t.dir(e); + if (o.length > 0) { + a.children = []; + const s = [], l = []; + for (const u of o) { + const d = e === "/" ? `/${u}` : `${e}/${u}`; + try { + (await t.stat(d)).isDirectory() ? s.push(u) : l.push(u); + } catch (p) { + console.warn(`Failed to stat ${d}:`, p.message); + } + } + s.sort(), l.sort(); + for (const u of [...s, ...l]) { + const d = e === "/" ? `/${u}` : `${e}/${u}`; + try { + const p = await Pr(t, d, i); + a.children.push(p); + } catch (p) { + console.warn(`Failed to process ${d}:`, p.message); + } + } + } + } + return a; + } catch { + return null; + } +}; +export { + xt as $, + Fi as A, + Oi as B, + qn as C, + wt as D, + Un as E, + Bn as F, + na as G, + _n as H, + Yt as I, + ne as J, + Kn as K, + Xn as L, + Vn as M, + Dn as N, + An as O, + Ln as P, + Zr as Q, + Ai as R, + ea as S, + Ti as T, + Dt as U, + jn as V, + In as W, + Qn as X, + Zn as Y, + ra as Z, + aa as _, + vi as a, + oa as a0, + sa as a1, + lt as a2, + ct as a3, + la as a4, + ca as a5, + cr as a6, + Xt as a7, + Gt as a8, + zi as a9, + $e as aA, + Er as aB, + Sr as aC, + yi as aD, + Pr as aE, + tr as aa, + ir as ab, + nr as ac, + rr as ad, + ar as ae, + or as af, + da as ag, + bt as ah, + N as ai, + Si as aj, + hr as ak, + G as al, + ot as am, + $i as an, + Z as ao, + ee as ap, + Kr as aq, + _r as ar, + Hr as as, + se as at, + Zt as au, + vr as av, + I as aw, + ki as ax, + Ve as ay, + Fe as az, + Pn as b, + st as c, + xi as d, + Yr as e, + Gr as f, + xn as g, + Xr as h, + Nn as i, + Rn as j, + Qr as k, + Ri as l, + Tn as m, + ta as n, + Jt as o, + Li as p, + Vi as q, + Ot as r, + Yn as s, + oe as t, + Jr as u, + Ii as v, + Hn as w, + Jn as x, + ia as y, + ji as z +}; diff --git a/dist/components.js b/dist/components.js index b613172..69042c2 100644 --- a/dist/components.js +++ b/dist/components.js @@ -1,4 +1,4 @@ -import { aq as s, ah as p, ar as n, as as r, ap as t } from "./common/main-C0CYfBDd.js"; +import { aq as s, ah as p, ar as n, as as r, ap as t } from "./common/main-D7to3RZo.js"; export { s as Empty, p as Icon, diff --git a/dist/container.js b/dist/container.js index 84dfb94..a02cf93 100644 --- a/dist/container.js +++ b/dist/container.js @@ -1,4 +1,4 @@ -import { am as s, aq as e, ar as p, as as n, an as t, ap as d, ao as r, al as u } from "./common/main-C0CYfBDd.js"; +import { am as s, aq as e, ar as p, as as n, an as t, ap as d, ao as r, al as u } from "./common/main-D7to3RZo.js"; export { s as Context, e as Empty, diff --git a/dist/data-converter.js b/dist/data-converter.js index 253a49c..975e081 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-C0CYfBDd.js"; +import { D as p } from "./common/main-D7to3RZo.js"; export { p as default }; diff --git a/dist/data-list.js b/dist/data-list.js index 5b57d56..2d2d8cd 100644 --- a/dist/data-list.js +++ b/dist/data-list.js @@ -1,4 +1,4 @@ -import { L as t, J as e, B as r, F as o, M as i, I as l, E as u, K as D, C as n, N as L, A as C, P as m, O as p, W as b, S as c, U as F, T as d, V as O, Q as S } from "./common/main-C0CYfBDd.js"; +import { L as t, J as e, B as r, F as o, M as i, I as l, E as u, K as D, C as n, N as L, A as C, P as m, O as p, W as b, S as c, U as F, T as d, V as O, Q as S } from "./common/main-D7to3RZo.js"; export { t as DataListContent, e as DataListContext, diff --git a/dist/data-list/utils.js b/dist/data-list/utils.js index ab9857a..12a97cb 100644 --- a/dist/data-list/utils.js +++ b/dist/data-list/utils.js @@ -1,5 +1,5 @@ import "lodash"; -import { p as t } from "../common/main-C0CYfBDd.js"; +import { p as t } from "../common/main-D7to3RZo.js"; export { t as getDefaultExpandRowKeys }; diff --git a/dist/grid-layout-form.js b/dist/grid-layout-form.js index 3612f4c..33213e0 100644 --- a/dist/grid-layout-form.js +++ b/dist/grid-layout-form.js @@ -1,4 +1,4 @@ -import { a7 as s, a9 as r, a8 as u, a6 as o, z as t, ae as m, ac as d, ad as F, ag as i, ab as g, aa as c, af as l } from "./common/main-C0CYfBDd.js"; +import { a7 as s, a9 as r, a8 as u, a6 as o, z as t, ae as m, ac as d, ad as F, ag as i, ab as g, aa as c, af as l } from "./common/main-D7to3RZo.js"; export { s as GridLayoutForm, r as GridLayoutFormHelper, diff --git a/dist/grid-layout-form/utils.js b/dist/grid-layout-form/utils.js index 7fafc8b..3144af5 100644 --- a/dist/grid-layout-form/utils.js +++ b/dist/grid-layout-form/utils.js @@ -1,5 +1,5 @@ import "lodash"; -import { a as o, g } from "../common/main-C0CYfBDd.js"; +import { a as o, g } from "../common/main-D7to3RZo.js"; export { o as getNormalizeWidget, g as getOptionItemByValue diff --git a/dist/grid-layout.js b/dist/grid-layout.js index d7366d3..cccb357 100644 --- a/dist/grid-layout.js +++ b/dist/grid-layout.js @@ -1,4 +1,4 @@ -import { q as u, v as e, s as r, H as t, G as d, x as i, z as o, y, w as G } from "./common/main-C0CYfBDd.js"; +import { q as u, v as e, s as r, H as t, G as d, x as i, z as o, y, w as G } from "./common/main-D7to3RZo.js"; export { u as GridLayout, e as GridLayoutFramework, diff --git a/dist/grid-layout/utils.js b/dist/grid-layout/utils.js index 2ed76f9..2ab0b88 100644 --- a/dist/grid-layout/utils.js +++ b/dist/grid-layout/utils.js @@ -1,4 +1,4 @@ -import { l as t, o as a, n as l } from "../common/main-C0CYfBDd.js"; +import { l as t, o as a, n as l } from "../common/main-D7to3RZo.js"; export { t as getBoxStyle, a as getNormalizeFields, diff --git a/dist/hooks.js b/dist/hooks.js index c673b36..f16a553 100644 --- a/dist/hooks.js +++ b/dist/hooks.js @@ -1,7 +1,7 @@ import "lodash"; import "rc-field-form"; import "react"; -import { a3 as r, a2 as o, a4 as p, a0 as f, a1 as i, a5 as m, $ as c } from "./common/main-C0CYfBDd.js"; +import { a3 as r, a2 as o, a4 as p, a0 as f, a1 as i, a5 as m, $ as c } from "./common/main-D7to3RZo.js"; import { default as b } from "rc-util/lib/hooks/useMergedState"; export { r as useDeepEffect, diff --git a/dist/iconfont.js b/dist/iconfont.js index 972b703..5bef20f 100644 --- a/dist/iconfont.js +++ b/dist/iconfont.js @@ -2,7 +2,7 @@ import "react/jsx-runtime"; import "react"; import "prop-types"; import "classnames"; -import { ah as a } from "./common/main-C0CYfBDd.js"; +import { ah as a } from "./common/main-D7to3RZo.js"; export { a as default }; diff --git a/dist/index.js b/dist/index.js index a221106..ac3adf3 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1,4 +1,4 @@ -import { aB as s, aC as e, ax as o, ay as n, at as p, az as r, aw as c, av as u, au as f, aA as l } from "./common/main-C0CYfBDd.js"; +import { aB as s, aC as e, ax as o, ay as n, at as p, az as r, aw as c, av as u, au as f, aA as l } from "./common/main-D7to3RZo.js"; export { s as AppContext, e as AppGlobalParamsContext, diff --git a/dist/pages.js b/dist/pages.js index 77e015a..bb4f485 100644 --- a/dist/pages.js +++ b/dist/pages.js @@ -1,4 +1,4 @@ -import { Y as t, X as e, Z as o, _ as g } from "./common/main-C0CYfBDd.js"; +import { Y as t, X as e, Z as o, _ as g } from "./common/main-D7to3RZo.js"; export { t as CustomPage, e as DataListPage, diff --git a/dist/res-ws.js b/dist/res-ws.js index 64b6223..27ce73d 100644 --- a/dist/res-ws.js +++ b/dist/res-ws.js @@ -1,5 +1,5 @@ import "lodash"; -import { R as a } from "./common/main-C0CYfBDd.js"; +import { R as a } from "./common/main-D7to3RZo.js"; export { a as default }; diff --git a/dist/utils.js b/dist/utils.js index bec47b3..1e6f468 100644 --- a/dist/utils.js +++ b/dist/utils.js @@ -1,5 +1,5 @@ import "lodash"; -import { d as s, f as i, e as g, h as m, b as o, k as P, c as p, j as d, i as h, m as k, r as f, t as u, u as l } from "./common/main-C0CYfBDd.js"; +import { d as s, f as i, e as g, h as m, b as o, k as P, c as p, j as d, i as h, m as k, r as f, t as u, u as l } from "./common/main-D7to3RZo.js"; import "./common/vender-FNiQWFaA.js"; export { s as deepSome, diff --git a/dist/virtual-fs.js b/dist/virtual-fs.js index a82e22e..bde49d8 100644 --- a/dist/virtual-fs.js +++ b/dist/virtual-fs.js @@ -1,5 +1,5 @@ import "pathe"; -import { aD as o, aE as r } from "./common/main-C0CYfBDd.js"; +import { aD as o, aE as r } from "./common/main-D7to3RZo.js"; export { o as default, r as toTreePaths diff --git a/package.json b/package.json index 46a983a..ab99e5b 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "ff", "private": true, - "version": "0.6.22", + "version": "0.6.23", "author": "www.fsdpf.com", "type": "module", "main": "./dist/index.js",