@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
|
@@ -40,6 +40,7 @@ var breakRemoveOnRow = function breakRemoveOnRow(s) {
|
|
|
40
40
|
};
|
|
41
41
|
var ColDivider = function ColDivider(props) {
|
|
42
42
|
var _dndContext$active, _dndContext$active$da, _dndContext$active$da2;
|
|
43
|
+
var dragIdRef = (0, _react2.useRef)(null);
|
|
43
44
|
var _useDroppable = (0, _core.useDroppable)({
|
|
44
45
|
id: props.id,
|
|
45
46
|
data: props.data
|
|
@@ -90,6 +91,7 @@ var ColDivider = function ColDivider(props) {
|
|
|
90
91
|
if (!isDragging) {
|
|
91
92
|
return;
|
|
92
93
|
}
|
|
94
|
+
dragIdRef.current = event.active.id;
|
|
93
95
|
var el = dividerRef.current;
|
|
94
96
|
var prev = el.previousElementSibling;
|
|
95
97
|
var next = el.nextElementSibling;
|
|
@@ -99,14 +101,23 @@ var ColDivider = function ColDivider(props) {
|
|
|
99
101
|
if (!isDragging) {
|
|
100
102
|
return;
|
|
101
103
|
}
|
|
104
|
+
if (dragIdRef.current === event.active.id) {
|
|
105
|
+
dragIdRef.current = dragIdRef.current + '_move';
|
|
106
|
+
}
|
|
102
107
|
var el = dividerRef.current;
|
|
103
108
|
var prev = el.previousElementSibling;
|
|
104
109
|
var next = el.nextElementSibling;
|
|
105
|
-
prev.style.width = "
|
|
106
|
-
next.style.width = "
|
|
110
|
+
prev.style.width = "".concat(clientWidths[0] + event.delta.x, "px");
|
|
111
|
+
next.style.width = "".concat(clientWidths[1] - event.delta.x, "px");
|
|
107
112
|
},
|
|
108
113
|
onDragEnd: function onDragEnd(event) {
|
|
109
|
-
var _ref, _ref2;
|
|
114
|
+
var _dragIdRef$current, _ref, _ref2;
|
|
115
|
+
if (!dragIdRef.current) return;
|
|
116
|
+
if ((_dragIdRef$current = dragIdRef.current) === null || _dragIdRef$current === void 0 ? void 0 : _dragIdRef$current.startsWith(event.active.id)) {
|
|
117
|
+
if (!dragIdRef.current.endsWith('_move')) {
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
110
121
|
if (clientWidths[0] <= 0 || clientWidths[1] <= 0) {
|
|
111
122
|
return;
|
|
112
123
|
}
|
|
@@ -119,8 +130,11 @@ var ColDivider = function ColDivider(props) {
|
|
|
119
130
|
var next = el.nextElementSibling;
|
|
120
131
|
prevSchema['x-component-props'] = prevSchema['x-component-props'] || {};
|
|
121
132
|
nextSchema['x-component-props'] = nextSchema['x-component-props'] || {};
|
|
122
|
-
|
|
123
|
-
|
|
133
|
+
var dividerWidth = el.clientWidth * (props.cols.length + 1) / props.cols.length;
|
|
134
|
+
var preWidth = (100 * (prev.getBoundingClientRect().width + dividerWidth) / el.parentElement.clientWidth).toFixed(2);
|
|
135
|
+
var nextWidth = (100 * (next.getBoundingClientRect().width + dividerWidth) / el.parentElement.clientWidth).toFixed(2);
|
|
136
|
+
prevSchema['x-component-props']['width'] = preWidth;
|
|
137
|
+
nextSchema['x-component-props']['width'] = nextWidth;
|
|
124
138
|
dn.emit('batchPatch', {
|
|
125
139
|
schemas: [(_ref = {}, _defineProperty(_ref, 'x-uid', prevSchema['x-uid']), _defineProperty(_ref, 'x-component-props', _objectSpread({}, prevSchema['x-component-props'])), _ref), (_ref2 = {}, _defineProperty(_ref2, 'x-uid', nextSchema['x-uid']), _defineProperty(_ref2, 'x-component-props', _objectSpread({}, nextSchema['x-component-props'])), _ref2)]
|
|
126
140
|
});
|
|
@@ -133,12 +147,12 @@ var ColDivider = function ColDivider(props) {
|
|
|
133
147
|
dividerRef.current = el;
|
|
134
148
|
}
|
|
135
149
|
},
|
|
136
|
-
className: (0, _classnames.default)('nb-col-divider', (0, _css.css)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n width: var(--nb-spacing);\n "])))),
|
|
150
|
+
className: (0, _classnames.default)('nb-col-divider', (0, _css.css)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n flex-shrink: 0;\n width: var(--nb-spacing);\n "])))),
|
|
137
151
|
style: _objectSpread({}, droppableStyle)
|
|
138
152
|
}, /*#__PURE__*/_react2.default.createElement("div", _objectSpread(_objectSpread(_objectSpread({
|
|
139
153
|
ref: setDraggableNodeRef
|
|
140
154
|
}, listeners), attributes), {}, {
|
|
141
|
-
className: props.first || props.last || !designable ? null : (0, _css.css)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n &::before {\n content: ' ';\n width:
|
|
155
|
+
className: props.first || props.last || !designable ? null : (0, _css.css)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n &::before {\n content: ' ';\n width: 100%;\n height: 100%;\n position: absolute;\n cursor: col-resize;\n }\n &:hover {\n &::before {\n background: rgba(241, 139, 98, 0.06) !important;\n }\n }\n width: var(--nb-spacing);\n height: 100%;\n position: absolute;\n cursor: col-resize;\n "])))
|
|
142
156
|
})));
|
|
143
157
|
};
|
|
144
158
|
var RowDivider = function RowDivider(props) {
|
|
@@ -326,7 +340,7 @@ Grid.Row = (0, _react.observer)(function () {
|
|
|
326
340
|
cols: cols
|
|
327
341
|
}
|
|
328
342
|
}, /*#__PURE__*/_react2.default.createElement("div", {
|
|
329
|
-
className: (0, _classnames.default)('nb-grid-row', (0, _css.css)(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n margin: 0 calc(-1 * var(--nb-spacing));\n display: flex;\n position: relative;\n /* z-index: 0; */\n "]))))
|
|
343
|
+
className: (0, _classnames.default)('nb-grid-row', (0, _css.css)(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n overflow-x: hidden;\n margin: 0 calc(-1 * var(--nb-spacing));\n display: flex;\n position: relative;\n /* z-index: 0; */\n "]))))
|
|
330
344
|
}, /*#__PURE__*/_react2.default.createElement(ColDivider, {
|
|
331
345
|
cols: cols,
|
|
332
346
|
first: true,
|
|
@@ -367,7 +381,7 @@ Grid.Col = (0, _react.observer)(function (props) {
|
|
|
367
381
|
if (cols === null || cols === void 0 ? void 0 : cols.length) {
|
|
368
382
|
var _schema$xComponentP;
|
|
369
383
|
var w = (schema === null || schema === void 0 ? void 0 : (_schema$xComponentP = schema['x-component-props']) === null || _schema$xComponentP === void 0 ? void 0 : _schema$xComponentP['width']) || 100 / cols.length;
|
|
370
|
-
width = "calc(".concat(w, "% - var(--nb-spacing) *
|
|
384
|
+
width = "calc(".concat(w, "% - var(--nb-spacing) * ").concat((cols.length + 1) / cols.length, ")");
|
|
371
385
|
}
|
|
372
386
|
var _useDroppable3 = (0, _core.useDroppable)({
|
|
373
387
|
id: field.address.toString(),
|
|
@@ -20,6 +20,14 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
20
20
|
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; }
|
|
21
21
|
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
22
22
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
23
|
+
var getContentWidth = function getContentWidth(element) {
|
|
24
|
+
if (element) {
|
|
25
|
+
var range = document.createRange();
|
|
26
|
+
range.selectNodeContents(element);
|
|
27
|
+
var contentWidth = range.getBoundingClientRect().width;
|
|
28
|
+
return contentWidth;
|
|
29
|
+
}
|
|
30
|
+
};
|
|
23
31
|
var ellipsisDefaultStyle = {
|
|
24
32
|
overflow: 'hidden',
|
|
25
33
|
overflowWrap: 'break-word',
|
|
@@ -36,6 +44,7 @@ var EllipsisWithTooltip = /*#__PURE__*/(0, _react.forwardRef)(function (props, r
|
|
|
36
44
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
37
45
|
visible = _useState4[0],
|
|
38
46
|
setVisible = _useState4[1];
|
|
47
|
+
var elRef = (0, _react.useRef)();
|
|
39
48
|
(0, _react.useImperativeHandle)(ref, function () {
|
|
40
49
|
return {
|
|
41
50
|
setPopoverVisible: setVisible
|
|
@@ -45,6 +54,12 @@ var EllipsisWithTooltip = /*#__PURE__*/(0, _react.forwardRef)(function (props, r
|
|
|
45
54
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, props.children);
|
|
46
55
|
}
|
|
47
56
|
var popoverContent = props.popoverContent;
|
|
57
|
+
var isOverflowTooltip = function isOverflowTooltip() {
|
|
58
|
+
var _elRef$current;
|
|
59
|
+
var contentWidth = getContentWidth(elRef.current);
|
|
60
|
+
var offsetWidth = (_elRef$current = elRef.current) === null || _elRef$current === void 0 ? void 0 : _elRef$current.offsetWidth;
|
|
61
|
+
return contentWidth > offsetWidth;
|
|
62
|
+
};
|
|
48
63
|
return /*#__PURE__*/_react.default.createElement(_antd.Popover, {
|
|
49
64
|
visible: ellipsis && visible,
|
|
50
65
|
onVisibleChange: function onVisibleChange(visible) {
|
|
@@ -57,10 +72,14 @@ var EllipsisWithTooltip = /*#__PURE__*/(0, _react.forwardRef)(function (props, r
|
|
|
57
72
|
}
|
|
58
73
|
}, popoverContent || props.children)
|
|
59
74
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
75
|
+
ref: elRef,
|
|
60
76
|
style: _objectSpread({}, ellipsisDefaultStyle),
|
|
61
77
|
onMouseEnter: function onMouseEnter(e) {
|
|
62
78
|
var el = e.target;
|
|
63
|
-
|
|
79
|
+
var isShowTooltips = isOverflowTooltip();
|
|
80
|
+
if (isShowTooltips) {
|
|
81
|
+
setEllipsis(el.scrollWidth >= el.clientWidth);
|
|
82
|
+
}
|
|
64
83
|
}
|
|
65
84
|
}, props.children));
|
|
66
85
|
});
|
|
@@ -12,6 +12,7 @@ var _react = require("@formily/react");
|
|
|
12
12
|
var _antd2 = require("antd");
|
|
13
13
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
14
14
|
var _react2 = _interopRequireWildcard(require("react"));
|
|
15
|
+
var _reactErrorBoundary = require("react-error-boundary");
|
|
15
16
|
var _reactI18next = require("react-i18next");
|
|
16
17
|
var _reactRouterDom = require("react-router-dom");
|
|
17
18
|
var _documentTitle = require("../../../document-title");
|
|
@@ -21,6 +22,7 @@ var _common = require("../../common");
|
|
|
21
22
|
var _sortableItem = require("../../common/sortable-item");
|
|
22
23
|
var _core = require("../../core");
|
|
23
24
|
var _hooks = require("../../hooks");
|
|
25
|
+
var _errorFallback = require("../error-fallback");
|
|
24
26
|
var _FixedBlock = _interopRequireDefault(require("./FixedBlock"));
|
|
25
27
|
var _PageTabDesigner = require("./PageTabDesigner");
|
|
26
28
|
var _excluded = ["children"];
|
|
@@ -86,6 +88,9 @@ var Page = function Page(props) {
|
|
|
86
88
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
87
89
|
height = _useState6[0],
|
|
88
90
|
setHeight = _useState6[1];
|
|
91
|
+
var handleErrors = function handleErrors(error) {
|
|
92
|
+
console.error(error);
|
|
93
|
+
};
|
|
89
94
|
return /*#__PURE__*/_react2.default.createElement(_FilterProvider.FilterBlockProvider, null, /*#__PURE__*/_react2.default.createElement("div", {
|
|
90
95
|
className: pageDesignerCss
|
|
91
96
|
}, /*#__PURE__*/_react2.default.createElement(_PageTabDesigner.PageDesigner, {
|
|
@@ -193,6 +198,9 @@ var Page = function Page(props) {
|
|
|
193
198
|
margin: 'var(--nb-spacing)',
|
|
194
199
|
flex: 1
|
|
195
200
|
}
|
|
201
|
+
}, /*#__PURE__*/_react2.default.createElement(_reactErrorBoundary.ErrorBoundary, {
|
|
202
|
+
FallbackComponent: _errorFallback.ErrorFallback,
|
|
203
|
+
onError: handleErrors
|
|
196
204
|
}, loading ? /*#__PURE__*/_react2.default.createElement(_antd2.Spin, null) : !disablePageHeader && enablePageTabs ? fieldSchema.mapProperties(function (schema) {
|
|
197
205
|
if (schema.name !== activeKey) return null;
|
|
198
206
|
return /*#__PURE__*/_react2.default.createElement(_FixedBlock.default, {
|
|
@@ -209,6 +217,6 @@ var Page = function Page(props) {
|
|
|
209
217
|
"calc(".concat(height, "px + 46px + var(--nb-spacing) * 2)")
|
|
210
218
|
}, /*#__PURE__*/_react2.default.createElement("div", {
|
|
211
219
|
className: pageWithFixedBlockCss
|
|
212
|
-
}, props.children)))));
|
|
220
|
+
}, props.children))))));
|
|
213
221
|
};
|
|
214
222
|
exports.Page = Page;
|
|
@@ -25,6 +25,13 @@ var Pagination = (0, _react.observer)(function (props) {
|
|
|
25
25
|
if (hidden) {
|
|
26
26
|
return null;
|
|
27
27
|
}
|
|
28
|
-
|
|
28
|
+
var onKeypress = function onKeypress(e) {
|
|
29
|
+
if (e.key === 'Enter') {
|
|
30
|
+
e.preventDefault();
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
return /*#__PURE__*/_react2.default.createElement("div", {
|
|
34
|
+
onKeyPress: onKeypress
|
|
35
|
+
}, /*#__PURE__*/_react2.default.createElement(_antd.Pagination, _objectSpread({}, others)));
|
|
29
36
|
});
|
|
30
37
|
exports.Pagination = Pagination;
|
|
@@ -190,7 +190,7 @@ var InputRecordPicker = function InputRecordPicker(props) {
|
|
|
190
190
|
multiple: multiple,
|
|
191
191
|
quickUpload: quickUpload,
|
|
192
192
|
selectFile: selectFile,
|
|
193
|
-
action: "".concat(collectionField.target, ":create"),
|
|
193
|
+
action: "".concat(collectionField === null || collectionField === void 0 ? void 0 : collectionField.target, ":create"),
|
|
194
194
|
onSelect: handleSelect,
|
|
195
195
|
onRemove: handleRemove,
|
|
196
196
|
onChange: function onChange(changed) {
|
|
@@ -257,12 +257,11 @@ var Drawer = function Drawer(_ref) {
|
|
|
257
257
|
setVisible = _ref.setVisible,
|
|
258
258
|
fieldSchema = _ref.fieldSchema,
|
|
259
259
|
options = _ref.options;
|
|
260
|
-
console.log('collectionField', options);
|
|
261
260
|
var getFilter = function getFilter() {
|
|
262
|
-
var targetKey = collectionField.targetKey || 'id';
|
|
261
|
+
var targetKey = (collectionField === null || collectionField === void 0 ? void 0 : collectionField.targetKey) || 'id';
|
|
263
262
|
var list = options.map(function (option) {
|
|
264
263
|
return option[targetKey];
|
|
265
|
-
});
|
|
264
|
+
}).filter(Boolean);
|
|
266
265
|
var filter = list.length ? {
|
|
267
266
|
$and: [_defineProperty({}, "".concat(targetKey, ".$ne"), list)]
|
|
268
267
|
} : {};
|
|
@@ -9,6 +9,7 @@ export declare type RemoteSelectProps<P = any> = SelectProps<P, any> & {
|
|
|
9
9
|
wait?: number;
|
|
10
10
|
manual?: boolean;
|
|
11
11
|
mapOptions?: (data: any) => RemoteSelectProps['fieldNames'];
|
|
12
|
+
targetField?: any;
|
|
12
13
|
service: ResourceActionOptions<P>;
|
|
13
14
|
};
|
|
14
15
|
export declare const RemoteSelect: React.ForwardRefExoticComponent<Partial<SelectProps<any, any> & {
|
|
@@ -18,6 +19,7 @@ export declare const RemoteSelect: React.ForwardRefExoticComponent<Partial<Selec
|
|
|
18
19
|
wait?: number;
|
|
19
20
|
manual?: boolean;
|
|
20
21
|
mapOptions?: (data: any) => RemoteSelectProps['fieldNames'];
|
|
22
|
+
targetField?: any;
|
|
21
23
|
service: ResourceActionOptions<any>;
|
|
22
24
|
}> & React.RefAttributes<unknown>> & {
|
|
23
25
|
ReadPretty: typeof ReadPretty;
|
|
@@ -6,15 +6,19 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = exports.RemoteSelect = void 0;
|
|
7
7
|
var _icons = require("@ant-design/icons");
|
|
8
8
|
var _react = require("@formily/react");
|
|
9
|
+
var _antd = require("antd");
|
|
10
|
+
var _moment = _interopRequireDefault(require("moment"));
|
|
9
11
|
var _react2 = _interopRequireWildcard(require("react"));
|
|
10
12
|
var _apiClient = require("../../../api-client");
|
|
11
13
|
var _SharedFilterProvider = require("../../../block-provider/SharedFilterProvider");
|
|
14
|
+
var _collectionManager = require("../../../collection-manager");
|
|
12
15
|
var _hooks = require("../../hooks");
|
|
13
16
|
var _select = require("../select");
|
|
14
17
|
var _ReadPretty = require("./ReadPretty");
|
|
15
|
-
var _excluded = ["fieldNames", "service", "wait", "value", "objectValue", "manual", "mapOptions"];
|
|
18
|
+
var _excluded = ["fieldNames", "service", "wait", "value", "objectValue", "manual", "mapOptions", "targetField"];
|
|
16
19
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
17
20
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
21
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
18
22
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
19
23
|
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
20
24
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
@@ -39,9 +43,73 @@ var InternalRemoteSelect = (0, _react.connect)(function (props) {
|
|
|
39
43
|
_props$manual = props.manual,
|
|
40
44
|
manual = _props$manual === void 0 ? true : _props$manual,
|
|
41
45
|
mapOptions = props.mapOptions,
|
|
46
|
+
_targetField = props.targetField,
|
|
42
47
|
others = _objectWithoutProperties(props, _excluded);
|
|
43
48
|
var compile = (0, _hooks.useCompile)();
|
|
44
49
|
var firstRun = (0, _react2.useRef)(false);
|
|
50
|
+
var fieldSchema = (0, _react.useFieldSchema)();
|
|
51
|
+
var _useCollection = (0, _collectionManager.useCollection)(),
|
|
52
|
+
getField = _useCollection.getField;
|
|
53
|
+
var _useCollectionManager = (0, _collectionManager.useCollectionManager)(),
|
|
54
|
+
getCollectionJoinField = _useCollectionManager.getCollectionJoinField,
|
|
55
|
+
getInterface = _useCollectionManager.getInterface;
|
|
56
|
+
var collectionField = getField(fieldSchema.name);
|
|
57
|
+
var targetField = _targetField || (collectionField === null || collectionField === void 0 ? void 0 : collectionField.target) && (fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.label) && getCollectionJoinField("".concat(collectionField.target, ".").concat(fieldNames.label));
|
|
58
|
+
var operator = (0, _react2.useMemo)(function () {
|
|
59
|
+
if (targetField === null || targetField === void 0 ? void 0 : targetField.interface) {
|
|
60
|
+
var _getInterface, _getInterface$filtera;
|
|
61
|
+
return ((_getInterface = getInterface(targetField.interface)) === null || _getInterface === void 0 ? void 0 : (_getInterface$filtera = _getInterface.filterable) === null || _getInterface$filtera === void 0 ? void 0 : _getInterface$filtera.operators[0].value) || '$includes';
|
|
62
|
+
}
|
|
63
|
+
return '$includes';
|
|
64
|
+
}, [targetField]);
|
|
65
|
+
var mapOptionsToTags = (0, _react2.useCallback)(function (options) {
|
|
66
|
+
try {
|
|
67
|
+
return options.map(function (option) {
|
|
68
|
+
var _targetField$uiSchema, _ref;
|
|
69
|
+
var label = option[fieldNames.label];
|
|
70
|
+
if (targetField === null || targetField === void 0 ? void 0 : (_targetField$uiSchema = targetField.uiSchema) === null || _targetField$uiSchema === void 0 ? void 0 : _targetField$uiSchema.enum) {
|
|
71
|
+
if (Array.isArray(label)) {
|
|
72
|
+
label = label.map(function (item, index) {
|
|
73
|
+
var option = targetField.uiSchema.enum.find(function (i) {
|
|
74
|
+
return i.value === item;
|
|
75
|
+
});
|
|
76
|
+
if (option) {
|
|
77
|
+
return /*#__PURE__*/_react2.default.createElement(_antd.Tag, {
|
|
78
|
+
key: index,
|
|
79
|
+
color: option.color,
|
|
80
|
+
style: {
|
|
81
|
+
marginRight: 3
|
|
82
|
+
}
|
|
83
|
+
}, (option === null || option === void 0 ? void 0 : option.label) || item);
|
|
84
|
+
} else {
|
|
85
|
+
return /*#__PURE__*/_react2.default.createElement(_antd.Tag, null, item);
|
|
86
|
+
}
|
|
87
|
+
}).reverse();
|
|
88
|
+
} else {
|
|
89
|
+
var item = targetField.uiSchema.enum.find(function (i) {
|
|
90
|
+
return i.value === label;
|
|
91
|
+
});
|
|
92
|
+
if (item) {
|
|
93
|
+
label = /*#__PURE__*/_react2.default.createElement(_antd.Tag, {
|
|
94
|
+
color: item.color
|
|
95
|
+
}, item.label);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
if ((targetField === null || targetField === void 0 ? void 0 : targetField.type) === 'date') {
|
|
100
|
+
label = (0, _moment.default)(label).format('YYYY-MM-DD');
|
|
101
|
+
}
|
|
102
|
+
if (mapOptions) {
|
|
103
|
+
var _mapOptions;
|
|
104
|
+
return mapOptions((_mapOptions = {}, _defineProperty(_mapOptions, fieldNames.label, label), _defineProperty(_mapOptions, fieldNames.value, option[fieldNames.value]), _mapOptions));
|
|
105
|
+
}
|
|
106
|
+
return _ref = {}, _defineProperty(_ref, fieldNames.label, label || option[fieldNames.value]), _defineProperty(_ref, fieldNames.value, option[fieldNames.value]), _ref;
|
|
107
|
+
});
|
|
108
|
+
} catch (err) {
|
|
109
|
+
console.error(err);
|
|
110
|
+
return options;
|
|
111
|
+
}
|
|
112
|
+
}, [targetField === null || targetField === void 0 ? void 0 : targetField.uiSchema, fieldNames]);
|
|
45
113
|
var _useRequest = (0, _apiClient.useRequest)(_objectSpread(_objectSpread({
|
|
46
114
|
action: 'list'
|
|
47
115
|
}, service), {}, {
|
|
@@ -72,15 +140,13 @@ var InternalRemoteSelect = (0, _react.connect)(function (props) {
|
|
|
72
140
|
}
|
|
73
141
|
}, [runDep]);
|
|
74
142
|
var onSearch = /*#__PURE__*/function () {
|
|
75
|
-
var
|
|
143
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(search) {
|
|
76
144
|
var _service$params2;
|
|
77
145
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
78
146
|
while (1) switch (_context.prev = _context.next) {
|
|
79
147
|
case 0:
|
|
80
148
|
run({
|
|
81
|
-
filter: (0, _SharedFilterProvider.mergeFilter)([_defineProperty({}, fieldNames.label, {
|
|
82
|
-
$includes: search
|
|
83
|
-
}), service === null || service === void 0 ? void 0 : (_service$params2 = service.params) === null || _service$params2 === void 0 ? void 0 : _service$params2.filter])
|
|
149
|
+
filter: (0, _SharedFilterProvider.mergeFilter)([_defineProperty({}, fieldNames.label, _defineProperty({}, operator, search)), service === null || service === void 0 ? void 0 : (_service$params2 = service.params) === null || _service$params2 === void 0 ? void 0 : _service$params2.filter])
|
|
84
150
|
});
|
|
85
151
|
case 1:
|
|
86
152
|
case "end":
|
|
@@ -89,13 +155,10 @@ var InternalRemoteSelect = (0, _react.connect)(function (props) {
|
|
|
89
155
|
}, _callee);
|
|
90
156
|
}));
|
|
91
157
|
return function onSearch(_x) {
|
|
92
|
-
return
|
|
158
|
+
return _ref2.apply(this, arguments);
|
|
93
159
|
};
|
|
94
160
|
}();
|
|
95
161
|
var getOptionsByFieldNames = (0, _react2.useCallback)(function (item) {
|
|
96
|
-
if (mapOptions) {
|
|
97
|
-
return mapOptions(item);
|
|
98
|
-
}
|
|
99
162
|
return Object.keys(fieldNames).reduce(function (obj, key) {
|
|
100
163
|
var value = item[fieldNames[key]];
|
|
101
164
|
if (value) {
|
|
@@ -106,11 +169,11 @@ var InternalRemoteSelect = (0, _react.connect)(function (props) {
|
|
|
106
169
|
}, {});
|
|
107
170
|
}, [fieldNames]);
|
|
108
171
|
var normalizeOptions = (0, _react2.useCallback)(function (obj) {
|
|
109
|
-
var
|
|
172
|
+
var _ref4;
|
|
110
173
|
if (objectValue || _typeof(obj) === 'object') {
|
|
111
174
|
return getOptionsByFieldNames(obj);
|
|
112
175
|
}
|
|
113
|
-
return
|
|
176
|
+
return _ref4 = {}, _defineProperty(_ref4, fieldNames.value, obj), _defineProperty(_ref4, fieldNames.label, obj), _ref4;
|
|
114
177
|
}, [objectValue, getOptionsByFieldNames]);
|
|
115
178
|
var options = (0, _react2.useMemo)(function () {
|
|
116
179
|
var _data$data, _data$data2;
|
|
@@ -137,7 +200,7 @@ var InternalRemoteSelect = (0, _react.connect)(function (props) {
|
|
|
137
200
|
value: value
|
|
138
201
|
}, others), {}, {
|
|
139
202
|
loading: loading,
|
|
140
|
-
options: options
|
|
203
|
+
options: mapOptionsToTags(options)
|
|
141
204
|
}));
|
|
142
205
|
}, (0, _react.mapProps)({
|
|
143
206
|
dataSource: 'options'
|
|
@@ -11,6 +11,7 @@ var _antd = require("antd");
|
|
|
11
11
|
var _react2 = _interopRequireDefault(require("react"));
|
|
12
12
|
var _hooks = require("../../hooks");
|
|
13
13
|
var _shared2 = require("./shared");
|
|
14
|
+
var _EllipsisWithTooltip = require("../input/EllipsisWithTooltip");
|
|
14
15
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
16
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
16
17
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
@@ -31,12 +32,14 @@ var ReadPretty = (0, _react.observer)(function (props) {
|
|
|
31
32
|
}
|
|
32
33
|
var dataSource = field.dataSource || props.options || [];
|
|
33
34
|
var options = (0, _shared2.getCurrentOptions)(field.value, dataSource, fieldNames);
|
|
34
|
-
return /*#__PURE__*/_react2.default.createElement("div", null,
|
|
35
|
+
return /*#__PURE__*/_react2.default.createElement("div", null, /*#__PURE__*/_react2.default.createElement(_EllipsisWithTooltip.EllipsisWithTooltip, {
|
|
36
|
+
ellipsis: props.ellipsis
|
|
37
|
+
}, options.map(function (option, key) {
|
|
35
38
|
return /*#__PURE__*/_react2.default.createElement(_antd.Tag, {
|
|
36
39
|
key: key,
|
|
37
40
|
color: option[fieldNames.color],
|
|
38
41
|
icon: option.icon
|
|
39
42
|
}, compile(option[fieldNames.label]));
|
|
40
|
-
}));
|
|
43
|
+
})));
|
|
41
44
|
});
|
|
42
45
|
exports.ReadPretty = ReadPretty;
|
|
@@ -90,18 +90,12 @@ var InternalSelect = (0, _react.connect)(function (props) {
|
|
|
90
90
|
value = props.value,
|
|
91
91
|
others = _objectWithoutProperties(props, _excluded2);
|
|
92
92
|
var mode = props.multiple ? 'multiple' : props.mode;
|
|
93
|
-
if (mode
|
|
93
|
+
if (mode && !['multiple', 'tags'].includes(mode)) {
|
|
94
94
|
mode = undefined;
|
|
95
95
|
}
|
|
96
|
-
var toValue = function toValue(v) {
|
|
97
|
-
if (['multiple', 'tags'].includes(mode)) {
|
|
98
|
-
return v || [];
|
|
99
|
-
}
|
|
100
|
-
return v;
|
|
101
|
-
};
|
|
102
96
|
if (objectValue) {
|
|
103
97
|
return /*#__PURE__*/_react2.default.createElement(ObjectSelect, _objectSpread(_objectSpread({}, others), {}, {
|
|
104
|
-
value:
|
|
98
|
+
value: value,
|
|
105
99
|
mode: mode
|
|
106
100
|
}));
|
|
107
101
|
}
|
|
@@ -109,7 +103,7 @@ var InternalSelect = (0, _react.connect)(function (props) {
|
|
|
109
103
|
showSearch: true,
|
|
110
104
|
filterOption: filterOption,
|
|
111
105
|
allowClear: true,
|
|
112
|
-
value:
|
|
106
|
+
value: value
|
|
113
107
|
}, others), {}, {
|
|
114
108
|
onChange: function onChange(changed) {
|
|
115
109
|
var _props$onChange;
|
|
@@ -5,153 +5,17 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.FilterDynamicComponent = FilterDynamicComponent;
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
|
-
var
|
|
9
|
-
var _useValues2 = require("../filter/useValues");
|
|
8
|
+
var _useVariableOptions = require("../../../schema-settings/VariableInput/hooks/useVariableOptions");
|
|
10
9
|
var _variable = require("../variable");
|
|
11
|
-
var _useUserVariable = require("./hooks/useUserVariable");
|
|
12
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
-
var useVariableOptions = function useVariableOptions() {
|
|
14
|
-
var _useValues = (0, _useValues2.useValues)(),
|
|
15
|
-
operator = _useValues.operator,
|
|
16
|
-
schema = _useValues.schema;
|
|
17
|
-
var operatorValue = (operator === null || operator === void 0 ? void 0 : operator.value) || '';
|
|
18
|
-
var userVariable = (0, _useUserVariable.useUserVariable)({
|
|
19
|
-
schema: schema,
|
|
20
|
-
operator: operator
|
|
21
|
-
});
|
|
22
|
-
if (!operator || !schema) return [];
|
|
23
|
-
var disabled = !['DatePicker', 'DatePicker.RangePicker'].includes(schema['x-component']);
|
|
24
|
-
var dateOptions = [{
|
|
25
|
-
key: 'now',
|
|
26
|
-
value: 'now',
|
|
27
|
-
label: "{{t(\"Now\")}}",
|
|
28
|
-
disabled: schema['x-component'] !== 'DatePicker' || operatorValue === '$dateBetween'
|
|
29
|
-
}, {
|
|
30
|
-
key: 'yesterday',
|
|
31
|
-
value: 'yesterday',
|
|
32
|
-
label: "{{t(\"Yesterday\")}}",
|
|
33
|
-
disabled: disabled
|
|
34
|
-
}, {
|
|
35
|
-
key: 'today',
|
|
36
|
-
value: 'today',
|
|
37
|
-
label: "{{t(\"Today\")}}",
|
|
38
|
-
disabled: disabled
|
|
39
|
-
}, {
|
|
40
|
-
key: 'tomorrow',
|
|
41
|
-
value: 'tomorrow',
|
|
42
|
-
label: "{{t(\"Tomorrow\")}}",
|
|
43
|
-
disabled: disabled
|
|
44
|
-
}, {
|
|
45
|
-
key: 'lastIsoWeek',
|
|
46
|
-
value: 'lastIsoWeek',
|
|
47
|
-
label: "{{t(\"Last week\")}}",
|
|
48
|
-
disabled: disabled
|
|
49
|
-
}, {
|
|
50
|
-
key: 'thisIsoWeek',
|
|
51
|
-
value: 'thisIsoWeek',
|
|
52
|
-
label: "{{t(\"This week\")}}",
|
|
53
|
-
disabled: disabled
|
|
54
|
-
}, {
|
|
55
|
-
key: 'nextIsoWeek',
|
|
56
|
-
value: 'nextIsoWeek',
|
|
57
|
-
label: "{{t(\"Next week\")}}",
|
|
58
|
-
disabled: disabled
|
|
59
|
-
}, {
|
|
60
|
-
key: 'lastMonth',
|
|
61
|
-
value: 'lastMonth',
|
|
62
|
-
label: "{{t(\"Last month\")}}",
|
|
63
|
-
disabled: disabled
|
|
64
|
-
}, {
|
|
65
|
-
key: 'thisMonth',
|
|
66
|
-
value: 'thisMonth',
|
|
67
|
-
label: "{{t(\"This month\")}}",
|
|
68
|
-
disabled: disabled
|
|
69
|
-
}, {
|
|
70
|
-
key: 'nextMonth',
|
|
71
|
-
value: 'nextMonth',
|
|
72
|
-
label: "{{t(\"Next month\")}}",
|
|
73
|
-
disabled: disabled
|
|
74
|
-
}, {
|
|
75
|
-
key: 'lastQuarter',
|
|
76
|
-
value: 'lastQuarter',
|
|
77
|
-
label: "{{t(\"Last quarter\")}}",
|
|
78
|
-
disabled: disabled
|
|
79
|
-
}, {
|
|
80
|
-
key: 'thisQuarter',
|
|
81
|
-
value: 'thisQuarter',
|
|
82
|
-
label: "{{t(\"This quarter\")}}",
|
|
83
|
-
disabled: disabled
|
|
84
|
-
}, {
|
|
85
|
-
key: 'nextQuarter',
|
|
86
|
-
value: 'nextQuarter',
|
|
87
|
-
label: "{{t(\"Next quarter\")}}",
|
|
88
|
-
disabled: disabled
|
|
89
|
-
}, {
|
|
90
|
-
key: 'lastYear',
|
|
91
|
-
value: 'lastYear',
|
|
92
|
-
label: "{{t(\"Last year\")}}",
|
|
93
|
-
disabled: disabled
|
|
94
|
-
}, {
|
|
95
|
-
key: 'thisYear',
|
|
96
|
-
value: 'thisYear',
|
|
97
|
-
label: "{{t(\"This year\")}}",
|
|
98
|
-
disabled: disabled
|
|
99
|
-
}, {
|
|
100
|
-
key: 'nextYear',
|
|
101
|
-
value: 'nextYear',
|
|
102
|
-
label: "{{t(\"Next year\")}}",
|
|
103
|
-
disabled: disabled
|
|
104
|
-
}, {
|
|
105
|
-
key: 'last7Days',
|
|
106
|
-
value: 'last7Days',
|
|
107
|
-
label: "{{t(\"Last 7 days\")}}",
|
|
108
|
-
disabled: disabled
|
|
109
|
-
}, {
|
|
110
|
-
key: 'next7Days',
|
|
111
|
-
value: 'next7Days',
|
|
112
|
-
label: "{{t(\"Next 7 days\")}}",
|
|
113
|
-
disabled: disabled
|
|
114
|
-
}, {
|
|
115
|
-
key: 'last30Days',
|
|
116
|
-
value: 'last30Days',
|
|
117
|
-
label: "{{t(\"Last 30 days\")}}",
|
|
118
|
-
disabled: disabled
|
|
119
|
-
}, {
|
|
120
|
-
key: 'next30Days',
|
|
121
|
-
value: 'next30Days',
|
|
122
|
-
label: "{{t(\"Next 30 days\")}}",
|
|
123
|
-
disabled: disabled
|
|
124
|
-
}, {
|
|
125
|
-
key: 'last90Days',
|
|
126
|
-
value: 'last90Days',
|
|
127
|
-
label: "{{t(\"Last 90 days\")}}",
|
|
128
|
-
disabled: disabled
|
|
129
|
-
}, {
|
|
130
|
-
key: 'next90Days',
|
|
131
|
-
value: 'next90Days',
|
|
132
|
-
label: "{{t(\"Next 90 days\")}}",
|
|
133
|
-
disabled: disabled
|
|
134
|
-
}];
|
|
135
|
-
return [userVariable, {
|
|
136
|
-
label: "{{t(\"Date variables\")}}",
|
|
137
|
-
value: '$date',
|
|
138
|
-
key: '$date',
|
|
139
|
-
disabled: dateOptions.every(function (option) {
|
|
140
|
-
return option.disabled;
|
|
141
|
-
}),
|
|
142
|
-
children: dateOptions
|
|
143
|
-
}];
|
|
144
|
-
};
|
|
145
11
|
function FilterDynamicComponent(props) {
|
|
146
12
|
var value = props.value,
|
|
147
13
|
onChange = props.onChange,
|
|
148
14
|
renderSchemaComponent = props.renderSchemaComponent;
|
|
149
|
-
var options = useVariableOptions();
|
|
150
|
-
var compile = (0, _.useCompile)();
|
|
151
|
-
var scope = compile(options);
|
|
15
|
+
var options = (0, _useVariableOptions.useVariableOptions)();
|
|
152
16
|
return /*#__PURE__*/_react.default.createElement(_variable.Variable.Input, {
|
|
153
17
|
value: value,
|
|
154
18
|
onChange: onChange,
|
|
155
|
-
scope:
|
|
19
|
+
scope: options
|
|
156
20
|
}, renderSchemaComponent());
|
|
157
21
|
}
|