@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 +64 -59
- package/lib/{index-C3fHjsMw-D4vY2Hrd.js → index-C3fHjsMw-CvzEor8U.js} +110 -110
- package/lib/index.js +3 -3
- package/lib/locale/zh-CN.json +1 -0
- package/package.json +6 -6
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.
|
|
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.
|
|
9706
|
-
"@nocobase/flow-engine": "2.0.0-beta.
|
|
9707
|
-
"@nocobase/sdk": "2.0.0-beta.
|
|
9708
|
-
"@nocobase/utils": "2.0.0-beta.
|
|
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)
|
|
16274
|
-
var
|
|
16275
|
-
|
|
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
|
|
16278
|
-
if (!(
|
|
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:
|
|
16281
|
-
name:
|
|
16282
|
-
type:
|
|
16283
|
-
target:
|
|
16284
|
-
title: ((
|
|
16285
|
-
schema:
|
|
16286
|
-
interface:
|
|
16287
|
-
operators: ((
|
|
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 (!(
|
|
16290
|
-
if (
|
|
16291
|
-
return
|
|
16292
|
-
if (
|
|
16293
|
-
const
|
|
16294
|
-
|
|
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
|
|
16297
|
+
return C;
|
|
16297
16298
|
}
|
|
16298
|
-
}, i = (
|
|
16299
|
-
const
|
|
16300
|
-
return
|
|
16301
|
-
const
|
|
16302
|
-
|
|
16303
|
-
}),
|
|
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 (
|
|
16306
|
-
}, field2option$1 = (e, t, o, n, r) => {
|
|
16307
|
-
var
|
|
16308
|
-
|
|
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
|
|
16311
|
-
if (!(
|
|
16312
|
+
const l = n == null ? void 0 : n.collectionFieldInterfaceManager.getFieldInterface(e.interface);
|
|
16313
|
+
if (!(l != null && l.filterable))
|
|
16312
16314
|
return;
|
|
16313
|
-
const { nested:
|
|
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: ((
|
|
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: ((
|
|
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
|
|
16324
|
-
if (
|
|
16325
|
-
const
|
|
16326
|
-
|
|
16327
|
-
|
|
16328
|
-
|
|
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
|
|
16337
|
+
return p;
|
|
16331
16338
|
}
|
|
16332
|
-
}, getOptions$3 = (e, t, o, n, r) => {
|
|
16333
|
-
const
|
|
16334
|
-
return e.forEach((
|
|
16335
|
-
const
|
|
16336
|
-
|
|
16337
|
-
}),
|
|
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
|
|
16340
|
-
const t = useFieldSchema(), o = ((
|
|
16341
|
-
|
|
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) {
|