@nocobase/client 1.5.0-beta.13 → 1.5.0-beta.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/es/index.mjs
CHANGED
|
@@ -5811,24 +5811,24 @@ const HEADERS_DATA_SOURCE_KEY = "x-data-source", isTitleField = (e, t) => {
|
|
|
5811
5811
|
const D = {
|
|
5812
5812
|
type: "duplicate",
|
|
5813
5813
|
tag: c((z = T.uiSchema) == null ? void 0 : z.title) || T.name
|
|
5814
|
-
},
|
|
5814
|
+
}, $ = P(x({}, D), {
|
|
5815
5815
|
role: "button",
|
|
5816
5816
|
title: React.createElement(TreeNode, P(x({}, D), { displayType: t })),
|
|
5817
5817
|
key: R ? `${R}.${T.name}` : T.name,
|
|
5818
5818
|
isLeaf: !0,
|
|
5819
5819
|
field: T
|
|
5820
5820
|
});
|
|
5821
|
-
return ["belongsTo", "belongsToMany"].includes(T.type) ? (D.type = "reference",
|
|
5821
|
+
return ["belongsTo", "belongsToMany"].includes(T.type) ? (D.type = "reference", $.type = "reference", $.title = React.createElement(TreeNode, P(x({}, D), { type: "reference", displayType: t })), $.isLeaf = !1, $.children = m(T.target, {
|
|
5822
5822
|
depth: F + 1,
|
|
5823
5823
|
maxDepth: A,
|
|
5824
|
-
prefix:
|
|
5824
|
+
prefix: $.key,
|
|
5825
5825
|
exclude: systemKeys
|
|
5826
|
-
})) : ["hasOne", "hasMany"].includes(T.type) && (
|
|
5826
|
+
})) : ["hasOne", "hasMany"].includes(T.type) && ($.isLeaf = !1, $.children = p(T.target, {
|
|
5827
5827
|
depth: F + 1,
|
|
5828
5828
|
maxDepth: A,
|
|
5829
|
-
prefix:
|
|
5829
|
+
prefix: $.key,
|
|
5830
5830
|
exclude: ["id", ...systemKeys]
|
|
5831
|
-
})),
|
|
5831
|
+
})), $;
|
|
5832
5832
|
}).filter(Boolean), m = (y, { prefix: v, maxDepth: F, depth: A = 0, exclude: R = [] }) => A > F ? [] : o(y).map((T) => {
|
|
5833
5833
|
var z;
|
|
5834
5834
|
if (!T.target || !T.interface || R.includes(T.name))
|
|
@@ -5836,15 +5836,15 @@ const HEADERS_DATA_SOURCE_KEY = "x-data-source", isTitleField = (e, t) => {
|
|
|
5836
5836
|
const D = {
|
|
5837
5837
|
type: "preloading",
|
|
5838
5838
|
tag: c((z = T.uiSchema) == null ? void 0 : z.title) || T.name
|
|
5839
|
-
},
|
|
5839
|
+
}, $ = v ? `${v}.${T.name}` : T.name;
|
|
5840
5840
|
return {
|
|
5841
5841
|
role: "button",
|
|
5842
5842
|
title: React.createElement(TreeNode, P(x({}, D), { displayType: t })),
|
|
5843
|
-
key:
|
|
5843
|
+
key: $,
|
|
5844
5844
|
isLeaf: !1,
|
|
5845
5845
|
field: T,
|
|
5846
5846
|
children: m(T.target, {
|
|
5847
|
-
prefix:
|
|
5847
|
+
prefix: $,
|
|
5848
5848
|
depth: A + 1,
|
|
5849
5849
|
maxDepth: F,
|
|
5850
5850
|
exclude: R
|
|
@@ -5863,8 +5863,8 @@ const HEADERS_DATA_SOURCE_KEY = "x-data-source", isTitleField = (e, t) => {
|
|
|
5863
5863
|
return h(F || R.treeData);
|
|
5864
5864
|
try {
|
|
5865
5865
|
return p(y, { exclude: ["id", ...systemKeys], maxDepth: 1 });
|
|
5866
|
-
} catch (
|
|
5867
|
-
return console.error(
|
|
5866
|
+
} catch ($) {
|
|
5867
|
+
return console.error($), [];
|
|
5868
5868
|
}
|
|
5869
5869
|
}, []), f = useCallback((y) => (v) => new Promise((F) => {
|
|
5870
5870
|
if (v.children.length)
|
|
@@ -5882,17 +5882,17 @@ const HEADERS_DATA_SOURCE_KEY = "x-data-source", isTitleField = (e, t) => {
|
|
|
5882
5882
|
getOnCheck: C,
|
|
5883
5883
|
getScopeDataSource: (y) => {
|
|
5884
5884
|
const v = o(y), F = (T, D) => {
|
|
5885
|
-
var M,
|
|
5885
|
+
var M, N;
|
|
5886
5886
|
if (!T.interface)
|
|
5887
5887
|
return;
|
|
5888
|
-
const
|
|
5889
|
-
if (!(
|
|
5888
|
+
const $ = a(T.interface);
|
|
5889
|
+
if (!($ != null && $.filterable))
|
|
5890
5890
|
return;
|
|
5891
|
-
const { nested: z, children: L, operators:
|
|
5891
|
+
const { nested: z, children: L, operators: B } = $.filterable, w = {
|
|
5892
5892
|
name: T.name,
|
|
5893
5893
|
title: ((M = T == null ? void 0 : T.uiSchema) == null ? void 0 : M.title) || T.name,
|
|
5894
5894
|
schema: T == null ? void 0 : T.uiSchema,
|
|
5895
|
-
operators: ((
|
|
5895
|
+
operators: ((N = B == null ? void 0 : B.filter) == null ? void 0 : N.call(B, (k) => !(k != null && k.visible) || k.visible(T))) || [],
|
|
5896
5896
|
interface: T.interface
|
|
5897
5897
|
};
|
|
5898
5898
|
if (!(T.target && D > 2)) {
|
|
@@ -5905,11 +5905,11 @@ const HEADERS_DATA_SOURCE_KEY = "x-data-source", isTitleField = (e, t) => {
|
|
|
5905
5905
|
return w;
|
|
5906
5906
|
}
|
|
5907
5907
|
}, A = (T, D) => {
|
|
5908
|
-
const
|
|
5908
|
+
const $ = [];
|
|
5909
5909
|
return T.forEach((z) => {
|
|
5910
5910
|
const L = F(z, D);
|
|
5911
|
-
L &&
|
|
5912
|
-
}),
|
|
5911
|
+
L && $.push(L);
|
|
5912
|
+
}), $;
|
|
5913
5913
|
};
|
|
5914
5914
|
return A(v, 1);
|
|
5915
5915
|
},
|
|
@@ -8996,15 +8996,15 @@ function withInitializer(e) {
|
|
|
8996
8996
|
S ? S(y(M, { isInSubTable: i })) : r(d, y(M, { isInSubTable: i }), { onSuccess: p });
|
|
8997
8997
|
},
|
|
8998
8998
|
[S, y, i, r, d, p]
|
|
8999
|
-
), { wrapSSR: F, hashId: A, componentCls: R } = useSchemaInitializerStyles(), [T, D] = useState(!1), { token:
|
|
8999
|
+
), { wrapSSR: F, hashId: A, componentCls: R } = useSchemaInitializerStyles(), [T, D] = useState(!1), { token: $ } = theme$1.useToken(), z = useNiceDropdownMaxHeight([T]), L = useMemo(
|
|
9000
9000
|
() => x({
|
|
9001
9001
|
options: n,
|
|
9002
9002
|
style: C
|
|
9003
9003
|
}, b),
|
|
9004
9004
|
[b, n, C]
|
|
9005
|
-
),
|
|
9005
|
+
), B = useMemo(() => css`
|
|
9006
9006
|
.ant-popover-inner {
|
|
9007
|
-
padding: ${`${
|
|
9007
|
+
padding: ${`${$.paddingXXS}px 0`};
|
|
9008
9008
|
.ant-menu-submenu-title {
|
|
9009
9009
|
margin-block: 0;
|
|
9010
9010
|
}
|
|
@@ -9012,7 +9012,7 @@ function withInitializer(e) {
|
|
|
9012
9012
|
padding: 0;
|
|
9013
9013
|
}
|
|
9014
9014
|
}
|
|
9015
|
-
`, [
|
|
9015
|
+
`, [$.paddingXXS]), w = useMemo(
|
|
9016
9016
|
() => ({
|
|
9017
9017
|
maxHeight: z,
|
|
9018
9018
|
overflowY: "auto"
|
|
@@ -9034,7 +9034,7 @@ function withInitializer(e) {
|
|
|
9034
9034
|
placement: "bottomLeft"
|
|
9035
9035
|
}, h), {
|
|
9036
9036
|
arrow: !1,
|
|
9037
|
-
overlayClassName:
|
|
9037
|
+
overlayClassName: B,
|
|
9038
9038
|
open: T,
|
|
9039
9039
|
onOpenChange: D,
|
|
9040
9040
|
content: F(
|
|
@@ -9044,10 +9044,10 @@ function withInitializer(e) {
|
|
|
9044
9044
|
theme: {
|
|
9045
9045
|
components: {
|
|
9046
9046
|
Menu: {
|
|
9047
|
-
itemHeight:
|
|
9048
|
-
borderRadius:
|
|
9049
|
-
itemBorderRadius:
|
|
9050
|
-
subMenuItemBorderRadius:
|
|
9047
|
+
itemHeight: $.marginXL,
|
|
9048
|
+
borderRadius: $.borderRadiusSM,
|
|
9049
|
+
itemBorderRadius: $.borderRadiusSM,
|
|
9050
|
+
subMenuItemBorderRadius: $.borderRadiusSM
|
|
9051
9051
|
}
|
|
9052
9052
|
}
|
|
9053
9053
|
},
|
|
@@ -10086,11 +10086,11 @@ const TableCellRender = ({ record: e, columnSchema: t, uiSchema: n, filterProper
|
|
|
10086
10086
|
}
|
|
10087
10087
|
`, [n.paddingContentVerticalLG, n.marginSM, n.margin]), b = useCollection(), S = useMemo(
|
|
10088
10088
|
() => u == null ? void 0 : u.map((v) => {
|
|
10089
|
-
var z, L,
|
|
10089
|
+
var z, L, B;
|
|
10090
10090
|
const F = v.reduceProperties((w, M) => {
|
|
10091
10091
|
if (isCollectionFieldComponent(M))
|
|
10092
10092
|
return w.concat([M]);
|
|
10093
|
-
}, []), A = (F == null ? void 0 : F.length) > 0 ? F[0].name : v.name, R = !!((z = v["x-component-props"]) != null && z.columnHidden), { uiSchema: T, defaultValue: D, interface:
|
|
10093
|
+
}, []), A = (F == null ? void 0 : F.length) > 0 ? F[0].name : v.name, R = !!((z = v["x-component-props"]) != null && z.columnHidden), { uiSchema: T, defaultValue: D, interface: $ } = (b == null ? void 0 : b.getField(A)) || {};
|
|
10094
10094
|
return T && (T.default = D), P(x({
|
|
10095
10095
|
title: /* @__PURE__ */ jsx(RefreshComponentProvider, { refresh: h, children: /* @__PURE__ */ jsx(
|
|
10096
10096
|
NocoBaseRecursionField,
|
|
@@ -10106,11 +10106,11 @@ const TableCellRender = ({ record: e, columnSchema: t, uiSchema: n, filterProper
|
|
|
10106
10106
|
sorter: (L = v["x-component-props"]) == null ? void 0 : L.sorter,
|
|
10107
10107
|
columnHidden: R
|
|
10108
10108
|
}, v["x-component-props"]), {
|
|
10109
|
-
width: R && !a ? 0 : ((
|
|
10110
|
-
render: (w, M,
|
|
10109
|
+
width: R && !a ? 0 : ((B = v["x-component-props"]) == null ? void 0 : B.width) || 100,
|
|
10110
|
+
render: (w, M, N) => {
|
|
10111
10111
|
var j, O;
|
|
10112
10112
|
const { enableLink: k } = Object.values(v.properties)[0]["x-component-props"] || {};
|
|
10113
|
-
return !k && ["sequence", "input", "textarea", "phone", "email"].includes(
|
|
10113
|
+
return !k && ["sequence", "input", "textarea", "phone", "email"].includes($) ? /* @__PURE__ */ jsx(
|
|
10114
10114
|
RenderTextInCell,
|
|
10115
10115
|
{
|
|
10116
10116
|
value: g(w || _.get(M, Object.keys(v.properties)[0])),
|
|
@@ -10125,7 +10125,7 @@ const TableCellRender = ({ record: e, columnSchema: t, uiSchema: n, filterProper
|
|
|
10125
10125
|
filterProperties: f,
|
|
10126
10126
|
schemaToolbarBigger: C,
|
|
10127
10127
|
field: o,
|
|
10128
|
-
index:
|
|
10128
|
+
index: N
|
|
10129
10129
|
}
|
|
10130
10130
|
) });
|
|
10131
10131
|
},
|
|
@@ -10246,7 +10246,7 @@ const TableCellRender = ({ record: e, columnSchema: t, uiSchema: n, filterProper
|
|
|
10246
10246
|
display: none !important;
|
|
10247
10247
|
}
|
|
10248
10248
|
`,
|
|
10249
|
-
itemRender: (D,
|
|
10249
|
+
itemRender: (D, $, z) => $ === "prev" ? /* @__PURE__ */ jsxs(
|
|
10250
10250
|
"div",
|
|
10251
10251
|
{
|
|
10252
10252
|
style: { display: "flex" },
|
|
@@ -10492,8 +10492,8 @@ const Table$2 = withDynamicSchemaProps(
|
|
|
10492
10492
|
"loading",
|
|
10493
10493
|
"onClickRow",
|
|
10494
10494
|
"value"
|
|
10495
|
-
]), y = useArrayField$1(S), v = useFieldSchema(), { size: F = "small" } = (v == null ? void 0 : v["x-component-props"]) || {}, A = useCollection(), T = ((ce = v == null ? void 0 : v.parent) == null ? void 0 : ce["x-decorator"]) === "TableSelectorProvider" ? useTableSelectorContext() : useTableBlockContext(), { expandFlag: D, allIncludesChildren:
|
|
10496
|
-
})), L = usePaginationProps$3(n, i, e),
|
|
10495
|
+
]), y = useArrayField$1(S), v = useFieldSchema(), { size: F = "small" } = (v == null ? void 0 : v["x-component-props"]) || {}, A = useCollection(), T = ((ce = v == null ? void 0 : v.parent) == null ? void 0 : ce["x-decorator"]) === "TableSelectorProvider" ? useTableSelectorContext() : useTableBlockContext(), { expandFlag: D, allIncludesChildren: $ } = T, z = useMemoizedFn(S.onRowDragEnd || (() => {
|
|
10496
|
+
})), L = usePaginationProps$3(n, i, e), B = useTableColumns$2(S, L), [w, M] = useState(() => D ? $ : []), [N, k] = useState(((Ce = y == null ? void 0 : y.data) == null ? void 0 : Ce.selectedRowKeys) || []), [j, O] = useState([]), q = (p == null ? void 0 : p.type) !== "none", E = useRef(/* @__PURE__ */ new Map()), U = useMemo(() => css`
|
|
10497
10497
|
& > td {
|
|
10498
10498
|
background-color: ${t.controlItemBgActive} !important;
|
|
10499
10499
|
}
|
|
@@ -10511,9 +10511,9 @@ const Table$2 = withDynamicSchemaProps(
|
|
|
10511
10511
|
record: re
|
|
10512
10512
|
}), [C, j]);
|
|
10513
10513
|
useDeepCompareEffect(() => {
|
|
10514
|
-
const re = D ?
|
|
10514
|
+
const re = D ? $ : [];
|
|
10515
10515
|
_.isEqual(re, w) || M(re);
|
|
10516
|
-
}, [D,
|
|
10516
|
+
}, [D, $]);
|
|
10517
10517
|
const W = useCallback((re) => {
|
|
10518
10518
|
if (m)
|
|
10519
10519
|
return X(re);
|
|
@@ -10559,7 +10559,7 @@ const Table$2 = withDynamicSchemaProps(
|
|
|
10559
10559
|
() => ({
|
|
10560
10560
|
rowSelection: ee ? x({
|
|
10561
10561
|
type: "checkbox",
|
|
10562
|
-
selectedRowKeys:
|
|
10562
|
+
selectedRowKeys: N,
|
|
10563
10563
|
onChange(re, Z) {
|
|
10564
10564
|
y.data = y.data || {}, y.data.selectedRowKeys = re, y.data.selectedRowData = Z, k(re), u == null || u(re, Z);
|
|
10565
10565
|
},
|
|
@@ -10604,7 +10604,7 @@ const Table$2 = withDynamicSchemaProps(
|
|
|
10604
10604
|
}),
|
|
10605
10605
|
[
|
|
10606
10606
|
ee,
|
|
10607
|
-
|
|
10607
|
+
N,
|
|
10608
10608
|
u,
|
|
10609
10609
|
c,
|
|
10610
10610
|
l,
|
|
@@ -10661,7 +10661,7 @@ const Table$2 = withDynamicSchemaProps(
|
|
|
10661
10661
|
onRow: H,
|
|
10662
10662
|
rowClassName: xe,
|
|
10663
10663
|
scroll: ue,
|
|
10664
|
-
columns:
|
|
10664
|
+
columns: B,
|
|
10665
10665
|
expandable: fe,
|
|
10666
10666
|
field: y,
|
|
10667
10667
|
size: F
|
|
@@ -10874,12 +10874,12 @@ const popupsContextStorage = {}, getStoredPopupContext = (e) => popupsContextSto
|
|
|
10874
10874
|
({
|
|
10875
10875
|
tabKey: w,
|
|
10876
10876
|
popupUid: M,
|
|
10877
|
-
recordData:
|
|
10877
|
+
recordData: N,
|
|
10878
10878
|
sourceId: k,
|
|
10879
10879
|
collection: j,
|
|
10880
10880
|
puid: O
|
|
10881
10881
|
}) => {
|
|
10882
|
-
const q = c.getFilterByTK(u || l,
|
|
10882
|
+
const q = c.getFilterByTK(u || l, N);
|
|
10883
10883
|
return getPopupPathFromParams({
|
|
10884
10884
|
popupuid: M,
|
|
10885
10885
|
puid: O,
|
|
@@ -10901,7 +10901,7 @@ const popupsContextStorage = {}, getStoredPopupContext = (e) => popupsContextSto
|
|
|
10901
10901
|
({
|
|
10902
10902
|
recordData: w,
|
|
10903
10903
|
parentRecordData: M,
|
|
10904
|
-
collectionNameUsedInURL:
|
|
10904
|
+
collectionNameUsedInURL: N,
|
|
10905
10905
|
popupUidUsedInURL: k,
|
|
10906
10906
|
customActionSchema: j
|
|
10907
10907
|
} = {}) => {
|
|
@@ -10913,7 +10913,7 @@ const popupsContextStorage = {}, getStoredPopupContext = (e) => popupsContextSto
|
|
|
10913
10913
|
popupUid: q,
|
|
10914
10914
|
recordData: w,
|
|
10915
10915
|
sourceId: E,
|
|
10916
|
-
collection:
|
|
10916
|
+
collection: N,
|
|
10917
10917
|
puid: k
|
|
10918
10918
|
});
|
|
10919
10919
|
let G = n.pathname;
|
|
@@ -10957,27 +10957,27 @@ ${JSON.stringify(O, null, 2)}`
|
|
|
10957
10957
|
F,
|
|
10958
10958
|
h
|
|
10959
10959
|
]
|
|
10960
|
-
),
|
|
10960
|
+
), $ = useCallback(() => {
|
|
10961
10961
|
if (!f())
|
|
10962
10962
|
return A == null ? void 0 : A(!1);
|
|
10963
10963
|
t(withSearchParams(removeLastPopupPath(n.pathname)), { replace: !0 }), removePopupLayerState(h);
|
|
10964
10964
|
}, [f, A, t, n == null ? void 0 : n.pathname, h]), z = useCallback(
|
|
10965
10965
|
(w) => {
|
|
10966
|
-
const M = y(),
|
|
10966
|
+
const M = y(), N = R({
|
|
10967
10967
|
tabKey: w,
|
|
10968
10968
|
popupUid: m == null ? void 0 : m.popupuid,
|
|
10969
10969
|
recordData: i == null ? void 0 : i.data,
|
|
10970
10970
|
sourceId: M
|
|
10971
10971
|
});
|
|
10972
10972
|
let k = removeLastPopupPath(n.pathname);
|
|
10973
|
-
_.last(k) === "/" && (k = k.slice(0, -1)), t(`${k}${
|
|
10973
|
+
_.last(k) === "/" && (k = k.slice(0, -1)), t(`${k}${N}`, {
|
|
10974
10974
|
replace: !0
|
|
10975
10975
|
});
|
|
10976
10976
|
},
|
|
10977
10977
|
[R, t, m == null ? void 0 : m.popupuid, i == null ? void 0 : i.data, n]
|
|
10978
10978
|
), L = useCallback((w, M) => {
|
|
10979
10979
|
M.__popup = w;
|
|
10980
|
-
}, []),
|
|
10980
|
+
}, []), B = useCallback((w) => w.__popup, []);
|
|
10981
10981
|
return {
|
|
10982
10982
|
/**
|
|
10983
10983
|
* used to open popup by changing the url
|
|
@@ -10986,9 +10986,9 @@ ${JSON.stringify(O, null, 2)}`
|
|
|
10986
10986
|
/**
|
|
10987
10987
|
* used to close popup by changing the url
|
|
10988
10988
|
*/
|
|
10989
|
-
closePopup:
|
|
10989
|
+
closePopup: $,
|
|
10990
10990
|
savePopupSchemaToSchema: L,
|
|
10991
|
-
getPopupSchemaFromSchema:
|
|
10991
|
+
getPopupSchemaFromSchema: B,
|
|
10992
10992
|
context: S,
|
|
10993
10993
|
/**
|
|
10994
10994
|
* @deprecated
|
|
@@ -12034,24 +12034,24 @@ const breakRemoveOnGrid = (e) => e["x-component"] === "Grid", breakRemoveOnRow =
|
|
|
12034
12034
|
if (!r || !S)
|
|
12035
12035
|
return;
|
|
12036
12036
|
n.current = T.active.id;
|
|
12037
|
-
const D = l.current,
|
|
12038
|
-
v([
|
|
12037
|
+
const D = l.current, $ = D.previousElementSibling, z = D.nextElementSibling;
|
|
12038
|
+
v([$.clientWidth, z.clientWidth]);
|
|
12039
12039
|
},
|
|
12040
12040
|
onDragMove(T) {
|
|
12041
12041
|
if (!r || !S)
|
|
12042
12042
|
return;
|
|
12043
12043
|
n.current === T.active.id && (n.current = n.current + "_move");
|
|
12044
|
-
const D = l.current,
|
|
12045
|
-
|
|
12044
|
+
const D = l.current, $ = D.previousElementSibling, z = D.nextElementSibling;
|
|
12045
|
+
$.style.width = `${y[0] + T.delta.x}px`, z.style.width = `${y[1] - T.delta.x}px`;
|
|
12046
12046
|
},
|
|
12047
12047
|
onDragEnd(T) {
|
|
12048
12048
|
var M;
|
|
12049
12049
|
if (!r || !n.current || (M = n.current) != null && M.startsWith(T.active.id) && !n.current.endsWith("_move") || y[0] <= 0 || y[1] <= 0 || (v([0, 0]), !h || !g))
|
|
12050
12050
|
return;
|
|
12051
|
-
const D = l.current,
|
|
12051
|
+
const D = l.current, $ = D.previousElementSibling, z = D.nextElementSibling;
|
|
12052
12052
|
h["x-component-props"] = h["x-component-props"] || {}, g["x-component-props"] = g["x-component-props"] || {};
|
|
12053
|
-
const L = D.clientWidth * (e.cols.length + 1) / e.cols.length,
|
|
12054
|
-
_.set(h, "x-component-props.width",
|
|
12053
|
+
const L = D.clientWidth * (e.cols.length + 1) / e.cols.length, B = (100 * ($.getBoundingClientRect().width + L) / D.parentElement.clientWidth).toFixed(2), w = (100 * (z.getBoundingClientRect().width + L) / D.parentElement.clientWidth).toFixed(2);
|
|
12054
|
+
_.set(h, "x-component-props.width", B), _.set(g, "x-component-props.width", w), o.emit("batchPatch", {
|
|
12055
12055
|
schemas: [
|
|
12056
12056
|
{
|
|
12057
12057
|
"x-uid": h["x-uid"],
|
|
@@ -12362,8 +12362,8 @@ const useTableBlockProps = () => {
|
|
|
12362
12362
|
),
|
|
12363
12363
|
onChange: useCallback(
|
|
12364
12364
|
({ current: S, pageSize: y }, v, F) => {
|
|
12365
|
-
var
|
|
12366
|
-
const A = (L = (z = (
|
|
12365
|
+
var $, z, L, B, w, M, N, k, j, O;
|
|
12366
|
+
const A = (L = (z = ($ = t.parent) == null ? void 0 : $["x-decorator-props"]) == null ? void 0 : z.params) == null ? void 0 : L.sort, R = F.order ? F.order === "ascend" ? [F.field] : [`-${F.field}`] : A || i.dragSortBy, T = y || ((M = (w = (B = t.parent) == null ? void 0 : B["x-decorator-props"]) == null ? void 0 : w.params) == null ? void 0 : M.pageSize), D = P(x({}, (j = (k = (N = a.current) == null ? void 0 : N.service) == null ? void 0 : k.params) == null ? void 0 : j[0]), { page: S || 1, pageSize: T });
|
|
12367
12367
|
R && (D.sort = R), (O = a.current) == null || O.service.run(D);
|
|
12368
12368
|
},
|
|
12369
12369
|
[t.parent]
|
|
@@ -12371,17 +12371,17 @@ const useTableBlockProps = () => {
|
|
|
12371
12371
|
onClickRow: useCallback(
|
|
12372
12372
|
(S, y, v) => {
|
|
12373
12373
|
const { targets: F, uid: A } = findFilterTargets(t), R = r();
|
|
12374
|
-
if (!F || !F.some((D) => R.some((
|
|
12374
|
+
if (!F || !F.some((D) => R.some(($) => $.uid === D.uid))) {
|
|
12375
12375
|
y((D) => D.length ? [] : D);
|
|
12376
12376
|
return;
|
|
12377
12377
|
}
|
|
12378
12378
|
const T = R.find((D) => D.uid === t.parent["x-uid"]);
|
|
12379
12379
|
R.forEach((D) => {
|
|
12380
|
-
var
|
|
12381
|
-
const
|
|
12382
|
-
if (
|
|
12380
|
+
var N, k, j;
|
|
12381
|
+
const $ = F.find((O) => O.uid === D.uid);
|
|
12382
|
+
if (!$)
|
|
12383
12383
|
return;
|
|
12384
|
-
const z = getSourceKey(T,
|
|
12384
|
+
const z = getSourceKey(T, $.field) || i.rowKey || "id", L = [S[z]], B = ((N = D.service.params) == null ? void 0 : N[0]) || {}, w = ((j = (k = D.service.params) == null ? void 0 : k[1]) == null ? void 0 : j.filters) || {};
|
|
12385
12385
|
if (v.includes(S[i.rowKey])) {
|
|
12386
12386
|
if (D.dataLoadingMode === "manual")
|
|
12387
12387
|
return D.clearData();
|
|
@@ -12390,8 +12390,8 @@ const useTableBlockProps = () => {
|
|
|
12390
12390
|
w[A] = {
|
|
12391
12391
|
$and: [
|
|
12392
12392
|
{
|
|
12393
|
-
[
|
|
12394
|
-
[
|
|
12393
|
+
[$.field || i.rowKey]: {
|
|
12394
|
+
[$.field ? "$in" : "$eq"]: L
|
|
12395
12395
|
}
|
|
12396
12396
|
}
|
|
12397
12397
|
]
|
|
@@ -12401,7 +12401,7 @@ const useTableBlockProps = () => {
|
|
|
12401
12401
|
D.defaultFilter
|
|
12402
12402
|
]);
|
|
12403
12403
|
return D.doFilter(
|
|
12404
|
-
P(x({},
|
|
12404
|
+
P(x({}, B), {
|
|
12405
12405
|
page: 1,
|
|
12406
12406
|
filter: M
|
|
12407
12407
|
}),
|
|
@@ -12768,10 +12768,10 @@ const useTableSelectorParams = () => useContext(TableSelectorParamsContext), Tab
|
|
|
12768
12768
|
var a, l, c, u, d, p, m, h, g, f, C, b, S, y, v, F;
|
|
12769
12769
|
const e = useField(), t = useTableSelectorContext(), n = useFieldSchema(), { getCollectionJoinField: o } = useCollectionManager_deprecated(), r = recursiveParent$1(n, "CollectionField"), i = o(r == null ? void 0 : r["x-collection-field"]);
|
|
12770
12770
|
return useEffect(() => {
|
|
12771
|
-
var R, T, D,
|
|
12771
|
+
var R, T, D, $, z, L, B, w, M, N, k, j, O;
|
|
12772
12772
|
if (!((R = t == null ? void 0 : t.service) != null && R.loading)) {
|
|
12773
12773
|
const q = (D = (T = t == null ? void 0 : t.service) == null ? void 0 : T.data) == null ? void 0 : D.data.map((E) => E);
|
|
12774
|
-
e.value = q, (
|
|
12774
|
+
e.value = q, ($ = e == null ? void 0 : e.setInitialValue) == null || $.call(e, q), e.data = e.data || {}, e.data.selectedRowKeys = [], e.componentProps.pagination = e.componentProps.pagination || {}, e.componentProps.pagination.pageSize = (B = (L = (z = t == null ? void 0 : t.service) == null ? void 0 : z.data) == null ? void 0 : L.meta) == null ? void 0 : B.pageSize, e.componentProps.pagination.total = (N = (M = (w = t == null ? void 0 : t.service) == null ? void 0 : w.data) == null ? void 0 : M.meta) == null ? void 0 : N.count, e.componentProps.pagination.current = (O = (j = (k = t == null ? void 0 : t.service) == null ? void 0 : k.data) == null ? void 0 : j.meta) == null ? void 0 : O.page;
|
|
12775
12775
|
}
|
|
12776
12776
|
}, [
|
|
12777
12777
|
i == null ? void 0 : i.foreignKey,
|
|
@@ -13542,8 +13542,8 @@ const useFormItemInitializerFields = (e) => {
|
|
|
13542
13542
|
Component: "CollectionFieldInitializer",
|
|
13543
13543
|
remove: removeGridFormItem,
|
|
13544
13544
|
schemaInitialize: (D) => {
|
|
13545
|
-
var
|
|
13546
|
-
(
|
|
13545
|
+
var $;
|
|
13546
|
+
($ = h == null ? void 0 : h.schemaInitialize) == null || $.call(h, D, {
|
|
13547
13547
|
field: m,
|
|
13548
13548
|
block: l,
|
|
13549
13549
|
readPretty: a,
|
|
@@ -13553,9 +13553,9 @@ const useFormItemInitializerFields = (e) => {
|
|
|
13553
13553
|
},
|
|
13554
13554
|
schema: S
|
|
13555
13555
|
};
|
|
13556
|
-
return l == "Kanban" && (y.find = (D,
|
|
13556
|
+
return l == "Kanban" && (y.find = (D, $, z) => {
|
|
13557
13557
|
const L = findSchema(D, "x-component", l);
|
|
13558
|
-
return findSchema(L,
|
|
13558
|
+
return findSchema(L, $, z);
|
|
13559
13559
|
}), y;
|
|
13560
13560
|
});
|
|
13561
13561
|
}, useFilterFormItemInitializerFields = (e) => {
|
|
@@ -13918,8 +13918,8 @@ const useFormItemInitializerFields = (e) => {
|
|
|
13918
13918
|
t: h,
|
|
13919
13919
|
componentNamePrefix: m
|
|
13920
13920
|
}).sort((D) => {
|
|
13921
|
-
const
|
|
13922
|
-
if (D.name === (C == null ? void 0 : C.name) ||
|
|
13921
|
+
const $ = _.toArray((C == null ? void 0 : C.inherits) || []);
|
|
13922
|
+
if (D.name === (C == null ? void 0 : C.name) || $.some((z) => z === D.name))
|
|
13923
13923
|
return -1;
|
|
13924
13924
|
})
|
|
13925
13925
|
]
|
|
@@ -13981,33 +13981,33 @@ const useFormItemInitializerFields = (e) => {
|
|
|
13981
13981
|
hideChildrenIfSingleCollection: !1,
|
|
13982
13982
|
fromOthersInPopup: !0,
|
|
13983
13983
|
componentType: T[t] || t,
|
|
13984
|
-
filter({ collection:
|
|
13985
|
-
return u ? u(
|
|
13984
|
+
filter({ collection: B, associationField: w }) {
|
|
13985
|
+
return u ? u(B) : !0;
|
|
13986
13986
|
},
|
|
13987
|
-
onClick(
|
|
13988
|
-
c(P(x({},
|
|
13987
|
+
onClick(B) {
|
|
13988
|
+
c(P(x({}, B), { fromOthersInPopup: !0 }));
|
|
13989
13989
|
}
|
|
13990
13990
|
})
|
|
13991
13991
|
};
|
|
13992
|
-
let
|
|
13992
|
+
let $;
|
|
13993
13993
|
const z = b.length ? R : null;
|
|
13994
13994
|
if (F[0].children.length && b.length)
|
|
13995
|
-
l ?
|
|
13995
|
+
l ? $ = [A, z] : $ = [A, z, D];
|
|
13996
13996
|
else if (F[0].children.length)
|
|
13997
13997
|
if (l) {
|
|
13998
13998
|
if (F[0].children.length <= 1)
|
|
13999
13999
|
return F[0].children = ((L = F[0].children[0]) == null ? void 0 : L.children) || [], F;
|
|
14000
|
-
|
|
14000
|
+
$ = [A];
|
|
14001
14001
|
} else
|
|
14002
|
-
|
|
14002
|
+
$ = [A, D];
|
|
14003
14003
|
else
|
|
14004
|
-
l ?
|
|
14004
|
+
l ? $ = [z] : $ = [z, D];
|
|
14005
14005
|
return [
|
|
14006
14006
|
{
|
|
14007
14007
|
name: "records",
|
|
14008
14008
|
label: h("Records"),
|
|
14009
14009
|
type: "subMenu",
|
|
14010
|
-
children:
|
|
14010
|
+
children: $.filter(Boolean)
|
|
14011
14011
|
}
|
|
14012
14012
|
];
|
|
14013
14013
|
}, [
|
|
@@ -14722,7 +14722,7 @@ const useGetAriaLabelOfDesigner = () => {
|
|
|
14722
14722
|
display: block !important;
|
|
14723
14723
|
}
|
|
14724
14724
|
`, GeneralSchemaDesigner = (e) => {
|
|
14725
|
-
var
|
|
14725
|
+
var $, z;
|
|
14726
14726
|
const t = useFieldSchema(), {
|
|
14727
14727
|
disableInitializer: n,
|
|
14728
14728
|
title: o,
|
|
@@ -14743,16 +14743,16 @@ const useGetAriaLabelOfDesigner = () => {
|
|
|
14743
14743
|
return {
|
|
14744
14744
|
insertPosition: "afterEnd",
|
|
14745
14745
|
wrap: ((L = S == null ? void 0 : S.cols) == null ? void 0 : L.length) > 1 ? void 0 : gridRowColWrap,
|
|
14746
|
-
Component: (
|
|
14746
|
+
Component: (B) => /* @__PURE__ */ jsx(
|
|
14747
14747
|
PlusOutlined,
|
|
14748
|
-
P(x({},
|
|
14748
|
+
P(x({}, B), {
|
|
14749
14749
|
role: "button",
|
|
14750
14750
|
"aria-label": g("schema-initializer"),
|
|
14751
14751
|
style: { cursor: "pointer", fontSize: 14 }
|
|
14752
14752
|
})
|
|
14753
14753
|
)
|
|
14754
14754
|
};
|
|
14755
|
-
}, [g, (
|
|
14755
|
+
}, [g, ($ = S == null ? void 0 : S.cols) == null ? void 0 : $.length]);
|
|
14756
14756
|
return d ? /* @__PURE__ */ jsx(SchemaToolbarProvider, P(x({}, a), { children: /* @__PURE__ */ jsxs("div", { className: cls("general-schema-designer", overrideAntdCSS), children: [
|
|
14757
14757
|
o && /* @__PURE__ */ jsx("div", { className: cls("general-schema-designer-title", titleCss), children: /* @__PURE__ */ jsxs(Space$1, { size: 2, children: [
|
|
14758
14758
|
/* @__PURE__ */ jsx("span", { className: "title-tag", children: c && R ? `${h(R == null ? void 0 : R.displayName)} > ${h(o)}` : h(o) }),
|
|
@@ -14806,13 +14806,13 @@ const useGetAriaLabelOfDesigner = () => {
|
|
|
14806
14806
|
if (Array.isArray(n))
|
|
14807
14807
|
return g(n);
|
|
14808
14808
|
}
|
|
14809
|
-
}, [n]), { render:
|
|
14809
|
+
}, [n]), { render: $, exists: z } = useSchemaSettingsRender(
|
|
14810
14810
|
r || (t == null ? void 0 : t["x-settings"]),
|
|
14811
14811
|
t == null ? void 0 : t["x-settings-props"]
|
|
14812
|
-
), { render: L, exists:
|
|
14812
|
+
), { render: L, exists: B } = useSchemaInitializerRender(
|
|
14813
14813
|
o || (t == null ? void 0 : t["x-initializer"]),
|
|
14814
14814
|
t == null ? void 0 : t["x-initializer-props"]
|
|
14815
|
-
), w = useGridRowContext(), M = useGridContext(),
|
|
14815
|
+
), w = useGridRowContext(), M = useGridContext(), N = useMemo(() => {
|
|
14816
14816
|
var H;
|
|
14817
14817
|
return {
|
|
14818
14818
|
insertPosition: "afterEnd",
|
|
@@ -14830,11 +14830,11 @@ const useGetAriaLabelOfDesigner = () => {
|
|
|
14830
14830
|
var H;
|
|
14831
14831
|
if (o === !1)
|
|
14832
14832
|
return null;
|
|
14833
|
-
if (
|
|
14834
|
-
return L(
|
|
14833
|
+
if (B)
|
|
14834
|
+
return L(N);
|
|
14835
14835
|
if (M != null && M.InitializerComponent || M != null && M.renderSchemaInitializer)
|
|
14836
|
-
return M != null && M.InitializerComponent ? /* @__PURE__ */ jsx(M.InitializerComponent, x({},
|
|
14837
|
-
}, [M, o, B,
|
|
14836
|
+
return M != null && M.InitializerComponent ? /* @__PURE__ */ jsx(M.InitializerComponent, x({}, N)) : (H = M.renderSchemaInitializer) == null ? void 0 : H.call(M, N);
|
|
14837
|
+
}, [M, o, N, B, L]), O = useMemo(() => r !== !1 && z ? $() : null, [z, $, r]), q = useRef(null), E = "hidden";
|
|
14838
14838
|
useEffect(() => {
|
|
14839
14839
|
const H = q.current;
|
|
14840
14840
|
let W = H == null ? void 0 : H.parentElement;
|
|
@@ -16318,21 +16318,21 @@ const ActionLink = withDynamicSchemaProps(
|
|
|
16318
16318
|
"onMouseEnter",
|
|
16319
16319
|
"refreshDataBlockRequest",
|
|
16320
16320
|
"confirmTitle"
|
|
16321
|
-
]), v = useDesigner(), F = useField(), A = useFieldSchema(), R = useCompile(), T = useCollectionRecordData(), D = R((U = A["x-component-props"]) == null ? void 0 : U.confirm) || g,
|
|
16321
|
+
]), v = useDesigner(), F = useField(), A = useFieldSchema(), R = useCompile(), T = useCollectionRecordData(), D = R((U = A["x-component-props"]) == null ? void 0 : U.confirm) || g, $ = useMemo(() => (A == null ? void 0 : A["x-linkage-rules"]) || [], [A == null ? void 0 : A["x-linkage-rules"]]), { designable: z } = useDesignable(), L = useComponent(o) || o, B = useVariables$1(), w = useLocalVariables$1({ currentForm: { values: T, readPretty: !1 } }), { visibleWithURL: M, setVisibleWithURL: N } = usePopupUtils(), { setSubmitted: k } = useActionContext(), { getAriaLabel: j } = useGetAriaLabelOfAction(l), O = useCollectionParentRecordData();
|
|
16322
16322
|
useEffect(() => {
|
|
16323
|
-
F.stateOfLinkageRules && setInitialActionState(F), F.stateOfLinkageRules = {},
|
|
16323
|
+
F.stateOfLinkageRules && setInitialActionState(F), F.stateOfLinkageRules = {}, $.filter((G) => !G.disabled).forEach((G) => {
|
|
16324
16324
|
var H;
|
|
16325
16325
|
(H = G.actions) == null || H.forEach((W) => {
|
|
16326
16326
|
linkageAction({
|
|
16327
16327
|
operator: W.operator,
|
|
16328
16328
|
field: F,
|
|
16329
16329
|
condition: G.condition,
|
|
16330
|
-
variables:
|
|
16330
|
+
variables: B,
|
|
16331
16331
|
localVariables: w
|
|
16332
16332
|
});
|
|
16333
16333
|
});
|
|
16334
16334
|
});
|
|
16335
|
-
}, [F,
|
|
16335
|
+
}, [F, $, w, B]);
|
|
16336
16336
|
const q = useCallback(
|
|
16337
16337
|
(G) => {
|
|
16338
16338
|
C == null || C(G);
|
|
@@ -16364,7 +16364,7 @@ const ActionLink = withDynamicSchemaProps(
|
|
|
16364
16364
|
propsDisabled: m,
|
|
16365
16365
|
useAction: r,
|
|
16366
16366
|
visibleWithURL: M,
|
|
16367
|
-
setVisibleWithURL:
|
|
16367
|
+
setVisibleWithURL: N,
|
|
16368
16368
|
setSubmitted: k,
|
|
16369
16369
|
getAriaLabel: j,
|
|
16370
16370
|
parentRecordData: O,
|
|
@@ -16400,10 +16400,10 @@ const ActionLink = withDynamicSchemaProps(
|
|
|
16400
16400
|
actionCallback: R,
|
|
16401
16401
|
visibleWithURL: T,
|
|
16402
16402
|
setVisibleWithURL: D,
|
|
16403
|
-
setSubmitted:
|
|
16403
|
+
setSubmitted: $,
|
|
16404
16404
|
getAriaLabel: z,
|
|
16405
16405
|
parentRecordData: L
|
|
16406
|
-
} = xe,
|
|
16406
|
+
} = xe, B = K(xe, [
|
|
16407
16407
|
"containerRefKey",
|
|
16408
16408
|
"fieldSchema",
|
|
16409
16409
|
"designable",
|
|
@@ -16431,7 +16431,7 @@ const ActionLink = withDynamicSchemaProps(
|
|
|
16431
16431
|
"setSubmitted",
|
|
16432
16432
|
"getAriaLabel",
|
|
16433
16433
|
"parentRecordData"
|
|
16434
|
-
]), [w, M] = useState(!1), { wrapSSR:
|
|
16434
|
+
]), [w, M] = useState(!1), { wrapSSR: N, componentCls: k, hashId: j } = useStyles$e(), [O, q] = useState(!1), E = o["x-toolbar-props"] || o["x-designer-props"], U = (pe = o == null ? void 0 : o["x-component-props"]) == null ? void 0 : pe.openMode, G = (fe = o == null ? void 0 : o["x-component-props"]) == null ? void 0 : fe.openSize, H = (me = o == null ? void 0 : o["x-component-props"]) == null ? void 0 : me.refreshDataBlockRequest, { modal: W } = App.useApp(), X = useForm(), Y = useACLActionParamsContext(), { run: J, element: Q, disabled: ee } = (A == null ? void 0 : A(R)) || {}, oe = X.disabled || i.disabled || ((he = i.data) == null ? void 0 : he.disabled) || F || ee, te = useMemo(() => {
|
|
16435
16435
|
var ce;
|
|
16436
16436
|
return P(x({}, v), {
|
|
16437
16437
|
opacity: r && (((ce = i == null ? void 0 : i.data) == null ? void 0 : ce.hidden) || !Y) && 0.1,
|
|
@@ -16451,7 +16451,7 @@ const ActionLink = withDynamicSchemaProps(
|
|
|
16451
16451
|
componentCls: k,
|
|
16452
16452
|
hashId: j,
|
|
16453
16453
|
className: d,
|
|
16454
|
-
others:
|
|
16454
|
+
others: B,
|
|
16455
16455
|
getAriaLabel: z,
|
|
16456
16456
|
type: p,
|
|
16457
16457
|
Designer: m,
|
|
@@ -16462,7 +16462,7 @@ const ActionLink = withDynamicSchemaProps(
|
|
|
16462
16462
|
run: J,
|
|
16463
16463
|
confirm: g,
|
|
16464
16464
|
modal: W,
|
|
16465
|
-
setSubmitted:
|
|
16465
|
+
setSubmitted: $,
|
|
16466
16466
|
confirmTitle: f,
|
|
16467
16467
|
title: y
|
|
16468
16468
|
}, ae = useCallback(
|
|
@@ -16483,7 +16483,7 @@ const ActionLink = withDynamicSchemaProps(
|
|
|
16483
16483
|
openSize: G,
|
|
16484
16484
|
containerRefKey: n,
|
|
16485
16485
|
fieldSchema: o,
|
|
16486
|
-
setSubmitted:
|
|
16486
|
+
setSubmitted: $,
|
|
16487
16487
|
children: [
|
|
16488
16488
|
C && /* @__PURE__ */ jsx(NocoBaseRecursionField, { basePath: i.address, onlyRenderProperties: !0, schema: o }),
|
|
16489
16489
|
!C && /* @__PURE__ */ jsx(RenderButton, x({}, ie)),
|
|
@@ -16492,7 +16492,7 @@ const ActionLink = withDynamicSchemaProps(
|
|
|
16492
16492
|
]
|
|
16493
16493
|
}
|
|
16494
16494
|
) });
|
|
16495
|
-
return isBulkEditAction(o) && (ue = /* @__PURE__ */ jsx(TabsContextProvider, { children: ue })),
|
|
16495
|
+
return isBulkEditAction(o) && (ue = /* @__PURE__ */ jsx(TabsContextProvider, { children: ue })), N(
|
|
16496
16496
|
b ? /* @__PURE__ */ jsx(RecordProvider, { record: null, parent: L, children: /* @__PURE__ */ jsx(TreeRecordProvider, { parent: S, children: ue }) }) : ue
|
|
16497
16497
|
);
|
|
16498
16498
|
});
|
|
@@ -16562,22 +16562,22 @@ const RenderButton = ({
|
|
|
16562
16562
|
modal: R,
|
|
16563
16563
|
setSubmitted: T,
|
|
16564
16564
|
confirmTitle: D,
|
|
16565
|
-
title:
|
|
16565
|
+
title: $
|
|
16566
16566
|
}) => {
|
|
16567
|
-
const { getDataBlockRequest: z } = useDataBlockRequestGetter(), { t: L } = useTranslation(), { isPopupVisibleControlledByURL:
|
|
16567
|
+
const { getDataBlockRequest: z } = useDataBlockRequestGetter(), { t: L } = useTranslation(), { isPopupVisibleControlledByURL: B } = usePopupSettings(), { openPopup: w } = usePopupUtils(), M = useRef(null);
|
|
16568
16568
|
M.current = w;
|
|
16569
|
-
const
|
|
16569
|
+
const N = useCallback(
|
|
16570
16570
|
(k, j = !0) => {
|
|
16571
16571
|
if (!(j && isPortalInBody(k.target)) && (k.preventDefault(), k.stopPropagation(), !i && n)) {
|
|
16572
16572
|
const O = () => {
|
|
16573
16573
|
b ? b(k, () => {
|
|
16574
16574
|
var q, E;
|
|
16575
16575
|
S !== !1 && (T == null || T(!0), (E = (q = z()) == null ? void 0 : q.refresh) == null || E.call(q));
|
|
16576
|
-
}) : isBulkEditAction(y) ||
|
|
16576
|
+
}) : isBulkEditAction(y) || !B() ? (v(!0), F == null || F()) : ["view", "update", "create", "customize:popup"].includes(y["x-action"]) && y["x-uid"] ? M.current() : (v(!0), F == null || F());
|
|
16577
16577
|
};
|
|
16578
16578
|
(A == null ? void 0 : A.enable) !== !1 && (A != null && A.content) ? R.confirm({
|
|
16579
|
-
title: L(A.title, { title: D ||
|
|
16580
|
-
content: L(A.content, { title: D ||
|
|
16579
|
+
title: L(A.title, { title: D || $ || (t == null ? void 0 : t.title) }),
|
|
16580
|
+
content: L(A.content, { title: D || $ || (t == null ? void 0 : t.title) }),
|
|
16581
16581
|
onOk: O
|
|
16582
16582
|
}) : O();
|
|
16583
16583
|
}
|
|
@@ -16591,7 +16591,7 @@ const RenderButton = ({
|
|
|
16591
16591
|
i,
|
|
16592
16592
|
t,
|
|
16593
16593
|
y,
|
|
16594
|
-
|
|
16594
|
+
B,
|
|
16595
16595
|
R,
|
|
16596
16596
|
b,
|
|
16597
16597
|
S,
|
|
@@ -16599,7 +16599,7 @@ const RenderButton = ({
|
|
|
16599
16599
|
T,
|
|
16600
16600
|
v,
|
|
16601
16601
|
L,
|
|
16602
|
-
|
|
16602
|
+
$,
|
|
16603
16603
|
z
|
|
16604
16604
|
]
|
|
16605
16605
|
);
|
|
@@ -16615,7 +16615,7 @@ const RenderButton = ({
|
|
|
16615
16615
|
buttonStyle: a,
|
|
16616
16616
|
handleMouseEnter: l,
|
|
16617
16617
|
getAriaLabel: g,
|
|
16618
|
-
handleButtonClick:
|
|
16618
|
+
handleButtonClick: N,
|
|
16619
16619
|
tarComponent: c,
|
|
16620
16620
|
componentCls: d,
|
|
16621
16621
|
hashId: p,
|
|
@@ -16623,7 +16623,7 @@ const RenderButton = ({
|
|
|
16623
16623
|
type: f,
|
|
16624
16624
|
Designer: C,
|
|
16625
16625
|
designerProps: u,
|
|
16626
|
-
title:
|
|
16626
|
+
title: $
|
|
16627
16627
|
}, h)
|
|
16628
16628
|
);
|
|
16629
16629
|
};
|
|
@@ -17732,7 +17732,7 @@ https://requirejs.org/docs/errors.html#` + e);
|
|
|
17732
17732
|
};
|
|
17733
17733
|
}
|
|
17734
17734
|
};
|
|
17735
|
-
function
|
|
17735
|
+
function $(k) {
|
|
17736
17736
|
delete l[k], delete c[k];
|
|
17737
17737
|
}
|
|
17738
17738
|
function z(k, j, O) {
|
|
@@ -17823,7 +17823,7 @@ https://requirejs.org/docs/errors.html#` + e);
|
|
|
17823
17823
|
G.push(H.normalizedMap || H);
|
|
17824
17824
|
}), req.onResourceLoad(o, this.map, G);
|
|
17825
17825
|
}
|
|
17826
|
-
|
|
17826
|
+
$(O), this.defined = !0;
|
|
17827
17827
|
}
|
|
17828
17828
|
this.defining = !1, this.defined && !this.defineEmitted && (this.defineEmitted = !0, this.emit("defined", this.exports), this.defineEmitComplete = !0);
|
|
17829
17829
|
}
|
|
@@ -17870,7 +17870,7 @@ https://requirejs.org/docs/errors.html#` + e);
|
|
|
17870
17870
|
});
|
|
17871
17871
|
}), E.error = bind(this, function(J) {
|
|
17872
17872
|
this.inited = !0, this.error = J, J.requireModules = [j], eachProp(l, function(Q) {
|
|
17873
|
-
Q.map.id.indexOf(j + "_unnormalized") === 0 &&
|
|
17873
|
+
Q.map.id.indexOf(j + "_unnormalized") === 0 && $(Q.map.id);
|
|
17874
17874
|
}), T(J);
|
|
17875
17875
|
}), E.fromText = bind(this, function(J, Q) {
|
|
17876
17876
|
var ee = k.name, oe = F(ee), te = useInteractive;
|
|
@@ -17924,7 +17924,7 @@ https://requirejs.org/docs/errors.html#` + e);
|
|
|
17924
17924
|
}), k === "error" && delete this.events[k];
|
|
17925
17925
|
}
|
|
17926
17926
|
};
|
|
17927
|
-
function
|
|
17927
|
+
function B(k) {
|
|
17928
17928
|
hasProp(p, k[0]) || A(F(k[0], null, !0)).init(k[1], k[2]);
|
|
17929
17929
|
}
|
|
17930
17930
|
function w(k, j, O, q) {
|
|
@@ -17937,12 +17937,12 @@ https://requirejs.org/docs/errors.html#` + e);
|
|
|
17937
17937
|
id: j && j.getAttribute("data-requiremodule")
|
|
17938
17938
|
};
|
|
17939
17939
|
}
|
|
17940
|
-
function
|
|
17940
|
+
function N() {
|
|
17941
17941
|
var k;
|
|
17942
17942
|
for (D(); d.length; ) {
|
|
17943
17943
|
if (k = d.shift(), k[0] === null)
|
|
17944
17944
|
return T(makeError("mismatch", "Mismatched anonymous define() module: " + k[k.length - 1]));
|
|
17945
|
-
|
|
17945
|
+
B(k);
|
|
17946
17946
|
}
|
|
17947
17947
|
o.defQueueMap = {};
|
|
17948
17948
|
}
|
|
@@ -18003,8 +18003,8 @@ https://requirejs.org/docs/errors.html#` + e);
|
|
|
18003
18003
|
j = j || {};
|
|
18004
18004
|
function O(q, E, U) {
|
|
18005
18005
|
var G, H, W;
|
|
18006
|
-
return j.enableBuildCallback && E && isFunction(E) && (E.__requireJsBuild = !0), typeof q == "string" ? isFunction(E) ? T(makeError("requireargs", "Invalid require call"), U) : k && hasProp(r, q) ? r[q](l[k.id]) : req.get ? req.get(o, q, k, O) : (H = F(q, k, !1, !0), G = H.id, hasProp(p, G) ? p[G] : T(makeError("notloaded", 'Module name "' + G + '" has not been loaded yet for context: ' + e + (k ? "" : ". Use require([])")))) : (
|
|
18007
|
-
|
|
18006
|
+
return j.enableBuildCallback && E && isFunction(E) && (E.__requireJsBuild = !0), typeof q == "string" ? isFunction(E) ? T(makeError("requireargs", "Invalid require call"), U) : k && hasProp(r, q) ? r[q](l[k.id]) : req.get ? req.get(o, q, k, O) : (H = F(q, k, !1, !0), G = H.id, hasProp(p, G) ? p[G] : T(makeError("notloaded", 'Module name "' + G + '" has not been loaded yet for context: ' + e + (k ? "" : ". Use require([])")))) : (N(), o.nextTick(function() {
|
|
18007
|
+
N(), W = A(F(null, k)), W.skipMap = j.skipMap, W.init(q, E, U, {
|
|
18008
18008
|
enabled: !0
|
|
18009
18009
|
}), L();
|
|
18010
18010
|
}), O);
|
|
@@ -18035,7 +18035,7 @@ https://requirejs.org/docs/errors.html#` + e);
|
|
|
18035
18035
|
var E = F(q, k, !0), U = getOwn(l, q);
|
|
18036
18036
|
U.undefed = !0, S(q), delete p[q], delete m[E.url], delete u[q], eachReverse(d, function(G, H) {
|
|
18037
18037
|
G[0] === q && d.splice(H, 1);
|
|
18038
|
-
}), delete o.defQueueMap[q], U && (U.events.defined && (u[q] = U.events),
|
|
18038
|
+
}), delete o.defQueueMap[q], U && (U.events.defined && (u[q] = U.events), $(q));
|
|
18039
18039
|
}), O;
|
|
18040
18040
|
},
|
|
18041
18041
|
/**
|
|
@@ -18063,7 +18063,7 @@ https://requirejs.org/docs/errors.html#` + e);
|
|
|
18063
18063
|
j = !0;
|
|
18064
18064
|
} else
|
|
18065
18065
|
O[0] === k && (j = !0);
|
|
18066
|
-
|
|
18066
|
+
B(O);
|
|
18067
18067
|
}
|
|
18068
18068
|
if (o.defQueueMap = {}, q = getOwn(l, k), !j && !hasProp(p, k) && q && !q.inited) {
|
|
18069
18069
|
if (a.enforceDefine && (!U || !getGlobal(U)))
|
|
@@ -18073,7 +18073,7 @@ https://requirejs.org/docs/errors.html#` + e);
|
|
|
18073
18073
|
null,
|
|
18074
18074
|
[k]
|
|
18075
18075
|
));
|
|
18076
|
-
|
|
18076
|
+
B([k, E.deps || [], E.exportsFn]);
|
|
18077
18077
|
}
|
|
18078
18078
|
L();
|
|
18079
18079
|
},
|
|
@@ -18632,12 +18632,12 @@ const useCollectionManager_deprecated = (e) => {
|
|
|
18632
18632
|
const t = useDataSourceManager(), n = useDataSource(), o = useCollectionManager(), r = e || (n == null ? void 0 : n.key) || void 0, [i, a] = useState(uid()), { refresh: l } = useSchemaComponentContext(), c = useMemo(
|
|
18633
18633
|
() => {
|
|
18634
18634
|
var w;
|
|
18635
|
-
return (w = t == null ? void 0 : t.collectionFieldInterfaceManager) == null ? void 0 : w.getFieldInterfaces().reduce((M,
|
|
18635
|
+
return (w = t == null ? void 0 : t.collectionFieldInterfaceManager) == null ? void 0 : w.getFieldInterfaces().reduce((M, N) => (M[N.name] = N, M), {});
|
|
18636
18636
|
},
|
|
18637
18637
|
[t, i]
|
|
18638
18638
|
), u = useMemo(() => t == null ? void 0 : t.collectionTemplateManager.getCollectionTemplates(), [t, i]), d = useCallback(() => {
|
|
18639
18639
|
var w, M;
|
|
18640
|
-
return (M = (w = t == null ? void 0 : t.getDataSource(r)) == null ? void 0 : w.collectionManager) == null ? void 0 : M.getCollections().map((
|
|
18640
|
+
return (M = (w = t == null ? void 0 : t.getDataSource(r)) == null ? void 0 : w.collectionManager) == null ? void 0 : M.getCollections().map((N) => N.getOptions());
|
|
18641
18641
|
}, [t, n]), p = useCallback(
|
|
18642
18642
|
(w) => {
|
|
18643
18643
|
var M;
|
|
@@ -18662,8 +18662,8 @@ const useCollectionManager_deprecated = (e) => {
|
|
|
18662
18662
|
[t]
|
|
18663
18663
|
), f = useCompile(), C = useCallback(
|
|
18664
18664
|
(w, M) => {
|
|
18665
|
-
var
|
|
18666
|
-
return ((k = (
|
|
18665
|
+
var N, k;
|
|
18666
|
+
return ((k = (N = p(M)) == null ? void 0 : N.getCollection(w)) == null ? void 0 : k.getInheritedFields()) || [];
|
|
18667
18667
|
},
|
|
18668
18668
|
[t, p]
|
|
18669
18669
|
), b = useCallback(
|
|
@@ -18671,40 +18671,40 @@ const useCollectionManager_deprecated = (e) => {
|
|
|
18671
18671
|
var k, j;
|
|
18672
18672
|
if (!w)
|
|
18673
18673
|
return [];
|
|
18674
|
-
const
|
|
18675
|
-
return ((j =
|
|
18674
|
+
const N = (k = p(M)) == null ? void 0 : k.getCollection(w);
|
|
18675
|
+
return ((j = N == null ? void 0 : N.getAllFields) == null ? void 0 : j.call(N)) || (N == null ? void 0 : N.getFields()) || [];
|
|
18676
18676
|
},
|
|
18677
18677
|
[t, p]
|
|
18678
18678
|
), S = useCallback(
|
|
18679
18679
|
(w, M) => {
|
|
18680
|
-
var
|
|
18680
|
+
var N;
|
|
18681
18681
|
if (!(!w || w.split(".").length < 2))
|
|
18682
|
-
return (
|
|
18682
|
+
return (N = p(M)) == null ? void 0 : N.getCollectionField(w);
|
|
18683
18683
|
},
|
|
18684
18684
|
[t, p]
|
|
18685
18685
|
), y = useCallback(
|
|
18686
18686
|
(w, M) => {
|
|
18687
|
-
var
|
|
18688
|
-
return w ? ((k = (
|
|
18687
|
+
var N, k;
|
|
18688
|
+
return w ? ((k = (N = p(M)) == null ? void 0 : N.getCollection(w)) == null ? void 0 : k.getParentCollectionsName()) || [] : [];
|
|
18689
18689
|
},
|
|
18690
18690
|
[t, p]
|
|
18691
18691
|
), v = useCallback(
|
|
18692
|
-
(w, M = !1,
|
|
18692
|
+
(w, M = !1, N) => {
|
|
18693
18693
|
var O;
|
|
18694
18694
|
if (!w)
|
|
18695
18695
|
return [];
|
|
18696
|
-
const k = (O = p(
|
|
18696
|
+
const k = (O = p(N)) == null ? void 0 : O.getCollection(w);
|
|
18697
18697
|
return (k == null ? void 0 : k.getChildrenCollections(M)) || [];
|
|
18698
18698
|
},
|
|
18699
18699
|
[t, p]
|
|
18700
18700
|
), F = useCallback(
|
|
18701
18701
|
(w, M) => {
|
|
18702
|
-
var
|
|
18703
|
-
return w ? ((k = (
|
|
18702
|
+
var N, k;
|
|
18703
|
+
return w ? ((k = (N = p(M)) == null ? void 0 : N.getCollection(w)) == null ? void 0 : k.getCurrentFields()) || [] : [];
|
|
18704
18704
|
},
|
|
18705
18705
|
[t, p]
|
|
18706
18706
|
), A = useCallback(
|
|
18707
|
-
(w, M = "string",
|
|
18707
|
+
(w, M = "string", N) => {
|
|
18708
18708
|
var J;
|
|
18709
18709
|
const {
|
|
18710
18710
|
association: k = !1,
|
|
@@ -18716,7 +18716,7 @@ const useCollectionManager_deprecated = (e) => {
|
|
|
18716
18716
|
prefixFieldValue: G = "",
|
|
18717
18717
|
usePrefix: H = !1,
|
|
18718
18718
|
dataSource: W
|
|
18719
|
-
} =
|
|
18719
|
+
} = N || {};
|
|
18720
18720
|
if (O.length - 1 > q)
|
|
18721
18721
|
return;
|
|
18722
18722
|
if (j[w])
|
|
@@ -18730,7 +18730,7 @@ const useCollectionManager_deprecated = (e) => {
|
|
|
18730
18730
|
value: H && G ? `${G}.${Q.name}` : Q.name,
|
|
18731
18731
|
label: f((oe = Q == null ? void 0 : Q.uiSchema) == null ? void 0 : oe.title) || Q.name
|
|
18732
18732
|
}, Q);
|
|
18733
|
-
return k && Q.target && (ee.children = O.includes(Q.target) ? [] : A(Q.target, M, P(x({},
|
|
18733
|
+
return k && Q.target && (ee.children = O.includes(Q.target) ? [] : A(Q.target, M, P(x({}, N), {
|
|
18734
18734
|
cached: j,
|
|
18735
18735
|
dataSource: W,
|
|
18736
18736
|
collectionNames: [...O, Q.target],
|
|
@@ -18743,38 +18743,38 @@ const useCollectionManager_deprecated = (e) => {
|
|
|
18743
18743
|
[b]
|
|
18744
18744
|
), R = useCallback(
|
|
18745
18745
|
(w, M) => {
|
|
18746
|
-
var
|
|
18747
|
-
return (
|
|
18746
|
+
var N;
|
|
18747
|
+
return (N = p(M)) == null ? void 0 : N.getCollection(w);
|
|
18748
18748
|
},
|
|
18749
18749
|
[t, p]
|
|
18750
18750
|
), T = useCallback(
|
|
18751
18751
|
(w, M) => {
|
|
18752
|
-
var
|
|
18753
|
-
return (k = (
|
|
18752
|
+
var N, k;
|
|
18753
|
+
return (k = (N = p(M)) == null ? void 0 : N.getCollection(w)) == null ? void 0 : k.getAllCollectionsInheritChain();
|
|
18754
18754
|
},
|
|
18755
18755
|
[t, p]
|
|
18756
18756
|
), D = useCallback(
|
|
18757
18757
|
(w, M) => () => {
|
|
18758
|
-
var
|
|
18759
|
-
return (k = (
|
|
18758
|
+
var N, k;
|
|
18759
|
+
return (k = (N = p(M)) == null ? void 0 : N.getCollection(w)) == null ? void 0 : k.getInheritCollectionsChain();
|
|
18760
18760
|
},
|
|
18761
18761
|
[t, p]
|
|
18762
|
-
),
|
|
18762
|
+
), $ = useCallback(
|
|
18763
18763
|
(w) => t == null ? void 0 : t.collectionFieldInterfaceManager.getFieldInterface(w),
|
|
18764
18764
|
[t]
|
|
18765
18765
|
), z = useCallback(
|
|
18766
18766
|
(w) => {
|
|
18767
18767
|
var M;
|
|
18768
|
-
return (M =
|
|
18768
|
+
return (M = $(w.interface)) == null ? void 0 : M.titleUsable;
|
|
18769
18769
|
},
|
|
18770
|
-
[
|
|
18770
|
+
[$]
|
|
18771
18771
|
), L = useCallback(
|
|
18772
|
-
(w, M,
|
|
18772
|
+
(w, M, N) => {
|
|
18773
18773
|
var k, j;
|
|
18774
|
-
return (j = (k = p(
|
|
18774
|
+
return (j = (k = p(N)) == null ? void 0 : k.getCollection(M)) == null ? void 0 : j.getParentCollectionFields(w);
|
|
18775
18775
|
},
|
|
18776
18776
|
[t, p]
|
|
18777
|
-
),
|
|
18777
|
+
), B = useCallback(
|
|
18778
18778
|
(w = "general") => t == null ? void 0 : t.collectionTemplateManager.getCollectionTemplate(w),
|
|
18779
18779
|
[t]
|
|
18780
18780
|
);
|
|
@@ -18783,8 +18783,8 @@ const useCollectionManager_deprecated = (e) => {
|
|
|
18783
18783
|
interfaces: c,
|
|
18784
18784
|
collections: m,
|
|
18785
18785
|
templates: u,
|
|
18786
|
-
getTemplate:
|
|
18787
|
-
getInterface:
|
|
18786
|
+
getTemplate: B,
|
|
18787
|
+
getInterface: $,
|
|
18788
18788
|
getCollections: d,
|
|
18789
18789
|
getParentCollectionFields: L,
|
|
18790
18790
|
getInheritCollections: y,
|
|
@@ -19081,7 +19081,7 @@ const BaseVariableContext = React.createContext(null), BaseVariableProvider = (e
|
|
|
19081
19081
|
isDisabled: f || isDisabledDefault,
|
|
19082
19082
|
getCollectionField: C.getCollectionField,
|
|
19083
19083
|
deprecated: p
|
|
19084
|
-
}) || []).sort((D,
|
|
19084
|
+
}) || []).sort((D, $) => D.isLeaf && !$.isLeaf ? -1 : !D.isLeaf && $.isLeaf ? 1 : 0).sort((D, $) => D.disabled && !$.disabled ? 1 : !D.disabled && $.disabled ? -1 : 0);
|
|
19085
19085
|
if (T.length === 0) {
|
|
19086
19086
|
y.disabled = !0, y.isLeaf = !0, A();
|
|
19087
19087
|
return;
|
|
@@ -19244,12 +19244,42 @@ const DatePickerContext = React.createContext({ utc: !0 }), useDatePickerContext
|
|
|
19244
19244
|
mapProps(mapRangePicker()),
|
|
19245
19245
|
mapReadPretty(ReadPretty$d.DateRangePicker)
|
|
19246
19246
|
), DatePicker = (e) => {
|
|
19247
|
-
const { utc: t = !0 } = useDatePickerContext(), n = Array.isArray(e.value) ? e.value[0] : e.value, o =
|
|
19247
|
+
const { utc: t = !0 } = useDatePickerContext(), n = Array.isArray(e.value) ? e.value[0] : e.value, { parseVariable: o } = useVariables$1() || {}, r = useLocalVariables$1(), [i, a] = useState(null), [l, c] = useState(null), u = useRef(null);
|
|
19248
|
+
useEffect(() => (u.current && u.current(), u.current = autorun(() => {
|
|
19249
|
+
d();
|
|
19250
|
+
}), () => {
|
|
19251
|
+
u.current();
|
|
19252
|
+
}), [e._maxDate, e._minDate, r, o]);
|
|
19253
|
+
const d = () => V(void 0, null, function* () {
|
|
19254
|
+
let m = e._minDate ? Promise.resolve(dayjs(e._minDate)) : Promise.resolve(null), h = e._maxDate ? Promise.resolve(dayjs(e._maxDate)) : Promise.resolve(null);
|
|
19255
|
+
isVariable(e._maxDate) && (h = o(e._maxDate, r).then((y) => dayjs(y.value))), isVariable(e._minDate) && (m = o(e._minDate, r).then((y) => dayjs(y.value)));
|
|
19256
|
+
const [g, f] = yield Promise.all([m, h]), C = Array.from({ length: 60 }, (y, v) => v), b = (y) => {
|
|
19257
|
+
if (!y || !g && !f)
|
|
19258
|
+
return !1;
|
|
19259
|
+
const v = dayjs(y);
|
|
19260
|
+
return v.isBefore(g, "minute") || v.isAfter(f, "minute");
|
|
19261
|
+
}, S = (y) => {
|
|
19262
|
+
if (!y || !g && !f)
|
|
19263
|
+
return { disabledHours: () => [], disabledMinutes: () => [], disabledSeconds: () => [] };
|
|
19264
|
+
const v = dayjs(y), F = v.isSame(g, "day"), A = v.isSame(f, "day");
|
|
19265
|
+
return {
|
|
19266
|
+
disabledHours: () => {
|
|
19267
|
+
const $ = [];
|
|
19268
|
+
return F && $.push(...Array.from({ length: g.hour() }, (z, L) => L)), A && $.push(...Array.from({ length: 24 - f.hour() }, (z, L) => L + f.hour() + 1)), $;
|
|
19269
|
+
},
|
|
19270
|
+
disabledMinutes: ($) => F && $ === g.hour() ? C.filter((z) => z < g.minute()) : A && $ === f.hour() ? C.filter((z) => z > f.minute()) : [],
|
|
19271
|
+
disabledSeconds: ($, z) => F && $ === g.hour() && z === g.minute() ? C.filter((L) => L < g.second()) : A && $ === f.hour() && z === f.minute() ? C.filter((L) => L > f.second()) : []
|
|
19272
|
+
};
|
|
19273
|
+
};
|
|
19274
|
+
a(() => b), c(() => S);
|
|
19275
|
+
}), p = P(x({
|
|
19248
19276
|
utc: t
|
|
19249
19277
|
}, e), {
|
|
19278
|
+
disabledDate: i,
|
|
19279
|
+
disabledTime: l,
|
|
19250
19280
|
showTime: e.showTime ? { defaultValue: dayjs("00:00:00", "HH:mm:ss") } : !1
|
|
19251
19281
|
});
|
|
19252
|
-
return /* @__PURE__ */ jsx(InternalDatePicker, P(x({},
|
|
19282
|
+
return /* @__PURE__ */ jsx(InternalDatePicker, P(x({}, p), { value: n }));
|
|
19253
19283
|
};
|
|
19254
19284
|
DatePicker.ReadPretty = ReadPretty$d.DatePicker;
|
|
19255
19285
|
DatePicker.RangePicker = function e(t) {
|
|
@@ -19809,19 +19839,13 @@ const useDateVariable = ({ operator: e, schema: t, noDisabled: n }) => {
|
|
|
19809
19839
|
/** 变量的值 */
|
|
19810
19840
|
currentUserCtx: (c = a == null ? void 0 : a.data) == null ? void 0 : c.data
|
|
19811
19841
|
};
|
|
19812
|
-
}, useCurrentFormData = () => {
|
|
19813
|
-
var t, n;
|
|
19814
|
-
const e = useDataBlockRequestData();
|
|
19815
|
-
if (!(((t = e == null ? void 0 : e.data) == null ? void 0 : t.length) > 1))
|
|
19816
|
-
return ((n = e == null ? void 0 : e.data) == null ? void 0 : n[0]) || (e == null ? void 0 : e.data);
|
|
19817
19842
|
}, useCurrentFormContext = ({ form: e } = {}) => {
|
|
19818
|
-
|
|
19819
|
-
const { form: t } = useFormBlockContext(), n = useCurrentFormData(), { isVariableParsedInOtherContext: o } = useFlag(), r = e || t;
|
|
19843
|
+
const { form: t } = useFormBlockContext(), { isVariableParsedInOtherContext: n } = useFlag(), o = e || t;
|
|
19820
19844
|
return {
|
|
19821
19845
|
/** 变量值 */
|
|
19822
|
-
currentFormCtx:
|
|
19846
|
+
currentFormCtx: o == null ? void 0 : o.values,
|
|
19823
19847
|
/** 用来判断是否可以显示`当前表单`变量 */
|
|
19824
|
-
shouldDisplayCurrentForm:
|
|
19848
|
+
shouldDisplayCurrentForm: o && !o.readPretty && !n
|
|
19825
19849
|
};
|
|
19826
19850
|
}, useCurrentFormVariable = ({
|
|
19827
19851
|
collectionField: e,
|
|
@@ -20077,8 +20101,8 @@ const ParentCollectionProvider = (e) => {
|
|
|
20077
20101
|
targetFieldSchema: i,
|
|
20078
20102
|
record: a
|
|
20079
20103
|
}) => {
|
|
20080
|
-
var
|
|
20081
|
-
const { filterVariables: l = () => !0 } = useVariables$1() || {}, c = (
|
|
20104
|
+
var B;
|
|
20105
|
+
const { filterVariables: l = () => !0 } = useVariables$1() || {}, c = (B = a == null ? void 0 : a.__parent) == null ? void 0 : B.__collectionName, { currentUserSettings: u } = useCurrentUserVariable({
|
|
20082
20106
|
maxDepth: 3,
|
|
20083
20107
|
uiSchema: n,
|
|
20084
20108
|
collectionField: e,
|
|
@@ -20120,7 +20144,7 @@ const ParentCollectionProvider = (e) => {
|
|
|
20120
20144
|
collectionField: e,
|
|
20121
20145
|
noDisabled: r,
|
|
20122
20146
|
targetFieldSchema: i
|
|
20123
|
-
}), { currentParentRecordSettings: D, shouldDisplayCurrentParentRecord:
|
|
20147
|
+
}), { currentParentRecordSettings: D, shouldDisplayCurrentParentRecord: $ } = useCurrentParentRecordVariable({
|
|
20124
20148
|
schema: n,
|
|
20125
20149
|
collectionName: c,
|
|
20126
20150
|
collectionField: e,
|
|
@@ -20136,7 +20160,7 @@ const ParentCollectionProvider = (e) => {
|
|
|
20136
20160
|
C && f,
|
|
20137
20161
|
S && b,
|
|
20138
20162
|
v && y,
|
|
20139
|
-
|
|
20163
|
+
$ && D,
|
|
20140
20164
|
A && F,
|
|
20141
20165
|
T && R,
|
|
20142
20166
|
L && z
|
|
@@ -20153,7 +20177,7 @@ const ParentCollectionProvider = (e) => {
|
|
|
20153
20177
|
b,
|
|
20154
20178
|
v,
|
|
20155
20179
|
y,
|
|
20156
|
-
|
|
20180
|
+
$,
|
|
20157
20181
|
D,
|
|
20158
20182
|
A,
|
|
20159
20183
|
F,
|
|
@@ -22232,19 +22256,19 @@ const SchemaSettingsSwitchItem = (e) => {
|
|
|
22232
22256
|
useEffect(() => {
|
|
22233
22257
|
D.setInitialValues(cloneDeep$1(r));
|
|
22234
22258
|
}, [JSON.stringify(r || {})]);
|
|
22235
|
-
const
|
|
22259
|
+
const $ = useCallback(() => {
|
|
22236
22260
|
h(!1), D.reset();
|
|
22237
22261
|
}, [D]), z = useCallback(() => V(void 0, null, function* () {
|
|
22238
22262
|
yield D.submit();
|
|
22239
22263
|
try {
|
|
22240
|
-
const M = D.values,
|
|
22241
|
-
yield n == null ? void 0 : n(cloneDeep$1(
|
|
22264
|
+
const M = D.values, N = Object.keys(M).reduce((k, j) => (D.query(j).take() && (k[j] = M[j]), k), {});
|
|
22265
|
+
yield n == null ? void 0 : n(cloneDeep$1(N)), h(!1);
|
|
22242
22266
|
} catch (M) {
|
|
22243
22267
|
console.error(M);
|
|
22244
22268
|
}
|
|
22245
22269
|
}), [D, n]), L = useCallback(() => V(void 0, null, function* () {
|
|
22246
22270
|
!g && (a != null && a["x-uid"]) && (b["x-action-settings"].schemaUid = a["x-uid"], y.emit("patch", { schema: b }), yield F.resource("uiSchemas").insert({ values: a }), f(a["x-uid"])), typeof i == "function" && (i == null || i()), S.setVisible(!1), h(!0);
|
|
22247
|
-
}), [F, S, y, b, a, g]),
|
|
22271
|
+
}), [F, S, y, b, a, g]), B = useCallback((M) => M.stopPropagation(), []);
|
|
22248
22272
|
return /* @__PURE__ */ jsxs(zIndexContext.Provider, { value: T, children: [
|
|
22249
22273
|
/* @__PURE__ */ jsx(
|
|
22250
22274
|
SchemaSettingsItem,
|
|
@@ -22252,7 +22276,7 @@ const SchemaSettingsSwitchItem = (e) => {
|
|
|
22252
22276
|
title: v(t)
|
|
22253
22277
|
}, p), {
|
|
22254
22278
|
onClick: L,
|
|
22255
|
-
onKeyDown:
|
|
22279
|
+
onKeyDown: B,
|
|
22256
22280
|
children: e.children || e.title
|
|
22257
22281
|
})
|
|
22258
22282
|
),
|
|
@@ -22265,10 +22289,10 @@ const SchemaSettingsSwitchItem = (e) => {
|
|
|
22265
22289
|
}, p), {
|
|
22266
22290
|
destroyOnClose: !0,
|
|
22267
22291
|
open: m,
|
|
22268
|
-
onCancel:
|
|
22292
|
+
onCancel: $,
|
|
22269
22293
|
zIndex: T,
|
|
22270
22294
|
footer: /* @__PURE__ */ jsxs(Space$1, { children: [
|
|
22271
|
-
/* @__PURE__ */ jsx(Button, { onClick:
|
|
22295
|
+
/* @__PURE__ */ jsx(Button, { onClick: $, children: C("Cancel") }),
|
|
22272
22296
|
/* @__PURE__ */ jsx(Button, { type: "primary", onClick: z, children: C("Submit") })
|
|
22273
22297
|
] }),
|
|
22274
22298
|
children: /* @__PURE__ */ jsx(FormActiveFieldsProvider, { name: "form", getActiveFieldsName: A == null ? void 0 : A.getActiveFieldsName, children: /* @__PURE__ */ jsx(FormProvider, { form: D, children: /* @__PURE__ */ jsxs(FormLayout, { layout: "vertical", children: [
|
|
@@ -22309,7 +22333,7 @@ const SchemaSettingsModalItem = (e) => {
|
|
|
22309
22333
|
"width",
|
|
22310
22334
|
"noRecord",
|
|
22311
22335
|
"ModalContextProvider"
|
|
22312
|
-
]), h = useContext(SchemaOptionsContext), g = useCollection(), f = useAPIClient(), C = useApp(), { theme: b } = useGlobalTheme(), S = useBlockRequestContext(), y = useFormActiveFields(), { locale: v } = useContext(ConfigProvider.ConfigContext), F = useDataSourceManager(), A = useDataSourceKey(), R = useCollectionRecord(), { association: T } = useDataBlockProps() || {}, D = useFormBlockContext(),
|
|
22336
|
+
]), h = useContext(SchemaOptionsContext), g = useCollection(), f = useAPIClient(), C = useApp(), { theme: b } = useGlobalTheme(), S = useBlockRequestContext(), y = useFormActiveFields(), { locale: v } = useContext(ConfigProvider.ConfigContext), F = useDataSourceManager(), A = useDataSourceKey(), R = useCollectionRecord(), { association: T } = useDataBlockProps() || {}, D = useFormBlockContext(), $ = useBlockContext(), { getOperators: z } = useOperators(), L = useLocationSearch(), B = useVariables$1(), { formValue: w, collection: M, parent: N } = useSubFormValue(), k = useCurrentPopupRecord(), j = useParentPopupRecord();
|
|
22313
22337
|
return t ? null : /* @__PURE__ */ jsx(
|
|
22314
22338
|
SchemaSettingsItem,
|
|
22315
22339
|
P(x({
|
|
@@ -22319,7 +22343,7 @@ const SchemaSettingsModalItem = (e) => {
|
|
|
22319
22343
|
const q = l ? yield l() : c, E = _.isFunction(e.schema) ? e.schema() : e.schema;
|
|
22320
22344
|
FormDialog(
|
|
22321
22345
|
{ title: E.title || n, width: u },
|
|
22322
|
-
() => /* @__PURE__ */ jsx(p, { children: /* @__PURE__ */ jsx(CollectOperators, { defaultOperators: z(), children: /* @__PURE__ */ jsx(VariablesContext.Provider, { value:
|
|
22346
|
+
() => /* @__PURE__ */ jsx(p, { children: /* @__PURE__ */ jsx(CollectOperators, { defaultOperators: z(), children: /* @__PURE__ */ jsx(VariablesContext.Provider, { value: B, children: /* @__PURE__ */ jsx(BlockContext.Provider, { value: $, children: /* @__PURE__ */ jsx(
|
|
22323
22347
|
VariablePopupRecordProvider,
|
|
22324
22348
|
{
|
|
22325
22349
|
recordData: k == null ? void 0 : k.value,
|
|
@@ -22328,7 +22352,7 @@ const SchemaSettingsModalItem = (e) => {
|
|
|
22328
22352
|
recordData: j == null ? void 0 : j.value,
|
|
22329
22353
|
collection: j == null ? void 0 : j.collection
|
|
22330
22354
|
},
|
|
22331
|
-
children: /* @__PURE__ */ jsx(CollectionRecordProvider, { record: d ? null : R, children: /* @__PURE__ */ jsx(FormBlockContext$1.Provider, { value: D, children: /* @__PURE__ */ jsx(SubFormProvider, { value: { value: w, collection: M, parent:
|
|
22355
|
+
children: /* @__PURE__ */ jsx(CollectionRecordProvider, { record: d ? null : R, children: /* @__PURE__ */ jsx(FormBlockContext$1.Provider, { value: D, children: /* @__PURE__ */ jsx(SubFormProvider, { value: { value: w, collection: M, parent: N }, children: /* @__PURE__ */ jsx(
|
|
22332
22356
|
FormActiveFieldsProvider,
|
|
22333
22357
|
{
|
|
22334
22358
|
name: "form",
|
|
@@ -22508,22 +22532,22 @@ const SchemaSettingsModalItem = (e) => {
|
|
|
22508
22532
|
}
|
|
22509
22533
|
}),
|
|
22510
22534
|
[n, a, l, b, m, h, u, p, A, r]
|
|
22511
|
-
), D = useMemo(() => ({ ArrayCollapse: ArrayCollapse$2, FormLayout }), []),
|
|
22535
|
+
), D = useMemo(() => ({ ArrayCollapse: ArrayCollapse$2, FormLayout }), []), $ = useCallback(
|
|
22512
22536
|
(L) => {
|
|
22513
22537
|
var k;
|
|
22514
|
-
const
|
|
22538
|
+
const B = [];
|
|
22515
22539
|
for (const j of L.fieldReaction.rules)
|
|
22516
|
-
|
|
22517
|
-
const w = b["x-component"] === "BlockTemplate" && ((k = b["x-component-props"]) == null ? void 0 : k.templateId),
|
|
22540
|
+
B.push(_.pickBy(j, _.identity));
|
|
22541
|
+
const w = b["x-component"] === "BlockTemplate" && ((k = b["x-component-props"]) == null ? void 0 : k.templateId), N = {
|
|
22518
22542
|
"x-uid": w && d(w).uid || b["x-uid"]
|
|
22519
22543
|
};
|
|
22520
|
-
b[F] =
|
|
22521
|
-
schema:
|
|
22544
|
+
b[F] = B, N[F] = B, c.emit("patch", {
|
|
22545
|
+
schema: N
|
|
22522
22546
|
}), c.refresh(), i == null || i();
|
|
22523
22547
|
},
|
|
22524
22548
|
[c, d, b, F, i]
|
|
22525
22549
|
);
|
|
22526
|
-
return /* @__PURE__ */ jsx(SchemaSettingsModalItem, { title: R, components: D, width: 770, schema: T, onSubmit:
|
|
22550
|
+
return /* @__PURE__ */ jsx(SchemaSettingsModalItem, { title: R, components: D, width: 770, schema: T, onSubmit: $ });
|
|
22527
22551
|
}, useDataTemplates = (e) => {
|
|
22528
22552
|
const t = useFieldSchema();
|
|
22529
22553
|
if (e)
|
|
@@ -23171,17 +23195,17 @@ const designerCss$4 = ({ margin: e = "-18px -16px", padding: t = "18px 16px" } =
|
|
|
23171
23195
|
}
|
|
23172
23196
|
},
|
|
23173
23197
|
onSubmit: (D) => {
|
|
23174
|
-
const
|
|
23198
|
+
const $ = {
|
|
23175
23199
|
"x-uid": n["x-uid"]
|
|
23176
23200
|
};
|
|
23177
|
-
(o.componentProps.picker || "date") !== D.picker && !m && o.value && (o.value = void 0, o.initialValue = void 0, n.default = void 0,
|
|
23201
|
+
(o.componentProps.picker || "date") !== D.picker && !m && o.value && (o.value = void 0, o.initialValue = void 0, n.default = void 0, $.default = void 0), $["x-component-props"] = o.componentProps || {}, n["x-component-props"] = x(x({}, o.componentProps || {}), D), $["x-component-props"] = n["x-component-props"], o.componentProps = n["x-component-props"];
|
|
23178
23202
|
const z = o.path.entire.split(".");
|
|
23179
23203
|
z.pop();
|
|
23180
23204
|
const L = z.join(".");
|
|
23181
|
-
o.query(`${L}.*[0:].${n.name}`).forEach((
|
|
23182
|
-
|
|
23205
|
+
o.query(`${L}.*[0:].${n.name}`).forEach((B) => {
|
|
23206
|
+
B.props.name === n.name && ((o.componentProps.picker || "date") !== D.picker && !m && (B.value = void 0, B.initialValue = void 0), B.setComponentProps(x({}, D)));
|
|
23183
23207
|
}), r.emit("patch", {
|
|
23184
|
-
schema:
|
|
23208
|
+
schema: $
|
|
23185
23209
|
}), r.refresh();
|
|
23186
23210
|
}
|
|
23187
23211
|
}
|
|
@@ -23210,7 +23234,7 @@ const getActionContext = (e) => {
|
|
|
23210
23234
|
R != null && R.target && (u = p(
|
|
23211
23235
|
`${R.target}.${((O = (j = o["x-component-props"]) == null ? void 0 : j.fieldNames) == null ? void 0 : O.label) || "id"}`
|
|
23212
23236
|
));
|
|
23213
|
-
const D = (R == null ? void 0 : R.interface) === "m2o" && findParentFieldSchema(o),
|
|
23237
|
+
const D = (R == null ? void 0 : R.interface) === "m2o" && findParentFieldSchema(o), $ = D && p(D == null ? void 0 : D["x-collection-field"]), z = useTableBlockContext(), L = (R == null ? void 0 : R.interface) === "m2m" || ($ == null ? void 0 : $.type) === "hasMany" && (R == null ? void 0 : R.interface) === "m2o", B = useCallback(
|
|
23214
23238
|
(q) => {
|
|
23215
23239
|
const E = q.find((G) => G.value === "$nForm"), U = m(A);
|
|
23216
23240
|
return !(U != null && U.length) && E && (E.children = formatVariableScop(y())), q;
|
|
@@ -23241,7 +23265,7 @@ const getActionContext = (e) => {
|
|
|
23241
23265
|
className: defaultInputStyle,
|
|
23242
23266
|
form: S,
|
|
23243
23267
|
record: b,
|
|
23244
|
-
returnScope:
|
|
23268
|
+
returnScope: B,
|
|
23245
23269
|
shouldChange: getShouldChange({
|
|
23246
23270
|
collectionField: R,
|
|
23247
23271
|
variables: g,
|
|
@@ -23286,12 +23310,12 @@ const getActionContext = (e) => {
|
|
|
23286
23310
|
L,
|
|
23287
23311
|
f,
|
|
23288
23312
|
b,
|
|
23289
|
-
|
|
23313
|
+
B,
|
|
23290
23314
|
a,
|
|
23291
23315
|
z.collection,
|
|
23292
23316
|
u,
|
|
23293
23317
|
g
|
|
23294
|
-
]),
|
|
23318
|
+
]), N = useCallback(
|
|
23295
23319
|
(q) => {
|
|
23296
23320
|
var U, G, H;
|
|
23297
23321
|
const E = {
|
|
@@ -23311,7 +23335,7 @@ const getActionContext = (e) => {
|
|
|
23311
23335
|
components: w,
|
|
23312
23336
|
width: 800,
|
|
23313
23337
|
schema: M,
|
|
23314
|
-
onSubmit:
|
|
23338
|
+
onSubmit: N,
|
|
23315
23339
|
ModalContextProvider: (q) => /* @__PURE__ */ jsx(FlagProvider, { isInSubForm: v, isInSubTable: F, isInSetDefaultValueDialog: !0, children: q.children })
|
|
23316
23340
|
}
|
|
23317
23341
|
);
|
|
@@ -24080,13 +24104,13 @@ const useGetFilterOptions = () => {
|
|
|
24080
24104
|
};
|
|
24081
24105
|
});
|
|
24082
24106
|
}, TableColumnDesigner$1 = (e) => {
|
|
24083
|
-
var z, L,
|
|
24084
|
-
const { uiSchema: t, fieldSchema: n, collectionField: o } = e, { form: r } = useFormBlockContext(), { getInterface: i, getCollection: a } = useCollectionManager_deprecated(), l = useField(), { t: c } = useTranslation(), u = useFieldSchema(), { dn: d } = useDesignable(), p = ((z = n == null ? void 0 : n["x-component-props"]) == null ? void 0 : z.fieldNames) || ((L = t == null ? void 0 : t["x-component-props"]) == null ? void 0 : L.fieldNames), m = useLabelFields$1((
|
|
24107
|
+
var z, L, B, w, M, N, k, j, O, q, E, U;
|
|
24108
|
+
const { uiSchema: t, fieldSchema: n, collectionField: o } = e, { form: r } = useFormBlockContext(), { getInterface: i, getCollection: a } = useCollectionManager_deprecated(), l = useField(), { t: c } = useTranslation(), u = useFieldSchema(), { dn: d } = useDesignable(), p = ((z = n == null ? void 0 : n["x-component-props"]) == null ? void 0 : z.fieldNames) || ((L = t == null ? void 0 : t["x-component-props"]) == null ? void 0 : L.fieldNames), m = useLabelFields$1((B = o == null ? void 0 : o.target) != null ? B : o == null ? void 0 : o.targetCollection), h = useColorFields((w = o == null ? void 0 : o.target) != null ? w : o == null ? void 0 : o.targetCollection), g = i(o == null ? void 0 : o.interface), f = a(o == null ? void 0 : o.target), C = isFileCollection$2(f), b = ["QuickEdit", "FormItem"].includes(n["x-decorator"]), { currentMode: S } = useAssociationFieldContext(), { isAllowToSetDefaultValue: y } = useIsAllowToSetDefaultValue({ collectionField: o, fieldSchema: n }), v = ["datetime", "createdAt", "updatedAt"].includes(o == null ? void 0 : o.interface), F = ["obo", "oho", "o2o", "o2m", "m2m", "m2o", "snapshot"].includes(
|
|
24085
24109
|
o == null ? void 0 : o.interface
|
|
24086
24110
|
), A = useFieldModeOptions({ fieldSchema: n }), R = ((M = n == null ? void 0 : n["x-component-props"]) == null ? void 0 : M.mode) || "Select";
|
|
24087
24111
|
let T = "editable";
|
|
24088
24112
|
n["x-disabled"] === !0 && (T = "readonly"), n["x-read-pretty"] === !0 && (T = "read-pretty");
|
|
24089
|
-
const D = F && R === "Select",
|
|
24113
|
+
const D = F && R === "Select", $ = () => {
|
|
24090
24114
|
const { name: G } = useCollection(), { linkageRulesProps: H } = useSchemaToolbar();
|
|
24091
24115
|
return /* @__PURE__ */ jsx(SchemaSettingsLinkageRules, x({ category: "style" }, P(x({}, H), { collectionName: G })));
|
|
24092
24116
|
};
|
|
@@ -24102,7 +24126,7 @@ const useGetFilterOptions = () => {
|
|
|
24102
24126
|
title: {
|
|
24103
24127
|
title: c("Column title"),
|
|
24104
24128
|
default: u == null ? void 0 : u.title,
|
|
24105
|
-
description: `${c("Original field title: ")}${((
|
|
24129
|
+
description: `${c("Original field title: ")}${((N = o == null ? void 0 : o.uiSchema) == null ? void 0 : N.title) || (n == null ? void 0 : n.title)}`,
|
|
24106
24130
|
"x-decorator": "FormItem",
|
|
24107
24131
|
"x-component": "Input",
|
|
24108
24132
|
"x-component-props": {}
|
|
@@ -24168,7 +24192,7 @@ const useGetFilterOptions = () => {
|
|
|
24168
24192
|
}
|
|
24169
24193
|
}
|
|
24170
24194
|
),
|
|
24171
|
-
/* @__PURE__ */ jsx(
|
|
24195
|
+
/* @__PURE__ */ jsx($, {}),
|
|
24172
24196
|
g && g.sortable === !0 && !S && /* @__PURE__ */ jsx(
|
|
24173
24197
|
SchemaSettingsSwitchItem,
|
|
24174
24198
|
{
|
|
@@ -25318,12 +25342,12 @@ function useCollectValuesToSubmit() {
|
|
|
25318
25342
|
resource: o,
|
|
25319
25343
|
actionFields: (d == null ? void 0 : d("form")) || []
|
|
25320
25344
|
}), S = {}, y = Object.keys(f).map((D) => V(this, null, function* () {
|
|
25321
|
-
const
|
|
25322
|
-
if (isVariable(
|
|
25323
|
-
const { value: L } = (yield p == null ? void 0 : p.parseVariable(
|
|
25345
|
+
const $ = f[D], z = i(D);
|
|
25346
|
+
if (isVariable($)) {
|
|
25347
|
+
const { value: L } = (yield p == null ? void 0 : p.parseVariable($, m)) || {};
|
|
25324
25348
|
L != null && (S[D] = transformVariableValue(L, { targetCollectionField: z }));
|
|
25325
25349
|
} else
|
|
25326
|
-
|
|
25350
|
+
$ != null && $ !== "" && (S[D] = $);
|
|
25327
25351
|
}));
|
|
25328
25352
|
if (yield Promise.all(y), (A = u == null ? void 0 : u["x-component-props"]) == null ? void 0 : A.addChild) {
|
|
25329
25353
|
const D = a();
|
|
@@ -25353,8 +25377,8 @@ const useCreateActionProps = () => {
|
|
|
25353
25377
|
return {
|
|
25354
25378
|
onClick() {
|
|
25355
25379
|
return V(this, null, function* () {
|
|
25356
|
-
var
|
|
25357
|
-
const { onSuccess: v, skipValidator: F, triggerWorkflows: A } = (
|
|
25380
|
+
var B;
|
|
25381
|
+
const { onSuccess: v, skipValidator: F, triggerWorkflows: A } = (B = u == null ? void 0 : u["x-action-settings"]) != null ? B : {}, { manualClose: R, redirecting: T, redirectTo: D, successMessage: $, actionAfterSuccess: z } = v || {};
|
|
25358
25382
|
F || (yield n.submit());
|
|
25359
25383
|
const L = yield f();
|
|
25360
25384
|
d.data = o.data || {}, d.data.loading = !0;
|
|
@@ -25367,16 +25391,16 @@ const useCreateActionProps = () => {
|
|
|
25367
25391
|
triggerWorkflows: A != null && A.length ? A.map((M) => [M.workflowKey, M.context].filter(Boolean).join("!")).join(",") : void 0,
|
|
25368
25392
|
updateAssociationValues: g
|
|
25369
25393
|
});
|
|
25370
|
-
if ((z === "previous" || !z && T !== !0) && (i == null || i(!1)), a == null || a(!0), l == null || l(!1), d.data.loading = !1, d.data.data = w,
|
|
25394
|
+
if ((z === "previous" || !z && T !== !0) && (i == null || i(!1)), a == null || a(!0), l == null || l(!1), d.data.loading = !1, d.data.data = w, !$) {
|
|
25371
25395
|
message.success(h("Saved successfully")), yield resetFormCorrectly(n), (T && !z || z === "redirect") && D && (isURL(D) ? window.location.href = D : c(D));
|
|
25372
25396
|
return;
|
|
25373
25397
|
}
|
|
25374
25398
|
R ? m.success({
|
|
25375
|
-
title: p(
|
|
25399
|
+
title: p($),
|
|
25376
25400
|
onOk: () => V(this, null, function* () {
|
|
25377
25401
|
yield resetFormCorrectly(n), (T && !z || z === "redirect") && D && (isURL(D) ? window.location.href = D : c(D));
|
|
25378
25402
|
})
|
|
25379
|
-
}) : (message.success(p(
|
|
25403
|
+
}) : (message.success(p($)), yield resetFormCorrectly(n), (T && !z || z === "redirect") && D && (isURL(D) ? window.location.href = D : c(D)));
|
|
25380
25404
|
} catch (w) {
|
|
25381
25405
|
d.data.loading = !1;
|
|
25382
25406
|
}
|
|
@@ -25393,10 +25417,10 @@ const useCreateActionProps = () => {
|
|
|
25393
25417
|
const R = u.map((H) => H.name), {
|
|
25394
25418
|
assignedValues: T = {},
|
|
25395
25419
|
onSuccess: D,
|
|
25396
|
-
overwriteValues:
|
|
25420
|
+
overwriteValues: $,
|
|
25397
25421
|
skipValidator: z,
|
|
25398
25422
|
triggerWorkflows: L
|
|
25399
|
-
} = (j = l == null ? void 0 : l["x-action-settings"]) != null ? j : {},
|
|
25423
|
+
} = (j = l == null ? void 0 : l["x-action-settings"]) != null ? j : {}, B = (O = i == null ? void 0 : i["x-component-props"]) == null ? void 0 : O.addChild, { successMessage: w } = D || {}, M = {}, N = Object.keys(T).map((H) => V(this, null, function* () {
|
|
25400
25424
|
const W = T[H], X = d(H);
|
|
25401
25425
|
if (isVariable(W)) {
|
|
25402
25426
|
const { value: Y } = (yield C == null ? void 0 : C.parseVariable(W, b)) || {};
|
|
@@ -25404,7 +25428,7 @@ const useCreateActionProps = () => {
|
|
|
25404
25428
|
} else
|
|
25405
25429
|
W != null && W !== "" && (M[H] = W);
|
|
25406
25430
|
}));
|
|
25407
|
-
yield Promise.all(
|
|
25431
|
+
yield Promise.all(N), z || (yield e.submit());
|
|
25408
25432
|
const k = getFormValues({
|
|
25409
25433
|
filterByTk: g,
|
|
25410
25434
|
field: t,
|
|
@@ -25414,14 +25438,14 @@ const useCreateActionProps = () => {
|
|
|
25414
25438
|
resource: n,
|
|
25415
25439
|
actionFields: (S == null ? void 0 : S("form")) || []
|
|
25416
25440
|
});
|
|
25417
|
-
if (
|
|
25441
|
+
if (B) {
|
|
25418
25442
|
const H = p();
|
|
25419
25443
|
k[(q = H == null ? void 0 : H.name) != null ? q : "parent"] = f, k[(E = H == null ? void 0 : H.foreignKey) != null ? E : "parentId"] = f.id;
|
|
25420
25444
|
}
|
|
25421
25445
|
c.data = t.data || {}, c.data.loading = !0;
|
|
25422
25446
|
try {
|
|
25423
25447
|
const H = yield n[y]({
|
|
25424
|
-
values: x(x(x({}, k),
|
|
25448
|
+
values: x(x(x({}, k), $), M),
|
|
25425
25449
|
filterKeys: v,
|
|
25426
25450
|
// TODO(refactor): should change to inject by plugin
|
|
25427
25451
|
triggerWorkflows: L != null && L.length ? L.map((W) => [W.workflowKey, W.context].filter(Boolean).join("!")).join(",") : void 0
|
|
@@ -25533,26 +25557,26 @@ const useCreateActionProps = () => {
|
|
|
25533
25557
|
return {
|
|
25534
25558
|
onClick(f, C) {
|
|
25535
25559
|
return V(this, null, function* () {
|
|
25536
|
-
var L,
|
|
25560
|
+
var L, B, w;
|
|
25537
25561
|
const {
|
|
25538
25562
|
assignedValues: b = {},
|
|
25539
25563
|
onSuccess: S,
|
|
25540
25564
|
skipValidator: y,
|
|
25541
25565
|
triggerWorkflows: v
|
|
25542
|
-
} = (L = r == null ? void 0 : r["x-action-settings"]) != null ? L : {}, { manualClose: F, redirecting: A, redirectTo: R, successMessage: T, actionAfterSuccess: D } = S || {},
|
|
25543
|
-
const
|
|
25544
|
-
if (isVariable(
|
|
25545
|
-
const { value: j } = (yield u == null ? void 0 : u.parseVariable(
|
|
25546
|
-
j && (
|
|
25566
|
+
} = (L = r == null ? void 0 : r["x-action-settings"]) != null ? L : {}, { manualClose: F, redirecting: A, redirectTo: R, successMessage: T, actionAfterSuccess: D } = S || {}, $ = {}, z = Object.keys(b).map((M) => V(this, null, function* () {
|
|
25567
|
+
const N = b[M], k = m(M);
|
|
25568
|
+
if (isVariable(N)) {
|
|
25569
|
+
const { value: j } = (yield u == null ? void 0 : u.parseVariable(N, d)) || {};
|
|
25570
|
+
j && ($[M] = transformVariableValue(j, { targetCollectionField: k }));
|
|
25547
25571
|
} else
|
|
25548
|
-
|
|
25572
|
+
N != null && N !== "" && ($[M] = N);
|
|
25549
25573
|
}));
|
|
25550
25574
|
yield Promise.all(z), y === !1 && (yield l.submit()), yield e.update({
|
|
25551
25575
|
filterByTk: o,
|
|
25552
|
-
values: x({},
|
|
25576
|
+
values: x({}, $),
|
|
25553
25577
|
// TODO(refactor): should change to inject by plugin
|
|
25554
25578
|
triggerWorkflows: v != null && v.length ? v.map((M) => [M.workflowKey, M.context].filter(Boolean).join("!")).join(",") : void 0
|
|
25555
|
-
}), (D === "previous" || !D && A !== !0) && (h == null || h(!1)), C && (C == null || C()), e instanceof TableFieldResource || (w = (
|
|
25579
|
+
}), (D === "previous" || !D && A !== !0) && (h == null || h(!1)), C && (C == null || C()), e instanceof TableFieldResource || (w = (B = t == null ? void 0 : t.service) == null ? void 0 : B.refresh) == null || w.call(B), T && (F ? c.success({
|
|
25556
25580
|
title: a(T),
|
|
25557
25581
|
onOk: () => V(this, null, function* () {
|
|
25558
25582
|
(A && !D || D === "redirect") && R && (isURL(R) ? window.location.href = R : i(R));
|
|
@@ -25573,29 +25597,29 @@ const useCreateActionProps = () => {
|
|
|
25573
25597
|
const {
|
|
25574
25598
|
assignedValues: T = {},
|
|
25575
25599
|
onSuccess: D,
|
|
25576
|
-
updateMode:
|
|
25577
|
-
} = (j = i == null ? void 0 : i["x-action-settings"]) != null ? j : {}, { manualClose: z, redirecting: L, redirectTo:
|
|
25600
|
+
updateMode: $
|
|
25601
|
+
} = (j = i == null ? void 0 : i["x-action-settings"]) != null ? j : {}, { manualClose: z, redirecting: L, redirectTo: B, successMessage: w, actionAfterSuccess: M } = D || {};
|
|
25578
25602
|
m.data = e.data || {}, m.data.loading = !0;
|
|
25579
|
-
const
|
|
25603
|
+
const N = {}, k = Object.keys(T).map((q) => V(this, null, function* () {
|
|
25580
25604
|
const E = T[q], U = C(q);
|
|
25581
25605
|
if (isVariable(E)) {
|
|
25582
25606
|
const { value: G } = (yield g == null ? void 0 : g.parseVariable(E, b)) || {};
|
|
25583
|
-
G && (
|
|
25607
|
+
G && (N[q] = transformVariableValue(G, { targetCollectionField: U }));
|
|
25584
25608
|
} else
|
|
25585
|
-
E != null && E !== "" && (
|
|
25609
|
+
E != null && E !== "" && (N[q] = E);
|
|
25586
25610
|
}));
|
|
25587
25611
|
yield Promise.all(k), (M === "previous" || !M && L !== !0) && (S == null || S(!1)), h.confirm({
|
|
25588
25612
|
title: p("Bulk update"),
|
|
25589
|
-
content: p(
|
|
25613
|
+
content: p($ === "selected" ? "Update selected data?" : "Update all data?"),
|
|
25590
25614
|
onOk() {
|
|
25591
25615
|
return V(this, null, function* () {
|
|
25592
25616
|
var U, G, H, W;
|
|
25593
25617
|
const { filter: q } = (G = (U = o.params) == null ? void 0 : U[0]) != null ? G : {}, E = {
|
|
25594
|
-
values: x({},
|
|
25618
|
+
values: x({}, N),
|
|
25595
25619
|
filter: q,
|
|
25596
25620
|
forceUpdate: !1
|
|
25597
25621
|
};
|
|
25598
|
-
if (
|
|
25622
|
+
if ($ === "selected") {
|
|
25599
25623
|
if (!(c != null && c.length)) {
|
|
25600
25624
|
message.error(p("Please select the records to be updated")), m.data.loading = !1;
|
|
25601
25625
|
return;
|
|
@@ -25612,9 +25636,9 @@ const useCreateActionProps = () => {
|
|
|
25612
25636
|
t instanceof TableFieldResource || (W = (H = n == null ? void 0 : n.service) == null ? void 0 : H.refresh) == null || W.call(H), w && (z ? h.success({
|
|
25613
25637
|
title: d(w),
|
|
25614
25638
|
onOk: () => V(this, null, function* () {
|
|
25615
|
-
(L && !M || M === "redirect") &&
|
|
25639
|
+
(L && !M || M === "redirect") && B && (isURL(B) ? window.location.href = B : u(B));
|
|
25616
25640
|
})
|
|
25617
|
-
}) : (message.success(d(w)), (L && !M || M === "redirect") &&
|
|
25641
|
+
}) : (message.success(d(w)), (L && !M || M === "redirect") && B && (isURL(B) ? window.location.href = B : u(B))));
|
|
25618
25642
|
});
|
|
25619
25643
|
},
|
|
25620
25644
|
onCancel() {
|
|
@@ -25633,11 +25657,11 @@ const useCreateActionProps = () => {
|
|
|
25633
25657
|
onClick() {
|
|
25634
25658
|
return V(this, null, function* () {
|
|
25635
25659
|
var q, E, U, G;
|
|
25636
|
-
const { skipValidator: A, onSuccess: R, requestSettings: T } = (q = o == null ? void 0 : o["x-action-settings"]) != null ? q : {}, { manualClose: D, redirecting:
|
|
25660
|
+
const { skipValidator: A, onSuccess: R, requestSettings: T } = (q = o == null ? void 0 : o["x-action-settings"]) != null ? q : {}, { manualClose: D, redirecting: $, redirectTo: z, successMessage: L, actionAfterSuccess: B } = R || {}, w = o == null ? void 0 : o["x-action"];
|
|
25637
25661
|
if (!T.url)
|
|
25638
25662
|
return;
|
|
25639
25663
|
A !== !0 && w === "customize:form:request" && (yield i.submit());
|
|
25640
|
-
const M = T.headers ? JSON.parse(T.headers) : {},
|
|
25664
|
+
const M = T.headers ? JSON.parse(T.headers) : {}, N = T.params ? JSON.parse(T.params) : {}, k = T.data ? JSON.parse(T.data) : {};
|
|
25641
25665
|
if (w === "customize:form:request" && ["POST", "PUT", "PATCH"].includes(T.method)) {
|
|
25642
25666
|
const H = a.map((X) => X.name), W = getFormValues({
|
|
25643
25667
|
filterByTk: n,
|
|
@@ -25654,15 +25678,15 @@ const useCreateActionProps = () => {
|
|
|
25654
25678
|
url: renderTemplate(T.url, { currentRecord: m, currentUser: g }),
|
|
25655
25679
|
method: T.method,
|
|
25656
25680
|
headers: parse(M)({ currentRecord: m, currentUser: g }),
|
|
25657
|
-
params: parse(
|
|
25681
|
+
params: parse(N)({ currentRecord: m, currentUser: g }),
|
|
25658
25682
|
data: parse(k)({ currentRecord: m, currentUser: g })
|
|
25659
25683
|
};
|
|
25660
25684
|
f.data = c.data || {}, f.data.loading = !0;
|
|
25661
25685
|
try {
|
|
25662
|
-
yield e.request(x({}, O)), f.data.loading = !1, u instanceof TableFieldResource || (U = (E = d == null ? void 0 : d.service) == null ? void 0 : E.refresh) == null || U.call(E), (G = p == null ? void 0 : p.refresh) == null || G.call(p), w === "customize:form:request" && (
|
|
25686
|
+
yield e.request(x({}, O)), f.data.loading = !1, u instanceof TableFieldResource || (U = (E = d == null ? void 0 : d.service) == null ? void 0 : E.refresh) == null || U.call(E), (G = p == null ? void 0 : p.refresh) == null || G.call(p), w === "customize:form:request" && (B === "previous" || !B && $ !== !0) && (b == null || b(!1)), L || (message.success(C("Saved successfully")), yield resetFormCorrectly(i), ($ && !B || B === "redirect") && z && (isURL(z) ? window.location.href = z : t(z))), D ? S.success({
|
|
25663
25687
|
title: r(L),
|
|
25664
25688
|
onOk: () => V(this, null, function* () {
|
|
25665
|
-
(
|
|
25689
|
+
($ && !B || B === "redirect") && z && (isURL(z) ? window.location.href = z : t(z));
|
|
25666
25690
|
})
|
|
25667
25691
|
}) : message.success(r(L));
|
|
25668
25692
|
} finally {
|
|
@@ -25681,9 +25705,9 @@ const useCreateActionProps = () => {
|
|
|
25681
25705
|
assignedValues: R = {},
|
|
25682
25706
|
onSuccess: T,
|
|
25683
25707
|
overwriteValues: D,
|
|
25684
|
-
skipValidator:
|
|
25708
|
+
skipValidator: $,
|
|
25685
25709
|
triggerWorkflows: z
|
|
25686
|
-
} = (E = l == null ? void 0 : l["x-action-settings"]) != null ? E : {}, { manualClose: L, redirecting:
|
|
25710
|
+
} = (E = l == null ? void 0 : l["x-action-settings"]) != null ? E : {}, { manualClose: L, redirecting: B, redirectTo: w, successMessage: M, actionAfterSuccess: N } = T || {}, k = {}, j = Object.keys(R).map((U) => V(this, null, function* () {
|
|
25687
25711
|
const G = R[U], H = d(U);
|
|
25688
25712
|
if (isVariable(G)) {
|
|
25689
25713
|
const { value: W } = (yield b == null ? void 0 : b.parseVariable(G, S)) || {};
|
|
@@ -25691,7 +25715,7 @@ const useCreateActionProps = () => {
|
|
|
25691
25715
|
} else
|
|
25692
25716
|
G != null && G !== "" && (k[U] = G);
|
|
25693
25717
|
}));
|
|
25694
|
-
yield Promise.all(j),
|
|
25718
|
+
yield Promise.all(j), $ || (yield e.submit());
|
|
25695
25719
|
const O = u.map((U) => U.name), q = getFormValues({
|
|
25696
25720
|
filterByTk: t,
|
|
25697
25721
|
field: n,
|
|
@@ -25710,14 +25734,14 @@ const useCreateActionProps = () => {
|
|
|
25710
25734
|
updateAssociationValues: g,
|
|
25711
25735
|
// TODO(refactor): should change to inject by plugin
|
|
25712
25736
|
triggerWorkflows: z != null && z.length ? z.map((U) => [U.workflowKey, U.context].filter(Boolean).join("!")).join(",") : void 0
|
|
25713
|
-
})), h.data.loading = !1, A && (A == null || A()), (
|
|
25737
|
+
})), h.data.loading = !1, A && (A == null || A()), (N === "previous" || !N && B !== !0) && (i == null || i(!1)), a == null || a(!1), !M)
|
|
25714
25738
|
return;
|
|
25715
25739
|
L ? f.success({
|
|
25716
25740
|
title: m(M),
|
|
25717
25741
|
onOk: () => V(this, null, function* () {
|
|
25718
|
-
yield e.reset(), (
|
|
25742
|
+
yield e.reset(), (B && !N || N === "redirect") && w && (isURL(w) ? window.location.href = w : c(w));
|
|
25719
25743
|
})
|
|
25720
|
-
}) : (message.success(m(M)), (
|
|
25744
|
+
}) : (message.success(m(M)), (B && !N || N === "redirect" || N === "redirect") && w && (isURL(w) ? window.location.href = w : c(w)));
|
|
25721
25745
|
} catch (U) {
|
|
25722
25746
|
h.data.loading = !1;
|
|
25723
25747
|
}
|
|
@@ -25874,7 +25898,7 @@ const useCreateActionProps = () => {
|
|
|
25874
25898
|
/** 渲染 Collapse 的列表数据 */
|
|
25875
25899
|
list: (d == null ? void 0 : d.data) || [],
|
|
25876
25900
|
onSelected: (F) => {
|
|
25877
|
-
var R, T, D,
|
|
25901
|
+
var R, T, D, $;
|
|
25878
25902
|
const A = ((T = (R = t.params) == null ? void 0 : R[1]) == null ? void 0 : T.filters) || {};
|
|
25879
25903
|
F.length ? A[`af.${c}`] = {
|
|
25880
25904
|
[`${c}.${i}.$in`]: F
|
|
@@ -25882,7 +25906,7 @@ const useCreateActionProps = () => {
|
|
|
25882
25906
|
P(x({}, (D = t.params) == null ? void 0 : D[0]), {
|
|
25883
25907
|
pageSize: 200,
|
|
25884
25908
|
page: 1,
|
|
25885
|
-
filter: mergeFilter([...Object.values(A), (
|
|
25909
|
+
filter: mergeFilter([...Object.values(A), ($ = n == null ? void 0 : n.params) == null ? void 0 : $.filter])
|
|
25886
25910
|
}),
|
|
25887
25911
|
{ filters: A }
|
|
25888
25912
|
);
|
|
@@ -25904,7 +25928,7 @@ const useCreateActionProps = () => {
|
|
|
25904
25928
|
var n;
|
|
25905
25929
|
return ["select", "multipleSelect", "checkbox", "checkboxGroup", "chinaRegion"].includes(e == null ? void 0 : e.interface) && ((n = e == null ? void 0 : e.uiSchema) == null ? void 0 : n.enum);
|
|
25906
25930
|
}, useAssociationFilterBlockProps = () => {
|
|
25907
|
-
var v, F, A, R, T, D,
|
|
25931
|
+
var v, F, A, R, T, D, $, z, L, B;
|
|
25908
25932
|
const e = AssociationFilter.useAssociationField(), t = useFieldSchema(), n = useOptionalFieldList(), { getDataBlocks: o } = useFilterBlock(), r = e == null ? void 0 : e.name, i = useField(), { props: a } = useBlockRequestContext(), l = useDataSourceHeaders(a == null ? void 0 : a.dataSource), c = useCollectionManager(), { filter: u, parseVariableLoading: d } = useParsedFilter({ filterOption: (F = (v = i.componentProps) == null ? void 0 : v.params) == null ? void 0 : F.filter });
|
|
25909
25933
|
let p, m, h, g, f, C, b, S;
|
|
25910
25934
|
C = e != null && e.target ? (A = c == null ? void 0 : c.getCollection(e.target)) == null ? void 0 : A.getPrimaryKey() : "id", b = ((T = (R = t["x-component-props"]) == null ? void 0 : R.fieldNames) == null ? void 0 : T.label) || C, { data: f, params: h, run: g } = useRequest(
|
|
@@ -25932,18 +25956,18 @@ const useCreateActionProps = () => {
|
|
|
25932
25956
|
b,
|
|
25933
25957
|
g,
|
|
25934
25958
|
C,
|
|
25935
|
-
(
|
|
25959
|
+
($ = i.componentProps) == null ? void 0 : $.params,
|
|
25936
25960
|
(L = (z = i.componentProps) == null ? void 0 : z.params) == null ? void 0 : L.sort,
|
|
25937
25961
|
d
|
|
25938
25962
|
]);
|
|
25939
25963
|
const y = useCallback(
|
|
25940
25964
|
(w) => {
|
|
25941
|
-
const { targets: M, uid:
|
|
25965
|
+
const { targets: M, uid: N } = findFilterTargets(t);
|
|
25942
25966
|
o().forEach((k) => {
|
|
25943
25967
|
var G, H, W;
|
|
25944
25968
|
if (!M.find((X) => X.uid === k.uid))
|
|
25945
25969
|
return;
|
|
25946
|
-
const O = `${
|
|
25970
|
+
const O = `${N}${t.name}`, q = ((G = k.service.params) == null ? void 0 : G[0]) || {};
|
|
25947
25971
|
(W = (H = k.service.params) == null ? void 0 : H[1]) != null && W.filters || _.set(k.service.params, "[1].filters", {});
|
|
25948
25972
|
const E = k.service.params[1].filters;
|
|
25949
25973
|
if (w.length)
|
|
@@ -25975,15 +25999,15 @@ const useCreateActionProps = () => {
|
|
|
25975
25999
|
multipleSelect: "$anyOf",
|
|
25976
26000
|
checkbox: "$in",
|
|
25977
26001
|
checkboxGroup: "$anyOf"
|
|
25978
|
-
},
|
|
25979
|
-
C = "value", b = "label", p =
|
|
26002
|
+
}, N = ((B = w == null ? void 0 : w.uiSchema) == null ? void 0 : B.enum) || [];
|
|
26003
|
+
C = "value", b = "label", p = N, h = {}, g = () => {
|
|
25980
26004
|
}, S = `${w.name}.${M[w.interface]}`, m = (k) => {
|
|
25981
26005
|
const j = k.target.value;
|
|
25982
26006
|
if (!j) {
|
|
25983
|
-
p =
|
|
26007
|
+
p = N;
|
|
25984
26008
|
return;
|
|
25985
26009
|
}
|
|
25986
|
-
p =
|
|
26010
|
+
p = N.filter((O) => O.label.includes(j));
|
|
25987
26011
|
};
|
|
25988
26012
|
} else
|
|
25989
26013
|
S = `${r}.${C}.$in`, p = (f == null ? void 0 : f.data) || [], m = (w) => {
|
|
@@ -26265,31 +26289,31 @@ const useSyncFromForm = (e, t, n) => {
|
|
|
26265
26289
|
return T;
|
|
26266
26290
|
if (S > y)
|
|
26267
26291
|
return [];
|
|
26268
|
-
const D = r(C).map((
|
|
26292
|
+
const D = r(C).map(($) => {
|
|
26269
26293
|
var w;
|
|
26270
|
-
if (b.includes(
|
|
26294
|
+
if (b.includes($.name) || !$.interface || ["sort", "password", "sequence"].includes($.type))
|
|
26271
26295
|
return;
|
|
26272
26296
|
const z = {
|
|
26273
26297
|
type: "duplicate",
|
|
26274
|
-
tag: c((w =
|
|
26298
|
+
tag: c((w = $.uiSchema) == null ? void 0 : w.title) || $.name
|
|
26275
26299
|
}, L = P(x({}, z), {
|
|
26276
26300
|
title: React.createElement(TreeNode, z),
|
|
26277
|
-
key: v ? `${v}.${
|
|
26301
|
+
key: v ? `${v}.${$.name}` : $.name,
|
|
26278
26302
|
isLeaf: !0,
|
|
26279
|
-
field:
|
|
26303
|
+
field: $,
|
|
26280
26304
|
disabled: F
|
|
26281
|
-
}),
|
|
26282
|
-
if (["belongsTo", "belongsToMany"].includes(
|
|
26283
|
-
z.type = "reference", L.type = "reference", L.title = React.createElement(TreeNode, P(x({}, z), { type: "reference" })), L.isLeaf = !1, L.children = m(
|
|
26305
|
+
}), B = A.find((M) => M.name === L.key);
|
|
26306
|
+
if (["belongsTo", "belongsToMany"].includes($.type) && (!B || ["Select", "Picker"].includes(B == null ? void 0 : B.fieldMode)))
|
|
26307
|
+
z.type = "reference", L.type = "reference", L.title = React.createElement(TreeNode, P(x({}, z), { type: "reference" })), L.isLeaf = !1, L.children = m($.target, {
|
|
26284
26308
|
depth: S + 1,
|
|
26285
26309
|
maxDepth: y,
|
|
26286
26310
|
prefix: L.key,
|
|
26287
26311
|
exclude: systemKeys
|
|
26288
26312
|
});
|
|
26289
|
-
else if (["hasOne", "hasMany"].includes(
|
|
26313
|
+
else if (["hasOne", "hasMany"].includes($.type) || ["Nester", "SubTable"].includes(B == null ? void 0 : B.fieldMode)) {
|
|
26290
26314
|
let M = !1;
|
|
26291
|
-
["hasOne", "hasMany"].includes(
|
|
26292
|
-
|
|
26315
|
+
["hasOne", "hasMany"].includes($.type) && ["Select", "Picker"].includes(B == null ? void 0 : B.fieldMode) && (M = !0), L.disabled = !0, L.isLeaf = !1, L.children = p(
|
|
26316
|
+
$.target,
|
|
26293
26317
|
{
|
|
26294
26318
|
depth: S + 1,
|
|
26295
26319
|
maxDepth: y,
|
|
@@ -26316,16 +26340,16 @@ const useSyncFromForm = (e, t, n) => {
|
|
|
26316
26340
|
const D = {
|
|
26317
26341
|
type: "preloading",
|
|
26318
26342
|
tag: c((z = T.uiSchema) == null ? void 0 : z.title) || T.name
|
|
26319
|
-
},
|
|
26343
|
+
}, $ = b ? `${b}.${T.name}` : T.name;
|
|
26320
26344
|
return {
|
|
26321
26345
|
type: "preloading",
|
|
26322
26346
|
tag: c((L = T.uiSchema) == null ? void 0 : L.title) || T.name,
|
|
26323
26347
|
title: React.createElement(TreeNode, D),
|
|
26324
|
-
key:
|
|
26348
|
+
key: $,
|
|
26325
26349
|
isLeaf: !1,
|
|
26326
26350
|
field: T,
|
|
26327
26351
|
children: m(T.target, {
|
|
26328
|
-
prefix:
|
|
26352
|
+
prefix: $,
|
|
26329
26353
|
depth: y + 1,
|
|
26330
26354
|
maxDepth: S,
|
|
26331
26355
|
exclude: v
|
|
@@ -26349,10 +26373,10 @@ const useSyncFromForm = (e, t, n) => {
|
|
|
26349
26373
|
const f = /* @__PURE__ */ new Set([]), C = /* @__PURE__ */ new Set([]), b = (v, F) => {
|
|
26350
26374
|
var A;
|
|
26351
26375
|
(A = v == null ? void 0 : v.reduceProperties) == null || A.call(v, (R, T) => {
|
|
26352
|
-
var M,
|
|
26353
|
-
const D = R || F,
|
|
26354
|
-
if (
|
|
26355
|
-
if (f.add({ name: w, fieldMode: ((
|
|
26376
|
+
var M, N, k;
|
|
26377
|
+
const D = R || F, $ = T["x-collection-field"] && o(T["x-collection-field"]), z = T.name.includes("."), L = $ && ["hasOne", "hasMany", "belongsTo", "belongsToMany"].includes($.type), B = !L && z ? getAssociationPath(T.name) : T.name, w = D === "" || !D ? B : D + "." + B;
|
|
26378
|
+
if ($ && !(["hasOne", "hasMany"].includes($.type) || ["SubForm", "Nester"].includes((M = T["x-component-props"]) == null ? void 0 : M.mode)) && C.add(w), $ && (L || z) && T["x-component"] !== "TableField") {
|
|
26379
|
+
if (f.add({ name: w, fieldMode: ((N = T["x-component-props"]) == null ? void 0 : N.mode) || "Select" }), ["Nester", "SubTable"].includes((k = T["x-component-props"]) == null ? void 0 : k.mode)) {
|
|
26356
26380
|
const j = D && D !== "" ? D + "." + T.name : T.name;
|
|
26357
26381
|
b(T, j);
|
|
26358
26382
|
}
|
|
@@ -27349,7 +27373,7 @@ const useParseDefaultValue = () => {
|
|
|
27349
27373
|
if (n && e && (isVariable(t.default) && e.value == null || e.value === t.default || R)) {
|
|
27350
27374
|
isVariable(e.value) && (yield e.reset({ forceClear: !0 })), e.loading = !0;
|
|
27351
27375
|
const D = !t.name.toString().includes(".") && (d == null ? void 0 : d.getField(t.name)), {
|
|
27352
|
-
value:
|
|
27376
|
+
value: $,
|
|
27353
27377
|
collectionName: z,
|
|
27354
27378
|
dataSource: L = "main"
|
|
27355
27379
|
} = yield n.parseVariable(t.default, o, {
|
|
@@ -27364,10 +27388,10 @@ const useParseDefaultValue = () => {
|
|
|
27364
27388
|
e.loading = !1;
|
|
27365
27389
|
return;
|
|
27366
27390
|
}
|
|
27367
|
-
const
|
|
27391
|
+
const B = transformVariableValue($, {
|
|
27368
27392
|
targetCollectionField: D
|
|
27369
27393
|
});
|
|
27370
|
-
|
|
27394
|
+
B == null || B === "" ? e.mounted && (e.setInitialValue(null), yield e.reset({ forceClear: !0 })) : p() ? h === 0 && m(B) : e.setInitialValue(B), e.loading = !1;
|
|
27371
27395
|
} else
|
|
27372
27396
|
!/\{\{.+\}\}/g.test(t.default) && e.setInitialValue && e.setInitialValue(t.default);
|
|
27373
27397
|
}), v = _.debounce(y, DEBOUNCE_WAIT);
|
|
@@ -27375,7 +27399,7 @@ const useParseDefaultValue = () => {
|
|
|
27375
27399
|
const R = getVariableName(t.default), T = S(R);
|
|
27376
27400
|
return T ? (y(), reaction(
|
|
27377
27401
|
() => {
|
|
27378
|
-
const
|
|
27402
|
+
const $ = { [R]: (T == null ? void 0 : T.ctx) || {} }, z = getPath(t.default), L = getValuesByPath($, z);
|
|
27379
27403
|
return L === void 0 ? Math.random() : L;
|
|
27380
27404
|
},
|
|
27381
27405
|
() => v({ forceUpdate: !0 }),
|
|
@@ -28754,24 +28778,24 @@ function Input$1(e) {
|
|
|
28754
28778
|
hideVariableButton: m
|
|
28755
28779
|
} = e, h = typeof e.scope == "function" ? e.scope() : e.scope, { wrapSSR: g, hashId: f, componentCls: C, rootPrefixCls: b } = useStyles$b({ hideVariableButton: m });
|
|
28756
28780
|
useAntdInputStyle(`${b}-input`);
|
|
28757
|
-
const S = useCompile(), { t: y } = useTranslation(), v = useForm(), [F, A] = React.useState([]), [R, T] = React.useState([]), [D,
|
|
28781
|
+
const S = useCompile(), { t: y } = useTranslation(), v = useForm(), [F, A] = React.useState([]), [R, T] = React.useState([]), [D, $] = React.useState(
|
|
28758
28782
|
m || !!(o && t != null)
|
|
28759
|
-
), z = useMemo(() => parseValue(t, p), [p, t]), L = typeof z == "string",
|
|
28783
|
+
), z = useMemo(() => parseValue(t, p), [p, t]), L = typeof z == "string", B = L ? z : "", w = L ? null : z, M = Object.assign(
|
|
28760
28784
|
{
|
|
28761
28785
|
label: "label",
|
|
28762
28786
|
value: "value",
|
|
28763
28787
|
children: "children"
|
|
28764
28788
|
},
|
|
28765
28789
|
d != null ? d : {}
|
|
28766
|
-
),
|
|
28790
|
+
), N = useMemo(() => o ? {
|
|
28767
28791
|
value: "$",
|
|
28768
28792
|
label: y("Constant"),
|
|
28769
28793
|
[M.value]: "$",
|
|
28770
28794
|
[M.label]: y("Constant")
|
|
28771
|
-
} : i ? getTypedConstantOption(
|
|
28795
|
+
} : i ? getTypedConstantOption(B, i, M) : null, [B, i]), k = (H = N == null ? void 0 : N.component) != null ? H : NullComponent, j = Array.isArray(i) ? (X = (W = i.find((Y) => Array.isArray(Y) && Y[0] === B)) == null ? void 0 : W[1]) != null ? X : {} : {};
|
|
28772
28796
|
let O;
|
|
28773
|
-
t == null ? a ? o && D ? O = ["$"] : O = [""] : o ? O = ["$"] : O = [" ",
|
|
28774
|
-
const ee =
|
|
28797
|
+
t == null ? a ? o && D ? O = ["$"] : O = [""] : o ? O = ["$"] : O = [" ", B] : O = o ? ["$"] : [" ", B], m && (O = ["$"]), useEffect(() => {
|
|
28798
|
+
const ee = N != null ? N : {}, { component: Y } = ee, J = K(ee, ["component"]), Q = [
|
|
28775
28799
|
...a ? [
|
|
28776
28800
|
{
|
|
28777
28801
|
value: "",
|
|
@@ -28780,11 +28804,11 @@ function Input$1(e) {
|
|
|
28780
28804
|
[M.label]: y("Null")
|
|
28781
28805
|
}
|
|
28782
28806
|
] : [],
|
|
28783
|
-
...
|
|
28807
|
+
...N ? [S(J)] : [],
|
|
28784
28808
|
...h ? [...h] : []
|
|
28785
28809
|
].filter((oe) => !oe.deprecated || (w == null ? void 0 : w[0]) === oe[M.value]);
|
|
28786
28810
|
A(Q);
|
|
28787
|
-
}, [h, w,
|
|
28811
|
+
}, [h, w, N, a]);
|
|
28788
28812
|
const q = (Y) => V(this, null, function* () {
|
|
28789
28813
|
var Q;
|
|
28790
28814
|
const J = Y[Y.length - 1];
|
|
@@ -28803,29 +28827,29 @@ function Input$1(e) {
|
|
|
28803
28827
|
(Y, J) => {
|
|
28804
28828
|
var Q, ee, oe;
|
|
28805
28829
|
if (Y[0] === "$") {
|
|
28806
|
-
|
|
28830
|
+
$(!0), w && n(null, J);
|
|
28807
28831
|
return;
|
|
28808
28832
|
} else
|
|
28809
|
-
|
|
28833
|
+
$(!1);
|
|
28810
28834
|
if (Y[0] === "") {
|
|
28811
28835
|
n(null);
|
|
28812
28836
|
return;
|
|
28813
28837
|
}
|
|
28814
28838
|
if (Y[0] === " ") {
|
|
28815
|
-
Y[1] ? Y[1] !==
|
|
28839
|
+
Y[1] ? Y[1] !== B && n((oe = (ee = (Q = ConstantTypes[Y[1]]) == null ? void 0 : Q.default) == null ? void 0 : ee.call(Q)) != null ? oe : null, J) : w && n(null, J);
|
|
28816
28840
|
return;
|
|
28817
28841
|
}
|
|
28818
28842
|
n(`{{${Y.join(".")}}}`, J);
|
|
28819
28843
|
},
|
|
28820
|
-
[
|
|
28844
|
+
[B, w, n]
|
|
28821
28845
|
), U = useCallback(() => {
|
|
28822
28846
|
var Y;
|
|
28823
|
-
if (
|
|
28824
|
-
const J =
|
|
28847
|
+
if ($(!!o), (Y = N == null ? void 0 : N.children) != null && Y.length) {
|
|
28848
|
+
const J = N.children[0].default();
|
|
28825
28849
|
return n(J);
|
|
28826
28850
|
}
|
|
28827
28851
|
n(null);
|
|
28828
|
-
}, [
|
|
28852
|
+
}, [N]);
|
|
28829
28853
|
useEffect(() => {
|
|
28830
28854
|
V(this, null, function* () {
|
|
28831
28855
|
var ee;
|
|
@@ -29230,7 +29254,7 @@ function TextArea(e) {
|
|
|
29230
29254
|
}
|
|
29231
29255
|
}
|
|
29232
29256
|
}, [F]);
|
|
29233
|
-
const
|
|
29257
|
+
const $ = useCallback(
|
|
29234
29258
|
function(j) {
|
|
29235
29259
|
const O = j.filter((U) => !!U.trim()), { current: q } = m;
|
|
29236
29260
|
if (!q || !O)
|
|
@@ -29249,7 +29273,7 @@ function TextArea(e) {
|
|
|
29249
29273
|
[b, i, D]
|
|
29250
29274
|
), L = useCallback(function({ currentTarget: j }) {
|
|
29251
29275
|
T(getCurrentRange(j));
|
|
29252
|
-
}, []),
|
|
29276
|
+
}, []), B = useCallback(function(j) {
|
|
29253
29277
|
j.key === "Enter" && j.preventDefault();
|
|
29254
29278
|
}, []), w = useCallback(function() {
|
|
29255
29279
|
S(!0);
|
|
@@ -29258,7 +29282,7 @@ function TextArea(e) {
|
|
|
29258
29282
|
S(!1), v(!0), T(getCurrentRange(j)), i(getValue(j, u));
|
|
29259
29283
|
},
|
|
29260
29284
|
[i, D]
|
|
29261
|
-
),
|
|
29285
|
+
), N = useCallback(
|
|
29262
29286
|
function(j) {
|
|
29263
29287
|
j.preventDefault();
|
|
29264
29288
|
const O = j.clipboardData.getData("text/html") || j.clipboardData.getData("text"), q = sanitizeHTML(O, {
|
|
@@ -29316,8 +29340,8 @@ function TextArea(e) {
|
|
|
29316
29340
|
"aria-label": "textbox",
|
|
29317
29341
|
onInput: z,
|
|
29318
29342
|
onBlur: L,
|
|
29319
|
-
onKeyDown:
|
|
29320
|
-
onPaste:
|
|
29343
|
+
onKeyDown: B,
|
|
29344
|
+
onPaste: N,
|
|
29321
29345
|
onCompositionStart: w,
|
|
29322
29346
|
onCompositionEnd: M,
|
|
29323
29347
|
placeholder: e.placeholder,
|
|
@@ -29355,7 +29379,7 @@ function TextArea(e) {
|
|
|
29355
29379
|
{
|
|
29356
29380
|
options: h,
|
|
29357
29381
|
setOptions: g,
|
|
29358
|
-
onInsert:
|
|
29382
|
+
onInsert: $,
|
|
29359
29383
|
changeOnSelect: a,
|
|
29360
29384
|
fieldNames: c || defaultFieldNames$2
|
|
29361
29385
|
}
|
|
@@ -32903,7 +32927,111 @@ const tableBlockSettings = new SchemaSettings({
|
|
|
32903
32927
|
}, cascadeSelectComponentFieldSettings = new SchemaSettings({
|
|
32904
32928
|
name: "fieldSettings:component:CascadeSelect",
|
|
32905
32929
|
items: [fieldComponent$7, titleField$2, ellipsisSettingsItem]
|
|
32906
|
-
}),
|
|
32930
|
+
}), SchemaSettingsDateRange = function e(t) {
|
|
32931
|
+
var R, T, D, $, z, L, B, w, M, N, k, j, O, q, E, U;
|
|
32932
|
+
const { fieldSchema: n } = t, o = useField(), { dn: r } = useDesignable(), { t: i } = useTranslation(), { getCollectionJoinField: a } = useCollectionManager_deprecated(), { isInSubForm: l, isInSubTable: c } = useFlag() || {}, u = a(n == null ? void 0 : n["x-collection-field"]) || {}, d = ((R = n == null ? void 0 : n["x-component-props"]) == null ? void 0 : R.showTime) || ((D = (T = u == null ? void 0 : u.uiSchema) == null ? void 0 : T["x-component-props"]) == null ? void 0 : D.showTime) || !1, p = (($ = n == null ? void 0 : n["x-component-props"]) == null ? void 0 : $.dateFormat) || ((L = (z = u == null ? void 0 : u.uiSchema) == null ? void 0 : z["x-component-props"]) == null ? void 0 : L.dateFormat) || "YYYY-MM-DD", m = ((B = n == null ? void 0 : n["x-component-props"]) == null ? void 0 : B.timeFormat) || ((M = (w = u == null ? void 0 : u.uiSchema) == null ? void 0 : w["x-component-props"]) == null ? void 0 : M.timeFormat) || "HH:mm:ss", h = ((N = n == null ? void 0 : n["x-component-props"]) == null ? void 0 : N.picker) || ((j = (k = u == null ? void 0 : u.uiSchema) == null ? void 0 : k["x-component-props"]) == null ? void 0 : j.picker) || "date";
|
|
32933
|
+
n["x-read-pretty"] || o.readOnly || o.readPretty;
|
|
32934
|
+
const g = (O = n == null ? void 0 : n["x-component-props"]) == null ? void 0 : O._minDate, f = (q = n == null ? void 0 : n["x-component-props"]) == null ? void 0 : q._maxDate, C = ((E = u == null ? void 0 : u.uiSchema) == null ? void 0 : E["x-component-props"].gmt) || !1, b = ((U = u == null ? void 0 : u.uiSchema) == null ? void 0 : U["x-component-props"].utc) || !1, S = useRecord(), { form: y } = useFormBlockContext(), v = useCallback(
|
|
32935
|
+
(G) => /* @__PURE__ */ jsx(
|
|
32936
|
+
SchemaComponent,
|
|
32937
|
+
{
|
|
32938
|
+
schema: {
|
|
32939
|
+
"x-component": "DatePicker",
|
|
32940
|
+
"x-component-props": {
|
|
32941
|
+
dateFormat: p,
|
|
32942
|
+
timeFormat: m,
|
|
32943
|
+
gmt: C,
|
|
32944
|
+
utc: b,
|
|
32945
|
+
picker: h,
|
|
32946
|
+
showTime: d,
|
|
32947
|
+
placeholder: '{{t("Please select time or variable")}}',
|
|
32948
|
+
style: {
|
|
32949
|
+
minWidth: 385
|
|
32950
|
+
}
|
|
32951
|
+
},
|
|
32952
|
+
name: "value",
|
|
32953
|
+
"x-read-pretty": !1,
|
|
32954
|
+
"x-validator": void 0,
|
|
32955
|
+
"x-decorator": void 0
|
|
32956
|
+
}
|
|
32957
|
+
}
|
|
32958
|
+
),
|
|
32959
|
+
[p, C, h, d, m, b]
|
|
32960
|
+
), F = useCallback(
|
|
32961
|
+
(G) => /* @__PURE__ */ jsx(
|
|
32962
|
+
VariableInput,
|
|
32963
|
+
P(x({}, G), {
|
|
32964
|
+
form: y,
|
|
32965
|
+
record: S,
|
|
32966
|
+
noDisabled: !0,
|
|
32967
|
+
renderSchemaComponent: v
|
|
32968
|
+
})
|
|
32969
|
+
),
|
|
32970
|
+
[n, y, S, v]
|
|
32971
|
+
);
|
|
32972
|
+
function A(G) {
|
|
32973
|
+
if (G != null) {
|
|
32974
|
+
if (typeof G == "string")
|
|
32975
|
+
return G;
|
|
32976
|
+
if (typeof G == "object" && Object.prototype.hasOwnProperty.call(G, "value"))
|
|
32977
|
+
return A(G.value);
|
|
32978
|
+
}
|
|
32979
|
+
}
|
|
32980
|
+
return /* @__PURE__ */ jsx(
|
|
32981
|
+
SchemaSettingsModalItem,
|
|
32982
|
+
{
|
|
32983
|
+
title: i("Date range limit"),
|
|
32984
|
+
schema: {
|
|
32985
|
+
type: "object",
|
|
32986
|
+
"x-decorator": "",
|
|
32987
|
+
properties: {
|
|
32988
|
+
_minDate: {
|
|
32989
|
+
type: "string",
|
|
32990
|
+
title: '{{t("MinDate")}}',
|
|
32991
|
+
"x-decorator": "FormItem",
|
|
32992
|
+
"x-component": F,
|
|
32993
|
+
"x-component-props": {
|
|
32994
|
+
name: "_minDate"
|
|
32995
|
+
},
|
|
32996
|
+
//日期和使用变量设置的默认值不同
|
|
32997
|
+
default: isVariable(g) ? g : { value: g }
|
|
32998
|
+
},
|
|
32999
|
+
_maxDate: {
|
|
33000
|
+
type: "string",
|
|
33001
|
+
title: '{{t("MaxDate")}}',
|
|
33002
|
+
"x-decorator": "FormItem",
|
|
33003
|
+
"x-component": F,
|
|
33004
|
+
"x-component-props": {
|
|
33005
|
+
name: "_maxDate"
|
|
33006
|
+
},
|
|
33007
|
+
default: isVariable(f) ? f : { value: f }
|
|
33008
|
+
}
|
|
33009
|
+
}
|
|
33010
|
+
},
|
|
33011
|
+
onSubmit: (G) => {
|
|
33012
|
+
const H = {
|
|
33013
|
+
"x-uid": n["x-uid"]
|
|
33014
|
+
};
|
|
33015
|
+
H["x-component-props"] = o.componentProps || {}, n["x-component-props"] = P(x({}, o.componentProps || {}), {
|
|
33016
|
+
_maxDate: A(G == null ? void 0 : G._maxDate),
|
|
33017
|
+
_minDate: A(G == null ? void 0 : G._minDate)
|
|
33018
|
+
}), H["x-component-props"] = n["x-component-props"], o.componentProps = n["x-component-props"];
|
|
33019
|
+
const W = o.path.entire.split(".");
|
|
33020
|
+
W.pop();
|
|
33021
|
+
const X = W.join(".");
|
|
33022
|
+
o.query(`${X}.*[0:].${n.name}`).forEach((Y) => {
|
|
33023
|
+
Y.props.name === n.name && Y.setComponentProps({
|
|
33024
|
+
_maxDate: A(G == null ? void 0 : G._maxDate),
|
|
33025
|
+
_minDate: A(G == null ? void 0 : G._minDate)
|
|
33026
|
+
});
|
|
33027
|
+
}), r.emit("patch", {
|
|
33028
|
+
schema: H
|
|
33029
|
+
}), r.refresh();
|
|
33030
|
+
},
|
|
33031
|
+
ModalContextProvider: (G) => /* @__PURE__ */ jsx(FlagProvider, { isInSubForm: l, isInSubTable: c, isInFormDataTemplate: !0, children: G.children })
|
|
33032
|
+
}
|
|
33033
|
+
);
|
|
33034
|
+
}, datePickerComponentFieldSettings = new SchemaSettings({
|
|
32907
33035
|
name: "fieldSettings:component:DatePicker",
|
|
32908
33036
|
items: [
|
|
32909
33037
|
{
|
|
@@ -32916,6 +33044,20 @@ const tableBlockSettings = new SchemaSettings({
|
|
|
32916
33044
|
};
|
|
32917
33045
|
}
|
|
32918
33046
|
},
|
|
33047
|
+
{
|
|
33048
|
+
name: "dateScopeSelect",
|
|
33049
|
+
Component: SchemaSettingsDateRange,
|
|
33050
|
+
useComponentProps() {
|
|
33051
|
+
const e = useFieldSchema(), { fieldSchema: t } = useColumnSchema$1();
|
|
33052
|
+
return {
|
|
33053
|
+
fieldSchema: t || e
|
|
33054
|
+
};
|
|
33055
|
+
},
|
|
33056
|
+
useVisible() {
|
|
33057
|
+
const { fieldSchema: e } = useColumnSchema$1(), t = useFieldSchema(), n = e || t;
|
|
33058
|
+
return !(n != null && n["x-read-pretty"]);
|
|
33059
|
+
}
|
|
33060
|
+
},
|
|
32919
33061
|
ellipsisSettingsItem,
|
|
32920
33062
|
enableLinkSettingsItem,
|
|
32921
33063
|
openModeSettingsItem
|
|
@@ -34391,22 +34533,22 @@ const variablesStore = {}, getFieldPath = (e, t) => {
|
|
|
34391
34533
|
const y = C.split("."), v = y[0], F = mergeVariableToCollectionNameWithLocalVariables(variablesStore, b);
|
|
34392
34534
|
let A = mergeCtxWithLocalVariables(n.current, b);
|
|
34393
34535
|
const { fieldPath: R, dataSource: T, variableOption: D } = getFieldPath(v, F);
|
|
34394
|
-
let
|
|
34536
|
+
let $ = R;
|
|
34395
34537
|
const { fieldPath: z } = getFieldPath(C, F), L = y.length === 1 ? D == null ? void 0 : D.collectionName : (w = r(z, T)) == null ? void 0 : w.target;
|
|
34396
34538
|
if (!(v in A))
|
|
34397
34539
|
throw new Error(`VariablesProvider: ${v} is not found`);
|
|
34398
|
-
for (let
|
|
34540
|
+
for (let N = 0; N < y.length; N++) {
|
|
34399
34541
|
if (A == null)
|
|
34400
34542
|
return {
|
|
34401
34543
|
value: A === void 0 ? D == null ? void 0 : D.defaultValue : A,
|
|
34402
34544
|
dataSource: T,
|
|
34403
34545
|
collectionName: L
|
|
34404
34546
|
};
|
|
34405
|
-
const k = y[
|
|
34547
|
+
const k = y[N], { fieldPath: j } = getFieldPath(y.slice(0, N + 1).join("."), F), O = r(j, T), q = (M = i($, T)) == null ? void 0 : M.getPrimaryKey();
|
|
34406
34548
|
if (Array.isArray(A)) {
|
|
34407
34549
|
const E = A.map((U) => {
|
|
34408
34550
|
if (!(S != null && S.doNotRequest) && shouldToRequest(U == null ? void 0 : U[k]) && (U == null ? void 0 : U[q]) != null && O != null && O.target) {
|
|
34409
|
-
const G = `/${
|
|
34551
|
+
const G = `/${$}/${U[O.sourceKey || q]}/${k}:${getAction(O.type)}`;
|
|
34410
34552
|
if (hasRequested(G))
|
|
34411
34553
|
return getRequested(G);
|
|
34412
34554
|
const H = o.request({
|
|
@@ -34422,7 +34564,7 @@ const variablesStore = {}, getFieldPath = (e, t) => {
|
|
|
34422
34564
|
});
|
|
34423
34565
|
A = removeThroughCollectionFields(_.flatten(yield Promise.all(E)), O);
|
|
34424
34566
|
} else if (!(S != null && S.doNotRequest) && shouldToRequest(A[k]) && A[q] != null && (O != null && O.target)) {
|
|
34425
|
-
const E = `/${
|
|
34567
|
+
const E = `/${$}/${A[O.sourceKey || q]}/${k}:${getAction(O.type)}`;
|
|
34426
34568
|
let U = null;
|
|
34427
34569
|
if (hasRequested(E))
|
|
34428
34570
|
U = yield getRequested(E);
|
|
@@ -34439,13 +34581,13 @@ const variablesStore = {}, getFieldPath = (e, t) => {
|
|
|
34439
34581
|
raw(A)[k] || (raw(A)[k] = U.data.data), A = removeThroughCollectionFields(getValuesByPath(A, k), O);
|
|
34440
34582
|
} else
|
|
34441
34583
|
A = removeThroughCollectionFields(getValuesByPath(A, k), O);
|
|
34442
|
-
O != null && O.target && (
|
|
34584
|
+
O != null && O.target && ($ = O.target);
|
|
34443
34585
|
}
|
|
34444
|
-
const
|
|
34586
|
+
const B = a(
|
|
34445
34587
|
_.isFunction(A) ? A({ fieldOperator: S == null ? void 0 : S.fieldOperator, isParsingVariable: !0 }) : A
|
|
34446
34588
|
);
|
|
34447
34589
|
return {
|
|
34448
|
-
value:
|
|
34590
|
+
value: B === void 0 ? D.defaultValue : B,
|
|
34449
34591
|
dataSource: T,
|
|
34450
34592
|
collectionName: L
|
|
34451
34593
|
};
|
|
@@ -34809,7 +34951,7 @@ function addAppVersion(e, t) {
|
|
|
34809
34951
|
addAppVersion((o = e.properties) == null ? void 0 : o[n], t);
|
|
34810
34952
|
}), e;
|
|
34811
34953
|
}
|
|
34812
|
-
const name = "@nocobase/client", version = "1.5.0-beta.
|
|
34954
|
+
const name = "@nocobase/client", version = "1.5.0-beta.15", license = "AGPL-3.0", main = "lib/index.js", module = "es/index.mjs", types = "es/index.d.ts", dependencies = {
|
|
34813
34955
|
"@ahooksjs/use-url-state": "3.5.1",
|
|
34814
34956
|
"@ant-design/cssinjs": "^1.11.1",
|
|
34815
34957
|
"@ant-design/icons": "^5.1.4",
|
|
@@ -34831,9 +34973,9 @@ const name = "@nocobase/client", version = "1.5.0-beta.13", license = "AGPL-3.0"
|
|
|
34831
34973
|
"@formily/reactive-react": "^2.2.27",
|
|
34832
34974
|
"@formily/shared": "^2.2.27",
|
|
34833
34975
|
"@formily/validator": "^2.2.27",
|
|
34834
|
-
"@nocobase/evaluators": "1.5.0-beta.
|
|
34835
|
-
"@nocobase/sdk": "1.5.0-beta.
|
|
34836
|
-
"@nocobase/utils": "1.5.0-beta.
|
|
34976
|
+
"@nocobase/evaluators": "1.5.0-beta.15",
|
|
34977
|
+
"@nocobase/sdk": "1.5.0-beta.15",
|
|
34978
|
+
"@nocobase/utils": "1.5.0-beta.15",
|
|
34837
34979
|
ahooks: "^3.7.2",
|
|
34838
34980
|
antd: "5.12.8",
|
|
34839
34981
|
"antd-style": "3.7.1",
|
|
@@ -35600,8 +35742,8 @@ const useFieldComponentOptions = () => {
|
|
|
35600
35742
|
const { refresh: t } = useDesignable(), n = useAPIClient(), { t: o } = useTranslation();
|
|
35601
35743
|
return useCallback(
|
|
35602
35744
|
(r) => {
|
|
35603
|
-
var f, C, b, S, y, v, F, A, R, T, D,
|
|
35604
|
-
const { active: i, over: a } = r, l = (C = (f = i == null ? void 0 : i.data) == null ? void 0 : f.current) == null ? void 0 : C.schema, c = (S = (b = a == null ? void 0 : a.data) == null ? void 0 : b.current) == null ? void 0 : S.schema, u = (v = (y = a == null ? void 0 : a.data) == null ? void 0 : y.current) == null ? void 0 : v.insertAdjacent, d = (A = (F = a == null ? void 0 : a.data) == null ? void 0 : F.current) == null ? void 0 : A.breakRemoveOn, p = (T = (R = a == null ? void 0 : a.data) == null ? void 0 : R.current) == null ? void 0 : T.wrapSchema, m = (
|
|
35745
|
+
var f, C, b, S, y, v, F, A, R, T, D, $, z, L, B;
|
|
35746
|
+
const { active: i, over: a } = r, l = (C = (f = i == null ? void 0 : i.data) == null ? void 0 : f.current) == null ? void 0 : C.schema, c = (S = (b = a == null ? void 0 : a.data) == null ? void 0 : b.current) == null ? void 0 : S.schema, u = (v = (y = a == null ? void 0 : a.data) == null ? void 0 : y.current) == null ? void 0 : v.insertAdjacent, d = (A = (F = a == null ? void 0 : a.data) == null ? void 0 : F.current) == null ? void 0 : A.breakRemoveOn, p = (T = (R = a == null ? void 0 : a.data) == null ? void 0 : R.current) == null ? void 0 : T.wrapSchema, m = ($ = (D = a == null ? void 0 : a.data) == null ? void 0 : D.current) == null ? void 0 : $.onSuccess, h = (B = (L = (z = a == null ? void 0 : a.data) == null ? void 0 : z.current) == null ? void 0 : L.removeParentsIfNoChildren) != null ? B : !0;
|
|
35605
35747
|
if (!l || !c) {
|
|
35606
35748
|
e == null || e(r);
|
|
35607
35749
|
return;
|
|
@@ -36136,30 +36278,30 @@ const getValues = (e, t) => castArray(e).filter((n) => n != null).map((n) => typ
|
|
|
36136
36278
|
"dataSource",
|
|
36137
36279
|
"toOptionsItem",
|
|
36138
36280
|
"popupMatchSelectWidth"
|
|
36139
|
-
]), C = useDataSourceKey(), b = useDataSourceHeaders(m || C), [S, y] = useState(!1), v = useRef(!1), F = useFieldSchema(), A = ((X = F["x-component-props"]) == null ? void 0 : X.addMode) === "quickAdd", { getField: R } = useCollection_deprecated(), T = useRef(null), { getCollectionJoinField: D, getInterface:
|
|
36281
|
+
]), C = useDataSourceKey(), b = useDataSourceHeaders(m || C), [S, y] = useState(!1), v = useRef(!1), F = useFieldSchema(), A = ((X = F["x-component-props"]) == null ? void 0 : X.addMode) === "quickAdd", { getField: R } = useCollection_deprecated(), T = useRef(null), { getCollectionJoinField: D, getInterface: $ } = useCollectionManager_deprecated(), z = F["x-collection-field"] || F.name, L = R(z) || D(z), B = u || (L == null ? void 0 : L.target) && (t == null ? void 0 : t.label) && D(`${L.target}.${t.label}`), w = useMemo(() => {
|
|
36140
36282
|
var J;
|
|
36141
|
-
if (
|
|
36142
|
-
const Q =
|
|
36143
|
-
return
|
|
36283
|
+
if (B != null && B.interface) {
|
|
36284
|
+
const Q = $(B.interface), ee = ((J = Q == null ? void 0 : Q.filterable) == null ? void 0 : J.operators[0].value) || "$includes";
|
|
36285
|
+
return B.type === "string" ? "$includes" : ee;
|
|
36144
36286
|
}
|
|
36145
36287
|
return "$includes";
|
|
36146
|
-
}, [
|
|
36288
|
+
}, [B]), M = useCompile(), N = useCallback(
|
|
36147
36289
|
(J) => {
|
|
36148
36290
|
try {
|
|
36149
36291
|
return J.filter((Q) => ["number", "string"].includes(typeof Q[t.value]) || !Q[t.value]).map((Q) => {
|
|
36150
36292
|
var oe;
|
|
36151
36293
|
let ee = M(Q[t.label]);
|
|
36152
|
-
if ((oe =
|
|
36294
|
+
if ((oe = B == null ? void 0 : B.uiSchema) != null && oe.enum)
|
|
36153
36295
|
if (Array.isArray(ee))
|
|
36154
36296
|
ee = ee.map((te, ie) => {
|
|
36155
|
-
const ae =
|
|
36297
|
+
const ae = B.uiSchema.enum.find((ue) => ue.value === te);
|
|
36156
36298
|
return ae ? /* @__PURE__ */ jsx(Tag, { role: "button", color: ae.color, style: { marginRight: 3 }, children: (ae == null ? void 0 : ae.label) || te }, ie) : /* @__PURE__ */ jsx(Tag, { role: "button", children: te }, te);
|
|
36157
36299
|
}).reverse();
|
|
36158
36300
|
else {
|
|
36159
|
-
const te =
|
|
36301
|
+
const te = B.uiSchema.enum.find((ie) => ie.value === ee);
|
|
36160
36302
|
te && (ee = /* @__PURE__ */ jsx(Tag, { role: "button", color: te.color, children: te.label }));
|
|
36161
36303
|
}
|
|
36162
|
-
return (
|
|
36304
|
+
return (B == null ? void 0 : B.type) === "date" && (ee = dayjs(ee).format("YYYY-MM-DD")), c ? c({
|
|
36163
36305
|
[t.label]: ee || EMPTY$1,
|
|
36164
36306
|
[t.value]: Q[t.value]
|
|
36165
36307
|
}) : P(x({}, Q), {
|
|
@@ -36171,7 +36313,7 @@ const getValues = (e, t) => castArray(e).filter((n) => n != null).map((n) => typ
|
|
|
36171
36313
|
return console.error(Q), J;
|
|
36172
36314
|
}
|
|
36173
36315
|
},
|
|
36174
|
-
[
|
|
36316
|
+
[B == null ? void 0 : B.uiSchema, t]
|
|
36175
36317
|
), { data: k, run: j, loading: O } = useRequest(
|
|
36176
36318
|
P(x({
|
|
36177
36319
|
action: "list"
|
|
@@ -36243,7 +36385,7 @@ const getValues = (e, t) => castArray(e).filter((n) => n != null).map((n) => typ
|
|
|
36243
36385
|
defaultValue: i
|
|
36244
36386
|
}, f), {
|
|
36245
36387
|
loading: k ? O : !0,
|
|
36246
|
-
options: h(
|
|
36388
|
+
options: h(N(G)),
|
|
36247
36389
|
rawOptions: G,
|
|
36248
36390
|
dropdownRender: (J) => {
|
|
36249
36391
|
const Q = G.some((ee) => ee[t.label] === T.current);
|
|
@@ -36321,11 +36463,11 @@ const useFormDataTemplates = () => {
|
|
|
36321
36463
|
d(A), m(null), t == null || t.reset();
|
|
36322
36464
|
}), []), v = useCallback((A, R, T) => V(void 0, null, function* () {
|
|
36323
36465
|
const D = P(x({}, R), { dataId: A });
|
|
36324
|
-
m(R), fetchTemplateData(h, D, T).then((
|
|
36325
|
-
var
|
|
36326
|
-
z && (t.values[L] = z, (
|
|
36327
|
-
})),
|
|
36328
|
-
console.error(
|
|
36466
|
+
m(R), fetchTemplateData(h, D, T).then(($) => (t && $ && (t.reset(), t.__template = !0, forEach($, (z, L) => {
|
|
36467
|
+
var B;
|
|
36468
|
+
z && (t.values[L] = z, (B = t == null ? void 0 : t.setInitialValuesIn) == null || B.call(t, L, z));
|
|
36469
|
+
})), $)).catch(($) => {
|
|
36470
|
+
console.error($);
|
|
36329
36471
|
});
|
|
36330
36472
|
}), []);
|
|
36331
36473
|
if (!i || !r)
|
|
@@ -36445,45 +36587,49 @@ const useFormBlockHeight = () => {
|
|
|
36445
36587
|
n["x-linkage-rules"] && (t = n["x-linkage-rules"]);
|
|
36446
36588
|
}), t;
|
|
36447
36589
|
}, WithForm = (e) => {
|
|
36448
|
-
var
|
|
36449
|
-
const { form: t } = e, n = useFieldSchema(), { setFormValueChanged: o } = useActionContext(), r = useVariables$1(), i = useLocalVariables$1({ currentForm: t }), { templateFinished: a } = useTemplateBlockContext(), l = ((
|
|
36590
|
+
var u, d;
|
|
36591
|
+
const { form: t } = e, n = useFieldSchema(), { setFormValueChanged: o } = useActionContext(), r = useVariables$1(), i = useLocalVariables$1({ currentForm: t }), { templateFinished: a } = useTemplateBlockContext(), { loading: l } = useDataBlockRequest() || {}, c = ((d = getLinkageRules(n) || ((u = n.parent) == null ? void 0 : u["x-linkage-rules"])) == null ? void 0 : d.filter((p) => !p.disabled)) || [];
|
|
36450
36592
|
return useEffect(() => {
|
|
36451
|
-
const
|
|
36452
|
-
return t.addEffects(
|
|
36593
|
+
const p = uid();
|
|
36594
|
+
return t.addEffects(p, () => {
|
|
36453
36595
|
onFormInputChange(() => {
|
|
36454
36596
|
o == null || o(!0);
|
|
36455
36597
|
});
|
|
36456
36598
|
}), e.disabled && (t.disabled = e.disabled), () => {
|
|
36457
|
-
t.removeEffects(
|
|
36599
|
+
t.removeEffects(p);
|
|
36458
36600
|
};
|
|
36459
36601
|
}, [t, e.disabled, o]), useEffect(() => {
|
|
36460
|
-
|
|
36461
|
-
|
|
36462
|
-
|
|
36463
|
-
|
|
36464
|
-
|
|
36465
|
-
|
|
36466
|
-
|
|
36467
|
-
|
|
36468
|
-
|
|
36469
|
-
|
|
36470
|
-
|
|
36471
|
-
|
|
36472
|
-
|
|
36473
|
-
|
|
36474
|
-
|
|
36475
|
-
|
|
36476
|
-
|
|
36477
|
-
|
|
36478
|
-
|
|
36479
|
-
|
|
36602
|
+
if (l)
|
|
36603
|
+
return;
|
|
36604
|
+
const p = uid(), m = [];
|
|
36605
|
+
return setTimeout(() => {
|
|
36606
|
+
t.addEffects(p, () => {
|
|
36607
|
+
forEachLinkageRule(c, (h, g) => {
|
|
36608
|
+
var f;
|
|
36609
|
+
if ((f = h.targetFields) != null && f.length) {
|
|
36610
|
+
const C = h.targetFields.join(",");
|
|
36611
|
+
onFieldInit(`*(${C})`, (b, S) => {
|
|
36612
|
+
m.push(
|
|
36613
|
+
bindLinkageRulesToFiled({
|
|
36614
|
+
field: b,
|
|
36615
|
+
linkageRules: c,
|
|
36616
|
+
formValues: S.values,
|
|
36617
|
+
localVariables: i,
|
|
36618
|
+
action: h,
|
|
36619
|
+
rule: g,
|
|
36620
|
+
variables: r
|
|
36621
|
+
})
|
|
36622
|
+
);
|
|
36623
|
+
});
|
|
36624
|
+
}
|
|
36625
|
+
});
|
|
36480
36626
|
});
|
|
36481
36627
|
}), () => {
|
|
36482
|
-
t.removeEffects(
|
|
36483
|
-
|
|
36628
|
+
t.removeEffects(p), m.forEach((h) => {
|
|
36629
|
+
h();
|
|
36484
36630
|
});
|
|
36485
36631
|
};
|
|
36486
|
-
}, [
|
|
36632
|
+
}, [c, a, l]), n["x-decorator"] === "FormV2" ? /* @__PURE__ */ jsx(FormDecorator, x({}, e)) : /* @__PURE__ */ jsx(FormComponent, x({}, e));
|
|
36487
36633
|
}, WithoutForm = (e) => {
|
|
36488
36634
|
const t = useFieldSchema(), { setFormValueChanged: n } = useActionContext(), o = useMemo(
|
|
36489
36635
|
() => createForm({
|
|
@@ -37621,16 +37767,16 @@ const AppendsTreeSelect = (e) => {
|
|
|
37621
37767
|
"filter",
|
|
37622
37768
|
"rootOption",
|
|
37623
37769
|
"loadData"
|
|
37624
|
-
]), d = useCompile(), { t: p } = useTranslation(), [m, h] = useState({}), g = i({ collection: r }), [f, C] = parseCollectionName(g), b = useApp(), { collectionManager: S } = b.dataSourceManager.getDataSource(f), y = (L,
|
|
37770
|
+
]), d = useCompile(), { t: p } = useTranslation(), [m, h] = useState({}), g = i({ collection: r }), [f, C] = parseCollectionName(g), b = useApp(), { collectionManager: S } = b.dataSourceManager.getDataSource(f), y = (L, B) => {
|
|
37625
37771
|
const w = S.getCollection(L);
|
|
37626
|
-
return w ? w.getAllFields(
|
|
37772
|
+
return w ? w.getAllFields(B) : [];
|
|
37627
37773
|
}, v = Object.values(m), F = useMemo(() => e.multiple ? (n || []).map((L) => m[L]).filter(Boolean) : n, [n, e.multiple, m]), A = useCallback(
|
|
37628
37774
|
(L) => V(void 0, null, function* () {
|
|
37629
37775
|
if (c != null)
|
|
37630
37776
|
return c(L);
|
|
37631
37777
|
if (!L.isLeaf && L.loadChildren) {
|
|
37632
|
-
const
|
|
37633
|
-
h((w) =>
|
|
37778
|
+
const B = L.loadChildren(L);
|
|
37779
|
+
h((w) => B.reduce((M, N) => Object.assign(M, { [N.value]: N }), x({}, w)));
|
|
37634
37780
|
}
|
|
37635
37781
|
}),
|
|
37636
37782
|
[c]
|
|
@@ -37642,28 +37788,28 @@ const AppendsTreeSelect = (e) => {
|
|
|
37642
37788
|
title: l.label,
|
|
37643
37789
|
fullTitle: l.label,
|
|
37644
37790
|
isLeaf: !1
|
|
37645
|
-
}) : null, w = (c === null ? [] : getCollectionFieldOptions.call({ compile: d, getCollectionFields: y, filter: a }, C, L)).reduce((M,
|
|
37791
|
+
}) : null, w = (c === null ? [] : getCollectionFieldOptions.call({ compile: d, getCollectionFields: y, filter: a }, C, L)).reduce((M, N) => Object.assign(M, { [N.value]: N }), {});
|
|
37646
37792
|
L && (w[L.value] = L), h(w);
|
|
37647
37793
|
}, [g, l, a, c]), useEffect(() => {
|
|
37648
37794
|
const L = e.multiple ? n : n ? [n] : [];
|
|
37649
37795
|
if (!(L != null && L.length) || L.every((w) => !!m[w]))
|
|
37650
37796
|
return;
|
|
37651
|
-
const
|
|
37797
|
+
const B = [];
|
|
37652
37798
|
L.forEach((w) => {
|
|
37653
37799
|
const M = w.split(".");
|
|
37654
|
-
let
|
|
37655
|
-
for (let k = 1; k < M.length &&
|
|
37800
|
+
let N = m[M[0]];
|
|
37801
|
+
for (let k = 1; k < M.length && N; k++) {
|
|
37656
37802
|
const j = M.slice(0, k + 1).join(".");
|
|
37657
37803
|
if (m[j]) {
|
|
37658
|
-
|
|
37804
|
+
N = m[j];
|
|
37659
37805
|
break;
|
|
37660
37806
|
}
|
|
37661
|
-
if (!
|
|
37662
|
-
const O =
|
|
37663
|
-
O != null && O.length && (
|
|
37807
|
+
if (!N.isLeaf && N.loadChildren) {
|
|
37808
|
+
const O = N.loadChildren(N);
|
|
37809
|
+
O != null && O.length && (B.push(...O), N = O.find((q) => q.value === M.slice(0, k + 1).join(".")));
|
|
37664
37810
|
}
|
|
37665
37811
|
}
|
|
37666
|
-
}), h((w) =>
|
|
37812
|
+
}), h((w) => B.reduce((M, N) => Object.assign(M, { [N.value]: N }), x({}, w)));
|
|
37667
37813
|
}, [n, v.length, e.multiple]);
|
|
37668
37814
|
const R = useCallback(
|
|
37669
37815
|
(L) => {
|
|
@@ -37671,15 +37817,15 @@ const AppendsTreeSelect = (e) => {
|
|
|
37671
37817
|
o(L);
|
|
37672
37818
|
return;
|
|
37673
37819
|
}
|
|
37674
|
-
const
|
|
37820
|
+
const B = L.map((N) => N.value).filter(Boolean), w = new Set(B), M = F.find((N) => !w.has(N.value));
|
|
37675
37821
|
if (M) {
|
|
37676
|
-
const
|
|
37822
|
+
const N = `${M.value}.`;
|
|
37677
37823
|
Object.keys(m).forEach((k) => {
|
|
37678
|
-
k.startsWith(
|
|
37824
|
+
k.startsWith(N) && w.delete(k);
|
|
37679
37825
|
});
|
|
37680
37826
|
} else
|
|
37681
|
-
|
|
37682
|
-
const k =
|
|
37827
|
+
B.forEach((N) => {
|
|
37828
|
+
const k = N.split(".");
|
|
37683
37829
|
if (k.length)
|
|
37684
37830
|
for (let j = 1; j <= k.length; j++)
|
|
37685
37831
|
w.add(k.slice(0, j).join("."));
|
|
@@ -37690,14 +37836,14 @@ const AppendsTreeSelect = (e) => {
|
|
|
37690
37836
|
), T = useCallback(
|
|
37691
37837
|
(L) => {
|
|
37692
37838
|
var j;
|
|
37693
|
-
const { value:
|
|
37694
|
-
if (
|
|
37839
|
+
const { value: B, onClose: w, disabled: M, closable: N } = L;
|
|
37840
|
+
if (!B)
|
|
37695
37841
|
return null;
|
|
37696
|
-
const { fullTitle: k } = (j = m[
|
|
37697
|
-
return /* @__PURE__ */ jsx(Tag, { closable:
|
|
37842
|
+
const { fullTitle: k } = (j = m[B]) != null ? j : {};
|
|
37843
|
+
return /* @__PURE__ */ jsx(Tag, { closable: N && !M, onClose: w, children: k == null ? void 0 : k.join(" / ") });
|
|
37698
37844
|
},
|
|
37699
37845
|
[m]
|
|
37700
|
-
), D = Array.isArray(F) ? F.filter((L) => L.value in m) : F,
|
|
37846
|
+
), D = Array.isArray(F) ? F.filter((L) => L.value in m) : F, $ = e.multiple ? n : n != null ? [n] : [];
|
|
37701
37847
|
return /* @__PURE__ */ jsx(
|
|
37702
37848
|
TreeSelect$2,
|
|
37703
37849
|
x({
|
|
@@ -37706,7 +37852,7 @@ const AppendsTreeSelect = (e) => {
|
|
|
37706
37852
|
value: D,
|
|
37707
37853
|
placeholder: p("Select field"),
|
|
37708
37854
|
showCheckedStrategy: TreeSelect$2.SHOW_ALL,
|
|
37709
|
-
treeDefaultExpandedKeys:
|
|
37855
|
+
treeDefaultExpandedKeys: $,
|
|
37710
37856
|
allowClear: {
|
|
37711
37857
|
clearIcon: /* @__PURE__ */ jsx(CloseCircleFilled, { role: "button", "aria-label": "icon-close" })
|
|
37712
37858
|
},
|
|
@@ -37742,8 +37888,8 @@ const AppendsTreeSelect = (e) => {
|
|
|
37742
37888
|
const R = uid();
|
|
37743
37889
|
return f.addEffects(R, () => {
|
|
37744
37890
|
onFieldInputValueChange("*", (T) => {
|
|
37745
|
-
var
|
|
37746
|
-
(filterAnalyses((L = (z = (
|
|
37891
|
+
var $, z, L, B, w;
|
|
37892
|
+
(filterAnalyses((L = (z = ($ = r.componentProps) == null ? void 0 : $.service) == null ? void 0 : z.params) == null ? void 0 : L.filter) || []).includes((B = T == null ? void 0 : T.props) == null ? void 0 : B.name) && r.value && isEqual(T == null ? void 0 : T.indexes, r == null ? void 0 : r.indexes) && ((w = T == null ? void 0 : T.props) == null ? void 0 : w.name) !== r.props.name && (r.setValue(void 0), p(void 0));
|
|
37747
37893
|
});
|
|
37748
37894
|
}), () => {
|
|
37749
37895
|
f.removeEffects(R);
|
|
@@ -37752,18 +37898,18 @@ const AppendsTreeSelect = (e) => {
|
|
|
37752
37898
|
const y = (R) => V(void 0, null, function* () {
|
|
37753
37899
|
var z, L;
|
|
37754
37900
|
const { search: T, callBack: D } = R, {
|
|
37755
|
-
data: { data:
|
|
37901
|
+
data: { data: $ }
|
|
37756
37902
|
} = yield b.create({
|
|
37757
37903
|
values: {
|
|
37758
37904
|
[((L = (z = r == null ? void 0 : r.componentProps) == null ? void 0 : z.fieldNames) == null ? void 0 : L.label) || "id"]: T
|
|
37759
37905
|
}
|
|
37760
37906
|
});
|
|
37761
|
-
if (
|
|
37907
|
+
if ($) {
|
|
37762
37908
|
if (["m2m", "o2m"].includes(l == null ? void 0 : l.interface) && g !== !1) {
|
|
37763
|
-
const
|
|
37764
|
-
|
|
37909
|
+
const B = f.getValuesIn(r.path) || [];
|
|
37910
|
+
B.push($), f.setValuesIn(r.path, B), r.onInput(B);
|
|
37765
37911
|
} else
|
|
37766
|
-
f.setValuesIn(r.path,
|
|
37912
|
+
f.setValuesIn(r.path, $), r.onInput($);
|
|
37767
37913
|
isFunction(D) && (D == null || D()), message.success(h("Saved successfully"));
|
|
37768
37914
|
}
|
|
37769
37915
|
}), v = (R) => /* @__PURE__ */ jsxs(
|
|
@@ -38349,17 +38495,17 @@ function Uploader(n) {
|
|
|
38349
38495
|
(R) => {
|
|
38350
38496
|
var T;
|
|
38351
38497
|
if (i) {
|
|
38352
|
-
const D = R.fileList.filter((
|
|
38498
|
+
const D = R.fileList.filter(($) => $.status === "done");
|
|
38353
38499
|
if (D.length) {
|
|
38354
|
-
const
|
|
38500
|
+
const $ = [...a != null ? a : [], ...D.map((z) => {
|
|
38355
38501
|
var L;
|
|
38356
38502
|
return c((L = z.response) == null ? void 0 : L.data);
|
|
38357
38503
|
})];
|
|
38358
|
-
l == null || l(
|
|
38504
|
+
l == null || l($);
|
|
38359
38505
|
}
|
|
38360
|
-
d(R.fileList.filter((
|
|
38506
|
+
d(R.fileList.filter(($) => $.status !== "done").map(normalizeFile));
|
|
38361
38507
|
} else {
|
|
38362
|
-
const D = R.fileList.find((
|
|
38508
|
+
const D = R.fileList.find(($) => $.uid === R.file.uid);
|
|
38363
38509
|
D.status === "done" ? (l == null || l(c((T = D.response) == null ? void 0 : T.data)), d([])) : d([normalizeFile(D)]);
|
|
38364
38510
|
}
|
|
38365
38511
|
},
|
|
@@ -38681,16 +38827,16 @@ function FileSelector(e) {
|
|
|
38681
38827
|
);
|
|
38682
38828
|
}
|
|
38683
38829
|
const InternalFileManager = (e) => {
|
|
38684
|
-
var D,
|
|
38830
|
+
var D, $;
|
|
38685
38831
|
const T = e, { value: t, multiple: n, onChange: o } = T, r = K(T, ["value", "multiple", "onChange"]), i = useFieldSchema(), [a, l] = useState(!1), [c, u] = useState([]), d = useInsertSchema$1("Selector"), p = useFieldNames$1(e), { designable: m } = useDesignable(), h = useField(), [g, f] = useState([]), { getField: C } = useCollection_deprecated(), b = C(h.props.name), S = useLabelUiSchema$1(b == null ? void 0 : b.target, (p == null ? void 0 : p.label) || "label"), y = useCompile(), { modalProps: v } = useActionContext(), F = (z) => {
|
|
38686
|
-
z.stopPropagation(), z.preventDefault(), m ? d(schema$1.Selector) : i.reduceProperties((
|
|
38832
|
+
z.stopPropagation(), z.preventDefault(), m ? d(schema$1.Selector) : i.reduceProperties((B, w) => w["x-component"] === "AssociationField.Selector" ? w : B, null) || i.addProperty("selector", schema$1.Selector), l(!0), u([]);
|
|
38687
38833
|
};
|
|
38688
38834
|
useEffect(() => {
|
|
38689
38835
|
if (t && Object.keys(t).length > 0) {
|
|
38690
38836
|
const z = (Array.isArray(t) ? t : t ? [t] : []).filter(Boolean).map((L) => {
|
|
38691
|
-
const
|
|
38837
|
+
const B = L[p.label];
|
|
38692
38838
|
return P(x({}, L), {
|
|
38693
|
-
[p.label]: getLabelFormatValue$1(y(S), y(
|
|
38839
|
+
[p.label]: getLabelFormatValue$1(y(S), y(B))
|
|
38694
38840
|
});
|
|
38695
38841
|
});
|
|
38696
38842
|
f(z);
|
|
@@ -38710,10 +38856,10 @@ const InternalFileManager = (e) => {
|
|
|
38710
38856
|
setSelectedRows: u,
|
|
38711
38857
|
collectionField: b
|
|
38712
38858
|
}, R = () => {
|
|
38713
|
-
const { setVisible: z } = useActionContext(), { multiple: L, selectedRows:
|
|
38859
|
+
const { setVisible: z } = useActionContext(), { multiple: L, selectedRows: B, onChange: w, options: M, collectionField: N } = useContext(RecordPickerContext);
|
|
38714
38860
|
return {
|
|
38715
38861
|
onClick() {
|
|
38716
|
-
w(L ? unionBy(
|
|
38862
|
+
w(L ? unionBy(B, M, (N == null ? void 0 : N.targetKey) || "id") : (B == null ? void 0 : B[0]) || null), z(!1);
|
|
38717
38863
|
}
|
|
38718
38864
|
};
|
|
38719
38865
|
};
|
|
@@ -38724,7 +38870,7 @@ const InternalFileManager = (e) => {
|
|
|
38724
38870
|
value: n ? g : g == null ? void 0 : g[0],
|
|
38725
38871
|
multiple: n,
|
|
38726
38872
|
quickUpload: ((D = i["x-component-props"]) == null ? void 0 : D.quickUpload) !== !1,
|
|
38727
|
-
selectFile: ((
|
|
38873
|
+
selectFile: (($ = i["x-component-props"]) == null ? void 0 : $.selectFile) !== !1,
|
|
38728
38874
|
action: `${b == null ? void 0 : b.target}:create`,
|
|
38729
38875
|
onSelect: F,
|
|
38730
38876
|
onChange: o
|
|
@@ -38769,27 +38915,27 @@ const InternalFileManager = (e) => {
|
|
|
38769
38915
|
const { data: t, mapOptions: n, onChange: o, value: r } = e, [i, a] = useState([
|
|
38770
38916
|
{ key: void 0, children: [], value: null }
|
|
38771
38917
|
]), [l, c] = useState(t), [u, d] = useState(!1), p = useCompile(), m = useAPIClient(), h = useServiceOptions$1(e), { options: g, field: f } = useAssociationFieldContext(), C = m.resource(g.target), { getCollectionJoinField: b, getInterface: S } = useCollectionManager_deprecated(), y = (L = f == null ? void 0 : f.componentProps) == null ? void 0 : L.fieldNames, v = (g == null ? void 0 : g.target) && (y == null ? void 0 : y.label) && b(`${g.target}.${y.label}`), F = useMemo(() => {
|
|
38772
|
-
var
|
|
38773
|
-
return v != null && v.interface && ((w = (
|
|
38918
|
+
var B, w;
|
|
38919
|
+
return v != null && v.interface && ((w = (B = S(v.interface)) == null ? void 0 : B.filterable) == null ? void 0 : w.operators[0].value) || "$includes";
|
|
38774
38920
|
}, [v]), A = useField();
|
|
38775
38921
|
useEffect(() => {
|
|
38776
|
-
var
|
|
38922
|
+
var B;
|
|
38777
38923
|
if (r) {
|
|
38778
|
-
const w = Array.isArray(r) ? extractLastNonNullValueObjects(r == null ? void 0 : r.filter((
|
|
38779
|
-
key:
|
|
38924
|
+
const w = Array.isArray(r) ? extractLastNonNullValueObjects(r == null ? void 0 : r.filter((N) => N.value), !0) : transformNestedData(r), M = (B = w == null ? void 0 : w.map) == null ? void 0 : B.call(w, (N) => ({
|
|
38925
|
+
key: N.parentId,
|
|
38780
38926
|
children: [],
|
|
38781
|
-
value:
|
|
38927
|
+
value: N
|
|
38782
38928
|
}));
|
|
38783
38929
|
a(M);
|
|
38784
38930
|
}
|
|
38785
38931
|
}, []);
|
|
38786
38932
|
const R = useCallback(
|
|
38787
|
-
(
|
|
38933
|
+
(B) => {
|
|
38788
38934
|
try {
|
|
38789
|
-
return
|
|
38790
|
-
var
|
|
38935
|
+
return B == null ? void 0 : B.filter((w) => ["number", "string"].includes(typeof w[y.value])).map((w) => {
|
|
38936
|
+
var N, k, j;
|
|
38791
38937
|
let M = p(w[y.label]);
|
|
38792
|
-
if ((
|
|
38938
|
+
if ((N = v == null ? void 0 : v.uiSchema) != null && N.enum)
|
|
38793
38939
|
if (Array.isArray(M))
|
|
38794
38940
|
M = M.map((O, q) => {
|
|
38795
38941
|
var U, G;
|
|
@@ -38809,52 +38955,52 @@ const InternalFileManager = (e) => {
|
|
|
38809
38955
|
});
|
|
38810
38956
|
}).filter(Boolean);
|
|
38811
38957
|
} catch (w) {
|
|
38812
|
-
return console.error(w),
|
|
38958
|
+
return console.error(w), B;
|
|
38813
38959
|
}
|
|
38814
38960
|
},
|
|
38815
38961
|
[v == null ? void 0 : v.uiSchema, y]
|
|
38816
|
-
), T = (
|
|
38962
|
+
), T = (B) => V(void 0, null, function* () {
|
|
38817
38963
|
var M;
|
|
38818
38964
|
const w = yield C.list({
|
|
38819
38965
|
pageSize: 200,
|
|
38820
38966
|
params: h == null ? void 0 : h.params,
|
|
38821
|
-
filter: mergeFilter([
|
|
38822
|
-
tree:
|
|
38967
|
+
filter: mergeFilter([B]),
|
|
38968
|
+
tree: B.parentId ? void 0 : !0
|
|
38823
38969
|
});
|
|
38824
38970
|
return (M = w == null ? void 0 : w.data) == null ? void 0 : M.data;
|
|
38825
|
-
}), D = (
|
|
38826
|
-
const
|
|
38827
|
-
if (k.splice(M + 1), k[M] = P(x({}, k[M]), { value: w }), w != null && w.id && (k[M + 1] = { key: w == null ? void 0 : w.id, children: (
|
|
38971
|
+
}), D = (B, w, M) => V(void 0, null, function* () {
|
|
38972
|
+
const N = yield T({ parentId: w == null ? void 0 : w.id }), k = [...i];
|
|
38973
|
+
if (k.splice(M + 1), k[M] = P(x({}, k[M]), { value: w }), w != null && w.id && (k[M + 1] = { key: w == null ? void 0 : w.id, children: (N == null ? void 0 : N.length) > 0 ? N : null }), a(k), ["o2m", "m2m"].includes(g.interface)) {
|
|
38828
38974
|
const j = Array.isArray(f.fieldValue) ? f.fieldValue : [];
|
|
38829
38975
|
j[A.index] = w, f.fieldValue = j;
|
|
38830
38976
|
} else
|
|
38831
38977
|
f.value = w;
|
|
38832
38978
|
o == null || o(k);
|
|
38833
|
-
}),
|
|
38834
|
-
var
|
|
38835
|
-
if (
|
|
38979
|
+
}), $ = (B, w, M) => V(void 0, null, function* () {
|
|
38980
|
+
var N, k, j;
|
|
38981
|
+
if (B) {
|
|
38836
38982
|
d(!0);
|
|
38837
38983
|
const O = yield T({ parentId: w == null ? void 0 : w.key });
|
|
38838
|
-
if (d(!1), c(O), M === (i == null ? void 0 : i.length) - 1 && ((
|
|
38984
|
+
if (d(!1), c(O), M === (i == null ? void 0 : i.length) - 1 && ((N = w == null ? void 0 : w.value) != null && N.id)) {
|
|
38839
38985
|
const q = yield T({ parentId: (k = w == null ? void 0 : w.value) == null ? void 0 : k.id }), E = [...i];
|
|
38840
38986
|
E.splice(M + 1), E[M] = P(x({}, E[M]), { value: w == null ? void 0 : w.value }), E[M + 1] = { key: (j = w == null ? void 0 : w.value) == null ? void 0 : j.id, children: (q == null ? void 0 : q.length) > 0 ? q : null }, a(E), o == null || o(E);
|
|
38841
38987
|
}
|
|
38842
38988
|
}
|
|
38843
|
-
}), z = (
|
|
38844
|
-
const M =
|
|
38989
|
+
}), z = (B, w) => V(void 0, null, function* () {
|
|
38990
|
+
const M = B ? {
|
|
38845
38991
|
[y.label]: {
|
|
38846
|
-
[F]:
|
|
38992
|
+
[F]: B
|
|
38847
38993
|
}
|
|
38848
38994
|
} : {};
|
|
38849
38995
|
d(!0);
|
|
38850
|
-
const
|
|
38996
|
+
const N = yield T(P(x({}, M), {
|
|
38851
38997
|
parentId: w == null ? void 0 : w.key
|
|
38852
38998
|
}));
|
|
38853
|
-
d(!1), c(
|
|
38999
|
+
d(!1), c(N);
|
|
38854
39000
|
});
|
|
38855
|
-
return /* @__PURE__ */ jsx(Space$1, { wrap: !0, children: i.map((
|
|
38856
|
-
var M,
|
|
38857
|
-
return
|
|
39001
|
+
return /* @__PURE__ */ jsx(Space$1, { wrap: !0, children: i.map((B, w) => {
|
|
39002
|
+
var M, N, k;
|
|
39003
|
+
return B.children && /* @__PURE__ */ jsx(
|
|
38858
39004
|
Select$1,
|
|
38859
39005
|
{
|
|
38860
39006
|
disabled: f.disabled,
|
|
@@ -38864,19 +39010,19 @@ const InternalFileManager = (e) => {
|
|
|
38864
39010
|
filterOption: !1,
|
|
38865
39011
|
filterSort: null,
|
|
38866
39012
|
defaultValue: {
|
|
38867
|
-
label: (M =
|
|
38868
|
-
value: (
|
|
39013
|
+
label: (M = B == null ? void 0 : B.value) == null ? void 0 : M[y.label],
|
|
39014
|
+
value: (N = B == null ? void 0 : B.value) == null ? void 0 : N[y.value]
|
|
38869
39015
|
},
|
|
38870
39016
|
labelInValue: !0,
|
|
38871
|
-
onSearch: (j) => z(j,
|
|
39017
|
+
onSearch: (j) => z(j, B),
|
|
38872
39018
|
fieldNames: y,
|
|
38873
39019
|
style: { minWidth: 150 },
|
|
38874
39020
|
onChange: (j, O) => D(j, O, w),
|
|
38875
39021
|
options: u ? [] : R(l),
|
|
38876
|
-
onDropdownVisibleChange: (j) =>
|
|
39022
|
+
onDropdownVisibleChange: (j) => $(j, B, w),
|
|
38877
39023
|
notFoundContent: u ? /* @__PURE__ */ jsx(Spin, { size: "small" }) : null
|
|
38878
39024
|
},
|
|
38879
|
-
`${(k =
|
|
39025
|
+
`${(k = B.value) == null ? void 0 : k.id}+ ${B.key} + ${y.label}`
|
|
38880
39026
|
);
|
|
38881
39027
|
}) });
|
|
38882
39028
|
}), AssociationCascadeSelect = connect((e) => /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(CascadeSelect, x({}, e)) })), InternalCascadeSelect = observer$1(
|
|
@@ -39086,11 +39232,11 @@ const InternalNesterCss = css`
|
|
|
39086
39232
|
});
|
|
39087
39233
|
}, InternalPicker = observer$1(
|
|
39088
39234
|
(e) => {
|
|
39089
|
-
var
|
|
39235
|
+
var B;
|
|
39090
39236
|
const L = e, { value: t, multiple: n, openSize: o, onChange: r, quickUpload: i, selectFile: a, shouldMountElement: l } = L, c = K(L, ["value", "multiple", "openSize", "onChange", "quickUpload", "selectFile", "shouldMountElement"]), u = useField(), d = useFieldNames$1(e), [p, m] = useState(!1), h = useFieldSchema(), g = useInsertSchema$1("Selector"), { options: f } = useAssociationFieldContext(), { collectionName: C } = useFormBlockContext(), b = useCompile(), S = useLabelUiSchema$1(f, (d == null ? void 0 : d.label) || "label"), y = h["x-add-new"], [v, F] = useState([]), A = useCollectionRecordData(), R = useMemo(() => t && Object.keys(t).length > 0 ? (Array.isArray(t) ? t : t ? [t] : []).filter(Boolean).map((M) => {
|
|
39091
|
-
const
|
|
39237
|
+
const N = M == null ? void 0 : M[d.label];
|
|
39092
39238
|
return P(x({}, M), {
|
|
39093
|
-
[d.label]: getLabelFormatValue$1(b(S), b(
|
|
39239
|
+
[d.label]: getLabelFormatValue$1(b(S), b(N))
|
|
39094
39240
|
});
|
|
39095
39241
|
}) : [], [t, d == null ? void 0 : d.label]), T = {
|
|
39096
39242
|
size: "small",
|
|
@@ -39108,14 +39254,14 @@ const InternalNesterCss = css`
|
|
|
39108
39254
|
}, D = () => {
|
|
39109
39255
|
var w;
|
|
39110
39256
|
return n == null ? null : Array.isArray(t) ? (w = t.filter(Boolean)) == null ? void 0 : w.map((M) => M == null ? void 0 : M[d.value]) : t == null ? void 0 : t[d.value];
|
|
39111
|
-
},
|
|
39257
|
+
}, $ = () => {
|
|
39112
39258
|
const w = (f == null ? void 0 : f.targetKey) || "id", M = R.map((k) => k[w]).filter(Boolean);
|
|
39113
39259
|
return M.length ? { $and: [{ [`${w}.$ne`]: M }] } : {};
|
|
39114
39260
|
}, z = () => {
|
|
39115
|
-
const { setVisible: w } = useActionContext(), { multiple: M, selectedRows:
|
|
39261
|
+
const { setVisible: w } = useActionContext(), { multiple: M, selectedRows: N, onChange: k, options: j, collectionField: O } = useContext(RecordPickerContext);
|
|
39116
39262
|
return {
|
|
39117
39263
|
onClick() {
|
|
39118
|
-
k(M ? unionBy(
|
|
39264
|
+
k(M ? unionBy(N, j, (O == null ? void 0 : O.targetKey) || "id") : (N == null ? void 0 : N[0]) || null), w(!1);
|
|
39119
39265
|
},
|
|
39120
39266
|
style: {
|
|
39121
39267
|
display: M !== !1 && ["o2m", "m2m", "mbm"].includes(O == null ? void 0 : O.interface) ? "block" : "none"
|
|
@@ -39145,7 +39291,7 @@ const InternalNesterCss = css`
|
|
|
39145
39291
|
r([]), F([]);
|
|
39146
39292
|
return;
|
|
39147
39293
|
}
|
|
39148
|
-
const M = R == null ? void 0 : R.filter((
|
|
39294
|
+
const M = R == null ? void 0 : R.filter((N) => w.includes(N[d.value]));
|
|
39149
39295
|
r(M), F(M);
|
|
39150
39296
|
}
|
|
39151
39297
|
} else {
|
|
@@ -39172,12 +39318,12 @@ const InternalNesterCss = css`
|
|
|
39172
39318
|
ActionContextProvider,
|
|
39173
39319
|
{
|
|
39174
39320
|
value: {
|
|
39175
|
-
openSize: ((
|
|
39321
|
+
openSize: ((B = h["x-component-props"]) == null ? void 0 : B.openSize) || o,
|
|
39176
39322
|
openMode: "drawer",
|
|
39177
39323
|
visible: p,
|
|
39178
39324
|
setVisible: m
|
|
39179
39325
|
},
|
|
39180
|
-
children: /* @__PURE__ */ jsx(RecordPickerProvider, P(x({}, T), { children: /* @__PURE__ */ jsx(CollectionProvider_deprecated, { name: f == null ? void 0 : f.target, children: /* @__PURE__ */ jsx(FormProvider, { children: /* @__PURE__ */ jsx(TableSelectorParamsProvider, { params: { filter:
|
|
39326
|
+
children: /* @__PURE__ */ jsx(RecordPickerProvider, P(x({}, T), { children: /* @__PURE__ */ jsx(CollectionProvider_deprecated, { name: f == null ? void 0 : f.target, children: /* @__PURE__ */ jsx(FormProvider, { children: /* @__PURE__ */ jsx(TableSelectorParamsProvider, { params: { filter: $() }, children: /* @__PURE__ */ jsx(
|
|
39181
39327
|
SchemaComponentOptions,
|
|
39182
39328
|
{
|
|
39183
39329
|
scope: {
|
|
@@ -39227,10 +39373,10 @@ const RenderRecord = React.memo(
|
|
|
39227
39373
|
const F = useCallback(() => v.current, []);
|
|
39228
39374
|
return useEffect(() => {
|
|
39229
39375
|
const A = toArr$3(h).map((R, T, D) => {
|
|
39230
|
-
const
|
|
39376
|
+
const $ = R == null ? void 0 : R[(e == null ? void 0 : e.label) || "label"], z = t ? transformNestedData(R).map((M) => M == null ? void 0 : M[(e == null ? void 0 : e.label) || "label"]).join(" / ") : isObject($) ? JSON.stringify($) : $, L = toValue$3(n(z), "N/A"), B = o(
|
|
39231
39377
|
(R == null ? void 0 : R.__collection) || (r == null ? void 0 : r.target),
|
|
39232
39378
|
(e == null ? void 0 : e.label) || "label"
|
|
39233
|
-
), w = getLabelFormatValue$1(n(
|
|
39379
|
+
), w = getLabelFormatValue$1(n(B), L, !0);
|
|
39234
39380
|
return /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
39235
39381
|
/* @__PURE__ */ jsx("span", { children: i ? w : a !== !1 ? /* @__PURE__ */ jsx(
|
|
39236
39382
|
"a",
|
|
@@ -39239,7 +39385,7 @@ const RenderRecord = React.memo(
|
|
|
39239
39385
|
g(!0);
|
|
39240
39386
|
},
|
|
39241
39387
|
onClick: (M) => {
|
|
39242
|
-
var
|
|
39388
|
+
var N;
|
|
39243
39389
|
g(!0), M.stopPropagation(), M.preventDefault(), l && !u.properties && (c(schema$1.Viewer), y.current = !0), y.current ? (setTimeout(() => {
|
|
39244
39390
|
d({
|
|
39245
39391
|
recordData: R,
|
|
@@ -39249,7 +39395,7 @@ const RenderRecord = React.memo(
|
|
|
39249
39395
|
}), y.current = !1) : u.properties && d({
|
|
39250
39396
|
recordData: R,
|
|
39251
39397
|
parentRecordData: p
|
|
39252
|
-
}), (
|
|
39398
|
+
}), (N = m == null ? void 0 : m.current) == null || N.setPopoverVisible(!1);
|
|
39253
39399
|
},
|
|
39254
39400
|
children: w
|
|
39255
39401
|
}
|
|
@@ -39653,7 +39799,7 @@ const CreateAction = observer$1(
|
|
|
39653
39799
|
const { onClick: t } = e, n = useCollection_deprecated(), o = useFieldSchema(), r = useField(), i = useForm(), a = useVariables$1(), l = useAclCheckFn(), c = o["x-enable-children"] || [], u = o == null ? void 0 : o["x-allow-add-to-current"], d = (R = o == null ? void 0 : o["x-component-props"]) == null ? void 0 : R.linkageFromForm, p = r.componentProps.type === "danger" ? void 0 : r.componentProps.type || "primary", { getChildrenCollections: m } = useCollectionManager_deprecated(), h = m(n.name), g = useMemo(() => c.map((T) => {
|
|
39654
39800
|
if (!T)
|
|
39655
39801
|
return;
|
|
39656
|
-
const D = h.find((
|
|
39802
|
+
const D = h.find(($) => $.name === T.collection);
|
|
39657
39803
|
if (D)
|
|
39658
39804
|
return P(x({}, D.getOptions()), {
|
|
39659
39805
|
title: T.title || D.title
|
|
@@ -39668,9 +39814,9 @@ const CreateAction = observer$1(
|
|
|
39668
39814
|
return useEffect(() => {
|
|
39669
39815
|
r.stateOfLinkageRules = {}, f.filter((T) => !T.disabled).forEach((T) => {
|
|
39670
39816
|
var D;
|
|
39671
|
-
(D = T.actions) == null || D.forEach((
|
|
39817
|
+
(D = T.actions) == null || D.forEach(($) => {
|
|
39672
39818
|
linkageAction({
|
|
39673
|
-
operator:
|
|
39819
|
+
operator: $.operator,
|
|
39674
39820
|
field: r,
|
|
39675
39821
|
condition: T.condition,
|
|
39676
39822
|
variables: a,
|
|
@@ -39939,7 +40085,7 @@ const CreateRecordAction$1 = forwardRef(InternalCreateRecordAction), initializer
|
|
|
39939
40085
|
S.current = t;
|
|
39940
40086
|
const y = useCallback(() => S.current, []);
|
|
39941
40087
|
return /* @__PURE__ */ jsx(Fragment, { children: toArr$3(e.value).map((F, A, R) => {
|
|
39942
|
-
const T = F == null ? void 0 : F[(r == null ? void 0 : r.label) || "label"], D = g ? transformNestedData(F).map((L) => L == null ? void 0 : L[(r == null ? void 0 : r.label) || "label"]).join(" / ") : isObject(T) ? JSON.stringify(T) : T,
|
|
40088
|
+
const T = F == null ? void 0 : F[(r == null ? void 0 : r.label) || "label"], D = g ? transformNestedData(F).map((L) => L == null ? void 0 : L[(r == null ? void 0 : r.label) || "label"]).join(" / ") : isObject(T) ? JSON.stringify(T) : T, $ = toValue$2(l(D), "N/A"), z = getTabFormatValue(l(u), $, F[o]);
|
|
39943
40089
|
return /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
39944
40090
|
/* @__PURE__ */ jsx("span", { children: d ? z : n !== !1 ? /* @__PURE__ */ jsx(
|
|
39945
40091
|
"a",
|
|
@@ -39948,7 +40094,7 @@ const CreateRecordAction$1 = forwardRef(InternalCreateRecordAction), initializer
|
|
|
39948
40094
|
e.setBtnHover(!0);
|
|
39949
40095
|
},
|
|
39950
40096
|
onClick: (L) => {
|
|
39951
|
-
var
|
|
40097
|
+
var B;
|
|
39952
40098
|
e.setBtnHover(!0), L.stopPropagation(), L.preventDefault(), c && !t.properties && (i(schema$1.Viewer), b.current = !0), b.current ? setTimeout(() => {
|
|
39953
40099
|
f({
|
|
39954
40100
|
recordData: F,
|
|
@@ -39958,7 +40104,7 @@ const CreateRecordAction$1 = forwardRef(InternalCreateRecordAction), initializer
|
|
|
39958
40104
|
}) : f({
|
|
39959
40105
|
recordData: F,
|
|
39960
40106
|
parentRecordData: C
|
|
39961
|
-
}), (
|
|
40107
|
+
}), (B = p == null ? void 0 : p.current) == null || B.setPopoverVisible(!1);
|
|
39962
40108
|
},
|
|
39963
40109
|
children: z
|
|
39964
40110
|
}
|
|
@@ -40023,9 +40169,9 @@ const useColumnsDeepMemoized = (e) => {
|
|
|
40023
40169
|
`, [n.paddingContentVerticalLG, n.marginSM]), f = useCollection(), C = useMemo(
|
|
40024
40170
|
() => d == null ? void 0 : d.map((S) => {
|
|
40025
40171
|
var A, R, T;
|
|
40026
|
-
const y = S.reduceProperties((D,
|
|
40027
|
-
if (isCollectionFieldComponent(
|
|
40028
|
-
return D.concat([
|
|
40172
|
+
const y = S.reduceProperties((D, $) => {
|
|
40173
|
+
if (isCollectionFieldComponent($))
|
|
40174
|
+
return D.concat([$]);
|
|
40029
40175
|
}, []), v = (y == null ? void 0 : y.length) > 0 ? y[0].name : S.name, F = !!((A = S["x-component-props"]) != null && A.columnHidden);
|
|
40030
40176
|
return P(x({
|
|
40031
40177
|
title: /* @__PURE__ */ jsx(RecursionField, { name: S.name, schema: S, onlyRenderSelf: !0 }),
|
|
@@ -40035,15 +40181,15 @@ const useColumnsDeepMemoized = (e) => {
|
|
|
40035
40181
|
columnHidden: F
|
|
40036
40182
|
}, S["x-component-props"]), {
|
|
40037
40183
|
width: F && !a ? 0 : ((T = S["x-component-props"]) == null ? void 0 : T.width) || 100,
|
|
40038
|
-
render: (D,
|
|
40039
|
-
var
|
|
40040
|
-
const z = (
|
|
40041
|
-
return /* @__PURE__ */ jsx(SubFormProvider, { value: { value:
|
|
40184
|
+
render: (D, $) => {
|
|
40185
|
+
var B;
|
|
40186
|
+
const z = (B = o.value) == null ? void 0 : B.indexOf($), L = o.address.concat($.__index || z);
|
|
40187
|
+
return /* @__PURE__ */ jsx(SubFormProvider, { value: { value: $, collection: f, fieldSchema: r.parent }, children: /* @__PURE__ */ jsx(RecordIndexProvider, { index: $.__index || z, children: /* @__PURE__ */ jsx(RecordProvider, { isNew: isNewRecord($), record: $, parent: u, children: /* @__PURE__ */ jsx(ColumnFieldProvider, { schema: S, basePath: L, children: /* @__PURE__ */ jsx("span", { role: "button", className: g, children: /* @__PURE__ */ jsx(RecursionField, { basePath: L, schema: S, onlyRenderProperties: !0 }) }) }) }) }) });
|
|
40042
40188
|
},
|
|
40043
|
-
onCell: (D,
|
|
40189
|
+
onCell: (D, $) => ({
|
|
40044
40190
|
record: D,
|
|
40045
40191
|
schema: S,
|
|
40046
|
-
rowIndex:
|
|
40192
|
+
rowIndex: $,
|
|
40047
40193
|
isSubTable: e.isSubTable,
|
|
40048
40194
|
columnHidden: F
|
|
40049
40195
|
}),
|
|
@@ -40163,7 +40309,7 @@ const useColumnsDeepMemoized = (e) => {
|
|
|
40163
40309
|
display: none !important;
|
|
40164
40310
|
}
|
|
40165
40311
|
`,
|
|
40166
|
-
itemRender: (D,
|
|
40312
|
+
itemRender: (D, $, z) => $ === "prev" ? /* @__PURE__ */ jsxs(
|
|
40167
40313
|
"div",
|
|
40168
40314
|
{
|
|
40169
40315
|
style: { display: "flex" },
|
|
@@ -40379,8 +40525,8 @@ const Table$1 = withDynamicSchemaProps(
|
|
|
40379
40525
|
"onExpand",
|
|
40380
40526
|
"loading",
|
|
40381
40527
|
"onClickRow"
|
|
40382
|
-
]), S = useArrayField(b), y = useFieldSchema(), { size: v = "small" } = (y == null ? void 0 : y["x-component-props"]) || {}, F = useCollection(), R = ((ce = y == null ? void 0 : y.parent) == null ? void 0 : ce["x-decorator"]) === "TableSelectorProvider" ? useTableSelectorContext() : useTableBlockContext(), { expandFlag: T, allIncludesChildren: D } = R,
|
|
40383
|
-
})), z = usePaginationProps$2(n, i), L = useTableColumns$1(b, z), [
|
|
40528
|
+
]), S = useArrayField(b), y = useFieldSchema(), { size: v = "small" } = (y == null ? void 0 : y["x-component-props"]) || {}, F = useCollection(), R = ((ce = y == null ? void 0 : y.parent) == null ? void 0 : ce["x-decorator"]) === "TableSelectorProvider" ? useTableSelectorContext() : useTableBlockContext(), { expandFlag: T, allIncludesChildren: D } = R, $ = useMemoizedFn(b.onRowDragEnd || (() => {
|
|
40529
|
+
})), z = usePaginationProps$2(n, i), L = useTableColumns$1(b, z), [B, w] = useState(() => T ? D : []), [M, N] = useState(((Ce = S == null ? void 0 : S.data) == null ? void 0 : Ce.selectedRowKeys) || []), [k, j] = useState([]), O = (p == null ? void 0 : p.type) !== "none", q = useRef(/* @__PURE__ */ new Map()), E = useMemo(() => css`
|
|
40384
40530
|
& > td {
|
|
40385
40531
|
background-color: ${t.controlItemBgActive} !important;
|
|
40386
40532
|
}
|
|
@@ -40395,7 +40541,7 @@ const Table$1 = withDynamicSchemaProps(
|
|
|
40395
40541
|
}) : null, [C, k]);
|
|
40396
40542
|
useDeepCompareEffect(() => {
|
|
40397
40543
|
const Z = T ? D : [];
|
|
40398
|
-
_.isEqual(Z,
|
|
40544
|
+
_.isEqual(Z, B) || w(Z);
|
|
40399
40545
|
}, [T, D]);
|
|
40400
40546
|
const H = useCallback((Z) => {
|
|
40401
40547
|
if (m)
|
|
@@ -40423,10 +40569,10 @@ const Table$1 = withDynamicSchemaProps(
|
|
|
40423
40569
|
return;
|
|
40424
40570
|
}
|
|
40425
40571
|
const le = (ve = (ye = (Se = se.active) == null ? void 0 : Se.data.current) == null ? void 0 : ye.sortable) == null ? void 0 : ve.index, de = (Re = (Fe = (Pe = se.over) == null ? void 0 : Pe.data.current) == null ? void 0 : Fe.sortable) == null ? void 0 : Re.index, be = S.value[le] || se.active, Ie = S.value[de] || se.over;
|
|
40426
|
-
S.move(le, de),
|
|
40572
|
+
S.move(le, de), $({ from: be, to: Ie });
|
|
40427
40573
|
}, []);
|
|
40428
40574
|
return /* @__PURE__ */ jsx(DndContext, { onDragEnd: ne, children: /* @__PURE__ */ jsx("tbody", x({}, Z)) });
|
|
40429
|
-
}, [S,
|
|
40575
|
+
}, [S, $]);
|
|
40430
40576
|
Y.displayName = "BodyWrapperComponent";
|
|
40431
40577
|
const J = useMemo(() => ({
|
|
40432
40578
|
header: {
|
|
@@ -40444,7 +40590,7 @@ const Table$1 = withDynamicSchemaProps(
|
|
|
40444
40590
|
type: "checkbox",
|
|
40445
40591
|
selectedRowKeys: M,
|
|
40446
40592
|
onChange(Z, ne) {
|
|
40447
|
-
S.data = S.data || {}, S.data.selectedRowKeys = Z, S.data.selectedRowData = ne,
|
|
40593
|
+
S.data = S.data || {}, S.data.selectedRowKeys = Z, S.data.selectedRowData = ne, N(Z), u == null || u(Z, ne);
|
|
40448
40594
|
},
|
|
40449
40595
|
getCheckboxProps(Z) {
|
|
40450
40596
|
return {
|
|
@@ -40519,14 +40665,14 @@ const Table$1 = withDynamicSchemaProps(
|
|
|
40519
40665
|
[k, U, JSON.stringify(m)]
|
|
40520
40666
|
), pe = useCallback(
|
|
40521
40667
|
(Z, ne) => {
|
|
40522
|
-
const se = Z ? [
|
|
40668
|
+
const se = Z ? [...B, ne[F.getPrimaryKey()]] : B.filter((le) => ne[F.getPrimaryKey()] !== le);
|
|
40523
40669
|
w(se), g == null || g(Z, ne);
|
|
40524
40670
|
},
|
|
40525
|
-
[
|
|
40671
|
+
[B, g, F]
|
|
40526
40672
|
), fe = useMemo(() => ({
|
|
40527
40673
|
onExpand: pe,
|
|
40528
|
-
expandedRowKeys:
|
|
40529
|
-
}), [
|
|
40674
|
+
expandedRowKeys: B
|
|
40675
|
+
}), [B, pe]);
|
|
40530
40676
|
return (
|
|
40531
40677
|
// If spinning is set to undefined, it will cause the subtable to always display loading, so we need to convert it here
|
|
40532
40678
|
/* @__PURE__ */ jsx(Spin, { spinning: !!f, children: /* @__PURE__ */ jsx(
|
|
@@ -40594,7 +40740,7 @@ const Table$1 = withDynamicSchemaProps(
|
|
|
40594
40740
|
}
|
|
40595
40741
|
`, SubTable = observer$1(
|
|
40596
40742
|
(e) => {
|
|
40597
|
-
var w, M,
|
|
40743
|
+
var w, M, N, k;
|
|
40598
40744
|
const { openSize: t } = e, { field: n, options: o } = useAssociationFieldContext(), { t: r } = useTranslation(), [i, a] = useState(!1), [l, c] = useState([]), u = useFieldNames$1(e), d = useFieldSchema(), p = useCompile(), m = useLabelUiSchema$1(o, (u == null ? void 0 : u.label) || "label"), h = useCollectionRecord(), g = useCollection(), { allowSelectExistingRecord: f, allowAddnew: C, allowDisassociation: b } = n.componentProps;
|
|
40599
40745
|
useSubTableSpecialCase({ field: n });
|
|
40600
40746
|
const S = (j, O) => {
|
|
@@ -40638,10 +40784,10 @@ const Table$1 = withDynamicSchemaProps(
|
|
|
40638
40784
|
}, A = () => {
|
|
40639
40785
|
const j = (o == null ? void 0 : o.targetKey) || "id", O = (n.value || []).map((E) => E == null ? void 0 : E[j]).filter(Boolean);
|
|
40640
40786
|
return O.length ? { $and: [{ [`${j}.$ne`]: O }] } : {};
|
|
40641
|
-
}, [R, T] = useState(1), [D,
|
|
40787
|
+
}, [R, T] = useState(1), [D, $] = useState(((w = n.componentProps) == null ? void 0 : w.pageSize) || 10);
|
|
40642
40788
|
useEffect(() => {
|
|
40643
40789
|
var j;
|
|
40644
|
-
|
|
40790
|
+
$((j = n.componentProps) == null ? void 0 : j.pageSize);
|
|
40645
40791
|
}, [(M = n.componentProps) == null ? void 0 : M.pageSize]);
|
|
40646
40792
|
const z = useMemo(() => {
|
|
40647
40793
|
var O;
|
|
@@ -40651,13 +40797,13 @@ const Table$1 = withDynamicSchemaProps(
|
|
|
40651
40797
|
pageSize: D || 10,
|
|
40652
40798
|
total: n == null ? void 0 : n.value,
|
|
40653
40799
|
onChange: (q, E) => {
|
|
40654
|
-
T(q),
|
|
40800
|
+
T(q), $(E), n.onInput(n.value);
|
|
40655
40801
|
},
|
|
40656
40802
|
showSizeChanger: !0,
|
|
40657
40803
|
pageSizeOptions: ["10", "20", "50", "100"],
|
|
40658
40804
|
hideOnSinglePage: !1
|
|
40659
40805
|
};
|
|
40660
|
-
}, [(
|
|
40806
|
+
}, [(N = n.value) == null ? void 0 : N.length, D, R]), L = () => {
|
|
40661
40807
|
const { field: j } = useAssociationFieldContext();
|
|
40662
40808
|
return {
|
|
40663
40809
|
run() {
|
|
@@ -40667,7 +40813,7 @@ const Table$1 = withDynamicSchemaProps(
|
|
|
40667
40813
|
return T(O), j.onInput(j.value);
|
|
40668
40814
|
}
|
|
40669
40815
|
};
|
|
40670
|
-
},
|
|
40816
|
+
}, B = () => ({
|
|
40671
40817
|
run() {
|
|
40672
40818
|
a(!0);
|
|
40673
40819
|
}
|
|
@@ -40718,7 +40864,7 @@ const Table$1 = withDynamicSchemaProps(
|
|
|
40718
40864
|
f && /* @__PURE__ */ jsx(
|
|
40719
40865
|
Action.Link,
|
|
40720
40866
|
{
|
|
40721
|
-
useAction:
|
|
40867
|
+
useAction: B,
|
|
40722
40868
|
title: /* @__PURE__ */ jsxs(Space$1, { style: { gap: 2 }, children: [
|
|
40723
40869
|
/* @__PURE__ */ jsx(ZoomInOutlined, {}),
|
|
40724
40870
|
" ",
|
|
@@ -40852,14 +40998,14 @@ const ReadPretty$7 = observer$1(
|
|
|
40852
40998
|
InternalAssociationSelect.displayName = "InternalAssociationSelect";
|
|
40853
40999
|
const AssociationSelect = InternalAssociationSelect;
|
|
40854
41000
|
AssociationSelect.Designer = function e() {
|
|
40855
|
-
var M,
|
|
40856
|
-
const { getCollectionFields: t, getInterface: n, getCollectionJoinField: o, getCollection: r, isTitleField: i } = useCollectionManager_deprecated(), { getField: a } = useCollection_deprecated(), { form: l } = useFormBlockContext(), c = useField(), u = useFieldSchema(), { t: d } = useTranslation(), p = useFilterByTk(), { dn: m, refresh: h, insertAdjacent: g } = useDesignable(), f = useCompile(), C = useIsShowMultipleSwitch(), { isAllowToSetDefaultValue: b } = useIsAllowToSetDefaultValue(), S = a(u.name) || o(u["x-collection-field"]), y = useFieldComponentOptions(), v = c.address.segments.includes("__form_grid"), F = n(S == null ? void 0 : S.interface), A = (M = F == null ? void 0 : F.validateSchema) == null ? void 0 : M.call(F, u), R = (
|
|
41001
|
+
var M, N, k, j, O, q, E, U, G, H, W;
|
|
41002
|
+
const { getCollectionFields: t, getInterface: n, getCollectionJoinField: o, getCollection: r, isTitleField: i } = useCollectionManager_deprecated(), { getField: a } = useCollection_deprecated(), { form: l } = useFormBlockContext(), c = useField(), u = useFieldSchema(), { t: d } = useTranslation(), p = useFilterByTk(), { dn: m, refresh: h, insertAdjacent: g } = useDesignable(), f = useCompile(), C = useIsShowMultipleSwitch(), { isAllowToSetDefaultValue: b } = useIsAllowToSetDefaultValue(), S = a(u.name) || o(u["x-collection-field"]), y = useFieldComponentOptions(), v = c.address.segments.includes("__form_grid"), F = n(S == null ? void 0 : S.interface), A = (M = F == null ? void 0 : F.validateSchema) == null ? void 0 : M.call(F, u), R = (N = S == null ? void 0 : S.uiSchema) == null ? void 0 : N.title, T = S != null && S.target ? t(S == null ? void 0 : S.target) : [];
|
|
40857
41003
|
c.title === R || c.title;
|
|
40858
|
-
const D = useSortFields(S == null ? void 0 : S.target),
|
|
41004
|
+
const D = useSortFields(S == null ? void 0 : S.target), $ = ((O = (j = (k = c.componentProps) == null ? void 0 : k.service) == null ? void 0 : j.params) == null ? void 0 : O.sort) || [];
|
|
40859
41005
|
useEffect(() => {
|
|
40860
41006
|
c.readPretty !== u["x-read-pretty"] && (c.readPretty = !!u["x-read-pretty"]);
|
|
40861
41007
|
}, [u["x-read-pretty"]]);
|
|
40862
|
-
const z =
|
|
41008
|
+
const z = $ == null ? void 0 : $.map((X) => X.startsWith("-") ? {
|
|
40863
41009
|
field: X.substring(1),
|
|
40864
41010
|
direction: "desc"
|
|
40865
41011
|
} : {
|
|
@@ -40874,8 +41020,8 @@ AssociationSelect.Designer = function e() {
|
|
|
40874
41020
|
label: f((Y = X == null ? void 0 : X.uiSchema) == null ? void 0 : Y.title) || (X == null ? void 0 : X.name)
|
|
40875
41021
|
};
|
|
40876
41022
|
});
|
|
40877
|
-
let
|
|
40878
|
-
u["x-disabled"] === !0 && (
|
|
41023
|
+
let B = "editable";
|
|
41024
|
+
u["x-disabled"] === !0 && (B = "readonly"), u["x-read-pretty"] === !0 && (B = "read-pretty");
|
|
40879
41025
|
const w = _.omit(u, "required");
|
|
40880
41026
|
return /* @__PURE__ */ jsxs(GeneralSchemaDesigner, { children: [
|
|
40881
41027
|
/* @__PURE__ */ jsx(GeneralSchemaItems, {}),
|
|
@@ -41188,7 +41334,7 @@ AssociationSelect.Designer = function e() {
|
|
|
41188
41334
|
{ label: d("Readonly"), value: "readonly" },
|
|
41189
41335
|
{ label: d("Easy-reading"), value: "read-pretty" }
|
|
41190
41336
|
],
|
|
41191
|
-
value:
|
|
41337
|
+
value: B,
|
|
41192
41338
|
onChange: (X) => {
|
|
41193
41339
|
const Y = {
|
|
41194
41340
|
"x-uid": u["x-uid"]
|
|
@@ -41251,22 +41397,22 @@ AssociationSelect.Designer = function e() {
|
|
|
41251
41397
|
] });
|
|
41252
41398
|
};
|
|
41253
41399
|
AssociationSelect.FilterDesigner = function e() {
|
|
41254
|
-
var F, A, R, T, D,
|
|
41400
|
+
var F, A, R, T, D, $, z, L, B, w, M;
|
|
41255
41401
|
const { getCollectionFields: t, getInterface: n, getCollectionJoinField: o } = useCollectionManager_deprecated(), { getField: r } = useCollection_deprecated(), { form: i } = useFormBlockContext(), a = useField(), l = useFieldSchema(), { t: c } = useTranslation(), { dn: u, refresh: d } = useDesignable(), p = useCompile(), m = r(l.name) || o(l["x-collection-field"]), h = n(m == null ? void 0 : m.interface), g = (F = h == null ? void 0 : h.validateSchema) == null ? void 0 : F.call(h, l), f = (A = m == null ? void 0 : m.uiSchema) == null ? void 0 : A.title, C = m != null && m.target ? t(m == null ? void 0 : m.target) : [];
|
|
41256
41402
|
a.title === f || a.title;
|
|
41257
|
-
const b = useSortFields(m == null ? void 0 : m.target), S = ((D = (T = (R = a.componentProps) == null ? void 0 : R.service) == null ? void 0 : T.params) == null ? void 0 : D.sort) || [], y = S == null ? void 0 : S.map((
|
|
41258
|
-
field:
|
|
41403
|
+
const b = useSortFields(m == null ? void 0 : m.target), S = ((D = (T = (R = a.componentProps) == null ? void 0 : R.service) == null ? void 0 : T.params) == null ? void 0 : D.sort) || [], y = S == null ? void 0 : S.map((N) => N.startsWith("-") ? {
|
|
41404
|
+
field: N.substring(1),
|
|
41259
41405
|
direction: "desc"
|
|
41260
41406
|
} : {
|
|
41261
|
-
field:
|
|
41407
|
+
field: N,
|
|
41262
41408
|
direction: "asc"
|
|
41263
41409
|
});
|
|
41264
41410
|
a.readPretty || a.required;
|
|
41265
|
-
const v = C.filter((
|
|
41411
|
+
const v = C.filter((N) => !(N != null && N.target) && N.type !== "boolean").map((N) => {
|
|
41266
41412
|
var k;
|
|
41267
41413
|
return {
|
|
41268
|
-
value:
|
|
41269
|
-
label: p((k =
|
|
41414
|
+
value: N == null ? void 0 : N.name,
|
|
41415
|
+
label: p((k = N == null ? void 0 : N.uiSchema) == null ? void 0 : k.title) || (N == null ? void 0 : N.name)
|
|
41270
41416
|
};
|
|
41271
41417
|
});
|
|
41272
41418
|
return l["x-disabled"], l["x-read-pretty"], /* @__PURE__ */ jsxs(GeneralSchemaDesigner, { children: [
|
|
@@ -41357,10 +41503,10 @@ AssociationSelect.FilterDesigner = function e() {
|
|
|
41357
41503
|
}
|
|
41358
41504
|
}
|
|
41359
41505
|
},
|
|
41360
|
-
onSubmit: (
|
|
41506
|
+
onSubmit: (N) => {
|
|
41361
41507
|
var q;
|
|
41362
41508
|
const k = [];
|
|
41363
|
-
for (const E of
|
|
41509
|
+
for (const E of N.rules)
|
|
41364
41510
|
k.push(_.pickBy(E, _.identity));
|
|
41365
41511
|
const j = {
|
|
41366
41512
|
"x-uid": l["x-uid"]
|
|
@@ -41375,7 +41521,7 @@ AssociationSelect.FilterDesigner = function e() {
|
|
|
41375
41521
|
}
|
|
41376
41522
|
}
|
|
41377
41523
|
),
|
|
41378
|
-
i && !(i != null && i.readPretty) && ((
|
|
41524
|
+
i && !(i != null && i.readPretty) && (($ = m == null ? void 0 : m.uiSchema) == null ? void 0 : $.type) && /* @__PURE__ */ jsx(
|
|
41379
41525
|
SchemaSettingsModalItem,
|
|
41380
41526
|
{
|
|
41381
41527
|
title: c("Set default value"),
|
|
@@ -41392,11 +41538,11 @@ AssociationSelect.FilterDesigner = function e() {
|
|
|
41392
41538
|
})
|
|
41393
41539
|
}
|
|
41394
41540
|
},
|
|
41395
|
-
onSubmit: (
|
|
41541
|
+
onSubmit: (N) => {
|
|
41396
41542
|
const k = {
|
|
41397
41543
|
"x-uid": l["x-uid"]
|
|
41398
41544
|
};
|
|
41399
|
-
a.value !==
|
|
41545
|
+
a.value !== N.default && (a.value = N.default), l.default = N.default, k.default = N.default, u.emit("patch", {
|
|
41400
41546
|
schema: k
|
|
41401
41547
|
}), d();
|
|
41402
41548
|
}
|
|
@@ -41406,10 +41552,10 @@ AssociationSelect.FilterDesigner = function e() {
|
|
|
41406
41552
|
SchemaSettingsDataScope,
|
|
41407
41553
|
{
|
|
41408
41554
|
collectionName: m == null ? void 0 : m.target,
|
|
41409
|
-
defaultFilter: ((
|
|
41555
|
+
defaultFilter: ((B = (L = (z = a.componentProps) == null ? void 0 : z.service) == null ? void 0 : L.params) == null ? void 0 : B.filter) || {},
|
|
41410
41556
|
form: i,
|
|
41411
|
-
onSubmit: ({ filter:
|
|
41412
|
-
|
|
41557
|
+
onSubmit: ({ filter: N }) => {
|
|
41558
|
+
N = removeNullCondition(N), _.set(a.componentProps, "service.params.filter", N), l["x-component-props"] = a.componentProps, u.emit("patch", {
|
|
41413
41559
|
schema: {
|
|
41414
41560
|
"x-uid": l["x-uid"],
|
|
41415
41561
|
"x-component-props": a.componentProps
|
|
@@ -41492,8 +41638,8 @@ AssociationSelect.FilterDesigner = function e() {
|
|
|
41492
41638
|
}
|
|
41493
41639
|
}
|
|
41494
41640
|
},
|
|
41495
|
-
onSubmit: ({ sort:
|
|
41496
|
-
const k =
|
|
41641
|
+
onSubmit: ({ sort: N }) => {
|
|
41642
|
+
const k = N.map((j) => j.direction === "desc" ? `-${j.field}` : j.field);
|
|
41497
41643
|
_.set(a.componentProps, "service.params.sort", k), l["x-component-props"] = a.componentProps, u.emit("patch", {
|
|
41498
41644
|
schema: {
|
|
41499
41645
|
"x-uid": l["x-uid"],
|
|
@@ -41509,12 +41655,12 @@ AssociationSelect.FilterDesigner = function e() {
|
|
|
41509
41655
|
title: c("Title field"),
|
|
41510
41656
|
options: v,
|
|
41511
41657
|
value: (M = (w = a == null ? void 0 : a.componentProps) == null ? void 0 : w.fieldNames) == null ? void 0 : M.label,
|
|
41512
|
-
onChange: (
|
|
41658
|
+
onChange: (N) => {
|
|
41513
41659
|
var O, q;
|
|
41514
41660
|
const k = {
|
|
41515
41661
|
"x-uid": l["x-uid"]
|
|
41516
41662
|
}, j = P(x(x({}, (q = (O = m == null ? void 0 : m.uiSchema) == null ? void 0 : O["x-component-props"]) == null ? void 0 : q.fieldNames), a.componentProps.fieldNames), {
|
|
41517
|
-
label:
|
|
41663
|
+
label: N
|
|
41518
41664
|
});
|
|
41519
41665
|
a.componentProps.fieldNames = j, l["x-component-props"] = l["x-component-props"] || {}, l["x-component-props"].fieldNames = j, k["x-component-props"] = l["x-component-props"], u.emit("patch", {
|
|
41520
41666
|
schema: k
|
|
@@ -43045,7 +43191,7 @@ const InternalListBlockProvider = (e) => {
|
|
|
43045
43191
|
return e - m - h - d;
|
|
43046
43192
|
}, InternalList = withSkeletonComponent(
|
|
43047
43193
|
(e) => {
|
|
43048
|
-
var L,
|
|
43194
|
+
var L, B, w;
|
|
43049
43195
|
const { service: t } = useListBlockContext(), { run: n, params: o } = t, r = useFieldSchema(), i = useDesigner(), a = (L = t == null ? void 0 : t.data) == null ? void 0 : L.meta, { pageSize: l, count: c, hasNext: u, page: d } = a || {}, p = useField(), [m] = useState(/* @__PURE__ */ new Map()), { wrapSSR: h, componentCls: g, hashId: f } = useStyles$5(), C = useListBlockHeight(), { token: b } = theme$1.useToken(), S = useCallback(
|
|
43050
43196
|
(M) => (m.has(M) || m.set(
|
|
43051
43197
|
M,
|
|
@@ -43058,10 +43204,10 @@ const InternalListBlockProvider = (e) => {
|
|
|
43058
43204
|
), m.get(M)),
|
|
43059
43205
|
[r.properties, m]
|
|
43060
43206
|
), y = [5, 10, 20, 50, 100, 200], v = useCallback(
|
|
43061
|
-
(M,
|
|
43207
|
+
(M, N) => {
|
|
43062
43208
|
n(P(x({}, o == null ? void 0 : o[0]), {
|
|
43063
43209
|
page: M,
|
|
43064
|
-
pageSize:
|
|
43210
|
+
pageSize: N
|
|
43065
43211
|
}));
|
|
43066
43212
|
},
|
|
43067
43213
|
[n, o]
|
|
@@ -43092,7 +43238,7 @@ const InternalListBlockProvider = (e) => {
|
|
|
43092
43238
|
display: none !important;
|
|
43093
43239
|
}
|
|
43094
43240
|
`,
|
|
43095
|
-
itemRender: (
|
|
43241
|
+
itemRender: (N, k, j) => k === "prev" ? /* @__PURE__ */ jsxs(
|
|
43096
43242
|
"div",
|
|
43097
43243
|
{
|
|
43098
43244
|
style: { display: "flex" },
|
|
@@ -43147,17 +43293,17 @@ const InternalListBlockProvider = (e) => {
|
|
|
43147
43293
|
children: /* @__PURE__ */ jsx(
|
|
43148
43294
|
List$1,
|
|
43149
43295
|
P(x({}, e), {
|
|
43150
|
-
pagination: !a || !((
|
|
43296
|
+
pagination: !a || !((B = p.value) != null && B.length) ? !1 : z,
|
|
43151
43297
|
loading: t == null ? void 0 : t.loading,
|
|
43152
|
-
children: (w = p.value) != null && w.length ? p.value.map((M,
|
|
43298
|
+
children: (w = p.value) != null && w.length ? p.value.map((M, N) => /* @__PURE__ */ jsx(
|
|
43153
43299
|
NocoBaseRecursionField,
|
|
43154
43300
|
{
|
|
43155
43301
|
basePath: p.address,
|
|
43156
|
-
name:
|
|
43302
|
+
name: N,
|
|
43157
43303
|
onlyRenderProperties: !0,
|
|
43158
|
-
schema: S(
|
|
43304
|
+
schema: S(N)
|
|
43159
43305
|
},
|
|
43160
|
-
|
|
43306
|
+
N
|
|
43161
43307
|
)) : null
|
|
43162
43308
|
})
|
|
43163
43309
|
)
|
|
@@ -43723,8 +43869,8 @@ const useMenuTranslation = () => useTranslation("lm-menus"), toItems$1 = (e = {}
|
|
|
43723
43869
|
onFieldChange("target", (A) => {
|
|
43724
43870
|
var T, D;
|
|
43725
43871
|
const [, R] = ((D = (T = A == null ? void 0 : A.value) == null ? void 0 : T.split) == null ? void 0 : D.call(T, "||")) || [];
|
|
43726
|
-
A.query("position").take((
|
|
43727
|
-
|
|
43872
|
+
A.query("position").take(($) => {
|
|
43873
|
+
$.dataSource = R === "Menu.SubMenu" ? [
|
|
43728
43874
|
{ label: i("Before"), value: "beforeBegin" },
|
|
43729
43875
|
{ label: i("After"), value: "afterEnd" },
|
|
43730
43876
|
{ label: i("Inner"), value: "beforeEnd" }
|
|
@@ -43800,8 +43946,8 @@ const useMenuTranslation = () => useTranslation("lm-menus"), toItems$1 = (e = {}
|
|
|
43800
43946
|
}
|
|
43801
43947
|
}), [p, i]), b = useCallback(
|
|
43802
43948
|
({ target: F, position: A }) => {
|
|
43803
|
-
var
|
|
43804
|
-
const [R] = ((
|
|
43949
|
+
var $;
|
|
43950
|
+
const [R] = (($ = F == null ? void 0 : F.split) == null ? void 0 : $.call(F, "||")) || [];
|
|
43805
43951
|
if (!R)
|
|
43806
43952
|
return;
|
|
43807
43953
|
const T = findByUid(a, R), D = createDesignable({
|
|
@@ -44210,14 +44356,14 @@ const Menu = React.memo((e) => {
|
|
|
44210
44356
|
var L;
|
|
44211
44357
|
let z;
|
|
44212
44358
|
if (o) {
|
|
44213
|
-
const
|
|
44214
|
-
z = (
|
|
44359
|
+
const B = findKeysByUid(f, o);
|
|
44360
|
+
z = (B == null ? void 0 : B[0]) || null;
|
|
44215
44361
|
} else
|
|
44216
44362
|
z = (F == null ? void 0 : F[0]) || null;
|
|
44217
44363
|
if (n === "mix" && z) {
|
|
44218
|
-
const
|
|
44219
|
-
if ((
|
|
44220
|
-
return
|
|
44364
|
+
const B = (L = f.properties) == null ? void 0 : L[z];
|
|
44365
|
+
if ((B == null ? void 0 : B["x-component"]) === "Menu.SubMenu")
|
|
44366
|
+
return B;
|
|
44221
44367
|
}
|
|
44222
44368
|
return null;
|
|
44223
44369
|
}, [F, n, f, o]);
|
|
@@ -44231,7 +44377,7 @@ const Menu = React.memo((e) => {
|
|
|
44231
44377
|
}, [o]), useEffect(() => {
|
|
44232
44378
|
["inline", "mix"].includes(n) && T(F);
|
|
44233
44379
|
}, [F]);
|
|
44234
|
-
const
|
|
44380
|
+
const $ = useContext(SchemaComponentContext);
|
|
44235
44381
|
return /* @__PURE__ */ jsx(DndContext, { children: /* @__PURE__ */ jsx(MenuItemDesignerContext.Provider, { value: g, children: /* @__PURE__ */ jsxs(MenuModeContext.Provider, { value: n, children: [
|
|
44236
44382
|
/* @__PURE__ */ jsx(
|
|
44237
44383
|
HeaderMenu,
|
|
@@ -44248,7 +44394,7 @@ const Menu = React.memo((e) => {
|
|
|
44248
44394
|
defaultSelectedKeys: F,
|
|
44249
44395
|
defaultOpenKeys: R,
|
|
44250
44396
|
selectedKeys: y,
|
|
44251
|
-
designable:
|
|
44397
|
+
designable: $.designable,
|
|
44252
44398
|
render: b,
|
|
44253
44399
|
children: l
|
|
44254
44400
|
}
|
|
@@ -44266,7 +44412,7 @@ const Menu = React.memo((e) => {
|
|
|
44266
44412
|
render: b,
|
|
44267
44413
|
t: h,
|
|
44268
44414
|
api: C,
|
|
44269
|
-
designable:
|
|
44415
|
+
designable: $.designable
|
|
44270
44416
|
}
|
|
44271
44417
|
)
|
|
44272
44418
|
] }) }) });
|
|
@@ -44782,16 +44928,16 @@ const toValue = (e, t) => e == null ? t : e, ReadPrettyRecordPicker = observer$1
|
|
|
44782
44928
|
if (isShowFilePicker(h))
|
|
44783
44929
|
return u ? /* @__PURE__ */ jsx(Preview, x({}, e)) : null;
|
|
44784
44930
|
const b = () => toArr$3(e.value).map((A, R, T) => {
|
|
44785
|
-
const D = toValue(m(A == null ? void 0 : A[(i == null ? void 0 : i.label) || "label"]), "N/A"),
|
|
44931
|
+
const D = toValue(m(A == null ? void 0 : A[(i == null ? void 0 : i.label) || "label"]), "N/A"), $ = getLabelFormatValue(h, D, !0);
|
|
44786
44932
|
return /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
44787
|
-
/* @__PURE__ */ jsx("span", { className: "test-record-picker-read-pretty-item", children: g || f ?
|
|
44933
|
+
/* @__PURE__ */ jsx("span", { className: "test-record-picker-read-pretty-item", children: g || f ? $ : /* @__PURE__ */ jsx(
|
|
44788
44934
|
"a",
|
|
44789
44935
|
{
|
|
44790
44936
|
onClick: (z) => {
|
|
44791
44937
|
var L;
|
|
44792
44938
|
z.stopPropagation(), z.preventDefault(), l(!0), p(A), (L = C == null ? void 0 : C.current) == null || L.setPopoverVisible(!1);
|
|
44793
44939
|
},
|
|
44794
|
-
children:
|
|
44940
|
+
children: $
|
|
44795
44941
|
}
|
|
44796
44942
|
) }),
|
|
44797
44943
|
R < T.length - 1 ? /* @__PURE__ */ jsx("span", { style: { marginRight: 4, color: "#aaa" }, children: "," }) : null
|
|
@@ -45619,8 +45765,8 @@ const useStyles$2 = genStyleHook("nb-rich-text", (e) => {
|
|
|
45619
45765
|
"aria-label": `checkbox-${y.name}`
|
|
45620
45766
|
}),
|
|
45621
45767
|
renderCell: (y, v, F, A) => {
|
|
45622
|
-
var D,
|
|
45623
|
-
const R = (D = e == null ? void 0 : e.pagination) == null ? void 0 : D.current, T = ((
|
|
45768
|
+
var D, $;
|
|
45769
|
+
const R = (D = e == null ? void 0 : e.pagination) == null ? void 0 : D.current, T = (($ = e == null ? void 0 : e.pagination) == null ? void 0 : $.pageSize) || 20;
|
|
45624
45770
|
return R && (F = F + (R - 1) * T), /* @__PURE__ */ jsxs(
|
|
45625
45771
|
"div",
|
|
45626
45772
|
{
|
|
@@ -46205,14 +46351,14 @@ const TableActionColumnDesigner = (e) => {
|
|
|
46205
46351
|
"sort-field"
|
|
46206
46352
|
);
|
|
46207
46353
|
}, TableBlockDesigner = () => {
|
|
46208
|
-
var T, D,
|
|
46209
|
-
const { name: e, title: t } = useCollection_deprecated(), { getCollectionField: n, getCollection: o } = useCollectionManager_deprecated(), r = useField(), i = useFieldSchema(), { form: a } = useFormBlockContext(), l = useSortFields(e), { service: c } = useTableBlockContext(), { t: u } = useTranslation(), { dn: d } = useDesignable(), { componentNamePrefix: p } = useBlockTemplateContext(), m = ((D = (T = i == null ? void 0 : i["x-decorator-props"]) == null ? void 0 : T.params) == null ? void 0 : D.sort) || [], h = ((
|
|
46354
|
+
var T, D, $, z, L, B, w, M, N, k, j;
|
|
46355
|
+
const { name: e, title: t } = useCollection_deprecated(), { getCollectionField: n, getCollection: o } = useCollectionManager_deprecated(), r = useField(), i = useFieldSchema(), { form: a } = useFormBlockContext(), l = useSortFields(e), { service: c } = useTableBlockContext(), { t: u } = useTranslation(), { dn: d } = useDesignable(), { componentNamePrefix: p } = useBlockTemplateContext(), m = ((D = (T = i == null ? void 0 : i["x-decorator-props"]) == null ? void 0 : T.params) == null ? void 0 : D.sort) || [], h = (($ = i == null ? void 0 : i["x-decorator-props"]) == null ? void 0 : $.resource) || ((z = i == null ? void 0 : i["x-decorator-props"]) == null ? void 0 : z.association), g = !((L = i == null ? void 0 : i["x-decorator-props"]) != null && L.disableTemplate), f = m == null ? void 0 : m.map((O) => O != null && O.startsWith("-") ? {
|
|
46210
46356
|
field: O.substring(1),
|
|
46211
46357
|
direction: "desc"
|
|
46212
46358
|
} : {
|
|
46213
46359
|
field: O,
|
|
46214
46360
|
direction: "asc"
|
|
46215
|
-
}), C = useSchemaTemplate(), b = useCollection_deprecated(), { dragSort: S, resource: y } = r.decoratorProps, v = y && n(y), F = y != null && y.includes(".") ? (
|
|
46361
|
+
}), C = useSchemaTemplate(), b = useCollection_deprecated(), { dragSort: S, resource: y } = r.decoratorProps, v = y && n(y), F = y != null && y.includes(".") ? (B = o(v == null ? void 0 : v.target)) == null ? void 0 : B.tree : !!(b != null && b.tree), A = useCallback(
|
|
46216
46362
|
({ filter: O }) => {
|
|
46217
46363
|
O = removeNullCondition(O);
|
|
46218
46364
|
const q = r.decoratorProps.params || {};
|
|
@@ -46368,7 +46514,7 @@ const TableActionColumnDesigner = (e) => {
|
|
|
46368
46514
|
SchemaSettingsSelectItem,
|
|
46369
46515
|
{
|
|
46370
46516
|
title: u("Records per page"),
|
|
46371
|
-
value: ((k = (
|
|
46517
|
+
value: ((k = (N = r.decoratorProps) == null ? void 0 : N.params) == null ? void 0 : k.pageSize) || 20,
|
|
46372
46518
|
options: [
|
|
46373
46519
|
{ label: "5", value: 5 },
|
|
46374
46520
|
{ label: "10", value: 10 },
|
|
@@ -46451,29 +46597,29 @@ TableField.ActionBar = observer$1(
|
|
|
46451
46597
|
{ displayName: "TableField.ActionBar" }
|
|
46452
46598
|
);
|
|
46453
46599
|
const TableSelectorDesigner = () => {
|
|
46454
|
-
var R, T, D,
|
|
46455
|
-
const { name: e, title: t } = useCollection_deprecated(), { getCollectionJoinField: n, getAllCollectionsInheritChain: o } = useCollectionManager_deprecated(), r = useField(), i = useFieldSchema(), { form: a } = useFormBlockContext(), l = useSortFields(e), { service: c, extraFilter: u } = useTableSelectorContext(), { t: d } = useTranslation(), { dn: p } = useDesignable(), m = ((T = (R = i == null ? void 0 : i["x-decorator-props"]) == null ? void 0 : R.params) == null ? void 0 : T.sort) || [], h = recursiveParent$1(i, "CollectionField"), g = n(h == null ? void 0 : h["x-collection-field"]), f = m == null ? void 0 : m.map((
|
|
46456
|
-
field:
|
|
46600
|
+
var R, T, D, $, z, L;
|
|
46601
|
+
const { name: e, title: t } = useCollection_deprecated(), { getCollectionJoinField: n, getAllCollectionsInheritChain: o } = useCollectionManager_deprecated(), r = useField(), i = useFieldSchema(), { form: a } = useFormBlockContext(), l = useSortFields(e), { service: c, extraFilter: u } = useTableSelectorContext(), { t: d } = useTranslation(), { dn: p } = useDesignable(), m = ((T = (R = i == null ? void 0 : i["x-decorator-props"]) == null ? void 0 : R.params) == null ? void 0 : T.sort) || [], h = recursiveParent$1(i, "CollectionField"), g = n(h == null ? void 0 : h["x-collection-field"]), f = m == null ? void 0 : m.map((B) => B.startsWith("-") ? {
|
|
46602
|
+
field: B.substring(1),
|
|
46457
46603
|
direction: "desc"
|
|
46458
46604
|
} : {
|
|
46459
|
-
field:
|
|
46605
|
+
field: B,
|
|
46460
46606
|
direction: "asc"
|
|
46461
46607
|
}), C = useSchemaTemplate(), b = useCollection_deprecated(), { dragSort: S } = r.decoratorProps, y = useRecord(), v = useVariables$1(), { currentFormCollection: F } = useContext(RecordPickerContext), A = useLocalVariables$1({ collectionName: F });
|
|
46462
46608
|
return /* @__PURE__ */ jsxs(GeneralSchemaDesigner, { template: C, title: t || e, disableInitializer: !0, children: [
|
|
46463
46609
|
/* @__PURE__ */ jsx(
|
|
46464
46610
|
SchemaSettingsDataScope,
|
|
46465
46611
|
{
|
|
46466
|
-
defaultFilter: ((
|
|
46612
|
+
defaultFilter: (($ = (D = i == null ? void 0 : i["x-decorator-props"]) == null ? void 0 : D.params) == null ? void 0 : $.filter) || {},
|
|
46467
46613
|
form: a,
|
|
46468
|
-
onSubmit: ({ filter:
|
|
46469
|
-
var
|
|
46470
|
-
|
|
46614
|
+
onSubmit: ({ filter: B }) => {
|
|
46615
|
+
var N;
|
|
46616
|
+
B = removeNullCondition(B);
|
|
46471
46617
|
const w = r.decoratorProps.params || {};
|
|
46472
|
-
w.filter =
|
|
46473
|
-
let M = _.cloneDeep(
|
|
46618
|
+
w.filter = B, r.decoratorProps.params = w, i["x-decorator-props"].params = w;
|
|
46619
|
+
let M = _.cloneDeep(B);
|
|
46474
46620
|
u && (M ? M = {
|
|
46475
46621
|
$and: [u, M]
|
|
46476
|
-
} : M = u), c.run(P(x({}, (
|
|
46622
|
+
} : M = u), c.run(P(x({}, (N = c.params) == null ? void 0 : N[0]), { filter: M, page: 1 })), p.emit("patch", {
|
|
46477
46623
|
schema: {
|
|
46478
46624
|
"x-uid": i["x-uid"],
|
|
46479
46625
|
"x-decorator-props": i["x-decorator-props"]
|
|
@@ -46481,14 +46627,14 @@ const TableSelectorDesigner = () => {
|
|
|
46481
46627
|
});
|
|
46482
46628
|
},
|
|
46483
46629
|
collectionName: e,
|
|
46484
|
-
dynamicComponent: (
|
|
46630
|
+
dynamicComponent: (B) => /* @__PURE__ */ jsx(
|
|
46485
46631
|
VariableInput,
|
|
46486
|
-
P(x({},
|
|
46632
|
+
P(x({}, B), {
|
|
46487
46633
|
form: a,
|
|
46488
|
-
collectionField:
|
|
46634
|
+
collectionField: B.collectionField,
|
|
46489
46635
|
record: y,
|
|
46490
46636
|
shouldChange: getShouldChange({
|
|
46491
|
-
collectionField:
|
|
46637
|
+
collectionField: B.collectionField,
|
|
46492
46638
|
variables: v,
|
|
46493
46639
|
localVariables: A,
|
|
46494
46640
|
getAllCollectionsInheritChain: o
|
|
@@ -46505,11 +46651,11 @@ const TableSelectorDesigner = () => {
|
|
|
46505
46651
|
title: d("Tree table"),
|
|
46506
46652
|
defaultChecked: !0,
|
|
46507
46653
|
checked: r.decoratorProps.treeTable,
|
|
46508
|
-
onChange: (
|
|
46654
|
+
onChange: (B) => {
|
|
46509
46655
|
var M;
|
|
46510
|
-
r.form.clearFormGraph(`${r.address}.*`), r.decoratorProps.treeTable =
|
|
46656
|
+
r.form.clearFormGraph(`${r.address}.*`), r.decoratorProps.treeTable = B, i["x-decorator-props"].treeTable = B;
|
|
46511
46657
|
const w = P(x({}, (M = c.params) == null ? void 0 : M[0]), {
|
|
46512
|
-
tree:
|
|
46658
|
+
tree: B ? !0 : null
|
|
46513
46659
|
});
|
|
46514
46660
|
p.emit("patch", {
|
|
46515
46661
|
schema: i
|
|
@@ -46593,15 +46739,15 @@ const TableSelectorDesigner = () => {
|
|
|
46593
46739
|
}
|
|
46594
46740
|
}
|
|
46595
46741
|
},
|
|
46596
|
-
onSubmit: ({ sort:
|
|
46597
|
-
var
|
|
46598
|
-
const w =
|
|
46742
|
+
onSubmit: ({ sort: B }) => {
|
|
46743
|
+
var N;
|
|
46744
|
+
const w = B.map((k) => k.direction === "desc" ? `-${k.field}` : k.field), M = r.decoratorProps.params || {};
|
|
46599
46745
|
M.sort = w, r.decoratorProps.params = M, i["x-decorator-props"].params = M, p.emit("patch", {
|
|
46600
46746
|
schema: {
|
|
46601
46747
|
"x-uid": i["x-uid"],
|
|
46602
46748
|
"x-decorator-props": i["x-decorator-props"]
|
|
46603
46749
|
}
|
|
46604
|
-
}), c.run(P(x({}, (
|
|
46750
|
+
}), c.run(P(x({}, (N = c.params) == null ? void 0 : N[0]), { sort: w }));
|
|
46605
46751
|
}
|
|
46606
46752
|
}
|
|
46607
46753
|
),
|
|
@@ -46618,10 +46764,10 @@ const TableSelectorDesigner = () => {
|
|
|
46618
46764
|
{ label: "100", value: 100 },
|
|
46619
46765
|
{ label: "200", value: 200 }
|
|
46620
46766
|
],
|
|
46621
|
-
onChange: (
|
|
46767
|
+
onChange: (B) => {
|
|
46622
46768
|
var M;
|
|
46623
46769
|
const w = r.decoratorProps.params || {};
|
|
46624
|
-
w.pageSize =
|
|
46770
|
+
w.pageSize = B, r.decoratorProps.params = w, i["x-decorator-props"].params = w, c.run(P(x({}, (M = c.params) == null ? void 0 : M[0]), { pageSize: B, page: 1 })), p.emit("patch", {
|
|
46625
46771
|
schema: {
|
|
46626
46772
|
"x-uid": i["x-uid"],
|
|
46627
46773
|
"x-decorator-props": i["x-decorator-props"]
|
|
@@ -48048,11 +48194,11 @@ const useCurrentAppInfo = () => useContext(CurrentAppInfoContext), CurrentAppInf
|
|
|
48048
48194
|
if (R && y) {
|
|
48049
48195
|
const D = ((T = r(R)) == null ? void 0 : T.fields) || [];
|
|
48050
48196
|
o(
|
|
48051
|
-
D == null ? void 0 : D.filter((
|
|
48197
|
+
D == null ? void 0 : D.filter(($) => supportTypes.includes($.type)).map(($) => {
|
|
48052
48198
|
var z;
|
|
48053
48199
|
return {
|
|
48054
|
-
value:
|
|
48055
|
-
label: g(((z =
|
|
48200
|
+
value: $.name,
|
|
48201
|
+
label: g(((z = $.uiSchema) == null ? void 0 : z.title) || $.name)
|
|
48056
48202
|
};
|
|
48057
48203
|
})
|
|
48058
48204
|
);
|
|
@@ -48234,21 +48380,21 @@ const useCurrentAppInfo = () => useContext(CurrentAppInfoContext), CurrentAppInf
|
|
|
48234
48380
|
const t = useRecord();
|
|
48235
48381
|
return /* @__PURE__ */ jsx(AddFieldAction, x({ item: t }, e));
|
|
48236
48382
|
}, AddFieldAction = (e) => {
|
|
48237
|
-
var L,
|
|
48238
|
-
const { scope: t, getContainer: n, item: o, children: r, trigger: i, align: a, database: l } = e, { getInterface: c, getTemplate: u, collections: d, getCollection: p } = useCollectionManager_deprecated(), [m, h] = useState(!1), [g, f] = useState(), [C, b] = useState({}), S = useCompile(), { t: y } = useTranslation(), { isDialect: v } = useDialect(), F = useFieldInterfaceOptions(), A = ((
|
|
48383
|
+
var L, B;
|
|
48384
|
+
const { scope: t, getContainer: n, item: o, children: r, trigger: i, align: a, database: l } = e, { getInterface: c, getTemplate: u, collections: d, getCollection: p } = useCollectionManager_deprecated(), [m, h] = useState(!1), [g, f] = useState(), [C, b] = useState({}), S = useCompile(), { t: y } = useTranslation(), { isDialect: v } = useDialect(), F = useFieldInterfaceOptions(), A = ((B = (L = p(o.name)) == null ? void 0 : L.options) == null ? void 0 : B.fields) || o.fields || [], R = useMemo(() => d.map((w) => ({
|
|
48239
48385
|
label: S(w.title),
|
|
48240
48386
|
value: w.name
|
|
48241
48387
|
})), []), T = useCallback(() => {
|
|
48242
|
-
const { availableFieldInterfaces: w } = u(o.template) || {}, { exclude: M, include:
|
|
48388
|
+
const { availableFieldInterfaces: w } = u(o.template) || {}, { exclude: M, include: N } = w || {}, k = [];
|
|
48243
48389
|
return F.forEach((j) => {
|
|
48244
48390
|
var O;
|
|
48245
48391
|
if (j.key === "systemInfo")
|
|
48246
48392
|
k.push(P(x({}, j), {
|
|
48247
|
-
children: j.children.filter((q) => q.hidden ? !1 : q.value === "tableoid" ?
|
|
48393
|
+
children: j.children.filter((q) => q.hidden ? !1 : q.value === "tableoid" ? N != null && N.length ? N.includes(q.value) : (l == null ? void 0 : l.dialect) === "postgres" : typeof o[q.value] == "boolean" ? o[q.value] : !0)
|
|
48248
48394
|
}));
|
|
48249
48395
|
else {
|
|
48250
48396
|
let q = [];
|
|
48251
|
-
|
|
48397
|
+
N != null && N.length ? N.forEach((E) => {
|
|
48252
48398
|
var G;
|
|
48253
48399
|
const U = (G = j == null ? void 0 : j.children) == null ? void 0 : G.find((H) => [E, E.interface].includes(H.name));
|
|
48254
48400
|
U && q.push(P(x({}, U), {
|
|
@@ -48266,28 +48412,28 @@ const useCurrentAppInfo = () => useContext(CurrentAppInfoContext), CurrentAppInf
|
|
|
48266
48412
|
label: S(w.label),
|
|
48267
48413
|
title: S(w.label),
|
|
48268
48414
|
key: w.label,
|
|
48269
|
-
children: w.children.filter((
|
|
48270
|
-
label: S(
|
|
48271
|
-
title: S(
|
|
48272
|
-
key:
|
|
48273
|
-
dataTargetScope:
|
|
48415
|
+
children: w.children.filter((N) => ["m2o"].includes(N.name)).map((N) => ({
|
|
48416
|
+
label: S(N.title),
|
|
48417
|
+
title: S(N.title),
|
|
48418
|
+
key: N.name,
|
|
48419
|
+
dataTargetScope: N.targetScope
|
|
48274
48420
|
}))
|
|
48275
48421
|
} : {
|
|
48276
48422
|
type: "group",
|
|
48277
48423
|
label: S(w.label),
|
|
48278
48424
|
title: S(w.label),
|
|
48279
48425
|
key: w.label,
|
|
48280
|
-
children: w == null ? void 0 : w.children.filter((
|
|
48281
|
-
label: S(
|
|
48282
|
-
title: S(
|
|
48283
|
-
key:
|
|
48284
|
-
dataTargetScope:
|
|
48426
|
+
children: w == null ? void 0 : w.children.filter((N) => !["o2o", "subTable", "linkTo"].includes(N.name)).map((N) => ({
|
|
48427
|
+
label: S(N.title),
|
|
48428
|
+
title: S(N.title),
|
|
48429
|
+
key: N.name,
|
|
48430
|
+
dataTargetScope: N.targetScope
|
|
48285
48431
|
}))
|
|
48286
48432
|
};
|
|
48287
48433
|
}).filter((w) => {
|
|
48288
48434
|
var M;
|
|
48289
48435
|
return (M = w == null ? void 0 : w.children) == null ? void 0 : M.length;
|
|
48290
|
-
}), [T]),
|
|
48436
|
+
}), [T]), $ = useMemo(() => ({
|
|
48291
48437
|
style: {
|
|
48292
48438
|
maxHeight: "60vh",
|
|
48293
48439
|
overflow: "auto"
|
|
@@ -48295,8 +48441,8 @@ const useCurrentAppInfo = () => useContext(CurrentAppInfoContext), CurrentAppInf
|
|
|
48295
48441
|
onClick: (w) => {
|
|
48296
48442
|
const M = w.item.props["data-targetScope"];
|
|
48297
48443
|
M && f(M);
|
|
48298
|
-
const
|
|
48299
|
-
|
|
48444
|
+
const N = getSchema$8(c(w.key), o, S);
|
|
48445
|
+
N && (b(N), h(!0));
|
|
48300
48446
|
},
|
|
48301
48447
|
items: D
|
|
48302
48448
|
}), [c, D, o]), z = useMemo(() => A.filter((w) => ["string", "bigInt", "integer"].includes(w.type)).map((w) => {
|
|
@@ -48307,7 +48453,7 @@ const useCurrentAppInfo = () => useContext(CurrentAppInfoContext), CurrentAppInf
|
|
|
48307
48453
|
};
|
|
48308
48454
|
}), [A == null ? void 0 : A.length]);
|
|
48309
48455
|
return o.template !== "sql" && /* @__PURE__ */ jsx(RecordProvider, { record: o, children: /* @__PURE__ */ jsxs(ActionContextProvider, { value: { visible: m, setVisible: h }, children: [
|
|
48310
|
-
/* @__PURE__ */ jsx(Dropdown, { getPopupContainer: n, trigger: i, align: a, menu:
|
|
48456
|
+
/* @__PURE__ */ jsx(Dropdown, { getPopupContainer: n, trigger: i, align: a, menu: $, children: r || /* @__PURE__ */ jsx(Button, { icon: /* @__PURE__ */ jsx(PlusOutlined, {}), type: "primary", children: y("Add field") }) }),
|
|
48311
48457
|
/* @__PURE__ */ jsx(
|
|
48312
48458
|
SchemaComponent,
|
|
48313
48459
|
{
|
|
@@ -48441,8 +48587,8 @@ const useCurrentAppInfo = () => useContext(CurrentAppInfoContext), CurrentAppInf
|
|
|
48441
48587
|
S(R == null ? void 0 : R.data);
|
|
48442
48588
|
const T = l(o.interface), D = cloneDeep(R == null ? void 0 : R.data) || {};
|
|
48443
48589
|
D != null && D.reverseField || (D.autoCreateReverseField = !1, D.reverseField = (z = T == null ? void 0 : T.default) == null ? void 0 : z.reverseField, set$1(D.reverseField, "name", `f_${uid()}`), set$1(D.reverseField, "uiSchema.title", (L = o.__parent) == null ? void 0 : L.title));
|
|
48444
|
-
const
|
|
48445
|
-
h(
|
|
48590
|
+
const $ = getSchema$7(T, D, o, C);
|
|
48591
|
+
h($), p(!0);
|
|
48446
48592
|
}),
|
|
48447
48593
|
children: i || f("Edit")
|
|
48448
48594
|
})
|
|
@@ -48534,19 +48680,19 @@ const useCurrentAppInfo = () => useContext(CurrentAppInfoContext), CurrentAppInf
|
|
|
48534
48680
|
const t = useRecord(), n = useCollectionParentRecordData();
|
|
48535
48681
|
return /* @__PURE__ */ jsx(OverridingFieldAction, x({ item: t, parentItem: n }, e));
|
|
48536
48682
|
}, getIsOverriding = (e, t, n) => t.find((r) => r.name === n.name).collectionName === e, OverridingFieldAction = (e) => {
|
|
48537
|
-
const { scope: t, getContainer: n, item: o, parentItem: r, children: i, currentCollection: a } = e, { target: l, through: c } = o, { getInterface: u, getCollection: d, getCurrentCollectionFields: p, getChildrenCollections: m, collections: h } = useCollectionManager_deprecated(), [g, f] = useState(!1), [C, b] = useState({}), S = useAPIClient(), { t: y } = useTranslation(), v = useCompile(), F = (
|
|
48683
|
+
const { scope: t, getContainer: n, item: o, parentItem: r, children: i, currentCollection: a } = e, { target: l, through: c } = o, { getInterface: u, getCollection: d, getCurrentCollectionFields: p, getChildrenCollections: m, collections: h } = useCollectionManager_deprecated(), [g, f] = useState(!1), [C, b] = useState({}), S = useAPIClient(), { t: y } = useTranslation(), v = useCompile(), F = (B) => {
|
|
48538
48684
|
var M;
|
|
48539
|
-
return
|
|
48540
|
-
}, [A, R] = useState({}), T = p(a), D = getIsOverriding(a, T, o),
|
|
48541
|
-
label: v(
|
|
48542
|
-
value:
|
|
48685
|
+
return B && ((M = m(B)) == null ? void 0 : M.map((N) => N.name).concat([B]));
|
|
48686
|
+
}, [A, R] = useState({}), T = p(a), D = getIsOverriding(a, T, o), $ = useMemo(() => h.map((B) => ({
|
|
48687
|
+
label: v(B.title),
|
|
48688
|
+
value: B.name
|
|
48543
48689
|
})), []), z = () => {
|
|
48544
|
-
const
|
|
48690
|
+
const B = useForm(), { refresh: w } = useResourceActionContext(), { refreshCM: M } = useCollectionManager_deprecated(), N = useActionContext(), { resource: k } = useResourceContext();
|
|
48545
48691
|
return {
|
|
48546
48692
|
run() {
|
|
48547
48693
|
return V(this, null, function* () {
|
|
48548
|
-
yield
|
|
48549
|
-
const O = cloneDeep(
|
|
48694
|
+
yield B.submit();
|
|
48695
|
+
const O = cloneDeep(B.values), q = omit(O, [
|
|
48550
48696
|
"key",
|
|
48551
48697
|
"uiSchemaUid",
|
|
48552
48698
|
"collectionName",
|
|
@@ -48560,13 +48706,13 @@ const useCurrentAppInfo = () => useContext(CurrentAppInfoContext), CurrentAppInf
|
|
|
48560
48706
|
]);
|
|
48561
48707
|
yield k.create({
|
|
48562
48708
|
values: q
|
|
48563
|
-
}), yield
|
|
48709
|
+
}), yield B.reset(), yield M(), yield w(), N.setVisible(!1);
|
|
48564
48710
|
});
|
|
48565
48711
|
}
|
|
48566
48712
|
};
|
|
48567
48713
|
}, L = useMemo(() => {
|
|
48568
|
-
var
|
|
48569
|
-
return (o == null ? void 0 : o.fields) || ((
|
|
48714
|
+
var B;
|
|
48715
|
+
return (o == null ? void 0 : o.fields) || ((B = d(o.collectionName)) == null ? void 0 : B.options.fields.filter((w) => ["string", "bigInt", "integer"].includes(w.type)).map((w) => {
|
|
48570
48716
|
var M;
|
|
48571
48717
|
return {
|
|
48572
48718
|
value: w.name,
|
|
@@ -48580,18 +48726,18 @@ const useCurrentAppInfo = () => useContext(CurrentAppInfoContext), CurrentAppInf
|
|
|
48580
48726
|
{
|
|
48581
48727
|
disabled: D,
|
|
48582
48728
|
onClick: () => V(void 0, null, function* () {
|
|
48583
|
-
var
|
|
48729
|
+
var B;
|
|
48584
48730
|
if (!D) {
|
|
48585
48731
|
const { data: w } = yield S.resource("collections.fields", o.collectionName).get({
|
|
48586
48732
|
filterByTk: o.name,
|
|
48587
48733
|
appends: ["reverseField"]
|
|
48588
48734
|
});
|
|
48589
48735
|
R(w == null ? void 0 : w.data);
|
|
48590
|
-
const M = u(o.interface),
|
|
48591
|
-
|
|
48736
|
+
const M = u(o.interface), N = cloneDeep(w == null ? void 0 : w.data) || {};
|
|
48737
|
+
N != null && N.reverseField || (N.autoCreateReverseField = !1, N.reverseField = (B = M.default) == null ? void 0 : B.reverseField, set(N.reverseField, "name", `f_${uid()}`), set(N.reverseField, "uiSchema.title", o.__parent.title));
|
|
48592
48738
|
const k = getSchema$6(
|
|
48593
48739
|
P(x({}, M), {
|
|
48594
|
-
default:
|
|
48740
|
+
default: N
|
|
48595
48741
|
}),
|
|
48596
48742
|
o,
|
|
48597
48743
|
v
|
|
@@ -48616,7 +48762,7 @@ const useCurrentAppInfo = () => useContext(CurrentAppInfoContext), CurrentAppInf
|
|
|
48616
48762
|
override: !0,
|
|
48617
48763
|
isOverride: !0,
|
|
48618
48764
|
targetScope: { target: F(l), through: F(c) },
|
|
48619
|
-
collections:
|
|
48765
|
+
collections: $,
|
|
48620
48766
|
scopeKeyOptions: L
|
|
48621
48767
|
}, t)
|
|
48622
48768
|
}
|
|
@@ -49054,7 +49200,7 @@ const getSchema$4 = (e, t, n) => {
|
|
|
49054
49200
|
const w = [];
|
|
49055
49201
|
g.forEach((M) => {
|
|
49056
49202
|
var q;
|
|
49057
|
-
const
|
|
49203
|
+
const N = v(M), j = R(M).map((E) => {
|
|
49058
49204
|
const U = T(E, M);
|
|
49059
49205
|
return {
|
|
49060
49206
|
type: "group",
|
|
@@ -49068,22 +49214,22 @@ const getSchema$4 = (e, t, n) => {
|
|
|
49068
49214
|
};
|
|
49069
49215
|
})
|
|
49070
49216
|
};
|
|
49071
|
-
}), O = (q =
|
|
49217
|
+
}), O = (q = N.fields.filter((E) => !["obo", "oho", "m2m", "o2m"].includes(E == null ? void 0 : E.interface))) == null ? void 0 : q.map((E) => {
|
|
49072
49218
|
var U;
|
|
49073
49219
|
return { value: E.name, key: E.name, label: l(((U = E.uiSchema) == null ? void 0 : U.title) || E.name) };
|
|
49074
49220
|
}).concat(j);
|
|
49075
49221
|
w.push({
|
|
49076
49222
|
value: M,
|
|
49077
|
-
label: l(
|
|
49223
|
+
label: l(N.title || N.name),
|
|
49078
49224
|
children: O
|
|
49079
49225
|
});
|
|
49080
49226
|
}), h(w);
|
|
49081
49227
|
}, [g, t]), useEffect(() => {
|
|
49082
49228
|
t && (u(!0), a.resource("dbViews").get({ filterByTk: n, schema: r }).then(({ data: w }) => {
|
|
49083
|
-
var M,
|
|
49229
|
+
var M, N;
|
|
49084
49230
|
if (w) {
|
|
49085
49231
|
u(!1), p([]);
|
|
49086
|
-
const k = (
|
|
49232
|
+
const k = (N = Object.values((M = w == null ? void 0 : w.data) == null ? void 0 : M.fields)) == null ? void 0 : N.map((j) => {
|
|
49087
49233
|
var O, q;
|
|
49088
49234
|
if (j.source) {
|
|
49089
49235
|
const E = (i == null ? void 0 : i.data.find((U) => U.name === j.name)) || j;
|
|
@@ -49105,14 +49251,14 @@ const getSchema$4 = (e, t, n) => {
|
|
|
49105
49251
|
}).catch);
|
|
49106
49252
|
}, [t]);
|
|
49107
49253
|
const L = (w, M) => {
|
|
49108
|
-
d.splice(M, 1, w), p(d), S.value = d.map((
|
|
49254
|
+
d.splice(M, 1, w), p(d), S.value = d.map((N) => {
|
|
49109
49255
|
var j, O, q;
|
|
49110
|
-
const k = typeof
|
|
49111
|
-
return P(x({},
|
|
49256
|
+
const k = typeof N.source == "string" ? N.source : (q = (O = (j = N.source) == null ? void 0 : j.filter) == null ? void 0 : O.call(j, Boolean)) == null ? void 0 : q.join(".");
|
|
49257
|
+
return P(x({}, N), {
|
|
49112
49258
|
source: k
|
|
49113
49259
|
});
|
|
49114
49260
|
});
|
|
49115
|
-
},
|
|
49261
|
+
}, B = [
|
|
49116
49262
|
{
|
|
49117
49263
|
title: l("Field name"),
|
|
49118
49264
|
dataIndex: "name",
|
|
@@ -49124,7 +49270,7 @@ const getSchema$4 = (e, t, n) => {
|
|
|
49124
49270
|
dataIndex: "source",
|
|
49125
49271
|
key: "source",
|
|
49126
49272
|
width: 200,
|
|
49127
|
-
render: (w, M,
|
|
49273
|
+
render: (w, M, N) => /* @__PURE__ */ jsx(
|
|
49128
49274
|
Cascader$1,
|
|
49129
49275
|
{
|
|
49130
49276
|
defaultValue: typeof w == "string" ? w == null ? void 0 : w.split(".") : w,
|
|
@@ -49134,7 +49280,7 @@ const getSchema$4 = (e, t, n) => {
|
|
|
49134
49280
|
onChange: (k, j) => {
|
|
49135
49281
|
var q;
|
|
49136
49282
|
const O = (q = A(k == null ? void 0 : k[0])) == null ? void 0 : q.find((E) => E.name === last(k));
|
|
49137
|
-
L(P(x({}, M), { source: k, uiSchema: O == null ? void 0 : O.uiSchema }),
|
|
49283
|
+
L(P(x({}, M), { source: k, uiSchema: O == null ? void 0 : O.uiSchema }), N);
|
|
49138
49284
|
},
|
|
49139
49285
|
placeholder: l("Select field source")
|
|
49140
49286
|
}
|
|
@@ -49145,8 +49291,8 @@ const getSchema$4 = (e, t, n) => {
|
|
|
49145
49291
|
dataIndex: "type",
|
|
49146
49292
|
width: 140,
|
|
49147
49293
|
key: "type",
|
|
49148
|
-
render: (w, M,
|
|
49149
|
-
const k = d[
|
|
49294
|
+
render: (w, M, N) => {
|
|
49295
|
+
const k = d[N];
|
|
49150
49296
|
return k != null && k.source || !(k != null && k.possibleTypes) ? /* @__PURE__ */ jsx(Tag, { children: w }) : /* @__PURE__ */ jsx(
|
|
49151
49297
|
Select$1,
|
|
49152
49298
|
{
|
|
@@ -49154,7 +49300,7 @@ const getSchema$4 = (e, t, n) => {
|
|
|
49154
49300
|
popupMatchSelectWidth: !1,
|
|
49155
49301
|
style: { width: "100%" },
|
|
49156
49302
|
options: (k == null ? void 0 : k.possibleTypes.map((j) => ({ label: j, value: j }))) || [],
|
|
49157
|
-
onChange: (j) => L(P(x({}, k), { type: j }),
|
|
49303
|
+
onChange: (j) => L(P(x({}, k), { type: j }), N)
|
|
49158
49304
|
}
|
|
49159
49305
|
);
|
|
49160
49306
|
}
|
|
@@ -49164,8 +49310,8 @@ const getSchema$4 = (e, t, n) => {
|
|
|
49164
49310
|
dataIndex: "interface",
|
|
49165
49311
|
key: "interface",
|
|
49166
49312
|
width: 150,
|
|
49167
|
-
render: (w, M,
|
|
49168
|
-
const k = d[
|
|
49313
|
+
render: (w, M, N) => {
|
|
49314
|
+
const k = d[N], j = getInterfaceOptions(z, k.type);
|
|
49169
49315
|
return k.source ? w : /* @__PURE__ */ jsx(
|
|
49170
49316
|
Select$1,
|
|
49171
49317
|
{
|
|
@@ -49175,7 +49321,7 @@ const getSchema$4 = (e, t, n) => {
|
|
|
49175
49321
|
onChange: (O) => {
|
|
49176
49322
|
var E;
|
|
49177
49323
|
const q = F(O);
|
|
49178
|
-
L(P(x({}, k), { interface: O, uiSchema: (E = q == null ? void 0 : q.default) == null ? void 0 : E.uiSchema }),
|
|
49324
|
+
L(P(x({}, k), { interface: O, uiSchema: (E = q == null ? void 0 : q.default) == null ? void 0 : E.uiSchema }), N);
|
|
49179
49325
|
},
|
|
49180
49326
|
children: j.map((O) => /* @__PURE__ */ jsx(Select$1.OptGroup, { label: D(O.label), children: O.children.map((q) => /* @__PURE__ */ jsx(Select$1.Option, { value: q.name, children: D(q.label) }, q.value)) }, O.key))
|
|
49181
49327
|
}
|
|
@@ -49187,16 +49333,16 @@ const getSchema$4 = (e, t, n) => {
|
|
|
49187
49333
|
dataIndex: "title",
|
|
49188
49334
|
key: "title",
|
|
49189
49335
|
width: 180,
|
|
49190
|
-
render: (w, M,
|
|
49336
|
+
render: (w, M, N) => {
|
|
49191
49337
|
var j;
|
|
49192
|
-
const k = d[
|
|
49338
|
+
const k = d[N];
|
|
49193
49339
|
return /* @__PURE__ */ jsx(
|
|
49194
49340
|
Input$3,
|
|
49195
49341
|
{
|
|
49196
49342
|
defaultValue: ((j = k == null ? void 0 : k.uiSchema) == null ? void 0 : j.title) || w,
|
|
49197
49343
|
onChange: (O) => L(
|
|
49198
49344
|
P(x({}, k), { uiSchema: P(x({}, omit(k == null ? void 0 : k.uiSchema, "rawTitle")), { title: O.target.value }) }),
|
|
49199
|
-
|
|
49345
|
+
N
|
|
49200
49346
|
)
|
|
49201
49347
|
}
|
|
49202
49348
|
);
|
|
@@ -49214,7 +49360,7 @@ const getSchema$4 = (e, t, n) => {
|
|
|
49214
49360
|
{
|
|
49215
49361
|
bordered: !0,
|
|
49216
49362
|
size: "middle",
|
|
49217
|
-
columns:
|
|
49363
|
+
columns: B,
|
|
49218
49364
|
dataSource: d,
|
|
49219
49365
|
scroll: { y: 300 },
|
|
49220
49366
|
pagination: !1,
|
|
@@ -49249,14 +49395,14 @@ const mapFields = ["lineString", "point", "circle", "polygon"], PreviewTable$1 =
|
|
|
49249
49395
|
}, S = (y) => {
|
|
49250
49396
|
var v;
|
|
49251
49397
|
return (v = y.filter((F) => F.source || F.interface)) == null ? void 0 : v.map((F) => {
|
|
49252
|
-
var
|
|
49253
|
-
const A = typeof (F == null ? void 0 : F.source) == "string" ? (
|
|
49398
|
+
var $, z, L, B, w, M;
|
|
49399
|
+
const A = typeof (F == null ? void 0 : F.source) == "string" ? ($ = F == null ? void 0 : F.source) == null ? void 0 : $.split(".") : F == null ? void 0 : F.source, R = (L = (z = h(A == null ? void 0 : A[0])) == null ? void 0 : z.find((N) => N.name === (A == null ? void 0 : A[1]))) == null ? void 0 : L.uiSchema, T = ((B = F == null ? void 0 : F.uiSchema) == null ? void 0 : B.title) || (R == null ? void 0 : R.title) || F.name, D = F.source ? R : (M = (w = m(F.interface)) == null ? void 0 : w.default) == null ? void 0 : M.uiSchema;
|
|
49254
49400
|
return {
|
|
49255
49401
|
title: u(T),
|
|
49256
49402
|
dataIndex: F.name,
|
|
49257
49403
|
key: F.name,
|
|
49258
49404
|
width: 200,
|
|
49259
|
-
render: (
|
|
49405
|
+
render: (N, k, j) => {
|
|
49260
49406
|
const O = k[F.name], q = {
|
|
49261
49407
|
type: "object",
|
|
49262
49408
|
properties: {
|
|
@@ -49489,28 +49635,28 @@ const AsyncDataProvider = (e) => {
|
|
|
49489
49635
|
() => h.filter((T) => !["relation"].includes(T.key)).map((T, D) => ({
|
|
49490
49636
|
key: D,
|
|
49491
49637
|
label: d(T.label),
|
|
49492
|
-
options: T.children.map((
|
|
49493
|
-
value:
|
|
49638
|
+
options: T.children.map(($, z) => ({
|
|
49639
|
+
value: $.name,
|
|
49494
49640
|
key: `${D}-${z}`,
|
|
49495
|
-
label: d(
|
|
49641
|
+
label: d($.label)
|
|
49496
49642
|
}))
|
|
49497
49643
|
})),
|
|
49498
49644
|
[d]
|
|
49499
49645
|
), f = useSourceFieldsOptions(), C = useRef(p);
|
|
49500
49646
|
if (useEffect(() => {
|
|
49501
|
-
var
|
|
49647
|
+
var $;
|
|
49502
49648
|
const T = /* @__PURE__ */ new Map();
|
|
49503
49649
|
i || (a && a.length ? Object.entries((a == null ? void 0 : a[0]) || {}).forEach(([z, L]) => {
|
|
49504
49650
|
var k;
|
|
49505
|
-
const
|
|
49651
|
+
const B = l[z], w = inferInterface(z, L), M = (k = C.current(w)) == null ? void 0 : k.default, N = (B == null ? void 0 : B.uiSchema) || (M == null ? void 0 : M.uiSchema) || {};
|
|
49506
49652
|
T.set(z, {
|
|
49507
49653
|
name: z,
|
|
49508
|
-
interface: (
|
|
49509
|
-
type: (
|
|
49510
|
-
source:
|
|
49654
|
+
interface: (B == null ? void 0 : B.interface) || w,
|
|
49655
|
+
type: (B == null ? void 0 : B.type) || (M == null ? void 0 : M.type),
|
|
49656
|
+
source: B == null ? void 0 : B.source,
|
|
49511
49657
|
uiSchema: x({
|
|
49512
49658
|
title: z
|
|
49513
|
-
},
|
|
49659
|
+
}, N)
|
|
49514
49660
|
});
|
|
49515
49661
|
}) : Object.entries(l || {}).forEach(
|
|
49516
49662
|
([z, L]) => T.set(z, P(x({
|
|
@@ -49521,7 +49667,7 @@ const AsyncDataProvider = (e) => {
|
|
|
49521
49667
|
title: z
|
|
49522
49668
|
}, (L == null ? void 0 : L.uiSchema) || {})
|
|
49523
49669
|
}))
|
|
49524
|
-
)), (
|
|
49670
|
+
)), ($ = c.value) != null && $.length && c.value.forEach((z) => {
|
|
49525
49671
|
T.has(z.name) && T.set(z.name, z);
|
|
49526
49672
|
});
|
|
49527
49673
|
const D = Array.from(T.values());
|
|
@@ -49537,12 +49683,12 @@ const AsyncDataProvider = (e) => {
|
|
|
49537
49683
|
return /* @__PURE__ */ jsx(Alert, { showIcon: !0, message: `${e("SQL error: ")}${T}`, type: "error" });
|
|
49538
49684
|
}
|
|
49539
49685
|
const S = (T, D) => {
|
|
49540
|
-
const
|
|
49541
|
-
|
|
49542
|
-
|
|
49543
|
-
var L,
|
|
49686
|
+
const $ = [...t];
|
|
49687
|
+
$.splice(D, 1, T), n($), c.setValue(
|
|
49688
|
+
$.map((z) => {
|
|
49689
|
+
var L, B, w;
|
|
49544
49690
|
return P(x({}, z), {
|
|
49545
|
-
source: typeof z.source == "string" ? z.source : ((w = (
|
|
49691
|
+
source: typeof z.source == "string" ? z.source : ((w = (B = (L = z.source) == null ? void 0 : L.filter) == null ? void 0 : B.call(L, Boolean)) == null ? void 0 : w.join(".")) || null
|
|
49546
49692
|
});
|
|
49547
49693
|
})
|
|
49548
49694
|
);
|
|
@@ -49558,8 +49704,8 @@ const AsyncDataProvider = (e) => {
|
|
|
49558
49704
|
dataIndex: "source",
|
|
49559
49705
|
key: "source",
|
|
49560
49706
|
width: 200,
|
|
49561
|
-
render: (T, D,
|
|
49562
|
-
const z = t[
|
|
49707
|
+
render: (T, D, $) => {
|
|
49708
|
+
const z = t[$];
|
|
49563
49709
|
return /* @__PURE__ */ jsx(
|
|
49564
49710
|
Cascader$1,
|
|
49565
49711
|
{
|
|
@@ -49568,15 +49714,15 @@ const AsyncDataProvider = (e) => {
|
|
|
49568
49714
|
options: d(f),
|
|
49569
49715
|
placeholder: e("Select field source"),
|
|
49570
49716
|
onChange: (L) => {
|
|
49571
|
-
let
|
|
49572
|
-
|
|
49717
|
+
let B = l[L == null ? void 0 : L[1]];
|
|
49718
|
+
B != null && B.interface || (B = m((L == null ? void 0 : L.join(".")) || "")), S(
|
|
49573
49719
|
P(x({}, z), {
|
|
49574
49720
|
source: L,
|
|
49575
|
-
interface:
|
|
49576
|
-
type:
|
|
49577
|
-
uiSchema:
|
|
49721
|
+
interface: B == null ? void 0 : B.interface,
|
|
49722
|
+
type: B == null ? void 0 : B.type,
|
|
49723
|
+
uiSchema: B == null ? void 0 : B.uiSchema
|
|
49578
49724
|
}),
|
|
49579
|
-
|
|
49725
|
+
$
|
|
49580
49726
|
);
|
|
49581
49727
|
}
|
|
49582
49728
|
}
|
|
@@ -49588,27 +49734,27 @@ const AsyncDataProvider = (e) => {
|
|
|
49588
49734
|
dataIndex: "interface",
|
|
49589
49735
|
key: "interface",
|
|
49590
49736
|
width: 150,
|
|
49591
|
-
render: (T, D,
|
|
49737
|
+
render: (T, D, $) => {
|
|
49592
49738
|
var L;
|
|
49593
|
-
const z = t[
|
|
49739
|
+
const z = t[$];
|
|
49594
49740
|
return z.source ? /* @__PURE__ */ jsx(Tag, { children: d((L = p(T)) == null ? void 0 : L.title) || T }) : /* @__PURE__ */ jsx(
|
|
49595
49741
|
Select$1,
|
|
49596
49742
|
{
|
|
49597
49743
|
defaultValue: z.interface || "input",
|
|
49598
49744
|
style: { width: "100%" },
|
|
49599
49745
|
popupMatchSelectWidth: !1,
|
|
49600
|
-
onChange: (
|
|
49601
|
-
var M,
|
|
49602
|
-
const w = p(
|
|
49746
|
+
onChange: (B) => {
|
|
49747
|
+
var M, N, k, j, O;
|
|
49748
|
+
const w = p(B);
|
|
49603
49749
|
S(
|
|
49604
49750
|
P(x({}, z), {
|
|
49605
|
-
interface:
|
|
49751
|
+
interface: B || null,
|
|
49606
49752
|
uiSchema: P(x({}, (M = w == null ? void 0 : w.default) == null ? void 0 : M.uiSchema), {
|
|
49607
|
-
title: ((k = (
|
|
49753
|
+
title: ((k = (N = w == null ? void 0 : w.default) == null ? void 0 : N.uiSchema) == null ? void 0 : k.title) || ((j = z.uiSchema) == null ? void 0 : j.title)
|
|
49608
49754
|
}),
|
|
49609
49755
|
type: (O = w == null ? void 0 : w.default) == null ? void 0 : O.type
|
|
49610
49756
|
}),
|
|
49611
|
-
|
|
49757
|
+
$
|
|
49612
49758
|
);
|
|
49613
49759
|
},
|
|
49614
49760
|
allowClear: !0,
|
|
@@ -49622,15 +49768,15 @@ const AsyncDataProvider = (e) => {
|
|
|
49622
49768
|
dataIndex: "title",
|
|
49623
49769
|
key: "title",
|
|
49624
49770
|
width: 180,
|
|
49625
|
-
render: (T, D,
|
|
49626
|
-
var L,
|
|
49627
|
-
const z = t[
|
|
49771
|
+
render: (T, D, $) => {
|
|
49772
|
+
var L, B;
|
|
49773
|
+
const z = t[$];
|
|
49628
49774
|
return /* @__PURE__ */ jsx(
|
|
49629
49775
|
Input$3,
|
|
49630
49776
|
{
|
|
49631
49777
|
value: ((L = z.uiSchema) == null ? void 0 : L.title) || T,
|
|
49632
|
-
defaultValue: ((
|
|
49633
|
-
onChange: (w) => S(P(x({}, z), { uiSchema: P(x({}, z == null ? void 0 : z.uiSchema), { title: w.target.value }) }),
|
|
49778
|
+
defaultValue: ((B = z.uiSchema) == null ? void 0 : B.title) !== void 0 ? z.uiSchema.title : z == null ? void 0 : z.name,
|
|
49779
|
+
onChange: (w) => S(P(x({}, z), { uiSchema: P(x({}, z == null ? void 0 : z.uiSchema), { title: w.target.value }) }), $)
|
|
49634
49780
|
}
|
|
49635
49781
|
);
|
|
49636
49782
|
}
|
|
@@ -55701,7 +55847,7 @@ const RolesResourcesActions = connect((e) => {
|
|
|
55701
55847
|
const T = p[A.name] || {
|
|
55702
55848
|
name: A.name
|
|
55703
55849
|
};
|
|
55704
|
-
R ? T.fields = [] : T.fields = (D = l == null ? void 0 : l.map) == null ? void 0 : D.call(l, (
|
|
55850
|
+
R ? T.fields = [] : T.fields = (D = l == null ? void 0 : l.map) == null ? void 0 : D.call(l, ($) => $.name), p[A.name] = T, t(Object.values(p));
|
|
55705
55851
|
}
|
|
55706
55852
|
}
|
|
55707
55853
|
),
|
|
@@ -55714,15 +55860,15 @@ const RolesResourcesActions = connect((e) => {
|
|
|
55714
55860
|
checked: T,
|
|
55715
55861
|
"aria-label": `${A.name}_checkbox`,
|
|
55716
55862
|
onChange: () => {
|
|
55717
|
-
const
|
|
55863
|
+
const $ = p[A.name] || {
|
|
55718
55864
|
name: A.name
|
|
55719
|
-
}, z =
|
|
55865
|
+
}, z = $.fields || [];
|
|
55720
55866
|
if (T) {
|
|
55721
55867
|
const L = z.indexOf(D.name);
|
|
55722
55868
|
z.splice(L, 1);
|
|
55723
55869
|
} else
|
|
55724
55870
|
z.push(D.name);
|
|
55725
|
-
|
|
55871
|
+
$.fields = z, p[A.name] = $, t(Object.values(p));
|
|
55726
55872
|
}
|
|
55727
55873
|
}
|
|
55728
55874
|
)
|
|
@@ -56477,9 +56623,9 @@ function PluginInfo(e) {
|
|
|
56477
56623
|
y.silent().request({
|
|
56478
56624
|
url: "__health_check",
|
|
56479
56625
|
method: "get"
|
|
56480
|
-
}).then((
|
|
56481
|
-
(
|
|
56482
|
-
}).catch((
|
|
56626
|
+
}).then(($) => {
|
|
56627
|
+
($ == null ? void 0 : $.data) === "ok" && window.location.reload();
|
|
56628
|
+
}).catch(($) => {
|
|
56483
56629
|
});
|
|
56484
56630
|
}
|
|
56485
56631
|
setInterval(D, 1e3);
|
|
@@ -58494,14 +58640,14 @@ const ActionInitializerItem = (e) => {
|
|
|
58494
58640
|
), F = f || (i == null ? void 0 : i.targetKey) || "id", A = C || ((U = (E = a["x-component-props"]) == null ? void 0 : E.fieldNames) == null ? void 0 : U.label) || F, R = {
|
|
58495
58641
|
title: A || F,
|
|
58496
58642
|
key: F
|
|
58497
|
-
}, [T, D] = useState([]), [
|
|
58643
|
+
}, [T, D] = useState([]), [$, z] = useState(a.default || []), [L, B] = useState(!0), w = useLabelUiSchema(i, (R == null ? void 0 : R.title) || "label");
|
|
58498
58644
|
if (useEffect(() => {
|
|
58499
58645
|
a.default && (d(a.default), z(a.default));
|
|
58500
58646
|
}, [a.default, d]), !i)
|
|
58501
58647
|
return null;
|
|
58502
58648
|
const M = (W) => {
|
|
58503
|
-
D(W),
|
|
58504
|
-
},
|
|
58649
|
+
D(W), B(!1);
|
|
58650
|
+
}, N = (W) => {
|
|
58505
58651
|
z(W), d(W), p == null || p(W);
|
|
58506
58652
|
}, k = (W) => {
|
|
58507
58653
|
var Y;
|
|
@@ -58561,10 +58707,10 @@ const ActionInitializerItem = (e) => {
|
|
|
58561
58707
|
expandedKeys: T,
|
|
58562
58708
|
autoExpandParent: L,
|
|
58563
58709
|
treeData: u,
|
|
58564
|
-
onSelect:
|
|
58710
|
+
onSelect: N,
|
|
58565
58711
|
fieldNames: R,
|
|
58566
58712
|
titleRender: (W) => /* @__PURE__ */ jsx(EllipsisWithTooltip, { ellipsis: !0, children: getLabelFormatValue(w, c(W[A])) }),
|
|
58567
|
-
selectedKeys:
|
|
58713
|
+
selectedKeys: $,
|
|
58568
58714
|
blockNode: !0
|
|
58569
58715
|
}
|
|
58570
58716
|
)
|
|
@@ -58966,10 +59112,10 @@ const DataBlockInitializer = (e) => {
|
|
|
58966
59112
|
currentText: b,
|
|
58967
59113
|
otherText: S
|
|
58968
59114
|
} = e, { insert: y, setVisible: v } = useSchemaInitializer(), F = useCompile(), { getTemplateSchemaByMode: A } = useSchemaTemplateManager(), R = useCallback(
|
|
58969
|
-
(
|
|
58970
|
-
const { item: k, fromOthersInPopup: j } =
|
|
59115
|
+
(N) => V(void 0, null, function* () {
|
|
59116
|
+
const { item: k, fromOthersInPopup: j } = N;
|
|
58971
59117
|
if (f)
|
|
58972
|
-
return f(
|
|
59118
|
+
return f(N);
|
|
58973
59119
|
if (k.template) {
|
|
58974
59120
|
const O = yield A(k);
|
|
58975
59121
|
y(t ? t(O, { item: k, fromOthersInPopup: j }) : O);
|
|
@@ -58992,9 +59138,9 @@ const DataBlockInitializer = (e) => {
|
|
|
58992
59138
|
onClick: R,
|
|
58993
59139
|
currentText: b,
|
|
58994
59140
|
otherText: S
|
|
58995
|
-
}), D = useGetSchemaInitializerMenuItems(R),
|
|
58996
|
-
let
|
|
58997
|
-
return p &&
|
|
59141
|
+
}), D = useGetSchemaInitializerMenuItems(R), $ = useMemo(() => D(T, i), [D, T, i]), [z, L] = useState([]), B = useMenuSearch({ data: $, openKeys: z, hideSearch: u }), w = useMemo(() => {
|
|
59142
|
+
let N = B.filter((k) => k.key !== "search" && k.key !== "empty");
|
|
59143
|
+
return p && N.length === 1 ? N = N[0].children : N = B, [
|
|
58998
59144
|
{
|
|
58999
59145
|
key: i,
|
|
59000
59146
|
label: F(a),
|
|
@@ -59002,15 +59148,15 @@ const DataBlockInitializer = (e) => {
|
|
|
59002
59148
|
onClick: (k) => {
|
|
59003
59149
|
k.key === i && R(P(x({}, k), { item: e }));
|
|
59004
59150
|
},
|
|
59005
|
-
children:
|
|
59151
|
+
children: N
|
|
59006
59152
|
}
|
|
59007
59153
|
];
|
|
59008
|
-
}, [
|
|
59009
|
-
return
|
|
59154
|
+
}, [B, p, i, F, a, r, R, e]);
|
|
59155
|
+
return $.length > 1 || $.length === 1 && ((M = $[0].children) == null ? void 0 : M.length) > 0 ? /* @__PURE__ */ jsx(
|
|
59010
59156
|
SchemaInitializerMenu,
|
|
59011
59157
|
{
|
|
59012
|
-
onOpenChange: (
|
|
59013
|
-
L(
|
|
59158
|
+
onOpenChange: (N) => {
|
|
59159
|
+
L(N);
|
|
59014
59160
|
},
|
|
59015
59161
|
items: w
|
|
59016
59162
|
}
|