diff --git a/dist/button.js b/dist/button.js index 6617280..0b57cad 100644 --- a/dist/button.js +++ b/dist/button.js @@ -1,4 +1,4 @@ -import { a4 as s, a3 as u, a5 as e } from "./common/main-DhfQBqHJ.js"; +import { a4 as s, a3 as u, a5 as e } from "./common/main-ah3d0ahB.js"; export { s as auth, u as default, diff --git a/dist/common/main-DhfQBqHJ.js b/dist/common/main-ah3d0ahB.js similarity index 90% rename from dist/common/main-DhfQBqHJ.js rename to dist/common/main-ah3d0ahB.js index e7bf3c1..b154f4c 100644 --- a/dist/common/main-DhfQBqHJ.js +++ b/dist/common/main-ah3d0ahB.js @@ -17,9 +17,9 @@ import { jsx as g, jsxs as A } from "react/jsx-runtime"; import k, { useEffect as j, useState as F, useCallback as Y, useMemo as H, useRef as U, useContext as le, useId as Le, isValidElement as Ni, useLayoutEffect as Fi } from "react"; import c from "lodash"; import _t from "immutability-helper"; -import { Form as Ge, Input as Ei, Button as Xe, Pagination as Ri, Tree as Oi, Breadcrumb as Li, Table as Ai, Empty as ji, Popconfirm as Vi, Tooltip as Ii, Popover as Mi } from "antd"; +import { Form as Ye, Input as Ei, Button as Qe, Pagination as Ri, Tree as Oi, Breadcrumb as Li, Table as Ai, Empty as ji, Popconfirm as Vi, Tooltip as Ii, Popover as Mi } from "antd"; import { useMergedState as zi } from "rc-util"; -import M from "classnames"; +import z from "classnames"; import ee, { FieldContext as Gt, Field as Yt } from "rc-field-form"; import w from "prop-types"; import * as jt from "react-is"; @@ -64,18 +64,18 @@ const sr = () => g("div", { children: "Empty" }), qe = k.createContext({ ele: {} }, unmount: () => { } }), G = ({ rootClassName: e, className: t, children: i, actions: n, title: r, subTitle: a, extras: o, style: s = {} }) => { const { mount: l, unmount: u } = k.useContext(qe); - return n && G.Action({ children: n }), r && G.Title({ children: r }), a && G.SubTitle({ children: a }), o && G.Extra({ children: o }), j(() => (l("rootClassName", e), () => u(e)), [e]), g("div", { className: M("ff-container", t), style: s, children: i }); -}, _e = (e) => ({ children: t, className: i }) => { + return n && G.Action({ children: n }), r && G.Title({ children: r }), a && G.SubTitle({ children: a }), o && G.Extra({ children: o }), j(() => (l("rootClassName", e), () => u(e)), [e]), g("div", { className: z("ff-container", t), style: s, children: i }); +}, Ge = (e) => ({ children: t, className: i }) => { const { mount: n, unmount: r } = k.useContext(qe); - return j(() => (n(e, k.createElement("div", { key: `ff-${e}`, className: M(`ff-popup-${e}`, i) }, t)), () => r(e)), [i, t]), null; + return j(() => (n(e, k.createElement("div", { key: `ff-${e}`, className: z(`ff-popup-${e}`, i) }, t)), () => r(e)), [i, t]), null; }; -G.Action = _e("actions"), G.Title = _e("title"), G.SubTitle = _e("sub-title"), G.Extra = _e("extras"), G.propTypes = { className: w.string, style: w.object, title: w.any, subTitle: w.any, actions: w.any, extras: w.any }; +G.Action = Ge("actions"), G.Title = Ge("title"), G.SubTitle = Ge("sub-title"), G.Extra = Ge("extras"), G.propTypes = { className: w.string, style: w.object, title: w.any, subTitle: w.any, actions: w.any, extras: w.any }; const or = () => g(G, { className: "ff-loading", children: A("div", { className: "loader", children: [A("div", { className: "square", children: [g("span", {}), g("span", {}), g("span", {})] }), A("div", { className: "square", children: [g("span", {}), g("span", {}), g("span", {})] }), A("div", { className: "square", children: [g("span", {}), g("span", {}), g("span", {})] }), A("div", { className: "square", children: [g("span", {}), g("span", {}), g("span", {})] })] }) }), lr = () => g("div", { children: "NotFound" }), Zt = ({ children: e }) => { const [t, i] = F({}), n = Y((a, o) => i((s) => ({ ...s, [a]: o })), []), r = Y((a) => i((o) => ({ ...o, [a]: void 0 })), []); return typeof (e == null ? void 0 : e.type) == "string" ? e : g(qe.Provider, { value: { ele: t, mount: n, unmount: r }, children: k.cloneElement(e, { className: t.rootClassName, title: t.title, subTitle: t["sub-title"], actions: t.actions, extras: t.extras }) }); }; Zt.propTypes = { children: w.element.isRequired }; -const Vt = { close: ["M563.8 512l262.5-312.9c4.4-5.2 0.7-13.1-6.1-13.1h-79.8c-4.7 0-9.2 2.1-12.3 5.7L511.6 449.8 295.1 191.7c-3-3.6-7.5-5.7-12.3-5.7H203c-6.8 0-10.5 7.9-6.1 13.1L459.4 512 196.9 824.9c-4.4 5.2-0.7 13.1 6.1 13.1h79.8c4.7 0 9.2-2.1 12.3-5.7l216.5-258.1 216.5 258.1c3 3.6 7.5 5.7 12.3 5.7h79.8c6.8 0 10.5-7.9 6.1-13.1L563.8 512z"], check: ["M912 190h-69.9c-9.8 0-19.1 4.5-25.1 12.2L404.7 724.5 207 474c-6.1-7.7-15.3-12.2-25.1-12.2H112c-6.7 0-10.4 7.7-6.3 12.9l273.9 347c12.8 16.2 37.4 16.2 50.3 0l488.4-618.9c4.1-5.1 0.4-12.8-6.3-12.8z"], info: ["M512 224m-64 0a64 64 0 1 0 128 0 64 64 0 1 0-128 0Z", "M544 392h-64c-4.4 0-8 3.6-8 8v464c0 4.4 3.6 8 8 8h64c4.4 0 8-3.6 8-8V400c0-4.4-3.6-8-8-8z"] }, vt = ({ type: e, props: t }) => g("i", { ...t, children: g("svg", { viewBox: "0 0 1024 1024", width: "1em", height: "1em", fill: "currentColor", children: (Vt[e] || Vt.info).map((i, n) => g("path", { d: i }, n)) }) }), ei = ({ className: e, content: t, icon: i, $close: n }) => A(k.Fragment, { children: [i && g("div", { className: M("ff-notification-icon", e), children: g(vt, { type: i }) }), t] }), Gi = ({}) => g(G, { children: "Confirm" }); +const Vt = { close: ["M563.8 512l262.5-312.9c4.4-5.2 0.7-13.1-6.1-13.1h-79.8c-4.7 0-9.2 2.1-12.3 5.7L511.6 449.8 295.1 191.7c-3-3.6-7.5-5.7-12.3-5.7H203c-6.8 0-10.5 7.9-6.1 13.1L459.4 512 196.9 824.9c-4.4 5.2-0.7 13.1 6.1 13.1h79.8c4.7 0 9.2-2.1 12.3-5.7l216.5-258.1 216.5 258.1c3 3.6 7.5 5.7 12.3 5.7h79.8c6.8 0 10.5-7.9 6.1-13.1L563.8 512z"], check: ["M912 190h-69.9c-9.8 0-19.1 4.5-25.1 12.2L404.7 724.5 207 474c-6.1-7.7-15.3-12.2-25.1-12.2H112c-6.7 0-10.4 7.7-6.3 12.9l273.9 347c12.8 16.2 37.4 16.2 50.3 0l488.4-618.9c4.1-5.1 0.4-12.8-6.3-12.8z"], info: ["M512 224m-64 0a64 64 0 1 0 128 0 64 64 0 1 0-128 0Z", "M544 392h-64c-4.4 0-8 3.6-8 8v464c0 4.4 3.6 8 8 8h64c4.4 0 8-3.6 8-8V400c0-4.4-3.6-8-8-8z"] }, vt = ({ type: e, props: t }) => g("i", { ...t, children: g("svg", { viewBox: "0 0 1024 1024", width: "1em", height: "1em", fill: "currentColor", children: (Vt[e] || Vt.info).map((i, n) => g("path", { d: i }, n)) }) }), ei = ({ className: e, content: t, icon: i, $close: n }) => A(k.Fragment, { children: [i && g("div", { className: z("ff-notification-icon", e), children: g(vt, { type: i }) }), t] }), Gi = ({}) => g(G, { children: "Confirm" }); var ue, Ne; const ie = class ie { constructor() { @@ -123,7 +123,7 @@ const Ae = ht.getInstance(), It = { null2json: (e) => Object.create(), null2arra i = Array.isArray(e) ? "array" : typeof e, c.isObject(e) && (i = "json"); const n = `${i}2${t}`; return Reflect.has(It, n) ? It[n](e) : e; -}, rt = (e = {}, t = {}, i = {}, n = "") => ii(e, (r, a) => a === "type" && r === "code") ? ni(e, t, i, n) : ri(e, t, n), ii = (e, t = () => !1) => c.some(e, (i) => !!c.some(i, t) || (c.isEmpty(i) || !c.isPlainObject(i) && !c.isArray(i) ? void 0 : ii(i, t))), ni = async (e = {}, t = {}, i = {}, n = "") => { +}, Ue = (e = {}, t = {}, i = {}, n = "") => ii(e, (r, a) => a === "type" && r === "code") ? ni(e, t, i, n) : ri(e, t, n), ii = (e, t = () => !1) => c.some(e, (i) => !!c.some(i, t) || (c.isEmpty(i) || !c.isPlainObject(i) && !c.isArray(i) ? void 0 : ii(i, t))), ni = async (e = {}, t = {}, i = {}, n = "") => { let r = /* @__PURE__ */ Object.create(null); for (let a in e) { let o; @@ -182,13 +182,13 @@ const Ae = ht.getInstance(), It = { null2json: (e) => Object.create(), null2arra var t, i; return e ? (i = (t = e.match(/^@pkg(?:[^\/]*\/){1}(?[^\/]+)/)) == null ? void 0 : t.groups) == null ? void 0 : i.owner : ""; }; -var Ze, Me, ze, et; -const tt = class tt { +var et, Me, ze, tt; +const it = class it { constructor(...t) { R(this, Me, []); R(this, ze, (t) => { var i; - for (let n of t) Array.isArray(n[0]) ? y(this, ze).call(this, n) : y(this, Me).push(y(i = tt, Ze).call(i, n[0], n[1])); + for (let n of t) Array.isArray(n[0]) ? y(this, ze).call(this, n) : y(this, Me).push(y(i = it, et).call(i, n[0], n[1])); }); v(this, "toValue", async (t, i = null) => { const n = { getValue: () => t, getRecord: () => i }; @@ -201,8 +201,8 @@ const tt = class tt { } }, t); }); - v(this, "toRender", (t, i, n = null) => k.createElement(y(this, et), { value: t, record: i }, n)); - R(this, et, ({ value: t, record: i, children: n }) => { + v(this, "toRender", (t, i, n = null) => k.createElement(y(this, tt), { value: t, record: i }, n)); + R(this, tt, ({ value: t, record: i, children: n }) => { const [r, a] = F(n); return st(() => { let o = !1; @@ -212,12 +212,12 @@ const tt = class tt { y(this, ze).call(this, t); } }; -Ze = new WeakMap(), Me = new WeakMap(), ze = new WeakMap(), et = new WeakMap(), R(tt, Ze, c.memoize((t, i) => oe.getWidgetComponent(t).then((n) => { +et = new WeakMap(), Me = new WeakMap(), ze = new WeakMap(), tt = new WeakMap(), R(it, et, c.memoize((t, i) => oe.getWidgetComponent(t).then((n) => { var r; return ((r = n.default) == null ? void 0 : r.call(n, i)) || ((a) => a); }), (t, i) => `${t}::${Z(i, "string")}`)); -let Qe = tt; -const Qi = (e, t = {}) => H(() => e == null ? void 0 : e.map(({ widgetByJs: i, widgetByJsSetting: n, ...r }, a) => i ? { ...r, render: (o, s) => new Qe([i, n]).toRender(o, s, "-") } : r), [e, t]), pr = (e) => { +let Ze = it; +const Qi = (e, t = {}) => H(() => e == null ? void 0 : e.map(({ widgetByJs: i, widgetByJsSetting: n, ...r }, a) => i ? { ...r, render: (o, s) => new Ze([i, n]).toRender(o, s, "-") } : r), [e, t]), pr = (e) => { const [t, i] = F({}); return j(() => { let n = !1; @@ -225,7 +225,7 @@ const Qi = (e, t = {}) => H(() => e == null ? void 0 : e.map(({ widgetByJs: i, w }, [e]), t; }, mr = (e, t = {}) => { const [i, n] = F({ dataSource: [] }); - return Ue(() => { + return We(() => { let r = !1; return e && L.get(`/api/${e}/${L.encode({ page: 1, ...t })}`).then((a) => !r && n(a)), () => r = !0; }, [e, t]), i; @@ -252,11 +252,11 @@ const Qi = (e, t = {}) => H(() => e == null ? void 0 : e.map(({ widgetByJs: i, w const T = c.get(o.current, h > -1 ? [h, "children", b, "children"] : [b, "children"]); o.current = _t(o.current, h > -1 ? { [h]: { children: { $splice: [[b, 1, { ...C, children: T }]] } } } : { $splice: [[b, 1, { ...C, children: T }]] }); const P = new Map(x); - s.current.forEach((O, z) => { + s.current.forEach((O, V) => { var q; - (q = P.get(z)) != null && q.some((V) => V == m) || s.current.set(z, O.filter((V) => V !== m)); - }), P.forEach((O, z) => { - s.current.has(z) ? s.current.set(z, c.uniq([...s.current.get(z) || [], ...O])) : s.current.set(z, O); + (q = P.get(V)) != null && q.some((I) => I == m) || s.current.set(V, O.filter((I) => I !== m)); + }), P.forEach((O, V) => { + s.current.has(V) ? s.current.set(V, c.uniq([...s.current.get(V) || [], ...O])) : s.current.set(V, O); }); }).then(() => { a.current = !0, r(); @@ -275,13 +275,13 @@ const Qi = (e, t = {}) => H(() => e == null ? void 0 : e.map(({ widgetByJs: i, w const s = H(() => c.pick(n.current, ["total", "tab", "page", "pageSize", "condition", "sider", "keyword"]), [n.current]); return Object.assign(s, { onTabChange: (l) => o({ tab: l, page: 1 }), onPageChange: (l, u) => o({ page: l, pageSize: u }), onPageSizeChange: (l) => o({ pageSize: l, page: 1 }), onConditionChange: (l, u) => o({ keyword: u, condition: _t(n.current.condition || {}, { $merge: l || {} }), page: 1 }), onSiderChange: (l) => o({ sider: l, page: 1 }), onKeywordChange: (l) => o({ keyword: l, page: 1 }), itemOperationsAccess: r.current, dataSource: a.current, onReload: o }); }, tn = ({ listCode: e, className: t, layouts: i, dataSource: n, isPaginate: r, isItemOperations: a, isBatchOperations: o, batchOperations: s, itemOperations: l, itemOperationsAccess: u, resource: p, primaryKey: d, title: f, itemGridLayout: m, $setting: h, tabs: b, isConditionFormLayout: C, isTreeSider: x, treeSiderConfig: T }) => { - const { classNames: P, onClickCallback: O } = le(te), z = ai(l, u, d, p), q = Y((V, I, N) => g(nn, { className: M("ff-data-list-framework-item", P.item), operations: a ? z(I) : [], data: p ? { [p]: I } : I, children: V, onClickCallback: O }), [p, d, a, O, l, u]); - return A("div", { className: M("ff-data-list-framework", t), children: [g(i.sider, { isTreeSider: x, ...T }), A("div", { className: M("ff-data-list-container", P == null ? void 0 : P.container), children: [g(i.filter, { isConditionFormLayout: C }), g(i.toolbar, { title: f, tabs: b }), g(hn, { ...m, style: { "--col-num": (h == null ? void 0 : h.colNum) || 1 }, primaryKey: d, itemRender: q, dataSource: n }), g(i.footer, { isPaginate: r, isOperations: o, operations: s })] })] }); -}, nn = ({ className: e, operations: t, children: i, data: n, onClickCallback: r }) => A("div", { className: M("data-list-grid-layout-item-container", e), children: [i, !!(t != null && t.length) && g("div", { className: "data-list-grid-layout-item-actions", children: t.map((a) => g("span", { className: "data-list-grid-layout-item-action", children: g($.Link, { uuid: a.uuid, type: a.type, name: a.name, widget: a.widget, widgetType: a.widgetType, widgetProps: a.widgetProps, widgetSetting: a.widgetSetting, widgetContainerProps: a.widgetContainerSetting, data: n, confirm: a.confirm, onAfterClick: (o) => o !== !1 && (r == null ? void 0 : r(a.isRefresh, n)) }, a.uuid || Le()) }, (a == null ? void 0 : a.uuid) || Le())) })] }), rn = ({ listCode: e, className: t, layouts: i, dataSource: n, columns: r, isItemOperations: a, isBatchOperations: o, batchOperations: s, itemOperations: l, itemOperationsAccess: u, resource: p, primaryKey: d, title: f, tabs: m, isPaginate: h, isTreeSider: b, treeSiderConfig: C, isConditionFormLayout: x, ...T }) => { - const { classNames: P, onClickCallback: O } = le(te), z = ai(l, u, d, p), q = ft(l, u, n, d, p); - return A("div", { className: M("ff-data-table-framework", t), children: [g(i.sider, { isTreeSider: b, ...C }), A("div", { className: M("ff-data-table-container", P == null ? void 0 : P.container), children: [g(i.filter, { isConditionFormLayout: x }), g(i.toolbar, { title: f, tabs: m }), g(dn, { ...T, primaryKey: d, className: "ff-data-table-content", columns: r, dataSource: n, operationRender: q ? (V) => { - var I; - return g("div", { className: "ff-data-table-actions", children: (I = z(V)) == null ? void 0 : I.map((N, S) => g($.Link, { size: "small", uuid: N.uuid, type: N.type, name: N.name, widget: N.widget, widgetType: N.widgetType, widgetProps: N.widgetProps, widgetData: N.widgetData, widgetSetting: N.widgetSetting, widgetContainerProps: N.widgetContainerSetting, data: V, confirm: N.confirm, onAfterClick: (E) => E !== !1 && (O == null ? void 0 : O(N.isRefresh, V)) }, N.uuid || S)) }); + const { classNames: P, onClickCallback: O } = le(te), V = ai(l, u, d, p), q = Y((I, M, N) => g(nn, { className: z("ff-data-list-framework-item", P.item), operations: a ? V(M) : [], data: p ? { [p]: M } : M, children: I, onClickCallback: O }), [p, d, a, O, l, u]); + return A("div", { className: z("ff-data-list-framework", t), children: [g(i.sider, { isTreeSider: x, ...T }), A("div", { className: z("ff-data-list-container", P == null ? void 0 : P.container), children: [g(i.filter, { isConditionFormLayout: C }), g(i.toolbar, { title: f, tabs: b }), g(hn, { ...m, style: { "--col-num": (h == null ? void 0 : h.colNum) || 1 }, primaryKey: d, itemRender: q, dataSource: n }), g(i.footer, { isPaginate: r, isOperations: o, operations: s })] })] }); +}, nn = ({ className: e, operations: t, children: i, data: n, onClickCallback: r }) => A("div", { className: z("data-list-grid-layout-item-container", e), children: [i, !!(t != null && t.length) && g("div", { className: "data-list-grid-layout-item-actions", children: t.map((a) => g("span", { className: "data-list-grid-layout-item-action", children: g($.Link, { uuid: a.uuid, type: a.type, name: a.name, widget: a.widget, widgetType: a.widgetType, widgetProps: a.widgetProps, widgetSetting: a.widgetSetting, widgetContainerProps: a.widgetContainerSetting, data: n, confirm: a.confirm, onAfterClick: (o) => o !== !1 && (r == null ? void 0 : r(a.isRefresh, n)) }, a.uuid || Le()) }, (a == null ? void 0 : a.uuid) || Le())) })] }), rn = ({ listCode: e, className: t, layouts: i, dataSource: n, columns: r, isItemOperations: a, isBatchOperations: o, batchOperations: s, itemOperations: l, itemOperationsAccess: u, resource: p, primaryKey: d, title: f, tabs: m, isPaginate: h, isTreeSider: b, treeSiderConfig: C, isConditionFormLayout: x, ...T }) => { + const { classNames: P, onClickCallback: O } = le(te), V = ai(l, u, d, p), q = ft(l, u, n, d, p); + return A("div", { className: z("ff-data-table-framework", t), children: [g(i.sider, { isTreeSider: b, ...C }), A("div", { className: z("ff-data-table-container", P == null ? void 0 : P.container), children: [g(i.filter, { isConditionFormLayout: x }), g(i.toolbar, { title: f, tabs: m }), g(dn, { ...T, primaryKey: d, className: "ff-data-table-content", columns: r, dataSource: n, operationRender: q ? (I) => { + var M; + return g("div", { className: "ff-data-table-actions", children: (M = V(I)) == null ? void 0 : M.map((N, S) => g($.Link, { size: "small", uuid: N.uuid, type: N.type, name: N.name, widget: N.widget, widgetType: N.widgetType, widgetProps: N.widgetProps, widgetData: N.widgetData, widgetSetting: N.widgetSetting, widgetContainerProps: N.widgetContainerSetting, data: I, confirm: N.confirm, onAfterClick: (E) => E !== !1 && (O == null ? void 0 : O(N.isRefresh, I)) }, N.uuid || S)) }); } : null }), g(i.footer, { isPaginate: h, isOperations: o, operations: s })] })] }); }, te = k.createContext({ listCode: "", classNames: {}, getBase62params: (e, t) => { }, onReload: () => { @@ -297,36 +297,36 @@ const Qi = (e, t = {}) => H(() => e == null ? void 0 : e.map(({ widgetByJs: i, w return r != null && r.autoHeight ? o.height = "fit-content" : o["--grid-layout-row"] = `${n}`, r != null && r.alignItems && (o["--grid-layout-box-align-items"] = r.alignItems), r != null && r.justifyContent && (o["--grid-layout-box-justify-content"] = r.justifyContent), o["--grid-layout-box-margin"] = Mt(r == null ? void 0 : r.marginTop, r == null ? void 0 : r.marginRight, r == null ? void 0 : r.marginBottom, r == null ? void 0 : r.marginLeft), o["--grid-layout-box-padding"] = Mt(r == null ? void 0 : r.paddingTop, r == null ? void 0 : r.paddingRight, r == null ? void 0 : r.paddingBottom, r == null ? void 0 : r.paddingLeft), a && (o.height = `${a}px`), o; }, Mt = (e, t, i, n) => `${e || 0}px ${t || 0}px ${i || 0}px ${n || 0}px`, hr = (e = "Text", t = "@pkg/ff/grid-layouts") => e != null && e.startsWith("@") || e != null && e.startsWith("blob:") ? e : `${t}/${e}`, oi = ({ className: e, isConditionFormLayout: t }) => { var f, m; - const [i, n] = F({}), { listCode: r, onKeywordChange: a, onConditionChange: o, getBase62params: s, classNames: l } = k.useContext(te), { keyword: u, condition: p } = (s == null ? void 0 : s()) || {}, [d] = Ge.useForm(); + const [i, n] = F({}), { listCode: r, onKeywordChange: a, onConditionChange: o, getBase62params: s, classNames: l } = k.useContext(te), { keyword: u, condition: p } = (s == null ? void 0 : s()) || {}, [d] = Ye.useForm(); return j(() => { r && t && L.get(`/api/_/${r}/list-condition-form-layout`).then(({ resource: h, marginX: b, marginY: C, rowHeight: x, cols: T, fields: P }) => { n({ resource: h, itemMargin: [b, C], rowHeight: x, cols: T, fields: P }); }).catch(() => n({})); }, [r, t]), j(() => { d.setFieldsValue({ keyword: u, ...p }); - }, [JSON.stringify([u, p])]), g("div", { className: M("ff-data-list-filter", l.filter, e), children: g(Ge, { form: d, layout: "vertical", autoComplete: "off", onFinish: ((f = i.fields) == null ? void 0 : f.length) > 1 ? (h) => o({ [i.resource]: h[i.resource] }, h.keyword) : () => { + }, [JSON.stringify([u, p])]), g("div", { className: z("ff-data-list-filter", l.filter, e), children: g(Ye, { form: d, layout: "vertical", autoComplete: "off", onFinish: ((f = i.fields) == null ? void 0 : f.length) > 1 ? (h) => o({ [i.resource]: h[i.resource] }, h.keyword) : () => { }, onValuesChange: (h) => { c.isEmpty(c.omit(h, ["keyword"])) || d.submit(); }, children: ((m = i.fields) == null ? void 0 : m.length) > 1 ? g($t, { ...i, children: g(an, { onReset: () => { const { keyword: h, condition: b } = s("init") || {}; d.setFieldsValue({ keyword: h, ...b }); - } }) }) : g("div", { className: "ff-data-list-filter-default-form ff-grid-layout-form", children: g("div", { className: "grid-layout-item", style: si(20, 0, 5, 2), children: g(Ge.Item, { name: ["keyword"], children: g(Ei.Search, { allowClear: !0, enterButton: "搜索", placeholder: "多关键字 | 分割", onSearch: (h) => a(h) }) }) }) }) }) }); + } }) }) : g("div", { className: "ff-data-list-filter-default-form ff-grid-layout-form", children: g("div", { className: "grid-layout-item", style: si(20, 0, 5, 2), children: g(Ye.Item, { name: ["keyword"], children: g(Ei.Search, { allowClear: !0, enterButton: "搜索", placeholder: "多关键字 | 分割", onSearch: (h) => a(h) }) }) }) }) }) }); }, an = ({ cols: e, fields: t, onReset: i }) => { const [n, r] = F(!1), a = H(() => t == null ? void 0 : t.toReversed().some((o) => o.y > 1 || o.x + o.w >= e - 5), [e, t]); - return A(Ge.Item, { label: " ", style: { "--item-span": 5 }, className: M("ff-data-list-filter-actions", { expanded: n }), children: [g(Xe, { onClick: i, children: "重置" }), g(Xe, { type: "primary", htmlType: "submit", children: "查询" }), a && g($.Link, { className: "ff-data-list-filter-expanded-button", widget: () => r((o) => !o), type: "primary", name: n ? "关闭" : "展开", icon: n ? "icon-up" : "icon-down", iconPosition: "end" })] }); + return A(Ye.Item, { label: " ", style: { "--item-span": 5 }, className: z("ff-data-list-filter-actions", { expanded: n }), children: [g(Qe, { onClick: i, children: "重置" }), g(Qe, { type: "primary", htmlType: "submit", children: "查询" }), a && g($.Link, { className: "ff-data-list-filter-expanded-button", widget: () => r((o) => !o), type: "primary", name: n ? "关闭" : "展开", icon: n ? "icon-up" : "icon-down", iconPosition: "end" })] }); }; oi.reservedFields = [{ x: 0, y: 0, h: 3, w: 5, field: { isVirtual: !0, widgetPrefix: "@pkg/ff/grid-layout-forms", widget: "Input", code: "keyword", label: "关键字", placeholder: "多关键字 | 分割", extras: { prefix: "icon-search" } } }]; const sn = ({ className: e, operations: t, isOperations: i, isPaginate: n }) => { const { onPageChange: r, onPageSizeChange: a, onClickCallback: o, getBase62params: s } = k.useContext(te), { total: l, page: u, pageSize: p } = (s == null ? void 0 : s()) || {}; - return i && !c.isEmpty(t) || n ? A("div", { className: M("ff-data-list-footer", e), children: [g("div", { className: "ff-data-list-actions", children: t == null ? void 0 : t.map((d, f) => g($, { uuid: d.uuid, type: d.type, name: d.name, widget: d.widget, widgetType: d.widgetType, widgetProps: d.widgetProps, widgetData: d.widgetData, widgetSetting: d.widgetSetting, widgetContainerProps: d.widgetContainerSetting, onAfterClick: (m) => m !== !1 && (o == null ? void 0 : o(d.isRefresh, null)) }, d.uuid || f)) }), n && g(Ri, { size: "small", total: l, pageSize: p, showSizeChanger: !1, showTotal: (d) => `第 ${u} 页 / 总共 ${d} 条`, onChange: r, onShowSizeChange: a })] }) : null; + return i && !c.isEmpty(t) || n ? A("div", { className: z("ff-data-list-footer", e), children: [g("div", { className: "ff-data-list-actions", children: t == null ? void 0 : t.map((d, f) => g($, { uuid: d.uuid, type: d.type, name: d.name, widget: d.widget, widgetType: d.widgetType, widgetProps: d.widgetProps, widgetData: d.widgetData, widgetSetting: d.widgetSetting, widgetContainerProps: d.widgetContainerSetting, onAfterClick: (m) => m !== !1 && (o == null ? void 0 : o(d.isRefresh, null)) }, d.uuid || f)) }), n && g(Ri, { size: "small", total: l, pageSize: p, showSizeChanger: !1, showTotal: (d) => `第 ${u} 页 / 总共 ${d} 条`, onChange: r, onShowSizeChange: a })] }) : null; }, on = [{ title: "parent 1", key: "0-0", children: [{ title: "parent 1-0", key: "0-0-0", disabled: !0, children: [{ title: "leaf", key: "0-0-0-0", disableCheckbox: !0 }, { title: "leaf", key: "0-0-0-1" }] }, { title: "parent 1-1", key: "0-0-1", children: [{ title: g("span", { style: { color: "#1677ff" }, children: "sss" }), key: "0-0-1-0" }] }] }], ln = ({ className: e, width: t = 280, isTreeSider: i }) => { const { classNames: n } = le(te); - return i ? g(Oi.DirectoryTree, { className: M("ff-data-list-sider", n.sider, e), style: { "--sider-width": t }, showLine: !0, showIcon: !1, treeData: on }) : null; + return i ? g(Oi.DirectoryTree, { className: z("ff-data-list-sider", n.sider, e), style: { "--sider-width": t }, showLine: !0, showIcon: !1, treeData: on }) : null; }, cn = ({ className: e, title: t, tabs: i }) => { const { getBase62params: n, onTabChange: r, onReload: a, classNames: o } = le(te), { tab: s } = (n == null ? void 0 : n()) || {}, [l, u] = zi((i == null ? void 0 : i[0].value) ?? (i == null ? void 0 : i[0].code), { value: s, onChange: r }); - return A("div", { className: M("ff-data-list-toolbar", o.toolbar, e), children: [g("div", { className: "ff-data-list-title", children: t }), g(Li, { className: "ff-data-list-tabs", itemRender: ({ label: p, code: d, value: f }) => g("span", { onClick: () => u(f ?? d), className: M("ff-data-list-tab", { active: (f ?? d) == l }), children: p }), items: i }), A("div", { className: "ff-data-list-actions", children: [g($.Link, { icon: "icon-reload", widget: () => a() }), g($.Link, { icon: "icon-setting" })] })] }); -}, li = ({ isItemGridLayout: e, theme: t, themeProps: i, onClickCallback: n, onReload: r, listCode: a, total: o = 0, page: s = 0, onPageChange: l, pageSize: u = 30, onPageSizeChange: p, tab: d, onTabChange: f, keyword: m, onKeywordChange: h, condition: b, onConditionChange: C, sider: x, onSiderChange: T, layouts: P, classNames: O = {}, ...z }) => { - const [q, V] = F(), I = Y((S, E) => { + return A("div", { className: z("ff-data-list-toolbar", o.toolbar, e), children: [g("div", { className: "ff-data-list-title", children: t }), g(Li, { className: "ff-data-list-tabs", itemRender: ({ label: p, code: d, value: f }) => g("span", { onClick: () => u(f ?? d), className: z("ff-data-list-tab", { active: (f ?? d) == l }), children: p }), items: i }), A("div", { className: "ff-data-list-actions", children: [g($.Link, { icon: "icon-reload", widget: () => a() }), g($.Link, { icon: "icon-setting" })] })] }); +}, li = ({ isItemGridLayout: e, theme: t, themeProps: i, onClickCallback: n, onReload: r, listCode: a, total: o = 0, page: s = 0, onPageChange: l, pageSize: u = 30, onPageSizeChange: p, tab: d, onTabChange: f, keyword: m, onKeywordChange: h, condition: b, onConditionChange: C, sider: x, onSiderChange: T, layouts: P, classNames: O = {}, ...V }) => { + const [q, I] = F(), M = Y((S, E) => { const D = { tab: d, page: s, pageSize: u, keyword: m, sider: x, condition: b, total: o }; return S && S != "init" ? c.get(D, S, E) : D; }, [JSON.stringify(b), d, s, u, m, x, o]), N = H(() => { @@ -344,16 +344,16 @@ const sn = ({ className: e, operations: t, isOperations: i, isPaginate: n }) => t ? oe.getWidgetComponent(t).then((S) => { if (!S) throw `${t} not found`; return S; - }).catch((S) => ({ default: () => `${S}` })).then((S) => V(k.createElement(S.default, { ...z, layouts: N, $setting: i }))) : V(g(e ? tn : rn, { ...z, layouts: N, $setting: i })); - }, [t, i]), g(te.Provider, { value: { classNames: O, listCode: a, onClickCallback: n, onReload: r, getBase62params: I, onPageChange: l, onPageSizeChange: p, onTabChange: f, onSiderChange: T, onKeywordChange: h, onConditionChange: C }, children: q && k.cloneElement(q, z) }); + }).catch((S) => ({ default: () => `${S}` })).then((S) => I(k.createElement(S.default, { ...V, layouts: N, $setting: i }))) : I(g(e ? tn : rn, { ...V, layouts: N, $setting: i })); + }, [t, i]), g(te.Provider, { value: { classNames: O, listCode: a, onClickCallback: n, onReload: r, getBase62params: M, onPageChange: l, onPageSizeChange: p, onTabChange: f, onSiderChange: T, onKeywordChange: h, onConditionChange: C }, children: q && k.cloneElement(q, V) }); }; li.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 pe, de, Se, it; +var pe, de, Se, nt; const re = class re { constructor() { R(this, de, null); R(this, Se, /* @__PURE__ */ new Map()); - R(this, it, () => { + R(this, nt, () => { if (y(this, de)) return y(this, de).port.postMessage({ command: "status", data: [] }); W(this, de, new SharedWorker(new URL("/ff-worker/res-ws.js", self.location))), y(this, de).port.onmessage = (t) => { var i, n; @@ -365,21 +365,21 @@ const re = class re { }); }, y(this, de).port.postMessage({ command: "status", data: [] }); }); - v(this, "subscribe", (t, i = []) => (i ? Array.isArray(i) && i.length == 0 ? i = "*" : Array.isArray(i) || (i = [i].flat()) : i = "*", y(this, Se).set(t, i), y(this, Se).size == 1 && y(this, it).call(this), () => this.unsubscribe(t))); + v(this, "subscribe", (t, i = []) => (i ? Array.isArray(i) && i.length == 0 ? i = "*" : Array.isArray(i) || (i = [i].flat()) : i = "*", y(this, Se).set(t, i), y(this, Se).size == 1 && y(this, nt).call(this), () => this.unsubscribe(t))); v(this, "unsubscribe", (t) => y(this, Se).delete(t)); if (y(re, pe)) return y(re, pe); } }; -pe = new WeakMap(), de = new WeakMap(), Se = new WeakMap(), it = new WeakMap(), R(re, pe, null), v(re, "getInstance", () => (y(re, pe) || W(re, pe, new re()), y(re, pe))); +pe = new WeakMap(), de = new WeakMap(), Se = new WeakMap(), nt = new WeakMap(), R(re, pe, null), v(re, "getInstance", () => (y(re, pe) || W(re, pe, new re()), y(re, pe))); let yt = re; const ci = yt.getInstance(), Pt = k.forwardRef(({ listCode: e, base62params: t, className: i, theme: n, themeProps: r, layouts: a, classNames: o }, s) => { - const [{ resource: l, primaryKey: u, batchOperations: p = [], itemOperations: d = [], columns: f = [], themeConfig: m, theme: h, isConditionFormLayout: b = !1, isTreeSider: C, treeSiderConfig: x, isItemGridLayout: T, itemGridLayout: P, title: O, isPaginate: z, tabs: q }, V] = F({ isItemGridLayout: !1, itemGridLayout: {} }), I = en(e, t), [{ dataSource: N, itemOperationsAccess: S, condition: E, tab: D, keyword: X, page: ve, total: K, pageSize: ot, sider: He, onConditionChange: lt, onTabChange: Et, onKeywordChange: bi, onPageChange: Ci, onPageSizeChange: ki, onSiderChange: xi, onReload: ct }, Rt] = Zi(I, e, u, l), Si = ft(d, S, N, u), vi = ft(p); + const [{ resource: l, primaryKey: u, batchOperations: p = [], itemOperations: d = [], columns: f = [], themeConfig: m, theme: h, isConditionFormLayout: b = !1, isTreeSider: C, treeSiderConfig: x, isItemGridLayout: T, itemGridLayout: P, title: O, isPaginate: V, tabs: q }, I] = F({ isItemGridLayout: !1, itemGridLayout: {} }), M = en(e, t), [{ dataSource: N, itemOperationsAccess: S, condition: E, tab: D, keyword: X, page: ve, total: K, pageSize: ot, sider: Ke, onConditionChange: lt, onTabChange: Et, onKeywordChange: bi, onPageChange: Ci, onPageSizeChange: ki, onSiderChange: xi, onReload: ct }, Rt] = Zi(M, e, u, l), Si = ft(d, S, N, u), vi = ft(p); return j(() => { - let Ke = null; - return e && L.get(`/api/_/${e}`).resp(({ data: Je, res: Pi }) => { - Je != null && Je.isDynamicRefresh && (Ke = ci.subscribe(() => ct(), Pi)), V(Je); - }).catch(() => V({})), () => Ke == null ? void 0 : Ke(); - }, [e]), k.useImperativeHandle(s, () => ({ onReload: ct, onClickCallback: Rt })), g(li, { listCode: e, title: O, classNames: o, layouts: a, resource: l, primaryKey: u, theme: n || h, themeProps: r || m, isTreeSider: C, treeSiderConfig: x, isPaginate: z, tabs: q, isItemOperations: Si, isBatchOperations: vi, batchOperations: p, itemOperations: d, isItemGridLayout: T, columns: f, itemGridLayout: P, isConditionFormLayout: b, itemOperationsAccess: S, dataSource: N, onConditionChange: lt, onTabChange: Et, onKeywordChange: bi, onPageChange: Ci, onPageSizeChange: ki, onSiderChange: xi, condition: E, tab: D, keyword: X, page: ve, total: K, pageSize: ot, sider: He, className: M("ff-data-list-helper", i), onReload: ct, onClickCallback: Rt }); + let Je = null; + return e && L.get(`/api/_/${e}`).resp(({ data: _e, res: Pi }) => { + _e != null && _e.isDynamicRefresh && (Je = ci.subscribe(() => ct(), Pi)), I(_e); + }).catch(() => I({})), () => Je == null ? void 0 : Je(); + }, [e]), k.useImperativeHandle(s, () => ({ onReload: ct, onClickCallback: Rt })), g(li, { listCode: e, title: O, classNames: o, layouts: a, resource: l, primaryKey: u, theme: n || h, themeProps: r || m, isTreeSider: C, treeSiderConfig: x, isPaginate: V, tabs: q, isItemOperations: Si, isBatchOperations: vi, batchOperations: p, itemOperations: d, isItemGridLayout: T, columns: f, itemGridLayout: P, isConditionFormLayout: b, itemOperationsAccess: S, dataSource: N, onConditionChange: lt, onTabChange: Et, onKeywordChange: bi, onPageChange: Ci, onPageSizeChange: ki, onSiderChange: xi, condition: E, tab: D, keyword: X, page: ve, total: K, pageSize: ot, sider: Ke, className: z("ff-data-list-helper", i), onReload: ct, onClickCallback: Rt }); }), di = (e, t, i = !0) => i !== !0 && i-- <= 0 ? [] : c.isArray(e) && !c.isEmpty(e) ? e.reduce((n, r) => (Reflect.has(r, t) && Reflect.has(r, "children") && n.push(r[t]), Reflect.has(r, "children") && !c.isEmpty(r.children) ? n.concat(di(r.children, t, i)) : n), []) : [], dn = ({ className: e, primaryKey: t, columns: i = [], dataSource: n = [], operationRender: r, operationWidth: a = 180, ...o }) => { const { classNames: s } = le(te); Le(); @@ -396,7 +396,7 @@ const ci = yt.getInstance(), Pt = k.forwardRef(({ listCode: e, base62params: t, }; }, []); const h = Qi(i); - return g("div", { ref: u, className: M("ff-data-list-table", s.content, e), children: f.height ? g(Ai, { ...o, ref: l, rowKey: (b) => (b == null ? void 0 : b[t]) ?? Math.random(), columns: h == null ? void 0 : h.concat(r ? [{ title: "操作", align: "center", fixed: "right", width: `${Math.ceil(a / f.width * 100).toFixed(2)}%`, render: (b, C, x) => r(C, x) }] : []), dataSource: n, size: "middle", scroll: { x: "max-content", y: f.height - 50 }, pagination: !1, expandable: { defaultExpandAllRows: !0, expandRowByClick: !0, onExpandedRowsChange: d, expandedRowKeys: p } }) : null }); + return g("div", { ref: u, className: z("ff-data-list-table", s.content, e), children: f.height ? g(Ai, { ...o, ref: l, rowKey: (b) => (b == null ? void 0 : b[t]) ?? Math.random(), columns: h == null ? void 0 : h.concat(r ? [{ title: "操作", align: "center", fixed: "right", width: `${Math.ceil(a / f.width * 100).toFixed(2)}%`, render: (b, C, x) => r(C, x) }] : []), dataSource: n, size: "middle", scroll: { x: "max-content", y: f.height - 50 }, pagination: !1, expandable: { defaultExpandAllRows: !0, expandRowByClick: !0, onExpandedRowsChange: d, expandedRowKeys: p } }) : null }); }, un = "RC_FORM_INTERNAL_HOOKS", gn = (e, { initialValue: t, initialValueLanguage: i, convertJs: n, convertJsSetting: r, type: a = "string" }, o = null) => { const s = U(!1), l = le(Gt), [u, p] = F(), [d, f] = F(i != "javascript" && e ? l.getFieldValue(e) : void 0), { registerWatch: m } = l.getInternalHooks(un) || {}; return j(() => m == null ? void 0 : m((h, b, C) => { @@ -405,8 +405,8 @@ const ci = yt.getInstance(), Pt = k.forwardRef(({ listCode: e, base62params: t, c.isEqual(x, d) || f(Z(x, a)); }), [d]), j(() => { i == "javascript" && t ? Ce.exec(t, {}, { getFieldValueForBasicForm: (h) => o ? o.getFieldValue(h) : l.getFieldValue(h), getFieldValue: (h) => l.getFieldValue(h) }).then((h) => f(Z(h, a))).catch((h) => notification.error({ message: `布局数据错误: ${JSON.stringify(h)}` })).finally(() => s.current = !0) : (t && f(Z(t ?? l.getFieldValue(e), a)), s.current = !0); - }, [t, i]), Ue(() => { - s.current && n && new Qe([n, r]).toValue(d, l.getFieldsValue(!0)).then(p).catch((h) => { + }, [t, i]), We(() => { + s.current && n && new Ze([n, r]).toValue(d, l.getFieldsValue(!0)).then(p).catch((h) => { p(h), console.error("布局数据转换错误: ", h, n); }); }, [d, n, r]), [u ?? d, d]; @@ -426,7 +426,7 @@ const ci = yt.getInstance(), Pt = k.forwardRef(({ listCode: e, base62params: t, return g(e, { ...T, value: h, rawValue: b, $setting: Object.assign({}, o, x) }); }, gi = ({ className: e, cols: t = 12, rowHeight: i = 21, containerPadding: n = [0, 0], itemMargin: r = [4, 0], formProps: a = {}, fields: o = [], data: s, basicForm: l = null, ...u }) => { const [p] = ee.useForm(), d = ui(o, pn, l), f = H(() => [{ name: "__PROPS__", value: a }], [a]); - return Ue(() => (p.setFieldsValue(s), () => p.resetFields()), [s]), g(ee, { fields: f, form: p, component: !1, children: g("div", { ...u, className: M("ff-grid-layout", e), style: { "--grid-layout-item-margin-y": `${(r == null ? void 0 : r[0]) || 0}px`, "--grid-layout-item-margin-x": `${(r == null ? void 0 : r[1]) || 0}px`, "--grid-layout-container-padding-y": `${(n == null ? void 0 : n[0]) || 0}px`, "--grid-layout-container-padding-x": `${(n == null ? void 0 : n[1]) || 0}px`, "--grid-layout-cols": t, "--grid-layout-row-height": `${i}px` }, children: d }) }); + return We(() => (p.setFieldsValue(s), () => p.resetFields()), [s]), g(ee, { fields: f, form: p, component: !1, children: g("div", { ...u, className: z("ff-grid-layout", e), style: { "--grid-layout-item-margin-y": `${(r == null ? void 0 : r[0]) || 0}px`, "--grid-layout-item-margin-x": `${(r == null ? void 0 : r[1]) || 0}px`, "--grid-layout-container-padding-y": `${(n == null ? void 0 : n[0]) || 0}px`, "--grid-layout-container-padding-x": `${(n == null ? void 0 : n[1]) || 0}px`, "--grid-layout-cols": t, "--grid-layout-row-height": `${i}px` }, children: d }) }); }, fr = (zt = gi, function({ code: e, data: t, ...i }) { const [n, r] = F({ resource: null, cols: 12, rowHeight: 21, fields: [] }); return j(() => { @@ -436,12 +436,12 @@ const ci = yt.getInstance(), Pt = k.forwardRef(({ listCode: e, base62params: t, var zt; const hn = ({ cols: e, rowHeight: t, itemMargin: i, fields: n, primaryKey: r, dataSource: a, itemClassName: o, itemRender: s = (d, f, m) => d, empty: l = g(ji, { description: null }), className: u, style: p = {} }) => { const { classNames: d } = le(te), f = Le(), m = H(() => g(gi, { cols: e, rowHeight: t, itemMargin: i, fields: n, className: o }), [n, e, t, i]); - return g("div", { className: M("ff-data-list-content", d.content, u), style: p, children: c.isEmpty(a) ? l : a.map((h, b) => { + return g("div", { className: z("ff-data-list-content", d.content, u), style: p, children: c.isEmpty(a) ? l : a.map((h, b) => { const C = s(k.cloneElement(m, { data: h }), h, b); return k.cloneElement(C, { key: `${f}-${(h == null ? void 0 : h[r]) || b}` }); }) }); }, fn = ({ component: e, $props: t }) => { - const { base62params: i } = rt(t, {}); + const { base62params: i } = Ue(t, {}); return g(G, { children: g(Pt, { listCode: e, base62params: L.decode(i) }) }); }, yn = () => "Empty", wn = ({ component: e, $setting: t, $props: i }) => { const [n, r] = F(); @@ -449,7 +449,7 @@ const hn = ({ cols: e, rowHeight: t, itemMargin: i, fields: n, primaryKey: r, da if (!e) return r(g(yn, { description: null })); oe.getWidgetComponent(e).catch((o) => ({ default: () => `${o}` })).then((o) => k.createElement(o.default, { $setting: t })).then(r); }, [e]); - const a = rt(i, {}); + const a = Ue(i, {}); return n ? k.cloneElement(n, a) : null; }; var me, Q, he, fe, Be, De; @@ -520,9 +520,9 @@ const ae = class ae { }); v(this, "createBrowserRouter", (t = {}) => { if (y(this, Q).size == 0) return null; - const i = Ae.get("Common.WEBSITE_DEFAULT_THEME", "@pkg/ff/frameworks/DefaultTheme"), n = Ae.get(oe.checkUserToken() ? "Common.WEBSITE_LOGIN_REDIRECT" : "Common.WEBSITE_DEFAULT", "/index"), r = { [i]: 0 }, a = (s, l) => () => oe.getWidgetComponent(s).then((u) => u.default || function() { + const i = Ae.get("Common.WEBSITE_DEFAULT_THEME", "@pkg/ff/frameworks/DefaultTheme"), n = Ae.get(oe.checkUserToken() ? "Common.WEBSITE_LOGIN_REDIRECT" : "Common.WEBSITE_DEFAULT", "/index"), r = { [i]: 0 }, a = (s, l) => () => Promise.all([oe.getWidgetComponent(s), Ue(l)]).then(([u, p]) => [u.default || function() { return `${s}`; - }).then((u) => ({ Component: () => k.createElement(Zt, {}, k.createElement(u, l)) })), o = Array.from(y(this, Q).values()).reduce((s, { uuid: l, uri: u, name: p, type: d, component: f, widgetSetting: m, widgetProps: h, isLogin: b, isLayout: C, extra: x }) => { + }, p]).then(([u, p]) => ({ Component: () => k.createElement(Zt, {}, k.createElement(u, p)) })), o = Array.from(y(this, Q).values()).reduce((s, { uuid: l, uri: u, name: p, type: d, component: f, widgetSetting: m, widgetProps: h, isLogin: b, isLayout: C, extra: x }) => { let T = {}, P = 0; switch (d) { case "list": @@ -533,7 +533,8 @@ const ae = class ae { } const O = (x == null ? void 0 : x.theme) ?? (x == null ? void 0 : x.layout); if (O) { - if (!r[O]) return r[O] = s.length, [...s, { path: "/", lazy: a(O, {}), children: [{ path: u, ...T }] }]; + const V = (x == null ? void 0 : x.themeProps) ?? (x == null ? void 0 : x.layoutProps); + if (!r[O]) return r[O] = s.length, [...s, { path: "/", lazy: a(O, V), children: [{ path: u, ...T }] }]; P = r[O]; } return C && P > -1 ? (s[P].children.push({ path: u, ...T }), s) : [...s, { path: u, ...T }]; @@ -546,12 +547,12 @@ const ae = class ae { me = new WeakMap(), Q = new WeakMap(), he = new WeakMap(), fe = new WeakMap(), Be = new WeakMap(), De = new WeakMap(), R(ae, me, null), v(ae, "getInstance", () => (y(ae, me) || W(ae, me, new ae()), y(ae, me))); let wt = ae; const bn = ({ to: e, replace: t }) => Xt() ? k.createElement(Ki, { to: e, replace: t }) : (window.document.location = e, "redirect"), be = wt.getInstance(), Pe = new Worker(new URL("/ff-worker/index.js", self.location)), Bt = { getConfigure: (e) => Ae.get(e), route: { redirect: (...e) => be.redirect(...e), getPageParams: (...e) => be.getPageParams(...e), getCurrentRoute: () => be.getCurrentRoute() }, popup: { notification: (...e) => _.notification(...e), success: (...e) => _.success(...e), error: (...e) => _.error(...e), form: (...e) => _.form(...e), modal: (...e) => _.modal(...e), confirm: (...e) => _.confirm(...e) } }; -var nt, Fe, ye; +var rt, Fe, ye; const B = class B { constructor() { v(this, "exec", (t, i = {}, n = {}, r = "") => new Promise((a, o) => { if (!/^(?!\s*(\/\/|\/\*|\*)).*?\S+/m.test(t)) return a(); - const s = At(B, nt)._++; + const s = At(B, rt)._++; y(B, Fe).set(s, n), B.mQueue.set(s, [a, o]), Pe.postMessage({ id: s, session: r, category: "eval", method: t, args: i }); })); v(this, "clear", (t) => Pe.postMessage({ session: t, category: "clear" })); @@ -574,7 +575,7 @@ const B = class B { }, !1); } }; -nt = new WeakMap(), Fe = new WeakMap(), ye = new WeakMap(), v(B, "mQueue", /* @__PURE__ */ new Map()), R(B, nt, 0), R(B, Fe, /* @__PURE__ */ new Map()), R(B, ye, null), v(B, "getInstance", () => (y(B, ye) || W(B, ye, new B()), y(B, ye))); +rt = new WeakMap(), Fe = new WeakMap(), ye = new WeakMap(), v(B, "mQueue", /* @__PURE__ */ new Map()), R(B, rt, 0), R(B, Fe, /* @__PURE__ */ new Map()), R(B, ye, null), v(B, "getInstance", () => (y(B, ye) || W(B, ye, new B()), y(B, ye))); let bt = B; const Ce = bt.getInstance(), at = () => { const e = U(!0), [, t] = k.useReducer((i) => i + 1, 0); @@ -591,11 +592,11 @@ const Ce = bt.getInstance(), at = () => { return j(() => { n.current && (n.current(t), n.current = null); }, [t]), [t, r]; -}, Ue = (e = (n) => { +}, We = (e = (n) => { }, t, i = c.isEqual) => { const n = k.useRef(); i(t, n.current) || (n.current = c.cloneDeep(t)), k.useEffect(e, [n.current]); -}, st = Ue, pi = (e, t = "string") => { +}, st = We, pi = (e, t = "string") => { var i; if (!Array.isArray(e)) return e; for (let n = 0; n < e.length; n++) e[n].value = Z((i = e[n]) == null ? void 0 : i.value, t), e[n] && Reflect.has(e[n], "children") && (e[n].children = pi(e[n].children, t)); @@ -611,7 +612,7 @@ const Ce = bt.getInstance(), at = () => { const [t, i] = F(), n = { type: "GET" }; if (typeof e == "string" ? n.url = e : c.isPlainObject(e) && Object.assign(n, e), !(n != null && n.url)) throw "url is required"; const r = (a) => L.request(n, !1).resp((o) => (console.log("useSubscribeRequest", a), i(o), o)); - return Ue(() => { + return We(() => { let a = null; return r().then((o) => { a = ci.subscribe(c.throttle(r, 180, { leading: !1, trailing: !0 }), o.res); @@ -713,12 +714,12 @@ const Ce = bt.getInstance(), at = () => { }, [s]), u && k.cloneElement(u, { ...a, ...l }); }, Pn = (e, t = {}, i = null) => (n) => { const { type: r, code: a, label: o, noStyle: s, placeholder: l, required: u = !1, extras: p, validators: d, help: f, isVirtual: m, $isReserved: h, initialValue: b, initialValueLanguage: C, ...x } = c.omit(c.merge({}, t, n), ["convertJs", "convertJsSetting", "widget", "widgetPerfix", "widgetDecorator", "subWidgets", "boxStyle"]), T = kn(Object.assign({}, d, u ? { required: !0 } : {}), a, r), P = H(() => { - const I = Object.keys((t == null ? void 0 : t.extras) || {}); - return c.over([c.partialRight(c.pick, I), c.partialRight(c.omit, I)]); - }, [t == null ? void 0 : t.extras]), [O, z] = P(x), q = { label: o, noStyle: s, colon: !1, layout: "vertical" }, V = Y((I) => I == null ? void 0 : Z(I, r), [r]); - return g(Yt, { name: a, rules: T, initialValue: V(b), normalize: V, children: (I, N, S) => { + const M = Object.keys((t == null ? void 0 : t.extras) || {}); + return c.over([c.partialRight(c.pick, M), c.partialRight(c.omit, M)]); + }, [t == null ? void 0 : t.extras]), [O, V] = P(x), q = { label: o, noStyle: s, colon: !1, layout: "vertical" }, I = Y((M) => M == null ? void 0 : Z(M, r), [r]); + return g(Yt, { name: a, rules: T, initialValue: I(b), normalize: I, children: (M, N, S) => { var E; - return g(e, { type: r, rcform: S, basicForm: i, itemProps: { validateStatus: N.errors.length > 0 ? "error" : "success", tooltip: f, help: N.errors.length > 0 ? N.errors.join("、") : null, required: ((E = T == null ? void 0 : T[0]) == null ? void 0 : E.required) || !1, ...q }, fieldProps: { placeholder: l, ...z, ...I }, $setting: Object.assign({}, p, O) }); + return g(e, { type: r, rcform: S, basicForm: i, itemProps: { validateStatus: N.errors.length > 0 ? "error" : "success", tooltip: f, help: N.errors.length > 0 ? N.errors.join("、") : null, required: ((E = T == null ? void 0 : T[0]) == null ? void 0 : E.required) || !1, ...q }, fieldProps: { placeholder: l, ...V, ...M }, $setting: Object.assign({}, p, O) }); } }); }, $t = ({ cols: e = 24, rowHeight: t = 16, itemMargin: i = [8, 16], containerPadding: n = [0, 0], fields: r = [], children: a, basicForm: o = null }) => { const s = ui(r, hi, o); @@ -727,10 +728,10 @@ const Ce = bt.getInstance(), at = () => { $t.propTypes = { fields: w.array }; const $n = (qt = $t, ({ code: e, layout: t, name: i, primaryKey: n = 0, style: r = {}, formProps: a = {}, form: o, basicForm: s, isPreview: l = !1, className: u, onFinish: p, onValuesChange: d = () => { }, ...f }) => { - const { align: m, autoComplete: h, resource: b, items: C, hides: x, rowHeight: T, marginX: P, marginY: O, cols: z, listenChangeFields: q, listenChangeFieldsFunc: V, pk: I, uuid: N } = Cn(e), [S] = ee.useForm(o), E = H(() => [{ name: "__PK__", value: I }, { name: "__PROPS__", value: a }, { name: "__RESOURCE__", value: b }, { name: "__LAYOUT_KEY__", value: e }, { name: "__LAYOUT_UUID__", value: N }, { name: "__PRIMARY_KEY__", value: n }], [I, e, N, b, n, a]); - return A(ee, { className: u, name: i || e, layout: t || m, fields: E, form: S, autoComplete: h, style: { ...r, position: "relative" }, onFinish: p, onValuesChange: (D, X) => (({ changedValues: ve, allValues: K, listenChangeFields: ot, listenChangeFieldsFunc: He, onValuesChange: lt, code: Et }) => { - lt(ve, K), He && Array.isArray(ot) && Ce.exec(He, { changedValues: ve, allValues: K }, { getFieldValue: S.getFieldValue, setFieldValue: S.setFieldValue, setFieldsValue: S.setFieldsValue, isFieldTouched: S.isFieldTouched, isFieldsTouched: S.isFieldsTouched }); - })({ changedValues: D, allValues: X, listenChangeFields: q, listenChangeFieldsFunc: V, onValuesChange: d, code: e }), children: [g(qt, { ...f, form: S, basicForm: s, code: e, fields: C, cols: z, rowHeight: T, itemMargin: [P, O] }), x == null ? void 0 : x.map((D) => { + const { align: m, autoComplete: h, resource: b, items: C, hides: x, rowHeight: T, marginX: P, marginY: O, cols: V, listenChangeFields: q, listenChangeFieldsFunc: I, pk: M, uuid: N } = Cn(e), [S] = ee.useForm(o), E = H(() => [{ name: "__PK__", value: M }, { name: "__PROPS__", value: a }, { name: "__RESOURCE__", value: b }, { name: "__LAYOUT_KEY__", value: e }, { name: "__LAYOUT_UUID__", value: N }, { name: "__PRIMARY_KEY__", value: n }], [M, e, N, b, n, a]); + return A(ee, { className: u, name: i || e, layout: t || m, fields: E, form: S, autoComplete: h, style: { ...r, position: "relative" }, onFinish: p, onValuesChange: (D, X) => (({ changedValues: ve, allValues: K, listenChangeFields: ot, listenChangeFieldsFunc: Ke, onValuesChange: lt, code: Et }) => { + lt(ve, K), Ke && Array.isArray(ot) && Ce.exec(Ke, { changedValues: ve, allValues: K }, { getFieldValue: S.getFieldValue, setFieldValue: S.setFieldValue, setFieldsValue: S.setFieldsValue, isFieldTouched: S.isFieldTouched, isFieldsTouched: S.isFieldsTouched }); + })({ changedValues: D, allValues: X, listenChangeFields: q, listenChangeFieldsFunc: I, onValuesChange: d, code: e }), children: [g(qt, { ...f, form: S, basicForm: s, code: e, fields: C, cols: V, rowHeight: T, itemMargin: [P, O] }), x == null ? void 0 : x.map((D) => { var X; return g(Yt, { name: D.code, children: g(vn, { form: S, basicForm: s, name: D.code, type: D.type, initialValue: D.initialValue, initialValueLanguage: (X = D.extras) == null ? void 0 : X.initialValueLanguage }) }, JSON.stringify(D.code)); })] }, e); @@ -754,7 +755,7 @@ const fi = ({ $setting: e, $close: t, extras: i, code: n, primaryKey: r, ...a }) Ct(e, t + 1); }), Ut.add(i), document.body.appendChild(n); } -}, kt = ({ className: e, type: t, style: i = {}, ...n }) => g("span", { role: "img", className: M("ff-iconfont", e), style: i, ...n, children: g("svg", { style: { width: "1em", height: "1em", fill: "currentColor", overflow: "hidden" }, viewBox: "0 0 1024 1024", children: g("use", { xlinkHref: `#${t}` }) }) }); +}, kt = ({ className: e, type: t, style: i = {}, ...n }) => g("span", { role: "img", className: z("ff-iconfont", e), style: i, ...n, children: g("svg", { style: { width: "1em", height: "1em", fill: "currentColor", overflow: "hidden" }, viewBox: "0 0 1024 1024", children: g("use", { xlinkHref: `#${t}` }) }) }); kt.propTypes = { className: w.string, type: w.string.isRequired, style: w.object }, kt.init = Ct; const Tn = (e, t, i, { isReplaceRouteHistory: n = !1 } = {}) => be.redirect(i, t, { replace: n }), Nn = (e, t = {}, i, n = {}) => { var a; @@ -790,39 +791,39 @@ const Tn = (e, t, i, { isReplaceRouteHistory: n = !1 } = {}) => be.redirect(i, t } return (...f) => console.error("useButton unknown widgetType", t, ...f); }, [e, t]); - return [c.debounce((f) => (s == null || s(f), Promise.resolve(rt(n, f, { list: l })).then((m) => d(f, { ...i, ...m })).then((m) => o == null ? void 0 : o(m)).catch(console.error)), 300, { leading: !0, trailing: !1 }), u]; + return [c.debounce((f) => (s == null || s(f), Promise.resolve(Ue(n, f, { list: l })).then((m) => d(f, { ...i, ...m })).then((m) => o == null ? void 0 : o(m)).catch(console.error)), 300, { leading: !0, trailing: !1 }), u]; }, yi = ({ type: e, name: t, className: i, icon: n, iconPosition: r, size: a }, o = "default") => H(() => { - const s = { type: "primary", className: M("ff-button", i), iconPosition: r, size: a }; - return e === "danger" ? s.danger = !0 : e === "default" && (s.type = e), o === "link" || o === "dashed" ? (s.type = o, e === "default" && (s.className = M(s.className, "ff-default"))) : o !== "circle" && o !== "round" || (s.shape = o), n && (s.icon = g(kt, { type: n })), t && (s.children = t), s; -}, [o, e, i, n, r]), We = (e) => function({ className: t, variant: i, children: n, name: r, icon: a, type: o = "default", iconPosition: s = "start", noAuthType: l, onAfterClick: u, onBeforeClick: p, data: d, loading: f, disabled: m, tooltip: h, confirm: b, widget: C = () => { -}, widgetType: x, widgetData: T, widgetProps: P, widgetSetting: O, widgetContainerProps: z, ...q }) { - const V = c.isEmpty(h) || !h.enabled ? {} : h, I = c.isEmpty(b) ? { enabled: !1 } : Object.assign({ enabled: !0 }, b), N = yi({ className: t, name: r, type: o, icon: a, iconPosition: s }, i ?? e), [S, E] = F(!1), [D, { disabled: X, loading: ve }] = Rn({ widget: C, widgetType: x, widgetData: T, widgetProps: P, widgetSetting: O, widgetContainerProps: z }, { onAfterClick: u, onBeforeClick: p }); - return g(Vi, { okText: "确定", cancelText: "取消", getPopupContainer: (K) => K, ...I, disabled: X || m, open: S, onOpenChange: (K) => { + const s = { type: "primary", className: z("ff-button", i), iconPosition: r, size: a }; + return e === "danger" ? s.danger = !0 : e === "default" && (s.type = e), o === "link" || o === "dashed" ? (s.type = o, e === "default" && (s.className = z(s.className, "ff-default"))) : o !== "circle" && o !== "round" || (s.shape = o), n && (s.icon = g(kt, { type: n })), t && (s.children = t), s; +}, [o, e, i, n, r]), He = (e) => function({ className: t, variant: i, children: n, name: r, icon: a, type: o = "default", iconPosition: s = "start", noAuthType: l, onAfterClick: u, onBeforeClick: p, data: d, loading: f, disabled: m, tooltip: h, confirm: b, widget: C = () => { +}, widgetType: x, widgetData: T, widgetProps: P, widgetSetting: O, widgetContainerProps: V, ...q }) { + const I = c.isEmpty(h) || !h.enabled ? {} : h, M = c.isEmpty(b) ? { enabled: !1 } : Object.assign({ enabled: !0 }, b), N = yi({ className: t, name: r, type: o, icon: a, iconPosition: s }, i ?? e), [S, E] = F(!1), [D, { disabled: X, loading: ve }] = Rn({ widget: C, widgetType: x, widgetData: T, widgetProps: P, widgetSetting: O, widgetContainerProps: V }, { onAfterClick: u, onBeforeClick: p }); + return g(Vi, { okText: "确定", cancelText: "取消", getPopupContainer: (K) => K, ...M, disabled: X || m, open: S, onOpenChange: (K) => { if (!K) return E(K); - I.enabled ? E(K) : D(d); + M.enabled ? E(K) : D(d); }, onConfirm: () => { D(d); }, onClick: (K) => { K.stopPropagation(); - }, children: g(Ii, { getPopupContainer: (K) => K, ...V, title: S ? null : V == null ? void 0 : V.title, trigger: ["hover", "click"], children: g(Xe, { loading: ve || f, disabled: X || m, ...N, ...q, children: n || r }) }) }); -}, $ = We("default"); + }, children: g(Ii, { getPopupContainer: (K) => K, ...I, title: S ? null : I == null ? void 0 : I.title, trigger: ["hover", "click"], children: g(Qe, { loading: ve || f, disabled: X || m, ...N, ...q, children: n || r }) }) }); +}, $ = He("default"); $.propTypes = { type: w.oneOf(["primary", "default", "danger", ""]), size: w.oneOf(["large", "middle", "small"]), name: w.string, icon: w.string, iconPosition: w.oneOf(["start", "end"]), data: w.any, widget: w.any, widgetType: w.oneOf(["destroy", "redirect", "func", "fsdpf-component", "grid-layout-form", "grid-layout", "data-list"]), widgetData: w.object, widgetProps: w.object, widgetSetting: w.object, widgetContainerProps: w.object, tooltip: w.exact({ title: w.string.isRequired, placement: w.oneOf(["top", "left", "right", "bottom", "topLeft", "topRight", "bottomLeft", "bottomRight", "leftTop", "leftBottom", "rightTop", "rightBottom"]), enabled: w.oneOfType([w.bool, w.number]), getPopupContainer: w.func }), confirm: w.exact({ title: w.string.isRequired, cancelText: w.string, okText: w.string, okType: w.oneOf(["primary", "default", "danger", ""]), placement: w.oneOf(["top", "left", "right", "bottom", "topLeft", "topRight", "bottomLeft", "bottomRight", "leftTop", "leftBottom", "rightTop", "rightBottom"]), enabled: w.oneOfType([w.bool, w.number]), getPopupContainer: w.func, arrow: w.oneOfType([w.bool, w.exact({ pointAtCenter: w.bool })]) }) }; -const On = We("link"), Ln = We("circle"), An = We("round"), jn = We("dashed"), Tt = ({ data: e, widget: t, widgetType: i = "fsdpf-component", widgetData: n, widgetProps: r, widgetSetting: a, widgetContainerProps: o, onAfterClick: s, onBeforeClick: l, children: u, extras: p }) => { - const d = le(te), [f, m] = F(!1), [h, b] = F("hover"), [C, x] = F({}), [T, P] = F(), { placement: O, align: z, arrow: q = { pointAtCenter: !0 }, getPopupContainer: V, ...I } = o || {}; +const On = He("link"), Ln = He("circle"), An = He("round"), jn = He("dashed"), Tt = ({ data: e, widget: t, widgetType: i = "fsdpf-component", widgetData: n, widgetProps: r, widgetSetting: a, widgetContainerProps: o, onAfterClick: s, onBeforeClick: l, children: u, extras: p }) => { + const d = le(te), [f, m] = F(!1), [h, b] = F("hover"), [C, x] = F({}), [T, P] = F(), { placement: O, align: V, arrow: q = { pointAtCenter: !0 }, getPopupContainer: I, ...M } = o || {}; j(() => { i == "grid-layout-form" ? P(k.createElement(fi, { ...n, $setting: a, code: t })) : i == "data-list" ? P(k.createElement(Pt, { base62params: e, $setting: a, listCode: t })) : c.isString(t) ? oe.getWidgetComponent(t).then(({ default: E }) => { P(k.createElement(E, { ...n, $setting: a })); }).catch((E) => P(E.toString())) : Ft(t) ? P(k.createElement(t, { ...n, $setting: a })) : k.isValidElement(t) && P(k.cloneElement(t, { ...n, $setting: a })); }, [t, i, n]), j(() => { - Promise.resolve(rt(r, e, { list: d })).then(x); + Promise.resolve(Ue(r, e, { list: d })).then(x); }, [r, e, d.getBase62params]); const N = (E, D = !1) => (m(E), !E && b("hover"), E ? l == null ? void 0 : l(C) : s == null ? void 0 : s(D)), S = (E) => { m(!0), b("click"); }; - return g(Mi, { zIndex: 1080, placement: O, onPopupClick: S, onClick: S, open: f, align: z, arrow: q, trigger: h, getPopupContainer: V, content: g(Vn, { ...I, extras: p, children: T && k.cloneElement(T, { ...C, $close: (E) => N(!1, E) }) }), children: u, onOpenChange: N }); + return g(Mi, { zIndex: 1080, placement: O, onPopupClick: S, onClick: S, open: f, align: V, arrow: q, trigger: h, getPopupContainer: I, content: g(Vn, { ...M, extras: p, children: T && k.cloneElement(T, { ...C, $close: (E) => N(!1, E) }) }), children: u, onOpenChange: N }); }, Vn = ({ title: e, className: t, children: i, extras: n, width: r, height: a, ...o }) => { const [s, l] = F({}), u = Y((m, h) => l((b) => ({ ...b, [m]: h })), []), p = Y((m) => l((h) => ({ ...h, [m]: void 0 })), []), d = e ? k.createElement("div", { className: "ff-popup-title" }, e) : s == null ? void 0 : s.title, f = n ?? k.createElement("div", { className: "ff-popup-reserved-extras" }, n); - return g(qe.Provider, { value: { ele: s, mount: u, unmount: p }, children: A("div", { className: M("ff-popup ff-popover", t, s.rootClassName), style: { width: r, height: a }, ...o, children: [A("div", { className: "ff-popup-header", children: [d, s == null ? void 0 : s["sub-title"]] }), i, A("div", { className: "ff-popup-footer", children: [f, s == null ? void 0 : s.extras, s == null ? void 0 : s.actions] })] }) }); + return g(qe.Provider, { value: { ele: s, mount: u, unmount: p }, children: A("div", { className: z("ff-popup ff-popover", t, s.rootClassName), style: { width: r, height: a }, ...o, children: [A("div", { className: "ff-popup-header", children: [d, s == null ? void 0 : s["sub-title"]] }), i, A("div", { className: "ff-popup-footer", children: [f, s == null ? void 0 : s.extras, s == null ? void 0 : s.actions] })] }) }); }; Tt.propTypes = { widgetType: w.oneOf(["fsdpf-component", "grid-layout-form", "data-list"]) }; const Kt = ({ options: e = [], triggerWeights: t = ["grid-layout-form", "grid-layout", "fsdpf-component", "print"], onAfterClick: i = (m, h, b) => { @@ -833,7 +834,7 @@ const Kt = ({ options: e = [], triggerWeights: t = ["grid-layout-form", "grid-la const T = t.indexOf(x.widgetType); return T === -1 ? C[1].push(x) : C[0] ? T < t.indexOf(C[0].widgetType) ? (C[1].push(C[0]), C[0] = x) : C[1].push(x) : C[0] = x, C; }, [null, []]), [e, t]); - o ? d = o(m, f) || d : d || (d = g(Xe, { ...yi(Object.assign(m != null && m.name || m != null && m.icon ? {} : { icon: "icon-location" }, m, { size: a }), r) })); + o ? d = o(m, f) || d : d || (d = g(Qe, { ...yi(Object.assign(m != null && m.name || m != null && m.icon ? {} : { icon: "icon-location" }, m, { size: a }), r) })); const b = h.map((C) => u(Object.assign({ uuid: C.uuid, type: C.type, name: C.name, widget: C.widget, widgetType: C.widgetType, widgetProps: C.widgetProps, widgetData: C.widgetData, widgetSetting: C.widgetSetting, widgetContainerProps: C.widgetContainerSetting, confirm: C.confirm, onAfterClick: c.partialRight(i, C, f), onBeforeClick: c.partialRight(n, C, f) }, { size: l, variant: s }), f)); return g(Tt, { widget: m == null ? void 0 : m.widget, widgetType: m == null ? void 0 : m.widgetType, widgetProps: m == null ? void 0 : m.widgetProps, widgetSetting: m == null ? void 0 : m.widgetSetting, widgetContainerProps: Object.assign({}, p, m == null ? void 0 : m.widgetContainerProps), data: f, widgetData: m == null ? void 0 : m.widgetData, extras: b, onAfterClick: c.partialRight(i, m, f), onBeforeClick: c.partialRight(n, m, f), children: d }); }; @@ -841,12 +842,12 @@ Kt.propTypes = { triggerWeights: w.array, options: w.arrayOf(w.shape({ ...$.prop const In = ({ fields: e, formProps: t, $close: i }) => { const [n] = ee.useForm(), r = H(() => [{ name: "__PROPS__", value: t }], [t]); return g(G, { actions: A(k.Fragment, { children: [g($, { name: "取消", widget: () => i(!1) }), g($, { name: "确定", type: "primary", widget: () => n.validateFields(!0).then(i) })] }), children: g(ee, { fields: r, form: n, className: "ff-modal-form", children: e == null ? void 0 : e.map(({ code: a, ...o }) => g(hi, { code: a, ...o }, a)) }) }); -}, Mn = ({ className: e, $close: t, children: i, title: n, subTitle: r, actions: a, extras: o, zIndex: s, ...l }) => A(Ji, { ...l, prefixCls: "ff-drawer", className: M("ff-popup", e), maskMotion: { motionAppear: !0, motionName: "mask-motion" }, motion: (u) => ({ motionAppear: !0, motionName: `panel-motion-${u}` }), children: [A("div", { className: "ff-popup-header", children: [g("button", { "aria-label": "Close", className: "ff-popup-close", onClick: l.onClose, children: g(vt, { type: "close" }) }), n, r] }), g("div", { className: "ff-popup-body", children: i }), A("div", { className: "ff-popup-footer", children: [o, a] })] }), zn = ({ className: e, $close: t, $event: i, children: n, title: r, subTitle: a, actions: o, extras: s, zIndex: l, placement: u, ...p }) => { +}, Mn = ({ className: e, $close: t, children: i, title: n, subTitle: r, actions: a, extras: o, zIndex: s, ...l }) => A(Ji, { ...l, prefixCls: "ff-drawer", className: z("ff-popup", e), maskMotion: { motionAppear: !0, motionName: "mask-motion" }, motion: (u) => ({ motionAppear: !0, motionName: `panel-motion-${u}` }), children: [A("div", { className: "ff-popup-header", children: [g("button", { "aria-label": "Close", className: "ff-popup-close", onClick: l.onClose, children: g(vt, { type: "close" }) }), n, r] }), g("div", { className: "ff-popup-body", children: i }), A("div", { className: "ff-popup-footer", children: [o, a] })] }), zn = ({ className: e, $close: t, $event: i, children: n, title: r, subTitle: a, actions: o, extras: s, zIndex: l, placement: u, ...p }) => { const d = (i == null ? void 0 : i.pageX) === void 0 ? { animation: null, maskAnimation: null, mousePosition: { x: null, y: null } } : { animation: "zoom", maskAnimation: "fade", mousePosition: { x: i == null ? void 0 : i.pageX, y: i == null ? void 0 : i.pageY } }; - return g(_i, { ...p, ...d, prefixCls: "ff-modal", modalRender: () => A("div", { className: M("ff-modal-content ff-popup", e), children: [A("div", { className: "ff-popup-header", children: [g("button", { "aria-label": "Close", className: "ff-popup-close", onClick: p.onClose, children: g(vt, { type: "close" }) }), r, a] }), g("div", { className: "ff-popup-body", children: n }), A("div", { className: "ff-popup-footer", children: [s, o] })] }) }); + return g(_i, { ...p, ...d, prefixCls: "ff-modal", modalRender: () => A("div", { className: z("ff-modal-content ff-popup", e), children: [A("div", { className: "ff-popup-header", children: [g("button", { "aria-label": "Close", className: "ff-popup-close", onClick: p.onClose, children: g(vt, { type: "close" }) }), r, a] }), g("div", { className: "ff-popup-body", children: n }), A("div", { className: "ff-popup-footer", children: [s, o] })] }) }); }, wi = ({ placement: e, $close: t, $event: i, children: n, title: r, ...a }) => { const [o, s] = F({}), [l, u] = F(!0), p = Y((h, b) => s((C) => ({ ...C, [h]: b })), []), d = Y((h) => s((b) => ({ ...b, [h]: void 0 })), []); - let f = { ...a, className: o.rootClassName, title: o.title || r && k.createElement("div", { className: M("ff-popup-title") }, r), subTitle: o["sub-title"], actions: o.actions, extras: o.extras, children: n, $close: t, $event: i, onClose: () => u(!1) }; + let f = { ...a, className: o.rootClassName, title: o.title || r && k.createElement("div", { className: z("ff-popup-title") }, r), subTitle: o["sub-title"], actions: o.actions, extras: o.extras, children: n, $close: t, $event: i, onClose: () => u(!1) }; const m = () => { t(!1); }; @@ -879,7 +880,7 @@ const Jt = (e, t, i = {}) => J.$onClick(e, t, i), ut = (e, { showProgress: t, du }), notification: ut, success: (e, t = { duration: 1.5 }) => ut(e, { ...t, className: "ff-notification-success", icon: "check" }), error: (e, t = { duration: 1.5 }) => ut(e, { ...t, className: "ff-notification-error", icon: "close" }) }; Re.configure({ showSpinner: !1 }), Oe.interceptors.request.use((e) => { e.headers.Platform = "web", e.headers.SaaS = window.localStorage.getItem("SaaS"); - const t = window.localStorage.getItem(Ye); + const t = window.localStorage.getItem(Xe); return e.headers.Authorization = t ? `Bearer ${t} ` : void 0, Re.inc(), e; }, (e) => (Re.done(), Promise.reject({ code: -1, msg: e }))), Oe.interceptors.response.use(({ data: e, headers: t }) => (Re.done(), { ...e, res: t == null ? void 0 : t.res }), function(e) { return Re.done(), Promise.reject(e.message); @@ -897,7 +898,7 @@ class je extends Error { super(...i), Error.captureStackTrace && Error.captureStackTrace(this, je), this.name = `${t} Not Found`; } } -const gt = "mine", Ye = "token"; +const gt = "mine", Xe = "token"; var we, Ee; const se = class se { constructor() { @@ -930,7 +931,7 @@ const se = class se { v(this, "getWidgetOperationAuth", () => L.get("/api/init-widget-operation-auth").then((t) => t.reduce((i, { uuid: n, auth: r }) => [...i, [n, r]], []))); v(this, "getPhoneNumber", (t) => L.get(`/api/user-wx-phone-number/${t}`)); v(this, "getUserToken", () => { - const t = window.localStorage.getItem(Ye); + const t = window.localStorage.getItem(Xe); if (!t) return ""; const i = t.split("."); if (!Array.isArray(i) || i.length !== 3) throw "登录令牌无效!"; @@ -957,8 +958,8 @@ const se = class se { } return Promise.resolve(null); }); - v(this, "login", (t, i, n = {}) => L.post("/api/user-token", { username: t, passwd: Di.hash(i), platform: "web", ...n }).then(({ token: r }) => (window.localStorage.setItem(Ye, r), r))); - v(this, "logout", (t) => (window.localStorage.removeItem(gt), window.localStorage.removeItem(Ye), t == null ? void 0 : t())); + v(this, "login", (t, i, n = {}) => L.post("/api/user-token", { username: t, passwd: Di.hash(i), platform: "web", ...n }).then(({ token: r }) => (window.localStorage.setItem(Xe, r), r))); + v(this, "logout", (t) => (window.localStorage.removeItem(gt), window.localStorage.removeItem(Xe), t == null ? void 0 : t())); if (y(se, we)) return y(se, we); } }; @@ -979,7 +980,7 @@ export { tn as A, rn as B, Qi as C, - Qe as D, + Ze as D, pr as E, mr as F, fr as G, @@ -991,7 +992,7 @@ export { at as M, yr as N, wr as O, - Ue as P, + We as P, st as Q, ci as R, br as S, @@ -1028,7 +1029,7 @@ export { be as al, Bn as am, Dn as an, - rt as b, + Ue as b, dr as c, ii as d, ur as e, diff --git a/dist/components.js b/dist/components.js index e804768..3ad8afe 100644 --- a/dist/components.js +++ b/dist/components.js @@ -1,4 +1,4 @@ -import { ab as s, a2 as p, ac as d, ad as n, aa as t } from "./common/main-DhfQBqHJ.js"; +import { ab as s, a2 as p, ac as d, ad as n, aa as t } from "./common/main-ah3d0ahB.js"; export { s as Empty, p as Icon, diff --git a/dist/container.js b/dist/container.js index b50e190..4a6d4cf 100644 --- a/dist/container.js +++ b/dist/container.js @@ -1,4 +1,4 @@ -import { a7 as o, ab as s, ac as d, ad as p, a8 as t, aa as n, a9 as r, a6 as u } from "./common/main-DhfQBqHJ.js"; +import { a7 as o, ab as s, ac as d, ad as p, a8 as t, aa as n, a9 as r, a6 as u } from "./common/main-ah3d0ahB.js"; export { o as Context, s as Empty, diff --git a/dist/data-converter.js b/dist/data-converter.js index 1470614..028a2fa 100644 --- a/dist/data-converter.js +++ b/dist/data-converter.js @@ -1,6 +1,6 @@ import "lodash"; import "react"; -import { D as p } from "./common/main-DhfQBqHJ.js"; +import { D as p } from "./common/main-ah3d0ahB.js"; export { p as default }; diff --git a/dist/data-list.js b/dist/data-list.js index 4548127..a65134d 100644 --- a/dist/data-list.js +++ b/dist/data-list.js @@ -1,4 +1,4 @@ -import { z as t, x as e, p as r, v as o, A as i, w as u, s as D, y as l, q as L, B as n, o as p, C as m, L as C, F as c, J as F, I as b, K as d, E as k } from "./common/main-DhfQBqHJ.js"; +import { z as t, x as e, p as r, v as o, A as i, w as u, s as D, y as l, q as L, B as n, o as p, C as m, L as C, F as c, J as F, I as b, K as d, E as k } from "./common/main-ah3d0ahB.js"; export { t as DataListContent, e as DataListContext, diff --git a/dist/data-list/utils.js b/dist/data-list/utils.js index af945f1..f5c3655 100644 --- a/dist/data-list/utils.js +++ b/dist/data-list/utils.js @@ -1,5 +1,5 @@ import "lodash"; -import { j as a } from "../common/main-DhfQBqHJ.js"; +import { j as a } from "../common/main-ah3d0ahB.js"; export { a as getDefaultExpandRowKeys }; diff --git a/dist/grid-layout-form.js b/dist/grid-layout-form.js index 213943e..b3e2834 100644 --- a/dist/grid-layout-form.js +++ b/dist/grid-layout-form.js @@ -1,4 +1,4 @@ -import { V as s, X as r, W as u, U as o, $ as t, _ as d, a1 as m, Z as F, Y as i, a0 as g } from "./common/main-DhfQBqHJ.js"; +import { V as s, X as r, W as u, U as o, $ as t, _ as d, a1 as m, Z as F, Y as i, a0 as g } from "./common/main-ah3d0ahB.js"; export { s as GridLayoutForm, r as GridLayoutFormHelper, diff --git a/dist/grid-layout-form/utils.js b/dist/grid-layout-form/utils.js index 203a51f..cb12f78 100644 --- a/dist/grid-layout-form/utils.js +++ b/dist/grid-layout-form/utils.js @@ -1,5 +1,5 @@ import "lodash"; -import { g as o, a as g } from "../common/main-DhfQBqHJ.js"; +import { g as o, a as g } from "../common/main-ah3d0ahB.js"; export { o as getOptionItemByValue, g as getWidgetByNormalize diff --git a/dist/grid-layout.js b/dist/grid-layout.js index 14a6e77..c1fe270 100644 --- a/dist/grid-layout.js +++ b/dist/grid-layout.js @@ -1,4 +1,4 @@ -import { k as d, l as e, H as i, G as t, m as u, n as o } from "./common/main-DhfQBqHJ.js"; +import { k as d, l as e, H as i, G as t, m as u, n as o } from "./common/main-ah3d0ahB.js"; export { d as GridLayout, e as GridLayoutWidget, diff --git a/dist/grid-layout/utils.js b/dist/grid-layout/utils.js index be14c05..3afee74 100644 --- a/dist/grid-layout/utils.js +++ b/dist/grid-layout/utils.js @@ -1,4 +1,4 @@ -import { h as o, i as a } from "../common/main-DhfQBqHJ.js"; +import { h as o, i as a } from "../common/main-ah3d0ahB.js"; export { o as getBoxStyle, a as getWidgetByNormalize diff --git a/dist/hooks.js b/dist/hooks.js index a64fb3f..f0ffeec 100644 --- a/dist/hooks.js +++ b/dist/hooks.js @@ -1,7 +1,7 @@ import "lodash"; import "rc-field-form"; import "react"; -import { Q as r, P as o, S as p, N as f, O as i, T as m, M as c } from "./common/main-DhfQBqHJ.js"; +import { Q as r, P as o, S as p, N as f, O as i, T as m, M as c } from "./common/main-ah3d0ahB.js"; import { default as S } from "rc-util/lib/hooks/useMergedState"; export { r as useDeepEffect, diff --git a/dist/iconfont.js b/dist/iconfont.js index dac7d2c..cf6a93d 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 { a2 as a } from "./common/main-DhfQBqHJ.js"; +import { a2 as a } from "./common/main-ah3d0ahB.js"; export { a as default }; diff --git a/dist/index.js b/dist/index.js index e5911e9..a6ecf3a 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1,4 +1,4 @@ -import { am as t, an as e, ai as o, aj as n, ae as p, ak as r, ah as c, ag as f, af as l, al as i } from "./common/main-DhfQBqHJ.js"; +import { am as t, an as e, ai as o, aj as n, ae as p, ak as r, ah as c, ag as f, af as l, al as i } from "./common/main-ah3d0ahB.js"; export { t as AppContext, e as AppGlobalParamsContext, diff --git a/dist/res-ws.js b/dist/res-ws.js index 8cb972e..27d716c 100644 --- a/dist/res-ws.js +++ b/dist/res-ws.js @@ -1,5 +1,5 @@ import "lodash"; -import { R as a } from "./common/main-DhfQBqHJ.js"; +import { R as a } from "./common/main-ah3d0ahB.js"; export { a as default }; diff --git a/dist/utils.js b/dist/utils.js index e5badc6..4498bfd 100644 --- a/dist/utils.js +++ b/dist/utils.js @@ -1,5 +1,5 @@ import "lodash"; -import { d as s, e as g, c as r, f as o, b as i, r as m, t as p, u as P } from "./common/main-DhfQBqHJ.js"; +import { d as s, e as g, c as r, f as o, b as i, r as m, t as p, u as P } from "./common/main-ah3d0ahB.js"; export { s as deepSome, g as getPkgCategory, diff --git a/package.json b/package.json index b847467..fb719aa 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "ff", "private": true, - "version": "0.4.66", + "version": "0.4.67", "author": "www.fsdpf.com", "type": "module", "main": "./dist/index.js",