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