@nocobase/client 2.0.32 → 2.0.33

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
@@ -3816,6 +3816,12 @@ const bp = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3816
3816
  get getRenderContent() {
3817
3817
  return getRenderContent;
3818
3818
  },
3819
+ get getSchemaSettingsConfirmZIndex() {
3820
+ return getSchemaSettingsConfirmZIndex;
3821
+ },
3822
+ get getSchemaSettingsDialogZIndex() {
3823
+ return getSchemaSettingsDialogZIndex;
3824
+ },
3819
3825
  get getShouldChange() {
3820
3826
  return getShouldChange;
3821
3827
  },
@@ -9967,7 +9973,7 @@ function addAppVersion(e, t) {
9967
9973
  addAppVersion((n = e.properties) == null ? void 0 : n[o], t);
9968
9974
  }), e;
9969
9975
  }
9970
- const name = "@nocobase/client", version = "2.0.32", license = "Apache-2.0", main = "lib/index.js", module = "es/index.mjs", types = "es/index.d.ts", dependencies = {
9976
+ const name = "@nocobase/client", version = "2.0.33", license = "Apache-2.0", main = "lib/index.js", module = "es/index.mjs", types = "es/index.d.ts", dependencies = {
9971
9977
  "@ahooksjs/use-url-state": "3.5.1",
9972
9978
  "@ant-design/cssinjs": "^1.11.1",
9973
9979
  "@ant-design/icons": "^5.6.1",
@@ -9990,10 +9996,10 @@ const name = "@nocobase/client", version = "2.0.32", license = "Apache-2.0", mai
9990
9996
  "@formily/reactive-react": "^2.2.27",
9991
9997
  "@formily/shared": "^2.2.27",
9992
9998
  "@formily/validator": "^2.2.27",
9993
- "@nocobase/evaluators": "2.0.32",
9994
- "@nocobase/flow-engine": "2.0.32",
9995
- "@nocobase/sdk": "2.0.32",
9996
- "@nocobase/utils": "2.0.32",
9999
+ "@nocobase/evaluators": "2.0.33",
10000
+ "@nocobase/flow-engine": "2.0.33",
10001
+ "@nocobase/sdk": "2.0.33",
10002
+ "@nocobase/utils": "2.0.33",
9997
10003
  "@tanstack/react-table": "^8.21.3",
9998
10004
  "@types/tabulator-tables": "^6.2.6",
9999
10005
  "acorn-jsx": "^5.3.2",
@@ -23220,8 +23226,8 @@ const findGridSchema = (e) => e.reduceProperties((t, o) => {
23220
23226
  type: "divider"
23221
23227
  };
23222
23228
  return t(n), null;
23223
- }, SchemaSettingsRemove = (e) => {
23224
- const { disabled: t, confirm: o, title: n, removeParentsIfNoChildren: r, breakRemoveOn: i } = e, { dn: a, template: l } = useSchemaSettings(), { t: c } = useTranslation(), u = useField(), d = useCompile(), p = useFieldSchema(), m = useBlockTemplateContext(), h = useForm(), { modal: g } = App.useApp(), { removeActiveFieldName: f } = useFormActiveFields() || {}, { removeDataBlock: y } = useFilterBlock();
23229
+ }, getSchemaSettingsDialogZIndex = (e) => Math.max(getZIndex("modal", e + 10, 0), ICON_POPUP_Z_INDEX + 200), getSchemaSettingsConfirmZIndex = (e) => Math.max(getZIndex("modal", e, 1), 1e3), SchemaSettingsRemove = (e) => {
23230
+ const { disabled: t, confirm: o, title: n, removeParentsIfNoChildren: r, breakRemoveOn: i } = e, { dn: a, template: l } = useSchemaSettings(), { t: c } = useTranslation(), u = useField(), d = useCompile(), p = useFieldSchema(), m = useBlockTemplateContext(), h = useForm(), { modal: g } = App.useApp(), { removeActiveFieldName: f } = useFormActiveFields() || {}, { removeDataBlock: y } = useFilterBlock(), b = useZIndexContext(), S = getSchemaSettingsConfirmZIndex(b);
23225
23231
  return /* @__PURE__ */ jsx(
23226
23232
  SchemaSettingsItem,
23227
23233
  {
@@ -23231,18 +23237,19 @@ const findGridSchema = (e) => e.reduceProperties((t, o) => {
23231
23237
  onClick: () => {
23232
23238
  g.confirm(A(x({
23233
23239
  title: n ? d(n) : c("Delete block"),
23234
- content: c("Are you sure you want to delete it?")
23240
+ content: c("Are you sure you want to delete it?"),
23241
+ zIndex: S
23235
23242
  }, o), {
23236
23243
  onOk() {
23237
23244
  return L(this, null, function* () {
23238
- var C;
23239
- const S = {
23245
+ var P;
23246
+ const F = {
23240
23247
  removeParentsIfNoChildren: r,
23241
23248
  breakRemoveOn: i
23242
23249
  };
23243
- u != null && u.required && (u.required = !1, p.required = !1), l && l.uid === p["x-uid"] && (m != null && m.dn) ? yield m == null ? void 0 : m.dn.remove(null, S) : yield a.remove(null, S), yield (C = o == null ? void 0 : o.onOk) == null ? void 0 : C.call(o), delete h.values[p.name], a.refresh({ refreshParentSchema: !0 }), f == null || f(p.name), h == null || h.query(new RegExp(`${p.parent.name}.${p.name}$`)).forEach((F) => {
23244
- var P, v;
23245
- (P = F.setValue) == null || P.call(F, void 0), (v = F.setInitialValue) == null || v.call(F, void 0);
23250
+ u != null && u.required && (u.required = !1, p.required = !1), l && l.uid === p["x-uid"] && (m != null && m.dn) ? yield m == null ? void 0 : m.dn.remove(null, F) : yield a.remove(null, F), yield (P = o == null ? void 0 : o.onOk) == null ? void 0 : P.call(o), delete h.values[p.name], a.refresh({ refreshParentSchema: !0 }), f == null || f(p.name), h == null || h.query(new RegExp(`${p.parent.name}.${p.name}$`)).forEach((v) => {
23251
+ var k, I;
23252
+ (k = v.setValue) == null || k.call(v, void 0), (I = v.setInitialValue) == null || I.call(v, void 0);
23246
23253
  }), y(p["x-uid"]);
23247
23254
  });
23248
23255
  }
@@ -23398,7 +23405,7 @@ const SchemaSettingsSwitchItem = (e) => {
23398
23405
  });
23399
23406
  SchemaSettingsActionModalItem.displayName = "SchemaSettingsActionModalItem";
23400
23407
  const SchemaSettingsModalItem = (e) => {
23401
- const G = e, {
23408
+ const X = e, {
23402
23409
  hidden: t,
23403
23410
  title: o,
23404
23411
  components: n,
@@ -23409,9 +23416,9 @@ const SchemaSettingsModalItem = (e) => {
23409
23416
  initialValues: c,
23410
23417
  width: u = "fit-content",
23411
23418
  noRecord: d = !1,
23412
- ModalContextProvider: p = (W) => /* @__PURE__ */ jsx(Fragment$1, { children: W.children }),
23419
+ ModalContextProvider: p = (Q) => /* @__PURE__ */ jsx(Fragment$1, { children: Q.children }),
23413
23420
  dialogRootClassName: m
23414
- } = G, h = ee(G, [
23421
+ } = X, h = ee(X, [
23415
23422
  "hidden",
23416
23423
  "title",
23417
23424
  "components",
@@ -23424,34 +23431,35 @@ const SchemaSettingsModalItem = (e) => {
23424
23431
  "noRecord",
23425
23432
  "ModalContextProvider",
23426
23433
  "dialogRootClassName"
23427
- ]), g = useContext(SchemaOptionsContext), f = useCollection(), y = useAPIClient(), b = useApp(), { theme: S } = useGlobalTheme(), C = useBlockRequestContext(), F = useFormActiveFields(), { locale: P } = useContext(ConfigProvider.ConfigContext), v = useDataSourceManager(), k = useDataSourceKey(), I = useCollectionRecord(), { association: M } = useDataBlockProps() || {}, E = useCurrentRecord(), $ = useFormBlockContext(), D = useBlockContext(), { getOperators: T } = useOperators(), w = useLocationSearch(), B = useVariables$1(), N = useContext(AllDataBlocksContext), j = useContext(SchemaComponentContext), O = useContext(VariableScopeContext$1), { formValue: q, collection: V, parent: z } = useSubFormValue(), U = useCurrentPopupRecord(), K = useParentPopupRecord();
23434
+ ]), g = useContext(SchemaOptionsContext), f = useCollection(), y = useAPIClient(), b = useApp(), { theme: S } = useGlobalTheme(), C = useBlockRequestContext(), F = useFormActiveFields(), { locale: P } = useContext(ConfigProvider.ConfigContext), v = useDataSourceManager(), k = useDataSourceKey(), I = useCollectionRecord(), { association: M } = useDataBlockProps() || {}, E = useCurrentRecord(), $ = useFormBlockContext(), D = useBlockContext(), { getOperators: T } = useOperators(), w = useLocationSearch(), B = useVariables$1(), N = useContext(AllDataBlocksContext), j = useContext(SchemaComponentContext), O = useContext(VariableScopeContext$1), q = useZIndexContext(), V = getSchemaSettingsDialogZIndex(q), { formValue: z, collection: U, parent: K } = useSubFormValue(), G = useCurrentPopupRecord(), W = useParentPopupRecord();
23428
23435
  return t ? null : /* @__PURE__ */ jsx(
23429
23436
  SchemaSettingsItem,
23430
23437
  A(x({
23431
23438
  title: o
23432
23439
  }, h), {
23433
23440
  onClick: () => L(void 0, null, function* () {
23434
- const W = l ? yield l() : c, X = _.isFunction(e.schema) ? e.schema() : e.schema;
23441
+ const Q = l ? yield l() : c, J = _.isFunction(e.schema) ? e.schema() : e.schema;
23435
23442
  FormDialog(
23436
23443
  {
23437
- title: X.title || o,
23444
+ title: J.title || o,
23438
23445
  width: u,
23439
23446
  rootClassName: m,
23440
- getContainer: () => document.body
23447
+ getContainer: () => document.body,
23448
+ zIndex: V
23441
23449
  },
23442
23450
  () => /* @__PURE__ */ jsx(VariableScopeContext$1.Provider, { value: O, children: /* @__PURE__ */ jsx(SchemaComponentContext.Provider, { value: j, children: /* @__PURE__ */ jsx(AllDataBlocksContext.Provider, { value: N, children: /* @__PURE__ */ jsx(p, { children: /* @__PURE__ */ jsx(CollectOperators, { defaultOperators: T(), children: /* @__PURE__ */ jsx(VariablesContext.Provider, { value: B, children: /* @__PURE__ */ jsx(BlockContext.Provider, { value: D, children: /* @__PURE__ */ jsx(
23443
23451
  VariablePopupRecordProvider,
23444
23452
  {
23445
- recordData: U == null ? void 0 : U.value,
23446
- collection: U == null ? void 0 : U.collection,
23453
+ recordData: G == null ? void 0 : G.value,
23454
+ collection: G == null ? void 0 : G.collection,
23447
23455
  parent: {
23448
- recordData: K == null ? void 0 : K.value,
23449
- collection: K == null ? void 0 : K.collection
23456
+ recordData: W == null ? void 0 : W.value,
23457
+ collection: W == null ? void 0 : W.collection
23450
23458
  },
23451
23459
  children: /* @__PURE__ */ jsx(CollectionRecordProvider, { record: d ? null : I, children: /* @__PURE__ */ jsx(CurrentRecordContextProvider, A(x({}, E), { children: /* @__PURE__ */ jsx(FormBlockContext$1.Provider, { value: $, children: /* @__PURE__ */ jsx(
23452
23460
  SubFormProvider,
23453
23461
  {
23454
- value: { value: q, collection: V, parent: z },
23462
+ value: { value: z, collection: U, parent: K },
23455
23463
  children: /* @__PURE__ */ jsx(
23456
23464
  FormActiveFieldsProvider,
23457
23465
  {
@@ -23488,12 +23496,12 @@ const SchemaSettingsModalItem = (e) => {
23488
23496
  min-width: 320px;
23489
23497
  }
23490
23498
  `,
23491
- children: /* @__PURE__ */ jsx(ApplicationContext.Provider, { value: b, children: /* @__PURE__ */ jsx(APIClientProvider, { apiClient: y, children: /* @__PURE__ */ jsx(ConfigProvider, { locale: P, children: /* @__PURE__ */ jsx(zIndexContext.Provider, { value: ICON_POPUP_Z_INDEX, children: /* @__PURE__ */ jsx(
23499
+ children: /* @__PURE__ */ jsx(ApplicationContext.Provider, { value: b, children: /* @__PURE__ */ jsx(APIClientProvider, { apiClient: y, children: /* @__PURE__ */ jsx(ConfigProvider, { locale: P, children: /* @__PURE__ */ jsx(zIndexContext.Provider, { value: V, children: /* @__PURE__ */ jsx(
23492
23500
  SchemaComponent,
23493
23501
  {
23494
23502
  components: n,
23495
23503
  scope: r,
23496
- schema: X
23504
+ schema: J
23497
23505
  }
23498
23506
  ) }) }) }) })
23499
23507
  }
@@ -23512,10 +23520,10 @@ const SchemaSettingsModalItem = (e) => {
23512
23520
  ) }) }) }) }) }) }) }),
23513
23521
  S
23514
23522
  ).open({
23515
- initialValues: W,
23523
+ initialValues: Q,
23516
23524
  effects: i
23517
- }).then((Q) => (a(Q), Q)).catch((Q) => {
23518
- console.error(Q);
23525
+ }).then((Z) => (a(Z), Z)).catch((Z) => {
23526
+ console.error(Z);
23519
23527
  });
23520
23528
  }),
23521
23529
  children: e.children || e.title
@@ -30633,7 +30641,7 @@ const useStyles$a = genStyleHook("nb-markdown", (e, { isDarkTheme: t }) => {
30633
30641
  }, t ? i : r)
30634
30642
  };
30635
30643
  }), parseMarkdown$1 = _.memoize((e) => L(void 0, null, function* () {
30636
- return e && (yield import("./md-oH2RssNY.mjs")).default.render(e);
30644
+ return e && (yield import("./md-BbvRKckr.mjs")).default.render(e);
30637
30645
  }));
30638
30646
  function useParseMarkdown$1(e) {
30639
30647
  const [t, o] = useState(""), [n, r] = useState(!0);
@@ -72046,7 +72054,7 @@ BlockGridModel.registerFlow({
72046
72054
  }
72047
72055
  });
72048
72056
  const parseMarkdown = _.memoize((e) => L(void 0, null, function* () {
72049
- return e && (yield import("./md-BbvRKckr.mjs")).default.render(e);
72057
+ return e && (yield import("./md-oH2RssNY.mjs")).default.render(e);
72050
72058
  }));
72051
72059
  function useParseMarkdown(e) {
72052
72060
  const [t, o] = useState(""), [n, r] = useState(!0);
@@ -79808,24 +79816,24 @@ function omitHiddenModelValuesFromSubmit(e, t) {
79808
79816
  }
79809
79817
  function submitHandler(e, t, o) {
79810
79818
  return L(this, null, function* () {
79811
- var c, u;
79819
+ var c, u, d;
79812
79820
  const n = e.resource, r = e.blockModel, i = e != null && e.flowSettingsEnabled ? getValidationNamePathsExcludingHiddenModels(r) : null;
79813
79821
  Array.isArray(i) ? i.length && (yield r.form.validateFields(i)) : yield r.form.validateFields();
79814
79822
  const a = r.form.getFieldsValue(!0), l = omitHiddenModelValuesFromSubmit(a, r);
79815
79823
  if (n instanceof SingleRecordResource) {
79816
79824
  if (r instanceof EditFormModel) {
79817
- const p = n.getMeta("currentFilterByTk");
79818
- p ? n.setFilterByTk(p) : n.isNewRecord = !0;
79825
+ const m = n.getMeta("currentFilterByTk");
79826
+ m ? n.setFilterByTk(m) : n.isNewRecord = !0;
79819
79827
  }
79820
- const d = o ? yield o(l) : yield n.save(l, t.requestConfig);
79821
- r instanceof EditFormModel ? (n.isNewRecord = !1, (c = r.resetUserModifiedFields) == null || c.call(r), yield n.refresh()) : (r.form.resetFields(), (u = r.resetUserModifiedFields) == null || u.call(r), r.emitter.emit("onFieldReset"), e.view.inputArgs.collectionName === r.collection.name && e.view.inputArgs.onChange && e.view.inputArgs.onChange(d == null ? void 0 : d.data));
79828
+ const p = o ? yield o(l) : yield n.save(l, t.requestConfig);
79829
+ r instanceof EditFormModel ? (n.isNewRecord = !1, (c = r.resetUserModifiedFields) == null || c.call(r), yield n.refresh()) : (r.form.resetFields(), r.emitter.emit("onFieldReset"), (u = r.resetUserModifiedFields) == null || u.call(r), e.view.inputArgs.collectionName === r.collection.name && e.view.inputArgs.onChange && e.view.inputArgs.onChange(p == null ? void 0 : p.data));
79822
79830
  } else if (n instanceof MultiRecordResource) {
79823
- const d = n.getMeta("currentFilterByTk");
79824
- if (!d) {
79831
+ const p = n.getMeta("currentFilterByTk");
79832
+ if (!p) {
79825
79833
  e.message.error(e.t("No filterByTk found for multi-record resource."));
79826
79834
  return;
79827
79835
  }
79828
- (yield o) ? yield o(l, d) : yield n.update(d, l, t.requestConfig);
79836
+ (yield o) ? yield o(l, p) : yield n.update(p, l, t.requestConfig), (d = r.resetUserModifiedFields) == null || d.call(r);
79829
79837
  }
79830
79838
  });
79831
79839
  }
@@ -108720,6 +108728,8 @@ export {
108720
108728
  getPageSchema,
108721
108729
  getPopupPathFromParams,
108722
108730
  getRenderContent,
108731
+ getSchemaSettingsConfirmZIndex,
108732
+ getSchemaSettingsDialogZIndex,
108723
108733
  getShouldChange,
108724
108734
  getSimpleModePaginationClassName,
108725
108735
  getStoredPopupContext,
@@ -69,6 +69,8 @@ export interface SchemaSettingsRemoveProps {
69
69
  removeParentsIfNoChildren?: boolean;
70
70
  breakRemoveOn?: ISchema | ((s: ISchema) => boolean);
71
71
  }
72
+ export declare const getSchemaSettingsDialogZIndex: (parentZIndex: number) => number;
73
+ export declare const getSchemaSettingsConfirmZIndex: (parentZIndex: number) => number;
72
74
  export declare const SchemaSettingsRemove: FC<SchemaSettingsRemoveProps>;
73
75
  export interface SchemaSettingsSelectItemProps extends Omit<SchemaSettingsItemProps, 'onChange' | 'onClick'>, Omit<SelectWithTitleProps, 'title' | 'defaultValue'> {
74
76
  value?: SelectWithTitleProps['defaultValue'];