This commit is contained in:
what 2024-12-11 17:34:45 +08:00
parent e62db84068
commit af0556244f
17 changed files with 274 additions and 274 deletions

2
dist/button.js vendored
View File

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

View File

@ -4,7 +4,7 @@ var Rt = (e) => {
}; };
var va = (e, t, a) => t in e ? ka(e, t, { enumerable: !0, configurable: !0, writable: !0, value: a }) : e[t] = a; 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), Ft = (e, t, a) => t.has(e) || Rt("Cannot " + a); var k = (e, t, a) => va(e, typeof t != "symbol" ? t + "" : t, a), Ft = (e, t, a) => t.has(e) || Rt("Cannot " + a);
var g = (e, t, a) => (Ft(e, t, "read from private field"), a ? a.call(e) : t.get(e)), $ = (e, t, a) => t.has(e) ? Rt("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, a), B = (e, t, a, n) => (Ft(e, t, "write to private field"), n ? n.call(e, a) : t.set(e, a), a); var g = (e, t, a) => (Ft(e, t, "read from private field"), a ? a.call(e) : t.get(e)), N = (e, t, a) => t.has(e) ? Rt("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, a), B = (e, t, a, n) => (Ft(e, t, "write to private field"), n ? n.call(e, a) : t.set(e, a), a);
var Ot = (e, t, a, n) => ({ var Ot = (e, t, a, n) => ({
set _(r) { set _(r) {
B(e, t, r, a); B(e, t, r, a);
@ -13,14 +13,14 @@ var Ot = (e, t, a, n) => ({
return g(e, t, n); return g(e, t, n);
} }
}); });
import { jsx as u, jsxs as R } from "react/jsx-runtime"; import { jsx as u, jsxs as F } from "react/jsx-runtime";
import C, { useEffect as E, useState as N, useCallback as le, useMemo as Q, useRef as q, useContext as Te, useId as Ge, useLayoutEffect as Sa } from "react"; import C, { useEffect as $, useState as P, useCallback as ce, useMemo as Z, useRef as q, useContext as Te, useId as Ge, useLayoutEffect as Sa } from "react";
import p from "lodash"; import p from "lodash";
import Ht from "immutability-helper"; import Ht from "immutability-helper";
import O from "classnames"; import O from "classnames";
import { Form as Ke, Input as xa, Button as lt, Breadcrumb as Pa, Tree as Na, Pagination as $a, Table as Ea, Empty as Ta, Popconfirm as Ra, Tooltip as Fa, Popover as Oa } from "antd"; import { Form as Ke, Input as xa, Button as lt, Breadcrumb as Pa, Tree as Na, Pagination as $a, Table as Ea, Empty as Ta, Popconfirm as Ra, Tooltip as Fa, Popover as Oa } from "antd";
import { useMergedState as La } from "rc-util"; import { useMergedState as La } from "rc-util";
import Y, { 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 { 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 A from "prop-types";
import * as Lt from "react-is"; import * as Lt from "react-is";
@ -29,22 +29,22 @@ import { N as Re, a as Fe, T as ct, S as Ua } from "./vender-DMK1apIA.js";
import "rc-util/lib/hooks/useMergedState"; import "rc-util/lib/hooks/useMergedState";
import Da from "rc-drawer"; import Da from "rc-drawer";
import Ba from "rc-dialog"; import Ba from "rc-dialog";
var xe, Ve, Pe, se, be, ke; var xe, Ve, Pe, ie, be, ke;
class Kt { class Kt {
constructor(t, a) { constructor(t, a) {
$(this, xe, /* @__PURE__ */ new Map()); N(this, xe, /* @__PURE__ */ new Map());
$(this, Ve, !0); N(this, Ve, !0);
$(this, Pe, []); N(this, Pe, []);
$(this, se); N(this, ie);
$(this, be, () => g(this, se)); N(this, be, () => g(this, ie));
$(this, ke, () => Promise.resolve()); N(this, ke, () => Promise.resolve());
k(this, "get", (...t) => new Promise((a, n) => { k(this, "get", (...t) => new Promise((a, n) => {
const r = JSON.stringify(t); const r = JSON.stringify(t);
if (g(this, xe).has(r)) return a(g(this, ke).call(this, g(this, se), ...t)); if (g(this, xe).has(r)) return a(g(this, ke).call(this, g(this, ie), ...t));
if (g(this, se) === void 0) g(this, Pe).push([t, a, n]), g(this, Ve) && (B(this, Ve, !1), Promise.resolve(typeof g(this, be) == "function" ? g(this, be).call(this) : g(this, be)).then((s) => B(this, se, s || null)).finally(() => { if (g(this, ie) === void 0) g(this, Pe).push([t, a, n]), g(this, Ve) && (B(this, Ve, !1), Promise.resolve(typeof g(this, be) == "function" ? g(this, be).call(this) : g(this, be)).then((s) => B(this, ie, s || null)).finally(() => {
g(this, Pe).forEach(([s, i, o]) => { g(this, Pe).forEach(([s, i, o]) => {
try { try {
const l = g(this, ke).call(this, g(this, se), ...s); const l = g(this, ke).call(this, g(this, ie), ...s);
g(this, xe).set(JSON.stringify(s), l), i(l); g(this, xe).set(JSON.stringify(s), l), i(l);
} catch (l) { } catch (l) {
o(l); o(l);
@ -52,53 +52,53 @@ class Kt {
}), g(this, Pe).length = 0; }), g(this, Pe).length = 0;
})); }));
else { else {
const s = g(this, ke).call(this, g(this, se), ...t); const s = g(this, ke).call(this, g(this, ie), ...t);
g(this, xe).set(r, s), a(s); g(this, xe).set(r, s), a(s);
} }
})); }));
B(this, ke, a), B(this, be, t); B(this, ke, a), B(this, be, t);
} }
} }
xe = new WeakMap(), Ve = new WeakMap(), Pe = new WeakMap(), se = new WeakMap(), be = new WeakMap(), ke = new WeakMap(); xe = new WeakMap(), Ve = new WeakMap(), Pe = new WeakMap(), ie = new WeakMap(), be = new WeakMap(), ke = new WeakMap();
const Zn = () => u("div", { children: "Empty" }), We = C.createContext({ ele: {}, mount: () => { const Zn = () => u("div", { children: "Empty" }), We = C.createContext({ ele: {}, mount: () => {
}, unmount: () => { }, unmount: () => {
} }), J = ({ rootClassName: e, className: t, children: a, actions: n, title: r, subTitle: s, extras: i, style: o = {} }) => { } }), K = ({ rootClassName: e, className: t, children: a, actions: n, title: r, subTitle: s, extras: i, style: o = {} }) => {
const { mount: l, unmount: d } = C.useContext(We); const { mount: l, unmount: d } = C.useContext(We);
return n && J.Action({ children: n }), r && J.Title({ children: r }), s && J.SubTitle({ children: s }), i && J.Extra({ children: i }), E(() => (l("rootClassName", e), () => d(e)), [e]), u("div", { className: O("ff-container", t), style: o, children: a }); return n && K.Action({ children: n }), r && K.Title({ children: r }), s && K.SubTitle({ children: s }), i && K.Extra({ children: i }), $(() => (l("rootClassName", e), () => d(e)), [e]), u("div", { className: O("ff-container", t), style: o, children: a });
}, Je = (e) => ({ children: t, className: a }) => { }, Je = (e) => ({ children: t, className: a }) => {
const { mount: n, unmount: r } = C.useContext(We); const { mount: n, unmount: r } = C.useContext(We);
return E(() => (n(e, C.createElement("div", { key: `ff-${e}`, className: O(`ff-popup-${e}`, a) }, t)), () => r(e)), [a, t]), null; return $(() => (n(e, C.createElement("div", { key: `ff-${e}`, className: O(`ff-popup-${e}`, a) }, t)), () => r(e)), [a, t]), null;
}; };
J.Action = Je("actions"), J.Title = Je("title"), J.SubTitle = Je("sub-title"), J.Extra = Je("extras"), J.propTypes = { className: A.string, style: A.object, title: A.any, subTitle: A.any, actions: A.any, extras: A.any }; K.Action = Je("actions"), K.Title = Je("title"), K.SubTitle = Je("sub-title"), K.Extra = Je("extras"), K.propTypes = { className: A.string, style: A.object, title: A.any, subTitle: A.any, actions: A.any, extras: A.any };
const er = () => u(J, { className: "ff-loading", children: R("div", { className: "loader", children: [R("div", { className: "square", children: [u("span", {}), u("span", {}), u("span", {})] }), R("div", { className: "square", children: [u("span", {}), u("span", {}), u("span", {})] }), R("div", { className: "square", children: [u("span", {}), u("span", {}), u("span", {})] }), R("div", { className: "square", children: [u("span", {}), u("span", {}), u("span", {})] })] }) }), tr = () => u("div", { children: "NotFound" }), _t = ({ children: e }) => { const er = () => u(K, { className: "ff-loading", children: F("div", { className: "loader", children: [F("div", { className: "square", children: [u("span", {}), u("span", {}), u("span", {})] }), F("div", { className: "square", children: [u("span", {}), u("span", {}), u("span", {})] }), F("div", { className: "square", children: [u("span", {}), u("span", {}), u("span", {})] }), F("div", { className: "square", children: [u("span", {}), u("span", {}), u("span", {})] })] }) }), tr = () => u("div", { children: "NotFound" }), _t = ({ children: e }) => {
const [t, a] = N({}), n = le((s, i) => a((o) => ({ ...o, [s]: i })), []), r = le((s) => a((i) => ({ ...i, [s]: void 0 })), []); const [t, a] = P({}), 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(We.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 }) }); return typeof (e == null ? void 0 : e.type) == "string" ? e : u(We.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 }; _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 }) => R(C.Fragment, { children: [a && u("div", { className: O("ff-notification-icon", e), children: u(bt, { type: a }) }), t] }), qa = ({}) => u(J, { children: "Confirm" }); 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 }) => F(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, Ne; var de, Ne;
const Z = class Z {
constructor() {
$(this, Ne, /* @__PURE__ */ new Map());
k(this, "init", (t) => B(this, Ne, new Map(t)));
k(this, "check", (t) => !g(this, Ne).has(t) || g(this, Ne).get(t));
if (g(Z, de)) return g(Z, de);
}
};
de = new WeakMap(), Ne = new WeakMap(), $(Z, de, null), k(Z, "getInstance", () => (g(Z, de) || B(Z, de, new Z()), g(Z, de)));
let dt = Z;
const Ha = dt.getInstance();
var ue, Ae;
const ee = class ee { const ee = class ee {
constructor() { constructor() {
$(this, Ae, null); N(this, Ne, /* @__PURE__ */ new Map());
k(this, "init", (t) => B(this, Ae, t)); k(this, "init", (t) => B(this, Ne, new Map(t)));
k(this, "get", (t, a) => p.get(g(this, Ae), t, a)); k(this, "check", (t) => !g(this, Ne).has(t) || g(this, Ne).get(t));
if (g(ee, ue)) return g(ee, ue); if (g(ee, de)) return g(ee, de);
} }
}; };
ue = new WeakMap(), Ae = new WeakMap(), $(ee, ue, null), k(ee, "getInstance", () => (g(ee, ue) || B(ee, ue, new ee()), g(ee, ue))); de = new WeakMap(), Ne = new WeakMap(), N(ee, de, null), k(ee, "getInstance", () => (g(ee, de) || B(ee, de, new ee()), g(ee, de)));
let ut = ee; let dt = ee;
const Ha = dt.getInstance();
var ue, Ae;
const te = class te {
constructor() {
N(this, Ae, null);
k(this, "init", (t) => B(this, Ae, t));
k(this, "get", (t, a) => p.get(g(this, Ae), t, a));
if (g(te, ue)) return g(te, ue);
}
};
ue = new WeakMap(), Ae = new WeakMap(), N(te, ue, null), k(te, "getInstance", () => (g(te, ue) || B(te, ue, new te()), g(te, ue)));
let ut = te;
const Oe = ut.getInstance(), At = { null2json: (e) => Object.create(), null2array: (e) => [], null2number: (e) => 0, null2bool: (e) => !1, null2string: (e) => "", null2integer: (e) => 0, null2float: (e) => 0, string2json: (e) => e ? JSON.parse(e) : "{}", string2array: (e) => e.substr(0, 1) === "[" && e.substr(-1) === "]" ? JSON.parse(e) : e.split(","), string2number: (e) => e == "" ? 0 : +e, string2integer: (e) => e == "" ? 0 : +e, string2float: (e) => e == "" ? 0 : +e, string2bool: (e) => { const Oe = ut.getInstance(), At = { null2json: (e) => Object.create(), null2array: (e) => [], null2number: (e) => 0, null2bool: (e) => !1, null2string: (e) => "", null2integer: (e) => 0, null2float: (e) => 0, string2json: (e) => e ? JSON.parse(e) : "{}", string2array: (e) => e.substr(0, 1) === "[" && e.substr(-1) === "]" ? JSON.parse(e) : e.split(","), string2number: (e) => e == "" ? 0 : +e, string2integer: (e) => e == "" ? 0 : +e, string2float: (e) => e == "" ? 0 : +e, string2bool: (e) => {
switch (`${e}`.toLowerCase()) { switch (`${e}`.toLowerCase()) {
case "0": case "0":
@ -108,7 +108,7 @@ const Oe = ut.getInstance(), At = { null2json: (e) => Object.create(), null2arra
return !1; return !1;
} }
return !!e; return !!e;
}, string2string: (e) => e, json2json: (e) => e, json2array: (e) => e ? Object.values(e) : [], json2number: (e) => Object.keys(e).length, json2integer: (e) => Object.keys(e).length, json2float: (e) => Object.keys(e).length, json2bool: (e) => Object.keys(e).length > 0, json2string: (e) => e ? JSON.stringify(e) : "", array2json: (e) => ({ ...e }), array2array: (e) => e, array2number: (e) => e.length, array2integer: (e) => e.length, array2float: (e) => e.length, array2bool: (e) => e.length > 0, array2string: (e) => JSON.stringify(e), number2json: (e) => ({}), number2array: (e) => [e], number2number: (e) => e, number2integer: (e) => e, number2float: (e) => e, number2bool: (e) => !!e, number2string: (e) => e.toString(), boolean2json: (e) => ({}), boolean2array: (e) => [], boolean2number: (e) => +e, boolean2integer: (e) => +e, boolean2float: (e) => +e, boolean2bool: (e) => e, boolean2string: (e) => e ? "true" : "false" }, G = (e, t) => { }, string2string: (e) => e, json2json: (e) => e, json2array: (e) => e ? Object.values(e) : [], json2number: (e) => Object.keys(e).length, json2integer: (e) => Object.keys(e).length, json2float: (e) => Object.keys(e).length, json2bool: (e) => Object.keys(e).length > 0, json2string: (e) => e ? JSON.stringify(e) : "", array2json: (e) => ({ ...e }), array2array: (e) => e, array2number: (e) => e.length, array2integer: (e) => e.length, array2float: (e) => e.length, array2bool: (e) => e.length > 0, array2string: (e) => JSON.stringify(e), number2json: (e) => ({}), number2array: (e) => [e], number2number: (e) => e, number2integer: (e) => e, number2float: (e) => e, number2bool: (e) => !!e, number2string: (e) => e.toString(), boolean2json: (e) => ({}), boolean2array: (e) => [], boolean2number: (e) => +e, boolean2integer: (e) => +e, boolean2float: (e) => +e, boolean2bool: (e) => e, boolean2string: (e) => e ? "true" : "false" }, Y = (e, t) => {
let a = "string"; let a = "string";
a = Array.isArray(e) ? "array" : typeof e, p.isObject(e) && (a = "json"); a = Array.isArray(e) ? "array" : typeof e, p.isObject(e) && (a = "json");
const n = `${a}2${t}`; const n = `${a}2${t}`;
@ -128,7 +128,7 @@ const Oe = ut.getInstance(), At = { null2json: (e) => Object.create(), null2arra
break; break;
case "router": case "router":
case "query": case "query":
i = oe.getPageParams(l); i = le.getPageParams(l);
break; break;
case "string": case "string":
i = l; i = l;
@ -149,7 +149,7 @@ const Oe = ut.getInstance(), At = { null2json: (e) => Object.create(), null2arra
break; break;
case "router": case "router":
case "query": case "query":
s = oe.getPageParams(o); s = le.getPageParams(o);
break; break;
case "string": case "string":
s = o; s = o;
@ -166,8 +166,8 @@ const Oe = ut.getInstance(), At = { null2json: (e) => Object.create(), null2arra
var Xe, je, Ie, Qe; var Xe, je, Ie, Qe;
const Ze = class Ze { const Ze = class Ze {
constructor(...t) { constructor(...t) {
$(this, je, []); N(this, je, []);
$(this, Ie, (t) => { N(this, Ie, (t) => {
var a; var a;
for (let n of t) Array.isArray(n[0]) ? g(this, Ie).call(this, n) : g(this, je).push(g(a = Ze, Xe).call(a, n[0], n[1])); for (let n of t) Array.isArray(n[0]) ? g(this, Ie).call(this, n) : g(this, je).push(g(a = Ze, Xe).call(a, n[0], n[1]));
}); });
@ -183,53 +183,53 @@ const Ze = class Ze {
}, t); }, t);
}); });
k(this, "toRender", (t, a, n = null) => C.createElement(g(this, Qe), { value: t, record: a }, n)); k(this, "toRender", (t, a, n = null) => C.createElement(g(this, Qe), { value: t, record: a }, n));
$(this, Qe, ({ value: t, record: a, children: n }) => { N(this, Qe, ({ value: t, record: a, children: n }) => {
const [r, s] = N(n); const [r, s] = P(n);
return xt(() => { return xt(() => {
let i = !1; let i = !1;
return s(n), this.toValue(t, a).then((o) => G(o, "string")).then((o) => !i && s(o)).catch((o) => !i && s(`${o}`)), () => i = !0; 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; }, [t, a]), r;
}); });
g(this, Ie).call(this, t); g(this, Ie).call(this, t);
} }
}; };
Xe = new WeakMap(), je = new WeakMap(), Ie = new WeakMap(), Qe = new WeakMap(), $(Ze, Xe, p.memoize((t, a) => X.getWidgetComponent(t).then((n) => { Xe = new WeakMap(), je = new WeakMap(), Ie = new WeakMap(), Qe = new WeakMap(), N(Ze, Xe, p.memoize((t, a) => Q.getWidgetComponent(t).then((n) => {
var r; var r;
return ((r = n.default) == null ? void 0 : r.call(n, a)) || ((s) => s); return ((r = n.default) == null ? void 0 : r.call(n, a)) || ((s) => s);
}), (t, a) => `${t}::${G(a, "string")}`)); }), (t, a) => `${t}::${Y(a, "string")}`));
let Ye = Ze; let Ye = Ze;
const Ja = (e, t = {}) => Q(() => e == null ? void 0 : e.map(({ widgetByJs: a, widgetByJsSetting: n, ...r }, s) => a ? { ...r, render: (i, o) => new Ye([a, n]).toRender(i, o, "-") } : r), [e, t]), nr = (e) => { const Ja = (e, t = {}) => Z(() => e == null ? void 0 : e.map(({ widgetByJs: a, widgetByJsSetting: n, ...r }, s) => a ? { ...r, render: (i, o) => new Ye([a, n]).toRender(i, o, "-") } : r), [e, t]), nr = (e) => {
const [t, a] = N({}); const [t, a] = P({});
return E(() => { return $(() => {
let n = !1; let n = !1;
return e && T.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; return e && R.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; }, [e]), t;
}, rr = (e, t = {}) => { }, rr = (e, t = {}) => {
const [a, n] = N({ dataSource: [] }); const [a, n] = P({ dataSource: [] });
return Ue(() => { return Ue(() => {
let r = !1; let r = !1;
return e && T.get(`/api/${e}/${T.encode({ page: 1, ...t })}`).then((s) => !r && n(s)), () => r = !0; return e && R.get(`/api/${e}/${R.encode({ page: 1, ...t })}`).then((s) => !r && n(s)), () => r = !0;
}, [e, t]), a; }, [e, t]), a;
}, gt = (e, t = null, a = null, n = "id") => Q(() => { }, gt = (e, t = null, a = null, n = "id") => Z(() => {
if (p.isEmpty(e) || !e.some(({ uuid: s }) => Ha.check(s))) return !1; if (p.isEmpty(e) || !e.some(({ uuid: s }) => Ha.check(s))) return !1;
if (p.isEmpty(a) || p.isEmpty(t)) return !0; if (p.isEmpty(a) || p.isEmpty(t)) return !0;
const r = t.map((s) => `${s == null ? void 0 : s[n]}`); const r = t.map((s) => `${s == null ? void 0 : s[n]}`);
return e.some(({ uuid: s }) => !s || !a.has(s) || a.get(s).some((i) => r.includes(`${i}`))); 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) => { }, [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); const r = St(), s = q(!1), i = q(e.dataSource), o = q(e.itemOperationsAccess);
return E(() => (i.current = e.dataSource, o.current = e.itemOperationsAccess, () => s.current = !1), [e.dataSource, e.itemOperationsAccess]), s.current && (e.dataSource = i.current, e.itemOperationsAccess = o.current), [e, (l = 0, d = null) => { 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, d = null) => {
var c, m; var c, m;
if (s.current = !1, l === 1) return (c = e.onReload) == null ? void 0 : c.call(e); if (s.current = !1, l === 1) return (c = e.onReload) == null ? void 0 : c.call(e);
if (l === 2) { if (l === 2) {
const h = p.get(d, "__PARENT_ID__", ""), f = p.get(d, a, p.get(d, [n, a], "")), y = p.findIndex(i.current, ["__PARENT_ID__", h]), b = p.findIndex(y > -1 ? p.get(i.current, [y, "children"]) : i.current, [a, f]); const h = p.get(d, "__PARENT_ID__", ""), f = p.get(d, a, p.get(d, [n, a], "")), y = p.findIndex(i.current, ["__PARENT_ID__", h]), b = p.findIndex(y > -1 ? p.get(i.current, [y, "children"]) : i.current, [a, f]);
if (b === -1) return (m = e.onReload) == null ? void 0 : m.call(e); if (b === -1) return (m = e.onReload) == null ? void 0 : m.call(e);
Promise.all([T.get(`/api/${t}/detail/${f}`), T.post(`/api/${t}/list-operations-access`, { ids: f })]).then(([w, v]) => { Promise.all([R.get(`/api/${t}/detail/${f}`), R.post(`/api/${t}/list-operations-access`, { ids: f })]).then(([w, v]) => {
const j = p.get(i.current, y > -1 ? [y, "children", b, "children"] : [b, "children"]); const j = p.get(i.current, y > -1 ? [y, "children", b, "children"] : [b, "children"]);
i.current = Ht(i.current, y > -1 ? { [y]: { children: { $splice: [[b, 1, { ...w, children: j }]] } } } : { $splice: [[b, 1, { ...w, children: j }]] }); i.current = Ht(i.current, y > -1 ? { [y]: { children: { $splice: [[b, 1, { ...w, children: j }]] } } } : { $splice: [[b, 1, { ...w, children: j }]] });
const z = new Map(v); const z = new Map(v);
o.current.forEach((I, L) => { o.current.forEach((I, L) => {
var S; var E;
(S = z.get(L)) != null && S.some((F) => F == f) || o.current.set(L, I.filter((F) => F !== f)); (E = z.get(L)) != null && E.some((S) => S == f) || o.current.set(L, I.filter((S) => S !== f));
}), z.forEach((I, L) => { }), z.forEach((I, L) => {
o.current.has(L) ? o.current.set(L, p.uniq([...o.current.get(L) || [], ...I])) : o.current.set(L, I); o.current.has(L) ? o.current.set(L, p.uniq([...o.current.get(L) || [], ...I])) : o.current.set(L, I);
}); });
@ -240,21 +240,21 @@ const Ja = (e, t = {}) => Q(() => e == null ? void 0 : e.map(({ widgetByJs: a, w
}]; }];
}, _a = (e, t) => { }, _a = (e, t) => {
const a = St(), n = q(t), r = q(/* @__PURE__ */ new Map()), s = q([]), i = p.throttle((l) => { const a = St(), n = q(t), r = q(/* @__PURE__ */ new Map()), s = q([]), i = p.throttle((l) => {
s.current = [], T.list(e, p.pick({ ...n.current, ...l }, ["tab", "page", "pageSize", "condition", "sider", "keyword"])).then(({ keyword: d, condition: c, total: m, tab: h, sider: f, page: y, pageSize: b, operationsAccess: w, dataSource: v }) => { s.current = [], R.list(e, p.pick({ ...n.current, ...l }, ["tab", "page", "pageSize", "condition", "sider", "keyword"])).then(({ keyword: d, condition: c, total: m, tab: h, sider: f, page: y, pageSize: b, operationsAccess: w, dataSource: v }) => {
n.current = { tab: h, condition: c, sider: f, keyword: d, total: m, pageSize: b, page: v != null && v.length ? y : 1 }, s.current = v, r.current = new Map(w), a(); n.current = { tab: h, condition: c, sider: f, keyword: d, total: m, pageSize: b, page: v != null && v.length ? y : 1 }, s.current = v, r.current = new Map(w), a();
}); });
}, 380, { leading: !1, trailing: !0 }); }, 380, { leading: !1, trailing: !0 });
xt(() => { xt(() => {
s.current = [], e && i(t); s.current = [], e && i(t);
}, [e, t]); }, [e, t]);
const o = Q(() => p.pick(n.current, ["total", "tab", "page", "pageSize", "condition", "sider", "keyword"]), [n.current]); 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, d) => i({ page: l, pageSize: d }), onPageSizeChange: (l) => i({ pageSize: l, page: 1 }), onConditionChange: (l, d) => i({ keyword: d, 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 }); return Object.assign(o, { onTabChange: (l) => i({ tab: l, page: 1 }), onPageChange: (l, d) => i({ page: l, pageSize: d }), onPageSizeChange: (l) => i({ pageSize: l, page: 1 }), onConditionChange: (l, d) => i({ keyword: d, condition: Ht(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: d, resource: c, primaryKey: m, title: h, itemGridLayout: f, $setting: y, tabs: b, isConditionFormLayout: w, isTreeSider: v, treeSiderConfig: j }) => { }, Ga = ({ className: e, itemClassName: t, classNames: a = {}, dataSource: n, isPaginate: r, isItemOperations: s, isBatchOperations: i, batchOperations: o, itemOperations: l, itemOperationsAccess: d, resource: c, primaryKey: m, title: h, itemGridLayout: f, $setting: y, tabs: b, isConditionFormLayout: w, isTreeSider: v, treeSiderConfig: j }) => {
const { getBase62params: z, onClickCallback: I } = Te(we), { total: L, page: S, pageSize: F } = (z == null ? void 0 : z()) || {}, V = le((W, U, D) => u(Ya, { className: O("ff-data-list-framework-item", t), operations: s && U ? l == null ? void 0 : l.filter((x) => !(m && x.uuid && d.has(x.uuid)) || d.get(x.uuid).includes(U == null ? void 0 : U[m])) : [], data: c ? { [c]: U } : U, children: W, onClickCallback: I }), [c, m, s, I, l, d]); const { getBase62params: z, onClickCallback: I } = Te(we), { total: L, page: E, pageSize: S } = (z == null ? void 0 : z()) || {}, V = ce((U, D, W) => u(Ya, { className: O("ff-data-list-framework-item", t), operations: s && D ? l == null ? void 0 : l.filter((T) => !(m && T.uuid && d.has(T.uuid)) || d.get(T.uuid).includes(D == null ? void 0 : D[m])) : [], data: c ? { [c]: D } : D, children: U, onClickCallback: I }), [c, m, s, I, l, d]);
return R("div", { className: O("ff-data-list-framework", e), children: [u(na, { className: a == null ? void 0 : a.sider, isTreeSider: v, ...j }), R("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: h, className: a == null ? void 0 : a.toolbar, tabs: b }), u(on, { ...f, className: a == null ? void 0 : a.content, style: { "--col-num": (y == null ? void 0 : y.colNum) || 1 }, primaryKey: m, itemRender: V, dataSource: n }), u(ra, { className: a == null ? void 0 : a.footer, isPaginate: r, isOperations: i, operations: o, total: L, page: S, pageSize: F })] })] }); return F("div", { className: O("ff-data-list-framework", e), children: [u(na, { className: a == null ? void 0 : a.sider, isTreeSider: v, ...j }), F("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: h, className: a == null ? void 0 : a.toolbar, tabs: b }), u(on, { ...f, className: a == null ? void 0 : a.content, style: { "--col-num": (y == null ? void 0 : y.colNum) || 1 }, primaryKey: m, itemRender: V, dataSource: n }), u(ra, { className: a == null ? void 0 : a.footer, isPaginate: r, isOperations: i, operations: o, total: L, page: E, pageSize: S })] })] });
}, Ya = ({ className: e, operations: t, children: a, data: n, onClickCallback: r }) => R("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(P.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 || Ge()) }, (s == null ? void 0 : s.uuid) || Ge())) })] }), Xa = ({ listCode: e, className: t, classNames: a = {}, itemClassName: n, dataSource: r, columns: s, isItemOperations: i, isBatchOperations: o, batchOperations: l, itemOperations: d, itemOperationsAccess: c, resource: m, primaryKey: h, title: f, tabs: y, isPaginate: b, isTreeSider: w, treeSiderConfig: v, isConditionFormLayout: j, ...z }) => { }, Ya = ({ className: e, operations: t, children: a, data: n, onClickCallback: r }) => F("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, confirm: s.confirm, onAfterClick: (i) => i !== !1 && (r == null ? void 0 : r(s.isRefresh, n)) }, s.uuid || Ge()) }, (s == null ? void 0 : s.uuid) || Ge())) })] }), Xa = ({ listCode: e, className: t, classNames: a = {}, itemClassName: n, dataSource: r, columns: s, isItemOperations: i, isBatchOperations: o, batchOperations: l, itemOperations: d, itemOperationsAccess: c, resource: m, primaryKey: h, title: f, tabs: y, isPaginate: b, isTreeSider: w, treeSiderConfig: v, isConditionFormLayout: j, ...z }) => {
const { getBase62params: I, onClickCallback: L } = Te(we), { total: S, page: F, pageSize: V } = (I == null ? void 0 : I()) || {}, W = gt(d, r, c, h); const { getBase62params: I, onClickCallback: L } = Te(we), { total: E, page: S, pageSize: V } = (I == null ? void 0 : I()) || {}, U = gt(d, r, c, h);
return R("div", { className: O("ff-data-table-framework", t), children: [u(na, { className: a == null ? void 0 : a.sider, isTreeSider: w, ...v }), R("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 }), u(tn, { ...z, primaryKey: h, className: "ff-data-table-content", columns: s, dataSource: r, operationRender: W ? (U) => u("div", { className: "ff-data-table-actions", children: d == null ? void 0 : d.reduce((D, x, ce) => [...D, u(P.Link, { size: "small", uuid: x.uuid, type: x.type, name: x.name, widget: x.widget, widgetType: x.widgetType, widgetProps: x.widgetProps, widgetData: x.widgetData, widgetSetting: x.widgetSetting, widgetContainerProps: x.widgetContainerSetting, data: U, onAfterClick: (re) => re !== !1 && (L == null ? void 0 : L(x.isRefresh, U)) }, x.uuid || ce)], []) }) : null }), u(ra, { isPaginate: b, isOperations: o, operations: l, total: S, page: F, pageSize: V })] })] }); return F("div", { className: O("ff-data-table-framework", t), children: [u(na, { className: a == null ? void 0 : a.sider, isTreeSider: w, ...v }), F("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 }), u(tn, { ...z, primaryKey: h, className: "ff-data-table-content", columns: s, dataSource: r, operationRender: U ? (D) => u("div", { className: "ff-data-table-actions", children: d == null ? void 0 : d.reduce((W, T, H) => [...W, u(x.Link, { size: "small", uuid: T.uuid, type: T.type, name: T.name, widget: T.widget, widgetType: T.widgetType, widgetProps: T.widgetProps, widgetData: T.widgetData, widgetSetting: T.widgetSetting, widgetContainerProps: T.widgetContainerSetting, data: D, confirm: T.confirm, onAfterClick: (se) => se !== !1 && (L == null ? void 0 : L(T.isRefresh, D)) }, T.uuid || H)], []) }) : null }), u(ra, { isPaginate: b, isOperations: o, operations: l, total: E, page: S, pageSize: V })] })] });
}, we = C.createContext({ listCode: "", getBase62params: (e, t) => { }, we = C.createContext({ listCode: "", getBase62params: (e, t) => {
}, onReload: () => { }, onReload: () => {
}, onClickCallback: () => { }, onClickCallback: () => {
@ -265,60 +265,60 @@ const Ja = (e, t = {}) => Q(() => e == null ? void 0 : e.map(({ widgetByJs: a, w
}, onPageChange: () => { }, onPageChange: () => {
}, onPageSizeChange: () => { }, onPageSizeChange: () => {
} }), Qa = ({ isItemGridLayout: e, theme: t, themeProps: a, onClickCallback: n, onReload: r, listCode: s, total: i = 0, page: o = 0, onPageChange: l, pageSize: d = 30, onPageSizeChange: c, tab: m, onTabChange: h, keyword: f, onKeywordChange: y, condition: b, onConditionChange: w, sider: v, onSiderChange: j, ...z }) => { } }), Qa = ({ isItemGridLayout: e, theme: t, themeProps: a, onClickCallback: n, onReload: r, listCode: s, total: i = 0, page: o = 0, onPageChange: l, pageSize: d = 30, onPageSizeChange: c, tab: m, onTabChange: h, keyword: f, onKeywordChange: y, condition: b, onConditionChange: w, sider: v, onSiderChange: j, ...z }) => {
const [I, L] = N(); const [I, L] = P();
return E(() => { return $(() => {
t ? X.getWidgetComponent(t).then((S) => { t ? Q.getWidgetComponent(t).then((E) => {
if (!S) throw `${t} not found`; if (!E) throw `${t} not found`;
return S; return E;
}).catch((S) => ({ default: () => `${S}` })).then((S) => L(C.createElement(S.default, { ...z, $setting: a }))) : L(u(e ? Ga : Xa, { ...z, $setting: a })); }).catch((E) => ({ default: () => `${E}` })).then((E) => L(C.createElement(E.default, { ...z, $setting: a }))) : L(u(e ? Ga : Xa, { ...z, $setting: a }));
}, [t, a]), u(we.Provider, { value: { listCode: s, onClickCallback: n, onReload: r, getBase62params: (S, F) => { }, [t, a]), u(we.Provider, { value: { listCode: s, onClickCallback: n, onReload: r, getBase62params: (E, S) => {
const V = { tab: m, page: o, pageSize: d, keyword: f, sider: v, condition: b, total: i }; const V = { tab: m, page: o, pageSize: d, keyword: f, sider: v, condition: b, total: i };
return S && S != "init" ? V[S] ?? F : V; return E && E != "init" ? V[E] ?? S : V;
}, onPageChange: l, onPageSizeChange: c, onTabChange: h, onSiderChange: j, onKeywordChange: y, onConditionChange: w }, children: I && C.cloneElement(I, z) }); }, onPageChange: l, onPageSizeChange: c, onTabChange: h, onSiderChange: j, onKeywordChange: y, onConditionChange: w }, children: I && C.cloneElement(I, z) });
}; };
var ge, ie, ve, et; var ge, oe, ve, et;
const te = class te { const ae = class ae {
constructor() { constructor() {
$(this, ie, null); N(this, oe, null);
$(this, ve, /* @__PURE__ */ new Map()); N(this, ve, /* @__PURE__ */ new Map());
$(this, et, () => { N(this, et, () => {
if (g(this, ie)) return g(this, ie).port.postMessage({ command: "status", data: [] }); if (g(this, oe)) return g(this, oe).port.postMessage({ command: "status", data: [] });
B(this, ie, new SharedWorker(new URL("/ff-worker/res-ws.js", self.location))), g(this, ie).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; var a, n;
(a = t.data) != null && a.uuid ? g(this, ve).forEach((r, s) => { (a = t.data) != null && a.uuid ? g(this, ve).forEach((r, s) => {
var i; var i;
(r == "*" || (i = r == null ? void 0 : r.includes) != null && i.call(r, t.data.uuid)) && s(t.data); (r == "*" || (i = r == null ? void 0 : r.includes) != null && i.call(r, t.data.uuid)) && s(t.data);
}) : ((n = t.data) == null ? void 0 : n.readyState) == WebSocket.CLOSED && T.get("/api/user-api-token").then(({ token: r, expire_at: s }) => { }) : ((n = t.data) == null ? void 0 : n.readyState) == WebSocket.CLOSED && R.get("/api/user-api-token").then(({ token: r, expire_at: s }) => {
g(this, ie).port.postMessage({ command: "initWs", data: [`ws${p.trimStart(T.appUrl, "http")}api/user-resource-status-ws?token=${r}`] }); g(this, oe).port.postMessage({ command: "initWs", data: [`ws${p.trimStart(R.appUrl, "http")}api/user-resource-status-ws?token=${r}`] });
}); });
}, g(this, ie).port.postMessage({ command: "status", data: [] }); }, g(this, oe).port.postMessage({ command: "status", data: [] });
}); });
k(this, "subscribe", (t, a = []) => (a ? Array.isArray(a) && a.length == 0 ? a = "*" : Array.isArray(a) || (a = [a].flat()) : a = "*", g(this, ve).set(t, a), g(this, ve).size == 1 && g(this, et).call(this), () => this.unsubscribe(t))); k(this, "subscribe", (t, a = []) => (a ? Array.isArray(a) && a.length == 0 ? a = "*" : Array.isArray(a) || (a = [a].flat()) : a = "*", g(this, ve).set(t, a), g(this, ve).size == 1 && g(this, et).call(this), () => this.unsubscribe(t)));
k(this, "unsubscribe", (t) => g(this, ve).delete(t)); k(this, "unsubscribe", (t) => g(this, ve).delete(t));
if (g(te, ge)) return g(te, ge); if (g(ae, ge)) return g(ae, ge);
} }
}; };
ge = new WeakMap(), ie = new WeakMap(), ve = new WeakMap(), et = new WeakMap(), $(te, ge, null), k(te, "getInstance", () => (g(te, ge) || B(te, ge, new te()), g(te, ge))); ge = new WeakMap(), oe = new WeakMap(), ve = new WeakMap(), et = new WeakMap(), N(ae, ge, null), k(ae, "getInstance", () => (g(ae, ge) || B(ae, ge, new ae()), g(ae, ge)));
let pt = te; 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 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: d, batchOperations: c = [], itemOperations: m = [], columns: h = [], themeConfig: f, theme: y, isConditionFormLayout: b = !1, isTreeSider: w, treeSiderConfig: v, isItemGridLayout: j, itemGridLayout: z, title: I, isPaginate: L, tabs: S }, F] = N({ isItemGridLayout: !1, itemGridLayout: {} }), V = _a(e, t), [{ dataSource: W, itemOperationsAccess: U, condition: D, tab: x, keyword: ce, page: re, total: at, pageSize: Be, sider: nt, onConditionChange: Et, onTabChange: pa, onKeywordChange: ma, onPageChange: ha, onPageSizeChange: fa, onSiderChange: ya, onReload: rt }, Tt] = Ka(V, e, d, l), wa = gt(m, W, U, d), Ca = gt(c); const [{ resource: l, primaryKey: d, batchOperations: c = [], itemOperations: m = [], columns: h = [], themeConfig: f, theme: y, isConditionFormLayout: b = !1, isTreeSider: w, treeSiderConfig: v, isItemGridLayout: j, itemGridLayout: z, title: I, isPaginate: L, tabs: E }, S] = P({ isItemGridLayout: !1, itemGridLayout: {} }), V = _a(e, t), [{ dataSource: U, itemOperationsAccess: D, condition: W, tab: T, keyword: H, page: se, total: at, pageSize: Be, sider: nt, onConditionChange: Et, onTabChange: pa, onKeywordChange: ma, onPageChange: ha, onPageSizeChange: fa, onSiderChange: ya, onReload: rt }, Tt] = Ka(V, e, d, l), wa = gt(m, U, D, d), Ca = gt(c);
return E(() => { return $(() => {
let qe = null; let qe = null;
return e && T.get(`/api/_/${e}`).resp(({ data: He, res: ba }) => { return e && R.get(`/api/_/${e}`).resp(({ data: He, res: ba }) => {
He != null && He.isDynamicRefresh && (qe = ea.subscribe(() => rt(), ba)), F(He); He != null && He.isDynamicRefresh && (qe = ea.subscribe(() => rt(), ba)), S(He);
}).catch(() => F({})), () => qe == null ? void 0 : qe(); }).catch(() => S({})), () => qe == null ? void 0 : qe();
}, [e]), C.useImperativeHandle(o, () => ({ onReload: rt, onClickCallback: Tt })), u(Qa, { listCode: e, title: I, itemClassName: n, classNames: i, resource: l, primaryKey: d, theme: r || y, themeProps: s || f, isTreeSider: w, treeSiderConfig: v, isPaginate: L, tabs: S, isItemOperations: wa, isBatchOperations: Ca, batchOperations: c, itemOperations: m, isItemGridLayout: j, columns: h, itemGridLayout: z, isConditionFormLayout: b, itemOperationsAccess: U, dataSource: W, onConditionChange: Et, onTabChange: pa, onKeywordChange: ma, onPageChange: ha, onPageSizeChange: fa, onSiderChange: ya, condition: D, tab: x, keyword: ce, page: re, total: at, pageSize: Be, sider: nt, className: O("ff-data-list-helper", a), onReload: rt, onClickCallback: Tt }); }, [e]), C.useImperativeHandle(o, () => ({ onReload: rt, onClickCallback: Tt })), u(Qa, { listCode: e, title: I, itemClassName: n, classNames: i, resource: l, primaryKey: d, theme: r || y, themeProps: s || f, isTreeSider: w, treeSiderConfig: v, isPaginate: L, tabs: E, isItemOperations: wa, isBatchOperations: Ca, batchOperations: c, itemOperations: m, isItemGridLayout: j, columns: h, itemGridLayout: z, isConditionFormLayout: b, itemOperationsAccess: D, dataSource: U, onConditionChange: Et, onTabChange: pa, onKeywordChange: ma, onPageChange: ha, onPageSizeChange: fa, onSiderChange: ya, condition: W, tab: T, keyword: H, page: se, total: at, pageSize: Be, sider: nt, className: O("ff-data-list-helper", a), onReload: rt, onClickCallback: Tt });
}), ta = (e, t, a, n, r = {}, s = 0) => { }), 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" }; 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; 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 }) => { }, jt = (e, t, a, n) => `${e || 0}px ${t || 0}px ${a || 0}px ${n || 0}px`, vt = ({ className: e, isConditionFormLayout: t }) => {
var m, h; var m, h;
const [a, n] = N({}), { listCode: r, onKeywordChange: s, onConditionChange: i, getBase62params: o } = C.useContext(we), { keyword: l, condition: d } = (o == null ? void 0 : o()) || {}, [c] = Ke.useForm(); const [a, n] = P({}), { listCode: r, onKeywordChange: s, onConditionChange: i, getBase62params: o } = C.useContext(we), { keyword: l, condition: d } = (o == null ? void 0 : o()) || {}, [c] = Ke.useForm();
return E(() => { return $(() => {
r && t && T.get(`/api/_/${r}/list-condition-form-layout`).then(({ resource: f, marginX: y, marginY: b, rowHeight: w, cols: v, fields: j }) => { r && t && R.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 }); n({ resource: f, itemMargin: [y, b], rowHeight: w, cols: v, fields: j });
}).catch(() => n({})); }).catch(() => n({}));
}, [r, t]), E(() => { }, [r, t]), $(() => {
c.setFieldsValue({ keyword: l, ...d }); c.setFieldsValue({ keyword: l, ...d });
}, [JSON.stringify([l, d])]), u("div", { className: O("ff-data-list-filter", e), children: u(Ke, { form: c, layout: "vertical", autoComplete: "off", onFinish: ((m = a.fields) == null ? void 0 : m.length) > 1 ? (f) => i({ [a.resource]: f[a.resource] }, f.keyword) : () => { }, [JSON.stringify([l, d])]), u("div", { className: O("ff-data-list-filter", e), children: u(Ke, { form: c, layout: "vertical", autoComplete: "off", onFinish: ((m = a.fields) == null ? void 0 : m.length) > 1 ? (f) => i({ [a.resource]: f[a.resource] }, f.keyword) : () => {
}, onValuesChange: (f) => { }, onValuesChange: (f) => {
@ -328,20 +328,20 @@ const ea = pt.getInstance(), kt = C.forwardRef(({ listCode: e, base62params: t,
c.setFieldsValue({ keyword: f, ...y }); c.setFieldsValue({ keyword: f, ...y });
} }) }) : u("div", { className: "ff-data-list-filter-default-form ff-grid-layout-form", children: u("div", { className: "grid-layout-item", style: ta(20, 0, 5, 2), children: u(Ke.Item, { name: ["keyword"], children: u(xa.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(Ke.Item, { name: ["keyword"], children: u(xa.Search, { allowClear: !0, enterButton: "搜索", placeholder: "多关键字 | 分割", onSearch: (f) => s(f) }) }) }) }) }) });
}, Za = ({ cols: e, fields: t, onReset: a }) => { }, Za = ({ cols: e, fields: t, onReset: a }) => {
const [n, r] = N(!1), s = Q(() => t == null ? void 0 : t.toReversed().some((i) => i.y > 1 || i.x + i.w >= e - 5), [e, t]); const [n, r] = P(!1), s = Z(() => t == null ? void 0 : t.toReversed().some((i) => i.y > 1 || i.x + i.w >= e - 5), [e, t]);
return R(Ke.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(P.Link, { className: "ff-data-list-filter-expanded-button", widget: () => r((i) => !i), type: "primary", name: n ? "关闭" : "展开", icon: n ? "icon-up" : "icon-down", iconPosition: "end" })] }); return F(Ke.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" } } }]; 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 }) => { const aa = ({ className: e, title: t, tabs: a }) => {
const { getBase62params: n, onTabChange: r, onReload: s } = Te(we), { tab: i } = (n == null ? void 0 : n()) || {}, [o, l] = La((a == null ? void 0 : a[0].value) ?? (a == null ? void 0 : a[0].code), { value: i, onChange: r }); const { getBase62params: n, onTabChange: r, onReload: s } = Te(we), { tab: i } = (n == null ? void 0 : n()) || {}, [o, l] = La((a == null ? void 0 : a[0].value) ?? (a == null ? void 0 : a[0].code), { value: i, onChange: r });
return R("div", { className: O("ff-data-list-toolbar", e), children: [u("div", { className: "ff-data-list-title", children: t }), u(Pa, { className: "ff-data-list-tabs", itemRender: ({ label: d, code: c, value: m }) => u("span", { onClick: () => l(m ?? c), className: O("ff-data-list-tab", { active: (m ?? c) == o }), children: d }), items: a }), R("div", { className: "ff-data-list-actions", children: [u(P.Link, { icon: "icon-reload", widget: () => s() }), u(P.Link, { icon: "icon-setting" })] })] }); return F("div", { className: O("ff-data-list-toolbar", e), children: [u("div", { className: "ff-data-list-title", children: t }), u(Pa, { className: "ff-data-list-tabs", itemRender: ({ label: d, code: c, value: m }) => u("span", { onClick: () => l(m ?? c), className: O("ff-data-list-tab", { active: (m ?? c) == o }), children: d }), items: a }), F("div", { className: "ff-data-list-actions", children: [u(x.Link, { icon: "icon-reload", widget: () => s() }), 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(Na.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 }) => { }, 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(Na.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: d } = C.useContext(we); const { onPageChange: o, onPageSizeChange: l, onClickCallback: d } = C.useContext(we);
return a && !p.isEmpty(t) || n ? R("div", { className: O("ff-data-list-footer", e), children: [u("div", { className: "ff-data-list-actions", children: t == null ? void 0 : t.map((c, m) => u(P, { uuid: c.uuid, type: c.type, name: c.name, widget: c.widget, widgetType: c.widgetType, widgetProps: c.widgetProps, widgetData: c.widgetData, widgetSetting: c.widgetSetting, widgetContainerProps: c.widgetContainerSetting, onAfterClick: (h) => h !== !1 && (d == null ? void 0 : d(c.isRefresh, null)) }, c.uuid || m)) }), n && u($a, { size: "small", total: r, pageSize: i, showSizeChanger: !1, showTotal: (c) => `${s} 页 / 总共 ${c}`, onChange: o, onShowSizeChange: l })] }) : null; return a && !p.isEmpty(t) || n ? F("div", { className: O("ff-data-list-footer", e), children: [u("div", { className: "ff-data-list-actions", children: t == null ? void 0 : t.map((c, m) => u(x, { uuid: c.uuid, type: c.type, name: c.name, widget: c.widget, widgetType: c.widgetType, widgetProps: c.widgetProps, widgetData: c.widgetData, widgetSetting: c.widgetSetting, widgetContainerProps: c.widgetContainerSetting, onAfterClick: (h) => h !== !1 && (d == null ? void 0 : d(c.isRefresh, null)) }, c.uuid || m)) }), n && u($a, { size: "small", total: r, pageSize: i, showSizeChanger: !1, showTotal: (c) => `${s} 页 / 总共 ${c}`, 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 }) => { }, 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 }) => {
Ge(); Ge();
const o = q(null), l = q(null), [d, c] = N([]), [m, h] = N({ width: 0, height: 0 }); const o = q(null), l = q(null), [d, c] = P([]), [m, h] = P({ width: 0, height: 0 });
E(() => { $(() => {
c(sa(n, t)); c(sa(n, t));
}, [n, t]), Sa(() => { }, [n, t]), Sa(() => {
const y = new ResizeObserver(() => { const y = new ResizeObserver(() => {
@ -355,82 +355,82 @@ const aa = ({ className: e, title: t, tabs: a }) => {
const f = Ja(a); const f = Ja(a);
return u("div", { ref: l, className: O("ff-data-list-table", e), children: m.height ? u(Ea, { ...i, ref: o, rowKey: (y) => (y == null ? void 0 : y[t]) ?? Math.random(), columns: f == null ? void 0 : f.concat(r ? [{ title: "操作", align: "center", fixed: "right", width: `${Math.ceil(s / m.width * 100).toFixed(2)}%`, render: (y, b, w) => r(b, w) }] : []), dataSource: n, size: "middle", scroll: { x: "max-content", y: m.height - 50 }, pagination: !1, expandable: { defaultExpandAllRows: !0, expandRowByClick: !0, onExpandedRowsChange: c, expandedRowKeys: d } }) : null }); return u("div", { ref: l, className: O("ff-data-list-table", e), children: m.height ? u(Ea, { ...i, ref: o, rowKey: (y) => (y == null ? void 0 : y[t]) ?? Math.random(), columns: f == null ? void 0 : f.concat(r ? [{ title: "操作", align: "center", fixed: "right", width: `${Math.ceil(s / m.width * 100).toFixed(2)}%`, render: (y, b, w) => r(b, w) }] : []), dataSource: n, size: "middle", scroll: { x: "max-content", y: m.height - 50 }, pagination: !1, expandable: { defaultExpandAllRows: !0, expandRowByClick: !0, onExpandedRowsChange: c, expandedRowKeys: d } }) : null });
}, an = "RC_FORM_INTERNAL_HOOKS", ia = (e, { initialValue: t, initialValueLanguage: a, convertJs: n, convertJsSetting: r, type: s = "string" }, i = 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 = Te(Va), [d, c] = N(), [m, h] = N(a != "javascript" && e ? l.getFieldValue(e) : void 0), { registerWatch: f } = l.getInternalHooks(an) || {}; const o = q(!1), l = Te(Va), [d, c] = P(), [m, h] = P(a != "javascript" && e ? l.getFieldValue(e) : void 0), { registerWatch: f } = l.getInternalHooks(an) || {};
return E(() => f == null ? void 0 : f((y, b, w) => { return $(() => f == null ? void 0 : f((y, b, w) => {
if (!o.current) return; if (!o.current) return;
const v = p.get(b, e); const v = p.get(b, e);
p.isEqual(v, m) || h(G(v, s)); p.isEqual(v, m) || h(Y(v, s));
}), [m]), E(() => { }), [m]), $(() => {
a == "javascript" && t ? Ce.exec(t, {}, { getFieldValueForBasicForm: (y) => i ? i.getFieldValue(y) : l.getFieldValue(y), getFieldValue: (y) => l.getFieldValue(y) }).then((y) => h(G(y, s))).catch((y) => notification.error({ message: `布局数据错误: ${JSON.stringify(y)}` })).finally(() => o.current = !0) : (t && h(G(t ?? l.getFieldValue(e), s)), o.current = !0); a == "javascript" && t ? Ce.exec(t, {}, { getFieldValueForBasicForm: (y) => i ? i.getFieldValue(y) : l.getFieldValue(y), getFieldValue: (y) => l.getFieldValue(y) }).then((y) => h(Y(y, s))).catch((y) => notification.error({ message: `布局数据错误: ${JSON.stringify(y)}` })).finally(() => o.current = !0) : (t && h(Y(t ?? l.getFieldValue(e), s)), o.current = !0);
}, [t, a]), Ue(() => { }, [t, a]), Ue(() => {
o.current && n && new Ye([n, r]).toValue(m, l.getFieldsValue(!0)).then(c).catch((y) => { o.current && n && new Ye([n, r]).toValue(m, l.getFieldsValue(!0)).then(c).catch((y) => {
c(y), console.error("布局数据转换错误: ", y, n); c(y), console.error("布局数据转换错误: ", y, n);
}); });
}, [m, n, r]), [d ?? m, m]; }, [m, n, r]), [d ?? m, m];
}, oa = (e, t, a = "@pkg/ff/grid-layouts", n = null) => Q(() => { }, oa = (e, t, a = "@pkg/ff/grid-layouts", n = null) => Z(() => {
var r; var r;
return (r = p.sortBy(e, ["y", "x"])) == null ? void 0 : r.map(({ i: s, x: i, y: o, w: l, h: d, field: { boxStyle: c, widgetPrefix: m = a, widget: h, ...f } }, y) => u("div", { className: "grid-layout-item", style: ta(i, o, l, d, c, h === "Height" && (f == null ? void 0 : f.initialValue)), children: u(nn, { ...f, basicForm: n, itemWidget: h != null && h.startsWith("@") || h != null && h.startsWith("blob:") ? h : `${m}/${h}`, itemWidgetRender: t }) }, s || y)); return (r = p.sortBy(e, ["y", "x"])) == null ? void 0 : r.map(({ i: s, x: i, y: o, w: l, h: d, field: { boxStyle: c, widgetPrefix: m = a, widget: h, ...f } }, y) => u("div", { className: "grid-layout-item", style: ta(i, o, l, d, c, h === "Height" && (f == null ? void 0 : f.initialValue)), children: u(nn, { ...f, basicForm: n, itemWidget: h != null && h.startsWith("@") || h != null && h.startsWith("blob:") ? h : `${m}/${h}`, itemWidgetRender: t }) }, s || y));
}, [e]), nn = ({ itemWidget: e, itemWidgetRender: t, basicForm: a, ...n }) => { }, [e]), nn = ({ itemWidget: e, itemWidgetRender: t, basicForm: a, ...n }) => {
const [r, s] = N(); const [r, s] = P();
return E(() => { return $(() => {
X.getWidgetComponent(e).then(({ defaultProps: i = {}, default: o }) => { Q.getWidgetComponent(e).then(({ defaultProps: i = {}, default: o }) => {
s(C.createElement(t(o, i, a), n)); s(C.createElement(t(o, i, a), n));
}).catch((i) => { }).catch((i) => {
console.error(i), s(e); console.error(i), s(e);
}); });
}, [e]), r; }, [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 }) => { }, 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 [d] = Y.useForm(), c = oa(a, rn, "@pkg/ff/grid-layouts"), m = Q(() => [{ name: "__PROPS__", value: i }], [i]); const [d] = X.useForm(), c = oa(a, rn, "@pkg/ff/grid-layouts"), m = Z(() => [{ name: "__PROPS__", value: i }], [i]);
return Ue(() => (d.setFieldsValue(n), () => d.resetFields()), [n]), u(Y, { fields: m, form: d, 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: c }) }); return Ue(() => (d.setFieldsValue(n), () => d.resetFields()), [n]), u(X, { fields: m, form: d, 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: c }) });
}, rn = (e, t = {}, a = null) => (n) => { }, rn = (e, t = {}, a = null) => (n) => {
const { code: r, label: s, extras: i, isVirtual: o, initialValue: l, initialValueLanguage: d, convertJs: c, convertJsSetting: m, ...h } = p.merge({}, t, n), [f, y] = ia(o ? null : r, { initialValue: l, initialValueLanguage: d, convertJs: c, convertJsSetting: m, type: (h == null ? void 0 : h.type) || "string" }, a); const { code: r, label: s, extras: i, isVirtual: o, initialValue: l, initialValueLanguage: d, convertJs: c, convertJsSetting: m, ...h } = p.merge({}, t, n), [f, y] = ia(o ? null : r, { initialValue: l, initialValueLanguage: d, convertJs: c, convertJsSetting: m, type: (h == null ? void 0 : h.type) || "string" }, a);
return u(e, { ...h, value: f, rawValue: y, $setting: i || {} }); return u(e, { ...h, value: f, rawValue: y, $setting: i || {} });
}, sr = (It = la, function({ code: e, data: t, ...a }) { }, sr = (It = la, function({ code: e, data: t, ...a }) {
const [n, r] = N({ resource: null, cols: 12, rowHeight: 21, fields: [] }); const [n, r] = P({ resource: null, cols: 12, rowHeight: 21, fields: [] });
return E(() => { return $(() => {
e && T.get(`/api/_/${e}`).then((s) => r(p.pick(s, ["resource", "cols", "rowHeight", "fields"]))); e && R.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 } : {} }); }, [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; var It;
const ir = ({ widget: e, widgetPrefix: t = "@pkg/ff/grid-layouts", basicForm: a, ...n }) => { const ir = ({ 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(); const r = e != null && e.startsWith("@") || e != null && e.startsWith("blob:") ? e : `${t}/${e}`, [s, i] = P();
return E(() => { return $(() => {
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))); 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; }, [r]), s;
}, sn = (e, t = {}, a = null) => (n) => { }, sn = (e, t = {}, a = null) => (n) => {
const { code: r, label: s, extras: i, isVirtual: o, initialValue: l, initialValueLanguage: d, convertJs: c, convertJsSetting: m, value: h, ...f } = p.merge({}, t, n), [y, b] = ia(o ? null : r, { initialValue: l, initialValueLanguage: d, convertJs: c, convertJsSetting: m, type: (f == null ? void 0 : f.type) || "string" }, a); const { code: r, label: s, extras: i, isVirtual: o, initialValue: l, initialValueLanguage: d, convertJs: c, convertJsSetting: m, value: h, ...f } = p.merge({}, t, n), [y, b] = ia(o ? null : r, { initialValue: l, initialValueLanguage: d, convertJs: c, convertJsSetting: m, type: (f == null ? void 0 : f.type) || "string" }, a);
return u(e, { ...f, value: y, rawValue: b, $setting: i || {} }); return u(e, { ...f, value: y, rawValue: b, $setting: i || {} });
}, on = ({ cols: e, rowHeight: t, itemMargin: a, fields: n, primaryKey: r, dataSource: s, itemClassName: i, itemRender: o = (m, h, f) => m, empty: l = u(Ta, { description: null }), className: d, style: c = {} }) => { }, on = ({ cols: e, rowHeight: t, itemMargin: a, fields: n, primaryKey: r, dataSource: s, itemClassName: i, itemRender: o = (m, h, f) => m, empty: l = u(Ta, { description: null }), className: d, style: c = {} }) => {
const m = Ge(), h = Q(() => u(la, { cols: e, rowHeight: t, itemMargin: a, fields: n, className: i }), [n, e, t, a]); const m = Ge(), h = Z(() => u(la, { cols: e, rowHeight: t, itemMargin: a, fields: n, className: i }), [n, e, t, a]);
return u("div", { className: O("ff-data-list-content", d), style: c, children: p.isEmpty(s) ? l : s.map((f, y) => { return u("div", { className: O("ff-data-list-content", d), style: c, children: p.isEmpty(s) ? l : s.map((f, y) => {
const b = o(C.cloneElement(h, { data: f }), f, y); const b = o(C.cloneElement(h, { data: f }), f, y);
return C.cloneElement(b, { key: `${m}-${(f == null ? void 0 : f[r]) || y}` }); return C.cloneElement(b, { key: `${m}-${(f == null ? void 0 : f[r]) || y}` });
}) }); }) });
}, ln = ({ component: e }) => { }, ln = ({ component: e }) => {
const { base62params: t } = Aa(); const { base62params: t } = Aa();
return u(J, { children: u(kt, { listCode: e, base62params: T.decode(t) }) }); return u(K, { children: u(kt, { listCode: e, base62params: R.decode(t) }) });
}, cn = () => "Empty", dn = ({ component: e, $setting: t }) => { }, cn = () => "Empty", dn = ({ component: e, $setting: t }) => {
const [a, n] = N(); const [a, n] = P();
E(() => { $(() => {
if (!e) return n(u(cn, { description: null })); 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]); }, [e]);
const r = oe.getPageParams() || {}; const r = le.getPageParams() || {};
return a ? C.cloneElement(a, r) : null; return a ? C.cloneElement(a, r) : null;
}; };
var pe, _, me, he, Me, ze; var pe, G, me, he, Me, ze;
const ae = class ae { const ne = class ne {
constructor() { constructor() {
$(this, _, /* @__PURE__ */ new Map()); N(this, G, /* @__PURE__ */ new Map());
$(this, me, {}); N(this, me, {});
$(this, he, null); N(this, he, null);
k(this, "init", (t, a) => { k(this, "init", (t, a) => {
B(this, _, t), B(this, me, a); B(this, G, t), B(this, me, a);
}); });
k(this, "get", (t) => (g(this, _).has(t) || (t = Array.from(g(this, _).keys()).find((a) => g(this, _).get(a).uri === t)), g(this, _).get(t) || {})); 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 = {}) => { k(this, "redirect", (t, a, n = {}) => {
const { uri: r, type: s, widgetProps: i } = this.get(t) || {}; const { uri: r, type: s, widgetProps: i } = this.get(t) || {};
let o = ja(r || t, s != "list" ? a : p.mapValues(a, (d) => T.encode(d))); let o = ja(r || t, s != "list" ? a : p.mapValues(a, (d) => R.encode(d)));
const l = new URLSearchParams(); const l = new URLSearchParams();
for (const d in i || {}) (i == null ? void 0 : i.type) == "query" && l.append(d, a[d]); for (const d in i || {}) (i == null ? void 0 : i.type) == "query" && l.append(d, a[d]);
return l.size > 0 && (o = `${o}?${l.toString()}`), g(this, he).navigate(o, n); return l.size > 0 && (o = `${o}?${l.toString()}`), g(this, he).navigate(o, n);
@ -445,7 +445,7 @@ const ae = class ae {
return a; return a;
}); });
k(this, "getMenusByRouteUuid", (t) => g(this, ze).call(this, t, Object.values(g(this, me)).flat())); k(this, "getMenusByRouteUuid", (t) => g(this, ze).call(this, t, Object.values(g(this, me)).flat()));
$(this, Me, (t, a, n = []) => { N(this, Me, (t, a, n = []) => {
if (p.isEmpty(t)) return n; if (p.isEmpty(t)) return n;
for (const { uuid: r, children: s } of t) { for (const { uuid: r, children: s } of t) {
if (r == a) return n.concat(r); if (r == a) return n.concat(r);
@ -453,7 +453,7 @@ const ae = class ae {
} }
return n; return n;
}); });
$(this, ze, (t, a) => { N(this, ze, (t, a) => {
var r; var r;
let n = []; let n = [];
for (const s of a) s.widgetType == "redirect" && (s.uuid == t || s.widget == t ? n.push(s) : (r = s.children) != null && r.length && (n = n.concat(g(this, ze).call(this, t, s.children)))); for (const s of a) s.widgetType == "redirect" && (s.uuid == t || s.widget == t ? n.push(s) : (r = s.children) != null && r.length && (n = n.concat(g(this, ze).call(this, t, s.children))));
@ -469,7 +469,7 @@ const ae = class ae {
var n; var n;
const a = (n = g(this, he).state.matches[g(this, he).state.matches.length - 1 - t]) == null ? void 0 : n.route; const a = (n = g(this, he).state.matches[g(this, he).state.matches.length - 1 - t]) == null ? void 0 : n.route;
if (!a) return null; if (!a) return null;
for (let [r, s] of g(this, _)) if (s.uri === a.path) return s; for (let [r, s] of g(this, G)) if (s.uri === a.path) return s;
return null; return null;
}); });
k(this, "getPageParams", (t) => { k(this, "getPageParams", (t) => {
@ -480,10 +480,10 @@ const ae = class ae {
}), t ? p.get(r, t) : r; }), t ? p.get(r, t) : r;
}); });
k(this, "createBrowserRouter", (t = {}) => { k(this, "createBrowserRouter", (t = {}) => {
if (g(this, _).size == 0) return null; if (g(this, G).size == 0) return null;
const a = Oe.get("Common.WEBSITE_DEFAULT_THEME", "@pkg/ff/frameworks/DefaultTheme"), n = Oe.get(X.checkUserToken() ? "Common.WEBSITE_LOGIN_REDIRECT" : "Common.WEBSITE_DEFAULT", "/index"), r = { [a]: 0 }, s = (o, l) => () => X.getWidgetComponent(o).then((d) => d.default || function() { const a = Oe.get("Common.WEBSITE_DEFAULT_THEME", "@pkg/ff/frameworks/DefaultTheme"), n = Oe.get(Q.checkUserToken() ? "Common.WEBSITE_LOGIN_REDIRECT" : "Common.WEBSITE_DEFAULT", "/index"), r = { [a]: 0 }, s = (o, l) => () => Q.getWidgetComponent(o).then((d) => d.default || function() {
return `${o}`; return `${o}`;
}).then((d) => ({ Component: () => C.createElement(_t, {}, C.createElement(d, l)) })), i = Array.from(g(this, _).values()).reduce((o, { uuid: l, uri: d, name: c, type: m, component: h, widgetSetting: f, isLogin: y, isLayout: b, extra: w }) => { }).then((d) => ({ Component: () => C.createElement(_t, {}, C.createElement(d, l)) })), i = Array.from(g(this, G).values()).reduce((o, { uuid: l, uri: d, name: c, type: m, component: h, widgetSetting: f, isLogin: y, isLayout: b, extra: w }) => {
let v = {}, j = 0; let v = {}, j = 0;
switch (m) { switch (m) {
case "list": case "list":
@ -500,12 +500,12 @@ const ae = class ae {
}, [{ path: "/", lazy: s(a, {}), children: [] }]); }, [{ path: "/", lazy: s(a, {}), children: [] }]);
return i.push({ index: !0, element: C.createElement(un, { to: n, replace: !0 }) }), B(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(ae, pe)) return g(ae, pe); if (g(ne, pe)) return g(ne, pe);
} }
}; };
pe = new WeakMap(), _ = new WeakMap(), me = new WeakMap(), he = new WeakMap(), Me = new WeakMap(), ze = new WeakMap(), $(ae, pe, null), k(ae, "getInstance", () => (g(ae, pe) || B(ae, pe, new ae()), g(ae, pe))); pe = new WeakMap(), G = new WeakMap(), me = new WeakMap(), he = new WeakMap(), Me = new WeakMap(), ze = new WeakMap(), N(ne, pe, null), k(ne, "getInstance", () => (g(ne, pe) || B(ne, pe, new ne()), g(ne, pe)));
let mt = ae; let mt = ne;
const un = ({ to: e, replace: t }) => Ma() ? C.createElement(za, { to: e, replace: t }) : (window.document.location = e, "redirect"), oe = mt.getInstance(), Se = new Worker(new URL("/ff-worker/index.js", self.location)), Mt = { getConfigure: (e) => Oe.get(e), route: { redirect: (...e) => oe.redirect(...e), getPageParams: (...e) => oe.getPageParams(...e), getCurrentRoute: () => oe.getCurrentRoute() }, popup: { notification: (...e) => K.notification(...e), success: (...e) => K.success(...e), error: (...e) => K.error(...e), form: (...e) => K.form(...e), modal: (...e) => K.modal(...e), confirm: (...e) => K.confirm(...e) } }; const un = ({ to: e, replace: t }) => Ma() ? C.createElement(za, { to: e, replace: t }) : (window.document.location = e, "redirect"), le = mt.getInstance(), Se = new Worker(new URL("/ff-worker/index.js", self.location)), Mt = { getConfigure: (e) => Oe.get(e), route: { redirect: (...e) => le.redirect(...e), getPageParams: (...e) => le.getPageParams(...e), getCurrentRoute: () => le.getCurrentRoute() }, popup: { notification: (...e) => _.notification(...e), success: (...e) => _.success(...e), error: (...e) => _.error(...e), form: (...e) => _.form(...e), modal: (...e) => _.modal(...e), confirm: (...e) => _.confirm(...e) } };
var tt, $e, fe; var tt, $e, fe;
const M = class M { const M = class M {
constructor() { constructor() {
@ -533,21 +533,21 @@ const M = class M {
}, !1); }, !1);
} }
}; };
tt = new WeakMap(), $e = new WeakMap(), fe = new WeakMap(), k(M, "mQueue", /* @__PURE__ */ new Map()), $(M, tt, 0), $(M, $e, /* @__PURE__ */ new Map()), $(M, fe, null), k(M, "getInstance", () => (g(M, fe) || B(M, fe, new M()), g(M, fe))); tt = new WeakMap(), $e = new WeakMap(), fe = new WeakMap(), k(M, "mQueue", /* @__PURE__ */ new Map()), N(M, tt, 0), N(M, $e, /* @__PURE__ */ new Map()), N(M, fe, null), k(M, "getInstance", () => (g(M, fe) || B(M, fe, new M()), g(M, fe)));
let ht = M; let ht = M;
const Ce = ht.getInstance(), St = () => { const Ce = ht.getInstance(), St = () => {
const e = q(!0), [, t] = C.useReducer((a) => a + 1, 0); const e = q(!0), [, t] = C.useReducer((a) => a + 1, 0);
return E(() => () => e.current = !1, []), () => e.current && t(); return $(() => () => e.current = !1, []), () => e.current && t();
}, or = (e) => { }, or = (e) => {
const t = q(); const t = q();
return E(() => { return $(() => {
t.current = e; t.current = e;
}, [e]), t.current; }, [e]), t.current;
}, lr = (e) => { }, lr = (e) => {
const [t, a] = N(e), n = q(null), r = le((s, i) => { const [t, a] = P(e), n = q(null), r = ce((s, i) => {
n.current = i, a(s); n.current = i, a(s);
}, []); }, []);
return E(() => { return $(() => {
n.current && (n.current(t), n.current = null); n.current && (n.current(t), n.current = null);
}, [t]), [t, r]; }, [t]), [t, r];
}, Ue = (e = (n) => { }, Ue = (e = (n) => {
@ -557,19 +557,19 @@ const Ce = ht.getInstance(), St = () => {
}, xt = Ue, ca = (e, t = "string") => { }, xt = Ue, ca = (e, t = "string") => {
var a; var a;
if (!Array.isArray(e)) return e; if (!Array.isArray(e)) return e;
for (let n = 0; n < e.length; n++) e[n].value = G((a = e[n]) == null ? void 0 : a.value, t), e[n] && Reflect.has(e[n], "children") && (e[n].children = ca(e[n].children, t)); 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; return e;
}, cr = (e, t = "json", a = "string", n, r = null) => { }, cr = (e, t = "json", a = "string", n, r = null) => {
const [s] = Y.useForm(n), [i, o] = N([{ label: "无", value: "", disabled: !0 }]), l = q([]), d = Y.useWatch((c) => l.current.length === 0 ? null : p.pick(c, l.current), s) || null; const [s] = X.useForm(n), [i, o] = P([{ label: "无", value: "", disabled: !0 }]), l = q([]), d = X.useWatch((c) => l.current.length === 0 ? null : p.pick(c, l.current), s) || null;
return E(() => { return $(() => {
Array.isArray(e) ? o(e) : t === "javascript" && e ? Ce.exec(e, {}, { getFieldValue: (c) => (l.current.includes(c) || l.current.push(c), s.getFieldValue(c)), getFieldValueForBasicForm: (c) => (l.current.includes(c) || l.current.push(c), r ? r.getFieldValue(c) : s.getFieldValue(c)) }).then((c) => { Array.isArray(e) ? o(e) : t === "javascript" && e ? Ce.exec(e, {}, { getFieldValue: (c) => (l.current.includes(c) || l.current.push(c), s.getFieldValue(c)), getFieldValueForBasicForm: (c) => (l.current.includes(c) || l.current.push(c), r ? r.getFieldValue(c) : s.getFieldValue(c)) }).then((c) => {
o(G(c, "array")); o(Y(c, "array"));
}) : e && o(G(e, "array")); }) : e && o(Y(e, "array"));
}, [e, t, d]), ca(i, a); }, [e, t, d]), ca(i, a);
}, dr = (e) => { }, dr = (e) => {
const [t, a] = N(), n = { type: "GET" }; const [t, a] = P(), 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"; 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) => T.request(n, !1).resp((i) => (console.log("useSubscribeRequest", s), a(i), i)); const r = (s) => R.request(n, !1).resp((i) => (console.log("useSubscribeRequest", s), a(i), i));
return Ue(() => { return Ue(() => {
let s = null; let s = null;
return r().then((i) => { return r().then((i) => {
@ -579,14 +579,14 @@ const Ce = ht.getInstance(), St = () => {
}, gn = (e) => { }, gn = (e) => {
const [t, a] = C.useState({ gridItems: [], hideItems: [] }); const [t, a] = C.useState({ gridItems: [], hideItems: [] });
return C.useEffect(() => { return C.useEffect(() => {
e && T.get(`/api/_/${e}`).then(({ pk: n, uuid: r, code: s, resource: i, align: o, cols: l, rowHeight: d, marginX: c, marginY: m, listenChangeFields: h, listenChangeFieldsFunc: f, fields: y }) => ({ pk: n, uuid: r, code: s, resource: i, align: o, cols: l, rowHeight: d, marginX: c, marginY: m, listenChangeFields: h, listenChangeFieldsFunc: f, ...y.reduce((b, w) => { e && R.get(`/api/_/${e}`).then(({ pk: n, uuid: r, code: s, resource: i, align: o, cols: l, rowHeight: d, marginX: c, marginY: m, listenChangeFields: h, listenChangeFieldsFunc: f, fields: y }) => ({ pk: n, uuid: r, code: s, resource: i, align: o, cols: l, rowHeight: d, marginX: c, marginY: m, listenChangeFields: h, listenChangeFieldsFunc: f, ...y.reduce((b, w) => {
var v; var v;
return (v = w == null ? void 0 : w.field) != null && v.hidden ? b.hides.push(w == null ? void 0 : w.field) : b.items.push(w), b; return (v = w == null ? void 0 : w.field) != null && v.hidden ? b.hides.push(w == null ? void 0 : w.field) : b.items.push(w), b;
}, { items: [], hides: [] }) })).then(a); }, { items: [], hides: [] }) })).then(a);
}, [e]), t; }, [e]), t;
}, pn = ({ max: e = 0, min: t = 0, type: a = "", message: n, pattern: r, required: s = !1, validator: i } = {}, o, l) => { }, pn = ({ max: e = 0, min: t = 0, type: a = "", message: n, pattern: r, required: s = !1, validator: i } = {}, o, l) => {
const [d, c] = N([]); const [d, c] = P([]);
return E(() => { return $(() => {
const m = []; const m = [];
if (s) { if (s) {
let h = l; let h = l;
@ -619,80 +619,80 @@ const Ce = ht.getInstance(), St = () => {
c(m); c(m);
}, [e, t, a, n, r, s, i]), d; }, [e, t, a, n, r, s, i]), d;
}, mn = (e, t, a) => { }, mn = (e, t, a) => {
const [n, r] = N(null); const [n, r] = P(null);
return E(() => { return $(() => {
const { initDataUri: s = `/api/${e}`, initDataMethod: i = "GET" } = a || {}; const { initDataUri: s = `/api/${e}`, initDataMethod: i = "GET" } = a || {};
t && T.request({ method: i, url: p.trimEnd(`${s}/${t}`, "/") }).then((o) => { t && R.request({ method: i, url: p.trimEnd(`${s}/${t}`, "/") }).then((o) => {
r(o); r(o);
}); });
}, [e, t, a]), n; }, [e, t, a]), n;
}, hn = (e, t, a, n = {}) => { }, hn = (e, t, a, n = {}) => {
const r = St(), s = q(!0), i = q([]), [o, l] = N(a), d = Y.useWatch((c) => JSON.stringify(p.pick(c, i.current)), t) || "{}"; const r = St(), s = q(!0), i = q([]), [o, l] = P(a), d = X.useWatch((c) => JSON.stringify(p.pick(c, i.current)), t) || "{}";
return E(() => { return $(() => {
e && Ce.exec(e, n, { getFieldValue: p.wrap(t.getFieldValue, (c, m) => (i.current.some((h) => p.isEqual(h, m)) || (i.current.push(m), r()), c(m))), isFieldTouched: t.isFieldTouched, isFieldsTouched: t.isFieldsTouched }).then((c) => s.current && l(c)); e && Ce.exec(e, n, { getFieldValue: p.wrap(t.getFieldValue, (c, m) => (i.current.some((h) => p.isEqual(h, m)) || (i.current.push(m), r()), c(m))), isFieldTouched: t.isFieldTouched, isFieldsTouched: t.isFieldsTouched }).then((c) => s.current && l(c));
}, [e, d, t, n]), E(() => () => s.current = !1, []), o; }, [e, d, t, n]), $(() => () => s.current = !1, []), o;
}, ur = ({ value: e, onChange: t }, a = null) => { }, ur = ({ value: e, onChange: t }, a = null) => {
const n = q(), [r] = Y.useForm(a); const n = q(), [r] = X.useForm(a);
return xt(() => { return xt(() => {
p.isEqual(n.current, e) || r.setFieldsValue(e); p.isEqual(n.current, e) || r.setFieldsValue(e);
}, [e]), E(() => () => r.resetFields(), []), [Q(() => 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); n.current = i, t(i);
}]; }];
}, fn = ({ type: e, initialValue: t, initialValueLanguage: a, onChange: n, form: r }) => { }, fn = ({ type: e, initialValue: t, initialValueLanguage: a, onChange: n, form: r }) => {
const s = hn(a == "javascript" && t, r, a == "javascript" ? void 0 : t, {}); const s = hn(a == "javascript" && t, r, a == "javascript" ? void 0 : t, {});
return E(() => { return $(() => {
a == "javascript" ? n(G(s, e)) : t && n(G(t, e)); a == "javascript" ? n(Y(s, e)) : t && n(Y(t, e));
}, [e, t, s]), null; }, [e, t, s]), null;
}, yn = ({ widget: e = "Input", widgetPrefix: t = "@pkg/ff/grid-layout-forms", widgetDecorator: a, subWidgets: n, basicForm: r, ...s }) => { }, 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] = N(); const i = e != null && e.startsWith("@") || e != null && e.startsWith("blob:") ? e : `${t}/${e}`, [o, l] = P();
return E(() => { return $(() => {
i && X.getWidgetComponent(i).then(({ defaultProps: d = {}, default: c }) => ({ default: da(c, d, r) })).catch((d) => ({ default: () => `${d}` })).then((d) => l(C.createElement(d.default, s))); i && Q.getWidgetComponent(i).then(({ defaultProps: d = {}, default: c }) => ({ default: da(c, d, r) })).catch((d) => ({ default: () => `${d}` })).then((d) => l(C.createElement(d.default, s)));
}, [i]), o && C.cloneElement(o, s); }, [i]), o && C.cloneElement(o, s);
}, da = (e, t = {}, a = null) => (n) => { }, da = (e, t = {}, a = null) => (n) => {
const { type: r, code: s, label: i, noStyle: o, placeholder: l, extras: d, validators: c, help: m, isVirtual: h, $isReserved: f, initialValue: y, initialValueLanguage: b, convertJs: w, convertJsSetting: v, widgetPerfix: j, boxStyle: z, widgetDecorator: I, subWidgets: L, ...S } = { ...t, ...n }, F = pn(c || {}, s, r), V = { label: i, noStyle: o, colon: !1, layout: "vertical" }, W = { placeholder: l, ...S }, U = le((D) => D == null ? void 0 : G(D, r), [r]); const { type: r, code: s, label: i, noStyle: o, placeholder: l, extras: d, validators: c, help: m, isVirtual: h, $isReserved: f, initialValue: y, initialValueLanguage: b, convertJs: w, convertJsSetting: v, widgetPerfix: j, boxStyle: z, widgetDecorator: I, subWidgets: L, ...E } = { ...t, ...n }, S = pn(c || {}, s, r), V = { label: i, noStyle: o, colon: !1, layout: "vertical" }, U = { placeholder: l, ...E }, D = ce((W) => W == null ? void 0 : Y(W, r), [r]);
return u(Jt, { name: s, rules: F, initialValue: U(y), normalize: U, children: (D, x, ce) => { return u(Jt, { name: s, rules: S, initialValue: D(y), normalize: D, children: (W, T, H) => {
var re; var se;
return u(e, { type: r, rcform: ce, itemProps: { validateStatus: x.errors.length > 0 ? "error" : "success", tooltip: m, help: x.errors.length > 0 ? x.errors.join("、") : null, required: ((re = F == null ? void 0 : F[0]) == null ? void 0 : re.required) || !1, ...V }, fieldProps: { ...W, ...D }, $setting: d || {} }); return u(e, { type: r, rcform: H, itemProps: { validateStatus: T.errors.length > 0 ? "error" : "success", tooltip: m, help: T.errors.length > 0 ? T.errors.join("、") : null, required: ((se = S == null ? void 0 : S[0]) == null ? void 0 : se.required) || !1, ...V }, fieldProps: { ...U, ...W }, $setting: d || {} });
} }); } });
}, Pt = ({ cols: e = 24, rowHeight: t = 16, itemMargin: a = [8, 16], containerPadding: n = [0, 0], fields: r = [], children: s, basicForm: i = null }) => { }, Pt = ({ 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"); const o = oa(r, da, "@pkg/ff/grid-layout-forms");
return R("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 })] }); return F("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 })] });
}; };
Pt.propTypes = { fields: A.array }; Pt.propTypes = { fields: A.array };
const wn = (zt = Pt, ({ code: e, layout: t, name: a, primaryKey: n = 0, style: r = {}, formProps: s = {}, form: i, isPreview: o = !1, className: l, onFinish: d, onValuesChange: c = () => { const wn = (zt = Pt, ({ code: e, layout: t, name: a, primaryKey: n = 0, style: r = {}, formProps: s = {}, form: i, isPreview: o = !1, className: l, onFinish: d, onValuesChange: c = () => {
}, ...m }) => { }, ...m }) => {
const { align: h, autoComplete: f, resource: y, items: b, hides: w, rowHeight: v, marginX: j, marginY: z, cols: I, listenChangeFields: L, listenChangeFieldsFunc: S, pk: F, uuid: V } = gn(e), [W] = Y.useForm(i), U = Q(() => [{ 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]); const { align: h, autoComplete: f, resource: y, items: b, hides: w, rowHeight: v, marginX: j, marginY: z, cols: I, listenChangeFields: L, listenChangeFieldsFunc: E, pk: S, uuid: V } = gn(e), [U] = X.useForm(i), D = Z(() => [{ name: "__PK__", value: S }, { name: "__PROPS__", value: s }, { name: "__RESOURCE__", value: y }, { name: "__LAYOUT_KEY__", value: e }, { name: "__LAYOUT_UUID__", value: V }, { name: "__PRIMARY_KEY__", value: n }], [S, e, V, y, n, s]);
return R(Y, { className: l, name: a || e, layout: t || h, fields: U, form: W, autoComplete: f, style: { ...r, position: "relative" }, onFinish: d, onValuesChange: (D, x) => (({ changedValues: ce, allValues: re, listenChangeFields: at, listenChangeFieldsFunc: Be, onValuesChange: nt, code: Et }) => { return F(X, { className: l, name: a || e, layout: t || h, fields: D, form: U, autoComplete: f, style: { ...r, position: "relative" }, onFinish: d, onValuesChange: (W, T) => (({ changedValues: H, allValues: se, listenChangeFields: at, listenChangeFieldsFunc: Be, onValuesChange: nt, code: Et }) => {
nt(ce, re), Be && Array.isArray(at) && Ce.exec(Be, { changedValues: ce, allValues: re }, { getFieldValue: W.getFieldValue, setFieldValue: W.setFieldValue, setFieldsValue: W.setFieldsValue, isFieldTouched: W.isFieldTouched, isFieldsTouched: W.isFieldsTouched }); nt(H, se), Be && Array.isArray(at) && Ce.exec(Be, { changedValues: H, allValues: se }, { getFieldValue: U.getFieldValue, setFieldValue: U.setFieldValue, setFieldsValue: U.setFieldsValue, isFieldTouched: U.isFieldTouched, isFieldsTouched: U.isFieldsTouched });
})({ changedValues: D, allValues: x, listenChangeFields: L, listenChangeFieldsFunc: S, onValuesChange: c, code: e }), children: [u(zt, { ...m, form: W, code: e, fields: b, cols: I, rowHeight: v, itemMargin: [j, z] }), w == null ? void 0 : w.map((D) => { })({ changedValues: W, allValues: T, listenChangeFields: L, listenChangeFieldsFunc: E, onValuesChange: c, code: e }), children: [u(zt, { ...m, form: U, code: e, fields: b, cols: I, rowHeight: v, itemMargin: [j, z] }), w == null ? void 0 : w.map((W) => {
var x; var T;
return u(Jt, { name: D.code, children: u(fn, { form: W, name: D.code, type: D.type, initialValue: D.initialValue, initialValueLanguage: (x = D.extras) == null ? void 0 : x.initialValueLanguage }) }, JSON.stringify(D.code)); return u(Jt, { name: W.code, children: u(fn, { form: U, name: W.code, type: W.type, initialValue: W.initialValue, initialValueLanguage: (T = W.extras) == null ? void 0 : T.initialValueLanguage }) }, JSON.stringify(W.code));
})] }, e); })] }, e);
}); });
var zt; var zt;
const ua = ({ $setting: e, $close: t, extras: a, code: n, primaryKey: r, ...s }) => { const ua = ({ $setting: e, $close: t, extras: a, code: n, primaryKey: r, ...s }) => {
const [i] = Y.useForm(), o = mn(n, r, e); const [i] = X.useForm(), o = mn(n, r, e);
return E(() => { return $(() => {
o && i.setFieldsValue(o); o && i.setFieldsValue(o);
}, [o]), u(J, { actions: R(C.Fragment, { children: [u(P, { name: "保存", type: "primary", widget: () => { }, [o]), u(K, { actions: F(C.Fragment, { children: [u(x, { name: "保存", type: "primary", widget: () => {
const l = i.getFieldValue("__RESOURCE__"), { initDataUri: d = `/api/${n}` } = e || {}; const l = i.getFieldValue("__RESOURCE__"), { initDataUri: d = `/api/${n}` } = e || {};
i.validateFields(!0).then((c) => l ? p.pick(c, [l]) : c).then((c) => T.post(r ? `${d}/${r}` : `${d}`, c).msg(t)).catch(() => K.error("请先完善表单信息", { duration: 2e3 })); i.validateFields(!0).then((c) => l ? p.pick(c, [l]) : c).then((c) => R.post(r ? `${d}/${r}` : `${d}`, c).msg(t)).catch(() => _.error("请先完善表单信息", { duration: 2e3 }));
} }), u(P, { 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 } = {}) => oe.redirect(a, t, { replace: n }), bn = (e, t = {}, a, n = {}) => { }, Cn = (e, t, a, { isReplaceRouteHistory: n = !1 } = {}) => le.redirect(a, t, { replace: n }), bn = (e, t = {}, a, n = {}) => {
var s; var s;
const r = (s = n.router) == null ? void 0 : s.reduce((i, [o, l, d]) => { const r = (s = n.router) == null ? void 0 : s.reduce((i, [o, l, d]) => {
const c = p.get(t, ["router", o]); const c = p.get(t, ["router", o]);
if (!c && c !== 0 && l) throw `请传入 ${d}`; if (!c && c !== 0 && l) throw `请传入 ${d}`;
return `${i}/${c}`; return `${i}/${c}`;
}, `/api/${a}`); }, `/api/${a}`);
return T.del(r, t.param).msg(); return R.del(r, t.param).msg();
}, Wt = (e, t, a, { status: { loading: n, disabled: r }, setStatus: s }) => { }, 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 })) }; 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 ? Ce.exec(a, t, i) : null; return p.isFunction(a) ? a.call(null, { ...t, ...i }) : p.isString(a) && a ? Ce.exec(a, t, i) : null;
}, Ut = (e, t, a, n, r) => p.isString(a) && a ? X.getWidgetComponent(a).then(({ default: s }) => K.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) => {
K.error(a, { content: s.toString() }); _.error(a, { content: s.toString() });
}) : K.modal(a, { ...t, $setting: n }, r != null && r.title ? { ...r, title: p.template(r.title)(e) } : r), kn = (e, t, a, n, r) => K.modal(ua, { ...t, $setting: n, code: a }, r != null && r.title ? { ...r, title: p.template(r.title)(e) } : r), vn = (e, t, a, n, r) => K.modal(kt, { base62params: t, $setting: n, listCode: a }, r != null && r.title ? { ...r, title: p.template(r.title)(e) } : r), Sn = ({ widget: e, widgetType: t, widgetData: a, widgetProps: n, widgetSetting: r, widgetContainerProps: s }, { onAfterClick: i, onBeforeClick: o }) => { }) : _.modal(a, { ...t, $setting: n }, r != null && r.title ? { ...r, title: p.template(r.title)(e) } : r), kn = (e, t, a, n, r) => _.modal(ua, { ...t, $setting: n, code: a }, r != null && r.title ? { ...r, title: p.template(r.title)(e) } : r), vn = (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), Sn = ({ widget: e, widgetType: t, widgetData: a, widgetProps: n, widgetSetting: r, widgetContainerProps: s }, { onAfterClick: i, onBeforeClick: o }) => {
const l = Te(we), [d, c] = N({ leading: !0, trailing: !1 }), m = Q(() => { const l = Te(we), [d, c] = P({ leading: !0, trailing: !1 }), m = Z(() => {
switch (t) { switch (t) {
case "redirect": case "redirect":
return p.partialRight(Cn, e, r); return p.partialRight(Cn, e, r);
@ -725,46 +725,46 @@ const ua = ({ $setting: e, $close: t, extras: a, code: n, primaryKey: r, ...s })
} }
}, 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 = ({ 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; yt.propTypes = { className: A.string, type: A.string.isRequired, style: A.object }, yt.init = ft;
const De = (e) => function({ className: t, children: a, name: n, icon: r, type: s = "default", iconPosition: i = "start", noAuthType: o, onAfterClick: l, onBeforeClick: d, data: c, loading: m, disabled: h, tooltip: f, popConfirm: y, widget: b, widgetType: w, widgetData: v, widgetProps: j, widgetSetting: z, widgetContainerProps: I, ...L }) { const De = (e) => function({ className: t, children: a, name: n, icon: r, type: s = "default", iconPosition: i = "start", noAuthType: o, onAfterClick: l, onBeforeClick: d, data: c, loading: m, disabled: h, tooltip: f, confirm: y, widget: b, widgetType: w, widgetData: v, widgetProps: j, widgetSetting: z, widgetContainerProps: I, ...L }) {
const S = { type: "primary", className: O("ff-button", t), iconPosition: i }; const E = Object.assign({ enabled: !0 }, y), 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 })); 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] = N(!1), [W, { disabled: U, loading: D }] = Sn({ widget: b, widgetType: w, widgetData: v, widgetProps: j, widgetSetting: z, widgetContainerProps: I }, { onAfterClick: l, onBeforeClick: d }); const [V, U] = P(!1), [D, { disabled: W, loading: T }] = Sn({ widget: b, widgetType: w, widgetData: v, widgetProps: j, widgetSetting: z, widgetContainerProps: I }, { onAfterClick: l, onBeforeClick: d });
return u(Ra, { okText: "确定", cancelText: "取消", ...y || {}, disabled: U || h, open: F, onOpenChange: (x) => { return u(Ra, { okText: "确定", cancelText: "取消", ...E || {}, disabled: W || h, open: V, onOpenChange: (H) => {
if (!x) return V(x); if (!H) return U(H);
y ? V(x) : W(c); E.enabled ? U(H) : D(c);
}, onConfirm: () => { }, onConfirm: () => {
W(c); D(c);
}, onClick: (x) => { }, onClick: (H) => {
x.stopPropagation(); H.stopPropagation();
}, children: u(Fa, { ...f, title: F ? null : f == null ? void 0 : f.title, trigger: ["hover", "click"], children: u(lt, { loading: D || m, disabled: U || h, ...S, ...L, children: a || n }) }) }); }, children: u(Fa, { ...f, title: V ? null : f == null ? void 0 : f.title, trigger: ["hover", "click"], children: u(lt, { loading: T || m, disabled: W || h, ...S, ...L, children: a || n }) }) });
}, P = De("default"), xn = De("link"), Pn = De("circle"), Nn = De("round"), $n = De("dashed"), Bt = ({ data: e, widget: t, widgetType: a = "fsdpf-component", children: n, widgetData: r, widgetProps: s, widgetSetting: i, widgetContainerProps: o }) => { }, x = De("default"), xn = De("link"), Pn = De("circle"), Nn = De("round"), $n = De("dashed"), Bt = ({ data: e, widget: t, widgetType: a = "fsdpf-component", children: n, widgetData: r, widgetProps: s, widgetSetting: i, widgetContainerProps: o }) => {
const l = Te(we), [d, c] = N(!1), [m, h] = N("hover"), [f, y] = N({}), [b, w] = N(), { placement: v, align: j, arrow: z = { pointAtCenter: !0 }, getPopupContainer: I, ...L } = o || {}; const l = Te(we), [d, c] = P(!1), [m, h] = P("hover"), [f, y] = P({}), [b, w] = P(), { placement: v, align: j, arrow: z = { pointAtCenter: !0 }, getPopupContainer: I, ...L } = o || {};
E(() => { $(() => {
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 }) => { 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 })); w(C.createElement(V, { ...r, $setting: i }));
}).catch((V) => w(V.toString())) : $t(t) ? w(C.createElement(t, { ...r, $setting: i })) : C.isValidElement(t) && w(C.cloneElement(t, { ...r, $setting: i })); }).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]), E(() => { }, [t, a, r]), $(() => {
Promise.resolve(Yt(s, e, { list: l })).then(y); Promise.resolve(Yt(s, e, { list: l })).then(y);
}, [s, e]); }, [s, e]);
const S = (V) => { const E = (V) => {
c(V), !V && h("hover"); c(V), !V && h("hover");
}, F = (V) => { }, S = (V) => {
c(!0), h("click"); c(!0), h("click");
}; };
return u(Oa, { zIndex: 1080, placement: v, onPopupClick: F, onClick: F, open: d, align: j, arrow: z, trigger: m, getPopupContainer: I, content: u(En, { ...L, children: b && C.cloneElement(b, { ...f, $close: () => S(!1) }) }), children: n, onOpenChange: S }); return u(Oa, { zIndex: 1080, placement: v, onPopupClick: S, onClick: S, open: d, align: j, arrow: z, trigger: m, getPopupContainer: I, content: u(En, { ...L, children: b && C.cloneElement(b, { ...f, $close: () => E(!1) }) }), children: n, onOpenChange: E });
}, En = ({ title: e, className: t, children: a, width: n, height: r, ...s }) => { }, En = ({ title: e, className: t, children: a, width: n, height: r, ...s }) => {
const [i, o] = N({}), l = le((m, h) => o((f) => ({ ...f, [m]: h })), []), d = le((m) => o((h) => ({ ...h, [m]: void 0 })), []), c = e ? C.createElement("div", { className: "ff-popup-title" }, e) : i == null ? void 0 : i.title; const [i, o] = P({}), l = ce((m, h) => o((f) => ({ ...f, [m]: h })), []), d = ce((m) => o((h) => ({ ...h, [m]: void 0 })), []), c = e ? C.createElement("div", { className: "ff-popup-title" }, e) : i == null ? void 0 : i.title;
return u(We.Provider, { value: { ele: i, mount: l, unmount: d }, children: R("div", { className: O("ff-popup ff-popover", t), style: { width: n, height: r }, ...s, children: [R("div", { className: "ff-popup-header", children: [c, i == null ? void 0 : i["sub-title"]] }), a, R("div", { className: "ff-popup-footer", children: [i == null ? void 0 : i.extras, i == null ? void 0 : i.actions] })] }) }); return u(We.Provider, { value: { ele: i, mount: l, unmount: d }, children: F("div", { className: O("ff-popup ff-popover", t), style: { width: n, height: r }, ...s, children: [F("div", { className: "ff-popup-header", children: [c, i == null ? void 0 : i["sub-title"]] }), a, F("div", { className: "ff-popup-footer", children: [i == null ? void 0 : i.extras, i == null ? void 0 : i.actions] })] }) });
}; };
Bt.propTypes = { widgetType: A.oneOf(["fsdpf-component", "grid-layout-form", "data-list"]) }, P.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 }, P.Link = xn, P.Link.defaultProps = P.defaultProps, P.Link.propTypes = P.propTypes, P.Circle = Pn, P.Circle.defaultProps = P.defaultProps, P.Circle.propTypes = P.propTypes, P.Round = Nn, P.Round.defaultProps = P.defaultProps, P.Round.propTypes = P.propTypes, P.Dashed = $n, P.Dashed.defaultProps = P.defaultProps, P.Dashed.propTypes = P.propTypes, P.Popover = Bt; 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 = xn, x.Link.defaultProps = x.defaultProps, x.Link.propTypes = x.propTypes, x.Circle = Pn, 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 = $n, x.Dashed.defaultProps = x.defaultProps, x.Dashed.propTypes = x.propTypes, x.Popover = Bt;
const Tn = ({ fields: e, formProps: t, $close: a }) => { const Tn = ({ fields: e, formProps: t, $close: a }) => {
const [n] = Y.useForm(), r = Q(() => [{ name: "__PROPS__", value: t }], [t]); const [n] = X.useForm(), r = Z(() => [{ name: "__PROPS__", value: t }], [t]);
return u(J, { actions: R(C.Fragment, { children: [u(P, { name: "取消", widget: () => a(!1) }), u(P, { name: "确定", type: "primary", widget: () => n.validateFields(!0).then(a) })] }), children: u(Y, { fields: r, form: n, className: "ff-modal-form", children: e == null ? void 0 : e.map(({ code: s, ...i }) => u(yn, { code: s, ...i }, s)) }) }); return u(K, { actions: F(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)) }) });
}, Rn = ({ className: e, $close: t, children: a, title: n, subTitle: r, actions: s, extras: i, zIndex: o, ...l }) => R(Da, { ...l, prefixCls: "ff-drawer", className: O("ff-popup", e), maskMotion: { motionAppear: !0, motionName: "mask-motion" }, motion: (d) => ({ motionAppear: !0, motionName: `panel-motion-${d}` }), children: [R("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 }), R("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: d, ...c }) => { }, Rn = ({ className: e, $close: t, children: a, title: n, subTitle: r, actions: s, extras: i, zIndex: o, ...l }) => F(Da, { ...l, prefixCls: "ff-drawer", className: O("ff-popup", e), maskMotion: { motionAppear: !0, motionName: "mask-motion" }, motion: (d) => ({ motionAppear: !0, motionName: `panel-motion-${d}` }), children: [F("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 }), F("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: d, ...c }) => {
const m = (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 } }; const m = (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(Ba, { ...c, ...m, prefixCls: "ff-modal", modalRender: () => R("div", { className: O("ff-modal-content ff-popup", e), children: [R("div", { className: "ff-popup-header", children: [u("button", { "aria-label": "Close", className: "ff-popup-close", onClick: c.onClose, children: u(bt, { type: "close" }) }), r, s] }), u("div", { className: "ff-popup-body", children: n }), R("div", { className: "ff-popup-footer", children: [o, i] })] }) }); return u(Ba, { ...c, ...m, prefixCls: "ff-modal", modalRender: () => F("div", { className: O("ff-modal-content ff-popup", e), children: [F("div", { className: "ff-popup-header", children: [u("button", { "aria-label": "Close", className: "ff-popup-close", onClick: c.onClose, children: u(bt, { type: "close" }) }), r, s] }), u("div", { className: "ff-popup-body", children: n }), F("div", { className: "ff-popup-footer", children: [o, i] })] }) });
}, ga = ({ placement: e, $close: t, $event: a, children: n, title: r, ...s }) => { }, ga = ({ placement: e, $close: t, $event: a, children: n, title: r, ...s }) => {
const [i, o] = N({}), [l, d] = N(!0), c = le((y, b) => o((w) => ({ ...w, [y]: b })), []), m = le((y) => o((b) => ({ ...b, [y]: void 0 })), []); const [i, o] = P({}), [l, d] = P(!0), c = ce((y, b) => o((w) => ({ ...w, [y]: b })), []), m = ce((y) => o((b) => ({ ...b, [y]: void 0 })), []);
let h = { ...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: () => d(!1) }; let h = { ...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: () => d(!1) };
const f = () => { const f = () => {
t(!1); t(!1);
@ -772,27 +772,27 @@ const Tn = ({ fields: e, formProps: t, $close: a }) => {
return u(We.Provider, { value: { ele: i, mount: c, unmount: m }, children: e && e !== "center" ? u(Rn, { ...h, placement: e, open: l, afterOpenChange: (y) => !y && f() }) : u(Fn, { ...h, visible: l, afterClose: f }) }); return u(We.Provider, { value: { ele: i, mount: c, unmount: m }, children: e && e !== "center" ? u(Rn, { ...h, placement: e, open: l, afterOpenChange: (y) => !y && f() }) : u(Fn, { ...h, visible: l, afterClose: f }) });
}; };
ga.propTypes = { placement: A.oneOf(["center", "left", "top", "right", "bottom"]) }; ga.propTypes = { placement: A.oneOf(["center", "left", "top", "right", "bottom"]) };
const H = () => { const J = () => {
const [e, t] = Wa({ maxCount: 6, motion: { motionName: "ff-notification-fade", motionAppear: !0, motionEnter: !0, motionLeave: !0, onLeaveStart: (s) => { const [e, t] = Wa({ maxCount: 6, motion: { motionName: "ff-notification-fade", motionAppear: !0, motionEnter: !0, motionLeave: !0, onLeaveStart: (s) => {
const { offsetHeight: i } = s; const { offsetHeight: i } = s;
return { height: i }; return { height: i };
}, onLeaveActive: () => ({ height: 0, opacity: 0, margin: 0 }) }, prefixCls: "ff-notification" }), [, a] = C.useReducer((s) => s + 1, 0); }, onLeaveActive: () => ({ height: 0, opacity: 0, margin: 0 }) }, prefixCls: "ff-notification" }), [, a] = C.useReducer((s) => s + 1, 0);
E(() => { $(() => {
H.$onClick = n, H.$queue.forEach(([s, i, o], l, d) => { J.$onClick = n, J.$queue.forEach(([s, i, o], l, d) => {
r([i, o], ...s), delete d[l]; r([i, o], ...s), delete d[l];
}); });
}, []); }, []);
const n = (s, i = {}, o = {}) => new Promise((l, d) => r([l, d], s, i, o)), r = ([s, i], o, l = {}, d = {}) => { const n = (s, i = {}, o = {}) => new Promise((l, d) => r([l, d], s, i, o)), r = ([s, i], o, l = {}, d = {}) => {
const c = H.$index++, m = (h) => ((f, y) => (H.$popups.delete(f), a(), y == null ? void 0 : y()))(c, () => s(h)); const c = J.$index++, m = (h) => ((f, y) => (J.$popups.delete(f), a(), y == null ? void 0 : y()))(c, () => s(h));
if (o === Gt) return e.open({ ...d, key: c, content: C.createElement(o, { ...l, $close: () => e.close(c) }) }); if (o === Gt) return e.open({ ...d, key: c, content: C.createElement(o, { ...l, $close: () => e.close(c) }) });
H.$popups.set(c, C.createElement(ga, { zIndex: c, maskClosable: !1, $event: l == null ? void 0 : l.$event, ...d, key: c, $close: m }, C.isValidElement(o) ? C.cloneElement(o, { ...l, $close: m }) : o != null && o.name || Lt.isForwardRef(o) || (o == null ? void 0 : o.$$typeof) === Lt.ForwardRef ? C.createElement(o, { ...l, $close: m }) : o)), a(); J.$popups.set(c, C.createElement(ga, { zIndex: c, maskClosable: !1, $event: l == null ? void 0 : l.$event, ...d, key: c, $close: m }, C.isValidElement(o) ? C.cloneElement(o, { ...l, $close: m }) : o != null && o.name || Lt.isForwardRef(o) || (o == null ? void 0 : o.$$typeof) === Lt.ForwardRef ? C.createElement(o, { ...l, $close: m }) : o)), a();
}; };
return R(C.Fragment, { children: [Array.from(H.$popups).map(([s, i]) => i), t] }); return F(C.Fragment, { children: [Array.from(J.$popups).map(([s, i]) => i), t] });
}; };
H.$popups = /* @__PURE__ */ new Map(), H.$index = 0, H.$queue = [], H.$onClick = (...e) => new Promise((t, a) => { J.$popups = /* @__PURE__ */ new Map(), J.$index = 0, J.$queue = [], J.$onClick = (...e) => new Promise((t, a) => {
H.$queue.push([e, t, a]); J.$queue.push([e, t, a]);
}); });
const qt = (e, t, a = {}) => H.$onClick(e, t, a), it = (e, { showProgress: t, duration: a, ...n } = { duration: 1.5 }) => H.$onClick(Gt, { content: e, ...n }, { showProgress: t, duration: a }), K = { modal: qt, confirm: (e, t = {}) => H.$onClick(qa, { content: e, ...t }, { placement: "center" }), form: (e, t = {}, a = {}) => qt(Tn, { formProps: a, fields: e }, { placement: "center", ...t }).then((n) => { const qt = (e, t, a = {}) => J.$onClick(e, t, a), it = (e, { showProgress: t, duration: a, ...n } = { duration: 1.5 }) => J.$onClick(Gt, { content: e, ...n }, { showProgress: t, duration: a }), _ = { modal: qt, confirm: (e, t = {}) => J.$onClick(qa, { content: e, ...t }, { placement: "center" }), form: (e, t = {}, a = {}) => qt(Tn, { formProps: a, fields: e }, { placement: "center", ...t }).then((n) => {
if (n === !1) throw !1; if (n === !1) throw !1;
return n; return n;
}), notification: it, success: (e, t = { duration: 1.5 }) => it(e, { ...t, className: "ff-notification-success", icon: "check" }), error: (e, t = { duration: 1.5 }) => it(e, { ...t, className: "ff-notification-error", icon: "close" }) }; }), notification: it, success: (e, t = { duration: 1.5 }) => it(e, { ...t, className: "ff-notification-success", icon: "check" }), error: (e, t = { duration: 1.5 }) => it(e, { ...t, className: "ff-notification-error", icon: "close" }) };
@ -802,10 +802,10 @@ Re.configure({ showSpinner: !1 }), Fe.interceptors.request.use((e) => {
return e.headers.Authorization = t ? `Bearer ${t} ` : void 0, Re.inc(), e; return e.headers.Authorization = t ? `Bearer ${t} ` : void 0, Re.inc(), e;
}, (e) => (Re.done(), Promise.reject({ code: -1, msg: e }))), Fe.interceptors.response.use(({ data: e, headers: t }) => (Re.done(), { ...e, res: t == null ? void 0 : t.res }), function(e) { }, (e) => (Re.done(), Promise.reject({ code: -1, msg: e }))), Fe.interceptors.response.use(({ data: e, headers: t }) => (Re.done(), { ...e, res: t == null ? void 0 : t.res }), function(e) {
return Re.done(), Promise.reject(e.message); return Re.done(), Promise.reject(e.message);
}), window.addEventListener("unhandledrejection", ct.onUnhandledRejection), ct.onMsg = (e, t) => K[[0, 1].includes(e) ? "success" : "error"](t).then(() => e === 20300 && oe.redirect(Oe.get("Common.WEBSITE_LOGIN_PAGE"))); }), window.addEventListener("unhandledrejection", ct.onUnhandledRejection), ct.onMsg = (e, t) => _[[0, 1].includes(e) ? "success" : "error"](t).then(() => e === 20300 && le.redirect(Oe.get("Common.WEBSITE_LOGIN_PAGE")));
const wt = { appUrl: "", init: (e, t, a) => { const wt = { appUrl: "", init: (e, t, a) => {
wt.appUrl = a, Fe.defaults.baseURL = a, Fe.defaults.timeout = 15e3, Object.assign(wt, new ct(e, t, Fe)); wt.appUrl = a, Fe.defaults.baseURL = a, Fe.defaults.timeout = 15e3, Object.assign(wt, new ct(e, t, Fe));
} }, T = wt; } }, R = wt;
class Nt extends Error { class Nt extends Error {
constructor(t, a) { constructor(t, a) {
super(a), Error.captureStackTrace && Error.captureStackTrace(this, Nt), !a instanceof Le && (this.name = `${t} Error Runtime`); super(a), Error.captureStackTrace && Error.captureStackTrace(this, Nt), !a instanceof Le && (this.name = `${t} Error Runtime`);
@ -818,9 +818,9 @@ class Le extends Error {
} }
const ot = "mine", _e = "token"; const ot = "mine", _e = "token";
var ye, Ee; var ye, Ee;
const ne = class ne { const re = class re {
constructor() { constructor() {
$(this, Ee, /* @__PURE__ */ new Map()); N(this, Ee, /* @__PURE__ */ new Map());
k(this, "setVendor", (t, a) => g(this, Ee).set(t, new Kt(a, async (n, r) => { k(this, "setVendor", (t, a) => g(this, Ee).set(t, new Kt(a, async (n, r) => {
var i, o; var i, o;
if (!(n != null && n.default)) throw "@pkg not found"; if (!(n != null && n.default)) throw "@pkg not found";
@ -838,16 +838,16 @@ const ne = class ne {
const [, a] = t == null ? void 0 : t.split("@pkg/"); const [, a] = t == null ? void 0 : t.split("@pkg/");
if (!a) throw new Le(t); if (!a) throw new Le(t);
try { try {
return g(this, Ee).has("pkg") ? await g(this, Ee).get("pkg").get(a) : await import(`${T.appUrl}/api/pkg-import/web?name=${t}`); return g(this, Ee).has("pkg") ? await g(this, Ee).get("pkg").get(a) : await import(`${R.appUrl}/api/pkg-import/web?name=${t}`);
} catch (n) { } catch (n) {
throw new Nt(t, n); throw new Nt(t, n);
} }
}); });
k(this, "getRoutes", () => T.get("/api/my-router").then((t) => [...t, { uuid: "data-list-setting", isLayout: !0, uri: "/data-list-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/ff-design/components/DataListSetting", extra: { layout: "@pkg/ff-design/frameworks/DesignTheme" } }, { uuid: "grid-layout-setting", isLayout: !0, uri: "/grid-layout-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/ff-design/components/GridLayoutSetting", extra: { layout: "@pkg/ff-design/frameworks/DesignTheme" } }, { uuid: "grid-layout-form-setting", isLayout: !0, uri: "/grid-layout-form-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/ff-design/components/GridLayoutFormSetting", extra: { layout: "@pkg/ff-design/frameworks/DesignTheme" } }, { uuid: "resource-api-setting", isLayout: !0, uri: "/resource-api-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/ff-design/components/ResourceApiSetting", extra: { layout: "@pkg/ff-design/frameworks/DesignTheme" } }, { uuid: "charts-setting", isLayout: !0, uri: "/resource-api-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/ff-design/components/ChartsSetting", extra: { layout: "@pkg/ff-design/frameworks/DesignTheme" } }, { uuid: "fsm-setting", isLayout: !0, uri: "/fsm-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/ff-design/components/FsmSetting", extra: { layout: "@pkg/ff-design/frameworks/DesignTheme" } }, { uuid: "component-setting", isLayout: !0, uri: "/component-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/ff-design/components/ComponentSetting", extra: { layout: "@pkg/ff-design/frameworks/DesignTheme" } }, { uuid: "login", uri: "/login", name: "登录", type: "fsdpf-component", isLogin: !1, component: "@pkg/ff/components/Login" }, { uuid: "not-found", uri: "*", name: "Not Found", type: "fsdpf-component", isLogin: !1, component: "@pkg/ff/components/NotFound" }].map(({ uuid: a, ...n }) => [a, { uuid: a, ...n }])).then((t) => new Map(t))); k(this, "getRoutes", () => R.get("/api/my-router").then((t) => [...t, { uuid: "data-list-setting", isLayout: !0, uri: "/data-list-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/ff-design/components/DataListSetting", extra: { layout: "@pkg/ff-design/frameworks/DesignTheme" } }, { uuid: "grid-layout-setting", isLayout: !0, uri: "/grid-layout-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/ff-design/components/GridLayoutSetting", extra: { layout: "@pkg/ff-design/frameworks/DesignTheme" } }, { uuid: "grid-layout-form-setting", isLayout: !0, uri: "/grid-layout-form-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/ff-design/components/GridLayoutFormSetting", extra: { layout: "@pkg/ff-design/frameworks/DesignTheme" } }, { uuid: "resource-api-setting", isLayout: !0, uri: "/resource-api-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/ff-design/components/ResourceApiSetting", extra: { layout: "@pkg/ff-design/frameworks/DesignTheme" } }, { uuid: "charts-setting", isLayout: !0, uri: "/resource-api-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/ff-design/components/ChartsSetting", extra: { layout: "@pkg/ff-design/frameworks/DesignTheme" } }, { uuid: "fsm-setting", isLayout: !0, uri: "/fsm-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/ff-design/components/FsmSetting", extra: { layout: "@pkg/ff-design/frameworks/DesignTheme" } }, { uuid: "component-setting", isLayout: !0, uri: "/component-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/ff-design/components/ComponentSetting", extra: { layout: "@pkg/ff-design/frameworks/DesignTheme" } }, { uuid: "login", uri: "/login", name: "登录", type: "fsdpf-component", isLogin: !1, component: "@pkg/ff/components/Login" }, { uuid: "not-found", uri: "*", name: "Not Found", type: "fsdpf-component", isLogin: !1, component: "@pkg/ff/components/NotFound" }].map(({ uuid: a, ...n }) => [a, { uuid: a, ...n }])).then((t) => new Map(t)));
k(this, "getMenus", () => T.get("/api/my-menu")); k(this, "getMenus", () => R.get("/api/my-menu"));
k(this, "getConfigure", () => T.get("api/init-configure")); k(this, "getConfigure", () => R.get("api/init-configure"));
k(this, "getWidgetOperationAuth", () => T.get("/api/init-widget-operation-auth").then((t) => t.reduce((a, { uuid: n, auth: r }) => [...a, [n, r]], []))); k(this, "getWidgetOperationAuth", () => R.get("/api/init-widget-operation-auth").then((t) => t.reduce((a, { uuid: n, auth: r }) => [...a, [n, r]], [])));
k(this, "getPhoneNumber", (t) => T.get(`/api/user-wx-phone-number/${t}`)); k(this, "getPhoneNumber", (t) => R.get(`/api/user-wx-phone-number/${t}`));
k(this, "getUserToken", () => { k(this, "getUserToken", () => {
const t = window.localStorage.getItem(_e); const t = window.localStorage.getItem(_e);
if (!t) return ""; if (!t) return "";
@ -869,23 +869,23 @@ const ne = class ne {
try { try {
const n = this.getUserToken(); const n = this.getUserToken();
if (!n) return Promise.resolve(null); if (!n) return Promise.resolve(null);
const { iat: r } = JSON.parse(window.atob((a = n == null ? void 0 : n.split(".")) == null ? void 0 : a[1])), { iat: s, ...i } = T.decode(window.localStorage.getItem(ot) || "", {}); const { iat: r } = JSON.parse(window.atob((a = n == null ? void 0 : n.split(".")) == null ? void 0 : a[1])), { iat: s, ...i } = R.decode(window.localStorage.getItem(ot) || "", {});
return s === r ? Promise.resolve(i) : T.get("/api/mine-info").then(({ User: o = null }) => (window.localStorage.setItem(ot, T.encode({ ...o, iat: r })), o)); return s === r ? Promise.resolve(i) : R.get("/api/mine-info").then(({ User: o = null }) => (window.localStorage.setItem(ot, R.encode({ ...o, iat: r })), o));
} catch (n) { } catch (n) {
console.error(n), t && Popup.error("请登录").then(logout); console.error(n), t && Popup.error("请登录").then(logout);
} }
return Promise.resolve(null); return Promise.resolve(null);
}); });
k(this, "login", (t, a, n = {}) => T.post("/api/user-token", { username: t, passwd: Ua.hash(a), platform: "web", ...n }).then(({ token: r }) => (window.localStorage.setItem(_e, r), r))); k(this, "login", (t, a, n = {}) => R.post("/api/user-token", { username: t, passwd: Ua.hash(a), platform: "web", ...n }).then(({ token: r }) => (window.localStorage.setItem(_e, r), r)));
k(this, "logout", () => { k(this, "logout", () => {
window.localStorage.removeItem(ot), window.localStorage.removeItem(_e); window.localStorage.removeItem(ot), window.localStorage.removeItem(_e);
}); });
if (g(ne, ye)) return g(ne, ye); if (g(re, ye)) return g(re, ye);
} }
}; };
ye = new WeakMap(), Ee = new WeakMap(), $(ne, ye, null), k(ne, "getInstance", () => (g(ne, ye) || B(ne, ye, new ne()), g(ne, ye))); ye = new WeakMap(), Ee = new WeakMap(), N(re, ye, null), k(re, "getInstance", () => (g(re, ye) || B(re, ye, new re()), g(re, ye)));
let Ct = ne; let Ct = re;
const X = Ct.getInstance(), On = C.createContext({ user: {}, initUser: () => { const Q = Ct.getInstance(), On = C.createContext({ user: {}, initUser: () => {
}, initUserComplete: !1 }), Ln = C.createContext({ set: () => { }, initUserComplete: !1 }), Ln = C.createContext({ set: () => {
}, get: () => { }, get: () => {
}, assign: () => { }, assign: () => {
@ -894,7 +894,7 @@ const X = Ct.getInstance(), On = C.createContext({ user: {}, initUser: () => {
if (!e || typeof window > "u") return; if (!e || typeof window > "u") return;
let a = document.querySelector(`style[ff-style-token="${t}"]`); 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); 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);
}, An = Object.freeze(Object.defineProperty({ __proto__: null, AppContext: On, AppGlobalParamsContext: Ln, cache: Kt, configure: Oe, default: X, func: Ce, http: T, insertStyle: Vn, isReactComponent: $t, route: oe }, Symbol.toStringTag, { value: "Module" })), jn = (e, t, a = "children") => { }, An = Object.freeze(Object.defineProperty({ __proto__: null, AppContext: On, AppGlobalParamsContext: Ln, cache: Kt, configure: Oe, default: Q, func: Ce, http: R, insertStyle: Vn, isReactComponent: $t, route: le }, Symbol.toStringTag, { value: "Module" })), jn = (e, t, a = "children") => {
if (p.isEmpty(e)) return {}; if (p.isEmpty(e)) return {};
const n = p.find(e, ["value", t]); const n = p.find(e, ["value", t]);
if (!p.isEmpty(n)) return n; if (!p.isEmpty(n)) return n;
@ -929,25 +929,25 @@ export {
hn as T, hn as T,
ur as U, ur as U,
yt as V, yt as V,
P as W, x as W,
Ha as X, Ha as X,
Sn as Y, Sn as Y,
J as Z, K as Z,
We as _, We as _,
ta as a, ta as a,
H as a0, J as a0,
K as a1, _ as a1,
Zn as a2, Zn as a2,
er as a3, er as a3,
tr as a4, tr as a4,
X as a5, Q as a5,
$t as a6, $t as a6,
Vn as a7, Vn as a7,
T as a8, R as a8,
Kt as a9, Kt as a9,
Oe as aa, Oe as aa,
Ce as ab, Ce as ab,
oe as ac, le as ac,
On as ad, On as ad,
Ln as ae, Ln as ae,
jn as af, jn as af,
@ -969,7 +969,7 @@ export {
Ga as q, Ga as q,
st as r, st as r,
Xa as s, Xa as s,
G as t, Y as t,
ar as u, ar as u,
Ja as v, Ja as v,
nr as w, nr as w,

2
dist/components.js vendored
View File

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

2
dist/container.js vendored
View File

@ -1,4 +1,4 @@
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-CP3X76ta.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-B9_aE5ZC.js";
export { export {
o as Context, o as Context,
s as Empty, s as Empty,

View File

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

2
dist/data-list.js vendored
View File

@ -1,4 +1,4 @@
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-CP3X76ta.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-B9_aE5ZC.js";
export { export {
t as DataListContent, t as DataListContent,
e as DataListContext, e as DataListContext,

View File

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

View File

@ -1,4 +1,4 @@
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-CP3X76ta.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-B9_aE5ZC.js";
export { export {
s as GridLayoutForm, s as GridLayoutForm,
r as GridLayoutFormHelper, r as GridLayoutFormHelper,

View File

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

2
dist/grid-layout.js vendored
View File

@ -1,4 +1,4 @@
import { c as d, d as e, H as i, G as t, e as u, f as o } from "./common/main-CP3X76ta.js"; import { c as d, d as e, H as i, G as t, e as u, f as o } from "./common/main-B9_aE5ZC.js";
export { export {
d as GridLayout, d as GridLayout,
e as GridLayoutWidget, e as GridLayoutWidget,

View File

@ -1,4 +1,4 @@
import { a as t } from "../common/main-CP3X76ta.js"; import { a as t } from "../common/main-B9_aE5ZC.js";
export { export {
t as getBoxStyle t as getBoxStyle
}; };

2
dist/hooks.js vendored
View File

@ -1,7 +1,7 @@
import "lodash"; import "lodash";
import "rc-field-form"; import "rc-field-form";
import "react"; import "react";
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-CP3X76ta.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-B9_aE5ZC.js";
import { default as E } from "rc-util/lib/hooks/useMergedState"; import { default as E } from "rc-util/lib/hooks/useMergedState";
export { export {
r as useDeepEffect, r as useDeepEffect,

2
dist/iconfont.js vendored
View File

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

2
dist/index.js vendored
View File

@ -1,4 +1,4 @@
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-CP3X76ta.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-B9_aE5ZC.js";
export { export {
t as AppContext, t as AppContext,
e as AppGlobalParamsContext, e as AppGlobalParamsContext,

2
dist/res-ws.js vendored
View File

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

2
dist/utils.js vendored
View File

@ -1,5 +1,5 @@
import "lodash"; import "lodash";
import { g as r, r as i, t as s, u as o } from "./common/main-CP3X76ta.js"; import { g as r, r as i, t as s, u as o } from "./common/main-B9_aE5ZC.js";
export { export {
r as getWidgetPropsData, r as getWidgetPropsData,
i as replaceKeys, i as replaceKeys,

View File

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