@nocobase/client 1.9.36 → 1.9.38

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.
@@ -0,0 +1,10 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ /// <reference types="react" />
10
+ export declare const TableUidContext: import("react").Context<string>;
package/es/index.mjs CHANGED
@@ -113,7 +113,7 @@ import { loadableResource } from "react-imported-component";
113
113
  import ProLayout, { RouteContext, PageHeader } from "@ant-design/pro-layout";
114
114
  import * as antdStyle from "antd-style";
115
115
  import { createStyles, createGlobalStyle, useAntdToken } from "antd-style";
116
- import { createStyles as wn } from "antd-style";
116
+ import { createStyles as Rn } from "antd-style";
117
117
  import * as dndKitCore from "@dnd-kit/core";
118
118
  import { DndContext as DndContext$1, rectIntersection, DragOverlay, useDroppable, useDndContext, useDndMonitor, useDraggable } from "@dnd-kit/core";
119
119
  import * as dndKitSortable from "@dnd-kit/sortable";
@@ -142,7 +142,6 @@ import { Line, Area, Column, Bar, Pie, Rose, WordCloud, Scatter, Radar, DualAxes
142
142
  import BigNumber from "bignumber.js";
143
143
  import { format } from "d3-format";
144
144
  import * as math from "mathjs";
145
- import { isFunction as isFunction$1 } from "mathjs";
146
145
  import { customAlphabet } from "nanoid";
147
146
  import { isDesktop } from "react-device-detect";
148
147
  import ReactDragListView from "react-drag-listview";
@@ -8856,7 +8855,7 @@ function addAppVersion(e, t) {
8856
8855
  addAppVersion((o = e.properties) == null ? void 0 : o[n], t);
8857
8856
  }), e;
8858
8857
  }
