@nocobase/client 0.9.3-alpha.1 → 0.9.4-alpha.2
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/ACLProvider.js +2 -2
- package/es/acl/Configuration/RoleConfigure.js +15 -8
- package/es/api-client/APIClient.d.ts +2 -0
- package/es/api-client/APIClient.js +11 -0
- package/es/block-provider/BlockProvider.js +58 -17
- package/es/block-provider/hooks/index.js +81 -60
- package/es/collection-manager/CollectionField.js +3 -3
- package/es/collection-manager/CollectionFieldProvider.js +2 -1
- package/es/collection-manager/Configuration/AddFieldAction.js +3 -3
- package/es/collection-manager/Configuration/CollectionFields.d.ts +1 -1
- package/es/collection-manager/Configuration/CollectionFields.js +1 -3
- package/es/collection-manager/Configuration/ConfigurationTabs.js +7 -6
- package/es/collection-manager/hooks/useCollection.d.ts +1 -1
- package/es/collection-manager/hooks/useCollectionDataSource.js +4 -4
- package/es/collection-manager/interfaces/m2m.js +1 -1
- package/es/collection-manager/interfaces/m2o.js +1 -1
- package/es/collection-manager/interfaces/o2m.js +1 -1
- package/es/collection-manager/interfaces/o2o.js +2 -2
- package/es/collection-manager/templates/expression.js +1 -1
- package/es/filter-provider/utils.js +1 -1
- package/es/index.d.ts +1 -0
- package/es/index.js +1 -0
- package/es/locale/en_US.d.ts +16 -1
- package/es/locale/en_US.js +17 -2
- package/es/locale/es_ES.d.ts +692 -0
- package/es/locale/es_ES.js +691 -0
- package/es/locale/ja_JP.d.ts +5 -1
- package/es/locale/ja_JP.js +6 -2
- package/es/locale/pt_BR.d.ts +5 -1
- package/es/locale/pt_BR.js +6 -2
- package/es/locale/ru_RU.d.ts +5 -1
- package/es/locale/ru_RU.js +6 -2
- package/es/locale/tr_TR.d.ts +5 -1
- package/es/locale/tr_TR.js +6 -2
- package/es/locale/zh_CN.d.ts +25 -2
- package/es/locale/zh_CN.js +26 -3
- package/es/pm/PluginManagerLink.js +22 -14
- package/es/record-provider/index.d.ts +4 -0
- package/es/record-provider/index.js +3 -0
- package/es/schema-component/antd/action/Action.Designer.js +6 -3
- package/es/schema-component/antd/action/Action.Drawer.js +5 -2
- package/es/schema-component/antd/action/Action.js +2 -2
- package/es/schema-component/antd/action/ActionBar.js +25 -18
- package/es/schema-component/antd/association-field/AssociationFieldProvider.d.ts +2 -2
- package/es/schema-component/antd/association-field/AssociationFieldProvider.js +62 -9
- package/es/schema-component/antd/association-field/AssociationSelect.js +10 -65
- package/es/schema-component/antd/association-field/Editable.d.ts +1 -1
- package/es/schema-component/antd/association-field/Editable.js +32 -40
- package/es/schema-component/antd/association-field/InternalNester.js +4 -3
- package/es/schema-component/antd/association-field/InternalPicker.js +29 -60
- package/es/schema-component/antd/association-field/InternalViewer.js +9 -12
- package/es/schema-component/antd/association-field/Nester.js +19 -21
- package/es/schema-component/antd/association-field/ReadPretty.d.ts +1 -1
- package/es/schema-component/antd/association-field/ReadPretty.js +9 -25
- package/es/schema-component/antd/association-field/components/CreateRecordAction.d.ts +2 -0
- package/es/schema-component/antd/association-field/components/CreateRecordAction.js +61 -0
- package/es/schema-component/antd/association-field/context.d.ts +5 -2
- package/es/schema-component/antd/association-field/context.js +1 -1
- package/es/schema-component/antd/association-field/hooks.d.ts +3 -0
- package/es/schema-component/antd/association-field/hooks.js +10 -10
- package/es/schema-component/antd/association-filter/AssociationFilter.Item.js +3 -3
- package/es/schema-component/antd/association-select/AssociationSelect.js +49 -231
- package/es/schema-component/antd/association-select/useServiceOptions.js +2 -2
- package/es/schema-component/antd/collection-select/CollectionSelect.js +5 -0
- package/es/schema-component/antd/filter/FilterAction.js +2 -2
- package/es/schema-component/antd/form/Form.js +4 -4
- package/es/schema-component/antd/form-item/FormItem.js +126 -145
- package/es/schema-component/antd/form-item/SchemaSettingOptions.js +3 -3
- package/es/schema-component/antd/form-v2/Form.Designer.js +1 -0
- package/es/schema-component/antd/form-v2/Templates.d.ts +20 -0
- package/es/schema-component/antd/form-v2/Templates.js +42 -12
- package/es/schema-component/antd/grid/Grid.js +34 -24
- package/es/schema-component/antd/grid-card/GridCard.Decorator.d.ts +5 -0
- package/es/schema-component/antd/grid-card/GridCard.Decorator.js +65 -0
- package/es/schema-component/antd/grid-card/GridCard.Designer.d.ts +1 -0
- package/es/schema-component/antd/grid-card/GridCard.Designer.js +243 -0
- package/es/schema-component/antd/grid-card/GridCard.Item.d.ts +1 -0
- package/es/schema-component/antd/grid-card/GridCard.Item.js +18 -0
- package/es/schema-component/antd/grid-card/GridCard.d.ts +8 -0
- package/es/schema-component/antd/grid-card/GridCard.js +103 -0
- package/es/schema-component/antd/grid-card/hooks.d.ts +4 -0
- package/es/schema-component/antd/grid-card/hooks.js +9 -0
- package/es/schema-component/antd/grid-card/index.d.ts +1 -0
- package/es/schema-component/antd/grid-card/index.js +1 -0
- package/es/schema-component/antd/grid-card/options.d.ts +20 -0
- package/es/schema-component/antd/grid-card/options.js +20 -0
- package/es/schema-component/antd/icon-picker/IconPicker.js +2 -2
- package/es/schema-component/antd/index.d.ts +2 -0
- package/es/schema-component/antd/index.js +2 -0
- package/es/schema-component/antd/input/EllipsisWithTooltip.js +2 -2
- package/es/schema-component/antd/list/List.Decorator.d.ts +5 -0
- package/es/schema-component/antd/list/List.Decorator.js +59 -0
- package/es/schema-component/antd/list/List.Designer.d.ts +1 -0
- package/es/schema-component/antd/list/List.Designer.js +205 -0
- package/es/schema-component/antd/list/List.Item.d.ts +1 -0
- package/es/schema-component/antd/list/List.Item.js +15 -0
- package/es/schema-component/antd/list/List.d.ts +8 -0
- package/es/schema-component/antd/list/List.js +83 -0
- package/es/schema-component/antd/list/hooks.d.ts +4 -0
- package/es/schema-component/antd/list/hooks.js +9 -0
- package/es/schema-component/antd/list/index.d.ts +1 -0
- package/es/schema-component/antd/list/index.js +1 -0
- package/es/schema-component/antd/remote-select/RemoteSelect.js +12 -10
- package/es/schema-component/antd/select/Select.js +15 -4
- package/es/schema-component/antd/table/Table.Void.Designer.js +1 -0
- package/es/schema-component/antd/table-v2/TableBlockDesigner.js +2 -1
- package/es/schema-component/antd/table-v2/TableSelectorDesigner.js +1 -0
- package/es/schema-component/antd/table-v2/hooks/useUserVariable.d.ts +22 -0
- package/es/schema-component/antd/table-v2/hooks/useUserVariable.js +65 -0
- package/es/schema-component/antd/variable/Input.js +6 -3
- package/es/schema-component/common/dnd-context/index.js +2 -2
- package/es/schema-component/common/sortable-item/SortableItem.js +3 -4
- package/es/schema-component/core/SchemaComponentProvider.js +2 -2
- package/es/schema-initializer/SchemaInitializerProvider.d.ts +1 -0
- package/es/schema-initializer/SchemaInitializerProvider.js +23 -10
- package/es/schema-initializer/buttons/BlockInitializers.js +10 -0
- package/es/schema-initializer/buttons/CustomFormItemInitializers.js +4 -2
- package/es/schema-initializer/buttons/FormActionInitializers.d.ts +0 -116
- package/es/schema-initializer/buttons/FormActionInitializers.js +106 -100
- package/es/schema-initializer/buttons/GanttActionInitializers.d.ts +0 -19
- package/es/schema-initializer/buttons/GridCardActionInitializers.d.ts +195 -0
- package/es/schema-initializer/buttons/GridCardActionInitializers.js +278 -0
- package/es/schema-initializer/buttons/ListActionInitializers.d.ts +195 -0
- package/es/schema-initializer/buttons/ListActionInitializers.js +278 -0
- package/es/schema-initializer/buttons/TableActionColumnInitializers.js +1 -1
- package/es/schema-initializer/buttons/TableActionInitializers.d.ts +0 -20
- package/es/schema-initializer/buttons/TableActionInitializers.js +29 -35
- package/es/schema-initializer/buttons/TableColumnInitializers.js +4 -1
- package/es/schema-initializer/buttons/index.d.ts +3 -0
- package/es/schema-initializer/buttons/index.js +3 -0
- package/es/schema-initializer/components/BulkEditField.js +7 -5
- package/es/schema-initializer/components/CreateRecordAction.d.ts +1 -0
- package/es/schema-initializer/components/CreateRecordAction.js +51 -30
- package/es/schema-initializer/components/DeletedField.d.ts +1 -0
- package/es/schema-initializer/components/DeletedField.js +11 -0
- package/es/schema-initializer/components/assigned-field/AssignedField.js +35 -23
- package/es/schema-initializer/items/GridCardBlockInitializer.d.ts +1 -0
- package/es/schema-initializer/items/GridCardBlockInitializer.js +47 -0
- package/es/schema-initializer/items/ListBlockInitializer.d.ts +1 -0
- package/es/schema-initializer/items/ListBlockInitializer.js +47 -0
- package/es/schema-initializer/items/index.d.ts +3 -1
- package/es/schema-initializer/items/index.js +4 -2
- package/es/schema-initializer/utils.d.ts +112 -0
- package/es/schema-initializer/utils.js +206 -32
- package/es/schema-items/GeneralSchemaItems.d.ts +4 -0
- package/es/schema-items/GeneralSchemaItems.js +148 -0
- package/es/schema-items/index.d.ts +1 -0
- package/es/schema-items/index.js +2 -1
- package/es/schema-settings/DataTemplates/FormDataTemplates.d.ts +1 -0
- package/es/schema-settings/DataTemplates/FormDataTemplates.js +117 -42
- package/es/schema-settings/DataTemplates/components/AsDefaultTemplate.js +1 -1
- package/es/schema-settings/DataTemplates/components/DataTemplateTitle.js +9 -13
- package/es/schema-settings/DataTemplates/components/Designer.d.ts +7 -0
- package/es/schema-settings/DataTemplates/components/Designer.js +179 -0
- package/es/schema-settings/DataTemplates/hooks/useCollectionState.d.ts +6 -1
- package/es/schema-settings/DataTemplates/hooks/useCollectionState.js +204 -96
- package/es/schema-settings/GeneralSchemaDesigner.js +19 -15
- package/es/schema-settings/SchemaSettings.d.ts +1 -1
- package/es/schema-settings/SchemaSettings.js +54 -30
- package/es/schema-settings/VariableInput/hooks/useUserVariable.js +1 -1
- package/es/schema-settings/hooks/useIsShowMultipleSwitch.d.ts +4 -0
- package/es/schema-settings/hooks/useIsShowMultipleSwitch.js +18 -0
- package/es/schema-templates/BlockTemplateDetails.js +1 -1
- package/es/settings-form/SettingsForm.js +2 -2
- package/es/user/CurrentUser.js +120 -12
- package/lib/acl/ACLProvider.js +2 -2
- package/lib/acl/Configuration/RoleConfigure.js +15 -8
- package/lib/api-client/APIClient.d.ts +2 -0
- package/lib/api-client/APIClient.js +11 -0
- package/lib/block-provider/BlockProvider.js +57 -16
- package/lib/block-provider/hooks/index.js +80 -59
- package/lib/collection-manager/CollectionField.js +3 -3
- package/lib/collection-manager/CollectionFieldProvider.js +2 -1
- package/lib/collection-manager/Configuration/AddFieldAction.js +2 -2
- package/lib/collection-manager/Configuration/CollectionFields.d.ts +1 -1
- package/lib/collection-manager/Configuration/CollectionFields.js +1 -3
- package/lib/collection-manager/Configuration/ConfigurationTabs.js +7 -6
- package/lib/collection-manager/hooks/useCollection.d.ts +1 -1
- package/lib/collection-manager/hooks/useCollectionDataSource.js +4 -4
- package/lib/collection-manager/interfaces/m2m.js +1 -1
- package/lib/collection-manager/interfaces/m2o.js +1 -1
- package/lib/collection-manager/interfaces/o2m.js +1 -1
- package/lib/collection-manager/interfaces/o2o.js +2 -2
- package/lib/collection-manager/templates/expression.js +1 -1
- package/lib/filter-provider/utils.js +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.js +11 -0
- package/lib/locale/en_US.d.ts +16 -1
- package/lib/locale/en_US.js +17 -2
- package/lib/locale/es_ES.d.ts +692 -0
- package/lib/locale/es_ES.js +698 -0
- package/lib/locale/ja_JP.d.ts +5 -1
- package/lib/locale/ja_JP.js +6 -2
- package/lib/locale/pt_BR.d.ts +5 -1
- package/lib/locale/pt_BR.js +6 -2
- package/lib/locale/ru_RU.d.ts +5 -1
- package/lib/locale/ru_RU.js +6 -2
- package/lib/locale/tr_TR.d.ts +5 -1
- package/lib/locale/tr_TR.js +6 -2
- package/lib/locale/zh_CN.d.ts +25 -2
- package/lib/locale/zh_CN.js +26 -3
- package/lib/pm/PluginManagerLink.js +21 -13
- package/lib/record-provider/index.d.ts +4 -0
- package/lib/record-provider/index.js +5 -1
- package/lib/schema-component/antd/action/Action.Designer.js +6 -3
- package/lib/schema-component/antd/action/Action.Drawer.js +5 -2
- package/lib/schema-component/antd/action/Action.js +2 -2
- package/lib/schema-component/antd/action/ActionBar.js +23 -16
- package/lib/schema-component/antd/association-field/AssociationFieldProvider.d.ts +2 -2
- package/lib/schema-component/antd/association-field/AssociationFieldProvider.js +62 -8
- package/lib/schema-component/antd/association-field/AssociationSelect.js +9 -66
- package/lib/schema-component/antd/association-field/Editable.d.ts +1 -1
- package/lib/schema-component/antd/association-field/Editable.js +33 -42
- package/lib/schema-component/antd/association-field/InternalNester.js +2 -2
- package/lib/schema-component/antd/association-field/InternalPicker.js +25 -56
- package/lib/schema-component/antd/association-field/InternalViewer.js +7 -10
- package/lib/schema-component/antd/association-field/Nester.js +19 -21
- package/lib/schema-component/antd/association-field/ReadPretty.d.ts +1 -1
- package/lib/schema-component/antd/association-field/ReadPretty.js +10 -27
- package/lib/schema-component/antd/association-field/components/CreateRecordAction.d.ts +2 -0
- package/lib/schema-component/antd/association-field/components/CreateRecordAction.js +71 -0
- package/lib/schema-component/antd/association-field/context.d.ts +5 -2
- package/lib/schema-component/antd/association-field/context.js +1 -1
- package/lib/schema-component/antd/association-field/hooks.d.ts +3 -0
- package/lib/schema-component/antd/association-field/hooks.js +10 -10
- package/lib/schema-component/antd/association-filter/AssociationFilter.Item.js +3 -3
- package/lib/schema-component/antd/association-select/AssociationSelect.js +49 -231
- package/lib/schema-component/antd/association-select/useServiceOptions.js +2 -2
- package/lib/schema-component/antd/collection-select/CollectionSelect.js +5 -0
- package/lib/schema-component/antd/filter/FilterAction.js +2 -2
- package/lib/schema-component/antd/form/Form.js +4 -4
- package/lib/schema-component/antd/form-item/FormItem.js +122 -141
- package/lib/schema-component/antd/form-item/SchemaSettingOptions.js +3 -3
- package/lib/schema-component/antd/form-v2/Form.Designer.js +1 -0
- package/lib/schema-component/antd/form-v2/Templates.d.ts +20 -0
- package/lib/schema-component/antd/form-v2/Templates.js +41 -11
- package/lib/schema-component/antd/grid/Grid.js +33 -23
- package/lib/schema-component/antd/grid-card/GridCard.Decorator.d.ts +5 -0
- package/lib/schema-component/antd/grid-card/GridCard.Decorator.js +77 -0
- package/lib/schema-component/antd/grid-card/GridCard.Designer.d.ts +1 -0
- package/lib/schema-component/antd/grid-card/GridCard.Designer.js +253 -0
- package/lib/schema-component/antd/grid-card/GridCard.Item.d.ts +1 -0
- package/lib/schema-component/antd/grid-card/GridCard.Item.js +26 -0
- package/lib/schema-component/antd/grid-card/GridCard.d.ts +8 -0
- package/lib/schema-component/antd/grid-card/GridCard.js +112 -0
- package/lib/schema-component/antd/grid-card/hooks.d.ts +4 -0
- package/lib/schema-component/antd/grid-card/hooks.js +16 -0
- package/lib/schema-component/antd/grid-card/index.d.ts +1 -0
- package/lib/schema-component/antd/grid-card/index.js +16 -0
- package/lib/schema-component/antd/grid-card/options.d.ts +20 -0
- package/lib/schema-component/antd/grid-card/options.js +31 -0
- package/lib/schema-component/antd/icon-picker/IconPicker.js +2 -2
- package/lib/schema-component/antd/index.d.ts +2 -0
- package/lib/schema-component/antd/index.js +22 -0
- package/lib/schema-component/antd/input/EllipsisWithTooltip.js +2 -2
- package/lib/schema-component/antd/list/List.Decorator.d.ts +5 -0
- package/lib/schema-component/antd/list/List.Decorator.js +71 -0
- package/lib/schema-component/antd/list/List.Designer.d.ts +1 -0
- package/lib/schema-component/antd/list/List.Designer.js +213 -0
- package/lib/schema-component/antd/list/List.Item.d.ts +1 -0
- package/lib/schema-component/antd/list/List.Item.js +23 -0
- package/lib/schema-component/antd/list/List.d.ts +8 -0
- package/lib/schema-component/antd/list/List.js +92 -0
- package/lib/schema-component/antd/list/hooks.d.ts +4 -0
- package/lib/schema-component/antd/list/hooks.js +16 -0
- package/lib/schema-component/antd/list/index.d.ts +1 -0
- package/lib/schema-component/antd/list/index.js +16 -0
- package/lib/schema-component/antd/remote-select/RemoteSelect.js +11 -9
- package/lib/schema-component/antd/select/Select.js +14 -3
- package/lib/schema-component/antd/table/Table.Void.Designer.js +1 -0
- package/lib/schema-component/antd/table-v2/TableBlockDesigner.js +2 -1
- package/lib/schema-component/antd/table-v2/TableSelectorDesigner.js +1 -0
- package/lib/schema-component/antd/table-v2/hooks/useUserVariable.d.ts +22 -0
- package/lib/schema-component/antd/table-v2/hooks/useUserVariable.js +73 -0
- package/lib/schema-component/antd/variable/Input.js +6 -3
- package/lib/schema-component/common/dnd-context/index.js +2 -2
- package/lib/schema-component/common/sortable-item/SortableItem.js +3 -4
- package/lib/schema-component/core/SchemaComponentProvider.js +2 -2
- package/lib/schema-initializer/SchemaInitializerProvider.d.ts +1 -0
- package/lib/schema-initializer/SchemaInitializerProvider.js +22 -9
- package/lib/schema-initializer/buttons/BlockInitializers.js +10 -0
- package/lib/schema-initializer/buttons/CustomFormItemInitializers.js +4 -2
- package/lib/schema-initializer/buttons/FormActionInitializers.d.ts +0 -116
- package/lib/schema-initializer/buttons/FormActionInitializers.js +106 -100
- package/lib/schema-initializer/buttons/GanttActionInitializers.d.ts +0 -19
- package/lib/schema-initializer/buttons/GridCardActionInitializers.d.ts +195 -0
- package/lib/schema-initializer/buttons/GridCardActionInitializers.js +285 -0
- package/lib/schema-initializer/buttons/ListActionInitializers.d.ts +195 -0
- package/lib/schema-initializer/buttons/ListActionInitializers.js +285 -0
- package/lib/schema-initializer/buttons/TableActionColumnInitializers.js +1 -1
- package/lib/schema-initializer/buttons/TableActionInitializers.d.ts +0 -20
- package/lib/schema-initializer/buttons/TableActionInitializers.js +29 -35
- package/lib/schema-initializer/buttons/TableColumnInitializers.js +4 -1
- package/lib/schema-initializer/buttons/index.d.ts +3 -0
- package/lib/schema-initializer/buttons/index.js +22 -0
- package/lib/schema-initializer/components/BulkEditField.js +7 -5
- package/lib/schema-initializer/components/CreateRecordAction.d.ts +1 -0
- package/lib/schema-initializer/components/CreateRecordAction.js +54 -32
- package/lib/schema-initializer/components/DeletedField.d.ts +1 -0
- package/lib/schema-initializer/components/DeletedField.js +19 -0
- package/lib/schema-initializer/components/assigned-field/AssignedField.js +34 -22
- package/lib/schema-initializer/items/GridCardBlockInitializer.d.ts +1 -0
- package/lib/schema-initializer/items/GridCardBlockInitializer.js +55 -0
- package/lib/schema-initializer/items/ListBlockInitializer.d.ts +1 -0
- package/lib/schema-initializer/items/ListBlockInitializer.js +55 -0
- package/lib/schema-initializer/items/index.d.ts +3 -1
- package/lib/schema-initializer/items/index.js +33 -11
- package/lib/schema-initializer/utils.d.ts +112 -0
- package/lib/schema-initializer/utils.js +209 -33
- package/lib/schema-items/GeneralSchemaItems.d.ts +4 -0
- package/lib/schema-items/GeneralSchemaItems.js +156 -0
- package/lib/schema-items/index.d.ts +1 -0
- package/lib/schema-items/index.js +11 -0
- package/lib/schema-settings/DataTemplates/FormDataTemplates.d.ts +1 -0
- package/lib/schema-settings/DataTemplates/FormDataTemplates.js +119 -41
- package/lib/schema-settings/DataTemplates/components/AsDefaultTemplate.js +1 -1
- package/lib/schema-settings/DataTemplates/components/DataTemplateTitle.js +10 -14
- package/lib/schema-settings/DataTemplates/components/Designer.d.ts +7 -0
- package/lib/schema-settings/DataTemplates/components/Designer.js +188 -0
- package/lib/schema-settings/DataTemplates/hooks/useCollectionState.d.ts +6 -1
- package/lib/schema-settings/DataTemplates/hooks/useCollectionState.js +204 -95
- package/lib/schema-settings/GeneralSchemaDesigner.js +21 -15
- package/lib/schema-settings/SchemaSettings.d.ts +1 -1
- package/lib/schema-settings/SchemaSettings.js +53 -29
- package/lib/schema-settings/VariableInput/hooks/useUserVariable.js +1 -1
- package/lib/schema-settings/hooks/useIsShowMultipleSwitch.d.ts +4 -0
- package/lib/schema-settings/hooks/useIsShowMultipleSwitch.js +24 -0
- package/lib/settings-form/SettingsForm.js +2 -2
- package/lib/user/CurrentUser.js +118 -10
- package/package.json +5 -5
- package/tsconfig.json +8 -0
|
@@ -7,13 +7,12 @@ exports.default = exports.RemoteSelect = void 0;
|
|
|
7
7
|
var _icons = require("@ant-design/icons");
|
|
8
8
|
var _react = require("@formily/react");
|
|
9
9
|
var _antd = require("antd");
|
|
10
|
-
var _moment = _interopRequireDefault(require("moment"));
|
|
11
10
|
var _lodash = require("lodash");
|
|
11
|
+
var _moment = _interopRequireDefault(require("moment"));
|
|
12
12
|
var _react2 = _interopRequireWildcard(require("react"));
|
|
13
13
|
var _apiClient = require("../../../api-client");
|
|
14
14
|
var _SharedFilterProvider = require("../../../block-provider/SharedFilterProvider");
|
|
15
15
|
var _collectionManager = require("../../../collection-manager");
|
|
16
|
-
var _hooks = require("../../hooks");
|
|
17
16
|
var _select = require("../select");
|
|
18
17
|
var _ReadPretty = require("./ReadPretty");
|
|
19
18
|
var _excluded = ["fieldNames", "service", "wait", "value", "objectValue", "manual", "mapOptions", "targetField"];
|
|
@@ -31,6 +30,7 @@ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _ty
|
|
|
31
30
|
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
32
31
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
33
32
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
33
|
+
var EMPTY = 'N/A';
|
|
34
34
|
var InternalRemoteSelect = (0, _react.connect)(function (props) {
|
|
35
35
|
var _field$componentProps, _field$componentProps2, _field$componentProps3, _service$params;
|
|
36
36
|
var _props$fieldNames = props.fieldNames,
|
|
@@ -46,7 +46,6 @@ var InternalRemoteSelect = (0, _react.connect)(function (props) {
|
|
|
46
46
|
mapOptions = props.mapOptions,
|
|
47
47
|
_targetField = props.targetField,
|
|
48
48
|
others = _objectWithoutProperties(props, _excluded);
|
|
49
|
-
var compile = (0, _hooks.useCompile)();
|
|
50
49
|
var firstRun = (0, _react2.useRef)(false);
|
|
51
50
|
var fieldSchema = (0, _react.useFieldSchema)();
|
|
52
51
|
var field = (0, _react.useField)();
|
|
@@ -84,7 +83,9 @@ var InternalRemoteSelect = (0, _react.connect)(function (props) {
|
|
|
84
83
|
}
|
|
85
84
|
}, (option === null || option === void 0 ? void 0 : option.label) || item);
|
|
86
85
|
} else {
|
|
87
|
-
return /*#__PURE__*/_react2.default.createElement(_antd.Tag,
|
|
86
|
+
return /*#__PURE__*/_react2.default.createElement(_antd.Tag, {
|
|
87
|
+
key: item
|
|
88
|
+
}, item);
|
|
88
89
|
}
|
|
89
90
|
}).reverse();
|
|
90
91
|
} else {
|
|
@@ -103,10 +104,10 @@ var InternalRemoteSelect = (0, _react.connect)(function (props) {
|
|
|
103
104
|
}
|
|
104
105
|
if (mapOptions) {
|
|
105
106
|
var _mapOptions;
|
|
106
|
-
return mapOptions((_mapOptions = {}, _defineProperty(_mapOptions, fieldNames.label, label), _defineProperty(_mapOptions, fieldNames.value, option[fieldNames.value]), _mapOptions));
|
|
107
|
+
return mapOptions((_mapOptions = {}, _defineProperty(_mapOptions, fieldNames.label, label || EMPTY), _defineProperty(_mapOptions, fieldNames.value, option[fieldNames.value]), _mapOptions));
|
|
107
108
|
}
|
|
108
|
-
return _objectSpread(_objectSpread({}, option), {}, (_objectSpread2 = {}, _defineProperty(_objectSpread2, fieldNames.label, label ||
|
|
109
|
-
});
|
|
109
|
+
return _objectSpread(_objectSpread({}, option), {}, (_objectSpread2 = {}, _defineProperty(_objectSpread2, fieldNames.label, label || EMPTY), _defineProperty(_objectSpread2, fieldNames.value, option[fieldNames.value]), _objectSpread2));
|
|
110
|
+
}).filter(Boolean);
|
|
110
111
|
} catch (err) {
|
|
111
112
|
console.error(err);
|
|
112
113
|
return options;
|
|
@@ -148,7 +149,7 @@ var InternalRemoteSelect = (0, _react.connect)(function (props) {
|
|
|
148
149
|
while (1) switch (_context.prev = _context.next) {
|
|
149
150
|
case 0:
|
|
150
151
|
run({
|
|
151
|
-
filter: (0, _SharedFilterProvider.mergeFilter)([_defineProperty({}, fieldNames.label, _defineProperty({}, operator, search)), ((_field$componentProps4 = field.componentProps) === null || _field$componentProps4 === void 0 ? void 0 : (_field$componentProps5 = _field$componentProps4.service) === null || _field$componentProps5 === void 0 ? void 0 : (_field$componentProps6 = _field$componentProps5.params) === null || _field$componentProps6 === void 0 ? void 0 : _field$componentProps6.filter) || (service === null || service === void 0 ? void 0 : (_service$params2 = service.params) === null || _service$params2 === void 0 ? void 0 : _service$params2.filter)])
|
|
152
|
+
filter: (0, _SharedFilterProvider.mergeFilter)([search ? _defineProperty({}, fieldNames.label, _defineProperty({}, operator, search)) : {}, ((_field$componentProps4 = field.componentProps) === null || _field$componentProps4 === void 0 ? void 0 : (_field$componentProps5 = _field$componentProps4.service) === null || _field$componentProps5 === void 0 ? void 0 : (_field$componentProps6 = _field$componentProps5.params) === null || _field$componentProps6 === void 0 ? void 0 : _field$componentProps6.filter) || (service === null || service === void 0 ? void 0 : (_service$params2 = service.params) === null || _service$params2 === void 0 ? void 0 : _service$params2.filter)])
|
|
152
153
|
});
|
|
153
154
|
case 1:
|
|
154
155
|
case "end":
|
|
@@ -188,6 +189,7 @@ var InternalRemoteSelect = (0, _react.connect)(function (props) {
|
|
|
188
189
|
firstRun.current = true;
|
|
189
190
|
};
|
|
190
191
|
return /*#__PURE__*/_react2.default.createElement(_select.Select, _objectSpread(_objectSpread({
|
|
192
|
+
dropdownMatchSelectWidth: false,
|
|
191
193
|
autoClearSearchValue: true,
|
|
192
194
|
filterOption: false,
|
|
193
195
|
filterSort: null,
|
|
@@ -197,7 +199,7 @@ var InternalRemoteSelect = (0, _react.connect)(function (props) {
|
|
|
197
199
|
objectValue: objectValue,
|
|
198
200
|
value: value
|
|
199
201
|
}, others), {}, {
|
|
200
|
-
loading: loading,
|
|
202
|
+
loading: data ? loading : true,
|
|
201
203
|
options: mapOptionsToTags(options)
|
|
202
204
|
}));
|
|
203
205
|
}, (0, _react.mapProps)({
|
|
@@ -11,8 +11,8 @@ var _antd = require("antd");
|
|
|
11
11
|
var _react2 = _interopRequireDefault(require("react"));
|
|
12
12
|
var _ReadPretty = require("./ReadPretty");
|
|
13
13
|
var _shared2 = require("./shared");
|
|
14
|
-
var _excluded = ["value", "options", "onChange", "fieldNames", "mode"],
|
|
15
|
-
_excluded2 = ["objectValue", "value"];
|
|
14
|
+
var _excluded = ["value", "options", "onChange", "fieldNames", "mode", "loading"],
|
|
15
|
+
_excluded2 = ["objectValue", "loading", "value"];
|
|
16
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
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; }
|
|
18
18
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
@@ -31,6 +31,7 @@ var ObjectSelect = function ObjectSelect(props) {
|
|
|
31
31
|
_onChange = props.onChange,
|
|
32
32
|
fieldNames = props.fieldNames,
|
|
33
33
|
mode = props.mode,
|
|
34
|
+
loading = props.loading,
|
|
34
35
|
others = _objectWithoutProperties(props, _excluded);
|
|
35
36
|
var toValue = function toValue(v) {
|
|
36
37
|
var _getCurrentOptions;
|
|
@@ -57,9 +58,13 @@ var ObjectSelect = function ObjectSelect(props) {
|
|
|
57
58
|
value: toValue(value),
|
|
58
59
|
allowClear: true,
|
|
59
60
|
labelInValue: true,
|
|
61
|
+
notFoundContent: loading ? /*#__PURE__*/_react2.default.createElement(_antd.Spin, null) : /*#__PURE__*/_react2.default.createElement(_antd.Empty, {
|
|
62
|
+
image: _antd.Empty.PRESENTED_IMAGE_SIMPLE
|
|
63
|
+
}),
|
|
60
64
|
options: options,
|
|
61
65
|
fieldNames: fieldNames,
|
|
62
66
|
showSearch: true,
|
|
67
|
+
dropdownMatchSelectWidth: false,
|
|
63
68
|
filterOption: function filterOption(input, option) {
|
|
64
69
|
var _option;
|
|
65
70
|
return ((_option = option === null || option === void 0 ? void 0 : option[fieldNames.label || 'label']) !== null && _option !== void 0 ? _option : '').includes(input);
|
|
@@ -87,6 +92,7 @@ var filterOption = function filterOption(input, option) {
|
|
|
87
92
|
};
|
|
88
93
|
var InternalSelect = (0, _react.connect)(function (props) {
|
|
89
94
|
var objectValue = props.objectValue,
|
|
95
|
+
loading = props.loading,
|
|
90
96
|
value = props.value,
|
|
91
97
|
others = _objectWithoutProperties(props, _excluded2);
|
|
92
98
|
var mode = props.multiple ? 'multiple' : props.mode;
|
|
@@ -96,13 +102,18 @@ var InternalSelect = (0, _react.connect)(function (props) {
|
|
|
96
102
|
if (objectValue) {
|
|
97
103
|
return /*#__PURE__*/_react2.default.createElement(ObjectSelect, _objectSpread(_objectSpread({}, others), {}, {
|
|
98
104
|
value: value,
|
|
99
|
-
mode: mode
|
|
105
|
+
mode: mode,
|
|
106
|
+
loading: loading
|
|
100
107
|
}));
|
|
101
108
|
}
|
|
102
109
|
return /*#__PURE__*/_react2.default.createElement(_antd.Select, _objectSpread(_objectSpread({
|
|
103
110
|
showSearch: true,
|
|
104
111
|
filterOption: filterOption,
|
|
105
112
|
allowClear: true,
|
|
113
|
+
dropdownMatchSelectWidth: false,
|
|
114
|
+
notFoundContent: loading ? /*#__PURE__*/_react2.default.createElement(_antd.Spin, null) : /*#__PURE__*/_react2.default.createElement(_antd.Empty, {
|
|
115
|
+
image: _antd.Empty.PRESENTED_IMAGE_SIMPLE
|
|
116
|
+
}),
|
|
106
117
|
value: value
|
|
107
118
|
}, others), {}, {
|
|
108
119
|
onChange: function onChange(changed) {
|
|
@@ -55,7 +55,7 @@ var TableBlockDesigner = function TableBlockDesigner() {
|
|
|
55
55
|
var defaultResource = fieldSchema === null || fieldSchema === void 0 ? void 0 : (_fieldSchema$xDecora4 = fieldSchema['x-decorator-props']) === null || _fieldSchema$xDecora4 === void 0 ? void 0 : _fieldSchema$xDecora4.resource;
|
|
56
56
|
var supportTemplate = !(fieldSchema === null || fieldSchema === void 0 ? void 0 : (_fieldSchema$xDecora5 = fieldSchema['x-decorator-props']) === null || _fieldSchema$xDecora5 === void 0 ? void 0 : _fieldSchema$xDecora5.disableTemplate);
|
|
57
57
|
var sort = defaultSort === null || defaultSort === void 0 ? void 0 : defaultSort.map(function (item) {
|
|
58
|
-
return item.startsWith('-') ? {
|
|
58
|
+
return (item === null || item === void 0 ? void 0 : item.startsWith('-')) ? {
|
|
59
59
|
field: item.substring(1),
|
|
60
60
|
direction: 'desc'
|
|
61
61
|
} : {
|
|
@@ -170,6 +170,7 @@ var TableBlockDesigner = function TableBlockDesigner() {
|
|
|
170
170
|
field: {
|
|
171
171
|
type: 'string',
|
|
172
172
|
enum: sortFields,
|
|
173
|
+
required: true,
|
|
173
174
|
'x-decorator': 'FormItem',
|
|
174
175
|
'x-component': 'Select',
|
|
175
176
|
'x-component-props': {
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
interface Operator {
|
|
2
|
+
label: string;
|
|
3
|
+
value: string;
|
|
4
|
+
}
|
|
5
|
+
interface GetOptionsParams {
|
|
6
|
+
schema: any;
|
|
7
|
+
operator: Operator;
|
|
8
|
+
maxDepth: number;
|
|
9
|
+
count?: number;
|
|
10
|
+
}
|
|
11
|
+
export declare const useOptions: (collectionName: string, { schema, operator, maxDepth, count }: GetOptionsParams) => any;
|
|
12
|
+
export declare const useUserVariable: ({ schema, operator }: {
|
|
13
|
+
schema: any;
|
|
14
|
+
operator: any;
|
|
15
|
+
}) => {
|
|
16
|
+
label: string;
|
|
17
|
+
value: string;
|
|
18
|
+
key: string;
|
|
19
|
+
disabled: any;
|
|
20
|
+
children: any;
|
|
21
|
+
};
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useUserVariable = exports.useOptions = void 0;
|
|
7
|
+
var _filter = require("../../filter");
|
|
8
|
+
var isOperatorSupportMultiRelation = function isOperatorSupportMultiRelation(operator) {
|
|
9
|
+
if (!operator) return false;
|
|
10
|
+
return ['$eq', '$ne'].includes(operator.value);
|
|
11
|
+
};
|
|
12
|
+
var isSingleRelationField = function isSingleRelationField(field) {
|
|
13
|
+
if (!field) return false;
|
|
14
|
+
return field.type === 'belongsTo' || field.type === 'hasOne';
|
|
15
|
+
};
|
|
16
|
+
var useOptions = function useOptions(collectionName, _ref) {
|
|
17
|
+
var schema = _ref.schema,
|
|
18
|
+
operator = _ref.operator,
|
|
19
|
+
maxDepth = _ref.maxDepth,
|
|
20
|
+
_ref$count = _ref.count,
|
|
21
|
+
count = _ref$count === void 0 ? 1 : _ref$count;
|
|
22
|
+
if (count > maxDepth) {
|
|
23
|
+
return [];
|
|
24
|
+
}
|
|
25
|
+
var result = (0, _filter.useFilterOptions)(collectionName).map(function (option) {
|
|
26
|
+
if (!option.target) {
|
|
27
|
+
var _option$schema;
|
|
28
|
+
return {
|
|
29
|
+
key: option.name,
|
|
30
|
+
value: option.name,
|
|
31
|
+
label: option.title,
|
|
32
|
+
// TODO: 现在是通过组件的名称来过滤能够被选择的选项,这样的坏处是不够精确,后续可以优化
|
|
33
|
+
disabled: (schema === null || schema === void 0 ? void 0 : schema['x-component']) !== ((_option$schema = option.schema) === null || _option$schema === void 0 ? void 0 : _option$schema['x-component'])
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
var children = useOptions(option.target, {
|
|
37
|
+
schema: schema,
|
|
38
|
+
operator: operator,
|
|
39
|
+
maxDepth: maxDepth,
|
|
40
|
+
count: count + 1
|
|
41
|
+
}) || [];
|
|
42
|
+
return {
|
|
43
|
+
key: option.name,
|
|
44
|
+
value: option.name,
|
|
45
|
+
label: option.title,
|
|
46
|
+
children: children,
|
|
47
|
+
disabled: !isSingleRelationField(option) && !isOperatorSupportMultiRelation(operator) || children.every(function (child) {
|
|
48
|
+
return child.disabled;
|
|
49
|
+
})
|
|
50
|
+
};
|
|
51
|
+
});
|
|
52
|
+
return result;
|
|
53
|
+
};
|
|
54
|
+
exports.useOptions = useOptions;
|
|
55
|
+
var useUserVariable = function useUserVariable(_ref2) {
|
|
56
|
+
var schema = _ref2.schema,
|
|
57
|
+
operator = _ref2.operator;
|
|
58
|
+
var options = useOptions('users', {
|
|
59
|
+
schema: schema,
|
|
60
|
+
operator: operator,
|
|
61
|
+
maxDepth: 3
|
|
62
|
+
}) || [];
|
|
63
|
+
return {
|
|
64
|
+
label: "{{t(\"Current user\")}}",
|
|
65
|
+
value: '$user',
|
|
66
|
+
key: '$user',
|
|
67
|
+
disabled: options.every(function (option) {
|
|
68
|
+
return option.disabled;
|
|
69
|
+
}),
|
|
70
|
+
children: options
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
exports.useUserVariable = useUserVariable;
|
|
@@ -135,12 +135,15 @@ var ConstantTypes = {
|
|
|
135
135
|
default: null
|
|
136
136
|
}
|
|
137
137
|
};
|
|
138
|
-
function getTypedConstantOption(type) {
|
|
138
|
+
function getTypedConstantOption(type, types) {
|
|
139
139
|
var _ConstantTypes$type;
|
|
140
|
+
var allTypes = Object.values(ConstantTypes);
|
|
140
141
|
return {
|
|
141
142
|
value: '',
|
|
142
143
|
label: '{{t("Constant")}}',
|
|
143
|
-
children:
|
|
144
|
+
children: types ? allTypes.filter(function (item) {
|
|
145
|
+
return Array.isArray(types) && types.includes(item.value) || types === true;
|
|
146
|
+
}) : allTypes,
|
|
144
147
|
component: (_ConstantTypes$type = ConstantTypes[type]) === null || _ConstantTypes$type === void 0 ? void 0 : _ConstantTypes$type.component
|
|
145
148
|
};
|
|
146
149
|
}
|
|
@@ -165,7 +168,7 @@ function Input(props) {
|
|
|
165
168
|
var _ref5 = children ? {
|
|
166
169
|
value: '',
|
|
167
170
|
label: '{{t("Constant")}}'
|
|
168
|
-
} : useTypedConstant ? getTypedConstantOption(type) : {
|
|
171
|
+
} : useTypedConstant ? getTypedConstantOption(type, useTypedConstant) : {
|
|
169
172
|
value: '',
|
|
170
173
|
label: '{{t("Null")}}',
|
|
171
174
|
component: ConstantTypes.null.component
|
|
@@ -31,7 +31,7 @@ var useDragEnd = function useDragEnd(props) {
|
|
|
31
31
|
var _useTranslation = (0, _reactI18next.useTranslation)(),
|
|
32
32
|
t = _useTranslation.t;
|
|
33
33
|
return function (event) {
|
|
34
|
-
var _active$data, _active$data$current, _over$data, _over$data$current, _over$data2, _over$data2$current, _over$data3, _over$data3$current, _over$data4, _over$data4$current, _over$data5, _over$data5$current, _over$data$current$re;
|
|
34
|
+
var _active$data, _active$data$current, _over$data, _over$data$current, _over$data2, _over$data2$current, _over$data3, _over$data3$current, _over$data4, _over$data4$current, _over$data5, _over$data5$current, _over$data$current$re, _over$data6, _over$data6$current;
|
|
35
35
|
var active = event.active,
|
|
36
36
|
over = event.over;
|
|
37
37
|
var activeSchema = active === null || active === void 0 ? void 0 : (_active$data = active.data) === null || _active$data === void 0 ? void 0 : (_active$data$current = _active$data.current) === null || _active$data$current === void 0 ? void 0 : _active$data$current.schema;
|
|
@@ -40,7 +40,7 @@ var useDragEnd = function useDragEnd(props) {
|
|
|
40
40
|
var breakRemoveOn = over === null || over === void 0 ? void 0 : (_over$data3 = over.data) === null || _over$data3 === void 0 ? void 0 : (_over$data3$current = _over$data3.current) === null || _over$data3$current === void 0 ? void 0 : _over$data3$current.breakRemoveOn;
|
|
41
41
|
var wrapSchema = over === null || over === void 0 ? void 0 : (_over$data4 = over.data) === null || _over$data4 === void 0 ? void 0 : (_over$data4$current = _over$data4.current) === null || _over$data4$current === void 0 ? void 0 : _over$data4$current.wrapSchema;
|
|
42
42
|
var onSuccess = over === null || over === void 0 ? void 0 : (_over$data5 = over.data) === null || _over$data5 === void 0 ? void 0 : (_over$data5$current = _over$data5.current) === null || _over$data5$current === void 0 ? void 0 : _over$data5$current.onSuccess;
|
|
43
|
-
var removeParentsIfNoChildren = (_over$data$current$re = over.data.current.removeParentsIfNoChildren) !== null && _over$data$current$re !== void 0 ? _over$data$current$re : true;
|
|
43
|
+
var removeParentsIfNoChildren = (_over$data$current$re = over === null || over === void 0 ? void 0 : (_over$data6 = over.data) === null || _over$data6 === void 0 ? void 0 : (_over$data6$current = _over$data6.current) === null || _over$data6$current === void 0 ? void 0 : _over$data6$current.removeParentsIfNoChildren) !== null && _over$data$current$re !== void 0 ? _over$data$current$re : true;
|
|
44
44
|
if (!activeSchema || !overSchema) {
|
|
45
45
|
var _props$onDragEnd;
|
|
46
46
|
props === null || props === void 0 ? void 0 : (_props$onDragEnd = props.onDragEnd) === null || _props$onDragEnd === void 0 ? void 0 : _props$onDragEnd.call(props, event);
|
|
@@ -9,7 +9,7 @@ var _core = require("@dnd-kit/core");
|
|
|
9
9
|
var _react = require("@formily/react");
|
|
10
10
|
var _react2 = _interopRequireWildcard(require("react"));
|
|
11
11
|
var _excluded = ["component", "style", "children", "openMode"],
|
|
12
|
-
_excluded2 = ["schema", "id"];
|
|
12
|
+
_excluded2 = ["schema", "id", "removeParentsIfNoChildren"];
|
|
13
13
|
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); }
|
|
14
14
|
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; }
|
|
15
15
|
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; }
|
|
@@ -84,18 +84,17 @@ var useSortableItemId = function useSortableItemId(props) {
|
|
|
84
84
|
return field.address.toString();
|
|
85
85
|
};
|
|
86
86
|
var SortableItem = (0, _react.observer)(function (props) {
|
|
87
|
-
var _others$removeParents;
|
|
88
87
|
var _useSortableItemProps = useSortableItemProps(props),
|
|
89
88
|
schema = _useSortableItemProps.schema,
|
|
90
89
|
id = _useSortableItemProps.id,
|
|
90
|
+
removeParentsIfNoChildren = _useSortableItemProps.removeParentsIfNoChildren,
|
|
91
91
|
others = _objectWithoutProperties(_useSortableItemProps, _excluded2);
|
|
92
|
-
var removeParentsIfNoChildren = (_others$removeParents = others.removeParentsIfNoChildren) !== null && _others$removeParents !== void 0 ? _others$removeParents : true;
|
|
93
92
|
return /*#__PURE__*/_react2.default.createElement(SortableProvider, {
|
|
94
93
|
id: id,
|
|
95
94
|
data: {
|
|
96
95
|
insertAdjacent: 'afterEnd',
|
|
97
96
|
schema: schema,
|
|
98
|
-
removeParentsIfNoChildren: removeParentsIfNoChildren
|
|
97
|
+
removeParentsIfNoChildren: removeParentsIfNoChildren !== null && removeParentsIfNoChildren !== void 0 ? removeParentsIfNoChildren : true
|
|
99
98
|
}
|
|
100
99
|
}, /*#__PURE__*/_react2.default.createElement(Sortable, _objectSpread({}, others), props.children));
|
|
101
100
|
});
|
|
@@ -58,8 +58,8 @@ var SchemaComponentProvider = function SchemaComponentProvider(props) {
|
|
|
58
58
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
59
59
|
formId = _useState4[0],
|
|
60
60
|
setFormId = _useState4[1];
|
|
61
|
-
var form =
|
|
62
|
-
return (0, _core.createForm)();
|
|
61
|
+
var form = (0, _react2.useMemo)(function () {
|
|
62
|
+
return props.form || (0, _core.createForm)();
|
|
63
63
|
}, [formId]);
|
|
64
64
|
var _useTranslation = (0, _reactI18next.useTranslation)(),
|
|
65
65
|
t = _useTranslation.t;
|
|
@@ -6,6 +6,7 @@ export interface SchemaInitializerProviderProps {
|
|
|
6
6
|
}
|
|
7
7
|
export declare const useSchemaInitializer: (name: string, props?: {}) => {
|
|
8
8
|
exists: boolean;
|
|
9
|
+
InitializerComponent: (p: any) => JSX.Element;
|
|
9
10
|
render: (props?: any) => React.CElement<any, React.Component<any, any, any>>;
|
|
10
11
|
};
|
|
11
12
|
export declare const SchemaInitializerPluginContext: React.Context<any>;
|
|
@@ -31,19 +31,30 @@ var useSchemaInitializer = function useSchemaInitializer(name) {
|
|
|
31
31
|
var _render = function render(component, props) {
|
|
32
32
|
return component && /*#__PURE__*/_react2.default.createElement(component, props);
|
|
33
33
|
};
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
exists: false,
|
|
37
|
-
render: function render(props) {
|
|
38
|
-
return _render(null);
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
var initializer = (0, _get.default)(initializers, name || (fieldSchema === null || fieldSchema === void 0 ? void 0 : fieldSchema['x-initializer']));
|
|
34
|
+
var initializerPropsRef = (0, _react2.useRef)({});
|
|
35
|
+
var initializer = name ? (0, _get.default)(initializers, name || (fieldSchema === null || fieldSchema === void 0 ? void 0 : fieldSchema['x-initializer'])) : null;
|
|
43
36
|
var initializerProps = _objectSpread(_objectSpread({}, props), fieldSchema === null || fieldSchema === void 0 ? void 0 : fieldSchema['x-initializer-props']);
|
|
37
|
+
initializerPropsRef.current = initializerProps;
|
|
38
|
+
var InitializerComponent = (0, _react2.useMemo)(function () {
|
|
39
|
+
var C = _react2.default.Fragment;
|
|
40
|
+
if (!initializer) {
|
|
41
|
+
return C;
|
|
42
|
+
} else if ((0, _shared.isPlainObj)(initializer)) {
|
|
43
|
+
C = initializer.component || _SchemaInitializer.SchemaInitializer.Button;
|
|
44
|
+
return function (p) {
|
|
45
|
+
return /*#__PURE__*/_react2.default.createElement(C, _objectSpread(_objectSpread(_objectSpread({}, initializer), initializerPropsRef.current), p));
|
|
46
|
+
};
|
|
47
|
+
} else {
|
|
48
|
+
C = initializer;
|
|
49
|
+
return function (p) {
|
|
50
|
+
return /*#__PURE__*/_react2.default.createElement(C, _objectSpread(_objectSpread({}, initializerPropsRef.current), p));
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
}, [initializer]);
|
|
44
54
|
if (!initializer) {
|
|
45
55
|
return {
|
|
46
56
|
exists: false,
|
|
57
|
+
InitializerComponent: InitializerComponent,
|
|
47
58
|
render: function render(props) {
|
|
48
59
|
return _render(null);
|
|
49
60
|
}
|
|
@@ -52,6 +63,7 @@ var useSchemaInitializer = function useSchemaInitializer(name) {
|
|
|
52
63
|
if ((0, _shared.isPlainObj)(initializer)) {
|
|
53
64
|
return {
|
|
54
65
|
exists: true,
|
|
66
|
+
InitializerComponent: InitializerComponent,
|
|
55
67
|
render: function render(props) {
|
|
56
68
|
var component = initializer.component || _SchemaInitializer.SchemaInitializer.Button;
|
|
57
69
|
return _render(component, _objectSpread(_objectSpread(_objectSpread({}, initializer), initializerProps), props));
|
|
@@ -60,6 +72,7 @@ var useSchemaInitializer = function useSchemaInitializer(name) {
|
|
|
60
72
|
}
|
|
61
73
|
return {
|
|
62
74
|
exists: true,
|
|
75
|
+
InitializerComponent: InitializerComponent,
|
|
63
76
|
render: function render(props) {
|
|
64
77
|
return _render(initializer, _objectSpread(_objectSpread({}, initializerProps), props));
|
|
65
78
|
}
|
|
@@ -29,6 +29,16 @@ var BlockInitializers = {
|
|
|
29
29
|
type: 'item',
|
|
30
30
|
title: '{{t("Details")}}',
|
|
31
31
|
component: 'DetailsBlockInitializer'
|
|
32
|
+
}, {
|
|
33
|
+
key: 'List',
|
|
34
|
+
type: 'item',
|
|
35
|
+
title: '{{t("List")}}',
|
|
36
|
+
component: 'ListBlockInitializer'
|
|
37
|
+
}, {
|
|
38
|
+
key: 'GridCard',
|
|
39
|
+
type: 'item',
|
|
40
|
+
title: '{{t("Grid Card")}}',
|
|
41
|
+
component: 'GridCardBlockInitializer'
|
|
32
42
|
}, {
|
|
33
43
|
key: 'calendar',
|
|
34
44
|
type: 'item',
|
|
@@ -6,9 +6,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.CustomFormItemInitializers = void 0;
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _reactI18next = require("react-i18next");
|
|
9
|
+
var _schemaComponent = require("../../schema-component");
|
|
9
10
|
var _SchemaInitializer = require("../SchemaInitializer");
|
|
10
11
|
var _utils = require("../utils");
|
|
11
|
-
var _schemaComponent = require("../../schema-component");
|
|
12
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
13
|
// 表单里配置字段
|
|
14
14
|
var CustomFormItemInitializers = function CustomFormItemInitializers(props) {
|
|
@@ -17,7 +17,9 @@ var CustomFormItemInitializers = function CustomFormItemInitializers(props) {
|
|
|
17
17
|
var compile = (0, _schemaComponent.useCompile)();
|
|
18
18
|
var insertPosition = props.insertPosition,
|
|
19
19
|
component = props.component;
|
|
20
|
-
var inheritFields = (0, _utils.useInheritsFormItemInitializerFields)(
|
|
20
|
+
var inheritFields = (0, _utils.useInheritsFormItemInitializerFields)({
|
|
21
|
+
component: 'AssignedField'
|
|
22
|
+
});
|
|
21
23
|
var fieldItems = [{
|
|
22
24
|
type: 'itemGroup',
|
|
23
25
|
title: t('Configure fields'),
|
|
@@ -20,58 +20,6 @@ export declare const FormActionInitializers: {
|
|
|
20
20
|
type: string;
|
|
21
21
|
title: string;
|
|
22
22
|
children: ({
|
|
23
|
-
type: string;
|
|
24
|
-
title: string;
|
|
25
|
-
component: string;
|
|
26
|
-
schema: {
|
|
27
|
-
type: string;
|
|
28
|
-
title: string;
|
|
29
|
-
'x-action': string;
|
|
30
|
-
'x-designer': string;
|
|
31
|
-
'x-component': string;
|
|
32
|
-
'x-component-props': {
|
|
33
|
-
openMode: string;
|
|
34
|
-
useProps?: undefined;
|
|
35
|
-
};
|
|
36
|
-
properties: {
|
|
37
|
-
drawer: {
|
|
38
|
-
type: string;
|
|
39
|
-
title: string;
|
|
40
|
-
'x-component': string;
|
|
41
|
-
'x-component-props': {
|
|
42
|
-
className: string;
|
|
43
|
-
};
|
|
44
|
-
properties: {
|
|
45
|
-
tabs: {
|
|
46
|
-
type: string;
|
|
47
|
-
'x-component': string;
|
|
48
|
-
'x-component-props': {};
|
|
49
|
-
'x-initializer': string;
|
|
50
|
-
properties: {
|
|
51
|
-
tab1: {
|
|
52
|
-
type: string;
|
|
53
|
-
title: string;
|
|
54
|
-
'x-component': string;
|
|
55
|
-
'x-designer': string;
|
|
56
|
-
'x-component-props': {};
|
|
57
|
-
properties: {
|
|
58
|
-
grid: {
|
|
59
|
-
type: string;
|
|
60
|
-
'x-component': string;
|
|
61
|
-
'x-initializer': string;
|
|
62
|
-
properties: {};
|
|
63
|
-
};
|
|
64
|
-
};
|
|
65
|
-
};
|
|
66
|
-
};
|
|
67
|
-
};
|
|
68
|
-
};
|
|
69
|
-
};
|
|
70
|
-
};
|
|
71
|
-
'x-designer-props'?: undefined;
|
|
72
|
-
'x-action-settings'?: undefined;
|
|
73
|
-
};
|
|
74
|
-
} | {
|
|
75
23
|
type: string;
|
|
76
24
|
title: string;
|
|
77
25
|
component: string;
|
|
@@ -95,10 +43,7 @@ export declare const FormActionInitializers: {
|
|
|
95
43
|
};
|
|
96
44
|
'x-component-props': {
|
|
97
45
|
useProps: string;
|
|
98
|
-
openMode?: undefined;
|
|
99
46
|
};
|
|
100
|
-
type?: undefined;
|
|
101
|
-
properties?: undefined;
|
|
102
47
|
};
|
|
103
48
|
} | {
|
|
104
49
|
type: string;
|
|
@@ -121,10 +66,7 @@ export declare const FormActionInitializers: {
|
|
|
121
66
|
};
|
|
122
67
|
'x-component-props': {
|
|
123
68
|
useProps: string;
|
|
124
|
-
openMode?: undefined;
|
|
125
69
|
};
|
|
126
|
-
type?: undefined;
|
|
127
|
-
properties?: undefined;
|
|
128
70
|
'x-designer-props'?: undefined;
|
|
129
71
|
};
|
|
130
72
|
})[];
|
|
@@ -152,58 +94,6 @@ export declare const CreateFormActionInitializers: {
|
|
|
152
94
|
type: string;
|
|
153
95
|
title: string;
|
|
154
96
|
children: ({
|
|
155
|
-
type: string;
|
|
156
|
-
title: string;
|
|
157
|
-
component: string;
|
|
158
|
-
schema: {
|
|
159
|
-
type: string;
|
|
160
|
-
title: string;
|
|
161
|
-
'x-action': string;
|
|
162
|
-
'x-designer': string;
|
|
163
|
-
'x-component': string;
|
|
164
|
-
'x-component-props': {
|
|
165
|
-
openMode: string;
|
|
166
|
-
useProps?: undefined;
|
|
167
|
-
};
|
|
168
|
-
properties: {
|
|
169
|
-
drawer: {
|
|
170
|
-
type: string;
|
|
171
|
-
title: string;
|
|
172
|
-
'x-component': string;
|
|
173
|
-
'x-component-props': {
|
|
174
|
-
className: string;
|
|
175
|
-
};
|
|
176
|
-
properties: {
|
|
177
|
-
tabs: {
|
|
178
|
-
type: string;
|
|
179
|
-
'x-component': string;
|
|
180
|
-
'x-component-props': {};
|
|
181
|
-
'x-initializer': string;
|
|
182
|
-
properties: {
|
|
183
|
-
tab1: {
|
|
184
|
-
type: string;
|
|
185
|
-
title: string;
|
|
186
|
-
'x-component': string;
|
|
187
|
-
'x-designer': string;
|
|
188
|
-
'x-component-props': {};
|
|
189
|
-
properties: {
|
|
190
|
-
grid: {
|
|
191
|
-
type: string;
|
|
192
|
-
'x-component': string;
|
|
193
|
-
'x-initializer': string;
|
|
194
|
-
properties: {};
|
|
195
|
-
};
|
|
196
|
-
};
|
|
197
|
-
};
|
|
198
|
-
};
|
|
199
|
-
};
|
|
200
|
-
};
|
|
201
|
-
};
|
|
202
|
-
};
|
|
203
|
-
'x-designer-props'?: undefined;
|
|
204
|
-
'x-action-settings'?: undefined;
|
|
205
|
-
};
|
|
206
|
-
} | {
|
|
207
97
|
type: string;
|
|
208
98
|
title: string;
|
|
209
99
|
component: string;
|
|
@@ -227,10 +117,7 @@ export declare const CreateFormActionInitializers: {
|
|
|
227
117
|
};
|
|
228
118
|
'x-component-props': {
|
|
229
119
|
useProps: string;
|
|
230
|
-
openMode?: undefined;
|
|
231
120
|
};
|
|
232
|
-
type?: undefined;
|
|
233
|
-
properties?: undefined;
|
|
234
121
|
};
|
|
235
122
|
} | {
|
|
236
123
|
type: string;
|
|
@@ -253,10 +140,7 @@ export declare const CreateFormActionInitializers: {
|
|
|
253
140
|
};
|
|
254
141
|
'x-component-props': {
|
|
255
142
|
useProps: string;
|
|
256
|
-
openMode?: undefined;
|
|
257
143
|
};
|
|
258
|
-
type?: undefined;
|
|
259
|
-
properties?: undefined;
|
|
260
144
|
'x-designer-props'?: undefined;
|
|
261
145
|
};
|
|
262
146
|
})[];
|