This commit is contained in:
what 2024-12-16 15:48:33 +08:00
parent ed8d79e61a
commit 62d174ea3e
17 changed files with 232 additions and 232 deletions

2
dist/button.js vendored
View File

@ -1,4 +1,4 @@
import { $ as s, _ as u, a0 as e } from "./common/main-B5hgccZL.js";
import { $ as s, _ as u, a0 as e } from "./common/main-DsH9zeNE.js";
import "prop-types";
export {
s as auth,

View File

@ -1,9 +1,9 @@
var kn = Object.defineProperty;
var Cn = Object.defineProperty;
var Et = (e) => {
throw TypeError(e);
};
var vn = (e, t, n) => t in e ? kn(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
var x = (e, t, n) => vn(e, typeof t != "symbol" ? t + "" : t, n), Rt = (e, t, n) => t.has(e) || Et("Cannot " + n);
var kn = (e, t, n) => t in e ? Cn(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
var x = (e, t, n) => kn(e, typeof t != "symbol" ? t + "" : t, n), Rt = (e, t, n) => t.has(e) || Et("Cannot " + n);
var m = (e, t, n) => (Rt(e, t, "read from private field"), n ? n.call(e) : t.get(e)), E = (e, t, n) => t.has(e) ? Et("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, n), B = (e, t, n, a) => (Rt(e, t, "write to private field"), a ? a.call(e, n) : t.set(e, n), n);
var Ft = (e, t, n, a) => ({
set _(r) {
@ -14,21 +14,21 @@ var Ft = (e, t, n, a) => ({
}
});
import { jsx as d, jsxs as O } from "react/jsx-runtime";
import C, { useEffect as R, useState as N, useCallback as ce, useMemo as G, useRef as D, useContext as de, useId as Ge, useLayoutEffect as xn } from "react";
import C, { useEffect as R, useState as T, useCallback as ce, useMemo as G, useRef as D, useContext as de, useId as Ge, useLayoutEffect as vn } from "react";
import p from "lodash";
import qt from "immutability-helper";
import { Form as Ke, Input as Sn, Button as lt, Pagination as $n, Tree as Pn, Breadcrumb as Nn, Table as Tn, Empty as En, Popconfirm as Rn, Tooltip as Fn, Popover as On } from "antd";
import { useMergedState as Ln } from "rc-util";
import { Form as Ke, Input as xn, Button as lt, Pagination as Sn, Tree as $n, Breadcrumb as Pn, Table as Nn, Empty as Tn, Popconfirm as En, Tooltip as Rn, Popover as Fn } from "antd";
import { useMergedState as On } from "rc-util";
import V from "classnames";
import Q, { FieldContext as Vn, Field as Ht } from "rc-field-form";
import { useParams as jn, generatePath as An, createBrowserRouter as In, useInRouterContext as Mn, Navigate as zn } from "react-router-dom";
import Q, { FieldContext as Ln, Field as Ht } from "rc-field-form";
import { useParams as Vn, generatePath as jn, createBrowserRouter as An, useInRouterContext as In, Navigate as Mn } from "react-router-dom";
import k from "prop-types";
import * as Ot from "react-is";
import { useNotification as Wn } from "rc-notification";
import { N as Re, a as Fe, T as ct, S as Bn } from "./vender-DMK1apIA.js";
import { useNotification as zn } from "rc-notification";
import { N as Re, a as Fe, T as ct, S as Wn } from "./vender-DMK1apIA.js";
import "rc-util/lib/hooks/useMergedState";
import Un from "rc-drawer";
import Dn from "rc-dialog";
import Bn from "rc-drawer";
import Un from "rc-dialog";
var $e, Ve, Pe, se, ke, ve;
class Jt {
constructor(t, n) {
@ -60,7 +60,7 @@ class Jt {
}
}
$e = new WeakMap(), Ve = new WeakMap(), Pe = new WeakMap(), se = new WeakMap(), ke = new WeakMap(), ve = new WeakMap();
const er = () => d("div", { children: "Empty" }), We = C.createContext({ ele: {}, mount: () => {
const Za = () => d("div", { children: "Empty" }), We = C.createContext({ ele: {}, mount: () => {
}, unmount: () => {
} }), J = ({ rootClassName: e, className: t, children: n, actions: a, title: r, subTitle: i, extras: s, style: o = {} }) => {
const { mount: l, unmount: c } = C.useContext(We);
@ -70,12 +70,12 @@ const er = () => d("div", { children: "Empty" }), We = C.createContext({ ele: {}
return R(() => (a(e, C.createElement("div", { key: `ff-${e}`, className: V(`ff-popup-${e}`, n) }, t)), () => r(e)), [n, t]), null;
};
J.Action = Je("actions"), J.Title = Je("title"), J.SubTitle = Je("sub-title"), J.Extra = Je("extras"), J.propTypes = { className: k.string, style: k.object, title: k.any, subTitle: k.any, actions: k.any, extras: k.any };
const tr = () => d(J, { className: "ff-loading", children: O("div", { className: "loader", children: [O("div", { className: "square", children: [d("span", {}), d("span", {}), d("span", {})] }), O("div", { className: "square", children: [d("span", {}), d("span", {}), d("span", {})] }), O("div", { className: "square", children: [d("span", {}), d("span", {}), d("span", {})] }), O("div", { className: "square", children: [d("span", {}), d("span", {}), d("span", {})] })] }) }), nr = () => d("div", { children: "NotFound" }), Kt = ({ children: e }) => {
const [t, n] = N({}), a = ce((i, s) => n((o) => ({ ...o, [i]: s })), []), r = ce((i) => n((s) => ({ ...s, [i]: void 0 })), []);
const er = () => d(J, { className: "ff-loading", children: O("div", { className: "loader", children: [O("div", { className: "square", children: [d("span", {}), d("span", {}), d("span", {})] }), O("div", { className: "square", children: [d("span", {}), d("span", {}), d("span", {})] }), O("div", { className: "square", children: [d("span", {}), d("span", {}), d("span", {})] }), O("div", { className: "square", children: [d("span", {}), d("span", {}), d("span", {})] })] }) }), tr = () => d("div", { children: "NotFound" }), Kt = ({ children: e }) => {
const [t, n] = T({}), a = ce((i, s) => n((o) => ({ ...o, [i]: s })), []), r = ce((i) => n((s) => ({ ...s, [i]: void 0 })), []);
return typeof (e == null ? void 0 : e.type) == "string" ? e : d(We.Provider, { value: { ele: t, mount: a, unmount: r }, children: C.cloneElement(e, { className: t.rootClassName, title: t.title, subTitle: t["sub-title"], actions: t.actions, extras: t.extras }) });
};
Kt.propTypes = { children: k.element.isRequired };
const Lt = { close: ["M563.8 512l262.5-312.9c4.4-5.2 0.7-13.1-6.1-13.1h-79.8c-4.7 0-9.2 2.1-12.3 5.7L511.6 449.8 295.1 191.7c-3-3.6-7.5-5.7-12.3-5.7H203c-6.8 0-10.5 7.9-6.1 13.1L459.4 512 196.9 824.9c-4.4 5.2-0.7 13.1 6.1 13.1h79.8c4.7 0 9.2-2.1 12.3-5.7l216.5-258.1 216.5 258.1c3 3.6 7.5 5.7 12.3 5.7h79.8c6.8 0 10.5-7.9 6.1-13.1L563.8 512z"], check: ["M912 190h-69.9c-9.8 0-19.1 4.5-25.1 12.2L404.7 724.5 207 474c-6.1-7.7-15.3-12.2-25.1-12.2H112c-6.7 0-10.4 7.7-6.3 12.9l273.9 347c12.8 16.2 37.4 16.2 50.3 0l488.4-618.9c4.1-5.1 0.4-12.8-6.3-12.8z"], info: ["M512 224m-64 0a64 64 0 1 0 128 0 64 64 0 1 0-128 0Z", "M544 392h-64c-4.4 0-8 3.6-8 8v464c0 4.4 3.6 8 8 8h64c4.4 0 8-3.6 8-8V400c0-4.4-3.6-8-8-8z"] }, Ct = ({ type: e, props: t }) => d("i", { ...t, children: d("svg", { viewBox: "0 0 1024 1024", width: "1em", height: "1em", fill: "currentColor", children: (Lt[e] || Lt.info).map((n, a) => d("path", { d: n }, a)) }) }), _t = ({ className: e, content: t, icon: n, $close: a }) => O(C.Fragment, { children: [n && d("div", { className: V("ff-notification-icon", e), children: d(Ct, { type: n }) }), t] }), qn = ({}) => d(J, { children: "Confirm" });
const Lt = { close: ["M563.8 512l262.5-312.9c4.4-5.2 0.7-13.1-6.1-13.1h-79.8c-4.7 0-9.2 2.1-12.3 5.7L511.6 449.8 295.1 191.7c-3-3.6-7.5-5.7-12.3-5.7H203c-6.8 0-10.5 7.9-6.1 13.1L459.4 512 196.9 824.9c-4.4 5.2-0.7 13.1 6.1 13.1h79.8c4.7 0 9.2-2.1 12.3-5.7l216.5-258.1 216.5 258.1c3 3.6 7.5 5.7 12.3 5.7h79.8c6.8 0 10.5-7.9 6.1-13.1L563.8 512z"], check: ["M912 190h-69.9c-9.8 0-19.1 4.5-25.1 12.2L404.7 724.5 207 474c-6.1-7.7-15.3-12.2-25.1-12.2H112c-6.7 0-10.4 7.7-6.3 12.9l273.9 347c12.8 16.2 37.4 16.2 50.3 0l488.4-618.9c4.1-5.1 0.4-12.8-6.3-12.8z"], info: ["M512 224m-64 0a64 64 0 1 0 128 0 64 64 0 1 0-128 0Z", "M544 392h-64c-4.4 0-8 3.6-8 8v464c0 4.4 3.6 8 8 8h64c4.4 0 8-3.6 8-8V400c0-4.4-3.6-8-8-8z"] }, Ct = ({ type: e, props: t }) => d("i", { ...t, children: d("svg", { viewBox: "0 0 1024 1024", width: "1em", height: "1em", fill: "currentColor", children: (Lt[e] || Lt.info).map((n, a) => d("path", { d: n }, a)) }) }), _t = ({ className: e, content: t, icon: n, $close: a }) => O(C.Fragment, { children: [n && d("div", { className: V("ff-notification-icon", e), children: d(Ct, { type: n }) }), t] }), Dn = ({}) => d(J, { children: "Confirm" });
var ge, Ne;
const te = class te {
constructor() {
@ -87,7 +87,7 @@ const te = class te {
};
ge = new WeakMap(), Ne = new WeakMap(), E(te, ge, null), x(te, "getInstance", () => (m(te, ge) || B(te, ge, new te()), m(te, ge)));
let dt = te;
const Hn = dt.getInstance();
const qn = dt.getInstance();
var pe, je;
const ne = class ne {
constructor() {
@ -159,16 +159,16 @@ const Oe = ut.getInstance(), Vt = { null2json: (e) => Object.create(), null2arra
p.set(a, r, i);
}
return a;
}, {}), it = (e, t) => e && typeof e == "object" ? Array.isArray(e) ? e.map((n) => it(n, t)) : Object.keys(e).reduce((n, a) => (t[a] ? n[t[a]] = it(e[a], t) : n[a] = it(e[a], t), n), {}) : e, ar = () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (e) => {
}, {}), it = (e, t) => e && typeof e == "object" ? Array.isArray(e) ? e.map((n) => it(n, t)) : Object.keys(e).reduce((n, a) => (t[a] ? n[t[a]] = it(e[a], t) : n[a] = it(e[a], t), n), {}) : e, nr = () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (e) => {
const t = 16 * Math.random() | 0;
return (e === "x" ? t : 3 & t | 8).toString(16);
}), rr = (e) => {
}), ar = (e) => {
var t, n;
return e ? (n = (t = e.match(/^@pkg(?:[^\/]*\/){3}(?<name>[^\/]+)/)) == null ? void 0 : t.groups) == null ? void 0 : n.name : "";
}, ir = (e) => {
}, rr = (e) => {
var t, n;
return e ? (n = (t = e.match(/^@pkg(?:[^\/]*\/){2}(?<category>[^\/]+)/)) == null ? void 0 : t.groups) == null ? void 0 : n.category : "";
}, sr = (e) => {
}, ir = (e) => {
var t, n;
return e ? (n = (t = e.match(/^@pkg(?:[^\/]*\/){1}(?<owner>[^\/]+)/)) == null ? void 0 : t.groups) == null ? void 0 : n.owner : "";
};
@ -193,7 +193,7 @@ const Ze = class Ze {
});
x(this, "toRender", (t, n, a = null) => C.createElement(m(this, Qe), { value: t, record: n }, a));
E(this, Qe, ({ value: t, record: n, children: a }) => {
const [r, i] = N(a);
const [r, i] = T(a);
return xt(() => {
let s = !1;
return i(a), this.toValue(t, n).then((o) => X(o, "string")).then((o) => !s && i(o)).catch((o) => !s && i(`${o}`)), () => s = !0;
@ -207,24 +207,24 @@ Xe = new WeakMap(), Ae = new WeakMap(), Ie = new WeakMap(), Qe = new WeakMap(),
return ((r = a.default) == null ? void 0 : r.call(a, n)) || ((i) => i);
}), (t, n) => `${t}::${X(n, "string")}`));
let Ye = Ze;
const Jn = (e, t = {}) => G(() => e == null ? void 0 : e.map(({ widgetByJs: n, widgetByJsSetting: a, ...r }, i) => n ? { ...r, render: (s, o) => new Ye([n, a]).toRender(s, o, "-") } : r), [e, t]), or = (e) => {
const [t, n] = N({});
const Hn = (e, t = {}) => G(() => e == null ? void 0 : e.map(({ widgetByJs: n, widgetByJsSetting: a, ...r }, i) => n ? { ...r, render: (s, o) => new Ye([n, a]).toRender(s, o, "-") } : r), [e, t]), sr = (e) => {
const [t, n] = T({});
return R(() => {
let a = !1;
return e && F.get(`/api/_/${e}`).then((r) => p.pick(r, ["uuid", "name", "code", "resource", "marginX", "marginY", "cols", "rowHeight", "primaryKey", "columns", "itemOperations", "batchOperations", "isConditionFormLayout", "layout", "tabs", "pageSize", "layoutConfig"])).then((r) => !a && n(r)), () => a = !0;
}, [e]), t;
}, lr = (e, t = {}) => {
const [n, a] = N({ dataSource: [] });
}, or = (e, t = {}) => {
const [n, a] = T({ dataSource: [] });
return Be(() => {
let r = !1;
return e && F.get(`/api/${e}/${F.encode({ page: 1, ...t })}`).then((i) => !r && a(i)), () => r = !0;
}, [e, t]), n;
}, gt = (e, t = null, n = null, a = "id") => G(() => {
if (p.isEmpty(e) || !e.some(({ uuid: i }) => Hn.check(i))) return !1;
if (p.isEmpty(e) || !e.some(({ uuid: i }) => qn.check(i))) return !1;
if (p.isEmpty(n) || p.isEmpty(t)) return !0;
const r = t.map((i) => `${i == null ? void 0 : i[a]}`);
return e.some(({ uuid: i }) => !i || !n.has(i) || n.get(i).some((s) => r.includes(`${s}`)));
}, [e, t, n, a]), Kn = (e, t, n = "id", a = null) => {
}, [e, t, n, a]), Jn = (e, t, n = "id", a = null) => {
const r = vt(), i = D(!1), s = D(e.dataSource), o = D(e.itemOperationsAccess);
return R(() => (s.current = e.dataSource, o.current = e.itemOperationsAccess, () => i.current = !1), [e.dataSource, e.itemOperationsAccess]), i.current && (e.dataSource = s.current, e.itemOperationsAccess = o.current), [e, (l = 0, c = null) => {
var u, g;
@ -238,7 +238,7 @@ const Jn = (e, t = {}) => G(() => e == null ? void 0 : e.map(({ widgetByJs: n, w
const L = new Map($);
o.current.forEach((M, j) => {
var A;
(A = L.get(j)) != null && A.some((T) => T == y) || o.current.set(j, M.filter((T) => T !== y));
(A = L.get(j)) != null && A.some((P) => P == y) || o.current.set(j, M.filter((P) => P !== y));
}), L.forEach((M, j) => {
o.current.has(j) ? o.current.set(j, p.uniq([...o.current.get(j) || [], ...M])) : o.current.set(j, M);
});
@ -247,7 +247,7 @@ const Jn = (e, t = {}) => G(() => e == null ? void 0 : e.map(({ widgetByJs: n, w
});
}
}];
}, _n = (e, t) => {
}, Kn = (e, t) => {
const n = vt(), a = D(t), r = D(/* @__PURE__ */ new Map()), i = D([]), s = p.throttle((l) => {
i.current = [], F.list(e, p.pick({ ...a.current, ...l }, ["tab", "page", "pageSize", "condition", "sider", "keyword"])).then(({ keyword: c, condition: u, total: g, tab: h, sider: y, page: f, pageSize: b, operationsAccess: w, dataSource: $ }) => {
a.current = { tab: h, condition: u, sider: y, keyword: c, total: g, pageSize: b, page: $ != null && $.length ? f : 1 }, i.current = $, r.current = new Map(w), n();
@ -258,12 +258,12 @@ const Jn = (e, t = {}) => G(() => e == null ? void 0 : e.map(({ widgetByJs: n, w
}, [e, t]);
const o = G(() => p.pick(a.current, ["total", "tab", "page", "pageSize", "condition", "sider", "keyword"]), [a.current]);
return Object.assign(o, { onTabChange: (l) => s({ tab: l, page: 1 }), onPageChange: (l, c) => s({ page: l, pageSize: c }), onPageSizeChange: (l) => s({ pageSize: l, page: 1 }), onConditionChange: (l, c) => s({ keyword: c, condition: qt(a.current.condition || {}, { $merge: l || {} }), page: 1 }), onSiderChange: (l) => s({ sider: l, page: 1 }), onKeywordChange: (l) => s({ keyword: l, page: 1 }), itemOperationsAccess: r.current, dataSource: i.current, onReload: s });
}, Gn = ({ listCode: e, className: t, layouts: n, dataSource: a, isPaginate: r, isItemOperations: i, isBatchOperations: s, batchOperations: o, itemOperations: l, itemOperationsAccess: c, resource: u, primaryKey: g, title: h, itemGridLayout: y, $setting: f, tabs: b, isConditionFormLayout: w, isTreeSider: $, treeSiderConfig: I }) => {
const { classNames: L, onClickCallback: M } = de(ee), j = ce((A, T, v) => d(Yn, { className: V("ff-data-list-framework-item", L.item), operations: i && T ? l == null ? void 0 : l.filter((S) => !(g && S.uuid && c.has(S.uuid)) || c.get(S.uuid).includes(T == null ? void 0 : T[g])) : [], data: u ? { [u]: T } : T, children: A, onClickCallback: M }), [u, g, i, M, l, c]);
return O("div", { className: V("ff-data-list-framework", t), children: [d(n.sider, { isTreeSider: $, ...I }), O("div", { className: V("ff-data-list-container", L == null ? void 0 : L.container), children: [d(n.filter, { isConditionFormLayout: w }), d(n.toolbar, { title: h, tabs: b }), d(la, { ...y, style: { "--col-num": (f == null ? void 0 : f.colNum) || 1 }, primaryKey: g, itemRender: j, dataSource: a }), d(n.footer, { isPaginate: r, isOperations: s, operations: o })] })] });
}, Yn = ({ className: e, operations: t, children: n, data: a, onClickCallback: r }) => O("div", { className: V("data-list-grid-layout-item-container", e), children: [n, !!(t != null && t.length) && d("div", { className: "data-list-grid-layout-item-actions", children: t.map((i) => d("span", { className: "data-list-grid-layout-item-action", children: d(P.Link, { uuid: i.uuid, type: i.type, name: i.name, widget: i.widget, widgetType: i.widgetType, widgetProps: i.widgetProps, widgetSetting: i.widgetSetting, widgetContainerProps: i.widgetContainerSetting, data: a, confirm: i.confirm, onAfterClick: (s) => s !== !1 && (r == null ? void 0 : r(i.isRefresh, a)) }, i.uuid || Ge()) }, (i == null ? void 0 : i.uuid) || Ge())) })] }), Xn = ({ listCode: e, className: t, layouts: n, dataSource: a, columns: r, isItemOperations: i, isBatchOperations: s, batchOperations: o, itemOperations: l, itemOperationsAccess: c, resource: u, primaryKey: g, title: h, tabs: y, isPaginate: f, isTreeSider: b, treeSiderConfig: w, isConditionFormLayout: $, ...I }) => {
}, _n = ({ listCode: e, className: t, layouts: n, dataSource: a, isPaginate: r, isItemOperations: i, isBatchOperations: s, batchOperations: o, itemOperations: l, itemOperationsAccess: c, resource: u, primaryKey: g, title: h, itemGridLayout: y, $setting: f, tabs: b, isConditionFormLayout: w, isTreeSider: $, treeSiderConfig: I }) => {
const { classNames: L, onClickCallback: M } = de(ee), j = ce((A, P, S) => d(Gn, { className: V("ff-data-list-framework-item", L.item), operations: i && P ? l == null ? void 0 : l.filter((v) => !(g && v.uuid && c.has(v.uuid)) || c.get(v.uuid).includes(P == null ? void 0 : P[g])) : [], data: u ? { [u]: P } : P, children: A, onClickCallback: M }), [u, g, i, M, l, c]);
return O("div", { className: V("ff-data-list-framework", t), children: [d(n.sider, { isTreeSider: $, ...I }), O("div", { className: V("ff-data-list-container", L == null ? void 0 : L.container), children: [d(n.filter, { isConditionFormLayout: w }), d(n.toolbar, { title: h, tabs: b }), d(oa, { ...y, style: { "--col-num": (f == null ? void 0 : f.colNum) || 1 }, primaryKey: g, itemRender: j, dataSource: a }), d(n.footer, { isPaginate: r, isOperations: s, operations: o })] })] });
}, Gn = ({ className: e, operations: t, children: n, data: a, onClickCallback: r }) => O("div", { className: V("data-list-grid-layout-item-container", e), children: [n, !!(t != null && t.length) && d("div", { className: "data-list-grid-layout-item-actions", children: t.map((i) => d("span", { className: "data-list-grid-layout-item-action", children: d(N.Link, { uuid: i.uuid, type: i.type, name: i.name, widget: i.widget, widgetType: i.widgetType, widgetProps: i.widgetProps, widgetSetting: i.widgetSetting, widgetContainerProps: i.widgetContainerSetting, data: a, confirm: i.confirm, onAfterClick: (s) => s !== !1 && (r == null ? void 0 : r(i.isRefresh, a)) }, i.uuid || Ge()) }, (i == null ? void 0 : i.uuid) || Ge())) })] }), Yn = ({ listCode: e, className: t, layouts: n, dataSource: a, columns: r, isItemOperations: i, isBatchOperations: s, batchOperations: o, itemOperations: l, itemOperationsAccess: c, resource: u, primaryKey: g, title: h, tabs: y, isPaginate: f, isTreeSider: b, treeSiderConfig: w, isConditionFormLayout: $, ...I }) => {
const { classNames: L, onClickCallback: M } = de(ee), j = gt(l, a, c, g);
return O("div", { className: V("ff-data-table-framework", t), children: [d(n.sider, { isTreeSider: b, ...w }), O("div", { className: V("ff-data-table-container", L == null ? void 0 : L.container), children: [d(n.filter, { isConditionFormLayout: $ }), d(n.toolbar, { title: h, tabs: y }), d(aa, { ...I, primaryKey: g, className: "ff-data-table-content", columns: r, dataSource: a, operationRender: j ? (A) => d("div", { className: "ff-data-table-actions", children: l == null ? void 0 : l.reduce((T, v, S) => [...T, d(P.Link, { size: "small", uuid: v.uuid, type: v.type, name: v.name, widget: v.widget, widgetType: v.widgetType, widgetProps: v.widgetProps, widgetData: v.widgetData, widgetSetting: v.widgetSetting, widgetContainerProps: v.widgetContainerSetting, data: A, confirm: v.confirm, onAfterClick: (U) => U !== !1 && (M == null ? void 0 : M(v.isRefresh, A)) }, v.uuid || S)], []) }) : null }), d(n.footer, { isPaginate: f, isOperations: s, operations: o })] })] });
return O("div", { className: V("ff-data-table-framework", t), children: [d(n.sider, { isTreeSider: b, ...w }), O("div", { className: V("ff-data-table-container", L == null ? void 0 : L.container), children: [d(n.filter, { isConditionFormLayout: $ }), d(n.toolbar, { title: h, tabs: y }), d(na, { ...I, primaryKey: g, className: "ff-data-table-content", columns: r, dataSource: a, operationRender: j ? (A) => d("div", { className: "ff-data-table-actions", children: l == null ? void 0 : l.reduce((P, S, v) => [...P, d(N.Link, { size: "small", uuid: S.uuid, type: S.type, name: S.name, widget: S.widget, widgetType: S.widgetType, widgetProps: S.widgetProps, widgetData: S.widgetData, widgetSetting: S.widgetSetting, widgetContainerProps: S.widgetContainerSetting, data: A, confirm: S.confirm, onAfterClick: (U) => U !== !1 && (M == null ? void 0 : M(S.isRefresh, A)) }, S.uuid || v)], []) }) : null }), d(n.footer, { isPaginate: f, isOperations: s, operations: o })] })] });
}, ee = C.createContext({ listCode: "", classNames: {}, getBase62params: (e, t) => {
}, onReload: () => {
}, onClickCallback: () => {
@ -278,7 +278,7 @@ const Jn = (e, t = {}) => G(() => e == null ? void 0 : e.map(({ widgetByJs: n, w
return r != null && r.autoHeight ? s.height = "fit-content" : s["--grid-layout-row"] = `${a}`, r != null && r.alignItems && (s["--grid-layout-box-align-items"] = r.alignItems), r != null && r.justifyContent && (s["--grid-layout-box-justify-content"] = r.justifyContent), s["--grid-layout-box-margin"] = jt(r == null ? void 0 : r.marginTop, r == null ? void 0 : r.marginRight, r == null ? void 0 : r.marginBottom, r == null ? void 0 : r.marginLeft), s["--grid-layout-box-padding"] = jt(r == null ? void 0 : r.paddingTop, r == null ? void 0 : r.paddingRight, r == null ? void 0 : r.paddingBottom, r == null ? void 0 : r.paddingLeft), i && (s.height = `${i}px`), s;
}, jt = (e, t, n, a) => `${e || 0}px ${t || 0}px ${n || 0}px ${a || 0}px`, en = ({ className: e, isConditionFormLayout: t }) => {
var h, y;
const [n, a] = N({}), { listCode: r, onKeywordChange: i, onConditionChange: s, getBase62params: o, classNames: l } = C.useContext(ee), { keyword: c, condition: u } = (o == null ? void 0 : o()) || {}, [g] = Ke.useForm();
const [n, a] = T({}), { listCode: r, onKeywordChange: i, onConditionChange: s, getBase62params: o, classNames: l } = C.useContext(ee), { keyword: c, condition: u } = (o == null ? void 0 : o()) || {}, [g] = Ke.useForm();
return R(() => {
r && t && F.get(`/api/_/${r}/list-condition-form-layout`).then(({ resource: f, marginX: b, marginY: w, rowHeight: $, cols: I, fields: L }) => {
a({ resource: f, itemMargin: [b, w], rowHeight: $, cols: I, fields: L });
@ -288,39 +288,39 @@ const Jn = (e, t = {}) => G(() => e == null ? void 0 : e.map(({ widgetByJs: n, w
}, [JSON.stringify([c, u])]), d("div", { className: V("ff-data-list-filter", l.filter, e), children: d(Ke, { form: g, layout: "vertical", autoComplete: "off", onFinish: ((h = n.fields) == null ? void 0 : h.length) > 1 ? (f) => s({ [n.resource]: f[n.resource] }, f.keyword) : () => {
}, onValuesChange: (f) => {
p.isEmpty(p.omit(f, ["keyword"])) || g.submit();
}, children: ((y = n.fields) == null ? void 0 : y.length) > 1 ? d(St, { ...n, children: d(Qn, { onReset: () => {
}, children: ((y = n.fields) == null ? void 0 : y.length) > 1 ? d(St, { ...n, children: d(Xn, { onReset: () => {
const { keyword: f, condition: b } = o("init") || {};
g.setFieldsValue({ keyword: f, ...b });
} }) }) : d("div", { className: "ff-data-list-filter-default-form ff-grid-layout-form", children: d("div", { className: "grid-layout-item", style: Zt(20, 0, 5, 2), children: d(Ke.Item, { name: ["keyword"], children: d(Sn.Search, { allowClear: !0, enterButton: "搜索", placeholder: "多关键字 | 分割", onSearch: (f) => i(f) }) }) }) }) }) });
}, Qn = ({ cols: e, fields: t, onReset: n }) => {
const [a, r] = N(!1), i = G(() => t == null ? void 0 : t.toReversed().some((s) => s.y > 1 || s.x + s.w >= e - 5), [e, t]);
return O(Ke.Item, { label: " ", style: { "--item-span": 5 }, className: V("ff-data-list-filter-actions", { expanded: a }), children: [d(lt, { onClick: n, children: "重置" }), d(lt, { type: "primary", htmlType: "submit", children: "查询" }), i && d(P.Link, { className: "ff-data-list-filter-expanded-button", widget: () => r((s) => !s), type: "primary", name: a ? "关闭" : "展开", icon: a ? "icon-up" : "icon-down", iconPosition: "end" })] });
} }) }) : d("div", { className: "ff-data-list-filter-default-form ff-grid-layout-form", children: d("div", { className: "grid-layout-item", style: Zt(20, 0, 5, 2), children: d(Ke.Item, { name: ["keyword"], children: d(xn.Search, { allowClear: !0, enterButton: "搜索", placeholder: "多关键字 | 分割", onSearch: (f) => i(f) }) }) }) }) }) });
}, Xn = ({ cols: e, fields: t, onReset: n }) => {
const [a, r] = T(!1), i = G(() => t == null ? void 0 : t.toReversed().some((s) => s.y > 1 || s.x + s.w >= e - 5), [e, t]);
return O(Ke.Item, { label: " ", style: { "--item-span": 5 }, className: V("ff-data-list-filter-actions", { expanded: a }), children: [d(lt, { onClick: n, children: "重置" }), d(lt, { type: "primary", htmlType: "submit", children: "查询" }), i && d(N.Link, { className: "ff-data-list-filter-expanded-button", widget: () => r((s) => !s), type: "primary", name: a ? "关闭" : "展开", icon: a ? "icon-up" : "icon-down", iconPosition: "end" })] });
};
en.reservedFields = [{ x: 0, y: 0, h: 3, w: 5, field: { isVirtual: !0, widgetPrefix: "@pkg/ff/grid-layout-forms", widget: "Input", code: "keyword", label: "关键字", placeholder: "多关键字 | 分割", extras: { prefix: "icon-search" } } }];
const Zn = ({ className: e, operations: t, isOperations: n, isPaginate: a }) => {
const Qn = ({ className: e, operations: t, isOperations: n, isPaginate: a }) => {
const { onPageChange: r, onPageSizeChange: i, onClickCallback: s, getBase62params: o } = C.useContext(ee), { total: l, page: c, pageSize: u } = (o == null ? void 0 : o()) || {};
return n && !p.isEmpty(t) || a ? O("div", { className: V("ff-data-list-footer", e), children: [d("div", { className: "ff-data-list-actions", children: t == null ? void 0 : t.map((g, h) => d(P, { uuid: g.uuid, type: g.type, name: g.name, widget: g.widget, widgetType: g.widgetType, widgetProps: g.widgetProps, widgetData: g.widgetData, widgetSetting: g.widgetSetting, widgetContainerProps: g.widgetContainerSetting, onAfterClick: (y) => y !== !1 && (s == null ? void 0 : s(g.isRefresh, null)) }, g.uuid || h)) }), a && d($n, { size: "small", total: l, pageSize: u, showSizeChanger: !1, showTotal: (g) => `${c} 页 / 总共 ${g}`, onChange: r, onShowSizeChange: i })] }) : null;
}, ea = [{ title: "parent 1", key: "0-0", children: [{ title: "parent 1-0", key: "0-0-0", disabled: !0, children: [{ title: "leaf", key: "0-0-0-0", disableCheckbox: !0 }, { title: "leaf", key: "0-0-0-1" }] }, { title: "parent 1-1", key: "0-0-1", children: [{ title: d("span", { style: { color: "#1677ff" }, children: "sss" }), key: "0-0-1-0" }] }] }], ta = ({ className: e, width: t = 280, isTreeSider: n }) => {
return n && !p.isEmpty(t) || a ? O("div", { className: V("ff-data-list-footer", e), children: [d("div", { className: "ff-data-list-actions", children: t == null ? void 0 : t.map((g, h) => d(N, { uuid: g.uuid, type: g.type, name: g.name, widget: g.widget, widgetType: g.widgetType, widgetProps: g.widgetProps, widgetData: g.widgetData, widgetSetting: g.widgetSetting, widgetContainerProps: g.widgetContainerSetting, onAfterClick: (y) => y !== !1 && (s == null ? void 0 : s(g.isRefresh, null)) }, g.uuid || h)) }), a && d(Sn, { size: "small", total: l, pageSize: u, showSizeChanger: !1, showTotal: (g) => `${c} 页 / 总共 ${g}`, onChange: r, onShowSizeChange: i })] }) : null;
}, Zn = [{ title: "parent 1", key: "0-0", children: [{ title: "parent 1-0", key: "0-0-0", disabled: !0, children: [{ title: "leaf", key: "0-0-0-0", disableCheckbox: !0 }, { title: "leaf", key: "0-0-0-1" }] }, { title: "parent 1-1", key: "0-0-1", children: [{ title: d("span", { style: { color: "#1677ff" }, children: "sss" }), key: "0-0-1-0" }] }] }], ea = ({ className: e, width: t = 280, isTreeSider: n }) => {
const { classNames: a } = de(ee);
return n ? d(Pn.DirectoryTree, { className: V("ff-data-list-sider", a.sider, e), style: { "--sider-width": t }, showLine: !0, showIcon: !1, treeData: ea }) : null;
}, na = ({ className: e, title: t, tabs: n }) => {
const { getBase62params: a, onTabChange: r, onReload: i, classNames: s } = de(ee), { tab: o } = (a == null ? void 0 : a()) || {}, [l, c] = Ln((n == null ? void 0 : n[0].value) ?? (n == null ? void 0 : n[0].code), { value: o, onChange: r });
return O("div", { className: V("ff-data-list-toolbar", s.toolbar, e), children: [d("div", { className: "ff-data-list-title", children: t }), d(Nn, { className: "ff-data-list-tabs", itemRender: ({ label: u, code: g, value: h }) => d("span", { onClick: () => c(h ?? g), className: V("ff-data-list-tab", { active: (h ?? g) == l }), children: u }), items: n }), O("div", { className: "ff-data-list-actions", children: [d(P.Link, { icon: "icon-reload", widget: () => i() }), d(P.Link, { icon: "icon-setting" })] })] });
return n ? d($n.DirectoryTree, { className: V("ff-data-list-sider", a.sider, e), style: { "--sider-width": t }, showLine: !0, showIcon: !1, treeData: Zn }) : null;
}, ta = ({ className: e, title: t, tabs: n }) => {
const { getBase62params: a, onTabChange: r, onReload: i, classNames: s } = de(ee), { tab: o } = (a == null ? void 0 : a()) || {}, [l, c] = On((n == null ? void 0 : n[0].value) ?? (n == null ? void 0 : n[0].code), { value: o, onChange: r });
return O("div", { className: V("ff-data-list-toolbar", s.toolbar, e), children: [d("div", { className: "ff-data-list-title", children: t }), d(Pn, { className: "ff-data-list-tabs", itemRender: ({ label: u, code: g, value: h }) => d("span", { onClick: () => c(h ?? g), className: V("ff-data-list-tab", { active: (h ?? g) == l }), children: u }), items: n }), O("div", { className: "ff-data-list-actions", children: [d(N.Link, { icon: "icon-reload", widget: () => i() }), d(N.Link, { icon: "icon-setting" })] })] });
}, tn = ({ isItemGridLayout: e, theme: t, themeProps: n, onClickCallback: a, onReload: r, listCode: i, total: s = 0, page: o = 0, onPageChange: l, pageSize: c = 30, onPageSizeChange: u, tab: g, onTabChange: h, keyword: y, onKeywordChange: f, condition: b, onConditionChange: w, sider: $, onSiderChange: I, layouts: L, classNames: M = {}, ...j }) => {
const [A, T] = N(), v = G(() => {
let S = { sider: ta, filter: en, footer: Zn, toolbar: na };
L === !1 ? S = { sider: null, filter: null, footer: null, toolbar: null } : p.isPlainObject(L) && (S = Object.assign({}, S, L));
for (const U in S) S[U] || (S[U] = () => d(C.Fragment, {}));
return S;
const [A, P] = T(), S = G(() => {
let v = { sider: ea, filter: en, footer: Qn, toolbar: ta };
L === !1 ? v = { sider: null, filter: null, footer: null, toolbar: null } : p.isPlainObject(L) && (v = Object.assign({}, v, L));
for (const U in v) v[U] || (v[U] = () => d(C.Fragment, {}));
return v;
}, [L]);
return R(() => {
t ? Z.getWidgetComponent(t).then((S) => {
if (!S) throw `${t} not found`;
return S;
}).catch((S) => ({ default: () => `${S}` })).then((S) => T(C.createElement(S.default, { ...j, layouts: v, $setting: n }))) : T(d(e ? Gn : Xn, { ...j, layouts: v, $setting: n }));
}, [t, n]), d(ee.Provider, { value: { classNames: M, listCode: i, onClickCallback: a, onReload: r, getBase62params: (S, U) => {
const z = { tab: g, page: o, pageSize: c, keyword: y, sider: $, condition: b, total: s };
return S && S != "init" ? z[S] ?? U : z;
t ? Z.getWidgetComponent(t).then((v) => {
if (!v) throw `${t} not found`;
return v;
}).catch((v) => ({ default: () => `${v}` })).then((v) => P(C.createElement(v.default, { ...j, layouts: S, $setting: n }))) : P(d(e ? _n : Yn, { ...j, layouts: S, $setting: n }));
}, [t, n]), d(ee.Provider, { value: { classNames: M, listCode: i, onClickCallback: a, onReload: r, getBase62params: (v, U) => {
const W = { tab: g, page: o, pageSize: c, keyword: y, sider: $, condition: b, total: s };
return v && v != "init" ? W[v] ?? U : W;
}, onPageChange: l, onPageSizeChange: u, onTabChange: h, onSiderChange: I, onKeywordChange: f, onConditionChange: w }, children: A && C.cloneElement(A, j) });
};
tn.propTypes = { layouts: k.oneOfType([k.exact({ sider: k.elementType, filter: k.elementType, footer: k.elementType, toolbar: k.elementType }), k.bool]) };
@ -348,21 +348,21 @@ const ae = class ae {
};
me = new WeakMap(), oe = new WeakMap(), xe = new WeakMap(), et = new WeakMap(), E(ae, me, null), x(ae, "getInstance", () => (m(ae, me) || B(ae, me, new ae()), m(ae, me)));
let pt = ae;
const nn = pt.getInstance(), kt = C.forwardRef(({ listCode: e, base62params: t, className: n, itemClassName: a, theme: r, themeProps: i, layouts: s, classNames: o }, l) => {
const [{ resource: c, primaryKey: u, batchOperations: g = [], itemOperations: h = [], columns: y = [], themeConfig: f, theme: b, isConditionFormLayout: w = !1, isTreeSider: $, treeSiderConfig: I, isItemGridLayout: L, itemGridLayout: M, title: j, isPaginate: A, tabs: T }, v] = N({ isItemGridLayout: !1, itemGridLayout: {} }), S = _n(e, t), [{ dataSource: U, itemOperationsAccess: z, condition: K, tab: ue, keyword: _, page: nt, total: De, pageSize: at, sider: Nt, onConditionChange: gn, onTabChange: pn, onKeywordChange: mn, onPageChange: hn, onPageSizeChange: fn, onSiderChange: yn, onReload: rt }, Tt] = Kn(S, e, u, c), wn = gt(h, U, z, u), bn = gt(g);
const nn = pt.getInstance(), kt = C.forwardRef(({ listCode: e, base62params: t, className: n, theme: a, themeProps: r, layouts: i, classNames: s }, o) => {
const [{ resource: l, primaryKey: c, batchOperations: u = [], itemOperations: g = [], columns: h = [], themeConfig: y, theme: f, isConditionFormLayout: b = !1, isTreeSider: w, treeSiderConfig: $, isItemGridLayout: I, itemGridLayout: L, title: M, isPaginate: j, tabs: A }, P] = T({ isItemGridLayout: !1, itemGridLayout: {} }), S = Kn(e, t), [{ dataSource: v, itemOperationsAccess: U, condition: W, tab: K, keyword: ue, page: _, total: nt, pageSize: De, sider: at, onConditionChange: Nt, onTabChange: gn, onKeywordChange: pn, onPageChange: mn, onPageSizeChange: hn, onSiderChange: fn, onReload: rt }, Tt] = Jn(S, e, c, l), yn = gt(g, v, U, c), wn = gt(u);
return R(() => {
let qe = null;
return e && F.get(`/api/_/${e}`).resp(({ data: He, res: Cn }) => {
He != null && He.isDynamicRefresh && (qe = nn.subscribe(() => rt(), Cn)), v(He);
}).catch(() => v({})), () => qe == null ? void 0 : qe();
}, [e]), C.useImperativeHandle(l, () => ({ onReload: rt, onClickCallback: Tt })), d(tn, { listCode: e, title: j, itemClassName: a, classNames: o, resource: c, primaryKey: u, theme: r || b, themeProps: i || f, isTreeSider: $, treeSiderConfig: I, isPaginate: A, tabs: T, isItemOperations: wn, isBatchOperations: bn, batchOperations: g, itemOperations: h, isItemGridLayout: L, columns: y, itemGridLayout: M, isConditionFormLayout: w, itemOperationsAccess: z, dataSource: U, onConditionChange: gn, onTabChange: pn, onKeywordChange: mn, onPageChange: hn, onPageSizeChange: fn, onSiderChange: yn, condition: K, tab: ue, keyword: _, page: nt, total: De, pageSize: at, sider: Nt, layouts: { footer: null }, className: V("ff-data-list-helper", n), onReload: rt, onClickCallback: Tt });
}), an = (e, t, n = !0) => n !== !0 && n-- <= 0 ? [] : p.isArray(e) && !p.isEmpty(e) ? e.reduce((a, r) => (Reflect.has(r, t) && Reflect.has(r, "children") && a.push(r[t]), Reflect.has(r, "children") && !p.isEmpty(r.children) ? a.concat(an(r.children, t, n)) : a), []) : [], aa = ({ className: e, primaryKey: t, columns: n = [], dataSource: a = [], operationRender: r, operationWidth: i = 180, ...s }) => {
return e && F.get(`/api/_/${e}`).resp(({ data: He, res: bn }) => {
He != null && He.isDynamicRefresh && (qe = nn.subscribe(() => rt(), bn)), P(He);
}).catch(() => P({})), () => qe == null ? void 0 : qe();
}, [e]), C.useImperativeHandle(o, () => ({ onReload: rt, onClickCallback: Tt })), d(tn, { listCode: e, title: M, classNames: s, layouts: i, resource: l, primaryKey: c, theme: a || f, themeProps: r || y, isTreeSider: w, treeSiderConfig: $, isPaginate: j, tabs: A, isItemOperations: yn, isBatchOperations: wn, batchOperations: u, itemOperations: g, isItemGridLayout: I, columns: h, itemGridLayout: L, isConditionFormLayout: b, itemOperationsAccess: U, dataSource: v, onConditionChange: Nt, onTabChange: gn, onKeywordChange: pn, onPageChange: mn, onPageSizeChange: hn, onSiderChange: fn, condition: W, tab: K, keyword: ue, page: _, total: nt, pageSize: De, sider: at, className: V("ff-data-list-helper", n), onReload: rt, onClickCallback: Tt });
}), an = (e, t, n = !0) => n !== !0 && n-- <= 0 ? [] : p.isArray(e) && !p.isEmpty(e) ? e.reduce((a, r) => (Reflect.has(r, t) && Reflect.has(r, "children") && a.push(r[t]), Reflect.has(r, "children") && !p.isEmpty(r.children) ? a.concat(an(r.children, t, n)) : a), []) : [], na = ({ className: e, primaryKey: t, columns: n = [], dataSource: a = [], operationRender: r, operationWidth: i = 180, ...s }) => {
const { classNames: o } = de(ee);
Ge();
const l = D(null), c = D(null), [u, g] = N([]), [h, y] = N({ width: 0, height: 0 });
const l = D(null), c = D(null), [u, g] = T([]), [h, y] = T({ width: 0, height: 0 });
R(() => {
g(an(a, t));
}, [a, t]), xn(() => {
}, [a, t]), vn(() => {
const b = new ResizeObserver(() => {
var w;
y({ width: ((w = l.current) == null ? void 0 : w.nativeElement.querySelector(".ant-table-body").scrollWidth) || c.current.offsetWidth, height: c.current.offsetHeight });
@ -371,10 +371,10 @@ const nn = pt.getInstance(), kt = C.forwardRef(({ listCode: e, base62params: t,
c.current && b.unobserve(c.current);
};
}, []);
const f = Jn(n);
return d("div", { ref: c, className: V("ff-data-list-table", o.content, e), children: h.height ? d(Tn, { ...s, ref: l, rowKey: (b) => (b == null ? void 0 : b[t]) ?? Math.random(), columns: f == null ? void 0 : f.concat(r ? [{ title: "操作", align: "center", fixed: "right", width: `${Math.ceil(i / h.width * 100).toFixed(2)}%`, render: (b, w, $) => r(w, $) }] : []), dataSource: a, size: "middle", scroll: { x: "max-content", y: h.height - 50 }, pagination: !1, expandable: { defaultExpandAllRows: !0, expandRowByClick: !0, onExpandedRowsChange: g, expandedRowKeys: u } }) : null });
}, ra = "RC_FORM_INTERNAL_HOOKS", rn = (e, { initialValue: t, initialValueLanguage: n, convertJs: a, convertJsSetting: r, type: i = "string" }, s = null) => {
const o = D(!1), l = de(Vn), [c, u] = N(), [g, h] = N(n != "javascript" && e ? l.getFieldValue(e) : void 0), { registerWatch: y } = l.getInternalHooks(ra) || {};
const f = Hn(n);
return d("div", { ref: c, className: V("ff-data-list-table", o.content, e), children: h.height ? d(Nn, { ...s, ref: l, rowKey: (b) => (b == null ? void 0 : b[t]) ?? Math.random(), columns: f == null ? void 0 : f.concat(r ? [{ title: "操作", align: "center", fixed: "right", width: `${Math.ceil(i / h.width * 100).toFixed(2)}%`, render: (b, w, $) => r(w, $) }] : []), dataSource: a, size: "middle", scroll: { x: "max-content", y: h.height - 50 }, pagination: !1, expandable: { defaultExpandAllRows: !0, expandRowByClick: !0, onExpandedRowsChange: g, expandedRowKeys: u } }) : null });
}, aa = "RC_FORM_INTERNAL_HOOKS", rn = (e, { initialValue: t, initialValueLanguage: n, convertJs: a, convertJsSetting: r, type: i = "string" }, s = null) => {
const o = D(!1), l = de(Ln), [c, u] = T(), [g, h] = T(n != "javascript" && e ? l.getFieldValue(e) : void 0), { registerWatch: y } = l.getInternalHooks(aa) || {};
return R(() => y == null ? void 0 : y((f, b, w) => {
if (!o.current) return;
const $ = p.get(b, e);
@ -388,9 +388,9 @@ const nn = pt.getInstance(), kt = C.forwardRef(({ listCode: e, base62params: t,
}, [g, a, r]), [c ?? g, g];
}, sn = (e, t, n = "@pkg/ff/grid-layouts", a = null) => G(() => {
var r;
return (r = p.sortBy(e, ["y", "x"])) == null ? void 0 : r.map(({ i, x: s, y: o, w: l, h: c, field: { boxStyle: u, widgetPrefix: g = n, widget: h, ...y } }, f) => d("div", { className: "grid-layout-item", style: Zt(s, o, l, c, u, h === "Height" && (y == null ? void 0 : y.initialValue)), children: d(ia, { ...y, basicForm: a, itemWidget: h != null && h.startsWith("@") || h != null && h.startsWith("blob:") ? h : `${g}/${h}`, itemWidgetRender: t }) }, i || f));
}, [e]), ia = ({ itemWidget: e, itemWidgetRender: t, basicForm: n, ...a }) => {
const [r, i] = N();
return (r = p.sortBy(e, ["y", "x"])) == null ? void 0 : r.map(({ i, x: s, y: o, w: l, h: c, field: { boxStyle: u, widgetPrefix: g = n, widget: h, ...y } }, f) => d("div", { className: "grid-layout-item", style: Zt(s, o, l, c, u, h === "Height" && (y == null ? void 0 : y.initialValue)), children: d(ra, { ...y, basicForm: a, itemWidget: h != null && h.startsWith("@") || h != null && h.startsWith("blob:") ? h : `${g}/${h}`, itemWidgetRender: t }) }, i || f));
}, [e]), ra = ({ itemWidget: e, itemWidgetRender: t, basicForm: n, ...a }) => {
const [r, i] = T();
return R(() => {
Z.getWidgetComponent(e).then(({ defaultProps: s = {}, default: o }) => {
i(C.createElement(t(o, s, n), a));
@ -399,39 +399,39 @@ const nn = pt.getInstance(), kt = C.forwardRef(({ listCode: e, base62params: t,
});
}, [e]), r;
}, on = ({ cols: e = 12, rowHeight: t = 21, fields: n = [], data: a, containerPadding: r = [0, 0], itemMargin: i = [4, 0], formProps: s = {}, className: o, ...l }) => {
const [c] = Q.useForm(), u = sn(n, sa, "@pkg/ff/grid-layouts"), g = G(() => [{ name: "__PROPS__", value: s }], [s]);
const [c] = Q.useForm(), u = sn(n, ia, "@pkg/ff/grid-layouts"), g = G(() => [{ name: "__PROPS__", value: s }], [s]);
return Be(() => (c.setFieldsValue(a), () => c.resetFields()), [a]), d(Q, { fields: g, form: c, component: !1, children: d("div", { ...l, className: V("ff-grid-layout", o), style: { "--grid-layout-item-margin-y": `${(i == null ? void 0 : i[0]) || 0}px`, "--grid-layout-item-margin-x": `${(i == null ? void 0 : i[1]) || 0}px`, "--grid-layout-container-padding-y": `${(r == null ? void 0 : r[0]) || 0}px`, "--grid-layout-container-padding-x": `${(r == null ? void 0 : r[1]) || 0}px`, "--grid-layout-cols": e, "--grid-layout-row-height": `${t}px` }, children: u }) });
}, sa = (e, t = {}, n = null) => (a) => {
}, ia = (e, t = {}, n = null) => (a) => {
const { code: r, label: i, extras: s, isVirtual: o, initialValue: l, initialValueLanguage: c, convertJs: u, convertJsSetting: g, ...h } = p.merge({}, t, a), [y, f] = rn(o ? null : r, { initialValue: l, initialValueLanguage: c, convertJs: u, convertJsSetting: g, type: (h == null ? void 0 : h.type) || "string" }, n);
return d(e, { ...h, value: y, rawValue: f, $setting: s || {} });
}, cr = (At = on, function({ code: e, data: t, ...n }) {
const [a, r] = N({ resource: null, cols: 12, rowHeight: 21, fields: [] });
}, lr = (At = on, function({ code: e, data: t, ...n }) {
const [a, r] = T({ resource: null, cols: 12, rowHeight: 21, fields: [] });
return R(() => {
e && F.get(`/api/_/${e}`).then((i) => r(p.pick(i, ["resource", "cols", "rowHeight", "fields"])));
}, [e]), (a == null ? void 0 : a.resource) && d(At, { ...n, rowHeight: a.rowHeight, cols: a.cols, fields: a.fields, data: a != null && a.resource ? { [a == null ? void 0 : a.resource]: t } : {} });
});
var At;
const dr = ({ widget: e, widgetPrefix: t = "@pkg/ff/grid-layouts", basicForm: n, ...a }) => {
const r = e != null && e.startsWith("@") || e != null && e.startsWith("blob:") ? e : `${t}/${e}`, [i, s] = N();
const cr = ({ widget: e, widgetPrefix: t = "@pkg/ff/grid-layouts", basicForm: n, ...a }) => {
const r = e != null && e.startsWith("@") || e != null && e.startsWith("blob:") ? e : `${t}/${e}`, [i, s] = T();
return R(() => {
r && Z.getWidgetComponent(r).then(({ defaultProps: o = {}, default: l }) => ({ default: oa(l, o, n) })).catch((o) => ({ default: () => `${o}` })).then((o) => s(C.createElement(o.default, a)));
r && Z.getWidgetComponent(r).then(({ defaultProps: o = {}, default: l }) => ({ default: sa(l, o, n) })).catch((o) => ({ default: () => `${o}` })).then((o) => s(C.createElement(o.default, a)));
}, [r]), i;
}, oa = (e, t = {}, n = null) => (a) => {
}, sa = (e, t = {}, n = null) => (a) => {
const { code: r, label: i, extras: s, isVirtual: o, initialValue: l, initialValueLanguage: c, convertJs: u, convertJsSetting: g, value: h, ...y } = p.merge({}, t, a), [f, b] = rn(o ? null : r, { initialValue: l, initialValueLanguage: c, convertJs: u, convertJsSetting: g, type: (y == null ? void 0 : y.type) || "string" }, n);
return d(e, { ...y, value: f, rawValue: b, $setting: s || {} });
}, la = ({ cols: e, rowHeight: t, itemMargin: n, fields: a, primaryKey: r, dataSource: i, itemClassName: s, itemRender: o = (g, h, y) => g, empty: l = d(En, { description: null }), className: c, style: u = {} }) => {
}, oa = ({ cols: e, rowHeight: t, itemMargin: n, fields: a, primaryKey: r, dataSource: i, itemClassName: s, itemRender: o = (g, h, y) => g, empty: l = d(Tn, { description: null }), className: c, style: u = {} }) => {
const { classNames: g } = de(ee), h = Ge(), y = G(() => d(on, { cols: e, rowHeight: t, itemMargin: n, fields: a, className: s }), [a, e, t, n]);
return d("div", { className: V("ff-data-list-content", g.content, c), style: u, children: p.isEmpty(i) ? l : i.map((f, b) => {
const w = o(C.cloneElement(y, { data: f }), f, b);
return C.cloneElement(w, { key: `${h}-${(f == null ? void 0 : f[r]) || b}` });
}) });
}, ca = ({ component: e }) => {
const { base62params: t } = jn();
}, la = ({ component: e }) => {
const { base62params: t } = Vn();
return d(J, { children: d(kt, { listCode: e, base62params: F.decode(t) }) });
}, da = () => "Empty", ua = ({ component: e, $setting: t }) => {
const [n, a] = N();
}, ca = () => "Empty", da = ({ component: e, $setting: t }) => {
const [n, a] = T();
R(() => {
if (!e) return a(d(da, { description: null }));
if (!e) return a(d(ca, { description: null }));
Z.getWidgetComponent(e).catch((i) => ({ default: () => `${i}` })).then((i) => C.createElement(i.default, { $setting: t })).then(a);
}, [e]);
const r = le.getPageParams() || {};
@ -449,7 +449,7 @@ const re = class re {
x(this, "get", (t) => (m(this, Y).has(t) || (t = Array.from(m(this, Y).keys()).find((n) => m(this, Y).get(n).uri === t)), m(this, Y).get(t) || {}));
x(this, "redirect", (t, n, a = {}) => {
const { uri: r, type: i, widgetProps: s } = this.get(t) || {};
let o = An(r || t, i != "list" ? n : p.mapValues(n, (c) => F.encode(c)));
let o = jn(r || t, i != "list" ? n : p.mapValues(n, (c) => F.encode(c)));
const l = new URLSearchParams();
for (const c in s || {}) (s == null ? void 0 : s.type) == "query" && l.append(c, n[c]);
return l.size > 0 && (o = `${o}?${l.toString()}`), m(this, ye).navigate(o, a);
@ -506,10 +506,10 @@ const re = class re {
let $ = {}, I = 0;
switch (g) {
case "list":
$.element = C.createElement(ca, { component: h });
$.element = C.createElement(la, { component: h });
break;
case "fsdpf-component":
$.element = C.createElement(ua, { key: h, component: h, $setting: y });
$.element = C.createElement(da, { key: h, component: h, $setting: y });
}
if (w != null && w.layout) {
if (!r[w == null ? void 0 : w.layout]) return r[w == null ? void 0 : w.layout] = o.length, [...o, { path: "/", lazy: i(w == null ? void 0 : w.layout, {}), children: [{ path: c, ...$ }] }];
@ -517,29 +517,29 @@ const re = class re {
}
return b && I > -1 ? (o[I].children.push({ path: c, ...$ }), o) : [...o, { path: c, ...$ }];
}, [{ path: "/", lazy: i(n, {}), children: [] }]);
return s.push({ index: !0, element: C.createElement(ga, { to: a, replace: !0 }) }), B(this, ye, In(s, t));
return s.push({ index: !0, element: C.createElement(ua, { to: a, replace: !0 }) }), B(this, ye, An(s, t));
});
if (m(re, he)) return m(re, he);
}
};
he = new WeakMap(), Y = new WeakMap(), fe = new WeakMap(), ye = new WeakMap(), Me = new WeakMap(), ze = new WeakMap(), E(re, he, null), x(re, "getInstance", () => (m(re, he) || B(re, he, new re()), m(re, he)));
let mt = re;
const ga = ({ to: e, replace: t }) => Mn() ? C.createElement(zn, { to: e, replace: t }) : (window.document.location = e, "redirect"), le = mt.getInstance(), Se = new Worker(new URL("/ff-worker/index.js", self.location)), It = { getConfigure: (e) => Oe.get(e), route: { redirect: (...e) => le.redirect(...e), getPageParams: (...e) => le.getPageParams(...e), getCurrentRoute: () => le.getCurrentRoute() }, popup: { notification: (...e) => H.notification(...e), success: (...e) => H.success(...e), error: (...e) => H.error(...e), form: (...e) => H.form(...e), modal: (...e) => H.modal(...e), confirm: (...e) => H.confirm(...e) } };
const ua = ({ to: e, replace: t }) => In() ? C.createElement(Mn, { to: e, replace: t }) : (window.document.location = e, "redirect"), le = mt.getInstance(), Se = new Worker(new URL("/ff-worker/index.js", self.location)), It = { getConfigure: (e) => Oe.get(e), route: { redirect: (...e) => le.redirect(...e), getPageParams: (...e) => le.getPageParams(...e), getCurrentRoute: () => le.getCurrentRoute() }, popup: { notification: (...e) => H.notification(...e), success: (...e) => H.success(...e), error: (...e) => H.error(...e), form: (...e) => H.form(...e), modal: (...e) => H.modal(...e), confirm: (...e) => H.confirm(...e) } };
var tt, Te, we;
const W = class W {
const z = class z {
constructor() {
x(this, "exec", (t, n = {}, a = {}, r = "") => new Promise((i, s) => {
const o = Ft(W, tt)._++;
m(W, Te).set(o, a), W.mQueue.set(o, [i, s]), Se.postMessage({ id: o, session: r, category: "eval", method: t, args: n });
const o = Ft(z, tt)._++;
m(z, Te).set(o, a), z.mQueue.set(o, [i, s]), Se.postMessage({ id: o, session: r, category: "eval", method: t, args: n });
}));
x(this, "clear", (t) => Se.postMessage({ session: t, category: "clear" }));
if (m(W, we)) return m(W, we);
Promise.resolve().then(() => Aa).then((t) => {
if (m(z, we)) return m(z, we);
Promise.resolve().then(() => ja).then((t) => {
It.http = t.http;
}), Se.addEventListener("message", ({ data: { id: t, task_id: n, method: a, args: r, category: i, data: s, error: o, session: l } }) => {
if (i === "eval" && W.mQueue.has(t)) o !== null ? W.mQueue.get(t)[1](o) : W.mQueue.get(t)[0](s), m(W, Te).delete(t), W.mQueue.delete(t);
if (i === "eval" && z.mQueue.has(t)) o !== null ? z.mQueue.get(t)[1](o) : z.mQueue.get(t)[0](s), m(z, Te).delete(t), z.mQueue.delete(t);
else if (i === "util") try {
const c = p.get(It, a.split("/")) || p.get(m(W, Te).get(n), a.split("/"));
const c = p.get(It, a.split("/")) || p.get(m(z, Te).get(n), a.split("/"));
if (!p.isFunction(c)) throw `${a} not found`;
Promise.resolve(Reflect.apply(c, void 0, r)).then((u) => {
Se.postMessage({ id: t, task_id: n, category: i, method: a, args: r, session: l, data: u, error: null });
@ -552,18 +552,18 @@ const W = class W {
}, !1);
}
};
tt = new WeakMap(), Te = new WeakMap(), we = new WeakMap(), x(W, "mQueue", /* @__PURE__ */ new Map()), E(W, tt, 0), E(W, Te, /* @__PURE__ */ new Map()), E(W, we, null), x(W, "getInstance", () => (m(W, we) || B(W, we, new W()), m(W, we)));
let ht = W;
tt = new WeakMap(), Te = new WeakMap(), we = new WeakMap(), x(z, "mQueue", /* @__PURE__ */ new Map()), E(z, tt, 0), E(z, Te, /* @__PURE__ */ new Map()), E(z, we, null), x(z, "getInstance", () => (m(z, we) || B(z, we, new z()), m(z, we)));
let ht = z;
const Ce = ht.getInstance(), vt = () => {
const e = D(!0), [, t] = C.useReducer((n) => n + 1, 0);
return R(() => () => e.current = !1, []), () => e.current && t();
}, ur = (e) => {
}, dr = (e) => {
const t = D();
return R(() => {
t.current = e;
}, [e]), t.current;
}, gr = (e) => {
const [t, n] = N(e), a = D(null), r = ce((i, s) => {
}, ur = (e) => {
const [t, n] = T(e), a = D(null), r = ce((i, s) => {
a.current = s, n(i);
}, []);
return R(() => {
@ -578,15 +578,15 @@ const Ce = ht.getInstance(), vt = () => {
if (!Array.isArray(e)) return e;
for (let a = 0; a < e.length; a++) e[a].value = X((n = e[a]) == null ? void 0 : n.value, t), e[a] && Reflect.has(e[a], "children") && (e[a].children = ln(e[a].children, t));
return e;
}, pr = (e, t = "json", n = "string", a, r = null) => {
const [i] = Q.useForm(a), [s, o] = N([{ label: "无", value: "", disabled: !0 }]), l = D([]), c = Q.useWatch((u) => l.current.length === 0 ? null : p.pick(u, l.current), i) || null;
}, gr = (e, t = "json", n = "string", a, r = null) => {
const [i] = Q.useForm(a), [s, o] = T([{ label: "无", value: "", disabled: !0 }]), l = D([]), c = Q.useWatch((u) => l.current.length === 0 ? null : p.pick(u, l.current), i) || null;
return R(() => {
Array.isArray(e) ? o(e) : t === "javascript" && e ? Ce.exec(e, {}, { getFieldValue: (u) => (l.current.includes(u) || l.current.push(u), i.getFieldValue(u)), getFieldValueForBasicForm: (u) => (l.current.includes(u) || l.current.push(u), r ? r.getFieldValue(u) : i.getFieldValue(u)) }).then((u) => {
o(X(u, "array"));
}) : e && o(X(e, "array"));
}, [e, t, c]), ln(s, n);
}, mr = (e) => {
const [t, n] = N(), a = { type: "GET" };
}, pr = (e) => {
const [t, n] = T(), a = { type: "GET" };
if (typeof e == "string" ? a.url = e : p.isPlainObject(e) && Object.assign(a, e), !(a != null && a.url)) throw "url is required";
const r = (i) => F.request(a, !1).resp((s) => (console.log("useSubscribeRequest", i), n(s), s));
return Be(() => {
@ -595,7 +595,7 @@ const Ce = ht.getInstance(), vt = () => {
i = nn.subscribe(p.throttle(r, 180, { leading: !1, trailing: !0 }), s.res);
}), () => i == null ? void 0 : i();
}, a), t;
}, pa = (e) => {
}, ga = (e) => {
const [t, n] = C.useState({ gridItems: [], hideItems: [] });
return C.useEffect(() => {
e && F.get(`/api/_/${e}`).then(({ pk: a, uuid: r, code: i, resource: s, align: o, cols: l, rowHeight: c, marginX: u, marginY: g, listenChangeFields: h, listenChangeFieldsFunc: y, fields: f }) => ({ pk: a, uuid: r, code: i, resource: s, align: o, cols: l, rowHeight: c, marginX: u, marginY: g, listenChangeFields: h, listenChangeFieldsFunc: y, ...f.reduce((b, w) => {
@ -603,8 +603,8 @@ const Ce = ht.getInstance(), vt = () => {
return ($ = w == null ? void 0 : w.field) != null && $.hidden ? b.hides.push(w == null ? void 0 : w.field) : b.items.push(w), b;
}, { items: [], hides: [] }) })).then(n);
}, [e]), t;
}, ma = ({ max: e = 0, min: t = 0, type: n = "", message: a, pattern: r, required: i = !1, validator: s } = {}, o, l) => {
const [c, u] = N([]);
}, pa = ({ max: e = 0, min: t = 0, type: n = "", message: a, pattern: r, required: i = !1, validator: s } = {}, o, l) => {
const [c, u] = T([]);
return R(() => {
const g = [];
if (i) {
@ -637,67 +637,67 @@ const Ce = ht.getInstance(), vt = () => {
}
u(g);
}, [e, t, n, a, r, i, s]), c;
}, ha = (e, t, n) => {
const [a, r] = N(null);
}, ma = (e, t, n) => {
const [a, r] = T(null);
return R(() => {
const { initDataUri: i = `/api/${e}`, initDataMethod: s = "GET" } = n || {};
t && F.request({ method: s, url: p.trimEnd(`${i}/${t}`, "/") }).then((o) => {
r(o);
});
}, [e, t, n]), a;
}, fa = (e, t, n, a = {}) => {
const r = vt(), i = D(!0), s = D([]), [o, l] = N(n), c = Q.useWatch((u) => JSON.stringify(p.pick(u, s.current)), t) || "{}";
}, ha = (e, t, n, a = {}) => {
const r = vt(), i = D(!0), s = D([]), [o, l] = T(n), c = Q.useWatch((u) => JSON.stringify(p.pick(u, s.current)), t) || "{}";
return R(() => {
e && Ce.exec(e, a, { getFieldValue: p.wrap(t.getFieldValue, (u, g) => (s.current.some((h) => p.isEqual(h, g)) || (s.current.push(g), r()), u(g))), isFieldTouched: t.isFieldTouched, isFieldsTouched: t.isFieldsTouched }).then((u) => i.current && l(u));
}, [e, c, t, a]), R(() => () => i.current = !1, []), o;
}, hr = ({ value: e, onChange: t }, n = null) => {
}, mr = ({ value: e, onChange: t }, n = null) => {
const a = D(), [r] = Q.useForm(n);
return xt(() => {
p.isEqual(a.current, e) || r.setFieldsValue(e);
}, [e]), R(() => () => r.resetFields(), []), [G(() => r.__INTERNAL__ ? r : { ...r, __INTERNAL__: {} }, [r]), (i, s) => {
a.current = s, t(s);
}];
}, ya = ({ type: e, initialValue: t, initialValueLanguage: n, onChange: a, form: r }) => {
const i = fa(n == "javascript" && t, r, n == "javascript" ? void 0 : t, {});
}, fa = ({ type: e, initialValue: t, initialValueLanguage: n, onChange: a, form: r }) => {
const i = ha(n == "javascript" && t, r, n == "javascript" ? void 0 : t, {});
return R(() => {
n == "javascript" ? a(X(i, e)) : t && a(X(t, e));
}, [e, t, i]), null;
}, wa = ({ widget: e = "Input", widgetPrefix: t = "@pkg/ff/grid-layout-forms", widgetDecorator: n, subWidgets: a, basicForm: r, ...i }) => {
const s = e != null && e.startsWith("@") || e != null && e.startsWith("blob:") ? e : `${t}/${e}`, [o, l] = N();
}, ya = ({ widget: e = "Input", widgetPrefix: t = "@pkg/ff/grid-layout-forms", widgetDecorator: n, subWidgets: a, basicForm: r, ...i }) => {
const s = e != null && e.startsWith("@") || e != null && e.startsWith("blob:") ? e : `${t}/${e}`, [o, l] = T();
return R(() => {
s && Z.getWidgetComponent(s).then(({ defaultProps: c = {}, default: u }) => ({ default: cn(u, c, r) })).catch((c) => ({ default: () => `${c}` })).then((c) => l(C.createElement(c.default, i)));
}, [s]), o && C.cloneElement(o, i);
}, cn = (e, t = {}, n = null) => (a) => {
const { type: r, code: i, label: s, noStyle: o, placeholder: l, extras: c, validators: u, help: g, isVirtual: h, $isReserved: y, initialValue: f, initialValueLanguage: b, convertJs: w, convertJsSetting: $, widgetPerfix: I, boxStyle: L, widgetDecorator: M, subWidgets: j, ...A } = { ...t, ...a }, T = ma(u || {}, i, r), v = { label: s, noStyle: o, colon: !1, layout: "vertical" }, S = { placeholder: l, ...A }, U = ce((z) => z == null ? void 0 : X(z, r), [r]);
return d(Ht, { name: i, rules: T, initialValue: U(f), normalize: U, children: (z, K, ue) => {
const { type: r, code: i, label: s, noStyle: o, placeholder: l, extras: c, validators: u, help: g, isVirtual: h, $isReserved: y, initialValue: f, initialValueLanguage: b, convertJs: w, convertJsSetting: $, widgetPerfix: I, boxStyle: L, widgetDecorator: M, subWidgets: j, ...A } = { ...t, ...a }, P = pa(u || {}, i, r), S = { label: s, noStyle: o, colon: !1, layout: "vertical" }, v = { placeholder: l, ...A }, U = ce((W) => W == null ? void 0 : X(W, r), [r]);
return d(Ht, { name: i, rules: P, initialValue: U(f), normalize: U, children: (W, K, ue) => {
var _;
return d(e, { type: r, rcform: ue, itemProps: { validateStatus: K.errors.length > 0 ? "error" : "success", tooltip: g, help: K.errors.length > 0 ? K.errors.join("、") : null, required: ((_ = T == null ? void 0 : T[0]) == null ? void 0 : _.required) || !1, ...v }, fieldProps: { ...S, ...z }, $setting: c || {} });
return d(e, { type: r, rcform: ue, itemProps: { validateStatus: K.errors.length > 0 ? "error" : "success", tooltip: g, help: K.errors.length > 0 ? K.errors.join("、") : null, required: ((_ = P == null ? void 0 : P[0]) == null ? void 0 : _.required) || !1, ...S }, fieldProps: { ...v, ...W }, $setting: c || {} });
} });
}, St = ({ cols: e = 24, rowHeight: t = 16, itemMargin: n = [8, 16], containerPadding: a = [0, 0], fields: r = [], children: i, basicForm: s = null }) => {
const o = sn(r, cn, "@pkg/ff/grid-layout-forms");
return O("div", { className: "ff-grid-layout-form", style: { "--grid-layout-item-margin-x": `${(n == null ? void 0 : n[0]) ?? 8}px`, "--grid-layout-item-margin-y": `${(n == null ? void 0 : n[1]) ?? 16}px`, "--grid-layout-container-padding-y": `${(a == null ? void 0 : a[0]) || 0}px`, "--grid-layout-container-padding-x": `${(a == null ? void 0 : a[1]) || 0}px`, "--grid-layout-cols": e, "--grid-layout-row-height": `${t}px` }, children: [o, i && C.cloneElement(i, { cols: e, rowHeight: t, itemMargin: n, containerPadding: a, fields: r })] });
};
St.propTypes = { fields: k.array };
const ba = (Mt = St, ({ code: e, layout: t, name: n, primaryKey: a = 0, style: r = {}, formProps: i = {}, form: s, isPreview: o = !1, className: l, onFinish: c, onValuesChange: u = () => {
const wa = (Mt = St, ({ code: e, layout: t, name: n, primaryKey: a = 0, style: r = {}, formProps: i = {}, form: s, isPreview: o = !1, className: l, onFinish: c, onValuesChange: u = () => {
}, ...g }) => {
const { align: h, autoComplete: y, resource: f, items: b, hides: w, rowHeight: $, marginX: I, marginY: L, cols: M, listenChangeFields: j, listenChangeFieldsFunc: A, pk: T, uuid: v } = pa(e), [S] = Q.useForm(s), U = G(() => [{ name: "__PK__", value: T }, { name: "__PROPS__", value: i }, { name: "__RESOURCE__", value: f }, { name: "__LAYOUT_KEY__", value: e }, { name: "__LAYOUT_UUID__", value: v }, { name: "__PRIMARY_KEY__", value: a }], [T, e, v, f, a, i]);
return O(Q, { className: l, name: n || e, layout: t || h, fields: U, form: S, autoComplete: y, style: { ...r, position: "relative" }, onFinish: c, onValuesChange: (z, K) => (({ changedValues: ue, allValues: _, listenChangeFields: nt, listenChangeFieldsFunc: De, onValuesChange: at, code: Nt }) => {
at(ue, _), De && Array.isArray(nt) && Ce.exec(De, { changedValues: ue, allValues: _ }, { getFieldValue: S.getFieldValue, setFieldValue: S.setFieldValue, setFieldsValue: S.setFieldsValue, isFieldTouched: S.isFieldTouched, isFieldsTouched: S.isFieldsTouched });
})({ changedValues: z, allValues: K, listenChangeFields: j, listenChangeFieldsFunc: A, onValuesChange: u, code: e }), children: [d(Mt, { ...g, form: S, code: e, fields: b, cols: M, rowHeight: $, itemMargin: [I, L] }), w == null ? void 0 : w.map((z) => {
const { align: h, autoComplete: y, resource: f, items: b, hides: w, rowHeight: $, marginX: I, marginY: L, cols: M, listenChangeFields: j, listenChangeFieldsFunc: A, pk: P, uuid: S } = ga(e), [v] = Q.useForm(s), U = G(() => [{ name: "__PK__", value: P }, { name: "__PROPS__", value: i }, { name: "__RESOURCE__", value: f }, { name: "__LAYOUT_KEY__", value: e }, { name: "__LAYOUT_UUID__", value: S }, { name: "__PRIMARY_KEY__", value: a }], [P, e, S, f, a, i]);
return O(Q, { className: l, name: n || e, layout: t || h, fields: U, form: v, autoComplete: y, style: { ...r, position: "relative" }, onFinish: c, onValuesChange: (W, K) => (({ changedValues: ue, allValues: _, listenChangeFields: nt, listenChangeFieldsFunc: De, onValuesChange: at, code: Nt }) => {
at(ue, _), De && Array.isArray(nt) && Ce.exec(De, { changedValues: ue, allValues: _ }, { getFieldValue: v.getFieldValue, setFieldValue: v.setFieldValue, setFieldsValue: v.setFieldsValue, isFieldTouched: v.isFieldTouched, isFieldsTouched: v.isFieldsTouched });
})({ changedValues: W, allValues: K, listenChangeFields: j, listenChangeFieldsFunc: A, onValuesChange: u, code: e }), children: [d(Mt, { ...g, form: v, code: e, fields: b, cols: M, rowHeight: $, itemMargin: [I, L] }), w == null ? void 0 : w.map((W) => {
var K;
return d(Ht, { name: z.code, children: d(ya, { form: S, name: z.code, type: z.type, initialValue: z.initialValue, initialValueLanguage: (K = z.extras) == null ? void 0 : K.initialValueLanguage }) }, JSON.stringify(z.code));
return d(Ht, { name: W.code, children: d(fa, { form: v, name: W.code, type: W.type, initialValue: W.initialValue, initialValueLanguage: (K = W.extras) == null ? void 0 : K.initialValueLanguage }) }, JSON.stringify(W.code));
})] }, e);
});
var Mt;
const dn = ({ $setting: e, $close: t, extras: n, code: a, primaryKey: r, ...i }) => {
const [s] = Q.useForm(), o = ha(a, r, e);
const [s] = Q.useForm(), o = ma(a, r, e);
return R(() => {
o && s.setFieldsValue(o);
}, [o]), d(J, { actions: O(C.Fragment, { children: [d(P, { name: "保存", type: "primary", widget: () => {
}, [o]), d(J, { actions: O(C.Fragment, { children: [d(N, { name: "保存", type: "primary", widget: () => {
const l = s.getFieldValue("__RESOURCE__"), { initDataUri: c = `/api/${a}` } = e || {};
s.validateFields(!0).then((u) => l ? p.pick(u, [l]) : u).then((u) => F.post(r ? `${c}/${r}` : `${c}`, u).msg(t)).catch(() => H.error("请先完善表单信息", { duration: 2e3 }));
} }), d(P, { name: "取消", widget: () => t(!1) })] }), extras: n, children: d(ba, { form: s, code: a, primaryKey: r, ...i }) });
}, Ca = (e, t, n, { isReplaceRouteHistory: a = !1 } = {}) => le.redirect(n, t, { replace: a }), ka = (e, t = {}, n, a = {}) => {
} }), d(N, { name: "取消", widget: () => t(!1) })] }), extras: n, children: d(wa, { form: s, code: a, primaryKey: r, ...i }) });
}, ba = (e, t, n, { isReplaceRouteHistory: a = !1 } = {}) => le.redirect(n, t, { replace: a }), Ca = (e, t = {}, n, a = {}) => {
var i;
const r = (i = a.router) == null ? void 0 : i.reduce((s, [o, l, c]) => {
const u = p.get(t, ["router", o]);
@ -710,21 +710,21 @@ const dn = ({ $setting: e, $close: t, extras: n, code: a, primaryKey: r, ...i })
return p.isFunction(n) ? n.call(null, { ...t, ...s }) : p.isString(n) && n ? Ce.exec(n, t, s) : null;
}, Wt = (e, t, n, a, r) => p.isString(n) && n ? Z.getWidgetComponent(n).then(({ default: i }) => H.modal(i, { ...t, $setting: a }, r != null && r.title ? { ...r, title: p.template(r.title)(e) } : r)).catch((i) => {
H.error(n, { content: i.toString() });
}) : H.modal(n, { ...t, $setting: a }, r != null && r.title ? { ...r, title: p.template(r.title)(e) } : r), va = (e, t, n, a, r) => H.modal(dn, { ...t, $setting: a, code: n }, r != null && r.title ? { ...r, title: p.template(r.title)(e) } : r), xa = (e, t, n, a, r) => H.modal(kt, { base62params: t, $setting: a, listCode: n }, r != null && r.title ? { ...r, title: p.template(r.title)(e) } : r), Sa = ({ widget: e, widgetType: t, widgetData: n, widgetProps: a, widgetSetting: r, widgetContainerProps: i }, { onAfterClick: s, onBeforeClick: o }) => {
const l = de(ee), [c, u] = N({ leading: !0, trailing: !1 }), g = G(() => {
}) : H.modal(n, { ...t, $setting: a }, r != null && r.title ? { ...r, title: p.template(r.title)(e) } : r), ka = (e, t, n, a, r) => H.modal(dn, { ...t, $setting: a, code: n }, r != null && r.title ? { ...r, title: p.template(r.title)(e) } : r), va = (e, t, n, a, r) => H.modal(kt, { base62params: t, $setting: a, listCode: n }, r != null && r.title ? { ...r, title: p.template(r.title)(e) } : r), xa = ({ widget: e, widgetType: t, widgetData: n, widgetProps: a, widgetSetting: r, widgetContainerProps: i }, { onAfterClick: s, onBeforeClick: o }) => {
const l = de(ee), [c, u] = T({ leading: !0, trailing: !1 }), g = G(() => {
switch (t) {
case "redirect":
return p.partialRight(Ca, e, r);
return p.partialRight(ba, e, r);
case "func":
return p.partialRight(zt, (r == null ? void 0 : r.code) ?? e, { status: c, setStatus: u });
case "fsdpf-component":
return p.partialRight(Wt, e, r, i);
case "grid-layout-form":
return p.partialRight(va, e, r, i);
case "data-list":
return p.partialRight(xa, e, r, i);
case "destroy":
return p.partialRight(ka, e, r, i);
case "data-list":
return p.partialRight(va, e, r, i);
case "destroy":
return p.partialRight(Ca, e, r, i);
default:
if (Pt(e) || C.isValidElement(e)) return p.partialRight(Wt, e, r, i);
if (p.isFunction(e)) return p.partialRight(zt, (r == null ? void 0 : r.code) || e, { status: c, setStatus: u });
@ -745,54 +745,54 @@ const dn = ({ $setting: e, $close: t, extras: n, code: a, primaryKey: r, ...i })
}, yt = ({ className: e, type: t, style: n = {}, ...a }) => d("span", { role: "img", className: V("ff-iconfont", e), style: n, ...a, children: d("svg", { style: { width: "1em", height: "1em", fill: "currentColor", overflow: "hidden" }, viewBox: "0 0 1024 1024", children: d("use", { xlinkHref: `#${t}` }) }) });
yt.propTypes = { className: k.string, type: k.string.isRequired, style: k.object }, yt.init = ft;
const Ue = (e) => function({ className: t, children: n, name: a, icon: r, type: i = "default", iconPosition: s = "start", noAuthType: o, onAfterClick: l, onBeforeClick: c, data: u, loading: g, disabled: h, tooltip: y, confirm: f, widget: b, widgetType: w, widgetData: $, widgetProps: I, widgetSetting: L, widgetContainerProps: M, ...j }) {
const A = p.isEmpty(y) || !y.enabled ? {} : y, T = p.isEmpty(f) ? { enabled: !1 } : Object.assign({ enabled: !0 }, f), v = { type: "primary", className: V("ff-button", t), iconPosition: s };
i === "danger" ? v.danger = !0 : i === "default" && (v.type = i), e === "link" || e === "dashed" ? (v.type = e, i === "default" && (v.className = V(v.className, "ff-default"))) : e !== "circle" && e !== "round" || (v.shape = e), r && (v.icon = d(yt, { type: r }));
const [S, U] = N(!1), [z, { disabled: K, loading: ue }] = Sa({ widget: b, widgetType: w, widgetData: $, widgetProps: I, widgetSetting: L, widgetContainerProps: M }, { onAfterClick: l, onBeforeClick: c });
return d(Rn, { okText: "确定", cancelText: "取消", ...T, disabled: K || h, open: S, onOpenChange: (_) => {
const A = p.isEmpty(y) || !y.enabled ? {} : y, P = p.isEmpty(f) ? { enabled: !1 } : Object.assign({ enabled: !0 }, f), S = { type: "primary", className: V("ff-button", t), iconPosition: s };
i === "danger" ? S.danger = !0 : i === "default" && (S.type = i), e === "link" || e === "dashed" ? (S.type = e, i === "default" && (S.className = V(S.className, "ff-default"))) : e !== "circle" && e !== "round" || (S.shape = e), r && (S.icon = d(yt, { type: r }));
const [v, U] = T(!1), [W, { disabled: K, loading: ue }] = xa({ widget: b, widgetType: w, widgetData: $, widgetProps: I, widgetSetting: L, widgetContainerProps: M }, { onAfterClick: l, onBeforeClick: c });
return d(En, { okText: "确定", cancelText: "取消", ...P, disabled: K || h, open: v, onOpenChange: (_) => {
if (!_) return U(_);
T.enabled ? U(_) : z(u);
P.enabled ? U(_) : W(u);
}, onConfirm: () => {
z(u);
W(u);
}, onClick: (_) => {
_.stopPropagation();
}, children: d(Fn, { ...A, title: S ? null : A == null ? void 0 : A.title, trigger: ["hover", "click"], children: d(lt, { loading: ue || g, disabled: K || h, ...v, ...j, children: n || a }) }) });
}, P = Ue("default"), $a = Ue("link"), Pa = Ue("circle"), Na = Ue("round"), Ta = Ue("dashed"), Ut = ({ data: e, widget: t, widgetType: n = "fsdpf-component", children: a, widgetData: r, widgetProps: i, widgetSetting: s, widgetContainerProps: o }) => {
const l = de(ee), [c, u] = N(!1), [g, h] = N("hover"), [y, f] = N({}), [b, w] = N(), { placement: $, align: I, arrow: L = { pointAtCenter: !0 }, getPopupContainer: M, ...j } = o || {};
}, children: d(Rn, { ...A, title: v ? null : A == null ? void 0 : A.title, trigger: ["hover", "click"], children: d(lt, { loading: ue || g, disabled: K || h, ...S, ...j, children: n || a }) }) });
}, N = Ue("default"), Sa = Ue("link"), $a = Ue("circle"), Pa = Ue("round"), Na = Ue("dashed"), Ut = ({ data: e, widget: t, widgetType: n = "fsdpf-component", children: a, widgetData: r, widgetProps: i, widgetSetting: s, widgetContainerProps: o }) => {
const l = de(ee), [c, u] = T(!1), [g, h] = T("hover"), [y, f] = T({}), [b, w] = T(), { placement: $, align: I, arrow: L = { pointAtCenter: !0 }, getPopupContainer: M, ...j } = o || {};
R(() => {
n == "grid-layout-form" ? w(C.createElement(dn, { ...r, $setting: s, code: t })) : n == "data-list" ? w(C.createElement(kt, { base62params: e, $setting: s, listCode: t })) : p.isString(t) ? Z.getWidgetComponent(t).then(({ default: v }) => {
w(C.createElement(v, { ...r, $setting: s }));
}).catch((v) => w(v.toString())) : Pt(t) ? w(C.createElement(t, { ...r, $setting: s })) : C.isValidElement(t) && w(C.cloneElement(t, { ...r, $setting: s }));
n == "grid-layout-form" ? w(C.createElement(dn, { ...r, $setting: s, code: t })) : n == "data-list" ? w(C.createElement(kt, { base62params: e, $setting: s, listCode: t })) : p.isString(t) ? Z.getWidgetComponent(t).then(({ default: S }) => {
w(C.createElement(S, { ...r, $setting: s }));
}).catch((S) => w(S.toString())) : Pt(t) ? w(C.createElement(t, { ...r, $setting: s })) : C.isValidElement(t) && w(C.cloneElement(t, { ...r, $setting: s }));
}, [t, n, r]), R(() => {
Promise.resolve(Gt(i, e, { list: l })).then(f);
}, [i, e]);
const A = (v) => {
u(v), !v && h("hover");
}, T = (v) => {
const A = (S) => {
u(S), !S && h("hover");
}, P = (S) => {
u(!0), h("click");
};
return d(On, { zIndex: 1080, placement: $, onPopupClick: T, onClick: T, open: c, align: I, arrow: L, trigger: g, getPopupContainer: M, content: d(Ea, { ...j, children: b && C.cloneElement(b, { ...y, $close: () => A(!1) }) }), children: a, onOpenChange: A });
}, Ea = ({ title: e, className: t, children: n, width: a, height: r, ...i }) => {
const [s, o] = N({}), l = ce((g, h) => o((y) => ({ ...y, [g]: h })), []), c = ce((g) => o((h) => ({ ...h, [g]: void 0 })), []), u = e ? C.createElement("div", { className: "ff-popup-title" }, e) : s == null ? void 0 : s.title;
return d(Fn, { zIndex: 1080, placement: $, onPopupClick: P, onClick: P, open: c, align: I, arrow: L, trigger: g, getPopupContainer: M, content: d(Ta, { ...j, children: b && C.cloneElement(b, { ...y, $close: () => A(!1) }) }), children: a, onOpenChange: A });
}, Ta = ({ title: e, className: t, children: n, width: a, height: r, ...i }) => {
const [s, o] = T({}), l = ce((g, h) => o((y) => ({ ...y, [g]: h })), []), c = ce((g) => o((h) => ({ ...h, [g]: void 0 })), []), u = e ? C.createElement("div", { className: "ff-popup-title" }, e) : s == null ? void 0 : s.title;
return d(We.Provider, { value: { ele: s, mount: l, unmount: c }, children: O("div", { className: V("ff-popup ff-popover", t), style: { width: a, height: r }, ...i, children: [O("div", { className: "ff-popup-header", children: [u, s == null ? void 0 : s["sub-title"]] }), n, O("div", { className: "ff-popup-footer", children: [s == null ? void 0 : s.extras, s == null ? void 0 : s.actions] })] }) });
};
Ut.propTypes = { widgetType: k.oneOf(["fsdpf-component", "grid-layout-form", "data-list"]) }, P.propTypes = { type: k.oneOf(["primary", "default", "danger", ""]), name: k.string, icon: k.string, iconPosition: k.oneOf(["start", "end"]), data: k.any, widget: k.any, widgetType: k.oneOf(["destroy", "redirect", "func", "fsdpf-component", "grid-layout-form", "grid-layout", "data-list"]), widgetData: k.object, widgetProps: k.object, widgetSetting: k.object, widgetContainerProps: k.object, tooltip: k.exact({ title: k.string.isRequired, placement: k.oneOf(["top", "left", "right", "bottom", "topLeft", "topRight", "bottomLeft", "bottomRight", "leftTop", "leftBottom", "rightTop", "rightBottom"]), enabled: k.oneOfType([k.bool, k.number]), getPopupContainer: k.func }), confirm: k.exact({ title: k.string.isRequired, cancelText: k.string, okText: k.string, okType: k.oneOf(["primary", "default", "danger", ""]), placement: k.oneOf(["top", "left", "right", "bottom", "topLeft", "topRight", "bottomLeft", "bottomRight", "leftTop", "leftBottom", "rightTop", "rightBottom"]), enabled: k.oneOfType([k.bool, k.number]), getPopupContainer: k.func, arrow: k.oneOfType([k.bool, k.exact({ pointAtCenter: k.bool })]) }) }, P.Link = $a, P.Link.defaultProps = P.defaultProps, P.Link.propTypes = P.propTypes, P.Circle = Pa, P.Circle.defaultProps = P.defaultProps, P.Circle.propTypes = P.propTypes, P.Round = Na, P.Round.defaultProps = P.defaultProps, P.Round.propTypes = P.propTypes, P.Dashed = Ta, P.Dashed.defaultProps = P.defaultProps, P.Dashed.propTypes = P.propTypes, P.Popover = Ut;
const Ra = ({ fields: e, formProps: t, $close: n }) => {
Ut.propTypes = { widgetType: k.oneOf(["fsdpf-component", "grid-layout-form", "data-list"]) }, N.propTypes = { type: k.oneOf(["primary", "default", "danger", ""]), name: k.string, icon: k.string, iconPosition: k.oneOf(["start", "end"]), data: k.any, widget: k.any, widgetType: k.oneOf(["destroy", "redirect", "func", "fsdpf-component", "grid-layout-form", "grid-layout", "data-list"]), widgetData: k.object, widgetProps: k.object, widgetSetting: k.object, widgetContainerProps: k.object, tooltip: k.exact({ title: k.string.isRequired, placement: k.oneOf(["top", "left", "right", "bottom", "topLeft", "topRight", "bottomLeft", "bottomRight", "leftTop", "leftBottom", "rightTop", "rightBottom"]), enabled: k.oneOfType([k.bool, k.number]), getPopupContainer: k.func }), confirm: k.exact({ title: k.string.isRequired, cancelText: k.string, okText: k.string, okType: k.oneOf(["primary", "default", "danger", ""]), placement: k.oneOf(["top", "left", "right", "bottom", "topLeft", "topRight", "bottomLeft", "bottomRight", "leftTop", "leftBottom", "rightTop", "rightBottom"]), enabled: k.oneOfType([k.bool, k.number]), getPopupContainer: k.func, arrow: k.oneOfType([k.bool, k.exact({ pointAtCenter: k.bool })]) }) }, N.Link = Sa, N.Link.defaultProps = N.defaultProps, N.Link.propTypes = N.propTypes, N.Circle = $a, N.Circle.defaultProps = N.defaultProps, N.Circle.propTypes = N.propTypes, N.Round = Pa, N.Round.defaultProps = N.defaultProps, N.Round.propTypes = N.propTypes, N.Dashed = Na, N.Dashed.defaultProps = N.defaultProps, N.Dashed.propTypes = N.propTypes, N.Popover = Ut;
const Ea = ({ fields: e, formProps: t, $close: n }) => {
const [a] = Q.useForm(), r = G(() => [{ name: "__PROPS__", value: t }], [t]);
return d(J, { actions: O(C.Fragment, { children: [d(P, { name: "取消", widget: () => n(!1) }), d(P, { name: "确定", type: "primary", widget: () => a.validateFields(!0).then(n) })] }), children: d(Q, { fields: r, form: a, className: "ff-modal-form", children: e == null ? void 0 : e.map(({ code: i, ...s }) => d(wa, { code: i, ...s }, i)) }) });
}, Fa = ({ className: e, $close: t, children: n, title: a, subTitle: r, actions: i, extras: s, zIndex: o, ...l }) => O(Un, { ...l, prefixCls: "ff-drawer", className: V("ff-popup", e), maskMotion: { motionAppear: !0, motionName: "mask-motion" }, motion: (c) => ({ motionAppear: !0, motionName: `panel-motion-${c}` }), children: [O("div", { className: "ff-popup-header", children: [d("button", { "aria-label": "Close", className: "ff-popup-close", onClick: l.onClose, children: d(Ct, { type: "close" }) }), a, r] }), d("div", { className: "ff-popup-body", children: n }), O("div", { className: "ff-popup-footer", children: [s, i] })] }), Oa = ({ className: e, $close: t, $event: n, children: a, title: r, subTitle: i, actions: s, extras: o, zIndex: l, placement: c, ...u }) => {
return d(J, { actions: O(C.Fragment, { children: [d(N, { name: "取消", widget: () => n(!1) }), d(N, { name: "确定", type: "primary", widget: () => a.validateFields(!0).then(n) })] }), children: d(Q, { fields: r, form: a, className: "ff-modal-form", children: e == null ? void 0 : e.map(({ code: i, ...s }) => d(ya, { code: i, ...s }, i)) }) });
}, Ra = ({ className: e, $close: t, children: n, title: a, subTitle: r, actions: i, extras: s, zIndex: o, ...l }) => O(Bn, { ...l, prefixCls: "ff-drawer", className: V("ff-popup", e), maskMotion: { motionAppear: !0, motionName: "mask-motion" }, motion: (c) => ({ motionAppear: !0, motionName: `panel-motion-${c}` }), children: [O("div", { className: "ff-popup-header", children: [d("button", { "aria-label": "Close", className: "ff-popup-close", onClick: l.onClose, children: d(Ct, { type: "close" }) }), a, r] }), d("div", { className: "ff-popup-body", children: n }), O("div", { className: "ff-popup-footer", children: [s, i] })] }), Fa = ({ className: e, $close: t, $event: n, children: a, title: r, subTitle: i, actions: s, extras: o, zIndex: l, placement: c, ...u }) => {
const g = (n == null ? void 0 : n.pageX) === void 0 ? { animation: null, maskAnimation: null, mousePosition: { x: null, y: null } } : { animation: "zoom", maskAnimation: "fade", mousePosition: { x: n == null ? void 0 : n.pageX, y: n == null ? void 0 : n.pageY } };
return d(Dn, { ...u, ...g, prefixCls: "ff-modal", modalRender: () => O("div", { className: V("ff-modal-content ff-popup", e), children: [O("div", { className: "ff-popup-header", children: [d("button", { "aria-label": "Close", className: "ff-popup-close", onClick: u.onClose, children: d(Ct, { type: "close" }) }), r, i] }), d("div", { className: "ff-popup-body", children: a }), O("div", { className: "ff-popup-footer", children: [o, s] })] }) });
return d(Un, { ...u, ...g, prefixCls: "ff-modal", modalRender: () => O("div", { className: V("ff-modal-content ff-popup", e), children: [O("div", { className: "ff-popup-header", children: [d("button", { "aria-label": "Close", className: "ff-popup-close", onClick: u.onClose, children: d(Ct, { type: "close" }) }), r, i] }), d("div", { className: "ff-popup-body", children: a }), O("div", { className: "ff-popup-footer", children: [o, s] })] }) });
}, un = ({ placement: e, $close: t, $event: n, children: a, title: r, ...i }) => {
const [s, o] = N({}), [l, c] = N(!0), u = ce((f, b) => o((w) => ({ ...w, [f]: b })), []), g = ce((f) => o((b) => ({ ...b, [f]: void 0 })), []);
const [s, o] = T({}), [l, c] = T(!0), u = ce((f, b) => o((w) => ({ ...w, [f]: b })), []), g = ce((f) => o((b) => ({ ...b, [f]: void 0 })), []);
let h = { ...i, className: s.rootClassName, title: s.title || r && C.createElement("div", { className: V("ff-popup-title") }, r), subTitle: s["sub-title"], actions: s.actions, extras: s.extras, children: a, $close: t, $event: n, onClose: () => c(!1) };
const y = () => {
t(!1);
};
return d(We.Provider, { value: { ele: s, mount: u, unmount: g }, children: e && e !== "center" ? d(Fa, { ...h, placement: e, open: l, afterOpenChange: (f) => !f && y() }) : d(Oa, { ...h, visible: l, afterClose: y }) });
return d(We.Provider, { value: { ele: s, mount: u, unmount: g }, children: e && e !== "center" ? d(Ra, { ...h, placement: e, open: l, afterOpenChange: (f) => !f && y() }) : d(Fa, { ...h, visible: l, afterClose: y }) });
};
un.propTypes = { placement: k.oneOf(["center", "left", "top", "right", "bottom"]) };
const q = () => {
const [e, t] = Wn({ maxCount: 6, motion: { motionName: "ff-notification-fade", motionAppear: !0, motionEnter: !0, motionLeave: !0, onLeaveStart: (i) => {
const [e, t] = zn({ maxCount: 6, motion: { motionName: "ff-notification-fade", motionAppear: !0, motionEnter: !0, motionLeave: !0, onLeaveStart: (i) => {
const { offsetHeight: s } = i;
return { height: s };
}, onLeaveActive: () => ({ height: 0, opacity: 0, margin: 0 }) }, prefixCls: "ff-notification" }), [, n] = C.useReducer((i) => i + 1, 0);
@ -811,7 +811,7 @@ const q = () => {
q.$popups = /* @__PURE__ */ new Map(), q.$index = 0, q.$queue = [], q.$onClick = (...e) => new Promise((t, n) => {
q.$queue.push([e, t, n]);
});
const Dt = (e, t, n = {}) => q.$onClick(e, t, n), st = (e, { showProgress: t, duration: n, ...a } = { duration: 1.5 }) => q.$onClick(_t, { content: e, ...a }, { showProgress: t, duration: n }), H = { modal: Dt, confirm: (e, t = {}) => q.$onClick(qn, { content: e, ...t }, { placement: "center" }), form: (e, t = {}, n = {}) => Dt(Ra, { formProps: n, fields: e }, { placement: "center", ...t }).then((a) => {
const Dt = (e, t, n = {}) => q.$onClick(e, t, n), st = (e, { showProgress: t, duration: n, ...a } = { duration: 1.5 }) => q.$onClick(_t, { content: e, ...a }, { showProgress: t, duration: n }), H = { modal: Dt, confirm: (e, t = {}) => q.$onClick(Dn, { content: e, ...t }, { placement: "center" }), form: (e, t = {}, n = {}) => Dt(Ea, { formProps: n, fields: e }, { placement: "center", ...t }).then((a) => {
if (a === !1) throw !1;
return a;
}), notification: st, success: (e, t = { duration: 1.5 }) => st(e, { ...t, className: "ff-notification-success", icon: "check" }), error: (e, t = { duration: 1.5 }) => st(e, { ...t, className: "ff-notification-error", icon: "close" }) };
@ -895,106 +895,106 @@ const ie = class ie {
}
return Promise.resolve(null);
});
x(this, "login", (t, n, a = {}) => F.post("/api/user-token", { username: t, passwd: Bn.hash(n), platform: "web", ...a }).then(({ token: r }) => (window.localStorage.setItem(_e, r), r)));
x(this, "login", (t, n, a = {}) => F.post("/api/user-token", { username: t, passwd: Wn.hash(n), platform: "web", ...a }).then(({ token: r }) => (window.localStorage.setItem(_e, r), r)));
x(this, "logout", (t) => (window.localStorage.removeItem(ot), window.localStorage.removeItem(_e), t == null ? void 0 : t()));
if (m(ie, be)) return m(ie, be);
}
};
be = new WeakMap(), Ee = new WeakMap(), E(ie, be, null), x(ie, "getInstance", () => (m(ie, be) || B(ie, be, new ie()), m(ie, be)));
let bt = ie;
const Z = bt.getInstance(), La = C.createContext({ user: {}, initUser: () => {
}, initUserComplete: !1 }), Va = C.createContext({ set: () => {
const Z = bt.getInstance(), Oa = C.createContext({ user: {}, initUser: () => {
}, initUserComplete: !1 }), La = C.createContext({ set: () => {
}, get: () => {
}, assign: () => {
}, currentRoute: () => {
} }), Pt = (e) => !!(e != null && e.name) && (e.prototype instanceof C.Component || /^[A-Z]/.test(e.name)), ja = (e, t) => {
} }), Pt = (e) => !!(e != null && e.name) && (e.prototype instanceof C.Component || /^[A-Z]/.test(e.name)), Va = (e, t) => {
if (!e || typeof window > "u") return;
let n = document.querySelector(`style[ff-style-token="${t}"]`);
return n ? (n.innerHTML = e, e) : (n = document.createElement("style"), n.setAttribute("ff-style-token", t), n.setAttribute("type", "text/css"), n.innerHTML = e, document.head.appendChild(n), e);
}, Aa = Object.freeze(Object.defineProperty({ __proto__: null, AppContext: La, AppGlobalParamsContext: Va, cache: Jt, configure: Oe, default: Z, func: Ce, http: F, insertStyle: ja, isReactComponent: Pt, route: le }, Symbol.toStringTag, { value: "Module" })), Ia = (e, t, n = "children") => {
}, ja = Object.freeze(Object.defineProperty({ __proto__: null, AppContext: Oa, AppGlobalParamsContext: La, cache: Jt, configure: Oe, default: Z, func: Ce, http: F, insertStyle: Va, isReactComponent: Pt, route: le }, Symbol.toStringTag, { value: "Module" })), Aa = (e, t, n = "children") => {
if (p.isEmpty(e)) return {};
const a = p.find(e, ["value", t]);
if (!p.isEmpty(a)) return a;
const r = e.length;
for (let i = 0; i < r; i++) {
const { [n]: s } = e[i], o = Ia(s, t, n);
const { [n]: s } = e[i], o = Aa(s, t, n);
if (!p.isEmpty(o)) return o;
}
return {};
};
export {
Hn as $,
or as A,
lr as B,
qn as $,
sr as A,
or as B,
gt as C,
Ye as D,
Kn as E,
_n as F,
cr as G,
ra as H,
Jn as E,
Kn as F,
lr as G,
aa as H,
vt as I,
ur as J,
gr as K,
dr as J,
ur as K,
Be as L,
xt as M,
pr as N,
mr as O,
ba as P,
gr as N,
pr as O,
wa as P,
St as Q,
nn as R,
wa as S,
ya as S,
dn as T,
pa as U,
ma as V,
ha as W,
fa as X,
hr as Y,
ga as U,
pa as V,
ma as W,
ha as X,
mr as Y,
yt as Z,
P as _,
rr as a,
Sa as a0,
N as _,
ar as a,
xa as a0,
J as a1,
We as a2,
Kt as a3,
q as a4,
H as a5,
er as a6,
tr as a7,
nr as a8,
Za as a6,
er as a7,
tr as a8,
Z as a9,
Pt as aa,
ja as ab,
Va as ab,
F as ac,
Jt as ad,
Oe as ae,
Ce as af,
le as ag,
La as ah,
Va as ai,
Ia as aj,
ir as b,
sr as c,
Oa as ah,
La as ai,
Aa as aj,
rr as b,
ir as c,
Yt as d,
Zt as e,
an as f,
Gt as g,
on as h,
dr as i,
cr as i,
rn as j,
sn as k,
tn as l,
en as m,
na as n,
ta as o,
Zn as p,
ta as n,
ea as o,
Qn as p,
kt as q,
it as r,
ee as s,
X as t,
ar as u,
aa as v,
la as w,
Gn as x,
Xn as y,
Jn as z
nr as u,
na as v,
oa as w,
_n as x,
Yn as y,
Hn as z
};

2
dist/components.js vendored
View File

@ -1,4 +1,4 @@
import { a6 as s, Z as p, a7 as n, a8 as t, a5 as d } from "./common/main-B5hgccZL.js";
import { a6 as s, Z as p, a7 as n, a8 as t, a5 as d } from "./common/main-DsH9zeNE.js";
export {
s as Empty,
p as Icon,

2
dist/container.js vendored
View File

@ -1,4 +1,4 @@
import { a2 as o, a6 as s, a7 as p, a8 as t, a3 as d, a5 as n, a4 as r, a1 as u } from "./common/main-B5hgccZL.js";
import { a2 as o, a6 as s, a7 as p, a8 as t, a3 as d, a5 as n, a4 as r, a1 as u } from "./common/main-DsH9zeNE.js";
export {
o as Context,
s as Empty,

View File

@ -1,6 +1,6 @@
import "lodash";
import "react";
import { D as p } from "./common/main-B5hgccZL.js";
import { D as p } from "./common/main-DsH9zeNE.js";
export {
p as default
};

2
dist/data-list.js vendored
View File

@ -1,4 +1,4 @@
import { w as t, s as e, m as r, p as o, x as i, q as l, o as u, v as D, n as L, y as n, l as m, z as p, F as C, B as F, C as b, E as c, A as d } from "./common/main-B5hgccZL.js";
import { w as t, s as e, m as r, p as o, x as i, q as l, o as u, v as D, n as L, y as n, l as m, z as p, F as C, B as F, C as b, E as c, A as d } from "./common/main-DsH9zeNE.js";
export {
t as DataListContent,
e as DataListContext,

View File

@ -1,5 +1,5 @@
import "lodash";
import { f as a } from "../common/main-B5hgccZL.js";
import { f as a } from "../common/main-DsH9zeNE.js";
export {
a as getDefaultExpandRowKeys
};

View File

@ -1,4 +1,4 @@
import { Q as s, T as r, S as u, P as o, X as t, W as d, Y as m, V as F, U as i } from "./common/main-B5hgccZL.js";
import { Q as s, T as r, S as u, P as o, X as t, W as d, Y as m, V as F, U as i } from "./common/main-DsH9zeNE.js";
export {
s as GridLayoutForm,
r as GridLayoutFormHelper,

View File

@ -1,5 +1,5 @@
import "lodash";
import { aj as a } from "../common/main-B5hgccZL.js";
import { aj as a } from "../common/main-DsH9zeNE.js";
export {
a as getOptionItemByValue
};

2
dist/grid-layout.js vendored
View File

@ -1,4 +1,4 @@
import { h as d, i as e, H as i, G as t, j as u, k as o } from "./common/main-B5hgccZL.js";
import { h as d, i as e, H as i, G as t, j as u, k as o } from "./common/main-DsH9zeNE.js";
export {
d as GridLayout,
e as GridLayoutWidget,

View File

@ -1,4 +1,4 @@
import { e as t } from "../common/main-B5hgccZL.js";
import { e as t } from "../common/main-DsH9zeNE.js";
export {
t as getBoxStyle
};

2
dist/hooks.js vendored
View File

@ -1,7 +1,7 @@
import "lodash";
import "rc-field-form";
import "react";
import { M as r, L as o, N as p, J as f, K as i, O as m, I as c } from "./common/main-B5hgccZL.js";
import { M as r, L as o, N as p, J as f, K as i, O as m, I as c } from "./common/main-DsH9zeNE.js";
import { default as b } from "rc-util/lib/hooks/useMergedState";
export {
r as useDeepEffect,

2
dist/iconfont.js vendored
View File

@ -2,7 +2,7 @@ import "react/jsx-runtime";
import "react";
import "prop-types";
import "classnames";
import { Z as a } from "./common/main-B5hgccZL.js";
import { Z as a } from "./common/main-DsH9zeNE.js";
export {
a as default
};

2
dist/index.js vendored
View File

@ -1,4 +1,4 @@
import { ah as t, ai as e, ad as o, ae as n, a9 as p, af as c, ac as r, ab as f, aa as i, ag as l } from "./common/main-B5hgccZL.js";
import { ah as t, ai as e, ad as o, ae as n, a9 as p, af as c, ac as r, ab as f, aa as i, ag as l } from "./common/main-DsH9zeNE.js";
export {
t as AppContext,
e as AppGlobalParamsContext,

2
dist/res-ws.js vendored
View File

@ -1,5 +1,5 @@
import "lodash";
import { R as a } from "./common/main-B5hgccZL.js";
import { R as a } from "./common/main-DsH9zeNE.js";
export {
a as default
};

2
dist/utils.js vendored
View File

@ -1,5 +1,5 @@
import "lodash";
import { d as g, b as s, a as r, c as o, g as i, r as m, t as p, u as P } from "./common/main-B5hgccZL.js";
import { d as g, b as s, a as r, c as o, g as i, r as m, t as p, u as P } from "./common/main-DsH9zeNE.js";
export {
g as deepSome,
s as getPkgCategory,

View File

@ -1,7 +1,7 @@
{
"name": "ff",
"private": true,
"version": "0.4.43",
"version": "0.4.44",
"author": "www.fsdpf.com",
"type": "module",
"main": "./dist/index.js",