This commit is contained in:
what 2024-11-28 14:24:31 +08:00
parent afda35a01d
commit 46bcca9abe
19 changed files with 1530 additions and 1678 deletions

2
dist/button.js vendored
View File

@ -1,4 +1,4 @@
import { U as s, T as u, V as e } from "./common/main-GwmFPdzM.js";
import { U as s, T as u, V as e } from "./common/main-BSuXB8tt.js";
import "prop-types";
export {
s as auth,

View File

@ -24,7 +24,8 @@ import { useParams as Oa, generatePath as Va, createBrowserRouter as Aa, useInRo
import L from "prop-types";
import * as jt from "react-is";
import { useNotification as Ma } from "rc-notification";
import { N as Be, a as Ue, w as ht, S as za } from "./vender-egxe712p.js";
import { N as Be, a as Ue, T as ht, S as za } from "./vender-DMK1apIA.js";
import "rc-util/lib/hooks/useMergedState";
import Mt from "immutability-helper";
import Wa from "rc-drawer";
import Ba from "rc-dialog";
@ -59,7 +60,7 @@ class Qt {
}
}
Ie = new WeakMap(), He = new WeakMap(), je = new WeakMap(), ue = new WeakMap(), Fe = new WeakMap(), Re = new WeakMap();
const Kn = () => d("div", { children: "Empty" }), Qe = C.createContext({ ele: {}, mount: () => {
const _n = () => d("div", { children: "Empty" }), Qe = C.createContext({ ele: {}, mount: () => {
}, unmount: () => {
} }), K = ({ rootClassName: e, className: t, children: a, actions: n, title: r, subTitle: s, extras: i, style: o = {} }) => {
const { mount: l, unmount: u } = C.useContext(Qe);
@ -69,7 +70,7 @@ const Kn = () => d("div", { children: "Empty" }), Qe = C.createContext({ ele: {}
return x(() => (n(e, C.createElement("div", { key: `ff-${e}`, className: R(`ff-popup-${e}`, a) }, t)), () => r(e)), [a, t]), null;
};
K.Action = tt("actions"), K.Title = tt("title"), K.SubTitle = tt("sub-title"), K.Extra = tt("extras"), K.propTypes = { className: L.string, style: L.object, title: L.any, subTitle: L.any, actions: L.any, extras: L.any };
const _n = () => d(K, { className: "ff-loading", children: $("div", { className: "loader", children: [$("div", { className: "square", children: [d("span", {}), d("span", {}), d("span", {})] }), $("div", { className: "square", children: [d("span", {}), d("span", {}), d("span", {})] }), $("div", { className: "square", children: [d("span", {}), d("span", {}), d("span", {})] }), $("div", { className: "square", children: [d("span", {}), d("span", {}), d("span", {})] })] }) }), Gn = () => d("div", { children: "NotFound" }), Zt = ({ children: e }) => {
const Gn = () => d(K, { className: "ff-loading", children: $("div", { className: "loader", children: [$("div", { className: "square", children: [d("span", {}), d("span", {}), d("span", {})] }), $("div", { className: "square", children: [d("span", {}), d("span", {}), d("span", {})] }), $("div", { className: "square", children: [d("span", {}), d("span", {}), d("span", {})] }), $("div", { className: "square", children: [d("span", {}), d("span", {}), d("span", {})] })] }) }), Yn = () => d("div", { children: "NotFound" }), Zt = ({ children: e }) => {
const [t, a] = P({}), n = me((s, i) => a((o) => ({ ...o, [s]: i })), []), r = me((s) => a((i) => ({ ...i, [s]: void 0 })), []);
return typeof (e == null ? void 0 : e.type) == "string" ? e : d(Qe.Provider, { value: { ele: t, mount: n, unmount: r }, children: C.cloneElement(e, { className: t.rootClassName, title: t.title, subTitle: t["sub-title"], actions: t.actions, extras: t.extras }) });
};
@ -194,13 +195,13 @@ rt = new WeakMap(), Ke = new WeakMap(), _e = new WeakMap(), st = new WeakMap(),
return ((r = n.default) == null ? void 0 : r.call(n, a)) || ((s) => s);
}), (t, a) => `${t}::${Z(a, "string")}`));
let wt = it;
const qa = (e, t = {}) => ie(() => e == null ? void 0 : e.map(({ widgetByJs: a, widgetByJsSetting: n, ...r }, s) => a ? { ...r, render: (i, o) => new wt([a, n]).toRender(i, o, "-") } : r), [e, t]), Yn = (e) => {
const qa = (e, t = {}) => ie(() => e == null ? void 0 : e.map(({ widgetByJs: a, widgetByJsSetting: n, ...r }, s) => a ? { ...r, render: (i, o) => new wt([a, n]).toRender(i, o, "-") } : r), [e, t]), Xn = (e) => {
const [t, a] = P({});
return x(() => {
let n = !1;
return e && E.get(`/api/_/${e}`).then((r) => p.pick(r, ["uuid", "name", "code", "resource", "marginX", "marginY", "cols", "rowHeight", "primaryKey", "columns", "itemOperations", "batchOperations", "isConditionFormLayout", "layout", "tabs", "pageSize", "layoutConfig"])).then((r) => !n && a(r)), () => n = !0;
}, [e]), t;
}, Xn = (e, t = {}) => {
}, Qn = (e, t = {}) => {
const [a, n] = P({ dataSource: [] });
return Ze(() => {
let r = !1;
@ -371,14 +372,14 @@ const oa = ({ className: e, title: t, tabs: a, tab: n, onTabChange: r }) => {
}, en = (e, t = {}, a = null) => (n) => {
const { code: r, label: s, extras: i, isVirtual: o, initialValue: l, initialValueLanguage: u, convertJs: c, convertJsSetting: m, ...h } = p.merge({}, t, n), [f, y] = ua(o ? null : r, { initialValue: l, initialValueLanguage: u, convertJs: c, convertJsSetting: m, type: (h == null ? void 0 : h.type) || "string" }, a);
return d(e, { ...h, value: f, rawValue: y, $setting: i || {} });
}, Qn = (Ut = pa, function({ code: e, data: t, ...a }) {
}, Zn = (Ut = pa, function({ code: e, data: t, ...a }) {
const [n, r] = P({ resource: null, cols: 12, rowHeight: 21, fields: [] });
return x(() => {
e && E.get(`/api/_/${e}`).then((s) => r(p.pick(s, ["resource", "cols", "rowHeight", "fields"])));
}, [e]), (n == null ? void 0 : n.resource) && d(Ut, { ...a, rowHeight: n.rowHeight, cols: n.cols, fields: n.fields, data: n != null && n.resource ? { [n == null ? void 0 : n.resource]: t } : {} });
});
var Ut;
const Zn = ({ widget: e, widgetPrefix: t = "@pkg/ff/grid-layouts", basicForm: a, ...n }) => {
const er = ({ widget: e, widgetPrefix: t = "@pkg/ff/grid-layouts", basicForm: a, ...n }) => {
const r = e != null && e.startsWith("@") || e != null && e.startsWith("blob:") ? e : `${t}/${e}`, [s, i] = P();
return x(() => {
r && X.getWidgetComponent(r).then(({ defaultProps: o = {}, default: l }) => ({ default: tn(l, o, a) })).catch((o) => ({ default: () => `${o}` })).then((o) => i(C.createElement(o.default, n)));
@ -521,12 +522,12 @@ let vt = A;
const Ne = vt.getInstance(), ma = () => {
const e = Y(!0), [, t] = C.useReducer((a) => a + 1, 0);
return x(() => () => e.current = !1, []), () => e.current && t();
}, er = (e) => {
}, tr = (e) => {
const t = Y();
return x(() => {
t.current = e;
}, [e]), t.current;
}, tr = (e) => {
}, ar = (e) => {
const [t, a] = P(e), n = Y(null), r = me((s, i) => {
n.current = i, a(s);
}, []);
@ -542,14 +543,14 @@ const Ne = vt.getInstance(), ma = () => {
if (!Array.isArray(e)) return e;
for (let n = 0; n < e.length; n++) e[n].value = Z((a = e[n]) == null ? void 0 : a.value, t), e[n] && Reflect.has(e[n], "children") && (e[n].children = ha(e[n].children, t));
return e;
}, ar = (e, t = "json", a = "string", n, r = null) => {
}, nr = (e, t = "json", a = "string", n, r = null) => {
const [s] = ee.useForm(n), [i, o] = P([{ label: "无", value: "", disabled: !0 }]), l = Y([]), u = ee.useWatch((c) => l.current.length === 0 ? null : p.pick(c, l.current), s) || null;
return x(() => {
Array.isArray(e) ? o(e) : t === "javascript" && e ? Ne.exec(e, {}, { getFieldValue: (c) => (l.current.includes(c) || l.current.push(c), s.getFieldValue(c)), getFieldValueForBasicForm: (c) => (l.current.includes(c) || l.current.push(c), r ? r.getFieldValue(c) : s.getFieldValue(c)) }).then((c) => {
o(Z(c, "array"));
}) : e && o(Z(e, "array"));
}, [e, t, u]), ha(i, a);
}, nr = (e) => {
}, rr = (e) => {
const [t, a] = P(), n = { type: "GET" };
if (typeof e == "string" ? n.url = e : p.isPlainObject(e) && Object.assign(n, e), !(n != null && n.url)) throw "url is required";
const r = (s) => E.request(n, !1).resp((i) => (console.log("useSubscribeRequest", s), a(i), i));
@ -614,7 +615,7 @@ const Ne = vt.getInstance(), ma = () => {
return x(() => {
e && Ne.exec(e, n, { getFieldValue: p.wrap(t.getFieldValue, (c, m) => (i.current.some((h) => p.isEqual(h, m)) || (i.current.push(m), r()), c(m))), isFieldTouched: t.isFieldTouched, isFieldsTouched: t.isFieldsTouched }).then((c) => s.current && l(c));
}, [e, u, t, n]), x(() => () => s.current = !1, []), o;
}, rr = ({ value: e, onChange: t }, a = null) => {
}, sr = ({ value: e, onChange: t }, a = null) => {
const n = Y(), [r] = ee.useForm(a);
return Ft(() => {
p.isEqual(n.current, e) || r.setFieldsValue(e);
@ -879,14 +880,14 @@ const X = $t.getInstance(), xn = C.createContext({ user: {}, initUser: () => {
return {};
};
export {
Kn as $,
tr as A,
_n as $,
ar as A,
Ze as B,
Ft as C,
wt as D,
ar as E,
nr as F,
Qn as G,
nr as E,
rr as F,
Zn as G,
Qa as H,
mn as I,
Rt as J,
@ -896,7 +897,7 @@ export {
cn as N,
dn as O,
un as P,
rr as Q,
sr as Q,
sa as R,
Pt as S,
S as T,
@ -908,8 +909,8 @@ export {
J as Z,
G as _,
ia as a,
_n as a0,
Gn as a1,
Gn as a0,
Yn as a1,
X as a2,
Ot as a3,
Tn as a4,
@ -923,7 +924,7 @@ export {
Rn as ac,
da as b,
pa as c,
Zn as d,
er as d,
ga as e,
_a as f,
ta as g,
@ -941,9 +942,9 @@ export {
qa as s,
Z as t,
ua as u,
Yn as v,
Xn as w,
Xn as v,
Qn as w,
Ct as x,
ma as y,
er as z
tr as z
};

1483
dist/common/vender-DMK1apIA.js vendored Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

2
dist/components.js vendored
View File

@ -1,4 +1,4 @@
import { $ as s, S as p, a0 as n, a1 as t, _ as d } from "./common/main-GwmFPdzM.js";
import { $ as s, S as p, a0 as n, a1 as t, _ as d } from "./common/main-BSuXB8tt.js";
export {
s as Empty,
p as Icon,

2
dist/container.js vendored
View File

@ -1,4 +1,4 @@
import { X as o, $ as s, a0 as p, a1 as t, Y as d, _ as n, Z as r, W as u } from "./common/main-GwmFPdzM.js";
import { X as o, $ as s, a0 as p, a1 as t, Y as d, _ as n, Z as r, W as u } from "./common/main-BSuXB8tt.js";
export {
o as Context,
s as Empty,

View File

@ -1,6 +1,6 @@
import "lodash";
import "react";
import { D as p } from "./common/main-GwmFPdzM.js";
import { D as p } from "./common/main-BSuXB8tt.js";
export {
p as default
};

2
dist/data-list.js vendored
View File

@ -1,4 +1,4 @@
import { o as t, m as e, h as r, k as o, p as i, l as D, j as u, n as l, i as L, q as n, f as m, s as p, w as C, x as F, v as b } from "./common/main-GwmFPdzM.js";
import { o as t, m as e, h as r, k as o, p as i, l as D, j as u, n as l, i as L, q as n, f as m, s as p, w as C, x as F, v as b } from "./common/main-BSuXB8tt.js";
export {
t as DataListContent,
e as DataListContext,

View File

@ -1,5 +1,5 @@
import "lodash";
import { b as a } from "../common/main-GwmFPdzM.js";
import { b as a } from "../common/main-BSuXB8tt.js";
export {
a as getDefaultExpandRowKeys
};

View File

@ -1,4 +1,4 @@
import { J as s, L as r, K as u, I as o, P as t, O as d, Q as m, N as F, M as i } from "./common/main-GwmFPdzM.js";
import { J as s, L as r, K as u, I as o, P as t, O as d, Q as m, N as F, M as i } from "./common/main-BSuXB8tt.js";
export {
s as GridLayoutForm,
r as GridLayoutFormHelper,

View File

@ -1,5 +1,5 @@
import "lodash";
import { ac as a } from "../common/main-GwmFPdzM.js";
import { ac as a } from "../common/main-BSuXB8tt.js";
export {
a as getOptionItemByValue
};

2
dist/grid-layout.js vendored
View File

@ -1,4 +1,4 @@
import { c as d, d as e, H as u, G as i, u as t, e as o } from "./common/main-GwmFPdzM.js";
import { c as d, d as e, H as u, G as i, u as t, e as o } from "./common/main-BSuXB8tt.js";
export {
d as GridLayout,
e as GridLayoutWidget,

View File

@ -1,4 +1,4 @@
import { a as t } from "../common/main-GwmFPdzM.js";
import { a as t } from "../common/main-BSuXB8tt.js";
export {
t as getBoxStyle
};

10
dist/hooks.js vendored
View File

@ -1,15 +1,15 @@
import "lodash";
import "rc-field-form";
import "react";
import { C as r, B as o, E as p, z as i, A as f, F as m, y as c } from "./common/main-GwmFPdzM.js";
import { _ as b } from "./common/vender-egxe712p.js";
import { C as r, B as o, E as p, z as f, A as i, F as m, y as c } from "./common/main-BSuXB8tt.js";
import { default as E } from "rc-util/lib/hooks/useMergedState";
export {
r as useDeepEffect,
o as useDeepEqualEffect,
b as useMergedState,
E as useMergedState,
p as useOptions,
i as usePrevious,
f as useStateWithCallback,
f as usePrevious,
i as useStateWithCallback,
m as useSubscribeRequest,
c as useUpdate
};

2
dist/iconfont.js vendored
View File

@ -2,7 +2,7 @@ import "react/jsx-runtime";
import "react";
import "prop-types";
import "classnames";
import { S as a } from "./common/main-GwmFPdzM.js";
import { S as a } from "./common/main-BSuXB8tt.js";
export {
a as default
};

2
dist/index.js vendored
View File

@ -1,4 +1,4 @@
import { aa as t, ab as e, a6 as o, a7 as n, a2 as p, a8 as r, a5 as c, a4 as f, a3 as l, a9 as u } from "./common/main-GwmFPdzM.js";
import { aa as t, ab as e, a6 as o, a7 as n, a2 as p, a8 as r, a5 as c, a4 as f, a3 as l, a9 as u } from "./common/main-BSuXB8tt.js";
export {
t as AppContext,
e as AppGlobalParamsContext,

2
dist/res-ws.js vendored
View File

@ -1,5 +1,5 @@
import "lodash";
import { R as a } from "./common/main-GwmFPdzM.js";
import { R as a } from "./common/main-BSuXB8tt.js";
export {
a as default
};

2
dist/utils.js vendored
View File

@ -1,5 +1,5 @@
import "lodash";
import { g as a, r as i, t as o } from "./common/main-GwmFPdzM.js";
import { g as a, r as i, t as o } from "./common/main-BSuXB8tt.js";
export {
a as getWidgetPropsData,
i as replaceKeys,

View File

@ -1,7 +1,7 @@
{
"name": "ff",
"private": true,
"version": "0.4.24",
"version": "0.4.25",
"author": "www.fsdpf.com",
"type": "module",
"main": "./dist/index.js",
@ -53,7 +53,8 @@
"react-dom",
"react-is",
"react/jsx-runtime",
"prop-types"
"prop-types",
"rc-util/lib/hooks/useMergedState"
]
}
}