From a139b8aef79102ead195ae88759ec73fcaab1e0a Mon Sep 17 00:00:00 2001 From: what Date: Fri, 12 Jul 2024 10:30:05 +0800 Subject: [PATCH] [feat] v0.2.0 --- dist/button.js | 10 +- dist/common/main-D2ZjkFcD.js | 2175 ------------------------------- dist/common/main-DamvcBIJ.js | 2245 ++++++++++++++++++++++++++++++++ dist/common/vender-CMS8SASe.js | 835 ++++++++++++ dist/common/vender-CijlkmMW.js | 835 ------------ dist/components.js | 6 +- dist/container.js | 10 +- dist/data-list.js | 34 +- dist/grid-layout-form.js | 14 +- dist/grid-layout.js | 8 +- dist/hooks.js | 16 +- dist/index.js | 22 +- dist/res-ws.js | 4 +- dist/service.js | 12 +- dist/style.css | 2 +- dist/user.js | 10 +- dist/utils.js | 4 +- package.json | 4 +- 18 files changed, 3158 insertions(+), 3088 deletions(-) delete mode 100644 dist/common/main-D2ZjkFcD.js create mode 100644 dist/common/main-DamvcBIJ.js create mode 100644 dist/common/vender-CMS8SASe.js delete mode 100644 dist/common/vender-CijlkmMW.js diff --git a/dist/button.js b/dist/button.js index e4ac7eb..2b32b0f 100644 --- a/dist/button.js +++ b/dist/button.js @@ -1,7 +1,7 @@ -import { E as s, B as u, C as e } from "./common/main-D2ZjkFcD.js"; -import "./common/vender-CijlkmMW.js"; +import { E, B, C } from "./common/main-DamvcBIJ.js"; +import "./common/vender-CMS8SASe.js"; export { - s as auth, - u as default, - e as useButton + E as auth, + B as default, + C as useButton }; diff --git a/dist/common/main-D2ZjkFcD.js b/dist/common/main-D2ZjkFcD.js deleted file mode 100644 index 45e9c4f..0000000 --- a/dist/common/main-D2ZjkFcD.js +++ /dev/null @@ -1,2175 +0,0 @@ -var Rn = Object.defineProperty; -var kn = (e, t, n) => t in e ? Rn(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n; -var F = (e, t, n) => (kn(e, typeof t != "symbol" ? t + "" : t, n), n), Zt = (e, t, n) => { - if (!t.has(e)) - throw TypeError("Cannot " + n); -}; -var u = (e, t, n) => (Zt(e, t, "read from private field"), n ? n.call(e) : t.get(e)), R = (e, t, n) => { - if (t.has(e)) - throw TypeError("Cannot add the same private member more than once"); - t instanceof WeakSet ? t.add(e) : t.set(e, n); -}, U = (e, t, n, s) => (Zt(e, t, "write to private field"), s ? s.call(e, n) : t.set(e, n), n); -var He = (e, t, n, s) => ({ - set _(r) { - U(e, t, r, n); - }, - get _() { - return u(e, t, s); - } -}); -import d from "lodash"; -import Be from "axios"; -import v, { useMemo as le, useEffect as L, useRef as K, useState as k, useCallback as _, useContext as De, useLayoutEffect as Fn, useId as Vn } from "react"; -import vt from "ff-request"; -import Ln from "https://assets.fsdpf.net/js/esm/spark-md5@3_0_2.min.js?url"; -import { jsx as f, jsxs as Z, Fragment as Nn } from "react/jsx-runtime"; -import { QuestionOutlined as In, LoadingOutlined as wn, createFromIconfontCN as En } from "@ant-design/icons"; -import T from "classnames"; -import { P as S, N as Ye } from "./vender-CijlkmMW.js"; -import Ke, { Field as Dt, FieldContext as Wn } from "rc-field-form"; -import { notification as Xt, Drawer as Pn, Modal as Zn, Form as Me, ConfigProvider as jt, Input as Tn, Breadcrumb as Gn, Tree as Sn, Pagination as $n, Table as zn, Empty as On, Popconfirm as xn, Tooltip as Un, Button as Dn, Popover as Xn } from "antd"; -import { flushSync as jn } from "react-dom"; -import Tt from "immutability-helper"; -import { useParams as Hn, generatePath as Bn, Navigate as Yn, createBrowserRouter as Kn } from "react-router-dom"; -const Ct = ({ type: e, className: t, ...n }) => { - if (!(e != null && e.startsWith("icon-"))) - return /* @__PURE__ */ f(In, {}); - if (e === "icon-loading") - return /* @__PURE__ */ f(wn, { className: t, ...n }); - const s = le(() => En({ scriptUrl: Pe.get("Common.ICONFONT", []) }), [Pe.get("Common.ICONFONT")]); - return /* @__PURE__ */ f(s, { type: e, className: T("iconfont", t), ...n }); -}, Mn = ({ className: e, title: t, content: n, icon: s, $close: r, category: o, duration: i = 4.5 }) => { - const [c, l] = Xt.useNotification(); - return L(() => { - c[o || "open"]({ - className: e, - message: t, - description: n, - icon: s, - duration: i, - onClose: () => r(!1) - }); - }, [t, n, s]), l; -}, An = ({ className: e, title: t, content: n, okText: s, $close: r, duration: o = 5e3 }) => { - var a; - const i = K(), [c, l] = k(); - return L(() => (c > 0 && (i.current = setTimeout(() => { - c <= 1 ? r() : l((p) => p - 1); - }, 1e3)), () => clearTimeout(i.current)), [c]), L(() => { - l(Math.max(Math.ceil(o / 1e3), 0)); - }, [o]), /* @__PURE__ */ f("div", { className: T("ff-confirm", e), onClick: (p) => p.mpEvent.currentTarget.id === p.mpEvent.target.id && r(), children: /* @__PURE__ */ Z("div", { className: "ff-confirm-container", children: [ - /* @__PURE__ */ f("div", { className: "ff-confirm-title", children: t }), - /* @__PURE__ */ f("div", { className: "ff-confirm-content", children: n }), - /* @__PURE__ */ Z("div", { className: "ff-confirm-operations", children: [ - /* @__PURE__ */ Z("div", { className: "ff-confirm-cancel", onClick: () => r(!1), children: [ - "取消 (", - c, - ")" - ] }), - v.isValidElement(s) ? v.cloneElement(s, { - onClick: () => r(!0), - className: T("ff-confirm-ok", (a = s.props) == null ? void 0 : a.className) - }) : /* @__PURE__ */ f("div", { className: "ff-confirm-ok", onClick: () => r(!0), children: s || "确定" }) - ] }) - ] }) }); -}, Xe = v.createContext({ - ele: {}, - mount: () => { - }, - unmount: () => { - } -}), Y = ({ className: e, children: t, actions: n, title: s, subTitle: r, extras: o, style: i }) => (n && Y.Action({ children: n }), s && Y.Title({ children: s }), r && Y.SubTitle({ children: r }), o && Y.Extra({ children: o }), /* @__PURE__ */ f("div", { className: T("ff-container", e), style: i, children: t })), ct = (e) => ({ children: t, className: n }) => { - const { mount: s, unmount: r } = v.useContext(Xe); - return L(() => (s(e, v.createElement("div", { - key: `ff-${e}`, - className: T(`ff-popup-${e}`, n) - }, t)), () => r(e)), [n, t]), null; -}; -Y.Action = ct("actions"); -Y.Title = ct("title"); -Y.SubTitle = ct("sub-title"); -Y.Extra = ct("extras"); -const nr = ({ name: e }) => { - const { ele: t } = v.useContext(Xe); - return t == null ? void 0 : t[e]; -}; -Y.propTypes = { - // 容器 className - className: S.string, - // 容器样式 - style: S.object, - // 标题占位符 - title: S.any, - // 副标题占位符 - subTitle: S.any, - // 操作按钮占位符 - actions: S.any, - // 扩展安装占位符 - extras: S.any -}; -Y.defaultProps = { - style: {} -}; -const Jn = v.forwardRef(({ $close: e, children: t, className: n, title: s, ...r }, o) => { - const i = K(), [c, l] = k(!0), [a, p] = k({}), g = _((h, y) => p((b) => ({ ...b, [h]: y })), []), m = _((h) => p((y) => ({ ...y, [h]: void 0 })), []); - return v.useImperativeHandle(o, () => ({ - handleClose: (h) => { - i.current = h, l(!1); - } - })), /* @__PURE__ */ f(Xe.Provider, { value: { ele: a, mount: g, unmount: m }, children: /* @__PURE__ */ f( - Pn, - { - ...r, - title: s || (a == null ? void 0 : a.title), - open: c, - onClose: () => { - i.current = !1, l(!1); - }, - afterOpenChange: (h) => !h && e(i.current), - className: T("ff-popup ff-drawer", n, a == null ? void 0 : a.className), - extra: a == null ? void 0 : a["sub-title"], - classNames: { header: "ff-popup-header", footer: "ff-popup-footer" }, - footer: a != null && a.extras || a != null && a.actions ? /* @__PURE__ */ Z(v.Fragment, { children: [ - (a == null ? void 0 : a.extras) || /* @__PURE__ */ f("div", { className: "ff-popup-extras" }), - (a == null ? void 0 : a.actions) || /* @__PURE__ */ f("div", { className: "ff-popup-actions" }) - ] }) : void 0, - children: t - } - ) }); -}), Qn = v.forwardRef(({ $close: e, children: t, className: n, title: s, ...r }, o) => { - const i = K(), [c, l] = k(!0), [a, p] = k({}), g = _((h, y) => p((b) => ({ ...b, [h]: y })), []), m = _((h) => p((y) => ({ ...y, [h]: void 0 })), []); - return v.useImperativeHandle(o, () => ({ - handleClose: (h) => { - i.current = h, l(!1); - } - })), /* @__PURE__ */ f(Xe.Provider, { value: { ele: a, mount: g, unmount: m }, children: /* @__PURE__ */ f( - Zn, - { - ...r, - title: /* @__PURE__ */ Z(Nn, { children: [ - s || (a == null ? void 0 : a.title), - a == null ? void 0 : a["sub-title"] - ] }), - open: c, - onCancel: () => { - i.current = !1, l(!1); - }, - afterOpenChange: (h) => !h && e(i.current), - className: T("ff-popup ff-modal", n, a == null ? void 0 : a.className), - keyboard: !0, - classNames: { header: "ff-popup-header", footer: "ff-popup-footer" }, - footer: a != null && a.extras || a != null && a.actions ? /* @__PURE__ */ Z(v.Fragment, { children: [ - (a == null ? void 0 : a.extras) || /* @__PURE__ */ f("div", { className: "ff-popup-extras" }), - (a == null ? void 0 : a.actions) || /* @__PURE__ */ f("div", { className: "ff-popup-actions" }) - ] }) : null, - children: t - } - ) }); -}); -var fe, ae, we, nt; -const ee = class ee { - constructor() { - R(this, ae, null); - R(this, we, /* @__PURE__ */ new Map()); - R(this, nt, () => { - if (u(this, ae)) - return u(this, ae).port.postMessage({ command: "status", data: [] }); - U(this, ae, new SharedWorker(new URL("data:text/plain;base64,Y29uc3QgcG9ydHMgPSBbXQpsZXQgd3MgPSBudWxsCgpmdW5jdGlvbiBpbml0V3ModXJsKSB7CiAgd3MgPSBuZXcgV2ViU29ja2V0KHVybCkKICB3cy5vbmNsb3NlID0gKGUpID0+IGNvbnNvbGUubG9nKCd3cyBjbG9zZWQnLCBlKQogIHdzLm9uZXJyb3IgPSAoZSkgPT4gY29uc29sZS5sb2coJ3dzIGVycm9yJywgZSkKICB3cy5vbm1lc3NhZ2UgPSAoeyBkYXRhIH0pID0+IHsKICAgIGNvbnN0IHZhbHVlID0gSlNPTi5wYXJzZShkYXRhKQogICAgcG9ydHMuZm9yRWFjaChwb3J0ID0+IHBvcnQucG9zdE1lc3NhZ2UodmFsdWUpKQogIH0KfQoKZnVuY3Rpb24gY2xvc2VXcygpIHsKICBpZiAoIXdzIHx8IHdzLnJlYWR5U3RhdGUgPT0gV2ViU29ja2V0Lk9QRU4pIHsKICAgIHdzLmNsb3NlKCkKICB9Cn0KCmZ1bmN0aW9uIHN0YXR1cygpIHsKICB0aGlzLnBvc3RNZXNzYWdlKHsgcmVhZHlTdGF0ZTogd3MgPyB3cy5yZWFkeVN0YXRlIDogV2ViU29ja2V0LkNMT1NFRCB9KQp9CgpzZWxmLm9uY29ubmVjdCA9IChlKSA9PiB7CiAgY29uc3QgcG9ydCA9IGUucG9ydHNbMF07CgogIHBvcnQub25tZXNzYWdlID0gKHsgZGF0YTogeyBjb21tYW5kLCBkYXRhIH0gfSkgPT4gewogICAgaWYgKGNvbW1hbmQgJiYgWydpbml0V3MnLCAnY2xvc2VXcycsICdzdGF0dXMnXS5pbmNsdWRlcyhjb21tYW5kKSkgUmVmbGVjdC5hcHBseShzZWxmPy5bY29tbWFuZF0sIHBvcnQsIGRhdGEgfHwgW10pCiAgfQoKICBwb3J0cy5wdXNoKHBvcnQpCn0K", self.location))), u(this, ae).port.onmessage = (t) => { - var n, s; - (n = t.data) != null && n.uuid ? u(this, we).forEach((r, o) => { - var i; - (r == "*" || (i = r == null ? void 0 : r.includes) != null && i.call(r, t.data.uuid)) && o(t.data); - }) : ((s = t.data) == null ? void 0 : s.readyState) == WebSocket.CLOSED && I.get("/api/user-api-token").then(({ token: r, expire_at: o }) => { - u(this, ae).port.postMessage({ command: "initWs", data: [`ws${d.trimStart(It, "http")}api/user-resource-status-ws?token=${r}`] }); - }); - }, u(this, ae).port.postMessage({ command: "status", data: [] }); - }); - F(this, "subscribe", (t, n = []) => (n ? Array.isArray(n) && n.length == 0 ? n = "*" : Array.isArray(n) || (n = [n].flat()) : n = "*", u(this, we).set(t, n), u(this, we).size == 1 && u(this, nt).call(this), () => this.unsubscribe(t))); - F(this, "unsubscribe", (t) => u(this, we).delete(t)); - if (u(ee, fe)) - return u(ee, fe); - } -}; -fe = new WeakMap(), ae = new WeakMap(), we = new WeakMap(), nt = new WeakMap(), R(ee, fe, null), F(ee, "getInstance", () => (u(ee, fe) || U(ee, fe, new ee()), u(ee, fe))); -let ft = ee; -const Ht = ft.getInstance(), Bt = () => { - const e = K(!0), [t, n] = k(0); - return L(() => () => e.current = !1, []), () => e.current && jn(() => { - n(t + 1); - }); -}, sr = ({ value: e, defaultValue: t, onChange: n }) => { - const s = Bt(), r = K(e !== void 0 ? e : t); - e !== void 0 && (r.current = e); - const o = _(d.debounce((i) => { - e === void 0 && (r.current = i, s()), n && n(i); - }, 380, { leading: !0, trailing: !1 }), [e]); - return [r.current, o]; -}, Gt = (e) => { - const t = K(); - return L(() => { - t.current = e; - }), t.current; -}, qn = (e) => { - const t = K(), [n, s] = k(e); - return L(() => { - d.isFunction(t.current) && t.current(n); - }, [n]), [n, function(r, o) { - t.current = o, s(r); - }]; -}, lt = (e = v.EffectCallback, t, n = d.isEqual) => { - const s = v.useRef(t); - (!s.current || !n(t, s.current)) && (s.current = t), v.useEffect(e, [s.current]); -}, Yt = (e, t = "string") => { - var n; - if (!Array.isArray(e)) - return e; - for (let s = 0; s < e.length; s++) - e[s].value = d.toPrimitive((n = e[s]) == null ? void 0 : n.value, t), e[s] && Reflect.has(e[s], "children") && (e[s].children = Yt(e[s].children, t)); - return e; -}, rr = (e, t = "json", n = "string", s, r = null) => { - const [o] = Ke.useForm(s), [i, c] = k([{ label: "无", value: "", disabled: !0 }]), l = K([]), a = Ke.useWatch((p) => l.current.length === 0 ? null : d.pick(p, l.current), o) || null; - return L(() => { - Array.isArray(e) ? c(e) : t === "javascript" && e ? ke.exec(e, {}, { - getFieldValue: (p) => (l.current.includes(p) || l.current.push(p), o.getFieldValue(p)), - getFieldValueForBasicForm: (p) => (l.current.includes(p) || l.current.push(p), r ? r.getFieldValue(p) : o.getFieldValue(p)) - }).then((p) => { - c(d.toPrimitive(p, "array")); - }) : e && c(d.toPrimitive(e, "array")); - }, [e, t, a]), Yt(i, n); -}, or = (e) => { - const [t, n] = k(), s = { type: "GET" }; - if (typeof e == "string" ? s.url = e : d.isPlainObject(e) && Object.assign(s, e), !(s != null && s.url)) - throw "url is required"; - const r = (o) => I.request(s, !1).resp((i) => (console.log("useSubscribeRequest", o), n(i), i)); - return lt(() => { - let o = null; - return r().then((i) => { - o = Ht.subscribe(d.throttle(r, 180, { leading: !1, trailing: !0 }), i.res); - }), () => o == null ? void 0 : o(); - }, s), t; -}, _n = (e) => { - const [t, n] = v.useState({ gridItems: [], hideItems: [] }); - return v.useEffect(() => { - e && I.get(`/api/_/${e}`).then(({ - pk: s, - uuid: r, - code: o, - resource: i, - align: c, - listenChangeFields: l, - listenChangeFieldsFunc: a, - fields: p - }) => ({ - pk: s, - uuid: r, - code: o, - resource: i, - align: c, - listenChangeFields: l, - listenChangeFieldsFunc: a, - ...p.reduce((g, m) => { - var h; - return (h = m == null ? void 0 : m.field) != null && h.hidden ? g.hides.push(m == null ? void 0 : m.field) : g.items.push(m), g; - }, { items: [], hides: [] }) - })).then(n); - }, [e]), t; -}, es = ({ - max: e = 0, - min: t = 0, - type: n = "", - message: s, - pattern: r, - required: o = !1, - validator: i -} = {}, c, l) => { - const [a, p] = k([]); - return L(() => { - const g = []; - if (o) { - let m = l; - switch (l) { - case "number": - case "string": - case "array": - break; - case "bool": - m = "boolean"; - break; - case "json": - m = "object"; - break; - } - g.push({ type: m, required: !0, whitespace: !0, message: "该项必填" }); - } - switch (n) { - case "string": - g.push({ - type: n, - max: e, - min: t, - message: s || (t && e ? `字符必须在 ${t} ~ ${e} 之间` : `${e ? "最多能有" : "最少要有"} ${t || e} 个字符`) - }); - break; - case "pattern": - g.push({ type: "string", pattern: r, message: s }); - break; - case "validator": - i && g.push(({ getFieldValue: m }) => ({ - validator: async (h, y) => { - const b = await ke.exec(i, { value: y, fieldName: c }, { getFieldValue: m }); - return d.isString(b) && b ? Promise.reject(b) : d.isBoolean(b) && !b ? Promise.reject(s) : Promise.resolve(); - } - })); - break; - } - p(g); - }, [e, t, n, s, r, o, i]), a; -}, ts = (e, t, n) => { - const [s, r] = k(null); - return L(() => { - const { - initDataUri: o = `/api/${e}`, - initDataMethod: i = "GET" - } = n || {}; - t && I.request({ - method: i, - url: d.trimEnd(`${o}/${t}`, "/") - }).then((c) => { - r(c); - }); - }, [e, t, n]), s; -}, ns = (e, t, n, s = {}) => { - const r = Bt(), o = K(!0), i = K([]), [c, l] = k(n), a = Ke.useWatch((p) => JSON.stringify(d.pick(p, i.current)), t) || "{}"; - return L(() => { - e && ke.exec(e, s, { - getFieldValue: d.wrap(t.getFieldValue, (p, g) => (i.current.some((m) => d.isEqual(m, g)) || (i.current.push(g), r()), p(g))), - isFieldTouched: t.isFieldTouched, - isFieldsTouched: t.isFieldsTouched - }).then((p) => o.current && l(p)); - }, [e, a, t, s]), L(() => () => o.current = !1, []), c; -}, ss = (e) => ({ - code: t, - layout: n, - name: s, - primaryKey: r = 0, - style: o = {}, - formProps: i = {}, - form: c, - isPreview: l = !1, - className: a, - onFinish: p, - onValuesChange: g = () => { - }, - ...m -}) => { - const { - align: h, - autoComplete: y, - resource: b, - items: N, - hides: w, - rowHeight: $, - marginX: E, - marginY: Q, - listenChangeFields: M, - listenChangeFieldsFunc: G, - pk: W, - uuid: z - } = _n(t), [O] = Me.useForm(c), D = ({ - changedValues: X, - allValues: x, - listenChangeFields: ut, - listenChangeFieldsFunc: je, - onValuesChange: Fe, - code: Et - }) => { - Fe(X, x), je && Array.isArray(ut) && ke.exec( - je, - { changedValues: X, allValues: x }, - { - getFieldValue: O.getFieldValue, - setFieldsValue: O.setFieldsValue, - isFieldTouched: O.isFieldTouched, - isFieldsTouched: O.isFieldsTouched - } - ); - }, oe = le(() => [ - { name: "__PK__", value: W }, - { name: "__PROPS__", value: i }, - { name: "__RESOURCE__", value: b }, - { name: "__LAYOUT_KEY__", value: t }, - { name: "__LAYOUT_UUID__", value: z }, - { name: "__PRIMARY_KEY__", value: r } - ], [W, t, z, b, r, i]); - return /* @__PURE__ */ Z( - Me, - { - className: a, - requiredMark: !0, - name: s || t, - layout: n || h, - fields: oe, - form: O, - autoComplete: y, - style: { ...o, position: "relative" }, - onFinish: p, - onValuesChange: (X, x) => D( - { - changedValues: X, - allValues: x, - listenChangeFields: M, - listenChangeFieldsFunc: G, - onValuesChange: g, - code: t - } - ), - children: [ - /* @__PURE__ */ f( - e, - { - ...m, - form: O, - code: t, - fields: N, - rowHeight: $, - marginX: E, - marginY: Q - } - ), - w == null ? void 0 : w.map((X) => { - var x; - return /* @__PURE__ */ f(Dt, { name: X.code, children: /* @__PURE__ */ f( - rs, - { - form: O, - name: X.code, - type: X.type, - initialValue: X.initialValue, - initialValueLanguage: (x = X.extras) == null ? void 0 : x.initialValueLanguage - } - ) }, JSON.stringify(X.code)); - }) - ] - } - ); -}, rs = ({ type: e, initialValue: t, initialValueLanguage: n, onChange: s, form: r }) => { - const o = ns( - n == "javascript" && t, - r, - n == "javascript" ? void 0 : t, - {} - ); - return L(() => { - n == "javascript" ? s(d.toPrimitive(o, e)) : s(d.toPrimitive(t, e)); - }, [e, t, o]), null; -}, os = (e) => function({ code: n, data: s, ...r }) { - const [o, i] = k({ - resource: null, - cols: 12, - rowHeight: 21, - fields: [] - }); - return L(() => { - n && I.get(`/api/_/${n}`).then((c) => i(d.pick(c, ["resource", "cols", "rowHeight", "fields"]))); - }, [n]), (o == null ? void 0 : o.resource) && /* @__PURE__ */ f( - e, - { - ...r, - rowHeight: o.rowHeight, - cols: o.cols, - fields: o.fields, - data: o != null && o.resource ? { [o == null ? void 0 : o.resource]: s } : {} - } - ); -}, is = "RC_FORM_INTERNAL_HOOKS", Kt = (e, { - initialValue: t, - initialValueLanguage: n, - convertJs: s, - convertJsSetting: r, - type: o = "string" -}, i = null) => { - const c = K(!1), l = De(Wn), [a, p] = k(), [g, m] = k(n == "javascript" || !e ? void 0 : l.getFieldValue(e)), { registerWatch: h } = l.getInternalHooks(is) || {}; - return L(() => h == null ? void 0 : h((y, b, N) => { - if (!c.current) - return; - const w = d.get(b, e); - d.isEqual(w, g) || m(d.toPrimitive(w, o)); - }), [g]), L(() => { - n == "javascript" && t ? ke.exec(t, {}, { - getFieldValueForBasicForm: (y) => i ? i.getFieldValue(y) : l.getFieldValue(y), - getFieldValue: (y) => l.getFieldValue(y) - }).then((y) => m(d.toPrimitive(y, o))).catch((y) => notification.error({ message: `布局数据错误: ${JSON.stringify(y)}` })).finally(() => c.current = !0) : (t && m(d.toPrimitive(t ?? l.getFieldValue(e), o)), c.current = !0); - }, [t, n]), lt(() => { - c.current && s && J.getWidgetComponent(s).then(({ default: y }) => y({ value: g, record: l.getFieldsValue(!0), $setting: r })).then(p).catch((y) => console.error("布局数据转换错误: ", y, s)); - }, [g, s, r]), [a || g, g]; -}, as = (e, t, n, s, r, o) => { - const i = { - "--grid-layout-h": `${s}`, - "--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"] = `${s}`, i["--grid-layout-box-margin"] = St(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"] = St(r == null ? void 0 : r.paddingTop, r == null ? void 0 : r.paddingRight, r == null ? void 0 : r.paddingBottom, r == null ? void 0 : r.paddingLeft), o && (i.height = `${o}px`), i; -}, St = (e, t, n, s) => `${e || 0}px ${t || 0}px ${n || 0}px ${s || 0}px`, Mt = ({ cols: e, rowHeight: t, fields: n, data: s, containerPadding: r = [0, 0], itemMargin: o = [4, 0], formProps: i = {}, className: c, ...l }) => { - const [a] = Ke.useForm(), p = At(n, ls, "@pkg/grid-layouts"), g = le(() => [ - { name: "__PROPS__", value: i } - ], [i]); - return lt(() => { - a.setFieldsValue(s); - }, [s]), /* @__PURE__ */ f(Ke, { fields: g, form: a, component: !1, children: /* @__PURE__ */ f( - "div", - { - ...l, - className: T("ff-grid-layout", c), - style: { - "--grid-layout-item-margin-y": `${(o == null ? void 0 : o[0]) || 0}px`, - "--grid-layout-item-margin-x": `${(o == null ? void 0 : o[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 || 12, - "--grid-layout-row-height": `${t || 21}px` - }, - children: p - } - ) }); -}, At = (e, t, n = "@pkg/grid-layouts", s = null) => le(() => { - var r; - return (r = d.sortBy(e, ["y", "x"])) == null ? void 0 : r.map( - ({ i: o, x: i, y: c, w: l, h: a, field: { boxStyle: p, widgetPrefix: g = n, widget: m, ...h } }, y) => /* @__PURE__ */ f( - "div", - { - className: "grid-layout-item", - style: as(i, c, l, a, p, m === "Height" && (h == null ? void 0 : h.initialValue)), - children: /* @__PURE__ */ f( - cs, - { - ...h, - basicForm: s, - itemWidget: m != null && m.startsWith("@") ? m : `${g}/${m}`, - itemWidgetRender: t - } - ) - }, - o || y - ) - ); -}, [e]), cs = ({ itemWidget: e, itemWidgetRender: t, basicForm: n, ...s }) => { - const [r, o] = k(); - return L(() => { - J.getWidgetComponent(e).then(({ defaultProps: i, default: c }) => { - o(v.createElement(t(c, i, n), s)); - }).catch((i) => o(e)); - }, [e]), r; -}, ls = (e, t, n = null) => (s) => { - const { - code: r, - label: o, - extras: i, - isVirtual: c, - initialValue: l, - initialValueLanguage: a, - convertJs: p, - convertJsSetting: g, - ...m - } = d.merge({}, t, s), [h, y] = Kt(c ? null : r, { - initialValue: l, - initialValueLanguage: a, - convertJs: p, - convertJsSetting: g, - type: (m == null ? void 0 : m.type) || "string" - }, n); - return /* @__PURE__ */ f(e, { ...m, value: h, rawValue: y, $setting: i || {} }); -}, ir = os(Mt), Jt = ({ widget: e, widgetPrefix: t, widgetDecorator: n, subWidgets: s, basicForm: r, ...o }) => { - const i = e != null && e.startsWith("@") ? e : `${t}/${e}`, [c, l] = k(); - return L(() => { - i && J.getWidgetComponent(i).then(({ defaultProps: a, default: p }) => ({ - default: Qt(p, a, r) - })).catch((a) => ({ default: () => `${a}` })).then((a) => l(v.createElement(a.default, o))); - }, [i]), c && v.cloneElement(c, o); -}; -Jt.defaultProps = { - widgetPrefix: "@pkg/grid-layout-forms", - widget: "Input" -}; -const Qt = (e, t, n = null) => (s) => { - const { - type: r, - code: o, - label: i, - noStyle: c, - placeholder: l, - extras: a, - validators: p, - help: g, - isVirtual: m, - initialValue: h, - initialValueLanguage: y, - convertJs: b, - convertJsSetting: N, - widgetPerfix: w, - boxStyle: $, - widgetDecorator: E, - subWidgets: Q, - ...M - } = { ...t, ...s }, G = es(p || {}, o, r), W = { - label: i, - noStyle: c, - colon: !1 - }, z = { - placeholder: l, - ...M - }, O = _((D) => D == null ? void 0 : d.toPrimitive(D, r), [r]); - return /* @__PURE__ */ f( - Dt, - { - name: o, - rules: G, - initialValue: O(h), - normalize: O, - children: (D, oe, X) => { - var x; - return /* @__PURE__ */ f( - e, - { - type: r, - rcform: X, - itemProps: { - validateStatus: oe.errors.length > 0 ? "error" : "success", - tooltip: g, - help: oe.errors.length > 0 ? oe.errors.join("、") : null, - required: ((x = G == null ? void 0 : G[0]) == null ? void 0 : x.required) || !1, - ...W - }, - fieldProps: { ...z, ...D }, - $setting: a || {} - } - ); - } - } - ); -}, Rt = ({ cols: e, rowHeight: t, itemMargin: n = [8, 8], containerPadding: s = [0, 0], fields: r }) => { - const o = At(r, Qt, "@pkg/grid-layout-forms"); - return /* @__PURE__ */ f(jt, { theme: { components: { Form: { itemMarginBottom: 0 } } }, children: /* @__PURE__ */ f("div", { className: "ff-grid-layout-form", style: { - "--grid-layout-item-margin-x": `${(n == null ? void 0 : n[0]) || 0}px`, - "--grid-layout-item-margin-y": `${(n == null ? void 0 : n[1]) || 0}px`, - "--grid-layout-container-padding-y": `${(s == null ? void 0 : s[0]) || 0}px`, - "--grid-layout-container-padding-x": `${(s == null ? void 0 : s[1]) || 0}px`, - "--grid-layout-cols": e || 24, - "--grid-layout-row-height": `${t || 16}px` - }, children: o }) }); -}; -Rt.propTypes = { - fields: S.array.isRequired -}; -Rt.defaultProps = { - fields: [] -}; -const us = ss(Rt), qt = ({ children: e }) => { - const [t, n] = k({}), s = _((o, i) => n((c) => ({ ...c, [o]: i })), []), r = _((o) => n((i) => ({ ...i, [o]: void 0 })), []); - return /* @__PURE__ */ f(Xe.Provider, { value: { ele: t, mount: s, unmount: r }, children: e }); -}; -qt.defaultProps = { - isDrawerRender: !1 -}; -qt.propTypes = { - isDrawerRender: S.bool -}; -const _t = (e = {}, t = {}, n = {}, s = "") => d.deepSome(e, (r, o) => o === "type" && r === "code") ? en(e, t, n, s) : tn(e, t, s), en = async (e = {}, t = {}, n = {}, s = "") => { - let r = /* @__PURE__ */ Object.create(null); - for (let o in e) { - let i; - if (Reflect.has(e[o], "type") && ["code", "field", "router", "query", "string"].includes(e[o].type)) { - const { type: c, value: l = "", default: a = s } = e[o]; - switch (c) { - case "code": - i = await ke.exec(l, t, n); - break; - case "field": - i = d.get(t, l) ?? d.get(t, l.substring(l.indexOf(".") + 1)); - break; - case "router": - case "query": - i = Re.getPageParams(l); - break; - case "string": - i = l; - } - i ?? (i = a); - } else - i = await en(e[o], t, n, s); - d.set(r, o, i); - } - return r; -}, tn = (e = {}, t = {}, n = "") => Object.keys(e || {}).reduce((s, r) => { - if (d.isPlainObject(e[r])) { - let o; - if (Reflect.has(e[r], "type") && ["field", "router", "query", "string"].includes(e[r].type)) { - const { type: i, value: c = "", default: l = n } = e[r]; - switch (i) { - case "field": - o = d.get(t, c) ?? d.get(t, c.substring(c.indexOf(".") + 1)); - break; - case "router": - case "query": - o = Re.getPageParams(c); - break; - case "string": - o = c; - break; - } - o ?? (o = l); - } else - o = tn(e[r], t, n); - d.set(s, r, o); - } - return s; -}, {}), ds = ({ - className: e, - itemClassName: t, - classNames: n, - dataSource: s, - isPaginate: r, - pageSize: o, - isItemOperations: i, - isBatchOperations: c, - batchOperations: l, - itemOperations: a, - itemOperationsAccess: p, - resource: g, - primaryKey: m, - title: h, - itemGridLayout: y, - $setting: b, - isTreeSider: N, - treeSiderConfig: w -}) => { - const { getBase62params: $, onClickCallback: E } = De(Ze), { total: Q, page: M } = $() || {}, G = _((W, z, O) => /* @__PURE__ */ f( - fs, - { - className: T("ff-data-list-framework-item", t), - operations: i && z ? a == null ? void 0 : a.filter((D) => !m || !D.uuid || !p.has(D.uuid) ? !0 : p.get(D.uuid).includes(z == null ? void 0 : z[m])) : [], - data: g ? { [g]: z } : z, - children: W, - onClickCallback: E - } - ), [g, m, i, E, a, p]); - return /* @__PURE__ */ Z("div", { className: T("ff-data-list-framework", e), children: [ - /* @__PURE__ */ f(Ft, { className: n == null ? void 0 : n.sider, isTreeSider: N, ...w }), - /* @__PURE__ */ Z("div", { className: T("ff-data-list-container", n == null ? void 0 : n.container), children: [ - /* @__PURE__ */ f(sn, { className: n == null ? void 0 : n.filter }), - /* @__PURE__ */ f(rn, { title: h, className: n == null ? void 0 : n.toolbar }), - /* @__PURE__ */ f( - ln, - { - ...y, - className: n == null ? void 0 : n.content, - style: { "--col-num": (b == null ? void 0 : b.colNum) || 1 }, - primaryKey: m, - itemRender: G, - dataSource: s - } - ), - /* @__PURE__ */ f( - on, - { - className: n == null ? void 0 : n.footer, - isPaginate: r, - isOperations: c, - operations: l, - total: Q, - page: M, - pageSize: o - } - ) - ] }) - ] }); -}, fs = ({ className: e, operations: t, children: n, data: s, onClickCallback: r }) => /* @__PURE__ */ Z("div", { className: T("data-list-grid-layout-item-container", e), children: [ - n, - !!(t != null && t.length) && /* @__PURE__ */ f("div", { className: "data-list-grid-layout-item-actions", children: t.map((o) => /* @__PURE__ */ f("span", { className: "data-list-grid-layout-item-action", children: /* @__PURE__ */ f( - C.Link, - { - uuid: o.uuid, - type: o.type, - name: o.name, - widget: o.widget, - widgetType: o.widgetType, - widgetProps: o.widgetProps, - widgetSetting: o.widgetSetting, - widgetContainerProps: o.widgetContainerSetting, - data: s, - onAfterClick: (i) => i !== !1 && (r == null ? void 0 : r(o.isRefresh, s)) - }, - o.uuid || useId() - ) }, (o == null ? void 0 : o.uuid) || useId())) }) -] }), ps = ({ - className: e, - itemClassName: t, - dataSource: n, - columns: s, - isItemOperations: r, - isBatchOperations: o, - batchOperations: i, - itemOperations: c, - itemOperationsAccess: l, - resource: a, - primaryKey: p, - title: g, - isPaginate: m, - pageSize: h, - isTreeSider: y, - treeSiderConfig: b, - ...N -}) => { - const { getBase62params: w, onClickCallback: $ } = De(Ze), { total: E, page: Q } = w() || {}; - return /* @__PURE__ */ Z("div", { className: T("ff-data-table-framework", e), children: [ - /* @__PURE__ */ f(Ft, { isTreeSider: y, ...b }), - /* @__PURE__ */ Z("div", { className: "ff-data-table-container", children: [ - /* @__PURE__ */ f(sn, {}), - /* @__PURE__ */ f(rn, { title: g }), - /* @__PURE__ */ f( - cn, - { - ...N, - className: "ff-data-table-content", - columns: s, - dataSource: n, - operationRender: (M) => /* @__PURE__ */ f("div", { className: "ff-data-table-actions", children: c == null ? void 0 : c.reduce((G, W, z) => [ - ...G, - /* @__PURE__ */ f( - C.Link, - { - size: "small", - uuid: W.uuid, - type: W.type, - name: W.name, - widget: W.widget, - widgetType: W.widgetType, - widgetProps: W.widgetProps, - widgetSetting: W.widgetSetting, - widgetContainerProps: W.widgetContainerSetting, - data: M, - onAfterClick: (O) => O !== !1 && ($ == null ? void 0 : $(W.isRefresh, data)) - }, - W.uuid || z - ) - ], []) }) - } - ), - /* @__PURE__ */ f( - on, - { - isPaginate: m, - isOperations: o, - operations: i, - total: E, - page: Q, - pageSize: h - } - ) - ] }) - ] }); -}, Ze = v.createContext({ - getBase62params: (e, t) => { - }, - onReload: () => { - }, - onClickCallback: () => { - }, - onConditonChange: () => { - }, - onTabChange: () => { - }, - onSiderChange: () => { - }, - onKeywordChange: () => { - }, - onPageChange: () => { - }, - onPageSizeChange: () => { - } -}), nn = ({ - isItemGridLayout: e, - theme: t, - themeProps: n, - onClickCallback: s, - onReload: r, - getBase62params: o, - onPageChange: i, - onPageSizeChange: c, - onTabChange: l, - onSiderChange: a, - onKeywordChange: p, - onConditonChange: g, - ...m -}) => { - const [h, y] = k(); - return L(() => { - t ? J.getWidgetComponent(t).then((b) => { - if (!b) - throw `${t} not found`; - return b; - }).catch((b) => ({ default: () => `${b}` })).then((b) => y(v.createElement(b.default, { ...m, $setting: n }))) : h || y(null); - }, [t, n]), /* @__PURE__ */ f(Ze.Provider, { value: { - onClickCallback: s, - onReload: r, - getBase62params: o, - onPageChange: i, - onPageSizeChange: c, - onTabChange: l, - onSiderChange: a, - onKeywordChange: p, - onConditonChange: g - }, children: h ? v.cloneElement(h, { ...m, $setting: n }) : e ? /* @__PURE__ */ f(ds, { ...m, $setting: n }) : /* @__PURE__ */ f(ps, { ...m, $setting: n }) }); -}; -nn.defaultProps = { - onReload: () => { - }, - getBase62params: () => { - } -}; -const hs = (e, t, n, s, r) => { - const o = v.lazy(() => J.getWidgetComponent(e).catch((i) => ({ default: () => `${i}` }))); - return /* @__PURE__ */ f(v.Suspense, { children: /* @__PURE__ */ f( - o, - { - value: t, - record: n, - $setting: s, - base62params: r - } - ) }, e); -}, gs = (e, t = {}) => (Gt(e), Gt(t), le(() => e == null ? void 0 : e.map(({ widgetByJs: s, widgetByJsSetting: r, ...o }, i) => s && !s.endsWith("/BasicShowFieldData") ? { - ...o, - render: (c, l) => { - const a = hs(s, c, l, r, t); - return d.isFunction(o == null ? void 0 : o.render) ? o.render(a, c, l) : a; - } -} : o), [e, t])), ar = (e) => { - const [t, n] = k({}); - return L(() => { - let s = !1; - return e && I.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) => !s && n(r)), () => s = !0; - }, [e]), t; -}, cr = (e, t = {}) => { - const [n, s] = k({ dataSource: [] }); - return lt(() => { - let r = !1; - return e && I.get(`/api/${e}/${I.encode({ page: 1, ...t })}`).then((o) => !r && s(o)), () => r = !0; - }, [e, t]), n; -}, $t = (e, t = null, n = null, s = "id") => le(() => { - if (d.isEmpty(e) || !e.every(({ uuid: o }) => Vs.check(o))) - return !1; - if (d.isEmpty(n) || d.isEmpty(t)) - return !0; - const r = t.map((o) => o == null ? void 0 : o[s]); - return e.some(({ uuid: o }) => !o || !n.has(o) ? !0 : n.get(o).some((i) => r.includes(i))); -}, [e, t, n, s]), kt = v.forwardRef(({ listCode: e, base62params: t, className: n, itemClassName: s, theme: r, themeProps: o, classNames: i }, c) => { - const [{ tab: l, page: a, total: p, condition: g, sider: m, keyword: h, dataSource: y, itemOperationsAccess: b, pageSize: N }, w] = qn(t), [{ - resource: $, - primaryKey: E, - batchOperations: Q = [], - itemOperations: M = [], - columns: G = [], - themeConfig: W, - theme: z, - isTreeSider: O, - treeSiderConfig: D, - isItemGridLayout: oe, - itemGridLayout: X, - title: x, - isPaginate: ut - }, je] = k({ isItemGridLayout: !1, itemGridLayout: {} }), Fe = (j) => I.list(e, { tab: l, page: a, total: p, condition: g, sider: m, keyword: h, ...j }).then(({ - condition: H, - total: ue, - tab: Ve, - page: de, - pageSize: Le, - operationsAccess: ie, - dataSource: B - }) => { - w({ - dataSource: B, - pageSize: Le, - total: ue, - page: de, - tab: Ve, - condition: H, - sider: m, - keyword: h, - itemOperationsAccess: new Map(ie) - }); - }), Et = $t(M, y, b, E), pn = $t(Q); - L(() => { - let j = null; - return e && I.get(`/api/_/${e}`).resp(({ data: H, res: ue }) => { - H != null && H.isDynamicRefresh && (j = Ht.subscribe(() => Fe(), ue)), je(H); - }).catch(() => je({})), w((H) => ({ ...H, dataSource: [] })), () => j == null ? void 0 : j(); - }, [e]), L(() => { - e && Fe(t); - }, [t]); - const hn = () => { - }, gn = () => { - }, mn = () => { - }, yn = () => { - }, bn = (j, H) => Fe({ page: j, pageSize: H }), vn = (j) => Fe({ pageSize: j, page: 1 }), Cn = (j, H) => { - const ue = { tab: l, sider: m, keyword: h, page: a, pageSize: N, condition: g, total: p }; - return j ? d.get(ue, j, H) : ue; - }, tt = () => { - Fe(); - }, Wt = (j = 0, H = null) => { - if (j === 2) { - const ue = d.get(H, "__PARENT_ID__", ""), Ve = d.get(H, E, d.get(H, [$, E], "")), de = d.findIndex(y, ["__PARENT_ID__", ue]), Le = d.findIndex(de > -1 ? d.get(y, [de, "children"]) : y, [E, Ve]); - Le > -1 ? (I.get(`/api/${e}/detail/${Ve}`).then((ie) => { - w((B) => { - const Ne = d.get(B.dataSource, de > -1 ? [de, "children", Le, "children"] : [Le, "children"]); - return { - ...B, - dataSource: de > -1 ? Tt(B.dataSource, { [de]: { children: { $splice: [[Le, 1, { ...ie, children: Ne }]] } } }) : Tt(B.dataSource, { $splice: [[Le, 1, { ...ie, children: Ne }]] }) - }; - }); - }), I.post(`/api/${e}/list-operations-access`, { ids: Ve }).then((ie) => new Map(ie)).then((ie) => { - w((B) => (B.itemOperationsAccess.forEach((Ne, Ie) => { - var Pt; - (Pt = ie.get(Ie)) != null && Pt.some((dt) => dt == Ve) || B.itemOperationsAccess.set(Ie, Ne.filter((dt) => dt !== Ve)); - }), ie.forEach((Ne, Ie) => { - B.itemOperationsAccess.has(Ie) ? B.itemOperationsAccess.set(Ie, d.uniq([...B.itemOperationsAccess.get(Ie) || [], ...Ne])) : B.itemOperationsAccess.set(Ie, Ne); - }), { ...B })); - })) : tt(); - } else - j === 1 && tt(); - }; - return v.useImperativeHandle(c, () => ({ - onReload: tt, - onClickCallback: Wt - })), /* @__PURE__ */ f( - nn, - { - ...{ - title: x, - itemClassName: s, - classNames: i, - resource: $, - primaryKey: E, - theme: r || z, - themeProps: o || W, - isPaginate: ut, - pageSize: N, - page: a, - isTreeSider: O, - treeSiderConfig: D, - isItemOperations: Et, - isBatchOperations: pn, - batchOperations: Q, - itemOperations: M, - itemOperationsAccess: b, - dataSource: y, - isItemGridLayout: oe, - columns: G, - itemGridLayout: X - }, - className: T("ff-data-list-helper", n), - getBase62params: Cn, - onReload: tt, - onClickCallback: Wt, - onConditonChange: hn, - onTabChange: gn, - onSiderChange: mn, - onKeywordChange: yn, - onPageChange: bn, - onPageSizeChange: vn - } - ); -}), sn = ({ className: e }) => (v.useContext(Ze), /* @__PURE__ */ Z("div", { className: T("ff-data-list-filter", e), children: [ - /* @__PURE__ */ f( - Tn, - { - placeholder: "关键字", - style: { width: "30%", maxWidth: 300 }, - prefix: /* @__PURE__ */ f(Ct, { type: "icon-search" }) - } - ), - /* @__PURE__ */ Z("div", { className: "ff-data-list-actions", children: [ - /* @__PURE__ */ f(C, { children: "重置" }), - /* @__PURE__ */ f(C, { type: "primary", children: "查询" }), - /* @__PURE__ */ f( - C.Link, - { - className: "ff-data-list-filter-submit-button", - type: "primary", - name: "展开", - icon: "icon-down", - iconPosition: "end" - } - ) - ] }) -] })), ms = [ - { title: "全部", className: "active" }, - { title: "运行中" }, - { title: "已上线" } -], rn = ({ className: e, title: t }) => /* @__PURE__ */ Z("div", { className: T("ff-data-list-toolbar", e), children: [ - /* @__PURE__ */ f("div", { className: "ff-data-list-title", children: t }), - /* @__PURE__ */ f(Gn, { className: "ff-data-list-tabs", items: ms }), - /* @__PURE__ */ Z("div", { className: "ff-data-list-actions", children: [ - /* @__PURE__ */ f(C.Link, { icon: "icon-reload" }), - /* @__PURE__ */ f(C.Link, { icon: "icon-setting" }) - ] }) -] }), ys = [ - { - 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: /* @__PURE__ */ f( - "span", - { - style: { - color: "#1677ff" - }, - children: "sss" - } - ), - key: "0-0-1-0" - } - ] - } - ] - } -], Ft = ({ className: e, width: t, isTreeSider: n }) => n ? /* @__PURE__ */ f( - Sn.DirectoryTree, - { - className: T("ff-data-list-sider", e), - style: { "--sider-width": t }, - showLine: !0, - showIcon: !1, - treeData: ys - } -) : null; -Ft.defaultProps = { - width: 280 -}; -const on = ({ className: e, operations: t, isOperations: n, isPaginate: s, total: r, page: o, pageSize: i }) => { - const { onPageChange: c, onPageSizeChange: l, onClickCallback: a } = v.useContext(Ze); - return n && !d.isEmpty(t) || s ? /* @__PURE__ */ Z("div", { className: T("ff-data-list-footer", e), children: [ - /* @__PURE__ */ f("div", { className: "ff-data-list-actions", children: t == null ? void 0 : t.map((p, g) => /* @__PURE__ */ f( - C, - { - uuid: p.uuid, - type: p.type, - name: p.name, - widget: p.widget, - widgetType: p.widgetType, - widgetProps: p.widgetProps, - widgetSetting: p.widgetSetting, - widgetContainerProps: p.widgetContainerSetting, - onAfterClick: (m) => m !== !1 && (a == null ? void 0 : a(p.isRefresh, null)) - }, - p.uuid || g - )) }), - s && /* @__PURE__ */ f( - $n, - { - size: "small", - total: r, - pageSize: i, - showSizeChanger: !1, - showTotal: (p) => `第 ${o} 页 / 总共 ${p} 条`, - onChange: c, - onShowSizeChange: l - } - ) - ] }) : null; -}, an = (e, t, n = !0) => n !== !0 && n-- <= 0 ? [] : d.isArray(e) && !d.isEmpty(e) ? e.reduce((s, r) => (Reflect.has(r, t) && Reflect.has(r, "children") && s.push(r[t]), Reflect.has(r, "children") && !d.isEmpty(r.children) ? s.concat(an(r.children, t, n)) : s), []) : [], cn = ({ - className: e, - primaryKey: t, - columns: n, - dataSource: s, - operationRender: r, - operationWidth: o, - ...i -}) => { - const c = K(null), l = K(null), [a, p] = k([]), [g, m] = k({ width: 0, height: 0 }); - L(() => { - p(an(s, t)); - }, [s, t]), Fn(() => { - const y = new ResizeObserver(() => { - var b; - m({ - width: ((b = c.current) == null ? void 0 : b.nativeElement.querySelector(".ant-table-body").scrollWidth) || l.current.offsetWidth, - height: l.current.offsetHeight - }); - }); - return l.current && y.observe(l.current), () => { - l.current && y.unobserve(l.current); - }; - }, []); - const h = gs(n); - return /* @__PURE__ */ f("div", { ref: l, className: T("ff-data-list-table", e), children: g.height ? /* @__PURE__ */ f( - zn, - { - ...i, - ref: c, - rowKey: (y, b) => (y == null ? void 0 : y[t]) ?? b, - columns: h == null ? void 0 : h.concat(r ? [{ - title: "操作", - align: "center", - fixed: "right", - width: `${Math.ceil(o / g.width * 100).toFixed(2)}%`, - render: (y, b, N) => r(b, N) - }] : []), - dataSource: s, - size: "middle", - scroll: { x: "max-content", y: g.height - 47 }, - pagination: !1, - expandable: { - defaultExpandAllRows: !0, - expandRowByClick: !0, - onExpandedRowsChange: p, - expandedRowKeys: a - } - } - ) : null }); -}; -cn.defaultProps = { - operationWidth: 180, - columns: [], - dataSource: [] -}; -const bs = ({ widget: e, widgetPrefix: t, basicForm: n, ...s }) => { - const r = e != null && e.startsWith("@") ? e : `${t}/${e}`, [o, i] = k(); - return L(() => { - r && J.getWidgetComponent(r).then(({ defaultProps: c, default: l }) => ({ - default: vs(l, c, n) - })).catch((c) => ({ default: () => `${c}` })).then((c) => i(v.createElement(c.default, s))); - }, [r]), o; -}, vs = (e, t, n = null) => (s) => { - const { - code: r, - label: o, - extras: i, - isVirtual: c, - initialValue: l, - initialValueLanguage: a, - convertJs: p, - convertJsSetting: g, - value: m, - ...h - } = d.merge({}, t, s), [y, b] = Kt(c ? null : r, { - initialValue: l, - initialValueLanguage: a, - convertJs: p, - convertJsSetting: g, - type: (h == null ? void 0 : h.type) || "string" - }, n); - return /* @__PURE__ */ f(e, { ...h, value: y, rawValue: b, $setting: i || {} }); -}; -bs.defaultProps = { - widgetPrefix: "@pkg/grid-layouts" -}; -const ln = ({ - cols: e, - rowHeight: t, - itemMargin: n, - fields: s, - primaryKey: r, - itemRender: o, - dataSource: i, - itemClassName: c, - empty: l, - className: a, - style: p -}) => { - const g = Vn(), m = le(() => /* @__PURE__ */ f( - Mt, - { - cols: e, - rowHeight: t, - itemMargin: n, - fields: s, - className: c - } - ), [s, e, t, n]); - return /* @__PURE__ */ f("div", { className: T("ff-data-list-content", a), style: p, children: d.isEmpty(i) ? l : i == null ? void 0 : i.map((h, y) => /* @__PURE__ */ f(v.Fragment, { children: o(v.cloneElement(m, { data: h }), h, y) }, `${g}-${(h == null ? void 0 : h[r]) || y}`)) }); -}; -ln.defaultProps = { - itemRender: (e, t, n) => e, - empty: /* @__PURE__ */ f(On, { description: null }), - style: {} -}; -const Cs = (e, t, { isReplaceRouteHistory: n = !1 } = {}) => Re.redirect(t, e, { replace: n }), zt = (e, t, { status: { loading: n, disabled: s }, setStatus: r }) => { - const o = { - loading: (i) => i === void 0 ? n : r((c) => ({ ...c, loading: i })), - disabled: (i) => i === void 0 ? s : r((c) => ({ ...c, disabled: i })) - }; - return d.isFunction(t) ? t.call(null, { ...e, ...o }) : d.isString(t) && t ? ke.exec(t, e, o) : null; -}, Ot = (e, t, n, s) => d.isString(t) && t ? J.getWidgetComponent(t).then(({ default: r }) => V.modal( - r, - { ...e, $setting: n }, - s -)).catch((r) => { - V.error(t, { content: r.toString() }); -}) : V.modal( - t, - { ...e, $setting: n }, - s -), Rs = (e, t, n, s) => V.modal( - un, - { ...e, $setting: n, code: t }, - s -), ks = (e, t, n, s) => V.modal( - kt, - { base62params: e, $setting: n, listCode: t }, - s -), Fs = ({ - widget: e, - widgetType: t, - widgetData: n, - widgetProps: s, - widgetSetting: r, - widgetContainerProps: o -}, { onAfterClick: i, onBeforeClick: c }) => { - const l = De(Ze); - De(dn); - const [a, p] = k({ leading: !0, trailing: !1 }), g = le(() => { - switch (t) { - case "redirect": - return d.partialRight(Cs, e, r); - case "func": - return d.partialRight(zt, (r == null ? void 0 : r.code) ?? e, { status: a, setStatus: p }); - case "fsdpf-component": - return d.partialRight(Ot, e, r, o); - case "grid-layout-form": - return d.partialRight(Rs, e, r, o); - case "data-list": - return d.partialRight(ks, e, r, o); - default: - if (wt(e) || v.isValidElement(e)) - return d.partialRight(Ot, e, r, o); - if (d.isFunction(e)) - return d.partialRight(zt, (r == null ? void 0 : r.code) || e, { status: a, setStatus: p }); - } - return (...h) => console.error("useButton unknown widgetType", t, ...h); - }, [e, t]); - return [d.debounce((h) => (c == null || c(h), Promise.resolve(_t(s, h, { list: l })).then((y) => g({ ...n, ...y })).then((y) => i == null ? void 0 : i(y)).catch(console.error)), 300, { leading: !0, trailing: !1 }), a]; -}; -var pe, Se; -const te = class te { - constructor() { - R(this, Se, null); - F(this, "init", (t) => U(this, Se, new Map(t))); - F(this, "check", (t) => !u(this, Se).has(t) || u(this, Se).get(t)); - if (u(te, pe)) - return u(te, pe); - } -}; -pe = new WeakMap(), Se = new WeakMap(), R(te, pe, null), F(te, "getInstance", () => (u(te, pe) || U(te, pe, new te()), u(te, pe))); -let pt = te; -const Vs = pt.getInstance(), et = (e) => function({ - className: n, - children: s, - name: r, - icon: o, - type: i, - data: c, - noAuthType: l, - onAfterClick: a, - onBeforeClick: p, - loading: g, - disabled: m, - tooltip: h, - popConfirm: y, - widget: b, - widgetType: N, - widgetData: w, - widgetProps: $, - widgetSetting: E, - widgetContainerProps: Q, - ...M -}) { - const G = { - type: "primary", - className: T("ff-button", n) - }; - i === "danger" ? G.danger = !0 : i === "default" && (G.type = i), e === "link" || e === "dashed" ? (G.type = e, i === "default" && (G.className = T(G.className, "ff-default"))) : (e === "circle" || e === "round") && (G.shape = e), o && (G.icon = /* @__PURE__ */ f(Ct, { type: o })); - const [W, z] = k(!1), [O, { disabled: D, loading: oe }] = Fs({ widget: b, widgetType: N, widgetData: w, widgetProps: $, widgetSetting: E, widgetContainerProps: Q }, { onAfterClick: a, onBeforeClick: p }); - return /* @__PURE__ */ f( - xn, - { - okText: "确定", - cancelText: "取消", - ...y || {}, - disabled: D || m, - open: W, - onOpenChange: (x) => { - if (!x) - return z(x); - y ? z(x) : O(c); - }, - onConfirm: () => { - O(c); - }, - onClick: (x) => { - x.stopPropagation(); - }, - children: /* @__PURE__ */ f(Un, { ...h, title: W ? null : h == null ? void 0 : h.title, trigger: ["hover", "click"], children: /* @__PURE__ */ f( - Dn, - { - loading: oe || g, - disabled: D || m, - ...G, - ...M, - children: s || r - } - ) }) - } - ); -}, C = et("default"), Ls = et("link"), Ns = et("circle"), Is = et("round"), ws = et("dashed"), Vt = ({ data: e, widget: t, widgetType: n, children: s, widgetData: r, widgetProps: o, widgetSetting: i, widgetContainerProps: c }) => { - const l = De(Ze), [a, p] = k(!1), [g, m] = k("hover"), [h, y] = k({}), [b, N] = k(); - L(() => { - n == "grid-layout-form" ? N(v.createElement(un, { ...r, $setting: i, code: t })) : n == "data-list" ? N(v.createElement(kt, { base62params: e, $setting: i, listCode: t })) : d.isString(t) ? J.getWidgetComponent(t).then(({ default: E }) => { - N(v.createElement(E, { ...r, $setting: i })); - }).catch((E) => N(E.toString())) : wt(t) ? N(v.createElement(t, { ...r, $setting: i })) : v.isValidElement(t) && N(v.cloneElement(t, { ...r, $setting: i })); - }, [t, n, r]), L(() => { - Promise.resolve(_t(o, e, { list: l })).then(y); - }, [o, e]); - const w = (E) => { - p(E), !E && m("hover"); - }, $ = () => { - p(!0), m("click"); - }; - return /* @__PURE__ */ f( - Xn, - { - zIndex: 1e3, - ...c, - onPopupClick: $, - onClick: $, - open: a, - trigger: g, - content: /* @__PURE__ */ f(Es, { children: b && v.cloneElement(b, { ...h, $close: () => w(!1) }) }), - children: s, - onOpenChange: w, - overlayClassName: "ff-popup ff-popover" - } - ); -}, Es = ({ children: e }) => { - const [t, n] = k({}), s = _((o, i) => n((c) => ({ ...c, [o]: i })), []), r = _((o) => n((i) => ({ ...i, [o]: void 0 })), []); - return /* @__PURE__ */ Z(Xe.Provider, { value: { ele: t, mount: s, unmount: r }, children: [ - t != null && t.title || t != null && t["sub-title"] ? /* @__PURE__ */ Z("div", { className: "ff-popup-header", children: [ - (t == null ? void 0 : t.title) || /* @__PURE__ */ f("div", { className: "ff-popup-title" }), - (t == null ? void 0 : t["sub-title"]) || /* @__PURE__ */ f("div", { className: "ff-popup-sub-title" }) - ] }) : null, - e, - t != null && t.extras || t != null && t.actions ? /* @__PURE__ */ Z("div", { className: "ff-popup-footer", children: [ - (t == null ? void 0 : t.extras) || /* @__PURE__ */ f("div", { className: "ff-popup-extras" }), - (t == null ? void 0 : t.actions) || /* @__PURE__ */ f("div", { className: "ff-popup-actions" }) - ] }) : null - ] }); -}; -Vt.defaultProps = { - widgetType: "fsdpf-component" -}; -Vt.propTypes = { - widgetType: S.oneOf(["fsdpf-component", "grid-layout-form", "data-list"]) -}; -C.defaultProps = { - type: "default", - iconPosition: "start" -}; -C.propTypes = { - type: S.oneOf(["primary", "default", "danger", ""]), - name: S.string, - // 按钮名称 - icon: S.string, - // 图标 - iconPosition: S.oneOf(["start", "end"]), - // 图标位置 - data: S.any, - // onClick 数据源, 会受到 widgetProps 数据结构影响 - widget: S.any, - // 组件 - widgetType: S.oneOf(["destroy", "redirect", "func", "fsdpf-component", "grid-layout-form", "grid-layout", "data-list"]), - // 组件类型 - widgetData: S.object, - // onClick缺省数据 - widgetProps: S.object, - // data 数据结构 - widgetSetting: S.object, - // $setting - widgetContainerProps: S.object - // 容器配置 -}; -C.Link = Ls; -C.Link.defaultProps = C.defaultProps; -C.Link.propTypes = C.propTypes; -C.Circle = Ns; -C.Circle.defaultProps = C.defaultProps; -C.Circle.propTypes = C.propTypes; -C.Round = Is; -C.Round.defaultProps = C.defaultProps; -C.Round.propTypes = C.propTypes; -C.Dashed = ws; -C.Dashed.defaultProps = C.defaultProps; -C.Dashed.propTypes = C.propTypes; -C.Popover = Vt; -const un = ({ $setting: e, $close: t, extras: n, code: s, primaryKey: r, ...o }) => { - const [i] = Me.useForm(), c = ts(s, r, e); - L(() => { - c && i.setFieldsValue(c); - }, [c]); - const l = () => { - const a = i.getFieldValue("__RESOURCE__"), { - initDataUri: p = `/api/${s}` - } = e || {}; - i.validateFields(!0).then((g) => a ? d.pick(g, [a]) : g).then((g) => I.post(r ? `${p}/${r}` : `${p}`, g).msg(t)).catch(() => V.error("请先完善表单信息", { duration: 2e3 })); - }; - return /* @__PURE__ */ f( - Y, - { - actions: /* @__PURE__ */ Z(v.Fragment, { children: [ - /* @__PURE__ */ f(C, { name: "保存", type: "primary", widget: l }), - /* @__PURE__ */ f(C, { name: "取消", widget: () => t(!1) }) - ] }), - extras: n, - children: /* @__PURE__ */ f(us, { form: i, code: s, primaryKey: r, ...o }) - } - ); -}, Ws = (e, t, n = "children") => { - if (d.isEmpty(e)) - return {}; - const s = d.find(e, ["value", t]); - if (!d.isEmpty(s)) - return s; - const r = e.length; - for (let o = 0; o < r; o++) { - const { [n]: i } = e[o], c = Ws(i, t, n); - if (!d.isEmpty(c)) - return c; - } - return {}; -}, Ps = ({ fields: e, formProps: t, $close: n }) => { - const [s] = Me.useForm(), r = () => s.validateFields(!0).then(n), o = le(() => [ - { name: "__PROPS__", value: t } - ], [t]); - return /* @__PURE__ */ f(Y, { actions: /* @__PURE__ */ Z(v.Fragment, { children: [ - /* @__PURE__ */ f(C, { name: "取消", widget: () => n(!1) }), - /* @__PURE__ */ f(C, { name: "确定", type: "primary", widget: () => r() }) - ] }), children: /* @__PURE__ */ f(jt, { theme: { components: { Form: { itemMarginBottom: 6 } } }, children: /* @__PURE__ */ f(Me, { fields: o, layout: "vertical", form: s, children: e == null ? void 0 : e.map(({ code: i, ...c }) => /* @__PURE__ */ f(Jt, { code: i, ...c }, i)) }) }) }); -}; -var st, $e, he, rt, ot, Ae, it, ze; -const Ge = class Ge extends v.Component { - constructor(n) { - super(n); - R(this, st, null); - R(this, $e, 0); - R(this, he, /* @__PURE__ */ new Map()); - R(this, rt, (n) => new Promise((s) => { - const r = He(this, $e)._++; - u(this, he).set(r, v.createElement(Mn, { - ...n, - key: r, - $close: (o) => u(this, ze).call(this, r, () => s(o)) - })), this.forceUpdate(); - })); - R(this, ot, (n, s) => new Promise((r) => { - const o = He(this, $e)._++; - u(this, he).set(o, v.createElement(An, { - ...s, - content: n, - key: o, - $close: (i) => u(this, ze).call(this, o, () => r(i)) - })), this.forceUpdate(); - })); - R(this, Ae, (n, s, { mode: r, ...o } = {}) => new Promise((i) => { - const c = He(this, $e)._++, l = { current: null }; - u(this, he).set(c, v.createElement( - r == "drawer" ? Jn : Qn, - { - ref: l, - key: c, - maskClosable: !1, - ...o, - $close: (a) => u(this, ze).call(this, c, () => i(a)) - }, - v.createElement(n, { - ...s, - $close: (a) => l.current.handleClose(a) - }) - )), this.forceUpdate(); - })); - R(this, it, (n, s = {}, r = {}) => u(this, Ae).call(this, Ps, { formProps: r, fields: n }, s).then((o) => { - if (o === !1) - throw !1; - return o; - })); - R(this, ze, (n, s) => { - u(this, he).delete(n), this.forceUpdate(s); - }); - Ge.modal = u(this, Ae), Ge.notification = u(this, rt), Ge.confirm = u(this, ot), Ge.form = u(this, it); - } - componentWillUnmount() { - var n, s; - (s = (n = u(this, st)) == null ? void 0 : n[1]) == null || s.call(n); - } - render() { - const n = Array.from(u(this, he)); - return /* @__PURE__ */ f(v.Fragment, { children: n.map(([s, r]) => r) }); - } -}; -st = new WeakMap(), $e = new WeakMap(), he = new WeakMap(), rt = new WeakMap(), ot = new WeakMap(), Ae = new WeakMap(), it = new WeakMap(), ze = new WeakMap(); -let V = Ge; -V.notification = ({ title: e, content: t, icon: n, category: s, ...r }) => Promise.resolve(Xt[s || "open"]({ - ...r, - icon: n ? /* @__PURE__ */ f(Ct, { type: n || "" }) : void 0, - message: e, - description: t -})); -V.success = (e, t = {}) => V.notification({ title: e, category: "success", ...t }); -V.error = (e, t = {}) => V.notification({ title: e, category: "error", ...t }); -V.confirm = (e, t = {}) => V.notification({ content: e, ...t }); -V.form = (e, t = {}) => V.notification({ title: e, ...t }); -V.modal = (e = {}) => V.notification(e); -const ht = "mine", Lt = "token", Zs = "web", Ts = 60 * 60 * 24 * 30, Nt = () => { - const e = window.localStorage.getItem(Lt); - if (!e) - return ""; - const t = e.split("."); - if (!Array.isArray(t) || t.length !== 3) - throw "登录令牌无效!"; - const { iat: n } = JSON.parse(window.atob(t[1])); - if (Math.floor((/* @__PURE__ */ new Date()).getTime() / 1e3) - n > Ts) - throw "登录令牌已过期, 请重新登录!"; - return e; -}, Gs = () => { - try { - return !!Nt(); - } catch { - return !1; - } -}, lr = (e = !0) => { - var t; - try { - const n = Nt(); - if (!n) - return Promise.resolve(null); - const { iat: s } = JSON.parse(window.atob((t = n == null ? void 0 : n.split(".")) == null ? void 0 : t[1])), { iat: r, ...o } = I.decode(window.localStorage.getItem(ht) || "", {}); - return r === s ? Promise.resolve(o) : I.get("/api/mine-info").then(({ User: i = null }) => (window.localStorage.setItem(ht, I.encode({ ...i, iat: s })), i)); - } catch (n) { - console.error(n), e && V.error("请登录").then(Ss); - } - return Promise.resolve(null); -}, ur = (e, t, n = {}) => I.post("/api/user-token", { - username: e, - passwd: Ln.hash(t), - platform: Zs, - ...n -}).then(({ token: s }) => (window.localStorage.setItem(Lt, s), s)), Ss = () => { - window.localStorage.removeItem(ht), window.localStorage.removeItem(Lt); -}; -Ye.configure({ showSpinner: !1 }); -Be.interceptors.request.use((e) => { - e.headers.Platform = "web", e.headers.SaaS = window.localStorage.getItem("SaaS"); - try { - const t = Nt(); - e.headers.Authorization = t ? `Bearer ${t} ` : void 0; - } catch { - } - return Ye.inc(), e; -}, (e) => (Ye.done(), Promise.reject({ code: -1, msg: e }))); -Be.interceptors.response.use(({ data: e, headers: t }) => (Ye.done(), { ...e, res: t == null ? void 0 : t.res }), function(e) { - return Ye.done(), Promise.reject(e.message); -}); -window.addEventListener("unhandledrejection", vt.onUnhandledRejection); -vt.onMsg = (e, t) => V[[0, 1].includes(e) ? "success" : "error"](t).then(() => e === 20300 && Re.redirect(Pe.get("Common.WEBSITE_LOGIN_PAGE"))); -const $s = v.createContext({ - user: {}, - initUser: () => { - }, - initUserComplete: !1 -}), dn = v.createContext({ - set: () => { - }, - get: () => { - }, - assign: () => { - }, - currentRoute: () => { - } -}); -var Oe, Je, xe, ce, Ee, We; -class fn { - constructor(t, n) { - R(this, Oe, /* @__PURE__ */ new Map()); - R(this, Je, !0); - R(this, xe, []); - R(this, ce, void 0); - R(this, Ee, () => u(this, ce)); - R(this, We, () => Promise.resolve()); - F(this, "get", (...t) => new Promise((n, s) => { - const r = JSON.stringify(t); - if (u(this, Oe).has(r)) - return n(u(this, We).call(this, u(this, ce), ...t)); - if (u(this, ce) === void 0) - u(this, xe).push([t, n, s]), u(this, Je) && (U(this, Je, !1), Promise.resolve(typeof u(this, Ee) == "function" ? u(this, Ee).call(this) : u(this, Ee)).then((o) => U(this, ce, o || null)).finally(() => { - u(this, xe).forEach(([o, i, c]) => { - try { - const l = u(this, We).call(this, u(this, ce), ...o); - u(this, Oe).set(JSON.stringify(o), l), i(l); - } catch (l) { - c(l); - } - }), u(this, xe).length = 0; - })); - else { - const o = u(this, We).call(this, u(this, ce), ...t); - u(this, Oe).set(r, o), n(o); - } - })); - U(this, We, n), U(this, Ee, t); - } -} -Oe = new WeakMap(), Je = new WeakMap(), xe = new WeakMap(), ce = new WeakMap(), Ee = new WeakMap(), We = new WeakMap(); -var ge, Qe; -const ne = class ne { - constructor() { - R(this, Qe, null); - F(this, "init", (t) => U(this, Qe, t)); - F(this, "get", (t, n) => d.get(u(this, Qe), t, n)); - if (u(ne, ge)) - return u(ne, ge); - } -}; -ge = new WeakMap(), Qe = new WeakMap(), R(ne, ge, null), F(ne, "getInstance", () => (u(ne, ge) || U(ne, ge, new ne()), u(ne, ge))); -let gt = ne; -const Pe = gt.getInstance(), zs = ({ component: e }) => { - const { base62params: t } = Hn(); - return /* @__PURE__ */ f(Y, { children: /* @__PURE__ */ f( - kt, - { - listCode: e, - base62params: I.decode(t) - } - ) }); -}, Os = ({ component: e, $setting: t }) => { - const [n, s] = k(); - L(() => { - if (!e) - return s(/* @__PURE__ */ f(Empty, { description: null })); - J.getWidgetComponent(e).catch((o) => ({ default: () => `${o}` })).then((o) => v.createElement(o.default, { $setting: t })).then(s); - }, [e]); - const r = {}; - return n ? v.cloneElement(n, r) : null; -}; -var me, q, ye, be, qe, _e; -const se = class se { - constructor() { - R(this, q, /* @__PURE__ */ new Map()); - R(this, ye, {}); - R(this, be, null); - F(this, "init", (t, n) => { - U(this, q, t), U(this, ye, n); - }); - F(this, "get", (t) => (u(this, q).has(t) || (t = Array.from(u(this, q).keys()).find((n) => u(this, q).get(n).uri === t)), u(this, q).get(t) || {})); - F(this, "redirect", (t, n, s = {}) => { - const { uri: r, type: o, widgetProps: i } = this.get(t) || {}; - let c = Bn(r || t, o != "list" ? n : d.mapValues(n, (a) => I.encode(a))); - const l = new URLSearchParams(); - for (const a in i || {}) - (i == null ? void 0 : i.type) == "query" && l.append(a, n[a]); - return l.size > 0 && (c = `${c}?${l.toString()}`), u(this, be).navigate(c, s); - }); - /** - * - * @param {*} category // user, system, navigator - * @returns - */ - F(this, "getMenus", (t) => { - var n; - return ((n = u(this, ye)) == null ? void 0 : n[t]) || []; - }); - F(this, "findMenuPathByUuid", (t) => { - let n = []; - for (const s in u(this, ye)) - if (n = u(this, qe).call(this, u(this, ye)[s], t, [s]), n.length > 1) - return n; - return n; - }); - F(this, "getMenusByRouteUuid", (t) => u(this, _e).call(this, t, Object.values(u(this, ye)).flat())); - R(this, qe, (t, n, s = []) => { - if (d.isEmpty(t)) - return s; - for (const { uuid: r, children: o } of t) { - if (r == n) - return s.concat(r); - if (!d.isEmpty(o)) - return s.concat(r, u(this, qe).call(this, o, n)); - } - return s; - }); - R(this, _e, (t, n) => { - var r; - let s = []; - for (const o of n) - o.widgetType == "redirect" && (o.uuid == t || o.widget == t ? s.push(o) : (r = o.children) != null && r.length && (s = s.concat(u(this, _e).call(this, t, o.children)))); - return s; - }); - F(this, "getCurrentMenu", () => { - const { uuid: t } = this.getCurrentRoute() || {}; - if (!t) - return; - const n = this.getMenusByRouteUuid(t); - if (!d.isEmpty(n)) - return n[0]; - }); - F(this, "getCurrentRoute", (t = 0) => { - var s; - const n = (s = u(this, be).state.matches[u(this, be).state.matches.length - 1 - t]) == null ? void 0 : s.route; - if (!n) - return null; - for (let [r, o] of u(this, q)) - if (o.uri === n.path) - return o; - return null; - }); - F(this, "getPageParams", (t) => { - var o; - const { location: n, matches: s } = u(this, be).state, r = ((o = s[s.length - 1]) == null ? void 0 : o.params) || {}; - return n.search && new URLSearchParams(n.search).forEach((i, c) => { - r[c] = i; - }), t ? d.get(r, t) : r; - }); - F(this, "createBrowserRouter", (t = {}) => { - if (u(this, q).size == 0) - return null; - const n = Pe.get("Common.WEBSITE_DEFAULT_THEME", "@pkg/frameworks/BasicLayout"), s = Pe.get(Gs() ? "Common.WEBSITE_LOGIN_REDIRECT" : "Common.WEBSITE_DEFAULT", "/index"), r = { [n]: 0 }, o = Array.from(u(this, q).values()).reduce((i, { uuid: c, uri: l, name: a, type: p, component: g, widgetSetting: m, isLogin: h, isLayout: y, extra: b }) => { - let N = {}, w = 0; - switch (p) { - case "list": - N.element = v.createElement(zs, { component: g }); - break; - case "fsdpf-component": - N.element = v.createElement(Os, { key: g, component: g, $setting: m }); - break; - } - if (b != null && b.layout) - if (r[b == null ? void 0 : b.layout]) - w = r[b == null ? void 0 : b.layout]; - else - return r[b == null ? void 0 : b.layout] = i.length, [...i, { - path: "/", - lazy: () => J.getWidgetComponent(b == null ? void 0 : b.layout).then(($) => ({ Component: $.default })), - children: [{ path: l, ...N }] - }]; - return y && w > -1 ? (i[w].children.push({ path: l, ...N }), i) : [...i, { path: l, ...N }]; - }, [ - { - path: "/", - lazy: () => J.getWidgetComponent(n).then((i) => ({ Component: i.default })), - children: [] - } - ]); - return o.push({ index: !0, element: v.createElement(Yn, { to: s, replace: !0 }) }), U(this, be, Kn(o, t)); - }); - if (u(se, me)) - return u(se, me); - } -}; -me = new WeakMap(), q = new WeakMap(), ye = new WeakMap(), be = new WeakMap(), qe = new WeakMap(), _e = new WeakMap(), R(se, me, null), F(se, "getInstance", () => (u(se, me) || U(se, me, new se()), u(se, me))); -let mt = se; -const Re = mt.getInstance(), Te = new Worker(new URL("data:text/plain;base64,KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO2ltcG9ydFNjcmlwdHMoImh0dHBzOi8vYXNzZXRzLmZzZHBmLm5ldC9qcy91bWQvbG9kYXNoQDRfMTdfMjEubWluLmpzIiwiaHR0cHM6Ly9hc3NldHMuZnNkcGYubmV0L2pzL3VtZC9sb2Rhc2gubWl4aW4uanMiKSxpbXBvcnRTY3JpcHRzKCJodHRwczovL2Fzc2V0cy5mc2RwZi5uZXQvanMvdW1kL21vbWVudEAyXzI5XzQubWluLmpzIiwiaHR0cHM6Ly9hc3NldHMuZnNkcGYubmV0L2pzL3VtZC9tb21lbnQubG9jYWxlLnpoLWNuLmpzIiksbW9tZW50LmxvY2FsZSgiemgtY24iKTtjb25zdCBVdGlsPShlLHMpPT57Y29uc3QgdD1VdGlsLm1zZ19pZCsrO3JldHVybiBuZXcgUHJveHkoKCk9Pnt9LHtnZXQoe3Jvb3Q6YX0sbil7Y29uc3Qgbz1hP2Ake2F9LyR7bn1gOm47cmV0dXJuIGZ1bmN0aW9uKC4uLmkpe3JldHVybiBuZXcgUHJvbWlzZSgocixsKT0+e1V0aWwubVF1ZXVlLnNldCh0LFtyLGxdKSxzZWxmLnBvc3RNZXNzYWdlKHtpZDp0LHRhc2tfaWQ6ZSxzZXNzaW9uOnMsY2F0ZWdvcnk6InV0aWwiLG1ldGhvZDpvLGFyZ3M6aX0pfSl9fSxhcHBseShhLG4sbyl7cmV0dXJuIG5ldyBQcm94eShPYmplY3QuY3JlYXRlKHtyb290Om9bMF18fG51bGx9KSx7Z2V0OnRoaXMuZ2V0fSl9fSl9O1V0aWwubXNnX2lkPTAsVXRpbC5tUXVldWU9bmV3IE1hcCxVdGlsLm1NZXRob2RXb3Jrc3BhY2U9bmV3IE1hcCxzZWxmLmFkZEV2ZW50TGlzdGVuZXIoIm1lc3NhZ2UiLGZ1bmN0aW9uKHtkYXRhOntpZDplLGRhdGE6cyxlcnJvcjp0LGNhdGVnb3J5OmF9fSl7YT09PSJ1dGlsIiYmKHQhPT1udWxsP1V0aWwubVF1ZXVlLmdldChlKVsxXSh0KTpVdGlsLm1RdWV1ZS5nZXQoZSlbMF0ocyksVXRpbC5tUXVldWUuZ2V0KGUpLFV0aWwubVF1ZXVlLmRlbGV0ZShlKSl9LCExKSxzZWxmLmFkZEV2ZW50TGlzdGVuZXIoIm1lc3NhZ2UiLCh7ZGF0YTp7aWQsbWV0aG9kLGFyZ3MsY2F0ZWdvcnksc2Vzc2lvbixzb3VyY2VVUkx9fSk9PntpZihjYXRlZ29yeSE9PSJldmFsIilyZXR1cm47c2Vzc2lvbiYmIVV0aWwubU1ldGhvZFdvcmtzcGFjZS5oYXMoc2Vzc2lvbikmJlV0aWwubU1ldGhvZFdvcmtzcGFjZS5zZXQoc2Vzc2lvbix7fSk7Y29uc3QgZXZhbERhdGFTb3VyY2VVUkw9c291cmNlVVJMP2AKLy8jIHNvdXJjZVVSTD1mZjovLy8uLyR7c291cmNlVVJMfWA6IiIsZXZhbERhdGE9ZXZhbChgKGFzeW5jIGZ1bmN0aW9uKHske09iamVjdC5rZXlzKGFyZ3MpLmpvaW4oIiwgIil9fSwgVXRpbCl7JHttZXRob2R9Cn0pJHtldmFsRGF0YVNvdXJjZVVSTH1gKS5jYWxsKHNlc3Npb24/VXRpbC5tTWV0aG9kV29ya3NwYWNlLmdldChzZXNzaW9uKTp7fSxhcmdzLFV0aWwoaWQsc2Vzc2lvbikpO3JldHVybiBQcm9taXNlLnJlc29sdmUoZXZhbERhdGEpLnRoZW4oZT0+e3NlbGYucG9zdE1lc3NhZ2Uoe2lkLHNlc3Npb24sY2F0ZWdvcnksZGF0YTplLGVycm9yOm51bGx9KX0pLmNhdGNoKGU9PntzZWxmLnBvc3RNZXNzYWdlKHtpZCxzZXNzaW9uLGNhdGVnb3J5LGRhdGE6bnVsbCxlcnJvcjplIGluc3RhbmNlb2YgRE9NRXhjZXB0aW9uJiZlLm5hbWU9PT0iRGF0YUNsb25lRXJyb3IiPyJEYXRhQ2xvbmVFcnJvciDov5Tlm57nu5Pmnpzlj6rog73kuLrnroDljZXmlbDmja7moLzlvI8iOmV9KX0pfSksc2VsZi5hZGRFdmVudExpc3RlbmVyKCJtZXNzYWdlIiwoe2RhdGE6e2NhdGVnb3J5OmUsc2Vzc2lvbjpzfX0pPT57ZT09PSJjbGVhciImJlV0aWwubU1ldGhvZFdvcmtzcGFjZS5kZWxldGUocyl9LCExKX0pKCk7Cg==", self.location)), xt = { - getConfigure: (e) => Pe.get(e), - route: { - redirect: (...e) => Re.redirect(...e), - getPageParams: (...e) => Re.getPageParams(...e), - getCurrentRoute: () => Re.getCurrentRoute() - }, - modal: { - notification: (...e) => V.notification(...e), - success: (...e) => V.success(...e), - error: (...e) => V.error(...e), - form: (...e) => V.form(...e) - }, - popup: { - notification: (...e) => V.notification(...e), - success: (...e) => V.success(...e), - error: (...e) => V.error(...e), - form: (...e) => V.form(...e) - } -}; -var at, Ue, ve; -const P = class P { - constructor() { - F(this, "exec", (t, n = {}, s = {}, r = "") => new Promise((o, i) => { - const c = He(P, at)._++; - u(P, Ue).set(c, s), P.mQueue.set(c, [o, i]), Te.postMessage({ id: c, session: r, category: "eval", method: t, args: n }); - })); - F(this, "clear", (t) => Te.postMessage({ session: t, category: "clear" })); - if (u(P, ve)) - return u(P, ve); - Promise.resolve().then(() => xs).then((t) => { - xt.http = t.http; - }), Te.addEventListener("message", ({ data: { id: t, task_id: n, method: s, args: r, category: o, data: i, error: c, session: l } }) => { - if (o === "eval" && P.mQueue.has(t)) - c !== null ? P.mQueue.get(t)[1](c) : P.mQueue.get(t)[0](i), u(P, Ue).delete(t), P.mQueue.delete(t); - else if (o === "util") - try { - const a = d.get(xt, s.split("/")) || d.get(u(P, Ue).get(n), s.split("/")); - if (!d.isFunction(a)) - throw `${s} not found`; - Promise.resolve(Reflect.apply(a, void 0, r)).then((p) => { - Te.postMessage({ id: t, task_id: n, category: o, method: s, args: r, session: l, data: p, error: null }); - }).catch((p) => { - Te.postMessage({ id: t, task_id: n, category: o, method: s, args: r, session: l, data: null, error: p }); - }); - } catch (a) { - Te.postMessage({ id: t, task_id: n, category: o, method: s, args: r, session: l, data: null, error: a }); - } - }, !1); - } -}; -at = new WeakMap(), Ue = new WeakMap(), ve = new WeakMap(), F(P, "mQueue", /* @__PURE__ */ new Map()), R(P, at, 0), R(P, Ue, /* @__PURE__ */ new Map()), R(P, ve, null), F(P, "getInstance", () => (u(P, ve) || U(P, ve, new P()), u(P, ve))); -let yt = P; -const ke = yt.getInstance(); -var Ce, A; -const re = class re { - constructor() { - R(this, A, /* @__PURE__ */ new Map()); - F(this, "setVendor", (t, n) => u(this, A).set(t, new fn(n, (s, r) => s.dynamicRequireFsdpfComponent(r)))); - F(this, "getWidgetComponent", async (t) => { - if (!t) - throw "getWidgetComponent widget is required"; - const [, n] = t == null ? void 0 : t.split("@ff/"), [, s] = t == null ? void 0 : t.split("@app/"), [, r] = t == null ? void 0 : t.split("@pkg/"), [, o] = t == null ? void 0 : t.split("@fsdpf/"); - try { - switch (!0) { - case (!!n && u(this, A).has("pkg")): - return await u(this, A).get("pkg").get(n); - case (!!s && u(this, A).has("pkg")): - return await u(this, A).get("pkg").get(s); - case (!!r && u(this, A).has("pkg")): - return await u(this, A).get("pkg").get(r); - case (!!o && u(this, A).has("pkg")): - return await u(this, A).get("pkg").get(o); - } - } catch (i) { - throw i; - } - }); - if (u(re, Ce)) - return u(re, Ce); - } -}; -Ce = new WeakMap(), A = new WeakMap(), R(re, Ce, null), F(re, "getInstance", () => (u(re, Ce) || U(re, Ce, new re()), u(re, Ce))); -let bt = re; -const J = bt.getInstance(), Ut = { - null2json: (e) => null, - null2array: (e) => null, - null2number: (e) => null, - null2bool: (e) => null, - null2string: (e) => null, - null2integer: (e) => null, - null2float: (e) => null, - // null2json: (data) => ({}), - // null2array: (data) => ([]), - // null2number: (data) => 0, - // null2bool: (data) => false, - // null2string: (data) => '', - string2json: (e) => e ? JSON.parse(e) : "{}", - string2array: (e) => e.substr(0, 1) === "[" && e.substr(-1) === "]" ? JSON.parse(e) : e.split(","), - string2number: (e) => e == "" ? null : +e, - string2integer: (e) => e == "" ? null : +e, - string2float: (e) => e == "" ? null : +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" -}; -d.mixin({ - toPairsDeep: (e, t) => d.flatMap( - d.toPairs(e), - ([n, s]) => d.isObjectLike(s) ? d.toPairsDeep(s, n) : [[`${d.isUndefined(t) ? "" : t + "."}${n}`, s]] - ), - deepSome: (e, t = () => !1) => d.some(e, (n) => { - if (d.some(n, t)) - return !0; - if (!d.isEmpty(n) && (d.isPlainObject(n) || d.isArray(n))) - return d.deepSome(n, t); - }), - toPrimitive: (e, t) => { - let n = "string"; - Array.isArray(e) ? n = "array" : n = typeof e, d.isObject(e) && (n = "json"); - const s = `${n}2${t}`; - return Reflect.has(Ut, s) ? Ut[s](e) : e; - }, - replaceKeys: (e, t) => !e || typeof e != "object" ? e : Array.isArray(e) ? e.map((n) => d.replaceKeys(n, t)) : Object.keys(e).reduce((n, s) => (t[s] ? n[t[s]] = d.replaceKeys(e[s], t) : n[s] = d.replaceKeys(e[s], t), n), {}) -}); -let It = ""; -const I = { - init: (e, t, n) => { - Be.defaults.baseURL = It = n, Be.defaults.timeout = 15e3, Object.assign(I, new vt(e, t, Be)); - } -}, wt = (e) => { - var t; - return e && (e == null ? void 0 : e.name) && ((e == null ? void 0 : e.prototype) instanceof v.Component || (e == null ? void 0 : e.name.substr(0, 1)) === ((t = e.name.substr(0, 1)) == null ? void 0 : t.toUpperCase())); -}, xs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ - __proto__: null, - AppGlobalParamsContext: dn, - get AppUrl() { - return It; - }, - cache: fn, - configure: Pe, - core: J, - default: $s, - func: ke, - http: I, - isReactComponent: wt, - route: Re -}, Symbol.toStringTag, { value: "Module" })), dr = () => I.get("/api/my-router").then((e) => [ - ...e, - { uuid: "data-list-setting", isLayout: !0, uri: "/data-list-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/components/ff-design/DataListSetting", extra: { layout: "@pkg/frameworks/DesignTheme" } }, - { uuid: "grid-layout-setting", isLayout: !0, uri: "/grid-layout-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/components/ff-design/GridLayoutSetting", extra: { layout: "@pkg/frameworks/DesignTheme" } }, - { uuid: "grid-layout-form-setting", isLayout: !0, uri: "/grid-layout-form-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/components/ff-design/GridLayoutFormSetting", extra: { layout: "@pkg/frameworks/DesignTheme" } }, - { uuid: "resource-api-setting", isLayout: !0, uri: "/resource-api-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/components/ff-design/ResourceApiSetting", extra: { layout: "@pkg/frameworks/DesignTheme" } }, - { uuid: "charts-setting", isLayout: !0, uri: "/resource-api-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/components/ff-design/ChartsSetting", extra: { layout: "@pkg/frameworks/DesignTheme" } }, - { uuid: "fsm-setting", isLayout: !0, uri: "/fsm-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/components/ff-design/FsmSetting", extra: { layout: "@pkg/frameworks/DesignTheme" } }, - { uuid: "component-setting", isLayout: !0, uri: "/component-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/components/ff-design/ComponentSetting", extra: { layout: "@pkg/frameworks/DesignTheme" } }, - { uuid: "login", uri: "/login", name: "登录", type: "fsdpf-component", isLogin: !1, component: "@pkg/components/ff/Login" }, - { uuid: "not-found", uri: "*", name: "Not Found", type: "fsdpf-component", isLogin: !1, component: "@pkg/components/ff/NotFound" } -].map(({ uuid: t, ...n }) => [t, { uuid: t, ...n }])).then((e) => new Map(e)), fr = () => I.get("/api/my-menu"), pr = () => I.get("api/init-configure"), hr = () => I.get("/api/init-widget-operation-auth").then((e) => e.reduce((t, { uuid: n, auth: s }) => [...t, [n, s]], [])), gr = (e) => I.get(`/api/user-wx-phone-number/${e}`); -export { - Pe as $, - $t as A, - C as B, - Fs as C, - nn as D, - Vs as E, - Y as F, - ir as G, - us as H, - Rt as I, - Jt as J, - un as K, - ns as L, - Ws as M, - Ct as N, - Nt as O, - Gs as P, - lr as Q, - Ht as R, - Xe as S, - ur as T, - Ss as U, - It as V, - I as W, - wt as X, - $s as Y, - dn as Z, - fn as _, - sr as a, - ke as a0, - J as a1, - Re as a2, - dr as a3, - fr as a4, - pr as a5, - hr as a6, - gr as a7, - Gt as b, - qn as c, - lt as d, - rr as e, - or as f, - nr as g, - qt as h, - V as i, - an as j, - Mt as k, - bs as l, - sn as m, - rn as n, - Ft as o, - on as p, - kt as q, - Ze as r, - cn as s, - ln as t, - Bt as u, - ds as v, - hs as w, - gs as x, - ar as y, - cr as z -}; diff --git a/dist/common/main-DamvcBIJ.js b/dist/common/main-DamvcBIJ.js new file mode 100644 index 0000000..c867c77 --- /dev/null +++ b/dist/common/main-DamvcBIJ.js @@ -0,0 +1,2245 @@ +var __defProp = Object.defineProperty; +var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: !0, configurable: !0, writable: !0, value }) : obj[key] = value; +var __publicField = (obj, key, value) => (__defNormalProp(obj, typeof key != "symbol" ? key + "" : key, value), value), __accessCheck = (obj, member, msg) => { + if (!member.has(obj)) + throw TypeError("Cannot " + msg); +}; +var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj)), __privateAdd = (obj, member, value) => { + if (member.has(obj)) + throw TypeError("Cannot add the same private member more than once"); + member instanceof WeakSet ? member.add(obj) : member.set(obj, value); +}, __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value); +var __privateWrapper = (obj, member, setter, getter) => ({ + set _(value) { + __privateSet(obj, member, value, setter); + }, + get _() { + return __privateGet(obj, member, getter); + } +}); +import _ from "lodash"; +import axios from "axios"; +import React, { useMemo, useEffect, useRef, useState, useCallback, useContext, useLayoutEffect, useId as useId$1 } from "react"; +import Request from "ff-request"; +import SparkMD5 from "https://assets.fsdpf.net/js/esm/spark-md5@3_0_2.min.js?url"; +import { jsx, jsxs, Fragment } from "react/jsx-runtime"; +import { QuestionOutlined, LoadingOutlined, createFromIconfontCN } from "@ant-design/icons"; +import cx from "classnames"; +import { P as PropTypes, N as NProgress } from "./vender-CMS8SASe.js"; +import Form, { Field, FieldContext } from "rc-field-form"; +import { notification as notification$1, Drawer as Drawer$1, Modal as Modal$1, Form as Form$1, ConfigProvider, Input, Button as Button$1, Breadcrumb, Tree, Pagination, Table, Empty as Empty$1, Popconfirm, Tooltip, Popover as Popover$1 } from "antd"; +import { flushSync } from "react-dom"; +import update from "immutability-helper"; +import { useParams, generatePath, Navigate, createBrowserRouter } from "react-router-dom"; +const Iconfont = ({ type, className, ...props }) => { + if (!(type != null && type.startsWith("icon-"))) + return /* @__PURE__ */ jsx(QuestionOutlined, {}); + if (type === "icon-loading") + return /* @__PURE__ */ jsx(LoadingOutlined, { className, ...props }); + const Icon = useMemo(() => createFromIconfontCN({ scriptUrl: configure.get("Common.ICONFONT", []) }), [configure.get("Common.ICONFONT")]); + return /* @__PURE__ */ jsx(Icon, { type, className: cx("iconfont", className), ...props }); +}, Notification = ({ className, title, content, icon, $close, category, duration = 4.5 }) => { + const [api, contextHolder] = notification$1.useNotification(); + return useEffect(() => { + api[category || "open"]({ + className, + message: title, + description: content, + icon, + duration, + onClose: () => $close(!1) + }); + }, [title, content, icon]), contextHolder; +}, Confirm = ({ className, title, content, okText, $close, duration = 5e3 }) => { + var _a; + const timeRef = useRef(), [time, setTime] = useState(); + return useEffect(() => (time > 0 && (timeRef.current = setTimeout(() => { + time <= 1 ? $close() : setTime((time2) => time2 - 1); + }, 1e3)), () => clearTimeout(timeRef.current)), [time]), useEffect(() => { + setTime(Math.max(Math.ceil(duration / 1e3), 0)); + }, [duration]), /* @__PURE__ */ jsx("div", { className: cx("ff-confirm", className), onClick: (e) => e.mpEvent.currentTarget.id === e.mpEvent.target.id && $close(), children: /* @__PURE__ */ jsxs("div", { className: "ff-confirm-container", children: [ + /* @__PURE__ */ jsx("div", { className: "ff-confirm-title", children: title }), + /* @__PURE__ */ jsx("div", { className: "ff-confirm-content", children: content }), + /* @__PURE__ */ jsxs("div", { className: "ff-confirm-operations", children: [ + /* @__PURE__ */ jsxs("div", { className: "ff-confirm-cancel", onClick: () => $close(!1), children: [ + "取消 (", + time, + ")" + ] }), + React.isValidElement(okText) ? React.cloneElement(okText, { + onClick: () => $close(!0), + className: cx("ff-confirm-ok", (_a = okText.props) == null ? void 0 : _a.className) + }) : /* @__PURE__ */ jsx("div", { className: "ff-confirm-ok", onClick: () => $close(!0), children: okText || "确定" }) + ] }) + ] }) }); +}, SlotContext = React.createContext({ + ele: {}, + mount: () => { + }, + unmount: () => { + } +}), FFContainer = ({ className, children, actions, title, subTitle, extras, style }) => (actions && FFContainer.Action({ children: actions }), title && FFContainer.Title({ children: title }), subTitle && FFContainer.SubTitle({ children: subTitle }), extras && FFContainer.Extra({ children: extras }), /* @__PURE__ */ jsx("div", { className: cx("ff-container", className), style, children })), slot = (name) => ({ children, className }) => { + const { mount, unmount } = React.useContext(SlotContext); + return useEffect(() => (mount(name, React.createElement("div", { + key: `ff-${name}`, + className: cx(`ff-popup-${name}`, className) + }, children)), () => unmount(name)), [className, children]), null; +}; +FFContainer.Action = slot("actions"); +FFContainer.Title = slot("title"); +FFContainer.SubTitle = slot("sub-title"); +FFContainer.Extra = slot("extras"); +const SlotRender = ({ name }) => { + const { ele } = React.useContext(SlotContext); + return ele == null ? void 0 : ele[name]; +}; +FFContainer.propTypes = { + // 容器 className + className: PropTypes.string, + // 容器样式 + style: PropTypes.object, + // 标题占位符 + title: PropTypes.any, + // 副标题占位符 + subTitle: PropTypes.any, + // 操作按钮占位符 + actions: PropTypes.any, + // 扩展安装占位符 + extras: PropTypes.any +}; +FFContainer.defaultProps = { + style: {} +}; +const Drawer = React.forwardRef(({ $close, children, className, title, ...props }, ref) => { + const closeCarryRef = useRef(), [open, setOpen] = useState(!0), [ele, setEle] = useState({}), onMount = useCallback((solt, ele2) => setEle((state) => ({ ...state, [solt]: ele2 })), []), onUnmount = useCallback((solt) => setEle((state) => ({ ...state, [solt]: void 0 })), []); + return React.useImperativeHandle(ref, () => ({ + handleClose: (result) => { + closeCarryRef.current = result, setOpen(!1); + } + })), /* @__PURE__ */ jsx(SlotContext.Provider, { value: { ele, mount: onMount, unmount: onUnmount }, children: /* @__PURE__ */ jsx( + Drawer$1, + { + ...props, + title: title || (ele == null ? void 0 : ele.title), + open, + onClose: () => { + closeCarryRef.current = !1, setOpen(!1); + }, + afterOpenChange: (open2) => !open2 && $close(closeCarryRef.current), + className: cx("ff-popup ff-drawer", className, ele == null ? void 0 : ele.className), + extra: ele == null ? void 0 : ele["sub-title"], + classNames: { header: "ff-popup-header", footer: "ff-popup-footer" }, + footer: ele != null && ele.extras || ele != null && ele.actions ? /* @__PURE__ */ jsxs(React.Fragment, { children: [ + (ele == null ? void 0 : ele.extras) || /* @__PURE__ */ jsx("div", { className: "ff-popup-extras" }), + (ele == null ? void 0 : ele.actions) || /* @__PURE__ */ jsx("div", { className: "ff-popup-actions" }) + ] }) : void 0, + children + } + ) }); +}), Modal = React.forwardRef(({ $close, children, className, title, ...props }, ref) => { + const closeCarryRef = useRef(), [open, setOpen] = useState(!0), [ele, setEle] = useState({}), onMount = useCallback((solt, ele2) => setEle((state) => ({ ...state, [solt]: ele2 })), []), onUnmount = useCallback((solt) => setEle((state) => ({ ...state, [solt]: void 0 })), []); + return React.useImperativeHandle(ref, () => ({ + handleClose: (result) => { + closeCarryRef.current = result, setOpen(!1); + } + })), /* @__PURE__ */ jsx(SlotContext.Provider, { value: { ele, mount: onMount, unmount: onUnmount }, children: /* @__PURE__ */ jsx( + Modal$1, + { + ...props, + title: /* @__PURE__ */ jsxs(Fragment, { children: [ + title || (ele == null ? void 0 : ele.title), + ele == null ? void 0 : ele["sub-title"] + ] }), + open, + onCancel: () => { + closeCarryRef.current = !1, setOpen(!1); + }, + afterOpenChange: (open2) => !open2 && $close(closeCarryRef.current), + className: cx("ff-popup ff-modal", className, ele == null ? void 0 : ele.className), + keyboard: !0, + classNames: { header: "ff-popup-header", footer: "ff-popup-footer" }, + footer: ele != null && ele.extras || ele != null && ele.actions ? /* @__PURE__ */ jsxs(React.Fragment, { children: [ + (ele == null ? void 0 : ele.extras) || /* @__PURE__ */ jsx("div", { className: "ff-popup-extras" }), + (ele == null ? void 0 : ele.actions) || /* @__PURE__ */ jsx("div", { className: "ff-popup-actions" }) + ] }) : null, + children + } + ) }); +}); +var _instance, _oWorker, _topic, _initWorker; +const _ResWs = class _ResWs { + constructor() { + __privateAdd(this, _oWorker, null); + __privateAdd(this, _topic, /* @__PURE__ */ new Map()); + __privateAdd(this, _initWorker, () => { + if (__privateGet(this, _oWorker)) + return __privateGet(this, _oWorker).port.postMessage({ command: "status", data: [] }); + __privateSet(this, _oWorker, new SharedWorker(new URL("data:text/plain;base64,Y29uc3QgcG9ydHMgPSBbXQpsZXQgd3MgPSBudWxsCgpmdW5jdGlvbiBpbml0V3ModXJsKSB7CiAgd3MgPSBuZXcgV2ViU29ja2V0KHVybCkKICB3cy5vbmNsb3NlID0gKGUpID0+IGNvbnNvbGUubG9nKCd3cyBjbG9zZWQnLCBlKQogIHdzLm9uZXJyb3IgPSAoZSkgPT4gY29uc29sZS5sb2coJ3dzIGVycm9yJywgZSkKICB3cy5vbm1lc3NhZ2UgPSAoeyBkYXRhIH0pID0+IHsKICAgIGNvbnN0IHZhbHVlID0gSlNPTi5wYXJzZShkYXRhKQogICAgcG9ydHMuZm9yRWFjaChwb3J0ID0+IHBvcnQucG9zdE1lc3NhZ2UodmFsdWUpKQogIH0KfQoKZnVuY3Rpb24gY2xvc2VXcygpIHsKICBpZiAoIXdzIHx8IHdzLnJlYWR5U3RhdGUgPT0gV2ViU29ja2V0Lk9QRU4pIHsKICAgIHdzLmNsb3NlKCkKICB9Cn0KCmZ1bmN0aW9uIHN0YXR1cygpIHsKICB0aGlzLnBvc3RNZXNzYWdlKHsgcmVhZHlTdGF0ZTogd3MgPyB3cy5yZWFkeVN0YXRlIDogV2ViU29ja2V0LkNMT1NFRCB9KQp9CgpzZWxmLm9uY29ubmVjdCA9IChlKSA9PiB7CiAgY29uc3QgcG9ydCA9IGUucG9ydHNbMF07CgogIHBvcnQub25tZXNzYWdlID0gKHsgZGF0YTogeyBjb21tYW5kLCBkYXRhIH0gfSkgPT4gewogICAgaWYgKGNvbW1hbmQgJiYgWydpbml0V3MnLCAnY2xvc2VXcycsICdzdGF0dXMnXS5pbmNsdWRlcyhjb21tYW5kKSkgUmVmbGVjdC5hcHBseShzZWxmPy5bY29tbWFuZF0sIHBvcnQsIGRhdGEgfHwgW10pCiAgfQoKICBwb3J0cy5wdXNoKHBvcnQpCn0K", self.location))), __privateGet(this, _oWorker).port.onmessage = (e) => { + var _a, _b; + (_a = e.data) != null && _a.uuid ? __privateGet(this, _topic).forEach((flag, fn2) => { + var _a2; + (flag == "*" || (_a2 = flag == null ? void 0 : flag.includes) != null && _a2.call(flag, e.data.uuid)) && fn2(e.data); + }) : ((_b = e.data) == null ? void 0 : _b.readyState) == WebSocket.CLOSED && http.get("/api/user-api-token").then(({ token, expire_at }) => { + __privateGet(this, _oWorker).port.postMessage({ command: "initWs", data: [`ws${_.trimStart(AppUrl, "http")}api/user-resource-status-ws?token=${token}`] }); + }); + }, __privateGet(this, _oWorker).port.postMessage({ command: "status", data: [] }); + }); + __publicField(this, "subscribe", (cb, res = []) => (res ? Array.isArray(res) && res.length == 0 ? res = "*" : Array.isArray(res) || (res = [res].flat()) : res = "*", __privateGet(this, _topic).set(cb, res), __privateGet(this, _topic).size == 1 && __privateGet(this, _initWorker).call(this), () => this.unsubscribe(cb))); + __publicField(this, "unsubscribe", (cb) => __privateGet(this, _topic).delete(cb)); + if (__privateGet(_ResWs, _instance)) + return __privateGet(_ResWs, _instance); + } +}; +_instance = new WeakMap(), _oWorker = new WeakMap(), _topic = new WeakMap(), _initWorker = new WeakMap(), __privateAdd(_ResWs, _instance, null), __publicField(_ResWs, "getInstance", () => (__privateGet(_ResWs, _instance) || __privateSet(_ResWs, _instance, new _ResWs()), __privateGet(_ResWs, _instance))); +let ResWs = _ResWs; +const ResWs$1 = ResWs.getInstance(), useUpdate = () => { + const isMouned = useRef(!0), [value, setValue] = useState(0); + return useEffect(() => () => isMouned.current = !1, []), () => isMouned.current && flushSync(() => { + setValue(value + 1); + }); +}, usePropsValue = ({ value, defaultValue, onChange }) => { + const update2 = useUpdate(), stateRef = useRef(value !== void 0 ? value : defaultValue); + value !== void 0 && (stateRef.current = value); + const setState = useCallback(_.debounce((v) => { + value === void 0 && (stateRef.current = v, update2()), onChange && onChange(v); + }, 380, { leading: !0, trailing: !1 }), [value]); + return [stateRef.current, setState]; +}, usePrevious = (state) => { + const ref = useRef(); + return useEffect(() => { + ref.current = state; + }), ref.current; +}, useStateWithCallback = (init) => { + const cbRef = useRef(), [data2, setData] = useState(init); + return useEffect(() => { + _.isFunction(cbRef.current) && cbRef.current(data2); + }, [data2]), [data2, function(data3, callback) { + cbRef.current = callback, setData(data3); + }]; +}, useDeepEqualEffect = (effect = React.EffectCallback, deps, compare = _.isEqual) => { + const oldDeps = React.useRef(deps); + (!oldDeps.current || !compare(deps, oldDeps.current)) && (oldDeps.current = deps), React.useEffect(effect, [oldDeps.current]); +}, transformOptions = (arr, type = "string") => { + var _a; + if (!Array.isArray(arr)) + return arr; + for (let i = 0; i < arr.length; i++) + arr[i].value = _.toPrimitive((_a = arr[i]) == null ? void 0 : _a.value, type), arr[i] && Reflect.has(arr[i], "children") && (arr[i].children = transformOptions(arr[i].children, type)); + return arr; +}, useOptions = (options, language = "json", type = "string", form, basicForm = null) => { + const [rcform] = Form.useForm(form), [data2, setData] = useState([{ label: "无", value: "", disabled: !0 }]), dependenciesFieldsRef = useRef([]), dependenciesValue = Form.useWatch((data3) => dependenciesFieldsRef.current.length === 0 ? null : _.pick(data3, dependenciesFieldsRef.current), rcform) || null; + return useEffect(() => { + Array.isArray(options) ? setData(options) : language === "javascript" && options ? fn.exec(options, {}, { + getFieldValue: (namePath) => (dependenciesFieldsRef.current.includes(namePath) || dependenciesFieldsRef.current.push(namePath), rcform.getFieldValue(namePath)), + getFieldValueForBasicForm: (namePath) => (dependenciesFieldsRef.current.includes(namePath) || dependenciesFieldsRef.current.push(namePath), basicForm ? basicForm.getFieldValue(namePath) : rcform.getFieldValue(namePath)) + }).then((data3) => { + setData(_.toPrimitive(data3, "array")); + }) : options && setData(_.toPrimitive(options, "array")); + }, [options, language, dependenciesValue]), transformOptions(data2, type); +}, useSubscribeRequest = (param) => { + const [data2, setData] = useState(), opts = { type: "GET" }; + if (typeof param == "string" ? opts.url = param : _.isPlainObject(param) && Object.assign(opts, param), !(opts != null && opts.url)) + throw "url is required"; + const initData = (e) => http.request(opts, !1).resp((resp) => (console.log("useSubscribeRequest", e), setData(resp), resp)); + return useDeepEqualEffect(() => { + let unsubscribe = null; + return initData().then((resp) => { + unsubscribe = ResWs$1.subscribe(_.throttle(initData, 180, { leading: !1, trailing: !0 }), resp.res); + }), () => unsubscribe == null ? void 0 : unsubscribe(); + }, opts), data2; +}, useConfigure = (code) => { + const [data2, setData] = React.useState({ gridItems: [], hideItems: [] }); + return React.useEffect(() => { + code && http.get(`/api/_/${code}`).then(({ + pk, + uuid, + code: code2, + resource, + align, + cols, + rowHeight, + marginX, + marginY, + listenChangeFields, + listenChangeFieldsFunc, + fields + }) => ({ + pk, + uuid, + code: code2, + resource, + align, + cols, + rowHeight, + marginX, + marginY, + listenChangeFields, + listenChangeFieldsFunc, + ...fields.reduce((carry, item) => { + var _a; + return (_a = item == null ? void 0 : item.field) != null && _a.hidden ? carry.hides.push(item == null ? void 0 : item.field) : carry.items.push(item), carry; + }, { items: [], hides: [] }) + })).then(setData); + }, [code]), data2; +}, useRules = ({ + max = 0, + min = 0, + type = "", + message, + pattern, + required = !1, + validator +} = {}, fieldName, fieldType) => { + const [rules, setRules] = useState([]); + return useEffect(() => { + const initRules = []; + if (required) { + let requiredFieldType = fieldType; + switch (fieldType) { + case "number": + case "string": + case "array": + break; + case "bool": + requiredFieldType = "boolean"; + break; + case "json": + requiredFieldType = "object"; + break; + } + initRules.push({ type: requiredFieldType, required: !0, whitespace: !0, message: "该项必填" }); + } + switch (type) { + case "string": + initRules.push({ + type, + max, + min, + message: message || (min && max ? `字符必须在 ${min} ~ ${max} 之间` : `${max ? "最多能有" : "最少要有"} ${min || max} 个字符`) + }); + break; + case "pattern": + initRules.push({ type: "string", pattern, message }); + break; + case "validator": + validator && initRules.push(({ getFieldValue }) => ({ + validator: async (__, value) => { + const msg = await fn.exec(validator, { value, fieldName }, { getFieldValue }); + return _.isString(msg) && msg ? Promise.reject(msg) : _.isBoolean(msg) && !msg ? Promise.reject(message) : Promise.resolve(); + } + })); + break; + } + setRules(initRules); + }, [max, min, type, message, pattern, required, validator]), rules; +}, useFormData = (code, primaryKey, formSetting) => { + const [formData, setFormData] = useState(null); + return useEffect(() => { + const { + initDataUri = `/api/${code}`, + initDataMethod = "GET" + } = formSetting || {}; + primaryKey && http.request({ + method: initDataMethod, + url: _.trimEnd(`${initDataUri}/${primaryKey}`, "/") + }).then((data2) => { + setFormData(data2); + }); + }, [code, primaryKey, formSetting]), formData; +}, useFnRun = (fn$1, form, initialValue, props = {}) => { + const forceUpdate = useUpdate(), isMountedRef = useRef(!0), dependenciesRef = useRef([]), [result, setResult] = useState(initialValue), flag = Form.useWatch((values) => JSON.stringify(_.pick(values, dependenciesRef.current)), form) || "{}"; + return useEffect(() => { + fn$1 && fn.exec(fn$1, props, { + getFieldValue: _.wrap(form.getFieldValue, (cb, namePath) => (dependenciesRef.current.some((item) => _.isEqual(item, namePath)) || (dependenciesRef.current.push(namePath), forceUpdate()), cb(namePath))), + isFieldTouched: form.isFieldTouched, + isFieldsTouched: form.isFieldsTouched + }).then((v) => isMountedRef.current && setResult(v)); + }, [fn$1, flag, form, props]), useEffect(() => () => isMountedRef.current = !1, []), result; +}, GridLayoutFormHoc = (WrapComponent) => ({ + code, + layout, + name, + primaryKey = 0, + style = {}, + formProps = {}, + form: initForm, + isPreview = !1, + className, + onFinish, + onValuesChange = () => { + }, + ...props +}) => { + const { + align, + autoComplete, + resource, + items, + hides, + rowHeight, + marginX, + marginY, + cols, + listenChangeFields, + listenChangeFieldsFunc, + pk, + uuid + } = useConfigure(code), [form] = Form$1.useForm(initForm), onFormValuesChange = ({ + changedValues, + allValues, + listenChangeFields: listenChangeFields2, + listenChangeFieldsFunc: listenChangeFieldsFunc2, + onValuesChange: onValuesChange2, + code: code2 + }) => { + onValuesChange2(changedValues, allValues), listenChangeFieldsFunc2 && Array.isArray(listenChangeFields2) && fn.exec( + listenChangeFieldsFunc2, + { changedValues, allValues }, + { + getFieldValue: form.getFieldValue, + setFieldsValue: form.setFieldsValue, + isFieldTouched: form.isFieldTouched, + isFieldsTouched: form.isFieldsTouched + } + ); + }, formPropsFields = useMemo(() => [ + { name: "__PK__", value: pk }, + { name: "__PROPS__", value: formProps }, + { name: "__RESOURCE__", value: resource }, + { name: "__LAYOUT_KEY__", value: code }, + { name: "__LAYOUT_UUID__", value: uuid }, + { name: "__PRIMARY_KEY__", value: primaryKey } + ], [pk, code, uuid, resource, primaryKey, formProps]); + return /* @__PURE__ */ jsxs( + Form$1, + { + className, + requiredMark: !0, + name: name || code, + layout: layout || align, + fields: formPropsFields, + form, + autoComplete, + style: { ...style, position: "relative" }, + onFinish, + onValuesChange: (changedValues, allValues) => onFormValuesChange( + { + changedValues, + allValues, + listenChangeFields, + listenChangeFieldsFunc, + onValuesChange, + code + } + ), + children: [ + /* @__PURE__ */ jsx( + WrapComponent, + { + ...props, + form, + code, + fields: items, + cols, + rowHeight, + itemMargin: [marginX, marginY] + } + ), + hides == null ? void 0 : hides.map((item) => { + var _a; + return /* @__PURE__ */ jsx(Field, { name: item.code, children: /* @__PURE__ */ jsx( + HideField, + { + form, + name: item.code, + type: item.type, + initialValue: item.initialValue, + initialValueLanguage: (_a = item.extras) == null ? void 0 : _a.initialValueLanguage + } + ) }, JSON.stringify(item.code)); + }) + ] + } + ); +}, HideField = ({ type, initialValue, initialValueLanguage, onChange, form }) => { + const value = useFnRun( + initialValueLanguage == "javascript" && initialValue, + form, + initialValueLanguage == "javascript" ? void 0 : initialValue, + {} + ); + return useEffect(() => { + initialValueLanguage == "javascript" ? onChange(_.toPrimitive(value, type)) : onChange(_.toPrimitive(initialValue, type)); + }, [type, initialValue, value]), null; +}, GridLayoutHoc = (Component2) => function({ code, data: data2, ...props }) { + const [layout, setLayout] = useState({ + resource: null, + cols: 12, + rowHeight: 21, + fields: [] + }); + return useEffect(() => { + code && http.get(`/api/_/${code}`).then((resp) => setLayout(_.pick(resp, ["resource", "cols", "rowHeight", "fields"]))); + }, [code]), (layout == null ? void 0 : layout.resource) && /* @__PURE__ */ jsx( + Component2, + { + ...props, + rowHeight: layout.rowHeight, + cols: layout.cols, + fields: layout.fields, + data: layout != null && layout.resource ? { [layout == null ? void 0 : layout.resource]: data2 } : {} + } + ); +}, HOOK_MARK = "RC_FORM_INTERNAL_HOOKS", useField = (name, { + initialValue, + initialValueLanguage, + convertJs, + convertJsSetting, + type = "string" +}, pContext = null) => { + const isMountedRef = useRef(!1), form = useContext(FieldContext), [newValue, setNewValue] = useState(), [value, setValue] = useState(initialValueLanguage == "javascript" || !name ? void 0 : form.getFieldValue(name)), { registerWatch } = form.getInternalHooks(HOOK_MARK) || {}; + return useEffect(() => registerWatch == null ? void 0 : registerWatch((_values, allValues, _namePath) => { + if (!isMountedRef.current) + return; + const watchValue = _.get(allValues, name); + _.isEqual(watchValue, value) || setValue(_.toPrimitive(watchValue, type)); + }), [value]), useEffect(() => { + initialValueLanguage == "javascript" && initialValue ? fn.exec(initialValue, {}, { + getFieldValueForBasicForm: (name2) => pContext ? pContext.getFieldValue(name2) : form.getFieldValue(name2), + getFieldValue: (name2) => form.getFieldValue(name2) + }).then((data2) => setValue(_.toPrimitive(data2, type))).catch((e) => notification.error({ message: `布局数据错误: ${JSON.stringify(e)}` })).finally(() => isMountedRef.current = !0) : (initialValue && setValue(_.toPrimitive(initialValue ?? form.getFieldValue(name), type)), isMountedRef.current = !0); + }, [initialValue, initialValueLanguage]), useDeepEqualEffect(() => { + isMountedRef.current && convertJs && core.getWidgetComponent(convertJs).then(({ default: fn2 }) => fn2({ value, record: form.getFieldsValue(!0), $setting: convertJsSetting })).then(setNewValue).catch((e) => console.error("布局数据转换错误: ", e, convertJs)); + }, [value, convertJs, convertJsSetting]), [newValue || value, value]; +}, getBoxStyle = (x, y, w, h, boxStyle = {}, height = 0) => { + const style = { + "--grid-layout-h": `${h}`, + "--grid-layout-w": `${w}`, + "--grid-layout-x": `${x}`, + "--grid-layout-y": `${y}`, + "--grid-layout-row-height-offset": "0px" + }; + return boxStyle != null && boxStyle.autoHeight ? style.height = "fit-content" : style["--grid-layout-row"] = `${h}`, style["--grid-layout-box-margin"] = getBoxMargin(boxStyle == null ? void 0 : boxStyle.marginTop, boxStyle == null ? void 0 : boxStyle.marginRight, boxStyle == null ? void 0 : boxStyle.marginBottom, boxStyle == null ? void 0 : boxStyle.marginLeft), style["--grid-layout-box-padding"] = getBoxMargin(boxStyle == null ? void 0 : boxStyle.paddingTop, boxStyle == null ? void 0 : boxStyle.paddingRight, boxStyle == null ? void 0 : boxStyle.paddingBottom, boxStyle == null ? void 0 : boxStyle.paddingLeft), height && (style.height = `${height}px`), style; +}, getBoxMargin = (top, right, bottom, left) => `${top || 0}px ${right || 0}px ${bottom || 0}px ${left || 0}px`, GridLayout = ({ cols, rowHeight, fields, data: data2, containerPadding = [0, 0], itemMargin = [4, 0], formProps = {}, className, ...props }) => { + const [form] = Form.useForm(), items = useGridLayoutFields(fields, itemWidgetRender$2, "@pkg/grid-layouts"), formPropsFields = useMemo(() => [ + { name: "__PROPS__", value: formProps } + ], [formProps]); + return useDeepEqualEffect(() => { + form.setFieldsValue(data2); + }, [data2]), /* @__PURE__ */ jsx(Form, { fields: formPropsFields, form, component: !1, children: /* @__PURE__ */ jsx( + "div", + { + ...props, + className: cx("ff-grid-layout", className), + style: { + "--grid-layout-item-margin-y": `${(itemMargin == null ? void 0 : itemMargin[0]) || 0}px`, + "--grid-layout-item-margin-x": `${(itemMargin == null ? void 0 : itemMargin[1]) || 0}px`, + "--grid-layout-container-padding-y": `${(containerPadding == null ? void 0 : containerPadding[0]) || 0}px`, + "--grid-layout-container-padding-x": `${(containerPadding == null ? void 0 : containerPadding[1]) || 0}px`, + "--grid-layout-cols": cols || 12, + "--grid-layout-row-height": `${rowHeight || 21}px` + }, + children: items + } + ) }); +}, useGridLayoutFields = (fields, itemWidgetRender2, prefix = "@pkg/grid-layouts", basicForm = null) => useMemo(() => { + var _a; + return (_a = _.sortBy(fields, ["y", "x"])) == null ? void 0 : _a.map( + ({ i, x, y, w, h, field: { boxStyle, widgetPrefix = prefix, widget, ...field } }, index2) => /* @__PURE__ */ jsx( + "div", + { + className: "grid-layout-item", + style: getBoxStyle(x, y, w, h, boxStyle, widget === "Height" && (field == null ? void 0 : field.initialValue)), + children: /* @__PURE__ */ jsx( + ItemWidget, + { + ...field, + basicForm, + itemWidget: widget != null && widget.startsWith("@") ? widget : `${widgetPrefix}/${widget}`, + itemWidgetRender: itemWidgetRender2 + } + ) + }, + i || index2 + ) + ); +}, [fields]), ItemWidget = ({ itemWidget, itemWidgetRender: itemWidgetRender2, basicForm, ...props }) => { + const [children, setChildren] = useState(); + return useEffect(() => { + core.getWidgetComponent(itemWidget).then(({ defaultProps, default: ItemWidget2 }) => { + setChildren(React.createElement(itemWidgetRender2(ItemWidget2, defaultProps, basicForm), props)); + }).catch((e) => setChildren(itemWidget)); + }, [itemWidget]), children; +}, itemWidgetRender$2 = (ItemWidget2, defaultProps, basicForm = null) => (props) => { + const { + code, + label, + extras, + isVirtual, + initialValue, + initialValueLanguage, + convertJs, + convertJsSetting, + ...itemWidgetProps + } = _.merge({}, defaultProps, props), [value, rawValue] = useField(isVirtual ? null : code, { + initialValue, + initialValueLanguage, + convertJs, + convertJsSetting, + type: (itemWidgetProps == null ? void 0 : itemWidgetProps.type) || "string" + }, basicForm); + return /* @__PURE__ */ jsx(ItemWidget2, { ...itemWidgetProps, value, rawValue, $setting: extras || {} }); +}, GridLayout$1 = GridLayoutHoc(GridLayout), GridLayoutFormWidget = ({ widget, widgetPrefix, widgetDecorator, subWidgets, basicForm, ...props }) => { + const itemWidget = widget != null && widget.startsWith("@") ? widget : `${widgetPrefix}/${widget}`, [ItemWidget2, setItemWidget] = useState(); + return useEffect(() => { + itemWidget && core.getWidgetComponent(itemWidget).then(({ defaultProps, default: ItemWidget22 }) => ({ + default: itemWidgetRender$1(ItemWidget22, defaultProps, basicForm) + })).catch((e) => ({ default: () => `${e}` })).then((res) => setItemWidget(React.createElement(res.default, props))); + }, [itemWidget]), ItemWidget2 && React.cloneElement(ItemWidget2, props); +}; +GridLayoutFormWidget.defaultProps = { + widgetPrefix: "@pkg/grid-layout-forms", + widget: "Input" +}; +const itemWidgetRender$1 = (ItemWidget2, defaultProps, basicForm = null) => (props) => { + const { + type, + code, + label, + noStyle, + placeholder, + extras, + validators, + help, + isVirtual, + $isReserved, + initialValue, + initialValueLanguage, + convertJs, + convertJsSetting, + widgetPerfix: _widgetPerfix, + boxStyle: _boxStyle, + widgetDecorator, + subWidgets, + ...itemWidgetProps + } = { ...defaultProps, ...props }, rules = useRules(validators || {}, code, type), itemProps = { + label, + noStyle, + colon: !1 + }, fieldProps = { + placeholder, + ...itemWidgetProps + }, normalize = useCallback((value) => value == null ? void 0 : _.toPrimitive(value, type), [type]); + return /* @__PURE__ */ jsx( + Field, + { + name: code, + rules, + initialValue: normalize(initialValue), + normalize, + children: (control, meta, rcform) => { + var _a; + return /* @__PURE__ */ jsx( + ItemWidget2, + { + type, + rcform, + itemProps: { + validateStatus: meta.errors.length > 0 ? "error" : "success", + tooltip: help, + help: meta.errors.length > 0 ? meta.errors.join("、") : null, + required: ((_a = rules == null ? void 0 : rules[0]) == null ? void 0 : _a.required) || !1, + ...itemProps + }, + fieldProps: { ...fieldProps, ...control }, + $setting: extras || {} + } + ); + } + } + ); +}, GridLayoutForm = ({ cols, rowHeight, itemMargin, containerPadding, fields, children }) => { + const items = useGridLayoutFields(fields, itemWidgetRender$1, "@pkg/grid-layout-forms"); + return /* @__PURE__ */ jsx(ConfigProvider, { theme: { components: { Form: { itemMarginBottom: 0 } } }, children: /* @__PURE__ */ jsxs("div", { className: "ff-grid-layout-form", style: { + "--grid-layout-item-margin-x": `${(itemMargin == null ? void 0 : itemMargin[0]) ?? 8}px`, + "--grid-layout-item-margin-y": `${(itemMargin == null ? void 0 : itemMargin[1]) ?? 16}px`, + "--grid-layout-container-padding-y": `${(containerPadding == null ? void 0 : containerPadding[0]) || 0}px`, + "--grid-layout-container-padding-x": `${(containerPadding == null ? void 0 : containerPadding[1]) || 0}px`, + "--grid-layout-cols": cols || 24, + "--grid-layout-row-height": `${rowHeight || 16}px` + }, children: [ + items, + children && React.cloneElement(children, { cols, rowHeight, itemMargin, containerPadding, fields }) + ] }) }); +}; +GridLayoutForm.propTypes = { + fields: PropTypes.array.isRequired +}; +GridLayoutForm.defaultProps = { + fields: [], + itemMargin: [8, 16], + containerPadding: [0, 0] +}; +const GridLayoutForm$1 = GridLayoutFormHoc(GridLayoutForm), FFPageRender = ({ children }) => { + const [ele, setEle] = useState({}), onMount = useCallback((solt, ele2) => setEle((state) => ({ ...state, [solt]: ele2 })), []), onUnmount = useCallback((solt) => setEle((state) => ({ ...state, [solt]: void 0 })), []); + return /* @__PURE__ */ jsx(SlotContext.Provider, { value: { ele, mount: onMount, unmount: onUnmount }, children }); +}; +FFPageRender.defaultProps = { + isDrawerRender: !1 +}; +FFPageRender.propTypes = { + isDrawerRender: PropTypes.bool +}; +const getWidgetPropsData = (registerProps = {}, data2 = {}, fns2 = {}, defaultValue = "") => _.deepSome(registerProps, (value, key) => key === "type" && value === "code") ? getWidgetPropsDataAsync(registerProps, data2, fns2, defaultValue) : getWidgetPropsDataSync(registerProps, data2, defaultValue), getWidgetPropsDataAsync = async (registerProps = {}, data2 = {}, fns2 = {}, defaultValue = "") => { + let res = /* @__PURE__ */ Object.create(null); + for (let key in registerProps) { + let newValue; + if (Reflect.has(registerProps[key], "type") && ["code", "field", "router", "query", "string"].includes(registerProps[key].type)) { + const { type: fieldType, value: fieldData = "", default: fieldDefault = defaultValue } = registerProps[key]; + switch (fieldType) { + case "code": + newValue = await fn.exec(fieldData, data2, fns2); + break; + case "field": + newValue = _.get(data2, fieldData) ?? _.get(data2, fieldData.substring(fieldData.indexOf(".") + 1)); + break; + case "router": + case "query": + newValue = route.getPageParams(fieldData); + break; + case "string": + newValue = fieldData; + } + newValue ?? (newValue = fieldDefault); + } else + newValue = await getWidgetPropsDataAsync(registerProps[key], data2, fns2, defaultValue); + _.set(res, key, newValue); + } + return res; +}, getWidgetPropsDataSync = (registerProps = {}, data2 = {}, defaultValue = "") => Object.keys(registerProps || {}).reduce((res, key) => { + if (_.isPlainObject(registerProps[key])) { + let newValue; + if (Reflect.has(registerProps[key], "type") && ["field", "router", "query", "string"].includes(registerProps[key].type)) { + const { type: fieldType, value: fieldData = "", default: fieldDefault = defaultValue } = registerProps[key]; + switch (fieldType) { + case "field": + newValue = _.get(data2, fieldData) ?? _.get(data2, fieldData.substring(fieldData.indexOf(".") + 1)); + break; + case "router": + case "query": + newValue = route.getPageParams(fieldData); + break; + case "string": + newValue = fieldData; + break; + } + newValue ?? (newValue = fieldDefault); + } else + newValue = getWidgetPropsDataSync(registerProps[key], data2, defaultValue); + _.set(res, key, newValue); + } + return res; +}, {}), DataListFramework = ({ + className, + itemClassName, + classNames, + dataSource, + isPaginate, + pageSize, + isItemOperations, + isBatchOperations, + batchOperations, + itemOperations, + itemOperationsAccess, + resource, + primaryKey, + title, + itemGridLayout, + $setting, + tabs, + isTreeSider, + treeSiderConfig +}) => { + const { getBase62params, onClickCallback, onTabChange } = useContext(DataListContext), { total, page, tab } = getBase62params() || {}, itemRender = useCallback((children, data2, index2) => /* @__PURE__ */ jsx( + ItemOperations, + { + className: cx("ff-data-list-framework-item", itemClassName), + operations: isItemOperations && data2 ? itemOperations == null ? void 0 : itemOperations.filter((oper) => !primaryKey || !oper.uuid || !itemOperationsAccess.has(oper.uuid) ? !0 : itemOperationsAccess.get(oper.uuid).includes(data2 == null ? void 0 : data2[primaryKey])) : [], + data: resource ? { [resource]: data2 } : data2, + children, + onClickCallback + } + ), [resource, primaryKey, isItemOperations, onClickCallback, itemOperations, itemOperationsAccess]); + return /* @__PURE__ */ jsxs("div", { className: cx("ff-data-list-framework", className), children: [ + /* @__PURE__ */ jsx(DataListSider, { className: classNames == null ? void 0 : classNames.sider, isTreeSider, ...treeSiderConfig }), + /* @__PURE__ */ jsxs("div", { className: cx("ff-data-list-container", classNames == null ? void 0 : classNames.container), children: [ + /* @__PURE__ */ jsx(DataListFilter, { className: classNames == null ? void 0 : classNames.filter }), + /* @__PURE__ */ jsx( + DataListToolbar, + { + title, + className: classNames == null ? void 0 : classNames.toolbar, + tabs, + tab, + onTabChange + } + ), + /* @__PURE__ */ jsx( + DataListContent, + { + ...itemGridLayout, + className: classNames == null ? void 0 : classNames.content, + style: { "--col-num": ($setting == null ? void 0 : $setting.colNum) || 1 }, + primaryKey, + itemRender, + dataSource + } + ), + /* @__PURE__ */ jsx( + DataListFooter, + { + className: classNames == null ? void 0 : classNames.footer, + isPaginate, + isOperations: isBatchOperations, + operations: batchOperations, + total, + page, + pageSize + } + ) + ] }) + ] }); +}, ItemOperations = ({ className, operations, children, data: data2, onClickCallback }) => /* @__PURE__ */ jsxs("div", { className: cx("data-list-grid-layout-item-container", className), children: [ + children, + !!(operations != null && operations.length) && /* @__PURE__ */ jsx("div", { className: "data-list-grid-layout-item-actions", children: operations.map((item) => /* @__PURE__ */ jsx("span", { className: "data-list-grid-layout-item-action", children: /* @__PURE__ */ jsx( + Button.Link, + { + uuid: item.uuid, + type: item.type, + name: item.name, + widget: item.widget, + widgetType: item.widgetType, + widgetProps: item.widgetProps, + widgetSetting: item.widgetSetting, + widgetContainerProps: item.widgetContainerSetting, + data: data2, + onAfterClick: (e) => e !== !1 && (onClickCallback == null ? void 0 : onClickCallback(item.isRefresh, data2)) + }, + item.uuid || useId() + ) }, (item == null ? void 0 : item.uuid) || useId())) }) +] }), DataTableFramework = ({ + listCode, + className, + itemClassName, + dataSource, + columns, + isItemOperations, + isBatchOperations, + batchOperations, + itemOperations, + itemOperationsAccess, + resource, + primaryKey, + title, + isPaginate, + pageSize, + isTreeSider, + treeSiderConfig, + ...props +}) => { + const { getBase62params, onClickCallback } = useContext(DataListContext), { total, page } = getBase62params() || {}; + return /* @__PURE__ */ jsxs("div", { className: cx("ff-data-table-framework", className), children: [ + /* @__PURE__ */ jsx(DataListSider, { isTreeSider, ...treeSiderConfig }), + /* @__PURE__ */ jsxs("div", { className: "ff-data-table-container", children: [ + /* @__PURE__ */ jsx(DataListFilter, { listCode }), + /* @__PURE__ */ jsx(DataListToolbar, { title }), + /* @__PURE__ */ jsx( + DataListTable, + { + ...props, + className: "ff-data-table-content", + columns, + dataSource, + operationRender: (record) => /* @__PURE__ */ jsx("div", { className: "ff-data-table-actions", children: itemOperations == null ? void 0 : itemOperations.reduce((carry, item, i) => [ + ...carry, + /* @__PURE__ */ jsx( + Button.Link, + { + size: "small", + uuid: item.uuid, + type: item.type, + name: item.name, + widget: item.widget, + widgetType: item.widgetType, + widgetProps: item.widgetProps, + widgetSetting: item.widgetSetting, + widgetContainerProps: item.widgetContainerSetting, + data: record, + onAfterClick: (e) => e !== !1 && (onClickCallback == null ? void 0 : onClickCallback(item.isRefresh, data)) + }, + item.uuid || i + ) + ], []) }) + } + ), + /* @__PURE__ */ jsx( + DataListFooter, + { + isPaginate, + isOperations: isBatchOperations, + operations: batchOperations, + total, + page, + pageSize + } + ) + ] }) + ] }); +}, DataListContext = React.createContext({ + listCode: "", + getBase62params: (k, defaultValue) => { + }, + onReload: () => { + }, + onClickCallback: () => { + }, + onConditonChange: () => { + }, + onTabChange: () => { + }, + onSiderChange: () => { + }, + onKeywordChange: () => { + }, + onPageChange: () => { + }, + onPageSizeChange: () => { + } +}), DataList$1 = ({ + isItemGridLayout, + theme, + themeProps, + onClickCallback, + onReload, + getBase62params, + listCode, + onPageChange, + onPageSizeChange, + onTabChange, + onSiderChange, + onKeywordChange, + onConditonChange, + ...props +}) => { + const [framework, setFramework] = useState(); + return useEffect(() => { + theme ? core.getWidgetComponent(theme).then((resp) => { + if (!resp) + throw `${theme} not found`; + return resp; + }).catch((e) => ({ default: () => `${e}` })).then((resp) => setFramework(React.createElement(resp.default, { ...props, $setting: themeProps }))) : framework || setFramework(null); + }, [theme, themeProps]), /* @__PURE__ */ jsx(DataListContext.Provider, { value: { + listCode, + onClickCallback, + onReload, + getBase62params, + onPageChange, + onPageSizeChange, + onTabChange, + onSiderChange, + onKeywordChange, + onConditonChange + }, children: framework ? React.cloneElement(framework, { ...props, $setting: themeProps }) : isItemGridLayout ? /* @__PURE__ */ jsx(DataListFramework, { ...props, $setting: themeProps }) : /* @__PURE__ */ jsx(DataTableFramework, { ...props, $setting: themeProps }) }); +}; +DataList$1.defaultProps = { + onReload: () => { + }, + getBase62params: () => { + } +}; +const loadDataListFieldWidget = (widget, value, record, widgetSetting, base62params) => { + const Widget = React.lazy(() => core.getWidgetComponent(widget).catch((e) => ({ default: () => `${e}` }))); + return /* @__PURE__ */ jsx(React.Suspense, { children: /* @__PURE__ */ jsx( + Widget, + { + value, + record, + $setting: widgetSetting, + base62params + } + ) }, widget); +}, useColumnsRender = (columns, base62params = {}) => (usePrevious(columns), usePrevious(base62params), useMemo(() => columns == null ? void 0 : columns.map(({ widgetByJs, widgetByJsSetting, ...item }, i) => widgetByJs && !widgetByJs.endsWith("/BasicShowFieldData") ? { + ...item, + render: (value, record) => { + const widgetByJsRender = loadDataListFieldWidget(widgetByJs, value, record, widgetByJsSetting, base62params); + return _.isFunction(item == null ? void 0 : item.render) ? item.render(widgetByJsRender, value, record) : widgetByJsRender; + } +} : item), [columns, base62params])), useStructure = (listCode) => { + const [option, setOption] = useState({}); + return useEffect(() => { + let flag = !1; + return listCode && http.get(`/api/_/${listCode}`).then((data2) => _.pick(data2, [ + "uuid", + "name", + "code", + "resource", + "marginX", + "marginY", + "cols", + "rowHeight", + "primaryKey", + "columns", + "itemOperations", + "batchOperations", + "isConditionFormLayout", + "layout", + "tabs", + "pageSize", + "layoutConfig" + ])).then((data2) => !flag && setOption(data2)), () => flag = !0; + }, [listCode]), option; +}, useDataSource = (listCode, base62params = {}) => { + const [option, setOption] = useState({ dataSource: [] }); + return useDeepEqualEffect(() => { + let flag = !1; + return listCode && http.get(`/api/${listCode}/${http.encode({ page: 1, ...base62params })}`).then((data2) => !flag && setOption(data2)), () => flag = !0; + }, [listCode, base62params]), option; +}, useHasOperationColumn = (operations, dataSource = null, itemOperationsAccess = null, pk = "id") => useMemo(() => { + if (_.isEmpty(operations) || !operations.every(({ uuid }) => auth.check(uuid))) + return !1; + if (_.isEmpty(itemOperationsAccess) || _.isEmpty(dataSource)) + return !0; + const ids = dataSource.map((item) => item == null ? void 0 : item[pk]); + return operations.some(({ uuid }) => !uuid || !itemOperationsAccess.has(uuid) ? !0 : itemOperationsAccess.get(uuid).some((oper) => ids.includes(oper))); +}, [operations, dataSource, itemOperationsAccess, pk]), DataListHelper = React.forwardRef(({ listCode, base62params, className, itemClassName, theme: _theme, themeProps, classNames }, ref) => { + const [{ tab, page, total, condition, sider, keyword, dataSource, itemOperationsAccess, pageSize }, setData] = useStateWithCallback(base62params), [{ + resource, + primaryKey, + batchOperations = [], + itemOperations = [], + columns = [], + themeConfig, + theme, + isTreeSider, + treeSiderConfig, + isItemGridLayout, + itemGridLayout, + title, + isPaginate, + tabs + }, setStructure] = useState({ isItemGridLayout: !1, itemGridLayout: {} }), initData = (params) => http.list(listCode, { tab, page, total, condition, sider, keyword, ...params }).then(({ + condition: condition2, + total: total2, + tab: tab2, + page: page2, + pageSize: pageSize2, + operationsAccess, + dataSource: dataSource2 + }) => { + setData({ + dataSource: dataSource2, + pageSize: pageSize2, + total: total2, + page: page2, + tab: tab2, + condition: condition2, + sider, + keyword, + itemOperationsAccess: new Map(operationsAccess) + }); + }), isItemOperations = useHasOperationColumn(itemOperations, dataSource, itemOperationsAccess, primaryKey), isBatchOperations = useHasOperationColumn(batchOperations); + useEffect(() => { + let unsubscribe = null; + return listCode && http.get(`/api/_/${listCode}`).resp(({ data: data2, res }) => { + data2 != null && data2.isDynamicRefresh && (unsubscribe = ResWs$1.subscribe(() => initData(), res)), setStructure(data2); + }).catch(() => setStructure({})), setData((data2) => ({ ...data2, dataSource: [] })), () => unsubscribe == null ? void 0 : unsubscribe(); + }, [listCode]), useEffect(() => { + listCode && initData(base62params); + }, [JSON.stringify(base62params)]); + const onConditonChange = (value, keyword2) => initData({ keyword: keyword2, condition: update(condition || {}, { $merge: value || {} }), page: 1 }), onTabChange = (tab2) => initData({ tab: tab2, page: 1 }), onSiderChange = (sider2) => initData({ sider: sider2, page: 1 }), onKeywordChange = (keyword2) => initData({ keyword: keyword2, page: 1 }), onPageChange = (page2, pageSize2) => initData({ page: page2, pageSize: pageSize2 }), onPageSizeChange = (pageSize2) => initData({ pageSize: pageSize2, page: 1 }), getBase62params = (k, defaultValue, isInit = !1) => { + if (k == "init") + return base62params; + const params = { tab, sider, keyword, page, pageSize, condition, total }; + return k ? _.get(params, k, defaultValue) : params; + }, onReload = () => { + initData(); + }, onClickCallback = (isRefresh = 0, item = null) => { + if (isRefresh === 2) { + const parentPk = _.get(item, "__PARENT_ID__", ""), pk = _.get(item, primaryKey, _.get(item, [resource, primaryKey], "")), pIndex = _.findIndex(dataSource, ["__PARENT_ID__", parentPk]), index2 = _.findIndex(pIndex > -1 ? _.get(dataSource, [pIndex, "children"]) : dataSource, [primaryKey, pk]); + index2 > -1 ? (http.get(`/api/${listCode}/detail/${pk}`).then((resp) => { + setData((data2) => { + const children = _.get(data2.dataSource, pIndex > -1 ? [pIndex, "children", index2, "children"] : [index2, "children"]); + return { + ...data2, + dataSource: pIndex > -1 ? update(data2.dataSource, { [pIndex]: { children: { $splice: [[index2, 1, { ...resp, children }]] } } }) : update(data2.dataSource, { $splice: [[index2, 1, { ...resp, children }]] }) + }; + }); + }), http.post(`/api/${listCode}/list-operations-access`, { ids: pk }).then((data2) => new Map(data2)).then((detailAccess) => { + setData((data2) => (data2.itemOperationsAccess.forEach((ids, uuid) => { + var _a; + (_a = detailAccess.get(uuid)) != null && _a.some((item2) => item2 == pk) || data2.itemOperationsAccess.set(uuid, ids.filter((id) => id !== pk)); + }), detailAccess.forEach((ids, uuid) => { + data2.itemOperationsAccess.has(uuid) ? data2.itemOperationsAccess.set(uuid, _.uniq([...data2.itemOperationsAccess.get(uuid) || [], ...ids])) : data2.itemOperationsAccess.set(uuid, ids); + }), { ...data2 })); + })) : onReload(); + } else + isRefresh === 1 && onReload(); + }; + return React.useImperativeHandle(ref, () => ({ + onReload, + onClickCallback + })), /* @__PURE__ */ jsx( + DataList$1, + { + ...{ + listCode, + title, + itemClassName, + classNames, + resource, + primaryKey, + theme: _theme || theme, + themeProps: themeProps || themeConfig, + isPaginate, + pageSize, + page, + isTreeSider, + treeSiderConfig, + tabs, + isItemOperations, + isBatchOperations, + batchOperations, + itemOperations, + itemOperationsAccess, + dataSource, + isItemGridLayout, + columns, + itemGridLayout + }, + className: cx("ff-data-list-helper", className), + getBase62params, + onReload, + onClickCallback, + onConditonChange, + onTabChange, + onSiderChange, + onKeywordChange, + onPageChange, + onPageSizeChange + } + ); +}), DataListFilter = ({ className }) => { + var _a, _b; + const [structure, setStructure] = useState({}), { listCode, onKeywordChange, onConditonChange, getBase62params } = React.useContext(DataListContext), { keyword, condition } = getBase62params() || {}, [form] = Form$1.useForm(); + useEffect(() => { + http.get(`/api/_/${listCode}/list-condition-form-layout`).then(({ resource, marginX, marginY, rowHeight, cols, fields }) => { + setStructure({ resource, itemMargin: [marginX, marginY], rowHeight, cols, fields }); + }).catch(() => setStructure({})); + }, [listCode]), useEffect(() => { + form.setFieldsValue({ keyword, ...condition }); + }, [JSON.stringify([keyword, condition])]); + const onReset = () => { + const { keyword: keyword2, condition: condition2 } = getBase62params("init") || {}; + form.setFieldsValue({ keyword: keyword2, ...condition2 }); + }, onSubmit = (value) => onConditonChange(value[structure == null ? void 0 : structure.resource], value.keyword), onKeywordSearch = (value) => onKeywordChange(value); + return /* @__PURE__ */ jsx("div", { className: cx("ff-data-list-filter", className), children: /* @__PURE__ */ jsx( + Form$1, + { + form, + layout: "vertical", + autoComplete: "off", + onFinish: ((_a = structure.fields) == null ? void 0 : _a.length) > 1 ? onSubmit : () => { + }, + children: ((_b = structure.fields) == null ? void 0 : _b.length) > 1 ? /* @__PURE__ */ jsx(GridLayoutForm, { ...structure, children: /* @__PURE__ */ jsx(DataListFilterAction, { onReset }) }) : /* @__PURE__ */ jsx("div", { className: "ff-data-list-filter-default-form ff-grid-layout-form", children: /* @__PURE__ */ jsx("div", { className: "grid-layout-item", style: getBoxStyle(20, 0, 5, 2), children: /* @__PURE__ */ jsx(Form$1.Item, { name: ["keyword"], children: /* @__PURE__ */ jsx(Input.Search, { allowClear: !0, enterButton: "搜索", placeholder: "多关键字 | 分割", onSearch: onKeywordSearch }) }) }) }) + } + ) }); +}, DataListFilterAction = ({ cols, fields, onReset }) => { + const [expanded, setExpanded] = useState(!1), isMore = useMemo(() => fields == null ? void 0 : fields.toReversed().some((item) => item.y > 1 || item.x + item.w >= cols - 5), [cols, fields]); + return /* @__PURE__ */ jsxs(Form$1.Item, { label: " ", style: { "--item-span": 5 }, className: cx("ff-data-list-filter-actions", { expanded }), children: [ + /* @__PURE__ */ jsx(Button$1, { onClick: onReset, children: "重置" }), + /* @__PURE__ */ jsx(Button$1, { type: "primary", htmlType: "submit", children: "查询" }), + isMore && /* @__PURE__ */ jsx( + Button.Link, + { + className: "ff-data-list-filter-expanded-button", + widget: () => setExpanded((flag) => !flag), + type: "primary", + name: expanded ? "关闭" : "展开", + icon: expanded ? "icon-up" : "icon-down", + iconPosition: "end" + } + ) + ] }); +}; +DataListFilter.reservedFields = [ + { + x: 0, + y: 0, + h: 3, + w: 5, + field: { + isVirtual: !0, + widgetPrefix: "@pkg/grid-layout-forms", + widget: "Input", + code: "keyword", + label: "关键字", + placeholder: "多关键字 | 分割", + extras: { prefix: "icon-search" } + } + } +]; +const DataListToolbar = ({ className, title, tabs, tab, onTabChange }) => { + const [tabValue, setTabValue] = usePropsValue({ value: tab, defaultValue: tabs == null ? void 0 : tabs[0].value, onChange: onTabChange }); + return /* @__PURE__ */ jsxs("div", { className: cx("ff-data-list-toolbar", className), children: [ + /* @__PURE__ */ jsx("div", { className: "ff-data-list-title", children: title }), + /* @__PURE__ */ jsx( + Breadcrumb, + { + className: "ff-data-list-tabs", + itemRender: ({ label, code: value }) => /* @__PURE__ */ jsx("span", { onClick: () => setTabValue(value), className: cx("ff-data-list-tab", { active: value == tabValue }), children: label }), + items: tabs + } + ), + /* @__PURE__ */ jsxs("div", { className: "ff-data-list-actions", children: [ + /* @__PURE__ */ jsx(Button.Link, { icon: "icon-reload" }), + /* @__PURE__ */ jsx(Button.Link, { icon: "icon-setting" }) + ] }) + ] }); +}, treeData = [ + { + 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: /* @__PURE__ */ jsx( + "span", + { + style: { + color: "#1677ff" + }, + children: "sss" + } + ), + key: "0-0-1-0" + } + ] + } + ] + } +], DataListSider = ({ className, width, isTreeSider }) => isTreeSider ? /* @__PURE__ */ jsx( + Tree.DirectoryTree, + { + className: cx("ff-data-list-sider", className), + style: { "--sider-width": width }, + showLine: !0, + showIcon: !1, + treeData + } +) : null; +DataListSider.defaultProps = { + width: 280 +}; +const DataListFooter = ({ className, operations, isOperations, isPaginate, total, page, pageSize }) => { + const { onPageChange, onPageSizeChange, onClickCallback } = React.useContext(DataListContext); + return isOperations && !_.isEmpty(operations) || isPaginate ? /* @__PURE__ */ jsxs("div", { className: cx("ff-data-list-footer", className), children: [ + /* @__PURE__ */ jsx("div", { className: "ff-data-list-actions", children: operations == null ? void 0 : operations.map((item, i) => /* @__PURE__ */ jsx( + Button, + { + uuid: item.uuid, + type: item.type, + name: item.name, + widget: item.widget, + widgetType: item.widgetType, + widgetProps: item.widgetProps, + widgetSetting: item.widgetSetting, + widgetContainerProps: item.widgetContainerSetting, + onAfterClick: (e) => e !== !1 && (onClickCallback == null ? void 0 : onClickCallback(item.isRefresh, null)) + }, + item.uuid || i + )) }), + isPaginate && /* @__PURE__ */ jsx( + Pagination, + { + size: "small", + total, + pageSize, + showSizeChanger: !1, + showTotal: (total2) => `第 ${page} 页 / 总共 ${total2} 条`, + onChange: onPageChange, + onShowSizeChange: onPageSizeChange + } + ) + ] }) : null; +}, getDefaultExpandRowKeys = (data2, key, depth = !0) => depth !== !0 && depth-- <= 0 ? [] : _.isArray(data2) && !_.isEmpty(data2) ? data2.reduce((res, item) => (Reflect.has(item, key) && Reflect.has(item, "children") && res.push(item[key]), Reflect.has(item, "children") && !_.isEmpty(item.children) ? res.concat(getDefaultExpandRowKeys(item.children, key, depth)) : res), []) : [], DataListTable = ({ + className, + primaryKey, + columns, + dataSource, + operationRender, + operationWidth, + ...props +}) => { + const tableRef = useRef(null), divRef = useRef(null), [expandedRowKeys, setExpandedRowKeys] = useState([]), [divSize, setDivSize] = useState({ width: 0, height: 0 }); + useEffect(() => { + setExpandedRowKeys(getDefaultExpandRowKeys(dataSource, primaryKey)); + }, [dataSource, primaryKey]), useLayoutEffect(() => { + const resizeObserver = new ResizeObserver(() => { + var _a; + setDivSize({ + width: ((_a = tableRef.current) == null ? void 0 : _a.nativeElement.querySelector(".ant-table-body").scrollWidth) || divRef.current.offsetWidth, + height: divRef.current.offsetHeight + }); + }); + return divRef.current && resizeObserver.observe(divRef.current), () => { + divRef.current && resizeObserver.unobserve(divRef.current); + }; + }, []); + const newColumns = useColumnsRender(columns); + return /* @__PURE__ */ jsx("div", { ref: divRef, className: cx("ff-data-list-table", className), children: divSize.height ? /* @__PURE__ */ jsx( + Table, + { + ...props, + ref: tableRef, + rowKey: (v, index2) => (v == null ? void 0 : v[primaryKey]) ?? index2, + columns: newColumns == null ? void 0 : newColumns.concat(operationRender ? [{ + title: "操作", + align: "center", + fixed: "right", + width: `${Math.ceil(operationWidth / divSize.width * 100).toFixed(2)}%`, + render: (_text, record, index2) => operationRender(record, index2) + }] : []), + dataSource, + size: "middle", + scroll: { x: "max-content", y: divSize.height - 47 }, + pagination: !1, + expandable: { + defaultExpandAllRows: !0, + expandRowByClick: !0, + onExpandedRowsChange: setExpandedRowKeys, + expandedRowKeys + } + } + ) : null }); +}; +DataListTable.defaultProps = { + operationWidth: 180, + columns: [], + dataSource: [] +}; +const GridLayoutWidget = ({ widget, widgetPrefix, basicForm, ...props }) => { + const itemWidget = widget != null && widget.startsWith("@") ? widget : `${widgetPrefix}/${widget}`, [ItemWidget2, setItemWidget] = useState(); + return useEffect(() => { + itemWidget && core.getWidgetComponent(itemWidget).then(({ defaultProps, default: ItemWidget22 }) => ({ + default: itemWidgetRender(ItemWidget22, defaultProps, basicForm) + })).catch((e) => ({ default: () => `${e}` })).then((res) => setItemWidget(React.createElement(res.default, props))); + }, [itemWidget]), ItemWidget2; +}, itemWidgetRender = (ItemWidget2, defaultProps, basicForm = null) => (props) => { + const { + code, + label, + extras, + isVirtual, + initialValue, + initialValueLanguage, + convertJs, + convertJsSetting, + value: _value, + ...itemWidgetProps + } = _.merge({}, defaultProps, props), [value, rawValue] = useField(isVirtual ? null : code, { + initialValue, + initialValueLanguage, + convertJs, + convertJsSetting, + type: (itemWidgetProps == null ? void 0 : itemWidgetProps.type) || "string" + }, basicForm); + return /* @__PURE__ */ jsx(ItemWidget2, { ...itemWidgetProps, value, rawValue, $setting: extras || {} }); +}; +GridLayoutWidget.defaultProps = { + widgetPrefix: "@pkg/grid-layouts" +}; +const DataListContent = ({ + cols, + rowHeight, + itemMargin, + fields, + primaryKey, + itemRender, + dataSource, + itemClassName, + empty, + className, + style +}) => { + const id = useId$1(), GridLayoutElement = useMemo(() => /* @__PURE__ */ jsx( + GridLayout, + { + cols, + rowHeight, + itemMargin, + fields, + className: itemClassName + } + ), [fields, cols, rowHeight, itemMargin]); + return /* @__PURE__ */ jsx("div", { className: cx("ff-data-list-content", className), style, children: _.isEmpty(dataSource) ? empty : dataSource == null ? void 0 : dataSource.map((item, i) => /* @__PURE__ */ jsx(React.Fragment, { children: itemRender(React.cloneElement(GridLayoutElement, { data: item }), item, i) }, `${id}-${(item == null ? void 0 : item[primaryKey]) || i}`)) }); +}; +DataListContent.defaultProps = { + itemRender: (children, data2, index2) => children, + empty: /* @__PURE__ */ jsx(Empty$1, { description: null }), + style: {} +}; +const redirect = (params, widget, { isReplaceRouteHistory = !1 } = {}) => route.redirect(widget, params, { replace: isReplaceRouteHistory }), func = (params, widget, { status: { loading, disabled }, setStatus }) => { + const extras = { + loading: (flag) => flag === void 0 ? loading : setStatus((data2) => ({ ...data2, loading: flag })), + disabled: (flag) => flag === void 0 ? disabled : setStatus((data2) => ({ ...data2, disabled: flag })) + }; + return _.isFunction(widget) ? widget.call(null, { ...params, ...extras }) : _.isString(widget) && widget ? fn.exec(widget, params, extras) : null; +}, component = (data2, widget, widgetSetting, widgetContainerProps) => _.isString(widget) && widget ? core.getWidgetComponent(widget).then(({ default: WidgetComponent }) => FFPopupRender.modal( + WidgetComponent, + { ...data2, $setting: widgetSetting }, + widgetContainerProps +)).catch((e) => { + FFPopupRender.error(widget, { content: e.toString() }); +}) : FFPopupRender.modal( + widget, + { ...data2, $setting: widgetSetting }, + widgetContainerProps +), gridLayoutForm = (data2, widget, widgetSetting, widgetContainerProps) => FFPopupRender.modal( + GridLayoutFormHelper, + { ...data2, $setting: widgetSetting, code: widget }, + widgetContainerProps +), list = (data2, widget, widgetSetting, widgetContainerProps) => FFPopupRender.modal( + DataListHelper, + { base62params: data2, $setting: widgetSetting, listCode: widget }, + widgetContainerProps +), useButton = ({ + widget, + widgetType, + widgetData, + widgetProps, + widgetSetting, + widgetContainerProps +}, { onAfterClick, onBeforeClick }) => { + const listFn = useContext(DataListContext); + useContext(AppGlobalParamsContext); + const [status, setStatus] = useState({ leading: !0, trailing: !1 }), fn2 = useMemo(() => { + switch (widgetType) { + case "redirect": + return _.partialRight(redirect, widget, widgetSetting); + case "func": + return _.partialRight(func, (widgetSetting == null ? void 0 : widgetSetting.code) ?? widget, { status, setStatus }); + case "fsdpf-component": + return _.partialRight(component, widget, widgetSetting, widgetContainerProps); + case "grid-layout-form": + return _.partialRight(gridLayoutForm, widget, widgetSetting, widgetContainerProps); + case "data-list": + return _.partialRight(list, widget, widgetSetting, widgetContainerProps); + default: + if (isReactComponent(widget) || React.isValidElement(widget)) + return _.partialRight(component, widget, widgetSetting, widgetContainerProps); + if (_.isFunction(widget)) + return _.partialRight(func, (widgetSetting == null ? void 0 : widgetSetting.code) || widget, { status, setStatus }); + } + return (...args) => console.error("useButton unknown widgetType", widgetType, ...args); + }, [widget, widgetType]); + return [_.debounce((data2) => (onBeforeClick == null || onBeforeClick(data2), Promise.resolve(getWidgetPropsData(widgetProps, data2, { list: listFn })).then((data22) => fn2({ ...widgetData, ...data22 })).then((result) => onAfterClick == null ? void 0 : onAfterClick(result)).catch(console.error)), 300, { leading: !0, trailing: !1 }), status]; +}; +var _instance2, _data; +const _OperationAuth = class _OperationAuth { + constructor() { + __privateAdd(this, _data, null); + __publicField(this, "init", (data2) => __privateSet(this, _data, new Map(data2))); + __publicField(this, "check", (uuid) => !__privateGet(this, _data).has(uuid) || __privateGet(this, _data).get(uuid)); + if (__privateGet(_OperationAuth, _instance2)) + return __privateGet(_OperationAuth, _instance2); + } +}; +_instance2 = new WeakMap(), _data = new WeakMap(), __privateAdd(_OperationAuth, _instance2, null), __publicField(_OperationAuth, "getInstance", () => (__privateGet(_OperationAuth, _instance2) || __privateSet(_OperationAuth, _instance2, new _OperationAuth()), __privateGet(_OperationAuth, _instance2))); +let OperationAuth = _OperationAuth; +const auth = OperationAuth.getInstance(), entry = (cate) => function({ + className, + children, + name, + icon, + type, + data: data2, + noAuthType, + onAfterClick, + onBeforeClick, + loading: customLoading, + disabled: customDisabled, + tooltip, + popConfirm, + widget, + widgetType, + widgetData, + widgetProps, + widgetSetting, + widgetContainerProps, + ...props +}) { + const btnProps = { + type: "primary", + className: cx("ff-button", className) + }; + type === "danger" ? btnProps.danger = !0 : type === "default" && (btnProps.type = type), cate === "link" || cate === "dashed" ? (btnProps.type = cate, type === "default" && (btnProps.className = cx(btnProps.className, "ff-default"))) : (cate === "circle" || cate === "round") && (btnProps.shape = cate), icon && (btnProps.icon = /* @__PURE__ */ jsx(Iconfont, { type: icon })); + const [confirmOpen, setConfirmOpen] = useState(!1), [onClick, { disabled, loading }] = useButton({ widget, widgetType, widgetData, widgetProps, widgetSetting, widgetContainerProps }, { onAfterClick, onBeforeClick }); + return /* @__PURE__ */ jsx( + Popconfirm, + { + okText: "确定", + cancelText: "取消", + ...popConfirm || {}, + disabled: disabled || customDisabled, + open: confirmOpen, + onOpenChange: (flag) => { + if (!flag) + return setConfirmOpen(flag); + popConfirm ? setConfirmOpen(flag) : onClick(data2); + }, + onConfirm: () => { + onClick(data2); + }, + onClick: (e) => { + e.stopPropagation(); + }, + children: /* @__PURE__ */ jsx(Tooltip, { ...tooltip, title: confirmOpen ? null : tooltip == null ? void 0 : tooltip.title, trigger: ["hover", "click"], children: /* @__PURE__ */ jsx( + Button$1, + { + loading: loading || customLoading, + disabled: disabled || customDisabled, + ...btnProps, + ...props, + children: children || name + } + ) }) + } + ); +}, Button = entry("default"), Link = entry("link"), Circle = entry("circle"), Round = entry("round"), Dashed = entry("dashed"), Popover = ({ data: data2, widget, widgetType, children, widgetData, widgetProps, widgetSetting, widgetContainerProps }) => { + const listFn = useContext(DataListContext), [open, setOpen] = useState(!1), [trigger, setTrigger] = useState("hover"), [componentData, setComponentData] = useState({}), [component2, setComponent] = useState(); + useEffect(() => { + widgetType == "grid-layout-form" ? setComponent(React.createElement(GridLayoutFormHelper, { ...widgetData, $setting: widgetSetting, code: widget })) : widgetType == "data-list" ? setComponent(React.createElement(DataListHelper, { base62params: data2, $setting: widgetSetting, listCode: widget })) : _.isString(widget) ? core.getWidgetComponent(widget).then(({ default: WidgetComponent }) => { + setComponent(React.createElement(WidgetComponent, { ...widgetData, $setting: widgetSetting })); + }).catch((e) => setComponent(e.toString())) : isReactComponent(widget) ? setComponent(React.createElement(widget, { ...widgetData, $setting: widgetSetting })) : React.isValidElement(widget) && setComponent(React.cloneElement(widget, { ...widgetData, $setting: widgetSetting })); + }, [widget, widgetType, widgetData]), useEffect(() => { + Promise.resolve(getWidgetPropsData(widgetProps, data2, { list: listFn })).then(setComponentData); + }, [widgetProps, data2]); + const onOpenChange = (flag) => { + setOpen(flag), !flag && setTrigger("hover"); + }, onClick = () => { + setOpen(!0), setTrigger("click"); + }; + return /* @__PURE__ */ jsx( + Popover$1, + { + zIndex: 1e3, + ...widgetContainerProps, + onPopupClick: onClick, + onClick, + open, + trigger, + content: /* @__PURE__ */ jsx(PopoverContent, { children: component2 && React.cloneElement(component2, { ...componentData, $close: () => onOpenChange(!1) }) }), + children, + onOpenChange, + overlayClassName: "ff-popup ff-popover" + } + ); +}, PopoverContent = ({ children }) => { + const [ele, setEle] = useState({}), onMount = useCallback((solt, ele2) => setEle((state) => ({ ...state, [solt]: ele2 })), []), onUnmount = useCallback((solt) => setEle((state) => ({ ...state, [solt]: void 0 })), []); + return /* @__PURE__ */ jsxs(SlotContext.Provider, { value: { ele, mount: onMount, unmount: onUnmount }, children: [ + ele != null && ele.title || ele != null && ele["sub-title"] ? /* @__PURE__ */ jsxs("div", { className: "ff-popup-header", children: [ + (ele == null ? void 0 : ele.title) || /* @__PURE__ */ jsx("div", { className: "ff-popup-title" }), + (ele == null ? void 0 : ele["sub-title"]) || /* @__PURE__ */ jsx("div", { className: "ff-popup-sub-title" }) + ] }) : null, + children, + ele != null && ele.extras || ele != null && ele.actions ? /* @__PURE__ */ jsxs("div", { className: "ff-popup-footer", children: [ + (ele == null ? void 0 : ele.extras) || /* @__PURE__ */ jsx("div", { className: "ff-popup-extras" }), + (ele == null ? void 0 : ele.actions) || /* @__PURE__ */ jsx("div", { className: "ff-popup-actions" }) + ] }) : null + ] }); +}; +Popover.defaultProps = { + widgetType: "fsdpf-component" +}; +Popover.propTypes = { + widgetType: PropTypes.oneOf(["fsdpf-component", "grid-layout-form", "data-list"]) +}; +Button.defaultProps = { + type: "default", + iconPosition: "start" +}; +Button.propTypes = { + type: PropTypes.oneOf(["primary", "default", "danger", ""]), + name: PropTypes.string, + // 按钮名称 + icon: PropTypes.string, + // 图标 + iconPosition: PropTypes.oneOf(["start", "end"]), + // 图标位置 + data: PropTypes.any, + // onClick 数据源, 会受到 widgetProps 数据结构影响 + widget: PropTypes.any, + // 组件 + widgetType: PropTypes.oneOf(["destroy", "redirect", "func", "fsdpf-component", "grid-layout-form", "grid-layout", "data-list"]), + // 组件类型 + widgetData: PropTypes.object, + // onClick缺省数据 + widgetProps: PropTypes.object, + // data 数据结构 + widgetSetting: PropTypes.object, + // $setting + widgetContainerProps: PropTypes.object + // 容器配置 +}; +Button.Link = Link; +Button.Link.defaultProps = Button.defaultProps; +Button.Link.propTypes = Button.propTypes; +Button.Circle = Circle; +Button.Circle.defaultProps = Button.defaultProps; +Button.Circle.propTypes = Button.propTypes; +Button.Round = Round; +Button.Round.defaultProps = Button.defaultProps; +Button.Round.propTypes = Button.propTypes; +Button.Dashed = Dashed; +Button.Dashed.defaultProps = Button.defaultProps; +Button.Dashed.propTypes = Button.propTypes; +Button.Popover = Popover; +const GridLayoutFormHelper = ({ $setting, $close, extras, code, primaryKey, ...props }) => { + const [form] = Form$1.useForm(), data2 = useFormData(code, primaryKey, $setting); + useEffect(() => { + data2 && form.setFieldsValue(data2); + }, [data2]); + const onSubmit = () => { + const key = form.getFieldValue("__RESOURCE__"), { + initDataUri = `/api/${code}` + } = $setting || {}; + form.validateFields(!0).then((data22) => key ? _.pick(data22, [key]) : data22).then((data22) => http.post(primaryKey ? `${initDataUri}/${primaryKey}` : `${initDataUri}`, data22).msg($close)).catch(() => FFPopupRender.error("请先完善表单信息", { duration: 2e3 })); + }; + return /* @__PURE__ */ jsx( + FFContainer, + { + actions: /* @__PURE__ */ jsxs(React.Fragment, { children: [ + /* @__PURE__ */ jsx(Button, { name: "保存", type: "primary", widget: onSubmit }), + /* @__PURE__ */ jsx(Button, { name: "取消", widget: () => $close(!1) }) + ] }), + extras, + children: /* @__PURE__ */ jsx(GridLayoutForm$1, { form, code, primaryKey, ...props }) + } + ); +}, getOptionItemByValue = (items, value, depthKey = "children") => { + if (_.isEmpty(items)) + return {}; + const item = _.find(items, ["value", value]); + if (!_.isEmpty(item)) + return item; + const len = items.length; + for (let i = 0; i < len; i++) { + const { [depthKey]: children } = items[i], result = getOptionItemByValue(children, value, depthKey); + if (!_.isEmpty(result)) + return result; + } + return {}; +}, FormModalContainer = ({ fields, formProps, $close }) => { + const [form] = Form$1.useForm(), onSubmit = () => form.validateFields(!0).then($close), formPropsFields = useMemo(() => [ + { name: "__PROPS__", value: formProps } + ], [formProps]); + return /* @__PURE__ */ jsx(FFContainer, { actions: /* @__PURE__ */ jsxs(React.Fragment, { children: [ + /* @__PURE__ */ jsx(Button, { name: "取消", widget: () => $close(!1) }), + /* @__PURE__ */ jsx(Button, { name: "确定", type: "primary", widget: () => onSubmit() }) + ] }), children: /* @__PURE__ */ jsx(ConfigProvider, { theme: { components: { Form: { itemMarginBottom: 6 } } }, children: /* @__PURE__ */ jsx(Form$1, { fields: formPropsFields, layout: "vertical", form, children: fields == null ? void 0 : fields.map(({ code, ...props }) => /* @__PURE__ */ jsx(GridLayoutFormWidget, { code, ...props }, code)) }) }) }); +}; +var _pending, _index, _renders, _onNotificationClick, _onConfirmClick, _onModalClick, _onFormClick, _onModalClose; +const _FFPopupRender = class _FFPopupRender extends React.Component { + constructor(props) { + super(props); + __privateAdd(this, _pending, null); + __privateAdd(this, _index, 0); + __privateAdd(this, _renders, /* @__PURE__ */ new Map()); + __privateAdd(this, _onNotificationClick, (opts) => new Promise((resolve) => { + const index2 = __privateWrapper(this, _index)._++; + __privateGet(this, _renders).set(index2, React.createElement(Notification, { + ...opts, + key: index2, + $close: (flag) => __privateGet(this, _onModalClose).call(this, index2, () => resolve(flag)) + })), this.forceUpdate(); + })); + __privateAdd(this, _onConfirmClick, (content, opts) => new Promise((resolve) => { + const index2 = __privateWrapper(this, _index)._++; + __privateGet(this, _renders).set(index2, React.createElement(Confirm, { + ...opts, + content, + key: index2, + $close: (flag) => __privateGet(this, _onModalClose).call(this, index2, () => resolve(flag)) + })), this.forceUpdate(); + })); + __privateAdd(this, _onModalClick, (widget, widgetProps, { mode, ...widgetContainerProps } = {}) => new Promise((resolve) => { + const index2 = __privateWrapper(this, _index)._++, ref = { current: null }; + __privateGet(this, _renders).set(index2, React.createElement( + mode == "drawer" ? Drawer : Modal, + { + ref, + key: index2, + maskClosable: !1, + ...widgetContainerProps, + $close: (flag) => __privateGet(this, _onModalClose).call(this, index2, () => resolve(flag)) + }, + React.createElement(widget, { + ...widgetProps, + $close: (flag) => ref.current.handleClose(flag) + }) + )), this.forceUpdate(); + })); + __privateAdd(this, _onFormClick, (fields, widgetContainerProps = {}, formProps = {}) => __privateGet(this, _onModalClick).call(this, FormModalContainer, { formProps, fields }, widgetContainerProps).then((resp) => { + if (resp === !1) + throw !1; + return resp; + })); + __privateAdd(this, _onModalClose, (index2, cb) => { + __privateGet(this, _renders).delete(index2), this.forceUpdate(cb); + }); + _FFPopupRender.modal = __privateGet(this, _onModalClick), _FFPopupRender.notification = __privateGet(this, _onNotificationClick), _FFPopupRender.confirm = __privateGet(this, _onConfirmClick), _FFPopupRender.form = __privateGet(this, _onFormClick); + } + componentWillUnmount() { + var _a, _b; + (_b = (_a = __privateGet(this, _pending)) == null ? void 0 : _a[1]) == null || _b.call(_a); + } + render() { + const renders = Array.from(__privateGet(this, _renders)); + return /* @__PURE__ */ jsx(React.Fragment, { children: renders.map(([i, item]) => item) }); + } +}; +_pending = new WeakMap(), _index = new WeakMap(), _renders = new WeakMap(), _onNotificationClick = new WeakMap(), _onConfirmClick = new WeakMap(), _onModalClick = new WeakMap(), _onFormClick = new WeakMap(), _onModalClose = new WeakMap(); +let FFPopupRender = _FFPopupRender; +FFPopupRender.notification = ({ title, content, icon, category, ...opts }) => Promise.resolve(notification$1[category || "open"]({ + ...opts, + icon: icon ? /* @__PURE__ */ jsx(Iconfont, { type: icon || "" }) : void 0, + message: title, + description: content +})); +FFPopupRender.success = (title, opts = {}) => FFPopupRender.notification({ title, category: "success", ...opts }); +FFPopupRender.error = (title, opts = {}) => FFPopupRender.notification({ title, category: "error", ...opts }); +FFPopupRender.confirm = (content, opts = {}) => FFPopupRender.notification({ content, ...opts }); +FFPopupRender.form = (title, opts = {}) => FFPopupRender.notification({ title, ...opts }); +FFPopupRender.modal = (opts = {}) => FFPopupRender.notification(opts); +const USER_MINE = "mine", USER_TOKEN = "token", USER_PLATFORM = "web", USER_TOKEN_EXPIRE = 60 * 60 * 24 * 30, getUserToken = () => { + const token = window.localStorage.getItem(USER_TOKEN); + if (!token) + return ""; + const jwt = token.split("."); + if (!Array.isArray(jwt) || jwt.length !== 3) + throw "登录令牌无效!"; + const { iat } = JSON.parse(window.atob(jwt[1])); + if (Math.floor((/* @__PURE__ */ new Date()).getTime() / 1e3) - iat > USER_TOKEN_EXPIRE) + throw "登录令牌已过期, 请重新登录!"; + return token; +}, checkUserToken = () => { + try { + return !!getUserToken(); + } catch { + return !1; + } +}, getUserInfo = (isAutoLogout = !0) => { + var _a; + try { + const token = getUserToken(); + if (!token) + return Promise.resolve(null); + const { iat: t_iat } = JSON.parse(window.atob((_a = token == null ? void 0 : token.split(".")) == null ? void 0 : _a[1])), { iat: u_iat, ...User } = http.decode(window.localStorage.getItem(USER_MINE) || "", {}); + return u_iat === t_iat ? Promise.resolve(User) : http.get("/api/mine-info").then(({ User: User2 = null }) => (window.localStorage.setItem(USER_MINE, http.encode({ ...User2, iat: t_iat })), User2)); + } catch (e) { + console.error(e), isAutoLogout && FFPopupRender.error("请登录").then(logout); + } + return Promise.resolve(null); +}, login = (username, passwd, opts = {}) => http.post("/api/user-token", { + username, + passwd: SparkMD5.hash(passwd), + platform: USER_PLATFORM, + ...opts +}).then(({ token }) => (window.localStorage.setItem(USER_TOKEN, token), token)), logout = () => { + window.localStorage.removeItem(USER_MINE), window.localStorage.removeItem(USER_TOKEN); +}; +NProgress.configure({ showSpinner: !1 }); +axios.interceptors.request.use((config) => { + config.headers.Platform = "web", config.headers.SaaS = window.localStorage.getItem("SaaS"); + try { + const token = getUserToken(); + config.headers.Authorization = token ? `Bearer ${token} ` : void 0; + } catch { + } + return NProgress.inc(), config; +}, (errMsg) => (NProgress.done(), Promise.reject({ code: -1, msg: errMsg }))); +axios.interceptors.response.use(({ data: data2, headers }) => (NProgress.done(), { ...data2, res: headers == null ? void 0 : headers.res }), function(e) { + return NProgress.done(), Promise.reject(e.message); +}); +window.addEventListener("unhandledrejection", Request.onUnhandledRejection); +Request.onMsg = (code, msg) => FFPopupRender[[0, 1].includes(code) ? "success" : "error"](msg).then(() => code === 20300 && route.redirect(configure.get("Common.WEBSITE_LOGIN_PAGE"))); +const AppContext = React.createContext({ + user: {}, + initUser: () => { + }, + initUserComplete: !1 +}), AppGlobalParamsContext = React.createContext({ + set: () => { + }, + get: () => { + }, + assign: () => { + }, + currentRoute: () => { + } +}); +var _cache, _loading, _pending2, _pResult, _target, _get; +class Cache { + constructor(target, fn2) { + __privateAdd(this, _cache, /* @__PURE__ */ new Map()); + __privateAdd(this, _loading, !0); + __privateAdd(this, _pending2, []); + __privateAdd(this, _pResult, void 0); + __privateAdd(this, _target, () => __privateGet(this, _pResult)); + __privateAdd(this, _get, () => Promise.resolve()); + __publicField(this, "get", (...args) => new Promise((resolve, reject) => { + const key = JSON.stringify(args); + if (__privateGet(this, _cache).has(key)) + return resolve(__privateGet(this, _get).call(this, __privateGet(this, _pResult), ...args)); + if (__privateGet(this, _pResult) === void 0) + __privateGet(this, _pending2).push([args, resolve, reject]), __privateGet(this, _loading) && (__privateSet(this, _loading, !1), Promise.resolve(typeof __privateGet(this, _target) == "function" ? __privateGet(this, _target).call(this) : __privateGet(this, _target)).then((data2) => __privateSet(this, _pResult, data2 || null)).finally(() => { + __privateGet(this, _pending2).forEach(([args2, resolve2, reject2]) => { + try { + const result = __privateGet(this, _get).call(this, __privateGet(this, _pResult), ...args2); + __privateGet(this, _cache).set(JSON.stringify(args2), result), resolve2(result); + } catch (e) { + reject2(e); + } + }), __privateGet(this, _pending2).length = 0; + })); + else { + const result = __privateGet(this, _get).call(this, __privateGet(this, _pResult), ...args); + __privateGet(this, _cache).set(key, result), resolve(result); + } + })); + __privateSet(this, _get, fn2), __privateSet(this, _target, target); + } +} +_cache = new WeakMap(), _loading = new WeakMap(), _pending2 = new WeakMap(), _pResult = new WeakMap(), _target = new WeakMap(), _get = new WeakMap(); +var _instance3, _data2; +const _Configure = class _Configure { + constructor() { + __privateAdd(this, _data2, null); + __publicField(this, "init", (data2) => __privateSet(this, _data2, data2)); + __publicField(this, "get", (key, _default) => _.get(__privateGet(this, _data2), key, _default)); + if (__privateGet(_Configure, _instance3)) + return __privateGet(_Configure, _instance3); + } +}; +_instance3 = new WeakMap(), _data2 = new WeakMap(), __privateAdd(_Configure, _instance3, null), __publicField(_Configure, "getInstance", () => (__privateGet(_Configure, _instance3) || __privateSet(_Configure, _instance3, new _Configure()), __privateGet(_Configure, _instance3))); +let Configure = _Configure; +const configure = Configure.getInstance(), DataList = ({ component: component2 }) => { + const { base62params } = useParams(); + return /* @__PURE__ */ jsx(FFContainer, { children: /* @__PURE__ */ jsx( + DataListHelper, + { + listCode: component2, + base62params: http.decode(base62params) + } + ) }); +}, Component = ({ component: component2, $setting }) => { + const [children, setChildren] = useState(); + useEffect(() => { + if (!component2) + return setChildren(/* @__PURE__ */ jsx(Empty, { description: null })); + core.getWidgetComponent(component2).catch((e) => ({ default: () => `${e}` })).then((pkg) => React.createElement(pkg.default, { $setting })).then(setChildren); + }, [component2]); + const props = {}; + return children ? React.cloneElement(children, props) : null; +}; +var _instance4, _data3, _menus, _router, _findPathById, _getMenuItems; +const _Route = class _Route { + constructor() { + __privateAdd(this, _data3, /* @__PURE__ */ new Map()); + __privateAdd(this, _menus, {}); + __privateAdd(this, _router, null); + __publicField(this, "init", (data2, menus) => { + __privateSet(this, _data3, data2), __privateSet(this, _menus, menus); + }); + __publicField(this, "get", (uuid) => (__privateGet(this, _data3).has(uuid) || (uuid = Array.from(__privateGet(this, _data3).keys()).find((k) => __privateGet(this, _data3).get(k).uri === uuid)), __privateGet(this, _data3).get(uuid) || {})); + __publicField(this, "redirect", (uuid, params, opt = {}) => { + const { uri, type, widgetProps } = this.get(uuid) || {}; + let url = generatePath(uri || uuid, type != "list" ? params : _.mapValues(params, (item) => http.encode(item))); + const oUrlParam = new URLSearchParams(); + for (const key in widgetProps || {}) + (widgetProps == null ? void 0 : widgetProps.type) == "query" && oUrlParam.append(key, params[key]); + return oUrlParam.size > 0 && (url = `${url}?${oUrlParam.toString()}`), __privateGet(this, _router).navigate(url, opt); + }); + /** + * + * @param {*} category // user, system, navigator + * @returns + */ + __publicField(this, "getMenus", (category) => { + var _a; + return ((_a = __privateGet(this, _menus)) == null ? void 0 : _a[category]) || []; + }); + __publicField(this, "findMenuPathByUuid", (uuid) => { + let result = []; + for (const key in __privateGet(this, _menus)) + if (result = __privateGet(this, _findPathById).call(this, __privateGet(this, _menus)[key], uuid, [key]), result.length > 1) + return result; + return result; + }); + __publicField(this, "getMenusByRouteUuid", (key) => __privateGet(this, _getMenuItems).call(this, key, Object.values(__privateGet(this, _menus)).flat())); + __privateAdd(this, _findPathById, (items, target, path = []) => { + if (_.isEmpty(items)) + return path; + for (const { uuid, children } of items) { + if (uuid == target) + return path.concat(uuid); + if (!_.isEmpty(children)) + return path.concat(uuid, __privateGet(this, _findPathById).call(this, children, target)); + } + return path; + }); + __privateAdd(this, _getMenuItems, (key, items) => { + var _a; + let result = []; + for (const item of items) + item.widgetType == "redirect" && (item.uuid == key || item.widget == key ? result.push(item) : (_a = item.children) != null && _a.length && (result = result.concat(__privateGet(this, _getMenuItems).call(this, key, item.children)))); + return result; + }); + __publicField(this, "getCurrentMenu", () => { + const { uuid } = this.getCurrentRoute() || {}; + if (!uuid) + return; + const items = this.getMenusByRouteUuid(uuid); + if (!_.isEmpty(items)) + return items[0]; + }); + __publicField(this, "getCurrentRoute", (delta = 0) => { + var _a; + const route2 = (_a = __privateGet(this, _router).state.matches[__privateGet(this, _router).state.matches.length - 1 - delta]) == null ? void 0 : _a.route; + if (!route2) + return null; + for (let [_key, item] of __privateGet(this, _data3)) + if (item.uri === route2.path) + return item; + return null; + }); + __publicField(this, "getPageParams", (key) => { + var _a; + const { location, matches } = __privateGet(this, _router).state, params = ((_a = matches[matches.length - 1]) == null ? void 0 : _a.params) || {}; + return location.search && new URLSearchParams(location.search).forEach((value, key2) => { + params[key2] = value; + }), key ? _.get(params, key) : params; + }); + __publicField(this, "createBrowserRouter", (opt = {}) => { + if (__privateGet(this, _data3).size == 0) + return null; + const theme = configure.get("Common.WEBSITE_DEFAULT_THEME", "@pkg/frameworks/BasicLayout"), index2 = configure.get(checkUserToken() ? "Common.WEBSITE_LOGIN_REDIRECT" : "Common.WEBSITE_DEFAULT", "/index"), themeMap = { [theme]: 0 }, routes = Array.from(__privateGet(this, _data3).values()).reduce((carry, { uuid, uri, name, type, component: component2, widgetSetting, isLogin, isLayout, extra }) => { + let item = {}, themeIndex = 0; + switch (type) { + case "list": + item.element = React.createElement(DataList, { component: component2 }); + break; + case "fsdpf-component": + item.element = React.createElement(Component, { key: component2, component: component2, $setting: widgetSetting }); + break; + } + if (extra != null && extra.layout) + if (themeMap[extra == null ? void 0 : extra.layout]) + themeIndex = themeMap[extra == null ? void 0 : extra.layout]; + else + return themeMap[extra == null ? void 0 : extra.layout] = carry.length, [...carry, { + path: "/", + lazy: () => core.getWidgetComponent(extra == null ? void 0 : extra.layout).then((resp) => ({ Component: resp.default })), + children: [{ path: uri, ...item }] + }]; + return isLayout && themeIndex > -1 ? (carry[themeIndex].children.push({ path: uri, ...item }), carry) : [...carry, { path: uri, ...item }]; + }, [ + { + path: "/", + lazy: () => core.getWidgetComponent(theme).then((resp) => ({ Component: resp.default })), + children: [] + } + ]); + return routes.push({ index: !0, element: React.createElement(Navigate, { to: index2, replace: !0 }) }), __privateSet(this, _router, createBrowserRouter(routes, opt)); + }); + if (__privateGet(_Route, _instance4)) + return __privateGet(_Route, _instance4); + } +}; +_instance4 = new WeakMap(), _data3 = new WeakMap(), _menus = new WeakMap(), _router = new WeakMap(), _findPathById = new WeakMap(), _getMenuItems = new WeakMap(), __privateAdd(_Route, _instance4, null), __publicField(_Route, "getInstance", () => (__privateGet(_Route, _instance4) || __privateSet(_Route, _instance4, new _Route()), __privateGet(_Route, _instance4))); +let Route = _Route; +const route = Route.getInstance(), oWorker = new Worker(new URL("data:text/plain;base64,KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO2ltcG9ydFNjcmlwdHMoImh0dHBzOi8vYXNzZXRzLmZzZHBmLm5ldC9qcy91bWQvbG9kYXNoQDRfMTdfMjEubWluLmpzIiwiaHR0cHM6Ly9hc3NldHMuZnNkcGYubmV0L2pzL3VtZC9sb2Rhc2gubWl4aW4uanMiKSxpbXBvcnRTY3JpcHRzKCJodHRwczovL2Fzc2V0cy5mc2RwZi5uZXQvanMvdW1kL21vbWVudEAyXzI5XzQubWluLmpzIiwiaHR0cHM6Ly9hc3NldHMuZnNkcGYubmV0L2pzL3VtZC9tb21lbnQubG9jYWxlLnpoLWNuLmpzIiksbW9tZW50LmxvY2FsZSgiemgtY24iKTtjb25zdCBVdGlsPShlLHMpPT57Y29uc3QgdD1VdGlsLm1zZ19pZCsrO3JldHVybiBuZXcgUHJveHkoKCk9Pnt9LHtnZXQoe3Jvb3Q6YX0sbil7Y29uc3Qgbz1hP2Ake2F9LyR7bn1gOm47cmV0dXJuIGZ1bmN0aW9uKC4uLmkpe3JldHVybiBuZXcgUHJvbWlzZSgocixsKT0+e1V0aWwubVF1ZXVlLnNldCh0LFtyLGxdKSxzZWxmLnBvc3RNZXNzYWdlKHtpZDp0LHRhc2tfaWQ6ZSxzZXNzaW9uOnMsY2F0ZWdvcnk6InV0aWwiLG1ldGhvZDpvLGFyZ3M6aX0pfSl9fSxhcHBseShhLG4sbyl7cmV0dXJuIG5ldyBQcm94eShPYmplY3QuY3JlYXRlKHtyb290Om9bMF18fG51bGx9KSx7Z2V0OnRoaXMuZ2V0fSl9fSl9O1V0aWwubXNnX2lkPTAsVXRpbC5tUXVldWU9bmV3IE1hcCxVdGlsLm1NZXRob2RXb3Jrc3BhY2U9bmV3IE1hcCxzZWxmLmFkZEV2ZW50TGlzdGVuZXIoIm1lc3NhZ2UiLGZ1bmN0aW9uKHtkYXRhOntpZDplLGRhdGE6cyxlcnJvcjp0LGNhdGVnb3J5OmF9fSl7YT09PSJ1dGlsIiYmKHQhPT1udWxsP1V0aWwubVF1ZXVlLmdldChlKVsxXSh0KTpVdGlsLm1RdWV1ZS5nZXQoZSlbMF0ocyksVXRpbC5tUXVldWUuZ2V0KGUpLFV0aWwubVF1ZXVlLmRlbGV0ZShlKSl9LCExKSxzZWxmLmFkZEV2ZW50TGlzdGVuZXIoIm1lc3NhZ2UiLCh7ZGF0YTp7aWQsbWV0aG9kLGFyZ3MsY2F0ZWdvcnksc2Vzc2lvbixzb3VyY2VVUkx9fSk9PntpZihjYXRlZ29yeSE9PSJldmFsIilyZXR1cm47c2Vzc2lvbiYmIVV0aWwubU1ldGhvZFdvcmtzcGFjZS5oYXMoc2Vzc2lvbikmJlV0aWwubU1ldGhvZFdvcmtzcGFjZS5zZXQoc2Vzc2lvbix7fSk7Y29uc3QgZXZhbERhdGFTb3VyY2VVUkw9c291cmNlVVJMP2AKLy8jIHNvdXJjZVVSTD1mZjovLy8uLyR7c291cmNlVVJMfWA6IiIsZXZhbERhdGE9ZXZhbChgKGFzeW5jIGZ1bmN0aW9uKHske09iamVjdC5rZXlzKGFyZ3MpLmpvaW4oIiwgIil9fSwgVXRpbCl7JHttZXRob2R9Cn0pJHtldmFsRGF0YVNvdXJjZVVSTH1gKS5jYWxsKHNlc3Npb24/VXRpbC5tTWV0aG9kV29ya3NwYWNlLmdldChzZXNzaW9uKTp7fSxhcmdzLFV0aWwoaWQsc2Vzc2lvbikpO3JldHVybiBQcm9taXNlLnJlc29sdmUoZXZhbERhdGEpLnRoZW4oZT0+e3NlbGYucG9zdE1lc3NhZ2Uoe2lkLHNlc3Npb24sY2F0ZWdvcnksZGF0YTplLGVycm9yOm51bGx9KX0pLmNhdGNoKGU9PntzZWxmLnBvc3RNZXNzYWdlKHtpZCxzZXNzaW9uLGNhdGVnb3J5LGRhdGE6bnVsbCxlcnJvcjplIGluc3RhbmNlb2YgRE9NRXhjZXB0aW9uJiZlLm5hbWU9PT0iRGF0YUNsb25lRXJyb3IiPyJEYXRhQ2xvbmVFcnJvciDov5Tlm57nu5Pmnpzlj6rog73kuLrnroDljZXmlbDmja7moLzlvI8iOmV9KX0pfSksc2VsZi5hZGRFdmVudExpc3RlbmVyKCJtZXNzYWdlIiwoe2RhdGE6e2NhdGVnb3J5OmUsc2Vzc2lvbjpzfX0pPT57ZT09PSJjbGVhciImJlV0aWwubU1ldGhvZFdvcmtzcGFjZS5kZWxldGUocyl9LCExKX0pKCk7Cg==", self.location)), fns = { + getConfigure: (key) => configure.get(key), + route: { + redirect: (...args) => route.redirect(...args), + getPageParams: (...args) => route.getPageParams(...args), + getCurrentRoute: () => route.getCurrentRoute() + }, + modal: { + notification: (...args) => FFPopupRender.notification(...args), + success: (...args) => FFPopupRender.success(...args), + error: (...args) => FFPopupRender.error(...args), + form: (...args) => FFPopupRender.form(...args) + }, + popup: { + notification: (...args) => FFPopupRender.notification(...args), + success: (...args) => FFPopupRender.success(...args), + error: (...args) => FFPopupRender.error(...args), + form: (...args) => FFPopupRender.form(...args) + } +}; +var _msg_id, _fns, _instance5; +const _Func = class _Func { + constructor() { + __publicField(this, "exec", (source, args = {}, fns2 = {}, session = "") => new Promise((resolve, reject) => { + const id = __privateWrapper(_Func, _msg_id)._++; + __privateGet(_Func, _fns).set(id, fns2), _Func.mQueue.set(id, [resolve, reject]), oWorker.postMessage({ id, session, category: "eval", method: source, args }); + })); + __publicField(this, "clear", (session) => oWorker.postMessage({ session, category: "clear" })); + if (__privateGet(_Func, _instance5)) + return __privateGet(_Func, _instance5); + Promise.resolve().then(() => index).then((m) => { + fns.http = m.http; + }), oWorker.addEventListener("message", ({ data: { id, task_id, method, args, category, data: data2, error, session } }) => { + if (category === "eval" && _Func.mQueue.has(id)) + error !== null ? _Func.mQueue.get(id)[1](error) : _Func.mQueue.get(id)[0](data2), __privateGet(_Func, _fns).delete(id), _Func.mQueue.delete(id); + else if (category === "util") + try { + const func2 = _.get(fns, method.split("/")) || _.get(__privateGet(_Func, _fns).get(task_id), method.split("/")); + if (!_.isFunction(func2)) + throw `${method} not found`; + Promise.resolve(Reflect.apply(func2, void 0, args)).then((data3) => { + oWorker.postMessage({ id, task_id, category, method, args, session, data: data3, error: null }); + }).catch((e) => { + oWorker.postMessage({ id, task_id, category, method, args, session, data: null, error: e }); + }); + } catch (e) { + oWorker.postMessage({ id, task_id, category, method, args, session, data: null, error: e }); + } + }, !1); + } +}; +_msg_id = new WeakMap(), _fns = new WeakMap(), _instance5 = new WeakMap(), __publicField(_Func, "mQueue", /* @__PURE__ */ new Map()), __privateAdd(_Func, _msg_id, 0), __privateAdd(_Func, _fns, /* @__PURE__ */ new Map()), __privateAdd(_Func, _instance5, null), __publicField(_Func, "getInstance", () => (__privateGet(_Func, _instance5) || __privateSet(_Func, _instance5, new _Func()), __privateGet(_Func, _instance5))); +let Func = _Func; +const fn = Func.getInstance(); +var _instance6, _cache2; +const _Core = class _Core { + constructor() { + __privateAdd(this, _cache2, /* @__PURE__ */ new Map()); + __publicField(this, "setVendor", (key, vendor) => __privateGet(this, _cache2).set(key, new Cache(vendor, (self2, pkg) => self2.dynamicRequireFsdpfComponent(pkg)))); + __publicField(this, "getWidgetComponent", async (w) => { + if (!w) + throw "getWidgetComponent widget is required"; + const [, ff] = w == null ? void 0 : w.split("@ff/"), [, app] = w == null ? void 0 : w.split("@app/"), [, pkg] = w == null ? void 0 : w.split("@pkg/"), [, fsdpf] = w == null ? void 0 : w.split("@fsdpf/"); + try { + switch (!0) { + case (!!ff && __privateGet(this, _cache2).has("pkg")): + return await __privateGet(this, _cache2).get("pkg").get(ff); + case (!!app && __privateGet(this, _cache2).has("pkg")): + return await __privateGet(this, _cache2).get("pkg").get(app); + case (!!pkg && __privateGet(this, _cache2).has("pkg")): + return await __privateGet(this, _cache2).get("pkg").get(pkg); + case (!!fsdpf && __privateGet(this, _cache2).has("pkg")): + return await __privateGet(this, _cache2).get("pkg").get(fsdpf); + } + } catch (e) { + throw e; + } + }); + if (__privateGet(_Core, _instance6)) + return __privateGet(_Core, _instance6); + } +}; +_instance6 = new WeakMap(), _cache2 = new WeakMap(), __privateAdd(_Core, _instance6, null), __publicField(_Core, "getInstance", () => (__privateGet(_Core, _instance6) || __privateSet(_Core, _instance6, new _Core()), __privateGet(_Core, _instance6))); +let Core = _Core; +const core = Core.getInstance(), convertFns = { + null2json: (data2) => null, + null2array: (data2) => null, + null2number: (data2) => null, + null2bool: (data2) => null, + null2string: (data2) => null, + null2integer: (data2) => null, + null2float: (data2) => null, + // null2json: (data) => ({}), + // null2array: (data) => ([]), + // null2number: (data) => 0, + // null2bool: (data) => false, + // null2string: (data) => '', + string2json: (data2) => data2 ? JSON.parse(data2) : "{}", + string2array: (data2) => data2.substr(0, 1) === "[" && data2.substr(-1) === "]" ? JSON.parse(data2) : data2.split(","), + string2number: (data2) => data2 == "" ? null : +data2, + string2integer: (data2) => data2 == "" ? null : +data2, + string2float: (data2) => data2 == "" ? null : +data2, + string2bool: (data2) => { + switch (`${data2}`.toLowerCase()) { + case "0": + case "false": + case "[]": + case "{}": + return !1; + } + return !!data2; + }, + string2string: (data2) => data2, + json2json: (data2) => data2, + json2array: (data2) => data2 ? Object.values(data2) : [], + json2number: (data2) => Object.keys(data2).length, + json2integer: (data2) => Object.keys(data2).length, + json2float: (data2) => Object.keys(data2).length, + json2bool: (data2) => Object.keys(data2).length > 0, + json2string: (data2) => data2 ? JSON.stringify(data2) : "", + array2json: (data2) => ({ ...data2 }), + array2array: (data2) => data2, + array2number: (data2) => data2.length, + array2integer: (data2) => data2.length, + array2float: (data2) => data2.length, + array2bool: (data2) => data2.length > 0, + array2string: (data2) => JSON.stringify(data2), + number2json: (data2) => ({}), + number2array: (data2) => [data2], + number2number: (data2) => data2, + number2integer: (data2) => data2, + number2float: (data2) => data2, + number2bool: (data2) => !!data2, + number2string: (data2) => data2.toString(), + boolean2json: (data2) => ({}), + boolean2array: (data2) => [], + boolean2number: (data2) => +data2, + boolean2integer: (data2) => +data2, + boolean2float: (data2) => +data2, + boolean2bool: (data2) => data2, + boolean2string: (data2) => data2 ? "true" : "false" +}; +_.mixin({ + toPairsDeep: (obj, i) => _.flatMap( + _.toPairs(obj), + ([k, v]) => _.isObjectLike(v) ? _.toPairsDeep(v, k) : [[`${_.isUndefined(i) ? "" : i + "."}${k}`, v]] + ), + deepSome: (items, func2 = () => !1) => _.some(items, (item) => { + if (_.some(item, func2)) + return !0; + if (!_.isEmpty(item) && (_.isPlainObject(item) || _.isArray(item))) + return _.deepSome(item, func2); + }), + toPrimitive: (data2, type) => { + let sourceType = "string"; + Array.isArray(data2) ? sourceType = "array" : sourceType = typeof data2, _.isObject(data2) && (sourceType = "json"); + const fn2 = `${sourceType}2${type}`; + return Reflect.has(convertFns, fn2) ? convertFns[fn2](data2) : data2; + }, + replaceKeys: (obj, keyMap) => !obj || typeof obj != "object" ? obj : Array.isArray(obj) ? obj.map((item) => _.replaceKeys(item, keyMap)) : Object.keys(obj).reduce((acc, key) => (keyMap[key] ? acc[keyMap[key]] = _.replaceKeys(obj[key], keyMap) : acc[key] = _.replaceKeys(obj[key], keyMap), acc), {}) +}); +let AppUrl = ""; +const http = { + init: (appKey, appSecret, appUrl) => { + axios.defaults.baseURL = AppUrl = appUrl, axios.defaults.timeout = 15e3, Object.assign(http, new Request(appKey, appSecret, axios)); + } +}, isReactComponent = (component2) => component2 != null && component2.name ? component2.prototype instanceof React.Component ? !0 : /^[A-Z]/.test(component2.name) : !1, index = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ + __proto__: null, + AppGlobalParamsContext, + get AppUrl() { + return AppUrl; + }, + cache: Cache, + configure, + core, + default: AppContext, + func: fn, + http, + isReactComponent, + route +}, Symbol.toStringTag, { value: "Module" })), getRoutes = () => http.get("/api/my-router").then((resp) => [ + ...resp, + { uuid: "data-list-setting", isLayout: !0, uri: "/data-list-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/components/ff-design/DataListSetting", extra: { layout: "@pkg/frameworks/DesignTheme" } }, + { uuid: "grid-layout-setting", isLayout: !0, uri: "/grid-layout-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/components/ff-design/GridLayoutSetting", extra: { layout: "@pkg/frameworks/DesignTheme" } }, + { uuid: "grid-layout-form-setting", isLayout: !0, uri: "/grid-layout-form-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/components/ff-design/GridLayoutFormSetting", extra: { layout: "@pkg/frameworks/DesignTheme" } }, + { uuid: "resource-api-setting", isLayout: !0, uri: "/resource-api-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/components/ff-design/ResourceApiSetting", extra: { layout: "@pkg/frameworks/DesignTheme" } }, + { uuid: "charts-setting", isLayout: !0, uri: "/resource-api-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/components/ff-design/ChartsSetting", extra: { layout: "@pkg/frameworks/DesignTheme" } }, + { uuid: "fsm-setting", isLayout: !0, uri: "/fsm-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/components/ff-design/FsmSetting", extra: { layout: "@pkg/frameworks/DesignTheme" } }, + { uuid: "component-setting", isLayout: !0, uri: "/component-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/components/ff-design/ComponentSetting", extra: { layout: "@pkg/frameworks/DesignTheme" } }, + { uuid: "login", uri: "/login", name: "登录", type: "fsdpf-component", isLogin: !1, component: "@pkg/components/ff/Login" }, + { uuid: "not-found", uri: "*", name: "Not Found", type: "fsdpf-component", isLogin: !1, component: "@pkg/components/ff/NotFound" } +].map(({ uuid, ...item }) => [uuid, { uuid, ...item }])).then((data2) => new Map(data2)), getMenus = () => http.get("/api/my-menu"), getConfigure = () => http.get("api/init-configure"), getWidgetOperationAuth = () => http.get("/api/init-widget-operation-auth").then((resp) => resp.reduce((carry, { uuid, auth: auth2 }) => [...carry, [uuid, auth2]], [])), getPhoneNumber = (code) => http.get(`/api/user-wx-phone-number/${code}`); +export { + configure as $, + useHasOperationColumn as A, + Button as B, + useButton as C, + DataList$1 as D, + auth as E, + FFContainer as F, + GridLayout$1 as G, + GridLayoutForm$1 as H, + GridLayoutForm as I, + GridLayoutFormWidget as J, + GridLayoutFormHelper as K, + useFnRun as L, + getOptionItemByValue as M, + Iconfont as N, + getUserToken as O, + checkUserToken as P, + getUserInfo as Q, + ResWs$1 as R, + SlotContext as S, + login as T, + logout as U, + AppUrl as V, + http as W, + isReactComponent as X, + AppContext as Y, + AppGlobalParamsContext as Z, + Cache as _, + usePropsValue as a, + fn as a0, + core as a1, + route as a2, + getRoutes as a3, + getMenus as a4, + getConfigure as a5, + getWidgetOperationAuth as a6, + getPhoneNumber as a7, + usePrevious as b, + useStateWithCallback as c, + useDeepEqualEffect as d, + useOptions as e, + useSubscribeRequest as f, + SlotRender as g, + FFPageRender as h, + FFPopupRender as i, + getDefaultExpandRowKeys as j, + GridLayout as k, + GridLayoutWidget as l, + DataListFilter as m, + DataListToolbar as n, + DataListSider as o, + DataListFooter as p, + DataListHelper as q, + DataListContext as r, + DataListTable as s, + DataListContent as t, + useUpdate as u, + DataListFramework as v, + loadDataListFieldWidget as w, + useColumnsRender as x, + useStructure as y, + useDataSource as z +}; diff --git a/dist/common/vender-CMS8SASe.js b/dist/common/vender-CMS8SASe.js new file mode 100644 index 0000000..b142876 --- /dev/null +++ b/dist/common/vender-CMS8SASe.js @@ -0,0 +1,835 @@ +var commonjsGlobal = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}; +function getDefaultExportFromCjs(x) { + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x.default : x; +} +var propTypes = { exports: {} }, reactIs = { exports: {} }, reactIs_production_min = {}; +/** @license React v16.13.1 + * react-is.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +var hasRequiredReactIs_production_min; +function requireReactIs_production_min() { + if (hasRequiredReactIs_production_min) + return reactIs_production_min; + hasRequiredReactIs_production_min = 1; + var b = typeof Symbol == "function" && Symbol.for, c = b ? Symbol.for("react.element") : 60103, d = b ? Symbol.for("react.portal") : 60106, e = b ? Symbol.for("react.fragment") : 60107, f = b ? Symbol.for("react.strict_mode") : 60108, g = b ? Symbol.for("react.profiler") : 60114, h = b ? Symbol.for("react.provider") : 60109, k = b ? Symbol.for("react.context") : 60110, l = b ? Symbol.for("react.async_mode") : 60111, m = b ? Symbol.for("react.concurrent_mode") : 60111, n = b ? Symbol.for("react.forward_ref") : 60112, p = b ? Symbol.for("react.suspense") : 60113, q = b ? Symbol.for("react.suspense_list") : 60120, r = b ? Symbol.for("react.memo") : 60115, t = b ? Symbol.for("react.lazy") : 60116, v = b ? Symbol.for("react.block") : 60121, w = b ? Symbol.for("react.fundamental") : 60117, x = b ? Symbol.for("react.responder") : 60118, y = b ? Symbol.for("react.scope") : 60119; + function z(a) { + if (typeof a == "object" && a !== null) { + var u = a.$$typeof; + switch (u) { + case c: + switch (a = a.type, a) { + case l: + case m: + case e: + case g: + case f: + case p: + return a; + default: + switch (a = a && a.$$typeof, a) { + case k: + case n: + case t: + case r: + case h: + return a; + default: + return u; + } + } + case d: + return u; + } + } + } + function A(a) { + return z(a) === m; + } + return reactIs_production_min.AsyncMode = l, reactIs_production_min.ConcurrentMode = m, reactIs_production_min.ContextConsumer = k, reactIs_production_min.ContextProvider = h, reactIs_production_min.Element = c, reactIs_production_min.ForwardRef = n, reactIs_production_min.Fragment = e, reactIs_production_min.Lazy = t, reactIs_production_min.Memo = r, reactIs_production_min.Portal = d, reactIs_production_min.Profiler = g, reactIs_production_min.StrictMode = f, reactIs_production_min.Suspense = p, reactIs_production_min.isAsyncMode = function(a) { + return A(a) || z(a) === l; + }, reactIs_production_min.isConcurrentMode = A, reactIs_production_min.isContextConsumer = function(a) { + return z(a) === k; + }, reactIs_production_min.isContextProvider = function(a) { + return z(a) === h; + }, reactIs_production_min.isElement = function(a) { + return typeof a == "object" && a !== null && a.$$typeof === c; + }, reactIs_production_min.isForwardRef = function(a) { + return z(a) === n; + }, reactIs_production_min.isFragment = function(a) { + return z(a) === e; + }, reactIs_production_min.isLazy = function(a) { + return z(a) === t; + }, reactIs_production_min.isMemo = function(a) { + return z(a) === r; + }, reactIs_production_min.isPortal = function(a) { + return z(a) === d; + }, reactIs_production_min.isProfiler = function(a) { + return z(a) === g; + }, reactIs_production_min.isStrictMode = function(a) { + return z(a) === f; + }, reactIs_production_min.isSuspense = function(a) { + return z(a) === p; + }, reactIs_production_min.isValidElementType = function(a) { + return typeof a == "string" || typeof a == "function" || a === e || a === m || a === g || a === f || a === p || a === q || typeof a == "object" && a !== null && (a.$$typeof === t || a.$$typeof === r || a.$$typeof === h || a.$$typeof === k || a.$$typeof === n || a.$$typeof === w || a.$$typeof === x || a.$$typeof === y || a.$$typeof === v); + }, reactIs_production_min.typeOf = z, reactIs_production_min; +} +var reactIs_development = {}; +/** @license React v16.13.1 + * react-is.development.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +var hasRequiredReactIs_development; +function requireReactIs_development() { + return hasRequiredReactIs_development || (hasRequiredReactIs_development = 1, process.env.NODE_ENV !== "production" && function() { + var hasSymbol = typeof Symbol == "function" && Symbol.for, REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for("react.element") : 60103, REACT_PORTAL_TYPE = hasSymbol ? Symbol.for("react.portal") : 60106, REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for("react.fragment") : 60107, REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for("react.strict_mode") : 60108, REACT_PROFILER_TYPE = hasSymbol ? Symbol.for("react.profiler") : 60114, REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for("react.provider") : 60109, REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for("react.context") : 60110, REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for("react.async_mode") : 60111, REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for("react.concurrent_mode") : 60111, REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for("react.forward_ref") : 60112, REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for("react.suspense") : 60113, REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for("react.suspense_list") : 60120, REACT_MEMO_TYPE = hasSymbol ? Symbol.for("react.memo") : 60115, REACT_LAZY_TYPE = hasSymbol ? Symbol.for("react.lazy") : 60116, REACT_BLOCK_TYPE = hasSymbol ? Symbol.for("react.block") : 60121, REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for("react.fundamental") : 60117, REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for("react.responder") : 60118, REACT_SCOPE_TYPE = hasSymbol ? Symbol.for("react.scope") : 60119; + function isValidElementType(type) { + return typeof type == "string" || typeof type == "function" || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill. + type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type == "object" && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE); + } + function typeOf(object) { + if (typeof object == "object" && object !== null) { + var $$typeof = object.$$typeof; + switch ($$typeof) { + case REACT_ELEMENT_TYPE: + var type = object.type; + switch (type) { + case REACT_ASYNC_MODE_TYPE: + case REACT_CONCURRENT_MODE_TYPE: + case REACT_FRAGMENT_TYPE: + case REACT_PROFILER_TYPE: + case REACT_STRICT_MODE_TYPE: + case REACT_SUSPENSE_TYPE: + return type; + default: + var $$typeofType = type && type.$$typeof; + switch ($$typeofType) { + case REACT_CONTEXT_TYPE: + case REACT_FORWARD_REF_TYPE: + case REACT_LAZY_TYPE: + case REACT_MEMO_TYPE: + case REACT_PROVIDER_TYPE: + return $$typeofType; + default: + return $$typeof; + } + } + case REACT_PORTAL_TYPE: + return $$typeof; + } + } + } + var AsyncMode = REACT_ASYNC_MODE_TYPE, ConcurrentMode = REACT_CONCURRENT_MODE_TYPE, ContextConsumer = REACT_CONTEXT_TYPE, ContextProvider = REACT_PROVIDER_TYPE, Element = REACT_ELEMENT_TYPE, ForwardRef = REACT_FORWARD_REF_TYPE, Fragment = REACT_FRAGMENT_TYPE, Lazy = REACT_LAZY_TYPE, Memo = REACT_MEMO_TYPE, Portal = REACT_PORTAL_TYPE, Profiler = REACT_PROFILER_TYPE, StrictMode = REACT_STRICT_MODE_TYPE, Suspense = REACT_SUSPENSE_TYPE, hasWarnedAboutDeprecatedIsAsyncMode = !1; + function isAsyncMode(object) { + return hasWarnedAboutDeprecatedIsAsyncMode || (hasWarnedAboutDeprecatedIsAsyncMode = !0, console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")), isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE; + } + function isConcurrentMode(object) { + return typeOf(object) === REACT_CONCURRENT_MODE_TYPE; + } + function isContextConsumer(object) { + return typeOf(object) === REACT_CONTEXT_TYPE; + } + function isContextProvider(object) { + return typeOf(object) === REACT_PROVIDER_TYPE; + } + function isElement(object) { + return typeof object == "object" && object !== null && object.$$typeof === REACT_ELEMENT_TYPE; + } + function isForwardRef(object) { + return typeOf(object) === REACT_FORWARD_REF_TYPE; + } + function isFragment(object) { + return typeOf(object) === REACT_FRAGMENT_TYPE; + } + function isLazy(object) { + return typeOf(object) === REACT_LAZY_TYPE; + } + function isMemo(object) { + return typeOf(object) === REACT_MEMO_TYPE; + } + function isPortal(object) { + return typeOf(object) === REACT_PORTAL_TYPE; + } + function isProfiler(object) { + return typeOf(object) === REACT_PROFILER_TYPE; + } + function isStrictMode(object) { + return typeOf(object) === REACT_STRICT_MODE_TYPE; + } + function isSuspense(object) { + return typeOf(object) === REACT_SUSPENSE_TYPE; + } + reactIs_development.AsyncMode = AsyncMode, reactIs_development.ConcurrentMode = ConcurrentMode, reactIs_development.ContextConsumer = ContextConsumer, reactIs_development.ContextProvider = ContextProvider, reactIs_development.Element = Element, reactIs_development.ForwardRef = ForwardRef, reactIs_development.Fragment = Fragment, reactIs_development.Lazy = Lazy, reactIs_development.Memo = Memo, reactIs_development.Portal = Portal, reactIs_development.Profiler = Profiler, reactIs_development.StrictMode = StrictMode, reactIs_development.Suspense = Suspense, reactIs_development.isAsyncMode = isAsyncMode, reactIs_development.isConcurrentMode = isConcurrentMode, reactIs_development.isContextConsumer = isContextConsumer, reactIs_development.isContextProvider = isContextProvider, reactIs_development.isElement = isElement, reactIs_development.isForwardRef = isForwardRef, reactIs_development.isFragment = isFragment, reactIs_development.isLazy = isLazy, reactIs_development.isMemo = isMemo, reactIs_development.isPortal = isPortal, reactIs_development.isProfiler = isProfiler, reactIs_development.isStrictMode = isStrictMode, reactIs_development.isSuspense = isSuspense, reactIs_development.isValidElementType = isValidElementType, reactIs_development.typeOf = typeOf; + }()), reactIs_development; +} +var hasRequiredReactIs; +function requireReactIs() { + return hasRequiredReactIs || (hasRequiredReactIs = 1, process.env.NODE_ENV === "production" ? reactIs.exports = requireReactIs_production_min() : reactIs.exports = requireReactIs_development()), reactIs.exports; +} +/* +object-assign +(c) Sindre Sorhus +@license MIT +*/ +var objectAssign, hasRequiredObjectAssign; +function requireObjectAssign() { + if (hasRequiredObjectAssign) + return objectAssign; + hasRequiredObjectAssign = 1; + var getOwnPropertySymbols = Object.getOwnPropertySymbols, hasOwnProperty = Object.prototype.hasOwnProperty, propIsEnumerable = Object.prototype.propertyIsEnumerable; + function toObject(val) { + if (val == null) + throw new TypeError("Object.assign cannot be called with null or undefined"); + return Object(val); + } + function shouldUseNative() { + try { + if (!Object.assign) + return !1; + var test1 = new String("abc"); + if (test1[5] = "de", Object.getOwnPropertyNames(test1)[0] === "5") + return !1; + for (var test2 = {}, i = 0; i < 10; i++) + test2["_" + String.fromCharCode(i)] = i; + var order2 = Object.getOwnPropertyNames(test2).map(function(n) { + return test2[n]; + }); + if (order2.join("") !== "0123456789") + return !1; + var test3 = {}; + return "abcdefghijklmnopqrst".split("").forEach(function(letter) { + test3[letter] = letter; + }), Object.keys(Object.assign({}, test3)).join("") === "abcdefghijklmnopqrst"; + } catch { + return !1; + } + } + return objectAssign = shouldUseNative() ? Object.assign : function(target, source) { + for (var from, to = toObject(target), symbols, s = 1; s < arguments.length; s++) { + from = Object(arguments[s]); + for (var key in from) + hasOwnProperty.call(from, key) && (to[key] = from[key]); + if (getOwnPropertySymbols) { + symbols = getOwnPropertySymbols(from); + for (var i = 0; i < symbols.length; i++) + propIsEnumerable.call(from, symbols[i]) && (to[symbols[i]] = from[symbols[i]]); + } + } + return to; + }, objectAssign; +} +var ReactPropTypesSecret_1, hasRequiredReactPropTypesSecret; +function requireReactPropTypesSecret() { + if (hasRequiredReactPropTypesSecret) + return ReactPropTypesSecret_1; + hasRequiredReactPropTypesSecret = 1; + var ReactPropTypesSecret = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"; + return ReactPropTypesSecret_1 = ReactPropTypesSecret, ReactPropTypesSecret_1; +} +var has, hasRequiredHas; +function requireHas() { + return hasRequiredHas || (hasRequiredHas = 1, has = Function.call.bind(Object.prototype.hasOwnProperty)), has; +} +var checkPropTypes_1, hasRequiredCheckPropTypes; +function requireCheckPropTypes() { + if (hasRequiredCheckPropTypes) + return checkPropTypes_1; + hasRequiredCheckPropTypes = 1; + var printWarning = function() { + }; + if (process.env.NODE_ENV !== "production") { + var ReactPropTypesSecret = requireReactPropTypesSecret(), loggedTypeFailures = {}, has2 = requireHas(); + printWarning = function(text) { + var message = "Warning: " + text; + typeof console < "u" && console.error(message); + try { + throw new Error(message); + } catch { + } + }; + } + function checkPropTypes(typeSpecs, values, location, componentName, getStack) { + if (process.env.NODE_ENV !== "production") { + for (var typeSpecName in typeSpecs) + if (has2(typeSpecs, typeSpecName)) { + var error; + try { + if (typeof typeSpecs[typeSpecName] != "function") { + var err = Error( + (componentName || "React class") + ": " + location + " type `" + typeSpecName + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof typeSpecs[typeSpecName] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`." + ); + throw err.name = "Invariant Violation", err; + } + error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret); + } catch (ex) { + error = ex; + } + if (error && !(error instanceof Error) && printWarning( + (componentName || "React class") + ": type specification of " + location + " `" + typeSpecName + "` is invalid; the type checker function must return `null` or an `Error` but returned a " + typeof error + ". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)." + ), error instanceof Error && !(error.message in loggedTypeFailures)) { + loggedTypeFailures[error.message] = !0; + var stack = getStack ? getStack() : ""; + printWarning( + "Failed " + location + " type: " + error.message + (stack ?? "") + ); + } + } + } + } + return checkPropTypes.resetWarningCache = function() { + process.env.NODE_ENV !== "production" && (loggedTypeFailures = {}); + }, checkPropTypes_1 = checkPropTypes, checkPropTypes_1; +} +var factoryWithTypeCheckers, hasRequiredFactoryWithTypeCheckers; +function requireFactoryWithTypeCheckers() { + if (hasRequiredFactoryWithTypeCheckers) + return factoryWithTypeCheckers; + hasRequiredFactoryWithTypeCheckers = 1; + var ReactIs = requireReactIs(), assign = requireObjectAssign(), ReactPropTypesSecret = requireReactPropTypesSecret(), has2 = requireHas(), checkPropTypes = requireCheckPropTypes(), printWarning = function() { + }; + process.env.NODE_ENV !== "production" && (printWarning = function(text) { + var message = "Warning: " + text; + typeof console < "u" && console.error(message); + try { + throw new Error(message); + } catch { + } + }); + function emptyFunctionThatReturnsNull() { + return null; + } + return factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) { + var ITERATOR_SYMBOL = typeof Symbol == "function" && Symbol.iterator, FAUX_ITERATOR_SYMBOL = "@@iterator"; + function getIteratorFn(maybeIterable) { + var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]); + if (typeof iteratorFn == "function") + return iteratorFn; + } + var ANONYMOUS = "<>", ReactPropTypes = { + array: createPrimitiveTypeChecker("array"), + bigint: createPrimitiveTypeChecker("bigint"), + bool: createPrimitiveTypeChecker("boolean"), + func: createPrimitiveTypeChecker("function"), + number: createPrimitiveTypeChecker("number"), + object: createPrimitiveTypeChecker("object"), + string: createPrimitiveTypeChecker("string"), + symbol: createPrimitiveTypeChecker("symbol"), + any: createAnyTypeChecker(), + arrayOf: createArrayOfTypeChecker, + element: createElementTypeChecker(), + elementType: createElementTypeTypeChecker(), + instanceOf: createInstanceTypeChecker, + node: createNodeChecker(), + objectOf: createObjectOfTypeChecker, + oneOf: createEnumTypeChecker, + oneOfType: createUnionTypeChecker, + shape: createShapeTypeChecker, + exact: createStrictShapeTypeChecker + }; + function is(x, y) { + return x === y ? x !== 0 || 1 / x === 1 / y : x !== x && y !== y; + } + function PropTypeError(message, data) { + this.message = message, this.data = data && typeof data == "object" ? data : {}, this.stack = ""; + } + PropTypeError.prototype = Error.prototype; + function createChainableTypeChecker(validate) { + if (process.env.NODE_ENV !== "production") + var manualPropTypeCallCache = {}, manualPropTypeWarningCount = 0; + function checkType(isRequired, props, propName, componentName, location, propFullName, secret) { + if (componentName = componentName || ANONYMOUS, propFullName = propFullName || propName, secret !== ReactPropTypesSecret) { + if (throwOnDirectAccess) { + var err = new Error( + "Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types" + ); + throw err.name = "Invariant Violation", err; + } else if (process.env.NODE_ENV !== "production" && typeof console < "u") { + var cacheKey = componentName + ":" + propName; + !manualPropTypeCallCache[cacheKey] && // Avoid spamming the console because they are often not actionable except for lib authors + manualPropTypeWarningCount < 3 && (printWarning( + "You are manually calling a React.PropTypes validation function for the `" + propFullName + "` prop on `" + componentName + "`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details." + ), manualPropTypeCallCache[cacheKey] = !0, manualPropTypeWarningCount++); + } + } + return props[propName] == null ? isRequired ? props[propName] === null ? new PropTypeError("The " + location + " `" + propFullName + "` is marked as required " + ("in `" + componentName + "`, but its value is `null`.")) : new PropTypeError("The " + location + " `" + propFullName + "` is marked as required in " + ("`" + componentName + "`, but its value is `undefined`.")) : null : validate(props, propName, componentName, location, propFullName); + } + var chainedCheckType = checkType.bind(null, !1); + return chainedCheckType.isRequired = checkType.bind(null, !0), chainedCheckType; + } + function createPrimitiveTypeChecker(expectedType) { + function validate(props, propName, componentName, location, propFullName, secret) { + var propValue = props[propName], propType = getPropType(propValue); + if (propType !== expectedType) { + var preciseType = getPreciseType(propValue); + return new PropTypeError( + "Invalid " + location + " `" + propFullName + "` of type " + ("`" + preciseType + "` supplied to `" + componentName + "`, expected ") + ("`" + expectedType + "`."), + { expectedType } + ); + } + return null; + } + return createChainableTypeChecker(validate); + } + function createAnyTypeChecker() { + return createChainableTypeChecker(emptyFunctionThatReturnsNull); + } + function createArrayOfTypeChecker(typeChecker) { + function validate(props, propName, componentName, location, propFullName) { + if (typeof typeChecker != "function") + return new PropTypeError("Property `" + propFullName + "` of component `" + componentName + "` has invalid PropType notation inside arrayOf."); + var propValue = props[propName]; + if (!Array.isArray(propValue)) { + var propType = getPropType(propValue); + return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected an array.")); + } + for (var i = 0; i < propValue.length; i++) { + var error = typeChecker(propValue, i, componentName, location, propFullName + "[" + i + "]", ReactPropTypesSecret); + if (error instanceof Error) + return error; + } + return null; + } + return createChainableTypeChecker(validate); + } + function createElementTypeChecker() { + function validate(props, propName, componentName, location, propFullName) { + var propValue = props[propName]; + if (!isValidElement(propValue)) { + var propType = getPropType(propValue); + return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected a single ReactElement.")); + } + return null; + } + return createChainableTypeChecker(validate); + } + function createElementTypeTypeChecker() { + function validate(props, propName, componentName, location, propFullName) { + var propValue = props[propName]; + if (!ReactIs.isValidElementType(propValue)) { + var propType = getPropType(propValue); + return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected a single ReactElement type.")); + } + return null; + } + return createChainableTypeChecker(validate); + } + function createInstanceTypeChecker(expectedClass) { + function validate(props, propName, componentName, location, propFullName) { + if (!(props[propName] instanceof expectedClass)) { + var expectedClassName = expectedClass.name || ANONYMOUS, actualClassName = getClassName(props[propName]); + return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + actualClassName + "` supplied to `" + componentName + "`, expected ") + ("instance of `" + expectedClassName + "`.")); + } + return null; + } + return createChainableTypeChecker(validate); + } + function createEnumTypeChecker(expectedValues) { + if (!Array.isArray(expectedValues)) + return process.env.NODE_ENV !== "production" && (arguments.length > 1 ? printWarning( + "Invalid arguments supplied to oneOf, expected an array, got " + arguments.length + " arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])." + ) : printWarning("Invalid argument supplied to oneOf, expected an array.")), emptyFunctionThatReturnsNull; + function validate(props, propName, componentName, location, propFullName) { + for (var propValue = props[propName], i = 0; i < expectedValues.length; i++) + if (is(propValue, expectedValues[i])) + return null; + var valuesString = JSON.stringify(expectedValues, function(key, value) { + var type = getPreciseType(value); + return type === "symbol" ? String(value) : value; + }); + return new PropTypeError("Invalid " + location + " `" + propFullName + "` of value `" + String(propValue) + "` " + ("supplied to `" + componentName + "`, expected one of " + valuesString + ".")); + } + return createChainableTypeChecker(validate); + } + function createObjectOfTypeChecker(typeChecker) { + function validate(props, propName, componentName, location, propFullName) { + if (typeof typeChecker != "function") + return new PropTypeError("Property `" + propFullName + "` of component `" + componentName + "` has invalid PropType notation inside objectOf."); + var propValue = props[propName], propType = getPropType(propValue); + if (propType !== "object") + return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected an object.")); + for (var key in propValue) + if (has2(propValue, key)) { + var error = typeChecker(propValue, key, componentName, location, propFullName + "." + key, ReactPropTypesSecret); + if (error instanceof Error) + return error; + } + return null; + } + return createChainableTypeChecker(validate); + } + function createUnionTypeChecker(arrayOfTypeCheckers) { + if (!Array.isArray(arrayOfTypeCheckers)) + return process.env.NODE_ENV !== "production" && printWarning("Invalid argument supplied to oneOfType, expected an instance of array."), emptyFunctionThatReturnsNull; + for (var i = 0; i < arrayOfTypeCheckers.length; i++) { + var checker = arrayOfTypeCheckers[i]; + if (typeof checker != "function") + return printWarning( + "Invalid argument supplied to oneOfType. Expected an array of check functions, but received " + getPostfixForTypeWarning(checker) + " at index " + i + "." + ), emptyFunctionThatReturnsNull; + } + function validate(props, propName, componentName, location, propFullName) { + for (var expectedTypes = [], i2 = 0; i2 < arrayOfTypeCheckers.length; i2++) { + var checker2 = arrayOfTypeCheckers[i2], checkerResult = checker2(props, propName, componentName, location, propFullName, ReactPropTypesSecret); + if (checkerResult == null) + return null; + checkerResult.data && has2(checkerResult.data, "expectedType") && expectedTypes.push(checkerResult.data.expectedType); + } + var expectedTypesMessage = expectedTypes.length > 0 ? ", expected one of type [" + expectedTypes.join(", ") + "]" : ""; + return new PropTypeError("Invalid " + location + " `" + propFullName + "` supplied to " + ("`" + componentName + "`" + expectedTypesMessage + ".")); + } + return createChainableTypeChecker(validate); + } + function createNodeChecker() { + function validate(props, propName, componentName, location, propFullName) { + return isNode(props[propName]) ? null : new PropTypeError("Invalid " + location + " `" + propFullName + "` supplied to " + ("`" + componentName + "`, expected a ReactNode.")); + } + return createChainableTypeChecker(validate); + } + function invalidValidatorError(componentName, location, propFullName, key, type) { + return new PropTypeError( + (componentName || "React class") + ": " + location + " type `" + propFullName + "." + key + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + type + "`." + ); + } + function createShapeTypeChecker(shapeTypes) { + function validate(props, propName, componentName, location, propFullName) { + var propValue = props[propName], propType = getPropType(propValue); + if (propType !== "object") + return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type `" + propType + "` " + ("supplied to `" + componentName + "`, expected `object`.")); + for (var key in shapeTypes) { + var checker = shapeTypes[key]; + if (typeof checker != "function") + return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker)); + var error = checker(propValue, key, componentName, location, propFullName + "." + key, ReactPropTypesSecret); + if (error) + return error; + } + return null; + } + return createChainableTypeChecker(validate); + } + function createStrictShapeTypeChecker(shapeTypes) { + function validate(props, propName, componentName, location, propFullName) { + var propValue = props[propName], propType = getPropType(propValue); + if (propType !== "object") + return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type `" + propType + "` " + ("supplied to `" + componentName + "`, expected `object`.")); + var allKeys = assign({}, props[propName], shapeTypes); + for (var key in allKeys) { + var checker = shapeTypes[key]; + if (has2(shapeTypes, key) && typeof checker != "function") + return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker)); + if (!checker) + return new PropTypeError( + "Invalid " + location + " `" + propFullName + "` key `" + key + "` supplied to `" + componentName + "`.\nBad object: " + JSON.stringify(props[propName], null, " ") + ` +Valid keys: ` + JSON.stringify(Object.keys(shapeTypes), null, " ") + ); + var error = checker(propValue, key, componentName, location, propFullName + "." + key, ReactPropTypesSecret); + if (error) + return error; + } + return null; + } + return createChainableTypeChecker(validate); + } + function isNode(propValue) { + switch (typeof propValue) { + case "number": + case "string": + case "undefined": + return !0; + case "boolean": + return !propValue; + case "object": + if (Array.isArray(propValue)) + return propValue.every(isNode); + if (propValue === null || isValidElement(propValue)) + return !0; + var iteratorFn = getIteratorFn(propValue); + if (iteratorFn) { + var iterator = iteratorFn.call(propValue), step; + if (iteratorFn !== propValue.entries) { + for (; !(step = iterator.next()).done; ) + if (!isNode(step.value)) + return !1; + } else + for (; !(step = iterator.next()).done; ) { + var entry = step.value; + if (entry && !isNode(entry[1])) + return !1; + } + } else + return !1; + return !0; + default: + return !1; + } + } + function isSymbol(propType, propValue) { + return propType === "symbol" ? !0 : propValue ? propValue["@@toStringTag"] === "Symbol" || typeof Symbol == "function" && propValue instanceof Symbol : !1; + } + function getPropType(propValue) { + var propType = typeof propValue; + return Array.isArray(propValue) ? "array" : propValue instanceof RegExp ? "object" : isSymbol(propType, propValue) ? "symbol" : propType; + } + function getPreciseType(propValue) { + if (typeof propValue > "u" || propValue === null) + return "" + propValue; + var propType = getPropType(propValue); + if (propType === "object") { + if (propValue instanceof Date) + return "date"; + if (propValue instanceof RegExp) + return "regexp"; + } + return propType; + } + function getPostfixForTypeWarning(value) { + var type = getPreciseType(value); + switch (type) { + case "array": + case "object": + return "an " + type; + case "boolean": + case "date": + case "regexp": + return "a " + type; + default: + return type; + } + } + function getClassName(propValue) { + return !propValue.constructor || !propValue.constructor.name ? ANONYMOUS : propValue.constructor.name; + } + return ReactPropTypes.checkPropTypes = checkPropTypes, ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache, ReactPropTypes.PropTypes = ReactPropTypes, ReactPropTypes; + }, factoryWithTypeCheckers; +} +var factoryWithThrowingShims, hasRequiredFactoryWithThrowingShims; +function requireFactoryWithThrowingShims() { + if (hasRequiredFactoryWithThrowingShims) + return factoryWithThrowingShims; + hasRequiredFactoryWithThrowingShims = 1; + var ReactPropTypesSecret = requireReactPropTypesSecret(); + function emptyFunction() { + } + function emptyFunctionWithReset() { + } + return emptyFunctionWithReset.resetWarningCache = emptyFunction, factoryWithThrowingShims = function() { + function shim(props, propName, componentName, location, propFullName, secret) { + if (secret !== ReactPropTypesSecret) { + var err = new Error( + "Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types" + ); + throw err.name = "Invariant Violation", err; + } + } + shim.isRequired = shim; + function getShim() { + return shim; + } + var ReactPropTypes = { + array: shim, + bigint: shim, + bool: shim, + func: shim, + number: shim, + object: shim, + string: shim, + symbol: shim, + any: shim, + arrayOf: getShim, + element: shim, + elementType: shim, + instanceOf: getShim, + node: shim, + objectOf: getShim, + oneOf: getShim, + oneOfType: getShim, + shape: getShim, + exact: getShim, + checkPropTypes: emptyFunctionWithReset, + resetWarningCache: emptyFunction + }; + return ReactPropTypes.PropTypes = ReactPropTypes, ReactPropTypes; + }, factoryWithThrowingShims; +} +if (process.env.NODE_ENV !== "production") { + var ReactIs = requireReactIs(), throwOnDirectAccess = !0; + propTypes.exports = requireFactoryWithTypeCheckers()(ReactIs.isElement, throwOnDirectAccess); +} else + propTypes.exports = requireFactoryWithThrowingShims()(); +var propTypesExports = propTypes.exports; +const PropTypes = /* @__PURE__ */ getDefaultExportFromCjs(propTypesExports); +var nprogress = { exports: {} }; +/* NProgress, (c) 2013, 2014 Rico Sta. Cruz - http://ricostacruz.com/nprogress + * @license MIT */ +(function(module, exports) { + (function(root, factory) { + module.exports = factory(); + })(commonjsGlobal, function() { + var NProgress2 = {}; + NProgress2.version = "0.2.0"; + var Settings = NProgress2.settings = { + minimum: 0.08, + easing: "ease", + positionUsing: "", + speed: 200, + trickle: !0, + trickleRate: 0.02, + trickleSpeed: 800, + showSpinner: !0, + barSelector: '[role="bar"]', + spinnerSelector: '[role="spinner"]', + parent: "body", + template: '
' + }; + NProgress2.configure = function(options) { + var key, value; + for (key in options) + value = options[key], value !== void 0 && options.hasOwnProperty(key) && (Settings[key] = value); + return this; + }, NProgress2.status = null, NProgress2.set = function(n) { + var started = NProgress2.isStarted(); + n = clamp(n, Settings.minimum, 1), NProgress2.status = n === 1 ? null : n; + var progress = NProgress2.render(!started), bar = progress.querySelector(Settings.barSelector), speed = Settings.speed, ease = Settings.easing; + return progress.offsetWidth, queue(function(next) { + Settings.positionUsing === "" && (Settings.positionUsing = NProgress2.getPositioningCSS()), css(bar, barPositionCSS(n, speed, ease)), n === 1 ? (css(progress, { + transition: "none", + opacity: 1 + }), progress.offsetWidth, setTimeout(function() { + css(progress, { + transition: "all " + speed + "ms linear", + opacity: 0 + }), setTimeout(function() { + NProgress2.remove(), next(); + }, speed); + }, speed)) : setTimeout(next, speed); + }), this; + }, NProgress2.isStarted = function() { + return typeof NProgress2.status == "number"; + }, NProgress2.start = function() { + NProgress2.status || NProgress2.set(0); + var work = function() { + setTimeout(function() { + NProgress2.status && (NProgress2.trickle(), work()); + }, Settings.trickleSpeed); + }; + return Settings.trickle && work(), this; + }, NProgress2.done = function(force) { + return !force && !NProgress2.status ? this : NProgress2.inc(0.3 + 0.5 * Math.random()).set(1); + }, NProgress2.inc = function(amount) { + var n = NProgress2.status; + return n ? (typeof amount != "number" && (amount = (1 - n) * clamp(Math.random() * n, 0.1, 0.95)), n = clamp(n + amount, 0, 0.994), NProgress2.set(n)) : NProgress2.start(); + }, NProgress2.trickle = function() { + return NProgress2.inc(Math.random() * Settings.trickleRate); + }, function() { + var initial = 0, current = 0; + NProgress2.promise = function($promise) { + return !$promise || $promise.state() === "resolved" ? this : (current === 0 && NProgress2.start(), initial++, current++, $promise.always(function() { + current--, current === 0 ? (initial = 0, NProgress2.done()) : NProgress2.set((initial - current) / initial); + }), this); + }; + }(), NProgress2.render = function(fromStart) { + if (NProgress2.isRendered()) + return document.getElementById("nprogress"); + addClass(document.documentElement, "nprogress-busy"); + var progress = document.createElement("div"); + progress.id = "nprogress", progress.innerHTML = Settings.template; + var bar = progress.querySelector(Settings.barSelector), perc = fromStart ? "-100" : toBarPerc(NProgress2.status || 0), parent = document.querySelector(Settings.parent), spinner; + return css(bar, { + transition: "all 0 linear", + transform: "translate3d(" + perc + "%,0,0)" + }), Settings.showSpinner || (spinner = progress.querySelector(Settings.spinnerSelector), spinner && removeElement(spinner)), parent != document.body && addClass(parent, "nprogress-custom-parent"), parent.appendChild(progress), progress; + }, NProgress2.remove = function() { + removeClass(document.documentElement, "nprogress-busy"), removeClass(document.querySelector(Settings.parent), "nprogress-custom-parent"); + var progress = document.getElementById("nprogress"); + progress && removeElement(progress); + }, NProgress2.isRendered = function() { + return !!document.getElementById("nprogress"); + }, NProgress2.getPositioningCSS = function() { + var bodyStyle = document.body.style, vendorPrefix = "WebkitTransform" in bodyStyle ? "Webkit" : "MozTransform" in bodyStyle ? "Moz" : "msTransform" in bodyStyle ? "ms" : "OTransform" in bodyStyle ? "O" : ""; + return vendorPrefix + "Perspective" in bodyStyle ? "translate3d" : vendorPrefix + "Transform" in bodyStyle ? "translate" : "margin"; + }; + function clamp(n, min, max) { + return n < min ? min : n > max ? max : n; + } + function toBarPerc(n) { + return (-1 + n) * 100; + } + function barPositionCSS(n, speed, ease) { + var barCSS; + return Settings.positionUsing === "translate3d" ? barCSS = { transform: "translate3d(" + toBarPerc(n) + "%,0,0)" } : Settings.positionUsing === "translate" ? barCSS = { transform: "translate(" + toBarPerc(n) + "%,0)" } : barCSS = { "margin-left": toBarPerc(n) + "%" }, barCSS.transition = "all " + speed + "ms " + ease, barCSS; + } + var queue = /* @__PURE__ */ function() { + var pending = []; + function next() { + var fn = pending.shift(); + fn && fn(next); + } + return function(fn) { + pending.push(fn), pending.length == 1 && next(); + }; + }(), css = /* @__PURE__ */ function() { + var cssPrefixes = ["Webkit", "O", "Moz", "ms"], cssProps = {}; + function camelCase(string) { + return string.replace(/^-ms-/, "ms-").replace(/-([\da-z])/gi, function(match, letter) { + return letter.toUpperCase(); + }); + } + function getVendorProp(name) { + var style = document.body.style; + if (name in style) + return name; + for (var i = cssPrefixes.length, capName = name.charAt(0).toUpperCase() + name.slice(1), vendorName; i--; ) + if (vendorName = cssPrefixes[i] + capName, vendorName in style) + return vendorName; + return name; + } + function getStyleProp(name) { + return name = camelCase(name), cssProps[name] || (cssProps[name] = getVendorProp(name)); + } + function applyCss(element, prop, value) { + prop = getStyleProp(prop), element.style[prop] = value; + } + return function(element, properties) { + var args = arguments, prop, value; + if (args.length == 2) + for (prop in properties) + value = properties[prop], value !== void 0 && properties.hasOwnProperty(prop) && applyCss(element, prop, value); + else + applyCss(element, args[1], args[2]); + }; + }(); + function hasClass(element, name) { + var list = typeof element == "string" ? element : classList(element); + return list.indexOf(" " + name + " ") >= 0; + } + function addClass(element, name) { + var oldList = classList(element), newList = oldList + name; + hasClass(oldList, name) || (element.className = newList.substring(1)); + } + function removeClass(element, name) { + var oldList = classList(element), newList; + hasClass(element, name) && (newList = oldList.replace(" " + name + " ", " "), element.className = newList.substring(1, newList.length - 1)); + } + function classList(element) { + return (" " + (element.className || "") + " ").replace(/\s+/gi, " "); + } + function removeElement(element) { + element && element.parentNode && element.parentNode.removeChild(element); + } + return NProgress2; + }); +})(nprogress); +var nprogressExports = nprogress.exports; +const NProgress = /* @__PURE__ */ getDefaultExportFromCjs(nprogressExports); +export { + NProgress as N, + PropTypes as P +}; diff --git a/dist/common/vender-CijlkmMW.js b/dist/common/vender-CijlkmMW.js deleted file mode 100644 index 14c1c87..0000000 --- a/dist/common/vender-CijlkmMW.js +++ /dev/null @@ -1,835 +0,0 @@ -var Se = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}; -function ge(s) { - return s && s.__esModule && Object.prototype.hasOwnProperty.call(s, "default") ? s.default : s; -} -var ae = { exports: {} }, H = { exports: {} }, O = {}; -/** @license React v16.13.1 - * react-is.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -var ce; -function Pe() { - if (ce) - return O; - ce = 1; - var s = typeof Symbol == "function" && Symbol.for, k = s ? Symbol.for("react.element") : 60103, i = s ? Symbol.for("react.portal") : 60106, u = s ? Symbol.for("react.fragment") : 60107, _ = s ? Symbol.for("react.strict_mode") : 60108, f = s ? Symbol.for("react.profiler") : 60114, A = s ? Symbol.for("react.provider") : 60109, y = s ? Symbol.for("react.context") : 60110, x = s ? Symbol.for("react.async_mode") : 60111, C = s ? Symbol.for("react.concurrent_mode") : 60111, g = s ? Symbol.for("react.forward_ref") : 60112, S = s ? Symbol.for("react.suspense") : 60113, M = s ? Symbol.for("react.suspense_list") : 60120, j = s ? Symbol.for("react.memo") : 60115, r = s ? Symbol.for("react.lazy") : 60116, n = s ? Symbol.for("react.block") : 60121, c = s ? Symbol.for("react.fundamental") : 60117, P = s ? Symbol.for("react.responder") : 60118, q = s ? Symbol.for("react.scope") : 60119; - function I(t) { - if (typeof t == "object" && t !== null) { - var $ = t.$$typeof; - switch ($) { - case k: - switch (t = t.type, t) { - case x: - case C: - case u: - case f: - case _: - case S: - return t; - default: - switch (t = t && t.$$typeof, t) { - case y: - case g: - case r: - case j: - case A: - return t; - default: - return $; - } - } - case i: - return $; - } - } - } - function l(t) { - return I(t) === C; - } - return O.AsyncMode = x, O.ConcurrentMode = C, O.ContextConsumer = y, O.ContextProvider = A, O.Element = k, O.ForwardRef = g, O.Fragment = u, O.Lazy = r, O.Memo = j, O.Portal = i, O.Profiler = f, O.StrictMode = _, O.Suspense = S, O.isAsyncMode = function(t) { - return l(t) || I(t) === x; - }, O.isConcurrentMode = l, O.isContextConsumer = function(t) { - return I(t) === y; - }, O.isContextProvider = function(t) { - return I(t) === A; - }, O.isElement = function(t) { - return typeof t == "object" && t !== null && t.$$typeof === k; - }, O.isForwardRef = function(t) { - return I(t) === g; - }, O.isFragment = function(t) { - return I(t) === u; - }, O.isLazy = function(t) { - return I(t) === r; - }, O.isMemo = function(t) { - return I(t) === j; - }, O.isPortal = function(t) { - return I(t) === i; - }, O.isProfiler = function(t) { - return I(t) === f; - }, O.isStrictMode = function(t) { - return I(t) === _; - }, O.isSuspense = function(t) { - return I(t) === S; - }, O.isValidElementType = function(t) { - return typeof t == "string" || typeof t == "function" || t === u || t === C || t === f || t === _ || t === S || t === M || typeof t == "object" && t !== null && (t.$$typeof === r || t.$$typeof === j || t.$$typeof === A || t.$$typeof === y || t.$$typeof === g || t.$$typeof === c || t.$$typeof === P || t.$$typeof === q || t.$$typeof === n); - }, O.typeOf = I, O; -} -var R = {}; -/** @license React v16.13.1 - * react-is.development.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -var fe; -function Oe() { - return fe || (fe = 1, process.env.NODE_ENV !== "production" && function() { - var s = typeof Symbol == "function" && Symbol.for, k = s ? Symbol.for("react.element") : 60103, i = s ? Symbol.for("react.portal") : 60106, u = s ? Symbol.for("react.fragment") : 60107, _ = s ? Symbol.for("react.strict_mode") : 60108, f = s ? Symbol.for("react.profiler") : 60114, A = s ? Symbol.for("react.provider") : 60109, y = s ? Symbol.for("react.context") : 60110, x = s ? Symbol.for("react.async_mode") : 60111, C = s ? Symbol.for("react.concurrent_mode") : 60111, g = s ? Symbol.for("react.forward_ref") : 60112, S = s ? Symbol.for("react.suspense") : 60113, M = s ? Symbol.for("react.suspense_list") : 60120, j = s ? Symbol.for("react.memo") : 60115, r = s ? Symbol.for("react.lazy") : 60116, n = s ? Symbol.for("react.block") : 60121, c = s ? Symbol.for("react.fundamental") : 60117, P = s ? Symbol.for("react.responder") : 60118, q = s ? Symbol.for("react.scope") : 60119; - function I(o) { - return typeof o == "string" || typeof o == "function" || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill. - o === u || o === C || o === f || o === _ || o === S || o === M || typeof o == "object" && o !== null && (o.$$typeof === r || o.$$typeof === j || o.$$typeof === A || o.$$typeof === y || o.$$typeof === g || o.$$typeof === c || o.$$typeof === P || o.$$typeof === q || o.$$typeof === n); - } - function l(o) { - if (typeof o == "object" && o !== null) { - var U = o.$$typeof; - switch (U) { - case k: - var V = o.type; - switch (V) { - case x: - case C: - case u: - case f: - case _: - case S: - return V; - default: - var ue = V && V.$$typeof; - switch (ue) { - case y: - case g: - case r: - case j: - case A: - return ue; - default: - return U; - } - } - case i: - return U; - } - } - } - var t = x, $ = C, D = y, W = A, J = k, G = g, N = u, X = r, K = j, F = i, Z = f, L = _, z = S, B = !1; - function Q(o) { - return B || (B = !0, console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")), e(o) || l(o) === x; - } - function e(o) { - return l(o) === C; - } - function a(o) { - return l(o) === y; - } - function b(o) { - return l(o) === A; - } - function v(o) { - return typeof o == "object" && o !== null && o.$$typeof === k; - } - function d(o) { - return l(o) === g; - } - function h(o) { - return l(o) === u; - } - function p(o) { - return l(o) === r; - } - function m(o) { - return l(o) === j; - } - function T(o) { - return l(o) === i; - } - function w(o) { - return l(o) === f; - } - function E(o) { - return l(o) === _; - } - function Y(o) { - return l(o) === S; - } - R.AsyncMode = t, R.ConcurrentMode = $, R.ContextConsumer = D, R.ContextProvider = W, R.Element = J, R.ForwardRef = G, R.Fragment = N, R.Lazy = X, R.Memo = K, R.Portal = F, R.Profiler = Z, R.StrictMode = L, R.Suspense = z, R.isAsyncMode = Q, R.isConcurrentMode = e, R.isContextConsumer = a, R.isContextProvider = b, R.isElement = v, R.isForwardRef = d, R.isFragment = h, R.isLazy = p, R.isMemo = m, R.isPortal = T, R.isProfiler = w, R.isStrictMode = E, R.isSuspense = Y, R.isValidElementType = I, R.typeOf = l; - }()), R; -} -var le; -function he() { - return le || (le = 1, process.env.NODE_ENV === "production" ? H.exports = Pe() : H.exports = Oe()), H.exports; -} -/* -object-assign -(c) Sindre Sorhus -@license MIT -*/ -var ee, de; -function Re() { - if (de) - return ee; - de = 1; - var s = Object.getOwnPropertySymbols, k = Object.prototype.hasOwnProperty, i = Object.prototype.propertyIsEnumerable; - function u(f) { - if (f == null) - throw new TypeError("Object.assign cannot be called with null or undefined"); - return Object(f); - } - function _() { - try { - if (!Object.assign) - return !1; - var f = new String("abc"); - if (f[5] = "de", Object.getOwnPropertyNames(f)[0] === "5") - return !1; - for (var A = {}, y = 0; y < 10; y++) - A["_" + String.fromCharCode(y)] = y; - var x = Object.getOwnPropertyNames(A).map(function(g) { - return A[g]; - }); - if (x.join("") !== "0123456789") - return !1; - var C = {}; - return "abcdefghijklmnopqrst".split("").forEach(function(g) { - C[g] = g; - }), Object.keys(Object.assign({}, C)).join("") === "abcdefghijklmnopqrst"; - } catch { - return !1; - } - } - return ee = _() ? Object.assign : function(f, A) { - for (var y, x = u(f), C, g = 1; g < arguments.length; g++) { - y = Object(arguments[g]); - for (var S in y) - k.call(y, S) && (x[S] = y[S]); - if (s) { - C = s(y); - for (var M = 0; M < C.length; M++) - i.call(y, C[M]) && (x[C[M]] = y[C[M]]); - } - } - return x; - }, ee; -} -var re, pe; -function se() { - if (pe) - return re; - pe = 1; - var s = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"; - return re = s, re; -} -var te, ye; -function Te() { - return ye || (ye = 1, te = Function.call.bind(Object.prototype.hasOwnProperty)), te; -} -var ne, ve; -function _e() { - if (ve) - return ne; - ve = 1; - var s = function() { - }; - if (process.env.NODE_ENV !== "production") { - var k = se(), i = {}, u = Te(); - s = function(f) { - var A = "Warning: " + f; - typeof console < "u" && console.error(A); - try { - throw new Error(A); - } catch { - } - }; - } - function _(f, A, y, x, C) { - if (process.env.NODE_ENV !== "production") { - for (var g in f) - if (u(f, g)) { - var S; - try { - if (typeof f[g] != "function") { - var M = Error( - (x || "React class") + ": " + y + " type `" + g + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof f[g] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`." - ); - throw M.name = "Invariant Violation", M; - } - S = f[g](A, g, x, y, null, k); - } catch (r) { - S = r; - } - if (S && !(S instanceof Error) && s( - (x || "React class") + ": type specification of " + y + " `" + g + "` is invalid; the type checker function must return `null` or an `Error` but returned a " + typeof S + ". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)." - ), S instanceof Error && !(S.message in i)) { - i[S.message] = !0; - var j = C ? C() : ""; - s( - "Failed " + y + " type: " + S.message + (j ?? "") - ); - } - } - } - } - return _.resetWarningCache = function() { - process.env.NODE_ENV !== "production" && (i = {}); - }, ne = _, ne; -} -var oe, me; -function Ce() { - if (me) - return oe; - me = 1; - var s = he(), k = Re(), i = se(), u = Te(), _ = _e(), f = function() { - }; - process.env.NODE_ENV !== "production" && (f = function(y) { - var x = "Warning: " + y; - typeof console < "u" && console.error(x); - try { - throw new Error(x); - } catch { - } - }); - function A() { - return null; - } - return oe = function(y, x) { - var C = typeof Symbol == "function" && Symbol.iterator, g = "@@iterator"; - function S(e) { - var a = e && (C && e[C] || e[g]); - if (typeof a == "function") - return a; - } - var M = "<>", j = { - array: P("array"), - bigint: P("bigint"), - bool: P("boolean"), - func: P("function"), - number: P("number"), - object: P("object"), - string: P("string"), - symbol: P("symbol"), - any: q(), - arrayOf: I, - element: l(), - elementType: t(), - instanceOf: $, - node: G(), - objectOf: W, - oneOf: D, - oneOfType: J, - shape: X, - exact: K - }; - function r(e, a) { - return e === a ? e !== 0 || 1 / e === 1 / a : e !== e && a !== a; - } - function n(e, a) { - this.message = e, this.data = a && typeof a == "object" ? a : {}, this.stack = ""; - } - n.prototype = Error.prototype; - function c(e) { - if (process.env.NODE_ENV !== "production") - var a = {}, b = 0; - function v(h, p, m, T, w, E, Y) { - if (T = T || M, E = E || m, Y !== i) { - if (x) { - var o = new Error( - "Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types" - ); - throw o.name = "Invariant Violation", o; - } else if (process.env.NODE_ENV !== "production" && typeof console < "u") { - var U = T + ":" + m; - !a[U] && // Avoid spamming the console because they are often not actionable except for lib authors - b < 3 && (f( - "You are manually calling a React.PropTypes validation function for the `" + E + "` prop on `" + T + "`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details." - ), a[U] = !0, b++); - } - } - return p[m] == null ? h ? p[m] === null ? new n("The " + w + " `" + E + "` is marked as required " + ("in `" + T + "`, but its value is `null`.")) : new n("The " + w + " `" + E + "` is marked as required in " + ("`" + T + "`, but its value is `undefined`.")) : null : e(p, m, T, w, E); - } - var d = v.bind(null, !1); - return d.isRequired = v.bind(null, !0), d; - } - function P(e) { - function a(b, v, d, h, p, m) { - var T = b[v], w = L(T); - if (w !== e) { - var E = z(T); - return new n( - "Invalid " + h + " `" + p + "` of type " + ("`" + E + "` supplied to `" + d + "`, expected ") + ("`" + e + "`."), - { expectedType: e } - ); - } - return null; - } - return c(a); - } - function q() { - return c(A); - } - function I(e) { - function a(b, v, d, h, p) { - if (typeof e != "function") - return new n("Property `" + p + "` of component `" + d + "` has invalid PropType notation inside arrayOf."); - var m = b[v]; - if (!Array.isArray(m)) { - var T = L(m); - return new n("Invalid " + h + " `" + p + "` of type " + ("`" + T + "` supplied to `" + d + "`, expected an array.")); - } - for (var w = 0; w < m.length; w++) { - var E = e(m, w, d, h, p + "[" + w + "]", i); - if (E instanceof Error) - return E; - } - return null; - } - return c(a); - } - function l() { - function e(a, b, v, d, h) { - var p = a[b]; - if (!y(p)) { - var m = L(p); - return new n("Invalid " + d + " `" + h + "` of type " + ("`" + m + "` supplied to `" + v + "`, expected a single ReactElement.")); - } - return null; - } - return c(e); - } - function t() { - function e(a, b, v, d, h) { - var p = a[b]; - if (!s.isValidElementType(p)) { - var m = L(p); - return new n("Invalid " + d + " `" + h + "` of type " + ("`" + m + "` supplied to `" + v + "`, expected a single ReactElement type.")); - } - return null; - } - return c(e); - } - function $(e) { - function a(b, v, d, h, p) { - if (!(b[v] instanceof e)) { - var m = e.name || M, T = Q(b[v]); - return new n("Invalid " + h + " `" + p + "` of type " + ("`" + T + "` supplied to `" + d + "`, expected ") + ("instance of `" + m + "`.")); - } - return null; - } - return c(a); - } - function D(e) { - if (!Array.isArray(e)) - return process.env.NODE_ENV !== "production" && (arguments.length > 1 ? f( - "Invalid arguments supplied to oneOf, expected an array, got " + arguments.length + " arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])." - ) : f("Invalid argument supplied to oneOf, expected an array.")), A; - function a(b, v, d, h, p) { - for (var m = b[v], T = 0; T < e.length; T++) - if (r(m, e[T])) - return null; - var w = JSON.stringify(e, function(Y, o) { - var U = z(o); - return U === "symbol" ? String(o) : o; - }); - return new n("Invalid " + h + " `" + p + "` of value `" + String(m) + "` " + ("supplied to `" + d + "`, expected one of " + w + ".")); - } - return c(a); - } - function W(e) { - function a(b, v, d, h, p) { - if (typeof e != "function") - return new n("Property `" + p + "` of component `" + d + "` has invalid PropType notation inside objectOf."); - var m = b[v], T = L(m); - if (T !== "object") - return new n("Invalid " + h + " `" + p + "` of type " + ("`" + T + "` supplied to `" + d + "`, expected an object.")); - for (var w in m) - if (u(m, w)) { - var E = e(m, w, d, h, p + "." + w, i); - if (E instanceof Error) - return E; - } - return null; - } - return c(a); - } - function J(e) { - if (!Array.isArray(e)) - return process.env.NODE_ENV !== "production" && f("Invalid argument supplied to oneOfType, expected an instance of array."), A; - for (var a = 0; a < e.length; a++) { - var b = e[a]; - if (typeof b != "function") - return f( - "Invalid argument supplied to oneOfType. Expected an array of check functions, but received " + B(b) + " at index " + a + "." - ), A; - } - function v(d, h, p, m, T) { - for (var w = [], E = 0; E < e.length; E++) { - var Y = e[E], o = Y(d, h, p, m, T, i); - if (o == null) - return null; - o.data && u(o.data, "expectedType") && w.push(o.data.expectedType); - } - var U = w.length > 0 ? ", expected one of type [" + w.join(", ") + "]" : ""; - return new n("Invalid " + m + " `" + T + "` supplied to " + ("`" + p + "`" + U + ".")); - } - return c(v); - } - function G() { - function e(a, b, v, d, h) { - return F(a[b]) ? null : new n("Invalid " + d + " `" + h + "` supplied to " + ("`" + v + "`, expected a ReactNode.")); - } - return c(e); - } - function N(e, a, b, v, d) { - return new n( - (e || "React class") + ": " + a + " type `" + b + "." + v + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + d + "`." - ); - } - function X(e) { - function a(b, v, d, h, p) { - var m = b[v], T = L(m); - if (T !== "object") - return new n("Invalid " + h + " `" + p + "` of type `" + T + "` " + ("supplied to `" + d + "`, expected `object`.")); - for (var w in e) { - var E = e[w]; - if (typeof E != "function") - return N(d, h, p, w, z(E)); - var Y = E(m, w, d, h, p + "." + w, i); - if (Y) - return Y; - } - return null; - } - return c(a); - } - function K(e) { - function a(b, v, d, h, p) { - var m = b[v], T = L(m); - if (T !== "object") - return new n("Invalid " + h + " `" + p + "` of type `" + T + "` " + ("supplied to `" + d + "`, expected `object`.")); - var w = k({}, b[v], e); - for (var E in w) { - var Y = e[E]; - if (u(e, E) && typeof Y != "function") - return N(d, h, p, E, z(Y)); - if (!Y) - return new n( - "Invalid " + h + " `" + p + "` key `" + E + "` supplied to `" + d + "`.\nBad object: " + JSON.stringify(b[v], null, " ") + ` -Valid keys: ` + JSON.stringify(Object.keys(e), null, " ") - ); - var o = Y(m, E, d, h, p + "." + E, i); - if (o) - return o; - } - return null; - } - return c(a); - } - function F(e) { - switch (typeof e) { - case "number": - case "string": - case "undefined": - return !0; - case "boolean": - return !e; - case "object": - if (Array.isArray(e)) - return e.every(F); - if (e === null || y(e)) - return !0; - var a = S(e); - if (a) { - var b = a.call(e), v; - if (a !== e.entries) { - for (; !(v = b.next()).done; ) - if (!F(v.value)) - return !1; - } else - for (; !(v = b.next()).done; ) { - var d = v.value; - if (d && !F(d[1])) - return !1; - } - } else - return !1; - return !0; - default: - return !1; - } - } - function Z(e, a) { - return e === "symbol" ? !0 : a ? a["@@toStringTag"] === "Symbol" || typeof Symbol == "function" && a instanceof Symbol : !1; - } - function L(e) { - var a = typeof e; - return Array.isArray(e) ? "array" : e instanceof RegExp ? "object" : Z(a, e) ? "symbol" : a; - } - function z(e) { - if (typeof e > "u" || e === null) - return "" + e; - var a = L(e); - if (a === "object") { - if (e instanceof Date) - return "date"; - if (e instanceof RegExp) - return "regexp"; - } - return a; - } - function B(e) { - var a = z(e); - switch (a) { - case "array": - case "object": - return "an " + a; - case "boolean": - case "date": - case "regexp": - return "a " + a; - default: - return a; - } - } - function Q(e) { - return !e.constructor || !e.constructor.name ? M : e.constructor.name; - } - return j.checkPropTypes = _, j.resetWarningCache = _.resetWarningCache, j.PropTypes = j, j; - }, oe; -} -var ie, be; -function we() { - if (be) - return ie; - be = 1; - var s = se(); - function k() { - } - function i() { - } - return i.resetWarningCache = k, ie = function() { - function u(A, y, x, C, g, S) { - if (S !== s) { - var M = new Error( - "Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types" - ); - throw M.name = "Invariant Violation", M; - } - } - u.isRequired = u; - function _() { - return u; - } - var f = { - array: u, - bigint: u, - bool: u, - func: u, - number: u, - object: u, - string: u, - symbol: u, - any: u, - arrayOf: _, - element: u, - elementType: u, - instanceOf: _, - node: u, - objectOf: _, - oneOf: _, - oneOfType: _, - shape: _, - exact: _, - checkPropTypes: i, - resetWarningCache: k - }; - return f.PropTypes = f, f; - }, ie; -} -if (process.env.NODE_ENV !== "production") { - var xe = he(), Ae = !0; - ae.exports = Ce()(xe.isElement, Ae); -} else - ae.exports = we()(); -var Ie = ae.exports; -const je = /* @__PURE__ */ ge(Ie); -var Ee = { exports: {} }; -/* NProgress, (c) 2013, 2014 Rico Sta. Cruz - http://ricostacruz.com/nprogress - * @license MIT */ -(function(s, k) { - (function(i, u) { - s.exports = u(); - })(Se, function() { - var i = {}; - i.version = "0.2.0"; - var u = i.settings = { - minimum: 0.08, - easing: "ease", - positionUsing: "", - speed: 200, - trickle: !0, - trickleRate: 0.02, - trickleSpeed: 800, - showSpinner: !0, - barSelector: '[role="bar"]', - spinnerSelector: '[role="spinner"]', - parent: "body", - template: '
' - }; - i.configure = function(r) { - var n, c; - for (n in r) - c = r[n], c !== void 0 && r.hasOwnProperty(n) && (u[n] = c); - return this; - }, i.status = null, i.set = function(r) { - var n = i.isStarted(); - r = _(r, u.minimum, 1), i.status = r === 1 ? null : r; - var c = i.render(!n), P = c.querySelector(u.barSelector), q = u.speed, I = u.easing; - return c.offsetWidth, y(function(l) { - u.positionUsing === "" && (u.positionUsing = i.getPositioningCSS()), x(P, A(r, q, I)), r === 1 ? (x(c, { - transition: "none", - opacity: 1 - }), c.offsetWidth, setTimeout(function() { - x(c, { - transition: "all " + q + "ms linear", - opacity: 0 - }), setTimeout(function() { - i.remove(), l(); - }, q); - }, q)) : setTimeout(l, q); - }), this; - }, i.isStarted = function() { - return typeof i.status == "number"; - }, i.start = function() { - i.status || i.set(0); - var r = function() { - setTimeout(function() { - i.status && (i.trickle(), r()); - }, u.trickleSpeed); - }; - return u.trickle && r(), this; - }, i.done = function(r) { - return !r && !i.status ? this : i.inc(0.3 + 0.5 * Math.random()).set(1); - }, i.inc = function(r) { - var n = i.status; - return n ? (typeof r != "number" && (r = (1 - n) * _(Math.random() * n, 0.1, 0.95)), n = _(n + r, 0, 0.994), i.set(n)) : i.start(); - }, i.trickle = function() { - return i.inc(Math.random() * u.trickleRate); - }, function() { - var r = 0, n = 0; - i.promise = function(c) { - return !c || c.state() === "resolved" ? this : (n === 0 && i.start(), r++, n++, c.always(function() { - n--, n === 0 ? (r = 0, i.done()) : i.set((r - n) / r); - }), this); - }; - }(), i.render = function(r) { - if (i.isRendered()) - return document.getElementById("nprogress"); - g(document.documentElement, "nprogress-busy"); - var n = document.createElement("div"); - n.id = "nprogress", n.innerHTML = u.template; - var c = n.querySelector(u.barSelector), P = r ? "-100" : f(i.status || 0), q = document.querySelector(u.parent), I; - return x(c, { - transition: "all 0 linear", - transform: "translate3d(" + P + "%,0,0)" - }), u.showSpinner || (I = n.querySelector(u.spinnerSelector), I && j(I)), q != document.body && g(q, "nprogress-custom-parent"), q.appendChild(n), n; - }, i.remove = function() { - S(document.documentElement, "nprogress-busy"), S(document.querySelector(u.parent), "nprogress-custom-parent"); - var r = document.getElementById("nprogress"); - r && j(r); - }, i.isRendered = function() { - return !!document.getElementById("nprogress"); - }, i.getPositioningCSS = function() { - var r = document.body.style, n = "WebkitTransform" in r ? "Webkit" : "MozTransform" in r ? "Moz" : "msTransform" in r ? "ms" : "OTransform" in r ? "O" : ""; - return n + "Perspective" in r ? "translate3d" : n + "Transform" in r ? "translate" : "margin"; - }; - function _(r, n, c) { - return r < n ? n : r > c ? c : r; - } - function f(r) { - return (-1 + r) * 100; - } - function A(r, n, c) { - var P; - return u.positionUsing === "translate3d" ? P = { transform: "translate3d(" + f(r) + "%,0,0)" } : u.positionUsing === "translate" ? P = { transform: "translate(" + f(r) + "%,0)" } : P = { "margin-left": f(r) + "%" }, P.transition = "all " + n + "ms " + c, P; - } - var y = /* @__PURE__ */ function() { - var r = []; - function n() { - var c = r.shift(); - c && c(n); - } - return function(c) { - r.push(c), r.length == 1 && n(); - }; - }(), x = /* @__PURE__ */ function() { - var r = ["Webkit", "O", "Moz", "ms"], n = {}; - function c(l) { - return l.replace(/^-ms-/, "ms-").replace(/-([\da-z])/gi, function(t, $) { - return $.toUpperCase(); - }); - } - function P(l) { - var t = document.body.style; - if (l in t) - return l; - for (var $ = r.length, D = l.charAt(0).toUpperCase() + l.slice(1), W; $--; ) - if (W = r[$] + D, W in t) - return W; - return l; - } - function q(l) { - return l = c(l), n[l] || (n[l] = P(l)); - } - function I(l, t, $) { - t = q(t), l.style[t] = $; - } - return function(l, t) { - var $ = arguments, D, W; - if ($.length == 2) - for (D in t) - W = t[D], W !== void 0 && t.hasOwnProperty(D) && I(l, D, W); - else - I(l, $[1], $[2]); - }; - }(); - function C(r, n) { - var c = typeof r == "string" ? r : M(r); - return c.indexOf(" " + n + " ") >= 0; - } - function g(r, n) { - var c = M(r), P = c + n; - C(c, n) || (r.className = P.substring(1)); - } - function S(r, n) { - var c = M(r), P; - C(r, n) && (P = c.replace(" " + n + " ", " "), r.className = P.substring(1, P.length - 1)); - } - function M(r) { - return (" " + (r.className || "") + " ").replace(/\s+/gi, " "); - } - function j(r) { - r && r.parentNode && r.parentNode.removeChild(r); - } - return i; - }); -})(Ee); -var Me = Ee.exports; -const $e = /* @__PURE__ */ ge(Me); -export { - $e as N, - je as P -}; diff --git a/dist/components.js b/dist/components.js index 0b88847..80eddb8 100644 --- a/dist/components.js +++ b/dist/components.js @@ -1,5 +1,5 @@ -import { N as a, i as r } from "./common/main-D2ZjkFcD.js"; +import { N, i } from "./common/main-DamvcBIJ.js"; export { - a as Icon, - r as Popup + N as Icon, + i as Popup }; diff --git a/dist/container.js b/dist/container.js index e58fc15..8b78929 100644 --- a/dist/container.js +++ b/dist/container.js @@ -1,8 +1,8 @@ -import { S as o, h as r, i as s, g as t, F } from "./common/main-D2ZjkFcD.js"; +import { S, h, i, g, F } from "./common/main-DamvcBIJ.js"; export { - o as Context, - r as FFPageRender, - s as FFPopupRender, - t as SlotRender, + S as Context, + h as FFPageRender, + i as FFPopupRender, + g as SlotRender, F as default }; diff --git a/dist/data-list.js b/dist/data-list.js index 52b63c5..643e71d 100644 --- a/dist/data-list.js +++ b/dist/data-list.js @@ -1,19 +1,19 @@ -import { t as s, r as e, m as r, p as o, v as i, q as D, o as l, s as u, n as L, v as n, D as d, w as m, x as F, z as p, A as C, y as b } from "./common/main-D2ZjkFcD.js"; +import { t, r, m, p, v, q, o, s, n, v as v2, D, w, x, z, A, y } from "./common/main-DamvcBIJ.js"; export { - s as DataListContent, - e as DataListContext, - r as DataListFilter, - o as DataListFooter, - i as DataListFramework, - D as DataListHelper, - l as DataListSider, - u as DataListTable, - L as DataListToolbar, - n as DataTableFramework, - d as default, - m as loadDataListFieldWidget, - F as useColumnsRender, - p as useDataSource, - C as useHasOperationColumn, - b as useStructure + t as DataListContent, + r as DataListContext, + m as DataListFilter, + p as DataListFooter, + v as DataListFramework, + q as DataListHelper, + o as DataListSider, + s as DataListTable, + n as DataListToolbar, + v2 as DataTableFramework, + D as default, + w as loadDataListFieldWidget, + x as useColumnsRender, + z as useDataSource, + A as useHasOperationColumn, + y as useStructure }; diff --git a/dist/grid-layout-form.js b/dist/grid-layout-form.js index 23eb99a..858c881 100644 --- a/dist/grid-layout-form.js +++ b/dist/grid-layout-form.js @@ -1,9 +1,9 @@ -import { I as o, K as r, J as t, H as s, M as u, L as d } from "./common/main-D2ZjkFcD.js"; +import { I, K, J, H, M, L } from "./common/main-DamvcBIJ.js"; export { - o as GridLayoutForm, - r as GridLayoutFormHelper, - t as GridLayoutFormWidget, - s as default, - u as getOptionItemByValue, - d as useFnRun + I as GridLayoutForm, + K as GridLayoutFormHelper, + J as GridLayoutFormWidget, + H as default, + M as getOptionItemByValue, + L as useFnRun }; diff --git a/dist/grid-layout.js b/dist/grid-layout.js index 92320aa..5985d2f 100644 --- a/dist/grid-layout.js +++ b/dist/grid-layout.js @@ -1,6 +1,6 @@ -import { k as d, l as o, G as r } from "./common/main-D2ZjkFcD.js"; +import { k, l, G } from "./common/main-DamvcBIJ.js"; export { - d as GridLayout, - o as GridLayoutWidget, - r as default + k as GridLayout, + l as GridLayoutWidget, + G as default }; diff --git a/dist/hooks.js b/dist/hooks.js index ce929fa..4f79be4 100644 --- a/dist/hooks.js +++ b/dist/hooks.js @@ -2,13 +2,13 @@ import "lodash"; import "rc-field-form"; import "react"; import "react-dom"; -import { d as p, e as r, b as i, a as m, c as b, f as c, u as f } from "./common/main-D2ZjkFcD.js"; +import { d, e, b, a, c, f, u } from "./common/main-DamvcBIJ.js"; export { - p as useDeepEqualEffect, - r as useOptions, - i as usePrevious, - m as usePropsValue, - b as useStateWithCallback, - c as useSubscribeRequest, - f as useUpdate + d as useDeepEqualEffect, + e as useOptions, + b as usePrevious, + a as usePropsValue, + c as useStateWithCallback, + f as useSubscribeRequest, + u as useUpdate }; diff --git a/dist/index.js b/dist/index.js index c647fa4..3a71cce 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1,17 +1,17 @@ import "lodash"; import "axios"; import "react"; -import { Z as e, V as m, _ as c, $ as i, a1 as n, Y as f, a0 as l, W as u, X as h, a2 as x } from "./common/main-D2ZjkFcD.js"; +import { Z, V, _, $, a1, Y, a0, W, X, a2 } from "./common/main-DamvcBIJ.js"; import "ff-request"; export { - e as AppGlobalParamsContext, - m as AppUrl, - c as cache, - i as configure, - n as core, - f as default, - l as func, - u as http, - h as isReactComponent, - x as route + Z as AppGlobalParamsContext, + V as AppUrl, + _ as cache, + $ as configure, + a1 as core, + Y as default, + a0 as func, + W as http, + X as isReactComponent, + a2 as route }; diff --git a/dist/res-ws.js b/dist/res-ws.js index ab5d888..b60ade7 100644 --- a/dist/res-ws.js +++ b/dist/res-ws.js @@ -1,5 +1,5 @@ import "lodash"; -import { R as a } from "./common/main-D2ZjkFcD.js"; +import { R } from "./common/main-DamvcBIJ.js"; export { - a as default + R as default }; diff --git a/dist/service.js b/dist/service.js index 1f1a027..808ddcd 100644 --- a/dist/service.js +++ b/dist/service.js @@ -1,8 +1,8 @@ -import { a5 as t, a4 as g, a7 as s, a3 as o, a6 as r } from "./common/main-D2ZjkFcD.js"; +import { a5, a4, a7, a3, a6 } from "./common/main-DamvcBIJ.js"; export { - t as getConfigure, - g as getMenus, - s as getPhoneNumber, - o as getRoutes, - r as getWidgetOperationAuth + a5 as getConfigure, + a4 as getMenus, + a7 as getPhoneNumber, + a3 as getRoutes, + a6 as getWidgetOperationAuth }; diff --git a/dist/style.css b/dist/style.css index db208b9..df96d6e 100644 --- a/dist/style.css +++ b/dist/style.css @@ -1 +1 @@ -#nprogress{pointer-events:none}#nprogress .bar{background:#29d;position:fixed;z-index:1031;top:0;left:0;width:100%;height:2px}#nprogress .peg{display:block;position:absolute;right:0;width:100px;height:100%;box-shadow:0 0 10px #29d,0 0 5px #29d;opacity:1;-webkit-transform:rotate(3deg) translate(0px,-4px);-ms-transform:rotate(3deg) translate(0px,-4px);transform:rotate(3deg) translateY(-4px)}#nprogress .spinner{display:block;position:fixed;z-index:1031;top:15px;right:15px}#nprogress .spinner-icon{width:18px;height:18px;box-sizing:border-box;border:solid 2px transparent;border-top-color:#29d;border-left-color:#29d;border-radius:50%;-webkit-animation:nprogress-spinner .4s linear infinite;animation:nprogress-spinner .4s linear infinite}.nprogress-custom-parent{overflow:hidden;position:relative}.nprogress-custom-parent #nprogress .spinner,.nprogress-custom-parent #nprogress .bar{position:absolute}@-webkit-keyframes nprogress-spinner{0%{-webkit-transform:rotate(0deg)}to{-webkit-transform:rotate(360deg)}}@keyframes nprogress-spinner{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.ff-container{height:100%;padding:var(--ff-padding, 0px);background-color:var(--ff-bg-color, #fff)}.ff-drawer .ant-drawer-header{padding:0 8px 0 0}.ff-drawer .ant-drawer-header .ant-drawer-title{height:50px;line-height:50px}.ff-drawer .ant-drawer-header .ant-drawer-close{margin-inline-end:0}.ff-drawer .ant-drawer-body{padding:8px}.ff-drawer .ff-popup-footer{padding:8px;height:46px;align-items:center;display:flex}.ff-drawer .ff-popup-footer .ff-popup-extras,.ff-drawer .ff-popup-footer .ff-popup-actions{display:flex;gap:4px}.ff-drawer .ff-popup-footer .ff-popup-extras{flex:1}.ff-modal>div:not([aria-hidden]){height:inherit}.ff-modal>div:not([aria-hidden])>.ant-modal-content{height:inherit;display:flex;flex-direction:column}.ff-modal>div:not([aria-hidden])>.ant-modal-content>.ant-modal-body{flex:1;overflow-y:overlay}.ff-modal .ff-popup-footer{height:46px;align-items:center;display:flex}.ff-modal .ff-popup-footer .ff-popup-extras,.ff-modal .ff-popup-footer .ff-popup-actions{display:flex;gap:4px}.ff-modal .ff-popup-footer .ff-popup-extras{flex:1}.ff-grid-layout{--grid-layout-h: 1;--grid-layout-row: none;--grid-layout-row-height: 18px;--grid-layout-row-height-offset: 0px;--grid-layout-cols: 12;display:grid;grid-template-columns:repeat(var(--grid-layout-cols),1fr);grid-auto-rows:minmax(min-content,max-content);padding:var(--grid-layout-container-padding-y, 0) var(--grid-layout-container-padding-x, 0);column-gap:var(--grid-layout-item-margin-x);row-gap:var(--grid-layout-item-margin-y)}.ff-grid-layout .grid-layout-item{grid-row:span var(--grid-layout-h, 1);grid-column:calc(var(--grid-layout-x, 1) + 1)/calc(var(--grid-layout-x, 1) + var(--grid-layout-w, 1) + 1);height:calc(var(--grid-layout-row-height) * var(--grid-layout-h) + var(--grid-layout-row-height-offset));padding:var(--grid-layout-box-paddin);margin:var(--grid-layout-box-margin)}.ff-grid-layout-form{--grid-layout-h: 1;--grid-layout-row: none;--grid-layout-row-height: 18px;--grid-layout-row-height-offset: 0px;--grid-layout-cols: 12;display:grid;grid-template-columns:repeat(var(--grid-layout-cols),1fr);grid-auto-rows:minmax(min-content,max-content);padding:var(--grid-layout-container-padding-y, 0) var(--grid-layout-container-padding-x, 0);column-gap:var(--grid-layout-item-margin-x, 8px);row-gap:var(--grid-layout-item-margin-y, 8px)}.ff-grid-layout-form .grid-layout-item{grid-row:span var(--grid-layout-h, 1);grid-column:calc(var(--grid-layout-x, 1) + 1)/calc(var(--grid-layout-x, 1) + var(--grid-layout-w, 1) + 1);height:calc(var(--grid-layout-row-height) * var(--grid-layout-h) + var(--grid-layout-row-height-offset));padding:var(--grid-layout-box-padding-y, 0) var(--grid-layout-box-padding-x, 0);margin:var(--grid-layout-box-margin)}.ff-data-list-framework{height:100%;--sider-width: 280px;--col-num: 1;--gap: 8px;display:flex;gap:8px}.ff-data-list-framework .ff-data-list-sider{width:var(--sider-width);overflow-y:auto;box-shadow:8px 0 4px -8px #0000000d}.ff-data-list-framework .ff-data-list-sider+.ff-data-list-container{width:calc(100% - var(--sider-width))}.ff-data-list-framework .ff-data-list-container{width:100%;height:100%;row-gap:8px;display:flex;flex-direction:column}.ff-data-list-framework .ff-data-list-container .ff-data-list-content{flex:1;overflow-y:auto;display:grid;gap:var(--gap);padding:calc(var(--gap) / 2);grid-template-columns:repeat(var(--col-num),1fr);grid-auto-rows:min-content}.ff-data-list-framework .ff-data-list-container .ff-data-list-content .ff-data-list-framework-item{display:flex;flex-direction:column;justify-content:space-between;row-gap:8px;border-radius:4px;background-color:#fff;box-shadow:0 0 8px #00000014}.ff-data-list-framework .ff-data-list-container .ff-data-list-content .ff-data-list-framework-item .ff-grid-layout{padding:8px}.ff-data-list-framework .ff-data-list-container .ff-data-list-content .ff-data-list-framework-item .data-list-grid-layout-item-actions{margin-top:8px;display:flex;justify-content:space-between;border-top:1px solid #f0f0f0}.ff-data-list-framework .ff-data-list-container .ff-data-list-content .ff-data-list-framework-item .data-list-grid-layout-item-actions .data-list-grid-layout-item-action{text-align:center;margin:2px 0;flex:1}.ff-data-list-framework .ff-data-list-container .ff-data-list-content .ff-data-list-framework-item .data-list-grid-layout-item-actions .data-list-grid-layout-item-action:not(:last-child){border-right:1px solid #f0f0f0}.ff-data-table-framework{height:100%;display:flex;flex-direction:column}.ff-data-table-framework .ff-data-table-toolbar{display:flex}.ff-data-list-item-operations{max-width:180px;display:flex;flex-wrap:wrap;gap:var(--margin-xss, 4px)}.ff-data-list-item-operations>.ant-btn:not(.ant-btn-circle){flex-grow:1}.ff-data-list-helper{height:100%}.ff-data-list-filter{display:flex;justify-content:space-between}.ff-data-list-filter .ant-input-prefix{color:#00000073}.ff-data-list-filter .ff-data-list-filter-submit-button{margin-left:8px}.ff-data-list-filter .ff-data-list-actions{display:flex;justify-content:center;gap:8px}.ff-data-list-toolbar{gap:8px;display:flex;justify-content:space-between;align-items:center}.ff-data-list-toolbar .ff-data-list-actions{display:flex;justify-content:center;gap:8px}.ff-data-list-toolbar .ff-data-list-tabs{cursor:pointer}.ff-data-list-toolbar .ff-data-list-tabs .ant-breadcrumb-link{color:#00000073}.ff-data-list-toolbar .ff-data-list-tabs .ant-breadcrumb-link:hover{font-weight:600}.ff-data-list-toolbar .ff-data-list-tabs .ant-breadcrumb-link.active{color:#1677ff;font-weight:600}.ff-data-list-sider{width:var(--sider-width, 280px);overflow-y:auto;box-shadow:8px 0 4px -8px #0000000d}.ff-data-list-footer{padding-block-start:8px;display:flex;justify-content:space-between}.ff-data-list-footer .ff-data-list-actions{display:flex;justify-content:center;gap:8px}.ff-data-list-table{height:100%;overflow-y:hidden}.ff-data-list-table .ant-table *{scrollbar-width:auto;scrollbar-color:auto}.ff-button.ant-btn-link,.ff-button.ant-btn-text{width:initial;padding:0;height:auto}.ff-default.ant-btn-link{color:#000000e0}.ant-btn-link.ant-btn:not(:disabled):focus-visible{outline:initial;outline-offset:initial;transition:initial}.ff-popover .ff-popup-footer{display:flex;justify-content:space-between;margin-top:var(--margin-xs)}page-container{--bg-color: #fff;--mask-bg-color: rgba(0, 0, 0, .6)}page-container .ff-notification{height:100vh;width:100vw;display:flex;align-items:center;justify-content:center}page-container .ff-notification .ff-notification-container{color:#fff;border-radius:12rpx;background-color:#0009;height:fit-content;padding:28rpx;max-width:50%;max-height:50%;text-align:center}page-container .ff-notification .ff-notification-container .iconfont.ff-notification-icon{font-size:62rpx}page-container .ff-notification .ff-notification-container .iconfont.ff-notification-icon+view{margin-top:20rpx}page-container .ff-confirm{display:flex;align-items:center;justify-content:center;color:var(--text-color, #737373);background-color:#0006}page-container .ff-confirm .ff-confirm-container{background-color:#fff;width:80%;min-height:240rpx;max-height:80%;border-radius:12rpx;padding:38rpx;display:flex;flex-direction:column;gap:18rpx}page-container .ff-confirm .ff-confirm-container .ff-confirm-title{font-size:36rpx;text-align:center}page-container .ff-confirm .ff-confirm-container .ff-confirm-content{flex:1;overflow-y:auto;min-height:1.8em;max-height:70vh}page-container .ff-confirm .ff-confirm-container .ff-confirm-operations{display:flex;gap:38rpx}page-container .ff-confirm .ff-confirm-container .ff-confirm-operations .ff-confirm-ok,page-container .ff-confirm .ff-confirm-container .ff-confirm-operations .ff-confirm-cancel{flex:1;border-radius:32rpx;padding:10rpx 0;text-align:center}page-container .ff-confirm .ff-confirm-container .ff-confirm-operations .ff-confirm-cancel{box-shadow:0 0 3rpx var(--text-color, #737373);border:1rpx solid var(--text-color, #737373)}page-container .ff-confirm .ff-confirm-container .ff-confirm-operations .ff-confirm-ok{color:#fff;background-color:var(--primary-color, #1890ff)}page-container .ff-modal>div:not([aria-hidden]){height:inherit}page-container .ff-modal>div:not([aria-hidden])>.ant-modal-content{height:inherit;display:flex;flex-direction:column}page-container .ff-modal>div:not([aria-hidden])>.ant-modal-content>.ant-modal-body{flex:1;overflow-y:overlay}page-container .ff-modal .ff-popup-footer{height:46px;align-items:center;display:flex}page-container .ff-modal .ff-popup-footer .ff-popup-extras,page-container .ff-modal .ff-popup-footer .ff-popup-actions{display:flex;gap:4px}page-container .ff-modal .ff-popup-footer .ff-popup-extras{flex:1}:root{--padding-lg: 24px;--padding-md: 16px;--padding-sm: 12px;--padding-xs: 8px;--padding-xss: 4px;--margin-lg: 24px;--margin-md: 16px;--margin-sm: 12px;--margin-xs: 8px;--margin-xss: 4px;--border-color: #f2f2f2;--bg-color: rgba(0, 0, 0, .02)}#root{height:100vh;background-color:#f0f2f5}.ant-form-vertical .ant-form-item-label,.ant-form.ant-vertical .ant-form-item-label{padding-bottom:0;text-align:start}.ant-form-vertical .ant-form-item-row,.ant-form.ant-vertical .ant-form-item-row{flex-direction:column}.ant-form-item .ant-form-item-label>label{height:22px}.anticon.iconfont{transform:scale(1.14)}.react-grid-layout .react-grid-item{box-sizing:border-box!important}.monaco-editor .parameter-hints-widget{border:0px}.monaco-editor .parameter-hints-widget .signature{padding:0}.monaco-editor .suggest-widget,.monaco-editor.vs-dark .suggest-widget{border:0px}.monaco-editor .rename-box{top:0}.ant-divider:has(+.ant-form .ant-divider:first-child){display:none}*::-webkit-scrollbar-thumb{background:#aaa;border-radius:5px}*::-webkit-scrollbar-thumb:hover{background:#999}*::-webkit-scrollbar-track{background-color:#ddd}*::-webkit-scrollbar-corner{background-color:#ddd}*::-webkit-scrollbar{width:5px;height:5px} +#nprogress{pointer-events:none}#nprogress .bar{background:#29d;position:fixed;z-index:1031;top:0;left:0;width:100%;height:2px}#nprogress .peg{display:block;position:absolute;right:0;width:100px;height:100%;box-shadow:0 0 10px #29d,0 0 5px #29d;opacity:1;-webkit-transform:rotate(3deg) translate(0px,-4px);-ms-transform:rotate(3deg) translate(0px,-4px);transform:rotate(3deg) translateY(-4px)}#nprogress .spinner{display:block;position:fixed;z-index:1031;top:15px;right:15px}#nprogress .spinner-icon{width:18px;height:18px;box-sizing:border-box;border:solid 2px transparent;border-top-color:#29d;border-left-color:#29d;border-radius:50%;-webkit-animation:nprogress-spinner .4s linear infinite;animation:nprogress-spinner .4s linear infinite}.nprogress-custom-parent{overflow:hidden;position:relative}.nprogress-custom-parent #nprogress .spinner,.nprogress-custom-parent #nprogress .bar{position:absolute}@-webkit-keyframes nprogress-spinner{0%{-webkit-transform:rotate(0deg)}to{-webkit-transform:rotate(360deg)}}@keyframes nprogress-spinner{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.ff-container{height:100%;padding:var(--ff-padding, 0px);background-color:var(--ff-bg-color, #fff)}.ff-drawer .ant-drawer-header{padding:0 8px 0 0}.ff-drawer .ant-drawer-header .ant-drawer-title{height:50px;line-height:50px}.ff-drawer .ant-drawer-header .ant-drawer-close{margin-inline-end:0}.ff-drawer .ant-drawer-body{padding:8px}.ff-drawer .ff-popup-footer{padding:8px;height:46px;align-items:center;display:flex}.ff-drawer .ff-popup-footer .ff-popup-extras,.ff-drawer .ff-popup-footer .ff-popup-actions{display:flex;gap:4px}.ff-drawer .ff-popup-footer .ff-popup-extras{flex:1}.ff-modal>div:not([aria-hidden]){height:inherit}.ff-modal>div:not([aria-hidden])>.ant-modal-content{height:inherit;display:flex;flex-direction:column}.ff-modal>div:not([aria-hidden])>.ant-modal-content>.ant-modal-body{flex:1;overflow-y:overlay}.ff-modal .ff-popup-footer{height:46px;align-items:center;display:flex}.ff-modal .ff-popup-footer .ff-popup-extras,.ff-modal .ff-popup-footer .ff-popup-actions{display:flex;gap:4px}.ff-modal .ff-popup-footer .ff-popup-extras{flex:1}.ff-grid-layout{--grid-layout-h: 1;--grid-layout-row: none;--grid-layout-row-height: 18px;--grid-layout-row-height-offset: 0px;--grid-layout-cols: 12;display:grid;grid-template-columns:repeat(var(--grid-layout-cols),1fr);grid-auto-rows:minmax(min-content,max-content);padding:var(--grid-layout-container-padding-y, 0) var(--grid-layout-container-padding-x, 0);column-gap:var(--grid-layout-item-margin-x);row-gap:var(--grid-layout-item-margin-y)}.ff-grid-layout .grid-layout-item{grid-row:span var(--grid-layout-h, 1);grid-column:calc(var(--grid-layout-x, 1) + 1)/calc(var(--grid-layout-x, 1) + var(--grid-layout-w, 1) + 1);height:calc(var(--grid-layout-row-height) * var(--grid-layout-h) + var(--grid-layout-row-height-offset));padding:var(--grid-layout-box-paddin);margin:var(--grid-layout-box-margin)}.ff-grid-layout-form{--grid-layout-h: 1;--grid-layout-row: none;--grid-layout-row-height: 18px;--grid-layout-row-height-offset: 0px;--grid-layout-cols: 12;display:grid;grid-template-columns:repeat(var(--grid-layout-cols),1fr);grid-auto-rows:minmax(min-content,max-content);padding:var(--grid-layout-container-padding-y, 0) var(--grid-layout-container-padding-x, 0);column-gap:var(--grid-layout-item-margin-x, 8px);row-gap:var(--grid-layout-item-margin-y, 16px)}.ff-grid-layout-form .grid-layout-item{grid-row:span var(--grid-layout-h, 1);grid-column:calc(var(--grid-layout-x, 1) + 1)/calc(var(--grid-layout-x, 1) + var(--grid-layout-w, 1) + 1);height:calc(var(--grid-layout-row-height) * var(--grid-layout-h) + var(--grid-layout-row-height-offset));padding:var(--grid-layout-box-padding-y, 0) var(--grid-layout-box-padding-x, 0);margin:var(--grid-layout-box-margin)}.ff-data-list-framework{height:100%;--sider-width: 280px;--col-num: 1;--gap: 8px;display:flex;gap:8px}.ff-data-list-framework .ff-data-list-sider{width:var(--sider-width);overflow-y:auto;box-shadow:8px 0 4px -8px #0000000d}.ff-data-list-framework .ff-data-list-sider+.ff-data-list-container{width:calc(100% - var(--sider-width))}.ff-data-list-framework .ff-data-list-container{width:100%;height:100%;row-gap:8px;display:flex;flex-direction:column}.ff-data-list-framework .ff-data-list-container .ff-data-list-content{flex:1;overflow-y:auto;display:grid;gap:var(--gap);padding:calc(var(--gap) / 2);grid-template-columns:repeat(var(--col-num),1fr);grid-auto-rows:min-content}.ff-data-list-framework .ff-data-list-container .ff-data-list-content .ff-data-list-framework-item{display:flex;flex-direction:column;justify-content:space-between;row-gap:8px;border-radius:4px;background-color:#fff;box-shadow:0 0 8px #00000014}.ff-data-list-framework .ff-data-list-container .ff-data-list-content .ff-data-list-framework-item .ff-grid-layout{padding:8px}.ff-data-list-framework .ff-data-list-container .ff-data-list-content .ff-data-list-framework-item .data-list-grid-layout-item-actions{margin-top:8px;display:flex;justify-content:space-between;border-top:1px solid #f0f0f0}.ff-data-list-framework .ff-data-list-container .ff-data-list-content .ff-data-list-framework-item .data-list-grid-layout-item-actions .data-list-grid-layout-item-action{text-align:center;margin:2px 0;flex:1}.ff-data-list-framework .ff-data-list-container .ff-data-list-content .ff-data-list-framework-item .data-list-grid-layout-item-actions .data-list-grid-layout-item-action:not(:last-child){border-right:1px solid #f0f0f0}.ff-data-table-framework{height:100%;display:flex;flex-direction:column}.ff-data-table-framework .ff-data-table-toolbar{display:flex}.ff-data-list-item-operations{max-width:180px;display:flex;flex-wrap:wrap;gap:var(--margin-xss, 4px)}.ff-data-list-item-operations>.ant-btn:not(.ant-btn-circle){flex-grow:1}.ff-data-list-helper{height:100%}.ff-data-list-filter:has(.ff-data-list-filter-actions:not(.expanded)){height:60px;overflow-y:hidden}.ff-data-list-filter .ff-data-list-filter-default-form.ff-grid-layout-form{--grid-layout-cols: 25;--grid-layout-item-margin-x: 8px;--grid-layout-item-margin-y: 16px}.ff-data-list-filter .ff-data-list-filter-actions{grid-column:span var(--itemp-span, 5) / calc(var(--grid-layout-cols, 25) + 1)}.ff-data-list-filter .ff-data-list-filter-actions:not(.expanded){grid-row:1}.ff-data-list-filter .ff-data-list-filter-actions .ff-data-list-filter-expanded-button{margin-left:8px}.ff-data-list-filter .ff-data-list-filter-actions .ant-form-item-control-input-content{display:flex;justify-content:flex-end;align-items:center;gap:8px}.ff-data-list-toolbar{gap:8px;display:flex;justify-content:space-between;align-items:center}.ff-data-list-toolbar .ff-data-list-actions{display:flex;justify-content:center;gap:8px}.ff-data-list-toolbar .ff-data-list-tabs{cursor:pointer}.ff-data-list-toolbar .ff-data-list-tabs .ff-data-list-tab{color:#00000073}.ff-data-list-toolbar .ff-data-list-tabs .ff-data-list-tab:hover{font-weight:600}.ff-data-list-toolbar .ff-data-list-tabs .ff-data-list-tab.active{color:#1677ff;font-weight:600}.ff-data-list-sider{width:var(--sider-width, 280px);overflow-y:auto;box-shadow:8px 0 4px -8px #0000000d}.ff-data-list-footer{padding-block-start:8px;display:flex;justify-content:space-between}.ff-data-list-footer .ff-data-list-actions{display:flex;justify-content:center;gap:8px}.ff-data-list-table{height:100%;overflow-y:hidden}.ff-data-list-table .ant-table *{scrollbar-width:auto;scrollbar-color:auto}.ff-button.ant-btn-link,.ff-button.ant-btn-text{width:initial;padding:0;height:auto}.ff-default.ant-btn-link{color:#000000e0}.ant-btn-link.ant-btn:not(:disabled):focus-visible{outline:initial;outline-offset:initial;transition:initial}.ff-popover .ff-popup-footer{display:flex;justify-content:space-between;margin-top:var(--margin-xs)}page-container{--bg-color: #fff;--mask-bg-color: rgba(0, 0, 0, .6)}page-container .ff-notification{height:100vh;width:100vw;display:flex;align-items:center;justify-content:center}page-container .ff-notification .ff-notification-container{color:#fff;border-radius:12rpx;background-color:#0009;height:fit-content;padding:28rpx;max-width:50%;max-height:50%;text-align:center}page-container .ff-notification .ff-notification-container .iconfont.ff-notification-icon{font-size:62rpx}page-container .ff-notification .ff-notification-container .iconfont.ff-notification-icon+view{margin-top:20rpx}page-container .ff-confirm{display:flex;align-items:center;justify-content:center;color:var(--text-color, #737373);background-color:#0006}page-container .ff-confirm .ff-confirm-container{background-color:#fff;width:80%;min-height:240rpx;max-height:80%;border-radius:12rpx;padding:38rpx;display:flex;flex-direction:column;gap:18rpx}page-container .ff-confirm .ff-confirm-container .ff-confirm-title{font-size:36rpx;text-align:center}page-container .ff-confirm .ff-confirm-container .ff-confirm-content{flex:1;overflow-y:auto;min-height:1.8em;max-height:70vh}page-container .ff-confirm .ff-confirm-container .ff-confirm-operations{display:flex;gap:38rpx}page-container .ff-confirm .ff-confirm-container .ff-confirm-operations .ff-confirm-ok,page-container .ff-confirm .ff-confirm-container .ff-confirm-operations .ff-confirm-cancel{flex:1;border-radius:32rpx;padding:10rpx 0;text-align:center}page-container .ff-confirm .ff-confirm-container .ff-confirm-operations .ff-confirm-cancel{box-shadow:0 0 3rpx var(--text-color, #737373);border:1rpx solid var(--text-color, #737373)}page-container .ff-confirm .ff-confirm-container .ff-confirm-operations .ff-confirm-ok{color:#fff;background-color:var(--primary-color, #1890ff)}page-container .ff-modal>div:not([aria-hidden]){height:inherit}page-container .ff-modal>div:not([aria-hidden])>.ant-modal-content{height:inherit;display:flex;flex-direction:column}page-container .ff-modal>div:not([aria-hidden])>.ant-modal-content>.ant-modal-body{flex:1;overflow-y:overlay}page-container .ff-modal .ff-popup-footer{height:46px;align-items:center;display:flex}page-container .ff-modal .ff-popup-footer .ff-popup-extras,page-container .ff-modal .ff-popup-footer .ff-popup-actions{display:flex;gap:4px}page-container .ff-modal .ff-popup-footer .ff-popup-extras{flex:1}:root{--padding-lg: 24px;--padding-md: 16px;--padding-sm: 12px;--padding-xs: 8px;--padding-xss: 4px;--margin-lg: 24px;--margin-md: 16px;--margin-sm: 12px;--margin-xs: 8px;--margin-xss: 4px;--border-color: #f2f2f2;--bg-color: rgba(0, 0, 0, .02)}#root{height:100vh;background-color:#f0f2f5}.ant-form-vertical .ant-form-item-label,.ant-form.ant-vertical .ant-form-item-label{padding-bottom:0;text-align:start}.ant-form-vertical .ant-form-item-row,.ant-form.ant-vertical .ant-form-item-row{flex-direction:column}.ant-form-item .ant-form-item-label>label{height:22px}.anticon.iconfont{transform:scale(1.14)}.react-grid-layout .react-grid-item{box-sizing:border-box!important}.monaco-editor .parameter-hints-widget{border:0px}.monaco-editor .parameter-hints-widget .signature{padding:0}.monaco-editor .suggest-widget,.monaco-editor.vs-dark .suggest-widget{border:0px}.monaco-editor .rename-box{top:0}.ant-divider:has(+.ant-form .ant-divider:first-child){display:none}*::-webkit-scrollbar-thumb{background:#aaa;border-radius:5px}*::-webkit-scrollbar-thumb:hover{background:#999}*::-webkit-scrollbar-track{background-color:#ddd}*::-webkit-scrollbar-corner{background-color:#ddd}*::-webkit-scrollbar{width:5px;height:5px} diff --git a/dist/user.js b/dist/user.js index d3827a8..9d3d831 100644 --- a/dist/user.js +++ b/dist/user.js @@ -3,11 +3,11 @@ import "react/jsx-runtime"; import "react"; import "@ant-design/icons"; import "classnames"; -import { P as p, Q as a, O as g, T as n, U } from "./common/main-D2ZjkFcD.js"; +import { P, Q, O, T, U } from "./common/main-DamvcBIJ.js"; export { - p as checkUserToken, - a as getUserInfo, - g as getUserToken, - n as login, + P as checkUserToken, + Q as getUserInfo, + O as getUserToken, + T as login, U as logout }; diff --git a/dist/utils.js b/dist/utils.js index 06da4bd..47adc96 100644 --- a/dist/utils.js +++ b/dist/utils.js @@ -1,5 +1,5 @@ import "lodash"; -import { j as a } from "./common/main-D2ZjkFcD.js"; +import { j } from "./common/main-DamvcBIJ.js"; export { - a as getDefaultExpandRowKeys + j as getDefaultExpandRowKeys }; diff --git a/package.json b/package.json index 66b9167..5a53301 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "ff", "private": true, - "version": "0.1.13", + "version": "0.2.0", "type": "module", "files": [ "dist/" @@ -23,7 +23,7 @@ "./style.css": "./dist/style.css" }, "scripts": { - "dev": "vite", + "dev": "vite build --mode development", "build": "vite build", "lint": "eslint . --ext js,jsx --report-unused-disable-directives --max-warnings 0", "preview": "vite preview"