@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
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
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); }
|
|
2
|
-
var _templateObject, _templateObject2;
|
|
2
|
+
var _templateObject, _templateObject2, _templateObject3;
|
|
3
3
|
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
4
4
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
5
5
|
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; }
|
|
@@ -9,27 +9,30 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
|
|
|
9
9
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
10
10
|
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); }
|
|
11
11
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
12
|
-
import { css } from '@emotion/css';
|
|
13
|
-
import { ArrayCollapse, FormLayout, FormItem as Item
|
|
12
|
+
import { css, cx } from '@emotion/css';
|
|
13
|
+
import { ArrayCollapse, ArrayItems, FormLayout, FormItem as Item } from '@formily/antd';
|
|
14
14
|
import { observer, useField, useFieldSchema } from '@formily/react';
|
|
15
15
|
import { uid } from '@formily/shared';
|
|
16
|
+
import { Select } from 'antd';
|
|
16
17
|
import _ from 'lodash';
|
|
17
18
|
import moment from 'moment';
|
|
18
19
|
import React, { useContext, useEffect } from 'react';
|
|
19
20
|
import { useTranslation } from 'react-i18next';
|
|
20
21
|
import { ACLCollectionFieldProvider } from '../../../acl/ACLProvider';
|
|
21
|
-
import { BlockRequestContext,
|
|
22
|
-
import { useCollection, useCollectionManager, useSortFields
|
|
22
|
+
import { BlockRequestContext, useFormBlockContext } from '../../../block-provider';
|
|
23
|
+
import { useCollection, useCollectionFilterOptions, useCollectionManager, useSortFields } from '../../../collection-manager';
|
|
23
24
|
import { isTitleField } from '../../../collection-manager/Configuration/CollectionFields';
|
|
25
|
+
import { GeneralSchemaItems } from '../../../schema-items/GeneralSchemaItems';
|
|
24
26
|
import { GeneralSchemaDesigner, SchemaSettings, isPatternDisabled, isShowDefaultValue } from '../../../schema-settings';
|
|
25
27
|
import { VariableInput } from '../../../schema-settings/VariableInput/VariableInput';
|
|
26
|
-
import {
|
|
28
|
+
import { useIsShowMultipleSwitch } from '../../../schema-settings/hooks/useIsShowMultipleSwitch';
|
|
27
29
|
import { isVariable, parseVariables, useVariablesCtx } from '../../common/utils/uitls';
|
|
28
30
|
import { SchemaComponent } from '../../core';
|
|
29
|
-
import { removeNullCondition } from '../filter';
|
|
30
31
|
import { useCompile, useDesignable, useFieldModeOptions } from '../../hooks';
|
|
31
32
|
import { BlockItem } from '../block-item';
|
|
33
|
+
import { removeNullCondition } from '../filter';
|
|
32
34
|
import { HTMLEncode } from '../input/shared';
|
|
35
|
+
import { FilterDynamicComponent } from '../table-v2/FilterDynamicComponent';
|
|
33
36
|
import { isInvariable } from '../variable';
|
|
34
37
|
import { FilterFormDesigner } from './FormItem.FilterFormDesigner';
|
|
35
38
|
import { useEnsureOperatorsValid } from './SchemaSettingOptions';
|
|
@@ -62,10 +65,12 @@ export var FormItem = observer(function (props) {
|
|
|
62
65
|
}
|
|
63
66
|
}
|
|
64
67
|
}, []);
|
|
68
|
+
var _props$showTitle = props.showTitle,
|
|
69
|
+
showTitle = _props$showTitle === void 0 ? true : _props$showTitle;
|
|
65
70
|
return /*#__PURE__*/React.createElement(ACLCollectionFieldProvider, null, /*#__PURE__*/React.createElement(BlockItem, {
|
|
66
71
|
className: 'nb-form-item'
|
|
67
72
|
}, /*#__PURE__*/React.createElement(Item, _objectSpread(_objectSpread({
|
|
68
|
-
className:
|
|
73
|
+
className: cx(css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n & .ant-space {\n flex-wrap: wrap;\n }\n "]))), _defineProperty({}, css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n > .ant-formily-item-label {\n display: none;\n }\n "]))), showTitle === false))
|
|
69
74
|
}, props), {}, {
|
|
70
75
|
extra: typeof field.description === 'string' ? /*#__PURE__*/React.createElement("div", {
|
|
71
76
|
dangerouslySetInnerHTML: {
|
|
@@ -75,7 +80,7 @@ export var FormItem = observer(function (props) {
|
|
|
75
80
|
}))));
|
|
76
81
|
});
|
|
77
82
|
FormItem.Designer = function Designer() {
|
|
78
|
-
var _interfaceConfig$vali, _collectionField$uiSc, _getCollectionFields, _field$componentProps, _field$componentProps2, _field$componentProps3, _field$componentProps4, _field$componentProps5, _field$componentProps6, _field$componentProps7,
|
|
83
|
+
var _interfaceConfig$vali, _collectionField$uiSc, _getCollectionFields, _field$componentProps, _field$componentProps2, _field$componentProps3, _field$componentProps4, _field$componentProps5, _field$componentProps6, _field$componentProps7, _fieldSchema$xCompon, _fieldSchema$xCompon2, _fieldSchema$xCompon3, _fieldSchema$xCompon4, _fieldSchema$xCompon5, _fieldSchema$xCompon6, _fieldSchema$xCompon7, _fieldSchema$xCompon8, _fieldSchema$xCompon9, _fieldSchema$xCompon10, _field$componentProps8, _field$componentProps9;
|
|
79
84
|
var _useCollectionManager = useCollectionManager(),
|
|
80
85
|
getCollectionFields = _useCollectionManager.getCollectionFields,
|
|
81
86
|
getInterface = _useCollectionManager.getInterface,
|
|
@@ -83,7 +88,6 @@ FormItem.Designer = function Designer() {
|
|
|
83
88
|
getCollection = _useCollectionManager.getCollection;
|
|
84
89
|
var _useCollection = useCollection(),
|
|
85
90
|
getField = _useCollection.getField;
|
|
86
|
-
var tk = useFilterByTk();
|
|
87
91
|
var _useFormBlockContext = useFormBlockContext(),
|
|
88
92
|
form = _useFormBlockContext.form;
|
|
89
93
|
var field = useField();
|
|
@@ -96,6 +100,7 @@ FormItem.Designer = function Designer() {
|
|
|
96
100
|
insertAdjacent = _useDesignable.insertAdjacent;
|
|
97
101
|
var compile = useCompile();
|
|
98
102
|
var variablesCtx = useVariablesCtx();
|
|
103
|
+
var IsShowMultipleSwitch = useIsShowMultipleSwitch();
|
|
99
104
|
var collectionField = getField(fieldSchema['name']) || getCollectionJoinField(fieldSchema['x-collection-field']);
|
|
100
105
|
var targetCollection = getCollection(collectionField === null || collectionField === void 0 ? void 0 : collectionField.target);
|
|
101
106
|
var interfaceConfig = getInterface(collectionField === null || collectionField === void 0 ? void 0 : collectionField.interface);
|
|
@@ -135,7 +140,7 @@ FormItem.Designer = function Designer() {
|
|
|
135
140
|
var fieldMode = (field === null || field === void 0 ? void 0 : (_field$componentProps7 = field.componentProps) === null || _field$componentProps7 === void 0 ? void 0 : _field$componentProps7['mode']) || (isFileField ? 'FileManager' : 'Select');
|
|
136
141
|
var isSelectFieldMode = fieldMode === 'Select';
|
|
137
142
|
var sort = defaultSort === null || defaultSort === void 0 ? void 0 : defaultSort.map(function (item) {
|
|
138
|
-
return item.startsWith('-') ? {
|
|
143
|
+
return (item === null || item === void 0 ? void 0 : item.startsWith('-')) ? {
|
|
139
144
|
field: item.substring(1),
|
|
140
145
|
direction: 'desc'
|
|
141
146
|
} : {
|
|
@@ -143,111 +148,15 @@ FormItem.Designer = function Designer() {
|
|
|
143
148
|
direction: 'asc'
|
|
144
149
|
};
|
|
145
150
|
});
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
properties: {
|
|
153
|
-
title: {
|
|
154
|
-
title: t('Field title'),
|
|
155
|
-
default: field === null || field === void 0 ? void 0 : field.title,
|
|
156
|
-
description: "".concat(t('Original field title: ')).concat(collectionField === null || collectionField === void 0 ? void 0 : (_collectionField$uiSc2 = collectionField.uiSchema) === null || _collectionField$uiSc2 === void 0 ? void 0 : _collectionField$uiSc2.title),
|
|
157
|
-
'x-decorator': 'FormItem',
|
|
158
|
-
'x-component': 'Input',
|
|
159
|
-
'x-component-props': {}
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
},
|
|
163
|
-
onSubmit: function onSubmit(_ref) {
|
|
164
|
-
var title = _ref.title;
|
|
165
|
-
if (title) {
|
|
166
|
-
field.title = title;
|
|
167
|
-
fieldSchema.title = title;
|
|
168
|
-
dn.emit('patch', {
|
|
169
|
-
schema: {
|
|
170
|
-
'x-uid': fieldSchema['x-uid'],
|
|
171
|
-
title: fieldSchema.title
|
|
172
|
-
}
|
|
173
|
-
});
|
|
174
|
-
}
|
|
175
|
-
dn.refresh();
|
|
176
|
-
}
|
|
177
|
-
}), !field.readPretty && /*#__PURE__*/React.createElement(SchemaSettings.ModalItem, {
|
|
178
|
-
key: "edit-description",
|
|
179
|
-
title: t('Edit description'),
|
|
180
|
-
schema: {
|
|
181
|
-
type: 'object',
|
|
182
|
-
title: t('Edit description'),
|
|
183
|
-
properties: {
|
|
184
|
-
description: {
|
|
185
|
-
// title: t('Description'),
|
|
186
|
-
default: field === null || field === void 0 ? void 0 : field.description,
|
|
187
|
-
'x-decorator': 'FormItem',
|
|
188
|
-
'x-component': 'Input.TextArea',
|
|
189
|
-
'x-component-props': {}
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
},
|
|
193
|
-
onSubmit: function onSubmit(_ref2) {
|
|
194
|
-
var description = _ref2.description;
|
|
195
|
-
field.description = description;
|
|
196
|
-
fieldSchema.description = description;
|
|
197
|
-
dn.emit('patch', {
|
|
198
|
-
schema: {
|
|
199
|
-
'x-uid': fieldSchema['x-uid'],
|
|
200
|
-
description: fieldSchema.description
|
|
201
|
-
}
|
|
202
|
-
});
|
|
203
|
-
dn.refresh();
|
|
204
|
-
}
|
|
205
|
-
}), field.readPretty && /*#__PURE__*/React.createElement(SchemaSettings.ModalItem, {
|
|
206
|
-
key: "edit-tooltip",
|
|
207
|
-
title: t('Edit tooltip'),
|
|
208
|
-
schema: {
|
|
209
|
-
type: 'object',
|
|
210
|
-
title: t('Edit description'),
|
|
211
|
-
properties: {
|
|
212
|
-
tooltip: {
|
|
213
|
-
default: fieldSchema === null || fieldSchema === void 0 ? void 0 : (_fieldSchema$xDecora = fieldSchema['x-decorator-props']) === null || _fieldSchema$xDecora === void 0 ? void 0 : _fieldSchema$xDecora.tooltip,
|
|
214
|
-
'x-decorator': 'FormItem',
|
|
215
|
-
'x-component': 'Input.TextArea',
|
|
216
|
-
'x-component-props': {}
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
},
|
|
220
|
-
onSubmit: function onSubmit(_ref3) {
|
|
221
|
-
var tooltip = _ref3.tooltip;
|
|
222
|
-
field.decoratorProps.tooltip = tooltip;
|
|
223
|
-
fieldSchema['x-decorator-props'] = fieldSchema['x-decorator-props'] || {};
|
|
224
|
-
fieldSchema['x-decorator-props']['tooltip'] = tooltip;
|
|
225
|
-
dn.emit('patch', {
|
|
226
|
-
schema: {
|
|
227
|
-
'x-uid': fieldSchema['x-uid'],
|
|
228
|
-
'x-decorator-props': fieldSchema['x-decorator-props']
|
|
229
|
-
}
|
|
230
|
-
});
|
|
231
|
-
dn.refresh();
|
|
232
|
-
}
|
|
233
|
-
}), !field.readPretty && fieldSchema['x-component'] !== 'FormField' && /*#__PURE__*/React.createElement(SchemaSettings.SwitchItem, {
|
|
234
|
-
key: "required",
|
|
235
|
-
title: t('Required'),
|
|
236
|
-
checked: fieldSchema.required,
|
|
237
|
-
onChange: function onChange(required) {
|
|
238
|
-
var schema = _defineProperty({}, 'x-uid', fieldSchema['x-uid']);
|
|
239
|
-
field.required = required;
|
|
240
|
-
fieldSchema['required'] = required;
|
|
241
|
-
schema['required'] = required;
|
|
242
|
-
dn.emit('patch', {
|
|
243
|
-
schema: schema
|
|
244
|
-
});
|
|
245
|
-
refresh();
|
|
246
|
-
}
|
|
247
|
-
}), !(form === null || form === void 0 ? void 0 : form.readPretty) && isFileField ? /*#__PURE__*/React.createElement(SchemaSettings.SwitchItem, {
|
|
151
|
+
var fieldSchemaWithoutRequired = _.omit(fieldSchema, 'required');
|
|
152
|
+
var isSubFormMode = ((_fieldSchema$xCompon = fieldSchema['x-component-props']) === null || _fieldSchema$xCompon === void 0 ? void 0 : _fieldSchema$xCompon.mode) === 'Nester';
|
|
153
|
+
var isPickerMode = ((_fieldSchema$xCompon2 = fieldSchema['x-component-props']) === null || _fieldSchema$xCompon2 === void 0 ? void 0 : _fieldSchema$xCompon2.mode) === 'Picker';
|
|
154
|
+
var showFieldMode = isAssociationField && fieldModeOptions && !isTableField;
|
|
155
|
+
var showModeSelect = showFieldMode && isPickerMode;
|
|
156
|
+
return /*#__PURE__*/React.createElement(GeneralSchemaDesigner, null, /*#__PURE__*/React.createElement(GeneralSchemaItems, null), !(form === null || form === void 0 ? void 0 : form.readPretty) && isFileField ? /*#__PURE__*/React.createElement(SchemaSettings.SwitchItem, {
|
|
248
157
|
key: "quick-upload",
|
|
249
158
|
title: t('Quick upload'),
|
|
250
|
-
checked: ((_fieldSchema$
|
|
159
|
+
checked: ((_fieldSchema$xCompon3 = fieldSchema['x-component-props']) === null || _fieldSchema$xCompon3 === void 0 ? void 0 : _fieldSchema$xCompon3.quickUpload) !== false,
|
|
251
160
|
onChange: function onChange(value) {
|
|
252
161
|
var schema = _defineProperty({}, 'x-uid', fieldSchema['x-uid']);
|
|
253
162
|
field.componentProps.quickUpload = value;
|
|
@@ -262,7 +171,7 @@ FormItem.Designer = function Designer() {
|
|
|
262
171
|
}) : null, !(form === null || form === void 0 ? void 0 : form.readPretty) && isFileField ? /*#__PURE__*/React.createElement(SchemaSettings.SwitchItem, {
|
|
263
172
|
key: "select-file",
|
|
264
173
|
title: t('Select file'),
|
|
265
|
-
checked: ((_fieldSchema$
|
|
174
|
+
checked: ((_fieldSchema$xCompon4 = fieldSchema['x-component-props']) === null || _fieldSchema$xCompon4 === void 0 ? void 0 : _fieldSchema$xCompon4.selectFile) !== false,
|
|
266
175
|
onChange: function onChange(value) {
|
|
267
176
|
var schema = _defineProperty({}, 'x-uid', fieldSchema['x-uid']);
|
|
268
177
|
field.componentProps.selectFile = value;
|
|
@@ -362,7 +271,7 @@ FormItem.Designer = function Designer() {
|
|
|
362
271
|
}
|
|
363
272
|
},
|
|
364
273
|
onSubmit: function onSubmit(v) {
|
|
365
|
-
var _collectionField$
|
|
274
|
+
var _collectionField$uiSc2;
|
|
366
275
|
var rules = [];
|
|
367
276
|
var _iterator = _createForOfIteratorHelper(v.rules),
|
|
368
277
|
_step;
|
|
@@ -400,7 +309,7 @@ FormItem.Designer = function Designer() {
|
|
|
400
309
|
_iterator2.f();
|
|
401
310
|
}
|
|
402
311
|
}
|
|
403
|
-
var concatValidator = _.concat([], (collectionField === null || collectionField === void 0 ? void 0 : (_collectionField$
|
|
312
|
+
var concatValidator = _.concat([], (collectionField === null || collectionField === void 0 ? void 0 : (_collectionField$uiSc2 = collectionField.uiSchema) === null || _collectionField$uiSc2 === void 0 ? void 0 : _collectionField$uiSc2['x-validator']) || [], rules);
|
|
404
313
|
field.validator = concatValidator;
|
|
405
314
|
fieldSchema['x-validator'] = rules;
|
|
406
315
|
schema['x-validator'] = rules;
|
|
@@ -421,10 +330,10 @@ FormItem.Designer = function Designer() {
|
|
|
421
330
|
type: 'object',
|
|
422
331
|
title: t('Set default value'),
|
|
423
332
|
properties: {
|
|
424
|
-
default: isInvariable(interfaceConfig) ? _objectSpread(_objectSpread({},
|
|
333
|
+
default: isInvariable(interfaceConfig) ? _objectSpread(_objectSpread({}, fieldSchemaWithoutRequired || {}), {}, {
|
|
425
334
|
'x-decorator': 'FormItem',
|
|
426
335
|
'x-component-props': _objectSpread(_objectSpread({}, fieldSchema['x-component-props']), {}, {
|
|
427
|
-
component: (collectionField === null || collectionField === void 0 ? void 0 : collectionField.target) && collectionField.interface !== 'chinaRegion' ? 'AssociationSelect' : undefined,
|
|
336
|
+
component: (collectionField === null || collectionField === void 0 ? void 0 : collectionField.target) && (collectionField === null || collectionField === void 0 ? void 0 : collectionField.interface) !== 'chinaRegion' ? 'AssociationSelect' : undefined,
|
|
428
337
|
service: {
|
|
429
338
|
resource: collectionField === null || collectionField === void 0 ? void 0 : collectionField.target
|
|
430
339
|
},
|
|
@@ -438,7 +347,7 @@ FormItem.Designer = function Designer() {
|
|
|
438
347
|
default: getFieldDefaultValue(fieldSchema, collectionField),
|
|
439
348
|
'x-read-pretty': false,
|
|
440
349
|
'x-disabled': false
|
|
441
|
-
}) : _objectSpread(_objectSpread({},
|
|
350
|
+
}) : _objectSpread(_objectSpread({}, fieldSchemaWithoutRequired || {}), {}, {
|
|
442
351
|
'x-decorator': 'FormItem',
|
|
443
352
|
'x-component': 'VariableInput',
|
|
444
353
|
'x-component-props': _objectSpread(_objectSpread({}, (fieldSchema === null || fieldSchema === void 0 ? void 0 : fieldSchema['x-component-props']) || {}), {}, {
|
|
@@ -446,7 +355,7 @@ FormItem.Designer = function Designer() {
|
|
|
446
355
|
schema: collectionField === null || collectionField === void 0 ? void 0 : collectionField.uiSchema,
|
|
447
356
|
className: defaultInputStyle,
|
|
448
357
|
renderSchemaComponent: function Com(props) {
|
|
449
|
-
var s = _.cloneDeep(
|
|
358
|
+
var s = _.cloneDeep(fieldSchemaWithoutRequired) || {};
|
|
450
359
|
s.title = '';
|
|
451
360
|
s['x-read-pretty'] = false;
|
|
452
361
|
s['x-disabled'] = false;
|
|
@@ -502,15 +411,15 @@ FormItem.Designer = function Designer() {
|
|
|
502
411
|
}
|
|
503
412
|
}
|
|
504
413
|
},
|
|
505
|
-
onSubmit: function onSubmit(
|
|
506
|
-
var
|
|
507
|
-
var filter =
|
|
414
|
+
onSubmit: function onSubmit(_ref) {
|
|
415
|
+
var _schema5;
|
|
416
|
+
var filter = _ref.filter;
|
|
508
417
|
filter = removeNullCondition(filter);
|
|
509
418
|
_.set(field.componentProps, 'service.params.filter', filter);
|
|
510
419
|
fieldSchema['x-component-props'] = field.componentProps;
|
|
511
420
|
field.componentProps = field.componentProps;
|
|
512
421
|
dn.emit('patch', {
|
|
513
|
-
schema: (
|
|
422
|
+
schema: (_schema5 = {}, _defineProperty(_schema5, 'x-uid', fieldSchema['x-uid']), _defineProperty(_schema5, 'x-component-props', field.componentProps), _schema5)
|
|
514
423
|
});
|
|
515
424
|
}
|
|
516
425
|
}), isSelectFieldMode && !field.readPretty && /*#__PURE__*/React.createElement(SchemaSettings.ModalItem, {
|
|
@@ -542,6 +451,7 @@ FormItem.Designer = function Designer() {
|
|
|
542
451
|
field: {
|
|
543
452
|
type: 'string',
|
|
544
453
|
enum: sortFields,
|
|
454
|
+
required: true,
|
|
545
455
|
'x-decorator': 'FormItem',
|
|
546
456
|
'x-component': 'Select',
|
|
547
457
|
'x-component-props': {
|
|
@@ -584,19 +494,19 @@ FormItem.Designer = function Designer() {
|
|
|
584
494
|
}
|
|
585
495
|
}
|
|
586
496
|
},
|
|
587
|
-
onSubmit: function onSubmit(
|
|
588
|
-
var
|
|
589
|
-
var sort =
|
|
497
|
+
onSubmit: function onSubmit(_ref2) {
|
|
498
|
+
var _schema6;
|
|
499
|
+
var sort = _ref2.sort;
|
|
590
500
|
var sortArr = sort.map(function (item) {
|
|
591
501
|
return item.direction === 'desc' ? "-".concat(item.field) : item.field;
|
|
592
502
|
});
|
|
593
503
|
_.set(field.componentProps, 'service.params.sort', sortArr);
|
|
594
504
|
fieldSchema['x-component-props'] = field.componentProps;
|
|
595
505
|
dn.emit('patch', {
|
|
596
|
-
schema: (
|
|
506
|
+
schema: (_schema6 = {}, _defineProperty(_schema6, 'x-uid', fieldSchema['x-uid']), _defineProperty(_schema6, 'x-component-props', field.componentProps), _schema6)
|
|
597
507
|
});
|
|
598
508
|
}
|
|
599
|
-
}),
|
|
509
|
+
}), showFieldMode && /*#__PURE__*/React.createElement(SchemaSettings.SelectItem, {
|
|
600
510
|
key: "field-mode",
|
|
601
511
|
title: t('Field mode'),
|
|
602
512
|
options: fieldModeOptions,
|
|
@@ -608,20 +518,75 @@ FormItem.Designer = function Designer() {
|
|
|
608
518
|
schema['x-component-props'] = fieldSchema['x-component-props'];
|
|
609
519
|
field.componentProps = field.componentProps || {};
|
|
610
520
|
field.componentProps.mode = mode;
|
|
611
|
-
if (mode === 'Nester') {
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
}
|
|
521
|
+
// if (mode === 'Nester') {
|
|
522
|
+
// const initValue = ['hasMany', 'belongsToMany'].includes(collectionField?.type) ? [{}] : {};
|
|
523
|
+
// field.value = field.value || initValue;
|
|
524
|
+
// }
|
|
615
525
|
dn.emit('patch', {
|
|
616
526
|
schema: schema
|
|
617
527
|
});
|
|
618
528
|
dn.refresh();
|
|
619
529
|
}
|
|
620
|
-
}),
|
|
530
|
+
}), showModeSelect && /*#__PURE__*/React.createElement(SchemaSettings.Item, null, /*#__PURE__*/React.createElement("div", {
|
|
531
|
+
style: {
|
|
532
|
+
alignItems: 'center',
|
|
533
|
+
display: 'flex',
|
|
534
|
+
justifyContent: 'space-between'
|
|
535
|
+
}
|
|
536
|
+
}, t('Popup size'), /*#__PURE__*/React.createElement(Select, {
|
|
537
|
+
bordered: false,
|
|
538
|
+
options: [{
|
|
539
|
+
label: t('Small'),
|
|
540
|
+
value: 'small'
|
|
541
|
+
}, {
|
|
542
|
+
label: t('Middle'),
|
|
543
|
+
value: 'middle'
|
|
544
|
+
}, {
|
|
545
|
+
label: t('Large'),
|
|
546
|
+
value: 'large'
|
|
547
|
+
}],
|
|
548
|
+
value: (_fieldSchema$xCompon5 = fieldSchema === null || fieldSchema === void 0 ? void 0 : (_fieldSchema$xCompon6 = fieldSchema['x-component-props']) === null || _fieldSchema$xCompon6 === void 0 ? void 0 : _fieldSchema$xCompon6['openSize']) !== null && _fieldSchema$xCompon5 !== void 0 ? _fieldSchema$xCompon5 : (fieldSchema === null || fieldSchema === void 0 ? void 0 : (_fieldSchema$xCompon7 = fieldSchema['x-component-props']) === null || _fieldSchema$xCompon7 === void 0 ? void 0 : _fieldSchema$xCompon7['openMode']) == 'modal' ? 'large' : 'middle',
|
|
549
|
+
onChange: function onChange(value) {
|
|
550
|
+
field.componentProps.openSize = value;
|
|
551
|
+
fieldSchema['x-component-props'] = field.componentProps;
|
|
552
|
+
dn.emit('patch', {
|
|
553
|
+
schema: {
|
|
554
|
+
'x-uid': fieldSchema['x-uid'],
|
|
555
|
+
'x-component-props': fieldSchema['x-component-props']
|
|
556
|
+
}
|
|
557
|
+
});
|
|
558
|
+
dn.refresh();
|
|
559
|
+
},
|
|
560
|
+
style: {
|
|
561
|
+
textAlign: 'right',
|
|
562
|
+
minWidth: 100
|
|
563
|
+
}
|
|
564
|
+
}))), !field.readPretty && isAssociationField && ['Select', 'Picker'].includes(fieldMode) && /*#__PURE__*/React.createElement(SchemaSettings.SwitchItem, {
|
|
621
565
|
key: "allowAddNew",
|
|
622
566
|
title: t('Allow add new data'),
|
|
623
567
|
checked: fieldSchema['x-add-new'],
|
|
624
568
|
onChange: function onChange(allowAddNew) {
|
|
569
|
+
var hasAddNew = fieldSchema.reduceProperties(function (buf, schema) {
|
|
570
|
+
if (schema['x-component'] === 'Action') {
|
|
571
|
+
return schema;
|
|
572
|
+
}
|
|
573
|
+
return buf;
|
|
574
|
+
}, null);
|
|
575
|
+
if (!hasAddNew) {
|
|
576
|
+
var addNewActionschema = {
|
|
577
|
+
'x-action': 'create',
|
|
578
|
+
title: "{{t('Add new')}}",
|
|
579
|
+
'x-designer': 'Action.Designer',
|
|
580
|
+
'x-component': 'Action',
|
|
581
|
+
'x-decorator': 'ACLActionProvider',
|
|
582
|
+
'x-component-props': {
|
|
583
|
+
openMode: 'drawer',
|
|
584
|
+
type: 'default',
|
|
585
|
+
component: 'CreateRecordAction'
|
|
586
|
+
}
|
|
587
|
+
};
|
|
588
|
+
insertAdjacent('afterBegin', addNewActionschema);
|
|
589
|
+
}
|
|
625
590
|
var schema = _defineProperty({}, 'x-uid', fieldSchema['x-uid']);
|
|
626
591
|
field['x-add-new'] = allowAddNew;
|
|
627
592
|
fieldSchema['x-add-new'] = allowAddNew;
|
|
@@ -631,10 +596,10 @@ FormItem.Designer = function Designer() {
|
|
|
631
596
|
});
|
|
632
597
|
refresh();
|
|
633
598
|
}
|
|
634
|
-
}),
|
|
599
|
+
}), IsShowMultipleSwitch() ? /*#__PURE__*/React.createElement(SchemaSettings.SwitchItem, {
|
|
635
600
|
key: "multiple",
|
|
636
|
-
title: t('
|
|
637
|
-
checked: ((_fieldSchema$
|
|
601
|
+
title: t('Allow multiple'),
|
|
602
|
+
checked: ((_fieldSchema$xCompon8 = fieldSchema['x-component-props']) === null || _fieldSchema$xCompon8 === void 0 ? void 0 : _fieldSchema$xCompon8.multiple) === undefined ? true : fieldSchema['x-component-props'].multiple,
|
|
638
603
|
onChange: function onChange(value) {
|
|
639
604
|
var schema = _defineProperty({}, 'x-uid', fieldSchema['x-uid']);
|
|
640
605
|
fieldSchema['x-component-props'] = fieldSchema['x-component-props'] || {};
|
|
@@ -647,9 +612,25 @@ FormItem.Designer = function Designer() {
|
|
|
647
612
|
});
|
|
648
613
|
refresh();
|
|
649
614
|
}
|
|
650
|
-
})
|
|
615
|
+
}) : null, IsShowMultipleSwitch() && isSubFormMode ? /*#__PURE__*/React.createElement(SchemaSettings.SwitchItem, {
|
|
616
|
+
key: "allowDissociate",
|
|
617
|
+
title: t('Allow dissociate'),
|
|
618
|
+
checked: ((_fieldSchema$xCompon9 = fieldSchema['x-component-props']) === null || _fieldSchema$xCompon9 === void 0 ? void 0 : _fieldSchema$xCompon9.allowDissociate) !== false,
|
|
619
|
+
onChange: function onChange(value) {
|
|
620
|
+
var schema = _defineProperty({}, 'x-uid', fieldSchema['x-uid']);
|
|
621
|
+
fieldSchema['x-component-props'] = fieldSchema['x-component-props'] || {};
|
|
622
|
+
field.componentProps = field.componentProps || {};
|
|
623
|
+
fieldSchema['x-component-props'].allowDissociate = value;
|
|
624
|
+
field.componentProps.allowDissociate = value;
|
|
625
|
+
schema['x-component-props'] = fieldSchema['x-component-props'];
|
|
626
|
+
dn.emit('patch', {
|
|
627
|
+
schema: schema
|
|
628
|
+
});
|
|
629
|
+
refresh();
|
|
630
|
+
}
|
|
631
|
+
}) : null, field.readPretty && options.length > 0 && fieldSchema['x-component'] === 'CollectionField' && !isFileField && /*#__PURE__*/React.createElement(SchemaSettings.SwitchItem, {
|
|
651
632
|
title: t('Enable link'),
|
|
652
|
-
checked: ((_fieldSchema$
|
|
633
|
+
checked: ((_fieldSchema$xCompon10 = fieldSchema['x-component-props']) === null || _fieldSchema$xCompon10 === void 0 ? void 0 : _fieldSchema$xCompon10.enableLink) !== false,
|
|
653
634
|
onChange: function onChange(flag) {
|
|
654
635
|
fieldSchema['x-component-props'] = _objectSpread(_objectSpread({}, fieldSchema === null || fieldSchema === void 0 ? void 0 : fieldSchema['x-component-props']), {}, {
|
|
655
636
|
enableLink: flag
|
|
@@ -715,15 +696,15 @@ FormItem.Designer = function Designer() {
|
|
|
715
696
|
});
|
|
716
697
|
dn.refresh();
|
|
717
698
|
}
|
|
718
|
-
}), options.length > 0 &&
|
|
699
|
+
}), options.length > 0 && isAssociationField && /*#__PURE__*/React.createElement(SchemaSettings.SelectItem, {
|
|
719
700
|
key: "title-field",
|
|
720
701
|
title: t('Title field'),
|
|
721
702
|
options: options,
|
|
722
703
|
value: field === null || field === void 0 ? void 0 : (_field$componentProps8 = field.componentProps) === null || _field$componentProps8 === void 0 ? void 0 : (_field$componentProps9 = _field$componentProps8.fieldNames) === null || _field$componentProps9 === void 0 ? void 0 : _field$componentProps9.label,
|
|
723
704
|
onChange: function onChange(label) {
|
|
724
|
-
var _collectionField$
|
|
705
|
+
var _collectionField$uiSc3, _collectionField$uiSc4;
|
|
725
706
|
var schema = _defineProperty({}, 'x-uid', fieldSchema['x-uid']);
|
|
726
|
-
var fieldNames = _objectSpread(_objectSpread(_objectSpread({}, collectionField === null || collectionField === void 0 ? void 0 : (_collectionField$
|
|
707
|
+
var fieldNames = _objectSpread(_objectSpread(_objectSpread({}, collectionField === null || collectionField === void 0 ? void 0 : (_collectionField$uiSc3 = collectionField.uiSchema) === null || _collectionField$uiSc3 === void 0 ? void 0 : (_collectionField$uiSc4 = _collectionField$uiSc3['x-component-props']) === null || _collectionField$uiSc4 === void 0 ? void 0 : _collectionField$uiSc4['fieldNames']), field.componentProps.fieldNames), {}, {
|
|
727
708
|
label: label
|
|
728
709
|
});
|
|
729
710
|
fieldSchema['x-component-props'] = fieldSchema['x-component-props'] || {};
|
|
@@ -751,9 +732,9 @@ export function isFileCollection(collection) {
|
|
|
751
732
|
}
|
|
752
733
|
FormItem.FilterFormDesigner = FilterFormDesigner;
|
|
753
734
|
export function getFieldDefaultValue(fieldSchema, collectionField) {
|
|
754
|
-
var _collectionField$
|
|
735
|
+
var _collectionField$uiSc5;
|
|
755
736
|
var result = (fieldSchema === null || fieldSchema === void 0 ? void 0 : fieldSchema.default) || (collectionField === null || collectionField === void 0 ? void 0 : collectionField.defaultValue);
|
|
756
|
-
if ((collectionField === null || collectionField === void 0 ? void 0 : (_collectionField$
|
|
737
|
+
if ((collectionField === null || collectionField === void 0 ? void 0 : (_collectionField$uiSc5 = collectionField.uiSchema) === null || _collectionField$uiSc5 === void 0 ? void 0 : _collectionField$uiSc5['x-component']) === 'DatePicker' && result) {
|
|
757
738
|
return moment(result);
|
|
758
739
|
}
|
|
759
740
|
return result;
|
|
@@ -365,11 +365,11 @@ export var EditDefaultValue = function EditDefaultValue() {
|
|
|
365
365
|
type: 'object',
|
|
366
366
|
title: t('Set default value'),
|
|
367
367
|
properties: {
|
|
368
|
-
default: _objectSpread(_objectSpread({}, collectionField.uiSchema), {}, {
|
|
368
|
+
default: _objectSpread(_objectSpread({}, collectionField === null || collectionField === void 0 ? void 0 : collectionField.uiSchema), {}, {
|
|
369
369
|
name: 'default',
|
|
370
370
|
title: t('Default value'),
|
|
371
371
|
'x-decorator': 'FormItem',
|
|
372
|
-
default: fieldSchema.default || collectionField.defaultValue
|
|
372
|
+
default: fieldSchema.default || (collectionField === null || collectionField === void 0 ? void 0 : collectionField.defaultValue)
|
|
373
373
|
})
|
|
374
374
|
}
|
|
375
375
|
},
|
|
@@ -558,7 +558,7 @@ export var EditTitleField = function EditTitleField() {
|
|
|
558
558
|
dn = _useDesignable10.dn;
|
|
559
559
|
var compile = useCompile();
|
|
560
560
|
var collectionField = getField(fieldSchema['name']) || getCollectionJoinField(fieldSchema['x-collection-field']);
|
|
561
|
-
var targetFields = (collectionField === null || collectionField === void 0 ? void 0 : collectionField.target) ? getCollectionFields(collectionField.target) : (_getCollectionFields = getCollectionFields(collectionField === null || collectionField === void 0 ? void 0 : collectionField.targetCollection)) !== null && _getCollectionFields !== void 0 ? _getCollectionFields : [];
|
|
561
|
+
var targetFields = (collectionField === null || collectionField === void 0 ? void 0 : collectionField.target) ? getCollectionFields(collectionField === null || collectionField === void 0 ? void 0 : collectionField.target) : (_getCollectionFields = getCollectionFields(collectionField === null || collectionField === void 0 ? void 0 : collectionField.targetCollection)) !== null && _getCollectionFields !== void 0 ? _getCollectionFields : [];
|
|
562
562
|
var options = targetFields.filter(function (field) {
|
|
563
563
|
return !(field === null || field === void 0 ? void 0 : field.target) && field.type !== 'boolean';
|
|
564
564
|
}).map(function (field) {
|
|
@@ -1,3 +1,23 @@
|
|
|
1
|
+
export interface ITemplate {
|
|
2
|
+
config?: {
|
|
3
|
+
[key: string]: {
|
|
4
|
+
/** 设置的数据范围 */
|
|
5
|
+
filter?: any;
|
|
6
|
+
/** 设置的标题字段 */
|
|
7
|
+
titleField?: string;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
items: {
|
|
11
|
+
key: string;
|
|
12
|
+
title: string;
|
|
13
|
+
collection: string;
|
|
14
|
+
dataId: number;
|
|
15
|
+
fields: string[];
|
|
16
|
+
default?: boolean;
|
|
17
|
+
}[];
|
|
18
|
+
/** 是否在 Form 区块显示模板选择器 */
|
|
19
|
+
display: boolean;
|
|
20
|
+
}
|
|
1
21
|
export declare const Templates: ({ style, form }: {
|
|
2
22
|
style?: {};
|
|
3
23
|
form: any;
|