This commit is contained in:
what 2024-12-10 14:48:09 +08:00
parent 416495adc6
commit cb3e69ebfd
17 changed files with 262 additions and 257 deletions

2
dist/button.js vendored
View File

@ -1,4 +1,4 @@
import { W as s, V as u, X as e } from "./common/main-DwWXlZKl.js";
import { X as s, W as u, Y as e } from "./common/main-RnTtq_9x.js";
import "prop-types";
export {
s as auth,

View File

@ -4,35 +4,35 @@ var Ft = (e) => {
};
var va = (e, t, a) => t in e ? ka(e, t, { enumerable: !0, configurable: !0, writable: !0, value: a }) : e[t] = a;
var k = (e, t, a) => va(e, typeof t != "symbol" ? t + "" : t, a), Rt = (e, t, a) => t.has(e) || Ft("Cannot " + a);
var g = (e, t, a) => (Rt(e, t, "read from private field"), a ? a.call(e) : t.get(e)), P = (e, t, a) => t.has(e) ? Ft("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, a), D = (e, t, a, n) => (Rt(e, t, "write to private field"), n ? n.call(e, a) : t.set(e, a), a);
var g = (e, t, a) => (Rt(e, t, "read from private field"), a ? a.call(e) : t.get(e)), P = (e, t, a) => t.has(e) ? Ft("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, a), B = (e, t, a, n) => (Rt(e, t, "write to private field"), n ? n.call(e, a) : t.set(e, a), a);
var Ot = (e, t, a, n) => ({
set _(r) {
D(e, t, r, a);
B(e, t, r, a);
},
get _() {
return g(e, t, n);
}
});
import { jsx as u, jsxs as T } from "react/jsx-runtime";
import C, { useEffect as x, useState as $, useCallback as ce, useMemo as Z, useRef as q, useContext as Ue, useId as Ye, useLayoutEffect as Sa } from "react";
import C, { useEffect as $, useState as N, useCallback as ce, useMemo as Z, useRef as q, useContext as Ue, useId as Ye, useLayoutEffect as Sa } from "react";
import p from "lodash";
import Ht from "immutability-helper";
import O from "classnames";
import { Form as _e, Input as Na, Button as lt, Breadcrumb as $a, Tree as Pa, Pagination as xa, Table as Ta, Empty as Ea, Popconfirm as Fa, Tooltip as Ra, Popover as Oa } from "antd";
import { Form as _e, Input as xa, Button as lt, Breadcrumb as Na, Tree as Pa, Pagination as $a, Table as Ta, Empty as Ea, Popconfirm as Fa, Tooltip as Ra, Popover as Oa } from "antd";
import { useMergedState as La } from "rc-util";
import Q, { FieldContext as Va, Field as Jt } from "rc-field-form";
import X, { FieldContext as Va, Field as Jt } from "rc-field-form";
import { useParams as Aa, generatePath as ja, createBrowserRouter as Ia, useInRouterContext as Ma, Navigate as za } from "react-router-dom";
import A from "prop-types";
import * as Lt from "react-is";
import { useNotification as Wa } from "rc-notification";
import { N as Re, a as Oe, T as ct, S as Ua } from "./vender-DMK1apIA.js";
import "rc-util/lib/hooks/useMergedState";
import Ba from "rc-drawer";
import Da from "rc-dialog";
var $e, Ae, Pe, ie, Ce, be;
import Da from "rc-drawer";
import Ba from "rc-dialog";
var Ne, Ae, Pe, ie, Ce, be;
class Kt {
constructor(t, a) {
P(this, $e, /* @__PURE__ */ new Map());
P(this, Ne, /* @__PURE__ */ new Map());
P(this, Ae, !0);
P(this, Pe, []);
P(this, ie);
@ -40,12 +40,12 @@ class Kt {
P(this, be, () => Promise.resolve());
k(this, "get", (...t) => new Promise((a, n) => {
const r = JSON.stringify(t);
if (g(this, $e).has(r)) return a(g(this, be).call(this, g(this, ie), ...t));
if (g(this, ie) === void 0) g(this, Pe).push([t, a, n]), g(this, Ae) && (D(this, Ae, !1), Promise.resolve(typeof g(this, Ce) == "function" ? g(this, Ce).call(this) : g(this, Ce)).then((s) => D(this, ie, s || null)).finally(() => {
if (g(this, Ne).has(r)) return a(g(this, be).call(this, g(this, ie), ...t));
if (g(this, ie) === void 0) g(this, Pe).push([t, a, n]), g(this, Ae) && (B(this, Ae, !1), Promise.resolve(typeof g(this, Ce) == "function" ? g(this, Ce).call(this) : g(this, Ce)).then((s) => B(this, ie, s || null)).finally(() => {
g(this, Pe).forEach(([s, i, o]) => {
try {
const l = g(this, be).call(this, g(this, ie), ...s);
g(this, $e).set(JSON.stringify(s), l), i(l);
g(this, Ne).set(JSON.stringify(s), l), i(l);
} catch (l) {
o(l);
}
@ -53,51 +53,51 @@ class Kt {
}));
else {
const s = g(this, be).call(this, g(this, ie), ...t);
g(this, $e).set(r, s), a(s);
g(this, Ne).set(r, s), a(s);
}
}));
D(this, be, a), D(this, Ce, t);
B(this, be, a), B(this, Ce, t);
}
}
$e = new WeakMap(), Ae = new WeakMap(), Pe = new WeakMap(), ie = new WeakMap(), Ce = new WeakMap(), be = new WeakMap();
const Xn = () => u("div", { children: "Empty" }), Be = C.createContext({ ele: {}, mount: () => {
Ne = new WeakMap(), Ae = new WeakMap(), Pe = new WeakMap(), ie = new WeakMap(), Ce = new WeakMap(), be = new WeakMap();
const Qn = () => u("div", { children: "Empty" }), De = C.createContext({ ele: {}, mount: () => {
}, unmount: () => {
} }), K = ({ rootClassName: e, className: t, children: a, actions: n, title: r, subTitle: s, extras: i, style: o = {} }) => {
const { mount: l, unmount: c } = C.useContext(Be);
return n && K.Action({ children: n }), r && K.Title({ children: r }), s && K.SubTitle({ children: s }), i && K.Extra({ children: i }), x(() => (l("rootClassName", e), () => c(e)), [e]), u("div", { className: O("ff-container", t), style: o, children: a });
const { mount: l, unmount: c } = C.useContext(De);
return n && K.Action({ children: n }), r && K.Title({ children: r }), s && K.SubTitle({ children: s }), i && K.Extra({ children: i }), $(() => (l("rootClassName", e), () => c(e)), [e]), u("div", { className: O("ff-container", t), style: o, children: a });
}, Ke = (e) => ({ children: t, className: a }) => {
const { mount: n, unmount: r } = C.useContext(Be);
return x(() => (n(e, C.createElement("div", { key: `ff-${e}`, className: O(`ff-popup-${e}`, a) }, t)), () => r(e)), [a, t]), null;
const { mount: n, unmount: r } = C.useContext(De);
return $(() => (n(e, C.createElement("div", { key: `ff-${e}`, className: O(`ff-popup-${e}`, a) }, t)), () => r(e)), [a, t]), null;
};
K.Action = Ke("actions"), K.Title = Ke("title"), K.SubTitle = Ke("sub-title"), K.Extra = Ke("extras"), K.propTypes = { className: A.string, style: A.object, title: A.any, subTitle: A.any, actions: A.any, extras: A.any };
const Zn = () => u(K, { className: "ff-loading", children: T("div", { className: "loader", children: [T("div", { className: "square", children: [u("span", {}), u("span", {}), u("span", {})] }), T("div", { className: "square", children: [u("span", {}), u("span", {}), u("span", {})] }), T("div", { className: "square", children: [u("span", {}), u("span", {}), u("span", {})] }), T("div", { className: "square", children: [u("span", {}), u("span", {}), u("span", {})] })] }) }), er = () => u("div", { children: "NotFound" }), _t = ({ children: e }) => {
const [t, a] = $({}), n = ce((s, i) => a((o) => ({ ...o, [s]: i })), []), r = ce((s) => a((i) => ({ ...i, [s]: void 0 })), []);
return typeof (e == null ? void 0 : e.type) == "string" ? e : u(Be.Provider, { value: { ele: t, mount: n, unmount: r }, children: C.cloneElement(e, { className: t.rootClassName, title: t.title, subTitle: t["sub-title"], actions: t.actions, extras: t.extras }) });
const [t, a] = N({}), n = ce((s, i) => a((o) => ({ ...o, [s]: i })), []), r = ce((s) => a((i) => ({ ...i, [s]: void 0 })), []);
return typeof (e == null ? void 0 : e.type) == "string" ? e : u(De.Provider, { value: { ele: t, mount: n, unmount: r }, children: C.cloneElement(e, { className: t.rootClassName, title: t.title, subTitle: t["sub-title"], actions: t.actions, extras: t.extras }) });
};
_t.propTypes = { children: A.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"] }, bt = ({ 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((a, n) => u("path", { d: a }, n)) }) }), Gt = ({ className: e, content: t, icon: a, $close: n }) => T(C.Fragment, { children: [a && u("div", { className: O("ff-notification-icon", e), children: u(bt, { type: a }) }), t] }), qa = ({}) => u(K, { children: "Confirm" });
var de, xe;
var de, $e;
const ee = class ee {
constructor() {
P(this, xe, /* @__PURE__ */ new Map());
k(this, "init", (t) => D(this, xe, new Map(t)));
k(this, "check", (t) => !g(this, xe).has(t) || g(this, xe).get(t));
P(this, $e, /* @__PURE__ */ new Map());
k(this, "init", (t) => B(this, $e, new Map(t)));
k(this, "check", (t) => !g(this, $e).has(t) || g(this, $e).get(t));
if (g(ee, de)) return g(ee, de);
}
};
de = new WeakMap(), xe = new WeakMap(), P(ee, de, null), k(ee, "getInstance", () => (g(ee, de) || D(ee, de, new ee()), g(ee, de)));
de = new WeakMap(), $e = new WeakMap(), P(ee, de, null), k(ee, "getInstance", () => (g(ee, de) || B(ee, de, new ee()), g(ee, de)));
let dt = ee;
const Ha = dt.getInstance();
var ue, je;
const te = class te {
constructor() {
P(this, je, null);
k(this, "init", (t) => D(this, je, t));
k(this, "init", (t) => B(this, je, t));
k(this, "get", (t, a) => p.get(g(this, je), t, a));
if (g(te, ue)) return g(te, ue);
}
};
ue = new WeakMap(), je = new WeakMap(), P(te, ue, null), k(te, "getInstance", () => (g(te, ue) || D(te, ue, new te()), g(te, ue)));
ue = new WeakMap(), je = new WeakMap(), P(te, ue, null), k(te, "getInstance", () => (g(te, ue) || B(te, ue, new te()), g(te, ue)));
let ut = te;
const Le = ut.getInstance(), At = { null2json: (e) => Object.create(), null2array: (e) => [], null2number: (e) => 0, null2bool: (e) => !1, null2string: (e) => "", null2integer: (e) => 0, null2float: (e) => 0, string2json: (e) => e ? JSON.parse(e) : "{}", string2array: (e) => e.substr(0, 1) === "[" && e.substr(-1) === "]" ? JSON.parse(e) : e.split(","), string2number: (e) => e == "" ? 0 : +e, string2integer: (e) => e == "" ? 0 : +e, string2float: (e) => e == "" ? 0 : +e, string2bool: (e) => {
switch (`${e}`.toLowerCase()) {
@ -113,7 +113,7 @@ const Le = ut.getInstance(), At = { null2json: (e) => Object.create(), null2arra
a = Array.isArray(e) ? "array" : typeof e, p.isObject(e) && (a = "json");
const n = `${a}2${t}`;
return Reflect.has(At, n) ? At[n](e) : e;
}, Yt = (e = {}, t = {}, a = {}, n = "") => Qt(e, (r, s) => s === "type" && r === "code") ? Xt(e, t, a, n) : Zt(e, t, n), Qt = (e, t = () => !1) => p.some(e, (a) => !!p.some(a, t) || (p.isEmpty(a) || !p.isPlainObject(a) && !p.isArray(a) ? void 0 : Qt(a, t))), Xt = async (e = {}, t = {}, a = {}, n = "") => {
}, Yt = (e = {}, t = {}, a = {}, n = "") => Xt(e, (r, s) => s === "type" && r === "code") ? Qt(e, t, a, n) : Zt(e, t, n), Xt = (e, t = () => !1) => p.some(e, (a) => !!p.some(a, t) || (p.isEmpty(a) || !p.isPlainObject(a) && !p.isArray(a) ? void 0 : Xt(a, t))), Qt = async (e = {}, t = {}, a = {}, n = "") => {
let r = /* @__PURE__ */ Object.create(null);
for (let s in e) {
let i;
@ -134,7 +134,7 @@ const Le = ut.getInstance(), At = { null2json: (e) => Object.create(), null2arra
i = l;
}
i ?? (i = c);
} else i = await Xt(e[s], t, a, n);
} else i = await Qt(e[s], t, a, n);
p.set(r, s, i);
}
return r;
@ -159,14 +159,17 @@ const Le = ut.getInstance(), At = { null2json: (e) => Object.create(), null2arra
p.set(n, r, s);
}
return n;
}, {}), st = (e, t) => e && typeof e == "object" ? Array.isArray(e) ? e.map((a) => st(a, t)) : Object.keys(e).reduce((a, n) => (t[n] ? a[t[n]] = st(e[n], t) : a[n] = st(e[n], t), a), {}) : e;
var Xe, Ie, Me, Ze;
}, {}), st = (e, t) => e && typeof e == "object" ? Array.isArray(e) ? e.map((a) => st(a, t)) : Object.keys(e).reduce((a, n) => (t[n] ? a[t[n]] = st(e[n], t) : a[n] = st(e[n], t), a), {}) : e, tr = () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (e) => {
const t = 16 * Math.random() | 0;
return (e === "x" ? t : 3 & t | 8).toString(16);
});
var Qe, Ie, Me, Ze;
const et = class et {
constructor(...t) {
P(this, Ie, []);
P(this, Me, (t) => {
var a;
for (let n of t) Array.isArray(n[0]) ? g(this, Me).call(this, n) : g(this, Ie).push(g(a = et, Xe).call(a, n[0], n[1]));
for (let n of t) Array.isArray(n[0]) ? g(this, Me).call(this, n) : g(this, Ie).push(g(a = et, Qe).call(a, n[0], n[1]));
});
k(this, "toValue", async (t, a = null) => {
const n = { getValue: () => t, getRecord: () => a };
@ -181,8 +184,8 @@ const et = class et {
});
k(this, "toRender", (t, a, n = null) => C.createElement(g(this, Ze), { value: t, record: a }, n));
P(this, Ze, ({ value: t, record: a, children: n }) => {
const [r, s] = $(n);
return Nt(() => {
const [r, s] = N(n);
return xt(() => {
let i = !1;
return s(n), this.toValue(t, a).then((o) => Y(o, "string")).then((o) => !i && s(o)).catch((o) => !i && s(`${o}`)), () => i = !0;
}, [t, a]), r;
@ -190,20 +193,20 @@ const et = class et {
g(this, Me).call(this, t);
}
};
Xe = new WeakMap(), Ie = new WeakMap(), Me = new WeakMap(), Ze = new WeakMap(), P(et, Xe, p.memoize((t, a) => X.getWidgetComponent(t).then((n) => {
Qe = new WeakMap(), Ie = new WeakMap(), Me = new WeakMap(), Ze = new WeakMap(), P(et, Qe, p.memoize((t, a) => Q.getWidgetComponent(t).then((n) => {
var r;
return ((r = n.default) == null ? void 0 : r.call(n, a)) || ((s) => s);
}), (t, a) => `${t}::${Y(a, "string")}`));
let Qe = et;
const Ja = (e, t = {}) => Z(() => e == null ? void 0 : e.map(({ widgetByJs: a, widgetByJsSetting: n, ...r }, s) => a ? { ...r, render: (i, o) => new Qe([a, n]).toRender(i, o, "-") } : r), [e, t]), tr = (e) => {
const [t, a] = $({});
return x(() => {
let Xe = et;
const Ja = (e, t = {}) => Z(() => e == null ? void 0 : e.map(({ widgetByJs: a, widgetByJsSetting: n, ...r }, s) => a ? { ...r, render: (i, o) => new Xe([a, n]).toRender(i, o, "-") } : r), [e, t]), ar = (e) => {
const [t, a] = N({});
return $(() => {
let n = !1;
return e && E.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) => !n && a(r)), () => n = !0;
}, [e]), t;
}, ar = (e, t = {}) => {
const [a, n] = $({ dataSource: [] });
return De(() => {
}, nr = (e, t = {}) => {
const [a, n] = N({ dataSource: [] });
return Be(() => {
let r = !1;
return e && E.get(`/api/${e}/${E.encode({ page: 1, ...t })}`).then((s) => !r && n(s)), () => r = !0;
}, [e, t]), a;
@ -214,7 +217,7 @@ const Ja = (e, t = {}) => Z(() => e == null ? void 0 : e.map(({ widgetByJs: a, w
return e.some(({ uuid: s }) => !s || !a.has(s) || a.get(s).some((i) => r.includes(`${i}`)));
}, [e, t, a, n]), Ka = (e, t, a = "id", n = null) => {
const r = St(), s = q(!1), i = q(e.dataSource), o = q(e.itemOperationsAccess);
return x(() => (i.current = e.dataSource, o.current = e.itemOperationsAccess, () => s.current = !1), [e.dataSource, e.itemOperationsAccess]), s.current && (e.dataSource = i.current, e.itemOperationsAccess = o.current), [e, (l = 0, c = null) => {
return $(() => (i.current = e.dataSource, o.current = e.itemOperationsAccess, () => s.current = !1), [e.dataSource, e.itemOperationsAccess]), s.current && (e.dataSource = i.current, e.itemOperationsAccess = o.current), [e, (l = 0, c = null) => {
var d, h;
if (s.current = !1, l === 1) return (d = e.onReload) == null ? void 0 : d.call(e);
if (l === 2) {
@ -241,17 +244,17 @@ const Ja = (e, t = {}) => Z(() => e == null ? void 0 : e.map(({ widgetByJs: a, w
n.current = { tab: m, condition: d, sider: f, keyword: c, total: h, pageSize: b, page: v != null && v.length ? y : 1 }, s.current = v, r.current = new Map(w), a();
});
}, 380, { leading: !1, trailing: !0 });
Nt(() => {
xt(() => {
s.current = [], e && i(t);
}, [e, t]);
const o = Z(() => p.pick(n.current, ["total", "tab", "page", "pageSize", "condition", "sider", "keyword"]), [n.current]);
return Object.assign(o, { onTabChange: (l) => i({ tab: l, page: 1 }), onPageChange: (l, c) => i({ page: l, pageSize: c }), onPageSizeChange: (l) => i({ pageSize: l, page: 1 }), onConditionChange: (l, c) => i({ keyword: c, condition: Ht(n.current.condition || {}, { $merge: l || {} }), page: 1 }), onSiderChange: (l) => i({ sider: l, page: 1 }), onKeywordChange: (l) => i({ keyword: l, page: 1 }), itemOperationsAccess: r.current, dataSource: s.current, onReload: i });
}, Ga = ({ className: e, itemClassName: t, classNames: a = {}, dataSource: n, isPaginate: r, isItemOperations: s, isBatchOperations: i, batchOperations: o, itemOperations: l, itemOperationsAccess: c, resource: d, primaryKey: h, title: m, itemGridLayout: f, $setting: y, tabs: b, isConditionFormLayout: w, isTreeSider: v, treeSiderConfig: j }) => {
const { getBase62params: W, onClickCallback: I, onTabChange: L } = Ue(ve), { total: S, page: F, pageSize: V, tab: B } = (W == null ? void 0 : W()) || {}, H = ce((U, R, se) => u(Ya, { className: O("ff-data-list-framework-item", t), operations: s && R ? l == null ? void 0 : l.filter((M) => !(h && M.uuid && c.has(M.uuid)) || c.get(M.uuid).includes(R == null ? void 0 : R[h])) : [], data: d ? { [d]: R } : R, children: U, onClickCallback: I }), [d, h, s, I, l, c]);
return T("div", { className: O("ff-data-list-framework", e), children: [u(na, { className: a == null ? void 0 : a.sider, isTreeSider: v, ...j }), T("div", { className: O("ff-data-list-container", a == null ? void 0 : a.container), children: [u(vt, { className: a == null ? void 0 : a.filter, isConditionFormLayout: w }), u(aa, { title: m, className: a == null ? void 0 : a.toolbar, tabs: b, tab: B, onTabChange: L }), u(on, { ...f, className: a == null ? void 0 : a.content, style: { "--col-num": (y == null ? void 0 : y.colNum) || 1 }, primaryKey: h, itemRender: H, dataSource: n }), u(ra, { className: a == null ? void 0 : a.footer, isPaginate: r, isOperations: i, operations: o, total: S, page: F, pageSize: V })] })] });
}, Ya = ({ className: e, operations: t, children: a, data: n, onClickCallback: r }) => T("div", { className: O("data-list-grid-layout-item-container", e), children: [a, !!(t != null && t.length) && u("div", { className: "data-list-grid-layout-item-actions", children: t.map((s) => u("span", { className: "data-list-grid-layout-item-action", children: u(N.Link, { uuid: s.uuid, type: s.type, name: s.name, widget: s.widget, widgetType: s.widgetType, widgetProps: s.widgetProps, widgetSetting: s.widgetSetting, widgetContainerProps: s.widgetContainerSetting, data: n, onAfterClick: (i) => i !== !1 && (r == null ? void 0 : r(s.isRefresh, n)) }, s.uuid || Ye()) }, (s == null ? void 0 : s.uuid) || Ye())) })] }), Qa = ({ listCode: e, className: t, classNames: a = {}, itemClassName: n, dataSource: r, columns: s, isItemOperations: i, isBatchOperations: o, batchOperations: l, itemOperations: c, itemOperationsAccess: d, resource: h, primaryKey: m, title: f, tabs: y, isPaginate: b, isTreeSider: w, treeSiderConfig: v, isConditionFormLayout: j, ...W }) => {
const { getBase62params: I, onClickCallback: L, onTabChange: S } = Ue(ve), { total: F, page: V, tab: B, pageSize: H } = (I == null ? void 0 : I()) || {}, U = gt(c, r, d, m);
return T("div", { className: O("ff-data-table-framework", t), children: [u(na, { className: a == null ? void 0 : a.sider, isTreeSider: w, ...v }), T("div", { className: O("ff-data-table-container", a == null ? void 0 : a.container), children: [u(vt, { listCode: e, isConditionFormLayout: j }), u(aa, { title: f, className: a == null ? void 0 : a.toolbar, tabs: y, tab: B, onTabChange: S }), u(tn, { ...W, primaryKey: m, className: "ff-data-table-content", columns: s, dataSource: r, operationRender: U ? (R) => u("div", { className: "ff-data-table-actions", children: c == null ? void 0 : c.reduce((se, M, Fe) => [...se, u(N.Link, { size: "small", uuid: M.uuid, type: M.type, name: M.name, widget: M.widget, widgetType: M.widgetType, widgetProps: M.widgetProps, widgetData: M.widgetData, widgetSetting: M.widgetSetting, widgetContainerProps: M.widgetContainerSetting, data: R, onAfterClick: (Se) => Se !== !1 && (L == null ? void 0 : L(M.isRefresh, R)) }, M.uuid || Fe)], []) }) : null }), u(ra, { isPaginate: b, isOperations: o, operations: l, total: F, page: V, pageSize: H })] })] });
const { getBase62params: W, onClickCallback: I, onTabChange: L } = Ue(ve), { total: S, page: F, pageSize: V, tab: D } = (W == null ? void 0 : W()) || {}, H = ce((U, R, se) => u(Ya, { className: O("ff-data-list-framework-item", t), operations: s && R ? l == null ? void 0 : l.filter((M) => !(h && M.uuid && c.has(M.uuid)) || c.get(M.uuid).includes(R == null ? void 0 : R[h])) : [], data: d ? { [d]: R } : R, children: U, onClickCallback: I }), [d, h, s, I, l, c]);
return T("div", { className: O("ff-data-list-framework", e), children: [u(na, { className: a == null ? void 0 : a.sider, isTreeSider: v, ...j }), T("div", { className: O("ff-data-list-container", a == null ? void 0 : a.container), children: [u(vt, { className: a == null ? void 0 : a.filter, isConditionFormLayout: w }), u(aa, { title: m, className: a == null ? void 0 : a.toolbar, tabs: b, tab: D, onTabChange: L }), u(on, { ...f, className: a == null ? void 0 : a.content, style: { "--col-num": (y == null ? void 0 : y.colNum) || 1 }, primaryKey: h, itemRender: H, dataSource: n }), u(ra, { className: a == null ? void 0 : a.footer, isPaginate: r, isOperations: i, operations: o, total: S, page: F, pageSize: V })] })] });
}, Ya = ({ className: e, operations: t, children: a, data: n, onClickCallback: r }) => T("div", { className: O("data-list-grid-layout-item-container", e), children: [a, !!(t != null && t.length) && u("div", { className: "data-list-grid-layout-item-actions", children: t.map((s) => u("span", { className: "data-list-grid-layout-item-action", children: u(x.Link, { uuid: s.uuid, type: s.type, name: s.name, widget: s.widget, widgetType: s.widgetType, widgetProps: s.widgetProps, widgetSetting: s.widgetSetting, widgetContainerProps: s.widgetContainerSetting, data: n, onAfterClick: (i) => i !== !1 && (r == null ? void 0 : r(s.isRefresh, n)) }, s.uuid || Ye()) }, (s == null ? void 0 : s.uuid) || Ye())) })] }), Xa = ({ listCode: e, className: t, classNames: a = {}, itemClassName: n, dataSource: r, columns: s, isItemOperations: i, isBatchOperations: o, batchOperations: l, itemOperations: c, itemOperationsAccess: d, resource: h, primaryKey: m, title: f, tabs: y, isPaginate: b, isTreeSider: w, treeSiderConfig: v, isConditionFormLayout: j, ...W }) => {
const { getBase62params: I, onClickCallback: L, onTabChange: S } = Ue(ve), { total: F, page: V, tab: D, pageSize: H } = (I == null ? void 0 : I()) || {}, U = gt(c, r, d, m);
return T("div", { className: O("ff-data-table-framework", t), children: [u(na, { className: a == null ? void 0 : a.sider, isTreeSider: w, ...v }), T("div", { className: O("ff-data-table-container", a == null ? void 0 : a.container), children: [u(vt, { listCode: e, isConditionFormLayout: j }), u(aa, { title: f, className: a == null ? void 0 : a.toolbar, tabs: y, tab: D, onTabChange: S }), u(tn, { ...W, primaryKey: m, className: "ff-data-table-content", columns: s, dataSource: r, operationRender: U ? (R) => u("div", { className: "ff-data-table-actions", children: c == null ? void 0 : c.reduce((se, M, Fe) => [...se, u(x.Link, { size: "small", uuid: M.uuid, type: M.type, name: M.name, widget: M.widget, widgetType: M.widgetType, widgetProps: M.widgetProps, widgetData: M.widgetData, widgetSetting: M.widgetSetting, widgetContainerProps: M.widgetContainerSetting, data: R, onAfterClick: (Se) => Se !== !1 && (L == null ? void 0 : L(M.isRefresh, R)) }, M.uuid || Fe)], []) }) : null }), u(ra, { isPaginate: b, isOperations: o, operations: l, total: F, page: V, pageSize: H })] })] });
}, ve = C.createContext({ listCode: "", getBase62params: (e, t) => {
}, onReload: () => {
}, onClickCallback: () => {
@ -261,13 +264,13 @@ const Ja = (e, t = {}) => Z(() => e == null ? void 0 : e.map(({ widgetByJs: a, w
}, onKeywordChange: () => {
}, onPageChange: () => {
}, onPageSizeChange: () => {
} }), Xa = ({ isItemGridLayout: e, theme: t, themeProps: a, onClickCallback: n, onReload: r, listCode: s, total: i = 0, page: o = 0, onPageChange: l, pageSize: c = 30, onPageSizeChange: d, tab: h, onTabChange: m, keyword: f, onKeywordChange: y, condition: b, onConditionChange: w, sider: v, onSiderChange: j, ...W }) => {
const [I, L] = $();
return x(() => {
t ? X.getWidgetComponent(t).then((S) => {
} }), Qa = ({ isItemGridLayout: e, theme: t, themeProps: a, onClickCallback: n, onReload: r, listCode: s, total: i = 0, page: o = 0, onPageChange: l, pageSize: c = 30, onPageSizeChange: d, tab: h, onTabChange: m, keyword: f, onKeywordChange: y, condition: b, onConditionChange: w, sider: v, onSiderChange: j, ...W }) => {
const [I, L] = N();
return $(() => {
t ? Q.getWidgetComponent(t).then((S) => {
if (!S) throw `${t} not found`;
return S;
}).catch((S) => ({ default: () => `${S}` })).then((S) => L(C.createElement(S.default, { ...W, $setting: a }))) : L(u(e ? Ga : Qa, { ...W, $setting: a }));
}).catch((S) => ({ default: () => `${S}` })).then((S) => L(C.createElement(S.default, { ...W, $setting: a }))) : L(u(e ? Ga : Xa, { ...W, $setting: a }));
}, [t, a]), u(ve.Provider, { value: { listCode: s, onClickCallback: n, onReload: r, getBase62params: (S, F) => {
const V = { tab: h, page: o, pageSize: c, keyword: f, sider: v, condition: b, total: i };
return S && S != "init" ? V[S] ?? F : V;
@ -280,7 +283,7 @@ const ae = class ae {
P(this, ke, /* @__PURE__ */ new Map());
P(this, tt, () => {
if (g(this, oe)) return g(this, oe).port.postMessage({ command: "status", data: [] });
D(this, oe, new SharedWorker(new URL("/ff-worker/res-ws.js", self.location))), g(this, oe).port.onmessage = (t) => {
B(this, oe, new SharedWorker(new URL("/ff-worker/res-ws.js", self.location))), g(this, oe).port.onmessage = (t) => {
var a, n;
(a = t.data) != null && a.uuid ? g(this, ke).forEach((r, s) => {
var i;
@ -295,50 +298,50 @@ const ae = class ae {
if (g(ae, ge)) return g(ae, ge);
}
};
ge = new WeakMap(), oe = new WeakMap(), ke = new WeakMap(), tt = new WeakMap(), P(ae, ge, null), k(ae, "getInstance", () => (g(ae, ge) || D(ae, ge, new ae()), g(ae, ge)));
ge = new WeakMap(), oe = new WeakMap(), ke = new WeakMap(), tt = new WeakMap(), P(ae, ge, null), k(ae, "getInstance", () => (g(ae, ge) || B(ae, ge, new ae()), g(ae, ge)));
let pt = ae;
const ea = pt.getInstance(), kt = C.forwardRef(({ listCode: e, base62params: t, className: a, itemClassName: n, theme: r, themeProps: s, classNames: i }, o) => {
const [{ resource: l, primaryKey: c, batchOperations: d = [], itemOperations: h = [], columns: m = [], themeConfig: f, theme: y, isConditionFormLayout: b = !1, isTreeSider: w, treeSiderConfig: v, isItemGridLayout: j, itemGridLayout: W, title: I, isPaginate: L, tabs: S }, F] = $({ isItemGridLayout: !1, itemGridLayout: {} }), V = _a(e, t), [{ dataSource: B, itemOperationsAccess: H, condition: U, tab: R, keyword: se, page: M, total: Fe, pageSize: Se, sider: nt, onConditionChange: Tt, onTabChange: pa, onKeywordChange: ma, onPageChange: ha, onPageSizeChange: fa, onSiderChange: ya, onReload: rt }, Et] = Ka(V, e, c, l), wa = gt(h, B, H, c), Ca = gt(d);
return x(() => {
const [{ resource: l, primaryKey: c, batchOperations: d = [], itemOperations: h = [], columns: m = [], themeConfig: f, theme: y, isConditionFormLayout: b = !1, isTreeSider: w, treeSiderConfig: v, isItemGridLayout: j, itemGridLayout: W, title: I, isPaginate: L, tabs: S }, F] = N({ isItemGridLayout: !1, itemGridLayout: {} }), V = _a(e, t), [{ dataSource: D, itemOperationsAccess: H, condition: U, tab: R, keyword: se, page: M, total: Fe, pageSize: Se, sider: nt, onConditionChange: Tt, onTabChange: pa, onKeywordChange: ma, onPageChange: ha, onPageSizeChange: fa, onSiderChange: ya, onReload: rt }, Et] = Ka(V, e, c, l), wa = gt(h, D, H, c), Ca = gt(d);
return $(() => {
let He = null;
return e && E.get(`/api/_/${e}`).resp(({ data: Je, res: ba }) => {
Je != null && Je.isDynamicRefresh && (He = ea.subscribe(() => rt(), ba)), F(Je);
}).catch(() => F({})), () => He == null ? void 0 : He();
}, [e]), C.useImperativeHandle(o, () => ({ onReload: rt, onClickCallback: Et })), u(Xa, { listCode: e, title: I, itemClassName: n, classNames: i, resource: l, primaryKey: c, theme: r || y, themeProps: s || f, isTreeSider: w, treeSiderConfig: v, isPaginate: L, tabs: S, isItemOperations: wa, isBatchOperations: Ca, batchOperations: d, itemOperations: h, isItemGridLayout: j, columns: m, itemGridLayout: W, isConditionFormLayout: b, itemOperationsAccess: H, dataSource: B, onConditionChange: Tt, onTabChange: pa, onKeywordChange: ma, onPageChange: ha, onPageSizeChange: fa, onSiderChange: ya, condition: U, tab: R, keyword: se, page: M, total: Fe, pageSize: Se, sider: nt, className: O("ff-data-list-helper", a), onReload: rt, onClickCallback: Et });
}, [e]), C.useImperativeHandle(o, () => ({ onReload: rt, onClickCallback: Et })), u(Qa, { listCode: e, title: I, itemClassName: n, classNames: i, resource: l, primaryKey: c, theme: r || y, themeProps: s || f, isTreeSider: w, treeSiderConfig: v, isPaginate: L, tabs: S, isItemOperations: wa, isBatchOperations: Ca, batchOperations: d, itemOperations: h, isItemGridLayout: j, columns: m, itemGridLayout: W, isConditionFormLayout: b, itemOperationsAccess: H, dataSource: D, onConditionChange: Tt, onTabChange: pa, onKeywordChange: ma, onPageChange: ha, onPageSizeChange: fa, onSiderChange: ya, condition: U, tab: R, keyword: se, page: M, total: Fe, pageSize: Se, sider: nt, className: O("ff-data-list-helper", a), onReload: rt, onClickCallback: Et });
}), ta = (e, t, a, n, r = {}, s = 0) => {
const i = { "--grid-layout-h": `${n}`, "--grid-layout-w": `${a}`, "--grid-layout-x": `${e}`, "--grid-layout-y": `${t}`, "--grid-layout-row-height-offset": "0px" };
return r != null && r.autoHeight ? i.height = "fit-content" : i["--grid-layout-row"] = `${n}`, r != null && r.alignItems && (i["--grid-layout-box-align-items"] = r.alignItems), r != null && r.justifyContent && (i["--grid-layout-box-justify-content"] = r.justifyContent), i["--grid-layout-box-margin"] = jt(r == null ? void 0 : r.marginTop, r == null ? void 0 : r.marginRight, r == null ? void 0 : r.marginBottom, r == null ? void 0 : r.marginLeft), i["--grid-layout-box-padding"] = jt(r == null ? void 0 : r.paddingTop, r == null ? void 0 : r.paddingRight, r == null ? void 0 : r.paddingBottom, r == null ? void 0 : r.paddingLeft), s && (i.height = `${s}px`), i;
}, jt = (e, t, a, n) => `${e || 0}px ${t || 0}px ${a || 0}px ${n || 0}px`, vt = ({ className: e, isConditionFormLayout: t }) => {
var h, m;
const [a, n] = $({}), { listCode: r, onKeywordChange: s, onConditionChange: i, getBase62params: o } = C.useContext(ve), { keyword: l, condition: c } = (o == null ? void 0 : o()) || {}, [d] = _e.useForm();
return x(() => {
const [a, n] = N({}), { listCode: r, onKeywordChange: s, onConditionChange: i, getBase62params: o } = C.useContext(ve), { keyword: l, condition: c } = (o == null ? void 0 : o()) || {}, [d] = _e.useForm();
return $(() => {
r && t && E.get(`/api/_/${r}/list-condition-form-layout`).then(({ resource: f, marginX: y, marginY: b, rowHeight: w, cols: v, fields: j }) => {
n({ resource: f, itemMargin: [y, b], rowHeight: w, cols: v, fields: j });
}).catch(() => n({}));
}, [r, t]), x(() => {
}, [r, t]), $(() => {
d.setFieldsValue({ keyword: l, ...c });
}, [JSON.stringify([l, c])]), u("div", { className: O("ff-data-list-filter", e), children: u(_e, { form: d, layout: "vertical", autoComplete: "off", onFinish: ((h = a.fields) == null ? void 0 : h.length) > 1 ? (f) => i({ [a.resource]: f[a.resource] }, f.keyword) : () => {
}, onValuesChange: (f) => {
p.isEmpty(p.omit(f, ["keyword"])) || d.submit();
}, children: ((m = a.fields) == null ? void 0 : m.length) > 1 ? u($t, { ...a, children: u(Za, { onReset: () => {
}, children: ((m = a.fields) == null ? void 0 : m.length) > 1 ? u(Nt, { ...a, children: u(Za, { onReset: () => {
const { keyword: f, condition: y } = o("init") || {};
d.setFieldsValue({ keyword: f, ...y });
} }) }) : u("div", { className: "ff-data-list-filter-default-form ff-grid-layout-form", children: u("div", { className: "grid-layout-item", style: ta(20, 0, 5, 2), children: u(_e.Item, { name: ["keyword"], children: u(Na.Search, { allowClear: !0, enterButton: "搜索", placeholder: "多关键字 | 分割", onSearch: (f) => s(f) }) }) }) }) }) });
} }) }) : u("div", { className: "ff-data-list-filter-default-form ff-grid-layout-form", children: u("div", { className: "grid-layout-item", style: ta(20, 0, 5, 2), children: u(_e.Item, { name: ["keyword"], children: u(xa.Search, { allowClear: !0, enterButton: "搜索", placeholder: "多关键字 | 分割", onSearch: (f) => s(f) }) }) }) }) }) });
}, Za = ({ cols: e, fields: t, onReset: a }) => {
const [n, r] = $(!1), s = Z(() => t == null ? void 0 : t.toReversed().some((i) => i.y > 1 || i.x + i.w >= e - 5), [e, t]);
return T(_e.Item, { label: " ", style: { "--item-span": 5 }, className: O("ff-data-list-filter-actions", { expanded: n }), children: [u(lt, { onClick: a, children: "重置" }), u(lt, { type: "primary", htmlType: "submit", children: "查询" }), s && u(N.Link, { className: "ff-data-list-filter-expanded-button", widget: () => r((i) => !i), type: "primary", name: n ? "关闭" : "展开", icon: n ? "icon-up" : "icon-down", iconPosition: "end" })] });
const [n, r] = N(!1), s = Z(() => t == null ? void 0 : t.toReversed().some((i) => i.y > 1 || i.x + i.w >= e - 5), [e, t]);
return T(_e.Item, { label: " ", style: { "--item-span": 5 }, className: O("ff-data-list-filter-actions", { expanded: n }), children: [u(lt, { onClick: a, children: "重置" }), u(lt, { type: "primary", htmlType: "submit", children: "查询" }), s && u(x.Link, { className: "ff-data-list-filter-expanded-button", widget: () => r((i) => !i), type: "primary", name: n ? "关闭" : "展开", icon: n ? "icon-up" : "icon-down", iconPosition: "end" })] });
};
vt.reservedFields = [{ x: 0, y: 0, h: 3, w: 5, field: { isVirtual: !0, widgetPrefix: "@pkg/ff/grid-layout-forms", widget: "Input", code: "keyword", label: "关键字", placeholder: "多关键字 | 分割", extras: { prefix: "icon-search" } } }];
const aa = ({ className: e, title: t, tabs: a, tab: n, onTabChange: r }) => {
const [s, i] = La((a == null ? void 0 : a[0].value) ?? (a == null ? void 0 : a[0].code), { value: n, onChange: r });
return T("div", { className: O("ff-data-list-toolbar", e), children: [u("div", { className: "ff-data-list-title", children: t }), u($a, { className: "ff-data-list-tabs", itemRender: ({ label: o, code: l, value: c }) => u("span", { onClick: () => i(c ?? l), className: O("ff-data-list-tab", { active: (c ?? l) == s }), children: o }), items: a }), T("div", { className: "ff-data-list-actions", children: [u(N.Link, { icon: "icon-reload" }), u(N.Link, { icon: "icon-setting" })] })] });
return T("div", { className: O("ff-data-list-toolbar", e), children: [u("div", { className: "ff-data-list-title", children: t }), u(Na, { className: "ff-data-list-tabs", itemRender: ({ label: o, code: l, value: c }) => u("span", { onClick: () => i(c ?? l), className: O("ff-data-list-tab", { active: (c ?? l) == s }), children: o }), items: a }), T("div", { className: "ff-data-list-actions", children: [u(x.Link, { icon: "icon-reload" }), u(x.Link, { icon: "icon-setting" })] })] });
}, en = [{ 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" }] }] }], na = ({ className: e, width: t = 280, isTreeSider: a }) => a ? u(Pa.DirectoryTree, { className: O("ff-data-list-sider", e), style: { "--sider-width": t }, showLine: !0, showIcon: !1, treeData: en }) : null, ra = ({ className: e, operations: t, isOperations: a, isPaginate: n, total: r, page: s, pageSize: i }) => {
const { onPageChange: o, onPageSizeChange: l, onClickCallback: c } = C.useContext(ve);
return a && !p.isEmpty(t) || n ? T("div", { className: O("ff-data-list-footer", e), children: [u("div", { className: "ff-data-list-actions", children: t == null ? void 0 : t.map((d, h) => u(N, { 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 && (c == null ? void 0 : c(d.isRefresh, null)) }, d.uuid || h)) }), n && u(xa, { size: "small", total: r, pageSize: i, showSizeChanger: !1, showTotal: (d) => `${s} 页 / 总共 ${d}`, onChange: o, onShowSizeChange: l })] }) : null;
return a && !p.isEmpty(t) || n ? T("div", { className: O("ff-data-list-footer", e), children: [u("div", { className: "ff-data-list-actions", children: t == null ? void 0 : t.map((d, h) => u(x, { 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 && (c == null ? void 0 : c(d.isRefresh, null)) }, d.uuid || h)) }), n && u($a, { size: "small", total: r, pageSize: i, showSizeChanger: !1, showTotal: (d) => `${s} 页 / 总共 ${d}`, onChange: o, onShowSizeChange: l })] }) : null;
}, sa = (e, t, a = !0) => a !== !0 && a-- <= 0 ? [] : p.isArray(e) && !p.isEmpty(e) ? e.reduce((n, r) => (Reflect.has(r, t) && Reflect.has(r, "children") && n.push(r[t]), Reflect.has(r, "children") && !p.isEmpty(r.children) ? n.concat(sa(r.children, t, a)) : n), []) : [], tn = ({ className: e, primaryKey: t, columns: a = [], dataSource: n = [], operationRender: r, operationWidth: s = 180, ...i }) => {
Ye();
const o = q(null), l = q(null), [c, d] = $([]), [h, m] = $({ width: 0, height: 0 });
x(() => {
const o = q(null), l = q(null), [c, d] = N([]), [h, m] = N({ width: 0, height: 0 });
$(() => {
d(sa(n, t));
}, [n, t]), Sa(() => {
const y = new ResizeObserver(() => {
@ -352,15 +355,15 @@ const aa = ({ className: e, title: t, tabs: a, tab: n, onTabChange: r }) => {
const f = Ja(a);
return u("div", { ref: l, className: O("ff-data-list-table", e), children: h.height ? u(Ta, { ...i, ref: o, rowKey: (y) => (y == null ? void 0 : y[t]) ?? Math.random(), columns: f == null ? void 0 : f.concat(r ? [{ title: "操作", align: "center", fixed: "right", width: `${Math.ceil(s / h.width * 100).toFixed(2)}%`, render: (y, b, w) => r(b, w) }] : []), dataSource: n, size: "middle", scroll: { x: "max-content", y: h.height - 50 }, pagination: !1, expandable: { defaultExpandAllRows: !0, expandRowByClick: !0, onExpandedRowsChange: d, expandedRowKeys: c } }) : null });
}, an = "RC_FORM_INTERNAL_HOOKS", ia = (e, { initialValue: t, initialValueLanguage: a, convertJs: n, convertJsSetting: r, type: s = "string" }, i = null) => {
const o = q(!1), l = Ue(Va), [c, d] = $(), [h, m] = $(a != "javascript" && e ? l.getFieldValue(e) : void 0), { registerWatch: f } = l.getInternalHooks(an) || {};
return x(() => f == null ? void 0 : f((y, b, w) => {
const o = q(!1), l = Ue(Va), [c, d] = N(), [h, m] = N(a != "javascript" && e ? l.getFieldValue(e) : void 0), { registerWatch: f } = l.getInternalHooks(an) || {};
return $(() => f == null ? void 0 : f((y, b, w) => {
if (!o.current) return;
const v = p.get(b, e);
p.isEqual(v, h) || m(Y(v, s));
}), [h]), x(() => {
}), [h]), $(() => {
a == "javascript" && t ? we.exec(t, {}, { getFieldValueForBasicForm: (y) => i ? i.getFieldValue(y) : l.getFieldValue(y), getFieldValue: (y) => l.getFieldValue(y) }).then((y) => m(Y(y, s))).catch((y) => notification.error({ message: `布局数据错误: ${JSON.stringify(y)}` })).finally(() => o.current = !0) : (t && m(Y(t ?? l.getFieldValue(e), s)), o.current = !0);
}, [t, a]), De(() => {
o.current && n && new Qe([n, r]).toValue(h, l.getFieldsValue(!0)).then(d).catch((y) => {
}, [t, a]), Be(() => {
o.current && n && new Xe([n, r]).toValue(h, l.getFieldsValue(!0)).then(d).catch((y) => {
d(y), console.error("布局数据转换错误: ", y, n);
});
}, [h, n, r]), [c ?? h, h];
@ -368,31 +371,31 @@ const aa = ({ className: e, title: t, tabs: a, tab: n, onTabChange: r }) => {
var r;
return (r = p.sortBy(e, ["y", "x"])) == null ? void 0 : r.map(({ i: s, x: i, y: o, w: l, h: c, field: { boxStyle: d, widgetPrefix: h = a, widget: m, ...f } }, y) => u("div", { className: "grid-layout-item", style: ta(i, o, l, c, d, m === "Height" && (f == null ? void 0 : f.initialValue)), children: u(nn, { ...f, basicForm: n, itemWidget: m != null && m.startsWith("@") || m != null && m.startsWith("blob:") ? m : `${h}/${m}`, itemWidgetRender: t }) }, s || y));
}, [e]), nn = ({ itemWidget: e, itemWidgetRender: t, basicForm: a, ...n }) => {
const [r, s] = $();
return x(() => {
X.getWidgetComponent(e).then(({ defaultProps: i = {}, default: o }) => {
const [r, s] = N();
return $(() => {
Q.getWidgetComponent(e).then(({ defaultProps: i = {}, default: o }) => {
s(C.createElement(t(o, i, a), n));
}).catch((i) => {
console.error(i), s(e);
});
}, [e]), r;
}, la = ({ cols: e = 12, rowHeight: t = 21, fields: a = [], data: n, containerPadding: r = [0, 0], itemMargin: s = [4, 0], formProps: i = {}, className: o, ...l }) => {
const [c] = Q.useForm(), d = oa(a, rn, "@pkg/ff/grid-layouts"), h = Z(() => [{ name: "__PROPS__", value: i }], [i]);
return De(() => (c.setFieldsValue(n), () => c.resetFields()), [n]), u(Q, { fields: h, form: c, component: !1, children: u("div", { ...l, className: O("ff-grid-layout", o), style: { "--grid-layout-item-margin-y": `${(s == null ? void 0 : s[0]) || 0}px`, "--grid-layout-item-margin-x": `${(s == null ? void 0 : s[1]) || 0}px`, "--grid-layout-container-padding-y": `${(r == null ? void 0 : r[0]) || 0}px`, "--grid-layout-container-padding-x": `${(r == null ? void 0 : r[1]) || 0}px`, "--grid-layout-cols": e, "--grid-layout-row-height": `${t}px` }, children: d }) });
const [c] = X.useForm(), d = oa(a, rn, "@pkg/ff/grid-layouts"), h = Z(() => [{ name: "__PROPS__", value: i }], [i]);
return Be(() => (c.setFieldsValue(n), () => c.resetFields()), [n]), u(X, { fields: h, form: c, component: !1, children: u("div", { ...l, className: O("ff-grid-layout", o), style: { "--grid-layout-item-margin-y": `${(s == null ? void 0 : s[0]) || 0}px`, "--grid-layout-item-margin-x": `${(s == null ? void 0 : s[1]) || 0}px`, "--grid-layout-container-padding-y": `${(r == null ? void 0 : r[0]) || 0}px`, "--grid-layout-container-padding-x": `${(r == null ? void 0 : r[1]) || 0}px`, "--grid-layout-cols": e, "--grid-layout-row-height": `${t}px` }, children: d }) });
}, rn = (e, t = {}, a = null) => (n) => {
const { code: r, label: s, extras: i, isVirtual: o, initialValue: l, initialValueLanguage: c, convertJs: d, convertJsSetting: h, ...m } = p.merge({}, t, n), [f, y] = ia(o ? null : r, { initialValue: l, initialValueLanguage: c, convertJs: d, convertJsSetting: h, type: (m == null ? void 0 : m.type) || "string" }, a);
return u(e, { ...m, value: f, rawValue: y, $setting: i || {} });
}, nr = (It = la, function({ code: e, data: t, ...a }) {
const [n, r] = $({ resource: null, cols: 12, rowHeight: 21, fields: [] });
return x(() => {
}, rr = (It = la, function({ code: e, data: t, ...a }) {
const [n, r] = N({ resource: null, cols: 12, rowHeight: 21, fields: [] });
return $(() => {
e && E.get(`/api/_/${e}`).then((s) => r(p.pick(s, ["resource", "cols", "rowHeight", "fields"])));
}, [e]), (n == null ? void 0 : n.resource) && u(It, { ...a, rowHeight: n.rowHeight, cols: n.cols, fields: n.fields, data: n != null && n.resource ? { [n == null ? void 0 : n.resource]: t } : {} });
});
var It;
const rr = ({ widget: e, widgetPrefix: t = "@pkg/ff/grid-layouts", basicForm: a, ...n }) => {
const r = e != null && e.startsWith("@") || e != null && e.startsWith("blob:") ? e : `${t}/${e}`, [s, i] = $();
return x(() => {
r && X.getWidgetComponent(r).then(({ defaultProps: o = {}, default: l }) => ({ default: sn(l, o, a) })).catch((o) => ({ default: () => `${o}` })).then((o) => i(C.createElement(o.default, n)));
const sr = ({ widget: e, widgetPrefix: t = "@pkg/ff/grid-layouts", basicForm: a, ...n }) => {
const r = e != null && e.startsWith("@") || e != null && e.startsWith("blob:") ? e : `${t}/${e}`, [s, i] = N();
return $(() => {
r && Q.getWidgetComponent(r).then(({ defaultProps: o = {}, default: l }) => ({ default: sn(l, o, a) })).catch((o) => ({ default: () => `${o}` })).then((o) => i(C.createElement(o.default, n)));
}, [r]), s;
}, sn = (e, t = {}, a = null) => (n) => {
const { code: r, label: s, extras: i, isVirtual: o, initialValue: l, initialValueLanguage: c, convertJs: d, convertJsSetting: h, value: m, ...f } = p.merge({}, t, n), [y, b] = ia(o ? null : r, { initialValue: l, initialValueLanguage: c, convertJs: d, convertJsSetting: h, type: (f == null ? void 0 : f.type) || "string" }, a);
@ -407,10 +410,10 @@ const rr = ({ widget: e, widgetPrefix: t = "@pkg/ff/grid-layouts", basicForm: a,
const { base62params: t } = Aa();
return u(K, { children: u(kt, { listCode: e, base62params: E.decode(t) }) });
}, cn = () => "Empty", dn = ({ component: e, $setting: t }) => {
const [a, n] = $();
x(() => {
const [a, n] = N();
$(() => {
if (!e) return n(u(cn, { description: null }));
X.getWidgetComponent(e).catch((s) => ({ default: () => `${s}` })).then((s) => C.createElement(s.default, { $setting: t })).then(n);
Q.getWidgetComponent(e).catch((s) => ({ default: () => `${s}` })).then((s) => C.createElement(s.default, { $setting: t })).then(n);
}, [e]);
const r = le.getPageParams() || {};
return a ? C.cloneElement(a, r) : null;
@ -422,7 +425,7 @@ const ne = class ne {
P(this, me, {});
P(this, he, null);
k(this, "init", (t, a) => {
D(this, G, t), D(this, me, a);
B(this, G, t), B(this, me, a);
});
k(this, "get", (t) => (g(this, G).has(t) || (t = Array.from(g(this, G).keys()).find((a) => g(this, G).get(a).uri === t)), g(this, G).get(t) || {}));
k(this, "redirect", (t, a, n = {}) => {
@ -478,7 +481,7 @@ const ne = class ne {
});
k(this, "createBrowserRouter", (t = {}) => {
if (g(this, G).size == 0) return null;
const a = Le.get("Common.WEBSITE_DEFAULT_THEME", "@pkg/ff/frameworks/BasicLayout"), n = Le.get(X.checkUserToken() ? "Common.WEBSITE_LOGIN_REDIRECT" : "Common.WEBSITE_DEFAULT", "/index"), r = { [a]: 0 }, s = (o, l) => () => X.getWidgetComponent(o).then((c) => c.default || function() {
const a = Le.get("Common.WEBSITE_DEFAULT_THEME", "@pkg/ff/frameworks/DefaultTheme"), n = Le.get(Q.checkUserToken() ? "Common.WEBSITE_LOGIN_REDIRECT" : "Common.WEBSITE_DEFAULT", "/index"), r = { [a]: 0 }, s = (o, l) => () => Q.getWidgetComponent(o).then((c) => c.default || function() {
return `${o}`;
}).then((c) => ({ Component: () => C.createElement(_t, {}, C.createElement(c, l)) })), i = Array.from(g(this, G).values()).reduce((o, { uuid: l, uri: c, name: d, type: h, component: m, widgetSetting: f, isLogin: y, isLayout: b, extra: w }) => {
let v = {}, j = 0;
@ -495,79 +498,79 @@ const ne = class ne {
}
return b && j > -1 ? (o[j].children.push({ path: c, ...v }), o) : [...o, { path: c, ...v }];
}, [{ path: "/", lazy: s(a, {}), children: [] }]);
return i.push({ index: !0, element: C.createElement(un, { to: n, replace: !0 }) }), D(this, he, Ia(i, t));
return i.push({ index: !0, element: C.createElement(un, { to: n, replace: !0 }) }), B(this, he, Ia(i, t));
});
if (g(ne, pe)) return g(ne, pe);
}
};
pe = new WeakMap(), G = new WeakMap(), me = new WeakMap(), he = new WeakMap(), ze = new WeakMap(), We = new WeakMap(), P(ne, pe, null), k(ne, "getInstance", () => (g(ne, pe) || D(ne, pe, new ne()), g(ne, pe)));
pe = new WeakMap(), G = new WeakMap(), me = new WeakMap(), he = new WeakMap(), ze = new WeakMap(), We = new WeakMap(), P(ne, pe, null), k(ne, "getInstance", () => (g(ne, pe) || B(ne, pe, new ne()), g(ne, pe)));
let mt = ne;
const un = ({ to: e, replace: t }) => Ma() ? C.createElement(za, { to: e, replace: t }) : (window.document.location = e, "redirect"), le = mt.getInstance(), Ne = new Worker(new URL("/ff-worker/index.js", self.location)), Mt = { getConfigure: (e) => Le.get(e), route: { redirect: (...e) => le.redirect(...e), getPageParams: (...e) => le.getPageParams(...e), getCurrentRoute: () => le.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) } };
const un = ({ to: e, replace: t }) => Ma() ? C.createElement(za, { to: e, replace: t }) : (window.document.location = e, "redirect"), le = mt.getInstance(), xe = new Worker(new URL("/ff-worker/index.js", self.location)), Mt = { getConfigure: (e) => Le.get(e), route: { redirect: (...e) => le.redirect(...e), getPageParams: (...e) => le.getPageParams(...e), getCurrentRoute: () => le.getCurrentRoute() }, popup: { notification: (...e) => _.notification(...e), success: (...e) => _.success(...e), error: (...e) => _.error(...e), form: (...e) => _.form(...e), modal: (...e) => _.modal(...e), confirm: (...e) => _.confirm(...e) } };
var at, Te, fe;
const z = class z {
constructor() {
k(this, "exec", (t, a = {}, n = {}, r = "") => new Promise((s, i) => {
const o = Ot(z, at)._++;
g(z, Te).set(o, n), z.mQueue.set(o, [s, i]), Ne.postMessage({ id: o, session: r, category: "eval", method: t, args: a });
g(z, Te).set(o, n), z.mQueue.set(o, [s, i]), xe.postMessage({ id: o, session: r, category: "eval", method: t, args: a });
}));
k(this, "clear", (t) => Ne.postMessage({ session: t, category: "clear" }));
k(this, "clear", (t) => xe.postMessage({ session: t, category: "clear" }));
if (g(z, fe)) return g(z, fe);
Promise.resolve().then(() => Vn).then((t) => {
Mt.http = t.http;
}), Ne.addEventListener("message", ({ data: { id: t, task_id: a, method: n, args: r, category: s, data: i, error: o, session: l } }) => {
}), xe.addEventListener("message", ({ data: { id: t, task_id: a, method: n, args: r, category: s, data: i, error: o, session: l } }) => {
if (s === "eval" && z.mQueue.has(t)) o !== null ? z.mQueue.get(t)[1](o) : z.mQueue.get(t)[0](i), g(z, Te).delete(t), z.mQueue.delete(t);
else if (s === "util") try {
const c = p.get(Mt, n.split("/")) || p.get(g(z, Te).get(a), n.split("/"));
if (!p.isFunction(c)) throw `${n} not found`;
Promise.resolve(Reflect.apply(c, void 0, r)).then((d) => {
Ne.postMessage({ id: t, task_id: a, category: s, method: n, args: r, session: l, data: d, error: null });
xe.postMessage({ id: t, task_id: a, category: s, method: n, args: r, session: l, data: d, error: null });
}).catch((d) => {
Ne.postMessage({ id: t, task_id: a, category: s, method: n, args: r, session: l, data: null, error: d });
xe.postMessage({ id: t, task_id: a, category: s, method: n, args: r, session: l, data: null, error: d });
});
} catch (c) {
Ne.postMessage({ id: t, task_id: a, category: s, method: n, args: r, session: l, data: null, error: c });
xe.postMessage({ id: t, task_id: a, category: s, method: n, args: r, session: l, data: null, error: c });
}
}, !1);
}
};
at = new WeakMap(), Te = new WeakMap(), fe = new WeakMap(), k(z, "mQueue", /* @__PURE__ */ new Map()), P(z, at, 0), P(z, Te, /* @__PURE__ */ new Map()), P(z, fe, null), k(z, "getInstance", () => (g(z, fe) || D(z, fe, new z()), g(z, fe)));
at = new WeakMap(), Te = new WeakMap(), fe = new WeakMap(), k(z, "mQueue", /* @__PURE__ */ new Map()), P(z, at, 0), P(z, Te, /* @__PURE__ */ new Map()), P(z, fe, null), k(z, "getInstance", () => (g(z, fe) || B(z, fe, new z()), g(z, fe)));
let ht = z;
const we = ht.getInstance(), St = () => {
const e = q(!0), [, t] = C.useReducer((a) => a + 1, 0);
return x(() => () => e.current = !1, []), () => e.current && t();
}, sr = (e) => {
return $(() => () => e.current = !1, []), () => e.current && t();
}, ir = (e) => {
const t = q();
return x(() => {
return $(() => {
t.current = e;
}, [e]), t.current;
}, ir = (e) => {
const [t, a] = $(e), n = q(null), r = ce((s, i) => {
}, or = (e) => {
const [t, a] = N(e), n = q(null), r = ce((s, i) => {
n.current = i, a(s);
}, []);
return x(() => {
return $(() => {
n.current && (n.current(t), n.current = null);
}, [t]), [t, r];
}, De = (e = (n) => {
}, Be = (e = (n) => {
}, t, a = p.isEqual) => {
const n = C.useRef();
a(t, n.current) || (n.current = p.cloneDeep(t)), C.useEffect(e, [n.current]);
}, Nt = De, ca = (e, t = "string") => {
}, xt = Be, ca = (e, t = "string") => {
var a;
if (!Array.isArray(e)) return e;
for (let n = 0; n < e.length; n++) e[n].value = Y((a = e[n]) == null ? void 0 : a.value, t), e[n] && Reflect.has(e[n], "children") && (e[n].children = ca(e[n].children, t));
return e;
}, or = (e, t = "json", a = "string", n, r = null) => {
const [s] = Q.useForm(n), [i, o] = $([{ label: "无", value: "", disabled: !0 }]), l = q([]), c = Q.useWatch((d) => l.current.length === 0 ? null : p.pick(d, l.current), s) || null;
return x(() => {
}, lr = (e, t = "json", a = "string", n, r = null) => {
const [s] = X.useForm(n), [i, o] = N([{ label: "无", value: "", disabled: !0 }]), l = q([]), c = X.useWatch((d) => l.current.length === 0 ? null : p.pick(d, l.current), s) || null;
return $(() => {
Array.isArray(e) ? o(e) : t === "javascript" && e ? we.exec(e, {}, { getFieldValue: (d) => (l.current.includes(d) || l.current.push(d), s.getFieldValue(d)), getFieldValueForBasicForm: (d) => (l.current.includes(d) || l.current.push(d), r ? r.getFieldValue(d) : s.getFieldValue(d)) }).then((d) => {
o(Y(d, "array"));
}) : e && o(Y(e, "array"));
}, [e, t, c]), ca(i, a);
}, lr = (e) => {
const [t, a] = $(), n = { type: "GET" };
}, cr = (e) => {
const [t, a] = N(), n = { type: "GET" };
if (typeof e == "string" ? n.url = e : p.isPlainObject(e) && Object.assign(n, e), !(n != null && n.url)) throw "url is required";
const r = (s) => E.request(n, !1).resp((i) => (console.log("useSubscribeRequest", s), a(i), i));
return De(() => {
return Be(() => {
let s = null;
return r().then((i) => {
s = ea.subscribe(p.throttle(r, 180, { leading: !1, trailing: !0 }), i.res);
@ -582,8 +585,8 @@ const we = ht.getInstance(), St = () => {
}, { items: [], hides: [] }) })).then(a);
}, [e]), t;
}, pn = ({ max: e = 0, min: t = 0, type: a = "", message: n, pattern: r, required: s = !1, validator: i } = {}, o, l) => {
const [c, d] = $([]);
return x(() => {
const [c, d] = N([]);
return $(() => {
const h = [];
if (s) {
let m = l;
@ -616,72 +619,72 @@ const we = ht.getInstance(), St = () => {
d(h);
}, [e, t, a, n, r, s, i]), c;
}, mn = (e, t, a) => {
const [n, r] = $(null);
return x(() => {
const [n, r] = N(null);
return $(() => {
const { initDataUri: s = `/api/${e}`, initDataMethod: i = "GET" } = a || {};
t && E.request({ method: i, url: p.trimEnd(`${s}/${t}`, "/") }).then((o) => {
r(o);
});
}, [e, t, a]), n;
}, hn = (e, t, a, n = {}) => {
const r = St(), s = q(!0), i = q([]), [o, l] = $(a), c = Q.useWatch((d) => JSON.stringify(p.pick(d, i.current)), t) || "{}";
return x(() => {
const r = St(), s = q(!0), i = q([]), [o, l] = N(a), c = X.useWatch((d) => JSON.stringify(p.pick(d, i.current)), t) || "{}";
return $(() => {
e && we.exec(e, n, { getFieldValue: p.wrap(t.getFieldValue, (d, h) => (i.current.some((m) => p.isEqual(m, h)) || (i.current.push(h), r()), d(h))), isFieldTouched: t.isFieldTouched, isFieldsTouched: t.isFieldsTouched }).then((d) => s.current && l(d));
}, [e, c, t, n]), x(() => () => s.current = !1, []), o;
}, cr = ({ value: e, onChange: t }, a = null) => {
const n = q(), [r] = Q.useForm(a);
return Nt(() => {
}, [e, c, t, n]), $(() => () => s.current = !1, []), o;
}, dr = ({ value: e, onChange: t }, a = null) => {
const n = q(), [r] = X.useForm(a);
return xt(() => {
p.isEqual(n.current, e) || r.setFieldsValue(e);
}, [e]), x(() => () => r.resetFields(), []), [Z(() => r.__INTERNAL__ ? r : { ...r, __INTERNAL__: {} }, [r]), (s, i) => {
}, [e]), $(() => () => r.resetFields(), []), [Z(() => r.__INTERNAL__ ? r : { ...r, __INTERNAL__: {} }, [r]), (s, i) => {
n.current = i, t(i);
}];
}, fn = ({ type: e, initialValue: t, initialValueLanguage: a, onChange: n, form: r }) => {
const s = hn(a == "javascript" && t, r, a == "javascript" ? void 0 : t, {});
return x(() => {
return $(() => {
a == "javascript" ? n(Y(s, e)) : t && n(Y(t, e));
}, [e, t, s]), null;
}, yn = ({ widget: e = "Input", widgetPrefix: t = "@pkg/ff/grid-layout-forms", widgetDecorator: a, subWidgets: n, basicForm: r, ...s }) => {
const i = e != null && e.startsWith("@") || e != null && e.startsWith("blob:") ? e : `${t}/${e}`, [o, l] = $();
return x(() => {
i && X.getWidgetComponent(i).then(({ defaultProps: c = {}, default: d }) => ({ default: da(d, c, r) })).catch((c) => ({ default: () => `${c}` })).then((c) => l(C.createElement(c.default, s)));
const i = e != null && e.startsWith("@") || e != null && e.startsWith("blob:") ? e : `${t}/${e}`, [o, l] = N();
return $(() => {
i && Q.getWidgetComponent(i).then(({ defaultProps: c = {}, default: d }) => ({ default: da(d, c, r) })).catch((c) => ({ default: () => `${c}` })).then((c) => l(C.createElement(c.default, s)));
}, [i]), o && C.cloneElement(o, s);
}, da = (e, t = {}, a = null) => (n) => {
const { type: r, code: s, label: i, noStyle: o, placeholder: l, extras: c, validators: d, help: h, isVirtual: m, $isReserved: f, initialValue: y, initialValueLanguage: b, convertJs: w, convertJsSetting: v, widgetPerfix: j, boxStyle: W, widgetDecorator: I, subWidgets: L, ...S } = { ...t, ...n }, F = pn(d || {}, s, r), V = { label: i, noStyle: o, colon: !1, layout: "vertical" }, B = { placeholder: l, ...S }, H = ce((U) => U == null ? void 0 : Y(U, r), [r]);
const { type: r, code: s, label: i, noStyle: o, placeholder: l, extras: c, validators: d, help: h, isVirtual: m, $isReserved: f, initialValue: y, initialValueLanguage: b, convertJs: w, convertJsSetting: v, widgetPerfix: j, boxStyle: W, widgetDecorator: I, subWidgets: L, ...S } = { ...t, ...n }, F = pn(d || {}, s, r), V = { label: i, noStyle: o, colon: !1, layout: "vertical" }, D = { placeholder: l, ...S }, H = ce((U) => U == null ? void 0 : Y(U, r), [r]);
return u(Jt, { name: s, rules: F, initialValue: H(y), normalize: H, children: (U, R, se) => {
var M;
return u(e, { type: r, rcform: se, itemProps: { validateStatus: R.errors.length > 0 ? "error" : "success", tooltip: h, help: R.errors.length > 0 ? R.errors.join("、") : null, required: ((M = F == null ? void 0 : F[0]) == null ? void 0 : M.required) || !1, ...V }, fieldProps: { ...B, ...U }, $setting: c || {} });
return u(e, { type: r, rcform: se, itemProps: { validateStatus: R.errors.length > 0 ? "error" : "success", tooltip: h, help: R.errors.length > 0 ? R.errors.join("、") : null, required: ((M = F == null ? void 0 : F[0]) == null ? void 0 : M.required) || !1, ...V }, fieldProps: { ...D, ...U }, $setting: c || {} });
} });
}, $t = ({ cols: e = 24, rowHeight: t = 16, itemMargin: a = [8, 16], containerPadding: n = [0, 0], fields: r = [], children: s, basicForm: i = null }) => {
}, Nt = ({ cols: e = 24, rowHeight: t = 16, itemMargin: a = [8, 16], containerPadding: n = [0, 0], fields: r = [], children: s, basicForm: i = null }) => {
const o = oa(r, da, "@pkg/ff/grid-layout-forms");
return T("div", { className: "ff-grid-layout-form", style: { "--grid-layout-item-margin-x": `${(a == null ? void 0 : a[0]) ?? 8}px`, "--grid-layout-item-margin-y": `${(a == null ? void 0 : a[1]) ?? 16}px`, "--grid-layout-container-padding-y": `${(n == null ? void 0 : n[0]) || 0}px`, "--grid-layout-container-padding-x": `${(n == null ? void 0 : n[1]) || 0}px`, "--grid-layout-cols": e, "--grid-layout-row-height": `${t}px` }, children: [o, s && C.cloneElement(s, { cols: e, rowHeight: t, itemMargin: a, containerPadding: n, fields: r })] });
};
$t.propTypes = { fields: A.array };
const wn = (zt = $t, ({ code: e, layout: t, name: a, primaryKey: n = 0, style: r = {}, formProps: s = {}, form: i, isPreview: o = !1, className: l, onFinish: c, onValuesChange: d = () => {
Nt.propTypes = { fields: A.array };
const wn = (zt = Nt, ({ code: e, layout: t, name: a, primaryKey: n = 0, style: r = {}, formProps: s = {}, form: i, isPreview: o = !1, className: l, onFinish: c, onValuesChange: d = () => {
}, ...h }) => {
const { align: m, autoComplete: f, resource: y, items: b, hides: w, rowHeight: v, marginX: j, marginY: W, cols: I, listenChangeFields: L, listenChangeFieldsFunc: S, pk: F, uuid: V } = gn(e), [B] = Q.useForm(i), H = Z(() => [{ name: "__PK__", value: F }, { name: "__PROPS__", value: s }, { name: "__RESOURCE__", value: y }, { name: "__LAYOUT_KEY__", value: e }, { name: "__LAYOUT_UUID__", value: V }, { name: "__PRIMARY_KEY__", value: n }], [F, e, V, y, n, s]);
return T(Q, { className: l, name: a || e, layout: t || m, fields: H, form: B, autoComplete: f, style: { ...r, position: "relative" }, onFinish: c, onValuesChange: (U, R) => (({ changedValues: se, allValues: M, listenChangeFields: Fe, listenChangeFieldsFunc: Se, onValuesChange: nt, code: Tt }) => {
nt(se, M), Se && Array.isArray(Fe) && we.exec(Se, { changedValues: se, allValues: M }, { getFieldValue: B.getFieldValue, setFieldValue: B.setFieldValue, setFieldsValue: B.setFieldsValue, isFieldTouched: B.isFieldTouched, isFieldsTouched: B.isFieldsTouched });
})({ changedValues: U, allValues: R, listenChangeFields: L, listenChangeFieldsFunc: S, onValuesChange: d, code: e }), children: [u(zt, { ...h, form: B, code: e, fields: b, cols: I, rowHeight: v, itemMargin: [j, W] }), w == null ? void 0 : w.map((U) => {
const { align: m, autoComplete: f, resource: y, items: b, hides: w, rowHeight: v, marginX: j, marginY: W, cols: I, listenChangeFields: L, listenChangeFieldsFunc: S, pk: F, uuid: V } = gn(e), [D] = X.useForm(i), H = Z(() => [{ name: "__PK__", value: F }, { name: "__PROPS__", value: s }, { name: "__RESOURCE__", value: y }, { name: "__LAYOUT_KEY__", value: e }, { name: "__LAYOUT_UUID__", value: V }, { name: "__PRIMARY_KEY__", value: n }], [F, e, V, y, n, s]);
return T(X, { className: l, name: a || e, layout: t || m, fields: H, form: D, autoComplete: f, style: { ...r, position: "relative" }, onFinish: c, onValuesChange: (U, R) => (({ changedValues: se, allValues: M, listenChangeFields: Fe, listenChangeFieldsFunc: Se, onValuesChange: nt, code: Tt }) => {
nt(se, M), Se && Array.isArray(Fe) && we.exec(Se, { changedValues: se, allValues: M }, { getFieldValue: D.getFieldValue, setFieldValue: D.setFieldValue, setFieldsValue: D.setFieldsValue, isFieldTouched: D.isFieldTouched, isFieldsTouched: D.isFieldsTouched });
})({ changedValues: U, allValues: R, listenChangeFields: L, listenChangeFieldsFunc: S, onValuesChange: d, code: e }), children: [u(zt, { ...h, form: D, code: e, fields: b, cols: I, rowHeight: v, itemMargin: [j, W] }), w == null ? void 0 : w.map((U) => {
var R;
return u(Jt, { name: U.code, children: u(fn, { form: B, name: U.code, type: U.type, initialValue: U.initialValue, initialValueLanguage: (R = U.extras) == null ? void 0 : R.initialValueLanguage }) }, JSON.stringify(U.code));
return u(Jt, { name: U.code, children: u(fn, { form: D, name: U.code, type: U.type, initialValue: U.initialValue, initialValueLanguage: (R = U.extras) == null ? void 0 : R.initialValueLanguage }) }, JSON.stringify(U.code));
})] }, e);
});
var zt;
const ua = ({ $setting: e, $close: t, extras: a, code: n, primaryKey: r, ...s }) => {
const [i] = Q.useForm(), o = mn(n, r, e);
return x(() => {
const [i] = X.useForm(), o = mn(n, r, e);
return $(() => {
o && i.setFieldsValue(o);
}, [o]), u(K, { actions: T(C.Fragment, { children: [u(N, { name: "保存", type: "primary", widget: () => {
}, [o]), u(K, { actions: T(C.Fragment, { children: [u(x, { name: "保存", type: "primary", widget: () => {
const l = i.getFieldValue("__RESOURCE__"), { initDataUri: c = `/api/${n}` } = e || {};
i.validateFields(!0).then((d) => l ? p.pick(d, [l]) : d).then((d) => E.post(r ? `${c}/${r}` : `${c}`, d).msg(t)).catch(() => _.error("请先完善表单信息", { duration: 2e3 }));
} }), u(N, { name: "取消", widget: () => t(!1) })] }), extras: a, children: u(wn, { form: i, code: n, primaryKey: r, ...s }) });
} }), u(x, { name: "取消", widget: () => t(!1) })] }), extras: a, children: u(wn, { form: i, code: n, primaryKey: r, ...s }) });
}, Cn = (e, t, a, { isReplaceRouteHistory: n = !1 } = {}) => le.redirect(a, t, { replace: n }), Wt = (e, t, a, { status: { loading: n, disabled: r }, setStatus: s }) => {
const i = { loading: (o) => o === void 0 ? n : s((l) => ({ ...l, loading: o })), disabled: (o) => o === void 0 ? r : s((l) => ({ ...l, disabled: o })) };
return p.isFunction(a) ? a.call(null, { ...t, ...i }) : p.isString(a) && a ? we.exec(a, t, i) : null;
}, Ut = (e, t, a, n, r) => p.isString(a) && a ? X.getWidgetComponent(a).then(({ default: s }) => _.modal(s, { ...t, $setting: n }, r != null && r.title ? { ...r, title: p.template(r.title)(e) } : r)).catch((s) => {
}, Ut = (e, t, a, n, r) => p.isString(a) && a ? Q.getWidgetComponent(a).then(({ default: s }) => _.modal(s, { ...t, $setting: n }, r != null && r.title ? { ...r, title: p.template(r.title)(e) } : r)).catch((s) => {
_.error(a, { content: s.toString() });
}) : _.modal(a, { ...t, $setting: n }, r != null && r.title ? { ...r, title: p.template(r.title)(e) } : r), bn = (e, t, a, n, r) => _.modal(ua, { ...t, $setting: n, code: a }, r != null && r.title ? { ...r, title: p.template(r.title)(e) } : r), kn = (e, t, a, n, r) => _.modal(kt, { base62params: t, $setting: n, listCode: a }, r != null && r.title ? { ...r, title: p.template(r.title)(e) } : r), vn = ({ widget: e, widgetType: t, widgetData: a, widgetProps: n, widgetSetting: r, widgetContainerProps: s }, { onAfterClick: i, onBeforeClick: o }) => {
const l = Ue(ve), [c, d] = $({ leading: !0, trailing: !1 }), h = Z(() => {
const l = Ue(ve), [c, d] = N({ leading: !0, trailing: !1 }), h = Z(() => {
switch (t) {
case "redirect":
return p.partialRight(Cn, e, r);
@ -694,43 +697,43 @@ const ua = ({ $setting: e, $close: t, extras: a, code: n, primaryKey: r, ...s })
case "data-list":
return p.partialRight(kn, e, r, s);
default:
if (xt(e) || C.isValidElement(e)) return p.partialRight(Ut, e, r, s);
if ($t(e) || C.isValidElement(e)) return p.partialRight(Ut, e, r, s);
if (p.isFunction(e)) return p.partialRight(Wt, (r == null ? void 0 : r.code) || e, { status: c, setStatus: d });
}
return (...m) => console.error("useButton unknown widgetType", t, ...m);
}, [e, t]);
return [p.debounce((m) => (o == null || o(m), Promise.resolve(Yt(n, m, { list: l })).then((f) => h(m, { ...a, ...f })).then((f) => i == null ? void 0 : i(f)).catch(console.error)), 300, { leading: !0, trailing: !1 }), c];
}, Bt = /* @__PURE__ */ new Set(), ft = (e = [], t = 0) => {
}, Dt = /* @__PURE__ */ new Set(), ft = (e = [], t = 0) => {
const a = e[t];
if (a.length && !Bt.has(a)) {
if (a.length && !Dt.has(a)) {
const n = document.createElement("script");
n.setAttribute("src", a), n.setAttribute("data-namespace", a), e.length > t + 1 && (n.onload = () => {
ft(e, t + 1);
}, n.onerror = () => {
ft(e, t + 1);
}), Bt.add(a), document.body.appendChild(n);
}), Dt.add(a), document.body.appendChild(n);
}
}, yt = ({ className: e, type: t, style: a = {}, ...n }) => u("span", { role: "img", className: O("ff-iconfont", e), style: a, ...n, children: u("svg", { style: { width: "1em", height: "1em", fill: "currentColor", overflow: "hidden" }, viewBox: "0 0 1024 1024", children: u("use", { xlinkHref: `#${t}` }) }) });
yt.propTypes = { className: A.string, type: A.string.isRequired, style: A.object }, yt.init = ft;
const qe = (e) => function({ className: t, children: a, name: n, icon: r, type: s = "default", iconPosition: i = "start", noAuthType: o, onAfterClick: l, onBeforeClick: c, data: d, loading: h, disabled: m, tooltip: f, popConfirm: y, widget: b, widgetType: w, widgetData: v, widgetProps: j, widgetSetting: W, widgetContainerProps: I, ...L }) {
const S = { type: "primary", className: O("ff-button", t), iconPosition: i };
s === "danger" ? S.danger = !0 : s === "default" && (S.type = s), e === "link" || e === "dashed" ? (S.type = e, s === "default" && (S.className = O(S.className, "ff-default"))) : e !== "circle" && e !== "round" || (S.shape = e), r && (S.icon = u(yt, { type: r }));
const [F, V] = $(!1), [B, { disabled: H, loading: U }] = vn({ widget: b, widgetType: w, widgetData: v, widgetProps: j, widgetSetting: W, widgetContainerProps: I }, { onAfterClick: l, onBeforeClick: c });
const [F, V] = N(!1), [D, { disabled: H, loading: U }] = vn({ widget: b, widgetType: w, widgetData: v, widgetProps: j, widgetSetting: W, widgetContainerProps: I }, { onAfterClick: l, onBeforeClick: c });
return u(Fa, { okText: "确定", cancelText: "取消", ...y || {}, disabled: H || m, open: F, onOpenChange: (R) => {
if (!R) return V(R);
y ? V(R) : B(d);
y ? V(R) : D(d);
}, onConfirm: () => {
B(d);
D(d);
}, onClick: (R) => {
R.stopPropagation();
}, children: u(Ra, { ...f, title: F ? null : f == null ? void 0 : f.title, trigger: ["hover", "click"], children: u(lt, { loading: U || h, disabled: H || m, ...S, ...L, children: a || n }) }) });
}, N = qe("default"), Sn = qe("link"), Nn = qe("circle"), $n = qe("round"), Pn = qe("dashed"), Dt = ({ data: e, widget: t, widgetType: a = "fsdpf-component", children: n, widgetData: r, widgetProps: s, widgetSetting: i, widgetContainerProps: o }) => {
const l = Ue(ve), [c, d] = $(!1), [h, m] = $("hover"), [f, y] = $({}), [b, w] = $(), { placement: v, align: j, arrow: W = { pointAtCenter: !0 }, getPopupContainer: I, ...L } = o || {};
x(() => {
a == "grid-layout-form" ? w(C.createElement(ua, { ...r, $setting: i, code: t })) : a == "data-list" ? w(C.createElement(kt, { base62params: e, $setting: i, listCode: t })) : p.isString(t) ? X.getWidgetComponent(t).then(({ default: V }) => {
}, x = qe("default"), Sn = qe("link"), xn = qe("circle"), Nn = qe("round"), Pn = qe("dashed"), Bt = ({ data: e, widget: t, widgetType: a = "fsdpf-component", children: n, widgetData: r, widgetProps: s, widgetSetting: i, widgetContainerProps: o }) => {
const l = Ue(ve), [c, d] = N(!1), [h, m] = N("hover"), [f, y] = N({}), [b, w] = N(), { placement: v, align: j, arrow: W = { pointAtCenter: !0 }, getPopupContainer: I, ...L } = o || {};
$(() => {
a == "grid-layout-form" ? w(C.createElement(ua, { ...r, $setting: i, code: t })) : a == "data-list" ? w(C.createElement(kt, { base62params: e, $setting: i, listCode: t })) : p.isString(t) ? Q.getWidgetComponent(t).then(({ default: V }) => {
w(C.createElement(V, { ...r, $setting: i }));
}).catch((V) => w(V.toString())) : xt(t) ? w(C.createElement(t, { ...r, $setting: i })) : C.isValidElement(t) && w(C.cloneElement(t, { ...r, $setting: i }));
}, [t, a, r]), x(() => {
}).catch((V) => w(V.toString())) : $t(t) ? w(C.createElement(t, { ...r, $setting: i })) : C.isValidElement(t) && w(C.cloneElement(t, { ...r, $setting: i }));
}, [t, a, r]), $(() => {
Promise.resolve(Yt(s, e, { list: l })).then(y);
}, [s, e]);
const S = (V) => {
@ -738,25 +741,25 @@ const qe = (e) => function({ className: t, children: a, name: n, icon: r, type:
}, F = (V) => {
d(!0), m("click");
};
return u(Oa, { zIndex: 1080, placement: v, onPopupClick: F, onClick: F, open: c, align: j, arrow: W, trigger: h, getPopupContainer: I, content: u(xn, { ...L, children: b && C.cloneElement(b, { ...f, $close: () => S(!1) }) }), children: n, onOpenChange: S });
}, xn = ({ title: e, className: t, children: a, width: n, height: r, ...s }) => {
const [i, o] = $({}), l = ce((h, m) => o((f) => ({ ...f, [h]: m })), []), c = ce((h) => o((m) => ({ ...m, [h]: void 0 })), []), d = e ? C.createElement("div", { className: "ff-popup-title" }, e) : i == null ? void 0 : i.title;
return u(Be.Provider, { value: { ele: i, mount: l, unmount: c }, children: T("div", { className: O("ff-popup ff-popover", t), style: { width: n, height: r }, ...s, children: [T("div", { className: "ff-popup-header", children: [d, i == null ? void 0 : i["sub-title"]] }), a, T("div", { className: "ff-popup-footer", children: [i == null ? void 0 : i.extras, i == null ? void 0 : i.actions] })] }) });
return u(Oa, { zIndex: 1080, placement: v, onPopupClick: F, onClick: F, open: c, align: j, arrow: W, trigger: h, getPopupContainer: I, content: u($n, { ...L, children: b && C.cloneElement(b, { ...f, $close: () => S(!1) }) }), children: n, onOpenChange: S });
}, $n = ({ title: e, className: t, children: a, width: n, height: r, ...s }) => {
const [i, o] = N({}), l = ce((h, m) => o((f) => ({ ...f, [h]: m })), []), c = ce((h) => o((m) => ({ ...m, [h]: void 0 })), []), d = e ? C.createElement("div", { className: "ff-popup-title" }, e) : i == null ? void 0 : i.title;
return u(De.Provider, { value: { ele: i, mount: l, unmount: c }, children: T("div", { className: O("ff-popup ff-popover", t), style: { width: n, height: r }, ...s, children: [T("div", { className: "ff-popup-header", children: [d, i == null ? void 0 : i["sub-title"]] }), a, T("div", { className: "ff-popup-footer", children: [i == null ? void 0 : i.extras, i == null ? void 0 : i.actions] })] }) });
};
Dt.propTypes = { widgetType: A.oneOf(["fsdpf-component", "grid-layout-form", "data-list"]) }, N.propTypes = { type: A.oneOf(["primary", "default", "danger", ""]), name: A.string, icon: A.string, iconPosition: A.oneOf(["start", "end"]), data: A.any, widget: A.any, widgetType: A.oneOf(["destroy", "redirect", "func", "fsdpf-component", "grid-layout-form", "grid-layout", "data-list"]), widgetData: A.object, widgetProps: A.object, widgetSetting: A.object, widgetContainerProps: A.object }, N.Link = Sn, N.Link.defaultProps = N.defaultProps, N.Link.propTypes = N.propTypes, N.Circle = Nn, N.Circle.defaultProps = N.defaultProps, N.Circle.propTypes = N.propTypes, N.Round = $n, N.Round.defaultProps = N.defaultProps, N.Round.propTypes = N.propTypes, N.Dashed = Pn, N.Dashed.defaultProps = N.defaultProps, N.Dashed.propTypes = N.propTypes, N.Popover = Dt;
Bt.propTypes = { widgetType: A.oneOf(["fsdpf-component", "grid-layout-form", "data-list"]) }, x.propTypes = { type: A.oneOf(["primary", "default", "danger", ""]), name: A.string, icon: A.string, iconPosition: A.oneOf(["start", "end"]), data: A.any, widget: A.any, widgetType: A.oneOf(["destroy", "redirect", "func", "fsdpf-component", "grid-layout-form", "grid-layout", "data-list"]), widgetData: A.object, widgetProps: A.object, widgetSetting: A.object, widgetContainerProps: A.object }, x.Link = Sn, x.Link.defaultProps = x.defaultProps, x.Link.propTypes = x.propTypes, x.Circle = xn, x.Circle.defaultProps = x.defaultProps, x.Circle.propTypes = x.propTypes, x.Round = Nn, x.Round.defaultProps = x.defaultProps, x.Round.propTypes = x.propTypes, x.Dashed = Pn, x.Dashed.defaultProps = x.defaultProps, x.Dashed.propTypes = x.propTypes, x.Popover = Bt;
const Tn = ({ fields: e, formProps: t, $close: a }) => {
const [n] = Q.useForm(), r = Z(() => [{ name: "__PROPS__", value: t }], [t]);
return u(K, { actions: T(C.Fragment, { children: [u(N, { name: "取消", widget: () => a(!1) }), u(N, { name: "确定", type: "primary", widget: () => n.validateFields(!0).then(a) })] }), children: u(Q, { fields: r, form: n, className: "ff-modal-form", children: e == null ? void 0 : e.map(({ code: s, ...i }) => u(yn, { code: s, ...i }, s)) }) });
}, En = ({ className: e, $close: t, children: a, title: n, subTitle: r, actions: s, extras: i, zIndex: o, ...l }) => T(Ba, { ...l, prefixCls: "ff-drawer", className: O("ff-popup", e), maskMotion: { motionAppear: !0, motionName: "mask-motion" }, motion: (c) => ({ motionAppear: !0, motionName: `panel-motion-${c}` }), children: [T("div", { className: "ff-popup-header", children: [u("button", { "aria-label": "Close", className: "ff-popup-close", onClick: l.onClose, children: u(bt, { type: "close" }) }), n, r] }), u("div", { className: "ff-popup-body", children: a }), T("div", { className: "ff-popup-footer", children: [i, s] })] }), Fn = ({ className: e, $close: t, $event: a, children: n, title: r, subTitle: s, actions: i, extras: o, zIndex: l, placement: c, ...d }) => {
const [n] = X.useForm(), r = Z(() => [{ name: "__PROPS__", value: t }], [t]);
return u(K, { actions: T(C.Fragment, { children: [u(x, { name: "取消", widget: () => a(!1) }), u(x, { name: "确定", type: "primary", widget: () => n.validateFields(!0).then(a) })] }), children: u(X, { fields: r, form: n, className: "ff-modal-form", children: e == null ? void 0 : e.map(({ code: s, ...i }) => u(yn, { code: s, ...i }, s)) }) });
}, En = ({ className: e, $close: t, children: a, title: n, subTitle: r, actions: s, extras: i, zIndex: o, ...l }) => T(Da, { ...l, prefixCls: "ff-drawer", className: O("ff-popup", e), maskMotion: { motionAppear: !0, motionName: "mask-motion" }, motion: (c) => ({ motionAppear: !0, motionName: `panel-motion-${c}` }), children: [T("div", { className: "ff-popup-header", children: [u("button", { "aria-label": "Close", className: "ff-popup-close", onClick: l.onClose, children: u(bt, { type: "close" }) }), n, r] }), u("div", { className: "ff-popup-body", children: a }), T("div", { className: "ff-popup-footer", children: [i, s] })] }), Fn = ({ className: e, $close: t, $event: a, children: n, title: r, subTitle: s, actions: i, extras: o, zIndex: l, placement: c, ...d }) => {
const h = (a == null ? void 0 : a.pageX) === void 0 ? { animation: null, maskAnimation: null, mousePosition: { x: null, y: null } } : { animation: "zoom", maskAnimation: "fade", mousePosition: { x: a == null ? void 0 : a.pageX, y: a == null ? void 0 : a.pageY } };
return u(Da, { ...d, ...h, prefixCls: "ff-modal", modalRender: () => T("div", { className: O("ff-modal-content ff-popup", e), children: [T("div", { className: "ff-popup-header", children: [u("button", { "aria-label": "Close", className: "ff-popup-close", onClick: d.onClose, children: u(bt, { type: "close" }) }), r, s] }), u("div", { className: "ff-popup-body", children: n }), T("div", { className: "ff-popup-footer", children: [o, i] })] }) });
return u(Ba, { ...d, ...h, prefixCls: "ff-modal", modalRender: () => T("div", { className: O("ff-modal-content ff-popup", e), children: [T("div", { className: "ff-popup-header", children: [u("button", { "aria-label": "Close", className: "ff-popup-close", onClick: d.onClose, children: u(bt, { type: "close" }) }), r, s] }), u("div", { className: "ff-popup-body", children: n }), T("div", { className: "ff-popup-footer", children: [o, i] })] }) });
}, ga = ({ placement: e, $close: t, $event: a, children: n, title: r, ...s }) => {
const [i, o] = $({}), [l, c] = $(!0), d = ce((y, b) => o((w) => ({ ...w, [y]: b })), []), h = ce((y) => o((b) => ({ ...b, [y]: void 0 })), []);
const [i, o] = N({}), [l, c] = N(!0), d = ce((y, b) => o((w) => ({ ...w, [y]: b })), []), h = ce((y) => o((b) => ({ ...b, [y]: void 0 })), []);
let m = { ...s, className: i.rootClassName, title: i.title || r && C.createElement("div", { className: O("ff-popup-title") }, r), subTitle: i["sub-title"], actions: i.actions, extras: i.extras, children: n, $close: t, $event: a, onClose: () => c(!1) };
const f = () => {
t(!1);
};
return u(Be.Provider, { value: { ele: i, mount: d, unmount: h }, children: e && e !== "center" ? u(En, { ...m, placement: e, open: l, afterOpenChange: (y) => !y && f() }) : u(Fn, { ...m, visible: l, afterClose: f }) });
return u(De.Provider, { value: { ele: i, mount: d, unmount: h }, children: e && e !== "center" ? u(En, { ...m, placement: e, open: l, afterOpenChange: (y) => !y && f() }) : u(Fn, { ...m, visible: l, afterClose: f }) });
};
ga.propTypes = { placement: A.oneOf(["center", "left", "top", "right", "bottom"]) };
const J = () => {
@ -764,7 +767,7 @@ const J = () => {
const { offsetHeight: i } = s;
return { height: i };
}, onLeaveActive: () => ({ height: 0, opacity: 0, margin: 0 }) }, prefixCls: "ff-notification" }), [, a] = C.useReducer((s) => s + 1, 0);
x(() => {
$(() => {
J.$onClick = n, J.$queue.forEach(([s, i, o], l, c) => {
r([i, o], ...s), delete c[l];
});
@ -870,18 +873,18 @@ const re = class re {
if (g(re, ye)) return g(re, ye);
}
};
ye = new WeakMap(), Ee = new WeakMap(), P(re, ye, null), k(re, "getInstance", () => (g(re, ye) || D(re, ye, new re()), g(re, ye)));
ye = new WeakMap(), Ee = new WeakMap(), P(re, ye, null), k(re, "getInstance", () => (g(re, ye) || B(re, ye, new re()), g(re, ye)));
let Ct = re;
const X = Ct.getInstance(), Rn = C.createContext({ user: {}, initUser: () => {
const Q = Ct.getInstance(), Rn = C.createContext({ user: {}, initUser: () => {
}, initUserComplete: !1 }), On = C.createContext({ set: () => {
}, get: () => {
}, assign: () => {
}, currentRoute: () => {
} }), xt = (e) => !!(e != null && e.name) && (e.prototype instanceof C.Component || /^[A-Z]/.test(e.name)), Ln = (e, t) => {
} }), $t = (e) => !!(e != null && e.name) && (e.prototype instanceof C.Component || /^[A-Z]/.test(e.name)), Ln = (e, t) => {
if (!e || typeof window > "u") return;
let a = document.querySelector(`style[ff-style-token="${t}"]`);
return a ? (a.innerHTML = e, e) : (a = document.createElement("style"), a.setAttribute("ff-style-token", t), a.setAttribute("type", "text/css"), a.innerHTML = e, document.head.appendChild(a), e);
}, Vn = Object.freeze(Object.defineProperty({ __proto__: null, AppContext: Rn, AppGlobalParamsContext: On, cache: Kt, configure: Le, default: X, func: we, http: E, insertStyle: Ln, isReactComponent: xt, route: le }, Symbol.toStringTag, { value: "Module" })), An = (e, t, a = "children") => {
}, Vn = Object.freeze(Object.defineProperty({ __proto__: null, AppContext: Rn, AppGlobalParamsContext: On, cache: Kt, configure: Le, default: Q, func: we, http: E, insertStyle: Ln, isReactComponent: $t, route: le }, Symbol.toStringTag, { value: "Module" })), An = (e, t, a = "children") => {
if (p.isEmpty(e)) return {};
const n = p.find(e, ["value", t]);
if (!p.isEmpty(n)) return n;
@ -893,73 +896,74 @@ const X = Ct.getInstance(), Rn = C.createContext({ user: {}, initUser: () => {
return {};
};
export {
J as $,
St as A,
sr as B,
_t as $,
_a as A,
St as B,
ir as C,
Qe as D,
De as E,
Nt as F,
nr as G,
Xe as D,
or as E,
Be as F,
rr as G,
an as H,
or as I,
xt as I,
lr as J,
wn as K,
$t as L,
yn as M,
ua as N,
gn as O,
pn as P,
mn as Q,
cr as K,
wn as L,
Nt as M,
yn as N,
ua as O,
gn as P,
pn as Q,
ea as R,
hn as S,
cr as T,
yt as U,
N as V,
Ha as W,
vn as X,
K as Y,
Be as Z,
_t as _,
mn as S,
hn as T,
dr as U,
yt as V,
x as W,
Ha as X,
vn as Y,
K as Z,
De as _,
ta as a,
_ as a0,
Xn as a1,
Zn as a2,
er as a3,
X as a4,
xt as a5,
Ln as a6,
E as a7,
Kt as a8,
Le as a9,
we as aa,
le as ab,
Rn as ac,
On as ad,
An as ae,
J as a0,
_ as a1,
Qn as a2,
Zn as a3,
er as a4,
Q as a5,
$t as a6,
Ln as a7,
E as a8,
Kt as a9,
Le as aa,
we as ab,
le as ac,
Rn as ad,
On as ae,
An as af,
sa as b,
la as c,
rr as d,
oa as e,
Xa as f,
sr as d,
ia as e,
oa as f,
Yt as g,
vt as h,
aa as i,
na as j,
ra as k,
kt as l,
ve as m,
tn as n,
on as o,
Ga as p,
Qa as q,
Qa as h,
vt as i,
aa as j,
na as k,
ra as l,
kt as m,
ve as n,
tn as o,
on as p,
Ga as q,
st as r,
Ja as s,
Xa as s,
Y as t,
ia as u,
tr as v,
tr as u,
Ja as v,
ar as w,
gt as x,
Ka as y,
_a as z
nr as x,
gt as y,
Ka as z
};

2
dist/components.js vendored
View File

@ -1,4 +1,4 @@
import { a1 as s, U as p, a2 as n, a3 as t, a0 as d } from "./common/main-DwWXlZKl.js";
import { a2 as s, V as p, a3 as n, a4 as t, a1 as d } from "./common/main-RnTtq_9x.js";
export {
s as Empty,
p as Icon,

2
dist/container.js vendored
View File

@ -1,4 +1,4 @@
import { Z as o, a1 as s, a2 as p, a3 as t, _ as d, a0 as n, $ as r, Y as u } from "./common/main-DwWXlZKl.js";
import { _ as o, a2 as s, a3 as p, a4 as t, $ as d, a1 as n, a0 as r, Z as u } from "./common/main-RnTtq_9x.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-DwWXlZKl.js";
import { D as p } from "./common/main-RnTtq_9x.js";
export {
p as default
};

2
dist/data-list.js vendored
View File

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

View File

@ -1,5 +1,5 @@
import "lodash";
import { b as a } from "../common/main-DwWXlZKl.js";
import { b as a } from "../common/main-RnTtq_9x.js";
export {
a as getDefaultExpandRowKeys
};

View File

@ -1,4 +1,4 @@
import { L as s, N as r, M as u, K as o, S as t, Q as d, T as m, P as F, O as i } from "./common/main-DwWXlZKl.js";
import { M as s, O as r, N as u, L as o, T as t, S as d, U as m, Q as F, P as i } from "./common/main-RnTtq_9x.js";
export {
s as GridLayoutForm,
r as GridLayoutFormHelper,

View File

@ -1,5 +1,5 @@
import "lodash";
import { ae as a } from "../common/main-DwWXlZKl.js";
import { af as a } from "../common/main-RnTtq_9x.js";
export {
a as getOptionItemByValue
};

8
dist/grid-layout.js vendored
View File

@ -1,9 +1,9 @@
import { c as d, d as e, H as u, G as i, u as t, e as o } from "./common/main-DwWXlZKl.js";
import { c as d, d as e, H as i, G as t, e as u, f as o } from "./common/main-RnTtq_9x.js";
export {
d as GridLayout,
e as GridLayoutWidget,
u as HOOK_MARK,
i as default,
t as useField,
i as HOOK_MARK,
t as default,
u as useField,
o as useGridLayoutFields
};

View File

@ -1,4 +1,4 @@
import { a as t } from "../common/main-DwWXlZKl.js";
import { a as t } from "../common/main-RnTtq_9x.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 { F as r, E as o, I as p, B as f, C as i, J as m, A as c } from "./common/main-DwWXlZKl.js";
import { I as r, F as o, J as p, C as f, E as i, K as m, B as c } from "./common/main-RnTtq_9x.js";
import { default as E } 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 { U as a } from "./common/main-DwWXlZKl.js";
import { V as a } from "./common/main-RnTtq_9x.js";
export {
a as default
};

2
dist/index.js vendored
View File

@ -1,4 +1,4 @@
import { ac as t, ad as e, a8 as o, a9 as n, a4 as p, aa as c, a7 as r, a6 as f, a5 as l, ab as u } from "./common/main-DwWXlZKl.js";
import { ad as t, ae as e, a9 as o, aa as n, a5 as p, ab as c, a8 as r, a7 as f, a6 as l, ac as u } from "./common/main-RnTtq_9x.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-DwWXlZKl.js";
import { R as a } from "./common/main-RnTtq_9x.js";
export {
a as default
};

7
dist/utils.js vendored
View File

@ -1,7 +1,8 @@
import "lodash";
import { g as a, r as i, t as o } from "./common/main-DwWXlZKl.js";
import { g as r, r as i, t as s, u as o } from "./common/main-RnTtq_9x.js";
export {
a as getWidgetPropsData,
r as getWidgetPropsData,
i as replaceKeys,
o as toPrimitive
s as toPrimitive,
o as uuid
};

View File

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