1009 lines
76 KiB
JavaScript
1009 lines
76 KiB
JavaScript
var kn = Object.defineProperty;
|
|
var Et = (e) => {
|
|
throw TypeError(e);
|
|
};
|
|
var xn = (e, t, n) => t in e ? kn(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
var v = (e, t, n) => xn(e, typeof t != "symbol" ? t + "" : t, n), Rt = (e, t, n) => t.has(e) || Et("Cannot " + n);
|
|
var m = (e, t, n) => (Rt(e, t, "read from private field"), n ? n.call(e) : t.get(e)), E = (e, t, n) => t.has(e) ? Et("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, n), U = (e, t, n, a) => (Rt(e, t, "write to private field"), a ? a.call(e, n) : t.set(e, n), n);
|
|
var Ft = (e, t, n, a) => ({
|
|
set _(r) {
|
|
U(e, t, r, n);
|
|
},
|
|
get _() {
|
|
return m(e, t, a);
|
|
}
|
|
});
|
|
import { jsx as d, jsxs as O } from "react/jsx-runtime";
|
|
import k, { useEffect as R, useState as T, useCallback as G, useMemo as Y, useRef as q, useContext as de, useId as Ge, useLayoutEffect as vn } from "react";
|
|
import g from "lodash";
|
|
import qt from "immutability-helper";
|
|
import { Form as Ke, Input as Sn, Button as lt, Pagination as $n, Tree as Pn, Breadcrumb as Nn, Table as Tn, Empty as En, Popconfirm as Rn, Tooltip as Fn, Popover as On } from "antd";
|
|
import { useMergedState as Ln } from "rc-util";
|
|
import A from "classnames";
|
|
import Z, { FieldContext as Vn, Field as Ht } from "rc-field-form";
|
|
import { useParams as An, generatePath as jn, createBrowserRouter as In, useInRouterContext as Mn, Navigate as zn } from "react-router-dom";
|
|
import b from "prop-types";
|
|
import * as Ot from "react-is";
|
|
import { useNotification as Bn } from "rc-notification";
|
|
import { N as Re, a as Fe, T as ct, S as Wn } from "./vender-DMK1apIA.js";
|
|
import "rc-util/lib/hooks/useMergedState";
|
|
import Un from "rc-drawer";
|
|
import Dn from "rc-dialog";
|
|
var $e, Ve, Pe, oe, ke, xe;
|
|
class Jt {
|
|
constructor(t, n) {
|
|
E(this, $e, /* @__PURE__ */ new Map());
|
|
E(this, Ve, !0);
|
|
E(this, Pe, []);
|
|
E(this, oe);
|
|
E(this, ke, () => m(this, oe));
|
|
E(this, xe, () => Promise.resolve());
|
|
v(this, "get", (...t) => new Promise((n, a) => {
|
|
const r = JSON.stringify(t);
|
|
if (m(this, $e).has(r)) return n(m(this, xe).call(this, m(this, oe), ...t));
|
|
if (m(this, oe) === void 0) m(this, Pe).push([t, n, a]), m(this, Ve) && (U(this, Ve, !1), Promise.resolve(typeof m(this, ke) == "function" ? m(this, ke).call(this) : m(this, ke)).then((s) => U(this, oe, s || null)).finally(() => {
|
|
m(this, Pe).forEach(([s, i, o]) => {
|
|
try {
|
|
const l = m(this, xe).call(this, m(this, oe), ...s);
|
|
m(this, $e).set(JSON.stringify(s), l), i(l);
|
|
} catch (l) {
|
|
o(l);
|
|
}
|
|
}), m(this, Pe).length = 0;
|
|
}));
|
|
else {
|
|
const s = m(this, xe).call(this, m(this, oe), ...t);
|
|
m(this, $e).set(r, s), n(s);
|
|
}
|
|
}));
|
|
U(this, xe, n), U(this, ke, t);
|
|
}
|
|
}
|
|
$e = new WeakMap(), Ve = new WeakMap(), Pe = new WeakMap(), oe = new WeakMap(), ke = new WeakMap(), xe = new WeakMap();
|
|
const er = () => d("div", { children: "Empty" }), Be = k.createContext({ ele: {}, mount: () => {
|
|
}, unmount: () => {
|
|
} }), _ = ({ rootClassName: e, className: t, children: n, actions: a, title: r, subTitle: s, extras: i, style: o = {} }) => {
|
|
const { mount: l, unmount: c } = k.useContext(Be);
|
|
return a && _.Action({ children: a }), r && _.Title({ children: r }), s && _.SubTitle({ children: s }), i && _.Extra({ children: i }), R(() => (l("rootClassName", e), () => c(e)), [e]), d("div", { className: A("ff-container", t), style: o, children: n });
|
|
}, Je = (e) => ({ children: t, className: n }) => {
|
|
const { mount: a, unmount: r } = k.useContext(Be);
|
|
return R(() => (a(e, k.createElement("div", { key: `ff-${e}`, className: A(`ff-popup-${e}`, n) }, t)), () => r(e)), [n, t]), null;
|
|
};
|
|
_.Action = Je("actions"), _.Title = Je("title"), _.SubTitle = Je("sub-title"), _.Extra = Je("extras"), _.propTypes = { className: b.string, style: b.object, title: b.any, subTitle: b.any, actions: b.any, extras: b.any };
|
|
const tr = () => d(_, { className: "ff-loading", children: O("div", { className: "loader", children: [O("div", { className: "square", children: [d("span", {}), d("span", {}), d("span", {})] }), O("div", { className: "square", children: [d("span", {}), d("span", {}), d("span", {})] }), O("div", { className: "square", children: [d("span", {}), d("span", {}), d("span", {})] }), O("div", { className: "square", children: [d("span", {}), d("span", {}), d("span", {})] })] }) }), nr = () => d("div", { children: "NotFound" }), Kt = ({ children: e }) => {
|
|
const [t, n] = T({}), a = G((s, i) => n((o) => ({ ...o, [s]: i })), []), r = G((s) => n((i) => ({ ...i, [s]: void 0 })), []);
|
|
return typeof (e == null ? void 0 : e.type) == "string" ? e : d(Be.Provider, { value: { ele: t, mount: a, unmount: r }, children: k.cloneElement(e, { className: t.rootClassName, title: t.title, subTitle: t["sub-title"], actions: t.actions, extras: t.extras }) });
|
|
};
|
|
Kt.propTypes = { children: b.element.isRequired };
|
|
const Lt = { 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"] }, Ct = ({ type: e, props: t }) => d("i", { ...t, children: d("svg", { viewBox: "0 0 1024 1024", width: "1em", height: "1em", fill: "currentColor", children: (Lt[e] || Lt.info).map((n, a) => d("path", { d: n }, a)) }) }), _t = ({ className: e, content: t, icon: n, $close: a }) => O(k.Fragment, { children: [n && d("div", { className: A("ff-notification-icon", e), children: d(Ct, { type: n }) }), t] }), qn = ({}) => d(_, { children: "Confirm" });
|
|
var ge, Ne;
|
|
const ne = class ne {
|
|
constructor() {
|
|
E(this, Ne, /* @__PURE__ */ new Map());
|
|
v(this, "init", (t) => U(this, Ne, new Map(t)));
|
|
v(this, "check", (t) => !m(this, Ne).has(t) || m(this, Ne).get(t));
|
|
if (m(ne, ge)) return m(ne, ge);
|
|
}
|
|
};
|
|
ge = new WeakMap(), Ne = new WeakMap(), E(ne, ge, null), v(ne, "getInstance", () => (m(ne, ge) || U(ne, ge, new ne()), m(ne, ge)));
|
|
let dt = ne;
|
|
const Hn = dt.getInstance();
|
|
var pe, Ae;
|
|
const ae = class ae {
|
|
constructor() {
|
|
E(this, Ae, null);
|
|
v(this, "init", (t) => U(this, Ae, t));
|
|
v(this, "get", (t, n) => g.get(m(this, Ae), t, n));
|
|
if (m(ae, pe)) return m(ae, pe);
|
|
}
|
|
};
|
|
pe = new WeakMap(), Ae = new WeakMap(), E(ae, pe, null), v(ae, "getInstance", () => (m(ae, pe) || U(ae, pe, new ae()), m(ae, pe)));
|
|
let ut = ae;
|
|
const Oe = ut.getInstance(), Vt = { null2json: (e) => Object.create(), null2array: (e) => [], null2number: (e) => 0, null2bool: (e) => !1, null2string: (e) => "", null2integer: (e) => 0, null2float: (e) => 0, string2json: (e) => e ? JSON.parse(e) : "{}", string2array: (e) => e.substr(0, 1) === "[" && e.substr(-1) === "]" ? JSON.parse(e) : e.split(","), string2number: (e) => e == "" ? 0 : +e, string2integer: (e) => e == "" ? 0 : +e, string2float: (e) => e == "" ? 0 : +e, string2bool: (e) => {
|
|
switch (`${e}`.toLowerCase()) {
|
|
case "0":
|
|
case "false":
|
|
case "[]":
|
|
case "{}":
|
|
return !1;
|
|
}
|
|
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" }, Q = (e, t) => {
|
|
let n = "string";
|
|
n = Array.isArray(e) ? "array" : typeof e, g.isObject(e) && (n = "json");
|
|
const a = `${n}2${t}`;
|
|
return Reflect.has(Vt, a) ? Vt[a](e) : e;
|
|
}, Gt = (e = {}, t = {}, n = {}, a = "") => Yt(e, (r, s) => s === "type" && r === "code") ? Xt(e, t, n, a) : Qt(e, t, a), Yt = (e, t = () => !1) => g.some(e, (n) => !!g.some(n, t) || (g.isEmpty(n) || !g.isPlainObject(n) && !g.isArray(n) ? void 0 : Yt(n, t))), Xt = async (e = {}, t = {}, n = {}, a = "") => {
|
|
let r = /* @__PURE__ */ Object.create(null);
|
|
for (let s in e) {
|
|
let i;
|
|
if (Reflect.has(e[s], "type") && ["code", "field", "router", "query", "string"].includes(e[s].type)) {
|
|
const { type: o, value: l = "", default: c = a } = e[s];
|
|
switch (o) {
|
|
case "code":
|
|
i = await Ce.exec(l, t, n);
|
|
break;
|
|
case "field":
|
|
i = g.get(t, l) ?? g.get(t, l.substring(l.indexOf(".") + 1));
|
|
break;
|
|
case "router":
|
|
case "query":
|
|
i = ce.getPageParams(l);
|
|
break;
|
|
case "string":
|
|
i = l;
|
|
}
|
|
i ?? (i = c);
|
|
} else i = await Xt(e[s], t, n, a);
|
|
g.set(r, s, i);
|
|
}
|
|
return r;
|
|
}, Qt = (e = {}, t = {}, n = "") => Object.keys(e || {}).reduce((a, r) => {
|
|
if (g.isPlainObject(e[r])) {
|
|
let s;
|
|
if (Reflect.has(e[r], "type") && ["field", "router", "query", "string"].includes(e[r].type)) {
|
|
const { type: i, value: o = "", default: l = n } = e[r];
|
|
switch (i) {
|
|
case "field":
|
|
s = g.get(t, o) ?? g.get(t, o.substring(o.indexOf(".") + 1));
|
|
break;
|
|
case "router":
|
|
case "query":
|
|
s = ce.getPageParams(o);
|
|
break;
|
|
case "string":
|
|
s = o;
|
|
}
|
|
s ?? (s = l);
|
|
} else s = Qt(e[r], t, n);
|
|
g.set(a, r, s);
|
|
}
|
|
return a;
|
|
}, {}), st = (e, t) => e && typeof e == "object" ? Array.isArray(e) ? e.map((n) => st(n, t)) : Object.keys(e).reduce((n, a) => (t[a] ? n[t[a]] = st(e[a], t) : n[a] = st(e[a], t), n), {}) : e, ar = () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (e) => {
|
|
const t = 16 * Math.random() | 0;
|
|
return (e === "x" ? t : 3 & t | 8).toString(16);
|
|
}), rr = (e) => {
|
|
var t, n;
|
|
return e ? (n = (t = e.match(/^@pkg(?:[^\/]*\/){3}(?<name>[^\/]+)/)) == null ? void 0 : t.groups) == null ? void 0 : n.name : "";
|
|
}, sr = (e) => {
|
|
var t, n;
|
|
return e ? (n = (t = e.match(/^@pkg(?:[^\/]*\/){2}(?<category>[^\/]+)/)) == null ? void 0 : t.groups) == null ? void 0 : n.category : "";
|
|
}, ir = (e) => {
|
|
var t, n;
|
|
return e ? (n = (t = e.match(/^@pkg(?:[^\/]*\/){1}(?<owner>[^\/]+)/)) == null ? void 0 : t.groups) == null ? void 0 : n.owner : "";
|
|
};
|
|
var Xe, je, Ie, Qe;
|
|
const Ze = class Ze {
|
|
constructor(...t) {
|
|
E(this, je, []);
|
|
E(this, Ie, (t) => {
|
|
var n;
|
|
for (let a of t) Array.isArray(a[0]) ? m(this, Ie).call(this, a) : m(this, je).push(m(n = Ze, Xe).call(n, a[0], a[1]));
|
|
});
|
|
v(this, "toValue", async (t, n = null) => {
|
|
const a = { getValue: () => t, getRecord: () => n };
|
|
return await m(this, je).reduce(async (r, s) => {
|
|
try {
|
|
const i = await r;
|
|
return (await s).call(a, i);
|
|
} catch (i) {
|
|
return console.error(i), r;
|
|
}
|
|
}, t);
|
|
});
|
|
v(this, "toRender", (t, n, a = null) => k.createElement(m(this, Qe), { value: t, record: n }, a));
|
|
E(this, Qe, ({ value: t, record: n, children: a }) => {
|
|
const [r, s] = T(a);
|
|
return vt(() => {
|
|
let i = !1;
|
|
return s(a), this.toValue(t, n).then((o) => Q(o, "string")).then((o) => !i && s(o)).catch((o) => !i && s(`${o}`)), () => i = !0;
|
|
}, [t, n]), r;
|
|
});
|
|
m(this, Ie).call(this, t);
|
|
}
|
|
};
|
|
Xe = new WeakMap(), je = new WeakMap(), Ie = new WeakMap(), Qe = new WeakMap(), E(Ze, Xe, g.memoize((t, n) => ee.getWidgetComponent(t).then((a) => {
|
|
var r;
|
|
return ((r = a.default) == null ? void 0 : r.call(a, n)) || ((s) => s);
|
|
}), (t, n) => `${t}::${Q(n, "string")}`));
|
|
let Ye = Ze;
|
|
const Jn = (e, t = {}) => Y(() => e == null ? void 0 : e.map(({ widgetByJs: n, widgetByJsSetting: a, ...r }, s) => n ? { ...r, render: (i, o) => new Ye([n, a]).toRender(i, o, "-") } : r), [e, t]), or = (e) => {
|
|
const [t, n] = T({});
|
|
return R(() => {
|
|
let a = !1;
|
|
return e && F.get(`/api/_/${e}`).then((r) => g.pick(r, ["uuid", "name", "code", "resource", "marginX", "marginY", "cols", "rowHeight", "primaryKey", "columns", "itemOperations", "batchOperations", "isConditionFormLayout", "layout", "tabs", "pageSize", "layoutConfig"])).then((r) => !a && n(r)), () => a = !0;
|
|
}, [e]), t;
|
|
}, lr = (e, t = {}) => {
|
|
const [n, a] = T({ dataSource: [] });
|
|
return We(() => {
|
|
let r = !1;
|
|
return e && F.get(`/api/${e}/${F.encode({ page: 1, ...t })}`).then((s) => !r && a(s)), () => r = !0;
|
|
}, [e, t]), n;
|
|
}, Zt = (e, t, n = "id", a) => {
|
|
const r = G(a ? (s) => g.get(s, n, g.get(s, [a, n])) : (s) => g.get(s, n), [n, a]);
|
|
return G((s) => e == null ? void 0 : e.filter((i) => !i.uuid || !t.has(i.uuid) || t.get(i.uuid).includes(`${r(s)}`)), [e, t, r]);
|
|
}, gt = (e, t, n = null, a = "id", r) => {
|
|
const s = G(r ? (i) => g.get(i, a, g.get(i, [r, a])) : (i) => g.get(i, a), [a, r]);
|
|
return Y(() => {
|
|
if (g.isEmpty(t) || !t.some(({ uuid: o }) => Hn.check(o))) return !1;
|
|
if (g.isEmpty(n) || g.isEmpty(e)) return !0;
|
|
const i = e.map((o) => `${s(o)}`);
|
|
return t.some(({ uuid: o }) => !o || !n.has(o) || n.get(o).some((l) => i.includes(`${l}`)));
|
|
}, [t, e, n, s]);
|
|
}, Kn = (e, t, n = "id", a = null) => {
|
|
const r = xt(), s = q(!1), i = q(e.dataSource), o = q(e.itemOperationsAccess);
|
|
return R(() => (i.current = e.dataSource, o.current = e.itemOperationsAccess, () => s.current = !1), [e.dataSource, e.itemOperationsAccess]), s.current && (e.dataSource = i.current, e.itemOperationsAccess = o.current), [e, (l = 0, c = null) => {
|
|
var u, p;
|
|
if (s.current = !1, l === 1) return (u = e.onReload) == null ? void 0 : u.call(e);
|
|
if (l === 2) {
|
|
const f = g.get(c, "__PARENT_ID__", ""), y = g.get(c, n, g.get(c, [a, n], "")), h = g.findIndex(i.current, ["__PARENT_ID__", f]), w = g.findIndex(h > -1 ? g.get(i.current, [h, "children"]) : i.current, [n, y]);
|
|
if (w === -1) return (p = e.onReload) == null ? void 0 : p.call(e);
|
|
Promise.all([F.get(`/api/${t}/detail/${y}`), F.post(`/api/${t}/list-operations-access`, { ids: y })]).then(([C, S]) => {
|
|
const j = g.get(i.current, h > -1 ? [h, "children", w, "children"] : [w, "children"]);
|
|
i.current = qt(i.current, h > -1 ? { [h]: { children: { $splice: [[w, 1, { ...C, children: j }]] } } } : { $splice: [[w, 1, { ...C, children: j }]] });
|
|
const P = new Map(S);
|
|
o.current.forEach((M, I) => {
|
|
var z;
|
|
(z = P.get(I)) != null && z.some((L) => L == y) || o.current.set(I, M.filter((L) => L !== y));
|
|
}), P.forEach((M, I) => {
|
|
o.current.has(I) ? o.current.set(I, g.uniq([...o.current.get(I) || [], ...M])) : o.current.set(I, M);
|
|
});
|
|
}).then(() => {
|
|
s.current = !0, r();
|
|
});
|
|
}
|
|
}];
|
|
}, _n = (e, t) => {
|
|
const n = xt(), a = q(t), r = q(/* @__PURE__ */ new Map()), s = q([]), i = g.throttle((l) => {
|
|
s.current = [], F.list(e, g.pick({ ...a.current, ...l }, ["tab", "page", "pageSize", "condition", "sider", "keyword"])).then(({ keyword: c, condition: u, total: p, tab: f, sider: y, page: h, pageSize: w, operationsAccess: C, dataSource: S }) => {
|
|
a.current = { tab: f, condition: u, sider: y, keyword: c, total: p, pageSize: w, page: S != null && S.length ? h : 1 }, s.current = S, r.current = new Map(C), n();
|
|
});
|
|
}, 380, { leading: !1, trailing: !0 });
|
|
vt(() => {
|
|
s.current = [], e && i(t);
|
|
}, [e, t]);
|
|
const o = Y(() => g.pick(a.current, ["total", "tab", "page", "pageSize", "condition", "sider", "keyword"]), [a.current]);
|
|
return Object.assign(o, { onTabChange: (l) => i({ tab: l, page: 1 }), onPageChange: (l, c) => i({ page: l, pageSize: c }), onPageSizeChange: (l) => i({ pageSize: l, page: 1 }), onConditionChange: (l, c) => i({ keyword: c, condition: qt(a.current.condition || {}, { $merge: l || {} }), page: 1 }), onSiderChange: (l) => i({ sider: l, page: 1 }), onKeywordChange: (l) => i({ keyword: l, page: 1 }), itemOperationsAccess: r.current, dataSource: s.current, onReload: i });
|
|
}, Gn = ({ listCode: e, className: t, layouts: n, dataSource: a, isPaginate: r, isItemOperations: s, isBatchOperations: i, batchOperations: o, itemOperations: l, itemOperationsAccess: c, resource: u, primaryKey: p, title: f, itemGridLayout: y, $setting: h, tabs: w, isConditionFormLayout: C, isTreeSider: S, treeSiderConfig: j }) => {
|
|
const { classNames: P, onClickCallback: M } = de(te), I = Zt(l, c, p, u), z = G((L, V, x) => d(Yn, { className: A("ff-data-list-framework-item", P.item), operations: s ? I(V) : [], data: u ? { [u]: V } : V, children: L, onClickCallback: M }), [u, p, s, M, l, c]);
|
|
return O("div", { className: A("ff-data-list-framework", t), children: [d(n.sider, { isTreeSider: S, ...j }), O("div", { className: A("ff-data-list-container", P == null ? void 0 : P.container), children: [d(n.filter, { isConditionFormLayout: C }), d(n.toolbar, { title: f, tabs: w }), d(la, { ...y, style: { "--col-num": (h == null ? void 0 : h.colNum) || 1 }, primaryKey: p, itemRender: z, dataSource: a }), d(n.footer, { isPaginate: r, isOperations: i, operations: o })] })] });
|
|
}, Yn = ({ className: e, operations: t, children: n, data: a, onClickCallback: r }) => O("div", { className: A("data-list-grid-layout-item-container", e), children: [n, !!(t != null && t.length) && d("div", { className: "data-list-grid-layout-item-actions", children: t.map((s) => d("span", { className: "data-list-grid-layout-item-action", children: d(N.Link, { uuid: s.uuid, type: s.type, name: s.name, widget: s.widget, widgetType: s.widgetType, widgetProps: s.widgetProps, widgetSetting: s.widgetSetting, widgetContainerProps: s.widgetContainerSetting, data: a, confirm: s.confirm, onAfterClick: (i) => i !== !1 && (r == null ? void 0 : r(s.isRefresh, a)) }, s.uuid || Ge()) }, (s == null ? void 0 : s.uuid) || Ge())) })] }), Xn = ({ listCode: e, className: t, layouts: n, dataSource: a, columns: r, isItemOperations: s, isBatchOperations: i, batchOperations: o, itemOperations: l, itemOperationsAccess: c, resource: u, primaryKey: p, title: f, tabs: y, isPaginate: h, isTreeSider: w, treeSiderConfig: C, isConditionFormLayout: S, ...j }) => {
|
|
const { classNames: P, onClickCallback: M } = de(te), I = Zt(l, c, p, u), z = gt(a, l, c, p, u);
|
|
return O("div", { className: A("ff-data-table-framework", t), children: [d(n.sider, { isTreeSider: w, ...C }), O("div", { className: A("ff-data-table-container", P == null ? void 0 : P.container), children: [d(n.filter, { isConditionFormLayout: S }), d(n.toolbar, { title: f, tabs: y }), d(aa, { ...j, primaryKey: p, className: "ff-data-table-content", columns: r, dataSource: a, operationRender: z ? (L) => {
|
|
var V;
|
|
return d("div", { className: "ff-data-table-actions", children: (V = I(L)) == null ? void 0 : V.map((x, W) => d(N.Link, { size: "small", uuid: x.uuid, type: x.type, name: x.name, widget: x.widget, widgetType: x.widgetType, widgetProps: x.widgetProps, widgetData: x.widgetData, widgetSetting: x.widgetSetting, widgetContainerProps: x.widgetContainerSetting, data: L, confirm: x.confirm, onAfterClick: ($) => $ !== !1 && (M == null ? void 0 : M(x.isRefresh, L)) }, x.uuid || W)) });
|
|
} : null }), d(n.footer, { isPaginate: h, isOperations: i, operations: o })] })] });
|
|
}, te = k.createContext({ listCode: "", classNames: {}, getBase62params: (e, t) => {
|
|
}, onReload: () => {
|
|
}, onClickCallback: () => {
|
|
}, onConditionChange: () => {
|
|
}, onTabChange: () => {
|
|
}, onSiderChange: () => {
|
|
}, onKeywordChange: () => {
|
|
}, onPageChange: () => {
|
|
}, onPageSizeChange: () => {
|
|
} }), en = (e, t, n, a, r = {}, s = 0) => {
|
|
const i = { "--grid-layout-h": `${a}`, "--grid-layout-w": `${n}`, "--grid-layout-x": `${e}`, "--grid-layout-y": `${t}`, "--grid-layout-row-height-offset": "0px" };
|
|
return r != null && r.autoHeight ? i.height = "fit-content" : i["--grid-layout-row"] = `${a}`, r != null && r.alignItems && (i["--grid-layout-box-align-items"] = r.alignItems), r != null && r.justifyContent && (i["--grid-layout-box-justify-content"] = r.justifyContent), i["--grid-layout-box-margin"] = At(r == null ? void 0 : r.marginTop, r == null ? void 0 : r.marginRight, r == null ? void 0 : r.marginBottom, r == null ? void 0 : r.marginLeft), i["--grid-layout-box-padding"] = At(r == null ? void 0 : r.paddingTop, r == null ? void 0 : r.paddingRight, r == null ? void 0 : r.paddingBottom, r == null ? void 0 : r.paddingLeft), s && (i.height = `${s}px`), i;
|
|
}, At = (e, t, n, a) => `${e || 0}px ${t || 0}px ${n || 0}px ${a || 0}px`, tn = ({ className: e, isConditionFormLayout: t }) => {
|
|
var f, y;
|
|
const [n, a] = T({}), { listCode: r, onKeywordChange: s, onConditionChange: i, getBase62params: o, classNames: l } = k.useContext(te), { keyword: c, condition: u } = (o == null ? void 0 : o()) || {}, [p] = Ke.useForm();
|
|
return R(() => {
|
|
r && t && F.get(`/api/_/${r}/list-condition-form-layout`).then(({ resource: h, marginX: w, marginY: C, rowHeight: S, cols: j, fields: P }) => {
|
|
a({ resource: h, itemMargin: [w, C], rowHeight: S, cols: j, fields: P });
|
|
}).catch(() => a({}));
|
|
}, [r, t]), R(() => {
|
|
p.setFieldsValue({ keyword: c, ...u });
|
|
}, [JSON.stringify([c, u])]), d("div", { className: A("ff-data-list-filter", l.filter, e), children: d(Ke, { form: p, layout: "vertical", autoComplete: "off", onFinish: ((f = n.fields) == null ? void 0 : f.length) > 1 ? (h) => i({ [n.resource]: h[n.resource] }, h.keyword) : () => {
|
|
}, onValuesChange: (h) => {
|
|
g.isEmpty(g.omit(h, ["keyword"])) || p.submit();
|
|
}, children: ((y = n.fields) == null ? void 0 : y.length) > 1 ? d(St, { ...n, children: d(Qn, { onReset: () => {
|
|
const { keyword: h, condition: w } = o("init") || {};
|
|
p.setFieldsValue({ keyword: h, ...w });
|
|
} }) }) : d("div", { className: "ff-data-list-filter-default-form ff-grid-layout-form", children: d("div", { className: "grid-layout-item", style: en(20, 0, 5, 2), children: d(Ke.Item, { name: ["keyword"], children: d(Sn.Search, { allowClear: !0, enterButton: "搜索", placeholder: "多关键字 | 分割", onSearch: (h) => s(h) }) }) }) }) }) });
|
|
}, Qn = ({ cols: e, fields: t, onReset: n }) => {
|
|
const [a, r] = T(!1), s = Y(() => t == null ? void 0 : t.toReversed().some((i) => i.y > 1 || i.x + i.w >= e - 5), [e, t]);
|
|
return O(Ke.Item, { label: " ", style: { "--item-span": 5 }, className: A("ff-data-list-filter-actions", { expanded: a }), children: [d(lt, { onClick: n, children: "重置" }), d(lt, { type: "primary", htmlType: "submit", children: "查询" }), s && d(N.Link, { className: "ff-data-list-filter-expanded-button", widget: () => r((i) => !i), type: "primary", name: a ? "关闭" : "展开", icon: a ? "icon-up" : "icon-down", iconPosition: "end" })] });
|
|
};
|
|
tn.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 Zn = ({ className: e, operations: t, isOperations: n, isPaginate: a }) => {
|
|
const { onPageChange: r, onPageSizeChange: s, onClickCallback: i, getBase62params: o } = k.useContext(te), { total: l, page: c, pageSize: u } = (o == null ? void 0 : o()) || {};
|
|
return n && !g.isEmpty(t) || a ? O("div", { className: A("ff-data-list-footer", e), children: [d("div", { className: "ff-data-list-actions", children: t == null ? void 0 : t.map((p, f) => d(N, { 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: (y) => y !== !1 && (i == null ? void 0 : i(p.isRefresh, null)) }, p.uuid || f)) }), a && d($n, { size: "small", total: l, pageSize: u, showSizeChanger: !1, showTotal: (p) => `第 ${c} 页 / 总共 ${p} 条`, onChange: r, onShowSizeChange: s })] }) : null;
|
|
}, ea = [{ 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: d("span", { style: { color: "#1677ff" }, children: "sss" }), key: "0-0-1-0" }] }] }], ta = ({ className: e, width: t = 280, isTreeSider: n }) => {
|
|
const { classNames: a } = de(te);
|
|
return n ? d(Pn.DirectoryTree, { className: A("ff-data-list-sider", a.sider, e), style: { "--sider-width": t }, showLine: !0, showIcon: !1, treeData: ea }) : null;
|
|
}, na = ({ className: e, title: t, tabs: n }) => {
|
|
const { getBase62params: a, onTabChange: r, onReload: s, classNames: i } = de(te), { tab: o } = (a == null ? void 0 : a()) || {}, [l, c] = Ln((n == null ? void 0 : n[0].value) ?? (n == null ? void 0 : n[0].code), { value: o, onChange: r });
|
|
return O("div", { className: A("ff-data-list-toolbar", i.toolbar, e), children: [d("div", { className: "ff-data-list-title", children: t }), d(Nn, { className: "ff-data-list-tabs", itemRender: ({ label: u, code: p, value: f }) => d("span", { onClick: () => c(f ?? p), className: A("ff-data-list-tab", { active: (f ?? p) == l }), children: u }), items: n }), O("div", { className: "ff-data-list-actions", children: [d(N.Link, { icon: "icon-reload", widget: () => s() }), d(N.Link, { icon: "icon-setting" })] })] });
|
|
}, nn = ({ isItemGridLayout: e, theme: t, themeProps: n, onClickCallback: a, onReload: r, listCode: s, total: i = 0, page: o = 0, onPageChange: l, pageSize: c = 30, onPageSizeChange: u, tab: p, onTabChange: f, keyword: y, onKeywordChange: h, condition: w, onConditionChange: C, sider: S, onSiderChange: j, layouts: P, classNames: M = {}, ...I }) => {
|
|
const [z, L] = T(), V = Y(() => {
|
|
let x = { sider: ta, filter: tn, footer: Zn, toolbar: na };
|
|
P === !1 ? x = { sider: null, filter: null, footer: null, toolbar: null } : g.isPlainObject(P) && (x = Object.assign({}, x, P));
|
|
for (const W in x) x[W] || (x[W] = () => d(k.Fragment, {}));
|
|
return x;
|
|
}, [P]);
|
|
return R(() => {
|
|
t ? ee.getWidgetComponent(t).then((x) => {
|
|
if (!x) throw `${t} not found`;
|
|
return x;
|
|
}).catch((x) => ({ default: () => `${x}` })).then((x) => L(k.createElement(x.default, { ...I, layouts: V, $setting: n }))) : L(d(e ? Gn : Xn, { ...I, layouts: V, $setting: n }));
|
|
}, [t, n]), d(te.Provider, { value: { classNames: M, listCode: s, onClickCallback: a, onReload: r, getBase62params: (x, W) => {
|
|
const $ = { tab: p, page: o, pageSize: c, keyword: y, sider: S, condition: w, total: i };
|
|
return x && x != "init" ? $[x] ?? W : $;
|
|
}, onPageChange: l, onPageSizeChange: u, onTabChange: f, onSiderChange: j, onKeywordChange: h, onConditionChange: C }, children: z && k.cloneElement(z, I) });
|
|
};
|
|
nn.propTypes = { classNames: b.exact({ sider: b.string, filter: b.string, footer: b.string, toolbar: b.string, container: b.string, content: b.string, item: b.string }), layouts: b.oneOfType([b.exact({ sider: b.elementType, filter: b.elementType, footer: b.elementType, toolbar: b.elementType }), b.bool]) };
|
|
var me, le, ve, et;
|
|
const re = class re {
|
|
constructor() {
|
|
E(this, le, null);
|
|
E(this, ve, /* @__PURE__ */ new Map());
|
|
E(this, et, () => {
|
|
if (m(this, le)) return m(this, le).port.postMessage({ command: "status", data: [] });
|
|
U(this, le, new SharedWorker(new URL("/ff-worker/res-ws.js", self.location))), m(this, le).port.onmessage = (t) => {
|
|
var n, a;
|
|
(n = t.data) != null && n.uuid ? m(this, ve).forEach((r, s) => {
|
|
var i;
|
|
(r == "*" || (i = r == null ? void 0 : r.includes) != null && i.call(r, t.data.uuid)) && s(t.data);
|
|
}) : ((a = t.data) == null ? void 0 : a.readyState) == WebSocket.CLOSED && F.get("/api/user-api-token").then(({ token: r, expire_at: s }) => {
|
|
m(this, le).port.postMessage({ command: "initWs", data: [`ws${g.trimStart(F.appUrl, "http")}api/user-resource-status-ws?token=${r}`] });
|
|
});
|
|
}, m(this, le).port.postMessage({ command: "status", data: [] });
|
|
});
|
|
v(this, "subscribe", (t, n = []) => (n ? Array.isArray(n) && n.length == 0 ? n = "*" : Array.isArray(n) || (n = [n].flat()) : n = "*", m(this, ve).set(t, n), m(this, ve).size == 1 && m(this, et).call(this), () => this.unsubscribe(t)));
|
|
v(this, "unsubscribe", (t) => m(this, ve).delete(t));
|
|
if (m(re, me)) return m(re, me);
|
|
}
|
|
};
|
|
me = new WeakMap(), le = new WeakMap(), ve = new WeakMap(), et = new WeakMap(), E(re, me, null), v(re, "getInstance", () => (m(re, me) || U(re, me, new re()), m(re, me)));
|
|
let pt = re;
|
|
const an = pt.getInstance(), kt = k.forwardRef(({ listCode: e, base62params: t, className: n, theme: a, themeProps: r, layouts: s, classNames: i }, o) => {
|
|
const [{ resource: l, primaryKey: c, batchOperations: u = [], itemOperations: p = [], columns: f = [], themeConfig: y, theme: h, isConditionFormLayout: w = !1, isTreeSider: C, treeSiderConfig: S, isItemGridLayout: j, itemGridLayout: P, title: M, isPaginate: I, tabs: z }, L] = T({ isItemGridLayout: !1, itemGridLayout: {} }), V = _n(e, t), [{ dataSource: x, itemOperationsAccess: W, condition: $, tab: H, keyword: ue, page: D, total: nt, pageSize: De, sider: at, onConditionChange: Nt, onTabChange: pn, onKeywordChange: mn, onPageChange: hn, onPageSizeChange: fn, onSiderChange: yn, onReload: rt }, Tt] = Kn(V, e, c, l), wn = gt(p, x, W, c), bn = gt(u);
|
|
return R(() => {
|
|
let qe = null;
|
|
return e && F.get(`/api/_/${e}`).resp(({ data: He, res: Cn }) => {
|
|
He != null && He.isDynamicRefresh && (qe = an.subscribe(() => rt(), Cn)), L(He);
|
|
}).catch(() => L({})), () => qe == null ? void 0 : qe();
|
|
}, [e]), k.useImperativeHandle(o, () => ({ onReload: rt, onClickCallback: Tt })), d(nn, { listCode: e, title: M, classNames: i, layouts: s, resource: l, primaryKey: c, theme: a || h, themeProps: r || y, isTreeSider: C, treeSiderConfig: S, isPaginate: I, tabs: z, isItemOperations: wn, isBatchOperations: bn, batchOperations: u, itemOperations: p, isItemGridLayout: j, columns: f, itemGridLayout: P, isConditionFormLayout: w, itemOperationsAccess: W, dataSource: x, onConditionChange: Nt, onTabChange: pn, onKeywordChange: mn, onPageChange: hn, onPageSizeChange: fn, onSiderChange: yn, condition: $, tab: H, keyword: ue, page: D, total: nt, pageSize: De, sider: at, className: A("ff-data-list-helper", n), onReload: rt, onClickCallback: Tt });
|
|
}), rn = (e, t, n = !0) => n !== !0 && n-- <= 0 ? [] : g.isArray(e) && !g.isEmpty(e) ? e.reduce((a, r) => (Reflect.has(r, t) && Reflect.has(r, "children") && a.push(r[t]), Reflect.has(r, "children") && !g.isEmpty(r.children) ? a.concat(rn(r.children, t, n)) : a), []) : [], aa = ({ className: e, primaryKey: t, columns: n = [], dataSource: a = [], operationRender: r, operationWidth: s = 180, ...i }) => {
|
|
const { classNames: o } = de(te);
|
|
Ge();
|
|
const l = q(null), c = q(null), [u, p] = T([]), [f, y] = T({ width: 0, height: 0 });
|
|
R(() => {
|
|
p(rn(a, t));
|
|
}, [a, t]), vn(() => {
|
|
const w = new ResizeObserver(() => {
|
|
var C;
|
|
y({ width: ((C = l.current) == null ? void 0 : C.nativeElement.querySelector(".ant-table-body").scrollWidth) || c.current.offsetWidth, height: c.current.offsetHeight });
|
|
});
|
|
return c.current && w.observe(c.current), () => {
|
|
c.current && w.unobserve(c.current);
|
|
};
|
|
}, []);
|
|
const h = Jn(n);
|
|
return d("div", { ref: c, className: A("ff-data-list-table", o.content, e), children: f.height ? d(Tn, { ...i, ref: l, rowKey: (w) => (w == null ? void 0 : w[t]) ?? Math.random(), columns: h == null ? void 0 : h.concat(r ? [{ title: "操作", align: "center", fixed: "right", width: `${Math.ceil(s / f.width * 100).toFixed(2)}%`, render: (w, C, S) => r(C, S) }] : []), dataSource: a, size: "middle", scroll: { x: "max-content", y: f.height - 50 }, pagination: !1, expandable: { defaultExpandAllRows: !0, expandRowByClick: !0, onExpandedRowsChange: p, expandedRowKeys: u } }) : null });
|
|
}, ra = "RC_FORM_INTERNAL_HOOKS", sn = (e, { initialValue: t, initialValueLanguage: n, convertJs: a, convertJsSetting: r, type: s = "string" }, i = null) => {
|
|
const o = q(!1), l = de(Vn), [c, u] = T(), [p, f] = T(n != "javascript" && e ? l.getFieldValue(e) : void 0), { registerWatch: y } = l.getInternalHooks(ra) || {};
|
|
return R(() => y == null ? void 0 : y((h, w, C) => {
|
|
if (!o.current) return;
|
|
const S = g.get(w, e);
|
|
g.isEqual(S, p) || f(Q(S, s));
|
|
}), [p]), R(() => {
|
|
n == "javascript" && t ? Ce.exec(t, {}, { getFieldValueForBasicForm: (h) => i ? i.getFieldValue(h) : l.getFieldValue(h), getFieldValue: (h) => l.getFieldValue(h) }).then((h) => f(Q(h, s))).catch((h) => notification.error({ message: `布局数据错误: ${JSON.stringify(h)}` })).finally(() => o.current = !0) : (t && f(Q(t ?? l.getFieldValue(e), s)), o.current = !0);
|
|
}, [t, n]), We(() => {
|
|
o.current && a && new Ye([a, r]).toValue(p, l.getFieldsValue(!0)).then(u).catch((h) => {
|
|
u(h), console.error("布局数据转换错误: ", h, a);
|
|
});
|
|
}, [p, a, r]), [c ?? p, p];
|
|
}, on = (e, t, n = "@pkg/ff/grid-layouts", a = null) => Y(() => {
|
|
var r;
|
|
return (r = g.sortBy(e, ["y", "x"])) == null ? void 0 : r.map(({ i: s, x: i, y: o, w: l, h: c, field: { boxStyle: u, widgetPrefix: p = n, widget: f, ...y } }, h) => d("div", { className: "grid-layout-item", style: en(i, o, l, c, u, f === "Height" && (y == null ? void 0 : y.initialValue)), children: d(sa, { ...y, basicForm: a, itemWidget: f != null && f.startsWith("@") || f != null && f.startsWith("blob:") ? f : `${p}/${f}`, itemWidgetRender: t }) }, s || h));
|
|
}, [e]), sa = ({ itemWidget: e, itemWidgetRender: t, basicForm: n, ...a }) => {
|
|
const [r, s] = T();
|
|
return R(() => {
|
|
ee.getWidgetComponent(e).then(({ defaultProps: i = {}, default: o }) => {
|
|
s(k.createElement(t(o, i, n), a));
|
|
}).catch((i) => {
|
|
console.error(i), s(e);
|
|
});
|
|
}, [e]), r;
|
|
}, ln = ({ cols: e = 12, rowHeight: t = 21, fields: n = [], data: a, containerPadding: r = [0, 0], itemMargin: s = [4, 0], formProps: i = {}, className: o, ...l }) => {
|
|
const [c] = Z.useForm(), u = on(n, ia, "@pkg/ff/grid-layouts"), p = Y(() => [{ name: "__PROPS__", value: i }], [i]);
|
|
return We(() => (c.setFieldsValue(a), () => c.resetFields()), [a]), d(Z, { fields: p, form: c, component: !1, children: d("div", { ...l, className: A("ff-grid-layout", o), style: { "--grid-layout-item-margin-y": `${(s == null ? void 0 : s[0]) || 0}px`, "--grid-layout-item-margin-x": `${(s == null ? void 0 : s[1]) || 0}px`, "--grid-layout-container-padding-y": `${(r == null ? void 0 : r[0]) || 0}px`, "--grid-layout-container-padding-x": `${(r == null ? void 0 : r[1]) || 0}px`, "--grid-layout-cols": e, "--grid-layout-row-height": `${t}px` }, children: u }) });
|
|
}, ia = (e, t = {}, n = null) => (a) => {
|
|
const { code: r, label: s, extras: i, isVirtual: o, initialValue: l, initialValueLanguage: c, convertJs: u, convertJsSetting: p, ...f } = g.merge({}, t, a), [y, h] = sn(o ? null : r, { initialValue: l, initialValueLanguage: c, convertJs: u, convertJsSetting: p, type: (f == null ? void 0 : f.type) || "string" }, n);
|
|
return d(e, { ...f, value: y, rawValue: h, $setting: i || {} });
|
|
}, cr = (jt = ln, function({ code: e, data: t, ...n }) {
|
|
const [a, r] = T({ resource: null, cols: 12, rowHeight: 21, fields: [] });
|
|
return R(() => {
|
|
e && F.get(`/api/_/${e}`).then((s) => r(g.pick(s, ["resource", "cols", "rowHeight", "fields"])));
|
|
}, [e]), (a == null ? void 0 : a.resource) && d(jt, { ...n, rowHeight: a.rowHeight, cols: a.cols, fields: a.fields, data: a != null && a.resource ? { [a == null ? void 0 : a.resource]: t } : {} });
|
|
});
|
|
var jt;
|
|
const dr = ({ widget: e, widgetPrefix: t = "@pkg/ff/grid-layouts", basicForm: n, ...a }) => {
|
|
const r = e != null && e.startsWith("@") || e != null && e.startsWith("blob:") ? e : `${t}/${e}`, [s, i] = T();
|
|
return R(() => {
|
|
r && ee.getWidgetComponent(r).then(({ defaultProps: o = {}, default: l }) => ({ default: oa(l, o, n) })).catch((o) => ({ default: () => `${o}` })).then((o) => i(k.createElement(o.default, a)));
|
|
}, [r]), s;
|
|
}, oa = (e, t = {}, n = null) => (a) => {
|
|
const { code: r, label: s, extras: i, isVirtual: o, initialValue: l, initialValueLanguage: c, convertJs: u, convertJsSetting: p, value: f, ...y } = g.merge({}, t, a), [h, w] = sn(o ? null : r, { initialValue: l, initialValueLanguage: c, convertJs: u, convertJsSetting: p, type: (y == null ? void 0 : y.type) || "string" }, n);
|
|
return d(e, { ...y, value: h, rawValue: w, $setting: i || {} });
|
|
}, la = ({ cols: e, rowHeight: t, itemMargin: n, fields: a, primaryKey: r, dataSource: s, itemClassName: i, itemRender: o = (p, f, y) => p, empty: l = d(En, { description: null }), className: c, style: u = {} }) => {
|
|
const { classNames: p } = de(te), f = Ge(), y = Y(() => d(ln, { cols: e, rowHeight: t, itemMargin: n, fields: a, className: i }), [a, e, t, n]);
|
|
return d("div", { className: A("ff-data-list-content", p.content, c), style: u, children: g.isEmpty(s) ? l : s.map((h, w) => {
|
|
const C = o(k.cloneElement(y, { data: h }), h, w);
|
|
return k.cloneElement(C, { key: `${f}-${(h == null ? void 0 : h[r]) || w}` });
|
|
}) });
|
|
}, ca = ({ component: e }) => {
|
|
const { base62params: t } = An();
|
|
return d(_, { children: d(kt, { listCode: e, base62params: F.decode(t) }) });
|
|
}, da = () => "Empty", ua = ({ component: e, $setting: t }) => {
|
|
const [n, a] = T();
|
|
R(() => {
|
|
if (!e) return a(d(da, { description: null }));
|
|
ee.getWidgetComponent(e).catch((s) => ({ default: () => `${s}` })).then((s) => k.createElement(s.default, { $setting: t })).then(a);
|
|
}, [e]);
|
|
const r = ce.getPageParams() || {};
|
|
return n ? k.cloneElement(n, r) : null;
|
|
};
|
|
var he, X, fe, ye, Me, ze;
|
|
const se = class se {
|
|
constructor() {
|
|
E(this, X, /* @__PURE__ */ new Map());
|
|
E(this, fe, {});
|
|
E(this, ye, null);
|
|
v(this, "init", (t, n) => {
|
|
U(this, X, t), U(this, fe, n);
|
|
});
|
|
v(this, "get", (t) => (m(this, X).has(t) || (t = Array.from(m(this, X).keys()).find((n) => m(this, X).get(n).uri === t)), m(this, X).get(t) || {}));
|
|
v(this, "redirect", (t, n, a = {}) => {
|
|
const { uri: r, type: s, widgetProps: i } = this.get(t) || {};
|
|
let o = jn(r || t, s != "list" ? n : g.mapValues(n, (c) => F.encode(c)));
|
|
const l = new URLSearchParams();
|
|
for (const c in i || {}) (i == null ? void 0 : i.type) == "query" && l.append(c, n[c]);
|
|
return l.size > 0 && (o = `${o}?${l.toString()}`), m(this, ye).navigate(o, a);
|
|
});
|
|
v(this, "getMenus", (t) => {
|
|
var n;
|
|
return ((n = m(this, fe)) == null ? void 0 : n[t]) || [];
|
|
});
|
|
v(this, "findMenuPathByUuid", (t) => {
|
|
let n = [];
|
|
for (const a in m(this, fe)) if (n = m(this, Me).call(this, m(this, fe)[a], t, [a]), n.length > 1) return n;
|
|
return n;
|
|
});
|
|
v(this, "getMenusByRouteUuid", (t) => m(this, ze).call(this, t, Object.values(m(this, fe)).flat()));
|
|
E(this, Me, (t, n, a = []) => {
|
|
if (g.isEmpty(t)) return a;
|
|
for (const { uuid: r, children: s } of t) {
|
|
if (r == n) return a.concat(r);
|
|
if (!g.isEmpty(s)) return a.concat(r, m(this, Me).call(this, s, n));
|
|
}
|
|
return a;
|
|
});
|
|
E(this, ze, (t, n) => {
|
|
var r;
|
|
let a = [];
|
|
for (const s of n) s.widgetType == "redirect" && (s.uuid == t || s.widget == t ? a.push(s) : (r = s.children) != null && r.length && (a = a.concat(m(this, ze).call(this, t, s.children))));
|
|
return a;
|
|
});
|
|
v(this, "getCurrentMenu", () => {
|
|
const { uuid: t } = this.getCurrentRoute() || {};
|
|
if (!t) return;
|
|
const n = this.getMenusByRouteUuid(t);
|
|
return g.isEmpty(n) ? void 0 : n[0];
|
|
});
|
|
v(this, "getCurrentRoute", (t = 0) => {
|
|
var a;
|
|
const n = (a = m(this, ye).state.matches[m(this, ye).state.matches.length - 1 - t]) == null ? void 0 : a.route;
|
|
if (!n) return null;
|
|
for (let [r, s] of m(this, X)) if (s.uri === n.path) return s;
|
|
return null;
|
|
});
|
|
v(this, "getPageParams", (t) => {
|
|
var s, i;
|
|
const { location: n = {}, matches: a = [] } = ((s = m(this, ye)) == null ? void 0 : s.state) || {}, r = ((i = a[a.length - 1]) == null ? void 0 : i.params) || {};
|
|
return n.search && new URLSearchParams(n.search).forEach((o, l) => {
|
|
r[l] = o;
|
|
}), t ? g.get(r, t) : r;
|
|
});
|
|
v(this, "createBrowserRouter", (t = {}) => {
|
|
if (m(this, X).size == 0) return null;
|
|
const n = Oe.get("Common.WEBSITE_DEFAULT_THEME", "@pkg/ff/frameworks/DefaultTheme"), a = Oe.get(ee.checkUserToken() ? "Common.WEBSITE_LOGIN_REDIRECT" : "Common.WEBSITE_DEFAULT", "/index"), r = { [n]: 0 }, s = (o, l) => () => ee.getWidgetComponent(o).then((c) => c.default || function() {
|
|
return `${o}`;
|
|
}).then((c) => ({ Component: () => k.createElement(Kt, {}, k.createElement(c, l)) })), i = Array.from(m(this, X).values()).reduce((o, { uuid: l, uri: c, name: u, type: p, component: f, widgetSetting: y, isLogin: h, isLayout: w, extra: C }) => {
|
|
let S = {}, j = 0;
|
|
switch (p) {
|
|
case "list":
|
|
S.element = k.createElement(ca, { component: f });
|
|
break;
|
|
case "fsdpf-component":
|
|
S.element = k.createElement(ua, { key: f, component: f, $setting: y });
|
|
}
|
|
if (C != null && C.layout) {
|
|
if (!r[C == null ? void 0 : C.layout]) return r[C == null ? void 0 : C.layout] = o.length, [...o, { path: "/", lazy: s(C == null ? void 0 : C.layout, {}), children: [{ path: c, ...S }] }];
|
|
j = r[C == null ? void 0 : C.layout];
|
|
}
|
|
return w && j > -1 ? (o[j].children.push({ path: c, ...S }), o) : [...o, { path: c, ...S }];
|
|
}, [{ path: "/", lazy: s(n, {}), children: [] }]);
|
|
return i.push({ index: !0, element: k.createElement(ga, { to: a, replace: !0 }) }), U(this, ye, In(i, t));
|
|
});
|
|
if (m(se, he)) return m(se, he);
|
|
}
|
|
};
|
|
he = new WeakMap(), X = new WeakMap(), fe = new WeakMap(), ye = new WeakMap(), Me = new WeakMap(), ze = new WeakMap(), E(se, he, null), v(se, "getInstance", () => (m(se, he) || U(se, he, new se()), m(se, he)));
|
|
let mt = se;
|
|
const ga = ({ to: e, replace: t }) => Mn() ? k.createElement(zn, { to: e, replace: t }) : (window.document.location = e, "redirect"), ce = mt.getInstance(), Se = new Worker(new URL("/ff-worker/index.js", self.location)), It = { getConfigure: (e) => Oe.get(e), route: { redirect: (...e) => ce.redirect(...e), getPageParams: (...e) => ce.getPageParams(...e), getCurrentRoute: () => ce.getCurrentRoute() }, popup: { notification: (...e) => K.notification(...e), success: (...e) => K.success(...e), error: (...e) => K.error(...e), form: (...e) => K.form(...e), modal: (...e) => K.modal(...e), confirm: (...e) => K.confirm(...e) } };
|
|
var tt, Te, we;
|
|
const B = class B {
|
|
constructor() {
|
|
v(this, "exec", (t, n = {}, a = {}, r = "") => new Promise((s, i) => {
|
|
const o = Ft(B, tt)._++;
|
|
m(B, Te).set(o, a), B.mQueue.set(o, [s, i]), Se.postMessage({ id: o, session: r, category: "eval", method: t, args: n });
|
|
}));
|
|
v(this, "clear", (t) => Se.postMessage({ session: t, category: "clear" }));
|
|
if (m(B, we)) return m(B, we);
|
|
Promise.resolve().then(() => ja).then((t) => {
|
|
It.http = t.http;
|
|
}), Se.addEventListener("message", ({ data: { id: t, task_id: n, method: a, args: r, category: s, data: i, error: o, session: l } }) => {
|
|
if (s === "eval" && B.mQueue.has(t)) o !== null ? B.mQueue.get(t)[1](o) : B.mQueue.get(t)[0](i), m(B, Te).delete(t), B.mQueue.delete(t);
|
|
else if (s === "util") try {
|
|
const c = g.get(It, a.split("/")) || g.get(m(B, Te).get(n), a.split("/"));
|
|
if (!g.isFunction(c)) throw `${a} not found`;
|
|
Promise.resolve(Reflect.apply(c, void 0, r)).then((u) => {
|
|
Se.postMessage({ id: t, task_id: n, category: s, method: a, args: r, session: l, data: u, error: null });
|
|
}).catch((u) => {
|
|
Se.postMessage({ id: t, task_id: n, category: s, method: a, args: r, session: l, data: null, error: u });
|
|
});
|
|
} catch (c) {
|
|
Se.postMessage({ id: t, task_id: n, category: s, method: a, args: r, session: l, data: null, error: c });
|
|
}
|
|
}, !1);
|
|
}
|
|
};
|
|
tt = new WeakMap(), Te = new WeakMap(), we = new WeakMap(), v(B, "mQueue", /* @__PURE__ */ new Map()), E(B, tt, 0), E(B, Te, /* @__PURE__ */ new Map()), E(B, we, null), v(B, "getInstance", () => (m(B, we) || U(B, we, new B()), m(B, we)));
|
|
let ht = B;
|
|
const Ce = ht.getInstance(), xt = () => {
|
|
const e = q(!0), [, t] = k.useReducer((n) => n + 1, 0);
|
|
return R(() => () => e.current = !1, []), () => e.current && t();
|
|
}, ur = (e) => {
|
|
const t = q();
|
|
return R(() => {
|
|
t.current = e;
|
|
}, [e]), t.current;
|
|
}, gr = (e) => {
|
|
const [t, n] = T(e), a = q(null), r = G((s, i) => {
|
|
a.current = i, n(s);
|
|
}, []);
|
|
return R(() => {
|
|
a.current && (a.current(t), a.current = null);
|
|
}, [t]), [t, r];
|
|
}, We = (e = (a) => {
|
|
}, t, n = g.isEqual) => {
|
|
const a = k.useRef();
|
|
n(t, a.current) || (a.current = g.cloneDeep(t)), k.useEffect(e, [a.current]);
|
|
}, vt = We, cn = (e, t = "string") => {
|
|
var n;
|
|
if (!Array.isArray(e)) return e;
|
|
for (let a = 0; a < e.length; a++) e[a].value = Q((n = e[a]) == null ? void 0 : n.value, t), e[a] && Reflect.has(e[a], "children") && (e[a].children = cn(e[a].children, t));
|
|
return e;
|
|
}, pr = (e, t = "json", n = "string", a, r = null) => {
|
|
const [s] = Z.useForm(a), [i, o] = T([{ label: "无", value: "", disabled: !0 }]), l = q([]), c = Z.useWatch((u) => l.current.length === 0 ? null : g.pick(u, l.current), s) || null;
|
|
return R(() => {
|
|
Array.isArray(e) ? o(e) : t === "javascript" && e ? Ce.exec(e, {}, { getFieldValue: (u) => (l.current.includes(u) || l.current.push(u), s.getFieldValue(u)), getFieldValueForBasicForm: (u) => (l.current.includes(u) || l.current.push(u), r ? r.getFieldValue(u) : s.getFieldValue(u)) }).then((u) => {
|
|
o(Q(u, "array"));
|
|
}) : e && o(Q(e, "array"));
|
|
}, [e, t, c]), cn(i, n);
|
|
}, mr = (e) => {
|
|
const [t, n] = T(), a = { type: "GET" };
|
|
if (typeof e == "string" ? a.url = e : g.isPlainObject(e) && Object.assign(a, e), !(a != null && a.url)) throw "url is required";
|
|
const r = (s) => F.request(a, !1).resp((i) => (console.log("useSubscribeRequest", s), n(i), i));
|
|
return We(() => {
|
|
let s = null;
|
|
return r().then((i) => {
|
|
s = an.subscribe(g.throttle(r, 180, { leading: !1, trailing: !0 }), i.res);
|
|
}), () => s == null ? void 0 : s();
|
|
}, a), t;
|
|
}, pa = (e) => {
|
|
const [t, n] = k.useState({ gridItems: [], hideItems: [] });
|
|
return k.useEffect(() => {
|
|
e && F.get(`/api/_/${e}`).then(({ pk: a, uuid: r, code: s, resource: i, align: o, cols: l, rowHeight: c, marginX: u, marginY: p, listenChangeFields: f, listenChangeFieldsFunc: y, fields: h }) => ({ pk: a, uuid: r, code: s, resource: i, align: o, cols: l, rowHeight: c, marginX: u, marginY: p, listenChangeFields: f, listenChangeFieldsFunc: y, ...h.reduce((w, C) => {
|
|
var S;
|
|
return (S = C == null ? void 0 : C.field) != null && S.hidden ? w.hides.push(C == null ? void 0 : C.field) : w.items.push(C), w;
|
|
}, { items: [], hides: [] }) })).then(n);
|
|
}, [e]), t;
|
|
}, ma = ({ max: e = 0, min: t = 0, type: n = "", message: a, pattern: r, required: s = !1, validator: i } = {}, o, l) => {
|
|
const [c, u] = T([]);
|
|
return R(() => {
|
|
const p = [];
|
|
if (s) {
|
|
let f = l;
|
|
switch (l) {
|
|
case "number":
|
|
case "string":
|
|
case "array":
|
|
break;
|
|
case "bool":
|
|
f = "boolean";
|
|
break;
|
|
case "json":
|
|
f = "object";
|
|
}
|
|
p.push({ type: f, required: !0, whitespace: !0, message: "该项必填" });
|
|
}
|
|
switch (n) {
|
|
case "string":
|
|
p.push({ type: n, max: e, min: t, message: a || (t && e ? `字符必须在 ${t} ~ ${e} 之间` : `${e ? "最多能有" : "最少要有"} ${t || e} 个字符`) });
|
|
break;
|
|
case "pattern":
|
|
p.push({ type: "string", pattern: r, message: a });
|
|
break;
|
|
case "validator":
|
|
i && p.push(({ getFieldValue: f }) => ({ validator: async (y, h) => {
|
|
const w = await Ce.exec(i, { value: h, fieldName: o }, { getFieldValue: f });
|
|
return g.isString(w) && w ? Promise.reject(w) : g.isBoolean(w) && !w ? Promise.reject(a) : Promise.resolve();
|
|
} }));
|
|
}
|
|
u(p);
|
|
}, [e, t, n, a, r, s, i]), c;
|
|
}, ha = (e, t, n) => {
|
|
const [a, r] = T(null);
|
|
return R(() => {
|
|
const { initDataUri: s = `/api/${e}`, initDataMethod: i = "GET" } = n || {};
|
|
t && F.request({ method: i, url: g.trimEnd(`${s}/${t}`, "/") }).then((o) => {
|
|
r(o);
|
|
});
|
|
}, [e, t, n]), a;
|
|
}, fa = (e, t, n, a = {}) => {
|
|
const r = xt(), s = q(!0), i = q([]), [o, l] = T(n), c = Z.useWatch((u) => JSON.stringify(g.pick(u, i.current)), t) || "{}";
|
|
return R(() => {
|
|
e && Ce.exec(e, a, { getFieldValue: g.wrap(t.getFieldValue, (u, p) => (i.current.some((f) => g.isEqual(f, p)) || (i.current.push(p), r()), u(p))), isFieldTouched: t.isFieldTouched, isFieldsTouched: t.isFieldsTouched }).then((u) => s.current && l(u));
|
|
}, [e, c, t, a]), R(() => () => s.current = !1, []), o;
|
|
}, hr = ({ value: e, onChange: t }, n = null) => {
|
|
const a = q(), [r] = Z.useForm(n);
|
|
return vt(() => {
|
|
g.isEqual(a.current, e) || r.setFieldsValue(e);
|
|
}, [e]), R(() => () => r.resetFields(), []), [Y(() => r.__INTERNAL__ ? r : { ...r, __INTERNAL__: {} }, [r]), (s, i) => {
|
|
a.current = i, t(i);
|
|
}];
|
|
}, ya = ({ type: e, initialValue: t, initialValueLanguage: n, onChange: a, form: r }) => {
|
|
const s = fa(n == "javascript" && t, r, n == "javascript" ? void 0 : t, {});
|
|
return R(() => {
|
|
n == "javascript" ? a(Q(s, e)) : t && a(Q(t, e));
|
|
}, [e, t, s]), null;
|
|
}, wa = ({ widget: e = "Input", widgetPrefix: t = "@pkg/ff/grid-layout-forms", widgetDecorator: n, subWidgets: a, basicForm: r, ...s }) => {
|
|
const i = e != null && e.startsWith("@") || e != null && e.startsWith("blob:") ? e : `${t}/${e}`, [o, l] = T();
|
|
return R(() => {
|
|
i && ee.getWidgetComponent(i).then(({ defaultProps: c = {}, default: u }) => ({ default: dn(u, c, r) })).catch((c) => ({ default: () => `${c}` })).then((c) => l(k.createElement(c.default, s)));
|
|
}, [i]), o && k.cloneElement(o, s);
|
|
}, dn = (e, t = {}, n = null) => (a) => {
|
|
const { type: r, code: s, label: i, noStyle: o, placeholder: l, extras: c, validators: u, help: p, isVirtual: f, $isReserved: y, initialValue: h, initialValueLanguage: w, convertJs: C, convertJsSetting: S, widgetPerfix: j, boxStyle: P, widgetDecorator: M, subWidgets: I, ...z } = { ...t, ...a }, L = ma(u || {}, s, r), V = { label: i, noStyle: o, colon: !1, layout: "vertical" }, x = { placeholder: l, ...z }, W = G(($) => $ == null ? void 0 : Q($, r), [r]);
|
|
return d(Ht, { name: s, rules: L, initialValue: W(h), normalize: W, children: ($, H, ue) => {
|
|
var D;
|
|
return d(e, { type: r, rcform: ue, itemProps: { validateStatus: H.errors.length > 0 ? "error" : "success", tooltip: p, help: H.errors.length > 0 ? H.errors.join("、") : null, required: ((D = L == null ? void 0 : L[0]) == null ? void 0 : D.required) || !1, ...V }, fieldProps: { ...x, ...$ }, $setting: c || {} });
|
|
} });
|
|
}, St = ({ cols: e = 24, rowHeight: t = 16, itemMargin: n = [8, 16], containerPadding: a = [0, 0], fields: r = [], children: s, basicForm: i = null }) => {
|
|
const o = on(r, dn, "@pkg/ff/grid-layout-forms");
|
|
return O("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": `${(a == null ? void 0 : a[0]) || 0}px`, "--grid-layout-container-padding-x": `${(a == null ? void 0 : a[1]) || 0}px`, "--grid-layout-cols": e, "--grid-layout-row-height": `${t}px` }, children: [o, s && k.cloneElement(s, { cols: e, rowHeight: t, itemMargin: n, containerPadding: a, fields: r })] });
|
|
};
|
|
St.propTypes = { fields: b.array };
|
|
const ba = (Mt = St, ({ code: e, layout: t, name: n, primaryKey: a = 0, style: r = {}, formProps: s = {}, form: i, isPreview: o = !1, className: l, onFinish: c, onValuesChange: u = () => {
|
|
}, ...p }) => {
|
|
const { align: f, autoComplete: y, resource: h, items: w, hides: C, rowHeight: S, marginX: j, marginY: P, cols: M, listenChangeFields: I, listenChangeFieldsFunc: z, pk: L, uuid: V } = pa(e), [x] = Z.useForm(i), W = Y(() => [{ name: "__PK__", value: L }, { name: "__PROPS__", value: s }, { name: "__RESOURCE__", value: h }, { name: "__LAYOUT_KEY__", value: e }, { name: "__LAYOUT_UUID__", value: V }, { name: "__PRIMARY_KEY__", value: a }], [L, e, V, h, a, s]);
|
|
return O(Z, { className: l, name: n || e, layout: t || f, fields: W, form: x, autoComplete: y, style: { ...r, position: "relative" }, onFinish: c, onValuesChange: ($, H) => (({ changedValues: ue, allValues: D, listenChangeFields: nt, listenChangeFieldsFunc: De, onValuesChange: at, code: Nt }) => {
|
|
at(ue, D), De && Array.isArray(nt) && Ce.exec(De, { changedValues: ue, allValues: D }, { getFieldValue: x.getFieldValue, setFieldValue: x.setFieldValue, setFieldsValue: x.setFieldsValue, isFieldTouched: x.isFieldTouched, isFieldsTouched: x.isFieldsTouched });
|
|
})({ changedValues: $, allValues: H, listenChangeFields: I, listenChangeFieldsFunc: z, onValuesChange: u, code: e }), children: [d(Mt, { ...p, form: x, code: e, fields: w, cols: M, rowHeight: S, itemMargin: [j, P] }), C == null ? void 0 : C.map(($) => {
|
|
var H;
|
|
return d(Ht, { name: $.code, children: d(ya, { form: x, name: $.code, type: $.type, initialValue: $.initialValue, initialValueLanguage: (H = $.extras) == null ? void 0 : H.initialValueLanguage }) }, JSON.stringify($.code));
|
|
})] }, e);
|
|
});
|
|
var Mt;
|
|
const un = ({ $setting: e, $close: t, extras: n, code: a, primaryKey: r, ...s }) => {
|
|
const [i] = Z.useForm(), o = ha(a, r, e);
|
|
return R(() => {
|
|
o && i.setFieldsValue(o);
|
|
}, [o]), d(_, { actions: O(k.Fragment, { children: [d(N, { name: "保存", type: "primary", widget: () => {
|
|
const l = i.getFieldValue("__RESOURCE__"), { initDataUri: c = `/api/${a}` } = e || {};
|
|
i.validateFields(!0).then((u) => l ? g.pick(u, [l]) : u).then((u) => F.post(r ? `${c}/${r}` : `${c}`, u).msg(t)).catch(() => K.error("请先完善表单信息", { duration: 2e3 }));
|
|
} }), d(N, { name: "取消", widget: () => t(!1) })] }), extras: n, children: d(ba, { form: i, code: a, primaryKey: r, ...s }) });
|
|
}, Ca = (e, t, n, { isReplaceRouteHistory: a = !1 } = {}) => ce.redirect(n, t, { replace: a }), ka = (e, t = {}, n, a = {}) => {
|
|
var s;
|
|
const r = (s = a.router) == null ? void 0 : s.reduce((i, [o, l, c]) => {
|
|
const u = g.get(t, ["router", o]);
|
|
if (!u && u !== 0 && l) throw `请传入 ${c}`;
|
|
return `${i}/${u}`;
|
|
}, `/api/${n}`);
|
|
return F.del(r, t.param).msg();
|
|
}, zt = (e, t, n, { status: { loading: a, disabled: r }, setStatus: s }) => {
|
|
const i = { loading: (o) => o === void 0 ? a : s((l) => ({ ...l, loading: o })), disabled: (o) => o === void 0 ? r : s((l) => ({ ...l, disabled: o })) };
|
|
return g.isFunction(n) ? n.call(null, { ...t, ...i }) : g.isString(n) && n ? Ce.exec(n, t, i) : null;
|
|
}, Bt = (e, t, n, a, r) => g.isString(n) && n ? ee.getWidgetComponent(n).then(({ default: s }) => K.modal(s, { ...t, $setting: a }, r != null && r.title ? { ...r, title: g.template(r.title)(e) } : r)).catch((s) => {
|
|
K.error(n, { content: s.toString() });
|
|
}) : K.modal(n, { ...t, $setting: a }, r != null && r.title ? { ...r, title: g.template(r.title)(e) } : r), xa = (e, t, n, a, r) => K.modal(un, { ...t, $setting: a, code: n }, r != null && r.title ? { ...r, title: g.template(r.title)(e) } : r), va = (e, t, n, a, r) => K.modal(kt, { base62params: t, $setting: a, listCode: n }, r != null && r.title ? { ...r, title: g.template(r.title)(e) } : r), Sa = ({ widget: e, widgetType: t, widgetData: n, widgetProps: a, widgetSetting: r, widgetContainerProps: s }, { onAfterClick: i, onBeforeClick: o }) => {
|
|
const l = de(te), [c, u] = T({ leading: !0, trailing: !1 }), p = Y(() => {
|
|
switch (t) {
|
|
case "redirect":
|
|
return g.partialRight(Ca, e, r);
|
|
case "func":
|
|
return g.partialRight(zt, (r == null ? void 0 : r.code) ?? e, { status: c, setStatus: u });
|
|
case "fsdpf-component":
|
|
return g.partialRight(Bt, e, r, s);
|
|
case "grid-layout-form":
|
|
return g.partialRight(xa, e, r, s);
|
|
case "data-list":
|
|
return g.partialRight(va, e, r, s);
|
|
case "destroy":
|
|
return g.partialRight(ka, e, r, s);
|
|
default:
|
|
if (Pt(e) || k.isValidElement(e)) return g.partialRight(Bt, e, r, s);
|
|
if (g.isFunction(e)) return g.partialRight(zt, (r == null ? void 0 : r.code) || e, { status: c, setStatus: u });
|
|
}
|
|
return (...f) => console.error("useButton unknown widgetType", t, ...f);
|
|
}, [e, t]);
|
|
return [g.debounce((f) => (o == null || o(f), Promise.resolve(Gt(a, f, { list: l })).then((y) => p(f, { ...n, ...y })).then((y) => i == null ? void 0 : i(y)).catch(console.error)), 300, { leading: !0, trailing: !1 }), c];
|
|
}, Wt = /* @__PURE__ */ new Set(), ft = (e = [], t = 0) => {
|
|
const n = e[t];
|
|
if (n.length && !Wt.has(n)) {
|
|
const a = document.createElement("script");
|
|
a.setAttribute("src", n), a.setAttribute("data-namespace", n), e.length > t + 1 && (a.onload = () => {
|
|
ft(e, t + 1);
|
|
}, a.onerror = () => {
|
|
ft(e, t + 1);
|
|
}), Wt.add(n), document.body.appendChild(a);
|
|
}
|
|
}, yt = ({ className: e, type: t, style: n = {}, ...a }) => d("span", { role: "img", className: A("ff-iconfont", e), style: n, ...a, children: d("svg", { style: { width: "1em", height: "1em", fill: "currentColor", overflow: "hidden" }, viewBox: "0 0 1024 1024", children: d("use", { xlinkHref: `#${t}` }) }) });
|
|
yt.propTypes = { className: b.string, type: b.string.isRequired, style: b.object }, yt.init = ft;
|
|
const Ue = (e) => function({ className: t, children: n, name: a, icon: r, type: s = "default", iconPosition: i = "start", noAuthType: o, onAfterClick: l, onBeforeClick: c, data: u, loading: p, disabled: f, tooltip: y, confirm: h, widget: w, widgetType: C, widgetData: S, widgetProps: j, widgetSetting: P, widgetContainerProps: M, ...I }) {
|
|
const z = g.isEmpty(y) || !y.enabled ? {} : y, L = g.isEmpty(h) ? { enabled: !1 } : Object.assign({ enabled: !0 }, h), V = { type: "primary", className: A("ff-button", t), iconPosition: i };
|
|
s === "danger" ? V.danger = !0 : s === "default" && (V.type = s), e === "link" || e === "dashed" ? (V.type = e, s === "default" && (V.className = A(V.className, "ff-default"))) : e !== "circle" && e !== "round" || (V.shape = e), r && (V.icon = d(yt, { type: r }));
|
|
const [x, W] = T(!1), [$, { disabled: H, loading: ue }] = Sa({ widget: w, widgetType: C, widgetData: S, widgetProps: j, widgetSetting: P, widgetContainerProps: M }, { onAfterClick: l, onBeforeClick: c });
|
|
return d(Rn, { okText: "确定", cancelText: "取消", getPopupContainer: (D) => D, ...L, disabled: H || f, open: x, onOpenChange: (D) => {
|
|
if (!D) return W(D);
|
|
L.enabled ? W(D) : $(u);
|
|
}, onConfirm: () => {
|
|
$(u);
|
|
}, onClick: (D) => {
|
|
D.stopPropagation();
|
|
}, children: d(Fn, { getPopupContainer: (D) => D, ...z, title: x ? null : z == null ? void 0 : z.title, trigger: ["hover", "click"], children: d(lt, { loading: ue || p, disabled: H || f, ...V, ...I, children: n || a }) }) });
|
|
}, N = Ue("default"), $a = Ue("link"), Pa = Ue("circle"), Na = Ue("round"), Ta = Ue("dashed"), Ut = ({ data: e, widget: t, widgetType: n = "fsdpf-component", widgetData: a, widgetProps: r, widgetSetting: s, widgetContainerProps: i, onAfterClick: o, onBeforeClick: l, children: c, extras: u }) => {
|
|
const p = de(te), [f, y] = T(!1), [h, w] = T("hover"), [C, S] = T({}), [j, P] = T(), { placement: M, align: I, arrow: z = { pointAtCenter: !0 }, getPopupContainer: L, ...V } = i || {};
|
|
R(() => {
|
|
n == "grid-layout-form" ? P(k.createElement(un, { ...a, $setting: s, code: t })) : n == "data-list" ? P(k.createElement(kt, { base62params: e, $setting: s, listCode: t })) : g.isString(t) ? ee.getWidgetComponent(t).then(({ default: $ }) => {
|
|
P(k.createElement($, { ...a, $setting: s }));
|
|
}).catch(($) => P($.toString())) : Pt(t) ? P(k.createElement(t, { ...a, $setting: s })) : k.isValidElement(t) && P(k.cloneElement(t, { ...a, $setting: s }));
|
|
}, [t, n, a]), R(() => {
|
|
Promise.resolve(Gt(r, e, { list: p })).then(S);
|
|
}, [r, e]);
|
|
const x = ($, H = !1) => (y($), !$ && w("hover"), $ ? l == null ? void 0 : l(C) : o == null ? void 0 : o(H)), W = ($) => {
|
|
y(!0), w("click");
|
|
};
|
|
return d(On, { zIndex: 1080, placement: M, onPopupClick: W, onClick: W, open: f, align: I, arrow: z, trigger: h, getPopupContainer: L, content: d(Ea, { ...V, extras: u, children: j && k.cloneElement(j, { ...C, $close: ($) => x(!1, $) }) }), children: c, onOpenChange: x });
|
|
}, Ea = ({ title: e, className: t, children: n, extras: a, width: r, height: s, ...i }) => {
|
|
const [o, l] = T({}), c = G((y, h) => l((w) => ({ ...w, [y]: h })), []), u = G((y) => l((h) => ({ ...h, [y]: void 0 })), []), p = e ? k.createElement("div", { className: "ff-popup-title" }, e) : o == null ? void 0 : o.title, f = a ?? k.createElement("div", { className: "ff-popup-reserved-extras" }, a);
|
|
return d(Be.Provider, { value: { ele: o, mount: c, unmount: u }, children: O("div", { className: A("ff-popup ff-popover", t), style: { width: r, height: s }, ...i, children: [O("div", { className: "ff-popup-header", children: [p, o == null ? void 0 : o["sub-title"]] }), n, O("div", { className: "ff-popup-footer", children: [f, o == null ? void 0 : o.extras, o == null ? void 0 : o.actions] })] }) });
|
|
};
|
|
Ut.propTypes = { widgetType: b.oneOf(["fsdpf-component", "grid-layout-form", "data-list"]) }, N.propTypes = { type: b.oneOf(["primary", "default", "danger", ""]), name: b.string, icon: b.string, iconPosition: b.oneOf(["start", "end"]), data: b.any, widget: b.any, widgetType: b.oneOf(["destroy", "redirect", "func", "fsdpf-component", "grid-layout-form", "grid-layout", "data-list"]), widgetData: b.object, widgetProps: b.object, widgetSetting: b.object, widgetContainerProps: b.object, tooltip: b.exact({ title: b.string.isRequired, placement: b.oneOf(["top", "left", "right", "bottom", "topLeft", "topRight", "bottomLeft", "bottomRight", "leftTop", "leftBottom", "rightTop", "rightBottom"]), enabled: b.oneOfType([b.bool, b.number]), getPopupContainer: b.func }), confirm: b.exact({ title: b.string.isRequired, cancelText: b.string, okText: b.string, okType: b.oneOf(["primary", "default", "danger", ""]), placement: b.oneOf(["top", "left", "right", "bottom", "topLeft", "topRight", "bottomLeft", "bottomRight", "leftTop", "leftBottom", "rightTop", "rightBottom"]), enabled: b.oneOfType([b.bool, b.number]), getPopupContainer: b.func, arrow: b.oneOfType([b.bool, b.exact({ pointAtCenter: b.bool })]) }) }, N.Link = $a, N.Link.defaultProps = N.defaultProps, N.Link.propTypes = N.propTypes, N.Circle = Pa, N.Circle.defaultProps = N.defaultProps, N.Circle.propTypes = N.propTypes, N.Round = Na, N.Round.defaultProps = N.defaultProps, N.Round.propTypes = N.propTypes, N.Dashed = Ta, N.Dashed.defaultProps = N.defaultProps, N.Dashed.propTypes = N.propTypes, N.Popover = Ut;
|
|
const Ra = ({ fields: e, formProps: t, $close: n }) => {
|
|
const [a] = Z.useForm(), r = Y(() => [{ name: "__PROPS__", value: t }], [t]);
|
|
return d(_, { actions: O(k.Fragment, { children: [d(N, { name: "取消", widget: () => n(!1) }), d(N, { name: "确定", type: "primary", widget: () => a.validateFields(!0).then(n) })] }), children: d(Z, { fields: r, form: a, className: "ff-modal-form", children: e == null ? void 0 : e.map(({ code: s, ...i }) => d(wa, { code: s, ...i }, s)) }) });
|
|
}, Fa = ({ className: e, $close: t, children: n, title: a, subTitle: r, actions: s, extras: i, zIndex: o, ...l }) => O(Un, { ...l, prefixCls: "ff-drawer", className: A("ff-popup", e), maskMotion: { motionAppear: !0, motionName: "mask-motion" }, motion: (c) => ({ motionAppear: !0, motionName: `panel-motion-${c}` }), children: [O("div", { className: "ff-popup-header", children: [d("button", { "aria-label": "Close", className: "ff-popup-close", onClick: l.onClose, children: d(Ct, { type: "close" }) }), a, r] }), d("div", { className: "ff-popup-body", children: n }), O("div", { className: "ff-popup-footer", children: [i, s] })] }), Oa = ({ className: e, $close: t, $event: n, children: a, title: r, subTitle: s, actions: i, extras: o, zIndex: l, placement: c, ...u }) => {
|
|
const p = (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 d(Dn, { ...u, ...p, prefixCls: "ff-modal", modalRender: () => O("div", { className: A("ff-modal-content ff-popup", e), children: [O("div", { className: "ff-popup-header", children: [d("button", { "aria-label": "Close", className: "ff-popup-close", onClick: u.onClose, children: d(Ct, { type: "close" }) }), r, s] }), d("div", { className: "ff-popup-body", children: a }), O("div", { className: "ff-popup-footer", children: [o, i] })] }) });
|
|
}, gn = ({ placement: e, $close: t, $event: n, children: a, title: r, ...s }) => {
|
|
const [i, o] = T({}), [l, c] = T(!0), u = G((h, w) => o((C) => ({ ...C, [h]: w })), []), p = G((h) => o((w) => ({ ...w, [h]: void 0 })), []);
|
|
let f = { ...s, className: i.rootClassName, title: i.title || r && k.createElement("div", { className: A("ff-popup-title") }, r), subTitle: i["sub-title"], actions: i.actions, extras: i.extras, children: a, $close: t, $event: n, onClose: () => c(!1) };
|
|
const y = () => {
|
|
t(!1);
|
|
};
|
|
return d(Be.Provider, { value: { ele: i, mount: u, unmount: p }, children: e && e !== "center" ? d(Fa, { ...f, placement: e, open: l, afterOpenChange: (h) => !h && y() }) : d(Oa, { ...f, visible: l, afterClose: y }) });
|
|
};
|
|
gn.propTypes = { placement: b.oneOf(["center", "left", "top", "right", "bottom"]) };
|
|
const J = () => {
|
|
const [e, t] = Bn({ maxCount: 6, motion: { motionName: "ff-notification-fade", motionAppear: !0, motionEnter: !0, motionLeave: !0, onLeaveStart: (s) => {
|
|
const { offsetHeight: i } = s;
|
|
return { height: i };
|
|
}, onLeaveActive: () => ({ height: 0, opacity: 0, margin: 0 }) }, prefixCls: "ff-notification" }), [, n] = k.useReducer((s) => s + 1, 0);
|
|
R(() => {
|
|
J.$onClick = a, J.$queue.forEach(([s, i, o], l, c) => {
|
|
r([i, o], ...s), delete c[l];
|
|
});
|
|
}, []);
|
|
const a = (s, i = {}, o = {}) => new Promise((l, c) => r([l, c], s, i, o)), r = ([s, i], o, l = {}, c = {}) => {
|
|
const u = J.$index++, p = (f) => ((y, h) => (J.$popups.delete(y), n(), h == null ? void 0 : h()))(u, () => s(f));
|
|
if (o === _t) return e.open({ ...c, key: u, content: k.createElement(o, { ...l, $close: () => e.close(u) }) });
|
|
J.$popups.set(u, k.createElement(gn, { zIndex: u, maskClosable: !1, $event: l == null ? void 0 : l.$event, ...c, key: u, $close: p }, k.isValidElement(o) ? k.cloneElement(o, { ...l, $close: p }) : o != null && o.name || Ot.isForwardRef(o) || (o == null ? void 0 : o.$$typeof) === Ot.ForwardRef ? k.createElement(o, { ...l, $close: p }) : o)), n();
|
|
};
|
|
return O(k.Fragment, { children: [Array.from(J.$popups).map(([s, i]) => i), t] });
|
|
};
|
|
J.$popups = /* @__PURE__ */ new Map(), J.$index = 0, J.$queue = [], J.$onClick = (...e) => new Promise((t, n) => {
|
|
J.$queue.push([e, t, n]);
|
|
});
|
|
const Dt = (e, t, n = {}) => J.$onClick(e, t, n), it = (e, { showProgress: t, duration: n, ...a } = { duration: 1.5 }) => J.$onClick(_t, { content: e, ...a }, { showProgress: t, duration: n }), K = { modal: Dt, confirm: (e, t = {}) => J.$onClick(qn, { content: e, ...t }, { placement: "center" }), form: (e, t = {}, n = {}) => Dt(Ra, { formProps: n, fields: e }, { placement: "center", ...t }).then((a) => {
|
|
if (a === !1) throw !1;
|
|
return a;
|
|
}), notification: it, success: (e, t = { duration: 1.5 }) => it(e, { ...t, className: "ff-notification-success", icon: "check" }), error: (e, t = { duration: 1.5 }) => it(e, { ...t, className: "ff-notification-error", icon: "close" }) };
|
|
Re.configure({ showSpinner: !1 }), Fe.interceptors.request.use((e) => {
|
|
e.headers.Platform = "web", e.headers.SaaS = window.localStorage.getItem("SaaS");
|
|
const t = window.localStorage.getItem(_e);
|
|
return e.headers.Authorization = t ? `Bearer ${t} ` : void 0, Re.inc(), e;
|
|
}, (e) => (Re.done(), Promise.reject({ code: -1, msg: e }))), Fe.interceptors.response.use(({ data: e, headers: t }) => (Re.done(), { ...e, res: t == null ? void 0 : t.res }), function(e) {
|
|
return Re.done(), Promise.reject(e.message);
|
|
}), window.addEventListener("unhandledrejection", ct.onUnhandledRejection), ct.onMsg = (e, t) => K[[0, 1].includes(e) ? "success" : "error"](t).then(() => e === 20300 && ce.redirect(Oe.get("Common.WEBSITE_LOGIN_PAGE")));
|
|
const wt = { appUrl: "", init: (e, t, n) => {
|
|
wt.appUrl = n, Fe.defaults.baseURL = n, Fe.defaults.timeout = 15e3, Object.assign(wt, new ct(e, t, Fe));
|
|
} }, F = wt;
|
|
class $t extends Error {
|
|
constructor(t, n) {
|
|
super(n), Error.captureStackTrace && Error.captureStackTrace(this, $t), !n instanceof Le && (this.name = `${t} Error Runtime`);
|
|
}
|
|
}
|
|
class Le extends Error {
|
|
constructor(t, ...n) {
|
|
super(...n), Error.captureStackTrace && Error.captureStackTrace(this, Le), this.name = `${t} Not Found`;
|
|
}
|
|
}
|
|
const ot = "mine", _e = "token";
|
|
var be, Ee;
|
|
const ie = class ie {
|
|
constructor() {
|
|
E(this, Ee, /* @__PURE__ */ new Map());
|
|
v(this, "setVendor", (t, n) => m(this, Ee).set(t, new Jt(n, async (a, r) => {
|
|
var i, o;
|
|
if (!(a != null && a.default)) throw "@pkg not found";
|
|
let s = () => r;
|
|
switch ("function") {
|
|
case typeof (s = (i = a.default) == null ? void 0 : i[`./${r}/index.jsx`]):
|
|
case typeof (s = (o = a.default) == null ? void 0 : o[`./${r}/index.js`]):
|
|
return s();
|
|
}
|
|
throw new Le(r);
|
|
})));
|
|
v(this, "getWidgetComponent", async (t) => {
|
|
if (!t) throw "getWidgetComponent widget is required";
|
|
if (t != null && t.startsWith("blob:") || t != null && t.startsWith("http:") || t != null && t.startsWith("https:")) return await import(t);
|
|
const [, n] = t == null ? void 0 : t.split("@pkg/");
|
|
if (!n) throw new Le(t);
|
|
try {
|
|
return m(this, Ee).has("pkg") ? await m(this, Ee).get("pkg").get(n) : await import(`${F.appUrl}/api/pkg-import/web?name=${t}`);
|
|
} catch (a) {
|
|
throw new $t(t, a);
|
|
}
|
|
});
|
|
v(this, "getRoutes", () => F.get("/api/my-router").then((t) => [...t, { uuid: "data-list-setting", isLayout: !0, uri: "/data-list-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/ff-design/components/DataListSetting", extra: { layout: "@pkg/ff-design/frameworks/DesignTheme" } }, { uuid: "grid-layout-setting", isLayout: !0, uri: "/grid-layout-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/ff-design/components/GridLayoutSetting", extra: { layout: "@pkg/ff-design/frameworks/DesignTheme" } }, { uuid: "grid-layout-form-setting", isLayout: !0, uri: "/grid-layout-form-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/ff-design/components/GridLayoutFormSetting", extra: { layout: "@pkg/ff-design/frameworks/DesignTheme" } }, { uuid: "resource-api-setting", isLayout: !0, uri: "/resource-api-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/ff-design/components/ResourceApiSetting", extra: { layout: "@pkg/ff-design/frameworks/DesignTheme" } }, { uuid: "charts-setting", isLayout: !0, uri: "/resource-api-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/ff-design/components/ChartsSetting", extra: { layout: "@pkg/ff-design/frameworks/DesignTheme" } }, { uuid: "fsm-setting", isLayout: !0, uri: "/fsm-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/ff-design/components/FsmSetting", extra: { layout: "@pkg/ff-design/frameworks/DesignTheme" } }, { uuid: "component-setting", isLayout: !0, uri: "/component-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/ff-design/components/ComponentSetting", extra: { layout: "@pkg/ff-design/frameworks/DesignTheme" } }, { uuid: "login", uri: "/login", name: "登录", type: "fsdpf-component", isLogin: !1, component: "@pkg/ff/components/Login" }, { uuid: "not-found", uri: "*", name: "Not Found", type: "fsdpf-component", isLogin: !1, component: "@pkg/ff/components/NotFound" }].map(({ uuid: n, ...a }) => [n, { uuid: n, ...a }])).then((t) => new Map(t)));
|
|
v(this, "getMenus", () => F.get("/api/my-menu"));
|
|
v(this, "getConfigure", () => F.get("api/init-configure"));
|
|
v(this, "getWidgetOperationAuth", () => F.get("/api/init-widget-operation-auth").then((t) => t.reduce((n, { uuid: a, auth: r }) => [...n, [a, r]], [])));
|
|
v(this, "getPhoneNumber", (t) => F.get(`/api/user-wx-phone-number/${t}`));
|
|
v(this, "getUserToken", () => {
|
|
const t = window.localStorage.getItem(_e);
|
|
if (!t) return "";
|
|
const n = t.split(".");
|
|
if (!Array.isArray(n) || n.length !== 3) throw "登录令牌无效!";
|
|
const { iat: a } = JSON.parse(window.atob(n[1]));
|
|
if (Math.floor((/* @__PURE__ */ new Date()).getTime() / 1e3) - a > 2592e3) throw "登录令牌已过期, 请重新登录!";
|
|
return t;
|
|
});
|
|
v(this, "checkUserToken", () => {
|
|
try {
|
|
return !!this.getUserToken();
|
|
} catch {
|
|
return !1;
|
|
}
|
|
});
|
|
v(this, "getUserInfo", (t = !0) => {
|
|
var n;
|
|
try {
|
|
const a = this.getUserToken();
|
|
if (!a) return Promise.resolve(null);
|
|
const { iat: r } = JSON.parse(window.atob((n = a == null ? void 0 : a.split(".")) == null ? void 0 : n[1])), { iat: s, ...i } = F.decode(window.localStorage.getItem(ot) || "", {});
|
|
return s === r ? Promise.resolve(i) : F.get("/api/mine-info").then(({ User: o = null }) => (window.localStorage.setItem(ot, F.encode({ ...o, iat: r })), o));
|
|
} catch (a) {
|
|
console.error(a), t && K.error("请登录").then(this.logout);
|
|
}
|
|
return Promise.resolve(null);
|
|
});
|
|
v(this, "login", (t, n, a = {}) => F.post("/api/user-token", { username: t, passwd: Wn.hash(n), platform: "web", ...a }).then(({ token: r }) => (window.localStorage.setItem(_e, r), r)));
|
|
v(this, "logout", (t) => (window.localStorage.removeItem(ot), window.localStorage.removeItem(_e), t == null ? void 0 : t()));
|
|
if (m(ie, be)) return m(ie, be);
|
|
}
|
|
};
|
|
be = new WeakMap(), Ee = new WeakMap(), E(ie, be, null), v(ie, "getInstance", () => (m(ie, be) || U(ie, be, new ie()), m(ie, be)));
|
|
let bt = ie;
|
|
const ee = bt.getInstance(), La = k.createContext({ user: {}, initUser: () => {
|
|
}, initUserComplete: !1 }), Va = k.createContext({ set: () => {
|
|
}, get: () => {
|
|
}, assign: () => {
|
|
}, currentRoute: () => {
|
|
} }), Pt = (e) => !!(e != null && e.name) && (e.prototype instanceof k.Component || /^[A-Z]/.test(e.name)), Aa = (e, t) => {
|
|
if (!e || typeof window > "u") return;
|
|
let n = document.querySelector(`style[ff-style-token="${t}"]`);
|
|
return n ? (n.innerHTML = e, e) : (n = document.createElement("style"), n.setAttribute("ff-style-token", t), n.setAttribute("type", "text/css"), n.innerHTML = e, document.head.appendChild(n), e);
|
|
}, ja = Object.freeze(Object.defineProperty({ __proto__: null, AppContext: La, AppGlobalParamsContext: Va, cache: Jt, configure: Oe, default: ee, func: Ce, http: F, insertStyle: Aa, isReactComponent: Pt, route: ce }, Symbol.toStringTag, { value: "Module" })), Ia = (e, t, n = "children") => {
|
|
if (g.isEmpty(e)) return {};
|
|
const a = g.find(e, ["value", t]);
|
|
if (!g.isEmpty(a)) return a;
|
|
const r = e.length;
|
|
for (let s = 0; s < r; s++) {
|
|
const { [n]: i } = e[s], o = Ia(i, t, n);
|
|
if (!g.isEmpty(o)) return o;
|
|
}
|
|
return {};
|
|
};
|
|
export {
|
|
N as $,
|
|
or as A,
|
|
lr as B,
|
|
Zt as C,
|
|
Ye as D,
|
|
gt as E,
|
|
Kn as F,
|
|
cr as G,
|
|
ra as H,
|
|
_n as I,
|
|
xt as J,
|
|
ur as K,
|
|
gr as L,
|
|
We as M,
|
|
vt as N,
|
|
pr as O,
|
|
mr as P,
|
|
ba as Q,
|
|
an as R,
|
|
St as S,
|
|
wa as T,
|
|
un as U,
|
|
pa as V,
|
|
ma as W,
|
|
ha as X,
|
|
fa as Y,
|
|
hr as Z,
|
|
yt as _,
|
|
rr as a,
|
|
Hn as a0,
|
|
Sa as a1,
|
|
_ as a2,
|
|
Be as a3,
|
|
Kt as a4,
|
|
J as a5,
|
|
K as a6,
|
|
er as a7,
|
|
tr as a8,
|
|
nr as a9,
|
|
ee as aa,
|
|
Pt as ab,
|
|
Aa as ac,
|
|
F as ad,
|
|
Jt as ae,
|
|
Oe as af,
|
|
Ce as ag,
|
|
ce as ah,
|
|
La as ai,
|
|
Va as aj,
|
|
Ia as ak,
|
|
sr as b,
|
|
ir as c,
|
|
Yt as d,
|
|
en as e,
|
|
rn as f,
|
|
Gt as g,
|
|
ln as h,
|
|
dr as i,
|
|
sn as j,
|
|
on as k,
|
|
nn as l,
|
|
tn as m,
|
|
na as n,
|
|
ta as o,
|
|
Zn as p,
|
|
kt as q,
|
|
st as r,
|
|
te as s,
|
|
Q as t,
|
|
ar as u,
|
|
aa as v,
|
|
la as w,
|
|
Gn as x,
|
|
Xn as y,
|
|
Jn as z
|
|
};
|