@nocobase/client 1.8.5 → 1.8.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/es/index.mjs CHANGED
@@ -3676,6 +3676,9 @@ const bp = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3676
3676
  get useDatetimeVariableContext() {
3677
3677
  return useDatetimeVariableContext;
3678
3678
  },
3679
+ get useDeleteRouteSchema() {
3680
+ return useDeleteRouteSchema;
3681
+ },
3679
3682
  get useDesignable() {
3680
3683
  return useDesignable;
3681
3684
  },
@@ -6234,7 +6237,7 @@ const HEADERS_DATA_SOURCE_KEY = "x-data-source", isTitleField = (e, t) => {
6234
6237
  }
6235
6238
  const p = (y, { exclude: v = [], depth: I = 0, maxDepth: F, prefix: R = "" }) => I > F ? [] : o(y).map((T) => {
6236
6239
  var $;
6237
- if (v.includes(T.name) || !T.interface || ["sort", "password", "sequence"].includes(T.type) || n && n(T))
6240
+ if (v.includes(T.name) || !T.interface || I === 0 && ["sort", "password", "sequence"].includes(T.type) || n && n(T))
6238
6241
  return;
6239
6242
  const D = {
6240
6243
  type: "duplicate",
@@ -6255,7 +6258,7 @@ const HEADERS_DATA_SOURCE_KEY = "x-data-source", isTitleField = (e, t) => {
6255
6258
  depth: I + 1,
6256
6259
  maxDepth: F,
6257
6260
  prefix: B.key,
6258
- exclude: ["id", ...systemKeys]
6261
+ exclude: ["id", ...systemKeys.filter((O) => O !== "sort")]
6259
6262
  })), B;
6260
6263
  }).filter(Boolean), m = (y, { prefix: v, maxDepth: I, depth: F = 0, exclude: R = [] }) => F > I ? [] : o(y).map((T) => {
6261
6264
  var $;
@@ -6310,15 +6313,15 @@ const HEADERS_DATA_SOURCE_KEY = "x-data-source", isTitleField = (e, t) => {
6310
6313
  getOnCheck: C,
6311
6314
  getScopeDataSource: (y) => {
6312
6315
  const v = o(y), I = (T, D) => {
6313
- var O, N;
6316
+ var L, N;
6314
6317
  if (!T.interface)
6315
6318
  return;
6316
6319
  const B = i(T.interface);
6317
6320
  if (!(B != null && B.filterable))
6318
6321
  return;
6319
- const { nested: $, children: L, operators: j } = B.filterable, w = {
6322
+ const { nested: $, children: O, operators: j } = B.filterable, w = {
6320
6323
  name: T.name,
6321
- title: ((O = T == null ? void 0 : T.uiSchema) == null ? void 0 : O.title) || T.name,
6324
+ title: ((L = T == null ? void 0 : T.uiSchema) == null ? void 0 : L.title) || T.name,
6322
6325
  schema: T == null ? void 0 : T.uiSchema,
6323
6326
  operators: ((N = j == null ? void 0 : j.filter) == null ? void 0 : N.call(j, (k) => !(k != null && k.visible) || k.visible(T))) || [],
6324
6327
  interface: T.interface
@@ -6326,7 +6329,7 @@ const HEADERS_DATA_SOURCE_KEY = "x-data-source", isTitleField = (e, t) => {
6326
6329
  if (!(T.target && D > 2)) {
6327
6330
  if (D > 2)
6328
6331
  return w;
6329
- if (L != null && L.length && (w.children = L), $) {
6332
+ if (O != null && O.length && (w.children = O), $) {
6330
6333
  const k = o(T.target), M = F(k, D + 1).filter(Boolean);
6331
6334
  w.children = w.children || [], w.children.push(...M);
6332
6335
  }
@@ -6335,8 +6338,8 @@ const HEADERS_DATA_SOURCE_KEY = "x-data-source", isTitleField = (e, t) => {
6335
6338
  }, F = (T, D) => {
6336
6339
  const B = [];
6337
6340
  return T.forEach(($) => {
6338
- const L = I($, D);
6339
- L && B.push(L);
6341
+ const O = I($, D);
6342
+ O && B.push(O);
6340
6343
  }), B;
6341
6344
  };
6342
6345
  return F(v, 1);
@@ -6373,7 +6376,7 @@ function loadChildren$1({ node: e, traverseAssociations: t, traverseFields: n, s
6373
6376
  prefix: e.key,
6374
6377
  maxDepth: 1
6375
6378
  }) : (["hasOne", "hasMany"].includes(e.field.type) || (e == null ? void 0 : e.type) === "duplicate") && (i = n(e.field.target, {
6376
- exclude: ["id", ...o],
6379
+ exclude: ["id", ...o.filter((l) => l !== "sort")],
6377
6380
  prefix: e.key,
6378
6381
  maxDepth: 1
6379
6382
  })), i.length ? a.children = i : a.isLeaf = !0, i;
@@ -7084,14 +7087,14 @@ const collectFieldStateOfLinkageRules = ({
7084
7087
  action: l,
7085
7088
  conditionType: c
7086
7089
  }, u) => {
7087
- var S, y, v, I, F, R, T, D, B, $, L, j, w, O;
7090
+ var S, y, v, I, F, R, T, D, B, $, O, j, w, L;
7088
7091
  const d = ((S = n == null ? void 0 : n.stateOfLinkageRules) == null ? void 0 : S.required) || [(y = n == null ? void 0 : n.initStateOfLinkageRules) == null ? void 0 : y.required], p = ((v = n == null ? void 0 : n.stateOfLinkageRules) == null ? void 0 : v.display) || [(I = n == null ? void 0 : n.initStateOfLinkageRules) == null ? void 0 : I.display], m = ((F = n == null ? void 0 : n.stateOfLinkageRules) == null ? void 0 : F.pattern) || [(R = n == null ? void 0 : n.initStateOfLinkageRules) == null ? void 0 : R.pattern], h = ((T = n == null ? void 0 : n.stateOfLinkageRules) == null ? void 0 : T.value) || [(D = n == null ? void 0 : n.initStateOfLinkageRules) == null ? void 0 : D.value], g = ((B = n == null ? void 0 : n.stateOfLinkageRules) == null ? void 0 : B.dataSource) || [($ = n == null ? void 0 : n.initStateOfLinkageRules) == null ? void 0 : $.dataSource], { evaluate: f } = evaluators.get("formula.js"), C = {
7089
7092
  ruleGroup: o,
7090
7093
  variables: r,
7091
7094
  localVariables: a,
7092
7095
  variableNameOfLeftCondition: i,
7093
7096
  conditionType: c
7094
- }, b = ((L = n == null ? void 0 : n.stateOfLinkageRules) == null ? void 0 : L.dateScope) || [(j = n == null ? void 0 : n.initStateOfLinkageRules) == null ? void 0 : j.dateScope];
7097
+ }, b = ((O = n == null ? void 0 : n.stateOfLinkageRules) == null ? void 0 : O.dateScope) || [(j = n == null ? void 0 : n.initStateOfLinkageRules) == null ? void 0 : j.dateScope];
7095
7098
  switch (e) {
7096
7099
  case ActionType.Required:
7097
7100
  d.push(getTempFieldState(conditionAnalyses(C, u), !0)), n.stateOfLinkageRules = P(x({}, n.stateOfLinkageRules), {
@@ -7143,7 +7146,7 @@ const collectFieldStateOfLinkageRules = ({
7143
7146
  break;
7144
7147
  case ActionType.Options:
7145
7148
  {
7146
- const N = (O = (w = n.data) == null ? void 0 : w.dataSource) == null ? void 0 : O.filter((k) => t.value.includes(k.value));
7149
+ const N = (L = (w = n.data) == null ? void 0 : w.dataSource) == null ? void 0 : L.filter((k) => t.value.includes(k.value));
7147
7150
  g.push(getTempFieldState(conditionAnalyses(C, u), N || [])), n.stateOfLinkageRules = P(x({}, n.stateOfLinkageRules), {
7148
7151
  dataSource: g
7149
7152
  });
@@ -8302,11 +8305,11 @@ function withInitializer(e) {
8302
8305
  style: C,
8303
8306
  componentProps: b
8304
8307
  } = n, S = l ? l() : i, y = c(u), v = useCallback(
8305
- (O) => {
8306
- S ? S(y(O, { isInSubTable: a })) : r(d, y(O, { isInSubTable: a }), { onSuccess: p });
8308
+ (L) => {
8309
+ S ? S(y(L, { isInSubTable: a })) : r(d, y(L, { isInSubTable: a }), { onSuccess: p });
8307
8310
  },
8308
8311
  [S, y, a, r, d, p]
8309
- ), { wrapSSR: I, hashId: F, componentCls: R } = useSchemaInitializerStyles(), [T, D] = useState(!1), { token: B } = theme.useToken(), $ = useNiceDropdownMaxHeight([T]), L = useMemo(
8312
+ ), { wrapSSR: I, hashId: F, componentCls: R } = useSchemaInitializerStyles(), [T, D] = useState(!1), { token: B } = theme.useToken(), $ = useNiceDropdownMaxHeight([T]), O = useMemo(
8310
8313
  () => x({
8311
8314
  options: n,
8312
8315
  style: C
@@ -8346,7 +8349,7 @@ function withInitializer(e) {
8346
8349
  options: n,
8347
8350
  insert: v
8348
8351
  },
8349
- children: f === !1 ? React.createElement(e, L) : /* @__PURE__ */ jsx(
8352
+ children: f === !1 ? React.createElement(e, O) : /* @__PURE__ */ jsx(
8350
8353
  Popover,
8351
8354
  P(x({
8352
8355
  zIndex: 9999,
@@ -8374,7 +8377,7 @@ function withInitializer(e) {
8374
8377
  }
8375
8378
  ) })
8376
8379
  ),
8377
- children: React.createElement(e, L)
8380
+ children: React.createElement(e, O)
8378
8381
  })
8379
8382
  )
8380
8383
  }
@@ -8597,6 +8600,26 @@ const titleWrapperStyle = {
8597
8600
  /* @__PURE__ */ jsx(e, x({}, t)),
8598
8601
  /* @__PURE__ */ jsx(Tooltip, { title: n, children: /* @__PURE__ */ jsx(QuestionCircleOutlined, { style: { zIndex: 1 } }) })
8599
8602
  ] }) : /* @__PURE__ */ jsx(e, x({}, t));
8603
+ }, { evaluate } = evaluators.get("formula.js"), useEvaluatedExpression = (e) => {
8604
+ const t = useVariables$1(), n = useLocalVariables$1(), [o, r] = useState();
8605
+ return useEffect(() => {
8606
+ z(void 0, null, function* () {
8607
+ if (e == null || e === "") {
8608
+ r(void 0);
8609
+ return;
8610
+ }
8611
+ const { exp: i, scope: l } = yield replaceVariables(e, {
8612
+ variables: t,
8613
+ localVariables: n
8614
+ });
8615
+ try {
8616
+ const c = evaluate(i, x({ now: () => (/* @__PURE__ */ new Date()).toString() }, l));
8617
+ r(c);
8618
+ } catch (c) {
8619
+ console.error(c);
8620
+ }
8621
+ });
8622
+ }, [t.parseVariable, e, n]), o;
8600
8623
  };
8601
8624
  class SchemaInitializer {
8602
8625
  constructor(t) {
@@ -8746,7 +8769,7 @@ function addAppVersion(e, t) {
8746
8769
  addAppVersion((o = e.properties) == null ? void 0 : o[n], t);
8747
8770
  }), e;
8748
8771
  }
8749
- const name = "@nocobase/client", version = "1.8.5", license = "AGPL-3.0", main = "lib/index.js", module = "es/index.mjs", types = "es/index.d.ts", dependencies = {
8772
+ const name = "@nocobase/client", version = "1.8.7", license = "AGPL-3.0", main = "lib/index.js", module = "es/index.mjs", types = "es/index.d.ts", dependencies = {
8750
8773
  "@ahooksjs/use-url-state": "3.5.1",
8751
8774
  "@ant-design/cssinjs": "^1.11.1",
8752
8775
  "@ant-design/icons": "^5.6.1",
@@ -8767,9 +8790,9 @@ const name = "@nocobase/client", version = "1.8.5", license = "AGPL-3.0", main =
8767
8790
  "@formily/reactive-react": "^2.2.27",
8768
8791
  "@formily/shared": "^2.2.27",
8769
8792
  "@formily/validator": "^2.2.27",
8770
- "@nocobase/evaluators": "1.8.5",
8771
- "@nocobase/sdk": "1.8.5",
8772
- "@nocobase/utils": "1.8.5",
8793
+ "@nocobase/evaluators": "1.8.7",
8794
+ "@nocobase/sdk": "1.8.7",
8795
+ "@nocobase/utils": "1.8.7",
8773
8796
  ahooks: "^3.7.2",
8774
8797
  antd: "5.24.2",
8775
8798
  "antd-style": "3.7.1",
@@ -8780,6 +8803,7 @@ const name = "@nocobase/client", version = "1.8.5", license = "AGPL-3.0", main =
8780
8803
  "file-saver": "^2.0.5",
8781
8804
  filesize: "9.0.11",
8782
8805
  flat: "^5.0.2",
8806
+ "html5-qrcode": "^2.3.8",
8783
8807
  i18next: "^22.4.9",
8784
8808
  "i18next-http-backend": "^2.1.1",
8785
8809
  ignore: "^5.2.0",
@@ -8793,6 +8817,7 @@ const name = "@nocobase/client", version = "1.8.5", license = "AGPL-3.0", main =
8793
8817
  mime: "^4.0.4",
8794
8818
  "mime-match": "^1.0.2",
8795
8819
  "react-beautiful-dnd": "^13.1.0",
8820
+ "react-device-detect": "2.2.3",
8796
8821
  "react-drag-listview": "^0.1.9",
8797
8822
  "react-error-boundary": "^4.0.10",
8798
8823
  "react-helmet": "^6.1.0",
@@ -8818,8 +8843,7 @@ const name = "@nocobase/client", version = "1.8.5", license = "AGPL-3.0", main =
8818
8843
  "@types/react-big-calendar": "^1.6.4",
8819
8844
  "axios-mock-adapter": "^1.20.0",
8820
8845
  dumi: "2.2.14",
8821
- "dumi-theme-nocobase": "^0.2.28",
8822
- "html5-qrcode": "^2.3.8"
8846
+ "dumi-theme-nocobase": "^0.2.28"
8823
8847
  }, clientPkg = {
8824
8848
  name,
8825
8849
  version,
@@ -9937,11 +9961,11 @@ const TableCellRender = ({ record: e, columnSchema: t, uiSchema: n, filterProper
9937
9961
  }
9938
9962
  `, [o.paddingContentVerticalLG, o.marginSM, o.margin]), b = useCollection(), S = useMemo(() => withTooltipComponent(NocoBaseRecursionField), []), y = useMemo(
9939
9963
  () => d == null ? void 0 : d.map((I) => {
9940
- var L, j, w, O;
9964
+ var O, j, w, L;
9941
9965
  const F = I.reduceProperties((N, k) => {
9942
9966
  if (isCollectionFieldComponent(k))
9943
9967
  return N.concat([k]);
9944
- }, []), R = (F == null ? void 0 : F.length) > 0 ? F[0].name : I.name, T = !!((L = I["x-component-props"]) != null && L.columnHidden), { uiSchema: D, defaultValue: B, interface: $ } = (b == null ? void 0 : b.getField(R)) || {};
9968
+ }, []), R = (F == null ? void 0 : F.length) > 0 ? F[0].name : I.name, T = !!((O = I["x-component-props"]) != null && O.columnHidden), { uiSchema: D, defaultValue: B, interface: $ } = (b == null ? void 0 : b.getField(R)) || {};
9945
9969
  return I.title = n(I == null ? void 0 : I.title, { ns: NAMESPACE_UI_SCHEMA }), D && (D.default = B), P(x({
9946
9970
  title: /* @__PURE__ */ jsx(RefreshComponentProvider, { refresh: g, children: /* @__PURE__ */ jsx(
9947
9971
  S,
@@ -9958,7 +9982,7 @@ const TableCellRender = ({ record: e, columnSchema: t, uiSchema: n, filterProper
9958
9982
  sorter: (w = I["x-component-props"]) == null ? void 0 : w.sorter,
9959
9983
  columnHidden: T
9960
9984
  }, I["x-component-props"]), {
9961
- width: T && !l ? 0 : ((O = I["x-component-props"]) == null ? void 0 : O.width) || 100,
9985
+ width: T && !l ? 0 : ((L = I["x-component-props"]) == null ? void 0 : L.width) || 100,
9962
9986
  render: (N, k, M) => /* @__PURE__ */ jsx(RefreshComponentProvider, { refresh: g, children: /* @__PURE__ */ jsx(
9963
9987
  TableCellRender,
9964
9988
  {
@@ -10191,7 +10215,7 @@ const BodyRowComponent$1 = React.memo((e) => {
10191
10215
  });
10192
10216
  BodyRowComponent$1.displayName = "BodyRowComponent";
10193
10217
  const InternalBodyCellComponent$1 = React.memo((e) => {
10194
- const p = e, { record: t, schema: n, rowIndex: o, isSubTable: r } = p, a = W(p, ["record", "schema", "rowIndex", "isSubTable"]), i = n == null ? void 0 : n[LinkageRuleDataKeyMap.style], [l, c] = useState({}), u = !!(n != null && n.properties) && Object.values(n.properties).some((m) => m["x-read-pretty"] === !0), d = useMemo(
10218
+ const p = e, { record: t, schema: n, rowIndex: o, isSubTable: r } = p, a = W(p, ["record", "schema", "rowIndex", "isSubTable"]), i = n == null ? void 0 : n[LinkageRuleDataKeyMap.style], [l, c] = useState({}), u = !!(n != null && n.properties) && Object.values(n.properties).some((m) => m["x-read-pretty"] === !0) || (n == null ? void 0 : n["x-action-column"]) === "actions", d = useMemo(
10195
10219
  () => x(x({ overflow: "hidden" }, e.style), l),
10196
10220
  [e.style, l]
10197
10221
  );
@@ -10341,8 +10365,8 @@ const Table$2 = withDynamicSchemaProps(
10341
10365
  "loading",
10342
10366
  "onClickRow",
10343
10367
  "value"
10344
- ]), y = useArrayField$1(S), v = useFieldSchema(), { size: I = "small" } = (v == null ? void 0 : v["x-component-props"]) || {}, F = useCollection(), T = ((be = v == null ? void 0 : v.parent) == null ? void 0 : be["x-decorator"]) === "TableSelectorProvider" ? useTableSelectorContext() : useTableBlockContext(), { expandFlag: D, allIncludesChildren: B, enableIndexColumn: $ } = T, L = useMemoizedFn(S.onRowDragEnd || (() => {
10345
- })), j = usePaginationProps$3(n, a, e), w = useTableColumns$2(S, j), [O, N] = useState(() => D ? B : []), [k, M] = useState(((Se = y == null ? void 0 : y.data) == null ? void 0 : Se.selectedRowKeys) || []), [q, E] = useState([]), V = (p == null ? void 0 : p.type) !== "none", H = useRef(/* @__PURE__ */ new Map()), U = useMemo(() => css`
10368
+ ]), y = useArrayField$1(S), v = useFieldSchema(), { size: I = "small" } = (v == null ? void 0 : v["x-component-props"]) || {}, F = useCollection(), T = ((be = v == null ? void 0 : v.parent) == null ? void 0 : be["x-decorator"]) === "TableSelectorProvider" ? useTableSelectorContext() : useTableBlockContext(), { expandFlag: D, allIncludesChildren: B, enableIndexColumn: $ } = T, O = useMemoizedFn(S.onRowDragEnd || (() => {
10369
+ })), j = usePaginationProps$3(n, a, e), w = useTableColumns$2(S, j), [L, N] = useState(() => D ? B : []), [k, M] = useState(((Se = y == null ? void 0 : y.data) == null ? void 0 : Se.selectedRowKeys) || []), [q, E] = useState([]), V = (p == null ? void 0 : p.type) !== "none", H = useRef(/* @__PURE__ */ new Map()), U = useMemo(() => css`
10346
10370
  & > td {
10347
10371
  background-color: ${t.controlItemBgActive} !important;
10348
10372
  }
@@ -10368,7 +10392,7 @@ const Table$2 = withDynamicSchemaProps(
10368
10392
  }), [C, q]);
10369
10393
  useDeepCompareEffect(() => {
10370
10394
  const Z = D ? B : [];
10371
- _.isEqual(Z, O) || N(Z);
10395
+ _.isEqual(Z, L) || N(Z);
10372
10396
  }, [D, B]);
10373
10397
  const K = useCallback((Z) => {
10374
10398
  if (m)
@@ -10396,10 +10420,10 @@ const Table$2 = withDynamicSchemaProps(
10396
10420
  return;
10397
10421
  }
10398
10422
  const ie = (Pe = (ve = (ye = re.active) == null ? void 0 : ye.data.current) == null ? void 0 : ve.sortable) == null ? void 0 : Pe.index, ce = (Ae = (Ie = (Fe = re.over) == null ? void 0 : Fe.data.current) == null ? void 0 : Ie.sortable) == null ? void 0 : Ae.index, fe = (b == null ? void 0 : b[ie]) || re.active, Re = (b == null ? void 0 : b[ce]) || re.over;
10399
- y.move(ie, ce), L({ from: fe, to: Re });
10423
+ y.move(ie, ce), O({ from: fe, to: Re });
10400
10424
  }, []);
10401
10425
  return /* @__PURE__ */ jsx(DndContext, { onDragEnd: oe, children: /* @__PURE__ */ jsx("tbody", x({}, Z)) });
10402
- }, [y, L]);
10426
+ }, [y, O]);
10403
10427
  Q.displayName = "BodyWrapperComponent";
10404
10428
  const te = useMemo(() => ({
10405
10429
  header: {
@@ -10497,14 +10521,14 @@ const Table$2 = withDynamicSchemaProps(
10497
10521
  [q, Y, JSON.stringify(m)]
10498
10522
  ), ge = useCallback(
10499
10523
  (Z, oe) => {
10500
- const re = Z ? [...O, oe[F.getPrimaryKey()]] : O.filter((ie) => oe[F.getPrimaryKey()] !== ie);
10524
+ const re = Z ? [...L, oe[F.getPrimaryKey()]] : L.filter((ie) => oe[F.getPrimaryKey()] !== ie);
10501
10525
  N(re), g == null || g(Z, oe);
10502
10526
  },
10503
- [O, g, F]
10527
+ [L, g, F]
10504
10528
  ), xe = useMemo(() => ({
10505
10529
  onExpand: ge,
10506
- expandedRowKeys: O
10507
- }), [O, ge]);
10530
+ expandedRowKeys: L
10531
+ }), [L, ge]);
10508
10532
  return (
10509
10533
  // If spinning is set to undefined, it will cause the subtable to always display loading, so we need to convert it here.
10510
10534
  // We use Spin here instead of Table's loading prop because using Spin here reduces unnecessary re-renders.
@@ -10685,22 +10709,22 @@ const InternalTableBlockProvider = (e) => {
10685
10709
  const t = useDataSourceManager(), n = useDataSource(), o = useCollectionManager(), r = e || (n == null ? void 0 : n.key) || void 0, [a, i] = useState(uid()), { refresh: l } = useSchemaComponentContext(), c = useMemo(
10686
10710
  () => {
10687
10711
  var w;
10688
- return (w = t == null ? void 0 : t.collectionFieldInterfaceManager) == null ? void 0 : w.getFieldInterfaces().reduce((O, N) => (O[N.name] = N, O), {});
10712
+ return (w = t == null ? void 0 : t.collectionFieldInterfaceManager) == null ? void 0 : w.getFieldInterfaces().reduce((L, N) => (L[N.name] = N, L), {});
10689
10713
  },
10690
10714
  [t, a]
10691
10715
  ), u = useMemo(() => t == null ? void 0 : t.collectionTemplateManager.getCollectionTemplates(), [t, a]), d = useCallback(() => {
10692
- var w, O;
10693
- return (O = (w = t == null ? void 0 : t.getDataSource(r)) == null ? void 0 : w.collectionManager) == null ? void 0 : O.getCollections().map((N) => N.getOptions());
10716
+ var w, L;
10717
+ return (L = (w = t == null ? void 0 : t.getDataSource(r)) == null ? void 0 : w.collectionManager) == null ? void 0 : L.getCollections().map((N) => N.getOptions());
10694
10718
  }, [t, n]), p = useCallback(
10695
10719
  (w) => {
10696
- var O;
10697
- return o && !w ? o : (O = t == null ? void 0 : t.getDataSource(w || r)) == null ? void 0 : O.collectionManager;
10720
+ var L;
10721
+ return o && !w ? o : (L = t == null ? void 0 : t.getDataSource(w || r)) == null ? void 0 : L.collectionManager;
10698
10722
  },
10699
10723
  [o, t, r]
10700
10724
  ), m = useMemo(
10701
10725
  () => {
10702
- var w, O;
10703
- return (O = (w = t == null ? void 0 : t.getDataSource(DEFAULT_DATA_SOURCE_KEY)) == null ? void 0 : w.collectionManager) == null ? void 0 : O.getCollections();
10726
+ var w, L;
10727
+ return (L = (w = t == null ? void 0 : t.getDataSource(DEFAULT_DATA_SOURCE_KEY)) == null ? void 0 : w.collectionManager) == null ? void 0 : L.getCollections();
10704
10728
  },
10705
10729
  [t, a]
10706
10730
  ), h = useCallback(
@@ -10714,50 +10738,50 @@ const InternalTableBlockProvider = (e) => {
10714
10738
  }),
10715
10739
  [t]
10716
10740
  ), f = useCompile(), C = useCallback(
10717
- (w, O) => {
10741
+ (w, L) => {
10718
10742
  var N, k;
10719
- return ((k = (N = p(O)) == null ? void 0 : N.getCollection(w)) == null ? void 0 : k.getInheritedFields()) || [];
10743
+ return ((k = (N = p(L)) == null ? void 0 : N.getCollection(w)) == null ? void 0 : k.getInheritedFields()) || [];
10720
10744
  },
10721
10745
  [t, p]
10722
10746
  ), b = useCallback(
10723
- (w, O) => {
10747
+ (w, L) => {
10724
10748
  var k, M;
10725
10749
  if (!w)
10726
10750
  return [];
10727
- const N = (k = p(O)) == null ? void 0 : k.getCollection(w);
10751
+ const N = (k = p(L)) == null ? void 0 : k.getCollection(w);
10728
10752
  return ((M = N == null ? void 0 : N.getAllFields) == null ? void 0 : M.call(N)) || (N == null ? void 0 : N.getFields()) || [];
10729
10753
  },
10730
10754
  [t, p]
10731
10755
  ), S = useCallback(
10732
- (w, O) => {
10756
+ (w, L) => {
10733
10757
  var N;
10734
10758
  if (!(!w || w.split(".").length < 2))
10735
- return (N = p(O)) == null ? void 0 : N.getCollectionField(w);
10759
+ return (N = p(L)) == null ? void 0 : N.getCollectionField(w);
10736
10760
  },
10737
10761
  [t, p]
10738
10762
  ), y = useCallback(
10739
- (w, O) => {
10763
+ (w, L) => {
10740
10764
  var N, k;
10741
- return w ? ((k = (N = p(O)) == null ? void 0 : N.getCollection(w)) == null ? void 0 : k.getParentCollectionsName()) || [] : [];
10765
+ return w ? ((k = (N = p(L)) == null ? void 0 : N.getCollection(w)) == null ? void 0 : k.getParentCollectionsName()) || [] : [];
10742
10766
  },
10743
10767
  [t, p]
10744
10768
  ), v = useCallback(
10745
- (w, O = !1, N) => {
10769
+ (w, L = !1, N) => {
10746
10770
  var q;
10747
10771
  if (!w)
10748
10772
  return [];
10749
10773
  const k = (q = p(N)) == null ? void 0 : q.getCollection(w);
10750
- return (k == null ? void 0 : k.getChildrenCollections(O)) || [];
10774
+ return (k == null ? void 0 : k.getChildrenCollections(L)) || [];
10751
10775
  },
10752
10776
  [t, p]
10753
10777
  ), I = useCallback(
10754
- (w, O) => {
10778
+ (w, L) => {
10755
10779
  var N, k;
10756
- return w ? ((k = (N = p(O)) == null ? void 0 : N.getCollection(w)) == null ? void 0 : k.getCurrentFields()) || [] : [];
10780
+ return w ? ((k = (N = p(L)) == null ? void 0 : N.getCollection(w)) == null ? void 0 : k.getCurrentFields()) || [] : [];
10757
10781
  },
10758
10782
  [t, p]
10759
10783
  ), F = useCallback(
10760
- (w, O, N, k) => {
10784
+ (w, L, N, k) => {
10761
10785
  var ee;
10762
10786
  const {
10763
10787
  association: M = !1,
@@ -10774,16 +10798,16 @@ const InternalTableBlockProvider = (e) => {
10774
10798
  return;
10775
10799
  if (q[w])
10776
10800
  return _.cloneDeep(q[w]);
10777
- O && typeof O == "string" && (O = [O]), N && typeof N == "string" && (N = [N]);
10801
+ L && typeof L == "string" && (L = [L]), N && typeof N == "string" && (N = [N]);
10778
10802
  const K = b(w, J), X = (ee = K == null ? void 0 : K.filter(
10779
- (Q) => Q.interface && !U.includes(Q.interface) && (H || O && O.includes(Q.type) || N && N.includes(Q.interface) || (M && Q.target && Q.target !== w && Array.isArray(M) ? M.includes(Q.interface) : !1))
10803
+ (Q) => Q.interface && !U.includes(Q.interface) && (H || L && L.includes(Q.type) || N && N.includes(Q.interface) || (M && Q.target && Q.target !== w && Array.isArray(M) ? M.includes(Q.interface) : !1))
10780
10804
  )) == null ? void 0 : ee.map((Q) => {
10781
10805
  var ne, se;
10782
10806
  const te = x({
10783
10807
  value: Y && G ? `${G}.${Q.name}` : Q.name,
10784
10808
  label: f((ne = Q == null ? void 0 : Q.uiSchema) == null ? void 0 : ne.title) || Q.name
10785
10809
  }, Q);
10786
- return M && Q.target && (te.children = E.includes(Q.target) ? [] : F(Q.target, O, N, P(x({}, k), {
10810
+ return M && Q.target && (te.children = E.includes(Q.target) ? [] : F(Q.target, L, N, P(x({}, k), {
10787
10811
  cached: q,
10788
10812
  dataSource: J,
10789
10813
  collectionNames: [...E, Q.target],
@@ -10795,21 +10819,21 @@ const InternalTableBlockProvider = (e) => {
10795
10819
  },
10796
10820
  [b]
10797
10821
  ), R = useCallback(
10798
- (w, O) => {
10822
+ (w, L) => {
10799
10823
  var N;
10800
- return (N = p(O)) == null ? void 0 : N.getCollection(w);
10824
+ return (N = p(L)) == null ? void 0 : N.getCollection(w);
10801
10825
  },
10802
10826
  [t, p]
10803
10827
  ), T = useCallback(
10804
- (w, O) => {
10828
+ (w, L) => {
10805
10829
  var N, k;
10806
- return (k = (N = p(O)) == null ? void 0 : N.getCollection(w)) == null ? void 0 : k.getAllCollectionsInheritChain();
10830
+ return (k = (N = p(L)) == null ? void 0 : N.getCollection(w)) == null ? void 0 : k.getAllCollectionsInheritChain();
10807
10831
  },
10808
10832
  [t, p]
10809
10833
  ), D = useCallback(
10810
- (w, O) => () => {
10834
+ (w, L) => () => {
10811
10835
  var N, k;
10812
- return (k = (N = p(O)) == null ? void 0 : N.getCollection(w)) == null ? void 0 : k.getInheritCollectionsChain();
10836
+ return (k = (N = p(L)) == null ? void 0 : N.getCollection(w)) == null ? void 0 : k.getInheritCollectionsChain();
10813
10837
  },
10814
10838
  [t, p]
10815
10839
  ), B = useCallback(
@@ -10817,14 +10841,14 @@ const InternalTableBlockProvider = (e) => {
10817
10841
  [t]
10818
10842
  ), $ = useCallback(
10819
10843
  (w) => {
10820
- var O;
10821
- return (O = B(w.interface)) == null ? void 0 : O.titleUsable;
10844
+ var L;
10845
+ return (L = B(w.interface)) == null ? void 0 : L.titleUsable;
10822
10846
  },
10823
10847
  [B]
10824
- ), L = useCallback(
10825
- (w, O, N) => {
10848
+ ), O = useCallback(
10849
+ (w, L, N) => {
10826
10850
  var k, M;
10827
- return (M = (k = p(N)) == null ? void 0 : k.getCollection(O)) == null ? void 0 : M.getParentCollectionFields(w);
10851
+ return (M = (k = p(N)) == null ? void 0 : k.getCollection(L)) == null ? void 0 : M.getParentCollectionFields(w);
10828
10852
  },
10829
10853
  [t, p]
10830
10854
  ), j = useCallback(
@@ -10839,7 +10863,7 @@ const InternalTableBlockProvider = (e) => {
10839
10863
  getTemplate: j,
10840
10864
  getInterface: B,
10841
10865
  getCollections: d,
10842
- getParentCollectionFields: L,
10866
+ getParentCollectionFields: O,
10843
10867
  getInheritCollections: y,
10844
10868
  getChildrenCollections: v,
10845
10869
  refreshCM: g,
@@ -11050,14 +11074,14 @@ const popupsContextStorage = {}, getStoredPopupContext = (e) => popupsContextSto
11050
11074
  }, usePopupUtils = (e = {}) => {
11051
11075
  const t = useNavigateNoUpdate(), n = useLocationNoUpdate(), o = useFieldSchema(), r = useDataSourceKey(), a = useCollectionRecord(), i = useCollectionParentRecord(), l = useCollection(), c = useCollectionManager(), u = useAssociationName(), { visible: d, setVisible: p } = useContext(PopupVisibleProviderContext) || { visible: !1, setVisible: _.noop }, { params: m, currentLevel: h = 0 } = useCurrentPopupContext(), { getDataBlockRequest: g } = useDataBlockRequestGetter(), { isPopupVisibleControlledByURL: f } = usePopupSettings(), { setVisible: C } = useContext(ActionContext), { updatePopupContext: b } = usePopupContextInActionOrAssociationField(), S = useCurrentPopupContext(), y = useCallback(
11052
11076
  (w) => {
11053
- var O;
11054
- return (O = w || (i == null ? void 0 : i.data)) == null ? void 0 : O[c.getSourceKeyByAssociation(u)];
11077
+ var L;
11078
+ return (L = w || (i == null ? void 0 : i.data)) == null ? void 0 : L[c.getSourceKeyByAssociation(u)];
11055
11079
  },
11056
11080
  [i, u]
11057
11081
  ), v = useDataBlockRequestData(), I = useTableBlockContextBasicValue() || {}, F = e.setVisible || C, R = useCallback(
11058
11082
  ({
11059
11083
  tabKey: w,
11060
- popupUid: O,
11084
+ popupUid: L,
11061
11085
  recordData: N,
11062
11086
  sourceId: k,
11063
11087
  collection: M,
@@ -11065,7 +11089,7 @@ const popupsContextStorage = {}, getStoredPopupContext = (e) => popupsContextSto
11065
11089
  }) => {
11066
11090
  const E = c.getFilterByTK(u || l, N);
11067
11091
  return getPopupPathFromParams({
11068
- popupuid: O,
11092
+ popupuid: L,
11069
11093
  puid: q,
11070
11094
  collection: M,
11071
11095
  filterbytk: E,
@@ -11084,14 +11108,14 @@ const popupsContextStorage = {}, getStoredPopupContext = (e) => popupsContextSto
11084
11108
  }, [r, l, u]), D = useCallback(
11085
11109
  ({
11086
11110
  recordData: w,
11087
- parentRecordData: O,
11111
+ parentRecordData: L,
11088
11112
  collectionNameUsedInURL: N,
11089
11113
  popupUidUsedInURL: k,
11090
11114
  customActionSchema: M
11091
11115
  } = {}) => {
11092
11116
  if (!f())
11093
11117
  return F == null ? void 0 : F(!0);
11094
- const q = M || o, E = q == null ? void 0 : q["x-uid"], V = y(O);
11118
+ const q = M || o, E = q == null ? void 0 : q["x-uid"], V = y(L);
11095
11119
  w = w || (a == null ? void 0 : a.data);
11096
11120
  const H = R({
11097
11121
  popupUid: E,
@@ -11104,7 +11128,7 @@ const popupsContextStorage = {}, getStoredPopupContext = (e) => popupsContextSto
11104
11128
  if (_.last(U) === "/" && (U = U.slice(0, -1)), storePopupContext(E, {
11105
11129
  schema: q,
11106
11130
  record: new CollectionRecord({ isNew: !1, data: w }),
11107
- parentRecord: O ? new CollectionRecord({ isNew: !1, data: O }) : i,
11131
+ parentRecord: L ? new CollectionRecord({ isNew: !1, data: L }) : i,
11108
11132
  service: g(),
11109
11133
  dataSource: r,
11110
11134
  collection: l == null ? void 0 : l.name,
@@ -11154,11 +11178,11 @@ ${JSON.stringify(q, null, 2)}`
11154
11178
  m == null ? void 0 : m.popupuid
11155
11179
  ]), $ = useCallback(
11156
11180
  (w) => {
11157
- const O = y(), N = R({
11181
+ const L = y(), N = R({
11158
11182
  tabKey: w,
11159
11183
  popupUid: m == null ? void 0 : m.popupuid,
11160
11184
  recordData: a == null ? void 0 : a.data,
11161
- sourceId: O
11185
+ sourceId: L
11162
11186
  });
11163
11187
  let k = removeLastPopupPath(n.pathname);
11164
11188
  _.last(k) === "/" && (k = k.slice(0, -1)), t(`${k}${N}`, {
@@ -11166,8 +11190,8 @@ ${JSON.stringify(q, null, 2)}`
11166
11190
  });
11167
11191
  },
11168
11192
  [R, t, m == null ? void 0 : m.popupuid, a == null ? void 0 : a.data, n]
11169
- ), L = useCallback((w, O) => {
11170
- O.__popup = w;
11193
+ ), O = useCallback((w, L) => {
11194
+ L.__popup = w;
11171
11195
  }, []), j = useCallback((w) => w.__popup, []);
11172
11196
  return {
11173
11197
  /**
@@ -11178,7 +11202,7 @@ ${JSON.stringify(q, null, 2)}`
11178
11202
  * used to close popup by changing the url
11179
11203
  */
11180
11204
  closePopup: B,
11181
- savePopupSchemaToSchema: L,
11205
+ savePopupSchemaToSchema: O,
11182
11206
  getPopupSchemaFromSchema: j,
11183
11207
  context: S,
11184
11208
  /**
@@ -11974,20 +11998,18 @@ const designerCss$4 = ({ margin: e = "-18px -16px", padding: t = "18px 16px" } =
11974
11998
  }
11975
11999
  `, TableColumnActionBar$1 = observer$1(
11976
12000
  (e) => {
11977
- const t = useDesigner();
11978
- useFlag();
11979
- const { designable: n } = useSchemaComponentContext(), { token: o } = useToken$1();
11980
- return !n || t.isNullComponent ? e.children : /* @__PURE__ */ jsxs(
12001
+ const t = useDesigner(), { isInSubTable: n } = useFlag() || {}, { designable: o } = useSchemaComponentContext(), { token: r } = useToken$1(), { name: a } = (useBlockContext == null ? void 0 : useBlockContext()) || {};
12002
+ return !o || t.isNullComponent ? e.children : /* @__PURE__ */ jsx(
11981
12003
  SortableItem,
11982
12004
  {
11983
12005
  className: designerCss$4({
11984
- margin: `-${o.margin}px -${o.marginXS}px`,
11985
- padding: `${o.margin}px ${o.marginXS}px`
12006
+ margin: `-${r.margin}px -${r.marginXS}px`,
12007
+ padding: `${r.margin}px ${r.marginXS}px`
11986
12008
  }),
11987
- children: [
12009
+ children: /* @__PURE__ */ jsxs(BlockContext.Provider, { value: { name: n ? a : "taleColumn" }, children: [
11988
12010
  /* @__PURE__ */ jsx(t, {}),
11989
12011
  e.children
11990
- ]
12012
+ ] })
11991
12013
  }
11992
12014
  );
11993
12015
  },
@@ -12627,7 +12649,7 @@ const BaseVariableContext = React.createContext(null), BaseVariableProvider = (e
12627
12649
  return new Promise((T) => {
12628
12650
  setTimeout(() => {
12629
12651
  var $;
12630
- const B = (b && g(($ = I.field) == null ? void 0 : $.children) || getChildren$1(d(f(F, u, !0), I), {
12652
+ const B = (b && F === "attachments" && g(($ = I.field) == null ? void 0 : $.children) || getChildren$1(d(f(F, u, !0), I), {
12631
12653
  collectionField: e,
12632
12654
  uiSchema: t,
12633
12655
  targetFieldSchema: n,
@@ -12639,7 +12661,7 @@ const BaseVariableContext = React.createContext(null), BaseVariableProvider = (e
12639
12661
  isDisabled: C || isDisabledDefault,
12640
12662
  getCollectionField: S.getCollectionField,
12641
12663
  deprecated: p
12642
- }) || []).sort((L, j) => L.isLeaf && !j.isLeaf ? -1 : !L.isLeaf && j.isLeaf ? 1 : 0).sort((L, j) => L.disabled && !j.disabled ? 1 : !L.disabled && j.disabled ? -1 : 0);
12664
+ }) || []).sort((O, j) => O.isLeaf && !j.isLeaf ? -1 : !O.isLeaf && j.isLeaf ? 1 : 0).sort((O, j) => O.disabled && !j.disabled ? 1 : !O.disabled && j.disabled ? -1 : 0);
12643
12665
  if (B.length === 0) {
12644
12666
  I.disabled = !0, I.isLeaf = !0, T();
12645
12667
  return;
@@ -12998,7 +13020,7 @@ const DatePickerContext = React.createContext({ utc: !0 }), useDatePickerContext
12998
13020
  return B;
12999
13021
  },
13000
13022
  disabledMinutes: (B) => I && B === g.hour() ? C.filter(($) => $ < g.minute()) : F && B === f.hour() ? C.filter(($) => $ > f.minute()) : [],
13001
- disabledSeconds: (B, $) => I && B === g.hour() && $ === g.minute() ? C.filter((L) => L < g.second()) : F && B === f.hour() && $ === f.minute() ? C.filter((L) => L > f.second()) : []
13023
+ disabledSeconds: (B, $) => I && B === g.hour() && $ === g.minute() ? C.filter((O) => O < g.second()) : F && B === f.hour() && $ === f.minute() ? C.filter((O) => O > f.second()) : []
13002
13024
  };
13003
13025
  };
13004
13026
  i(() => b), c(() => S);
@@ -13906,7 +13928,7 @@ const ParentCollectionProvider = (e) => {
13906
13928
  collectionField: e,
13907
13929
  noDisabled: r,
13908
13930
  targetFieldSchema: a
13909
- }), { settings: $, shouldDisplayParentPopupRecord: L } = useParentPopupVariable({
13931
+ }), { settings: $, shouldDisplayParentPopupRecord: O } = useParentPopupVariable({
13910
13932
  schema: n,
13911
13933
  collectionField: e,
13912
13934
  noDisabled: r,
@@ -13917,7 +13939,7 @@ const ParentCollectionProvider = (e) => {
13917
13939
  collectionField: e,
13918
13940
  noDisabled: r,
13919
13941
  targetFieldSchema: a
13920
- }), { urlSearchParamsSettings: O, shouldDisplay: N } = useURLSearchParamsVariable();
13942
+ }), { urlSearchParamsSettings: L, shouldDisplay: N } = useURLSearchParamsVariable();
13921
13943
  return [...useMemo(() => [
13922
13944
  p,
13923
13945
  m,
@@ -13930,8 +13952,8 @@ const ParentCollectionProvider = (e) => {
13930
13952
  T && R,
13931
13953
  w && j,
13932
13954
  B && D,
13933
- L && $,
13934
- N && O
13955
+ O && $,
13956
+ N && L
13935
13957
  ].filter(Boolean).filter(u), [
13936
13958
  p,
13937
13959
  m,
@@ -13950,7 +13972,7 @@ const ParentCollectionProvider = (e) => {
13950
13972
  B,
13951
13973
  D,
13952
13974
  N,
13953
- O
13975
+ L
13954
13976
  ]), ...c.map(({ option: E }) => E)];
13955
13977
  }, VariableInput = (e) => {
13956
13978
  const {
@@ -13997,20 +14019,20 @@ const ParentCollectionProvider = (e) => {
13997
14019
  }));
13998
14020
  },
13999
14021
  [n, u]
14000
- ), L = m(
14022
+ ), O = m(
14001
14023
  B(_.isEmpty(I) ? T : I, {
14002
14024
  value: t
14003
14025
  })
14004
14026
  );
14005
14027
  return useEffect(() => {
14006
- C == null || C(L);
14028
+ C == null || C(O);
14007
14029
  }, [t, I]), /* @__PURE__ */ jsx(
14008
14030
  Variable.Input,
14009
14031
  {
14010
14032
  className: i,
14011
14033
  value: t,
14012
14034
  onChange: $,
14013
- scope: L,
14035
+ scope: O,
14014
14036
  style: r,
14015
14037
  changeOnSelect: y,
14016
14038
  hideVariableButton: f,
@@ -14312,8 +14334,8 @@ const SchemaSettingsDateFormat = function(t) {
14312
14334
  (o.componentProps.picker || "date") !== D.picker && !m && o.value && (o.value = void 0, o.initialValue = void 0, n.default = void 0, B.default = void 0), B["x-component-props"] = o.componentProps || {}, n["x-component-props"] = x(x({}, o.componentProps || {}), D), B["x-component-props"] = n["x-component-props"], o.componentProps = n["x-component-props"];
14313
14335
  const $ = o.path.entire.split(".");
14314
14336
  $.pop();
14315
- const L = $.join(".");
14316
- o.query(`${L}.*[0:].${n.name}`).forEach((j) => {
14337
+ const O = $.join(".");
14338
+ o.query(`${O}.*[0:].${n.name}`).forEach((j) => {
14317
14339
  j.props.name === n.name && ((o.componentProps.picker || "date") !== D.picker && !m && (j.value = void 0, j.initialValue = void 0), j.setComponentProps(x({}, D)));
14318
14340
  }), r.emit("patch", {
14319
14341
  schema: B
@@ -14345,13 +14367,13 @@ const getActionContext = (e) => {
14345
14367
  T != null && T.target && (u = p(
14346
14368
  `${T.target}.${((E = (q = o["x-component-props"]) == null ? void 0 : q.fieldNames) == null ? void 0 : E.label) || "id"}`
14347
14369
  ));
14348
- const B = (T == null ? void 0 : T.interface) === "m2o" && findParentFieldSchema(o), $ = B && p(B == null ? void 0 : B["x-collection-field"]), L = useTableBlockContext(), j = (T == null ? void 0 : T.interface) === "m2m" || (T == null ? void 0 : T.interface) === "mbm" || ($ == null ? void 0 : $.type) === "hasMany" && (T == null ? void 0 : T.interface) === "m2o", w = useCallback(
14370
+ const B = (T == null ? void 0 : T.interface) === "m2o" && findParentFieldSchema(o), $ = B && p(B == null ? void 0 : B["x-collection-field"]), O = useTableBlockContext(), j = (T == null ? void 0 : T.interface) === "m2m" || (T == null ? void 0 : T.interface) === "mbm" || ($ == null ? void 0 : $.type) === "hasMany" && (T == null ? void 0 : T.interface) === "m2o", w = useCallback(
14349
14371
  (V) => {
14350
14372
  const H = V.find((G) => G.value === "$nForm"), U = m(R);
14351
14373
  return !(U != null && U.length) && H && (H.children = formatVariableScop(v())), V;
14352
14374
  },
14353
14375
  [v, R]
14354
- ), O = useMemo(() => ({
14376
+ ), L = useMemo(() => ({
14355
14377
  ArrayCollapse: ArrayCollapse$2,
14356
14378
  FormLayout,
14357
14379
  VariableInput: (V) => /* @__PURE__ */ jsx(
@@ -14423,7 +14445,7 @@ const getActionContext = (e) => {
14423
14445
  b,
14424
14446
  w,
14425
14447
  i,
14426
- L.collection,
14448
+ O.collection,
14427
14449
  u,
14428
14450
  g
14429
14451
  ]), k = useCallback(
@@ -14443,7 +14465,7 @@ const getActionContext = (e) => {
14443
14465
  SchemaSettingsModalItem,
14444
14466
  {
14445
14467
  title: i("Set default value"),
14446
- components: O,
14468
+ components: L,
14447
14469
  width: 800,
14448
14470
  schema: N,
14449
14471
  onSubmit: k,
@@ -15313,10 +15335,10 @@ const useGetFilterOptions = () => {
15313
15335
  };
15314
15336
  });
15315
15337
  }, TableColumnDesigner$1 = (e) => {
15316
- var $, L, j, w, O, N, k, M, q, E, V, H;
15317
- const { uiSchema: t, fieldSchema: n, collectionField: o } = e, { form: r } = useFormBlockContext(), { getInterface: a, getCollection: i } = useCollectionManager_deprecated(), l = useField(), { t: c } = useTranslation(), u = useFieldSchema(), { dn: d } = useDesignable(), p = (($ = n == null ? void 0 : n["x-component-props"]) == null ? void 0 : $.fieldNames) || ((L = t == null ? void 0 : t["x-component-props"]) == null ? void 0 : L.fieldNames), m = useLabelFields$1((j = o == null ? void 0 : o.target) != null ? j : o == null ? void 0 : o.targetCollection), h = useColorFields((w = o == null ? void 0 : o.target) != null ? w : o == null ? void 0 : o.targetCollection), g = a(o == null ? void 0 : o.interface), f = i(o == null ? void 0 : o.target), C = isFileCollection$2(f), b = ["QuickEdit", "FormItem"].includes(n["x-decorator"]), { currentMode: S } = useAssociationFieldContext(), { isAllowToSetDefaultValue: y } = useIsAllowToSetDefaultValue({ collectionField: o, fieldSchema: n }), v = ["datetime", "createdAt", "updatedAt"].includes(o == null ? void 0 : o.interface), I = ["obo", "oho", "o2o", "o2m", "m2m", "m2o", "snapshot"].includes(
15338
+ var $, O, j, w, L, N, k, M, q, E, V, H;
15339
+ const { uiSchema: t, fieldSchema: n, collectionField: o } = e, { form: r } = useFormBlockContext(), { getInterface: a, getCollection: i } = useCollectionManager_deprecated(), l = useField(), { t: c } = useTranslation(), u = useFieldSchema(), { dn: d } = useDesignable(), p = (($ = n == null ? void 0 : n["x-component-props"]) == null ? void 0 : $.fieldNames) || ((O = t == null ? void 0 : t["x-component-props"]) == null ? void 0 : O.fieldNames), m = useLabelFields$1((j = o == null ? void 0 : o.target) != null ? j : o == null ? void 0 : o.targetCollection), h = useColorFields((w = o == null ? void 0 : o.target) != null ? w : o == null ? void 0 : o.targetCollection), g = a(o == null ? void 0 : o.interface), f = i(o == null ? void 0 : o.target), C = isFileCollection$2(f), b = ["QuickEdit", "FormItem"].includes(n["x-decorator"]), { currentMode: S } = useAssociationFieldContext(), { isAllowToSetDefaultValue: y } = useIsAllowToSetDefaultValue({ collectionField: o, fieldSchema: n }), v = ["datetime", "createdAt", "updatedAt"].includes(o == null ? void 0 : o.interface), I = ["obo", "oho", "o2o", "o2m", "m2m", "m2o", "snapshot"].includes(
15318
15340
  o == null ? void 0 : o.interface
15319
- ), F = useFieldModeOptions({ fieldSchema: n }), R = ((O = n == null ? void 0 : n["x-component-props"]) == null ? void 0 : O.mode) || "Select";
15341
+ ), F = useFieldModeOptions({ fieldSchema: n }), R = ((L = n == null ? void 0 : n["x-component-props"]) == null ? void 0 : L.mode) || "Select";
15320
15342
  let T = "editable";
15321
15343
  n["x-disabled"] === !0 && (T = "readonly"), n["x-read-pretty"] === !0 && (T = "read-pretty");
15322
15344
  const D = I && R === "Select", B = () => {
@@ -16675,8 +16697,8 @@ const useFormItemInitializerFields = (e) => {
16675
16697
  schema: S
16676
16698
  };
16677
16699
  return l == "Kanban" && (y.find = (D, B, $) => {
16678
- const L = findSchema(D, "x-component", l);
16679
- return findSchema(L, B, $);
16700
+ const O = findSchema(D, "x-component", l);
16701
+ return findSchema(O, B, $);
16680
16702
  }), y;
16681
16703
  });
16682
16704
  }, useFilterFormItemInitializerFields = (e) => {
@@ -17055,7 +17077,7 @@ const useFormItemInitializerFields = (e) => {
17055
17077
  ]
17056
17078
  })), [y, C == null ? void 0 : C.inherits, C == null ? void 0 : C.name, t, v, h]);
17057
17079
  return r ? useMemo(() => {
17058
- var L;
17080
+ var O;
17059
17081
  const F = {
17060
17082
  name: "currentRecord",
17061
17083
  collectionName: C.name,
@@ -17126,7 +17148,7 @@ const useFormItemInitializerFields = (e) => {
17126
17148
  else if (I[0].children.length)
17127
17149
  if (l) {
17128
17150
  if (I[0].children.length <= 1)
17129
- return I[0].children = ((L = I[0].children[0]) == null ? void 0 : L.children) || [], I;
17151
+ return I[0].children = ((O = I[0].children[0]) == null ? void 0 : O.children) || [], I;
17130
17152
  B = [F];
17131
17153
  } else
17132
17154
  B = [F, D];
@@ -17894,10 +17916,10 @@ const useStyles$g = genStyleHook("nb-schema-toolbar", (e) => {
17894
17916
  t["x-settings"] || a,
17895
17917
  t["x-settings-props"]
17896
17918
  ), S = useGridRowContext(), y = useGridContext(), v = useDataSourceManager(), I = v == null ? void 0 : v.getDataSources(), F = useDataSource(), R = (I == null ? void 0 : I.length) > 1 && F, T = ["FormItem", "ReadPrettyFormItem"].includes(r == null ? void 0 : r.componentName) ? `${r == null ? void 0 : r.name} ${m("(Fields only)")}` : r == null ? void 0 : r.name, D = useMemo(() => {
17897
- var L;
17919
+ var O;
17898
17920
  return {
17899
17921
  insertPosition: "afterEnd",
17900
- wrap: ((L = S == null ? void 0 : S.cols) == null ? void 0 : L.length) > 1 ? void 0 : gridRowColWrap,
17922
+ wrap: ((O = S == null ? void 0 : S.cols) == null ? void 0 : O.length) > 1 ? void 0 : gridRowColWrap,
17901
17923
  Component: (j) => /* @__PURE__ */ jsx(
17902
17924
  PlusOutlined,
17903
17925
  P(x({}, j), {
@@ -17965,7 +17987,7 @@ const useStyles$g = genStyleHook("nb-schema-toolbar", (e) => {
17965
17987
  container: g
17966
17988
  } = x(x({}, e), (t == null ? void 0 : t["x-toolbar-props"]) || {}), f = useCompile(), { draggable: C } = useContext(SchemaComponentContext), { componentCls: b, hashId: S } = useStyles$g(), { t: y } = useTranslation(), { getAriaLabel: v } = useGetAriaLabelOfDesigner(), I = useDataSourceManager(), F = I == null ? void 0 : I.getDataSources(), R = useDataSource(), T = (F == null ? void 0 : F.length) > 1 && R, D = useRefreshFieldSchema(), B = useRef(y("Reference template")), $ = useCallback(() => {
17967
17989
  D({ refreshParentSchema: !0 });
17968
- }, [D]), L = useMemo(() => {
17990
+ }, [D]), O = useMemo(() => {
17969
17991
  if (n) {
17970
17992
  if (typeof n == "string")
17971
17993
  return [f(n)];
@@ -17975,7 +17997,7 @@ const useStyles$g = genStyleHook("nb-schema-toolbar", (e) => {
17975
17997
  }, [n, t]), { render: j, exists: w } = useSchemaSettingsRender(
17976
17998
  r || (t == null ? void 0 : t["x-settings"]),
17977
17999
  t == null ? void 0 : t["x-settings-props"]
17978
- ), { render: O, exists: N } = useSchemaInitializerRender(
18000
+ ), { render: L, exists: N } = useSchemaInitializerRender(
17979
18001
  o || (t == null ? void 0 : t["x-initializer"]),
17980
18002
  t == null ? void 0 : t["x-initializer-props"]
17981
18003
  ), k = useGridRowContext(), M = useGridContext(), q = useMemo(() => {
@@ -17997,10 +18019,10 @@ const useStyles$g = genStyleHook("nb-schema-toolbar", (e) => {
17997
18019
  if (o === !1)
17998
18020
  return null;
17999
18021
  if (N)
18000
- return O(q);
18022
+ return L(q);
18001
18023
  if (M != null && M.InitializerComponent || M != null && M.renderSchemaInitializer)
18002
18024
  return M != null && M.InitializerComponent ? /* @__PURE__ */ jsx(M.InitializerComponent, x({}, q)) : (K = M.renderSchemaInitializer) == null ? void 0 : K.call(M, q);
18003
- }, [M, o, q, N, O]), H = useMemo(() => r !== !1 && w ? j() : null, [w, j, r]), U = useRef(null), G = "hidden";
18025
+ }, [M, o, q, N, L]), H = useMemo(() => r !== !1 && w ? j() : null, [w, j, r]), U = useRef(null), G = "hidden";
18004
18026
  useEffect(() => {
18005
18027
  const K = U.current;
18006
18028
  let X = K == null ? void 0 : K.parentElement;
@@ -18035,9 +18057,9 @@ const useStyles$g = genStyleHook("nb-schema-toolbar", (e) => {
18035
18057
  className: cls(b, S, m, "schema-toolbar", G),
18036
18058
  style: Y,
18037
18059
  children: [
18038
- L && /* @__PURE__ */ jsx("div", { className: "toolbar-title", children: /* @__PURE__ */ jsxs(Space$1, { size: 2, children: [
18039
- /* @__PURE__ */ jsx("span", { className: "toolbar-title-tag", children: T ? `${f(T == null ? void 0 : T.displayName)} > ${L[0]}` : L[0] }, L[0]),
18040
- L[1] && /* @__PURE__ */ jsx("span", { className: "toolbar-title-tag", children: `${B.current}: ${`${L[1]}` || y("Untitled")}` })
18060
+ O && /* @__PURE__ */ jsx("div", { className: "toolbar-title", children: /* @__PURE__ */ jsxs(Space$1, { size: 2, children: [
18061
+ /* @__PURE__ */ jsx("span", { className: "toolbar-title-tag", children: T ? `${f(T == null ? void 0 : T.displayName)} > ${O[0]}` : O[0] }, O[0]),
18062
+ O[1] && /* @__PURE__ */ jsx("span", { className: "toolbar-title-tag", children: `${B.current}: ${`${O[1]}` || y("Untitled")}` })
18041
18063
  ] }) }),
18042
18064
  /* @__PURE__ */ jsx("div", { className: cls("toolbar-icons", i), style: l, children: /* @__PURE__ */ jsxs(Space$1, { size: 3, align: "center", className: d, style: p, children: [
18043
18065
  E,
@@ -18268,8 +18290,8 @@ const useDragEnd = (e) => {
18268
18290
  const { refresh: t } = useDesignable(), n = useAPIClient(), { t: o } = useTranslation();
18269
18291
  return useCallback(
18270
18292
  (r) => {
18271
- var f, C, b, S, y, v, I, F, R, T, D, B, $, L, j;
18272
- const { active: a, over: i } = r, l = (C = (f = a == null ? void 0 : a.data) == null ? void 0 : f.current) == null ? void 0 : C.schema, c = (S = (b = i == null ? void 0 : i.data) == null ? void 0 : b.current) == null ? void 0 : S.schema, u = (v = (y = i == null ? void 0 : i.data) == null ? void 0 : y.current) == null ? void 0 : v.insertAdjacent, d = (F = (I = i == null ? void 0 : i.data) == null ? void 0 : I.current) == null ? void 0 : F.breakRemoveOn, p = (T = (R = i == null ? void 0 : i.data) == null ? void 0 : R.current) == null ? void 0 : T.wrapSchema, m = (B = (D = i == null ? void 0 : i.data) == null ? void 0 : D.current) == null ? void 0 : B.onSuccess, h = (j = (L = ($ = i == null ? void 0 : i.data) == null ? void 0 : $.current) == null ? void 0 : L.removeParentsIfNoChildren) != null ? j : !0;
18293
+ var f, C, b, S, y, v, I, F, R, T, D, B, $, O, j;
18294
+ const { active: a, over: i } = r, l = (C = (f = a == null ? void 0 : a.data) == null ? void 0 : f.current) == null ? void 0 : C.schema, c = (S = (b = i == null ? void 0 : i.data) == null ? void 0 : b.current) == null ? void 0 : S.schema, u = (v = (y = i == null ? void 0 : i.data) == null ? void 0 : y.current) == null ? void 0 : v.insertAdjacent, d = (F = (I = i == null ? void 0 : i.data) == null ? void 0 : I.current) == null ? void 0 : F.breakRemoveOn, p = (T = (R = i == null ? void 0 : i.data) == null ? void 0 : R.current) == null ? void 0 : T.wrapSchema, m = (B = (D = i == null ? void 0 : i.data) == null ? void 0 : D.current) == null ? void 0 : B.onSuccess, h = (j = (O = ($ = i == null ? void 0 : i.data) == null ? void 0 : $.current) == null ? void 0 : O.removeParentsIfNoChildren) != null ? j : !0;
18273
18295
  if (!l || !c) {
18274
18296
  e == null || e(r);
18275
18297
  return;
@@ -18421,29 +18443,29 @@ const breakRemoveOnGrid = (e) => e["x-component"] === "Grid", breakRemoveOnRow =
18421
18443
  }), [v, I] = useState([0, 0]);
18422
18444
  return useDndMonitor({
18423
18445
  onDragStart(D) {
18424
- var w, O, N;
18425
- const B = (N = (O = (w = D.active) == null ? void 0 : w.data) == null ? void 0 : O.current) == null ? void 0 : N.dividerRef;
18446
+ var w, L, N;
18447
+ const B = (N = (L = (w = D.active) == null ? void 0 : w.data) == null ? void 0 : L.current) == null ? void 0 : N.dividerRef;
18426
18448
  if (!B || !r)
18427
18449
  return;
18428
18450
  n.current = D.active.id;
18429
- const $ = B.current, L = $.previousElementSibling, j = $.nextElementSibling;
18430
- I([L.clientWidth, j.clientWidth]);
18451
+ const $ = B.current, O = $.previousElementSibling, j = $.nextElementSibling;
18452
+ I([O.clientWidth, j.clientWidth]);
18431
18453
  },
18432
18454
  onDragMove(D) {
18433
18455
  if (!r || !y)
18434
18456
  return;
18435
18457
  n.current === D.active.id && (n.current = n.current + "_move");
18436
- const B = l.current, $ = B.previousElementSibling, L = B.nextElementSibling;
18437
- $.style.width = `${v[0] + D.delta.x}px`, L.style.width = `${v[1] - D.delta.x}px`;
18458
+ const B = l.current, $ = B.previousElementSibling, O = B.nextElementSibling;
18459
+ $.style.width = `${v[0] + D.delta.x}px`, O.style.width = `${v[1] - D.delta.x}px`;
18438
18460
  },
18439
18461
  onDragEnd(D) {
18440
18462
  var N;
18441
18463
  if (!r || !n.current || (N = n.current) != null && N.startsWith(D.active.id) && !n.current.endsWith("_move") || v[0] <= 0 || v[1] <= 0 || (I([0, 0]), !h || !g))
18442
18464
  return;
18443
- const B = l.current, $ = B.previousElementSibling, L = B.nextElementSibling;
18465
+ const B = l.current, $ = B.previousElementSibling, O = B.nextElementSibling;
18444
18466
  h["x-component-props"] = h["x-component-props"] || {}, g["x-component-props"] = g["x-component-props"] || {};
18445
- const j = B.clientWidth * (e.cols.length + 1) / e.cols.length, w = (100 * ($.getBoundingClientRect().width + j) / B.parentElement.clientWidth).toFixed(2), O = (100 * (L.getBoundingClientRect().width + j) / B.parentElement.clientWidth).toFixed(2);
18446
- _.set(h, "x-component-props.width", w), _.set(g, "x-component-props.width", O), o.emit("batchPatch", {
18467
+ const j = B.clientWidth * (e.cols.length + 1) / e.cols.length, w = (100 * ($.getBoundingClientRect().width + j) / B.parentElement.clientWidth).toFixed(2), L = (100 * (O.getBoundingClientRect().width + j) / B.parentElement.clientWidth).toFixed(2);
18468
+ _.set(h, "x-component-props.width", w), _.set(g, "x-component-props.width", L), o.emit("batchPatch", {
18447
18469
  schemas: [
18448
18470
  {
18449
18471
  "x-uid": h["x-uid"],
@@ -18757,8 +18779,8 @@ const useTableBlockProps = () => {
18757
18779
  ),
18758
18780
  onChange: useCallback(
18759
18781
  ({ current: S, pageSize: y }, v, I) => {
18760
- var B, $, L, j, w, O, N, k, M, q;
18761
- const F = (L = ($ = (B = t.parent) == null ? void 0 : B["x-decorator-props"]) == null ? void 0 : $.params) == null ? void 0 : L.sort, R = I.order ? I.order === "ascend" ? [I.field] : [`-${I.field}`] : F || a.dragSortBy, T = y || ((O = (w = (j = t.parent) == null ? void 0 : j["x-decorator-props"]) == null ? void 0 : w.params) == null ? void 0 : O.pageSize), D = P(x({}, (M = (k = (N = i.current) == null ? void 0 : N.service) == null ? void 0 : k.params) == null ? void 0 : M[0]), { page: S || 1, pageSize: T });
18782
+ var B, $, O, j, w, L, N, k, M, q;
18783
+ const F = (O = ($ = (B = t.parent) == null ? void 0 : B["x-decorator-props"]) == null ? void 0 : $.params) == null ? void 0 : O.sort, R = I.order ? I.order === "ascend" ? [I.field] : [`-${I.field}`] : F || a.dragSortBy, T = y || ((L = (w = (j = t.parent) == null ? void 0 : j["x-decorator-props"]) == null ? void 0 : w.params) == null ? void 0 : L.pageSize), D = P(x({}, (M = (k = (N = i.current) == null ? void 0 : N.service) == null ? void 0 : k.params) == null ? void 0 : M[0]), { page: S || 1, pageSize: T });
18762
18784
  R && (D.sort = R), (q = i.current) == null || q.service.run(D);
18763
18785
  },
18764
18786
  [t.parent]
@@ -18776,7 +18798,7 @@ const useTableBlockProps = () => {
18776
18798
  const B = I.find((E) => E.uid === D.uid);
18777
18799
  if (!B)
18778
18800
  return;
18779
- const $ = getSourceKey(T, B.field) || a.rowKey || "id", L = [S[$]], j = ((N = D.service.params) == null ? void 0 : N[0]) || {}, w = ((M = (k = D.service.params) == null ? void 0 : k[1]) == null ? void 0 : M.filters) || {};
18801
+ const $ = getSourceKey(T, B.field) || a.rowKey || "id", O = [S[$]], j = ((N = D.service.params) == null ? void 0 : N[0]) || {}, w = ((M = (k = D.service.params) == null ? void 0 : k[1]) == null ? void 0 : M.filters) || {};
18780
18802
  if (v.includes(S[a.rowKey])) {
18781
18803
  if ((q = D.clearSelection) == null || q.call(D), D.dataLoadingMode === "manual")
18782
18804
  return D.clearData();
@@ -18786,19 +18808,19 @@ const useTableBlockProps = () => {
18786
18808
  $and: [
18787
18809
  {
18788
18810
  [B.field || a.rowKey]: {
18789
- [B.field ? "$in" : "$eq"]: L
18811
+ [B.field ? "$in" : "$eq"]: O
18790
18812
  }
18791
18813
  }
18792
18814
  ]
18793
18815
  };
18794
- const O = mergeFilter([
18816
+ const L = mergeFilter([
18795
18817
  ...Object.values(w).map((E) => removeNullCondition(E)),
18796
18818
  D.defaultFilter
18797
18819
  ]);
18798
18820
  return D.doFilter(
18799
18821
  P(x({}, j), {
18800
18822
  page: 1,
18801
- filter: O
18823
+ filter: L
18802
18824
  }),
18803
18825
  { filters: w }
18804
18826
  );
@@ -19152,10 +19174,10 @@ const useTableSelectorParams = () => useContext(TableSelectorParamsContext), Tab
19152
19174
  var i, l, c, u, d, p, m, h, g, f, C, b, S, y, v, I;
19153
19175
  const e = useField(), t = useTableSelectorContext(), n = useFieldSchema(), { getCollectionJoinField: o } = useCollectionManager_deprecated(), r = recursiveParent(n, "CollectionField"), a = o(r == null ? void 0 : r["x-collection-field"]);
19154
19176
  return useEffect(() => {
19155
- var R, T, D, B, $, L, j, w, O, N, k, M, q;
19177
+ var R, T, D, B, $, O, j, w, L, N, k, M, q;
19156
19178
  if (!((R = t == null ? void 0 : t.service) != null && R.loading)) {
19157
19179
  const E = (D = (T = t == null ? void 0 : t.service) == null ? void 0 : T.data) == null ? void 0 : D.data.map((V) => V);
19158
- e.value = E, (B = e == null ? void 0 : e.setInitialValue) == null || B.call(e, E), e.data = e.data || {}, e.data.selectedRowKeys = [], e.componentProps.pagination = e.componentProps.pagination || {}, e.componentProps.pagination.pageSize = (j = (L = ($ = t == null ? void 0 : t.service) == null ? void 0 : $.data) == null ? void 0 : L.meta) == null ? void 0 : j.pageSize, e.componentProps.pagination.total = (N = (O = (w = t == null ? void 0 : t.service) == null ? void 0 : w.data) == null ? void 0 : O.meta) == null ? void 0 : N.count, e.componentProps.pagination.current = (q = (M = (k = t == null ? void 0 : t.service) == null ? void 0 : k.data) == null ? void 0 : M.meta) == null ? void 0 : q.page;
19180
+ e.value = E, (B = e == null ? void 0 : e.setInitialValue) == null || B.call(e, E), e.data = e.data || {}, e.data.selectedRowKeys = [], e.componentProps.pagination = e.componentProps.pagination || {}, e.componentProps.pagination.pageSize = (j = (O = ($ = t == null ? void 0 : t.service) == null ? void 0 : $.data) == null ? void 0 : O.meta) == null ? void 0 : j.pageSize, e.componentProps.pagination.total = (N = (L = (w = t == null ? void 0 : t.service) == null ? void 0 : w.data) == null ? void 0 : L.meta) == null ? void 0 : N.count, e.componentProps.pagination.current = (q = (M = (k = t == null ? void 0 : t.service) == null ? void 0 : k.data) == null ? void 0 : M.meta) == null ? void 0 : q.page;
19159
19181
  }
19160
19182
  }, [
19161
19183
  a == null ? void 0 : a.foreignKey,
@@ -20620,7 +20642,7 @@ const DynamicComponent$1 = (e) => {
20620
20642
  }, DateScopeComponent = (e) => {
20621
20643
  var g, f, C, b, S, y, v, I, F, R, T, D, B, $;
20622
20644
  const t = useFieldSchema(), { getCollectionJoinField: n } = useCollectionManager_deprecated(), o = n(t == null ? void 0 : t["x-collection-field"]) || {}, r = ((g = o == null ? void 0 : o.uiSchema) == null ? void 0 : g["x-component-props"].gmt) || !1, a = ((f = o == null ? void 0 : o.uiSchema) == null ? void 0 : f["x-component-props"].utc) || !1, { form: i } = useFormBlockContext(), l = useRecord(), c = ((C = t == null ? void 0 : t["x-component-props"]) == null ? void 0 : C.showTime) || ((S = (b = o == null ? void 0 : o.uiSchema) == null ? void 0 : b["x-component-props"]) == null ? void 0 : S.showTime) || !1, u = ((y = t == null ? void 0 : t["x-component-props"]) == null ? void 0 : y.dateFormat) || ((I = (v = o == null ? void 0 : o.uiSchema) == null ? void 0 : v["x-component-props"]) == null ? void 0 : I.dateFormat) || "YYYY-MM-DD", d = ((F = t == null ? void 0 : t["x-component-props"]) == null ? void 0 : F.timeFormat) || ((T = (R = o == null ? void 0 : o.uiSchema) == null ? void 0 : R["x-component-props"]) == null ? void 0 : T.timeFormat) || "HH:mm:ss", p = ((D = t == null ? void 0 : t["x-component-props"]) == null ? void 0 : D.picker) || (($ = (B = o == null ? void 0 : o.uiSchema) == null ? void 0 : B["x-component-props"]) == null ? void 0 : $.picker) || "date", m = useCallback(
20623
- (L) => /* @__PURE__ */ jsx(
20645
+ (O) => /* @__PURE__ */ jsx(
20624
20646
  SchemaComponent,
20625
20647
  {
20626
20648
  schema: {
@@ -20646,9 +20668,9 @@ const DynamicComponent$1 = (e) => {
20646
20668
  ),
20647
20669
  [u, r, p, c, d, a]
20648
20670
  ), h = useCallback(
20649
- (L) => /* @__PURE__ */ jsx(FlagProvider, { collectionField: o, children: /* @__PURE__ */ jsx(
20671
+ (O) => /* @__PURE__ */ jsx(FlagProvider, { collectionField: o, children: /* @__PURE__ */ jsx(
20650
20672
  VariableInput,
20651
- P(x({}, L), {
20673
+ P(x({}, O), {
20652
20674
  form: i,
20653
20675
  record: l,
20654
20676
  noDisabled: !0,
@@ -21874,21 +21896,21 @@ const SchemaSettingsSwitchItem = (e) => {
21874
21896
  }, [D]), $ = useCallback(() => z(void 0, null, function* () {
21875
21897
  yield D.submit();
21876
21898
  try {
21877
- const O = D.values, N = Object.keys(O).reduce((k, M) => (D.query(M).take() && (k[M] = O[M]), k), {});
21899
+ const L = D.values, N = Object.keys(L).reduce((k, M) => (D.query(M).take() && (k[M] = L[M]), k), {});
21878
21900
  h(!1), yield n == null ? void 0 : n(cloneDeep$1(N));
21879
- } catch (O) {
21880
- console.error(O);
21901
+ } catch (L) {
21902
+ console.error(L);
21881
21903
  }
21882
- }), [D, n]), L = useCallback(() => z(void 0, null, function* () {
21904
+ }), [D, n]), O = useCallback(() => z(void 0, null, function* () {
21883
21905
  !g && (i != null && i["x-uid"]) && (b["x-action-settings"].schemaUid = i["x-uid"], y.emit("patch", { schema: b }), yield I.resource("uiSchemas").insert({ values: i }), f(i["x-uid"])), typeof a == "function" && (a == null || a()), S.setVisible(!1), h(!0);
21884
- }), [I, S, y, b, i, g]), j = useCallback((O) => O.stopPropagation(), []);
21906
+ }), [I, S, y, b, i, g]), j = useCallback((L) => L.stopPropagation(), []);
21885
21907
  return /* @__PURE__ */ jsxs(zIndexContext.Provider, { value: T, children: [
21886
21908
  /* @__PURE__ */ jsx(
21887
21909
  SchemaSettingsItem,
21888
21910
  P(x({
21889
21911
  title: v(t)
21890
21912
  }, p), {
21891
- onClick: L,
21913
+ onClick: O,
21892
21914
  onKeyDown: j,
21893
21915
  children: e.children || e.title
21894
21916
  })
@@ -21948,7 +21970,7 @@ const SchemaSettingsModalItem = (e) => {
21948
21970
  "noRecord",
21949
21971
  "ModalContextProvider",
21950
21972
  "dialogRootClassName"
21951
- ]), g = useContext(SchemaOptionsContext), f = useCollection(), C = useAPIClient(), b = useApp(), { theme: S } = useGlobalTheme(), y = useBlockRequestContext(), v = useFormActiveFields(), { locale: I } = useContext(ConfigProvider.ConfigContext), F = useDataSourceManager(), R = useDataSourceKey(), T = useCollectionRecord(), { association: D } = useDataBlockProps() || {}, B = useCurrentRecord(), $ = useFormBlockContext(), L = useBlockContext(), { getOperators: j } = useOperators(), w = useLocationSearch(), O = useVariables$1(), N = useContext(AllDataBlocksContext), k = useContext(SchemaComponentContext), M = useContext(VariableScopeContext$1), { formValue: q, collection: E, parent: V } = useSubFormValue(), H = useCurrentPopupRecord(), U = useParentPopupRecord();
21973
+ ]), g = useContext(SchemaOptionsContext), f = useCollection(), C = useAPIClient(), b = useApp(), { theme: S } = useGlobalTheme(), y = useBlockRequestContext(), v = useFormActiveFields(), { locale: I } = useContext(ConfigProvider.ConfigContext), F = useDataSourceManager(), R = useDataSourceKey(), T = useCollectionRecord(), { association: D } = useDataBlockProps() || {}, B = useCurrentRecord(), $ = useFormBlockContext(), O = useBlockContext(), { getOperators: j } = useOperators(), w = useLocationSearch(), L = useVariables$1(), N = useContext(AllDataBlocksContext), k = useContext(SchemaComponentContext), M = useContext(VariableScopeContext$1), { formValue: q, collection: E, parent: V } = useSubFormValue(), H = useCurrentPopupRecord(), U = useParentPopupRecord();
21952
21974
  return t ? null : /* @__PURE__ */ jsx(
21953
21975
  SchemaSettingsItem,
21954
21976
  P(x({
@@ -21958,7 +21980,7 @@ const SchemaSettingsModalItem = (e) => {
21958
21980
  const Y = l ? yield l() : c, J = _.isFunction(e.schema) ? e.schema() : e.schema;
21959
21981
  FormDialog(
21960
21982
  { title: J.title || n, width: u, rootClassName: m },
21961
- () => /* @__PURE__ */ jsx(VariableScopeContext$1.Provider, { value: M, children: /* @__PURE__ */ jsx(SchemaComponentContext.Provider, { value: k, children: /* @__PURE__ */ jsx(AllDataBlocksContext.Provider, { value: N, children: /* @__PURE__ */ jsx(p, { children: /* @__PURE__ */ jsx(CollectOperators, { defaultOperators: j(), children: /* @__PURE__ */ jsx(VariablesContext.Provider, { value: O, children: /* @__PURE__ */ jsx(BlockContext.Provider, { value: L, children: /* @__PURE__ */ jsx(
21983
+ () => /* @__PURE__ */ jsx(VariableScopeContext$1.Provider, { value: M, children: /* @__PURE__ */ jsx(SchemaComponentContext.Provider, { value: k, children: /* @__PURE__ */ jsx(AllDataBlocksContext.Provider, { value: N, children: /* @__PURE__ */ jsx(p, { children: /* @__PURE__ */ jsx(CollectOperators, { defaultOperators: j(), children: /* @__PURE__ */ jsx(VariablesContext.Provider, { value: L, children: /* @__PURE__ */ jsx(BlockContext.Provider, { value: O, children: /* @__PURE__ */ jsx(
21962
21984
  VariablePopupRecordProvider,
21963
21985
  {
21964
21986
  recordData: H == null ? void 0 : H.value,
@@ -22168,11 +22190,11 @@ const SchemaSettingsModalItem = (e) => {
22168
22190
  }
22169
22191
  }),
22170
22192
  [n, c, u, y, g, f, p, h, T, r]
22171
- ), L = useMemo(() => ({ ArrayCollapse: ArrayCollapse$2, FormLayout }), []), j = useCallback(
22172
- (O) => {
22193
+ ), O = useMemo(() => ({ ArrayCollapse: ArrayCollapse$2, FormLayout }), []), j = useCallback(
22194
+ (L) => {
22173
22195
  var E;
22174
22196
  const N = [];
22175
- for (const V of O.fieldReaction.rules)
22197
+ for (const V of L.fieldReaction.rules)
22176
22198
  N.push(_.omit(_.pickBy(V, _.identity), ["conditionBasic", "conditionAdvanced"]));
22177
22199
  const k = y["x-component"] === "BlockTemplate" && ((E = y["x-component-props"]) == null ? void 0 : E.templateId), q = {
22178
22200
  "x-uid": b !== LinkageRuleCategory.block ? k && m(k).uid || y["x-uid"] : c["x-uid"]
@@ -22187,11 +22209,11 @@ const SchemaSettingsModalItem = (e) => {
22187
22209
  SchemaSettingsModalItem,
22188
22210
  {
22189
22211
  title: D,
22190
- components: L,
22212
+ components: O,
22191
22213
  width: 960,
22192
22214
  schema: $,
22193
22215
  onSubmit: j,
22194
- ModalContextProvider: (O) => /* @__PURE__ */ jsx(FlagProvider, P(x({}, B), { children: O.children }))
22216
+ ModalContextProvider: (L) => /* @__PURE__ */ jsx(FlagProvider, P(x({}, B), { children: L.children }))
22195
22217
  }
22196
22218
  );
22197
22219
  }, useDataTemplates = (e) => {
@@ -23322,9 +23344,9 @@ function Input$1(e) {
23322
23344
  "constantAbel"
23323
23345
  ]), f = typeof e.scope == "function" ? e.scope() : e.scope, { wrapSSR: C, hashId: b, componentCls: S, rootPrefixCls: y } = useStyles$d({ hideVariableButton: m });
23324
23346
  useAntdInputStyle(`${y}-input`);
23325
- const v = useCompile(), { t: I } = useTranslation(), F = useForm(), [R, T] = React.useState([]), [D, B] = React.useState([]), [$, L] = React.useState(
23347
+ const v = useCompile(), { t: I } = useTranslation(), F = useForm(), [R, T] = React.useState([]), [D, B] = React.useState([]), [$, O] = React.useState(
23326
23348
  m || !!(o && t != null)
23327
- ), j = useMemo(() => parseValue(t, p), [p, t]), w = typeof j == "string", O = w ? j : "", N = w ? null : j, k = Object.assign(
23349
+ ), j = useMemo(() => parseValue(t, p), [p, t]), w = typeof j == "string", L = w ? j : "", N = w ? null : j, k = Object.assign(
23328
23350
  {
23329
23351
  label: "label",
23330
23352
  value: "value",
@@ -23336,9 +23358,9 @@ function Input$1(e) {
23336
23358
  label: I("Constant"),
23337
23359
  [k.value]: "$",
23338
23360
  [k.label]: I("Constant")
23339
- } : a ? getTypedConstantOption(O, a, k) : null : null, [O, a]), q = (K = M == null ? void 0 : M.component) != null ? K : NullComponent, E = Array.isArray(a) ? (ee = (X = a.find((Q) => Array.isArray(Q) && Q[0] === O)) == null ? void 0 : X[1]) != null ? ee : {} : {};
23361
+ } : a ? getTypedConstantOption(L, a, k) : null : null, [L, a]), q = (K = M == null ? void 0 : M.component) != null ? K : NullComponent, E = Array.isArray(a) ? (ee = (X = a.find((Q) => Array.isArray(Q) && Q[0] === L)) == null ? void 0 : X[1]) != null ? ee : {} : {};
23340
23362
  let V;
23341
- t == null ? i ? o && $ ? V = ["$"] : V = [""] : o ? V = ["$"] : V = [" ", O] : V = o ? ["$"] : [" ", O], m && (V = ["$"]), useEffect(() => {
23363
+ t == null ? i ? o && $ ? V = ["$"] : V = [""] : o ? V = ["$"] : V = [" ", L] : V = o ? ["$"] : [" ", L], m && (V = ["$"]), useEffect(() => {
23342
23364
  const se = M != null ? M : {}, { component: Q } = se, te = W(se, ["component"]), ne = [
23343
23365
  ...i ? [
23344
23366
  {
@@ -23371,24 +23393,24 @@ function Input$1(e) {
23371
23393
  (Q, te) => {
23372
23394
  var ne, se, ae;
23373
23395
  if (Q[0] === "$") {
23374
- L(!0), N && n(null, te);
23396
+ O(!0), N && n(null, te);
23375
23397
  return;
23376
23398
  } else
23377
- L(!1);
23399
+ O(!1);
23378
23400
  if (Q[0] === "") {
23379
23401
  n(null);
23380
23402
  return;
23381
23403
  }
23382
23404
  if (Q[0] === " ") {
23383
- Q[1] ? Q[1] !== O && n((ae = (se = (ne = ConstantTypes[Q[1]]) == null ? void 0 : ne.default) == null ? void 0 : se.call(ne)) != null ? ae : null, te) : N && n(null, te);
23405
+ Q[1] ? Q[1] !== L && n((ae = (se = (ne = ConstantTypes[Q[1]]) == null ? void 0 : ne.default) == null ? void 0 : se.call(ne)) != null ? ae : null, te) : N && n(null, te);
23384
23406
  return;
23385
23407
  }
23386
23408
  n(`{{${Q.join(".")}}}`, te);
23387
23409
  },
23388
- [O, N, n]
23410
+ [L, N, n]
23389
23411
  ), G = useCallback(() => {
23390
23412
  var Q;
23391
- if (L(!!o), (Q = M == null ? void 0 : M.children) != null && Q.length) {
23413
+ if (O(!!o), (Q = M == null ? void 0 : M.children) != null && Q.length) {
23392
23414
  const te = M.children[0].default();
23393
23415
  return n(te);
23394
23416
  }
@@ -23772,7 +23794,7 @@ function TextArea(e) {
23772
23794
  [l, g]
23773
23795
  ), [S, y] = useState(!1), [v, I] = useState(!1), [F, R] = useState(() => renderHTML(p != null ? p : "", b, c)), [T, D] = useState([-1, 0, -1, 0]);
23774
23796
  useAntdInputStyle("ant-input");
23775
- const { token: B } = theme.useToken(), $ = c.join(" "), L = useCallback(
23797
+ const { token: B } = theme.useToken(), $ = c.join(" "), O = useCallback(
23776
23798
  (V) => {
23777
23799
  var U;
23778
23800
  const H = getValue(V, c);
@@ -23820,15 +23842,15 @@ function TextArea(e) {
23820
23842
  const G = createVariableTagHTML(H.join("."), b);
23821
23843
  pasteHTML(U, G, {
23822
23844
  range: T
23823
- }), I(!0), D(getCurrentRange(U)), L(U);
23845
+ }), I(!0), D(getCurrentRange(U)), O(U);
23824
23846
  },
23825
- [b, L, T]
23847
+ [b, O, T]
23826
23848
  ), w = useCallback(
23827
23849
  function({ currentTarget: V }) {
23828
- S || (I(!0), D(getCurrentRange(V)), L(V));
23850
+ S || (I(!0), D(getCurrentRange(V)), O(V));
23829
23851
  },
23830
- [S, L]
23831
- ), O = useCallback(function({ currentTarget: V }) {
23852
+ [S, O]
23853
+ ), L = useCallback(function({ currentTarget: V }) {
23832
23854
  D(getCurrentRange(V));
23833
23855
  }, []), N = useCallback(function(V) {
23834
23856
  V.key === "Enter" && V.preventDefault();
@@ -23836,9 +23858,9 @@ function TextArea(e) {
23836
23858
  y(!0);
23837
23859
  }, []), M = useCallback(
23838
23860
  ({ currentTarget: V }) => {
23839
- y(!1), I(!0), D(getCurrentRange(V)), L(V);
23861
+ y(!1), I(!0), D(getCurrentRange(V)), O(V);
23840
23862
  },
23841
- [L]
23863
+ [O]
23842
23864
  ), q = useCallback(
23843
23865
  function(V) {
23844
23866
  V.preventDefault();
@@ -23859,9 +23881,9 @@ function TextArea(e) {
23859
23881
  }
23860
23882
  }
23861
23883
  }).replace(/\n/g, " ");
23862
- I(!0), pasteHTML(V.currentTarget, U), D(getCurrentRange(V.currentTarget)), L(V.currentTarget);
23884
+ I(!0), pasteHTML(V.currentTarget, U), D(getCurrentRange(V.currentTarget)), O(V.currentTarget);
23863
23885
  },
23864
- [L]
23886
+ [O]
23865
23887
  ), E = e.disabled || C.disabled;
23866
23888
  return t(
23867
23889
  /* @__PURE__ */ jsxs(Fragment$1, { children: [
@@ -23912,7 +23934,7 @@ function TextArea(e) {
23912
23934
  role: "button",
23913
23935
  "aria-label": "textbox",
23914
23936
  onInput: w,
23915
- onBlur: O,
23937
+ onBlur: L,
23916
23938
  onKeyDown: N,
23917
23939
  onPaste: q,
23918
23940
  onCompositionStart: k,
@@ -24372,7 +24394,20 @@ const GroupItem$1 = () => {
24372
24394
  Component: LinkMenuItem
24373
24395
  }
24374
24396
  ]
24375
- }), useMenuTranslation = () => useTranslation("lm-desktop-routes"), components$5 = { TreeSelect: TreeSelect$1 }, toItems$2 = (e, { t, compile: n }) => {
24397
+ }), useMenuTranslation = () => useTranslation("lm-desktop-routes");
24398
+ function useDeleteRouteSchema(e = "uiSchemas") {
24399
+ const t = useAPIClient(), n = useMemo(() => t.resource(e), [t, e]), { refresh: o } = useAllAccessDesktopRoutes();
24400
+ return { deleteRouteSchema: useCallback(
24401
+ (a) => z(this, null, function* () {
24402
+ if (!a)
24403
+ return;
24404
+ const i = yield n[`remove/${a}`]();
24405
+ return o(), i;
24406
+ }),
24407
+ [n, o]
24408
+ ) };
24409
+ }
24410
+ const components$5 = { TreeSelect: TreeSelect$1 }, toItems$2 = (e, { t, compile: n }) => {
24376
24411
  var r;
24377
24412
  const o = [];
24378
24413
  for (const a of e) {
@@ -24413,7 +24448,7 @@ const GroupItem$1 = () => {
24413
24448
  }
24414
24449
  }
24415
24450
  }, RemoveRoute = () => {
24416
- const { t: e } = useTranslation(), { modal: t } = App.useApp(), { deleteRoute: n } = useNocoBaseRoutes(), o = useCurrentRoute(), { allAccessRoutes: r } = useAllAccessDesktopRoutes(), a = useNavigateNoUpdate(), i = useCurrentPageUid();
24451
+ const { t: e } = useTranslation(), { modal: t } = App.useApp(), { deleteRoute: n } = useNocoBaseRoutes(), { deleteRouteSchema: o } = useDeleteRouteSchema(), r = useCurrentRoute(), { allAccessRoutes: a } = useAllAccessDesktopRoutes(), i = useNavigateNoUpdate(), l = useCurrentPageUid();
24417
24452
  return /* @__PURE__ */ jsx(
24418
24453
  SchemaSettingsItem,
24419
24454
  {
@@ -24424,10 +24459,10 @@ const GroupItem$1 = () => {
24424
24459
  title: e("Delete menu item"),
24425
24460
  content: e("Are you sure you want to delete it?"),
24426
24461
  onOk: () => z(void 0, null, function* () {
24427
- if ((o == null ? void 0 : o.id) != null && (yield n(o.id)), i !== (o == null ? void 0 : o.schemaUid) && !findRouteBySchemaUid(i, o == null ? void 0 : o.children))
24462
+ if ((r == null ? void 0 : r.id) != null && (yield Promise.all([n(r.id), o(r.schemaUid)])), l !== (r == null ? void 0 : r.schemaUid) && !findRouteBySchemaUid(l, r == null ? void 0 : r.children))
24428
24463
  return;
24429
- const l = findPrevSibling(r, o), c = findNextSibling(r, o);
24430
- a(l || c ? `/admin/${(l == null ? void 0 : l.schemaUid) || (c == null ? void 0 : c.schemaUid)}` : "/");
24464
+ const c = findPrevSibling(a, r), u = findNextSibling(a, r);
24465
+ i(c || u ? `/admin/${(c == null ? void 0 : c.schemaUid) || (u == null ? void 0 : u.schemaUid)}` : "/");
24431
24466
  })
24432
24467
  });
24433
24468
  },
@@ -24909,27 +24944,7 @@ const LanguageSettings = () => {
24909
24944
  sort: 350
24910
24945
  }
24911
24946
  ]
24912
- }), { evaluate } = evaluators.get("formula.js"), useEvaluatedExpression = (e) => {
24913
- const t = useVariables$1(), n = useLocalVariables$1(), [o, r] = useState();
24914
- return useEffect(() => {
24915
- z(void 0, null, function* () {
24916
- if (e == null || e === "") {
24917
- r(void 0);
24918
- return;
24919
- }
24920
- const { exp: i, scope: l } = yield replaceVariables(e, {
24921
- variables: t,
24922
- localVariables: n
24923
- });
24924
- try {
24925
- const c = evaluate(i, x({ now: () => (/* @__PURE__ */ new Date()).toString() }, l));
24926
- r(c);
24927
- } catch (c) {
24928
- console.error(c);
24929
- }
24930
- });
24931
- }, [t.parseVariable, e, n]), o;
24932
- }, NocoBaseRouteContext = createContext(null);
24947
+ }), NocoBaseRouteContext = createContext(null);
24933
24948
  NocoBaseRouteContext.displayName = "NocoBaseRouteContext";
24934
24949
  const CurrentRouteProvider = memo(({ children: e, uid: t }) => {
24935
24950
  const { allAccessRoutes: n } = useAllAccessDesktopRoutes(), o = useMemo(() => findRouteBySchemaUid(t, n), [t, n]);
@@ -25063,10 +25078,10 @@ const LayoutContent = () => {
25063
25078
  const F = (D = t._route.options) == null ? void 0 : D.href, R = (B = t._route.options) == null ? void 0 : B.params, T = ($ = t._route.options) == null ? void 0 : $.openInNewWindow;
25064
25079
  I.preventDefault(), I.stopPropagation();
25065
25080
  try {
25066
- const L = yield n(F, R || []);
25067
- T !== !1 ? window.open(L, "_blank") : navigateWithinSelf(F, i, window.location.origin + l);
25068
- } catch (L) {
25069
- console.error(L), window.open(F, "_blank");
25081
+ const O = yield n(F, R || []);
25082
+ T !== !1 ? window.open(O, "_blank") : navigateWithinSelf(F, i, window.location.origin + l);
25083
+ } catch (O) {
25084
+ console.error(O), window.open(F, "_blank");
25070
25085
  }
25071
25086
  }),
25072
25087
  [n, t]
@@ -27022,7 +27037,7 @@ https://requirejs.org/docs/errors.html#` + e);
27022
27037
  G && !k.depMatched[H] && !q[U] && (getOwn(M, U) ? (k.defineDep(H, p[U]), k.check()) : $(G, M, q));
27023
27038
  }), q[E] = !0);
27024
27039
  }
27025
- function L() {
27040
+ function O() {
27026
27041
  var k, M, q = i.waitSeconds * 1e3, E = q && o.startTime + q < (/* @__PURE__ */ new Date()).getTime(), V = [], H = [], U = !1, G = !0;
27027
27042
  if (!t) {
27028
27043
  if (t = !0, eachProp(c, function(Y) {
@@ -27038,7 +27053,7 @@ https://requirejs.org/docs/errors.html#` + e);
27038
27053
  G && each(H, function(Y) {
27039
27054
  $(Y, {}, {});
27040
27055
  }), (!E || M) && U && (isBrowser || isWebWorker) && !a && (a = setTimeout(function() {
27041
- a = 0, L();
27056
+ a = 0, O();
27042
27057
  }, 50)), t = !1;
27043
27058
  }
27044
27059
  }
@@ -27210,7 +27225,7 @@ https://requirejs.org/docs/errors.html#` + e);
27210
27225
  function w(k, M, q, E) {
27211
27226
  k.detachEvent && !isOpera ? E && k.detachEvent(E, M) : k.removeEventListener(q, M, !1);
27212
27227
  }
27213
- function O(k) {
27228
+ function L(k) {
27214
27229
  var M = k.currentTarget || k.srcElement;
27215
27230
  return w(M, o.onScriptLoad, "load", "onreadystatechange"), w(M, o.onScriptError, "error"), {
27216
27231
  node: M,
@@ -27286,7 +27301,7 @@ https://requirejs.org/docs/errors.html#` + e);
27286
27301
  return M.enableBuildCallback && V && isFunction(V) && (V.__requireJsBuild = !0), typeof E == "string" ? isFunction(V) ? T(makeError("requireargs", "Invalid require call"), H) : k && hasProp(r, E) ? r[E](l[k.id]) : req.get ? req.get(o, E, k, q) : (G = I(E, k, !1, !0), U = G.id, hasProp(p, U) ? p[U] : T(makeError("notloaded", 'Module name "' + U + '" has not been loaded yet for context: ' + e + (k ? "" : ". Use require([])")))) : (N(), o.nextTick(function() {
27287
27302
  N(), Y = F(I(null, k)), Y.skipMap = M.skipMap, Y.init(E, V, H, {
27288
27303
  enabled: !0
27289
- }), L();
27304
+ }), O();
27290
27305
  }), q);
27291
27306
  }
27292
27307
  return mixin(q, {
@@ -27355,7 +27370,7 @@ https://requirejs.org/docs/errors.html#` + e);
27355
27370
  ));
27356
27371
  j([k, V.deps || [], V.exportsFn]);
27357
27372
  }
27358
- L();
27373
+ O();
27359
27374
  },
27360
27375
  /**
27361
27376
  * Converts a module name to a file path. Supports cases where
@@ -27404,7 +27419,7 @@ https://requirejs.org/docs/errors.html#` + e);
27404
27419
  onScriptLoad: function(k) {
27405
27420
  if (k.type === "load" || readyRegExp.test((k.currentTarget || k.srcElement).readyState)) {
27406
27421
  interactiveScript = null;
27407
- var M = O(k);
27422
+ var M = L(k);
27408
27423
  o.completeLoad(M.id);
27409
27424
  }
27410
27425
  },
@@ -27412,7 +27427,7 @@ https://requirejs.org/docs/errors.html#` + e);
27412
27427
  * Callback for script errors.
27413
27428
  */
27414
27429
  onScriptError: function(k) {
27415
- var M = O(k);
27430
+ var M = L(k);
27416
27431
  if (!y(M.id)) {
27417
27432
  var q = [];
27418
27433
  return eachProp(l, function(E, V) {
@@ -29025,9 +29040,9 @@ const MarkdownVoidInner = withDynamicSchemaProps(
29025
29040
  const { isDarkTheme: t } = useGlobalTheme(), { componentCls: n, hashId: o } = useStyles$a({ isDarkTheme: t }), { content: r, className: a } = e, i = useField(), l = useFieldSchema(), { dn: c } = useDesignable(), { onSave: u, onCancel: d, form: p } = e, m = useCollectionRecord(), [h, g] = useState(""), f = useVariables$1(), C = useLocalVariables$1(), { engine: b } = (l == null ? void 0 : l["x-decorator-props"]) || {}, [S, y] = useState(!1), { t: v, i18n: I } = useTranslation(), F = useForm(), R = extractNFormPaths(r), [T, D] = useState(null);
29026
29041
  useEffect(() => {
29027
29042
  if (R.length > 0) {
29028
- const L = uid();
29043
+ const O = uid();
29029
29044
  return setTimeout(() => {
29030
- F.addEffects(L, () => reaction(
29045
+ F.addEffects(O, () => reaction(
29031
29046
  () => {
29032
29047
  const j = getValuesByPaths(F.values, R);
29033
29048
  return JSON.stringify(j);
@@ -29038,7 +29053,7 @@ const MarkdownVoidInner = withDynamicSchemaProps(
29038
29053
  { fireImmediately: !0, equals: isEqual }
29039
29054
  ));
29040
29055
  }), () => {
29041
- F.removeEffects(L);
29056
+ F.removeEffects(O);
29042
29057
  };
29043
29058
  }
29044
29059
  }, []), useEffect(() => {
@@ -29068,13 +29083,13 @@ const MarkdownVoidInner = withDynamicSchemaProps(
29068
29083
  onCancel: () => {
29069
29084
  i.editable = !1, d == null || d();
29070
29085
  },
29071
- onSubmit: (L) => z(void 0, null, function* () {
29086
+ onSubmit: (O) => z(void 0, null, function* () {
29072
29087
  var j;
29073
- i.editable = !1, (j = l["x-component-props"]) != null || (l["x-component-props"] = {}), l["x-component-props"].content = L, i.componentProps.content = L, u == null || u(l), c.emit("patch", {
29088
+ i.editable = !1, (j = l["x-component-props"]) != null || (l["x-component-props"] = {}), l["x-component-props"].content = O, i.componentProps.content = O, u == null || u(l), c.emit("patch", {
29074
29089
  schema: {
29075
29090
  "x-uid": l["x-uid"],
29076
29091
  "x-component-props": {
29077
- content: L
29092
+ content: O
29078
29093
  }
29079
29094
  }
29080
29095
  });
@@ -29242,8 +29257,8 @@ function useCollectValuesToSubmit() {
29242
29257
  }), S = {}, y = Object.keys(f).map((D) => z(this, null, function* () {
29243
29258
  const B = f[D], $ = a(D);
29244
29259
  if (isVariable$1(B)) {
29245
- const { value: L } = (yield p == null ? void 0 : p.parseVariable(B, m)) || {};
29246
- S[D] = transformVariableValue(L, { targetCollectionField: $ });
29260
+ const { value: O } = (yield p == null ? void 0 : p.parseVariable(B, m)) || {};
29261
+ S[D] = transformVariableValue(O, { targetCollectionField: $ });
29247
29262
  } else
29248
29263
  B !== "" && (S[D] = B);
29249
29264
  }));
@@ -29275,12 +29290,12 @@ const useCreateActionProps = () => {
29275
29290
  return {
29276
29291
  onClick() {
29277
29292
  return z(this, null, function* () {
29278
- var O, N;
29279
- const { onSuccess: F, skipValidator: R, triggerWorkflows: T } = (O = u == null ? void 0 : u["x-action-settings"]) != null ? O : {}, {
29293
+ var L, N;
29294
+ const { onSuccess: F, skipValidator: R, triggerWorkflows: T } = (L = u == null ? void 0 : u["x-action-settings"]) != null ? L : {}, {
29280
29295
  manualClose: D,
29281
29296
  redirecting: B,
29282
29297
  redirectTo: $,
29283
- successMessage: L,
29298
+ successMessage: O,
29284
29299
  actionAfterSuccess: j
29285
29300
  } = F || {};
29286
29301
  R || (yield n.submit());
@@ -29299,16 +29314,16 @@ const useCreateActionProps = () => {
29299
29314
  if ($ && (M = yield getVariableValue($, {
29300
29315
  variables: y,
29301
29316
  localVariables: [...S, { name: "$record", ctx: new Proxy((N = k == null ? void 0 : k.data) == null ? void 0 : N.data, {}) }]
29302
- })), (j === "previous" || !j && B !== !0) && (a == null || a(!1)), i == null || i(!0), l == null || l(!1), d.data.loading = !1, d.data.data = k, !L) {
29317
+ })), (j === "previous" || !j && B !== !0) && (a == null || a(!1)), i == null || i(!0), l == null || l(!1), d.data.loading = !1, d.data.data = k, !O) {
29303
29318
  message.success(h("Saved successfully")), yield resetFormCorrectly(n), (B && !j || j === "redirect") && M && (isURL(M) ? window.location.href = M : c(M));
29304
29319
  return;
29305
29320
  }
29306
29321
  D ? m.success({
29307
- title: p(L),
29322
+ title: p(O),
29308
29323
  onOk: () => z(this, null, function* () {
29309
29324
  yield resetFormCorrectly(n), (B && !j || j === "redirect") && M && (isURL(M) ? window.location.href = M : c(M));
29310
29325
  })
29311
- }) : (message.success(p(L)), yield resetFormCorrectly(n), (B && !j || j === "redirect") && M && (isURL(M) ? window.location.href = M : c(M)));
29326
+ }) : (message.success(p(O)), yield resetFormCorrectly(n), (B && !j || j === "redirect") && M && (isURL(M) ? window.location.href = M : c(M)));
29312
29327
  } catch (k) {
29313
29328
  d.data.loading = !1;
29314
29329
  }
@@ -29327,14 +29342,14 @@ const useCreateActionProps = () => {
29327
29342
  onSuccess: D,
29328
29343
  overwriteValues: B,
29329
29344
  skipValidator: $,
29330
- triggerWorkflows: L
29331
- } = (M = l == null ? void 0 : l["x-action-settings"]) != null ? M : {}, j = (q = a == null ? void 0 : a["x-component-props"]) == null ? void 0 : q.addChild, { successMessage: w } = D || {}, O = {}, N = Object.keys(T).map((G) => z(this, null, function* () {
29345
+ triggerWorkflows: O
29346
+ } = (M = l == null ? void 0 : l["x-action-settings"]) != null ? M : {}, j = (q = a == null ? void 0 : a["x-component-props"]) == null ? void 0 : q.addChild, { successMessage: w } = D || {}, L = {}, N = Object.keys(T).map((G) => z(this, null, function* () {
29332
29347
  const Y = T[G], J = d(G);
29333
29348
  if (isVariable$1(Y)) {
29334
29349
  const { value: K } = (yield C == null ? void 0 : C.parseVariable(Y, b)) || {};
29335
- O[G] = transformVariableValue(K, { targetCollectionField: J });
29350
+ L[G] = transformVariableValue(K, { targetCollectionField: J });
29336
29351
  } else
29337
- Y !== "" && (O[G] = Y);
29352
+ Y !== "" && (L[G] = Y);
29338
29353
  }));
29339
29354
  yield Promise.all(N), $ || (yield e.submit());
29340
29355
  const k = getFormValues({
@@ -29353,10 +29368,10 @@ const useCreateActionProps = () => {
29353
29368
  c.data = t.data || {}, c.data.loading = !0;
29354
29369
  try {
29355
29370
  const G = yield n[y]({
29356
- values: x(x(x({}, k), B), O),
29371
+ values: x(x(x({}, k), B), L),
29357
29372
  filterKeys: v,
29358
29373
  // TODO(refactor): should change to inject by plugin
29359
- triggerWorkflows: L != null && L.length ? L.map((Y) => [Y.workflowKey, Y.context].filter(Boolean).join("!")).join(",") : void 0
29374
+ triggerWorkflows: O != null && O.length ? O.map((Y) => [Y.workflowKey, Y.context].filter(Boolean).join("!")).join(",") : void 0
29360
29375
  });
29361
29376
  if (c.data.loading = !1, c.data.data = G, (U = (H = o == null ? void 0 : o.service) == null ? void 0 : H.refresh) == null || U.call(H), r == null || r(!1), i == null || i(!0), !w)
29362
29377
  return;
@@ -29465,7 +29480,7 @@ const useCreateActionProps = () => {
29465
29480
  return {
29466
29481
  onClick(f, C) {
29467
29482
  return z(this, null, function* () {
29468
- var w, O, N, k;
29483
+ var w, L, N, k;
29469
29484
  const {
29470
29485
  assignedValues: b = {},
29471
29486
  onSuccess: S,
@@ -29486,7 +29501,7 @@ const useCreateActionProps = () => {
29486
29501
  q !== "" && (B[M] = q);
29487
29502
  }));
29488
29503
  yield Promise.all($), y === !1 && (yield l.submit());
29489
- const L = yield e.update({
29504
+ const O = yield e.update({
29490
29505
  filterByTk: o,
29491
29506
  values: x({}, B),
29492
29507
  // TODO(refactor): should change to inject by plugin
@@ -29495,7 +29510,7 @@ const useCreateActionProps = () => {
29495
29510
  let j = R;
29496
29511
  R && (j = yield getVariableValue(R, {
29497
29512
  variables: u,
29498
- localVariables: [...d, { name: "$record", ctx: new Proxy((O = L == null ? void 0 : L.data) == null ? void 0 : O.data, {}) }]
29513
+ localVariables: [...d, { name: "$record", ctx: new Proxy((L = O == null ? void 0 : O.data) == null ? void 0 : L.data, {}) }]
29499
29514
  })), (D === "previous" || !D && F !== !0) && (h == null || h(!1)), C && (C == null || C()), e instanceof TableFieldResource || (k = (N = t == null ? void 0 : t.service) == null ? void 0 : N.refresh) == null || k.call(N), T && (I ? c.success({
29500
29515
  title: i(T),
29501
29516
  onOk: () => z(this, null, function* () {
@@ -29518,7 +29533,7 @@ const useCreateActionProps = () => {
29518
29533
  assignedValues: T = {},
29519
29534
  onSuccess: D,
29520
29535
  updateMode: B
29521
- } = (M = a == null ? void 0 : a["x-action-settings"]) != null ? M : {}, { manualClose: $, redirecting: L, redirectTo: j, successMessage: w, actionAfterSuccess: O } = D || {};
29536
+ } = (M = a == null ? void 0 : a["x-action-settings"]) != null ? M : {}, { manualClose: $, redirecting: O, redirectTo: j, successMessage: w, actionAfterSuccess: L } = D || {};
29522
29537
  m.data = e.data || {}, m.data.loading = !0;
29523
29538
  const N = {}, k = Object.keys(T).map((E) => z(this, null, function* () {
29524
29539
  const V = T[E], H = C(E);
@@ -29528,7 +29543,7 @@ const useCreateActionProps = () => {
29528
29543
  } else
29529
29544
  V !== "" && (N[E] = V);
29530
29545
  }));
29531
- yield Promise.all(k), (O === "previous" || !O && L !== !0) && (S == null || S(!1)), h.confirm({
29546
+ yield Promise.all(k), (L === "previous" || !L && O !== !0) && (S == null || S(!1)), h.confirm({
29532
29547
  title: p("Bulk update"),
29533
29548
  content: p(B === "selected" ? "Update selected data?" : "Update all data?"),
29534
29549
  onOk() {
@@ -29556,9 +29571,9 @@ const useCreateActionProps = () => {
29556
29571
  t instanceof TableFieldResource || (Y = (G = n == null ? void 0 : n.service) == null ? void 0 : G.refresh) == null || Y.call(G), w && ($ ? h.success({
29557
29572
  title: d(w),
29558
29573
  onOk: () => z(this, null, function* () {
29559
- (L && !O || O === "redirect") && j && (isURL(j) ? window.location.href = j : u(j));
29574
+ (O && !L || L === "redirect") && j && (isURL(j) ? window.location.href = j : u(j));
29560
29575
  })
29561
- }) : (message.success(d(w)), (L && !O || O === "redirect") && j && (isURL(j) ? window.location.href = j : u(j))));
29576
+ }) : (message.success(d(w)), (O && !L || L === "redirect") && j && (isURL(j) ? window.location.href = j : u(j))));
29562
29577
  });
29563
29578
  },
29564
29579
  onCancel() {
@@ -29577,11 +29592,11 @@ const useCreateActionProps = () => {
29577
29592
  onClick() {
29578
29593
  return z(this, null, function* () {
29579
29594
  var E, V, H, U;
29580
- const { skipValidator: F, onSuccess: R, requestSettings: T } = (E = o == null ? void 0 : o["x-action-settings"]) != null ? E : {}, { manualClose: D, redirecting: B, redirectTo: $, successMessage: L, actionAfterSuccess: j } = R || {}, w = o == null ? void 0 : o["x-action"];
29595
+ const { skipValidator: F, onSuccess: R, requestSettings: T } = (E = o == null ? void 0 : o["x-action-settings"]) != null ? E : {}, { manualClose: D, redirecting: B, redirectTo: $, successMessage: O, actionAfterSuccess: j } = R || {}, w = o == null ? void 0 : o["x-action"];
29581
29596
  if (!T.url)
29582
29597
  return;
29583
29598
  F !== !0 && w === "customize:form:request" && (yield a.submit());
29584
- const O = T.headers ? JSON.parse(T.headers) : {}, N = T.params ? JSON.parse(T.params) : {}, k = T.data ? JSON.parse(T.data) : {};
29599
+ const L = T.headers ? JSON.parse(T.headers) : {}, N = T.params ? JSON.parse(T.params) : {}, k = T.data ? JSON.parse(T.data) : {};
29585
29600
  if (w === "customize:form:request" && ["POST", "PUT", "PATCH"].includes(T.method)) {
29586
29601
  const G = i.map((J) => J.name), Y = getFormValues({
29587
29602
  filterByTk: n,
@@ -29597,18 +29612,18 @@ const useCreateActionProps = () => {
29597
29612
  const q = {
29598
29613
  url: renderTemplate(T.url, { currentRecord: m, currentUser: g }),
29599
29614
  method: T.method,
29600
- headers: parse(O)({ currentRecord: m, currentUser: g }),
29615
+ headers: parse(L)({ currentRecord: m, currentUser: g }),
29601
29616
  params: parse(N)({ currentRecord: m, currentUser: g }),
29602
29617
  data: parse(k)({ currentRecord: m, currentUser: g })
29603
29618
  };
29604
29619
  f.data = c.data || {}, f.data.loading = !0;
29605
29620
  try {
29606
- yield e.request(x({}, q)), f.data.loading = !1, u instanceof TableFieldResource || (H = (V = d == null ? void 0 : d.service) == null ? void 0 : V.refresh) == null || H.call(V), (U = p == null ? void 0 : p.refresh) == null || U.call(p), w === "customize:form:request" && (j === "previous" || !j && B !== !0) && (b == null || b(!1)), L || (message.success(C("Saved successfully")), yield resetFormCorrectly(a), (B && !j || j === "redirect") && $ && (isURL($) ? window.location.href = $ : t($))), D ? S.success({
29607
- title: r(L),
29621
+ yield e.request(x({}, q)), f.data.loading = !1, u instanceof TableFieldResource || (H = (V = d == null ? void 0 : d.service) == null ? void 0 : V.refresh) == null || H.call(V), (U = p == null ? void 0 : p.refresh) == null || U.call(p), w === "customize:form:request" && (j === "previous" || !j && B !== !0) && (b == null || b(!1)), O || (message.success(C("Saved successfully")), yield resetFormCorrectly(a), (B && !j || j === "redirect") && $ && (isURL($) ? window.location.href = $ : t($))), D ? S.success({
29622
+ title: r(O),
29608
29623
  onOk: () => z(this, null, function* () {
29609
29624
  (B && !j || j === "redirect") && $ && (isURL($) ? window.location.href = $ : t($));
29610
29625
  })
29611
- }) : message.success(r(L));
29626
+ }) : message.success(r(O));
29612
29627
  } finally {
29613
29628
  f.data.loading = !1;
29614
29629
  }
@@ -29628,10 +29643,10 @@ const useCreateActionProps = () => {
29628
29643
  skipValidator: B,
29629
29644
  triggerWorkflows: $
29630
29645
  } = (V = l == null ? void 0 : l["x-action-settings"]) != null ? V : {}, {
29631
- manualClose: L,
29646
+ manualClose: O,
29632
29647
  redirecting: j,
29633
29648
  redirectTo: w,
29634
- successMessage: O,
29649
+ successMessage: L,
29635
29650
  actionAfterSuccess: N
29636
29651
  } = T || {}, k = {}, M = Object.keys(R).map((U) => z(this, null, function* () {
29637
29652
  const G = R[U], Y = d(U);
@@ -29666,14 +29681,14 @@ const useCreateActionProps = () => {
29666
29681
  if (w && (G = yield getVariableValue(w, {
29667
29682
  variables: b,
29668
29683
  localVariables: [...S, { name: "$record", ctx: new Proxy((H = U == null ? void 0 : U.data) == null ? void 0 : H.data, {}) }]
29669
- })), (N === "previous" || !N && j !== !0) && (a == null || a(!1)), i == null || i(!1), !O)
29684
+ })), (N === "previous" || !N && j !== !0) && (a == null || a(!1)), i == null || i(!1), !L)
29670
29685
  return;
29671
- L ? f.success({
29672
- title: m(O),
29686
+ O ? f.success({
29687
+ title: m(L),
29673
29688
  onOk: () => z(this, null, function* () {
29674
29689
  yield e.reset(), (j && !N || N === "redirect") && G && (isURL(G) ? window.location.href = G : c(G));
29675
29690
  })
29676
- }) : (message.success(m(O)), (j && !N || N === "redirect" || N === "redirect") && G && (isURL(G) ? window.location.href = G : c(G)));
29691
+ }) : (message.success(m(L)), (j && !N || N === "redirect" || N === "redirect") && G && (isURL(G) ? window.location.href = G : c(G)));
29677
29692
  } catch (U) {
29678
29693
  h.data.loading = !1;
29679
29694
  }
@@ -29864,7 +29879,7 @@ const useCreateActionProps = () => {
29864
29879
  var n;
29865
29880
  return ["select", "multipleSelect", "checkbox", "checkboxGroup", "chinaRegion"].includes(e == null ? void 0 : e.interface) && ((n = e == null ? void 0 : e.uiSchema) == null ? void 0 : n.enum);
29866
29881
  }, useAssociationFilterBlockProps = () => {
29867
- var v, I, F, R, T, D, B, $, L, j;
29882
+ var v, I, F, R, T, D, B, $, O, j;
29868
29883
  const e = AssociationFilter.useAssociationField(), t = useFieldSchema(), n = useOptionalFieldList(), { getDataBlocks: o } = useFilterBlock(), r = e == null ? void 0 : e.name, a = useField(), { props: i } = useBlockRequestContext(), l = useDataSourceHeaders(i == null ? void 0 : i.dataSource), c = useCollectionManager(), { filter: u, parseVariableLoading: d } = useParsedFilter({ filterOption: (I = (v = a.componentProps) == null ? void 0 : v.params) == null ? void 0 : I.filter });
29869
29884
  let p, m, h, g, f, C, b, S;
29870
29885
  C = e != null && e.target ? (F = c == null ? void 0 : c.getCollection(e.target)) == null ? void 0 : F.getPrimaryKey() : "id", b = ((T = (R = t["x-component-props"]) == null ? void 0 : R.fieldNames) == null ? void 0 : T.label) || C, { data: f, params: h, run: g } = useRequest(
@@ -29893,15 +29908,15 @@ const useCreateActionProps = () => {
29893
29908
  g,
29894
29909
  C,
29895
29910
  (B = a.componentProps) == null ? void 0 : B.params,
29896
- (L = ($ = a.componentProps) == null ? void 0 : $.params) == null ? void 0 : L.sort,
29911
+ (O = ($ = a.componentProps) == null ? void 0 : $.params) == null ? void 0 : O.sort,
29897
29912
  d
29898
29913
  ]);
29899
29914
  const y = useCallback(
29900
29915
  (w) => {
29901
- const { targets: O, uid: N } = findFilterTargets(t);
29916
+ const { targets: L, uid: N } = findFilterTargets(t);
29902
29917
  o().forEach((k) => {
29903
29918
  var U, G, Y, J;
29904
- if (!O.find((K) => K.uid === k.uid))
29919
+ if (!L.find((K) => K.uid === k.uid))
29905
29920
  return;
29906
29921
  const q = `${N}${t.name}`, E = ((U = k.service.params) == null ? void 0 : U[0]) || {};
29907
29922
  (Y = (G = k.service.params) == null ? void 0 : G[1]) != null && Y.filters || _.set(k.service.params, "[1].filters", {});
@@ -29930,14 +29945,14 @@ const useCreateActionProps = () => {
29930
29945
  if (!e)
29931
29946
  return {};
29932
29947
  if (isOptionalField(e)) {
29933
- const w = n.find((k) => k.name === t.name), O = {
29948
+ const w = n.find((k) => k.name === t.name), L = {
29934
29949
  select: "$in",
29935
29950
  multipleSelect: "$anyOf",
29936
29951
  checkbox: "$in",
29937
29952
  checkboxGroup: "$anyOf"
29938
29953
  }, N = ((j = w == null ? void 0 : w.uiSchema) == null ? void 0 : j.enum) || [];
29939
29954
  C = "value", b = "label", p = N, h = {}, g = () => {
29940
- }, S = `${w.name}.${O[w.interface]}`, m = (k) => {
29955
+ }, S = `${w.name}.${L[w.interface]}`, m = (k) => {
29941
29956
  const M = k.target.value;
29942
29957
  if (!M) {
29943
29958
  p = N;
@@ -30234,35 +30249,35 @@ const useSyncFromForm = (e, t, n) => {
30234
30249
  const $ = {
30235
30250
  type: "duplicate",
30236
30251
  tag: c((w = B.uiSchema) == null ? void 0 : w.title) || B.name
30237
- }, L = P(x({}, $), {
30252
+ }, O = P(x({}, $), {
30238
30253
  title: React.createElement(TreeNode, $),
30239
30254
  key: v ? `${v}.${B.name}` : B.name,
30240
30255
  isLeaf: !0,
30241
30256
  field: B,
30242
30257
  disabled: I
30243
- }), j = F.find((O) => O.name === L.key);
30258
+ }), j = F.find((L) => L.name === O.key);
30244
30259
  if (["belongsTo", "belongsToMany"].includes(B.type) && (!j || ["Select", "Picker"].includes(j == null ? void 0 : j.fieldMode)))
30245
- $.type = "reference", L.type = "reference", L.title = React.createElement(TreeNode, P(x({}, $), { type: "reference" })), L.isLeaf = !1, L.children = m(B.target, {
30260
+ $.type = "reference", O.type = "reference", O.title = React.createElement(TreeNode, P(x({}, $), { type: "reference" })), O.isLeaf = !1, O.children = m(B.target, {
30246
30261
  depth: S + 1,
30247
30262
  maxDepth: y,
30248
- prefix: L.key,
30263
+ prefix: O.key,
30249
30264
  exclude: systemKeys
30250
30265
  });
30251
30266
  else if (["hasOne", "hasMany"].includes(B.type) || ["Nester", "SubTable"].includes(j == null ? void 0 : j.fieldMode)) {
30252
- let O = !1;
30253
- ["hasOne", "hasMany"].includes(B.type) && ["Select", "Picker"].includes(j == null ? void 0 : j.fieldMode) && (O = !0), L.disabled = !0, L.isLeaf = !1, L.children = p(
30267
+ let L = !1;
30268
+ ["hasOne", "hasMany"].includes(B.type) && ["Select", "Picker"].includes(j == null ? void 0 : j.fieldMode) && (L = !0), O.disabled = !0, O.isLeaf = !1, O.children = p(
30254
30269
  B.target,
30255
30270
  {
30256
30271
  depth: S + 1,
30257
30272
  maxDepth: y,
30258
- prefix: L.key,
30273
+ prefix: O.key,
30259
30274
  exclude: ["id", ...systemKeys],
30260
- disabled: O
30275
+ disabled: L
30261
30276
  },
30262
30277
  F
30263
30278
  );
30264
30279
  }
30265
- return L;
30280
+ return O;
30266
30281
  }).filter(Boolean);
30267
30282
  return f.set(R, D), D;
30268
30283
  })(new LRUCache({ max: 100 })), m = /* @__PURE__ */ ((f) => (C, { prefix: b, maxDepth: S, depth: y = 0, exclude: v = [] }) => {
@@ -30272,7 +30287,7 @@ const useSyncFromForm = (e, t, n) => {
30272
30287
  if (y > S)
30273
30288
  return [];
30274
30289
  const R = r(C).map((T) => {
30275
- var $, L;
30290
+ var $, O;
30276
30291
  if (!T.target || !T.interface || v.includes(T.name))
30277
30292
  return;
30278
30293
  const D = {
@@ -30281,7 +30296,7 @@ const useSyncFromForm = (e, t, n) => {
30281
30296
  }, B = b ? `${b}.${T.name}` : T.name;
30282
30297
  return {
30283
30298
  type: "preloading",
30284
- tag: c((L = T.uiSchema) == null ? void 0 : L.title) || T.name,
30299
+ tag: c((O = T.uiSchema) == null ? void 0 : O.title) || T.name,
30285
30300
  title: React.createElement(TreeNode, D),
30286
30301
  key: B,
30287
30302
  isLeaf: !1,
@@ -30311,9 +30326,9 @@ const useSyncFromForm = (e, t, n) => {
30311
30326
  const f = /* @__PURE__ */ new Set([]), C = /* @__PURE__ */ new Set([]), b = (v, I) => {
30312
30327
  var F;
30313
30328
  (F = v == null ? void 0 : v.reduceProperties) == null || F.call(v, (R, T) => {
30314
- var O, N, k;
30315
- const D = R || I, B = T["x-collection-field"] && o(T["x-collection-field"]), $ = T.name.includes("."), L = B && ["hasOne", "hasMany", "belongsTo", "belongsToMany"].includes(B.type), j = !L && $ ? getAssociationPath(T.name) : T.name, w = D === "" || !D ? j : D + "." + j;
30316
- if (B && !(["hasOne", "hasMany"].includes(B.type) || ["SubForm", "Nester"].includes((O = T["x-component-props"]) == null ? void 0 : O.mode)) && C.add(w), B && (L || $) && T["x-component"] !== "TableField") {
30329
+ var L, N, k;
30330
+ const D = R || I, B = T["x-collection-field"] && o(T["x-collection-field"]), $ = T.name.includes("."), O = B && ["hasOne", "hasMany", "belongsTo", "belongsToMany"].includes(B.type), j = !O && $ ? getAssociationPath(T.name) : T.name, w = D === "" || !D ? j : D + "." + j;
30331
+ if (B && !(["hasOne", "hasMany"].includes(B.type) || ["SubForm", "Nester"].includes((L = T["x-component-props"]) == null ? void 0 : L.mode)) && C.add(w), B && (O || $) && T["x-component"] !== "TableField") {
30317
30332
  if (f.add({ name: w, fieldMode: ((N = T["x-component-props"]) == null ? void 0 : N.mode) || "Select" }), ["Nester", "SubTable"].includes((k = T["x-component-props"]) == null ? void 0 : k.mode)) {
30318
30333
  const M = D && D !== "" ? D + "." + T.name : T.name;
30319
30334
  b(T, M);
@@ -31367,7 +31382,7 @@ const DragHandler = (e) => {
31367
31382
  } = useURLSearchParamsVariable(), { datetimeCtx: F } = useDatetimeVariableContext(), { currentFormCtx: R } = useCurrentFormContext({ form: e == null ? void 0 : e.currentForm }), { name: T } = useCollection_deprecated(), D = useContextVariable();
31368
31383
  let { name: B } = useBlockCollection();
31369
31384
  e != null && e.collectionName && (B = e.collectionName);
31370
- const $ = useApp(), L = ((j = $.getVariables) == null ? void 0 : j.call($).map((w) => ({
31385
+ const $ = useApp(), O = ((j = $.getVariables) == null ? void 0 : j.call($).map((w) => ({
31371
31386
  name: w.name,
31372
31387
  ctx: w.useCtx()
31373
31388
  }))) || [];
@@ -31458,7 +31473,7 @@ const DragHandler = (e) => {
31458
31473
  ctx: y,
31459
31474
  defaultValue: I
31460
31475
  },
31461
- ...L
31476
+ ...O
31462
31477
  ].filter(Boolean), [
31463
31478
  i,
31464
31479
  l,
@@ -31482,7 +31497,7 @@ const DragHandler = (e) => {
31482
31497
  o,
31483
31498
  D,
31484
31499
  y,
31485
- ...L.map((w) => w.ctx)
31500
+ ...O.map((w) => w.ctx)
31486
31501
  ]);
31487
31502
  }, useLocalVariables$1 = useLocalVariables, useVariables = () => useContext(VariablesContext), useVariables$1 = useVariables, isSubFormOrSubTableField = (e) => {
31488
31503
  for (; e; ) {
@@ -31558,7 +31573,7 @@ const useParseDefaultValue = () => {
31558
31573
  const D = !t.name.toString().includes(".") && (d == null ? void 0 : d.getField(t.name)), {
31559
31574
  value: B,
31560
31575
  collectionName: $,
31561
- dataSource: L = "main"
31576
+ dataSource: O = "main"
31562
31577
  } = yield n.parseVariable(t.default, o, {
31563
31578
  fieldOperator: C(t.name)
31564
31579
  });
@@ -31566,7 +31581,7 @@ const useParseDefaultValue = () => {
31566
31581
  collectionName: D.target,
31567
31582
  targetCollectionName: $,
31568
31583
  dm: b,
31569
- dataSource: L
31584
+ dataSource: O
31570
31585
  })) {
31571
31586
  e.loading = !1;
31572
31587
  return;
@@ -31582,8 +31597,8 @@ const useParseDefaultValue = () => {
31582
31597
  const R = getVariableName(t.default), T = S(R);
31583
31598
  return T ? (y({ forceUpdate: !0 }), reaction(
31584
31599
  () => {
31585
- const B = { [R]: (T == null ? void 0 : T.ctx) || {} }, $ = getPath(t.default), L = getValuesByPath(B, $);
31586
- return L === void 0 ? Math.random() : L;
31600
+ const B = { [R]: (T == null ? void 0 : T.ctx) || {} }, $ = getPath(t.default), O = getValuesByPath(B, $);
31601
+ return O === void 0 ? Math.random() : O;
31587
31602
  },
31588
31603
  () => v({ forceUpdate: !0 }),
31589
31604
  {
@@ -37614,8 +37629,8 @@ const enabledIndexColumn$1 = {
37614
37629
  name: "fieldSettings:component:CascadeSelect",
37615
37630
  items: [fieldComponent$6, titleField$1, ellipsisSettingsItem, setTheDataScope]
37616
37631
  }), SchemaSettingsDateRange = function e(t) {
37617
- var R, T, D, B, $, L, j, w, O, N, k, M, q, E, V, H;
37618
- const { fieldSchema: n } = t, o = useField(), { dn: r } = useDesignable(), { t: a } = useTranslation(), { getCollectionJoinField: i } = useCollectionManager_deprecated(), { isInSubForm: l, isInSubTable: c } = useFlag() || {}, u = i(n == null ? void 0 : n["x-collection-field"]) || {}, d = ((R = n == null ? void 0 : n["x-component-props"]) == null ? void 0 : R.showTime) || ((D = (T = u == null ? void 0 : u.uiSchema) == null ? void 0 : T["x-component-props"]) == null ? void 0 : D.showTime) || !1, p = ((B = n == null ? void 0 : n["x-component-props"]) == null ? void 0 : B.dateFormat) || ((L = ($ = u == null ? void 0 : u.uiSchema) == null ? void 0 : $["x-component-props"]) == null ? void 0 : L.dateFormat) || "YYYY-MM-DD", m = ((j = n == null ? void 0 : n["x-component-props"]) == null ? void 0 : j.timeFormat) || ((O = (w = u == null ? void 0 : u.uiSchema) == null ? void 0 : w["x-component-props"]) == null ? void 0 : O.timeFormat) || "HH:mm:ss", h = ((N = n == null ? void 0 : n["x-component-props"]) == null ? void 0 : N.picker) || ((M = (k = u == null ? void 0 : u.uiSchema) == null ? void 0 : k["x-component-props"]) == null ? void 0 : M.picker) || "date";
37632
+ var R, T, D, B, $, O, j, w, L, N, k, M, q, E, V, H;
37633
+ const { fieldSchema: n } = t, o = useField(), { dn: r } = useDesignable(), { t: a } = useTranslation(), { getCollectionJoinField: i } = useCollectionManager_deprecated(), { isInSubForm: l, isInSubTable: c } = useFlag() || {}, u = i(n == null ? void 0 : n["x-collection-field"]) || {}, d = ((R = n == null ? void 0 : n["x-component-props"]) == null ? void 0 : R.showTime) || ((D = (T = u == null ? void 0 : u.uiSchema) == null ? void 0 : T["x-component-props"]) == null ? void 0 : D.showTime) || !1, p = ((B = n == null ? void 0 : n["x-component-props"]) == null ? void 0 : B.dateFormat) || ((O = ($ = u == null ? void 0 : u.uiSchema) == null ? void 0 : $["x-component-props"]) == null ? void 0 : O.dateFormat) || "YYYY-MM-DD", m = ((j = n == null ? void 0 : n["x-component-props"]) == null ? void 0 : j.timeFormat) || ((L = (w = u == null ? void 0 : u.uiSchema) == null ? void 0 : w["x-component-props"]) == null ? void 0 : L.timeFormat) || "HH:mm:ss", h = ((N = n == null ? void 0 : n["x-component-props"]) == null ? void 0 : N.picker) || ((M = (k = u == null ? void 0 : u.uiSchema) == null ? void 0 : k["x-component-props"]) == null ? void 0 : M.picker) || "date";
37619
37634
  n["x-read-pretty"] || o.readOnly || o.readPretty;
37620
37635
  const g = (q = n == null ? void 0 : n["x-component-props"]) == null ? void 0 : q._minDate, f = (E = n == null ? void 0 : n["x-component-props"]) == null ? void 0 : E._maxDate, C = ((V = u == null ? void 0 : u.uiSchema) == null ? void 0 : V["x-component-props"].gmt) || !1, b = ((H = u == null ? void 0 : u.uiSchema) == null ? void 0 : H["x-component-props"].utc) || !1, S = useRecord(), { form: y } = useFormBlockContext(), v = useCallback(
37621
37636
  (U) => /* @__PURE__ */ jsx(
@@ -39096,12 +39111,12 @@ const variablesStore = {}, getFieldPath$1 = (e, t) => {
39096
39111
  _.isFunction(C) ? n.current = C(n.current) : n.current = C;
39097
39112
  }, []), u = useCallback(
39098
39113
  (C, b, S) => z(void 0, null, function* () {
39099
- var w, O;
39114
+ var w, L;
39100
39115
  const y = C.split("."), v = y[0], I = mergeVariableToCollectionNameWithLocalVariables(variablesStore, b);
39101
39116
  let F = mergeCtxWithLocalVariables(n.current, b);
39102
39117
  const { fieldPath: R, dataSource: T, variableOption: D } = getFieldPath$1(v, I);
39103
39118
  let B = R;
39104
- const { fieldPath: $ } = getFieldPath$1(C, I), L = y.length === 1 ? D == null ? void 0 : D.collectionName : (w = r($, T)) == null ? void 0 : w.target;
39119
+ const { fieldPath: $ } = getFieldPath$1(C, I), O = y.length === 1 ? D == null ? void 0 : D.collectionName : (w = r($, T)) == null ? void 0 : w.target;
39105
39120
  if (!(v in F))
39106
39121
  throw new Error(`VariablesProvider: ${v} is not found`);
39107
39122
  for (let N = 0; N < y.length; N++) {
@@ -39109,11 +39124,11 @@ const variablesStore = {}, getFieldPath$1 = (e, t) => {
39109
39124
  return {
39110
39125
  value: F === void 0 ? D == null ? void 0 : D.defaultValue : F,
39111
39126
  dataSource: T,
39112
- collectionName: L
39127
+ collectionName: O
39113
39128
  };
39114
39129
  if (_.isFunction(F))
39115
39130
  break;
39116
- const k = y[N], M = y.slice(0, N + 1).join("."), { fieldPath: q } = getFieldPath$1(M, I), E = r(q, T), V = (O = a(B, T)) == null ? void 0 : O.getPrimaryKey();
39131
+ const k = y[N], M = y.slice(0, N + 1).join("."), { fieldPath: q } = getFieldPath$1(M, I), E = r(q, T), V = (L = a(B, T)) == null ? void 0 : L.getPrimaryKey();
39117
39132
  if (Array.isArray(F)) {
39118
39133
  const H = F.map((U) => {
39119
39134
  if (!(S != null && S.doNotRequest) && shouldToRequest(U == null ? void 0 : U[k], U, M) && (U == null ? void 0 : U[V]) != null && E != null && E.target) {
@@ -39163,7 +39178,7 @@ const variablesStore = {}, getFieldPath$1 = (e, t) => {
39163
39178
  return {
39164
39179
  value: j === void 0 ? D.defaultValue : j,
39165
39180
  dataSource: T,
39166
- collectionName: L
39181
+ collectionName: O
39167
39182
  };
39168
39183
  }),
39169
39184
  [r]
@@ -39588,8 +39603,8 @@ const NocoBaseField = (e) => {
39588
39603
  !y.parent && p && (y.parent = p, !((B = (D = y.parent) == null ? void 0 : D.properties) != null && B[y.name]) && y.name && _.set(y.parent, `properties.${y.name}`, y));
39589
39604
  const v = useCallback(() => {
39590
39605
  const $ = y.parent;
39591
- h.current = new Schema(y.toJSON(), $), $ != null && $.properties && Object.keys($.properties).forEach((L) => {
39592
- L === y.name && ($.properties[L] = h.current);
39606
+ h.current = new Schema(y.toJSON(), $), $ != null && $.properties && Object.keys($.properties).forEach((O) => {
39607
+ O === y.name && ($.properties[O] = h.current);
39593
39608
  }), b(), S == null || S();
39594
39609
  }, [y, S, b]), I = useMemo(() => d ? createMergedSchemaInstance(y, d, o) : f ? (f.default = C, createMergedSchemaInstance(y, f, o)) : y, [f, C, y, o, d]), F = useFieldProps(I), R = ($) => {
39595
39610
  if (!r)
@@ -39745,7 +39760,7 @@ const ActionLink = withDynamicSchemaProps(
39745
39760
  return ((K = F == null ? void 0 : F["x-linkage-rules"]) == null ? void 0 : K.filter((X) => !X.disabled)) || [];
39746
39761
  },
39747
39762
  [F == null ? void 0 : F["x-linkage-rules"]]
39748
- ), { designable: $ } = useDesignable(), L = useComponent(o) || o, j = useVariables$1(), w = useLocalVariables$1(), { visibleWithURL: O, setVisibleWithURL: N } = usePopupUtils(), { setSubmitted: k } = useActionContext(), { getAriaLabel: M } = useGetAriaLabelOfAction(l), q = useCollectionParentRecordData(), E = useApp(), { getAllDataBlocks: V } = useAllDataBlocks(), H = useForm();
39763
+ ), { designable: $ } = useDesignable(), O = useComponent(o) || o, j = useVariables$1(), w = useLocalVariables$1(), { visibleWithURL: L, setVisibleWithURL: N } = usePopupUtils(), { setSubmitted: k } = useActionContext(), { getAriaLabel: M } = useGetAriaLabelOfAction(l), q = useCollectionParentRecordData(), E = useApp(), { getAllDataBlocks: V } = useAllDataBlocks(), H = useForm();
39749
39764
  useEffect(() => {
39750
39765
  I.stateOfLinkageRules && setInitialActionState(I);
39751
39766
  const K = uid(), X = [];
@@ -39809,7 +39824,7 @@ const ActionLink = withDynamicSchemaProps(
39809
39824
  icon: i,
39810
39825
  loading: d,
39811
39826
  handleMouseEnter: U,
39812
- tarComponent: L,
39827
+ tarComponent: O,
39813
39828
  className: a,
39814
39829
  type: e.type,
39815
39830
  Designer: v,
@@ -39823,7 +39838,7 @@ const ActionLink = withDynamicSchemaProps(
39823
39838
  style: u,
39824
39839
  propsDisabled: m,
39825
39840
  useAction: r,
39826
- visibleWithURL: O,
39841
+ visibleWithURL: L,
39827
39842
  setVisibleWithURL: N,
39828
39843
  setSubmitted: k,
39829
39844
  getAriaLabel: M,
@@ -39862,7 +39877,7 @@ const ActionLink = withDynamicSchemaProps(
39862
39877
  setVisibleWithURL: D,
39863
39878
  setSubmitted: B,
39864
39879
  getAriaLabel: $,
39865
- parentRecordData: L
39880
+ parentRecordData: O
39866
39881
  } = Ce, j = W(Ce, [
39867
39882
  "containerRefKey",
39868
39883
  "fieldSchema",
@@ -39891,7 +39906,7 @@ const ActionLink = withDynamicSchemaProps(
39891
39906
  "setSubmitted",
39892
39907
  "getAriaLabel",
39893
39908
  "parentRecordData"
39894
- ]), [w, O] = useState(!1), { wrapSSR: N, componentCls: k, hashId: M } = useStyles$8(), [q, E] = useState(!1), V = o["x-toolbar-props"] || o["x-designer-props"], H = (he = o == null ? void 0 : o["x-component-props"]) == null ? void 0 : he.openMode, U = (ge = o == null ? void 0 : o["x-component-props"]) == null ? void 0 : ge.openSize, G = (xe = o == null ? void 0 : o["x-component-props"]) == null ? void 0 : xe.refreshDataBlockRequest, { modal: Y } = App.useApp(), J = useForm(), K = useACLActionParamsContext(), {
39909
+ ]), [w, L] = useState(!1), { wrapSSR: N, componentCls: k, hashId: M } = useStyles$8(), [q, E] = useState(!1), V = o["x-toolbar-props"] || o["x-designer-props"], H = (he = o == null ? void 0 : o["x-component-props"]) == null ? void 0 : he.openMode, U = (ge = o == null ? void 0 : o["x-component-props"]) == null ? void 0 : ge.openSize, G = (xe = o == null ? void 0 : o["x-component-props"]) == null ? void 0 : xe.refreshDataBlockRequest, { modal: Y } = App.useApp(), J = useForm(), K = useACLActionParamsContext(), {
39895
39910
  run: X,
39896
39911
  element: ee,
39897
39912
  disabled: Q,
@@ -39923,7 +39938,7 @@ const ActionLink = withDynamicSchemaProps(
39923
39938
  onClick: h,
39924
39939
  refreshDataBlockRequest: G,
39925
39940
  fieldSchema: o,
39926
- setVisible: O,
39941
+ setVisible: L,
39927
39942
  run: X,
39928
39943
  confirm: g,
39929
39944
  modal: Y,
@@ -39932,7 +39947,7 @@ const ActionLink = withDynamicSchemaProps(
39932
39947
  title: y
39933
39948
  }, ue = useCallback(
39934
39949
  (de) => {
39935
- O == null || O(de), D == null || D(de);
39950
+ L == null || L(de), D == null || D(de);
39936
39951
  },
39937
39952
  [D]
39938
39953
  );
@@ -40031,10 +40046,10 @@ const RenderButton = ({
40031
40046
  confirmTitle: D,
40032
40047
  title: B
40033
40048
  }) => {
40034
- const { getDataBlockRequest: $ } = useDataBlockRequestGetter(), { t: L } = useTranslation(), { isPopupVisibleControlledByURL: j } = usePopupSettings(), { openPopup: w } = usePopupUtils(), O = useVariables$1(), N = useLocalVariables$1(), k = useRef(null), M = useCompile(), q = useForm();
40049
+ const { getDataBlockRequest: $ } = useDataBlockRequestGetter(), { t: O } = useTranslation(), { isPopupVisibleControlledByURL: j } = usePopupSettings(), { openPopup: w } = usePopupUtils(), L = useVariables$1(), N = useLocalVariables$1(), k = useRef(null), M = useCompile(), q = useForm();
40035
40050
  k.current = w;
40036
40051
  const E = {
40037
- variables: O,
40052
+ variables: L,
40038
40053
  localVariables: N
40039
40054
  }, V = useCallback(
40040
40055
  (H, U = !0) => z(void 0, null, function* () {
@@ -40042,7 +40057,7 @@ const RenderButton = ({
40042
40057
  if (U && isPortalInBody(H.target))
40043
40058
  return;
40044
40059
  H.preventDefault(), H.stopPropagation();
40045
- const G = yield getVariableValue(L(F == null ? void 0 : F.title, { title: M(y.title) }), E), Y = yield getVariableValue(L(F == null ? void 0 : F.content, { title: M(y.title) }), E);
40060
+ const G = yield getVariableValue(O(F == null ? void 0 : F.title, { title: M(y.title) }), E), Y = yield getVariableValue(O(F == null ? void 0 : F.content, { title: M(y.title) }), E);
40046
40061
  if (!a && n) {
40047
40062
  const K = () => {
40048
40063
  b ? b(H, () => {
@@ -40051,8 +40066,8 @@ const RenderButton = ({
40051
40066
  }) : isBulkEditAction(y) || !j() ? (v(!0), I == null || I()) : ["view", "update", "create", "customize:popup"].includes(y["x-action"]) && y["x-uid"] ? k.current() : (v(!0), I == null || I());
40052
40067
  };
40053
40068
  (F == null ? void 0 : F.enable) !== !1 && (F != null && F.content) ? (yield (J = q == null ? void 0 : q.submit) == null ? void 0 : J.call(q), R.confirm({
40054
- title: L(G, { title: D || B || (t == null ? void 0 : t.title) }),
40055
- content: L(Y, { title: D || B || (t == null ? void 0 : t.title) }),
40069
+ title: O(G, { title: D || B || (t == null ? void 0 : t.title) }),
40070
+ content: O(Y, { title: D || B || (t == null ? void 0 : t.title) }),
40056
40071
  onOk: K
40057
40072
  })) : K();
40058
40073
  }
@@ -40073,7 +40088,7 @@ const RenderButton = ({
40073
40088
  I,
40074
40089
  T,
40075
40090
  v,
40076
- L,
40091
+ O,
40077
40092
  B,
40078
40093
  $
40079
40094
  ]
@@ -40106,7 +40121,7 @@ RenderButton.displayName = "RenderButton";
40106
40121
  const RenderButtonInner = observer$1(
40107
40122
  (e) => {
40108
40123
  var N, M;
40109
- const O = e, {
40124
+ const L = e, {
40110
40125
  designable: t,
40111
40126
  field: n,
40112
40127
  aclCtx: o,
@@ -40127,7 +40142,7 @@ const RenderButtonInner = observer$1(
40127
40142
  title: S,
40128
40143
  isLink: y,
40129
40144
  onlyIcon: v
40130
- } = O, I = W(O, [
40145
+ } = L, I = W(L, [
40131
40146
  "designable",
40132
40147
  "field",
40133
40148
  "aclCtx",
@@ -40175,7 +40190,7 @@ const RenderButtonInner = observer$1(
40175
40190
  );
40176
40191
  if (!t && ((N = n == null ? void 0 : n.data) != null && N.hidden || !o))
40177
40192
  return null;
40178
- const D = S != null ? S : n == null ? void 0 : n.title, B = typeof D == "string" ? F(D, { ns: NAMESPACE_UI_SCHEMA }) : D, k = l, { opacity: $ } = k, L = W(k, ["opacity"]), j = y && $ ? { opacity: $ } : void 0, w = v || p ? T : p || Button;
40193
+ const D = S != null ? S : n == null ? void 0 : n.title, B = typeof D == "string" ? F(D, { ns: NAMESPACE_UI_SCHEMA }) : D, k = l, { opacity: $ } = k, O = W(k, ["opacity"]), j = y && $ ? { opacity: $ } : void 0, w = v || p ? T : p || Button;
40179
40194
  return /* @__PURE__ */ jsxs(
40180
40195
  SortableItem,
40181
40196
  P(x({
@@ -40186,7 +40201,7 @@ const RenderButtonInner = observer$1(
40186
40201
  loading: ((M = n == null ? void 0 : n.data) == null ? void 0 : M.loading) || a,
40187
40202
  icon: typeof r == "string" ? /* @__PURE__ */ jsx(Icon, { type: r, style: j }) : r,
40188
40203
  disabled: i,
40189
- style: y ? L : l,
40204
+ style: y ? O : l,
40190
40205
  onClick: R,
40191
40206
  component: w,
40192
40207
  className: cls(m, h, g, "nb-action"),
@@ -40661,30 +40676,30 @@ const getValues = (e, t) => castArray(e).filter((n) => n != null).map((n) => typ
40661
40676
  "toOptionsItem",
40662
40677
  "popupMatchSelectWidth",
40663
40678
  "onSuccess"
40664
- ]), b = useDataSourceKey(), S = useDataSourceHeaders(m || b), y = useRef(!1), v = useFieldSchema(), I = ((Y = v["x-component-props"]) == null ? void 0 : Y.addMode) === "quickAdd", { getField: F } = useCollection_deprecated(), R = useRef(null), { getCollectionJoinField: T, getInterface: D } = useCollectionManager_deprecated(), B = v["x-collection-field"] || v.name, $ = F(B) || T(B), L = u || ($ == null ? void 0 : $.target) && (t == null ? void 0 : t.label) && T(`${$.target}.${t.label}`), j = useMemo(() => {
40679
+ ]), b = useDataSourceKey(), S = useDataSourceHeaders(m || b), y = useRef(!1), v = useFieldSchema(), I = ((Y = v["x-component-props"]) == null ? void 0 : Y.addMode) === "quickAdd", { getField: F } = useCollection_deprecated(), R = useRef(null), { getCollectionJoinField: T, getInterface: D } = useCollectionManager_deprecated(), B = v["x-collection-field"] || v.name, $ = F(B) || T(B), O = u || ($ == null ? void 0 : $.target) && (t == null ? void 0 : t.label) && T(`${$.target}.${t.label}`), j = useMemo(() => {
40665
40680
  var K;
40666
- if (L != null && L.interface) {
40667
- const X = D(L.interface), ee = ((K = X == null ? void 0 : X.filterable) == null ? void 0 : K.operators[0].value) || "$includes";
40668
- return L.type === "string" ? "$includes" : ee;
40681
+ if (O != null && O.interface) {
40682
+ const X = D(O.interface), ee = ((K = X == null ? void 0 : X.filterable) == null ? void 0 : K.operators[0].value) || "$includes";
40683
+ return O.type === "string" ? "$includes" : ee;
40669
40684
  }
40670
40685
  return "$includes";
40671
- }, [L]), w = useCompile(), O = useCallback(
40686
+ }, [O]), w = useCompile(), L = useCallback(
40672
40687
  (K) => {
40673
40688
  try {
40674
40689
  return K.filter((X) => ["number", "string"].includes(typeof X[t.value]) || !X[t.value]).map((X) => {
40675
40690
  var Q;
40676
40691
  let ee = w(X[t.label]);
40677
- if ((Q = L == null ? void 0 : L.uiSchema) != null && Q.enum)
40692
+ if ((Q = O == null ? void 0 : O.uiSchema) != null && Q.enum)
40678
40693
  if (Array.isArray(ee))
40679
40694
  ee = ee.map((te, ne) => {
40680
- const se = L.uiSchema.enum.find((ae) => ae.value === te);
40695
+ const se = O.uiSchema.enum.find((ae) => ae.value === te);
40681
40696
  return se ? /* @__PURE__ */ jsx(Tag, { role: "button", color: se.color, style: { marginRight: 3 }, children: (se == null ? void 0 : se.label) || te }, ne) : /* @__PURE__ */ jsx(Tag, { role: "button", children: te }, te);
40682
40697
  }).reverse();
40683
40698
  else {
40684
- const te = L.uiSchema.enum.find((ne) => ne.value === ee);
40699
+ const te = O.uiSchema.enum.find((ne) => ne.value === ee);
40685
40700
  te && (ee = /* @__PURE__ */ jsx(Tag, { role: "button", color: te.color, children: te.label }));
40686
40701
  }
40687
- return (L == null ? void 0 : L.type) === "date" && (ee = dayjs(ee).format("YYYY-MM-DD")), c ? c({
40702
+ return (O == null ? void 0 : O.type) === "date" && (ee = dayjs(ee).format("YYYY-MM-DD")), c ? c({
40688
40703
  [t.label]: ee || EMPTY$1,
40689
40704
  [t.value]: X[t.value]
40690
40705
  }) : P(x({}, omit(X, "style")), {
@@ -40696,7 +40711,7 @@ const getValues = (e, t) => castArray(e).filter((n) => n != null).map((n) => typ
40696
40711
  return console.error(X), K;
40697
40712
  }
40698
40713
  },
40699
- [L == null ? void 0 : L.uiSchema, t]
40714
+ [O == null ? void 0 : O.uiSchema, t]
40700
40715
  ), { data: N, run: k, loading: M } = useRequest(
40701
40716
  P(x({
40702
40717
  action: "list"
@@ -40768,7 +40783,7 @@ const getValues = (e, t) => castArray(e).filter((n) => n != null).map((n) => typ
40768
40783
  defaultValue: a
40769
40784
  }, C), {
40770
40785
  loading: N ? M : !0,
40771
- options: h(O(H)),
40786
+ options: h(L(H)),
40772
40787
  rawOptions: H,
40773
40788
  dropdownRender: (K) => {
40774
40789
  const X = H.some((ee) => ee[t.label] === R.current);
@@ -40846,9 +40861,9 @@ const useFormDataTemplates = () => {
40846
40861
  d(R), m(null), t == null || t.reset();
40847
40862
  }), []), I = useCallback((R, T, D) => z(void 0, null, function* () {
40848
40863
  const B = P(x({}, T), { dataId: R });
40849
- m(T), fetchTemplateData(h, B, D).then(($) => (t && $ && (t.reset(), t.__template = !0, forEach($, (L, j) => {
40864
+ m(T), fetchTemplateData(h, B, D).then(($) => (t && $ && (t.reset(), t.__template = !0, forEach($, (O, j) => {
40850
40865
  var w;
40851
- L && (t.values[j] = L, (w = t == null ? void 0 : t.setInitialValuesIn) == null || w.call(t, j, L));
40866
+ O && (t.values[j] = O, (w = t == null ? void 0 : t.setInitialValuesIn) == null || w.call(t, j, O));
40852
40867
  })), $)).catch(($) => {
40853
40868
  console.error($);
40854
40869
  });
@@ -41779,10 +41794,10 @@ const insertPositionToMethod = {
41779
41794
  [(D = c == null ? void 0 : c["x-component-props"]) == null ? void 0 : D.onSelect]
41780
41795
  ), h = useMemo(() => toItems$1(c == null ? void 0 : c.properties, { t: l, compile: u }), [c == null ? void 0 : c.properties, l, u]), g = useCallback(
41781
41796
  ($) => {
41782
- onFieldChange("target", (L) => {
41783
- var w, O;
41784
- const [, j] = ((O = (w = L == null ? void 0 : L.value) == null ? void 0 : w.split) == null ? void 0 : O.call(w, "||")) || [];
41785
- L.query("position").take((N) => {
41797
+ onFieldChange("target", (O) => {
41798
+ var w, L;
41799
+ const [, j] = ((L = (w = O == null ? void 0 : O.value) == null ? void 0 : w.split) == null ? void 0 : L.call(w, "||")) || [];
41800
+ O.query("position").take((N) => {
41786
41801
  N.dataSource = j === "Menu.SubMenu" ? [
41787
41802
  { label: l("Before"), value: "beforeBegin" },
41788
41803
  { label: l("After"), value: "afterEnd" },
@@ -41830,9 +41845,9 @@ const insertPositionToMethod = {
41830
41845
  }), [n.componentProps.tooltip]);
41831
41846
  o["x-component"] === "Menu.URL" && (f.properties.href = d, f.properties.params = p, C.href = n.componentProps.href, C.params = n.componentProps.params);
41832
41847
  const y = useCallback(
41833
- ({ title: $, icon: L, href: j, params: w }) => {
41848
+ ({ title: $, icon: O, href: j, params: w }) => {
41834
41849
  var N;
41835
- const O = {
41850
+ const L = {
41836
41851
  "x-uid": o["x-uid"],
41837
41852
  "x-server-hooks": [
41838
41853
  {
@@ -41841,11 +41856,11 @@ const insertPositionToMethod = {
41841
41856
  }
41842
41857
  ]
41843
41858
  };
41844
- $ && (o.title = $, n.title = $, O.title = $, i()), n.componentProps.icon = L, n.componentProps.href = j, n.componentProps.params = w, O["x-component-props"] = { icon: L, href: j, params: w }, o["x-component-props"] = o["x-component-props"] || {}, o["x-component-props"].icon = L, o["x-component-props"].href = j, o["x-component-props"].params = w, m == null || m({ item: { props: { schema: o } } }), a.emit("patch", {
41845
- schema: O
41859
+ $ && (o.title = $, n.title = $, L.title = $, i()), n.componentProps.icon = O, n.componentProps.href = j, n.componentProps.params = w, L["x-component-props"] = { icon: O, href: j, params: w }, o["x-component-props"] = o["x-component-props"] || {}, o["x-component-props"].icon = O, o["x-component-props"].href = j, o["x-component-props"].params = w, m == null || m({ item: { props: { schema: o } } }), a.emit("patch", {
41860
+ schema: L
41846
41861
  }), (N = o.__route__) != null && N.id && e(o.__route__.id, {
41847
41862
  title: $,
41848
- icon: L,
41863
+ icon: O,
41849
41864
  options: j || w ? {
41850
41865
  href: j,
41851
41866
  params: w
@@ -41855,8 +41870,8 @@ const insertPositionToMethod = {
41855
41870
  [o, n, a, i, m]
41856
41871
  ), v = useCallback(
41857
41872
  ({ tooltip: $ }) => {
41858
- var L;
41859
- (L = o.__route__) != null && L.id && e(o.__route__.id, {
41873
+ var O;
41874
+ (O = o.__route__) != null && O.id && e(o.__route__.id, {
41860
41875
  tooltip: $
41861
41876
  });
41862
41877
  },
@@ -41886,31 +41901,31 @@ const insertPositionToMethod = {
41886
41901
  }
41887
41902
  }
41888
41903
  }), [h, l]), { moveRoute: F } = useNocoBaseRoutes(), R = useCallback(
41889
- (j) => z(void 0, [j], function* ({ target: $, position: L }) {
41904
+ (j) => z(void 0, [j], function* ({ target: $, position: O }) {
41890
41905
  var q;
41891
41906
  const [w] = ((q = $ == null ? void 0 : $.split) == null ? void 0 : q.call($, "||")) || [];
41892
41907
  if (!w)
41893
41908
  return;
41894
- const O = findByUid(c, w), N = createDesignable({
41909
+ const L = findByUid(c, w), N = createDesignable({
41895
41910
  t: l,
41896
41911
  api: r,
41897
41912
  refresh: i,
41898
- current: O
41913
+ current: L
41899
41914
  }), k = {
41900
41915
  beforeBegin: "insertBefore",
41901
41916
  afterEnd: "insertAfter"
41902
- }, M = L === "beforeEnd" ? {
41917
+ }, M = O === "beforeEnd" ? {
41903
41918
  targetScope: {
41904
- parentId: O.__route__.id
41919
+ parentId: L.__route__.id
41905
41920
  }
41906
41921
  } : {
41907
- targetId: O.__route__.id
41922
+ targetId: L.__route__.id
41908
41923
  };
41909
41924
  yield F(x({
41910
41925
  sourceId: o.__route__.id,
41911
41926
  sortField: "sort",
41912
- method: k[L]
41913
- }, M)), N.loadAPIClientEvents(), N.insertAdjacent(L, o);
41927
+ method: k[O]
41928
+ }, M)), N.loadAPIClientEvents(), N.insertAdjacent(O, o);
41914
41929
  }),
41915
41930
  [c, l, r, i, F, o]
41916
41931
  ), T = useMemo(() => ({
@@ -42364,14 +42379,14 @@ const useMenuDragEnd = () => {
42364
42379
  theme: m
42365
42380
  } = useProps(e), { t: h } = useTranslation(), g = useDesigner(), f = useFieldSchema(), C = useAPIClient(), { render: b } = useSchemaInitializerRender(f["x-initializer"], f["x-initializer-props"]), S = useSideMenuRef(), [y, v] = useState(), [I, F] = useState(() => a || (r ? findKeysByUid(f, r) : [])), [R, T] = useState(() => ["inline", "mix"].includes(n) ? i || I : i), D = useMemo(() => {
42366
42381
  var j;
42367
- let L;
42382
+ let O;
42368
42383
  if (o) {
42369
42384
  const w = findKeysByUid(f, o);
42370
- L = (w == null ? void 0 : w[0]) || null;
42385
+ O = (w == null ? void 0 : w[0]) || null;
42371
42386
  } else
42372
- L = (I == null ? void 0 : I[0]) || null;
42373
- if (n === "mix" && L) {
42374
- const w = (j = f.properties) == null ? void 0 : j[L];
42387
+ O = (I == null ? void 0 : I[0]) || null;
42388
+ if (n === "mix" && O) {
42389
+ const w = (j = f.properties) == null ? void 0 : j[O];
42375
42390
  if ((w == null ? void 0 : w["x-component"]) === "Menu.SubMenu")
42376
42391
  return w;
42377
42392
  }
@@ -42382,8 +42397,8 @@ const useMenuDragEnd = () => {
42382
42397
  v(void 0);
42383
42398
  return;
42384
42399
  }
42385
- const L = findKeysByUid(f, o);
42386
- v(L), ["inline", "mix"].includes(n) && T(i || L);
42400
+ const O = findKeysByUid(f, o);
42401
+ v(O), ["inline", "mix"].includes(n) && T(i || O);
42387
42402
  }, [o]), useEffect(() => {
42388
42403
  ["inline", "mix"].includes(n) && T(I);
42389
42404
  }, [I]);
@@ -43192,7 +43207,7 @@ function loadChildren(e) {
43192
43207
  return t.length && t.some((n) => isAssociation(n.field)) || (e.isLeaf = !0), t;
43193
43208
  }
43194
43209
  function isAssociation(e) {
43195
- return e.target && e.interface;
43210
+ return ["belongsTo", "hasMany", "hasOne", "belongsToMany", "belongsToArray"].includes(e.type) && e.target && e.interface;
43196
43211
  }
43197
43212
  function trueFilter(e) {
43198
43213
  return !0;
@@ -43216,7 +43231,7 @@ function getCollectionFieldOptions(e, t) {
43216
43231
  });
43217
43232
  }
43218
43233
  const FieldsTreeSelect = (e) => {
43219
- const L = e, {
43234
+ const O = e, {
43220
43235
  title: t,
43221
43236
  value: n,
43222
43237
  onChange: o,
@@ -43226,7 +43241,7 @@ const FieldsTreeSelect = (e) => {
43226
43241
  rootOption: l,
43227
43242
  loadData: c,
43228
43243
  includeFieldPaths: u
43229
- } = L, d = W(L, [
43244
+ } = O, d = W(O, [
43230
43245
  "title",
43231
43246
  "value",
43232
43247
  "onChange",
@@ -43237,15 +43252,15 @@ const FieldsTreeSelect = (e) => {
43237
43252
  "loadData",
43238
43253
  "includeFieldPaths"
43239
43254
  ]), p = useCompile(), { t: m } = useTranslation(), [h, g] = useState({}), f = a({ collection: r }), [C, b] = parseCollectionName(f), S = useApp(), { collectionManager: y } = S.dataSourceManager.getDataSource(C), v = (j, w) => {
43240
- const O = y.getCollection(j);
43241
- return O ? O.getAllFields(w) : [];
43255
+ const L = y.getCollection(j);
43256
+ return L ? L.getAllFields(w) : [];
43242
43257
  }, I = Object.values(h), F = useMemo(() => e.multiple ? (n || []).map((j) => h[j]).filter(Boolean) : n, [n, e.multiple, h]), R = useCallback(
43243
43258
  (j) => z(void 0, null, function* () {
43244
43259
  if (c != null)
43245
43260
  return c(j);
43246
43261
  if (!j.isLeaf && j.loadChildren) {
43247
43262
  const w = j.loadChildren(j);
43248
- g((O) => w.reduce((N, k) => Object.assign(N, { [k.value]: k }), x({}, O)));
43263
+ g((L) => w.reduce((N, k) => Object.assign(N, { [k.value]: k }), x({}, L)));
43249
43264
  }
43250
43265
  }),
43251
43266
  [c]
@@ -43257,15 +43272,15 @@ const FieldsTreeSelect = (e) => {
43257
43272
  title: l.label,
43258
43273
  fullTitle: l.label,
43259
43274
  isLeaf: !1
43260
- }) : null, O = (c === null ? [] : getCollectionFieldOptions.call({ compile: p, getCollectionFields: v, filter: i }, b, j)).reduce((N, k) => Object.assign(N, { [k.value]: k }), {});
43261
- j && (O[j.value] = j), g(O);
43275
+ }) : null, L = (c === null ? [] : getCollectionFieldOptions.call({ compile: p, getCollectionFields: v, filter: i }, b, j)).reduce((N, k) => Object.assign(N, { [k.value]: k }), {});
43276
+ j && (L[j.value] = j), g(L);
43262
43277
  }, [f, l, i, c]), useEffect(() => {
43263
43278
  const j = e.multiple ? n : n ? [n] : [];
43264
- if (!(j != null && j.length) || j.every((O) => !!h[O]))
43279
+ if (!(j != null && j.length) || j.every((L) => !!h[L]))
43265
43280
  return;
43266
43281
  const w = [];
43267
- j.forEach((O) => {
43268
- const N = O.split(".");
43282
+ j.forEach((L) => {
43283
+ const N = L.split(".");
43269
43284
  let k = h[N[0]];
43270
43285
  for (let M = 1; M < N.length && k; M++) {
43271
43286
  const q = N.slice(0, M + 1).join(".");
@@ -43278,7 +43293,7 @@ const FieldsTreeSelect = (e) => {
43278
43293
  E != null && E.length && (w.push(...E), k = E.find((V) => V.value === N.slice(0, M + 1).join(".")));
43279
43294
  }
43280
43295
  }
43281
- }), g((O) => w.reduce((N, k) => Object.assign(N, { [k.value]: k }), x({}, O)));
43296
+ }), g((L) => w.reduce((N, k) => Object.assign(N, { [k.value]: k }), x({}, L)));
43282
43297
  }, [n, I.length, e.multiple]);
43283
43298
  const T = useCallback(
43284
43299
  (j) => {
@@ -43286,30 +43301,30 @@ const FieldsTreeSelect = (e) => {
43286
43301
  o(j);
43287
43302
  return;
43288
43303
  }
43289
- const w = j.map((k) => k.value).filter(Boolean), O = new Set(w), N = F.find((k) => !O.has(k.value));
43304
+ const w = j.map((k) => k.value).filter(Boolean), L = new Set(w), N = F.find((k) => !L.has(k.value));
43290
43305
  if (N) {
43291
43306
  const k = `${N.value}.`;
43292
43307
  Object.keys(h).forEach((M) => {
43293
- M.startsWith(k) && O.delete(M);
43308
+ M.startsWith(k) && L.delete(M);
43294
43309
  });
43295
43310
  } else
43296
43311
  u && w.forEach((k) => {
43297
43312
  const M = k.split(".");
43298
43313
  if (M.length)
43299
43314
  for (let q = 1; q <= M.length; q++)
43300
- O.add(M.slice(0, q).join("."));
43315
+ L.add(M.slice(0, q).join("."));
43301
43316
  });
43302
- o(Array.from(O));
43317
+ o(Array.from(L));
43303
43318
  },
43304
43319
  [e.multiple, F, o, h]
43305
43320
  ), D = useCallback(
43306
43321
  (j) => {
43307
43322
  var q;
43308
- const { value: w, onClose: O, disabled: N, closable: k } = j;
43323
+ const { value: w, onClose: L, disabled: N, closable: k } = j;
43309
43324
  if (!w)
43310
43325
  return null;
43311
43326
  const { fullTitle: M } = (q = h[w]) != null ? q : {};
43312
- return /* @__PURE__ */ jsx(Tag, { closable: k && !N, onClose: O, children: M == null ? void 0 : M.join(" / ") });
43327
+ return /* @__PURE__ */ jsx(Tag, { closable: k && !N, onClose: L, children: M == null ? void 0 : M.join(" / ") });
43313
43328
  },
43314
43329
  [h]
43315
43330
  ), B = Array.isArray(F) ? F.filter((j) => j.value in h) : F, $ = e.multiple ? n : n != null ? [n] : [];
@@ -43361,27 +43376,27 @@ const InternalAssociationSelect$1 = observer$1(
43361
43376
  var B;
43362
43377
  const D = e, { objectValue: t = !0, addMode: n } = D, o = W(D, ["objectValue", "addMode"]), r = useField(), a = useFieldSchema(), i = useServiceOptions$1((a == null ? void 0 : a["x-component-props"]) || e), { options: l } = useAssociationFieldContext(), c = isVariable$1(e.value) ? void 0 : e.value, u = Array.isArray(c) ? c.filter(Boolean) : c, [d, p] = useState(u), m = (B = a["x-component-props"]) == null ? void 0 : B.addMode, { t: h } = useTranslation(), { multiple: g } = e, f = useForm(), b = useAPIClient().resource(l.target), S = useCollectionRecordData(), y = useContext(SchemaComponentContext), { getCollection: v } = useCollectionManager_deprecated(), I = v(l.target), { filterTargetKey: F } = I;
43363
43378
  useEffect(() => {
43364
- const $ = isVariable$1(r.value) ? void 0 : r.value, L = Array.isArray($) ? $.filter(Boolean) : $, j = removeIfKeyEmpty(L, F);
43379
+ const $ = isVariable$1(r.value) ? void 0 : r.value, O = Array.isArray($) ? $.filter(Boolean) : $, j = removeIfKeyEmpty(O, F);
43365
43380
  p(j), isEqual(r.value, j) || (r.value = j);
43366
43381
  }, [r.value, F]), useEffect(() => {
43367
43382
  const $ = uid();
43368
43383
  return f.addEffects($, () => {
43369
- onFieldInputValueChange("*", (L) => {
43384
+ onFieldInputValueChange("*", (O) => {
43370
43385
  var N, k, M, q, E, V;
43371
- const j = filterAnalyses((M = (k = (N = r.componentProps) == null ? void 0 : N.service) == null ? void 0 : k.params) == null ? void 0 : M.filter) || [], w = getFieldPath(L.address.entire), O = getFieldPath(r.address.entire);
43372
- j.includes((q = L == null ? void 0 : L.props) == null ? void 0 : q.name) && r.value && isEqual(L == null ? void 0 : L.indexes, r == null ? void 0 : r.indexes) && ((E = L == null ? void 0 : L.props) == null ? void 0 : E.name) !== r.props.name && (!((V = r == null ? void 0 : r.indexes) != null && V.length) || isEqual(w, O)) && (r.setValue(null), p(null));
43386
+ const j = filterAnalyses((M = (k = (N = r.componentProps) == null ? void 0 : N.service) == null ? void 0 : k.params) == null ? void 0 : M.filter) || [], w = getFieldPath(O.address.entire), L = getFieldPath(r.address.entire);
43387
+ j.includes((q = O == null ? void 0 : O.props) == null ? void 0 : q.name) && r.value && isEqual(O == null ? void 0 : O.indexes, r == null ? void 0 : r.indexes) && ((E = O == null ? void 0 : O.props) == null ? void 0 : E.name) !== r.props.name && (!((V = r == null ? void 0 : r.indexes) != null && V.length) || isEqual(w, L)) && (r.setValue(null), p(null));
43373
43388
  });
43374
43389
  }), () => {
43375
43390
  f.removeEffects($);
43376
43391
  };
43377
43392
  }, []);
43378
43393
  const R = ($) => z(void 0, null, function* () {
43379
- var O, N;
43380
- const { search: L, callBack: j } = $, {
43394
+ var L, N;
43395
+ const { search: O, callBack: j } = $, {
43381
43396
  data: { data: w }
43382
43397
  } = yield b.create({
43383
43398
  values: {
43384
- [((N = (O = r == null ? void 0 : r.componentProps) == null ? void 0 : O.fieldNames) == null ? void 0 : N.label) || "id"]: L
43399
+ [((N = (L = r == null ? void 0 : r.componentProps) == null ? void 0 : L.fieldNames) == null ? void 0 : N.label) || "id"]: O
43385
43400
  }
43386
43401
  });
43387
43402
  if (w) {
@@ -43415,8 +43430,8 @@ const InternalAssociationSelect$1 = observer$1(
43415
43430
  service: i,
43416
43431
  onChange: ($) => {
43417
43432
  var j;
43418
- const L = Array.isArray($) && $.length === 0 ? null : $;
43419
- (j = e.onChange) == null || j.call(e, L);
43433
+ const O = Array.isArray($) && $.length === 0 ? null : $;
43434
+ (j = e.onChange) == null || j.call(e, O);
43420
43435
  },
43421
43436
  CustomDropdownRender: m === "quickAdd" && T
43422
43437
  })
@@ -44016,32 +44031,32 @@ function Uploader(n) {
44016
44031
  }, [f, p, h]);
44017
44032
  const S = useCallback(
44018
44033
  (B) => {
44019
- var L;
44034
+ var O;
44020
44035
  const $ = B.fileList.filter((j) => j.status !== "done").map(normalizeFile);
44021
44036
  if (m($), a) {
44022
44037
  const j = B.fileList.filter((w) => w.status === "done");
44023
44038
  if (j.length) {
44024
- const w = [...u, ...j.map((O) => {
44039
+ const w = [...u, ...j.map((L) => {
44025
44040
  var N;
44026
- return c((N = O.response) == null ? void 0 : N.data);
44041
+ return c((N = L.response) == null ? void 0 : N.data);
44027
44042
  })];
44028
44043
  $.length ? d(w) : (l == null || l([...i || [], ...w]), d([]));
44029
44044
  }
44030
44045
  } else {
44031
44046
  const j = B.fileList.find((w) => w.uid === B.file.uid);
44032
- j.status === "done" && (l == null || l(c((L = j.response) == null ? void 0 : L.data)), m([]));
44047
+ j.status === "done" && (l == null || l(c((O = j.response) == null ? void 0 : O.data)), m([]));
44033
44048
  }
44034
44049
  },
44035
44050
  [a, i, u, c, l]
44036
44051
  ), y = useCallback((B) => {
44037
44052
  m(($) => {
44038
- const L = $.indexOf(B);
44039
- return $.splice(L, 1), [...$];
44053
+ const O = $.indexOf(B);
44054
+ return $.splice(O, 1), [...$];
44040
44055
  });
44041
44056
  }, []), v = useCallback((B) => {
44042
44057
  d(($) => {
44043
- const L = $.indexOf(B);
44044
- return $.splice(L, 1), [...$];
44058
+ const O = $.indexOf(B);
44059
+ return $.splice(O, 1), [...$];
44045
44060
  });
44046
44061
  }, []), I = useComponent("QRCodeUploader"), { mimetype: F, size: R } = e != null ? e : {}, T = useSizeHint(R), D = !r && (a || (!i || Array.isArray(i) && !i.length) && !p.length);
44047
44062
  return /* @__PURE__ */ jsxs(Fragment$1, { children: [
@@ -44362,9 +44377,9 @@ const InternalFileManager = (e) => {
44362
44377
  };
44363
44378
  useEffect(() => {
44364
44379
  if (t && Object.keys(t).length > 0) {
44365
- const $ = (Array.isArray(t) ? t : t ? [t] : []).filter(Boolean).map((L) => {
44366
- const j = L[p.label];
44367
- return P(x({}, L), {
44380
+ const $ = (Array.isArray(t) ? t : t ? [t] : []).filter(Boolean).map((O) => {
44381
+ const j = O[p.label];
44382
+ return P(x({}, O), {
44368
44383
  [p.label]: getLabelFormatValue$1(y(S), y(j))
44369
44384
  });
44370
44385
  });
@@ -44385,10 +44400,10 @@ const InternalFileManager = (e) => {
44385
44400
  setSelectedRows: u,
44386
44401
  collectionField: b
44387
44402
  }, R = () => {
44388
- const { setVisible: $ } = useActionContext(), { multiple: L, selectedRows: j, onChange: w, options: O, collectionField: N } = useContext(RecordPickerContext);
44403
+ const { setVisible: $ } = useActionContext(), { multiple: O, selectedRows: j, onChange: w, options: L, collectionField: N } = useContext(RecordPickerContext);
44389
44404
  return {
44390
44405
  onClick() {
44391
- w(L ? unionBy(j, O, (N == null ? void 0 : N.targetKey) || "id") : (j == null ? void 0 : j[0]) || null), $(!1);
44406
+ w(O ? unionBy(j, L, (N == null ? void 0 : N.targetKey) || "id") : (j == null ? void 0 : j[0]) || null), $(!1);
44392
44407
  }
44393
44408
  };
44394
44409
  };
@@ -44440,22 +44455,22 @@ const InternalFileManager = (e) => {
44440
44455
  FormItem: FormItem$1
44441
44456
  }
44442
44457
  }), CascadeSelect = connect((e) => {
44443
- var L;
44458
+ var O;
44444
44459
  const { data: t, mapOptions: n, onChange: o, value: r } = e, [a, i] = useState([
44445
44460
  { key: void 0, children: [], value: null }
44446
- ]), [l, c] = useState(t), [u, d] = useState(!1), p = useCompile(), m = useAPIClient(), h = useServiceOptions$1(e), { options: g, field: f } = useAssociationFieldContext(), C = m.resource(g.target), { getCollectionJoinField: b, getInterface: S } = useCollectionManager_deprecated(), y = (L = f == null ? void 0 : f.componentProps) == null ? void 0 : L.fieldNames, v = (g == null ? void 0 : g.target) && (y == null ? void 0 : y.label) && b(`${g.target}.${y.label}`), I = useMemo(() => {
44461
+ ]), [l, c] = useState(t), [u, d] = useState(!1), p = useCompile(), m = useAPIClient(), h = useServiceOptions$1(e), { options: g, field: f } = useAssociationFieldContext(), C = m.resource(g.target), { getCollectionJoinField: b, getInterface: S } = useCollectionManager_deprecated(), y = (O = f == null ? void 0 : f.componentProps) == null ? void 0 : O.fieldNames, v = (g == null ? void 0 : g.target) && (y == null ? void 0 : y.label) && b(`${g.target}.${y.label}`), I = useMemo(() => {
44447
44462
  var j, w;
44448
44463
  return v != null && v.interface && ((w = (j = S(v.interface)) == null ? void 0 : j.filterable) == null ? void 0 : w.operators[0].value) || "$includes";
44449
44464
  }, [v]), F = useField();
44450
44465
  useEffect(() => {
44451
44466
  var j;
44452
44467
  if (r) {
44453
- const w = Array.isArray(r) ? extractLastNonNullValueObjects(r == null ? void 0 : r.filter((N) => N.value), !0) : transformNestedData(r), O = (j = w == null ? void 0 : w.map) == null ? void 0 : j.call(w, (N) => ({
44468
+ const w = Array.isArray(r) ? extractLastNonNullValueObjects(r == null ? void 0 : r.filter((N) => N.value), !0) : transformNestedData(r), L = (j = w == null ? void 0 : w.map) == null ? void 0 : j.call(w, (N) => ({
44454
44469
  key: N.parentId,
44455
44470
  children: [],
44456
44471
  value: N
44457
44472
  }));
44458
- i(O);
44473
+ i(L);
44459
44474
  }
44460
44475
  }, []);
44461
44476
  const R = useCallback(
@@ -44463,23 +44478,23 @@ const InternalFileManager = (e) => {
44463
44478
  try {
44464
44479
  return j == null ? void 0 : j.filter((w) => ["number", "string"].includes(typeof w[y.value])).map((w) => {
44465
44480
  var N, k, M;
44466
- let O = p(w[y.label]);
44481
+ let L = p(w[y.label]);
44467
44482
  if ((N = v == null ? void 0 : v.uiSchema) != null && N.enum)
44468
- if (Array.isArray(O))
44469
- O = O.map((q, E) => {
44483
+ if (Array.isArray(L))
44484
+ L = L.map((q, E) => {
44470
44485
  var H, U;
44471
44486
  const V = (U = (H = v.uiSchema.enum).find) == null ? void 0 : U.call(H, (G) => G.value === q);
44472
44487
  return V ? /* @__PURE__ */ jsx(Tag, { color: V.color, style: { marginRight: 3 }, children: (V == null ? void 0 : V.label) || q }, E) : /* @__PURE__ */ jsx(Tag, { children: q }, q);
44473
44488
  }).reverse();
44474
44489
  else {
44475
- const q = (M = (k = v.uiSchema.enum).find) == null ? void 0 : M.call(k, (E) => E.value === O);
44476
- q && (O = /* @__PURE__ */ jsx(Tag, { color: q.color, children: q.label }));
44490
+ const q = (M = (k = v.uiSchema.enum).find) == null ? void 0 : M.call(k, (E) => E.value === L);
44491
+ q && (L = /* @__PURE__ */ jsx(Tag, { color: q.color, children: q.label }));
44477
44492
  }
44478
- return (v == null ? void 0 : v.type) === "date" && (O = dayjs(O).format("YYYY-MM-DD")), n ? n({
44479
- [y.label]: O || EMPTY,
44493
+ return (v == null ? void 0 : v.type) === "date" && (L = dayjs(L).format("YYYY-MM-DD")), n ? n({
44494
+ [y.label]: L || EMPTY,
44480
44495
  [y.value]: w[y.value]
44481
44496
  }) : P(x({}, w), {
44482
- [y.label]: O || EMPTY,
44497
+ [y.label]: L || EMPTY,
44483
44498
  [y.value]: w[y.value]
44484
44499
  });
44485
44500
  }).filter(Boolean);
@@ -44489,46 +44504,46 @@ const InternalFileManager = (e) => {
44489
44504
  },
44490
44505
  [v == null ? void 0 : v.uiSchema, y]
44491
44506
  ), T = (j) => z(void 0, null, function* () {
44492
- var O, N;
44507
+ var L, N;
44493
44508
  const w = yield C.list({
44494
44509
  pageSize: 200,
44495
44510
  params: h == null ? void 0 : h.params,
44496
- filter: mergeFilter([j, (O = h == null ? void 0 : h.params) == null ? void 0 : O.filter]),
44511
+ filter: mergeFilter([j, (L = h == null ? void 0 : h.params) == null ? void 0 : L.filter]),
44497
44512
  tree: j.parentId ? void 0 : !0
44498
44513
  });
44499
44514
  return (N = w == null ? void 0 : w.data) == null ? void 0 : N.data;
44500
- }), D = (j, w, O) => z(void 0, null, function* () {
44515
+ }), D = (j, w, L) => z(void 0, null, function* () {
44501
44516
  const N = yield T({ parentId: w == null ? void 0 : w.id }), k = [...a];
44502
- if (k.splice(O + 1), k[O] = P(x({}, k[O]), { value: w }), w != null && w.id && (k[O + 1] = { key: w == null ? void 0 : w.id, children: (N == null ? void 0 : N.length) > 0 ? N : null }), i(k), ["o2m", "m2m"].includes(g.interface)) {
44517
+ if (k.splice(L + 1), k[L] = P(x({}, k[L]), { value: w }), w != null && w.id && (k[L + 1] = { key: w == null ? void 0 : w.id, children: (N == null ? void 0 : N.length) > 0 ? N : null }), i(k), ["o2m", "m2m"].includes(g.interface)) {
44503
44518
  const M = Array.isArray(f.fieldValue) ? f.fieldValue : [];
44504
44519
  M[F.index] = w, f.fieldValue = M;
44505
44520
  } else
44506
44521
  f.value = w;
44507
44522
  k.length === 1 && !k[0].value ? o == null || o(null) : o == null || o(k);
44508
- }), B = (j, w, O) => z(void 0, null, function* () {
44523
+ }), B = (j, w, L) => z(void 0, null, function* () {
44509
44524
  var N, k, M;
44510
44525
  if (j) {
44511
44526
  d(!0);
44512
44527
  const q = yield T({ parentId: w == null ? void 0 : w.key });
44513
- if (d(!1), c(q), O === (a == null ? void 0 : a.length) - 1 && ((N = w == null ? void 0 : w.value) != null && N.id)) {
44528
+ if (d(!1), c(q), L === (a == null ? void 0 : a.length) - 1 && ((N = w == null ? void 0 : w.value) != null && N.id)) {
44514
44529
  const E = yield T({ parentId: (k = w == null ? void 0 : w.value) == null ? void 0 : k.id }), V = [...a];
44515
- V.splice(O + 1), V[O] = P(x({}, V[O]), { value: w == null ? void 0 : w.value }), V[O + 1] = { key: (M = w == null ? void 0 : w.value) == null ? void 0 : M.id, children: (E == null ? void 0 : E.length) > 0 ? E : null }, i(V), o == null || o(V);
44530
+ V.splice(L + 1), V[L] = P(x({}, V[L]), { value: w == null ? void 0 : w.value }), V[L + 1] = { key: (M = w == null ? void 0 : w.value) == null ? void 0 : M.id, children: (E == null ? void 0 : E.length) > 0 ? E : null }, i(V), o == null || o(V);
44516
44531
  }
44517
44532
  }
44518
44533
  }), $ = (j, w) => z(void 0, null, function* () {
44519
- const O = j ? {
44534
+ const L = j ? {
44520
44535
  [y.label]: {
44521
44536
  [I]: j
44522
44537
  }
44523
44538
  } : {};
44524
44539
  d(!0);
44525
- const N = yield T(P(x({}, O), {
44540
+ const N = yield T(P(x({}, L), {
44526
44541
  parentId: w == null ? void 0 : w.key
44527
44542
  }));
44528
44543
  d(!1), c(N);
44529
44544
  });
44530
44545
  return /* @__PURE__ */ jsx(Space$1, { wrap: !0, children: a.map((j, w) => {
44531
- var O, N, k;
44546
+ var L, N, k;
44532
44547
  return j.children && /* @__PURE__ */ jsx(
44533
44548
  Select$1,
44534
44549
  {
@@ -44539,7 +44554,7 @@ const InternalFileManager = (e) => {
44539
44554
  filterOption: !1,
44540
44555
  filterSort: null,
44541
44556
  defaultValue: {
44542
- label: (O = j == null ? void 0 : j.value) == null ? void 0 : O[y.label],
44557
+ label: (L = j == null ? void 0 : j.value) == null ? void 0 : L[y.label],
44543
44558
  value: (N = j == null ? void 0 : j.value) == null ? void 0 : N[y.value]
44544
44559
  },
44545
44560
  labelInValue: !0,
@@ -44789,7 +44804,7 @@ const InternalNesterCardCss = css`
44789
44804
  }, InternalPicker = observer$1(
44790
44805
  (e) => {
44791
44806
  var N;
44792
- const O = e, { value: t, multiple: n, openSize: o, onChange: r, quickUpload: a, selectFile: i, shouldMountElement: l } = O, c = W(O, ["value", "multiple", "openSize", "onChange", "quickUpload", "selectFile", "shouldMountElement"]), u = useField(), d = useFieldNames$1(e), [p, m] = useState(!1), h = useFieldSchema(), g = useInsertSchema$1("Selector"), { options: f } = useAssociationFieldContext(), { collectionName: C } = useFormBlockContext(), b = useCompile(), S = useLabelUiSchema$1(f, (d == null ? void 0 : d.label) || "label"), y = h["x-add-new"], [v, I] = useState([]), F = useCollectionRecordData(), R = useMemo(() => t && Object.keys(t).length > 0 ? (Array.isArray(t) ? t : t ? [t] : []).filter(Boolean).map((M) => {
44807
+ const L = e, { value: t, multiple: n, openSize: o, onChange: r, quickUpload: a, selectFile: i, shouldMountElement: l } = L, c = W(L, ["value", "multiple", "openSize", "onChange", "quickUpload", "selectFile", "shouldMountElement"]), u = useField(), d = useFieldNames$1(e), [p, m] = useState(!1), h = useFieldSchema(), g = useInsertSchema$1("Selector"), { options: f } = useAssociationFieldContext(), { collectionName: C } = useFormBlockContext(), b = useCompile(), S = useLabelUiSchema$1(f, (d == null ? void 0 : d.label) || "label"), y = h["x-add-new"], [v, I] = useState([]), F = useCollectionRecordData(), R = useMemo(() => t && Object.keys(t).length > 0 ? (Array.isArray(t) ? t : t ? [t] : []).filter(Boolean).map((M) => {
44793
44808
  const q = M == null ? void 0 : M[d.label];
44794
44809
  return P(x({}, M), {
44795
44810
  [d.label]: getLabelFormatValue$1(b(S), b(q))
@@ -44817,7 +44832,7 @@ const InternalNesterCardCss = css`
44817
44832
  useEffect(() => {
44818
44833
  t || I([]);
44819
44834
  }, [t]);
44820
- const L = () => {
44835
+ const O = () => {
44821
44836
  const { setVisible: k } = useActionContext(), { multiple: M, selectedRows: q, onChange: E, options: V, collectionField: H } = useContext(RecordPickerContext);
44822
44837
  return {
44823
44838
  onClick() {
@@ -44829,7 +44844,7 @@ const InternalNesterCardCss = css`
44829
44844
  };
44830
44845
  }, j = useMemo(
44831
44846
  () => ({
44832
- usePickActionProps: L,
44847
+ usePickActionProps: O,
44833
44848
  useTableSelectorProps: useTableSelectorProps$2
44834
44849
  }),
44835
44850
  []
@@ -44935,10 +44950,10 @@ const RenderRecord = React.memo(
44935
44950
  const R = useCallback(() => F.current, []);
44936
44951
  return useEffect(() => {
44937
44952
  const T = toArr$3(h).map((D, B, $) => {
44938
- const L = D == null ? void 0 : D[(e == null ? void 0 : e.label) || "label"], j = t ? transformNestedData(D).map((k) => k == null ? void 0 : k[(e == null ? void 0 : e.label) || "label"]).join(" / ") : isObject(L) ? JSON.stringify(L) : L, w = toValue$4(n(j), "N/A"), O = o(
44953
+ const O = D == null ? void 0 : D[(e == null ? void 0 : e.label) || "label"], j = t ? transformNestedData(D).map((k) => k == null ? void 0 : k[(e == null ? void 0 : e.label) || "label"]).join(" / ") : isObject(O) ? JSON.stringify(O) : O, w = toValue$4(n(j), "N/A"), L = o(
44939
44954
  (D == null ? void 0 : D.__collection) || (r == null ? void 0 : r.target),
44940
44955
  (e == null ? void 0 : e.label) || "label"
44941
- ), N = getLabelFormatValue$1(n(O), w, !0);
44956
+ ), N = getLabelFormatValue$1(n(L), w, !0);
44942
44957
  return /* @__PURE__ */ jsxs(Fragment, { children: [
44943
44958
  /* @__PURE__ */ jsx("span", { children: a ? N : i !== !1 ? /* @__PURE__ */ jsx(
44944
44959
  "a",
@@ -45019,8 +45034,8 @@ const getSourceData = (e, t) => {
45019
45034
  return n ? _.get(e, n) : e;
45020
45035
  }, ReadPrettyInternalViewer = (e) => {
45021
45036
  var B, $;
45022
- const { value: t, ButtonList: n = ButtonLinkList } = e, o = useFieldSchema(), { enableLink: r, openMode: a, openSize: i } = o["x-component-props"] || {}, l = useField(), [c, u] = useState(!1), { options: d } = useAssociationFieldContext(), p = useAssociationName(), { visibleWithURL: m, setVisibleWithURL: h } = usePopupUtils(), [g, f] = useState(!!m), { defaultOpenMode: C } = useOpenModeContext(), b = useCollectionRecordData(), [S, y] = useState(null), { isPopupVisibleControlledByURL: v } = usePopupSettings(), I = useCollection(), F = useCallback((L) => {
45023
- y(L.recordData);
45037
+ const { value: t, ButtonList: n = ButtonLinkList } = e, o = useFieldSchema(), { enableLink: r, openMode: a, openSize: i } = o["x-component-props"] || {}, l = useField(), [c, u] = useState(!1), { options: d } = useAssociationFieldContext(), p = useAssociationName(), { visibleWithURL: m, setVisibleWithURL: h } = usePopupUtils(), [g, f] = useState(!!m), { defaultOpenMode: C } = useOpenModeContext(), b = useCollectionRecordData(), [S, y] = useState(null), { isPopupVisibleControlledByURL: v } = usePopupSettings(), I = useCollection(), F = useCallback((O) => {
45038
+ y(O.recordData);
45024
45039
  }, []), R = /* @__PURE__ */ jsx(EllipsisWithTooltip, { ellipsis: (B = e.ellipsis) != null ? B : !0, children: /* @__PURE__ */ jsx(CollectionRecordProvider, { isNew: !1, record: getSourceData(b, o), children: /* @__PURE__ */ jsx(
45025
45040
  n,
45026
45041
  {
@@ -45033,8 +45048,8 @@ const getSourceData = (e, t) => {
45033
45048
  ) }) }), T = useMemo(
45034
45049
  () => ({
45035
45050
  visible: c || m,
45036
- setVisible: (L) => {
45037
- u == null || u(L), h == null || h(L);
45051
+ setVisible: (O) => {
45052
+ u == null || u(O), h == null || h(O);
45038
45053
  },
45039
45054
  openMode: a || C,
45040
45055
  snapshot: (d == null ? void 0 : d.interface) === "snapshot",
@@ -45053,7 +45068,7 @@ const getSourceData = (e, t) => {
45053
45068
  schema: o,
45054
45069
  onlyRenderProperties: !0,
45055
45070
  basePath: l.address,
45056
- filterProperties: (L) => L["x-component"] === "AssociationField.Viewer"
45071
+ filterProperties: (O) => O["x-component"] === "AssociationField.Viewer"
45057
45072
  }
45058
45073
  ) }) })
45059
45074
  ) : /* @__PURE__ */ jsx(
@@ -45072,7 +45087,7 @@ const getSourceData = (e, t) => {
45072
45087
  schema: o,
45073
45088
  onlyRenderProperties: !0,
45074
45089
  basePath: l.address,
45075
- filterProperties: (L) => L["x-component"] === "AssociationField.Viewer"
45090
+ filterProperties: (O) => O["x-component"] === "AssociationField.Viewer"
45076
45091
  }
45077
45092
  ) }) }) })
45078
45093
  }
@@ -45519,8 +45534,8 @@ function FinallyButton(h) {
45519
45534
  } = g;
45520
45535
  var v, I, F, R, T, D;
45521
45536
  const { getCollection: b } = useCollectionManager_deprecated(), S = useACLActionParamsContext(), y = useMemo(() => {
45522
- var L;
45523
- const B = m && (((L = d == null ? void 0 : d.data) == null ? void 0 : L.hidden) || !S);
45537
+ var O;
45538
+ const B = m && (((O = d == null ? void 0 : d.data) == null ? void 0 : O.hidden) || !S);
45524
45539
  return {
45525
45540
  opacity: a !== "link" && B ? 0.1 : 1
45526
45541
  };
@@ -45534,7 +45549,7 @@ function FinallyButton(h) {
45534
45549
  danger: r.danger,
45535
45550
  icon: u,
45536
45551
  onClick: (B) => {
45537
- const $ = getLinkageCollection(t, p, d), L = e.find((w) => w.name === $) ? $ : c.name, j = b(L);
45552
+ const $ = getLinkageCollection(t, p, d), O = e.find((w) => w.name === $) ? $ : c.name, j = b(O);
45538
45553
  l == null || l(j);
45539
45554
  },
45540
45555
  style: x({
@@ -45697,22 +45712,22 @@ const CreateRecordAction$1 = forwardRef(InternalCreateRecordAction), initializer
45697
45712
  }
45698
45713
  });
45699
45714
  Array.isArray(o.value) || (o.value = []);
45700
- const D = useCallback(({ form: w, fieldSchema: O, collectionField: N, getInterface: k }) => {
45715
+ const D = useCallback(({ form: w, fieldSchema: L, collectionField: N, getInterface: k }) => {
45701
45716
  var M;
45702
- return !N || N.target && ((M = O["x-component-props"]) != null && M.mode) && !["Picker", "Select"].includes(O["x-component-props"].mode) ? !1 : !(w != null && w.readPretty) && !isPatternDisabled(O) && !interfacesOfUnsupportedDefaultValue.includes(N == null ? void 0 : N.interface) && !isSystemField(N, k);
45717
+ return !N || N.target && ((M = L["x-component-props"]) != null && M.mode) && !["Picker", "Select"].includes(L["x-component-props"].mode) ? !1 : !(w != null && w.readPretty) && !isPatternDisabled(L) && !interfacesOfUnsupportedDefaultValue.includes(N == null ? void 0 : N.interface) && !isSystemField(N, k);
45703
45718
  }, []), B = () => {
45704
- const { setVisible: w } = useActionContext(), { selectedRows: O, setSelectedRows: N } = useContext(RecordPickerContext);
45719
+ const { setVisible: w } = useActionContext(), { selectedRows: L, setSelectedRows: N } = useContext(RecordPickerContext);
45705
45720
  return {
45706
45721
  onClick() {
45707
- O.map((k) => o.value.push(markRecordAsNew(k))), o.onInput(o.value), o.initialValue = o.value, N([]), w(!1);
45722
+ L.map((k) => o.value.push(markRecordAsNew(k))), o.onInput(o.value), o.initialValue = o.value, N([]), w(!1);
45708
45723
  }
45709
45724
  };
45710
- }, $ = useMemo(() => o.value && Object.keys(o.value).length > 0 ? (Array.isArray(o.value) ? o.value : o.value ? [o.value] : []).filter(Boolean).map((O) => {
45711
- const N = O == null ? void 0 : O[I.label];
45712
- return P(x({}, O), {
45725
+ }, $ = useMemo(() => o.value && Object.keys(o.value).length > 0 ? (Array.isArray(o.value) ? o.value : o.value ? [o.value] : []).filter(Boolean).map((L) => {
45726
+ const N = L == null ? void 0 : L[I.label];
45727
+ return P(x({}, L), {
45713
45728
  [I.label]: getLabelFormatValue$1(F(R), F(N))
45714
45729
  });
45715
- }) : [], [o.value, I == null ? void 0 : I.label]), L = {
45730
+ }) : [], [o.value, I == null ? void 0 : I.label]), O = {
45716
45731
  size: "small",
45717
45732
  fieldNames: o.componentProps.fieldNames,
45718
45733
  multiple: !0,
@@ -45725,8 +45740,8 @@ const CreateRecordAction$1 = forwardRef(InternalCreateRecordAction), initializer
45725
45740
  setSelectedRows: v,
45726
45741
  collectionField: n
45727
45742
  }, j = () => {
45728
- const w = (n == null ? void 0 : n.targetKey) || "id", O = (o.value || []).map((k) => k == null ? void 0 : k[w]).filter(Boolean);
45729
- return O.length ? { $and: [{ [`${w}.$ne`]: O }] } : {};
45743
+ const w = (n == null ? void 0 : n.targetKey) || "id", L = (o.value || []).map((k) => k == null ? void 0 : k[w]).filter(Boolean);
45744
+ return L.length ? { $and: [{ [`${w}.$ne`]: L }] } : {};
45730
45745
  };
45731
45746
  return o.value.length > 0 ? /* @__PURE__ */ jsxs(
45732
45747
  Card,
@@ -45740,31 +45755,31 @@ const CreateRecordAction$1 = forwardRef(InternalCreateRecordAction), initializer
45740
45755
  `,
45741
45756
  children: [
45742
45757
  /* @__PURE__ */ jsxs(RefreshComponentProvider, { refresh: C, children: [
45743
- o.value.map((w, O) => {
45758
+ o.value.map((w, L) => {
45744
45759
  let N = a;
45745
45760
  return a || (N = !(w != null && w[n.targetKey])), /* @__PURE__ */ jsxs(React.Fragment, { children: [
45746
- /* @__PURE__ */ jsx("div", { style: { textAlign: "right" }, children: !o.readPretty && N && (!t["x-template-uid"] || O > 0) && /* @__PURE__ */ jsx(Tooltip, { title: c("Remove"), children: /* @__PURE__ */ jsx(
45761
+ /* @__PURE__ */ jsx("div", { style: { textAlign: "right" }, children: !o.readPretty && N && (!t["x-template-uid"] || L > 0) && /* @__PURE__ */ jsx(Tooltip, { title: c("Remove"), children: /* @__PURE__ */ jsx(
45747
45762
  CloseOutlined,
45748
45763
  {
45749
45764
  style: { zIndex: 1e3, color: "#a8a3a3" },
45750
45765
  onClick: () => {
45751
45766
  action(() => (spliceArrayState(o, {
45752
- startIndex: O,
45767
+ startIndex: L,
45753
45768
  deleteCount: 1
45754
- }), o.value.splice(O, 1), Array.isArray(o.initialValue) && o.initialValue.splice(O, 1), o.onInput(o.value)));
45769
+ }), o.value.splice(L, 1), Array.isArray(o.initialValue) && o.initialValue.splice(L, 1), o.onInput(o.value)));
45755
45770
  }
45756
45771
  }
45757
45772
  ) }, "remove") }),
45758
- /* @__PURE__ */ jsx(FormActiveFieldsProvider, { name: "nester", children: /* @__PURE__ */ jsx(SubFormProvider, { value: { value: w, collection: d, fieldSchema: t.parent }, children: /* @__PURE__ */ jsx(RecordProvider, { isNew: isNewRecord(w), record: w, parent: u, children: /* @__PURE__ */ jsx(RecordIndexProvider, { index: O, children: /* @__PURE__ */ jsx(DefaultValueProvider, { isAllowToSetDefaultValue: D, children: /* @__PURE__ */ jsx(
45773
+ /* @__PURE__ */ jsx(FormActiveFieldsProvider, { name: "nester", children: /* @__PURE__ */ jsx(SubFormProvider, { value: { value: w, collection: d, fieldSchema: t.parent }, children: /* @__PURE__ */ jsx(RecordProvider, { isNew: isNewRecord(w), record: w, parent: u, children: /* @__PURE__ */ jsx(RecordIndexProvider, { index: L, children: /* @__PURE__ */ jsx(DefaultValueProvider, { isAllowToSetDefaultValue: D, children: /* @__PURE__ */ jsx(
45759
45774
  NocoBaseRecursionField,
45760
45775
  {
45761
45776
  onlyRenderProperties: !0,
45762
- basePath: o.address.concat(O),
45777
+ basePath: o.address.concat(L),
45763
45778
  schema: h
45764
45779
  }
45765
45780
  ) }) }) }) }) }),
45766
45781
  /* @__PURE__ */ jsx(Divider$1, {})
45767
- ] }, O);
45782
+ ] }, L);
45768
45783
  }),
45769
45784
  /* @__PURE__ */ jsxs(Space$1, { children: [
45770
45785
  o.editable && r && /* @__PURE__ */ jsx(
@@ -45775,8 +45790,8 @@ const CreateRecordAction$1 = forwardRef(InternalCreateRecordAction), initializer
45775
45790
  action(() => {
45776
45791
  Array.isArray(o.value) || (o.value = []);
45777
45792
  const w = o.value.length;
45778
- return o.value.splice(w, 0, markRecordAsNew({})), each(o.form.fields, (O, N) => {
45779
- O || delete o.form.fields[N];
45793
+ return o.value.splice(w, 0, markRecordAsNew({})), each(o.form.fields, (L, N) => {
45794
+ L || delete o.form.fields[N];
45780
45795
  }), o.onInput(o.value);
45781
45796
  });
45782
45797
  }
@@ -45810,7 +45825,7 @@ const CreateRecordAction$1 = forwardRef(InternalCreateRecordAction), initializer
45810
45825
  visible: b,
45811
45826
  setVisible: S
45812
45827
  },
45813
- children: /* @__PURE__ */ jsx(RecordPickerProvider, P(x({}, L), { children: /* @__PURE__ */ jsx(CollectionProvider, { name: n == null ? void 0 : n.target, children: /* @__PURE__ */ jsx(FormProvider, { children: /* @__PURE__ */ jsx(TableSelectorParamsProvider, { params: { filter: j() }, children: /* @__PURE__ */ jsx(
45828
+ children: /* @__PURE__ */ jsx(RecordPickerProvider, P(x({}, O), { children: /* @__PURE__ */ jsx(CollectionProvider, { name: n == null ? void 0 : n.target, children: /* @__PURE__ */ jsx(FormProvider, { children: /* @__PURE__ */ jsx(TableSelectorParamsProvider, { params: { filter: j() }, children: /* @__PURE__ */ jsx(
45814
45829
  SchemaComponentOptions,
45815
45830
  {
45816
45831
  scope: {
@@ -45857,7 +45872,7 @@ const CreateRecordAction$1 = forwardRef(InternalCreateRecordAction), initializer
45857
45872
  S.current = t;
45858
45873
  const y = useCallback(() => S.current, []);
45859
45874
  return /* @__PURE__ */ jsx(Fragment$1, { children: toArr$3(e.value).map((I, F, R) => {
45860
- const T = I == null ? void 0 : I[(r == null ? void 0 : r.label) || "label"], D = g ? transformNestedData(I).map((L) => L == null ? void 0 : L[(r == null ? void 0 : r.label) || "label"]).join(" / ") : isObject(T) ? JSON.stringify(T) : T, B = toValue$3(l(D), "N/A"), $ = getTabFormatValue(l(u), B, I[o]);
45875
+ const T = I == null ? void 0 : I[(r == null ? void 0 : r.label) || "label"], D = g ? transformNestedData(I).map((O) => O == null ? void 0 : O[(r == null ? void 0 : r.label) || "label"]).join(" / ") : isObject(T) ? JSON.stringify(T) : T, B = toValue$3(l(D), "N/A"), $ = getTabFormatValue(l(u), B, I[o]);
45861
45876
  return /* @__PURE__ */ jsxs(Fragment, { children: [
45862
45877
  /* @__PURE__ */ jsx("span", { children: d ? $ : n !== !1 ? /* @__PURE__ */ jsx(
45863
45878
  "a",
@@ -45865,9 +45880,9 @@ const CreateRecordAction$1 = forwardRef(InternalCreateRecordAction), initializer
45865
45880
  onMouseEnter: () => {
45866
45881
  e.setBtnHover(!0);
45867
45882
  },
45868
- onClick: (L) => {
45883
+ onClick: (O) => {
45869
45884
  var j;
45870
- e.setBtnHover(!0), L.stopPropagation(), L.preventDefault(), c && !t.properties && (a(schema$1.Viewer), b.current = !0), b.current ? setTimeout(() => {
45885
+ e.setBtnHover(!0), O.stopPropagation(), O.preventDefault(), c && !t.properties && (a(schema$1.Viewer), b.current = !0), b.current ? setTimeout(() => {
45871
45886
  f({
45872
45887
  recordData: I,
45873
45888
  parentRecordData: C,
@@ -45958,8 +45973,8 @@ const useColumnsDeepMemoized = (e) => {
45958
45973
  width: I && !i ? 0 : ((D = S["x-component-props"]) == null ? void 0 : D.width) || 100,
45959
45974
  render: (B, $) => {
45960
45975
  var w;
45961
- const L = (w = o.value) == null ? void 0 : w.indexOf($), j = o.address.concat($.__index || L);
45962
- return /* @__PURE__ */ jsx(SubFormProvider, { value: { value: $, collection: f, fieldSchema: r.parent }, children: /* @__PURE__ */ jsx(RecordIndexProvider, { index: $.__index || L, children: /* @__PURE__ */ jsx(RecordProvider, { isNew: isNewRecord($), record: $, parent: u, children: /* @__PURE__ */ jsx(ColumnFieldProvider, { schema: S, basePath: j, children: /* @__PURE__ */ jsx("span", { role: "button", className: g, children: /* @__PURE__ */ jsx(RecursionField, { basePath: j, schema: S, onlyRenderProperties: !0 }) }, L) }) }) }) });
45976
+ const O = (w = o.value) == null ? void 0 : w.indexOf($), j = o.address.concat($.__index || O);
45977
+ return /* @__PURE__ */ jsx(SubFormProvider, { value: { value: $, collection: f, fieldSchema: r.parent }, children: /* @__PURE__ */ jsx(RecordIndexProvider, { index: $.__index || O, children: /* @__PURE__ */ jsx(RecordProvider, { isNew: isNewRecord($), record: $, parent: u, children: /* @__PURE__ */ jsx(ColumnFieldProvider, { schema: S, basePath: j, children: /* @__PURE__ */ jsx("span", { role: "button", className: g, children: /* @__PURE__ */ jsx(RecursionField, { basePath: j, schema: S, onlyRenderProperties: !0 }) }, O) }) }) }) });
45963
45978
  },
45964
45979
  onCell: (B, $) => ({
45965
45980
  record: B,
@@ -46298,7 +46313,7 @@ const Table$1 = withDynamicSchemaProps(
46298
46313
  "onClickRow",
46299
46314
  "enableIndexColumn"
46300
46315
  ]), y = useArrayField(S), v = useFieldSchema(), { size: I = "small" } = (v == null ? void 0 : v["x-component-props"]) || {}, F = useCollection(), T = ((de = v == null ? void 0 : v.parent) == null ? void 0 : de["x-decorator"]) === "TableSelectorProvider" ? useTableSelectorContext() : useTableBlockContext(), { expandFlag: D, allIncludesChildren: B } = T, $ = useMemoizedFn(S.onRowDragEnd || (() => {
46301
- })), L = usePaginationProps$2(n, a), j = useTableColumns$1(S, L), [w, O] = useState(() => D ? B : []), [N, k] = useState(((be = y == null ? void 0 : y.data) == null ? void 0 : be.selectedRowKeys) || []), [M, q] = useState([]), E = (p == null ? void 0 : p.type) !== "none", V = useRef(/* @__PURE__ */ new Map()), H = useMemo(() => css`
46316
+ })), O = usePaginationProps$2(n, a), j = useTableColumns$1(S, O), [w, L] = useState(() => D ? B : []), [N, k] = useState(((be = y == null ? void 0 : y.data) == null ? void 0 : be.selectedRowKeys) || []), [M, q] = useState([]), E = (p == null ? void 0 : p.type) !== "none", V = useRef(/* @__PURE__ */ new Map()), H = useMemo(() => css`
46302
46317
  & > td {
46303
46318
  background-color: ${t.controlItemBgActive} !important;
46304
46319
  }
@@ -46313,7 +46328,7 @@ const Table$1 = withDynamicSchemaProps(
46313
46328
  }) : null, [C, M]);
46314
46329
  useDeepCompareEffect(() => {
46315
46330
  const Z = D ? B : [];
46316
- _.isEqual(Z, w) || O(Z);
46331
+ _.isEqual(Z, w) || L(Z);
46317
46332
  }, [D, B]);
46318
46333
  const Y = useCallback((Z) => {
46319
46334
  if (m)
@@ -46372,7 +46387,7 @@ const Table$1 = withDynamicSchemaProps(
46372
46387
  renderCell: (Z, oe, re, ie) => {
46373
46388
  if (!l && !c)
46374
46389
  return ie;
46375
- const ce = L == null ? void 0 : L.current, fe = (L == null ? void 0 : L.pageSize) || 20;
46390
+ const ce = O == null ? void 0 : O.current, fe = (O == null ? void 0 : O.pageSize) || 20;
46376
46391
  return ce ? re = re + (ce - 1) * fe + 1 : re = re + 1, oe.__index && (re = extractIndex(oe.__index)), /* @__PURE__ */ jsxs(
46377
46392
  "div",
46378
46393
  {
@@ -46413,7 +46428,7 @@ const Table$1 = withDynamicSchemaProps(
46413
46428
  J,
46414
46429
  E,
46415
46430
  Q,
46416
- L,
46431
+ O,
46417
46432
  b
46418
46433
  ]
46419
46434
  ), ne = useCallback(
@@ -46439,7 +46454,7 @@ const Table$1 = withDynamicSchemaProps(
46439
46454
  ), he = useCallback(
46440
46455
  (Z, oe) => {
46441
46456
  const re = Z ? [...w, oe[F.getPrimaryKey()]] : w.filter((ie) => oe[F.getPrimaryKey()] !== ie);
46442
- O(re), g == null || g(Z, oe);
46457
+ L(re), g == null || g(Z, oe);
46443
46458
  },
46444
46459
  [w, g, F]
46445
46460
  ), ge = useMemo(() => ({
@@ -46457,7 +46472,7 @@ const Table$1 = withDynamicSchemaProps(
46457
46472
  defaultRowKey: Y,
46458
46473
  dataSource: K
46459
46474
  }, S), te), {
46460
- paginationProps: L,
46475
+ paginationProps: O,
46461
46476
  components: ee,
46462
46477
  onTableChange: d,
46463
46478
  onRow: G,
@@ -46568,10 +46583,10 @@ const Table$1 = withDynamicSchemaProps(
46568
46583
  }, T = () => {
46569
46584
  const E = (o == null ? void 0 : o.targetKey) || "id", V = (n.value || []).map((U) => U == null ? void 0 : U[E]).filter(Boolean);
46570
46585
  return V.length ? { $and: [{ [`${E}.$ne`]: V }] } : {};
46571
- }, [D, B] = useState(1), [$, L] = useState(((k = n.componentProps) == null ? void 0 : k.pageSize) || 10), { setFormValueChanged: j } = useActionContext();
46586
+ }, [D, B] = useState(1), [$, O] = useState(((k = n.componentProps) == null ? void 0 : k.pageSize) || 10), { setFormValueChanged: j } = useActionContext();
46572
46587
  useEffect(() => {
46573
46588
  var E;
46574
- L((E = n.componentProps) == null ? void 0 : E.pageSize);
46589
+ O((E = n.componentProps) == null ? void 0 : E.pageSize);
46575
46590
  }, [(M = n.componentProps) == null ? void 0 : M.pageSize]);
46576
46591
  const w = useMemo(() => {
46577
46592
  var V;
@@ -46581,13 +46596,13 @@ const Table$1 = withDynamicSchemaProps(
46581
46596
  pageSize: $ || 10,
46582
46597
  total: n == null ? void 0 : n.value,
46583
46598
  onChange: (H, U) => {
46584
- B(H), L(U), n.componentProps.pageSize = U, n.onInput(n.value), j == null || j(!1);
46599
+ B(H), O(U), n.componentProps.pageSize = U, n.onInput(n.value), j == null || j(!1);
46585
46600
  },
46586
46601
  showSizeChanger: !0,
46587
46602
  pageSizeOptions: ["10", "20", "50", "100"],
46588
46603
  hideOnSinglePage: !1
46589
46604
  };
46590
- }, [(q = n.value) == null ? void 0 : q.length, $, D]), O = () => {
46605
+ }, [(q = n.value) == null ? void 0 : q.length, $, D]), L = () => {
46591
46606
  const { field: E } = useAssociationFieldContext();
46592
46607
  return {
46593
46608
  run() {
@@ -46632,7 +46647,7 @@ const Table$1 = withDynamicSchemaProps(
46632
46647
  b !== !1 && /* @__PURE__ */ jsx(
46633
46648
  Action.Link,
46634
46649
  {
46635
- useAction: O,
46650
+ useAction: L,
46636
46651
  title: /* @__PURE__ */ jsxs(Space$1, { style: { gap: 2 }, className: "nb-sub-table-addNew", children: [
46637
46652
  /* @__PURE__ */ jsx(PlusOutlined, {}),
46638
46653
  " ",
@@ -46778,8 +46793,8 @@ const ReadPretty$7 = observer$1(
46778
46793
  InternalAssociationSelect.displayName = "InternalAssociationSelect";
46779
46794
  const AssociationSelect = InternalAssociationSelect;
46780
46795
  AssociationSelect.Designer = function e() {
46781
- var O, N, k, M, q, E, V, H, U, G, Y;
46782
- const { getCollectionFields: t, getInterface: n, getCollectionJoinField: o, getCollection: r, isTitleField: a } = useCollectionManager_deprecated(), { getField: i } = useCollection_deprecated(), { form: l } = useFormBlockContext(), c = useField(), u = useFieldSchema(), { t: d } = useTranslation(), p = useFilterByTk(), { dn: m, refresh: h, insertAdjacent: g } = useDesignable(), f = useCompile(), C = useIsShowMultipleSwitch(), { isAllowToSetDefaultValue: b } = useIsAllowToSetDefaultValue(), S = i(u.name) || o(u["x-collection-field"]), y = useFieldComponentOptions(), v = c.address.segments.includes("__form_grid"), I = n(S == null ? void 0 : S.interface), F = (O = I == null ? void 0 : I.validateSchema) == null ? void 0 : O.call(I, u), R = (N = S == null ? void 0 : S.uiSchema) == null ? void 0 : N.title, T = S != null && S.target ? t(S == null ? void 0 : S.target) : [];
46796
+ var L, N, k, M, q, E, V, H, U, G, Y;
46797
+ const { getCollectionFields: t, getInterface: n, getCollectionJoinField: o, getCollection: r, isTitleField: a } = useCollectionManager_deprecated(), { getField: i } = useCollection_deprecated(), { form: l } = useFormBlockContext(), c = useField(), u = useFieldSchema(), { t: d } = useTranslation(), p = useFilterByTk(), { dn: m, refresh: h, insertAdjacent: g } = useDesignable(), f = useCompile(), C = useIsShowMultipleSwitch(), { isAllowToSetDefaultValue: b } = useIsAllowToSetDefaultValue(), S = i(u.name) || o(u["x-collection-field"]), y = useFieldComponentOptions(), v = c.address.segments.includes("__form_grid"), I = n(S == null ? void 0 : S.interface), F = (L = I == null ? void 0 : I.validateSchema) == null ? void 0 : L.call(I, u), R = (N = S == null ? void 0 : S.uiSchema) == null ? void 0 : N.title, T = S != null && S.target ? t(S == null ? void 0 : S.target) : [];
46783
46798
  c.title === R || c.title;
46784
46799
  const D = useSortFields(S == null ? void 0 : S.target), B = ((q = (M = (k = c.componentProps) == null ? void 0 : k.service) == null ? void 0 : M.params) == null ? void 0 : q.sort) || [];
46785
46800
  useEffect(() => {
@@ -46793,7 +46808,7 @@ AssociationSelect.Designer = function e() {
46793
46808
  direction: "asc"
46794
46809
  });
46795
46810
  c.readPretty || c.required;
46796
- const L = T.filter((J) => a(J)).map((J) => {
46811
+ const O = T.filter((J) => a(J)).map((J) => {
46797
46812
  var K;
46798
46813
  return {
46799
46814
  value: J == null ? void 0 : J.name,
@@ -47144,7 +47159,7 @@ AssociationSelect.Designer = function e() {
47144
47159
  SchemaSettingsSelectItem,
47145
47160
  {
47146
47161
  title: d("Title field"),
47147
- options: L,
47162
+ options: O,
47148
47163
  value: (Y = (G = c == null ? void 0 : c.componentProps) == null ? void 0 : G.fieldNames) == null ? void 0 : Y.label,
47149
47164
  onChange: (J) => {
47150
47165
  var ee, Q;
@@ -47177,7 +47192,7 @@ AssociationSelect.Designer = function e() {
47177
47192
  ] });
47178
47193
  };
47179
47194
  AssociationSelect.FilterDesigner = function e() {
47180
- var I, F, R, T, D, B, $, L, j, w, O;
47195
+ var I, F, R, T, D, B, $, O, j, w, L;
47181
47196
  const { getCollectionFields: t, getInterface: n, getCollectionJoinField: o } = useCollectionManager_deprecated(), { getField: r } = useCollection_deprecated(), { form: a } = useFormBlockContext(), i = useField(), l = useFieldSchema(), { t: c } = useTranslation(), { dn: u, refresh: d } = useDesignable(), p = useCompile(), m = r(l.name) || o(l["x-collection-field"]), h = n(m == null ? void 0 : m.interface), g = (I = h == null ? void 0 : h.validateSchema) == null ? void 0 : I.call(h, l), f = (F = m == null ? void 0 : m.uiSchema) == null ? void 0 : F.title, C = m != null && m.target ? t(m == null ? void 0 : m.target) : [];
47182
47197
  i.title === f || i.title;
47183
47198
  const b = useSortFields(m == null ? void 0 : m.target), S = ((D = (T = (R = i.componentProps) == null ? void 0 : R.service) == null ? void 0 : T.params) == null ? void 0 : D.sort) || [], y = S == null ? void 0 : S.map((N) => N.startsWith("-") ? {
@@ -47332,7 +47347,7 @@ AssociationSelect.FilterDesigner = function e() {
47332
47347
  SchemaSettingsDataScope,
47333
47348
  {
47334
47349
  collectionName: m == null ? void 0 : m.target,
47335
- defaultFilter: ((j = (L = ($ = i.componentProps) == null ? void 0 : $.service) == null ? void 0 : L.params) == null ? void 0 : j.filter) || {},
47350
+ defaultFilter: ((j = (O = ($ = i.componentProps) == null ? void 0 : $.service) == null ? void 0 : O.params) == null ? void 0 : j.filter) || {},
47336
47351
  form: a,
47337
47352
  onSubmit: ({ filter: N }) => {
47338
47353
  N = removeNullCondition(N), _.set(i.componentProps, "service.params.filter", N), l["x-component-props"] = i.componentProps, u.emit("patch", {
@@ -47434,7 +47449,7 @@ AssociationSelect.FilterDesigner = function e() {
47434
47449
  {
47435
47450
  title: c("Title field"),
47436
47451
  options: v,
47437
- value: (O = (w = i == null ? void 0 : i.componentProps) == null ? void 0 : w.fieldNames) == null ? void 0 : O.label,
47452
+ value: (L = (w = i == null ? void 0 : i.componentProps) == null ? void 0 : w.fieldNames) == null ? void 0 : L.label,
47438
47453
  onChange: (N) => {
47439
47454
  var q, E;
47440
47455
  const k = {
@@ -47787,13 +47802,16 @@ const DataSourceSelect = connect((e) => {
47787
47802
  "#1677FF",
47788
47803
  "#F5222D",
47789
47804
  "#FADB14",
47805
+ "#E6F4FF",
47806
+ "#fff1f0",
47807
+ "#F6FFED",
47808
+ "#E6FFFB",
47790
47809
  "#FA8C164D",
47791
47810
  "#FADB144D",
47792
47811
  "#52C41A4D",
47793
47812
  "#1677FF4D",
47794
47813
  "#2F54EB4D",
47795
- "#722ED14D",
47796
- "#EB2F964D"
47814
+ "#722ED14D"
47797
47815
  ]
47798
47816
  }
47799
47817
  ],
@@ -48883,8 +48901,8 @@ const InternalListBlockProvider = (e) => {
48883
48901
  }
48884
48902
  },
48885
48903
  onSubmit: ({ sort: $ }) => {
48886
- const L = $.map((j) => j.direction === "desc" ? `-${j.field}` : j.field);
48887
- _.set(i, "x-decorator-props.params.sort", L), c.decoratorProps.params = P(x({}, i["x-decorator-props"].params), { page: 1 }), u.emit("patch", {
48904
+ const O = $.map((j) => j.direction === "desc" ? `-${j.field}` : j.field);
48905
+ _.set(i, "x-decorator-props.params.sort", O), c.decoratorProps.params = P(x({}, i["x-decorator-props"].params), { page: 1 }), u.emit("patch", {
48888
48906
  schema: {
48889
48907
  "x-uid": i["x-uid"],
48890
48908
  "x-decorator-props": i["x-decorator-props"]
@@ -49017,7 +49035,7 @@ const InternalListBlockProvider = (e) => {
49017
49035
  return e - u - n.paddingLG - l;
49018
49036
  }, InternalList = withSkeletonComponent(
49019
49037
  (e) => {
49020
- var j, w, O, N;
49038
+ var j, w, L, N;
49021
49039
  const { service: t } = useListBlockContext(), { run: n, params: o } = t, r = useFieldSchema(), a = useDesigner(), i = (j = t == null ? void 0 : t.data) == null ? void 0 : j.meta, { pageSize: l, count: c, hasNext: u, page: d } = i || {}, p = useField(), [m] = useState(/* @__PURE__ */ new Map()), { wrapSSR: h, componentCls: g, hashId: f } = useStyles$3(), C = useListBlockHeight(), { token: b } = theme.useToken(), S = useCallback(
49022
49040
  (k) => (m.has(k) || m.set(
49023
49041
  k,
@@ -49081,7 +49099,7 @@ const InternalListBlockProvider = (e) => {
49081
49099
  }
49082
49100
  ) : E
49083
49101
  };
49084
- })(), { isMobileLayout: L } = useMobileLayout();
49102
+ })(), { isMobileLayout: O } = useMobileLayout();
49085
49103
  return h(
49086
49104
  /* @__PURE__ */ jsx(
49087
49105
  SchemaComponentOptions,
@@ -49119,7 +49137,7 @@ const InternalListBlockProvider = (e) => {
49119
49137
  children: /* @__PURE__ */ jsx(
49120
49138
  List$1,
49121
49139
  P(x({}, e), {
49122
- pagination: !i || !((w = p.value) != null && w.length) || c <= ((O = p.value) == null ? void 0 : O.length) ? !1 : $,
49140
+ pagination: !i || !((w = p.value) != null && w.length) || c <= ((L = p.value) == null ? void 0 : L.length) ? !1 : $,
49123
49141
  loading: t == null ? void 0 : t.loading,
49124
49142
  children: (N = p.value) != null && N.length ? p.value.map((k, M) => /* @__PURE__ */ jsx(
49125
49143
  NocoBaseRecursionField,
@@ -49127,7 +49145,7 @@ const InternalListBlockProvider = (e) => {
49127
49145
  basePath: p.address,
49128
49146
  name: M,
49129
49147
  onlyRenderProperties: !0,
49130
- schema: L ? transformMultiColumnToSingleColumn(S(M)) : S(M)
49148
+ schema: O ? transformMultiColumnToSingleColumn(S(M)) : S(M)
49131
49149
  },
49132
49150
  M
49133
49151
  )) : null
@@ -49566,8 +49584,8 @@ const toValue$1 = (e, t) => e == null ? t : e, ReadPrettyRecordPicker = observer
49566
49584
  "a",
49567
49585
  {
49568
49586
  onClick: ($) => {
49569
- var L;
49570
- $.stopPropagation(), $.preventDefault(), l(!0), p(F), (L = C == null ? void 0 : C.current) == null || L.setPopoverVisible(!1);
49587
+ var O;
49588
+ $.stopPropagation(), $.preventDefault(), l(!0), p(F), (O = C == null ? void 0 : C.current) == null || O.setPopoverVisible(!1);
49571
49589
  },
49572
49590
  children: B
49573
49591
  }
@@ -50985,7 +51003,7 @@ const TableActionColumnDesigner = (e) => {
50985
51003
  "sort-field"
50986
51004
  );
50987
51005
  }, TableBlockDesigner = () => {
50988
- var I, F, R, T, D, B, $, L, j, w, O, N;
51006
+ var I, F, R, T, D, B, $, O, j, w, L, N;
50989
51007
  const { name: e, title: t } = useCollection_deprecated(), { getCollectionField: n, getCollection: o } = useCollectionManager_deprecated(), r = useField(), a = useFieldSchema(), { form: i } = useFormBlockContext(), l = useSortFields(e), { service: c } = useTableBlockContext(), { t: u } = useTranslation(), { dn: d } = useDesignable();
50990
51008
  useBlockTemplateContext();
50991
51009
  const p = ((F = (I = a == null ? void 0 : a["x-decorator-props"]) == null ? void 0 : I.params) == null ? void 0 : F.sort) || [];
@@ -51071,7 +51089,7 @@ const TableActionColumnDesigner = (e) => {
51071
51089
  SchemaSettingsDataScope,
51072
51090
  {
51073
51091
  collectionName: e,
51074
- defaultFilter: ((j = (L = a == null ? void 0 : a["x-decorator-props"]) == null ? void 0 : L.params) == null ? void 0 : j.filter) || {},
51092
+ defaultFilter: ((j = (O = a == null ? void 0 : a["x-decorator-props"]) == null ? void 0 : O.params) == null ? void 0 : j.filter) || {},
51075
51093
  form: i,
51076
51094
  onSubmit: y
51077
51095
  }
@@ -51168,7 +51186,7 @@ const TableActionColumnDesigner = (e) => {
51168
51186
  SchemaSettingsSelectItem,
51169
51187
  {
51170
51188
  title: u("Records per page"),
51171
- value: ((O = (w = r.decoratorProps) == null ? void 0 : w.params) == null ? void 0 : O.pageSize) || 20,
51189
+ value: ((L = (w = r.decoratorProps) == null ? void 0 : w.params) == null ? void 0 : L.pageSize) || 20,
51172
51190
  options: [
51173
51191
  { label: "5", value: 5 },
51174
51192
  { label: "10", value: 10 },
@@ -51242,7 +51260,7 @@ TableField.ActionBar = observer$1(
51242
51260
  { displayName: "TableField.ActionBar" }
51243
51261
  );
51244
51262
  const TableSelectorDesigner = () => {
51245
- var R, T, D, B, $, L;
51263
+ var R, T, D, B, $, O;
51246
51264
  const { name: e, title: t } = useCollection_deprecated(), { getCollectionJoinField: n, getAllCollectionsInheritChain: o } = useCollectionManager_deprecated(), r = useField(), a = useFieldSchema(), { form: i } = useFormBlockContext(), l = useSortFields(e), { service: c, extraFilter: u } = useTableSelectorContext(), { t: d } = useTranslation(), { dn: p } = useDesignable(), m = ((T = (R = a == null ? void 0 : a["x-decorator-props"]) == null ? void 0 : R.params) == null ? void 0 : T.sort) || [], h = recursiveParent(a, "CollectionField"), g = n(h == null ? void 0 : h["x-collection-field"]), f = m == null ? void 0 : m.map((j) => j.startsWith("-") ? {
51247
51265
  field: j.substring(1),
51248
51266
  direction: "desc"
@@ -51261,10 +51279,10 @@ const TableSelectorDesigner = () => {
51261
51279
  j = removeNullCondition(j);
51262
51280
  const w = r.decoratorProps.params || {};
51263
51281
  w.filter = j, r.decoratorProps.params = w, a["x-decorator-props"].params = w;
51264
- let O = _.cloneDeep(j);
51265
- u && (O ? O = {
51266
- $and: [u, O]
51267
- } : O = u), c.run(P(x({}, (N = c.params) == null ? void 0 : N[0]), { filter: O, page: 1 })), p.emit("patch", {
51282
+ let L = _.cloneDeep(j);
51283
+ u && (L ? L = {
51284
+ $and: [u, L]
51285
+ } : L = u), c.run(P(x({}, (N = c.params) == null ? void 0 : N[0]), { filter: L, page: 1 })), p.emit("patch", {
51268
51286
  schema: {
51269
51287
  "x-uid": a["x-uid"],
51270
51288
  "x-decorator-props": a["x-decorator-props"]
@@ -51297,9 +51315,9 @@ const TableSelectorDesigner = () => {
51297
51315
  defaultChecked: !0,
51298
51316
  checked: r.decoratorProps.treeTable,
51299
51317
  onChange: (j) => {
51300
- var O;
51318
+ var L;
51301
51319
  r.form.clearFormGraph(`${r.address}.*`), r.decoratorProps.treeTable = j, a["x-decorator-props"].treeTable = j;
51302
- const w = P(x({}, (O = c.params) == null ? void 0 : O[0]), {
51320
+ const w = P(x({}, (L = c.params) == null ? void 0 : L[0]), {
51303
51321
  tree: j ? !0 : null
51304
51322
  });
51305
51323
  p.emit("patch", {
@@ -51386,8 +51404,8 @@ const TableSelectorDesigner = () => {
51386
51404
  },
51387
51405
  onSubmit: ({ sort: j }) => {
51388
51406
  var N;
51389
- const w = j.map((k) => k.direction === "desc" ? `-${k.field}` : k.field), O = r.decoratorProps.params || {};
51390
- O.sort = w, r.decoratorProps.params = O, a["x-decorator-props"].params = O, p.emit("patch", {
51407
+ const w = j.map((k) => k.direction === "desc" ? `-${k.field}` : k.field), L = r.decoratorProps.params || {};
51408
+ L.sort = w, r.decoratorProps.params = L, a["x-decorator-props"].params = L, p.emit("patch", {
51391
51409
  schema: {
51392
51410
  "x-uid": a["x-uid"],
51393
51411
  "x-decorator-props": a["x-decorator-props"]
@@ -51400,7 +51418,7 @@ const TableSelectorDesigner = () => {
51400
51418
  SchemaSettingsSelectItem,
51401
51419
  {
51402
51420
  title: d("Records per page"),
51403
- value: ((L = ($ = r.decoratorProps) == null ? void 0 : $.params) == null ? void 0 : L.pageSize) || 20,
51421
+ value: ((O = ($ = r.decoratorProps) == null ? void 0 : $.params) == null ? void 0 : O.pageSize) || 20,
51404
51422
  options: [
51405
51423
  { label: "5", value: 5 },
51406
51424
  { label: "10", value: 10 },
@@ -51410,9 +51428,9 @@ const TableSelectorDesigner = () => {
51410
51428
  { label: "200", value: 200 }
51411
51429
  ],
51412
51430
  onChange: (j) => {
51413
- var O;
51431
+ var L;
51414
51432
  const w = r.decoratorProps.params || {};
51415
- w.pageSize = j, r.decoratorProps.params = w, a["x-decorator-props"].params = w, c.run(P(x({}, (O = c.params) == null ? void 0 : O[0]), { pageSize: j, page: 1 })), p.emit("patch", {
51433
+ w.pageSize = j, r.decoratorProps.params = w, a["x-decorator-props"].params = w, c.run(P(x({}, (L = c.params) == null ? void 0 : L[0]), { pageSize: j, page: 1 })), p.emit("patch", {
51416
51434
  schema: {
51417
51435
  "x-uid": a["x-uid"],
51418
51436
  "x-decorator-props": a["x-decorator-props"]
@@ -53213,11 +53231,11 @@ const useCurrentAppInfo = () => useContext(CurrentAppInfoContext), CurrentAppInf
53213
53231
  if (D && I) {
53214
53232
  const $ = ((B = r(D)) == null ? void 0 : B.fields) || [];
53215
53233
  o(
53216
- $ == null ? void 0 : $.filter((L) => supportTypes.includes(L.type)).map((L) => {
53234
+ $ == null ? void 0 : $.filter((O) => supportTypes.includes(O.type)).map((O) => {
53217
53235
  var j;
53218
53236
  return {
53219
- value: L.name,
53220
- label: g(((j = L.uiSchema) == null ? void 0 : j.title) || L.name)
53237
+ value: O.name,
53238
+ label: g(((j = O.uiSchema) == null ? void 0 : j.title) || O.name)
53221
53239
  };
53222
53240
  })
53223
53241
  );
@@ -53406,12 +53424,12 @@ const useCurrentAppInfo = () => useContext(CurrentAppInfoContext), CurrentAppInf
53406
53424
  const t = useRecord();
53407
53425
  return /* @__PURE__ */ jsx(AddFieldAction, x({ item: t }, e));
53408
53426
  }, AddFieldAction = (e) => {
53409
- var L, j;
53410
- const { scope: t, getContainer: n, item: o, children: r, trigger: a, align: i, database: l } = e, { getInterface: c, getTemplate: u, collections: d, getCollection: p } = useCollectionManager_deprecated(), [m, h] = useState(!1), [g, f] = useState(), [C, b] = useState({}), S = useCompile(), { t: y } = useTranslation(), { isDialect: v } = useDialect(), I = useFieldInterfaceOptions(), F = ((j = (L = p(o.name)) == null ? void 0 : L.options) == null ? void 0 : j.fields) || o.fields || [], R = useMemo(() => d.map((w) => ({
53427
+ var O, j;
53428
+ const { scope: t, getContainer: n, item: o, children: r, trigger: a, align: i, database: l } = e, { getInterface: c, getTemplate: u, collections: d, getCollection: p } = useCollectionManager_deprecated(), [m, h] = useState(!1), [g, f] = useState(), [C, b] = useState({}), S = useCompile(), { t: y } = useTranslation(), { isDialect: v } = useDialect(), I = useFieldInterfaceOptions(), F = ((j = (O = p(o.name)) == null ? void 0 : O.options) == null ? void 0 : j.fields) || o.fields || [], R = useMemo(() => d.map((w) => ({
53411
53429
  label: S(w.title),
53412
53430
  value: w.name
53413
53431
  })), []), T = useCallback(() => {
53414
- const { availableFieldInterfaces: w } = u(o.template) || {}, { exclude: O, include: N } = w || {}, k = [];
53432
+ const { availableFieldInterfaces: w } = u(o.template) || {}, { exclude: L, include: N } = w || {}, k = [];
53415
53433
  return I.forEach((M) => {
53416
53434
  var q;
53417
53435
  if (M.key === "systemInfo")
@@ -53426,14 +53444,14 @@ const useCurrentAppInfo = () => useContext(CurrentAppInfoContext), CurrentAppInf
53426
53444
  H && E.push(P(x({}, H), {
53427
53445
  targetScope: V == null ? void 0 : V.targetScope
53428
53446
  }));
53429
- }) : O != null && O.length ? E = (q = M == null ? void 0 : M.children) == null ? void 0 : q.filter((V) => !O.includes(V.name)) : E = M == null ? void 0 : M.children, E != null && E.length && k.push(P(x({}, M), {
53447
+ }) : L != null && L.length ? E = (q = M == null ? void 0 : M.children) == null ? void 0 : q.filter((V) => !L.includes(V.name)) : E = M == null ? void 0 : M.children, E != null && E.length && k.push(P(x({}, M), {
53430
53448
  children: E
53431
53449
  }));
53432
53450
  }
53433
53451
  }), k;
53434
53452
  }, [u, o]), D = useMemo(() => T().map((w) => {
53435
- var O;
53436
- return ((O = w == null ? void 0 : w.children) == null ? void 0 : O.length) === 0 ? null : o.template === "view" ? {
53453
+ var L;
53454
+ return ((L = w == null ? void 0 : w.children) == null ? void 0 : L.length) === 0 ? null : o.template === "view" ? {
53437
53455
  type: "group",
53438
53456
  label: S(w.label),
53439
53457
  title: S(w.label),
@@ -53457,25 +53475,25 @@ const useCurrentAppInfo = () => useContext(CurrentAppInfoContext), CurrentAppInf
53457
53475
  }))
53458
53476
  };
53459
53477
  }).filter((w) => {
53460
- var O;
53461
- return (O = w == null ? void 0 : w.children) == null ? void 0 : O.length;
53478
+ var L;
53479
+ return (L = w == null ? void 0 : w.children) == null ? void 0 : L.length;
53462
53480
  }), [T]), B = useMemo(() => ({
53463
53481
  style: {
53464
53482
  maxHeight: "60vh",
53465
53483
  overflow: "auto"
53466
53484
  },
53467
53485
  onClick: (w) => {
53468
- const O = w.item.props["data-targetScope"];
53469
- O && f(O);
53486
+ const L = w.item.props["data-targetScope"];
53487
+ L && f(L);
53470
53488
  const N = getSchema$8(c(w.key), o, S);
53471
53489
  N && (b(N), h(!0));
53472
53490
  },
53473
53491
  items: D
53474
53492
  }), [c, D, o]), $ = useMemo(() => F.filter((w) => ["string", "bigInt", "integer"].includes(w.type)).map((w) => {
53475
- var O;
53493
+ var L;
53476
53494
  return {
53477
53495
  value: w.name,
53478
- label: S((O = w.uiSchema) == null ? void 0 : O.title)
53496
+ label: S((L = w.uiSchema) == null ? void 0 : L.title)
53479
53497
  };
53480
53498
  }), [F == null ? void 0 : F.length]);
53481
53499
  return o.template !== "sql" && /* @__PURE__ */ jsx(RecordProvider, { record: o, children: /* @__PURE__ */ jsxs(ActionContextProvider, { value: { visible: m, setVisible: h }, children: [
@@ -53605,14 +53623,14 @@ const useCurrentAppInfo = () => useContext(CurrentAppInfoContext), CurrentAppInf
53605
53623
  "a",
53606
53624
  P(x({}, i), {
53607
53625
  onClick: () => z(void 0, null, function* () {
53608
- var $, L;
53626
+ var $, O;
53609
53627
  const { data: R } = yield g.resource("collections.fields", o.collectionName).get({
53610
53628
  filterByTk: o.name,
53611
53629
  appends: ["reverseField"]
53612
53630
  });
53613
53631
  S(R == null ? void 0 : R.data);
53614
53632
  const T = l(o.interface), D = cloneDeep(R == null ? void 0 : R.data) || {};
53615
- D != null && D.reverseField ? D.autoCreateReverseField = !0 : (D.autoCreateReverseField = !1, D.reverseField = ($ = T == null ? void 0 : T.default) == null ? void 0 : $.reverseField, set$1(D.reverseField, "name", `f_${uid()}`), set$1(D.reverseField, "uiSchema.title", (L = o.__parent) == null ? void 0 : L.title));
53633
+ D != null && D.reverseField ? D.autoCreateReverseField = !0 : (D.autoCreateReverseField = !1, D.reverseField = ($ = T == null ? void 0 : T.default) == null ? void 0 : $.reverseField, set$1(D.reverseField, "name", `f_${uid()}`), set$1(D.reverseField, "uiSchema.title", (O = o.__parent) == null ? void 0 : O.title));
53616
53634
  const B = getSchema$7(T, D, o, C);
53617
53635
  h(B), p(!0);
53618
53636
  }),
@@ -53707,13 +53725,13 @@ const useCurrentAppInfo = () => useContext(CurrentAppInfoContext), CurrentAppInf
53707
53725
  return /* @__PURE__ */ jsx(OverridingFieldAction, x({ item: t, parentItem: n }, e));
53708
53726
  }, getIsOverriding = (e, t, n) => t.find((r) => r.name === n.name).collectionName === e, OverridingFieldAction = (e) => {
53709
53727
  const { scope: t, getContainer: n, item: o, parentItem: r, children: a, currentCollection: i } = e, { target: l, through: c } = o, { getInterface: u, getCollection: d, getCurrentCollectionFields: p, getChildrenCollections: m, collections: h } = useCollectionManager_deprecated(), [g, f] = useState(!1), [C, b] = useState({}), S = useAPIClient(), { t: y } = useTranslation(), v = useCompile(), I = (j) => {
53710
- var O;
53711
- return j && ((O = m(j)) == null ? void 0 : O.map((N) => N.name).concat([j]));
53728
+ var L;
53729
+ return j && ((L = m(j)) == null ? void 0 : L.map((N) => N.name).concat([j]));
53712
53730
  }, [F, R] = useState({}), T = p(i), D = getIsOverriding(i, T, o), B = useMemo(() => h.map((j) => ({
53713
53731
  label: v(j.title),
53714
53732
  value: j.name
53715
53733
  })), []), $ = () => {
53716
- const j = useForm(), { refresh: w } = useResourceActionContext(), { refreshCM: O } = useCollectionManager_deprecated(), N = useActionContext(), { resource: k } = useResourceContext();
53734
+ const j = useForm(), { refresh: w } = useResourceActionContext(), { refreshCM: L } = useCollectionManager_deprecated(), N = useActionContext(), { resource: k } = useResourceContext();
53717
53735
  return {
53718
53736
  run() {
53719
53737
  return z(this, null, function* () {
@@ -53732,17 +53750,17 @@ const useCurrentAppInfo = () => useContext(CurrentAppInfoContext), CurrentAppInf
53732
53750
  ]);
53733
53751
  yield k.create({
53734
53752
  values: E
53735
- }), yield j.reset(), yield O(), yield w(), N.setVisible(!1);
53753
+ }), yield j.reset(), yield L(), yield w(), N.setVisible(!1);
53736
53754
  });
53737
53755
  }
53738
53756
  };
53739
- }, L = useMemo(() => {
53757
+ }, O = useMemo(() => {
53740
53758
  var j;
53741
53759
  return (o == null ? void 0 : o.fields) || ((j = d(o.collectionName)) == null ? void 0 : j.options.fields.filter((w) => ["string", "bigInt", "integer"].includes(w.type)).map((w) => {
53742
- var O;
53760
+ var L;
53743
53761
  return {
53744
53762
  value: w.name,
53745
- label: v((O = w.uiSchema) == null ? void 0 : O.title)
53763
+ label: v((L = w.uiSchema) == null ? void 0 : L.title)
53746
53764
  };
53747
53765
  }));
53748
53766
  }, [o.name]);
@@ -53759,10 +53777,10 @@ const useCurrentAppInfo = () => useContext(CurrentAppInfoContext), CurrentAppInf
53759
53777
  appends: ["reverseField"]
53760
53778
  });
53761
53779
  R(w == null ? void 0 : w.data);
53762
- const O = u(o.interface), N = cloneDeep(w == null ? void 0 : w.data) || {};
53763
- N != null && N.reverseField || (N.autoCreateReverseField = !1, N.reverseField = (j = O.default) == null ? void 0 : j.reverseField, set(N.reverseField, "name", `f_${uid()}`), set(N.reverseField, "uiSchema.title", o.__parent.title));
53780
+ const L = u(o.interface), N = cloneDeep(w == null ? void 0 : w.data) || {};
53781
+ N != null && N.reverseField || (N.autoCreateReverseField = !1, N.reverseField = (j = L.default) == null ? void 0 : j.reverseField, set(N.reverseField, "name", `f_${uid()}`), set(N.reverseField, "uiSchema.title", o.__parent.title));
53764
53782
  const k = getSchema$6(
53765
- P(x({}, O), {
53783
+ P(x({}, L), {
53766
53784
  default: N
53767
53785
  }),
53768
53786
  o,
@@ -53789,7 +53807,7 @@ const useCurrentAppInfo = () => useContext(CurrentAppInfoContext), CurrentAppInf
53789
53807
  isOverride: !0,
53790
53808
  targetScope: { target: I(l), through: I(c) },
53791
53809
  collections: B,
53792
- scopeKeyOptions: L
53810
+ scopeKeyOptions: O
53793
53811
  }, t)
53794
53812
  }
53795
53813
  )
@@ -54224,10 +54242,10 @@ const getSchema$4 = (e, t, n) => {
54224
54242
  const { databaseView: t, viewName: n, sources: o, schema: r } = e, { data: a } = useContext(ResourceActionContext), i = useAPIClient(), { t: l } = useTranslation(), [c, u] = useState(!1), [d, p] = useState([]), [m, h] = useState([]), [g, f] = useState(o), [C, b] = useState([]), S = useField(), y = useForm(), { getCollection: v, getInterface: I, getCollectionFields: F, getInheritCollections: R, getParentCollectionFields: T } = useCollectionManager_deprecated(), D = useCompile(), $ = useFieldInterfaceOptions().filter((w) => !["relation", "systemInfo"].includes(w.key));
54225
54243
  useEffect(() => {
54226
54244
  const w = [];
54227
- g.forEach((O) => {
54245
+ g.forEach((L) => {
54228
54246
  var E;
54229
- const N = v(O), M = R(O).map((V) => {
54230
- const H = T(V, O);
54247
+ const N = v(L), M = R(L).map((V) => {
54248
+ const H = T(V, L);
54231
54249
  return {
54232
54250
  type: "group",
54233
54251
  key: V,
@@ -54245,17 +54263,17 @@ const getSchema$4 = (e, t, n) => {
54245
54263
  return { value: V.name, key: V.name, label: l(((H = V.uiSchema) == null ? void 0 : H.title) || V.name) };
54246
54264
  }).concat(M);
54247
54265
  w.push({
54248
- value: O,
54266
+ value: L,
54249
54267
  label: l(N.title || N.name),
54250
54268
  children: q
54251
54269
  });
54252
54270
  }), h(w);
54253
54271
  }, [g, t]), useEffect(() => {
54254
54272
  t && (u(!0), i.resource("dbViews").get({ filterByTk: n, schema: r }).then(({ data: w }) => {
54255
- var O, N;
54273
+ var L, N;
54256
54274
  if (w) {
54257
54275
  u(!1), p([]);
54258
- const k = (N = Object.values((O = w == null ? void 0 : w.data) == null ? void 0 : O.fields)) == null ? void 0 : N.map((M) => {
54276
+ const k = (N = Object.values((L = w == null ? void 0 : w.data) == null ? void 0 : L.fields)) == null ? void 0 : N.map((M) => {
54259
54277
  var q, E;
54260
54278
  if (M.source) {
54261
54279
  const V = (a == null ? void 0 : a.data.find((H) => H.name === M.name)) || M;
@@ -54276,9 +54294,9 @@ const getSchema$4 = (e, t, n) => {
54276
54294
  }
54277
54295
  }).catch);
54278
54296
  }, [t]);
54279
- const L = (w, O) => {
54297
+ const O = (w, L) => {
54280
54298
  const N = _.cloneDeep(d);
54281
- N[O] = w, p(N), S.value = N.map((k) => {
54299
+ N[L] = w, p(N), S.value = N.map((k) => {
54282
54300
  var q, E, V;
54283
54301
  const M = typeof k.source == "string" ? k.source : (V = (E = (q = k.source) == null ? void 0 : q.filter) == null ? void 0 : E.call(q, Boolean)) == null ? void 0 : V.join(".");
54284
54302
  return P(x({}, k), {
@@ -54297,7 +54315,7 @@ const getSchema$4 = (e, t, n) => {
54297
54315
  dataIndex: "source",
54298
54316
  key: "source",
54299
54317
  width: 200,
54300
- render: (w, O, N) => /* @__PURE__ */ jsx(
54318
+ render: (w, L, N) => /* @__PURE__ */ jsx(
54301
54319
  Cascader$1,
54302
54320
  {
54303
54321
  defaultValue: typeof w == "string" ? w == null ? void 0 : w.split(".") : w,
@@ -54307,7 +54325,7 @@ const getSchema$4 = (e, t, n) => {
54307
54325
  onChange: (k, M) => {
54308
54326
  var E;
54309
54327
  const q = (E = F(k == null ? void 0 : k[0])) == null ? void 0 : E.find((V) => V.name === last(k));
54310
- L(P(x({}, O), { source: k, uiSchema: q == null ? void 0 : q.uiSchema }), N);
54328
+ O(P(x({}, L), { source: k, uiSchema: q == null ? void 0 : q.uiSchema }), N);
54311
54329
  },
54312
54330
  placeholder: l("Select field source")
54313
54331
  }
@@ -54318,7 +54336,7 @@ const getSchema$4 = (e, t, n) => {
54318
54336
  dataIndex: "type",
54319
54337
  width: 140,
54320
54338
  key: "type",
54321
- render: (w, O, N) => {
54339
+ render: (w, L, N) => {
54322
54340
  const k = d[N];
54323
54341
  return k != null && k.source || !(k != null && k.possibleTypes) ? /* @__PURE__ */ jsx(Tag, { children: w }) : /* @__PURE__ */ jsx(
54324
54342
  Select$1,
@@ -54327,7 +54345,7 @@ const getSchema$4 = (e, t, n) => {
54327
54345
  popupMatchSelectWidth: !1,
54328
54346
  style: { width: "100%" },
54329
54347
  options: (k == null ? void 0 : k.possibleTypes.map((M) => ({ label: M, value: M }))) || [],
54330
- onChange: (M) => L(P(x({}, k), { type: M }), N)
54348
+ onChange: (M) => O(P(x({}, k), { type: M }), N)
54331
54349
  }
54332
54350
  );
54333
54351
  }
@@ -54337,7 +54355,7 @@ const getSchema$4 = (e, t, n) => {
54337
54355
  dataIndex: "interface",
54338
54356
  key: "interface",
54339
54357
  width: 150,
54340
- render: (w, O, N) => {
54358
+ render: (w, L, N) => {
54341
54359
  const k = d[N], M = getInterfaceOptions($, k.type);
54342
54360
  return k.source ? w : /* @__PURE__ */ jsx(
54343
54361
  Select$1,
@@ -54346,7 +54364,7 @@ const getSchema$4 = (e, t, n) => {
54346
54364
  style: { width: "100%" },
54347
54365
  popupMatchSelectWidth: !1,
54348
54366
  onChange: (q) => {
54349
- L(P(x({}, k), { interface: q }), N);
54367
+ O(P(x({}, k), { interface: q }), N);
54350
54368
  },
54351
54369
  children: M.map((q) => /* @__PURE__ */ jsx(Select$1.OptGroup, { label: D(q.label), children: q.children.map((E) => /* @__PURE__ */ jsx(Select$1.Option, { value: E.name, children: D(E.label) }, E.value)) }, q.key))
54352
54370
  }
@@ -54358,14 +54376,14 @@ const getSchema$4 = (e, t, n) => {
54358
54376
  dataIndex: "title",
54359
54377
  key: "title",
54360
54378
  width: 180,
54361
- render: (w, O, N) => {
54379
+ render: (w, L, N) => {
54362
54380
  var M;
54363
54381
  const k = d[N];
54364
54382
  return /* @__PURE__ */ jsx(
54365
54383
  Input$3,
54366
54384
  {
54367
54385
  defaultValue: ((M = k == null ? void 0 : k.uiSchema) == null ? void 0 : M.title) || w,
54368
- onChange: (q) => L(
54386
+ onChange: (q) => O(
54369
54387
  P(x({}, k), { uiSchema: P(x({}, omit(k == null ? void 0 : k.uiSchema, "rawTitle")), { title: q.target.value }) }),
54370
54388
  N
54371
54389
  )
@@ -54420,8 +54438,8 @@ const mapFields = ["lineString", "point", "circle", "polygon"], PreviewTable$1 =
54420
54438
  }, S = (y) => {
54421
54439
  var v;
54422
54440
  return (v = y.filter((I) => I.source || I.interface)) == null ? void 0 : v.map((I) => {
54423
- var B, $, L, j, w, O;
54424
- const F = typeof (I == null ? void 0 : I.source) == "string" ? (B = I == null ? void 0 : I.source) == null ? void 0 : B.split(".") : I == null ? void 0 : I.source, R = (L = ($ = h(F == null ? void 0 : F[0])) == null ? void 0 : $.find((N) => N.name === (F == null ? void 0 : F[1]))) == null ? void 0 : L.uiSchema, T = ((j = I == null ? void 0 : I.uiSchema) == null ? void 0 : j.title) || (R == null ? void 0 : R.title) || I.name, D = I.source ? R : (O = (w = m(I.interface)) == null ? void 0 : w.default) == null ? void 0 : O.uiSchema;
54441
+ var B, $, O, j, w, L;
54442
+ const F = typeof (I == null ? void 0 : I.source) == "string" ? (B = I == null ? void 0 : I.source) == null ? void 0 : B.split(".") : I == null ? void 0 : I.source, R = (O = ($ = h(F == null ? void 0 : F[0])) == null ? void 0 : $.find((N) => N.name === (F == null ? void 0 : F[1]))) == null ? void 0 : O.uiSchema, T = ((j = I == null ? void 0 : I.uiSchema) == null ? void 0 : j.title) || (R == null ? void 0 : R.title) || I.name, D = I.source ? R : (L = (w = m(I.interface)) == null ? void 0 : w.default) == null ? void 0 : L.uiSchema;
54425
54443
  return {
54426
54444
  title: u(T),
54427
54445
  dataIndex: I.name,
@@ -54671,26 +54689,26 @@ const AsyncDataProvider = (e) => {
54671
54689
  if (useEffect(() => {
54672
54690
  var B;
54673
54691
  const T = /* @__PURE__ */ new Map();
54674
- a || (i && i.length ? Object.entries((i == null ? void 0 : i[0]) || {}).forEach(([$, L]) => {
54692
+ a || (i && i.length ? Object.entries((i == null ? void 0 : i[0]) || {}).forEach(([$, O]) => {
54675
54693
  var k;
54676
- const j = l[$], w = inferInterface($, L), O = (k = C.current(w)) == null ? void 0 : k.default, N = (j == null ? void 0 : j.uiSchema) || (O == null ? void 0 : O.uiSchema) || {};
54694
+ const j = l[$], w = inferInterface($, O), L = (k = C.current(w)) == null ? void 0 : k.default, N = (j == null ? void 0 : j.uiSchema) || (L == null ? void 0 : L.uiSchema) || {};
54677
54695
  T.set($, {
54678
54696
  name: $,
54679
54697
  interface: (j == null ? void 0 : j.interface) || w,
54680
- type: (j == null ? void 0 : j.type) || (O == null ? void 0 : O.type),
54698
+ type: (j == null ? void 0 : j.type) || (L == null ? void 0 : L.type),
54681
54699
  source: j == null ? void 0 : j.source,
54682
54700
  uiSchema: x({
54683
54701
  title: $
54684
54702
  }, N)
54685
54703
  });
54686
54704
  }) : Object.entries(l || {}).forEach(
54687
- ([$, L]) => T.set($, P(x({
54705
+ ([$, O]) => T.set($, P(x({
54688
54706
  name: $,
54689
54707
  type: "string"
54690
- }, L), {
54708
+ }, O), {
54691
54709
  uiSchema: x({
54692
54710
  title: $
54693
- }, (L == null ? void 0 : L.uiSchema) || {})
54711
+ }, (O == null ? void 0 : O.uiSchema) || {})
54694
54712
  }))
54695
54713
  )), (B = c.value) != null && B.length && c.value.forEach(($) => {
54696
54714
  T.has($.name) && T.set($.name, $);
@@ -54711,9 +54729,9 @@ const AsyncDataProvider = (e) => {
54711
54729
  const B = [...t];
54712
54730
  B.splice(D, 1, T), n(B), c.setValue(
54713
54731
  B.map(($) => {
54714
- var L, j, w;
54732
+ var O, j, w;
54715
54733
  return P(x({}, $), {
54716
- source: typeof $.source == "string" ? $.source : ((w = (j = (L = $.source) == null ? void 0 : L.filter) == null ? void 0 : j.call(L, Boolean)) == null ? void 0 : w.join(".")) || null
54734
+ source: typeof $.source == "string" ? $.source : ((w = (j = (O = $.source) == null ? void 0 : O.filter) == null ? void 0 : j.call(O, Boolean)) == null ? void 0 : w.join(".")) || null
54717
54735
  });
54718
54736
  })
54719
54737
  );
@@ -54738,11 +54756,11 @@ const AsyncDataProvider = (e) => {
54738
54756
  allowClear: !0,
54739
54757
  options: d(f),
54740
54758
  placeholder: e("Select field source"),
54741
- onChange: (L) => {
54742
- let j = l[L == null ? void 0 : L[1]];
54743
- j != null && j.interface || (j = m((L == null ? void 0 : L.join(".")) || "")), S(
54759
+ onChange: (O) => {
54760
+ let j = l[O == null ? void 0 : O[1]];
54761
+ j != null && j.interface || (j = m((O == null ? void 0 : O.join(".")) || "")), S(
54744
54762
  P(x({}, $), {
54745
- source: L,
54763
+ source: O,
54746
54764
  interface: j == null ? void 0 : j.interface,
54747
54765
  type: j == null ? void 0 : j.type,
54748
54766
  uiSchema: j == null ? void 0 : j.uiSchema
@@ -54760,21 +54778,21 @@ const AsyncDataProvider = (e) => {
54760
54778
  key: "interface",
54761
54779
  width: 150,
54762
54780
  render: (T, D, B) => {
54763
- var L;
54781
+ var O;
54764
54782
  const $ = t[B];
54765
- return $.source ? /* @__PURE__ */ jsx(Tag, { children: d((L = p(T)) == null ? void 0 : L.title) || T }) : /* @__PURE__ */ jsx(
54783
+ return $.source ? /* @__PURE__ */ jsx(Tag, { children: d((O = p(T)) == null ? void 0 : O.title) || T }) : /* @__PURE__ */ jsx(
54766
54784
  Select$1,
54767
54785
  {
54768
54786
  defaultValue: $.interface || "input",
54769
54787
  style: { width: "100%" },
54770
54788
  popupMatchSelectWidth: !1,
54771
54789
  onChange: (j) => {
54772
- var O, N, k, M, q;
54790
+ var L, N, k, M, q;
54773
54791
  const w = p(j);
54774
54792
  S(
54775
54793
  P(x({}, $), {
54776
54794
  interface: j || null,
54777
- uiSchema: P(x({}, (O = w == null ? void 0 : w.default) == null ? void 0 : O.uiSchema), {
54795
+ uiSchema: P(x({}, (L = w == null ? void 0 : w.default) == null ? void 0 : L.uiSchema), {
54778
54796
  title: ((k = (N = w == null ? void 0 : w.default) == null ? void 0 : N.uiSchema) == null ? void 0 : k.title) || ((M = $.uiSchema) == null ? void 0 : M.title)
54779
54797
  }),
54780
54798
  type: (q = w == null ? void 0 : w.default) == null ? void 0 : q.type
@@ -54794,12 +54812,12 @@ const AsyncDataProvider = (e) => {
54794
54812
  key: "title",
54795
54813
  width: 180,
54796
54814
  render: (T, D, B) => {
54797
- var L, j;
54815
+ var O, j;
54798
54816
  const $ = t[B];
54799
54817
  return /* @__PURE__ */ jsx(
54800
54818
  Input$3,
54801
54819
  {
54802
- value: ((L = $.uiSchema) == null ? void 0 : L.title) || T,
54820
+ value: ((O = $.uiSchema) == null ? void 0 : O.title) || T,
54803
54821
  defaultValue: ((j = $.uiSchema) == null ? void 0 : j.title) !== void 0 ? $.uiSchema.title : $ == null ? void 0 : $.name,
54804
54822
  onChange: (w) => S(P(x({}, $), { uiSchema: P(x({}, $ == null ? void 0 : $.uiSchema), { title: w.target.value }) }), B)
54805
54823
  }
@@ -60816,8 +60834,8 @@ const RolesResourcesActions = connect((e) => {
60816
60834
  name: F.name
60817
60835
  }, $ = B.fields || [];
60818
60836
  if (T) {
60819
- const L = $.indexOf(D.name);
60820
- $.splice(L, 1);
60837
+ const O = $.indexOf(D.name);
60838
+ $.splice(O, 1);
60821
60839
  } else
60822
60840
  $.push(D.name);
60823
60841
  B.fields = $, p[F.name] = B, t(Object.values(p));
@@ -63309,17 +63327,17 @@ const ActionInitializerItem = (e) => {
63309
63327
  ), F = C || (a == null ? void 0 : a.targetKey) || "id", R = b || ((U = (H = i["x-component-props"]) == null ? void 0 : H.fieldNames) == null ? void 0 : U.label) || F, T = {
63310
63328
  title: R || F,
63311
63329
  key: F
63312
- }, [D, B] = useState([]), [$, L] = useState(i.default || []), [j, w] = useState(!0), O = useLabelUiSchema(a, (T == null ? void 0 : T.title) || "label");
63330
+ }, [D, B] = useState([]), [$, O] = useState(i.default || []), [j, w] = useState(!0), L = useLabelUiSchema(a, (T == null ? void 0 : T.title) || "label");
63313
63331
  if (useEffect(() => {
63314
63332
  i.default && setTimeout(() => {
63315
- d(i.default), L(i.default);
63333
+ d(i.default), O(i.default);
63316
63334
  }, 100);
63317
63335
  }, [i.default, d]), !a)
63318
63336
  return null;
63319
63337
  const N = (J) => {
63320
63338
  B(J), w(!1);
63321
63339
  }, k = (J) => {
63322
- L(J), d(J), p == null || p(J);
63340
+ O(J), d(J), p == null || p(J);
63323
63341
  }, M = (J) => {
63324
63342
  var X;
63325
63343
  const K = (X = h == null ? void 0 : h[0]) == null ? void 0 : X.filter;
@@ -63380,7 +63398,7 @@ const ActionInitializerItem = (e) => {
63380
63398
  treeData: u,
63381
63399
  onSelect: k,
63382
63400
  fieldNames: T,
63383
- titleRender: (J) => /* @__PURE__ */ jsx(EllipsisWithTooltip, { ellipsis: !0, children: getLabelFormatValue(O, c(J[R])) }),
63401
+ titleRender: (J) => /* @__PURE__ */ jsx(EllipsisWithTooltip, { ellipsis: !0, children: getLabelFormatValue(L, c(J[R])) }),
63384
63402
  selectedKeys: $,
63385
63403
  blockNode: !0
63386
63404
  }
@@ -63839,9 +63857,9 @@ const DataBlockInitializer = (e) => {
63839
63857
  onClick: D,
63840
63858
  currentText: b,
63841
63859
  otherText: S
63842
- }), $ = useGetSchemaInitializerMenuItems(D), L = useMemo(() => $(B, a), [$, B, a]), [j, w] = useState([]), O = useMenuSearch({ data: L, openKeys: j, hideSearch: u }), N = useMemo(() => {
63843
- let q = O.filter((E) => E.key !== "search" && E.key !== "empty");
63844
- return p && q.length === 1 ? q = q[0].children : q = O, [
63860
+ }), $ = useGetSchemaInitializerMenuItems(D), O = useMemo(() => $(B, a), [$, B, a]), [j, w] = useState([]), L = useMenuSearch({ data: O, openKeys: j, hideSearch: u }), N = useMemo(() => {
63861
+ let q = L.filter((E) => E.key !== "search" && E.key !== "empty");
63862
+ return p && q.length === 1 ? q = q[0].children : q = L, [
63845
63863
  {
63846
63864
  key: a,
63847
63865
  label: F(i),
@@ -63852,8 +63870,8 @@ const DataBlockInitializer = (e) => {
63852
63870
  children: q
63853
63871
  }
63854
63872
  ];
63855
- }, [O, p, a, F, i, r, D, e]);
63856
- return L.length > 1 || L.length === 1 && ((M = (k = L[0]) == null ? void 0 : k.children) == null ? void 0 : M.length) > 0 || y ? /* @__PURE__ */ jsx(
63873
+ }, [L, p, a, F, i, r, D, e]);
63874
+ return O.length > 1 || O.length === 1 && ((M = (k = O[0]) == null ? void 0 : k.children) == null ? void 0 : M.length) > 0 || y ? /* @__PURE__ */ jsx(
63857
63875
  SchemaInitializerMenu,
63858
63876
  {
63859
63877
  onOpenChange: (q) => {
@@ -68752,6 +68770,7 @@ export {
68752
68770
  useDateVariable,
68753
68771
  useDatetimeVariable,
68754
68772
  useDatetimeVariableContext,
68773
+ useDeleteRouteSchema,
68755
68774
  useDesignable,
68756
68775
  useDesigner,
68757
68776
  useDestroyAction,