diff --git a/dist/button.js b/dist/button.js index 70e1ba8..0f96096 100644 --- a/dist/button.js +++ b/dist/button.js @@ -1,4 +1,4 @@ -import { P as s, O as u, Q as e } from "./common/main-CxqrXb2v.js"; +import { P as s, O as u, Q as e } from "./common/main-C2XZS82Q.js"; import "prop-types"; export { s as auth, diff --git a/dist/common/main-CxqrXb2v.js b/dist/common/main-C2XZS82Q.js similarity index 90% rename from dist/common/main-CxqrXb2v.js rename to dist/common/main-C2XZS82Q.js index eb0dbf2..ea27998 100644 --- a/dist/common/main-CxqrXb2v.js +++ b/dist/common/main-C2XZS82Q.js @@ -183,12 +183,12 @@ const De = ut.getInstance(), Aa = (e, t, a, n, i) => { if (g.isEmpty(a) || g.isEmpty(t)) return !0; const i = t.map((r) => r == null ? void 0 : r[n]); return e.some(({ uuid: r }) => !r || !a.has(r) || a.get(r).some((s) => i.includes(s))); -}, [e, t, a, n]), za = ({ className: e, itemClassName: t, classNames: a = {}, dataSource: n, isPaginate: i, isItemOperations: r, isBatchOperations: s, batchOperations: o, itemOperations: l, itemOperationsAccess: u, resource: d, primaryKey: m, title: y, itemGridLayout: h, $setting: f, tabs: C, isConditionFormLayout: w, isTreeSider: E, treeSiderConfig: A }) => { +}, [e, t, a, n]), za = ({ className: e, itemClassName: t, classNames: a = {}, dataSource: n, isPaginate: i, isItemOperations: r, isBatchOperations: s, batchOperations: o, itemOperations: l, itemOperationsAccess: u, resource: d, primaryKey: m, title: f, itemGridLayout: h, $setting: y, tabs: C, isConditionFormLayout: w, isTreeSider: E, treeSiderConfig: A }) => { const { getBase62params: J, onClickCallback: W, onTabChange: I } = Ge(Le), { total: M, page: D, pageSize: K, tab: z } = J() || {}, G = ge((V, k, se) => c(Ba, { className: R("ff-data-list-framework-item", t), operations: r && k ? l == null ? void 0 : l.filter((L) => !(m && L.uuid && u.has(L.uuid)) || u.get(L.uuid).includes(k == null ? void 0 : k[m])) : [], data: d ? { [d]: k } : k, children: V, onClickCallback: W }), [d, m, r, W, l, u]); - return $("div", { className: R("ff-data-list-framework", e), children: [c(ta, { className: a == null ? void 0 : a.sider, isTreeSider: E, ...A }), $("div", { className: R("ff-data-list-container", a == null ? void 0 : a.container), children: [c(kt, { className: a == null ? void 0 : a.filter, isConditionFormLayout: w }), c(ea, { title: y, className: a == null ? void 0 : a.toolbar, tabs: C, tab: z, onTabChange: I }), c(Ya, { ...h, className: a == null ? void 0 : a.content, style: { "--col-num": (f == null ? void 0 : f.colNum) || 1 }, primaryKey: m, itemRender: G, dataSource: n }), c(aa, { className: a == null ? void 0 : a.footer, isPaginate: i, isOperations: s, operations: o, total: M, page: D, pageSize: K })] })] }); -}, Ba = ({ className: e, operations: t, children: a, data: n, onClickCallback: i }) => $("div", { className: R("data-list-grid-layout-item-container", e), children: [a, !!(t != null && t.length) && c("div", { className: "data-list-grid-layout-item-actions", children: t.map((r) => c("span", { className: "data-list-grid-layout-item-action", children: c(S.Link, { uuid: r.uuid, type: r.type, name: r.name, widget: r.widget, widgetType: r.widgetType, widgetProps: r.widgetProps, widgetSetting: r.widgetSetting, widgetContainerProps: r.widgetContainerSetting, data: n, onAfterClick: (s) => s !== !1 && (i == null ? void 0 : i(r.isRefresh, n)) }, r.uuid || useId()) }, (r == null ? void 0 : r.uuid) || useId())) })] }), Ua = ({ listCode: e, className: t, classNames: a = {}, itemClassName: n, dataSource: i, columns: r, isItemOperations: s, isBatchOperations: o, batchOperations: l, itemOperations: u, itemOperationsAccess: d, resource: m, primaryKey: y, title: h, tabs: f, isPaginate: C, isTreeSider: w, treeSiderConfig: E, isConditionFormLayout: A, ...J }) => { - const { getBase62params: W, onClickCallback: I, onTabChange: M } = Ge(Le), { total: D, page: K, tab: z, pageSize: G } = W() || {}, V = gt(u, i, d, y); - return $("div", { className: R("ff-data-table-framework", t), children: [c(ta, { className: a == null ? void 0 : a.sider, isTreeSider: w, ...E }), $("div", { className: R("ff-data-table-container", a == null ? void 0 : a.container), children: [c(kt, { listCode: e, isConditionFormLayout: A }), c(ea, { title: h, className: a == null ? void 0 : a.toolbar, tabs: f, tab: z, onTabChange: M }), c(Ha, { ...J, className: "ff-data-table-content", columns: r, dataSource: i, operationRender: V ? (k) => c("div", { className: "ff-data-table-actions", children: u == null ? void 0 : u.reduce((se, L, me) => [...se, c(S.Link, { size: "small", uuid: L.uuid, type: L.type, name: L.name, widget: L.widget, widgetType: L.widgetType, widgetProps: L.widgetProps, widgetData: L.widgetData, widgetSetting: L.widgetSetting, widgetContainerProps: L.widgetContainerSetting, data: k, onAfterClick: (Ne) => Ne !== !1 && (I == null ? void 0 : I(L.isRefresh, data)) }, L.uuid || me)], []) }) : null }), c(aa, { isPaginate: C, isOperations: o, operations: l, total: D, page: K, pageSize: G })] })] }); + return $("div", { className: R("ff-data-list-framework", e), children: [c(ta, { className: a == null ? void 0 : a.sider, isTreeSider: E, ...A }), $("div", { className: R("ff-data-list-container", a == null ? void 0 : a.container), children: [c(kt, { className: a == null ? void 0 : a.filter, isConditionFormLayout: w }), c(ea, { title: f, className: a == null ? void 0 : a.toolbar, tabs: C, tab: z, onTabChange: I }), c(Ya, { ...h, className: a == null ? void 0 : a.content, style: { "--col-num": (y == null ? void 0 : y.colNum) || 1 }, primaryKey: m, itemRender: G, dataSource: n }), c(aa, { className: a == null ? void 0 : a.footer, isPaginate: i, isOperations: s, operations: o, total: M, page: D, pageSize: K })] })] }); +}, Ba = ({ className: e, operations: t, children: a, data: n, onClickCallback: i }) => $("div", { className: R("data-list-grid-layout-item-container", e), children: [a, !!(t != null && t.length) && c("div", { className: "data-list-grid-layout-item-actions", children: t.map((r) => c("span", { className: "data-list-grid-layout-item-action", children: c(S.Link, { uuid: r.uuid, type: r.type, name: r.name, widget: r.widget, widgetType: r.widgetType, widgetProps: r.widgetProps, widgetSetting: r.widgetSetting, widgetContainerProps: r.widgetContainerSetting, data: n, onAfterClick: (s) => s !== !1 && (i == null ? void 0 : i(r.isRefresh, n)) }, r.uuid || useId()) }, (r == null ? void 0 : r.uuid) || useId())) })] }), Ua = ({ listCode: e, className: t, classNames: a = {}, itemClassName: n, dataSource: i, columns: r, isItemOperations: s, isBatchOperations: o, batchOperations: l, itemOperations: u, itemOperationsAccess: d, resource: m, primaryKey: f, title: h, tabs: y, isPaginate: C, isTreeSider: w, treeSiderConfig: E, isConditionFormLayout: A, ...J }) => { + const { getBase62params: W, onClickCallback: I, onTabChange: M } = Ge(Le), { total: D, page: K, tab: z, pageSize: G } = W() || {}, V = gt(u, i, d, f); + return $("div", { className: R("ff-data-table-framework", t), children: [c(ta, { className: a == null ? void 0 : a.sider, isTreeSider: w, ...E }), $("div", { className: R("ff-data-table-container", a == null ? void 0 : a.container), children: [c(kt, { listCode: e, isConditionFormLayout: A }), c(ea, { title: h, className: a == null ? void 0 : a.toolbar, tabs: y, tab: z, onTabChange: M }), c(Ha, { ...J, className: "ff-data-table-content", columns: r, dataSource: i, operationRender: V ? (k) => c("div", { className: "ff-data-table-actions", children: u == null ? void 0 : u.reduce((se, L, me) => [...se, c(S.Link, { size: "small", uuid: L.uuid, type: L.type, name: L.name, widget: L.widget, widgetType: L.widgetType, widgetProps: L.widgetProps, widgetData: L.widgetData, widgetSetting: L.widgetSetting, widgetContainerProps: L.widgetContainerSetting, data: k, onAfterClick: (Ne) => Ne !== !1 && (I == null ? void 0 : I(L.isRefresh, data)) }, L.uuid || me)], []) }) : null }), c(aa, { isPaginate: C, isOperations: o, operations: l, total: D, page: K, pageSize: G })] })] }); }, Le = b.createContext({ listCode: "", getBase62params: (e, t) => { }, onReload: () => { }, onClickCallback: () => { @@ -198,14 +198,14 @@ const De = ut.getInstance(), Aa = (e, t, a, n, i) => { }, onKeywordChange: () => { }, onPageChange: () => { }, onPageSizeChange: () => { -} }), Da = ({ isItemGridLayout: e, theme: t, themeProps: a, onClickCallback: n, onReload: i, getBase62params: r, listCode: s, onPageChange: o, onPageSizeChange: l, onTabChange: u, onSiderChange: d, onKeywordChange: m, onConditonChange: y, ...h }) => { - const [f, C] = P(); +} }), Da = ({ isItemGridLayout: e, theme: t, themeProps: a, onClickCallback: n, onReload: i, getBase62params: r, listCode: s, onPageChange: o, onPageSizeChange: l, onTabChange: u, onSiderChange: d, onKeywordChange: m, onConditonChange: f, ...h }) => { + const [y, C] = P(); return N(() => { t ? X.getWidgetComponent(t).then((w) => { if (!w) throw `${t} not found`; return w; - }).catch((w) => ({ default: () => `${w}` })).then((w) => C(b.createElement(w.default, { ...h, $setting: a }))) : f || C(null); - }, [t, a]), c(Le.Provider, { value: { listCode: s, onClickCallback: n, onReload: i, getBase62params: r, onPageChange: o, onPageSizeChange: l, onTabChange: u, onSiderChange: d, onKeywordChange: m, onConditonChange: y }, children: f ? b.cloneElement(f, { ...h, $setting: a }) : c(e ? za : Ua, { ...h, $setting: a }) }); + }).catch((w) => ({ default: () => `${w}` })).then((w) => C(b.createElement(w.default, { ...h, $setting: a }))) : y || C(null); + }, [t, a]), c(Le.Provider, { value: { listCode: s, onClickCallback: n, onReload: i, getBase62params: r, onPageChange: o, onPageSizeChange: l, onTabChange: u, onSiderChange: d, onKeywordChange: m, onConditonChange: f }, children: y ? b.cloneElement(y, { ...h, $setting: a }) : c(e ? za : Ua, { ...h, $setting: a }) }); }; var we, ue, Oe, at; const ae = class ae { @@ -232,11 +232,11 @@ const ae = class ae { we = new WeakMap(), ue = new WeakMap(), Oe = new WeakMap(), at = new WeakMap(), F(ae, we, null), v(ae, "getInstance", () => (p(ae, we) || B(ae, we, new ae()), p(ae, we))); let pt = ae; const Xt = pt.getInstance(), vt = b.forwardRef(({ listCode: e, base62params: t, className: a, itemClassName: n, theme: i, themeProps: r, classNames: s }, o) => { - const l = oa(), u = Q(t), d = Q(/* @__PURE__ */ new Map()), m = Q([]), [{ resource: y, primaryKey: h, batchOperations: f = [], itemOperations: C = [], columns: w = [], themeConfig: E, theme: A, isConditionFormLayout: J = !1, isTreeSider: W, treeSiderConfig: I, isItemGridLayout: M, itemGridLayout: D, title: K, isPaginate: z, tabs: G }, V] = P({ isItemGridLayout: !1, itemGridLayout: {} }), k = g.throttle((T) => { + const l = oa(), u = Q(t), d = Q(/* @__PURE__ */ new Map()), m = Q([]), [{ resource: f, primaryKey: h, batchOperations: y = [], itemOperations: C = [], columns: w = [], themeConfig: E, theme: A, isConditionFormLayout: J = !1, isTreeSider: W, treeSiderConfig: I, isItemGridLayout: M, itemGridLayout: D, title: K, isPaginate: z, tabs: G }, V] = P({ isItemGridLayout: !1, itemGridLayout: {} }), k = g.throttle((T) => { m.current = [], x.list(e, g.pick({ ...u.current, ...T }, ["tab", "page", "pageSize", "condition", "sider", "keyword"])).then(({ keyword: U, condition: Ve, total: xe, tab: he, sider: Ee, page: oe, pageSize: le, operationsAccess: ce, dataSource: Te }) => { u.current = { tab: he, condition: Ve, sider: Ee, keyword: U, total: xe, pageSize: le, page: Te != null && Te.length ? oe : 1 }, m.current = Te, d.current = new Map(ce), l(); }); - }, 380, { leading: !1, trailing: !0 }), se = gt(C, m.current, d.current, h), L = gt(f); + }, 380, { leading: !1, trailing: !0 }), se = gt(C, m.current, d.current, h), L = gt(y); N(() => { let T = null; return e && x.get(`/api/_/${e}`).resp(({ data: U, res: Ve }) => { @@ -249,7 +249,7 @@ const Xt = pt.getInstance(), vt = b.forwardRef(({ listCode: e, base62params: t, k(); }, Ne = (T = 0, U = null) => { if (T === 2) { - const Ve = g.get(U, "__PARENT_ID__", ""), xe = g.get(U, h, g.get(U, [y, h], "")), he = g.findIndex(m.current, ["__PARENT_ID__", Ve]), Ee = g.findIndex(he > -1 ? g.get(m.current, [he, "children"]) : m.current, [h, xe]); + const Ve = g.get(U, "__PARENT_ID__", ""), xe = g.get(U, h, g.get(U, [f, h], "")), he = g.findIndex(m.current, ["__PARENT_ID__", Ve]), Ee = g.findIndex(he > -1 ? g.get(m.current, [he, "children"]) : m.current, [h, xe]); Ee > -1 ? (x.get(`/api/${e}/detail/${xe}`).then((oe) => { const le = g.get(m.current, he > -1 ? [he, "children", Ee, "children"] : [Ee, "children"]); m.current = Tt(m.current, he > -1 ? { [he]: { children: { $splice: [[Ee, 1, { ...oe, children: le }]] } } } : { $splice: [[Ee, 1, { ...oe, children: le }]] }), l(); @@ -264,26 +264,26 @@ const Xt = pt.getInstance(), vt = b.forwardRef(({ listCode: e, base62params: t, } else T === 1 && me(); }; b.useImperativeHandle(o, () => ({ onReload: me, onClickCallback: Ne })); - const it = { listCode: e, title: K, itemClassName: n, classNames: s, resource: y, primaryKey: h, theme: i || A, themeProps: r || E, isTreeSider: W, treeSiderConfig: I, isPaginate: z, tabs: G, isItemOperations: se, isBatchOperations: L, batchOperations: f, itemOperations: C, isItemGridLayout: M, columns: w, itemGridLayout: D, isConditionFormLayout: J, itemOperationsAccess: d.current, dataSource: m.current }; + const it = { listCode: e, title: K, itemClassName: n, classNames: s, resource: f, primaryKey: h, theme: i || A, themeProps: r || E, isTreeSider: W, treeSiderConfig: I, isPaginate: z, tabs: G, isItemOperations: se, isBatchOperations: L, batchOperations: y, itemOperations: C, isItemGridLayout: M, columns: w, itemGridLayout: D, isConditionFormLayout: J, itemOperationsAccess: d.current, dataSource: m.current }; return c(Da, { ...it, className: R("ff-data-list-helper", a), getBase62params: (T, U, Ve = !1) => T == "init" ? t : T ? g.get(u.current, T, U) : u.current, onReload: me, onClickCallback: Ne, onConditonChange: (T, U) => k({ keyword: U, condition: Tt(u.current.condition || {}, { $merge: T || {} }), page: 1 }), onTabChange: (T) => k({ tab: T, page: 1 }), onSiderChange: (T) => k({ sider: T, page: 1 }), onKeywordChange: (T) => k({ keyword: T, page: 1 }), onPageChange: (T, U) => k({ page: T, pageSize: U }), onPageSizeChange: (T) => k({ pageSize: T, page: 1 }) }); }), Zt = (e, t, a, n, i = {}, r = 0) => { const s = { "--grid-layout-h": `${n}`, "--grid-layout-w": `${a}`, "--grid-layout-x": `${e}`, "--grid-layout-y": `${t}`, "--grid-layout-row-height-offset": "0px" }; return i != null && i.autoHeight ? s.height = "fit-content" : s["--grid-layout-row"] = `${n}`, s["--grid-layout-box-margin"] = Ot(i == null ? void 0 : i.marginTop, i == null ? void 0 : i.marginRight, i == null ? void 0 : i.marginBottom, i == null ? void 0 : i.marginLeft), s["--grid-layout-box-padding"] = Ot(i == null ? void 0 : i.paddingTop, i == null ? void 0 : i.paddingRight, i == null ? void 0 : i.paddingBottom, i == null ? void 0 : i.paddingLeft), r && (s.height = `${r}px`), s; }, Ot = (e, t, a, n) => `${e || 0}px ${t || 0}px ${a || 0}px ${n || 0}px`, kt = ({ className: e, isConditionFormLayout: t }) => { - var m, y; + var m, f; const [a, n] = P({}), { listCode: i, onKeywordChange: r, onConditonChange: s, getBase62params: o } = b.useContext(Le), { keyword: l, condition: u } = o() || {}, [d] = Ze.useForm(); return N(() => { - i && t && x.get(`/api/_/${i}/list-condition-form-layout`).then(({ resource: h, marginX: f, marginY: C, rowHeight: w, cols: E, fields: A }) => { - n({ resource: h, itemMargin: [f, C], rowHeight: w, cols: E, fields: A }); + i && t && x.get(`/api/_/${i}/list-condition-form-layout`).then(({ resource: h, marginX: y, marginY: C, rowHeight: w, cols: E, fields: A }) => { + n({ resource: h, itemMargin: [y, C], rowHeight: w, cols: E, fields: A }); }).catch(() => n({})); }, [i, t]), N(() => { d.setFieldsValue({ keyword: l, ...u }); }, [JSON.stringify([l, u])]), c("div", { className: R("ff-data-list-filter", e), children: c(Ze, { form: d, layout: "vertical", autoComplete: "off", onFinish: ((m = a.fields) == null ? void 0 : m.length) > 1 ? (h) => s({ [a.resource]: h[a.resource] }, h.keyword) : () => { }, onValuesChange: (h) => { g.isEmpty(g.omit(h, ["keyword"])) || d.submit(); - }, children: ((y = a.fields) == null ? void 0 : y.length) > 1 ? c(St, { ...a, children: c(Wa, { onReset: () => { - const { keyword: h, condition: f } = o("init") || {}; - d.setFieldsValue({ keyword: h, ...f }); + }, children: ((f = a.fields) == null ? void 0 : f.length) > 1 ? c(St, { ...a, children: c(Wa, { onReset: () => { + const { keyword: h, condition: y } = o("init") || {}; + d.setFieldsValue({ keyword: h, ...y }); } }) }) : c("div", { className: "ff-data-list-filter-default-form ff-grid-layout-form", children: c("div", { className: "grid-layout-item", style: Zt(20, 0, 5, 2), children: c(Ze.Item, { name: ["keyword"], children: c(ha.Search, { allowClear: !0, enterButton: "搜索", placeholder: "多关键字 | 分割", onSearch: (h) => r(h) }) }) }) }) }) }); }, Wa = ({ cols: e, fields: t, onReset: a }) => { const [n, i] = P(!1), r = pe(() => t == null ? void 0 : t.toReversed().some((s) => s.y > 1 || s.x + s.w >= e - 5), [e, t]); @@ -295,37 +295,37 @@ const ea = ({ className: e, title: t, tabs: a, tab: n, onTabChange: i }) => { return $("div", { className: R("ff-data-list-toolbar", e), children: [c("div", { className: "ff-data-list-title", children: t }), c(fa, { className: "ff-data-list-tabs", itemRender: ({ label: o, code: l }) => c("span", { onClick: () => s(l), className: R("ff-data-list-tab", { active: l == r }), children: o }), items: a }), $("div", { className: "ff-data-list-actions", children: [c(S.Link, { icon: "icon-reload" }), c(S.Link, { icon: "icon-setting" })] })] }); }, qa = [{ 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: c("span", { style: { color: "#1677ff" }, children: "sss" }), key: "0-0-1-0" }] }] }], ta = ({ className: e, width: t = 280, isTreeSider: a }) => a ? c(ya.DirectoryTree, { className: R("ff-data-list-sider", e), style: { "--sider-width": t }, showLine: !0, showIcon: !1, treeData: qa }) : null, aa = ({ className: e, operations: t, isOperations: a, isPaginate: n, total: i, page: r, pageSize: s }) => { const { onPageChange: o, onPageSizeChange: l, onClickCallback: u } = b.useContext(Le); - return a && !g.isEmpty(t) || n ? $("div", { className: R("ff-data-list-footer", e), children: [c("div", { className: "ff-data-list-actions", children: t == null ? void 0 : t.map((d, m) => c(S, { uuid: d.uuid, type: d.type, name: d.name, widget: d.widget, widgetType: d.widgetType, widgetProps: d.widgetProps, widgetData: d.widgetData, widgetSetting: d.widgetSetting, widgetContainerProps: d.widgetContainerSetting, onAfterClick: (y) => y !== !1 && (u == null ? void 0 : u(d.isRefresh, null)) }, d.uuid || m)) }), n && c(wa, { size: "small", total: i, pageSize: s, showSizeChanger: !1, showTotal: (d) => `第 ${r} 页 / 总共 ${d} 条`, onChange: o, onShowSizeChange: l })] }) : null; + return a && !g.isEmpty(t) || n ? $("div", { className: R("ff-data-list-footer", e), children: [c("div", { className: "ff-data-list-actions", children: t == null ? void 0 : t.map((d, m) => c(S, { uuid: d.uuid, type: d.type, name: d.name, widget: d.widget, widgetType: d.widgetType, widgetProps: d.widgetProps, widgetData: d.widgetData, widgetSetting: d.widgetSetting, widgetContainerProps: d.widgetContainerSetting, onAfterClick: (f) => f !== !1 && (u == null ? void 0 : u(d.isRefresh, null)) }, d.uuid || m)) }), n && c(wa, { size: "small", total: i, pageSize: s, showSizeChanger: !1, showTotal: (d) => `第 ${r} 页 / 总共 ${d} 条`, onChange: o, onShowSizeChange: l })] }) : null; }, na = (e, t, a = !0) => a !== !0 && a-- <= 0 ? [] : g.isArray(e) && !g.isEmpty(e) ? e.reduce((n, i) => (Reflect.has(i, t) && Reflect.has(i, "children") && n.push(i[t]), Reflect.has(i, "children") && !g.isEmpty(i.children) ? n.concat(na(i.children, t, a)) : n), []) : [], Ha = ({ className: e, primaryKey: t, columns: a = [], dataSource: n = [], operationRender: i, operationWidth: r = 180, ...s }) => { Dt(); - const o = Q(null), l = Q(null), [u, d] = P([]), [m, y] = P({ width: 0, height: 0 }); + const o = Q(null), l = Q(null), [u, d] = P([]), [m, f] = P({ width: 0, height: 0 }); N(() => { d(na(n, t)); }, [n, t]), ma(() => { - const f = new ResizeObserver(() => { + const y = new ResizeObserver(() => { var C; - y({ width: ((C = o.current) == null ? void 0 : C.nativeElement.querySelector(".ant-table-body").scrollWidth) || l.current.offsetWidth, height: l.current.offsetHeight }); + f({ width: ((C = o.current) == null ? void 0 : C.nativeElement.querySelector(".ant-table-body").scrollWidth) || l.current.offsetWidth, height: l.current.offsetHeight }); }); - return l.current && f.observe(l.current), () => { - l.current && f.unobserve(l.current); + return l.current && y.observe(l.current), () => { + l.current && y.unobserve(l.current); }; }, []); const h = Ma(a); - return c("div", { ref: l, className: R("ff-data-list-table", e), children: m.height ? c(ba, { ...s, ref: o, rowKey: (f) => (f == null ? void 0 : f[t]) ?? Math.random(), columns: h == null ? void 0 : h.concat(i ? [{ title: "操作", align: "center", fixed: "right", width: `${Math.ceil(r / m.width * 100).toFixed(2)}%`, render: (f, C, w) => i(C, w) }] : []), dataSource: n, size: "middle", scroll: { x: "max-content", y: m.height - 50 }, pagination: !1, expandable: { defaultExpandAllRows: !0, expandRowByClick: !0, onExpandedRowsChange: d, expandedRowKeys: u } }) : null }); + return c("div", { ref: l, className: R("ff-data-list-table", e), children: m.height ? c(ba, { ...s, ref: o, rowKey: (y) => (y == null ? void 0 : y[t]) ?? Math.random(), columns: h == null ? void 0 : h.concat(i ? [{ title: "操作", align: "center", fixed: "right", width: `${Math.ceil(r / m.width * 100).toFixed(2)}%`, render: (y, C, w) => i(C, w) }] : []), dataSource: n, size: "middle", scroll: { x: "max-content", y: m.height - 50 }, pagination: !1, expandable: { defaultExpandAllRows: !0, expandRowByClick: !0, onExpandedRowsChange: d, expandedRowKeys: u } }) : null }); }, Ja = "RC_FORM_INTERNAL_HOOKS", ia = (e, { initialValue: t, initialValueLanguage: a, convertJs: n, convertJsSetting: i, type: r = "string" }, s = null) => { - const o = Q(!1), l = Ge($a), [u, d] = P(), [m, y] = P(a != "javascript" && e ? l.getFieldValue(e) : void 0), { registerWatch: h } = l.getInternalHooks(Ja) || {}; - return N(() => h == null ? void 0 : h((f, C, w) => { + const o = Q(!1), l = Ge($a), [u, d] = P(), [m, f] = P(a != "javascript" && e ? l.getFieldValue(e) : void 0), { registerWatch: h } = l.getInternalHooks(Ja) || {}; + return N(() => h == null ? void 0 : h((y, C, w) => { if (!o.current) return; const E = g.get(C, e); - g.isEqual(E, m) || y(g.toPrimitive(E, r)); + g.isEqual(E, m) || f(g.toPrimitive(E, r)); }), [m]), N(() => { - a == "javascript" && t ? $e.exec(t, {}, { getFieldValueForBasicForm: (f) => s ? s.getFieldValue(f) : l.getFieldValue(f), getFieldValue: (f) => l.getFieldValue(f) }).then((f) => y(g.toPrimitive(f, r))).catch((f) => notification.error({ message: `布局数据错误: ${JSON.stringify(f)}` })).finally(() => o.current = !0) : (t && y(g.toPrimitive(t ?? l.getFieldValue(e), r)), o.current = !0); + a == "javascript" && t ? $e.exec(t, {}, { getFieldValueForBasicForm: (y) => s ? s.getFieldValue(y) : l.getFieldValue(y), getFieldValue: (y) => l.getFieldValue(y) }).then((y) => f(g.toPrimitive(y, r))).catch((y) => notification.error({ message: `布局数据错误: ${JSON.stringify(y)}` })).finally(() => o.current = !0) : (t && f(g.toPrimitive(t ?? l.getFieldValue(e), r)), o.current = !0); }, [t, a]), Ye(() => { - o.current && n && X.getWidgetComponent(n).then(({ default: f }) => f({ value: m, record: l.getFieldsValue(!0), $setting: i })).then(d).catch((f) => console.error("布局数据转换错误: ", f, n)); + o.current && n && X.getWidgetComponent(n).then(({ default: y }) => y({ value: m, record: l.getFieldsValue(!0), $setting: i })).then(d).catch((y) => console.error("布局数据转换错误: ", y, n)); }, [m, n, i]), [u || m, m]; }, ra = (e, t, a = "@pkg/grid-layouts", n = null) => pe(() => { var i; - return (i = g.sortBy(e, ["y", "x"])) == null ? void 0 : i.map(({ i: r, x: s, y: o, w: l, h: u, field: { boxStyle: d, widgetPrefix: m = a, widget: y, ...h } }, f) => c("div", { className: "grid-layout-item", style: Zt(s, o, l, u, d, y === "Height" && (h == null ? void 0 : h.initialValue)), children: c(Ka, { ...h, basicForm: n, itemWidget: y != null && y.startsWith("@") ? y : `${m}/${y}`, itemWidgetRender: t }) }, r || f)); + return (i = g.sortBy(e, ["y", "x"])) == null ? void 0 : i.map(({ i: r, x: s, y: o, w: l, h: u, field: { boxStyle: d, widgetPrefix: m = a, widget: f, ...h } }, y) => c("div", { className: "grid-layout-item", style: Zt(s, o, l, u, d, f === "Height" && (h == null ? void 0 : h.initialValue)), children: c(Ka, { ...h, basicForm: n, itemWidget: f != null && f.startsWith("@") ? f : `${m}/${f}`, itemWidgetRender: t }) }, r || y)); }, [e]), Ka = ({ itemWidget: e, itemWidgetRender: t, basicForm: a, ...n }) => { const [i, r] = P(); return N(() => { @@ -341,8 +341,8 @@ const ea = ({ className: e, title: t, tabs: a, tab: n, onTabChange: i }) => { u.setFieldsValue(n); }, [n]), c(re, { fields: m, form: u, component: !1, children: c("div", { ...l, className: R("ff-grid-layout", o), style: { "--grid-layout-item-margin-y": `${(r == null ? void 0 : r[0]) || 0}px`, "--grid-layout-item-margin-x": `${(r == null ? void 0 : r[1]) || 0}px`, "--grid-layout-container-padding-y": `${(i == null ? void 0 : i[0]) || 0}px`, "--grid-layout-container-padding-x": `${(i == null ? void 0 : i[1]) || 0}px`, "--grid-layout-cols": e, "--grid-layout-row-height": `${t}px` }, children: d }) }); }, Ga = (e, t = {}, a = null) => (n) => { - const { code: i, label: r, extras: s, isVirtual: o, initialValue: l, initialValueLanguage: u, convertJs: d, convertJsSetting: m, ...y } = g.merge({}, t, n), [h, f] = ia(o ? null : i, { initialValue: l, initialValueLanguage: u, convertJs: d, convertJsSetting: m, type: (y == null ? void 0 : y.type) || "string" }, a); - return c(e, { ...y, value: h, rawValue: f, $setting: s || {} }); + const { code: i, label: r, extras: s, isVirtual: o, initialValue: l, initialValueLanguage: u, convertJs: d, convertJsSetting: m, ...f } = g.merge({}, t, n), [h, y] = ia(o ? null : i, { initialValue: l, initialValueLanguage: u, convertJs: d, convertJsSetting: m, type: (f == null ? void 0 : f.type) || "string" }, a); + return c(e, { ...f, value: h, rawValue: y, $setting: s || {} }); }, Kn = (Lt = sa, function({ code: e, data: t, ...a }) { const [n, i] = P({ resource: null, cols: 12, rowHeight: 21, fields: [] }); return N(() => { @@ -356,11 +356,11 @@ const Gn = ({ widget: e, widgetPrefix: t = "@pkg/grid-layouts", basicForm: a, .. i && X.getWidgetComponent(i).then(({ defaultProps: o = {}, default: l }) => ({ default: _a(l, o, a) })).catch((o) => ({ default: () => `${o}` })).then((o) => s(b.createElement(o.default, n))); }, [i]), r; }, _a = (e, t = {}, a = null) => (n) => { - const { code: i, label: r, extras: s, isVirtual: o, initialValue: l, initialValueLanguage: u, convertJs: d, convertJsSetting: m, value: y, ...h } = g.merge({}, t, n), [f, C] = ia(o ? null : i, { initialValue: l, initialValueLanguage: u, convertJs: d, convertJsSetting: m, type: (h == null ? void 0 : h.type) || "string" }, a); - return c(e, { ...h, value: f, rawValue: C, $setting: s || {} }); -}, Ya = ({ cols: e, rowHeight: t, itemMargin: a, fields: n, primaryKey: i, dataSource: r, itemClassName: s, itemRender: o = (m, y, h) => m, empty: l = c(Ca, { description: null }), className: u, style: d = {} }) => { - const m = Dt(), y = pe(() => c(sa, { cols: e, rowHeight: t, itemMargin: a, fields: n, className: s }), [n, e, t, a]); - return c("div", { className: R("ff-data-list-content", u), style: d, children: g.isEmpty(r) ? l : r == null ? void 0 : r.map((h, f) => c(b.Fragment, { children: o(b.cloneElement(y, { data: h }), h, f) }, `${m}-${(h == null ? void 0 : h[i]) || f}`)) }); + const { code: i, label: r, extras: s, isVirtual: o, initialValue: l, initialValueLanguage: u, convertJs: d, convertJsSetting: m, value: f, ...h } = g.merge({}, t, n), [y, C] = ia(o ? null : i, { initialValue: l, initialValueLanguage: u, convertJs: d, convertJsSetting: m, type: (h == null ? void 0 : h.type) || "string" }, a); + return c(e, { ...h, value: y, rawValue: C, $setting: s || {} }); +}, Ya = ({ cols: e, rowHeight: t, itemMargin: a, fields: n, primaryKey: i, dataSource: r, itemClassName: s, itemRender: o = (m, f, h) => m, empty: l = c(Ca, { description: null }), className: u, style: d = {} }) => { + const m = Dt(), f = pe(() => c(sa, { cols: e, rowHeight: t, itemMargin: a, fields: n, className: s }), [n, e, t, a]); + return c("div", { className: R("ff-data-list-content", u), style: d, children: g.isEmpty(r) ? l : r == null ? void 0 : r.map((h, y) => c(b.Fragment, { children: o(b.cloneElement(f, { data: h }), h, y) }, `${m}-${(h == null ? void 0 : h[i]) || y}`)) }); }, Qa = ({ component: e }) => { const { base62params: t } = Na(); return c(H, { children: c(vt, { listCode: e, base62params: x.decode(t) }) }); @@ -436,14 +436,14 @@ const ne = class ne { if (p(this, Z).size == 0) return null; const a = De.get("Common.WEBSITE_DEFAULT_THEME", "@pkg/frameworks/BasicLayout"), n = De.get(X.checkUserToken() ? "Common.WEBSITE_LOGIN_REDIRECT" : "Common.WEBSITE_DEFAULT", "/index"), i = { [a]: 0 }, r = (o, l) => () => X.getWidgetComponent(o).then((u) => u.default || function() { return `${o}`; - }).then((u) => ({ Component: () => b.createElement(Kt, {}, b.createElement(u, l)) })), s = Array.from(p(this, Z).values()).reduce((o, { uuid: l, uri: u, name: d, type: m, component: y, widgetSetting: h, isLogin: f, isLayout: C, extra: w }) => { + }).then((u) => ({ Component: () => b.createElement(Kt, {}, b.createElement(u, l)) })), s = Array.from(p(this, Z).values()).reduce((o, { uuid: l, uri: u, name: d, type: m, component: f, widgetSetting: h, isLogin: y, isLayout: C, extra: w }) => { let E = {}, A = 0; switch (m) { case "list": - E.element = b.createElement(Qa, { component: y }); + E.element = b.createElement(Qa, { component: f }); break; case "fsdpf-component": - E.element = b.createElement(Za, { key: y, component: y, $setting: h }); + E.element = b.createElement(Za, { key: f, component: f, $setting: h }); } if (w != null && w.layout) { if (!i[w == null ? void 0 : w.layout]) return i[w == null ? void 0 : w.layout] = o.length, [...o, { path: "/", lazy: r(w == null ? void 0 : w.layout, {}), children: [{ path: u, ...E }] }]; @@ -532,7 +532,7 @@ const $e = ht.getInstance(), oa = () => { }, an = (e) => { const [t, a] = b.useState({ gridItems: [], hideItems: [] }); return b.useEffect(() => { - e && x.get(`/api/_/${e}`).then(({ pk: n, uuid: i, code: r, resource: s, align: o, cols: l, rowHeight: u, marginX: d, marginY: m, listenChangeFields: y, listenChangeFieldsFunc: h, fields: f }) => ({ pk: n, uuid: i, code: r, resource: s, align: o, cols: l, rowHeight: u, marginX: d, marginY: m, listenChangeFields: y, listenChangeFieldsFunc: h, ...f.reduce((C, w) => { + e && x.get(`/api/_/${e}`).then(({ pk: n, uuid: i, code: r, resource: s, align: o, cols: l, rowHeight: u, marginX: d, marginY: m, listenChangeFields: f, listenChangeFieldsFunc: h, fields: y }) => ({ pk: n, uuid: i, code: r, resource: s, align: o, cols: l, rowHeight: u, marginX: d, marginY: m, listenChangeFields: f, listenChangeFieldsFunc: h, ...y.reduce((C, w) => { var E; return (E = w == null ? void 0 : w.field) != null && E.hidden ? C.hides.push(w == null ? void 0 : w.field) : C.items.push(w), C; }, { items: [], hides: [] }) })).then(a); @@ -542,19 +542,19 @@ const $e = ht.getInstance(), oa = () => { return N(() => { const m = []; if (r) { - let y = l; + let f = l; switch (l) { case "number": case "string": case "array": break; case "bool": - y = "boolean"; + f = "boolean"; break; case "json": - y = "object"; + f = "object"; } - m.push({ type: y, required: !0, whitespace: !0, message: "该项必填" }); + m.push({ type: f, required: !0, whitespace: !0, message: "该项必填" }); } switch (a) { case "string": @@ -564,8 +564,8 @@ const $e = ht.getInstance(), oa = () => { m.push({ type: "string", pattern: i, message: n }); break; case "validator": - s && m.push(({ getFieldValue: y }) => ({ validator: async (h, f) => { - const C = await $e.exec(s, { value: f, fieldName: o }, { getFieldValue: y }); + s && m.push(({ getFieldValue: f }) => ({ validator: async (h, y) => { + const C = await $e.exec(s, { value: y, fieldName: o }, { getFieldValue: f }); return g.isString(C) && C ? Promise.reject(C) : g.isBoolean(C) && !C ? Promise.reject(n) : Promise.resolve(); } })); } @@ -582,7 +582,7 @@ const $e = ht.getInstance(), oa = () => { }, sn = (e, t, a, n = {}) => { const i = oa(), r = Q(!0), s = Q([]), [o, l] = P(a), u = re.useWatch((d) => JSON.stringify(g.pick(d, s.current)), t) || "{}"; return N(() => { - e && $e.exec(e, n, { getFieldValue: g.wrap(t.getFieldValue, (d, m) => (s.current.some((y) => g.isEqual(y, m)) || (s.current.push(m), i()), d(m))), isFieldTouched: t.isFieldTouched, isFieldsTouched: t.isFieldsTouched }).then((d) => r.current && l(d)); + e && $e.exec(e, n, { getFieldValue: g.wrap(t.getFieldValue, (d, m) => (s.current.some((f) => g.isEqual(f, m)) || (s.current.push(m), i()), d(m))), isFieldTouched: t.isFieldTouched, isFieldsTouched: t.isFieldsTouched }).then((d) => r.current && l(d)); }, [e, u, t, n]), N(() => () => r.current = !1, []), o; }, on = ({ type: e, initialValue: t, initialValueLanguage: a, onChange: n, form: i }) => { const r = sn(a == "javascript" && t, i, a == "javascript" ? void 0 : t, {}); @@ -595,8 +595,8 @@ const $e = ht.getInstance(), oa = () => { s && X.getWidgetComponent(s).then(({ defaultProps: u = {}, default: d }) => ({ default: ca(d, u, i) })).catch((u) => ({ default: () => `${u}` })).then((u) => l(b.createElement(u.default, r))); }, [s]), o && b.cloneElement(o, r); }, ca = (e, t = {}, a = null) => (n) => { - const { type: i, code: r, label: s, noStyle: o, placeholder: l, extras: u, validators: d, help: m, isVirtual: y, $isReserved: h, initialValue: f, initialValueLanguage: C, convertJs: w, convertJsSetting: E, widgetPerfix: A, boxStyle: J, widgetDecorator: W, subWidgets: I, ...M } = { ...t, ...n }, D = nn(d || {}, r, i), K = { label: s, noStyle: o, colon: !1, layout: "vertical" }, z = { placeholder: l, ...M }, G = ge((V) => V == null ? void 0 : g.toPrimitive(V, i), [i]); - return c(Wt, { name: r, rules: D, initialValue: G(f), normalize: G, children: (V, k, se) => { + const { type: i, code: r, label: s, noStyle: o, placeholder: l, extras: u, validators: d, help: m, isVirtual: f, $isReserved: h, initialValue: y, initialValueLanguage: C, convertJs: w, convertJsSetting: E, widgetPerfix: A, boxStyle: J, widgetDecorator: W, subWidgets: I, ...M } = { ...t, ...n }, D = nn(d || {}, r, i), K = { label: s, noStyle: o, colon: !1, layout: "vertical" }, z = { placeholder: l, ...M }, G = ge((V) => V == null ? void 0 : g.toPrimitive(V, i), [i]); + return c(Wt, { name: r, rules: D, initialValue: G(y), normalize: G, children: (V, k, se) => { var L; return c(e, { type: i, rcform: se, itemProps: { validateStatus: k.errors.length > 0 ? "error" : "success", tooltip: m, help: k.errors.length > 0 ? k.errors.join("、") : null, required: ((L = D == null ? void 0 : D[0]) == null ? void 0 : L.required) || !1, ...K }, fieldProps: { ...z, ...V }, $setting: u || {} }); } }); @@ -607,8 +607,8 @@ const $e = ht.getInstance(), oa = () => { St.propTypes = { fields: O.array }; const cn = (It = St, ({ code: e, layout: t, name: a, primaryKey: n = 0, style: i = {}, formProps: r = {}, form: s, isPreview: o = !1, className: l, onFinish: u, onValuesChange: d = () => { }, ...m }) => { - const { align: y, autoComplete: h, resource: f, items: C, hides: w, rowHeight: E, marginX: A, marginY: J, cols: W, listenChangeFields: I, listenChangeFieldsFunc: M, pk: D, uuid: K } = an(e), [z] = re.useForm(s), G = pe(() => [{ name: "__PK__", value: D }, { name: "__PROPS__", value: r }, { name: "__RESOURCE__", value: f }, { name: "__LAYOUT_KEY__", value: e }, { name: "__LAYOUT_UUID__", value: K }, { name: "__PRIMARY_KEY__", value: n }], [D, e, K, f, n, r]); - return $(re, { className: l, name: a || e, layout: t || y, fields: G, form: z, autoComplete: h, style: { ...i, position: "relative" }, onFinish: u, onValuesChange: (V, k) => (({ changedValues: se, allValues: L, listenChangeFields: me, listenChangeFieldsFunc: Ne, onValuesChange: it, code: T }) => { + const { align: f, autoComplete: h, resource: y, items: C, hides: w, rowHeight: E, marginX: A, marginY: J, cols: W, listenChangeFields: I, listenChangeFieldsFunc: M, pk: D, uuid: K } = an(e), [z] = re.useForm(s), G = pe(() => [{ name: "__PK__", value: D }, { name: "__PROPS__", value: r }, { name: "__RESOURCE__", value: y }, { name: "__LAYOUT_KEY__", value: e }, { name: "__LAYOUT_UUID__", value: K }, { name: "__PRIMARY_KEY__", value: n }], [D, e, K, y, n, r]); + return $(re, { className: l, name: a || e, layout: t || f, fields: G, form: z, autoComplete: h, style: { ...i, position: "relative" }, onFinish: u, onValuesChange: (V, k) => (({ changedValues: se, allValues: L, listenChangeFields: me, listenChangeFieldsFunc: Ne, onValuesChange: it, code: T }) => { it(se, L), Ne && Array.isArray(me) && $e.exec(Ne, { changedValues: se, allValues: L }, { getFieldValue: z.getFieldValue, setFieldsValue: z.setFieldsValue, isFieldTouched: z.isFieldTouched, isFieldsTouched: z.isFieldsTouched }); })({ changedValues: V, allValues: k, listenChangeFields: I, listenChangeFieldsFunc: M, onValuesChange: d, code: e }), children: [c(It, { ...m, form: z, code: e, fields: C, cols: W, rowHeight: E, itemMargin: [A, J] }), w == null ? void 0 : w.map((V) => { var k; @@ -646,9 +646,9 @@ const da = ({ $setting: e, $close: t, extras: a, code: n, primaryKey: i, ...r }) if ($t(e) || b.isValidElement(e)) return g.partialRight(Mt, e, i, r); if (g.isFunction(e)) return g.partialRight(At, (i == null ? void 0 : i.code) || e, { status: u, setStatus: d }); } - return (...y) => console.error("useButton unknown widgetType", t, ...y); + return (...f) => console.error("useButton unknown widgetType", t, ...f); }, [e, t]); - return [g.debounce((y) => (o == null || o(y), Promise.resolve(_t(n, y, { list: l })).then((h) => m({ ...a, ...h })).then((h) => s == null ? void 0 : s(h)).catch(console.error)), 300, { leading: !0, trailing: !1 }), u]; + return [g.debounce((f) => (o == null || o(f), Promise.resolve(_t(n, f, { list: l })).then((h) => m({ ...a, ...h })).then((h) => s == null ? void 0 : s(h)).catch(console.error)), 300, { leading: !0, trailing: !1 }), u]; }, zt = /* @__PURE__ */ new Set(), ft = (e = [], t = 0) => { const a = e[t]; if (a.length && !zt.has(a)) { @@ -661,36 +661,36 @@ const da = ({ $setting: e, $close: t, extras: a, code: n, primaryKey: i, ...r }) } }, yt = ({ className: e, type: t, style: a = {}, ...n }) => c("span", { role: "img", className: R("ff-iconfont", e), style: a, ...n, children: c("svg", { style: { width: "1em", height: "1em", fill: "currentColor", overflow: "hidden" }, viewBox: "0 0 1024 1024", children: c("use", { xlinkHref: `#${t}` }) }) }); yt.propTypes = { className: O.string, type: O.string.isRequired, style: O.object }, yt.init = ft; -const Qe = (e) => function({ className: t, children: a, name: n, icon: i, type: r = "default", iconPosition: s = "start", noAuthType: o, onAfterClick: l, onBeforeClick: u, data: d, loading: m, disabled: y, tooltip: h, popConfirm: f, widget: C, widgetType: w, widgetData: E, widgetProps: A, widgetSetting: J, widgetContainerProps: W, ...I }) { +const Qe = (e) => function({ className: t, children: a, name: n, icon: i, type: r = "default", iconPosition: s = "start", noAuthType: o, onAfterClick: l, onBeforeClick: u, data: d, loading: m, disabled: f, tooltip: h, popConfirm: y, widget: C, widgetType: w, widgetData: E, widgetProps: A, widgetSetting: J, widgetContainerProps: W, ...I }) { const M = { type: "primary", className: R("ff-button", t), iconPosition: s }; r === "danger" ? M.danger = !0 : r === "default" && (M.type = r), e === "link" || e === "dashed" ? (M.type = e, r === "default" && (M.className = R(M.className, "ff-default"))) : e !== "circle" && e !== "round" || (M.shape = e), i && (M.icon = c(yt, { type: i })); const [D, K] = P(!1), [z, { disabled: G, loading: V }] = pn({ widget: C, widgetType: w, widgetData: E, widgetProps: A, widgetSetting: J, widgetContainerProps: W }, { onAfterClick: l, onBeforeClick: u }); - return c(va, { okText: "确定", cancelText: "取消", ...f || {}, disabled: G || y, open: D, onOpenChange: (k) => { + return c(va, { okText: "确定", cancelText: "取消", ...y || {}, disabled: G || f, open: D, onOpenChange: (k) => { if (!k) return K(k); - f ? K(k) : z(d); + y ? K(k) : z(d); }, onConfirm: () => { z(d); }, onClick: (k) => { k.stopPropagation(); - }, children: c(ka, { ...h, title: D ? null : h == null ? void 0 : h.title, trigger: ["hover", "click"], children: c(lt, { loading: V || m, disabled: G || y, ...M, ...I, children: a || n }) }) }); + }, children: c(ka, { ...h, title: D ? null : h == null ? void 0 : h.title, trigger: ["hover", "click"], children: c(lt, { loading: V || m, disabled: G || f, ...M, ...I, children: a || n }) }) }); }, S = Qe("default"), mn = Qe("link"), hn = Qe("circle"), fn = Qe("round"), yn = Qe("dashed"), Bt = ({ data: e, widget: t, widgetType: a = "fsdpf-component", children: n, widgetData: i, widgetProps: r, widgetSetting: s, widgetContainerProps: o }) => { - const l = Ge(Le), [u, d] = P(!1), [m, y] = P("hover"), [h, f] = P({}), [C, w] = P(), { placement: E, ...A } = o || {}; + const l = Ge(Le), [u, d] = P(!1), [m, f] = P("hover"), [h, y] = P({}), [C, w] = P(), { placement: E, ...A } = o || {}; N(() => { a == "grid-layout-form" ? w(b.createElement(da, { ...i, $setting: s, code: t })) : a == "data-list" ? w(b.createElement(vt, { base62params: e, $setting: s, listCode: t })) : g.isString(t) ? X.getWidgetComponent(t).then(({ default: I }) => { w(b.createElement(I, { ...i, $setting: s })); }).catch((I) => w(I.toString())) : $t(t) ? w(b.createElement(t, { ...i, $setting: s })) : b.isValidElement(t) && w(b.cloneElement(t, { ...i, $setting: s })); }, [t, a, i]), N(() => { - Promise.resolve(_t(r, e, { list: l })).then(f); + Promise.resolve(_t(r, e, { list: l })).then(y); }, [r, e]); const J = (I) => { - d(I), !I && y("hover"); + d(I), !I && f("hover"); }, W = () => { - d(!0), y("click"); + d(!0), f("click"); }; return c(Sa, { zIndex: 1e3, placement: E, onPopupClick: W, onClick: W, open: u, trigger: m, content: c(wn, { ...A, children: C && b.cloneElement(C, { ...h, $close: () => J(!1) }) }), children: n, onOpenChange: J }); -}, wn = ({ title: e, className: t, children: a, ...n }) => { - const [i, r] = P({}), s = ge((u, d) => r((m) => ({ ...m, [u]: d })), []), o = ge((u) => r((d) => ({ ...d, [u]: void 0 })), []), l = e ? b.createElement("div", { className: "ff-popup-title" }, e) : i == null ? void 0 : i.title; - return c(_e.Provider, { value: { ele: i, mount: s, unmount: o }, children: $("div", { className: R("ff-popup ff-popover", t), ...n, children: [l || i != null && i["sub-title"] ? $("div", { className: "ff-popup-header", children: [l || c("div", { className: "ff-popup-title" }), (i == null ? void 0 : i["sub-title"]) || c("div", { className: "ff-popup-sub-title" })] }) : null, a, i != null && i.extras || i != null && i.actions ? $("div", { className: "ff-popup-footer", children: [(i == null ? void 0 : i.extras) || c("div", { className: "ff-popup-extras" }), (i == null ? void 0 : i.actions) || c("div", { className: "ff-popup-actions" })] }) : null] }) }); +}, wn = ({ title: e, className: t, children: a, width: n, height: i, ...r }) => { + const [s, o] = P({}), l = ge((m, f) => o((h) => ({ ...h, [m]: f })), []), u = ge((m) => o((f) => ({ ...f, [m]: void 0 })), []), d = e ? b.createElement("div", { className: "ff-popup-title" }, e) : s == null ? void 0 : s.title; + return c(_e.Provider, { value: { ele: s, mount: l, unmount: u }, children: $("div", { className: R("ff-popup ff-popover", t), style: { width: n, height: i }, ...r, children: [d || s != null && s["sub-title"] ? $("div", { className: "ff-popup-header", children: [d || c("div", { className: "ff-popup-title" }), (s == null ? void 0 : s["sub-title"]) || c("div", { className: "ff-popup-sub-title" })] }) : null, a, s != null && s.extras || s != null && s.actions ? $("div", { className: "ff-popup-footer", children: [(s == null ? void 0 : s.extras) || c("div", { className: "ff-popup-extras" }), (s == null ? void 0 : s.actions) || c("div", { className: "ff-popup-actions" })] }) : null] }) }); }; Bt.propTypes = { widgetType: O.oneOf(["fsdpf-component", "grid-layout-form", "data-list"]) }, S.propTypes = { type: O.oneOf(["primary", "default", "danger", ""]), name: O.string, icon: O.string, iconPosition: O.oneOf(["start", "end"]), data: O.any, widget: O.any, widgetType: O.oneOf(["destroy", "redirect", "func", "fsdpf-component", "grid-layout-form", "grid-layout", "data-list"]), widgetData: O.object, widgetProps: O.object, widgetSetting: O.object, widgetContainerProps: O.object }, S.Link = mn, S.Link.defaultProps = S.defaultProps, S.Link.propTypes = S.propTypes, S.Circle = hn, S.Circle.defaultProps = S.defaultProps, S.Circle.propTypes = S.propTypes, S.Round = fn, S.Round.defaultProps = S.defaultProps, S.Round.propTypes = S.propTypes, S.Dashed = yn, S.Dashed.defaultProps = S.defaultProps, S.Dashed.propTypes = S.propTypes, S.Popover = Bt; const bn = ({ fields: e, formProps: t, $close: a }) => { @@ -700,12 +700,12 @@ const bn = ({ fields: e, formProps: t, $close: a }) => { const m = (a == null ? void 0 : a.pageX) === void 0 ? { animation: null, maskAnimation: null, mousePosition: { x: null, y: null } } : { animation: "zoom", maskAnimation: "fade", mousePosition: { x: a == null ? void 0 : a.pageX, y: a == null ? void 0 : a.pageY } }; return c(Va, { ...d, ...m, prefixCls: "ff-modal", modalRender: () => $("div", { className: R("ff-modal-content ff-popup", e), children: [$("div", { className: "ff-popup-header", children: [c("button", { "aria-label": "Close", className: "ff-popup-close", onClick: d.onClose, children: c(Ct, { type: "close" }) }), i, " ", r] }), c("div", { className: "ff-popup-body", children: n }), $("div", { className: "ff-popup-footer", children: [o, " ", s] })] }) }); }, ua = ({ placement: e, $close: t, $event: a, children: n, title: i, ...r }) => { - const [s, o] = P({}), [l, u] = P(!0), d = ge((f, C) => o((w) => ({ ...w, [f]: C })), []), m = ge((f) => o((C) => ({ ...C, [f]: void 0 })), []); - let y = { ...r, className: s.rootClassName, title: s.title || i && b.createElement("div", { className: R("ff-popup-title") }, i), subTitle: s["sub-title"], actions: s.actions, extras: s.extras, children: n, $close: t, $event: a, onClose: () => u(!1) }; + const [s, o] = P({}), [l, u] = P(!0), d = ge((y, C) => o((w) => ({ ...w, [y]: C })), []), m = ge((y) => o((C) => ({ ...C, [y]: void 0 })), []); + let f = { ...r, className: s.rootClassName, title: s.title || i && b.createElement("div", { className: R("ff-popup-title") }, i), subTitle: s["sub-title"], actions: s.actions, extras: s.extras, children: n, $close: t, $event: a, onClose: () => u(!1) }; const h = () => { t(!1); }; - return c(_e.Provider, { value: { ele: s, mount: d, unmount: m }, children: e && e !== "center" ? c(Cn, { ...y, placement: e, open: l, afterOpenChange: (f) => !f && h() }) : c(vn, { ...y, visible: l, afterClose: h }) }); + return c(_e.Provider, { value: { ele: s, mount: d, unmount: m }, children: e && e !== "center" ? c(Cn, { ...f, placement: e, open: l, afterOpenChange: (y) => !y && h() }) : c(vn, { ...f, visible: l, afterClose: h }) }); }; ua.propTypes = { placement: O.oneOf(["center", "left", "top", "right", "bottom"]) }; const q = () => { @@ -719,7 +719,7 @@ const q = () => { }); }, []); const n = (r, s = {}, o = {}) => new Promise((l, u) => i([l, u], r, s, o)), i = ([r, s], o, l = {}, u = {}) => { - const d = q.$index++, m = (y) => ((h, f) => (q.$popups.delete(h), a(), f == null ? void 0 : f()))(d, () => r(y)); + const d = q.$index++, m = (f) => ((h, y) => (q.$popups.delete(h), a(), y == null ? void 0 : y()))(d, () => r(f)); if (o === Gt) return e.open({ ...u, key: d, content: b.createElement(o, { ...l, $close: () => e.close(d) }) }); q.$popups.set(d, b.createElement(ua, { zIndex: d, maskClosable: !1, $event: l == null ? void 0 : l.$event, ...u, key: d, $close: m }, b.isValidElement(o) ? b.cloneElement(o, { ...l, $close: m }) : o != null && o.name ? b.createElement(o, { ...l, $close: m }) : o)), a(); }; diff --git a/dist/components.js b/dist/components.js index 061aea4..0752dbd 100644 --- a/dist/components.js +++ b/dist/components.js @@ -1,4 +1,4 @@ -import { X as s, N as p, Y as n, Z as t, W as d } from "./common/main-CxqrXb2v.js"; +import { X as s, N as p, Y as n, Z as t, W as d } from "./common/main-C2XZS82Q.js"; export { s as Empty, p as Icon, diff --git a/dist/container.js b/dist/container.js index cfd9b74..841370b 100644 --- a/dist/container.js +++ b/dist/container.js @@ -1,4 +1,4 @@ -import { T as o, X as s, Y as p, Z as t, U as d, W as n, V as r, S as u } from "./common/main-CxqrXb2v.js"; +import { T as o, X as s, Y as p, Z as t, U as d, W as n, V as r, S as u } from "./common/main-C2XZS82Q.js"; export { o as Context, s as Empty, diff --git a/dist/data-list.js b/dist/data-list.js index 07cc1b8..4cf37dc 100644 --- a/dist/data-list.js +++ b/dist/data-list.js @@ -1,4 +1,4 @@ -import { m as s, k as e, e as r, i, n as o, j as D, h as l, l as u, f as L, o as n, D as d, p as m, q as F, s as p, t as C, r as b } from "./common/main-CxqrXb2v.js"; +import { m as s, k as e, e as r, i, n as o, j as D, h as l, l as u, f as L, o as n, D as d, p as m, q as F, s as p, t as C, r as b } from "./common/main-C2XZS82Q.js"; export { s as DataListContent, e as DataListContext, diff --git a/dist/data-list/utils.js b/dist/data-list/utils.js index 5eeb96d..903bfbd 100644 --- a/dist/data-list/utils.js +++ b/dist/data-list/utils.js @@ -1,5 +1,5 @@ import "lodash"; -import { a as t } from "../common/main-CxqrXb2v.js"; +import { a as t } from "../common/main-C2XZS82Q.js"; export { t as getDefaultExpandRowKeys }; diff --git a/dist/grid-layout-form.js b/dist/grid-layout-form.js index c5c48cb..e33311c 100644 --- a/dist/grid-layout-form.js +++ b/dist/grid-layout-form.js @@ -1,4 +1,4 @@ -import { E as r, I as u, F as e, C as o, M as t, L as F, K as d, J as m } from "./common/main-CxqrXb2v.js"; +import { E as r, I as u, F as e, C as o, M as t, L as F, K as d, J as m } from "./common/main-C2XZS82Q.js"; export { r as GridLayoutForm, u as GridLayoutFormHelper, diff --git a/dist/grid-layout-form/utils.js b/dist/grid-layout-form/utils.js index 74f3078..00a4ebf 100644 --- a/dist/grid-layout-form/utils.js +++ b/dist/grid-layout-form/utils.js @@ -1,5 +1,5 @@ import "lodash"; -import { a7 as a } from "../common/main-CxqrXb2v.js"; +import { a7 as a } from "../common/main-C2XZS82Q.js"; export { a as getOptionItemByValue }; diff --git a/dist/grid-layout.js b/dist/grid-layout.js index 204b535..3909df0 100644 --- a/dist/grid-layout.js +++ b/dist/grid-layout.js @@ -1,4 +1,4 @@ -import { b as d, c as e, H as u, G as i, u as t, d as o } from "./common/main-CxqrXb2v.js"; +import { b as d, c as e, H as u, G as i, u as t, d as o } from "./common/main-C2XZS82Q.js"; export { d as GridLayout, e as GridLayoutWidget, diff --git a/dist/grid-layout/utils.js b/dist/grid-layout/utils.js index 46aaae7..befca09 100644 --- a/dist/grid-layout/utils.js +++ b/dist/grid-layout/utils.js @@ -1,4 +1,4 @@ -import { g as t } from "../common/main-CxqrXb2v.js"; +import { g as t } from "../common/main-C2XZS82Q.js"; export { t as getBoxStyle }; diff --git a/dist/hooks.js b/dist/hooks.js index 42e7698..2b1416d 100644 --- a/dist/hooks.js +++ b/dist/hooks.js @@ -1,7 +1,7 @@ import "lodash"; import "rc-field-form"; import "react"; -import { z as p, y as i, A as o, w as r, x as f, B as c, v as m } from "./common/main-CxqrXb2v.js"; +import { z as p, y as i, A as o, w as r, x as f, B as c, v as m } from "./common/main-C2XZS82Q.js"; export { p as useDeepEffect, i as useDeepEqualEffect, diff --git a/dist/iconfont.js b/dist/iconfont.js index 647955c..392cca7 100644 --- a/dist/iconfont.js +++ b/dist/iconfont.js @@ -2,7 +2,7 @@ import "react/jsx-runtime"; import "react"; import "prop-types"; import "classnames"; -import { N as a } from "./common/main-CxqrXb2v.js"; +import { N as a } from "./common/main-C2XZS82Q.js"; export { a as default }; diff --git a/dist/index.js b/dist/index.js index e736783..2656a02 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1,4 +1,4 @@ -import { a5 as t, a6 as e, a1 as o, a2 as p, _ as n, a3 as c, a0 as r, $ as f, a4 as u } from "./common/main-CxqrXb2v.js"; +import { a5 as t, a6 as e, a1 as o, a2 as p, _ as n, a3 as c, a0 as r, $ as f, a4 as u } from "./common/main-C2XZS82Q.js"; export { t as AppContext, e as AppGlobalParamsContext, diff --git a/dist/res-ws.js b/dist/res-ws.js index cbba811..0868099 100644 --- a/dist/res-ws.js +++ b/dist/res-ws.js @@ -1,5 +1,5 @@ import "lodash"; -import { R as a } from "./common/main-CxqrXb2v.js"; +import { R as a } from "./common/main-C2XZS82Q.js"; export { a as default }; diff --git a/package.json b/package.json index 838a562..e88b53f 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "ff", "private": true, - "version": "0.4.5", + "version": "0.4.6", "author": "www.fsdpf.com", "type": "module", "main": "./dist/index.js",