v0.4.7
This commit is contained in:
parent
35599162e5
commit
64bc787e10
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-C2XZS82Q.js";
|
||||
import { P as s, O as u, Q as e } from "./common/main-DgNCIBN3.js";
|
||||
import "prop-types";
|
||||
export {
|
||||
s as auth,
|
||||
|
@ -4,10 +4,10 @@ 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), B = (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), z = (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) {
|
||||
B(e, t, i, a);
|
||||
z(e, t, i, a);
|
||||
},
|
||||
get _() {
|
||||
return p(e, t, n);
|
||||
@ -21,7 +21,7 @@ import { Form as Ze, Input as ha, Button as lt, Breadcrumb as fa, Tree as ya, Pa
|
||||
import { useMergedState as Pa } from "rc-util";
|
||||
import re, { FieldContext as $a, Field as Wt } from "rc-field-form";
|
||||
import { useParams as Na, generatePath as xa, createBrowserRouter as Ea, useInRouterContext as Ta, Navigate as Fa } from "react-router-dom";
|
||||
import O from "prop-types";
|
||||
import L from "prop-types";
|
||||
import "react-is";
|
||||
import { useNotification as Ra } from "rc-notification";
|
||||
import { N as Be, a as Ue, w as ct, S as Oa } from "./vender-DDOSHWIo.js";
|
||||
@ -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) && (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(() => {
|
||||
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(() => {
|
||||
p(this, Ae).forEach(([r, s, o]) => {
|
||||
try {
|
||||
const l = p(this, Re).call(this, p(this, de), ...r);
|
||||
@ -71,7 +71,7 @@ class Jt {
|
||||
p(this, Ie).set(i, r), a(r);
|
||||
}
|
||||
}));
|
||||
B(this, Re, a), B(this, Fe, t);
|
||||
z(this, Re, a), z(this, Fe, t);
|
||||
}
|
||||
}
|
||||
Ie = new WeakMap(), qe = new WeakMap(), Ae = new WeakMap(), de = new WeakMap(), Fe = new WeakMap(), Re = new WeakMap();
|
||||
@ -84,23 +84,23 @@ const Dn = () => c("div", { children: "Empty" }), _e = b.createContext({ ele: {}
|
||||
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;
|
||||
};
|
||||
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 };
|
||||
H.Action = Xe("actions"), H.Title = Xe("title"), H.SubTitle = Xe("sub-title"), H.Extra = Xe("extras"), H.propTypes = { className: L.string, style: L.object, title: L.any, subTitle: L.any, actions: L.any, extras: L.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 };
|
||||
Kt.propTypes = { children: L.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(H, { children: "Confirm" });
|
||||
var fe, Me;
|
||||
const ee = class ee {
|
||||
constructor() {
|
||||
F(this, Me, null);
|
||||
v(this, "init", (t) => B(this, Me, new Map(t)));
|
||||
v(this, "init", (t) => z(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) || B(ee, fe, new ee()), 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)));
|
||||
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,12 +153,12 @@ var ye, He;
|
||||
const te = class te {
|
||||
constructor() {
|
||||
F(this, He, null);
|
||||
v(this, "init", (t) => B(this, He, t));
|
||||
v(this, "init", (t) => z(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) || B(te, ye, new te()), 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)));
|
||||
let ut = te;
|
||||
const De = ut.getInstance(), Aa = (e, t, a, n, i) => {
|
||||
const r = b.lazy(() => X.getWidgetComponent(e).catch((s) => ({ default: () => `${s}` })));
|
||||
@ -184,11 +184,11 @@ const De = ut.getInstance(), Aa = (e, t, a, n, i) => {
|
||||
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: f, itemGridLayout: h, $setting: y, 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: f, 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": (y == null ? void 0 : y.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: f, title: h, tabs: y, 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, f);
|
||||
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: y, 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 })] })] });
|
||||
const { getBase62params: _, onClickCallback: W, onTabChange: D } = Ge(Le), { total: O, page: U, pageSize: J, tab: M } = _() || {}, K = ge((j, k, se) => c(Ba, { className: R("ff-data-list-framework-item", t), operations: r && k ? l == null ? void 0 : l.filter((V) => !(m && V.uuid && u.has(V.uuid)) || u.get(V.uuid).includes(k == null ? void 0 : k[m])) : [], data: d ? { [d]: k } : k, children: j, 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: f, className: a == null ? void 0 : a.toolbar, tabs: C, tab: M, onTabChange: D }), c(Ya, { ...h, className: a == null ? void 0 : a.content, style: { "--col-num": (y == null ? void 0 : y.colNum) || 1 }, primaryKey: m, itemRender: K, dataSource: n }), c(aa, { className: a == null ? void 0 : a.footer, isPaginate: i, isOperations: s, operations: o, total: O, page: U, pageSize: J })] })] });
|
||||
}, 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: f, title: h, tabs: y, isPaginate: C, isTreeSider: w, treeSiderConfig: E, isConditionFormLayout: A, ..._ }) => {
|
||||
const { getBase62params: W, onClickCallback: D, onTabChange: O } = Ge(Le), { total: U, page: J, tab: M, pageSize: K } = W() || {}, j = gt(u, i, d, f);
|
||||
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: y, tab: M, onTabChange: O }), c(Ha, { ..._, className: "ff-data-table-content", columns: r, dataSource: i, operationRender: j ? (k) => c("div", { className: "ff-data-table-actions", children: u == null ? void 0 : u.reduce((se, V, me) => [...se, c(S.Link, { size: "small", uuid: V.uuid, type: V.type, name: V.name, widget: V.widget, widgetType: V.widgetType, widgetProps: V.widgetProps, widgetData: V.widgetData, widgetSetting: V.widgetSetting, widgetContainerProps: V.widgetContainerSetting, data: k, onAfterClick: (Ne) => Ne !== !1 && (D == null ? void 0 : D(V.isRefresh, data)) }, V.uuid || me)], []) }) : null }), c(aa, { isPaginate: C, isOperations: o, operations: l, total: U, page: J, pageSize: K })] })] });
|
||||
}, Le = b.createContext({ listCode: "", getBase62params: (e, t) => {
|
||||
}, onReload: () => {
|
||||
}, onClickCallback: () => {
|
||||
@ -214,7 +214,7 @@ 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: [] });
|
||||
B(this, ue, new SharedWorker(new URL("/ff-worker/res-ws.js", self.location))), p(this, ue).port.onmessage = (t) => {
|
||||
z(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;
|
||||
@ -229,27 +229,27 @@ 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) || B(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) || z(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 = Q(t), d = Q(/* @__PURE__ */ new Map()), m = Q([]), [{ resource: f, primaryKey: h, batchOperations: y = [], 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();
|
||||
const l = oa(), u = Q(t), d = Q(/* @__PURE__ */ new Map()), m = Q([]), [{ resource: f, primaryKey: h, batchOperations: y = [], itemOperations: C = [], columns: w = [], themeConfig: E, theme: A, isConditionFormLayout: _ = !1, isTreeSider: W, treeSiderConfig: D, isItemGridLayout: O, itemGridLayout: U, title: J, isPaginate: M, tabs: K }, j] = 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: B, 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: B, 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(y);
|
||||
}, 380, { leading: !1, trailing: !0 }), se = gt(C, m.current, d.current, h), V = gt(y);
|
||||
N(() => {
|
||||
let T = null;
|
||||
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();
|
||||
return e && x.get(`/api/_/${e}`).resp(({ data: B, res: Ve }) => {
|
||||
B != null && B.isDynamicRefresh && (T = Xt.subscribe(() => k(), Ve)), u.current.pageSize = B.pageSize, j(B);
|
||||
}).catch(() => j({})), () => T == null ? void 0 : T();
|
||||
}, [e]), tn(() => {
|
||||
e && k(t);
|
||||
}, [e, t]);
|
||||
const me = () => {
|
||||
k();
|
||||
}, Ne = (T = 0, U = null) => {
|
||||
}, Ne = (T = 0, B = null) => {
|
||||
if (T === 2) {
|
||||
const Ve = g.get(U, "__PARENT_ID__", ""), xe = g.get(U, h, g.get(U, [f, h], "")), he = g.findIndex(m.current, ["__PARENT_ID__", Ve]), Ee = g.findIndex(he > -1 ? g.get(m.current, [he, "children"]) : m.current, [h, xe]);
|
||||
const Ve = g.get(B, "__PARENT_ID__", ""), xe = g.get(B, h, g.get(B, [f, 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 ? (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();
|
||||
@ -264,8 +264,8 @@ 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: K, itemClassName: n, classNames: s, resource: f, primaryKey: h, theme: i || A, themeProps: r || E, isTreeSider: W, treeSiderConfig: I, isPaginate: z, tabs: G, isItemOperations: se, isBatchOperations: L, batchOperations: y, 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 }) });
|
||||
const it = { listCode: e, title: J, itemClassName: n, classNames: s, resource: f, primaryKey: h, theme: i || A, themeProps: r || E, isTreeSider: W, treeSiderConfig: D, isPaginate: M, tabs: K, isItemOperations: se, isBatchOperations: V, batchOperations: y, itemOperations: C, isItemGridLayout: O, columns: w, itemGridLayout: U, isConditionFormLayout: _, itemOperationsAccess: d.current, dataSource: m.current };
|
||||
return c(Da, { ...it, className: R("ff-data-list-helper", a), getBase62params: (T, B, Ve = !1) => T == "init" ? t : T ? g.get(u.current, T, B) : u.current, onReload: me, onClickCallback: Ne, onConditonChange: (T, B) => k({ keyword: B, 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, B) => k({ page: T, pageSize: B }), 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" };
|
||||
return i != null && i.autoHeight ? s.height = "fit-content" : s["--grid-layout-row"] = `${n}`, s["--grid-layout-box-margin"] = Ot(i == null ? void 0 : i.marginTop, i == null ? void 0 : i.marginRight, i == null ? void 0 : i.marginBottom, i == null ? void 0 : i.marginLeft), s["--grid-layout-box-padding"] = Ot(i == null ? void 0 : i.paddingTop, i == null ? void 0 : i.paddingRight, i == null ? void 0 : i.paddingBottom, i == null ? void 0 : i.paddingLeft), r && (s.height = `${r}px`), s;
|
||||
@ -378,7 +378,7 @@ const ne = class ne {
|
||||
F(this, Ce, {});
|
||||
F(this, ve, null);
|
||||
v(this, "init", (t, a) => {
|
||||
B(this, Z, t), B(this, Ce, a);
|
||||
z(this, Z, t), z(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 = {}) => {
|
||||
@ -451,29 +451,29 @@ const ne = class ne {
|
||||
}
|
||||
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 }) }), B(this, ve, Ea(s, t));
|
||||
return s.push({ index: !0, element: b.createElement(en, { to: n, replace: !0 }) }), z(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) || B(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) || z(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) => _.notification(...e), success: (...e) => _.success(...e), error: (...e) => _.error(...e), form: (...e) => _.form(...e), modal: (...e) => _.modal(...e), confirm: (...e) => _.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) => G.notification(...e), success: (...e) => G.success(...e), error: (...e) => G.error(...e), form: (...e) => G.form(...e), modal: (...e) => G.modal(...e), confirm: (...e) => G.confirm(...e) } };
|
||||
var nt, ze, ke;
|
||||
const j = class j {
|
||||
const I = class I {
|
||||
constructor() {
|
||||
v(this, "exec", (t, a = {}, n = {}, i = "") => new Promise((r, s) => {
|
||||
const o = Et(j, nt)._++;
|
||||
p(j, ze).set(o, n), j.mQueue.set(o, [r, s]), je.postMessage({ id: o, session: i, category: "eval", method: t, args: a });
|
||||
const o = Et(I, nt)._++;
|
||||
p(I, ze).set(o, n), I.mQueue.set(o, [r, s]), je.postMessage({ id: o, session: i, category: "eval", method: t, args: a });
|
||||
}));
|
||||
v(this, "clear", (t) => je.postMessage({ session: t, category: "clear" }));
|
||||
if (p(j, ke)) return p(j, ke);
|
||||
if (p(I, ke)) return p(I, ke);
|
||||
Promise.resolve().then(() => Pn).then((t) => {
|
||||
Vt.http = t.http;
|
||||
}), je.addEventListener("message", ({ data: { id: t, task_id: a, method: n, args: i, category: r, data: s, error: o, session: l } }) => {
|
||||
if (r === "eval" && j.mQueue.has(t)) o !== null ? j.mQueue.get(t)[1](o) : j.mQueue.get(t)[0](s), p(j, ze).delete(t), j.mQueue.delete(t);
|
||||
if (r === "eval" && I.mQueue.has(t)) o !== null ? I.mQueue.get(t)[1](o) : I.mQueue.get(t)[0](s), p(I, ze).delete(t), I.mQueue.delete(t);
|
||||
else if (r === "util") try {
|
||||
const u = g.get(Vt, n.split("/")) || g.get(p(j, ze).get(a), n.split("/"));
|
||||
const u = g.get(Vt, n.split("/")) || g.get(p(I, ze).get(a), n.split("/"));
|
||||
if (!g.isFunction(u)) throw `${n} not found`;
|
||||
Promise.resolve(Reflect.apply(u, void 0, i)).then((d) => {
|
||||
je.postMessage({ id: t, task_id: a, category: r, method: n, args: i, session: l, data: d, error: null });
|
||||
@ -486,8 +486,8 @@ 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) || B(j, ke, new j()), p(j, ke)));
|
||||
let ht = j;
|
||||
nt = new WeakMap(), ze = new WeakMap(), ke = new WeakMap(), v(I, "mQueue", /* @__PURE__ */ new Map()), F(I, nt, 0), F(I, ze, /* @__PURE__ */ new Map()), F(I, ke, null), v(I, "getInstance", () => (p(I, ke) || z(I, ke, new I()), p(I, ke)));
|
||||
let ht = I;
|
||||
const $e = ht.getInstance(), oa = () => {
|
||||
const e = Q(!0), [, t] = b.useReducer((a) => a + 1, 0);
|
||||
return N(() => () => e.current = !1, []), () => e.current && t();
|
||||
@ -595,24 +595,24 @@ const $e = ht.getInstance(), oa = () => {
|
||||
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: f, $isReserved: h, initialValue: y, 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(y), 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, ...K }, fieldProps: { ...z, ...V }, $setting: u || {} });
|
||||
const { type: i, code: r, label: s, noStyle: o, placeholder: l, extras: u, validators: d, help: m, isVirtual: f, $isReserved: h, initialValue: y, initialValueLanguage: C, convertJs: w, convertJsSetting: E, widgetPerfix: A, boxStyle: _, widgetDecorator: W, subWidgets: D, ...O } = { ...t, ...n }, U = nn(d || {}, r, i), J = { label: s, noStyle: o, colon: !1, layout: "vertical" }, M = { placeholder: l, ...O }, K = ge((j) => j == null ? void 0 : g.toPrimitive(j, i), [i]);
|
||||
return c(Wt, { name: r, rules: U, initialValue: K(y), normalize: K, children: (j, k, se) => {
|
||||
var V;
|
||||
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: ((V = U == null ? void 0 : U[0]) == null ? void 0 : V.required) || !1, ...J }, fieldProps: { ...M, ...j }, $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");
|
||||
return $("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: [s, r && b.cloneElement(r, { cols: e, rowHeight: t, itemMargin: a, containerPadding: n, fields: i })] });
|
||||
};
|
||||
St.propTypes = { fields: O.array };
|
||||
St.propTypes = { fields: L.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: f, autoComplete: h, resource: y, 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: y }, { name: "__LAYOUT_KEY__", value: e }, { name: "__LAYOUT_UUID__", value: K }, { name: "__PRIMARY_KEY__", value: n }], [D, e, K, y, n, r]);
|
||||
return $(re, { className: l, name: a || e, layout: t || f, 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) => {
|
||||
const { align: f, autoComplete: h, resource: y, items: C, hides: w, rowHeight: E, marginX: A, marginY: _, cols: W, listenChangeFields: D, listenChangeFieldsFunc: O, pk: U, uuid: J } = an(e), [M] = re.useForm(s), K = pe(() => [{ name: "__PK__", value: U }, { name: "__PROPS__", value: r }, { name: "__RESOURCE__", value: y }, { name: "__LAYOUT_KEY__", value: e }, { name: "__LAYOUT_UUID__", value: J }, { name: "__PRIMARY_KEY__", value: n }], [U, e, J, y, n, r]);
|
||||
return $(re, { className: l, name: a || e, layout: t || f, fields: K, form: M, autoComplete: h, style: { ...i, position: "relative" }, onFinish: u, onValuesChange: (j, k) => (({ changedValues: se, allValues: V, listenChangeFields: me, listenChangeFieldsFunc: Ne, onValuesChange: it, code: T }) => {
|
||||
it(se, V), Ne && Array.isArray(me) && $e.exec(Ne, { changedValues: se, allValues: V }, { getFieldValue: M.getFieldValue, setFieldsValue: M.setFieldsValue, isFieldTouched: M.isFieldTouched, isFieldsTouched: M.isFieldsTouched });
|
||||
})({ changedValues: j, allValues: k, listenChangeFields: D, listenChangeFieldsFunc: O, onValuesChange: d, code: e }), children: [c(It, { ...m, form: M, code: e, fields: C, cols: W, rowHeight: E, itemMargin: [A, _] }), w == null ? void 0 : w.map((j) => {
|
||||
var k;
|
||||
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));
|
||||
return c(Wt, { name: j.code, children: c(on, { form: M, name: j.code, type: j.type, initialValue: j.initialValue, initialValueLanguage: (k = j.extras) == null ? void 0 : k.initialValueLanguage }) }, JSON.stringify(j.code));
|
||||
})] });
|
||||
});
|
||||
var It;
|
||||
@ -622,14 +622,14 @@ const da = ({ $setting: e, $close: t, extras: a, code: n, primaryKey: i, ...r })
|
||||
o && s.setFieldsValue(o);
|
||||
}, [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) => x.post(i ? `${u}/${i}` : `${u}`, d).msg(t)).catch(() => _.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(() => G.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 ? 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 }) => {
|
||||
}, Mt = (e, t, a, n) => g.isString(t) && t ? X.getWidgetComponent(t).then(({ default: i }) => G.modal(i, { ...e, $setting: a }, n)).catch((i) => {
|
||||
G.error(t, { content: i.toString() });
|
||||
}) : G.modal(t, { ...e, $setting: a }, n), un = (e, t, a, n) => G.modal(da, { ...e, $setting: a, code: t }, n), gn = (e, t, a, n) => G.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":
|
||||
@ -660,39 +660,39 @@ const da = ({ $setting: e, $close: t, extras: a, code: n, primaryKey: i, ...r })
|
||||
}), zt.add(a), document.body.appendChild(n);
|
||||
}
|
||||
}, 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: f, tooltip: h, popConfirm: y, 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: "取消", ...y || {}, disabled: G || f, open: D, onOpenChange: (k) => {
|
||||
if (!k) return K(k);
|
||||
y ? K(k) : z(d);
|
||||
yt.propTypes = { className: L.string, type: L.string.isRequired, style: L.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: f, tooltip: h, popConfirm: y, widget: C, widgetType: w, widgetData: E, widgetProps: A, widgetSetting: _, widgetContainerProps: W, ...D }) {
|
||||
const O = { type: "primary", className: R("ff-button", t), iconPosition: s };
|
||||
r === "danger" ? O.danger = !0 : r === "default" && (O.type = r), e === "link" || e === "dashed" ? (O.type = e, r === "default" && (O.className = R(O.className, "ff-default"))) : e !== "circle" && e !== "round" || (O.shape = e), i && (O.icon = c(yt, { type: i }));
|
||||
const [U, J] = P(!1), [M, { disabled: K, loading: j }] = pn({ widget: C, widgetType: w, widgetData: E, widgetProps: A, widgetSetting: _, widgetContainerProps: W }, { onAfterClick: l, onBeforeClick: u });
|
||||
return c(va, { okText: "确定", cancelText: "取消", ...y || {}, disabled: K || f, open: U, onOpenChange: (k) => {
|
||||
if (!k) return J(k);
|
||||
y ? J(k) : M(d);
|
||||
}, onConfirm: () => {
|
||||
z(d);
|
||||
M(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: G || f, ...M, ...I, children: a || n }) }) });
|
||||
}, children: c(ka, { ...h, title: U ? null : h == null ? void 0 : h.title, trigger: ["hover", "click"], children: c(lt, { loading: j || m, disabled: K || f, ...O, ...D, 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, f] = P("hover"), [h, y] = P({}), [C, w] = P(), { placement: E, ...A } = o || {};
|
||||
const l = Ge(Le), [u, d] = P(!1), [m, f] = P("hover"), [h, y] = P({}), [C, w] = P(), { placement: E, align: 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) ? 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 }));
|
||||
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: O }) => {
|
||||
w(b.createElement(O, { ...i, $setting: s }));
|
||||
}).catch((O) => w(O.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(y);
|
||||
}, [r, e]);
|
||||
const J = (I) => {
|
||||
d(I), !I && f("hover");
|
||||
}, W = () => {
|
||||
const W = (O) => {
|
||||
d(O), !O && f("hover");
|
||||
}, D = () => {
|
||||
d(!0), f("click");
|
||||
};
|
||||
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 });
|
||||
return c(Sa, { zIndex: 1e3, placement: E, onPopupClick: D, onClick: D, open: u, align: A, trigger: m, content: c(wn, { ..._, children: C && b.cloneElement(C, { ...h, $close: () => W(!1) }) }), children: n, onOpenChange: W });
|
||||
}, wn = ({ title: e, className: t, children: a, width: n, height: i, ...r }) => {
|
||||
const [s, o] = P({}), l = ge((m, f) => o((h) => ({ ...h, [m]: f })), []), u = ge((m) => o((f) => ({ ...f, [m]: void 0 })), []), d = e ? b.createElement("div", { className: "ff-popup-title" }, e) : s == null ? void 0 : s.title;
|
||||
return c(_e.Provider, { value: { ele: s, mount: l, unmount: u }, children: $("div", { className: R("ff-popup ff-popover", t), style: { width: n, height: i }, ...r, children: [d || s != null && s["sub-title"] ? $("div", { className: "ff-popup-header", children: [d || c("div", { className: "ff-popup-title" }), (s == null ? void 0 : s["sub-title"]) || c("div", { className: "ff-popup-sub-title" })] }) : null, a, s != null && s.extras || s != null && s.actions ? $("div", { className: "ff-popup-footer", children: [(s == null ? void 0 : s.extras) || c("div", { className: "ff-popup-extras" }), (s == null ? void 0 : s.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;
|
||||
Bt.propTypes = { widgetType: L.oneOf(["fsdpf-component", "grid-layout-form", "data-list"]) }, S.propTypes = { type: L.oneOf(["primary", "default", "danger", ""]), name: L.string, icon: L.string, iconPosition: L.oneOf(["start", "end"]), data: L.any, widget: L.any, widgetType: L.oneOf(["destroy", "redirect", "func", "fsdpf-component", "grid-layout-form", "grid-layout", "data-list"]), widgetData: L.object, widgetProps: L.object, widgetSetting: L.object, widgetContainerProps: L.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(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)) }) });
|
||||
@ -707,7 +707,7 @@ 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, { ...f, placement: e, open: l, afterOpenChange: (y) => !y && h() }) : c(vn, { ...f, visible: l, afterClose: h }) });
|
||||
};
|
||||
ua.propTypes = { placement: O.oneOf(["center", "left", "top", "right", "bottom"]) };
|
||||
ua.propTypes = { placement: L.oneOf(["center", "left", "top", "right", "bottom"]) };
|
||||
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;
|
||||
@ -728,7 +728,7 @@ const q = () => {
|
||||
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 = {}) => 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) => {
|
||||
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 }), G = { 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,7 +738,7 @@ 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) => _[[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) => G[[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));
|
||||
} }, x = wt;
|
||||
@ -828,7 +828,7 @@ const ie = class ie {
|
||||
if (p(ie, Se)) return 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)));
|
||||
Se = new WeakMap(), Y = new WeakMap(), F(ie, Se, null), v(ie, "getInstance", () => (p(ie, Se) || z(ie, Se, new ie()), p(ie, Se)));
|
||||
let bt = ie;
|
||||
const X = bt.getInstance(), kn = b.createContext({ user: {}, initUser: () => {
|
||||
}, initUserComplete: !1 }), Sn = b.createContext({ set: () => {
|
||||
@ -870,7 +870,7 @@ export {
|
||||
_e as T,
|
||||
Kt as U,
|
||||
q as V,
|
||||
_ as W,
|
||||
G as W,
|
||||
Dn as X,
|
||||
Wn as Y,
|
||||
qn as Z,
|
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-C2XZS82Q.js";
|
||||
import { X as s, N as p, Y as n, Z as t, W as d } from "./common/main-DgNCIBN3.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-C2XZS82Q.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-DgNCIBN3.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-C2XZS82Q.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-DgNCIBN3.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-C2XZS82Q.js";
|
||||
import { a as t } from "../common/main-DgNCIBN3.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-C2XZS82Q.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-DgNCIBN3.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-C2XZS82Q.js";
|
||||
import { a7 as a } from "../common/main-DgNCIBN3.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-C2XZS82Q.js";
|
||||
import { b as d, c as e, H as u, G as i, u as t, d as o } from "./common/main-DgNCIBN3.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-C2XZS82Q.js";
|
||||
import { g as t } from "../common/main-DgNCIBN3.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-C2XZS82Q.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-DgNCIBN3.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-C2XZS82Q.js";
|
||||
import { N as a } from "./common/main-DgNCIBN3.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-C2XZS82Q.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-DgNCIBN3.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-C2XZS82Q.js";
|
||||
import { R as a } from "./common/main-DgNCIBN3.js";
|
||||
export {
|
||||
a as default
|
||||
};
|
||||
|
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "ff",
|
||||
"private": true,
|
||||
"version": "0.4.6",
|
||||
"version": "0.4.7",
|
||||
"author": "www.fsdpf.com",
|
||||
"type": "module",
|
||||
"main": "./dist/index.js",
|
||||
|
Loading…
Reference in New Issue
Block a user