v0.5.16
This commit is contained in:
parent
53ccb14151
commit
05ebefd78e
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-DdIS_WOJ.js";
|
import { ab as s, aa as u, ac as e } from "./common/main-UvNID6kN.js";
|
||||||
export {
|
export {
|
||||||
s as auth,
|
s as auth,
|
||||||
u as default,
|
u as default,
|
||||||
|
@ -19,7 +19,7 @@ import w from "prop-types";
|
|||||||
import I from "classnames";
|
import I from "classnames";
|
||||||
import * as Mt from "react-is";
|
import * as Mt from "react-is";
|
||||||
import { useNotification as Vn } from "rc-notification";
|
import { useNotification as Vn } from "rc-notification";
|
||||||
import d from "lodash";
|
import c from "lodash";
|
||||||
import te, { FieldContext as Xt, Field as Qt } from "rc-field-form";
|
import te, { FieldContext as Xt, Field as Qt } from "rc-field-form";
|
||||||
import { M as ut, N as Le, a as Ve, P as ft, S as In } from "./vender-CtjyT19B.js";
|
import { M as ut, N as Le, a as Ve, P as ft, S as In } from "./vender-CtjyT19B.js";
|
||||||
import Zt from "immutability-helper";
|
import Zt from "immutability-helper";
|
||||||
@ -75,7 +75,7 @@ const pr = () => u(Y, { className: "ff-loading", children: j("div", { className:
|
|||||||
return typeof (e == null ? void 0 : e.type) == "string" ? e : u(He.Provider, { value: { ele: t, mount: i, unmount: r }, children: x.cloneElement(e, { className: t.rootClassName, title: t.title, subTitle: t["sub-title"], actions: t.actions, extras: t.extras }) });
|
return typeof (e == null ? void 0 : e.type) == "string" ? e : u(He.Provider, { value: { ele: t, mount: i, unmount: r }, children: x.cloneElement(e, { className: t.rootClassName, title: t.title, subTitle: t["sub-title"], actions: t.actions, extras: t.extras }) });
|
||||||
};
|
};
|
||||||
nn.propTypes = { children: w.element.isRequired };
|
nn.propTypes = { children: w.element.isRequired };
|
||||||
const zt = { 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"] }, Nt = ({ type: e, props: t }) => u("i", { ...t, children: u("svg", { viewBox: "0 0 1024 1024", width: "1em", height: "1em", fill: "currentColor", children: (zt[e] || zt.info).map((n, i) => u("path", { d: n }, i)) }) }), rn = ({ className: e, content: t, icon: n, $close: i }) => j(x.Fragment, { children: [n && u("div", { className: I("ff-notification-icon", e), children: u(Nt, { type: n }) }), t] }), ti = ({}) => u(Y, { children: "Confirm" });
|
const zt = { 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 }) => u("i", { ...t, children: u("svg", { viewBox: "0 0 1024 1024", width: "1em", height: "1em", fill: "currentColor", children: (zt[e] || zt.info).map((n, i) => u("path", { d: n }, i)) }) }), rn = ({ className: e, content: t, icon: n, $close: i }) => j(x.Fragment, { children: [n && u("div", { className: I("ff-notification-icon", e), children: u($t, { type: n }) }), t] }), ti = ({}) => u(Y, { children: "Confirm" });
|
||||||
var pe, Ee;
|
var pe, Ee;
|
||||||
const ie = class ie {
|
const ie = class ie {
|
||||||
constructor() {
|
constructor() {
|
||||||
@ -88,13 +88,13 @@ const ie = class ie {
|
|||||||
pe = new WeakMap(), Ee = new WeakMap(), E(ie, pe, null), P(ie, "getInstance", () => (y(ie, pe) || U(ie, pe, new ie()), y(ie, pe)));
|
pe = new WeakMap(), Ee = new WeakMap(), E(ie, pe, null), P(ie, "getInstance", () => (y(ie, pe) || U(ie, pe, new ie()), y(ie, pe)));
|
||||||
let yt = ie;
|
let yt = ie;
|
||||||
const ni = yt.getInstance(), ii = (e, t, n = "children") => {
|
const ni = yt.getInstance(), ii = (e, t, n = "children") => {
|
||||||
if (d.isEmpty(e)) return {};
|
if (c.isEmpty(e)) return {};
|
||||||
const i = d.find(e, ["value", t]);
|
const i = c.find(e, ["value", t]);
|
||||||
if (!d.isEmpty(i)) return i;
|
if (!c.isEmpty(i)) return i;
|
||||||
const r = e.length;
|
const r = e.length;
|
||||||
for (let a = 0; a < r; a++) {
|
for (let a = 0; a < r; a++) {
|
||||||
const { [n]: o } = e[a], s = ii(o, t, n);
|
const { [n]: o } = e[a], s = ii(o, t, n);
|
||||||
if (!d.isEmpty(s)) return s;
|
if (!c.isEmpty(s)) return s;
|
||||||
}
|
}
|
||||||
return {};
|
return {};
|
||||||
}, an = (e = "Input", t = "@pkg/ff/grid-layout-forms") => e != null && e.startsWith("@") || e != null && e.startsWith("blob:") ? e : `${t}/${e}`;
|
}, an = (e = "Input", t = "@pkg/ff/grid-layout-forms") => e != null && e.startsWith("@") || e != null && e.startsWith("blob:") ? e : `${t}/${e}`;
|
||||||
@ -103,7 +103,7 @@ const re = class re {
|
|||||||
constructor() {
|
constructor() {
|
||||||
E(this, Be, null);
|
E(this, Be, null);
|
||||||
P(this, "init", (t) => U(this, Be, t));
|
P(this, "init", (t) => U(this, Be, t));
|
||||||
P(this, "get", (t, n) => d.get(y(this, Be), t, n));
|
P(this, "get", (t, n) => c.get(y(this, Be), t, n));
|
||||||
if (y(re, me)) return y(re, me);
|
if (y(re, me)) return y(re, me);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -120,10 +120,10 @@ const Ie = wt.getInstance(), Bt = { null2json: (e) => Object.create(), null2arra
|
|||||||
return !!e;
|
return !!e;
|
||||||
}, string2string: (e) => e, json2json: (e) => e, json2array: (e) => e ? Object.values(e) : [], json2number: (e) => Object.keys(e).length, json2integer: (e) => Object.keys(e).length, json2float: (e) => Object.keys(e).length, json2bool: (e) => Object.keys(e).length > 0, json2string: (e) => e ? JSON.stringify(e) : "", array2json: (e) => ({ ...e }), array2array: (e) => e, array2number: (e) => e.length, array2integer: (e) => e.length, array2float: (e) => e.length, array2bool: (e) => e.length > 0, array2string: (e) => JSON.stringify(e), number2json: (e) => ({}), number2array: (e) => [e], number2number: (e) => e, number2integer: (e) => e, number2float: (e) => e, number2bool: (e) => !!e, number2string: (e) => e.toString(), boolean2json: (e) => ({}), boolean2array: (e) => [], boolean2number: (e) => +e, boolean2integer: (e) => +e, boolean2float: (e) => +e, boolean2bool: (e) => e, boolean2string: (e) => e ? "true" : "false" }, ee = (e, t) => {
|
}, string2string: (e) => e, json2json: (e) => e, json2array: (e) => e ? Object.values(e) : [], json2number: (e) => Object.keys(e).length, json2integer: (e) => Object.keys(e).length, json2float: (e) => Object.keys(e).length, json2bool: (e) => Object.keys(e).length > 0, json2string: (e) => e ? JSON.stringify(e) : "", array2json: (e) => ({ ...e }), array2array: (e) => e, array2number: (e) => e.length, array2integer: (e) => e.length, array2float: (e) => e.length, array2bool: (e) => e.length > 0, array2string: (e) => JSON.stringify(e), number2json: (e) => ({}), number2array: (e) => [e], number2number: (e) => e, number2integer: (e) => e, number2float: (e) => e, number2bool: (e) => !!e, number2string: (e) => e.toString(), boolean2json: (e) => ({}), boolean2array: (e) => [], boolean2number: (e) => +e, boolean2integer: (e) => +e, boolean2float: (e) => +e, boolean2bool: (e) => e, boolean2string: (e) => e ? "true" : "false" }, ee = (e, t) => {
|
||||||
let n = "string";
|
let n = "string";
|
||||||
n = Array.isArray(e) ? "array" : typeof e, d.isObject(e) && (n = "json");
|
n = Array.isArray(e) ? "array" : typeof e, c.isObject(e) && (n = "json");
|
||||||
const i = `${n}2${t}`;
|
const i = `${n}2${t}`;
|
||||||
return Reflect.has(Bt, i) ? Bt[i](e) : e;
|
return Reflect.has(Bt, i) ? Bt[i](e) : e;
|
||||||
}, Je = (e = {}, t = {}, n = {}, i = "") => sn(e, (r, a) => a === "type" && r === "code") ? on(e, t, n, i) : ln(e, t, i), sn = (e, t = () => !1) => d.some(e, (n) => !!d.some(n, t) || (d.isEmpty(n) || !d.isPlainObject(n) && !d.isArray(n) ? void 0 : sn(n, t))), on = async (e = {}, t = {}, n = {}, i = "") => {
|
}, Je = (e = {}, t = {}, n = {}, i = "") => sn(e, (r, a) => a === "type" && r === "code") ? on(e, t, n, i) : ln(e, t, i), sn = (e, t = () => !1) => c.some(e, (n) => !!c.some(n, t) || (c.isEmpty(n) || !c.isPlainObject(n) && !c.isArray(n) ? void 0 : sn(n, t))), on = async (e = {}, t = {}, n = {}, i = "") => {
|
||||||
let r = /* @__PURE__ */ Object.create(null);
|
let r = /* @__PURE__ */ Object.create(null);
|
||||||
for (let a in e) {
|
for (let a in e) {
|
||||||
let o;
|
let o;
|
||||||
@ -133,12 +133,12 @@ const Ie = wt.getInstance(), Bt = { null2json: (e) => Object.create(), null2arra
|
|||||||
case "code":
|
case "code":
|
||||||
try {
|
try {
|
||||||
o = await xe.exec(l, t, n);
|
o = await xe.exec(l, t, n);
|
||||||
} catch (c) {
|
} catch (d) {
|
||||||
console.error("getWidgetPropsData", c);
|
console.error("getWidgetPropsData", d);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "field":
|
case "field":
|
||||||
o = d.get(t, l) ?? d.get(t, l.substring(l.indexOf(".") + 1));
|
o = c.get(t, l) ?? c.get(t, l.substring(l.indexOf(".") + 1));
|
||||||
break;
|
break;
|
||||||
case "router":
|
case "router":
|
||||||
case "query":
|
case "query":
|
||||||
@ -149,17 +149,17 @@ const Ie = wt.getInstance(), Bt = { null2json: (e) => Object.create(), null2arra
|
|||||||
}
|
}
|
||||||
o ?? (o = g);
|
o ?? (o = g);
|
||||||
} else o = await on(e[a], t, n, i);
|
} else o = await on(e[a], t, n, i);
|
||||||
d.set(r, a, o);
|
c.set(r, a, o);
|
||||||
}
|
}
|
||||||
return r;
|
return r;
|
||||||
}, ln = (e = {}, t = {}, n = "") => Object.keys(e || {}).reduce((i, r) => {
|
}, ln = (e = {}, t = {}, n = "") => Object.keys(e || {}).reduce((i, r) => {
|
||||||
if (d.isPlainObject(e[r])) {
|
if (c.isPlainObject(e[r])) {
|
||||||
let a;
|
let a;
|
||||||
if (Reflect.has(e[r], "type") && ["field", "router", "query", "string"].includes(e[r].type)) {
|
if (Reflect.has(e[r], "type") && ["field", "router", "query", "string"].includes(e[r].type)) {
|
||||||
const { type: o, value: s = "", default: l = n } = e[r];
|
const { type: o, value: s = "", default: l = n } = e[r];
|
||||||
switch (o) {
|
switch (o) {
|
||||||
case "field":
|
case "field":
|
||||||
a = d.get(t, s) ?? d.get(t, s.substring(s.indexOf(".") + 1));
|
a = c.get(t, s) ?? c.get(t, s.substring(s.indexOf(".") + 1));
|
||||||
break;
|
break;
|
||||||
case "router":
|
case "router":
|
||||||
case "query":
|
case "query":
|
||||||
@ -170,7 +170,7 @@ const Ie = wt.getInstance(), Bt = { null2json: (e) => Object.create(), null2arra
|
|||||||
}
|
}
|
||||||
a ?? (a = l);
|
a ?? (a = l);
|
||||||
} else a = ln(e[r], t, n);
|
} else a = ln(e[r], t, n);
|
||||||
d.set(i, r, a);
|
c.set(i, r, a);
|
||||||
}
|
}
|
||||||
return i;
|
return i;
|
||||||
}, {}), gt = (e, t) => e && typeof e == "object" ? Array.isArray(e) ? e.map((n) => gt(n, t)) : Object.keys(e).reduce((n, i) => (t[i] ? n[t[i]] = gt(e[i], t) : n[i] = gt(e[i], t), n), {}) : e, hr = () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (e) => {
|
}, {}), gt = (e, t) => e && typeof e == "object" ? Array.isArray(e) ? e.map((n) => gt(n, t)) : Object.keys(e).reduce((n, i) => (t[i] ? n[t[i]] = gt(e[i], t) : n[i] = gt(e[i], t), n), {}) : e, hr = () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (e) => {
|
||||||
@ -221,7 +221,7 @@ const it = class it {
|
|||||||
y(this, qe).call(this, t);
|
y(this, qe).call(this, t);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
tt = new WeakMap(), De = new WeakMap(), qe = new WeakMap(), nt = new WeakMap(), E(it, tt, d.memoize((t, n) => le.getWidgetComponent(t).then((i) => {
|
tt = new WeakMap(), De = new WeakMap(), qe = new WeakMap(), nt = new WeakMap(), E(it, tt, c.memoize((t, n) => le.getWidgetComponent(t).then((i) => {
|
||||||
var r;
|
var r;
|
||||||
return ((r = i.default) == null ? void 0 : r.call(i, n)) || ((a) => a);
|
return ((r = i.default) == null ? void 0 : r.call(i, n)) || ((a) => a);
|
||||||
}), (t, n) => `${t}::${ee(n, "string")}`));
|
}), (t, n) => `${t}::${ee(n, "string")}`));
|
||||||
@ -230,7 +230,7 @@ const ai = (e, t = {}) => H(() => e == null ? void 0 : e.map(({ widgetByJs: n, w
|
|||||||
const [t, n] = O({});
|
const [t, n] = O({});
|
||||||
return L(() => {
|
return L(() => {
|
||||||
let i = !1;
|
let i = !1;
|
||||||
return e && A.get(`/api/_/${e}`).then((r) => d.pick(r, ["uuid", "name", "code", "resource", "marginX", "marginY", "cols", "rowHeight", "primaryKey", "columns", "itemOperations", "batchOperations", "isConditionFormLayout", "layout", "tabs", "pageSize", "layoutConfig"])).then((r) => !i && n(r)), () => i = !0;
|
return e && A.get(`/api/_/${e}`).then((r) => c.pick(r, ["uuid", "name", "code", "resource", "marginX", "marginY", "cols", "rowHeight", "primaryKey", "columns", "itemOperations", "batchOperations", "isConditionFormLayout", "layout", "tabs", "pageSize", "layoutConfig"])).then((r) => !i && n(r)), () => i = !0;
|
||||||
}, [e]), t;
|
}, [e]), t;
|
||||||
}, Cr = (e, t = {}) => {
|
}, Cr = (e, t = {}) => {
|
||||||
const [n, i] = O({ dataSource: [] });
|
const [n, i] = O({ dataSource: [] });
|
||||||
@ -239,33 +239,33 @@ const ai = (e, t = {}) => H(() => e == null ? void 0 : e.map(({ widgetByJs: n, w
|
|||||||
return e && A.get(`/api/${e}/${A.encode({ page: 1, ...t })}`).then((a) => !r && i(a)), () => r = !0;
|
return e && A.get(`/api/${e}/${A.encode({ page: 1, ...t })}`).then((a) => !r && i(a)), () => r = !0;
|
||||||
}, [e, t]), n;
|
}, [e, t]), n;
|
||||||
}, cn = (e = [], t = /* @__PURE__ */ new Map(), n = "id", i) => {
|
}, cn = (e = [], t = /* @__PURE__ */ new Map(), n = "id", i) => {
|
||||||
const r = X(i ? (a) => d.get(a, n, d.get(a, [i, n])) : (a) => d.get(a, n), [n, i]);
|
const r = X(i ? (a) => c.get(a, n, c.get(a, [i, n])) : (a) => c.get(a, n), [n, i]);
|
||||||
return X((a) => e == null ? void 0 : e.filter((o) => !o.uuid || !t.has(o.uuid) || t.get(o.uuid).some((s) => s == r(a))), [e, t, r]);
|
return X((a) => e == null ? void 0 : e.filter((o) => !o.uuid || !t.has(o.uuid) || t.get(o.uuid).some((s) => s == r(a))), [e, t, r]);
|
||||||
}, Ct = (e = [], t = /* @__PURE__ */ new Map(), n = [], i = "id", r) => {
|
}, Ct = (e = [], t = /* @__PURE__ */ new Map(), n = [], i = "id", r) => {
|
||||||
const a = X(r ? (o) => d.get(o, i, d.get(o, [r, i])) : (o) => d.get(o, i), [i, r]);
|
const a = X(r ? (o) => c.get(o, i, c.get(o, [r, i])) : (o) => c.get(o, i), [i, r]);
|
||||||
return H(() => {
|
return H(() => {
|
||||||
if (d.isEmpty(e) || !e.some(({ uuid: s }) => ni.check(s))) return !1;
|
if (c.isEmpty(e) || !e.some(({ uuid: s }) => ni.check(s))) return !1;
|
||||||
if (d.isEmpty(t) || d.isEmpty(n)) return !0;
|
if (c.isEmpty(t) || c.isEmpty(n)) return !0;
|
||||||
const o = n.map((s) => a(s));
|
const o = n.map((s) => a(s));
|
||||||
return e.some(({ uuid: s }) => !s || !t.has(s) || t.get(s).some((l) => o.some((g) => g == l)));
|
return e.some(({ uuid: s }) => !s || !t.has(s) || t.get(s).some((l) => o.some((g) => g == l)));
|
||||||
}, [e, n, t, a]);
|
}, [e, n, t, a]);
|
||||||
}, si = (e, t, n = "id", i = null) => {
|
}, si = (e, t, n = "id", i = null) => {
|
||||||
const r = st(), a = W(!1), o = W(e.dataSource), s = W(e.itemOperationsAccess);
|
const r = st(), a = W(!1), o = W(e.dataSource), s = W(e.itemOperationsAccess);
|
||||||
return L(() => (o.current = e.dataSource, s.current = e.itemOperationsAccess, () => a.current = !1), [e.dataSource, e.itemOperationsAccess]), a.current && (e.dataSource = o.current, e.itemOperationsAccess = s.current), [e, (l = 0, g = null) => {
|
return L(() => (o.current = e.dataSource, s.current = e.itemOperationsAccess, () => a.current = !1), [e.dataSource, e.itemOperationsAccess]), a.current && (e.dataSource = o.current, e.itemOperationsAccess = s.current), [e, (l = 0, g = null) => {
|
||||||
var c, p;
|
var d, p;
|
||||||
if (a.current = !1, l === 1) return (c = e.onReload) == null ? void 0 : c.call(e);
|
if (a.current = !1, l === 1) return (d = e.onReload) == null ? void 0 : d.call(e);
|
||||||
if (l === 2) {
|
if (l === 2) {
|
||||||
const f = d.get(g, "__PARENT_ID__", ""), m = d.get(g, n, d.get(g, [i, n], "")), h = d.findIndex(o.current, ["__PARENT_ID__", f]), b = d.findIndex(h > -1 ? d.get(o.current, [h, "children"]) : o.current, [n, m]);
|
const f = c.get(g, "__PARENT_ID__", ""), m = c.get(g, n, c.get(g, [i, n], "")), h = c.findIndex(o.current, ["__PARENT_ID__", f]), b = c.findIndex(h > -1 ? c.get(o.current, [h, "children"]) : o.current, [n, m]);
|
||||||
if (b === -1) return (p = e.onReload) == null ? void 0 : p.call(e);
|
if (b === -1) return (p = e.onReload) == null ? void 0 : p.call(e);
|
||||||
Promise.all([A.get(`/api/${t}/detail/${m}`), A.post(`/api/${t}/list-operations-access`, { ids: m })]).then(([C, k]) => {
|
Promise.all([A.get(`/api/${t}/detail/${m}`), A.post(`/api/${t}/list-operations-access`, { ids: m })]).then(([C, k]) => {
|
||||||
const v = d.get(o.current, h > -1 ? [h, "children", b, "children"] : [b, "children"]);
|
const v = c.get(o.current, h > -1 ? [h, "children", b, "children"] : [b, "children"]);
|
||||||
o.current = Zt(o.current, h > -1 ? { [h]: { children: { $splice: [[b, 1, { ...C, children: v }]] } } } : { $splice: [[b, 1, { ...C, children: v }]] });
|
o.current = Zt(o.current, h > -1 ? { [h]: { children: { $splice: [[b, 1, { ...C, children: v }]] } } } : { $splice: [[b, 1, { ...C, children: v }]] });
|
||||||
const S = new Map(k);
|
const S = new Map(k);
|
||||||
s.current.forEach((N, V) => {
|
s.current.forEach(($, V) => {
|
||||||
var q;
|
var q;
|
||||||
(q = S.get(V)) != null && q.some((B) => B == m) || s.current.set(V, N.filter((B) => B !== m));
|
(q = S.get(V)) != null && q.some((B) => B == m) || s.current.set(V, $.filter((B) => B !== m));
|
||||||
}), S.forEach((N, V) => {
|
}), S.forEach(($, V) => {
|
||||||
s.current.has(V) ? s.current.set(V, d.uniq([...s.current.get(V) || [], ...N])) : s.current.set(V, N);
|
s.current.has(V) ? s.current.set(V, c.uniq([...s.current.get(V) || [], ...$])) : s.current.set(V, $);
|
||||||
});
|
});
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
a.current = !0, r();
|
a.current = !0, r();
|
||||||
@ -273,24 +273,24 @@ const ai = (e, t = {}) => H(() => e == null ? void 0 : e.map(({ widgetByJs: n, w
|
|||||||
}
|
}
|
||||||
}];
|
}];
|
||||||
}, oi = (e, t) => {
|
}, oi = (e, t) => {
|
||||||
const n = st(), i = W(t), r = W(/* @__PURE__ */ new Map()), a = W([]), o = d.throttle((l) => {
|
const n = st(), i = W(t), r = W(/* @__PURE__ */ new Map()), a = W([]), o = c.throttle((l) => {
|
||||||
a.current = [], A.list(e, d.pick({ ...i.current, ...l }, ["tab", "page", "pageSize", "condition", "sider", "keyword"])).then(({ keyword: g, condition: c, total: p, tab: f, sider: m, page: h, pageSize: b, operationsAccess: C, dataSource: k }) => {
|
a.current = [], A.list(e, c.pick({ ...i.current, ...l }, ["tab", "page", "pageSize", "condition", "sider", "keyword"])).then(({ keyword: g, condition: d, total: p, tab: f, sider: m, page: h, pageSize: b, operationsAccess: C, dataSource: k }) => {
|
||||||
i.current = { tab: f, condition: c, sider: m, keyword: g, total: p, pageSize: b, page: k != null && k.length ? h : 1 }, a.current = k, r.current = new Map(C), n();
|
i.current = { tab: f, condition: d, sider: m, keyword: g, total: p, pageSize: b, page: k != null && k.length ? h : 1 }, a.current = k, r.current = new Map(C), n();
|
||||||
});
|
});
|
||||||
}, 380, { leading: !1, trailing: !0 });
|
}, 380, { leading: !1, trailing: !0 });
|
||||||
ot(() => {
|
ot(() => {
|
||||||
a.current = [], e && o(t);
|
a.current = [], e && o(t);
|
||||||
}, [e, t]);
|
}, [e, t]);
|
||||||
const s = H(() => d.pick(i.current, ["total", "tab", "page", "pageSize", "condition", "sider", "keyword"]), [i.current]);
|
const s = H(() => c.pick(i.current, ["total", "tab", "page", "pageSize", "condition", "sider", "keyword"]), [i.current]);
|
||||||
return Object.assign(s, { onTabChange: (l) => o({ tab: l, page: 1 }), onPageChange: (l, g) => o({ page: l, pageSize: g }), onPageSizeChange: (l) => o({ pageSize: l, page: 1 }), onConditionChange: (l, g) => o({ keyword: g, condition: Zt(i.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, payload: t == null ? void 0 : t.payload });
|
return Object.assign(s, { onTabChange: (l) => o({ tab: l, page: 1 }), onPageChange: (l, g) => o({ page: l, pageSize: g }), onPageSizeChange: (l) => o({ pageSize: l, page: 1 }), onConditionChange: (l, g) => o({ keyword: g, condition: Zt(i.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, payload: t == null ? void 0 : t.payload });
|
||||||
}, li = ({ listCode: e, className: t, layouts: n, dataSource: i, isPaginate: r, isItemOperations: a, isBatchOperations: o, batchOperations: s, itemOperations: l, itemOperationsAccess: g, resource: c, primaryKey: p, title: f, itemGridLayout: m, $setting: h, tabs: b, isConditionFormLayout: C, isTreeSider: k, treeSiderConfig: v }) => {
|
}, li = ({ listCode: e, className: t, layouts: n, dataSource: i, isPaginate: r, isItemOperations: a, isBatchOperations: o, batchOperations: s, itemOperations: l, itemOperationsAccess: g, resource: d, primaryKey: p, title: f, itemGridLayout: m, $setting: h, tabs: b, isConditionFormLayout: C, isTreeSider: k, treeSiderConfig: v }) => {
|
||||||
const { classNames: S, onClickCallback: N } = ce(ne), V = d.pick(h, ["column", "colWidth", "beforeRender", "afterRender", "style"]), q = cn(l, g, p, c), B = X((M, R, z) => u(ci, { className: I("ff-data-list-framework-item", S.item), operations: a ? q(R) : [], data: c ? { [c]: R } : R, children: M, onClickCallback: N }), [c, p, a, N, l, g]);
|
const { classNames: S, onClickCallback: $ } = ce(ne), V = c.pick(h, ["column", "colWidth", "beforeRender", "afterRender", "style"]), q = cn(l, g, p, d), B = X((M, R, z) => u(ci, { className: I("ff-data-list-framework-item", S.item), operations: a ? q(R) : [], data: d ? { [d]: R } : R, children: M, onClickCallback: $ }), [d, p, a, $, l, g]);
|
||||||
return j("div", { className: I("ff-data-list-framework", t), children: [u(n.sider, { isTreeSider: k, ...v }), j("div", { className: I("ff-data-list-container", S == null ? void 0 : S.container), children: [u(n.filter, { isConditionFormLayout: C }), u(n.toolbar, { title: f, tabs: b }), u(ki, { ...V, ...m, primaryKey: p, itemRender: B, dataSource: i }), u(n.footer, { isPaginate: r, isOperations: o, operations: s })] })] });
|
return j("div", { className: I("ff-data-list-framework", t), children: [u(n.sider, { isTreeSider: k, ...v }), j("div", { className: I("ff-data-list-container", S == null ? void 0 : S.container), children: [u(n.filter, { isConditionFormLayout: C }), u(n.toolbar, { title: f, tabs: b }), u(ki, { ...V, ...m, primaryKey: p, itemRender: B, dataSource: i }), u(n.footer, { isPaginate: r, isOperations: o, operations: s })] })] });
|
||||||
}, ci = ({ className: e, operations: t, children: n, data: i, onClickCallback: r }) => j("div", { className: I("data-list-grid-layout-item-container", e), children: [n, !!(t != null && t.length) && u("div", { className: "data-list-grid-layout-item-actions", children: t.map((a) => u("span", { className: "data-list-grid-layout-item-action", children: u(T.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: i, confirm: a.confirm, onAfterClick: (o) => o !== !1 && (r == null ? void 0 : r(a.isRefresh, i)) }, a.uuid || ht()) }, (a == null ? void 0 : a.uuid) || ht())) })] }), di = ({ listCode: e, className: t, layouts: n, dataSource: i, columns: r, isItemOperations: a, isBatchOperations: o, batchOperations: s, itemOperations: l, itemOperationsAccess: g, resource: c, primaryKey: p, title: f, tabs: m, isPaginate: h, isTreeSider: b, treeSiderConfig: C, isConditionFormLayout: k, ...v }) => {
|
}, ci = ({ className: e, operations: t, children: n, data: i, onClickCallback: r }) => j("div", { className: I("data-list-grid-layout-item-container", e), children: [n, !!(t != null && t.length) && u("div", { className: "data-list-grid-layout-item-actions", children: t.map((a) => u("span", { className: "data-list-grid-layout-item-action", children: u(T.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: i, confirm: a.confirm, onAfterClick: (o) => o !== !1 && (r == null ? void 0 : r(a.isRefresh, i)) }, a.uuid || ht()) }, (a == null ? void 0 : a.uuid) || ht())) })] }), di = ({ listCode: e, className: t, layouts: n, dataSource: i, columns: r, isItemOperations: a, isBatchOperations: o, batchOperations: s, itemOperations: l, itemOperationsAccess: g, resource: d, primaryKey: p, title: f, tabs: m, isPaginate: h, isTreeSider: b, treeSiderConfig: C, isConditionFormLayout: k, ...v }) => {
|
||||||
const { classNames: S, onClickCallback: N } = ce(ne), V = cn(l, g, p, c), q = Ct(l, g, i, p, c);
|
const { classNames: S, onClickCallback: $ } = ce(ne), V = cn(l, g, p, d), q = Ct(l, g, i, p, d);
|
||||||
return j("div", { className: I("ff-data-table-framework", t), children: [u(n.sider, { isTreeSider: b, ...C }), j("div", { className: I("ff-data-table-container", S == null ? void 0 : S.container), children: [u(n.filter, { isConditionFormLayout: k }), u(n.toolbar, { title: f, tabs: m }), u(fi, { ...v, primaryKey: p, className: "ff-data-table-content", columns: r, dataSource: i, operationRender: q ? (B) => {
|
return j("div", { className: I("ff-data-table-framework", t), children: [u(n.sider, { isTreeSider: b, ...C }), j("div", { className: I("ff-data-table-container", S == null ? void 0 : S.container), children: [u(n.filter, { isConditionFormLayout: k }), u(n.toolbar, { title: f, tabs: m }), u(fi, { ...v, primaryKey: p, className: "ff-data-table-content", columns: r, dataSource: i, operationRender: q ? (B) => {
|
||||||
var M;
|
var M;
|
||||||
return u("div", { className: "ff-data-table-actions", children: (M = V(B)) == null ? void 0 : M.map((R, z) => u(T.Link, { size: "small", uuid: R.uuid, type: R.type, name: R.name, widget: R.widget, widgetType: R.widgetType, widgetProps: R.widgetProps, widgetData: R.widgetData, widgetSetting: R.widgetSetting, widgetContainerProps: R.widgetContainerSetting, data: B, confirm: R.confirm, onAfterClick: ($) => $ !== !1 && (N == null ? void 0 : N(R.isRefresh, B)) }, R.uuid || z)) });
|
return u("div", { className: "ff-data-table-actions", children: (M = V(B)) == null ? void 0 : M.map((R, z) => u(T.Link, { size: "small", uuid: R.uuid, type: R.type, name: R.name, widget: R.widget, widgetType: R.widgetType, widgetProps: R.widgetProps, widgetData: R.widgetData, widgetSetting: R.widgetSetting, widgetContainerProps: R.widgetContainerSetting, data: B, confirm: R.confirm, onAfterClick: (N) => N !== !1 && ($ == null ? void 0 : $(R.isRefresh, B)) }, R.uuid || z)) });
|
||||||
} : null }), u(n.footer, { isPaginate: h, isOperations: o, operations: s })] })] });
|
} : null }), u(n.footer, { isPaginate: h, isOperations: o, operations: s })] })] });
|
||||||
}, ne = x.createContext({ listCode: "", classNames: {}, getBase62params: (e, t) => {
|
}, ne = x.createContext({ listCode: "", classNames: {}, getBase62params: (e, t) => {
|
||||||
}, onReload: () => {
|
}, onReload: () => {
|
||||||
@ -306,16 +306,16 @@ const ai = (e, t = {}) => H(() => e == null ? void 0 : e.map(({ widgetByJs: n, w
|
|||||||
return r != null && r.autoHeight ? o.height = "fit-content" : o["--grid-layout-row"] = `${i}`, 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"] = Dt(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"] = Dt(r == null ? void 0 : r.paddingTop, r == null ? void 0 : r.paddingRight, r == null ? void 0 : r.paddingBottom, r == null ? void 0 : r.paddingLeft), a && (o.height = `${a}px`), o;
|
return r != null && r.autoHeight ? o.height = "fit-content" : o["--grid-layout-row"] = `${i}`, 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"] = Dt(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"] = Dt(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;
|
||||||
}, Dt = (e, t, n, i) => `${e || 0}px ${t || 0}px ${n || 0}px ${i || 0}px`, kr = (e = "Text", t = "@pkg/ff/grid-layouts") => e != null && e.startsWith("@") || e != null && e.startsWith("blob:") ? e : `${t}/${e}`, un = ({ className: e, isConditionFormLayout: t }) => {
|
}, Dt = (e, t, n, i) => `${e || 0}px ${t || 0}px ${n || 0}px ${i || 0}px`, kr = (e = "Text", t = "@pkg/ff/grid-layouts") => e != null && e.startsWith("@") || e != null && e.startsWith("blob:") ? e : `${t}/${e}`, un = ({ className: e, isConditionFormLayout: t }) => {
|
||||||
var f, m;
|
var f, m;
|
||||||
const [n, i] = O({}), { listCode: r, onKeywordChange: a, onConditionChange: o, getBase62params: s, classNames: l } = x.useContext(ne), { keyword: g, condition: c } = (s == null ? void 0 : s()) || {}, [p] = Xe.useForm();
|
const [n, i] = O({}), { listCode: r, onKeywordChange: a, onConditionChange: o, getBase62params: s, classNames: l } = x.useContext(ne), { keyword: g, condition: d } = (s == null ? void 0 : s()) || {}, [p] = Xe.useForm();
|
||||||
return L(() => {
|
return L(() => {
|
||||||
r && t && A.get(`/api/_/${r}/list-condition-form-layout`).then(({ resource: h, marginX: b, marginY: C, rowHeight: k, cols: v, fields: S }) => {
|
r && t && A.get(`/api/_/${r}/list-condition-form-layout`).then(({ resource: h, marginX: b, marginY: C, rowHeight: k, cols: v, fields: S }) => {
|
||||||
i({ resource: h, itemMargin: [b, C], rowHeight: k, cols: v, fields: S });
|
i({ resource: h, itemMargin: [b, C], rowHeight: k, cols: v, fields: S });
|
||||||
}).catch(() => i({}));
|
}).catch(() => i({}));
|
||||||
}, [r, t]), L(() => {
|
}, [r, t]), L(() => {
|
||||||
p.setFieldsValue({ keyword: g, ...c });
|
p.setFieldsValue({ keyword: g, ...d });
|
||||||
}, [JSON.stringify([g, c])]), u("div", { className: I("ff-data-list-filter", l.filter, e), children: u(Xe, { form: p, layout: "vertical", autoComplete: "off", onFinish: ((f = n.fields) == null ? void 0 : f.length) > 1 ? (h) => o({ [n.resource]: h[n.resource] }, h.keyword) : () => {
|
}, [JSON.stringify([g, d])]), u("div", { className: I("ff-data-list-filter", l.filter, e), children: u(Xe, { form: p, layout: "vertical", autoComplete: "off", onFinish: ((f = n.fields) == null ? void 0 : f.length) > 1 ? (h) => o({ [n.resource]: h[n.resource] }, h.keyword) : () => {
|
||||||
}, onValuesChange: (h) => {
|
}, onValuesChange: (h) => {
|
||||||
d.isEmpty(d.omit(h, ["keyword"])) || p.submit();
|
c.isEmpty(c.omit(h, ["keyword"])) || p.submit();
|
||||||
}, children: ((m = n.fields) == null ? void 0 : m.length) > 1 ? u(Ft, { ...n, children: u(ui, { onReset: () => {
|
}, children: ((m = n.fields) == null ? void 0 : m.length) > 1 ? u(Ft, { ...n, children: u(ui, { onReset: () => {
|
||||||
const { keyword: h, condition: b } = s("init") || {};
|
const { keyword: h, condition: b } = s("init") || {};
|
||||||
p.setFieldsValue({ keyword: h, ...b });
|
p.setFieldsValue({ keyword: h, ...b });
|
||||||
@ -326,35 +326,35 @@ const ai = (e, t = {}) => H(() => e == null ? void 0 : e.map(({ widgetByJs: n, w
|
|||||||
};
|
};
|
||||||
un.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" } } }];
|
un.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 gi = ({ className: e, operations: t, isOperations: n, isPaginate: i }) => {
|
const gi = ({ className: e, operations: t, isOperations: n, isPaginate: i }) => {
|
||||||
const { onPageChange: r, onPageSizeChange: a, onClickCallback: o, getBase62params: s } = x.useContext(ne), { total: l, page: g, pageSize: c } = (s == null ? void 0 : s()) || {};
|
const { onPageChange: r, onPageSizeChange: a, onClickCallback: o, getBase62params: s } = x.useContext(ne), { total: l, page: g, pageSize: d } = (s == null ? void 0 : s()) || {};
|
||||||
return n && !d.isEmpty(t) || i ? j("div", { className: I("ff-data-list-footer", e), children: [u("div", { className: "ff-data-list-actions", children: t == null ? void 0 : t.map((p, f) => u(T, { uuid: p.uuid, type: p.type, name: p.name, widget: p.widget, widgetType: p.widgetType, widgetProps: p.widgetProps, widgetData: p.widgetData, widgetSetting: p.widgetSetting, widgetContainerProps: p.widgetContainerSetting, onAfterClick: (m) => m !== !1 && (o == null ? void 0 : o(p.isRefresh, null)) }, p.uuid || f)) }), i && u(zn, { size: "small", total: l, pageSize: c, showSizeChanger: !1, showTotal: (p) => `第 ${g} 页 / 总共 ${p} 条`, onChange: r, onShowSizeChange: a })] }) : null;
|
return n && !c.isEmpty(t) || i ? j("div", { className: I("ff-data-list-footer", e), children: [u("div", { className: "ff-data-list-actions", children: t == null ? void 0 : t.map((p, f) => u(T, { uuid: p.uuid, type: p.type, name: p.name, widget: p.widget, widgetType: p.widgetType, widgetProps: p.widgetProps, widgetData: p.widgetData, widgetSetting: p.widgetSetting, widgetContainerProps: p.widgetContainerSetting, onAfterClick: (m) => m !== !1 && (o == null ? void 0 : o(p.isRefresh, null)) }, p.uuid || f)) }), i && u(zn, { size: "small", total: l, pageSize: d, showSizeChanger: !1, showTotal: (p) => `第 ${g} 页 / 总共 ${p} 条`, onChange: r, onShowSizeChange: a })] }) : null;
|
||||||
}, pi = [{ 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: u("span", { style: { color: "#1677ff" }, children: "sss" }), key: "0-0-1-0" }] }] }], mi = ({ className: e, width: t = 280, isTreeSider: n }) => {
|
}, pi = [{ 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: u("span", { style: { color: "#1677ff" }, children: "sss" }), key: "0-0-1-0" }] }] }], mi = ({ className: e, width: t = 280, isTreeSider: n }) => {
|
||||||
const { classNames: i } = ce(ne);
|
const { classNames: i } = ce(ne);
|
||||||
return n ? u(Bn.DirectoryTree, { className: I("ff-data-list-sider", i.sider, e), style: { "--sider-width": t }, showLine: !0, showIcon: !1, treeData: pi }) : null;
|
return n ? u(Bn.DirectoryTree, { className: I("ff-data-list-sider", i.sider, e), style: { "--sider-width": t }, showLine: !0, showIcon: !1, treeData: pi }) : null;
|
||||||
}, hi = ({ className: e, title: t, tabs: n }) => {
|
}, hi = ({ className: e, title: t, tabs: n }) => {
|
||||||
const { getBase62params: i, onTabChange: r, onReload: a, classNames: o } = ce(ne), { tab: s } = (i == null ? void 0 : i()) || {}, [l, g] = Kn((n == null ? void 0 : n[0].value) ?? (n == null ? void 0 : n[0].code), { value: s, onChange: r });
|
const { getBase62params: i, onTabChange: r, onReload: a, classNames: o } = ce(ne), { tab: s } = (i == null ? void 0 : i()) || {}, [l, g] = Kn((n == null ? void 0 : n[0].value) ?? (n == null ? void 0 : n[0].code), { value: s, onChange: r });
|
||||||
return j("div", { className: I("ff-data-list-toolbar", o.toolbar, e), children: [u("div", { className: "ff-data-list-title", children: t }), u(Dn, { className: "ff-data-list-tabs", itemRender: ({ label: c, code: p, value: f }) => u("span", { onClick: () => g(f ?? p), className: I("ff-data-list-tab", { active: (f ?? p) == l }), children: c }), items: n }), j("div", { className: "ff-data-list-actions", children: [u(T.Link, { icon: "icon-reload", widget: () => a() }), u(T.Link, { icon: "icon-setting" })] })] });
|
return j("div", { className: I("ff-data-list-toolbar", o.toolbar, e), children: [u("div", { className: "ff-data-list-title", children: t }), u(Dn, { className: "ff-data-list-tabs", itemRender: ({ label: d, code: p, value: f }) => u("span", { onClick: () => g(f ?? p), className: I("ff-data-list-tab", { active: (f ?? p) == l }), children: d }), items: n }), j("div", { className: "ff-data-list-actions", children: [u(T.Link, { icon: "icon-reload", widget: () => a() }), u(T.Link, { icon: "icon-setting" })] })] });
|
||||||
}, gn = ({ isItemGridLayout: e, theme: t, themeProps: n, onClickCallback: i, onReload: r, listCode: a, total: o = 0, page: s = 0, onPageChange: l, pageSize: g = 30, onPageSizeChange: c, tab: p, onTabChange: f, keyword: m, onKeywordChange: h, condition: b, onConditionChange: C, sider: k, onSiderChange: v, layouts: S, classNames: N = {}, payload: V = {}, ...q }) => {
|
}, gn = ({ isItemGridLayout: e, theme: t, themeProps: n, onClickCallback: i, onReload: r, listCode: a, total: o = 0, page: s = 0, onPageChange: l, pageSize: g = 30, onPageSizeChange: d, tab: p, onTabChange: f, keyword: m, onKeywordChange: h, condition: b, onConditionChange: C, sider: k, onSiderChange: v, layouts: S, classNames: $ = {}, payload: V = {}, ...q }) => {
|
||||||
const [B, M] = O(), R = X(($, F) => {
|
const [B, M] = O(), R = X((N, F) => {
|
||||||
const J = { tab: p, page: s, pageSize: g, keyword: m, sider: k, condition: b, total: o, payload: V };
|
const J = { tab: p, page: s, pageSize: g, keyword: m, sider: k, condition: b, total: o, payload: V };
|
||||||
return $ && $ != "init" ? d.get(J, $, F) : J;
|
return N && N != "init" ? c.get(J, N, F) : J;
|
||||||
}, [JSON.stringify(b), JSON.stringify(V), p, s, g, m, k, o]), z = H(() => {
|
}, [JSON.stringify(b), JSON.stringify(V), p, s, g, m, k, o]), z = H(() => {
|
||||||
let $ = { sider: mi, filter: un, footer: gi, toolbar: hi };
|
let N = { sider: mi, filter: un, footer: gi, toolbar: hi };
|
||||||
S === !1 ? $ = { sider: null, filter: null, footer: null, toolbar: null } : d.isPlainObject(S) && ($ = Object.assign({}, $, S));
|
S === !1 ? N = { sider: null, filter: null, footer: null, toolbar: null } : c.isPlainObject(S) && (N = Object.assign({}, N, S));
|
||||||
for (const F in $) if ($[F]) {
|
for (const F in N) if (N[F]) {
|
||||||
if (An($[F])) {
|
if (An(N[F])) {
|
||||||
const J = $[F];
|
const J = N[F];
|
||||||
$[F] = (de) => x.cloneElement(J, de);
|
N[F] = (de) => x.cloneElement(J, de);
|
||||||
}
|
}
|
||||||
} else $[F] = () => u(x.Fragment, {});
|
} else N[F] = () => u(x.Fragment, {});
|
||||||
return $;
|
return N;
|
||||||
}, [S]);
|
}, [S]);
|
||||||
return L(() => {
|
return L(() => {
|
||||||
t ? le.getWidgetComponent(t).then(($) => {
|
t ? le.getWidgetComponent(t).then((N) => {
|
||||||
if (!$) throw `${t} not found`;
|
if (!N) throw `${t} not found`;
|
||||||
return $;
|
return N;
|
||||||
}).catch(($) => ({ default: () => `${$}` })).then(($) => M(x.createElement($.default, { ...q, layouts: z, $setting: n }))) : M(u(e ? li : di, { ...q, layouts: z, $setting: n }));
|
}).catch((N) => ({ default: () => `${N}` })).then((N) => M(x.createElement(N.default, { ...q, layouts: z, $setting: n }))) : M(u(e ? li : di, { ...q, layouts: z, $setting: n }));
|
||||||
}, [t, n]), u(ne.Provider, { value: { classNames: N, listCode: a, onClickCallback: i, onReload: r, getBase62params: R, onPageChange: l, onPageSizeChange: c, onTabChange: f, onSiderChange: v, onKeywordChange: h, onConditionChange: C }, children: B && x.cloneElement(B, q) });
|
}, [t, n]), u(ne.Provider, { value: { classNames: $, listCode: a, onClickCallback: i, onReload: r, getBase62params: R, onPageChange: l, onPageSizeChange: d, onTabChange: f, onSiderChange: v, onKeywordChange: h, onConditionChange: C }, children: B && x.cloneElement(B, q) });
|
||||||
};
|
};
|
||||||
gn.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]) };
|
gn.propTypes = { classNames: w.exact({ sider: w.string, filter: w.string, footer: w.string, toolbar: w.string, container: w.string, content: w.string, item: w.string }), layouts: w.oneOfType([w.exact({ sider: w.oneOfType([w.elementType, w.element]), filter: w.oneOfType([w.elementType, w.element]), footer: w.oneOfType([w.elementType, w.element]), toolbar: w.oneOfType([w.elementType, w.element]) }), w.bool]) };
|
||||||
var he, ge, Te, rt;
|
var he, ge, Te, rt;
|
||||||
@ -370,7 +370,7 @@ const ae = class ae {
|
|||||||
var o;
|
var o;
|
||||||
(r == "*" || (o = r == null ? void 0 : r.includes) != null && o.call(r, t.data.uuid)) && a(t.data);
|
(r == "*" || (o = r == null ? void 0 : r.includes) != null && o.call(r, t.data.uuid)) && a(t.data);
|
||||||
}) : ((i = t.data) == null ? void 0 : i.readyState) == WebSocket.CLOSED && A.get("/api/user-api-token").then(({ token: r, expire_at: a }) => {
|
}) : ((i = t.data) == null ? void 0 : i.readyState) == WebSocket.CLOSED && A.get("/api/user-api-token").then(({ token: r, expire_at: a }) => {
|
||||||
y(this, ge).port.postMessage({ command: "initWs", data: [`ws${d.trimStart(A.appUrl, "http")}api/user-resource-status-ws?token=${r}`] });
|
y(this, ge).port.postMessage({ command: "initWs", data: [`ws${c.trimStart(A.appUrl, "http")}api/user-resource-status-ws?token=${r}`] });
|
||||||
});
|
});
|
||||||
}, y(this, ge).port.postMessage({ command: "status", data: [] });
|
}, y(this, ge).port.postMessage({ command: "status", data: [] });
|
||||||
});
|
});
|
||||||
@ -382,17 +382,17 @@ const ae = class ae {
|
|||||||
he = new WeakMap(), ge = new WeakMap(), Te = new WeakMap(), rt = new WeakMap(), E(ae, he, null), P(ae, "getInstance", () => (y(ae, he) || U(ae, he, new ae()), y(ae, he)));
|
he = new WeakMap(), ge = new WeakMap(), Te = new WeakMap(), rt = new WeakMap(), E(ae, he, null), P(ae, "getInstance", () => (y(ae, he) || U(ae, he, new ae()), y(ae, he)));
|
||||||
let kt = ae;
|
let kt = ae;
|
||||||
const pn = kt.getInstance(), Rt = x.forwardRef(({ listCode: e, base62params: t, className: n, theme: i, themeProps: r, layouts: a, classNames: o }, s) => {
|
const pn = kt.getInstance(), Rt = x.forwardRef(({ listCode: e, base62params: t, className: n, theme: i, themeProps: r, layouts: a, classNames: o }, s) => {
|
||||||
const [{ resource: l, primaryKey: g, batchOperations: c = [], itemOperations: p = [], columns: f = [], themeConfig: m, theme: h, isConditionFormLayout: b = !1, isTreeSider: C, treeSiderConfig: k, isItemGridLayout: v, itemGridLayout: S, title: N, isPaginate: V, tabs: q }, B] = O({ isItemGridLayout: !1, itemGridLayout: {} }), M = oi(e, t), [{ dataSource: R, itemOperationsAccess: z, condition: $, tab: F, keyword: J, page: de, total: Se, pageSize: $e, sider: Ne, onConditionChange: K, onTabChange: jt, onKeywordChange: ct, onPageChange: vn, onPageSizeChange: Pn, onSiderChange: Tn, onReload: dt, payload: $n }, At] = si(M, e, g, l), Nn = Ct(p, z, R, g), Rn = Ct(c);
|
const [{ resource: l, primaryKey: g, batchOperations: d = [], itemOperations: p = [], columns: f = [], themeConfig: m, theme: h, isConditionFormLayout: b = !1, isTreeSider: C, treeSiderConfig: k, isItemGridLayout: v, itemGridLayout: S, title: $, isPaginate: V, tabs: q }, B] = O({ isItemGridLayout: !1, itemGridLayout: {} }), M = oi(e, t), [{ dataSource: R, itemOperationsAccess: z, condition: N, tab: F, keyword: J, page: de, total: Se, pageSize: Ne, sider: $e, onConditionChange: K, onTabChange: jt, onKeywordChange: ct, onPageChange: vn, onPageSizeChange: Pn, onSiderChange: Tn, onReload: dt, payload: Nn }, At] = si(M, e, g, l), $n = Ct(p, z, R, g), Rn = Ct(d);
|
||||||
L(() => {
|
L(() => {
|
||||||
let Q = null;
|
let Q = null;
|
||||||
return e && A.get(`/api/_/${e}`).resp(({ data: Ge, res: On }) => {
|
return e && A.get(`/api/_/${e}`).resp(({ data: Ge, res: On }) => {
|
||||||
Ge != null && Ge.isDynamicRefresh && (Q = pn.subscribe(() => dt(), On)), B(Ge);
|
Ge != null && Ge.isDynamicRefresh && (Q = pn.subscribe(() => dt(), On)), B(Ge);
|
||||||
}).catch(() => B({})), () => Q == null ? void 0 : Q();
|
}).catch(() => B({})), () => Q == null ? void 0 : Q();
|
||||||
}, [e]), x.useImperativeHandle(s, () => ({ onReload: dt, onClickCallback: At }));
|
}, [e]), x.useImperativeHandle(s, () => ({ onReload: dt, onClickCallback: At }));
|
||||||
const Fn = { listCode: e, title: N, classNames: o, layouts: a, resource: l, primaryKey: g, theme: i || h, themeProps: r || m, isTreeSider: C, treeSiderConfig: k, isPaginate: V, tabs: q, isItemOperations: Nn, itemOperations: p == null ? void 0 : p.map((Q) => d.isEmpty(Q == null ? void 0 : Q.confirm) ? Q : { ...Q, confirm: Object.assign({}, Q.confirm, { getPopupContainer: () => document.body }) }), isBatchOperations: Rn, batchOperations: c, isItemGridLayout: v, columns: f, itemGridLayout: S, isConditionFormLayout: b, itemOperationsAccess: z, dataSource: R, onConditionChange: K, onTabChange: jt, onKeywordChange: ct, onPageChange: vn, onPageSizeChange: Pn, onSiderChange: Tn, condition: $, tab: F, keyword: J, page: de, total: Se, pageSize: $e, sider: Ne, payload: $n };
|
const Fn = { listCode: e, title: $, classNames: o, layouts: a, resource: l, primaryKey: g, theme: i || h, themeProps: r || m, isTreeSider: C, treeSiderConfig: k, isPaginate: V, tabs: q, isItemOperations: $n, itemOperations: p == null ? void 0 : p.map((Q) => c.isEmpty(Q == null ? void 0 : Q.confirm) ? Q : { ...Q, confirm: Object.assign({}, Q.confirm, { getPopupContainer: () => document.body }) }), isBatchOperations: Rn, batchOperations: d, isItemGridLayout: v, columns: f, itemGridLayout: S, isConditionFormLayout: b, itemOperationsAccess: z, dataSource: R, onConditionChange: K, onTabChange: jt, onKeywordChange: ct, onPageChange: vn, onPageSizeChange: Pn, onSiderChange: Tn, condition: N, tab: F, keyword: J, page: de, total: Se, pageSize: Ne, sider: $e, payload: Nn };
|
||||||
return u(gn, { ...Fn, className: I("ff-data-list-helper", n), onReload: dt, onClickCallback: At });
|
return u(gn, { ...Fn, className: I("ff-data-list-helper", n), onReload: dt, onClickCallback: At });
|
||||||
}), mn = (e, t, n = !0) => n !== !0 && n-- <= 0 ? [] : d.isArray(e) && !d.isEmpty(e) ? e.reduce((i, r) => (Reflect.has(r, t) && Reflect.has(r, "children") && i.push(r[t]), Reflect.has(r, "children") && !d.isEmpty(r.children) ? i.concat(mn(r.children, t, n)) : i), []) : [], fi = ({ className: e, primaryKey: t, columns: n = [], dataSource: i = [], operationRender: r, operationWidth: a = 180, ...o }) => {
|
}), mn = (e, t, n = !0) => n !== !0 && n-- <= 0 ? [] : c.isArray(e) && !c.isEmpty(e) ? e.reduce((i, r) => (Reflect.has(r, t) && Reflect.has(r, "children") && i.push(r[t]), Reflect.has(r, "children") && !c.isEmpty(r.children) ? i.concat(mn(r.children, t, n)) : i), []) : [], fi = ({ className: e, primaryKey: t, columns: n = [], dataSource: i = [], operationRender: r, operationWidth: a = 180, ...o }) => {
|
||||||
const { classNames: s } = ce(ne), l = W(null), g = W(null), [c, p] = O([]), [f, m] = O({ width: 0, height: 0 });
|
const { classNames: s } = ce(ne), l = W(null), g = W(null), [d, p] = O([]), [f, m] = O({ width: 0, height: 0 });
|
||||||
L(() => {
|
L(() => {
|
||||||
p(mn(i, t));
|
p(mn(i, t));
|
||||||
}, [i, t]), Ln(() => {
|
}, [i, t]), Ln(() => {
|
||||||
@ -405,50 +405,50 @@ const pn = kt.getInstance(), Rt = x.forwardRef(({ listCode: e, base62params: t,
|
|||||||
};
|
};
|
||||||
}, []);
|
}, []);
|
||||||
const h = ai(n);
|
const h = ai(n);
|
||||||
return u("div", { ref: g, className: I("ff-data-list-table", s.content, e), children: f.height ? u(qn, { ...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, k) => r(C, k) }] : []), dataSource: i, size: "middle", scroll: { x: "max-content", y: f.height - 50 }, pagination: !1, expandable: { defaultExpandAllRows: !0, expandRowByClick: !0, onExpandedRowsChange: p, expandedRowKeys: c } }) : null });
|
return u("div", { ref: g, className: I("ff-data-list-table", s.content, e), children: f.height ? u(qn, { ...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, k) => r(C, k) }] : []), dataSource: i, size: "middle", scroll: { x: "max-content", y: f.height - 50 }, pagination: !1, expandable: { defaultExpandAllRows: !0, expandRowByClick: !0, onExpandedRowsChange: p, expandedRowKeys: d } }) : null });
|
||||||
}, yi = "RC_FORM_INTERNAL_HOOKS", wi = (e, { initialValue: t, initialValueLanguage: n, convertJs: i, convertJsSetting: r, type: a = "string" }, o = null) => {
|
}, yi = "RC_FORM_INTERNAL_HOOKS", wi = (e, { initialValue: t, initialValueLanguage: n, convertJs: i, convertJsSetting: r, type: a = "string" }, o = null) => {
|
||||||
const s = W(!1), l = ce(Xt), [g, c] = O(), [p, f] = O(n != "javascript" && e ? l.getFieldValue(e) : void 0), { registerWatch: m } = l.getInternalHooks(yi) || {};
|
const s = W(!1), l = ce(Xt), [g, d] = O(), [p, f] = O(n != "javascript" && e ? l.getFieldValue(e) : void 0), { registerWatch: m } = l.getInternalHooks(yi) || {};
|
||||||
return L(() => m == null ? void 0 : m((h, b, C) => {
|
return L(() => m == null ? void 0 : m((h, b, C) => {
|
||||||
if (!s.current) return;
|
if (!s.current) return;
|
||||||
const k = d.get(b, e);
|
const k = c.get(b, e);
|
||||||
d.isEqual(k, p) || f(ee(k, a));
|
c.isEqual(k, p) || f(ee(k, a));
|
||||||
}), [p]), L(() => {
|
}), [p]), L(() => {
|
||||||
n == "javascript" && t ? xe.exec(t, {}, { getFieldValueForBasicForm: (h) => o ? o.getFieldValue(h) : l.getFieldValue(h), getFieldValue: (h) => l.getFieldValue(h) }).then((h) => f(ee(h, a))).catch((h) => notification.error({ message: `布局数据错误: ${JSON.stringify(h)}` })).finally(() => s.current = !0) : (t && f(ee(t ?? l.getFieldValue(e), a)), s.current = !0);
|
n == "javascript" && t ? xe.exec(t, {}, { getFieldValueForBasicForm: (h) => o ? o.getFieldValue(h) : l.getFieldValue(h), getFieldValue: (h) => l.getFieldValue(h) }).then((h) => f(ee(h, a))).catch((h) => notification.error({ message: `布局数据错误: ${JSON.stringify(h)}` })).finally(() => s.current = !0) : (t && f(ee(t ?? l.getFieldValue(e), a)), s.current = !0);
|
||||||
}, [t, n]), Ke(() => {
|
}, [t, n]), Ke(() => {
|
||||||
s.current && i && new et([i, r]).toValue(p, l.getFieldsValue(!0)).then(c).catch((h) => {
|
s.current && i && new et([i, r]).toValue(p, l.getFieldsValue(!0)).then(d).catch((h) => {
|
||||||
c(h), console.error("布局数据转换错误: ", h, i);
|
d(h), console.error("布局数据转换错误: ", h, i);
|
||||||
});
|
});
|
||||||
}, [p, i, r]), [g ?? p, p];
|
}, [p, i, r]), [g ?? p, p];
|
||||||
}, hn = (e, t, n = null) => H(() => {
|
}, hn = (e, t, n = null) => H(() => {
|
||||||
var i;
|
var i;
|
||||||
return (i = d.sortBy(e, ["y", "x"])) == null ? void 0 : i.map(({ i: r, x: a, y: o, w: s, h: l, field: { boxStyle: g, ...c } }, p) => u("div", { className: "grid-layout-item", style: dn(a, o, s, l, g), children: u(t, { ...c, basicForm: n }) }, r ?? p));
|
return (i = c.sortBy(e, ["y", "x"])) == null ? void 0 : i.map(({ i: r, x: a, y: o, w: s, h: l, field: { boxStyle: g, ...d } }, p) => u("div", { className: "grid-layout-item", style: dn(a, o, s, l, g), children: u(t, { ...d, basicForm: n }) }, r ?? p));
|
||||||
}, [e]), bi = ({ widget: e, widgetPrefix: t = "@pkg/ff/grid-layouts", basicForm: n, ...i }) => {
|
}, [e]), bi = ({ widget: e, widgetPrefix: t = "@pkg/ff/grid-layouts", basicForm: n, ...i }) => {
|
||||||
const r = e != null && e.startsWith("@") || e != null && e.startsWith("blob:") ? e : `${t}/${e}`, [a, o] = O();
|
const r = e != null && e.startsWith("@") || e != null && e.startsWith("blob:") ? e : `${t}/${e}`, [a, o] = O();
|
||||||
return L(() => {
|
return L(() => {
|
||||||
r && le.getWidgetComponent(r).then(({ defaultProps: s = {}, default: l }) => ({ default: Ci(l, s, n) })).catch((s) => ({ default: () => `${s}` })).then((s) => o(x.createElement(s.default, i)));
|
r && le.getWidgetComponent(r).then(({ defaultProps: s = {}, default: l }) => ({ default: Ci(l, s, n) })).catch((s) => ({ default: () => `${s}` })).then((s) => o(x.createElement(s.default, i)));
|
||||||
}, [r]), a;
|
}, [r]), a;
|
||||||
}, Ci = (e, t = {}, n = null) => (i) => {
|
}, Ci = (e, t = {}, n = null) => (i) => {
|
||||||
const { code: r, label: a, extras: o, isVirtual: s, initialValue: l, initialValueLanguage: g, convertJs: c, convertJsSetting: p, value: f, ...m } = d.merge({}, t, i), [h, b] = wi(s ? null : r, { initialValue: l, initialValueLanguage: g, convertJs: c, convertJsSetting: p, type: (m == null ? void 0 : m.type) || "string" }, n), C = H(() => {
|
const { code: r, label: a, extras: o, isVirtual: s, initialValue: l, initialValueLanguage: g, convertJs: d, convertJsSetting: p, value: f, ...m } = c.merge({}, t, i), [h, b] = wi(s ? null : r, { initialValue: l, initialValueLanguage: g, convertJs: d, convertJsSetting: p, type: (m == null ? void 0 : m.type) || "string" }, n), C = H(() => {
|
||||||
const S = Object.keys((t == null ? void 0 : t.extras) || {});
|
const S = Object.keys((t == null ? void 0 : t.extras) || {});
|
||||||
return d.over([d.partialRight(d.pick, S), d.partialRight(d.omit, S)]);
|
return c.over([c.partialRight(c.pick, S), c.partialRight(c.omit, S)]);
|
||||||
}, [t == null ? void 0 : t.extras]), [k, v] = C(m);
|
}, [t == null ? void 0 : t.extras]), [k, v] = C(m);
|
||||||
return u(e, { ...v, value: h, rawValue: b, $setting: Object.assign({}, o, k) });
|
return u(e, { ...v, value: h, rawValue: b, $setting: Object.assign({}, o, k) });
|
||||||
}, fn = ({ className: e, cols: t = 12, rowHeight: n = 21, containerPadding: i = [0, 0], itemMargin: r = [4, 0], formProps: a = {}, fields: o = [], data: s, basicForm: l = null, ...g }) => {
|
}, fn = ({ className: e, cols: t = 12, rowHeight: n = 21, containerPadding: i = [0, 0], itemMargin: r = [4, 0], formProps: a = {}, fields: o = [], data: s, basicForm: l = null, ...g }) => {
|
||||||
const [c] = te.useForm(), p = hn(o, bi, l), f = H(() => [{ name: "__PROPS__", value: a }], [a]);
|
const [d] = te.useForm(), p = hn(o, bi, l), f = H(() => [{ name: "__PROPS__", value: a }], [a]);
|
||||||
return Ke(() => (c.setFieldsValue(s), () => c.resetFields()), [s]), u(te, { fields: f, form: c, component: !1, children: u("div", { ...g, className: I("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": `${(i == null ? void 0 : i[0]) || 0}px`, "--grid-layout-container-padding-x": `${(i == null ? void 0 : i[1]) || 0}px`, "--grid-layout-cols": t, "--grid-layout-row-height": `${n}px` }, children: p }) });
|
return Ke(() => (d.setFieldsValue(s), () => d.resetFields()), [s]), u(te, { fields: f, form: d, component: !1, children: u("div", { ...g, className: I("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": `${(i == null ? void 0 : i[0]) || 0}px`, "--grid-layout-container-padding-x": `${(i == null ? void 0 : i[1]) || 0}px`, "--grid-layout-cols": t, "--grid-layout-row-height": `${n}px` }, children: p }) });
|
||||||
}, xr = (qt = fn, function({ code: e, data: t, ...n }) {
|
}, xr = (qt = fn, function({ code: e, data: t, ...n }) {
|
||||||
const [i, r] = O({ resource: null, cols: 12, rowHeight: 21, fields: [] });
|
const [i, r] = O({ resource: null, cols: 12, rowHeight: 21, fields: [] });
|
||||||
return L(() => {
|
return L(() => {
|
||||||
e && A.get(`/api/_/${e}`).then((a) => r(d.pick(a, ["resource", "cols", "rowHeight", "fields"])));
|
e && A.get(`/api/_/${e}`).then((a) => r(c.pick(a, ["resource", "cols", "rowHeight", "fields"])));
|
||||||
}, [e]), (i == null ? void 0 : i.resource) && u(qt, { ...n, rowHeight: i.rowHeight, cols: i.cols, fields: i.fields, data: i != null && i.resource ? { [i == null ? void 0 : i.resource]: t } : {} });
|
}, [e]), (i == null ? void 0 : i.resource) && u(qt, { ...n, rowHeight: i.rowHeight, cols: i.cols, fields: i.fields, data: i != null && i.resource ? { [i == null ? void 0 : i.resource]: t } : {} });
|
||||||
});
|
});
|
||||||
var qt;
|
var qt;
|
||||||
const ki = ({ column: e = 0, colWidth: t = 0, cols: n, rowHeight: i, itemMargin: r, fields: a, primaryKey: o, dataSource: s, itemClassName: l, beforeRender: g = null, afterRender: c = null, itemRender: p = (b, C, k) => b, empty: f = u(Wn, { description: null }), className: m, style: h = {} }) => {
|
const ki = ({ column: e = 0, colWidth: t = 0, cols: n, rowHeight: i, itemMargin: r, fields: a, primaryKey: o, dataSource: s, itemClassName: l, beforeRender: g = null, afterRender: d = null, itemRender: p = (b, C, k) => b, empty: f = u(Wn, { description: null }), className: m, style: h = {} }) => {
|
||||||
const { classNames: b } = ce(ne), C = H(() => u(fn, { cols: n, rowHeight: i, itemMargin: r, fields: a, className: l }), [a, n, i, r]), k = d.isEmpty(s);
|
const { classNames: b } = ce(ne), C = H(() => u(fn, { cols: n, rowHeight: i, itemMargin: r, fields: a, className: l }), [a, n, i, r]), k = c.isEmpty(s);
|
||||||
return j("div", { className: I("ff-data-list-content", b.content, m), style: Object.assign({}, h, e && { "--col-num": e }, t && { "--col-width": t }), children: [g == null ? void 0 : g(s), k ? f : s.map((v, S) => {
|
return j("div", { className: I("ff-data-list-content", b.content, m), style: Object.assign({}, h, e && { "--col-num": e }, t && { "--col-width": t }), children: [g == null ? void 0 : g(s), k ? f : s.map((v, S) => {
|
||||||
const N = p(x.cloneElement(C, { data: v }), v, S);
|
const $ = p(x.cloneElement(C, { data: v }), v, S);
|
||||||
return x.cloneElement(N, { key: `${(v == null ? void 0 : v[o]) ?? S}-${ri(v)}` });
|
return x.cloneElement($, { key: `${(v == null ? void 0 : v[o]) ?? S}-${ri(v)}` });
|
||||||
}), c == null ? void 0 : c(s)] });
|
}), d == null ? void 0 : d(s)] });
|
||||||
}, xi = ({ component: e, $props: t }) => {
|
}, xi = ({ component: e, $props: t }) => {
|
||||||
const { base62params: n } = Je(t, {});
|
const { base62params: n } = Je(t, {});
|
||||||
return u(Y, { children: u(Rt, { listCode: e, base62params: A.decode(n) }) });
|
return u(Y, { children: u(Rt, { listCode: e, base62params: A.decode(n) }) });
|
||||||
@ -472,9 +472,9 @@ const se = class se {
|
|||||||
});
|
});
|
||||||
P(this, "get", (t) => (y(this, Z).has(t) || (t = Array.from(y(this, Z).keys()).find((n) => y(this, Z).get(n).uri === t)), y(this, Z).get(t) || {}));
|
P(this, "get", (t) => (y(this, Z).has(t) || (t = Array.from(y(this, Z).keys()).find((n) => y(this, Z).get(n).uri === t)), y(this, Z).get(t) || {}));
|
||||||
P(this, "redirect", (t, n, i = {}) => {
|
P(this, "redirect", (t, n, i = {}) => {
|
||||||
const { uri: r, type: a, widgetProps: o } = this.get(t) || {}, { router: s, query: l, ...g } = n || {}, c = Object.assign({}, g, s), p = Object.assign({}, g, l);
|
const { uri: r, type: a, widgetProps: o } = this.get(t) || {}, { router: s, query: l, ...g } = n || {}, d = Object.assign({}, g, s), p = Object.assign({}, g, l);
|
||||||
a == "list" && (c.base62params = A.encode(c != null && c.base62params ? c.base62params : c));
|
a == "list" && (d.base62params = A.encode(d != null && d.base62params ? d.base62params : d));
|
||||||
let f = _n(r || t, c);
|
let f = _n(r || t, d);
|
||||||
const m = new URLSearchParams();
|
const m = new URLSearchParams();
|
||||||
for (const h in o || {}) (o == null ? void 0 : o.type) == "query" && Object.has(p, h) && m.append(h, JSON.stringify(p[h]));
|
for (const h in o || {}) (o == null ? void 0 : o.type) == "query" && Object.has(p, h) && m.append(h, JSON.stringify(p[h]));
|
||||||
return m.size > 0 && (f = `${f}?${m.toString()}`), i != null && i.isOpenWindow ? window.open(f) : y(this, we).navigate(f, { replace: !!(i != null && i.isReplaceRouteHistory) });
|
return m.size > 0 && (f = `${f}?${m.toString()}`), i != null && i.isOpenWindow ? window.open(f) : y(this, we).navigate(f, { replace: !!(i != null && i.isReplaceRouteHistory) });
|
||||||
@ -490,10 +490,10 @@ const se = class se {
|
|||||||
});
|
});
|
||||||
P(this, "getMenusByRouteUuid", (t) => y(this, Ue).call(this, t, Object.values(y(this, ye)).flat()));
|
P(this, "getMenusByRouteUuid", (t) => y(this, Ue).call(this, t, Object.values(y(this, ye)).flat()));
|
||||||
E(this, We, (t, n, i = []) => {
|
E(this, We, (t, n, i = []) => {
|
||||||
if (d.isEmpty(t)) return i;
|
if (c.isEmpty(t)) return i;
|
||||||
for (const { uuid: r, children: a } of t) {
|
for (const { uuid: r, children: a } of t) {
|
||||||
if (r == n) return i.concat(r);
|
if (r == n) return i.concat(r);
|
||||||
if (!d.isEmpty(a)) return i.concat(r, y(this, We).call(this, a, n));
|
if (!c.isEmpty(a)) return i.concat(r, y(this, We).call(this, a, n));
|
||||||
}
|
}
|
||||||
return i;
|
return i;
|
||||||
});
|
});
|
||||||
@ -507,7 +507,7 @@ const se = class se {
|
|||||||
const { uuid: t } = this.getCurrentRoute() || {};
|
const { uuid: t } = this.getCurrentRoute() || {};
|
||||||
if (!t) return;
|
if (!t) return;
|
||||||
const n = this.getMenusByRouteUuid(t);
|
const n = this.getMenusByRouteUuid(t);
|
||||||
return d.isEmpty(n) ? void 0 : n[0];
|
return c.isEmpty(n) ? void 0 : n[0];
|
||||||
});
|
});
|
||||||
P(this, "getCurrentRoute", (t = 0) => {
|
P(this, "getCurrentRoute", (t = 0) => {
|
||||||
var i;
|
var i;
|
||||||
@ -526,13 +526,13 @@ const se = class se {
|
|||||||
}
|
}
|
||||||
return n && new URLSearchParams(n).forEach((s, l) => {
|
return n && new URLSearchParams(n).forEach((s, l) => {
|
||||||
i[l] = s;
|
i[l] = s;
|
||||||
}), t ? d.get(i, t) : i;
|
}), t ? c.get(i, t) : i;
|
||||||
});
|
});
|
||||||
P(this, "createBrowserRouter", (t = {}) => {
|
P(this, "createBrowserRouter", (t = {}) => {
|
||||||
if (y(this, Z).size == 0) return null;
|
if (y(this, Z).size == 0) return null;
|
||||||
const n = Ie.get("Common.WEBSITE_DEFAULT_THEME", "@pkg/ff/frameworks/DefaultTheme"), i = Ie.get(le.checkUserToken() ? "Common.WEBSITE_LOGIN_REDIRECT" : "Common.WEBSITE_DEFAULT", "/index"), r = { [n]: 0 }, a = (s, l) => () => Promise.all([le.getWidgetComponent(s), Je(l)]).then(([g, c]) => [g.default || function() {
|
const n = Ie.get("Common.WEBSITE_DEFAULT_THEME", "@pkg/ff/frameworks/DefaultTheme"), i = Ie.get(le.checkUserToken() ? "Common.WEBSITE_LOGIN_REDIRECT" : "Common.WEBSITE_DEFAULT", "/index"), r = { [n]: 0 }, a = (s, l) => () => Promise.all([le.getWidgetComponent(s), Je(l)]).then(([g, d]) => [g.default || function() {
|
||||||
return `${s}`;
|
return `${s}`;
|
||||||
}, c]).then(([g, c]) => ({ Component: () => x.createElement(nn, {}, x.createElement(g, { $setting: c })) })), o = Array.from(y(this, Z).values()).reduce((s, { uuid: l, uri: g, name: c, type: p, component: f, widgetSetting: m, widgetProps: h, isLogin: b, isLayout: C, extra: k }) => {
|
}, d]).then(([g, d]) => ({ Component: () => x.createElement(nn, {}, x.createElement(g, { $setting: d })) })), o = Array.from(y(this, Z).values()).reduce((s, { uuid: l, uri: g, name: d, type: p, component: f, widgetSetting: m, widgetProps: h, isLogin: b, isLayout: C, extra: k }) => {
|
||||||
let v = {}, S = 0;
|
let v = {}, S = 0;
|
||||||
switch (p) {
|
switch (p) {
|
||||||
case "list":
|
case "list":
|
||||||
@ -541,11 +541,11 @@ const se = class se {
|
|||||||
case "fsdpf-component":
|
case "fsdpf-component":
|
||||||
v.element = x.createElement(Si, { key: f, component: f, $setting: m, $props: h });
|
v.element = x.createElement(Si, { key: f, component: f, $setting: m, $props: h });
|
||||||
}
|
}
|
||||||
const N = (k == null ? void 0 : k.theme) ?? (k == null ? void 0 : k.layout);
|
const $ = (k == null ? void 0 : k.theme) ?? (k == null ? void 0 : k.layout);
|
||||||
if (N) {
|
if ($) {
|
||||||
const V = (k == null ? void 0 : k.themeProps) ?? (k == null ? void 0 : k.layoutProps);
|
const V = (k == null ? void 0 : k.themeProps) ?? (k == null ? void 0 : k.layoutProps);
|
||||||
if (!r[N]) return r[N] = s.length, [...s, { path: "/", lazy: a(N, V), children: [{ path: g, ...v }] }];
|
if (!r[$]) return r[$] = s.length, [...s, { path: "/", lazy: a($, V), children: [{ path: g, ...v }] }];
|
||||||
S = r[N];
|
S = r[$];
|
||||||
}
|
}
|
||||||
return C && S > -1 ? (s[S].children.push({ path: g, ...v }), s) : [...s, { path: g, ...v }];
|
return C && S > -1 ? (s[S].children.push({ path: g, ...v }), s) : [...s, { path: g, ...v }];
|
||||||
}, [{ path: "/", lazy: a(n, {}), children: [] }]);
|
}, [{ path: "/", lazy: a(n, {}), children: [] }]);
|
||||||
@ -572,12 +572,12 @@ const D = class D {
|
|||||||
}), Re.addEventListener("message", ({ data: { id: t, task_id: n, method: i, args: r, category: a, data: o, error: s, session: l } }) => {
|
}), Re.addEventListener("message", ({ data: { id: t, task_id: n, method: i, args: r, category: a, data: o, error: s, session: l } }) => {
|
||||||
if (a === "eval" && D.mQueue.has(t)) s !== null ? D.mQueue.get(t)[1](s) : D.mQueue.get(t)[0](o), y(D, je).delete(t), D.mQueue.delete(t);
|
if (a === "eval" && D.mQueue.has(t)) s !== null ? D.mQueue.get(t)[1](s) : D.mQueue.get(t)[0](o), y(D, je).delete(t), D.mQueue.delete(t);
|
||||||
else if (a === "util") try {
|
else if (a === "util") try {
|
||||||
const g = d.get(Wt, i.split("/")) || d.get(y(D, je).get(n), i.split("/"));
|
const g = c.get(Wt, i.split("/")) || c.get(y(D, je).get(n), i.split("/"));
|
||||||
if (!d.isFunction(g)) throw `${i} not found`;
|
if (!c.isFunction(g)) throw `${i} not found`;
|
||||||
Promise.resolve(Reflect.apply(g, void 0, r)).then((c) => {
|
Promise.resolve(Reflect.apply(g, void 0, r)).then((d) => {
|
||||||
Re.postMessage({ id: t, task_id: n, category: a, method: i, args: r, session: l, data: c, error: null });
|
Re.postMessage({ id: t, task_id: n, category: a, method: i, args: r, session: l, data: d, error: null });
|
||||||
}).catch((c) => {
|
}).catch((d) => {
|
||||||
Re.postMessage({ id: t, task_id: n, category: a, method: i, args: r, session: l, data: null, error: c });
|
Re.postMessage({ id: t, task_id: n, category: a, method: i, args: r, session: l, data: null, error: d });
|
||||||
});
|
});
|
||||||
} catch (g) {
|
} catch (g) {
|
||||||
Re.postMessage({ id: t, task_id: n, category: a, method: i, args: r, session: l, data: null, error: g });
|
Re.postMessage({ id: t, task_id: n, category: a, method: i, args: r, session: l, data: null, error: g });
|
||||||
@ -603,41 +603,41 @@ const xe = St.getInstance(), st = () => {
|
|||||||
i.current && (i.current(t), i.current = null);
|
i.current && (i.current(t), i.current = null);
|
||||||
}, [t]), [t, r];
|
}, [t]), [t, r];
|
||||||
}, Ke = (e = (i) => {
|
}, Ke = (e = (i) => {
|
||||||
}, t, n = d.isEqual) => {
|
}, t, n = c.isEqual) => {
|
||||||
const i = x.useRef();
|
const i = x.useRef();
|
||||||
n(t, i.current) || (i.current = d.cloneDeep(t)), x.useEffect(e, [i.current]);
|
n(t, i.current) || (i.current = c.cloneDeep(t)), x.useEffect(e, [i.current]);
|
||||||
}, ot = Ke, wn = (e, t = "string") => {
|
}, ot = Ke, wn = (e, t = "string") => {
|
||||||
var n;
|
var n;
|
||||||
if (!Array.isArray(e)) return e;
|
if (!Array.isArray(e)) return e;
|
||||||
for (let i = 0; i < e.length; i++) e[i].value = ee((n = e[i]) == null ? void 0 : n.value, t), e[i] && Reflect.has(e[i], "children") && (e[i].children = wn(e[i].children, t));
|
for (let i = 0; i < e.length; i++) e[i].value = ee((n = e[i]) == null ? void 0 : n.value, t), e[i] && Reflect.has(e[i], "children") && (e[i].children = wn(e[i].children, t));
|
||||||
return e;
|
return e;
|
||||||
}, $r = (e, t = "json", n = "string", i, r = null) => {
|
}, Nr = (e, t = "json", n = "string", i, r = null) => {
|
||||||
const [a] = te.useForm(i), [o, s] = O([{ label: "无", value: "", disabled: !0 }]), l = W([]), g = te.useWatch((c) => l.current.length === 0 ? null : d.pick(c, l.current), a) || null;
|
const [a] = te.useForm(i), [o, s] = O([{ label: "无", value: "", disabled: !0 }]), l = W([]), g = te.useWatch((d) => l.current.length === 0 ? null : c.pick(d, l.current), a) || null;
|
||||||
return L(() => {
|
return L(() => {
|
||||||
Array.isArray(e) ? s(e) : t === "javascript" && e ? xe.exec(e, {}, { getFieldValue: (c) => (l.current.includes(c) || l.current.push(c), a.getFieldValue(c)), getFieldValueForBasicForm: (c) => (l.current.includes(c) || l.current.push(c), r ? r.getFieldValue(c) : a.getFieldValue(c)) }).then((c) => {
|
Array.isArray(e) ? s(e) : t === "javascript" && e ? xe.exec(e, {}, { getFieldValue: (d) => (l.current.includes(d) || l.current.push(d), a.getFieldValue(d)), getFieldValueForBasicForm: (d) => (l.current.includes(d) || l.current.push(d), r ? r.getFieldValue(d) : a.getFieldValue(d)) }).then((d) => {
|
||||||
s(ee(c, "array"));
|
s(ee(d, "array"));
|
||||||
}).catch((c) => console.error("useOptions", c)) : e && s(ee(e, "array"));
|
}).catch((d) => console.error("useOptions", d)) : e && s(ee(e, "array"));
|
||||||
}, [e, t, g]), wn(o, n);
|
}, [e, t, g]), wn(o, n);
|
||||||
}, Nr = (e) => {
|
}, $r = (e) => {
|
||||||
const [t, n] = O(), i = { type: "GET" };
|
const [t, n] = O(), i = { type: "GET" };
|
||||||
if (typeof e == "string" ? i.url = e : d.isPlainObject(e) && Object.assign(i, e), !(i != null && i.url)) throw "url is required";
|
if (typeof e == "string" ? i.url = e : c.isPlainObject(e) && Object.assign(i, e), !(i != null && i.url)) throw "url is required";
|
||||||
const r = (a) => A.request(i, !1).resp((o) => (console.log("useSubscribeRequest", a), n(o), o));
|
const r = (a) => A.request(i, !1).resp((o) => (console.log("useSubscribeRequest", a), n(o), o));
|
||||||
return Ke(() => {
|
return Ke(() => {
|
||||||
let a = null;
|
let a = null;
|
||||||
return r().then((o) => {
|
return r().then((o) => {
|
||||||
a = pn.subscribe(d.throttle(r, 180, { leading: !1, trailing: !0 }), o.res);
|
a = pn.subscribe(c.throttle(r, 180, { leading: !1, trailing: !0 }), o.res);
|
||||||
}), () => a == null ? void 0 : a();
|
}), () => a == null ? void 0 : a();
|
||||||
}, i), t;
|
}, i), t;
|
||||||
}, Pi = (e) => {
|
}, Pi = (e) => {
|
||||||
const [t, n] = x.useState({ gridItems: [], hideItems: [] });
|
const [t, n] = x.useState({ gridItems: [], hideItems: [] });
|
||||||
return x.useEffect(() => {
|
return x.useEffect(() => {
|
||||||
e && A.get(`/api/_/${e}`).then(({ pk: i, uuid: r, code: a, resource: o, align: s, cols: l, rowHeight: g, marginX: c, marginY: p, listenChangeFields: f, listenChangeFieldsFunc: m, fields: h }) => ({ pk: i, uuid: r, code: a, resource: o, align: s, cols: l, rowHeight: g, marginX: c, marginY: p, listenChangeFields: f, listenChangeFieldsFunc: m, ...h.reduce((b, C) => {
|
e && A.get(`/api/_/${e}`).then(({ pk: i, uuid: r, code: a, resource: o, align: s, cols: l, rowHeight: g, marginX: d, marginY: p, listenChangeFields: f, listenChangeFieldsFunc: m, fields: h }) => ({ pk: i, uuid: r, code: a, resource: o, align: s, cols: l, rowHeight: g, marginX: d, marginY: p, listenChangeFields: f, listenChangeFieldsFunc: m, ...h.reduce((b, C) => {
|
||||||
var k;
|
var k;
|
||||||
return (k = C == null ? void 0 : C.field) != null && k.hidden ? b.hides.push(C == null ? void 0 : C.field) : b.items.push(C), b;
|
return (k = C == null ? void 0 : C.field) != null && k.hidden ? b.hides.push(C == null ? void 0 : C.field) : b.items.push(C), b;
|
||||||
}, { items: [], hides: [] }) })).then(n);
|
}, { items: [], hides: [] }) })).then(n);
|
||||||
}, [e]), t;
|
}, [e]), t;
|
||||||
}, Ti = ({ max: e = 0, min: t = 0, type: n = "", message: i, pattern: r, required: a = !1, validator: o } = {}, s, l) => {
|
}, Ti = ({ max: e = 0, min: t = 0, type: n = "", message: i, pattern: r, required: a = !1, validator: o } = {}, s, l) => {
|
||||||
const [g, c] = O([]);
|
const [g, d] = O([]);
|
||||||
return L(() => {
|
return L(() => {
|
||||||
const p = [];
|
const p = [];
|
||||||
if (a) {
|
if (a) {
|
||||||
@ -665,46 +665,53 @@ const xe = St.getInstance(), st = () => {
|
|||||||
case "validator":
|
case "validator":
|
||||||
o && p.push(({ getFieldValue: f }) => ({ validator: async (m, h) => {
|
o && p.push(({ getFieldValue: f }) => ({ validator: async (m, h) => {
|
||||||
const b = await xe.exec(o, { value: h, fieldName: s }, { getFieldValue: f });
|
const b = await xe.exec(o, { value: h, fieldName: s }, { getFieldValue: f });
|
||||||
return d.isString(b) && b ? Promise.reject(b) : d.isBoolean(b) && !b ? Promise.reject(i) : Promise.resolve();
|
return c.isString(b) && b ? Promise.reject(b) : c.isBoolean(b) && !b ? Promise.reject(i) : Promise.resolve();
|
||||||
} }));
|
} }));
|
||||||
}
|
}
|
||||||
c(p);
|
d(p);
|
||||||
}, [e, t, n, i, r, a, o]), g;
|
}, [e, t, n, i, r, a, o]), g;
|
||||||
}, $i = (e, t, n) => {
|
}, Ni = (e, t, n) => {
|
||||||
const [i, r] = O(null);
|
const [i, r] = O(null);
|
||||||
return L(() => {
|
return L(() => {
|
||||||
const { initDataUri: a = `/api/${e}`, initDataMethod: o = "GET" } = n || {};
|
const { initDataUri: a = `/api/${e}`, initDataMethod: o = "GET" } = n || {};
|
||||||
t && A.request({ method: o, url: d.trimEnd(`${a}/${t}`, "/") }).then((s) => {
|
t && A.request({ method: o, url: c.trimEnd(`${a}/${t}`, "/") }).then((s) => {
|
||||||
r(s);
|
r(s);
|
||||||
});
|
});
|
||||||
}, [e, t, n]), i;
|
}, [e, t, n]), i;
|
||||||
}, Ni = (e, t, n) => X((i, r = { serialize: (a) => a, onSuccess: () => {
|
}, $i = (e, t, n) => X((i, r = { serialize: (a) => a, onSuccess: () => {
|
||||||
}, onFail: (a) => (a == null ? void 0 : a.errorFields) && G.error("请先完善表单信息", { duration: 2e3 }) }) => {
|
}, onFail: (a) => (a == null ? void 0 : a.errorFields) && G.error("请先完善表单信息", { duration: 2e3 }) }) => {
|
||||||
const a = i.getFieldValue("__RESOURCE__"), { submitDataUri: o = `/api/${e}`, submitDataMethod: s = "POST" } = n || {};
|
const a = i.getFieldValue("__RESOURCE__"), { submitDataUri: o = `/api/${e}`, submitDataMethod: s = "POST" } = n || {};
|
||||||
return i.validateFields().then((l) => a ? d.pick(l, [a]) : l).then(r.serialize).then((l) => A.request({ method: s, url: d.trimEnd(`${o}/${t || ""}`, "/"), data: l }).msg(r.onSuccess)).catch(r.onFail);
|
return i.validateFields().then((l) => a ? c.pick(l, [a]) : l).then(r.serialize).then((l) => A.request({ method: s, url: c.trimEnd(`${o}/${t || ""}`, "/"), data: l }).msg(r.onSuccess)).catch(r.onFail);
|
||||||
}, [e, t, n]), bn = (e, t, n = {}, i = {}, r = {}) => {
|
}, [e, t, n]), Rr = (e, t, n, i) => {
|
||||||
const a = ce(Xt), o = st(), s = W(!0), l = W([]), [g, c] = O(t), [p, f] = O(), m = te.useWatch((h) => JSON.stringify(d.pick(h, l.current)), a) || "{}";
|
const r = Ni(t, n, i);
|
||||||
|
L(() => {
|
||||||
|
r ? e.setFieldsValue(r) : e.resetFields();
|
||||||
|
}, [e, r]);
|
||||||
|
const a = $i(t, n, i);
|
||||||
|
return c.partial(a, e);
|
||||||
|
}, bn = (e, t, n = {}, i = {}, r = {}) => {
|
||||||
|
const a = ce(Xt), o = st(), s = W(!0), l = W([]), [g, d] = O(t), [p, f] = O(), m = te.useWatch((h) => JSON.stringify(c.pick(h, l.current)), a) || "{}";
|
||||||
return ot(() => {
|
return ot(() => {
|
||||||
e && xe.exec(e, n, { ...i, getFieldValueForBasicForm: (h) => r ? r.getFieldValue(h) : null, getFieldValue: d.wrap(a.getFieldValue, (h, b) => (l.current.some((C) => d.isEqual(C, b)) || (l.current.push(b), o()), h == null ? void 0 : h(b))), isFieldTouched: a.isFieldTouched, isFieldsTouched: a.isFieldsTouched }).then((h) => {
|
e && xe.exec(e, n, { ...i, getFieldValueForBasicForm: (h) => r ? r.getFieldValue(h) : null, getFieldValue: c.wrap(a.getFieldValue, (h, b) => (l.current.some((C) => c.isEqual(C, b)) || (l.current.push(b), o()), h == null ? void 0 : h(b))), isFieldTouched: a.isFieldTouched, isFieldsTouched: a.isFieldsTouched }).then((h) => {
|
||||||
s.current && (c(h), f(null));
|
s.current && (d(h), f(null));
|
||||||
}).catch((h) => {
|
}).catch((h) => {
|
||||||
s.current && (c(t), f(h));
|
s.current && (d(t), f(h));
|
||||||
});
|
});
|
||||||
}, [e, m, a, n, i]), L(() => () => s.current = !1, []), e ? [g, p] : [t, null];
|
}, [e, m, a, n, i]), L(() => () => s.current = !1, []), e ? [g, p] : [t, null];
|
||||||
}, Ri = (e, t, n = [], i = {}) => {
|
}, Ri = (e, t, n = [], i = {}) => {
|
||||||
const r = W({}), a = W(), o = d.debounce(st(), 180), s = ["disabled", "required"], l = (f, m) => {
|
const r = W({}), a = W(), o = c.debounce(st(), 180), s = ["disabled", "required"], l = (f, m) => {
|
||||||
s.includes(f) && (r.current[f] = m), o();
|
s.includes(f) && (r.current[f] = m), o();
|
||||||
}, g = H(() => ({ setDisabled: (f) => l("disabled", f), setRequired: (f) => l("required", f), getDisabled: () => r.current.disabled, getRequired: () => r.current.required }), [t]), [c, p] = bn(t, -1, {}, g, i);
|
}, g = H(() => ({ setDisabled: (f) => l("disabled", f), setRequired: (f) => l("required", f), getDisabled: () => r.current.disabled, getRequired: () => r.current.required }), [t]), [d, p] = bn(t, -1, {}, g, i);
|
||||||
if (!p && a.current != c && (c >= 0 || !d.isEmpty(n == null ? void 0 : n[c]))) {
|
if (!p && a.current != d && (d >= 0 || !c.isEmpty(n == null ? void 0 : n[d]))) {
|
||||||
a.current = c;
|
a.current = d;
|
||||||
const { widget: f, widgetPrefix: m, props: h } = n == null ? void 0 : n[c];
|
const { widget: f, widgetPrefix: m, props: h } = n == null ? void 0 : n[d];
|
||||||
e = an(f, m), r.current = d.merge(h, d.pick(r.current, s));
|
e = an(f, m), r.current = c.merge(h, c.pick(r.current, s));
|
||||||
}
|
}
|
||||||
return [e, r.current];
|
return [e, r.current];
|
||||||
}, Ut = (e) => e === void 0 || e === !1 ? "" : (Array.isArray(e) ? e : [e]).join("_"), Rr = ({ value: e, onChange: t }, n = null) => {
|
}, Ut = (e) => e === void 0 || e === !1 ? "" : (Array.isArray(e) ? e : [e]).join("_"), Fr = ({ value: e, onChange: t }, n = null) => {
|
||||||
const i = W(), [r] = te.useForm(n), a = W({});
|
const i = W(), [r] = te.useForm(n), a = W({});
|
||||||
return ot(() => {
|
return ot(() => {
|
||||||
d.isEqual(i.current, e) || r.setFieldsValue(e);
|
c.isEqual(i.current, e) || r.setFieldsValue(e);
|
||||||
}, [e]), L(() => () => r.resetFields(), []), [H(() => r.__INTERNAL__ ? r : { ...r, __INTERNAL__: { itemRef: (o) => (s) => {
|
}, [e]), L(() => () => r.resetFields(), []), [H(() => r.__INTERNAL__ ? r : { ...r, __INTERNAL__: { itemRef: (o) => (s) => {
|
||||||
const l = Ut(o);
|
const l = Ut(o);
|
||||||
s ? a.current[l] = s : delete a.current[l];
|
s ? a.current[l] = s : delete a.current[l];
|
||||||
@ -724,40 +731,38 @@ const xe = St.getInstance(), st = () => {
|
|||||||
n == "javascript" ? i(ee(a, e)) : t && i(ee(t, e));
|
n == "javascript" ? i(ee(a, e)) : t && i(ee(t, e));
|
||||||
}, [e, t, a]), null;
|
}, [e, t, a]), null;
|
||||||
}, Cn = ({ widget: e = "Input", widgetPrefix: t = "@pkg/ff/grid-layout-forms", widgetDecorator: n, subWidgets: i = [], basicForm: r, ...a }) => {
|
}, Cn = ({ widget: e = "Input", widgetPrefix: t = "@pkg/ff/grid-layout-forms", widgetDecorator: n, subWidgets: i = [], basicForm: r, ...a }) => {
|
||||||
const o = an(e, t), [s, l] = Ri(o, n, i, r), [g, c] = O();
|
const o = an(e, t), [s, l] = Ri(o, n, i, r), [g, d] = O();
|
||||||
return L(() => {
|
return L(() => {
|
||||||
s && le.getWidgetComponent(s).then(({ defaultProps: p = {}, default: f }) => ({ default: Oi(f, p, r) })).catch((p) => ({ default: () => `${p}` })).then((p) => c(x.createElement(p.default, a)));
|
s && le.getWidgetComponent(s).then(({ defaultProps: p = {}, default: f }) => ({ default: Oi(f, p, r) })).catch((p) => ({ default: () => `${p}` })).then((p) => d(x.createElement(p.default, a)));
|
||||||
}, [s]), g && x.cloneElement(g, { ...a, ...l });
|
}, [s]), g && x.cloneElement(g, { ...a, ...l });
|
||||||
}, Oi = (e, t = {}, n = null) => (i) => {
|
}, Oi = (e, t = {}, n = null) => (i) => {
|
||||||
const { type: r, code: a, label: o, noStyle: s, placeholder: l, required: g = !1, extras: c, validators: p, help: f, isVirtual: m, $isReserved: h, initialValue: b, initialValueLanguage: C, ...k } = d.omit(d.merge({}, t, i), ["convertJs", "convertJsSetting", "widget", "widgetPerfix", "widgetDecorator", "subWidgets", "boxStyle"]), v = Ti(Object.assign({}, p, g ? { required: !0 } : {}), a, r), S = H(() => {
|
const { type: r, code: a, label: o, noStyle: s, placeholder: l, required: g = !1, extras: d, validators: p, help: f, isVirtual: m, $isReserved: h, initialValue: b, initialValueLanguage: C, ...k } = c.omit(c.merge({}, t, i), ["convertJs", "convertJsSetting", "widget", "widgetPerfix", "widgetDecorator", "subWidgets", "boxStyle"]), v = Ti(Object.assign({}, p, g ? { required: !0 } : {}), a, r), S = H(() => {
|
||||||
const M = Object.keys((t == null ? void 0 : t.extras) || {});
|
const M = Object.keys((t == null ? void 0 : t.extras) || {});
|
||||||
return d.over([d.partialRight(d.pick, M), d.partialRight(d.omit, M)]);
|
return c.over([c.partialRight(c.pick, M), c.partialRight(c.omit, M)]);
|
||||||
}, [t == null ? void 0 : t.extras]), [N, V] = S(k), q = { label: o, noStyle: s, colon: !1, layout: "vertical" }, B = X((M) => M == null ? void 0 : ee(M, r), [r]);
|
}, [t == null ? void 0 : t.extras]), [$, V] = S(k), q = { label: o, noStyle: s, colon: !1, layout: "vertical" }, B = X((M) => M == null ? void 0 : ee(M, r), [r]);
|
||||||
return u(Qt, { name: a, rules: v, initialValue: B(b), normalize: B, children: (M, R, z) => {
|
return u(Qt, { name: a, rules: v, initialValue: B(b), normalize: B, children: (M, R, z) => {
|
||||||
var $;
|
var N;
|
||||||
return u(e, { type: r, rcform: z, basicForm: n, itemProps: { validateStatus: R.errors.length > 0 ? "error" : "success", tooltip: f || null, help: R.errors.length > 0 ? R.errors.join("、") : null, required: (($ = v == null ? void 0 : v[0]) == null ? void 0 : $.required) || !1, ...q }, fieldProps: { placeholder: l, ...V, ...M }, $setting: Object.assign({}, c, N) });
|
return u(e, { type: r, rcform: z, basicForm: n, itemProps: { validateStatus: R.errors.length > 0 ? "error" : "success", tooltip: f || null, help: R.errors.length > 0 ? R.errors.join("、") : null, required: ((N = v == null ? void 0 : v[0]) == null ? void 0 : N.required) || !1, ...q }, fieldProps: { placeholder: l, ...V, ...M }, $setting: Object.assign({}, d, $) });
|
||||||
} });
|
} });
|
||||||
}, Ft = ({ cols: e = 24, rowHeight: t = 16, itemMargin: n = [8, 16], containerPadding: i = [0, 0], fields: r = [], children: a, basicForm: o = null }) => {
|
}, Ft = ({ cols: e = 24, rowHeight: t = 16, itemMargin: n = [8, 16], containerPadding: i = [0, 0], fields: r = [], children: a, basicForm: o = null }) => {
|
||||||
const s = hn(r, Cn, o);
|
const s = hn(r, Cn, o);
|
||||||
return j("div", { className: "ff-grid-layout-form", style: { "--grid-layout-item-margin-x": `${(n == null ? void 0 : n[0]) ?? 8}px`, "--grid-layout-item-margin-y": `${(n == null ? void 0 : n[1]) ?? 16}px`, "--grid-layout-container-padding-y": `${(i == null ? void 0 : i[0]) || 0}px`, "--grid-layout-container-padding-x": `${(i == null ? void 0 : i[1]) || 0}px`, "--grid-layout-cols": e, "--grid-layout-row-height": `${t}px` }, children: [s, a && x.cloneElement(a, { cols: e, rowHeight: t, itemMargin: n, containerPadding: i, fields: r })] });
|
return j("div", { className: "ff-grid-layout-form", style: { "--grid-layout-item-margin-x": `${(n == null ? void 0 : n[0]) ?? 8}px`, "--grid-layout-item-margin-y": `${(n == null ? void 0 : n[1]) ?? 16}px`, "--grid-layout-container-padding-y": `${(i == null ? void 0 : i[0]) || 0}px`, "--grid-layout-container-padding-x": `${(i == null ? void 0 : i[1]) || 0}px`, "--grid-layout-cols": e, "--grid-layout-row-height": `${t}px` }, children: [s, a && x.cloneElement(a, { cols: e, rowHeight: t, itemMargin: n, containerPadding: i, fields: r })] });
|
||||||
};
|
};
|
||||||
Ft.propTypes = { fields: w.array };
|
Ft.propTypes = { fields: w.array };
|
||||||
const Ei = (Ht = Ft, ({ code: e, layout: t, name: n, primaryKey: i = 0, style: r = {}, formProps: a = {}, form: o, basicForm: s, isPreview: l = !1, className: g, onFinish: c, onValuesChange: p = () => {
|
const Ei = (Ht = Ft, ({ code: e, layout: t, name: n, primaryKey: i = 0, style: r = {}, formProps: a = {}, form: o, basicForm: s, isPreview: l = !1, className: g, onFinish: d, onValuesChange: p = () => {
|
||||||
}, ...f }) => {
|
}, ...f }) => {
|
||||||
const { align: m, autoComplete: h, resource: b, items: C, hides: k, rowHeight: v, marginX: S, marginY: N, cols: V, listenChangeFields: q, listenChangeFieldsFunc: B, pk: M, uuid: R } = Pi(e), [z] = te.useForm(o), $ = H(() => [{ name: "__PK__", value: M }, { name: "__PROPS__", value: a }, { name: "__RESOURCE__", value: b }, { name: "__LAYOUT_KEY__", value: e }, { name: "__LAYOUT_UUID__", value: R }, { name: "__PRIMARY_KEY__", value: i }], [M, e, R, b, i, a]);
|
const { align: m, autoComplete: h, resource: b, items: C, hides: k, rowHeight: v, marginX: S, marginY: $, cols: V, listenChangeFields: q, listenChangeFieldsFunc: B, pk: M, uuid: R } = Pi(e), [z] = te.useForm(o), N = H(() => [{ name: "__PK__", value: M }, { name: "__PROPS__", value: a }, { name: "__RESOURCE__", value: b }, { name: "__LAYOUT_KEY__", value: e }, { name: "__LAYOUT_UUID__", value: R }, { name: "__PRIMARY_KEY__", value: i }], [M, e, R, b, i, a]);
|
||||||
return j(te, { className: g, name: n || e, layout: t || m, fields: $, form: z, autoComplete: h, style: { ...r, position: "relative" }, onFinish: c, onValuesChange: (F, J) => (({ changedValues: de, allValues: Se, listenChangeFields: $e, listenChangeFieldsFunc: Ne, onValuesChange: K, code: jt }) => {
|
return j(te, { className: g, name: n || e, layout: t || m, fields: N, form: z, autoComplete: h, style: { ...r, position: "relative" }, onFinish: d, onValuesChange: (F, J) => (({ changedValues: de, allValues: Se, listenChangeFields: Ne, listenChangeFieldsFunc: $e, onValuesChange: K, code: jt }) => {
|
||||||
K(de, Se), Ne && Array.isArray($e) && xe.exec(Ne, { changedValues: de, allValues: Se }, { getFieldValue: z.getFieldValue, setFieldValue: z.setFieldValue, setFieldsValue: z.setFieldsValue, isFieldTouched: z.isFieldTouched, isFieldsTouched: z.isFieldsTouched }).catch((ct) => console.error("onFormValuesChange", ct));
|
K(de, Se), $e && Array.isArray(Ne) && xe.exec($e, { changedValues: de, allValues: Se }, { getFieldValue: z.getFieldValue, setFieldValue: z.setFieldValue, setFieldsValue: z.setFieldsValue, isFieldTouched: z.isFieldTouched, isFieldsTouched: z.isFieldsTouched }).catch((ct) => console.error("onFormValuesChange", ct));
|
||||||
})({ changedValues: F, allValues: J, listenChangeFields: q, listenChangeFieldsFunc: B, onValuesChange: p, code: e }), children: [u(Ht, { ...f, form: z, basicForm: s, code: e, fields: C, cols: V, rowHeight: v, itemMargin: [S, N] }), k == null ? void 0 : k.map((F) => {
|
})({ changedValues: F, allValues: J, listenChangeFields: q, listenChangeFieldsFunc: B, onValuesChange: p, code: e }), children: [u(Ht, { ...f, form: z, basicForm: s, code: e, fields: C, cols: V, rowHeight: v, itemMargin: [S, $] }), k == null ? void 0 : k.map((F) => {
|
||||||
var J;
|
var J;
|
||||||
return u(Qt, { name: F.code, children: u(Fi, { form: z, basicForm: s, name: F.code, type: F.type, initialValue: F.initialValue, initialValueLanguage: (J = F.extras) == null ? void 0 : J.initialValueLanguage }) }, JSON.stringify(F.code));
|
return u(Qt, { name: F.code, children: u(Fi, { form: z, basicForm: s, name: F.code, type: F.type, initialValue: F.initialValue, initialValueLanguage: (J = F.extras) == null ? void 0 : J.initialValueLanguage }) }, JSON.stringify(F.code));
|
||||||
})] }, e);
|
})] }, e);
|
||||||
});
|
});
|
||||||
var Ht;
|
var Ht;
|
||||||
const kn = ({ $setting: e, $close: t, extras: n, code: i, primaryKey: r, ...a }) => {
|
const kn = ({ $setting: e, $close: t, extras: n, code: i, primaryKey: r, ...a }) => {
|
||||||
const [o] = te.useForm(), s = $i(i, r, e), l = Ni(i, r, e);
|
const [o] = te.useForm(), s = useFormAction(o, i, r, e);
|
||||||
return L(() => {
|
return u(Y, { actions: j(x.Fragment, { children: [u(T, { name: (e == null ? void 0 : e.okText) || "保存", type: "primary", widget: () => s({ onSuccess: t }) }), u(T, { name: (e == null ? void 0 : e.cancelText) || "取消", widget: () => t(!1) })] }), extras: n, children: u(Ei, { form: o, code: i, primaryKey: r, ...a }) });
|
||||||
s ? o.setFieldsValue(s) : o.resetFields();
|
|
||||||
}, [s]), u(Y, { actions: j(x.Fragment, { children: [u(T, { name: (e == null ? void 0 : e.okText) || "保存", type: "primary", widget: () => l(o, { onSuccess: t }) }), u(T, { name: (e == null ? void 0 : e.cancelText) || "取消", widget: () => t(!1) })] }), extras: n, children: u(Ei, { form: o, code: i, primaryKey: r, ...a }) });
|
|
||||||
}, Jt = /* @__PURE__ */ new Set(), vt = (e = [], t = 0) => {
|
}, Jt = /* @__PURE__ */ new Set(), vt = (e = [], t = 0) => {
|
||||||
const n = e[t];
|
const n = e[t];
|
||||||
if (n.length && !Jt.has(n)) {
|
if (n.length && !Jt.has(n)) {
|
||||||
@ -773,101 +778,101 @@ Pt.propTypes = { className: w.string, type: w.string.isRequired, style: w.object
|
|||||||
const ji = (e, t, n, i) => ke.redirect(n, t, i), Ai = (e, t = {}, n, i = {}) => {
|
const ji = (e, t, n, i) => ke.redirect(n, t, i), Ai = (e, t = {}, n, i = {}) => {
|
||||||
var a;
|
var a;
|
||||||
const r = (a = i.router) == null ? void 0 : a.reduce((o, [s, l, g]) => {
|
const r = (a = i.router) == null ? void 0 : a.reduce((o, [s, l, g]) => {
|
||||||
const c = d.get(t, ["router", s]);
|
const d = c.get(t, ["router", s]);
|
||||||
if (!c && c !== 0 && l) throw `请传入 ${g}`;
|
if (!d && d !== 0 && l) throw `请传入 ${g}`;
|
||||||
return `${o}/${c}`;
|
return `${o}/${d}`;
|
||||||
}, `/api/${n}`);
|
}, `/api/${n}`);
|
||||||
return A.del(r, t.param).msg();
|
return A.del(r, t.param).msg();
|
||||||
}, Kt = (e, t, n, { status: { loading: i, disabled: r }, setStatus: a }) => {
|
}, Kt = (e, t, n, { status: { loading: i, disabled: r }, setStatus: a }) => {
|
||||||
const o = { loading: (s) => s === void 0 ? i : a((l) => ({ ...l, loading: s })), disabled: (s) => s === void 0 ? r : a((l) => ({ ...l, disabled: s })) };
|
const o = { loading: (s) => s === void 0 ? i : a((l) => ({ ...l, loading: s })), disabled: (s) => s === void 0 ? r : a((l) => ({ ...l, disabled: s })) };
|
||||||
return d.isFunction(n) ? n.call(null, { ...t, ...o }) : d.isString(n) && n ? xe.exec(n, t, o) : null;
|
return c.isFunction(n) ? n.call(null, { ...t, ...o }) : c.isString(n) && n ? xe.exec(n, t, o) : null;
|
||||||
}, _t = (e, t, n, i, r) => d.isString(n) && n ? le.getWidgetComponent(n).then(({ default: a }) => G.modal(a, { ...t, $setting: i }, r != null && r.title ? { ...r, title: d.template(r.title)(e) } : r)).catch((a) => {
|
}, _t = (e, t, n, i, r) => c.isString(n) && n ? le.getWidgetComponent(n).then(({ default: a }) => G.modal(a, { ...t, $setting: i }, r != null && r.title ? { ...r, title: c.template(r.title)(e) } : r)).catch((a) => {
|
||||||
G.error(n, { content: a.toString() });
|
G.error(n, { content: a.toString() });
|
||||||
}) : G.modal(n, { ...t, $setting: i }, r != null && r.title ? { ...r, title: d.template(r.title)(e) } : r), Li = (e, t, n, i, r) => G.modal(kn, { ...t, $setting: i, code: n }, r != null && r.title ? { ...r, title: d.template(r.title)(e) } : r), Vi = (e, t, n, i, r) => G.modal(Rt, { base62params: t, $setting: i, listCode: n }, r != null && r.title ? { ...r, title: d.template(r.title)(e) } : r), Ii = ({ widget: e, widgetType: t, widgetData: n, widgetProps: i, widgetSetting: r, widgetContainerProps: a }, { onAfterClick: o, onBeforeClick: s }) => {
|
}) : G.modal(n, { ...t, $setting: i }, r != null && r.title ? { ...r, title: c.template(r.title)(e) } : r), Li = (e, t, n, i, r) => G.modal(kn, { ...t, $setting: i, code: n }, r != null && r.title ? { ...r, title: c.template(r.title)(e) } : r), Vi = (e, t, n, i, r) => G.modal(Rt, { base62params: t, $setting: i, listCode: n }, r != null && r.title ? { ...r, title: c.template(r.title)(e) } : r), Ii = ({ widget: e, widgetType: t, widgetData: n, widgetProps: i, widgetSetting: r, widgetContainerProps: a }, { onAfterClick: o, onBeforeClick: s }) => {
|
||||||
const l = ce(ne), [g, c] = O({ leading: !0, trailing: !1 }), p = H(() => {
|
const l = ce(ne), [g, d] = O({ leading: !0, trailing: !1 }), p = H(() => {
|
||||||
switch (t) {
|
switch (t) {
|
||||||
case "redirect":
|
case "redirect":
|
||||||
return d.partialRight(ji, e, r);
|
return c.partialRight(ji, e, r);
|
||||||
case "func":
|
case "func":
|
||||||
return d.partialRight(Kt, (r == null ? void 0 : r.code) ?? e, { status: g, setStatus: c });
|
return c.partialRight(Kt, (r == null ? void 0 : r.code) ?? e, { status: g, setStatus: d });
|
||||||
case "component":
|
case "component":
|
||||||
case "fsdpf-component":
|
case "fsdpf-component":
|
||||||
return d.partialRight(_t, e, r, a);
|
return c.partialRight(_t, e, r, a);
|
||||||
case "grid-layout-form":
|
case "grid-layout-form":
|
||||||
return d.partialRight(Li, e, r, a);
|
return c.partialRight(Li, e, r, a);
|
||||||
case "data-list":
|
case "data-list":
|
||||||
return d.partialRight(Vi, e, r, a);
|
return c.partialRight(Vi, e, r, a);
|
||||||
case "destroy":
|
case "destroy":
|
||||||
return d.partialRight(Ai, e, r, a);
|
return c.partialRight(Ai, e, r, a);
|
||||||
default:
|
default:
|
||||||
if (Et(e) || x.isValidElement(e)) return d.partialRight(_t, e, r, a);
|
if (Et(e) || x.isValidElement(e)) return c.partialRight(_t, e, r, a);
|
||||||
if (d.isFunction(e)) return d.partialRight(Kt, (r == null ? void 0 : r.code) || e, { status: g, setStatus: c });
|
if (c.isFunction(e)) return c.partialRight(Kt, (r == null ? void 0 : r.code) || e, { status: g, setStatus: d });
|
||||||
}
|
}
|
||||||
return (...f) => console.error("useButton unknown widgetType", t, ...f);
|
return (...f) => console.error("useButton unknown widgetType", t, ...f);
|
||||||
}, [e, t]);
|
}, [e, t]);
|
||||||
return [d.debounce((f) => (s == null || s(f), Promise.resolve(Je(i, f, { list: l })).then((m) => p(f, { ...n, ...m })).then((m) => o == null ? void 0 : o(m)).catch(console.error)), 300, { leading: !0, trailing: !1 }), g];
|
return [c.debounce((f) => (s == null || s(f), Promise.resolve(Je(i, f, { list: l })).then((m) => p(f, { ...n, ...m })).then((m) => o == null ? void 0 : o(m)).catch(console.error)), 300, { leading: !0, trailing: !1 }), g];
|
||||||
}, xn = ({ type: e, name: t, className: n, icon: i, iconPosition: r, size: a }, o = "default") => H(() => {
|
}, xn = ({ type: e, name: t, className: n, icon: i, iconPosition: r, size: a }, o = "default") => H(() => {
|
||||||
const s = { type: "primary", className: I("ff-button", n), iconPosition: r, size: a };
|
const s = { type: "primary", className: I("ff-button", n), 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 = I(s.className, "ff-default"))) : o !== "circle" && o !== "round" || (s.shape = o), i && (s.icon = u(Pt, { type: i })), t && (s.children = t), s;
|
return e === "danger" ? s.danger = !0 : e === "default" && (s.type = e), o === "link" || o === "dashed" ? (s.type = o, e === "default" && (s.className = I(s.className, "ff-default"))) : o !== "circle" && o !== "round" || (s.shape = o), i && (s.icon = u(Pt, { type: i })), t && (s.children = t), s;
|
||||||
}, [o, e, n, i, r]), lt = ({ data: e, widget: t, widgetType: n = "fsdpf-component", widgetData: i, widgetProps: r, widgetSetting: a, widgetContainerProps: o, onAfterClick: s, onBeforeClick: l, children: g, extras: c }) => {
|
}, [o, e, n, i, r]), lt = ({ data: e, widget: t, widgetType: n = "fsdpf-component", widgetData: i, widgetProps: r, widgetSetting: a, widgetContainerProps: o, onAfterClick: s, onBeforeClick: l, children: g, extras: d }) => {
|
||||||
const p = ce(ne), [f, m] = O(!1), [h, b] = O("hover"), [C, k] = O({}), [v, S] = O(), { placement: N, align: V, zIndex: q, arrow: B = { pointAtCenter: !0 }, getPopupContainer: M, ...R } = o || {};
|
const p = ce(ne), [f, m] = O(!1), [h, b] = O("hover"), [C, k] = O({}), [v, S] = O(), { placement: $, align: V, zIndex: q, arrow: B = { pointAtCenter: !0 }, getPopupContainer: M, ...R } = o || {};
|
||||||
L(() => {
|
L(() => {
|
||||||
n == "grid-layout-form" ? S(x.createElement(kn, { ...i, $setting: a, code: t })) : n == "data-list" ? S(x.createElement(Rt, { base62params: e, $setting: a, listCode: t })) : d.isString(t) ? le.getWidgetComponent(t).then(({ default: F }) => {
|
n == "grid-layout-form" ? S(x.createElement(kn, { ...i, $setting: a, code: t })) : n == "data-list" ? S(x.createElement(Rt, { base62params: e, $setting: a, listCode: t })) : c.isString(t) ? le.getWidgetComponent(t).then(({ default: F }) => {
|
||||||
S(x.createElement(F, { ...i, $setting: a }));
|
S(x.createElement(F, { ...i, $setting: a }));
|
||||||
}).catch((F) => S(F.toString())) : Et(t) ? S(x.createElement(t, { ...i, $setting: a })) : x.isValidElement(t) && S(x.cloneElement(t, { ...i, $setting: a }));
|
}).catch((F) => S(F.toString())) : Et(t) ? S(x.createElement(t, { ...i, $setting: a })) : x.isValidElement(t) && S(x.cloneElement(t, { ...i, $setting: a }));
|
||||||
}, [t, n, i]), L(() => {
|
}, [t, n, i]), L(() => {
|
||||||
Promise.resolve(Je(r, e, { list: p })).then(k);
|
Promise.resolve(Je(r, e, { list: p })).then(k);
|
||||||
}, [r, e, p.getBase62params]);
|
}, [r, e, p.getBase62params]);
|
||||||
const z = (F, J = !1) => (m(F), !F && b("hover"), F ? l == null ? void 0 : l(C) : s == null ? void 0 : s(J)), $ = (F) => {
|
const z = (F, J = !1) => (m(F), !F && b("hover"), F ? l == null ? void 0 : l(C) : s == null ? void 0 : s(J)), N = (F) => {
|
||||||
m(!0), b("click");
|
m(!0), b("click");
|
||||||
};
|
};
|
||||||
return u(Un, { zIndex: q, placement: N, onPopupClick: $, onClick: $, open: f, align: V, arrow: B, trigger: h, getPopupContainer: M, content: u(Mi, { ...R, extras: c, children: v && x.cloneElement(v, { ...C, $close: (F) => z(!1, F) }) }), children: g, onOpenChange: z });
|
return u(Un, { zIndex: q, placement: $, onPopupClick: N, onClick: N, open: f, align: V, arrow: B, trigger: h, getPopupContainer: M, content: u(Mi, { ...R, extras: d, children: v && x.cloneElement(v, { ...C, $close: (F) => z(!1, F) }) }), children: g, onOpenChange: z });
|
||||||
}, Mi = ({ title: e, className: t, children: n, extras: i, width: r, height: a, ...o }) => {
|
}, Mi = ({ title: e, className: t, children: n, extras: i, width: r, height: a, ...o }) => {
|
||||||
const [s, l] = O({}), g = X((m, h) => l((b) => ({ ...b, [m]: h })), []), c = X((m) => l((h) => ({ ...h, [m]: void 0 })), []), p = e ? x.createElement("div", { className: "ff-popup-title" }, e) : s == null ? void 0 : s.title, f = i ?? x.createElement("div", { className: "ff-popup-reserved-extras" }, i);
|
const [s, l] = O({}), g = X((m, h) => l((b) => ({ ...b, [m]: h })), []), d = X((m) => l((h) => ({ ...h, [m]: void 0 })), []), p = e ? x.createElement("div", { className: "ff-popup-title" }, e) : s == null ? void 0 : s.title, f = i ?? x.createElement("div", { className: "ff-popup-reserved-extras" }, i);
|
||||||
return u(He.Provider, { value: { ele: s, mount: g, unmount: c }, children: j("div", { className: I("ff-popup ff-popover", t, s.rootClassName), style: { width: r, height: a }, ...o, children: [j("div", { className: "ff-popup-header", children: [p, s == null ? void 0 : s["sub-title"]] }), n, j("div", { className: "ff-popup-footer", children: [f, s == null ? void 0 : s.extras, s == null ? void 0 : s.actions] })] }) });
|
return u(He.Provider, { value: { ele: s, mount: g, unmount: d }, children: j("div", { className: I("ff-popup ff-popover", t, s.rootClassName), style: { width: r, height: a }, ...o, children: [j("div", { className: "ff-popup-header", children: [p, s == null ? void 0 : s["sub-title"]] }), n, j("div", { className: "ff-popup-footer", children: [f, s == null ? void 0 : s.extras, s == null ? void 0 : s.actions] })] }) });
|
||||||
};
|
};
|
||||||
lt.propTypes = { widgetType: w.oneOf(["fsdpf-component", "grid-layout-form", "data-list"]) };
|
lt.propTypes = { widgetType: w.oneOf(["fsdpf-component", "grid-layout-form", "data-list"]) };
|
||||||
const _e = (e) => function({ className: t, variant: n, children: i, name: r, icon: a, type: o = "default", iconPosition: s = "start", noAuthType: l, onAfterClick: g, onBeforeClick: c, data: p, loading: f, disabled: m, tooltip: h, confirm: b, widget: C = () => {
|
const _e = (e) => function({ className: t, variant: n, children: i, name: r, icon: a, type: o = "default", iconPosition: s = "start", noAuthType: l, onAfterClick: g, onBeforeClick: d, data: p, loading: f, disabled: m, tooltip: h, confirm: b, widget: C = () => {
|
||||||
}, widgetType: k, widgetData: v, widgetProps: S, widgetSetting: N, widgetContainerProps: V, ...q }) {
|
}, widgetType: k, widgetData: v, widgetProps: S, widgetSetting: $, widgetContainerProps: V, ...q }) {
|
||||||
const { mode: B, ...M } = V || {}, R = xn({ className: t, name: r, type: o, icon: a, iconPosition: s }, n ?? e), z = u(Ze, { ...R, ...q, children: i || r });
|
const { mode: B, ...M } = V || {}, R = xn({ className: t, name: r, type: o, icon: a, iconPosition: s }, n ?? e), z = u(Ze, { ...R, ...q, children: i || r });
|
||||||
if (B === "popover" && !["destroy", "redirect", "func"].includes(k)) return u(lt, { data: p, widget: C, widgetType: k, widgetData: v, widgetProps: S, widgetSetting: N, widgetContainerProps: M, onAfterClick: g, onBeforeClick: c, children: z });
|
if (B === "popover" && !["destroy", "redirect", "func"].includes(k)) return u(lt, { data: p, widget: C, widgetType: k, widgetData: v, widgetProps: S, widgetSetting: $, widgetContainerProps: M, onAfterClick: g, onBeforeClick: d, children: z });
|
||||||
const $ = d.isEmpty(h) || !h.enabled ? {} : h, F = d.isEmpty(b) ? { enabled: !1 } : Object.assign({ enabled: !0 }, b), [J, de] = O(!1), [Se, { disabled: $e, loading: Ne }] = Ii({ widget: C, widgetType: k, widgetData: v, widgetProps: S, widgetSetting: N, widgetContainerProps: M }, { onAfterClick: g, onBeforeClick: c });
|
const N = c.isEmpty(h) || !h.enabled ? {} : h, F = c.isEmpty(b) ? { enabled: !1 } : Object.assign({ enabled: !0 }, b), [J, de] = O(!1), [Se, { disabled: Ne, loading: $e }] = Ii({ widget: C, widgetType: k, widgetData: v, widgetProps: S, widgetSetting: $, widgetContainerProps: M }, { onAfterClick: g, onBeforeClick: d });
|
||||||
return u(Hn, { okText: "确定", cancelText: "取消", getPopupContainer: (K) => K, ...F, disabled: $e || m, open: J, onOpenChange: (K) => {
|
return u(Hn, { okText: "确定", cancelText: "取消", getPopupContainer: (K) => K, ...F, disabled: Ne || m, open: J, onOpenChange: (K) => {
|
||||||
if (!K) return de(K);
|
if (!K) return de(K);
|
||||||
F.enabled ? de(K) : Se(p);
|
F.enabled ? de(K) : Se(p);
|
||||||
}, onConfirm: (K) => {
|
}, onConfirm: (K) => {
|
||||||
Se(p, K);
|
Se(p, K);
|
||||||
}, onClick: (K) => {
|
}, onClick: (K) => {
|
||||||
K.stopPropagation();
|
K.stopPropagation();
|
||||||
}, children: u(Jn, { getPopupContainer: (K) => K, ...$, title: J ? null : $ == null ? void 0 : $.title, trigger: ["hover", "click"], children: x.cloneElement(z, { loading: Ne || f, disabled: $e || m }) }) });
|
}, children: u(Jn, { getPopupContainer: (K) => K, ...N, title: J ? null : N == null ? void 0 : N.title, trigger: ["hover", "click"], children: x.cloneElement(z, { loading: $e || f, disabled: Ne || m }) }) });
|
||||||
}, T = _e("default");
|
}, T = _e("default");
|
||||||
T.propTypes = { type: w.oneOf(["primary", "default", "danger", ""]), size: w.oneOf(["large", "middle", "small"]), name: w.string, icon: w.string, iconPosition: w.oneOf(["start", "end"]), data: w.any, widget: w.any, widgetType: w.oneOf(["destroy", "redirect", "func", "component", "fsdpf-component", "grid-layout-form", "grid-layout", "data-list"]), widgetData: w.object, widgetProps: w.object, widgetSetting: w.object, widgetContainerProps: w.object, tooltip: w.exact({ title: w.string.isRequired, placement: w.oneOf(["top", "left", "right", "bottom", "topLeft", "topRight", "bottomLeft", "bottomRight", "leftTop", "leftBottom", "rightTop", "rightBottom"]), enabled: w.oneOfType([w.bool, w.number]), getPopupContainer: w.func }), confirm: w.exact({ title: w.string.isRequired, cancelText: w.string, okText: w.string, okType: w.oneOf(["primary", "default", "danger", ""]), placement: w.oneOf(["top", "left", "right", "bottom", "topLeft", "topRight", "bottomLeft", "bottomRight", "leftTop", "leftBottom", "rightTop", "rightBottom"]), enabled: w.oneOfType([w.bool, w.number]), getPopupContainer: w.func, arrow: w.oneOfType([w.bool, w.exact({ pointAtCenter: w.bool })]) }) };
|
T.propTypes = { type: w.oneOf(["primary", "default", "danger", ""]), size: w.oneOf(["large", "middle", "small"]), name: w.string, icon: w.string, iconPosition: w.oneOf(["start", "end"]), data: w.any, widget: w.any, widgetType: w.oneOf(["destroy", "redirect", "func", "component", "fsdpf-component", "grid-layout-form", "grid-layout", "data-list"]), widgetData: w.object, widgetProps: w.object, widgetSetting: w.object, widgetContainerProps: w.object, tooltip: w.exact({ title: w.string.isRequired, placement: w.oneOf(["top", "left", "right", "bottom", "topLeft", "topRight", "bottomLeft", "bottomRight", "leftTop", "leftBottom", "rightTop", "rightBottom"]), enabled: w.oneOfType([w.bool, w.number]), getPopupContainer: w.func }), confirm: w.exact({ title: w.string.isRequired, cancelText: w.string, okText: w.string, okType: w.oneOf(["primary", "default", "danger", ""]), placement: w.oneOf(["top", "left", "right", "bottom", "topLeft", "topRight", "bottomLeft", "bottomRight", "leftTop", "leftBottom", "rightTop", "rightBottom"]), enabled: w.oneOfType([w.bool, w.number]), getPopupContainer: w.func, arrow: w.oneOfType([w.bool, w.exact({ pointAtCenter: w.bool })]) }) };
|
||||||
const zi = _e("link"), Bi = _e("circle"), Di = _e("round"), qi = _e("dashed"), Gt = ({ options: e = [], triggerWeights: t = ["grid-layout-form", "grid-layout", "fsdpf-component", "print"], onAfterClick: n = (m, h, b) => {
|
const zi = _e("link"), Bi = _e("circle"), Di = _e("round"), qi = _e("dashed"), Gt = ({ options: e = [], triggerWeights: t = ["grid-layout-form", "grid-layout", "fsdpf-component", "print"], onAfterClick: n = (m, h, b) => {
|
||||||
}, onBeforeClick: i = (m, h, b) => {
|
}, onBeforeClick: i = (m, h, b) => {
|
||||||
}, labelVariant: r = "link", labelSize: a, labelRender: o, btnVariant: s, btnSize: l, btnRender: g = (m, h) => u(T, { ...m, data: h }, m.uuid || ht()), widgetContainerProps: c = {}, children: p, data: f }) => {
|
}, labelVariant: r = "link", labelSize: a, labelRender: o, btnVariant: s, btnSize: l, btnRender: g = (m, h) => u(T, { ...m, data: h }, m.uuid || ht()), widgetContainerProps: d = {}, children: p, data: f }) => {
|
||||||
if (d.isEmpty(e)) return p;
|
if (c.isEmpty(e)) return p;
|
||||||
const [m, h] = H(() => (e || []).reduce((C, k) => {
|
const [m, h] = H(() => (e || []).reduce((C, k) => {
|
||||||
const v = t.indexOf(k.widgetType);
|
const v = t.indexOf(k.widgetType);
|
||||||
return v === -1 ? C[1].push(k) : C[0] ? v < t.indexOf(C[0].widgetType) ? (C[1].push(C[0]), C[0] = k) : C[1].push(k) : C[0] = k, C;
|
return v === -1 ? C[1].push(k) : C[0] ? v < t.indexOf(C[0].widgetType) ? (C[1].push(C[0]), C[0] = k) : C[1].push(k) : C[0] = k, C;
|
||||||
}, [null, []]), [e, t]);
|
}, [null, []]), [e, t]);
|
||||||
o ? p = o(m, f) || p : p || (p = u(Ze, { ...xn(Object.assign(m != null && m.name || m != null && m.icon ? {} : { icon: "icon-location" }, m, { size: a }), r) }));
|
o ? p = o(m, f) || p : p || (p = u(Ze, { ...xn(Object.assign(m != null && m.name || m != null && m.icon ? {} : { icon: "icon-location" }, m, { size: a }), r) }));
|
||||||
const b = h.map((C) => g(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: d.partialRight(n, C, f), onBeforeClick: d.partialRight(i, C, f) }, { size: l, variant: s }), f));
|
const b = h.map((C) => g(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(n, C, f), onBeforeClick: c.partialRight(i, C, f) }, { size: l, variant: s }), f));
|
||||||
return u(lt, { widget: m == null ? void 0 : m.widget, widgetType: m == null ? void 0 : m.widgetType, widgetProps: m == null ? void 0 : m.widgetProps, widgetSetting: m == null ? void 0 : m.widgetSetting, widgetContainerProps: Object.assign({}, c, m == null ? void 0 : m.widgetContainerProps), data: f, widgetData: m == null ? void 0 : m.widgetData, extras: b, onAfterClick: d.partialRight(n, m, f), onBeforeClick: d.partialRight(i, m, f), children: p });
|
return u(lt, { widget: m == null ? void 0 : m.widget, widgetType: m == null ? void 0 : m.widgetType, widgetProps: m == null ? void 0 : m.widgetProps, widgetSetting: m == null ? void 0 : m.widgetSetting, widgetContainerProps: Object.assign({}, d, m == null ? void 0 : m.widgetContainerProps), data: f, widgetData: m == null ? void 0 : m.widgetData, extras: b, onAfterClick: c.partialRight(n, m, f), onBeforeClick: c.partialRight(i, m, f), children: p });
|
||||||
};
|
};
|
||||||
Gt.propTypes = { triggerWeights: w.array, options: w.arrayOf(w.shape({ ...T.propTypes, widgetType: T.propTypes.widgetType.isRequired })), btnSize: T.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: T.propTypes.size, onAfterClick: w.func, onBeforeClick: w.func, widgetContainerProps: T.propTypes.widgetContainerProps, data: T.propTypes.data }, T.Link = zi, T.Link.defaultProps = T.defaultProps, T.Link.propTypes = T.propTypes, T.Circle = Bi, T.Circle.defaultProps = T.defaultProps, T.Circle.propTypes = T.propTypes, T.Round = Di, T.Round.defaultProps = T.defaultProps, T.Round.propTypes = T.propTypes, T.Dashed = qi, T.Dashed.defaultProps = T.defaultProps, T.Dashed.propTypes = T.propTypes, T.Popover = lt, T.GroupPopover = Gt;
|
Gt.propTypes = { triggerWeights: w.array, options: w.arrayOf(w.shape({ ...T.propTypes, widgetType: T.propTypes.widgetType.isRequired })), btnSize: T.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: T.propTypes.size, onAfterClick: w.func, onBeforeClick: w.func, widgetContainerProps: T.propTypes.widgetContainerProps, data: T.propTypes.data }, T.Link = zi, T.Link.defaultProps = T.defaultProps, T.Link.propTypes = T.propTypes, T.Circle = Bi, T.Circle.defaultProps = T.defaultProps, T.Circle.propTypes = T.propTypes, T.Round = Di, T.Round.defaultProps = T.defaultProps, T.Round.propTypes = T.propTypes, T.Dashed = qi, T.Dashed.defaultProps = T.defaultProps, T.Dashed.propTypes = T.propTypes, T.Popover = lt, T.GroupPopover = Gt;
|
||||||
const Wi = ({ fields: e, formProps: t, $close: n }) => {
|
const Wi = ({ fields: e, formProps: t, $close: n }) => {
|
||||||
const [i] = te.useForm(), r = H(() => [{ name: "__PROPS__", value: t }], [t]);
|
const [i] = te.useForm(), r = H(() => [{ name: "__PROPS__", value: t }], [t]);
|
||||||
return u(Y, { actions: j(x.Fragment, { children: [u(T, { name: "取消", widget: () => n(!1) }), u(T, { name: "确定", type: "primary", widget: () => i.validateFields(!0).then(n) })] }), children: u(te, { fields: r, form: i, className: "ff-modal-form", children: e == null ? void 0 : e.map(({ code: a, ...o }) => u(Cn, { code: a, ...o }, a)) }) });
|
return u(Y, { actions: j(x.Fragment, { children: [u(T, { name: "取消", widget: () => n(!1) }), u(T, { name: "确定", type: "primary", widget: () => i.validateFields(!0).then(n) })] }), children: u(te, { fields: r, form: i, className: "ff-modal-form", children: e == null ? void 0 : e.map(({ code: a, ...o }) => u(Cn, { code: a, ...o }, a)) }) });
|
||||||
}, Ui = ({ className: e, $close: t, children: n, title: i, subTitle: r, actions: a, extras: o, ...s }) => j(Zn, { ...s, prefixCls: "ff-drawer", className: I("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: [u("button", { "aria-label": "Close", className: "ff-popup-close", onClick: s.onClose, children: u(Nt, { type: "close" }) }), i, r] }), u("div", { className: "ff-popup-body", children: n }), j("div", { className: "ff-popup-footer", children: [o, a] })] }), Hi = ({ className: e, $close: t, $event: n, children: i, title: r, subTitle: a, actions: o, extras: s, placement: l, ...g }) => {
|
}, Ui = ({ className: e, $close: t, children: n, title: i, subTitle: r, actions: a, extras: o, ...s }) => j(Zn, { ...s, prefixCls: "ff-drawer", className: I("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: [u("button", { "aria-label": "Close", className: "ff-popup-close", onClick: s.onClose, children: u($t, { type: "close" }) }), i, r] }), u("div", { className: "ff-popup-body", children: n }), j("div", { className: "ff-popup-footer", children: [o, a] })] }), Hi = ({ className: e, $close: t, $event: n, children: i, title: r, subTitle: a, actions: o, extras: s, placement: l, ...g }) => {
|
||||||
const c = (n == null ? void 0 : n.pageX) === void 0 ? { animation: null, maskAnimation: null, mousePosition: { x: null, y: null } } : { animation: "zoom", maskAnimation: "fade", mousePosition: { x: n == null ? void 0 : n.pageX, y: n == null ? void 0 : n.pageY } };
|
const d = (n == null ? void 0 : n.pageX) === void 0 ? { animation: null, maskAnimation: null, mousePosition: { x: null, y: null } } : { animation: "zoom", maskAnimation: "fade", mousePosition: { x: n == null ? void 0 : n.pageX, y: n == null ? void 0 : n.pageY } };
|
||||||
return u(ei, { ...g, ...c, prefixCls: "ff-modal", modalRender: () => j("div", { className: I("ff-modal-content ff-popup", e), children: [j("div", { className: "ff-popup-header", children: [u("button", { "aria-label": "Close", className: "ff-popup-close", onClick: g.onClose, children: u(Nt, { type: "close" }) }), r, a] }), u("div", { className: "ff-popup-body", children: i }), j("div", { className: "ff-popup-footer", children: [s, o] })] }) });
|
return u(ei, { ...g, ...d, prefixCls: "ff-modal", modalRender: () => j("div", { className: I("ff-modal-content ff-popup", e), children: [j("div", { className: "ff-popup-header", children: [u("button", { "aria-label": "Close", className: "ff-popup-close", onClick: g.onClose, children: u($t, { type: "close" }) }), r, a] }), u("div", { className: "ff-popup-body", children: i }), j("div", { className: "ff-popup-footer", children: [s, o] })] }) });
|
||||||
}, Sn = ({ placement: e, $close: t, $event: n, children: i, title: r, ...a }) => {
|
}, Sn = ({ placement: e, $close: t, $event: n, children: i, title: r, ...a }) => {
|
||||||
const [o, s] = O({}), [l, g] = O(!0), c = X((h, b) => s((C) => ({ ...C, [h]: b })), []), p = X((h) => s((b) => ({ ...b, [h]: void 0 })), []);
|
const [o, s] = O({}), [l, g] = O(!0), d = X((h, b) => s((C) => ({ ...C, [h]: b })), []), p = X((h) => s((b) => ({ ...b, [h]: void 0 })), []);
|
||||||
let f = { ...a, className: o.rootClassName, title: o.title || r && x.createElement("div", { className: I("ff-popup-title") }, r), subTitle: o["sub-title"], actions: o.actions, extras: o.extras, children: i, $close: t, $event: n, onClose: () => g(!1) };
|
let f = { ...a, className: o.rootClassName, title: o.title || r && x.createElement("div", { className: I("ff-popup-title") }, r), subTitle: o["sub-title"], actions: o.actions, extras: o.extras, children: i, $close: t, $event: n, onClose: () => g(!1) };
|
||||||
const m = () => {
|
const m = () => {
|
||||||
t(!1);
|
t(!1);
|
||||||
};
|
};
|
||||||
return u(He.Provider, { value: { ele: o, mount: c, unmount: p }, children: e && e !== "center" ? u(Ui, { ...f, placement: e, open: l, afterOpenChange: (h) => !h && m() }) : u(Hi, { ...f, visible: l, afterClose: m }) });
|
return u(He.Provider, { value: { ele: o, mount: d, unmount: p }, children: e && e !== "center" ? u(Ui, { ...f, placement: e, open: l, afterOpenChange: (h) => !h && m() }) : u(Hi, { ...f, visible: l, afterClose: m }) });
|
||||||
};
|
};
|
||||||
Sn.propTypes = { placement: w.oneOf(["center", "left", "top", "right", "bottom"]) };
|
Sn.propTypes = { placement: w.oneOf(["center", "left", "top", "right", "bottom"]) };
|
||||||
const _ = () => {
|
const _ = () => {
|
||||||
@ -881,9 +886,9 @@ const _ = () => {
|
|||||||
});
|
});
|
||||||
}, []);
|
}, []);
|
||||||
const i = (a, o = {}, s = {}) => new Promise((l, g) => r([l, g], a, o, s)), r = ([a, o], s, l = {}, g = {}) => {
|
const i = (a, o = {}, s = {}) => new Promise((l, g) => r([l, g], a, o, s)), r = ([a, o], s, l = {}, g = {}) => {
|
||||||
const c = _.$index++, p = (f) => ((m, h) => (_.$popups.delete(m), n(), h == null ? void 0 : h()))(c, () => a(f));
|
const d = _.$index++, p = (f) => ((m, h) => (_.$popups.delete(m), n(), h == null ? void 0 : h()))(d, () => a(f));
|
||||||
if (s === rn) return e.open({ ...g, key: c, content: x.createElement(s, { ...l, $close: () => e.close(c) }) });
|
if (s === rn) return e.open({ ...g, key: d, content: x.createElement(s, { ...l, $close: () => e.close(d) }) });
|
||||||
_.$popups.set(c, x.createElement(Sn, { maskClosable: !1, $event: l == null ? void 0 : l.$event, ...g, key: c, $close: p }, x.isValidElement(s) ? x.cloneElement(s, { ...l, $close: p }) : s != null && s.name || Mt.isForwardRef(s) || (s == null ? void 0 : s.$$typeof) === Mt.ForwardRef ? x.createElement(s, { ...l, $close: p }) : s)), n();
|
_.$popups.set(d, x.createElement(Sn, { maskClosable: !1, $event: l == null ? void 0 : l.$event, ...g, key: d, $close: p }, x.isValidElement(s) ? x.cloneElement(s, { ...l, $close: p }) : s != null && s.name || Mt.isForwardRef(s) || (s == null ? void 0 : s.$$typeof) === Mt.ForwardRef ? x.createElement(s, { ...l, $close: p }) : s)), n();
|
||||||
};
|
};
|
||||||
return j(x.Fragment, { children: [Array.from(_.$popups).map(([a, o]) => o), t] });
|
return j(x.Fragment, { children: [Array.from(_.$popups).map(([a, o]) => o), t] });
|
||||||
};
|
};
|
||||||
@ -980,8 +985,8 @@ const oe = class oe {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
Ce = new WeakMap(), Ae = new WeakMap(), E(oe, Ce, null), P(oe, "getInstance", () => (y(oe, Ce) || U(oe, Ce, new oe()), y(oe, Ce)));
|
Ce = new WeakMap(), Ae = new WeakMap(), E(oe, Ce, null), P(oe, "getInstance", () => (y(oe, Ce) || U(oe, Ce, new oe()), y(oe, Ce)));
|
||||||
let $t = oe;
|
let Nt = oe;
|
||||||
const le = $t.getInstance(), Ji = x.createContext({ user: {}, initUser: () => {
|
const le = Nt.getInstance(), Ji = x.createContext({ user: {}, initUser: () => {
|
||||||
}, initUserComplete: !1 }), Ki = x.createContext({ set: () => {
|
}, initUserComplete: !1 }), Ki = x.createContext({ set: () => {
|
||||||
}, get: () => {
|
}, get: () => {
|
||||||
}, assign: () => {
|
}, assign: () => {
|
||||||
@ -1016,41 +1021,42 @@ export {
|
|||||||
Tr as U,
|
Tr as U,
|
||||||
Ke as V,
|
Ke as V,
|
||||||
ot as W,
|
ot as W,
|
||||||
$r as X,
|
Nr as X,
|
||||||
Nr as Y,
|
$r as Y,
|
||||||
Ei as Z,
|
Ei as Z,
|
||||||
Ft as _,
|
Ft as _,
|
||||||
an as a,
|
an as a,
|
||||||
kn as a0,
|
kn as a0,
|
||||||
Pi as a1,
|
Pi as a1,
|
||||||
Ti as a2,
|
Ti as a2,
|
||||||
$i as a3,
|
Ni as a3,
|
||||||
Ni as a4,
|
$i as a4,
|
||||||
bn as a5,
|
Rr as a5,
|
||||||
Ri as a6,
|
bn as a6,
|
||||||
Rr as a7,
|
Ri as a7,
|
||||||
Pt as a8,
|
Fr as a8,
|
||||||
T as a9,
|
Pt as a9,
|
||||||
ni as aa,
|
T as aa,
|
||||||
Ii as ab,
|
ni as ab,
|
||||||
Y as ac,
|
Ii as ac,
|
||||||
He as ad,
|
Y as ad,
|
||||||
nn as ae,
|
He as ae,
|
||||||
_ as af,
|
nn as af,
|
||||||
G as ag,
|
_ as ag,
|
||||||
gr as ah,
|
G as ah,
|
||||||
pr as ai,
|
gr as ai,
|
||||||
mr as aj,
|
pr as aj,
|
||||||
le as ak,
|
mr as ak,
|
||||||
Et as al,
|
le as al,
|
||||||
_i as am,
|
Et as am,
|
||||||
A as an,
|
_i as an,
|
||||||
tn as ao,
|
A as ao,
|
||||||
Ie as ap,
|
tn as ap,
|
||||||
xe as aq,
|
Ie as aq,
|
||||||
ke as ar,
|
xe as ar,
|
||||||
Ji as as,
|
ke as as,
|
||||||
Ki as at,
|
Ji as at,
|
||||||
|
Ki as au,
|
||||||
Je as b,
|
Je as b,
|
||||||
fr as c,
|
fr as c,
|
||||||
sn as d,
|
sn as d,
|
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-DdIS_WOJ.js";
|
import { ai as s, a9 as p, aj as n, ak as t, ah as d } from "./common/main-UvNID6kN.js";
|
||||||
export {
|
export {
|
||||||
s as Empty,
|
s as Empty,
|
||||||
p as Icon,
|
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-DdIS_WOJ.js";
|
import { ae as o, ai as s, aj as d, ak as p, af as t, ah as n, ag as r, ad as u } from "./common/main-UvNID6kN.js";
|
||||||
export {
|
export {
|
||||||
o as Context,
|
o as Context,
|
||||||
s as Empty,
|
s as Empty,
|
||||||
|
2
dist/data-converter.js
vendored
2
dist/data-converter.js
vendored
@ -1,6 +1,6 @@
|
|||||||
import "lodash";
|
import "lodash";
|
||||||
import "react";
|
import "react";
|
||||||
import { D as p } from "./common/main-DdIS_WOJ.js";
|
import { D as p } from "./common/main-UvNID6kN.js";
|
||||||
export {
|
export {
|
||||||
p as default
|
p as default
|
||||||
};
|
};
|
||||||
|
2
dist/data-list.js
vendored
2
dist/data-list.js
vendored
@ -1,4 +1,4 @@
|
|||||||
import { A as t, y as e, q as r, w as o, B as i, x as u, v as D, z as l, s as L, C as n, p, E as m, M as C, I as c, K as F, J as b, L as d, F as k } from "./common/main-DdIS_WOJ.js";
|
import { A as t, y as e, q as r, w as o, B as i, x as u, v as D, z as l, s as L, C as n, p, E as m, M as C, I as c, K as F, J as b, L as d, F as k } from "./common/main-UvNID6kN.js";
|
||||||
export {
|
export {
|
||||||
t as DataListContent,
|
t as DataListContent,
|
||||||
e as DataListContext,
|
e as DataListContext,
|
||||||
|
2
dist/data-list/utils.js
vendored
2
dist/data-list/utils.js
vendored
@ -1,5 +1,5 @@
|
|||||||
import "lodash";
|
import "lodash";
|
||||||
import { k as a } from "../common/main-DdIS_WOJ.js";
|
import { k as a } from "../common/main-UvNID6kN.js";
|
||||||
export {
|
export {
|
||||||
a as getDefaultExpandRowKeys
|
a as getDefaultExpandRowKeys
|
||||||
};
|
};
|
||||||
|
15
dist/grid-layout-form.js
vendored
15
dist/grid-layout-form.js
vendored
@ -1,14 +1,15 @@
|
|||||||
import { _ as s, a0 as r, $ as u, Z as o, a5 as t, a3 as m, a4 as d, a7 as F, a2 as i, a1 as g, a6 as l } from "./common/main-DdIS_WOJ.js";
|
import { _ as e, a0 as r, $ as u, Z as o, a6 as t, a5 as m, a3 as F, a4 as d, a8 as i, a2 as g, a1 as l, a7 as n } from "./common/main-UvNID6kN.js";
|
||||||
export {
|
export {
|
||||||
s as GridLayoutForm,
|
e as GridLayoutForm,
|
||||||
r as GridLayoutFormHelper,
|
r as GridLayoutFormHelper,
|
||||||
u as GridLayoutFormWidget,
|
u as GridLayoutFormWidget,
|
||||||
o as default,
|
o as default,
|
||||||
t as useFnRun,
|
t as useFnRun,
|
||||||
m as useFormData,
|
m as useFormAction,
|
||||||
|
F as useFormData,
|
||||||
d as useFormSubmit,
|
d as useFormSubmit,
|
||||||
F as useMergedFormValuesChange,
|
i as useMergedFormValuesChange,
|
||||||
i as useRules,
|
g as useRules,
|
||||||
g as useStructure,
|
l as useStructure,
|
||||||
l as useWidgetDecorator
|
n as useWidgetDecorator
|
||||||
};
|
};
|
||||||
|
2
dist/grid-layout-form/utils.js
vendored
2
dist/grid-layout-form/utils.js
vendored
@ -1,5 +1,5 @@
|
|||||||
import "lodash";
|
import "lodash";
|
||||||
import { g as o, a as g } from "../common/main-DdIS_WOJ.js";
|
import { g as o, a as g } from "../common/main-UvNID6kN.js";
|
||||||
export {
|
export {
|
||||||
o as getOptionItemByValue,
|
o as getOptionItemByValue,
|
||||||
g as getWidgetByNormalize
|
g as getWidgetByNormalize
|
||||||
|
2
dist/grid-layout.js
vendored
2
dist/grid-layout.js
vendored
@ -1,4 +1,4 @@
|
|||||||
import { l as d, m as e, H as i, G as o, n as t, o as u } from "./common/main-DdIS_WOJ.js";
|
import { l as d, m as e, H as i, G as o, n as t, o as u } from "./common/main-UvNID6kN.js";
|
||||||
export {
|
export {
|
||||||
d as GridLayout,
|
d as GridLayout,
|
||||||
e as GridLayoutWidget,
|
e as GridLayoutWidget,
|
||||||
|
2
dist/grid-layout/utils.js
vendored
2
dist/grid-layout/utils.js
vendored
@ -1,4 +1,4 @@
|
|||||||
import { i as o, j as a } from "../common/main-DdIS_WOJ.js";
|
import { i as o, j as a } from "../common/main-UvNID6kN.js";
|
||||||
export {
|
export {
|
||||||
o as getBoxStyle,
|
o as getBoxStyle,
|
||||||
a as getWidgetByNormalize
|
a as getWidgetByNormalize
|
||||||
|
2
dist/hooks.js
vendored
2
dist/hooks.js
vendored
@ -1,7 +1,7 @@
|
|||||||
import "lodash";
|
import "lodash";
|
||||||
import "rc-field-form";
|
import "rc-field-form";
|
||||||
import "react";
|
import "react";
|
||||||
import { W as r, V as o, X as p, T as f, U as i, Y as m, S as c } from "./common/main-DdIS_WOJ.js";
|
import { W as r, V as o, X as p, T as f, U as i, Y as m, S as c } from "./common/main-UvNID6kN.js";
|
||||||
import { default as S } from "rc-util/lib/hooks/useMergedState";
|
import { default as S } from "rc-util/lib/hooks/useMergedState";
|
||||||
export {
|
export {
|
||||||
r as useDeepEffect,
|
r as useDeepEffect,
|
||||||
|
2
dist/iconfont.js
vendored
2
dist/iconfont.js
vendored
@ -2,7 +2,7 @@ import "react/jsx-runtime";
|
|||||||
import "react";
|
import "react";
|
||||||
import "prop-types";
|
import "prop-types";
|
||||||
import "classnames";
|
import "classnames";
|
||||||
import { a8 as a } from "./common/main-DdIS_WOJ.js";
|
import { a9 as a } from "./common/main-UvNID6kN.js";
|
||||||
export {
|
export {
|
||||||
a as default
|
a as default
|
||||||
};
|
};
|
||||||
|
6
dist/index.js
vendored
6
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-DdIS_WOJ.js";
|
import { at as t, au as e, ap as o, aq as n, al as p, ar as r, ao as c, an as l, am as u, as as f } from "./common/main-UvNID6kN.js";
|
||||||
export {
|
export {
|
||||||
t as AppContext,
|
t as AppContext,
|
||||||
e as AppGlobalParamsContext,
|
e as AppGlobalParamsContext,
|
||||||
@ -8,6 +8,6 @@ export {
|
|||||||
r as func,
|
r as func,
|
||||||
c as http,
|
c as http,
|
||||||
l as insertStyle,
|
l as insertStyle,
|
||||||
f as isReactComponent,
|
u as isReactComponent,
|
||||||
m as route
|
f as route
|
||||||
};
|
};
|
||||||
|
2
dist/pages.js
vendored
2
dist/pages.js
vendored
@ -1,4 +1,4 @@
|
|||||||
import { O as t, N as e, P as o, Q as P } from "./common/main-DdIS_WOJ.js";
|
import { O as t, N as e, P as o, Q as P } from "./common/main-UvNID6kN.js";
|
||||||
export {
|
export {
|
||||||
t as CustomPage,
|
t as CustomPage,
|
||||||
e as DataListPage,
|
e as DataListPage,
|
||||||
|
2
dist/res-ws.js
vendored
2
dist/res-ws.js
vendored
@ -1,5 +1,5 @@
|
|||||||
import "lodash";
|
import "lodash";
|
||||||
import { R as a } from "./common/main-DdIS_WOJ.js";
|
import { R as a } from "./common/main-UvNID6kN.js";
|
||||||
export {
|
export {
|
||||||
a as default
|
a as default
|
||||||
};
|
};
|
||||||
|
2
dist/utils.js
vendored
2
dist/utils.js
vendored
@ -1,5 +1,5 @@
|
|||||||
import "lodash";
|
import "lodash";
|
||||||
import { d as r, e as g, c as o, f as i, b as m, h as p, r as P, t as d, u as h } from "./common/main-DdIS_WOJ.js";
|
import { d as r, e as g, c as o, f as i, b as m, h as p, r as P, t as d, u as h } from "./common/main-UvNID6kN.js";
|
||||||
import "./common/vender-CtjyT19B.js";
|
import "./common/vender-CtjyT19B.js";
|
||||||
export {
|
export {
|
||||||
r as deepSome,
|
r as deepSome,
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "ff",
|
"name": "ff",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "0.5.15",
|
"version": "0.5.16",
|
||||||
"author": "www.fsdpf.com",
|
"author": "www.fsdpf.com",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"main": "./dist/index.js",
|
"main": "./dist/index.js",
|
||||||
|
Loading…
Reference in New Issue
Block a user