@nocobase/client 0.9.2-alpha.1 → 0.9.2-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/acl/Configuration/FilterDynamicComponent.d.ts +2 -0
- package/es/{schema-component/antd/table-v2/hooks/useUserVariable.js → acl/Configuration/FilterDynamicComponent.js} +32 -4
- package/es/acl/Configuration/schemas/scopes.js +3 -0
- package/es/application/Application.d.ts +1 -0
- package/es/application/Application.js +12 -2
- package/es/block-provider/FormFieldProvider.js +9 -1
- package/es/block-provider/TableSelectorProvider.js +3 -2
- package/es/block-provider/hooks/index.js +18 -13
- package/es/board/CardAdder.js +1 -1
- package/es/board/ColumnForm.js +4 -4
- package/es/board/DefaultColumnHeader.d.ts +1 -1
- package/es/board/DefaultColumnHeader.js +6 -6
- package/es/collection-manager/CollectionField.js +16 -13
- package/es/collection-manager/CollectionManagerProvider.js +10 -2
- package/es/collection-manager/Configuration/AddCollectionAction.js +1 -1
- package/es/collection-manager/Configuration/CollectionFields.d.ts +2 -0
- package/es/collection-manager/Configuration/CollectionFields.js +458 -0
- package/es/collection-manager/Configuration/CollectionFieldsTableArray.js +3 -3
- package/es/collection-manager/Configuration/ConfigurationTable.js +4 -2
- package/es/collection-manager/Configuration/ConfigurationTabs.js +6 -2
- package/es/collection-manager/Configuration/EditCollectionAction.js +4 -4
- package/es/collection-manager/Configuration/EditFieldAction.js +1 -1
- package/es/collection-manager/Configuration/OverridingCollectionField.js +1 -1
- package/es/collection-manager/Configuration/schemas/collectionFields.d.ts +2 -0
- package/es/collection-manager/Configuration/schemas/collectionFields.js +1 -1
- package/es/collection-manager/Configuration/schemas/collections.js +8 -5
- package/es/collection-manager/action-hooks.d.ts +2 -1
- package/es/collection-manager/action-hooks.js +10 -7
- package/es/collection-manager/hooks/useCollectionDataSource.js +2 -2
- package/es/collection-manager/hooks/useCollectionManager.d.ts +1 -0
- package/es/collection-manager/hooks/useCollectionManager.js +2 -0
- package/es/collection-manager/interfaces/checkbox.js +7 -0
- package/es/collection-manager/interfaces/checkboxGroup.js +7 -0
- package/es/collection-manager/interfaces/components/index.js +1 -1
- package/es/collection-manager/interfaces/createdBy.js +5 -1
- package/es/collection-manager/interfaces/email.js +7 -0
- package/es/collection-manager/interfaces/linkTo.js +6 -0
- package/es/collection-manager/interfaces/m2m.js +6 -0
- package/es/collection-manager/interfaces/m2o.js +6 -0
- package/es/collection-manager/interfaces/multipleSelect.js +10 -0
- package/es/collection-manager/interfaces/o2m.js +8 -1
- package/es/collection-manager/interfaces/o2o.js +6 -0
- package/es/collection-manager/interfaces/percent.js +10 -0
- package/es/collection-manager/interfaces/select.js +10 -0
- package/es/collection-manager/interfaces/updatedBy.js +5 -1
- package/es/collection-manager/types.d.ts +1 -0
- package/es/filter-provider/utils.d.ts +8 -3
- package/es/filter-provider/utils.js +42 -27
- package/es/locale/en_US.d.ts +7 -0
- package/es/locale/en_US.js +8 -1
- package/es/locale/ja_JP.d.ts +15 -0
- package/es/locale/ja_JP.js +17 -2
- package/es/locale/pt_BR.d.ts +16 -0
- package/es/locale/pt_BR.js +18 -2
- package/es/locale/ru_RU.d.ts +15 -0
- package/es/locale/ru_RU.js +17 -2
- package/es/locale/tr_TR.d.ts +16 -1
- package/es/locale/tr_TR.js +18 -3
- package/es/locale/zh_CN.d.ts +16 -0
- package/es/locale/zh_CN.js +17 -1
- package/es/pm/PluginManagerLink.js +5 -3
- package/es/pm/index.js +1 -1
- package/es/schema-component/antd/action/Action.js +1 -1
- package/es/schema-component/antd/association-select/AssociationSelect.js +56 -35
- package/es/schema-component/antd/association-select/useServiceOptions.js +3 -2
- package/es/schema-component/antd/checkbox/Checkbox.js +4 -3
- package/es/schema-component/antd/collection-select/CollectionSelect.d.ts +2 -2
- package/es/schema-component/antd/collection-select/CollectionSelect.js +6 -6
- package/es/schema-component/antd/error-fallback/ErrorFallback.d.ts +3 -0
- package/es/schema-component/antd/error-fallback/ErrorFallback.js +47 -0
- package/es/schema-component/antd/error-fallback/index.d.ts +1 -0
- package/es/schema-component/antd/error-fallback/index.js +1 -0
- package/es/schema-component/antd/filter/useFilterActionProps.d.ts +2 -0
- package/es/schema-component/antd/filter/useFilterActionProps.js +127 -7
- package/es/schema-component/antd/filter/useValues.js +7 -8
- package/es/schema-component/antd/form-item/FormItem.d.ts +3 -0
- package/es/schema-component/antd/form-item/FormItem.js +81 -16
- package/es/schema-component/antd/form-item/SchemaSettingOptions.js +2 -3
- package/es/schema-component/antd/form-v2/Templates.js +24 -18
- package/es/schema-component/antd/gantt/components/calendar/top-part-of-calendar.d.ts +1 -1
- package/es/schema-component/antd/gantt/components/calendar/top-part-of-calendar.js +3 -3
- package/es/schema-component/antd/gantt/components/gantt/style.js +1 -1
- package/es/schema-component/antd/gantt/components/grid/grid.d.ts +2 -2
- package/es/schema-component/antd/gantt/components/grid/grid.js +2 -2
- package/es/schema-component/antd/gantt/components/grid/style.js +1 -1
- package/es/schema-component/antd/gantt/components/other/arrow.d.ts +2 -2
- package/es/schema-component/antd/gantt/components/other/arrow.js +3 -3
- package/es/schema-component/antd/gantt/components/other/horizontal-scroll.d.ts +1 -1
- package/es/schema-component/antd/gantt/components/other/horizontal-scroll.js +1 -1
- package/es/schema-component/antd/gantt/components/other/style.js +1 -1
- package/es/schema-component/antd/gantt/components/task-item/bar/bar-display.d.ts +1 -1
- package/es/schema-component/antd/gantt/components/task-item/bar/bar-display.js +1 -1
- package/es/schema-component/antd/gantt/components/task-item/bar/bar-small.d.ts +2 -2
- package/es/schema-component/antd/gantt/components/task-item/bar/bar-small.js +6 -6
- package/es/schema-component/antd/gantt/components/task-item/bar/bar.d.ts +2 -2
- package/es/schema-component/antd/gantt/components/task-item/bar/bar.js +9 -9
- package/es/schema-component/antd/gantt/components/task-item/bar/style.js +2 -2
- package/es/schema-component/antd/gantt/components/task-item/milestone/milestone.d.ts +2 -2
- package/es/schema-component/antd/gantt/components/task-item/milestone/milestone.js +2 -2
- package/es/schema-component/antd/gantt/types/bar-task.d.ts +2 -2
- package/es/schema-component/antd/gantt/types/date-setup.d.ts +1 -1
- package/es/schema-component/antd/gantt/types/gantt-task-actions.d.ts +3 -3
- package/es/schema-component/antd/gantt/types/public-types.d.ts +1 -1
- package/es/schema-component/antd/grid/Grid.js +23 -9
- package/es/schema-component/antd/icon-picker/IconPicker.js +1 -1
- package/es/schema-component/antd/input/EllipsisWithTooltip.js +21 -2
- package/es/schema-component/antd/menu/util.js +0 -1
- package/es/schema-component/antd/page/Page.js +10 -2
- package/es/schema-component/antd/pagination/index.js +8 -1
- package/es/schema-component/antd/record-picker/InputRecordPicker.js +3 -4
- package/es/schema-component/antd/record-picker/useFieldNames.js +1 -1
- package/es/schema-component/antd/remote-select/RemoteSelect.d.ts +2 -0
- package/es/schema-component/antd/remote-select/RemoteSelect.js +75 -13
- package/es/schema-component/antd/select/ReadPretty.js +5 -2
- package/es/schema-component/antd/select/Select.js +3 -9
- package/es/schema-component/antd/table/Table.Array.js +2 -2
- package/es/schema-component/antd/table-v2/FilterDynamicComponent.js +2 -138
- package/es/schema-component/antd/table-v2/Table.Column.Designer.js +6 -5
- package/es/schema-component/antd/table-v2/Table.js +2 -2
- package/es/schema-component/antd/upload/ReadPretty.js +2 -1
- package/es/schema-component/antd/variable/Input.js +11 -5
- package/es/schema-component/antd/variable/JSONInput.js +4 -4
- package/es/schema-component/antd/variable/TextArea.js +1 -1
- package/es/schema-component/antd/variable/Variable.js +3 -3
- package/es/schema-component/antd/variable/VariableSelect.js +8 -8
- package/es/schema-component/antd/variable/XButton.d.ts +1 -1
- package/es/schema-component/antd/variable/XButton.js +4 -4
- package/es/schema-component/common/utils/uitls.d.ts +9 -0
- package/es/schema-component/common/utils/uitls.js +37 -3
- package/es/schema-component/core/DesignableSwitch.js +5 -3
- package/es/schema-component/hooks/useComponent.js +2 -2
- package/es/schema-component/hooks/useDesignable.js +2 -2
- package/es/schema-component/hooks/useFieldTitle.js +4 -4
- package/es/schema-initializer/SchemaInitializer.js +2 -2
- package/es/schema-initializer/buttons/BulkEditFormItemInitializers.js +14 -7
- package/es/schema-initializer/items/DestroyActionInitializer.js +2 -2
- package/es/schema-initializer/items/FilterActionInitializer.js +2 -2
- package/es/schema-initializer/items/FormBlockInitializer.js +3 -3
- package/es/schema-initializer/items/G2PlotInitializer.js +1 -1
- package/es/schema-initializer/items/KanbanBlockInitializer.js +9 -9
- package/es/schema-initializer/items/MarkdownBlockInitializer.js +3 -3
- package/es/schema-initializer/items/PrintActionInitializer.js +2 -2
- package/es/schema-initializer/items/RecordAssociationBlockInitializer.js +5 -5
- package/es/schema-initializer/items/RecordAssociationCalendarBlockInitializer.js +9 -9
- package/es/schema-initializer/items/RecordAssociationDetailsBlockInitializer.js +5 -5
- package/es/schema-initializer/items/RecordAssociationFormBlockInitializer.js +4 -4
- package/es/schema-initializer/items/RecordReadPrettyAssociationFormBlockInitializer.js +5 -5
- package/es/schema-initializer/items/RefreshActionInitializer.js +2 -2
- package/es/schema-initializer/items/SubmitActionInitializer.js +2 -2
- package/es/schema-initializer/items/TableActionColumnInitializer.js +2 -2
- package/es/schema-initializer/items/TableCollectionFieldInitializer.js +2 -2
- package/es/schema-initializer/items/TableSelectorInitializer.js +5 -5
- package/es/schema-initializer/items/UpdateActionInitializer.js +2 -2
- package/es/schema-initializer/items/UpdateSubmitActionInitializer.js +2 -2
- package/es/schema-initializer/items/ViewActionInitializer.js +2 -2
- package/es/schema-initializer/utils.js +17 -10
- package/es/schema-settings/DataTemplates/FormDataTemplates.js +28 -12
- package/es/schema-settings/DataTemplates/hooks/useCollectionState.js +2 -1
- package/es/schema-settings/LinkageRules/FilterDynamicComponent.d.ts +9 -2
- package/es/schema-settings/LinkageRules/ValueDynamicComponent.js +2 -1
- package/es/schema-settings/SchemaSettings.d.ts +4 -1
- package/es/schema-settings/SchemaSettings.js +32 -19
- package/es/schema-settings/VariableInput/VariableInput.d.ts +13 -0
- package/es/schema-settings/VariableInput/VariableInput.js +37 -0
- package/es/schema-settings/VariableInput/hooks/useDateVariable.d.ts +4 -0
- package/es/schema-settings/VariableInput/hooks/useDateVariable.js +129 -0
- package/es/schema-settings/VariableInput/hooks/useUserVariable.d.ts +5 -0
- package/es/schema-settings/VariableInput/hooks/useUserVariable.js +68 -0
- package/es/schema-settings/VariableInput/hooks/useVariableOptions.d.ts +1 -0
- package/es/schema-settings/VariableInput/hooks/useVariableOptions.js +18 -0
- package/es/user/VerificationCode.js +7 -8
- package/lib/acl/Configuration/FilterDynamicComponent.d.ts +2 -0
- package/lib/{schema-component/antd/table-v2/hooks/useUserVariable.js → acl/Configuration/FilterDynamicComponent.js} +32 -4
- package/lib/acl/Configuration/schemas/scopes.js +3 -0
- package/lib/application/Application.d.ts +1 -0
- package/lib/application/Application.js +12 -2
- package/lib/block-provider/FormFieldProvider.js +9 -1
- package/lib/block-provider/TableSelectorProvider.js +3 -2
- package/lib/block-provider/hooks/index.js +17 -12
- package/lib/board/CardAdder.js +1 -1
- package/lib/board/ColumnForm.js +4 -4
- package/lib/board/DefaultColumnHeader.d.ts +1 -1
- package/lib/board/DefaultColumnHeader.js +6 -6
- package/lib/collection-manager/CollectionField.js +16 -13
- package/lib/collection-manager/CollectionManagerProvider.js +10 -2
- package/lib/collection-manager/Configuration/AddCollectionAction.js +1 -1
- package/lib/collection-manager/Configuration/CollectionFields.d.ts +2 -0
- package/lib/collection-manager/Configuration/CollectionFields.js +468 -0
- package/lib/collection-manager/Configuration/CollectionFieldsTableArray.js +3 -3
- package/lib/collection-manager/Configuration/ConfigurationTable.js +4 -2
- package/lib/collection-manager/Configuration/ConfigurationTabs.js +5 -1
- package/lib/collection-manager/Configuration/EditCollectionAction.js +4 -4
- package/lib/collection-manager/Configuration/EditFieldAction.js +1 -1
- package/lib/collection-manager/Configuration/OverridingCollectionField.js +1 -1
- package/lib/collection-manager/Configuration/schemas/collectionFields.d.ts +2 -0
- package/lib/collection-manager/Configuration/schemas/collectionFields.js +2 -1
- package/lib/collection-manager/Configuration/schemas/collections.js +8 -5
- package/lib/collection-manager/action-hooks.d.ts +2 -1
- package/lib/collection-manager/action-hooks.js +13 -9
- package/lib/collection-manager/hooks/useCollectionManager.d.ts +1 -0
- package/lib/collection-manager/hooks/useCollectionManager.js +2 -0
- package/lib/collection-manager/interfaces/checkbox.js +7 -0
- package/lib/collection-manager/interfaces/checkboxGroup.js +7 -0
- package/lib/collection-manager/interfaces/components/index.js +1 -1
- package/lib/collection-manager/interfaces/createdBy.js +5 -1
- package/lib/collection-manager/interfaces/email.js +7 -0
- package/lib/collection-manager/interfaces/linkTo.js +6 -0
- package/lib/collection-manager/interfaces/m2m.js +6 -0
- package/lib/collection-manager/interfaces/m2o.js +6 -0
- package/lib/collection-manager/interfaces/multipleSelect.js +10 -0
- package/lib/collection-manager/interfaces/o2m.js +8 -1
- package/lib/collection-manager/interfaces/o2o.js +6 -0
- package/lib/collection-manager/interfaces/percent.js +10 -0
- package/lib/collection-manager/interfaces/select.js +10 -0
- package/lib/collection-manager/interfaces/updatedBy.js +5 -1
- package/lib/collection-manager/types.d.ts +1 -0
- package/lib/filter-provider/utils.d.ts +8 -3
- package/lib/filter-provider/utils.js +44 -28
- package/lib/locale/en_US.d.ts +7 -0
- package/lib/locale/en_US.js +8 -1
- package/lib/locale/ja_JP.d.ts +15 -0
- package/lib/locale/ja_JP.js +17 -2
- package/lib/locale/pt_BR.d.ts +16 -0
- package/lib/locale/pt_BR.js +18 -2
- package/lib/locale/ru_RU.d.ts +15 -0
- package/lib/locale/ru_RU.js +17 -2
- package/lib/locale/tr_TR.d.ts +16 -1
- package/lib/locale/tr_TR.js +18 -3
- package/lib/locale/zh_CN.d.ts +16 -0
- package/lib/locale/zh_CN.js +17 -1
- package/lib/pm/PluginManagerLink.js +4 -2
- package/lib/pm/index.js +1 -1
- package/lib/schema-component/antd/action/Action.js +1 -1
- package/lib/schema-component/antd/association-select/AssociationSelect.js +55 -34
- package/lib/schema-component/antd/association-select/useServiceOptions.js +3 -2
- package/lib/schema-component/antd/checkbox/Checkbox.js +4 -3
- package/lib/schema-component/antd/collection-select/CollectionSelect.d.ts +2 -2
- package/lib/schema-component/antd/error-fallback/ErrorFallback.d.ts +3 -0
- package/lib/schema-component/antd/error-fallback/ErrorFallback.js +55 -0
- package/lib/schema-component/antd/error-fallback/index.d.ts +1 -0
- package/lib/schema-component/antd/error-fallback/index.js +16 -0
- package/lib/schema-component/antd/filter/useFilterActionProps.d.ts +2 -0
- package/lib/schema-component/antd/filter/useFilterActionProps.js +130 -8
- package/lib/schema-component/antd/filter/useValues.js +6 -7
- package/lib/schema-component/antd/form-item/FormItem.d.ts +3 -0
- package/lib/schema-component/antd/form-item/FormItem.js +81 -15
- package/lib/schema-component/antd/form-item/SchemaSettingOptions.js +1 -2
- package/lib/schema-component/antd/form-v2/Templates.js +24 -18
- package/lib/schema-component/antd/gantt/components/calendar/top-part-of-calendar.d.ts +1 -1
- package/lib/schema-component/antd/gantt/components/calendar/top-part-of-calendar.js +2 -2
- package/lib/schema-component/antd/gantt/components/gantt/style.js +1 -1
- package/lib/schema-component/antd/gantt/components/grid/grid.d.ts +2 -2
- package/lib/schema-component/antd/gantt/components/grid/style.js +1 -1
- package/lib/schema-component/antd/gantt/components/other/arrow.d.ts +2 -2
- package/lib/schema-component/antd/gantt/components/other/arrow.js +2 -2
- package/lib/schema-component/antd/gantt/components/other/horizontal-scroll.d.ts +1 -1
- package/lib/schema-component/antd/gantt/components/other/style.js +1 -1
- package/lib/schema-component/antd/gantt/components/task-item/bar/bar-display.d.ts +1 -1
- package/lib/schema-component/antd/gantt/components/task-item/bar/bar-small.d.ts +2 -2
- package/lib/schema-component/antd/gantt/components/task-item/bar/bar-small.js +2 -2
- package/lib/schema-component/antd/gantt/components/task-item/bar/bar.d.ts +2 -2
- package/lib/schema-component/antd/gantt/components/task-item/bar/bar.js +4 -4
- package/lib/schema-component/antd/gantt/components/task-item/bar/style.js +2 -2
- package/lib/schema-component/antd/gantt/components/task-item/milestone/milestone.d.ts +2 -2
- package/lib/schema-component/antd/gantt/components/task-item/milestone/milestone.js +1 -1
- package/lib/schema-component/antd/gantt/types/bar-task.d.ts +2 -2
- package/lib/schema-component/antd/gantt/types/date-setup.d.ts +1 -1
- package/lib/schema-component/antd/gantt/types/gantt-task-actions.d.ts +3 -3
- package/lib/schema-component/antd/gantt/types/public-types.d.ts +1 -1
- package/lib/schema-component/antd/grid/Grid.js +23 -9
- package/lib/schema-component/antd/input/EllipsisWithTooltip.js +20 -1
- package/lib/schema-component/antd/menu/util.js +0 -1
- package/lib/schema-component/antd/page/Page.js +9 -1
- package/lib/schema-component/antd/pagination/index.js +8 -1
- package/lib/schema-component/antd/record-picker/InputRecordPicker.js +3 -4
- package/lib/schema-component/antd/remote-select/RemoteSelect.d.ts +2 -0
- package/lib/schema-component/antd/remote-select/RemoteSelect.js +75 -12
- package/lib/schema-component/antd/select/ReadPretty.js +5 -2
- package/lib/schema-component/antd/select/Select.js +3 -9
- package/lib/schema-component/antd/table-v2/FilterDynamicComponent.js +3 -139
- package/lib/schema-component/antd/table-v2/Table.Column.Designer.js +6 -5
- package/lib/schema-component/antd/table-v2/Table.js +2 -2
- package/lib/schema-component/antd/upload/ReadPretty.js +2 -1
- package/lib/schema-component/antd/variable/Input.js +10 -4
- package/lib/schema-component/antd/variable/JSONInput.js +2 -2
- package/lib/schema-component/antd/variable/TextArea.js +1 -1
- package/lib/schema-component/antd/variable/VariableSelect.js +4 -4
- package/lib/schema-component/antd/variable/XButton.d.ts +1 -1
- package/lib/schema-component/antd/variable/XButton.js +1 -1
- package/lib/schema-component/common/utils/uitls.d.ts +9 -0
- package/lib/schema-component/common/utils/uitls.js +43 -4
- package/lib/schema-component/core/DesignableSwitch.js +4 -2
- package/lib/schema-component/hooks/useComponent.js +2 -2
- package/lib/schema-component/hooks/useDesignable.js +2 -2
- package/lib/schema-initializer/SchemaInitializer.js +2 -2
- package/lib/schema-initializer/buttons/BulkEditFormItemInitializers.js +14 -7
- package/lib/schema-initializer/utils.js +17 -10
- package/lib/schema-settings/DataTemplates/FormDataTemplates.js +28 -12
- package/lib/schema-settings/DataTemplates/hooks/useCollectionState.js +2 -1
- package/lib/schema-settings/LinkageRules/FilterDynamicComponent.d.ts +9 -2
- package/lib/schema-settings/LinkageRules/ValueDynamicComponent.js +2 -1
- package/lib/schema-settings/SchemaSettings.d.ts +4 -1
- package/lib/schema-settings/SchemaSettings.js +37 -21
- package/lib/schema-settings/VariableInput/VariableInput.d.ts +13 -0
- package/lib/schema-settings/VariableInput/VariableInput.js +47 -0
- package/lib/schema-settings/VariableInput/hooks/useDateVariable.d.ts +4 -0
- package/lib/schema-settings/VariableInput/hooks/useDateVariable.js +136 -0
- package/lib/schema-settings/VariableInput/hooks/useUserVariable.d.ts +5 -0
- package/lib/schema-settings/VariableInput/hooks/useUserVariable.js +75 -0
- package/lib/schema-settings/VariableInput/hooks/useVariableOptions.d.ts +1 -0
- package/lib/schema-settings/VariableInput/hooks/useVariableOptions.js +25 -0
- package/lib/user/VerificationCode.js +1 -2
- package/package.json +6 -5
- package/es/schema-component/antd/table-v2/hooks/useUserVariable.d.ts +0 -10
- package/lib/schema-component/antd/table-v2/hooks/useUserVariable.d.ts +0 -10
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { useCompile } from '../../schema-component';
|
|
3
|
+
import { useFilterOptions } from '../../schema-component/antd/filter';
|
|
4
|
+
import { useValues } from '../../schema-component/antd/filter/useValues';
|
|
5
|
+
import { Variable } from '../../schema-component/antd/variable';
|
|
2
6
|
var useOptions = function useOptions(collectionName, _ref) {
|
|
3
7
|
var schema = _ref.schema,
|
|
4
8
|
operator = _ref.operator,
|
|
@@ -36,13 +40,13 @@ var useOptions = function useOptions(collectionName, _ref) {
|
|
|
36
40
|
});
|
|
37
41
|
return result;
|
|
38
42
|
};
|
|
39
|
-
|
|
43
|
+
var useUserVariable = function useUserVariable(_ref2) {
|
|
40
44
|
var schema = _ref2.schema,
|
|
41
45
|
operator = _ref2.operator;
|
|
42
46
|
var options = useOptions('users', {
|
|
43
47
|
schema: schema,
|
|
44
48
|
operator: operator,
|
|
45
|
-
maxDepth:
|
|
49
|
+
maxDepth: 1
|
|
46
50
|
}) || [];
|
|
47
51
|
return {
|
|
48
52
|
label: "{{t(\"Current user\")}}",
|
|
@@ -53,4 +57,28 @@ export var useUserVariable = function useUserVariable(_ref2) {
|
|
|
53
57
|
}),
|
|
54
58
|
children: options
|
|
55
59
|
};
|
|
56
|
-
};
|
|
60
|
+
};
|
|
61
|
+
var useVariableOptions = function useVariableOptions() {
|
|
62
|
+
var _useValues = useValues(),
|
|
63
|
+
operator = _useValues.operator,
|
|
64
|
+
schema = _useValues.schema;
|
|
65
|
+
var userVariable = useUserVariable({
|
|
66
|
+
schema: schema,
|
|
67
|
+
operator: operator
|
|
68
|
+
});
|
|
69
|
+
if (!operator || !schema) return [];
|
|
70
|
+
return [userVariable];
|
|
71
|
+
};
|
|
72
|
+
export function FilterDynamicComponent(props) {
|
|
73
|
+
var value = props.value,
|
|
74
|
+
onChange = props.onChange,
|
|
75
|
+
renderSchemaComponent = props.renderSchemaComponent;
|
|
76
|
+
var options = useVariableOptions();
|
|
77
|
+
var compile = useCompile();
|
|
78
|
+
var scope = compile(options);
|
|
79
|
+
return /*#__PURE__*/React.createElement(Variable.Input, {
|
|
80
|
+
value: value,
|
|
81
|
+
onChange: onChange,
|
|
82
|
+
scope: scope
|
|
83
|
+
}, renderSchemaComponent());
|
|
84
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { useContext, useEffect } from 'react';
|
|
2
2
|
import { useFormBlockContext } from '../../../block-provider';
|
|
3
3
|
import { useFilterOptions } from '../../../schema-component';
|
|
4
|
+
import { FilterDynamicComponent } from '../FilterDynamicComponent';
|
|
4
5
|
import { RoleResourceCollectionContext } from '../RolesResourcesActions';
|
|
5
6
|
export var rolesResourcesScopesCollection = {
|
|
6
7
|
name: 'rolesResourcesScopes',
|
|
@@ -139,6 +140,7 @@ export var scopesSchema = {
|
|
|
139
140
|
'x-decorator': 'FormItem',
|
|
140
141
|
'x-component': 'Filter',
|
|
141
142
|
'x-component-props': {
|
|
143
|
+
dynamicComponent: FilterDynamicComponent,
|
|
142
144
|
useProps: function useProps() {
|
|
143
145
|
var ctx = useContext(RoleResourceCollectionContext);
|
|
144
146
|
var options = useFilterOptions(ctx.name);
|
|
@@ -267,6 +269,7 @@ export var scopesSchema = {
|
|
|
267
269
|
'x-decorator': 'FormItem',
|
|
268
270
|
'x-component': 'Filter',
|
|
269
271
|
'x-component-props': {
|
|
272
|
+
dynamicComponent: FilterDynamicComponent,
|
|
270
273
|
useProps: function useProps() {
|
|
271
274
|
var ctx = useContext(RoleResourceCollectionContext);
|
|
272
275
|
var options = useFilterOptions(ctx.name);
|
|
@@ -23,6 +23,7 @@ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToAr
|
|
|
23
23
|
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; }
|
|
24
24
|
import { Spin } from 'antd';
|
|
25
25
|
import React, { useEffect, useState } from 'react';
|
|
26
|
+
import { ErrorBoundary } from 'react-error-boundary';
|
|
26
27
|
import { I18nextProvider } from 'react-i18next';
|
|
27
28
|
import { Link, NavLink } from 'react-router-dom';
|
|
28
29
|
import { ACLProvider } from '../acl';
|
|
@@ -35,6 +36,7 @@ import { PinnedPluginListProvider } from '../plugin-manager';
|
|
|
35
36
|
import PMProvider, { PluginManagerLink, SettingsCenterDropdown } from '../pm';
|
|
36
37
|
import { AdminLayout, AuthLayout, RemoteRouteSwitchProvider, RouteSchemaComponent, RouteSwitch, useRoutes } from '../route-switch';
|
|
37
38
|
import { AntdSchemaComponentProvider, DesignableSwitch, MenuItemInitializers, SchemaComponentProvider } from '../schema-component';
|
|
39
|
+
import { ErrorFallback } from '../schema-component/antd/error-fallback';
|
|
38
40
|
import { SchemaInitializerProvider } from '../schema-initializer';
|
|
39
41
|
import { BlockTemplateDetails, BlockTemplatePage } from '../schema-templates';
|
|
40
42
|
import { SystemSettingsProvider } from '../system-settings';
|
|
@@ -156,6 +158,11 @@ export var Application = /*#__PURE__*/function () {
|
|
|
156
158
|
value: function plugin(_plugin) {
|
|
157
159
|
this.plugins.push(_plugin);
|
|
158
160
|
}
|
|
161
|
+
}, {
|
|
162
|
+
key: "handleErrors",
|
|
163
|
+
value: function handleErrors(error) {
|
|
164
|
+
console.error(error);
|
|
165
|
+
}
|
|
159
166
|
}, {
|
|
160
167
|
key: "render",
|
|
161
168
|
value: function render() {
|
|
@@ -226,9 +233,12 @@ export var Application = /*#__PURE__*/function () {
|
|
|
226
233
|
if (loading) {
|
|
227
234
|
return /*#__PURE__*/React.createElement(Spin, null);
|
|
228
235
|
}
|
|
229
|
-
return /*#__PURE__*/React.createElement(
|
|
236
|
+
return /*#__PURE__*/React.createElement(ErrorBoundary, {
|
|
237
|
+
FallbackComponent: ErrorFallback,
|
|
238
|
+
onError: _this.handleErrors
|
|
239
|
+
}, /*#__PURE__*/React.createElement(App, {
|
|
230
240
|
providers: _this.providers
|
|
231
|
-
});
|
|
241
|
+
}));
|
|
232
242
|
};
|
|
233
243
|
}
|
|
234
244
|
}]);
|
|
@@ -7,6 +7,7 @@ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input ==
|
|
|
7
7
|
import { createForm, onFormValuesChange } from '@formily/core';
|
|
8
8
|
import { useField } from '@formily/react';
|
|
9
9
|
import { autorun } from '@formily/reactive';
|
|
10
|
+
import { forEach } from '@nocobase/utils/client';
|
|
10
11
|
import { Spin } from 'antd';
|
|
11
12
|
import React, { createContext, useContext, useEffect, useMemo } from 'react';
|
|
12
13
|
import { RecordProvider } from '../record-provider';
|
|
@@ -39,7 +40,14 @@ var InternalFormFieldProvider = function InternalFormFieldProvider(props) {
|
|
|
39
40
|
useEffect(function () {
|
|
40
41
|
var dispose = autorun(function () {
|
|
41
42
|
var _formBlockCtx$form2;
|
|
42
|
-
|
|
43
|
+
var data = (formBlockCtx === null || formBlockCtx === void 0 ? void 0 : (_formBlockCtx$form2 = formBlockCtx.form) === null || _formBlockCtx$form2 === void 0 ? void 0 : _formBlockCtx$form2.values[fieldName]) || {};
|
|
44
|
+
// 先清空表单值,再赋值,避免当值为空时,表单未被清空
|
|
45
|
+
form.reset();
|
|
46
|
+
forEach(data, function (value, key) {
|
|
47
|
+
if (value) {
|
|
48
|
+
form.values[key] = value;
|
|
49
|
+
}
|
|
50
|
+
});
|
|
43
51
|
});
|
|
44
52
|
return dispose;
|
|
45
53
|
}, []);
|
|
@@ -18,6 +18,7 @@ import { Schema, useField, useFieldSchema } from '@formily/react';
|
|
|
18
18
|
import uniq from 'lodash/uniq';
|
|
19
19
|
import React, { createContext, useContext, useEffect, useState } from 'react';
|
|
20
20
|
import { useCollectionManager } from '../collection-manager';
|
|
21
|
+
import { isInFilterFormBlock } from '../filter-provider';
|
|
21
22
|
import { RecordProvider, useRecord } from '../record-provider';
|
|
22
23
|
import { SchemaComponentOptions } from '../schema-component';
|
|
23
24
|
import { BlockProvider, RenderChildrenWithAssociationFilter, useBlockRequestContext } from './BlockProvider';
|
|
@@ -189,7 +190,7 @@ export var TableSelectorProvider = function TableSelectorProvider(props) {
|
|
|
189
190
|
}
|
|
190
191
|
var extraFilter;
|
|
191
192
|
if (collectionField) {
|
|
192
|
-
if (['oho', 'o2m'].includes(collectionField.interface)) {
|
|
193
|
+
if (['oho', 'o2m'].includes(collectionField.interface) && !isInFilterFormBlock(fieldSchema)) {
|
|
193
194
|
if (record === null || record === void 0 ? void 0 : record[collectionField.sourceKey]) {
|
|
194
195
|
extraFilter = {
|
|
195
196
|
$or: [_defineProperty({}, collectionField.foreignKey, {
|
|
@@ -204,7 +205,7 @@ export var TableSelectorProvider = function TableSelectorProvider(props) {
|
|
|
204
205
|
});
|
|
205
206
|
}
|
|
206
207
|
}
|
|
207
|
-
if (['obo'].includes(collectionField.interface)) {
|
|
208
|
+
if (['obo'].includes(collectionField.interface) && !isInFilterFormBlock(fieldSchema)) {
|
|
208
209
|
var fields = getCollectionFields(collectionField.target);
|
|
209
210
|
var targetField = fields.find(function (f) {
|
|
210
211
|
return f.foreignKey && f.foreignKey === collectionField.foreignKey;
|
|
@@ -25,7 +25,7 @@ import { useHistory } from 'react-router-dom';
|
|
|
25
25
|
import { useReactToPrint } from 'react-to-print';
|
|
26
26
|
import { AssociationFilter, useFormBlockContext, useTableBlockContext } from '../..';
|
|
27
27
|
import { useAPIClient, useRequest } from '../../api-client';
|
|
28
|
-
import { useCollection } from '../../collection-manager';
|
|
28
|
+
import { useCollection, useCollectionManager } from '../../collection-manager';
|
|
29
29
|
import { useFilterBlock } from '../../filter-provider/FilterProvider';
|
|
30
30
|
import { transformToFilter } from '../../filter-provider/utils';
|
|
31
31
|
import { useRecord } from '../../record-provider';
|
|
@@ -292,6 +292,10 @@ export var useFilterBlockActionProps = function useFilterBlockActionProps() {
|
|
|
292
292
|
var fieldSchema = useFieldSchema();
|
|
293
293
|
var _useFilterBlock = useFilterBlock(),
|
|
294
294
|
getDataBlocks = _useFilterBlock.getDataBlocks;
|
|
295
|
+
var _useCollection2 = useCollection(),
|
|
296
|
+
name = _useCollection2.name;
|
|
297
|
+
var _useCollectionManager = useCollectionManager(),
|
|
298
|
+
getCollectionJoinField = _useCollectionManager.getCollectionJoinField;
|
|
295
299
|
actionField.data = actionField.data || {};
|
|
296
300
|
return {
|
|
297
301
|
onClick: function onClick() {
|
|
@@ -322,7 +326,7 @@ export var useFilterBlockActionProps = function useFilterBlockActionProps() {
|
|
|
322
326
|
case 3:
|
|
323
327
|
param = ((_block$service$params = block.service.params) === null || _block$service$params === void 0 ? void 0 : _block$service$params[0]) || {}; // 保留原有的 filter
|
|
324
328
|
storedFilter = ((_block$service$params2 = block.service.params) === null || _block$service$params2 === void 0 ? void 0 : (_block$service$params3 = _block$service$params2[1]) === null || _block$service$params3 === void 0 ? void 0 : _block$service$params3.filters) || {};
|
|
325
|
-
storedFilter[uid] = removeNullCondition(transformToFilter(form.values, fieldSchema));
|
|
329
|
+
storedFilter[uid] = removeNullCondition(transformToFilter(form.values, fieldSchema, getCollectionJoinField, name));
|
|
326
330
|
mergedFilter = mergeFilter([].concat(_toConsumableArray(Object.values(storedFilter).map(function (filter) {
|
|
327
331
|
return removeNullCondition(filter);
|
|
328
332
|
})), [block.defaultFilter]));
|
|
@@ -344,13 +348,14 @@ export var useFilterBlockActionProps = function useFilterBlockActionProps() {
|
|
|
344
348
|
}()));
|
|
345
349
|
case 5:
|
|
346
350
|
actionField.data.loading = false;
|
|
347
|
-
_context4.next =
|
|
351
|
+
_context4.next = 12;
|
|
348
352
|
break;
|
|
349
353
|
case 8:
|
|
350
354
|
_context4.prev = 8;
|
|
351
355
|
_context4.t0 = _context4["catch"](2);
|
|
356
|
+
console.error(_context4.t0);
|
|
352
357
|
actionField.data.loading = false;
|
|
353
|
-
case
|
|
358
|
+
case 12:
|
|
354
359
|
case "end":
|
|
355
360
|
return _context4.stop();
|
|
356
361
|
}
|
|
@@ -822,9 +827,9 @@ export var useCustomizeRequestActionProps = function useCustomizeRequestActionPr
|
|
|
822
827
|
var actionSchema = useFieldSchema();
|
|
823
828
|
var compile = useCompile();
|
|
824
829
|
var form = useForm();
|
|
825
|
-
var
|
|
826
|
-
fields =
|
|
827
|
-
getField =
|
|
830
|
+
var _useCollection3 = useCollection(),
|
|
831
|
+
fields = _useCollection3.fields,
|
|
832
|
+
getField = _useCollection3.getField;
|
|
828
833
|
var _useBlockRequestConte5 = useBlockRequestContext(),
|
|
829
834
|
field = _useBlockRequestConte5.field,
|
|
830
835
|
resource = _useBlockRequestConte5.resource,
|
|
@@ -964,9 +969,9 @@ export var useUpdateActionProps = function useUpdateActionProps() {
|
|
|
964
969
|
setVisible = _useActionContext3.setVisible;
|
|
965
970
|
var actionSchema = useFieldSchema();
|
|
966
971
|
var history = useHistory();
|
|
967
|
-
var
|
|
968
|
-
fields =
|
|
969
|
-
getField =
|
|
972
|
+
var _useCollection4 = useCollection(),
|
|
973
|
+
fields = _useCollection4.fields,
|
|
974
|
+
getField = _useCollection4.getField;
|
|
970
975
|
var compile = useCompile();
|
|
971
976
|
var actionField = useField();
|
|
972
977
|
var _useFormBlockContext = useFormBlockContext(),
|
|
@@ -1284,9 +1289,9 @@ export var useAssociationFilterProps = function useAssociationFilterProps() {
|
|
|
1284
1289
|
};
|
|
1285
1290
|
};
|
|
1286
1291
|
export var useOptionalFieldList = function useOptionalFieldList() {
|
|
1287
|
-
var
|
|
1288
|
-
|
|
1289
|
-
currentFields =
|
|
1292
|
+
var _useCollection5 = useCollection(),
|
|
1293
|
+
_useCollection5$curre = _useCollection5.currentFields,
|
|
1294
|
+
currentFields = _useCollection5$curre === void 0 ? [] : _useCollection5$curre;
|
|
1290
1295
|
return currentFields.filter(function (field) {
|
|
1291
1296
|
return isOptionalField(field) && field.uiSchema.enum;
|
|
1292
1297
|
});
|
package/es/board/CardAdder.js
CHANGED
|
@@ -23,7 +23,7 @@ function CardAdder(_ref) {
|
|
|
23
23
|
return setAddingCard(false);
|
|
24
24
|
}
|
|
25
25
|
}) : /*#__PURE__*/React.createElement("button", {
|
|
26
|
-
className:
|
|
26
|
+
className: "react-kanban-card-adder-button",
|
|
27
27
|
onClick: function onClick() {
|
|
28
28
|
return setAddingCard(!addingCard);
|
|
29
29
|
}
|
package/es/board/ColumnForm.js
CHANGED
|
@@ -10,7 +10,7 @@ function ColumnForm(_ref) {
|
|
|
10
10
|
when(inputColumnTitle.current.value)(onConfirm);
|
|
11
11
|
}
|
|
12
12
|
return /*#__PURE__*/React.createElement("div", {
|
|
13
|
-
className:
|
|
13
|
+
className: "react-kanban-column",
|
|
14
14
|
style: {
|
|
15
15
|
minWidth: '230px'
|
|
16
16
|
}
|
|
@@ -21,13 +21,13 @@ function ColumnForm(_ref) {
|
|
|
21
21
|
},
|
|
22
22
|
onSubmit: addColumn
|
|
23
23
|
}, /*#__PURE__*/React.createElement("input", {
|
|
24
|
-
type:
|
|
24
|
+
type: "text",
|
|
25
25
|
ref: inputColumnTitle,
|
|
26
26
|
autoFocus: true
|
|
27
27
|
}), /*#__PURE__*/React.createElement("button", {
|
|
28
|
-
type:
|
|
28
|
+
type: "submit"
|
|
29
29
|
}, "Add"), /*#__PURE__*/React.createElement("button", {
|
|
30
|
-
type:
|
|
30
|
+
type: "button",
|
|
31
31
|
onClick: onCancel
|
|
32
32
|
}, "Cancel")));
|
|
33
33
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
declare function DefaultColumnHeader({ children: column, allowRemoveColumn, onColumnRemove, allowRenameColumn, onColumnRename }: {
|
|
2
|
+
declare function DefaultColumnHeader({ children: column, allowRemoveColumn, onColumnRemove, allowRenameColumn, onColumnRename, }: {
|
|
3
3
|
children: any;
|
|
4
4
|
allowRemoveColumn: any;
|
|
5
5
|
onColumnRemove: any;
|
|
@@ -50,11 +50,11 @@ function DefaultColumnHeader(_ref2) {
|
|
|
50
50
|
toggleRenameMode();
|
|
51
51
|
}
|
|
52
52
|
return /*#__PURE__*/React.createElement("div", {
|
|
53
|
-
className:
|
|
53
|
+
className: "react-kanban-column-header"
|
|
54
54
|
}, renameMode ? /*#__PURE__*/React.createElement("form", {
|
|
55
55
|
onSubmit: handleRenameColumn
|
|
56
56
|
}, /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement("input", {
|
|
57
|
-
type:
|
|
57
|
+
type: "text",
|
|
58
58
|
value: titleInput,
|
|
59
59
|
onChange: function onChange(_ref3) {
|
|
60
60
|
var value = _ref3.target.value;
|
|
@@ -62,11 +62,11 @@ function DefaultColumnHeader(_ref2) {
|
|
|
62
62
|
},
|
|
63
63
|
autoFocus: true
|
|
64
64
|
})), /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement("button", {
|
|
65
|
-
className:
|
|
66
|
-
type:
|
|
65
|
+
className: "react-kanban-column-header__button",
|
|
66
|
+
type: "submit"
|
|
67
67
|
}, "Rename"), /*#__PURE__*/React.createElement("button", {
|
|
68
|
-
className:
|
|
69
|
-
type:
|
|
68
|
+
className: "react-kanban-column-header__button",
|
|
69
|
+
type: "button",
|
|
70
70
|
onClick: handleRenameMode
|
|
71
71
|
}, "Cancel"))) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ColumnTitle, {
|
|
72
72
|
allowRenameColumn: allowRenameColumn,
|
|
@@ -8,17 +8,19 @@ import { connect, useField, useFieldSchema } from '@formily/react';
|
|
|
8
8
|
import { merge } from '@formily/shared';
|
|
9
9
|
import { concat } from 'lodash';
|
|
10
10
|
import React, { useEffect } from 'react';
|
|
11
|
+
import { useTranslation } from 'react-i18next';
|
|
11
12
|
import { useActionContext, useCompile, useComponent, useFormBlockContext, useRecord } from '..';
|
|
12
13
|
import { CollectionFieldProvider } from './CollectionFieldProvider';
|
|
13
14
|
import { useCollectionField } from './hooks';
|
|
14
15
|
// TODO: 初步适配
|
|
15
16
|
var InternalField = function InternalField(props) {
|
|
17
|
+
var component = props.component;
|
|
16
18
|
var field = useField();
|
|
17
19
|
var fieldSchema = useFieldSchema();
|
|
18
20
|
var _useCollectionField = useCollectionField(),
|
|
19
21
|
uiSchema = _useCollectionField.uiSchema,
|
|
20
22
|
defaultValue = _useCollectionField.defaultValue;
|
|
21
|
-
var
|
|
23
|
+
var Component = useComponent(component || (uiSchema === null || uiSchema === void 0 ? void 0 : uiSchema['x-component']) || 'Input');
|
|
22
24
|
var compile = useCompile();
|
|
23
25
|
var setFieldProps = function setFieldProps(key, value) {
|
|
24
26
|
field[key] = typeof field[key] === 'undefined' ? value : field[key];
|
|
@@ -61,21 +63,12 @@ var InternalField = function InternalField(props) {
|
|
|
61
63
|
field.dataSource = uiSchema.enum;
|
|
62
64
|
var originalProps = compile(uiSchema['x-component-props']) || {};
|
|
63
65
|
var componentProps = merge(originalProps, field.componentProps || {});
|
|
64
|
-
field.component = [
|
|
65
|
-
// if (interfaceType === 'input') {
|
|
66
|
-
// field.componentProps.ellipsis = true;
|
|
67
|
-
// } else if (interfaceType === 'textarea') {
|
|
68
|
-
// field.componentProps.ellipsis = true;
|
|
69
|
-
// } else if (interfaceType === 'markdown') {
|
|
70
|
-
// field.componentProps.ellipsis = true;
|
|
71
|
-
// } else if (interfaceType === 'attachment') {
|
|
72
|
-
// field.componentProps.size = 'small';
|
|
73
|
-
// }
|
|
66
|
+
field.component = [Component, componentProps];
|
|
74
67
|
}, [JSON.stringify(uiSchema)]);
|
|
75
68
|
if (!uiSchema) {
|
|
76
69
|
return null;
|
|
77
70
|
}
|
|
78
|
-
return /*#__PURE__*/React.createElement(
|
|
71
|
+
return /*#__PURE__*/React.createElement(Component, props, props.children);
|
|
79
72
|
};
|
|
80
73
|
export var InternalFallbackField = function InternalFallbackField() {
|
|
81
74
|
var _fieldSchema$xCompon, _fieldSchema$xCompon2, _fieldSchema$xCompon3;
|
|
@@ -98,6 +91,16 @@ export var InternalFallbackField = function InternalFallbackField() {
|
|
|
98
91
|
}
|
|
99
92
|
return /*#__PURE__*/React.createElement("div", null, displayText);
|
|
100
93
|
};
|
|
94
|
+
// 当字段被删除时,显示一个提示占位符
|
|
95
|
+
var DeletedField = function DeletedField() {
|
|
96
|
+
var _useTranslation = useTranslation(),
|
|
97
|
+
t = _useTranslation.t;
|
|
98
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
99
|
+
style: {
|
|
100
|
+
color: '#ccc'
|
|
101
|
+
}
|
|
102
|
+
}, t('The field has bee deleted'));
|
|
103
|
+
};
|
|
101
104
|
export var CollectionField = connect(function (props) {
|
|
102
105
|
var _fieldSchema$xCompon4;
|
|
103
106
|
var fieldSchema = useFieldSchema();
|
|
@@ -107,7 +110,7 @@ export var CollectionField = connect(function (props) {
|
|
|
107
110
|
return /*#__PURE__*/React.createElement(CollectionFieldProvider, {
|
|
108
111
|
name: fieldSchema.name,
|
|
109
112
|
field: field,
|
|
110
|
-
fallback: snapshot ? /*#__PURE__*/React.createElement(InternalFallbackField, null) : null
|
|
113
|
+
fallback: snapshot ? /*#__PURE__*/React.createElement(InternalFallbackField, null) : /*#__PURE__*/React.createElement(DeletedField, null)
|
|
111
114
|
}, /*#__PURE__*/React.createElement(InternalField, _objectSpread({}, props)));
|
|
112
115
|
});
|
|
113
116
|
export default CollectionField;
|
|
@@ -32,6 +32,7 @@ export var CollectionManagerProvider = function CollectionManagerProvider(props)
|
|
|
32
32
|
_props$collections = props.collections,
|
|
33
33
|
collections = _props$collections === void 0 ? [] : _props$collections,
|
|
34
34
|
refreshCM = props.refreshCM,
|
|
35
|
+
updateCollection = props.updateCollection,
|
|
35
36
|
templates = props.templates;
|
|
36
37
|
var defaultTemplates = keyBy(templateOptions(), function (item) {
|
|
37
38
|
return item.name;
|
|
@@ -43,7 +44,8 @@ export var CollectionManagerProvider = function CollectionManagerProvider(props)
|
|
|
43
44
|
interfaces: _objectSpread(_objectSpread(_objectSpread({}, defaultInterfaces), ctx.interfaces), interfaces),
|
|
44
45
|
templates: _objectSpread(_objectSpread({}, defaultTemplates), templates),
|
|
45
46
|
collections: [].concat(_toConsumableArray(ctx.collections), _toConsumableArray(collections)),
|
|
46
|
-
refreshCM: refreshCM
|
|
47
|
+
refreshCM: refreshCM,
|
|
48
|
+
updateCollection: updateCollection
|
|
47
49
|
})
|
|
48
50
|
}, /*#__PURE__*/React.createElement(CollectionManagerSchemaComponentProvider, null, props.children));
|
|
49
51
|
};
|
|
@@ -135,6 +137,11 @@ export var RemoteCollectionManagerProvider = function RemoteCollectionManagerPro
|
|
|
135
137
|
return _ref2.apply(this, arguments);
|
|
136
138
|
};
|
|
137
139
|
}();
|
|
140
|
+
var updateCollection = function updateCollection(collection) {
|
|
141
|
+
service.mutate({
|
|
142
|
+
data: collection
|
|
143
|
+
});
|
|
144
|
+
};
|
|
138
145
|
return /*#__PURE__*/React.createElement(CollectionCategroriesProvider, {
|
|
139
146
|
service: _objectSpread({}, result),
|
|
140
147
|
refreshCategory: refreshCategory
|
|
@@ -144,7 +151,8 @@ export var RemoteCollectionManagerProvider = function RemoteCollectionManagerPro
|
|
|
144
151
|
setContentLoading: setContentLoading
|
|
145
152
|
}),
|
|
146
153
|
collections: service === null || service === void 0 ? void 0 : (_service$data = service.data) === null || _service$data === void 0 ? void 0 : _service$data.data,
|
|
147
|
-
refreshCM: refreshCM
|
|
154
|
+
refreshCM: refreshCM,
|
|
155
|
+
updateCollection: updateCollection
|
|
148
156
|
}, props)));
|
|
149
157
|
};
|
|
150
158
|
export var CollectionCategroriesProvider = function CollectionCategroriesProvider(props) {
|
|
@@ -32,8 +32,8 @@ import { useResourceActionContext, useResourceContext } from '../ResourceActionP
|
|
|
32
32
|
import { useCancelAction } from '../action-hooks';
|
|
33
33
|
import { useCollectionManager } from '../hooks';
|
|
34
34
|
import * as components from './components';
|
|
35
|
-
import { templateOptions } from './templates';
|
|
36
35
|
import { TemplateSummay } from './components/TemplateSummay';
|
|
36
|
+
import { templateOptions } from './templates';
|
|
37
37
|
var getSchema = function getSchema(schema, category, compile) {
|
|
38
38
|
if (!schema) {
|
|
39
39
|
return;
|