8859
- const name = "@nocobase/client", version = "1.9.36", license = "AGPL-3.0", main = "lib/index.js", module = "es/index.mjs", types = "es/index.d.ts", dependencies = {
8858
+ const name = "@nocobase/client", version = "1.9.38", license = "AGPL-3.0", main = "lib/index.js", module = "es/index.mjs", types = "es/index.d.ts", dependencies = {
8860
8859
  "@ahooksjs/use-url-state": "3.5.1",
8861
8860
  "@ant-design/cssinjs": "^1.11.1",
8862
8861
  "@ant-design/icons": "^5.6.1",
@@ -8877,9 +8876,9 @@ const name = "@nocobase/client", version = "1.9.36", license = "AGPL-3.0", main
8877
8876
  "@formily/reactive-react": "^2.2.27",
8878
8877
  "@formily/shared": "^2.2.27",
8879
8878
  "@formily/validator": "^2.2.27",
8880
- "@nocobase/evaluators": "1.9.36",
8881
- "@nocobase/sdk": "1.9.36",
8882
- "@nocobase/utils": "1.9.36",
8879
+ "@nocobase/evaluators": "1.9.38",
8880
+ "@nocobase/sdk": "1.9.38",
8881
+ "@nocobase/utils": "1.9.38",
8883
8882
  ahooks: "^3.7.2",
8884
8883
  antd: "5.24.2",
8885
8884
  "antd-mobile": "^5.41.1",
@@ -8901,7 +8900,7 @@ const name = "@nocobase/client", version = "1.9.36", license = "AGPL-3.0", main
8901
8900
  "lru-cache": "6.0.0",
8902
8901
  "markdown-it": "14.1.0",
8903
8902
  "markdown-it-highlightjs": "3.3.1",
8904
- mathjs: "^10.6.0",
8903
+ mathjs: "^15.1.0",
8905
8904
  mermaid: "9.4.3",
8906
8905
  mime: "^4.0.4",
8907
8906
  "mime-match": "^1.0.2",
@@ -9915,93 +9914,93 @@ const SubFormProvider = (e) => {
9915
9914
  fieldSchema: n,
9916
9915
  parent: o
9917
9916
  };
9918
- }, useColumnSettings = (e) => {
9919
- const { t } = useTranslation(), n = `nocobase_table_column_settings_${e}`, o = useCallback(() => {
9917
+ }, TableUidContext = createContext(null), useColumnSettings = (e) => {
9918
+ const { t } = useTranslation(), n = useContext(TableUidContext), o = `nocobase_table_column_settings_${n}`, r = useCallback(() => {
9920
9919
  try {
9921
- const i = localStorage.getItem(n);
9922
- return i ? JSON.parse(i) : null;
9923
- } catch (i) {
9924
- return console.warn("Failed to parse table column settings from localStorage:", i), null;
9920
+ const l = localStorage.getItem(o);
9921
+ return l ? JSON.parse(l) : null;
9922
+ } catch (l) {
9923
+ return console.warn("Failed to parse table column settings from localStorage:", l), null;
9925
9924
  }
9926
- }, [n]), r = useCallback(
9927
- (i) => {
9925
+ }, [o]), a = useCallback(
9926
+ (l) => {
9928
9927
  try {
9929
- const l = JSON.stringify(i);
9930
- localStorage.setItem(n, l);
9931
- const c = new CustomEvent("nocobase-table-settings-changed", {
9928
+ const c = JSON.stringify(l);
9929
+ localStorage.setItem(o, c);
9930
+ const u = new CustomEvent("nocobase-table-settings-changed", {
9932
9931
  detail: {
9933
- key: n,
9934
- tableId: e,
9935
- settings: i
9932
+ key: o,
9933
+ tableId: n,
9934
+ settings: l
9936
9935
  }
9937
9936
  });
9938
- window.dispatchEvent(c);
9939
- } catch (l) {
9940
- console.warn("Failed to save table column settings to localStorage:", l), message.error(t("Failed to save table settings"));
9937
+ window.dispatchEvent(u);
9938
+ } catch (c) {
9939
+ console.warn("Failed to save table column settings to localStorage:", c), message.error(t("Failed to save table settings"));
9941
9940
  }
9942
9941
  },
9943
- [n, e, t]
9944
- ), a = useCallback(() => {
9942
+ [o, n, t]
9943
+ ), i = useCallback(() => {
9945
9944
  try {
9946
- localStorage.removeItem(n);
9947
- const i = new CustomEvent("nocobase-table-settings-changed", {
9945
+ localStorage.removeItem(o);
9946
+ const l = new CustomEvent("nocobase-table-settings-changed", {
9948
9947
  detail: {
9949
- key: n,
9950
- tableId: e,
9948
+ key: o,
9949
+ tableId: n,
9951
9950
  settings: null
9952
9951
  }
9953
9952
  });
9954
- window.dispatchEvent(i);
9955
- } catch (i) {
9956
- console.warn("Failed to clear table column settings from localStorage:", i), message.error(t("Failed to clear table settings"));
9953
+ window.dispatchEvent(l);
9954
+ } catch (l) {
9955
+ console.warn("Failed to clear table column settings from localStorage:", l), message.error(t("Failed to clear table settings"));
9957
9956
  }
9958
- }, [n, e, t]);
9957
+ }, [o, n, t]);
9959
9958
  return {
9960
- getSettings: o,
9961
- saveSettings: r,
9962
- clearSettings: a
9959
+ getSettings: r,
9960
+ saveSettings: a,
9961
+ clearSettings: i
9963
9962
  };
9964
9963
  }, useTableColumnIntegration = (e, t = !0) => {
9965
- const n = useFieldSchema(), o = (n == null ? void 0 : n["x-uid"]) || "default", { getSettings: r } = useColumnSettings(o), [a, i] = useState(0);
9964
+ const n = useContext(TableUidContext), { getSettings: o } = useColumnSettings(), [r, a] = useState(0);
9966
9965
  useEffect(() => {
9967
- const u = (d) => {
9968
- const { key: p, tableId: m } = d.detail;
9969
- (p.includes(o) || m === o) && i((h) => h + 1);
9966
+ const c = (u) => {
9967
+ const { key: d, tableId: p } = u.detail;
9968
+ (d.includes(n) || p === n) && a((m) => m + 1);
9970
9969
  };
9971
- return window.addEventListener("nocobase-table-settings-changed", u), () => {
9972
- window.removeEventListener("nocobase-table-settings-changed", u);
9970
+ return window.addEventListener("nocobase-table-settings-changed", c), () => {
9971
+ window.removeEventListener("nocobase-table-settings-changed", c);
9973
9972
  };
9974
- }, [o]);
9975
- const l = useMemo(() => r(), [r, a]);
9973
+ }, [n]);
9974
+ const i = useMemo(() => o(), [o, r]);
9976
9975
  return {
9977
9976
  columns: useMemo(() => {
9978
- if (!t || !l || l.length === 0)
9977
+ if (!t || !i || i.length === 0)
9979
9978
  return e;
9980
- const u = /* @__PURE__ */ new Map();
9981
- l.forEach((g) => {
9982
- u.set(g.key, g);
9979
+ const c = /* @__PURE__ */ new Map();
9980
+ i.forEach((h) => {
9981
+ c.set(h.key, h);
9983
9982
  });
9984
- const d = e.map((g) => {
9985
- const f = u.get(g.key);
9986
- if (f) {
9987
- const C = g.columnHidden || !f.visible, b = f.width || g.width, S = f.fixed || g.fixed;
9988
- return P(x({}, g), {
9989
- columnHidden: C,
9990
- fixed: S,
9991
- width: b,
9992
- _orderIndex: f.order
9983
+ const u = e.map((h) => {
9984
+ const g = c.get(h.key);
9985
+ if (g) {
9986
+ const f = h.columnHidden || !g.visible, C = g.width || h.width, b = g.fixed || h.fixed;
9987
+ return P(x({}, h), {
9988
+ columnHidden: f,
9989
+ fixed: b,
9990
+ width: C,
9991
+ _orderIndex: g.order
9993
9992
  });
9994
9993
  }
9995
- return g;
9996
- }), p = [], m = [];
9997
- d.forEach((g) => {
9998
- g._orderIndex !== void 0 ? p.push(g) : m.push(g);
9999
- }), p.sort((g, f) => (g._orderIndex || 0) - (f._orderIndex || 0));
10000
- const h = [...p, ...m];
10001
- return h.forEach((g) => {
10002
- delete g._orderIndex;
10003
- }), h;
10004
- }, [e, l])
9994
+ return h;
9995
+ }), d = [], p = [];
9996
+ u.forEach((h) => {
9997
+ h._orderIndex !== void 0 ? d.push(h) : p.push(h);
9998
+ }), d.sort((h, g) => (h._orderIndex || 0) - (g._orderIndex || 0));
9999
+ const m = [...d, ...p];
10000
+ return m.forEach((h) => {
10001
+ delete h._orderIndex;
10002
+ }), m;
10003
+ }, [e, i])
10005
10004
  };
10006
10005
  }, TableSkeleton = ({ rows: e = 5, columns: t = 6 }) => {
10007
10006
  const { token: n } = useToken$1(), o = n.controlHeight * 2.06, r = n.controlHeight * 1.75, a = useMemo(
@@ -10870,7 +10869,7 @@ const InternalTableBlockProvider = (e) => {
10870
10869
  else
10871
10870
  u = "__nochildren__";
10872
10871
  const d = useMemo(() => createForm(), [i]);
10873
- return c ? null : /* @__PURE__ */ jsx(SchemaComponentOptions, { scope: { treeTable: i }, children: /* @__PURE__ */ jsx(FormContext.Provider, { value: d, children: /* @__PURE__ */ jsx(BlockProvider, P(x({ name: e.name || "table" }, e), { params: l, runWhenParamsChanged: !0, children: /* @__PURE__ */ jsx(InternalTableBlockProvider, P(x({}, e), { childrenColumnName: u, params: l })) })) }) });
10872
+ return c ? null : /* @__PURE__ */ jsx(TableUidContext.Provider, { value: n["x-uid"], children: /* @__PURE__ */ jsx(SchemaComponentOptions, { scope: { treeTable: i }, children: /* @__PURE__ */ jsx(FormContext.Provider, { value: d, children: /* @__PURE__ */ jsx(BlockProvider, P(x({ name: e.name || "table" }, e), { params: l, runWhenParamsChanged: !0, children: /* @__PURE__ */ jsx(InternalTableBlockProvider, P(x({}, e), { childrenColumnName: u, params: l })) })) }) }) });
10874
10873
  }), useTableBlockContext = () => useContext(TableBlockContext), useTableBlockContextBasicValue = () => useContext(TableBlockContextBasicValue), NOOP = () => {
10875
10874
  }, CollectOperatorsContext = createContext(null), CollectOperators = (e) => {
10876
10875
  const t = useRef(e.defaultOperators || {}), n = useCallback((i, l) => {
@@ -30077,72 +30076,74 @@ const useCreateActionProps = () => {
30077
30076
  }, [e, t, n, o]);
30078
30077
  }, useEditTableActionProps = () => {
30079
30078
  const e = useField(), t = useFieldSchema(), n = useTableColumns$2(), o = useCallback(() => {
30080
- let g = t;
30081
- for (; g; ) {
30082
- const f = (b) => {
30083
- if (!(b != null && b.properties))
30079
+ let h = t;
30080
+ for (; h; ) {
30081
+ const g = (C) => {
30082
+ if (!(C != null && C.properties))
30084
30083
  return null;
30085
- for (const S in b.properties) {
30086
- const y = b.properties[S];
30087
- if (y["x-component"] === "TableV2")
30084
+ for (const b in C.properties) {
30085
+ const S = C.properties[b];
30086
+ if (S["x-component"] === "TableV2")
30087
+ return S;
30088
+ const y = g(S);
30089
+ if (y)
30088
30090
  return y;
30089
- const v = f(y);
30090
- if (v)
30091
- return v;
30092
30091
  }
30093
30092
  return null;
30094
- }, C = f(g);
30095
- if (C)
30096
- return C;
30097
- if (!g.parent)
30093
+ }, f = g(h);
30094
+ if (f)
30095
+ return f;
30096
+ if (!h.parent)
30098
30097
  break;
30099
- g = g.parent;
30098
+ h = h.parent;
30100
30099
  }
30101
- return g;
30102
- }, [t]), r = useMemo(() => o(), [o]), a = useMemo(() => (r == null ? void 0 : r["x-uid"]) || "default", [r]), { getSettings: i, saveSettings: l, clearSettings: c } = useColumnSettings(a), [u, d] = useState(i()), p = useMemo(() => {
30100
+ return h;
30101
+ }, [t]), r = useMemo(() => o(), [o]);
30102
+ useMemo(() => (r == null ? void 0 : r["x-uid"]) || "default", [r]);
30103
+ const { getSettings: a, saveSettings: i, clearSettings: l } = useColumnSettings(), [c, u] = useState(a()), d = useMemo(() => {
30103
30104
  if (n.length === 0)
30104
30105
  return [];
30105
- if (!u || u.length === 0)
30106
+ if (!c || c.length === 0)
30106
30107
  return n;
30107
- const g = /* @__PURE__ */ new Map();
30108
- return u.forEach((C) => {
30109
- g.set(C.key, C);
30110
- }), n.map((C) => {
30111
- const b = g.get(C.key);
30112
- return b ? P(x({}, C), {
30113
- visible: b.visible,
30114
- order: b.order,
30115
- width: b.width || C.width,
30116
- fixed: b.fixed || C.fixed
30117
- }) : C;
30118
- }).sort((C, b) => (C.order || 0) - (b.order || 0));
30119
- }, [n, u]);
30108
+ const h = /* @__PURE__ */ new Map();
30109
+ return c.forEach((f) => {
30110
+ h.set(f.key, f);
30111
+ }), n.map((f) => {
30112
+ const C = h.get(f.key);
30113
+ return C ? P(x({}, f), {
30114
+ visible: C.visible,
30115
+ order: C.order,
30116
+ width: C.width || f.width,
30117
+ fixed: C.fixed || f.fixed
30118
+ }) : f;
30119
+ }).sort((f, C) => (f.order || 0) - (C.order || 0));
30120
+ }, [n, c]);
30120
30121
  useEffect(() => {
30121
- p.length > 0 && (e.dataSource = p);
30122
- }, [p, e]);
30123
- const m = useCallback(
30124
- (g) => {
30125
- if (!(g != null && g.columns) || !Array.isArray(g.columns))
30122
+ d.length > 0 && (e.dataSource = d);
30123
+ }, [d, e]);
30124
+ const p = useCallback(
30125
+ (h) => {
30126
+ if (!(h != null && h.columns) || !Array.isArray(h.columns))
30126
30127
  return;
30127
- const f = g.columns.map((C, b) => ({
30128
- key: C.key,
30129
- title: C.title,
30130
- dataIndex: C.dataIndex,
30131
- visible: C.visible,
30132
- fixed: C.fixed,
30133
- width: C.width,
30134
- order: b
30128
+ const g = h.columns.map((f, C) => ({
30129
+ key: f.key,
30130
+ title: f.title,
30131
+ dataIndex: f.dataIndex,
30132
+ visible: f.visible,
30133
+ fixed: f.fixed,
30134
+ width: f.width,
30135
+ order: C
30135
30136
  }));
30136
- l(f);
30137
+ i(g);
30137
30138
  },
30138
- [l]
30139
- ), h = useCallback(() => {
30140
- c(), d(i());
30141
- }, [c]);
30139
+ [i]
30140
+ ), m = useCallback(() => {
30141
+ l(), u(a());
30142
+ }, [l]);
30142
30143
  return {
30143
- columns: p,
30144
- onSubmit: m,
30145
- onReset: h
30144
+ columns: d,
30145
+ onSubmit: p,
30146
+ onReset: m
30146
30147
  };
30147
30148
  }, useDetailsPaginationProps = () => {
30148
30149
  var r, a, i, l, c, u, d, p, m, h, g, f, C, b, S, y, v;
@@ -33050,7 +33051,7 @@ const createSubmitActionSettings = new SchemaSettings({
33050
33051
  l
33051
33052
  )) && d.push(!0), t.stateOfLinkageRules = P(x({}, t.stateOfLinkageRules), {
33052
33053
  disabled: d
33053
- }), t.disabled = last(d), t.componentProps.disabled = last(d);
33054
+ }), t.data = t.data || {}, t.data.disabled = last(d), t.componentProps.disabled = last(d);
33054
33055
  break;
33055
33056
  case ActionType.Active:
33056
33057
  (yield conditionAnalyses(
@@ -33058,13 +33059,13 @@ const createSubmitActionSettings = new SchemaSettings({
33058
33059
  l
33059
33060
  )) ? d.push(!1) : d.push(!!((g = t.componentProps) != null && g.disabled)), t.stateOfLinkageRules = P(x({}, t.stateOfLinkageRules), {
33060
33061
  disabled: d
33061
- }), t.disabled = last(d), t.componentProps.disabled = last(d);
33062
+ }), t.data = t.data || {}, t.data.disabled = last(d), t.componentProps.disabled = last(d);
33062
33063
  break;
33063
33064
  default:
33064
33065
  return null;
33065
33066
  }
33066
33067
  }), setInitialActionState = (e) => {
33067
- e.data = e.data || {}, e.display = "visible", e.disabled = !1, e.data.hidden = !1, e.componentProps.disabled = !1;
33068
+ e.data = e.data || {}, e.display = "visible", e.data.hidden = !1, e.data.disabled = !1, e.componentProps.disabled = !1;
33068
33069
  }, MenuGroup = (e) => e.children;
33069
33070
  function ButtonEditor$1(e) {
33070
33071
  var i, l, c, u, d;
@@ -40369,7 +40370,7 @@ const ActionLink = withDynamicSchemaProps(
40369
40370
  element: Z,
40370
40371
  disabled: Q,
40371
40372
  loading: ne
40372
- } = (F == null ? void 0 : F(w)) || {}, ee = Y.disabled || a.disabled || ((he = a.data) == null ? void 0 : he.disabled) || I || Q, re = useMemo(() => {
40373
+ } = (F == null ? void 0 : F(w)) || {}, ee = Y.disabled || ((he = a.data) == null ? void 0 : he.disabled) || I || Q, re = useMemo(() => {
40373
40374
  var fe;
40374
40375
  return P(x({}, v), {
40375
40376
  opacity: r && (((fe = a == null ? void 0 : a.data) == null ? void 0 : fe.hidden) || !X) && 0.1,
@@ -40511,23 +40512,23 @@ const RenderButton = ({
40511
40512
  localVariables: $
40512
40513
  }, L = useCallback(
40513
40514
  (G, H = !0) => q(void 0, null, function* () {
40514
- var Y;
40515
+ var Y, X;
40515
40516
  if (H && isPortalInBody(G.target))
40516
40517
  return;
40517
40518
  G.preventDefault(), G.stopPropagation();
40518
40519
  const U = yield getVariableValue(M(F == null ? void 0 : F.title, { title: E(y.title) }), V), K = yield getVariableValue(M(F == null ? void 0 : F.content, { title: E(y.title) }), V);
40519
40520
  if (!a && n) {
40520
- const X = () => {
40521
+ const J = () => {
40521
40522
  b ? b(G, () => {
40522
- var J, Z;
40523
- S !== !1 && (T == null || T(!0), (Z = (J = N()) == null ? void 0 : J.refresh) == null || Z.call(J));
40523
+ var Z, Q;
40524
+ S !== !1 && (T == null || T(!0), (Q = (Z = N()) == null ? void 0 : Z.refresh) == null || Q.call(Z));
40524
40525
  }) : isBulkEditAction(y) || !j() ? (v(!0), I == null || I()) : ["view", "update", "create", "customize:popup"].includes(y["x-action"]) && y["x-uid"] ? A.current() : (v(!0), I == null || I());
40525
40526
  };
40526
- (F == null ? void 0 : F.enable) !== !1 && (F != null && F.content) ? (yield (Y = z == null ? void 0 : z.submit) == null ? void 0 : Y.call(z), w.confirm({
40527
+ (F == null ? void 0 : F.enable) !== !1 && (F != null && F.content) ? ((Y = y == null ? void 0 : y["x-action-settings"]) != null && Y.skipValidator || (yield (X = z == null ? void 0 : z.submit) == null ? void 0 : X.call(z)), w.confirm({
40527
40528
  title: M(U, { title: D || B || (t == null ? void 0 : t.title) }),
40528
40529
  content: M(K, { title: D || B || (t == null ? void 0 : t.title) }),
40529
- onOk: X
40530
- })) : X();
40530
+ onOk: J
40531
+ })) : J();
40531
40532
  }
40532
40533
  }),
40533
40534
  [
@@ -43991,7 +43992,7 @@ const InternalAssociationSelect$1 = observer$1(
43991
43992
  A.push(R), f.setValuesIn(r.path, A), r.onInput(A);
43992
43993
  } else
43993
43994
  f.setValuesIn(r.path, R), r.onInput(R);
43994
- isFunction$1(j) && (j == null || j()), message.success(h("Saved successfully"));
43995
+ isFunction(j) && (j == null || j()), message.success(h("Saved successfully"));
43995
43996
  }
43996
43997
  }), T = (N) => /* @__PURE__ */ jsxs(
43997
43998
  "div",
@@ -45126,7 +45127,9 @@ const InternalFileManager = (e) => {
45126
45127
  }));
45127
45128
  i(O);
45128
45129
  }
45129
- }, []);
45130
+ }, []), useEffect(() => {
45131
+ r || i([{ key: void 0, children: [], value: null }]);
45132
+ }, [r]);
45130
45133
  const w = useCallback(
45131
45134
  (j) => {
45132
45135
  try {
@@ -45225,43 +45228,49 @@ const InternalFileManager = (e) => {
45225
45228
  }) });
45226
45229
  }), AssociationCascadeSelect = connect((e) => /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(CascadeSelect, x({}, e)) })), InternalCascadeSelect = observer$1(
45227
45230
  (e) => {
45228
- const { options: t } = useAssociationFieldContext(), n = useMemo(() => createForm(), []), { t: o } = useTranslation(), r = useField(), a = useFieldSchema(), { loading: i, data: l } = useDataBlockRequest() || {}, c = useMemo(() => {
45229
- var g;
45230
- return (g = l == null ? void 0 : l.data) == null ? void 0 : g[a.name];
45231
- }, [i]), u = !l || a.name in ((l == null ? void 0 : l.data) || {}), d = debounce((g) => {
45232
- var f, C;
45231
+ var f;
45232
+ const { options: t } = useAssociationFieldContext(), n = useMemo(() => createForm(), []), { t: o } = useTranslation(), r = useField(), a = useForm(), i = useFieldSchema(), { loading: l, data: c } = useDataBlockRequest() || {}, u = useMemo(() => {
45233
+ var C;
45234
+ return (C = c == null ? void 0 : c.data) == null ? void 0 : C[i.name];
45235
+ }, [l]), d = !c || i.name in ((c == null ? void 0 : c.data) || {}), p = debounce((C) => {
45236
+ var b, S;
45233
45237
  if (t.interface === "m2o") {
45234
- const b = extractLastNonNullValueObjects((f = g.values) == null ? void 0 : f[a.name]);
45238
+ const y = extractLastNonNullValueObjects((b = C.values) == null ? void 0 : b[i.name]);
45235
45239
  setTimeout(() => {
45236
- g.setValuesIn(a.name, b), r.value = b;
45240
+ C.setValuesIn(i.name, y), r.value = y;
45237
45241
  });
45238
45242
  } else {
45239
- const b = extractLastNonNullValueObjects((C = g.values) == null ? void 0 : C.select_array).filter(
45240
- (S) => S && Object.keys(S).length > 0
45243
+ const y = extractLastNonNullValueObjects(((S = C.values) == null ? void 0 : S.select_array) || []).filter(
45244
+ (v) => v && Object.keys(v).length > 0
45241
45245
  );
45242
45246
  setTimeout(() => {
45243
- r.value = b;
45247
+ r.value = y;
45244
45248
  });
45245
45249
  }
45246
45250
  }, 300);
45247
45251
  useEffect(() => {
45248
- const g = uid();
45249
- return n.addEffects(g, () => {
45250
- onFormValuesChange((f) => {
45251
- d(f);
45252
+ const C = uid();
45253
+ return n.addEffects(C, () => {
45254
+ onFormValuesChange((b) => {
45255
+ p(b);
45252
45256
  });
45253
45257
  }), () => {
45254
- n.removeEffects(g), d.cancel();
45258
+ n.removeEffects(C), p.cancel();
45255
45259
  };
45256
- }, []);
45257
- const h = {
45260
+ }, []), useEffect(() => {
45261
+ var C, b;
45262
+ (C = a.values) != null && C[i.name] || (n && n.values.select_array && !((b = a.values) != null && b[i.name]) ? (n.setValuesIn("select_array", void 0), setTimeout(() => {
45263
+ n.setValuesIn("select_array", [{}]);
45264
+ })) : n.reset());
45265
+ }, [(f = a.values) == null ? void 0 : f[i.name]]);
45266
+ const g = {
45258
45267
  type: "object",
45259
45268
  properties: {
45260
45269
  select_array: {
45261
45270
  type: "array",
45262
45271
  "x-component": "ArrayItems",
45263
45272
  "x-decorator": "FormItem",
45264
- default: Array.isArray(c) && c.length > 0 ? c : [{}],
45273
+ default: Array.isArray(u) && u.length > 0 ? u : [{}],
45265
45274
  items: {
45266
45275
  type: "void",
45267
45276
  "x-component": "Space",
@@ -45312,18 +45321,18 @@ const InternalFileManager = (e) => {
45312
45321
  }
45313
45322
  }
45314
45323
  };
45315
- return !i && u && /* @__PURE__ */ jsx(FormProvider$1, { form: n, children: t.interface === "m2o" ? /* @__PURE__ */ jsx(
45324
+ return !l && d && /* @__PURE__ */ jsx(FormProvider$1, { form: n, children: t.interface === "m2o" ? /* @__PURE__ */ jsx(
45316
45325
  SchemaComponent,
45317
45326
  {
45318
45327
  components: { FormItem: FormItem$1 },
45319
- schema: P(x({}, a), {
45320
- default: c,
45328
+ schema: P(x({}, i), {
45329
+ default: u,
45321
45330
  title: "",
45322
45331
  "x-component": AssociationCascadeSelect,
45323
45332
  "x-component-props": x({}, e)
45324
45333
  })
45325
45334
  }
45326
- ) : /* @__PURE__ */ jsx(SchemaField, { schema: h }) });
45335
+ ) : /* @__PURE__ */ jsx(SchemaField, { schema: g }) });
45327
45336
  },
45328
45337
  { displayName: "InternalCascadeSelect" }
45329
45338
  );
@@ -55659,7 +55668,10 @@ const supportTypes = ["string", "bigInt", "integer", "uuid", "uid", "nanoid"], S
55659
55668
  }, OverridingCollectionField = (e) => {
55660
55669
  const t = useRecord(), n = useCollectionParentRecordData();
55661
55670
  return /* @__PURE__ */ jsx(OverridingFieldAction, x({ item: t, parentItem: n }, e));
55662
- }, getIsOverriding = (e, t, n) => t.find((r) => r.name === n.name).collectionName === e, OverridingFieldAction = (e) => {
55671
+ }, getIsOverriding = (e, t, n) => {
55672
+ const o = t.find((r) => r.name === n.name);
55673
+ return (o == null ? void 0 : o.collectionName) === e;
55674
+ }, OverridingFieldAction = (e) => {
55663
55675
  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) => {
55664
55676
  var O;
55665
55677
  return j && ((O = m(j)) == null ? void 0 : O.map(($) => $.name).concat([j]));
@@ -56040,6 +56052,9 @@ const getSchema$4 = (e, t, n) => {
56040
56052
  [uid()]: {
56041
56053
  type: "void",
56042
56054
  "x-component": "Action.Drawer",
56055
+ "x-component-props": {
56056
+ getContainer: o
56057
+ },
56043
56058
  "x-decorator": "Form",
56044
56059
  "x-decorator-props": {
56045
56060
  useValues: "{{ useValuesFromRecord }}"
@@ -56084,11 +56099,14 @@ const getSchema$4 = (e, t, n) => {
56084
56099
  };
56085
56100
  }, useValuesFromRecord = (e) => {
56086
56101
  const t = useRecord(), n = useRequest(
56087
- () => Promise.resolve({
56088
- data: P(x({}, omit$1(cloneDeep(t), ["__parent", "__collectionName"])), {
56089
- category: t == null ? void 0 : t.category.map((r) => r.id)
56090
- })
56091
- }),
56102
+ () => {
56103
+ var r;
56104
+ return Promise.resolve({
56105
+ data: P(x({}, omit$1(cloneDeep(t), ["__parent", "__collectionName"])), {
56106
+ category: (r = t == null ? void 0 : t.category) == null ? void 0 : r.map((a) => a.id)
56107
+ })
56108
+ });
56109
+ },
56092
56110
  P(x({}, e), {
56093
56111
  manual: !0
56094
56112
  })
@@ -56121,7 +56139,8 @@ const getSchema$4 = (e, t, n) => {
56121
56139
  const g = i(o.template), f = getSchema$3(
56122
56140
  x({}, g),
56123
56141
  o,
56124
- m
56142
+ m,
56143
+ n
56125
56144
  );
56126
56145
  d(f), c(!0);
56127
56146
  }),
@@ -61253,28 +61272,36 @@ class CollectionPlugin extends Plugin {
61253
61272
  addFieldInterfaceGroups() {
61254
61273
  this.dataSourceManager.addFieldInterfaceGroups({
61255
61274
  basic: {
61256
- label: '{{t("Basic")}}'
61275
+ label: '{{t("Basic")}}',
61276
+ order: 1
61257
61277
  },
61258
61278
  choices: {
61259
- label: '{{t("Choices")}}'
61279
+ label: '{{t("Choices")}}',
61280
+ order: 20
61260
61281
  },
61261
61282
  media: {
61262
- label: '{{t("Media")}}'
61283
+ label: '{{t("Media")}}',
61284
+ order: 40
61263
61285
  },
61264
61286
  datetime: {
61265
- label: '{{t("Date & Time")}}'
61287
+ label: '{{t("Date & Time")}}',
61288
+ order: 80
61266
61289
  },
61267
61290
  relation: {
61268
- label: '{{t("Relation")}}'
61291
+ label: '{{t("Relation")}}',
61292
+ order: 100
61269
61293
  },
61270
61294
  advanced: {
61271
- label: '{{t("Advanced type")}}'
61295
+ label: '{{t("Advanced type")}}',
61296
+ order: 200
61272
61297
  },
61273
61298
  systemInfo: {
61274
- label: '{{t("System info")}}'
61299
+ label: '{{t("System info")}}',
61300
+ order: 400
61275
61301
  },
61276
61302
  others: {
61277
- label: '{{t("Others")}}'
61303
+ label: '{{t("Others")}}',
61304
+ order: 800
61278
61305
  }
61279
61306
  });
61280
61307
  }
@@ -70501,7 +70528,7 @@ export {
70501
70528
  createReadPrettyFormBlockSchema,
70502
70529
  createRouterManager,
70503
70530
  createSelectSchemaSettingsItem,
70504
- wn as createStyles,
70531
+ Rn as createStyles,
70505
70532
  createSwitchSettingsItem,
70506
70533
  createTableBlockSchema,
70507
70534
  createTableBlockUISchema,