diff --git a/dist/button.js b/dist/button.js index 83c7f53..bed2f00 100644 --- a/dist/button.js +++ b/dist/button.js @@ -1,4 +1,4 @@ -import { Y as s, X as u, Z as e } from "./common/main-CAjvwlqH.js"; +import { $ as s, _ as u, a0 as e } from "./common/main-B5hgccZL.js"; import "prop-types"; export { s as auth, diff --git a/dist/common/main-B5hgccZL.js b/dist/common/main-B5hgccZL.js new file mode 100644 index 0000000..66fbcb0 --- /dev/null +++ b/dist/common/main-B5hgccZL.js @@ -0,0 +1,1000 @@ +var kn = Object.defineProperty; +var Et = (e) => { + throw TypeError(e); +}; +var vn = (e, t, n) => t in e ? kn(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n; +var x = (e, t, n) => vn(e, typeof t != "symbol" ? t + "" : t, n), Rt = (e, t, n) => t.has(e) || Et("Cannot " + n); +var m = (e, t, n) => (Rt(e, t, "read from private field"), n ? n.call(e) : t.get(e)), E = (e, t, n) => t.has(e) ? Et("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, n), B = (e, t, n, a) => (Rt(e, t, "write to private field"), a ? a.call(e, n) : t.set(e, n), n); +var Ft = (e, t, n, a) => ({ + set _(r) { + B(e, t, r, n); + }, + get _() { + return m(e, t, a); + } +}); +import { jsx as d, jsxs as O } from "react/jsx-runtime"; +import C, { useEffect as R, useState as N, useCallback as ce, useMemo as G, useRef as D, useContext as de, useId as Ge, useLayoutEffect as xn } from "react"; +import p from "lodash"; +import qt from "immutability-helper"; +import { Form as Ke, Input as Sn, Button as lt, Pagination as $n, Tree as Pn, Breadcrumb as Nn, Table as Tn, Empty as En, Popconfirm as Rn, Tooltip as Fn, Popover as On } from "antd"; +import { useMergedState as Ln } from "rc-util"; +import V from "classnames"; +import Q, { FieldContext as Vn, Field as Ht } from "rc-field-form"; +import { useParams as jn, generatePath as An, createBrowserRouter as In, useInRouterContext as Mn, Navigate as zn } from "react-router-dom"; +import k from "prop-types"; +import * as Ot from "react-is"; +import { useNotification as Wn } from "rc-notification"; +import { N as Re, a as Fe, T as ct, S as Bn } from "./vender-DMK1apIA.js"; +import "rc-util/lib/hooks/useMergedState"; +import Un from "rc-drawer"; +import Dn from "rc-dialog"; +var $e, Ve, Pe, se, ke, ve; +class Jt { + constructor(t, n) { + E(this, $e, /* @__PURE__ */ new Map()); + E(this, Ve, !0); + E(this, Pe, []); + E(this, se); + E(this, ke, () => m(this, se)); + E(this, ve, () => Promise.resolve()); + x(this, "get", (...t) => new Promise((n, a) => { + const r = JSON.stringify(t); + if (m(this, $e).has(r)) return n(m(this, ve).call(this, m(this, se), ...t)); + if (m(this, se) === void 0) m(this, Pe).push([t, n, a]), m(this, Ve) && (B(this, Ve, !1), Promise.resolve(typeof m(this, ke) == "function" ? m(this, ke).call(this) : m(this, ke)).then((i) => B(this, se, i || null)).finally(() => { + m(this, Pe).forEach(([i, s, o]) => { + try { + const l = m(this, ve).call(this, m(this, se), ...i); + m(this, $e).set(JSON.stringify(i), l), s(l); + } catch (l) { + o(l); + } + }), m(this, Pe).length = 0; + })); + else { + const i = m(this, ve).call(this, m(this, se), ...t); + m(this, $e).set(r, i), n(i); + } + })); + B(this, ve, n), B(this, ke, t); + } +} +$e = new WeakMap(), Ve = new WeakMap(), Pe = new WeakMap(), se = new WeakMap(), ke = new WeakMap(), ve = new WeakMap(); +const er = () => d("div", { children: "Empty" }), We = C.createContext({ ele: {}, mount: () => { +}, unmount: () => { +} }), J = ({ rootClassName: e, className: t, children: n, actions: a, title: r, subTitle: i, extras: s, style: o = {} }) => { + const { mount: l, unmount: c } = C.useContext(We); + return a && J.Action({ children: a }), r && J.Title({ children: r }), i && J.SubTitle({ children: i }), s && J.Extra({ children: s }), R(() => (l("rootClassName", e), () => c(e)), [e]), d("div", { className: V("ff-container", t), style: o, children: n }); +}, Je = (e) => ({ children: t, className: n }) => { + const { mount: a, unmount: r } = C.useContext(We); + return R(() => (a(e, C.createElement("div", { key: `ff-${e}`, className: V(`ff-popup-${e}`, n) }, t)), () => r(e)), [n, t]), null; +}; +J.Action = Je("actions"), J.Title = Je("title"), J.SubTitle = Je("sub-title"), J.Extra = Je("extras"), J.propTypes = { className: k.string, style: k.object, title: k.any, subTitle: k.any, actions: k.any, extras: k.any }; +const tr = () => d(J, { className: "ff-loading", children: O("div", { className: "loader", children: [O("div", { className: "square", children: [d("span", {}), d("span", {}), d("span", {})] }), O("div", { className: "square", children: [d("span", {}), d("span", {}), d("span", {})] }), O("div", { className: "square", children: [d("span", {}), d("span", {}), d("span", {})] }), O("div", { className: "square", children: [d("span", {}), d("span", {}), d("span", {})] })] }) }), nr = () => d("div", { children: "NotFound" }), Kt = ({ children: e }) => { + const [t, n] = N({}), a = ce((i, s) => n((o) => ({ ...o, [i]: s })), []), r = ce((i) => n((s) => ({ ...s, [i]: void 0 })), []); + return typeof (e == null ? void 0 : e.type) == "string" ? e : d(We.Provider, { value: { ele: t, mount: a, unmount: r }, children: C.cloneElement(e, { className: t.rootClassName, title: t.title, subTitle: t["sub-title"], actions: t.actions, extras: t.extras }) }); +}; +Kt.propTypes = { children: k.element.isRequired }; +const Lt = { 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"] }, Ct = ({ type: e, props: t }) => d("i", { ...t, children: d("svg", { viewBox: "0 0 1024 1024", width: "1em", height: "1em", fill: "currentColor", children: (Lt[e] || Lt.info).map((n, a) => d("path", { d: n }, a)) }) }), _t = ({ className: e, content: t, icon: n, $close: a }) => O(C.Fragment, { children: [n && d("div", { className: V("ff-notification-icon", e), children: d(Ct, { type: n }) }), t] }), qn = ({}) => d(J, { children: "Confirm" }); +var ge, Ne; +const te = class te { + constructor() { + E(this, Ne, /* @__PURE__ */ new Map()); + x(this, "init", (t) => B(this, Ne, new Map(t))); + x(this, "check", (t) => !m(this, Ne).has(t) || m(this, Ne).get(t)); + if (m(te, ge)) return m(te, ge); + } +}; +ge = new WeakMap(), Ne = new WeakMap(), E(te, ge, null), x(te, "getInstance", () => (m(te, ge) || B(te, ge, new te()), m(te, ge))); +let dt = te; +const Hn = dt.getInstance(); +var pe, je; +const ne = class ne { + constructor() { + E(this, je, null); + x(this, "init", (t) => B(this, je, t)); + x(this, "get", (t, n) => p.get(m(this, je), t, n)); + if (m(ne, pe)) return m(ne, pe); + } +}; +pe = new WeakMap(), je = new WeakMap(), E(ne, pe, null), x(ne, "getInstance", () => (m(ne, pe) || B(ne, pe, new ne()), m(ne, pe))); +let ut = ne; +const Oe = ut.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" }, X = (e, t) => { + let n = "string"; + n = Array.isArray(e) ? "array" : typeof e, p.isObject(e) && (n = "json"); + const a = `${n}2${t}`; + return Reflect.has(Vt, a) ? Vt[a](e) : e; +}, Gt = (e = {}, t = {}, n = {}, a = "") => Yt(e, (r, i) => i === "type" && r === "code") ? Xt(e, t, n, a) : Qt(e, t, a), Yt = (e, t = () => !1) => p.some(e, (n) => !!p.some(n, t) || (p.isEmpty(n) || !p.isPlainObject(n) && !p.isArray(n) ? void 0 : Yt(n, t))), Xt = async (e = {}, t = {}, n = {}, a = "") => { + let r = /* @__PURE__ */ Object.create(null); + for (let i in e) { + let s; + if (Reflect.has(e[i], "type") && ["code", "field", "router", "query", "string"].includes(e[i].type)) { + const { type: o, value: l = "", default: c = a } = e[i]; + switch (o) { + case "code": + s = await Ce.exec(l, t, n); + break; + case "field": + s = p.get(t, l) ?? p.get(t, l.substring(l.indexOf(".") + 1)); + break; + case "router": + case "query": + s = le.getPageParams(l); + break; + case "string": + s = l; + } + s ?? (s = c); + } else s = await Xt(e[i], t, n, a); + p.set(r, i, s); + } + return r; +}, Qt = (e = {}, t = {}, n = "") => Object.keys(e || {}).reduce((a, r) => { + if (p.isPlainObject(e[r])) { + let i; + if (Reflect.has(e[r], "type") && ["field", "router", "query", "string"].includes(e[r].type)) { + const { type: s, value: o = "", default: l = n } = e[r]; + switch (s) { + case "field": + i = p.get(t, o) ?? p.get(t, o.substring(o.indexOf(".") + 1)); + break; + case "router": + case "query": + i = le.getPageParams(o); + break; + case "string": + i = o; + } + i ?? (i = l); + } else i = Qt(e[r], t, n); + p.set(a, r, i); + } + return a; +}, {}), it = (e, t) => e && typeof e == "object" ? Array.isArray(e) ? e.map((n) => it(n, t)) : Object.keys(e).reduce((n, a) => (t[a] ? n[t[a]] = it(e[a], t) : n[a] = it(e[a], t), n), {}) : e, ar = () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (e) => { + const t = 16 * Math.random() | 0; + return (e === "x" ? t : 3 & t | 8).toString(16); +}), rr = (e) => { + var t, n; + return e ? (n = (t = e.match(/^@pkg(?:[^\/]*\/){3}(?[^\/]+)/)) == null ? void 0 : t.groups) == null ? void 0 : n.name : ""; +}, ir = (e) => { + var t, n; + return e ? (n = (t = e.match(/^@pkg(?:[^\/]*\/){2}(?[^\/]+)/)) == null ? void 0 : t.groups) == null ? void 0 : n.category : ""; +}, sr = (e) => { + var t, n; + return e ? (n = (t = e.match(/^@pkg(?:[^\/]*\/){1}(?[^\/]+)/)) == null ? void 0 : t.groups) == null ? void 0 : n.owner : ""; +}; +var Xe, Ae, Ie, Qe; +const Ze = class Ze { + constructor(...t) { + E(this, Ae, []); + E(this, Ie, (t) => { + var n; + for (let a of t) Array.isArray(a[0]) ? m(this, Ie).call(this, a) : m(this, Ae).push(m(n = Ze, Xe).call(n, a[0], a[1])); + }); + x(this, "toValue", async (t, n = null) => { + const a = { getValue: () => t, getRecord: () => n }; + return await m(this, Ae).reduce(async (r, i) => { + try { + const s = await r; + return (await i).call(a, s); + } catch (s) { + return console.error(s), r; + } + }, t); + }); + x(this, "toRender", (t, n, a = null) => C.createElement(m(this, Qe), { value: t, record: n }, a)); + E(this, Qe, ({ value: t, record: n, children: a }) => { + const [r, i] = N(a); + return xt(() => { + let s = !1; + return i(a), this.toValue(t, n).then((o) => X(o, "string")).then((o) => !s && i(o)).catch((o) => !s && i(`${o}`)), () => s = !0; + }, [t, n]), r; + }); + m(this, Ie).call(this, t); + } +}; +Xe = new WeakMap(), Ae = new WeakMap(), Ie = new WeakMap(), Qe = new WeakMap(), E(Ze, Xe, p.memoize((t, n) => Z.getWidgetComponent(t).then((a) => { + var r; + return ((r = a.default) == null ? void 0 : r.call(a, n)) || ((i) => i); +}), (t, n) => `${t}::${X(n, "string")}`)); +let Ye = Ze; +const Jn = (e, t = {}) => G(() => e == null ? void 0 : e.map(({ widgetByJs: n, widgetByJsSetting: a, ...r }, i) => n ? { ...r, render: (s, o) => new Ye([n, a]).toRender(s, o, "-") } : r), [e, t]), or = (e) => { + const [t, n] = N({}); + return R(() => { + let a = !1; + return e && F.get(`/api/_/${e}`).then((r) => p.pick(r, ["uuid", "name", "code", "resource", "marginX", "marginY", "cols", "rowHeight", "primaryKey", "columns", "itemOperations", "batchOperations", "isConditionFormLayout", "layout", "tabs", "pageSize", "layoutConfig"])).then((r) => !a && n(r)), () => a = !0; + }, [e]), t; +}, lr = (e, t = {}) => { + const [n, a] = N({ dataSource: [] }); + return Be(() => { + let r = !1; + return e && F.get(`/api/${e}/${F.encode({ page: 1, ...t })}`).then((i) => !r && a(i)), () => r = !0; + }, [e, t]), n; +}, gt = (e, t = null, n = null, a = "id") => G(() => { + if (p.isEmpty(e) || !e.some(({ uuid: i }) => Hn.check(i))) return !1; + if (p.isEmpty(n) || p.isEmpty(t)) return !0; + const r = t.map((i) => `${i == null ? void 0 : i[a]}`); + return e.some(({ uuid: i }) => !i || !n.has(i) || n.get(i).some((s) => r.includes(`${s}`))); +}, [e, t, n, a]), Kn = (e, t, n = "id", a = null) => { + const r = vt(), i = D(!1), s = D(e.dataSource), o = D(e.itemOperationsAccess); + return R(() => (s.current = e.dataSource, o.current = e.itemOperationsAccess, () => i.current = !1), [e.dataSource, e.itemOperationsAccess]), i.current && (e.dataSource = s.current, e.itemOperationsAccess = o.current), [e, (l = 0, c = null) => { + var u, g; + if (i.current = !1, l === 1) return (u = e.onReload) == null ? void 0 : u.call(e); + if (l === 2) { + const h = p.get(c, "__PARENT_ID__", ""), y = p.get(c, n, p.get(c, [a, n], "")), f = p.findIndex(s.current, ["__PARENT_ID__", h]), b = p.findIndex(f > -1 ? p.get(s.current, [f, "children"]) : s.current, [n, y]); + if (b === -1) return (g = e.onReload) == null ? void 0 : g.call(e); + Promise.all([F.get(`/api/${t}/detail/${y}`), F.post(`/api/${t}/list-operations-access`, { ids: y })]).then(([w, $]) => { + const I = p.get(s.current, f > -1 ? [f, "children", b, "children"] : [b, "children"]); + s.current = qt(s.current, f > -1 ? { [f]: { children: { $splice: [[b, 1, { ...w, children: I }]] } } } : { $splice: [[b, 1, { ...w, children: I }]] }); + const L = new Map($); + o.current.forEach((M, j) => { + var A; + (A = L.get(j)) != null && A.some((T) => T == y) || o.current.set(j, M.filter((T) => T !== y)); + }), L.forEach((M, j) => { + o.current.has(j) ? o.current.set(j, p.uniq([...o.current.get(j) || [], ...M])) : o.current.set(j, M); + }); + }).then(() => { + i.current = !0, r(); + }); + } + }]; +}, _n = (e, t) => { + const n = vt(), a = D(t), r = D(/* @__PURE__ */ new Map()), i = D([]), s = p.throttle((l) => { + i.current = [], F.list(e, p.pick({ ...a.current, ...l }, ["tab", "page", "pageSize", "condition", "sider", "keyword"])).then(({ keyword: c, condition: u, total: g, tab: h, sider: y, page: f, pageSize: b, operationsAccess: w, dataSource: $ }) => { + a.current = { tab: h, condition: u, sider: y, keyword: c, total: g, pageSize: b, page: $ != null && $.length ? f : 1 }, i.current = $, r.current = new Map(w), n(); + }); + }, 380, { leading: !1, trailing: !0 }); + xt(() => { + i.current = [], e && s(t); + }, [e, t]); + const o = G(() => p.pick(a.current, ["total", "tab", "page", "pageSize", "condition", "sider", "keyword"]), [a.current]); + return Object.assign(o, { onTabChange: (l) => s({ tab: l, page: 1 }), onPageChange: (l, c) => s({ page: l, pageSize: c }), onPageSizeChange: (l) => s({ pageSize: l, page: 1 }), onConditionChange: (l, c) => s({ keyword: c, condition: qt(a.current.condition || {}, { $merge: l || {} }), page: 1 }), onSiderChange: (l) => s({ sider: l, page: 1 }), onKeywordChange: (l) => s({ keyword: l, page: 1 }), itemOperationsAccess: r.current, dataSource: i.current, onReload: s }); +}, Gn = ({ listCode: e, className: t, layouts: n, dataSource: a, isPaginate: r, isItemOperations: i, isBatchOperations: s, batchOperations: o, itemOperations: l, itemOperationsAccess: c, resource: u, primaryKey: g, title: h, itemGridLayout: y, $setting: f, tabs: b, isConditionFormLayout: w, isTreeSider: $, treeSiderConfig: I }) => { + const { classNames: L, onClickCallback: M } = de(ee), j = ce((A, T, v) => d(Yn, { className: V("ff-data-list-framework-item", L.item), operations: i && T ? l == null ? void 0 : l.filter((S) => !(g && S.uuid && c.has(S.uuid)) || c.get(S.uuid).includes(T == null ? void 0 : T[g])) : [], data: u ? { [u]: T } : T, children: A, onClickCallback: M }), [u, g, i, M, l, c]); + return O("div", { className: V("ff-data-list-framework", t), children: [d(n.sider, { isTreeSider: $, ...I }), O("div", { className: V("ff-data-list-container", L == null ? void 0 : L.container), children: [d(n.filter, { isConditionFormLayout: w }), d(n.toolbar, { title: h, tabs: b }), d(la, { ...y, style: { "--col-num": (f == null ? void 0 : f.colNum) || 1 }, primaryKey: g, itemRender: j, dataSource: a }), d(n.footer, { isPaginate: r, isOperations: s, operations: o })] })] }); +}, Yn = ({ className: e, operations: t, children: n, data: a, onClickCallback: r }) => O("div", { className: V("data-list-grid-layout-item-container", e), children: [n, !!(t != null && t.length) && d("div", { className: "data-list-grid-layout-item-actions", children: t.map((i) => d("span", { className: "data-list-grid-layout-item-action", children: d(P.Link, { uuid: i.uuid, type: i.type, name: i.name, widget: i.widget, widgetType: i.widgetType, widgetProps: i.widgetProps, widgetSetting: i.widgetSetting, widgetContainerProps: i.widgetContainerSetting, data: a, confirm: i.confirm, onAfterClick: (s) => s !== !1 && (r == null ? void 0 : r(i.isRefresh, a)) }, i.uuid || Ge()) }, (i == null ? void 0 : i.uuid) || Ge())) })] }), Xn = ({ listCode: e, className: t, layouts: n, dataSource: a, columns: r, isItemOperations: i, isBatchOperations: s, batchOperations: o, itemOperations: l, itemOperationsAccess: c, resource: u, primaryKey: g, title: h, tabs: y, isPaginate: f, isTreeSider: b, treeSiderConfig: w, isConditionFormLayout: $, ...I }) => { + const { classNames: L, onClickCallback: M } = de(ee), j = gt(l, a, c, g); + return O("div", { className: V("ff-data-table-framework", t), children: [d(n.sider, { isTreeSider: b, ...w }), O("div", { className: V("ff-data-table-container", L == null ? void 0 : L.container), children: [d(n.filter, { isConditionFormLayout: $ }), d(n.toolbar, { title: h, tabs: y }), d(aa, { ...I, primaryKey: g, className: "ff-data-table-content", columns: r, dataSource: a, operationRender: j ? (A) => d("div", { className: "ff-data-table-actions", children: l == null ? void 0 : l.reduce((T, v, S) => [...T, d(P.Link, { size: "small", uuid: v.uuid, type: v.type, name: v.name, widget: v.widget, widgetType: v.widgetType, widgetProps: v.widgetProps, widgetData: v.widgetData, widgetSetting: v.widgetSetting, widgetContainerProps: v.widgetContainerSetting, data: A, confirm: v.confirm, onAfterClick: (U) => U !== !1 && (M == null ? void 0 : M(v.isRefresh, A)) }, v.uuid || S)], []) }) : null }), d(n.footer, { isPaginate: f, isOperations: s, operations: o })] })] }); +}, ee = C.createContext({ listCode: "", classNames: {}, getBase62params: (e, t) => { +}, onReload: () => { +}, onClickCallback: () => { +}, onConditionChange: () => { +}, onTabChange: () => { +}, onSiderChange: () => { +}, onKeywordChange: () => { +}, onPageChange: () => { +}, onPageSizeChange: () => { +} }), Zt = (e, t, n, a, r = {}, i = 0) => { + const s = { "--grid-layout-h": `${a}`, "--grid-layout-w": `${n}`, "--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"] = `${a}`, 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"] = jt(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"] = jt(r == null ? void 0 : r.paddingTop, r == null ? void 0 : r.paddingRight, r == null ? void 0 : r.paddingBottom, r == null ? void 0 : r.paddingLeft), i && (s.height = `${i}px`), s; +}, jt = (e, t, n, a) => `${e || 0}px ${t || 0}px ${n || 0}px ${a || 0}px`, en = ({ className: e, isConditionFormLayout: t }) => { + var h, y; + const [n, a] = N({}), { listCode: r, onKeywordChange: i, onConditionChange: s, getBase62params: o, classNames: l } = C.useContext(ee), { keyword: c, condition: u } = (o == null ? void 0 : o()) || {}, [g] = Ke.useForm(); + return R(() => { + r && t && F.get(`/api/_/${r}/list-condition-form-layout`).then(({ resource: f, marginX: b, marginY: w, rowHeight: $, cols: I, fields: L }) => { + a({ resource: f, itemMargin: [b, w], rowHeight: $, cols: I, fields: L }); + }).catch(() => a({})); + }, [r, t]), R(() => { + g.setFieldsValue({ keyword: c, ...u }); + }, [JSON.stringify([c, u])]), d("div", { className: V("ff-data-list-filter", l.filter, e), children: d(Ke, { form: g, layout: "vertical", autoComplete: "off", onFinish: ((h = n.fields) == null ? void 0 : h.length) > 1 ? (f) => s({ [n.resource]: f[n.resource] }, f.keyword) : () => { + }, onValuesChange: (f) => { + p.isEmpty(p.omit(f, ["keyword"])) || g.submit(); + }, children: ((y = n.fields) == null ? void 0 : y.length) > 1 ? d(St, { ...n, children: d(Qn, { onReset: () => { + const { keyword: f, condition: b } = o("init") || {}; + g.setFieldsValue({ keyword: f, ...b }); + } }) }) : d("div", { className: "ff-data-list-filter-default-form ff-grid-layout-form", children: d("div", { className: "grid-layout-item", style: Zt(20, 0, 5, 2), children: d(Ke.Item, { name: ["keyword"], children: d(Sn.Search, { allowClear: !0, enterButton: "搜索", placeholder: "多关键字 | 分割", onSearch: (f) => i(f) }) }) }) }) }) }); +}, Qn = ({ cols: e, fields: t, onReset: n }) => { + const [a, r] = N(!1), i = G(() => t == null ? void 0 : t.toReversed().some((s) => s.y > 1 || s.x + s.w >= e - 5), [e, t]); + return O(Ke.Item, { label: " ", style: { "--item-span": 5 }, className: V("ff-data-list-filter-actions", { expanded: a }), children: [d(lt, { onClick: n, children: "重置" }), d(lt, { type: "primary", htmlType: "submit", children: "查询" }), i && d(P.Link, { className: "ff-data-list-filter-expanded-button", widget: () => r((s) => !s), type: "primary", name: a ? "关闭" : "展开", icon: a ? "icon-up" : "icon-down", iconPosition: "end" })] }); +}; +en.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 Zn = ({ className: e, operations: t, isOperations: n, isPaginate: a }) => { + const { onPageChange: r, onPageSizeChange: i, onClickCallback: s, getBase62params: o } = C.useContext(ee), { total: l, page: c, pageSize: u } = (o == null ? void 0 : o()) || {}; + return n && !p.isEmpty(t) || a ? O("div", { className: V("ff-data-list-footer", e), children: [d("div", { className: "ff-data-list-actions", children: t == null ? void 0 : t.map((g, h) => d(P, { uuid: g.uuid, type: g.type, name: g.name, widget: g.widget, widgetType: g.widgetType, widgetProps: g.widgetProps, widgetData: g.widgetData, widgetSetting: g.widgetSetting, widgetContainerProps: g.widgetContainerSetting, onAfterClick: (y) => y !== !1 && (s == null ? void 0 : s(g.isRefresh, null)) }, g.uuid || h)) }), a && d($n, { size: "small", total: l, pageSize: u, showSizeChanger: !1, showTotal: (g) => `第 ${c} 页 / 总共 ${g} 条`, onChange: r, onShowSizeChange: i })] }) : null; +}, ea = [{ 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: d("span", { style: { color: "#1677ff" }, children: "sss" }), key: "0-0-1-0" }] }] }], ta = ({ className: e, width: t = 280, isTreeSider: n }) => { + const { classNames: a } = de(ee); + return n ? d(Pn.DirectoryTree, { className: V("ff-data-list-sider", a.sider, e), style: { "--sider-width": t }, showLine: !0, showIcon: !1, treeData: ea }) : null; +}, na = ({ className: e, title: t, tabs: n }) => { + const { getBase62params: a, onTabChange: r, onReload: i, classNames: s } = de(ee), { tab: o } = (a == null ? void 0 : a()) || {}, [l, c] = Ln((n == null ? void 0 : n[0].value) ?? (n == null ? void 0 : n[0].code), { value: o, onChange: r }); + return O("div", { className: V("ff-data-list-toolbar", s.toolbar, e), children: [d("div", { className: "ff-data-list-title", children: t }), d(Nn, { className: "ff-data-list-tabs", itemRender: ({ label: u, code: g, value: h }) => d("span", { onClick: () => c(h ?? g), className: V("ff-data-list-tab", { active: (h ?? g) == l }), children: u }), items: n }), O("div", { className: "ff-data-list-actions", children: [d(P.Link, { icon: "icon-reload", widget: () => i() }), d(P.Link, { icon: "icon-setting" })] })] }); +}, tn = ({ isItemGridLayout: e, theme: t, themeProps: n, onClickCallback: a, onReload: r, listCode: i, total: s = 0, page: o = 0, onPageChange: l, pageSize: c = 30, onPageSizeChange: u, tab: g, onTabChange: h, keyword: y, onKeywordChange: f, condition: b, onConditionChange: w, sider: $, onSiderChange: I, layouts: L, classNames: M = {}, ...j }) => { + const [A, T] = N(), v = G(() => { + let S = { sider: ta, filter: en, footer: Zn, toolbar: na }; + L === !1 ? S = { sider: null, filter: null, footer: null, toolbar: null } : p.isPlainObject(L) && (S = Object.assign({}, S, L)); + for (const U in S) S[U] || (S[U] = () => d(C.Fragment, {})); + return S; + }, [L]); + return R(() => { + t ? Z.getWidgetComponent(t).then((S) => { + if (!S) throw `${t} not found`; + return S; + }).catch((S) => ({ default: () => `${S}` })).then((S) => T(C.createElement(S.default, { ...j, layouts: v, $setting: n }))) : T(d(e ? Gn : Xn, { ...j, layouts: v, $setting: n })); + }, [t, n]), d(ee.Provider, { value: { classNames: M, listCode: i, onClickCallback: a, onReload: r, getBase62params: (S, U) => { + const z = { tab: g, page: o, pageSize: c, keyword: y, sider: $, condition: b, total: s }; + return S && S != "init" ? z[S] ?? U : z; + }, onPageChange: l, onPageSizeChange: u, onTabChange: h, onSiderChange: I, onKeywordChange: f, onConditionChange: w }, children: A && C.cloneElement(A, j) }); +}; +tn.propTypes = { layouts: k.oneOfType([k.exact({ sider: k.elementType, filter: k.elementType, footer: k.elementType, toolbar: k.elementType }), k.bool]) }; +var me, oe, xe, et; +const ae = class ae { + constructor() { + E(this, oe, null); + E(this, xe, /* @__PURE__ */ new Map()); + E(this, et, () => { + if (m(this, oe)) return m(this, oe).port.postMessage({ command: "status", data: [] }); + B(this, oe, new SharedWorker(new URL("/ff-worker/res-ws.js", self.location))), m(this, oe).port.onmessage = (t) => { + var n, a; + (n = t.data) != null && n.uuid ? m(this, xe).forEach((r, i) => { + var s; + (r == "*" || (s = r == null ? void 0 : r.includes) != null && s.call(r, t.data.uuid)) && i(t.data); + }) : ((a = t.data) == null ? void 0 : a.readyState) == WebSocket.CLOSED && F.get("/api/user-api-token").then(({ token: r, expire_at: i }) => { + m(this, oe).port.postMessage({ command: "initWs", data: [`ws${p.trimStart(F.appUrl, "http")}api/user-resource-status-ws?token=${r}`] }); + }); + }, m(this, oe).port.postMessage({ command: "status", data: [] }); + }); + x(this, "subscribe", (t, n = []) => (n ? Array.isArray(n) && n.length == 0 ? n = "*" : Array.isArray(n) || (n = [n].flat()) : n = "*", m(this, xe).set(t, n), m(this, xe).size == 1 && m(this, et).call(this), () => this.unsubscribe(t))); + x(this, "unsubscribe", (t) => m(this, xe).delete(t)); + if (m(ae, me)) return m(ae, me); + } +}; +me = new WeakMap(), oe = new WeakMap(), xe = new WeakMap(), et = new WeakMap(), E(ae, me, null), x(ae, "getInstance", () => (m(ae, me) || B(ae, me, new ae()), m(ae, me))); +let pt = ae; +const nn = pt.getInstance(), kt = C.forwardRef(({ listCode: e, base62params: t, className: n, itemClassName: a, theme: r, themeProps: i, layouts: s, classNames: o }, l) => { + const [{ resource: c, primaryKey: u, batchOperations: g = [], itemOperations: h = [], columns: y = [], themeConfig: f, theme: b, isConditionFormLayout: w = !1, isTreeSider: $, treeSiderConfig: I, isItemGridLayout: L, itemGridLayout: M, title: j, isPaginate: A, tabs: T }, v] = N({ isItemGridLayout: !1, itemGridLayout: {} }), S = _n(e, t), [{ dataSource: U, itemOperationsAccess: z, condition: K, tab: ue, keyword: _, page: nt, total: De, pageSize: at, sider: Nt, onConditionChange: gn, onTabChange: pn, onKeywordChange: mn, onPageChange: hn, onPageSizeChange: fn, onSiderChange: yn, onReload: rt }, Tt] = Kn(S, e, u, c), wn = gt(h, U, z, u), bn = gt(g); + return R(() => { + let qe = null; + return e && F.get(`/api/_/${e}`).resp(({ data: He, res: Cn }) => { + He != null && He.isDynamicRefresh && (qe = nn.subscribe(() => rt(), Cn)), v(He); + }).catch(() => v({})), () => qe == null ? void 0 : qe(); + }, [e]), C.useImperativeHandle(l, () => ({ onReload: rt, onClickCallback: Tt })), d(tn, { listCode: e, title: j, itemClassName: a, classNames: o, resource: c, primaryKey: u, theme: r || b, themeProps: i || f, isTreeSider: $, treeSiderConfig: I, isPaginate: A, tabs: T, isItemOperations: wn, isBatchOperations: bn, batchOperations: g, itemOperations: h, isItemGridLayout: L, columns: y, itemGridLayout: M, isConditionFormLayout: w, itemOperationsAccess: z, dataSource: U, onConditionChange: gn, onTabChange: pn, onKeywordChange: mn, onPageChange: hn, onPageSizeChange: fn, onSiderChange: yn, condition: K, tab: ue, keyword: _, page: nt, total: De, pageSize: at, sider: Nt, layouts: { footer: null }, className: V("ff-data-list-helper", n), onReload: rt, onClickCallback: Tt }); +}), an = (e, t, n = !0) => n !== !0 && n-- <= 0 ? [] : p.isArray(e) && !p.isEmpty(e) ? e.reduce((a, r) => (Reflect.has(r, t) && Reflect.has(r, "children") && a.push(r[t]), Reflect.has(r, "children") && !p.isEmpty(r.children) ? a.concat(an(r.children, t, n)) : a), []) : [], aa = ({ className: e, primaryKey: t, columns: n = [], dataSource: a = [], operationRender: r, operationWidth: i = 180, ...s }) => { + const { classNames: o } = de(ee); + Ge(); + const l = D(null), c = D(null), [u, g] = N([]), [h, y] = N({ width: 0, height: 0 }); + R(() => { + g(an(a, t)); + }, [a, t]), xn(() => { + const b = new ResizeObserver(() => { + var w; + y({ width: ((w = l.current) == null ? void 0 : w.nativeElement.querySelector(".ant-table-body").scrollWidth) || c.current.offsetWidth, height: c.current.offsetHeight }); + }); + return c.current && b.observe(c.current), () => { + c.current && b.unobserve(c.current); + }; + }, []); + const f = Jn(n); + return d("div", { ref: c, className: V("ff-data-list-table", o.content, e), children: h.height ? d(Tn, { ...s, ref: l, rowKey: (b) => (b == null ? void 0 : b[t]) ?? Math.random(), columns: f == null ? void 0 : f.concat(r ? [{ title: "操作", align: "center", fixed: "right", width: `${Math.ceil(i / h.width * 100).toFixed(2)}%`, render: (b, w, $) => r(w, $) }] : []), dataSource: a, size: "middle", scroll: { x: "max-content", y: h.height - 50 }, pagination: !1, expandable: { defaultExpandAllRows: !0, expandRowByClick: !0, onExpandedRowsChange: g, expandedRowKeys: u } }) : null }); +}, ra = "RC_FORM_INTERNAL_HOOKS", rn = (e, { initialValue: t, initialValueLanguage: n, convertJs: a, convertJsSetting: r, type: i = "string" }, s = null) => { + const o = D(!1), l = de(Vn), [c, u] = N(), [g, h] = N(n != "javascript" && e ? l.getFieldValue(e) : void 0), { registerWatch: y } = l.getInternalHooks(ra) || {}; + return R(() => y == null ? void 0 : y((f, b, w) => { + if (!o.current) return; + const $ = p.get(b, e); + p.isEqual($, g) || h(X($, i)); + }), [g]), R(() => { + n == "javascript" && t ? Ce.exec(t, {}, { getFieldValueForBasicForm: (f) => s ? s.getFieldValue(f) : l.getFieldValue(f), getFieldValue: (f) => l.getFieldValue(f) }).then((f) => h(X(f, i))).catch((f) => notification.error({ message: `布局数据错误: ${JSON.stringify(f)}` })).finally(() => o.current = !0) : (t && h(X(t ?? l.getFieldValue(e), i)), o.current = !0); + }, [t, n]), Be(() => { + o.current && a && new Ye([a, r]).toValue(g, l.getFieldsValue(!0)).then(u).catch((f) => { + u(f), console.error("布局数据转换错误: ", f, a); + }); + }, [g, a, r]), [c ?? g, g]; +}, sn = (e, t, n = "@pkg/ff/grid-layouts", a = null) => G(() => { + var r; + return (r = p.sortBy(e, ["y", "x"])) == null ? void 0 : r.map(({ i, x: s, y: o, w: l, h: c, field: { boxStyle: u, widgetPrefix: g = n, widget: h, ...y } }, f) => d("div", { className: "grid-layout-item", style: Zt(s, o, l, c, u, h === "Height" && (y == null ? void 0 : y.initialValue)), children: d(ia, { ...y, basicForm: a, itemWidget: h != null && h.startsWith("@") || h != null && h.startsWith("blob:") ? h : `${g}/${h}`, itemWidgetRender: t }) }, i || f)); +}, [e]), ia = ({ itemWidget: e, itemWidgetRender: t, basicForm: n, ...a }) => { + const [r, i] = N(); + return R(() => { + Z.getWidgetComponent(e).then(({ defaultProps: s = {}, default: o }) => { + i(C.createElement(t(o, s, n), a)); + }).catch((s) => { + console.error(s), i(e); + }); + }, [e]), r; +}, on = ({ cols: e = 12, rowHeight: t = 21, fields: n = [], data: a, containerPadding: r = [0, 0], itemMargin: i = [4, 0], formProps: s = {}, className: o, ...l }) => { + const [c] = Q.useForm(), u = sn(n, sa, "@pkg/ff/grid-layouts"), g = G(() => [{ name: "__PROPS__", value: s }], [s]); + return Be(() => (c.setFieldsValue(a), () => c.resetFields()), [a]), d(Q, { fields: g, form: c, component: !1, children: d("div", { ...l, className: V("ff-grid-layout", o), style: { "--grid-layout-item-margin-y": `${(i == null ? void 0 : i[0]) || 0}px`, "--grid-layout-item-margin-x": `${(i == null ? void 0 : i[1]) || 0}px`, "--grid-layout-container-padding-y": `${(r == null ? void 0 : r[0]) || 0}px`, "--grid-layout-container-padding-x": `${(r == null ? void 0 : r[1]) || 0}px`, "--grid-layout-cols": e, "--grid-layout-row-height": `${t}px` }, children: u }) }); +}, sa = (e, t = {}, n = null) => (a) => { + const { code: r, label: i, extras: s, isVirtual: o, initialValue: l, initialValueLanguage: c, convertJs: u, convertJsSetting: g, ...h } = p.merge({}, t, a), [y, f] = rn(o ? null : r, { initialValue: l, initialValueLanguage: c, convertJs: u, convertJsSetting: g, type: (h == null ? void 0 : h.type) || "string" }, n); + return d(e, { ...h, value: y, rawValue: f, $setting: s || {} }); +}, cr = (At = on, function({ code: e, data: t, ...n }) { + const [a, r] = N({ resource: null, cols: 12, rowHeight: 21, fields: [] }); + return R(() => { + e && F.get(`/api/_/${e}`).then((i) => r(p.pick(i, ["resource", "cols", "rowHeight", "fields"]))); + }, [e]), (a == null ? void 0 : a.resource) && d(At, { ...n, rowHeight: a.rowHeight, cols: a.cols, fields: a.fields, data: a != null && a.resource ? { [a == null ? void 0 : a.resource]: t } : {} }); +}); +var At; +const dr = ({ widget: e, widgetPrefix: t = "@pkg/ff/grid-layouts", basicForm: n, ...a }) => { + const r = e != null && e.startsWith("@") || e != null && e.startsWith("blob:") ? e : `${t}/${e}`, [i, s] = N(); + return R(() => { + r && Z.getWidgetComponent(r).then(({ defaultProps: o = {}, default: l }) => ({ default: oa(l, o, n) })).catch((o) => ({ default: () => `${o}` })).then((o) => s(C.createElement(o.default, a))); + }, [r]), i; +}, oa = (e, t = {}, n = null) => (a) => { + const { code: r, label: i, extras: s, isVirtual: o, initialValue: l, initialValueLanguage: c, convertJs: u, convertJsSetting: g, value: h, ...y } = p.merge({}, t, a), [f, b] = rn(o ? null : r, { initialValue: l, initialValueLanguage: c, convertJs: u, convertJsSetting: g, type: (y == null ? void 0 : y.type) || "string" }, n); + return d(e, { ...y, value: f, rawValue: b, $setting: s || {} }); +}, la = ({ cols: e, rowHeight: t, itemMargin: n, fields: a, primaryKey: r, dataSource: i, itemClassName: s, itemRender: o = (g, h, y) => g, empty: l = d(En, { description: null }), className: c, style: u = {} }) => { + const { classNames: g } = de(ee), h = Ge(), y = G(() => d(on, { cols: e, rowHeight: t, itemMargin: n, fields: a, className: s }), [a, e, t, n]); + return d("div", { className: V("ff-data-list-content", g.content, c), style: u, children: p.isEmpty(i) ? l : i.map((f, b) => { + const w = o(C.cloneElement(y, { data: f }), f, b); + return C.cloneElement(w, { key: `${h}-${(f == null ? void 0 : f[r]) || b}` }); + }) }); +}, ca = ({ component: e }) => { + const { base62params: t } = jn(); + return d(J, { children: d(kt, { listCode: e, base62params: F.decode(t) }) }); +}, da = () => "Empty", ua = ({ component: e, $setting: t }) => { + const [n, a] = N(); + R(() => { + if (!e) return a(d(da, { description: null })); + Z.getWidgetComponent(e).catch((i) => ({ default: () => `${i}` })).then((i) => C.createElement(i.default, { $setting: t })).then(a); + }, [e]); + const r = le.getPageParams() || {}; + return n ? C.cloneElement(n, r) : null; +}; +var he, Y, fe, ye, Me, ze; +const re = class re { + constructor() { + E(this, Y, /* @__PURE__ */ new Map()); + E(this, fe, {}); + E(this, ye, null); + x(this, "init", (t, n) => { + B(this, Y, t), B(this, fe, n); + }); + x(this, "get", (t) => (m(this, Y).has(t) || (t = Array.from(m(this, Y).keys()).find((n) => m(this, Y).get(n).uri === t)), m(this, Y).get(t) || {})); + x(this, "redirect", (t, n, a = {}) => { + const { uri: r, type: i, widgetProps: s } = this.get(t) || {}; + let o = An(r || t, i != "list" ? n : p.mapValues(n, (c) => F.encode(c))); + const l = new URLSearchParams(); + for (const c in s || {}) (s == null ? void 0 : s.type) == "query" && l.append(c, n[c]); + return l.size > 0 && (o = `${o}?${l.toString()}`), m(this, ye).navigate(o, a); + }); + x(this, "getMenus", (t) => { + var n; + return ((n = m(this, fe)) == null ? void 0 : n[t]) || []; + }); + x(this, "findMenuPathByUuid", (t) => { + let n = []; + for (const a in m(this, fe)) if (n = m(this, Me).call(this, m(this, fe)[a], t, [a]), n.length > 1) return n; + return n; + }); + x(this, "getMenusByRouteUuid", (t) => m(this, ze).call(this, t, Object.values(m(this, fe)).flat())); + E(this, Me, (t, n, a = []) => { + if (p.isEmpty(t)) return a; + for (const { uuid: r, children: i } of t) { + if (r == n) return a.concat(r); + if (!p.isEmpty(i)) return a.concat(r, m(this, Me).call(this, i, n)); + } + return a; + }); + E(this, ze, (t, n) => { + var r; + let a = []; + for (const i of n) i.widgetType == "redirect" && (i.uuid == t || i.widget == t ? a.push(i) : (r = i.children) != null && r.length && (a = a.concat(m(this, ze).call(this, t, i.children)))); + return a; + }); + x(this, "getCurrentMenu", () => { + const { uuid: t } = this.getCurrentRoute() || {}; + if (!t) return; + const n = this.getMenusByRouteUuid(t); + return p.isEmpty(n) ? void 0 : n[0]; + }); + x(this, "getCurrentRoute", (t = 0) => { + var a; + const n = (a = m(this, ye).state.matches[m(this, ye).state.matches.length - 1 - t]) == null ? void 0 : a.route; + if (!n) return null; + for (let [r, i] of m(this, Y)) if (i.uri === n.path) return i; + return null; + }); + x(this, "getPageParams", (t) => { + var i, s; + const { location: n = {}, matches: a = [] } = ((i = m(this, ye)) == null ? void 0 : i.state) || {}, r = ((s = a[a.length - 1]) == null ? void 0 : s.params) || {}; + return n.search && new URLSearchParams(n.search).forEach((o, l) => { + r[l] = o; + }), t ? p.get(r, t) : r; + }); + x(this, "createBrowserRouter", (t = {}) => { + if (m(this, Y).size == 0) return null; + const n = Oe.get("Common.WEBSITE_DEFAULT_THEME", "@pkg/ff/frameworks/DefaultTheme"), a = Oe.get(Z.checkUserToken() ? "Common.WEBSITE_LOGIN_REDIRECT" : "Common.WEBSITE_DEFAULT", "/index"), r = { [n]: 0 }, i = (o, l) => () => Z.getWidgetComponent(o).then((c) => c.default || function() { + return `${o}`; + }).then((c) => ({ Component: () => C.createElement(Kt, {}, C.createElement(c, l)) })), s = Array.from(m(this, Y).values()).reduce((o, { uuid: l, uri: c, name: u, type: g, component: h, widgetSetting: y, isLogin: f, isLayout: b, extra: w }) => { + let $ = {}, I = 0; + switch (g) { + case "list": + $.element = C.createElement(ca, { component: h }); + break; + case "fsdpf-component": + $.element = C.createElement(ua, { key: h, component: h, $setting: y }); + } + if (w != null && w.layout) { + if (!r[w == null ? void 0 : w.layout]) return r[w == null ? void 0 : w.layout] = o.length, [...o, { path: "/", lazy: i(w == null ? void 0 : w.layout, {}), children: [{ path: c, ...$ }] }]; + I = r[w == null ? void 0 : w.layout]; + } + return b && I > -1 ? (o[I].children.push({ path: c, ...$ }), o) : [...o, { path: c, ...$ }]; + }, [{ path: "/", lazy: i(n, {}), children: [] }]); + return s.push({ index: !0, element: C.createElement(ga, { to: a, replace: !0 }) }), B(this, ye, In(s, t)); + }); + if (m(re, he)) return m(re, he); + } +}; +he = new WeakMap(), Y = new WeakMap(), fe = new WeakMap(), ye = new WeakMap(), Me = new WeakMap(), ze = new WeakMap(), E(re, he, null), x(re, "getInstance", () => (m(re, he) || B(re, he, new re()), m(re, he))); +let mt = re; +const ga = ({ to: e, replace: t }) => Mn() ? C.createElement(zn, { to: e, replace: t }) : (window.document.location = e, "redirect"), le = mt.getInstance(), Se = new Worker(new URL("/ff-worker/index.js", self.location)), It = { getConfigure: (e) => Oe.get(e), route: { redirect: (...e) => le.redirect(...e), getPageParams: (...e) => le.getPageParams(...e), getCurrentRoute: () => le.getCurrentRoute() }, popup: { notification: (...e) => H.notification(...e), success: (...e) => H.success(...e), error: (...e) => H.error(...e), form: (...e) => H.form(...e), modal: (...e) => H.modal(...e), confirm: (...e) => H.confirm(...e) } }; +var tt, Te, we; +const W = class W { + constructor() { + x(this, "exec", (t, n = {}, a = {}, r = "") => new Promise((i, s) => { + const o = Ft(W, tt)._++; + m(W, Te).set(o, a), W.mQueue.set(o, [i, s]), Se.postMessage({ id: o, session: r, category: "eval", method: t, args: n }); + })); + x(this, "clear", (t) => Se.postMessage({ session: t, category: "clear" })); + if (m(W, we)) return m(W, we); + Promise.resolve().then(() => Aa).then((t) => { + It.http = t.http; + }), Se.addEventListener("message", ({ data: { id: t, task_id: n, method: a, args: r, category: i, data: s, error: o, session: l } }) => { + if (i === "eval" && W.mQueue.has(t)) o !== null ? W.mQueue.get(t)[1](o) : W.mQueue.get(t)[0](s), m(W, Te).delete(t), W.mQueue.delete(t); + else if (i === "util") try { + const c = p.get(It, a.split("/")) || p.get(m(W, Te).get(n), a.split("/")); + if (!p.isFunction(c)) throw `${a} not found`; + Promise.resolve(Reflect.apply(c, void 0, r)).then((u) => { + Se.postMessage({ id: t, task_id: n, category: i, method: a, args: r, session: l, data: u, error: null }); + }).catch((u) => { + Se.postMessage({ id: t, task_id: n, category: i, method: a, args: r, session: l, data: null, error: u }); + }); + } catch (c) { + Se.postMessage({ id: t, task_id: n, category: i, method: a, args: r, session: l, data: null, error: c }); + } + }, !1); + } +}; +tt = new WeakMap(), Te = new WeakMap(), we = new WeakMap(), x(W, "mQueue", /* @__PURE__ */ new Map()), E(W, tt, 0), E(W, Te, /* @__PURE__ */ new Map()), E(W, we, null), x(W, "getInstance", () => (m(W, we) || B(W, we, new W()), m(W, we))); +let ht = W; +const Ce = ht.getInstance(), vt = () => { + const e = D(!0), [, t] = C.useReducer((n) => n + 1, 0); + return R(() => () => e.current = !1, []), () => e.current && t(); +}, ur = (e) => { + const t = D(); + return R(() => { + t.current = e; + }, [e]), t.current; +}, gr = (e) => { + const [t, n] = N(e), a = D(null), r = ce((i, s) => { + a.current = s, n(i); + }, []); + return R(() => { + a.current && (a.current(t), a.current = null); + }, [t]), [t, r]; +}, Be = (e = (a) => { +}, t, n = p.isEqual) => { + const a = C.useRef(); + n(t, a.current) || (a.current = p.cloneDeep(t)), C.useEffect(e, [a.current]); +}, xt = Be, ln = (e, t = "string") => { + var n; + if (!Array.isArray(e)) return e; + for (let a = 0; a < e.length; a++) e[a].value = X((n = e[a]) == null ? void 0 : n.value, t), e[a] && Reflect.has(e[a], "children") && (e[a].children = ln(e[a].children, t)); + return e; +}, pr = (e, t = "json", n = "string", a, r = null) => { + const [i] = Q.useForm(a), [s, o] = N([{ label: "无", value: "", disabled: !0 }]), l = D([]), c = Q.useWatch((u) => l.current.length === 0 ? null : p.pick(u, l.current), i) || null; + return R(() => { + Array.isArray(e) ? o(e) : t === "javascript" && e ? Ce.exec(e, {}, { getFieldValue: (u) => (l.current.includes(u) || l.current.push(u), i.getFieldValue(u)), getFieldValueForBasicForm: (u) => (l.current.includes(u) || l.current.push(u), r ? r.getFieldValue(u) : i.getFieldValue(u)) }).then((u) => { + o(X(u, "array")); + }) : e && o(X(e, "array")); + }, [e, t, c]), ln(s, n); +}, mr = (e) => { + const [t, n] = N(), a = { type: "GET" }; + if (typeof e == "string" ? a.url = e : p.isPlainObject(e) && Object.assign(a, e), !(a != null && a.url)) throw "url is required"; + const r = (i) => F.request(a, !1).resp((s) => (console.log("useSubscribeRequest", i), n(s), s)); + return Be(() => { + let i = null; + return r().then((s) => { + i = nn.subscribe(p.throttle(r, 180, { leading: !1, trailing: !0 }), s.res); + }), () => i == null ? void 0 : i(); + }, a), t; +}, pa = (e) => { + const [t, n] = C.useState({ gridItems: [], hideItems: [] }); + return C.useEffect(() => { + e && F.get(`/api/_/${e}`).then(({ pk: a, uuid: r, code: i, resource: s, align: o, cols: l, rowHeight: c, marginX: u, marginY: g, listenChangeFields: h, listenChangeFieldsFunc: y, fields: f }) => ({ pk: a, uuid: r, code: i, resource: s, align: o, cols: l, rowHeight: c, marginX: u, marginY: g, listenChangeFields: h, listenChangeFieldsFunc: y, ...f.reduce((b, w) => { + var $; + return ($ = w == null ? void 0 : w.field) != null && $.hidden ? b.hides.push(w == null ? void 0 : w.field) : b.items.push(w), b; + }, { items: [], hides: [] }) })).then(n); + }, [e]), t; +}, ma = ({ max: e = 0, min: t = 0, type: n = "", message: a, pattern: r, required: i = !1, validator: s } = {}, o, l) => { + const [c, u] = N([]); + return R(() => { + const g = []; + if (i) { + let h = l; + switch (l) { + case "number": + case "string": + case "array": + break; + case "bool": + h = "boolean"; + break; + case "json": + h = "object"; + } + g.push({ type: h, required: !0, whitespace: !0, message: "该项必填" }); + } + switch (n) { + case "string": + g.push({ type: n, max: e, min: t, message: a || (t && e ? `字符必须在 ${t} ~ ${e} 之间` : `${e ? "最多能有" : "最少要有"} ${t || e} 个字符`) }); + break; + case "pattern": + g.push({ type: "string", pattern: r, message: a }); + break; + case "validator": + s && g.push(({ getFieldValue: h }) => ({ validator: async (y, f) => { + const b = await Ce.exec(s, { value: f, fieldName: o }, { getFieldValue: h }); + return p.isString(b) && b ? Promise.reject(b) : p.isBoolean(b) && !b ? Promise.reject(a) : Promise.resolve(); + } })); + } + u(g); + }, [e, t, n, a, r, i, s]), c; +}, ha = (e, t, n) => { + const [a, r] = N(null); + return R(() => { + const { initDataUri: i = `/api/${e}`, initDataMethod: s = "GET" } = n || {}; + t && F.request({ method: s, url: p.trimEnd(`${i}/${t}`, "/") }).then((o) => { + r(o); + }); + }, [e, t, n]), a; +}, fa = (e, t, n, a = {}) => { + const r = vt(), i = D(!0), s = D([]), [o, l] = N(n), c = Q.useWatch((u) => JSON.stringify(p.pick(u, s.current)), t) || "{}"; + return R(() => { + e && Ce.exec(e, a, { getFieldValue: p.wrap(t.getFieldValue, (u, g) => (s.current.some((h) => p.isEqual(h, g)) || (s.current.push(g), r()), u(g))), isFieldTouched: t.isFieldTouched, isFieldsTouched: t.isFieldsTouched }).then((u) => i.current && l(u)); + }, [e, c, t, a]), R(() => () => i.current = !1, []), o; +}, hr = ({ value: e, onChange: t }, n = null) => { + const a = D(), [r] = Q.useForm(n); + return xt(() => { + p.isEqual(a.current, e) || r.setFieldsValue(e); + }, [e]), R(() => () => r.resetFields(), []), [G(() => r.__INTERNAL__ ? r : { ...r, __INTERNAL__: {} }, [r]), (i, s) => { + a.current = s, t(s); + }]; +}, ya = ({ type: e, initialValue: t, initialValueLanguage: n, onChange: a, form: r }) => { + const i = fa(n == "javascript" && t, r, n == "javascript" ? void 0 : t, {}); + return R(() => { + n == "javascript" ? a(X(i, e)) : t && a(X(t, e)); + }, [e, t, i]), null; +}, wa = ({ widget: e = "Input", widgetPrefix: t = "@pkg/ff/grid-layout-forms", widgetDecorator: n, subWidgets: a, basicForm: r, ...i }) => { + const s = e != null && e.startsWith("@") || e != null && e.startsWith("blob:") ? e : `${t}/${e}`, [o, l] = N(); + return R(() => { + s && Z.getWidgetComponent(s).then(({ defaultProps: c = {}, default: u }) => ({ default: cn(u, c, r) })).catch((c) => ({ default: () => `${c}` })).then((c) => l(C.createElement(c.default, i))); + }, [s]), o && C.cloneElement(o, i); +}, cn = (e, t = {}, n = null) => (a) => { + const { type: r, code: i, label: s, noStyle: o, placeholder: l, extras: c, validators: u, help: g, isVirtual: h, $isReserved: y, initialValue: f, initialValueLanguage: b, convertJs: w, convertJsSetting: $, widgetPerfix: I, boxStyle: L, widgetDecorator: M, subWidgets: j, ...A } = { ...t, ...a }, T = ma(u || {}, i, r), v = { label: s, noStyle: o, colon: !1, layout: "vertical" }, S = { placeholder: l, ...A }, U = ce((z) => z == null ? void 0 : X(z, r), [r]); + return d(Ht, { name: i, rules: T, initialValue: U(f), normalize: U, children: (z, K, ue) => { + var _; + return d(e, { type: r, rcform: ue, itemProps: { validateStatus: K.errors.length > 0 ? "error" : "success", tooltip: g, help: K.errors.length > 0 ? K.errors.join("、") : null, required: ((_ = T == null ? void 0 : T[0]) == null ? void 0 : _.required) || !1, ...v }, fieldProps: { ...S, ...z }, $setting: c || {} }); + } }); +}, St = ({ cols: e = 24, rowHeight: t = 16, itemMargin: n = [8, 16], containerPadding: a = [0, 0], fields: r = [], children: i, basicForm: s = null }) => { + const o = sn(r, cn, "@pkg/ff/grid-layout-forms"); + return O("div", { className: "ff-grid-layout-form", style: { "--grid-layout-item-margin-x": `${(n == null ? void 0 : n[0]) ?? 8}px`, "--grid-layout-item-margin-y": `${(n == null ? void 0 : n[1]) ?? 16}px`, "--grid-layout-container-padding-y": `${(a == null ? void 0 : a[0]) || 0}px`, "--grid-layout-container-padding-x": `${(a == null ? void 0 : a[1]) || 0}px`, "--grid-layout-cols": e, "--grid-layout-row-height": `${t}px` }, children: [o, i && C.cloneElement(i, { cols: e, rowHeight: t, itemMargin: n, containerPadding: a, fields: r })] }); +}; +St.propTypes = { fields: k.array }; +const ba = (Mt = St, ({ code: e, layout: t, name: n, primaryKey: a = 0, style: r = {}, formProps: i = {}, form: s, isPreview: o = !1, className: l, onFinish: c, onValuesChange: u = () => { +}, ...g }) => { + const { align: h, autoComplete: y, resource: f, items: b, hides: w, rowHeight: $, marginX: I, marginY: L, cols: M, listenChangeFields: j, listenChangeFieldsFunc: A, pk: T, uuid: v } = pa(e), [S] = Q.useForm(s), U = G(() => [{ name: "__PK__", value: T }, { name: "__PROPS__", value: i }, { name: "__RESOURCE__", value: f }, { name: "__LAYOUT_KEY__", value: e }, { name: "__LAYOUT_UUID__", value: v }, { name: "__PRIMARY_KEY__", value: a }], [T, e, v, f, a, i]); + return O(Q, { className: l, name: n || e, layout: t || h, fields: U, form: S, autoComplete: y, style: { ...r, position: "relative" }, onFinish: c, onValuesChange: (z, K) => (({ changedValues: ue, allValues: _, listenChangeFields: nt, listenChangeFieldsFunc: De, onValuesChange: at, code: Nt }) => { + at(ue, _), De && Array.isArray(nt) && Ce.exec(De, { changedValues: ue, allValues: _ }, { getFieldValue: S.getFieldValue, setFieldValue: S.setFieldValue, setFieldsValue: S.setFieldsValue, isFieldTouched: S.isFieldTouched, isFieldsTouched: S.isFieldsTouched }); + })({ changedValues: z, allValues: K, listenChangeFields: j, listenChangeFieldsFunc: A, onValuesChange: u, code: e }), children: [d(Mt, { ...g, form: S, code: e, fields: b, cols: M, rowHeight: $, itemMargin: [I, L] }), w == null ? void 0 : w.map((z) => { + var K; + return d(Ht, { name: z.code, children: d(ya, { form: S, name: z.code, type: z.type, initialValue: z.initialValue, initialValueLanguage: (K = z.extras) == null ? void 0 : K.initialValueLanguage }) }, JSON.stringify(z.code)); + })] }, e); +}); +var Mt; +const dn = ({ $setting: e, $close: t, extras: n, code: a, primaryKey: r, ...i }) => { + const [s] = Q.useForm(), o = ha(a, r, e); + return R(() => { + o && s.setFieldsValue(o); + }, [o]), d(J, { actions: O(C.Fragment, { children: [d(P, { name: "保存", type: "primary", widget: () => { + const l = s.getFieldValue("__RESOURCE__"), { initDataUri: c = `/api/${a}` } = e || {}; + s.validateFields(!0).then((u) => l ? p.pick(u, [l]) : u).then((u) => F.post(r ? `${c}/${r}` : `${c}`, u).msg(t)).catch(() => H.error("请先完善表单信息", { duration: 2e3 })); + } }), d(P, { name: "取消", widget: () => t(!1) })] }), extras: n, children: d(ba, { form: s, code: a, primaryKey: r, ...i }) }); +}, Ca = (e, t, n, { isReplaceRouteHistory: a = !1 } = {}) => le.redirect(n, t, { replace: a }), ka = (e, t = {}, n, a = {}) => { + var i; + const r = (i = a.router) == null ? void 0 : i.reduce((s, [o, l, c]) => { + const u = p.get(t, ["router", o]); + if (!u && u !== 0 && l) throw `请传入 ${c}`; + return `${s}/${u}`; + }, `/api/${n}`); + return F.del(r, t.param).msg(); +}, zt = (e, t, n, { status: { loading: a, disabled: r }, setStatus: i }) => { + const s = { loading: (o) => o === void 0 ? a : i((l) => ({ ...l, loading: o })), disabled: (o) => o === void 0 ? r : i((l) => ({ ...l, disabled: o })) }; + return p.isFunction(n) ? n.call(null, { ...t, ...s }) : p.isString(n) && n ? Ce.exec(n, t, s) : null; +}, Wt = (e, t, n, a, r) => p.isString(n) && n ? Z.getWidgetComponent(n).then(({ default: i }) => H.modal(i, { ...t, $setting: a }, r != null && r.title ? { ...r, title: p.template(r.title)(e) } : r)).catch((i) => { + H.error(n, { content: i.toString() }); +}) : H.modal(n, { ...t, $setting: a }, r != null && r.title ? { ...r, title: p.template(r.title)(e) } : r), va = (e, t, n, a, r) => H.modal(dn, { ...t, $setting: a, code: n }, r != null && r.title ? { ...r, title: p.template(r.title)(e) } : r), xa = (e, t, n, a, r) => H.modal(kt, { base62params: t, $setting: a, listCode: n }, r != null && r.title ? { ...r, title: p.template(r.title)(e) } : r), Sa = ({ widget: e, widgetType: t, widgetData: n, widgetProps: a, widgetSetting: r, widgetContainerProps: i }, { onAfterClick: s, onBeforeClick: o }) => { + const l = de(ee), [c, u] = N({ leading: !0, trailing: !1 }), g = G(() => { + switch (t) { + case "redirect": + return p.partialRight(Ca, e, r); + case "func": + return p.partialRight(zt, (r == null ? void 0 : r.code) ?? e, { status: c, setStatus: u }); + case "fsdpf-component": + return p.partialRight(Wt, e, r, i); + case "grid-layout-form": + return p.partialRight(va, e, r, i); + case "data-list": + return p.partialRight(xa, e, r, i); + case "destroy": + return p.partialRight(ka, e, r, i); + default: + if (Pt(e) || C.isValidElement(e)) return p.partialRight(Wt, e, r, i); + if (p.isFunction(e)) return p.partialRight(zt, (r == null ? void 0 : r.code) || e, { status: c, setStatus: u }); + } + return (...h) => console.error("useButton unknown widgetType", t, ...h); + }, [e, t]); + return [p.debounce((h) => (o == null || o(h), Promise.resolve(Gt(a, h, { list: l })).then((y) => g(h, { ...n, ...y })).then((y) => s == null ? void 0 : s(y)).catch(console.error)), 300, { leading: !0, trailing: !1 }), c]; +}, Bt = /* @__PURE__ */ new Set(), ft = (e = [], t = 0) => { + const n = e[t]; + if (n.length && !Bt.has(n)) { + const a = document.createElement("script"); + a.setAttribute("src", n), a.setAttribute("data-namespace", n), e.length > t + 1 && (a.onload = () => { + ft(e, t + 1); + }, a.onerror = () => { + ft(e, t + 1); + }), Bt.add(n), document.body.appendChild(a); + } +}, yt = ({ className: e, type: t, style: n = {}, ...a }) => d("span", { role: "img", className: V("ff-iconfont", e), style: n, ...a, children: d("svg", { style: { width: "1em", height: "1em", fill: "currentColor", overflow: "hidden" }, viewBox: "0 0 1024 1024", children: d("use", { xlinkHref: `#${t}` }) }) }); +yt.propTypes = { className: k.string, type: k.string.isRequired, style: k.object }, yt.init = ft; +const Ue = (e) => function({ className: t, children: n, name: a, icon: r, type: i = "default", iconPosition: s = "start", noAuthType: o, onAfterClick: l, onBeforeClick: c, data: u, loading: g, disabled: h, tooltip: y, confirm: f, widget: b, widgetType: w, widgetData: $, widgetProps: I, widgetSetting: L, widgetContainerProps: M, ...j }) { + const A = p.isEmpty(y) || !y.enabled ? {} : y, T = p.isEmpty(f) ? { enabled: !1 } : Object.assign({ enabled: !0 }, f), v = { type: "primary", className: V("ff-button", t), iconPosition: s }; + i === "danger" ? v.danger = !0 : i === "default" && (v.type = i), e === "link" || e === "dashed" ? (v.type = e, i === "default" && (v.className = V(v.className, "ff-default"))) : e !== "circle" && e !== "round" || (v.shape = e), r && (v.icon = d(yt, { type: r })); + const [S, U] = N(!1), [z, { disabled: K, loading: ue }] = Sa({ widget: b, widgetType: w, widgetData: $, widgetProps: I, widgetSetting: L, widgetContainerProps: M }, { onAfterClick: l, onBeforeClick: c }); + return d(Rn, { okText: "确定", cancelText: "取消", ...T, disabled: K || h, open: S, onOpenChange: (_) => { + if (!_) return U(_); + T.enabled ? U(_) : z(u); + }, onConfirm: () => { + z(u); + }, onClick: (_) => { + _.stopPropagation(); + }, children: d(Fn, { ...A, title: S ? null : A == null ? void 0 : A.title, trigger: ["hover", "click"], children: d(lt, { loading: ue || g, disabled: K || h, ...v, ...j, children: n || a }) }) }); +}, P = Ue("default"), $a = Ue("link"), Pa = Ue("circle"), Na = Ue("round"), Ta = Ue("dashed"), Ut = ({ data: e, widget: t, widgetType: n = "fsdpf-component", children: a, widgetData: r, widgetProps: i, widgetSetting: s, widgetContainerProps: o }) => { + const l = de(ee), [c, u] = N(!1), [g, h] = N("hover"), [y, f] = N({}), [b, w] = N(), { placement: $, align: I, arrow: L = { pointAtCenter: !0 }, getPopupContainer: M, ...j } = o || {}; + R(() => { + n == "grid-layout-form" ? w(C.createElement(dn, { ...r, $setting: s, code: t })) : n == "data-list" ? w(C.createElement(kt, { base62params: e, $setting: s, listCode: t })) : p.isString(t) ? Z.getWidgetComponent(t).then(({ default: v }) => { + w(C.createElement(v, { ...r, $setting: s })); + }).catch((v) => w(v.toString())) : Pt(t) ? w(C.createElement(t, { ...r, $setting: s })) : C.isValidElement(t) && w(C.cloneElement(t, { ...r, $setting: s })); + }, [t, n, r]), R(() => { + Promise.resolve(Gt(i, e, { list: l })).then(f); + }, [i, e]); + const A = (v) => { + u(v), !v && h("hover"); + }, T = (v) => { + u(!0), h("click"); + }; + return d(On, { zIndex: 1080, placement: $, onPopupClick: T, onClick: T, open: c, align: I, arrow: L, trigger: g, getPopupContainer: M, content: d(Ea, { ...j, children: b && C.cloneElement(b, { ...y, $close: () => A(!1) }) }), children: a, onOpenChange: A }); +}, Ea = ({ title: e, className: t, children: n, width: a, height: r, ...i }) => { + const [s, o] = N({}), l = ce((g, h) => o((y) => ({ ...y, [g]: h })), []), c = ce((g) => o((h) => ({ ...h, [g]: void 0 })), []), u = e ? C.createElement("div", { className: "ff-popup-title" }, e) : s == null ? void 0 : s.title; + return d(We.Provider, { value: { ele: s, mount: l, unmount: c }, children: O("div", { className: V("ff-popup ff-popover", t), style: { width: a, height: r }, ...i, children: [O("div", { className: "ff-popup-header", children: [u, s == null ? void 0 : s["sub-title"]] }), n, O("div", { className: "ff-popup-footer", children: [s == null ? void 0 : s.extras, s == null ? void 0 : s.actions] })] }) }); +}; +Ut.propTypes = { widgetType: k.oneOf(["fsdpf-component", "grid-layout-form", "data-list"]) }, P.propTypes = { type: k.oneOf(["primary", "default", "danger", ""]), name: k.string, icon: k.string, iconPosition: k.oneOf(["start", "end"]), data: k.any, widget: k.any, widgetType: k.oneOf(["destroy", "redirect", "func", "fsdpf-component", "grid-layout-form", "grid-layout", "data-list"]), widgetData: k.object, widgetProps: k.object, widgetSetting: k.object, widgetContainerProps: k.object, tooltip: k.exact({ title: k.string.isRequired, placement: k.oneOf(["top", "left", "right", "bottom", "topLeft", "topRight", "bottomLeft", "bottomRight", "leftTop", "leftBottom", "rightTop", "rightBottom"]), enabled: k.oneOfType([k.bool, k.number]), getPopupContainer: k.func }), confirm: k.exact({ title: k.string.isRequired, cancelText: k.string, okText: k.string, okType: k.oneOf(["primary", "default", "danger", ""]), placement: k.oneOf(["top", "left", "right", "bottom", "topLeft", "topRight", "bottomLeft", "bottomRight", "leftTop", "leftBottom", "rightTop", "rightBottom"]), enabled: k.oneOfType([k.bool, k.number]), getPopupContainer: k.func, arrow: k.oneOfType([k.bool, k.exact({ pointAtCenter: k.bool })]) }) }, P.Link = $a, P.Link.defaultProps = P.defaultProps, P.Link.propTypes = P.propTypes, P.Circle = Pa, P.Circle.defaultProps = P.defaultProps, P.Circle.propTypes = P.propTypes, P.Round = Na, P.Round.defaultProps = P.defaultProps, P.Round.propTypes = P.propTypes, P.Dashed = Ta, P.Dashed.defaultProps = P.defaultProps, P.Dashed.propTypes = P.propTypes, P.Popover = Ut; +const Ra = ({ fields: e, formProps: t, $close: n }) => { + const [a] = Q.useForm(), r = G(() => [{ name: "__PROPS__", value: t }], [t]); + return d(J, { actions: O(C.Fragment, { children: [d(P, { name: "取消", widget: () => n(!1) }), d(P, { name: "确定", type: "primary", widget: () => a.validateFields(!0).then(n) })] }), children: d(Q, { fields: r, form: a, className: "ff-modal-form", children: e == null ? void 0 : e.map(({ code: i, ...s }) => d(wa, { code: i, ...s }, i)) }) }); +}, Fa = ({ className: e, $close: t, children: n, title: a, subTitle: r, actions: i, extras: s, zIndex: o, ...l }) => O(Un, { ...l, prefixCls: "ff-drawer", className: V("ff-popup", e), maskMotion: { motionAppear: !0, motionName: "mask-motion" }, motion: (c) => ({ motionAppear: !0, motionName: `panel-motion-${c}` }), children: [O("div", { className: "ff-popup-header", children: [d("button", { "aria-label": "Close", className: "ff-popup-close", onClick: l.onClose, children: d(Ct, { type: "close" }) }), a, r] }), d("div", { className: "ff-popup-body", children: n }), O("div", { className: "ff-popup-footer", children: [s, i] })] }), Oa = ({ className: e, $close: t, $event: n, children: a, title: r, subTitle: i, actions: s, extras: o, zIndex: l, placement: c, ...u }) => { + const g = (n == null ? void 0 : n.pageX) === void 0 ? { animation: null, maskAnimation: null, mousePosition: { x: null, y: null } } : { animation: "zoom", maskAnimation: "fade", mousePosition: { x: n == null ? void 0 : n.pageX, y: n == null ? void 0 : n.pageY } }; + return d(Dn, { ...u, ...g, prefixCls: "ff-modal", modalRender: () => O("div", { className: V("ff-modal-content ff-popup", e), children: [O("div", { className: "ff-popup-header", children: [d("button", { "aria-label": "Close", className: "ff-popup-close", onClick: u.onClose, children: d(Ct, { type: "close" }) }), r, i] }), d("div", { className: "ff-popup-body", children: a }), O("div", { className: "ff-popup-footer", children: [o, s] })] }) }); +}, un = ({ placement: e, $close: t, $event: n, children: a, title: r, ...i }) => { + const [s, o] = N({}), [l, c] = N(!0), u = ce((f, b) => o((w) => ({ ...w, [f]: b })), []), g = ce((f) => o((b) => ({ ...b, [f]: void 0 })), []); + let h = { ...i, className: s.rootClassName, title: s.title || r && C.createElement("div", { className: V("ff-popup-title") }, r), subTitle: s["sub-title"], actions: s.actions, extras: s.extras, children: a, $close: t, $event: n, onClose: () => c(!1) }; + const y = () => { + t(!1); + }; + return d(We.Provider, { value: { ele: s, mount: u, unmount: g }, children: e && e !== "center" ? d(Fa, { ...h, placement: e, open: l, afterOpenChange: (f) => !f && y() }) : d(Oa, { ...h, visible: l, afterClose: y }) }); +}; +un.propTypes = { placement: k.oneOf(["center", "left", "top", "right", "bottom"]) }; +const q = () => { + const [e, t] = Wn({ maxCount: 6, motion: { motionName: "ff-notification-fade", motionAppear: !0, motionEnter: !0, motionLeave: !0, onLeaveStart: (i) => { + const { offsetHeight: s } = i; + return { height: s }; + }, onLeaveActive: () => ({ height: 0, opacity: 0, margin: 0 }) }, prefixCls: "ff-notification" }), [, n] = C.useReducer((i) => i + 1, 0); + R(() => { + q.$onClick = a, q.$queue.forEach(([i, s, o], l, c) => { + r([s, o], ...i), delete c[l]; + }); + }, []); + const a = (i, s = {}, o = {}) => new Promise((l, c) => r([l, c], i, s, o)), r = ([i, s], o, l = {}, c = {}) => { + const u = q.$index++, g = (h) => ((y, f) => (q.$popups.delete(y), n(), f == null ? void 0 : f()))(u, () => i(h)); + if (o === _t) return e.open({ ...c, key: u, content: C.createElement(o, { ...l, $close: () => e.close(u) }) }); + q.$popups.set(u, C.createElement(un, { zIndex: u, maskClosable: !1, $event: l == null ? void 0 : l.$event, ...c, key: u, $close: g }, C.isValidElement(o) ? C.cloneElement(o, { ...l, $close: g }) : o != null && o.name || Ot.isForwardRef(o) || (o == null ? void 0 : o.$$typeof) === Ot.ForwardRef ? C.createElement(o, { ...l, $close: g }) : o)), n(); + }; + return O(C.Fragment, { children: [Array.from(q.$popups).map(([i, s]) => s), t] }); +}; +q.$popups = /* @__PURE__ */ new Map(), q.$index = 0, q.$queue = [], q.$onClick = (...e) => new Promise((t, n) => { + q.$queue.push([e, t, n]); +}); +const Dt = (e, t, n = {}) => q.$onClick(e, t, n), st = (e, { showProgress: t, duration: n, ...a } = { duration: 1.5 }) => q.$onClick(_t, { content: e, ...a }, { showProgress: t, duration: n }), H = { modal: Dt, confirm: (e, t = {}) => q.$onClick(qn, { content: e, ...t }, { placement: "center" }), form: (e, t = {}, n = {}) => Dt(Ra, { formProps: n, fields: e }, { placement: "center", ...t }).then((a) => { + if (a === !1) throw !1; + return a; +}), notification: st, success: (e, t = { duration: 1.5 }) => st(e, { ...t, className: "ff-notification-success", icon: "check" }), error: (e, t = { duration: 1.5 }) => st(e, { ...t, className: "ff-notification-error", icon: "close" }) }; +Re.configure({ showSpinner: !1 }), Fe.interceptors.request.use((e) => { + e.headers.Platform = "web", e.headers.SaaS = window.localStorage.getItem("SaaS"); + const t = window.localStorage.getItem(_e); + return e.headers.Authorization = t ? `Bearer ${t} ` : void 0, Re.inc(), e; +}, (e) => (Re.done(), Promise.reject({ code: -1, msg: e }))), Fe.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", ct.onUnhandledRejection), ct.onMsg = (e, t) => H[[0, 1].includes(e) ? "success" : "error"](t).then(() => e === 20300 && le.redirect(Oe.get("Common.WEBSITE_LOGIN_PAGE"))); +const wt = { appUrl: "", init: (e, t, n) => { + wt.appUrl = n, Fe.defaults.baseURL = n, Fe.defaults.timeout = 15e3, Object.assign(wt, new ct(e, t, Fe)); +} }, F = wt; +class $t extends Error { + constructor(t, n) { + super(n), Error.captureStackTrace && Error.captureStackTrace(this, $t), !n instanceof Le && (this.name = `${t} Error Runtime`); + } +} +class Le extends Error { + constructor(t, ...n) { + super(...n), Error.captureStackTrace && Error.captureStackTrace(this, Le), this.name = `${t} Not Found`; + } +} +const ot = "mine", _e = "token"; +var be, Ee; +const ie = class ie { + constructor() { + E(this, Ee, /* @__PURE__ */ new Map()); + x(this, "setVendor", (t, n) => m(this, Ee).set(t, new Jt(n, async (a, r) => { + var s, o; + if (!(a != null && a.default)) throw "@pkg not found"; + let i = () => r; + switch ("function") { + case typeof (i = (s = a.default) == null ? void 0 : s[`./${r}/index.jsx`]): + case typeof (i = (o = a.default) == null ? void 0 : o[`./${r}/index.js`]): + return i(); + } + throw new Le(r); + }))); + x(this, "getWidgetComponent", async (t) => { + if (!t) throw "getWidgetComponent widget is required"; + if (t != null && t.startsWith("blob:") || t != null && t.startsWith("http:") || t != null && t.startsWith("https:")) return await import(t); + const [, n] = t == null ? void 0 : t.split("@pkg/"); + if (!n) throw new Le(t); + try { + return m(this, Ee).has("pkg") ? await m(this, Ee).get("pkg").get(n) : await import(`${F.appUrl}/api/pkg-import/web?name=${t}`); + } catch (a) { + throw new $t(t, a); + } + }); + x(this, "getRoutes", () => F.get("/api/my-router").then((t) => [...t, { uuid: "data-list-setting", isLayout: !0, uri: "/data-list-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/ff-design/components/DataListSetting", extra: { layout: "@pkg/ff-design/frameworks/DesignTheme" } }, { uuid: "grid-layout-setting", isLayout: !0, uri: "/grid-layout-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/ff-design/components/GridLayoutSetting", extra: { layout: "@pkg/ff-design/frameworks/DesignTheme" } }, { uuid: "grid-layout-form-setting", isLayout: !0, uri: "/grid-layout-form-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/ff-design/components/GridLayoutFormSetting", extra: { layout: "@pkg/ff-design/frameworks/DesignTheme" } }, { uuid: "resource-api-setting", isLayout: !0, uri: "/resource-api-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/ff-design/components/ResourceApiSetting", extra: { layout: "@pkg/ff-design/frameworks/DesignTheme" } }, { uuid: "charts-setting", isLayout: !0, uri: "/resource-api-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/ff-design/components/ChartsSetting", extra: { layout: "@pkg/ff-design/frameworks/DesignTheme" } }, { uuid: "fsm-setting", isLayout: !0, uri: "/fsm-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/ff-design/components/FsmSetting", extra: { layout: "@pkg/ff-design/frameworks/DesignTheme" } }, { uuid: "component-setting", isLayout: !0, uri: "/component-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/ff-design/components/ComponentSetting", extra: { layout: "@pkg/ff-design/frameworks/DesignTheme" } }, { uuid: "login", uri: "/login", name: "登录", type: "fsdpf-component", isLogin: !1, component: "@pkg/ff/components/Login" }, { uuid: "not-found", uri: "*", name: "Not Found", type: "fsdpf-component", isLogin: !1, component: "@pkg/ff/components/NotFound" }].map(({ uuid: n, ...a }) => [n, { uuid: n, ...a }])).then((t) => new Map(t))); + x(this, "getMenus", () => F.get("/api/my-menu")); + x(this, "getConfigure", () => F.get("api/init-configure")); + x(this, "getWidgetOperationAuth", () => F.get("/api/init-widget-operation-auth").then((t) => t.reduce((n, { uuid: a, auth: r }) => [...n, [a, r]], []))); + x(this, "getPhoneNumber", (t) => F.get(`/api/user-wx-phone-number/${t}`)); + x(this, "getUserToken", () => { + const t = window.localStorage.getItem(_e); + if (!t) return ""; + const n = t.split("."); + if (!Array.isArray(n) || n.length !== 3) throw "登录令牌无效!"; + const { iat: a } = JSON.parse(window.atob(n[1])); + if (Math.floor((/* @__PURE__ */ new Date()).getTime() / 1e3) - a > 2592e3) throw "登录令牌已过期, 请重新登录!"; + return t; + }); + x(this, "checkUserToken", () => { + try { + return !!this.getUserToken(); + } catch { + return !1; + } + }); + x(this, "getUserInfo", (t = !0) => { + var n; + try { + const a = this.getUserToken(); + if (!a) return Promise.resolve(null); + const { iat: r } = JSON.parse(window.atob((n = a == null ? void 0 : a.split(".")) == null ? void 0 : n[1])), { iat: i, ...s } = F.decode(window.localStorage.getItem(ot) || "", {}); + return i === r ? Promise.resolve(s) : F.get("/api/mine-info").then(({ User: o = null }) => (window.localStorage.setItem(ot, F.encode({ ...o, iat: r })), o)); + } catch (a) { + console.error(a), t && H.error("请登录").then(this.logout); + } + return Promise.resolve(null); + }); + x(this, "login", (t, n, a = {}) => F.post("/api/user-token", { username: t, passwd: Bn.hash(n), platform: "web", ...a }).then(({ token: r }) => (window.localStorage.setItem(_e, r), r))); + x(this, "logout", (t) => (window.localStorage.removeItem(ot), window.localStorage.removeItem(_e), t == null ? void 0 : t())); + if (m(ie, be)) return m(ie, be); + } +}; +be = new WeakMap(), Ee = new WeakMap(), E(ie, be, null), x(ie, "getInstance", () => (m(ie, be) || B(ie, be, new ie()), m(ie, be))); +let bt = ie; +const Z = bt.getInstance(), La = C.createContext({ user: {}, initUser: () => { +}, initUserComplete: !1 }), Va = C.createContext({ set: () => { +}, get: () => { +}, assign: () => { +}, currentRoute: () => { +} }), Pt = (e) => !!(e != null && e.name) && (e.prototype instanceof C.Component || /^[A-Z]/.test(e.name)), ja = (e, t) => { + if (!e || typeof window > "u") return; + let n = document.querySelector(`style[ff-style-token="${t}"]`); + return n ? (n.innerHTML = e, e) : (n = document.createElement("style"), n.setAttribute("ff-style-token", t), n.setAttribute("type", "text/css"), n.innerHTML = e, document.head.appendChild(n), e); +}, Aa = Object.freeze(Object.defineProperty({ __proto__: null, AppContext: La, AppGlobalParamsContext: Va, cache: Jt, configure: Oe, default: Z, func: Ce, http: F, insertStyle: ja, isReactComponent: Pt, route: le }, Symbol.toStringTag, { value: "Module" })), Ia = (e, t, n = "children") => { + if (p.isEmpty(e)) return {}; + const a = p.find(e, ["value", t]); + if (!p.isEmpty(a)) return a; + const r = e.length; + for (let i = 0; i < r; i++) { + const { [n]: s } = e[i], o = Ia(s, t, n); + if (!p.isEmpty(o)) return o; + } + return {}; +}; +export { + Hn as $, + or as A, + lr as B, + gt as C, + Ye as D, + Kn as E, + _n as F, + cr as G, + ra as H, + vt as I, + ur as J, + gr as K, + Be as L, + xt as M, + pr as N, + mr as O, + ba as P, + St as Q, + nn as R, + wa as S, + dn as T, + pa as U, + ma as V, + ha as W, + fa as X, + hr as Y, + yt as Z, + P as _, + rr as a, + Sa as a0, + J as a1, + We as a2, + Kt as a3, + q as a4, + H as a5, + er as a6, + tr as a7, + nr as a8, + Z as a9, + Pt as aa, + ja as ab, + F as ac, + Jt as ad, + Oe as ae, + Ce as af, + le as ag, + La as ah, + Va as ai, + Ia as aj, + ir as b, + sr as c, + Yt as d, + Zt as e, + an as f, + Gt as g, + on as h, + dr as i, + rn as j, + sn as k, + tn as l, + en as m, + na as n, + ta as o, + Zn as p, + kt as q, + it as r, + ee as s, + X as t, + ar as u, + aa as v, + la as w, + Gn as x, + Xn as y, + Jn as z +}; diff --git a/dist/common/main-CAjvwlqH.js b/dist/common/main-CAjvwlqH.js deleted file mode 100644 index 593240e..0000000 --- a/dist/common/main-CAjvwlqH.js +++ /dev/null @@ -1,978 +0,0 @@ -var vn = Object.defineProperty; -var Rt = (e) => { - throw TypeError(e); -}; -var xn = (e, t, n) => t in e ? vn(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n; -var v = (e, t, n) => xn(e, typeof t != "symbol" ? t + "" : t, n), Ft = (e, t, n) => t.has(e) || Rt("Cannot " + n); -var p = (e, t, n) => (Ft(e, t, "read from private field"), n ? n.call(e) : t.get(e)), E = (e, t, n) => t.has(e) ? Rt("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, n), D = (e, t, n, a) => (Ft(e, t, "write to private field"), a ? a.call(e, n) : t.set(e, n), n); -var Ot = (e, t, n, a) => ({ - set _(r) { - D(e, t, r, n); - }, - get _() { - return p(e, t, a); - } -}); -import { jsx as u, jsxs as O } from "react/jsx-runtime"; -import b, { useEffect as R, useState as $, useCallback as ce, useMemo as Z, useRef as q, useContext as Ee, useId as Ge, useLayoutEffect as Sn } from "react"; -import g from "lodash"; -import Ht from "immutability-helper"; -import V from "classnames"; -import { Form as Ke, Input as $n, Button as lt, Breadcrumb as Nn, Tree as Pn, Pagination as Tn, Table as En, Empty as Rn, Popconfirm as Fn, Tooltip as On, Popover as Ln } from "antd"; -import { useMergedState as Vn } from "rc-util"; -import X, { FieldContext as An, Field as Jt } from "rc-field-form"; -import { useParams as jn, generatePath as In, createBrowserRouter as Mn, useInRouterContext as zn, Navigate as Bn } from "react-router-dom"; -import k from "prop-types"; -import * as Lt from "react-is"; -import { useNotification as Wn } from "rc-notification"; -import { N as Re, a as Fe, T as ct, S as Un } from "./vender-DMK1apIA.js"; -import "rc-util/lib/hooks/useMergedState"; -import Dn from "rc-drawer"; -import qn from "rc-dialog"; -var Se, Ve, $e, ie, Ce, ke; -class Kt { - constructor(t, n) { - E(this, Se, /* @__PURE__ */ new Map()); - E(this, Ve, !0); - E(this, $e, []); - E(this, ie); - E(this, Ce, () => p(this, ie)); - E(this, ke, () => Promise.resolve()); - v(this, "get", (...t) => new Promise((n, a) => { - const r = JSON.stringify(t); - if (p(this, Se).has(r)) return n(p(this, ke).call(this, p(this, ie), ...t)); - if (p(this, ie) === void 0) p(this, $e).push([t, n, a]), p(this, Ve) && (D(this, Ve, !1), Promise.resolve(typeof p(this, Ce) == "function" ? p(this, Ce).call(this) : p(this, Ce)).then((s) => D(this, ie, s || null)).finally(() => { - p(this, $e).forEach(([s, i, o]) => { - try { - const l = p(this, ke).call(this, p(this, ie), ...s); - p(this, Se).set(JSON.stringify(s), l), i(l); - } catch (l) { - o(l); - } - }), p(this, $e).length = 0; - })); - else { - const s = p(this, ke).call(this, p(this, ie), ...t); - p(this, Se).set(r, s), n(s); - } - })); - D(this, ke, n), D(this, Ce, t); - } -} -Se = new WeakMap(), Ve = new WeakMap(), $e = new WeakMap(), ie = new WeakMap(), Ce = new WeakMap(), ke = new WeakMap(); -const Za = () => u("div", { children: "Empty" }), Be = b.createContext({ ele: {}, mount: () => { -}, unmount: () => { -} }), _ = ({ rootClassName: e, className: t, children: n, actions: a, title: r, subTitle: s, extras: i, style: o = {} }) => { - const { mount: l, unmount: d } = b.useContext(Be); - return a && _.Action({ children: a }), r && _.Title({ children: r }), s && _.SubTitle({ children: s }), i && _.Extra({ children: i }), R(() => (l("rootClassName", e), () => d(e)), [e]), u("div", { className: V("ff-container", t), style: o, children: n }); -}, Je = (e) => ({ children: t, className: n }) => { - const { mount: a, unmount: r } = b.useContext(Be); - return R(() => (a(e, b.createElement("div", { key: `ff-${e}`, className: V(`ff-popup-${e}`, n) }, t)), () => r(e)), [n, t]), null; -}; -_.Action = Je("actions"), _.Title = Je("title"), _.SubTitle = Je("sub-title"), _.Extra = Je("extras"), _.propTypes = { className: k.string, style: k.object, title: k.any, subTitle: k.any, actions: k.any, extras: k.any }; -const er = () => u(_, { className: "ff-loading", children: O("div", { className: "loader", children: [O("div", { className: "square", children: [u("span", {}), u("span", {}), u("span", {})] }), O("div", { className: "square", children: [u("span", {}), u("span", {}), u("span", {})] }), O("div", { className: "square", children: [u("span", {}), u("span", {}), u("span", {})] }), O("div", { className: "square", children: [u("span", {}), u("span", {}), u("span", {})] })] }) }), tr = () => u("div", { children: "NotFound" }), _t = ({ children: e }) => { - const [t, n] = $({}), a = ce((s, i) => n((o) => ({ ...o, [s]: i })), []), r = ce((s) => n((i) => ({ ...i, [s]: void 0 })), []); - return typeof (e == null ? void 0 : e.type) == "string" ? e : u(Be.Provider, { value: { ele: t, mount: a, unmount: r }, children: b.cloneElement(e, { className: t.rootClassName, title: t.title, subTitle: t["sub-title"], actions: t.actions, extras: t.extras }) }); -}; -_t.propTypes = { children: k.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"] }, Ct = ({ type: e, props: t }) => u("i", { ...t, children: u("svg", { viewBox: "0 0 1024 1024", width: "1em", height: "1em", fill: "currentColor", children: (Vt[e] || Vt.info).map((n, a) => u("path", { d: n }, a)) }) }), Gt = ({ className: e, content: t, icon: n, $close: a }) => O(b.Fragment, { children: [n && u("div", { className: V("ff-notification-icon", e), children: u(Ct, { type: n }) }), t] }), Hn = ({}) => u(_, { children: "Confirm" }); -var de, Ne; -const te = class te { - constructor() { - E(this, Ne, /* @__PURE__ */ new Map()); - v(this, "init", (t) => D(this, Ne, new Map(t))); - v(this, "check", (t) => !p(this, Ne).has(t) || p(this, Ne).get(t)); - if (p(te, de)) return p(te, de); - } -}; -de = new WeakMap(), Ne = new WeakMap(), E(te, de, null), v(te, "getInstance", () => (p(te, de) || D(te, de, new te()), p(te, de))); -let dt = te; -const Jn = dt.getInstance(); -var ue, Ae; -const ne = class ne { - constructor() { - E(this, Ae, null); - v(this, "init", (t) => D(this, Ae, t)); - v(this, "get", (t, n) => g.get(p(this, Ae), t, n)); - if (p(ne, ue)) return p(ne, ue); - } -}; -ue = new WeakMap(), Ae = new WeakMap(), E(ne, ue, null), v(ne, "getInstance", () => (p(ne, ue) || D(ne, ue, new ne()), p(ne, ue))); -let ut = ne; -const Oe = ut.getInstance(), At = { 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" }, Y = (e, t) => { - let n = "string"; - n = Array.isArray(e) ? "array" : typeof e, g.isObject(e) && (n = "json"); - const a = `${n}2${t}`; - return Reflect.has(At, a) ? At[a](e) : e; -}, Yt = (e = {}, t = {}, n = {}, a = "") => Xt(e, (r, s) => s === "type" && r === "code") ? Qt(e, t, n, a) : Zt(e, t, a), Xt = (e, t = () => !1) => g.some(e, (n) => !!g.some(n, t) || (g.isEmpty(n) || !g.isPlainObject(n) && !g.isArray(n) ? void 0 : Xt(n, t))), Qt = async (e = {}, t = {}, n = {}, a = "") => { - let r = /* @__PURE__ */ Object.create(null); - for (let s in e) { - let i; - if (Reflect.has(e[s], "type") && ["code", "field", "router", "query", "string"].includes(e[s].type)) { - const { type: o, value: l = "", default: d = a } = e[s]; - switch (o) { - case "code": - i = await be.exec(l, t, n); - break; - case "field": - i = g.get(t, l) ?? g.get(t, l.substring(l.indexOf(".") + 1)); - break; - case "router": - case "query": - i = le.getPageParams(l); - break; - case "string": - i = l; - } - i ?? (i = d); - } else i = await Qt(e[s], t, n, a); - g.set(r, s, i); - } - return r; -}, Zt = (e = {}, t = {}, n = "") => Object.keys(e || {}).reduce((a, r) => { - if (g.isPlainObject(e[r])) { - let s; - if (Reflect.has(e[r], "type") && ["field", "router", "query", "string"].includes(e[r].type)) { - const { type: i, value: o = "", default: l = n } = e[r]; - switch (i) { - case "field": - s = g.get(t, o) ?? g.get(t, o.substring(o.indexOf(".") + 1)); - break; - case "router": - case "query": - s = le.getPageParams(o); - break; - case "string": - s = o; - } - s ?? (s = l); - } else s = Zt(e[r], t, n); - g.set(a, r, s); - } - return a; -}, {}), st = (e, t) => e && typeof e == "object" ? Array.isArray(e) ? e.map((n) => st(n, t)) : Object.keys(e).reduce((n, a) => (t[a] ? n[t[a]] = st(e[a], t) : n[a] = st(e[a], t), n), {}) : e, nr = () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (e) => { - const t = 16 * Math.random() | 0; - return (e === "x" ? t : 3 & t | 8).toString(16); -}); -var Xe, je, Ie, Qe; -const Ze = class Ze { - constructor(...t) { - E(this, je, []); - E(this, Ie, (t) => { - var n; - for (let a of t) Array.isArray(a[0]) ? p(this, Ie).call(this, a) : p(this, je).push(p(n = Ze, Xe).call(n, a[0], a[1])); - }); - v(this, "toValue", async (t, n = null) => { - const a = { getValue: () => t, getRecord: () => n }; - return await p(this, je).reduce(async (r, s) => { - try { - const i = await r; - return (await s).call(a, i); - } catch (i) { - return console.error(i), r; - } - }, t); - }); - v(this, "toRender", (t, n, a = null) => b.createElement(p(this, Qe), { value: t, record: n }, a)); - E(this, Qe, ({ value: t, record: n, children: a }) => { - const [r, s] = $(a); - return St(() => { - let i = !1; - return s(a), this.toValue(t, n).then((o) => Y(o, "string")).then((o) => !i && s(o)).catch((o) => !i && s(`${o}`)), () => i = !0; - }, [t, n]), r; - }); - p(this, Ie).call(this, t); - } -}; -Xe = new WeakMap(), je = new WeakMap(), Ie = new WeakMap(), Qe = new WeakMap(), E(Ze, Xe, g.memoize((t, n) => Q.getWidgetComponent(t).then((a) => { - var r; - return ((r = a.default) == null ? void 0 : r.call(a, n)) || ((s) => s); -}), (t, n) => `${t}::${Y(n, "string")}`)); -let Ye = Ze; -const Kn = (e, t = {}) => Z(() => e == null ? void 0 : e.map(({ widgetByJs: n, widgetByJsSetting: a, ...r }, s) => n ? { ...r, render: (i, o) => new Ye([n, a]).toRender(i, o, "-") } : r), [e, t]), ar = (e) => { - const [t, n] = $({}); - return R(() => { - let a = !1; - return e && F.get(`/api/_/${e}`).then((r) => g.pick(r, ["uuid", "name", "code", "resource", "marginX", "marginY", "cols", "rowHeight", "primaryKey", "columns", "itemOperations", "batchOperations", "isConditionFormLayout", "layout", "tabs", "pageSize", "layoutConfig"])).then((r) => !a && n(r)), () => a = !0; - }, [e]), t; -}, rr = (e, t = {}) => { - const [n, a] = $({ dataSource: [] }); - return We(() => { - let r = !1; - return e && F.get(`/api/${e}/${F.encode({ page: 1, ...t })}`).then((s) => !r && a(s)), () => r = !0; - }, [e, t]), n; -}, gt = (e, t = null, n = null, a = "id") => Z(() => { - if (g.isEmpty(e) || !e.some(({ uuid: s }) => Jn.check(s))) return !1; - if (g.isEmpty(n) || g.isEmpty(t)) return !0; - const r = t.map((s) => `${s == null ? void 0 : s[a]}`); - return e.some(({ uuid: s }) => !s || !n.has(s) || n.get(s).some((i) => r.includes(`${i}`))); -}, [e, t, n, a]), _n = (e, t, n = "id", a = null) => { - const r = xt(), s = q(!1), i = q(e.dataSource), o = q(e.itemOperationsAccess); - return R(() => (i.current = e.dataSource, o.current = e.itemOperationsAccess, () => s.current = !1), [e.dataSource, e.itemOperationsAccess]), s.current && (e.dataSource = i.current, e.itemOperationsAccess = o.current), [e, (l = 0, d = null) => { - var c, m; - if (s.current = !1, l === 1) return (c = e.onReload) == null ? void 0 : c.call(e); - if (l === 2) { - const h = g.get(d, "__PARENT_ID__", ""), f = g.get(d, n, g.get(d, [a, n], "")), y = g.findIndex(i.current, ["__PARENT_ID__", h]), C = g.findIndex(y > -1 ? g.get(i.current, [y, "children"]) : i.current, [n, f]); - if (C === -1) return (m = e.onReload) == null ? void 0 : m.call(e); - Promise.all([F.get(`/api/${t}/detail/${f}`), F.post(`/api/${t}/list-operations-access`, { ids: f })]).then(([w, x]) => { - const j = g.get(i.current, y > -1 ? [y, "children", C, "children"] : [C, "children"]); - i.current = Ht(i.current, y > -1 ? { [y]: { children: { $splice: [[C, 1, { ...w, children: j }]] } } } : { $splice: [[C, 1, { ...w, children: j }]] }); - const z = new Map(x); - o.current.forEach((I, A) => { - var N; - (N = z.get(A)) != null && N.some((L) => L == f) || o.current.set(A, I.filter((L) => L !== f)); - }), z.forEach((I, A) => { - o.current.has(A) ? o.current.set(A, g.uniq([...o.current.get(A) || [], ...I])) : o.current.set(A, I); - }); - }).then(() => { - s.current = !0, r(); - }); - } - }]; -}, Gn = (e, t) => { - const n = xt(), a = q(t), r = q(/* @__PURE__ */ new Map()), s = q([]), i = g.throttle((l) => { - s.current = [], F.list(e, g.pick({ ...a.current, ...l }, ["tab", "page", "pageSize", "condition", "sider", "keyword"])).then(({ keyword: d, condition: c, total: m, tab: h, sider: f, page: y, pageSize: C, operationsAccess: w, dataSource: x }) => { - a.current = { tab: h, condition: c, sider: f, keyword: d, total: m, pageSize: C, page: x != null && x.length ? y : 1 }, s.current = x, r.current = new Map(w), n(); - }); - }, 380, { leading: !1, trailing: !0 }); - St(() => { - s.current = [], e && i(t); - }, [e, t]); - const o = Z(() => g.pick(a.current, ["total", "tab", "page", "pageSize", "condition", "sider", "keyword"]), [a.current]); - return Object.assign(o, { onTabChange: (l) => i({ tab: l, page: 1 }), onPageChange: (l, d) => i({ page: l, pageSize: d }), onPageSizeChange: (l) => i({ pageSize: l, page: 1 }), onConditionChange: (l, d) => i({ keyword: d, condition: Ht(a.current.condition || {}, { $merge: l || {} }), page: 1 }), onSiderChange: (l) => i({ sider: l, page: 1 }), onKeywordChange: (l) => i({ keyword: l, page: 1 }), itemOperationsAccess: r.current, dataSource: s.current, onReload: i }); -}, Yn = ({ className: e, itemClassName: t, classNames: n = {}, dataSource: a, isPaginate: r, isItemOperations: s, isBatchOperations: i, batchOperations: o, itemOperations: l, itemOperationsAccess: d, resource: c, primaryKey: m, title: h, itemGridLayout: f, $setting: y, tabs: C, isConditionFormLayout: w, isTreeSider: x, treeSiderConfig: j }) => { - const { getBase62params: z, onClickCallback: I } = Ee(we), { total: A, page: N, pageSize: L } = (z == null ? void 0 : z()) || {}, P = ce((W, U, B) => u(Xn, { className: V("ff-data-list-framework-item", t), operations: s && U ? l == null ? void 0 : l.filter((T) => !(m && T.uuid && d.has(T.uuid)) || d.get(T.uuid).includes(U == null ? void 0 : U[m])) : [], data: c ? { [c]: U } : U, children: W, onClickCallback: I }), [c, m, s, I, l, d]); - return O("div", { className: V("ff-data-list-framework", e), children: [u(an, { className: n == null ? void 0 : n.sider, isTreeSider: x, ...j }), O("div", { className: V("ff-data-list-container", n == null ? void 0 : n.container), children: [u(vt, { className: n == null ? void 0 : n.filter, isConditionFormLayout: w }), u(nn, { title: h, className: n == null ? void 0 : n.toolbar, tabs: C }), u(oa, { ...f, className: n == null ? void 0 : n.content, style: { "--col-num": (y == null ? void 0 : y.colNum) || 1 }, primaryKey: m, itemRender: P, dataSource: a }), u(rn, { className: n == null ? void 0 : n.footer, isPaginate: r, isOperations: i, operations: o, total: A, page: N, pageSize: L })] })] }); -}, Xn = ({ className: e, operations: t, children: n, data: a, onClickCallback: r }) => O("div", { className: V("data-list-grid-layout-item-container", e), children: [n, !!(t != null && t.length) && u("div", { className: "data-list-grid-layout-item-actions", children: t.map((s) => u("span", { className: "data-list-grid-layout-item-action", children: u(S.Link, { uuid: s.uuid, type: s.type, name: s.name, widget: s.widget, widgetType: s.widgetType, widgetProps: s.widgetProps, widgetSetting: s.widgetSetting, widgetContainerProps: s.widgetContainerSetting, data: a, confirm: s.confirm, onAfterClick: (i) => i !== !1 && (r == null ? void 0 : r(s.isRefresh, a)) }, s.uuid || Ge()) }, (s == null ? void 0 : s.uuid) || Ge())) })] }), Qn = ({ listCode: e, className: t, classNames: n = {}, itemClassName: a, dataSource: r, columns: s, isItemOperations: i, isBatchOperations: o, batchOperations: l, itemOperations: d, itemOperationsAccess: c, resource: m, primaryKey: h, title: f, tabs: y, isPaginate: C, isTreeSider: w, treeSiderConfig: x, isConditionFormLayout: j, ...z }) => { - const { getBase62params: I, onClickCallback: A } = Ee(we), { total: N, page: L, pageSize: P } = (I == null ? void 0 : I()) || {}, W = gt(d, r, c, h); - return O("div", { className: V("ff-data-table-framework", t), children: [u(an, { className: n == null ? void 0 : n.sider, isTreeSider: w, ...x }), O("div", { className: V("ff-data-table-container", n == null ? void 0 : n.container), children: [u(vt, { listCode: e, isConditionFormLayout: j }), u(nn, { title: f, className: n == null ? void 0 : n.toolbar, tabs: y }), u(na, { ...z, primaryKey: h, className: "ff-data-table-content", columns: s, dataSource: r, operationRender: W ? (U) => u("div", { className: "ff-data-table-actions", children: d == null ? void 0 : d.reduce((B, T, ee) => [...B, u(S.Link, { size: "small", uuid: T.uuid, type: T.type, name: T.name, widget: T.widget, widgetType: T.widgetType, widgetProps: T.widgetProps, widgetData: T.widgetData, widgetSetting: T.widgetSetting, widgetContainerProps: T.widgetContainerSetting, data: U, confirm: T.confirm, onAfterClick: (H) => H !== !1 && (A == null ? void 0 : A(T.isRefresh, U)) }, T.uuid || ee)], []) }) : null }), u(rn, { isPaginate: C, isOperations: o, operations: l, total: N, page: L, pageSize: P })] })] }); -}, we = b.createContext({ listCode: "", getBase62params: (e, t) => { -}, onReload: () => { -}, onClickCallback: () => { -}, onConditionChange: () => { -}, onTabChange: () => { -}, onSiderChange: () => { -}, onKeywordChange: () => { -}, onPageChange: () => { -}, onPageSizeChange: () => { -} }), Zn = ({ isItemGridLayout: e, theme: t, themeProps: n, onClickCallback: a, onReload: r, listCode: s, total: i = 0, page: o = 0, onPageChange: l, pageSize: d = 30, onPageSizeChange: c, tab: m, onTabChange: h, keyword: f, onKeywordChange: y, condition: C, onConditionChange: w, sider: x, onSiderChange: j, ...z }) => { - const [I, A] = $(); - return R(() => { - t ? Q.getWidgetComponent(t).then((N) => { - if (!N) throw `${t} not found`; - return N; - }).catch((N) => ({ default: () => `${N}` })).then((N) => A(b.createElement(N.default, { ...z, $setting: n }))) : A(u(e ? Yn : Qn, { ...z, $setting: n })); - }, [t, n]), u(we.Provider, { value: { listCode: s, onClickCallback: a, onReload: r, getBase62params: (N, L) => { - const P = { tab: m, page: o, pageSize: d, keyword: f, sider: x, condition: C, total: i }; - return N && N != "init" ? P[N] ?? L : P; - }, onPageChange: l, onPageSizeChange: c, onTabChange: h, onSiderChange: j, onKeywordChange: y, onConditionChange: w }, children: I && b.cloneElement(I, z) }); -}; -var ge, oe, ve, et; -const ae = class ae { - constructor() { - E(this, oe, null); - E(this, ve, /* @__PURE__ */ new Map()); - E(this, et, () => { - if (p(this, oe)) return p(this, oe).port.postMessage({ command: "status", data: [] }); - D(this, oe, new SharedWorker(new URL("/ff-worker/res-ws.js", self.location))), p(this, oe).port.onmessage = (t) => { - var n, a; - (n = t.data) != null && n.uuid ? p(this, ve).forEach((r, s) => { - var i; - (r == "*" || (i = r == null ? void 0 : r.includes) != null && i.call(r, t.data.uuid)) && s(t.data); - }) : ((a = t.data) == null ? void 0 : a.readyState) == WebSocket.CLOSED && F.get("/api/user-api-token").then(({ token: r, expire_at: s }) => { - p(this, oe).port.postMessage({ command: "initWs", data: [`ws${g.trimStart(F.appUrl, "http")}api/user-resource-status-ws?token=${r}`] }); - }); - }, p(this, oe).port.postMessage({ command: "status", data: [] }); - }); - v(this, "subscribe", (t, n = []) => (n ? Array.isArray(n) && n.length == 0 ? n = "*" : Array.isArray(n) || (n = [n].flat()) : n = "*", p(this, ve).set(t, n), p(this, ve).size == 1 && p(this, et).call(this), () => this.unsubscribe(t))); - v(this, "unsubscribe", (t) => p(this, ve).delete(t)); - if (p(ae, ge)) return p(ae, ge); - } -}; -ge = new WeakMap(), oe = new WeakMap(), ve = new WeakMap(), et = new WeakMap(), E(ae, ge, null), v(ae, "getInstance", () => (p(ae, ge) || D(ae, ge, new ae()), p(ae, ge))); -let pt = ae; -const en = pt.getInstance(), kt = b.forwardRef(({ listCode: e, base62params: t, className: n, itemClassName: a, theme: r, themeProps: s, classNames: i }, o) => { - const [{ resource: l, primaryKey: d, batchOperations: c = [], itemOperations: m = [], columns: h = [], themeConfig: f, theme: y, isConditionFormLayout: C = !1, isTreeSider: w, treeSiderConfig: x, isItemGridLayout: j, itemGridLayout: z, title: I, isPaginate: A, tabs: N }, L] = $({ isItemGridLayout: !1, itemGridLayout: {} }), P = Gn(e, t), [{ dataSource: W, itemOperationsAccess: U, condition: B, tab: T, keyword: ee, page: H, total: nt, pageSize: De, sider: at, onConditionChange: Tt, onTabChange: mn, onKeywordChange: hn, onPageChange: fn, onPageSizeChange: yn, onSiderChange: wn, onReload: rt }, Et] = _n(P, e, d, l), bn = gt(m, W, U, d), Cn = gt(c); - return R(() => { - let qe = null; - return e && F.get(`/api/_/${e}`).resp(({ data: He, res: kn }) => { - He != null && He.isDynamicRefresh && (qe = en.subscribe(() => rt(), kn)), L(He); - }).catch(() => L({})), () => qe == null ? void 0 : qe(); - }, [e]), b.useImperativeHandle(o, () => ({ onReload: rt, onClickCallback: Et })), u(Zn, { listCode: e, title: I, itemClassName: a, classNames: i, resource: l, primaryKey: d, theme: r || y, themeProps: s || f, isTreeSider: w, treeSiderConfig: x, isPaginate: A, tabs: N, isItemOperations: bn, isBatchOperations: Cn, batchOperations: c, itemOperations: m, isItemGridLayout: j, columns: h, itemGridLayout: z, isConditionFormLayout: C, itemOperationsAccess: U, dataSource: W, onConditionChange: Tt, onTabChange: mn, onKeywordChange: hn, onPageChange: fn, onPageSizeChange: yn, onSiderChange: wn, condition: B, tab: T, keyword: ee, page: H, total: nt, pageSize: De, sider: at, className: V("ff-data-list-helper", n), onReload: rt, onClickCallback: Et }); -}), tn = (e, t, n, a, r = {}, s = 0) => { - const i = { "--grid-layout-h": `${a}`, "--grid-layout-w": `${n}`, "--grid-layout-x": `${e}`, "--grid-layout-y": `${t}`, "--grid-layout-row-height-offset": "0px" }; - return r != null && r.autoHeight ? i.height = "fit-content" : i["--grid-layout-row"] = `${a}`, r != null && r.alignItems && (i["--grid-layout-box-align-items"] = r.alignItems), r != null && r.justifyContent && (i["--grid-layout-box-justify-content"] = r.justifyContent), i["--grid-layout-box-margin"] = jt(r == null ? void 0 : r.marginTop, r == null ? void 0 : r.marginRight, r == null ? void 0 : r.marginBottom, r == null ? void 0 : r.marginLeft), i["--grid-layout-box-padding"] = jt(r == null ? void 0 : r.paddingTop, r == null ? void 0 : r.paddingRight, r == null ? void 0 : r.paddingBottom, r == null ? void 0 : r.paddingLeft), s && (i.height = `${s}px`), i; -}, jt = (e, t, n, a) => `${e || 0}px ${t || 0}px ${n || 0}px ${a || 0}px`, vt = ({ className: e, isConditionFormLayout: t }) => { - var m, h; - const [n, a] = $({}), { listCode: r, onKeywordChange: s, onConditionChange: i, getBase62params: o } = b.useContext(we), { keyword: l, condition: d } = (o == null ? void 0 : o()) || {}, [c] = Ke.useForm(); - return R(() => { - r && t && F.get(`/api/_/${r}/list-condition-form-layout`).then(({ resource: f, marginX: y, marginY: C, rowHeight: w, cols: x, fields: j }) => { - a({ resource: f, itemMargin: [y, C], rowHeight: w, cols: x, fields: j }); - }).catch(() => a({})); - }, [r, t]), R(() => { - c.setFieldsValue({ keyword: l, ...d }); - }, [JSON.stringify([l, d])]), u("div", { className: V("ff-data-list-filter", e), children: u(Ke, { form: c, layout: "vertical", autoComplete: "off", onFinish: ((m = n.fields) == null ? void 0 : m.length) > 1 ? (f) => i({ [n.resource]: f[n.resource] }, f.keyword) : () => { - }, onValuesChange: (f) => { - g.isEmpty(g.omit(f, ["keyword"])) || c.submit(); - }, children: ((h = n.fields) == null ? void 0 : h.length) > 1 ? u($t, { ...n, children: u(ea, { onReset: () => { - const { keyword: f, condition: y } = o("init") || {}; - c.setFieldsValue({ keyword: f, ...y }); - } }) }) : u("div", { className: "ff-data-list-filter-default-form ff-grid-layout-form", children: u("div", { className: "grid-layout-item", style: tn(20, 0, 5, 2), children: u(Ke.Item, { name: ["keyword"], children: u($n.Search, { allowClear: !0, enterButton: "搜索", placeholder: "多关键字 | 分割", onSearch: (f) => s(f) }) }) }) }) }) }); -}, ea = ({ cols: e, fields: t, onReset: n }) => { - const [a, r] = $(!1), s = Z(() => t == null ? void 0 : t.toReversed().some((i) => i.y > 1 || i.x + i.w >= e - 5), [e, t]); - return O(Ke.Item, { label: " ", style: { "--item-span": 5 }, className: V("ff-data-list-filter-actions", { expanded: a }), children: [u(lt, { onClick: n, children: "重置" }), u(lt, { type: "primary", htmlType: "submit", children: "查询" }), s && u(S.Link, { className: "ff-data-list-filter-expanded-button", widget: () => r((i) => !i), type: "primary", name: a ? "关闭" : "展开", icon: a ? "icon-up" : "icon-down", iconPosition: "end" })] }); -}; -vt.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 nn = ({ className: e, title: t, tabs: n }) => { - const { getBase62params: a, onTabChange: r, onReload: s } = Ee(we), { tab: i } = (a == null ? void 0 : a()) || {}, [o, l] = Vn((n == null ? void 0 : n[0].value) ?? (n == null ? void 0 : n[0].code), { value: i, onChange: r }); - return O("div", { className: V("ff-data-list-toolbar", e), children: [u("div", { className: "ff-data-list-title", children: t }), u(Nn, { className: "ff-data-list-tabs", itemRender: ({ label: d, code: c, value: m }) => u("span", { onClick: () => l(m ?? c), className: V("ff-data-list-tab", { active: (m ?? c) == o }), children: d }), items: n }), O("div", { className: "ff-data-list-actions", children: [u(S.Link, { icon: "icon-reload", widget: () => s() }), u(S.Link, { icon: "icon-setting" })] })] }); -}, ta = [{ title: "parent 1", key: "0-0", children: [{ title: "parent 1-0", key: "0-0-0", disabled: !0, children: [{ title: "leaf", key: "0-0-0-0", disableCheckbox: !0 }, { title: "leaf", key: "0-0-0-1" }] }, { title: "parent 1-1", key: "0-0-1", children: [{ title: u("span", { style: { color: "#1677ff" }, children: "sss" }), key: "0-0-1-0" }] }] }], an = ({ className: e, width: t = 280, isTreeSider: n }) => n ? u(Pn.DirectoryTree, { className: V("ff-data-list-sider", e), style: { "--sider-width": t }, showLine: !0, showIcon: !1, treeData: ta }) : null, rn = ({ className: e, operations: t, isOperations: n, isPaginate: a, total: r, page: s, pageSize: i }) => { - const { onPageChange: o, onPageSizeChange: l, onClickCallback: d } = b.useContext(we); - return n && !g.isEmpty(t) || a ? O("div", { className: V("ff-data-list-footer", e), children: [u("div", { className: "ff-data-list-actions", children: t == null ? void 0 : t.map((c, m) => u(S, { 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, onAfterClick: (h) => h !== !1 && (d == null ? void 0 : d(c.isRefresh, null)) }, c.uuid || m)) }), a && u(Tn, { size: "small", total: r, pageSize: i, showSizeChanger: !1, showTotal: (c) => `第 ${s} 页 / 总共 ${c} 条`, onChange: o, onShowSizeChange: l })] }) : null; -}, sn = (e, t, n = !0) => n !== !0 && n-- <= 0 ? [] : g.isArray(e) && !g.isEmpty(e) ? e.reduce((a, r) => (Reflect.has(r, t) && Reflect.has(r, "children") && a.push(r[t]), Reflect.has(r, "children") && !g.isEmpty(r.children) ? a.concat(sn(r.children, t, n)) : a), []) : [], na = ({ className: e, primaryKey: t, columns: n = [], dataSource: a = [], operationRender: r, operationWidth: s = 180, ...i }) => { - Ge(); - const o = q(null), l = q(null), [d, c] = $([]), [m, h] = $({ width: 0, height: 0 }); - R(() => { - c(sn(a, t)); - }, [a, t]), Sn(() => { - const y = new ResizeObserver(() => { - var C; - h({ width: ((C = o.current) == null ? void 0 : C.nativeElement.querySelector(".ant-table-body").scrollWidth) || l.current.offsetWidth, height: l.current.offsetHeight }); - }); - return l.current && y.observe(l.current), () => { - l.current && y.unobserve(l.current); - }; - }, []); - const f = Kn(n); - return u("div", { ref: l, className: V("ff-data-list-table", e), children: m.height ? u(En, { ...i, ref: o, rowKey: (y) => (y == null ? void 0 : y[t]) ?? Math.random(), columns: f == null ? void 0 : f.concat(r ? [{ title: "操作", align: "center", fixed: "right", width: `${Math.ceil(s / m.width * 100).toFixed(2)}%`, render: (y, C, w) => r(C, w) }] : []), dataSource: a, size: "middle", scroll: { x: "max-content", y: m.height - 50 }, pagination: !1, expandable: { defaultExpandAllRows: !0, expandRowByClick: !0, onExpandedRowsChange: c, expandedRowKeys: d } }) : null }); -}, aa = "RC_FORM_INTERNAL_HOOKS", on = (e, { initialValue: t, initialValueLanguage: n, convertJs: a, convertJsSetting: r, type: s = "string" }, i = null) => { - const o = q(!1), l = Ee(An), [d, c] = $(), [m, h] = $(n != "javascript" && e ? l.getFieldValue(e) : void 0), { registerWatch: f } = l.getInternalHooks(aa) || {}; - return R(() => f == null ? void 0 : f((y, C, w) => { - if (!o.current) return; - const x = g.get(C, e); - g.isEqual(x, m) || h(Y(x, s)); - }), [m]), R(() => { - n == "javascript" && t ? be.exec(t, {}, { getFieldValueForBasicForm: (y) => i ? i.getFieldValue(y) : l.getFieldValue(y), getFieldValue: (y) => l.getFieldValue(y) }).then((y) => h(Y(y, s))).catch((y) => notification.error({ message: `布局数据错误: ${JSON.stringify(y)}` })).finally(() => o.current = !0) : (t && h(Y(t ?? l.getFieldValue(e), s)), o.current = !0); - }, [t, n]), We(() => { - o.current && a && new Ye([a, r]).toValue(m, l.getFieldsValue(!0)).then(c).catch((y) => { - c(y), console.error("布局数据转换错误: ", y, a); - }); - }, [m, a, r]), [d ?? m, m]; -}, ln = (e, t, n = "@pkg/ff/grid-layouts", a = null) => Z(() => { - var r; - return (r = g.sortBy(e, ["y", "x"])) == null ? void 0 : r.map(({ i: s, x: i, y: o, w: l, h: d, field: { boxStyle: c, widgetPrefix: m = n, widget: h, ...f } }, y) => u("div", { className: "grid-layout-item", style: tn(i, o, l, d, c, h === "Height" && (f == null ? void 0 : f.initialValue)), children: u(ra, { ...f, basicForm: a, itemWidget: h != null && h.startsWith("@") || h != null && h.startsWith("blob:") ? h : `${m}/${h}`, itemWidgetRender: t }) }, s || y)); -}, [e]), ra = ({ itemWidget: e, itemWidgetRender: t, basicForm: n, ...a }) => { - const [r, s] = $(); - return R(() => { - Q.getWidgetComponent(e).then(({ defaultProps: i = {}, default: o }) => { - s(b.createElement(t(o, i, n), a)); - }).catch((i) => { - console.error(i), s(e); - }); - }, [e]), r; -}, cn = ({ cols: e = 12, rowHeight: t = 21, fields: n = [], data: a, containerPadding: r = [0, 0], itemMargin: s = [4, 0], formProps: i = {}, className: o, ...l }) => { - const [d] = X.useForm(), c = ln(n, sa, "@pkg/ff/grid-layouts"), m = Z(() => [{ name: "__PROPS__", value: i }], [i]); - return We(() => (d.setFieldsValue(a), () => d.resetFields()), [a]), u(X, { fields: m, form: d, component: !1, children: u("div", { ...l, className: V("ff-grid-layout", o), style: { "--grid-layout-item-margin-y": `${(s == null ? void 0 : s[0]) || 0}px`, "--grid-layout-item-margin-x": `${(s == null ? void 0 : s[1]) || 0}px`, "--grid-layout-container-padding-y": `${(r == null ? void 0 : r[0]) || 0}px`, "--grid-layout-container-padding-x": `${(r == null ? void 0 : r[1]) || 0}px`, "--grid-layout-cols": e, "--grid-layout-row-height": `${t}px` }, children: c }) }); -}, sa = (e, t = {}, n = null) => (a) => { - const { code: r, label: s, extras: i, isVirtual: o, initialValue: l, initialValueLanguage: d, convertJs: c, convertJsSetting: m, ...h } = g.merge({}, t, a), [f, y] = on(o ? null : r, { initialValue: l, initialValueLanguage: d, convertJs: c, convertJsSetting: m, type: (h == null ? void 0 : h.type) || "string" }, n); - return u(e, { ...h, value: f, rawValue: y, $setting: i || {} }); -}, sr = (It = cn, function({ code: e, data: t, ...n }) { - const [a, r] = $({ resource: null, cols: 12, rowHeight: 21, fields: [] }); - return R(() => { - e && F.get(`/api/_/${e}`).then((s) => r(g.pick(s, ["resource", "cols", "rowHeight", "fields"]))); - }, [e]), (a == null ? void 0 : a.resource) && u(It, { ...n, rowHeight: a.rowHeight, cols: a.cols, fields: a.fields, data: a != null && a.resource ? { [a == null ? void 0 : a.resource]: t } : {} }); -}); -var It; -const ir = ({ widget: e, widgetPrefix: t = "@pkg/ff/grid-layouts", basicForm: n, ...a }) => { - const r = e != null && e.startsWith("@") || e != null && e.startsWith("blob:") ? e : `${t}/${e}`, [s, i] = $(); - return R(() => { - r && Q.getWidgetComponent(r).then(({ defaultProps: o = {}, default: l }) => ({ default: ia(l, o, n) })).catch((o) => ({ default: () => `${o}` })).then((o) => i(b.createElement(o.default, a))); - }, [r]), s; -}, ia = (e, t = {}, n = null) => (a) => { - const { code: r, label: s, extras: i, isVirtual: o, initialValue: l, initialValueLanguage: d, convertJs: c, convertJsSetting: m, value: h, ...f } = g.merge({}, t, a), [y, C] = on(o ? null : r, { initialValue: l, initialValueLanguage: d, convertJs: c, convertJsSetting: m, type: (f == null ? void 0 : f.type) || "string" }, n); - return u(e, { ...f, value: y, rawValue: C, $setting: i || {} }); -}, oa = ({ cols: e, rowHeight: t, itemMargin: n, fields: a, primaryKey: r, dataSource: s, itemClassName: i, itemRender: o = (m, h, f) => m, empty: l = u(Rn, { description: null }), className: d, style: c = {} }) => { - const m = Ge(), h = Z(() => u(cn, { cols: e, rowHeight: t, itemMargin: n, fields: a, className: i }), [a, e, t, n]); - return u("div", { className: V("ff-data-list-content", d), style: c, children: g.isEmpty(s) ? l : s.map((f, y) => { - const C = o(b.cloneElement(h, { data: f }), f, y); - return b.cloneElement(C, { key: `${m}-${(f == null ? void 0 : f[r]) || y}` }); - }) }); -}, la = ({ component: e }) => { - const { base62params: t } = jn(); - return u(_, { children: u(kt, { listCode: e, base62params: F.decode(t) }) }); -}, ca = () => "Empty", da = ({ component: e, $setting: t }) => { - const [n, a] = $(); - R(() => { - if (!e) return a(u(ca, { description: null })); - Q.getWidgetComponent(e).catch((s) => ({ default: () => `${s}` })).then((s) => b.createElement(s.default, { $setting: t })).then(a); - }, [e]); - const r = le.getPageParams() || {}; - return n ? b.cloneElement(n, r) : null; -}; -var pe, G, me, he, Me, ze; -const re = class re { - constructor() { - E(this, G, /* @__PURE__ */ new Map()); - E(this, me, {}); - E(this, he, null); - v(this, "init", (t, n) => { - D(this, G, t), D(this, me, n); - }); - v(this, "get", (t) => (p(this, G).has(t) || (t = Array.from(p(this, G).keys()).find((n) => p(this, G).get(n).uri === t)), p(this, G).get(t) || {})); - v(this, "redirect", (t, n, a = {}) => { - const { uri: r, type: s, widgetProps: i } = this.get(t) || {}; - let o = In(r || t, s != "list" ? n : g.mapValues(n, (d) => F.encode(d))); - const l = new URLSearchParams(); - for (const d in i || {}) (i == null ? void 0 : i.type) == "query" && l.append(d, n[d]); - return l.size > 0 && (o = `${o}?${l.toString()}`), p(this, he).navigate(o, a); - }); - v(this, "getMenus", (t) => { - var n; - return ((n = p(this, me)) == null ? void 0 : n[t]) || []; - }); - v(this, "findMenuPathByUuid", (t) => { - let n = []; - for (const a in p(this, me)) if (n = p(this, Me).call(this, p(this, me)[a], t, [a]), n.length > 1) return n; - return n; - }); - v(this, "getMenusByRouteUuid", (t) => p(this, ze).call(this, t, Object.values(p(this, me)).flat())); - E(this, Me, (t, n, a = []) => { - if (g.isEmpty(t)) return a; - for (const { uuid: r, children: s } of t) { - if (r == n) return a.concat(r); - if (!g.isEmpty(s)) return a.concat(r, p(this, Me).call(this, s, n)); - } - return a; - }); - E(this, ze, (t, n) => { - var r; - let a = []; - for (const s of n) s.widgetType == "redirect" && (s.uuid == t || s.widget == t ? a.push(s) : (r = s.children) != null && r.length && (a = a.concat(p(this, ze).call(this, t, s.children)))); - return a; - }); - v(this, "getCurrentMenu", () => { - const { uuid: t } = this.getCurrentRoute() || {}; - if (!t) return; - const n = this.getMenusByRouteUuid(t); - return g.isEmpty(n) ? void 0 : n[0]; - }); - v(this, "getCurrentRoute", (t = 0) => { - var a; - const n = (a = p(this, he).state.matches[p(this, he).state.matches.length - 1 - t]) == null ? void 0 : a.route; - if (!n) return null; - for (let [r, s] of p(this, G)) if (s.uri === n.path) return s; - return null; - }); - v(this, "getPageParams", (t) => { - var s, i; - const { location: n = {}, matches: a = [] } = ((s = p(this, he)) == null ? void 0 : s.state) || {}, r = ((i = a[a.length - 1]) == null ? void 0 : i.params) || {}; - return n.search && new URLSearchParams(n.search).forEach((o, l) => { - r[l] = o; - }), t ? g.get(r, t) : r; - }); - v(this, "createBrowserRouter", (t = {}) => { - if (p(this, G).size == 0) return null; - const n = Oe.get("Common.WEBSITE_DEFAULT_THEME", "@pkg/ff/frameworks/DefaultTheme"), a = Oe.get(Q.checkUserToken() ? "Common.WEBSITE_LOGIN_REDIRECT" : "Common.WEBSITE_DEFAULT", "/index"), r = { [n]: 0 }, s = (o, l) => () => Q.getWidgetComponent(o).then((d) => d.default || function() { - return `${o}`; - }).then((d) => ({ Component: () => b.createElement(_t, {}, b.createElement(d, l)) })), i = Array.from(p(this, G).values()).reduce((o, { uuid: l, uri: d, name: c, type: m, component: h, widgetSetting: f, isLogin: y, isLayout: C, extra: w }) => { - let x = {}, j = 0; - switch (m) { - case "list": - x.element = b.createElement(la, { component: h }); - break; - case "fsdpf-component": - x.element = b.createElement(da, { key: h, component: h, $setting: f }); - } - if (w != null && w.layout) { - if (!r[w == null ? void 0 : w.layout]) return r[w == null ? void 0 : w.layout] = o.length, [...o, { path: "/", lazy: s(w == null ? void 0 : w.layout, {}), children: [{ path: d, ...x }] }]; - j = r[w == null ? void 0 : w.layout]; - } - return C && j > -1 ? (o[j].children.push({ path: d, ...x }), o) : [...o, { path: d, ...x }]; - }, [{ path: "/", lazy: s(n, {}), children: [] }]); - return i.push({ index: !0, element: b.createElement(ua, { to: a, replace: !0 }) }), D(this, he, Mn(i, t)); - }); - if (p(re, pe)) return p(re, pe); - } -}; -pe = new WeakMap(), G = new WeakMap(), me = new WeakMap(), he = new WeakMap(), Me = new WeakMap(), ze = new WeakMap(), E(re, pe, null), v(re, "getInstance", () => (p(re, pe) || D(re, pe, new re()), p(re, pe))); -let mt = re; -const ua = ({ to: e, replace: t }) => zn() ? b.createElement(Bn, { to: e, replace: t }) : (window.document.location = e, "redirect"), le = mt.getInstance(), xe = new Worker(new URL("/ff-worker/index.js", self.location)), Mt = { getConfigure: (e) => Oe.get(e), route: { redirect: (...e) => le.redirect(...e), getPageParams: (...e) => le.getPageParams(...e), getCurrentRoute: () => le.getCurrentRoute() }, popup: { notification: (...e) => K.notification(...e), success: (...e) => K.success(...e), error: (...e) => K.error(...e), form: (...e) => K.form(...e), modal: (...e) => K.modal(...e), confirm: (...e) => K.confirm(...e) } }; -var tt, Pe, fe; -const M = class M { - constructor() { - v(this, "exec", (t, n = {}, a = {}, r = "") => new Promise((s, i) => { - const o = Ot(M, tt)._++; - p(M, Pe).set(o, a), M.mQueue.set(o, [s, i]), xe.postMessage({ id: o, session: r, category: "eval", method: t, args: n }); - })); - v(this, "clear", (t) => xe.postMessage({ session: t, category: "clear" })); - if (p(M, fe)) return p(M, fe); - Promise.resolve().then(() => Aa).then((t) => { - Mt.http = t.http; - }), xe.addEventListener("message", ({ data: { id: t, task_id: n, method: a, args: r, category: s, data: i, error: o, session: l } }) => { - if (s === "eval" && M.mQueue.has(t)) o !== null ? M.mQueue.get(t)[1](o) : M.mQueue.get(t)[0](i), p(M, Pe).delete(t), M.mQueue.delete(t); - else if (s === "util") try { - const d = g.get(Mt, a.split("/")) || g.get(p(M, Pe).get(n), a.split("/")); - if (!g.isFunction(d)) throw `${a} not found`; - Promise.resolve(Reflect.apply(d, void 0, r)).then((c) => { - xe.postMessage({ id: t, task_id: n, category: s, method: a, args: r, session: l, data: c, error: null }); - }).catch((c) => { - xe.postMessage({ id: t, task_id: n, category: s, method: a, args: r, session: l, data: null, error: c }); - }); - } catch (d) { - xe.postMessage({ id: t, task_id: n, category: s, method: a, args: r, session: l, data: null, error: d }); - } - }, !1); - } -}; -tt = new WeakMap(), Pe = new WeakMap(), fe = new WeakMap(), v(M, "mQueue", /* @__PURE__ */ new Map()), E(M, tt, 0), E(M, Pe, /* @__PURE__ */ new Map()), E(M, fe, null), v(M, "getInstance", () => (p(M, fe) || D(M, fe, new M()), p(M, fe))); -let ht = M; -const be = ht.getInstance(), xt = () => { - const e = q(!0), [, t] = b.useReducer((n) => n + 1, 0); - return R(() => () => e.current = !1, []), () => e.current && t(); -}, or = (e) => { - const t = q(); - return R(() => { - t.current = e; - }, [e]), t.current; -}, lr = (e) => { - const [t, n] = $(e), a = q(null), r = ce((s, i) => { - a.current = i, n(s); - }, []); - return R(() => { - a.current && (a.current(t), a.current = null); - }, [t]), [t, r]; -}, We = (e = (a) => { -}, t, n = g.isEqual) => { - const a = b.useRef(); - n(t, a.current) || (a.current = g.cloneDeep(t)), b.useEffect(e, [a.current]); -}, St = We, dn = (e, t = "string") => { - var n; - if (!Array.isArray(e)) return e; - for (let a = 0; a < e.length; a++) e[a].value = Y((n = e[a]) == null ? void 0 : n.value, t), e[a] && Reflect.has(e[a], "children") && (e[a].children = dn(e[a].children, t)); - return e; -}, cr = (e, t = "json", n = "string", a, r = null) => { - const [s] = X.useForm(a), [i, o] = $([{ label: "无", value: "", disabled: !0 }]), l = q([]), d = X.useWatch((c) => l.current.length === 0 ? null : g.pick(c, l.current), s) || null; - return R(() => { - Array.isArray(e) ? o(e) : t === "javascript" && e ? be.exec(e, {}, { getFieldValue: (c) => (l.current.includes(c) || l.current.push(c), s.getFieldValue(c)), getFieldValueForBasicForm: (c) => (l.current.includes(c) || l.current.push(c), r ? r.getFieldValue(c) : s.getFieldValue(c)) }).then((c) => { - o(Y(c, "array")); - }) : e && o(Y(e, "array")); - }, [e, t, d]), dn(i, n); -}, dr = (e) => { - const [t, n] = $(), a = { type: "GET" }; - if (typeof e == "string" ? a.url = e : g.isPlainObject(e) && Object.assign(a, e), !(a != null && a.url)) throw "url is required"; - const r = (s) => F.request(a, !1).resp((i) => (console.log("useSubscribeRequest", s), n(i), i)); - return We(() => { - let s = null; - return r().then((i) => { - s = en.subscribe(g.throttle(r, 180, { leading: !1, trailing: !0 }), i.res); - }), () => s == null ? void 0 : s(); - }, a), t; -}, ga = (e) => { - const [t, n] = b.useState({ gridItems: [], hideItems: [] }); - return b.useEffect(() => { - e && F.get(`/api/_/${e}`).then(({ pk: a, uuid: r, code: s, resource: i, align: o, cols: l, rowHeight: d, marginX: c, marginY: m, listenChangeFields: h, listenChangeFieldsFunc: f, fields: y }) => ({ pk: a, uuid: r, code: s, resource: i, align: o, cols: l, rowHeight: d, marginX: c, marginY: m, listenChangeFields: h, listenChangeFieldsFunc: f, ...y.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(n); - }, [e]), t; -}, pa = ({ max: e = 0, min: t = 0, type: n = "", message: a, pattern: r, required: s = !1, validator: i } = {}, o, l) => { - const [d, c] = $([]); - return R(() => { - const m = []; - if (s) { - let h = l; - switch (l) { - case "number": - case "string": - case "array": - break; - case "bool": - h = "boolean"; - break; - case "json": - h = "object"; - } - m.push({ type: h, required: !0, whitespace: !0, message: "该项必填" }); - } - switch (n) { - case "string": - m.push({ type: n, max: e, min: t, message: a || (t && e ? `字符必须在 ${t} ~ ${e} 之间` : `${e ? "最多能有" : "最少要有"} ${t || e} 个字符`) }); - break; - case "pattern": - m.push({ type: "string", pattern: r, message: a }); - break; - case "validator": - i && m.push(({ getFieldValue: h }) => ({ validator: async (f, y) => { - const C = await be.exec(i, { value: y, fieldName: o }, { getFieldValue: h }); - return g.isString(C) && C ? Promise.reject(C) : g.isBoolean(C) && !C ? Promise.reject(a) : Promise.resolve(); - } })); - } - c(m); - }, [e, t, n, a, r, s, i]), d; -}, ma = (e, t, n) => { - const [a, r] = $(null); - return R(() => { - const { initDataUri: s = `/api/${e}`, initDataMethod: i = "GET" } = n || {}; - t && F.request({ method: i, url: g.trimEnd(`${s}/${t}`, "/") }).then((o) => { - r(o); - }); - }, [e, t, n]), a; -}, ha = (e, t, n, a = {}) => { - const r = xt(), s = q(!0), i = q([]), [o, l] = $(n), d = X.useWatch((c) => JSON.stringify(g.pick(c, i.current)), t) || "{}"; - return R(() => { - e && be.exec(e, a, { getFieldValue: g.wrap(t.getFieldValue, (c, m) => (i.current.some((h) => g.isEqual(h, m)) || (i.current.push(m), r()), c(m))), isFieldTouched: t.isFieldTouched, isFieldsTouched: t.isFieldsTouched }).then((c) => s.current && l(c)); - }, [e, d, t, a]), R(() => () => s.current = !1, []), o; -}, ur = ({ value: e, onChange: t }, n = null) => { - const a = q(), [r] = X.useForm(n); - return St(() => { - g.isEqual(a.current, e) || r.setFieldsValue(e); - }, [e]), R(() => () => r.resetFields(), []), [Z(() => r.__INTERNAL__ ? r : { ...r, __INTERNAL__: {} }, [r]), (s, i) => { - a.current = i, t(i); - }]; -}, fa = ({ type: e, initialValue: t, initialValueLanguage: n, onChange: a, form: r }) => { - const s = ha(n == "javascript" && t, r, n == "javascript" ? void 0 : t, {}); - return R(() => { - n == "javascript" ? a(Y(s, e)) : t && a(Y(t, e)); - }, [e, t, s]), null; -}, ya = ({ widget: e = "Input", widgetPrefix: t = "@pkg/ff/grid-layout-forms", widgetDecorator: n, subWidgets: a, basicForm: r, ...s }) => { - const i = e != null && e.startsWith("@") || e != null && e.startsWith("blob:") ? e : `${t}/${e}`, [o, l] = $(); - return R(() => { - i && Q.getWidgetComponent(i).then(({ defaultProps: d = {}, default: c }) => ({ default: un(c, d, r) })).catch((d) => ({ default: () => `${d}` })).then((d) => l(b.createElement(d.default, s))); - }, [i]), o && b.cloneElement(o, s); -}, un = (e, t = {}, n = null) => (a) => { - const { type: r, code: s, label: i, noStyle: o, placeholder: l, extras: d, validators: c, help: m, isVirtual: h, $isReserved: f, initialValue: y, initialValueLanguage: C, convertJs: w, convertJsSetting: x, widgetPerfix: j, boxStyle: z, widgetDecorator: I, subWidgets: A, ...N } = { ...t, ...a }, L = pa(c || {}, s, r), P = { label: i, noStyle: o, colon: !1, layout: "vertical" }, W = { placeholder: l, ...N }, U = ce((B) => B == null ? void 0 : Y(B, r), [r]); - return u(Jt, { name: s, rules: L, initialValue: U(y), normalize: U, children: (B, T, ee) => { - var H; - return u(e, { type: r, rcform: ee, itemProps: { validateStatus: T.errors.length > 0 ? "error" : "success", tooltip: m, help: T.errors.length > 0 ? T.errors.join("、") : null, required: ((H = L == null ? void 0 : L[0]) == null ? void 0 : H.required) || !1, ...P }, fieldProps: { ...W, ...B }, $setting: d || {} }); - } }); -}, $t = ({ cols: e = 24, rowHeight: t = 16, itemMargin: n = [8, 16], containerPadding: a = [0, 0], fields: r = [], children: s, basicForm: i = null }) => { - const o = ln(r, un, "@pkg/ff/grid-layout-forms"); - return O("div", { className: "ff-grid-layout-form", style: { "--grid-layout-item-margin-x": `${(n == null ? void 0 : n[0]) ?? 8}px`, "--grid-layout-item-margin-y": `${(n == null ? void 0 : n[1]) ?? 16}px`, "--grid-layout-container-padding-y": `${(a == null ? void 0 : a[0]) || 0}px`, "--grid-layout-container-padding-x": `${(a == null ? void 0 : a[1]) || 0}px`, "--grid-layout-cols": e, "--grid-layout-row-height": `${t}px` }, children: [o, s && b.cloneElement(s, { cols: e, rowHeight: t, itemMargin: n, containerPadding: a, fields: r })] }); -}; -$t.propTypes = { fields: k.array }; -const wa = (zt = $t, ({ code: e, layout: t, name: n, primaryKey: a = 0, style: r = {}, formProps: s = {}, form: i, isPreview: o = !1, className: l, onFinish: d, onValuesChange: c = () => { -}, ...m }) => { - const { align: h, autoComplete: f, resource: y, items: C, hides: w, rowHeight: x, marginX: j, marginY: z, cols: I, listenChangeFields: A, listenChangeFieldsFunc: N, pk: L, uuid: P } = ga(e), [W] = X.useForm(i), U = Z(() => [{ name: "__PK__", value: L }, { name: "__PROPS__", value: s }, { name: "__RESOURCE__", value: y }, { name: "__LAYOUT_KEY__", value: e }, { name: "__LAYOUT_UUID__", value: P }, { name: "__PRIMARY_KEY__", value: a }], [L, e, P, y, a, s]); - return O(X, { className: l, name: n || e, layout: t || h, fields: U, form: W, autoComplete: f, style: { ...r, position: "relative" }, onFinish: d, onValuesChange: (B, T) => (({ changedValues: ee, allValues: H, listenChangeFields: nt, listenChangeFieldsFunc: De, onValuesChange: at, code: Tt }) => { - at(ee, H), De && Array.isArray(nt) && be.exec(De, { changedValues: ee, allValues: H }, { getFieldValue: W.getFieldValue, setFieldValue: W.setFieldValue, setFieldsValue: W.setFieldsValue, isFieldTouched: W.isFieldTouched, isFieldsTouched: W.isFieldsTouched }); - })({ changedValues: B, allValues: T, listenChangeFields: A, listenChangeFieldsFunc: N, onValuesChange: c, code: e }), children: [u(zt, { ...m, form: W, code: e, fields: C, cols: I, rowHeight: x, itemMargin: [j, z] }), w == null ? void 0 : w.map((B) => { - var T; - return u(Jt, { name: B.code, children: u(fa, { form: W, name: B.code, type: B.type, initialValue: B.initialValue, initialValueLanguage: (T = B.extras) == null ? void 0 : T.initialValueLanguage }) }, JSON.stringify(B.code)); - })] }, e); -}); -var zt; -const gn = ({ $setting: e, $close: t, extras: n, code: a, primaryKey: r, ...s }) => { - const [i] = X.useForm(), o = ma(a, r, e); - return R(() => { - o && i.setFieldsValue(o); - }, [o]), u(_, { actions: O(b.Fragment, { children: [u(S, { name: "保存", type: "primary", widget: () => { - const l = i.getFieldValue("__RESOURCE__"), { initDataUri: d = `/api/${a}` } = e || {}; - i.validateFields(!0).then((c) => l ? g.pick(c, [l]) : c).then((c) => F.post(r ? `${d}/${r}` : `${d}`, c).msg(t)).catch(() => K.error("请先完善表单信息", { duration: 2e3 })); - } }), u(S, { name: "取消", widget: () => t(!1) })] }), extras: n, children: u(wa, { form: i, code: a, primaryKey: r, ...s }) }); -}, ba = (e, t, n, { isReplaceRouteHistory: a = !1 } = {}) => le.redirect(n, t, { replace: a }), Ca = (e, t = {}, n, a = {}) => { - var s; - const r = (s = a.router) == null ? void 0 : s.reduce((i, [o, l, d]) => { - const c = g.get(t, ["router", o]); - if (!c && c !== 0 && l) throw `请传入 ${d}`; - return `${i}/${c}`; - }, `/api/${n}`); - return F.del(r, t.param).msg(); -}, Bt = (e, t, n, { status: { loading: a, disabled: r }, setStatus: s }) => { - const i = { loading: (o) => o === void 0 ? a : s((l) => ({ ...l, loading: o })), disabled: (o) => o === void 0 ? r : s((l) => ({ ...l, disabled: o })) }; - return g.isFunction(n) ? n.call(null, { ...t, ...i }) : g.isString(n) && n ? be.exec(n, t, i) : null; -}, Wt = (e, t, n, a, r) => g.isString(n) && n ? Q.getWidgetComponent(n).then(({ default: s }) => K.modal(s, { ...t, $setting: a }, r != null && r.title ? { ...r, title: g.template(r.title)(e) } : r)).catch((s) => { - K.error(n, { content: s.toString() }); -}) : K.modal(n, { ...t, $setting: a }, r != null && r.title ? { ...r, title: g.template(r.title)(e) } : r), ka = (e, t, n, a, r) => K.modal(gn, { ...t, $setting: a, code: n }, r != null && r.title ? { ...r, title: g.template(r.title)(e) } : r), va = (e, t, n, a, r) => K.modal(kt, { base62params: t, $setting: a, listCode: n }, r != null && r.title ? { ...r, title: g.template(r.title)(e) } : r), xa = ({ widget: e, widgetType: t, widgetData: n, widgetProps: a, widgetSetting: r, widgetContainerProps: s }, { onAfterClick: i, onBeforeClick: o }) => { - const l = Ee(we), [d, c] = $({ leading: !0, trailing: !1 }), m = Z(() => { - switch (t) { - case "redirect": - return g.partialRight(ba, e, r); - case "func": - return g.partialRight(Bt, (r == null ? void 0 : r.code) ?? e, { status: d, setStatus: c }); - case "fsdpf-component": - return g.partialRight(Wt, e, r, s); - case "grid-layout-form": - return g.partialRight(ka, e, r, s); - case "data-list": - return g.partialRight(va, e, r, s); - case "destroy": - return g.partialRight(Ca, e, r, s); - default: - if (Pt(e) || b.isValidElement(e)) return g.partialRight(Wt, e, r, s); - if (g.isFunction(e)) return g.partialRight(Bt, (r == null ? void 0 : r.code) || e, { status: d, setStatus: c }); - } - return (...h) => console.error("useButton unknown widgetType", t, ...h); - }, [e, t]); - return [g.debounce((h) => (o == null || o(h), Promise.resolve(Yt(a, h, { list: l })).then((f) => m(h, { ...n, ...f })).then((f) => i == null ? void 0 : i(f)).catch(console.error)), 300, { leading: !0, trailing: !1 }), d]; -}, Ut = /* @__PURE__ */ new Set(), ft = (e = [], t = 0) => { - const n = e[t]; - if (n.length && !Ut.has(n)) { - const a = document.createElement("script"); - a.setAttribute("src", n), a.setAttribute("data-namespace", n), e.length > t + 1 && (a.onload = () => { - ft(e, t + 1); - }, a.onerror = () => { - ft(e, t + 1); - }), Ut.add(n), document.body.appendChild(a); - } -}, yt = ({ className: e, type: t, style: n = {}, ...a }) => u("span", { role: "img", className: V("ff-iconfont", e), style: n, ...a, children: u("svg", { style: { width: "1em", height: "1em", fill: "currentColor", overflow: "hidden" }, viewBox: "0 0 1024 1024", children: u("use", { xlinkHref: `#${t}` }) }) }); -yt.propTypes = { className: k.string, type: k.string.isRequired, style: k.object }, yt.init = ft; -const Ue = (e) => function({ className: t, children: n, name: a, icon: r, type: s = "default", iconPosition: i = "start", noAuthType: o, onAfterClick: l, onBeforeClick: d, data: c, loading: m, disabled: h, tooltip: f, confirm: y, widget: C, widgetType: w, widgetData: x, widgetProps: j, widgetSetting: z, widgetContainerProps: I, ...A }) { - const N = g.isEmpty(f) || !f.enabled ? {} : f, L = g.isEmpty(y) ? { enabled: !1 } : Object.assign({ enabled: !0 }, y), P = { type: "primary", className: V("ff-button", t), iconPosition: i }; - s === "danger" ? P.danger = !0 : s === "default" && (P.type = s), e === "link" || e === "dashed" ? (P.type = e, s === "default" && (P.className = V(P.className, "ff-default"))) : e !== "circle" && e !== "round" || (P.shape = e), r && (P.icon = u(yt, { type: r })); - const [W, U] = $(!1), [B, { disabled: T, loading: ee }] = xa({ widget: C, widgetType: w, widgetData: x, widgetProps: j, widgetSetting: z, widgetContainerProps: I }, { onAfterClick: l, onBeforeClick: d }); - return u(Fn, { okText: "确定", cancelText: "取消", ...L, disabled: T || h, open: W, onOpenChange: (H) => { - if (!H) return U(H); - L.enabled ? U(H) : B(c); - }, onConfirm: () => { - B(c); - }, onClick: (H) => { - H.stopPropagation(); - }, children: u(On, { ...N, title: W ? null : N == null ? void 0 : N.title, trigger: ["hover", "click"], children: u(lt, { loading: ee || m, disabled: T || h, ...P, ...A, children: n || a }) }) }); -}, S = Ue("default"), Sa = Ue("link"), $a = Ue("circle"), Na = Ue("round"), Pa = Ue("dashed"), Dt = ({ data: e, widget: t, widgetType: n = "fsdpf-component", children: a, widgetData: r, widgetProps: s, widgetSetting: i, widgetContainerProps: o }) => { - const l = Ee(we), [d, c] = $(!1), [m, h] = $("hover"), [f, y] = $({}), [C, w] = $(), { placement: x, align: j, arrow: z = { pointAtCenter: !0 }, getPopupContainer: I, ...A } = o || {}; - R(() => { - n == "grid-layout-form" ? w(b.createElement(gn, { ...r, $setting: i, code: t })) : n == "data-list" ? w(b.createElement(kt, { base62params: e, $setting: i, listCode: t })) : g.isString(t) ? Q.getWidgetComponent(t).then(({ default: P }) => { - w(b.createElement(P, { ...r, $setting: i })); - }).catch((P) => w(P.toString())) : Pt(t) ? w(b.createElement(t, { ...r, $setting: i })) : b.isValidElement(t) && w(b.cloneElement(t, { ...r, $setting: i })); - }, [t, n, r]), R(() => { - Promise.resolve(Yt(s, e, { list: l })).then(y); - }, [s, e]); - const N = (P) => { - c(P), !P && h("hover"); - }, L = (P) => { - c(!0), h("click"); - }; - return u(Ln, { zIndex: 1080, placement: x, onPopupClick: L, onClick: L, open: d, align: j, arrow: z, trigger: m, getPopupContainer: I, content: u(Ta, { ...A, children: C && b.cloneElement(C, { ...f, $close: () => N(!1) }) }), children: a, onOpenChange: N }); -}, Ta = ({ title: e, className: t, children: n, width: a, height: r, ...s }) => { - const [i, o] = $({}), l = ce((m, h) => o((f) => ({ ...f, [m]: h })), []), d = ce((m) => o((h) => ({ ...h, [m]: void 0 })), []), c = e ? b.createElement("div", { className: "ff-popup-title" }, e) : i == null ? void 0 : i.title; - return u(Be.Provider, { value: { ele: i, mount: l, unmount: d }, children: O("div", { className: V("ff-popup ff-popover", t), style: { width: a, height: r }, ...s, children: [O("div", { className: "ff-popup-header", children: [c, i == null ? void 0 : i["sub-title"]] }), n, O("div", { className: "ff-popup-footer", children: [i == null ? void 0 : i.extras, i == null ? void 0 : i.actions] })] }) }); -}; -Dt.propTypes = { widgetType: k.oneOf(["fsdpf-component", "grid-layout-form", "data-list"]) }, S.propTypes = { type: k.oneOf(["primary", "default", "danger", ""]), name: k.string, icon: k.string, iconPosition: k.oneOf(["start", "end"]), data: k.any, widget: k.any, widgetType: k.oneOf(["destroy", "redirect", "func", "fsdpf-component", "grid-layout-form", "grid-layout", "data-list"]), widgetData: k.object, widgetProps: k.object, widgetSetting: k.object, widgetContainerProps: k.object, tooltip: k.exact({ title: k.string.isRequired, placement: k.oneOf(["top", "left", "right", "bottom", "topLeft", "topRight", "bottomLeft", "bottomRight", "leftTop", "leftBottom", "rightTop", "rightBottom"]), enabled: k.oneOfType([k.bool, k.number]), getPopupContainer: k.func }), confirm: k.exact({ title: k.string.isRequired, cancelText: k.string, okText: k.string, okType: k.oneOf(["primary", "default", "danger", ""]), placement: k.oneOf(["top", "left", "right", "bottom", "topLeft", "topRight", "bottomLeft", "bottomRight", "leftTop", "leftBottom", "rightTop", "rightBottom"]), enabled: k.oneOfType([k.bool, k.number]), getPopupContainer: k.func, arrow: k.oneOfType([k.bool, k.exact({ pointAtCenter: k.bool })]) }) }, S.Link = Sa, S.Link.defaultProps = S.defaultProps, S.Link.propTypes = S.propTypes, S.Circle = $a, S.Circle.defaultProps = S.defaultProps, S.Circle.propTypes = S.propTypes, S.Round = Na, S.Round.defaultProps = S.defaultProps, S.Round.propTypes = S.propTypes, S.Dashed = Pa, S.Dashed.defaultProps = S.defaultProps, S.Dashed.propTypes = S.propTypes, S.Popover = Dt; -const Ea = ({ fields: e, formProps: t, $close: n }) => { - const [a] = X.useForm(), r = Z(() => [{ name: "__PROPS__", value: t }], [t]); - return u(_, { actions: O(b.Fragment, { children: [u(S, { name: "取消", widget: () => n(!1) }), u(S, { name: "确定", type: "primary", widget: () => a.validateFields(!0).then(n) })] }), children: u(X, { fields: r, form: a, className: "ff-modal-form", children: e == null ? void 0 : e.map(({ code: s, ...i }) => u(ya, { code: s, ...i }, s)) }) }); -}, Ra = ({ className: e, $close: t, children: n, title: a, subTitle: r, actions: s, extras: i, zIndex: o, ...l }) => O(Dn, { ...l, prefixCls: "ff-drawer", className: V("ff-popup", e), maskMotion: { motionAppear: !0, motionName: "mask-motion" }, motion: (d) => ({ motionAppear: !0, motionName: `panel-motion-${d}` }), children: [O("div", { className: "ff-popup-header", children: [u("button", { "aria-label": "Close", className: "ff-popup-close", onClick: l.onClose, children: u(Ct, { type: "close" }) }), a, r] }), u("div", { className: "ff-popup-body", children: n }), O("div", { className: "ff-popup-footer", children: [i, s] })] }), Fa = ({ className: e, $close: t, $event: n, children: a, title: r, subTitle: s, actions: i, extras: o, zIndex: l, placement: d, ...c }) => { - const m = (n == null ? void 0 : n.pageX) === void 0 ? { animation: null, maskAnimation: null, mousePosition: { x: null, y: null } } : { animation: "zoom", maskAnimation: "fade", mousePosition: { x: n == null ? void 0 : n.pageX, y: n == null ? void 0 : n.pageY } }; - return u(qn, { ...c, ...m, prefixCls: "ff-modal", modalRender: () => O("div", { className: V("ff-modal-content ff-popup", e), children: [O("div", { className: "ff-popup-header", children: [u("button", { "aria-label": "Close", className: "ff-popup-close", onClick: c.onClose, children: u(Ct, { type: "close" }) }), r, s] }), u("div", { className: "ff-popup-body", children: a }), O("div", { className: "ff-popup-footer", children: [o, i] })] }) }); -}, pn = ({ placement: e, $close: t, $event: n, children: a, title: r, ...s }) => { - const [i, o] = $({}), [l, d] = $(!0), c = ce((y, C) => o((w) => ({ ...w, [y]: C })), []), m = ce((y) => o((C) => ({ ...C, [y]: void 0 })), []); - let h = { ...s, className: i.rootClassName, title: i.title || r && b.createElement("div", { className: V("ff-popup-title") }, r), subTitle: i["sub-title"], actions: i.actions, extras: i.extras, children: a, $close: t, $event: n, onClose: () => d(!1) }; - const f = () => { - t(!1); - }; - return u(Be.Provider, { value: { ele: i, mount: c, unmount: m }, children: e && e !== "center" ? u(Ra, { ...h, placement: e, open: l, afterOpenChange: (y) => !y && f() }) : u(Fa, { ...h, visible: l, afterClose: f }) }); -}; -pn.propTypes = { placement: k.oneOf(["center", "left", "top", "right", "bottom"]) }; -const J = () => { - const [e, t] = Wn({ maxCount: 6, motion: { motionName: "ff-notification-fade", motionAppear: !0, motionEnter: !0, motionLeave: !0, onLeaveStart: (s) => { - const { offsetHeight: i } = s; - return { height: i }; - }, onLeaveActive: () => ({ height: 0, opacity: 0, margin: 0 }) }, prefixCls: "ff-notification" }), [, n] = b.useReducer((s) => s + 1, 0); - R(() => { - J.$onClick = a, J.$queue.forEach(([s, i, o], l, d) => { - r([i, o], ...s), delete d[l]; - }); - }, []); - const a = (s, i = {}, o = {}) => new Promise((l, d) => r([l, d], s, i, o)), r = ([s, i], o, l = {}, d = {}) => { - const c = J.$index++, m = (h) => ((f, y) => (J.$popups.delete(f), n(), y == null ? void 0 : y()))(c, () => s(h)); - if (o === Gt) return e.open({ ...d, key: c, content: b.createElement(o, { ...l, $close: () => e.close(c) }) }); - J.$popups.set(c, b.createElement(pn, { zIndex: c, maskClosable: !1, $event: l == null ? void 0 : l.$event, ...d, key: c, $close: m }, b.isValidElement(o) ? b.cloneElement(o, { ...l, $close: m }) : o != null && o.name || Lt.isForwardRef(o) || (o == null ? void 0 : o.$$typeof) === Lt.ForwardRef ? b.createElement(o, { ...l, $close: m }) : o)), n(); - }; - return O(b.Fragment, { children: [Array.from(J.$popups).map(([s, i]) => i), t] }); -}; -J.$popups = /* @__PURE__ */ new Map(), J.$index = 0, J.$queue = [], J.$onClick = (...e) => new Promise((t, n) => { - J.$queue.push([e, t, n]); -}); -const qt = (e, t, n = {}) => J.$onClick(e, t, n), it = (e, { showProgress: t, duration: n, ...a } = { duration: 1.5 }) => J.$onClick(Gt, { content: e, ...a }, { showProgress: t, duration: n }), K = { modal: qt, confirm: (e, t = {}) => J.$onClick(Hn, { content: e, ...t }, { placement: "center" }), form: (e, t = {}, n = {}) => qt(Ea, { formProps: n, fields: e }, { placement: "center", ...t }).then((a) => { - if (a === !1) throw !1; - return a; -}), notification: it, success: (e, t = { duration: 1.5 }) => it(e, { ...t, className: "ff-notification-success", icon: "check" }), error: (e, t = { duration: 1.5 }) => it(e, { ...t, className: "ff-notification-error", icon: "close" }) }; -Re.configure({ showSpinner: !1 }), Fe.interceptors.request.use((e) => { - e.headers.Platform = "web", e.headers.SaaS = window.localStorage.getItem("SaaS"); - const t = window.localStorage.getItem(_e); - return e.headers.Authorization = t ? `Bearer ${t} ` : void 0, Re.inc(), e; -}, (e) => (Re.done(), Promise.reject({ code: -1, msg: e }))), Fe.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", ct.onUnhandledRejection), ct.onMsg = (e, t) => K[[0, 1].includes(e) ? "success" : "error"](t).then(() => e === 20300 && le.redirect(Oe.get("Common.WEBSITE_LOGIN_PAGE"))); -const wt = { appUrl: "", init: (e, t, n) => { - wt.appUrl = n, Fe.defaults.baseURL = n, Fe.defaults.timeout = 15e3, Object.assign(wt, new ct(e, t, Fe)); -} }, F = wt; -class Nt extends Error { - constructor(t, n) { - super(n), Error.captureStackTrace && Error.captureStackTrace(this, Nt), !n instanceof Le && (this.name = `${t} Error Runtime`); - } -} -class Le extends Error { - constructor(t, ...n) { - super(...n), Error.captureStackTrace && Error.captureStackTrace(this, Le), this.name = `${t} Not Found`; - } -} -const ot = "mine", _e = "token"; -var ye, Te; -const se = class se { - constructor() { - E(this, Te, /* @__PURE__ */ new Map()); - v(this, "setVendor", (t, n) => p(this, Te).set(t, new Kt(n, async (a, r) => { - var i, o; - if (!(a != null && a.default)) throw "@pkg not found"; - let s = () => r; - switch ("function") { - case typeof (s = (i = a.default) == null ? void 0 : i[`./${r}/index.jsx`]): - case typeof (s = (o = a.default) == null ? void 0 : o[`./${r}/index.js`]): - return s(); - } - throw new Le(r); - }))); - v(this, "getWidgetComponent", async (t) => { - if (!t) throw "getWidgetComponent widget is required"; - if (t != null && t.startsWith("blob:") || t != null && t.startsWith("http:") || t != null && t.startsWith("https:")) return await import(t); - const [, n] = t == null ? void 0 : t.split("@pkg/"); - if (!n) throw new Le(t); - try { - return p(this, Te).has("pkg") ? await p(this, Te).get("pkg").get(n) : await import(`${F.appUrl}/api/pkg-import/web?name=${t}`); - } catch (a) { - throw new Nt(t, a); - } - }); - v(this, "getRoutes", () => F.get("/api/my-router").then((t) => [...t, { uuid: "data-list-setting", isLayout: !0, uri: "/data-list-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/ff-design/components/DataListSetting", extra: { layout: "@pkg/ff-design/frameworks/DesignTheme" } }, { uuid: "grid-layout-setting", isLayout: !0, uri: "/grid-layout-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/ff-design/components/GridLayoutSetting", extra: { layout: "@pkg/ff-design/frameworks/DesignTheme" } }, { uuid: "grid-layout-form-setting", isLayout: !0, uri: "/grid-layout-form-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/ff-design/components/GridLayoutFormSetting", extra: { layout: "@pkg/ff-design/frameworks/DesignTheme" } }, { uuid: "resource-api-setting", isLayout: !0, uri: "/resource-api-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/ff-design/components/ResourceApiSetting", extra: { layout: "@pkg/ff-design/frameworks/DesignTheme" } }, { uuid: "charts-setting", isLayout: !0, uri: "/resource-api-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/ff-design/components/ChartsSetting", extra: { layout: "@pkg/ff-design/frameworks/DesignTheme" } }, { uuid: "fsm-setting", isLayout: !0, uri: "/fsm-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/ff-design/components/FsmSetting", extra: { layout: "@pkg/ff-design/frameworks/DesignTheme" } }, { uuid: "component-setting", isLayout: !0, uri: "/component-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/ff-design/components/ComponentSetting", extra: { layout: "@pkg/ff-design/frameworks/DesignTheme" } }, { uuid: "login", uri: "/login", name: "登录", type: "fsdpf-component", isLogin: !1, component: "@pkg/ff/components/Login" }, { uuid: "not-found", uri: "*", name: "Not Found", type: "fsdpf-component", isLogin: !1, component: "@pkg/ff/components/NotFound" }].map(({ uuid: n, ...a }) => [n, { uuid: n, ...a }])).then((t) => new Map(t))); - v(this, "getMenus", () => F.get("/api/my-menu")); - v(this, "getConfigure", () => F.get("api/init-configure")); - v(this, "getWidgetOperationAuth", () => F.get("/api/init-widget-operation-auth").then((t) => t.reduce((n, { uuid: a, auth: r }) => [...n, [a, r]], []))); - v(this, "getPhoneNumber", (t) => F.get(`/api/user-wx-phone-number/${t}`)); - v(this, "getUserToken", () => { - const t = window.localStorage.getItem(_e); - if (!t) return ""; - const n = t.split("."); - if (!Array.isArray(n) || n.length !== 3) throw "登录令牌无效!"; - const { iat: a } = JSON.parse(window.atob(n[1])); - if (Math.floor((/* @__PURE__ */ new Date()).getTime() / 1e3) - a > 2592e3) throw "登录令牌已过期, 请重新登录!"; - return t; - }); - v(this, "checkUserToken", () => { - try { - return !!this.getUserToken(); - } catch { - return !1; - } - }); - v(this, "getUserInfo", (t = !0) => { - var n; - try { - const a = this.getUserToken(); - if (!a) return Promise.resolve(null); - const { iat: r } = JSON.parse(window.atob((n = a == null ? void 0 : a.split(".")) == null ? void 0 : n[1])), { iat: s, ...i } = F.decode(window.localStorage.getItem(ot) || "", {}); - return s === r ? Promise.resolve(i) : F.get("/api/mine-info").then(({ User: o = null }) => (window.localStorage.setItem(ot, F.encode({ ...o, iat: r })), o)); - } catch (a) { - console.error(a), t && K.error("请登录").then(this.logout); - } - return Promise.resolve(null); - }); - v(this, "login", (t, n, a = {}) => F.post("/api/user-token", { username: t, passwd: Un.hash(n), platform: "web", ...a }).then(({ token: r }) => (window.localStorage.setItem(_e, r), r))); - v(this, "logout", (t) => (window.localStorage.removeItem(ot), window.localStorage.removeItem(_e), t == null ? void 0 : t())); - if (p(se, ye)) return p(se, ye); - } -}; -ye = new WeakMap(), Te = new WeakMap(), E(se, ye, null), v(se, "getInstance", () => (p(se, ye) || D(se, ye, new se()), p(se, ye))); -let bt = se; -const Q = bt.getInstance(), Oa = b.createContext({ user: {}, initUser: () => { -}, initUserComplete: !1 }), La = b.createContext({ set: () => { -}, get: () => { -}, assign: () => { -}, currentRoute: () => { -} }), Pt = (e) => !!(e != null && e.name) && (e.prototype instanceof b.Component || /^[A-Z]/.test(e.name)), Va = (e, t) => { - if (!e || typeof window > "u") return; - let n = document.querySelector(`style[ff-style-token="${t}"]`); - return n ? (n.innerHTML = e, e) : (n = document.createElement("style"), n.setAttribute("ff-style-token", t), n.setAttribute("type", "text/css"), n.innerHTML = e, document.head.appendChild(n), e); -}, Aa = Object.freeze(Object.defineProperty({ __proto__: null, AppContext: Oa, AppGlobalParamsContext: La, cache: Kt, configure: Oe, default: Q, func: be, http: F, insertStyle: Va, isReactComponent: Pt, route: le }, Symbol.toStringTag, { value: "Module" })), ja = (e, t, n = "children") => { - if (g.isEmpty(e)) return {}; - const a = g.find(e, ["value", t]); - if (!g.isEmpty(a)) return a; - const r = e.length; - for (let s = 0; s < r; s++) { - const { [n]: i } = e[s], o = ja(i, t, n); - if (!g.isEmpty(o)) return o; - } - return {}; -}; -export { - Be as $, - _n as A, - Gn as B, - xt as C, - Ye as D, - or as E, - lr as F, - sr as G, - aa as H, - We as I, - St as J, - cr as K, - dr as L, - wa as M, - $t as N, - ya as O, - gn as P, - ga as Q, - en as R, - pa as S, - ma as T, - ha as U, - ur as V, - yt as W, - S as X, - Jn as Y, - xa as Z, - _, - tn as a, - _t as a0, - J as a1, - K as a2, - Za as a3, - er as a4, - tr as a5, - Q as a6, - Pt as a7, - Va as a8, - F as a9, - Kt as aa, - Oe as ab, - be as ac, - le as ad, - Oa as ae, - La as af, - ja as ag, - sn as b, - cn as c, - Xt as d, - ir as e, - on as f, - Yt as g, - ln as h, - Zn as i, - vt as j, - nn as k, - an as l, - rn as m, - kt as n, - we as o, - na as p, - oa as q, - st as r, - Yn as s, - Y as t, - nr as u, - Qn as v, - Kn as w, - ar as x, - rr as y, - gt as z -}; diff --git a/dist/components.js b/dist/components.js index 23486a1..b32e851 100644 --- a/dist/components.js +++ b/dist/components.js @@ -1,4 +1,4 @@ -import { a3 as s, W as p, a4 as n, a5 as t, a2 as d } from "./common/main-CAjvwlqH.js"; +import { a6 as s, Z as p, a7 as n, a8 as t, a5 as d } from "./common/main-B5hgccZL.js"; export { s as Empty, p as Icon, diff --git a/dist/container.js b/dist/container.js index 6d69996..4d103ec 100644 --- a/dist/container.js +++ b/dist/container.js @@ -1,4 +1,4 @@ -import { $ as o, a3 as s, a4 as p, a5 as t, a0 as d, a2 as n, a1 as r, _ as u } from "./common/main-CAjvwlqH.js"; +import { a2 as o, a6 as s, a7 as p, a8 as t, a3 as d, a5 as n, a4 as r, a1 as u } from "./common/main-B5hgccZL.js"; export { o as Context, s as Empty, diff --git a/dist/data-converter.js b/dist/data-converter.js index 244942c..5c6ae8a 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-CAjvwlqH.js"; +import { D as p } from "./common/main-B5hgccZL.js"; export { p as default }; diff --git a/dist/data-list.js b/dist/data-list.js index da2d557..a0b88b9 100644 --- a/dist/data-list.js +++ b/dist/data-list.js @@ -1,4 +1,4 @@ -import { q as t, o as e, j as r, m as o, s as i, n as l, l as u, p as D, k as L, v as n, i as m, w as p, B as C, y as b, z as k, A as F, x as c } from "./common/main-CAjvwlqH.js"; +import { w as t, s as e, m as r, p as o, x as i, q as l, o as u, v as D, n as L, y as n, l as m, z as p, F as C, B as F, C as b, E as c, A as d } from "./common/main-B5hgccZL.js"; export { t as DataListContent, e as DataListContext, @@ -13,8 +13,8 @@ export { m as default, p as useColumnsRender, C as useDataListHelper, - b as useDataSource, - k as useHasOperationColumn, - F as useOperationCallback, - c as useStructure + F as useDataSource, + b as useHasOperationColumn, + c as useOperationCallback, + d as useStructure }; diff --git a/dist/data-list/utils.js b/dist/data-list/utils.js index 11b549a..a4804d0 100644 --- a/dist/data-list/utils.js +++ b/dist/data-list/utils.js @@ -1,5 +1,5 @@ import "lodash"; -import { b as a } from "../common/main-CAjvwlqH.js"; +import { f as a } from "../common/main-B5hgccZL.js"; export { a as getDefaultExpandRowKeys }; diff --git a/dist/grid-layout-form.js b/dist/grid-layout-form.js index 77b2b5d..46534bc 100644 --- a/dist/grid-layout-form.js +++ b/dist/grid-layout-form.js @@ -1,4 +1,4 @@ -import { N as s, P as r, O as u, M as o, U as t, T as d, V as m, S as F, Q as i } from "./common/main-CAjvwlqH.js"; +import { Q as s, T as r, S as u, P as o, X as t, W as d, Y as m, V as F, U as i } from "./common/main-B5hgccZL.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 2ab98e5..3509b5d 100644 --- a/dist/grid-layout-form/utils.js +++ b/dist/grid-layout-form/utils.js @@ -1,5 +1,5 @@ import "lodash"; -import { ag as a } from "../common/main-CAjvwlqH.js"; +import { aj as a } from "../common/main-B5hgccZL.js"; export { a as getOptionItemByValue }; diff --git a/dist/grid-layout.js b/dist/grid-layout.js index 4b1fa5b..ca538d6 100644 --- a/dist/grid-layout.js +++ b/dist/grid-layout.js @@ -1,7 +1,7 @@ -import { c as e, e as d, H as i, G as t, f as u, h as o } from "./common/main-CAjvwlqH.js"; +import { h as d, i as e, H as i, G as t, j as u, k as o } from "./common/main-B5hgccZL.js"; export { - e as GridLayout, - d as GridLayoutWidget, + d as GridLayout, + e as GridLayoutWidget, i as HOOK_MARK, t as default, u as useField, diff --git a/dist/grid-layout/utils.js b/dist/grid-layout/utils.js index ece5c12..c977c3b 100644 --- a/dist/grid-layout/utils.js +++ b/dist/grid-layout/utils.js @@ -1,4 +1,4 @@ -import { a as t } from "../common/main-CAjvwlqH.js"; +import { e as t } from "../common/main-B5hgccZL.js"; export { t as getBoxStyle }; diff --git a/dist/hooks.js b/dist/hooks.js index 6005777..7b045aa 100644 --- a/dist/hooks.js +++ b/dist/hooks.js @@ -1,12 +1,12 @@ import "lodash"; import "rc-field-form"; import "react"; -import { J as r, I as o, K as p, E as f, F as i, L as m, C as c } from "./common/main-CAjvwlqH.js"; -import { default as E } from "rc-util/lib/hooks/useMergedState"; +import { M as r, L as o, N as p, J as f, K as i, O as m, I as c } from "./common/main-B5hgccZL.js"; +import { default as b } from "rc-util/lib/hooks/useMergedState"; export { r as useDeepEffect, o as useDeepEqualEffect, - E as useMergedState, + b as useMergedState, p as useOptions, f as usePrevious, i as useStateWithCallback, diff --git a/dist/iconfont.js b/dist/iconfont.js index 1a0489b..9398fef 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 { W as a } from "./common/main-CAjvwlqH.js"; +import { Z as a } from "./common/main-B5hgccZL.js"; export { a as default }; diff --git a/dist/index.js b/dist/index.js index 3387d65..26cef7d 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1,4 +1,4 @@ -import { ae as t, af as e, aa as o, ab as n, a6 as p, ac as c, a9 as r, a8 as f, a7 as l, ad as u } from "./common/main-CAjvwlqH.js"; +import { ah as t, ai as e, ad as o, ae as n, a9 as p, af as c, ac as r, ab as f, aa as i, ag as l } from "./common/main-B5hgccZL.js"; export { t as AppContext, e as AppGlobalParamsContext, @@ -8,6 +8,6 @@ export { c as func, r as http, f as insertStyle, - l as isReactComponent, - u as route + i as isReactComponent, + l as route }; diff --git a/dist/res-ws.js b/dist/res-ws.js index d7babec..d6f2958 100644 --- a/dist/res-ws.js +++ b/dist/res-ws.js @@ -1,5 +1,5 @@ import "lodash"; -import { R as a } from "./common/main-CAjvwlqH.js"; +import { R as a } from "./common/main-B5hgccZL.js"; export { a as default }; diff --git a/dist/style.css b/dist/style.css index 1260e4f..d9e6920 100644 --- a/dist/style.css +++ b/dist/style.css @@ -1 +1 @@ -#nprogress{pointer-events:none}#nprogress .bar{background:#29d;position:fixed;z-index:1031;top:0;left:0;width:100%;height:2px}#nprogress .peg{display:block;position:absolute;right:0;width:100px;height:100%;box-shadow:0 0 10px #29d,0 0 5px #29d;opacity:1;-webkit-transform:rotate(3deg) translate(0px,-4px);-ms-transform:rotate(3deg) translate(0px,-4px);transform:rotate(3deg) translateY(-4px)}#nprogress .spinner{display:block;position:fixed;z-index:1031;top:15px;right:15px}#nprogress .spinner-icon{width:18px;height:18px;box-sizing:border-box;border:solid 2px transparent;border-top-color:#29d;border-left-color:#29d;border-radius:50%;-webkit-animation:nprogress-spinner .4s linear infinite;animation:nprogress-spinner .4s linear infinite}.nprogress-custom-parent{overflow:hidden;position:relative}.nprogress-custom-parent #nprogress .spinner,.nprogress-custom-parent #nprogress .bar{position:absolute}@-webkit-keyframes nprogress-spinner{0%{-webkit-transform:rotate(0deg)}to{-webkit-transform:rotate(360deg)}}@keyframes nprogress-spinner{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.react-grid-layout .react-grid-item{box-sizing:border-box!important}.monaco-editor .parameter-hints-widget{border:0px}.monaco-editor .parameter-hints-widget .signature{padding:0}.monaco-editor .suggest-widget,.monaco-editor.vs-dark .suggest-widget{border:0px}.monaco-editor .rename-box{top:0}.ant-divider:has(+.ant-form .ant-divider:first-child){display:none}:root{--padding-lg: 24px;--padding-md: 16px;--padding-sm: 12px;--padding-xs: 8px;--padding-xss: 4px;--margin-lg: 24px;--margin-md: 16px;--margin-sm: 12px;--margin-xs: 8px;--margin-xss: 4px;--border-color: #f2f2f2;--bg-color: rgba(0, 0, 0, .02)}#root{height:100vh;background-color:#f0f2f5}*::-webkit-scrollbar-thumb{background:#aaa;border-radius:5px}*::-webkit-scrollbar-thumb:hover{background:#999}*::-webkit-scrollbar-track{background-color:#ddd}*::-webkit-scrollbar-corner{background-color:#ddd}*::-webkit-scrollbar{width:5px;height:5px}.ff-container{height:100%}.ff-loading{height:100vh;width:100%;background-color:#f0f2f5;display:flex;justify-content:center;align-items:center}.ff-loading .loader{-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);width:128px;height:80px}.ff-loading .loader .square{position:relative}.ff-loading .loader .square:nth-child(1){margin-left:0}.ff-loading .loader .square:nth-child(1) span{-webkit-animation:animsquare1 2s infinite ease-in;animation:animsquare1 2s infinite ease-in}.ff-loading .loader .square:nth-child(2){margin-left:44px}.ff-loading .loader .square:nth-child(2) span{-webkit-animation:animsquare2 2s infinite ease-in;animation:animsquare2 2s infinite ease-in}.ff-loading .loader .square:nth-child(3){margin-left:88px}.ff-loading .loader .square:nth-child(3) span{-webkit-animation:animsquare3 2s infinite ease-in;animation:animsquare3 2s infinite ease-in}.ff-loading .loader .square:nth-child(4){margin-left:132px}.ff-loading .loader .square:nth-child(4) span{-webkit-animation:animsquare4 2s infinite ease-in;animation:animsquare4 2s infinite ease-in}.ff-loading .loader .square span{position:absolute;top:0;left:20px;height:36px;width:36px;border-radius:2px;background-color:#fff}.ff-loading .loader .square span:nth-child(1){top:0;-webkit-animation-delay:0s;animation-delay:0s}.ff-loading .loader .square span:nth-child(2){top:44px;-webkit-animation-delay:.15s;animation-delay:.15s}.ff-loading .loader .square span:nth-child(3){top:88px;-webkit-animation-delay:.3s;animation-delay:.3s}@media (max-width: 550px){.ff-loading .loader{-webkit-transform:scale(.75);transform:scale(.75)}}@media (max-width: 440px){.ff-loading .loader{-webkit-transform:scale(.5);transform:scale(.5)}}@keyframes animsquare4{0%,5%,95%,to{-webkit-transform:translate(0px,0px) rotate(0deg);transform:translate(0) rotate(0)}30%,70%{-webkit-transform:translate(40px,0px) rotate(90deg);transform:translate(40px) rotate(90deg)}}@keyframes animsquare3{0%,10%,90%,to{-webkit-transform:translate(0px,0px) rotate(0deg);transform:translate(0) rotate(0)}35%,65%{-webkit-transform:translate(40px,0px) rotate(90deg);transform:translate(40px) rotate(90deg)}}@keyframes animsquare2{0%,15%,85%,to{-webkit-transform:translate(0px,0px) rotate(0deg);transform:translate(0) rotate(0)}40%,60%{-webkit-transform:translate(40px,0px) rotate(90deg);transform:translate(40px) rotate(90deg)}}@keyframes animsquare1{0%,20%,80%,to{-webkit-transform:translate(0px,0px) rotate(0deg);transform:translate(0) rotate(0)}45%,55%{-webkit-transform:translate(40px,0px) rotate(90deg);transform:translate(40px) rotate(90deg)}}.ff-notification{position:fixed;z-index:2000;display:flex;max-height:100vh;padding:20px;align-items:flex-end;width:380px;overflow-x:hidden;overflow-y:clip;height:100vh;box-sizing:content-box;pointer-events:none;flex-direction:column;gap:24px}.ff-notification-top,.ff-notification-topLeft,.ff-notification-topRight{top:0}.ff-notification-bottom,.ff-notification-bottomRight,.ff-notification-bottomLeft{bottom:0}.ff-notification-bottomRight,.ff-notification-topRight{right:0}.ff-notification-notice{position:relative;display:block;box-sizing:border-box;line-height:1.5;width:100%}.ff-notification-notice-wrapper{z-index:2000;pointer-events:auto;position:relative;display:block;box-sizing:border-box;border-radius:8px;box-shadow:0 6px 16px #00000014,0 3px 6px -4px #0000001f,0 9px 28px 8px #0000000d;width:calc(100% - 40px);background-color:#fff;right:0}.ff-notification-notice-content{padding:14px 18px;display:flex;gap:8px;white-space:pre-wrap}.ff-notification-notice-content .ff-notification-icon.ff-notification-error{--bg-color: #ff4d4f}.ff-notification-notice-content .ff-notification-icon.ff-notification-success{--bg-color: #52c41a}.ff-notification-notice-content .ff-notification-icon.ff-notification-info{--bg-color: #1677ff}.ff-notification-notice-content .ff-notification-icon>*:first-child{width:24px;height:24px;display:inline-flex;align-items:center;justify-content:center;border-radius:50%;color:#fff;background-color:var(--bg-color)}.ff-notification-notice-progress{position:absolute;left:3px;right:3px;border-radius:1px;overflow:hidden;-moz-appearance:none;appearance:none;-webkit-appearance:none;display:block;inline-size:100%;block-size:2px;border:0}.ff-notification-notice-progress,.ff-notification-notice-progress::-webkit-progress-bar{background-color:#0000000a}.ff-notification-notice-progress::-moz-progress-bar{background-color:#31afff}.ff-notification-notice-progress::-webkit-progress-value{background-color:#31afff}.ff-notification-fade{overflow:hidden;transition:all .3s}.ff-notification-fade-appear-prepare{pointer-events:none;opacity:0!important}.ff-notification-fade-appear-start{transform:translate(100%);opacity:0}.ff-notification-fade-appear-active{transform:translate(0);opacity:1}.ff-data-list-framework{height:100%;--sider-width: 280px;--col-num: 1;--gap: 8px;display:flex;gap:var(--gap)}.ff-data-list-framework .ff-data-list-container{width:100%;height:100%;row-gap:var(--gap);display:flex;flex-direction:column}.ff-data-list-framework .ff-data-list-container .ff-data-list-content{flex:1;overflow-y:auto;display:grid;gap:var(--gap);padding:calc(var(--gap) / 2);grid-template-columns:repeat(var(--col-num),1fr);grid-auto-rows:min-content}.ff-data-list-framework .ff-data-list-container .ff-data-list-content .ff-data-list-framework-item{display:flex;flex-direction:column;justify-content:space-between;row-gap:8px;border-radius:4px;background-color:#fff;box-shadow:0 0 8px #00000014}.ff-data-list-framework .ff-data-list-container .ff-data-list-content .ff-data-list-framework-item .ff-grid-layout{padding:8px}.ff-data-list-framework .ff-data-list-container .ff-data-list-content .ff-data-list-framework-item .data-list-grid-layout-item-actions{margin-top:8px;display:flex;justify-content:space-between;border-top:1px solid #f0f0f0}.ff-data-list-framework .ff-data-list-container .ff-data-list-content .ff-data-list-framework-item .data-list-grid-layout-item-actions .data-list-grid-layout-item-action{text-align:center;margin:2px 0;flex:1}.ff-data-list-framework .ff-data-list-container .ff-data-list-content .ff-data-list-framework-item .data-list-grid-layout-item-actions .data-list-grid-layout-item-action:not(:last-child){border-right:1px solid #f0f0f0}.ff-data-table-framework{height:100%;--sider-width: 280px;--col-num: 1;--gap: 8px;display:flex;gap:var(--gap)}.ff-data-table-framework .ff-data-table-container{width:100%;height:100%;display:flex;flex-direction:column;row-gap:var(--gap)}.ff-data-list-item-operations{max-width:180px;display:flex;flex-wrap:wrap;gap:var(--margin-xss, 4px)}.ff-data-list-item-operations>.ant-btn:not(.ant-btn-circle){flex-grow:1}.ff-data-list-helper{height:100%}.ff-data-list-filter:has(.ff-data-list-filter-actions:not(.expanded)){height:60px;overflow-y:hidden}.ff-data-list-filter .ff-data-list-filter-default-form.ff-grid-layout-form{--grid-layout-cols: 25;--grid-layout-item-margin-x: 8px;--grid-layout-item-margin-y: 16px}.ff-data-list-filter .ff-data-list-filter-actions{grid-column:span var(--itemp-span, 5) / calc(var(--grid-layout-cols, 25) + 1)}.ff-data-list-filter .ff-data-list-filter-actions:not(.expanded){grid-row:1}.ff-data-list-filter .ff-data-list-filter-actions .ff-data-list-filter-expanded-button{margin-left:8px}.ff-data-list-filter .ff-data-list-filter-actions .ant-form-item-control-input-content{display:flex;justify-content:flex-end;align-items:center;gap:8px}.ff-data-list-toolbar{gap:8px;display:flex;justify-content:space-between;align-items:center}.ff-data-list-toolbar .ff-data-list-title{color:#000000e0;font-weight:600;font-size:14px}.ff-data-list-toolbar .ff-data-list-actions{display:flex;justify-content:center;gap:8px}.ff-data-list-toolbar .ff-data-list-tabs{cursor:pointer}.ff-data-list-toolbar .ff-data-list-tabs .ff-data-list-tab{color:#00000073}.ff-data-list-toolbar .ff-data-list-tabs .ff-data-list-tab:hover{font-weight:600}.ff-data-list-toolbar .ff-data-list-tabs .ff-data-list-tab.active{color:#1677ff;font-weight:600}.ff-data-list-sider{width:var(--sider-width, 280px);overflow-y:auto;box-shadow:8px 0 4px -8px #0000000d}.ff-data-list-sider+.ff-data-list-container{width:calc(100% - var(--sider-width, 280px))}.ff-data-list-footer{padding-block-start:8px;display:flex;justify-content:space-between}.ff-data-list-footer .ff-data-list-actions{display:flex;justify-content:center;gap:8px}.ff-data-list-table{height:100%;overflow-y:hidden}.ff-data-list-table .ant-table *{scrollbar-width:auto;scrollbar-color:auto}.ff-grid-layout{--grid-layout-h: 1;--grid-layout-row: none;--grid-layout-row-height: 18px;--grid-layout-row-height-offset: 0px;--grid-layout-cols: 12;display:grid;grid-template-columns:repeat(var(--grid-layout-cols),1fr);grid-auto-rows:minmax(min-content,max-content);padding:var(--grid-layout-container-padding-y, 0) var(--grid-layout-container-padding-x, 0);padding-bottom:calc(var(--grid-layout-container-padding-y, 0) + var(--grid-layout-item-margin-y));column-gap:var(--grid-layout-item-margin-x);row-gap:var(--grid-layout-item-margin-y)}.ff-grid-layout .grid-layout-item{grid-row:span var(--grid-layout-h, 1);grid-column:calc(var(--grid-layout-x, 1) + 1)/calc(var(--grid-layout-x, 1) + var(--grid-layout-w, 1) + 1);height:calc(var(--grid-layout-row-height) * var(--grid-layout-h) + var(--grid-layout-row-height-offset));padding:var(--grid-layout-box-paddin);margin:var(--grid-layout-box-margin);display:var(--grid-layout-box-display, flex);align-items:var(--grid-layout-box-align-items, center);justify-content:var(--grid-layout-box-justify-content, normal)}.ff-grid-layout-form{--grid-layout-h: 1;--grid-layout-row: none;--grid-layout-row-height: 18px;--grid-layout-row-height-offset: 0px;--grid-layout-cols: 12;display:grid;grid-template-columns:repeat(var(--grid-layout-cols),1fr);grid-auto-rows:minmax(min-content,max-content);padding:var(--grid-layout-container-padding-y, 0) var(--grid-layout-container-padding-x, 0);padding-bottom:calc(var(--grid-layout-container-padding-y, 0) + var(--grid-layout-item-margin-y, 16px));column-gap:var(--grid-layout-item-margin-x, 8px);row-gap:var(--grid-layout-item-margin-y, 16px)}.ff-grid-layout-form .grid-layout-item{grid-row:span var(--grid-layout-h, 1);grid-column:calc(var(--grid-layout-x, 1) + 1)/calc(var(--grid-layout-x, 1) + var(--grid-layout-w, 1) + 1);height:calc(var(--grid-layout-row-height) * var(--grid-layout-h) + var(--grid-layout-row-height-offset));padding:var(--grid-layout-box-padding-y, 0) var(--grid-layout-box-padding-x, 0);margin:var(--grid-layout-box-margin)}.ff-iconfont{transform:scale(1.14);vertical-align:-.125em;display:inline-flex;align-items:center;justify-content:center}.ff-iconfont:not(:last-child){margin-right:8px}.ff-button.ant-btn-link,.ff-button.ant-btn-text{width:initial;padding:0;height:auto}.ff-default.ant-btn-link{color:#000000e0}.ant-btn-link.ant-btn:not(:disabled):focus-visible{outline:initial;outline-offset:initial;transition:initial}.ff-popover .ff-popup-header{margin-bottom:calc(var(--margin-sm) / 2)}.ff-popover .ff-popup-header:empty{display:none}.ff-popover .ff-popup-footer{display:flex;justify-content:space-between;margin-top:var(--margin-sm)}.ff-popover .ff-popup-footer:empty{display:none}.ff-modal-form{display:flex;flex-direction:column;gap:var(--modal-form-gap, 8px)}.mask-motion-enter-active,.mask-motion-appear-active,.mask-motion-leave-active{transition:all .3s}.mask-motion-enter,.mask-motion-appear{opacity:0}.mask-motion-enter-active,.mask-motion-appear-active,.mask-motion-leave{opacity:1}.mask-motion-leave-active{opacity:0}.panel-motion-left-enter-start,.panel-motion-left-appear-start,.panel-motion-left-leave-start{transition:none!important}.panel-motion-left-enter-active,.panel-motion-left-appear-active,.panel-motion-left-leave-active{transition:all .3s}.panel-motion-left-enter,.panel-motion-left-appear{transform:translate(-100%)}.panel-motion-left-enter-active,.panel-motion-left-appear-active,.panel-motion-left-leave{transform:translate(0)}.panel-motion-left-leave-active{transform:translate(-100%)!important}.panel-motion-right-enter-start,.panel-motion-right-appear-start,.panel-motion-right-leave-start{transition:none!important}.panel-motion-right-enter-active,.panel-motion-right-appear-active,.panel-motion-right-leave-active{transition:all .3s}.panel-motion-right-enter,.panel-motion-right-appear{transform:translate(100%)}.panel-motion-right-enter-active,.panel-motion-right-appear-active,.panel-motion-right-leave{transform:translate(0)}.panel-motion-right-leave-active{transform:translate(100%)!important}.panel-motion-top-enter-start,.panel-motion-top-appear-start,.panel-motion-top-leave-start{transition:none!important}.panel-motion-top-enter-active,.panel-motion-top-appear-active,.panel-motion-top-leave-active{transition:all .3s}.panel-motion-top-enter,.panel-motion-top-appear{transform:translateY(-100%)}.panel-motion-top-enter-active,.panel-motion-top-appear-active,.panel-motion-top-leave{transform:translateY(0)}.panel-motion-top-leave-active{transform:translateY(-100%)!important}.panel-motion-bottom-enter-start,.panel-motion-bottom-appear-start,.panel-motion-bottom-leave-start{transition:none!important}.panel-motion-bottom-enter-active,.panel-motion-bottom-appear-active,.panel-motion-bottom-leave-active{transition:all .3s}.panel-motion-bottom-enter,.panel-motion-bottom-appear{transform:translateY(100%)}.panel-motion-bottom-enter-active,.panel-motion-bottom-appear-active,.panel-motion-bottom-leave{transform:translateY(0)}.panel-motion-bottom-leave-active{transform:translateY(100%)!important}.ff-drawer-mask{top:0;right:0;bottom:0;left:0;position:absolute;z-index:1050;pointer-events:auto;background-color:var(--popup-mask-bg-color, rgba(0, 0, 0, .45))}.ff-drawer{top:0;right:0;bottom:0;left:0;position:fixed;z-index:1050;pointer-events:none}.ff-drawer .ff-popup-close{top:14px;right:0}.ff-drawer-inline{position:absolute}.ff-drawer-left .ff-drawer-content-wrapper{inset:0 auto 0 0;box-shadow:6px 0 16px #00000014,3px 0 6px -4px #0000001f,9px 0 28px 8px #0000000d}.ff-drawer-right .ff-drawer-content-wrapper{inset:0 0 0 auto;box-shadow:-6px 0 16px #00000014,-3px 0 6px -4px #0000001f,-9px 0 28px 8px #0000000d}.ff-drawer-top .ff-drawer-content-wrapper{top:0;box-shadow:0 6px 16px #00000014,0 3px 6px -4px #0000001f,0 9px 28px 8px #0000000d}.ff-drawer-bottom .ff-drawer-content-wrapper{bottom:0;box-shadow:0 -6px 16px #00000014,0 -3px 6px -4px #0000001f,0 -9px 28px 8px #0000000d}.ff-drawer-top .ff-drawer-content-wrapper,.ff-drawer-bottom .ff-drawer-content-wrapper{inset-inline:0}.ff-drawer-content{width:100%;height:100%;overflow:auto;background-color:var(--popup-bg-color, #fff);pointer-events:auto}.ff-drawer .ff-popup-header{padding:16px 8px;border-bottom:1px solid rgba(5,5,5,.06)}.ff-drawer .ff-popup-footer{border-top:1px solid rgba(5,5,5,.06);padding:12px 8px}.ff-drawer .ff-popup-body{padding:8px}.ff-drawer-content-wrapper{position:absolute;z-index:1050;overflow:hidden;transition:transform .3s;max-width:100vw}.ff-drawer-content-wrapper-hidden{display:none}.ff-modal-mask{position:fixed;top:0;right:0;left:0;bottom:0;pointer-events:auto;background-color:var(--popup-mask-bg-color, rgba(0, 0, 0, .45));height:100%;filter:alpha(opacity=50);z-index:1050}.ff-modal-mask-hidden{display:none}.ff-modal-fade-enter,.ff-modal-fade-appear{opacity:0;animation-duration:.3s;animation-fill-mode:both;animation-timing-function:cubic-bezier(.55,0,.55,.2);animation-play-state:paused}.ff-modal-fade-leave{animation-duration:.3s;animation-fill-mode:both;animation-timing-function:cubic-bezier(.55,0,.55,.2);animation-play-state:paused}.ff-modal-fade-enter.ff-modal-fade-enter-active,.ff-modal-fade-appear.ff-modal-fade-appear-active{animation-name:rcDialogFadeIn;animation-play-state:running}.ff-modal-fade-leave.ff-modal-fade-leave-active{animation-name:rcDialogFadeOut;animation-play-state:running}@keyframes rcDialogFadeIn{0%{opacity:0}to{opacity:1}}@keyframes rcDialogFadeOut{0%{opacity:1}to{opacity:0}}.ff-modal{position:relative;top:100px;width:min-content;margin:0 auto}.ff-modal .ff-popup-close{top:14px;right:8px}.ff-modal .ff-popup-header:has(.ff-popup-title),.ff-modal .ff-popup-header:has(.ff-popup-sub-title){margin-bottom:8px}.ff-modal .ff-popup-footer:not(:empty){margin-top:12px}.ff-modal-wrap{position:fixed;overflow:auto;top:0;right:0;bottom:0;left:0;z-index:1050;-webkit-overflow-scrolling:touch;outline:0}.ff-modal-title{margin:0;font-size:14px;line-height:21px;font-weight:700}.ff-modal-content{position:relative;background-color:var(--popup-bg-color, #fff);border-radius:8px;background-clip:padding-box;max-height:calc(100vh - 150px);min-width:max(35vw,600px);box-shadow:0 6px 16px #00000014,0 3px 6px -4px #0000001f,0 9px 28px 8px #0000000d;padding:20px 24px}.ff-modal-zoom-enter,.ff-modal-zoom-appear{opacity:0;animation-duration:.3s;animation-fill-mode:both;animation-timing-function:cubic-bezier(.08,.82,.17,1);animation-play-state:paused}.ff-modal-zoom-leave{animation-duration:.3s;animation-fill-mode:both;animation-timing-function:cubic-bezier(.6,.04,.98,.34);animation-play-state:paused}.ff-modal-zoom-enter.ff-modal-zoom-enter-active,.ff-modal-zoom-appear.ff-modal-zoom-appear-active{animation-name:rcDialogZoomIn;animation-play-state:running}.ff-modal-zoom-leave.ff-modal-zoom-leave-active{animation-name:rcDialogZoomOut;animation-play-state:running}@keyframes rcDialogZoomIn{0%{opacity:0;transform:scale(0)}to{opacity:1;transform:scale(1)}}@keyframes rcDialogZoomOut{0%{transform:scale(1)}to{opacity:0;transform:scale(0)}}.ff-popup-close{cursor:pointer;border:0;background:transparent;font-size:24px;position:absolute;line-height:1;color:#000;opacity:.5}.ff-popup-close:disabled{pointer-events:none}.ff-popup-close:hover{opacity:.65}.ff-popup{display:flex;flex-direction:column}.ff-popup-title,.ff-popup-sub-title{display:inline}.ff-popup-title{font-size:18px;font-weight:600}.ff-popup-footer{display:flex;gap:8px;justify-content:flex-end}.ff-popup-footer:empty{display:none}.ff-popup-extras,.ff-popup-actions{display:flex;align-items:center;gap:8px}.ff-popup-extras{flex:1}.ff-popup-body{flex:1;overflow-y:auto} +#nprogress{pointer-events:none}#nprogress .bar{background:#29d;position:fixed;z-index:1031;top:0;left:0;width:100%;height:2px}#nprogress .peg{display:block;position:absolute;right:0;width:100px;height:100%;box-shadow:0 0 10px #29d,0 0 5px #29d;opacity:1;-webkit-transform:rotate(3deg) translate(0px,-4px);-ms-transform:rotate(3deg) translate(0px,-4px);transform:rotate(3deg) translateY(-4px)}#nprogress .spinner{display:block;position:fixed;z-index:1031;top:15px;right:15px}#nprogress .spinner-icon{width:18px;height:18px;box-sizing:border-box;border:solid 2px transparent;border-top-color:#29d;border-left-color:#29d;border-radius:50%;-webkit-animation:nprogress-spinner .4s linear infinite;animation:nprogress-spinner .4s linear infinite}.nprogress-custom-parent{overflow:hidden;position:relative}.nprogress-custom-parent #nprogress .spinner,.nprogress-custom-parent #nprogress .bar{position:absolute}@-webkit-keyframes nprogress-spinner{0%{-webkit-transform:rotate(0deg)}to{-webkit-transform:rotate(360deg)}}@keyframes nprogress-spinner{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.react-grid-layout .react-grid-item{box-sizing:border-box!important}.monaco-editor .parameter-hints-widget{border:0px}.monaco-editor .parameter-hints-widget .signature{padding:0}.monaco-editor .suggest-widget,.monaco-editor.vs-dark .suggest-widget{border:0px}.monaco-editor .rename-box{top:0}.ant-divider:has(+.ant-form .ant-divider:first-child){display:none}:root{--padding-lg: 24px;--padding-md: 16px;--padding-sm: 12px;--padding-xs: 8px;--padding-xss: 4px;--margin-lg: 24px;--margin-md: 16px;--margin-sm: 12px;--margin-xs: 8px;--margin-xss: 4px;--border-color: #f2f2f2;--bg-color: rgba(0, 0, 0, .02)}#root{height:100vh;background-color:#f0f2f5}*::-webkit-scrollbar-thumb{background:#aaa;border-radius:5px}*::-webkit-scrollbar-thumb:hover{background:#999}*::-webkit-scrollbar-track{background-color:#ddd}*::-webkit-scrollbar-corner{background-color:#ddd}*::-webkit-scrollbar{width:5px;height:5px}.ff-container{height:100%}.ff-loading{height:100vh;width:100%;background-color:#f0f2f5;display:flex;justify-content:center;align-items:center}.ff-loading .loader{-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);width:128px;height:80px}.ff-loading .loader .square{position:relative}.ff-loading .loader .square:nth-child(1){margin-left:0}.ff-loading .loader .square:nth-child(1) span{-webkit-animation:animsquare1 2s infinite ease-in;animation:animsquare1 2s infinite ease-in}.ff-loading .loader .square:nth-child(2){margin-left:44px}.ff-loading .loader .square:nth-child(2) span{-webkit-animation:animsquare2 2s infinite ease-in;animation:animsquare2 2s infinite ease-in}.ff-loading .loader .square:nth-child(3){margin-left:88px}.ff-loading .loader .square:nth-child(3) span{-webkit-animation:animsquare3 2s infinite ease-in;animation:animsquare3 2s infinite ease-in}.ff-loading .loader .square:nth-child(4){margin-left:132px}.ff-loading .loader .square:nth-child(4) span{-webkit-animation:animsquare4 2s infinite ease-in;animation:animsquare4 2s infinite ease-in}.ff-loading .loader .square span{position:absolute;top:0;left:20px;height:36px;width:36px;border-radius:2px;background-color:#fff}.ff-loading .loader .square span:nth-child(1){top:0;-webkit-animation-delay:0s;animation-delay:0s}.ff-loading .loader .square span:nth-child(2){top:44px;-webkit-animation-delay:.15s;animation-delay:.15s}.ff-loading .loader .square span:nth-child(3){top:88px;-webkit-animation-delay:.3s;animation-delay:.3s}@media (max-width: 550px){.ff-loading .loader{-webkit-transform:scale(.75);transform:scale(.75)}}@media (max-width: 440px){.ff-loading .loader{-webkit-transform:scale(.5);transform:scale(.5)}}@keyframes animsquare4{0%,5%,95%,to{-webkit-transform:translate(0px,0px) rotate(0deg);transform:translate(0) rotate(0)}30%,70%{-webkit-transform:translate(40px,0px) rotate(90deg);transform:translate(40px) rotate(90deg)}}@keyframes animsquare3{0%,10%,90%,to{-webkit-transform:translate(0px,0px) rotate(0deg);transform:translate(0) rotate(0)}35%,65%{-webkit-transform:translate(40px,0px) rotate(90deg);transform:translate(40px) rotate(90deg)}}@keyframes animsquare2{0%,15%,85%,to{-webkit-transform:translate(0px,0px) rotate(0deg);transform:translate(0) rotate(0)}40%,60%{-webkit-transform:translate(40px,0px) rotate(90deg);transform:translate(40px) rotate(90deg)}}@keyframes animsquare1{0%,20%,80%,to{-webkit-transform:translate(0px,0px) rotate(0deg);transform:translate(0) rotate(0)}45%,55%{-webkit-transform:translate(40px,0px) rotate(90deg);transform:translate(40px) rotate(90deg)}}.ff-notification{position:fixed;z-index:2000;display:flex;max-height:100vh;padding:20px;align-items:flex-end;width:380px;overflow-x:hidden;overflow-y:clip;height:100vh;box-sizing:content-box;pointer-events:none;flex-direction:column;gap:24px}.ff-notification-top,.ff-notification-topLeft,.ff-notification-topRight{top:0}.ff-notification-bottom,.ff-notification-bottomRight,.ff-notification-bottomLeft{bottom:0}.ff-notification-bottomRight,.ff-notification-topRight{right:0}.ff-notification-notice{position:relative;display:block;box-sizing:border-box;line-height:1.5;width:100%}.ff-notification-notice-wrapper{z-index:2000;pointer-events:auto;position:relative;display:block;box-sizing:border-box;border-radius:8px;box-shadow:0 6px 16px #00000014,0 3px 6px -4px #0000001f,0 9px 28px 8px #0000000d;width:calc(100% - 40px);background-color:#fff;right:0}.ff-notification-notice-content{padding:14px 18px;display:flex;gap:8px;white-space:pre-wrap}.ff-notification-notice-content .ff-notification-icon.ff-notification-error{--bg-color: #ff4d4f}.ff-notification-notice-content .ff-notification-icon.ff-notification-success{--bg-color: #52c41a}.ff-notification-notice-content .ff-notification-icon.ff-notification-info{--bg-color: #1677ff}.ff-notification-notice-content .ff-notification-icon>*:first-child{width:24px;height:24px;display:inline-flex;align-items:center;justify-content:center;border-radius:50%;color:#fff;background-color:var(--bg-color)}.ff-notification-notice-progress{position:absolute;left:3px;right:3px;border-radius:1px;overflow:hidden;-moz-appearance:none;appearance:none;-webkit-appearance:none;display:block;inline-size:100%;block-size:2px;border:0}.ff-notification-notice-progress,.ff-notification-notice-progress::-webkit-progress-bar{background-color:#0000000a}.ff-notification-notice-progress::-moz-progress-bar{background-color:#31afff}.ff-notification-notice-progress::-webkit-progress-value{background-color:#31afff}.ff-notification-fade{overflow:hidden;transition:all .3s}.ff-notification-fade-appear-prepare{pointer-events:none;opacity:0!important}.ff-notification-fade-appear-start{transform:translate(100%);opacity:0}.ff-notification-fade-appear-active{transform:translate(0);opacity:1}.ff-data-list-framework{height:100%;--sider-width: 280px;--col-num: 1;--gap: 8px;display:flex;gap:var(--gap)}.ff-data-list-framework .ff-data-list-container{width:100%;height:100%;row-gap:var(--gap);display:flex;flex-direction:column}.ff-data-list-framework .ff-data-list-container .ff-data-list-content{flex:1;overflow-y:auto;display:grid;gap:var(--gap);padding:calc(var(--gap) / 2);grid-template-columns:repeat(var(--col-num),1fr);grid-auto-rows:min-content}.ff-data-list-framework .ff-data-list-container .ff-data-list-content .ff-data-list-framework-item{display:flex;flex-direction:column;justify-content:space-between;row-gap:8px;border-radius:4px;background-color:#fff;box-shadow:0 0 8px #00000014}.ff-data-list-framework .ff-data-list-container .ff-data-list-content .ff-data-list-framework-item .ff-grid-layout{padding:8px}.ff-data-list-framework .ff-data-list-container .ff-data-list-content .ff-data-list-framework-item .data-list-grid-layout-item-actions{margin-top:8px;display:flex;justify-content:space-between;border-top:1px solid #f0f0f0}.ff-data-list-framework .ff-data-list-container .ff-data-list-content .ff-data-list-framework-item .data-list-grid-layout-item-actions .data-list-grid-layout-item-action{text-align:center;margin:2px 0;flex:1}.ff-data-list-framework .ff-data-list-container .ff-data-list-content .ff-data-list-framework-item .data-list-grid-layout-item-actions .data-list-grid-layout-item-action:not(:last-child){border-right:1px solid #f0f0f0}.ff-data-table-framework{height:100%;--sider-width: 280px;--col-num: 1;--gap: 8px;display:flex;gap:var(--gap)}.ff-data-table-framework .ff-data-table-container{width:100%;height:100%;display:flex;flex-direction:column;row-gap:var(--gap)}.ff-data-list-filter:has(.ff-data-list-filter-actions:not(.expanded)){height:60px;overflow-y:hidden}.ff-data-list-filter .ff-data-list-filter-default-form.ff-grid-layout-form{--grid-layout-cols: 25;--grid-layout-item-margin-x: 8px;--grid-layout-item-margin-y: 16px}.ff-data-list-filter .ff-data-list-filter-actions{grid-column:span var(--itemp-span, 5) / calc(var(--grid-layout-cols, 25) + 1)}.ff-data-list-filter .ff-data-list-filter-actions:not(.expanded){grid-row:1}.ff-data-list-filter .ff-data-list-filter-actions .ff-data-list-filter-expanded-button{margin-left:8px}.ff-data-list-filter .ff-data-list-filter-actions .ant-form-item-control-input-content{display:flex;justify-content:flex-end;align-items:center;gap:8px}.ff-data-list-footer{padding-block-start:8px;display:flex;justify-content:space-between}.ff-data-list-footer .ff-data-list-actions{display:flex;justify-content:center;gap:8px}.ff-data-list-sider{width:var(--sider-width, 280px);overflow-y:auto;box-shadow:8px 0 4px -8px #0000000d}.ff-data-list-sider+.ff-data-list-container{width:calc(100% - var(--sider-width, 280px))}.ff-data-list-toolbar{gap:8px;display:flex;justify-content:space-between;align-items:center}.ff-data-list-toolbar .ff-data-list-title{color:#000000e0;font-weight:600;font-size:14px}.ff-data-list-toolbar .ff-data-list-actions{display:flex;justify-content:center;gap:8px}.ff-data-list-toolbar .ff-data-list-tabs{cursor:pointer}.ff-data-list-toolbar .ff-data-list-tabs .ff-data-list-tab{color:#00000073}.ff-data-list-toolbar .ff-data-list-tabs .ff-data-list-tab:hover{font-weight:600}.ff-data-list-toolbar .ff-data-list-tabs .ff-data-list-tab.active{color:#1677ff;font-weight:600}.ff-data-list-item-operations{max-width:180px;display:flex;flex-wrap:wrap;gap:var(--margin-xss, 4px)}.ff-data-list-item-operations>.ant-btn:not(.ant-btn-circle){flex-grow:1}.ff-data-list-helper{height:100%}.ff-data-list-table{height:100%;overflow-y:hidden}.ff-data-list-table .ant-table *{scrollbar-width:auto;scrollbar-color:auto}.ff-grid-layout{--grid-layout-h: 1;--grid-layout-row: none;--grid-layout-row-height: 18px;--grid-layout-row-height-offset: 0px;--grid-layout-cols: 12;display:grid;grid-template-columns:repeat(var(--grid-layout-cols),1fr);grid-auto-rows:minmax(min-content,max-content);padding:var(--grid-layout-container-padding-y, 0) var(--grid-layout-container-padding-x, 0);padding-bottom:calc(var(--grid-layout-container-padding-y, 0) + var(--grid-layout-item-margin-y));column-gap:var(--grid-layout-item-margin-x);row-gap:var(--grid-layout-item-margin-y)}.ff-grid-layout .grid-layout-item{grid-row:span var(--grid-layout-h, 1);grid-column:calc(var(--grid-layout-x, 1) + 1)/calc(var(--grid-layout-x, 1) + var(--grid-layout-w, 1) + 1);height:calc(var(--grid-layout-row-height) * var(--grid-layout-h) + var(--grid-layout-row-height-offset));padding:var(--grid-layout-box-paddin);margin:var(--grid-layout-box-margin);display:var(--grid-layout-box-display, flex);align-items:var(--grid-layout-box-align-items, center);justify-content:var(--grid-layout-box-justify-content, normal)}.ff-grid-layout-form{--grid-layout-h: 1;--grid-layout-row: none;--grid-layout-row-height: 18px;--grid-layout-row-height-offset: 0px;--grid-layout-cols: 12;display:grid;grid-template-columns:repeat(var(--grid-layout-cols),1fr);grid-auto-rows:minmax(min-content,max-content);padding:var(--grid-layout-container-padding-y, 0) var(--grid-layout-container-padding-x, 0);padding-bottom:calc(var(--grid-layout-container-padding-y, 0) + var(--grid-layout-item-margin-y, 16px));column-gap:var(--grid-layout-item-margin-x, 8px);row-gap:var(--grid-layout-item-margin-y, 16px)}.ff-grid-layout-form .grid-layout-item{grid-row:span var(--grid-layout-h, 1);grid-column:calc(var(--grid-layout-x, 1) + 1)/calc(var(--grid-layout-x, 1) + var(--grid-layout-w, 1) + 1);height:calc(var(--grid-layout-row-height) * var(--grid-layout-h) + var(--grid-layout-row-height-offset));padding:var(--grid-layout-box-padding-y, 0) var(--grid-layout-box-padding-x, 0);margin:var(--grid-layout-box-margin)}.ff-iconfont{transform:scale(1.14);vertical-align:-.125em;display:inline-flex;align-items:center;justify-content:center}.ff-iconfont:not(:last-child){margin-right:8px}.ff-button.ant-btn-link,.ff-button.ant-btn-text{width:initial;padding:0;height:auto}.ff-default.ant-btn-link{color:#000000e0}.ant-btn-link.ant-btn:not(:disabled):focus-visible{outline:initial;outline-offset:initial;transition:initial}.ff-popover .ff-popup-header{margin-bottom:calc(var(--margin-sm) / 2)}.ff-popover .ff-popup-header:empty{display:none}.ff-popover .ff-popup-footer{display:flex;justify-content:space-between;margin-top:var(--margin-sm)}.ff-popover .ff-popup-footer:empty{display:none}.ff-modal-form{display:flex;flex-direction:column;gap:var(--modal-form-gap, 8px)}.mask-motion-enter-active,.mask-motion-appear-active,.mask-motion-leave-active{transition:all .3s}.mask-motion-enter,.mask-motion-appear{opacity:0}.mask-motion-enter-active,.mask-motion-appear-active,.mask-motion-leave{opacity:1}.mask-motion-leave-active{opacity:0}.panel-motion-left-enter-start,.panel-motion-left-appear-start,.panel-motion-left-leave-start{transition:none!important}.panel-motion-left-enter-active,.panel-motion-left-appear-active,.panel-motion-left-leave-active{transition:all .3s}.panel-motion-left-enter,.panel-motion-left-appear{transform:translate(-100%)}.panel-motion-left-enter-active,.panel-motion-left-appear-active,.panel-motion-left-leave{transform:translate(0)}.panel-motion-left-leave-active{transform:translate(-100%)!important}.panel-motion-right-enter-start,.panel-motion-right-appear-start,.panel-motion-right-leave-start{transition:none!important}.panel-motion-right-enter-active,.panel-motion-right-appear-active,.panel-motion-right-leave-active{transition:all .3s}.panel-motion-right-enter,.panel-motion-right-appear{transform:translate(100%)}.panel-motion-right-enter-active,.panel-motion-right-appear-active,.panel-motion-right-leave{transform:translate(0)}.panel-motion-right-leave-active{transform:translate(100%)!important}.panel-motion-top-enter-start,.panel-motion-top-appear-start,.panel-motion-top-leave-start{transition:none!important}.panel-motion-top-enter-active,.panel-motion-top-appear-active,.panel-motion-top-leave-active{transition:all .3s}.panel-motion-top-enter,.panel-motion-top-appear{transform:translateY(-100%)}.panel-motion-top-enter-active,.panel-motion-top-appear-active,.panel-motion-top-leave{transform:translateY(0)}.panel-motion-top-leave-active{transform:translateY(-100%)!important}.panel-motion-bottom-enter-start,.panel-motion-bottom-appear-start,.panel-motion-bottom-leave-start{transition:none!important}.panel-motion-bottom-enter-active,.panel-motion-bottom-appear-active,.panel-motion-bottom-leave-active{transition:all .3s}.panel-motion-bottom-enter,.panel-motion-bottom-appear{transform:translateY(100%)}.panel-motion-bottom-enter-active,.panel-motion-bottom-appear-active,.panel-motion-bottom-leave{transform:translateY(0)}.panel-motion-bottom-leave-active{transform:translateY(100%)!important}.ff-drawer-mask{top:0;right:0;bottom:0;left:0;position:absolute;z-index:1050;pointer-events:auto;background-color:var(--popup-mask-bg-color, rgba(0, 0, 0, .45))}.ff-drawer{top:0;right:0;bottom:0;left:0;position:fixed;z-index:1050;pointer-events:none}.ff-drawer .ff-popup-close{top:14px;right:0}.ff-drawer-inline{position:absolute}.ff-drawer-left .ff-drawer-content-wrapper{inset:0 auto 0 0;box-shadow:6px 0 16px #00000014,3px 0 6px -4px #0000001f,9px 0 28px 8px #0000000d}.ff-drawer-right .ff-drawer-content-wrapper{inset:0 0 0 auto;box-shadow:-6px 0 16px #00000014,-3px 0 6px -4px #0000001f,-9px 0 28px 8px #0000000d}.ff-drawer-top .ff-drawer-content-wrapper{top:0;box-shadow:0 6px 16px #00000014,0 3px 6px -4px #0000001f,0 9px 28px 8px #0000000d}.ff-drawer-bottom .ff-drawer-content-wrapper{bottom:0;box-shadow:0 -6px 16px #00000014,0 -3px 6px -4px #0000001f,0 -9px 28px 8px #0000000d}.ff-drawer-top .ff-drawer-content-wrapper,.ff-drawer-bottom .ff-drawer-content-wrapper{inset-inline:0}.ff-drawer-content{width:100%;height:100%;overflow:auto;background-color:var(--popup-bg-color, #fff);pointer-events:auto}.ff-drawer .ff-popup-header{padding:16px 8px;border-bottom:1px solid rgba(5,5,5,.06)}.ff-drawer .ff-popup-footer{border-top:1px solid rgba(5,5,5,.06);padding:12px 8px}.ff-drawer .ff-popup-body{padding:8px}.ff-drawer-content-wrapper{position:absolute;z-index:1050;overflow:hidden;transition:transform .3s;max-width:100vw}.ff-drawer-content-wrapper-hidden{display:none}.ff-modal-mask{position:fixed;top:0;right:0;left:0;bottom:0;pointer-events:auto;background-color:var(--popup-mask-bg-color, rgba(0, 0, 0, .45));height:100%;filter:alpha(opacity=50);z-index:1050}.ff-modal-mask-hidden{display:none}.ff-modal-fade-enter,.ff-modal-fade-appear{opacity:0;animation-duration:.3s;animation-fill-mode:both;animation-timing-function:cubic-bezier(.55,0,.55,.2);animation-play-state:paused}.ff-modal-fade-leave{animation-duration:.3s;animation-fill-mode:both;animation-timing-function:cubic-bezier(.55,0,.55,.2);animation-play-state:paused}.ff-modal-fade-enter.ff-modal-fade-enter-active,.ff-modal-fade-appear.ff-modal-fade-appear-active{animation-name:rcDialogFadeIn;animation-play-state:running}.ff-modal-fade-leave.ff-modal-fade-leave-active{animation-name:rcDialogFadeOut;animation-play-state:running}@keyframes rcDialogFadeIn{0%{opacity:0}to{opacity:1}}@keyframes rcDialogFadeOut{0%{opacity:1}to{opacity:0}}.ff-modal{position:relative;top:100px;width:min-content;margin:0 auto}.ff-modal .ff-popup-close{top:14px;right:8px}.ff-modal .ff-popup-header:has(.ff-popup-title),.ff-modal .ff-popup-header:has(.ff-popup-sub-title){margin-bottom:8px}.ff-modal .ff-popup-footer:not(:empty){margin-top:12px}.ff-modal-wrap{position:fixed;overflow:auto;top:0;right:0;bottom:0;left:0;z-index:1050;-webkit-overflow-scrolling:touch;outline:0}.ff-modal-title{margin:0;font-size:14px;line-height:21px;font-weight:700}.ff-modal-content{position:relative;background-color:var(--popup-bg-color, #fff);border-radius:8px;background-clip:padding-box;max-height:calc(100vh - 150px);min-width:max(35vw,600px);box-shadow:0 6px 16px #00000014,0 3px 6px -4px #0000001f,0 9px 28px 8px #0000000d;padding:20px 24px}.ff-modal-zoom-enter,.ff-modal-zoom-appear{opacity:0;animation-duration:.3s;animation-fill-mode:both;animation-timing-function:cubic-bezier(.08,.82,.17,1);animation-play-state:paused}.ff-modal-zoom-leave{animation-duration:.3s;animation-fill-mode:both;animation-timing-function:cubic-bezier(.6,.04,.98,.34);animation-play-state:paused}.ff-modal-zoom-enter.ff-modal-zoom-enter-active,.ff-modal-zoom-appear.ff-modal-zoom-appear-active{animation-name:rcDialogZoomIn;animation-play-state:running}.ff-modal-zoom-leave.ff-modal-zoom-leave-active{animation-name:rcDialogZoomOut;animation-play-state:running}@keyframes rcDialogZoomIn{0%{opacity:0;transform:scale(0)}to{opacity:1;transform:scale(1)}}@keyframes rcDialogZoomOut{0%{transform:scale(1)}to{opacity:0;transform:scale(0)}}.ff-popup-close{cursor:pointer;border:0;background:transparent;font-size:24px;position:absolute;line-height:1;color:#000;opacity:.5}.ff-popup-close:disabled{pointer-events:none}.ff-popup-close:hover{opacity:.65}.ff-popup{display:flex;flex-direction:column}.ff-popup-title,.ff-popup-sub-title{display:inline}.ff-popup-title{font-size:18px;font-weight:600}.ff-popup-footer{display:flex;gap:8px;justify-content:flex-end}.ff-popup-footer:empty{display:none}.ff-popup-extras,.ff-popup-actions{display:flex;align-items:center;gap:8px}.ff-popup-extras{flex:1}.ff-popup-body{flex:1;overflow-y:auto} diff --git a/dist/utils.js b/dist/utils.js index 11640ee..1476871 100644 --- a/dist/utils.js +++ b/dist/utils.js @@ -1,9 +1,12 @@ import "lodash"; -import { d as r, g as s, r as i, t as o, u as p } from "./common/main-CAjvwlqH.js"; +import { d as g, b as s, a as r, c as o, g as i, r as m, t as p, u as P } from "./common/main-B5hgccZL.js"; export { - r as deepSome, - s as getWidgetPropsData, - i as replaceKeys, - o as toPrimitive, - p as uuid + g as deepSome, + s as getPkgCategory, + r as getPkgName, + o as getPkgOwner, + i as getWidgetPropsData, + m as replaceKeys, + p as toPrimitive, + P as uuid }; diff --git a/package.json b/package.json index c6e2800..30d0c0a 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "ff", "private": true, - "version": "0.4.42", + "version": "0.4.43", "author": "www.fsdpf.com", "type": "module", "main": "./dist/index.js",