This commit is contained in:
what 2025-07-23 15:28:16 +08:00
parent 5b01c0ff3b
commit c869014fdf
17 changed files with 142 additions and 142 deletions

2
dist/button.js vendored
View File

@ -1,4 +1,4 @@
import { a4 as s, a3 as u, a5 as e } from "./common/main--iillTPv.js"; import { a4 as s, a3 as u, a5 as e } from "./common/main-BpRlLf9Z.js";
export { export {
s as auth, s as auth,
u as default, u as default,

View File

@ -63,8 +63,8 @@ $e = new WeakMap(), Ve = new WeakMap(), Te = new WeakMap(), ce = new WeakMap(),
const sr = () => g("div", { children: "Empty" }), qe = k.createContext({ ele: {}, mount: () => { const sr = () => g("div", { children: "Empty" }), qe = k.createContext({ ele: {}, mount: () => {
}, unmount: () => { }, unmount: () => {
} }), G = ({ rootClassName: e, className: t, children: i, actions: n, title: r, subTitle: a, extras: o, style: s = {} }) => { } }), G = ({ rootClassName: e, className: t, children: i, actions: n, title: r, subTitle: a, extras: o, style: s = {} }) => {
const { mount: l, unmount: u } = k.useContext(qe); const { mount: l, unmount: d } = k.useContext(qe);
return G.Action({ children: n }), G.Title({ children: r }), G.SubTitle({ children: a }), G.Extra({ children: o }), j(() => (l("rootClassName", e), () => u(e)), [e]), g("div", { className: z("ff-container", t), style: s, children: i }); return G.Action({ children: n }), G.Title({ children: r }), G.SubTitle({ children: a }), G.Extra({ children: o }), j(() => (l("rootClassName", e), () => d(e)), [e]), g("div", { className: z("ff-container", t), style: s, children: i });
}, Ge = (e) => ({ children: t, className: i }) => { }, Ge = (e) => ({ children: t, className: i }) => {
const { mount: n, unmount: r } = k.useContext(qe); const { mount: n, unmount: r } = k.useContext(qe);
return j(() => (t && n(e, k.createElement("div", { key: `ff-${e}`, className: z(`ff-popup-${e}`, i) }, t)), () => r(e)), [i, t]), null; return j(() => (t && n(e, k.createElement("div", { key: `ff-${e}`, className: z(`ff-popup-${e}`, i) }, t)), () => r(e)), [i, t]), null;
@ -128,7 +128,7 @@ const Ae = ht.getInstance(), It = { null2json: (e) => Object.create(), null2arra
for (let a in e) { for (let a in e) {
let o; let o;
if (Reflect.has(e[a], "type") && ["code", "field", "router", "query", "string"].includes(e[a].type)) { if (Reflect.has(e[a], "type") && ["code", "field", "router", "query", "string"].includes(e[a].type)) {
const { type: s, value: l = "", default: u = n } = e[a]; const { type: s, value: l = "", default: d = n } = e[a];
switch (s) { switch (s) {
case "code": case "code":
o = await Ce.exec(l, t, i); o = await Ce.exec(l, t, i);
@ -143,7 +143,7 @@ const Ae = ht.getInstance(), It = { null2json: (e) => Object.create(), null2arra
case "string": case "string":
o = l; o = l;
} }
o ?? (o = u); o ?? (o = d);
} else o = await ni(e[a], t, i, n); } else o = await ni(e[a], t, i, n);
c.set(r, a, o); c.set(r, a, o);
} }
@ -231,23 +231,23 @@ const Qi = (e, t = {}) => H(() => e == null ? void 0 : e.map(({ widgetByJs: i, w
}, [e, t]), i; }, [e, t]), i;
}, ai = (e = [], t = /* @__PURE__ */ new Map(), i = "id", n) => { }, ai = (e = [], t = /* @__PURE__ */ new Map(), i = "id", n) => {
const r = Y(n ? (a) => c.get(a, i, c.get(a, [n, i])) : (a) => c.get(a, i), [i, n]); const r = Y(n ? (a) => c.get(a, i, c.get(a, [n, i])) : (a) => c.get(a, i), [i, n]);
return Y((a) => e == null ? void 0 : e.filter((o) => !o.uuid || !t.has(o.uuid) || t.get(o.uuid).includes(`${r(a)}`)), [e, t, r]); return Y((a) => e == null ? void 0 : e.filter((o) => !o.uuid || !t.has(o.uuid) || t.get(o.uuid).some((s) => s == r(a))), [e, t, r]);
}, ft = (e = [], t = /* @__PURE__ */ new Map(), i = [], n = "id", r) => { }, ft = (e = [], t = /* @__PURE__ */ new Map(), i = [], n = "id", r) => {
const a = Y(r ? (o) => c.get(o, n, c.get(o, [r, n])) : (o) => c.get(o, n), [n, r]); const a = Y(r ? (o) => c.get(o, n, c.get(o, [r, n])) : (o) => c.get(o, n), [n, r]);
return H(() => { return H(() => {
if (c.isEmpty(e) || !e.some(({ uuid: s }) => Yi.check(s))) return !1; if (c.isEmpty(e) || !e.some(({ uuid: s }) => Yi.check(s))) return !1;
if (c.isEmpty(t) || c.isEmpty(i)) return !0; if (c.isEmpty(t) || c.isEmpty(i)) return !0;
const o = i.map((s) => `${a(s)}`); const o = i.map((s) => a(s));
return e.some(({ uuid: s }) => !s || !t.has(s) || t.get(s).some((l) => o.includes(`${l}`))); return e.some(({ uuid: s }) => !s || !t.has(s) || t.get(s).some((l) => o.some((d) => d == l)));
}, [e, i, t, a]); }, [e, i, t, a]);
}, Zi = (e, t, i = "id", n = null) => { }, Zi = (e, t, i = "id", n = null) => {
const r = at(), a = U(!1), o = U(e.dataSource), s = U(e.itemOperationsAccess); const r = at(), a = U(!1), o = U(e.dataSource), s = U(e.itemOperationsAccess);
return j(() => (o.current = e.dataSource, s.current = e.itemOperationsAccess, () => a.current = !1), [e.dataSource, e.itemOperationsAccess]), a.current && (e.dataSource = o.current, e.itemOperationsAccess = s.current), [e, (l = 0, u = null) => { return j(() => (o.current = e.dataSource, s.current = e.itemOperationsAccess, () => a.current = !1), [e.dataSource, e.itemOperationsAccess]), a.current && (e.dataSource = o.current, e.itemOperationsAccess = s.current), [e, (l = 0, d = null) => {
var p, d; var p, u;
if (a.current = !1, l === 1) return (p = e.onReload) == null ? void 0 : p.call(e); if (a.current = !1, l === 1) return (p = e.onReload) == null ? void 0 : p.call(e);
if (l === 2) { if (l === 2) {
const f = c.get(u, "__PARENT_ID__", ""), m = c.get(u, i, c.get(u, [n, i], "")), h = c.findIndex(o.current, ["__PARENT_ID__", f]), b = c.findIndex(h > -1 ? c.get(o.current, [h, "children"]) : o.current, [i, m]); const f = c.get(d, "__PARENT_ID__", ""), m = c.get(d, i, c.get(d, [n, i], "")), h = c.findIndex(o.current, ["__PARENT_ID__", f]), b = c.findIndex(h > -1 ? c.get(o.current, [h, "children"]) : o.current, [i, m]);
if (b === -1) return (d = e.onReload) == null ? void 0 : d.call(e); if (b === -1) return (u = e.onReload) == null ? void 0 : u.call(e);
Promise.all([L.get(`/api/${t}/detail/${m}`), L.post(`/api/${t}/list-operations-access`, { ids: m })]).then(([C, x]) => { Promise.all([L.get(`/api/${t}/detail/${m}`), L.post(`/api/${t}/list-operations-access`, { ids: m })]).then(([C, x]) => {
const T = c.get(o.current, h > -1 ? [h, "children", b, "children"] : [b, "children"]); const T = c.get(o.current, h > -1 ? [h, "children", b, "children"] : [b, "children"]);
o.current = _t(o.current, h > -1 ? { [h]: { children: { $splice: [[b, 1, { ...C, children: T }]] } } } : { $splice: [[b, 1, { ...C, children: T }]] }); o.current = _t(o.current, h > -1 ? { [h]: { children: { $splice: [[b, 1, { ...C, children: T }]] } } } : { $splice: [[b, 1, { ...C, children: T }]] });
@ -265,21 +265,21 @@ const Qi = (e, t = {}) => H(() => e == null ? void 0 : e.map(({ widgetByJs: i, w
}]; }];
}, en = (e, t) => { }, en = (e, t) => {
const i = at(), n = U(t), r = U(/* @__PURE__ */ new Map()), a = U([]), o = c.throttle((l) => { const i = at(), n = U(t), r = U(/* @__PURE__ */ new Map()), a = U([]), o = c.throttle((l) => {
a.current = [], L.list(e, c.pick({ ...n.current, ...l }, ["tab", "page", "pageSize", "condition", "sider", "keyword"])).then(({ keyword: u, condition: p, total: d, tab: f, sider: m, page: h, pageSize: b, operationsAccess: C, dataSource: x }) => { a.current = [], L.list(e, c.pick({ ...n.current, ...l }, ["tab", "page", "pageSize", "condition", "sider", "keyword"])).then(({ keyword: d, condition: p, total: u, tab: f, sider: m, page: h, pageSize: b, operationsAccess: C, dataSource: x }) => {
n.current = { tab: f, condition: p, sider: m, keyword: u, total: d, pageSize: b, page: x != null && x.length ? h : 1 }, a.current = x, r.current = new Map(C), i(); n.current = { tab: f, condition: p, sider: m, keyword: d, total: u, pageSize: b, page: x != null && x.length ? h : 1 }, a.current = x, r.current = new Map(C), i();
}); });
}, 380, { leading: !1, trailing: !0 }); }, 380, { leading: !1, trailing: !0 });
st(() => { st(() => {
a.current = [], e && o(t); a.current = [], e && o(t);
}, [e, t]); }, [e, t]);
const s = H(() => c.pick(n.current, ["total", "tab", "page", "pageSize", "condition", "sider", "keyword"]), [n.current]); const s = H(() => c.pick(n.current, ["total", "tab", "page", "pageSize", "condition", "sider", "keyword"]), [n.current]);
return Object.assign(s, { onTabChange: (l) => o({ tab: l, page: 1 }), onPageChange: (l, u) => o({ page: l, pageSize: u }), onPageSizeChange: (l) => o({ pageSize: l, page: 1 }), onConditionChange: (l, u) => o({ keyword: u, condition: _t(n.current.condition || {}, { $merge: l || {} }), page: 1 }), onSiderChange: (l) => o({ sider: l, page: 1 }), onKeywordChange: (l) => o({ keyword: l, page: 1 }), itemOperationsAccess: r.current, dataSource: a.current, onReload: o }); return Object.assign(s, { onTabChange: (l) => o({ tab: l, page: 1 }), onPageChange: (l, d) => o({ page: l, pageSize: d }), onPageSizeChange: (l) => o({ pageSize: l, page: 1 }), onConditionChange: (l, d) => o({ keyword: d, condition: _t(n.current.condition || {}, { $merge: l || {} }), page: 1 }), onSiderChange: (l) => o({ sider: l, page: 1 }), onKeywordChange: (l) => o({ keyword: l, page: 1 }), itemOperationsAccess: r.current, dataSource: a.current, onReload: o });
}, tn = ({ listCode: e, className: t, layouts: i, dataSource: n, isPaginate: r, isItemOperations: a, isBatchOperations: o, batchOperations: s, itemOperations: l, itemOperationsAccess: u, resource: p, primaryKey: d, title: f, itemGridLayout: m, $setting: h, tabs: b, isConditionFormLayout: C, isTreeSider: x, treeSiderConfig: T }) => { }, tn = ({ listCode: e, className: t, layouts: i, dataSource: n, isPaginate: r, isItemOperations: a, isBatchOperations: o, batchOperations: s, itemOperations: l, itemOperationsAccess: d, resource: p, primaryKey: u, title: f, itemGridLayout: m, $setting: h, tabs: b, isConditionFormLayout: C, isTreeSider: x, treeSiderConfig: T }) => {
const { classNames: P, onClickCallback: O } = le(te), V = ai(l, u, d, p), q = Y((I, M, N) => g(nn, { className: z("ff-data-list-framework-item", P.item), operations: a ? V(M) : [], data: p ? { [p]: M } : M, children: I, onClickCallback: O }), [p, d, a, O, l, u]); const { classNames: P, onClickCallback: O } = le(te), V = ai(l, d, u, p), q = Y((I, M, N) => g(nn, { className: z("ff-data-list-framework-item", P.item), operations: a ? V(M) : [], data: p ? { [p]: M } : M, children: I, onClickCallback: O }), [p, u, a, O, l, d]);
return A("div", { className: z("ff-data-list-framework", t), children: [g(i.sider, { isTreeSider: x, ...T }), A("div", { className: z("ff-data-list-container", P == null ? void 0 : P.container), children: [g(i.filter, { isConditionFormLayout: C }), g(i.toolbar, { title: f, tabs: b }), g(hn, { ...m, style: { "--col-num": (h == null ? void 0 : h.colNum) || 1 }, primaryKey: d, itemRender: q, dataSource: n }), g(i.footer, { isPaginate: r, isOperations: o, operations: s })] })] }); return A("div", { className: z("ff-data-list-framework", t), children: [g(i.sider, { isTreeSider: x, ...T }), A("div", { className: z("ff-data-list-container", P == null ? void 0 : P.container), children: [g(i.filter, { isConditionFormLayout: C }), g(i.toolbar, { title: f, tabs: b }), g(hn, { ...m, style: { "--col-num": (h == null ? void 0 : h.colNum) || 1 }, primaryKey: u, itemRender: q, dataSource: n }), g(i.footer, { isPaginate: r, isOperations: o, operations: s })] })] });
}, nn = ({ className: e, operations: t, children: i, data: n, onClickCallback: r }) => A("div", { className: z("data-list-grid-layout-item-container", e), children: [i, !!(t != null && t.length) && g("div", { className: "data-list-grid-layout-item-actions", children: t.map((a) => g("span", { className: "data-list-grid-layout-item-action", children: g($.Link, { uuid: a.uuid, type: a.type, name: a.name, widget: a.widget, widgetType: a.widgetType, widgetProps: a.widgetProps, widgetSetting: a.widgetSetting, widgetContainerProps: a.widgetContainerSetting, data: n, confirm: a.confirm, onAfterClick: (o) => o !== !1 && (r == null ? void 0 : r(a.isRefresh, n)) }, a.uuid || Le()) }, (a == null ? void 0 : a.uuid) || Le())) })] }), rn = ({ listCode: e, className: t, layouts: i, dataSource: n, columns: r, isItemOperations: a, isBatchOperations: o, batchOperations: s, itemOperations: l, itemOperationsAccess: u, resource: p, primaryKey: d, title: f, tabs: m, isPaginate: h, isTreeSider: b, treeSiderConfig: C, isConditionFormLayout: x, ...T }) => { }, nn = ({ className: e, operations: t, children: i, data: n, onClickCallback: r }) => A("div", { className: z("data-list-grid-layout-item-container", e), children: [i, !!(t != null && t.length) && g("div", { className: "data-list-grid-layout-item-actions", children: t.map((a) => g("span", { className: "data-list-grid-layout-item-action", children: g($.Link, { uuid: a.uuid, type: a.type, name: a.name, widget: a.widget, widgetType: a.widgetType, widgetProps: a.widgetProps, widgetSetting: a.widgetSetting, widgetContainerProps: a.widgetContainerSetting, data: n, confirm: a.confirm, onAfterClick: (o) => o !== !1 && (r == null ? void 0 : r(a.isRefresh, n)) }, a.uuid || Le()) }, (a == null ? void 0 : a.uuid) || Le())) })] }), rn = ({ listCode: e, className: t, layouts: i, dataSource: n, columns: r, isItemOperations: a, isBatchOperations: o, batchOperations: s, itemOperations: l, itemOperationsAccess: d, resource: p, primaryKey: u, title: f, tabs: m, isPaginate: h, isTreeSider: b, treeSiderConfig: C, isConditionFormLayout: x, ...T }) => {
const { classNames: P, onClickCallback: O } = le(te), V = ai(l, u, d, p), q = ft(l, u, n, d, p); const { classNames: P, onClickCallback: O } = le(te), V = ai(l, d, u, p), q = ft(l, d, n, u, p);
return A("div", { className: z("ff-data-table-framework", t), children: [g(i.sider, { isTreeSider: b, ...C }), A("div", { className: z("ff-data-table-container", P == null ? void 0 : P.container), children: [g(i.filter, { isConditionFormLayout: x }), g(i.toolbar, { title: f, tabs: m }), g(dn, { ...T, primaryKey: d, className: "ff-data-table-content", columns: r, dataSource: n, operationRender: q ? (I) => { return A("div", { className: z("ff-data-table-framework", t), children: [g(i.sider, { isTreeSider: b, ...C }), A("div", { className: z("ff-data-table-container", P == null ? void 0 : P.container), children: [g(i.filter, { isConditionFormLayout: x }), g(i.toolbar, { title: f, tabs: m }), g(dn, { ...T, primaryKey: u, className: "ff-data-table-content", columns: r, dataSource: n, operationRender: q ? (I) => {
var M; var M;
return g("div", { className: "ff-data-table-actions", children: (M = V(I)) == null ? void 0 : M.map((N, S) => g($.Link, { size: "small", uuid: N.uuid, type: N.type, name: N.name, widget: N.widget, widgetType: N.widgetType, widgetProps: N.widgetProps, widgetData: N.widgetData, widgetSetting: N.widgetSetting, widgetContainerProps: N.widgetContainerSetting, data: I, confirm: N.confirm, onAfterClick: (E) => E !== !1 && (O == null ? void 0 : O(N.isRefresh, I)) }, N.uuid || S)) }); return g("div", { className: "ff-data-table-actions", children: (M = V(I)) == null ? void 0 : M.map((N, S) => g($.Link, { size: "small", uuid: N.uuid, type: N.type, name: N.name, widget: N.widget, widgetType: N.widgetType, widgetProps: N.widgetProps, widgetData: N.widgetData, widgetSetting: N.widgetSetting, widgetContainerProps: N.widgetContainerSetting, data: I, confirm: N.confirm, onAfterClick: (E) => E !== !1 && (O == null ? void 0 : O(N.isRefresh, I)) }, N.uuid || S)) });
} : null }), g(i.footer, { isPaginate: h, isOperations: o, operations: s })] })] }); } : null }), g(i.footer, { isPaginate: h, isOperations: o, operations: s })] })] });
@ -297,19 +297,19 @@ const Qi = (e, t = {}) => H(() => e == null ? void 0 : e.map(({ widgetByJs: i, w
return r != null && r.autoHeight ? o.height = "fit-content" : o["--grid-layout-row"] = `${n}`, r != null && r.alignItems && (o["--grid-layout-box-align-items"] = r.alignItems), r != null && r.justifyContent && (o["--grid-layout-box-justify-content"] = r.justifyContent), o["--grid-layout-box-margin"] = Mt(r == null ? void 0 : r.marginTop, r == null ? void 0 : r.marginRight, r == null ? void 0 : r.marginBottom, r == null ? void 0 : r.marginLeft), o["--grid-layout-box-padding"] = Mt(r == null ? void 0 : r.paddingTop, r == null ? void 0 : r.paddingRight, r == null ? void 0 : r.paddingBottom, r == null ? void 0 : r.paddingLeft), a && (o.height = `${a}px`), o; return r != null && r.autoHeight ? o.height = "fit-content" : o["--grid-layout-row"] = `${n}`, r != null && r.alignItems && (o["--grid-layout-box-align-items"] = r.alignItems), r != null && r.justifyContent && (o["--grid-layout-box-justify-content"] = r.justifyContent), o["--grid-layout-box-margin"] = Mt(r == null ? void 0 : r.marginTop, r == null ? void 0 : r.marginRight, r == null ? void 0 : r.marginBottom, r == null ? void 0 : r.marginLeft), o["--grid-layout-box-padding"] = Mt(r == null ? void 0 : r.paddingTop, r == null ? void 0 : r.paddingRight, r == null ? void 0 : r.paddingBottom, r == null ? void 0 : r.paddingLeft), a && (o.height = `${a}px`), o;
}, Mt = (e, t, i, n) => `${e || 0}px ${t || 0}px ${i || 0}px ${n || 0}px`, hr = (e = "Text", t = "@pkg/ff/grid-layouts") => e != null && e.startsWith("@") || e != null && e.startsWith("blob:") ? e : `${t}/${e}`, oi = ({ className: e, isConditionFormLayout: t }) => { }, Mt = (e, t, i, n) => `${e || 0}px ${t || 0}px ${i || 0}px ${n || 0}px`, hr = (e = "Text", t = "@pkg/ff/grid-layouts") => e != null && e.startsWith("@") || e != null && e.startsWith("blob:") ? e : `${t}/${e}`, oi = ({ className: e, isConditionFormLayout: t }) => {
var f, m; var f, m;
const [i, n] = F({}), { listCode: r, onKeywordChange: a, onConditionChange: o, getBase62params: s, classNames: l } = k.useContext(te), { keyword: u, condition: p } = (s == null ? void 0 : s()) || {}, [d] = Ye.useForm(); const [i, n] = F({}), { listCode: r, onKeywordChange: a, onConditionChange: o, getBase62params: s, classNames: l } = k.useContext(te), { keyword: d, condition: p } = (s == null ? void 0 : s()) || {}, [u] = Ye.useForm();
return j(() => { return j(() => {
r && t && L.get(`/api/_/${r}/list-condition-form-layout`).then(({ resource: h, marginX: b, marginY: C, rowHeight: x, cols: T, fields: P }) => { r && t && L.get(`/api/_/${r}/list-condition-form-layout`).then(({ resource: h, marginX: b, marginY: C, rowHeight: x, cols: T, fields: P }) => {
n({ resource: h, itemMargin: [b, C], rowHeight: x, cols: T, fields: P }); n({ resource: h, itemMargin: [b, C], rowHeight: x, cols: T, fields: P });
}).catch(() => n({})); }).catch(() => n({}));
}, [r, t]), j(() => { }, [r, t]), j(() => {
d.setFieldsValue({ keyword: u, ...p }); u.setFieldsValue({ keyword: d, ...p });
}, [JSON.stringify([u, p])]), g("div", { className: z("ff-data-list-filter", l.filter, e), children: g(Ye, { form: d, layout: "vertical", autoComplete: "off", onFinish: ((f = i.fields) == null ? void 0 : f.length) > 1 ? (h) => o({ [i.resource]: h[i.resource] }, h.keyword) : () => { }, [JSON.stringify([d, p])]), g("div", { className: z("ff-data-list-filter", l.filter, e), children: g(Ye, { form: u, layout: "vertical", autoComplete: "off", onFinish: ((f = i.fields) == null ? void 0 : f.length) > 1 ? (h) => o({ [i.resource]: h[i.resource] }, h.keyword) : () => {
}, onValuesChange: (h) => { }, onValuesChange: (h) => {
c.isEmpty(c.omit(h, ["keyword"])) || d.submit(); c.isEmpty(c.omit(h, ["keyword"])) || u.submit();
}, children: ((m = i.fields) == null ? void 0 : m.length) > 1 ? g($t, { ...i, children: g(an, { onReset: () => { }, children: ((m = i.fields) == null ? void 0 : m.length) > 1 ? g($t, { ...i, children: g(an, { onReset: () => {
const { keyword: h, condition: b } = s("init") || {}; const { keyword: h, condition: b } = s("init") || {};
d.setFieldsValue({ keyword: h, ...b }); u.setFieldsValue({ keyword: h, ...b });
} }) }) : g("div", { className: "ff-data-list-filter-default-form ff-grid-layout-form", children: g("div", { className: "grid-layout-item", style: si(20, 0, 5, 2), children: g(Ye.Item, { name: ["keyword"], children: g(Ei.Search, { allowClear: !0, enterButton: "搜索", placeholder: "多关键字 | 分割", onSearch: (h) => a(h) }) }) }) }) }) }); } }) }) : g("div", { className: "ff-data-list-filter-default-form ff-grid-layout-form", children: g("div", { className: "grid-layout-item", style: si(20, 0, 5, 2), children: g(Ye.Item, { name: ["keyword"], children: g(Ei.Search, { allowClear: !0, enterButton: "搜索", placeholder: "多关键字 | 分割", onSearch: (h) => a(h) }) }) }) }) }) });
}, an = ({ cols: e, fields: t, onReset: i }) => { }, an = ({ cols: e, fields: t, onReset: i }) => {
const [n, r] = F(!1), a = H(() => t == null ? void 0 : t.toReversed().some((o) => o.y > 1 || o.x + o.w >= e - 5), [e, t]); const [n, r] = F(!1), a = H(() => t == null ? void 0 : t.toReversed().some((o) => o.y > 1 || o.x + o.w >= e - 5), [e, t]);
@ -317,19 +317,19 @@ const Qi = (e, t = {}) => H(() => e == null ? void 0 : e.map(({ widgetByJs: i, w
}; };
oi.reservedFields = [{ x: 0, y: 0, h: 3, w: 5, field: { isVirtual: !0, widgetPrefix: "@pkg/ff/grid-layout-forms", widget: "Input", code: "keyword", label: "关键字", placeholder: "多关键字 | 分割", extras: { prefix: "icon-search" } } }]; oi.reservedFields = [{ x: 0, y: 0, h: 3, w: 5, field: { isVirtual: !0, widgetPrefix: "@pkg/ff/grid-layout-forms", widget: "Input", code: "keyword", label: "关键字", placeholder: "多关键字 | 分割", extras: { prefix: "icon-search" } } }];
const sn = ({ className: e, operations: t, isOperations: i, isPaginate: n }) => { const sn = ({ className: e, operations: t, isOperations: i, isPaginate: n }) => {
const { onPageChange: r, onPageSizeChange: a, onClickCallback: o, getBase62params: s } = k.useContext(te), { total: l, page: u, pageSize: p } = (s == null ? void 0 : s()) || {}; const { onPageChange: r, onPageSizeChange: a, onClickCallback: o, getBase62params: s } = k.useContext(te), { total: l, page: d, pageSize: p } = (s == null ? void 0 : s()) || {};
return i && !c.isEmpty(t) || n ? A("div", { className: z("ff-data-list-footer", e), children: [g("div", { className: "ff-data-list-actions", children: t == null ? void 0 : t.map((d, f) => g($, { uuid: d.uuid, type: d.type, name: d.name, widget: d.widget, widgetType: d.widgetType, widgetProps: d.widgetProps, widgetData: d.widgetData, widgetSetting: d.widgetSetting, widgetContainerProps: d.widgetContainerSetting, onAfterClick: (m) => m !== !1 && (o == null ? void 0 : o(d.isRefresh, null)) }, d.uuid || f)) }), n && g(Ri, { size: "small", total: l, pageSize: p, showSizeChanger: !1, showTotal: (d) => `${u} 页 / 总共 ${d}`, onChange: r, onShowSizeChange: a })] }) : null; return i && !c.isEmpty(t) || n ? A("div", { className: z("ff-data-list-footer", e), children: [g("div", { className: "ff-data-list-actions", children: t == null ? void 0 : t.map((u, f) => g($, { uuid: u.uuid, type: u.type, name: u.name, widget: u.widget, widgetType: u.widgetType, widgetProps: u.widgetProps, widgetData: u.widgetData, widgetSetting: u.widgetSetting, widgetContainerProps: u.widgetContainerSetting, onAfterClick: (m) => m !== !1 && (o == null ? void 0 : o(u.isRefresh, null)) }, u.uuid || f)) }), n && g(Ri, { size: "small", total: l, pageSize: p, showSizeChanger: !1, showTotal: (u) => `${d} 页 / 总共 ${u}`, onChange: r, onShowSizeChange: a })] }) : null;
}, on = [{ title: "parent 1", key: "0-0", children: [{ title: "parent 1-0", key: "0-0-0", disabled: !0, children: [{ title: "leaf", key: "0-0-0-0", disableCheckbox: !0 }, { title: "leaf", key: "0-0-0-1" }] }, { title: "parent 1-1", key: "0-0-1", children: [{ title: g("span", { style: { color: "#1677ff" }, children: "sss" }), key: "0-0-1-0" }] }] }], ln = ({ className: e, width: t = 280, isTreeSider: i }) => { }, on = [{ title: "parent 1", key: "0-0", children: [{ title: "parent 1-0", key: "0-0-0", disabled: !0, children: [{ title: "leaf", key: "0-0-0-0", disableCheckbox: !0 }, { title: "leaf", key: "0-0-0-1" }] }, { title: "parent 1-1", key: "0-0-1", children: [{ title: g("span", { style: { color: "#1677ff" }, children: "sss" }), key: "0-0-1-0" }] }] }], ln = ({ className: e, width: t = 280, isTreeSider: i }) => {
const { classNames: n } = le(te); const { classNames: n } = le(te);
return i ? g(Oi.DirectoryTree, { className: z("ff-data-list-sider", n.sider, e), style: { "--sider-width": t }, showLine: !0, showIcon: !1, treeData: on }) : null; return i ? g(Oi.DirectoryTree, { className: z("ff-data-list-sider", n.sider, e), style: { "--sider-width": t }, showLine: !0, showIcon: !1, treeData: on }) : null;
}, cn = ({ className: e, title: t, tabs: i }) => { }, cn = ({ className: e, title: t, tabs: i }) => {
const { getBase62params: n, onTabChange: r, onReload: a, classNames: o } = le(te), { tab: s } = (n == null ? void 0 : n()) || {}, [l, u] = zi((i == null ? void 0 : i[0].value) ?? (i == null ? void 0 : i[0].code), { value: s, onChange: r }); const { getBase62params: n, onTabChange: r, onReload: a, classNames: o } = le(te), { tab: s } = (n == null ? void 0 : n()) || {}, [l, d] = zi((i == null ? void 0 : i[0].value) ?? (i == null ? void 0 : i[0].code), { value: s, onChange: r });
return A("div", { className: z("ff-data-list-toolbar", o.toolbar, e), children: [g("div", { className: "ff-data-list-title", children: t }), g(Li, { className: "ff-data-list-tabs", itemRender: ({ label: p, code: d, value: f }) => g("span", { onClick: () => u(f ?? d), className: z("ff-data-list-tab", { active: (f ?? d) == l }), children: p }), items: i }), A("div", { className: "ff-data-list-actions", children: [g($.Link, { icon: "icon-reload", widget: () => a() }), g($.Link, { icon: "icon-setting" })] })] }); return A("div", { className: z("ff-data-list-toolbar", o.toolbar, e), children: [g("div", { className: "ff-data-list-title", children: t }), g(Li, { className: "ff-data-list-tabs", itemRender: ({ label: p, code: u, value: f }) => g("span", { onClick: () => d(f ?? u), className: z("ff-data-list-tab", { active: (f ?? u) == l }), children: p }), items: i }), A("div", { className: "ff-data-list-actions", children: [g($.Link, { icon: "icon-reload", widget: () => a() }), g($.Link, { icon: "icon-setting" })] })] });
}, li = ({ isItemGridLayout: e, theme: t, themeProps: i, onClickCallback: n, onReload: r, listCode: a, total: o = 0, page: s = 0, onPageChange: l, pageSize: u = 30, onPageSizeChange: p, tab: d, onTabChange: f, keyword: m, onKeywordChange: h, condition: b, onConditionChange: C, sider: x, onSiderChange: T, layouts: P, classNames: O = {}, ...V }) => { }, li = ({ isItemGridLayout: e, theme: t, themeProps: i, onClickCallback: n, onReload: r, listCode: a, total: o = 0, page: s = 0, onPageChange: l, pageSize: d = 30, onPageSizeChange: p, tab: u, onTabChange: f, keyword: m, onKeywordChange: h, condition: b, onConditionChange: C, sider: x, onSiderChange: T, layouts: P, classNames: O = {}, ...V }) => {
const [q, I] = F(), M = Y((S, E) => { const [q, I] = F(), M = Y((S, E) => {
const D = { tab: d, page: s, pageSize: u, keyword: m, sider: x, condition: b, total: o }; const D = { tab: u, page: s, pageSize: d, keyword: m, sider: x, condition: b, total: o };
return S && S != "init" ? c.get(D, S, E) : D; return S && S != "init" ? c.get(D, S, E) : D;
}, [JSON.stringify(b), d, s, u, m, x, o]), N = H(() => { }, [JSON.stringify(b), u, s, d, m, x, o]), N = H(() => {
let S = { sider: ln, filter: oi, footer: sn, toolbar: cn }; let S = { sider: ln, filter: oi, footer: sn, toolbar: cn };
P === !1 ? S = { sider: null, filter: null, footer: null, toolbar: null } : c.isPlainObject(P) && (S = Object.assign({}, S, P)); P === !1 ? S = { sider: null, filter: null, footer: null, toolbar: null } : c.isPlainObject(P) && (S = Object.assign({}, S, P));
for (const E in S) if (S[E]) { for (const E in S) if (S[E]) {
@ -373,60 +373,60 @@ const re = class re {
pe = new WeakMap(), de = new WeakMap(), Se = new WeakMap(), nt = new WeakMap(), R(re, pe, null), v(re, "getInstance", () => (y(re, pe) || W(re, pe, new re()), y(re, pe))); pe = new WeakMap(), de = new WeakMap(), Se = new WeakMap(), nt = new WeakMap(), R(re, pe, null), v(re, "getInstance", () => (y(re, pe) || W(re, pe, new re()), y(re, pe)));
let yt = re; let yt = re;
const ci = yt.getInstance(), Pt = k.forwardRef(({ listCode: e, base62params: t, className: i, theme: n, themeProps: r, layouts: a, classNames: o }, s) => { const ci = yt.getInstance(), Pt = k.forwardRef(({ listCode: e, base62params: t, className: i, theme: n, themeProps: r, layouts: a, classNames: o }, s) => {
const [{ resource: l, primaryKey: u, batchOperations: p = [], itemOperations: d = [], columns: f = [], themeConfig: m, theme: h, isConditionFormLayout: b = !1, isTreeSider: C, treeSiderConfig: x, isItemGridLayout: T, itemGridLayout: P, title: O, isPaginate: V, tabs: q }, I] = F({ isItemGridLayout: !1, itemGridLayout: {} }), M = en(e, t), [{ dataSource: N, itemOperationsAccess: S, condition: E, tab: D, keyword: X, page: ve, total: K, pageSize: ot, sider: Ke, onConditionChange: lt, onTabChange: Et, onKeywordChange: bi, onPageChange: Ci, onPageSizeChange: ki, onSiderChange: xi, onReload: ct }, Rt] = Zi(M, e, u, l), Si = ft(d, S, N, u), vi = ft(p); const [{ resource: l, primaryKey: d, batchOperations: p = [], itemOperations: u = [], columns: f = [], themeConfig: m, theme: h, isConditionFormLayout: b = !1, isTreeSider: C, treeSiderConfig: x, isItemGridLayout: T, itemGridLayout: P, title: O, isPaginate: V, tabs: q }, I] = F({ isItemGridLayout: !1, itemGridLayout: {} }), M = en(e, t), [{ dataSource: N, itemOperationsAccess: S, condition: E, tab: D, keyword: X, page: ve, total: K, pageSize: ot, sider: Ke, onConditionChange: lt, onTabChange: Et, onKeywordChange: bi, onPageChange: Ci, onPageSizeChange: ki, onSiderChange: xi, onReload: ct }, Rt] = Zi(M, e, d, l), Si = ft(u, S, N, d), vi = ft(p);
return j(() => { return j(() => {
let Je = null; let Je = null;
return e && L.get(`/api/_/${e}`).resp(({ data: _e, res: Pi }) => { return e && L.get(`/api/_/${e}`).resp(({ data: _e, res: Pi }) => {
_e != null && _e.isDynamicRefresh && (Je = ci.subscribe(() => ct(), Pi)), I(_e); _e != null && _e.isDynamicRefresh && (Je = ci.subscribe(() => ct(), Pi)), I(_e);
}).catch(() => I({})), () => Je == null ? void 0 : Je(); }).catch(() => I({})), () => Je == null ? void 0 : Je();
}, [e]), k.useImperativeHandle(s, () => ({ onReload: ct, onClickCallback: Rt })), g(li, { listCode: e, title: O, classNames: o, layouts: a, resource: l, primaryKey: u, theme: n || h, themeProps: r || m, isTreeSider: C, treeSiderConfig: x, isPaginate: V, tabs: q, isItemOperations: Si, isBatchOperations: vi, batchOperations: p, itemOperations: d, isItemGridLayout: T, columns: f, itemGridLayout: P, isConditionFormLayout: b, itemOperationsAccess: S, dataSource: N, onConditionChange: lt, onTabChange: Et, onKeywordChange: bi, onPageChange: Ci, onPageSizeChange: ki, onSiderChange: xi, condition: E, tab: D, keyword: X, page: ve, total: K, pageSize: ot, sider: Ke, className: z("ff-data-list-helper", i), onReload: ct, onClickCallback: Rt }); }, [e]), k.useImperativeHandle(s, () => ({ onReload: ct, onClickCallback: Rt })), g(li, { listCode: e, title: O, classNames: o, layouts: a, resource: l, primaryKey: d, theme: n || h, themeProps: r || m, isTreeSider: C, treeSiderConfig: x, isPaginate: V, tabs: q, isItemOperations: Si, isBatchOperations: vi, batchOperations: p, itemOperations: u, isItemGridLayout: T, columns: f, itemGridLayout: P, isConditionFormLayout: b, itemOperationsAccess: S, dataSource: N, onConditionChange: lt, onTabChange: Et, onKeywordChange: bi, onPageChange: Ci, onPageSizeChange: ki, onSiderChange: xi, condition: E, tab: D, keyword: X, page: ve, total: K, pageSize: ot, sider: Ke, className: z("ff-data-list-helper", i), onReload: ct, onClickCallback: Rt });
}), di = (e, t, i = !0) => i !== !0 && i-- <= 0 ? [] : c.isArray(e) && !c.isEmpty(e) ? e.reduce((n, r) => (Reflect.has(r, t) && Reflect.has(r, "children") && n.push(r[t]), Reflect.has(r, "children") && !c.isEmpty(r.children) ? n.concat(di(r.children, t, i)) : n), []) : [], dn = ({ className: e, primaryKey: t, columns: i = [], dataSource: n = [], operationRender: r, operationWidth: a = 180, ...o }) => { }), di = (e, t, i = !0) => i !== !0 && i-- <= 0 ? [] : c.isArray(e) && !c.isEmpty(e) ? e.reduce((n, r) => (Reflect.has(r, t) && Reflect.has(r, "children") && n.push(r[t]), Reflect.has(r, "children") && !c.isEmpty(r.children) ? n.concat(di(r.children, t, i)) : n), []) : [], dn = ({ className: e, primaryKey: t, columns: i = [], dataSource: n = [], operationRender: r, operationWidth: a = 180, ...o }) => {
const { classNames: s } = le(te); const { classNames: s } = le(te);
Le(); Le();
const l = U(null), u = U(null), [p, d] = F([]), [f, m] = F({ width: 0, height: 0 }); const l = U(null), d = U(null), [p, u] = F([]), [f, m] = F({ width: 0, height: 0 });
j(() => { j(() => {
d(di(n, t)); u(di(n, t));
}, [n, t]), Fi(() => { }, [n, t]), Fi(() => {
const b = new ResizeObserver(() => { const b = new ResizeObserver(() => {
var C; var C;
m({ width: ((C = l.current) == null ? void 0 : C.nativeElement.querySelector(".ant-table-body").scrollWidth) || u.current.offsetWidth, height: u.current.offsetHeight }); m({ width: ((C = l.current) == null ? void 0 : C.nativeElement.querySelector(".ant-table-body").scrollWidth) || d.current.offsetWidth, height: d.current.offsetHeight });
}); });
return u.current && b.observe(u.current), () => { return d.current && b.observe(d.current), () => {
u.current && b.unobserve(u.current); d.current && b.unobserve(d.current);
}; };
}, []); }, []);
const h = Qi(i); const h = Qi(i);
return g("div", { ref: u, className: z("ff-data-list-table", s.content, e), children: f.height ? g(Ai, { ...o, ref: l, rowKey: (b) => (b == null ? void 0 : b[t]) ?? Math.random(), columns: h == null ? void 0 : h.concat(r ? [{ title: "操作", align: "center", fixed: "right", width: `${Math.ceil(a / f.width * 100).toFixed(2)}%`, render: (b, C, x) => r(C, x) }] : []), dataSource: n, size: "middle", scroll: { x: "max-content", y: f.height - 50 }, pagination: !1, expandable: { defaultExpandAllRows: !0, expandRowByClick: !0, onExpandedRowsChange: d, expandedRowKeys: p } }) : null }); return g("div", { ref: d, className: z("ff-data-list-table", s.content, e), children: f.height ? g(Ai, { ...o, ref: l, rowKey: (b) => (b == null ? void 0 : b[t]) ?? Math.random(), columns: h == null ? void 0 : h.concat(r ? [{ title: "操作", align: "center", fixed: "right", width: `${Math.ceil(a / f.width * 100).toFixed(2)}%`, render: (b, C, x) => r(C, x) }] : []), dataSource: n, size: "middle", scroll: { x: "max-content", y: f.height - 50 }, pagination: !1, expandable: { defaultExpandAllRows: !0, expandRowByClick: !0, onExpandedRowsChange: u, expandedRowKeys: p } }) : null });
}, un = "RC_FORM_INTERNAL_HOOKS", gn = (e, { initialValue: t, initialValueLanguage: i, convertJs: n, convertJsSetting: r, type: a = "string" }, o = null) => { }, un = "RC_FORM_INTERNAL_HOOKS", gn = (e, { initialValue: t, initialValueLanguage: i, convertJs: n, convertJsSetting: r, type: a = "string" }, o = null) => {
const s = U(!1), l = le(Gt), [u, p] = F(), [d, f] = F(i != "javascript" && e ? l.getFieldValue(e) : void 0), { registerWatch: m } = l.getInternalHooks(un) || {}; const s = U(!1), l = le(Gt), [d, p] = F(), [u, f] = F(i != "javascript" && e ? l.getFieldValue(e) : void 0), { registerWatch: m } = l.getInternalHooks(un) || {};
return j(() => m == null ? void 0 : m((h, b, C) => { return j(() => m == null ? void 0 : m((h, b, C) => {
if (!s.current) return; if (!s.current) return;
const x = c.get(b, e); const x = c.get(b, e);
c.isEqual(x, d) || f(Z(x, a)); c.isEqual(x, u) || f(Z(x, a));
}), [d]), j(() => { }), [u]), j(() => {
i == "javascript" && t ? Ce.exec(t, {}, { getFieldValueForBasicForm: (h) => o ? o.getFieldValue(h) : l.getFieldValue(h), getFieldValue: (h) => l.getFieldValue(h) }).then((h) => f(Z(h, a))).catch((h) => notification.error({ message: `布局数据错误: ${JSON.stringify(h)}` })).finally(() => s.current = !0) : (t && f(Z(t ?? l.getFieldValue(e), a)), s.current = !0); i == "javascript" && t ? Ce.exec(t, {}, { getFieldValueForBasicForm: (h) => o ? o.getFieldValue(h) : l.getFieldValue(h), getFieldValue: (h) => l.getFieldValue(h) }).then((h) => f(Z(h, a))).catch((h) => notification.error({ message: `布局数据错误: ${JSON.stringify(h)}` })).finally(() => s.current = !0) : (t && f(Z(t ?? l.getFieldValue(e), a)), s.current = !0);
}, [t, i]), We(() => { }, [t, i]), We(() => {
s.current && n && new Ze([n, r]).toValue(d, l.getFieldsValue(!0)).then(p).catch((h) => { s.current && n && new Ze([n, r]).toValue(u, l.getFieldsValue(!0)).then(p).catch((h) => {
p(h), console.error("布局数据转换错误: ", h, n); p(h), console.error("布局数据转换错误: ", h, n);
}); });
}, [d, n, r]), [u ?? d, d]; }, [u, n, r]), [d ?? u, u];
}, ui = (e, t, i = null) => H(() => { }, ui = (e, t, i = null) => H(() => {
var n; var n;
return (n = c.sortBy(e, ["y", "x"])) == null ? void 0 : n.map(({ i: r, x: a, y: o, w: s, h: l, field: { boxStyle: u, ...p } }, d) => g("div", { className: "grid-layout-item", style: si(a, o, s, l, u), children: g(t, { ...p, basicForm: i }) }, r ?? d)); return (n = c.sortBy(e, ["y", "x"])) == null ? void 0 : n.map(({ i: r, x: a, y: o, w: s, h: l, field: { boxStyle: d, ...p } }, u) => g("div", { className: "grid-layout-item", style: si(a, o, s, l, d), children: g(t, { ...p, basicForm: i }) }, r ?? u));
}, [e]), pn = ({ widget: e, widgetPrefix: t = "@pkg/ff/grid-layouts", basicForm: i, ...n }) => { }, [e]), pn = ({ widget: e, widgetPrefix: t = "@pkg/ff/grid-layouts", basicForm: i, ...n }) => {
const r = e != null && e.startsWith("@") || e != null && e.startsWith("blob:") ? e : `${t}/${e}`, [a, o] = F(); const r = e != null && e.startsWith("@") || e != null && e.startsWith("blob:") ? e : `${t}/${e}`, [a, o] = F();
return j(() => { return j(() => {
r && oe.getWidgetComponent(r).then(({ defaultProps: s = {}, default: l }) => ({ default: mn(l, s, i) })).catch((s) => ({ default: () => `${s}` })).then((s) => o(k.createElement(s.default, n))); r && oe.getWidgetComponent(r).then(({ defaultProps: s = {}, default: l }) => ({ default: mn(l, s, i) })).catch((s) => ({ default: () => `${s}` })).then((s) => o(k.createElement(s.default, n)));
}, [r]), a; }, [r]), a;
}, mn = (e, t = {}, i = null) => (n) => { }, mn = (e, t = {}, i = null) => (n) => {
const { code: r, label: a, extras: o, isVirtual: s, initialValue: l, initialValueLanguage: u, convertJs: p, convertJsSetting: d, value: f, ...m } = c.merge({}, t, n), [h, b] = gn(s ? null : r, { initialValue: l, initialValueLanguage: u, convertJs: p, convertJsSetting: d, type: (m == null ? void 0 : m.type) || "string" }, i), C = H(() => { const { code: r, label: a, extras: o, isVirtual: s, initialValue: l, initialValueLanguage: d, convertJs: p, convertJsSetting: u, value: f, ...m } = c.merge({}, t, n), [h, b] = gn(s ? null : r, { initialValue: l, initialValueLanguage: d, convertJs: p, convertJsSetting: u, type: (m == null ? void 0 : m.type) || "string" }, i), C = H(() => {
const P = Object.keys((t == null ? void 0 : t.extras) || {}); const P = Object.keys((t == null ? void 0 : t.extras) || {});
return c.over([c.partialRight(c.pick, P), c.partialRight(c.omit, P)]); return c.over([c.partialRight(c.pick, P), c.partialRight(c.omit, P)]);
}, [t == null ? void 0 : t.extras]), [x, T] = C(m); }, [t == null ? void 0 : t.extras]), [x, T] = C(m);
return g(e, { ...T, value: h, rawValue: b, $setting: Object.assign({}, o, x) }); return g(e, { ...T, value: h, rawValue: b, $setting: Object.assign({}, o, x) });
}, gi = ({ className: e, cols: t = 12, rowHeight: i = 21, containerPadding: n = [0, 0], itemMargin: r = [4, 0], formProps: a = {}, fields: o = [], data: s, basicForm: l = null, ...u }) => { }, gi = ({ className: e, cols: t = 12, rowHeight: i = 21, containerPadding: n = [0, 0], itemMargin: r = [4, 0], formProps: a = {}, fields: o = [], data: s, basicForm: l = null, ...d }) => {
const [p] = ee.useForm(), d = ui(o, pn, l), f = H(() => [{ name: "__PROPS__", value: a }], [a]); const [p] = ee.useForm(), u = ui(o, pn, l), f = H(() => [{ name: "__PROPS__", value: a }], [a]);
return We(() => (p.setFieldsValue(s), () => p.resetFields()), [s]), g(ee, { fields: f, form: p, component: !1, children: g("div", { ...u, className: z("ff-grid-layout", e), style: { "--grid-layout-item-margin-y": `${(r == null ? void 0 : r[0]) || 0}px`, "--grid-layout-item-margin-x": `${(r == null ? void 0 : r[1]) || 0}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": t, "--grid-layout-row-height": `${i}px` }, children: d }) }); return We(() => (p.setFieldsValue(s), () => p.resetFields()), [s]), g(ee, { fields: f, form: p, component: !1, children: g("div", { ...d, className: z("ff-grid-layout", e), style: { "--grid-layout-item-margin-y": `${(r == null ? void 0 : r[0]) || 0}px`, "--grid-layout-item-margin-x": `${(r == null ? void 0 : r[1]) || 0}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": t, "--grid-layout-row-height": `${i}px` }, children: u }) });
}, fr = (zt = gi, function({ code: e, data: t, ...i }) { }, fr = (zt = gi, function({ code: e, data: t, ...i }) {
const [n, r] = F({ resource: null, cols: 12, rowHeight: 21, fields: [] }); const [n, r] = F({ resource: null, cols: 12, rowHeight: 21, fields: [] });
return j(() => { return j(() => {
@ -434,9 +434,9 @@ const ci = yt.getInstance(), Pt = k.forwardRef(({ listCode: e, base62params: t,
}, [e]), (n == null ? void 0 : n.resource) && g(zt, { ...i, rowHeight: n.rowHeight, cols: n.cols, fields: n.fields, data: n != null && n.resource ? { [n == null ? void 0 : n.resource]: t } : {} }); }, [e]), (n == null ? void 0 : n.resource) && g(zt, { ...i, rowHeight: n.rowHeight, cols: n.cols, fields: n.fields, data: n != null && n.resource ? { [n == null ? void 0 : n.resource]: t } : {} });
}); });
var zt; var zt;
const hn = ({ cols: e, rowHeight: t, itemMargin: i, fields: n, primaryKey: r, dataSource: a, itemClassName: o, itemRender: s = (d, f, m) => d, empty: l = g(ji, { description: null }), className: u, style: p = {} }) => { const hn = ({ cols: e, rowHeight: t, itemMargin: i, fields: n, primaryKey: r, dataSource: a, itemClassName: o, itemRender: s = (u, f, m) => u, empty: l = g(ji, { description: null }), className: d, style: p = {} }) => {
const { classNames: d } = le(te), f = Le(), m = H(() => g(gi, { cols: e, rowHeight: t, itemMargin: i, fields: n, className: o }), [n, e, t, i]); const { classNames: u } = le(te), f = Le(), m = H(() => g(gi, { cols: e, rowHeight: t, itemMargin: i, fields: n, className: o }), [n, e, t, i]);
return g("div", { className: z("ff-data-list-content", d.content, u), style: p, children: c.isEmpty(a) ? l : a.map((h, b) => { return g("div", { className: z("ff-data-list-content", u.content, d), style: p, children: c.isEmpty(a) ? l : a.map((h, b) => {
const C = s(k.cloneElement(m, { data: h }), h, b); const C = s(k.cloneElement(m, { data: h }), h, b);
return k.cloneElement(C, { key: `${f}-${(h == null ? void 0 : h[r]) || b}` }); return k.cloneElement(C, { key: `${f}-${(h == null ? void 0 : h[r]) || b}` });
}) }); }) });
@ -464,9 +464,9 @@ const ae = class ae {
v(this, "get", (t) => (y(this, Q).has(t) || (t = Array.from(y(this, Q).keys()).find((i) => y(this, Q).get(i).uri === t)), y(this, Q).get(t) || {})); v(this, "get", (t) => (y(this, Q).has(t) || (t = Array.from(y(this, Q).keys()).find((i) => y(this, Q).get(i).uri === t)), y(this, Q).get(t) || {}));
v(this, "redirect", (t, i, n = {}) => { v(this, "redirect", (t, i, n = {}) => {
const { uri: r, type: a, widgetProps: o } = this.get(t) || {}; const { uri: r, type: a, widgetProps: o } = this.get(t) || {};
let s = qi(r || t, a != "list" ? i : c.mapValues(i, (u) => L.encode(u))); let s = qi(r || t, a != "list" ? i : c.mapValues(i, (d) => L.encode(d)));
const l = new URLSearchParams(); const l = new URLSearchParams();
for (const u in o || {}) (o == null ? void 0 : o.type) == "query" && l.append(u, i[u]); for (const d in o || {}) (o == null ? void 0 : o.type) == "query" && l.append(d, i[d]);
return l.size > 0 && (s = `${s}?${l.toString()}`), y(this, fe).navigate(s, n); return l.size > 0 && (s = `${s}?${l.toString()}`), y(this, fe).navigate(s, n);
}); });
v(this, "getMenus", (t) => { v(this, "getMenus", (t) => {
@ -520,11 +520,11 @@ const ae = class ae {
}); });
v(this, "createBrowserRouter", (t = {}) => { v(this, "createBrowserRouter", (t = {}) => {
if (y(this, Q).size == 0) return null; if (y(this, Q).size == 0) return null;
const i = Ae.get("Common.WEBSITE_DEFAULT_THEME", "@pkg/ff/frameworks/DefaultTheme"), n = Ae.get(oe.checkUserToken() ? "Common.WEBSITE_LOGIN_REDIRECT" : "Common.WEBSITE_DEFAULT", "/index"), r = { [i]: 0 }, a = (s, l) => () => Promise.all([oe.getWidgetComponent(s), Ue(l)]).then(([u, p]) => [u.default || function() { const i = Ae.get("Common.WEBSITE_DEFAULT_THEME", "@pkg/ff/frameworks/DefaultTheme"), n = Ae.get(oe.checkUserToken() ? "Common.WEBSITE_LOGIN_REDIRECT" : "Common.WEBSITE_DEFAULT", "/index"), r = { [i]: 0 }, a = (s, l) => () => Promise.all([oe.getWidgetComponent(s), Ue(l)]).then(([d, p]) => [d.default || function() {
return `${s}`; return `${s}`;
}, p]).then(([u, p]) => ({ Component: () => k.createElement(Zt, {}, k.createElement(u, { $setting: p })) })), o = Array.from(y(this, Q).values()).reduce((s, { uuid: l, uri: u, name: p, type: d, component: f, widgetSetting: m, widgetProps: h, isLogin: b, isLayout: C, extra: x }) => { }, p]).then(([d, p]) => ({ Component: () => k.createElement(Zt, {}, k.createElement(d, { $setting: p })) })), o = Array.from(y(this, Q).values()).reduce((s, { uuid: l, uri: d, name: p, type: u, component: f, widgetSetting: m, widgetProps: h, isLogin: b, isLayout: C, extra: x }) => {
let T = {}, P = 0; let T = {}, P = 0;
switch (d) { switch (u) {
case "list": case "list":
T.element = k.createElement(fn, { component: f, $props: h }); T.element = k.createElement(fn, { component: f, $props: h });
break; break;
@ -534,10 +534,10 @@ const ae = class ae {
const O = (x == null ? void 0 : x.theme) ?? (x == null ? void 0 : x.layout); const O = (x == null ? void 0 : x.theme) ?? (x == null ? void 0 : x.layout);
if (O) { if (O) {
const V = (x == null ? void 0 : x.themeProps) ?? (x == null ? void 0 : x.layoutProps); const V = (x == null ? void 0 : x.themeProps) ?? (x == null ? void 0 : x.layoutProps);
if (!r[O]) return r[O] = s.length, [...s, { path: "/", lazy: a(O, V), children: [{ path: u, ...T }] }]; if (!r[O]) return r[O] = s.length, [...s, { path: "/", lazy: a(O, V), children: [{ path: d, ...T }] }];
P = r[O]; P = r[O];
} }
return C && P > -1 ? (s[P].children.push({ path: u, ...T }), s) : [...s, { path: u, ...T }]; return C && P > -1 ? (s[P].children.push({ path: d, ...T }), s) : [...s, { path: d, ...T }];
}, [{ path: "/", lazy: a(i, {}), children: [] }]); }, [{ path: "/", lazy: a(i, {}), children: [] }]);
return o.push({ index: !0, element: k.createElement(bn, { to: n, replace: !0 }) }), W(this, fe, Hi(o, t)); return o.push({ index: !0, element: k.createElement(bn, { to: n, replace: !0 }) }), W(this, fe, Hi(o, t));
}); });
@ -562,15 +562,15 @@ const B = class B {
}), Pe.addEventListener("message", ({ data: { id: t, task_id: i, method: n, args: r, category: a, data: o, error: s, session: l } }) => { }), Pe.addEventListener("message", ({ data: { id: t, task_id: i, method: n, args: r, category: a, data: o, error: s, session: l } }) => {
if (a === "eval" && B.mQueue.has(t)) s !== null ? B.mQueue.get(t)[1](s) : B.mQueue.get(t)[0](o), y(B, Fe).delete(t), B.mQueue.delete(t); if (a === "eval" && B.mQueue.has(t)) s !== null ? B.mQueue.get(t)[1](s) : B.mQueue.get(t)[0](o), y(B, Fe).delete(t), B.mQueue.delete(t);
else if (a === "util") try { else if (a === "util") try {
const u = c.get(Bt, n.split("/")) || c.get(y(B, Fe).get(i), n.split("/")); const d = c.get(Bt, n.split("/")) || c.get(y(B, Fe).get(i), n.split("/"));
if (!c.isFunction(u)) throw `${n} not found`; if (!c.isFunction(d)) throw `${n} not found`;
Promise.resolve(Reflect.apply(u, void 0, r)).then((p) => { Promise.resolve(Reflect.apply(d, void 0, r)).then((p) => {
Pe.postMessage({ id: t, task_id: i, category: a, method: n, args: r, session: l, data: p, error: null }); Pe.postMessage({ id: t, task_id: i, category: a, method: n, args: r, session: l, data: p, error: null });
}).catch((p) => { }).catch((p) => {
Pe.postMessage({ id: t, task_id: i, category: a, method: n, args: r, session: l, data: null, error: p }); Pe.postMessage({ id: t, task_id: i, category: a, method: n, args: r, session: l, data: null, error: p });
}); });
} catch (u) { } catch (d) {
Pe.postMessage({ id: t, task_id: i, category: a, method: n, args: r, session: l, data: null, error: u }); Pe.postMessage({ id: t, task_id: i, category: a, method: n, args: r, session: l, data: null, error: d });
} }
}, !1); }, !1);
} }
@ -602,12 +602,12 @@ const Ce = bt.getInstance(), at = () => {
for (let n = 0; n < e.length; n++) e[n].value = Z((i = e[n]) == null ? void 0 : i.value, t), e[n] && Reflect.has(e[n], "children") && (e[n].children = pi(e[n].children, t)); for (let n = 0; n < e.length; n++) e[n].value = Z((i = e[n]) == null ? void 0 : i.value, t), e[n] && Reflect.has(e[n], "children") && (e[n].children = pi(e[n].children, t));
return e; return e;
}, br = (e, t = "json", i = "string", n, r = null) => { }, br = (e, t = "json", i = "string", n, r = null) => {
const [a] = ee.useForm(n), [o, s] = F([{ label: "无", value: "", disabled: !0 }]), l = U([]), u = ee.useWatch((p) => l.current.length === 0 ? null : c.pick(p, l.current), a) || null; const [a] = ee.useForm(n), [o, s] = F([{ label: "无", value: "", disabled: !0 }]), l = U([]), d = ee.useWatch((p) => l.current.length === 0 ? null : c.pick(p, l.current), a) || null;
return j(() => { return j(() => {
Array.isArray(e) ? s(e) : t === "javascript" && e ? Ce.exec(e, {}, { getFieldValue: (p) => (l.current.includes(p) || l.current.push(p), a.getFieldValue(p)), getFieldValueForBasicForm: (p) => (l.current.includes(p) || l.current.push(p), r ? r.getFieldValue(p) : a.getFieldValue(p)) }).then((p) => { Array.isArray(e) ? s(e) : t === "javascript" && e ? Ce.exec(e, {}, { getFieldValue: (p) => (l.current.includes(p) || l.current.push(p), a.getFieldValue(p)), getFieldValueForBasicForm: (p) => (l.current.includes(p) || l.current.push(p), r ? r.getFieldValue(p) : a.getFieldValue(p)) }).then((p) => {
s(Z(p, "array")); s(Z(p, "array"));
}) : e && s(Z(e, "array")); }) : e && s(Z(e, "array"));
}, [e, t, u]), pi(o, i); }, [e, t, d]), pi(o, i);
}, Cr = (e) => { }, Cr = (e) => {
const [t, i] = F(), n = { type: "GET" }; const [t, i] = F(), n = { type: "GET" };
if (typeof e == "string" ? n.url = e : c.isPlainObject(e) && Object.assign(n, e), !(n != null && n.url)) throw "url is required"; if (typeof e == "string" ? n.url = e : c.isPlainObject(e) && Object.assign(n, e), !(n != null && n.url)) throw "url is required";
@ -621,15 +621,15 @@ const Ce = bt.getInstance(), at = () => {
}, Cn = (e) => { }, Cn = (e) => {
const [t, i] = k.useState({ gridItems: [], hideItems: [] }); const [t, i] = k.useState({ gridItems: [], hideItems: [] });
return k.useEffect(() => { return k.useEffect(() => {
e && L.get(`/api/_/${e}`).then(({ pk: n, uuid: r, code: a, resource: o, align: s, cols: l, rowHeight: u, marginX: p, marginY: d, listenChangeFields: f, listenChangeFieldsFunc: m, fields: h }) => ({ pk: n, uuid: r, code: a, resource: o, align: s, cols: l, rowHeight: u, marginX: p, marginY: d, listenChangeFields: f, listenChangeFieldsFunc: m, ...h.reduce((b, C) => { e && L.get(`/api/_/${e}`).then(({ pk: n, uuid: r, code: a, resource: o, align: s, cols: l, rowHeight: d, marginX: p, marginY: u, listenChangeFields: f, listenChangeFieldsFunc: m, fields: h }) => ({ pk: n, uuid: r, code: a, resource: o, align: s, cols: l, rowHeight: d, marginX: p, marginY: u, listenChangeFields: f, listenChangeFieldsFunc: m, ...h.reduce((b, C) => {
var x; var x;
return (x = C == null ? void 0 : C.field) != null && x.hidden ? b.hides.push(C == null ? void 0 : C.field) : b.items.push(C), b; return (x = C == null ? void 0 : C.field) != null && x.hidden ? b.hides.push(C == null ? void 0 : C.field) : b.items.push(C), b;
}, { items: [], hides: [] }) })).then(i); }, { items: [], hides: [] }) })).then(i);
}, [e]), t; }, [e]), t;
}, kn = ({ max: e = 0, min: t = 0, type: i = "", message: n, pattern: r, required: a = !1, validator: o } = {}, s, l) => { }, kn = ({ max: e = 0, min: t = 0, type: i = "", message: n, pattern: r, required: a = !1, validator: o } = {}, s, l) => {
const [u, p] = F([]); const [d, p] = F([]);
return j(() => { return j(() => {
const d = []; const u = [];
if (a) { if (a) {
let f = l; let f = l;
switch (l) { switch (l) {
@ -643,23 +643,23 @@ const Ce = bt.getInstance(), at = () => {
case "json": case "json":
f = "object"; f = "object";
} }
d.push({ type: f, required: !0, whitespace: !0, message: "该项必填" }); u.push({ type: f, required: !0, whitespace: !0, message: "该项必填" });
} }
switch (i) { switch (i) {
case "string": case "string":
d.push({ type: i, max: e, min: t, message: n || (t && e ? `字符必须在 ${t} ~ ${e} 之间` : `${e ? "最多能有" : "最少要有"} ${t || e} 个字符`) }); u.push({ type: i, max: e, min: t, message: n || (t && e ? `字符必须在 ${t} ~ ${e} 之间` : `${e ? "最多能有" : "最少要有"} ${t || e} 个字符`) });
break; break;
case "pattern": case "pattern":
d.push({ type: "string", pattern: r, message: n }); u.push({ type: "string", pattern: r, message: n });
break; break;
case "validator": case "validator":
o && d.push(({ getFieldValue: f }) => ({ validator: async (m, h) => { o && u.push(({ getFieldValue: f }) => ({ validator: async (m, h) => {
const b = await Ce.exec(o, { value: h, fieldName: s }, { getFieldValue: f }); const b = await Ce.exec(o, { value: h, fieldName: s }, { getFieldValue: f });
return c.isString(b) && b ? Promise.reject(b) : c.isBoolean(b) && !b ? Promise.reject(n) : Promise.resolve(); return c.isString(b) && b ? Promise.reject(b) : c.isBoolean(b) && !b ? Promise.reject(n) : Promise.resolve();
} })); } }));
} }
p(d); p(u);
}, [e, t, i, n, r, a, o]), u; }, [e, t, i, n, r, a, o]), d;
}, xn = (e, t, i) => { }, xn = (e, t, i) => {
const [n, r] = F(null); const [n, r] = F(null);
return j(() => { return j(() => {
@ -669,20 +669,20 @@ const Ce = bt.getInstance(), at = () => {
}); });
}, [e, t, i]), n; }, [e, t, i]), n;
}, mi = (e, t, i = {}, n = {}, r = {}) => { }, mi = (e, t, i = {}, n = {}, r = {}) => {
const a = le(Gt), o = at(), s = U(!0), l = U([]), [u, p] = F(t), d = ee.useWatch((f) => JSON.stringify(c.pick(f, l.current)), a) || "{}"; const a = le(Gt), o = at(), s = U(!0), l = U([]), [d, p] = F(t), u = ee.useWatch((f) => JSON.stringify(c.pick(f, l.current)), a) || "{}";
return st(() => { return st(() => {
e && Ce.exec(e, i, { ...n, getFieldValueForBasicForm: (f) => r ? r.getFieldValue(f) : null, getFieldValue: c.wrap(a.getFieldValue, (f, m) => (l.current.some((h) => c.isEqual(h, m)) || (l.current.push(m), o()), f == null ? void 0 : f(m))), isFieldTouched: a.isFieldTouched, isFieldsTouched: a.isFieldsTouched }).then((f) => s.current && p(f)); e && Ce.exec(e, i, { ...n, getFieldValueForBasicForm: (f) => r ? r.getFieldValue(f) : null, getFieldValue: c.wrap(a.getFieldValue, (f, m) => (l.current.some((h) => c.isEqual(h, m)) || (l.current.push(m), o()), f == null ? void 0 : f(m))), isFieldTouched: a.isFieldTouched, isFieldsTouched: a.isFieldsTouched }).then((f) => s.current && p(f));
}, [e, d, a, i, n]), j(() => () => s.current = !1, []), u; }, [e, u, a, i, n]), j(() => () => s.current = !1, []), d;
}, Sn = (e, t, i = [], n = {}) => { }, Sn = (e, t, i = [], n = {}) => {
const r = U({}); const r = U({});
if (!t) return [e, r.current]; if (!t) return [e, r.current];
const a = U(), o = c.debounce(at(), 180), s = ["disabled", "required"], l = (d, f) => { const a = U(), o = c.debounce(at(), 180), s = ["disabled", "required"], l = (u, f) => {
s.includes(d) && (r.current[d] = f), o(); s.includes(u) && (r.current[u] = f), o();
}, u = H(() => ({ setDisabled: (d) => l("disabled", d), setRequired: (d) => l("required", d), getDisabled: () => r.current.disabled, getRequired: () => r.current.required }), [t]), p = mi(t, -1, {}, u, n) ?? -1; }, d = H(() => ({ setDisabled: (u) => l("disabled", u), setRequired: (u) => l("required", u), getDisabled: () => r.current.disabled, getRequired: () => r.current.required }), [t]), p = mi(t, -1, {}, d, n) ?? -1;
if (a.current != p && (p >= 0 || !c.isEmpty(i == null ? void 0 : i[p]))) { if (a.current != p && (p >= 0 || !c.isEmpty(i == null ? void 0 : i[p]))) {
a.current = p; a.current = p;
const { widget: d, widgetPrefix: f, props: m } = i == null ? void 0 : i[p]; const { widget: u, widgetPrefix: f, props: m } = i == null ? void 0 : i[p];
e = ti(d, f), r.current = c.merge(m, c.pick(r.current, s)); e = ti(u, f), r.current = c.merge(m, c.pick(r.current, s));
} }
return [e, r.current]; return [e, r.current];
}, Dt = (e) => e === void 0 || e === !1 ? "" : (Array.isArray(e) ? e : [e]).join("_"), kr = ({ value: e, onChange: t }, i = null) => { }, Dt = (e) => e === void 0 || e === !1 ? "" : (Array.isArray(e) ? e : [e]).join("_"), kr = ({ value: e, onChange: t }, i = null) => {
@ -708,12 +708,12 @@ const Ce = bt.getInstance(), at = () => {
i == "javascript" ? n(Z(a, e)) : t && n(Z(t, e)); i == "javascript" ? n(Z(a, e)) : t && n(Z(t, e));
}, [e, t, a]), null; }, [e, t, a]), null;
}, hi = ({ widget: e = "Input", widgetPrefix: t = "@pkg/ff/grid-layout-forms", widgetDecorator: i, subWidgets: n = [], basicForm: r, ...a }) => { }, hi = ({ widget: e = "Input", widgetPrefix: t = "@pkg/ff/grid-layout-forms", widgetDecorator: i, subWidgets: n = [], basicForm: r, ...a }) => {
const o = ti(e, t), [s, l] = Sn(o, i, n, r), [u, p] = F(); const o = ti(e, t), [s, l] = Sn(o, i, n, r), [d, p] = F();
return j(() => { return j(() => {
s && oe.getWidgetComponent(s).then(({ defaultProps: d = {}, default: f }) => ({ default: Pn(f, d, r) })).catch((d) => ({ default: () => `${d}` })).then((d) => p(k.createElement(d.default, a))); s && oe.getWidgetComponent(s).then(({ defaultProps: u = {}, default: f }) => ({ default: Pn(f, u, r) })).catch((u) => ({ default: () => `${u}` })).then((u) => p(k.createElement(u.default, a)));
}, [s]), u && k.cloneElement(u, { ...a, ...l }); }, [s]), d && k.cloneElement(d, { ...a, ...l });
}, Pn = (e, t = {}, i = null) => (n) => { }, Pn = (e, t = {}, i = null) => (n) => {
const { type: r, code: a, label: o, noStyle: s, placeholder: l, required: u = !1, extras: p, validators: d, help: f, isVirtual: m, $isReserved: h, initialValue: b, initialValueLanguage: C, ...x } = c.omit(c.merge({}, t, n), ["convertJs", "convertJsSetting", "widget", "widgetPerfix", "widgetDecorator", "subWidgets", "boxStyle"]), T = kn(Object.assign({}, d, u ? { required: !0 } : {}), a, r), P = H(() => { const { type: r, code: a, label: o, noStyle: s, placeholder: l, required: d = !1, extras: p, validators: u, help: f, isVirtual: m, $isReserved: h, initialValue: b, initialValueLanguage: C, ...x } = c.omit(c.merge({}, t, n), ["convertJs", "convertJsSetting", "widget", "widgetPerfix", "widgetDecorator", "subWidgets", "boxStyle"]), T = kn(Object.assign({}, u, d ? { required: !0 } : {}), a, r), P = H(() => {
const M = Object.keys((t == null ? void 0 : t.extras) || {}); const M = Object.keys((t == null ? void 0 : t.extras) || {});
return c.over([c.partialRight(c.pick, M), c.partialRight(c.omit, M)]); return c.over([c.partialRight(c.pick, M), c.partialRight(c.omit, M)]);
}, [t == null ? void 0 : t.extras]), [O, V] = P(x), q = { label: o, noStyle: s, colon: !1, layout: "vertical" }, I = Y((M) => M == null ? void 0 : Z(M, r), [r]); }, [t == null ? void 0 : t.extras]), [O, V] = P(x), q = { label: o, noStyle: s, colon: !1, layout: "vertical" }, I = Y((M) => M == null ? void 0 : Z(M, r), [r]);
@ -726,12 +726,12 @@ const Ce = bt.getInstance(), at = () => {
return A("div", { className: "ff-grid-layout-form", style: { "--grid-layout-item-margin-x": `${(i == null ? void 0 : i[0]) ?? 8}px`, "--grid-layout-item-margin-y": `${(i == null ? void 0 : i[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, a && k.cloneElement(a, { cols: e, rowHeight: t, itemMargin: i, containerPadding: n, fields: r })] }); return A("div", { className: "ff-grid-layout-form", style: { "--grid-layout-item-margin-x": `${(i == null ? void 0 : i[0]) ?? 8}px`, "--grid-layout-item-margin-y": `${(i == null ? void 0 : i[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, a && k.cloneElement(a, { cols: e, rowHeight: t, itemMargin: i, containerPadding: n, fields: r })] });
}; };
$t.propTypes = { fields: w.array }; $t.propTypes = { fields: w.array };
const $n = (qt = $t, ({ code: e, layout: t, name: i, primaryKey: n = 0, style: r = {}, formProps: a = {}, form: o, basicForm: s, isPreview: l = !1, className: u, onFinish: p, onValuesChange: d = () => { const $n = (qt = $t, ({ code: e, layout: t, name: i, primaryKey: n = 0, style: r = {}, formProps: a = {}, form: o, basicForm: s, isPreview: l = !1, className: d, onFinish: p, onValuesChange: u = () => {
}, ...f }) => { }, ...f }) => {
const { align: m, autoComplete: h, resource: b, items: C, hides: x, rowHeight: T, marginX: P, marginY: O, cols: V, listenChangeFields: q, listenChangeFieldsFunc: I, pk: M, uuid: N } = Cn(e), [S] = ee.useForm(o), E = H(() => [{ name: "__PK__", value: M }, { name: "__PROPS__", value: a }, { name: "__RESOURCE__", value: b }, { name: "__LAYOUT_KEY__", value: e }, { name: "__LAYOUT_UUID__", value: N }, { name: "__PRIMARY_KEY__", value: n }], [M, e, N, b, n, a]); const { align: m, autoComplete: h, resource: b, items: C, hides: x, rowHeight: T, marginX: P, marginY: O, cols: V, listenChangeFields: q, listenChangeFieldsFunc: I, pk: M, uuid: N } = Cn(e), [S] = ee.useForm(o), E = H(() => [{ name: "__PK__", value: M }, { name: "__PROPS__", value: a }, { name: "__RESOURCE__", value: b }, { name: "__LAYOUT_KEY__", value: e }, { name: "__LAYOUT_UUID__", value: N }, { name: "__PRIMARY_KEY__", value: n }], [M, e, N, b, n, a]);
return A(ee, { className: u, name: i || e, layout: t || m, fields: E, form: S, autoComplete: h, style: { ...r, position: "relative" }, onFinish: p, onValuesChange: (D, X) => (({ changedValues: ve, allValues: K, listenChangeFields: ot, listenChangeFieldsFunc: Ke, onValuesChange: lt, code: Et }) => { return A(ee, { className: d, name: i || e, layout: t || m, fields: E, form: S, autoComplete: h, style: { ...r, position: "relative" }, onFinish: p, onValuesChange: (D, X) => (({ changedValues: ve, allValues: K, listenChangeFields: ot, listenChangeFieldsFunc: Ke, onValuesChange: lt, code: Et }) => {
lt(ve, K), Ke && Array.isArray(ot) && Ce.exec(Ke, { changedValues: ve, allValues: K }, { getFieldValue: S.getFieldValue, setFieldValue: S.setFieldValue, setFieldsValue: S.setFieldsValue, isFieldTouched: S.isFieldTouched, isFieldsTouched: S.isFieldsTouched }); lt(ve, K), Ke && Array.isArray(ot) && Ce.exec(Ke, { changedValues: ve, allValues: K }, { getFieldValue: S.getFieldValue, setFieldValue: S.setFieldValue, setFieldsValue: S.setFieldsValue, isFieldTouched: S.isFieldTouched, isFieldsTouched: S.isFieldsTouched });
})({ changedValues: D, allValues: X, listenChangeFields: q, listenChangeFieldsFunc: I, onValuesChange: d, code: e }), children: [g(qt, { ...f, form: S, basicForm: s, code: e, fields: C, cols: V, rowHeight: T, itemMargin: [P, O] }), x == null ? void 0 : x.map((D) => { })({ changedValues: D, allValues: X, listenChangeFields: q, listenChangeFieldsFunc: I, onValuesChange: u, code: e }), children: [g(qt, { ...f, form: S, basicForm: s, code: e, fields: C, cols: V, rowHeight: T, itemMargin: [P, O] }), x == null ? void 0 : x.map((D) => {
var X; var X;
return g(Yt, { name: D.code, children: g(vn, { form: S, basicForm: s, name: D.code, type: D.type, initialValue: D.initialValue, initialValueLanguage: (X = D.extras) == null ? void 0 : X.initialValueLanguage }) }, JSON.stringify(D.code)); return g(Yt, { name: D.code, children: g(vn, { form: S, basicForm: s, name: D.code, type: D.type, initialValue: D.initialValue, initialValueLanguage: (X = D.extras) == null ? void 0 : X.initialValueLanguage }) }, JSON.stringify(D.code));
})] }, e); })] }, e);
@ -742,8 +742,8 @@ const fi = ({ $setting: e, $close: t, extras: i, code: n, primaryKey: r, ...a })
return j(() => { return j(() => {
s && o.setFieldsValue(s); s && o.setFieldsValue(s);
}, [s]), g(G, { actions: A(k.Fragment, { children: [g($, { name: "保存", type: "primary", widget: () => { }, [s]), g(G, { actions: A(k.Fragment, { children: [g($, { name: "保存", type: "primary", widget: () => {
const l = o.getFieldValue("__RESOURCE__"), { initDataUri: u = `/api/${n}` } = e || {}; const l = o.getFieldValue("__RESOURCE__"), { initDataUri: d = `/api/${n}` } = e || {};
o.validateFields(!0).then((p) => l ? c.pick(p, [l]) : p).then((p) => L.post(r ? `${u}/${r}` : `${u}`, p).msg(t)).catch(() => _.error("请先完善表单信息", { duration: 2e3 })); o.validateFields(!0).then((p) => l ? c.pick(p, [l]) : p).then((p) => L.post(r ? `${d}/${r}` : `${d}`, p).msg(t)).catch(() => _.error("请先完善表单信息", { duration: 2e3 }));
} }), g($, { name: "取消", widget: () => t(!1) })] }), extras: i, children: g($n, { form: o, code: n, primaryKey: r, ...a }) }); } }), g($, { name: "取消", widget: () => t(!1) })] }), extras: i, children: g($n, { form: o, code: n, primaryKey: r, ...a }) });
}, Ut = /* @__PURE__ */ new Set(), Ct = (e = [], t = 0) => { }, Ut = /* @__PURE__ */ new Set(), Ct = (e = [], t = 0) => {
const i = e[t]; const i = e[t];
@ -759,9 +759,9 @@ const fi = ({ $setting: e, $close: t, extras: i, code: n, primaryKey: r, ...a })
kt.propTypes = { className: w.string, type: w.string.isRequired, style: w.object }, kt.init = Ct; kt.propTypes = { className: w.string, type: w.string.isRequired, style: w.object }, kt.init = Ct;
const Tn = (e, t, i, { isReplaceRouteHistory: n = !1 } = {}) => be.redirect(i, t, { replace: n }), Nn = (e, t = {}, i, n = {}) => { const Tn = (e, t, i, { isReplaceRouteHistory: n = !1 } = {}) => be.redirect(i, t, { replace: n }), Nn = (e, t = {}, i, n = {}) => {
var a; var a;
const r = (a = n.router) == null ? void 0 : a.reduce((o, [s, l, u]) => { const r = (a = n.router) == null ? void 0 : a.reduce((o, [s, l, d]) => {
const p = c.get(t, ["router", s]); const p = c.get(t, ["router", s]);
if (!p && p !== 0 && l) throw `请传入 ${u}`; if (!p && p !== 0 && l) throw `请传入 ${d}`;
return `${o}/${p}`; return `${o}/${p}`;
}, `/api/${i}`); }, `/api/${i}`);
return L.del(r, t.param).msg(); return L.del(r, t.param).msg();
@ -771,12 +771,12 @@ const Tn = (e, t, i, { isReplaceRouteHistory: n = !1 } = {}) => be.redirect(i, t
}, Ht = (e, t, i, n, r) => c.isString(i) && i ? oe.getWidgetComponent(i).then(({ default: a }) => _.modal(a, { ...t, $setting: n }, r != null && r.title ? { ...r, title: c.template(r.title)(e) } : r)).catch((a) => { }, Ht = (e, t, i, n, r) => c.isString(i) && i ? oe.getWidgetComponent(i).then(({ default: a }) => _.modal(a, { ...t, $setting: n }, r != null && r.title ? { ...r, title: c.template(r.title)(e) } : r)).catch((a) => {
_.error(i, { content: a.toString() }); _.error(i, { content: a.toString() });
}) : _.modal(i, { ...t, $setting: n }, r != null && r.title ? { ...r, title: c.template(r.title)(e) } : r), Fn = (e, t, i, n, r) => _.modal(fi, { ...t, $setting: n, code: i }, r != null && r.title ? { ...r, title: c.template(r.title)(e) } : r), En = (e, t, i, n, r) => _.modal(Pt, { base62params: t, $setting: n, listCode: i }, r != null && r.title ? { ...r, title: c.template(r.title)(e) } : r), Rn = ({ widget: e, widgetType: t, widgetData: i, widgetProps: n, widgetSetting: r, widgetContainerProps: a }, { onAfterClick: o, onBeforeClick: s }) => { }) : _.modal(i, { ...t, $setting: n }, r != null && r.title ? { ...r, title: c.template(r.title)(e) } : r), Fn = (e, t, i, n, r) => _.modal(fi, { ...t, $setting: n, code: i }, r != null && r.title ? { ...r, title: c.template(r.title)(e) } : r), En = (e, t, i, n, r) => _.modal(Pt, { base62params: t, $setting: n, listCode: i }, r != null && r.title ? { ...r, title: c.template(r.title)(e) } : r), Rn = ({ widget: e, widgetType: t, widgetData: i, widgetProps: n, widgetSetting: r, widgetContainerProps: a }, { onAfterClick: o, onBeforeClick: s }) => {
const l = le(te), [u, p] = F({ leading: !0, trailing: !1 }), d = H(() => { const l = le(te), [d, p] = F({ leading: !0, trailing: !1 }), u = H(() => {
switch (t) { switch (t) {
case "redirect": case "redirect":
return c.partialRight(Tn, e, r); return c.partialRight(Tn, e, r);
case "func": case "func":
return c.partialRight(Wt, (r == null ? void 0 : r.code) ?? e, { status: u, setStatus: p }); return c.partialRight(Wt, (r == null ? void 0 : r.code) ?? e, { status: d, setStatus: p });
case "fsdpf-component": case "fsdpf-component":
return c.partialRight(Ht, e, r, a); return c.partialRight(Ht, e, r, a);
case "grid-layout-form": case "grid-layout-form":
@ -787,71 +787,71 @@ const Tn = (e, t, i, { isReplaceRouteHistory: n = !1 } = {}) => be.redirect(i, t
return c.partialRight(Nn, e, r, a); return c.partialRight(Nn, e, r, a);
default: default:
if (Ft(e) || k.isValidElement(e)) return c.partialRight(Ht, e, r, a); if (Ft(e) || k.isValidElement(e)) return c.partialRight(Ht, e, r, a);
if (c.isFunction(e)) return c.partialRight(Wt, (r == null ? void 0 : r.code) || e, { status: u, setStatus: p }); if (c.isFunction(e)) return c.partialRight(Wt, (r == null ? void 0 : r.code) || e, { status: d, setStatus: p });
} }
return (...f) => console.error("useButton unknown widgetType", t, ...f); return (...f) => console.error("useButton unknown widgetType", t, ...f);
}, [e, t]); }, [e, t]);
return [c.debounce((f) => (s == null || s(f), Promise.resolve(Ue(n, f, { list: l })).then((m) => d(f, { ...i, ...m })).then((m) => o == null ? void 0 : o(m)).catch(console.error)), 300, { leading: !0, trailing: !1 }), u]; return [c.debounce((f) => (s == null || s(f), Promise.resolve(Ue(n, f, { list: l })).then((m) => u(f, { ...i, ...m })).then((m) => o == null ? void 0 : o(m)).catch(console.error)), 300, { leading: !0, trailing: !1 }), d];
}, yi = ({ type: e, name: t, className: i, icon: n, iconPosition: r, size: a }, o = "default") => H(() => { }, yi = ({ type: e, name: t, className: i, icon: n, iconPosition: r, size: a }, o = "default") => H(() => {
const s = { type: "primary", className: z("ff-button", i), iconPosition: r, size: a }; const s = { type: "primary", className: z("ff-button", i), iconPosition: r, size: a };
return e === "danger" ? s.danger = !0 : e === "default" && (s.type = e), o === "link" || o === "dashed" ? (s.type = o, e === "default" && (s.className = z(s.className, "ff-default"))) : o !== "circle" && o !== "round" || (s.shape = o), n && (s.icon = g(kt, { type: n })), t && (s.children = t), s; return e === "danger" ? s.danger = !0 : e === "default" && (s.type = e), o === "link" || o === "dashed" ? (s.type = o, e === "default" && (s.className = z(s.className, "ff-default"))) : o !== "circle" && o !== "round" || (s.shape = o), n && (s.icon = g(kt, { type: n })), t && (s.children = t), s;
}, [o, e, i, n, r]), He = (e) => function({ className: t, variant: i, children: n, name: r, icon: a, type: o = "default", iconPosition: s = "start", noAuthType: l, onAfterClick: u, onBeforeClick: p, data: d, loading: f, disabled: m, tooltip: h, confirm: b, widget: C = () => { }, [o, e, i, n, r]), He = (e) => function({ className: t, variant: i, children: n, name: r, icon: a, type: o = "default", iconPosition: s = "start", noAuthType: l, onAfterClick: d, onBeforeClick: p, data: u, loading: f, disabled: m, tooltip: h, confirm: b, widget: C = () => {
}, widgetType: x, widgetData: T, widgetProps: P, widgetSetting: O, widgetContainerProps: V, ...q }) { }, widgetType: x, widgetData: T, widgetProps: P, widgetSetting: O, widgetContainerProps: V, ...q }) {
const I = c.isEmpty(h) || !h.enabled ? {} : h, M = c.isEmpty(b) ? { enabled: !1 } : Object.assign({ enabled: !0 }, b), N = yi({ className: t, name: r, type: o, icon: a, iconPosition: s }, i ?? e), [S, E] = F(!1), [D, { disabled: X, loading: ve }] = Rn({ widget: C, widgetType: x, widgetData: T, widgetProps: P, widgetSetting: O, widgetContainerProps: V }, { onAfterClick: u, onBeforeClick: p }); const I = c.isEmpty(h) || !h.enabled ? {} : h, M = c.isEmpty(b) ? { enabled: !1 } : Object.assign({ enabled: !0 }, b), N = yi({ className: t, name: r, type: o, icon: a, iconPosition: s }, i ?? e), [S, E] = F(!1), [D, { disabled: X, loading: ve }] = Rn({ widget: C, widgetType: x, widgetData: T, widgetProps: P, widgetSetting: O, widgetContainerProps: V }, { onAfterClick: d, onBeforeClick: p });
return g(Vi, { okText: "确定", cancelText: "取消", getPopupContainer: (K) => K, ...M, disabled: X || m, open: S, onOpenChange: (K) => { return g(Vi, { okText: "确定", cancelText: "取消", getPopupContainer: (K) => K, ...M, disabled: X || m, open: S, onOpenChange: (K) => {
if (!K) return E(K); if (!K) return E(K);
M.enabled ? E(K) : D(d); M.enabled ? E(K) : D(u);
}, onConfirm: () => { }, onConfirm: () => {
D(d); D(u);
}, onClick: (K) => { }, onClick: (K) => {
K.stopPropagation(); K.stopPropagation();
}, children: g(Ii, { getPopupContainer: (K) => K, ...I, title: S ? null : I == null ? void 0 : I.title, trigger: ["hover", "click"], children: g(Qe, { loading: ve || f, disabled: X || m, ...N, ...q, children: n || r }) }) }); }, children: g(Ii, { getPopupContainer: (K) => K, ...I, title: S ? null : I == null ? void 0 : I.title, trigger: ["hover", "click"], children: g(Qe, { loading: ve || f, disabled: X || m, ...N, ...q, children: n || r }) }) });
}, $ = He("default"); }, $ = He("default");
$.propTypes = { type: w.oneOf(["primary", "default", "danger", ""]), size: w.oneOf(["large", "middle", "small"]), name: w.string, icon: w.string, iconPosition: w.oneOf(["start", "end"]), data: w.any, widget: w.any, widgetType: w.oneOf(["destroy", "redirect", "func", "fsdpf-component", "grid-layout-form", "grid-layout", "data-list"]), widgetData: w.object, widgetProps: w.object, widgetSetting: w.object, widgetContainerProps: w.object, tooltip: w.exact({ title: w.string.isRequired, placement: w.oneOf(["top", "left", "right", "bottom", "topLeft", "topRight", "bottomLeft", "bottomRight", "leftTop", "leftBottom", "rightTop", "rightBottom"]), enabled: w.oneOfType([w.bool, w.number]), getPopupContainer: w.func }), confirm: w.exact({ title: w.string.isRequired, cancelText: w.string, okText: w.string, okType: w.oneOf(["primary", "default", "danger", ""]), placement: w.oneOf(["top", "left", "right", "bottom", "topLeft", "topRight", "bottomLeft", "bottomRight", "leftTop", "leftBottom", "rightTop", "rightBottom"]), enabled: w.oneOfType([w.bool, w.number]), getPopupContainer: w.func, arrow: w.oneOfType([w.bool, w.exact({ pointAtCenter: w.bool })]) }) }; $.propTypes = { type: w.oneOf(["primary", "default", "danger", ""]), size: w.oneOf(["large", "middle", "small"]), name: w.string, icon: w.string, iconPosition: w.oneOf(["start", "end"]), data: w.any, widget: w.any, widgetType: w.oneOf(["destroy", "redirect", "func", "fsdpf-component", "grid-layout-form", "grid-layout", "data-list"]), widgetData: w.object, widgetProps: w.object, widgetSetting: w.object, widgetContainerProps: w.object, tooltip: w.exact({ title: w.string.isRequired, placement: w.oneOf(["top", "left", "right", "bottom", "topLeft", "topRight", "bottomLeft", "bottomRight", "leftTop", "leftBottom", "rightTop", "rightBottom"]), enabled: w.oneOfType([w.bool, w.number]), getPopupContainer: w.func }), confirm: w.exact({ title: w.string.isRequired, cancelText: w.string, okText: w.string, okType: w.oneOf(["primary", "default", "danger", ""]), placement: w.oneOf(["top", "left", "right", "bottom", "topLeft", "topRight", "bottomLeft", "bottomRight", "leftTop", "leftBottom", "rightTop", "rightBottom"]), enabled: w.oneOfType([w.bool, w.number]), getPopupContainer: w.func, arrow: w.oneOfType([w.bool, w.exact({ pointAtCenter: w.bool })]) }) };
const On = He("link"), Ln = He("circle"), An = He("round"), jn = He("dashed"), Tt = ({ data: e, widget: t, widgetType: i = "fsdpf-component", widgetData: n, widgetProps: r, widgetSetting: a, widgetContainerProps: o, onAfterClick: s, onBeforeClick: l, children: u, extras: p }) => { const On = He("link"), Ln = He("circle"), An = He("round"), jn = He("dashed"), Tt = ({ data: e, widget: t, widgetType: i = "fsdpf-component", widgetData: n, widgetProps: r, widgetSetting: a, widgetContainerProps: o, onAfterClick: s, onBeforeClick: l, children: d, extras: p }) => {
const d = le(te), [f, m] = F(!1), [h, b] = F("hover"), [C, x] = F({}), [T, P] = F(), { placement: O, align: V, arrow: q = { pointAtCenter: !0 }, getPopupContainer: I, ...M } = o || {}; const u = le(te), [f, m] = F(!1), [h, b] = F("hover"), [C, x] = F({}), [T, P] = F(), { placement: O, align: V, arrow: q = { pointAtCenter: !0 }, getPopupContainer: I, ...M } = o || {};
j(() => { j(() => {
i == "grid-layout-form" ? P(k.createElement(fi, { ...n, $setting: a, code: t })) : i == "data-list" ? P(k.createElement(Pt, { base62params: e, $setting: a, listCode: t })) : c.isString(t) ? oe.getWidgetComponent(t).then(({ default: E }) => { i == "grid-layout-form" ? P(k.createElement(fi, { ...n, $setting: a, code: t })) : i == "data-list" ? P(k.createElement(Pt, { base62params: e, $setting: a, listCode: t })) : c.isString(t) ? oe.getWidgetComponent(t).then(({ default: E }) => {
P(k.createElement(E, { ...n, $setting: a })); P(k.createElement(E, { ...n, $setting: a }));
}).catch((E) => P(E.toString())) : Ft(t) ? P(k.createElement(t, { ...n, $setting: a })) : k.isValidElement(t) && P(k.cloneElement(t, { ...n, $setting: a })); }).catch((E) => P(E.toString())) : Ft(t) ? P(k.createElement(t, { ...n, $setting: a })) : k.isValidElement(t) && P(k.cloneElement(t, { ...n, $setting: a }));
}, [t, i, n]), j(() => { }, [t, i, n]), j(() => {
Promise.resolve(Ue(r, e, { list: d })).then(x); Promise.resolve(Ue(r, e, { list: u })).then(x);
}, [r, e, d.getBase62params]); }, [r, e, u.getBase62params]);
const N = (E, D = !1) => (m(E), !E && b("hover"), E ? l == null ? void 0 : l(C) : s == null ? void 0 : s(D)), S = (E) => { const N = (E, D = !1) => (m(E), !E && b("hover"), E ? l == null ? void 0 : l(C) : s == null ? void 0 : s(D)), S = (E) => {
m(!0), b("click"); m(!0), b("click");
}; };
return g(Mi, { zIndex: 1080, placement: O, onPopupClick: S, onClick: S, open: f, align: V, arrow: q, trigger: h, getPopupContainer: I, content: g(Vn, { ...M, extras: p, children: T && k.cloneElement(T, { ...C, $close: (E) => N(!1, E) }) }), children: u, onOpenChange: N }); return g(Mi, { zIndex: 1080, placement: O, onPopupClick: S, onClick: S, open: f, align: V, arrow: q, trigger: h, getPopupContainer: I, content: g(Vn, { ...M, extras: p, children: T && k.cloneElement(T, { ...C, $close: (E) => N(!1, E) }) }), children: d, onOpenChange: N });
}, Vn = ({ title: e, className: t, children: i, extras: n, width: r, height: a, ...o }) => { }, Vn = ({ title: e, className: t, children: i, extras: n, width: r, height: a, ...o }) => {
const [s, l] = F({}), u = Y((m, h) => l((b) => ({ ...b, [m]: h })), []), p = Y((m) => l((h) => ({ ...h, [m]: void 0 })), []), d = e ? k.createElement("div", { className: "ff-popup-title" }, e) : s == null ? void 0 : s.title, f = n ?? k.createElement("div", { className: "ff-popup-reserved-extras" }, n); const [s, l] = F({}), d = Y((m, h) => l((b) => ({ ...b, [m]: h })), []), p = Y((m) => l((h) => ({ ...h, [m]: void 0 })), []), u = e ? k.createElement("div", { className: "ff-popup-title" }, e) : s == null ? void 0 : s.title, f = n ?? k.createElement("div", { className: "ff-popup-reserved-extras" }, n);
return g(qe.Provider, { value: { ele: s, mount: u, unmount: p }, children: A("div", { className: z("ff-popup ff-popover", t, s.rootClassName), style: { width: r, height: a }, ...o, children: [A("div", { className: "ff-popup-header", children: [d, s == null ? void 0 : s["sub-title"]] }), i, A("div", { className: "ff-popup-footer", children: [f, s == null ? void 0 : s.extras, s == null ? void 0 : s.actions] })] }) }); return g(qe.Provider, { value: { ele: s, mount: d, unmount: p }, children: A("div", { className: z("ff-popup ff-popover", t, s.rootClassName), style: { width: r, height: a }, ...o, children: [A("div", { className: "ff-popup-header", children: [u, s == null ? void 0 : s["sub-title"]] }), i, A("div", { className: "ff-popup-footer", children: [f, s == null ? void 0 : s.extras, s == null ? void 0 : s.actions] })] }) });
}; };
Tt.propTypes = { widgetType: w.oneOf(["fsdpf-component", "grid-layout-form", "data-list"]) }; Tt.propTypes = { widgetType: w.oneOf(["fsdpf-component", "grid-layout-form", "data-list"]) };
const Kt = ({ options: e = [], triggerWeights: t = ["grid-layout-form", "grid-layout", "fsdpf-component", "print"], onAfterClick: i = (m, h, b) => { const Kt = ({ options: e = [], triggerWeights: t = ["grid-layout-form", "grid-layout", "fsdpf-component", "print"], onAfterClick: i = (m, h, b) => {
}, onBeforeClick: n = (m, h, b) => { }, onBeforeClick: n = (m, h, b) => {
}, labelVariant: r = "link", labelSize: a, labelRender: o, btnVariant: s, btnSize: l, btnRender: u = (m, h) => g($, { ...m, data: h }, m.uuid || Le()), widgetContainerProps: p = {}, children: d, data: f }) => { }, labelVariant: r = "link", labelSize: a, labelRender: o, btnVariant: s, btnSize: l, btnRender: d = (m, h) => g($, { ...m, data: h }, m.uuid || Le()), widgetContainerProps: p = {}, children: u, data: f }) => {
if (c.isEmpty(e)) return d; if (c.isEmpty(e)) return u;
const [m, h] = H(() => (e || []).reduce((C, x) => { const [m, h] = H(() => (e || []).reduce((C, x) => {
const T = t.indexOf(x.widgetType); const T = t.indexOf(x.widgetType);
return T === -1 ? C[1].push(x) : C[0] ? T < t.indexOf(C[0].widgetType) ? (C[1].push(C[0]), C[0] = x) : C[1].push(x) : C[0] = x, C; return T === -1 ? C[1].push(x) : C[0] ? T < t.indexOf(C[0].widgetType) ? (C[1].push(C[0]), C[0] = x) : C[1].push(x) : C[0] = x, C;
}, [null, []]), [e, t]); }, [null, []]), [e, t]);
o ? d = o(m, f) || d : d || (d = g(Qe, { ...yi(Object.assign(m != null && m.name || m != null && m.icon ? {} : { icon: "icon-location" }, m, { size: a }), r) })); o ? u = o(m, f) || u : u || (u = g(Qe, { ...yi(Object.assign(m != null && m.name || m != null && m.icon ? {} : { icon: "icon-location" }, m, { size: a }), r) }));
const b = h.map((C) => u(Object.assign({ uuid: C.uuid, type: C.type, name: C.name, widget: C.widget, widgetType: C.widgetType, widgetProps: C.widgetProps, widgetData: C.widgetData, widgetSetting: C.widgetSetting, widgetContainerProps: C.widgetContainerSetting, confirm: C.confirm, onAfterClick: c.partialRight(i, C, f), onBeforeClick: c.partialRight(n, C, f) }, { size: l, variant: s }), f)); const b = h.map((C) => d(Object.assign({ uuid: C.uuid, type: C.type, name: C.name, widget: C.widget, widgetType: C.widgetType, widgetProps: C.widgetProps, widgetData: C.widgetData, widgetSetting: C.widgetSetting, widgetContainerProps: C.widgetContainerSetting, confirm: C.confirm, onAfterClick: c.partialRight(i, C, f), onBeforeClick: c.partialRight(n, C, f) }, { size: l, variant: s }), f));
return g(Tt, { widget: m == null ? void 0 : m.widget, widgetType: m == null ? void 0 : m.widgetType, widgetProps: m == null ? void 0 : m.widgetProps, widgetSetting: m == null ? void 0 : m.widgetSetting, widgetContainerProps: Object.assign({}, p, m == null ? void 0 : m.widgetContainerProps), data: f, widgetData: m == null ? void 0 : m.widgetData, extras: b, onAfterClick: c.partialRight(i, m, f), onBeforeClick: c.partialRight(n, m, f), children: d }); return g(Tt, { widget: m == null ? void 0 : m.widget, widgetType: m == null ? void 0 : m.widgetType, widgetProps: m == null ? void 0 : m.widgetProps, widgetSetting: m == null ? void 0 : m.widgetSetting, widgetContainerProps: Object.assign({}, p, m == null ? void 0 : m.widgetContainerProps), data: f, widgetData: m == null ? void 0 : m.widgetData, extras: b, onAfterClick: c.partialRight(i, m, f), onBeforeClick: c.partialRight(n, m, f), children: u });
}; };
Kt.propTypes = { triggerWeights: w.array, options: w.arrayOf(w.shape({ ...$.propTypes, widgetType: $.propTypes.widgetType.isRequired })), btnSize: $.propTypes.size, btnRender: w.func, btnVariant: w.oneOf(["", "default", "link", "circle", "round", "dashed"]), labelVariant: w.oneOf(["", "default", "link", "circle", "round", "dashed"]), labelRender: w.func, labelSize: $.propTypes.size, onAfterClick: w.func, onBeforeClick: w.func, widgetContainerProps: $.propTypes.widgetContainerProps, data: $.propTypes.data }, $.Link = On, $.Link.defaultProps = $.defaultProps, $.Link.propTypes = $.propTypes, $.Circle = Ln, $.Circle.defaultProps = $.defaultProps, $.Circle.propTypes = $.propTypes, $.Round = An, $.Round.defaultProps = $.defaultProps, $.Round.propTypes = $.propTypes, $.Dashed = jn, $.Dashed.defaultProps = $.defaultProps, $.Dashed.propTypes = $.propTypes, $.Popover = Tt, $.GroupPopover = Kt; Kt.propTypes = { triggerWeights: w.array, options: w.arrayOf(w.shape({ ...$.propTypes, widgetType: $.propTypes.widgetType.isRequired })), btnSize: $.propTypes.size, btnRender: w.func, btnVariant: w.oneOf(["", "default", "link", "circle", "round", "dashed"]), labelVariant: w.oneOf(["", "default", "link", "circle", "round", "dashed"]), labelRender: w.func, labelSize: $.propTypes.size, onAfterClick: w.func, onBeforeClick: w.func, widgetContainerProps: $.propTypes.widgetContainerProps, data: $.propTypes.data }, $.Link = On, $.Link.defaultProps = $.defaultProps, $.Link.propTypes = $.propTypes, $.Circle = Ln, $.Circle.defaultProps = $.defaultProps, $.Circle.propTypes = $.propTypes, $.Round = An, $.Round.defaultProps = $.defaultProps, $.Round.propTypes = $.propTypes, $.Dashed = jn, $.Dashed.defaultProps = $.defaultProps, $.Dashed.propTypes = $.propTypes, $.Popover = Tt, $.GroupPopover = Kt;
const In = ({ fields: e, formProps: t, $close: i }) => { const In = ({ fields: e, formProps: t, $close: i }) => {
const [n] = ee.useForm(), r = H(() => [{ name: "__PROPS__", value: t }], [t]); const [n] = ee.useForm(), r = H(() => [{ name: "__PROPS__", value: t }], [t]);
return g(G, { actions: A(k.Fragment, { children: [g($, { name: "取消", widget: () => i(!1) }), g($, { name: "确定", type: "primary", widget: () => n.validateFields(!0).then(i) })] }), children: g(ee, { fields: r, form: n, className: "ff-modal-form", children: e == null ? void 0 : e.map(({ code: a, ...o }) => g(hi, { code: a, ...o }, a)) }) }); return g(G, { actions: A(k.Fragment, { children: [g($, { name: "取消", widget: () => i(!1) }), g($, { name: "确定", type: "primary", widget: () => n.validateFields(!0).then(i) })] }), children: g(ee, { fields: r, form: n, className: "ff-modal-form", children: e == null ? void 0 : e.map(({ code: a, ...o }) => g(hi, { code: a, ...o }, a)) }) });
}, Mn = ({ className: e, $close: t, children: i, title: n, subTitle: r, actions: a, extras: o, zIndex: s, ...l }) => A(Ji, { ...l, prefixCls: "ff-drawer", className: z("ff-popup", e), maskMotion: { motionAppear: !0, motionName: "mask-motion" }, motion: (u) => ({ motionAppear: !0, motionName: `panel-motion-${u}` }), children: [A("div", { className: "ff-popup-header", children: [g("button", { "aria-label": "Close", className: "ff-popup-close", onClick: l.onClose, children: g(vt, { type: "close" }) }), n, r] }), g("div", { className: "ff-popup-body", children: i }), A("div", { className: "ff-popup-footer", children: [o, a] })] }), zn = ({ className: e, $close: t, $event: i, children: n, title: r, subTitle: a, actions: o, extras: s, zIndex: l, placement: u, ...p }) => { }, Mn = ({ className: e, $close: t, children: i, title: n, subTitle: r, actions: a, extras: o, zIndex: s, ...l }) => A(Ji, { ...l, prefixCls: "ff-drawer", className: z("ff-popup", e), maskMotion: { motionAppear: !0, motionName: "mask-motion" }, motion: (d) => ({ motionAppear: !0, motionName: `panel-motion-${d}` }), children: [A("div", { className: "ff-popup-header", children: [g("button", { "aria-label": "Close", className: "ff-popup-close", onClick: l.onClose, children: g(vt, { type: "close" }) }), n, r] }), g("div", { className: "ff-popup-body", children: i }), A("div", { className: "ff-popup-footer", children: [o, a] })] }), zn = ({ className: e, $close: t, $event: i, children: n, title: r, subTitle: a, actions: o, extras: s, zIndex: l, placement: d, ...p }) => {
const d = (i == null ? void 0 : i.pageX) === void 0 ? { animation: null, maskAnimation: null, mousePosition: { x: null, y: null } } : { animation: "zoom", maskAnimation: "fade", mousePosition: { x: i == null ? void 0 : i.pageX, y: i == null ? void 0 : i.pageY } }; const u = (i == null ? void 0 : i.pageX) === void 0 ? { animation: null, maskAnimation: null, mousePosition: { x: null, y: null } } : { animation: "zoom", maskAnimation: "fade", mousePosition: { x: i == null ? void 0 : i.pageX, y: i == null ? void 0 : i.pageY } };
return g(_i, { ...p, ...d, prefixCls: "ff-modal", modalRender: () => A("div", { className: z("ff-modal-content ff-popup", e), children: [A("div", { className: "ff-popup-header", children: [g("button", { "aria-label": "Close", className: "ff-popup-close", onClick: p.onClose, children: g(vt, { type: "close" }) }), r, a] }), g("div", { className: "ff-popup-body", children: n }), A("div", { className: "ff-popup-footer", children: [s, o] })] }) }); return g(_i, { ...p, ...u, prefixCls: "ff-modal", modalRender: () => A("div", { className: z("ff-modal-content ff-popup", e), children: [A("div", { className: "ff-popup-header", children: [g("button", { "aria-label": "Close", className: "ff-popup-close", onClick: p.onClose, children: g(vt, { type: "close" }) }), r, a] }), g("div", { className: "ff-popup-body", children: n }), A("div", { className: "ff-popup-footer", children: [s, o] })] }) });
}, wi = ({ placement: e, $close: t, $event: i, children: n, title: r, ...a }) => { }, wi = ({ placement: e, $close: t, $event: i, children: n, title: r, ...a }) => {
const [o, s] = F({}), [l, u] = F(!0), p = Y((h, b) => s((C) => ({ ...C, [h]: b })), []), d = Y((h) => s((b) => ({ ...b, [h]: void 0 })), []); const [o, s] = F({}), [l, d] = F(!0), p = Y((h, b) => s((C) => ({ ...C, [h]: b })), []), u = Y((h) => s((b) => ({ ...b, [h]: void 0 })), []);
let f = { ...a, className: o.rootClassName, title: o.title || r && k.createElement("div", { className: z("ff-popup-title") }, r), subTitle: o["sub-title"], actions: o.actions, extras: o.extras, children: n, $close: t, $event: i, onClose: () => u(!1) }; let f = { ...a, className: o.rootClassName, title: o.title || r && k.createElement("div", { className: z("ff-popup-title") }, r), subTitle: o["sub-title"], actions: o.actions, extras: o.extras, children: n, $close: t, $event: i, onClose: () => d(!1) };
const m = () => { const m = () => {
t(!1); t(!1);
}; };
return g(qe.Provider, { value: { ele: o, mount: p, unmount: d }, children: e && e !== "center" ? g(Mn, { ...f, placement: e, open: l, afterOpenChange: (h) => !h && m() }) : g(zn, { ...f, visible: l, afterClose: m }) }); return g(qe.Provider, { value: { ele: o, mount: p, unmount: u }, children: e && e !== "center" ? g(Mn, { ...f, placement: e, open: l, afterOpenChange: (h) => !h && m() }) : g(zn, { ...f, visible: l, afterClose: m }) });
}; };
wi.propTypes = { placement: w.oneOf(["center", "left", "top", "right", "bottom"]) }; wi.propTypes = { placement: w.oneOf(["center", "left", "top", "right", "bottom"]) };
const J = () => { const J = () => {
@ -860,14 +860,14 @@ const J = () => {
return { height: o }; return { height: o };
}, onLeaveActive: () => ({ height: 0, opacity: 0, margin: 0 }) }, prefixCls: "ff-notification" }), [, i] = k.useReducer((a) => a + 1, 0); }, onLeaveActive: () => ({ height: 0, opacity: 0, margin: 0 }) }, prefixCls: "ff-notification" }), [, i] = k.useReducer((a) => a + 1, 0);
j(() => { j(() => {
J.$onClick = n, J.$queue.forEach(([a, o, s], l, u) => { J.$onClick = n, J.$queue.forEach(([a, o, s], l, d) => {
r([o, s], ...a), delete u[l]; r([o, s], ...a), delete d[l];
}); });
}, []); }, []);
const n = (a, o = {}, s = {}) => new Promise((l, u) => r([l, u], a, o, s)), r = ([a, o], s, l = {}, u = {}) => { const n = (a, o = {}, s = {}) => new Promise((l, d) => r([l, d], a, o, s)), r = ([a, o], s, l = {}, d = {}) => {
const p = J.$index++, d = (f) => ((m, h) => (J.$popups.delete(m), i(), h == null ? void 0 : h()))(p, () => a(f)); const p = J.$index++, u = (f) => ((m, h) => (J.$popups.delete(m), i(), h == null ? void 0 : h()))(p, () => a(f));
if (s === ei) return e.open({ ...u, key: p, content: k.createElement(s, { ...l, $close: () => e.close(p) }) }); if (s === ei) return e.open({ ...d, key: p, content: k.createElement(s, { ...l, $close: () => e.close(p) }) });
J.$popups.set(p, k.createElement(wi, { zIndex: p, maskClosable: !1, $event: l == null ? void 0 : l.$event, ...u, key: p, $close: d }, k.isValidElement(s) ? k.cloneElement(s, { ...l, $close: d }) : s != null && s.name || jt.isForwardRef(s) || (s == null ? void 0 : s.$$typeof) === jt.ForwardRef ? k.createElement(s, { ...l, $close: d }) : s)), i(); J.$popups.set(p, k.createElement(wi, { zIndex: p, maskClosable: !1, $event: l == null ? void 0 : l.$event, ...d, key: p, $close: u }, k.isValidElement(s) ? k.cloneElement(s, { ...l, $close: u }) : s != null && s.name || jt.isForwardRef(s) || (s == null ? void 0 : s.$$typeof) === jt.ForwardRef ? k.createElement(s, { ...l, $close: u }) : s)), i();
}; };
return A(k.Fragment, { children: [Array.from(J.$popups).map(([a, o]) => o), t] }); return A(k.Fragment, { children: [Array.from(J.$popups).map(([a, o]) => o), t] });
}; };

2
dist/components.js vendored
View File

@ -1,4 +1,4 @@
import { ab as s, a2 as p, ac as d, ad as n, aa as t } from "./common/main--iillTPv.js"; import { ab as s, a2 as p, ac as d, ad as n, aa as t } from "./common/main-BpRlLf9Z.js";
export { export {
s as Empty, s as Empty,
p as Icon, p as Icon,

2
dist/container.js vendored
View File

@ -1,4 +1,4 @@
import { a7 as o, ab as s, ac as d, ad as p, a8 as t, aa as n, a9 as r, a6 as u } from "./common/main--iillTPv.js"; import { a7 as o, ab as s, ac as d, ad as p, a8 as t, aa as n, a9 as r, a6 as u } from "./common/main-BpRlLf9Z.js";
export { export {
o as Context, o as Context,
s as Empty, s as Empty,

View File

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

2
dist/data-list.js vendored
View File

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

View File

@ -1,5 +1,5 @@
import "lodash"; import "lodash";
import { j as a } from "../common/main--iillTPv.js"; import { j as a } from "../common/main-BpRlLf9Z.js";
export { export {
a as getDefaultExpandRowKeys a as getDefaultExpandRowKeys
}; };

View File

@ -1,4 +1,4 @@
import { V as s, X as r, W as u, U as o, $ as t, _ as d, a1 as m, Z as F, Y as i, a0 as g } from "./common/main--iillTPv.js"; import { V as s, X as r, W as u, U as o, $ as t, _ as d, a1 as m, Z as F, Y as i, a0 as g } from "./common/main-BpRlLf9Z.js";
export { export {
s as GridLayoutForm, s as GridLayoutForm,
r as GridLayoutFormHelper, r as GridLayoutFormHelper,

View File

@ -1,5 +1,5 @@
import "lodash"; import "lodash";
import { g as o, a as g } from "../common/main--iillTPv.js"; import { g as o, a as g } from "../common/main-BpRlLf9Z.js";
export { export {
o as getOptionItemByValue, o as getOptionItemByValue,
g as getWidgetByNormalize g as getWidgetByNormalize

2
dist/grid-layout.js vendored
View File

@ -1,4 +1,4 @@
import { k as d, l as e, H as i, G as t, m as u, n as o } from "./common/main--iillTPv.js"; import { k as d, l as e, H as i, G as t, m as u, n as o } from "./common/main-BpRlLf9Z.js";
export { export {
d as GridLayout, d as GridLayout,
e as GridLayoutWidget, e as GridLayoutWidget,

View File

@ -1,4 +1,4 @@
import { h as o, i as a } from "../common/main--iillTPv.js"; import { h as o, i as a } from "../common/main-BpRlLf9Z.js";
export { export {
o as getBoxStyle, o as getBoxStyle,
a as getWidgetByNormalize a as getWidgetByNormalize

2
dist/hooks.js vendored
View File

@ -1,7 +1,7 @@
import "lodash"; import "lodash";
import "rc-field-form"; import "rc-field-form";
import "react"; import "react";
import { Q as r, P as o, S as p, N as f, O as i, T as m, M as c } from "./common/main--iillTPv.js"; import { Q as r, P as o, S as p, N as f, O as i, T as m, M as c } from "./common/main-BpRlLf9Z.js";
import { default as S } from "rc-util/lib/hooks/useMergedState"; import { default as S } from "rc-util/lib/hooks/useMergedState";
export { export {
r as useDeepEffect, r as useDeepEffect,

2
dist/iconfont.js vendored
View File

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

2
dist/index.js vendored
View File

@ -1,4 +1,4 @@
import { am as t, an as e, ai as o, aj as n, ae as p, ak as r, ah as c, ag as f, af as l, al as i } from "./common/main--iillTPv.js"; import { am as t, an as e, ai as o, aj as n, ae as p, ak as r, ah as c, ag as f, af as l, al as i } from "./common/main-BpRlLf9Z.js";
export { export {
t as AppContext, t as AppContext,
e as AppGlobalParamsContext, e as AppGlobalParamsContext,

2
dist/res-ws.js vendored
View File

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

2
dist/utils.js vendored
View File

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

View File

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