@nocobase/client 2.0.0-alpha.35 → 2.0.0-alpha.36

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.
@@ -16,4 +16,5 @@ export declare class ChildPageModel extends PageModel {
16
16
  };
17
17
  createPageTabModelOptions: () => CreateModelOptions;
18
18
  handleDragEnd(event: DragEndEvent): Promise<void>;
19
+ render(): React.JSX.Element;
19
20
  }
package/es/index.mjs CHANGED
@@ -9613,7 +9613,7 @@ function addAppVersion(e, t) {
9613
9613
  addAppVersion((n = e.properties) == null ? void 0 : n[o], t);
9614
9614
  }), e;
9615
9615
  }
9616
- const name = "@nocobase/client", version = "2.0.0-alpha.35", license = "AGPL-3.0", main = "lib/index.js", module = "es/index.mjs", types = "es/index.d.ts", dependencies = {
9616
+ const name = "@nocobase/client", version = "2.0.0-alpha.36", license = "AGPL-3.0", main = "lib/index.js", module = "es/index.mjs", types = "es/index.d.ts", dependencies = {
9617
9617
  "@ahooksjs/use-url-state": "3.5.1",
9618
9618
  "@ant-design/cssinjs": "^1.11.1",
9619
9619
  "@ant-design/icons": "^5.6.1",
@@ -9636,10 +9636,10 @@ const name = "@nocobase/client", version = "2.0.0-alpha.35", license = "AGPL-3.0
9636
9636
  "@formily/reactive-react": "^2.2.27",
9637
9637
  "@formily/shared": "^2.2.27",
9638
9638
  "@formily/validator": "^2.2.27",
9639
- "@nocobase/evaluators": "2.0.0-alpha.35",
9640
- "@nocobase/flow-engine": "2.0.0-alpha.35",
9641
- "@nocobase/sdk": "2.0.0-alpha.35",
9642
- "@nocobase/utils": "2.0.0-alpha.35",
9639
+ "@nocobase/evaluators": "2.0.0-alpha.36",
9640
+ "@nocobase/flow-engine": "2.0.0-alpha.36",
9641
+ "@nocobase/sdk": "2.0.0-alpha.36",
9642
+ "@nocobase/utils": "2.0.0-alpha.36",
9643
9643
  "@tanstack/react-table": "^8.21.3",
9644
9644
  "@types/tabulator-tables": "^6.2.6",
9645
9645
  "acorn-jsx": "^5.3.2",
@@ -30043,7 +30043,7 @@ const useStyles$a = genStyleHook("nb-markdown", (e, { isDarkTheme: t }) => {
30043
30043
  }, t ? i : r)
30044
30044
  };
30045
30045
  }), parseMarkdown$1 = _.memoize((e) => O(void 0, null, function* () {
30046
- return e && (yield import("./md-BbvRKckr.mjs")).default.render(e);
30046
+ return e && (yield import("./md-oH2RssNY.mjs")).default.render(e);
30047
30047
  }));
