v0.4.4
This commit is contained in:
parent
5c0a398209
commit
4028d8cd04
2
dist/button.js
vendored
2
dist/button.js
vendored
@ -1,4 +1,4 @@
|
||||
import { P as s, O as u, Q as e } from "./common/main-BWGhrIEF.js";
|
||||
import { P as s, O as u, Q as e } from "./common/main-BHLR5OFm.js";
|
||||
import "prop-types";
|
||||
export {
|
||||
s as auth,
|
||||
|
@ -4,17 +4,17 @@ var Nt = (e) => {
|
||||
};
|
||||
var pa = (e, t, a) => t in e ? ga(e, t, { enumerable: !0, configurable: !0, writable: !0, value: a }) : e[t] = a;
|
||||
var v = (e, t, a) => pa(e, typeof t != "symbol" ? t + "" : t, a), xt = (e, t, a) => t.has(e) || Nt("Cannot " + a);
|
||||
var p = (e, t, a) => (xt(e, t, "read from private field"), a ? a.call(e) : t.get(e)), F = (e, t, a) => t.has(e) ? Nt("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, a), z = (e, t, a, n) => (xt(e, t, "write to private field"), n ? n.call(e, a) : t.set(e, a), a);
|
||||
var p = (e, t, a) => (xt(e, t, "read from private field"), a ? a.call(e) : t.get(e)), F = (e, t, a) => t.has(e) ? Nt("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, a), B = (e, t, a, n) => (xt(e, t, "write to private field"), n ? n.call(e, a) : t.set(e, a), a);
|
||||
var Et = (e, t, a, n) => ({
|
||||
set _(i) {
|
||||
z(e, t, i, a);
|
||||
B(e, t, i, a);
|
||||
},
|
||||
get _() {
|
||||
return p(e, t, n);
|
||||
}
|
||||
});
|
||||
import { jsx as c, jsxs as $ } from "react/jsx-runtime";
|
||||
import b, { useEffect as N, useState as P, useCallback as ge, useMemo as pe, useContext as Ge, useRef as Y, useId as Dt, useLayoutEffect as ma } from "react";
|
||||
import b, { useEffect as N, useState as P, useCallback as ge, useMemo as pe, useContext as Ge, useRef as Q, useId as Dt, useLayoutEffect as ma } from "react";
|
||||
import g from "lodash";
|
||||
import R from "classnames";
|
||||
import { Form as Ze, Input as ha, Button as lt, Breadcrumb as fa, Tree as ya, Pagination as wa, Table as ba, Empty as Ca, Popconfirm as va, Tooltip as ka, Popover as Sa } from "antd";
|
||||
@ -56,7 +56,7 @@ class Jt {
|
||||
v(this, "get", (...t) => new Promise((a, n) => {
|
||||
const i = JSON.stringify(t);
|
||||
if (p(this, Ie).has(i)) return a(p(this, Re).call(this, p(this, de), ...t));
|
||||
if (p(this, de) === void 0) p(this, Ae).push([t, a, n]), p(this, qe) && (z(this, qe, !1), Promise.resolve(typeof p(this, Fe) == "function" ? p(this, Fe).call(this) : p(this, Fe)).then((r) => z(this, de, r || null)).finally(() => {
|
||||
if (p(this, de) === void 0) p(this, Ae).push([t, a, n]), p(this, qe) && (B(this, qe, !1), Promise.resolve(typeof p(this, Fe) == "function" ? p(this, Fe).call(this) : p(this, Fe)).then((r) => B(this, de, r || null)).finally(() => {
|
||||
p(this, Ae).forEach(([r, s, o]) => {
|
||||
try {
|
||||
const l = p(this, Re).call(this, p(this, de), ...r);
|
||||
@ -71,36 +71,36 @@ class Jt {
|
||||
p(this, Ie).set(i, r), a(r);
|
||||
}
|
||||
}));
|
||||
z(this, Re, a), z(this, Fe, t);
|
||||
B(this, Re, a), B(this, Fe, t);
|
||||
}
|
||||
}
|
||||
Ie = new WeakMap(), qe = new WeakMap(), Ae = new WeakMap(), de = new WeakMap(), Fe = new WeakMap(), Re = new WeakMap();
|
||||
const Dn = () => c("div", { children: "Empty" }), _e = b.createContext({ ele: {}, mount: () => {
|
||||
}, unmount: () => {
|
||||
} }), q = ({ rootClassName: e, className: t, children: a, actions: n, title: i, subTitle: r, extras: s, style: o = {} }) => {
|
||||
} }), H = ({ rootClassName: e, className: t, children: a, actions: n, title: i, subTitle: r, extras: s, style: o = {} }) => {
|
||||
const { mount: l, unmount: u } = b.useContext(_e);
|
||||
return n && q.Action({ children: n }), i && q.Title({ children: i }), r && q.SubTitle({ children: r }), s && q.Extra({ children: s }), N(() => (l("rootClassName", e), () => u(e)), [e]), c("div", { className: R("ff-container", t), style: o, children: a });
|
||||
return n && H.Action({ children: n }), i && H.Title({ children: i }), r && H.SubTitle({ children: r }), s && H.Extra({ children: s }), N(() => (l("rootClassName", e), () => u(e)), [e]), c("div", { className: R("ff-container", t), style: o, children: a });
|
||||
}, Xe = (e) => ({ children: t, className: a }) => {
|
||||
const { mount: n, unmount: i } = b.useContext(_e);
|
||||
return N(() => (n(e, b.createElement("div", { key: `ff-${e}`, className: R(`ff-popup-${e}`, a) }, t)), () => i(e)), [a, t]), null;
|
||||
};
|
||||
q.Action = Xe("actions"), q.Title = Xe("title"), q.SubTitle = Xe("sub-title"), q.Extra = Xe("extras"), q.propTypes = { className: O.string, style: O.object, title: O.any, subTitle: O.any, actions: O.any, extras: O.any };
|
||||
const Wn = () => c(q, { className: "ff-loading", children: $("div", { className: "loader", children: [$("div", { className: "square", children: [c("span", {}), c("span", {}), c("span", {})] }), $("div", { className: "square", children: [c("span", {}), c("span", {}), c("span", {})] }), $("div", { className: "square", children: [c("span", {}), c("span", {}), c("span", {})] }), $("div", { className: "square", children: [c("span", {}), c("span", {}), c("span", {})] })] }) }), qn = () => c("div", { children: "NotFound" }), Kt = ({ children: e }) => {
|
||||
H.Action = Xe("actions"), H.Title = Xe("title"), H.SubTitle = Xe("sub-title"), H.Extra = Xe("extras"), H.propTypes = { className: O.string, style: O.object, title: O.any, subTitle: O.any, actions: O.any, extras: O.any };
|
||||
const Wn = () => c(H, { className: "ff-loading", children: $("div", { className: "loader", children: [$("div", { className: "square", children: [c("span", {}), c("span", {}), c("span", {})] }), $("div", { className: "square", children: [c("span", {}), c("span", {}), c("span", {})] }), $("div", { className: "square", children: [c("span", {}), c("span", {}), c("span", {})] }), $("div", { className: "square", children: [c("span", {}), c("span", {}), c("span", {})] })] }) }), qn = () => c("div", { children: "NotFound" }), Kt = ({ children: e }) => {
|
||||
const [t, a] = P({}), n = ge((r, s) => a((o) => ({ ...o, [r]: s })), []), i = ge((r) => a((s) => ({ ...s, [r]: void 0 })), []);
|
||||
return typeof (e == null ? void 0 : e.type) == "string" ? e : c(_e.Provider, { value: { ele: t, mount: n, unmount: i }, children: b.cloneElement(e, { className: t.rootClassName, title: t.title, subTitle: t["sub-title"], actions: t.actions, extras: t.extras }) });
|
||||
};
|
||||
Kt.propTypes = { children: O.element.isRequired };
|
||||
const Rt = { close: ["M563.8 512l262.5-312.9c4.4-5.2 0.7-13.1-6.1-13.1h-79.8c-4.7 0-9.2 2.1-12.3 5.7L511.6 449.8 295.1 191.7c-3-3.6-7.5-5.7-12.3-5.7H203c-6.8 0-10.5 7.9-6.1 13.1L459.4 512 196.9 824.9c-4.4 5.2-0.7 13.1 6.1 13.1h79.8c4.7 0 9.2-2.1 12.3-5.7l216.5-258.1 216.5 258.1c3 3.6 7.5 5.7 12.3 5.7h79.8c6.8 0 10.5-7.9 6.1-13.1L563.8 512z"], check: ["M912 190h-69.9c-9.8 0-19.1 4.5-25.1 12.2L404.7 724.5 207 474c-6.1-7.7-15.3-12.2-25.1-12.2H112c-6.7 0-10.4 7.7-6.3 12.9l273.9 347c12.8 16.2 37.4 16.2 50.3 0l488.4-618.9c4.1-5.1 0.4-12.8-6.3-12.8z"], info: ["M512 224m-64 0a64 64 0 1 0 128 0 64 64 0 1 0-128 0Z", "M544 392h-64c-4.4 0-8 3.6-8 8v464c0 4.4 3.6 8 8 8h64c4.4 0 8-3.6 8-8V400c0-4.4-3.6-8-8-8z"] }, Ct = ({ type: e, props: t }) => c("i", { ...t, children: c("svg", { viewBox: "0 0 1024 1024", width: "1em", height: "1em", fill: "currentColor", children: (Rt[e] || Rt.info).map((a, n) => c("path", { d: a }, n)) }) }), Gt = ({ className: e, content: t, icon: a, $close: n }) => $(b.Fragment, { children: [a && c("div", { className: R("ff-notification-icon", e), children: c(Ct, { type: a }) }), t] }), ja = ({}) => c(q, { children: "Confirm" });
|
||||
const Rt = { close: ["M563.8 512l262.5-312.9c4.4-5.2 0.7-13.1-6.1-13.1h-79.8c-4.7 0-9.2 2.1-12.3 5.7L511.6 449.8 295.1 191.7c-3-3.6-7.5-5.7-12.3-5.7H203c-6.8 0-10.5 7.9-6.1 13.1L459.4 512 196.9 824.9c-4.4 5.2-0.7 13.1 6.1 13.1h79.8c4.7 0 9.2-2.1 12.3-5.7l216.5-258.1 216.5 258.1c3 3.6 7.5 5.7 12.3 5.7h79.8c6.8 0 10.5-7.9 6.1-13.1L563.8 512z"], check: ["M912 190h-69.9c-9.8 0-19.1 4.5-25.1 12.2L404.7 724.5 207 474c-6.1-7.7-15.3-12.2-25.1-12.2H112c-6.7 0-10.4 7.7-6.3 12.9l273.9 347c12.8 16.2 37.4 16.2 50.3 0l488.4-618.9c4.1-5.1 0.4-12.8-6.3-12.8z"], info: ["M512 224m-64 0a64 64 0 1 0 128 0 64 64 0 1 0-128 0Z", "M544 392h-64c-4.4 0-8 3.6-8 8v464c0 4.4 3.6 8 8 8h64c4.4 0 8-3.6 8-8V400c0-4.4-3.6-8-8-8z"] }, Ct = ({ type: e, props: t }) => c("i", { ...t, children: c("svg", { viewBox: "0 0 1024 1024", width: "1em", height: "1em", fill: "currentColor", children: (Rt[e] || Rt.info).map((a, n) => c("path", { d: a }, n)) }) }), Gt = ({ className: e, content: t, icon: a, $close: n }) => $(b.Fragment, { children: [a && c("div", { className: R("ff-notification-icon", e), children: c(Ct, { type: a }) }), t] }), ja = ({}) => c(H, { children: "Confirm" });
|
||||
var fe, Me;
|
||||
const ee = class ee {
|
||||
constructor() {
|
||||
F(this, Me, null);
|
||||
v(this, "init", (t) => z(this, Me, new Map(t)));
|
||||
v(this, "init", (t) => B(this, Me, new Map(t)));
|
||||
v(this, "check", (t) => !p(this, Me).has(t) || p(this, Me).get(t));
|
||||
if (p(ee, fe)) return p(ee, fe);
|
||||
}
|
||||
};
|
||||
fe = new WeakMap(), Me = new WeakMap(), F(ee, fe, null), v(ee, "getInstance", () => (p(ee, fe) || z(ee, fe, new ee()), p(ee, fe)));
|
||||
fe = new WeakMap(), Me = new WeakMap(), F(ee, fe, null), v(ee, "getInstance", () => (p(ee, fe) || B(ee, fe, new ee()), p(ee, fe)));
|
||||
let dt = ee;
|
||||
const Ia = dt.getInstance(), _t = (e = {}, t = {}, a = {}, n = "") => g.deepSome(e, (i, r) => r === "type" && i === "code") ? Yt(e, t, a, n) : Qt(e, t, n), Yt = async (e = {}, t = {}, a = {}, n = "") => {
|
||||
let i = /* @__PURE__ */ Object.create(null);
|
||||
@ -153,15 +153,15 @@ var ye, He;
|
||||
const te = class te {
|
||||
constructor() {
|
||||
F(this, He, null);
|
||||
v(this, "init", (t) => z(this, He, t));
|
||||
v(this, "init", (t) => B(this, He, t));
|
||||
v(this, "get", (t, a) => g.get(p(this, He), t, a));
|
||||
if (p(te, ye)) return p(te, ye);
|
||||
}
|
||||
};
|
||||
ye = new WeakMap(), He = new WeakMap(), F(te, ye, null), v(te, "getInstance", () => (p(te, ye) || z(te, ye, new te()), p(te, ye)));
|
||||
ye = new WeakMap(), He = new WeakMap(), F(te, ye, null), v(te, "getInstance", () => (p(te, ye) || B(te, ye, new te()), p(te, ye)));
|
||||
let ut = te;
|
||||
const De = ut.getInstance(), Aa = (e, t, a, n, i) => {
|
||||
const r = b.lazy(() => Q.getWidgetComponent(e).catch((s) => ({ default: () => `${s}` })));
|
||||
const r = b.lazy(() => X.getWidgetComponent(e).catch((s) => ({ default: () => `${s}` })));
|
||||
return c(b.Suspense, { children: c(r, { value: t, record: a, $setting: n, base62params: i }) }, e);
|
||||
}, Ma = (e, t = {}) => (jt(e), jt(t), pe(() => e == null ? void 0 : e.map(({ widgetByJs: a, widgetByJsSetting: n, ...i }, r) => a && !a.endsWith("/BasicShowFieldData") ? { ...i, render: (s, o) => {
|
||||
const l = Aa(a, s, o, n, t);
|
||||
@ -170,25 +170,25 @@ const De = ut.getInstance(), Aa = (e, t, a, n, i) => {
|
||||
const [t, a] = P({});
|
||||
return N(() => {
|
||||
let n = !1;
|
||||
return e && E.get(`/api/_/${e}`).then((i) => g.pick(i, ["uuid", "name", "code", "resource", "marginX", "marginY", "cols", "rowHeight", "primaryKey", "columns", "itemOperations", "batchOperations", "isConditionFormLayout", "layout", "tabs", "pageSize", "layoutConfig"])).then((i) => !n && a(i)), () => n = !0;
|
||||
return e && x.get(`/api/_/${e}`).then((i) => g.pick(i, ["uuid", "name", "code", "resource", "marginX", "marginY", "cols", "rowHeight", "primaryKey", "columns", "itemOperations", "batchOperations", "isConditionFormLayout", "layout", "tabs", "pageSize", "layoutConfig"])).then((i) => !n && a(i)), () => n = !0;
|
||||
}, [e]), t;
|
||||
}, Jn = (e, t = {}) => {
|
||||
const [a, n] = P({ dataSource: [] });
|
||||
return Ye(() => {
|
||||
let i = !1;
|
||||
return e && E.get(`/api/${e}/${E.encode({ page: 1, ...t })}`).then((r) => !i && n(r)), () => i = !0;
|
||||
return e && x.get(`/api/${e}/${x.encode({ page: 1, ...t })}`).then((r) => !i && n(r)), () => i = !0;
|
||||
}, [e, t]), a;
|
||||
}, gt = (e, t = null, a = null, n = "id") => pe(() => {
|
||||
if (g.isEmpty(e) || !e.every(({ uuid: r }) => Ia.check(r))) return !1;
|
||||
if (g.isEmpty(a) || g.isEmpty(t)) return !0;
|
||||
const i = t.map((r) => r == null ? void 0 : r[n]);
|
||||
return e.some(({ uuid: r }) => !r || !a.has(r) || a.get(r).some((s) => i.includes(s)));
|
||||
}, [e, t, a, n]), za = ({ className: e, itemClassName: t, classNames: a = {}, dataSource: n, isPaginate: i, isItemOperations: r, isBatchOperations: s, batchOperations: o, itemOperations: l, itemOperationsAccess: u, resource: d, primaryKey: m, title: y, itemGridLayout: h, $setting: f, tabs: C, isConditionFormLayout: w, isTreeSider: x, treeSiderConfig: I }) => {
|
||||
const { getBase62params: B, onClickCallback: X, onTabChange: G } = Ge(Le), { total: A, page: D, pageSize: H, tab: M } = B() || {}, J = ge((V, k, se) => c(Ba, { className: R("ff-data-list-framework-item", t), operations: r && k ? l == null ? void 0 : l.filter((L) => !(m && L.uuid && u.has(L.uuid)) || u.get(L.uuid).includes(k == null ? void 0 : k[m])) : [], data: d ? { [d]: k } : k, children: V, onClickCallback: X }), [d, m, r, X, l, u]);
|
||||
return $("div", { className: R("ff-data-list-framework", e), children: [c(ta, { className: a == null ? void 0 : a.sider, isTreeSider: x, ...I }), $("div", { className: R("ff-data-list-container", a == null ? void 0 : a.container), children: [c(kt, { className: a == null ? void 0 : a.filter, isConditionFormLayout: w }), c(ea, { title: y, className: a == null ? void 0 : a.toolbar, tabs: C, tab: M, onTabChange: G }), c(Ya, { ...h, className: a == null ? void 0 : a.content, style: { "--col-num": (f == null ? void 0 : f.colNum) || 1 }, primaryKey: m, itemRender: J, dataSource: n }), c(aa, { className: a == null ? void 0 : a.footer, isPaginate: i, isOperations: s, operations: o, total: A, page: D, pageSize: H })] })] });
|
||||
}, Ba = ({ className: e, operations: t, children: a, data: n, onClickCallback: i }) => $("div", { className: R("data-list-grid-layout-item-container", e), children: [a, !!(t != null && t.length) && c("div", { className: "data-list-grid-layout-item-actions", children: t.map((r) => c("span", { className: "data-list-grid-layout-item-action", children: c(S.Link, { uuid: r.uuid, type: r.type, name: r.name, widget: r.widget, widgetType: r.widgetType, widgetProps: r.widgetProps, widgetSetting: r.widgetSetting, widgetContainerProps: r.widgetContainerSetting, data: n, onAfterClick: (s) => s !== !1 && (i == null ? void 0 : i(r.isRefresh, n)) }, r.uuid || useId()) }, (r == null ? void 0 : r.uuid) || useId())) })] }), Ua = ({ listCode: e, className: t, classNames: a = {}, itemClassName: n, dataSource: i, columns: r, isItemOperations: s, isBatchOperations: o, batchOperations: l, itemOperations: u, itemOperationsAccess: d, resource: m, primaryKey: y, title: h, tabs: f, isPaginate: C, isTreeSider: w, treeSiderConfig: x, isConditionFormLayout: I, ...B }) => {
|
||||
const { getBase62params: X, onClickCallback: G, onTabChange: A } = Ge(Le), { total: D, page: H, tab: M, pageSize: J } = X() || {}, V = gt(u, i, d, y);
|
||||
return $("div", { className: R("ff-data-table-framework", t), children: [c(ta, { className: a == null ? void 0 : a.sider, isTreeSider: w, ...x }), $("div", { className: R("ff-data-table-container", a == null ? void 0 : a.container), children: [c(kt, { listCode: e, isConditionFormLayout: I }), c(ea, { title: h, className: a == null ? void 0 : a.toolbar, tabs: f, tab: M, onTabChange: A }), c(Ha, { ...B, className: "ff-data-table-content", columns: r, dataSource: i, operationRender: V ? (k) => c("div", { className: "ff-data-table-actions", children: u == null ? void 0 : u.reduce((se, L, me) => [...se, c(S.Link, { size: "small", uuid: L.uuid, type: L.type, name: L.name, widget: L.widget, widgetType: L.widgetType, widgetProps: L.widgetProps, widgetData: L.widgetData, widgetSetting: L.widgetSetting, widgetContainerProps: L.widgetContainerSetting, data: k, onAfterClick: (Ne) => Ne !== !1 && (G == null ? void 0 : G(L.isRefresh, data)) }, L.uuid || me)], []) }) : null }), c(aa, { isPaginate: C, isOperations: o, operations: l, total: D, page: H, pageSize: J })] })] });
|
||||
}, [e, t, a, n]), za = ({ className: e, itemClassName: t, classNames: a = {}, dataSource: n, isPaginate: i, isItemOperations: r, isBatchOperations: s, batchOperations: o, itemOperations: l, itemOperationsAccess: u, resource: d, primaryKey: m, title: y, itemGridLayout: h, $setting: f, tabs: C, isConditionFormLayout: w, isTreeSider: E, treeSiderConfig: A }) => {
|
||||
const { getBase62params: J, onClickCallback: W, onTabChange: I } = Ge(Le), { total: M, page: D, pageSize: K, tab: z } = J() || {}, G = ge((V, k, se) => c(Ba, { className: R("ff-data-list-framework-item", t), operations: r && k ? l == null ? void 0 : l.filter((L) => !(m && L.uuid && u.has(L.uuid)) || u.get(L.uuid).includes(k == null ? void 0 : k[m])) : [], data: d ? { [d]: k } : k, children: V, onClickCallback: W }), [d, m, r, W, l, u]);
|
||||
return $("div", { className: R("ff-data-list-framework", e), children: [c(ta, { className: a == null ? void 0 : a.sider, isTreeSider: E, ...A }), $("div", { className: R("ff-data-list-container", a == null ? void 0 : a.container), children: [c(kt, { className: a == null ? void 0 : a.filter, isConditionFormLayout: w }), c(ea, { title: y, className: a == null ? void 0 : a.toolbar, tabs: C, tab: z, onTabChange: I }), c(Ya, { ...h, className: a == null ? void 0 : a.content, style: { "--col-num": (f == null ? void 0 : f.colNum) || 1 }, primaryKey: m, itemRender: G, dataSource: n }), c(aa, { className: a == null ? void 0 : a.footer, isPaginate: i, isOperations: s, operations: o, total: M, page: D, pageSize: K })] })] });
|
||||
}, Ba = ({ className: e, operations: t, children: a, data: n, onClickCallback: i }) => $("div", { className: R("data-list-grid-layout-item-container", e), children: [a, !!(t != null && t.length) && c("div", { className: "data-list-grid-layout-item-actions", children: t.map((r) => c("span", { className: "data-list-grid-layout-item-action", children: c(S.Link, { uuid: r.uuid, type: r.type, name: r.name, widget: r.widget, widgetType: r.widgetType, widgetProps: r.widgetProps, widgetSetting: r.widgetSetting, widgetContainerProps: r.widgetContainerSetting, data: n, onAfterClick: (s) => s !== !1 && (i == null ? void 0 : i(r.isRefresh, n)) }, r.uuid || useId()) }, (r == null ? void 0 : r.uuid) || useId())) })] }), Ua = ({ listCode: e, className: t, classNames: a = {}, itemClassName: n, dataSource: i, columns: r, isItemOperations: s, isBatchOperations: o, batchOperations: l, itemOperations: u, itemOperationsAccess: d, resource: m, primaryKey: y, title: h, tabs: f, isPaginate: C, isTreeSider: w, treeSiderConfig: E, isConditionFormLayout: A, ...J }) => {
|
||||
const { getBase62params: W, onClickCallback: I, onTabChange: M } = Ge(Le), { total: D, page: K, tab: z, pageSize: G } = W() || {}, V = gt(u, i, d, y);
|
||||
return $("div", { className: R("ff-data-table-framework", t), children: [c(ta, { className: a == null ? void 0 : a.sider, isTreeSider: w, ...E }), $("div", { className: R("ff-data-table-container", a == null ? void 0 : a.container), children: [c(kt, { listCode: e, isConditionFormLayout: A }), c(ea, { title: h, className: a == null ? void 0 : a.toolbar, tabs: f, tab: z, onTabChange: M }), c(Ha, { ...J, className: "ff-data-table-content", columns: r, dataSource: i, operationRender: V ? (k) => c("div", { className: "ff-data-table-actions", children: u == null ? void 0 : u.reduce((se, L, me) => [...se, c(S.Link, { size: "small", uuid: L.uuid, type: L.type, name: L.name, widget: L.widget, widgetType: L.widgetType, widgetProps: L.widgetProps, widgetData: L.widgetData, widgetSetting: L.widgetSetting, widgetContainerProps: L.widgetContainerSetting, data: k, onAfterClick: (Ne) => Ne !== !1 && (I == null ? void 0 : I(L.isRefresh, data)) }, L.uuid || me)], []) }) : null }), c(aa, { isPaginate: C, isOperations: o, operations: l, total: D, page: K, pageSize: G })] })] });
|
||||
}, Le = b.createContext({ listCode: "", getBase62params: (e, t) => {
|
||||
}, onReload: () => {
|
||||
}, onClickCallback: () => {
|
||||
@ -201,7 +201,7 @@ const De = ut.getInstance(), Aa = (e, t, a, n, i) => {
|
||||
} }), Da = ({ isItemGridLayout: e, theme: t, themeProps: a, onClickCallback: n, onReload: i, getBase62params: r, listCode: s, onPageChange: o, onPageSizeChange: l, onTabChange: u, onSiderChange: d, onKeywordChange: m, onConditonChange: y, ...h }) => {
|
||||
const [f, C] = P();
|
||||
return N(() => {
|
||||
t ? Q.getWidgetComponent(t).then((w) => {
|
||||
t ? X.getWidgetComponent(t).then((w) => {
|
||||
if (!w) throw `${t} not found`;
|
||||
return w;
|
||||
}).catch((w) => ({ default: () => `${w}` })).then((w) => C(b.createElement(w.default, { ...h, $setting: a }))) : f || C(null);
|
||||
@ -214,13 +214,13 @@ const ae = class ae {
|
||||
F(this, Oe, /* @__PURE__ */ new Map());
|
||||
F(this, at, () => {
|
||||
if (p(this, ue)) return p(this, ue).port.postMessage({ command: "status", data: [] });
|
||||
z(this, ue, new SharedWorker(new URL("/ff-worker/res-ws.js", self.location))), p(this, ue).port.onmessage = (t) => {
|
||||
B(this, ue, new SharedWorker(new URL("/ff-worker/res-ws.js", self.location))), p(this, ue).port.onmessage = (t) => {
|
||||
var a, n;
|
||||
(a = t.data) != null && a.uuid ? p(this, Oe).forEach((i, r) => {
|
||||
var s;
|
||||
(i == "*" || (s = i == null ? void 0 : i.includes) != null && s.call(i, t.data.uuid)) && r(t.data);
|
||||
}) : ((n = t.data) == null ? void 0 : n.readyState) == WebSocket.CLOSED && E.get("/api/user-api-token").then(({ token: i, expire_at: r }) => {
|
||||
p(this, ue).port.postMessage({ command: "initWs", data: [`ws${g.trimStart(E.appUrl, "http")}api/user-resource-status-ws?token=${i}`] });
|
||||
}) : ((n = t.data) == null ? void 0 : n.readyState) == WebSocket.CLOSED && x.get("/api/user-api-token").then(({ token: i, expire_at: r }) => {
|
||||
p(this, ue).port.postMessage({ command: "initWs", data: [`ws${g.trimStart(x.appUrl, "http")}api/user-resource-status-ws?token=${i}`] });
|
||||
});
|
||||
}, p(this, ue).port.postMessage({ command: "status", data: [] });
|
||||
});
|
||||
@ -229,17 +229,17 @@ const ae = class ae {
|
||||
if (p(ae, we)) return p(ae, we);
|
||||
}
|
||||
};
|
||||
we = new WeakMap(), ue = new WeakMap(), Oe = new WeakMap(), at = new WeakMap(), F(ae, we, null), v(ae, "getInstance", () => (p(ae, we) || z(ae, we, new ae()), p(ae, we)));
|
||||
we = new WeakMap(), ue = new WeakMap(), Oe = new WeakMap(), at = new WeakMap(), F(ae, we, null), v(ae, "getInstance", () => (p(ae, we) || B(ae, we, new ae()), p(ae, we)));
|
||||
let pt = ae;
|
||||
const Xt = pt.getInstance(), vt = b.forwardRef(({ listCode: e, base62params: t, className: a, itemClassName: n, theme: i, themeProps: r, classNames: s }, o) => {
|
||||
const l = oa(), u = Y(t), d = Y(/* @__PURE__ */ new Map()), m = Y([]), [{ resource: y, primaryKey: h, batchOperations: f = [], itemOperations: C = [], columns: w = [], themeConfig: x, theme: I, isConditionFormLayout: B = !1, isTreeSider: X, treeSiderConfig: G, isItemGridLayout: A, itemGridLayout: D, title: H, isPaginate: M, tabs: J }, V] = P({ isItemGridLayout: !1, itemGridLayout: {} }), k = g.throttle((T) => {
|
||||
m.current = [], E.list(e, g.pick({ ...u.current, ...T }, ["tab", "page", "pageSize", "condition", "sider", "keyword"])).then(({ keyword: U, condition: Ve, total: xe, tab: he, sider: Ee, page: oe, pageSize: le, operationsAccess: ce, dataSource: Te }) => {
|
||||
const l = oa(), u = Q(t), d = Q(/* @__PURE__ */ new Map()), m = Q([]), [{ resource: y, primaryKey: h, batchOperations: f = [], itemOperations: C = [], columns: w = [], themeConfig: E, theme: A, isConditionFormLayout: J = !1, isTreeSider: W, treeSiderConfig: I, isItemGridLayout: M, itemGridLayout: D, title: K, isPaginate: z, tabs: G }, V] = P({ isItemGridLayout: !1, itemGridLayout: {} }), k = g.throttle((T) => {
|
||||
m.current = [], x.list(e, g.pick({ ...u.current, ...T }, ["tab", "page", "pageSize", "condition", "sider", "keyword"])).then(({ keyword: U, condition: Ve, total: xe, tab: he, sider: Ee, page: oe, pageSize: le, operationsAccess: ce, dataSource: Te }) => {
|
||||
u.current = { tab: he, condition: Ve, sider: Ee, keyword: U, total: xe, pageSize: le, page: Te != null && Te.length ? oe : 1 }, m.current = Te, d.current = new Map(ce), l();
|
||||
});
|
||||
}, 380, { leading: !1, trailing: !0 }), se = gt(C, m.current, d.current, h), L = gt(f);
|
||||
N(() => {
|
||||
let T = null;
|
||||
return e && E.get(`/api/_/${e}`).resp(({ data: U, res: Ve }) => {
|
||||
return e && x.get(`/api/_/${e}`).resp(({ data: U, res: Ve }) => {
|
||||
U != null && U.isDynamicRefresh && (T = Xt.subscribe(() => k(), Ve)), u.current.pageSize = U.pageSize, V(U);
|
||||
}).catch(() => V({})), () => T == null ? void 0 : T();
|
||||
}, [e]), tn(() => {
|
||||
@ -250,10 +250,10 @@ const Xt = pt.getInstance(), vt = b.forwardRef(({ listCode: e, base62params: t,
|
||||
}, Ne = (T = 0, U = null) => {
|
||||
if (T === 2) {
|
||||
const Ve = g.get(U, "__PARENT_ID__", ""), xe = g.get(U, h, g.get(U, [y, h], "")), he = g.findIndex(m.current, ["__PARENT_ID__", Ve]), Ee = g.findIndex(he > -1 ? g.get(m.current, [he, "children"]) : m.current, [h, xe]);
|
||||
Ee > -1 ? (E.get(`/api/${e}/detail/${xe}`).then((oe) => {
|
||||
Ee > -1 ? (x.get(`/api/${e}/detail/${xe}`).then((oe) => {
|
||||
const le = g.get(m.current, he > -1 ? [he, "children", Ee, "children"] : [Ee, "children"]);
|
||||
m.current = Tt(m.current, he > -1 ? { [he]: { children: { $splice: [[Ee, 1, { ...oe, children: le }]] } } } : { $splice: [[Ee, 1, { ...oe, children: le }]] }), l();
|
||||
}), E.post(`/api/${e}/list-operations-access`, { ids: xe }).then((oe) => new Map(oe)).then((oe) => {
|
||||
}), x.post(`/api/${e}/list-operations-access`, { ids: xe }).then((oe) => new Map(oe)).then((oe) => {
|
||||
d.current.forEach((le, ce) => {
|
||||
var Te;
|
||||
(Te = oe.get(ce)) != null && Te.some((rt) => rt == xe) || d.current.set(ce, le.filter((rt) => rt !== xe));
|
||||
@ -264,7 +264,7 @@ const Xt = pt.getInstance(), vt = b.forwardRef(({ listCode: e, base62params: t,
|
||||
} else T === 1 && me();
|
||||
};
|
||||
b.useImperativeHandle(o, () => ({ onReload: me, onClickCallback: Ne }));
|
||||
const it = { listCode: e, title: H, itemClassName: n, classNames: s, resource: y, primaryKey: h, theme: i || I, themeProps: r || x, isTreeSider: X, treeSiderConfig: G, isPaginate: M, tabs: J, isItemOperations: se, isBatchOperations: L, batchOperations: f, itemOperations: C, isItemGridLayout: A, columns: w, itemGridLayout: D, isConditionFormLayout: B, itemOperationsAccess: d.current, dataSource: m.current };
|
||||
const it = { listCode: e, title: K, itemClassName: n, classNames: s, resource: y, primaryKey: h, theme: i || A, themeProps: r || E, isTreeSider: W, treeSiderConfig: I, isPaginate: z, tabs: G, isItemOperations: se, isBatchOperations: L, batchOperations: f, itemOperations: C, isItemGridLayout: M, columns: w, itemGridLayout: D, isConditionFormLayout: J, itemOperationsAccess: d.current, dataSource: m.current };
|
||||
return c(Da, { ...it, className: R("ff-data-list-helper", a), getBase62params: (T, U, Ve = !1) => T == "init" ? t : T ? g.get(u.current, T, U) : u.current, onReload: me, onClickCallback: Ne, onConditonChange: (T, U) => k({ keyword: U, condition: Tt(u.current.condition || {}, { $merge: T || {} }), page: 1 }), onTabChange: (T) => k({ tab: T, page: 1 }), onSiderChange: (T) => k({ sider: T, page: 1 }), onKeywordChange: (T) => k({ keyword: T, page: 1 }), onPageChange: (T, U) => k({ page: T, pageSize: U }), onPageSizeChange: (T) => k({ pageSize: T, page: 1 }) });
|
||||
}), Zt = (e, t, a, n, i = {}, r = 0) => {
|
||||
const s = { "--grid-layout-h": `${n}`, "--grid-layout-w": `${a}`, "--grid-layout-x": `${e}`, "--grid-layout-y": `${t}`, "--grid-layout-row-height-offset": "0px" };
|
||||
@ -273,8 +273,8 @@ const Xt = pt.getInstance(), vt = b.forwardRef(({ listCode: e, base62params: t,
|
||||
var m, y;
|
||||
const [a, n] = P({}), { listCode: i, onKeywordChange: r, onConditonChange: s, getBase62params: o } = b.useContext(Le), { keyword: l, condition: u } = o() || {}, [d] = Ze.useForm();
|
||||
return N(() => {
|
||||
i && t && E.get(`/api/_/${i}/list-condition-form-layout`).then(({ resource: h, marginX: f, marginY: C, rowHeight: w, cols: x, fields: I }) => {
|
||||
n({ resource: h, itemMargin: [f, C], rowHeight: w, cols: x, fields: I });
|
||||
i && t && x.get(`/api/_/${i}/list-condition-form-layout`).then(({ resource: h, marginX: f, marginY: C, rowHeight: w, cols: E, fields: A }) => {
|
||||
n({ resource: h, itemMargin: [f, C], rowHeight: w, cols: E, fields: A });
|
||||
}).catch(() => n({}));
|
||||
}, [i, t]), N(() => {
|
||||
d.setFieldsValue({ keyword: l, ...u });
|
||||
@ -298,7 +298,7 @@ const ea = ({ className: e, title: t, tabs: a, tab: n, onTabChange: i }) => {
|
||||
return a && !g.isEmpty(t) || n ? $("div", { className: R("ff-data-list-footer", e), children: [c("div", { className: "ff-data-list-actions", children: t == null ? void 0 : t.map((d, m) => c(S, { uuid: d.uuid, type: d.type, name: d.name, widget: d.widget, widgetType: d.widgetType, widgetProps: d.widgetProps, widgetData: d.widgetData, widgetSetting: d.widgetSetting, widgetContainerProps: d.widgetContainerSetting, onAfterClick: (y) => y !== !1 && (u == null ? void 0 : u(d.isRefresh, null)) }, d.uuid || m)) }), n && c(wa, { size: "small", total: i, pageSize: s, showSizeChanger: !1, showTotal: (d) => `第 ${r} 页 / 总共 ${d} 条`, onChange: o, onShowSizeChange: l })] }) : null;
|
||||
}, na = (e, t, a = !0) => a !== !0 && a-- <= 0 ? [] : g.isArray(e) && !g.isEmpty(e) ? e.reduce((n, i) => (Reflect.has(i, t) && Reflect.has(i, "children") && n.push(i[t]), Reflect.has(i, "children") && !g.isEmpty(i.children) ? n.concat(na(i.children, t, a)) : n), []) : [], Ha = ({ className: e, primaryKey: t, columns: a = [], dataSource: n = [], operationRender: i, operationWidth: r = 180, ...s }) => {
|
||||
Dt();
|
||||
const o = Y(null), l = Y(null), [u, d] = P([]), [m, y] = P({ width: 0, height: 0 });
|
||||
const o = Q(null), l = Q(null), [u, d] = P([]), [m, y] = P({ width: 0, height: 0 });
|
||||
N(() => {
|
||||
d(na(n, t));
|
||||
}, [n, t]), ma(() => {
|
||||
@ -313,15 +313,15 @@ const ea = ({ className: e, title: t, tabs: a, tab: n, onTabChange: i }) => {
|
||||
const h = Ma(a);
|
||||
return c("div", { ref: l, className: R("ff-data-list-table", e), children: m.height ? c(ba, { ...s, ref: o, rowKey: (f) => (f == null ? void 0 : f[t]) ?? Math.random(), columns: h == null ? void 0 : h.concat(i ? [{ title: "操作", align: "center", fixed: "right", width: `${Math.ceil(r / m.width * 100).toFixed(2)}%`, render: (f, C, w) => i(C, w) }] : []), dataSource: n, size: "middle", scroll: { x: "max-content", y: m.height - 50 }, pagination: !1, expandable: { defaultExpandAllRows: !0, expandRowByClick: !0, onExpandedRowsChange: d, expandedRowKeys: u } }) : null });
|
||||
}, Ja = "RC_FORM_INTERNAL_HOOKS", ia = (e, { initialValue: t, initialValueLanguage: a, convertJs: n, convertJsSetting: i, type: r = "string" }, s = null) => {
|
||||
const o = Y(!1), l = Ge($a), [u, d] = P(), [m, y] = P(a != "javascript" && e ? l.getFieldValue(e) : void 0), { registerWatch: h } = l.getInternalHooks(Ja) || {};
|
||||
const o = Q(!1), l = Ge($a), [u, d] = P(), [m, y] = P(a != "javascript" && e ? l.getFieldValue(e) : void 0), { registerWatch: h } = l.getInternalHooks(Ja) || {};
|
||||
return N(() => h == null ? void 0 : h((f, C, w) => {
|
||||
if (!o.current) return;
|
||||
const x = g.get(C, e);
|
||||
g.isEqual(x, m) || y(g.toPrimitive(x, r));
|
||||
const E = g.get(C, e);
|
||||
g.isEqual(E, m) || y(g.toPrimitive(E, r));
|
||||
}), [m]), N(() => {
|
||||
a == "javascript" && t ? $e.exec(t, {}, { getFieldValueForBasicForm: (f) => s ? s.getFieldValue(f) : l.getFieldValue(f), getFieldValue: (f) => l.getFieldValue(f) }).then((f) => y(g.toPrimitive(f, r))).catch((f) => notification.error({ message: `布局数据错误: ${JSON.stringify(f)}` })).finally(() => o.current = !0) : (t && y(g.toPrimitive(t ?? l.getFieldValue(e), r)), o.current = !0);
|
||||
}, [t, a]), Ye(() => {
|
||||
o.current && n && Q.getWidgetComponent(n).then(({ default: f }) => f({ value: m, record: l.getFieldsValue(!0), $setting: i })).then(d).catch((f) => console.error("布局数据转换错误: ", f, n));
|
||||
o.current && n && X.getWidgetComponent(n).then(({ default: f }) => f({ value: m, record: l.getFieldsValue(!0), $setting: i })).then(d).catch((f) => console.error("布局数据转换错误: ", f, n));
|
||||
}, [m, n, i]), [u || m, m];
|
||||
}, ra = (e, t, a = "@pkg/grid-layouts", n = null) => pe(() => {
|
||||
var i;
|
||||
@ -329,7 +329,7 @@ const ea = ({ className: e, title: t, tabs: a, tab: n, onTabChange: i }) => {
|
||||
}, [e]), Ka = ({ itemWidget: e, itemWidgetRender: t, basicForm: a, ...n }) => {
|
||||
const [i, r] = P();
|
||||
return N(() => {
|
||||
Q.getWidgetComponent(e).then(({ defaultProps: s = {}, default: o }) => {
|
||||
X.getWidgetComponent(e).then(({ defaultProps: s = {}, default: o }) => {
|
||||
r(b.createElement(t(o, s, a), n));
|
||||
}).catch((s) => {
|
||||
console.error(s), r(e);
|
||||
@ -346,14 +346,14 @@ const ea = ({ className: e, title: t, tabs: a, tab: n, onTabChange: i }) => {
|
||||
}, Kn = (Lt = sa, function({ code: e, data: t, ...a }) {
|
||||
const [n, i] = P({ resource: null, cols: 12, rowHeight: 21, fields: [] });
|
||||
return N(() => {
|
||||
e && E.get(`/api/_/${e}`).then((r) => i(g.pick(r, ["resource", "cols", "rowHeight", "fields"])));
|
||||
e && x.get(`/api/_/${e}`).then((r) => i(g.pick(r, ["resource", "cols", "rowHeight", "fields"])));
|
||||
}, [e]), (n == null ? void 0 : n.resource) && c(Lt, { ...a, rowHeight: n.rowHeight, cols: n.cols, fields: n.fields, data: n != null && n.resource ? { [n == null ? void 0 : n.resource]: t } : {} });
|
||||
});
|
||||
var Lt;
|
||||
const Gn = ({ widget: e, widgetPrefix: t = "@pkg/grid-layouts", basicForm: a, ...n }) => {
|
||||
const i = e != null && e.startsWith("@") ? e : `${t}/${e}`, [r, s] = P();
|
||||
return N(() => {
|
||||
i && Q.getWidgetComponent(i).then(({ defaultProps: o = {}, default: l }) => ({ default: _a(l, o, a) })).catch((o) => ({ default: () => `${o}` })).then((o) => s(b.createElement(o.default, n)));
|
||||
i && X.getWidgetComponent(i).then(({ defaultProps: o = {}, default: l }) => ({ default: _a(l, o, a) })).catch((o) => ({ default: () => `${o}` })).then((o) => s(b.createElement(o.default, n)));
|
||||
}, [i]), r;
|
||||
}, _a = (e, t = {}, a = null) => (n) => {
|
||||
const { code: i, label: r, extras: s, isVirtual: o, initialValue: l, initialValueLanguage: u, convertJs: d, convertJsSetting: m, value: y, ...h } = g.merge({}, t, n), [f, C] = ia(o ? null : i, { initialValue: l, initialValueLanguage: u, convertJs: d, convertJsSetting: m, type: (h == null ? void 0 : h.type) || "string" }, a);
|
||||
@ -363,12 +363,12 @@ const Gn = ({ widget: e, widgetPrefix: t = "@pkg/grid-layouts", basicForm: a, ..
|
||||
return c("div", { className: R("ff-data-list-content", u), style: d, children: g.isEmpty(r) ? l : r == null ? void 0 : r.map((h, f) => c(b.Fragment, { children: o(b.cloneElement(y, { data: h }), h, f) }, `${m}-${(h == null ? void 0 : h[i]) || f}`)) });
|
||||
}, Qa = ({ component: e }) => {
|
||||
const { base62params: t } = Na();
|
||||
return c(q, { children: c(vt, { listCode: e, base62params: E.decode(t) }) });
|
||||
return c(H, { children: c(vt, { listCode: e, base62params: x.decode(t) }) });
|
||||
}, Xa = () => "Empty", Za = ({ component: e, $setting: t }) => {
|
||||
const [a, n] = P();
|
||||
return N(() => {
|
||||
if (!e) return n(c(Xa, { description: null }));
|
||||
Q.getWidgetComponent(e).catch((i) => ({ default: () => `${i}` })).then((i) => b.createElement(i.default, { $setting: t })).then(n);
|
||||
X.getWidgetComponent(e).catch((i) => ({ default: () => `${i}` })).then((i) => b.createElement(i.default, { $setting: t })).then(n);
|
||||
}, [e]), a ? b.cloneElement(a, {}) : null;
|
||||
};
|
||||
var be, Z, Ce, ve, Je, Ke;
|
||||
@ -378,12 +378,12 @@ const ne = class ne {
|
||||
F(this, Ce, {});
|
||||
F(this, ve, null);
|
||||
v(this, "init", (t, a) => {
|
||||
z(this, Z, t), z(this, Ce, a);
|
||||
B(this, Z, t), B(this, Ce, a);
|
||||
});
|
||||
v(this, "get", (t) => (p(this, Z).has(t) || (t = Array.from(p(this, Z).keys()).find((a) => p(this, Z).get(a).uri === t)), p(this, Z).get(t) || {}));
|
||||
v(this, "redirect", (t, a, n = {}) => {
|
||||
const { uri: i, type: r, widgetProps: s } = this.get(t) || {};
|
||||
let o = xa(i || t, r != "list" ? a : g.mapValues(a, (u) => E.encode(u)));
|
||||
let o = xa(i || t, r != "list" ? a : g.mapValues(a, (u) => x.encode(u)));
|
||||
const l = new URLSearchParams();
|
||||
for (const u in s || {}) (s == null ? void 0 : s.type) == "query" && l.append(u, a[u]);
|
||||
return l.size > 0 && (o = `${o}?${l.toString()}`), p(this, ve).navigate(o, n);
|
||||
@ -434,31 +434,31 @@ const ne = class ne {
|
||||
});
|
||||
v(this, "createBrowserRouter", (t = {}) => {
|
||||
if (p(this, Z).size == 0) return null;
|
||||
const a = De.get("Common.WEBSITE_DEFAULT_THEME", "@pkg/frameworks/BasicLayout"), n = De.get(Q.checkUserToken() ? "Common.WEBSITE_LOGIN_REDIRECT" : "Common.WEBSITE_DEFAULT", "/index"), i = { [a]: 0 }, r = (o, l) => () => Q.getWidgetComponent(o).then((u) => u.default || function() {
|
||||
const a = De.get("Common.WEBSITE_DEFAULT_THEME", "@pkg/frameworks/BasicLayout"), n = De.get(X.checkUserToken() ? "Common.WEBSITE_LOGIN_REDIRECT" : "Common.WEBSITE_DEFAULT", "/index"), i = { [a]: 0 }, r = (o, l) => () => X.getWidgetComponent(o).then((u) => u.default || function() {
|
||||
return `${o}`;
|
||||
}).then((u) => ({ Component: () => b.createElement(Kt, {}, b.createElement(u, l)) })), s = Array.from(p(this, Z).values()).reduce((o, { uuid: l, uri: u, name: d, type: m, component: y, widgetSetting: h, isLogin: f, isLayout: C, extra: w }) => {
|
||||
let x = {}, I = 0;
|
||||
let E = {}, A = 0;
|
||||
switch (m) {
|
||||
case "list":
|
||||
x.element = b.createElement(Qa, { component: y });
|
||||
E.element = b.createElement(Qa, { component: y });
|
||||
break;
|
||||
case "fsdpf-component":
|
||||
x.element = b.createElement(Za, { key: y, component: y, $setting: h });
|
||||
E.element = b.createElement(Za, { key: y, component: y, $setting: h });
|
||||
}
|
||||
if (w != null && w.layout) {
|
||||
if (!i[w == null ? void 0 : w.layout]) return i[w == null ? void 0 : w.layout] = o.length, [...o, { path: "/", lazy: r(w == null ? void 0 : w.layout, {}), children: [{ path: u, ...x }] }];
|
||||
I = i[w == null ? void 0 : w.layout];
|
||||
if (!i[w == null ? void 0 : w.layout]) return i[w == null ? void 0 : w.layout] = o.length, [...o, { path: "/", lazy: r(w == null ? void 0 : w.layout, {}), children: [{ path: u, ...E }] }];
|
||||
A = i[w == null ? void 0 : w.layout];
|
||||
}
|
||||
return C && I > -1 ? (o[I].children.push({ path: u, ...x }), o) : [...o, { path: u, ...x }];
|
||||
return C && A > -1 ? (o[A].children.push({ path: u, ...E }), o) : [...o, { path: u, ...E }];
|
||||
}, [{ path: "/", lazy: r(a, {}), children: [] }]);
|
||||
return s.push({ index: !0, element: b.createElement(en, { to: n, replace: !0 }) }), z(this, ve, Ea(s, t));
|
||||
return s.push({ index: !0, element: b.createElement(en, { to: n, replace: !0 }) }), B(this, ve, Ea(s, t));
|
||||
});
|
||||
if (p(ne, be)) return p(ne, be);
|
||||
}
|
||||
};
|
||||
be = new WeakMap(), Z = new WeakMap(), Ce = new WeakMap(), ve = new WeakMap(), Je = new WeakMap(), Ke = new WeakMap(), F(ne, be, null), v(ne, "getInstance", () => (p(ne, be) || z(ne, be, new ne()), p(ne, be)));
|
||||
be = new WeakMap(), Z = new WeakMap(), Ce = new WeakMap(), ve = new WeakMap(), Je = new WeakMap(), Ke = new WeakMap(), F(ne, be, null), v(ne, "getInstance", () => (p(ne, be) || B(ne, be, new ne()), p(ne, be)));
|
||||
let mt = ne;
|
||||
const en = ({ to: e, replace: t }) => Ta() ? b.createElement(Fa, { to: e, replace: t }) : (window.document.location = e, "redirect"), Pe = mt.getInstance(), je = new Worker(new URL("/ff-worker/index.js", self.location)), Vt = { getConfigure: (e) => De.get(e), route: { redirect: (...e) => Pe.redirect(...e), getPageParams: (...e) => Pe.getPageParams(...e), getCurrentRoute: () => Pe.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 en = ({ to: e, replace: t }) => Ta() ? b.createElement(Fa, { to: e, replace: t }) : (window.document.location = e, "redirect"), Pe = mt.getInstance(), je = new Worker(new URL("/ff-worker/index.js", self.location)), Vt = { getConfigure: (e) => De.get(e), route: { redirect: (...e) => Pe.redirect(...e), getPageParams: (...e) => Pe.getPageParams(...e), getCurrentRoute: () => Pe.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 nt, ze, ke;
|
||||
const j = class j {
|
||||
constructor() {
|
||||
@ -486,18 +486,18 @@ const j = class j {
|
||||
}, !1);
|
||||
}
|
||||
};
|
||||
nt = new WeakMap(), ze = new WeakMap(), ke = new WeakMap(), v(j, "mQueue", /* @__PURE__ */ new Map()), F(j, nt, 0), F(j, ze, /* @__PURE__ */ new Map()), F(j, ke, null), v(j, "getInstance", () => (p(j, ke) || z(j, ke, new j()), p(j, ke)));
|
||||
nt = new WeakMap(), ze = new WeakMap(), ke = new WeakMap(), v(j, "mQueue", /* @__PURE__ */ new Map()), F(j, nt, 0), F(j, ze, /* @__PURE__ */ new Map()), F(j, ke, null), v(j, "getInstance", () => (p(j, ke) || B(j, ke, new j()), p(j, ke)));
|
||||
let ht = j;
|
||||
const $e = ht.getInstance(), oa = () => {
|
||||
const e = Y(!0), [, t] = b.useReducer((a) => a + 1, 0);
|
||||
const e = Q(!0), [, t] = b.useReducer((a) => a + 1, 0);
|
||||
return N(() => () => e.current = !1, []), () => e.current && t();
|
||||
}, jt = (e) => {
|
||||
const t = Y();
|
||||
const t = Q();
|
||||
return N(() => {
|
||||
t.current = e;
|
||||
}, [e]), t.current;
|
||||
}, _n = (e) => {
|
||||
const [t, a] = P(e), n = Y(null), i = ge((r, s) => {
|
||||
const [t, a] = P(e), n = Q(null), i = ge((r, s) => {
|
||||
n.current = s, a(r);
|
||||
}, []);
|
||||
return N(() => {
|
||||
@ -513,7 +513,7 @@ const $e = ht.getInstance(), oa = () => {
|
||||
for (let n = 0; n < e.length; n++) e[n].value = g.toPrimitive((a = e[n]) == null ? void 0 : a.value, t), e[n] && Reflect.has(e[n], "children") && (e[n].children = la(e[n].children, t));
|
||||
return e;
|
||||
}, Yn = (e, t = "json", a = "string", n, i = null) => {
|
||||
const [r] = re.useForm(n), [s, o] = P([{ label: "无", value: "", disabled: !0 }]), l = Y([]), u = re.useWatch((d) => l.current.length === 0 ? null : g.pick(d, l.current), r) || null;
|
||||
const [r] = re.useForm(n), [s, o] = P([{ label: "无", value: "", disabled: !0 }]), l = Q([]), u = re.useWatch((d) => l.current.length === 0 ? null : g.pick(d, l.current), r) || null;
|
||||
return N(() => {
|
||||
Array.isArray(e) ? o(e) : t === "javascript" && e ? $e.exec(e, {}, { getFieldValue: (d) => (l.current.includes(d) || l.current.push(d), r.getFieldValue(d)), getFieldValueForBasicForm: (d) => (l.current.includes(d) || l.current.push(d), i ? i.getFieldValue(d) : r.getFieldValue(d)) }).then((d) => {
|
||||
o(g.toPrimitive(d, "array"));
|
||||
@ -522,7 +522,7 @@ const $e = ht.getInstance(), oa = () => {
|
||||
}, Qn = (e) => {
|
||||
const [t, a] = P(), n = { type: "GET" };
|
||||
if (typeof e == "string" ? n.url = e : g.isPlainObject(e) && Object.assign(n, e), !(n != null && n.url)) throw "url is required";
|
||||
const i = (r) => E.request(n, !1).resp((s) => (console.log("useSubscribeRequest", r), a(s), s));
|
||||
const i = (r) => x.request(n, !1).resp((s) => (console.log("useSubscribeRequest", r), a(s), s));
|
||||
return Ye(() => {
|
||||
let r = null;
|
||||
return i().then((s) => {
|
||||
@ -532,9 +532,9 @@ const $e = ht.getInstance(), oa = () => {
|
||||
}, an = (e) => {
|
||||
const [t, a] = b.useState({ gridItems: [], hideItems: [] });
|
||||
return b.useEffect(() => {
|
||||
e && E.get(`/api/_/${e}`).then(({ pk: n, uuid: i, code: r, resource: s, align: o, cols: l, rowHeight: u, marginX: d, marginY: m, listenChangeFields: y, listenChangeFieldsFunc: h, fields: f }) => ({ pk: n, uuid: i, code: r, resource: s, align: o, cols: l, rowHeight: u, marginX: d, marginY: m, listenChangeFields: y, listenChangeFieldsFunc: h, ...f.reduce((C, w) => {
|
||||
var x;
|
||||
return (x = w == null ? void 0 : w.field) != null && x.hidden ? C.hides.push(w == null ? void 0 : w.field) : C.items.push(w), C;
|
||||
e && x.get(`/api/_/${e}`).then(({ pk: n, uuid: i, code: r, resource: s, align: o, cols: l, rowHeight: u, marginX: d, marginY: m, listenChangeFields: y, listenChangeFieldsFunc: h, fields: f }) => ({ pk: n, uuid: i, code: r, resource: s, align: o, cols: l, rowHeight: u, marginX: d, marginY: m, listenChangeFields: y, listenChangeFieldsFunc: h, ...f.reduce((C, w) => {
|
||||
var E;
|
||||
return (E = w == null ? void 0 : w.field) != null && E.hidden ? C.hides.push(w == null ? void 0 : w.field) : C.items.push(w), C;
|
||||
}, { items: [], hides: [] }) })).then(a);
|
||||
}, [e]), t;
|
||||
}, nn = ({ max: e = 0, min: t = 0, type: a = "", message: n, pattern: i, required: r = !1, validator: s } = {}, o, l) => {
|
||||
@ -575,12 +575,12 @@ const $e = ht.getInstance(), oa = () => {
|
||||
const [n, i] = P(null);
|
||||
return N(() => {
|
||||
const { initDataUri: r = `/api/${e}`, initDataMethod: s = "GET" } = a || {};
|
||||
t && E.request({ method: s, url: g.trimEnd(`${r}/${t}`, "/") }).then((o) => {
|
||||
t && x.request({ method: s, url: g.trimEnd(`${r}/${t}`, "/") }).then((o) => {
|
||||
i(o);
|
||||
});
|
||||
}, [e, t, a]), n;
|
||||
}, sn = (e, t, a, n = {}) => {
|
||||
const i = oa(), r = Y(!0), s = Y([]), [o, l] = P(a), u = re.useWatch((d) => JSON.stringify(g.pick(d, s.current)), t) || "{}";
|
||||
const i = oa(), r = Q(!0), s = Q([]), [o, l] = P(a), u = re.useWatch((d) => JSON.stringify(g.pick(d, s.current)), t) || "{}";
|
||||
return N(() => {
|
||||
e && $e.exec(e, n, { getFieldValue: g.wrap(t.getFieldValue, (d, m) => (s.current.some((y) => g.isEqual(y, m)) || (s.current.push(m), i()), d(m))), isFieldTouched: t.isFieldTouched, isFieldsTouched: t.isFieldsTouched }).then((d) => r.current && l(d));
|
||||
}, [e, u, t, n]), N(() => () => r.current = !1, []), o;
|
||||
@ -592,13 +592,13 @@ const $e = ht.getInstance(), oa = () => {
|
||||
}, ln = ({ widget: e = "Input", widgetPrefix: t = "@pkg/grid-layout-forms", widgetDecorator: a, subWidgets: n, basicForm: i, ...r }) => {
|
||||
const s = e != null && e.startsWith("@") ? e : `${t}/${e}`, [o, l] = P();
|
||||
return N(() => {
|
||||
s && Q.getWidgetComponent(s).then(({ defaultProps: u = {}, default: d }) => ({ default: ca(d, u, i) })).catch((u) => ({ default: () => `${u}` })).then((u) => l(b.createElement(u.default, r)));
|
||||
s && X.getWidgetComponent(s).then(({ defaultProps: u = {}, default: d }) => ({ default: ca(d, u, i) })).catch((u) => ({ default: () => `${u}` })).then((u) => l(b.createElement(u.default, r)));
|
||||
}, [s]), o && b.cloneElement(o, r);
|
||||
}, ca = (e, t = {}, a = null) => (n) => {
|
||||
const { type: i, code: r, label: s, noStyle: o, placeholder: l, extras: u, validators: d, help: m, isVirtual: y, $isReserved: h, initialValue: f, initialValueLanguage: C, convertJs: w, convertJsSetting: x, widgetPerfix: I, boxStyle: B, widgetDecorator: X, subWidgets: G, ...A } = { ...t, ...n }, D = nn(d || {}, r, i), H = { label: s, noStyle: o, colon: !1, layout: "vertical" }, M = { placeholder: l, ...A }, J = ge((V) => V == null ? void 0 : g.toPrimitive(V, i), [i]);
|
||||
return c(Wt, { name: r, rules: D, initialValue: J(f), normalize: J, children: (V, k, se) => {
|
||||
const { type: i, code: r, label: s, noStyle: o, placeholder: l, extras: u, validators: d, help: m, isVirtual: y, $isReserved: h, initialValue: f, initialValueLanguage: C, convertJs: w, convertJsSetting: E, widgetPerfix: A, boxStyle: J, widgetDecorator: W, subWidgets: I, ...M } = { ...t, ...n }, D = nn(d || {}, r, i), K = { label: s, noStyle: o, colon: !1, layout: "vertical" }, z = { placeholder: l, ...M }, G = ge((V) => V == null ? void 0 : g.toPrimitive(V, i), [i]);
|
||||
return c(Wt, { name: r, rules: D, initialValue: G(f), normalize: G, children: (V, k, se) => {
|
||||
var L;
|
||||
return c(e, { type: i, rcform: se, itemProps: { validateStatus: k.errors.length > 0 ? "error" : "success", tooltip: m, help: k.errors.length > 0 ? k.errors.join("、") : null, required: ((L = D == null ? void 0 : D[0]) == null ? void 0 : L.required) || !1, ...H }, fieldProps: { ...M, ...V }, $setting: u || {} });
|
||||
return c(e, { type: i, rcform: se, itemProps: { validateStatus: k.errors.length > 0 ? "error" : "success", tooltip: m, help: k.errors.length > 0 ? k.errors.join("、") : null, required: ((L = D == null ? void 0 : D[0]) == null ? void 0 : L.required) || !1, ...K }, fieldProps: { ...z, ...V }, $setting: u || {} });
|
||||
} });
|
||||
}, St = ({ cols: e = 24, rowHeight: t = 16, itemMargin: a = [8, 16], containerPadding: n = [0, 0], fields: i = [], children: r }) => {
|
||||
const s = ra(i, ca, "@pkg/grid-layout-forms");
|
||||
@ -607,12 +607,12 @@ const $e = ht.getInstance(), oa = () => {
|
||||
St.propTypes = { fields: O.array };
|
||||
const cn = (It = St, ({ code: e, layout: t, name: a, primaryKey: n = 0, style: i = {}, formProps: r = {}, form: s, isPreview: o = !1, className: l, onFinish: u, onValuesChange: d = () => {
|
||||
}, ...m }) => {
|
||||
const { align: y, autoComplete: h, resource: f, items: C, hides: w, rowHeight: x, marginX: I, marginY: B, cols: X, listenChangeFields: G, listenChangeFieldsFunc: A, pk: D, uuid: H } = an(e), [M] = re.useForm(s), J = pe(() => [{ name: "__PK__", value: D }, { name: "__PROPS__", value: r }, { name: "__RESOURCE__", value: f }, { name: "__LAYOUT_KEY__", value: e }, { name: "__LAYOUT_UUID__", value: H }, { name: "__PRIMARY_KEY__", value: n }], [D, e, H, f, n, r]);
|
||||
return $(re, { className: l, name: a || e, layout: t || y, fields: J, form: M, autoComplete: h, style: { ...i, position: "relative" }, onFinish: u, onValuesChange: (V, k) => (({ changedValues: se, allValues: L, listenChangeFields: me, listenChangeFieldsFunc: Ne, onValuesChange: it, code: T }) => {
|
||||
it(se, L), Ne && Array.isArray(me) && $e.exec(Ne, { changedValues: se, allValues: L }, { getFieldValue: M.getFieldValue, setFieldsValue: M.setFieldsValue, isFieldTouched: M.isFieldTouched, isFieldsTouched: M.isFieldsTouched });
|
||||
})({ changedValues: V, allValues: k, listenChangeFields: G, listenChangeFieldsFunc: A, onValuesChange: d, code: e }), children: [c(It, { ...m, form: M, code: e, fields: C, cols: X, rowHeight: x, itemMargin: [I, B] }), w == null ? void 0 : w.map((V) => {
|
||||
const { align: y, autoComplete: h, resource: f, items: C, hides: w, rowHeight: E, marginX: A, marginY: J, cols: W, listenChangeFields: I, listenChangeFieldsFunc: M, pk: D, uuid: K } = an(e), [z] = re.useForm(s), G = pe(() => [{ name: "__PK__", value: D }, { name: "__PROPS__", value: r }, { name: "__RESOURCE__", value: f }, { name: "__LAYOUT_KEY__", value: e }, { name: "__LAYOUT_UUID__", value: K }, { name: "__PRIMARY_KEY__", value: n }], [D, e, K, f, n, r]);
|
||||
return $(re, { className: l, name: a || e, layout: t || y, fields: G, form: z, autoComplete: h, style: { ...i, position: "relative" }, onFinish: u, onValuesChange: (V, k) => (({ changedValues: se, allValues: L, listenChangeFields: me, listenChangeFieldsFunc: Ne, onValuesChange: it, code: T }) => {
|
||||
it(se, L), Ne && Array.isArray(me) && $e.exec(Ne, { changedValues: se, allValues: L }, { getFieldValue: z.getFieldValue, setFieldsValue: z.setFieldsValue, isFieldTouched: z.isFieldTouched, isFieldsTouched: z.isFieldsTouched });
|
||||
})({ changedValues: V, allValues: k, listenChangeFields: I, listenChangeFieldsFunc: M, onValuesChange: d, code: e }), children: [c(It, { ...m, form: z, code: e, fields: C, cols: W, rowHeight: E, itemMargin: [A, J] }), w == null ? void 0 : w.map((V) => {
|
||||
var k;
|
||||
return c(Wt, { name: V.code, children: c(on, { form: M, name: V.code, type: V.type, initialValue: V.initialValue, initialValueLanguage: (k = V.extras) == null ? void 0 : k.initialValueLanguage }) }, JSON.stringify(V.code));
|
||||
return c(Wt, { name: V.code, children: c(on, { form: z, name: V.code, type: V.type, initialValue: V.initialValue, initialValueLanguage: (k = V.extras) == null ? void 0 : k.initialValueLanguage }) }, JSON.stringify(V.code));
|
||||
})] });
|
||||
});
|
||||
var It;
|
||||
@ -620,16 +620,16 @@ const da = ({ $setting: e, $close: t, extras: a, code: n, primaryKey: i, ...r })
|
||||
const [s] = re.useForm(), o = rn(n, i, e);
|
||||
return N(() => {
|
||||
o && s.setFieldsValue(o);
|
||||
}, [o]), c(q, { actions: $(b.Fragment, { children: [c(S, { name: "保存", type: "primary", widget: () => {
|
||||
}, [o]), c(H, { actions: $(b.Fragment, { children: [c(S, { name: "保存", type: "primary", widget: () => {
|
||||
const l = s.getFieldValue("__RESOURCE__"), { initDataUri: u = `/api/${n}` } = e || {};
|
||||
s.validateFields(!0).then((d) => l ? g.pick(d, [l]) : d).then((d) => E.post(i ? `${u}/${i}` : `${u}`, d).msg(t)).catch(() => K.error("请先完善表单信息", { duration: 2e3 }));
|
||||
s.validateFields(!0).then((d) => l ? g.pick(d, [l]) : d).then((d) => x.post(i ? `${u}/${i}` : `${u}`, d).msg(t)).catch(() => _.error("请先完善表单信息", { duration: 2e3 }));
|
||||
} }), c(S, { name: "取消", widget: () => t(!1) })] }), extras: a, children: c(cn, { form: s, code: n, primaryKey: i, ...r }) });
|
||||
}, dn = (e, t, { isReplaceRouteHistory: a = !1 } = {}) => Pe.redirect(t, e, { replace: a }), At = (e, t, { status: { loading: a, disabled: n }, setStatus: i }) => {
|
||||
const r = { loading: (s) => s === void 0 ? a : i((o) => ({ ...o, loading: s })), disabled: (s) => s === void 0 ? n : i((o) => ({ ...o, disabled: s })) };
|
||||
return g.isFunction(t) ? t.call(null, { ...e, ...r }) : g.isString(t) && t ? $e.exec(t, e, r) : null;
|
||||
}, Mt = (e, t, a, n) => g.isString(t) && t ? Q.getWidgetComponent(t).then(({ default: i }) => K.modal(i, { ...e, $setting: a }, n)).catch((i) => {
|
||||
K.error(t, { content: i.toString() });
|
||||
}) : K.modal(t, { ...e, $setting: a }, n), un = (e, t, a, n) => K.modal(da, { ...e, $setting: a, code: t }, n), gn = (e, t, a, n) => K.modal(vt, { base62params: e, $setting: a, listCode: t }, n), pn = ({ widget: e, widgetType: t, widgetData: a, widgetProps: n, widgetSetting: i, widgetContainerProps: r }, { onAfterClick: s, onBeforeClick: o }) => {
|
||||
}, Mt = (e, t, a, n) => g.isString(t) && t ? X.getWidgetComponent(t).then(({ default: i }) => _.modal(i, { ...e, $setting: a }, n)).catch((i) => {
|
||||
_.error(t, { content: i.toString() });
|
||||
}) : _.modal(t, { ...e, $setting: a }, n), un = (e, t, a, n) => _.modal(da, { ...e, $setting: a, code: t }, n), gn = (e, t, a, n) => _.modal(vt, { base62params: e, $setting: a, listCode: t }, n), pn = ({ widget: e, widgetType: t, widgetData: a, widgetProps: n, widgetSetting: i, widgetContainerProps: r }, { onAfterClick: s, onBeforeClick: o }) => {
|
||||
const l = Ge(Le), [u, d] = P({ leading: !0, trailing: !1 }), m = pe(() => {
|
||||
switch (t) {
|
||||
case "redirect":
|
||||
@ -661,41 +661,41 @@ const da = ({ $setting: e, $close: t, extras: a, code: n, primaryKey: i, ...r })
|
||||
}
|
||||
}, yt = ({ className: e, type: t, style: a = {}, ...n }) => c("span", { role: "img", className: R("ff-iconfont", e), style: a, ...n, children: c("svg", { style: { width: "1em", height: "1em", fill: "currentColor", overflow: "hidden" }, viewBox: "0 0 1024 1024", children: c("use", { xlinkHref: `#${t}` }) }) });
|
||||
yt.propTypes = { className: O.string, type: O.string.isRequired, style: O.object }, yt.init = ft;
|
||||
const Qe = (e) => function({ className: t, children: a, name: n, icon: i, type: r = "default", iconPosition: s = "start", noAuthType: o, onAfterClick: l, onBeforeClick: u, data: d, loading: m, disabled: y, tooltip: h, popConfirm: f, widget: C, widgetType: w, widgetData: x, widgetProps: I, widgetSetting: B, widgetContainerProps: X, ...G }) {
|
||||
const A = { type: "primary", className: R("ff-button", t), iconPosition: s };
|
||||
r === "danger" ? A.danger = !0 : r === "default" && (A.type = r), e === "link" || e === "dashed" ? (A.type = e, r === "default" && (A.className = R(A.className, "ff-default"))) : e !== "circle" && e !== "round" || (A.shape = e), i && (A.icon = c(yt, { type: i }));
|
||||
const [D, H] = P(!1), [M, { disabled: J, loading: V }] = pn({ widget: C, widgetType: w, widgetData: x, widgetProps: I, widgetSetting: B, widgetContainerProps: X }, { onAfterClick: l, onBeforeClick: u });
|
||||
return c(va, { okText: "确定", cancelText: "取消", ...f || {}, disabled: J || y, open: D, onOpenChange: (k) => {
|
||||
if (!k) return H(k);
|
||||
f ? H(k) : M(d);
|
||||
const Qe = (e) => function({ className: t, children: a, name: n, icon: i, type: r = "default", iconPosition: s = "start", noAuthType: o, onAfterClick: l, onBeforeClick: u, data: d, loading: m, disabled: y, tooltip: h, popConfirm: f, widget: C, widgetType: w, widgetData: E, widgetProps: A, widgetSetting: J, widgetContainerProps: W, ...I }) {
|
||||
const M = { type: "primary", className: R("ff-button", t), iconPosition: s };
|
||||
r === "danger" ? M.danger = !0 : r === "default" && (M.type = r), e === "link" || e === "dashed" ? (M.type = e, r === "default" && (M.className = R(M.className, "ff-default"))) : e !== "circle" && e !== "round" || (M.shape = e), i && (M.icon = c(yt, { type: i }));
|
||||
const [D, K] = P(!1), [z, { disabled: G, loading: V }] = pn({ widget: C, widgetType: w, widgetData: E, widgetProps: A, widgetSetting: J, widgetContainerProps: W }, { onAfterClick: l, onBeforeClick: u });
|
||||
return c(va, { okText: "确定", cancelText: "取消", ...f || {}, disabled: G || y, open: D, onOpenChange: (k) => {
|
||||
if (!k) return K(k);
|
||||
f ? K(k) : z(d);
|
||||
}, onConfirm: () => {
|
||||
M(d);
|
||||
z(d);
|
||||
}, onClick: (k) => {
|
||||
k.stopPropagation();
|
||||
}, children: c(ka, { ...h, title: D ? null : h == null ? void 0 : h.title, trigger: ["hover", "click"], children: c(lt, { loading: V || m, disabled: J || y, ...A, ...G, children: a || n }) }) });
|
||||
}, children: c(ka, { ...h, title: D ? null : h == null ? void 0 : h.title, trigger: ["hover", "click"], children: c(lt, { loading: V || m, disabled: G || y, ...M, ...I, children: a || n }) }) });
|
||||
}, S = Qe("default"), mn = Qe("link"), hn = Qe("circle"), fn = Qe("round"), yn = Qe("dashed"), Bt = ({ data: e, widget: t, widgetType: a = "fsdpf-component", children: n, widgetData: i, widgetProps: r, widgetSetting: s, widgetContainerProps: o }) => {
|
||||
const l = Ge(Le), [u, d] = P(!1), [m, y] = P("hover"), [h, f] = P({}), [C, w] = P();
|
||||
const l = Ge(Le), [u, d] = P(!1), [m, y] = P("hover"), [h, f] = P({}), [C, w] = P(), { placement: E, ...A } = o || {};
|
||||
N(() => {
|
||||
a == "grid-layout-form" ? w(b.createElement(da, { ...i, $setting: s, code: t })) : a == "data-list" ? w(b.createElement(vt, { base62params: e, $setting: s, listCode: t })) : g.isString(t) ? Q.getWidgetComponent(t).then(({ default: B }) => {
|
||||
w(b.createElement(B, { ...i, $setting: s }));
|
||||
}).catch((B) => w(B.toString())) : $t(t) ? w(b.createElement(t, { ...i, $setting: s })) : b.isValidElement(t) && w(b.cloneElement(t, { ...i, $setting: s }));
|
||||
a == "grid-layout-form" ? w(b.createElement(da, { ...i, $setting: s, code: t })) : a == "data-list" ? w(b.createElement(vt, { base62params: e, $setting: s, listCode: t })) : g.isString(t) ? X.getWidgetComponent(t).then(({ default: I }) => {
|
||||
w(b.createElement(I, { ...i, $setting: s }));
|
||||
}).catch((I) => w(I.toString())) : $t(t) ? w(b.createElement(t, { ...i, $setting: s })) : b.isValidElement(t) && w(b.cloneElement(t, { ...i, $setting: s }));
|
||||
}, [t, a, i]), N(() => {
|
||||
Promise.resolve(_t(r, e, { list: l })).then(f);
|
||||
}, [r, e]);
|
||||
const x = (B) => {
|
||||
d(B), !B && y("hover");
|
||||
}, I = () => {
|
||||
const J = (I) => {
|
||||
d(I), !I && y("hover");
|
||||
}, W = () => {
|
||||
d(!0), y("click");
|
||||
};
|
||||
return c(Sa, { zIndex: 1e3, ...o, onPopupClick: I, onClick: I, open: u, trigger: m, content: c(wn, { children: C && b.cloneElement(C, { ...h, $close: () => x(!1) }) }), children: n, onOpenChange: x });
|
||||
}, wn = ({ children: e }) => {
|
||||
const [t, a] = P({}), n = ge((r, s) => a((o) => ({ ...o, [r]: s })), []), i = ge((r) => a((s) => ({ ...s, [r]: void 0 })), []);
|
||||
return c(_e.Provider, { value: { ele: t, mount: n, unmount: i }, children: $("div", { className: "ff-popup ff-popover", children: [t != null && t.title || t != null && t["sub-title"] ? $("div", { className: "ff-popup-header", children: [(t == null ? void 0 : t.title) || c("div", { className: "ff-popup-title" }), (t == null ? void 0 : t["sub-title"]) || c("div", { className: "ff-popup-sub-title" })] }) : null, e, t != null && t.extras || t != null && t.actions ? $("div", { className: "ff-popup-footer", children: [(t == null ? void 0 : t.extras) || c("div", { className: "ff-popup-extras" }), (t == null ? void 0 : t.actions) || c("div", { className: "ff-popup-actions" })] }) : null] }) });
|
||||
return c(Sa, { zIndex: 1e3, placement: E, onPopupClick: W, onClick: W, open: u, trigger: m, content: c(wn, { ...A, children: C && b.cloneElement(C, { ...h, $close: () => J(!1) }) }), children: n, onOpenChange: J });
|
||||
}, wn = ({ title: e, className: t, children: a, ...n }) => {
|
||||
const [i, r] = P({}), s = ge((u, d) => r((m) => ({ ...m, [u]: d })), []), o = ge((u) => r((d) => ({ ...d, [u]: void 0 })), []), l = e ? b.createElement("div", { className: "ff-popup-title" }, e) : i == null ? void 0 : i.title;
|
||||
return c(_e.Provider, { value: { ele: i, mount: s, unmount: o }, children: $("div", { className: cx("ff-popup ff-popover", t), ...n, children: [l || i != null && i["sub-title"] ? $("div", { className: "ff-popup-header", children: [l || c("div", { className: "ff-popup-title" }), (i == null ? void 0 : i["sub-title"]) || c("div", { className: "ff-popup-sub-title" })] }) : null, a, i != null && i.extras || i != null && i.actions ? $("div", { className: "ff-popup-footer", children: [(i == null ? void 0 : i.extras) || c("div", { className: "ff-popup-extras" }), (i == null ? void 0 : i.actions) || c("div", { className: "ff-popup-actions" })] }) : null] }) });
|
||||
};
|
||||
Bt.propTypes = { widgetType: O.oneOf(["fsdpf-component", "grid-layout-form", "data-list"]) }, S.propTypes = { type: O.oneOf(["primary", "default", "danger", ""]), name: O.string, icon: O.string, iconPosition: O.oneOf(["start", "end"]), data: O.any, widget: O.any, widgetType: O.oneOf(["destroy", "redirect", "func", "fsdpf-component", "grid-layout-form", "grid-layout", "data-list"]), widgetData: O.object, widgetProps: O.object, widgetSetting: O.object, widgetContainerProps: O.object }, S.Link = mn, S.Link.defaultProps = S.defaultProps, S.Link.propTypes = S.propTypes, S.Circle = hn, S.Circle.defaultProps = S.defaultProps, S.Circle.propTypes = S.propTypes, S.Round = fn, S.Round.defaultProps = S.defaultProps, S.Round.propTypes = S.propTypes, S.Dashed = yn, S.Dashed.defaultProps = S.defaultProps, S.Dashed.propTypes = S.propTypes, S.Popover = Bt;
|
||||
const bn = ({ fields: e, formProps: t, $close: a }) => {
|
||||
const [n] = re.useForm(), i = pe(() => [{ name: "__PROPS__", value: t }], [t]);
|
||||
return c(q, { actions: $(b.Fragment, { children: [c(S, { name: "取消", widget: () => a(!1) }), c(S, { name: "确定", type: "primary", widget: () => n.validateFields(!0).then(a) })] }), children: c(re, { fields: i, form: n, className: "ff-modal-form", children: e == null ? void 0 : e.map(({ code: r, ...s }) => c(ln, { code: r, ...s }, r)) }) });
|
||||
return c(H, { actions: $(b.Fragment, { children: [c(S, { name: "取消", widget: () => a(!1) }), c(S, { name: "确定", type: "primary", widget: () => n.validateFields(!0).then(a) })] }), children: c(re, { fields: i, form: n, className: "ff-modal-form", children: e == null ? void 0 : e.map(({ code: r, ...s }) => c(ln, { code: r, ...s }, r)) }) });
|
||||
}, Cn = ({ className: e, $close: t, children: a, title: n, subTitle: i, actions: r, extras: s, zIndex: o, ...l }) => $(La, { ...l, prefixCls: "ff-drawer", className: R("ff-popup", e), height: 378, maskMotion: { motionAppear: !0, motionName: "mask-motion" }, motion: (u) => ({ motionAppear: !0, motionName: `panel-motion-${u}` }), children: [$("div", { className: "ff-popup-header", children: [c("button", { "aria-label": "Close", className: "ff-popup-close", onClick: l.onClose, children: c(Ct, { type: "close" }) }), n, i] }), c("div", { className: "ff-popup-body", children: a }), $("div", { className: "ff-popup-footer", children: [s, " ", r] })] }), vn = ({ className: e, $close: t, $event: a, children: n, title: i, subTitle: r, actions: s, extras: o, zIndex: l, placement: u, ...d }) => {
|
||||
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 c(Va, { ...d, ...m, prefixCls: "ff-modal", modalRender: () => $("div", { className: R("ff-modal-content ff-popup", e), children: [$("div", { className: "ff-popup-header", children: [c("button", { "aria-label": "Close", className: "ff-popup-close", onClick: d.onClose, children: c(Ct, { type: "close" }) }), i, " ", r] }), c("div", { className: "ff-popup-body", children: n }), $("div", { className: "ff-popup-footer", children: [o, " ", s] })] }) });
|
||||
@ -708,27 +708,27 @@ const bn = ({ fields: e, formProps: t, $close: a }) => {
|
||||
return c(_e.Provider, { value: { ele: s, mount: d, unmount: m }, children: e && e !== "center" ? c(Cn, { ...y, placement: e, open: l, afterOpenChange: (f) => !f && h() }) : c(vn, { ...y, visible: l, afterClose: h }) });
|
||||
};
|
||||
ua.propTypes = { placement: O.oneOf(["center", "left", "top", "right", "bottom"]) };
|
||||
const W = () => {
|
||||
const q = () => {
|
||||
const [e, t] = Ra({ maxCount: 6, motion: { motionName: "ff-notification-fade", motionAppear: !0, motionEnter: !0, motionLeave: !0, onLeaveStart: (r) => {
|
||||
const { offsetHeight: s } = r;
|
||||
return { height: s };
|
||||
}, onLeaveActive: () => ({ height: 0, opacity: 0, margin: 0 }) }, prefixCls: "ff-notification" }), [, a] = b.useReducer((r) => r + 1, 0);
|
||||
N(() => {
|
||||
W.$onClick = n, W.$queue.forEach(([r, s, o], l, u) => {
|
||||
q.$onClick = n, q.$queue.forEach(([r, s, o], l, u) => {
|
||||
i([s, o], ...r), delete u[l];
|
||||
});
|
||||
}, []);
|
||||
const n = (r, s = {}, o = {}) => new Promise((l, u) => i([l, u], r, s, o)), i = ([r, s], o, l = {}, u = {}) => {
|
||||
const d = W.$index++, m = (y) => ((h, f) => (W.$popups.delete(h), a(), f == null ? void 0 : f()))(d, () => r(y));
|
||||
const d = q.$index++, m = (y) => ((h, f) => (q.$popups.delete(h), a(), f == null ? void 0 : f()))(d, () => r(y));
|
||||
if (o === Gt) return e.open({ ...u, key: d, content: b.createElement(o, { ...l, $close: () => e.close(d) }) });
|
||||
W.$popups.set(d, b.createElement(ua, { zIndex: d, maskClosable: !1, $event: l == null ? void 0 : l.$event, ...u, key: d, $close: m }, b.isValidElement(o) ? b.cloneElement(o, { ...l, $close: m }) : o != null && o.name ? b.createElement(o, { ...l, $close: m }) : o)), a();
|
||||
q.$popups.set(d, b.createElement(ua, { zIndex: d, maskClosable: !1, $event: l == null ? void 0 : l.$event, ...u, key: d, $close: m }, b.isValidElement(o) ? b.cloneElement(o, { ...l, $close: m }) : o != null && o.name ? b.createElement(o, { ...l, $close: m }) : o)), a();
|
||||
};
|
||||
return $(b.Fragment, { children: [Array.from(W.$popups).map(([r, s]) => s), t] });
|
||||
return $(b.Fragment, { children: [Array.from(q.$popups).map(([r, s]) => s), t] });
|
||||
};
|
||||
W.$popups = /* @__PURE__ */ new Map(), W.$index = 0, W.$queue = [], W.$onClick = (...e) => new Promise((t, a) => {
|
||||
W.$queue.push([e, t, a]);
|
||||
q.$popups = /* @__PURE__ */ new Map(), q.$index = 0, q.$queue = [], q.$onClick = (...e) => new Promise((t, a) => {
|
||||
q.$queue.push([e, t, a]);
|
||||
});
|
||||
const Ut = (e, t, a = {}) => W.$onClick(e, t, a), st = (e, { showProgress: t, duration: a, ...n } = { duration: 1.5 }) => W.$onClick(Gt, { content: e, ...n }, { showProgress: t, duration: a }), K = { modal: Ut, confirm: (e, t = {}) => W.$onClick(ja, { content: e, ...t }, { placement: "center" }), form: (e, t = {}, a = {}) => Ut(bn, { formProps: a, fields: e }, { placement: "center", ...t }).then((n) => {
|
||||
const Ut = (e, t, a = {}) => q.$onClick(e, t, a), st = (e, { showProgress: t, duration: a, ...n } = { duration: 1.5 }) => q.$onClick(Gt, { content: e, ...n }, { showProgress: t, duration: a }), _ = { modal: Ut, confirm: (e, t = {}) => q.$onClick(ja, { content: e, ...t }, { placement: "center" }), form: (e, t = {}, a = {}) => Ut(bn, { formProps: a, fields: e }, { placement: "center", ...t }).then((n) => {
|
||||
if (n === !1) throw !1;
|
||||
return n;
|
||||
}), notification: st, success: (e, t = { duration: 1.5 }) => st(e, { ...t, className: "ff-notification-success", icon: "check" }), error: (e, t = { duration: 1.5 }) => st(e, { ...t, className: "ff-notification-error", icon: "close" }) };
|
||||
@ -738,10 +738,10 @@ Be.configure({ showSpinner: !1 }), Ue.interceptors.request.use((e) => {
|
||||
return e.headers.Authorization = t ? `Bearer ${t} ` : void 0, Be.inc(), e;
|
||||
}, (e) => (Be.done(), Promise.reject({ code: -1, msg: e }))), Ue.interceptors.response.use(({ data: e, headers: t }) => (Be.done(), { ...e, res: t == null ? void 0 : t.res }), function(e) {
|
||||
return Be.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 && Pe.redirect(De.get("Common.WEBSITE_LOGIN_PAGE")));
|
||||
}), window.addEventListener("unhandledrejection", ct.onUnhandledRejection), ct.onMsg = (e, t) => _[[0, 1].includes(e) ? "success" : "error"](t).then(() => e === 20300 && Pe.redirect(De.get("Common.WEBSITE_LOGIN_PAGE")));
|
||||
const wt = { appUrl: "", init: (e, t, a) => {
|
||||
wt.appUrl = a, Ue.defaults.baseURL = a, Ue.defaults.timeout = 15e3, Object.assign(wt, new ct(e, t, Ue));
|
||||
} }, E = wt;
|
||||
} }, x = wt;
|
||||
class Pt extends Error {
|
||||
constructor(t, a) {
|
||||
super(a), Error.captureStackTrace && Error.captureStackTrace(this, Pt), !a instanceof We && (this.name = `${t} Error Runtime`);
|
||||
@ -753,11 +753,11 @@ class We extends Error {
|
||||
}
|
||||
}
|
||||
const ot = "mine", tt = "token";
|
||||
var Se, _;
|
||||
var Se, Y;
|
||||
const ie = class ie {
|
||||
constructor() {
|
||||
F(this, _, /* @__PURE__ */ new Map());
|
||||
v(this, "setVendor", (t, a) => p(this, _).set(t, new Jt(a, async (n, i) => {
|
||||
F(this, Y, /* @__PURE__ */ new Map());
|
||||
v(this, "setVendor", (t, a) => p(this, Y).set(t, new Jt(a, async (n, i) => {
|
||||
var s, o;
|
||||
if (!(n != null && n.default)) throw "@pkg not found";
|
||||
let r = () => i;
|
||||
@ -773,14 +773,14 @@ const ie = class ie {
|
||||
const [, a] = t == null ? void 0 : t.split("@ff/"), [, n] = t == null ? void 0 : t.split("@app/"), [, i] = t == null ? void 0 : t.split("@pkg/"), [, r] = t == null ? void 0 : t.split("@fsdpf/");
|
||||
try {
|
||||
switch (!0) {
|
||||
case (!!a && p(this, _).has("pkg")):
|
||||
return await p(this, _).get("pkg").get(a);
|
||||
case (!!n && p(this, _).has("pkg")):
|
||||
return await p(this, _).get("pkg").get(n);
|
||||
case (!!i && p(this, _).has("pkg")):
|
||||
return await p(this, _).get("pkg").get(i);
|
||||
case (!!r && p(this, _).has("pkg")):
|
||||
return await p(this, _).get("pkg").get(r);
|
||||
case (!!a && p(this, Y).has("pkg")):
|
||||
return await p(this, Y).get("pkg").get(a);
|
||||
case (!!n && p(this, Y).has("pkg")):
|
||||
return await p(this, Y).get("pkg").get(n);
|
||||
case (!!i && p(this, Y).has("pkg")):
|
||||
return await p(this, Y).get("pkg").get(i);
|
||||
case (!!r && p(this, Y).has("pkg")):
|
||||
return await p(this, Y).get("pkg").get(r);
|
||||
default:
|
||||
throw new We(t);
|
||||
}
|
||||
@ -788,11 +788,11 @@ const ie = class ie {
|
||||
throw new Pt(t, s);
|
||||
}
|
||||
});
|
||||
v(this, "getRoutes", () => E.get("/api/my-router").then((t) => [...t, { uuid: "data-list-setting", isLayout: !0, uri: "/data-list-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/components/ff-design/DataListSetting", extra: { layout: "@pkg/frameworks/DesignTheme" } }, { uuid: "grid-layout-setting", isLayout: !0, uri: "/grid-layout-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/components/ff-design/GridLayoutSetting", extra: { layout: "@pkg/frameworks/DesignTheme" } }, { uuid: "grid-layout-form-setting", isLayout: !0, uri: "/grid-layout-form-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/components/ff-design/GridLayoutFormSetting", extra: { layout: "@pkg/frameworks/DesignTheme" } }, { uuid: "resource-api-setting", isLayout: !0, uri: "/resource-api-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/components/ff-design/ResourceApiSetting", extra: { layout: "@pkg/frameworks/DesignTheme" } }, { uuid: "charts-setting", isLayout: !0, uri: "/resource-api-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/components/ff-design/ChartsSetting", extra: { layout: "@pkg/frameworks/DesignTheme" } }, { uuid: "fsm-setting", isLayout: !0, uri: "/fsm-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/components/ff-design/FsmSetting", extra: { layout: "@pkg/frameworks/DesignTheme" } }, { uuid: "component-setting", isLayout: !0, uri: "/component-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/components/ff-design/ComponentSetting", extra: { layout: "@pkg/frameworks/DesignTheme" } }, { uuid: "login", uri: "/login", name: "登录", type: "fsdpf-component", isLogin: !1, component: "@pkg/components/ff/Login" }, { uuid: "not-found", uri: "*", name: "Not Found", type: "fsdpf-component", isLogin: !1, component: "@pkg/components/ff/NotFound" }].map(({ uuid: a, ...n }) => [a, { uuid: a, ...n }])).then((t) => new Map(t)));
|
||||
v(this, "getMenus", () => E.get("/api/my-menu"));
|
||||
v(this, "getConfigure", () => E.get("api/init-configure"));
|
||||
v(this, "getWidgetOperationAuth", () => E.get("/api/init-widget-operation-auth").then((t) => t.reduce((a, { uuid: n, auth: i }) => [...a, [n, i]], [])));
|
||||
v(this, "getPhoneNumber", (t) => E.get(`/api/user-wx-phone-number/${t}`));
|
||||
v(this, "getRoutes", () => x.get("/api/my-router").then((t) => [...t, { uuid: "data-list-setting", isLayout: !0, uri: "/data-list-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/components/ff-design/DataListSetting", extra: { layout: "@pkg/frameworks/DesignTheme" } }, { uuid: "grid-layout-setting", isLayout: !0, uri: "/grid-layout-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/components/ff-design/GridLayoutSetting", extra: { layout: "@pkg/frameworks/DesignTheme" } }, { uuid: "grid-layout-form-setting", isLayout: !0, uri: "/grid-layout-form-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/components/ff-design/GridLayoutFormSetting", extra: { layout: "@pkg/frameworks/DesignTheme" } }, { uuid: "resource-api-setting", isLayout: !0, uri: "/resource-api-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/components/ff-design/ResourceApiSetting", extra: { layout: "@pkg/frameworks/DesignTheme" } }, { uuid: "charts-setting", isLayout: !0, uri: "/resource-api-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/components/ff-design/ChartsSetting", extra: { layout: "@pkg/frameworks/DesignTheme" } }, { uuid: "fsm-setting", isLayout: !0, uri: "/fsm-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/components/ff-design/FsmSetting", extra: { layout: "@pkg/frameworks/DesignTheme" } }, { uuid: "component-setting", isLayout: !0, uri: "/component-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/components/ff-design/ComponentSetting", extra: { layout: "@pkg/frameworks/DesignTheme" } }, { uuid: "login", uri: "/login", name: "登录", type: "fsdpf-component", isLogin: !1, component: "@pkg/components/ff/Login" }, { uuid: "not-found", uri: "*", name: "Not Found", type: "fsdpf-component", isLogin: !1, component: "@pkg/components/ff/NotFound" }].map(({ uuid: a, ...n }) => [a, { uuid: a, ...n }])).then((t) => new Map(t)));
|
||||
v(this, "getMenus", () => x.get("/api/my-menu"));
|
||||
v(this, "getConfigure", () => x.get("api/init-configure"));
|
||||
v(this, "getWidgetOperationAuth", () => x.get("/api/init-widget-operation-auth").then((t) => t.reduce((a, { uuid: n, auth: i }) => [...a, [n, i]], [])));
|
||||
v(this, "getPhoneNumber", (t) => x.get(`/api/user-wx-phone-number/${t}`));
|
||||
v(this, "getUserToken", () => {
|
||||
const t = window.localStorage.getItem(tt);
|
||||
if (!t) return "";
|
||||
@ -814,28 +814,28 @@ const ie = class ie {
|
||||
try {
|
||||
const n = this.getUserToken();
|
||||
if (!n) return Promise.resolve(null);
|
||||
const { iat: i } = JSON.parse(window.atob((a = n == null ? void 0 : n.split(".")) == null ? void 0 : a[1])), { iat: r, ...s } = E.decode(window.localStorage.getItem(ot) || "", {});
|
||||
return r === i ? Promise.resolve(s) : E.get("/api/mine-info").then(({ User: o = null }) => (window.localStorage.setItem(ot, E.encode({ ...o, iat: i })), o));
|
||||
const { iat: i } = JSON.parse(window.atob((a = n == null ? void 0 : n.split(".")) == null ? void 0 : a[1])), { iat: r, ...s } = x.decode(window.localStorage.getItem(ot) || "", {});
|
||||
return r === i ? Promise.resolve(s) : x.get("/api/mine-info").then(({ User: o = null }) => (window.localStorage.setItem(ot, x.encode({ ...o, iat: i })), o));
|
||||
} catch (n) {
|
||||
console.error(n), t && Popup.error("请登录").then(logout);
|
||||
}
|
||||
return Promise.resolve(null);
|
||||
});
|
||||
v(this, "login", (t, a, n = {}) => E.post("/api/user-token", { username: t, passwd: Oa.hash(a), platform: "web", ...n }).then(({ token: i }) => (window.localStorage.setItem(tt, i), i)));
|
||||
v(this, "login", (t, a, n = {}) => x.post("/api/user-token", { username: t, passwd: Oa.hash(a), platform: "web", ...n }).then(({ token: i }) => (window.localStorage.setItem(tt, i), i)));
|
||||
v(this, "logout", () => {
|
||||
window.localStorage.removeItem(ot), window.localStorage.removeItem(tt);
|
||||
});
|
||||
if (p(ie, Se)) return p(ie, Se);
|
||||
}
|
||||
};
|
||||
Se = new WeakMap(), _ = new WeakMap(), F(ie, Se, null), v(ie, "getInstance", () => (p(ie, Se) || z(ie, Se, new ie()), p(ie, Se)));
|
||||
Se = new WeakMap(), Y = new WeakMap(), F(ie, Se, null), v(ie, "getInstance", () => (p(ie, Se) || B(ie, Se, new ie()), p(ie, Se)));
|
||||
let bt = ie;
|
||||
const Q = bt.getInstance(), kn = b.createContext({ user: {}, initUser: () => {
|
||||
const X = bt.getInstance(), kn = b.createContext({ user: {}, initUser: () => {
|
||||
}, initUserComplete: !1 }), Sn = b.createContext({ set: () => {
|
||||
}, get: () => {
|
||||
}, assign: () => {
|
||||
}, currentRoute: () => {
|
||||
} }), $t = (e) => !!(e != null && e.name) && (e.prototype instanceof b.Component || /^[A-Z]/.test(e.name)), Pn = Object.freeze(Object.defineProperty({ __proto__: null, AppContext: kn, AppGlobalParamsContext: Sn, cache: Jt, configure: De, default: Q, func: $e, http: E, isReactComponent: $t, route: Pe }, Symbol.toStringTag, { value: "Module" })), $n = (e, t, a = "children") => {
|
||||
} }), $t = (e) => !!(e != null && e.name) && (e.prototype instanceof b.Component || /^[A-Z]/.test(e.name)), Pn = Object.freeze(Object.defineProperty({ __proto__: null, AppContext: kn, AppGlobalParamsContext: Sn, cache: Jt, configure: De, default: X, func: $e, http: x, isReactComponent: $t, route: Pe }, Symbol.toStringTag, { value: "Module" })), $n = (e, t, a = "children") => {
|
||||
if (g.isEmpty(e)) return {};
|
||||
const n = g.find(e, ["value", t]);
|
||||
if (!g.isEmpty(n)) return n;
|
||||
@ -866,17 +866,17 @@ export {
|
||||
Ia as P,
|
||||
pn as Q,
|
||||
Xt as R,
|
||||
q as S,
|
||||
H as S,
|
||||
_e as T,
|
||||
Kt as U,
|
||||
W as V,
|
||||
K as W,
|
||||
q as V,
|
||||
_ as W,
|
||||
Dn as X,
|
||||
Wn as Y,
|
||||
qn as Z,
|
||||
Q as _,
|
||||
X as _,
|
||||
na as a,
|
||||
E as a0,
|
||||
x as a0,
|
||||
Jt as a1,
|
||||
De as a2,
|
||||
$e as a3,
|
2
dist/components.js
vendored
2
dist/components.js
vendored
@ -1,4 +1,4 @@
|
||||
import { X as s, N as p, Y as n, Z as t, W as d } from "./common/main-BWGhrIEF.js";
|
||||
import { X as s, N as p, Y as n, Z as t, W as d } from "./common/main-BHLR5OFm.js";
|
||||
export {
|
||||
s as Empty,
|
||||
p as Icon,
|
||||
|
2
dist/container.js
vendored
2
dist/container.js
vendored
@ -1,4 +1,4 @@
|
||||
import { T as o, X as s, Y as p, Z as t, U as d, W as n, V as r, S as u } from "./common/main-BWGhrIEF.js";
|
||||
import { T as o, X as s, Y as p, Z as t, U as d, W as n, V as r, S as u } from "./common/main-BHLR5OFm.js";
|
||||
export {
|
||||
o as Context,
|
||||
s as Empty,
|
||||
|
2
dist/data-list.js
vendored
2
dist/data-list.js
vendored
@ -1,4 +1,4 @@
|
||||
import { m as s, k as e, e as r, i, n as o, j as D, h as l, l as u, f as L, o as n, D as d, p as m, q as F, s as p, t as C, r as b } from "./common/main-BWGhrIEF.js";
|
||||
import { m as s, k as e, e as r, i, n as o, j as D, h as l, l as u, f as L, o as n, D as d, p as m, q as F, s as p, t as C, r as b } from "./common/main-BHLR5OFm.js";
|
||||
export {
|
||||
s as DataListContent,
|
||||
e as DataListContext,
|
||||
|
2
dist/data-list/utils.js
vendored
2
dist/data-list/utils.js
vendored
@ -1,5 +1,5 @@
|
||||
import "lodash";
|
||||
import { a as t } from "../common/main-BWGhrIEF.js";
|
||||
import { a as t } from "../common/main-BHLR5OFm.js";
|
||||
export {
|
||||
t as getDefaultExpandRowKeys
|
||||
};
|
||||
|
2
dist/grid-layout-form.js
vendored
2
dist/grid-layout-form.js
vendored
@ -1,4 +1,4 @@
|
||||
import { E as r, I as u, F as e, C as o, M as t, L as F, K as d, J as m } from "./common/main-BWGhrIEF.js";
|
||||
import { E as r, I as u, F as e, C as o, M as t, L as F, K as d, J as m } from "./common/main-BHLR5OFm.js";
|
||||
export {
|
||||
r as GridLayoutForm,
|
||||
u as GridLayoutFormHelper,
|
||||
|
2
dist/grid-layout-form/utils.js
vendored
2
dist/grid-layout-form/utils.js
vendored
@ -1,5 +1,5 @@
|
||||
import "lodash";
|
||||
import { a7 as a } from "../common/main-BWGhrIEF.js";
|
||||
import { a7 as a } from "../common/main-BHLR5OFm.js";
|
||||
export {
|
||||
a as getOptionItemByValue
|
||||
};
|
||||
|
2
dist/grid-layout.js
vendored
2
dist/grid-layout.js
vendored
@ -1,4 +1,4 @@
|
||||
import { b as d, c as e, H as u, G as i, u as t, d as o } from "./common/main-BWGhrIEF.js";
|
||||
import { b as d, c as e, H as u, G as i, u as t, d as o } from "./common/main-BHLR5OFm.js";
|
||||
export {
|
||||
d as GridLayout,
|
||||
e as GridLayoutWidget,
|
||||
|
2
dist/grid-layout/utils.js
vendored
2
dist/grid-layout/utils.js
vendored
@ -1,4 +1,4 @@
|
||||
import { g as t } from "../common/main-BWGhrIEF.js";
|
||||
import { g as t } from "../common/main-BHLR5OFm.js";
|
||||
export {
|
||||
t as getBoxStyle
|
||||
};
|
||||
|
2
dist/hooks.js
vendored
2
dist/hooks.js
vendored
@ -1,7 +1,7 @@
|
||||
import "lodash";
|
||||
import "rc-field-form";
|
||||
import "react";
|
||||
import { z as p, y as i, A as o, w as r, x as f, B as c, v as m } from "./common/main-BWGhrIEF.js";
|
||||
import { z as p, y as i, A as o, w as r, x as f, B as c, v as m } from "./common/main-BHLR5OFm.js";
|
||||
export {
|
||||
p as useDeepEffect,
|
||||
i as useDeepEqualEffect,
|
||||
|
2
dist/iconfont.js
vendored
2
dist/iconfont.js
vendored
@ -2,7 +2,7 @@ import "react/jsx-runtime";
|
||||
import "react";
|
||||
import "prop-types";
|
||||
import "classnames";
|
||||
import { N as a } from "./common/main-BWGhrIEF.js";
|
||||
import { N as a } from "./common/main-BHLR5OFm.js";
|
||||
export {
|
||||
a as default
|
||||
};
|
||||
|
2
dist/index.js
vendored
2
dist/index.js
vendored
@ -1,4 +1,4 @@
|
||||
import { a5 as t, a6 as e, a1 as o, a2 as p, _ as n, a3 as c, a0 as r, $ as f, a4 as u } from "./common/main-BWGhrIEF.js";
|
||||
import { a5 as t, a6 as e, a1 as o, a2 as p, _ as n, a3 as c, a0 as r, $ as f, a4 as u } from "./common/main-BHLR5OFm.js";
|
||||
export {
|
||||
t as AppContext,
|
||||
e as AppGlobalParamsContext,
|
||||
|
2
dist/res-ws.js
vendored
2
dist/res-ws.js
vendored
@ -1,5 +1,5 @@
|
||||
import "lodash";
|
||||
import { R as a } from "./common/main-BWGhrIEF.js";
|
||||
import { R as a } from "./common/main-BHLR5OFm.js";
|
||||
export {
|
||||
a as default
|
||||
};
|
||||
|
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "ff",
|
||||
"private": true,
|
||||
"version": "0.4.3",
|
||||
"version": "0.4.4",
|
||||
"author": "www.fsdpf.com",
|
||||
"type": "module",
|
||||
"main": "./dist/index.js",
|
||||
|
Loading…
Reference in New Issue
Block a user