diff --git a/dist/button.js b/dist/button.js index a956243..0a850ef 100644 --- a/dist/button.js +++ b/dist/button.js @@ -1,4 +1,4 @@ -import { a0 as s, $ as u, a1 as e } from "./common/main-Bd51PHML.js"; +import { a4 as s, a3 as u, a5 as e } from "./common/main--W19LzWH.js"; import "prop-types"; export { s as auth, diff --git a/dist/common/main--W19LzWH.js b/dist/common/main--W19LzWH.js new file mode 100644 index 0000000..99abf7f --- /dev/null +++ b/dist/common/main--W19LzWH.js @@ -0,0 +1,1029 @@ +var va = Object.defineProperty; +var Ft = (e) => { + throw TypeError(e); +}; +var Sa = (e, t, a) => t in e ? va(e, t, { enumerable: !0, configurable: !0, writable: !0, value: a }) : e[t] = a; +var S = (e, t, a) => Sa(e, typeof t != "symbol" ? t + "" : t, a), Rt = (e, t, a) => t.has(e) || Ft("Cannot " + a); +var h = (e, t, a) => (Rt(e, t, "read from private field"), a ? a.call(e) : t.get(e)), F = (e, t, a) => t.has(e) ? Ft("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, a), D = (e, t, a, n) => (Rt(e, t, "write to private field"), n ? n.call(e, a) : t.set(e, a), a); +var Ot = (e, t, a, n) => ({ + set _(r) { + D(e, t, r, a); + }, + get _() { + return h(e, t, n); + } +}); +import { jsx as d, jsxs as O } from "react/jsx-runtime"; +import k, { useEffect as L, useState as T, useCallback as Y, useMemo as H, useRef as U, useContext as oe, useId as Ye, useLayoutEffect as $a } from "react"; +import u from "lodash"; +import Ht from "immutability-helper"; +import { Form as _e, Input as Pa, Button as ut, Pagination as Na, Tree as Ta, Breadcrumb as Ea, Table as Fa, Empty as Ra, Popconfirm as Oa, Tooltip as La, Popover as Va } from "antd"; +import { useMergedState as ja } from "rc-util"; +import j from "classnames"; +import Z, { FieldContext as Jt, Field as Kt } from "rc-field-form"; +import { useParams as Aa, generatePath as Ia, createBrowserRouter as Ma, useInRouterContext as za, Navigate as Ba } from "react-router-dom"; +import b from "prop-types"; +import * as Lt from "react-is"; +import { useNotification as qa } from "rc-notification"; +import { N as Fe, a as Re, T as gt, S as Da } from "./vender-DMK1apIA.js"; +import "rc-util/lib/hooks/useMergedState"; +import Ua from "rc-drawer"; +import Wa from "rc-dialog"; +var $e, Ve, Pe, le, ke, xe; +class _t { + constructor(t, a) { + F(this, $e, /* @__PURE__ */ new Map()); + F(this, Ve, !0); + F(this, Pe, []); + F(this, le); + F(this, ke, () => h(this, le)); + F(this, xe, () => Promise.resolve()); + S(this, "get", (...t) => new Promise((a, n) => { + const r = JSON.stringify(t); + if (h(this, $e).has(r)) return a(h(this, xe).call(this, h(this, le), ...t)); + if (h(this, le) === void 0) h(this, Pe).push([t, a, n]), h(this, Ve) && (D(this, Ve, !1), Promise.resolve(typeof h(this, ke) == "function" ? h(this, ke).call(this) : h(this, ke)).then((i) => D(this, le, i || null)).finally(() => { + h(this, Pe).forEach(([i, s, o]) => { + try { + const l = h(this, xe).call(this, h(this, le), ...i); + h(this, $e).set(JSON.stringify(i), l), s(l); + } catch (l) { + o(l); + } + }), h(this, Pe).length = 0; + })); + else { + const i = h(this, xe).call(this, h(this, le), ...t); + h(this, $e).set(r, i), a(i); + } + })); + D(this, xe, a), D(this, ke, t); + } +} +$e = new WeakMap(), Ve = new WeakMap(), Pe = new WeakMap(), le = new WeakMap(), ke = new WeakMap(), xe = new WeakMap(); +const nr = () => d("div", { children: "Empty" }), Be = k.createContext({ ele: {}, mount: () => { +}, unmount: () => { +} }), G = ({ rootClassName: e, className: t, children: a, actions: n, title: r, subTitle: i, extras: s, style: o = {} }) => { + const { mount: l, unmount: c } = k.useContext(Be); + return n && G.Action({ children: n }), r && G.Title({ children: r }), i && G.SubTitle({ children: i }), s && G.Extra({ children: s }), L(() => (l("rootClassName", e), () => c(e)), [e]), d("div", { className: j("ff-container", t), style: o, children: a }); +}, Ke = (e) => ({ children: t, className: a }) => { + const { mount: n, unmount: r } = k.useContext(Be); + return L(() => (n(e, k.createElement("div", { key: `ff-${e}`, className: j(`ff-popup-${e}`, a) }, t)), () => r(e)), [a, t]), null; +}; +G.Action = Ke("actions"), G.Title = Ke("title"), G.SubTitle = Ke("sub-title"), G.Extra = Ke("extras"), G.propTypes = { className: b.string, style: b.object, title: b.any, subTitle: b.any, actions: b.any, extras: b.any }; +const rr = () => d(G, { 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", {})] })] }) }), ir = () => d("div", { children: "NotFound" }), Gt = ({ children: e }) => { + const [t, a] = T({}), n = Y((i, s) => a((o) => ({ ...o, [i]: s })), []), r = Y((i) => a((s) => ({ ...s, [i]: void 0 })), []); + return typeof (e == null ? void 0 : e.type) == "string" ? e : d(Be.Provider, { value: { ele: t, mount: n, unmount: r }, children: k.cloneElement(e, { className: t.rootClassName, title: t.title, subTitle: t["sub-title"], actions: t.actions, extras: t.extras }) }); +}; +Gt.propTypes = { children: b.element.isRequired }; +const Vt = { close: ["M563.8 512l262.5-312.9c4.4-5.2 0.7-13.1-6.1-13.1h-79.8c-4.7 0-9.2 2.1-12.3 5.7L511.6 449.8 295.1 191.7c-3-3.6-7.5-5.7-12.3-5.7H203c-6.8 0-10.5 7.9-6.1 13.1L459.4 512 196.9 824.9c-4.4 5.2-0.7 13.1 6.1 13.1h79.8c4.7 0 9.2-2.1 12.3-5.7l216.5-258.1 216.5 258.1c3 3.6 7.5 5.7 12.3 5.7h79.8c6.8 0 10.5-7.9 6.1-13.1L563.8 512z"], check: ["M912 190h-69.9c-9.8 0-19.1 4.5-25.1 12.2L404.7 724.5 207 474c-6.1-7.7-15.3-12.2-25.1-12.2H112c-6.7 0-10.4 7.7-6.3 12.9l273.9 347c12.8 16.2 37.4 16.2 50.3 0l488.4-618.9c4.1-5.1 0.4-12.8-6.3-12.8z"], info: ["M512 224m-64 0a64 64 0 1 0 128 0 64 64 0 1 0-128 0Z", "M544 392h-64c-4.4 0-8 3.6-8 8v464c0 4.4 3.6 8 8 8h64c4.4 0 8-3.6 8-8V400c0-4.4-3.6-8-8-8z"] }, vt = ({ type: e, props: t }) => d("i", { ...t, children: d("svg", { viewBox: "0 0 1024 1024", width: "1em", height: "1em", fill: "currentColor", children: (Vt[e] || Vt.info).map((a, n) => d("path", { d: a }, n)) }) }), Yt = ({ className: e, content: t, icon: a, $close: n }) => O(k.Fragment, { children: [a && d("div", { className: j("ff-notification-icon", e), children: d(vt, { type: a }) }), t] }), Ha = ({}) => d(G, { children: "Confirm" }); +var ge, Ne; +const ae = class ae { + constructor() { + F(this, Ne, /* @__PURE__ */ new Map()); + S(this, "init", (t) => D(this, Ne, new Map(t))); + S(this, "check", (t) => !h(this, Ne).has(t) || h(this, Ne).get(t)); + if (h(ae, ge)) return h(ae, ge); + } +}; +ge = new WeakMap(), Ne = new WeakMap(), F(ae, ge, null), S(ae, "getInstance", () => (h(ae, ge) || D(ae, ge, new ae()), h(ae, ge))); +let pt = ae; +const Ja = pt.getInstance(), Ka = (e, t, a = "children") => { + if (u.isEmpty(e)) return {}; + const n = u.find(e, ["value", t]); + if (!u.isEmpty(n)) return n; + const r = e.length; + for (let i = 0; i < r; i++) { + const { [a]: s } = e[i], o = Ka(s, t, a); + if (!u.isEmpty(o)) return o; + } + return {}; +}, Xt = (e = "Input", t = "@pkg/ff/grid-layout-forms") => e != null && e.startsWith("@") || e != null && e.startsWith("blob:") ? e : `${t}/${e}`; +var pe, je; +const ne = class ne { + constructor() { + F(this, je, null); + S(this, "init", (t) => D(this, je, t)); + S(this, "get", (t, a) => u.get(h(this, je), t, a)); + if (h(ne, pe)) return h(ne, pe); + } +}; +pe = new WeakMap(), je = new WeakMap(), F(ne, pe, null), S(ne, "getInstance", () => (h(ne, pe) || D(ne, pe, new ne()), h(ne, pe))); +let mt = ne; +const Oe = mt.getInstance(), jt = { 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" }, Q = (e, t) => { + let a = "string"; + a = Array.isArray(e) ? "array" : typeof e, u.isObject(e) && (a = "json"); + const n = `${a}2${t}`; + return Reflect.has(jt, n) ? jt[n](e) : e; +}, Qt = (e = {}, t = {}, a = {}, n = "") => Zt(e, (r, i) => i === "type" && r === "code") ? ea(e, t, a, n) : ta(e, t, n), Zt = (e, t = () => !1) => u.some(e, (a) => !!u.some(a, t) || (u.isEmpty(a) || !u.isPlainObject(a) && !u.isArray(a) ? void 0 : Zt(a, t))), ea = async (e = {}, t = {}, a = {}, n = "") => { + 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 = n } = e[i]; + switch (o) { + case "code": + s = await Ce.exec(l, t, a); + break; + case "field": + s = u.get(t, l) ?? u.get(t, l.substring(l.indexOf(".") + 1)); + break; + case "router": + case "query": + s = de.getPageParams(l); + break; + case "string": + s = l; + } + s ?? (s = c); + } else s = await ea(e[i], t, a, n); + u.set(r, i, s); + } + return r; +}, ta = (e = {}, t = {}, a = "") => Object.keys(e || {}).reduce((n, r) => { + if (u.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 = a } = e[r]; + switch (s) { + case "field": + i = u.get(t, o) ?? u.get(t, o.substring(o.indexOf(".") + 1)); + break; + case "router": + case "query": + i = de.getPageParams(o); + break; + case "string": + i = o; + } + i ?? (i = l); + } else i = ta(e[r], t, a); + u.set(n, r, i); + } + return n; +}, {}), lt = (e, t) => e && typeof e == "object" ? Array.isArray(e) ? e.map((a) => lt(a, t)) : Object.keys(e).reduce((a, n) => (t[n] ? a[t[n]] = lt(e[n], t) : a[n] = lt(e[n], t), a), {}) : e, sr = () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (e) => { + const t = 16 * Math.random() | 0; + return (e === "x" ? t : 3 & t | 8).toString(16); +}), or = (e) => { + var t, a; + return e ? (a = (t = e.match(/^@pkg(?:[^\/]*\/){3}(?[^\/]+)/)) == null ? void 0 : t.groups) == null ? void 0 : a.name : ""; +}, lr = (e) => { + var t, a; + return e ? (a = (t = e.match(/^@pkg(?:[^\/]*\/){2}(?[^\/]+)/)) == null ? void 0 : t.groups) == null ? void 0 : a.category : ""; +}, cr = (e) => { + var t, a; + return e ? (a = (t = e.match(/^@pkg(?:[^\/]*\/){1}(?[^\/]+)/)) == null ? void 0 : t.groups) == null ? void 0 : a.owner : ""; +}; +var Qe, Ae, Ie, Ze; +const et = class et { + constructor(...t) { + F(this, Ae, []); + F(this, Ie, (t) => { + var a; + for (let n of t) Array.isArray(n[0]) ? h(this, Ie).call(this, n) : h(this, Ae).push(h(a = et, Qe).call(a, n[0], n[1])); + }); + S(this, "toValue", async (t, a = null) => { + const n = { getValue: () => t, getRecord: () => a }; + return await h(this, Ae).reduce(async (r, i) => { + try { + const s = await r; + return (await i).call(n, s); + } catch (s) { + return console.error(s), r; + } + }, t); + }); + S(this, "toRender", (t, a, n = null) => k.createElement(h(this, Ze), { value: t, record: a }, n)); + F(this, Ze, ({ value: t, record: a, children: n }) => { + const [r, i] = T(n); + return rt(() => { + let s = !1; + return i(n), this.toValue(t, a).then((o) => Q(o, "string")).then((o) => !s && i(o)).catch((o) => !s && i(`${o}`)), () => s = !0; + }, [t, a]), r; + }); + h(this, Ie).call(this, t); + } +}; +Qe = new WeakMap(), Ae = new WeakMap(), Ie = new WeakMap(), Ze = new WeakMap(), F(et, Qe, u.memoize((t, a) => ee.getWidgetComponent(t).then((n) => { + var r; + return ((r = n.default) == null ? void 0 : r.call(n, a)) || ((i) => i); +}), (t, a) => `${t}::${Q(a, "string")}`)); +let Xe = et; +const _a = (e, t = {}) => H(() => e == null ? void 0 : e.map(({ widgetByJs: a, widgetByJsSetting: n, ...r }, i) => a ? { ...r, render: (s, o) => new Xe([a, n]).toRender(s, o, "-") } : r), [e, t]), dr = (e) => { + const [t, a] = T({}); + return L(() => { + let n = !1; + return e && R.get(`/api/_/${e}`).then((r) => u.pick(r, ["uuid", "name", "code", "resource", "marginX", "marginY", "cols", "rowHeight", "primaryKey", "columns", "itemOperations", "batchOperations", "isConditionFormLayout", "layout", "tabs", "pageSize", "layoutConfig"])).then((r) => !n && a(r)), () => n = !0; + }, [e]), t; +}, ur = (e, t = {}) => { + const [a, n] = T({ dataSource: [] }); + return qe(() => { + let r = !1; + return e && R.get(`/api/${e}/${R.encode({ page: 1, ...t })}`).then((i) => !r && n(i)), () => r = !0; + }, [e, t]), a; +}, aa = (e = [], t = /* @__PURE__ */ new Map(), a = "id", n) => { + const r = Y(n ? (i) => u.get(i, a, u.get(i, [n, a])) : (i) => u.get(i, a), [a, n]); + return Y((i) => e == null ? void 0 : e.filter((s) => !s.uuid || !t.has(s.uuid) || t.get(s.uuid).includes(`${r(i)}`)), [e, t, r]); +}, ht = (e = [], t = [], a = /* @__PURE__ */ new Map(), n = "id", r) => { + const i = Y(r ? (s) => u.get(s, n, u.get(s, [r, n])) : (s) => u.get(s, n), [n, r]); + return H(() => { + if (u.isEmpty(t) || !t.some(({ uuid: o }) => Ja.check(o))) return !1; + if (u.isEmpty(a) || u.isEmpty(e)) return !0; + const s = e.map((o) => `${i(o)}`); + return t.some(({ uuid: o }) => !o || !a.has(o) || a.get(o).some((l) => s.includes(`${l}`))); + }, [t, e, a, i]); +}, Ga = (e, t, a = "id", n = null) => { + const r = nt(), i = U(!1), s = U(e.dataSource), o = U(e.itemOperationsAccess); + return L(() => (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 p, g; + if (i.current = !1, l === 1) return (p = e.onReload) == null ? void 0 : p.call(e); + if (l === 2) { + const m = u.get(c, "__PARENT_ID__", ""), y = u.get(c, a, u.get(c, [n, a], "")), f = u.findIndex(s.current, ["__PARENT_ID__", m]), w = u.findIndex(f > -1 ? u.get(s.current, [f, "children"]) : s.current, [a, y]); + if (w === -1) return (g = e.onReload) == null ? void 0 : g.call(e); + Promise.all([R.get(`/api/${t}/detail/${y}`), R.post(`/api/${t}/list-operations-access`, { ids: y })]).then(([C, v]) => { + const E = u.get(s.current, f > -1 ? [f, "children", w, "children"] : [w, "children"]); + s.current = Ht(s.current, f > -1 ? { [f]: { children: { $splice: [[w, 1, { ...C, children: E }]] } } } : { $splice: [[w, 1, { ...C, children: E }]] }); + const $ = new Map(v); + o.current.forEach((z, A) => { + var B; + (B = $.get(A)) != null && B.some((I) => I == y) || o.current.set(A, z.filter((I) => I !== y)); + }), $.forEach((z, A) => { + o.current.has(A) ? o.current.set(A, u.uniq([...o.current.get(A) || [], ...z])) : o.current.set(A, z); + }); + }).then(() => { + i.current = !0, r(); + }); + } + }]; +}, Ya = (e, t) => { + const a = nt(), n = U(t), r = U(/* @__PURE__ */ new Map()), i = U([]), s = u.throttle((l) => { + i.current = [], R.list(e, u.pick({ ...n.current, ...l }, ["tab", "page", "pageSize", "condition", "sider", "keyword"])).then(({ keyword: c, condition: p, total: g, tab: m, sider: y, page: f, pageSize: w, operationsAccess: C, dataSource: v }) => { + n.current = { tab: m, condition: p, sider: y, keyword: c, total: g, pageSize: w, page: v != null && v.length ? f : 1 }, i.current = v, r.current = new Map(C), a(); + }); + }, 380, { leading: !1, trailing: !0 }); + rt(() => { + i.current = [], e && s(t); + }, [e, t]); + const o = H(() => u.pick(n.current, ["total", "tab", "page", "pageSize", "condition", "sider", "keyword"]), [n.current]); + return Object.assign(o, { onTabChange: (l) => s({ tab: l, page: 1 }), onPageChange: (l, c) => s({ page: l, pageSize: c }), onPageSizeChange: (l) => s({ pageSize: l, page: 1 }), onConditionChange: (l, c) => s({ keyword: c, condition: Ht(n.current.condition || {}, { $merge: l || {} }), page: 1 }), onSiderChange: (l) => s({ sider: l, page: 1 }), onKeywordChange: (l) => s({ keyword: l, page: 1 }), itemOperationsAccess: r.current, dataSource: i.current, onReload: s }); +}, Xa = ({ listCode: e, className: t, layouts: a, dataSource: n, isPaginate: r, isItemOperations: i, isBatchOperations: s, batchOperations: o, itemOperations: l, itemOperationsAccess: c, resource: p, primaryKey: g, title: m, itemGridLayout: y, $setting: f, tabs: w, isConditionFormLayout: C, isTreeSider: v, treeSiderConfig: E }) => { + const { classNames: $, onClickCallback: z } = oe(te), A = aa(l, c, g, p), B = Y((I, P, x) => d(Qa, { className: j("ff-data-list-framework-item", $.item), operations: i ? A(P) : [], data: p ? { [p]: P } : P, children: I, onClickCallback: z }), [p, g, i, z, l, c]); + return O("div", { className: j("ff-data-list-framework", t), children: [d(a.sider, { isTreeSider: v, ...E }), O("div", { className: j("ff-data-list-container", $ == null ? void 0 : $.container), children: [d(a.filter, { isConditionFormLayout: C }), d(a.toolbar, { title: m, tabs: w }), d(gn, { ...y, style: { "--col-num": (f == null ? void 0 : f.colNum) || 1 }, primaryKey: g, itemRender: B, dataSource: n }), d(a.footer, { isPaginate: r, isOperations: s, operations: o })] })] }); +}, Qa = ({ className: e, operations: t, children: a, data: n, onClickCallback: r }) => O("div", { className: j("data-list-grid-layout-item-container", e), children: [a, !!(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(N.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: n, confirm: i.confirm, onAfterClick: (s) => s !== !1 && (r == null ? void 0 : r(i.isRefresh, n)) }, i.uuid || Ye()) }, (i == null ? void 0 : i.uuid) || Ye())) })] }), Za = ({ listCode: e, className: t, layouts: a, dataSource: n, columns: r, isItemOperations: i, isBatchOperations: s, batchOperations: o, itemOperations: l, itemOperationsAccess: c, resource: p, primaryKey: g, title: m, tabs: y, isPaginate: f, isTreeSider: w, treeSiderConfig: C, isConditionFormLayout: v, ...E }) => { + const { classNames: $, onClickCallback: z } = oe(te), A = aa(l, c, g, p), B = ht(n, l, c, g, p); + return O("div", { className: j("ff-data-table-framework", t), children: [d(a.sider, { isTreeSider: w, ...C }), O("div", { className: j("ff-data-table-container", $ == null ? void 0 : $.container), children: [d(a.filter, { isConditionFormLayout: v }), d(a.toolbar, { title: m, tabs: y }), d(on, { ...E, primaryKey: g, className: "ff-data-table-content", columns: r, dataSource: n, operationRender: B ? (I) => { + var P; + return d("div", { className: "ff-data-table-actions", children: (P = A(I)) == null ? void 0 : P.map((x, V) => d(N.Link, { size: "small", uuid: x.uuid, type: x.type, name: x.name, widget: x.widget, widgetType: x.widgetType, widgetProps: x.widgetProps, widgetData: x.widgetData, widgetSetting: x.widgetSetting, widgetContainerProps: x.widgetContainerSetting, data: I, confirm: x.confirm, onAfterClick: (M) => M !== !1 && (z == null ? void 0 : z(x.isRefresh, I)) }, x.uuid || V)) }); + } : null }), d(a.footer, { isPaginate: f, isOperations: s, operations: o })] })] }); +}, te = k.createContext({ listCode: "", classNames: {}, getBase62params: (e, t) => { +}, onReload: () => { +}, onClickCallback: () => { +}, onConditionChange: () => { +}, onTabChange: () => { +}, onSiderChange: () => { +}, onKeywordChange: () => { +}, onPageChange: () => { +}, onPageSizeChange: () => { +} }), na = (e, t, a, n, r = {}, i = 0) => { + const s = { "--grid-layout-h": `${n}`, "--grid-layout-w": `${a}`, "--grid-layout-x": `${e}`, "--grid-layout-y": `${t}`, "--grid-layout-row-height-offset": "0px" }; + return r != null && r.autoHeight ? s.height = "fit-content" : s["--grid-layout-row"] = `${n}`, r != null && r.alignItems && (s["--grid-layout-box-align-items"] = r.alignItems), r != null && r.justifyContent && (s["--grid-layout-box-justify-content"] = r.justifyContent), s["--grid-layout-box-margin"] = At(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"] = At(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; +}, At = (e, t, a, n) => `${e || 0}px ${t || 0}px ${a || 0}px ${n || 0}px`, en = (e = "Input", t = "@pkg/ff/grid-layouts") => e != null && e.startsWith("@") || e != null && e.startsWith("blob:") ? e : `${t}/${e}`, ra = ({ className: e, isConditionFormLayout: t }) => { + var m, y; + const [a, n] = T({}), { listCode: r, onKeywordChange: i, onConditionChange: s, getBase62params: o, classNames: l } = k.useContext(te), { keyword: c, condition: p } = (o == null ? void 0 : o()) || {}, [g] = _e.useForm(); + return L(() => { + r && t && R.get(`/api/_/${r}/list-condition-form-layout`).then(({ resource: f, marginX: w, marginY: C, rowHeight: v, cols: E, fields: $ }) => { + n({ resource: f, itemMargin: [w, C], rowHeight: v, cols: E, fields: $ }); + }).catch(() => n({})); + }, [r, t]), L(() => { + g.setFieldsValue({ keyword: c, ...p }); + }, [JSON.stringify([c, p])]), d("div", { className: j("ff-data-list-filter", l.filter, e), children: d(_e, { form: g, layout: "vertical", autoComplete: "off", onFinish: ((m = a.fields) == null ? void 0 : m.length) > 1 ? (f) => s({ [a.resource]: f[a.resource] }, f.keyword) : () => { + }, onValuesChange: (f) => { + u.isEmpty(u.omit(f, ["keyword"])) || g.submit(); + }, children: ((y = a.fields) == null ? void 0 : y.length) > 1 ? d($t, { ...a, children: d(tn, { onReset: () => { + const { keyword: f, condition: w } = o("init") || {}; + g.setFieldsValue({ keyword: f, ...w }); + } }) }) : d("div", { className: "ff-data-list-filter-default-form ff-grid-layout-form", children: d("div", { className: "grid-layout-item", style: na(20, 0, 5, 2), children: d(_e.Item, { name: ["keyword"], children: d(Pa.Search, { allowClear: !0, enterButton: "搜索", placeholder: "多关键字 | 分割", onSearch: (f) => i(f) }) }) }) }) }) }); +}, tn = ({ cols: e, fields: t, onReset: a }) => { + const [n, r] = T(!1), i = H(() => t == null ? void 0 : t.toReversed().some((s) => s.y > 1 || s.x + s.w >= e - 5), [e, t]); + return O(_e.Item, { label: " ", style: { "--item-span": 5 }, className: j("ff-data-list-filter-actions", { expanded: n }), children: [d(ut, { onClick: a, children: "重置" }), d(ut, { type: "primary", htmlType: "submit", children: "查询" }), i && d(N.Link, { className: "ff-data-list-filter-expanded-button", widget: () => r((s) => !s), type: "primary", name: n ? "关闭" : "展开", icon: n ? "icon-up" : "icon-down", iconPosition: "end" })] }); +}; +ra.reservedFields = [{ x: 0, y: 0, h: 3, w: 5, field: { isVirtual: !0, widgetPrefix: "@pkg/ff/grid-layout-forms", widget: "Input", code: "keyword", label: "关键字", placeholder: "多关键字 | 分割", extras: { prefix: "icon-search" } } }]; +const an = ({ className: e, operations: t, isOperations: a, isPaginate: n }) => { + const { onPageChange: r, onPageSizeChange: i, onClickCallback: s, getBase62params: o } = k.useContext(te), { total: l, page: c, pageSize: p } = (o == null ? void 0 : o()) || {}; + return a && !u.isEmpty(t) || n ? O("div", { className: j("ff-data-list-footer", e), children: [d("div", { className: "ff-data-list-actions", children: t == null ? void 0 : t.map((g, m) => d(N, { 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 || m)) }), n && d(Na, { size: "small", total: l, pageSize: p, showSizeChanger: !1, showTotal: (g) => `第 ${c} 页 / 总共 ${g} 条`, onChange: r, onShowSizeChange: i })] }) : null; +}, nn = [{ 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" }] }] }], rn = ({ className: e, width: t = 280, isTreeSider: a }) => { + const { classNames: n } = oe(te); + return a ? d(Ta.DirectoryTree, { className: j("ff-data-list-sider", n.sider, e), style: { "--sider-width": t }, showLine: !0, showIcon: !1, treeData: nn }) : null; +}, sn = ({ className: e, title: t, tabs: a }) => { + const { getBase62params: n, onTabChange: r, onReload: i, classNames: s } = oe(te), { tab: o } = (n == null ? void 0 : n()) || {}, [l, c] = ja((a == null ? void 0 : a[0].value) ?? (a == null ? void 0 : a[0].code), { value: o, onChange: r }); + return O("div", { className: j("ff-data-list-toolbar", s.toolbar, e), children: [d("div", { className: "ff-data-list-title", children: t }), d(Ea, { className: "ff-data-list-tabs", itemRender: ({ label: p, code: g, value: m }) => d("span", { onClick: () => c(m ?? g), className: j("ff-data-list-tab", { active: (m ?? g) == l }), children: p }), items: a }), O("div", { className: "ff-data-list-actions", children: [d(N.Link, { icon: "icon-reload", widget: () => i() }), d(N.Link, { icon: "icon-setting" })] })] }); +}, ia = ({ isItemGridLayout: e, theme: t, themeProps: a, onClickCallback: n, onReload: r, listCode: i, total: s = 0, page: o = 0, onPageChange: l, pageSize: c = 30, onPageSizeChange: p, tab: g, onTabChange: m, keyword: y, onKeywordChange: f, condition: w, onConditionChange: C, sider: v, onSiderChange: E, layouts: $, classNames: z = {}, ...A }) => { + const [B, I] = T(), P = H(() => { + let x = { sider: rn, filter: ra, footer: an, toolbar: sn }; + $ === !1 ? x = { sider: null, filter: null, footer: null, toolbar: null } : u.isPlainObject($) && (x = Object.assign({}, x, $)); + for (const V in x) x[V] || (x[V] = () => d(k.Fragment, {})); + return x; + }, [$]); + return L(() => { + t ? ee.getWidgetComponent(t).then((x) => { + if (!x) throw `${t} not found`; + return x; + }).catch((x) => ({ default: () => `${x}` })).then((x) => I(k.createElement(x.default, { ...A, layouts: P, $setting: a }))) : I(d(e ? Xa : Za, { ...A, layouts: P, $setting: a })); + }, [t, a]), d(te.Provider, { value: { classNames: z, listCode: i, onClickCallback: n, onReload: r, getBase62params: (x, V) => { + const M = { tab: g, page: o, pageSize: c, keyword: y, sider: v, condition: w, total: s }; + return x && x != "init" ? M[x] ?? V : M; + }, onPageChange: l, onPageSizeChange: p, onTabChange: m, onSiderChange: E, onKeywordChange: f, onConditionChange: C }, children: B && k.cloneElement(B, A) }); +}; +ia.propTypes = { classNames: b.exact({ sider: b.string, filter: b.string, footer: b.string, toolbar: b.string, container: b.string, content: b.string, item: b.string }), layouts: b.oneOfType([b.exact({ sider: b.elementType, filter: b.elementType, footer: b.elementType, toolbar: b.elementType }), b.bool]) }; +var me, ce, ve, tt; +const re = class re { + constructor() { + F(this, ce, null); + F(this, ve, /* @__PURE__ */ new Map()); + F(this, tt, () => { + if (h(this, ce)) return h(this, ce).port.postMessage({ command: "status", data: [] }); + D(this, ce, new SharedWorker(new URL("/ff-worker/res-ws.js", self.location))), h(this, ce).port.onmessage = (t) => { + var a, n; + (a = t.data) != null && a.uuid ? h(this, ve).forEach((r, i) => { + var s; + (r == "*" || (s = r == null ? void 0 : r.includes) != null && s.call(r, t.data.uuid)) && i(t.data); + }) : ((n = t.data) == null ? void 0 : n.readyState) == WebSocket.CLOSED && R.get("/api/user-api-token").then(({ token: r, expire_at: i }) => { + h(this, ce).port.postMessage({ command: "initWs", data: [`ws${u.trimStart(R.appUrl, "http")}api/user-resource-status-ws?token=${r}`] }); + }); + }, h(this, ce).port.postMessage({ command: "status", data: [] }); + }); + S(this, "subscribe", (t, a = []) => (a ? Array.isArray(a) && a.length == 0 ? a = "*" : Array.isArray(a) || (a = [a].flat()) : a = "*", h(this, ve).set(t, a), h(this, ve).size == 1 && h(this, tt).call(this), () => this.unsubscribe(t))); + S(this, "unsubscribe", (t) => h(this, ve).delete(t)); + if (h(re, me)) return h(re, me); + } +}; +me = new WeakMap(), ce = new WeakMap(), ve = new WeakMap(), tt = new WeakMap(), F(re, me, null), S(re, "getInstance", () => (h(re, me) || D(re, me, new re()), h(re, me))); +let ft = re; +const sa = ft.getInstance(), St = k.forwardRef(({ listCode: e, base62params: t, className: a, theme: n, themeProps: r, layouts: i, classNames: s }, o) => { + const [{ resource: l, primaryKey: c, batchOperations: p = [], itemOperations: g = [], columns: m = [], themeConfig: y, theme: f, isConditionFormLayout: w = !1, isTreeSider: C, treeSiderConfig: v, isItemGridLayout: E, itemGridLayout: $, title: z, isPaginate: A, tabs: B }, I] = T({ isItemGridLayout: !1, itemGridLayout: {} }), P = Ya(e, t), [{ dataSource: x, itemOperationsAccess: V, condition: M, tab: W, keyword: ue, page: J, total: Ue, pageSize: it, sider: We, onConditionChange: st, onTabChange: Tt, onKeywordChange: fa, onPageChange: ya, onPageSizeChange: wa, onSiderChange: ba, onReload: ot }, Et] = Ga(P, e, c, l), Ca = ht(g, x, V, c), ka = ht(p); + return L(() => { + let He = null; + return e && R.get(`/api/_/${e}`).resp(({ data: Je, res: xa }) => { + Je != null && Je.isDynamicRefresh && (He = sa.subscribe(() => ot(), xa)), I(Je); + }).catch(() => I({})), () => He == null ? void 0 : He(); + }, [e]), k.useImperativeHandle(o, () => ({ onReload: ot, onClickCallback: Et })), d(ia, { listCode: e, title: z, classNames: s, layouts: i, resource: l, primaryKey: c, theme: n || f, themeProps: r || y, isTreeSider: C, treeSiderConfig: v, isPaginate: A, tabs: B, isItemOperations: Ca, isBatchOperations: ka, batchOperations: p, itemOperations: g, isItemGridLayout: E, columns: m, itemGridLayout: $, isConditionFormLayout: w, itemOperationsAccess: V, dataSource: x, onConditionChange: st, onTabChange: Tt, onKeywordChange: fa, onPageChange: ya, onPageSizeChange: wa, onSiderChange: ba, condition: M, tab: W, keyword: ue, page: J, total: Ue, pageSize: it, sider: We, className: j("ff-data-list-helper", a), onReload: ot, onClickCallback: Et }); +}), oa = (e, t, a = !0) => a !== !0 && a-- <= 0 ? [] : u.isArray(e) && !u.isEmpty(e) ? e.reduce((n, r) => (Reflect.has(r, t) && Reflect.has(r, "children") && n.push(r[t]), Reflect.has(r, "children") && !u.isEmpty(r.children) ? n.concat(oa(r.children, t, a)) : n), []) : [], on = ({ className: e, primaryKey: t, columns: a = [], dataSource: n = [], operationRender: r, operationWidth: i = 180, ...s }) => { + const { classNames: o } = oe(te); + Ye(); + const l = U(null), c = U(null), [p, g] = T([]), [m, y] = T({ width: 0, height: 0 }); + L(() => { + g(oa(n, t)); + }, [n, t]), $a(() => { + const w = new ResizeObserver(() => { + var C; + y({ width: ((C = l.current) == null ? void 0 : C.nativeElement.querySelector(".ant-table-body").scrollWidth) || c.current.offsetWidth, height: c.current.offsetHeight }); + }); + return c.current && w.observe(c.current), () => { + c.current && w.unobserve(c.current); + }; + }, []); + const f = _a(a); + return d("div", { ref: c, className: j("ff-data-list-table", o.content, e), children: m.height ? d(Fa, { ...s, ref: l, rowKey: (w) => (w == null ? void 0 : w[t]) ?? Math.random(), columns: f == null ? void 0 : f.concat(r ? [{ title: "操作", align: "center", fixed: "right", width: `${Math.ceil(i / m.width * 100).toFixed(2)}%`, render: (w, C, v) => r(C, v) }] : []), dataSource: n, size: "middle", scroll: { x: "max-content", y: m.height - 50 }, pagination: !1, expandable: { defaultExpandAllRows: !0, expandRowByClick: !0, onExpandedRowsChange: g, expandedRowKeys: p } }) : null }); +}, ln = "RC_FORM_INTERNAL_HOOKS", la = (e, { initialValue: t, initialValueLanguage: a, convertJs: n, convertJsSetting: r, type: i = "string" }, s = null) => { + const o = U(!1), l = oe(Jt), [c, p] = T(), [g, m] = T(a != "javascript" && e ? l.getFieldValue(e) : void 0), { registerWatch: y } = l.getInternalHooks(ln) || {}; + return L(() => y == null ? void 0 : y((f, w, C) => { + if (!o.current) return; + const v = u.get(w, e); + u.isEqual(v, g) || m(Q(v, i)); + }), [g]), L(() => { + a == "javascript" && t ? Ce.exec(t, {}, { getFieldValueForBasicForm: (f) => s ? s.getFieldValue(f) : l.getFieldValue(f), getFieldValue: (f) => l.getFieldValue(f) }).then((f) => m(Q(f, i))).catch((f) => notification.error({ message: `布局数据错误: ${JSON.stringify(f)}` })).finally(() => o.current = !0) : (t && m(Q(t ?? l.getFieldValue(e), i)), o.current = !0); + }, [t, a]), qe(() => { + o.current && n && new Xe([n, r]).toValue(g, l.getFieldsValue(!0)).then(p).catch((f) => { + p(f), console.error("布局数据转换错误: ", f, n); + }); + }, [g, n, r]), [c ?? g, g]; +}, ca = (e, t, a = "@pkg/ff/grid-layouts", n = null) => H(() => { + var r; + return (r = u.sortBy(e, ["y", "x"])) == null ? void 0 : r.map(({ i, x: s, y: o, w: l, h: c, field: { boxStyle: p, widgetPrefix: g = a, widget: m, ...y } }, f) => d("div", { className: "grid-layout-item", style: na(s, o, l, c, p, m === "Height" && (y == null ? void 0 : y.initialValue)), children: d(cn, { ...y, basicForm: n, itemWidget: en(m, g), itemWidgetRender: t }) }, i || f)); +}, [e]), cn = ({ itemWidget: e, itemWidgetRender: t, basicForm: a, ...n }) => { + const [r, i] = T(); + return L(() => { + ee.getWidgetComponent(e).then(({ defaultProps: s = {}, default: o }) => { + i(k.createElement(t(o, s, a), n)); + }).catch((s) => { + console.error(s), i(e); + }); + }, [e]), r; +}, da = ({ cols: e = 12, rowHeight: t = 21, fields: a = [], data: n, containerPadding: r = [0, 0], itemMargin: i = [4, 0], formProps: s = {}, className: o, ...l }) => { + const [c] = Z.useForm(), p = ca(a, dn, "@pkg/ff/grid-layouts"), g = H(() => [{ name: "__PROPS__", value: s }], [s]); + return qe(() => (c.setFieldsValue(n), () => c.resetFields()), [n]), d(Z, { fields: g, form: c, component: !1, children: d("div", { ...l, className: j("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: p }) }); +}, dn = (e, t = {}, a = null) => (n) => { + const { code: r, label: i, extras: s, isVirtual: o, initialValue: l, initialValueLanguage: c, convertJs: p, convertJsSetting: g, ...m } = u.merge({}, t, n), [y, f] = la(o ? null : r, { initialValue: l, initialValueLanguage: c, convertJs: p, convertJsSetting: g, type: (m == null ? void 0 : m.type) || "string" }, a); + return d(e, { ...m, value: y, rawValue: f, $setting: s || {} }); +}, gr = (It = da, function({ code: e, data: t, ...a }) { + const [n, r] = T({ resource: null, cols: 12, rowHeight: 21, fields: [] }); + return L(() => { + e && R.get(`/api/_/${e}`).then((i) => r(u.pick(i, ["resource", "cols", "rowHeight", "fields"]))); + }, [e]), (n == null ? void 0 : n.resource) && d(It, { ...a, rowHeight: n.rowHeight, cols: n.cols, fields: n.fields, data: n != null && n.resource ? { [n == null ? void 0 : n.resource]: t } : {} }); +}); +var It; +const pr = ({ widget: e, widgetPrefix: t = "@pkg/ff/grid-layouts", basicForm: a, ...n }) => { + const r = e != null && e.startsWith("@") || e != null && e.startsWith("blob:") ? e : `${t}/${e}`, [i, s] = T(); + return L(() => { + r && ee.getWidgetComponent(r).then(({ defaultProps: o = {}, default: l }) => ({ default: un(l, o, a) })).catch((o) => ({ default: () => `${o}` })).then((o) => s(k.createElement(o.default, n))); + }, [r]), i; +}, un = (e, t = {}, a = null) => (n) => { + const { code: r, label: i, extras: s, isVirtual: o, initialValue: l, initialValueLanguage: c, convertJs: p, convertJsSetting: g, value: m, ...y } = u.merge({}, t, n), [f, w] = la(o ? null : r, { initialValue: l, initialValueLanguage: c, convertJs: p, convertJsSetting: g, type: (y == null ? void 0 : y.type) || "string" }, a), C = H(() => { + const $ = Object.keys((t == null ? void 0 : t.extras) || {}); + return u.over([u.partialRight(u.pick, $), u.partialRight(u.omit, $)]); + }, [t == null ? void 0 : t.extras]), [v, E] = C(y); + return d(e, { ...E, value: f, rawValue: w, $setting: Object.assign({}, s, v) }); +}, gn = ({ cols: e, rowHeight: t, itemMargin: a, fields: n, primaryKey: r, dataSource: i, itemClassName: s, itemRender: o = (g, m, y) => g, empty: l = d(Ra, { description: null }), className: c, style: p = {} }) => { + const { classNames: g } = oe(te), m = Ye(), y = H(() => d(da, { cols: e, rowHeight: t, itemMargin: a, fields: n, className: s }), [n, e, t, a]); + return d("div", { className: j("ff-data-list-content", g.content, c), style: p, children: u.isEmpty(i) ? l : i.map((f, w) => { + const C = o(k.cloneElement(y, { data: f }), f, w); + return k.cloneElement(C, { key: `${m}-${(f == null ? void 0 : f[r]) || w}` }); + }) }); +}, pn = ({ component: e }) => { + const { base62params: t } = Aa(); + return d(G, { children: d(St, { listCode: e, base62params: R.decode(t) }) }); +}, mn = () => "Empty", hn = ({ component: e, $setting: t }) => { + const [a, n] = T(); + L(() => { + if (!e) return n(d(mn, { description: null })); + ee.getWidgetComponent(e).catch((i) => ({ default: () => `${i}` })).then((i) => k.createElement(i.default, { $setting: t })).then(n); + }, [e]); + const r = de.getPageParams() || {}; + return a ? k.cloneElement(a, r) : null; +}; +var he, X, fe, ye, Me, ze; +const ie = class ie { + constructor() { + F(this, X, /* @__PURE__ */ new Map()); + F(this, fe, {}); + F(this, ye, null); + S(this, "init", (t, a) => { + D(this, X, t), D(this, fe, a); + }); + S(this, "get", (t) => (h(this, X).has(t) || (t = Array.from(h(this, X).keys()).find((a) => h(this, X).get(a).uri === t)), h(this, X).get(t) || {})); + S(this, "redirect", (t, a, n = {}) => { + const { uri: r, type: i, widgetProps: s } = this.get(t) || {}; + let o = Ia(r || t, i != "list" ? a : u.mapValues(a, (c) => R.encode(c))); + const l = new URLSearchParams(); + for (const c in s || {}) (s == null ? void 0 : s.type) == "query" && l.append(c, a[c]); + return l.size > 0 && (o = `${o}?${l.toString()}`), h(this, ye).navigate(o, n); + }); + S(this, "getMenus", (t) => { + var a; + return ((a = h(this, fe)) == null ? void 0 : a[t]) || []; + }); + S(this, "findMenuPathByUuid", (t) => { + let a = []; + for (const n in h(this, fe)) if (a = h(this, Me).call(this, h(this, fe)[n], t, [n]), a.length > 1) return a; + return a; + }); + S(this, "getMenusByRouteUuid", (t) => h(this, ze).call(this, t, Object.values(h(this, fe)).flat())); + F(this, Me, (t, a, n = []) => { + if (u.isEmpty(t)) return n; + for (const { uuid: r, children: i } of t) { + if (r == a) return n.concat(r); + if (!u.isEmpty(i)) return n.concat(r, h(this, Me).call(this, i, a)); + } + return n; + }); + F(this, ze, (t, a) => { + var r; + let n = []; + for (const i of a) i.widgetType == "redirect" && (i.uuid == t || i.widget == t ? n.push(i) : (r = i.children) != null && r.length && (n = n.concat(h(this, ze).call(this, t, i.children)))); + return n; + }); + S(this, "getCurrentMenu", () => { + const { uuid: t } = this.getCurrentRoute() || {}; + if (!t) return; + const a = this.getMenusByRouteUuid(t); + return u.isEmpty(a) ? void 0 : a[0]; + }); + S(this, "getCurrentRoute", (t = 0) => { + var n; + const a = (n = h(this, ye).state.matches[h(this, ye).state.matches.length - 1 - t]) == null ? void 0 : n.route; + if (!a) return null; + for (let [r, i] of h(this, X)) if (i.uri === a.path) return i; + return null; + }); + S(this, "getPageParams", (t) => { + var i, s; + const { location: a = {}, matches: n = [] } = ((i = h(this, ye)) == null ? void 0 : i.state) || {}, r = ((s = n[n.length - 1]) == null ? void 0 : s.params) || {}; + return a.search && new URLSearchParams(a.search).forEach((o, l) => { + r[l] = o; + }), t ? u.get(r, t) : r; + }); + S(this, "createBrowserRouter", (t = {}) => { + if (h(this, X).size == 0) return null; + const a = Oe.get("Common.WEBSITE_DEFAULT_THEME", "@pkg/ff/frameworks/DefaultTheme"), n = Oe.get(ee.checkUserToken() ? "Common.WEBSITE_LOGIN_REDIRECT" : "Common.WEBSITE_DEFAULT", "/index"), r = { [a]: 0 }, i = (o, l) => () => ee.getWidgetComponent(o).then((c) => c.default || function() { + return `${o}`; + }).then((c) => ({ Component: () => k.createElement(Gt, {}, k.createElement(c, l)) })), s = Array.from(h(this, X).values()).reduce((o, { uuid: l, uri: c, name: p, type: g, component: m, widgetSetting: y, isLogin: f, isLayout: w, extra: C }) => { + let v = {}, E = 0; + switch (g) { + case "list": + v.element = k.createElement(pn, { component: m }); + break; + case "fsdpf-component": + v.element = k.createElement(hn, { key: m, component: m, $setting: y }); + } + if (C != null && C.layout) { + if (!r[C == null ? void 0 : C.layout]) return r[C == null ? void 0 : C.layout] = o.length, [...o, { path: "/", lazy: i(C == null ? void 0 : C.layout, {}), children: [{ path: c, ...v }] }]; + E = r[C == null ? void 0 : C.layout]; + } + return w && E > -1 ? (o[E].children.push({ path: c, ...v }), o) : [...o, { path: c, ...v }]; + }, [{ path: "/", lazy: i(a, {}), children: [] }]); + return s.push({ index: !0, element: k.createElement(fn, { to: n, replace: !0 }) }), D(this, ye, Ma(s, t)); + }); + if (h(ie, he)) return h(ie, he); + } +}; +he = new WeakMap(), X = new WeakMap(), fe = new WeakMap(), ye = new WeakMap(), Me = new WeakMap(), ze = new WeakMap(), F(ie, he, null), S(ie, "getInstance", () => (h(ie, he) || D(ie, he, new ie()), h(ie, he))); +let yt = ie; +const fn = ({ to: e, replace: t }) => za() ? k.createElement(Ba, { to: e, replace: t }) : (window.document.location = e, "redirect"), de = yt.getInstance(), Se = new Worker(new URL("/ff-worker/index.js", self.location)), Mt = { getConfigure: (e) => Oe.get(e), route: { redirect: (...e) => de.redirect(...e), getPageParams: (...e) => de.getPageParams(...e), getCurrentRoute: () => de.getCurrentRoute() }, popup: { notification: (...e) => _.notification(...e), success: (...e) => _.success(...e), error: (...e) => _.error(...e), form: (...e) => _.form(...e), modal: (...e) => _.modal(...e), confirm: (...e) => _.confirm(...e) } }; +var at, Te, we; +const q = class q { + constructor() { + S(this, "exec", (t, a = {}, n = {}, r = "") => new Promise((i, s) => { + const o = Ot(q, at)._++; + h(q, Te).set(o, n), q.mQueue.set(o, [i, s]), Se.postMessage({ id: o, session: r, category: "eval", method: t, args: a }); + })); + S(this, "clear", (t) => Se.postMessage({ session: t, category: "clear" })); + if (h(q, we)) return h(q, we); + Promise.resolve().then(() => Bn).then((t) => { + Mt.http = t.http; + }), Se.addEventListener("message", ({ data: { id: t, task_id: a, method: n, args: r, category: i, data: s, error: o, session: l } }) => { + if (i === "eval" && q.mQueue.has(t)) o !== null ? q.mQueue.get(t)[1](o) : q.mQueue.get(t)[0](s), h(q, Te).delete(t), q.mQueue.delete(t); + else if (i === "util") try { + const c = u.get(Mt, n.split("/")) || u.get(h(q, Te).get(a), n.split("/")); + if (!u.isFunction(c)) throw `${n} not found`; + Promise.resolve(Reflect.apply(c, void 0, r)).then((p) => { + Se.postMessage({ id: t, task_id: a, category: i, method: n, args: r, session: l, data: p, error: null }); + }).catch((p) => { + Se.postMessage({ id: t, task_id: a, category: i, method: n, args: r, session: l, data: null, error: p }); + }); + } catch (c) { + Se.postMessage({ id: t, task_id: a, category: i, method: n, args: r, session: l, data: null, error: c }); + } + }, !1); + } +}; +at = new WeakMap(), Te = new WeakMap(), we = new WeakMap(), S(q, "mQueue", /* @__PURE__ */ new Map()), F(q, at, 0), F(q, Te, /* @__PURE__ */ new Map()), F(q, we, null), S(q, "getInstance", () => (h(q, we) || D(q, we, new q()), h(q, we))); +let wt = q; +const Ce = wt.getInstance(), nt = () => { + const e = U(!0), [, t] = k.useReducer((a) => a + 1, 0); + return L(() => () => e.current = !1, []), () => e.current && t(); +}, mr = (e) => { + const t = U(); + return L(() => { + t.current = e; + }, [e]), t.current; +}, hr = (e) => { + const [t, a] = T(e), n = U(null), r = Y((i, s) => { + n.current = s, a(i); + }, []); + return L(() => { + n.current && (n.current(t), n.current = null); + }, [t]), [t, r]; +}, qe = (e = (n) => { +}, t, a = u.isEqual) => { + const n = k.useRef(); + a(t, n.current) || (n.current = u.cloneDeep(t)), k.useEffect(e, [n.current]); +}, rt = qe, ua = (e, t = "string") => { + var a; + if (!Array.isArray(e)) return e; + for (let n = 0; n < e.length; n++) e[n].value = Q((a = e[n]) == null ? void 0 : a.value, t), e[n] && Reflect.has(e[n], "children") && (e[n].children = ua(e[n].children, t)); + return e; +}, fr = (e, t = "json", a = "string", n, r = null) => { + const [i] = Z.useForm(n), [s, o] = T([{ label: "无", value: "", disabled: !0 }]), l = U([]), c = Z.useWatch((p) => l.current.length === 0 ? null : u.pick(p, l.current), i) || null; + return L(() => { + Array.isArray(e) ? o(e) : t === "javascript" && e ? Ce.exec(e, {}, { getFieldValue: (p) => (l.current.includes(p) || l.current.push(p), i.getFieldValue(p)), getFieldValueForBasicForm: (p) => (l.current.includes(p) || l.current.push(p), r ? r.getFieldValue(p) : i.getFieldValue(p)) }).then((p) => { + o(Q(p, "array")); + }) : e && o(Q(e, "array")); + }, [e, t, c]), ua(s, a); +}, yr = (e) => { + const [t, a] = T(), n = { type: "GET" }; + if (typeof e == "string" ? n.url = e : u.isPlainObject(e) && Object.assign(n, e), !(n != null && n.url)) throw "url is required"; + const r = (i) => R.request(n, !1).resp((s) => (console.log("useSubscribeRequest", i), a(s), s)); + return qe(() => { + let i = null; + return r().then((s) => { + i = sa.subscribe(u.throttle(r, 180, { leading: !1, trailing: !0 }), s.res); + }), () => i == null ? void 0 : i(); + }, n), t; +}, yn = (e) => { + const [t, a] = k.useState({ gridItems: [], hideItems: [] }); + return k.useEffect(() => { + e && R.get(`/api/_/${e}`).then(({ pk: n, uuid: r, code: i, resource: s, align: o, cols: l, rowHeight: c, marginX: p, marginY: g, listenChangeFields: m, listenChangeFieldsFunc: y, fields: f }) => ({ pk: n, uuid: r, code: i, resource: s, align: o, cols: l, rowHeight: c, marginX: p, marginY: g, listenChangeFields: m, listenChangeFieldsFunc: y, ...f.reduce((w, C) => { + var v; + return (v = C == null ? void 0 : C.field) != null && v.hidden ? w.hides.push(C == null ? void 0 : C.field) : w.items.push(C), w; + }, { items: [], hides: [] }) })).then(a); + }, [e]), t; +}, wn = ({ max: e = 0, min: t = 0, type: a = "", message: n, pattern: r, required: i = !1, validator: s } = {}, o, l) => { + const [c, p] = T([]); + return L(() => { + const g = []; + if (i) { + let m = l; + switch (l) { + case "number": + case "string": + case "array": + break; + case "bool": + m = "boolean"; + break; + case "json": + m = "object"; + } + g.push({ type: m, required: !0, whitespace: !0, message: "该项必填" }); + } + switch (a) { + case "string": + g.push({ type: a, max: e, min: t, message: n || (t && e ? `字符必须在 ${t} ~ ${e} 之间` : `${e ? "最多能有" : "最少要有"} ${t || e} 个字符`) }); + break; + case "pattern": + g.push({ type: "string", pattern: r, message: n }); + break; + case "validator": + s && g.push(({ getFieldValue: m }) => ({ validator: async (y, f) => { + const w = await Ce.exec(s, { value: f, fieldName: o }, { getFieldValue: m }); + return u.isString(w) && w ? Promise.reject(w) : u.isBoolean(w) && !w ? Promise.reject(n) : Promise.resolve(); + } })); + } + p(g); + }, [e, t, a, n, r, i, s]), c; +}, bn = (e, t, a) => { + const [n, r] = T(null); + return L(() => { + const { initDataUri: i = `/api/${e}`, initDataMethod: s = "GET" } = a || {}; + t && R.request({ method: s, url: u.trimEnd(`${i}/${t}`, "/") }).then((o) => { + r(o); + }); + }, [e, t, a]), n; +}, ga = (e, t, a = {}, n = {}, r = {}) => { + const i = oe(Jt), s = nt(), o = U(!0), l = U([]), [c, p] = T(t), g = Z.useWatch((m) => JSON.stringify(u.pick(m, l.current)), i) || "{}"; + return rt(() => { + e && Ce.exec(e, a, { ...n, getFieldValueForBasicForm: (m) => r ? r.getFieldValue(m) : null, getFieldValue: u.wrap(i.getFieldValue, (m, y) => (l.current.some((f) => u.isEqual(f, y)) || (l.current.push(y), s()), m == null ? void 0 : m(y))), isFieldTouched: i.isFieldTouched, isFieldsTouched: i.isFieldsTouched }).then((m) => o.current && p(m)); + }, [e, g, i, a, n]), L(() => () => o.current = !1, []), c; +}, Cn = (e, t, a = [], n = {}) => { + const r = U({}); + if (!t) return [e, r.current]; + const i = U(), s = u.debounce(nt(), 180), o = ["disabled", "required"], l = (g, m) => { + o.includes(g) && (r.current[g] = m), s(); + }, c = H(() => ({ setDisabled: (g) => l("disabled", g), setRequired: (g) => l("required", g), getDisabled: () => r.current.disabled, getRequired: () => r.current.required }), [t]), p = ga(t, -1, {}, c, n) ?? -1; + if (i.current != p && (p >= 0 || !u.isEmpty(a == null ? void 0 : a[p]))) { + i.current = p; + const { widget: g, widgetPrefix: m, props: y } = a == null ? void 0 : a[p]; + e = Xt(g, m), r.current = u.merge(y, u.pick(r.current, o)); + } + return [e, r.current]; +}, wr = ({ value: e, onChange: t }, a = null) => { + const n = U(), [r] = Z.useForm(a); + return rt(() => { + u.isEqual(n.current, e) || r.setFieldsValue(e); + }, [e]), L(() => () => r.resetFields(), []), [H(() => r.__INTERNAL__ ? r : { ...r, __INTERNAL__: {} }, [r]), (i, s) => { + n.current = s, t(s); + }]; +}, kn = ({ type: e, initialValue: t, initialValueLanguage: a, onChange: n, basicForm: r }) => { + const i = ga(a == "javascript" && t, a == "javascript" ? void 0 : t, {}, {}, r); + return L(() => { + a == "javascript" ? n(Q(i, e)) : t && n(Q(t, e)); + }, [e, t, i]), null; +}, xn = ({ widget: e = "Input", widgetPrefix: t = "@pkg/ff/grid-layout-forms", widgetDecorator: a, subWidgets: n = [], basicForm: r, ...i }) => { + const s = Xt(e, t), [o, l] = Cn(s, a, n, r), [c, p] = T(); + return L(() => { + o && ee.getWidgetComponent(o).then(({ defaultProps: g = {}, default: m }) => ({ default: pa(m, g, r) })).catch((g) => ({ default: () => `${g}` })).then((g) => p(k.createElement(g.default, i))); + }, [o]), c && k.cloneElement(c, { ...i, ...l }); +}, pa = (e, t = {}, a = null) => (n) => { + const { type: r, code: i, label: s, noStyle: o, placeholder: l, required: c = !1, extras: p, validators: g, help: m, isVirtual: y, $isReserved: f, initialValue: w, initialValueLanguage: C, ...v } = u.omit(u.merge({}, t, n), ["convertJs", "convertJsSetting", "widget", "widgetPerfix", "widgetDecorator", "subWidgets", "boxStyle"]), E = wn(Object.assign({}, g, c ? { required: !0 } : {}), i, r), $ = H(() => { + const P = Object.keys((t == null ? void 0 : t.extras) || {}); + return u.over([u.partialRight(u.pick, P), u.partialRight(u.omit, P)]); + }, [t == null ? void 0 : t.extras]), [z, A] = $(v), B = { label: s, noStyle: o, colon: !1, layout: "vertical" }, I = Y((P) => P == null ? void 0 : Q(P, r), [r]); + return d(Kt, { name: i, rules: E, initialValue: I(w), normalize: I, children: (P, x, V) => { + var M; + return d(e, { type: r, rcform: V, basicForm: a, itemProps: { validateStatus: x.errors.length > 0 ? "error" : "success", tooltip: m, help: x.errors.length > 0 ? x.errors.join("、") : null, required: ((M = E == null ? void 0 : E[0]) == null ? void 0 : M.required) || !1, ...B }, fieldProps: { placeholder: l, ...A, ...P }, $setting: Object.assign({}, p, z) }); + } }); +}, $t = ({ cols: e = 24, rowHeight: t = 16, itemMargin: a = [8, 16], containerPadding: n = [0, 0], fields: r = [], children: i, basicForm: s = null }) => { + const o = ca(r, pa, "@pkg/ff/grid-layout-forms", s); + return O("div", { className: "ff-grid-layout-form", style: { "--grid-layout-item-margin-x": `${(a == null ? void 0 : a[0]) ?? 8}px`, "--grid-layout-item-margin-y": `${(a == null ? void 0 : a[1]) ?? 16}px`, "--grid-layout-container-padding-y": `${(n == null ? void 0 : n[0]) || 0}px`, "--grid-layout-container-padding-x": `${(n == null ? void 0 : n[1]) || 0}px`, "--grid-layout-cols": e, "--grid-layout-row-height": `${t}px` }, children: [o, i && k.cloneElement(i, { cols: e, rowHeight: t, itemMargin: a, containerPadding: n, fields: r })] }); +}; +$t.propTypes = { fields: b.array }; +const vn = (zt = $t, ({ code: e, layout: t, name: a, primaryKey: n = 0, style: r = {}, formProps: i = {}, form: s, basicForm: o, isPreview: l = !1, className: c, onFinish: p, onValuesChange: g = () => { +}, ...m }) => { + const { align: y, autoComplete: f, resource: w, items: C, hides: v, rowHeight: E, marginX: $, marginY: z, cols: A, listenChangeFields: B, listenChangeFieldsFunc: I, pk: P, uuid: x } = yn(e), [V] = Z.useForm(s), M = H(() => [{ name: "__PK__", value: P }, { name: "__PROPS__", value: i }, { name: "__RESOURCE__", value: w }, { name: "__LAYOUT_KEY__", value: e }, { name: "__LAYOUT_UUID__", value: x }, { name: "__PRIMARY_KEY__", value: n }], [P, e, x, w, n, i]); + return O(Z, { className: c, name: a || e, layout: t || y, fields: M, form: V, autoComplete: f, style: { ...r, position: "relative" }, onFinish: p, onValuesChange: (W, ue) => (({ changedValues: J, allValues: Ue, listenChangeFields: it, listenChangeFieldsFunc: We, onValuesChange: st, code: Tt }) => { + st(J, Ue), We && Array.isArray(it) && Ce.exec(We, { changedValues: J, allValues: Ue }, { getFieldValue: V.getFieldValue, setFieldValue: V.setFieldValue, setFieldsValue: V.setFieldsValue, isFieldTouched: V.isFieldTouched, isFieldsTouched: V.isFieldsTouched }); + })({ changedValues: W, allValues: ue, listenChangeFields: B, listenChangeFieldsFunc: I, onValuesChange: g, code: e }), children: [d(zt, { ...m, form: V, basicForm: o, code: e, fields: C, cols: A, rowHeight: E, itemMargin: [$, z] }), v == null ? void 0 : v.map((W) => { + var ue; + return d(Kt, { name: W.code, children: d(kn, { form: V, basicForm: o, name: W.code, type: W.type, initialValue: W.initialValue, initialValueLanguage: (ue = W.extras) == null ? void 0 : ue.initialValueLanguage }) }, JSON.stringify(W.code)); + })] }, e); +}); +var zt; +const ma = ({ $setting: e, $close: t, extras: a, code: n, primaryKey: r, ...i }) => { + const [s] = Z.useForm(), o = bn(n, r, e); + return L(() => { + o && s.setFieldsValue(o); + }, [o]), d(G, { actions: O(k.Fragment, { children: [d(N, { name: "保存", type: "primary", widget: () => { + const l = s.getFieldValue("__RESOURCE__"), { initDataUri: c = `/api/${n}` } = e || {}; + s.validateFields(!0).then((p) => l ? u.pick(p, [l]) : p).then((p) => R.post(r ? `${c}/${r}` : `${c}`, p).msg(t)).catch(() => _.error("请先完善表单信息", { duration: 2e3 })); + } }), d(N, { name: "取消", widget: () => t(!1) })] }), extras: a, children: d(vn, { form: s, code: n, primaryKey: r, ...i }) }); +}, Sn = (e, t, a, { isReplaceRouteHistory: n = !1 } = {}) => de.redirect(a, t, { replace: n }), $n = (e, t = {}, a, n = {}) => { + var i; + const r = (i = n.router) == null ? void 0 : i.reduce((s, [o, l, c]) => { + const p = u.get(t, ["router", o]); + if (!p && p !== 0 && l) throw `请传入 ${c}`; + return `${s}/${p}`; + }, `/api/${a}`); + return R.del(r, t.param).msg(); +}, Bt = (e, t, a, { status: { loading: n, disabled: r }, setStatus: i }) => { + const s = { loading: (o) => o === void 0 ? n : i((l) => ({ ...l, loading: o })), disabled: (o) => o === void 0 ? r : i((l) => ({ ...l, disabled: o })) }; + return u.isFunction(a) ? a.call(null, { ...t, ...s }) : u.isString(a) && a ? Ce.exec(a, t, s) : null; +}, qt = (e, t, a, n, r) => u.isString(a) && a ? ee.getWidgetComponent(a).then(({ default: i }) => _.modal(i, { ...t, $setting: n }, r != null && r.title ? { ...r, title: u.template(r.title)(e) } : r)).catch((i) => { + _.error(a, { content: i.toString() }); +}) : _.modal(a, { ...t, $setting: n }, r != null && r.title ? { ...r, title: u.template(r.title)(e) } : r), Pn = (e, t, a, n, r) => _.modal(ma, { ...t, $setting: n, code: a }, r != null && r.title ? { ...r, title: u.template(r.title)(e) } : r), Nn = (e, t, a, n, r) => _.modal(St, { base62params: t, $setting: n, listCode: a }, r != null && r.title ? { ...r, title: u.template(r.title)(e) } : r), Tn = ({ widget: e, widgetType: t, widgetData: a, widgetProps: n, widgetSetting: r, widgetContainerProps: i }, { onAfterClick: s, onBeforeClick: o }) => { + const l = oe(te), [c, p] = T({ leading: !0, trailing: !1 }), g = H(() => { + switch (t) { + case "redirect": + return u.partialRight(Sn, e, r); + case "func": + return u.partialRight(Bt, (r == null ? void 0 : r.code) ?? e, { status: c, setStatus: p }); + case "fsdpf-component": + return u.partialRight(qt, e, r, i); + case "grid-layout-form": + return u.partialRight(Pn, e, r, i); + case "data-list": + return u.partialRight(Nn, e, r, i); + case "destroy": + return u.partialRight($n, e, r, i); + default: + if (Nt(e) || k.isValidElement(e)) return u.partialRight(qt, e, r, i); + if (u.isFunction(e)) return u.partialRight(Bt, (r == null ? void 0 : r.code) || e, { status: c, setStatus: p }); + } + return (...m) => console.error("useButton unknown widgetType", t, ...m); + }, [e, t]); + return [u.debounce((m) => (o == null || o(m), Promise.resolve(Qt(n, m, { list: l })).then((y) => g(m, { ...a, ...y })).then((y) => s == null ? void 0 : s(y)).catch(console.error)), 300, { leading: !0, trailing: !1 }), c]; +}, Dt = /* @__PURE__ */ new Set(), bt = (e = [], t = 0) => { + const a = e[t]; + if (a.length && !Dt.has(a)) { + const n = document.createElement("script"); + n.setAttribute("src", a), n.setAttribute("data-namespace", a), e.length > t + 1 && (n.onload = () => { + bt(e, t + 1); + }, n.onerror = () => { + bt(e, t + 1); + }), Dt.add(a), document.body.appendChild(n); + } +}, Ct = ({ className: e, type: t, style: a = {}, ...n }) => d("span", { role: "img", className: j("ff-iconfont", e), style: a, ...n, children: d("svg", { style: { width: "1em", height: "1em", fill: "currentColor", overflow: "hidden" }, viewBox: "0 0 1024 1024", children: d("use", { xlinkHref: `#${t}` }) }) }); +Ct.propTypes = { className: b.string, type: b.string.isRequired, style: b.object }, Ct.init = bt; +const De = (e) => function({ className: t, children: a, name: n, icon: r, type: i = "default", iconPosition: s = "start", noAuthType: o, onAfterClick: l, onBeforeClick: c, data: p, loading: g, disabled: m, tooltip: y, confirm: f, widget: w, widgetType: C, widgetData: v, widgetProps: E, widgetSetting: $, widgetContainerProps: z, ...A }) { + const B = u.isEmpty(y) || !y.enabled ? {} : y, I = u.isEmpty(f) ? { enabled: !1 } : Object.assign({ enabled: !0 }, f), P = { type: "primary", className: j("ff-button", t), iconPosition: s }; + i === "danger" ? P.danger = !0 : i === "default" && (P.type = i), e === "link" || e === "dashed" ? (P.type = e, i === "default" && (P.className = j(P.className, "ff-default"))) : e !== "circle" && e !== "round" || (P.shape = e), r && (P.icon = d(Ct, { type: r })); + const [x, V] = T(!1), [M, { disabled: W, loading: ue }] = Tn({ widget: w, widgetType: C, widgetData: v, widgetProps: E, widgetSetting: $, widgetContainerProps: z }, { onAfterClick: l, onBeforeClick: c }); + return d(Oa, { okText: "确定", cancelText: "取消", getPopupContainer: (J) => J, ...I, disabled: W || m, open: x, onOpenChange: (J) => { + if (!J) return V(J); + I.enabled ? V(J) : M(p); + }, onConfirm: () => { + M(p); + }, onClick: (J) => { + J.stopPropagation(); + }, children: d(La, { getPopupContainer: (J) => J, ...B, title: x ? null : B == null ? void 0 : B.title, trigger: ["hover", "click"], children: d(ut, { loading: ue || g, disabled: W || m, ...P, ...A, children: a || n }) }) }); +}, N = De("default"), En = De("link"), Fn = De("circle"), Rn = De("round"), On = De("dashed"), Ut = ({ data: e, widget: t, widgetType: a = "fsdpf-component", widgetData: n, widgetProps: r, widgetSetting: i, widgetContainerProps: s, onAfterClick: o, onBeforeClick: l, children: c, extras: p }) => { + const g = oe(te), [m, y] = T(!1), [f, w] = T("hover"), [C, v] = T({}), [E, $] = T(), { placement: z, align: A, arrow: B = { pointAtCenter: !0 }, getPopupContainer: I, ...P } = s || {}; + L(() => { + a == "grid-layout-form" ? $(k.createElement(ma, { ...n, $setting: i, code: t })) : a == "data-list" ? $(k.createElement(St, { base62params: e, $setting: i, listCode: t })) : u.isString(t) ? ee.getWidgetComponent(t).then(({ default: M }) => { + $(k.createElement(M, { ...n, $setting: i })); + }).catch((M) => $(M.toString())) : Nt(t) ? $(k.createElement(t, { ...n, $setting: i })) : k.isValidElement(t) && $(k.cloneElement(t, { ...n, $setting: i })); + }, [t, a, n]), L(() => { + Promise.resolve(Qt(r, e, { list: g })).then(v); + }, [r, e]); + const x = (M, W = !1) => (y(M), !M && w("hover"), M ? l == null ? void 0 : l(C) : o == null ? void 0 : o(W)), V = (M) => { + y(!0), w("click"); + }; + return d(Va, { zIndex: 1080, placement: z, onPopupClick: V, onClick: V, open: m, align: A, arrow: B, trigger: f, getPopupContainer: I, content: d(Ln, { ...P, extras: p, children: E && k.cloneElement(E, { ...C, $close: (M) => x(!1, M) }) }), children: c, onOpenChange: x }); +}, Ln = ({ title: e, className: t, children: a, extras: n, width: r, height: i, ...s }) => { + const [o, l] = T({}), c = Y((y, f) => l((w) => ({ ...w, [y]: f })), []), p = Y((y) => l((f) => ({ ...f, [y]: void 0 })), []), g = e ? k.createElement("div", { className: "ff-popup-title" }, e) : o == null ? void 0 : o.title, m = n ?? k.createElement("div", { className: "ff-popup-reserved-extras" }, n); + return d(Be.Provider, { value: { ele: o, mount: c, unmount: p }, children: O("div", { className: j("ff-popup ff-popover", t), style: { width: r, height: i }, ...s, children: [O("div", { className: "ff-popup-header", children: [g, o == null ? void 0 : o["sub-title"]] }), a, O("div", { className: "ff-popup-footer", children: [m, o == null ? void 0 : o.extras, o == null ? void 0 : o.actions] })] }) }); +}; +Ut.propTypes = { widgetType: b.oneOf(["fsdpf-component", "grid-layout-form", "data-list"]) }, N.propTypes = { type: b.oneOf(["primary", "default", "danger", ""]), name: b.string, icon: b.string, iconPosition: b.oneOf(["start", "end"]), data: b.any, widget: b.any, widgetType: b.oneOf(["destroy", "redirect", "func", "fsdpf-component", "grid-layout-form", "grid-layout", "data-list"]), widgetData: b.object, widgetProps: b.object, widgetSetting: b.object, widgetContainerProps: b.object, tooltip: b.exact({ title: b.string.isRequired, placement: b.oneOf(["top", "left", "right", "bottom", "topLeft", "topRight", "bottomLeft", "bottomRight", "leftTop", "leftBottom", "rightTop", "rightBottom"]), enabled: b.oneOfType([b.bool, b.number]), getPopupContainer: b.func }), confirm: b.exact({ title: b.string.isRequired, cancelText: b.string, okText: b.string, okType: b.oneOf(["primary", "default", "danger", ""]), placement: b.oneOf(["top", "left", "right", "bottom", "topLeft", "topRight", "bottomLeft", "bottomRight", "leftTop", "leftBottom", "rightTop", "rightBottom"]), enabled: b.oneOfType([b.bool, b.number]), getPopupContainer: b.func, arrow: b.oneOfType([b.bool, b.exact({ pointAtCenter: b.bool })]) }) }, N.Link = En, N.Link.defaultProps = N.defaultProps, N.Link.propTypes = N.propTypes, N.Circle = Fn, N.Circle.defaultProps = N.defaultProps, N.Circle.propTypes = N.propTypes, N.Round = Rn, N.Round.defaultProps = N.defaultProps, N.Round.propTypes = N.propTypes, N.Dashed = On, N.Dashed.defaultProps = N.defaultProps, N.Dashed.propTypes = N.propTypes, N.Popover = Ut; +const Vn = ({ fields: e, formProps: t, $close: a }) => { + const [n] = Z.useForm(), r = H(() => [{ name: "__PROPS__", value: t }], [t]); + return d(G, { actions: O(k.Fragment, { children: [d(N, { name: "取消", widget: () => a(!1) }), d(N, { name: "确定", type: "primary", widget: () => n.validateFields(!0).then(a) })] }), children: d(Z, { fields: r, form: n, className: "ff-modal-form", children: e == null ? void 0 : e.map(({ code: i, ...s }) => d(xn, { code: i, ...s }, i)) }) }); +}, jn = ({ className: e, $close: t, children: a, title: n, subTitle: r, actions: i, extras: s, zIndex: o, ...l }) => O(Ua, { ...l, prefixCls: "ff-drawer", className: j("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(vt, { type: "close" }) }), n, r] }), d("div", { className: "ff-popup-body", children: a }), O("div", { className: "ff-popup-footer", children: [s, i] })] }), An = ({ className: e, $close: t, $event: a, children: n, title: r, subTitle: i, actions: s, extras: o, zIndex: l, placement: c, ...p }) => { + const g = (a == null ? void 0 : a.pageX) === void 0 ? { animation: null, maskAnimation: null, mousePosition: { x: null, y: null } } : { animation: "zoom", maskAnimation: "fade", mousePosition: { x: a == null ? void 0 : a.pageX, y: a == null ? void 0 : a.pageY } }; + return d(Wa, { ...p, ...g, prefixCls: "ff-modal", modalRender: () => O("div", { className: j("ff-modal-content ff-popup", e), children: [O("div", { className: "ff-popup-header", children: [d("button", { "aria-label": "Close", className: "ff-popup-close", onClick: p.onClose, children: d(vt, { type: "close" }) }), r, i] }), d("div", { className: "ff-popup-body", children: n }), O("div", { className: "ff-popup-footer", children: [o, s] })] }) }); +}, ha = ({ placement: e, $close: t, $event: a, children: n, title: r, ...i }) => { + const [s, o] = T({}), [l, c] = T(!0), p = Y((f, w) => o((C) => ({ ...C, [f]: w })), []), g = Y((f) => o((w) => ({ ...w, [f]: void 0 })), []); + let m = { ...i, className: s.rootClassName, title: s.title || r && k.createElement("div", { className: j("ff-popup-title") }, r), subTitle: s["sub-title"], actions: s.actions, extras: s.extras, children: n, $close: t, $event: a, onClose: () => c(!1) }; + const y = () => { + t(!1); + }; + return d(Be.Provider, { value: { ele: s, mount: p, unmount: g }, children: e && e !== "center" ? d(jn, { ...m, placement: e, open: l, afterOpenChange: (f) => !f && y() }) : d(An, { ...m, visible: l, afterClose: y }) }); +}; +ha.propTypes = { placement: b.oneOf(["center", "left", "top", "right", "bottom"]) }; +const K = () => { + const [e, t] = qa({ 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" }), [, a] = k.useReducer((i) => i + 1, 0); + L(() => { + K.$onClick = n, K.$queue.forEach(([i, s, o], l, c) => { + r([s, o], ...i), delete c[l]; + }); + }, []); + const n = (i, s = {}, o = {}) => new Promise((l, c) => r([l, c], i, s, o)), r = ([i, s], o, l = {}, c = {}) => { + const p = K.$index++, g = (m) => ((y, f) => (K.$popups.delete(y), a(), f == null ? void 0 : f()))(p, () => i(m)); + if (o === Yt) return e.open({ ...c, key: p, content: k.createElement(o, { ...l, $close: () => e.close(p) }) }); + K.$popups.set(p, k.createElement(ha, { zIndex: p, maskClosable: !1, $event: l == null ? void 0 : l.$event, ...c, key: p, $close: g }, k.isValidElement(o) ? k.cloneElement(o, { ...l, $close: g }) : o != null && o.name || Lt.isForwardRef(o) || (o == null ? void 0 : o.$$typeof) === Lt.ForwardRef ? k.createElement(o, { ...l, $close: g }) : o)), a(); + }; + return O(k.Fragment, { children: [Array.from(K.$popups).map(([i, s]) => s), t] }); +}; +K.$popups = /* @__PURE__ */ new Map(), K.$index = 0, K.$queue = [], K.$onClick = (...e) => new Promise((t, a) => { + K.$queue.push([e, t, a]); +}); +const Wt = (e, t, a = {}) => K.$onClick(e, t, a), ct = (e, { showProgress: t, duration: a, ...n } = { duration: 1.5 }) => K.$onClick(Yt, { content: e, ...n }, { showProgress: t, duration: a }), _ = { modal: Wt, confirm: (e, t = {}) => K.$onClick(Ha, { content: e, ...t }, { placement: "center" }), form: (e, t = {}, a = {}) => Wt(Vn, { formProps: a, fields: e }, { placement: "center", ...t }).then((n) => { + if (n === !1) throw !1; + return n; +}), notification: ct, success: (e, t = { duration: 1.5 }) => ct(e, { ...t, className: "ff-notification-success", icon: "check" }), error: (e, t = { duration: 1.5 }) => ct(e, { ...t, className: "ff-notification-error", icon: "close" }) }; +Fe.configure({ showSpinner: !1 }), Re.interceptors.request.use((e) => { + e.headers.Platform = "web", e.headers.SaaS = window.localStorage.getItem("SaaS"); + const t = window.localStorage.getItem(Ge); + return e.headers.Authorization = t ? `Bearer ${t} ` : void 0, Fe.inc(), e; +}, (e) => (Fe.done(), Promise.reject({ code: -1, msg: e }))), Re.interceptors.response.use(({ data: e, headers: t }) => (Fe.done(), { ...e, res: t == null ? void 0 : t.res }), function(e) { + return Fe.done(), Promise.reject(e.message); +}), window.addEventListener("unhandledrejection", gt.onUnhandledRejection), gt.onMsg = (e, t) => _[[0, 1].includes(e) ? "success" : "error"](t).then(() => e === 20300 && de.redirect(Oe.get("Common.WEBSITE_LOGIN_PAGE"))); +const kt = { appUrl: "", init: (e, t, a) => { + kt.appUrl = a, Re.defaults.baseURL = a, Re.defaults.timeout = 15e3, Object.assign(kt, new gt(e, t, Re)); +} }, R = kt; +class Pt extends Error { + constructor(t, a) { + super(a), Error.captureStackTrace && Error.captureStackTrace(this, Pt), !a instanceof Le && (this.name = `${t} Error Runtime`); + } +} +class Le extends Error { + constructor(t, ...a) { + super(...a), Error.captureStackTrace && Error.captureStackTrace(this, Le), this.name = `${t} Not Found`; + } +} +const dt = "mine", Ge = "token"; +var be, Ee; +const se = class se { + constructor() { + F(this, Ee, /* @__PURE__ */ new Map()); + S(this, "setVendor", (t, a) => h(this, Ee).set(t, new _t(a, async (n, r) => { + var s, o; + if (!(n != null && n.default)) throw "@pkg not found"; + let i = () => r; + switch ("function") { + case typeof (i = (s = n.default) == null ? void 0 : s[`./${r}/index.jsx`]): + case typeof (i = (o = n.default) == null ? void 0 : o[`./${r}/index.js`]): + return i(); + } + throw new Le(r); + }))); + S(this, "getWidgetComponent", async (t) => { + if (!t) throw "getWidgetComponent widget is required"; + if (t != null && t.startsWith("blob:") || t != null && t.startsWith("http:") || t != null && t.startsWith("https:")) return await import(t); + const [, a] = t == null ? void 0 : t.split("@pkg/"); + if (!a) throw new Le(t); + try { + return h(this, Ee).has("pkg") ? await h(this, Ee).get("pkg").get(a) : await import(`${R.appUrl}/api/pkg-import/web?name=${t}`); + } catch (n) { + throw new Pt(t, n); + } + }); + S(this, "getRoutes", () => R.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: a, ...n }) => [a, { uuid: a, ...n }])).then((t) => new Map(t))); + S(this, "getMenus", () => R.get("/api/my-menu")); + S(this, "getConfigure", () => R.get("api/init-configure")); + S(this, "getWidgetOperationAuth", () => R.get("/api/init-widget-operation-auth").then((t) => t.reduce((a, { uuid: n, auth: r }) => [...a, [n, r]], []))); + S(this, "getPhoneNumber", (t) => R.get(`/api/user-wx-phone-number/${t}`)); + S(this, "getUserToken", () => { + const t = window.localStorage.getItem(Ge); + if (!t) return ""; + const a = t.split("."); + if (!Array.isArray(a) || a.length !== 3) throw "登录令牌无效!"; + const { iat: n } = JSON.parse(window.atob(a[1])); + if (Math.floor((/* @__PURE__ */ new Date()).getTime() / 1e3) - n > 2592e3) throw "登录令牌已过期, 请重新登录!"; + return t; + }); + S(this, "checkUserToken", () => { + try { + return !!this.getUserToken(); + } catch { + return !1; + } + }); + S(this, "getUserInfo", (t = !0) => { + var a; + try { + const n = this.getUserToken(); + if (!n) return Promise.resolve(null); + const { iat: r } = JSON.parse(window.atob((a = n == null ? void 0 : n.split(".")) == null ? void 0 : a[1])), { iat: i, ...s } = R.decode(window.localStorage.getItem(dt) || "", {}); + return i === r ? Promise.resolve(s) : R.get("/api/mine-info").then(({ User: o = null }) => (window.localStorage.setItem(dt, R.encode({ ...o, iat: r })), o)); + } catch (n) { + console.error(n), t && _.error("请登录").then(this.logout); + } + return Promise.resolve(null); + }); + S(this, "login", (t, a, n = {}) => R.post("/api/user-token", { username: t, passwd: Da.hash(a), platform: "web", ...n }).then(({ token: r }) => (window.localStorage.setItem(Ge, r), r))); + S(this, "logout", (t) => (window.localStorage.removeItem(dt), window.localStorage.removeItem(Ge), t == null ? void 0 : t())); + if (h(se, be)) return h(se, be); + } +}; +be = new WeakMap(), Ee = new WeakMap(), F(se, be, null), S(se, "getInstance", () => (h(se, be) || D(se, be, new se()), h(se, be))); +let xt = se; +const ee = xt.getInstance(), In = k.createContext({ user: {}, initUser: () => { +}, initUserComplete: !1 }), Mn = k.createContext({ set: () => { +}, get: () => { +}, assign: () => { +}, currentRoute: () => { +} }), Nt = (e) => !!(e != null && e.name) && (e.prototype instanceof k.Component || /^[A-Z]/.test(e.name)), zn = (e, t) => { + if (!e || typeof window > "u") return; + let a = document.querySelector(`style[ff-style-token="${t}"]`); + return a ? (a.innerHTML = e, e) : (a = document.createElement("style"), a.setAttribute("ff-style-token", t), a.setAttribute("type", "text/css"), a.innerHTML = e, document.head.appendChild(a), e); +}, Bn = Object.freeze(Object.defineProperty({ __proto__: null, AppContext: In, AppGlobalParamsContext: Mn, cache: _t, configure: Oe, default: ee, func: Ce, http: R, insertStyle: zn, isReactComponent: Nt, route: de }, Symbol.toStringTag, { value: "Module" })); +export { + ga as $, + Xa as A, + Za as B, + _a as C, + Xe as D, + dr as E, + ur as F, + gr as G, + ln as H, + aa as I, + ht as J, + Ga as K, + Ya as L, + nt as M, + mr as N, + hr as O, + qe as P, + rt as Q, + sa as R, + fr as S, + yr as T, + vn as U, + $t as V, + xn as W, + ma as X, + yn as Y, + wn as Z, + bn as _, + Xt as a, + Cn as a0, + wr as a1, + Ct as a2, + N as a3, + Ja as a4, + Tn as a5, + G as a6, + Be as a7, + Gt as a8, + K as a9, + _ as aa, + nr as ab, + rr as ac, + ir as ad, + ee as ae, + Nt as af, + zn as ag, + R as ah, + _t as ai, + Oe as aj, + Ce as ak, + de as al, + In as am, + Mn as an, + Qt as b, + or as c, + Zt as d, + lr as e, + cr as f, + Ka as g, + na as h, + en as i, + oa as j, + da as k, + pr as l, + la as m, + ca as n, + ia as o, + ra as p, + sn as q, + lt as r, + rn as s, + Q as t, + sr as u, + an as v, + St as w, + te as x, + on as y, + gn as z +}; diff --git a/dist/common/main-Bd51PHML.js b/dist/common/main-Bd51PHML.js deleted file mode 100644 index b64306a..0000000 --- a/dist/common/main-Bd51PHML.js +++ /dev/null @@ -1,1008 +0,0 @@ -var kn = Object.defineProperty; -var Et = (e) => { - throw TypeError(e); -}; -var xn = (e, t, n) => t in e ? kn(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), 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), U = (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) { - U(e, t, r, n); - }, - get _() { - return m(e, t, a); - } -}); -import { jsx as d, jsxs as O } from "react/jsx-runtime"; -import k, { useEffect as R, useState as T, useCallback as G, useMemo as Y, useRef as q, useContext as de, useId as Ge, useLayoutEffect as vn } from "react"; -import g 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 A from "classnames"; -import Z, { FieldContext as Vn, Field as Ht } from "rc-field-form"; -import { useParams as An, generatePath as jn, createBrowserRouter as In, useInRouterContext as Mn, Navigate as zn } from "react-router-dom"; -import b from "prop-types"; -import * as Ot from "react-is"; -import { useNotification as Bn } from "rc-notification"; -import { N as Re, a as Fe, T as ct, S as Wn } from "./vender-DMK1apIA.js"; -import "rc-util/lib/hooks/useMergedState"; -import Un from "rc-drawer"; -import Dn from "rc-dialog"; -var $e, Ve, Pe, oe, ke, xe; -class Jt { - constructor(t, n) { - E(this, $e, /* @__PURE__ */ new Map()); - E(this, Ve, !0); - E(this, Pe, []); - E(this, oe); - E(this, ke, () => m(this, oe)); - E(this, xe, () => Promise.resolve()); - v(this, "get", (...t) => new Promise((n, a) => { - const r = JSON.stringify(t); - if (m(this, $e).has(r)) return n(m(this, xe).call(this, m(this, oe), ...t)); - if (m(this, oe) === void 0) m(this, Pe).push([t, n, a]), m(this, Ve) && (U(this, Ve, !1), Promise.resolve(typeof m(this, ke) == "function" ? m(this, ke).call(this) : m(this, ke)).then((s) => U(this, oe, s || null)).finally(() => { - m(this, Pe).forEach(([s, i, o]) => { - try { - const l = m(this, xe).call(this, m(this, oe), ...s); - m(this, $e).set(JSON.stringify(s), l), i(l); - } catch (l) { - o(l); - } - }), m(this, Pe).length = 0; - })); - else { - const s = m(this, xe).call(this, m(this, oe), ...t); - m(this, $e).set(r, s), n(s); - } - })); - U(this, xe, n), U(this, ke, t); - } -} -$e = new WeakMap(), Ve = new WeakMap(), Pe = new WeakMap(), oe = new WeakMap(), ke = new WeakMap(), xe = new WeakMap(); -const er = () => d("div", { children: "Empty" }), Be = k.createContext({ ele: {}, mount: () => { -}, unmount: () => { -} }), _ = ({ rootClassName: e, className: t, children: n, actions: a, title: r, subTitle: s, extras: i, style: o = {} }) => { - const { mount: l, unmount: c } = k.useContext(Be); - return a && _.Action({ children: a }), r && _.Title({ children: r }), s && _.SubTitle({ children: s }), i && _.Extra({ children: i }), R(() => (l("rootClassName", e), () => c(e)), [e]), d("div", { className: A("ff-container", t), style: o, children: n }); -}, Je = (e) => ({ children: t, className: n }) => { - const { mount: a, unmount: r } = k.useContext(Be); - return R(() => (a(e, k.createElement("div", { key: `ff-${e}`, className: A(`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: b.string, style: b.object, title: b.any, subTitle: b.any, actions: b.any, extras: b.any }; -const tr = () => d(_, { 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] = T({}), a = G((s, i) => n((o) => ({ ...o, [s]: i })), []), r = G((s) => n((i) => ({ ...i, [s]: void 0 })), []); - return typeof (e == null ? void 0 : e.type) == "string" ? e : d(Be.Provider, { value: { ele: t, mount: a, unmount: r }, children: k.cloneElement(e, { className: t.rootClassName, title: t.title, subTitle: t["sub-title"], actions: t.actions, extras: t.extras }) }); -}; -Kt.propTypes = { children: b.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(k.Fragment, { children: [n && d("div", { className: A("ff-notification-icon", e), children: d(Ct, { type: n }) }), t] }), qn = ({}) => d(_, { children: "Confirm" }); -var ge, Ne; -const ne = class ne { - constructor() { - E(this, Ne, /* @__PURE__ */ new Map()); - v(this, "init", (t) => U(this, Ne, new Map(t))); - v(this, "check", (t) => !m(this, Ne).has(t) || m(this, Ne).get(t)); - if (m(ne, ge)) return m(ne, ge); - } -}; -ge = new WeakMap(), Ne = new WeakMap(), E(ne, ge, null), v(ne, "getInstance", () => (m(ne, ge) || U(ne, ge, new ne()), m(ne, ge))); -let dt = ne; -const Hn = dt.getInstance(); -var pe, Ae; -const ae = class ae { - constructor() { - E(this, Ae, null); - v(this, "init", (t) => U(this, Ae, t)); - v(this, "get", (t, n) => g.get(m(this, Ae), t, n)); - if (m(ae, pe)) return m(ae, pe); - } -}; -pe = new WeakMap(), Ae = new WeakMap(), E(ae, pe, null), v(ae, "getInstance", () => (m(ae, pe) || U(ae, pe, new ae()), m(ae, pe))); -let ut = ae; -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" }, Q = (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(Vt, a) ? Vt[a](e) : e; -}, Gt = (e = {}, t = {}, n = {}, a = "") => Yt(e, (r, s) => s === "type" && r === "code") ? Xt(e, t, n, a) : Qt(e, t, a), Yt = (e, t = () => !1) => g.some(e, (n) => !!g.some(n, t) || (g.isEmpty(n) || !g.isPlainObject(n) && !g.isArray(n) ? void 0 : Yt(n, t))), Xt = 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: c = a } = e[s]; - switch (o) { - case "code": - i = await Ce.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 = ce.getPageParams(l); - break; - case "string": - i = l; - } - i ?? (i = c); - } else i = await Xt(e[s], t, n, a); - g.set(r, s, i); - } - return r; -}, Qt = (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 = ce.getPageParams(o); - break; - case "string": - s = o; - } - s ?? (s = l); - } else s = Qt(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, 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 : ""; -}, sr = (e) => { - var t, n; - return e ? (n = (t = e.match(/^@pkg(?:[^\/]*\/){2}(?[^\/]+)/)) == null ? void 0 : t.groups) == null ? void 0 : n.category : ""; -}, ir = (e) => { - var t, n; - return e ? (n = (t = e.match(/^@pkg(?:[^\/]*\/){1}(?[^\/]+)/)) == null ? void 0 : t.groups) == null ? void 0 : n.owner : ""; -}; -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]) ? m(this, Ie).call(this, a) : m(this, je).push(m(n = Ze, Xe).call(n, a[0], a[1])); - }); - v(this, "toValue", async (t, n = null) => { - const a = { getValue: () => t, getRecord: () => n }; - return await m(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) => k.createElement(m(this, Qe), { value: t, record: n }, a)); - E(this, Qe, ({ value: t, record: n, children: a }) => { - const [r, s] = T(a); - return vt(() => { - let i = !1; - return s(a), this.toValue(t, n).then((o) => Q(o, "string")).then((o) => !i && s(o)).catch((o) => !i && s(`${o}`)), () => i = !0; - }, [t, n]), r; - }); - m(this, Ie).call(this, t); - } -}; -Xe = new WeakMap(), je = new WeakMap(), Ie = new WeakMap(), Qe = new WeakMap(), E(Ze, Xe, g.memoize((t, n) => ee.getWidgetComponent(t).then((a) => { - var r; - return ((r = a.default) == null ? void 0 : r.call(a, n)) || ((s) => s); -}), (t, n) => `${t}::${Q(n, "string")}`)); -let Ye = Ze; -const Jn = (e, t = {}) => Y(() => 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]), or = (e) => { - const [t, n] = T({}); - 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; -}, lr = (e, t = {}) => { - const [n, a] = T({ 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; -}, Zt = (e, t, n = "id", a) => { - const r = G(a ? (s) => g.get(s, n, g.get(s, [a, n])) : (s) => g.get(s, n), [n, a]); - return G((s) => e == null ? void 0 : e.filter((i) => !i.uuid || !t.has(i.uuid) || t.get(i.uuid).includes(`${r(s)}`)), [e, t, r]); -}, gt = (e, t, n = null, a = "id", r) => { - const s = G(r ? (i) => g.get(i, a, g.get(i, [r, a])) : (i) => g.get(i, a), [a, r]); - return Y(() => { - if (g.isEmpty(t) || !t.some(({ uuid: o }) => Hn.check(o))) return !1; - if (g.isEmpty(n) || g.isEmpty(e)) return !0; - const i = e.map((o) => `${s(o)}`); - return t.some(({ uuid: o }) => !o || !n.has(o) || n.get(o).some((l) => i.includes(`${l}`))); - }, [t, e, n, s]); -}, Kn = (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, c = null) => { - var u, p; - if (s.current = !1, l === 1) return (u = e.onReload) == null ? void 0 : u.call(e); - if (l === 2) { - const f = g.get(c, "__PARENT_ID__", ""), y = g.get(c, n, g.get(c, [a, n], "")), h = g.findIndex(i.current, ["__PARENT_ID__", f]), w = g.findIndex(h > -1 ? g.get(i.current, [h, "children"]) : i.current, [n, y]); - if (w === -1) return (p = e.onReload) == null ? void 0 : p.call(e); - Promise.all([F.get(`/api/${t}/detail/${y}`), F.post(`/api/${t}/list-operations-access`, { ids: y })]).then(([C, S]) => { - const j = g.get(i.current, h > -1 ? [h, "children", w, "children"] : [w, "children"]); - i.current = qt(i.current, h > -1 ? { [h]: { children: { $splice: [[w, 1, { ...C, children: j }]] } } } : { $splice: [[w, 1, { ...C, children: j }]] }); - const P = new Map(S); - o.current.forEach((M, I) => { - var z; - (z = P.get(I)) != null && z.some((L) => L == y) || o.current.set(I, M.filter((L) => L !== y)); - }), P.forEach((M, I) => { - o.current.has(I) ? o.current.set(I, g.uniq([...o.current.get(I) || [], ...M])) : o.current.set(I, M); - }); - }).then(() => { - s.current = !0, r(); - }); - } - }]; -}, _n = (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: c, condition: u, total: p, tab: f, sider: y, page: h, pageSize: w, operationsAccess: C, dataSource: S }) => { - a.current = { tab: f, condition: u, sider: y, keyword: c, total: p, pageSize: w, page: S != null && S.length ? h : 1 }, s.current = S, r.current = new Map(C), n(); - }); - }, 380, { leading: !1, trailing: !0 }); - vt(() => { - s.current = [], e && i(t); - }, [e, t]); - const o = Y(() => 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, c) => i({ page: l, pageSize: c }), onPageSizeChange: (l) => i({ pageSize: l, page: 1 }), onConditionChange: (l, c) => i({ keyword: c, condition: qt(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 }); -}, Gn = ({ listCode: e, className: t, layouts: n, dataSource: a, isPaginate: r, isItemOperations: s, isBatchOperations: i, batchOperations: o, itemOperations: l, itemOperationsAccess: c, resource: u, primaryKey: p, title: f, itemGridLayout: y, $setting: h, tabs: w, isConditionFormLayout: C, isTreeSider: S, treeSiderConfig: j }) => { - const { classNames: P, onClickCallback: M } = de(te), I = Zt(l, c, p, u), z = G((L, V, x) => d(Yn, { className: A("ff-data-list-framework-item", P.item), operations: s ? I(V) : [], data: u ? { [u]: V } : V, children: L, onClickCallback: M }), [u, p, s, M, l, c]); - return O("div", { className: A("ff-data-list-framework", t), children: [d(n.sider, { isTreeSider: S, ...j }), O("div", { className: A("ff-data-list-container", P == null ? void 0 : P.container), children: [d(n.filter, { isConditionFormLayout: C }), d(n.toolbar, { title: f, tabs: w }), d(la, { ...y, style: { "--col-num": (h == null ? void 0 : h.colNum) || 1 }, primaryKey: p, itemRender: z, dataSource: a }), d(n.footer, { isPaginate: r, isOperations: i, operations: o })] })] }); -}, Yn = ({ className: e, operations: t, children: n, data: a, onClickCallback: r }) => O("div", { className: A("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((s) => d("span", { className: "data-list-grid-layout-item-action", children: d(N.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())) })] }), Xn = ({ listCode: e, className: t, layouts: n, dataSource: a, columns: r, isItemOperations: s, isBatchOperations: i, batchOperations: o, itemOperations: l, itemOperationsAccess: c, resource: u, primaryKey: p, title: f, tabs: y, isPaginate: h, isTreeSider: w, treeSiderConfig: C, isConditionFormLayout: S, ...j }) => { - const { classNames: P, onClickCallback: M } = de(te), I = Zt(l, c, p, u), z = gt(a, l, c, p, u); - return O("div", { className: A("ff-data-table-framework", t), children: [d(n.sider, { isTreeSider: w, ...C }), O("div", { className: A("ff-data-table-container", P == null ? void 0 : P.container), children: [d(n.filter, { isConditionFormLayout: S }), d(n.toolbar, { title: f, tabs: y }), d(aa, { ...j, primaryKey: p, className: "ff-data-table-content", columns: r, dataSource: a, operationRender: z ? (L) => { - var V; - return d("div", { className: "ff-data-table-actions", children: (V = I(L)) == null ? void 0 : V.map((x, W) => d(N.Link, { size: "small", uuid: x.uuid, type: x.type, name: x.name, widget: x.widget, widgetType: x.widgetType, widgetProps: x.widgetProps, widgetData: x.widgetData, widgetSetting: x.widgetSetting, widgetContainerProps: x.widgetContainerSetting, data: L, confirm: x.confirm, onAfterClick: ($) => $ !== !1 && (M == null ? void 0 : M(x.isRefresh, L)) }, x.uuid || W)) }); - } : null }), d(n.footer, { isPaginate: h, isOperations: i, operations: o })] })] }); -}, te = k.createContext({ listCode: "", classNames: {}, getBase62params: (e, t) => { -}, onReload: () => { -}, onClickCallback: () => { -}, onConditionChange: () => { -}, onTabChange: () => { -}, onSiderChange: () => { -}, onKeywordChange: () => { -}, onPageChange: () => { -}, onPageSizeChange: () => { -} }), en = (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"] = At(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"] = At(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; -}, At = (e, t, n, a) => `${e || 0}px ${t || 0}px ${n || 0}px ${a || 0}px`, tn = ({ className: e, isConditionFormLayout: t }) => { - var f, y; - const [n, a] = T({}), { listCode: r, onKeywordChange: s, onConditionChange: i, getBase62params: o, classNames: l } = k.useContext(te), { keyword: c, condition: u } = (o == null ? void 0 : o()) || {}, [p] = Ke.useForm(); - return R(() => { - r && t && F.get(`/api/_/${r}/list-condition-form-layout`).then(({ resource: h, marginX: w, marginY: C, rowHeight: S, cols: j, fields: P }) => { - a({ resource: h, itemMargin: [w, C], rowHeight: S, cols: j, fields: P }); - }).catch(() => a({})); - }, [r, t]), R(() => { - p.setFieldsValue({ keyword: c, ...u }); - }, [JSON.stringify([c, u])]), d("div", { className: A("ff-data-list-filter", l.filter, e), children: d(Ke, { form: p, layout: "vertical", autoComplete: "off", onFinish: ((f = n.fields) == null ? void 0 : f.length) > 1 ? (h) => i({ [n.resource]: h[n.resource] }, h.keyword) : () => { - }, onValuesChange: (h) => { - g.isEmpty(g.omit(h, ["keyword"])) || p.submit(); - }, children: ((y = n.fields) == null ? void 0 : y.length) > 1 ? d(St, { ...n, children: d(Qn, { onReset: () => { - const { keyword: h, condition: w } = o("init") || {}; - p.setFieldsValue({ keyword: h, ...w }); - } }) }) : d("div", { className: "ff-data-list-filter-default-form ff-grid-layout-form", children: d("div", { className: "grid-layout-item", style: en(20, 0, 5, 2), children: d(Ke.Item, { name: ["keyword"], children: d(Sn.Search, { allowClear: !0, enterButton: "搜索", placeholder: "多关键字 | 分割", onSearch: (h) => s(h) }) }) }) }) }) }); -}, Qn = ({ cols: e, fields: t, onReset: n }) => { - const [a, r] = T(!1), s = Y(() => 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: A("ff-data-list-filter-actions", { expanded: a }), children: [d(lt, { onClick: n, children: "重置" }), d(lt, { type: "primary", htmlType: "submit", children: "查询" }), s && d(N.Link, { className: "ff-data-list-filter-expanded-button", widget: () => r((i) => !i), type: "primary", name: a ? "关闭" : "展开", icon: a ? "icon-up" : "icon-down", iconPosition: "end" })] }); -}; -tn.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: s, onClickCallback: i, getBase62params: o } = k.useContext(te), { total: l, page: c, pageSize: u } = (o == null ? void 0 : o()) || {}; - return n && !g.isEmpty(t) || a ? O("div", { className: A("ff-data-list-footer", e), children: [d("div", { className: "ff-data-list-actions", children: t == null ? void 0 : t.map((p, f) => d(N, { uuid: p.uuid, type: p.type, name: p.name, widget: p.widget, widgetType: p.widgetType, widgetProps: p.widgetProps, widgetData: p.widgetData, widgetSetting: p.widgetSetting, widgetContainerProps: p.widgetContainerSetting, onAfterClick: (y) => y !== !1 && (i == null ? void 0 : i(p.isRefresh, null)) }, p.uuid || f)) }), a && d($n, { size: "small", total: l, pageSize: u, showSizeChanger: !1, showTotal: (p) => `第 ${c} 页 / 总共 ${p} 条`, onChange: r, onShowSizeChange: s })] }) : 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(te); - return n ? d(Pn.DirectoryTree, { className: A("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: s, classNames: i } = de(te), { 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: A("ff-data-list-toolbar", i.toolbar, e), children: [d("div", { className: "ff-data-list-title", children: t }), d(Nn, { className: "ff-data-list-tabs", itemRender: ({ label: u, code: p, value: f }) => d("span", { onClick: () => c(f ?? p), className: A("ff-data-list-tab", { active: (f ?? p) == l }), children: u }), items: n }), O("div", { className: "ff-data-list-actions", children: [d(N.Link, { icon: "icon-reload", widget: () => s() }), d(N.Link, { icon: "icon-setting" })] })] }); -}, nn = ({ isItemGridLayout: e, theme: t, themeProps: n, onClickCallback: a, onReload: r, listCode: s, total: i = 0, page: o = 0, onPageChange: l, pageSize: c = 30, onPageSizeChange: u, tab: p, onTabChange: f, keyword: y, onKeywordChange: h, condition: w, onConditionChange: C, sider: S, onSiderChange: j, layouts: P, classNames: M = {}, ...I }) => { - const [z, L] = T(), V = Y(() => { - let x = { sider: ta, filter: tn, footer: Zn, toolbar: na }; - P === !1 ? x = { sider: null, filter: null, footer: null, toolbar: null } : g.isPlainObject(P) && (x = Object.assign({}, x, P)); - for (const W in x) x[W] || (x[W] = () => d(k.Fragment, {})); - return x; - }, [P]); - return R(() => { - t ? ee.getWidgetComponent(t).then((x) => { - if (!x) throw `${t} not found`; - return x; - }).catch((x) => ({ default: () => `${x}` })).then((x) => L(k.createElement(x.default, { ...I, layouts: V, $setting: n }))) : L(d(e ? Gn : Xn, { ...I, layouts: V, $setting: n })); - }, [t, n]), d(te.Provider, { value: { classNames: M, listCode: s, onClickCallback: a, onReload: r, getBase62params: (x, W) => { - const $ = { tab: p, page: o, pageSize: c, keyword: y, sider: S, condition: w, total: i }; - return x && x != "init" ? $[x] ?? W : $; - }, onPageChange: l, onPageSizeChange: u, onTabChange: f, onSiderChange: j, onKeywordChange: h, onConditionChange: C }, children: z && k.cloneElement(z, I) }); -}; -nn.propTypes = { classNames: b.exact({ sider: b.string, filter: b.string, footer: b.string, toolbar: b.string, container: b.string, content: b.string, item: b.string }), layouts: b.oneOfType([b.exact({ sider: b.elementType, filter: b.elementType, footer: b.elementType, toolbar: b.elementType }), b.bool]) }; -var me, le, ve, et; -const re = class re { - constructor() { - E(this, le, null); - E(this, ve, /* @__PURE__ */ new Map()); - E(this, et, () => { - if (m(this, le)) return m(this, le).port.postMessage({ command: "status", data: [] }); - U(this, le, new SharedWorker(new URL("/ff-worker/res-ws.js", self.location))), m(this, le).port.onmessage = (t) => { - var n, a; - (n = t.data) != null && n.uuid ? m(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 }) => { - m(this, le).port.postMessage({ command: "initWs", data: [`ws${g.trimStart(F.appUrl, "http")}api/user-resource-status-ws?token=${r}`] }); - }); - }, m(this, le).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 = "*", m(this, ve).set(t, n), m(this, ve).size == 1 && m(this, et).call(this), () => this.unsubscribe(t))); - v(this, "unsubscribe", (t) => m(this, ve).delete(t)); - if (m(re, me)) return m(re, me); - } -}; -me = new WeakMap(), le = new WeakMap(), ve = new WeakMap(), et = new WeakMap(), E(re, me, null), v(re, "getInstance", () => (m(re, me) || U(re, me, new re()), m(re, me))); -let pt = re; -const an = pt.getInstance(), kt = k.forwardRef(({ listCode: e, base62params: t, className: n, theme: a, themeProps: r, layouts: s, classNames: i }, o) => { - const [{ resource: l, primaryKey: c, batchOperations: u = [], itemOperations: p = [], columns: f = [], themeConfig: y, theme: h, isConditionFormLayout: w = !1, isTreeSider: C, treeSiderConfig: S, isItemGridLayout: j, itemGridLayout: P, title: M, isPaginate: I, tabs: z }, L] = T({ isItemGridLayout: !1, itemGridLayout: {} }), V = _n(e, t), [{ dataSource: x, itemOperationsAccess: W, condition: $, tab: H, keyword: ue, page: D, total: nt, pageSize: De, sider: at, onConditionChange: Nt, onTabChange: pn, onKeywordChange: mn, onPageChange: hn, onPageSizeChange: fn, onSiderChange: yn, onReload: rt }, Tt] = Kn(V, e, c, l), wn = gt(p, x, W, c), bn = gt(u); - return R(() => { - let qe = null; - return e && F.get(`/api/_/${e}`).resp(({ data: He, res: Cn }) => { - He != null && He.isDynamicRefresh && (qe = an.subscribe(() => rt(), Cn)), L(He); - }).catch(() => L({})), () => qe == null ? void 0 : qe(); - }, [e]), k.useImperativeHandle(o, () => ({ onReload: rt, onClickCallback: Tt })), d(nn, { listCode: e, title: M, classNames: i, layouts: s, resource: l, primaryKey: c, theme: a || h, themeProps: r || y, isTreeSider: C, treeSiderConfig: S, isPaginate: I, tabs: z, isItemOperations: wn, isBatchOperations: bn, batchOperations: u, itemOperations: p, isItemGridLayout: j, columns: f, itemGridLayout: P, isConditionFormLayout: w, itemOperationsAccess: W, dataSource: x, onConditionChange: Nt, onTabChange: pn, onKeywordChange: mn, onPageChange: hn, onPageSizeChange: fn, onSiderChange: yn, condition: $, tab: H, keyword: ue, page: D, total: nt, pageSize: De, sider: at, className: A("ff-data-list-helper", n), onReload: rt, onClickCallback: Tt }); -}), rn = (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(rn(r.children, t, n)) : a), []) : [], aa = ({ className: e, primaryKey: t, columns: n = [], dataSource: a = [], operationRender: r, operationWidth: s = 180, ...i }) => { - const { classNames: o } = de(te); - Ge(); - const l = q(null), c = q(null), [u, p] = T([]), [f, y] = T({ width: 0, height: 0 }); - R(() => { - p(rn(a, t)); - }, [a, t]), vn(() => { - const w = new ResizeObserver(() => { - var C; - y({ width: ((C = l.current) == null ? void 0 : C.nativeElement.querySelector(".ant-table-body").scrollWidth) || c.current.offsetWidth, height: c.current.offsetHeight }); - }); - return c.current && w.observe(c.current), () => { - c.current && w.unobserve(c.current); - }; - }, []); - const h = Jn(n); - return d("div", { ref: c, className: A("ff-data-list-table", o.content, e), children: f.height ? d(Tn, { ...i, ref: l, rowKey: (w) => (w == null ? void 0 : w[t]) ?? Math.random(), columns: h == null ? void 0 : h.concat(r ? [{ title: "操作", align: "center", fixed: "right", width: `${Math.ceil(s / f.width * 100).toFixed(2)}%`, render: (w, C, S) => r(C, S) }] : []), dataSource: a, size: "middle", scroll: { x: "max-content", y: f.height - 50 }, pagination: !1, expandable: { defaultExpandAllRows: !0, expandRowByClick: !0, onExpandedRowsChange: p, expandedRowKeys: u } }) : null }); -}, ra = "RC_FORM_INTERNAL_HOOKS", sn = (e, { initialValue: t, initialValueLanguage: n, convertJs: a, convertJsSetting: r, type: s = "string" }, i = null) => { - const o = q(!1), l = de(Vn), [c, u] = T(), [p, f] = T(n != "javascript" && e ? l.getFieldValue(e) : void 0), { registerWatch: y } = l.getInternalHooks(ra) || {}; - return R(() => y == null ? void 0 : y((h, w, C) => { - if (!o.current) return; - const S = g.get(w, e); - g.isEqual(S, p) || f(Q(S, s)); - }), [p]), R(() => { - n == "javascript" && t ? Ce.exec(t, {}, { getFieldValueForBasicForm: (h) => i ? i.getFieldValue(h) : l.getFieldValue(h), getFieldValue: (h) => l.getFieldValue(h) }).then((h) => f(Q(h, s))).catch((h) => notification.error({ message: `布局数据错误: ${JSON.stringify(h)}` })).finally(() => o.current = !0) : (t && f(Q(t ?? l.getFieldValue(e), s)), o.current = !0); - }, [t, n]), We(() => { - o.current && a && new Ye([a, r]).toValue(p, l.getFieldsValue(!0)).then(u).catch((h) => { - u(h), console.error("布局数据转换错误: ", h, a); - }); - }, [p, a, r]), [c ?? p, p]; -}, on = (e, t, n = "@pkg/ff/grid-layouts", a = null) => Y(() => { - var r; - return (r = g.sortBy(e, ["y", "x"])) == null ? void 0 : r.map(({ i: s, x: i, y: o, w: l, h: c, field: { boxStyle: u, widgetPrefix: p = n, widget: f, ...y } }, h) => d("div", { className: "grid-layout-item", style: en(i, o, l, c, u, f === "Height" && (y == null ? void 0 : y.initialValue)), children: d(sa, { ...y, basicForm: a, itemWidget: f != null && f.startsWith("@") || f != null && f.startsWith("blob:") ? f : `${p}/${f}`, itemWidgetRender: t }) }, s || h)); -}, [e]), sa = ({ itemWidget: e, itemWidgetRender: t, basicForm: n, ...a }) => { - const [r, s] = T(); - return R(() => { - ee.getWidgetComponent(e).then(({ defaultProps: i = {}, default: o }) => { - s(k.createElement(t(o, i, n), a)); - }).catch((i) => { - console.error(i), s(e); - }); - }, [e]), r; -}, ln = ({ cols: e = 12, rowHeight: t = 21, fields: n = [], data: a, containerPadding: r = [0, 0], itemMargin: s = [4, 0], formProps: i = {}, className: o, ...l }) => { - const [c] = Z.useForm(), u = on(n, ia, "@pkg/ff/grid-layouts"), p = Y(() => [{ name: "__PROPS__", value: i }], [i]); - return We(() => (c.setFieldsValue(a), () => c.resetFields()), [a]), d(Z, { fields: p, form: c, component: !1, children: d("div", { ...l, className: A("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: u }) }); -}, ia = (e, t = {}, n = null) => (a) => { - const { code: r, label: s, extras: i, isVirtual: o, initialValue: l, initialValueLanguage: c, convertJs: u, convertJsSetting: p, ...f } = g.merge({}, t, a), [y, h] = sn(o ? null : r, { initialValue: l, initialValueLanguage: c, convertJs: u, convertJsSetting: p, type: (f == null ? void 0 : f.type) || "string" }, n); - return d(e, { ...f, value: y, rawValue: h, $setting: i || {} }); -}, cr = (jt = ln, function({ code: e, data: t, ...n }) { - const [a, r] = T({ 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) && d(jt, { ...n, rowHeight: a.rowHeight, cols: a.cols, fields: a.fields, data: a != null && a.resource ? { [a == null ? void 0 : a.resource]: t } : {} }); -}); -var jt; -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}`, [s, i] = T(); - return R(() => { - r && ee.getWidgetComponent(r).then(({ defaultProps: o = {}, default: l }) => ({ default: oa(l, o, n) })).catch((o) => ({ default: () => `${o}` })).then((o) => i(k.createElement(o.default, a))); - }, [r]), s; -}, oa = (e, t = {}, n = null) => (a) => { - const { code: r, label: s, extras: i, isVirtual: o, initialValue: l, initialValueLanguage: c, convertJs: u, convertJsSetting: p, value: f, ...y } = g.merge({}, t, a), [h, w] = sn(o ? null : r, { initialValue: l, initialValueLanguage: c, convertJs: u, convertJsSetting: p, type: (y == null ? void 0 : y.type) || "string" }, n); - return d(e, { ...y, value: h, rawValue: w, $setting: i || {} }); -}, la = ({ cols: e, rowHeight: t, itemMargin: n, fields: a, primaryKey: r, dataSource: s, itemClassName: i, itemRender: o = (p, f, y) => p, empty: l = d(En, { description: null }), className: c, style: u = {} }) => { - const { classNames: p } = de(te), f = Ge(), y = Y(() => d(ln, { cols: e, rowHeight: t, itemMargin: n, fields: a, className: i }), [a, e, t, n]); - return d("div", { className: A("ff-data-list-content", p.content, c), style: u, children: g.isEmpty(s) ? l : s.map((h, w) => { - const C = o(k.cloneElement(y, { data: h }), h, w); - return k.cloneElement(C, { key: `${f}-${(h == null ? void 0 : h[r]) || w}` }); - }) }); -}, ca = ({ component: e }) => { - const { base62params: t } = An(); - return d(_, { children: d(kt, { listCode: e, base62params: F.decode(t) }) }); -}, da = () => "Empty", ua = ({ component: e, $setting: t }) => { - const [n, a] = T(); - R(() => { - if (!e) return a(d(da, { description: null })); - ee.getWidgetComponent(e).catch((s) => ({ default: () => `${s}` })).then((s) => k.createElement(s.default, { $setting: t })).then(a); - }, [e]); - const r = ce.getPageParams() || {}; - return n ? k.cloneElement(n, r) : null; -}; -var he, X, fe, ye, Me, ze; -const se = class se { - constructor() { - E(this, X, /* @__PURE__ */ new Map()); - E(this, fe, {}); - E(this, ye, null); - v(this, "init", (t, n) => { - U(this, X, t), U(this, fe, n); - }); - v(this, "get", (t) => (m(this, X).has(t) || (t = Array.from(m(this, X).keys()).find((n) => m(this, X).get(n).uri === t)), m(this, X).get(t) || {})); - v(this, "redirect", (t, n, a = {}) => { - const { uri: r, type: s, widgetProps: i } = this.get(t) || {}; - let o = jn(r || t, s != "list" ? n : g.mapValues(n, (c) => F.encode(c))); - const l = new URLSearchParams(); - for (const c in i || {}) (i == null ? void 0 : i.type) == "query" && l.append(c, n[c]); - return l.size > 0 && (o = `${o}?${l.toString()}`), m(this, ye).navigate(o, a); - }); - v(this, "getMenus", (t) => { - var n; - return ((n = m(this, fe)) == null ? void 0 : n[t]) || []; - }); - v(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; - }); - v(this, "getMenusByRouteUuid", (t) => m(this, ze).call(this, t, Object.values(m(this, fe)).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, m(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(m(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 = 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, s] of m(this, X)) if (s.uri === n.path) return s; - return null; - }); - v(this, "getPageParams", (t) => { - var s, i; - const { location: n = {}, matches: a = [] } = ((s = m(this, ye)) == 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 (m(this, X).size == 0) return null; - const n = Oe.get("Common.WEBSITE_DEFAULT_THEME", "@pkg/ff/frameworks/DefaultTheme"), a = Oe.get(ee.checkUserToken() ? "Common.WEBSITE_LOGIN_REDIRECT" : "Common.WEBSITE_DEFAULT", "/index"), r = { [n]: 0 }, s = (o, l) => () => ee.getWidgetComponent(o).then((c) => c.default || function() { - return `${o}`; - }).then((c) => ({ Component: () => k.createElement(Kt, {}, k.createElement(c, l)) })), i = Array.from(m(this, X).values()).reduce((o, { uuid: l, uri: c, name: u, type: p, component: f, widgetSetting: y, isLogin: h, isLayout: w, extra: C }) => { - let S = {}, j = 0; - switch (p) { - case "list": - S.element = k.createElement(ca, { component: f }); - break; - case "fsdpf-component": - S.element = k.createElement(ua, { key: f, component: f, $setting: y }); - } - if (C != null && C.layout) { - if (!r[C == null ? void 0 : C.layout]) return r[C == null ? void 0 : C.layout] = o.length, [...o, { path: "/", lazy: s(C == null ? void 0 : C.layout, {}), children: [{ path: c, ...S }] }]; - j = r[C == null ? void 0 : C.layout]; - } - return w && j > -1 ? (o[j].children.push({ path: c, ...S }), o) : [...o, { path: c, ...S }]; - }, [{ path: "/", lazy: s(n, {}), children: [] }]); - return i.push({ index: !0, element: k.createElement(ga, { to: a, replace: !0 }) }), U(this, ye, In(i, t)); - }); - if (m(se, he)) return m(se, he); - } -}; -he = new WeakMap(), X = new WeakMap(), fe = new WeakMap(), ye = new WeakMap(), Me = new WeakMap(), ze = new WeakMap(), E(se, he, null), v(se, "getInstance", () => (m(se, he) || U(se, he, new se()), m(se, he))); -let mt = se; -const ga = ({ to: e, replace: t }) => Mn() ? k.createElement(zn, { to: e, replace: t }) : (window.document.location = e, "redirect"), ce = mt.getInstance(), Se = new Worker(new URL("/ff-worker/index.js", self.location)), It = { getConfigure: (e) => Oe.get(e), route: { redirect: (...e) => ce.redirect(...e), getPageParams: (...e) => ce.getPageParams(...e), getCurrentRoute: () => ce.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, Te, we; -const B = class B { - constructor() { - v(this, "exec", (t, n = {}, a = {}, r = "") => new Promise((s, i) => { - const o = Ft(B, tt)._++; - m(B, Te).set(o, a), B.mQueue.set(o, [s, i]), Se.postMessage({ id: o, session: r, category: "eval", method: t, args: n }); - })); - v(this, "clear", (t) => Se.postMessage({ session: t, category: "clear" })); - if (m(B, we)) return m(B, we); - Promise.resolve().then(() => ja).then((t) => { - It.http = t.http; - }), Se.addEventListener("message", ({ data: { id: t, task_id: n, method: a, args: r, category: s, data: i, error: o, session: l } }) => { - if (s === "eval" && B.mQueue.has(t)) o !== null ? B.mQueue.get(t)[1](o) : B.mQueue.get(t)[0](i), m(B, Te).delete(t), B.mQueue.delete(t); - else if (s === "util") try { - const c = g.get(It, a.split("/")) || g.get(m(B, Te).get(n), a.split("/")); - if (!g.isFunction(c)) throw `${a} not found`; - Promise.resolve(Reflect.apply(c, void 0, r)).then((u) => { - Se.postMessage({ id: t, task_id: n, category: s, method: a, args: r, session: l, data: u, error: null }); - }).catch((u) => { - Se.postMessage({ id: t, task_id: n, category: s, method: a, args: r, session: l, data: null, error: u }); - }); - } catch (c) { - Se.postMessage({ id: t, task_id: n, category: s, method: a, args: r, session: l, data: null, error: c }); - } - }, !1); - } -}; -tt = new WeakMap(), Te = new WeakMap(), we = new WeakMap(), v(B, "mQueue", /* @__PURE__ */ new Map()), E(B, tt, 0), E(B, Te, /* @__PURE__ */ new Map()), E(B, we, null), v(B, "getInstance", () => (m(B, we) || U(B, we, new B()), m(B, we))); -let ht = B; -const Ce = ht.getInstance(), xt = () => { - const e = q(!0), [, t] = k.useReducer((n) => n + 1, 0); - return R(() => () => e.current = !1, []), () => e.current && t(); -}, ur = (e) => { - const t = q(); - return R(() => { - t.current = e; - }, [e]), t.current; -}, gr = (e) => { - const [t, n] = T(e), a = q(null), r = G((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 = k.useRef(); - n(t, a.current) || (a.current = g.cloneDeep(t)), k.useEffect(e, [a.current]); -}, vt = We, cn = (e, t = "string") => { - var n; - if (!Array.isArray(e)) return e; - for (let a = 0; a < e.length; a++) e[a].value = Q((n = e[a]) == null ? void 0 : n.value, t), e[a] && Reflect.has(e[a], "children") && (e[a].children = cn(e[a].children, t)); - return e; -}, pr = (e, t = "json", n = "string", a, r = null) => { - const [s] = Z.useForm(a), [i, o] = T([{ label: "无", value: "", disabled: !0 }]), l = q([]), c = Z.useWatch((u) => l.current.length === 0 ? null : g.pick(u, l.current), s) || null; - return R(() => { - Array.isArray(e) ? o(e) : t === "javascript" && e ? Ce.exec(e, {}, { getFieldValue: (u) => (l.current.includes(u) || l.current.push(u), s.getFieldValue(u)), getFieldValueForBasicForm: (u) => (l.current.includes(u) || l.current.push(u), r ? r.getFieldValue(u) : s.getFieldValue(u)) }).then((u) => { - o(Q(u, "array")); - }) : e && o(Q(e, "array")); - }, [e, t, c]), cn(i, n); -}, mr = (e) => { - const [t, n] = T(), 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 = an.subscribe(g.throttle(r, 180, { leading: !1, trailing: !0 }), i.res); - }), () => s == null ? void 0 : s(); - }, a), t; -}, pa = (e) => { - const [t, n] = k.useState({ gridItems: [], hideItems: [] }); - return k.useEffect(() => { - e && F.get(`/api/_/${e}`).then(({ pk: a, uuid: r, code: s, resource: i, align: o, cols: l, rowHeight: c, marginX: u, marginY: p, listenChangeFields: f, listenChangeFieldsFunc: y, fields: h }) => ({ pk: a, uuid: r, code: s, resource: i, align: o, cols: l, rowHeight: c, marginX: u, marginY: p, listenChangeFields: f, listenChangeFieldsFunc: y, ...h.reduce((w, C) => { - var S; - return (S = C == null ? void 0 : C.field) != null && S.hidden ? w.hides.push(C == null ? void 0 : C.field) : w.items.push(C), w; - }, { items: [], hides: [] }) })).then(n); - }, [e]), t; -}, ma = ({ max: e = 0, min: t = 0, type: n = "", message: a, pattern: r, required: s = !1, validator: i } = {}, o, l) => { - const [c, u] = T([]); - return R(() => { - const p = []; - if (s) { - let f = l; - switch (l) { - case "number": - case "string": - case "array": - break; - case "bool": - f = "boolean"; - break; - case "json": - f = "object"; - } - p.push({ type: f, required: !0, whitespace: !0, message: "该项必填" }); - } - switch (n) { - case "string": - p.push({ type: n, max: e, min: t, message: a || (t && e ? `字符必须在 ${t} ~ ${e} 之间` : `${e ? "最多能有" : "最少要有"} ${t || e} 个字符`) }); - break; - case "pattern": - p.push({ type: "string", pattern: r, message: a }); - break; - case "validator": - i && p.push(({ getFieldValue: f }) => ({ validator: async (y, h) => { - const w = await Ce.exec(i, { value: h, fieldName: o }, { getFieldValue: f }); - return g.isString(w) && w ? Promise.reject(w) : g.isBoolean(w) && !w ? Promise.reject(a) : Promise.resolve(); - } })); - } - u(p); - }, [e, t, n, a, r, s, i]), c; -}, ha = (e, t, n) => { - const [a, r] = T(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; -}, fa = (e, t, n, a = {}) => { - const r = xt(), s = q(!0), i = q([]), [o, l] = T(n), c = Z.useWatch((u) => JSON.stringify(g.pick(u, i.current)), t) || "{}"; - return R(() => { - e && Ce.exec(e, a, { getFieldValue: g.wrap(t.getFieldValue, (u, p) => (i.current.some((f) => g.isEqual(f, p)) || (i.current.push(p), r()), u(p))), isFieldTouched: t.isFieldTouched, isFieldsTouched: t.isFieldsTouched }).then((u) => s.current && l(u)); - }, [e, c, t, a]), R(() => () => s.current = !1, []), o; -}, hr = ({ value: e, onChange: t }, n = null) => { - const a = q(), [r] = Z.useForm(n); - return vt(() => { - g.isEqual(a.current, e) || r.setFieldsValue(e); - }, [e]), R(() => () => r.resetFields(), []), [Y(() => r.__INTERNAL__ ? r : { ...r, __INTERNAL__: {} }, [r]), (s, i) => { - a.current = i, t(i); - }]; -}, ya = ({ type: e, initialValue: t, initialValueLanguage: n, onChange: a, form: r }) => { - const s = fa(n == "javascript" && t, r, n == "javascript" ? void 0 : t, {}); - return R(() => { - n == "javascript" ? a(Q(s, e)) : t && a(Q(t, e)); - }, [e, t, s]), null; -}, wa = ({ 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] = T(); - return R(() => { - i && ee.getWidgetComponent(i).then(({ defaultProps: c = {}, default: u }) => ({ default: dn(u, c, r) })).catch((c) => ({ default: () => `${c}` })).then((c) => l(k.createElement(c.default, s))); - }, [i]), o && k.cloneElement(o, s); -}, dn = (e, t = {}, n = null) => (a) => { - const { type: r, code: s, label: i, noStyle: o, placeholder: l, extras: c, validators: u, help: p, isVirtual: f, $isReserved: y, initialValue: h, initialValueLanguage: w, convertJs: C, convertJsSetting: S, widgetPerfix: j, boxStyle: P, widgetDecorator: M, subWidgets: I, ...z } = { ...t, ...a }, L = ma(u || {}, s, r), V = { label: i, noStyle: o, colon: !1, layout: "vertical" }, x = { placeholder: l, ...z }, W = G(($) => $ == null ? void 0 : Q($, r), [r]); - return d(Ht, { name: s, rules: L, initialValue: W(h), normalize: W, children: ($, H, ue) => { - var D; - return d(e, { type: r, rcform: ue, itemProps: { validateStatus: H.errors.length > 0 ? "error" : "success", tooltip: p, help: H.errors.length > 0 ? H.errors.join("、") : null, required: ((D = L == null ? void 0 : L[0]) == null ? void 0 : D.required) || !1, ...V }, fieldProps: { ...x, ...$ }, $setting: c || {} }); - } }); -}, St = ({ cols: e = 24, rowHeight: t = 16, itemMargin: n = [8, 16], containerPadding: a = [0, 0], fields: r = [], children: s, basicForm: i = null }) => { - const o = on(r, dn, "@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 && k.cloneElement(s, { cols: e, rowHeight: t, itemMargin: n, containerPadding: a, fields: r })] }); -}; -St.propTypes = { fields: b.array }; -const ba = (Mt = St, ({ code: e, layout: t, name: n, primaryKey: a = 0, style: r = {}, formProps: s = {}, form: i, isPreview: o = !1, className: l, onFinish: c, onValuesChange: u = () => { -}, ...p }) => { - const { align: f, autoComplete: y, resource: h, items: w, hides: C, rowHeight: S, marginX: j, marginY: P, cols: M, listenChangeFields: I, listenChangeFieldsFunc: z, pk: L, uuid: V } = pa(e), [x] = Z.useForm(i), W = Y(() => [{ name: "__PK__", value: L }, { name: "__PROPS__", value: s }, { name: "__RESOURCE__", value: h }, { name: "__LAYOUT_KEY__", value: e }, { name: "__LAYOUT_UUID__", value: V }, { name: "__PRIMARY_KEY__", value: a }], [L, e, V, h, a, s]); - return O(Z, { className: l, name: n || e, layout: t || f, fields: W, form: x, autoComplete: y, style: { ...r, position: "relative" }, onFinish: c, onValuesChange: ($, H) => (({ changedValues: ue, allValues: D, listenChangeFields: nt, listenChangeFieldsFunc: De, onValuesChange: at, code: Nt }) => { - at(ue, D), De && Array.isArray(nt) && Ce.exec(De, { changedValues: ue, allValues: D }, { getFieldValue: x.getFieldValue, setFieldValue: x.setFieldValue, setFieldsValue: x.setFieldsValue, isFieldTouched: x.isFieldTouched, isFieldsTouched: x.isFieldsTouched }); - })({ changedValues: $, allValues: H, listenChangeFields: I, listenChangeFieldsFunc: z, onValuesChange: u, code: e }), children: [d(Mt, { ...p, form: x, code: e, fields: w, cols: M, rowHeight: S, itemMargin: [j, P] }), C == null ? void 0 : C.map(($) => { - var H; - return d(Ht, { name: $.code, children: d(ya, { form: x, name: $.code, type: $.type, initialValue: $.initialValue, initialValueLanguage: (H = $.extras) == null ? void 0 : H.initialValueLanguage }) }, JSON.stringify($.code)); - })] }, e); -}); -var Mt; -const un = ({ $setting: e, $close: t, extras: n, code: a, primaryKey: r, ...s }) => { - const [i] = Z.useForm(), o = ha(a, r, e); - return R(() => { - o && i.setFieldsValue(o); - }, [o]), d(_, { actions: O(k.Fragment, { children: [d(N, { name: "保存", type: "primary", widget: () => { - const l = i.getFieldValue("__RESOURCE__"), { initDataUri: c = `/api/${a}` } = e || {}; - i.validateFields(!0).then((u) => l ? g.pick(u, [l]) : u).then((u) => F.post(r ? `${c}/${r}` : `${c}`, u).msg(t)).catch(() => K.error("请先完善表单信息", { duration: 2e3 })); - } }), d(N, { name: "取消", widget: () => t(!1) })] }), extras: n, children: d(ba, { form: i, code: a, primaryKey: r, ...s }) }); -}, Ca = (e, t, n, { isReplaceRouteHistory: a = !1 } = {}) => ce.redirect(n, t, { replace: a }), ka = (e, t = {}, n, a = {}) => { - var s; - const r = (s = a.router) == null ? void 0 : s.reduce((i, [o, l, c]) => { - const u = g.get(t, ["router", o]); - if (!u && u !== 0 && l) throw `请传入 ${c}`; - return `${i}/${u}`; - }, `/api/${n}`); - return F.del(r, t.param).msg(); -}, zt = (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 ? Ce.exec(n, t, i) : null; -}, Bt = (e, t, n, a, r) => g.isString(n) && n ? ee.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), xa = (e, t, n, a, r) => K.modal(un, { ...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), Sa = ({ widget: e, widgetType: t, widgetData: n, widgetProps: a, widgetSetting: r, widgetContainerProps: s }, { onAfterClick: i, onBeforeClick: o }) => { - const l = de(te), [c, u] = T({ leading: !0, trailing: !1 }), p = Y(() => { - switch (t) { - case "redirect": - return g.partialRight(Ca, e, r); - case "func": - return g.partialRight(zt, (r == null ? void 0 : r.code) ?? e, { status: c, setStatus: u }); - case "fsdpf-component": - return g.partialRight(Bt, e, r, s); - case "grid-layout-form": - return g.partialRight(xa, e, r, s); - case "data-list": - return g.partialRight(va, e, r, s); - case "destroy": - return g.partialRight(ka, e, r, s); - default: - if (Pt(e) || k.isValidElement(e)) return g.partialRight(Bt, e, r, s); - if (g.isFunction(e)) return g.partialRight(zt, (r == null ? void 0 : r.code) || e, { status: c, setStatus: u }); - } - return (...f) => console.error("useButton unknown widgetType", t, ...f); - }, [e, t]); - return [g.debounce((f) => (o == null || o(f), Promise.resolve(Gt(a, f, { list: l })).then((y) => p(f, { ...n, ...y })).then((y) => i == null ? void 0 : i(y)).catch(console.error)), 300, { leading: !0, trailing: !1 }), c]; -}, Wt = /* @__PURE__ */ new Set(), ft = (e = [], t = 0) => { - const n = e[t]; - if (n.length && !Wt.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); - }), Wt.add(n), document.body.appendChild(a); - } -}, yt = ({ className: e, type: t, style: n = {}, ...a }) => d("span", { role: "img", className: A("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: b.string, type: b.string.isRequired, style: b.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: c, data: u, loading: p, disabled: f, tooltip: y, confirm: h, widget: w, widgetType: C, widgetData: S, widgetProps: j, widgetSetting: P, widgetContainerProps: M, ...I }) { - const z = g.isEmpty(y) || !y.enabled ? {} : y, L = g.isEmpty(h) ? { enabled: !1 } : Object.assign({ enabled: !0 }, h), V = { type: "primary", className: A("ff-button", t), iconPosition: i }; - s === "danger" ? V.danger = !0 : s === "default" && (V.type = s), e === "link" || e === "dashed" ? (V.type = e, s === "default" && (V.className = A(V.className, "ff-default"))) : e !== "circle" && e !== "round" || (V.shape = e), r && (V.icon = d(yt, { type: r })); - const [x, W] = T(!1), [$, { disabled: H, loading: ue }] = Sa({ widget: w, widgetType: C, widgetData: S, widgetProps: j, widgetSetting: P, widgetContainerProps: M }, { onAfterClick: l, onBeforeClick: c }); - return d(Rn, { okText: "确定", cancelText: "取消", getPopupContainer: (D) => D, ...L, disabled: H || f, open: x, onOpenChange: (D) => { - if (!D) return W(D); - L.enabled ? W(D) : $(u); - }, onConfirm: () => { - $(u); - }, onClick: (D) => { - D.stopPropagation(); - }, children: d(Fn, { getPopupContainer: (D) => D, ...z, title: x ? null : z == null ? void 0 : z.title, trigger: ["hover", "click"], children: d(lt, { loading: ue || p, disabled: H || f, ...V, ...I, children: n || a }) }) }); -}, N = Ue("default"), $a = Ue("link"), Pa = Ue("circle"), Na = Ue("round"), Ta = Ue("dashed"), Ut = ({ data: e, widget: t, widgetType: n = "fsdpf-component", widgetData: a, widgetProps: r, widgetSetting: s, widgetContainerProps: i, onAfterClick: o, onBeforeClick: l, children: c, extras: u }) => { - const p = de(te), [f, y] = T(!1), [h, w] = T("hover"), [C, S] = T({}), [j, P] = T(), { placement: M, align: I, arrow: z = { pointAtCenter: !0 }, getPopupContainer: L, ...V } = i || {}; - R(() => { - n == "grid-layout-form" ? P(k.createElement(un, { ...a, $setting: s, code: t })) : n == "data-list" ? P(k.createElement(kt, { base62params: e, $setting: s, listCode: t })) : g.isString(t) ? ee.getWidgetComponent(t).then(({ default: $ }) => { - P(k.createElement($, { ...a, $setting: s })); - }).catch(($) => P($.toString())) : Pt(t) ? P(k.createElement(t, { ...a, $setting: s })) : k.isValidElement(t) && P(k.cloneElement(t, { ...a, $setting: s })); - }, [t, n, a]), R(() => { - Promise.resolve(Gt(r, e, { list: p })).then(S); - }, [r, e]); - const x = ($, H = !1) => (y($), !$ && w("hover"), $ ? l == null ? void 0 : l(C) : o == null ? void 0 : o(H)), W = ($) => { - y(!0), w("click"); - }; - return d(On, { zIndex: 1080, placement: M, onPopupClick: W, onClick: W, open: f, align: I, arrow: z, trigger: h, getPopupContainer: L, content: d(Ea, { ...V, extras: u, children: j && k.cloneElement(j, { ...C, $close: ($) => x(!1, $) }) }), children: c, onOpenChange: x }); -}, Ea = ({ title: e, className: t, children: n, extras: a, width: r, height: s, ...i }) => { - const [o, l] = T({}), c = G((y, h) => l((w) => ({ ...w, [y]: h })), []), u = G((y) => l((h) => ({ ...h, [y]: void 0 })), []), p = e ? k.createElement("div", { className: "ff-popup-title" }, e) : o == null ? void 0 : o.title, f = a ?? k.createElement("div", { className: "ff-popup-reserved-extras" }, a); - return d(Be.Provider, { value: { ele: o, mount: c, unmount: u }, children: O("div", { className: A("ff-popup ff-popover", t), style: { width: r, height: s }, ...i, children: [O("div", { className: "ff-popup-header", children: [p, o == null ? void 0 : o["sub-title"]] }), n, O("div", { className: "ff-popup-footer", children: [f, o == null ? void 0 : o.extras, o == null ? void 0 : o.actions] })] }) }); -}; -Ut.propTypes = { widgetType: b.oneOf(["fsdpf-component", "grid-layout-form", "data-list"]) }, N.propTypes = { type: b.oneOf(["primary", "default", "danger", ""]), name: b.string, icon: b.string, iconPosition: b.oneOf(["start", "end"]), data: b.any, widget: b.any, widgetType: b.oneOf(["destroy", "redirect", "func", "fsdpf-component", "grid-layout-form", "grid-layout", "data-list"]), widgetData: b.object, widgetProps: b.object, widgetSetting: b.object, widgetContainerProps: b.object, tooltip: b.exact({ title: b.string.isRequired, placement: b.oneOf(["top", "left", "right", "bottom", "topLeft", "topRight", "bottomLeft", "bottomRight", "leftTop", "leftBottom", "rightTop", "rightBottom"]), enabled: b.oneOfType([b.bool, b.number]), getPopupContainer: b.func }), confirm: b.exact({ title: b.string.isRequired, cancelText: b.string, okText: b.string, okType: b.oneOf(["primary", "default", "danger", ""]), placement: b.oneOf(["top", "left", "right", "bottom", "topLeft", "topRight", "bottomLeft", "bottomRight", "leftTop", "leftBottom", "rightTop", "rightBottom"]), enabled: b.oneOfType([b.bool, b.number]), getPopupContainer: b.func, arrow: b.oneOfType([b.bool, b.exact({ pointAtCenter: b.bool })]) }) }, N.Link = $a, N.Link.defaultProps = N.defaultProps, N.Link.propTypes = N.propTypes, N.Circle = Pa, N.Circle.defaultProps = N.defaultProps, N.Circle.propTypes = N.propTypes, N.Round = Na, N.Round.defaultProps = N.defaultProps, N.Round.propTypes = N.propTypes, N.Dashed = Ta, N.Dashed.defaultProps = N.defaultProps, N.Dashed.propTypes = N.propTypes, N.Popover = Ut; -const Ra = ({ fields: e, formProps: t, $close: n }) => { - const [a] = Z.useForm(), r = Y(() => [{ name: "__PROPS__", value: t }], [t]); - return d(_, { actions: O(k.Fragment, { children: [d(N, { name: "取消", widget: () => n(!1) }), d(N, { name: "确定", type: "primary", widget: () => a.validateFields(!0).then(n) })] }), children: d(Z, { fields: r, form: a, className: "ff-modal-form", children: e == null ? void 0 : e.map(({ code: s, ...i }) => d(wa, { code: s, ...i }, s)) }) }); -}, Fa = ({ className: e, $close: t, children: n, title: a, subTitle: r, actions: s, extras: i, zIndex: o, ...l }) => O(Un, { ...l, prefixCls: "ff-drawer", className: A("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: [i, s] })] }), Oa = ({ className: e, $close: t, $event: n, children: a, title: r, subTitle: s, actions: i, extras: o, zIndex: l, placement: c, ...u }) => { - const p = (n == null ? void 0 : n.pageX) === void 0 ? { animation: null, maskAnimation: null, mousePosition: { x: null, y: null } } : { animation: "zoom", maskAnimation: "fade", mousePosition: { x: n == null ? void 0 : n.pageX, y: n == null ? void 0 : n.pageY } }; - return d(Dn, { ...u, ...p, prefixCls: "ff-modal", modalRender: () => O("div", { className: A("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, s] }), d("div", { className: "ff-popup-body", children: a }), O("div", { className: "ff-popup-footer", children: [o, i] })] }) }); -}, gn = ({ placement: e, $close: t, $event: n, children: a, title: r, ...s }) => { - const [i, o] = T({}), [l, c] = T(!0), u = G((h, w) => o((C) => ({ ...C, [h]: w })), []), p = G((h) => o((w) => ({ ...w, [h]: void 0 })), []); - let f = { ...s, className: i.rootClassName, title: i.title || r && k.createElement("div", { className: A("ff-popup-title") }, r), subTitle: i["sub-title"], actions: i.actions, extras: i.extras, children: a, $close: t, $event: n, onClose: () => c(!1) }; - const y = () => { - t(!1); - }; - return d(Be.Provider, { value: { ele: i, mount: u, unmount: p }, children: e && e !== "center" ? d(Fa, { ...f, placement: e, open: l, afterOpenChange: (h) => !h && y() }) : d(Oa, { ...f, visible: l, afterClose: y }) }); -}; -gn.propTypes = { placement: b.oneOf(["center", "left", "top", "right", "bottom"]) }; -const J = () => { - const [e, t] = Bn({ 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] = k.useReducer((s) => s + 1, 0); - R(() => { - J.$onClick = a, J.$queue.forEach(([s, i, o], l, c) => { - r([i, o], ...s), delete c[l]; - }); - }, []); - const a = (s, i = {}, o = {}) => new Promise((l, c) => r([l, c], s, i, o)), r = ([s, i], o, l = {}, c = {}) => { - const u = J.$index++, p = (f) => ((y, h) => (J.$popups.delete(y), n(), h == null ? void 0 : h()))(u, () => s(f)); - if (o === _t) return e.open({ ...c, key: u, content: k.createElement(o, { ...l, $close: () => e.close(u) }) }); - J.$popups.set(u, k.createElement(gn, { zIndex: u, maskClosable: !1, $event: l == null ? void 0 : l.$event, ...c, key: u, $close: p }, k.isValidElement(o) ? k.cloneElement(o, { ...l, $close: p }) : o != null && o.name || Ot.isForwardRef(o) || (o == null ? void 0 : o.$$typeof) === Ot.ForwardRef ? k.createElement(o, { ...l, $close: p }) : o)), n(); - }; - return O(k.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 Dt = (e, t, n = {}) => J.$onClick(e, t, n), it = (e, { showProgress: t, duration: n, ...a } = { duration: 1.5 }) => J.$onClick(_t, { content: e, ...a }, { showProgress: t, duration: n }), K = { modal: Dt, confirm: (e, t = {}) => J.$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: 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 && ce.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()); - v(this, "setVendor", (t, n) => m(this, Ee).set(t, new Jt(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 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); - } - }); - 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: Wn.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 (m(ie, be)) return m(ie, be); - } -}; -be = new WeakMap(), Ee = new WeakMap(), E(ie, be, null), v(ie, "getInstance", () => (m(ie, be) || U(ie, be, new ie()), m(ie, be))); -let bt = ie; -const ee = bt.getInstance(), La = k.createContext({ user: {}, initUser: () => { -}, initUserComplete: !1 }), Va = k.createContext({ set: () => { -}, get: () => { -}, assign: () => { -}, currentRoute: () => { -} }), Pt = (e) => !!(e != null && e.name) && (e.prototype instanceof k.Component || /^[A-Z]/.test(e.name)), Aa = (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); -}, ja = Object.freeze(Object.defineProperty({ __proto__: null, AppContext: La, AppGlobalParamsContext: Va, cache: Jt, configure: Oe, default: ee, func: Ce, http: F, insertStyle: Aa, isReactComponent: Pt, route: ce }, Symbol.toStringTag, { value: "Module" })), Ia = (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 = Ia(i, t, n); - if (!g.isEmpty(o)) return o; - } - return {}; -}; -export { - N as $, - or as A, - lr as B, - Zt as C, - Ye as D, - gt as E, - Kn as F, - cr as G, - ra as H, - _n as I, - xt as J, - ur as K, - gr as L, - We as M, - vt as N, - pr as O, - mr as P, - ba as Q, - an as R, - St as S, - wa as T, - un as U, - pa as V, - ma as W, - ha as X, - fa as Y, - hr as Z, - yt as _, - rr as a, - Hn as a0, - Sa as a1, - _ as a2, - Be as a3, - Kt as a4, - J as a5, - K as a6, - er as a7, - tr as a8, - nr as a9, - ee as aa, - Pt as ab, - Aa as ac, - F as ad, - Jt as ae, - Oe as af, - Ce as ag, - ce as ah, - La as ai, - Va as aj, - Ia as ak, - sr as b, - ir as c, - Yt as d, - en as e, - rn as f, - Gt as g, - ln as h, - dr as i, - sn as j, - on as k, - nn as l, - tn as m, - na as n, - ta as o, - Zn as p, - kt as q, - st as r, - te as s, - Q as t, - ar as u, - aa as v, - la as w, - Gn as x, - Xn as y, - Jn as z -}; diff --git a/dist/components.js b/dist/components.js index 011fdf3..bb68db3 100644 --- a/dist/components.js +++ b/dist/components.js @@ -1,8 +1,8 @@ -import { a7 as s, _ as p, a8 as n, a9 as t, a6 as d } from "./common/main-Bd51PHML.js"; +import { ab as s, a2 as p, ac as d, ad as n, aa as t } from "./common/main--W19LzWH.js"; export { s as Empty, p as Icon, - n as Loading, - t as NotFound, - d as Popup + d as Loading, + n as NotFound, + t as Popup }; diff --git a/dist/container.js b/dist/container.js index f0a2d37..f7f2269 100644 --- a/dist/container.js +++ b/dist/container.js @@ -1,10 +1,10 @@ -import { a3 as o, a7 as s, a8 as p, a9 as t, a4 as d, a6 as n, a5 as r, a2 as u } from "./common/main-Bd51PHML.js"; +import { a7 as o, ab as s, ac as d, ad as p, a8 as t, aa as n, a9 as r, a6 as u } from "./common/main--W19LzWH.js"; export { o as Context, s as Empty, - p as Loading, - t as NotFound, - d as PageRender, + d as Loading, + p as NotFound, + t as PageRender, n as Popup, r as PopupRender, u as default diff --git a/dist/data-converter.js b/dist/data-converter.js index c08d256..8d421d2 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-Bd51PHML.js"; +import { D as p } from "./common/main--W19LzWH.js"; export { p as default }; diff --git a/dist/data-list.js b/dist/data-list.js index 336b571..1c82dab 100644 --- a/dist/data-list.js +++ b/dist/data-list.js @@ -1,4 +1,4 @@ -import { w as t, s as e, m as r, p as o, x as i, q as u, o as l, v as D, n, y as L, l as m, z as p, I as C, B as c, E as F, C as b, F as d, A as k } from "./common/main-Bd51PHML.js"; +import { z as t, x as e, p as r, v as o, A as i, w as u, s as D, y as l, q as L, B as n, o as p, C as m, L as C, F as c, J as F, I as b, K as d, E as k } from "./common/main--W19LzWH.js"; export { t as DataListContent, e as DataListContext, @@ -6,12 +6,12 @@ export { o as DataListFooter, i as DataListFramework, u as DataListHelper, - l as DataListSider, - D as DataListTable, - n as DataListToolbar, - L as DataTableFramework, - m as default, - p as useColumnsRender, + D as DataListSider, + l as DataListTable, + L as DataListToolbar, + n as DataTableFramework, + p as default, + m as useColumnsRender, C as useDataListHelper, c as useDataSource, F as useHasOperationColumn, diff --git a/dist/data-list/utils.js b/dist/data-list/utils.js index b99ea04..ddac2a2 100644 --- a/dist/data-list/utils.js +++ b/dist/data-list/utils.js @@ -1,5 +1,5 @@ import "lodash"; -import { f as a } from "../common/main-Bd51PHML.js"; +import { j as a } from "../common/main--W19LzWH.js"; export { a as getDefaultExpandRowKeys }; diff --git a/dist/grid-layout-form.js b/dist/grid-layout-form.js index 129e36f..b9b550f 100644 --- a/dist/grid-layout-form.js +++ b/dist/grid-layout-form.js @@ -1,4 +1,4 @@ -import { S as s, U as r, T as u, Q as o, Y as t, X as d, Z as m, W as F, V as i } from "./common/main-Bd51PHML.js"; +import { V as s, X as r, W as u, U as o, $ as t, _ as d, a1 as m, Z as F, Y as i, a0 as g } from "./common/main--W19LzWH.js"; export { s as GridLayoutForm, r as GridLayoutFormHelper, @@ -8,5 +8,6 @@ export { d as useFormData, m as useMergedFormValuesChange, F as useRules, - i as useStructure + i as useStructure, + g as useWidgetDecorator }; diff --git a/dist/grid-layout-form/utils.js b/dist/grid-layout-form/utils.js index 70ceef2..0f2dc8a 100644 --- a/dist/grid-layout-form/utils.js +++ b/dist/grid-layout-form/utils.js @@ -1,5 +1,6 @@ import "lodash"; -import { ak as a } from "../common/main-Bd51PHML.js"; +import { g as o, a as g } from "../common/main--W19LzWH.js"; export { - a as getOptionItemByValue + o as getOptionItemByValue, + g as getWidgetByNormalize }; diff --git a/dist/grid-layout.js b/dist/grid-layout.js index a5958c0..23b332a 100644 --- a/dist/grid-layout.js +++ b/dist/grid-layout.js @@ -1,4 +1,4 @@ -import { h as d, i as e, H as i, G as t, j as u, k as o } from "./common/main-Bd51PHML.js"; +import { k as d, l as e, H as i, G as t, m as u, n as o } from "./common/main--W19LzWH.js"; export { d as GridLayout, e as GridLayoutWidget, diff --git a/dist/grid-layout/utils.js b/dist/grid-layout/utils.js index f65a26d..fdbd25e 100644 --- a/dist/grid-layout/utils.js +++ b/dist/grid-layout/utils.js @@ -1,4 +1,5 @@ -import { e as t } from "../common/main-Bd51PHML.js"; +import { h as o, i as a } from "../common/main--W19LzWH.js"; export { - t as getBoxStyle + o as getBoxStyle, + a as getWidgetByNormalize }; diff --git a/dist/hooks.js b/dist/hooks.js index 955c37e..4a8e4d0 100644 --- a/dist/hooks.js +++ b/dist/hooks.js @@ -1,12 +1,12 @@ import "lodash"; import "rc-field-form"; import "react"; -import { N as r, M as o, O as p, K as f, L as i, P as m, J as c } from "./common/main-Bd51PHML.js"; -import { default as b } from "rc-util/lib/hooks/useMergedState"; +import { Q as r, P as o, S as p, N as f, O as i, T as m, M as c } from "./common/main--W19LzWH.js"; +import { default as S } from "rc-util/lib/hooks/useMergedState"; export { r as useDeepEffect, o as useDeepEqualEffect, - b as useMergedState, + S as useMergedState, p as useOptions, f as usePrevious, i as useStateWithCallback, diff --git a/dist/iconfont.js b/dist/iconfont.js index dccded5..e3b0caf 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 { _ as a } from "./common/main-Bd51PHML.js"; +import { a2 as a } from "./common/main--W19LzWH.js"; export { a as default }; diff --git a/dist/index.js b/dist/index.js index 4f32490..7a682e3 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1,13 +1,13 @@ -import { ai as t, aj as e, ae as o, af as n, aa as p, ag as c, ad as r, ac as f, ab as i, ah as l } from "./common/main-Bd51PHML.js"; +import { am as t, an as e, ai as o, aj as n, ae as p, ak as r, ah as c, ag as f, af as l, al as i } from "./common/main--W19LzWH.js"; export { t as AppContext, e as AppGlobalParamsContext, o as cache, n as configure, p as default, - c as func, - r as http, + r as func, + c as http, f as insertStyle, - i as isReactComponent, - l as route + l as isReactComponent, + i as route }; diff --git a/dist/res-ws.js b/dist/res-ws.js index 281c684..5529acb 100644 --- a/dist/res-ws.js +++ b/dist/res-ws.js @@ -1,5 +1,5 @@ import "lodash"; -import { R as a } from "./common/main-Bd51PHML.js"; +import { R as a } from "./common/main--W19LzWH.js"; export { a as default }; diff --git a/dist/style.css b/dist/style.css index 3b11f4b..bb407b0 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-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-reserved-extras,.ff-popup-extras,.ff-popup-actions{display:flex;align-items:center;gap:8px}.ff-popup-actions{margin-left:auto}.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}.ant-form-item-vertical .ant-form-item-control{flex-basis:auto}.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-reserved-extras,.ff-popup-extras,.ff-popup-actions{display:flex;align-items:center;gap:8px}.ff-popup-actions{margin-left:auto}.ff-popup-body{flex:1;overflow-y:auto} diff --git a/dist/utils.js b/dist/utils.js index 2bc159f..4e5187e 100644 --- a/dist/utils.js +++ b/dist/utils.js @@ -1,8 +1,8 @@ import "lodash"; -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-Bd51PHML.js"; +import { d as s, e as g, c as r, f as o, b as i, r as m, t as p, u as P } from "./common/main--W19LzWH.js"; export { - g as deepSome, - s as getPkgCategory, + s as deepSome, + g as getPkgCategory, r as getPkgName, o as getPkgOwner, i as getWidgetPropsData, diff --git a/package.json b/package.json index fa3c695..5912304 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "ff", "private": true, - "version": "0.4.46", + "version": "0.4.48", "author": "www.fsdpf.com", "type": "module", "main": "./dist/index.js",