@nocobase/client 0.19.0-alpha.2 → 0.19.0-alpha.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
|
@@ -2100,6 +2100,12 @@ const nocobaseClient = /* @__PURE__ */ _mergeNamespaces({
|
|
|
2100
2100
|
get useIsDetailBlock() {
|
|
2101
2101
|
return useIsDetailBlock;
|
|
2102
2102
|
},
|
|
2103
|
+
get useIsFormReadPretty() {
|
|
2104
|
+
return useIsFormReadPretty;
|
|
2105
|
+
},
|
|
2106
|
+
get useIsSelectFieldMode() {
|
|
2107
|
+
return useIsSelectFieldMode;
|
|
2108
|
+
},
|
|
2103
2109
|
get useLabelUiSchema() {
|
|
2104
2110
|
return useLabelUiSchema;
|
|
2105
2111
|
},
|
|
@@ -32387,6 +32393,60 @@ const filterFormItemSettings = new SchemaSettings({
|
|
|
32387
32393
|
name: "validationRules",
|
|
32388
32394
|
Component: EditValidationRules
|
|
32389
32395
|
},
|
|
32396
|
+
{
|
|
32397
|
+
name: "setDataScope",
|
|
32398
|
+
Component: SchemaSettingsDataScope,
|
|
32399
|
+
useVisible() {
|
|
32400
|
+
const isSelectFieldMode = useIsSelectFieldMode();
|
|
32401
|
+
const isFormReadPretty = useIsFormReadPretty();
|
|
32402
|
+
return isSelectFieldMode && !isFormReadPretty;
|
|
32403
|
+
},
|
|
32404
|
+
useComponentProps() {
|
|
32405
|
+
var _a, _b, _c;
|
|
32406
|
+
const { getCollectionJoinField, getAllCollectionsInheritChain } = useCollectionManager();
|
|
32407
|
+
const { getField } = useCollection();
|
|
32408
|
+
const { form } = useFormBlockContext();
|
|
32409
|
+
const record = useRecord();
|
|
32410
|
+
const field = useField();
|
|
32411
|
+
const fieldSchema = useFieldSchema();
|
|
32412
|
+
const collectionField = getField(fieldSchema["name"]) || getCollectionJoinField(fieldSchema["x-collection-field"]);
|
|
32413
|
+
const variables = useVariables$1();
|
|
32414
|
+
const localVariables = useLocalVariables$1();
|
|
32415
|
+
const { dn } = useDesignable();
|
|
32416
|
+
return {
|
|
32417
|
+
collectionName: collectionField == null ? void 0 : collectionField.target,
|
|
32418
|
+
defaultFilter: ((_c = (_b = (_a = fieldSchema == null ? void 0 : fieldSchema["x-component-props"]) == null ? void 0 : _a.service) == null ? void 0 : _b.params) == null ? void 0 : _c.filter) || {},
|
|
32419
|
+
form,
|
|
32420
|
+
dynamicComponent: (props) => {
|
|
32421
|
+
return /* @__PURE__ */ jsx(
|
|
32422
|
+
VariableInput,
|
|
32423
|
+
__spreadProps(__spreadValues({}, props), {
|
|
32424
|
+
form,
|
|
32425
|
+
collectionField: props.collectionField,
|
|
32426
|
+
record,
|
|
32427
|
+
shouldChange: getShouldChange({
|
|
32428
|
+
collectionField: props.collectionField,
|
|
32429
|
+
variables,
|
|
32430
|
+
localVariables,
|
|
32431
|
+
getAllCollectionsInheritChain
|
|
32432
|
+
})
|
|
32433
|
+
})
|
|
32434
|
+
);
|
|
32435
|
+
},
|
|
32436
|
+
onSubmit: ({ filter }) => {
|
|
32437
|
+
filter = removeNullCondition(filter);
|
|
32438
|
+
_.set(field.componentProps, "service.params.filter", filter);
|
|
32439
|
+
fieldSchema["x-component-props"] = field.componentProps;
|
|
32440
|
+
dn.emit("patch", {
|
|
32441
|
+
schema: {
|
|
32442
|
+
["x-uid"]: fieldSchema["x-uid"],
|
|
32443
|
+
"x-component-props": field.componentProps
|
|
32444
|
+
}
|
|
32445
|
+
});
|
|
32446
|
+
}
|
|
32447
|
+
};
|
|
32448
|
+
}
|
|
32449
|
+
},
|
|
32390
32450
|
{
|
|
32391
32451
|
name: "fieldMode",
|
|
32392
32452
|
Component: EditComponent
|
|
@@ -41063,6 +41123,8 @@ const components$3 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.define
|
|
|
41063
41123
|
useGetFilterOptions,
|
|
41064
41124
|
useGridContext,
|
|
41065
41125
|
useGridRowContext,
|
|
41126
|
+
useIsFormReadPretty,
|
|
41127
|
+
useIsSelectFieldMode,
|
|
41066
41128
|
useLabelUiSchema,
|
|
41067
41129
|
useLinkageAction,
|
|
41068
41130
|
useTabsContext,
|
|
@@ -43353,6 +43415,7 @@ const datetime = {
|
|
|
43353
43415
|
"uiSchema.x-component-props.gmt": {
|
|
43354
43416
|
type: "boolean",
|
|
43355
43417
|
title: '{{t("GMT")}}',
|
|
43418
|
+
"x-hidden": true,
|
|
43356
43419
|
"x-component": "Checkbox",
|
|
43357
43420
|
"x-content": '{{t("Use the same time zone (GMT) for all users")}}',
|
|
43358
43421
|
"x-decorator": "FormItem",
|
|
@@ -61823,6 +61886,8 @@ export {
|
|
|
61823
61886
|
useHistoryCollectionsByNames,
|
|
61824
61887
|
useInheritsTableColumnInitializerFields,
|
|
61825
61888
|
useIsDetailBlock,
|
|
61889
|
+
useIsFormReadPretty,
|
|
61890
|
+
useIsSelectFieldMode,
|
|
61826
61891
|
useLabelUiSchema,
|
|
61827
61892
|
useLinkageAction,
|
|
61828
61893
|
useLinkageCollectionFilterOptions,
|
package/lib/index.js
CHANGED
|
@@ -668,6 +668,8 @@ __export(es_exports, {
|
|
|
668
668
|
useHistoryCollectionsByNames: () => useHistoryCollectionsByNames,
|
|
669
669
|
useInheritsTableColumnInitializerFields: () => useInheritsTableColumnInitializerFields,
|
|
670
670
|
useIsDetailBlock: () => useIsDetailBlock,
|
|
671
|
+
useIsFormReadPretty: () => useIsFormReadPretty,
|
|
672
|
+
useIsSelectFieldMode: () => useIsSelectFieldMode,
|
|
671
673
|
useLabelUiSchema: () => useLabelUiSchema,
|
|
672
674
|
useLinkageAction: () => useLinkageAction,
|
|
673
675
|
useLinkageCollectionFilterOptions: () => useLinkageCollectionFilterOptions,
|
|
@@ -2838,6 +2840,12 @@ const nocobaseClient = /* @__PURE__ */ _mergeNamespaces$1({
|
|
|
2838
2840
|
get useIsDetailBlock() {
|
|
2839
2841
|
return useIsDetailBlock;
|
|
2840
2842
|
},
|
|
2843
|
+
get useIsFormReadPretty() {
|
|
2844
|
+
return useIsFormReadPretty;
|
|
2845
|
+
},
|
|
2846
|
+
get useIsSelectFieldMode() {
|
|
2847
|
+
return useIsSelectFieldMode;
|
|
2848
|
+
},
|
|
2841
2849
|
get useLabelUiSchema() {
|
|
2842
2850
|
return useLabelUiSchema;
|
|
2843
2851
|
},
|
|
@@ -33124,6 +33132,60 @@ const filterFormItemSettings = new SchemaSettings({
|
|
|
33124
33132
|
name: "validationRules",
|
|
33125
33133
|
Component: EditValidationRules
|
|
33126
33134
|
},
|
|
33135
|
+
{
|
|
33136
|
+
name: "setDataScope",
|
|
33137
|
+
Component: SchemaSettingsDataScope,
|
|
33138
|
+
useVisible() {
|
|
33139
|
+
const isSelectFieldMode = useIsSelectFieldMode();
|
|
33140
|
+
const isFormReadPretty = useIsFormReadPretty();
|
|
33141
|
+
return isSelectFieldMode && !isFormReadPretty;
|
|
33142
|
+
},
|
|
33143
|
+
useComponentProps() {
|
|
33144
|
+
var _a, _b, _c;
|
|
33145
|
+
const { getCollectionJoinField, getAllCollectionsInheritChain } = useCollectionManager();
|
|
33146
|
+
const { getField } = useCollection();
|
|
33147
|
+
const { form } = useFormBlockContext();
|
|
33148
|
+
const record = useRecord();
|
|
33149
|
+
const field = (0, import_react.useField)();
|
|
33150
|
+
const fieldSchema = (0, import_react.useFieldSchema)();
|
|
33151
|
+
const collectionField = getField(fieldSchema["name"]) || getCollectionJoinField(fieldSchema["x-collection-field"]);
|
|
33152
|
+
const variables = useVariables$1();
|
|
33153
|
+
const localVariables = useLocalVariables$1();
|
|
33154
|
+
const { dn } = useDesignable();
|
|
33155
|
+
return {
|
|
33156
|
+
collectionName: collectionField == null ? void 0 : collectionField.target,
|
|
33157
|
+
defaultFilter: ((_c = (_b = (_a = fieldSchema == null ? void 0 : fieldSchema["x-component-props"]) == null ? void 0 : _a.service) == null ? void 0 : _b.params) == null ? void 0 : _c.filter) || {},
|
|
33158
|
+
form,
|
|
33159
|
+
dynamicComponent: (props) => {
|
|
33160
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
33161
|
+
VariableInput,
|
|
33162
|
+
__spreadProps(__spreadValues({}, props), {
|
|
33163
|
+
form,
|
|
33164
|
+
collectionField: props.collectionField,
|
|
33165
|
+
record,
|
|
33166
|
+
shouldChange: getShouldChange({
|
|
33167
|
+
collectionField: props.collectionField,
|
|
33168
|
+
variables,
|
|
33169
|
+
localVariables,
|
|
33170
|
+
getAllCollectionsInheritChain
|
|
33171
|
+
})
|
|
33172
|
+
})
|
|
33173
|
+
);
|
|
33174
|
+
},
|
|
33175
|
+
onSubmit: ({ filter }) => {
|
|
33176
|
+
filter = removeNullCondition(filter);
|
|
33177
|
+
import_lodash.default.set(field.componentProps, "service.params.filter", filter);
|
|
33178
|
+
fieldSchema["x-component-props"] = field.componentProps;
|
|
33179
|
+
dn.emit("patch", {
|
|
33180
|
+
schema: {
|
|
33181
|
+
["x-uid"]: fieldSchema["x-uid"],
|
|
33182
|
+
"x-component-props": field.componentProps
|
|
33183
|
+
}
|
|
33184
|
+
});
|
|
33185
|
+
}
|
|
33186
|
+
};
|
|
33187
|
+
}
|
|
33188
|
+
},
|
|
33127
33189
|
{
|
|
33128
33190
|
name: "fieldMode",
|
|
33129
33191
|
Component: EditComponent
|
|
@@ -41800,6 +41862,8 @@ const components$3 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.define
|
|
|
41800
41862
|
useGetFilterOptions,
|
|
41801
41863
|
useGridContext,
|
|
41802
41864
|
useGridRowContext,
|
|
41865
|
+
useIsFormReadPretty,
|
|
41866
|
+
useIsSelectFieldMode,
|
|
41803
41867
|
useLabelUiSchema,
|
|
41804
41868
|
useLinkageAction,
|
|
41805
41869
|
useTabsContext,
|
|
@@ -44090,6 +44154,7 @@ const datetime = {
|
|
|
44090
44154
|
"uiSchema.x-component-props.gmt": {
|
|
44091
44155
|
type: "boolean",
|
|
44092
44156
|
title: '{{t("GMT")}}',
|
|
44157
|
+
"x-hidden": true,
|
|
44093
44158
|
"x-component": "Checkbox",
|
|
44094
44159
|
"x-content": '{{t("Use the same time zone (GMT) for all users")}}',
|
|
44095
44160
|
"x-decorator": "FormItem",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nocobase/client",
|
|
3
|
-
"version": "0.19.0-alpha.
|
|
3
|
+
"version": "0.19.0-alpha.3",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "es/index.mjs",
|
|
@@ -25,9 +25,9 @@
|
|
|
25
25
|
"@formily/reactive-react": "^2.2.27",
|
|
26
26
|
"@formily/shared": "^2.2.27",
|
|
27
27
|
"@formily/validator": "^2.2.27",
|
|
28
|
-
"@nocobase/evaluators": "0.19.0-alpha.
|
|
29
|
-
"@nocobase/sdk": "0.19.0-alpha.
|
|
30
|
-
"@nocobase/utils": "0.19.0-alpha.
|
|
28
|
+
"@nocobase/evaluators": "0.19.0-alpha.3",
|
|
29
|
+
"@nocobase/sdk": "0.19.0-alpha.3",
|
|
30
|
+
"@nocobase/utils": "0.19.0-alpha.3",
|
|
31
31
|
"ahooks": "^3.7.2",
|
|
32
32
|
"antd": "^5.12.8",
|
|
33
33
|
"antd-style": "3.4.5",
|
|
@@ -72,5 +72,5 @@
|
|
|
72
72
|
"dumi": "^2.2.0",
|
|
73
73
|
"dumi-theme-nocobase": "^0.2.19"
|
|
74
74
|
},
|
|
75
|
-
"gitHead": "
|
|
75
|
+
"gitHead": "3cee597df101a3f8f0f1e2a6f75fc2dddd02ac74"
|
|
76
76
|
}
|