From 3b89c7f9451c8c702829683900701bc5fb875882 Mon Sep 17 00:00:00 2001 From: what Date: Mon, 13 May 2024 16:03:43 +0800 Subject: [PATCH] v0.1.6 --- dist/button.js | 2 +- dist/common/main-CJT9_qCi.js | 1574 -------------------------------- dist/common/main-v06hYH4g.js | 1644 ++++++++++++++++++++++++++++++++++ dist/components.js | 2 +- dist/container.js | 8 +- dist/data-list.js | 2 +- dist/grid-layout-form.js | 8 +- dist/grid-layout.js | 2 +- dist/hooks.js | 16 +- dist/index.js | 2 +- dist/res-ws.js | 5 + dist/service.js | 2 +- dist/user.js | 2 +- package.json | 7 +- 14 files changed, 1676 insertions(+), 1600 deletions(-) delete mode 100644 dist/common/main-CJT9_qCi.js create mode 100644 dist/common/main-v06hYH4g.js create mode 100644 dist/res-ws.js diff --git a/dist/button.js b/dist/button.js index 3605c68..299c456 100644 --- a/dist/button.js +++ b/dist/button.js @@ -1,4 +1,4 @@ -import { B as e, n as r } from "./common/main-CJT9_qCi.js"; +import { B as e, o as r } from "./common/main-v06hYH4g.js"; import "./common/vender-B-S-5jfg.js"; export { e as default, diff --git a/dist/common/main-CJT9_qCi.js b/dist/common/main-CJT9_qCi.js deleted file mode 100644 index 32706ac..0000000 --- a/dist/common/main-CJT9_qCi.js +++ /dev/null @@ -1,1574 +0,0 @@ -var Lt = Object.defineProperty; -var kt = (e, t, n) => t in e ? Lt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n; -var N = (e, t, n) => (kt(e, typeof t != "symbol" ? t + "" : t, n), n), Be = (e, t, n) => { - if (!t.has(e)) - throw TypeError("Cannot " + n); -}; -var f = (e, t, n) => (Be(e, t, "read from private field"), n ? n.call(e) : t.get(e)), F = (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); -}, G = (e, t, n, s) => (Be(e, t, "write to private field"), s ? s.call(e, n) : t.set(e, n), n); -var Fe = (e, t, n, s) => ({ - set _(r) { - G(e, t, r, n); - }, - get _() { - return f(e, t, s); - } -}); -import m from "lodash"; -import Ce from "axios"; -import y, { useMemo as q, useEffect as C, useRef as j, useState as R, useCallback as oe, useContext as st } from "react"; -import xe from "ff-request"; -import Nt from "https://assets.fsdpf.net/js/esm/spark-md5@3_0_2.min.js?url"; -import { jsx as h, jsxs as P, Fragment as Wt } from "react/jsx-runtime"; -import { QuestionOutlined as Zt, LoadingOutlined as Et, createFromIconfontCN as Tt } from "@ant-design/icons"; -import $ from "classnames"; -import { notification as rt, Drawer as wt, Modal as Gt, Form as de, ConfigProvider as Ot, Popconfirm as $t, Tooltip as It, Button as Re, Popover as ot } from "antd"; -import { P as W } from "./vender-B-S-5jfg.js"; -import Ve, { Field as it, FieldContext as Pt } from "rc-field-form"; -import { flushSync as jt } from "react-dom"; -import { useParams as at, generatePath as zt, createBrowserRouter as Ut } from "react-router-dom"; -const lt = ({ type: e, className: t, ...n }) => { - if (!(e != null && e.startsWith("icon-"))) - return /* @__PURE__ */ h(Zt, {}); - if (e === "icon-loading") - return /* @__PURE__ */ h(Et, { className: t, ...n }); - const s = q(() => Tt({ scriptUrl: ie.get("Common.ICONFONT", []) }), [ie.get("Common.ICONFONT")]); - return /* @__PURE__ */ h(s, { type: e, className: $("iconfont", t), ...n }); -}, Xt = ({ className: e, title: t, content: n, icon: s, $close: r, category: o, duration: i = 4.5 }) => { - const [a, c] = rt.useNotification(); - return C(() => { - a[o || "open"]({ - className: e, - message: t, - description: n, - icon: s, - duration: i, - onClose: () => r(!1) - }); - }, [t, n, s]), c; -}, Dt = ({ className: e, title: t, content: n, okText: s, $close: r, duration: o = 5e3 }) => { - var l; - const i = j(), [a, c] = R(); - return C(() => (a > 0 && (i.current = setTimeout(() => { - a <= 1 ? r() : c((d) => d - 1); - }, 1e3)), () => clearTimeout(i.current)), [a]), C(() => { - c(Math.max(Math.ceil(o / 1e3), 0)); - }, [o]), /* @__PURE__ */ h("div", { className: $("ff-toast-confirm", e), onClick: (d) => d.mpEvent.currentTarget.id === d.mpEvent.target.id && r(), children: /* @__PURE__ */ P("div", { className: "ff-toast-confirm-container", children: [ - /* @__PURE__ */ h("div", { className: "ff-toast-confirm-title", children: t }), - /* @__PURE__ */ h("div", { className: "ff-toast-confirm-content", children: n }), - /* @__PURE__ */ P("div", { className: "ff-toast-confirm-operations", children: [ - /* @__PURE__ */ P("div", { className: "ff-toast-confirm-cancel", onClick: () => r(!1), children: [ - "取消 (", - a, - ")" - ] }), - y.isValidElement(s) ? y.cloneElement(s, { - onClick: () => r(!0), - className: $("ff-toast-confirm-ok", (l = s.props) == null ? void 0 : l.className) - }) : /* @__PURE__ */ h("div", { className: "ff-toast-confirm-ok", onClick: () => r(!0), children: s || "确定" }) - ] }) - ] }) }); -}, ae = y.createContext({ - ele: {}, - mount: () => { - }, - unmount: () => { - } -}), x = ({ className: e, rootClassName: t, children: n, actions: s, title: r, subTitle: o, extras: i }) => { - const { mount: a, unmount: c } = y.useContext(ae); - return C(() => (a("className", t), () => c("className")), [t]), s && x.Action({ children: s }), r && x.Title({ children: r }), o && x.SubTitle({ children: o }), i && x.Extra({ children: i }), /* @__PURE__ */ h("div", { className: $("ff-container", e), children: n }); -}, je = (e) => ({ children: t, className: n }) => { - const { mount: s, unmount: r } = y.useContext(ae); - return C(() => (s(e, y.createElement("div", { - key: `ff-${e}`, - className: $(`ff-toast-${e}`, n) - }, t)), () => r(e)), [n, t]), null; -}; -x.Action = je("actions"); -x.Title = je("title"); -x.SubTitle = je("sub-title"); -x.Extra = je("extras"); -const Yn = ({ name: e }) => { - const { ele: t } = y.useContext(ae); - return t == null ? void 0 : t[e]; -}; -x.propTypes = { - // root className - rootClassName: W.string, - // 容器 className - className: W.string, - // 标题占位符 - title: W.any, - // 副标题占位符 - subTitle: W.any, - // 操作按钮占位符 - actions: W.any, - // 扩展安装占位符 - extras: W.any -}; -const St = y.forwardRef(({ $close: e, children: t, className: n, title: s, ...r }, o) => { - const i = j(), [a, c] = R(!0), [l, d] = R({}), g = oe((u, b) => d((v) => ({ ...v, [u]: b })), []), p = oe((u) => d((b) => ({ ...b, [u]: void 0 })), []); - return y.useImperativeHandle(o, () => ({ - handleClose: (u) => { - i.current = u, c(!1); - } - })), /* @__PURE__ */ h(ae.Provider, { value: { ele: l, mount: g, unmount: p }, children: /* @__PURE__ */ h( - wt, - { - ...r, - title: s || (l == null ? void 0 : l.title), - open: a, - onClose: () => c(!1), - afterOpenChange: (u) => !u && e(i.current), - className: $("ff-toast ff-toast-drawer", n, l == null ? void 0 : l.className), - extra: l == null ? void 0 : l["sub-title"], - classNames: { header: "ff-toast-header", footer: "ff-toast-footer" }, - footer: l != null && l.extras || l != null && l.actions ? /* @__PURE__ */ P(y.Fragment, { children: [ - (l == null ? void 0 : l.extras) || /* @__PURE__ */ h("div", { className: "ff-toast-extras" }), - (l == null ? void 0 : l.actions) || /* @__PURE__ */ h("div", { className: "ff-toast-actions" }) - ] }) : void 0, - children: t - } - ) }); -}), xt = y.forwardRef(({ $close: e, children: t, className: n, title: s, ...r }, o) => { - const i = j(), [a, c] = R(!0), [l, d] = R({}), g = oe((u, b) => d((v) => ({ ...v, [u]: b })), []), p = oe((u) => d((b) => ({ ...b, [u]: void 0 })), []); - return y.useImperativeHandle(o, () => ({ - handleClose: (u) => { - i.current = u, c(!1); - } - })), /* @__PURE__ */ h(ae.Provider, { value: { ele: l, mount: g, unmount: p }, children: /* @__PURE__ */ h( - Gt, - { - ...r, - title: /* @__PURE__ */ P(Wt, { children: [ - s || (l == null ? void 0 : l.title), - l == null ? void 0 : l["sub-title"] - ] }), - open: a, - onCancel: () => { - i.current = !1, c(!1); - }, - afterOpenChange: (u) => !u && e(i.current), - className: $("ff-toast ff-toast-modal", n, l == null ? void 0 : l.className), - keyboard: !0, - classNames: { header: "ff-toast-header", footer: "ff-toast-footer" }, - footer: l != null && l.extras || l != null && l.actions ? /* @__PURE__ */ P(y.Fragment, { children: [ - (l == null ? void 0 : l.extras) || /* @__PURE__ */ h("div", { className: "ff-toast-extras" }), - (l == null ? void 0 : l.actions) || /* @__PURE__ */ h("div", { className: "ff-toast-actions" }) - ] }) : void 0, - children: t - } - ) }); -}); -var we, fe, K, Ge, Oe, $e, Ie, me; -const ue = class ue extends y.Component { - constructor(n) { - super(n); - F(this, we, null); - F(this, fe, 0); - F(this, K, /* @__PURE__ */ new Map()); - F(this, Ge, (n) => new Promise((s) => { - const r = Fe(this, fe)._++; - f(this, K).set(r, y.createElement(Xt, { - ...n, - key: r, - $close: (o) => f(this, me).call(this, r, () => s(o)) - })), this.forceUpdate(); - })); - F(this, Oe, (n, s) => new Promise((r) => { - const o = Fe(this, fe)._++; - f(this, K).set(o, y.createElement(Dt, { - ...s, - content: n, - key: o, - $close: (i) => f(this, me).call(this, o, () => r(i)) - })), this.forceUpdate(); - })); - F(this, $e, (n, s, { mode: r, ...o } = {}) => new Promise((i) => { - const a = Fe(this, fe)._++, c = { current: null }; - f(this, K).set(a, y.createElement( - r == "drawer" ? St : xt, - { - ref: c, - key: a, - maskClosable: !1, - ...o, - $close: (l) => f(this, me).call(this, a, () => i(l)) - }, - y.createElement(n, { - ...s, - $close: (l) => c.current.handleClose(l) - }) - )), this.forceUpdate(); - })); - F(this, Ie, (n, s) => { - }); - F(this, me, (n, s) => { - f(this, K).delete(n), this.forceUpdate(s); - }); - ue.modal = f(this, $e), ue.notification = f(this, Ge), ue.confirm = f(this, Oe), ue.form = f(this, Ie); - } - componentWillUnmount() { - var n, s; - (s = (n = f(this, we)) == null ? void 0 : n[1]) == null || s.call(n); - } - render() { - const n = Array.from(f(this, K)); - return /* @__PURE__ */ h(ae.Provider, { value: {}, children: n.map(([s, r]) => r) }); - } -}; -we = new WeakMap(), fe = new WeakMap(), K = new WeakMap(), Ge = new WeakMap(), Oe = new WeakMap(), $e = new WeakMap(), Ie = new WeakMap(), me = new WeakMap(); -let Z = ue; -Z.notification = ({ title: e, content: t, icon: n, category: s, ...r }) => Promise.resolve(rt[s || "open"]({ - ...r, - icon: n ? /* @__PURE__ */ h(lt, { type: n || "" }) : void 0, - message: e, - description: t -})); -Z.success = (e, t = {}) => Z.notification({ title: e, category: "success", ...t }); -Z.error = (e, t = {}) => Z.notification({ title: e, category: "error", ...t }); -Z.confirm = (e, t = {}) => Z.notification({ content: e, ...t }); -Z.form = (e = {}) => Z.notification(e); -Z.modal = (e = {}) => Z.notification(e); -const ze = "mine", He = "token", Ht = "web", Yt = 60 * 60 * 24 * 30, Ye = () => { - const e = window.localStorage.getItem(He); - 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 > Yt) - throw "登录令牌已过期, 请重新登录!"; - return e; -}, Jt = () => { - try { - return !!Ye(); - } catch { - return !1; - } -}, Jn = (e = !0) => { - var t; - try { - const n = Ye(); - 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 } = L.decode(window.localStorage.getItem(ze) || "", {}); - return r === s ? Promise.resolve(o) : L.get("/api/mine-info").then(({ User: i = null }) => (window.localStorage.setItem(ze, L.encode({ ...i, iat: s })), i)); - } catch (n) { - console.error(n), e && Z.error("请登录").then(Kt); - } - return Promise.resolve(null); -}, Kn = (e, t, n = {}) => L.post("/api/user-token", { - username: e, - passwd: Nt.hash(t), - platform: Ht, - ...n -}).then(({ token: s }) => (window.localStorage.setItem(He, s), s)), Kt = () => { - window.localStorage.removeItem(ze), window.localStorage.removeItem(He); -}; -Ce.interceptors.request.use((e) => { - e.headers.Platform = "web", e.headers.SaaS = window.localStorage.getItem("SaaS"); - try { - const t = Ye(); - e.headers.Authorization = t ? `Bearer ${t} ` : void 0; - } catch { - } - return e; -}, (e) => Promise.reject({ code: -1, msg: e })); -Ce.interceptors.response.use(({ data: e, headers: t }) => ({ ...e, res: t == null ? void 0 : t.Res }), function(e) { - return Promise.reject(e.message); -}); -window.addEventListener("unhandledrejection", xe.onUnhandledRejection); -xe.onToast = (e, t) => Z[[0, 1].includes(e) ? "success" : "error"](t).then(() => e === 20300 && Ae.redirect(ie.get("Common.WEBSITE_LOGIN_PAGE"))); -const At = y.createContext({ - user: {}, - initUser: () => { - }, - initUserComplete: !1 -}), ct = y.createContext({ - set: () => { - }, - get: () => { - }, - assign: () => { - }, - currentRoute: () => { - } -}); -var he, Le, ge, Y, ne, se; -class ut { - constructor(t, n) { - F(this, he, /* @__PURE__ */ new Map()); - F(this, Le, !0); - F(this, ge, []); - F(this, Y, void 0); - F(this, ne, () => f(this, Y)); - F(this, se, () => Promise.resolve()); - N(this, "get", (...t) => new Promise((n, s) => { - const r = JSON.stringify(t); - if (f(this, he).has(r)) - return n(f(this, se).call(this, f(this, Y), ...t)); - if (f(this, Y) === void 0) - f(this, ge).push([t, n, s]), f(this, Le) && (G(this, Le, !1), Promise.resolve(typeof f(this, ne) == "function" ? f(this, ne).call(this) : f(this, ne)).then((o) => G(this, Y, o || null)).finally(() => { - f(this, ge).forEach(([o, i, a]) => { - try { - const c = f(this, se).call(this, f(this, Y), ...o); - f(this, he).set(JSON.stringify(o), c), i(c); - } catch (c) { - a(c); - } - }), f(this, ge).length = 0; - })); - else { - const o = f(this, se).call(this, f(this, Y), ...t); - f(this, he).set(r, o), n(o); - } - })); - G(this, se, n), G(this, ne, t); - } -} -he = new WeakMap(), Le = new WeakMap(), ge = new WeakMap(), Y = new WeakMap(), ne = new WeakMap(), se = new WeakMap(); -var A, ke; -const U = class U { - constructor() { - F(this, ke, null); - N(this, "init", (t) => G(this, ke, t)); - N(this, "get", (t, n) => m.get(f(this, ke), t, n)); - if (f(U, A)) - return f(U, A); - } -}; -A = new WeakMap(), ke = new WeakMap(), F(U, A, null), N(U, "getInstance", () => (f(U, A) || G(U, A, new U()), f(U, A))); -let Ue = U; -const ie = Ue.getInstance(), ce = new Worker(new URL("data:text/plain;base64,KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO2ltcG9ydFNjcmlwdHMoImh0dHBzOi8vYXNzZXRzLmZzZHBmLm5ldC9qcy91bWQvbG9kYXNoQDRfMTdfMjEubWluLmpzIiwiaHR0cHM6Ly9hc3NldHMuZnNkcGYubmV0L2pzL3VtZC9sb2Rhc2gubWl4aW4uanMiKSxpbXBvcnRTY3JpcHRzKCJodHRwczovL2Fzc2V0cy5mc2RwZi5uZXQvanMvdW1kL21vbWVudEAyXzI5XzQubWluLmpzIiwiaHR0cHM6Ly9hc3NldHMuZnNkcGYubmV0L2pzL3VtZC9tb21lbnQubG9jYWxlLnpoLWNuLmpzIiksbW9tZW50LmxvY2FsZSgiemgtY24iKTtjb25zdCBVdGlsPShlLHMpPT57Y29uc3QgdD1VdGlsLm1zZ19pZCsrO3JldHVybiBuZXcgUHJveHkoKCk9Pnt9LHtnZXQoe3Jvb3Q6YX0sbil7Y29uc3Qgbz1hP2Ake2F9LyR7bn1gOm47cmV0dXJuIGZ1bmN0aW9uKC4uLmkpe3JldHVybiBuZXcgUHJvbWlzZSgocixsKT0+e1V0aWwubVF1ZXVlLnNldCh0LFtyLGxdKSxzZWxmLnBvc3RNZXNzYWdlKHtpZDp0LHRhc2tfaWQ6ZSxzZXNzaW9uOnMsY2F0ZWdvcnk6InV0aWwiLG1ldGhvZDpvLGFyZ3M6aX0pfSl9fSxhcHBseShhLG4sbyl7cmV0dXJuIG5ldyBQcm94eShPYmplY3QuY3JlYXRlKHtyb290Om9bMF18fG51bGx9KSx7Z2V0OnRoaXMuZ2V0fSl9fSl9O1V0aWwubXNnX2lkPTAsVXRpbC5tUXVldWU9bmV3IE1hcCxVdGlsLm1NZXRob2RXb3Jrc3BhY2U9bmV3IE1hcCxzZWxmLmFkZEV2ZW50TGlzdGVuZXIoIm1lc3NhZ2UiLGZ1bmN0aW9uKHtkYXRhOntpZDplLGRhdGE6cyxlcnJvcjp0LGNhdGVnb3J5OmF9fSl7YT09PSJ1dGlsIiYmKHQhPT1udWxsP1V0aWwubVF1ZXVlLmdldChlKVsxXSh0KTpVdGlsLm1RdWV1ZS5nZXQoZSlbMF0ocyksVXRpbC5tUXVldWUuZ2V0KGUpLFV0aWwubVF1ZXVlLmRlbGV0ZShlKSl9LCExKSxzZWxmLmFkZEV2ZW50TGlzdGVuZXIoIm1lc3NhZ2UiLCh7ZGF0YTp7aWQsbWV0aG9kLGFyZ3MsY2F0ZWdvcnksc2Vzc2lvbixzb3VyY2VVUkx9fSk9PntpZihjYXRlZ29yeSE9PSJldmFsIilyZXR1cm47c2Vzc2lvbiYmIVV0aWwubU1ldGhvZFdvcmtzcGFjZS5oYXMoc2Vzc2lvbikmJlV0aWwubU1ldGhvZFdvcmtzcGFjZS5zZXQoc2Vzc2lvbix7fSk7Y29uc3QgZXZhbERhdGFTb3VyY2VVUkw9c291cmNlVVJMP2AKLy8jIHNvdXJjZVVSTD1mZjovLy8uLyR7c291cmNlVVJMfWA6IiIsZXZhbERhdGE9ZXZhbChgKGFzeW5jIGZ1bmN0aW9uKHske09iamVjdC5rZXlzKGFyZ3MpLmpvaW4oIiwgIil9fSwgVXRpbCl7JHttZXRob2R9Cn0pJHtldmFsRGF0YVNvdXJjZVVSTH1gKS5jYWxsKHNlc3Npb24/VXRpbC5tTWV0aG9kV29ya3NwYWNlLmdldChzZXNzaW9uKTp7fSxhcmdzLFV0aWwoaWQsc2Vzc2lvbikpO3JldHVybiBQcm9taXNlLnJlc29sdmUoZXZhbERhdGEpLnRoZW4oZT0+e3NlbGYucG9zdE1lc3NhZ2Uoe2lkLHNlc3Npb24sY2F0ZWdvcnksZGF0YTplLGVycm9yOm51bGx9KX0pLmNhdGNoKGU9PntzZWxmLnBvc3RNZXNzYWdlKHtpZCxzZXNzaW9uLGNhdGVnb3J5LGRhdGE6bnVsbCxlcnJvcjplIGluc3RhbmNlb2YgRE9NRXhjZXB0aW9uJiZlLm5hbWU9PT0iRGF0YUNsb25lRXJyb3IiPyJEYXRhQ2xvbmVFcnJvciDov5Tlm57nu5Pmnpzlj6rog73kuLrnroDljZXmlbDmja7moLzlvI8iOmV9KX0pfSksc2VsZi5hZGRFdmVudExpc3RlbmVyKCJtZXNzYWdlIiwoe2RhdGE6e2NhdGVnb3J5OmUsc2Vzc2lvbjpzfX0pPT57ZT09PSJjbGVhciImJlV0aWwubU1ldGhvZFdvcmtzcGFjZS5kZWxldGUocyl9LCExKX0pKCk7Cg==", self.location)), Qe = { - getConfigure: (e) => ie.get(e) -}; -var Pe, pe, M; -const k = class k { - constructor() { - N(this, "exec", (t, n = {}, s = {}, r = "") => new Promise((o, i) => { - const a = Fe(k, Pe)._++; - f(k, pe).set(a, s), k.mQueue.set(a, [o, i]), ce.postMessage({ id: a, session: r, category: "eval", method: t, args: n }); - })); - N(this, "clear", (t) => ce.postMessage({ session: t, category: "clear" })); - if (f(k, M)) - return f(k, M); - Promise.resolve().then(() => Zn).then((t) => { - Qe.http = t.http; - }), ce.addEventListener("message", ({ data: { id: t, task_id: n, method: s, args: r, category: o, data: i, error: a, session: c } }) => { - if (o === "eval" && k.mQueue.has(t)) - a !== null ? k.mQueue.get(t)[1](a) : k.mQueue.get(t)[0](i), f(k, pe).delete(t), k.mQueue.delete(t); - else if (o === "util") - try { - const l = m.get(Qe, s.split("/")) || m.get(f(k, pe).get(n), s.split("/")); - if (!m.isFunction(l)) - throw `${s} not found`; - Promise.resolve(Reflect.apply(l, void 0, r)).then((d) => { - ce.postMessage({ id: t, task_id: n, category: o, method: s, args: r, session: c, data: d, error: null }); - }).catch((d) => { - ce.postMessage({ id: t, task_id: n, category: o, method: s, args: r, session: c, data: null, error: d }); - }); - } catch (l) { - ce.postMessage({ id: t, task_id: n, category: o, method: s, args: r, session: c, data: null, error: l }); - } - }, !1); - } -}; -Pe = new WeakMap(), pe = new WeakMap(), M = new WeakMap(), N(k, "mQueue", /* @__PURE__ */ new Map()), F(k, Pe, 0), F(k, pe, /* @__PURE__ */ new Map()), F(k, M, null), N(k, "getInstance", () => (f(k, M) || G(k, M, new k()), f(k, M))); -let Xe = k; -const _ = Xe.getInstance(); -var B, S; -const X = class X { - constructor() { - F(this, S, /* @__PURE__ */ new Map()); - N(this, "setVendor", (t, n) => f(this, S).set(t, new ut(n, (s, r) => s.dynamicRequireFsdpfComponent(r)))); - N(this, "getWidgetComponent", async (t) => { - if (!t) - throw "getWidgetComponent widget is required"; - const [, n] = t == null ? void 0 : t.split("@app/"), [, s] = t == null ? void 0 : t.split("@pkg/"), [, r] = t == null ? void 0 : t.split("@fsdpf/"); - try { - switch (!0) { - case (!!n && f(this, S).has("pkg")): - return await f(this, S).get("pkg").get(n); - case (!!s && f(this, S).has("pkg")): - return await f(this, S).get("pkg").get(s); - case (!!r && f(this, S).has("pkg")): - return await f(this, S).get("pkg").get(r); - } - } catch (o) { - throw o; - } - }); - if (f(X, B)) - return f(X, B); - } -}; -B = new WeakMap(), S = new WeakMap(), F(X, B, null), N(X, "getInstance", () => (f(X, B) || G(X, B, new X()), f(X, B))); -let De = X; -const H = De.getInstance(), Mt = () => "Table", dt = () => { - const e = j(!0), [t, n] = R(0); - return C(() => () => e.current = !1, []), () => e.current && jt(() => { - n(t + 1); - }); -}, An = ({ value: e, defaultValue: t, onChange: n }) => { - const s = dt(), r = j(e !== void 0 ? e : t); - e !== void 0 && (r.current = e); - const o = oe(m.debounce((i) => { - e === void 0 && (r.current = i, s()), n && n(i); - }, 380, { leading: !0, trailing: !1 }), [e]); - return [r.current, o]; -}, qe = (e) => { - const t = j(); - return C(() => { - t.current = e; - }), t.current; -}, Mn = (e) => { - const t = j(), [n, s] = R(e); - return C(() => { - m.isFunction(t.current) && t.current(n); - }, [n]), [n, function(r, o) { - t.current = o, s(r); - }]; -}, Je = (e = y.EffectCallback, t, n = m.isEqual) => { - const s = y.useRef(t); - (!s.current || !n(t, s.current)) && (s.current = t), y.useEffect(e, [s.current]); -}, ft = (e, t = "string") => { - var n; - if (!Array.isArray(e)) - return e; - for (let s = 0; s < e.length; s++) - e[s].value = m.toPrimitive((n = e[s]) == null ? void 0 : n.value, t), e[s] && Reflect.has(e[s], "children") && (e[s].children = ft(e[s].children, t)); - return e; -}, Bn = (e, t = "json", n = "string", s, r = null) => { - const [o] = Ve.useForm(s), [i, a] = R([{ label: "无", value: "", disabled: !0 }]), c = j([]), l = Ve.useWatch((d) => c.current.length === 0 ? null : m.pick(d, c.current), o) || null; - return C(() => { - Array.isArray(e) ? a(e) : t === "javascript" && e ? _.exec(e, {}, { - getFieldValue: (d) => (c.current.includes(d) || c.current.push(d), o.getFieldValue(d)), - getFieldValueForBasicForm: (d) => (c.current.includes(d) || c.current.push(d), r ? r.getFieldValue(d) : o.getFieldValue(d)) - }).then((d) => { - a(m.toPrimitive(d, "array")); - }) : e && a(m.toPrimitive(e, "array")); - }, [e, t, l]), ft(i, n); -}, Bt = (e) => { - const [t, n] = y.useState({ gridItems: [], hideItems: [] }); - return y.useEffect(() => { - e && L.get(`/api/_/${e}`).then(({ - pk: s, - uuid: r, - code: o, - resource: i, - align: a, - listenChangeFields: c, - listenChangeFieldsFunc: l, - fields: d - }) => ({ - pk: s, - uuid: r, - code: o, - resource: i, - align: a, - listenChangeFields: c, - listenChangeFieldsFunc: l, - ...d.reduce((g, p) => { - var u; - return (u = p == null ? void 0 : p.field) != null && u.hidden ? g.hides.push(p == null ? void 0 : p.field) : g.items.push(p), g; - }, { items: [], hides: [] }) - })).then(n); - }, [e]), t; -}, Qt = ({ - max: e = 0, - min: t = 0, - type: n = "", - message: s, - pattern: r, - required: o = !1, - validator: i -} = {}, a, c) => { - const [l, d] = R([]); - return C(() => { - const g = []; - if (o) { - let p = c; - switch (c) { - case "number": - case "string": - case "array": - break; - case "bool": - p = "boolean"; - break; - case "json": - p = "object"; - break; - } - g.push({ type: p, 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: p }) => ({ - validator: async (u, b) => { - const v = await _.exec(i, { value: b, fieldName: a }, { getFieldValue: p }); - return m.isString(v) && v ? Promise.reject(v) : m.isBoolean(v) && !v ? Promise.reject(s) : Promise.resolve(); - } - })); - break; - } - d(g); - }, [e, t, n, s, r, o, i]), l; -}, qt = (e, t, n) => { - const [s, r] = R(null); - return C(() => { - const { - initDataUri: o = `/api/${e}`, - initDataMethod: i = "GET" - } = n || {}; - L.request({ - method: i, - url: m.trimEnd(`${o}/${t}`, "/") - }).then((a) => { - r(a); - }); - }, [e, t, n]), s; -}, _t = (e, t, n, s = {}) => { - const r = dt(), o = j(!0), i = j([]), [a, c] = R(n), l = Ve.useWatch((d) => JSON.stringify(m.pick(d, i.current)), t) || "{}"; - return C(() => { - e && _.exec(e, s, { - getFieldValue: m.wrap(t.getFieldValue, (d, g) => (i.current.some((p) => m.isEqual(p, g)) || (i.current.push(g), r()), d(g))), - isFieldTouched: t.isFieldTouched, - isFieldsTouched: t.isFieldsTouched - }).then((d) => o.current && c(d)); - }, [e, l, t, s]), C(() => () => o.current = !1, []), a; -}, en = (e) => ({ - code: t, - layout: n, - name: s, - primaryKey: r = 0, - style: o = {}, - formProps: i = {}, - form: a, - isPreview: c = !1, - className: l, - onFinish: d, - onValuesChange: g = () => { - }, - ...p -}) => { - const { - align: u, - autoComplete: b, - resource: v, - items: z, - hides: le, - rowHeight: Ze, - marginX: Ee, - marginY: Te, - listenChangeFields: be, - listenChangeFieldsFunc: T, - pk: ee, - uuid: te - } = Bt(t), [E] = de.useForm(a), J = ({ - changedValues: w, - allValues: O, - listenChangeFields: Vt, - listenChangeFieldsFunc: Me, - onValuesChange: En, - code: Tn - }) => { - Me && Array.isArray(Vt) && _.exec( - Me, - { changedValues: w, allValues: O }, - { - getFieldValue: E.getFieldValue, - setFieldsValue: E.setFieldsValue, - isFieldTouched: E.isFieldTouched, - isFieldsTouched: E.isFieldsTouched - } - ); - }, ve = q(() => [ - { name: "__PK__", value: ee }, - { name: "__PROPS__", value: i }, - { name: "__RESOURCE__", value: v }, - { name: "__LAYOUT_KEY__", value: t }, - { name: "__LAYOUT_UUID__", value: te }, - { name: "__PRIMARY_KEY__", value: r } - ], [ee, t, te, v, r, i]); - return /* @__PURE__ */ P( - de, - { - className: l, - requiredMark: !0, - name: s || t, - layout: n || u, - fields: ve, - form: E, - autoComplete: b, - style: { ...o, position: "relative" }, - onFinish: d, - onValuesChange: (w, O) => J( - { - changedValues: w, - allValues: O, - listenChangeFields: be, - listenChangeFieldsFunc: T, - onValuesChange: g, - code: t - } - ), - children: [ - /* @__PURE__ */ h( - e, - { - ...p, - form: E, - code: t, - fields: z, - rowHeight: Ze, - marginX: Ee, - marginY: Te - } - ), - le == null ? void 0 : le.map((w) => { - var O; - return /* @__PURE__ */ h(it, { name: w.code, children: /* @__PURE__ */ h( - tn, - { - form: E, - name: w.code, - type: w.type, - initialValue: w.initialValue, - initialValueLanguage: (O = w.extras) == null ? void 0 : O.initialValueLanguage - } - ) }, JSON.stringify(w.code)); - }) - ] - } - ); -}, tn = ({ type: e, initialValue: t, initialValueLanguage: n, onChange: s, form: r }) => { - const o = _t( - n == "javascript" && t, - r, - n == "javascript" ? void 0 : t, - {} - ); - return C(() => { - n == "javascript" ? s(m.toPrimitive(o, e)) : s(m.toPrimitive(t, e)); - }, [e, t, o]), null; -}, nn = (e) => function({ code: n, data: s, ...r }) { - const [o, i] = R({ - resource: null, - cols: 12, - rowHeight: 21, - fields: [] - }); - return C(() => { - n && L.get(`/api/_/${n}`).then((a) => i(m.pick(a, ["resource", "cols", "rowHeight", "fields"]))); - }, [n]), (o == null ? void 0 : o.resource) && /* @__PURE__ */ h( - e, - { - ...r, - rowHeight: o.rowHeight, - cols: o.cols, - fields: o.fields, - data: o != null && o.resource ? { [o == null ? void 0 : o.resource]: s } : {} - } - ); -}, mt = (e, { - initialValue: t, - initialValueLanguage: n, - convertJs: s, - convertJsSetting: r, - type: o = "string" -}, i = null) => { - const a = j(!1), c = st(Pt), [l, d] = R(), [g, p] = R(n == "javascript" || !e ? void 0 : c.getFieldValue(e)); - return C(() => { - n == "javascript" && t ? _.exec(t, {}, { - getFieldValueForBasicForm: (u) => i ? i.getFieldValue(u) : c.getFieldValue(u), - getFieldValue: (u) => c.getFieldValue(u) - }).then((u) => p(m.toPrimitive(u, o))).catch((u) => notification.error({ message: `布局数据错误: ${JSON.stringify(u)}` })).finally(() => a.current = !0) : (t && p(m.toPrimitive(t || c.getFieldValue(e) || t, o)), a.current = !0); - }, [t, n]), Je(() => { - a.current && s && H.getWidgetComponent(s).then(({ default: u }) => u({ value: g, record: c.getFieldsValue(!0), $setting: r })).then(d).catch((u) => console.error("布局数据转换错误: ", u, s)); - }, [g, s, r]), [l || g, g]; -}, sn = (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"] = _e(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"] = _e(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; -}, _e = (e, t, n, s) => `${e || 0}px ${t || 0}px ${n || 0}px ${s || 0}px`, ht = ({ cols: e, rowHeight: t, fields: n, data: s, containerPadding: r = [0, 0], itemMargin: o = [4, 0], formProps: i = {}, className: a, ...c }) => { - const [l] = Ve.useForm(), d = gt(n, on, "@pkg/grid-layouts"), g = q(() => [ - { name: "__PROPS__", value: i } - ], [i]); - return Je(() => { - l.setFieldsValue(s); - }, [s]), /* @__PURE__ */ h(Ve, { fields: g, form: l, component: !1, children: /* @__PURE__ */ h( - "div", - { - ...c, - className: $("ff-grid-layout", a), - 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: d - } - ) }); -}, gt = (e, t, n = "@pkg/grid-layouts", s = null) => q(() => { - var r; - return (r = m.sortBy(e, ["y", "x"])) == null ? void 0 : r.map( - ({ i: o, x: i, y: a, w: c, h: l, field: { boxStyle: d, widgetPrefix: g = n, widget: p, ...u } }, b) => /* @__PURE__ */ h( - "div", - { - className: "grid-layout-item", - style: sn(i, a, c, l, d, p === "Height" && (u == null ? void 0 : u.initialValue)), - children: /* @__PURE__ */ h( - rn, - { - ...u, - basicForm: s, - itemWidget: p != null && p.startsWith("@") ? p : `${g}/${p}`, - itemWidgetRender: t - } - ) - }, - o || b - ) - ); -}, [e]), rn = ({ itemWidget: e, itemWidgetRender: t, basicForm: n, ...s }) => { - const [r, o] = R(); - return C(() => { - H.getWidgetComponent(e).then(({ defaultProps: i, default: a }) => { - o(y.createElement(t(a, i, n), s)); - }).catch((i) => o(e)); - }, [e]), r; -}, on = (e, t, n = null) => (s) => { - const { - code: r, - label: o, - extras: i, - isVirtual: a, - initialValue: c, - initialValueLanguage: l, - convertJs: d, - convertJsSetting: g, - ...p - } = m.merge({}, t, s), [u, b] = mt(a ? null : r, { - initialValue: c, - initialValueLanguage: l, - convertJs: d, - convertJsSetting: g, - type: (p == null ? void 0 : p.type) || "string" - }, n); - return /* @__PURE__ */ h(e, { ...p, value: u, rawValue: b, $setting: i || {} }); -}, Qn = nn(ht), pt = ({ widget: e, widgetPrefix: t, widgetDecorator: n, subWidgets: s, basicForm: r, ...o }) => { - const i = e != null && e.startsWith("@") ? e : `${t}/${e}`, [a, c] = R(); - return C(() => { - i && H.getWidgetComponent(i).then(({ defaultProps: l, default: d }) => ({ - default: yt(d, l, r) - })).catch((l) => ({ default: () => `${l}` })).then((l) => c(y.createElement(l.default, o))); - }, [i]), a && y.cloneElement(a, o); -}; -pt.defaultProps = { - widgetPrefix: "@pkg/grid-layout-forms", - widget: "Input" -}; -const yt = (e, t, n = null) => (s) => { - const { - type: r, - code: o, - label: i, - noStyle: a, - placeholder: c, - extras: l, - validators: d, - help: g, - isVirtual: p, - initialValue: u, - initialValueLanguage: b, - convertJs: v, - convertJsSetting: z, - widgetPerfix: le, - boxStyle: Ze, - widgetDecorator: Ee, - subWidgets: Te, - ...be - } = { ...t, ...s }, T = Qt(d || {}, o, r), ee = { - label: i, - noStyle: a, - colon: !1 - }, te = { - placeholder: c, - ...be - }; - return /* @__PURE__ */ h( - it, - { - name: o, - rules: T, - normalize: (E) => E == null ? void 0 : m.toPrimitive(E, r), - children: (E, J, ve) => { - var w; - return /* @__PURE__ */ h( - e, - { - type: r, - rcform: ve, - itemProps: { - validateStatus: J.errors.length > 0 ? "error" : "success", - tooltip: g, - help: J.errors.length > 0 ? J.errors.join("、") : null, - required: ((w = T == null ? void 0 : T[0]) == null ? void 0 : w.required) || !1, - ...ee - }, - fieldProps: { ...te, ...E }, - $setting: l || {} - } - ); - } - } - ); -}, Ke = ({ cols: e, rowHeight: t, itemMargin: n = [8, 8], containerPadding: s = [0, 0], fields: r }) => { - const o = gt(r, yt, "@pkg/grid-layout-forms"); - return /* @__PURE__ */ h(Ot, { theme: { components: { Form: { itemMarginBottom: 0 } } }, children: /* @__PURE__ */ h("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 }) }); -}; -Ke.propTypes = { - fields: W.array.isRequired -}; -Ke.defaultProps = { - fields: [] -}; -const an = en(Ke), bt = ({ children: e }) => { - const [t, n] = R({}), s = oe((o, i) => n((a) => ({ ...a, [o]: i })), []), r = oe((o) => n((i) => ({ ...i, [o]: void 0 })), []); - return /* @__PURE__ */ h(ae.Provider, { value: { ele: t, mount: s, unmount: r }, children: e }); -}; -bt.defaultProps = { - isDrawerRender: !1 -}; -bt.propTypes = { - isDrawerRender: W.bool -}; -const ln = (e = {}, t = {}, n = {}, s = "") => m.deepSome(e, (r, o) => o === "type" && r === "code") ? vt(e, t, n, s) : Ft(e, t, n, s), vt = async (e = {}, t = {}, n = {}, s = "") => { - let r = /* @__PURE__ */ Object.create(null); - for (let o in e) - if (Reflect.has(e[o], "type") && ["code", "field", "router", "query", "string"].includes(e[o].type)) { - const { type: i, value: a = "", default: c = s } = e[o]; - switch (i) { - case "code": - r[o] = await _.exec(a, n, {}) || c; - break; - case "field": - r[o] = m.get(n, a, c); - break; - case "router": - r[o] = t[a] || c; - break; - case "query": - r[o] = m.get(t.$query, o) || c; - break; - case "string": - r[o] = a || c; - } - } else - r[o] = await vt(e[o], t, n, s); - return r; -}, Ft = (e = {}, t = {}, n = {}, s = "") => Object.keys(e || {}).reduce((r, o) => { - if (m.isPlainObject(e[o])) - if (Reflect.has(e[o], "type") && ["field", "router", "query", "string"].includes(e[o].type)) { - const { type: i, value: a = "", default: c = s } = e[o]; - switch (i) { - case "field": - r[o] = m.get(n, a, c); - break; - case "router": - r[o] = t[a] || c; - break; - case "query": - r[o] = m.get(t.$query, o) || c; - break; - case "string": - r[o] = a || c; - } - } else - r[o] = Ft(e[o], t, n, s); - return r; -}, {}), cn = (e, t, { isReplaceRouteHistory: n = !1 } = {}) => Ae.redirect(t, e, { replace: n }), et = (e, t, { status: { loading: n, disabled: s }, setStatus: r }) => { - const o = { - loading: (i) => i === void 0 ? n : r((a) => ({ ...a, loading: i })), - disabled: (i) => i === void 0 ? s : r((a) => ({ ...a, disabled: i })) - }; - return m.isFunction(t) ? t.call(null, { ...e, ...o }) : m.isString(t) && t ? _.exec(t, e, o) : null; -}, tt = (e, t, n, s) => Z.modal( - t, - { ...e, $setting: n, code: t }, - s -), un = (e, t, n, s) => Z.modal( - pn, - { ...e, $setting: n, code: t }, - s -), dn = ({ - widget: e, - widgetType: t, - widgetData: n, - widgetProps: s, - widgetSetting: r, - widgetContainerProps: o -}, { onAfterClick: i, onBeforeClick: a }) => { - let c = at(); - st(ct); - const [l, d] = R({ leading: !0, trailing: !1 }), g = q(() => { - switch (t) { - case "redirect": - return m.partialRight(cn, e, r); - case "func": - return m.partialRight(et, (r == null ? void 0 : r.code) || e, { status: l, setStatus: d }); - case "fsdpf-component": - return m.partialRight(tt, e, r, o); - case "grid-layout-form": - return m.partialRight(un, e, r, o); - default: - if (Ct(e)) - return m.partialRight(tt, e, r, o); - if (m.isFunction(e)) - return m.partialRight(et, (r == null ? void 0 : r.code) || e, { status: l, setStatus: d }); - } - return (...u) => console.error("useButton unknown widgetType", t, ...u); - }, [e, t]); - return [m.debounce((u) => (a == null || a(u), Promise.resolve(ln(s, c, u)).then((b) => g({ ...n, ...b })).then((b) => i == null ? void 0 : i(b))), 300, { leading: !0, trailing: !1 }), l]; -}, We = (e) => function({ - className: n, - children: s, - name: r, - icon: o, - type: i, - data: a, - noAuthType: c, - onAfterClick: l, - onBeforeClick: d, - loading: g, - disabled: p, - tooltip: u, - popConfirm: b, - widget: v, - widgetType: z, - widgetData: le, - widgetProps: Ze, - widgetSetting: Ee, - widgetContainerProps: Te, - ...be -}) { - const T = { - type: "primary", - className: $("ff-button", n) - }; - i === "danger" ? T.danger = !0 : i === "default" && (T.type = i), e === "link" || e === "dashed" ? (T.type = e, i === "default" && (T.className = $(T.className, "ff-default"))) : (e === "circle" || e === "round") && (T.shape = e), o && (T.icon = /* @__PURE__ */ h(lt, { type: o })); - const [ee, te] = R(!1), [E, { disabled: J, loading: ve }] = dn({ widget: v, widgetType: z, widgetData: le, widgetProps: Ze, widgetSetting: Ee, widgetContainerProps: Te }, { onAfterClick: l, onBeforeClick: d }); - return /* @__PURE__ */ h( - $t, - { - okText: "确定", - cancelText: "取消", - ...b || {}, - disabled: J || p, - open: ee, - onOpenChange: (O) => { - if (!O) - return te(O); - b ? te(O) : E(a); - }, - onConfirm: () => { - E(a); - }, - onClick: (O) => { - O.stopPropagation(); - }, - children: /* @__PURE__ */ h(It, { ...u, title: ee ? null : u == null ? void 0 : u.title, trigger: ["hover", "click"], children: /* @__PURE__ */ h( - Re, - { - loading: ve || g, - disabled: J || p, - ...T, - ...be, - children: s || r - } - ) }) - } - ); -}, V = We("default"), fn = We("link"), mn = We("circle"), hn = We("round"), gn = We("dashed"); -V.defaultProps = { - type: "default" -}; -V.propTypes = { - type: W.oneOf(["primary", "default", "danger"]), - name: W.string, - // 按钮名称 - icon: W.string, - // 图标 - data: W.any, - // onClick 数据源, 会受到 widgetProps 数据结构影响 - widget: W.any, - // 组件 - widgetType: W.oneOf(["destroy", "redirect", "func", "fsdpf-component", "grid-layout-form", "grid-layout"]), - // 组件类型 - widgetData: W.object, - // onClick缺省数据 - widgetProps: W.object, - // data 数据结构 - widgetSetting: W.object, - // $setting - widgetContainerProps: W.object - // 容器配置 -}; -V.Link = fn; -V.Link.defaultProps = V.defaultProps; -V.Link.propTypes = V.propTypes; -V.Circle = mn; -V.Circle.defaultProps = V.defaultProps; -V.Circle.propTypes = V.propTypes; -V.Round = hn; -V.Round.defaultProps = V.defaultProps; -V.Round.propTypes = V.propTypes; -V.Dashed = gn; -V.Dashed.defaultProps = V.defaultProps; -V.Dashed.propTypes = V.propTypes; -const pn = ({ $setting: e, $close: t, extras: n, code: s, primaryKey: r, ...o }) => { - const [i] = de.useForm(), a = qt(s, r, e); - C(() => { - a && i.setFieldsValue(a); - }, [a]); - const c = () => { - const l = i.getFieldValue("__RESOURCE__"), { - initDataUri: d = `/api/${s}` - } = e || {}; - i.validateFields(!0).then((g) => l ? m.pick(g, [l]) : g).then((g) => L.post(r ? `${d}/${r}` : `${d}`, g).msg(t)).catch(() => Toast.error("请先完善表单信息", { duration: 2e3 })); - }; - return /* @__PURE__ */ h( - x, - { - actions: /* @__PURE__ */ P(y.Fragment, { children: [ - /* @__PURE__ */ h(V, { name: "保存", type: "primary", widget: c }), - /* @__PURE__ */ h(V, { name: "取消", widget: () => t(!1) }) - ] }), - extras: n, - children: /* @__PURE__ */ h(an, { form: i, code: s, primaryKey: r, ...o }) - } - ); -}, yn = (e, t, n = "children") => { - if (m.isEmpty(e)) - return {}; - const s = m.find(e, ["value", t]); - if (!m.isEmpty(s)) - return s; - const r = e.length; - for (let o = 0; o < r; o++) { - const { [n]: i } = e[o], a = yn(i, t, n); - if (!m.isEmpty(a)) - return a; - } - return {}; -}, bn = ({ listCode: e, className: t, record: n, props: s, children: r, cb: o, ...i }) => { - var d, g; - const [a, c] = R(!1), l = () => { - }; - return s != null && s.editableByJs && (s != null && s.uuid) && ((d = l(s.uuid)) != null && d.auth) ? /* @__PURE__ */ h( - ot, - { - overlayClassName: "ff-data-list-editable-popover", - title: s != null && s.title ? `${s == null ? void 0 : s.title} - 编辑` : "编辑", - trigger: ["contextMenu"], - placement: (s == null ? void 0 : s.align) === "right" ? "topRight" : "topLeft", - arrowPointAtCenter: (s == null ? void 0 : s.align) === "center", - open: a, - onOpenChange: c, - overlayStyle: { width: ((g = s == null ? void 0 : s.editableByJsSetting) == null ? void 0 : g.width) || 260 }, - content: /* @__PURE__ */ h(vn, { ...s, listCode: e, record: n, onCancel: () => { - c(!1); - }, cb: o }), - children: /* @__PURE__ */ h("td", { className: $(t, "ff-data-list-editable-cell"), children: r, ...i }) - } - ) : /* @__PURE__ */ h("td", { className: t, children: r, ...i }); -}, vn = ({ dataIndex: e, record: t, onCancel: n, uuid: s, title: r, type: o, listCode: i, editableByJs: a, editableByJsSetting: c, cb: l }) => { - const [d] = de.useForm(), g = (c == null ? void 0 : c.primaryKey) || "", p = () => d.validateFields().then(({ value: b }) => { - const v = m.get(t, g.substring(g.indexOf(".") + 1)); - if (v) - L.put(`/api/${i}-storeBy-${s}/${v}`, { value: b }).msg(l).then(n); - else - throw "获取更新主键失败!"; - }).catch(console.warn), u = () => { - d.setFieldsValue({ - value: m.get(t, e), - __PROPS__: JSON.parse(JSON.stringify(t)) - }); - }; - return C(() => { - u(); - }, [JSON.stringify(t)]), /* @__PURE__ */ P(de, { form: d, layout: "vertical", children: [ - /* @__PURE__ */ h( - pt, - { - label: null, - code: ["value"], - widget: a, - placeholder: r, - ...m.omit(c, ["primaryKey", "width", "height"]) - } - ), - /* @__PURE__ */ h(de.Item, { noStyle: !0, name: ["__PROPS__"], children: /* @__PURE__ */ h("div", {}) }), - /* @__PURE__ */ P("div", { className: "fsdpf-editable-popover-footer", children: [ - /* @__PURE__ */ h(Re, { size: "small", onClick: u, children: "重置" }), - /* @__PURE__ */ P(Re.Group, { children: [ - /* @__PURE__ */ h(Re, { size: "small", onClick: n, children: "取消" }), - /* @__PURE__ */ h(Re, { size: "small", type: "primary", onClick: p, children: "确定" }) - ] }) - ] }) - ] }); -}, Fn = ({ widget: e, widgetPrefix: t, basicForm: n, ...s }) => { - const r = e != null && e.startsWith("@") ? e : `${t}/${e}`, [o, i] = R(); - return C(() => { - r && H.getWidgetComponent(r).then(({ defaultProps: a, default: c }) => ({ - default: Rn(c, a, n) - })).catch((a) => ({ default: () => `${a}` })).then((a) => i(y.createElement(a.default, s))); - }, [r]), o; -}, Rn = (e, t, n = null) => (s) => { - const { - code: r, - label: o, - extras: i, - isVirtual: a, - initialValue: c, - initialValueLanguage: l, - convertJs: d, - convertJsSetting: g, - value: p, - ...u - } = m.merge({}, t, s), [b, v] = mt(a ? null : r, { - initialValue: c, - initialValueLanguage: l, - convertJs: d, - convertJsSetting: g, - type: (u == null ? void 0 : u.type) || "string" - }, n); - return /* @__PURE__ */ h(e, { ...u, value: b, rawValue: v, $setting: i || {} }); -}; -Fn.defaultProps = { - widgetPrefix: "@pkg/grid-layouts" -}; -const Cn = ({ className: e, children: t, itemOperations: n, resource: s, $setting: r }) => /* @__PURE__ */ h("div", { className: $("ff-data-list-grid-layout-items", e), children: y.Children.map(t, (o) => /* @__PURE__ */ h( - Vn, - { - operations: n, - data: s ? { [s]: o.props.data } : o.props.data, - children: o - } -)) }), Vn = ({ operations: e, children: t, data: n }) => m.isEmpty(e) ? t : /* @__PURE__ */ h( - ot, - { - destroyTooltipOnHide: !0, - align: { offset: [0, -8] }, - zIndex: 100, - mouseLeaveDelay: 0.2, - placement: "topRight", - content: /* @__PURE__ */ h("div", { className: "ff-data-list-item-operations flex-grow-1", children: e == null ? void 0 : e.map(({ isRefresh: s, ...r }) => /* @__PURE__ */ h( - V, - { - ...r, - data: n, - onAfterClick: (o) => console.log("列表按钮回调", o, n) - }, - (r == null ? void 0 : r.uuid) || useId() - )) }), - children: t - } -), Ln = ({ theme: e, themeProps: t, itemClassName: n, className: s, dataSource: r, fields: o, itemOperations: i, resource: a, ...c }) => { - const l = q(() => /* @__PURE__ */ h(ht, { ...c, fields: o }), [o, c]), d = q(() => r == null ? void 0 : r.map((u, b) => y.cloneElement(l, { key: b, data: u })), [r, l]), g = q(() => e ? y.lazy(() => H.getWidgetComponent(e).catch((u) => ({ default: () => `${u}` }))) : null, [e]), p = { - $setting: t, - resource: a, - itemOperations: i, - className: s, - itemClassName: n, - children: d - }; - return g ? /* @__PURE__ */ h(y.Suspense, { fallback: /* @__PURE__ */ h("div", { style: { width: "100%", height: "100%" } }), children: /* @__PURE__ */ h(g, { ...p }) }) : /* @__PURE__ */ h(Cn, { ...p }); -}, kn = ({ listCode: e, base62params: t, className: n, theme: s, themeProps: r, itemClassName: o }) => { - const [i, a] = R(), [{ - resource: c, - cols: l, - rowHeight: d, - fields: g, - itemOperations: p = [], - marginX: u, - marginY: b - }, v] = R({ marginX: 0, marginY: 0 }); - return C(() => { - L.get(`/api/_/${e}/list-grid-layout`).then(v).catch(() => v({})); - }, [e]), C(() => { - L.list(e, t).then(({ dataSource: z }) => { - a(z); - }); - }, [t]), /* @__PURE__ */ h( - Ln, - { - className: n, - itemClassName: o, - dataSource: i, - cols: l, - rowHeight: d, - fields: g, - resource: c, - itemOperations: p, - theme: s, - themeProps: r, - itemMargin: [u, b] - } - ); -}, Nn = (e, t, n, s, r) => { - const o = y.lazy(() => H.getWidgetComponent(e).catch((i) => ({ default: () => `${i}` }))); - return /* @__PURE__ */ h(y.Suspense, { children: /* @__PURE__ */ h( - o, - { - value: t, - record: n, - $setting: s, - base62params: r - } - ) }, e); -}, qn = (e, t = {}) => (qe(e), qe(t), e == null ? void 0 : e.map(({ widgetByJs: s, widgetByJsSetting: r, ...o }, i) => s && !s.endsWith("/BasicShowFieldData") ? { - ...o, - render: (a, c) => { - const l = Nn(s, a, c, r, t); - return m.isFunction(o == null ? void 0 : o.render) ? o.render(l, a, c) : l; - } -} : o)), _n = (e) => { - const [t, n] = R({}); - return C(() => { - let s = !1; - return e && L.get(`/api/_/${e}`).then((r) => m.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; -}, es = (e, t = {}) => { - const [n, s] = R({ dataSource: [] }); - return Je(() => { - let r = !1; - return e && L.get(`/api/${e}/${L.encode({ page: 1, ...t })}`).then((o) => !r && s(o)), () => r = !0; - }, [e, t]), n; -}; -Mt.EditableCell = bn; -const Wn = ({ component: e }) => { - const [t, n] = R({}), { base62params: s } = at(); - return C(() => { - e ? L.get(`/api/_/${e}`).then(n) : n({}); - }, [e]), /* @__PURE__ */ h( - kn, - { - listCode: e, - base62params: L.decode(s), - theme: t == null ? void 0 : t.theme, - themeProps: t == null ? void 0 : t.themeConfig - } - ); -}; -var Q, I, ye, re, Ne; -const D = class D { - constructor() { - F(this, I, /* @__PURE__ */ new Map()); - F(this, ye, {}); - F(this, re, null); - N(this, "init", (t, n) => { - G(this, I, t), G(this, ye, n); - }); - N(this, "get", (t) => (f(this, I).has(t) || (t = Array.from(f(this, I).keys()).find((n) => f(this, I).get(n).uri === t)), f(this, I).get(t) || {})); - N(this, "redirect", (t, n, s = {}) => { - const { uri: r, type: o, widgetProps: i } = this.get(t); - let a = zt(r, o != "list" ? n : m.mapValues(n, (l) => L.encode(l))); - const c = new URLSearchParams(); - for (const l in i || {}) - (i == null ? void 0 : i.type) == "query" && c.append(l, n[l]); - return c.size > 0 && (a = `${a}?${c.toString()}`), f(this, re).navigate(a, s); - }); - /** - * - * @param {*} category // user, system, navigator - * @returns - */ - N(this, "getMenus", (t) => { - var n; - return ((n = f(this, ye)) == null ? void 0 : n[t]) || []; - }); - N(this, "getCurrentMenu", () => { - var s, r; - const t = getCurrentPages(), n = Object.values(f(this, ye)).flat(); - for (let o = t.length - 1; o >= 0; o--) - if ((s = t[o].query) != null && s.c) - return f(this, Ne).call(this, (r = t[o].query) == null ? void 0 : r.c, n); - return null; - }); - N(this, "getCurrentRoute", (t = 0) => { - var s; - const n = (s = f(this, re).state.matches[f(this, re).state.matches.length - 1 - t]) == null ? void 0 : s.route; - if (!n) - return null; - for (let [r, o] of f(this, I)) - if (o.uri === n.path) - return o; - return null; - }); - F(this, Ne, (t, n) => { - var s; - for (const r of n) { - if (r.uuid == t || r.widget == t) - return r; - if ((s = r.children) != null && s.length) { - const o = f(this, Ne).call(this, t, r.children); - if (o) - return o; - } - } - return null; - }); - N(this, "createBrowserRouter", (t = {}) => { - if (f(this, I).size == 0) - return null; - const n = ie.get("Common.WEBSITE_DEFAULT_THEME", "@pkg/frameworks/BasicLayout"); - ie.get(Jt() ? "Common.WEBSITE_LOGIN_REDIRECT" : "Common.WEBSITE_DEFAULT", "/index"); - const s = { [n]: 0 }, r = Array.from(f(this, I).values()).reduce((o, { uuid: i, uri: a, name: c, type: l, component: d, isLogin: g, isLayout: p, extra: u }) => { - let b = {}, v = 0; - switch (l) { - case "list": - b.element = y.createElement(Wn, { component: d }); - break; - case "fsdpf-component": - b.lazy = () => H.getWidgetComponent(d).then((z) => ({ Component: z.default })); - break; - } - if (u != null && u.layout) - if (s[u == null ? void 0 : u.layout]) - v = s[u == null ? void 0 : u.layout]; - else - return s[u == null ? void 0 : u.layout] = o.length, [...o, { - path: "/", - lazy: () => H.getWidgetComponent(u == null ? void 0 : u.layout).then((z) => ({ Component: z.default })), - children: [{ path: a, ...b }] - }]; - return p && v > -1 ? (o[v].children.push({ path: a, ...b }), o) : [...o, { path: a, ...b }]; - }, [ - { - path: "/", - lazy: () => H.getWidgetComponent(n).then((o) => ({ Component: o.default })), - children: [] - } - ]); - return G(this, re, Ut(r, t)); - }); - if (f(D, Q)) - return f(D, Q); - } -}; -Q = new WeakMap(), I = new WeakMap(), ye = new WeakMap(), re = new WeakMap(), Ne = new WeakMap(), F(D, Q, null), N(D, "getInstance", () => (f(D, Q) || G(D, Q, new D()), f(D, Q))); -let Se = D; -const Ae = Se.getInstance(), nt = { - 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" -}; -m.mixin({ - toPairsDeep: (e, t) => m.flatMap( - m.toPairs(e), - ([n, s]) => m.isObjectLike(s) ? m.toPairsDeep(s, n) : [[`${m.isUndefined(t) ? "" : t + "."}${n}`, s]] - ), - deepSome: (e, t = () => !1) => m.some(e, (n) => { - if (m.some(n, t)) - return !0; - if (!m.isEmpty(n) && (m.isPlainObject(n) || m.isArray(n))) - return m.deepSome(n, t); - }), - toPrimitive: (e, t) => { - let n = "string"; - Array.isArray(e) ? n = "array" : n = typeof e, m.isObject(e) && (n = "json"); - const s = `${n}2${t}`; - return Reflect.has(nt, s) ? nt[s](e) : e; - }, - replaceKeys: (e, t) => !e || typeof e != "object" ? e : Array.isArray(e) ? e.map((n) => m.replaceKeys(n, t)) : Object.keys(e).reduce((n, s) => (t[s] ? n[t[s]] = m.replaceKeys(e[s], t) : n[s] = m.replaceKeys(e[s], t), n), {}) -}); -let Rt = ""; -const L = { - init: (e, t, n) => { - Ce.defaults.baseURL = Rt = n, Ce.defaults.timeout = 15e3, Object.assign(L, new xe(e, t, Ce)); - } -}, Ct = (e) => { - var t; - return e && (e == null ? void 0 : e.name) && ((e == null ? void 0 : e.prototype) instanceof y.Component || (e == null ? void 0 : e.name.substr(0, 1)) === ((t = e.name.substr(0, 1)) == null ? void 0 : t.toUpperCase())); -}, Zn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ - __proto__: null, - AppGlobalParamsContext: ct, - get AppUrl() { - return Rt; - }, - cache: ut, - configure: ie, - core: H, - default: At, - func: _, - http: L, - isReactComponent: Ct, - route: Ae -}, Symbol.toStringTag, { value: "Module" })), ts = () => L.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)), ns = () => L.get("/api/my-menu"), ss = () => L.get("api/init-configure"), rs = () => L.get("/api/init-widget-operation-auth"), os = (e) => L.get(`/api/user-wx-phone-number/${e}`); -export { - _n as A, - V as B, - es as C, - Ln as D, - Rt as E, - Z as F, - an as G, - L as H, - lt as I, - Ct as J, - At as K, - ct as L, - ut as M, - ie as N, - _ as O, - H as P, - Ae as Q, - ts as R, - ae as S, - Mt as T, - ns as U, - ss as V, - rs as W, - os as X, - Jn as a, - Kt as b, - Jt as c, - An as d, - qe as e, - Mn as f, - Ye as g, - Je as h, - Bn as i, - x as j, - Yn as k, - Kn as l, - bt as m, - dn as n, - Ke as o, - pt as p, - pn as q, - _t as r, - yn as s, - Qn as t, - dt as u, - ht as v, - Fn as w, - kn as x, - Nn as y, - qn as z -}; diff --git a/dist/common/main-v06hYH4g.js b/dist/common/main-v06hYH4g.js new file mode 100644 index 0000000..727d602 --- /dev/null +++ b/dist/common/main-v06hYH4g.js @@ -0,0 +1,1644 @@ +var Gt = Object.defineProperty; +var Tt = (e, t, n) => t in e ? Gt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n; +var N = (e, t, n) => (Tt(e, typeof t != "symbol" ? t + "" : t, n), n), st = (e, t, n) => { + if (!t.has(e)) + throw TypeError("Cannot " + n); +}; +var u = (e, t, n) => (st(e, t, "read from private field"), n ? n.call(e) : t.get(e)), v = (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); +}, E = (e, t, n, s) => (st(e, t, "write to private field"), s ? s.call(e, n) : t.set(e, n), n); +var We = (e, t, n, s) => ({ + set _(r) { + E(e, t, r, n); + }, + get _() { + return u(e, t, s); + } +}); +import f from "lodash"; +import Ze from "axios"; +import b, { useMemo as ie, useEffect as R, useRef as j, useState as V, useCallback as me, useContext as ut, useId as Et } from "react"; +import Me from "ff-request"; +import Ot from "https://assets.fsdpf.net/js/esm/spark-md5@3_0_2.min.js?url"; +import { jsx as g, jsxs as S, Fragment as Pt } from "react/jsx-runtime"; +import { QuestionOutlined as Xt, LoadingOutlined as Ht, createFromIconfontCN as $t } from "@ant-design/icons"; +import $ from "classnames"; +import { notification as dt, Drawer as zt, Modal as St, Form as be, ConfigProvider as jt, Popconfirm as Ut, Tooltip as Dt, Button as Le, Popover as ft } from "antd"; +import { P as G } from "./vender-B-S-5jfg.js"; +import we, { Field as mt, FieldContext as Yt } from "rc-field-form"; +import { flushSync as Kt } from "react-dom"; +import { useParams as gt, generatePath as xt, createBrowserRouter as At } from "react-router-dom"; +const ht = ({ type: e, className: t, ...n }) => { + if (!(e != null && e.startsWith("icon-"))) + return /* @__PURE__ */ g(Xt, {}); + if (e === "icon-loading") + return /* @__PURE__ */ g(Ht, { className: t, ...n }); + const s = ie(() => $t({ scriptUrl: ge.get("Common.ICONFONT", []) }), [ge.get("Common.ICONFONT")]); + return /* @__PURE__ */ g(s, { type: e, className: $("iconfont", t), ...n }); +}, Bt = ({ className: e, title: t, content: n, icon: s, $close: r, category: o, duration: i = 4.5 }) => { + const [a, l] = dt.useNotification(); + return R(() => { + a[o || "open"]({ + className: e, + message: t, + description: n, + icon: s, + duration: i, + onClose: () => r(!1) + }); + }, [t, n, s]), l; +}, Jt = ({ className: e, title: t, content: n, okText: s, $close: r, duration: o = 5e3 }) => { + var c; + const i = j(), [a, l] = V(); + return R(() => (a > 0 && (i.current = setTimeout(() => { + a <= 1 ? r() : l((d) => d - 1); + }, 1e3)), () => clearTimeout(i.current)), [a]), R(() => { + l(Math.max(Math.ceil(o / 1e3), 0)); + }, [o]), /* @__PURE__ */ g("div", { className: $("ff-toast-confirm", e), onClick: (d) => d.mpEvent.currentTarget.id === d.mpEvent.target.id && r(), children: /* @__PURE__ */ S("div", { className: "ff-toast-confirm-container", children: [ + /* @__PURE__ */ g("div", { className: "ff-toast-confirm-title", children: t }), + /* @__PURE__ */ g("div", { className: "ff-toast-confirm-content", children: n }), + /* @__PURE__ */ S("div", { className: "ff-toast-confirm-operations", children: [ + /* @__PURE__ */ S("div", { className: "ff-toast-confirm-cancel", onClick: () => r(!1), children: [ + "取消 (", + a, + ")" + ] }), + b.isValidElement(s) ? b.cloneElement(s, { + onClick: () => r(!0), + className: $("ff-toast-confirm-ok", (c = s.props) == null ? void 0 : c.className) + }) : /* @__PURE__ */ g("div", { className: "ff-toast-confirm-ok", onClick: () => r(!0), children: s || "确定" }) + ] }) + ] }) }); +}, he = b.createContext({ + ele: {}, + mount: () => { + }, + unmount: () => { + } +}), A = ({ className: e, rootClassName: t, children: n, actions: s, title: r, subTitle: o, extras: i }) => { + const { mount: a, unmount: l } = b.useContext(he); + return R(() => (a("className", t), () => l("className")), [t]), s && A.Action({ children: s }), r && A.Title({ children: r }), o && A.SubTitle({ children: o }), i && A.Extra({ children: i }), /* @__PURE__ */ g("div", { className: $("ff-container", e), children: n }); +}, Ue = (e) => ({ children: t, className: n }) => { + const { mount: s, unmount: r } = b.useContext(he); + return R(() => (s(e, b.createElement("div", { + key: `ff-${e}`, + className: $(`ff-toast-${e}`, n) + }, t)), () => r(e)), [n, t]), null; +}; +A.Action = Ue("actions"); +A.Title = Ue("title"); +A.SubTitle = Ue("sub-title"); +A.Extra = Ue("extras"); +const es = ({ name: e }) => { + const { ele: t } = b.useContext(he); + return t == null ? void 0 : t[e]; +}; +A.propTypes = { + // root className + rootClassName: G.string, + // 容器 className + className: G.string, + // 标题占位符 + title: G.any, + // 副标题占位符 + subTitle: G.any, + // 操作按钮占位符 + actions: G.any, + // 扩展安装占位符 + extras: G.any +}; +const Mt = b.forwardRef(({ $close: e, children: t, className: n, title: s, ...r }, o) => { + const i = j(), [a, l] = V(!0), [c, d] = V({}), h = me((m, y) => d((C) => ({ ...C, [m]: y })), []), p = me((m) => d((y) => ({ ...y, [m]: void 0 })), []); + return b.useImperativeHandle(o, () => ({ + handleClose: (m) => { + i.current = m, l(!1); + } + })), /* @__PURE__ */ g(he.Provider, { value: { ele: c, mount: h, unmount: p }, children: /* @__PURE__ */ g( + zt, + { + ...r, + title: s || (c == null ? void 0 : c.title), + open: a, + onClose: () => l(!1), + afterOpenChange: (m) => !m && e(i.current), + className: $("ff-toast ff-toast-drawer", n, c == null ? void 0 : c.className), + extra: c == null ? void 0 : c["sub-title"], + classNames: { header: "ff-toast-header", footer: "ff-toast-footer" }, + footer: c != null && c.extras || c != null && c.actions ? /* @__PURE__ */ S(b.Fragment, { children: [ + (c == null ? void 0 : c.extras) || /* @__PURE__ */ g("div", { className: "ff-toast-extras" }), + (c == null ? void 0 : c.actions) || /* @__PURE__ */ g("div", { className: "ff-toast-actions" }) + ] }) : void 0, + children: t + } + ) }); +}), Qt = b.forwardRef(({ $close: e, children: t, className: n, title: s, ...r }, o) => { + const i = j(), [a, l] = V(!0), [c, d] = V({}), h = me((m, y) => d((C) => ({ ...C, [m]: y })), []), p = me((m) => d((y) => ({ ...y, [m]: void 0 })), []); + return b.useImperativeHandle(o, () => ({ + handleClose: (m) => { + i.current = m, l(!1); + } + })), /* @__PURE__ */ g(he.Provider, { value: { ele: c, mount: h, unmount: p }, children: /* @__PURE__ */ g( + St, + { + ...r, + title: /* @__PURE__ */ S(Pt, { children: [ + s || (c == null ? void 0 : c.title), + c == null ? void 0 : c["sub-title"] + ] }), + open: a, + onCancel: () => { + i.current = !1, l(!1); + }, + afterOpenChange: (m) => !m && e(i.current), + className: $("ff-toast ff-toast-modal", n, c == null ? void 0 : c.className), + keyboard: !0, + classNames: { header: "ff-toast-header", footer: "ff-toast-footer" }, + footer: c != null && c.extras || c != null && c.actions ? /* @__PURE__ */ S(b.Fragment, { children: [ + (c == null ? void 0 : c.extras) || /* @__PURE__ */ g("div", { className: "ff-toast-extras" }), + (c == null ? void 0 : c.actions) || /* @__PURE__ */ g("div", { className: "ff-toast-actions" }) + ] }) : void 0, + children: t + } + ) }); +}); +var Pe, ve, ee, Xe, He, $e, ze, Ce; +const ye = class ye extends b.Component { + constructor(n) { + super(n); + v(this, Pe, null); + v(this, ve, 0); + v(this, ee, /* @__PURE__ */ new Map()); + v(this, Xe, (n) => new Promise((s) => { + const r = We(this, ve)._++; + u(this, ee).set(r, b.createElement(Bt, { + ...n, + key: r, + $close: (o) => u(this, Ce).call(this, r, () => s(o)) + })), this.forceUpdate(); + })); + v(this, He, (n, s) => new Promise((r) => { + const o = We(this, ve)._++; + u(this, ee).set(o, b.createElement(Jt, { + ...s, + content: n, + key: o, + $close: (i) => u(this, Ce).call(this, o, () => r(i)) + })), this.forceUpdate(); + })); + v(this, $e, (n, s, { mode: r, ...o } = {}) => new Promise((i) => { + const a = We(this, ve)._++, l = { current: null }; + u(this, ee).set(a, b.createElement( + r == "drawer" ? Mt : Qt, + { + ref: l, + key: a, + maskClosable: !1, + ...o, + $close: (c) => u(this, Ce).call(this, a, () => i(c)) + }, + b.createElement(n, { + ...s, + $close: (c) => l.current.handleClose(c) + }) + )), this.forceUpdate(); + })); + v(this, ze, (n, s) => { + }); + v(this, Ce, (n, s) => { + u(this, ee).delete(n), this.forceUpdate(s); + }); + ye.modal = u(this, $e), ye.notification = u(this, Xe), ye.confirm = u(this, He), ye.form = u(this, ze); + } + componentWillUnmount() { + var n, s; + (s = (n = u(this, Pe)) == null ? void 0 : n[1]) == null || s.call(n); + } + render() { + const n = Array.from(u(this, ee)); + return /* @__PURE__ */ g(he.Provider, { value: {}, children: n.map(([s, r]) => r) }); + } +}; +Pe = new WeakMap(), ve = new WeakMap(), ee = new WeakMap(), Xe = new WeakMap(), He = new WeakMap(), $e = new WeakMap(), ze = new WeakMap(), Ce = new WeakMap(); +let Z = ye; +Z.notification = ({ title: e, content: t, icon: n, category: s, ...r }) => Promise.resolve(dt[s || "open"]({ + ...r, + icon: n ? /* @__PURE__ */ g(ht, { type: n || "" }) : void 0, + message: e, + description: t +})); +Z.success = (e, t = {}) => Z.notification({ title: e, category: "success", ...t }); +Z.error = (e, t = {}) => Z.notification({ title: e, category: "error", ...t }); +Z.confirm = (e, t = {}) => Z.notification({ content: e, ...t }); +Z.form = (e = {}) => Z.notification(e); +Z.modal = (e = {}) => Z.notification(e); +const Ye = "mine", Qe = "token", qt = "web", _t = 60 * 60 * 24 * 30, qe = () => { + const e = window.localStorage.getItem(Qe); + 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 > _t) + throw "登录令牌已过期, 请重新登录!"; + return e; +}, en = () => { + try { + return !!qe(); + } catch { + return !1; + } +}, ts = (e = !0) => { + var t; + try { + const n = qe(); + 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 } = F.decode(window.localStorage.getItem(Ye) || "", {}); + return r === s ? Promise.resolve(o) : F.get("/api/mine-info").then(({ User: i = null }) => (window.localStorage.setItem(Ye, F.encode({ ...i, iat: s })), i)); + } catch (n) { + console.error(n), e && Z.error("请登录").then(tn); + } + return Promise.resolve(null); +}, ns = (e, t, n = {}) => F.post("/api/user-token", { + username: e, + passwd: Ot.hash(t), + platform: qt, + ...n +}).then(({ token: s }) => (window.localStorage.setItem(Qe, s), s)), tn = () => { + window.localStorage.removeItem(Ye), window.localStorage.removeItem(Qe); +}; +Ze.interceptors.request.use((e) => { + e.headers.Platform = "web", e.headers.SaaS = window.localStorage.getItem("SaaS"); + try { + const t = qe(); + e.headers.Authorization = t ? `Bearer ${t} ` : void 0; + } catch { + } + return e; +}, (e) => Promise.reject({ code: -1, msg: e })); +Ze.interceptors.response.use(({ data: e, headers: t }) => ({ ...e, res: t == null ? void 0 : t.res }), function(e) { + return Promise.reject(e.message); +}); +window.addEventListener("unhandledrejection", Me.onUnhandledRejection); +Me.onToast = (e, t) => Z[[0, 1].includes(e) ? "success" : "error"](t).then(() => e === 20300 && et.redirect(ge.get("Common.WEBSITE_LOGIN_PAGE"))); +const nn = b.createContext({ + user: {}, + initUser: () => { + }, + initUserComplete: !1 +}), pt = b.createContext({ + set: () => { + }, + get: () => { + }, + assign: () => { + }, + currentRoute: () => { + } +}); +var Ve, Ge, Fe, M, le, ue; +class yt { + constructor(t, n) { + v(this, Ve, /* @__PURE__ */ new Map()); + v(this, Ge, !0); + v(this, Fe, []); + v(this, M, void 0); + v(this, le, () => u(this, M)); + v(this, ue, () => Promise.resolve()); + N(this, "get", (...t) => new Promise((n, s) => { + const r = JSON.stringify(t); + if (u(this, Ve).has(r)) + return n(u(this, ue).call(this, u(this, M), ...t)); + if (u(this, M) === void 0) + u(this, Fe).push([t, n, s]), u(this, Ge) && (E(this, Ge, !1), Promise.resolve(typeof u(this, le) == "function" ? u(this, le).call(this) : u(this, le)).then((o) => E(this, M, o || null)).finally(() => { + u(this, Fe).forEach(([o, i, a]) => { + try { + const l = u(this, ue).call(this, u(this, M), ...o); + u(this, Ve).set(JSON.stringify(o), l), i(l); + } catch (l) { + a(l); + } + }), u(this, Fe).length = 0; + })); + else { + const o = u(this, ue).call(this, u(this, M), ...t); + u(this, Ve).set(r, o), n(o); + } + })); + E(this, ue, n), E(this, le, t); + } +} +Ve = new WeakMap(), Ge = new WeakMap(), Fe = new WeakMap(), M = new WeakMap(), le = new WeakMap(), ue = new WeakMap(); +var te, Te; +const U = class U { + constructor() { + v(this, Te, null); + N(this, "init", (t) => E(this, Te, t)); + N(this, "get", (t, n) => f.get(u(this, Te), t, n)); + if (u(U, te)) + return u(U, te); + } +}; +te = new WeakMap(), Te = new WeakMap(), v(U, te, null), N(U, "getInstance", () => (u(U, te) || E(U, te, new U()), u(U, te))); +let Ke = U; +const ge = Ke.getInstance(), pe = new Worker(new URL("data:text/plain;base64,KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO2ltcG9ydFNjcmlwdHMoImh0dHBzOi8vYXNzZXRzLmZzZHBmLm5ldC9qcy91bWQvbG9kYXNoQDRfMTdfMjEubWluLmpzIiwiaHR0cHM6Ly9hc3NldHMuZnNkcGYubmV0L2pzL3VtZC9sb2Rhc2gubWl4aW4uanMiKSxpbXBvcnRTY3JpcHRzKCJodHRwczovL2Fzc2V0cy5mc2RwZi5uZXQvanMvdW1kL21vbWVudEAyXzI5XzQubWluLmpzIiwiaHR0cHM6Ly9hc3NldHMuZnNkcGYubmV0L2pzL3VtZC9tb21lbnQubG9jYWxlLnpoLWNuLmpzIiksbW9tZW50LmxvY2FsZSgiemgtY24iKTtjb25zdCBVdGlsPShlLHMpPT57Y29uc3QgdD1VdGlsLm1zZ19pZCsrO3JldHVybiBuZXcgUHJveHkoKCk9Pnt9LHtnZXQoe3Jvb3Q6YX0sbil7Y29uc3Qgbz1hP2Ake2F9LyR7bn1gOm47cmV0dXJuIGZ1bmN0aW9uKC4uLmkpe3JldHVybiBuZXcgUHJvbWlzZSgocixsKT0+e1V0aWwubVF1ZXVlLnNldCh0LFtyLGxdKSxzZWxmLnBvc3RNZXNzYWdlKHtpZDp0LHRhc2tfaWQ6ZSxzZXNzaW9uOnMsY2F0ZWdvcnk6InV0aWwiLG1ldGhvZDpvLGFyZ3M6aX0pfSl9fSxhcHBseShhLG4sbyl7cmV0dXJuIG5ldyBQcm94eShPYmplY3QuY3JlYXRlKHtyb290Om9bMF18fG51bGx9KSx7Z2V0OnRoaXMuZ2V0fSl9fSl9O1V0aWwubXNnX2lkPTAsVXRpbC5tUXVldWU9bmV3IE1hcCxVdGlsLm1NZXRob2RXb3Jrc3BhY2U9bmV3IE1hcCxzZWxmLmFkZEV2ZW50TGlzdGVuZXIoIm1lc3NhZ2UiLGZ1bmN0aW9uKHtkYXRhOntpZDplLGRhdGE6cyxlcnJvcjp0LGNhdGVnb3J5OmF9fSl7YT09PSJ1dGlsIiYmKHQhPT1udWxsP1V0aWwubVF1ZXVlLmdldChlKVsxXSh0KTpVdGlsLm1RdWV1ZS5nZXQoZSlbMF0ocyksVXRpbC5tUXVldWUuZ2V0KGUpLFV0aWwubVF1ZXVlLmRlbGV0ZShlKSl9LCExKSxzZWxmLmFkZEV2ZW50TGlzdGVuZXIoIm1lc3NhZ2UiLCh7ZGF0YTp7aWQsbWV0aG9kLGFyZ3MsY2F0ZWdvcnksc2Vzc2lvbixzb3VyY2VVUkx9fSk9PntpZihjYXRlZ29yeSE9PSJldmFsIilyZXR1cm47c2Vzc2lvbiYmIVV0aWwubU1ldGhvZFdvcmtzcGFjZS5oYXMoc2Vzc2lvbikmJlV0aWwubU1ldGhvZFdvcmtzcGFjZS5zZXQoc2Vzc2lvbix7fSk7Y29uc3QgZXZhbERhdGFTb3VyY2VVUkw9c291cmNlVVJMP2AKLy8jIHNvdXJjZVVSTD1mZjovLy8uLyR7c291cmNlVVJMfWA6IiIsZXZhbERhdGE9ZXZhbChgKGFzeW5jIGZ1bmN0aW9uKHske09iamVjdC5rZXlzKGFyZ3MpLmpvaW4oIiwgIil9fSwgVXRpbCl7JHttZXRob2R9Cn0pJHtldmFsRGF0YVNvdXJjZVVSTH1gKS5jYWxsKHNlc3Npb24/VXRpbC5tTWV0aG9kV29ya3NwYWNlLmdldChzZXNzaW9uKTp7fSxhcmdzLFV0aWwoaWQsc2Vzc2lvbikpO3JldHVybiBQcm9taXNlLnJlc29sdmUoZXZhbERhdGEpLnRoZW4oZT0+e3NlbGYucG9zdE1lc3NhZ2Uoe2lkLHNlc3Npb24sY2F0ZWdvcnksZGF0YTplLGVycm9yOm51bGx9KX0pLmNhdGNoKGU9PntzZWxmLnBvc3RNZXNzYWdlKHtpZCxzZXNzaW9uLGNhdGVnb3J5LGRhdGE6bnVsbCxlcnJvcjplIGluc3RhbmNlb2YgRE9NRXhjZXB0aW9uJiZlLm5hbWU9PT0iRGF0YUNsb25lRXJyb3IiPyJEYXRhQ2xvbmVFcnJvciDov5Tlm57nu5Pmnpzlj6rog73kuLrnroDljZXmlbDmja7moLzlvI8iOmV9KX0pfSksc2VsZi5hZGRFdmVudExpc3RlbmVyKCJtZXNzYWdlIiwoe2RhdGE6e2NhdGVnb3J5OmUsc2Vzc2lvbjpzfX0pPT57ZT09PSJjbGVhciImJlV0aWwubU1ldGhvZFdvcmtzcGFjZS5kZWxldGUocyl9LCExKX0pKCk7Cg==", self.location)), rt = { + getConfigure: (e) => ge.get(e), + modal: { + notification: (...e) => Z.notification(...e), + success: (...e) => Z.success(...e), + error: (...e) => Z.error(...e) + } +}; +var Se, Re, ne; +const W = class W { + constructor() { + N(this, "exec", (t, n = {}, s = {}, r = "") => new Promise((o, i) => { + const a = We(W, Se)._++; + u(W, Re).set(a, s), W.mQueue.set(a, [o, i]), pe.postMessage({ id: a, session: r, category: "eval", method: t, args: n }); + })); + N(this, "clear", (t) => pe.postMessage({ session: t, category: "clear" })); + if (u(W, ne)) + return u(W, ne); + Promise.resolve().then(() => Hn).then((t) => { + rt.http = t.http; + }), pe.addEventListener("message", ({ data: { id: t, task_id: n, method: s, args: r, category: o, data: i, error: a, session: l } }) => { + if (o === "eval" && W.mQueue.has(t)) + a !== null ? W.mQueue.get(t)[1](a) : W.mQueue.get(t)[0](i), u(W, Re).delete(t), W.mQueue.delete(t); + else if (o === "util") + try { + const c = f.get(rt, s.split("/")) || f.get(u(W, Re).get(n), s.split("/")); + if (!f.isFunction(c)) + throw `${s} not found`; + Promise.resolve(Reflect.apply(c, void 0, r)).then((d) => { + pe.postMessage({ id: t, task_id: n, category: o, method: s, args: r, session: l, data: d, error: null }); + }).catch((d) => { + pe.postMessage({ id: t, task_id: n, category: o, method: s, args: r, session: l, data: null, error: d }); + }); + } catch (c) { + pe.postMessage({ id: t, task_id: n, category: o, method: s, args: r, session: l, data: null, error: c }); + } + }, !1); + } +}; +Se = new WeakMap(), Re = new WeakMap(), ne = new WeakMap(), N(W, "mQueue", /* @__PURE__ */ new Map()), v(W, Se, 0), v(W, Re, /* @__PURE__ */ new Map()), v(W, ne, null), N(W, "getInstance", () => (u(W, ne) || E(W, ne, new W()), u(W, ne))); +let xe = W; +const ae = xe.getInstance(); +var se, x; +const D = class D { + constructor() { + v(this, x, /* @__PURE__ */ new Map()); + N(this, "setVendor", (t, n) => u(this, x).set(t, new yt(n, (s, r) => s.dynamicRequireFsdpfComponent(r)))); + N(this, "getWidgetComponent", async (t) => { + if (!t) + throw "getWidgetComponent widget is required"; + const [, n] = t == null ? void 0 : t.split("@app/"), [, s] = t == null ? void 0 : t.split("@pkg/"), [, r] = t == null ? void 0 : t.split("@fsdpf/"); + try { + switch (!0) { + case (!!n && u(this, x).has("pkg")): + return await u(this, x).get("pkg").get(n); + case (!!s && u(this, x).has("pkg")): + return await u(this, x).get("pkg").get(s); + case (!!r && u(this, x).has("pkg")): + return await u(this, x).get("pkg").get(r); + } + } catch (o) { + throw o; + } + }); + if (u(D, se)) + return u(D, se); + } +}; +se = new WeakMap(), x = new WeakMap(), v(D, se, null), N(D, "getInstance", () => (u(D, se) || E(D, se, new D()), u(D, se))); +let Ae = D; +const B = Ae.getInstance(), sn = () => "Table"; +var re, Q, de, je; +const Y = class Y { + constructor() { + v(this, Q, null); + v(this, de, /* @__PURE__ */ new Map()); + v(this, je, () => { + if (u(this, Q)) + return u(this, Q).port.postMessage({ command: "status", data: [] }); + E(this, Q, new SharedWorker(new URL("data:text/plain;base64,Y29uc3QgcG9ydHMgPSBbXQpsZXQgd3MgPSBudWxsCgpmdW5jdGlvbiBpbml0V3ModXJsKSB7CiAgd3MgPSBuZXcgV2ViU29ja2V0KHVybCkKICB3cy5vbmNsb3NlID0gKGUpID0+IGNvbnNvbGUubG9nKCd3cyBjbG9zZWQnLCBlKQogIHdzLm9uZXJyb3IgPSAoZSkgPT4gY29uc29sZS5sb2coJ3dzIGVycm9yJywgZSkKICB3cy5vbm1lc3NhZ2UgPSAoeyBkYXRhIH0pID0+IHsKICAgIGNvbnN0IHZhbHVlID0gSlNPTi5wYXJzZShkYXRhKQogICAgcG9ydHMuZm9yRWFjaChwb3J0ID0+IHBvcnQucG9zdE1lc3NhZ2UodmFsdWUpKQogIH0KfQoKZnVuY3Rpb24gY2xvc2VXcygpIHsKICBpZiAoIXdzIHx8IHdzLnJlYWR5U3RhdGUgPT0gV2ViU29ja2V0Lk9QRU4pIHsKICAgIHdzLmNsb3NlKCkKICB9Cn0KCmZ1bmN0aW9uIHN0YXR1cygpIHsKICB0aGlzLnBvc3RNZXNzYWdlKHsgcmVhZHlTdGF0ZTogd3MgPyB3cy5yZWFkeVN0YXRlIDogV2ViU29ja2V0LkNMT1NFRCB9KQp9CgpzZWxmLm9uY29ubmVjdCA9IChlKSA9PiB7CiAgY29uc3QgcG9ydCA9IGUucG9ydHNbMF07CgogIHBvcnQub25tZXNzYWdlID0gKHsgZGF0YTogeyBjb21tYW5kLCBkYXRhIH0gfSkgPT4gewogICAgaWYgKGNvbW1hbmQgJiYgWydpbml0V3MnLCAnY2xvc2VXcycsICdzdGF0dXMnXS5pbmNsdWRlcyhjb21tYW5kKSkgUmVmbGVjdC5hcHBseShzZWxmPy5bY29tbWFuZF0sIHBvcnQsIGRhdGEgfHwgW10pCiAgfQoKICBwb3J0cy5wdXNoKHBvcnQpCn0K", self.location))), u(this, Q).port.onmessage = (t) => { + var n, s; + (n = t.data) != null && n.uuid ? u(this, de).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 && F.get("/api/user-api-token").then(({ token: r, expire_at: o }) => { + u(this, Q).port.postMessage({ command: "initWs", data: [`ws${f.trimStart(tt, "http")}api/user-resource-status-ws?token=${r}`] }); + }); + }, u(this, Q).port.postMessage({ command: "status", data: [] }); + }); + N(this, "subscribe", (t, n = []) => (n ? Array.isArray(n) && n.length == 0 ? n = "*" : Array.isArray(n) || (n = [n].flat()) : n = "*", u(this, de).set(t, n), u(this, de).size == 1 && u(this, je).call(this), () => this.unsubscribe(t))); + N(this, "unsubscribe", (t) => u(this, de).delete(t)); + if (u(Y, re)) + return u(Y, re); + } +}; +re = new WeakMap(), Q = new WeakMap(), de = new WeakMap(), je = new WeakMap(), v(Y, re, null), N(Y, "getInstance", () => (u(Y, re) || E(Y, re, new Y()), u(Y, re))); +let Be = Y; +const bt = Be.getInstance(), vt = () => { + const e = j(!0), [t, n] = V(0); + return R(() => () => e.current = !1, []), () => e.current && Kt(() => { + n(t + 1); + }); +}, ss = ({ value: e, defaultValue: t, onChange: n }) => { + const s = vt(), r = j(e !== void 0 ? e : t); + e !== void 0 && (r.current = e); + const o = me(f.debounce((i) => { + e === void 0 && (r.current = i, s()), n && n(i); + }, 380, { leading: !0, trailing: !1 }), [e]); + return [r.current, o]; +}, ot = (e) => { + const t = j(); + return R(() => { + t.current = e; + }), t.current; +}, rs = (e) => { + const t = j(), [n, s] = V(e); + return R(() => { + f.isFunction(t.current) && t.current(n); + }, [n]), [n, function(r, o) { + t.current = o, s(r); + }]; +}, De = (e = b.EffectCallback, t, n = f.isEqual) => { + const s = b.useRef(t); + (!s.current || !n(t, s.current)) && (s.current = t), b.useEffect(e, [s.current]); +}, Ct = (e, t = "string") => { + var n; + if (!Array.isArray(e)) + return e; + for (let s = 0; s < e.length; s++) + e[s].value = f.toPrimitive((n = e[s]) == null ? void 0 : n.value, t), e[s] && Reflect.has(e[s], "children") && (e[s].children = Ct(e[s].children, t)); + return e; +}, os = (e, t = "json", n = "string", s, r = null) => { + const [o] = we.useForm(s), [i, a] = V([{ label: "无", value: "", disabled: !0 }]), l = j([]), c = we.useWatch((d) => l.current.length === 0 ? null : f.pick(d, l.current), o) || null; + return R(() => { + Array.isArray(e) ? a(e) : t === "javascript" && e ? ae.exec(e, {}, { + getFieldValue: (d) => (l.current.includes(d) || l.current.push(d), o.getFieldValue(d)), + getFieldValueForBasicForm: (d) => (l.current.includes(d) || l.current.push(d), r ? r.getFieldValue(d) : o.getFieldValue(d)) + }).then((d) => { + a(f.toPrimitive(d, "array")); + }) : e && a(f.toPrimitive(e, "array")); + }, [e, t, c]), Ct(i, n); +}, is = (e) => { + const [t, n] = V(), s = { type: "GET" }; + if (typeof e == "string" ? s.url = e : f.isPlainObject(e) && Object.assign(s, e), !(s != null && s.url)) + throw "url is required"; + const r = (o) => F.request(s, !1).resp((i) => (console.log("useSubscribeRequest", o), n(i), i)); + return De(() => { + let o = null; + return r().then((i) => { + o = bt.subscribe(r, i.res); + }), () => o == null ? void 0 : o(); + }, s), t; +}, rn = (e) => { + const [t, n] = b.useState({ gridItems: [], hideItems: [] }); + return b.useEffect(() => { + e && F.get(`/api/_/${e}`).then(({ + pk: s, + uuid: r, + code: o, + resource: i, + align: a, + listenChangeFields: l, + listenChangeFieldsFunc: c, + fields: d + }) => ({ + pk: s, + uuid: r, + code: o, + resource: i, + align: a, + listenChangeFields: l, + listenChangeFieldsFunc: c, + ...d.reduce((h, p) => { + var m; + return (m = p == null ? void 0 : p.field) != null && m.hidden ? h.hides.push(p == null ? void 0 : p.field) : h.items.push(p), h; + }, { items: [], hides: [] }) + })).then(n); + }, [e]), t; +}, on = ({ + max: e = 0, + min: t = 0, + type: n = "", + message: s, + pattern: r, + required: o = !1, + validator: i +} = {}, a, l) => { + const [c, d] = V([]); + return R(() => { + const h = []; + if (o) { + let p = l; + switch (l) { + case "number": + case "string": + case "array": + break; + case "bool": + p = "boolean"; + break; + case "json": + p = "object"; + break; + } + h.push({ type: p, required: !0, whitespace: !0, message: "该项必填" }); + } + switch (n) { + case "string": + h.push({ + type: n, + max: e, + min: t, + message: s || (t && e ? `字符必须在 ${t} ~ ${e} 之间` : `${e ? "最多能有" : "最少要有"} ${t || e} 个字符`) + }); + break; + case "pattern": + h.push({ type: "string", pattern: r, message: s }); + break; + case "validator": + i && h.push(({ getFieldValue: p }) => ({ + validator: async (m, y) => { + const C = await ae.exec(i, { value: y, fieldName: a }, { getFieldValue: p }); + return f.isString(C) && C ? Promise.reject(C) : f.isBoolean(C) && !C ? Promise.reject(s) : Promise.resolve(); + } + })); + break; + } + d(h); + }, [e, t, n, s, r, o, i]), c; +}, an = (e, t, n) => { + const [s, r] = V(null); + return R(() => { + const { + initDataUri: o = `/api/${e}`, + initDataMethod: i = "GET" + } = n || {}; + F.request({ + method: i, + url: f.trimEnd(`${o}/${t}`, "/") + }).then((a) => { + r(a); + }); + }, [e, t, n]), s; +}, cn = (e, t, n, s = {}) => { + const r = vt(), o = j(!0), i = j([]), [a, l] = V(n), c = we.useWatch((d) => JSON.stringify(f.pick(d, i.current)), t) || "{}"; + return R(() => { + e && ae.exec(e, s, { + getFieldValue: f.wrap(t.getFieldValue, (d, h) => (i.current.some((p) => f.isEqual(p, h)) || (i.current.push(h), r()), d(h))), + isFieldTouched: t.isFieldTouched, + isFieldsTouched: t.isFieldsTouched + }).then((d) => o.current && l(d)); + }, [e, c, t, s]), R(() => () => o.current = !1, []), a; +}, ln = (e) => ({ + code: t, + layout: n, + name: s, + primaryKey: r = 0, + style: o = {}, + formProps: i = {}, + form: a, + isPreview: l = !1, + className: c, + onFinish: d, + onValuesChange: h = () => { + }, + ...p +}) => { + const { + align: m, + autoComplete: y, + resource: C, + items: w, + hides: X, + rowHeight: Ne, + marginX: L, + marginY: ce, + listenChangeFields: q, + listenChangeFieldsFunc: I, + pk: O, + uuid: J + } = rn(t), [T] = be.useForm(a), _ = ({ + changedValues: P, + allValues: H, + listenChangeFields: wt, + listenChangeFieldsFunc: nt, + onValuesChange: $n, + code: zn + }) => { + nt && Array.isArray(wt) && ae.exec( + nt, + { changedValues: P, allValues: H }, + { + getFieldValue: T.getFieldValue, + setFieldsValue: T.setFieldsValue, + isFieldTouched: T.isFieldTouched, + isFieldsTouched: T.isFieldsTouched + } + ); + }, Ie = ie(() => [ + { name: "__PK__", value: O }, + { name: "__PROPS__", value: i }, + { name: "__RESOURCE__", value: C }, + { name: "__LAYOUT_KEY__", value: t }, + { name: "__LAYOUT_UUID__", value: J }, + { name: "__PRIMARY_KEY__", value: r } + ], [O, t, J, C, r, i]); + return /* @__PURE__ */ S( + be, + { + className: c, + requiredMark: !0, + name: s || t, + layout: n || m, + fields: Ie, + form: T, + autoComplete: y, + style: { ...o, position: "relative" }, + onFinish: d, + onValuesChange: (P, H) => _( + { + changedValues: P, + allValues: H, + listenChangeFields: q, + listenChangeFieldsFunc: I, + onValuesChange: h, + code: t + } + ), + children: [ + /* @__PURE__ */ g( + e, + { + ...p, + form: T, + code: t, + fields: w, + rowHeight: Ne, + marginX: L, + marginY: ce + } + ), + X == null ? void 0 : X.map((P) => { + var H; + return /* @__PURE__ */ g(mt, { name: P.code, children: /* @__PURE__ */ g( + un, + { + form: T, + name: P.code, + type: P.type, + initialValue: P.initialValue, + initialValueLanguage: (H = P.extras) == null ? void 0 : H.initialValueLanguage + } + ) }, JSON.stringify(P.code)); + }) + ] + } + ); +}, un = ({ type: e, initialValue: t, initialValueLanguage: n, onChange: s, form: r }) => { + const o = cn( + n == "javascript" && t, + r, + n == "javascript" ? void 0 : t, + {} + ); + return R(() => { + n == "javascript" ? s(f.toPrimitive(o, e)) : s(f.toPrimitive(t, e)); + }, [e, t, o]), null; +}, dn = (e) => function({ code: n, data: s, ...r }) { + const [o, i] = V({ + resource: null, + cols: 12, + rowHeight: 21, + fields: [] + }); + return R(() => { + n && F.get(`/api/_/${n}`).then((a) => i(f.pick(a, ["resource", "cols", "rowHeight", "fields"]))); + }, [n]), (o == null ? void 0 : o.resource) && /* @__PURE__ */ g( + e, + { + ...r, + rowHeight: o.rowHeight, + cols: o.cols, + fields: o.fields, + data: o != null && o.resource ? { [o == null ? void 0 : o.resource]: s } : {} + } + ); +}, fn = "RC_FORM_INTERNAL_HOOKS", Vt = (e, { + initialValue: t, + initialValueLanguage: n, + convertJs: s, + convertJsSetting: r, + type: o = "string" +}, i = null) => { + const a = j(!1), l = ut(Yt), [c, d] = V(), [h, p] = V(n == "javascript" || !e ? void 0 : l.getFieldValue(e)), { registerWatch: m } = l.getInternalHooks(fn) || {}; + return R(() => m == null ? void 0 : m((y, C, w) => { + if (!a.current) + return; + const X = f.get(C, e); + f.isEqual(X, h) || p(f.toPrimitive(X, o)); + }), [h]), R(() => { + n == "javascript" && t ? ae.exec(t, {}, { + getFieldValueForBasicForm: (y) => i ? i.getFieldValue(y) : l.getFieldValue(y), + getFieldValue: (y) => l.getFieldValue(y) + }).then((y) => p(f.toPrimitive(y, o))).catch((y) => notification.error({ message: `布局数据错误: ${JSON.stringify(y)}` })).finally(() => a.current = !0) : (t && p(f.toPrimitive(t || l.getFieldValue(e) || t, o)), a.current = !0); + }, [t, n]), De(() => { + a.current && s && B.getWidgetComponent(s).then(({ default: y }) => y({ value: h, record: l.getFieldsValue(!0), $setting: r })).then(d).catch((y) => console.error("布局数据转换错误: ", y, s)); + }, [h, s, r]), [c || h, h]; +}, mn = (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"] = it(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"] = it(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; +}, it = (e, t, n, s) => `${e || 0}px ${t || 0}px ${n || 0}px ${s || 0}px`, Ft = ({ cols: e, rowHeight: t, fields: n, data: s, containerPadding: r = [0, 0], itemMargin: o = [4, 0], formProps: i = {}, className: a, ...l }) => { + const [c] = we.useForm(), d = Rt(n, hn, "@pkg/grid-layouts"), h = ie(() => [ + { name: "__PROPS__", value: i } + ], [i]); + return De(() => { + c.setFieldsValue(s); + }, [s]), /* @__PURE__ */ g(we, { fields: h, form: c, component: !1, children: /* @__PURE__ */ g( + "div", + { + ...l, + className: $("ff-grid-layout", a), + 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: d + } + ) }); +}, Rt = (e, t, n = "@pkg/grid-layouts", s = null) => ie(() => { + var r; + return (r = f.sortBy(e, ["y", "x"])) == null ? void 0 : r.map( + ({ i: o, x: i, y: a, w: l, h: c, field: { boxStyle: d, widgetPrefix: h = n, widget: p, ...m } }, y) => /* @__PURE__ */ g( + "div", + { + className: "grid-layout-item", + style: mn(i, a, l, c, d, p === "Height" && (m == null ? void 0 : m.initialValue)), + children: /* @__PURE__ */ g( + gn, + { + ...m, + basicForm: s, + itemWidget: p != null && p.startsWith("@") ? p : `${h}/${p}`, + itemWidgetRender: t + } + ) + }, + o || y + ) + ); +}, [e]), gn = ({ itemWidget: e, itemWidgetRender: t, basicForm: n, ...s }) => { + const [r, o] = V(); + return R(() => { + B.getWidgetComponent(e).then(({ defaultProps: i, default: a }) => { + o(b.createElement(t(a, i, n), s)); + }).catch((i) => o(e)); + }, [e]), r; +}, hn = (e, t, n = null) => (s) => { + const { + code: r, + label: o, + extras: i, + isVirtual: a, + initialValue: l, + initialValueLanguage: c, + convertJs: d, + convertJsSetting: h, + ...p + } = f.merge({}, t, s), [m, y] = Vt(a ? null : r, { + initialValue: l, + initialValueLanguage: c, + convertJs: d, + convertJsSetting: h, + type: (p == null ? void 0 : p.type) || "string" + }, n); + return /* @__PURE__ */ g(e, { ...p, value: m, rawValue: y, $setting: i || {} }); +}, as = dn(Ft), kt = ({ widget: e, widgetPrefix: t, widgetDecorator: n, subWidgets: s, basicForm: r, ...o }) => { + const i = e != null && e.startsWith("@") ? e : `${t}/${e}`, [a, l] = V(); + return R(() => { + i && B.getWidgetComponent(i).then(({ defaultProps: c, default: d }) => ({ + default: Nt(d, c, r) + })).catch((c) => ({ default: () => `${c}` })).then((c) => l(b.createElement(c.default, o))); + }, [i]), a && b.cloneElement(a, o); +}; +kt.defaultProps = { + widgetPrefix: "@pkg/grid-layout-forms", + widget: "Input" +}; +const Nt = (e, t, n = null) => (s) => { + const { + type: r, + code: o, + label: i, + noStyle: a, + placeholder: l, + extras: c, + validators: d, + help: h, + isVirtual: p, + initialValue: m, + initialValueLanguage: y, + convertJs: C, + convertJsSetting: w, + widgetPerfix: X, + boxStyle: Ne, + widgetDecorator: L, + subWidgets: ce, + ...q + } = { ...t, ...s }, I = on(d || {}, o, r), O = { + label: i, + noStyle: a, + colon: !1 + }, J = { + placeholder: l, + ...q + }; + return /* @__PURE__ */ g( + mt, + { + name: o, + rules: I, + normalize: (T) => T == null ? void 0 : f.toPrimitive(T, r), + children: (T, _, Ie) => { + var P; + return /* @__PURE__ */ g( + e, + { + type: r, + rcform: Ie, + itemProps: { + validateStatus: _.errors.length > 0 ? "error" : "success", + tooltip: h, + help: _.errors.length > 0 ? _.errors.join("、") : null, + required: ((P = I == null ? void 0 : I[0]) == null ? void 0 : P.required) || !1, + ...O + }, + fieldProps: { ...J, ...T }, + $setting: c || {} + } + ); + } + } + ); +}, _e = ({ cols: e, rowHeight: t, itemMargin: n = [8, 8], containerPadding: s = [0, 0], fields: r }) => { + const o = Rt(r, Nt, "@pkg/grid-layout-forms"); + return /* @__PURE__ */ g(jt, { theme: { components: { Form: { itemMarginBottom: 0 } } }, children: /* @__PURE__ */ g("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 }) }); +}; +_e.propTypes = { + fields: G.array.isRequired +}; +_e.defaultProps = { + fields: [] +}; +const pn = ln(_e), It = ({ children: e }) => { + const [t, n] = V({}), s = me((o, i) => n((a) => ({ ...a, [o]: i })), []), r = me((o) => n((i) => ({ ...i, [o]: void 0 })), []); + return /* @__PURE__ */ g(he.Provider, { value: { ele: t, mount: s, unmount: r }, children: e }); +}; +It.defaultProps = { + isDrawerRender: !1 +}; +It.propTypes = { + isDrawerRender: G.bool +}; +const yn = (e = {}, t = {}, n = {}, s = "") => f.deepSome(e, (r, o) => o === "type" && r === "code") ? Wt(e, t, n, s) : Lt(e, t, n, s), Wt = async (e = {}, t = {}, n = {}, s = "") => { + let r = /* @__PURE__ */ Object.create(null); + for (let o in e) + if (Reflect.has(e[o], "type") && ["code", "field", "router", "query", "string"].includes(e[o].type)) { + const { type: i, value: a = "", default: l = s } = e[o]; + switch (i) { + case "code": + r[o] = await ae.exec(a, n, {}) || l; + break; + case "field": + r[o] = f.get(n, a, l); + break; + case "router": + r[o] = t[a] || l; + break; + case "query": + r[o] = f.get(t.$query, o) || l; + break; + case "string": + r[o] = a || l; + } + } else + r[o] = await Wt(e[o], t, n, s); + return r; +}, Lt = (e = {}, t = {}, n = {}, s = "") => Object.keys(e || {}).reduce((r, o) => { + if (f.isPlainObject(e[o])) + if (Reflect.has(e[o], "type") && ["field", "router", "query", "string"].includes(e[o].type)) { + const { type: i, value: a = "", default: l = s } = e[o]; + switch (i) { + case "field": + r[o] = f.get(n, a, l); + break; + case "router": + r[o] = t[a] || l; + break; + case "query": + r[o] = f.get(t.$query, o) || l; + break; + case "string": + r[o] = a || l; + } + } else + r[o] = Lt(e[o], t, n, s); + return r; +}, {}), bn = (e, t, { isReplaceRouteHistory: n = !1 } = {}) => et.redirect(t, e, { replace: n }), at = (e, t, { status: { loading: n, disabled: s }, setStatus: r }) => { + const o = { + loading: (i) => i === void 0 ? n : r((a) => ({ ...a, loading: i })), + disabled: (i) => i === void 0 ? s : r((a) => ({ ...a, disabled: i })) + }; + return f.isFunction(t) ? t.call(null, { ...e, ...o }) : f.isString(t) && t ? ae.exec(t, e, o) : null; +}, ct = (e, t, n, s) => Z.modal( + t, + { ...e, $setting: n, code: t }, + s +), vn = (e, t, n, s) => Z.modal( + Nn, + { ...e, $setting: n, code: t }, + s +), Cn = ({ + widget: e, + widgetType: t, + widgetData: n, + widgetProps: s, + widgetSetting: r, + widgetContainerProps: o +}, { onAfterClick: i, onBeforeClick: a }) => { + let l = gt(); + ut(pt); + const [c, d] = V({ leading: !0, trailing: !1 }), h = ie(() => { + switch (t) { + case "redirect": + return f.partialRight(bn, e, r); + case "func": + return f.partialRight(at, (r == null ? void 0 : r.code) || e, { status: c, setStatus: d }); + case "fsdpf-component": + return f.partialRight(ct, e, r, o); + case "grid-layout-form": + return f.partialRight(vn, e, r, o); + default: + if (Zt(e)) + return f.partialRight(ct, e, r, o); + if (f.isFunction(e)) + return f.partialRight(at, (r == null ? void 0 : r.code) || e, { status: c, setStatus: d }); + } + return (...m) => console.error("useButton unknown widgetType", t, ...m); + }, [e, t]); + return [f.debounce((m) => (a == null || a(m), Promise.resolve(yn(s, l, m)).then((y) => h({ ...n, ...y })).then((y) => i == null ? void 0 : i(y))), 300, { leading: !0, trailing: !1 }), c]; +}, Oe = (e) => function({ + className: n, + children: s, + name: r, + icon: o, + type: i, + data: a, + noAuthType: l, + onAfterClick: c, + onBeforeClick: d, + loading: h, + disabled: p, + tooltip: m, + popConfirm: y, + widget: C, + widgetType: w, + widgetData: X, + widgetProps: Ne, + widgetSetting: L, + widgetContainerProps: ce, + ...q +}) { + const I = { + type: "primary", + className: $("ff-button", n) + }; + i === "danger" ? I.danger = !0 : i === "default" && (I.type = i), e === "link" || e === "dashed" ? (I.type = e, i === "default" && (I.className = $(I.className, "ff-default"))) : (e === "circle" || e === "round") && (I.shape = e), o && (I.icon = /* @__PURE__ */ g(ht, { type: o })); + const [O, J] = V(!1), [T, { disabled: _, loading: Ie }] = Cn({ widget: C, widgetType: w, widgetData: X, widgetProps: Ne, widgetSetting: L, widgetContainerProps: ce }, { onAfterClick: c, onBeforeClick: d }); + return /* @__PURE__ */ g( + Ut, + { + okText: "确定", + cancelText: "取消", + ...y || {}, + disabled: _ || p, + open: O, + onOpenChange: (H) => { + if (!H) + return J(H); + y ? J(H) : T(a); + }, + onConfirm: () => { + T(a); + }, + onClick: (H) => { + H.stopPropagation(); + }, + children: /* @__PURE__ */ g(Dt, { ...m, title: O ? null : m == null ? void 0 : m.title, trigger: ["hover", "click"], children: /* @__PURE__ */ g( + Le, + { + loading: Ie || h, + disabled: _ || p, + ...I, + ...q, + children: s || r + } + ) }) + } + ); +}, k = Oe("default"), Vn = Oe("link"), Fn = Oe("circle"), Rn = Oe("round"), kn = Oe("dashed"); +k.defaultProps = { + type: "default" +}; +k.propTypes = { + type: G.oneOf(["primary", "default", "danger"]), + name: G.string, + // 按钮名称 + icon: G.string, + // 图标 + data: G.any, + // onClick 数据源, 会受到 widgetProps 数据结构影响 + widget: G.any, + // 组件 + widgetType: G.oneOf(["destroy", "redirect", "func", "fsdpf-component", "grid-layout-form", "grid-layout"]), + // 组件类型 + widgetData: G.object, + // onClick缺省数据 + widgetProps: G.object, + // data 数据结构 + widgetSetting: G.object, + // $setting + widgetContainerProps: G.object + // 容器配置 +}; +k.Link = Vn; +k.Link.defaultProps = k.defaultProps; +k.Link.propTypes = k.propTypes; +k.Circle = Fn; +k.Circle.defaultProps = k.defaultProps; +k.Circle.propTypes = k.propTypes; +k.Round = Rn; +k.Round.defaultProps = k.defaultProps; +k.Round.propTypes = k.propTypes; +k.Dashed = kn; +k.Dashed.defaultProps = k.defaultProps; +k.Dashed.propTypes = k.propTypes; +const Nn = ({ $setting: e, $close: t, extras: n, code: s, primaryKey: r, ...o }) => { + const [i] = be.useForm(), a = an(s, r, e); + R(() => { + a && i.setFieldsValue(a); + }, [a]); + const l = () => { + const c = i.getFieldValue("__RESOURCE__"), { + initDataUri: d = `/api/${s}` + } = e || {}; + i.validateFields(!0).then((h) => c ? f.pick(h, [c]) : h).then((h) => F.post(r ? `${d}/${r}` : `${d}`, h).msg(t)).catch(() => Toast.error("请先完善表单信息", { duration: 2e3 })); + }; + return /* @__PURE__ */ g( + A, + { + actions: /* @__PURE__ */ S(b.Fragment, { children: [ + /* @__PURE__ */ g(k, { name: "保存", type: "primary", widget: l }), + /* @__PURE__ */ g(k, { name: "取消", widget: () => t(!1) }) + ] }), + extras: n, + children: /* @__PURE__ */ g(pn, { form: i, code: s, primaryKey: r, ...o }) + } + ); +}, In = (e, t, n = "children") => { + if (f.isEmpty(e)) + return {}; + const s = f.find(e, ["value", t]); + if (!f.isEmpty(s)) + return s; + const r = e.length; + for (let o = 0; o < r; o++) { + const { [n]: i } = e[o], a = In(i, t, n); + if (!f.isEmpty(a)) + return a; + } + return {}; +}, Wn = ({ listCode: e, className: t, record: n, props: s, children: r, cb: o, ...i }) => { + var d, h; + const [a, l] = V(!1), c = () => { + }; + return s != null && s.editableByJs && (s != null && s.uuid) && ((d = c(s.uuid)) != null && d.auth) ? /* @__PURE__ */ g( + ft, + { + overlayClassName: "ff-data-list-editable-popover", + title: s != null && s.title ? `${s == null ? void 0 : s.title} - 编辑` : "编辑", + trigger: ["contextMenu"], + placement: (s == null ? void 0 : s.align) === "right" ? "topRight" : "topLeft", + arrowPointAtCenter: (s == null ? void 0 : s.align) === "center", + open: a, + onOpenChange: l, + overlayStyle: { width: ((h = s == null ? void 0 : s.editableByJsSetting) == null ? void 0 : h.width) || 260 }, + content: /* @__PURE__ */ g(Ln, { ...s, listCode: e, record: n, onCancel: () => { + l(!1); + }, cb: o }), + children: /* @__PURE__ */ g("td", { className: $(t, "ff-data-list-editable-cell"), children: r, ...i }) + } + ) : /* @__PURE__ */ g("td", { className: t, children: r, ...i }); +}, Ln = ({ dataIndex: e, record: t, onCancel: n, uuid: s, title: r, type: o, listCode: i, editableByJs: a, editableByJsSetting: l, cb: c }) => { + const [d] = be.useForm(), h = (l == null ? void 0 : l.primaryKey) || "", p = () => d.validateFields().then(({ value: y }) => { + const C = f.get(t, h.substring(h.indexOf(".") + 1)); + if (C) + F.put(`/api/${i}-storeBy-${s}/${C}`, { value: y }).msg(c).then(n); + else + throw "获取更新主键失败!"; + }).catch(console.warn), m = () => { + d.setFieldsValue({ + value: f.get(t, e), + __PROPS__: JSON.parse(JSON.stringify(t)) + }); + }; + return R(() => { + m(); + }, [JSON.stringify(t)]), /* @__PURE__ */ S(be, { form: d, layout: "vertical", children: [ + /* @__PURE__ */ g( + kt, + { + label: null, + code: ["value"], + widget: a, + placeholder: r, + ...f.omit(l, ["primaryKey", "width", "height"]) + } + ), + /* @__PURE__ */ g(be.Item, { noStyle: !0, name: ["__PROPS__"], children: /* @__PURE__ */ g("div", {}) }), + /* @__PURE__ */ S("div", { className: "fsdpf-editable-popover-footer", children: [ + /* @__PURE__ */ g(Le, { size: "small", onClick: m, children: "重置" }), + /* @__PURE__ */ S(Le.Group, { children: [ + /* @__PURE__ */ g(Le, { size: "small", onClick: n, children: "取消" }), + /* @__PURE__ */ g(Le, { size: "small", type: "primary", onClick: p, children: "确定" }) + ] }) + ] }) + ] }); +}, Zn = ({ widget: e, widgetPrefix: t, basicForm: n, ...s }) => { + const r = e != null && e.startsWith("@") ? e : `${t}/${e}`, [o, i] = V(); + return R(() => { + r && B.getWidgetComponent(r).then(({ defaultProps: a, default: l }) => ({ + default: wn(l, a, n) + })).catch((a) => ({ default: () => `${a}` })).then((a) => i(b.createElement(a.default, s))); + }, [r]), o; +}, wn = (e, t, n = null) => (s) => { + const { + code: r, + label: o, + extras: i, + isVirtual: a, + initialValue: l, + initialValueLanguage: c, + convertJs: d, + convertJsSetting: h, + value: p, + ...m + } = f.merge({}, t, s), [y, C] = Vt(a ? null : r, { + initialValue: l, + initialValueLanguage: c, + convertJs: d, + convertJsSetting: h, + type: (m == null ? void 0 : m.type) || "string" + }, n); + return /* @__PURE__ */ g(e, { ...m, value: y, rawValue: C, $setting: i || {} }); +}; +Zn.defaultProps = { + widgetPrefix: "@pkg/grid-layouts" +}; +const Gn = ({ className: e, children: t, itemOperations: n, resource: s, $setting: r }) => /* @__PURE__ */ g("div", { className: $("ff-data-list-grid-layout-items", e), children: b.Children.map(t, (o) => /* @__PURE__ */ g( + Tn, + { + operations: n, + data: s ? { [s]: o.props.data } : o.props.data, + children: o + } +)) }), Tn = ({ operations: e, children: t, data: n }) => f.isEmpty(e) ? t : /* @__PURE__ */ g( + ft, + { + destroyTooltipOnHide: !0, + align: { offset: [0, -8] }, + zIndex: 100, + mouseLeaveDelay: 0.2, + placement: "topRight", + content: /* @__PURE__ */ g("div", { className: "ff-data-list-item-operations flex-grow-1", children: e == null ? void 0 : e.map(({ isRefresh: s, ...r }) => /* @__PURE__ */ g( + k, + { + ...r, + data: n, + onAfterClick: (o) => console.log("列表按钮回调", o, n) + }, + (r == null ? void 0 : r.uuid) || useId() + )) }), + children: t + } +), En = ({ + theme: e, + themeProps: t, + itemClassName: n, + className: s, + dataSource: r, + fields: o, + itemOperations: i, + itemOperationsAccess: a, + resource: l, + primaryKey: c, + ...d +}) => { + const h = Et(), p = ie(() => /* @__PURE__ */ g(Ft, { ...d, fields: o }), [o, d]), m = ie(() => r == null ? void 0 : r.map((w, X) => b.cloneElement(p, { key: `${h}-${(w == null ? void 0 : w[c]) || X}`, data: w })), [r, p]), y = ie(() => e ? b.lazy(() => B.getWidgetComponent(e).catch((w) => ({ default: () => `${w}` }))) : null, [e]), C = { + $setting: t, + resource: l, + primaryKey: c, + itemOperations: i, + itemOperationsAccess: a, + className: s, + itemClassName: n, + children: m + }; + return y ? /* @__PURE__ */ g(b.Suspense, { fallback: /* @__PURE__ */ g("div", { style: { width: "100%", height: "100%" } }), children: /* @__PURE__ */ g(y, { ...C }) }) : /* @__PURE__ */ g(Gn, { ...C }); +}, On = ({ listCode: e, base62params: t, className: n, itemClassName: s }) => { + const [r, o] = V(/* @__PURE__ */ new Map()), [i, a] = V([]), [{ + resource: l, + primaryKey: c, + cols: d, + rowHeight: h, + fields: p, + itemOperations: m = [], + marginX: y, + marginY: C, + themeConfig: w, + theme: X, + isItemGridLayout: Ne, + itemGridLayout: L + }, ce] = V({ isItemGridLayout: !1, itemGridLayout: {} }), q = () => F.list(e, t).then(({ operationsAccess: I, dataSource: O }) => { + o(new Map(I)), a(O); + }); + return R(() => { + let I = null; + return F.get(`/api/_/${e}`).resp(({ data: O, res: J }) => { + O != null && O.isDynamicRefresh && (I = bt.subscribe(q, J)), ce(O); + }).catch(() => ce({})), a([null]), () => I == null ? void 0 : I(); + }, [e]), R(() => { + q(); + }, [t]), /* @__PURE__ */ g( + En, + { + className: n, + itemClassName: s, + dataSource: i, + resource: l, + primaryKey: c, + itemOperations: m, + itemOperationsAccess: r, + theme: X, + themeProps: w, + cols: L == null ? void 0 : L.cols, + rowHeight: L == null ? void 0 : L.rowHeight, + fields: L == null ? void 0 : L.fields, + itemMargin: [L == null ? void 0 : L.marginX, L == null ? void 0 : L.marginY] + } + ); +}, Pn = (e, t, n, s, r) => { + const o = b.lazy(() => B.getWidgetComponent(e).catch((i) => ({ default: () => `${i}` }))); + return /* @__PURE__ */ g(b.Suspense, { children: /* @__PURE__ */ g( + o, + { + value: t, + record: n, + $setting: s, + base62params: r + } + ) }, e); +}, cs = (e, t = {}) => (ot(e), ot(t), e == null ? void 0 : e.map(({ widgetByJs: s, widgetByJsSetting: r, ...o }, i) => s && !s.endsWith("/BasicShowFieldData") ? { + ...o, + render: (a, l) => { + const c = Pn(s, a, l, r, t); + return f.isFunction(o == null ? void 0 : o.render) ? o.render(c, a, l) : c; + } +} : o)), ls = (e) => { + const [t, n] = V({}); + return R(() => { + let s = !1; + return e && F.get(`/api/_/${e}`).then((r) => f.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; +}, us = (e, t = {}) => { + const [n, s] = V({ dataSource: [] }); + return De(() => { + let r = !1; + return e && F.get(`/api/${e}/${F.encode({ page: 1, ...t })}`).then((o) => !r && s(o)), () => r = !0; + }, [e, t]), n; +}; +sn.EditableCell = Wn; +const Xn = ({ component: e }) => { + const { base62params: t } = gt(); + return /* @__PURE__ */ g( + On, + { + listCode: e, + base62params: F.decode(t) + } + ); +}; +var oe, z, ke, fe, Ee; +const K = class K { + constructor() { + v(this, z, /* @__PURE__ */ new Map()); + v(this, ke, {}); + v(this, fe, null); + N(this, "init", (t, n) => { + E(this, z, t), E(this, ke, n); + }); + N(this, "get", (t) => (u(this, z).has(t) || (t = Array.from(u(this, z).keys()).find((n) => u(this, z).get(n).uri === t)), u(this, z).get(t) || {})); + N(this, "redirect", (t, n, s = {}) => { + const { uri: r, type: o, widgetProps: i } = this.get(t); + let a = xt(r, o != "list" ? n : f.mapValues(n, (c) => F.encode(c))); + const l = new URLSearchParams(); + for (const c in i || {}) + (i == null ? void 0 : i.type) == "query" && l.append(c, n[c]); + return l.size > 0 && (a = `${a}?${l.toString()}`), u(this, fe).navigate(a, s); + }); + /** + * + * @param {*} category // user, system, navigator + * @returns + */ + N(this, "getMenus", (t) => { + var n; + return ((n = u(this, ke)) == null ? void 0 : n[t]) || []; + }); + N(this, "getCurrentMenu", () => { + var s, r; + const t = getCurrentPages(), n = Object.values(u(this, ke)).flat(); + for (let o = t.length - 1; o >= 0; o--) + if ((s = t[o].query) != null && s.c) + return u(this, Ee).call(this, (r = t[o].query) == null ? void 0 : r.c, n); + return null; + }); + N(this, "getCurrentRoute", (t = 0) => { + var s; + const n = (s = u(this, fe).state.matches[u(this, fe).state.matches.length - 1 - t]) == null ? void 0 : s.route; + if (!n) + return null; + for (let [r, o] of u(this, z)) + if (o.uri === n.path) + return o; + return null; + }); + v(this, Ee, (t, n) => { + var s; + for (const r of n) { + if (r.uuid == t || r.widget == t) + return r; + if ((s = r.children) != null && s.length) { + const o = u(this, Ee).call(this, t, r.children); + if (o) + return o; + } + } + return null; + }); + N(this, "createBrowserRouter", (t = {}) => { + if (u(this, z).size == 0) + return null; + const n = ge.get("Common.WEBSITE_DEFAULT_THEME", "@pkg/frameworks/BasicLayout"); + ge.get(en() ? "Common.WEBSITE_LOGIN_REDIRECT" : "Common.WEBSITE_DEFAULT", "/index"); + const s = { [n]: 0 }, r = Array.from(u(this, z).values()).reduce((o, { uuid: i, uri: a, name: l, type: c, component: d, isLogin: h, isLayout: p, extra: m }) => { + let y = {}, C = 0; + switch (c) { + case "list": + y.element = b.createElement(Xn, { component: d }); + break; + case "fsdpf-component": + y.lazy = () => B.getWidgetComponent(d).then((w) => ({ Component: w.default })); + break; + } + if (m != null && m.layout) + if (s[m == null ? void 0 : m.layout]) + C = s[m == null ? void 0 : m.layout]; + else + return s[m == null ? void 0 : m.layout] = o.length, [...o, { + path: "/", + lazy: () => B.getWidgetComponent(m == null ? void 0 : m.layout).then((w) => ({ Component: w.default })), + children: [{ path: a, ...y }] + }]; + return p && C > -1 ? (o[C].children.push({ path: a, ...y }), o) : [...o, { path: a, ...y }]; + }, [ + { + path: "/", + lazy: () => B.getWidgetComponent(n).then((o) => ({ Component: o.default })), + children: [] + } + ]); + return E(this, fe, At(r, t)); + }); + if (u(K, oe)) + return u(K, oe); + } +}; +oe = new WeakMap(), z = new WeakMap(), ke = new WeakMap(), fe = new WeakMap(), Ee = new WeakMap(), v(K, oe, null), N(K, "getInstance", () => (u(K, oe) || E(K, oe, new K()), u(K, oe))); +let Je = K; +const et = Je.getInstance(), lt = { + 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" +}; +f.mixin({ + toPairsDeep: (e, t) => f.flatMap( + f.toPairs(e), + ([n, s]) => f.isObjectLike(s) ? f.toPairsDeep(s, n) : [[`${f.isUndefined(t) ? "" : t + "."}${n}`, s]] + ), + deepSome: (e, t = () => !1) => f.some(e, (n) => { + if (f.some(n, t)) + return !0; + if (!f.isEmpty(n) && (f.isPlainObject(n) || f.isArray(n))) + return f.deepSome(n, t); + }), + toPrimitive: (e, t) => { + let n = "string"; + Array.isArray(e) ? n = "array" : n = typeof e, f.isObject(e) && (n = "json"); + const s = `${n}2${t}`; + return Reflect.has(lt, s) ? lt[s](e) : e; + }, + replaceKeys: (e, t) => !e || typeof e != "object" ? e : Array.isArray(e) ? e.map((n) => f.replaceKeys(n, t)) : Object.keys(e).reduce((n, s) => (t[s] ? n[t[s]] = f.replaceKeys(e[s], t) : n[s] = f.replaceKeys(e[s], t), n), {}) +}); +let tt = ""; +const F = { + init: (e, t, n) => { + Ze.defaults.baseURL = tt = n, Ze.defaults.timeout = 15e3, Object.assign(F, new Me(e, t, Ze)); + } +}, Zt = (e) => { + var t; + return e && (e == null ? void 0 : e.name) && ((e == null ? void 0 : e.prototype) instanceof b.Component || (e == null ? void 0 : e.name.substr(0, 1)) === ((t = e.name.substr(0, 1)) == null ? void 0 : t.toUpperCase())); +}, Hn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ + __proto__: null, + AppGlobalParamsContext: pt, + get AppUrl() { + return tt; + }, + cache: yt, + configure: ge, + core: B, + default: nn, + func: ae, + http: F, + isReactComponent: Zt, + route: et +}, Symbol.toStringTag, { value: "Module" })), ds = () => F.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)), fs = () => F.get("/api/my-menu"), ms = () => F.get("api/init-configure"), gs = () => F.get("/api/init-widget-operation-auth"), hs = (e) => F.get(`/api/user-wx-phone-number/${e}`); +export { + cs as A, + k as B, + ls as C, + En as D, + us as E, + Z as F, + pn as G, + tt as H, + ht as I, + F as J, + Zt as K, + nn as L, + pt as M, + yt as N, + ge as O, + ae as P, + B as Q, + bt as R, + he as S, + sn as T, + et as U, + ds as V, + fs as W, + ms as X, + gs as Y, + hs as Z, + ts as a, + tn as b, + en as c, + ss as d, + ot as e, + rs as f, + qe as g, + De as h, + os as i, + is as j, + A as k, + ns as l, + es as m, + It as n, + Cn as o, + _e as p, + kt as q, + Nn as r, + cn as s, + In as t, + vt as u, + as as v, + Ft as w, + Zn as x, + On as y, + Pn as z +}; diff --git a/dist/components.js b/dist/components.js index f03d92f..33e18c5 100644 --- a/dist/components.js +++ b/dist/components.js @@ -1,4 +1,4 @@ -import { I as s, F as r } from "./common/main-CJT9_qCi.js"; +import { I as s, F as r } from "./common/main-v06hYH4g.js"; export { s as Icon, r as Toast diff --git a/dist/container.js b/dist/container.js index 7b01efe..1132ec4 100644 --- a/dist/container.js +++ b/dist/container.js @@ -1,8 +1,8 @@ -import { S as s, m as t, F as o, k as r, j as F } from "./common/main-CJT9_qCi.js"; +import { S as s, n as t, F as n, m as o, k as r } from "./common/main-v06hYH4g.js"; export { s as Context, t as FFPageRender, - o as FFToastRender, - r as SlotRender, - F as default + n as FFToastRender, + o as SlotRender, + r as default }; diff --git a/dist/data-list.js b/dist/data-list.js index ca74af7..5732317 100644 --- a/dist/data-list.js +++ b/dist/data-list.js @@ -1,4 +1,4 @@ -import { D as e, x as t, T as u, y as r, z as d, C as i, A as l } from "./common/main-CJT9_qCi.js"; +import { D as e, y as t, T as u, z as r, A as d, E as i, C as l } from "./common/main-v06hYH4g.js"; export { e as DataList, t as DataListHelper, diff --git a/dist/grid-layout-form.js b/dist/grid-layout-form.js index 42af764..1eff8cd 100644 --- a/dist/grid-layout-form.js +++ b/dist/grid-layout-form.js @@ -1,9 +1,9 @@ -import { o as r, q as e, p as s, G as t, s as u, r as d } from "./common/main-CJT9_qCi.js"; +import { p as t, r as e, q as o, G as s, t as u, s as d } from "./common/main-v06hYH4g.js"; export { - r as GridLayoutForm, + t as GridLayoutForm, e as GridLayoutFormHelper, - s as GridLayoutFormWidget, - t as default, + o as GridLayoutFormWidget, + s as default, u as getOptionsItemByValue, d as useFnRun }; diff --git a/dist/grid-layout.js b/dist/grid-layout.js index e1125bd..785f976 100644 --- a/dist/grid-layout.js +++ b/dist/grid-layout.js @@ -1,4 +1,4 @@ -import { v as d, w as o, t as r } from "./common/main-CJT9_qCi.js"; +import { w as d, x as o, v as r } from "./common/main-v06hYH4g.js"; export { d as GridLayout, o as GridLayoutWidget, diff --git a/dist/hooks.js b/dist/hooks.js index e3919ba..f641374 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 "axios"; -import { h as r, i, e as m, d as f, f as l, u as c } from "./common/main-CJT9_qCi.js"; +import { h as p, i as r, e as i, d as m, f, j as l, u as b } from "./common/main-v06hYH4g.js"; export { - r as useDeepEqualEffect, - i as useOptions, - m as usePrevious, - f as usePropsValue, - l as useStateCallback, - c as useUpdate + p as useDeepEqualEffect, + r as useOptions, + i as usePrevious, + m as usePropsValue, + f as useStateCallback, + l as useSubscribeRequest, + b as useUpdate }; diff --git a/dist/index.js b/dist/index.js index 41dfffa..a6a4485 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1,7 +1,7 @@ import "lodash"; import "axios"; import "react"; -import { L as e, E as m, M as c, N as i, P as n, K as f, O as l, H as u, J as h, Q as x } from "./common/main-CJT9_qCi.js"; +import { M as e, H as m, N as c, O as i, Q as n, L as f, P as l, J as u, K as h, U as x } from "./common/main-v06hYH4g.js"; import "ff-request"; export { e as AppGlobalParamsContext, diff --git a/dist/res-ws.js b/dist/res-ws.js new file mode 100644 index 0000000..8776fe0 --- /dev/null +++ b/dist/res-ws.js @@ -0,0 +1,5 @@ +import "lodash"; +import { R as a } from "./common/main-v06hYH4g.js"; +export { + a as default +}; diff --git a/dist/service.js b/dist/service.js index 520862b..dc535ac 100644 --- a/dist/service.js +++ b/dist/service.js @@ -1,4 +1,4 @@ -import { V as g, U as s, X as a, R as o, W as r } from "./common/main-CJT9_qCi.js"; +import { X as g, W as s, Z as a, V as o, Y as r } from "./common/main-v06hYH4g.js"; export { g as getConfigure, s as getMenus, diff --git a/dist/user.js b/dist/user.js index a534c13..7731627 100644 --- a/dist/user.js +++ b/dist/user.js @@ -3,7 +3,7 @@ import "react/jsx-runtime"; import "react"; import "@ant-design/icons"; import "classnames"; -import { c as m, a as p, g, l as n, b as c } from "./common/main-CJT9_qCi.js"; +import { c as m, a as p, g, l as n, b as c } from "./common/main-v06hYH4g.js"; export { m as checkUserToken, p as getUserInfo, diff --git a/package.json b/package.json index 19ce99e..371fa33 100644 --- a/package.json +++ b/package.json @@ -1,14 +1,15 @@ { "name": "ff", "private": true, - "version": "0.1.5", + "version": "0.1.6", "type": "module", "files": [ "dist/" ], + "main": "./dist/index.js", "exports": { - ".": "./dist/index.js", "./hooks": "./dist/hooks.js", + "./res-ws": "./dist/res-ws.js", "./service": "./dist/service.js", "./user": "./dist/user.js", "./button": "./dist/button.js", @@ -30,9 +31,9 @@ "antd": "^5.16.0", "axios": "^1.5.0", "classnames": "^2.5.1", + "ff-request": "git+https://git.fsdpf.net/npm/ff-request-dist.git", "lodash": "^4.17.21", "rc-field-form": "^1.44.0", - "ff-request": "git+https://git.fsdpf.net:npm/ff-request-dist.git", "react": "^18.2.0", "react-dom": "^18.2.0", "react-router-dom": "^6.22.3"