@nocobase/client 1.9.32 → 1.9.34

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
@@ -8000,23 +8000,23 @@ ApplicationContext.displayName = "ApplicationContext";
8000
8000
  const AppComponent = observer(
8001
8001
  (n) => {
8002
8002
  var o = n, { children: e } = o, t = W(o, ["children"]);
8003
- var l;
8004
- const { app: r } = t, a = useCallback((c, u) => {
8005
- console.error(c);
8006
- const d = new Error();
8007
- d.stack = u.componentStack.trim(), console.error(d);
8003
+ var l, c, u, d, p, m, h, g, f;
8004
+ const { app: r } = t, a = useCallback((C, b) => {
8005
+ console.error(C);
8006
+ const S = new Error();
8007
+ S.stack = b.componentStack.trim(), console.error(S);
8008
8008
  }, []);
8009
8009
  useEffect(() => {
8010
8010
  r.load();
8011
8011
  }, [r]);
8012
8012
  const i = r.getComponent("AppError");
8013
- return r.loading ? r.renderComponent("AppSpin", { app: r }) : !r.maintained && r.maintaining ? r.renderComponent("AppMaintaining", { app: r }) : (l = r.error) != null && l.code && !(r.maintained && r.maintaining) ? /* @__PURE__ */ jsx(i, { app: r, error: r.error }) : /* @__PURE__ */ jsx(
8013
+ return r.loading ? r.renderComponent("AppSpin", { app: r }) : !r.maintained && r.maintaining ? r.renderComponent((d = (u = (c = (l = r.error) == null ? void 0 : l.command) == null ? void 0 : c.components) == null ? void 0 : u.maintaining) != null ? d : "AppMaintaining", { app: r }) : (p = r.error) != null && p.code && !(r.maintained && r.maintaining) ? /* @__PURE__ */ jsx(i, { app: r, error: r.error }) : /* @__PURE__ */ jsx(
8014
8014
  ErrorBoundary,
8015
8015
  {
8016
- FallbackComponent: (c) => /* @__PURE__ */ jsx(i, x({ app: r, error: r.error }, c)),
8016
+ FallbackComponent: (C) => /* @__PURE__ */ jsx(i, x({ app: r, error: r.error }, C)),
8017
8017
  onError: a,
8018
8018
  children: /* @__PURE__ */ jsxs(ApplicationContext.Provider, { value: r, children: [
8019
- r.maintained && r.maintaining && r.renderComponent("AppMaintainingDialog", { app: r }),
8019
+ r.maintained && r.maintaining && r.renderComponent((f = (g = (h = (m = r.error) == null ? void 0 : m.command) == null ? void 0 : h.components) == null ? void 0 : g.maintainingDialog) != null ? f : "AppMaintainingDialog", { app: r }),
8020
8020
  r.renderComponent("AppMain", void 0, e)
8021
8021
  ] })
8022
8022
  }
@@ -8856,7 +8856,7 @@ function addAppVersion(e, t) {
8856
8856
  addAppVersion((o = e.properties) == null ? void 0 : o[n], t);
8857
8857
  }), e;
8858
8858
  }
8859
- const name = "@nocobase/client", version = "1.9.32", license = "AGPL-3.0", main = "lib/index.js", module = "es/index.mjs", types = "es/index.d.ts", dependencies = {
8859
+ const name = "@nocobase/client", version = "1.9.34", license = "AGPL-3.0", main = "lib/index.js", module = "es/index.mjs", types = "es/index.d.ts", dependencies = {
8860
8860
  "@ahooksjs/use-url-state": "3.5.1",
8861
8861
  "@ant-design/cssinjs": "^1.11.1",
8862
8862
  "@ant-design/icons": "^5.6.1",
@@ -8877,9 +8877,9 @@ const name = "@nocobase/client", version = "1.9.32", license = "AGPL-3.0", main
8877
8877
  "@formily/reactive-react": "^2.2.27",
8878
8878
  "@formily/shared": "^2.2.27",
8879
8879
  "@formily/validator": "^2.2.27",
8880
- "@nocobase/evaluators": "1.9.32",
8881
- "@nocobase/sdk": "1.9.32",
8882
- "@nocobase/utils": "1.9.32",
8880
+ "@nocobase/evaluators": "1.9.34",
8881
+ "@nocobase/sdk": "1.9.34",
8882
+ "@nocobase/utils": "1.9.34",
8883
8883
  ahooks: "^3.7.2",
8884
8884
  antd: "5.24.2",
8885
8885
  "antd-mobile": "^5.41.1",
@@ -15404,78 +15404,83 @@ const useGetFilterOptions = () => {
15404
15404
  const t = useCollectionManager(), n = t == null ? void 0 : t.getCollectionFields(e);
15405
15405
  return useFilterFieldOptions(n);
15406
15406
  }, useGetFilterFieldOptions = () => {
15407
- var i;
15408
- const e = useFieldSchema(), t = ((i = e == null ? void 0 : e["x-component-props"]) == null ? void 0 : i.nonfilterable) || [], n = useCollectionManager(), o = useDataSourceManager(), r = (l, c, u) => {
15409
- var f, C;
15410
- if (t.length && c === 1 && t.includes(l.name) || !l.interface)
15407
+ var i, l;
15408
+ const e = useFieldSchema(), t = Array.isArray((i = e == null ? void 0 : e["x-component-props"]) == null ? void 0 : i.nonfilterable) ? (l = e == null ? void 0 : e["x-component-props"]) == null ? void 0 : l.nonfilterable : [], n = useCollectionManager(), o = useDataSourceManager(), r = (c, u, d, p) => {
15409
+ var S, y;
15410
+ const m = p ? `${p}.${c.name}` : c.name;
15411
+ if (t.length && t.includes(m) || !c.interface)
15411
15412
  return;
15412
- const d = o == null ? void 0 : o.collectionFieldInterfaceManager.getFieldInterface(l.interface);
15413
- if (!(d != null && d.filterable) && !u)
15413
+ const h = o == null ? void 0 : o.collectionFieldInterfaceManager.getFieldInterface(c.interface);
15414
+ if (!(h != null && h.filterable) && !d)
15414
15415
  return;
15415
- const { nested: p, children: m, operators: h } = (d == null ? void 0 : d.filterable) || {}, g = {
15416
- name: l.name,
15417
- type: l.type,
15418
- target: l.target,
15419
- title: ((f = l == null ? void 0 : l.uiSchema) == null ? void 0 : f.title) || l.name,
15420
- schema: l == null ? void 0 : l.uiSchema,
15421
- interface: l.interface,
15422
- operators: ((C = h == null ? void 0 : h.filter) == null ? void 0 : C.call(h, (b) => !(b != null && b.visible) || b.visible(l))) || []
15416
+ const { nested: g, children: f, operators: C } = (h == null ? void 0 : h.filterable) || {}, b = {
15417
+ name: c.name,
15418
+ type: c.type,
15419
+ target: c.target,
15420
+ title: ((S = c == null ? void 0 : c.uiSchema) == null ? void 0 : S.title) || c.name,
15421
+ schema: c == null ? void 0 : c.uiSchema,
15422
+ interface: c.interface,
15423
+ operators: ((y = C == null ? void 0 : C.filter) == null ? void 0 : y.call(C, (v) => !(v != null && v.visible) || v.visible(c))) || []
15423
15424
  };
15424
- if (!(l.target && c > 2)) {
15425
- if (c > 2)
15426
- return g;
15427
- if (m != null && m.length && (g.children = m), p) {
15428
- const b = n == null ? void 0 : n.getCollectionFields(l.target), S = a(b, c + 1).filter(Boolean);
15429
- g.children = g.children || [], g.children.push(...S);
15425
+ if (!(c.target && u > 2)) {
15426
+ if (u > 2)
15427
+ return b;
15428
+ if (f != null && f.length && (b.children = f), g) {
15429
+ const v = n == null ? void 0 : n.getCollectionFields(c.target), I = a(v, u + 1, d, m).filter(Boolean);
15430
+ b.children = b.children || [], b.children.push(...I);
15430
15431
  }
15431
- return g;
15432
+ return b;
15432
15433
  }
15433
- }, a = (l, c, u) => {
15434
- const d = [];
15435
- return l == null || l.forEach((p) => {
15436
- const m = r(p, c, u);
15437
- m && d.push(m);
15438
- }), d;
15434
+ }, a = (c, u, d, p) => {
15435
+ const m = [];
15436
+ return c == null || c.forEach((h) => {
15437
+ const g = r(h, u, d, p);
15438
+ g && m.push(g);
15439
+ }), m;
15439
15440
  };
15440
- return (l, c) => a(l, 1, c);
15441
- }, field2option = (e, t, n, o, r) => {
15442
- var d, p;
15443
- if (n.length && t === 1 && n.includes(e.name) || !e.interface || e.filterable === !1)
15441
+ return (c, u) => a(c, 1, u);
15442
+ }, field2option = (e, t, n, o, r, a) => {
15443
+ var m, h, g, f, C;
15444
+ const i = a ? `${a}.${e.name}` : e.name;
15445
+ if (n.length && n.includes(i) || !e.interface || e.filterable === !1)
15444
15446
  return;
15445
- const a = o == null ? void 0 : o.collectionFieldInterfaceManager.getFieldInterface(e.interface);
15446
- if (!(a != null && a.filterable))
15447
+ const l = o == null ? void 0 : o.collectionFieldInterfaceManager.getFieldInterface(e.interface);
15448
+ if (!(l != null && l.filterable))
15447
15449
  return;
15448
- const { nested: i, children: l, operators: c } = a.filterable, u = {
15450
+ const { nested: c, children: u, operators: d } = l.filterable, p = {
15449
15451
  name: e.name,
15450
15452
  type: e.type,
15451
15453
  target: e.target,
15452
- title: ((d = e == null ? void 0 : e.uiSchema) == null ? void 0 : d.title) || e.name,
15454
+ title: ((m = e == null ? void 0 : e.uiSchema) == null ? void 0 : m.title) || e.name,
15453
15455
  schema: e == null ? void 0 : e.uiSchema,
15454
- operators: ((p = c == null ? void 0 : c.filter) == null ? void 0 : p.call(c, (m) => !(m != null && m.visible) || m.visible(e))) || []
15456
+ operators: ((h = d == null ? void 0 : d.filter) == null ? void 0 : h.call(d, (b) => !(b != null && b.visible) || b.visible(e))) || []
15455
15457
  };
15456
15458
  if (!(e.target && t > 2)) {
15457
15459
  if (t > 2)
15458
- return u;
15459
- if (l != null && l.length && (u.children = l), i) {
15460
- const m = o.getDataSource(e.dataSourceKey).collectionManager.getCollectionFields(e.target), h = getOptions$1(m, t + 1, n, o).filter(
15461
- Boolean
15462
- );
15463
- u.children = u.children || [], u.children.push(...h);
15460
+ return p;
15461
+ if (u != null && u.length && (p.children = u), c) {
15462
+ const b = (g = r == null ? void 0 : r.dataSource) == null ? void 0 : g.key, S = e.dataSourceKey || b, y = S && S !== b ? ((f = o == null ? void 0 : o.getDataSource(S)) == null ? void 0 : f.collectionManager) || r : r || ((C = o == null ? void 0 : o.getDataSource(S)) == null ? void 0 : C.collectionManager), v = y == null ? void 0 : y.getCollectionFields(e.target), I = getOptions$1(
15463
+ v || [],
15464
+ t + 1,
15465
+ n,
15466
+ o,
15467
+ y || r,
15468
+ i
15469
+ ).filter(Boolean);
15470
+ p.children = p.children || [], p.children.push(...I);
15464
15471
  }
15465
- return u;
15472
+ return p;
15466
15473
  }
15467
- }, getOptions$1 = (e, t, n, o, r) => {
15468
- const a = [];
15469
- return e.forEach((i) => {
15470
- const l = field2option(i, t, n, o);
15471
- l && a.push(l);
15472
- }), a;
15474
+ }, getOptions$1 = (e = [], t, n, o, r, a) => {
15475
+ const i = [];
15476
+ return e.forEach((l) => {
15477
+ const c = field2option(l, t, n, o, r, a);
15478
+ c && i.push(c);
15479
+ }), i;
15473
15480
  }, useFilterFieldOptions = (e) => {
15474
- var r;
15475
- const t = useFieldSchema(), n = ((r = t == null ? void 0 : t["x-component-props"]) == null ? void 0 : r.nonfilterable) || [];
15476
- useCollectionManager();
15477
- const o = useDataSourceManager();
15478
- return getOptions$1(e, 1, n, o);
15481
+ var a, i;
15482
+ const t = useFieldSchema(), n = Array.isArray((a = t == null ? void 0 : t["x-component-props"]) == null ? void 0 : a.nonfilterable) ? (i = t == null ? void 0 : t["x-component-props"]) == null ? void 0 : i.nonfilterable : [], o = useCollectionManager(), r = useDataSourceManager();
15483
+ return getOptions$1(e, 1, n, r, o);
15479
15484
  }, isEmpty = (e) => Array.isArray(e) && e.length === 0 || e && Object.keys(e).length === 0 && Object.getPrototypeOf(e) === Object.prototype, removeNullCondition = (e, t = flat) => {
15480
15485
  const n = t(e || {}), o = {};
15481
15486
  for (const r in n) {
@@ -30774,7 +30779,7 @@ function SchemaSettingsConnectDataBlocks(e) {
30774
30779
  if (!l)
30775
30780
  return null;
30776
30781
  const h = c.map((g) => {
30777
- const f = `${p(g.collection.title)} #${g.uid.slice(0, 4)}`, C = () => {
30782
+ const f = `${p(g.collection.title)} ${g.uid ? `#${g.uid.slice(0, 4)}` : ""}`, C = () => {
30778
30783
  g.highlightBlock();
30779
30784
  }, b = () => {
30780
30785
  g.unhighlightBlock();
@@ -31686,7 +31691,8 @@ const DragHandler = (e) => {
31686
31691
  const v = {
31687
31692
  name: "$nForm",
31688
31693
  ctx: f,
31689
- collectionName: e
31694
+ collectionName: e,
31695
+ dataSource: m.current.dataSourceKey
31690
31696
  }, I = `{{ $nForm.${p} }}`;
31691
31697
  if (S == null)
31692
31698
  return;