@nocobase/client 2.0.0-beta.2 → 2.0.0-beta.3

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
@@ -9679,7 +9679,7 @@ function addAppVersion(e, t) {
9679
9679
  addAppVersion((n = e.properties) == null ? void 0 : n[o], t);
9680
9680
  }), e;
9681
9681
  }
9682
- const name = "@nocobase/client", version = "2.0.0-beta.2", license = "AGPL-3.0", main = "lib/index.js", module = "es/index.mjs", types = "es/index.d.ts", dependencies = {
9682
+ const name = "@nocobase/client", version = "2.0.0-beta.3", license = "AGPL-3.0", main = "lib/index.js", module = "es/index.mjs", types = "es/index.d.ts", dependencies = {
9683
9683
  "@ahooksjs/use-url-state": "3.5.1",
9684
9684
  "@ant-design/cssinjs": "^1.11.1",
9685
9685
  "@ant-design/icons": "^5.6.1",
@@ -9702,10 +9702,10 @@ const name = "@nocobase/client", version = "2.0.0-beta.2", license = "AGPL-3.0",
9702
9702
  "@formily/reactive-react": "^2.2.27",
9703
9703
  "@formily/shared": "^2.2.27",
9704
9704
  "@formily/validator": "^2.2.27",
9705
- "@nocobase/evaluators": "2.0.0-beta.2",
9706
- "@nocobase/flow-engine": "2.0.0-beta.2",
9707
- "@nocobase/sdk": "2.0.0-beta.2",
9708
- "@nocobase/utils": "2.0.0-beta.2",
9705
+ "@nocobase/evaluators": "2.0.0-beta.3",
9706
+ "@nocobase/flow-engine": "2.0.0-beta.3",
9707
+ "@nocobase/sdk": "2.0.0-beta.3",
9708
+ "@nocobase/utils": "2.0.0-beta.3",
9709
9709
  "@tanstack/react-table": "^8.21.3",
9710
9710
  "@types/tabulator-tables": "^6.2.6",
9711
9711
  "acorn-jsx": "^5.3.2",
@@ -16269,78 +16269,83 @@ const useGetFilterOptions = () => {
16269
16269
  const t = useCollectionManager(), o = t == null ? void 0 : t.getCollectionFields(e);
16270
16270
  return useFilterFieldOptions(o);
16271
16271
  }, useGetFilterFieldOptions = () => {
16272
- var a;
16273
- const e = useFieldSchema(), t = ((a = e == null ? void 0 : e["x-component-props"]) == null ? void 0 : a.nonfilterable) || [], o = useCollectionManager(), n = useDataSourceManager(), r = (l, c, u) => {
16274
- var x, b;
16275
- if (t.length && c === 1 && t.includes(l.name) || !l.interface)
16272
+ var a, l;
16273
+ const e = useFieldSchema(), t = Array.isArray((a = e == null ? void 0 : e["x-component-props"]) == null ? void 0 : a.nonfilterable) ? (l = e == null ? void 0 : e["x-component-props"]) == null ? void 0 : l.nonfilterable : [], o = useCollectionManager(), n = useDataSourceManager(), r = (c, u, d, p) => {
16274
+ var y, v;
16275
+ const m = p ? `${p}.${c.name}` : c.name;
16276
+ if (t.length && t.includes(m) || !c.interface)
16276
16277
  return;
16277
- const d = n == null ? void 0 : n.collectionFieldInterfaceManager.getFieldInterface(l.interface);
16278
- if (!(d != null && d.filterable) && !u)
16278
+ const h = n == null ? void 0 : n.collectionFieldInterfaceManager.getFieldInterface(c.interface);
16279
+ if (!(h != null && h.filterable) && !d)
16279
16280
  return;
16280
- const { nested: p, children: m, operators: h } = (d == null ? void 0 : d.filterable) || {}, g = {
16281
- name: l.name,
16282
- type: l.type,
16283
- target: l.target,
16284
- title: ((x = l == null ? void 0 : l.uiSchema) == null ? void 0 : x.title) || l.name,
16285
- schema: l == null ? void 0 : l.uiSchema,
16286
- interface: l.interface,
16287
- operators: ((b = h == null ? void 0 : h.filter) == null ? void 0 : b.call(h, (C) => !(C != null && C.visible) || C.visible(l))) || []
16281
+ const { nested: g, children: x, operators: b } = (h == null ? void 0 : h.filterable) || {}, C = {
16282
+ name: c.name,
16283
+ type: c.type,
16284
+ target: c.target,
16285
+ title: ((y = c == null ? void 0 : c.uiSchema) == null ? void 0 : y.title) || c.name,
16286
+ schema: c == null ? void 0 : c.uiSchema,
16287
+ interface: c.interface,
16288
+ operators: ((v = b == null ? void 0 : b.filter) == null ? void 0 : v.call(b, (S) => !(S != null && S.visible) || S.visible(c))) || []
16288
16289
  };
16289
- if (!(l.target && c > 2)) {
16290
- if (c > 2)
16291
- return g;
16292
- if (m != null && m.length && (g.children = m), p) {
16293
- const C = o == null ? void 0 : o.getCollectionFields(l.target), y = i(C, c + 1).filter(Boolean);
16294
- g.children = g.children || [], g.children.push(...y);
16290
+ if (!(c.target && u > 2)) {
16291
+ if (u > 2)
16292
+ return C;
16293
+ if (x != null && x.length && (C.children = x), g) {
16294
+ const S = o == null ? void 0 : o.getCollectionFields(c.target), F = i(S, u + 1, d, m).filter(Boolean);
16295
+ C.children = C.children || [], C.children.push(...F);
16295
16296
  }
16296
- return g;
16297
+ return C;
16297
16298
  }
16298
- }, i = (l, c, u) => {
16299
- const d = [];
16300
- return l == null || l.forEach((p) => {
16301
- const m = r(p, c, u);
16302
- m && d.push(m);
16303
- }), d;
16299
+ }, i = (c, u, d, p) => {
16300
+ const m = [];
16301
+ return c == null || c.forEach((h) => {
16302
+ const g = r(h, u, d, p);
16303
+ g && m.push(g);
16304
+ }), m;
16304
16305
  };
16305
- return (l, c) => i(l, 1, c);
16306
- }, field2option$1 = (e, t, o, n, r) => {
16307
- var d, p;
16308
- if (o.length && t === 1 && o.includes(e.name) || !e.interface || e.filterable === !1)
16306
+ return (c, u) => i(c, 1, u);
16307
+ }, field2option$1 = (e, t, o, n, r, i) => {
16308
+ var m, h, g, x, b;
16309
+ const a = i ? `${i}.${e.name}` : e.name;
16310
+ if (o.length && o.includes(a) || !e.interface || e.filterable === !1)
16309
16311
  return;
16310
- const i = n == null ? void 0 : n.collectionFieldInterfaceManager.getFieldInterface(e.interface);
16311
- if (!(i != null && i.filterable))
16312
+ const l = n == null ? void 0 : n.collectionFieldInterfaceManager.getFieldInterface(e.interface);
16313
+ if (!(l != null && l.filterable))
16312
16314
  return;
16313
- const { nested: a, children: l, operators: c } = i.filterable, u = {
16315
+ const { nested: c, children: u, operators: d } = l.filterable, p = {
16314
16316
  name: e.name,
16315
16317
  type: e.type,
16316
16318
  target: e.target,
16317
- title: ((d = e == null ? void 0 : e.uiSchema) == null ? void 0 : d.title) || e.name,
16319
+ title: ((m = e == null ? void 0 : e.uiSchema) == null ? void 0 : m.title) || e.name,
16318
16320
  schema: e == null ? void 0 : e.uiSchema,
16319
- operators: ((p = c == null ? void 0 : c.filter) == null ? void 0 : p.call(c, (m) => !(m != null && m.visible) || m.visible(e))) || []
16321
+ operators: ((h = d == null ? void 0 : d.filter) == null ? void 0 : h.call(d, (C) => !(C != null && C.visible) || C.visible(e))) || []
16320
16322
  };
16321
16323
  if (!(e.target && t > 2)) {
16322
16324
  if (t > 2)
16323
- return u;
16324
- if (l != null && l.length && (u.children = l), a) {
16325
- const m = n.getDataSource(e.dataSourceKey).collectionManager.getCollectionFields(e.target), h = getOptions$3(m, t + 1, o, n).filter(
16326
- Boolean
16327
- );
16328
- u.children = u.children || [], u.children.push(...h);
16325
+ return p;
16326
+ if (u != null && u.length && (p.children = u), c) {
16327
+ const C = (g = r == null ? void 0 : r.dataSource) == null ? void 0 : g.key, y = e.dataSourceKey || C, v = y && y !== C ? ((x = n == null ? void 0 : n.getDataSource(y)) == null ? void 0 : x.collectionManager) || r : r || ((b = n == null ? void 0 : n.getDataSource(y)) == null ? void 0 : b.collectionManager), S = v == null ? void 0 : v.getCollectionFields(e.target), F = getOptions$3(
16328
+ S || [],
16329
+ t + 1,
16330
+ o,
16331
+ n,
16332
+ v || r,
16333
+ a
16334
+ ).filter(Boolean);
16335
+ p.children = p.children || [], p.children.push(...F);
16329
16336
  }
16330
- return u;
16337
+ return p;
16331
16338
  }
16332
- }, getOptions$3 = (e, t, o, n, r) => {
16333
- const i = [];
16334
- return e.forEach((a) => {
16335
- const l = field2option$1(a, t, o, n);
16336
- l && i.push(l);
16337
- }), i;
16339
+ }, getOptions$3 = (e = [], t, o, n, r, i) => {
16340
+ const a = [];
16341
+ return e.forEach((l) => {
16342
+ const c = field2option$1(l, t, o, n, r, i);
16343
+ c && a.push(c);
16344
+ }), a;
16338
16345
  }, useFilterFieldOptions = (e) => {
16339
- var r;
16340
- const t = useFieldSchema(), o = ((r = t == null ? void 0 : t["x-component-props"]) == null ? void 0 : r.nonfilterable) || [];
16341
- useCollectionManager();
16342
- const n = useDataSourceManager();
16343
- return getOptions$3(e, 1, o, n);
16346
+ var i, a;
16347
+ const t = useFieldSchema(), o = Array.isArray((i = t == null ? void 0 : t["x-component-props"]) == null ? void 0 : i.nonfilterable) ? (a = t == null ? void 0 : t["x-component-props"]) == null ? void 0 : a.nonfilterable : [], n = useCollectionManager(), r = useDataSourceManager();
16348
+ return getOptions$3(e, 1, o, r, n);
16344
16349
  }, isEmpty = (e) => Array.isArray(e) && e.length === 0 || e && Object.keys(e).length === 0 && Object.getPrototypeOf(e) === Object.prototype, removeNullCondition = (e, t = flat) => {
16345
16350
  const o = t(e || {}), n = {};
16346
16351
  for (const r in o) {