@nocobase/client 0.9.2-alpha.3 → 0.9.3-alpha.1
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/acl/Configuration/schemas/useRoleResourceValues.d.ts +1 -14
- package/es/api-client/hooks/useRequest.d.ts +1 -14
- package/es/api-client/hooks/useRequest.js +48 -53
- package/es/block-provider/DetailsBlockProvider.js +13 -1
- package/es/block-provider/FormBlockProvider.js +30 -13
- package/es/block-provider/hooks/index.d.ts +11 -1
- package/es/block-provider/hooks/index.js +527 -301
- package/es/collection-manager/Configuration/CollectionFields.js +1 -2
- package/es/collection-manager/Configuration/EditCollectionAction.d.ts +1 -14
- package/es/collection-manager/action-hooks.d.ts +4 -43
- package/es/collection-manager/action-hooks.js +18 -7
- package/es/collection-manager/interfaces/createdBy.js +1 -1
- package/es/collection-manager/interfaces/linkTo.js +5 -40
- package/es/collection-manager/interfaces/m2m.js +6 -39
- package/es/collection-manager/interfaces/m2o.js +6 -39
- package/es/collection-manager/interfaces/o2m.js +6 -69
- package/es/collection-manager/interfaces/o2o.js +31 -122
- package/es/collection-manager/interfaces/types.d.ts +2 -0
- package/es/collection-manager/interfaces/updatedBy.js +1 -1
- package/es/collection-manager/sub-table.d.ts +1 -14
- package/es/collection-manager/templates/tree.js +2 -2
- package/es/filter-provider/FilterProvider.js +3 -1
- package/es/locale/en_US.d.ts +4 -1
- package/es/locale/en_US.js +6 -3
- package/es/locale/ja_JP.d.ts +4 -1
- package/es/locale/ja_JP.js +4 -1
- package/es/locale/pt_BR.d.ts +1 -1
- package/es/locale/pt_BR.js +1 -1
- package/es/locale/zh_CN.d.ts +5 -1
- package/es/locale/zh_CN.js +5 -1
- package/es/schema-component/antd/action/Action.Designer.js +4 -5
- package/es/schema-component/antd/association-field/AssociationFieldProvider.d.ts +2 -0
- package/es/schema-component/antd/association-field/AssociationFieldProvider.js +19 -0
- package/es/schema-component/antd/association-field/AssociationSelect.d.ts +14 -0
- package/es/schema-component/antd/association-field/AssociationSelect.js +118 -0
- package/es/schema-component/antd/association-field/Editable.d.ts +2 -0
- package/es/schema-component/antd/association-field/Editable.js +88 -0
- package/es/schema-component/antd/association-field/FileManager.d.ts +4 -0
- package/es/schema-component/antd/association-field/FileManager.js +243 -0
- package/es/schema-component/antd/association-field/InternalNester.d.ts +1 -0
- package/es/schema-component/antd/association-field/InternalNester.js +28 -0
- package/es/schema-component/antd/association-field/InternalPicker.d.ts +2 -0
- package/es/schema-component/antd/association-field/InternalPicker.js +267 -0
- package/es/schema-component/antd/association-field/InternalSubTable.d.ts +1 -0
- package/es/schema-component/antd/association-field/InternalSubTable.js +28 -0
- package/es/schema-component/antd/association-field/InternalViewer.d.ts +2 -0
- package/es/schema-component/antd/association-field/InternalViewer.js +115 -0
- package/es/schema-component/antd/association-field/Nester.d.ts +1 -0
- package/es/schema-component/antd/association-field/Nester.js +80 -0
- package/es/schema-component/antd/association-field/ReadPretty.d.ts +2 -0
- package/es/schema-component/antd/association-field/ReadPretty.js +38 -0
- package/es/schema-component/antd/association-field/SubTable.d.ts +1 -0
- package/es/schema-component/antd/association-field/SubTable.js +25 -0
- package/es/schema-component/antd/association-field/context.d.ts +7 -0
- package/es/schema-component/antd/association-field/context.js +2 -0
- package/es/schema-component/antd/association-field/hooks.d.ts +8 -0
- package/es/schema-component/antd/association-field/hooks.js +96 -0
- package/es/schema-component/antd/association-field/index.d.ts +1 -0
- package/es/schema-component/antd/association-field/index.js +14 -0
- package/es/schema-component/antd/association-field/schema.d.ts +142 -0
- package/es/schema-component/antd/association-field/schema.js +141 -0
- package/es/schema-component/antd/association-field/util.d.ts +8 -0
- package/es/schema-component/antd/association-field/util.js +84 -0
- package/es/schema-component/antd/association-filter/AssociationFilter.FilterBlockInitializer.js +2 -2
- package/es/schema-component/antd/association-select/AssociationSelect.js +11 -2
- package/es/schema-component/antd/expand-action/Expand.Action.Design.d.ts +1 -0
- package/es/schema-component/antd/expand-action/Expand.Action.Design.js +112 -0
- package/es/schema-component/antd/expand-action/Expand.Action.d.ts +1 -0
- package/es/schema-component/antd/expand-action/Expand.Action.js +40 -0
- package/es/schema-component/antd/expand-action/index.d.ts +1 -0
- package/es/schema-component/antd/expand-action/index.js +5 -0
- package/es/schema-component/antd/filter/Filter.Action.Designer.js +10 -12
- package/es/schema-component/antd/filter/FilterItem.js +1 -1
- package/es/schema-component/antd/filter/useOperators.d.ts +1 -1
- package/es/schema-component/antd/form-item/FormItem.d.ts +2 -1
- package/es/schema-component/antd/form-item/FormItem.js +206 -58
- package/es/schema-component/antd/form-item/SchemaSettingOptions.js +36 -58
- package/es/schema-component/antd/form-v2/utils.js +6 -4
- package/es/schema-component/antd/gantt/components/gantt/gantt.js +3 -3
- package/es/schema-component/antd/gantt/components/other/tooltip.js +1 -1
- package/es/schema-component/antd/index.d.ts +3 -1
- package/es/schema-component/antd/index.js +3 -1
- package/es/schema-component/antd/menu/Menu.js +6 -3
- package/es/schema-component/antd/record-picker/InputRecordPicker.d.ts +1 -0
- package/es/schema-component/antd/record-picker/InputRecordPicker.js +40 -17
- package/es/schema-component/antd/remote-select/RemoteSelect.js +16 -18
- package/es/schema-component/antd/table-v2/Table.Column.Designer.js +18 -9
- package/es/schema-component/antd/table-v2/Table.Index.d.ts +1 -0
- package/es/schema-component/antd/table-v2/Table.Index.js +6 -0
- package/es/schema-component/antd/table-v2/Table.js +9 -5
- package/es/schema-component/antd/table-v2/index.js +3 -1
- package/es/schema-component/antd/table-v2/utils.js +1 -1
- package/es/schema-component/antd/variable/Input.js +15 -16
- package/es/schema-component/antd/variable/TextArea.js +2 -5
- package/es/schema-component/antd/variable/Variable.d.ts +2 -0
- package/es/schema-component/antd/variable/Variable.js +5 -2
- package/es/schema-component/common/dnd-context/index.js +3 -2
- package/es/schema-component/common/sortable-item/SortableItem.js +4 -1
- package/es/schema-component/common/utils/uitls.js +1 -1
- package/es/schema-component/hooks/index.d.ts +1 -0
- package/es/schema-component/hooks/index.js +2 -1
- package/es/schema-component/hooks/useFieldModeOptions.d.ts +4 -0
- package/es/schema-component/hooks/useFieldModeOptions.js +105 -0
- package/es/schema-initializer/components/CreateRecordAction.d.ts +1 -1
- package/es/schema-initializer/components/CreateRecordAction.js +4 -3
- package/es/schema-initializer/items/ExpandActionInitializer.d.ts +0 -1
- package/es/schema-initializer/items/ExpandActionInitializer.js +9 -34
- package/es/schema-initializer/items/SelectActionInitializer.d.ts +1 -0
- package/es/schema-initializer/items/SelectActionInitializer.js +65 -0
- package/es/schema-initializer/items/index.d.ts +1 -0
- package/es/schema-initializer/items/index.js +2 -1
- package/es/schema-initializer/utils.js +57 -43
- package/es/schema-settings/LinkageRules/FilterDynamicComponent.js +1 -1
- package/es/schema-settings/LinkageRules/Variables.d.ts +1 -1
- package/es/schema-settings/LinkageRules/Variables.js +7 -4
- package/es/schema-settings/SchemaSettings.js +3 -3
- package/es/schema-settings/VariableInput/VariableInput.d.ts +3 -2
- package/es/schema-settings/VariableInput/VariableInput.js +3 -1
- package/lib/acl/Configuration/schemas/useRoleResourceValues.d.ts +1 -14
- package/lib/api-client/hooks/useRequest.d.ts +1 -14
- package/lib/api-client/hooks/useRequest.js +48 -53
- package/lib/block-provider/DetailsBlockProvider.js +13 -1
- package/lib/block-provider/FormBlockProvider.js +31 -15
- package/lib/block-provider/hooks/index.d.ts +11 -1
- package/lib/block-provider/hooks/index.js +537 -308
- package/lib/collection-manager/Configuration/CollectionFields.js +1 -2
- package/lib/collection-manager/Configuration/EditCollectionAction.d.ts +1 -14
- package/lib/collection-manager/action-hooks.d.ts +4 -43
- package/lib/collection-manager/action-hooks.js +18 -7
- package/lib/collection-manager/interfaces/createdBy.js +1 -1
- package/lib/collection-manager/interfaces/linkTo.js +4 -39
- package/lib/collection-manager/interfaces/m2m.js +5 -38
- package/lib/collection-manager/interfaces/m2o.js +5 -38
- package/lib/collection-manager/interfaces/o2m.js +8 -71
- package/lib/collection-manager/interfaces/o2o.js +36 -127
- package/lib/collection-manager/interfaces/types.d.ts +2 -0
- package/lib/collection-manager/interfaces/updatedBy.js +1 -1
- package/lib/collection-manager/sub-table.d.ts +1 -14
- package/lib/collection-manager/templates/tree.js +2 -2
- package/lib/filter-provider/FilterProvider.js +3 -1
- package/lib/locale/en_US.d.ts +4 -1
- package/lib/locale/en_US.js +6 -3
- package/lib/locale/ja_JP.d.ts +4 -1
- package/lib/locale/ja_JP.js +4 -1
- package/lib/locale/pt_BR.d.ts +1 -1
- package/lib/locale/pt_BR.js +1 -1
- package/lib/locale/zh_CN.d.ts +5 -1
- package/lib/locale/zh_CN.js +5 -1
- package/lib/schema-component/antd/action/Action.Designer.js +4 -5
- package/lib/schema-component/antd/association-field/AssociationFieldProvider.d.ts +2 -0
- package/lib/schema-component/antd/association-field/AssociationFieldProvider.js +28 -0
- package/lib/schema-component/antd/association-field/AssociationSelect.d.ts +14 -0
- package/lib/schema-component/antd/association-field/AssociationSelect.js +129 -0
- package/lib/schema-component/antd/association-field/Editable.d.ts +2 -0
- package/lib/schema-component/antd/association-field/Editable.js +97 -0
- package/lib/schema-component/antd/association-field/FileManager.d.ts +4 -0
- package/lib/schema-component/antd/association-field/FileManager.js +253 -0
- package/lib/schema-component/antd/association-field/InternalNester.d.ts +1 -0
- package/lib/schema-component/antd/association-field/InternalNester.js +39 -0
- package/lib/schema-component/antd/association-field/InternalPicker.d.ts +2 -0
- package/lib/schema-component/antd/association-field/InternalPicker.js +277 -0
- package/lib/schema-component/antd/association-field/InternalSubTable.d.ts +1 -0
- package/lib/schema-component/antd/association-field/InternalSubTable.js +39 -0
- package/lib/schema-component/antd/association-field/InternalViewer.d.ts +2 -0
- package/lib/schema-component/antd/association-field/InternalViewer.js +126 -0
- package/lib/schema-component/antd/association-field/Nester.d.ts +1 -0
- package/lib/schema-component/antd/association-field/Nester.js +89 -0
- package/lib/schema-component/antd/association-field/ReadPretty.d.ts +2 -0
- package/lib/schema-component/antd/association-field/ReadPretty.js +47 -0
- package/lib/schema-component/antd/association-field/SubTable.d.ts +1 -0
- package/lib/schema-component/antd/association-field/SubTable.js +33 -0
- package/lib/schema-component/antd/association-field/context.d.ts +7 -0
- package/lib/schema-component/antd/association-field/context.js +9 -0
- package/lib/schema-component/antd/association-field/hooks.d.ts +8 -0
- package/lib/schema-component/antd/association-field/hooks.js +107 -0
- package/lib/schema-component/antd/association-field/index.d.ts +1 -0
- package/lib/schema-component/antd/association-field/index.js +21 -0
- package/lib/schema-component/antd/association-field/schema.d.ts +142 -0
- package/lib/schema-component/antd/association-field/schema.js +148 -0
- package/lib/schema-component/antd/association-field/util.d.ts +8 -0
- package/lib/schema-component/antd/association-field/util.js +98 -0
- package/lib/schema-component/antd/association-filter/AssociationFilter.FilterBlockInitializer.js +2 -2
- package/lib/schema-component/antd/association-select/AssociationSelect.js +10 -1
- package/lib/schema-component/antd/expand-action/Expand.Action.Design.d.ts +1 -0
- package/lib/schema-component/antd/expand-action/Expand.Action.Design.js +120 -0
- package/lib/schema-component/antd/expand-action/Expand.Action.d.ts +1 -0
- package/lib/schema-component/antd/expand-action/Expand.Action.js +48 -0
- package/lib/schema-component/antd/expand-action/index.d.ts +1 -0
- package/lib/schema-component/antd/expand-action/index.js +12 -0
- package/lib/schema-component/antd/filter/Filter.Action.Designer.js +10 -12
- package/lib/schema-component/antd/filter/FilterItem.js +1 -1
- package/lib/schema-component/antd/filter/useOperators.d.ts +1 -1
- package/lib/schema-component/antd/form-item/FormItem.d.ts +2 -1
- package/lib/schema-component/antd/form-item/FormItem.js +204 -55
- package/lib/schema-component/antd/form-item/SchemaSettingOptions.js +34 -56
- package/lib/schema-component/antd/form-v2/utils.js +6 -5
- package/lib/schema-component/antd/gantt/components/gantt/gantt.js +3 -3
- package/lib/schema-component/antd/gantt/components/other/tooltip.js +1 -1
- package/lib/schema-component/antd/index.d.ts +3 -1
- package/lib/schema-component/antd/index.js +33 -11
- package/lib/schema-component/antd/menu/Menu.js +6 -3
- package/lib/schema-component/antd/record-picker/InputRecordPicker.d.ts +1 -0
- package/lib/schema-component/antd/record-picker/InputRecordPicker.js +42 -18
- package/lib/schema-component/antd/remote-select/RemoteSelect.js +15 -17
- package/lib/schema-component/antd/table-v2/Table.Column.Designer.js +18 -9
- package/lib/schema-component/antd/table-v2/Table.Index.d.ts +1 -0
- package/lib/schema-component/antd/table-v2/Table.Index.js +14 -0
- package/lib/schema-component/antd/table-v2/Table.js +9 -5
- package/lib/schema-component/antd/table-v2/index.js +3 -1
- package/lib/schema-component/antd/table-v2/utils.js +1 -1
- package/lib/schema-component/antd/variable/Input.js +15 -16
- package/lib/schema-component/antd/variable/TextArea.js +2 -5
- package/lib/schema-component/antd/variable/Variable.d.ts +2 -0
- package/lib/schema-component/antd/variable/Variable.js +6 -2
- package/lib/schema-component/common/dnd-context/index.js +3 -2
- package/lib/schema-component/common/sortable-item/SortableItem.js +4 -1
- package/lib/schema-component/common/utils/uitls.js +1 -1
- package/lib/schema-component/hooks/index.d.ts +1 -0
- package/lib/schema-component/hooks/index.js +11 -0
- package/lib/schema-component/hooks/useFieldModeOptions.d.ts +4 -0
- package/lib/schema-component/hooks/useFieldModeOptions.js +112 -0
- package/lib/schema-initializer/components/CreateRecordAction.d.ts +1 -1
- package/lib/schema-initializer/components/CreateRecordAction.js +4 -3
- package/lib/schema-initializer/items/ExpandActionInitializer.d.ts +0 -1
- package/lib/schema-initializer/items/ExpandActionInitializer.js +11 -37
- package/lib/schema-initializer/items/SelectActionInitializer.d.ts +1 -0
- package/lib/schema-initializer/items/SelectActionInitializer.js +73 -0
- package/lib/schema-initializer/items/index.d.ts +1 -0
- package/lib/schema-initializer/items/index.js +11 -0
- package/lib/schema-initializer/utils.js +56 -42
- package/lib/schema-settings/LinkageRules/FilterDynamicComponent.js +1 -1
- package/lib/schema-settings/LinkageRules/Variables.d.ts +1 -1
- package/lib/schema-settings/LinkageRules/Variables.js +7 -4
- package/lib/schema-settings/SchemaSettings.js +4 -4
- package/lib/schema-settings/VariableInput/VariableInput.d.ts +3 -2
- package/lib/schema-settings/VariableInput/VariableInput.js +3 -1
- package/package.json +5 -6
|
@@ -280,12 +280,15 @@ var useFormItemInitializerFields = function useFormItemInitializerFields(options
|
|
|
280
280
|
var _field$uiSchema3, _field$uiSchema4;
|
|
281
281
|
var interfaceConfig = getInterface(field.interface);
|
|
282
282
|
var targetCollection = getCollection(field.target);
|
|
283
|
-
|
|
283
|
+
// const component =
|
|
284
|
+
// field.interface === 'o2m' && targetCollection?.template !== 'file' && !snapshot
|
|
285
|
+
// ? 'TableField'
|
|
286
|
+
// : 'CollectionField';
|
|
284
287
|
var schema = {
|
|
285
288
|
type: 'string',
|
|
286
289
|
name: field.name,
|
|
287
290
|
'x-designer': 'FormItem.Designer',
|
|
288
|
-
'x-component':
|
|
291
|
+
'x-component': 'CollectionField',
|
|
289
292
|
'x-decorator': 'FormItem',
|
|
290
293
|
'x-collection-field': "".concat(name, ".").concat(field.name),
|
|
291
294
|
'x-component-props': {},
|
|
@@ -345,13 +348,16 @@ var useFilterFormItemInitializerFields = function useFilterFormItemInitializerFi
|
|
|
345
348
|
var _field$uiSchema6;
|
|
346
349
|
var interfaceConfig = getInterface(field.interface);
|
|
347
350
|
var targetCollection = getCollection(field.target);
|
|
348
|
-
|
|
351
|
+
// const component =
|
|
352
|
+
// field.interface === 'o2m' && targetCollection?.template !== 'file' && !snapshot
|
|
353
|
+
// ? 'TableField'
|
|
354
|
+
// : 'CollectionField';
|
|
349
355
|
var schema = {
|
|
350
356
|
type: 'string',
|
|
351
357
|
name: field.name,
|
|
352
358
|
required: false,
|
|
353
359
|
'x-designer': 'FormItem.FilterFormDesigner',
|
|
354
|
-
'x-component':
|
|
360
|
+
'x-component': 'CollectionField',
|
|
355
361
|
'x-decorator': 'FormItem',
|
|
356
362
|
'x-collection-field': "".concat(name, ".").concat(field.name),
|
|
357
363
|
'x-component-props': {}
|
|
@@ -539,13 +545,16 @@ var useInheritsFormItemInitializerFields = function useInheritsFormItemInitializ
|
|
|
539
545
|
var _field$uiSchema10, _field$uiSchema11, _field$uiSchema12;
|
|
540
546
|
var interfaceConfig = getInterface(field.interface);
|
|
541
547
|
var targetCollection = getCollection(field.target);
|
|
542
|
-
|
|
548
|
+
// const component =
|
|
549
|
+
// field.interface === 'o2m' && targetCollection?.template !== 'file' && !snapshot
|
|
550
|
+
// ? 'TableField'
|
|
551
|
+
// : 'CollectionField';
|
|
543
552
|
var schema = {
|
|
544
553
|
type: 'string',
|
|
545
554
|
name: field.name,
|
|
546
555
|
title: (field === null || field === void 0 ? void 0 : (_field$uiSchema10 = field.uiSchema) === null || _field$uiSchema10 === void 0 ? void 0 : _field$uiSchema10.title) || field.name,
|
|
547
556
|
'x-designer': 'FormItem.Designer',
|
|
548
|
-
'x-component':
|
|
557
|
+
'x-component': 'CollectionField',
|
|
549
558
|
'x-decorator': 'FormItem',
|
|
550
559
|
'x-collection-field': "".concat(name, ".").concat(field.name),
|
|
551
560
|
'x-component-props': {},
|
|
@@ -600,14 +609,17 @@ var useFilterInheritsFormItemInitializerFields = function useFilterInheritsFormI
|
|
|
600
609
|
var _field$uiSchema13, _field$uiSchema14, _field$uiSchema15;
|
|
601
610
|
var interfaceConfig = getInterface(field.interface);
|
|
602
611
|
var targetCollection = getCollection(field.target);
|
|
603
|
-
|
|
612
|
+
// const component =
|
|
613
|
+
// field.interface === 'o2m' && targetCollection?.template !== 'file' && !snapshot
|
|
614
|
+
// ? 'TableField'
|
|
615
|
+
// : 'CollectionField';
|
|
604
616
|
var schema = {
|
|
605
617
|
type: 'string',
|
|
606
618
|
name: field.name,
|
|
607
619
|
title: (field === null || field === void 0 ? void 0 : (_field$uiSchema13 = field.uiSchema) === null || _field$uiSchema13 === void 0 ? void 0 : _field$uiSchema13.title) || field.name,
|
|
608
620
|
required: false,
|
|
609
621
|
'x-designer': 'FormItem.FilterFormDesigner',
|
|
610
|
-
'x-component':
|
|
622
|
+
'x-component': 'CollectionField',
|
|
611
623
|
'x-decorator': 'FormItem',
|
|
612
624
|
'x-collection-field': "".concat(name, ".").concat(field.name),
|
|
613
625
|
'x-component-props': {},
|
|
@@ -650,7 +662,7 @@ var useCustomFormItemInitializerFields = function useCustomFormItemInitializerFi
|
|
|
650
662
|
var remove = useRemoveGridFormItem();
|
|
651
663
|
return currentFields === null || currentFields === void 0 ? void 0 : (_currentFields$filter3 = currentFields.filter(function (field) {
|
|
652
664
|
var _field$uiSchema16;
|
|
653
|
-
return (field === null || field === void 0 ? void 0 : field.interface) && !(field === null || field === void 0 ? void 0 : (_field$uiSchema16 = field.uiSchema) === null || _field$uiSchema16 === void 0 ? void 0 : _field$uiSchema16['x-read-pretty']) && field.interface !== 'snapshot';
|
|
665
|
+
return (field === null || field === void 0 ? void 0 : field.interface) && !(field === null || field === void 0 ? void 0 : (_field$uiSchema16 = field.uiSchema) === null || _field$uiSchema16 === void 0 ? void 0 : _field$uiSchema16['x-read-pretty']) && field.interface !== 'snapshot' && field.type !== 'sequence';
|
|
654
666
|
})) === null || _currentFields$filter3 === void 0 ? void 0 : _currentFields$filter3.map(function (field) {
|
|
655
667
|
var _field$uiSchema17, _field$uiSchema18;
|
|
656
668
|
var interfaceConfig = getInterface(field.interface);
|
|
@@ -683,7 +695,6 @@ var useCustomFormItemInitializerFields = function useCustomFormItemInitializerFi
|
|
|
683
695
|
};
|
|
684
696
|
exports.useCustomFormItemInitializerFields = useCustomFormItemInitializerFields;
|
|
685
697
|
var useCustomBulkEditFormItemInitializerFields = function useCustomBulkEditFormItemInitializerFields(options) {
|
|
686
|
-
var _fields$filter6;
|
|
687
698
|
var _useCollection11 = (0, _collectionManager.useCollection)(),
|
|
688
699
|
name = _useCollection11.name,
|
|
689
700
|
fields = _useCollection11.fields;
|
|
@@ -697,38 +708,41 @@ var useCustomBulkEditFormItemInitializerFields = function useCustomBulkEditFormI
|
|
|
697
708
|
_ref10$block = _ref10.block,
|
|
698
709
|
block = _ref10$block === void 0 ? 'Form' : _ref10$block;
|
|
699
710
|
var remove = useRemoveGridFormItem();
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
711
|
+
var filterFields = (0, _react2.useMemo)(function () {
|
|
712
|
+
return fields === null || fields === void 0 ? void 0 : fields.filter(function (field) {
|
|
713
|
+
var _field$uiSchema19;
|
|
714
|
+
return (field === null || field === void 0 ? void 0 : field.interface) && !(field === null || field === void 0 ? void 0 : (_field$uiSchema19 = field.uiSchema) === null || _field$uiSchema19 === void 0 ? void 0 : _field$uiSchema19['x-read-pretty']) && field.interface !== 'snapshot' && field.type !== 'sequence';
|
|
715
|
+
}).map(function (field) {
|
|
716
|
+
var _field$uiSchema20, _field$uiSchema21;
|
|
717
|
+
var interfaceConfig = getInterface(field.interface);
|
|
718
|
+
var schema = {
|
|
719
|
+
type: 'string',
|
|
720
|
+
name: field.name,
|
|
721
|
+
title: (field === null || field === void 0 ? void 0 : (_field$uiSchema20 = field.uiSchema) === null || _field$uiSchema20 === void 0 ? void 0 : _field$uiSchema20.title) || field.name,
|
|
722
|
+
'x-designer': 'FormItem.Designer',
|
|
723
|
+
'x-component': 'BulkEditField',
|
|
724
|
+
'x-decorator': 'FormItem',
|
|
725
|
+
'x-collection-field': "".concat(name, ".").concat(field.name)
|
|
726
|
+
};
|
|
727
|
+
return {
|
|
728
|
+
type: 'item',
|
|
729
|
+
title: (field === null || field === void 0 ? void 0 : (_field$uiSchema21 = field.uiSchema) === null || _field$uiSchema21 === void 0 ? void 0 : _field$uiSchema21.title) || field.name,
|
|
730
|
+
component: 'CollectionFieldInitializer',
|
|
731
|
+
remove: remove,
|
|
732
|
+
schemaInitialize: function schemaInitialize(s) {
|
|
733
|
+
var _interfaceConfig$sche10;
|
|
734
|
+
interfaceConfig === null || interfaceConfig === void 0 ? void 0 : (_interfaceConfig$sche10 = interfaceConfig.schemaInitialize) === null || _interfaceConfig$sche10 === void 0 ? void 0 : _interfaceConfig$sche10.call(interfaceConfig, s, {
|
|
735
|
+
field: field,
|
|
736
|
+
block: block,
|
|
737
|
+
readPretty: readPretty,
|
|
738
|
+
targetCollection: getCollection(field.target)
|
|
739
|
+
});
|
|
740
|
+
},
|
|
741
|
+
schema: schema
|
|
742
|
+
};
|
|
743
|
+
});
|
|
744
|
+
}, [fields]);
|
|
745
|
+
return filterFields;
|
|
732
746
|
};
|
|
733
747
|
exports.useCustomBulkEditFormItemInitializerFields = useCustomBulkEditFormItemInitializerFields;
|
|
734
748
|
var findSchema = function findSchema(schema, key, action) {
|
|
@@ -13,7 +13,7 @@ function FilterDynamicComponent(props) {
|
|
|
13
13
|
onChange = props.onChange,
|
|
14
14
|
renderSchemaComponent = props.renderSchemaComponent,
|
|
15
15
|
collectionName = props.collectionName;
|
|
16
|
-
var scope = (0, _Variables.useVariableOptions)(collectionName);
|
|
16
|
+
var scope = (0, _Variables.useVariableOptions)(collectionName, ['o2m', 'm2m']);
|
|
17
17
|
return /*#__PURE__*/_react.default.createElement(_schemaComponent.Variable.Input, {
|
|
18
18
|
value: value,
|
|
19
19
|
onChange: onChange,
|
|
@@ -12,8 +12,9 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
12
12
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
13
13
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
14
14
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
15
|
-
var supportsType = ['checkbox', 'number', 'percent', 'integer', 'input', 'textarea', 'email', 'phone', 'datetime', 'createdAt', 'updatedAt', 'radioGroup', 'checkboxGroup', 'select', 'multipleSelect', 'formula', 'oho', 'obo', 'm2o', 'o2m', 'm2m'];
|
|
15
|
+
var supportsType = ['id', 'checkbox', 'number', 'percent', 'integer', 'input', 'textarea', 'email', 'phone', 'datetime', 'createdAt', 'updatedAt', 'radioGroup', 'checkboxGroup', 'select', 'multipleSelect', 'formula', 'oho', 'obo', 'm2o', 'o2m', 'm2m'];
|
|
16
16
|
var useVariableTypes = function useVariableTypes(currentCollection) {
|
|
17
|
+
var excludes = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
17
18
|
var _useCollectionManager = (0, _collectionManager.useCollectionManager)(),
|
|
18
19
|
getCollectionFields = _useCollectionManager.getCollectionFields,
|
|
19
20
|
getInterface = _useCollectionManager.getInterface,
|
|
@@ -26,7 +27,9 @@ var useVariableTypes = function useVariableTypes(currentCollection) {
|
|
|
26
27
|
options: function options() {
|
|
27
28
|
var field2option = function field2option(field, depth) {
|
|
28
29
|
var _field$uiSchema;
|
|
29
|
-
if (!field.interface || !supportsType.
|
|
30
|
+
if (!field.interface || !supportsType.filter(function (v) {
|
|
31
|
+
return !excludes.includes(v);
|
|
32
|
+
}).includes(field.interface)) {
|
|
30
33
|
return;
|
|
31
34
|
}
|
|
32
35
|
var fieldInterface = getInterface(field.interface);
|
|
@@ -82,9 +85,9 @@ var useVariableTypes = function useVariableTypes(currentCollection) {
|
|
|
82
85
|
}]
|
|
83
86
|
}];
|
|
84
87
|
};
|
|
85
|
-
function useVariableOptions(collectionName) {
|
|
88
|
+
function useVariableOptions(collectionName, excludes) {
|
|
86
89
|
var compile = (0, _schemaComponent.useCompile)();
|
|
87
|
-
var options = useVariableTypes(collectionName).map(function (item) {
|
|
90
|
+
var options = useVariableTypes(collectionName, excludes).map(function (item) {
|
|
88
91
|
var options = typeof item.options === 'function' ? item.options() : item.options;
|
|
89
92
|
return {
|
|
90
93
|
label: compile(item.title),
|
|
@@ -25,6 +25,7 @@ var _BlockTemplate = require("../schema-templates/BlockTemplate");
|
|
|
25
25
|
var _DataTemplates = require("./DataTemplates");
|
|
26
26
|
var _LinkageRules = require("./LinkageRules");
|
|
27
27
|
var _actionHooks = require("./LinkageRules/action-hooks");
|
|
28
|
+
var _EnableChildCollections = require("./EnableChildCollections");
|
|
28
29
|
var _templateObject;
|
|
29
30
|
var _excluded = ["children", "fieldSchema"],
|
|
30
31
|
_excluded2 = ["title", "dn"],
|
|
@@ -1213,7 +1214,7 @@ SchemaSettings.DataTemplates = function DataTemplates(props) {
|
|
|
1213
1214
|
}
|
|
1214
1215
|
});
|
|
1215
1216
|
};
|
|
1216
|
-
SchemaSettings.EnableChildCollections = function
|
|
1217
|
+
SchemaSettings.EnableChildCollections = function EnableChildCollectionsItem(props) {
|
|
1217
1218
|
var collectionName = props.collectionName;
|
|
1218
1219
|
var fieldSchema = (0, _react.useFieldSchema)();
|
|
1219
1220
|
var _useDesignable5 = (0, _2.useDesignable)(),
|
|
@@ -1233,7 +1234,7 @@ SchemaSettings.EnableChildCollections = function EnableChildCollections(props) {
|
|
|
1233
1234
|
title: t('Enable child collections'),
|
|
1234
1235
|
properties: {
|
|
1235
1236
|
enableChildren: {
|
|
1236
|
-
'x-component': EnableChildCollections,
|
|
1237
|
+
'x-component': _EnableChildCollections.EnableChildCollections,
|
|
1237
1238
|
'x-component-props': {
|
|
1238
1239
|
useProps: function useProps() {
|
|
1239
1240
|
return {
|
|
@@ -1253,7 +1254,6 @@ SchemaSettings.EnableChildCollections = function EnableChildCollections(props) {
|
|
|
1253
1254
|
}
|
|
1254
1255
|
},
|
|
1255
1256
|
onSubmit: function onSubmit(v) {
|
|
1256
|
-
console.log(v);
|
|
1257
1257
|
var enableChildren = [];
|
|
1258
1258
|
var _iterator2 = _createForOfIteratorHelper(v.enableChildren.childrenCollections),
|
|
1259
1259
|
_step2;
|
|
@@ -1290,7 +1290,7 @@ SchemaSettings.EnableChildCollections = function EnableChildCollections(props) {
|
|
|
1290
1290
|
};
|
|
1291
1291
|
// 是否显示默认值配置项
|
|
1292
1292
|
var isShowDefaultValue = function isShowDefaultValue(collectionField, getInterface) {
|
|
1293
|
-
return !['o2o', 'oho', 'obo', 'o2m', 'attachment'].includes(collectionField === null || collectionField === void 0 ? void 0 : collectionField.interface) && !isSystemField(collectionField, getInterface);
|
|
1293
|
+
return !['o2o', 'oho', 'obo', 'o2m', 'attachment', 'expression'].includes(collectionField === null || collectionField === void 0 ? void 0 : collectionField.interface) && !isSystemField(collectionField, getInterface);
|
|
1294
1294
|
};
|
|
1295
1295
|
// 是否是系统字段
|
|
1296
1296
|
exports.isShowDefaultValue = isShowDefaultValue;
|
|
@@ -4,10 +4,11 @@ declare type Props = {
|
|
|
4
4
|
onChange: (value: any) => void;
|
|
5
5
|
collectionName: string;
|
|
6
6
|
renderSchemaComponent?: (props: any) => any;
|
|
7
|
-
style: React.CSSProperties;
|
|
8
7
|
schema: any;
|
|
9
8
|
operator: any;
|
|
10
|
-
children
|
|
9
|
+
children?: any;
|
|
10
|
+
className?: string;
|
|
11
|
+
style?: React.CSSProperties;
|
|
11
12
|
};
|
|
12
13
|
export declare const VariableInput: (props: Props) => JSX.Element;
|
|
13
14
|
export {};
|
|
@@ -15,7 +15,8 @@ var VariableInput = function VariableInput(props) {
|
|
|
15
15
|
onChange = props.onChange,
|
|
16
16
|
RenderSchemaComponent = props.renderSchemaComponent,
|
|
17
17
|
style = props.style,
|
|
18
|
-
schema = props.schema
|
|
18
|
+
schema = props.schema,
|
|
19
|
+
className = props.className;
|
|
19
20
|
var compile = (0, _schemaComponent.useCompile)();
|
|
20
21
|
var userVariable = (0, _useUserVariable.useUserVariable)({
|
|
21
22
|
schema: schema,
|
|
@@ -35,6 +36,7 @@ var VariableInput = function VariableInput(props) {
|
|
|
35
36
|
})];
|
|
36
37
|
}, []);
|
|
37
38
|
return /*#__PURE__*/_react.default.createElement(_schemaComponent.Variable.Input, {
|
|
39
|
+
className: className,
|
|
38
40
|
value: value,
|
|
39
41
|
onChange: onChange,
|
|
40
42
|
scope: scope,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nocobase/client",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.3-alpha.1",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"main": "lib",
|
|
6
6
|
"module": "es/index.js",
|
|
@@ -13,9 +13,9 @@
|
|
|
13
13
|
"@formily/antd": "2.0.20",
|
|
14
14
|
"@formily/core": "2.0.20",
|
|
15
15
|
"@formily/react": "2.0.20",
|
|
16
|
-
"@nocobase/evaluators": "0.9.
|
|
17
|
-
"@nocobase/sdk": "0.9.
|
|
18
|
-
"@nocobase/utils": "0.9.
|
|
16
|
+
"@nocobase/evaluators": "0.9.3-alpha.1",
|
|
17
|
+
"@nocobase/sdk": "0.9.3-alpha.1",
|
|
18
|
+
"@nocobase/utils": "0.9.3-alpha.1",
|
|
19
19
|
"ahooks": "^3.7.2",
|
|
20
20
|
"antd": "^4.24.8",
|
|
21
21
|
"axios": "^0.26.1",
|
|
@@ -25,7 +25,6 @@
|
|
|
25
25
|
"file-saver": "^2.0.5",
|
|
26
26
|
"i18next": "^22.4.9",
|
|
27
27
|
"i18next-http-backend": "^2.1.1",
|
|
28
|
-
"json-templates": "^4.2.0",
|
|
29
28
|
"markdown-it": "13.0.1",
|
|
30
29
|
"markdown-it-highlightjs": "3.3.1",
|
|
31
30
|
"mathjs": "^10.6.0",
|
|
@@ -60,5 +59,5 @@
|
|
|
60
59
|
"@types/markdown-it-highlightjs": "3.3.1",
|
|
61
60
|
"axios-mock-adapter": "^1.20.0"
|
|
62
61
|
},
|
|
63
|
-
"gitHead": "
|
|
62
|
+
"gitHead": "24979bc561537c0b84469c161eeef1a6de4c4684"
|
|
64
63
|
}
|