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