v0.5.10
This commit is contained in:
parent
cf0d94e1a2
commit
fc150b67e6
2
dist/button.js
vendored
2
dist/button.js
vendored
@ -1,4 +1,4 @@
|
||||
import { aa as s, a9 as u, ab as e } from "./common/main-DZ2sKQPT.js";
|
||||
import { aa as s, a9 as u, ab as e } from "./common/main-C_FS7g0q.js";
|
||||
export {
|
||||
s as auth,
|
||||
u as default,
|
||||
|
@ -62,20 +62,20 @@ class ei {
|
||||
Ne = new WeakMap(), Ie = new WeakMap(), Re = new WeakMap(), ue = new WeakMap(), Se = new WeakMap(), ve = new WeakMap();
|
||||
const gr = () => p("div", { children: "Empty" }), We = x.createContext({ ele: {}, mount: () => {
|
||||
}, unmount: () => {
|
||||
} }), G = ({ rootClassName: e, className: t, children: i, actions: n, title: r, subTitle: a, extras: o, style: s = {} }) => {
|
||||
} }), Y = ({ rootClassName: e, className: t, children: i, actions: n, title: r, subTitle: a, extras: o, style: s = {} }) => {
|
||||
const { mount: l, unmount: u } = x.useContext(We);
|
||||
return G.Action({ children: n }), G.Title({ children: r }), G.SubTitle({ children: a }), G.Extra({ children: o }), A(() => (l("rootClassName", e), () => u(e)), [e]), p("div", { className: M("ff-container", t), style: s, children: i });
|
||||
return Y.Action({ children: n }), Y.Title({ children: r }), Y.SubTitle({ children: a }), Y.Extra({ children: o }), A(() => (l("rootClassName", e), () => u(e)), [e]), p("div", { className: M("ff-container", t), style: s, children: i });
|
||||
}, Ge = (e) => ({ children: t, className: i }) => {
|
||||
const { mount: n, unmount: r } = x.useContext(We);
|
||||
return A(() => (t && n(e, x.createElement("div", { key: `ff-${e}`, className: M(`ff-popup-${e}`, i) }, t)), () => r(e)), [i, t]), null;
|
||||
};
|
||||
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 pr = () => p(G, { className: "ff-loading", children: j("div", { className: "loader", children: [j("div", { className: "square", children: [p("span", {}), p("span", {}), p("span", {})] }), j("div", { className: "square", children: [p("span", {}), p("span", {}), p("span", {})] }), j("div", { className: "square", children: [p("span", {}), p("span", {}), p("span", {})] }), j("div", { className: "square", children: [p("span", {}), p("span", {}), p("span", {})] })] }) }), mr = () => p("div", { children: "NotFound" }), ti = ({ children: e }) => {
|
||||
Y.Action = Ge("actions"), Y.Title = Ge("title"), Y.SubTitle = Ge("sub-title"), Y.Extra = Ge("extras"), Y.propTypes = { className: w.string, style: w.object, title: w.any, subTitle: w.any, actions: w.any, extras: w.any };
|
||||
const pr = () => p(Y, { className: "ff-loading", children: j("div", { className: "loader", children: [j("div", { className: "square", children: [p("span", {}), p("span", {}), p("span", {})] }), j("div", { className: "square", children: [p("span", {}), p("span", {}), p("span", {})] }), j("div", { className: "square", children: [p("span", {}), p("span", {}), p("span", {})] }), j("div", { className: "square", children: [p("span", {}), p("span", {}), p("span", {})] })] }) }), mr = () => p("div", { children: "NotFound" }), ti = ({ children: e }) => {
|
||||
const [t, i] = E({}), n = X((a, o) => i((s) => ({ ...s, [a]: o })), []), r = X((a) => i((o) => ({ ...o, [a]: void 0 })), []);
|
||||
return typeof (e == null ? void 0 : e.type) == "string" ? e : p(We.Provider, { value: { ele: t, mount: n, unmount: r }, children: x.cloneElement(e, { className: t.rootClassName, title: t.title, subTitle: t["sub-title"], actions: t.actions, extras: t.extras }) });
|
||||
};
|
||||
ti.propTypes = { children: w.element.isRequired };
|
||||
const Mt = { 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"] }, $t = ({ type: e, props: t }) => p("i", { ...t, children: p("svg", { viewBox: "0 0 1024 1024", width: "1em", height: "1em", fill: "currentColor", children: (Mt[e] || Mt.info).map((i, n) => p("path", { d: i }, n)) }) }), ii = ({ className: e, content: t, icon: i, $close: n }) => j(x.Fragment, { children: [i && p("div", { className: M("ff-notification-icon", e), children: p($t, { type: i }) }), t] }), tn = ({}) => p(G, { children: "Confirm" });
|
||||
const Mt = { 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"] }, $t = ({ type: e, props: t }) => p("i", { ...t, children: p("svg", { viewBox: "0 0 1024 1024", width: "1em", height: "1em", fill: "currentColor", children: (Mt[e] || Mt.info).map((i, n) => p("path", { d: i }, n)) }) }), ii = ({ className: e, content: t, icon: i, $close: n }) => j(x.Fragment, { children: [i && p("div", { className: M("ff-notification-icon", e), children: p($t, { type: i }) }), t] }), tn = ({}) => p(Y, { children: "Confirm" });
|
||||
var pe, Fe;
|
||||
const ne = class ne {
|
||||
constructor() {
|
||||
@ -181,7 +181,7 @@ const Ae = ft.getInstance(), zt = { null2json: (e) => Object.create(), null2arra
|
||||
}, wr = (e) => {
|
||||
var t, i;
|
||||
return e ? (i = (t = e.match(/^@pkg(?:[^\/]*\/){1}(?<owner>[^\/]+)/)) == null ? void 0 : t.groups) == null ? void 0 : i.owner : "";
|
||||
}, oi = () => K.$index++, an = (e, t = 32, i = "auto") => {
|
||||
}, oi = () => _.$index++, an = (e, t = 32, i = "auto") => {
|
||||
const n = yt(e), r = i === "auto" ? "x64" : i;
|
||||
if (t === 32) return dt.x86.hash32(n).toString();
|
||||
if (t === 128) return r === "x64" ? dt.x64.hash128(n) : dt.x86.hash128(n);
|
||||
@ -378,14 +378,14 @@ const ae = class ae {
|
||||
he = new WeakMap(), ge = new WeakMap(), Pe = new WeakMap(), rt = new WeakMap(), O(ae, he, null), v(ae, "getInstance", () => (y(ae, he) || H(ae, he, new ae()), y(ae, he)));
|
||||
let bt = ae;
|
||||
const gi = bt.getInstance(), Tt = x.forwardRef(({ listCode: e, base62params: t, className: i, theme: n, themeProps: r, layouts: a, classNames: o }, s) => {
|
||||
const [{ resource: l, primaryKey: u, batchOperations: c = [], itemOperations: g = [], columns: h = [], themeConfig: m, theme: f, isConditionFormLayout: C = !1, isTreeSider: b, treeSiderConfig: k, isItemGridLayout: S, itemGridLayout: $, title: T, isPaginate: I, tabs: q }, z] = E({ isItemGridLayout: !1, itemGridLayout: {} }), V = ln(e, t), [{ dataSource: R, itemOperationsAccess: B, condition: N, tab: F, keyword: J, page: de, total: $e, pageSize: Y, sider: Ke, onConditionChange: lt, onTabChange: Ot, onKeywordChange: Si, onPageChange: vi, onPageSizeChange: Pi, onSiderChange: $i, onReload: ct, payload: Ti }, jt] = on(V, e, u, l), Ni = wt(g, B, R, u), Ri = wt(c);
|
||||
const [{ resource: l, primaryKey: u, batchOperations: c = [], itemOperations: g = [], columns: h = [], themeConfig: m, theme: f, isConditionFormLayout: C = !1, isTreeSider: b, treeSiderConfig: k, isItemGridLayout: S, itemGridLayout: $, title: T, isPaginate: I, tabs: q }, z] = E({ isItemGridLayout: !1, itemGridLayout: {} }), V = ln(e, t), [{ dataSource: R, itemOperationsAccess: B, condition: N, tab: F, keyword: J, page: de, total: $e, pageSize: K, sider: Ke, onConditionChange: lt, onTabChange: Ot, onKeywordChange: Si, onPageChange: vi, onPageSizeChange: Pi, onSiderChange: $i, onReload: ct, payload: Ti }, jt] = on(V, e, u, l), Ni = wt(g, B, R, u), Ri = wt(c);
|
||||
A(() => {
|
||||
let Q = null;
|
||||
return e && L.get(`/api/_/${e}`).resp(({ data: _e, res: Ei }) => {
|
||||
_e != null && _e.isDynamicRefresh && (Q = gi.subscribe(() => ct(), Ei)), z(_e);
|
||||
}).catch(() => z({})), () => Q == null ? void 0 : Q();
|
||||
}, [e]), x.useImperativeHandle(s, () => ({ onReload: ct, onClickCallback: jt }));
|
||||
const Fi = { listCode: e, title: T, classNames: o, layouts: a, resource: l, primaryKey: u, theme: n || f, themeProps: r || m, isTreeSider: b, treeSiderConfig: k, isPaginate: I, tabs: q, isItemOperations: Ni, itemOperations: g == null ? void 0 : g.map((Q) => d.isEmpty(Q == null ? void 0 : Q.confirm) ? Q : { ...Q, confirm: Object.assign({}, Q.confirm, { getPopupContainer: () => document.body }) }), isBatchOperations: Ri, batchOperations: c, isItemGridLayout: S, columns: h, itemGridLayout: $, isConditionFormLayout: C, itemOperationsAccess: B, dataSource: R, onConditionChange: lt, onTabChange: Ot, onKeywordChange: Si, onPageChange: vi, onPageSizeChange: Pi, onSiderChange: $i, condition: N, tab: F, keyword: J, page: de, total: $e, pageSize: Y, sider: Ke, payload: Ti };
|
||||
const Fi = { listCode: e, title: T, classNames: o, layouts: a, resource: l, primaryKey: u, theme: n || f, themeProps: r || m, isTreeSider: b, treeSiderConfig: k, isPaginate: I, tabs: q, isItemOperations: Ni, itemOperations: g == null ? void 0 : g.map((Q) => d.isEmpty(Q == null ? void 0 : Q.confirm) ? Q : { ...Q, confirm: Object.assign({}, Q.confirm, { getPopupContainer: () => document.body }) }), isBatchOperations: Ri, batchOperations: c, isItemGridLayout: S, columns: h, itemGridLayout: $, isConditionFormLayout: C, itemOperationsAccess: B, dataSource: R, onConditionChange: lt, onTabChange: Ot, onKeywordChange: Si, onPageChange: vi, onPageSizeChange: Pi, onSiderChange: $i, condition: N, tab: F, keyword: J, page: de, total: $e, pageSize: K, sider: Ke, payload: Ti };
|
||||
return p(ui, { ...Fi, className: M("ff-data-list-helper", i), onReload: ct, onClickCallback: jt });
|
||||
}), pi = (e, t, i = !0) => i !== !0 && i-- <= 0 ? [] : d.isArray(e) && !d.isEmpty(e) ? e.reduce((n, r) => (Reflect.has(r, t) && Reflect.has(r, "children") && n.push(r[t]), Reflect.has(r, "children") && !d.isEmpty(r.children) ? n.concat(pi(r.children, t, i)) : n), []) : [], yn = ({ className: e, primaryKey: t, columns: i = [], dataSource: n = [], operationRender: r, operationWidth: a = 180, ...o }) => {
|
||||
const { classNames: s } = ce(ie);
|
||||
@ -449,7 +449,7 @@ const xn = ({ column: e = 0, colWidth: t = 0, cols: i, rowHeight: n, itemMargin:
|
||||
}), c == null ? void 0 : c(s)] });
|
||||
}, Sn = ({ component: e, $props: t }) => {
|
||||
const { base62params: i } = Ue(t, {});
|
||||
return p(G, { children: p(Tt, { listCode: e, base62params: L.decode(i) }) });
|
||||
return p(Y, { children: p(Tt, { listCode: e, base62params: L.decode(i) }) });
|
||||
}, Sr = () => p(fi, {}), fi = () => "Empty", vn = ({ component: e, $setting: t, $props: i }) => {
|
||||
const [n, r] = E();
|
||||
A(() => {
|
||||
@ -554,7 +554,7 @@ const se = class se {
|
||||
};
|
||||
fe = new WeakMap(), Z = new WeakMap(), ye = new WeakMap(), we = new WeakMap(), De = new WeakMap(), qe = new WeakMap(), O(se, fe, null), v(se, "getInstance", () => (y(se, fe) || H(se, fe, new se()), y(se, fe)));
|
||||
let Ct = se;
|
||||
const Pn = ({ to: e, replace: t }) => Zt() ? x.createElement(Qi, { to: e, replace: t }) : (window.document.location = e, "redirect"), ke = Ct.getInstance(), Te = new Worker(new URL("/ff-worker/index.js", self.location)), qt = { getConfigure: (e) => Ae.get(e), route: { redirect: (...e) => ke.redirect(...e), getPageParams: (...e) => ke.getPageParams(...e), getCurrentRoute: () => ke.getCurrentRoute() }, popup: { notification: (...e) => _.notification(...e), success: (...e) => _.success(...e), error: (...e) => _.error(...e), form: (...e) => _.form(...e), modal: (...e) => _.modal(...e), confirm: (...e) => _.confirm(...e) } };
|
||||
const Pn = ({ to: e, replace: t }) => Zt() ? x.createElement(Qi, { to: e, replace: t }) : (window.document.location = e, "redirect"), ke = Ct.getInstance(), Te = new Worker(new URL("/ff-worker/index.js", self.location)), qt = { getConfigure: (e) => Ae.get(e), route: { redirect: (...e) => ke.redirect(...e), getPageParams: (...e) => ke.getPageParams(...e), getCurrentRoute: () => ke.getCurrentRoute() }, popup: { notification: (...e) => G.notification(...e), success: (...e) => G.success(...e), error: (...e) => G.error(...e), form: (...e) => G.form(...e), modal: (...e) => G.modal(...e), confirm: (...e) => G.confirm(...e) } };
|
||||
var at, Ee, be;
|
||||
const D = class D {
|
||||
constructor() {
|
||||
@ -737,8 +737,8 @@ Nt.propTypes = { fields: w.array };
|
||||
const On = (Ut = Nt, ({ code: e, layout: t, name: i, primaryKey: n = 0, style: r = {}, formProps: a = {}, form: o, basicForm: s, isPreview: l = !1, className: u, onFinish: c, onValuesChange: g = () => {
|
||||
}, ...h }) => {
|
||||
const { align: m, autoComplete: f, resource: C, items: b, hides: k, rowHeight: S, marginX: $, marginY: T, cols: I, listenChangeFields: q, listenChangeFieldsFunc: z, pk: V, uuid: R } = $n(e), [B] = te.useForm(o), N = U(() => [{ name: "__PK__", value: V }, { name: "__PROPS__", value: a }, { name: "__RESOURCE__", value: C }, { name: "__LAYOUT_KEY__", value: e }, { name: "__LAYOUT_UUID__", value: R }, { name: "__PRIMARY_KEY__", value: n }], [V, e, R, C, n, a]);
|
||||
return j(te, { className: u, name: i || e, layout: t || m, fields: N, form: B, autoComplete: f, style: { ...r, position: "relative" }, onFinish: c, onValuesChange: (F, J) => (({ changedValues: de, allValues: $e, listenChangeFields: Y, listenChangeFieldsFunc: Ke, onValuesChange: lt, code: Ot }) => {
|
||||
lt(de, $e), Ke && Array.isArray(Y) && xe.exec(Ke, { changedValues: de, allValues: $e }, { getFieldValue: B.getFieldValue, setFieldValue: B.setFieldValue, setFieldsValue: B.setFieldsValue, isFieldTouched: B.isFieldTouched, isFieldsTouched: B.isFieldsTouched });
|
||||
return j(te, { className: u, name: i || e, layout: t || m, fields: N, form: B, autoComplete: f, style: { ...r, position: "relative" }, onFinish: c, onValuesChange: (F, J) => (({ changedValues: de, allValues: $e, listenChangeFields: K, listenChangeFieldsFunc: Ke, onValuesChange: lt, code: Ot }) => {
|
||||
lt(de, $e), Ke && Array.isArray(K) && xe.exec(Ke, { changedValues: de, allValues: $e }, { getFieldValue: B.getFieldValue, setFieldValue: B.setFieldValue, setFieldsValue: B.setFieldsValue, isFieldTouched: B.isFieldTouched, isFieldsTouched: B.isFieldsTouched });
|
||||
})({ changedValues: F, allValues: J, listenChangeFields: q, listenChangeFieldsFunc: z, onValuesChange: g, code: e }), children: [p(Ut, { ...h, form: B, basicForm: s, code: e, fields: b, cols: I, rowHeight: S, itemMargin: [$, T] }), k == null ? void 0 : k.map((F) => {
|
||||
var J;
|
||||
return p(Xt, { name: F.code, children: p(Fn, { form: B, basicForm: s, name: F.code, type: F.type, initialValue: F.initialValue, initialValueLanguage: (J = F.extras) == null ? void 0 : J.initialValueLanguage }) }, JSON.stringify(F.code));
|
||||
@ -749,9 +749,9 @@ const Ci = ({ $setting: e, $close: t, extras: i, code: n, primaryKey: r, ...a })
|
||||
const [o] = te.useForm(), s = Nn(n, r, e);
|
||||
return A(() => {
|
||||
s && o.setFieldsValue(s);
|
||||
}, [s]), p(G, { actions: j(x.Fragment, { children: [p(P, { name: "保存", type: "primary", widget: () => {
|
||||
}, [s]), p(Y, { actions: j(x.Fragment, { children: [p(P, { name: "保存", type: "primary", widget: () => {
|
||||
const l = o.getFieldValue("__RESOURCE__"), { initDataUri: u = `/api/${n}` } = e || {};
|
||||
o.validateFields(!0).then((c) => l ? d.pick(c, [l]) : c).then((c) => L.post(r ? `${u}/${r}` : `${u}`, c).msg(t)).catch(() => _.error("请先完善表单信息", { duration: 2e3 }));
|
||||
o.validateFields(!0).then((c) => l ? d.pick(c, [l]) : c).then((c) => L.post(r ? `${u}/${r}` : `${u}`, c).msg(t)).catch(() => G.error("请先完善表单信息", { duration: 2e3 }));
|
||||
} }), p(P, { name: "取消", widget: () => t(!1) })] }), extras: i, children: p(On, { form: o, code: n, primaryKey: r, ...a }) });
|
||||
}, Ht = /* @__PURE__ */ new Set(), xt = (e = [], t = 0) => {
|
||||
const i = e[t];
|
||||
@ -776,9 +776,9 @@ const jn = (e, t, i, n) => ke.redirect(i, t, n), Ln = (e, t = {}, i, n = {}) =>
|
||||
}, Jt = (e, t, i, { status: { loading: n, disabled: r }, setStatus: a }) => {
|
||||
const o = { loading: (s) => s === void 0 ? n : a((l) => ({ ...l, loading: s })), disabled: (s) => s === void 0 ? r : a((l) => ({ ...l, disabled: s })) };
|
||||
return d.isFunction(i) ? i.call(null, { ...t, ...o }) : d.isString(i) && i ? xe.exec(i, t, o) : null;
|
||||
}, Kt = (e, t, i, n, r) => d.isString(i) && i ? le.getWidgetComponent(i).then(({ default: a }) => _.modal(a, { ...t, $setting: n }, r != null && r.title ? { ...r, title: d.template(r.title)(e) } : r)).catch((a) => {
|
||||
_.error(i, { content: a.toString() });
|
||||
}) : _.modal(i, { ...t, $setting: n }, r != null && r.title ? { ...r, title: d.template(r.title)(e) } : r), An = (e, t, i, n, r) => _.modal(Ci, { ...t, $setting: n, code: i }, r != null && r.title ? { ...r, title: d.template(r.title)(e) } : r), Vn = (e, t, i, n, r) => _.modal(Tt, { base62params: t, $setting: n, listCode: i }, r != null && r.title ? { ...r, title: d.template(r.title)(e) } : r), In = ({ widget: e, widgetType: t, widgetData: i, widgetProps: n, widgetSetting: r, widgetContainerProps: a }, { onAfterClick: o, onBeforeClick: s }) => {
|
||||
}, Kt = (e, t, i, n, r) => d.isString(i) && i ? le.getWidgetComponent(i).then(({ default: a }) => G.modal(a, { ...t, $setting: n }, r != null && r.title ? { ...r, title: d.template(r.title)(e) } : r)).catch((a) => {
|
||||
G.error(i, { content: a.toString() });
|
||||
}) : G.modal(i, { ...t, $setting: n }, r != null && r.title ? { ...r, title: d.template(r.title)(e) } : r), An = (e, t, i, n, r) => G.modal(Ci, { ...t, $setting: n, code: i }, r != null && r.title ? { ...r, title: d.template(r.title)(e) } : r), Vn = (e, t, i, n, r) => G.modal(Tt, { base62params: t, $setting: n, listCode: i }, r != null && r.title ? { ...r, title: d.template(r.title)(e) } : r), In = ({ widget: e, widgetType: t, widgetData: i, widgetProps: n, widgetSetting: r, widgetContainerProps: a }, { onAfterClick: o, onBeforeClick: s }) => {
|
||||
const l = ce(ie), [u, c] = E({ leading: !0, trailing: !1 }), g = U(() => {
|
||||
switch (t) {
|
||||
case "redirect":
|
||||
@ -806,14 +806,14 @@ const jn = (e, t, i, n) => ke.redirect(i, t, n), Ln = (e, t = {}, i, n = {}) =>
|
||||
}, [o, e, i, n, r]), Je = (e) => function({ className: t, variant: i, children: n, name: r, icon: a, type: o = "default", iconPosition: s = "start", noAuthType: l, onAfterClick: u, onBeforeClick: c, data: g, loading: h, disabled: m, tooltip: f, confirm: C, widget: b = () => {
|
||||
}, widgetType: k, widgetData: S, widgetProps: $, widgetSetting: T, widgetContainerProps: I, ...q }) {
|
||||
const z = U(() => oi(), []), V = d.isEmpty(f) || !f.enabled ? {} : f, R = d.isEmpty(C) ? { enabled: !1 } : Object.assign({ enabled: !0 }, C), B = ki({ className: t, name: r, type: o, icon: a, iconPosition: s }, i ?? e), [N, F] = E(!1), [J, { disabled: de, loading: $e }] = In({ widget: b, widgetType: k, widgetData: S, widgetProps: $, widgetSetting: T, widgetContainerProps: I }, { onAfterClick: u, onBeforeClick: c });
|
||||
return p(Ui, { zIndex: z, okText: "确定", cancelText: "取消", getPopupContainer: (Y) => Y, ...R, disabled: de || m, open: N, onOpenChange: (Y) => {
|
||||
if (!Y) return F(Y);
|
||||
R.enabled ? F(Y) : J(g);
|
||||
}, onConfirm: () => {
|
||||
J(g);
|
||||
}, onClick: (Y) => {
|
||||
Y.stopPropagation();
|
||||
}, children: p(Hi, { zIndex: z, getPopupContainer: (Y) => Y, ...V, title: N ? null : V == null ? void 0 : V.title, trigger: ["hover", "click"], children: p(Ze, { loading: $e || h, disabled: de || m, ...B, ...q, children: n || r }) }) });
|
||||
return p(Ui, { zIndex: z, okText: "确定", cancelText: "取消", getPopupContainer: (K) => K, ...R, disabled: de || m, open: N, onOpenChange: (K) => {
|
||||
if (!K) return F(K);
|
||||
R.enabled ? F(K) : J(g);
|
||||
}, onConfirm: (K) => {
|
||||
J(g, K);
|
||||
}, onClick: (K) => {
|
||||
K.stopPropagation();
|
||||
}, children: p(Hi, { zIndex: z, getPopupContainer: (K) => K, ...V, title: N ? null : V == null ? void 0 : V.title, trigger: ["hover", "click"], children: p(Ze, { loading: $e || h, disabled: de || m, ...B, ...q, children: n || r }) }) });
|
||||
}, P = Je("default");
|
||||
P.propTypes = { type: w.oneOf(["primary", "default", "danger", ""]), size: w.oneOf(["large", "middle", "small"]), name: w.string, icon: w.string, iconPosition: w.oneOf(["start", "end"]), data: w.any, widget: w.any, widgetType: w.oneOf(["destroy", "redirect", "func", "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 Mn = Je("link"), zn = Je("circle"), Bn = Je("round"), Dn = Je("dashed"), Rt = ({ data: e, widget: t, widgetType: i = "fsdpf-component", widgetData: n, widgetProps: r, widgetSetting: a, widgetContainerProps: o, onAfterClick: s, onBeforeClick: l, children: u, extras: c }) => {
|
||||
@ -849,7 +849,7 @@ const _t = ({ options: e = [], triggerWeights: t = ["grid-layout-form", "grid-la
|
||||
_t.propTypes = { triggerWeights: w.array, options: w.arrayOf(w.shape({ ...P.propTypes, widgetType: P.propTypes.widgetType.isRequired })), btnSize: P.propTypes.size, btnRender: w.func, btnVariant: w.oneOf(["", "default", "link", "circle", "round", "dashed"]), labelVariant: w.oneOf(["", "default", "link", "circle", "round", "dashed"]), labelRender: w.func, labelSize: P.propTypes.size, onAfterClick: w.func, onBeforeClick: w.func, widgetContainerProps: P.propTypes.widgetContainerProps, data: P.propTypes.data }, P.Link = Mn, P.Link.defaultProps = P.defaultProps, P.Link.propTypes = P.propTypes, P.Circle = zn, P.Circle.defaultProps = P.defaultProps, P.Circle.propTypes = P.propTypes, P.Round = Bn, P.Round.defaultProps = P.defaultProps, P.Round.propTypes = P.propTypes, P.Dashed = Dn, P.Dashed.defaultProps = P.defaultProps, P.Dashed.propTypes = P.propTypes, P.Popover = Rt, P.GroupPopover = _t;
|
||||
const Wn = ({ fields: e, formProps: t, $close: i }) => {
|
||||
const [n] = te.useForm(), r = U(() => [{ name: "__PROPS__", value: t }], [t]);
|
||||
return p(G, { actions: j(x.Fragment, { children: [p(P, { name: "取消", widget: () => i(!1) }), p(P, { name: "确定", type: "primary", widget: () => n.validateFields(!0).then(i) })] }), children: p(te, { fields: r, form: n, className: "ff-modal-form", children: e == null ? void 0 : e.map(({ code: a, ...o }) => p(bi, { code: a, ...o }, a)) }) });
|
||||
return p(Y, { actions: j(x.Fragment, { children: [p(P, { name: "取消", widget: () => i(!1) }), p(P, { name: "确定", type: "primary", widget: () => n.validateFields(!0).then(i) })] }), children: p(te, { fields: r, form: n, className: "ff-modal-form", children: e == null ? void 0 : e.map(({ code: a, ...o }) => p(bi, { code: a, ...o }, a)) }) });
|
||||
}, Un = ({ className: e, $close: t, children: i, title: n, subTitle: r, actions: a, extras: o, ...s }) => j(Zi, { ...s, prefixCls: "ff-drawer", className: M("ff-popup", e), maskMotion: { motionAppear: !0, motionName: "mask-motion" }, motion: (l) => ({ motionAppear: !0, motionName: `panel-motion-${l}` }), children: [j("div", { className: "ff-popup-header", children: [p("button", { "aria-label": "Close", className: "ff-popup-close", onClick: s.onClose, children: p($t, { type: "close" }) }), n, r] }), p("div", { className: "ff-popup-body", children: i }), j("div", { className: "ff-popup-footer", children: [o, a] })] }), Hn = ({ className: e, $close: t, $event: i, children: n, title: r, subTitle: a, actions: o, extras: s, placement: l, ...u }) => {
|
||||
const c = (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 p(en, { ...u, ...c, prefixCls: "ff-modal", modalRender: () => j("div", { className: M("ff-modal-content ff-popup", e), children: [j("div", { className: "ff-popup-header", children: [p("button", { "aria-label": "Close", className: "ff-popup-close", onClick: u.onClose, children: p($t, { type: "close" }) }), r, a] }), p("div", { className: "ff-popup-body", children: n }), j("div", { className: "ff-popup-footer", children: [s, o] })] }) });
|
||||
@ -862,27 +862,27 @@ const Wn = ({ fields: e, formProps: t, $close: i }) => {
|
||||
return p(We.Provider, { value: { ele: o, mount: c, unmount: g }, children: e && e !== "center" ? p(Un, { ...h, placement: e, open: l, afterOpenChange: (f) => !f && m() }) : p(Hn, { ...h, visible: l, afterClose: m }) });
|
||||
};
|
||||
xi.propTypes = { placement: w.oneOf(["center", "left", "top", "right", "bottom"]) };
|
||||
const K = () => {
|
||||
const _ = () => {
|
||||
const [e, t] = Vi({ maxCount: 6, motion: { motionName: "ff-notification-fade", motionAppear: !0, motionEnter: !0, motionLeave: !0, onLeaveStart: (a) => {
|
||||
const { offsetHeight: o } = a;
|
||||
return { height: o };
|
||||
}, onLeaveActive: () => ({ height: 0, opacity: 0, margin: 0 }) }, prefixCls: "ff-notification" }), [, i] = x.useReducer((a) => a + 1, 0);
|
||||
A(() => {
|
||||
K.$onClick = n, K.$queue.forEach(([a, o, s], l, u) => {
|
||||
_.$onClick = n, _.$queue.forEach(([a, o, s], l, u) => {
|
||||
r([o, s], ...a), delete u[l];
|
||||
});
|
||||
}, []);
|
||||
const n = (a, o = {}, s = {}) => new Promise((l, u) => r([l, u], a, o, s)), r = ([a, o], s, l = {}, u = {}) => {
|
||||
const c = K.$index++, g = (h) => ((m, f) => (K.$popups.delete(m), i(), f == null ? void 0 : f()))(c, () => a(h));
|
||||
const c = _.$index++, g = (h) => ((m, f) => (_.$popups.delete(m), i(), f == null ? void 0 : f()))(c, () => a(h));
|
||||
if (s === ii) return e.open({ ...u, key: c, content: x.createElement(s, { ...l, $close: () => e.close(c) }) });
|
||||
K.$popups.set(c, x.createElement(xi, { zIndex: c, maskClosable: !1, $event: l == null ? void 0 : l.$event, ...u, key: c, $close: g }, x.isValidElement(s) ? x.cloneElement(s, { ...l, $close: g }) : s != null && s.name || It.isForwardRef(s) || (s == null ? void 0 : s.$$typeof) === It.ForwardRef ? x.createElement(s, { ...l, $close: g }) : s)), i();
|
||||
_.$popups.set(c, x.createElement(xi, { zIndex: c, maskClosable: !1, $event: l == null ? void 0 : l.$event, ...u, key: c, $close: g }, x.isValidElement(s) ? x.cloneElement(s, { ...l, $close: g }) : s != null && s.name || It.isForwardRef(s) || (s == null ? void 0 : s.$$typeof) === It.ForwardRef ? x.createElement(s, { ...l, $close: g }) : s)), i();
|
||||
};
|
||||
return j(x.Fragment, { children: [Array.from(K.$popups).map(([a, o]) => o), t] });
|
||||
return j(x.Fragment, { children: [Array.from(_.$popups).map(([a, o]) => o), t] });
|
||||
};
|
||||
K.$popups = /* @__PURE__ */ new Map(), K.$index = 9999, K.$queue = [], K.$onClick = (...e) => new Promise((t, i) => {
|
||||
K.$queue.push([e, t, i]);
|
||||
_.$popups = /* @__PURE__ */ new Map(), _.$index = 9999, _.$queue = [], _.$onClick = (...e) => new Promise((t, i) => {
|
||||
_.$queue.push([e, t, i]);
|
||||
});
|
||||
const Gt = (e, t, i = {}) => K.$onClick(e, t, i), gt = (e, { showProgress: t, duration: i, ...n } = { duration: 1.5 }) => K.$onClick(ii, { content: e, ...n }, { showProgress: t, duration: i }), _ = { modal: Gt, confirm: (e, t = {}) => K.$onClick(tn, { content: e, ...t }, { placement: "center" }), form: (e, t = {}, i = {}) => Gt(Wn, { formProps: i, fields: e }, { placement: "center", ...t }).then((n) => {
|
||||
const Gt = (e, t, i = {}) => _.$onClick(e, t, i), gt = (e, { showProgress: t, duration: i, ...n } = { duration: 1.5 }) => _.$onClick(ii, { content: e, ...n }, { showProgress: t, duration: i }), G = { modal: Gt, confirm: (e, t = {}) => _.$onClick(tn, { content: e, ...t }, { placement: "center" }), form: (e, t = {}, i = {}) => Gt(Wn, { formProps: i, fields: e }, { placement: "center", ...t }).then((n) => {
|
||||
if (n === !1) throw !1;
|
||||
return n;
|
||||
}), notification: gt, success: (e, t = { duration: 1.5 }) => gt(e, { ...t, className: "ff-notification-success", icon: "check" }), error: (e, t = { duration: 1.5 }) => gt(e, { ...t, className: "ff-notification-error", icon: "close" }) };
|
||||
@ -892,7 +892,7 @@ je.configure({ showSpinner: !1 }), Le.interceptors.request.use((e) => {
|
||||
return e.headers.Authorization = t ? `Bearer ${t} ` : void 0, je.inc(), e;
|
||||
}, (e) => (je.done(), Promise.reject({ code: -1, msg: e }))), Le.interceptors.response.use(({ data: e, headers: t }) => (je.done(), { ...e, res: t == null ? void 0 : t.res }), function(e) {
|
||||
return je.done(), Promise.reject(e.message);
|
||||
}), window.addEventListener("unhandledrejection", mt.onUnhandledRejection), mt.onMsg = (e, t) => _[[0, 1].includes(e) ? "success" : "error"](t).then(() => e === 20300 && ke.redirect(Ae.get("Common.WEBSITE_LOGIN_PAGE")));
|
||||
}), window.addEventListener("unhandledrejection", mt.onUnhandledRejection), mt.onMsg = (e, t) => G[[0, 1].includes(e) ? "success" : "error"](t).then(() => e === 20300 && ke.redirect(Ae.get("Common.WEBSITE_LOGIN_PAGE")));
|
||||
const vt = { appUrl: "", init: (e, t, i) => {
|
||||
vt.appUrl = i, Le.defaults.baseURL = i, Le.defaults.timeout = 15e3, Object.assign(vt, new mt(e, t, Le));
|
||||
} }, L = vt;
|
||||
@ -962,7 +962,7 @@ const oe = class oe {
|
||||
const { iat: r } = JSON.parse(window.atob((i = n == null ? void 0 : n.split(".")) == null ? void 0 : i[1])), { iat: a, ...o } = L.decode(window.localStorage.getItem(pt) || "", {});
|
||||
return a === r ? Promise.resolve(o) : L.get("/api/mine-info").then(({ User: s = null }) => (window.localStorage.setItem(pt, L.encode({ ...s, iat: r })), s));
|
||||
} catch (n) {
|
||||
console.error(n), t && _.error("请登录").then(this.logout);
|
||||
console.error(n), t && G.error("请登录").then(this.logout);
|
||||
}
|
||||
return Promise.resolve(null);
|
||||
});
|
||||
@ -1025,11 +1025,11 @@ export {
|
||||
P as a9,
|
||||
nn as aa,
|
||||
In as ab,
|
||||
G as ac,
|
||||
Y as ac,
|
||||
We as ad,
|
||||
ti as ae,
|
||||
K as af,
|
||||
_ as ag,
|
||||
_ as af,
|
||||
G as ag,
|
||||
gr as ah,
|
||||
pr as ai,
|
||||
mr as aj,
|
2
dist/components.js
vendored
2
dist/components.js
vendored
@ -1,4 +1,4 @@
|
||||
import { ah as s, a8 as p, ai as n, aj as t, ag as d } from "./common/main-DZ2sKQPT.js";
|
||||
import { ah as s, a8 as p, ai as n, aj as t, ag as d } from "./common/main-C_FS7g0q.js";
|
||||
export {
|
||||
s as Empty,
|
||||
p as Icon,
|
||||
|
2
dist/container.js
vendored
2
dist/container.js
vendored
@ -1,4 +1,4 @@
|
||||
import { ad as o, ah as s, ai as d, aj as p, ae as t, ag as n, af as r, ac as u } from "./common/main-DZ2sKQPT.js";
|
||||
import { ad as o, ah as s, ai as d, aj as p, ae as t, ag as n, af as r, ac as u } from "./common/main-C_FS7g0q.js";
|
||||
export {
|
||||
o as Context,
|
||||
s as Empty,
|
||||
|
2
dist/data-converter.js
vendored
2
dist/data-converter.js
vendored
@ -1,6 +1,6 @@
|
||||
import "lodash";
|
||||
import "react";
|
||||
import { D as p } from "./common/main-DZ2sKQPT.js";
|
||||
import { D as p } from "./common/main-C_FS7g0q.js";
|
||||
export {
|
||||
p as default
|
||||
};
|
||||
|
2
dist/data-list.js
vendored
2
dist/data-list.js
vendored
@ -1,4 +1,4 @@
|
||||
import { B as t, z as e, s as r, x as o, C as i, y as u, w as D, A as l, v as L, E as n, q as m, F as p, N as C, J as c, L as F, K as b, M as d, I as k } from "./common/main-DZ2sKQPT.js";
|
||||
import { B as t, z as e, s as r, x as o, C as i, y as u, w as D, A as l, v as L, E as n, q as m, F as p, N as C, J as c, L as F, K as b, M as d, I as k } from "./common/main-C_FS7g0q.js";
|
||||
export {
|
||||
t as DataListContent,
|
||||
e as DataListContext,
|
||||
|
2
dist/data-list/utils.js
vendored
2
dist/data-list/utils.js
vendored
@ -1,5 +1,5 @@
|
||||
import "lodash";
|
||||
import { l as a } from "../common/main-DZ2sKQPT.js";
|
||||
import { l as a } from "../common/main-C_FS7g0q.js";
|
||||
export {
|
||||
a as getDefaultExpandRowKeys
|
||||
};
|
||||
|
2
dist/grid-layout-form.js
vendored
2
dist/grid-layout-form.js
vendored
@ -1,4 +1,4 @@
|
||||
import { $ as s, a1 as r, a0 as u, _ as o, a5 as t, a4 as d, a7 as m, a3 as F, a2 as i, a6 as g } from "./common/main-DZ2sKQPT.js";
|
||||
import { $ as s, a1 as r, a0 as u, _ as o, a5 as t, a4 as d, a7 as m, a3 as F, a2 as i, a6 as g } from "./common/main-C_FS7g0q.js";
|
||||
export {
|
||||
s as GridLayoutForm,
|
||||
r as GridLayoutFormHelper,
|
||||
|
2
dist/grid-layout-form/utils.js
vendored
2
dist/grid-layout-form/utils.js
vendored
@ -1,5 +1,5 @@
|
||||
import "lodash";
|
||||
import { g as o, a as g } from "../common/main-DZ2sKQPT.js";
|
||||
import { g as o, a as g } from "../common/main-C_FS7g0q.js";
|
||||
export {
|
||||
o as getOptionItemByValue,
|
||||
g as getWidgetByNormalize
|
||||
|
2
dist/grid-layout.js
vendored
2
dist/grid-layout.js
vendored
@ -1,4 +1,4 @@
|
||||
import { m as d, n as e, H as i, G as o, o as t, p as u } from "./common/main-DZ2sKQPT.js";
|
||||
import { m as d, n as e, H as i, G as o, o as t, p as u } from "./common/main-C_FS7g0q.js";
|
||||
export {
|
||||
d as GridLayout,
|
||||
e as GridLayoutWidget,
|
||||
|
2
dist/grid-layout/utils.js
vendored
2
dist/grid-layout/utils.js
vendored
@ -1,4 +1,4 @@
|
||||
import { j as o, k as a } from "../common/main-DZ2sKQPT.js";
|
||||
import { j as o, k as a } from "../common/main-C_FS7g0q.js";
|
||||
export {
|
||||
o as getBoxStyle,
|
||||
a as getWidgetByNormalize
|
||||
|
2
dist/hooks.js
vendored
2
dist/hooks.js
vendored
@ -1,7 +1,7 @@
|
||||
import "lodash";
|
||||
import "rc-field-form";
|
||||
import "react";
|
||||
import { X as r, W as o, Y as p, U as f, V as i, Z as m, T as c } from "./common/main-DZ2sKQPT.js";
|
||||
import { X as r, W as o, Y as p, U as f, V as i, Z as m, T as c } from "./common/main-C_FS7g0q.js";
|
||||
import { default as b } from "rc-util/lib/hooks/useMergedState";
|
||||
export {
|
||||
r as useDeepEffect,
|
||||
|
2
dist/iconfont.js
vendored
2
dist/iconfont.js
vendored
@ -2,7 +2,7 @@ import "react/jsx-runtime";
|
||||
import "react";
|
||||
import "prop-types";
|
||||
import "classnames";
|
||||
import { a8 as a } from "./common/main-DZ2sKQPT.js";
|
||||
import { a8 as a } from "./common/main-C_FS7g0q.js";
|
||||
export {
|
||||
a as default
|
||||
};
|
||||
|
2
dist/index.js
vendored
2
dist/index.js
vendored
@ -1,4 +1,4 @@
|
||||
import { as as t, at as e, ao as o, ap as n, ak as p, aq as r, an as c, am as l, al as f, ar as m } from "./common/main-DZ2sKQPT.js";
|
||||
import { as as t, at as e, ao as o, ap as n, ak as p, aq as r, an as c, am as l, al as f, ar as m } from "./common/main-C_FS7g0q.js";
|
||||
export {
|
||||
t as AppContext,
|
||||
e as AppGlobalParamsContext,
|
||||
|
2
dist/pages.js
vendored
2
dist/pages.js
vendored
@ -1,4 +1,4 @@
|
||||
import { P as t, O as e, Q as o, S as P } from "./common/main-DZ2sKQPT.js";
|
||||
import { P as t, O as e, Q as o, S as P } from "./common/main-C_FS7g0q.js";
|
||||
export {
|
||||
t as CustomPage,
|
||||
e as DataListPage,
|
||||
|
2
dist/res-ws.js
vendored
2
dist/res-ws.js
vendored
@ -1,5 +1,5 @@
|
||||
import "lodash";
|
||||
import { R as a } from "./common/main-DZ2sKQPT.js";
|
||||
import { R as a } from "./common/main-C_FS7g0q.js";
|
||||
export {
|
||||
a as default
|
||||
};
|
||||
|
2
dist/style.css
vendored
2
dist/style.css
vendored
File diff suppressed because one or more lines are too long
2
dist/utils.js
vendored
2
dist/utils.js
vendored
@ -1,5 +1,5 @@
|
||||
import "lodash";
|
||||
import { d as g, e as i, c as p, f as m, h as P, b as d, i as u, r as h, t as k, u as c } from "./common/main-DZ2sKQPT.js";
|
||||
import { d as g, e as i, c as p, f as m, h as P, b as d, i as u, r as h, t as k, u as c } from "./common/main-C_FS7g0q.js";
|
||||
import "react/jsx-runtime";
|
||||
import "react";
|
||||
import "./common/vender-CtjyT19B.js";
|
||||
|
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "ff",
|
||||
"private": true,
|
||||
"version": "0.5.9",
|
||||
"version": "0.5.10",
|
||||
"author": "www.fsdpf.com",
|
||||
"type": "module",
|
||||
"main": "./dist/index.js",
|
||||
|
Loading…
Reference in New Issue
Block a user