30048
30048
  function useParseMarkdown$1(e) {
30049
30049
  const [t, o] = useState(""), [n, r] = useState(!0);
@@ -65260,7 +65260,7 @@ const BlockConfigsContext = createContext({
65260
65260
  zIndex: 1,
65261
65261
  lineHeight: 0
65262
65262
  },
65263
- children: /* @__PURE__ */ jsx(FlowContextSelector, { metaTree: m, onChange: (h) => p(h), onlyLeafSelectable: !0, children: /* @__PURE__ */ jsx(
65263
+ children: /* @__PURE__ */ jsx(FlowContextSelector, { metaTree: m, onChange: (h) => p(h), children: /* @__PURE__ */ jsx(
65264
65264
  Button,
65265
65265
  {
65266
65266
  type: "default",
@@ -67574,7 +67574,7 @@ BlockGridModel.registerFlow({
67574
67574
  }
67575
67575
  });
67576
67576
  const parseMarkdown = _.memoize((e) => O(void 0, null, function* () {
67577
- return e && (yield import("./md-oH2RssNY.mjs")).default.render(e);
67577
+ return e && (yield import("./md-BbvRKckr.mjs")).default.render(e);
67578
67578
  }));
67579
67579
  function useParseMarkdown(e) {
67580
67580
  const [t, o] = useState(""), [n, r] = useState(!0);
@@ -69715,7 +69715,12 @@ class PageModel extends FlowModel {
69715
69715
  FlowModelRenderer,
69716
69716
  {
69717
69717
  model: o,
69718
- showFlowSettings: { showBackground: !0, showBorder: !1 },
69718
+ showFlowSettings: {
69719
+ showBackground: !0,
69720
+ showBorder: !1,
69721
+ toolbarPosition: "above",
69722
+ style: { transform: "translateY(8px)" }
69723
+ },
69719
69724
  extraToolbarItems: [
69720
69725
  {
69721
69726
  key: "drag-handler",
@@ -69864,6 +69869,12 @@ class ChildPageModel extends PageModel {
69864
69869
  this.flowEngine.moveModel(o.active.id, o.over.id);
69865
69870
  });
69866
69871
  }
69872
+ render() {
69873
+ return /* @__PURE__ */ jsxs(Fragment$1, { children: [
69874
+ this.props.displayTitle && this.props.title ? /* @__PURE__ */ jsx(PageHeader, { title: this.props.title, style: this.props.headerStyle }) : this.context.view.type !== "embed" && /* @__PURE__ */ jsx("div", { style: { height: this.context.themeToken.paddingContentVerticalLG } }),
69875
+ this.props.enableTabs ? this.renderTabs() : this.renderFirstTab()
69876
+ ] });
69877
+ }
69867
69878
  }
69868
69879
  const BackButtonUsedInSubPage = () => {
69869
69880
  const e = useFlowContext(), t = e.themeToken, o = 32, n = useMemo(() => ({
@@ -70869,7 +70880,7 @@ UpdateRecordActionModel.registerFlow({
70869
70880
  },
70870
70881
  handler(e, t) {
70871
70882
  return O(this, null, function* () {
70872
- var l, c, u, d, p, m, h;
70883
+ var u, d, p, m, h, g, x, b;
70873
70884
  const o = e.model.getStepParams(SETTINGS_FLOW_KEY, "confirm"), n = o && typeof o == "object" ? o : { enable: !1 };
70874
70885
  yield e.runAction("confirm", n);
70875
70886
  const r = (t == null ? void 0 : t.assignedValues) || {};
@@ -70877,12 +70888,16 @@ UpdateRecordActionModel.registerFlow({
70877
70888
  e.message.warning(e.t("No assigned fields configured"));
70878
70889
  return;
70879
70890
  }
70880
- const i = (l = e.collection) == null ? void 0 : l.name, a = (u = (c = e.collection) == null ? void 0 : c.getFilterByTK) == null ? void 0 : u.call(c, e.record);
70891
+ const i = (u = e.collection) == null ? void 0 : u.name, a = (p = (d = e.collection) == null ? void 0 : d.getFilterByTK) == null ? void 0 : p.call(d, e.record);
70881
70892
  if (!i || typeof a == "undefined" || a === null) {
70882
70893
  e.message.error(e.t("Record is required to perform this action"));
70883
70894
  return;
70884
70895
  }
70885
- yield e.api.resource(i).update(f({ filterByTk: a, values: r }, (d = t.requestConfig) == null ? void 0 : d.params)), (h = (m = (p = e.blockModel) == null ? void 0 : p.resource) == null ? void 0 : m.refresh) == null || h.call(m), e.message.success(e.t("Saved successfully"));
70896
+ let l = r;
70897
+ const c = (m = e.collection) == null ? void 0 : m.getFilterByTK(e.record);
70898
+ Array.isArray(a) ? l = f(f({}, r), c || {}) : l = I(f({}, r), {
70899
+ [a]: c
70900
+ }), yield e.api.resource(i).update(f({ filterByTk: a, values: l }, (h = t.requestConfig) == null ? void 0 : h.params)), (b = (x = (g = e.blockModel) == null ? void 0 : g.resource) == null ? void 0 : x.refresh) == null || b.call(x), e.message.success(e.t("Saved successfully"));
70886
70901
  });
70887
70902
  }
70888
70903
  }
@@ -71150,7 +71165,10 @@ class FormBlockModel extends CollectionBlockModel {
71150
71165
  get: () => this.context.form.getFieldsValue(),
71151
71166
  cache: !1,
71152
71167
  meta: n,
71153
- resolveOnServer: createAssociationSubpathResolver(() => this.collection),
71168
+ resolveOnServer: createAssociationSubpathResolver(
71169
+ () => this.collection,
71170
+ () => this.form.getFieldsValue()
71171
+ ),
71154
71172
  serverOnlyWhenContextParams: !0
71155
71173
  });
71156
71174
  }
@@ -75168,6 +75186,9 @@ class TableActionsColumnModel extends TableCustomColumnModel {
75168
75186
  });
75169
75187
  }
75170
75188
  getColumnProps() {
75189
+ var o;
75190
+ if (this.hidden && !((o = this.flowEngine.flowSettings) != null && o.enabled))
75191
+ return null;
75171
75192
  const t = /* @__PURE__ */ jsx(Droppable, { model: this, children: /* @__PURE__ */ jsx(
75172
75193
  FlowsFloatContextMenu,
75173
75194
  {
@@ -77729,7 +77750,10 @@ class SubFormFieldModel extends FormAssociationFieldModel {
77729
77750
  this.context.t("Current object"),
77730
77751
  () => this.context.form.getFieldValue(this.props.name)
77731
77752
  ),
77732
- resolveOnServer: createAssociationSubpathResolver(() => this.context.collection),
77753
+ resolveOnServer: createAssociationSubpathResolver(
77754
+ () => this.context.collection,
77755
+ () => this.context.form.getFieldValue(this.props.name)
77756
+ ),
77733
77757
  serverOnlyWhenContextParams: !0
77734
77758
  });
77735
77759
  }
@@ -77806,7 +77830,10 @@ const ArrayNester$1 = ({ name: e, value: t, disabled: o }) => {
77806
77830
  y.context.t("Current object"),
77807
77831
  () => y.context.form.getFieldValue([e, x])
77808
77832
  ),
77809
- resolveOnServer: createAssociationSubpathResolver(() => y.context.collection),
77833
+ resolveOnServer: createAssociationSubpathResolver(
77834
+ () => y.context.collection,
77835
+ () => y.context.form.getFieldValue([e, x])
77836
+ ),
77810
77837
  serverOnlyWhenContextParams: !0
77811
77838
  }), // key 使用 index 是为了在移除前面行时,能重新渲染后面的行,以更新上下文中的值
77812
77839
  /* @__PURE__ */ jsxs("div", { style: { marginBottom: 12 }, children: [
@@ -77852,7 +77879,10 @@ class SubFormListFieldModel extends FormAssociationFieldModel {
77852
77879
  this.context.t("Current object"),
77853
77880
  (n) => n.currentObject
77854
77881
  ),
77855
- resolveOnServer: createAssociationSubpathResolver(() => this.context.collection),
77882
+ resolveOnServer: createAssociationSubpathResolver(
77883
+ () => this.context.collection,
77884
+ () => this.context.currentObject
77885
+ ),
77856
77886
  serverOnlyWhenContextParams: !0
77857
77887
  });
77858
77888
  }
@@ -77952,16 +77982,16 @@ CollectionSelectorFieldModel.registerFlow({
77952
77982
  steps: {
77953
77983
  init: {
77954
77984
  handler(e) {
77955
- const t = e.dataSourceManager.getDataSource("main").getCollections(), o = e.model.context.collectionField.uiSchema.enum, n = t.filter((r) => !r.options.hidden).map((r) => {
77985
+ const t = e.dataSourceManager.getDataSource("main").getCollections(), o = e.model.context.collectionField.uiSchema.enum || [], n = t.filter((r) => !r.options.hidden).filter((r) => o.length ? o.find((i) => i.value === r.name) : !0).map((r) => {
77956
77986
  var i;
77957
77987
  return {
77958
- label: e.t(r.title || r.label),
77988
+ label: e.t(r.title) || r.name,
77959
77989
  value: r.name || r.value,
77960
77990
  color: (i = r.category) == null ? void 0 : i.color
77961
77991
  };
77962
77992
  });
77963
77993
  e.model.setProps({
77964
- options: o.length ? o : n
77994
+ options: n
77965
77995
  });
77966
77996
  }
77967
77997
  }