@nocobase/client 1.4.3 → 1.4.4
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 +73 -74
- package/lib/index.js +54 -54
- package/package.json +5 -5
package/es/index.mjs
CHANGED
|
@@ -4295,7 +4295,7 @@ function addAppVersion(e, t) {
|
|
|
4295
4295
|
addAppVersion((n = e.properties) == null ? void 0 : n[o], t);
|
|
4296
4296
|
}), e;
|
|
4297
4297
|
}
|
|
4298
|
-
const name = "@nocobase/client", version$1 = "1.4.
|
|
4298
|
+
const name = "@nocobase/client", version$1 = "1.4.4", license = "AGPL-3.0", main = "lib/index.js", module = "es/index.mjs", types = "es/index.d.ts", dependencies = {
|
|
4299
4299
|
"@ahooksjs/use-url-state": "3.5.1",
|
|
4300
4300
|
"@ant-design/cssinjs": "^1.11.1",
|
|
4301
4301
|
"@ant-design/icons": "^5.1.4",
|
|
@@ -4317,9 +4317,9 @@ const name = "@nocobase/client", version$1 = "1.4.3", license = "AGPL-3.0", main
|
|
|
4317
4317
|
"@formily/reactive-react": "^2.2.27",
|
|
4318
4318
|
"@formily/shared": "^2.2.27",
|
|
4319
4319
|
"@formily/validator": "^2.2.27",
|
|
4320
|
-
"@nocobase/evaluators": "1.4.
|
|
4321
|
-
"@nocobase/sdk": "1.4.
|
|
4322
|
-
"@nocobase/utils": "1.4.
|
|
4320
|
+
"@nocobase/evaluators": "1.4.4",
|
|
4321
|
+
"@nocobase/sdk": "1.4.4",
|
|
4322
|
+
"@nocobase/utils": "1.4.4",
|
|
4323
4323
|
ahooks: "^3.7.2",
|
|
4324
4324
|
antd: "5.12.8",
|
|
4325
4325
|
"antd-style": "3.7.1",
|
|
@@ -8823,20 +8823,20 @@ class PluginSettingsManager {
|
|
|
8823
8823
|
const AppComponent = observer(
|
|
8824
8824
|
(o) => {
|
|
8825
8825
|
var n = o, { children: e } = n, t = K(n, ["children"]);
|
|
8826
|
-
var l;
|
|
8827
|
-
const { app: r } = t, i = useCallback((
|
|
8828
|
-
console.error(
|
|
8829
|
-
const
|
|
8830
|
-
|
|
8826
|
+
var l, c;
|
|
8827
|
+
const { app: r } = t, i = useCallback((u, d) => {
|
|
8828
|
+
console.error(u);
|
|
8829
|
+
const p = new Error();
|
|
8830
|
+
p.stack = d.componentStack.trim(), console.error(p);
|
|
8831
8831
|
}, []);
|
|
8832
8832
|
useEffect(() => {
|
|
8833
8833
|
r.load();
|
|
8834
8834
|
}, [r]);
|
|
8835
8835
|
const a = r.getComponent("AppError");
|
|
8836
|
-
return r.loading ? r.renderComponent("AppSpin", { app: r }) : !r.maintained && r.maintaining ? r.renderComponent("AppMaintaining", { app: r }) : (l = r.error) != null && l.code ? /* @__PURE__ */ jsx(a, { app: r, error: r.error }) : /* @__PURE__ */ jsx(
|
|
8836
|
+
return r.loading ? r.renderComponent("AppSpin", { app: r }) : !r.maintained && r.maintaining ? r.renderComponent("AppMaintaining", { app: r }) : (l = r.error) != null && l.code && ((c = r.error) == null ? void 0 : c.code) !== "APP_COMMANDING" ? /* @__PURE__ */ jsx(a, { app: r, error: r.error }) : /* @__PURE__ */ jsx(
|
|
8837
8837
|
ErrorBoundary,
|
|
8838
8838
|
{
|
|
8839
|
-
FallbackComponent: (
|
|
8839
|
+
FallbackComponent: (u) => /* @__PURE__ */ jsx(a, x({ app: r, error: r.error }, u)),
|
|
8840
8840
|
onError: i,
|
|
8841
8841
|
children: /* @__PURE__ */ jsxs(ApplicationContext.Provider, { value: r, children: [
|
|
8842
8842
|
r.maintained && r.maintaining && r.renderComponent("AppMaintainingDialog", { app: r }),
|
|
@@ -14203,7 +14203,7 @@ const useUpdateSchemaTemplateActionProps = () => {
|
|
|
14203
14203
|
];
|
|
14204
14204
|
function useTableColumnInitializerFields() {
|
|
14205
14205
|
const { name: e, currentFields: t = [] } = useCollection_deprecated(), { getInterface: o, getCollection: n } = useCollectionManager_deprecated(), i = useFieldSchema()["x-component"] === "AssociationField.SubTable", a = useForm(), l = i ? a.readPretty : !0;
|
|
14206
|
-
return t.filter((c) => (c == null ? void 0 : c.interface) && (c == null ? void 0 : c.interface) !== "subTable" && !(c != null && c.treeChildren)).map((c) => {
|
|
14206
|
+
return t.filter((c) => !c.collectionName || c.collectionName === e).filter((c) => (c == null ? void 0 : c.interface) && (c == null ? void 0 : c.interface) !== "subTable" && !(c != null && c.treeChildren)).map((c) => {
|
|
14207
14207
|
var h, g, f, C;
|
|
14208
14208
|
const u = o(c.interface), d = (c == null ? void 0 : c.target) && ((h = n(c == null ? void 0 : c.target)) == null ? void 0 : h.template) === "file", p = ((g = c == null ? void 0 : c.uiSchema) == null ? void 0 : g["x-component"]) === "Preview", m = {
|
|
14209
14209
|
name: c.name,
|
|
@@ -14384,62 +14384,62 @@ function useInheritsTableColumnInitializerFields() {
|
|
|
14384
14384
|
});
|
|
14385
14385
|
}
|
|
14386
14386
|
const useFormItemInitializerFields = (e) => {
|
|
14387
|
-
var d;
|
|
14387
|
+
var d, p;
|
|
14388
14388
|
const { name: t, currentFields: o } = useCollection_deprecated(), { getInterface: n, getCollection: r } = useCollectionManager_deprecated(), i = useForm(), { readPretty: a = i.readPretty, block: l = "Form" } = e || {}, { fieldSchema: c } = useActionContext(), u = c == null ? void 0 : c["x-action"];
|
|
14389
|
-
return (d = o == null ? void 0 :
|
|
14390
|
-
var
|
|
14391
|
-
const
|
|
14389
|
+
return (p = (d = o.filter((m) => !m.collectionName || m.collectionName === t)) == null ? void 0 : d.filter((m) => (m == null ? void 0 : m.interface) && !(m != null && m.treeChildren))) == null ? void 0 : p.map((m) => {
|
|
14390
|
+
var v, I, w, k, A;
|
|
14391
|
+
const h = n(m.interface), g = r(m.target), f = (m == null ? void 0 : m.target) && ((v = r(m == null ? void 0 : m.target)) == null ? void 0 : v.template) === "file", C = g, S = (w = (I = m == null ? void 0 : m.uiSchema) == null ? void 0 : I["x-component-props"]) == null ? void 0 : w.fieldNames, b = {
|
|
14392
14392
|
type: "string",
|
|
14393
|
-
name:
|
|
14393
|
+
name: m.name,
|
|
14394
14394
|
"x-toolbar": "FormItemSchemaToolbar",
|
|
14395
14395
|
"x-settings": "fieldSettings:FormItem",
|
|
14396
14396
|
"x-component": "CollectionField",
|
|
14397
14397
|
"x-decorator": "FormItem",
|
|
14398
|
-
"x-collection-field": `${t}.${
|
|
14399
|
-
"x-component-props":
|
|
14398
|
+
"x-collection-field": `${t}.${m.name}`,
|
|
14399
|
+
"x-component-props": f ? {
|
|
14400
14400
|
fieldNames: {
|
|
14401
14401
|
label: "preview",
|
|
14402
14402
|
value: "id"
|
|
14403
14403
|
}
|
|
14404
|
-
} :
|
|
14405
|
-
fieldNames: F(x({},
|
|
14404
|
+
} : C && S ? {
|
|
14405
|
+
fieldNames: F(x({}, S), { label: (g == null ? void 0 : g.titleField) || S.label })
|
|
14406
14406
|
} : {},
|
|
14407
|
-
"x-read-pretty": (
|
|
14408
|
-
},
|
|
14407
|
+
"x-read-pretty": (k = m == null ? void 0 : m.uiSchema) == null ? void 0 : k["x-read-pretty"]
|
|
14408
|
+
}, y = {
|
|
14409
14409
|
type: "item",
|
|
14410
|
-
name:
|
|
14411
|
-
title: ((
|
|
14410
|
+
name: m.name,
|
|
14411
|
+
title: ((A = m == null ? void 0 : m.uiSchema) == null ? void 0 : A.title) || m.name,
|
|
14412
14412
|
Component: "CollectionFieldInitializer",
|
|
14413
14413
|
remove: removeGridFormItem,
|
|
14414
|
-
schemaInitialize: (
|
|
14415
|
-
var
|
|
14416
|
-
(
|
|
14417
|
-
field:
|
|
14414
|
+
schemaInitialize: (D) => {
|
|
14415
|
+
var $;
|
|
14416
|
+
($ = h == null ? void 0 : h.schemaInitialize) == null || $.call(h, D, {
|
|
14417
|
+
field: m,
|
|
14418
14418
|
block: l,
|
|
14419
14419
|
readPretty: a,
|
|
14420
14420
|
action: u,
|
|
14421
|
-
targetCollection:
|
|
14421
|
+
targetCollection: g
|
|
14422
14422
|
});
|
|
14423
14423
|
},
|
|
14424
|
-
schema:
|
|
14424
|
+
schema: b
|
|
14425
14425
|
};
|
|
14426
|
-
return l == "Kanban" && (
|
|
14427
|
-
const
|
|
14428
|
-
return findSchema(
|
|
14429
|
-
}),
|
|
14426
|
+
return l == "Kanban" && (y.find = (D, $, L) => {
|
|
14427
|
+
const z = findSchema(D, "x-component", l);
|
|
14428
|
+
return findSchema(z, $, L);
|
|
14429
|
+
}), y;
|
|
14430
14430
|
});
|
|
14431
14431
|
}, useFilterFormItemInitializerFields = (e) => {
|
|
14432
|
-
var p;
|
|
14432
|
+
var p, m;
|
|
14433
14433
|
const { name: t, currentFields: o } = useCollection_deprecated(), { getInterface: n, getCollection: r } = useCollectionManager_deprecated(), i = useForm(), { readPretty: a = i.readPretty, block: l = "FilterForm" } = e || {}, { snapshot: c, fieldSchema: u } = useActionContext(), d = u == null ? void 0 : u["x-action"];
|
|
14434
|
-
return (p = o == null ? void 0 :
|
|
14435
|
-
var
|
|
14436
|
-
return (
|
|
14437
|
-
})) == null ? void 0 :
|
|
14438
|
-
var
|
|
14439
|
-
const
|
|
14440
|
-
let
|
|
14434
|
+
return (m = (p = o.filter((h) => !h.collectionName || h.collectionName === t)) == null ? void 0 : p.filter((h) => {
|
|
14435
|
+
var g;
|
|
14436
|
+
return (h == null ? void 0 : h.interface) && ((g = n(h.interface)) == null ? void 0 : g.filterable);
|
|
14437
|
+
})) == null ? void 0 : m.map((h) => {
|
|
14438
|
+
var b, y, v;
|
|
14439
|
+
const g = n(h.interface), f = r(h.target);
|
|
14440
|
+
let C = {
|
|
14441
14441
|
type: "string",
|
|
14442
|
-
name:
|
|
14442
|
+
name: h.name,
|
|
14443
14443
|
required: !1,
|
|
14444
14444
|
// 'x-designer': 'FormItem.FilterFormDesigner',
|
|
14445
14445
|
"x-toolbar": "FormItemSchemaToolbar",
|
|
@@ -14447,15 +14447,15 @@ const useFormItemInitializerFields = (e) => {
|
|
|
14447
14447
|
"x-component": "CollectionField",
|
|
14448
14448
|
"x-decorator": "FormItem",
|
|
14449
14449
|
"x-use-decorator-props": "useFormItemProps",
|
|
14450
|
-
"x-collection-field": `${t}.${
|
|
14450
|
+
"x-collection-field": `${t}.${h.name}`,
|
|
14451
14451
|
"x-component-props": {
|
|
14452
14452
|
utc: !1,
|
|
14453
14453
|
underFilter: !0
|
|
14454
14454
|
}
|
|
14455
14455
|
};
|
|
14456
|
-
return isAssocField(
|
|
14456
|
+
return isAssocField(h) && (C = {
|
|
14457
14457
|
type: "string",
|
|
14458
|
-
name: `${
|
|
14458
|
+
name: `${h.name}`,
|
|
14459
14459
|
required: !1,
|
|
14460
14460
|
// 'x-designer': 'FormItem.FilterFormDesigner',
|
|
14461
14461
|
"x-toolbar": "FormItemSchemaToolbar",
|
|
@@ -14463,25 +14463,25 @@ const useFormItemInitializerFields = (e) => {
|
|
|
14463
14463
|
"x-component": "CollectionField",
|
|
14464
14464
|
"x-decorator": "FormItem",
|
|
14465
14465
|
"x-use-decorator-props": "useFormItemProps",
|
|
14466
|
-
"x-collection-field": `${t}.${
|
|
14467
|
-
"x-component-props": F(x({}, (
|
|
14466
|
+
"x-collection-field": `${t}.${h.name}`,
|
|
14467
|
+
"x-component-props": F(x({}, (b = h.uiSchema) == null ? void 0 : b["x-component-props"]), { utc: !1, underFilter: !0 })
|
|
14468
14468
|
}), {
|
|
14469
|
-
name: ((
|
|
14469
|
+
name: ((y = h == null ? void 0 : h.uiSchema) == null ? void 0 : y.title) || h.name,
|
|
14470
14470
|
type: "item",
|
|
14471
|
-
title: ((
|
|
14471
|
+
title: ((v = h == null ? void 0 : h.uiSchema) == null ? void 0 : v.title) || h.name,
|
|
14472
14472
|
Component: "CollectionFieldInitializer",
|
|
14473
14473
|
remove: removeGridFormItem,
|
|
14474
|
-
schemaInitialize: (
|
|
14475
|
-
var
|
|
14476
|
-
(
|
|
14477
|
-
field:
|
|
14474
|
+
schemaInitialize: (I) => {
|
|
14475
|
+
var w;
|
|
14476
|
+
(w = g == null ? void 0 : g.schemaInitialize) == null || w.call(g, I, {
|
|
14477
|
+
field: h,
|
|
14478
14478
|
block: l,
|
|
14479
14479
|
readPretty: a,
|
|
14480
14480
|
action: d,
|
|
14481
|
-
targetCollection:
|
|
14481
|
+
targetCollection: f
|
|
14482
14482
|
});
|
|
14483
14483
|
},
|
|
14484
|
-
schema:
|
|
14484
|
+
schema: C
|
|
14485
14485
|
};
|
|
14486
14486
|
});
|
|
14487
14487
|
}, useAssociatedFormItemInitializerFields = (e) => {
|
|
@@ -33904,7 +33904,7 @@ const ReadPretty$b = observer$1(
|
|
|
33904
33904
|
const l = x(x({}, defaultFieldNames$1), e.fieldNames), c = i.dataSource || e.options || (a == null ? void 0 : a.uiSchema.enum) || [], u = getCurrentOptions(i.value, c, l);
|
|
33905
33905
|
if (!isValid(e.value) && !u.length || isArrayField(i) && ((p = i == null ? void 0 : i.value) == null ? void 0 : p.length) === 0)
|
|
33906
33906
|
return;
|
|
33907
|
-
const d = i.value && u.map((m, h) => /* @__PURE__ */ jsx(Tag, { color: m[l.color], icon: m.icon, children: m[l.label] }, h));
|
|
33907
|
+
const d = i.value !== null && u.map((m, h) => /* @__PURE__ */ jsx(Tag, { color: m[l.color], icon: m.icon, children: m[l.label] }, h));
|
|
33908
33908
|
r(d), o(!1);
|
|
33909
33909
|
}, [
|
|
33910
33910
|
a == null ? void 0 : a.uiSchema.enum,
|
|
@@ -36724,7 +36724,7 @@ const InternalFileManager = (e) => {
|
|
|
36724
36724
|
const w = {
|
|
36725
36725
|
size: "small",
|
|
36726
36726
|
fieldNames: p,
|
|
36727
|
-
multiple: ["o2m", "m2m"].includes(S == null ? void 0 : S.interface) && o,
|
|
36727
|
+
multiple: ["o2m", "m2m", "mbm"].includes(S == null ? void 0 : S.interface) && o,
|
|
36728
36728
|
association: {
|
|
36729
36729
|
target: S == null ? void 0 : S.target
|
|
36730
36730
|
},
|
|
@@ -46854,11 +46854,11 @@ const useCurrentAppInfo = () => useContext(CurrentAppInfoContext), CurrentAppInf
|
|
|
46854
46854
|
}, OverridingCollectionField = (e) => {
|
|
46855
46855
|
const t = useRecord(), o = useCollectionParentRecordData();
|
|
46856
46856
|
return /* @__PURE__ */ jsx(OverridingFieldAction, x({ item: t, parentItem: o }, e));
|
|
46857
|
-
}, getIsOverriding = (e, t) =>
|
|
46857
|
+
}, getIsOverriding = (e, t, o) => t.find((r) => r.name === o.name).collectionName === e, OverridingFieldAction = (e) => {
|
|
46858
46858
|
const { scope: t, getContainer: o, item: n, parentItem: r, children: i, currentCollection: a } = e, { target: l, through: c } = n, { getInterface: u, getCollection: d, getCurrentCollectionFields: p, getChildrenCollections: m, collections: h } = useCollectionManager_deprecated(), [g, f] = useState(!1), [C, S] = useState({}), b = useAPIClient(), { t: y } = useTranslation(), v = useCompile(), I = (j) => {
|
|
46859
46859
|
var B;
|
|
46860
46860
|
return j && ((B = m(j)) == null ? void 0 : B.map((M) => M.name).concat([j]));
|
|
46861
|
-
}, [w, k] = useState({}), A = p(a), D = getIsOverriding(A, n), $ = useMemo(() => h.map((j) => ({
|
|
46861
|
+
}, [w, k] = useState({}), A = p(a), D = getIsOverriding(a, A, n), $ = useMemo(() => h.map((j) => ({
|
|
46862
46862
|
label: v(j.title),
|
|
46863
46863
|
value: j.name
|
|
46864
46864
|
})), []), L = () => {
|
|
@@ -52182,7 +52182,7 @@ class InheritanceCollectionMixin extends Collection {
|
|
|
52182
52182
|
return l > 0 && (r.splice(l), r.forEach((u) => {
|
|
52183
52183
|
const d = this.collectionManager.getCollection(u);
|
|
52184
52184
|
c = c.concat(d.getCurrentFields());
|
|
52185
|
-
})), this.parentCollectionFields[o] = a.filter((u) =>
|
|
52185
|
+
})), this.parentCollectionFields[o] = a.filter((u) => c.find((p) => p.name === u.name).collectionName !== this.name), this.parentCollectionFields[o];
|
|
52186
52186
|
}
|
|
52187
52187
|
getAllCollectionsInheritChain() {
|
|
52188
52188
|
if (this.allCollectionsInheritChain)
|
|
@@ -61472,25 +61472,24 @@ const mockAPIClient = () => {
|
|
|
61472
61472
|
const e = new MockAPIClient(), t = e.mockAdapter();
|
|
61473
61473
|
return { apiClient: e, mockRequest: t };
|
|
61474
61474
|
}, PopupContextProvider = (e) => {
|
|
61475
|
-
var
|
|
61476
|
-
const
|
|
61475
|
+
var p, m;
|
|
61476
|
+
const { visible: t, setVisible: o } = e, [n, r] = useState(!1), { visible: i, setVisible: a } = useContext(PopupVisibleProviderContext) || {
|
|
61477
61477
|
visible: !1,
|
|
61478
61478
|
setVisible: () => {
|
|
61479
61479
|
}
|
|
61480
|
-
},
|
|
61481
|
-
(
|
|
61482
|
-
|
|
61483
|
-
(m = e.setVisible) == null || m.call(e, p), o == null || o(p), r == null || r(p);
|
|
61480
|
+
}, l = useFieldSchema(), c = useCallback(
|
|
61481
|
+
(h) => {
|
|
61482
|
+
o == null || o(h), r == null || r(h), a == null || a(h);
|
|
61484
61483
|
},
|
|
61485
|
-
[
|
|
61486
|
-
),
|
|
61484
|
+
[o, a]
|
|
61485
|
+
), u = ((p = l["x-component-props"]) == null ? void 0 : p.openMode) || "drawer", d = (m = l["x-component-props"]) == null ? void 0 : m.openSize;
|
|
61487
61486
|
return /* @__PURE__ */ jsx(PopupVisibleProvider, { visible: !1, children: /* @__PURE__ */ jsx(
|
|
61488
61487
|
ActionContextProvider,
|
|
61489
61488
|
{
|
|
61490
|
-
visible:
|
|
61491
|
-
setVisible:
|
|
61492
|
-
openMode:
|
|
61493
|
-
openSize:
|
|
61489
|
+
visible: t || n || i,
|
|
61490
|
+
setVisible: c,
|
|
61491
|
+
openMode: u,
|
|
61492
|
+
openSize: d,
|
|
61494
61493
|
children: e.children
|
|
61495
61494
|
}
|
|
61496
61495
|
) });
|