@nocobase/client 2.0.40 → 2.0.41

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.
@@ -96,6 +96,7 @@ export declare class RuleEngine {
96
96
  private tryUnregisterDefaultRuleInstance;
97
97
  private bindMasterInitialValue;
98
98
  private removeRule;
99
+ rescheduleAllRules(): void;
99
100
  private scheduleRule;
100
101
  private flushRules;
101
102
  private runRule;
@@ -51,6 +51,7 @@ export declare class FormValueRuntime {
51
51
  sync?: boolean;
52
52
  }): void;
53
53
  dispose(): void;
54
+ resetAfterFormReset(): void;
54
55
  isSuppressed(): boolean;
55
56
  handleFormFieldsChange(changedFields: Array<{
56
57
  name?: NamePath | string | number;
package/es/index.mjs CHANGED
@@ -9976,7 +9976,7 @@ function addAppVersion(e, t) {
9976
9976
  addAppVersion((n = e.properties) == null ? void 0 : n[o], t);
9977
9977
  }), e;
9978
9978
  }
9979
- const name = "@nocobase/client", version = "2.0.40", license = "Apache-2.0", main = "lib/index.js", module = "es/index.mjs", types = "es/index.d.ts", dependencies = {
9979
+ const name = "@nocobase/client", version = "2.0.41", license = "Apache-2.0", main = "lib/index.js", module = "es/index.mjs", types = "es/index.d.ts", dependencies = {
9980
9980
  "@ahooksjs/use-url-state": "3.5.1",
9981
9981
  "@ant-design/cssinjs": "^1.11.1",
9982
9982
  "@ant-design/icons": "^5.6.1",
@@ -9999,10 +9999,10 @@ const name = "@nocobase/client", version = "2.0.40", license = "Apache-2.0", mai
9999
9999
  "@formily/reactive-react": "^2.2.27",
10000
10000
  "@formily/shared": "^2.2.27",
10001
10001
  "@formily/validator": "^2.2.27",
10002
- "@nocobase/evaluators": "2.0.40",
10003
- "@nocobase/flow-engine": "2.0.40",
10004
- "@nocobase/sdk": "2.0.40",
10005
- "@nocobase/utils": "2.0.40",
10002
+ "@nocobase/evaluators": "2.0.41",
10003
+ "@nocobase/flow-engine": "2.0.41",
10004
+ "@nocobase/sdk": "2.0.41",
10005
+ "@nocobase/utils": "2.0.41",
10006
10006
  "@tanstack/react-table": "^8.21.3",
10007
10007
  "@types/tabulator-tables": "^6.2.6",
10008
10008
  "acorn-jsx": "^5.3.2",
@@ -65807,6 +65807,7 @@ const LocalPlugins = () => {
65807
65807
  "Notification",
65808
65808
  "System management",
65809
65809
  "Security",
65810
+ "Architecture",
65810
65811
  "Logging and monitoring",
65811
65812
  "Others"
65812
65813
  ], y = useMemo(() => f.map((P) => {
@@ -73316,7 +73317,7 @@ class PageModel extends FlowModel {
73316
73317
  }
73317
73318
  renderTabs() {
73318
73319
  var i, a, l, c, u;
73319
- const o = (a = (i = this.context.themeToken) == null ? void 0 : i.paddingLG) != null ? a : 16, n = this.tabBarExtraContent.left !== void 0 ? this.tabBarExtraContent.left : /* @__PURE__ */ jsx("span", { "aria-hidden": "true", style: { display: "inline-block", width: o, height: 1 } }), r = this.tabBarExtraContent.right !== void 0 ? this.tabBarExtraContent.right : /* @__PURE__ */ jsx(
73320
+ const o = (a = (i = this.context.themeToken) == null ? void 0 : i.paddingLG) != null ? a : 16, n = this.tabBarExtraContent.left !== void 0 ? this.tabBarExtraContent.left : /* @__PURE__ */ jsx("span", { "aria-hidden": "true", style: { display: "inline-block", width: o, height: 1 } }), r = this.tabBarExtraContent.right !== void 0 ? this.tabBarExtraContent.right : /* @__PURE__ */ jsx("span", { style: { display: "inline-flex", marginInlineEnd: o }, children: /* @__PURE__ */ jsx(
73320
73321
  AddSubModelButton,
73321
73322
  {
73322
73323
  model: this,
@@ -73330,7 +73331,7 @@ class PageModel extends FlowModel {
73330
73331
  ],
73331
73332
  children: /* @__PURE__ */ jsx(FlowSettingsButton, { icon: /* @__PURE__ */ jsx(PlusOutlined, {}), children: this.context.t("Add tab") })
73332
73333
  }
73333
- );
73334
+ ) });
73334
73335
  return /* @__PURE__ */ jsx(DndProvider, { onDragEnd: this.handleDragEnd.bind(this), children: /* @__PURE__ */ jsx(
73335
73336
  Tabs$1,
73336
73337
  {
@@ -77747,6 +77748,15 @@ class RuleEngine {
77747
77748
  a && a(), this.defaultRuleMasterDisposers.delete(r);
77748
77749
  }
77749
77750
  }
77751
+ rescheduleAllRules() {
77752
+ if (!this.options.isDisposed()) {
77753
+ this.lastRuleWriteByTargetKey.clear();
77754
+ for (const t of this.rules.values())
77755
+ t.state.runSeq += 1;
77756
+ for (const t of this.rules.keys())
77757
+ this.scheduleRule(t);
77758
+ }
77759
+ }
77750
77760
  scheduleRule(t) {
77751
77761
  var a;
77752
77762
  if (this.options.isDisposed())
@@ -78352,6 +78362,18 @@ class FormValueRuntime {
78352
78362
  r.dispose();
78353
78363
  this.observableBindings.clear(), this.txWriteCounts.clear();
78354
78364
  }
78365
+ resetAfterFormReset() {
78366
+ if (this.disposed)
78367
+ return;
78368
+ this.explicitSet.clear(), this.lastDefaultValueByPathKey.clear(), this.lastWriteMetaByPathKey.clear(), this.txWriteCounts.clear(), this.lastObservedChangedPaths = null, this.lastObservedSource = null, this.lastObservedToken += 1;
78369
+ for (const o of this.observableBindings.values())
78370
+ o.dispose();
78371
+ this.observableBindings.clear();
78372
+ const t = this.getFormValuesSnapshot();
78373
+ for (const o of Object.keys(this.valuesMirror))
78374
+ delete this.valuesMirror[o];
78375
+ t && typeof t == "object" && _.merge(this.valuesMirror, t), this.writeSeq += 1, this.bumpChangeTick(), this.ruleEngine.rescheduleAllRules();
78376
+ }
78355
78377
  isSuppressed() {
78356
78378
  return this.suppressFormCallbackDepth > 0;
78357
78379
  }
@@ -79954,7 +79976,7 @@ function omitHiddenModelValuesFromSubmit(e, t) {
79954
79976
  }
79955
79977
  function submitHandler(e, t, o) {
79956
79978
  return L(this, null, function* () {
79957
- var l, c, u;
79979
+ var l, c, u, d, p;
79958
79980
  const n = e.resource, r = e.blockModel;
79959
79981
  yield validateSubmitForm({
79960
79982
  form: r == null ? void 0 : r.form,
@@ -79965,18 +79987,18 @@ function submitHandler(e, t, o) {
79965
79987
  const i = r.form.getFieldsValue(!0), a = omitHiddenModelValuesFromSubmit(i, r);
79966
79988
  if (n instanceof SingleRecordResource) {
79967
79989
  if (r instanceof EditFormModel) {
79968
- const p = n.getMeta("currentFilterByTk");
79969
- p ? n.setFilterByTk(p) : n.isNewRecord = !0;
79990
+ const h = n.getMeta("currentFilterByTk");
79991
+ h ? n.setFilterByTk(h) : n.isNewRecord = !0;
79970
79992
  }
79971
- const d = o ? yield o(a) : yield n.save(a, t.requestConfig);
79972
- r instanceof EditFormModel ? (n.isNewRecord = !1, (l = r.resetUserModifiedFields) == null || l.call(r), yield n.refresh()) : (r.form.resetFields(), r.emitter.emit("onFieldReset"), (c = r.resetUserModifiedFields) == null || c.call(r), e.view.inputArgs.collectionName === r.collection.name && e.view.inputArgs.onChange && e.view.inputArgs.onChange(d == null ? void 0 : d.data));
79993
+ const m = o ? yield o(a) : yield n.save(a, t.requestConfig);
79994
+ r instanceof EditFormModel ? (n.isNewRecord = !1, (l = r.resetUserModifiedFields) == null || l.call(r), yield n.refresh()) : (r.form.resetFields(), r.emitter.emit("onFieldReset"), (c = r.resetUserModifiedFields) == null || c.call(r), (d = (u = r.formValueRuntime) == null ? void 0 : u.resetAfterFormReset) == null || d.call(u), e.view.inputArgs.collectionName === r.collection.name && e.view.inputArgs.onChange && e.view.inputArgs.onChange(m == null ? void 0 : m.data));
79973
79995
  } else if (n instanceof MultiRecordResource) {
79974
- const d = n.getMeta("currentFilterByTk");
79975
- if (!d) {
79996
+ const m = n.getMeta("currentFilterByTk");
79997
+ if (!m) {
79976
79998
  e.message.error(e.t("No filterByTk found for multi-record resource."));
79977
79999
  return;
79978
80000
  }
79979
- (yield o) ? yield o(a, d) : yield n.update(d, a, t.requestConfig), (u = r.resetUserModifiedFields) == null || u.call(r);
80001
+ (yield o) ? yield o(a, m) : yield n.update(m, a, t.requestConfig), (p = r.resetUserModifiedFields) == null || p.call(r);
79980
80002
  }
79981
80003
  });
79982
80004
  }