@nocobase/client 1.2.29-alpha → 1.2.32-alpha

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.
Files changed (3) hide show
  1. package/es/index.mjs +634 -625
  2. package/lib/index.js +9 -9
  3. package/package.json +5 -5
package/es/index.mjs CHANGED
@@ -65,7 +65,7 @@ import { notification, Spin, message, Tag, Result, Button, Select as Select$1, t
65
65
  import * as formilyShared from "@formily/shared";
66
66
  import { merge, uid, isArr, isFn, applyMiddleware, isNum as isNum$1, isStr, isBool, toArr as toArr$3, isValid, isReactElement, each } from "@formily/shared";
67
67
  import * as ahooks from "ahooks";
68
- import { useSetState, useRequest as useRequest$1, useUpdate, useLocalStorageState, useBoolean, useEventListener, useMemoizedFn, useDeepCompareEffect, useDebounce, useSessionStorageState } from "ahooks";
68
+ import { useSetState, useRequest as useRequest$1, useUpdate, useLocalStorageState, useBoolean, useEventListener, useMemoizedFn, useDeepCompareEffect, useCreation, useDebounce, useSessionStorageState } from "ahooks";
69
69
  import cloneDeep from "lodash/cloneDeep";
70
70
  import * as nocobaseClientUtils from "@nocobase/utils/client";
71
71
  import { isPlainObject, flatten, getValuesByPath, getDefaultFormat, str2moment, uid as uid$1, error, dayjs as dayjs$1, toGmt, toLocal, nextTick, forEach, isPortalInBody, unflatten as unflatten$1, isURL, parse, toFixedByStep, parseHTML } from "@nocobase/utils/client";
@@ -3965,7 +3965,7 @@ function addAppVersion(e, t) {
3965
3965
  addAppVersion((n = e.properties) == null ? void 0 : n[o], t);
3966
3966
  }), e;
3967
3967
  }
3968
- const name = "@nocobase/client", version$1 = "1.2.29-alpha", license = "AGPL-3.0", main = "lib/index.js", module = "es/index.mjs", types = "es/index.d.ts", dependencies = {
3968
+ const name = "@nocobase/client", version$1 = "1.2.32-alpha", license = "AGPL-3.0", main = "lib/index.js", module = "es/index.mjs", types = "es/index.d.ts", dependencies = {
3969
3969
  "@ahooksjs/use-url-state": "3.5.1",
3970
3970
  "@ant-design/cssinjs": "^1.11.1",
3971
3971
  "@ant-design/icons": "^5.1.4",
@@ -3986,9 +3986,9 @@ const name = "@nocobase/client", version$1 = "1.2.29-alpha", license = "AGPL-3.0
3986
3986
  "@formily/reactive-react": "^2.2.27",
3987
3987
  "@formily/shared": "^2.2.27",
3988
3988
  "@formily/validator": "^2.2.27",
3989
- "@nocobase/evaluators": "1.2.29-alpha",
3990
- "@nocobase/sdk": "1.2.29-alpha",
3991
- "@nocobase/utils": "1.2.29-alpha",
3989
+ "@nocobase/evaluators": "1.2.32-alpha",
3990
+ "@nocobase/sdk": "1.2.32-alpha",
3991
+ "@nocobase/utils": "1.2.32-alpha",
3992
3992
  ahooks: "^3.7.2",
3993
3993
  antd: "^5.12.8",
3994
3994
  "antd-style": "3.4.5",
@@ -4580,46 +4580,46 @@ const TreeNode = (e) => {
4580
4580
  return { label: (y = n(b)) == null ? void 0 : y.title, value: b };
4581
4581
  });
4582
4582
  }
