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