This commit is contained in:
what 2025-11-06 19:36:39 +08:00
parent b6d75af36c
commit 51a58de735
18 changed files with 137 additions and 136 deletions

2
dist/button.js vendored
View File

@ -1,4 +1,4 @@
import { ah as s, ag as u, ai as e } from "./common/main-CVIH_kMK.js"; import { ah as s, ag as u, ai as e } from "./common/main-BjyTqb_P.js";
export { export {
s as auth, s as auth,
u as default, u as default,

View File

@ -264,10 +264,10 @@ const Z = S.createContext({ listCode: "", classNames: {}, getBase62params: (e, t
} }
return g("td", { className: e, ...a }); return g("td", { className: e, ...a });
}, ca = ({ record: e, column: t, $close: n, $setting: a }) => { }, ca = ({ record: e, column: t, $close: n, $setting: a }) => {
const i = q(sa(h.get(e, t == null ? void 0 : t.dataIndex))), { listCode: r, onClickCallback: o } = ae(Z), [s] = Q.useForm(), { formSetting: l, widgetSetting: p } = a, c = (l == null ? void 0 : l.primaryKey) || "id", d = () => { const i = q(sa(h.get(e, t == null ? void 0 : t.dataIndex))), { listCode: r, onClickCallback: o } = ae(Z), [s] = Q.useForm(), { formSetting: l, widgetSetting: p } = a, c = (l == null ? void 0 : l.primaryKey) || "id", u = () => {
s.setFieldsValue({ value: h.get(e, t == null ? void 0 : t.dataIndex), __PROPS__: e }); s.setFieldsValue({ value: h.get(e, t == null ? void 0 : t.dataIndex), __PROPS__: e });
}; };
return Ke(() => d(), [e, t == null ? void 0 : t.dataIndex, r]), g(H, { actions: E(S.Fragment, { children: [g(P, { size: "small", onClick: d, children: "重置" }), E(zn.Compact, { block: !0, children: [g(P, { size: "small", widget: n, children: "取消" }), g(P, { type: "primary", size: "small", widget: () => s.validateFields().then(({ value: f }) => { return Ke(() => u(), [e, t == null ? void 0 : t.dataIndex, r]), g(H, { actions: E(S.Fragment, { children: [g(P, { size: "small", onClick: u, children: "重置" }), E(zn.Compact, { block: !0, children: [g(P, { size: "small", widget: n, children: "取消" }), g(P, { type: "primary", size: "small", widget: () => s.validateFields().then(({ value: f }) => {
const m = h.get(e, c.substring(c.indexOf(".") + 1)); const m = h.get(e, c.substring(c.indexOf(".") + 1));
if (!m) throw "获取更新主键失败!"; if (!m) throw "获取更新主键失败!";
A.put(`/api/${r}-storeBy-${t == null ? void 0 : t.uuid}/${m}`, { value: f }).msg(() => o(2, e)).then(n); A.put(`/api/${r}-storeBy-${t == null ? void 0 : t.uuid}/${m}`, { value: f }).msg(() => o(2, e)).then(n);
@ -308,14 +308,14 @@ const Z = S.createContext({ listCode: "", classNames: {}, getBase62params: (e, t
}, pa = (e, t, n = "id", a = null) => { }, pa = (e, t, n = "id", a = null) => {
const i = ot(), r = q(!1), o = q(e.dataSource), s = q(e.itemOperationsAccess); const i = ot(), r = q(!1), o = q(e.dataSource), s = q(e.itemOperationsAccess);
return L(() => (o.current = e.dataSource, s.current = e.itemOperationsAccess, () => r.current = !1), [e.dataSource, e.itemOperationsAccess]), r.current && (e.dataSource = o.current, e.itemOperationsAccess = s.current), [e, (l = 0, p = null) => { return L(() => (o.current = e.dataSource, s.current = e.itemOperationsAccess, () => r.current = !1), [e.dataSource, e.itemOperationsAccess]), r.current && (e.dataSource = o.current, e.itemOperationsAccess = s.current), [e, (l = 0, p = null) => {
var c, d; var c, u;
if (r.current = !1, l === 1) return (c = e.onReload) == null ? void 0 : c.call(e); if (r.current = !1, l === 1) return (c = e.onReload) == null ? void 0 : c.call(e);
if (l === 2) { if (l === 2) {
const f = h.get(p, "__PARENT_ID__", ""), m = h.get(p, n, h.get(p, [a, n], "")), u = h.findIndex(o.current, ["__PARENT_ID__", f]), b = h.findIndex(u > -1 ? h.get(o.current, [u, "children"]) : o.current, [n, m]); const f = h.get(p, "__PARENT_ID__", ""), m = h.get(p, n, h.get(p, [a, n], "")), d = h.findIndex(o.current, ["__PARENT_ID__", f]), b = h.findIndex(d > -1 ? h.get(o.current, [d, "children"]) : o.current, [n, 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([A.get(`/api/${t}/detail/${m}`), A.post(`/api/${t}/list-operations-access`, { ids: m })]).then(([k, C]) => { Promise.all([A.get(`/api/${t}/detail/${m}`), A.post(`/api/${t}/list-operations-access`, { ids: m })]).then(([k, C]) => {
const x = h.get(o.current, u > -1 ? [u, "children", b, "children"] : [b, "children"]); const x = h.get(o.current, d > -1 ? [d, "children", b, "children"] : [b, "children"]);
o.current = en(o.current, u > -1 ? { [u]: { children: { $splice: [[b, 1, { ...k, children: x }]] } } } : { $splice: [[b, 1, { ...k, children: x }]] }); o.current = en(o.current, d > -1 ? { [d]: { children: { $splice: [[b, 1, { ...k, children: x }]] } } } : { $splice: [[b, 1, { ...k, children: x }]] });
const v = new Map(C); const v = new Map(C);
s.current.forEach((R, F) => { s.current.forEach((R, F) => {
var B; var B;
@ -330,8 +330,8 @@ const Z = S.createContext({ listCode: "", classNames: {}, getBase62params: (e, t
}]; }];
}, ma = (e, t) => { }, ma = (e, t) => {
const n = ot(), a = q(t), i = q(/* @__PURE__ */ new Map()), r = q([]), o = h.throttle((l) => { const n = ot(), a = q(t), i = q(/* @__PURE__ */ new Map()), r = q([]), o = h.throttle((l) => {
r.current = [], A.list(e, h.pick({ ...a.current, ...l }, ["tab", "page", "pageSize", "condition", "sider", "keyword"])).then(({ keyword: p, condition: c, total: d, tab: f, sider: m, page: u, pageSize: b, operationsAccess: k, dataSource: C }) => { r.current = [], A.list(e, h.pick({ ...a.current, ...l }, ["tab", "page", "pageSize", "condition", "sider", "keyword"])).then(({ keyword: p, condition: c, total: u, tab: f, sider: m, page: d, pageSize: b, operationsAccess: k, dataSource: C }) => {
a.current = { tab: f, condition: c, sider: m, keyword: p, total: d, pageSize: b, page: C != null && C.length ? u : 1 }, r.current = C, i.current = new Map(k), n(); a.current = { tab: f, condition: c, sider: m, keyword: p, total: u, pageSize: b, page: C != null && C.length ? d : 1 }, r.current = C, i.current = new Map(k), n();
}); });
}, 380, { leading: !1, trailing: !0 }); }, 380, { leading: !1, trailing: !0 });
Ke(() => { Ke(() => {
@ -339,37 +339,37 @@ const Z = S.createContext({ listCode: "", classNames: {}, getBase62params: (e, t
}, [e, t]); }, [e, t]);
const s = _(() => h.pick(a.current, ["total", "tab", "page", "pageSize", "condition", "sider", "keyword"]), [a.current]); const s = _(() => h.pick(a.current, ["total", "tab", "page", "pageSize", "condition", "sider", "keyword"]), [a.current]);
return Object.assign(s, { onTabChange: (l) => o({ tab: l, page: 1 }), onPageChange: (l, p) => o({ page: l, pageSize: p }), onPageSizeChange: (l) => o({ pageSize: l, page: 1 }), onConditionChange: (l, p) => o({ keyword: p, condition: en(a.current.condition || {}, { $merge: l || {} }), page: 1 }), onSiderChange: (l) => o({ sider: l, page: 1 }), onKeywordChange: (l) => o({ keyword: l, page: 1 }), itemOperationsAccess: i.current, dataSource: r.current, onReload: o, payload: t == null ? void 0 : t.payload }); return Object.assign(s, { onTabChange: (l) => o({ tab: l, page: 1 }), onPageChange: (l, p) => o({ page: l, pageSize: p }), onPageSizeChange: (l) => o({ pageSize: l, page: 1 }), onConditionChange: (l, p) => o({ keyword: p, condition: en(a.current.condition || {}, { $merge: l || {} }), page: 1 }), onSiderChange: (l) => o({ sider: l, page: 1 }), onKeywordChange: (l) => o({ keyword: l, page: 1 }), itemOperationsAccess: i.current, dataSource: r.current, onReload: o, payload: t == null ? void 0 : t.payload });
}, ha = ({ listCode: e, className: t, layouts: n = {}, dataSource: a, isPaginate: i, isItemOperations: r, isBatchOperations: o, batchOperations: s, itemOperations: l, itemOperationsAccess: p, resource: c, primaryKey: d, title: f, itemGridLayout: m, $setting: u, tabs: b, isConditionFormLayout: k, isTreeSider: C, treeSiderConfig: x }) => { }, ha = ({ listCode: e, className: t, layouts: n = {}, dataSource: a, isPaginate: i, isItemOperations: r, isBatchOperations: o, batchOperations: s, itemOperations: l, itemOperationsAccess: p, resource: c, primaryKey: u, title: f, itemGridLayout: m, $setting: d, tabs: b, isConditionFormLayout: k, isTreeSider: C, treeSiderConfig: x }) => {
const { classNames: v, onClickCallback: R } = ae(Z), F = h.pick(u, ["column", "colWidth", "beforeRender", "afterRender", "style"]), B = dn(l, p, d, c), M = J((I, T, z) => g(fa, { className: V("ff-data-list-framework-item", v.item), operations: r ? B(T) : [], data: c ? { [c]: T } : T, children: I, onClickCallback: R }), [c, d, r, R, l, p]); const { classNames: v, onClickCallback: R } = ae(Z), F = h.pick(d, ["column", "colWidth", "beforeRender", "afterRender", "style"]), B = dn(l, p, u, c), M = J((I, T, z) => g(fa, { className: V("ff-data-list-framework-item", v.item), operations: r ? B(T) : [], data: c ? { [c]: T } : T, children: I, onClickCallback: R }), [c, u, r, R, l, p]);
return E("div", { className: V("ff-data-list-framework", t), children: [g(n.sider, { isTreeSider: C, ...x }), E("div", { className: V("ff-data-list-container", v == null ? void 0 : v.container), children: [g(n.filter, { isConditionFormLayout: k }), g(n.toolbar, { title: f, tabs: b }), g(Fa, { ...F, ...m, primaryKey: d, itemRender: M, dataSource: a }), g(n.footer, { isPaginate: i, isOperations: o, operations: s })] })] }); return E("div", { className: V("ff-data-list-framework", t), children: [g(n.sider, { isTreeSider: C, ...x }), E("div", { className: V("ff-data-list-container", v == null ? void 0 : v.container), children: [g(n.filter, { isConditionFormLayout: k }), g(n.toolbar, { title: f, tabs: b }), g(Fa, { ...F, ...m, primaryKey: u, itemRender: M, dataSource: a }), g(n.footer, { isPaginate: i, isOperations: o, operations: s })] })] });
}, fa = ({ className: e, operations: t, children: n, data: a, onClickCallback: i }) => E("div", { className: V("data-list-grid-layout-item-container", e), children: [n, !!(t != null && t.length) && g("div", { className: "data-list-grid-layout-item-actions", children: t.map((r) => g("span", { className: "data-list-grid-layout-item-action", children: g(P.Link, { uuid: r.uuid, type: r.type, name: r.name, widget: r.widget, widgetType: r.widgetType, widgetProps: r.widgetProps, widgetSetting: r.widgetSetting, widgetContainerProps: r.widgetContainerSetting, data: a, confirm: r.confirm, onAfterClick: (o) => o !== !1 && (i == null ? void 0 : i(r.isRefresh, a)) }, r.uuid || ht()) }, (r == null ? void 0 : r.uuid) || ht())) })] }), ya = ({ listCode: e, className: t, layouts: n = {}, dataSource: a, columns: i, isItemOperations: r, isBatchOperations: o, batchOperations: s, itemOperations: l, itemOperationsAccess: p, resource: c, primaryKey: d, title: f, tabs: m, isPaginate: u, isTreeSider: b, treeSiderConfig: k, isConditionFormLayout: C, ...x }) => { }, fa = ({ className: e, operations: t, children: n, data: a, onClickCallback: i }) => E("div", { className: V("data-list-grid-layout-item-container", e), children: [n, !!(t != null && t.length) && g("div", { className: "data-list-grid-layout-item-actions", children: t.map((r) => g("span", { className: "data-list-grid-layout-item-action", children: g(P.Link, { uuid: r.uuid, type: r.type, name: r.name, widget: r.widget, widgetType: r.widgetType, widgetProps: r.widgetProps, widgetSetting: r.widgetSetting, widgetContainerProps: r.widgetContainerSetting, data: a, confirm: r.confirm, onAfterClick: (o) => o !== !1 && (i == null ? void 0 : i(r.isRefresh, a)) }, r.uuid || ht()) }, (r == null ? void 0 : r.uuid) || ht())) })] }), ya = ({ listCode: e, className: t, layouts: n = {}, dataSource: a, columns: i, isItemOperations: r, isBatchOperations: o, batchOperations: s, itemOperations: l, itemOperationsAccess: p, resource: c, primaryKey: u, title: f, tabs: m, isPaginate: d, isTreeSider: b, treeSiderConfig: k, isConditionFormLayout: C, ...x }) => {
const { classNames: v, onClickCallback: R } = ae(Z), F = dn(l, p, d, c), B = Ct(l, p, a, d, c); const { classNames: v, onClickCallback: R } = ae(Z), F = dn(l, p, u, c), B = Ct(l, p, a, u, c);
return E("div", { className: V("ff-data-table-framework", t), children: [g(n.sider, { isTreeSider: b, ...k }), E("div", { className: V("ff-data-table-container", v == null ? void 0 : v.container), children: [g(n.filter, { isConditionFormLayout: C }), g(n.toolbar, { title: f, tabs: m }), g(xa, { ...x, primaryKey: d, className: "ff-data-table-content", columns: i, dataSource: a, operationRender: B ? (M) => { return E("div", { className: V("ff-data-table-framework", t), children: [g(n.sider, { isTreeSider: b, ...k }), E("div", { className: V("ff-data-table-container", v == null ? void 0 : v.container), children: [g(n.filter, { isConditionFormLayout: C }), g(n.toolbar, { title: f, tabs: m }), g(xa, { ...x, primaryKey: u, className: "ff-data-table-content", columns: i, dataSource: a, operationRender: B ? (M) => {
var I; var I;
return g("div", { className: "ff-data-table-actions", children: (I = F(M)) == null ? void 0 : I.map((T, z) => g(P.Link, { size: "small", uuid: T.uuid, type: T.type, name: T.name, widget: T.widget, widgetType: T.widgetType, widgetProps: T.widgetProps, widgetData: T.widgetData, widgetSetting: T.widgetSetting, widgetContainerProps: T.widgetContainerSetting, data: M, confirm: T.confirm, onAfterClick: (N) => N !== !1 && (R == null ? void 0 : R(T.isRefresh, M)) }, T.uuid || z)) }); return g("div", { className: "ff-data-table-actions", children: (I = F(M)) == null ? void 0 : I.map((T, z) => g(P.Link, { size: "small", uuid: T.uuid, type: T.type, name: T.name, widget: T.widget, widgetType: T.widgetType, widgetProps: T.widgetProps, widgetData: T.widgetData, widgetSetting: T.widgetSetting, widgetContainerProps: T.widgetContainerSetting, data: M, confirm: T.confirm, onAfterClick: (N) => N !== !1 && (R == null ? void 0 : R(T.isRefresh, M)) }, T.uuid || z)) });
} : null }), g(n.footer, { isPaginate: u, isOperations: o, operations: s })] })] }); } : null }), g(n.footer, { isPaginate: d, isOperations: o, operations: s })] })] });
}, Ft = (e, t, n = null) => { }, Ft = (e, t, n = null) => {
var a; var a;
return (a = h.sortBy(e, ["y", "x"])) == null ? void 0 : a.map(({ i, x: r, y: o, w: s, h: l, field: { boxStyle: p, ...c } }, d) => g("div", { className: "grid-layout-item", style: un(r, o, s, l, p), children: g(t, { ...c, basicForm: n }) }, i ?? d)); return (a = h.sortBy(e, ["y", "x"])) == null ? void 0 : a.map(({ i, x: r, y: o, w: s, h: l, field: { boxStyle: p, ...c } }, u) => g("div", { className: "grid-layout-item", style: un(r, o, s, l, p), children: g(t, { ...c, basicForm: n }) }, i ?? u));
}, un = (e, t, n, a, i = {}, r = 0) => { }, un = (e, t, n, a, i = {}, r = 0) => {
const o = { "--grid-layout-h": `${a}`, "--grid-layout-w": `${n}`, "--grid-layout-x": `${e}`, "--grid-layout-y": `${t}`, "--grid-layout-row-height-offset": "0px" }; const o = { "--grid-layout-h": `${a}`, "--grid-layout-w": `${n}`, "--grid-layout-x": `${e}`, "--grid-layout-y": `${t}`, "--grid-layout-row-height-offset": "0px" };
return i != null && i.autoHeight ? o.height = "fit-content" : o["--grid-layout-row"] = `${a}`, i != null && i.alignItems && (o["--grid-layout-box-align-items"] = i.alignItems), i != null && i.justifyContent && (o["--grid-layout-box-justify-content"] = i.justifyContent), o["--grid-layout-box-margin"] = qt(i == null ? void 0 : i.marginTop, i == null ? void 0 : i.marginRight, i == null ? void 0 : i.marginBottom, i == null ? void 0 : i.marginLeft), o["--grid-layout-box-padding"] = qt(i == null ? void 0 : i.paddingTop, i == null ? void 0 : i.paddingRight, i == null ? void 0 : i.paddingBottom, i == null ? void 0 : i.paddingLeft), r && (o.height = `${r}px`), o; return i != null && i.autoHeight ? o.height = "fit-content" : o["--grid-layout-row"] = `${a}`, i != null && i.alignItems && (o["--grid-layout-box-align-items"] = i.alignItems), i != null && i.justifyContent && (o["--grid-layout-box-justify-content"] = i.justifyContent), o["--grid-layout-box-margin"] = qt(i == null ? void 0 : i.marginTop, i == null ? void 0 : i.marginRight, i == null ? void 0 : i.marginBottom, i == null ? void 0 : i.marginLeft), o["--grid-layout-box-padding"] = qt(i == null ? void 0 : i.paddingTop, i == null ? void 0 : i.paddingRight, i == null ? void 0 : i.paddingBottom, i == null ? void 0 : i.paddingLeft), r && (o.height = `${r}px`), o;
}, qt = (e, t, n, a) => `${e || 0}px ${t || 0}px ${n || 0}px ${a || 0}px`, Ri = (e = "Text", t = "@pkg/ff/grid-layouts") => e != null && e.startsWith("@") || e != null && e.startsWith("blob:") ? e : `${t}/${e}`, gn = ({ className: e, isConditionFormLayout: t }) => { }, qt = (e, t, n, a) => `${e || 0}px ${t || 0}px ${n || 0}px ${a || 0}px`, Ri = (e = "Text", t = "@pkg/ff/grid-layouts") => e != null && e.startsWith("@") || e != null && e.startsWith("blob:") ? e : `${t}/${e}`, gn = ({ className: e, isConditionFormLayout: t }) => {
var f, m; var f, m;
const [n, a] = O({}), { listCode: i, onKeywordChange: r, onConditionChange: o, getBase62params: s, classNames: l } = S.useContext(Z), { keyword: p, condition: c } = (s == null ? void 0 : s()) || {}, [d] = Qe.useForm(); const [n, a] = O({}), { listCode: i, onKeywordChange: r, onConditionChange: o, getBase62params: s, classNames: l } = S.useContext(Z), { keyword: p, condition: c } = (s == null ? void 0 : s()) || {}, [u] = Qe.useForm();
return L(() => { return L(() => {
i && t && A.get(`/api/_/${i}/list-condition-form-layout`).then(({ resource: u, marginX: b, marginY: k, rowHeight: C, cols: x, fields: v }) => { i && t && A.get(`/api/_/${i}/list-condition-form-layout`).then(({ resource: d, marginX: b, marginY: k, rowHeight: C, cols: x, fields: v }) => {
a({ resource: u, itemMargin: [b, k], rowHeight: C, cols: x, fields: v }); a({ resource: d, itemMargin: [b, k], rowHeight: C, cols: x, fields: v });
}).catch(() => a({})); }).catch(() => a({}));
}, [i, t]), L(() => { }, [i, t]), L(() => {
d.setFieldsValue({ keyword: p, ...c }); u.setFieldsValue({ keyword: p, ...c });
}, [JSON.stringify([p, c])]), g("div", { className: V("ff-data-list-filter", l.filter, e), children: g(Qe, { form: d, layout: "vertical", autoComplete: "off", onFinish: ((f = n.fields) == null ? void 0 : f.length) > 1 ? (u) => o({ [n.resource]: u[n.resource] }, u.keyword) : () => { }, [JSON.stringify([p, c])]), g("div", { className: V("ff-data-list-filter", l.filter, e), children: g(Qe, { form: u, layout: "vertical", autoComplete: "off", onFinish: ((f = n.fields) == null ? void 0 : f.length) > 1 ? (d) => o({ [n.resource]: d[n.resource] }, d.keyword) : () => {
}, onValuesChange: (u) => { }, onValuesChange: (d) => {
h.isEmpty(h.omit(u, ["keyword"])) || d.submit(); h.isEmpty(h.omit(d, ["keyword"])) || u.submit();
}, children: ((m = n.fields) == null ? void 0 : m.length) > 1 ? g(jt, { ...n, children: g(wa, { onReset: () => { }, children: ((m = n.fields) == null ? void 0 : m.length) > 1 ? g(jt, { ...n, children: g(wa, { onReset: () => {
const { keyword: u, condition: b } = s("init") || {}; const { keyword: d, condition: b } = s("init") || {};
d.setFieldsValue({ keyword: u, ...b }); u.setFieldsValue({ keyword: d, ...b });
} }) }) : g("div", { className: "ff-data-list-filter-default-form ff-grid-layout-form", children: g("div", { className: "grid-layout-item", style: un(20, 0, 5, 2), children: g(Qe.Item, { name: ["keyword"], children: g(Bn.Search, { allowClear: !0, enterButton: "搜索", placeholder: "多关键字 | 分割", onSearch: (u) => r(u) }) }) }) }) }) }); } }) }) : g("div", { className: "ff-data-list-filter-default-form ff-grid-layout-form", children: g("div", { className: "grid-layout-item", style: un(20, 0, 5, 2), children: g(Qe.Item, { name: ["keyword"], children: g(Bn.Search, { allowClear: !0, enterButton: "搜索", placeholder: "多关键字 | 分割", onSearch: (d) => r(d) }) }) }) }) }) });
}, wa = ({ cols: e, fields: t, onReset: n }) => { }, wa = ({ cols: e, fields: t, onReset: n }) => {
const [a, i] = O(!1), r = _(() => t == null ? void 0 : t.toReversed().some((o) => o.y > 1 || o.x + o.w >= e - 5), [e, t]); const [a, i] = O(!1), r = _(() => t == null ? void 0 : t.toReversed().some((o) => o.y > 1 || o.x + o.w >= e - 5), [e, t]);
return E(Qe.Item, { label: " ", style: { "--item-span": 5 }, className: V("ff-data-list-filter-actions", { expanded: a }), children: [g(et, { onClick: n, children: "重置" }), g(et, { type: "primary", htmlType: "submit", children: "查询" }), r && g(P.Link, { className: "ff-data-list-filter-expanded-button", widget: () => i((o) => !o), type: "primary", name: a ? "关闭" : "展开", icon: a ? "icon-up" : "icon-down", iconPosition: "end" })] }); return E(Qe.Item, { label: " ", style: { "--item-span": 5 }, className: V("ff-data-list-filter-actions", { expanded: a }), children: [g(et, { onClick: n, children: "重置" }), g(et, { type: "primary", htmlType: "submit", children: "查询" }), r && g(P.Link, { className: "ff-data-list-filter-expanded-button", widget: () => i((o) => !o), type: "primary", name: a ? "关闭" : "展开", icon: a ? "icon-up" : "icon-down", iconPosition: "end" })] });
@ -377,18 +377,18 @@ const Z = S.createContext({ listCode: "", classNames: {}, getBase62params: (e, t
gn.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" } } }]; gn.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 ba = ({ className: e, operations: t, isOperations: n, isPaginate: a }) => { const ba = ({ className: e, operations: t, isOperations: n, isPaginate: a }) => {
const { onPageChange: i, onPageSizeChange: r, onClickCallback: o, getBase62params: s } = S.useContext(Z), { total: l, page: p, pageSize: c } = (s == null ? void 0 : s()) || {}; const { onPageChange: i, onPageSizeChange: r, onClickCallback: o, getBase62params: s } = S.useContext(Z), { total: l, page: p, pageSize: c } = (s == null ? void 0 : s()) || {};
return n && !h.isEmpty(t) || a ? E("div", { className: V("ff-data-list-footer", e), children: [g("div", { className: "ff-data-list-actions", children: t == null ? void 0 : t.map((d, f) => g(P, { 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)) }), a && g(Dn, { size: "small", total: l, pageSize: c, showSizeChanger: !1, showTotal: (d) => `${p} 页 / 总共 ${d}`, onChange: i, onShowSizeChange: r })] }) : null; return n && !h.isEmpty(t) || a ? E("div", { className: V("ff-data-list-footer", e), children: [g("div", { className: "ff-data-list-actions", children: t == null ? void 0 : t.map((u, f) => g(P, { 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)) }), a && g(Dn, { size: "small", total: l, pageSize: c, showSizeChanger: !1, showTotal: (u) => `${p} 页 / 总共 ${u}`, onChange: i, onShowSizeChange: r })] }) : null;
}, Ca = [{ 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" }] }] }], ka = ({ className: e, width: t = 280, isTreeSider: n }) => { }, Ca = [{ 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" }] }] }], ka = ({ className: e, width: t = 280, isTreeSider: n }) => {
const { classNames: a } = ae(Z); const { classNames: a } = ae(Z);
return n ? g(Un.DirectoryTree, { className: V("ff-data-list-sider", a.sider, e), style: { "--sider-width": t }, showLine: !0, showIcon: !1, treeData: Ca }) : null; return n ? g(Un.DirectoryTree, { className: V("ff-data-list-sider", a.sider, e), style: { "--sider-width": t }, showLine: !0, showIcon: !1, treeData: Ca }) : null;
}, Sa = ({ className: e, title: t, tabs: n }) => { }, Sa = ({ className: e, title: t, tabs: n }) => {
const { getBase62params: a, onTabChange: i, onReload: r, classNames: o } = ae(Z), { tab: s } = (a == null ? void 0 : a()) || {}, [l, p] = Gn((n == null ? void 0 : n[0].value) ?? (n == null ? void 0 : n[0].code), { value: s, onChange: i }); const { getBase62params: a, onTabChange: i, onReload: r, classNames: o } = ae(Z), { tab: s } = (a == null ? void 0 : a()) || {}, [l, p] = Gn((n == null ? void 0 : n[0].value) ?? (n == null ? void 0 : n[0].code), { value: s, onChange: i });
return E("div", { className: V("ff-data-list-toolbar", o.toolbar, e), children: [g("div", { className: "ff-data-list-title", children: t }), g(_n, { className: "ff-data-list-tabs", itemRender: ({ label: c, code: d, value: f }) => g("span", { onClick: () => p(f ?? d), className: V("ff-data-list-tab", { active: (f ?? d) == l }), children: c }), items: n }), E("div", { className: "ff-data-list-actions", children: [g(P.Link, { icon: "icon-reload", widget: () => r() }), g(P.Link, { icon: "icon-setting" })] })] }); return E("div", { className: V("ff-data-list-toolbar", o.toolbar, e), children: [g("div", { className: "ff-data-list-title", children: t }), g(_n, { className: "ff-data-list-tabs", itemRender: ({ label: c, code: u, value: f }) => g("span", { onClick: () => p(f ?? u), className: V("ff-data-list-tab", { active: (f ?? u) == l }), children: c }), items: n }), E("div", { className: "ff-data-list-actions", children: [g(P.Link, { icon: "icon-reload", widget: () => r() }), g(P.Link, { icon: "icon-setting" })] })] });
}, pn = ({ isItemGridLayout: e, theme: t, themeProps: n, onClickCallback: a, onReload: i, listCode: r, total: o = 0, page: s = 0, onPageChange: l, pageSize: p = 30, onPageSizeChange: c, tab: d, onTabChange: f, keyword: m, onKeywordChange: u, condition: b, onConditionChange: k, sider: C, onSiderChange: x, layouts: v, classNames: R = {}, payload: F = {}, ...B }) => { }, pn = ({ isItemGridLayout: e, theme: t, themeProps: n, onClickCallback: a, onReload: i, listCode: r, total: o = 0, page: s = 0, onPageChange: l, pageSize: p = 30, onPageSizeChange: c, tab: u, onTabChange: f, keyword: m, onKeywordChange: d, condition: b, onConditionChange: k, sider: C, onSiderChange: x, layouts: v, classNames: R = {}, payload: F = {}, ...B }) => {
const [M, I] = O(), T = J((N, K) => { const [M, I] = O(), T = J((N, K) => {
const D = { tab: d, page: s, pageSize: p, keyword: m, sider: C, condition: b, total: o, payload: F }; const D = { tab: u, page: s, pageSize: p, keyword: m, sider: C, condition: b, total: o, payload: F };
return N && N != "init" ? h.get(D, N, K) : D; return N && N != "init" ? h.get(D, N, K) : D;
}, [JSON.stringify(b), JSON.stringify(F), d, s, p, m, C, o]), z = _(() => { }, [JSON.stringify(b), JSON.stringify(F), u, s, p, m, C, o]), z = _(() => {
let N = { sider: ka, filter: gn, footer: ba, toolbar: Sa }; let N = { sider: ka, filter: gn, footer: ba, toolbar: Sa };
v === !1 ? N = { sider: null, filter: null, footer: null, toolbar: null } : h.isPlainObject(v) && (N = Object.assign({}, N, v)); v === !1 ? N = { sider: null, filter: null, footer: null, toolbar: null } : h.isPlainObject(v) && (N = Object.assign({}, N, v));
for (const K in N) if (N[K]) { for (const K in N) if (N[K]) {
@ -404,7 +404,7 @@ const ba = ({ className: e, operations: t, isOperations: n, isPaginate: a }) =>
if (!N) throw `${t} not found`; if (!N) throw `${t} not found`;
return N; return N;
}).catch((N) => ({ default: () => `${N}` })).then((N) => I(S.createElement(N.default, { ...B, layouts: z, $setting: n }))) : I(g(e ? ha : ya, { ...B, layouts: z, $setting: n })); }).catch((N) => ({ default: () => `${N}` })).then((N) => I(S.createElement(N.default, { ...B, layouts: z, $setting: n }))) : I(g(e ? ha : ya, { ...B, layouts: z, $setting: n }));
}, [t, n]), g(Z.Provider, { value: { classNames: R, listCode: r, onClickCallback: a, onReload: i, getBase62params: T, onPageChange: l, onPageSizeChange: c, onTabChange: f, onSiderChange: x, onKeywordChange: u, onConditionChange: k, setPage: l, setPageSize: c, setTab: f, setSider: x, setKeyword: u, setCondition: k }, children: M && S.cloneElement(M, B) }); }, [t, n]), g(Z.Provider, { value: { classNames: R, listCode: r, onClickCallback: a, onReload: i, getBase62params: T, onPageChange: l, onPageSizeChange: c, onTabChange: f, onSiderChange: x, onKeywordChange: d, onConditionChange: k, setPage: l, setPageSize: c, setTab: f, setSider: x, setKeyword: d, setCondition: k }, children: M && S.cloneElement(M, B) });
}; };
pn.propTypes = { classNames: w.exact({ sider: w.string, filter: w.string, footer: w.string, toolbar: w.string, container: w.string, content: w.string, item: w.string }), layouts: w.oneOfType([w.exact({ sider: w.oneOfType([w.elementType, w.element]), filter: w.oneOfType([w.elementType, w.element]), footer: w.oneOfType([w.elementType, w.element]), toolbar: w.oneOfType([w.elementType, w.element]) }), w.bool]) }; pn.propTypes = { classNames: w.exact({ sider: w.string, filter: w.string, footer: w.string, toolbar: w.string, container: w.string, content: w.string, item: w.string }), layouts: w.oneOfType([w.exact({ sider: w.oneOfType([w.elementType, w.element]), filter: w.oneOfType([w.elementType, w.element]), footer: w.oneOfType([w.elementType, w.element]), toolbar: w.oneOfType([w.elementType, w.element]) }), w.bool]) };
var he, ue, Pe, rt; var he, ue, Pe, rt;
@ -432,93 +432,93 @@ const se = class se {
he = new WeakMap(), ue = new WeakMap(), Pe = new WeakMap(), rt = new WeakMap(), j(se, he, null), $(se, "getInstance", () => (y(se, he) || W(se, he, new se()), y(se, he))); he = new WeakMap(), ue = new WeakMap(), Pe = new WeakMap(), rt = new WeakMap(), j(se, he, null), $(se, "getInstance", () => (y(se, he) || W(se, he, new se()), y(se, he)));
let kt = se; let kt = se;
const mn = kt.getInstance(), Rt = S.forwardRef(({ listCode: e, base62params: t, className: n, theme: a, themeProps: i, layouts: r, classNames: o }, s) => { const mn = kt.getInstance(), Rt = S.forwardRef(({ listCode: e, base62params: t, className: n, theme: a, themeProps: i, layouts: r, classNames: o }, s) => {
const [{ resource: l, primaryKey: p, batchOperations: c = [], itemOperations: d = [], columns: f = [], themeConfig: m, theme: u, isConditionFormLayout: b = !1, isTreeSider: k, treeSiderConfig: C, isItemGridLayout: x, itemGridLayout: v, title: R, isPaginate: F, tabs: B }, M] = O({ isItemGridLayout: !1, itemGridLayout: {} }), I = ma(e, t), [{ dataSource: T, itemOperationsAccess: z, condition: N, tab: K, keyword: D, page: ge, total: Je, pageSize: Ge, sider: ct, onConditionChange: X, onTabChange: xn, onKeywordChange: vn, onPageChange: Pn, onPageSizeChange: Tn, onSiderChange: $n, onReload: dt, payload: Nn }, Vt] = pa(I, e, p, l), Fn = Ct(d, z, T, p), Rn = Ct(c); const [{ resource: l, primaryKey: p, batchOperations: c = [], itemOperations: u = [], columns: f = [], themeConfig: m, theme: d, isConditionFormLayout: b = !1, isTreeSider: k, treeSiderConfig: C, isItemGridLayout: x, itemGridLayout: v, title: R, isPaginate: F, tabs: B }, M] = O({ isItemGridLayout: !1, itemGridLayout: {} }), I = ma(e, t), [{ dataSource: T, itemOperationsAccess: z, condition: N, tab: K, keyword: D, page: ge, total: Je, pageSize: Ge, sider: ct, onConditionChange: X, onTabChange: xn, onKeywordChange: vn, onPageChange: Pn, onPageSizeChange: Tn, onSiderChange: $n, onReload: dt, payload: Nn }, Vt] = pa(I, e, p, l), Fn = Ct(u, z, T, p), Rn = Ct(c);
L(() => { L(() => {
let ee = null; let ee = null;
return e && A.get(`/api/_/${e}`).resp(({ data: Ye, res: On }) => { return e && A.get(`/api/_/${e}`).resp(({ data: Ye, res: On }) => {
Ye != null && Ye.isDynamicRefresh && (ee = mn.subscribe(() => dt(), On)), M(Ye); Ye != null && Ye.isDynamicRefresh && (ee = mn.subscribe(() => dt(), On)), M(Ye);
}).catch(() => M({})), () => ee == null ? void 0 : ee(); }).catch(() => M({})), () => ee == null ? void 0 : ee();
}, [e]), S.useImperativeHandle(s, () => ({ onReload: dt, onClickCallback: Vt })); }, [e]), S.useImperativeHandle(s, () => ({ onReload: dt, onClickCallback: Vt }));
const En = { listCode: e, title: R, classNames: o, layouts: r, resource: l, primaryKey: p, theme: a || u, themeProps: i || m, isTreeSider: k, treeSiderConfig: C, isPaginate: F, tabs: B, isItemOperations: Fn, itemOperations: d == null ? void 0 : d.map((ee) => h.isEmpty(ee == null ? void 0 : ee.confirm) ? ee : { ...ee, confirm: Object.assign({}, ee.confirm, { getPopupContainer: () => document.body }) }), isBatchOperations: Rn, batchOperations: c, isItemGridLayout: x, columns: f, itemGridLayout: v, isConditionFormLayout: b, itemOperationsAccess: z, dataSource: T, onConditionChange: X, onTabChange: xn, onKeywordChange: vn, onPageChange: Pn, onPageSizeChange: Tn, onSiderChange: $n, condition: N, tab: K, keyword: D, page: ge, total: Je, pageSize: Ge, sider: ct, payload: Nn }; const En = { listCode: e, title: R, classNames: o, layouts: r, resource: l, primaryKey: p, theme: a || d, themeProps: i || m, isTreeSider: k, treeSiderConfig: C, isPaginate: F, tabs: B, isItemOperations: Fn, itemOperations: u == null ? void 0 : u.map((ee) => h.isEmpty(ee == null ? void 0 : ee.confirm) ? ee : { ...ee, confirm: Object.assign({}, ee.confirm, { getPopupContainer: () => document.body }) }), isBatchOperations: Rn, batchOperations: c, isItemGridLayout: x, columns: f, itemGridLayout: v, isConditionFormLayout: b, itemOperationsAccess: z, dataSource: T, onConditionChange: X, onTabChange: xn, onKeywordChange: vn, onPageChange: Pn, onPageSizeChange: Tn, onSiderChange: $n, condition: N, tab: K, keyword: D, page: ge, total: Je, pageSize: Ge, sider: ct, payload: Nn };
return g(pn, { ...En, className: V("ff-data-list-helper", n), onReload: dt, onClickCallback: Vt }); return g(pn, { ...En, className: V("ff-data-list-helper", n), onReload: dt, onClickCallback: Vt });
}), hn = (e, t, n = !0) => n !== !0 && n-- <= 0 ? [] : h.isArray(e) && !h.isEmpty(e) ? e.reduce((a, i) => (Reflect.has(i, t) && Reflect.has(i, "children") && a.push(i[t]), Reflect.has(i, "children") && !h.isEmpty(i.children) ? a.concat(hn(i.children, t, n)) : a), []) : [], xa = ({ className: e, primaryKey: t, columns: n = [], dataSource: a = [], operationRender: i, operationWidth: r = 180, components: o = {}, ...s }) => { }), hn = (e, t, n = !0) => n !== !0 && n-- <= 0 ? [] : h.isArray(e) && !h.isEmpty(e) ? e.reduce((a, i) => (Reflect.has(i, t) && Reflect.has(i, "children") && a.push(i[t]), Reflect.has(i, "children") && !h.isEmpty(i.children) ? a.concat(hn(i.children, t, n)) : a), []) : [], xa = ({ className: e, primaryKey: t, columns: n = [], dataSource: a = [], operationRender: i, operationWidth: r = 180, components: o = {}, ...s }) => {
const { classNames: l } = ae(Z), p = q(null), c = q(null), [d, f] = O([]), [m, u] = O({ width: 0, height: 0 }); const { classNames: l } = ae(Z), p = q(null), c = q(null), [u, f] = O([]), [m, d] = O({ width: 0, height: 0 });
L(() => { L(() => {
f(hn(a, t)); f(hn(a, t));
}, [a, t]), Vn(() => { }, [a, t]), Vn(() => {
const C = new ResizeObserver(() => { const C = new ResizeObserver(() => {
var x; var x;
u({ width: ((x = p.current) == null ? void 0 : x.nativeElement.querySelector(".ant-table-body").scrollWidth) || c.current.offsetWidth, height: c.current.offsetHeight }); d({ width: ((x = p.current) == null ? void 0 : x.nativeElement.querySelector(".ant-table-body").scrollWidth) || c.current.offsetWidth, height: c.current.offsetHeight });
}); });
return c.current && C.observe(c.current), () => { return c.current && C.observe(c.current), () => {
c.current && C.unobserve(c.current); c.current && C.unobserve(c.current);
}; };
}, []); }, []);
const b = ua(n), k = ga(o); const b = ua(n), k = ga(o);
return g("div", { ref: c, className: V("ff-data-list-table", l.content, e), children: m.height ? g(qn, { bordered: !0, ...s, components: k, ref: p, rowKey: (C) => (C == null ? void 0 : C[t]) ?? Math.random(), columns: b == null ? void 0 : b.concat(i ? [{ title: "操作", align: "center", fixed: "right", width: `${Math.ceil(r / m.width * 100).toFixed(2)}%`, render: (C, x, v) => i(x, v) }] : []), dataSource: a, size: "middle", scroll: { x: "max-content", y: m.height - 50 }, pagination: !1, expandable: { defaultExpandAllRows: !0, expandRowByClick: !0, onExpandedRowsChange: f, expandedRowKeys: d } }) : null }); return g("div", { ref: c, className: V("ff-data-list-table", l.content, e), children: m.height ? g(qn, { bordered: !0, ...s, components: k, ref: p, rowKey: (C) => (C == null ? void 0 : C[t]) ?? Math.random(), columns: b == null ? void 0 : b.concat(i ? [{ title: "操作", align: "center", fixed: "right", width: `${Math.ceil(r / m.width * 100).toFixed(2)}%`, render: (C, x, v) => i(x, v) }] : []), dataSource: a, size: "middle", scroll: { x: "max-content", y: m.height - 50 }, pagination: !1, expandable: { defaultExpandAllRows: !0, expandRowByClick: !0, onExpandedRowsChange: f, expandedRowKeys: u } }) : null });
}, va = "RC_FORM_INTERNAL_HOOKS", Pa = (e) => { }, va = "RC_FORM_INTERNAL_HOOKS", Pa = (e) => {
const [t, n] = S.useState({ items: [] }); const [t, n] = S.useState({ items: [] });
return L(() => { return L(() => {
e && A.get(`/api/_/${e}`).then(({ uuid: a, code: i, name: r, resource: o, primaryKey: s, marginX: l, marginY: p, cols: c, rowHeight: d, fields: f, theme: m, themeSetting: u }) => ({ uuid: a, code: i, name: r, resource: o, primaryKey: s, marginX: l, marginY: p, cols: c, rowHeight: d, theme: m, themeProps: u, items: f })).then(n); e && A.get(`/api/_/${e}`).then(({ uuid: a, code: i, name: r, resource: o, primaryKey: s, marginX: l, marginY: p, cols: c, rowHeight: u, fields: f, theme: m, themeSetting: d }) => ({ uuid: a, code: i, name: r, resource: o, primaryKey: s, marginX: l, marginY: p, cols: c, rowHeight: u, theme: m, themeProps: d, items: f })).then(n);
}, [e]), t; }, [e]), t;
}, Ta = (e, { initialValue: t, initialValueLanguage: n, convertJs: a, convertJsSetting: i, type: r = "string" }, o = null) => { }, Ta = (e, { initialValue: t, initialValueLanguage: n, convertJs: a, convertJsSetting: i, type: r = "string" }, o = null) => {
const s = q(!1), l = ae(Zt), [p, c] = O(), [d, f] = O(n != "javascript" && e ? l.getFieldValue(e) : void 0), { registerWatch: m } = l.getInternalHooks(va) || {}; const s = q(!1), l = ae(Zt), [p, c] = O(), [u, f] = O(n != "javascript" && e ? l.getFieldValue(e) : void 0), { registerWatch: m } = l.getInternalHooks(va) || {};
return L(() => m == null ? void 0 : m((u, b, k) => { return L(() => m == null ? void 0 : m((d, b, k) => {
if (!s.current) return; if (!s.current) return;
const C = h.get(b, e); const C = h.get(b, e);
h.isEqual(C, d) || f(ce(C, r)); h.isEqual(C, u) || f(ce(C, r));
}), [d]), L(() => { }), [u]), L(() => {
n == "javascript" && t ? Se.exec(t, {}, { getFieldValueForBasicForm: (u) => o ? o.getFieldValue(u) : l.getFieldValue(u), getFieldValue: (u) => l.getFieldValue(u) }).then((u) => f(ce(u, r))).catch((u) => notification.error({ message: `布局数据错误: ${JSON.stringify(u)}` })).finally(() => s.current = !0) : (t && f(ce(t ?? l.getFieldValue(e), r)), s.current = !0); n == "javascript" && t ? Se.exec(t, {}, { getFieldValueForBasicForm: (d) => o ? o.getFieldValue(d) : l.getFieldValue(d), getFieldValue: (d) => l.getFieldValue(d) }).then((d) => f(ce(d, r))).catch((d) => notification.error({ message: `布局数据错误: ${JSON.stringify(d)}` })).finally(() => s.current = !0) : (t && f(ce(t ?? l.getFieldValue(e), r)), s.current = !0);
}, [t, n]), We(() => { }, [t, n]), We(() => {
s.current && a && new tt([a, i]).toValue(d, l.getFieldsValue(!0)).then(c).catch((u) => { s.current && a && new tt([a, i]).toValue(u, l.getFieldsValue(!0)).then(c).catch((d) => {
c(u), console.error("布局数据转换错误: ", u, a); c(d), console.error("布局数据转换错误: ", d, a);
}); });
}, [d, a, i]), [p ?? d, d]; }, [u, a, i]), [p ?? u, u];
}, Ei = (e, t, n = null) => _(() => Ft(e, t, n), [e]), Et = (e, t, n = {}, a = {}, i = {}) => { }, Ei = (e, t, n = null) => _(() => Ft(e, t, n), [e]), Et = (e, t, n = {}, a = {}, i = {}) => {
const r = ae(Zt), o = ot(), s = q(!0), l = q([]), [p, c] = O(t), [d, f] = O(), m = Q.useWatch((u) => JSON.stringify(h.pick(u, l.current)), r) || "{}"; const r = ae(Zt), o = ot(), s = q(!0), l = q([]), [p, c] = O(t), [u, f] = O(), m = Q.useWatch((d) => JSON.stringify(h.pick(d, l.current)), r) || "{}";
return Ke(() => { return Ke(() => {
e && Se.exec(e, n, { ...a, getFieldValueForBasicForm: (u) => i ? i.getFieldValue(u) : null, getFieldValue: h.wrap(r.getFieldValue, (u, b) => (l.current.some((k) => h.isEqual(k, b)) || (l.current.push(b), o()), u == null ? void 0 : u(b))), isFieldTouched: r.isFieldTouched, isFieldsTouched: r.isFieldsTouched }).then((u) => { e && Se.exec(e, n, { ...a, getFieldValueForBasicForm: (d) => i ? i.getFieldValue(d) : null, getFieldValue: h.wrap(r.getFieldValue, (d, b) => (l.current.some((k) => h.isEqual(k, b)) || (l.current.push(b), o()), d == null ? void 0 : d(b))), isFieldTouched: r.isFieldTouched, isFieldsTouched: r.isFieldsTouched }).then((d) => {
s.current && (c(u), f(null)); s.current && (c(d), f(null));
}).catch((u) => { }).catch((d) => {
s.current && (c(t), f(u)); s.current && (c(t), f(d));
}); });
}, [e, m, r, n, a]), L(() => () => s.current = !1, []), e ? [p, d] : [t, null]; }, [e, m, r, n, a]), L(() => () => s.current = !1, []), e ? [p, u] : [t, null];
}, $a = ({ widget: e, widgetPrefix: t = "@pkg/ff/grid-layouts", basicForm: n, ...a }) => { }, $a = ({ widget: e, widgetPrefix: t = "@pkg/ff/grid-layouts", basicForm: n, ...a }) => {
const i = e != null && e.startsWith("@") || e != null && e.startsWith("blob:") ? e : `${t}/${e}`, [r, o] = O(); const i = e != null && e.startsWith("@") || e != null && e.startsWith("blob:") ? e : `${t}/${e}`, [r, o] = O();
return L(() => { return L(() => {
i && ne.getWidgetComponent(i).then(({ defaultProps: s = {}, default: l }) => ({ default: Na(l, s, n) })).catch((s) => ({ default: () => `${s}` })).then((s) => o(S.createElement(s.default, a))); i && ne.getWidgetComponent(i).then(({ defaultProps: s = {}, default: l }) => ({ default: Na(l, s, n) })).catch((s) => ({ default: () => `${s}` })).then((s) => o(S.createElement(s.default, a)));
}, [i]), r; }, [i]), r;
}, Na = (e, t = {}, n = null) => (a) => { }, Na = (e, t = {}, n = null) => (a) => {
const { code: i, label: r, extras: o, isVirtual: s, initialValue: l, initialValueLanguage: p, convertJs: c, convertJsSetting: d, value: f, ...m } = h.merge({}, t, a), [u, b] = Ta(s ? null : i, { initialValue: l, initialValueLanguage: p, convertJs: c, convertJsSetting: d, type: (m == null ? void 0 : m.type) || "string" }, n), k = _(() => { const { code: i, label: r, extras: o, isVirtual: s, initialValue: l, initialValueLanguage: p, convertJs: c, convertJsSetting: u, value: f, ...m } = h.merge({}, t, a), [d, b] = Ta(s ? null : i, { initialValue: l, initialValueLanguage: p, convertJs: c, convertJsSetting: u, type: (m == null ? void 0 : m.type) || "string" }, n), k = _(() => {
const v = Object.keys((t == null ? void 0 : t.extras) || {}); const v = Object.keys((t == null ? void 0 : t.extras) || {});
return h.over([h.partialRight(h.pick, v), h.partialRight(h.omit, v)]); return h.over([h.partialRight(h.pick, v), h.partialRight(h.omit, v)]);
}, [t == null ? void 0 : t.extras]), [C, x] = k(m); }, [t == null ? void 0 : t.extras]), [C, x] = k(m);
return g(e, { ...x, value: u, rawValue: b, $setting: Object.assign({}, o, C) }); return g(e, { ...x, value: d, rawValue: b, $setting: Object.assign({}, o, C) });
}, fn = ({ theme: e, basicForm: t, items: n = [{ key: "default", label: "默认" }], fields: a = [], itemRender: i, activeKeyFunc: r = "", chunks: o = [], widgetSetting: s = {}, children: l }) => { }, fn = ({ theme: e, basicForm: t, items: n = [{ key: "default", label: "默认" }], fields: a = [], itemRender: i, activeKeyFunc: r = "", chunks: o = [], widgetSetting: s = {}, children: l }) => {
const [p, c] = O(); const [p, c] = O();
L(() => { L(() => {
e ? ne.getWidgetComponent(e).then((u) => { e ? ne.getWidgetComponent(e).then((d) => {
if (!(u != null && u.default)) throw "not found"; if (!(d != null && d.default)) throw "not found";
return u; return d;
}).catch((u) => ({ default: () => `${e} ${u}` })).then((u) => c(S.createElement(u.default, {}))) : c(null); }).catch((d) => ({ default: () => `${e} ${d}` })).then((d) => c(S.createElement(d.default, {}))) : c(null);
}, [e]); }, [e]);
const d = _(() => n == null ? void 0 : n.map((u) => ({ ...u, children: i(a == null ? void 0 : a.filter((b) => !(b != null && b.group) && u.key == "default" || b.group == u.key), u.key == "default" ? l : null) })).concat(o), [n, l, o]), [f, m] = Et(r, d == null ? void 0 : d.map((u) => u.key), {}, {}, t); const u = _(() => n == null ? void 0 : n.map((d) => ({ ...d, children: i(d, a == null ? void 0 : a.filter((b) => !(b != null && b.group) && d.key == "default" || b.group == d.key), d.key == "default" ? l : null) })).concat(o), [n, l, o]), [f, m] = Et(r, u == null ? void 0 : u.map((d) => d.key), {}, {}, t);
return m && console.log(e, "activeKeyFunc", m), p && S.cloneElement(p, { activeKey: ce(f, "array"), items: d, $setting: s }); return m && console.log(e, "activeKeyFunc", m), p && S.cloneElement(p, { activeKey: ce(f, "array"), items: u, $setting: s });
}, yn = ({ name: e, form: t = null, basicForm: n = null, style: a = {}, className: i, cols: r = 12, rowHeight: o = 21, containerPadding: s = [0, 0], itemMargin: l = [4, 0], formProps: p = {}, formFields: c = [], fields: d = [], data: f, theme: m, themeProps: u = {}, children: b, ...k }) => { }, yn = ({ name: e, form: t = null, basicForm: n = null, style: a = {}, className: i, cols: r = 12, rowHeight: o = 21, containerPadding: s = [0, 0], itemMargin: l = [4, 0], formProps: p = {}, formFields: c = [], fields: u = [], data: f, theme: m, themeProps: d = {}, children: b, ...k }) => {
const [C] = Q.useForm(t), x = _(() => [{ name: "__PROPS__", value: p }].concat(c), [p, c]); const [C] = Q.useForm(t), x = _(() => [{ name: "__PROPS__", value: p }].concat(c), [p, c]);
We(() => (C.setFieldsValue(f), () => C.resetFields()), [f]); We(() => (C.setFieldsValue(f), () => C.resetFields()), [f]);
const v = (R, F) => { const v = (R, F) => {
const B = Ft(R, $a, n); const B = Ft(R, $a, n);
return E("div", { className: V("ff-grid-layout", i), style: { ...a, "--grid-layout-item-margin-y": `${(l == null ? void 0 : l[0]) || 0}px`, "--grid-layout-item-margin-x": `${(l == null ? void 0 : l[1]) || 0}px`, "--grid-layout-container-padding-y": `${(s == null ? void 0 : s[0]) || 0}px`, "--grid-layout-container-padding-x": `${(s == null ? void 0 : s[1]) || 0}px`, "--grid-layout-cols": r, "--grid-layout-row-height": `${o}px` }, children: [B, F && S.cloneElement(F, { cols: r, rowHeight: o, itemMargin: l, containerPadding: s, fields: R, basicForm: n })] }); return E("div", { className: V("ff-grid-layout", i), style: { ...a, "--grid-layout-item-margin-y": `${(l == null ? void 0 : l[0]) || 0}px`, "--grid-layout-item-margin-x": `${(l == null ? void 0 : l[1]) || 0}px`, "--grid-layout-container-padding-y": `${(s == null ? void 0 : s[0]) || 0}px`, "--grid-layout-container-padding-x": `${(s == null ? void 0 : s[1]) || 0}px`, "--grid-layout-cols": r, "--grid-layout-row-height": `${o}px` }, children: [B, F && S.cloneElement(F, { cols: r, rowHeight: o, itemMargin: l, containerPadding: s, fields: R, basicForm: n })] });
}; };
return g(Q, { ...k, fields: x, form: C, component: !1, children: m ? g(fn, { ...u, theme: m, itemRender: v, fields: d, children: b }) : v(d, b) }); return g(Q, { ...k, fields: x, form: C, component: !1, children: m ? g(fn, { ...d, theme: m, itemRender: v, fields: u, children: b }) : v(u, b) });
}, Oi = /* @__PURE__ */ ((e) => function({ code: t, data: n, ...a }) { }, Oi = /* @__PURE__ */ ((e) => function({ code: t, data: n, ...a }) {
const { uuid: i, resource: r, items: o, hides: s, rowHeight: l, marginX: p, marginY: c, cols: d, theme: f, themeProps: m } = Pa(t), u = _(() => [{ name: "__RESOURCE__", value: r }, { name: "__LAYOUT_KEY__", value: t }, { name: "__LAYOUT_UUID__", value: i }], [t, i, r]); const { uuid: i, resource: r, items: o, hides: s, rowHeight: l, marginX: p, marginY: c, cols: u, theme: f, themeProps: m } = Pa(t), d = _(() => [{ name: "__RESOURCE__", value: r }, { name: "__LAYOUT_KEY__", value: t }, { name: "__LAYOUT_UUID__", value: i }], [t, i, r]);
return r && g(e, { name: t, theme: f, themeProps: m, ...a, fields: o, formFields: u, rowHeight: l, cols: d, itemMargin: [p, c], data: r ? { [r]: n } : n }); return r && g(e, { name: t, theme: f, themeProps: m, ...a, fields: o, formFields: d, rowHeight: l, cols: u, itemMargin: [p, c], data: r ? { [r]: n } : n });
})(yn), Fa = ({ column: e = 0, colWidth: t = 0, cols: n, rowHeight: a, itemMargin: i, fields: r, primaryKey: o, dataSource: s, itemClassName: l, beforeRender: p = null, afterRender: c = null, itemRender: d = (b, k, C) => b, empty: f = g(Wn, { description: null }), className: m, style: u = {} }) => { })(yn), Fa = ({ column: e = 0, colWidth: t = 0, cols: n, rowHeight: a, itemMargin: i, fields: r, primaryKey: o, dataSource: s, itemClassName: l, beforeRender: p = null, afterRender: c = null, itemRender: u = (b, k, C) => b, empty: f = g(Wn, { description: null }), className: m, style: d = {} }) => {
const { classNames: b } = ae(Z), k = _(() => g(yn, { cols: n, rowHeight: a, itemMargin: i, fields: r, className: l }), [r, n, a, i]), C = h.isEmpty(s); const { classNames: b } = ae(Z), k = _(() => g(yn, { cols: n, rowHeight: a, itemMargin: i, fields: r, className: l }), [r, n, a, i]), C = h.isEmpty(s);
return E("div", { className: V("ff-data-list-content", b.content, m), style: Object.assign({}, u, e && { "--col-num": e }, t && { "--col-width": t }), children: [p == null ? void 0 : p(s), C ? f : s.map((x, v) => { return E("div", { className: V("ff-data-list-content", b.content, m), style: Object.assign({}, d, e && { "--col-num": e }, t && { "--col-width": t }), children: [p == null ? void 0 : p(s), C ? f : s.map((x, v) => {
const R = d(S.cloneElement(k, { data: x }), x, v); const R = u(S.cloneElement(k, { data: x }), x, v);
return S.cloneElement(R, { key: `${(x == null ? void 0 : x[o]) ?? v}-${oa(x)}` }); return S.cloneElement(R, { key: `${(x == null ? void 0 : x[o]) ?? v}-${oa(x)}` });
}), c == null ? void 0 : c(s)] }); }), c == null ? void 0 : c(s)] });
}, Ra = ({ component: e, $props: t }) => { }, Ra = ({ component: e, $props: t }) => {
@ -544,11 +544,11 @@ const oe = class oe {
}); });
$(this, "get", (t) => (y(this, te).has(t) || (t = Array.from(y(this, te).keys()).find((n) => y(this, te).get(n).uri === t)), y(this, te).get(t) || {})); $(this, "get", (t) => (y(this, te).has(t) || (t = Array.from(y(this, te).keys()).find((n) => y(this, te).get(n).uri === t)), y(this, te).get(t) || {}));
$(this, "redirect", (t, n, a = {}) => { $(this, "redirect", (t, n, a = {}) => {
const { uri: i, type: r, widgetProps: o } = this.get(t) || {}, { router: s, query: l, ...p } = n || {}, c = Object.assign({}, p, s), d = Object.assign({}, p, l); const { uri: i, type: r, widgetProps: o } = this.get(t) || {}, { router: s, query: l, ...p } = n || {}, c = Object.assign({}, p, s), u = Object.assign({}, p, l);
r == "list" && (c.base62params = A.encode(c != null && c.base62params ? c.base62params : c)); r == "list" && (c.base62params = A.encode(c != null && c.base62params ? c.base62params : c));
let f = Yn(i || t, c); let f = Yn(i || t, c);
const m = new URLSearchParams(); const m = new URLSearchParams();
for (const u in o || {}) (o == null ? void 0 : o.type) == "query" && Object.has(d, u) && m.append(u, JSON.stringify(d[u])); for (const d in o || {}) (o == null ? void 0 : o.type) == "query" && Object.has(u, d) && m.append(d, JSON.stringify(u[d]));
return m.size > 0 && (f = `${f}?${m.toString()}`), a != null && a.isOpenWindow ? window.open(f) : y(this, we).navigate(f, { replace: !!(a != null && a.isReplaceRouteHistory) }); return m.size > 0 && (f = `${f}?${m.toString()}`), a != null && a.isOpenWindow ? window.open(f) : y(this, we).navigate(f, { replace: !!(a != null && a.isReplaceRouteHistory) });
}); });
$(this, "getMenus", (t) => { $(this, "getMenus", (t) => {
@ -604,14 +604,14 @@ const oe = class oe {
if (y(this, te).size == 0) return null; if (y(this, te).size == 0) return null;
const n = Le.get("Common.WEBSITE_DEFAULT_THEME", "@pkg/ff/frameworks/DefaultTheme"), a = Le.get(ne.checkUserToken() ? "Common.WEBSITE_LOGIN_REDIRECT" : "Common.WEBSITE_DEFAULT", "/index"), i = { [n]: 0 }, r = (s, l) => () => Promise.all([ne.getWidgetComponent(s), qe(l)]).then(([p, c]) => [p.default || function() { const n = Le.get("Common.WEBSITE_DEFAULT_THEME", "@pkg/ff/frameworks/DefaultTheme"), a = Le.get(ne.checkUserToken() ? "Common.WEBSITE_LOGIN_REDIRECT" : "Common.WEBSITE_DEFAULT", "/index"), i = { [n]: 0 }, r = (s, l) => () => Promise.all([ne.getWidgetComponent(s), qe(l)]).then(([p, c]) => [p.default || function() {
return `${s}`; return `${s}`;
}, c]).then(([p, c]) => ({ Component: () => S.createElement(an, {}, S.createElement(p, { $setting: c })) })), o = Array.from(y(this, te).values()).reduce((s, { uuid: l, uri: p, name: c, type: d, component: f, widgetSetting: m, widgetProps: u, isLogin: b, isLayout: k, extra: C }) => { }, c]).then(([p, c]) => ({ Component: () => S.createElement(an, {}, S.createElement(p, { $setting: c })) })), o = Array.from(y(this, te).values()).reduce((s, { uuid: l, uri: p, name: c, type: u, component: f, widgetSetting: m, widgetProps: d, isLogin: b, isLayout: k, extra: C }) => {
let x = {}, v = 0; let x = {}, v = 0;
switch (d) { switch (u) {
case "list": case "list":
x.element = S.createElement(Ra, { component: f, $props: u }); x.element = S.createElement(Ra, { component: f, $props: d });
break; break;
case "fsdpf-component": case "fsdpf-component":
x.element = S.createElement(Ea, { key: f, component: f, $setting: m, $props: u }); x.element = S.createElement(Ea, { key: f, component: f, $setting: m, $props: d });
} }
const R = (C == null ? void 0 : C.theme) ?? (C == null ? void 0 : C.layout); const R = (C == null ? void 0 : C.theme) ?? (C == null ? void 0 : C.layout);
if (R) { if (R) {
@ -703,7 +703,7 @@ const Se = xt.getInstance(), ot = () => {
}, ja = (e) => { }, ja = (e) => {
const [t, n] = S.useState({ items: [], hides: [] }); const [t, n] = S.useState({ items: [], hides: [] });
return S.useEffect(() => { return S.useEffect(() => {
e && A.get(`/api/_/${e}`).then(({ pk: a, uuid: i, code: r, resource: o, align: s, cols: l, rowHeight: p, marginX: c, marginY: d, listenChangeFields: f, listenChangeFieldsFunc: m, fields: u, theme: b, themeSetting: k }) => ({ pk: a, uuid: i, code: r, resource: o, align: s, cols: l, rowHeight: p, marginX: c, marginY: d, theme: b, themeProps: k, listenChangeFields: f, listenChangeFieldsFunc: m, ...u.reduce((C, x) => { e && A.get(`/api/_/${e}`).then(({ pk: a, uuid: i, code: r, resource: o, align: s, cols: l, rowHeight: p, marginX: c, marginY: u, listenChangeFields: f, listenChangeFieldsFunc: m, fields: d, theme: b, themeSetting: k }) => ({ pk: a, uuid: i, code: r, resource: o, align: s, cols: l, rowHeight: p, marginX: c, marginY: u, theme: b, themeProps: k, listenChangeFields: f, listenChangeFieldsFunc: m, ...d.reduce((C, x) => {
var v; var v;
return (v = x == null ? void 0 : x.field) != null && v.hidden ? C.hides.push(x == null ? void 0 : x.field) : C.items.push(x), C; return (v = x == null ? void 0 : x.field) != null && v.hidden ? C.hides.push(x == null ? void 0 : x.field) : C.items.push(x), C;
}, { items: [], hides: [] }) })).then(n); }, { items: [], hides: [] }) })).then(n);
@ -711,7 +711,7 @@ const Se = xt.getInstance(), ot = () => {
}, Aa = ({ max: e = 0, min: t = 0, type: n = "", message: a, pattern: i, required: r = !1, validator: o } = {}, s, l) => { }, Aa = ({ max: e = 0, min: t = 0, type: n = "", message: a, pattern: i, required: r = !1, validator: o } = {}, s, l) => {
const [p, c] = O([]); const [p, c] = O([]);
return L(() => { return L(() => {
const d = []; const u = [];
if (r) { if (r) {
let f = l; let f = l;
switch (l) { switch (l) {
@ -725,22 +725,22 @@ const Se = xt.getInstance(), ot = () => {
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 (n) { switch (n) {
case "string": case "string":
d.push({ type: n, max: e, min: t, message: a || (t && e ? `字符必须在 ${t} ~ ${e} 之间` : `${e ? "最多能有" : "最少要有"} ${t || e} 个字符`) }); u.push({ type: n, max: e, min: t, message: a || (t && e ? `字符必须在 ${t} ~ ${e} 之间` : `${e ? "最多能有" : "最少要有"} ${t || e} 个字符`) });
break; break;
case "pattern": case "pattern":
d.push({ type: "string", pattern: i, message: a }); u.push({ type: "string", pattern: i, message: a });
break; break;
case "validator": case "validator":
o && d.push(({ getFieldValue: f }) => ({ validator: async (m, u) => { o && u.push(({ getFieldValue: f }) => ({ validator: async (m, d) => {
const b = await Se.exec(o, { value: u, fieldName: s }, { getFieldValue: f }); const b = await Se.exec(o, { value: d, fieldName: s }, { getFieldValue: f });
return h.isString(b) && b ? Promise.reject(b) : h.isBoolean(b) && !b ? Promise.reject(a) : Promise.resolve(); return h.isString(b) && b ? Promise.reject(b) : h.isBoolean(b) && !b ? Promise.reject(a) : Promise.resolve();
} })); } }));
} }
c(d); c(u);
}, [e, t, n, a, i, r, o]), p; }, [e, t, n, a, i, r, o]), p;
}, La = (e, t, n) => { }, La = (e, t, n) => {
const [a, i] = O(null); const [a, i] = O(null);
@ -764,11 +764,11 @@ const Se = xt.getInstance(), ot = () => {
}, Ma = (e, t, n = [], a = {}) => { }, Ma = (e, t, n = [], a = {}) => {
const i = q({}), r = q(), o = h.debounce(ot(), 180), s = ["disabled", "required"], l = (f, m) => { const i = q({}), r = q(), o = h.debounce(ot(), 180), s = ["disabled", "required"], l = (f, m) => {
s.includes(f) && (i.current[f] = m), o(); s.includes(f) && (i.current[f] = m), o();
}, p = _(() => ({ setDisabled: (f) => l("disabled", f), setRequired: (f) => l("required", f), getDisabled: () => i.current.disabled, getRequired: () => i.current.required }), [t]), [c, d] = Et(t, -1, {}, p, a); }, p = _(() => ({ setDisabled: (f) => l("disabled", f), setRequired: (f) => l("required", f), getDisabled: () => i.current.disabled, getRequired: () => i.current.required }), [t]), [c, u] = Et(t, -1, {}, p, a);
if (!d && r.current != c && (c >= 0 || !h.isEmpty(n == null ? void 0 : n[c]))) { if (!u && r.current != c && (c >= 0 || !h.isEmpty(n == null ? void 0 : n[c]))) {
r.current = c; r.current = c;
const { widget: f, widgetPrefix: m, props: u } = n == null ? void 0 : n[c]; const { widget: f, widgetPrefix: m, props: d } = n == null ? void 0 : n[c];
e = sn(f, m), i.current = h.merge(u, h.pick(i.current, s)); e = sn(f, m), i.current = h.merge(d, h.pick(i.current, s));
} }
return [e, i.current]; return [e, i.current];
}, Kt = (e) => e === void 0 || e === !1 ? "" : (Array.isArray(e) ? e : [e]).join("_"), zi = ({ value: e, onChange: t }, n = null) => { }, Kt = (e) => e === void 0 || e === !1 ? "" : (Array.isArray(e) ? e : [e]).join("_"), zi = ({ value: e, onChange: t }, n = null) => {
@ -791,10 +791,10 @@ const Se = xt.getInstance(), ot = () => {
}, Ot = ({ widget: e = "Input", widgetPrefix: t = "@pkg/ff/grid-layout-forms", widgetDecorator: n, subWidgets: a = [], basicForm: i, ...r }) => { }, Ot = ({ widget: e = "Input", widgetPrefix: t = "@pkg/ff/grid-layout-forms", widgetDecorator: n, subWidgets: a = [], basicForm: i, ...r }) => {
const o = sn(e, t), [s, l] = Ma(o, n, a, i), [p, c] = O(); const o = sn(e, t), [s, l] = Ma(o, n, a, i), [p, c] = O();
return L(() => { return L(() => {
s && ne.getWidgetComponent(s).then(({ defaultProps: d = {}, default: f }) => ({ default: za(f, d, i) })).catch((d) => ({ default: () => `${d}` })).then((d) => c(S.createElement(d.default, r))); s && ne.getWidgetComponent(s).then(({ defaultProps: u = {}, default: f }) => ({ default: za(f, u, i) })).catch((u) => ({ default: () => `${u}` })).then((u) => c(S.createElement(u.default, r)));
}, [s]), p && S.cloneElement(p, { ...r, ...l }); }, [s]), p && S.cloneElement(p, { ...r, ...l });
}, za = (e, t = {}, n = null) => (a) => { }, za = (e, t = {}, n = null) => (a) => {
const { type: i, code: r, label: o, noStyle: s, placeholder: l, required: p = !1, extras: c, validators: d, help: f, isVirtual: m, $isReserved: u, initialValue: b, initialValueLanguage: k, ...C } = h.omit(h.merge({}, t, a), ["convertJs", "convertJsSetting", "widget", "widgetPerfix", "widgetDecorator", "subWidgets", "boxStyle"]), x = Aa(Object.assign({}, d, p ? { required: !0 } : {}), r, i), v = _(() => { const { type: i, code: r, label: o, noStyle: s, placeholder: l, required: p = !1, extras: c, validators: u, help: f, isVirtual: m, $isReserved: d, initialValue: b, initialValueLanguage: k, ...C } = h.omit(h.merge({}, t, a), ["convertJs", "convertJsSetting", "widget", "widgetPerfix", "widgetDecorator", "subWidgets", "boxStyle"]), x = Aa(Object.assign({}, u, p ? { required: !0 } : {}), r, i), v = _(() => {
const I = Object.keys((t == null ? void 0 : t.extras) || {}); const I = Object.keys((t == null ? void 0 : t.extras) || {});
return h.over([h.partialRight(h.pick, I), h.partialRight(h.omit, I)]); return h.over([h.partialRight(h.pick, I), h.partialRight(h.omit, I)]);
}, [t == null ? void 0 : t.extras]), [R, F] = v(C), B = { label: o, noStyle: s, colon: !1, layout: "vertical" }, M = J((I) => I == null ? void 0 : ce(I, i), [i]); }, [t == null ? void 0 : t.extras]), [R, F] = v(C), B = { label: o, noStyle: s, colon: !1, layout: "vertical" }, M = J((I) => I == null ? void 0 : ce(I, i), [i]);
@ -802,10 +802,10 @@ const Se = xt.getInstance(), ot = () => {
var N; var N;
return g(e, { type: i, rcform: z, basicForm: n, itemProps: { validateStatus: T.errors.length > 0 ? "error" : "success", tooltip: f || null, help: T.errors.length > 0 ? T.errors.join("、") : null, required: ((N = x == null ? void 0 : x[0]) == null ? void 0 : N.required) || !1, ...B }, fieldProps: { placeholder: l, ...F, ...I }, $setting: Object.assign({}, c, R) }); return g(e, { type: i, rcform: z, basicForm: n, itemProps: { validateStatus: T.errors.length > 0 ? "error" : "success", tooltip: f || null, help: T.errors.length > 0 ? T.errors.join("、") : null, required: ((N = x == null ? void 0 : x[0]) == null ? void 0 : N.required) || !1, ...B }, fieldProps: { placeholder: l, ...F, ...I }, $setting: Object.assign({}, c, R) });
} }); } });
}, jt = ({ name: e, form: t = null, basicForm: n = null, style: a = {}, className: i, cols: r = 24, rowHeight: o = 16, itemMargin: s = [8, 16], containerPadding: l = [0, 0], fields: p = [], hides: c = [], primaryKey: d = 0, formProps: f = {}, formFields: m = [], listenChangeFields: u, listenChangeFieldsFunc: b, onValuesChange: k, theme: C, themeProps: x = {}, children: v, ...R }) => { }, jt = ({ name: e, form: t = null, basicForm: n = null, style: a = {}, className: i, cols: r = 24, rowHeight: o = 16, itemMargin: s = [8, 16], containerPadding: l = [0, 0], fields: p = [], hides: c = [], primaryKey: u = 0, formProps: f = {}, formFields: m = [], listenChangeFields: d, listenChangeFieldsFunc: b, onValuesChange: k, theme: C, themeProps: x = {}, children: v, ...R }) => {
const [F] = Q.useForm(t), B = J((T, z) => { const [F] = Q.useForm(t), B = J((T, z) => {
k == null || k(T, z), b && Array.isArray(u) && Se.exec(b, { changedValues: T, allValues: z }, { getFieldValue: F.getFieldValue, setFieldValue: F.setFieldValue, setFieldsValue: F.setFieldsValue, isFieldTouched: F.isFieldTouched, isFieldsTouched: F.isFieldsTouched }).catch((N) => console.error("onFormValuesChange", e, N)); k == null || k(T, z), b && Array.isArray(d) && Se.exec(b, { changedValues: T, allValues: z }, { getFieldValue: F.getFieldValue, setFieldValue: F.setFieldValue, setFieldsValue: F.setFieldsValue, isFieldTouched: F.isFieldTouched, isFieldsTouched: F.isFieldsTouched }).catch((N) => console.error("onFormValuesChange", e, N));
}, [e, F, k, u, b]), M = _(() => [{ name: "__PROPS__", value: f }, { name: "__PRIMARY_KEY__", value: d }].concat(m), [d, f, m]), I = (T, z) => { }, [e, F, k, d, b]), M = _(() => [{ name: "__PROPS__", value: f }, { name: "__PRIMARY_KEY__", value: u }].concat(m), [u, f, m]), I = (T, z) => {
const N = Ft(T, Ot, n); const N = Ft(T, Ot, n);
return E("div", { className: V("ff-grid-layout-form", i), style: { ...a, "--grid-layout-item-margin-x": `${(s == null ? void 0 : s[0]) ?? 8}px`, "--grid-layout-item-margin-y": `${(s == null ? void 0 : s[1]) ?? 16}px`, "--grid-layout-container-padding-y": `${(l == null ? void 0 : l[0]) || 0}px`, "--grid-layout-container-padding-x": `${(l == null ? void 0 : l[1]) || 0}px`, "--grid-layout-cols": r, "--grid-layout-row-height": `${o}px` }, children: [N, z && S.cloneElement(z, { cols: r, rowHeight: o, itemMargin: s, containerPadding: l, fields: T, basicForm: n })] }); return E("div", { className: V("ff-grid-layout-form", i), style: { ...a, "--grid-layout-item-margin-x": `${(s == null ? void 0 : s[0]) ?? 8}px`, "--grid-layout-item-margin-y": `${(s == null ? void 0 : s[1]) ?? 16}px`, "--grid-layout-container-padding-y": `${(l == null ? void 0 : l[0]) || 0}px`, "--grid-layout-container-padding-x": `${(l == null ? void 0 : l[1]) || 0}px`, "--grid-layout-cols": r, "--grid-layout-row-height": `${o}px` }, children: [N, z && S.cloneElement(z, { cols: r, rowHeight: o, itemMargin: s, containerPadding: l, fields: T, basicForm: n })] });
}; };
@ -821,8 +821,8 @@ const Se = xt.getInstance(), ot = () => {
}; };
jt.propTypes = { fields: w.array, hides: w.array }; jt.propTypes = { fields: w.array, hides: w.array };
const Da = /* @__PURE__ */ ((e) => ({ code: t, isPreview: n = !1, ...a }) => { const Da = /* @__PURE__ */ ((e) => ({ code: t, isPreview: n = !1, ...a }) => {
const { align: i, autoComplete: r, resource: o, items: s, hides: l, rowHeight: p, marginX: c, marginY: d, cols: f, listenChangeFields: m, listenChangeFieldsFunc: u, pk: b, uuid: k, theme: C, themeProps: x } = ja(t), v = _(() => [{ name: "__PK__", value: b }, { name: "__RESOURCE__", value: o }, { name: "__LAYOUT_KEY__", value: t }, { name: "__LAYOUT_UUID__", value: k }], [b, t, k, o]); const { align: i, autoComplete: r, resource: o, items: s, hides: l, rowHeight: p, marginX: c, marginY: u, cols: f, listenChangeFields: m, listenChangeFieldsFunc: d, pk: b, uuid: k, theme: C, themeProps: x } = ja(t), v = _(() => [{ name: "__PK__", value: b }, { name: "__RESOURCE__", value: o }, { name: "__LAYOUT_KEY__", value: t }, { name: "__LAYOUT_UUID__", value: k }], [b, t, k, o]);
return g(e, { name: t, autoComplete: r, theme: C, themeProps: x, ...a, formFields: v, listenChangeFields: m, listenChangeFieldsFunc: u, fields: s, hides: l, cols: f, rowHeight: p, itemMargin: [c, d] }); return g(e, { name: t, autoComplete: r, theme: C, themeProps: x, ...a, formFields: v, listenChangeFields: m, listenChangeFieldsFunc: d, fields: s, hides: l, cols: f, rowHeight: p, itemMargin: [c, u] });
})(jt), Cn = ({ $setting: e, $close: t, extras: n, code: a, primaryKey: i, ...r }) => { })(jt), Cn = ({ $setting: e, $close: t, extras: n, code: a, primaryKey: i, ...r }) => {
const [o] = Q.useForm(), s = Ia(o, a, i, e); const [o] = Q.useForm(), s = Ia(o, a, i, e);
return g(H, { actions: E(S.Fragment, { children: [g(P, { name: (e == null ? void 0 : e.okText) || "保存", type: "primary", widget: () => s({ onSuccess: t }) }), g(P, { name: (e == null ? void 0 : e.cancelText) || "取消", widget: () => t(!1) })] }), extras: n, children: g(Da, { form: o, code: a, primaryKey: i, ...r }) }); return g(H, { actions: E(S.Fragment, { children: [g(P, { name: (e == null ? void 0 : e.okText) || "保存", type: "primary", widget: () => s({ onSuccess: t }) }), g(P, { name: (e == null ? void 0 : e.cancelText) || "取消", widget: () => t(!1) })] }), extras: n, children: g(Da, { form: o, code: a, primaryKey: i, ...r }) });
@ -852,7 +852,7 @@ const Ua = (e, t, n, a) => ke.redirect(n, t, a), _a = (e, t = {}, n, a = {}) =>
}, Gt = (e, t, n, a, i) => h.isString(n) && n ? ne.getWidgetComponent(n).then(({ default: r }) => Y.modal(r, { ...t, $setting: a }, i != null && i.title ? { ...i, title: h.template(i.title)(e) } : i)).catch((r) => { }, Gt = (e, t, n, a, i) => h.isString(n) && n ? ne.getWidgetComponent(n).then(({ default: r }) => Y.modal(r, { ...t, $setting: a }, i != null && i.title ? { ...i, title: h.template(i.title)(e) } : i)).catch((r) => {
Y.error(n, { content: r.toString() }); Y.error(n, { content: r.toString() });
}) : Y.modal(n, { ...t, $setting: a }, i != null && i.title ? { ...i, title: h.template(i.title)(e) } : i), qa = (e, t, n, a, i) => Y.modal(Cn, { ...t, $setting: a, code: n }, i != null && i.title ? { ...i, title: h.template(i.title)(e) } : i), Wa = (e, t, n, a, i) => Y.modal(Rt, { base62params: t, $setting: a, listCode: n }, i != null && i.title ? { ...i, title: h.template(i.title)(e) } : i), Ka = ({ widget: e, widgetType: t, widgetData: n, widgetProps: a, widgetSetting: i, widgetContainerProps: r }, { onAfterClick: o, onBeforeClick: s } = {}) => { }) : Y.modal(n, { ...t, $setting: a }, i != null && i.title ? { ...i, title: h.template(i.title)(e) } : i), qa = (e, t, n, a, i) => Y.modal(Cn, { ...t, $setting: a, code: n }, i != null && i.title ? { ...i, title: h.template(i.title)(e) } : i), Wa = (e, t, n, a, i) => Y.modal(Rt, { base62params: t, $setting: a, listCode: n }, i != null && i.title ? { ...i, title: h.template(i.title)(e) } : i), Ka = ({ widget: e, widgetType: t, widgetData: n, widgetProps: a, widgetSetting: i, widgetContainerProps: r }, { onAfterClick: o, onBeforeClick: s } = {}) => {
const l = ae(Z), [p, c] = O({ leading: !0, trailing: !1 }), d = _(() => { const l = ae(Z), [p, c] = O({ leading: !0, trailing: !1 }), u = _(() => {
switch (t) { switch (t) {
case "redirect": case "redirect":
return h.partialRight(Ua, e, i); return h.partialRight(Ua, e, i);
@ -873,54 +873,54 @@ const Ua = (e, t, n, a) => ke.redirect(n, t, a), _a = (e, t = {}, n, a = {}) =>
} }
return (...f) => console.error("useButton unknown widgetType", t, ...f); return (...f) => console.error("useButton unknown widgetType", t, ...f);
}, [e, t]); }, [e, t]);
return [h.debounce((f) => (s == null || s(f), Promise.resolve(qe(a, f, { list: l })).then((m) => d(f, { ...n, ...m })).then((m) => o == null ? void 0 : o(m)).catch(console.error)), 300, { leading: !0, trailing: !1 }), p]; return [h.debounce((f) => (s == null || s(f), Promise.resolve(qe(a, f, { list: l })).then((m) => u(f, { ...n, ...m })).then((m) => o == null ? void 0 : o(m)).catch(console.error)), 300, { leading: !0, trailing: !1 }), p];
}, kn = ({ type: e, name: t, className: n, icon: a, iconPosition: i, size: r }, o = "default") => _(() => { }, kn = ({ type: e, name: t, className: n, icon: a, iconPosition: i, size: r }, o = "default") => _(() => {
const s = { type: "primary", className: V("ff-button", n), iconPosition: i, size: r }; const s = { type: "primary", className: V("ff-button", n), iconPosition: i, size: r };
return e === "danger" ? s.danger = !0 : e === "default" && (s.type = e), o === "link" || o === "dashed" ? (s.type = o, e === "default" && (s.className = V(s.className, "ff-default"))) : o !== "circle" && o !== "round" || (s.shape = o), a && (s.icon = g(Pt, { type: a })), 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 = V(s.className, "ff-default"))) : o !== "circle" && o !== "round" || (s.shape = o), a && (s.icon = g(Pt, { type: a })), t && (s.children = t), s;
}, [o, e, n, a, i]), lt = ({ data: e, widget: t, widgetType: n = "fsdpf-component", widgetData: a, widgetProps: i, widgetSetting: r, widgetContainerProps: o, onAfterClick: s, onBeforeClick: l, children: p, extras: c }) => { }, [o, e, n, a, i]), lt = ({ data: e, widget: t, widgetType: n = "fsdpf-component", widgetData: a, widgetProps: i, widgetSetting: r, widgetContainerProps: o, onAfterClick: s, onBeforeClick: l, children: p, extras: c }) => {
const d = ae(Z), [f, m] = O(!1), [u, b] = O("hover"), [k, C] = O({}), [x, v] = O(), { placement: R, align: F, zIndex: B, arrow: M = { pointAtCenter: !0 }, getPopupContainer: I, isPopupMountBodyContainer: T = !1, ...z } = o || {}; const u = ae(Z), [f, m] = O(!1), [d, b] = O("hover"), [k, C] = O({}), [x, v] = O(), { placement: R, align: F, zIndex: B, arrow: M = { pointAtCenter: !0 }, getPopupContainer: I, isPopupMountBodyContainer: T = !1, ...z } = o || {};
L(() => { L(() => {
n == "grid-layout-form" ? v(S.createElement(Cn, { ...a, $setting: r, code: t })) : n == "data-list" ? v(S.createElement(Rt, { base62params: e, $setting: r, listCode: t })) : h.isString(t) ? ne.getWidgetComponent(t).then(({ default: D }) => { n == "grid-layout-form" ? v(S.createElement(Cn, { ...a, $setting: r, code: t })) : n == "data-list" ? v(S.createElement(Rt, { base62params: e, $setting: r, listCode: t })) : h.isString(t) ? ne.getWidgetComponent(t).then(({ default: D }) => {
v(S.createElement(D, { ...a, $setting: r })); v(S.createElement(D, { ...a, $setting: r }));
}).catch((D) => v(D.toString())) : Lt(t) ? v(S.createElement(t, { ...a, $setting: r })) : S.isValidElement(t) && v(S.cloneElement(t, { ...a, $setting: r })); }).catch((D) => v(D.toString())) : Lt(t) ? v(S.createElement(t, { ...a, $setting: r })) : S.isValidElement(t) && v(S.cloneElement(t, { ...a, $setting: r }));
}, [t, n, a]), L(() => { }, [t, n, a]), L(() => {
Promise.resolve(qe(i, e, { list: d })).then(C); Promise.resolve(qe(i, e, { list: u })).then(C);
}, [i, e, d.getBase62params]); }, [i, e, u.getBase62params]);
const N = (D, ge = !1) => (m(D), !D && b("hover"), D ? l == null ? void 0 : l(k) : s == null ? void 0 : s(ge)), K = (D) => { const N = (D, ge = !1) => (m(D), !D && b("hover"), D ? l == null ? void 0 : l(k) : s == null ? void 0 : s(ge)), K = (D) => {
m(!0), b("click"); m(!0), b("click");
}; };
return g(Kn, { zIndex: B, placement: R, onPopupClick: K, onClick: K, open: f, align: F, arrow: M, trigger: u, getPopupContainer: I || T ? void 0 : (D) => D, styles: { body: { padding: 0 } }, content: g(Ha, { ...z, extras: c, children: x && S.cloneElement(x, { ...k, $close: (D) => N(!1, D) }) }), children: p, onOpenChange: N }); return g(Kn, { zIndex: B, placement: R, onPopupClick: K, onClick: K, open: f, align: F, arrow: M, trigger: d, getPopupContainer: I || T ? void 0 : (D) => D, styles: { body: { padding: 0 } }, content: g(Ha, { ...z, extras: c, children: x && S.cloneElement(x, { ...k, $close: (D) => N(!1, D) }) }), children: p, onOpenChange: N });
}, Ha = ({ title: e, className: t, children: n, extras: a, width: i, height: r, ...o }) => { }, Ha = ({ title: e, className: t, children: n, extras: a, width: i, height: r, ...o }) => {
const [s, l] = O({}), p = J((m, u) => l((b) => ({ ...b, [m]: u })), []), c = J((m) => l((u) => ({ ...u, [m]: void 0 })), []), d = e ? S.createElement("div", { className: "ff-popup-title" }, e) : s == null ? void 0 : s.title, f = a ?? S.createElement("div", { className: "ff-popup-reserved-extras" }, a); const [s, l] = O({}), p = J((m, d) => l((b) => ({ ...b, [m]: d })), []), c = J((m) => l((d) => ({ ...d, [m]: void 0 })), []), u = e ? S.createElement("div", { className: "ff-popup-title" }, e) : s == null ? void 0 : s.title, f = a ?? S.createElement("div", { className: "ff-popup-reserved-extras" }, a);
return g(_e.Provider, { value: { ele: s, mount: p, unmount: c }, children: E("div", { className: V("ff-popup ff-popover", t, s.rootClassName), style: { width: i, height: r }, ...o, children: [E("div", { className: "ff-popup-header", children: [d, s == null ? void 0 : s["sub-title"]] }), n, E("div", { className: "ff-popup-footer", children: [f, s == null ? void 0 : s.extras, s == null ? void 0 : s.actions] })] }) }); return g(_e.Provider, { value: { ele: s, mount: p, unmount: c }, children: E("div", { className: V("ff-popup ff-popover", t, s.rootClassName), style: { width: i, height: r }, ...o, children: [E("div", { className: "ff-popup-header", children: [u, s == null ? void 0 : s["sub-title"]] }), n, E("div", { className: "ff-popup-footer", children: [f, s == null ? void 0 : s.extras, s == null ? void 0 : s.actions] })] }) });
}; };
lt.propTypes = { widgetType: w.oneOf(["fsdpf-component", "grid-layout-form", "data-list"]) }; lt.propTypes = { widgetType: w.oneOf(["fsdpf-component", "grid-layout-form", "data-list"]) };
const He = (e) => function({ className: t, variant: n, children: a, name: i, icon: r, type: o = "default", iconPosition: s = "start", noAuthType: l, onAfterClick: p, onBeforeClick: c, data: d, loading: f, disabled: m, tooltip: u, confirm: b, widget: k = () => { const He = (e) => function({ className: t, variant: n, children: a, name: i, icon: r, type: o = "default", iconPosition: s = "start", noAuthType: l, onAfterClick: p, onBeforeClick: c, data: u, loading: f, disabled: m, tooltip: d, confirm: b, widget: k = () => {
}, widgetType: C, widgetData: x, widgetProps: v, widgetSetting: R, widgetContainerProps: F, ...B }) { }, widgetType: C, widgetData: x, widgetProps: v, widgetSetting: R, widgetContainerProps: F, ...B }) {
const { mode: M, ...I } = F || {}, T = kn({ className: t, name: i, type: o, icon: r, iconPosition: s }, n ?? e), z = g(et, { ...T, ...B, children: a || i }); const { mode: M, ...I } = F || {}, T = kn({ className: t, name: i, type: o, icon: r, iconPosition: s }, n ?? e), z = g(et, { ...T, ...B, children: a || i });
if (M === "popover" && !["destroy", "redirect", "func"].includes(C)) return g(lt, { data: d, widget: k, widgetType: C, widgetData: x, widgetProps: v, widgetSetting: R, widgetContainerProps: I, onAfterClick: p, onBeforeClick: c, children: z }); if (M === "popover" && !["destroy", "redirect", "func"].includes(C)) return g(lt, { data: u, widget: k, widgetType: C, widgetData: x, widgetProps: v, widgetSetting: R, widgetContainerProps: I, onAfterClick: p, onBeforeClick: c, children: z });
const N = h.isEmpty(u) || !u.enabled ? {} : u, K = h.isEmpty(b) ? { enabled: !1 } : Object.assign({ enabled: !0 }, b), [D, ge] = O(!1), [Je, { disabled: Ge, loading: ct }] = Ka({ widget: k, widgetType: C, widgetData: x, widgetProps: v, widgetSetting: R, widgetContainerProps: I }, { onAfterClick: p, onBeforeClick: c }); const N = h.isEmpty(d) || !d.enabled ? {} : d, K = h.isEmpty(b) ? { enabled: !1 } : Object.assign({ enabled: !0 }, b), [D, ge] = O(!1), [Je, { disabled: Ge, loading: ct }] = Ka({ widget: k, widgetType: C, widgetData: x, widgetProps: v, widgetSetting: R, widgetContainerProps: I }, { onAfterClick: p, onBeforeClick: c });
return g(Hn, { okText: "确定", cancelText: "取消", getPopupContainer: (X) => X, ...K, disabled: Ge || m, open: D, onOpenChange: (X) => { return g(Hn, { okText: "确定", cancelText: "取消", getPopupContainer: (X) => X, ...K, disabled: Ge || m, open: D, onOpenChange: (X) => {
if (!X) return ge(X); if (!X) return ge(X);
K.enabled ? ge(X) : Je(d); K.enabled ? ge(X) : Je(u);
}, onConfirm: (X) => { }, onConfirm: (X) => {
Je(d, X); Je(u, X);
}, onClick: (X) => { }, onClick: (X) => {
X.stopPropagation(); X.stopPropagation();
}, children: g(Jn, { getPopupContainer: (X) => X, ...N, title: D ? null : N == null ? void 0 : N.title, trigger: ["hover", "click"], children: S.cloneElement(z, { loading: ct || f, disabled: Ge || m }) }) }); }, children: g(Jn, { getPopupContainer: (X) => X, ...N, title: D ? null : N == null ? void 0 : N.title, trigger: ["hover", "click"], children: S.cloneElement(z, { loading: ct || f, disabled: Ge || m }) }) });
}, P = He("default"); }, P = He("default");
P.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", "component", "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 })]) }) }; P.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", "component", "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 Ja = He("link"), Ga = He("circle"), Ya = He("round"), Xa = He("dashed"), Yt = ({ options: e = [], triggerWeights: t = ["grid-layout-form", "grid-layout", "fsdpf-component", "print"], onAfterClick: n = (m, u, b) => { const Ja = He("link"), Ga = He("circle"), Ya = He("round"), Xa = He("dashed"), Yt = ({ options: e = [], triggerWeights: t = ["grid-layout-form", "grid-layout", "fsdpf-component", "print"], onAfterClick: n = (m, d, b) => {
}, onBeforeClick: a = (m, u, b) => { }, onBeforeClick: a = (m, d, b) => {
}, labelVariant: i = "link", labelSize: r, labelRender: o, btnVariant: s, btnSize: l, btnRender: p = (m, u) => g(P, { ...m, data: u }, m.uuid || ht()), widgetContainerProps: c = {}, children: d, data: f }) => { }, labelVariant: i = "link", labelSize: r, labelRender: o, btnVariant: s, btnSize: l, btnRender: p = (m, d) => g(P, { ...m, data: d }, m.uuid || ht()), widgetContainerProps: c = {}, children: u, data: f }) => {
if (h.isEmpty(e)) return d; if (h.isEmpty(e)) return u;
const [m, u] = _(() => (e || []).reduce((k, C) => { const [m, d] = _(() => (e || []).reduce((k, C) => {
const x = t.indexOf(C.widgetType); const x = t.indexOf(C.widgetType);
return x === -1 ? k[1].push(C) : k[0] ? x < t.indexOf(k[0].widgetType) ? (k[1].push(k[0]), k[0] = C) : k[1].push(C) : k[0] = C, k; return x === -1 ? k[1].push(C) : k[0] ? x < t.indexOf(k[0].widgetType) ? (k[1].push(k[0]), k[0] = C) : k[1].push(C) : k[0] = C, k;
}, [null, []]), [e, t]); }, [null, []]), [e, t]);
o ? d = o(m, f) || d : d || (d = g(et, { ...kn(Object.assign(m != null && m.name || m != null && m.icon ? {} : { icon: "icon-location" }, m, { size: r }), i) })); o ? u = o(m, f) || u : u || (u = g(et, { ...kn(Object.assign(m != null && m.name || m != null && m.icon ? {} : { icon: "icon-location" }, m, { size: r }), i) }));
const b = u.map((k) => p(Object.assign({ uuid: k.uuid, type: k.type, name: k.name, widget: k.widget, widgetType: k.widgetType, widgetProps: k.widgetProps, widgetData: k.widgetData, widgetSetting: k.widgetSetting, widgetContainerProps: k.widgetContainerSetting, confirm: k.confirm, onAfterClick: h.partialRight(n, k, f), onBeforeClick: h.partialRight(a, k, f) }, { size: l, variant: s }), f)); const b = d.map((k) => p(Object.assign({ uuid: k.uuid, type: k.type, name: k.name, widget: k.widget, widgetType: k.widgetType, widgetProps: k.widgetProps, widgetData: k.widgetData, widgetSetting: k.widgetSetting, widgetContainerProps: k.widgetContainerSetting, confirm: k.confirm, onAfterClick: h.partialRight(n, k, f), onBeforeClick: h.partialRight(a, k, f) }, { size: l, variant: s }), f));
return g(lt, { 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({}, c, m == null ? void 0 : m.widgetContainerProps), data: f, widgetData: m == null ? void 0 : m.widgetData, extras: b, onAfterClick: h.partialRight(n, m, f), onBeforeClick: h.partialRight(a, m, f), children: d }); return g(lt, { 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({}, c, m == null ? void 0 : m.widgetContainerProps), data: f, widgetData: m == null ? void 0 : m.widgetData, extras: b, onAfterClick: h.partialRight(n, m, f), onBeforeClick: h.partialRight(a, m, f), children: u });
}; };
Yt.propTypes = { triggerWeights: w.array, options: w.arrayOf(w.shape({ ...P.propTypes, widgetType: P.propTypes.widgetType.isRequired })), btnSize: P.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: P.propTypes.size, onAfterClick: w.func, onBeforeClick: w.func, widgetContainerProps: P.propTypes.widgetContainerProps, data: P.propTypes.data }, P.Link = Ja, P.Link.defaultProps = P.defaultProps, P.Link.propTypes = P.propTypes, P.Circle = Ga, P.Circle.defaultProps = P.defaultProps, P.Circle.propTypes = P.propTypes, P.Round = Ya, P.Round.defaultProps = P.defaultProps, P.Round.propTypes = P.propTypes, P.Dashed = Xa, P.Dashed.defaultProps = P.defaultProps, P.Dashed.propTypes = P.propTypes, P.Popover = lt, P.GroupPopover = Yt; Yt.propTypes = { triggerWeights: w.array, options: w.arrayOf(w.shape({ ...P.propTypes, widgetType: P.propTypes.widgetType.isRequired })), btnSize: P.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: P.propTypes.size, onAfterClick: w.func, onBeforeClick: w.func, widgetContainerProps: P.propTypes.widgetContainerProps, data: P.propTypes.data }, P.Link = Ja, P.Link.defaultProps = P.defaultProps, P.Link.propTypes = P.propTypes, P.Circle = Ga, P.Circle.defaultProps = P.defaultProps, P.Circle.propTypes = P.propTypes, P.Round = Ya, P.Round.defaultProps = P.defaultProps, P.Round.propTypes = P.propTypes, P.Dashed = Xa, P.Dashed.defaultProps = P.defaultProps, P.Dashed.propTypes = P.propTypes, P.Popover = lt, P.GroupPopover = Yt;
const Qa = ({ fields: e, formProps: t, $close: n }) => { const Qa = ({ fields: e, formProps: t, $close: n }) => {
@ -930,12 +930,12 @@ const Qa = ({ fields: e, formProps: t, $close: n }) => {
const c = (n == null ? void 0 : n.pageX) === void 0 ? { animation: null, maskAnimation: null, mousePosition: { x: null, y: null } } : { animation: "zoom", maskAnimation: "fade", mousePosition: { x: n == null ? void 0 : n.pageX, y: n == null ? void 0 : n.pageY } }; const c = (n == null ? void 0 : n.pageX) === void 0 ? { animation: null, maskAnimation: null, mousePosition: { x: null, y: null } } : { animation: "zoom", maskAnimation: "fade", mousePosition: { x: n == null ? void 0 : n.pageX, y: n == null ? void 0 : n.pageY } };
return g(na, { ...p, ...c, prefixCls: "ff-modal", modalRender: () => E("div", { className: V("ff-modal-content ff-popup", e), children: [E("div", { className: "ff-popup-header", children: [g("button", { "aria-label": "Close", className: "ff-popup-close", onClick: p.onClose, children: g(Nt, { type: "close" }) }), i, r] }), g("div", { className: "ff-popup-body", children: a }), E("div", { className: "ff-popup-footer", children: [s, o] })] }) }); return g(na, { ...p, ...c, prefixCls: "ff-modal", modalRender: () => E("div", { className: V("ff-modal-content ff-popup", e), children: [E("div", { className: "ff-popup-header", children: [g("button", { "aria-label": "Close", className: "ff-popup-close", onClick: p.onClose, children: g(Nt, { type: "close" }) }), i, r] }), g("div", { className: "ff-popup-body", children: a }), E("div", { className: "ff-popup-footer", children: [s, o] })] }) });
}, Sn = ({ placement: e, $close: t, $event: n, children: a, title: i, ...r }) => { }, Sn = ({ placement: e, $close: t, $event: n, children: a, title: i, ...r }) => {
const [o, s] = O({}), [l, p] = O(!0), c = J((u, b) => s((k) => ({ ...k, [u]: b })), []), d = J((u) => s((b) => ({ ...b, [u]: void 0 })), []); const [o, s] = O({}), [l, p] = O(!0), c = J((d, b) => s((k) => ({ ...k, [d]: b })), []), u = J((d) => s((b) => ({ ...b, [d]: void 0 })), []);
let f = { ...r, className: o.rootClassName, title: o.title || i && S.createElement("div", { className: V("ff-popup-title") }, i), subTitle: o["sub-title"], actions: o.actions, extras: o.extras, children: a, $close: t, $event: n, onClose: () => p(!1) }; let f = { ...r, className: o.rootClassName, title: o.title || i && S.createElement("div", { className: V("ff-popup-title") }, i), subTitle: o["sub-title"], actions: o.actions, extras: o.extras, children: a, $close: t, $event: n, onClose: () => p(!1) };
const m = () => { const m = () => {
t(!1); t(!1);
}; };
return g(_e.Provider, { value: { ele: o, mount: c, unmount: d }, children: e && e !== "center" ? g(Za, { ...f, placement: e, open: l, afterOpenChange: (u) => !u && m() }) : g(ei, { ...f, visible: l, afterClose: m }) }); return g(_e.Provider, { value: { ele: o, mount: c, unmount: u }, children: e && e !== "center" ? g(Za, { ...f, placement: e, open: l, afterOpenChange: (d) => !d && m() }) : g(ei, { ...f, visible: l, afterClose: m }) });
}; };
Sn.propTypes = { placement: w.oneOf(["center", "left", "top", "right", "bottom"]) }; Sn.propTypes = { placement: w.oneOf(["center", "left", "top", "right", "bottom"]) };
const G = () => { const G = () => {
@ -949,9 +949,9 @@ const G = () => {
}); });
}, []); }, []);
const a = (r, o = {}, s = {}) => new Promise((l, p) => i([l, p], r, o, s)), i = ([r, o], s, l = {}, p = {}) => { const a = (r, o = {}, s = {}) => new Promise((l, p) => i([l, p], r, o, s)), i = ([r, o], s, l = {}, p = {}) => {
const c = G.$index++, d = (f) => ((m, u) => (G.$popups.delete(m), n(), u == null ? void 0 : u()))(c, () => r(f)); const c = G.$index++, u = (f) => ((m, d) => (G.$popups.delete(m), n(), d == null ? void 0 : d()))(c, () => r(f));
if (s === rn) return e.open({ ...p, key: c, content: S.createElement(s, { ...l, $close: () => e.close(c) }) }); if (s === rn) return e.open({ ...p, key: c, content: S.createElement(s, { ...l, $close: () => e.close(c) }) });
G.$popups.set(c, S.createElement(Sn, { maskClosable: !1, $event: l == null ? void 0 : l.$event, ...p, key: c, $close: d }, S.isValidElement(s) ? S.cloneElement(s, { ...l, $close: d }) : s != null && s.name || Bt.isForwardRef(s) || (s == null ? void 0 : s.$$typeof) === Bt.ForwardRef ? S.createElement(s, { ...l, $close: d }) : s)), n(); G.$popups.set(c, S.createElement(Sn, { maskClosable: !1, $event: l == null ? void 0 : l.$event, ...p, key: c, $close: u }, S.isValidElement(s) ? S.cloneElement(s, { ...l, $close: u }) : s != null && s.name || Bt.isForwardRef(s) || (s == null ? void 0 : s.$$typeof) === Bt.ForwardRef ? S.createElement(s, { ...l, $close: u }) : s)), n();
}; };
return E(S.Fragment, { children: [Array.from(G.$popups).map(([r, o]) => o), t] }); return E(S.Fragment, { children: [Array.from(G.$popups).map(([r, o]) => o), t] });
}; };
@ -974,7 +974,8 @@ const A = new (Qt = class {
constructor() { constructor() {
$(this, "appUrl", ""); $(this, "appUrl", "");
j(this, Ee, null); j(this, Ee, null);
return W(this, Ee, new ft()), new Proxy(y(this, Ee), { get: (e, t) => t === "init" ? this.init.bind(this) : t === "appUrl" ? this.appUrl : e[t] }); const e = this;
return W(e, Ee, new ft()), new Proxy(y(e, Ee), { get: (t, n) => n === "init" ? e.init : n === "appUrl" ? e.appUrl : t[n] });
} }
init(e, t, n) { init(e, t, n) {
Ae.defaults.baseURL = this.appUrl = n, Ae.defaults.timeout = 15e3, y(this, Ee).init(e, t, Ae); Ae.defaults.baseURL = this.appUrl = n, Ae.defaults.timeout = 15e3, y(this, Ee).init(e, t, Ae);

2
dist/components.js vendored
View File

@ -1,4 +1,4 @@
import { ao as p, af as s, ap as n, aq as t, an as d } from "./common/main-CVIH_kMK.js"; import { ao as p, af as s, ap as n, aq as t, an as d } from "./common/main-BjyTqb_P.js";
export { export {
p as Empty, p as Empty,
s as Icon, s as Icon,

2
dist/container.js vendored
View File

@ -1,4 +1,4 @@
import { ak as e, ao as s, ap as p, aq as n, al as t, an as d, am as r, aj as u } from "./common/main-CVIH_kMK.js"; import { ak as e, ao as s, ap as p, aq as n, al as t, an as d, am as r, aj as u } from "./common/main-BjyTqb_P.js";
export { export {
e as Context, e 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-CVIH_kMK.js"; import { D as p } from "./common/main-BjyTqb_P.js";
export { export {
p as default p as default
}; };

2
dist/data-list.js vendored
View File

@ -1,4 +1,4 @@
import { J as t, F as e, z as r, C as o, K as i, E as l, B as u, I as D, A as n, L, y as C, N as m, M as p, U as b, P as c, S as F, Q as d, T as O, O as S } from "./common/main-CVIH_kMK.js"; import { J as t, F as e, z as r, C as o, K as i, E as l, B as u, I as D, A as n, L, y as C, N as m, M as p, U as b, P as c, S as F, Q as d, T as O, O as S } from "./common/main-BjyTqb_P.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 { n as a } from "../common/main-CVIH_kMK.js"; import { n as a } from "../common/main-BjyTqb_P.js";
export { export {
a as getDefaultExpandRowKeys a as getDefaultExpandRowKeys
}; };

View File

@ -1,4 +1,4 @@
import { a5 as s, a7 as r, a6 as u, a4 as o, x as t, ac as m, aa as d, ab as F, ae as i, a9 as c, a8 as g, ad as l } from "./common/main-CVIH_kMK.js"; import { a5 as s, a7 as r, a6 as u, a4 as o, x as t, ac as m, aa as d, ab as F, ae as i, a9 as c, a8 as g, ad as l } from "./common/main-BjyTqb_P.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 { a as o, g } from "../common/main-CVIH_kMK.js"; import { a as o, g } from "../common/main-BjyTqb_P.js";
export { export {
o as getNormalizeWidget, o as getNormalizeWidget,
g as getOptionItemByValue g as getOptionItemByValue

2
dist/grid-layout.js vendored
View File

@ -1,4 +1,4 @@
import { o as u, q as e, p as r, H as t, G as d, v as o, x as i, w as G, s as y } from "./common/main-CVIH_kMK.js"; import { o as u, q as e, p as r, H as t, G as d, v as o, x as i, w as G, s as y } from "./common/main-BjyTqb_P.js";
export { export {
u as GridLayout, u as GridLayout,
e as GridLayoutFramework, e as GridLayoutFramework,

View File

@ -1,4 +1,4 @@
import { j as a, l, k as o } from "../common/main-CVIH_kMK.js"; import { j as a, l, k as o } from "../common/main-BjyTqb_P.js";
export { export {
a as getBoxStyle, a as getBoxStyle,
l as getNormalizeFields, l as getNormalizeFields,

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 { a1 as r, a0 as o, a2 as p, _ as f, $ as i, a3 as m, Z as c } from "./common/main-CVIH_kMK.js"; import { a1 as r, a0 as o, a2 as p, _ as f, $ as i, a3 as m, Z as c } from "./common/main-BjyTqb_P.js";
import { default as b } from "rc-util/lib/hooks/useMergedState"; import { default as b } 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 { af as a } from "./common/main-CVIH_kMK.js"; import { af as a } from "./common/main-BjyTqb_P.js";
export { export {
a as default a as default
}; };

2
dist/index.js vendored
View File

@ -1,4 +1,4 @@
import { az as t, aA as e, av as o, aw as n, ar as p, ax as r, au as c, at as u, as as f, ay as l } from "./common/main-CVIH_kMK.js"; import { az as t, aA as e, av as o, aw as n, ar as p, ax as r, au as c, at as u, as as f, ay as l } from "./common/main-BjyTqb_P.js";
export { export {
t as AppContext, t as AppContext,
e as AppGlobalParamsContext, e as AppGlobalParamsContext,

2
dist/pages.js vendored
View File

@ -1,4 +1,4 @@
import { W as t, V as e, X as o, Y as g } from "./common/main-CVIH_kMK.js"; import { W as t, V as e, X as o, Y as g } from "./common/main-BjyTqb_P.js";
export { export {
t as CustomPage, t as CustomPage,
e as DataListPage, e as DataListPage,

2
dist/res-ws.js vendored
View File

@ -1,5 +1,5 @@
import "lodash"; import "lodash";
import { R as a } from "./common/main-CVIH_kMK.js"; import { R as a } from "./common/main-BjyTqb_P.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 r, f as i, e as g, h as m, b as o, c as p, i as P, m as d, r as k, t as u, u as h } from "./common/main-CVIH_kMK.js"; import { d as r, f as i, e as g, h as m, b as o, c as p, i as P, m as d, r as k, t as u, u as h } from "./common/main-BjyTqb_P.js";
import "./common/vender-FNiQWFaA.js"; import "./common/vender-FNiQWFaA.js";
export { export {
r as deepSome, r as deepSome,

View File

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