4583
- const u = (S, { exclude: b = [], depth: y = 0, maxDepth: v, prefix: I = "" }) => y > v ? [] : t(S).map((A) => {
4583
+ const u = (S, { exclude: b = [], depth: y = 0, maxDepth: v, prefix: I = "" }) => y > v ? [] : t(S).map((k) => {
4584
4584
  var M;
4585
- if (b.includes(A.name) || !A.interface || ["sort", "password", "sequence"].includes(A.type))
4585
+ if (b.includes(k.name) || !k.interface || ["sort", "password", "sequence"].includes(k.type))
4586
4586
  return;
4587
- const k = {
4587
+ const A = {
4588
4588
  type: "duplicate",
4589
- tag: a((M = A.uiSchema) == null ? void 0 : M.title) || A.name
4590
- }, w = F(g({}, k), {
4589
+ tag: a((M = k.uiSchema) == null ? void 0 : M.title) || k.name
4590
+ }, w = F(g({}, A), {
4591
4591
  role: "button",
4592
- title: React.createElement(TreeNode, k),
4593
- key: I ? `${I}.${A.name}` : A.name,
4592
+ title: React.createElement(TreeNode, A),
4593
+ key: I ? `${I}.${k.name}` : k.name,
4594
4594
  isLeaf: !0,
4595
- field: A
4595
+ field: k
4596
4596
  });
4597
- return ["belongsTo", "belongsToMany"].includes(A.type) ? (k.type = "reference", w.type = "reference", w.title = React.createElement(TreeNode, F(g({}, k), { type: "reference" })), w.isLeaf = !1, w.children = d(A.target, {
4597
+ return ["belongsTo", "belongsToMany"].includes(k.type) ? (A.type = "reference", w.type = "reference", w.title = React.createElement(TreeNode, F(g({}, A), { type: "reference" })), w.isLeaf = !1, w.children = d(k.target, {
4598
4598
  depth: y + 1,
4599
4599
  maxDepth: v,
4600
4600
  prefix: w.key,
4601
4601
  exclude: systemKeys
4602
- })) : ["hasOne", "hasMany"].includes(A.type) && (w.isLeaf = !1, w.children = u(A.target, {
4602
+ })) : ["hasOne", "hasMany"].includes(k.type) && (w.isLeaf = !1, w.children = u(k.target, {
4603
4603
  depth: y + 1,
4604
4604
  maxDepth: v,
4605
4605
  prefix: w.key,
4606
4606
  exclude: ["id", ...systemKeys]
4607
4607
  })), w;
4608
- }).filter(Boolean), d = (S, { prefix: b, maxDepth: y, depth: v = 0, exclude: I = [] }) => v > y ? [] : t(S).map((A) => {
4608
+ }).filter(Boolean), d = (S, { prefix: b, maxDepth: y, depth: v = 0, exclude: I = [] }) => v > y ? [] : t(S).map((k) => {
4609
4609
  var M;
4610
- if (!A.target || !A.interface || I.includes(A.name))
4610
+ if (!k.target || !k.interface || I.includes(k.name))
4611
4611
  return;
4612
- const k = {
4612
+ const A = {
4613
4613
  type: "preloading",
4614
- tag: a((M = A.uiSchema) == null ? void 0 : M.title) || A.name
4615
- }, w = b ? `${b}.${A.name}` : A.name;
4614
+ tag: a((M = k.uiSchema) == null ? void 0 : M.title) || k.name
4615
+ }, w = b ? `${b}.${k.name}` : k.name;
4616
4616
  return {
4617
4617
  role: "button",
4618
- title: React.createElement(TreeNode, k),
4618
+ title: React.createElement(TreeNode, A),
4619
4619
  key: w,
4620
4620
  isLeaf: !1,
4621
- field: A,
4622
- children: d(A.target, {
4621
+ field: k,
4622
+ children: d(k.target, {
4623
4623
  prefix: w,
4624
4624
  depth: v + 1,
4625
4625
  maxDepth: y,
@@ -4631,8 +4631,8 @@ const TreeNode = (e) => {
4631
4631
  title: React.createElement(TreeNode, F(g({}, b), { type: b.type })),
4632
4632
  children: b.children ? p(b.children) : null
4633
4633
  })), m = useCallback((S, b, y) => {
4634
- var A, k;
4635
- const v = b.index, I = (k = (A = l.initialValue) == null ? void 0 : A.items) == null ? void 0 : k[v];
4634
+ var k, A;
4635
+ const v = b.index, I = (A = (k = l.initialValue) == null ? void 0 : k.items) == null ? void 0 : A[v];
4636
4636
  if (!S)
4637
4637
  return [];
4638
4638
  if (I != null && I.treeData || y)
@@ -4657,47 +4657,47 @@ const TreeNode = (e) => {
4657
4657
  getOnLoadData: h,
4658
4658
  getOnCheck: x,
4659
4659
  getScopeDataSource: (S) => {
4660
- const b = t(S), y = (A, k) => {
4660
+ const b = t(S), y = (k, A) => {
4661
4661
  var O, R;
4662
- if (!A.interface)
4662
+ if (!k.interface)
4663
4663
  return;
4664
- const w = r(A.interface);
4664
+ const w = r(k.interface);
4665
4665
  if (!(w != null && w.filterable))
4666
4666
  return;
4667
4667
  const { nested: M, children: N, operators: E } = w.filterable, z = {
4668
- name: A.name,
4669
- title: ((O = A == null ? void 0 : A.uiSchema) == null ? void 0 : O.title) || A.name,
4670
- schema: A == null ? void 0 : A.uiSchema,
4671
- operators: ((R = E == null ? void 0 : E.filter) == null ? void 0 : R.call(E, (j) => !(j != null && j.visible) || j.visible(A))) || [],
4672
- interface: A.interface
4668
+ name: k.name,
4669
+ title: ((O = k == null ? void 0 : k.uiSchema) == null ? void 0 : O.title) || k.name,
4670
+ schema: k == null ? void 0 : k.uiSchema,
4671
+ operators: ((R = E == null ? void 0 : E.filter) == null ? void 0 : R.call(E, (j) => !(j != null && j.visible) || j.visible(k))) || [],
4672
+ interface: k.interface
4673
4673
  };
4674
- if (!(A.target && k > 2)) {
4675
- if (k > 2)
4674
+ if (!(k.target && A > 2)) {
4675
+ if (A > 2)
4676
4676
  return z;
4677
4677
  if (N != null && N.length && (z.children = N), M) {
4678
- const j = t(A.target), B = v(j, k + 1).filter(Boolean);
4678
+ const j = t(k.target), B = v(j, A + 1).filter(Boolean);
4679
4679
  z.children = z.children || [], z.children.push(...B);
4680
4680
  }
4681
4681
  return z;
4682
4682
  }
4683
- }, v = (A, k) => {
4683
+ }, v = (k, A) => {
4684
4684
  const w = [];
4685
- return A.forEach((M) => {
4686
- const N = y(M, k);
4685
+ return k.forEach((M) => {
4686
+ const N = y(M, A);
4687
4687
  N && w.push(N);
4688
4688
  }), w;
4689
4689
  };
4690
4690
  return v(b, 1);
4691
4691
  },
4692
4692
  useTitleFieldDataSource: (S) => {
4693
- const b = S.path.entire.replace("titleField", "collection"), y = S.query(b).get("value"), I = t(y).filter((A) => {
4694
- var k;
4695
- return (k = r(A.interface)) == null ? void 0 : k.titleUsable;
4696
- }).map((A) => {
4697
- var k;
4693
+ const b = S.path.entire.replace("titleField", "collection"), y = S.query(b).get("value"), I = t(y).filter((k) => {
4694
+ var A;
4695
+ return (A = r(k.interface)) == null ? void 0 : A.titleUsable;
4696
+ }).map((k) => {
4697
+ var A;
4698
4698
  return {
4699
- value: A == null ? void 0 : A.name,
4700
- label: a((k = A == null ? void 0 : A.uiSchema) == null ? void 0 : k.title) || (A == null ? void 0 : A.name)
4699
+ value: k == null ? void 0 : k.name,
4700
+ label: a((A = k == null ? void 0 : k.uiSchema) == null ? void 0 : A.title) || (k == null ? void 0 : k.name)
4701
4701
  };
4702
4702
  });
4703
4703
  S.dataSource = I;
@@ -6144,14 +6144,14 @@ const collectFieldStateOfLinkageRules = ({
6144
6144
  if ((t == null ? void 0 : t.mode) === "express") {
6145
6145
  if ((t.value || t.result) == null)
6146
6146
  return;
6147
- const { exp: I, scope: A } = yield replaceVariables(t.value || t.result, {
6147
+ const { exp: I, scope: k } = yield replaceVariables(t.value || t.result, {
6148
6148
  variables: r,
6149
6149
  localVariables: i
6150
6150
  });
6151
6151
  try {
6152
- return d(I, g({ now: () => (/* @__PURE__ */ new Date()).toString() }, A));
6153
- } catch (k) {
6154
- console.error(k);
6152
+ return d(I, g({ now: () => (/* @__PURE__ */ new Date()).toString() }, k));
6153
+ } catch (A) {
6154
+ console.error(A);
6155
6155
  }
6156
6156
  } else
6157
6157
  return (t == null ? void 0 : t.mode) === "constant" ? (v = t == null ? void 0 : t.value) != null ? v : t : null;
@@ -7595,7 +7595,7 @@ function withInitializer(e) {
7595
7595
  S ? S(c(z, { isInSubTable: i })) : r(u, c(z, { isInSubTable: i }), { onSuccess: d });
7596
7596
  },
7597
7597
  [S, c, r, u, d]
7598
- ), { wrapSSR: y, hashId: v, componentCls: I } = useSchemaInitializerStyles(), [A, k] = useState(!1), { token: w } = theme.useToken(), M = useNiceDropdownMaxHeight([A]), N = useMemo(
7598
+ ), { wrapSSR: y, hashId: v, componentCls: I } = useSchemaInitializerStyles(), [k, A] = useState(!1), { token: w } = theme.useToken(), M = useNiceDropdownMaxHeight([k]), N = useMemo(
7599
7599
  () => g({
7600
7600
  options: o,
7601
7601
  style: f
@@ -7616,8 +7616,8 @@ function withInitializer(e) {
7616
7616
  SchemaInitializerContext.Provider,
7617
7617
  {
7618
7618
  value: {
7619
- visible: A,
7620
- setVisible: k,
7619
+ visible: k,
7620
+ setVisible: A,
7621
7621
  insert: b,
7622
7622
  options: o
7623
7623
  },
@@ -7628,8 +7628,8 @@ function withInitializer(e) {
7628
7628
  }, m), {
7629
7629
  arrow: !1,
7630
7630
  overlayClassName: E,
7631
- open: A,
7632
- onOpenChange: k,
7631
+ open: k,
7632
+ onOpenChange: A,
7633
7633
  content: y(
7634
7634
  /* @__PURE__ */ jsx(
7635
7635
  "div",
@@ -7821,8 +7821,8 @@ const SchemaInitializerItemInternal = () => {
7821
7821
  "componentProps",
7822
7822
  "sort"
7823
7823
  ]), m = a(), h = l(), x = useFindComponent(), f = o || n, C = !f && t && typeComponentMap$1[t], S = useMemo(() => {
7824
- const A = [...m || [], ...r || []];
7825
- return A.length === 0 ? void 0 : A;
7824
+ const k = [...m || [], ...r || []];
7825
+ return k.length === 0 ? void 0 : k;
7826
7826
  }, [m, r]), b = useMemo(() => F(g(g(g({}, p), C ? h : {}), C ? u : {}), {
7827
7827
  children: S
7828
7828
  }), [p, C, h, u, S]);
@@ -8452,13 +8452,13 @@ https://requirejs.org/docs/errors.html#` + e);
8452
8452
  id: (Y ? Y + "!" + J : J) + U
8453
8453
  };
8454
8454
  }
8455
- function A(T) {
8455
+ function k(T) {
8456
8456
  var D = T.id, $ = getOwn(l, D);
8457
8457
  return $ || ($ = l[D] = new n.Module(T)), $;
8458
8458
  }
8459
- function k(T, D, $) {
8459
+ function A(T, D, $) {
8460
8460
  var q = T.id, L = getOwn(l, q);
8461
- hasProp(p, q) && (!L || L.defineEmitComplete) ? D === "defined" && $(p[q]) : (L = A(T), L.error && D === "error" ? $(L.error) : L.on(D, $));
8461
+ hasProp(p, q) && (!L || L.defineEmitComplete) ? D === "defined" && $(p[q]) : (L = k(T), L.error && D === "error" ? $(L.error) : L.on(D, $));
8462
8462
  }
8463
8463
  function w(T, D) {
8464
8464
  var $ = T.requireModules, q = !1;
@@ -8591,7 +8591,7 @@ https://requirejs.org/docs/errors.html#` + e);
8591
8591
  },
8592
8592
  callPlugin: function() {
8593
8593
  var T = this.map, D = T.id, $ = I(T.prefix);
8594
- this.depMaps.push($), k($, "defined", bind(this, function(q) {
8594
+ this.depMaps.push($), A($, "defined", bind(this, function(q) {
8595
8595
  var L, G, U, K = getOwn(h, this.map.id), Y = this.map.name, W = this.map.parentMap ? this.map.parentMap.name : null, X = n.makeRequire(T.parentMap, {
8596
8596
  enableBuildCallback: !0
8597
8597
  });
@@ -8602,7 +8602,7 @@ https://requirejs.org/docs/errors.html#` + e);
8602
8602
  T.prefix + "!" + Y,
8603
8603
  this.map.parentMap,
8604
8604
  !0
8605
- ), k(
8605
+ ), A(
8606
8606
  G,
8607
8607
  "defined",
8608
8608
  bind(this, function(Q) {
@@ -8634,7 +8634,7 @@ https://requirejs.org/docs/errors.html#` + e);
8634
8634
  }), w(Q);
8635
8635
  }), L.fromText = bind(this, function(Q, J) {
8636
8636
  var oe = T.name, re = I(oe), te = useInteractive;
8637
- J && (Q = J), te && (useInteractive = !1), A(re), hasProp(a.config, D) && (a.config[oe] = a.config[D]);
8637
+ J && (Q = J), te && (useInteractive = !1), k(re), hasProp(a.config, D) && (a.config[oe] = a.config[D]);
8638
8638
  try {
8639
8639
  req.exec(Q);
8640
8640
  } catch (se) {
@@ -8662,9 +8662,9 @@ https://requirejs.org/docs/errors.html#` + e);
8662
8662
  this.depExports[D] = L(this);
8663
8663
  return;
8664
8664
  }
8665
- this.depCount += 1, k(T, "defined", bind(this, function(G) {
8665
+ this.depCount += 1, A(T, "defined", bind(this, function(G) {
8666
8666
  this.undefed || (this.defineDep(D, G), this.check());
8667
- })), this.errback ? k(T, "error", bind(this, this.errback)) : this.events.error && k(T, "error", bind(this, function(G) {
8667
+ })), this.errback ? A(T, "error", bind(this, this.errback)) : this.events.error && A(T, "error", bind(this, function(G) {
8668
8668
  this.emit("error", G);
8669
8669
  }));
8670
8670
  }
@@ -8685,7 +8685,7 @@ https://requirejs.org/docs/errors.html#` + e);
8685
8685
  }
8686
8686
  };
8687
8687
  function O(T) {
8688
- hasProp(p, T[0]) || A(I(T[0], null, !0)).init(T[1], T[2]);
8688
+ hasProp(p, T[0]) || k(I(T[0], null, !0)).init(T[1], T[2]);
8689
8689
  }
8690
8690
  function R(T, D, $, q) {
8691
8691
  T.detachEvent && !isOpera ? q && T.detachEvent(q, D) : T.removeEventListener($, D, !1);
@@ -8764,7 +8764,7 @@ https://requirejs.org/docs/errors.html#` + e);
8764
8764
  function $(q, L, G) {
8765
8765
  var U, K, Y;
8766
8766
  return D.enableBuildCallback && L && isFunction(L) && (L.__requireJsBuild = !0), typeof q == "string" ? isFunction(L) ? w(makeError("requireargs", "Invalid require call"), G) : T && hasProp(r, q) ? r[q](l[T.id]) : req.get ? req.get(n, q, T, $) : (K = I(q, T, !1, !0), U = K.id, hasProp(p, U) ? p[U] : w(makeError("notloaded", 'Module name "' + U + '" has not been loaded yet for context: ' + e + (T ? "" : ". Use require([])")))) : (B(), n.nextTick(function() {
8767
- B(), Y = A(I(null, T)), Y.skipMap = D.skipMap, Y.init(q, L, G, {
8767
+ B(), Y = k(I(null, T)), Y.skipMap = D.skipMap, Y.init(q, L, G, {
8768
8768
  enabled: !0
8769
8769
  }), z();
8770
8770
  }), $);
@@ -8806,7 +8806,7 @@ https://requirejs.org/docs/errors.html#` + e);
8806
8806
  */
8807
8807
  enable: function(T) {
8808
8808
  var D = getOwn(l, T.id);
8809
- D && A(T).enable();
8809
+ D && k(T).enable();
8810
8810
  },
8811
8811
  /**
8812
8812
  * Internal method used by environment adapters to complete a load event.
@@ -9053,7 +9053,7 @@ const useCollectionManager_deprecated = (e) => {
9053
9053
  return R ? ((T = (B = p(j)) == null ? void 0 : B.getCollection(R)) == null ? void 0 : T.getCurrentFields()) || [] : [];
9054
9054
  },
9055
9055
  [t, p]
9056
- ), A = useCallback(
9056
+ ), k = useCallback(
9057
9057
  (R, j = "string", B) => {
9058
9058
  var Q;
9059
9059
  const {
@@ -9080,7 +9080,7 @@ const useCollectionManager_deprecated = (e) => {
9080
9080
  value: K && U ? `${U}.${J.name}` : J.name,
9081
9081
  label: f((re = J == null ? void 0 : J.uiSchema) == null ? void 0 : re.title) || J.name
9082
9082
  }, J);
9083
- return T && J.target && (oe.children = $.includes(J.target) ? [] : A(J.target, j, F(g({}, B), {
9083
+ return T && J.target && (oe.children = $.includes(J.target) ? [] : k(J.target, j, F(g({}, B), {
9084
9084
  cached: D,
9085
9085
  dataSource: Y,
9086
9086
  collectionNames: [...$, J.target],
@@ -9091,7 +9091,7 @@ const useCollectionManager_deprecated = (e) => {
9091
9091
  return D[R] = X, X;
9092
9092
  },
9093
9093
  [S]
9094
- ), k = useCallback(
9094
+ ), A = useCallback(
9095
9095
  (R, j) => {
9096
9096
  var B;
9097
9097
  return (B = p(j)) == null ? void 0 : B.getCollection(R);
@@ -9137,13 +9137,13 @@ const useCollectionManager_deprecated = (e) => {
9137
9137
  getInheritCollections: y,
9138
9138
  getChildrenCollections: v,
9139
9139
  refreshCM: x,
9140
- get: k,
9140
+ get: A,
9141
9141
  getInheritedFields: C,
9142
9142
  getCollectionField: b,
9143
9143
  getCollectionFields: S,
9144
- getCollectionFieldsOptions: A,
9144
+ getCollectionFieldsOptions: k,
9145
9145
  getCurrentCollectionFields: I,
9146
- getCollection: k,
9146
+ getCollection: A,
9147
9147
  getCollectionJoinField: b,
9148
9148
  getAllCollectionsInheritChain: w,
9149
9149
  getInheritCollectionsChain: M,
@@ -9858,9 +9858,9 @@ const BaseVariableContext = React.createContext(null), BaseVariableProvider = (e
9858
9858
  if (!((I = y.field) != null && I.target))
9859
9859
  return Promise.resolve(void 0);
9860
9860
  const v = y.field.target;
9861
- return new Promise((A) => {
9861
+ return new Promise((k) => {
9862
9862
  setTimeout(() => {
9863
- const k = (getChildren$2(d(x(v, u), y), {
9863
+ const A = (getChildren$2(d(x(v, u), y), {
9864
9864
  collectionField: e,
9865
9865
  uiSchema: t,
9866
9866
  targetFieldSchema: o,
@@ -9873,11 +9873,11 @@ const BaseVariableContext = React.createContext(null), BaseVariableProvider = (e
9873
9873
  getCollectionField: C.getCollectionField,
9874
9874
  deprecated: p
9875
9875
  }) || []).sort((w, M) => w.isLeaf && !M.isLeaf ? -1 : !w.isLeaf && M.isLeaf ? 1 : 0).sort((w, M) => w.disabled && !M.disabled ? 1 : !w.disabled && M.disabled ? -1 : 0);
9876
- if (k.length === 0) {
9877
- y.disabled = !0, y.isLeaf = !0, A();
9876
+ if (A.length === 0) {
9877
+ y.disabled = !0, y.isLeaf = !0, k();
9878
9878
  return;
9879
9879
  }
9880
- y.children = k, A();
9880
+ y.children = A, k();
9881
9881
  }, 5);
9882
9882
  });
9883
9883
  };
@@ -10099,14 +10099,14 @@ const variablesStore = {}, getFieldPath = (e, t) => {
10099
10099
  var E;
10100
10100
  const b = f.split("."), y = b[0], v = mergeVariableToCollectionNameWithLocalVariables(variablesStore, C);
10101
10101
  let I = mergeCtxWithLocalVariables(t.current, C);
10102
- const { fieldPath: A, dataSource: k, variableOption: w } = getFieldPath(y, v);
10103
- let M = A;
10102
+ const { fieldPath: k, dataSource: A, variableOption: w } = getFieldPath(y, v);
10103
+ let M = k;
10104
10104
  if (!(y in I))
10105
10105
  throw new Error(`VariablesProvider: ${y} is not found`);
10106
10106
  for (let z = 0; z < b.length; z++) {
10107
10107
  if (I == null)
10108
10108
  return I === void 0 ? w.defaultValue : I;
10109
- const O = b[z], { fieldPath: R } = getFieldPath(b.slice(0, z + 1).join("."), v), j = n(R, k), B = (E = r(M)) == null ? void 0 : E.getPrimaryKey();
10109
+ const O = b[z], { fieldPath: R } = getFieldPath(b.slice(0, z + 1).join("."), v), j = n(R, A), B = (E = r(M)) == null ? void 0 : E.getPrimaryKey();
10110
10110
  if (Array.isArray(I)) {
10111
10111
  const T = I.map((D) => {
10112
10112
  if (shouldToRequest(D == null ? void 0 : D[O]) && (D == null ? void 0 : D[B]) != null && j != null && j.target) {
@@ -10114,7 +10114,7 @@ const variablesStore = {}, getFieldPath = (e, t) => {
10114
10114
  if (hasRequested($))
10115
10115
  return getRequested($);
10116
10116
  const q = o.request({
10117
- headers: getDataSourceHeaders(k),
10117
+ headers: getDataSourceHeaders(A),
10118
10118
  url: $,
10119
10119
  params: {
10120
10120
  appends: S == null ? void 0 : S.appends
@@ -10132,7 +10132,7 @@ const variablesStore = {}, getFieldPath = (e, t) => {
10132
10132
  D = yield getRequested(T);
10133
10133
  else {
10134
10134
  const $ = o.request({
10135
- headers: getDataSourceHeaders(k),
10135
+ headers: getDataSourceHeaders(A),
10136
10136
  url: T,
10137
10137
  params: {
10138
10138
  appends: S == null ? void 0 : S.appends
@@ -10185,7 +10185,7 @@ const variablesStore = {}, getFieldPath = (e, t) => {
10185
10185
  [c]
10186
10186
  ), h = useCallback(
10187
10187
  (f, C) => V(void 0, null, function* () {
10188
- var A;
10188
+ var k;
10189
10189
  if (!isVariable(f))
10190
10190
  throw new Error(`VariablesProvider: ${f} is not a variable string`);
10191
10191
  C && (C = _.isArray(C) ? C : [C]);
@@ -10195,7 +10195,7 @@ const variablesStore = {}, getFieldPath = (e, t) => {
10195
10195
  ), b = getPath(f), { fieldPath: y, dataSource: v } = getFieldPath(b, S);
10196
10196
  let I = n(y, v);
10197
10197
  return !I && !b.includes(".") && (I = {
10198
- target: (A = S[b]) == null ? void 0 : A.collectionName
10198
+ target: (k = S[b]) == null ? void 0 : k.collectionName
10199
10199
  }), I;
10200
10200
  }),
10201
10201
  [n]
@@ -10811,7 +10811,7 @@ function useServiceOptions$1(e) {
10811
10811
  var D;
10812
10812
  const T = yield u(mergeFilter([v || ((D = o == null ? void 0 : o.params) == null ? void 0 : D.filter)]));
10813
10813
  m(T);
10814
- }), A = _.debounce(I, DEBOUNCE_WAIT);
10814
+ }), k = _.debounce(I, DEBOUNCE_WAIT);
10815
10815
  return I(), reaction(
10816
10816
  () => flatten(v, {
10817
10817
  breakOn({ key: D }) {
@@ -10829,7 +10829,7 @@ function useServiceOptions$1(e) {
10829
10829
  );
10830
10830
  }
10831
10831
  }),
10832
- A,
10832
+ k,
10833
10833
  {
10834
10834
  equals: _.isEqual
10835
10835
  }
@@ -11404,13 +11404,13 @@ GridContext.displayName = "GridContext";
11404
11404
  const breakRemoveOnGrid = (e) => e["x-component"] === "Grid", breakRemoveOnRow = (e) => e["x-component"] === "Grid.Row", MemorizedRecursionField = React.memo(RecursionField);
11405
11405
  MemorizedRecursionField.displayName = "MemorizedRecursionField";
11406
11406
  const ColDivider = (e) => {
11407
- var I, A, k;
11407
+ var I, k, A;
11408
11408
  const { token: t } = useToken(), o = useRef(null), { isOver: n, setNodeRef: r } = useDroppable({
11409
11409
  id: e.id,
11410
11410
  data: e.data
11411
11411
  }), { dn: i, designable: a } = useDesignable(), l = useRef(), c = useMemo(() => n ? {
11412
11412
  backgroundColor: new TinyColor(t.colorSettings).setAlpha(0.1).toHex8String()
11413
- } : {}, [n]), d = (k = (A = (I = useDndContext().active) == null ? void 0 : I.data.current) == null ? void 0 : A.schema) == null ? void 0 : k.parent, p = d ? Object.keys(d.properties).length : 0;
11413
+ } : {}, [n]), d = (A = (k = (I = useDndContext().active) == null ? void 0 : I.data.current) == null ? void 0 : k.schema) == null ? void 0 : A.parent, p = d ? Object.keys(d.properties).length : 0;
11414
11414
  let m = !0;
11415
11415
  if (p === 1)
11416
11416
  if (e.first)
@@ -12201,19 +12201,19 @@ const DataBlockInitializer = (e) => {
12201
12201
  filterOtherRecordsCollection: C,
12202
12202
  currentText: S,
12203
12203
  otherText: b
12204
- } = e, { insert: y, setVisible: v } = useSchemaInitializer(), I = useCompile(), { getTemplateSchemaByMode: A } = useSchemaTemplateManager(), k = useCallback(
12204
+ } = e, { insert: y, setVisible: v } = useSchemaInitializer(), I = useCompile(), { getTemplateSchemaByMode: k } = useSchemaTemplateManager(), A = useCallback(
12205
12205
  (B) => V(void 0, null, function* () {
12206
12206
  const { item: T, fromOthersInPopup: D } = B;
12207
12207
  if (f)
12208
12208
  return f(B);
12209
12209
  if (T.template) {
12210
- const $ = yield A(T);
12210
+ const $ = yield k(T);
12211
12211
  y(t ? t($, { item: T, fromOthersInPopup: D }) : $);
12212
12212
  } else
12213
12213
  o && o({ item: T, fromOthersInPopup: D });
12214
12214
  v(!1);
12215
12215
  }),
12216
- [A, y, v, o, f, t]
12216
+ [k, y, v, o, f, t]
12217
12217
  ), w = h || // eslint-disable-next-line react-hooks/rules-of-hooks
12218
12218
  useCollectionDataSourceItems({
12219
12219
  name: i,
@@ -12225,10 +12225,10 @@ const DataBlockInitializer = (e) => {
12225
12225
  showAssociationFields: d,
12226
12226
  dataBlockInitializerProps: e,
12227
12227
  hideOtherRecordsInPopup: x,
12228
- onClick: k,
12228
+ onClick: A,
12229
12229
  currentText: S,
12230
12230
  otherText: b
12231
- }), M = useGetSchemaInitializerMenuItems(k), N = useMemo(() => M(w, i), [M, w, i]), [E, z] = useState([]), O = useMenuSearch({ data: N, openKeys: E, hideSearch: u }), R = useMemo(() => {
12231
+ }), M = useGetSchemaInitializerMenuItems(A), N = useMemo(() => M(w, i), [M, w, i]), [E, z] = useState([]), O = useMenuSearch({ data: N, openKeys: E, hideSearch: u }), R = useMemo(() => {
12232
12232
  let B = O.filter((T) => T.key !== "search" && T.key !== "empty");
12233
12233
  return p && B.length === 1 ? B = B[0].children : B = O, [
12234
12234
  {
@@ -12236,12 +12236,12 @@ const DataBlockInitializer = (e) => {
12236
12236
  label: I(a),
12237
12237
  icon: typeof r == "string" ? /* @__PURE__ */ jsx(antIcons__default, { type: r }) : r,
12238
12238
  onClick: (T) => {
12239
- T.key === i && k(F(g({}, T), { item: e }));
12239
+ T.key === i && A(F(g({}, T), { item: e }));
12240
12240
  },
12241
12241
  children: B
12242
12242
  }
12243
12243
  ];
12244
- }, [O, p, i, I, a, r, k, e]);
12244
+ }, [O, p, i, I, a, r, A, e]);
12245
12245
  return N.length > 1 || N.length === 1 && ((j = N[0].children) == null ? void 0 : j.length) > 0 ? /* @__PURE__ */ jsx(
12246
12246
  SchemaInitializerMenu,
12247
12247
  {
@@ -12250,7 +12250,7 @@ const DataBlockInitializer = (e) => {
12250
12250
  },
12251
12251
  items: R
12252
12252
  }
12253
- ) : /* @__PURE__ */ jsx(SchemaInitializerItem, F(g({}, e), { onClick: k }));
12253
+ ) : /* @__PURE__ */ jsx(SchemaInitializerItem, F(g({}, e), { onClick: A }));
12254
12254
  }, createTableBlockUISchema = (e) => {
12255
12255
  const { collectionName: t, dataSource: o, rowKey: n, association: r } = e;
12256
12256
  if (!o)
@@ -13225,13 +13225,13 @@ const FilterFormDesigner = () => /* @__PURE__ */ jsx(GeneralSchemaDesigner, { sc
13225
13225
  if (S == null)
13226
13226
  return;
13227
13227
  const { appends: I } = d();
13228
- i.parseVariable(v, y, { appends: I }).then((A) => {
13228
+ i.parseVariable(v, y, { appends: I }).then((k) => {
13229
13229
  nextTick(() => {
13230
- const k = transformVariableValue(A, { targetCollectionField: h.current });
13231
- _.isEmpty(k) && !_.isNumber(k) ? a.value = null : a.value = k;
13230
+ const A = transformVariableValue(k, { targetCollectionField: h.current });
13231
+ _.isEmpty(A) && !_.isNumber(A) ? a.value = null : a.value = A;
13232
13232
  });
13233
- }).catch((A) => {
13234
- console.error(A);
13233
+ }).catch((k) => {
13234
+ console.error(k);
13235
13235
  });
13236
13236
  }, [S, f]);
13237
13237
  };
@@ -13264,8 +13264,8 @@ const useParseDefaultValue = () => {
13264
13264
  const S = getVariableName(t.default), b = x(S);
13265
13265
  return b ? (f(), reaction(
13266
13266
  () => {
13267
- const v = { [S]: (b == null ? void 0 : b.ctx) || {} }, I = getPath(t.default), A = getValuesByPath(v, I);
13268
- return A === void 0 ? Math.random() : A;
13267
+ const v = { [S]: (b == null ? void 0 : b.ctx) || {} }, I = getPath(t.default), k = getValuesByPath(v, I);
13268
+ return k === void 0 ? Math.random() : k;
13269
13269
  },
13270
13270
  () => C({ forceUpdate: !0 }),
13271
13271
  {
@@ -13906,12 +13906,12 @@ const findOption$1 = (e = [], t) => {
13906
13906
  var I;
13907
13907
  if (o.data = o.data || {}, !l || !n)
13908
13908
  return;
13909
- const [x = "", f = ""] = l.split(".$"), [C] = f.split(".", 2), S = x.split("."), b = findOption$1(S, n), y = b == null ? void 0 : b.operators, v = (I = y == null ? void 0 : y.find) == null ? void 0 : I.call(y, (A) => A.value === `$${C}`);
13909
+ const [x = "", f = ""] = l.split(".$"), [C] = f.split(".", 2), S = x.split("."), b = findOption$1(S, n), y = b == null ? void 0 : b.operators, v = (I = y == null ? void 0 : y.find) == null ? void 0 : I.call(y, (k) => k.value === `$${C}`);
13910
13910
  if (o.data.dataIndex = S, (S == null ? void 0 : S.length) > 1) {
13911
- const A = S.concat();
13912
- A.pop();
13913
- const k = t(`${e}.${A.join(".")}`);
13914
- i.collectionName = k == null ? void 0 : k.target;
13911
+ const k = S.concat();
13912
+ k.pop();
13913
+ const A = t(`${e}.${k.join(".")}`);
13914
+ i.collectionName = A == null ? void 0 : A.target;
13915
13915
  } else
13916
13916
  i.collectionName = null;
13917
13917
  o.data.operators = y, o.data.operator = v, o.data.schema = merge(b == null ? void 0 : b.schema, v == null ? void 0 : v.schema), o.data.value = get$1(unflatten(o.value), `${x}.$${C}`);
@@ -13935,7 +13935,7 @@ const findOption$1 = (e = [], t) => {
13935
13935
  ), m = useCallback(
13936
13936
  (x) => {
13937
13937
  var y, v, I;
13938
- const f = (I = (v = (y = o.data) == null ? void 0 : y.operators) == null ? void 0 : v.find) == null ? void 0 : I.call(v, (A) => A.value === x);
13938
+ const f = (I = (v = (y = o.data) == null ? void 0 : y.operators) == null ? void 0 : v.find) == null ? void 0 : I.call(v, (k) => k.value === x);
13939
13939
  o.data.operator = f;
13940
13940
  const C = findOption$1(o.data.dataIndex, n), S = cloneDeep(C == null ? void 0 : C.schema), b = cloneDeep(f == null ? void 0 : f.schema);
13941
13941
  o.data.schema = merge(S, b), o.data.value = f.noValue ? f.default || !0 : void 0, u();
@@ -14119,7 +14119,7 @@ const findOption$1 = (e = [], t) => {
14119
14119
  collectionField: e,
14120
14120
  noDisabled: r,
14121
14121
  targetFieldSchema: i
14122
- }), { currentParentRecordSettings: A, shouldDisplayCurrentParentRecord: k } = useCurrentParentRecordVariable({
14122
+ }), { currentParentRecordSettings: k, shouldDisplayCurrentParentRecord: A } = useCurrentParentRecordVariable({
14123
14123
  schema: o,
14124
14124
  collectionName: l,
14125
14125
  collectionField: e,
@@ -14134,7 +14134,7 @@ const findOption$1 = (e = [], t) => {
14134
14134
  h && m,
14135
14135
  f && x,
14136
14136
  S && C,
14137
- k && A,
14137
+ A && k,
14138
14138
  y && b,
14139
14139
  I && v,
14140
14140
  M && w
@@ -14149,8 +14149,8 @@ const findOption$1 = (e = [], t) => {
14149
14149
  x,
14150
14150
  S,
14151
14151
  C,
14152
- k,
14153
14152
  A,
14153
+ k,
14154
14154
  y,
14155
14155
  b,
14156
14156
  M,
@@ -14186,13 +14186,13 @@ const findOption$1 = (e = [], t) => {
14186
14186
  targetFieldSchema: h,
14187
14187
  blockCollectionName: f
14188
14188
  });
14189
- l && y.every((k) => k.value !== v.value) && y.push(v);
14190
- const A = useCallback(
14191
- (k, w) => {
14189
+ l && y.every((A) => A.value !== v.value) && y.push(v);
14190
+ const k = useCallback(
14191
+ (A, w) => {
14192
14192
  if (!u)
14193
- return o(k);
14193
+ return o(A);
14194
14194
  setTimeout(() => V(void 0, null, function* () {
14195
- (yield u(k, w)) && o(k);
14195
+ (yield u(A, w)) && o(A);
14196
14196
  }));
14197
14197
  },
14198
14198
  [o, u]
@@ -14202,7 +14202,7 @@ const findOption$1 = (e = [], t) => {
14202
14202
  {
14203
14203
  className: a,
14204
14204
  value: t,
14205
- onChange: A,
14205
+ onChange: k,
14206
14206
  scope: m(
14207
14207
  I(_.isEmpty(C) ? y : C, {
14208
14208
  value: t
@@ -14732,14 +14732,14 @@ const SchemaSettingsDefaultValue = function e(t) {
14732
14732
  var B, T, D, $;
14733
14733
  const o = useFieldSchema(), n = (B = t == null ? void 0 : t.fieldSchema) != null ? B : o, r = useField(), { dn: i } = useDesignable(), { t: a } = useTranslation(), l = useActionContext();
14734
14734
  let c;
14735
- const { getField: u } = useCollection_deprecated(), { getCollectionJoinField: d, getCollectionFields: p, getAllCollectionsInheritChain: m } = useCollectionManager_deprecated(), h = useVariables(), x = useLocalVariables(), f = useCollection_deprecated(), C = useRecord(), { form: S } = useFormBlockContext(), { getFields: b } = useCollectionFilterOptionsV2(f), { isInSubForm: y, isInSubTable: v } = useFlag() || {}, { name: I } = f, A = useMemo(
14735
+ const { getField: u } = useCollection_deprecated(), { getCollectionJoinField: d, getCollectionFields: p, getAllCollectionsInheritChain: m } = useCollectionManager_deprecated(), h = useVariables(), x = useLocalVariables(), f = useCollection_deprecated(), C = useRecord(), { form: S } = useFormBlockContext(), { getFields: b } = useCollectionFilterOptionsV2(f), { isInSubForm: y, isInSubTable: v } = useFlag() || {}, { name: I } = f, k = useMemo(
14736
14736
  () => u(n.name) || d(n["x-collection-field"]),
14737
14737
  [n, d, u]
14738
- ), k = _.omit(n, "required");
14739
- A != null && A.target && (c = d(
14740
- `${A.target}.${((D = (T = n["x-component-props"]) == null ? void 0 : T.fieldNames) == null ? void 0 : D.label) || "id"}`
14738
+ ), A = _.omit(n, "required");
14739
+ k != null && k.target && (c = d(
14740
+ `${k.target}.${((D = (T = n["x-component-props"]) == null ? void 0 : T.fieldNames) == null ? void 0 : D.label) || "id"}`
14741
14741
  ));
14742
- const w = (A == null ? void 0 : A.interface) === "m2o" && findParentFieldSchema(n), M = w && d(w == null ? void 0 : w["x-collection-field"]), N = useTableBlockContext(), E = (($ = l == null ? void 0 : l.fieldSchema) == null ? void 0 : $["x-action"]) === "customize:create" && ((A == null ? void 0 : A.interface) === "m2m" || (M == null ? void 0 : M.type) === "hasMany" && (A == null ? void 0 : A.interface) === "m2o"), z = useCallback(
14742
+ const w = (k == null ? void 0 : k.interface) === "m2o" && findParentFieldSchema(n), M = w && d(w == null ? void 0 : w["x-collection-field"]), N = useTableBlockContext(), E = (($ = l == null ? void 0 : l.fieldSchema) == null ? void 0 : $["x-action"]) === "customize:create" && ((k == null ? void 0 : k.interface) === "m2m" || (M == null ? void 0 : M.type) === "hasMany" && (k == null ? void 0 : k.interface) === "m2o"), z = useCallback(
14743
14743
  (q) => {
14744
14744
  const L = q.find((U) => U.value === "$nForm"), G = p(I);
14745
14745
  return !(G != null && G.length) && L && (L.children = formatVariableScop(b())), q;
@@ -14757,29 +14757,29 @@ const SchemaSettingsDefaultValue = function e(t) {
14757
14757
  "x-decorator": "FormItem",
14758
14758
  "x-component": "VariableInput",
14759
14759
  "x-component-props": F(g({}, (n == null ? void 0 : n["x-component-props"]) || {}), {
14760
- collectionField: A,
14760
+ collectionField: k,
14761
14761
  contextCollectionName: E && N.collection,
14762
- schema: A == null ? void 0 : A.uiSchema,
14762
+ schema: k == null ? void 0 : k.uiSchema,
14763
14763
  targetFieldSchema: n,
14764
14764
  className: defaultInputStyle,
14765
14765
  form: S,
14766
14766
  record: C,
14767
14767
  returnScope: z,
14768
14768
  shouldChange: getShouldChange({
14769
- collectionField: A,
14769
+ collectionField: k,
14770
14770
  variables: h,
14771
14771
  localVariables: x,
14772
14772
  getAllCollectionsInheritChain: m
14773
14773
  }),
14774
14774
  renderSchemaComponent: function(L) {
14775
- const G = _.cloneDeep(k) || {};
14775
+ const G = _.cloneDeep(A) || {};
14776
14776
  G.title = "", G.name = "default", G["x-read-pretty"] = !1, G["x-disabled"] = !1;
14777
- const U = getFieldDefaultValue(G, A);
14778
- A.target && G["x-component-props"] && (G["x-component-props"].mode = "Select"), A != null && A.uiSchema.type && (G.type = A.uiSchema.type), (A == null ? void 0 : A.uiSchema["x-component"]) === "Checkbox" && (_.set(G, "x-component-props.defaultChecked", U), G.type = "void");
14777
+ const U = getFieldDefaultValue(G, k);
14778
+ k.target && G["x-component-props"] && (G["x-component-props"].mode = "Select"), k != null && k.uiSchema.type && (G.type = k.uiSchema.type), (k == null ? void 0 : k.uiSchema["x-component"]) === "Checkbox" && (_.set(G, "x-component-props.defaultChecked", U), G.type = "void");
14779
14779
  const K = F(g({}, G || {}), {
14780
14780
  "x-decorator": "FormItem",
14781
14781
  "x-component-props": F(g({}, G["x-component-props"]), {
14782
- collectionName: A == null ? void 0 : A.collectionName,
14782
+ collectionName: k == null ? void 0 : k.collectionName,
14783
14783
  targetField: c,
14784
14784
  onChange: L.onChange,
14785
14785
  defaultValue: isVariable(U) ? "" : U,
@@ -14795,13 +14795,13 @@ const SchemaSettingsDefaultValue = function e(t) {
14795
14795
  }
14796
14796
  }),
14797
14797
  title: a("Default value"),
14798
- default: getFieldDefaultValue(n, A)
14798
+ default: getFieldDefaultValue(n, k)
14799
14799
  }
14800
14800
  }
14801
14801
  }), [
14802
- A,
14803
- n,
14804
14802
  k,
14803
+ n,
14804
+ A,
14805
14805
  S,
14806
14806
  m,
14807
14807
  E,
@@ -15283,8 +15283,8 @@ const InternalTableBlockProvider = (e) => {
15283
15283
  return useEffect(() => {
15284
15284
  var S, b, y;
15285
15285
  if (!i) {
15286
- const v = (S = o == null ? void 0 : o.service) == null ? void 0 : S.data, I = (v == null ? void 0 : v.data) || [], A = (v == null ? void 0 : v.meta) || {}, k = (y = (b = o == null ? void 0 : o.field) == null ? void 0 : b.data) == null ? void 0 : y.selectedRowKeys;
15287
- isEqual(e.value, I) || (e.value = I, e == null || e.setInitialValue(I)), e.data = e.data || {}, isEqual(e.data.selectedRowKeys, k) || (e.data.selectedRowKeys = k), e.componentProps.pagination = e.componentProps.pagination || {}, e.componentProps.pagination.pageSize = A == null ? void 0 : A.pageSize, e.componentProps.pagination.total = A == null ? void 0 : A.count, e.componentProps.pagination.current = A == null ? void 0 : A.page;
15286
+ const v = (S = o == null ? void 0 : o.service) == null ? void 0 : S.data, I = (v == null ? void 0 : v.data) || [], k = (v == null ? void 0 : v.meta) || {}, A = (y = (b = o == null ? void 0 : o.field) == null ? void 0 : b.data) == null ? void 0 : y.selectedRowKeys;
15287
+ isEqual(e.value, I) || (e.value = I, e == null || e.setInitialValue(I)), e.data = e.data || {}, isEqual(e.data.selectedRowKeys, A) || (e.data.selectedRowKeys = A), e.componentProps.pagination = e.componentProps.pagination || {}, e.componentProps.pagination.pageSize = k == null ? void 0 : k.pageSize, e.componentProps.pagination.total = k == null ? void 0 : k.count, e.componentProps.pagination.current = k == null ? void 0 : k.page;
15288
15288
  }
15289
15289
  }, [e, (m = o == null ? void 0 : o.service) == null ? void 0 : m.data, i, (x = (h = o == null ? void 0 : o.field) == null ? void 0 : h.data) == null ? void 0 : x.selectedRowKeys]), {
15290
15290
  bordered: o.bordered,
@@ -15310,21 +15310,21 @@ const InternalTableBlockProvider = (e) => {
15310
15310
  ),
15311
15311
  onChange: useCallback(
15312
15312
  ({ current: S, pageSize: b }, y, v) => {
15313
- var k, w, M;
15314
- const I = o.dragSort ? o.dragSortBy : v.order ? v.order === "ascend" ? [v.field] : [`-${v.field}`] : n || o.dragSortBy, A = b || ((M = (w = (k = t.parent) == null ? void 0 : k["x-decorator-props"]) == null ? void 0 : w.params) == null ? void 0 : M.pageSize);
15315
- o.service.run(F(g({}, a == null ? void 0 : a[0]), { page: S || 1, pageSize: A, sort: I }));
15313
+ var A, w, M;
15314
+ const I = o.dragSort ? o.dragSortBy : v.order ? v.order === "ascend" ? [v.field] : [`-${v.field}`] : n || o.dragSortBy, k = b || ((M = (w = (A = t.parent) == null ? void 0 : A["x-decorator-props"]) == null ? void 0 : w.params) == null ? void 0 : M.pageSize);
15315
+ o.service.run(F(g({}, a == null ? void 0 : a[0]), { page: S || 1, pageSize: k, sort: I }));
15316
15316
  },
15317
15317
  [n, a]
15318
15318
  ),
15319
15319
  onClickRow: useCallback(
15320
15320
  (S, b, y) => {
15321
- const { targets: v, uid: I } = findFilterTargets(t), A = r();
15322
- if (!v || !v.some((w) => A.some((M) => M.uid === w.uid))) {
15321
+ const { targets: v, uid: I } = findFilterTargets(t), k = r();
15322
+ if (!v || !v.some((w) => k.some((M) => M.uid === w.uid))) {
15323
15323
  b((w) => w.length ? [] : w);
15324
15324
  return;
15325
15325
  }
15326
- const k = [S[o.rowKey]];
15327
- A.forEach((w) => {
15326
+ const A = [S[o.rowKey]];
15327
+ k.forEach((w) => {
15328
15328
  var O, R, j;
15329
15329
  const M = v.find((B) => B.uid === w.uid);
15330
15330
  if (!M)
@@ -15339,7 +15339,7 @@ const InternalTableBlockProvider = (e) => {
15339
15339
  $and: [
15340
15340
  {
15341
15341
  [M.field || o.rowKey]: {
15342
- [M.field ? "$in" : "$eq"]: k
15342
+ [M.field ? "$in" : "$eq"]: A
15343
15343
  }
15344
15344
  }
15345
15345
  ]
@@ -15355,7 +15355,7 @@ const InternalTableBlockProvider = (e) => {
15355
15355
  }),
15356
15356
  { filters: E }
15357
15357
  );
15358
- }), b((w) => w != null && w.includes(S[o.rowKey]) ? [] : [...k]);
15358
+ }), b((w) => w != null && w.includes(S[o.rowKey]) ? [] : [...A]);
15359
15359
  },
15360
15360
  [o.rowKey, t, r]
15361
15361
  ),
@@ -15659,8 +15659,8 @@ const useTableSelectorParams = () => useContext(TableSelectorParamsContext), Tab
15659
15659
  var a, l, c, u, d, p, m, h, x, f, C, S, b, y, v, I;
15660
15660
  const e = useField(), t = useTableSelectorContext(), o = useFieldSchema(), { getCollectionJoinField: n } = useCollectionManager_deprecated(), r = recursiveParent$1(o, "CollectionField"), i = n(r == null ? void 0 : r["x-collection-field"]);
15661
15661
  return useEffect(() => {
15662
- var k, w, M, N, E, z, O, R, j, B, T, D, $, q, L;
15663
- if (!((k = t == null ? void 0 : t.service) != null && k.loading)) {
15662
+ var A, w, M, N, E, z, O, R, j, B, T, D, $, q, L;
15663
+ if (!((A = t == null ? void 0 : t.service) != null && A.loading)) {
15664
15664
  const G = (M = (w = t == null ? void 0 : t.service) == null ? void 0 : w.data) == null ? void 0 : M.data.map((U) => _.omit(U, i == null ? void 0 : i.foreignKey));
15665
15665
  e.value = G, (N = e == null ? void 0 : e.setInitialValue) == null || N.call(e, G), e.data = e.data || {}, e.data.selectedRowKeys = (z = (E = t == null ? void 0 : t.field) == null ? void 0 : E.data) == null ? void 0 : z.selectedRowKeys, e.componentProps.pagination = e.componentProps.pagination || {}, e.componentProps.pagination.pageSize = (j = (R = (O = t == null ? void 0 : t.service) == null ? void 0 : O.data) == null ? void 0 : R.meta) == null ? void 0 : j.pageSize, e.componentProps.pagination.total = (D = (T = (B = t == null ? void 0 : t.service) == null ? void 0 : B.data) == null ? void 0 : T.meta) == null ? void 0 : D.count, e.componentProps.pagination.current = (L = (q = ($ = t == null ? void 0 : t.service) == null ? void 0 : $.data) == null ? void 0 : q.meta) == null ? void 0 : L.page;
15666
15666
  }
@@ -15679,21 +15679,21 @@ const useTableSelectorParams = () => useContext(TableSelectorParamsContext), Tab
15679
15679
  dragSort: !1,
15680
15680
  rowKey: t.rowKey || "id",
15681
15681
  pagination: ((I = o == null ? void 0 : o["x-component-props"]) == null ? void 0 : I.pagination) === !1 ? !1 : e.componentProps.pagination,
15682
- onRowSelectionChange(k, w) {
15682
+ onRowSelectionChange(A, w) {
15683
15683
  var M;
15684
- t.field.data = ((M = t == null ? void 0 : t.field) == null ? void 0 : M.data) || {}, t.field.data.selectedRowKeys = k;
15684
+ t.field.data = ((M = t == null ? void 0 : t.field) == null ? void 0 : M.data) || {}, t.field.data.selectedRowKeys = A;
15685
15685
  },
15686
15686
  onRowDragEnd(M) {
15687
- return V(this, arguments, function* ({ from: k, to: w }) {
15687
+ return V(this, arguments, function* ({ from: A, to: w }) {
15688
15688
  yield t.resource.move({
15689
- sourceId: k[t.rowKey || "id"],
15689
+ sourceId: A[t.rowKey || "id"],
15690
15690
  targetId: w[t.rowKey || "id"]
15691
15691
  }), t.service.refresh();
15692
15692
  });
15693
15693
  },
15694
- onChange({ current: k, pageSize: w }) {
15694
+ onChange({ current: A, pageSize: w }) {
15695
15695
  var M;
15696
- t.service.run(F(g({}, (M = t.service.params) == null ? void 0 : M[0]), { page: k, pageSize: w }));
15696
+ t.service.run(F(g({}, (M = t.service.params) == null ? void 0 : M[0]), { page: A, pageSize: w }));
15697
15697
  }
15698
15698
  };
15699
15699
  }, BlockSchemaComponentProvider = (e) => /* @__PURE__ */ jsx(
@@ -16202,8 +16202,8 @@ function useInheritsTableColumnInitializerFields() {
16202
16202
  find: findTableColumn,
16203
16203
  remove: removeTableColumn,
16204
16204
  schemaInitialize: (I) => {
16205
- var A;
16206
- (A = x == null ? void 0 : x.schemaInitialize) == null || A.call(x, I, {
16205
+ var k;
16206
+ (k = x == null ? void 0 : x.schemaInitialize) == null || k.call(x, I, {
16207
16207
  field: h,
16208
16208
  readPretty: !0,
16209
16209
  block: "Table",
@@ -16221,7 +16221,7 @@ const useFormItemInitializerFields = (e) => {
16221
16221
  var d;
16222
16222
  const { name: t, currentFields: o } = useCollection_deprecated(), { getInterface: n, getCollection: r } = useCollectionManager_deprecated(), i = useForm(), { readPretty: a = i.readPretty, block: l = "Form" } = e || {}, { fieldSchema: c } = useActionContext(), u = c == null ? void 0 : c["x-action"];
16223
16223
  return (d = o == null ? void 0 : o.filter((p) => (p == null ? void 0 : p.interface) && !(p != null && p.treeChildren))) == null ? void 0 : d.map((p) => {
16224
- var y, v, I, A;
16224
+ var y, v, I, k;
16225
16225
  const m = n(p.interface), h = r(p.target), x = (p == null ? void 0 : p.target) && ((y = r(p == null ? void 0 : p.target)) == null ? void 0 : y.template) === "file", f = h, C = (v = p == null ? void 0 : p.uiSchema["x-component-props"]) == null ? void 0 : v.fieldNames, S = {
16226
16226
  type: "string",
16227
16227
  name: p.name,
@@ -16242,12 +16242,12 @@ const useFormItemInitializerFields = (e) => {
16242
16242
  }, b = {
16243
16243
  type: "item",
16244
16244
  name: p.name,
16245
- title: ((A = p == null ? void 0 : p.uiSchema) == null ? void 0 : A.title) || p.name,
16245
+ title: ((k = p == null ? void 0 : p.uiSchema) == null ? void 0 : k.title) || p.name,
16246
16246
  Component: "CollectionFieldInitializer",
16247
16247
  remove: removeGridFormItem,
16248
- schemaInitialize: (k) => {
16248
+ schemaInitialize: (A) => {
16249
16249
  var w;
16250
- (w = m == null ? void 0 : m.schemaInitialize) == null || w.call(m, k, {
16250
+ (w = m == null ? void 0 : m.schemaInitialize) == null || w.call(m, A, {
16251
16251
  field: p,
16252
16252
  block: l,
16253
16253
  readPretty: a,
@@ -16257,8 +16257,8 @@ const useFormItemInitializerFields = (e) => {
16257
16257
  },
16258
16258
  schema: S
16259
16259
  };
16260
- return l == "Kanban" && (b.find = (k, w, M) => {
16261
- const N = findSchema(k, "x-component", l);
16260
+ return l == "Kanban" && (b.find = (A, w, M) => {
16261
+ const N = findSchema(A, "x-component", l);
16262
16262
  return findSchema(N, w, M);
16263
16263
  }), b;
16264
16264
  });
@@ -16269,7 +16269,7 @@ const useFormItemInitializerFields = (e) => {
16269
16269
  var h;
16270
16270
  return (m == null ? void 0 : m.interface) && ((h = n(m.interface)) == null ? void 0 : h.filterable);
16271
16271
  })) == null ? void 0 : p.map((m) => {
16272
- var S, b, y, v, I, A, k;
16272
+ var S, b, y, v, I, k, A;
16273
16273
  const h = n(m.interface), x = r(m.target);
16274
16274
  let f = {
16275
16275
  type: "string",
@@ -16299,9 +16299,9 @@ const useFormItemInitializerFields = (e) => {
16299
16299
  "x-collection-field": `${t}.${m.name}`,
16300
16300
  "x-component-props": (I = m.uiSchema) == null ? void 0 : I["x-component-props"]
16301
16301
  }), {
16302
- name: ((A = m == null ? void 0 : m.uiSchema) == null ? void 0 : A.title) || m.name,
16302
+ name: ((k = m == null ? void 0 : m.uiSchema) == null ? void 0 : k.title) || m.name,
16303
16303
  type: "item",
16304
- title: ((k = m == null ? void 0 : m.uiSchema) == null ? void 0 : k.title) || m.name,
16304
+ title: ((A = m == null ? void 0 : m.uiSchema) == null ? void 0 : A.title) || m.name,
16305
16305
  Component: "CollectionFieldInitializer",
16306
16306
  remove: removeGridFormItem,
16307
16307
  schemaInitialize: (w) => {
@@ -16325,8 +16325,8 @@ const useFormItemInitializerFields = (e) => {
16325
16325
  const h = r(m.target), x = (f = h == null ? void 0 : h.filter(
16326
16326
  (b) => (b == null ? void 0 : b.interface) && !["subTable"].includes(b == null ? void 0 : b.interface) && !b.treeChildren
16327
16327
  )) == null ? void 0 : f.map((b) => {
16328
- var A, k, w;
16329
- const y = n(b.interface), v = (m == null ? void 0 : m.target) && ((A = i(m == null ? void 0 : m.target)) == null ? void 0 : A.template) === "file", I = {
16328
+ var k, A, w;
16329
+ const y = n(b.interface), v = (m == null ? void 0 : m.target) && ((k = i(m == null ? void 0 : m.target)) == null ? void 0 : k.template) === "file", I = {
16330
16330
  type: "string",
16331
16331
  name: `${m.name}.${b.name}`,
16332
16332
  // 'x-designer': 'FormItem.Designer',
@@ -16345,7 +16345,7 @@ const useFormItemInitializerFields = (e) => {
16345
16345
  "x-collection-field": `${t}.${m.name}.${b.name}`
16346
16346
  };
16347
16347
  return {
16348
- name: ((k = b == null ? void 0 : b.uiSchema) == null ? void 0 : k.title) || b.name,
16348
+ name: ((A = b == null ? void 0 : b.uiSchema) == null ? void 0 : A.title) || b.name,
16349
16349
  type: "item",
16350
16350
  title: ((w = b == null ? void 0 : b.uiSchema) == null ? void 0 : w.title) || b.name,
16351
16351
  Component: "CollectionFieldInitializer",
@@ -16425,7 +16425,7 @@ const useFormItemInitializerFields = (e) => {
16425
16425
  const u = i(c, t), { readPretty: d = l.readPretty, block: p = "Form", component: m = "CollectionField" } = e || {}, h = r(c);
16426
16426
  return {
16427
16427
  [h == null ? void 0 : h.title]: (x = u == null ? void 0 : u.filter((f) => f == null ? void 0 : f.interface)) == null ? void 0 : x.map((f) => {
16428
- var y, v, I, A;
16428
+ var y, v, I, k;
16429
16429
  const C = o(f.interface), S = r(f.target), b = {
16430
16430
  type: "string",
16431
16431
  name: f.name,
@@ -16442,12 +16442,12 @@ const useFormItemInitializerFields = (e) => {
16442
16442
  return {
16443
16443
  name: ((I = f == null ? void 0 : f.uiSchema) == null ? void 0 : I.title) || f.name,
16444
16444
  type: "item",
16445
- title: ((A = f == null ? void 0 : f.uiSchema) == null ? void 0 : A.title) || f.name,
16445
+ title: ((k = f == null ? void 0 : f.uiSchema) == null ? void 0 : k.title) || f.name,
16446
16446
  Component: "CollectionFieldInitializer",
16447
16447
  remove: removeGridFormItem,
16448
- schemaInitialize: (k) => {
16448
+ schemaInitialize: (A) => {
16449
16449
  var w;
16450
- (w = C == null ? void 0 : C.schemaInitialize) == null || w.call(C, k, {
16450
+ (w = C == null ? void 0 : C.schemaInitialize) == null || w.call(C, A, {
16451
16451
  field: f,
16452
16452
  block: p,
16453
16453
  readPretty: d,
@@ -16492,9 +16492,9 @@ const useFormItemInitializerFields = (e) => {
16492
16492
  title: ((I = x == null ? void 0 : x.uiSchema) == null ? void 0 : I.title) || x.name,
16493
16493
  Component: "CollectionFieldInitializer",
16494
16494
  remove: removeGridFormItem,
16495
- schemaInitialize: (A) => {
16496
- var k;
16497
- (k = f == null ? void 0 : f.schemaInitialize) == null || k.call(f, A, {
16495
+ schemaInitialize: (k) => {
16496
+ var A;
16497
+ (A = f == null ? void 0 : f.schemaInitialize) == null || A.call(f, k, {
16498
16498
  field: x,
16499
16499
  block: p,
16500
16500
  readPretty: d,
@@ -16638,15 +16638,15 @@ const useFormItemInitializerFields = (e) => {
16638
16638
  filterDataSource: i
16639
16639
  });
16640
16640
  n && (b = b.filter((I) => I.key === x));
16641
- const { getTemplatesByCollection: y } = useSchemaTemplateManager(), v = useMemo(() => b.map(({ key: I, displayName: A, collections: k }) => ({
16641
+ const { getTemplatesByCollection: y } = useSchemaTemplateManager(), v = useMemo(() => b.map(({ key: I, displayName: k, collections: A }) => ({
16642
16642
  name: I,
16643
- label: A,
16643
+ label: k,
16644
16644
  type: "subMenu",
16645
16645
  children: [
16646
16646
  ...getChildren({
16647
16647
  name: e,
16648
16648
  association: S,
16649
- collections: k,
16649
+ collections: A,
16650
16650
  componentName: t,
16651
16651
  searchValue: "",
16652
16652
  dataSource: I,
@@ -16677,7 +16677,7 @@ const useFormItemInitializerFields = (e) => {
16677
16677
  hideChildrenIfSingleCollection: !0,
16678
16678
  items: v
16679
16679
  })
16680
- }, A = {
16680
+ }, k = {
16681
16681
  name: "associationRecords",
16682
16682
  Component: DataBlockInitializer,
16683
16683
  // 目的是使点击无效
@@ -16698,7 +16698,7 @@ const useFormItemInitializerFields = (e) => {
16698
16698
  }
16699
16699
  ]
16700
16700
  })
16701
- }, k = {
16701
+ }, A = {
16702
16702
  ReadPrettyFormItem: "Details"
16703
16703
  }, w = {
16704
16704
  name: "otherRecords",
@@ -16714,7 +16714,7 @@ const useFormItemInitializerFields = (e) => {
16714
16714
  onlyCurrentDataSource: !1,
16715
16715
  hideChildrenIfSingleCollection: !1,
16716
16716
  fromOthersInPopup: !0,
16717
- componentType: k[t] || t,
16717
+ componentType: A[t] || t,
16718
16718
  filter({ collection: z, associationField: O }) {
16719
16719
  return u ? u(z) : !0;
16720
16720
  },
@@ -16724,7 +16724,7 @@ const useFormItemInitializerFields = (e) => {
16724
16724
  })
16725
16725
  };
16726
16726
  let M;
16727
- const N = C.length ? A : null;
16727
+ const N = C.length ? k : null;
16728
16728
  if (v[0].children.length && C.length)
16729
16729
  l ? M = [I, N] : M = [I, N, w];
16730
16730
  else if (v[0].children.length)
@@ -17347,7 +17347,7 @@ const useStyles$h = createStyles(() => ({
17347
17347
  }, { render: C, exists: S } = useSchemaSettingsRender(
17348
17348
  t["x-settings"] || i,
17349
17349
  t["x-settings-props"]
17350
- ), b = useGridRowContext(), y = useGridContext(), v = useDataSourceManager(), I = v == null ? void 0 : v.getDataSources(), A = useDataSource(), k = (I == null ? void 0 : I.length) > 1 && A, w = ["FormItem", "ReadPrettyFormItem"].includes(r == null ? void 0 : r.componentName) ? `${r == null ? void 0 : r.name} ${m("(Fields only)")}` : r == null ? void 0 : r.name, M = useMemo(() => {
17350
+ ), b = useGridRowContext(), y = useGridContext(), v = useDataSourceManager(), I = v == null ? void 0 : v.getDataSources(), k = useDataSource(), A = (I == null ? void 0 : I.length) > 1 && k, w = ["FormItem", "ReadPrettyFormItem"].includes(r == null ? void 0 : r.componentName) ? `${r == null ? void 0 : r.name} ${m("(Fields only)")}` : r == null ? void 0 : r.name, M = useMemo(() => {
17351
17351
  var z;
17352
17352
  return {
17353
17353
  insertPosition: "afterEnd",
@@ -17364,7 +17364,7 @@ const useStyles$h = createStyles(() => ({
17364
17364
  }, [x, (N = b == null ? void 0 : b.cols) == null ? void 0 : N.length]);
17365
17365
  return d ? /* @__PURE__ */ jsx(SchemaToolbarProvider, F(g({}, a), { children: /* @__PURE__ */ jsxs("div", { className: cls("general-schema-designer", overrideAntdCSS), children: [
17366
17366
  n && /* @__PURE__ */ jsx("div", { className: cls("general-schema-designer-title", titleCss), children: /* @__PURE__ */ jsxs(Space$1, { size: 2, children: [
17367
- /* @__PURE__ */ jsx("span", { className: "title-tag", children: c && k ? `${h(k == null ? void 0 : k.displayName)} > ${h(n)}` : h(n) }),
17367
+ /* @__PURE__ */ jsx("span", { className: "title-tag", children: c && A ? `${h(A == null ? void 0 : A.displayName)} > ${h(n)}` : h(n) }),
17368
17368
  r && /* @__PURE__ */ jsxs("span", { className: "title-tag", children: [
17369
17369
  m("Reference template"),
17370
17370
  ": ",
@@ -17413,11 +17413,11 @@ const useStyles$h = createStyles(() => ({
17413
17413
  ), { render: v, exists: I } = useSchemaInitializerRender(
17414
17414
  n || t["x-initializer"],
17415
17415
  t["x-initializer-props"]
17416
- ), A = useGridRowContext(), k = useGridContext(), w = useMemo(() => {
17416
+ ), k = useGridRowContext(), A = useGridContext(), w = useMemo(() => {
17417
17417
  var R;
17418
17418
  return {
17419
17419
  insertPosition: "afterEnd",
17420
- wrap: ((R = A == null ? void 0 : A.cols) == null ? void 0 : R.length) === 1 ? gridRowColWrap : void 0,
17420
+ wrap: ((R = k == null ? void 0 : k.cols) == null ? void 0 : R.length) === 1 ? gridRowColWrap : void 0,
17421
17421
  Component: (j) => /* @__PURE__ */ jsx(
17422
17422
  PlusOutlined,
17423
17423
  F(g({}, j), {
@@ -17427,15 +17427,15 @@ const useStyles$h = createStyles(() => ({
17427
17427
  })
17428
17428
  )
17429
17429
  };
17430
- }, [m, (O = A == null ? void 0 : A.cols) == null ? void 0 : O.length]), M = useMemo(() => l === !1 ? null : /* @__PURE__ */ jsx(DragHandler, { children: /* @__PURE__ */ jsx(DragOutlined, { role: "button", "aria-label": m("drag-handler") }) }), [l, m]), N = useMemo(() => {
17430
+ }, [m, (O = k == null ? void 0 : k.cols) == null ? void 0 : O.length]), M = useMemo(() => l === !1 ? null : /* @__PURE__ */ jsx(DragHandler, { children: /* @__PURE__ */ jsx(DragOutlined, { role: "button", "aria-label": m("drag-handler") }) }), [l, m]), N = useMemo(() => {
17431
17431
  var R;
17432
17432
  if (n === !1)
17433
17433
  return null;
17434
17434
  if (I)
17435
17435
  return v(w);
17436
- if (k != null && k.InitializerComponent || k != null && k.renderSchemaInitializer)
17437
- return k != null && k.InitializerComponent ? /* @__PURE__ */ jsx(k.InitializerComponent, g({}, w)) : (R = k.renderSchemaInitializer) == null ? void 0 : R.call(k, w);
17438
- }, [k, n, w, I, v]), E = useMemo(() => r !== !1 && y ? b() : null, [y, b, r]), z = useRef(null);
17436
+ if (A != null && A.InitializerComponent || A != null && A.renderSchemaInitializer)
17437
+ return A != null && A.InitializerComponent ? /* @__PURE__ */ jsx(A.InitializerComponent, g({}, w)) : (R = A.renderSchemaInitializer) == null ? void 0 : R.call(A, w);
17438
+ }, [A, n, w, I, v]), E = useMemo(() => r !== !1 && y ? b() : null, [y, b, r]), z = useRef(null);
17439
17439
  return useEffect(() => {
17440
17440
  const R = z.current;
17441
17441
  let j = R == null ? void 0 : R.parentElement;
@@ -17824,13 +17824,13 @@ observer$1(
17824
17824
  onChange: (v) => {
17825
17825
  b(v);
17826
17826
  try {
17827
- r.query("fieldReaction.items.*.layout.dataId").forEach((A) => {
17828
- A.componentProps.service.resource === m && (A.componentProps.fieldNames.label = v, A.componentProps.targetField = t(
17827
+ r.query("fieldReaction.items.*.layout.dataId").forEach((k) => {
17828
+ k.componentProps.service.resource === m && (k.componentProps.fieldNames.label = v, k.componentProps.targetField = t(
17829
17829
  `${m}.${v || (h == null ? void 0 : h.titleField) || "id"}`
17830
17830
  ));
17831
17831
  });
17832
- } catch (A) {
17833
- console.error(A);
17832
+ } catch (k) {
17833
+ console.error(k);
17834
17834
  }
17835
17835
  u["x-data-templates"] = d;
17836
17836
  const I = {
@@ -17899,22 +17899,22 @@ const compatibleDataId = (e, t) => e == null ? void 0 : e.map((o) => {
17899
17899
  ),
17900
17900
  []
17901
17901
  ), f = (I) => {
17902
- var k;
17903
- const A = p(I);
17902
+ var A;
17903
+ const k = p(I);
17904
17904
  return m(
17905
- `${I}.${((k = x == null ? void 0 : x.config[I]) == null ? void 0 : k.titleField) || (A == null ? void 0 : A.titleField) || "id"}`
17905
+ `${I}.${((A = x == null ? void 0 : x.config[I]) == null ? void 0 : A.titleField) || (k == null ? void 0 : k.titleField) || "id"}`
17906
17906
  );
17907
17907
  }, C = (I) => {
17908
- var k, w;
17909
- const A = p(I);
17908
+ var A, w;
17909
+ const k = p(I);
17910
17910
  return {
17911
- label: getLabel(((w = (k = x.config) == null ? void 0 : k[I]) == null ? void 0 : w.titleField) || (A == null ? void 0 : A.titleField) || "id"),
17911
+ label: getLabel(((w = (A = x.config) == null ? void 0 : A[I]) == null ? void 0 : w.titleField) || (k == null ? void 0 : k.titleField) || "id"),
17912
17912
  value: "id"
17913
17913
  };
17914
- }, S = (I, A) => {
17914
+ }, S = (I, k) => {
17915
17915
  var w, M;
17916
- const k = (M = (w = x.config) == null ? void 0 : w[I]) == null ? void 0 : M.filter;
17917
- return _.isEmpty(k) ? {} : removeNullCondition(mergeFilter([k, getSelectedIdFilter(A)], "$or"));
17916
+ const A = (M = (w = x.config) == null ? void 0 : w[I]) == null ? void 0 : M.filter;
17917
+ return _.isEmpty(A) ? {} : removeNullCondition(mergeFilter([A, getSelectedIdFilter(k)], "$or"));
17918
17918
  }, b = useMemo(() => ({ ArrayCollapse: ArrayCollapse$1 }), []), y = useMemo(
17919
17919
  () => ({
17920
17920
  getEnableFieldTree: a,
@@ -18993,7 +18993,7 @@ const SchemaSettingsProvider = (e) => {
18993
18993
  const S = r && c(r), b = findGridSchema(m), y = yield FormDialog(
18994
18994
  a("Save as template"),
18995
18995
  () => {
18996
- const A = {
18996
+ const k = {
18997
18997
  FormItem: a("Form"),
18998
18998
  ReadPrettyFormItem: a("Details")
18999
18999
  };
@@ -19008,8 +19008,8 @@ const SchemaSettingsProvider = (e) => {
19008
19008
  title: a("Template name"),
19009
19009
  required: !0,
19010
19010
  default: S ? `${l((S == null ? void 0 : S.title) || (S == null ? void 0 : S.name))}_${a(
19011
- A[n] || n
19012
- )}` : a(A[n] || n),
19011
+ k[n] || n
19012
+ )}` : a(k[n] || n),
19013
19013
  "x-decorator": "FormItem",
19014
19014
  "x-component": "Input"
19015
19015
  }
@@ -19177,7 +19177,7 @@ const SchemaSettingsProvider = (e) => {
19177
19177
  )
19178
19178
  ] });
19179
19179
  }, SchemaSettingsActionModalItem = React.memo((e) => {
19180
- const E = e, { title: t, onSubmit: o, initialValues: n, beforeOpen: r, initialSchema: i, schema: a, modalTip: l, components: c, scope: u } = E, d = H(E, ["title", "onSubmit", "initialValues", "beforeOpen", "initialSchema", "schema", "modalTip", "components", "scope"]), [p, m] = useState(!1), [h, x] = useState(e.uid), { t: f } = useTranslation(), C = useFieldSchema(), S = useContext(SchemaSettingsContext), { dn: b } = useSchemaSettings(), y = useCompile(), v = useAPIClient(), I = useFormActiveFields(), A = useMemo(
19180
+ const E = e, { title: t, onSubmit: o, initialValues: n, beforeOpen: r, initialSchema: i, schema: a, modalTip: l, components: c, scope: u } = E, d = H(E, ["title", "onSubmit", "initialValues", "beforeOpen", "initialSchema", "schema", "modalTip", "components", "scope"]), [p, m] = useState(!1), [h, x] = useState(e.uid), { t: f } = useTranslation(), C = useFieldSchema(), S = useContext(SchemaSettingsContext), { dn: b } = useSchemaSettings(), y = useCompile(), v = useAPIClient(), I = useFormActiveFields(), k = useMemo(
19181
19181
  () => createForm({
19182
19182
  initialValues: cloneDeep$1(n),
19183
19183
  values: cloneDeep$1(n)
@@ -19185,13 +19185,13 @@ const SchemaSettingsProvider = (e) => {
19185
19185
  [n]
19186
19186
  );
19187
19187
  useEffect(() => {
19188
- A.setInitialValues(cloneDeep$1(n));
19188
+ k.setInitialValues(cloneDeep$1(n));
19189
19189
  }, [JSON.stringify(n || {})]);
19190
- const k = useCallback(() => {
19191
- m(!1), A.reset();
19192
- }, [A]), w = useCallback(() => V(void 0, null, function* () {
19193
- yield A.submit(), o == null || o(cloneDeep$1(A.values)), m(!1);
19194
- }), [A, o]), M = useCallback(() => V(void 0, null, function* () {
19190
+ const A = useCallback(() => {
19191
+ m(!1), k.reset();
19192
+ }, [k]), w = useCallback(() => V(void 0, null, function* () {
19193
+ yield k.submit(), o == null || o(cloneDeep$1(k.values)), m(!1);
19194
+ }), [k, o]), M = useCallback(() => V(void 0, null, function* () {
19195
19195
  !h && (i != null && i["x-uid"]) && (C["x-action-settings"].schemaUid = i["x-uid"], b.emit("patch", { schema: C }), yield v.resource("uiSchemas").insert({ values: i }), x(i["x-uid"])), typeof r == "function" && (r == null || r()), S.setVisible(!1), m(!0);
19196
19196
  }), [v, S, b, C, i, h]), N = useCallback((z) => z.stopPropagation(), []);
19197
19197
  return /* @__PURE__ */ jsxs(Fragment, { children: [
@@ -19214,12 +19214,12 @@ const SchemaSettingsProvider = (e) => {
19214
19214
  }, d), {
19215
19215
  destroyOnClose: !0,
19216
19216
  open: p,
19217
- onCancel: k,
19217
+ onCancel: A,
19218
19218
  footer: /* @__PURE__ */ jsxs(Space$1, { children: [
19219
- /* @__PURE__ */ jsx(Button, { onClick: k, children: f("Cancel") }),
19219
+ /* @__PURE__ */ jsx(Button, { onClick: A, children: f("Cancel") }),
19220
19220
  /* @__PURE__ */ jsx(Button, { type: "primary", onClick: w, children: f("Submit") })
19221
19221
  ] }),
19222
- children: /* @__PURE__ */ jsx(FormActiveFieldsProvider, { name: "form", getActiveFieldsName: I == null ? void 0 : I.getActiveFieldsName, children: /* @__PURE__ */ jsx(FormProvider, { form: A, children: /* @__PURE__ */ jsxs(FormLayout, { layout: "vertical", children: [
19222
+ children: /* @__PURE__ */ jsx(FormActiveFieldsProvider, { name: "form", getActiveFieldsName: I == null ? void 0 : I.getActiveFieldsName, children: /* @__PURE__ */ jsx(FormProvider, { form: k, children: /* @__PURE__ */ jsxs(FormLayout, { layout: "vertical", children: [
19223
19223
  l && /* @__PURE__ */ jsx(Alert, { message: l }),
19224
19224
  l && /* @__PURE__ */ jsx("br", {}),
19225
19225
  p && h && /* @__PURE__ */ jsx(RemoteSchemaComponent, { noForm: !0, components: c, scope: u, uid: h }),
@@ -19255,7 +19255,7 @@ const SchemaSettingsModalItem = (e) => {
19255
19255
  "initialValues",
19256
19256
  "width",
19257
19257
  "noRecord"
19258
- ]), m = useContext(SchemaOptionsContext), h = useCollection_deprecated(), x = useAPIClient(), f = useApp(), { theme: C } = useGlobalTheme(), S = useBlockRequestContext(), b = useFormActiveFields(), { locale: y } = useContext(ConfigProvider.ConfigContext), v = useDataSourceManager(), I = useDataSourceKey(), A = useCollectionRecord(), { association: k } = useDataBlockProps() || {}, w = useFormBlockContext(), M = useBlockContext(), { getOperators: N } = useOperators(), { formValue: E, collection: z } = useSubFormValue(), O = useCurrentPopupRecord(), R = useParentPopupRecord();
19258
+ ]), m = useContext(SchemaOptionsContext), h = useCollection_deprecated(), x = useAPIClient(), f = useApp(), { theme: C } = useGlobalTheme(), S = useBlockRequestContext(), b = useFormActiveFields(), { locale: y } = useContext(ConfigProvider.ConfigContext), v = useDataSourceManager(), I = useDataSourceKey(), k = useCollectionRecord(), { association: A } = useDataBlockProps() || {}, w = useFormBlockContext(), M = useBlockContext(), { getOperators: N } = useOperators(), { formValue: E, collection: z } = useSubFormValue(), O = useCurrentPopupRecord(), R = useParentPopupRecord();
19259
19259
  return t ? null : /* @__PURE__ */ jsx(
19260
19260
  SchemaSettingsItem,
19261
19261
  F(g({
@@ -19274,7 +19274,7 @@ const SchemaSettingsModalItem = (e) => {
19274
19274
  recordData: R == null ? void 0 : R.value,
19275
19275
  collection: R == null ? void 0 : R.collection
19276
19276
  },
19277
- children: /* @__PURE__ */ jsx(CollectionRecordProvider, { record: d ? null : A, children: /* @__PURE__ */ jsx(FormBlockContext$1.Provider, { value: w, children: /* @__PURE__ */ jsx(SubFormProvider, { value: { value: E, collection: z }, children: /* @__PURE__ */ jsx(
19277
+ children: /* @__PURE__ */ jsx(CollectionRecordProvider, { record: d ? null : k, children: /* @__PURE__ */ jsx(FormBlockContext$1.Provider, { value: w, children: /* @__PURE__ */ jsx(SubFormProvider, { value: { value: E, collection: z }, children: /* @__PURE__ */ jsx(
19278
19278
  FormActiveFieldsProvider,
19279
19279
  {
19280
19280
  name: "form",
@@ -19284,7 +19284,7 @@ const SchemaSettingsModalItem = (e) => {
19284
19284
  {
19285
19285
  allowNull: !0,
19286
19286
  collection: h.name,
19287
- association: k,
19287
+ association: A,
19288
19288
  children: /* @__PURE__ */ jsx(SchemaComponentOptions, { scope: m.scope, components: m.components, children: /* @__PURE__ */ jsx(
19289
19289
  FormLayout,
19290
19290
  {
@@ -19448,8 +19448,8 @@ const SchemaSettingsModalItem = (e) => {
19448
19448
  const I = [];
19449
19449
  for (const N of v.fieldReaction.rules)
19450
19450
  I.push(_.pickBy(N, _.identity));
19451
- const A = x["x-component"] === "BlockTemplate" && ((M = x["x-component-props"]) == null ? void 0 : M.templateId), w = {
19452
- "x-uid": A && c(A).uid || x["x-uid"]
19451
+ const k = x["x-component"] === "BlockTemplate" && ((M = x["x-component-props"]) == null ? void 0 : M.templateId), w = {
19452
+ "x-uid": k && c(k).uid || x["x-uid"]
19453
19453
  };
19454
19454
  x["x-linkage-rules"] = I, w["x-linkage-rules"] = I, a.emit("patch", {
19455
19455
  schema: w
@@ -19983,10 +19983,10 @@ const SchemaSettingsWrapper = (e) => {
19983
19983
  "x-uid": o["x-uid"]
19984
19984
  };
19985
19985
  I["x-component-props"] = o["x-component-props"] || {}, o["x-component-props"] = g(g({}, o["x-component-props"] || {}), v), I["x-component-props"] = o["x-component-props"], n.componentProps = o["x-component-props"];
19986
- const A = n.path.entire.split(".");
19987
- A.pop();
19988
- const k = A.join(".");
19989
- n.query(`${k}.*[0:].${o.name}`).forEach((w) => {
19986
+ const k = n.path.entire.split(".");
19987
+ k.pop();
19988
+ const A = k.join(".");
19989
+ n.query(`${A}.*[0:].${o.name}`).forEach((w) => {
19990
19990
  w.props.name === o.name && w.setComponentProps(g({}, v));
19991
19991
  }), r.emit("patch", {
19992
19992
  schema: I
@@ -21154,8 +21154,8 @@ function WorkflowSelect(r) {
21154
21154
  if (b.value) {
21155
21155
  const v = b.value.split(".");
21156
21156
  for (let I = 0; I < v.length && y; I++) {
21157
- const A = v[I], k = y.fields.find((w) => w.name === A);
21158
- k && (y = d(k.target, p));
21157
+ const k = v[I], A = y.fields.find((w) => w.name === k);
21158
+ A && (y = d(A.target, p));
21159
21159
  }
21160
21160
  }
21161
21161
  h(joinCollectionName(p, y.name)), c(`group[${l}].workflowKey`, null);
@@ -21710,7 +21710,7 @@ const ActionLink = withDynamicSchemaProps(
21710
21710
  "addChild",
21711
21711
  "onMouseEnter",
21712
21712
  "refreshDataBlockRequest"
21713
- ]), v = useACLActionParamsContext(), { wrapSSR: I, componentCls: A, hashId: k } = useStyles$d(), { t: w } = useTranslation(), [M, N] = useState(!1), [E, z] = useState(!1), O = useDesigner(), R = useField(), { run: j, element: B, disabled: T } = a(f), D = useFieldSchema(), $ = useCompile(), q = useForm(), L = useCollectionRecordData(), G = useCollectionParentRecordData(), U = D["x-toolbar-props"] || D["x-designer-props"], K = (me = D == null ? void 0 : D["x-component-props"]) == null ? void 0 : me.openMode, Y = (he = D == null ? void 0 : D["x-component-props"]) == null ? void 0 : he.openSize, W = (ge = D == null ? void 0 : D["x-component-props"]) == null ? void 0 : ge.refreshDataBlockRequest, X = q.disabled || R.disabled || ((xe = R.data) == null ? void 0 : xe.disabled) || x || T, Q = useMemo(() => (D == null ? void 0 : D["x-linkage-rules"]) || [], [D == null ? void 0 : D["x-linkage-rules"]]), { designable: J } = useDesignable(), oe = useComponent(i) || i, { modal: re } = App.useApp(), te = useVariables(), se = useLocalVariables({ currentForm: { values: L } }), { getAriaLabel: ae } = useGetAriaLabelOfAction(u), ce = useDataBlockRequest(), ue = useMemo(() => {
21713
+ ]), v = useACLActionParamsContext(), { wrapSSR: I, componentCls: k, hashId: A } = useStyles$d(), { t: w } = useTranslation(), [M, N] = useState(!1), [E, z] = useState(!1), O = useDesigner(), R = useField(), { run: j, element: B, disabled: T } = a(f), D = useFieldSchema(), $ = useCompile(), q = useForm(), L = useCollectionRecordData(), G = useCollectionParentRecordData(), U = D["x-toolbar-props"] || D["x-designer-props"], K = (me = D == null ? void 0 : D["x-component-props"]) == null ? void 0 : me.openMode, Y = (he = D == null ? void 0 : D["x-component-props"]) == null ? void 0 : he.openSize, W = (ge = D == null ? void 0 : D["x-component-props"]) == null ? void 0 : ge.refreshDataBlockRequest, X = q.disabled || R.disabled || ((xe = R.data) == null ? void 0 : xe.disabled) || x || T, Q = useMemo(() => (D == null ? void 0 : D["x-linkage-rules"]) || [], [D == null ? void 0 : D["x-linkage-rules"]]), { designable: J } = useDesignable(), oe = useComponent(i) || i, { modal: re } = App.useApp(), te = useVariables(), se = useLocalVariables({ currentForm: { values: L } }), { getAriaLabel: ae } = useGetAriaLabelOfAction(u), ce = useDataBlockRequest(), ue = useMemo(() => {
21714
21714
  const Z = u || $(D.title);
21715
21715
  return _.isString(Z) ? w(Z) : Z;
21716
21716
  }, [u, D.title, w]);
@@ -21748,9 +21748,10 @@ const ActionLink = withDynamicSchemaProps(
21748
21748
  ), Ie = useMemo(() => {
21749
21749
  var Z;
21750
21750
  return F(g({}, p), {
21751
- opacity: J && (((Z = R == null ? void 0 : R.data) == null ? void 0 : Z.hidden) || !v) && 0.1
21751
+ opacity: J && (((Z = R == null ? void 0 : R.data) == null ? void 0 : Z.hidden) || !v) && 0.1,
21752
+ color: X ? "rgba(0, 0, 0, 0.25)" : null
21752
21753
  });
21753
- }, [J, (ee = R == null ? void 0 : R.data) == null ? void 0 : ee.hidden, p]), Se = useCallback(
21754
+ }, [J, (ee = R == null ? void 0 : R.data) == null ? void 0 : ee.hidden, p, X]), Se = useCallback(
21754
21755
  (Z) => {
21755
21756
  S == null || S(Z);
21756
21757
  },
@@ -21770,7 +21771,7 @@ const ActionLink = withDynamicSchemaProps(
21770
21771
  style: Ie,
21771
21772
  onClick: Pe,
21772
21773
  component: oe || Button,
21773
- className: cls(A, k, l, "nb-action"),
21774
+ className: cls(k, A, l, "nb-action"),
21774
21775
  type: e.type === "danger" ? void 0 : e.type,
21775
21776
  children: [
21776
21777
  ue,
@@ -22459,10 +22460,10 @@ const useGetFilterOptions = () => {
22459
22460
  var N, E, z, O, R, j, B, T, D, $, q, L;
22460
22461
  const { uiSchema: t, fieldSchema: o, collectionField: n } = e, { form: r } = useFormBlockContext(), { getInterface: i, getCollection: a } = useCollectionManager_deprecated(), l = useField(), { t: c } = useTranslation(), u = useFieldSchema(), { dn: d } = useDesignable(), p = ((N = o == null ? void 0 : o["x-component-props"]) == null ? void 0 : N.fieldNames) || ((E = t == null ? void 0 : t["x-component-props"]) == null ? void 0 : E.fieldNames), m = useLabelFields$1((z = n == null ? void 0 : n.target) != null ? z : n == null ? void 0 : n.targetCollection), h = useColorFields((O = n == null ? void 0 : n.target) != null ? O : n == null ? void 0 : n.targetCollection), x = i(n == null ? void 0 : n.interface), f = a(n == null ? void 0 : n.target), C = isFileCollection$1(f), S = ["QuickEdit", "FormItem"].includes(o["x-decorator"]), { currentMode: b } = useAssociationFieldContext(), { isAllowToSetDefaultValue: y } = useIsAllowToSetDefaultValue({ collectionField: n, fieldSchema: o }), v = ["datetime", "createdAt", "updatedAt"].includes(n == null ? void 0 : n.interface), I = ["obo", "oho", "o2o", "o2m", "m2m", "m2o", "snapshot"].includes(
22461
22462
  n == null ? void 0 : n.interface
22462
- ), A = useFieldModeOptions({ fieldSchema: o }), k = ((R = o == null ? void 0 : o["x-component-props"]) == null ? void 0 : R.mode) || "Select";
22463
+ ), k = useFieldModeOptions({ fieldSchema: o }), A = ((R = o == null ? void 0 : o["x-component-props"]) == null ? void 0 : R.mode) || "Select";
22463
22464
  let w = "editable";
22464
22465
  o["x-disabled"] === !0 && (w = "readonly"), o["x-read-pretty"] === !0 && (w = "read-pretty");
22465
- const M = I && k === "Select";
22466
+ const M = I && A === "Select";
22466
22467
  return /* @__PURE__ */ jsxs(GeneralSchemaDesigner, { disableInitializer: !0, children: [
22467
22468
  /* @__PURE__ */ jsx(
22468
22469
  SchemaSettingsModalItem,
@@ -22611,8 +22612,8 @@ const useGetFilterOptions = () => {
22611
22612
  { label: c("Title"), value: "Select" },
22612
22613
  C && { label: c("File manager"), value: "FileManager" },
22613
22614
  { label: c("Tag"), value: "Tag" }
22614
- ].filter(Boolean) : A,
22615
- value: k,
22615
+ ].filter(Boolean) : k,
22616
+ value: A,
22616
22617
  onChange: (G) => {
22617
22618
  const U = {
22618
22619
  "x-uid": o["x-uid"]
@@ -22624,7 +22625,7 @@ const useGetFilterOptions = () => {
22624
22625
  },
22625
22626
  "field-mode"
22626
22627
  ),
22627
- ["Tag"].includes(k) && /* @__PURE__ */ jsx(
22628
+ ["Tag"].includes(A) && /* @__PURE__ */ jsx(
22628
22629
  SchemaSettingsSelectItem,
22629
22630
  {
22630
22631
  title: c("Tag color field"),
@@ -23675,7 +23676,7 @@ function getFormValues({
23675
23676
  function useCollectValuesToSubmit() {
23676
23677
  const e = useForm(), t = useFilterByTk(), { field: o, resource: n } = useBlockRequestContext(), { fields: r, getField: i, getTreeParentField: a, name: l } = useCollection_deprecated(), c = r.map((f) => f.name), { fieldSchema: u } = useActionContext(), { getActiveFieldsName: d } = useFormActiveFields() || {}, p = useVariables(), m = useLocalVariables({ currentForm: e }), h = useFieldSchema(), x = useTreeParentRecord();
23677
23678
  return useCallback(() => V(this, null, function* () {
23678
- var I, A, k, w;
23679
+ var I, k, A, w;
23679
23680
  const { assignedValues: f = {}, overwriteValues: C } = (I = h == null ? void 0 : h["x-action-settings"]) != null ? I : {}, S = getFormValues({
23680
23681
  filterByTk: t,
23681
23682
  field: o,
@@ -23692,9 +23693,9 @@ function useCollectValuesToSubmit() {
23692
23693
  } else
23693
23694
  N != null && N !== "" && (b[M] = N);
23694
23695
  }));
23695
- if (yield Promise.all(y), (A = u == null ? void 0 : u["x-component-props"]) == null ? void 0 : A.addChild) {
23696
+ if (yield Promise.all(y), (k = u == null ? void 0 : u["x-component-props"]) == null ? void 0 : k.addChild) {
23696
23697
  const M = a();
23697
- S[(k = M == null ? void 0 : M.name) != null ? k : "parent"] = x, S[(w = M == null ? void 0 : M.foreignKey) != null ? w : "parentId"] = x == null ? void 0 : x.id;
23698
+ S[(A = M == null ? void 0 : M.name) != null ? A : "parent"] = x, S[(w = M == null ? void 0 : M.foreignKey) != null ? w : "parentId"] = x == null ? void 0 : x.id;
23698
23699
  }
23699
23700
  return g(g(g({}, S), C), b);
23700
23701
  }), [
@@ -23721,17 +23722,17 @@ const useCreateActionProps = () => {
23721
23722
  onClick() {
23722
23723
  return V(this, null, function* () {
23723
23724
  var w;
23724
- const { onSuccess: v, skipValidator: I, triggerWorkflows: A } = (w = u == null ? void 0 : u["x-action-settings"]) != null ? w : {};
23725
+ const { onSuccess: v, skipValidator: I, triggerWorkflows: k } = (w = u == null ? void 0 : u["x-action-settings"]) != null ? w : {};
23725
23726
  I || (yield o.submit());
23726
- const k = yield f();
23727
+ const A = yield f();
23727
23728
  d.data = n.data || {}, d.data.loading = !0;
23728
23729
  try {
23729
23730
  const M = yield r[C]({
23730
- values: k,
23731
+ values: A,
23731
23732
  filterKeys: S,
23732
23733
  filterByTk: e,
23733
23734
  // TODO(refactor): should change to inject by plugin
23734
- triggerWorkflows: A != null && A.length ? A.map((N) => [N.workflowKey, N.context].filter(Boolean).join("!")).join(",") : void 0,
23735
+ triggerWorkflows: k != null && k.length ? k.map((N) => [N.workflowKey, N.context].filter(Boolean).join("!")).join(",") : void 0,
23735
23736
  updateAssociationValues: x
23736
23737
  });
23737
23738
  if (i == null || i(!1), a == null || a(!0), l == null || l(!1), d.data.loading = !1, d.data.data = M, !(v != null && v.successMessage)) {
@@ -23757,7 +23758,7 @@ const useCreateActionProps = () => {
23757
23758
  onClick() {
23758
23759
  return V(this, null, function* () {
23759
23760
  var T, D, $, q, L, G;
23760
- const k = u.map((U) => U.name), {
23761
+ const A = u.map((U) => U.name), {
23761
23762
  assignedValues: w = {},
23762
23763
  onSuccess: M,
23763
23764
  overwriteValues: N,
@@ -23776,7 +23777,7 @@ const useCreateActionProps = () => {
23776
23777
  filterByTk: x,
23777
23778
  field: t,
23778
23779
  form: e,
23779
- fieldNames: k,
23780
+ fieldNames: A,
23780
23781
  getField: d,
23781
23782
  resource: o,
23782
23783
  actionFields: (b == null ? void 0 : b("form")) || []
@@ -23898,13 +23899,13 @@ const useCreateActionProps = () => {
23898
23899
  return {
23899
23900
  onClick(x, f) {
23900
23901
  return V(this, null, function* () {
23901
- var A, k, w;
23902
+ var k, A, w;
23902
23903
  const {
23903
23904
  assignedValues: C = {},
23904
23905
  onSuccess: S,
23905
23906
  skipValidator: b,
23906
23907
  triggerWorkflows: y
23907
- } = (A = r == null ? void 0 : r["x-action-settings"]) != null ? A : {}, v = {}, I = Object.keys(C).map((M) => V(this, null, function* () {
23908
+ } = (k = r == null ? void 0 : r["x-action-settings"]) != null ? k : {}, v = {}, I = Object.keys(C).map((M) => V(this, null, function* () {
23908
23909
  const N = C[M], E = m(M);
23909
23910
  if (isVariable(N)) {
23910
23911
  const z = yield u == null ? void 0 : u.parseVariable(N, d);
@@ -23917,7 +23918,7 @@ const useCreateActionProps = () => {
23917
23918
  values: g({}, v),
23918
23919
  // TODO(refactor): should change to inject by plugin
23919
23920
  triggerWorkflows: y != null && y.length ? y.map((M) => [M.workflowKey, M.context].filter(Boolean).join("!")).join(",") : void 0
23920
- }), f && (f == null || f()), e instanceof TableFieldResource || (w = (k = t == null ? void 0 : t.service) == null ? void 0 : k.refresh) == null || w.call(k), S != null && S.successMessage && (S != null && S.manualClose ? c.success({
23921
+ }), f && (f == null || f()), e instanceof TableFieldResource || (w = (A = t == null ? void 0 : t.service) == null ? void 0 : A.refresh) == null || w.call(A), S != null && S.successMessage && (S != null && S.manualClose ? c.success({
23921
23922
  title: a(S == null ? void 0 : S.successMessage),
23922
23923
  onOk: () => V(this, null, function* () {
23923
23924
  S != null && S.redirecting && (S != null && S.redirectTo) && (isURL(S.redirectTo) ? window.location.href = S.redirectTo : i(S.redirectTo));
@@ -23936,13 +23937,13 @@ const useCreateActionProps = () => {
23936
23937
  return V(this, null, function* () {
23937
23938
  var z;
23938
23939
  const {
23939
- assignedValues: k = {},
23940
+ assignedValues: A = {},
23940
23941
  onSuccess: w,
23941
23942
  updateMode: M
23942
23943
  } = (z = i == null ? void 0 : i["x-action-settings"]) != null ? z : {};
23943
23944
  m.data = e.data || {}, m.data.loading = !0;
23944
- const N = {}, E = Object.keys(k).map((R) => V(this, null, function* () {
23945
- const j = k[R], B = C(R);
23945
+ const N = {}, E = Object.keys(A).map((R) => V(this, null, function* () {
23946
+ const j = A[R], B = C(R);
23946
23947
  if (isVariable(j)) {
23947
23948
  const T = yield x == null ? void 0 : x.parseVariable(j, S);
23948
23949
  T && (N[R] = transformVariableValue(T, { targetCollectionField: B }));
@@ -23998,12 +23999,12 @@ const useCreateActionProps = () => {
23998
23999
  onClick() {
23999
24000
  return V(this, null, function* () {
24000
24001
  var R, j, B, T;
24001
- const { skipValidator: I, onSuccess: A, requestSettings: k } = (R = n == null ? void 0 : n["x-action-settings"]) != null ? R : {}, w = n == null ? void 0 : n["x-action"];
24002
- if (!k.url)
24002
+ const { skipValidator: I, onSuccess: k, requestSettings: A } = (R = n == null ? void 0 : n["x-action-settings"]) != null ? R : {}, w = n == null ? void 0 : n["x-action"];
24003
+ if (!A.url)
24003
24004
  return;
24004
24005
  I !== !0 && w === "customize:form:request" && (yield i.submit());
24005
- const M = k.headers ? JSON.parse(k.headers) : {}, N = k.params ? JSON.parse(k.params) : {}, E = k.data ? JSON.parse(k.data) : {};
24006
- if (w === "customize:form:request" && ["POST", "PUT", "PATCH"].includes(k.method)) {
24006
+ const M = A.headers ? JSON.parse(A.headers) : {}, N = A.params ? JSON.parse(A.params) : {}, E = A.data ? JSON.parse(A.data) : {};
24007
+ if (w === "customize:form:request" && ["POST", "PUT", "PATCH"].includes(A.method)) {
24007
24008
  const D = a.map((q) => q.name), $ = getFormValues({
24008
24009
  filterByTk: o,
24009
24010
  field: c,
@@ -24016,22 +24017,22 @@ const useCreateActionProps = () => {
24016
24017
  Object.assign(E, $);
24017
24018
  }
24018
24019
  const O = {
24019
- url: renderTemplate(k.url, { currentRecord: m, currentUser: x }),
24020
- method: k.method,
24020
+ url: renderTemplate(A.url, { currentRecord: m, currentUser: x }),
24021
+ method: A.method,
24021
24022
  headers: parse(M)({ currentRecord: m, currentUser: x }),
24022
24023
  params: parse(N)({ currentRecord: m, currentUser: x }),
24023
24024
  data: parse(E)({ currentRecord: m, currentUser: x })
24024
24025
  };
24025
24026
  f.data = c.data || {}, f.data.loading = !0;
24026
24027
  try {
24027
- if (yield e.request(g({}, O)), f.data.loading = !1, u instanceof TableFieldResource || (B = (j = d == null ? void 0 : d.service) == null ? void 0 : j.refresh) == null || B.call(j), (T = p == null ? void 0 : p.refresh) == null || T.call(p), w === "customize:form:request" && (C == null || C(!1)), !(A != null && A.successMessage))
24028
+ if (yield e.request(g({}, O)), f.data.loading = !1, u instanceof TableFieldResource || (B = (j = d == null ? void 0 : d.service) == null ? void 0 : j.refresh) == null || B.call(j), (T = p == null ? void 0 : p.refresh) == null || T.call(p), w === "customize:form:request" && (C == null || C(!1)), !(k != null && k.successMessage))
24028
24029
  return;
24029
- A != null && A.manualClose ? S.success({
24030
- title: r(A == null ? void 0 : A.successMessage),
24030
+ k != null && k.manualClose ? S.success({
24031
+ title: r(k == null ? void 0 : k.successMessage),
24031
24032
  onOk: () => V(this, null, function* () {
24032
- A != null && A.redirecting && (A != null && A.redirectTo) && (isURL(A.redirectTo) ? window.location.href = A.redirectTo : t(A.redirectTo));
24033
+ k != null && k.redirecting && (k != null && k.redirectTo) && (isURL(k.redirectTo) ? window.location.href = k.redirectTo : t(k.redirectTo));
24033
24034
  })
24034
- }) : message.success(r(A == null ? void 0 : A.successMessage));
24035
+ }) : message.success(r(k == null ? void 0 : k.successMessage));
24035
24036
  } finally {
24036
24037
  f.data.loading = !1;
24037
24038
  }
@@ -24045,13 +24046,13 @@ const useCreateActionProps = () => {
24045
24046
  return V(this, null, function* () {
24046
24047
  var j;
24047
24048
  const {
24048
- assignedValues: A = {},
24049
- onSuccess: k,
24049
+ assignedValues: k = {},
24050
+ onSuccess: A,
24050
24051
  overwriteValues: w,
24051
24052
  skipValidator: M,
24052
24053
  triggerWorkflows: N
24053
- } = (j = c == null ? void 0 : c["x-action-settings"]) != null ? j : {}, E = {}, z = Object.keys(A).map((B) => V(this, null, function* () {
24054
- const T = A[B], D = p(B);
24054
+ } = (j = c == null ? void 0 : c["x-action-settings"]) != null ? j : {}, E = {}, z = Object.keys(k).map((B) => V(this, null, function* () {
24055
+ const T = k[B], D = p(B);
24055
24056
  if (isVariable(T)) {
24056
24057
  const $ = yield b == null ? void 0 : b.parseVariable(T, y);
24057
24058
  $ && (E[B] = transformVariableValue($, { targetCollectionField: D }));
@@ -24077,14 +24078,14 @@ const useCreateActionProps = () => {
24077
24078
  updateAssociationValues: f,
24078
24079
  // TODO(refactor): should change to inject by plugin
24079
24080
  triggerWorkflows: N != null && N.length ? N.map((B) => [B.workflowKey, B.context].filter(Boolean).join("!")).join(",") : void 0
24080
- })), x.data.loading = !1, i == null || i(!1), a == null || a(!0), l == null || l(!1), !(k != null && k.successMessage))
24081
+ })), x.data.loading = !1, i == null || i(!1), a == null || a(!0), l == null || l(!1), !(A != null && A.successMessage))
24081
24082
  return;
24082
- k != null && k.manualClose ? C.success({
24083
- title: h(k == null ? void 0 : k.successMessage),
24083
+ A != null && A.manualClose ? C.success({
24084
+ title: h(A == null ? void 0 : A.successMessage),
24084
24085
  onOk: () => V(this, null, function* () {
24085
- yield e.reset(), k != null && k.redirecting && (k != null && k.redirectTo) && (isURL(k.redirectTo) ? window.location.href = k.redirectTo : u(k.redirectTo));
24086
+ yield e.reset(), A != null && A.redirecting && (A != null && A.redirectTo) && (isURL(A.redirectTo) ? window.location.href = A.redirectTo : u(A.redirectTo));
24086
24087
  })
24087
- }) : (message.success(h(k == null ? void 0 : k.successMessage)), k != null && k.redirecting && (k != null && k.redirectTo) && (isURL(k.redirectTo) ? window.location.href = k.redirectTo : u(k.redirectTo)));
24088
+ }) : (message.success(h(A == null ? void 0 : A.successMessage)), A != null && A.redirecting && (A != null && A.redirectTo) && (isURL(A.redirectTo) ? window.location.href = A.redirectTo : u(A.redirectTo)));
24088
24089
  } catch (B) {
24089
24090
  x.data.loading = !1;
24090
24091
  }
@@ -24226,17 +24227,17 @@ const useCreateActionProps = () => {
24226
24227
  /** 渲染 Collapse 的列表数据 */
24227
24228
  list: (d == null ? void 0 : d.data) || [],
24228
24229
  onSelected: (I) => {
24229
- var k, w, M, N;
24230
- const A = ((w = (k = t.params) == null ? void 0 : k[1]) == null ? void 0 : w.filters) || {};
24231
- I.length ? A[`af.${c}`] = {
24230
+ var A, w, M, N;
24231
+ const k = ((w = (A = t.params) == null ? void 0 : A[1]) == null ? void 0 : w.filters) || {};
24232
+ I.length ? k[`af.${c}`] = {
24232
24233
  [`${c}.${i}.$in`]: I
24233
- } : delete A[`af.${c}`], t.run(
24234
+ } : delete k[`af.${c}`], t.run(
24234
24235
  F(g({}, (M = t.params) == null ? void 0 : M[0]), {
24235
24236
  pageSize: 200,
24236
24237
  page: 1,
24237
- filter: mergeFilter([...Object.values(A), (N = o == null ? void 0 : o.params) == null ? void 0 : N.filter])
24238
+ filter: mergeFilter([...Object.values(k), (N = o == null ? void 0 : o.params) == null ? void 0 : N.filter])
24238
24239
  }),
24239
- { filters: A }
24240
+ { filters: k }
24240
24241
  );
24241
24242
  },
24242
24243
  handleSearchInput: (I) => {
@@ -24253,7 +24254,7 @@ const useCreateActionProps = () => {
24253
24254
  const { currentFields: e = [] } = useCollection_deprecated();
24254
24255
  return e.filter((t) => isOptionalField(t));
24255
24256
  }, isOptionalField = (e) => ["select", "multipleSelect", "checkbox", "checkboxGroup", "chinaRegion"].includes(e.interface) && e.uiSchema.enum, useAssociationFilterBlockProps = () => {
24256
- var b, y, v, I, A;
24257
+ var b, y, v, I, k;
24257
24258
  const e = AssociationFilter.useAssociationField(), t = useFieldSchema(), o = useOptionalFieldList(), { getDataBlocks: n } = useFilterBlock(), r = e == null ? void 0 : e.name, i = useField(), { props: a } = useBlockRequestContext(), l = useDataSourceHeaders(a == null ? void 0 : a.dataSource), c = useCollectionManager_deprecated();
24258
24259
  let u, d, p, m, h, x, f, C;
24259
24260
  if (x = e != null && e.target ? (b = c.getCollection(e.target)) == null ? void 0 : b.getPrimaryKey() : "id", f = ((v = (y = t["x-component-props"]) == null ? void 0 : y.fieldNames) == null ? void 0 : v.label) || x, { data: h, params: p, run: m } = useRequest(
@@ -24277,14 +24278,14 @@ const useCreateActionProps = () => {
24277
24278
  }, [e, f, m, x]), !e)
24278
24279
  return {};
24279
24280
  if (isOptionalField(e)) {
24280
- const k = o.find((N) => N.name === t.name), w = {
24281
+ const A = o.find((N) => N.name === t.name), w = {
24281
24282
  select: "$in",
24282
24283
  multipleSelect: "$anyOf",
24283
24284
  checkbox: "$in",
24284
24285
  checkboxGroup: "$anyOf"
24285
- }, M = ((A = k == null ? void 0 : k.uiSchema) == null ? void 0 : A.enum) || [];
24286
+ }, M = ((k = A == null ? void 0 : A.uiSchema) == null ? void 0 : k.enum) || [];
24286
24287
  x = "value", f = "label", u = M, p = {}, m = () => {
24287
- }, C = `${k.name}.${w[k.interface]}`, d = (N) => {
24288
+ }, C = `${A.name}.${w[A.interface]}`, d = (N) => {
24288
24289
  const E = N.target.value;
24289
24290
  if (!E) {
24290
24291
  u = M;
@@ -24293,26 +24294,26 @@ const useCreateActionProps = () => {
24293
24294
  u = M.filter((z) => z.label.includes(E));
24294
24295
  };
24295
24296
  } else
24296
- C = `${r}.${x}.$in`, u = (h == null ? void 0 : h.data) || [], d = (k) => {
24297
+ C = `${r}.${x}.$in`, u = (h == null ? void 0 : h.data) || [], d = (A) => {
24297
24298
  m(F(g({}, p == null ? void 0 : p[0]), {
24298
24299
  filter: {
24299
- [`${f}.$includes`]: k.target.value
24300
+ [`${f}.$includes`]: A.target.value
24300
24301
  }
24301
24302
  }));
24302
24303
  };
24303
24304
  return {
24304
24305
  /** 渲染 Collapse 的列表数据 */
24305
24306
  list: u,
24306
- onSelected: (k) => {
24307
+ onSelected: (A) => {
24307
24308
  const { targets: w, uid: M } = findFilterTargets(t);
24308
24309
  n().forEach((N) => {
24309
24310
  var B, T, D;
24310
24311
  if (!w.find(($) => $.uid === N.uid))
24311
24312
  return;
24312
24313
  const z = `${M}${t.name}`, O = ((B = N.service.params) == null ? void 0 : B[0]) || {}, R = ((D = (T = N.service.params) == null ? void 0 : T[1]) == null ? void 0 : D.filters) || {};
24313
- if (k.length)
24314
+ if (A.length)
24314
24315
  R[z] = {
24315
- [C]: k
24316
+ [C]: A
24316
24317
  };
24317
24318
  else {
24318
24319
  if (N.dataLoadingMode === "manual")
@@ -24378,33 +24379,33 @@ const useAssociationNames = (e) => {
24378
24379
  var S, b, y, v;
24379
24380
  const m = d || u, h = p["x-collection-field"] && n(p["x-collection-field"], e), x = p.name.includes("."), f = h && ["hasOne", "hasMany", "belongsTo", "belongsToMany"].includes(h.type);
24380
24381
  if (p["x-linkage-rules"]) {
24381
- const I = (k) => {
24382
- const w = Object.keys(k)[0] || "$and";
24383
- k[w].forEach((N) => {
24382
+ const I = (A) => {
24383
+ const w = Object.keys(A)[0] || "$and";
24384
+ A[w].forEach((N) => {
24384
24385
  if ("$and" in N || "$or" in N)
24385
24386
  return I(N);
24386
24387
  const E = getTargetField(N);
24387
24388
  E.length > 1 && o.add(E.join("."));
24388
24389
  });
24389
24390
  };
24390
- p["x-linkage-rules"].forEach(({ condition: k }) => {
24391
- I(k);
24391
+ p["x-linkage-rules"].forEach(({ condition: A }) => {
24392
+ I(A);
24392
24393
  });
24393
24394
  }
24394
24395
  const C = f && ((S = r(h.target, e)) == null ? void 0 : S.template) === "tree";
24395
24396
  if (h && (f || x) && p["x-component"] !== "TableField") {
24396
- const I = !f && x ? getAssociationPath(p.name) : p.name, A = m === "" || !m ? I : m + "." + I;
24397
+ const I = !f && x ? getAssociationPath(p.name) : p.name, k = m === "" || !m ? I : m + "." + I;
24397
24398
  if (C)
24398
- o.add(A), o.add(`${A}.parent(recursively=true)`);
24399
+ o.add(k), o.add(`${k}.parent(recursively=true)`);
24399
24400
  else if ((b = p["x-component-props"]) != null && b.sortArr) {
24400
- const k = (y = p["x-component-props"]) == null ? void 0 : y.sortArr;
24401
- o.add(`${A}(sort=${k})`);
24401
+ const A = (y = p["x-component-props"]) == null ? void 0 : y.sortArr;
24402
+ o.add(`${k}(sort=${A})`);
24402
24403
  } else
24403
- o.add(A);
24404
+ o.add(k);
24404
24405
  if (["Nester", "SubTable", "PopoverNester"].includes((v = p["x-component-props"]) == null ? void 0 : v.mode)) {
24405
- t.add(A);
24406
- const k = m && m !== "" ? m + "." + p.name : p.name;
24407
- a(p, k);
24406
+ t.add(k);
24407
+ const A = m && m !== "" ? m + "." + p.name : p.name;
24408
+ a(p, A);
24408
24409
  }
24409
24410
  } else
24410
24411
  [
@@ -24541,8 +24542,8 @@ function navigateWithinSelf(e, t, o = window.location.origin) {
24541
24542
  isURL(e) ? e.startsWith(o) ? t(e.replace(o, "")) : window.open(e, "_self") : t(e.startsWith("/") ? e : `/${e}`);
24542
24543
  }
24543
24544
  const useSyncFromForm = (e, t, o) => {
24544
- const { getCollectionJoinField: n, getCollectionFields: r } = useCollectionManager_deprecated(), i = ArrayBase.useArray(), a = ArrayBase.useIndex(), l = ArrayBase.useRecord(), c = useCompile(), { t: u } = useTranslation(), d = useForm(), p = /* @__PURE__ */ ((f) => (C, { exclude: S = [], depth: b = 0, maxDepth: y, prefix: v = "", disabled: I = !1 }, A) => {
24545
- const k = `${C}-${S.join(",")}-${b}-${y}-${v}`, w = f.get(k);
24545
+ const { getCollectionJoinField: n, getCollectionFields: r } = useCollectionManager_deprecated(), i = ArrayBase.useArray(), a = ArrayBase.useIndex(), l = ArrayBase.useRecord(), c = useCompile(), { t: u } = useTranslation(), d = useForm(), p = /* @__PURE__ */ ((f) => (C, { exclude: S = [], depth: b = 0, maxDepth: y, prefix: v = "", disabled: I = !1 }, k) => {
24546
+ const A = `${C}-${S.join(",")}-${b}-${y}-${v}`, w = f.get(A);
24546
24547
  if (w)
24547
24548
  return w;
24548
24549
  if (b > y)
@@ -24560,7 +24561,7 @@ const useSyncFromForm = (e, t, o) => {
24560
24561
  isLeaf: !0,
24561
24562
  field: N,
24562
24563
  disabled: I
24563
- }), O = A.find((j) => j.name === z.key);
24564
+ }), O = k.find((j) => j.name === z.key);
24564
24565
  if (["belongsTo", "belongsToMany"].includes(N.type) && (!O || ["Select", "Picker"].includes(O == null ? void 0 : O.fieldMode)))
24565
24566
  E.type = "reference", z.type = "reference", z.title = React.createElement(TreeNode, F(g({}, E), { type: "reference" })), z.isLeaf = !1, z.children = m(N.target, {
24566
24567
  depth: b + 1,
@@ -24579,19 +24580,19 @@ const useSyncFromForm = (e, t, o) => {
24579
24580
  exclude: ["id", ...systemKeys],
24580
24581
  disabled: j
24581
24582
  },
24582
- A
24583
+ k
24583
24584
  );
24584
24585
  }
24585
24586
  return z;
24586
24587
  }).filter(Boolean);
24587
- return f.set(k, M), M;
24588
+ return f.set(A, M), M;
24588
24589
  })(new LRUCache({ max: 100 })), m = /* @__PURE__ */ ((f) => (C, { prefix: S, maxDepth: b, depth: y = 0, exclude: v = [] }) => {
24589
- const I = `${C}-${v.join(",")}-${y}-${b}-${S}`, A = f.get(I);
24590
- if (A)
24591
- return A;
24590
+ const I = `${C}-${v.join(",")}-${y}-${b}-${S}`, k = f.get(I);
24591
+ if (k)
24592
+ return k;
24592
24593
  if (y > b)
24593
24594
  return [];
24594
- const k = r(C).map((w) => {
24595
+ const A = r(C).map((w) => {
24595
24596
  var E, z;
24596
24597
  if (!w.target || !w.interface || v.includes(w.name))
24597
24598
  return;
@@ -24614,7 +24615,7 @@ const useSyncFromForm = (e, t, o) => {
24614
24615
  })
24615
24616
  };
24616
24617
  }).filter(Boolean);
24617
- return f.set(I, k), k;
24618
+ return f.set(I, A), A;
24618
24619
  })(new LRUCache({ max: 100 })), h = useCallback((f, C) => {
24619
24620
  if (!f)
24620
24621
  return [];
@@ -24629,10 +24630,10 @@ const useSyncFromForm = (e, t, o) => {
24629
24630
  return V(this, null, function* () {
24630
24631
  var y;
24631
24632
  const f = /* @__PURE__ */ new Set([]), C = /* @__PURE__ */ new Set([]), S = (v, I) => {
24632
- var A;
24633
- (A = v == null ? void 0 : v.reduceProperties) == null || A.call(v, (k, w) => {
24633
+ var k;
24634
+ (k = v == null ? void 0 : v.reduceProperties) == null || k.call(v, (A, w) => {
24634
24635
  var j, B, T;
24635
- const M = k || I, N = w["x-collection-field"] && n(w["x-collection-field"]), E = w.name.includes("."), z = N && ["hasOne", "hasMany", "belongsTo", "belongsToMany"].includes(N.type), O = !z && E ? getAssociationPath(w.name) : w.name, R = M === "" || !M ? O : M + "." + O;
24636
+ const M = A || I, N = w["x-collection-field"] && n(w["x-collection-field"]), E = w.name.includes("."), z = N && ["hasOne", "hasMany", "belongsTo", "belongsToMany"].includes(N.type), O = !z && E ? getAssociationPath(w.name) : w.name, R = M === "" || !M ? O : M + "." + O;
24636
24637
  if (N && !(["hasOne", "hasMany"].includes(N.type) || ["SubForm", "Nester"].includes((j = w["x-component-props"]) == null ? void 0 : j.mode)) && C.add(R), N && (z || E) && w["x-component"] !== "TableField") {
24637
24638
  if (f.add({ name: R, fieldMode: ((B = w["x-component-props"]) == null ? void 0 : B.mode) || "Select" }), ["Nester", "SubTable"].includes((T = w["x-component-props"]) == null ? void 0 : T.mode)) {
24638
24639
  const D = M && M !== "" ? M + "." + w.name : w.name;
@@ -25411,7 +25412,7 @@ function Input$1(e) {
25411
25412
  fieldNames: u
25412
25413
  } = e, d = typeof e.scope == "function" ? e.scope() : e.scope, { wrapSSR: p, hashId: m, componentCls: h, rootPrefixCls: x } = useStyles$c();
25413
25414
  useAntdInputStyle(`${x}-input`);
25414
- const f = useCompile(), { t: C } = useTranslation(), S = useForm(), [b, y] = React.useState([]), [v, I] = React.useState([]), A = useMemo(() => parseValue(t), [t]), k = typeof A == "string", w = k ? A : "", M = k ? null : A, N = Object.assign(
25415
+ const f = useCompile(), { t: C } = useTranslation(), S = useForm(), [b, y] = React.useState([]), [v, I] = React.useState([]), k = useMemo(() => parseValue(t), [t]), A = typeof k == "string", w = A ? k : "", M = A ? null : k, N = Object.assign(
25415
25416
  {
25416
25417
  label: "label",
25417
25418
  value: "value",
@@ -25816,13 +25817,13 @@ function getCurrentRange(e) {
25816
25817
  ];
25817
25818
  }
25818
25819
  function TextArea(e) {
25819
- const { wrapSSR: t, hashId: o, componentCls: n } = useStyles$c(), { value: r = "", scope: i, onChange: a, multiline: l = !0, changeOnSelect: c, style: u } = e, d = useRef(null), [p, m] = useState([]), h = useForm(), x = useMemo(() => createOptionsValueLabelMap(p), [p]), [f, C] = useState(!1), [S, b] = useState(!1), [y, v] = useState(() => renderHTML(r != null ? r : "", x)), [I, A] = useState([-1, 0, -1, 0]);
25820
+ const { wrapSSR: t, hashId: o, componentCls: n } = useStyles$c(), { value: r = "", scope: i, onChange: a, multiline: l = !0, changeOnSelect: c, style: u } = e, d = useRef(null), [p, m] = useState([]), h = useForm(), x = useMemo(() => createOptionsValueLabelMap(p), [p]), [f, C] = useState(!1), [S, b] = useState(!1), [y, v] = useState(() => renderHTML(r != null ? r : "", x)), [I, k] = useState([-1, 0, -1, 0]);
25820
25821
  useAntdInputStyle("ant-input"), useEffect(() => {
25821
25822
  preloadOptions(i, r).then((j) => {
25822
25823
  m(j);
25823
25824
  }).catch(console.error);
25824
25825
  }, [i, r]), useEffect(() => {
25825
- v(renderHTML(r != null ? r : "", x)), S || A([-1, 0, -1, 0]);
25826
+ v(renderHTML(r != null ? r : "", x)), S || k([-1, 0, -1, 0]);
25826
25827
  }, [r, x]), useEffect(() => {
25827
25828
  var T;
25828
25829
  const { current: j } = d;
@@ -25844,11 +25845,11 @@ function TextArea(e) {
25844
25845
  if (D) {
25845
25846
  B.setStartAfter(D), B.setEndAfter(D);
25846
25847
  const $ = Array.from(j.childNodes), q = B.startContainer === j ? -1 : $.indexOf(D), L = B.startContainer === j ? -1 : $.indexOf(D);
25847
- A([q, B.startOffset, L, B.endOffset]);
25848
+ k([q, B.startOffset, L, B.endOffset]);
25848
25849
  }
25849
25850
  }
25850
25851
  }, [y]);
25851
- const k = useCallback(
25852
+ const A = useCallback(
25852
25853
  function(j) {
25853
25854
  const B = j.filter(($) => !!$.trim()), { current: T } = d;
25854
25855
  if (!T || !B)
@@ -25857,23 +25858,23 @@ function TextArea(e) {
25857
25858
  const D = createVariableTagHTML(B.join("."), x);
25858
25859
  pasteHTML(T, D, {
25859
25860
  range: I
25860
- }), b(!0), A(getCurrentRange(T)), a(getValue(T));
25861
+ }), b(!0), k(getCurrentRange(T)), a(getValue(T));
25861
25862
  },
25862
25863
  [x, a, I]
25863
25864
  ), w = useCallback(
25864
25865
  function({ currentTarget: j }) {
25865
- f || (b(!0), A(getCurrentRange(j)), a(getValue(j)));
25866
+ f || (b(!0), k(getCurrentRange(j)), a(getValue(j)));
25866
25867
  },
25867
25868
  [f, a]
25868
25869
  ), M = useCallback(function({ currentTarget: j }) {
25869
- A(getCurrentRange(j));
25870
+ k(getCurrentRange(j));
25870
25871
  }, []), N = useCallback(function(j) {
25871
25872
  j.key === "Enter" && j.preventDefault();
25872
25873
  }, []), E = useCallback(function() {
25873
25874
  C(!0);
25874
25875
  }, []), z = useCallback(
25875
25876
  ({ currentTarget: j }) => {
25876
- C(!1), b(!0), A(getCurrentRange(j)), a(getValue(j));
25877
+ C(!1), b(!0), k(getCurrentRange(j)), a(getValue(j));
25877
25878
  },
25878
25879
  [a]
25879
25880
  ), O = useCallback(
@@ -25896,7 +25897,7 @@ function TextArea(e) {
25896
25897
  }
25897
25898
  }
25898
25899
  }).replace(/\n/g, " ");
25899
- b(!0), pasteHTML(j.currentTarget, T), A(getCurrentRange(j.currentTarget)), a(getValue(j.currentTarget));
25900
+ b(!0), pasteHTML(j.currentTarget, T), k(getCurrentRange(j.currentTarget)), a(getValue(j.currentTarget));
25900
25901
  },
25901
25902
  [a]
25902
25903
  ), R = e.disabled || h.disabled;
@@ -25967,7 +25968,7 @@ function TextArea(e) {
25967
25968
  dangerouslySetInnerHTML: { __html: y }
25968
25969
  }
25969
25970
  ),
25970
- R ? null : /* @__PURE__ */ jsx(VariableSelect, { options: p, setOptions: m, onInsert: k, changeOnSelect: c })
25971
+ R ? null : /* @__PURE__ */ jsx(VariableSelect, { options: p, setOptions: m, onInsert: A, changeOnSelect: c })
25971
25972
  ]
25972
25973
  }
25973
25974
  )
@@ -27369,9 +27370,9 @@ const customizeLinkActionSettings = new SchemaSettings({
27369
27370
  step: null
27370
27371
  }
27371
27372
  }), [n]);
27372
- useMemo(() => gridSizes.reduce((I, A) => (I[A] = F(g({}, p), {
27373
- title: n(screenSizeTitleMaps[A]),
27374
- description: `${n("Screen size")} ${screenSizeMaps[A]} ${n("pixels")}`
27373
+ useMemo(() => gridSizes.reduce((I, k) => (I[k] = F(g({}, p), {
27374
+ title: n(screenSizeTitleMaps[k]),
27375
+ description: `${n("Screen size")} ${screenSizeMaps[k]} ${n("pixels")}`
27375
27376
  }), I), {}), [p, n]);
27376
27377
  const m = u == null ? void 0 : u.map((I) => I.startsWith("-") ? {
27377
27378
  field: I.substring(1),
@@ -27474,8 +27475,8 @@ const customizeLinkActionSettings = new SchemaSettings({
27474
27475
  }
27475
27476
  },
27476
27477
  onSubmit: ({ sort: I }) => {
27477
- const A = I.map((k) => k.direction === "desc" ? `-${k.field}` : k.field);
27478
- _.set(r, "x-decorator-props.params.sort", A), a.decoratorProps.params = g({}, r["x-decorator-props"].params), l.emit("patch", {
27478
+ const k = I.map((A) => A.direction === "desc" ? `-${A.field}` : A.field);
27479
+ _.set(r, "x-decorator-props.params.sort", k), a.decoratorProps.params = g({}, r["x-decorator-props"].params), l.emit("patch", {
27479
27480
  schema: {
27480
27481
  "x-uid": r["x-uid"],
27481
27482
  "x-decorator-props": r["x-decorator-props"]
@@ -28813,14 +28814,14 @@ const gridCardBlockSettings = new SchemaSettings({
28813
28814
  options: n,
28814
28815
  value: p == null ? void 0 : p.label,
28815
28816
  onChange(C) {
28816
- var v, I, A, k, w;
28817
+ var v, I, k, A, w;
28817
28818
  const S = {
28818
28819
  "x-uid": c["x-uid"]
28819
- }, b = F(g(g({}, (I = (v = d == null ? void 0 : d.uiSchema) == null ? void 0 : v["x-component-props"]) == null ? void 0 : I.fieldNames), (A = c["x-component-props"]) == null ? void 0 : A.fieldNames), {
28820
+ }, b = F(g(g({}, (I = (v = d == null ? void 0 : d.uiSchema) == null ? void 0 : v["x-component-props"]) == null ? void 0 : I.fieldNames), (k = c["x-component-props"]) == null ? void 0 : k.fieldNames), {
28820
28821
  label: C
28821
28822
  });
28822
28823
  c["x-component-props"] = c["x-component-props"] || {}, c["x-component-props"].fieldNames = b, S["x-component-props"] = c["x-component-props"], t.componentProps.fieldNames = c["x-component-props"].fieldNames;
28823
- const y = (w = t.path) == null ? void 0 : w.splice(((k = t.path) == null ? void 0 : k.length) - 1, 1);
28824
+ const y = (w = t.path) == null ? void 0 : w.splice(((A = t.path) == null ? void 0 : A.length) - 1, 1);
28824
28825
  t.form.query(`${y.concat("*." + c.name)}`).forEach((M) => {
28825
28826
  M.componentProps.fieldNames = p;
28826
28827
  }), o.emit("patch", {
@@ -30087,8 +30088,8 @@ const useFieldComponentOptions = () => {
30087
30088
  const { refresh: t } = useDesignable(), o = useAPIClient(), { t: n } = useTranslation();
30088
30089
  return useCallback(
30089
30090
  (r) => {
30090
- var f, C, S, b, y, v, I, A, k, w, M, N, E, z, O;
30091
- 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 = (b = (S = a == null ? void 0 : a.data) == null ? void 0 : S.current) == null ? void 0 : b.schema, u = (v = (y = a == null ? void 0 : a.data) == null ? void 0 : y.current) == null ? void 0 : v.insertAdjacent, d = (A = (I = a == null ? void 0 : a.data) == null ? void 0 : I.current) == null ? void 0 : A.breakRemoveOn, p = (w = (k = a == null ? void 0 : a.data) == null ? void 0 : k.current) == null ? void 0 : w.wrapSchema, m = (N = (M = a == null ? void 0 : a.data) == null ? void 0 : M.current) == null ? void 0 : N.onSuccess, h = (O = (z = (E = a == null ? void 0 : a.data) == null ? void 0 : E.current) == null ? void 0 : z.removeParentsIfNoChildren) != null ? O : !0;
30091
+ var f, C, S, b, y, v, I, k, A, w, M, N, E, z, O;
30092
+ 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 = (b = (S = a == null ? void 0 : a.data) == null ? void 0 : S.current) == null ? void 0 : b.schema, u = (v = (y = a == null ? void 0 : a.data) == null ? void 0 : y.current) == null ? void 0 : v.insertAdjacent, d = (k = (I = a == null ? void 0 : a.data) == null ? void 0 : I.current) == null ? void 0 : k.breakRemoveOn, p = (w = (A = a == null ? void 0 : a.data) == null ? void 0 : A.current) == null ? void 0 : w.wrapSchema, m = (N = (M = a == null ? void 0 : a.data) == null ? void 0 : M.current) == null ? void 0 : N.onSuccess, h = (O = (z = (E = a == null ? void 0 : a.data) == null ? void 0 : E.current) == null ? void 0 : z.removeParentsIfNoChildren) != null ? O : !0;
30092
30093
  if (!l || !c) {
30093
30094
  e == null || e(r);
30094
30095
  return;
@@ -30588,7 +30589,7 @@ const getValues = (e, t) => castArray(e).filter((o) => o != null).map((o) => typ
30588
30589
  "CustomDropdownRender",
30589
30590
  "optionFilter",
30590
30591
  "dataSource"
30591
- ]), x = useDataSourceKey(), f = useDataSourceHeaders(m || x), [C, S] = useState(!1), b = useRef(!1), y = useFieldSchema(), v = ((K = y["x-component-props"]) == null ? void 0 : K.addMode) === "quickAdd", { getField: I } = useCollection_deprecated(), A = useRef(null), { getCollectionJoinField: k, getInterface: w } = useCollectionManager_deprecated(), M = y["x-collection-field"] || y.name, N = I(M) || k(M), E = u || (N == null ? void 0 : N.target) && (t == null ? void 0 : t.label) && k(`${N.target}.${t.label}`), z = useMemo(() => {
30592
+ ]), x = useDataSourceKey(), f = useDataSourceHeaders(m || x), [C, S] = useState(!1), b = useRef(!1), y = useFieldSchema(), v = ((K = y["x-component-props"]) == null ? void 0 : K.addMode) === "quickAdd", { getField: I } = useCollection_deprecated(), k = useRef(null), { getCollectionJoinField: A, getInterface: w } = useCollectionManager_deprecated(), M = y["x-collection-field"] || y.name, N = I(M) || A(M), E = u || (N == null ? void 0 : N.target) && (t == null ? void 0 : t.label) && A(`${N.target}.${t.label}`), z = useMemo(() => {
30592
30593
  var W, X;
30593
30594
  return E != null && E.interface && ((X = (W = w(E.interface)) == null ? void 0 : W.filterable) == null ? void 0 : X.operators[0].value) || "$includes";
30594
30595
  }, [E]), O = useCompile(), R = useCallback(
@@ -30641,15 +30642,15 @@ const getValues = (e, t) => castArray(e).filter((o) => o != null).map((o) => typ
30641
30642
  fieldNames: t
30642
30643
  }),
30643
30644
  [o, t]
30644
- ), $ = useCallback(() => A.current && d ? /* @__PURE__ */ jsx(
30645
+ ), $ = useCallback(() => k.current && d ? /* @__PURE__ */ jsx(
30645
30646
  d,
30646
30647
  {
30647
- search: A.current,
30648
+ search: k.current,
30648
30649
  callBack: () => {
30649
- A.current = null, S(!1);
30650
+ k.current = null, S(!1);
30650
30651
  }
30651
30652
  }
30652
- ) : null, [A.current]);
30653
+ ) : null, [k.current]);
30653
30654
  useEffect(() => {
30654
30655
  b.current && B();
30655
30656
  }, [D]);
@@ -30664,7 +30665,7 @@ const getValues = (e, t) => castArray(e).filter((o) => o != null).map((o) => typ
30664
30665
  } : {},
30665
30666
  (X = o == null ? void 0 : o.params) == null ? void 0 : X.filter
30666
30667
  ])
30667
- }), A.current = W;
30668
+ }), k.current = W;
30668
30669
  }), L = useMemo(() => {
30669
30670
  var J;
30670
30671
  const W = r || i;
@@ -30684,7 +30685,7 @@ const getValues = (e, t) => castArray(e).filter((o) => o != null).map((o) => typ
30684
30685
  fieldNames: t,
30685
30686
  onSearch: q,
30686
30687
  onDropdownVisibleChange: (W) => {
30687
- S(W), A.current = null, W && B(), b.current = !0;
30688
+ S(W), k.current = null, W && B(), b.current = !0;
30688
30689
  },
30689
30690
  objectValue: a,
30690
30691
  value: r,
@@ -30694,10 +30695,10 @@ const getValues = (e, t) => castArray(e).filter((o) => o != null).map((o) => typ
30694
30695
  options: R(L),
30695
30696
  rawOptions: L,
30696
30697
  dropdownRender: (W) => {
30697
- const X = L.some((Q) => Q[t.label] === A.current);
30698
+ const X = L.some((Q) => Q[t.label] === k.current);
30698
30699
  return /* @__PURE__ */ jsx(Fragment, { children: v ? /* @__PURE__ */ jsxs(Fragment, { children: [
30699
- !((j == null ? void 0 : j.data.length) === 0 && (A != null && A.current)) && W,
30700
- (j == null ? void 0 : j.data.length) > 0 && (A == null ? void 0 : A.current) && !X && /* @__PURE__ */ jsx(Divider, { style: { margin: 0 } }),
30700
+ !((j == null ? void 0 : j.data.length) === 0 && (k != null && k.current)) && W,
30701
+ (j == null ? void 0 : j.data.length) > 0 && (k == null ? void 0 : k.current) && !X && /* @__PURE__ */ jsx(Divider, { style: { margin: 0 } }),
30701
30702
  !X && /* @__PURE__ */ jsx($, {})
30702
30703
  ] }) : W });
30703
30704
  }
@@ -30767,12 +30768,12 @@ const useFormDataTemplates = () => {
30767
30768
  }, e), [e, o.colorFillAlter]), C = useMemo(() => ({ fontSize: o.fontSize, fontWeight: "bold", whiteSpace: "nowrap", marginRight: o.marginXS }), [o.fontSize, o.marginXS]), S = useCallback((v) => V(void 0, null, function* () {
30768
30769
  d(v), m(null), t == null || t.reset();
30769
30770
  }), []), b = useCallback((v, I) => V(void 0, null, function* () {
30770
- const A = F(g({}, I), { dataId: v });
30771
- m(I), fetchTemplateData(h, A).then((k) => (t && k && (t.reset(), t.__template = !0, forEach(k, (w, M) => {
30771
+ const k = F(g({}, I), { dataId: v });
30772
+ m(I), fetchTemplateData(h, k).then((A) => (t && A && (t.reset(), t.__template = !0, forEach(A, (w, M) => {
30772
30773
  var N;
30773
30774
  w && (t.values[M] = w, (N = t == null ? void 0 : t.setInitialValuesIn) == null || N.call(t, M, w));
30774
- })), k)).catch((k) => {
30775
- console.error(k);
30775
+ })), A)).catch((A) => {
30776
+ console.error(A);
30776
30777
  });
30777
30778
  }), []);
30778
30779
  if (!i || !r)
@@ -30834,7 +30835,7 @@ function fetchTemplateData(e, t, o) {
30834
30835
  }
30835
30836
  const useFormBlockHeight = () => {
30836
30837
  var y, v, I;
30837
- const e = useDataBlockHeight(), t = useFieldSchema(), { token: o } = theme.useToken(), { designable: n } = useDesignable(), { heightProps: r } = useBlockHeightProps() || {}, { title: i } = r || {}, { display: a, enabled: l } = useFormDataTemplates(), c = t.reduceProperties((A, k) => k["x-component"] === "ActionBar" ? k : A), u = Object.keys((c == null ? void 0 : c.properties) || {}).length > 0, d = (I = (v = (y = t == null ? void 0 : t.parent) == null ? void 0 : y["x-decorator"]) == null ? void 0 : v.includes) == null ? void 0 : I.call(v, "FormBlockProvider"), p = u || n ? o.controlHeight + (d ? 1 : 2) * o.marginLG : o.marginLG, m = i ? o.fontSizeLG * o.lineHeightLG + o.padding * 2 - 1 : 0, { data: h } = useDataBlockRequest() || {}, { count: x, pageSize: f } = (h == null ? void 0 : h.meta) || {}, S = x > f ? o.controlHeightSM + 1 * o.paddingLG : 0, b = a && l ? o.controlHeight + 2 * o.padding + o.margin : 0;
30838
+ const e = useDataBlockHeight(), t = useFieldSchema(), { token: o } = theme.useToken(), { designable: n } = useDesignable(), { heightProps: r } = useBlockHeightProps() || {}, { title: i } = r || {}, { display: a, enabled: l } = useFormDataTemplates(), c = t.reduceProperties((k, A) => A["x-component"] === "ActionBar" ? A : k), u = Object.keys((c == null ? void 0 : c.properties) || {}).length > 0, d = (I = (v = (y = t == null ? void 0 : t.parent) == null ? void 0 : y["x-decorator"]) == null ? void 0 : v.includes) == null ? void 0 : I.call(v, "FormBlockProvider"), p = u || n ? o.controlHeight + (d ? 1 : 2) * o.marginLG : o.marginLG, m = i ? o.fontSizeLG * o.lineHeightLG + o.padding * 2 - 1 : 0, { data: h } = useDataBlockRequest() || {}, { count: x, pageSize: f } = (h == null ? void 0 : h.meta) || {}, S = x > f ? o.controlHeightSM + 1 * o.paddingLG : 0, b = a && l ? o.controlHeight + 2 * o.padding + o.margin : 0;
30838
30839
  return e - p - o.paddingLG - m - S - b;
30839
30840
  }, FormComponent = (e) => {
30840
30841
  const u = e, { form: t, children: o } = u, n = H(u, ["form", "children"]), r = useField(), i = useFieldSchema(), a = useAttach(t.createVoidField(F(g({}, r.props), { basePath: "" }))), l = useFormBlockHeight(), { token: c } = theme.useToken();
@@ -30884,12 +30885,12 @@ const useFormBlockHeight = () => {
30884
30885
  if ((f = x.targetFields) != null && f.length) {
30885
30886
  const C = x.targetFields.join(",");
30886
30887
  onFieldInit(`*(${C})`, (S, b) => {
30887
- var y, v, I, A;
30888
+ var y, v, I, k;
30888
30889
  S.initStateOfLinkageRules = {
30889
30890
  display: ((y = S.initStateOfLinkageRules) == null ? void 0 : y.display) || getTempFieldState(!0, S.display),
30890
30891
  required: ((v = S.initStateOfLinkageRules) == null ? void 0 : v.required) || getTempFieldState(!0, S.required || !1),
30891
30892
  pattern: ((I = S.initStateOfLinkageRules) == null ? void 0 : I.pattern) || getTempFieldState(!0, S.pattern),
30892
- value: ((A = S.initStateOfLinkageRules) == null ? void 0 : A.value) || getTempFieldState(!0, S.value || S.initialValue)
30893
+ value: ((k = S.initStateOfLinkageRules) == null ? void 0 : k.value) || getTempFieldState(!0, S.value || S.initialValue)
30893
30894
  }, p.push(
30894
30895
  reaction(
30895
30896
  // 这里共依赖 3 部分,当这 3 部分中的任意一部分发生变更后,需要触发联动规则:
@@ -30897,8 +30898,8 @@ const useFormBlockHeight = () => {
30897
30898
  // 2. 条件中的变量值;
30898
30899
  // 3. value 表达式中的变量值;
30899
30900
  () => {
30900
- const k = getFieldValuesInCondition({ linkageRules: l, formValues: b.values }), w = getVariableValuesInCondition({ linkageRules: l, localVariables: i }), M = getVariableValuesInExpression({ action: x, localVariables: i });
30901
- return [k, w, M].map((E) => JSON.stringify(E)).join(",");
30901
+ const A = getFieldValuesInCondition({ linkageRules: l, formValues: b.values }), w = getVariableValuesInCondition({ linkageRules: l, localVariables: i }), M = getVariableValuesInExpression({ action: x, localVariables: i });
30902
+ return [A, w, M].map((E) => JSON.stringify(E)).join(",");
30902
30903
  },
30903
30904
  getSubscriber(x, S, m, r, i),
30904
30905
  { fireImmediately: !0, equals: _.isEqual }
@@ -31718,7 +31719,7 @@ const FixedBlockContext = React.createContext({
31718
31719
  const h = (B = l["x-component-props"]) == null ? void 0 : B.disablePageHeader, x = (T = l["x-component-props"]) == null ? void 0 : T.enablePageTabs, f = (D = l["x-component-props"]) == null ? void 0 : D.hidePageTitle, C = useContext(SchemaOptionsContext), [S, b] = useSearchParams(), [y, v] = useState(!1), I = useMemo(
31719
31720
  () => S.get("tab") || Object.keys(l.properties || {}).shift(),
31720
31721
  [l.properties, S]
31721
- ), [A, k] = useState(0), { wrapSSR: w, hashId: M, componentCls: N } = useStyles$9(), E = useStyles$a(), { token: z } = useToken(), O = f ? void 0 : l.title || r(i);
31722
+ ), [k, A] = useState(0), { wrapSSR: w, hashId: M, componentCls: N } = useStyles$9(), E = useStyles$a(), { token: z } = useToken(), O = f ? void 0 : l.title || r(i);
31722
31723
  useRequest(
31723
31724
  {
31724
31725
  url: `/uiSchemas:getParentJsonSchema/${l["x-uid"]}`
@@ -31740,7 +31741,7 @@ const FixedBlockContext = React.createContext({
31740
31741
  "div",
31741
31742
  {
31742
31743
  ref: ($) => {
31743
- k(Math.floor(($ == null ? void 0 : $.getBoundingClientRect().height) || 0) + 1);
31744
+ A(Math.floor(($ == null ? void 0 : $.getBoundingClientRect().height) || 0) + 1);
31744
31745
  },
31745
31746
  children: !h && /* @__PURE__ */ jsx(
31746
31747
  PageHeader,
@@ -31834,7 +31835,7 @@ const FixedBlockContext = React.createContext({
31834
31835
  )
31835
31836
  }
31836
31837
  ),
31837
- /* @__PURE__ */ jsx("div", { className: "nb-page-wrapper", children: /* @__PURE__ */ jsx(ErrorBoundary, { FallbackComponent: ErrorFallback, onError: R, children: PageContent(y, h, x, l, I, A) }) })
31838
+ /* @__PURE__ */ jsx("div", { className: "nb-page-wrapper", children: /* @__PURE__ */ jsx(ErrorBoundary, { FallbackComponent: ErrorFallback, onError: R, children: PageContent(y, h, x, l, I, k) }) })
31838
31839
  ] })
31839
31840
  );
31840
31841
  };
@@ -32156,7 +32157,7 @@ const AppendsTreeSelect = (e) => {
32156
32157
  "filter",
32157
32158
  "rootOption",
32158
32159
  "loadData"
32159
- ]), d = useCompile(), { t: p } = useTranslation(), [m, h] = useState({}), x = i({ collection: r }), [f, C] = parseCollectionName(x), S = useApp(), { collectionManager: b } = S.dataSourceManager.getDataSource(f), y = b.getCollectionFields.bind(b), v = Object.values(m), I = useMemo(() => e.multiple ? (o || []).map((z) => m[z]).filter(Boolean) : o, [o, e.multiple, m]), A = useCallback(
32160
+ ]), d = useCompile(), { t: p } = useTranslation(), [m, h] = useState({}), x = i({ collection: r }), [f, C] = parseCollectionName(x), S = useApp(), { collectionManager: b } = S.dataSourceManager.getDataSource(f), y = b.getCollectionFields.bind(b), v = Object.values(m), I = useMemo(() => e.multiple ? (o || []).map((z) => m[z]).filter(Boolean) : o, [o, e.multiple, m]), k = useCallback(
32160
32161
  (z) => V(void 0, null, function* () {
32161
32162
  if (c != null)
32162
32163
  return c(z);
@@ -32197,7 +32198,7 @@ const AppendsTreeSelect = (e) => {
32197
32198
  }
32198
32199
  }), h((R) => O.reduce((j, B) => Object.assign(j, { [B.value]: B }), g({}, R)));
32199
32200
  }, [o, v.length, e.multiple]);
32200
- const k = useCallback(
32201
+ const A = useCallback(
32201
32202
  (z) => {
32202
32203
  if (!e.multiple) {
32203
32204
  n(z);
@@ -32245,10 +32246,10 @@ const AppendsTreeSelect = (e) => {
32245
32246
  treeCheckStrictly: e.multiple,
32246
32247
  treeCheckable: e.multiple,
32247
32248
  tagRender: w,
32248
- onChange: k,
32249
+ onChange: A,
32249
32250
  treeDataSimpleMode: !0,
32250
32251
  treeData: v,
32251
- loadData: A
32252
+ loadData: k
32252
32253
  }, u)
32253
32254
  );
32254
32255
  }, AssociationFieldProvider = observer$1(
@@ -32312,25 +32313,25 @@ const AppendsTreeSelect = (e) => {
32312
32313
  }), n;
32313
32314
  }, InternalAssociationSelect$1 = observer$1(
32314
32315
  (e) => {
32315
- var A;
32316
- const I = e, { objectValue: t = !0, addMode: o } = I, n = H(I, ["objectValue", "addMode"]), r = useField(), i = useFieldSchema(), a = useServiceOptions$1((i == null ? void 0 : i["x-component-props"]) || e), { options: l } = useAssociationFieldContext(), c = isVariable(e.value) ? void 0 : e.value, u = Array.isArray(c) ? c.filter(Boolean) : c, [d, p] = useState(u), m = (A = i["x-component-props"]) == null ? void 0 : A.addMode, { t: h } = useTranslation(), { multiple: x } = e, f = useForm(), S = useAPIClient().resource(l.target), b = useCollectionRecordData();
32316
+ var k;
32317
+ const I = e, { objectValue: t = !0, addMode: o } = I, n = H(I, ["objectValue", "addMode"]), r = useField(), i = useFieldSchema(), a = useServiceOptions$1((i == null ? void 0 : i["x-component-props"]) || e), { options: l } = useAssociationFieldContext(), c = isVariable(e.value) ? void 0 : e.value, u = Array.isArray(c) ? c.filter(Boolean) : c, [d, p] = useState(u), m = (k = i["x-component-props"]) == null ? void 0 : k.addMode, { t: h } = useTranslation(), { multiple: x } = e, f = useForm(), S = useAPIClient().resource(l.target), b = useCollectionRecordData();
32317
32318
  useEffect(() => {
32318
- const k = isVariable(r.value) ? void 0 : r.value, w = Array.isArray(k) ? k.filter(Boolean) : k;
32319
+ const A = isVariable(r.value) ? void 0 : r.value, w = Array.isArray(A) ? A.filter(Boolean) : A;
32319
32320
  p(w);
32320
32321
  }, [r.value]), useEffect(() => {
32321
- const k = uid();
32322
- return f.addEffects(k, () => {
32322
+ const A = uid();
32323
+ return f.addEffects(A, () => {
32323
32324
  onFieldInputValueChange("*", (w) => {
32324
32325
  var N, E, z, O;
32325
32326
  (filterAnalyses((z = (E = (N = r.componentProps) == null ? void 0 : N.service) == null ? void 0 : E.params) == null ? void 0 : z.filter) || []).includes((O = w == null ? void 0 : w.props) == null ? void 0 : O.name) && r.value && (r.setValue(r.initialValue), p(r.initialValue));
32326
32327
  });
32327
32328
  }), () => {
32328
- f.removeEffects(k);
32329
+ f.removeEffects(A);
32329
32330
  };
32330
32331
  }, []);
32331
- const y = (k) => V(void 0, null, function* () {
32332
+ const y = (A) => V(void 0, null, function* () {
32332
32333
  var E, z;
32333
- const { search: w, callBack: M } = k, {
32334
+ const { search: w, callBack: M } = A, {
32334
32335
  data: { data: N }
32335
32336
  } = yield S.create({
32336
32337
  values: {
@@ -32345,14 +32346,14 @@ const AppendsTreeSelect = (e) => {
32345
32346
  f.setValuesIn(r.path, N), r.onInput(N);
32346
32347
  isFunction(M) && (M == null || M()), message.success(h("Saved successfully"));
32347
32348
  }
32348
- }), v = (k) => /* @__PURE__ */ jsxs(
32349
+ }), v = (A) => /* @__PURE__ */ jsxs(
32349
32350
  "div",
32350
32351
  {
32351
- onClick: () => y(k),
32352
+ onClick: () => y(A),
32352
32353
  style: { cursor: "pointer", padding: "5px 12px", color: "#0d0c0c" },
32353
32354
  children: [
32354
32355
  /* @__PURE__ */ jsx(PlusOutlined, {}),
32355
- /* @__PURE__ */ jsx("span", { style: { paddingLeft: 5 }, children: h("Add") + ` “${k.search}” ` })
32356
+ /* @__PURE__ */ jsx("span", { style: { paddingLeft: 5 }, children: h("Add") + ` “${A.search}” ` })
32356
32357
  ]
32357
32358
  }
32358
32359
  );
@@ -32366,9 +32367,9 @@ const AppendsTreeSelect = (e) => {
32366
32367
  objectValue: t,
32367
32368
  value: u || d,
32368
32369
  service: a,
32369
- onChange: (k) => {
32370
+ onChange: (A) => {
32370
32371
  var M;
32371
- const w = (k == null ? void 0 : k.length) !== 0 ? k : null;
32372
+ const w = (A == null ? void 0 : A.length) !== 0 ? A : null;
32372
32373
  (M = e.onChange) == null || M.call(e, w);
32373
32374
  },
32374
32375
  CustomDropdownRender: m === "quickAdd" && v
@@ -32380,7 +32381,7 @@ const AppendsTreeSelect = (e) => {
32380
32381
  onlyRenderProperties: !0,
32381
32382
  basePath: r.address,
32382
32383
  schema: i,
32383
- filterProperties: (k) => k["x-component"] === "Action"
32384
+ filterProperties: (A) => A["x-component"] === "Action"
32384
32385
  }
32385
32386
  ) }) })
32386
32387
  ] }) }, i.name);
@@ -32903,26 +32904,26 @@ function Uploader(o) {
32903
32904
  const f = useCallback(
32904
32905
  (I) => {
32905
32906
  if (i) {
32906
- const A = I.fileList.filter((k) => k.status === "done");
32907
- if (A.length) {
32908
- const k = [...a != null ? a : [], ...A.map(toValueItem)];
32909
- l == null || l(k);
32907
+ const k = I.fileList.filter((A) => A.status === "done");
32908
+ if (k.length) {
32909
+ const A = [...a != null ? a : [], ...k.map(toValueItem)];
32910
+ l == null || l(A);
32910
32911
  }
32911
- u(I.fileList.filter((k) => k.status !== "done").map(normalizeFile));
32912
+ u(I.fileList.filter((A) => A.status !== "done").map(normalizeFile));
32912
32913
  } else {
32913
- const A = I.fileList.find((k) => k.uid === I.file.uid);
32914
- A.status === "done" ? (l == null || l(toValueItem(A)), u([])) : u([normalizeFile(A)]);
32914
+ const k = I.fileList.find((A) => A.uid === I.file.uid);
32915
+ k.status === "done" ? (l == null || l(toValueItem(k)), u([])) : u([normalizeFile(k)]);
32915
32916
  }
32916
32917
  },
32917
32918
  [a, i, l]
32918
32919
  ), C = useCallback((I) => {
32919
- u((A) => {
32920
- const k = A.indexOf(I);
32921
- return A.splice(k, 1), [...A];
32920
+ u((k) => {
32921
+ const A = k.indexOf(I);
32922
+ return k.splice(A, 1), [...k];
32922
32923
  });
32923
32924
  }, []), { mimetype: S, size: b } = e != null ? e : {}, y = useSizeHint(b), v = !r && (i || (!a || Array.isArray(a) && !a.length) && !c.length);
32924
32925
  return /* @__PURE__ */ jsxs(Fragment, { children: [
32925
- c.map((I, A) => /* @__PURE__ */ jsx(AttachmentListItem, { file: I, index: A, disabled: r, onDelete: C }, I.uid)),
32926
+ c.map((I, k) => /* @__PURE__ */ jsx(AttachmentListItem, { file: I, index: k, disabled: r, onDelete: C }, I.uid)),
32926
32927
  /* @__PURE__ */ jsx(
32927
32928
  "div",
32928
32929
  {
@@ -33231,7 +33232,7 @@ function FileSelector(e) {
33231
33232
  }
33232
33233
  const InternalFileManager = (e) => {
33233
33234
  var w, M;
33234
- const k = e, { value: t, multiple: o, onChange: n } = k, r = H(k, ["value", "multiple", "onChange"]), i = useFieldSchema(), [a, l] = useState(!1), [c, u] = useState([]), d = useInsertSchema("Selector"), p = useFieldNames$1(e), m = useField(), [h, x] = useState([]), { getField: f } = useCollection_deprecated(), C = f(m.props.name), S = useLabelUiSchema$1(C == null ? void 0 : C.target, (p == null ? void 0 : p.label) || "label"), b = useCompile(), { modalProps: y } = useActionContext(), v = (N) => {
33235
+ const A = e, { value: t, multiple: o, onChange: n } = A, r = H(A, ["value", "multiple", "onChange"]), i = useFieldSchema(), [a, l] = useState(!1), [c, u] = useState([]), d = useInsertSchema("Selector"), p = useFieldNames$1(e), m = useField(), [h, x] = useState([]), { getField: f } = useCollection_deprecated(), C = f(m.props.name), S = useLabelUiSchema$1(C == null ? void 0 : C.target, (p == null ? void 0 : p.label) || "label"), b = useCompile(), { modalProps: y } = useActionContext(), v = (N) => {
33235
33236
  N.stopPropagation(), N.preventDefault(), d(schema$1.Selector), l(!0), u([]);
33236
33237
  };
33237
33238
  useEffect(() => {
@@ -33258,7 +33259,7 @@ const InternalFileManager = (e) => {
33258
33259
  selectedRows: c,
33259
33260
  setSelectedRows: u,
33260
33261
  collectionField: C
33261
- }, A = () => {
33262
+ }, k = () => {
33262
33263
  const { setVisible: N } = useActionContext(), { multiple: E, selectedRows: z, onChange: O, options: R, collectionField: j } = useContext(RecordPickerContext);
33263
33264
  return {
33264
33265
  onClick() {
@@ -33291,7 +33292,7 @@ const InternalFileManager = (e) => {
33291
33292
  },
33292
33293
  formValueChanged: !1
33293
33294
  },
33294
- children: /* @__PURE__ */ jsx(RecordPickerProvider, F(g({}, I), { children: /* @__PURE__ */ jsx(CollectionProvider_deprecated, { name: C == null ? void 0 : C.target, children: /* @__PURE__ */ jsx(FormProvider, { children: /* @__PURE__ */ jsx(TableSelectorParamsProvider, { params: {}, children: /* @__PURE__ */ jsx(SchemaComponentOptions, { scope: { usePickActionProps: A, useTableSelectorProps: useTableSelectorProps$2 }, children: /* @__PURE__ */ jsx(
33295
+ children: /* @__PURE__ */ jsx(RecordPickerProvider, F(g({}, I), { children: /* @__PURE__ */ jsx(CollectionProvider_deprecated, { name: C == null ? void 0 : C.target, children: /* @__PURE__ */ jsx(FormProvider, { children: /* @__PURE__ */ jsx(TableSelectorParamsProvider, { params: {}, children: /* @__PURE__ */ jsx(SchemaComponentOptions, { scope: { usePickActionProps: k, useTableSelectorProps: useTableSelectorProps$2 }, children: /* @__PURE__ */ jsx(
33295
33296
  RecursionField,
33296
33297
  {
33297
33298
  onlyRenderProperties: !0,
@@ -33320,7 +33321,7 @@ const InternalFileManager = (e) => {
33320
33321
  ]), [l, c] = useState(t), [u, d] = useState(!1), p = useCompile(), m = useAPIClient(), h = useServiceOptions$1(e), { options: x, field: f } = useAssociationFieldContext(), C = m.resource(x.target), { getCollectionJoinField: S, getInterface: b } = useCollectionManager_deprecated(), y = (z = f == null ? void 0 : f.componentProps) == null ? void 0 : z.fieldNames, v = (x == null ? void 0 : x.target) && (y == null ? void 0 : y.label) && S(`${x.target}.${y.label}`), I = useMemo(() => {
33321
33322
  var O, R;
33322
33323
  return v != null && v.interface && ((R = (O = b(v.interface)) == null ? void 0 : O.filterable) == null ? void 0 : R.operators[0].value) || "$includes";
33323
- }, [v]), A = useField();
33324
+ }, [v]), k = useField();
33324
33325
  useEffect(() => {
33325
33326
  var O;
33326
33327
  if (r) {
@@ -33332,7 +33333,7 @@ const InternalFileManager = (e) => {
33332
33333
  a(j);
33333
33334
  }
33334
33335
  }, []);
33335
- const k = useCallback(
33336
+ const A = useCallback(
33336
33337
  (O) => {
33337
33338
  try {
33338
33339
  return O == null ? void 0 : O.filter((R) => ["number", "string"].includes(typeof R[y.value])).map((R) => {
@@ -33375,7 +33376,7 @@ const InternalFileManager = (e) => {
33375
33376
  const B = yield w({ parentId: R == null ? void 0 : R.id }), T = [...i];
33376
33377
  if (T.splice(j + 1), T[j] = F(g({}, T[j]), { value: R }), R != null && R.id && (T[j + 1] = { key: R == null ? void 0 : R.id, children: (B == null ? void 0 : B.length) > 0 ? B : null }), a(T), ["o2m", "m2m"].includes(x.interface)) {
33377
33378
  const D = Array.isArray(f.fieldValue) ? f.fieldValue : [];
33378
- D[A.index] = R, f.fieldValue = D;
33379
+ D[k.index] = R, f.fieldValue = D;
33379
33380
  } else
33380
33381
  f.value = R;
33381
33382
  n == null || n(T);
@@ -33421,7 +33422,7 @@ const InternalFileManager = (e) => {
33421
33422
  fieldNames: y,
33422
33423
  style: { minWidth: 150 },
33423
33424
  onChange: (D, $) => M(D, $, R),
33424
- options: u ? [] : k(l),
33425
+ options: u ? [] : A(l),
33425
33426
  onDropdownVisibleChange: (D) => N(D, O, R),
33426
33427
  notFoundContent: u ? /* @__PURE__ */ jsx(Spin, { size: "small" }) : null
33427
33428
  },
@@ -33616,7 +33617,7 @@ const InternalNesterCss = css`
33616
33617
  }, InternalPicker = observer$1(
33617
33618
  (e) => {
33618
33619
  var O;
33619
- const z = e, { value: t, multiple: o, openSize: n, onChange: r, quickUpload: i, selectFile: a, shouldMountElement: l } = z, c = H(z, ["value", "multiple", "openSize", "onChange", "quickUpload", "selectFile", "shouldMountElement"]), u = useField(), d = useFieldNames$1(e), [p, m] = useState(!1), h = useFieldSchema(), x = useInsertSchema("Selector"), { options: f } = useAssociationFieldContext(), { collectionName: C } = useFormBlockContext(), S = useCompile(), b = useLabelUiSchema$1(f, (d == null ? void 0 : d.label) || "label"), y = h["x-add-new"], [v, I] = useState([]), A = useCollectionRecordData(), k = useMemo(() => t && Object.keys(t).length > 0 ? (Array.isArray(t) ? t : t ? [t] : []).filter(Boolean).map((j) => {
33620
+ const z = e, { value: t, multiple: o, openSize: n, onChange: r, quickUpload: i, selectFile: a, shouldMountElement: l } = z, c = H(z, ["value", "multiple", "openSize", "onChange", "quickUpload", "selectFile", "shouldMountElement"]), u = useField(), d = useFieldNames$1(e), [p, m] = useState(!1), h = useFieldSchema(), x = useInsertSchema("Selector"), { options: f } = useAssociationFieldContext(), { collectionName: C } = useFormBlockContext(), S = useCompile(), b = useLabelUiSchema$1(f, (d == null ? void 0 : d.label) || "label"), y = h["x-add-new"], [v, I] = useState([]), k = useCollectionRecordData(), A = useMemo(() => t && Object.keys(t).length > 0 ? (Array.isArray(t) ? t : t ? [t] : []).filter(Boolean).map((j) => {
33620
33621
  const B = j == null ? void 0 : j[d.label];
33621
33622
  return F(g({}, j), {
33622
33623
  [d.label]: getLabelFormatValue$1(S(b), S(B))
@@ -33628,7 +33629,7 @@ const InternalNesterCss = css`
33628
33629
  association: {
33629
33630
  target: f == null ? void 0 : f.target
33630
33631
  },
33631
- options: k,
33632
+ options: A,
33632
33633
  onChange: e == null ? void 0 : e.onChange,
33633
33634
  selectedRows: v,
33634
33635
  setSelectedRows: I,
@@ -33638,7 +33639,7 @@ const InternalNesterCss = css`
33638
33639
  var R;
33639
33640
  return o == null ? null : Array.isArray(t) ? (R = t.filter(Boolean)) == null ? void 0 : R.map((j) => j == null ? void 0 : j[d.value]) : t == null ? void 0 : t[d.value];
33640
33641
  }, N = () => {
33641
- const R = (f == null ? void 0 : f.targetKey) || "id", j = k.map((T) => T[R]).filter(Boolean);
33642
+ const R = (f == null ? void 0 : f.targetKey) || "id", j = A.map((T) => T[R]).filter(Boolean);
33642
33643
  return j.length ? { $and: [{ [`${R}.$ne`]: j }] } : {};
33643
33644
  }, E = () => {
33644
33645
  const { setVisible: R } = useActionContext(), { multiple: j, selectedRows: B, onChange: T, options: D, collectionField: $ } = useContext(RecordPickerContext);
@@ -33674,7 +33675,7 @@ const InternalNesterCss = css`
33674
33675
  r([]), I([]);
33675
33676
  return;
33676
33677
  }
33677
- const j = k == null ? void 0 : k.filter((B) => R.includes(B[d.value]));
33678
+ const j = A == null ? void 0 : A.filter((B) => R.includes(B[d.value]));
33678
33679
  r(j), I(j);
33679
33680
  }
33680
33681
  } else {
@@ -33682,12 +33683,12 @@ const InternalNesterCss = css`
33682
33683
  r(j), I(j);
33683
33684
  }
33684
33685
  },
33685
- options: k,
33686
+ options: A,
33686
33687
  value: M(),
33687
33688
  open: !1
33688
33689
  })
33689
33690
  ) }),
33690
- y && /* @__PURE__ */ jsx(RecordProvider, { isNew: !0, record: null, parent: A, children: /* @__PURE__ */ jsx(ClearCollectionFieldContext, { children: /* @__PURE__ */ jsx(
33691
+ y && /* @__PURE__ */ jsx(RecordProvider, { isNew: !0, record: null, parent: k, children: /* @__PURE__ */ jsx(ClearCollectionFieldContext, { children: /* @__PURE__ */ jsx(
33691
33692
  RecursionField,
33692
33693
  {
33693
33694
  onlyRenderProperties: !0,
@@ -33738,7 +33739,7 @@ const ReadPrettyInternalViewer = observer$1(
33738
33739
  var N;
33739
33740
  const t = useFieldSchema(), o = useRecord(), { getCollection: n } = useCollectionManager_deprecated(), { enableLink: r } = t["x-component-props"] || {}, i = useField(), a = useFieldNames$1(e), [l, c] = useState(!1), u = useInsertSchema("Viewer"), { options: d } = useAssociationFieldContext(), [p, m] = useState({}), h = useCompile(), { designable: x } = useDesignable(), { snapshot: f } = useActionContext(), C = n(d == null ? void 0 : d.target), S = (C == null ? void 0 : C.template) === "tree", b = useRef(), y = useLabelUiSchemaV2(), [v, I] = useState(!1);
33740
33741
  useTranslation();
33741
- const k = /* @__PURE__ */ jsx(EllipsisWithTooltip, { ellipsis: !0, ref: b, children: toArr$3(e.value).map((E, z, O) => {
33742
+ const A = /* @__PURE__ */ jsx(EllipsisWithTooltip, { ellipsis: !0, ref: b, children: toArr$3(e.value).map((E, z, O) => {
33742
33743
  const R = E == null ? void 0 : E[(a == null ? void 0 : a.label) || "label"], j = S ? transformNestedData(E).map(($) => $ == null ? void 0 : $[(a == null ? void 0 : a.label) || "label"]).join(" / ") : isObject(R) ? JSON.stringify(R) : R, B = toValue$4(h(j), "N/A"), T = y(
33743
33744
  (E == null ? void 0 : E.__collection) || (d == null ? void 0 : d.target),
33744
33745
  (a == null ? void 0 : a.label) || "label"
@@ -33761,7 +33762,7 @@ const ReadPrettyInternalViewer = observer$1(
33761
33762
  ] }, `${E == null ? void 0 : E.id}_${z}`);
33762
33763
  }) });
33763
33764
  if (r === !1 || !v)
33764
- return k;
33765
+ return A;
33765
33766
  const w = () => /* @__PURE__ */ jsx(VariablePopupRecordProvider, { recordData: p, collection: C, children: /* @__PURE__ */ jsx(WithoutTableFieldResource.Provider, { value: !0, children: /* @__PURE__ */ jsx(FormProvider, { children: /* @__PURE__ */ jsx(
33766
33767
  RecursionField,
33767
33768
  {
@@ -33776,7 +33777,7 @@ const ReadPrettyInternalViewer = observer$1(
33776
33777
  return E && E.length > 2 ? /* @__PURE__ */ jsx(RecordProvider, { record: p, parent: o[E[1]], children: w() }) : /* @__PURE__ */ jsx(RecordProvider, { record: p, parent: o, children: w() });
33777
33778
  };
33778
33779
  return /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(BlockAssociationContext.Provider, { value: `${d == null ? void 0 : d.collectionName}.${d == null ? void 0 : d.name}`, children: /* @__PURE__ */ jsxs(CollectionProvider_deprecated, { name: (N = d == null ? void 0 : d.target) != null ? N : d == null ? void 0 : d.targetCollection, children: [
33779
- k,
33780
+ A,
33780
33781
  /* @__PURE__ */ jsx(
33781
33782
  ActionContextProvider,
33782
33783
  {
@@ -34028,8 +34029,8 @@ function getLinkageCollection(e, t, o) {
34028
34029
  }
34029
34030
  const CreateAction = observer$1(
34030
34031
  (e) => {
34031
- var k;
34032
- const { onClick: t } = e, o = useCollection_deprecated(), n = useFieldSchema(), r = useField(), i = useForm(), a = useVariables(), l = useAclCheckFn(), c = n["x-enable-children"] || [], u = n == null ? void 0 : n["x-allow-add-to-current"], d = (k = n == null ? void 0 : n["x-component-props"]) == null ? void 0 : k.linkageFromForm, p = r.componentProps.type === "danger" ? void 0 : r.componentProps.type || "primary", { getChildrenCollections: m } = useCollectionManager_deprecated(), h = m(o.name), x = useMemo(() => c.map((w) => {
34032
+ var A;
34033
+ const { onClick: t } = e, o = useCollection_deprecated(), n = useFieldSchema(), r = useField(), i = useForm(), a = useVariables(), l = useAclCheckFn(), c = n["x-enable-children"] || [], u = n == null ? void 0 : n["x-allow-add-to-current"], d = (A = n == null ? void 0 : n["x-component-props"]) == null ? void 0 : A.linkageFromForm, p = r.componentProps.type === "danger" ? void 0 : r.componentProps.type || "primary", { getChildrenCollections: m } = useCollectionManager_deprecated(), h = m(o.name), x = useMemo(() => c.map((w) => {
34033
34034
  if (!w)
34034
34035
  return;
34035
34036
  const M = h.find((N) => N.name === w.collection);
@@ -34041,7 +34042,7 @@ const CreateAction = observer$1(
34041
34042
  key: w.name,
34042
34043
  label: b(w.title),
34043
34044
  onClick: () => t == null ? void 0 : t(w)
34044
- })), [x, t]), A = useMemo(() => ({
34045
+ })), [x, t]), k = useMemo(() => ({
34045
34046
  items: I
34046
34047
  }), [I]);
34047
34048
  return useEffect(() => {
@@ -34065,7 +34066,7 @@ const CreateAction = observer$1(
34065
34066
  allowAddToCurrent: u,
34066
34067
  props: e,
34067
34068
  componentType: p,
34068
- menu: A,
34069
+ menu: k,
34069
34070
  onClick: t,
34070
34071
  collection: o,
34071
34072
  icon: v,
@@ -34107,8 +34108,8 @@ function FinallyButton({
34107
34108
  danger: n.danger,
34108
34109
  icon: c,
34109
34110
  onClick: (v) => {
34110
- const I = getLinkageCollection(t, d, u), A = e.find((w) => w.name === I) ? I : l.name, k = m(A);
34111
- a == null || a(k);
34111
+ const I = getLinkageCollection(t, d, u), k = e.find((w) => w.name === I) ? I : l.name, A = m(k);
34112
+ a == null || a(A);
34112
34113
  },
34113
34114
  style: g({
34114
34115
  display: !p && ((C = u == null ? void 0 : u.data) == null ? void 0 : C.hidden) && "none",
@@ -34323,18 +34324,18 @@ const CreateRecordAction$1 = forwardRef(InternalCreateRecordAction), initializer
34323
34324
  ), toValue$3 = (e, t) => e == null ? t : e, ReadPrettyInternalTag = observer$1(
34324
34325
  (e) => {
34325
34326
  var E;
34326
- const t = useFieldSchema(), o = useRecord(), { enableLink: n, tagColorField: r } = t["x-component-props"], i = useField(), a = useFieldNames$1(e), [l, c] = useState(!1), u = useInsertSchema("Viewer"), { options: d } = useAssociationFieldContext(), [p, m] = useState({}), h = useCompile(), { designable: x } = useDesignable(), f = useLabelUiSchema$1(d, (a == null ? void 0 : a.label) || "label"), { snapshot: C } = useActionContext(), S = useRef(), { getCollection: b } = useCollectionManager_deprecated(), y = b(d == null ? void 0 : d.target), v = (y == null ? void 0 : y.template) === "tree", [I, A] = useState(!1), w = /* @__PURE__ */ jsx(EllipsisWithTooltip, { ellipsis: !0, ref: S, children: toArr$3(e.value).map((z, O, R) => {
34327
+ const t = useFieldSchema(), o = useRecord(), { enableLink: n, tagColorField: r } = t["x-component-props"], i = useField(), a = useFieldNames$1(e), [l, c] = useState(!1), u = useInsertSchema("Viewer"), { options: d } = useAssociationFieldContext(), [p, m] = useState({}), h = useCompile(), { designable: x } = useDesignable(), f = useLabelUiSchema$1(d, (a == null ? void 0 : a.label) || "label"), { snapshot: C } = useActionContext(), S = useRef(), { getCollection: b } = useCollectionManager_deprecated(), y = b(d == null ? void 0 : d.target), v = (y == null ? void 0 : y.template) === "tree", [I, k] = useState(!1), w = /* @__PURE__ */ jsx(EllipsisWithTooltip, { ellipsis: !0, ref: S, children: toArr$3(e.value).map((z, O, R) => {
34327
34328
  const j = z == null ? void 0 : z[(a == null ? void 0 : a.label) || "label"], B = v ? transformNestedData(z).map(($) => $ == null ? void 0 : $[(a == null ? void 0 : a.label) || "label"]).join(" / ") : isObject(j) ? JSON.stringify(j) : j, T = toValue$3(h(B), "N/A"), D = getTabFormatValue(h(f), T, z[r]);
34328
34329
  return /* @__PURE__ */ jsxs(Fragment$1, { children: [
34329
34330
  /* @__PURE__ */ jsx("span", { children: C ? D : n !== !1 ? /* @__PURE__ */ jsx(
34330
34331
  "a",
34331
34332
  {
34332
34333
  onMouseEnter: () => {
34333
- A(!0);
34334
+ k(!0);
34334
34335
  },
34335
34336
  onClick: ($) => {
34336
34337
  var q;
34337
- A(!0), $.stopPropagation(), $.preventDefault(), x && u(schema$1.Viewer), c(!0), m(z), (q = S == null ? void 0 : S.current) == null || q.setPopoverVisible(!1);
34338
+ k(!0), $.stopPropagation(), $.preventDefault(), x && u(schema$1.Viewer), c(!0), m(z), (q = S == null ? void 0 : S.current) == null || q.setPopoverVisible(!1);
34338
34339
  },
34339
34340
  children: D
34340
34341
  }
@@ -34404,46 +34405,54 @@ const CreateRecordAction$1 = forwardRef(InternalCreateRecordAction), initializer
34404
34405
  const t = useField();
34405
34406
  return e.field || t;
34406
34407
  };
34408
+ function getSchemaArrJSON(e) {
34409
+ return e.map((t) => t.name === "actions" ? omit$1(t.toJSON(), "properties") : t.toJSON());
34410
+ }
34407
34411
  function adjustColumnOrder(e) {
34408
34412
  const t = [], o = [], n = [];
34409
34413
  return e.forEach((r) => {
34410
34414
  r.fixed === "left" ? t.push(r) : r.fixed === "right" ? n.push(r) : o.push(r);
34411
34415
  }), [...t, ...o, ...n];
34412
34416
  }
34413
- const useTableColumns$1 = (e) => {
34414
- const { token: t } = useToken(), o = useArrayField(e), n = useFieldSchema(), { schemaInWhitelist: r } = useACLFieldWhitelist(), { designable: i } = useDesignable(), { exists: a, render: l } = useSchemaInitializerRender(n["x-initializer"], n["x-initializer-props"]), c = useCollectionParentRecordData(), u = n.reduceProperties((x, f) => isColumnComponent$1(f) && r(Object.values(f.properties || {}).pop()) ? x.concat([f]) : x, []), d = useMemo(() => css`
34417
+ const useColumnsDeepMemoized = (e) => {
34418
+ const t = getSchemaArrJSON(e), o = useCreation(() => ({ value: _.cloneDeep(t) }), []);
34419
+ return _.isEqual(t, o.value) || (o.value = _.cloneDeep(t)), o.value;
34420
+ }, useTableColumns$1 = (e) => {
34421
+ const { token: t } = useToken(), o = useArrayField(e), n = useFieldSchema(), { schemaInWhitelist: r } = useACLFieldWhitelist(), { designable: i } = useDesignable(), { exists: a, render: l } = useSchemaInitializerRender(n["x-initializer"], n["x-initializer-props"]), c = useCollectionParentRecordData(), u = n.reduceProperties((f, C) => isColumnComponent$1(C) && r(Object.values(C.properties || {}).pop()) ? f.concat([C]) : f, []), d = useColumnsDeepMemoized(u), p = useMemo(() => css`
34415
34422
  .nb-action-link {
34416
34423
  margin: -${t.paddingContentVerticalLG}px -${t.marginSM}px;
34417
34424
  padding: ${t.paddingContentVerticalLG}px ${t.margin}px;
34418
34425
  }
34419
- `, [t.paddingContentVerticalLG, t.marginSM]), p = useCollection(), m = useMemo(
34420
- () => u == null ? void 0 : u.map((x) => {
34421
- var S;
34422
- const f = x.reduceProperties((b, y) => {
34423
- if (isCollectionFieldComponent(y))
34424
- return b.concat([y]);
34425
- }, []), C = (f == null ? void 0 : f.length) > 0 ? f[0].name : x.name;
34426
+ `, [t.paddingContentVerticalLG, t.marginSM]), m = useCollection(), h = useMemo(
34427
+ () => u == null ? void 0 : u.map((f) => {
34428
+ var b;
34429
+ const C = f.reduceProperties((y, v) => {
34430
+ if (isCollectionFieldComponent(v))
34431
+ return y.concat([v]);
34432
+ }, []), S = (C == null ? void 0 : C.length) > 0 ? C[0].name : f.name;
34426
34433
  return F(g({
34427
- title: /* @__PURE__ */ jsx(RecursionField, { name: x.name, schema: x, onlyRenderSelf: !0 }),
34428
- dataIndex: C,
34429
- key: x.name,
34430
- sorter: (S = x["x-component-props"]) == null ? void 0 : S.sorter,
34434
+ title: /* @__PURE__ */ jsx(RecursionField, { name: f.name, schema: f, onlyRenderSelf: !0 }),
34435
+ dataIndex: S,
34436
+ key: f.name,
34437
+ sorter: (b = f["x-component-props"]) == null ? void 0 : b.sorter,
34431
34438
  width: 200
34432
- }, x["x-component-props"]), {
34433
- render: (b, y) => {
34439
+ }, f["x-component-props"]), {
34440
+ render: (y, v) => {
34434
34441
  var A;
34435
- const v = (A = o.value) == null ? void 0 : A.indexOf(y), I = o.address.concat(y.__index || v);
34436
- return /* @__PURE__ */ jsx(SubFormProvider, { value: { value: y, collection: p }, children: /* @__PURE__ */ jsx(RecordIndexProvider, { index: y.__index || v, children: /* @__PURE__ */ jsx(RecordProvider, { isNew: isNewRecord(y), record: y, parent: c, children: /* @__PURE__ */ jsx(ColumnFieldProvider, { schema: x, basePath: I, children: /* @__PURE__ */ jsx("span", { role: "button", className: d, children: /* @__PURE__ */ jsx(RecursionField, { basePath: I, schema: x, onlyRenderProperties: !0 }) }) }) }) }) });
34442
+ const I = (A = o.value) == null ? void 0 : A.indexOf(v), k = o.address.concat(v.__index || I);
34443
+ return /* @__PURE__ */ jsx(SubFormProvider, { value: { value: v, collection: m }, children: /* @__PURE__ */ jsx(RecordIndexProvider, { index: v.__index || I, children: /* @__PURE__ */ jsx(RecordProvider, { isNew: isNewRecord(v), record: v, parent: c, children: /* @__PURE__ */ jsx(ColumnFieldProvider, { schema: f, basePath: k, children: /* @__PURE__ */ jsx("span", { role: "button", className: p, children: /* @__PURE__ */ jsx(RecursionField, { basePath: k, schema: f, onlyRenderProperties: !0 }) }) }) }) }) });
34437
34444
  }
34438
34445
  });
34439
34446
  }),
34440
- [u, o.value, o.address, p, c, d]
34447
+ // 这里不能把 columnsSchema 作为依赖,因为其每次都会变化,这里使用 hasChangedColumns 作为依赖
34448
+ // eslint-disable-next-line react-hooks/exhaustive-deps
34449
+ [d, o.value, o.address, m, c, p]
34441
34450
  );
34442
34451
  return useMemo(() => {
34443
34452
  if (!a)
34444
- return m;
34445
- const x = [
34446
- ...m,
34453
+ return h;
34454
+ const f = [
34455
+ ...h,
34447
34456
  {
34448
34457
  title: l(),
34449
34458
  dataIndex: "TABLE_COLUMN_INITIALIZER",
@@ -34452,29 +34461,29 @@ const useTableColumns$1 = (e) => {
34452
34461
  fixed: i ? "right" : "none"
34453
34462
  }
34454
34463
  ];
34455
- return e.showDel && x.push({
34464
+ return e.showDel && f.push({
34456
34465
  title: "",
34457
34466
  key: "delete",
34458
34467
  width: 60,
34459
34468
  align: "center",
34460
34469
  fixed: "right",
34461
- render: (f, C, S) => /* @__PURE__ */ jsx(
34470
+ render: (C, S, b) => /* @__PURE__ */ jsx(
34462
34471
  DeleteOutlined,
34463
34472
  {
34464
34473
  style: { cursor: "pointer" },
34465
34474
  onClick: () => {
34466
34475
  action(() => {
34467
- var b;
34476
+ var y;
34468
34477
  return spliceArrayState(o, {
34469
- startIndex: S,
34478
+ startIndex: b,
34470
34479
  deleteCount: 1
34471
- }), o.value.splice(S, 1), (b = o.initialValue) == null || b.splice(S, 1), o.onInput(o.value);
34480
+ }), o.value.splice(b, 1), (y = o.initialValue) == null || y.splice(b, 1), o.onInput(o.value);
34472
34481
  });
34473
34482
  }
34474
34483
  }
34475
34484
  )
34476
- }), adjustColumnOrder(x);
34477
- }, [m, a, o, l, e.showDel, i]);
34485
+ }), adjustColumnOrder(f);
34486
+ }, [h, a, o, l, e.showDel, i]);
34478
34487
  }, SortableRow = (e) => {
34479
34488
  var u, d, p, m, h, x;
34480
34489
  const { token: t } = useToken(), o = (u = e["data-row-key"]) == null ? void 0 : u.toString(), { setNodeRef: n, isOver: r, active: i, over: a } = useSortable({
@@ -34601,7 +34610,7 @@ const useTableColumns$1 = (e) => {
34601
34610
  "onExpand",
34602
34611
  "loading",
34603
34612
  "onClickRow"
34604
- ]), b = useArrayField(S), y = useTableColumns$1(S), v = useFieldSchema(), I = useCollection(), k = ((me = v == null ? void 0 : v.parent) == null ? void 0 : me["x-decorator"]) === "TableSelectorProvider" ? useTableSelectorContext() : useTableBlockContext(), { expandFlag: w, allIncludesChildren: M } = k, N = useMemoizedFn(S.onRowDragEnd || (() => {
34613
+ ]), b = useArrayField(S), y = useTableColumns$1(S), v = useFieldSchema(), I = useCollection(), A = ((me = v == null ? void 0 : v.parent) == null ? void 0 : me["x-decorator"]) === "TableSelectorProvider" ? useTableSelectorContext() : useTableBlockContext(), { expandFlag: w, allIncludesChildren: M } = A, N = useMemoizedFn(S.onRowDragEnd || (() => {
34605
34614
  })), E = usePaginationProps$1(o, i), [z, O] = useState(() => w ? M : []), [R, j] = useState(((he = b == null ? void 0 : b.data) == null ? void 0 : he.selectedRowKeys) || []), [B, T] = useState([]), D = (p == null ? void 0 : p.type) !== "none", $ = useRef(/* @__PURE__ */ new Map()), q = useMemo(() => css`
34606
34615
  & > td {
34607
34616
  background-color: ${t.controlItemBgActiveHover} !important;
@@ -34861,8 +34870,8 @@ const useTableColumns$1 = (e) => {
34861
34870
  const { openSize: t } = e, { field: o, options: n } = useAssociationFieldContext(), { t: r } = useTranslation(), [i, a] = useState(!1), [l, c] = useState([]), u = useFieldNames$1(e), d = useFieldSchema(), p = useCompile(), m = useLabelUiSchema$1(n, (u == null ? void 0 : u.label) || "label"), h = useCollectionRecord(), x = useCollection(), f = (v, I) => {
34862
34871
  if (I !== void 0 && isArr(o.value) && v !== I)
34863
34872
  return action(() => {
34864
- const A = o.value[v];
34865
- return o.value.splice(v, 1), o.value.splice(I, 0, A), exchangeArrayState(o, {
34873
+ const k = o.value[v];
34874
+ return o.value.splice(v, 1), o.value.splice(I, 0, k), exchangeArrayState(o, {
34866
34875
  fromIndex: v,
34867
34876
  toIndex: I
34868
34877
  }), o.onInput(o.value);
@@ -34870,9 +34879,9 @@ const useTableColumns$1 = (e) => {
34870
34879
  };
34871
34880
  o.move = f;
34872
34881
  const C = useMemo(() => o.value && Object.keys(o.value).length > 0 ? (Array.isArray(o.value) ? o.value : o.value ? [o.value] : []).filter(Boolean).map((I) => {
34873
- const A = I == null ? void 0 : I[u.label];
34882
+ const k = I == null ? void 0 : I[u.label];
34874
34883
  return F(g({}, I), {
34875
- [u.label]: getLabelFormatValue$1(p(m), p(A))
34884
+ [u.label]: getLabelFormatValue$1(p(m), p(k))
34876
34885
  });
34877
34886
  }) : [], [o.value, u == null ? void 0 : u.label]), S = {
34878
34887
  size: "small",
@@ -34887,14 +34896,14 @@ const useTableColumns$1 = (e) => {
34887
34896
  setSelectedRows: c,
34888
34897
  collectionField: n
34889
34898
  }, b = () => {
34890
- const { setVisible: v } = useActionContext(), { selectedRows: I, setSelectedRows: A } = useContext(RecordPickerContext);
34899
+ const { setVisible: v } = useActionContext(), { selectedRows: I, setSelectedRows: k } = useContext(RecordPickerContext);
34891
34900
  return {
34892
34901
  onClick() {
34893
- I.map((k) => o.value.push(k)), o.onInput(o.value), A([]), v(!1);
34902
+ I.map((A) => o.value.push(A)), o.onInput(o.value), k([]), v(!1);
34894
34903
  }
34895
34904
  };
34896
34905
  }, y = () => {
34897
- const v = (n == null ? void 0 : n.targetKey) || "id", I = (o.value || []).map((k) => k[v]).filter(Boolean);
34906
+ const v = (n == null ? void 0 : n.targetKey) || "id", I = (o.value || []).map((A) => A[v]).filter(Boolean);
34898
34907
  return I.length ? { $and: [{ [`${v}.$ne`]: I }] } : {};
34899
34908
  };
34900
34909
  return /* @__PURE__ */ jsxs("div", { className: subTableContainer, children: [
@@ -35062,8 +35071,8 @@ const ReadPretty$7 = observer$1(
35062
35071
  ), AssociationSelect = InternalAssociationSelect;
35063
35072
  AssociationSelect.Designer = function e() {
35064
35073
  var j, B, T, D, $, q, L, G, U, K, Y;
35065
- const { getCollectionFields: t, getInterface: o, getCollectionJoinField: n, 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: x } = useDesignable(), f = useCompile(), C = useIsShowMultipleSwitch(), { isAllowToSetDefaultValue: S } = useIsAllowToSetDefaultValue(), b = a(u.name) || n(u["x-collection-field"]), y = useFieldComponentOptions(), v = c.address.segments.includes("__form_grid"), I = o(b == null ? void 0 : b.interface), A = (j = I == null ? void 0 : I.validateSchema) == null ? void 0 : j.call(I, u), k = (B = b == null ? void 0 : b.uiSchema) == null ? void 0 : B.title, w = b != null && b.target ? t(b == null ? void 0 : b.target) : [];
35066
- c.title === k || c.title;
35074
+ const { getCollectionFields: t, getInterface: o, getCollectionJoinField: n, 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: x } = useDesignable(), f = useCompile(), C = useIsShowMultipleSwitch(), { isAllowToSetDefaultValue: S } = useIsAllowToSetDefaultValue(), b = a(u.name) || n(u["x-collection-field"]), y = useFieldComponentOptions(), v = c.address.segments.includes("__form_grid"), I = o(b == null ? void 0 : b.interface), k = (j = I == null ? void 0 : I.validateSchema) == null ? void 0 : j.call(I, u), A = (B = b == null ? void 0 : b.uiSchema) == null ? void 0 : B.title, w = b != null && b.target ? t(b == null ? void 0 : b.target) : [];
35075
+ c.title === A || c.title;
35067
35076
  const M = useSortFields(b == null ? void 0 : b.target), N = (($ = (D = (T = c.componentProps) == null ? void 0 : T.service) == null ? void 0 : D.params) == null ? void 0 : $.sort) || [];
35068
35077
  useEffect(() => {
35069
35078
  c.readPretty !== u["x-read-pretty"] && (c.readPretty = !!u["x-read-pretty"]);
@@ -35088,7 +35097,7 @@ AssociationSelect.Designer = function e() {
35088
35097
  const R = _.omit(u, "required");
35089
35098
  return /* @__PURE__ */ jsxs(GeneralSchemaDesigner, { children: [
35090
35099
  /* @__PURE__ */ jsx(GeneralSchemaItems, {}),
35091
- l && !(l != null && l.readPretty) && A && /* @__PURE__ */ jsx(
35100
+ l && !(l != null && l.readPretty) && k && /* @__PURE__ */ jsx(
35092
35101
  SchemaSettingsModalItem,
35093
35102
  {
35094
35103
  title: d("Set validation rules"),
@@ -35127,7 +35136,7 @@ AssociationSelect.Designer = function e() {
35127
35136
  labelCol: 8,
35128
35137
  wrapperCol: 16
35129
35138
  },
35130
- properties: F(g({}, A), {
35139
+ properties: F(g({}, k), {
35131
35140
  message: {
35132
35141
  type: "string",
35133
35142
  title: '{{ t("Error message") }}',
@@ -35460,10 +35469,10 @@ AssociationSelect.Designer = function e() {
35460
35469
  ] });
35461
35470
  };
35462
35471
  AssociationSelect.FilterDesigner = function e() {
35463
- var I, A, k, w, M, N, E, z, O, R, j;
35464
- const { getCollectionFields: t, getInterface: o, getCollectionJoinField: n } = 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) || n(l["x-collection-field"]), h = o(m == null ? void 0 : m.interface), x = (I = h == null ? void 0 : h.validateSchema) == null ? void 0 : I.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) : [];
35472
+ var I, k, A, w, M, N, E, z, O, R, j;
35473
+ const { getCollectionFields: t, getInterface: o, getCollectionJoinField: n } = 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) || n(l["x-collection-field"]), h = o(m == null ? void 0 : m.interface), x = (I = h == null ? void 0 : h.validateSchema) == null ? void 0 : I.call(h, l), f = (k = m == null ? void 0 : m.uiSchema) == null ? void 0 : k.title, C = m != null && m.target ? t(m == null ? void 0 : m.target) : [];
35465
35474
  a.title === f || a.title;
35466
- const S = useSortFields(m == null ? void 0 : m.target), b = ((M = (w = (k = a.componentProps) == null ? void 0 : k.service) == null ? void 0 : w.params) == null ? void 0 : M.sort) || [], y = b == null ? void 0 : b.map((B) => B.startsWith("-") ? {
35475
+ const S = useSortFields(m == null ? void 0 : m.target), b = ((M = (w = (A = a.componentProps) == null ? void 0 : A.service) == null ? void 0 : w.params) == null ? void 0 : M.sort) || [], y = b == null ? void 0 : b.map((B) => B.startsWith("-") ? {
35467
35476
  field: B.substring(1),
35468
35477
  direction: "desc"
35469
35478
  } : {
@@ -35853,11 +35862,11 @@ const blockDeleteSettings = new SchemaSettings({
35853
35862
  }
35854
35863
  },
35855
35864
  e
35856
- ), C = () => toArr$3(o).map((v) => typeof v == "object" ? v[m.value] : v), S = (v, I) => /* @__PURE__ */ jsx(Space$1, { split: "/", children: v.map((A, k) => {
35857
- if (I[k])
35858
- return /* @__PURE__ */ jsx("span", { children: A }, k);
35859
- const w = toArr$3(o).filter(Boolean).find((M) => M[m.value] === A);
35860
- return /* @__PURE__ */ jsx("span", { children: (w == null ? void 0 : w[m.label]) || A }, k);
35865
+ ), C = () => toArr$3(o).map((v) => typeof v == "object" ? v[m.value] : v), S = (v, I) => /* @__PURE__ */ jsx(Space$1, { split: "/", children: v.map((k, A) => {
35866
+ if (I[A])
35867
+ return /* @__PURE__ */ jsx("span", { children: k }, A);
35868
+ const w = toArr$3(o).filter(Boolean).find((M) => M[m.value] === k);
35869
+ return /* @__PURE__ */ jsx("span", { children: (w == null ? void 0 : w[m.label]) || k }, A);
35861
35870
  }) }), b = (v) => {
35862
35871
  var I;
35863
35872
  v && !((I = t.dataSource) != null && I.length) && f();
@@ -35875,7 +35884,7 @@ const blockDeleteSettings = new SchemaSettings({
35875
35884
  displayRender: S,
35876
35885
  onDropdownVisibleChange: b,
35877
35886
  onChange: (v, I) => {
35878
- n(v && r ? I.map((A) => omit$1(A, [m.children])) : v);
35887
+ n(v && r ? I.map((k) => omit$1(k, [m.children])) || null : v || null);
35879
35888
  }
35880
35889
  })
35881
35890
  );
@@ -37058,7 +37067,7 @@ const InternalListBlockProvider = (e) => {
37058
37067
  }
37059
37068
  },
37060
37069
  onSubmit: ({ sort: v }) => {
37061
- const I = v.map((A) => A.direction === "desc" ? `-${A.field}` : A.field);
37070
+ const I = v.map((k) => k.direction === "desc" ? `-${k.field}` : k.field);
37062
37071
  _.set(r, "x-decorator-props.params.sort", I), a.decoratorProps.params = F(g({}, r["x-decorator-props"].params), { page: 1 }), l.emit("patch", {
37063
37072
  schema: {
37064
37073
  "x-uid": r["x-uid"],
@@ -37539,8 +37548,8 @@ const MarkdownEditor = (e) => {
37539
37548
  const { isDarkTheme: t } = useGlobalTheme(), { componentCls: o, hashId: n } = useStyles$4({ isDarkTheme: t }), { content: r, className: i } = e, a = useField(), l = useFieldSchema(), { dn: c } = useDesignable(), { onSave: u, onCancel: d, form: p } = e, m = useCollectionRecord(), [h, x] = useState(""), f = useVariables(), C = useLocalVariables(), [S, b] = useState(!1);
37540
37549
  useEffect(() => {
37541
37550
  b(!0), V(void 0, null, function* () {
37542
- const A = yield replaceVariableValue(r, f, C), k = yield parseMarkdown(A);
37543
- x(k), b(!1);
37551
+ const k = yield replaceVariableValue(r, f, C), A = yield parseMarkdown(k);
37552
+ x(A), b(!1);
37544
37553
  });
37545
37554
  }, [r, f, C]);
37546
37555
  const y = useMarkdownHeight(), v = useVariableOptions({
@@ -37563,8 +37572,8 @@ const MarkdownEditor = (e) => {
37563
37572
  a.editable = !1, d == null || d();
37564
37573
  },
37565
37574
  onSubmit: (I) => V(void 0, null, function* () {
37566
- var A;
37567
- a.editable = !1, (A = l["x-component-props"]) != null || (l["x-component-props"] = {}), l["x-component-props"].content = I, a.componentProps.content = I, u == null || u(l), c.emit("patch", {
37575
+ var k;
37576
+ a.editable = !1, (k = l["x-component-props"]) != null || (l["x-component-props"] = {}), l["x-component-props"].content = I, a.componentProps.content = I, u == null || u(l), c.emit("patch", {
37568
37577
  schema: {
37569
37578
  "x-uid": l["x-uid"],
37570
37579
  "x-component-props": {
@@ -38233,7 +38242,7 @@ const Menu = observer$1(
38233
38242
  "defaultSelectedKeys",
38234
38243
  "defaultOpenKeys",
38235
38244
  "children"
38236
- ]), { t: d } = useTranslation(), p = useDesigner(), m = useFieldSchema(), { refresh: h } = useDesignable(), x = useAPIClient(), { render: f } = useSchemaInitializerRender(m["x-initializer"], m["x-initializer-props"]), C = useSideMenuRef(), [S, b] = useState(), [y, v] = useState(() => a || (r ? findKeysByUid(m, r) : [])), [I, A] = useState(!1), [k, w] = useState(() => ["inline", "mix"].includes(o) ? l || y : l), M = useMemo(() => {
38245
+ ]), { t: d } = useTranslation(), p = useDesigner(), m = useFieldSchema(), { refresh: h } = useDesignable(), x = useAPIClient(), { render: f } = useSchemaInitializerRender(m["x-initializer"], m["x-initializer-props"]), C = useSideMenuRef(), [S, b] = useState(), [y, v] = useState(() => a || (r ? findKeysByUid(m, r) : [])), [I, k] = useState(!1), [A, w] = useState(() => ["inline", "mix"].includes(o) ? l || y : l), M = useMemo(() => {
38237
38246
  var O;
38238
38247
  let z;
38239
38248
  if (n) {
@@ -38267,10 +38276,10 @@ const Menu = observer$1(
38267
38276
  schema: m,
38268
38277
  mode: o,
38269
38278
  onSelect: t,
38270
- setLoading: A,
38279
+ setLoading: k,
38271
38280
  setDefaultSelectedKeys: v,
38272
38281
  defaultSelectedKeys: y,
38273
- defaultOpenKeys: k,
38282
+ defaultOpenKeys: A,
38274
38283
  selectedKeys: S,
38275
38284
  designable: N,
38276
38285
  render: f,
@@ -38284,7 +38293,7 @@ const Menu = observer$1(
38284
38293
  mode: o,
38285
38294
  sideMenuSchema: M,
38286
38295
  sideMenuRef: C,
38287
- openKeys: k,
38296
+ openKeys: A,
38288
38297
  setOpenKeys: w,
38289
38298
  selectedKeys: S,
38290
38299
  onSelect: t,
@@ -38468,8 +38477,8 @@ const useStyles$3 = createStyles(({ token: e }) => ({
38468
38477
  const S = e.charCodeAt(x - 1), b = e.charCodeAt(x - 2);
38469
38478
  if (isLetter(f)) {
38470
38479
  if (isLetter(S) && isLetter(b)) {
38471
- const y = e.toLowerCase(), v = y.charCodeAt(x), I = y.charCodeAt(x - 1), A = y.charCodeAt(x - 2);
38472
- v - I === I - A && Math.abs(v - I) === 1 && u++;
38480
+ const y = e.toLowerCase(), v = y.charCodeAt(x), I = y.charCodeAt(x - 1), k = y.charCodeAt(x - 2);
38481
+ v - I === I - k && Math.abs(v - I) === 1 && u++;
38473
38482
  }
38474
38483
  } else
38475
38484
  isNum(f) ? isNum(S) && isNum(b) && f - S === S - b && Math.abs(f - S) === 1 && u++ : isSymbol(S) && isSymbol(b) && f - S === S - b && Math.abs(f - S) === 1 && u++;
@@ -38682,10 +38691,10 @@ const useTableSelectorProps = () => {
38682
38691
  const v = e, { value: t, multiple: o, onChange: n, quickUpload: r, selectFile: i } = v, a = H(v, ["value", "multiple", "onChange", "quickUpload", "selectFile"]), l = useFieldNames(e), [c, u] = useState(!1), d = useFieldSchema(), p = useAssociation(e), m = useCompile(), h = useLabelUiSchema(p, (l == null ? void 0 : l.label) || "label"), x = isShowFilePicker(h), [f, C] = useState([]), [S, b] = useState([]);
38683
38692
  useEffect(() => {
38684
38693
  if (t) {
38685
- const I = (Array.isArray(t) ? t : t ? [t] : []).map((A) => {
38686
- const k = A[l.label];
38687
- return F(g({}, A), {
38688
- [l.label]: getLabelFormatValue(h, m(k))
38694
+ const I = (Array.isArray(t) ? t : t ? [t] : []).map((k) => {
38695
+ const A = k[l.label];
38696
+ return F(g({}, k), {
38697
+ [l.label]: getLabelFormatValue(h, m(A))
38689
38698
  });
38690
38699
  });
38691
38700
  b(I);
@@ -38700,8 +38709,8 @@ const useTableSelectorProps = () => {
38700
38709
  multiple: o,
38701
38710
  action: `${p == null ? void 0 : p.target}:create`,
38702
38711
  onChange: (I) => {
38703
- let A = toArr$3(I);
38704
- A.every((k) => k.status !== "uploading") && (A = A.filter((k) => k.status === "done").map((k) => k.response.data), n(o ? [...S, ...A] : A[0]));
38712
+ let k = toArr$3(I);
38713
+ k.every((A) => A.status !== "uploading") && (k = k.filter((A) => A.status === "done").map((A) => A.response.data), n(o ? [...S, ...k] : k[0]));
38705
38714
  }
38706
38715
  }
38707
38716
  ) : /* @__PURE__ */ jsx(
@@ -38721,12 +38730,12 @@ const useTableSelectorProps = () => {
38721
38730
  n([]), C([]);
38722
38731
  return;
38723
38732
  }
38724
- const A = S == null ? void 0 : S.filter((k) => I.includes(k[l.value]));
38725
- n(A), C(A);
38733
+ const k = S == null ? void 0 : S.filter((A) => I.includes(A[l.value]));
38734
+ n(k), C(k);
38726
38735
  }
38727
38736
  } else {
38728
- const A = o ? [] : null;
38729
- n(A), C(A), b([]);
38737
+ const k = o ? [] : null;
38738
+ n(k), C(k), b([]);
38730
38739
  }
38731
38740
  },
38732
38741
  options: S,
@@ -38791,38 +38800,38 @@ function isShowFilePicker(e) {
38791
38800
  }
38792
38801
  const toValue$1 = (e, t) => e == null ? t : e, ReadPrettyRecordPicker = observer$1(
38793
38802
  (e) => {
38794
- var I, A;
38803
+ var I, k;
38795
38804
  const { ellipsis: t } = e, o = useFieldSchema(), n = useRecord(), { getCollectionJoinField: r } = useCollectionManager_deprecated(), i = useFieldNames(e), [a, l] = useState(!1), { getField: c } = useCollection_deprecated(), u = c(o.name) || r(o == null ? void 0 : o["x-collection-field"]), [d, p] = useState({}), m = useCompile(), h = useLabelUiSchema(u, (i == null ? void 0 : i.label) || "label"), x = isShowFilePicker(h), { snapshot: f } = useActionContext(), C = ((I = o["x-component-props"]) == null ? void 0 : I.mode) === "tags", S = useRef();
38796
38805
  if (x)
38797
38806
  return u ? /* @__PURE__ */ jsx(Preview, g({}, e)) : null;
38798
- const b = () => toArr$3(e.value).map((k, w, M) => {
38799
- const N = toValue$1(m(k == null ? void 0 : k[(i == null ? void 0 : i.label) || "label"]), "N/A"), E = getLabelFormatValue(h, N, !0);
38807
+ const b = () => toArr$3(e.value).map((A, w, M) => {
38808
+ const N = toValue$1(m(A == null ? void 0 : A[(i == null ? void 0 : i.label) || "label"]), "N/A"), E = getLabelFormatValue(h, N, !0);
38800
38809
  return /* @__PURE__ */ jsxs(Fragment$1, { children: [
38801
38810
  /* @__PURE__ */ jsx("span", { className: "test-record-picker-read-pretty-item", children: f || C ? E : /* @__PURE__ */ jsx(
38802
38811
  "a",
38803
38812
  {
38804
38813
  onClick: (z) => {
38805
38814
  var O;
38806
- z.stopPropagation(), z.preventDefault(), l(!0), p(k), (O = S == null ? void 0 : S.current) == null || O.setPopoverVisible(!1);
38815
+ z.stopPropagation(), z.preventDefault(), l(!0), p(A), (O = S == null ? void 0 : S.current) == null || O.setPopoverVisible(!1);
38807
38816
  },
38808
38817
  children: E
38809
38818
  }
38810
38819
  ) }),
38811
38820
  w < M.length - 1 ? /* @__PURE__ */ jsx("span", { style: { marginRight: 4, color: "#aaa" }, children: "," }) : null
38812
- ] }, `${k[i.value]}_${w}`);
38821
+ ] }, `${A[i.value]}_${w}`);
38813
38822
  }), y = () => /* @__PURE__ */ jsx(WithoutTableFieldResource.Provider, { value: !0, children: /* @__PURE__ */ jsx(FormProvider, { children: /* @__PURE__ */ jsx(
38814
38823
  RecursionField,
38815
38824
  {
38816
38825
  schema: o,
38817
38826
  onlyRenderProperties: !0,
38818
- filterProperties: (k) => k["x-component"] === "RecordPicker.Viewer"
38827
+ filterProperties: (A) => A["x-component"] === "RecordPicker.Viewer"
38819
38828
  }
38820
38829
  ) }) }), v = () => {
38821
38830
  var w;
38822
- const k = (w = o == null ? void 0 : o["x-collection-field"]) == null ? void 0 : w.split(".");
38823
- return k && k.length > 2 ? /* @__PURE__ */ jsx(RecordProvider, { record: d, parent: n[k[1]], children: y() }) : /* @__PURE__ */ jsx(RecordProvider, { record: d, parent: n, children: y() });
38831
+ const A = (w = o == null ? void 0 : o["x-collection-field"]) == null ? void 0 : w.split(".");
38832
+ return A && A.length > 2 ? /* @__PURE__ */ jsx(RecordProvider, { record: d, parent: n[A[1]], children: y() }) : /* @__PURE__ */ jsx(RecordProvider, { record: d, parent: n, children: y() });
38824
38833
  };
38825
- return u ? /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(BlockAssociationContext.Provider, { value: `${u.collectionName}.${u.name}`, children: /* @__PURE__ */ jsxs(CollectionProvider_deprecated, { name: (A = u.target) != null ? A : u.targetCollection, children: [
38834
+ return u ? /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(BlockAssociationContext.Provider, { value: `${u.collectionName}.${u.name}`, children: /* @__PURE__ */ jsxs(CollectionProvider_deprecated, { name: (k = u.target) != null ? k : u.targetCollection, children: [
38826
38835
  /* @__PURE__ */ jsx(EllipsisWithTooltip, { ellipsis: t, ref: S, children: b() }),
38827
38836
  /* @__PURE__ */ jsx(
38828
38837
  ActionContextProvider,
@@ -39621,10 +39630,10 @@ const useStyles$2 = genStyleHook("nb-rich-text", (e) => {
39621
39630
  getCheckboxProps: (y) => ({
39622
39631
  "aria-label": `checkbox-${y.name}`
39623
39632
  }),
39624
- renderCell: (y, v, I, A) => {
39633
+ renderCell: (y, v, I, k) => {
39625
39634
  var M, N;
39626
- const k = (M = e == null ? void 0 : e.pagination) == null ? void 0 : M.current, w = ((N = e == null ? void 0 : e.pagination) == null ? void 0 : N.pageSize) || 20;
39627
- return k && (I = I + (k - 1) * w), /* @__PURE__ */ jsxs(
39635
+ const A = (M = e == null ? void 0 : e.pagination) == null ? void 0 : M.current, w = ((N = e == null ? void 0 : e.pagination) == null ? void 0 : N.pageSize) || 20;
39636
+ return A && (I = I + (A - 1) * w), /* @__PURE__ */ jsxs(
39628
39637
  "div",
39629
39638
  {
39630
39639
  className: cls(
@@ -39687,7 +39696,7 @@ const useStyles$2 = genStyleHook("nb-rich-text", (e) => {
39687
39696
  }
39688
39697
  `
39689
39698
  ),
39690
- children: A
39699
+ children: k
39691
39700
  }
39692
39701
  )
39693
39702
  ]
@@ -39713,8 +39722,8 @@ const useStyles$2 = genStyleHook("nb-rich-text", (e) => {
39713
39722
  {
39714
39723
  handleSelector: ".drag-handle",
39715
39724
  onDragEnd: (y, v) => V(void 0, null, function* () {
39716
- const I = o.value[y], A = o.value[v];
39717
- o.move(y, v), yield h(I, A);
39725
+ const I = o.value[y], k = o.value[v];
39726
+ o.move(y, v), yield h(I, k);
39718
39727
  }),
39719
39728
  lineClassName: css`
39720
39729
  border-bottom: 2px solid ${new TinyColor(t.colorSettings).setAlpha(0.6).toHex8String()} !important;
@@ -40016,9 +40025,9 @@ const useStyles$2 = genStyleHook("nb-rich-text", (e) => {
40016
40025
  }
40017
40026
  },
40018
40027
  onSubmit: ({ filter: v }) => {
40019
- var A;
40028
+ var k;
40020
40029
  const I = o.decoratorProps.request.params || {};
40021
- I.filter = v, o.decoratorProps.request.params = I, n["x-decorator-props"].request.params = I, a.run(F(g({}, (A = a.params) == null ? void 0 : A[0]), { filter: v })), c.emit("patch", {
40030
+ I.filter = v, o.decoratorProps.request.params = I, n["x-decorator-props"].request.params = I, a.run(F(g({}, (k = a.params) == null ? void 0 : k[0]), { filter: v })), c.emit("patch", {
40022
40031
  schema: {
40023
40032
  "x-uid": n["x-uid"],
40024
40033
  "x-decorator-props": n["x-decorator-props"]
@@ -40103,14 +40112,14 @@ const useStyles$2 = genStyleHook("nb-rich-text", (e) => {
40103
40112
  }
40104
40113
  },
40105
40114
  onSubmit: ({ sort: v }) => {
40106
- var k;
40107
- const I = v.map((w) => w.direction === "desc" ? `-${w.field}` : w.field), A = o.decoratorProps.request.params || {};
40108
- A.sort = I, o.decoratorProps.request.params = A, n["x-decorator-props"].request.params = A, c.emit("patch", {
40115
+ var A;
40116
+ const I = v.map((w) => w.direction === "desc" ? `-${w.field}` : w.field), k = o.decoratorProps.request.params || {};
40117
+ k.sort = I, o.decoratorProps.request.params = k, n["x-decorator-props"].request.params = k, c.emit("patch", {
40109
40118
  schema: {
40110
40119
  "x-uid": n["x-uid"],
40111
40120
  "x-decorator-props": n["x-decorator-props"]
40112
40121
  }
40113
- }), a.run(F(g({}, (k = a.params) == null ? void 0 : k[0]), { sort: I }));
40122
+ }), a.run(F(g({}, (A = a.params) == null ? void 0 : A[0]), { sort: I }));
40114
40123
  }
40115
40124
  }
40116
40125
  ),
@@ -40127,9 +40136,9 @@ const useStyles$2 = genStyleHook("nb-rich-text", (e) => {
40127
40136
  { label: "200", value: 200 }
40128
40137
  ],
40129
40138
  onChange: (v) => {
40130
- var A;
40139
+ var k;
40131
40140
  const I = o.decoratorProps.request.params || {};
40132
- I.pageSize = v, o.decoratorProps.request.params = I, n["x-decorator-props"].request.params = I, a.run(F(g({}, (A = a.params) == null ? void 0 : A[0]), { pageSize: v })), c.emit("patch", {
40141
+ I.pageSize = v, o.decoratorProps.request.params = I, n["x-decorator-props"].request.params = I, a.run(F(g({}, (k = a.params) == null ? void 0 : k[0]), { pageSize: v })), c.emit("patch", {
40133
40142
  schema: {
40134
40143
  "x-uid": n["x-uid"],
40135
40144
  "x-decorator-props": n["x-decorator-props"]
@@ -40206,8 +40215,8 @@ const TableActionColumnDesigner = (e) => {
40206
40215
  "sort-field"
40207
40216
  );
40208
40217
  }, TableBlockDesigner = () => {
40209
- var k, w, M, N, E, z, O, R, j, B;
40210
- const { name: e, title: t } = useCollection_deprecated(), { getCollectionField: o, getCollection: n } = useCollectionManager_deprecated(), r = useField(), i = useFieldSchema(), { form: a } = useFormBlockContext(), l = useSortFields(e), { service: c } = useTableBlockContext(), { t: u } = useTranslation(), { dn: d } = useDesignable(), p = ((w = (k = i == null ? void 0 : i["x-decorator-props"]) == null ? void 0 : k.params) == null ? void 0 : w.sort) || [], m = ((M = i == null ? void 0 : i["x-decorator-props"]) == null ? void 0 : M.resource) || ((N = i == null ? void 0 : i["x-decorator-props"]) == null ? void 0 : N.association), h = !((E = i == null ? void 0 : i["x-decorator-props"]) != null && E.disableTemplate), x = p == null ? void 0 : p.map((T) => T != null && T.startsWith("-") ? {
40218
+ var A, w, M, N, E, z, O, R, j, B;
40219
+ const { name: e, title: t } = useCollection_deprecated(), { getCollectionField: o, getCollection: n } = useCollectionManager_deprecated(), r = useField(), i = useFieldSchema(), { form: a } = useFormBlockContext(), l = useSortFields(e), { service: c } = useTableBlockContext(), { t: u } = useTranslation(), { dn: d } = useDesignable(), p = ((w = (A = i == null ? void 0 : i["x-decorator-props"]) == null ? void 0 : A.params) == null ? void 0 : w.sort) || [], m = ((M = i == null ? void 0 : i["x-decorator-props"]) == null ? void 0 : M.resource) || ((N = i == null ? void 0 : i["x-decorator-props"]) == null ? void 0 : N.association), h = !((E = i == null ? void 0 : i["x-decorator-props"]) != null && E.disableTemplate), x = p == null ? void 0 : p.map((T) => T != null && T.startsWith("-") ? {
40211
40220
  field: T.substring(1),
40212
40221
  direction: "desc"
40213
40222
  } : {
@@ -40225,7 +40234,7 @@ const TableActionColumnDesigner = (e) => {
40225
40234
  }), c.params[0].page = 1;
40226
40235
  },
40227
40236
  [d, r.decoratorProps, i, c]
40228
- ), A = useAPIClient();
40237
+ ), k = useAPIClient();
40229
40238
  return /* @__PURE__ */ jsxs(GeneralSchemaDesigner, { template: f, title: t || e, children: [
40230
40239
  /* @__PURE__ */ jsx(SchemaSettingsBlockTitleItem, {}),
40231
40240
  /* @__PURE__ */ jsx(SchemaSettingsBlockHeightItem, {}),
@@ -40253,7 +40262,7 @@ const TableActionColumnDesigner = (e) => {
40253
40262
  title: u("Enable drag and drop sorting"),
40254
40263
  checked: r.decoratorProps.dragSort,
40255
40264
  onChange: (T) => V(void 0, null, function* () {
40256
- T && y && (yield A.resource("collections.fields", y.collectionName).update({
40265
+ T && y && (yield k.resource("collections.fields", y.collectionName).update({
40257
40266
  filterByTk: y.name,
40258
40267
  values: {
40259
40268
  sortable: !0
@@ -40420,14 +40429,14 @@ TableField.ActionBar = observer$1(
40420
40429
  { displayName: "TableField.ActionBar" }
40421
40430
  );
40422
40431
  const TableSelectorDesigner = () => {
40423
- var k, w, M, N, E, z;
40424
- const { name: e, title: t } = useCollection_deprecated(), { getCollectionJoinField: o, getAllCollectionsInheritChain: n } = useCollectionManager_deprecated(), r = useField(), i = useFieldSchema(), { form: a } = useFormBlockContext(), l = useSortFields(e), { service: c, extraFilter: u } = useTableSelectorContext(), { t: d } = useTranslation(), { dn: p } = useDesignable(), m = ((w = (k = i == null ? void 0 : i["x-decorator-props"]) == null ? void 0 : k.params) == null ? void 0 : w.sort) || [], h = recursiveParent$1(i, "CollectionField"), x = o(h == null ? void 0 : h["x-collection-field"]), f = m == null ? void 0 : m.map((O) => O.startsWith("-") ? {
40432
+ var A, w, M, N, E, z;
40433
+ const { name: e, title: t } = useCollection_deprecated(), { getCollectionJoinField: o, getAllCollectionsInheritChain: n } = useCollectionManager_deprecated(), r = useField(), i = useFieldSchema(), { form: a } = useFormBlockContext(), l = useSortFields(e), { service: c, extraFilter: u } = useTableSelectorContext(), { t: d } = useTranslation(), { dn: p } = useDesignable(), m = ((w = (A = i == null ? void 0 : i["x-decorator-props"]) == null ? void 0 : A.params) == null ? void 0 : w.sort) || [], h = recursiveParent$1(i, "CollectionField"), x = o(h == null ? void 0 : h["x-collection-field"]), f = m == null ? void 0 : m.map((O) => O.startsWith("-") ? {
40425
40434
  field: O.substring(1),
40426
40435
  direction: "desc"
40427
40436
  } : {
40428
40437
  field: O,
40429
40438
  direction: "asc"
40430
- }), C = useSchemaTemplate(), S = useCollection_deprecated(), { dragSort: b } = r.decoratorProps, y = useRecord(), v = useVariables(), { currentFormCollection: I } = useContext(RecordPickerContext), A = useLocalVariables({ collectionName: I });
40439
+ }), C = useSchemaTemplate(), S = useCollection_deprecated(), { dragSort: b } = r.decoratorProps, y = useRecord(), v = useVariables(), { currentFormCollection: I } = useContext(RecordPickerContext), k = useLocalVariables({ collectionName: I });
40431
40440
  return /* @__PURE__ */ jsxs(GeneralSchemaDesigner, { template: C, title: t || e, disableInitializer: !0, children: [
40432
40441
  /* @__PURE__ */ jsx(
40433
40442
  SchemaSettingsDataScope,
@@ -40459,7 +40468,7 @@ const TableSelectorDesigner = () => {
40459
40468
  shouldChange: getShouldChange({
40460
40469
  collectionField: O.collectionField,
40461
40470
  variables: v,
40462
- localVariables: A,
40471
+ localVariables: k,
40463
40472
  getAllCollectionsInheritChain: n
40464
40473
  }),
40465
40474
  currentFormCollectionName: I,
@@ -41154,8 +41163,8 @@ const SelfFields = (e) => {
41154
41163
  const C = F(g({}, e.context), {
41155
41164
  collection: x
41156
41165
  }), S = (v, I) => {
41157
- const A = n(v, I);
41158
- return F(g({}, A || {}), {
41166
+ const k = n(v, I);
41167
+ return F(g({}, k || {}), {
41159
41168
  "x-read-pretty": !0,
41160
41169
  name: `${h.name}.${v.name}`,
41161
41170
  "x-collection-field": `${i.name}.${h.name}.${v.name}`
@@ -42269,16 +42278,16 @@ const useCurrentAppInfo = () => useContext(CurrentAppInfoContext), CurrentAppInf
42269
42278
  var I;
42270
42279
  const y = ["belongsTo"].includes(u) ? l : ["belongsToMany"].includes(u) ? d : c, v = (I = r(y)) == null ? void 0 : I.fields;
42271
42280
  if (v) {
42272
- const A = v == null ? void 0 : v.filter((k) => supportTypes.includes(k.type)).map((k) => {
42281
+ const k = v == null ? void 0 : v.filter((A) => supportTypes.includes(A.type)).map((A) => {
42273
42282
  var w;
42274
42283
  return {
42275
- value: k.name,
42276
- label: x(((w = k.uiSchema) == null ? void 0 : w.title) || k.name)
42284
+ value: A.name,
42285
+ label: x(((w = A.uiSchema) == null ? void 0 : w.title) || A.name)
42277
42286
  };
42278
42287
  });
42279
- if (n(A), h) {
42280
- const k = A.find((w) => w.value === h);
42281
- S((k == null ? void 0 : k.label) || h);
42288
+ if (n(k), h) {
42289
+ const A = k.find((w) => w.value === h);
42290
+ S((A == null ? void 0 : A.label) || h);
42282
42291
  }
42283
42292
  }
42284
42293
  }, [u]), /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
@@ -42290,9 +42299,9 @@ const useCurrentAppInfo = () => useContext(CurrentAppInfoContext), CurrentAppInf
42290
42299
  showSearch: !0,
42291
42300
  onDropdownVisibleChange: (y) => V(void 0, null, function* () {
42292
42301
  var w;
42293
- const { target: v, type: I, through: A } = f.values, k = ["belongsTo"].includes(I) ? l || p : ["belongsToMany"].includes(I) ? A : v;
42294
- if (k && y) {
42295
- const M = ((w = r(k)) == null ? void 0 : w.fields) || [];
42302
+ const { target: v, type: I, through: k } = f.values, A = ["belongsTo"].includes(I) ? l || p : ["belongsToMany"].includes(I) ? k : v;
42303
+ if (A && y) {
42304
+ const M = ((w = r(A)) == null ? void 0 : w.fields) || [];
42296
42305
  n(
42297
42306
  M == null ? void 0 : M.filter((N) => supportTypes.includes(N.type)).map((N) => {
42298
42307
  var E;
@@ -42518,7 +42527,7 @@ const useCurrentAppInfo = () => useContext(CurrentAppInfoContext), CurrentAppInf
42518
42527
  return /* @__PURE__ */ jsx(AddFieldAction, g({ item: t }, e));
42519
42528
  }, AddFieldAction = (e) => {
42520
42529
  var z, O;
42521
- const { scope: t, getContainer: o, item: n, children: r, trigger: i, align: a, database: l } = e, { getInterface: c, getTemplate: u, collections: d, getCollection: p } = useCollectionManager_deprecated(), [m, h] = useState(!1), [x, f] = useState(), [C, S] = useState({}), b = useCompile(), { t: y } = useTranslation(), { isDialect: v } = useDialect(), I = useFieldInterfaceOptions(), A = ((O = (z = p(n.name)) == null ? void 0 : z.options) == null ? void 0 : O.fields) || n.fields || [], k = useMemo(() => d.map((R) => ({
42530
+ const { scope: t, getContainer: o, item: n, children: r, trigger: i, align: a, database: l } = e, { getInterface: c, getTemplate: u, collections: d, getCollection: p } = useCollectionManager_deprecated(), [m, h] = useState(!1), [x, f] = useState(), [C, S] = useState({}), b = useCompile(), { t: y } = useTranslation(), { isDialect: v } = useDialect(), I = useFieldInterfaceOptions(), k = ((O = (z = p(n.name)) == null ? void 0 : z.options) == null ? void 0 : O.fields) || n.fields || [], A = useMemo(() => d.map((R) => ({
42522
42531
  label: b(R.title),
42523
42532
  value: R.name
42524
42533
  })), []), w = useCallback(() => {
@@ -42582,13 +42591,13 @@ const useCurrentAppInfo = () => useContext(CurrentAppInfoContext), CurrentAppInf
42582
42591
  B && (S(B), h(!0));
42583
42592
  },
42584
42593
  items: M
42585
- }), [c, M, n]), E = useMemo(() => A.filter((R) => ["string", "bigInt", "integer"].includes(R.type)).map((R) => {
42594
+ }), [c, M, n]), E = useMemo(() => k.filter((R) => ["string", "bigInt", "integer"].includes(R.type)).map((R) => {
42586
42595
  var j;
42587
42596
  return {
42588
42597
  value: R.name,
42589
42598
  label: b((j = R.uiSchema) == null ? void 0 : j.title)
42590
42599
  };
42591
- }), [A == null ? void 0 : A.length]);
42600
+ }), [k == null ? void 0 : k.length]);
42592
42601
  return n.template !== "sql" && /* @__PURE__ */ jsx(RecordProvider, { record: n, children: /* @__PURE__ */ jsxs(ActionContextProvider, { value: { visible: m, setVisible: h }, children: [
42593
42602
  /* @__PURE__ */ jsx(Dropdown, { getPopupContainer: o, trigger: i, align: a, menu: N, children: r || /* @__PURE__ */ jsx(Button, { icon: /* @__PURE__ */ jsx(PlusOutlined, {}), type: "primary", children: y("Add field") }) }),
42594
42603
  /* @__PURE__ */ jsx(
@@ -42607,7 +42616,7 @@ const useCurrentAppInfo = () => useContext(CurrentAppInfoContext), CurrentAppInf
42607
42616
  record: n,
42608
42617
  showReverseFieldConfig: !0,
42609
42618
  targetScope: x,
42610
- collections: k,
42619
+ collections: A,
42611
42620
  isDialect: v,
42612
42621
  disabledJSONB: !1,
42613
42622
  scopeKeyOptions: E,
@@ -42732,18 +42741,18 @@ const useCurrentAppInfo = () => useContext(CurrentAppInfoContext), CurrentAppInf
42732
42741
  const t = useRecord(), o = useCollectionParentRecordData();
42733
42742
  return /* @__PURE__ */ jsx(EditFieldAction, g({ item: t, parentItem: o }, e));
42734
42743
  }, EditFieldAction = (e) => {
42735
- const A = e, { scope: t, getContainer: o, item: n, parentItem: r, children: i } = A, a = H(A, ["scope", "getContainer", "item", "parentItem", "children"]), { getInterface: l, collections: c, getCollection: u } = useCollectionManager_deprecated(), [d, p] = useState(!1), [m, h] = useState({}), x = useAPIClient(), { t: f } = useTranslation(), C = useCompile(), [S, b] = useState({}), { isDialect: y } = useDialect(), v = useMemo(() => {
42736
- var k;
42737
- return (n == null ? void 0 : n.fields) || ((k = u(n.collectionName)) == null ? void 0 : k.options.fields.filter((w) => ["string", "bigInt", "integer"].includes(w.type)).map((w) => {
42744
+ const k = e, { scope: t, getContainer: o, item: n, parentItem: r, children: i } = k, a = H(k, ["scope", "getContainer", "item", "parentItem", "children"]), { getInterface: l, collections: c, getCollection: u } = useCollectionManager_deprecated(), [d, p] = useState(!1), [m, h] = useState({}), x = useAPIClient(), { t: f } = useTranslation(), C = useCompile(), [S, b] = useState({}), { isDialect: y } = useDialect(), v = useMemo(() => {
42745
+ var A;
42746
+ return (n == null ? void 0 : n.fields) || ((A = u(n.collectionName)) == null ? void 0 : A.options.fields.filter((w) => ["string", "bigInt", "integer"].includes(w.type)).map((w) => {
42738
42747
  var M;
42739
42748
  return {
42740
42749
  value: w.name,
42741
42750
  label: C((M = w.uiSchema) == null ? void 0 : M.title)
42742
42751
  };
42743
42752
  }));
42744
- }, [n.name]), I = useMemo(() => c.map((k) => ({
42745
- label: C(k.title),
42746
- value: k.name
42753
+ }, [n.name]), I = useMemo(() => c.map((A) => ({
42754
+ label: C(A.title),
42755
+ value: A.name
42747
42756
  })), []);
42748
42757
  return /* @__PURE__ */ jsx(RecordProvider, { record: n, parent: r, children: /* @__PURE__ */ jsxs(ActionContextProvider, { value: { visible: d, setVisible: p }, children: [
42749
42758
  /* @__PURE__ */ jsx(
@@ -42751,12 +42760,12 @@ const useCurrentAppInfo = () => useContext(CurrentAppInfoContext), CurrentAppInf
42751
42760
  F(g({}, a), {
42752
42761
  onClick: () => V(void 0, null, function* () {
42753
42762
  var E, z;
42754
- const { data: k } = yield x.resource("collections.fields", n.collectionName).get({
42763
+ const { data: A } = yield x.resource("collections.fields", n.collectionName).get({
42755
42764
  filterByTk: n.name,
42756
42765
  appends: ["reverseField"]
42757
42766
  });
42758
- b(k == null ? void 0 : k.data);
42759
- const w = l(n.interface), M = cloneDeep(k == null ? void 0 : k.data) || {};
42767
+ b(A == null ? void 0 : A.data);
42768
+ const w = l(n.interface), M = cloneDeep(A == null ? void 0 : A.data) || {};
42760
42769
  M != null && M.reverseField || (M.autoCreateReverseField = !1, M.reverseField = (E = w == null ? void 0 : w.default) == null ? void 0 : E.reverseField, set(M.reverseField, "name", `f_${uid()}`), set(M.reverseField, "uiSchema.title", (z = n.__parent) == null ? void 0 : z.title));
42761
42770
  const N = getSchema$7(
42762
42771
  F(g({}, w), {
@@ -42860,7 +42869,7 @@ const useCurrentAppInfo = () => useContext(CurrentAppInfoContext), CurrentAppInf
42860
42869
  const { scope: t, getContainer: o, item: n, parentItem: r, children: i, currentCollection: a } = e, { target: l, through: c } = n, { getInterface: u, getCollection: d, getCurrentCollectionFields: p, getChildrenCollections: m, collections: h } = useCollectionManager_deprecated(), [x, f] = useState(!1), [C, S] = useState({}), b = useAPIClient(), { t: y } = useTranslation(), v = useCompile(), I = (O) => {
42861
42870
  var j;
42862
42871
  return O && ((j = m(O)) == null ? void 0 : j.map((B) => B.name).concat([O]));
42863
- }, [A, k] = useState({}), w = p(a), M = getIsOverriding(w, n), N = useMemo(() => h.map((O) => ({
42872
+ }, [k, A] = useState({}), w = p(a), M = getIsOverriding(w, n), N = useMemo(() => h.map((O) => ({
42864
42873
  label: v(O.title),
42865
42874
  value: O.name
42866
42875
  })), []), E = () => {
@@ -42909,7 +42918,7 @@ const useCurrentAppInfo = () => useContext(CurrentAppInfoContext), CurrentAppInf
42909
42918
  filterByTk: n.name,
42910
42919
  appends: ["reverseField"]
42911
42920
  });
42912
- k(R == null ? void 0 : R.data);
42921
+ A(R == null ? void 0 : R.data);
42913
42922
  const j = u(n.interface), B = cloneDeep(R == null ? void 0 : R.data) || {};
42914
42923
  B != null && B.reverseField || (B.autoCreateReverseField = !1, B.reverseField = (O = j.default) == null ? void 0 : O.reverseField, set$1(B.reverseField, "name", `f_${uid()}`), set$1(B.reverseField, "uiSchema.title", n.__parent.title));
42915
42924
  const T = getSchema$6(
@@ -42934,7 +42943,7 @@ const useCurrentAppInfo = () => useContext(CurrentAppInfoContext), CurrentAppInf
42934
42943
  getContainer: o,
42935
42944
  useOverridingCollectionField: E,
42936
42945
  useCancelAction,
42937
- showReverseFieldConfig: !(A != null && A.reverseField),
42946
+ showReverseFieldConfig: !(k != null && k.reverseField),
42938
42947
  createOnly: !0,
42939
42948
  override: !0,
42940
42949
  isOverride: !0,
@@ -43003,14 +43012,14 @@ const useCurrentAppInfo = () => useContext(CurrentAppInfoContext), CurrentAppInf
43003
43012
  "a",
43004
43013
  {
43005
43014
  onClick: () => V(void 0, null, function* () {
43006
- var A;
43015
+ var k;
43007
43016
  const { data: b } = yield m.resource("collections.fields", n.collectionName).get({
43008
43017
  filterByTk: n.name,
43009
43018
  appends: ["reverseField"]
43010
43019
  });
43011
43020
  C(b == null ? void 0 : b.data);
43012
43021
  const y = a(n.interface), v = cloneDeep(b == null ? void 0 : b.data) || {};
43013
- v != null && v.reverseField || (v.autoCreateReverseField = !1, v.reverseField = (A = y.default) == null ? void 0 : A.reverseField, set(v.reverseField, "name", `f_${uid()}`), set(v.reverseField, "uiSchema.title", n.__parent.title));
43022
+ v != null && v.reverseField || (v.autoCreateReverseField = !1, v.reverseField = (k = y.default) == null ? void 0 : k.reverseField, set(v.reverseField, "name", `f_${uid()}`), set(v.reverseField, "uiSchema.title", n.__parent.title));
43014
43023
  const I = getSchema$5(
43015
43024
  F(g({}, y), {
43016
43025
  default: v
@@ -43369,12 +43378,12 @@ const getSchema$4 = (e, t, o) => {
43369
43378
  });
43370
43379
  }), o.filter((n) => n.children.length > 0);
43371
43380
  }, PreviewCom = (e) => {
43372
- const { databaseView: t, viewName: o, sources: n, schema: r } = e, { data: i } = useContext(ResourceActionContext), a = useAPIClient(), { t: l } = useTranslation(), [c, u] = useState(!1), [d, p] = useState([]), [m, h] = useState([]), [x, f] = useState(n), [C, S] = useState([]), b = useField(), y = useForm(), { getCollection: v, getInterface: I, getCollectionFields: A, getInheritCollections: k, getParentCollectionFields: w } = useCollectionManager_deprecated(), M = useCompile(), E = useFieldInterfaceOptions().filter((R) => !["relation", "systemInfo"].includes(R.key));
43381
+ const { databaseView: t, viewName: o, sources: n, schema: r } = e, { data: i } = useContext(ResourceActionContext), a = useAPIClient(), { t: l } = useTranslation(), [c, u] = useState(!1), [d, p] = useState([]), [m, h] = useState([]), [x, f] = useState(n), [C, S] = useState([]), b = useField(), y = useForm(), { getCollection: v, getInterface: I, getCollectionFields: k, getInheritCollections: A, getParentCollectionFields: w } = useCollectionManager_deprecated(), M = useCompile(), E = useFieldInterfaceOptions().filter((R) => !["relation", "systemInfo"].includes(R.key));
43373
43382
  useEffect(() => {
43374
43383
  const R = [];
43375
43384
  x.forEach((j) => {
43376
43385
  var q;
43377
- const B = v(j), D = k(j).map((L) => {
43386
+ const B = v(j), D = A(j).map((L) => {
43378
43387
  const G = w(L, j);
43379
43388
  return {
43380
43389
  type: "group",
@@ -43453,7 +43462,7 @@ const getSchema$4 = (e, t, o) => {
43453
43462
  options: M(m),
43454
43463
  onChange: (T, D) => {
43455
43464
  var q;
43456
- const $ = (q = A(T == null ? void 0 : T[0])) == null ? void 0 : q.find((L) => L.name === last(T));
43465
+ const $ = (q = k(T == null ? void 0 : T[0])) == null ? void 0 : q.find((L) => L.name === last(T));
43457
43466
  z(F(g({}, j), { source: T, uiSchema: $ == null ? void 0 : $.uiSchema }), B);
43458
43467
  },
43459
43468
  placeholder: l("Select field source")
@@ -43570,7 +43579,7 @@ const mapFields = ["lineString", "point", "circle", "polygon"], PreviewTable$1 =
43570
43579
  var v;
43571
43580
  return (v = y.filter((I) => I.source || I.interface)) == null ? void 0 : v.map((I) => {
43572
43581
  var N, E, z, O, R, j;
43573
- const A = typeof (I == null ? void 0 : I.source) == "string" ? (N = I == null ? void 0 : I.source) == null ? void 0 : N.split(".") : I == null ? void 0 : I.source, k = (z = (E = h(A == null ? void 0 : A[0])) == null ? void 0 : E.find((B) => B.name === (A == null ? void 0 : A[1]))) == null ? void 0 : z.uiSchema, w = ((O = I == null ? void 0 : I.uiSchema) == null ? void 0 : O.title) || (k == null ? void 0 : k.title) || I.name, M = I.source ? k : (j = (R = m(I.interface)) == null ? void 0 : R.default) == null ? void 0 : j.uiSchema;
43582
+ const k = typeof (I == null ? void 0 : I.source) == "string" ? (N = I == null ? void 0 : I.source) == null ? void 0 : N.split(".") : I == null ? void 0 : I.source, A = (z = (E = h(k == null ? void 0 : k[0])) == null ? void 0 : E.find((B) => B.name === (k == null ? void 0 : k[1]))) == null ? void 0 : z.uiSchema, w = ((O = I == null ? void 0 : I.uiSchema) == null ? void 0 : O.title) || (A == null ? void 0 : A.title) || I.name, M = I.source ? A : (j = (R = m(I.interface)) == null ? void 0 : R.default) == null ? void 0 : j.uiSchema;
43574
43583
  return {
43575
43584
  title: u(w),
43576
43585
  dataIndex: I.name,
@@ -43582,9 +43591,9 @@ const mapFields = ["lineString", "point", "circle", "polygon"], PreviewTable$1 =
43582
43591
  properties: {
43583
43592
  [I.name]: {
43584
43593
  name: `${I.name}`,
43585
- "x-component": M && A ? "CollectionField" : "Input",
43594
+ "x-component": M && k ? "CollectionField" : "Input",
43586
43595
  "x-read-pretty": !0,
43587
- "x-collection-field": A == null ? void 0 : A.join("."),
43596
+ "x-collection-field": k == null ? void 0 : k.join("."),
43588
43597
  default: I.interface === "json" ? JSON.stringify($) : $
43589
43598
  }
43590
43599
  }
@@ -43804,7 +43813,7 @@ const AsyncDataProvider = (e) => {
43804
43813
  }), a;
43805
43814
  }, FieldsConfigure = observer$1(
43806
43815
  () => {
43807
- var v, I, A, k;
43816
+ var v, I, k, A;
43808
43817
  const { t: e } = useTranslation(), [t, o] = useState([]), { data: n, error: r, loading: i } = useAsyncData(), { data: a, fields: l } = n || {}, c = useField(), { data: u } = useContext(ResourceActionContext), d = useCompile(), { getInterface: p, getCollectionField: m } = useCollectionManager_deprecated(), h = useFieldInterfaceOptions(), x = useMemo(
43809
43818
  () => h.filter((w) => !["relation"].includes(w.key)).map((w, M) => ({
43810
43819
  key: M,
@@ -43852,7 +43861,7 @@ const AsyncDataProvider = (e) => {
43852
43861
  return /* @__PURE__ */ jsx(Alert, { showIcon: !0, message: e("Please use a valid SELECT or WITH AS statement") });
43853
43862
  const S = r;
43854
43863
  if (S) {
43855
- const w = ((k = (A = (I = (v = S == null ? void 0 : S.response) == null ? void 0 : v.data) == null ? void 0 : I.errors) == null ? void 0 : A.map) == null ? void 0 : k.call(A, (M) => M.message).join(`
43864
+ const w = ((A = (k = (I = (v = S == null ? void 0 : S.response) == null ? void 0 : v.data) == null ? void 0 : I.errors) == null ? void 0 : k.map) == null ? void 0 : A.call(k, (M) => M.message).join(`
43856
43865
  `)) || S.message;
43857
43866
  return /* @__PURE__ */ jsx(Alert, { showIcon: !0, message: `${e("SQL error: ")}${w}`, type: "error" });
43858
43867
  }
@@ -49509,7 +49518,7 @@ const ACLCollectionProvider = (e) => {
49509
49518
  )
49510
49519
  };
49511
49520
  }, ACLCollectionFieldProvider = (e) => {
49512
- const t = useFieldSchema(), o = useField(), { allowAll: n } = useACLRoleContext(), { whitelist: r } = useACLFieldWhitelist(), [i] = t.name.split("."), a = !t["x-acl-ignore"] && r.length > 0 ? r.includes(i) : !0;
49521
+ const t = useFieldSchema(), o = useField(), { allowAll: n } = useACLRoleContext(), { whitelist: r } = useACLFieldWhitelist(), [i] = t.name.split("."), a = !t["x-acl-ignore"] && r.length > 0 && (t != null && t["x-collection-field"]) ? r.includes(i) : !0;
49513
49522
  return useEffect(() => {
49514
49523
  a || (o.required = !1, o.display = "hidden");
49515
49524
  }, [a, o]), n ? /* @__PURE__ */ jsx(Fragment, { children: e.children }) : t["x-collection-field"] ? a ? /* @__PURE__ */ jsx(Fragment, { children: e.children }) : null : /* @__PURE__ */ jsx(Fragment, { children: e.children });
@@ -50561,34 +50570,34 @@ const RolesResourcesScopesSelectedRowKeysProvider = (e) => {
50561
50570
  }, RoleResourceCollectionContext = createContext({});
50562
50571
  RoleResourceCollectionContext.displayName = "RoleResourceCollectionContext";
50563
50572
  const RolesResourcesActions = connect((e) => {
50564
- var y, v, I, A;
50565
- const { styles: t } = useStyles$a(), o = (k) => {
50566
- const w = k.map((M) => F(g({}, M), {
50573
+ var y, v, I, k;
50574
+ const { styles: t } = useStyles$a(), o = (A) => {
50575
+ const w = A.map((M) => F(g({}, M), {
50567
50576
  scope: isEmpty$1(M.scope) ? null : M.scope
50568
50577
  }));
50569
50578
  e.onChange(w);
50570
50579
  };
50571
50580
  useForm();
50572
- const n = useRecord(), r = useAvailableActions(), { getCollection: i, getCollectionFields: a } = useCollectionManager_deprecated(), l = i(n.collectionName), c = a(n.collectionName), u = useCompile(), { t: d } = useTranslation(), p = useField(), m = toActionMap(p.value || []), h = (k, w) => {
50581
+ const n = useRecord(), r = useAvailableActions(), { getCollection: i, getCollectionFields: a } = useCollectionManager_deprecated(), l = i(n.collectionName), c = a(n.collectionName), u = useCompile(), { t: d } = useTranslation(), p = useField(), m = toActionMap(p.value || []), h = (A, w) => {
50573
50582
  var N;
50574
- const M = m == null ? void 0 : m[k];
50583
+ const M = m == null ? void 0 : m[A];
50575
50584
  return M ? (N = M == null ? void 0 : M.fields) == null ? void 0 : N.includes(w) : !1;
50576
- }, x = r.filter((k) => k.allowConfigureFields), f = (y = c == null ? void 0 : c.filter((k) => k.interface)) == null ? void 0 : y.map((k) => {
50577
- const w = g({}, k);
50585
+ }, x = r.filter((A) => A.allowConfigureFields), f = (y = c == null ? void 0 : c.filter((A) => A.interface)) == null ? void 0 : y.map((A) => {
50586
+ const w = g({}, A);
50578
50587
  for (const M of x)
50579
- w[M.name] = h(M.name, k.name);
50588
+ w[M.name] = h(M.name, A.name);
50580
50589
  return w;
50581
- }), C = (k) => {
50590
+ }), C = (A) => {
50582
50591
  var w, M;
50583
- m[k] ? delete m[k] : m[k] = {
50584
- name: k,
50592
+ m[A] ? delete m[A] : m[A] = {
50593
+ name: A,
50585
50594
  fields: (M = (w = c == null ? void 0 : c.filter((N) => N.interface)) == null ? void 0 : w.map) == null ? void 0 : M.call(w, (N) => N.name)
50586
50595
  }, o(Object.values(m));
50587
- }, S = (k, w) => {
50588
- m[k] ? (m[k].scope = w, o(Object.values(m))) : (C(k), m[k].scope = w);
50596
+ }, S = (A, w) => {
50597
+ m[A] ? (m[A].scope = w, o(Object.values(m))) : (C(A), m[A].scope = w);
50589
50598
  }, b = {};
50590
- for (const k of x)
50591
- b[k.name] = ((v = c == null ? void 0 : c.filter((w) => w.interface)) == null ? void 0 : v.length) === ((A = (I = m == null ? void 0 : m[k.name]) == null ? void 0 : I.fields) == null ? void 0 : A.length);
50599
+ for (const A of x)
50600
+ b[A.name] = ((v = c == null ? void 0 : c.filter((w) => w.interface)) == null ? void 0 : v.length) === ((k = (I = m == null ? void 0 : m[A.name]) == null ? void 0 : I.fields) == null ? void 0 : k.length);
50592
50601
  return /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(RoleResourceCollectionContext.Provider, { value: l, children: /* @__PURE__ */ jsxs(FormLayout, { layout: "vertical", children: [
50593
50602
  /* @__PURE__ */ jsx(FormItem$1, { label: d("Action permission"), children: /* @__PURE__ */ jsx(
50594
50603
  Table$2,
@@ -50600,20 +50609,20 @@ const RolesResourcesActions = connect((e) => {
50600
50609
  {
50601
50610
  dataIndex: "displayName",
50602
50611
  title: d("Action display name"),
50603
- render: (k) => u(k)
50612
+ render: (A) => u(A)
50604
50613
  },
50605
50614
  {
50606
50615
  dataIndex: "onNewRecord",
50607
50616
  title: d("Action type"),
50608
- render: (k) => k ? /* @__PURE__ */ jsx(Tag, { color: "green", children: d("Action on new records") }) : /* @__PURE__ */ jsx(Tag, { color: "geekblue", children: d("Action on existing records") })
50617
+ render: (A) => A ? /* @__PURE__ */ jsx(Tag, { color: "green", children: d("Action on new records") }) : /* @__PURE__ */ jsx(Tag, { color: "geekblue", children: d("Action on existing records") })
50609
50618
  },
50610
50619
  {
50611
50620
  dataIndex: "enabled",
50612
50621
  title: d("Allow"),
50613
- render: (k, w) => /* @__PURE__ */ jsx(
50622
+ render: (A, w) => /* @__PURE__ */ jsx(
50614
50623
  Checkbox$1,
50615
50624
  {
50616
- checked: k,
50625
+ checked: A,
50617
50626
  onChange: () => {
50618
50627
  C(w.name);
50619
50628
  }
@@ -50623,10 +50632,10 @@ const RolesResourcesActions = connect((e) => {
50623
50632
  {
50624
50633
  dataIndex: "scope",
50625
50634
  title: d("Data scope"),
50626
- render: (k, w) => !w.onNewRecord && /* @__PURE__ */ jsx(
50635
+ render: (A, w) => !w.onNewRecord && /* @__PURE__ */ jsx(
50627
50636
  ScopeSelect,
50628
50637
  {
50629
- value: k,
50638
+ value: A,
50630
50639
  onChange: (M) => {
50631
50640
  S(w.name, M);
50632
50641
  }
@@ -50634,9 +50643,9 @@ const RolesResourcesActions = connect((e) => {
50634
50643
  )
50635
50644
  }
50636
50645
  ],
50637
- dataSource: r == null ? void 0 : r.map((k) => {
50646
+ dataSource: r == null ? void 0 : r.map((A) => {
50638
50647
  let w = !1, M = null;
50639
- return m[k.name] && (w = !0, k.onNewRecord || (M = m[k.name].scope)), F(g({}, k), {
50648
+ return m[A.name] && (w = !0, A.onNewRecord || (M = m[A.name].scope)), F(g({}, A), {
50640
50649
  enabled: w,
50641
50650
  scope: M
50642
50651
  });
@@ -50653,12 +50662,12 @@ const RolesResourcesActions = connect((e) => {
50653
50662
  {
50654
50663
  dataIndex: ["uiSchema", "title"],
50655
50664
  title: d("Field display name"),
50656
- render: (k) => u(k)
50665
+ render: (A) => u(A)
50657
50666
  },
50658
- ...x.map((k) => {
50659
- const w = b == null ? void 0 : b[k.name];
50667
+ ...x.map((A) => {
50668
+ const w = b == null ? void 0 : b[A.name];
50660
50669
  return {
50661
- dataIndex: k.name,
50670
+ dataIndex: A.name,
50662
50671
  title: /* @__PURE__ */ jsxs(Fragment, { children: [
50663
50672
  /* @__PURE__ */ jsx(
50664
50673
  Checkbox$1,
@@ -50666,31 +50675,31 @@ const RolesResourcesActions = connect((e) => {
50666
50675
  checked: w,
50667
50676
  onChange: () => {
50668
50677
  var N;
50669
- const M = m[k.name] || {
50670
- name: k.name
50678
+ const M = m[A.name] || {
50679
+ name: A.name
50671
50680
  };
50672
- w ? M.fields = [] : M.fields = (N = c == null ? void 0 : c.map) == null ? void 0 : N.call(c, (E) => E.name), m[k.name] = M, o(Object.values(m));
50681
+ w ? M.fields = [] : M.fields = (N = c == null ? void 0 : c.map) == null ? void 0 : N.call(c, (E) => E.name), m[A.name] = M, o(Object.values(m));
50673
50682
  }
50674
50683
  }
50675
50684
  ),
50676
50685
  " ",
50677
- u(k.displayName)
50686
+ u(A.displayName)
50678
50687
  ] }),
50679
50688
  render: (M, N) => /* @__PURE__ */ jsx(
50680
50689
  Checkbox$1,
50681
50690
  {
50682
50691
  checked: M,
50683
- "aria-label": `${k.name}_checkbox`,
50692
+ "aria-label": `${A.name}_checkbox`,
50684
50693
  onChange: () => {
50685
- const E = m[k.name] || {
50686
- name: k.name
50694
+ const E = m[A.name] || {
50695
+ name: A.name
50687
50696
  }, z = E.fields || [];
50688
50697
  if (M) {
50689
50698
  const O = z.indexOf(N.name);
50690
50699
  z.splice(O, 1);
50691
50700
  } else
50692
50701
  z.push(N.name);
50693
- E.fields = z, m[k.name] = E, o(Object.values(m));
50702
+ E.fields = z, m[A.name] = E, o(Object.values(m));
50694
50703
  }
50695
50704
  }
50696
50705
  )
@@ -50940,14 +50949,14 @@ const PluginDetail = ({ plugin: e, onCancel: t }) => {
50940
50949
  ready: !!e.name
50941
50950
  }
50942
50951
  ), a = useMemo(() => {
50943
- var k, w, M;
50944
- if (!((w = (k = r == null ? void 0 : r.data) == null ? void 0 : k.packageJson) != null && w.repository))
50952
+ var A, w, M;
50953
+ if (!((w = (A = r == null ? void 0 : r.data) == null ? void 0 : A.packageJson) != null && w.repository))
50945
50954
  return null;
50946
50955
  const I = (M = r == null ? void 0 : r.data) == null ? void 0 : M.packageJson.repository;
50947
50956
  return (typeof I == "string" ? I : I.url).replace(/\.git$/, "").replace(/^git\+/, "");
50948
50957
  }, [r]), l = useMemo(() => {
50949
- var A;
50950
- const I = (A = r == null ? void 0 : r.data) == null ? void 0 : A.packageJson.author;
50958
+ var k;
50959
+ const I = (k = r == null ? void 0 : r.data) == null ? void 0 : k.packageJson.author;
50951
50960
  return I ? typeof I == "string" ? I : I.name : null;
50952
50961
  }, [r]), { styles: c, theme: u } = useStyles$1(), d = [
50953
50962
  {
@@ -51331,14 +51340,14 @@ const PluginUploadForm = ({ onClose: e, pluginData: t, isUpgrade: o }) => {
51331
51340
  ] });
51332
51341
  };
51333
51342
  function PluginInfo(e) {
51334
- const { data: t, onClick: o } = e, n = useApp(), { name: r, displayName: i, isCompatible: a, packageName: l, updatable: c, builtIn: u, enabled: d, description: p, error: m, homepage: h } = t, { styles: x, theme: f } = useStyles$1(), C = useNavigate(), { t: S } = useTranslation(), b = useAPIClient(), { modal: y } = App.useApp(), [v, I] = useState(!1), A = i || r || l;
51343
+ const { data: t, onClick: o } = e, n = useApp(), { name: r, displayName: i, isCompatible: a, packageName: l, updatable: c, builtIn: u, enabled: d, description: p, error: m, homepage: h } = t, { styles: x, theme: f } = useStyles$1(), C = useNavigate(), { t: S } = useTranslation(), b = useAPIClient(), { modal: y } = App.useApp(), [v, I] = useState(!1), k = i || r || l;
51335
51344
  return /* @__PURE__ */ jsxs(Fragment, { children: [
51336
51345
  v && /* @__PURE__ */ jsx(
51337
51346
  PluginUpgradeModal,
51338
51347
  {
51339
51348
  isShow: v,
51340
51349
  pluginData: t,
51341
- onClose: (k) => {
51350
+ onClose: (A) => {
51342
51351
  I(!1);
51343
51352
  }
51344
51353
  }
@@ -51347,7 +51356,7 @@ function PluginInfo(e) {
51347
51356
  Card,
51348
51357
  {
51349
51358
  role: "button",
51350
- "aria-label": A,
51359
+ "aria-label": k,
51351
51360
  size: "small",
51352
51361
  bordered: !1,
51353
51362
  onClick: () => {
@@ -51355,7 +51364,7 @@ function PluginInfo(e) {
51355
51364
  },
51356
51365
  headStyle: { border: "none", minHeight: "inherit", paddingTop: 14 },
51357
51366
  bodyStyle: { paddingTop: 10 },
51358
- title: /* @__PURE__ */ jsx("div", { children: A }),
51367
+ title: /* @__PURE__ */ jsx("div", { children: k }),
51359
51368
  hoverable: !0,
51360
51369
  className: css`
51361
51370
  .ant-card-actions {
@@ -51386,8 +51395,8 @@ function PluginInfo(e) {
51386
51395
  {
51387
51396
  href: h,
51388
51397
  target: "_blank",
51389
- onClick: (k) => {
51390
- k.stopPropagation();
51398
+ onClick: (A) => {
51399
+ A.stopPropagation();
51391
51400
  },
51392
51401
  rel: "noreferrer",
51393
51402
  children: [
@@ -51401,8 +51410,8 @@ function PluginInfo(e) {
51401
51410
  c && /* @__PURE__ */ jsxs(
51402
51411
  "a",
51403
51412
  {
51404
- onClick: (k) => {
51405
- k.stopPropagation(), I(!0);
51413
+ onClick: (A) => {
51414
+ A.stopPropagation(), I(!0);
51406
51415
  },
51407
51416
  children: [
51408
51417
  /* @__PURE__ */ jsx(ReloadOutlined, {}),
@@ -51415,8 +51424,8 @@ function PluginInfo(e) {
51415
51424
  d ? n.pluginSettingsManager.has(r) && /* @__PURE__ */ jsxs(
51416
51425
  "a",
51417
51426
  {
51418
- onClick: (k) => {
51419
- k.stopPropagation(), C(n.pluginSettingsManager.getRoutePath(r));
51427
+ onClick: (A) => {
51428
+ A.stopPropagation(), C(n.pluginSettingsManager.getRoutePath(r));
51420
51429
  },
51421
51430
  children: [
51422
51431
  /* @__PURE__ */ jsx(SettingOutlined, {}),
@@ -51429,22 +51438,22 @@ function PluginInfo(e) {
51429
51438
  {
51430
51439
  disabled: u,
51431
51440
  title: S("Are you sure to delete this plugin?"),
51432
- onConfirm: (k) => V(this, null, function* () {
51433
- k.stopPropagation(), b.request({
51441
+ onConfirm: (A) => V(this, null, function* () {
51442
+ A.stopPropagation(), b.request({
51434
51443
  url: "pm:remove",
51435
51444
  params: {
51436
51445
  filterByTk: r
51437
51446
  }
51438
51447
  });
51439
51448
  }),
51440
- onCancel: (k) => k.stopPropagation(),
51449
+ onCancel: (A) => A.stopPropagation(),
51441
51450
  okText: S("Yes"),
51442
51451
  cancelText: S("No"),
51443
51452
  children: /* @__PURE__ */ jsxs(
51444
51453
  "a",
51445
51454
  {
51446
- onClick: (k) => {
51447
- k.stopPropagation();
51455
+ onClick: (A) => {
51456
+ A.stopPropagation();
51448
51457
  },
51449
51458
  className: cls({ [x.cardActionDisabled]: u }),
51450
51459
  children: [
@@ -51464,12 +51473,12 @@ function PluginInfo(e) {
51464
51473
  "aria-label": "enable",
51465
51474
  size: "small",
51466
51475
  disabled: u || m,
51467
- onChange: (k, w) => V(this, null, function* () {
51468
- if (w.stopPropagation(), !a && k) {
51476
+ onChange: (A, w) => V(this, null, function* () {
51477
+ if (w.stopPropagation(), !a && A) {
51469
51478
  message.error(S("Dependencies check failed, can't enable."));
51470
51479
  return;
51471
51480
  }
51472
- k ? yield b.request({
51481
+ A ? yield b.request({
51473
51482
  url: "pm:enable",
51474
51483
  params: {
51475
51484
  filterByTk: r
@@ -51581,15 +51590,15 @@ const LocalPlugins = () => {
51581
51590
  "Others"
51582
51591
  ], C = useMemo(() => f.map((v) => {
51583
51592
  if (v === "Others") {
51584
- const A = o == null ? void 0 : o.data.filter((k) => !hasIntersection(k.keywords, f));
51593
+ const k = o == null ? void 0 : o.data.filter((A) => !hasIntersection(A.keywords, f));
51585
51594
  return {
51586
51595
  key: v,
51587
- list: A
51596
+ list: k
51588
51597
  };
51589
51598
  }
51590
- const I = o == null ? void 0 : o.data.filter((A) => {
51591
- var k;
51592
- return (k = A.keywords) == null ? void 0 : k.includes(v);
51599
+ const I = o == null ? void 0 : o.data.filter((k) => {
51600
+ var A;
51601
+ return (A = k.keywords) == null ? void 0 : A.includes(v);
51593
51602
  });
51594
51603
  return {
51595
51604
  key: v,
@@ -51598,12 +51607,12 @@ const LocalPlugins = () => {
51598
51607
  }), [f]), S = useMemo(() => {
51599
51608
  var I;
51600
51609
  let y = ((I = i[a]) == null ? void 0 : I.list) || [];
51601
- !a && m ? y = C.find((A) => A.key === m).list : a && m && (y = C.find((k) => k.key === m).list.filter((k) => y.find((w) => w.name === k.name)));
51610
+ !a && m ? y = C.find((k) => k.key === m).list : a && m && (y = C.find((A) => A.key === m).list.filter((A) => y.find((w) => w.name === A.name)));
51602
51611
  const v = x.toLocaleLowerCase().trim();
51603
51612
  return v && (y = _.filter(
51604
51613
  y,
51605
- (A) => String(A.displayName || "").toLocaleLowerCase().includes(v) || String(A.description || "").toLocaleLowerCase().includes(v)
51606
- )), y.sort((A, k) => A.displayName.localeCompare(k.displayName));
51614
+ (k) => String(k.displayName || "").toLocaleLowerCase().includes(v) || String(k.description || "").toLocaleLowerCase().includes(v)
51615
+ )), y.sort((k, A) => k.displayName.localeCompare(A.displayName));
51607
51616
  }, [a, i, x, m]), b = (y) => {
51608
51617
  p(y);
51609
51618
  };
@@ -52436,7 +52445,7 @@ const useMenuProps = () => {
52436
52445
  const { notification: t } = App.useApp(), [o, n] = useSessionStorageState("plugin-notice", { defaultValue: !1 }), { t: r } = useMenuTranslation(), { setTitle: i } = useDocumentTitle(), a = useCallback((w) => i(r(w)), []), l = useNavigate(), c = useParams(), u = useLocation(), d = useMatch("/admin"), p = useMatch("/admin/:name"), m = c.name, h = !!m, { sideMenuRef: x } = e, f = useACLRoleContext(), [C, S] = useState(null), b = ({ item: w }) => {
52437
52446
  const M = w.props.schema;
52438
52447
  a(M.title), S(M), l(`/admin/${M["x-uid"]}`);
52439
- }, { render: y } = useAppSpin(), v = useAdminSchemaUid(), { data: I, loading: A } = useRequest(
52448
+ }, { render: y } = useAppSpin(), v = useAdminSchemaUid(), { data: I, loading: k } = useRequest(
52440
52449
  {
52441
52450
  url: `/uiSchemas:getJsonSchema/${v}`
52442
52451
  },
@@ -52469,16 +52478,16 @@ const useMenuProps = () => {
52469
52478
  z || O ? x.current.style.display = "none" : x.current.style.display = "block";
52470
52479
  }
52471
52480
  }, [I == null ? void 0 : I.data, c.name, x]);
52472
- const k = useMemo(() => {
52481
+ const A = useMemo(() => {
52473
52482
  const w = filterByACL(I == null ? void 0 : I.data, f);
52474
52483
  return w != null && w["x-component-props"] && (w["x-component-props"].useProps = useMenuProps), w;
52475
52484
  }, [I == null ? void 0 : I.data]);
52476
52485
  return useEffect(() => {
52477
52486
  if (p) {
52478
- const w = findByUid(k, m);
52487
+ const w = findByUid(A, m);
52479
52488
  w && a(w.title);
52480
52489
  }
52481
- }, [m, d, p, k, a]), useRequest(
52490
+ }, [m, d, p, A, a]), useRequest(
52482
52491
  {
52483
52492
  url: "applicationPlugins:list",
52484
52493
  params: {
@@ -52511,12 +52520,12 @@ const useMenuProps = () => {
52511
52520
  manual: !0
52512
52521
  // ready: !hasNotice,
52513
52522
  }
52514
- ), A ? y() : /* @__PURE__ */ jsx(SchemaIdContext.Provider, { value: m, children: /* @__PURE__ */ jsx(
52523
+ ), k ? y() : /* @__PURE__ */ jsx(SchemaIdContext.Provider, { value: m, children: /* @__PURE__ */ jsx(
52515
52524
  SchemaComponent,
52516
52525
  {
52517
52526
  distributed: !0,
52518
52527
  scope: { useMenuProps, onSelect: b, sideMenuRef: x, defaultSelectedUid: m },
52519
- schema: k
52528
+ schema: A
52520
52529
  }
52521
52530
  ) });
52522
52531
  }, GlobalStyleForAdminLayout = createGlobalStyle`
@@ -53300,10 +53309,10 @@ const ActionInitializerItem = (e) => {
53300
53309
  } = useProps(e), [S, b] = useState(!1), y = useMemo(
53301
53310
  () => C && (i != null && i.name) ? [i.name] : [],
53302
53311
  []
53303
- ), v = x || (i == null ? void 0 : i.targetKey) || "id", I = f || ((L = (q = a["x-component-props"]) == null ? void 0 : q.fieldNames) == null ? void 0 : L.label) || v, A = {
53312
+ ), v = x || (i == null ? void 0 : i.targetKey) || "id", I = f || ((L = (q = a["x-component-props"]) == null ? void 0 : q.fieldNames) == null ? void 0 : L.label) || v, k = {
53304
53313
  title: I || v,
53305
53314
  key: v
53306
- }, [k, w] = useState([]), [M, N] = useState([]), [E, z] = useState(!0), O = useLabelUiSchema(i, (A == null ? void 0 : A.title) || "label");
53315
+ }, [A, w] = useState([]), [M, N] = useState([]), [E, z] = useState(!0), O = useLabelUiSchema(i, (k == null ? void 0 : k.title) || "label");
53307
53316
  if (!i)
53308
53317
  return null;
53309
53318
  const R = (K) => {
@@ -53365,11 +53374,11 @@ const ActionInitializerItem = (e) => {
53365
53374
  {
53366
53375
  className: "Tree",
53367
53376
  onExpand: R,
53368
- expandedKeys: k,
53377
+ expandedKeys: A,
53369
53378
  autoExpandParent: E,
53370
53379
  treeData: u,
53371
53380
  onSelect: j,
53372
- fieldNames: A,
53381
+ fieldNames: k,
53373
53382
  titleRender: (K) => /* @__PURE__ */ jsx(EllipsisWithTooltip, { ellipsis: !0, children: getLabelFormatValue(O, c(K[I])) }),
53374
53383
  selectedKeys: M,
53375
53384
  blockNode: !0
@@ -53391,10 +53400,10 @@ const ActionInitializerItem = (e) => {
53391
53400
  label: u((v = y == null ? void 0 : y.uiSchema) == null ? void 0 : v.title) || (y == null ? void 0 : y.name)
53392
53401
  };
53393
53402
  }), h = (y) => {
53394
- var A, k, w;
53403
+ var k, A, w;
53395
53404
  const v = {
53396
53405
  "x-uid": t["x-uid"]
53397
- }, I = F(g(g({}, (k = (A = l == null ? void 0 : l.uiSchema) == null ? void 0 : A["x-component-props"]) == null ? void 0 : k.fieldNames), (w = t["x-component-props"]) == null ? void 0 : w.fieldNames), {
53406
+ }, I = F(g(g({}, (A = (k = l == null ? void 0 : l.uiSchema) == null ? void 0 : k["x-component-props"]) == null ? void 0 : A.fieldNames), (w = t["x-component-props"]) == null ? void 0 : w.fieldNames), {
53398
53407
  label: y
53399
53408
  });
53400
53409
  t["x-component-props"] = t["x-component-props"] || {}, t["x-component-props"].fieldNames = I, v["x-component-props"] = t["x-component-props"], d.emit("patch", {