@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
|
@@ -219,6 +219,118 @@ export declare const createDetailsBlockSchema: (options: any) => import("@formil
|
|
|
219
219
|
"x-read-only"?: boolean;
|
|
220
220
|
"x-read-pretty"?: boolean;
|
|
221
221
|
}>;
|
|
222
|
+
export declare const createListBlockSchema: (options: any) => import("@formily/react").Stringify<{
|
|
223
|
+
[key: symbol]: any;
|
|
224
|
+
[key: `x-${string}`]: any;
|
|
225
|
+
[key: `x-${number}`]: any;
|
|
226
|
+
version?: string;
|
|
227
|
+
name?: import("@formily/react").SchemaKey;
|
|
228
|
+
title?: any;
|
|
229
|
+
description?: any;
|
|
230
|
+
default?: any;
|
|
231
|
+
readOnly?: boolean;
|
|
232
|
+
writeOnly?: boolean;
|
|
233
|
+
type?: import("@formily/react").SchemaTypes;
|
|
234
|
+
enum?: import("@formily/react").SchemaEnum<any>;
|
|
235
|
+
const?: any;
|
|
236
|
+
multipleOf?: number;
|
|
237
|
+
maximum?: number;
|
|
238
|
+
exclusiveMaximum?: number;
|
|
239
|
+
minimum?: number;
|
|
240
|
+
exclusiveMinimum?: number;
|
|
241
|
+
maxLength?: number;
|
|
242
|
+
minLength?: number;
|
|
243
|
+
pattern?: string | RegExp;
|
|
244
|
+
maxItems?: number;
|
|
245
|
+
minItems?: number;
|
|
246
|
+
uniqueItems?: boolean;
|
|
247
|
+
maxProperties?: number;
|
|
248
|
+
minProperties?: number;
|
|
249
|
+
required?: string | boolean | string[];
|
|
250
|
+
format?: string;
|
|
251
|
+
$ref?: string;
|
|
252
|
+
$namespace?: string;
|
|
253
|
+
definitions?: import("@formily/react").SchemaProperties<any, any, any, any, any, any, any, any>;
|
|
254
|
+
properties?: import("@formily/react").SchemaProperties<any, any, any, any, any, any, any, any>;
|
|
255
|
+
items?: import("@formily/react").SchemaItems<any, any, any, any, any, any, any, any>;
|
|
256
|
+
additionalItems?: import("@formily/react").Stringify<any>;
|
|
257
|
+
patternProperties?: import("@formily/react").SchemaProperties<any, any, any, any, any, any, any, any>;
|
|
258
|
+
additionalProperties?: import("@formily/react").Stringify<any>;
|
|
259
|
+
"x-value"?: any;
|
|
260
|
+
"x-index"?: number;
|
|
261
|
+
"x-pattern"?: any;
|
|
262
|
+
"x-display"?: any;
|
|
263
|
+
"x-validator"?: any;
|
|
264
|
+
"x-decorator"?: any;
|
|
265
|
+
"x-decorator-props"?: any;
|
|
266
|
+
"x-component"?: any;
|
|
267
|
+
"x-component-props"?: any;
|
|
268
|
+
"x-reactions"?: import("@formily/react").SchemaReactions<any>;
|
|
269
|
+
"x-content"?: any;
|
|
270
|
+
"x-data"?: any;
|
|
271
|
+
"x-visible"?: boolean;
|
|
272
|
+
"x-hidden"?: boolean;
|
|
273
|
+
"x-disabled"?: boolean;
|
|
274
|
+
"x-editable"?: boolean;
|
|
275
|
+
"x-read-only"?: boolean;
|
|
276
|
+
"x-read-pretty"?: boolean;
|
|
277
|
+
}>;
|
|
278
|
+
export declare const createGridCardBlockSchema: (options: any) => import("@formily/react").Stringify<{
|
|
279
|
+
[key: symbol]: any;
|
|
280
|
+
[key: `x-${string}`]: any;
|
|
281
|
+
[key: `x-${number}`]: any;
|
|
282
|
+
version?: string;
|
|
283
|
+
name?: import("@formily/react").SchemaKey;
|
|
284
|
+
title?: any;
|
|
285
|
+
description?: any;
|
|
286
|
+
default?: any;
|
|
287
|
+
readOnly?: boolean;
|
|
288
|
+
writeOnly?: boolean;
|
|
289
|
+
type?: import("@formily/react").SchemaTypes;
|
|
290
|
+
enum?: import("@formily/react").SchemaEnum<any>;
|
|
291
|
+
const?: any;
|
|
292
|
+
multipleOf?: number;
|
|
293
|
+
maximum?: number;
|
|
294
|
+
exclusiveMaximum?: number;
|
|
295
|
+
minimum?: number;
|
|
296
|
+
exclusiveMinimum?: number;
|
|
297
|
+
maxLength?: number;
|
|
298
|
+
minLength?: number;
|
|
299
|
+
pattern?: string | RegExp;
|
|
300
|
+
maxItems?: number;
|
|
301
|
+
minItems?: number;
|
|
302
|
+
uniqueItems?: boolean;
|
|
303
|
+
maxProperties?: number;
|
|
304
|
+
minProperties?: number;
|
|
305
|
+
required?: string | boolean | string[];
|
|
306
|
+
format?: string;
|
|
307
|
+
$ref?: string;
|
|
308
|
+
$namespace?: string;
|
|
309
|
+
definitions?: import("@formily/react").SchemaProperties<any, any, any, any, any, any, any, any>;
|
|
310
|
+
properties?: import("@formily/react").SchemaProperties<any, any, any, any, any, any, any, any>;
|
|
311
|
+
items?: import("@formily/react").SchemaItems<any, any, any, any, any, any, any, any>;
|
|
312
|
+
additionalItems?: import("@formily/react").Stringify<any>;
|
|
313
|
+
patternProperties?: import("@formily/react").SchemaProperties<any, any, any, any, any, any, any, any>;
|
|
314
|
+
additionalProperties?: import("@formily/react").Stringify<any>;
|
|
315
|
+
"x-value"?: any;
|
|
316
|
+
"x-index"?: number;
|
|
317
|
+
"x-pattern"?: any;
|
|
318
|
+
"x-display"?: any;
|
|
319
|
+
"x-validator"?: any;
|
|
320
|
+
"x-decorator"?: any;
|
|
321
|
+
"x-decorator-props"?: any;
|
|
322
|
+
"x-component"?: any;
|
|
323
|
+
"x-component-props"?: any;
|
|
324
|
+
"x-reactions"?: import("@formily/react").SchemaReactions<any>;
|
|
325
|
+
"x-content"?: any;
|
|
326
|
+
"x-data"?: any;
|
|
327
|
+
"x-visible"?: boolean;
|
|
328
|
+
"x-hidden"?: boolean;
|
|
329
|
+
"x-disabled"?: boolean;
|
|
330
|
+
"x-editable"?: boolean;
|
|
331
|
+
"x-read-only"?: boolean;
|
|
332
|
+
"x-read-pretty"?: boolean;
|
|
333
|
+
}>;
|
|
222
334
|
export declare const createFormBlockSchema: (options: any) => import("@formily/react").Stringify<{
|
|
223
335
|
[key: symbol]: any;
|
|
224
336
|
[key: `x-${string}`]: any;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.useTableColumnInitializerFields = exports.useRemoveGridFormItem = exports.useRecordCollectionDataSourceItems = exports.useInheritsTableColumnInitializerFields = exports.useInheritsFormItemInitializerFields = exports.useFormItemInitializerFields = exports.useFilterInheritsFormItemInitializerFields = exports.useFilterFormItemInitializerFields = exports.useFilterAssociatedFormItemInitializerFields = exports.useCustomFormItemInitializerFields = exports.useCustomBulkEditFormItemInitializerFields = exports.useCurrentSchema = exports.useCollectionDataSourceItems = exports.useAssociatedTableColumnInitializerFields = exports.useAssociatedFormItemInitializerFields = exports.removeTableColumn = exports.removeGridFormItem = exports.itemsMerge = exports.gridRowColWrap = exports.findTableColumn = exports.createTableSelectorSchema = exports.createTableBlockSchema = exports.createReadPrettyFormBlockSchema = exports.createKanbanBlockSchema = exports.createGanttBlockSchema = exports.createFormBlockSchema = exports.createFilterFormBlockSchema = exports.createDetailsBlockSchema = exports.createCollapseBlockSchema = exports.createCalendarBlockSchema = void 0;
|
|
6
|
+
exports.useTableColumnInitializerFields = exports.useRemoveGridFormItem = exports.useRecordCollectionDataSourceItems = exports.useInheritsTableColumnInitializerFields = exports.useInheritsFormItemInitializerFields = exports.useFormItemInitializerFields = exports.useFilterInheritsFormItemInitializerFields = exports.useFilterFormItemInitializerFields = exports.useFilterAssociatedFormItemInitializerFields = exports.useCustomFormItemInitializerFields = exports.useCustomBulkEditFormItemInitializerFields = exports.useCurrentSchema = exports.useCollectionDataSourceItems = exports.useAssociatedTableColumnInitializerFields = exports.useAssociatedFormItemInitializerFields = exports.removeTableColumn = exports.removeGridFormItem = exports.itemsMerge = exports.gridRowColWrap = exports.findTableColumn = exports.createTableSelectorSchema = exports.createTableBlockSchema = exports.createReadPrettyFormBlockSchema = exports.createListBlockSchema = exports.createKanbanBlockSchema = exports.createGridCardBlockSchema = exports.createGanttBlockSchema = exports.createFormBlockSchema = exports.createFilterFormBlockSchema = exports.createDetailsBlockSchema = exports.createCollapseBlockSchema = exports.createCalendarBlockSchema = void 0;
|
|
7
7
|
var _react = require("@formily/react");
|
|
8
8
|
var _shared = require("@formily/shared");
|
|
9
9
|
var _react2 = _interopRequireWildcard(require("react"));
|
|
@@ -15,14 +15,16 @@ var _schemaComponent = require("../schema-component");
|
|
|
15
15
|
var _schemaTemplates = require("../schema-templates");
|
|
16
16
|
var _SelectCollection = require("./SelectCollection");
|
|
17
17
|
var _excluded = ["formItemInitializers", "actionInitializers", "collection", "association", "resource", "template"],
|
|
18
|
-
_excluded2 = ["formItemInitializers", "actionInitializers", "
|
|
19
|
-
_excluded3 = ["formItemInitializers", "actionInitializers", "
|
|
20
|
-
_excluded4 = ["formItemInitializers", "actionInitializers", "collection", "association", "
|
|
21
|
-
_excluded5 = ["
|
|
22
|
-
_excluded6 = ["collection", "resource", "
|
|
23
|
-
_excluded7 = ["collection", "resource", "
|
|
24
|
-
_excluded8 = ["collection", "resource", "
|
|
25
|
-
_excluded9 = ["collection", "resource", "
|
|
18
|
+
_excluded2 = ["formItemInitializers", "actionInitializers", "itemActionInitializers", "collection", "association", "resource", "template"],
|
|
19
|
+
_excluded3 = ["formItemInitializers", "actionInitializers", "itemActionInitializers", "collection", "association", "resource", "template"],
|
|
20
|
+
_excluded4 = ["formItemInitializers", "actionInitializers", "collection", "resource", "association", "action", "template"],
|
|
21
|
+
_excluded5 = ["formItemInitializers", "actionInitializers", "collection", "resource", "association", "action", "template"],
|
|
22
|
+
_excluded6 = ["formItemInitializers", "actionInitializers", "collection", "association", "resource", "template"],
|
|
23
|
+
_excluded7 = ["collection", "resource", "rowKey", "tableActionInitializers", "tableColumnInitializers", "tableActionColumnInitializers", "tableBlockProvider", "disableTemplate", "TableBlockDesigner", "blockType", "pageSize"],
|
|
24
|
+
_excluded8 = ["collection", "resource", "rowKey"],
|
|
25
|
+
_excluded9 = ["collection", "resource", "fieldNames"],
|
|
26
|
+
_excluded10 = ["collection", "resource", "fieldNames"],
|
|
27
|
+
_excluded11 = ["collection", "resource", "groupField"];
|
|
26
28
|
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); }
|
|
27
29
|
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; }
|
|
28
30
|
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); }
|
|
@@ -537,7 +539,9 @@ var useInheritsFormItemInitializerFields = function useInheritsFormItemInitializ
|
|
|
537
539
|
_ref5$readPretty = _ref5.readPretty,
|
|
538
540
|
readPretty = _ref5$readPretty === void 0 ? form.readPretty : _ref5$readPretty,
|
|
539
541
|
_ref5$block = _ref5.block,
|
|
540
|
-
block = _ref5$block === void 0 ? 'Form' : _ref5$block
|
|
542
|
+
block = _ref5$block === void 0 ? 'Form' : _ref5$block,
|
|
543
|
+
_ref5$component = _ref5.component,
|
|
544
|
+
component = _ref5$component === void 0 ? 'CollectionField' : _ref5$component;
|
|
541
545
|
var targetCollection = getCollection(v);
|
|
542
546
|
return _defineProperty({}, targetCollection === null || targetCollection === void 0 ? void 0 : targetCollection.title, fields === null || fields === void 0 ? void 0 : (_fields$filter4 = fields.filter(function (field) {
|
|
543
547
|
return (field === null || field === void 0 ? void 0 : field.interface) && !(field === null || field === void 0 ? void 0 : field.isForeignKey);
|
|
@@ -554,7 +558,7 @@ var useInheritsFormItemInitializerFields = function useInheritsFormItemInitializ
|
|
|
554
558
|
name: field.name,
|
|
555
559
|
title: (field === null || field === void 0 ? void 0 : (_field$uiSchema10 = field.uiSchema) === null || _field$uiSchema10 === void 0 ? void 0 : _field$uiSchema10.title) || field.name,
|
|
556
560
|
'x-designer': 'FormItem.Designer',
|
|
557
|
-
'x-component':
|
|
561
|
+
'x-component': component,
|
|
558
562
|
'x-decorator': 'FormItem',
|
|
559
563
|
'x-collection-field': "".concat(name, ".").concat(field.name),
|
|
560
564
|
'x-component-props': {},
|
|
@@ -1027,17 +1031,189 @@ var createDetailsBlockSchema = function createDetailsBlockSchema(options) {
|
|
|
1027
1031
|
return schema;
|
|
1028
1032
|
};
|
|
1029
1033
|
exports.createDetailsBlockSchema = createDetailsBlockSchema;
|
|
1030
|
-
var
|
|
1034
|
+
var createListBlockSchema = function createListBlockSchema(options) {
|
|
1031
1035
|
var _options$formItemInit2 = options.formItemInitializers,
|
|
1032
|
-
formItemInitializers = _options$formItemInit2 === void 0 ? '
|
|
1036
|
+
formItemInitializers = _options$formItemInit2 === void 0 ? 'ReadPrettyFormItemInitializers' : _options$formItemInit2,
|
|
1033
1037
|
_options$actionInitia2 = options.actionInitializers,
|
|
1034
|
-
actionInitializers = _options$actionInitia2 === void 0 ? '
|
|
1038
|
+
actionInitializers = _options$actionInitia2 === void 0 ? 'ListActionInitializers' : _options$actionInitia2,
|
|
1039
|
+
_options$itemActionIn = options.itemActionInitializers,
|
|
1040
|
+
itemActionInitializers = _options$itemActionIn === void 0 ? 'ListItemActionInitializers' : _options$itemActionIn,
|
|
1041
|
+
collection = options.collection,
|
|
1042
|
+
association = options.association,
|
|
1043
|
+
resource = options.resource,
|
|
1044
|
+
template = options.template,
|
|
1045
|
+
others = _objectWithoutProperties(options, _excluded2);
|
|
1046
|
+
var resourceName = resource || association || collection;
|
|
1047
|
+
var schema = {
|
|
1048
|
+
type: 'void',
|
|
1049
|
+
'x-acl-action': "".concat(resourceName, ":view"),
|
|
1050
|
+
'x-decorator': 'List.Decorator',
|
|
1051
|
+
'x-decorator-props': _objectSpread({
|
|
1052
|
+
resource: resourceName,
|
|
1053
|
+
collection: collection,
|
|
1054
|
+
association: association,
|
|
1055
|
+
readPretty: true,
|
|
1056
|
+
action: 'list',
|
|
1057
|
+
params: {
|
|
1058
|
+
pageSize: 10
|
|
1059
|
+
},
|
|
1060
|
+
runWhenParamsChanged: true
|
|
1061
|
+
}, others),
|
|
1062
|
+
'x-component': 'CardItem',
|
|
1063
|
+
'x-designer': 'List.Designer',
|
|
1064
|
+
properties: {
|
|
1065
|
+
actionBar: {
|
|
1066
|
+
type: 'void',
|
|
1067
|
+
'x-initializer': actionInitializers,
|
|
1068
|
+
'x-component': 'ActionBar',
|
|
1069
|
+
'x-component-props': {
|
|
1070
|
+
style: {
|
|
1071
|
+
marginBottom: 'var(--nb-spacing)'
|
|
1072
|
+
}
|
|
1073
|
+
},
|
|
1074
|
+
properties: {}
|
|
1075
|
+
},
|
|
1076
|
+
list: {
|
|
1077
|
+
type: 'array',
|
|
1078
|
+
'x-component': 'List',
|
|
1079
|
+
'x-component-props': {
|
|
1080
|
+
props: '{{ useListBlockProps }}'
|
|
1081
|
+
},
|
|
1082
|
+
properties: {
|
|
1083
|
+
item: {
|
|
1084
|
+
type: 'object',
|
|
1085
|
+
'x-component': 'List.Item',
|
|
1086
|
+
'x-read-pretty': true,
|
|
1087
|
+
'x-component-props': {
|
|
1088
|
+
useProps: '{{ useListItemProps }}'
|
|
1089
|
+
},
|
|
1090
|
+
properties: {
|
|
1091
|
+
grid: template || {
|
|
1092
|
+
type: 'void',
|
|
1093
|
+
'x-component': 'Grid',
|
|
1094
|
+
'x-initializer': formItemInitializers,
|
|
1095
|
+
'x-initializer-props': {
|
|
1096
|
+
useProps: '{{ useListItemInitializerProps }}'
|
|
1097
|
+
},
|
|
1098
|
+
properties: {}
|
|
1099
|
+
},
|
|
1100
|
+
actionBar: {
|
|
1101
|
+
type: 'void',
|
|
1102
|
+
'x-align': 'left',
|
|
1103
|
+
'x-initializer': itemActionInitializers,
|
|
1104
|
+
'x-component': 'ActionBar',
|
|
1105
|
+
'x-component-props': {
|
|
1106
|
+
useProps: '{{ useListActionBarProps }}',
|
|
1107
|
+
layout: 'one-column'
|
|
1108
|
+
},
|
|
1109
|
+
properties: {}
|
|
1110
|
+
}
|
|
1111
|
+
}
|
|
1112
|
+
}
|
|
1113
|
+
}
|
|
1114
|
+
}
|
|
1115
|
+
}
|
|
1116
|
+
};
|
|
1117
|
+
return schema;
|
|
1118
|
+
};
|
|
1119
|
+
exports.createListBlockSchema = createListBlockSchema;
|
|
1120
|
+
var createGridCardBlockSchema = function createGridCardBlockSchema(options) {
|
|
1121
|
+
var _options$formItemInit3 = options.formItemInitializers,
|
|
1122
|
+
formItemInitializers = _options$formItemInit3 === void 0 ? 'ReadPrettyFormItemInitializers' : _options$formItemInit3,
|
|
1123
|
+
_options$actionInitia3 = options.actionInitializers,
|
|
1124
|
+
actionInitializers = _options$actionInitia3 === void 0 ? 'GridCardActionInitializers' : _options$actionInitia3,
|
|
1125
|
+
_options$itemActionIn2 = options.itemActionInitializers,
|
|
1126
|
+
itemActionInitializers = _options$itemActionIn2 === void 0 ? 'GridCardItemActionInitializers' : _options$itemActionIn2,
|
|
1127
|
+
collection = options.collection,
|
|
1128
|
+
association = options.association,
|
|
1129
|
+
resource = options.resource,
|
|
1130
|
+
template = options.template,
|
|
1131
|
+
others = _objectWithoutProperties(options, _excluded3);
|
|
1132
|
+
var resourceName = resource || association || collection;
|
|
1133
|
+
var schema = {
|
|
1134
|
+
type: 'void',
|
|
1135
|
+
'x-acl-action': "".concat(resourceName, ":view"),
|
|
1136
|
+
'x-decorator': 'GridCard.Decorator',
|
|
1137
|
+
'x-decorator-props': _objectSpread({
|
|
1138
|
+
resource: resourceName,
|
|
1139
|
+
collection: collection,
|
|
1140
|
+
association: association,
|
|
1141
|
+
readPretty: true,
|
|
1142
|
+
action: 'list',
|
|
1143
|
+
params: {
|
|
1144
|
+
pageSize: 12
|
|
1145
|
+
},
|
|
1146
|
+
runWhenParamsChanged: true
|
|
1147
|
+
}, others),
|
|
1148
|
+
'x-component': 'BlockItem',
|
|
1149
|
+
'x-designer': 'GridCard.Designer',
|
|
1150
|
+
properties: {
|
|
1151
|
+
actionBar: {
|
|
1152
|
+
type: 'void',
|
|
1153
|
+
'x-initializer': actionInitializers,
|
|
1154
|
+
'x-component': 'ActionBar',
|
|
1155
|
+
'x-component-props': {
|
|
1156
|
+
style: {
|
|
1157
|
+
marginBottom: 'var(--nb-spacing)'
|
|
1158
|
+
}
|
|
1159
|
+
},
|
|
1160
|
+
properties: {}
|
|
1161
|
+
},
|
|
1162
|
+
list: {
|
|
1163
|
+
type: 'array',
|
|
1164
|
+
'x-component': 'GridCard',
|
|
1165
|
+
'x-component-props': {
|
|
1166
|
+
props: '{{ useGridCardBlockProps }}'
|
|
1167
|
+
},
|
|
1168
|
+
properties: {
|
|
1169
|
+
item: {
|
|
1170
|
+
type: 'object',
|
|
1171
|
+
'x-component': 'GridCard.Item',
|
|
1172
|
+
'x-read-pretty': true,
|
|
1173
|
+
'x-component-props': {
|
|
1174
|
+
useProps: '{{ useGridCardItemProps }}'
|
|
1175
|
+
},
|
|
1176
|
+
properties: {
|
|
1177
|
+
grid: template || {
|
|
1178
|
+
type: 'void',
|
|
1179
|
+
'x-component': 'Grid',
|
|
1180
|
+
'x-initializer': formItemInitializers,
|
|
1181
|
+
'x-initializer-props': {
|
|
1182
|
+
useProps: '{{ useGridCardItemInitializerProps }}'
|
|
1183
|
+
},
|
|
1184
|
+
properties: {}
|
|
1185
|
+
},
|
|
1186
|
+
actionBar: {
|
|
1187
|
+
type: 'void',
|
|
1188
|
+
'x-align': 'left',
|
|
1189
|
+
'x-initializer': itemActionInitializers,
|
|
1190
|
+
'x-component': 'ActionBar',
|
|
1191
|
+
'x-component-props': {
|
|
1192
|
+
useProps: '{{ useGridCardActionBarProps }}',
|
|
1193
|
+
layout: 'one-column'
|
|
1194
|
+
},
|
|
1195
|
+
properties: {}
|
|
1196
|
+
}
|
|
1197
|
+
}
|
|
1198
|
+
}
|
|
1199
|
+
}
|
|
1200
|
+
}
|
|
1201
|
+
}
|
|
1202
|
+
};
|
|
1203
|
+
return schema;
|
|
1204
|
+
};
|
|
1205
|
+
exports.createGridCardBlockSchema = createGridCardBlockSchema;
|
|
1206
|
+
var createFormBlockSchema = function createFormBlockSchema(options) {
|
|
1207
|
+
var _options$formItemInit4 = options.formItemInitializers,
|
|
1208
|
+
formItemInitializers = _options$formItemInit4 === void 0 ? 'FormItemInitializers' : _options$formItemInit4,
|
|
1209
|
+
_options$actionInitia4 = options.actionInitializers,
|
|
1210
|
+
actionInitializers = _options$actionInitia4 === void 0 ? 'FormActionInitializers' : _options$actionInitia4,
|
|
1035
1211
|
collection = options.collection,
|
|
1036
1212
|
resource = options.resource,
|
|
1037
1213
|
association = options.association,
|
|
1038
1214
|
action = options.action,
|
|
1039
1215
|
template = options.template,
|
|
1040
|
-
others = _objectWithoutProperties(options,
|
|
1216
|
+
others = _objectWithoutProperties(options, _excluded4);
|
|
1041
1217
|
var resourceName = resource || association || collection;
|
|
1042
1218
|
var schema = {
|
|
1043
1219
|
type: 'void',
|
|
@@ -1089,16 +1265,16 @@ var createFormBlockSchema = function createFormBlockSchema(options) {
|
|
|
1089
1265
|
};
|
|
1090
1266
|
exports.createFormBlockSchema = createFormBlockSchema;
|
|
1091
1267
|
var createFilterFormBlockSchema = function createFilterFormBlockSchema(options) {
|
|
1092
|
-
var _options$
|
|
1093
|
-
formItemInitializers = _options$
|
|
1094
|
-
_options$
|
|
1095
|
-
actionInitializers = _options$
|
|
1268
|
+
var _options$formItemInit5 = options.formItemInitializers,
|
|
1269
|
+
formItemInitializers = _options$formItemInit5 === void 0 ? 'FilterFormItemInitializers' : _options$formItemInit5,
|
|
1270
|
+
_options$actionInitia5 = options.actionInitializers,
|
|
1271
|
+
actionInitializers = _options$actionInitia5 === void 0 ? 'FilterFormActionInitializers' : _options$actionInitia5,
|
|
1096
1272
|
collection = options.collection,
|
|
1097
1273
|
resource = options.resource,
|
|
1098
1274
|
association = options.association,
|
|
1099
1275
|
action = options.action,
|
|
1100
1276
|
template = options.template,
|
|
1101
|
-
others = _objectWithoutProperties(options,
|
|
1277
|
+
others = _objectWithoutProperties(options, _excluded5);
|
|
1102
1278
|
var resourceName = resource || association || collection;
|
|
1103
1279
|
var schema = {
|
|
1104
1280
|
type: 'void',
|
|
@@ -1147,15 +1323,15 @@ var createFilterFormBlockSchema = function createFilterFormBlockSchema(options)
|
|
|
1147
1323
|
};
|
|
1148
1324
|
exports.createFilterFormBlockSchema = createFilterFormBlockSchema;
|
|
1149
1325
|
var createReadPrettyFormBlockSchema = function createReadPrettyFormBlockSchema(options) {
|
|
1150
|
-
var _options$
|
|
1151
|
-
formItemInitializers = _options$
|
|
1152
|
-
_options$
|
|
1153
|
-
actionInitializers = _options$
|
|
1326
|
+
var _options$formItemInit6 = options.formItemInitializers,
|
|
1327
|
+
formItemInitializers = _options$formItemInit6 === void 0 ? 'ReadPrettyFormItemInitializers' : _options$formItemInit6,
|
|
1328
|
+
_options$actionInitia6 = options.actionInitializers,
|
|
1329
|
+
actionInitializers = _options$actionInitia6 === void 0 ? 'ReadPrettyFormActionInitializers' : _options$actionInitia6,
|
|
1154
1330
|
collection = options.collection,
|
|
1155
1331
|
association = options.association,
|
|
1156
1332
|
resource = options.resource,
|
|
1157
1333
|
template = options.template,
|
|
1158
|
-
others = _objectWithoutProperties(options,
|
|
1334
|
+
others = _objectWithoutProperties(options, _excluded6);
|
|
1159
1335
|
var resourceName = resource || association || collection;
|
|
1160
1336
|
var schema = {
|
|
1161
1337
|
type: 'void',
|
|
@@ -1216,7 +1392,7 @@ var createTableBlockSchema = function createTableBlockSchema(options) {
|
|
|
1216
1392
|
blockType = options.blockType,
|
|
1217
1393
|
_options$pageSize = options.pageSize,
|
|
1218
1394
|
pageSize = _options$pageSize === void 0 ? 20 : _options$pageSize,
|
|
1219
|
-
others = _objectWithoutProperties(options,
|
|
1395
|
+
others = _objectWithoutProperties(options, _excluded7);
|
|
1220
1396
|
var schema = {
|
|
1221
1397
|
type: 'void',
|
|
1222
1398
|
'x-decorator': tableBlockProvider !== null && tableBlockProvider !== void 0 ? tableBlockProvider : 'TableBlockProvider',
|
|
@@ -1244,7 +1420,7 @@ var createTableBlockSchema = function createTableBlockSchema(options) {
|
|
|
1244
1420
|
'x-component': 'ActionBar',
|
|
1245
1421
|
'x-component-props': {
|
|
1246
1422
|
style: {
|
|
1247
|
-
marginBottom:
|
|
1423
|
+
marginBottom: 'var(--nb-spacing)'
|
|
1248
1424
|
}
|
|
1249
1425
|
},
|
|
1250
1426
|
properties: {}
|
|
@@ -1319,7 +1495,7 @@ var createTableSelectorSchema = function createTableSelectorSchema(options) {
|
|
|
1319
1495
|
var collection = options.collection,
|
|
1320
1496
|
resource = options.resource,
|
|
1321
1497
|
rowKey = options.rowKey,
|
|
1322
|
-
others = _objectWithoutProperties(options,
|
|
1498
|
+
others = _objectWithoutProperties(options, _excluded8);
|
|
1323
1499
|
var schema = {
|
|
1324
1500
|
type: 'void',
|
|
1325
1501
|
'x-acl-action': "".concat(resource || collection, ":list"),
|
|
@@ -1342,7 +1518,7 @@ var createTableSelectorSchema = function createTableSelectorSchema(options) {
|
|
|
1342
1518
|
'x-component': 'ActionBar',
|
|
1343
1519
|
'x-component-props': {
|
|
1344
1520
|
style: {
|
|
1345
|
-
marginBottom:
|
|
1521
|
+
marginBottom: 'var(--nb-spacing)'
|
|
1346
1522
|
}
|
|
1347
1523
|
},
|
|
1348
1524
|
properties: {}
|
|
@@ -1369,7 +1545,7 @@ var createCalendarBlockSchema = function createCalendarBlockSchema(options) {
|
|
|
1369
1545
|
var collection = options.collection,
|
|
1370
1546
|
resource = options.resource,
|
|
1371
1547
|
fieldNames = options.fieldNames,
|
|
1372
|
-
others = _objectWithoutProperties(options,
|
|
1548
|
+
others = _objectWithoutProperties(options, _excluded9);
|
|
1373
1549
|
var schema = {
|
|
1374
1550
|
type: 'void',
|
|
1375
1551
|
'x-acl-action': "".concat(resource || collection, ":list"),
|
|
@@ -1461,7 +1637,7 @@ var createGanttBlockSchema = function createGanttBlockSchema(options) {
|
|
|
1461
1637
|
var collection = options.collection,
|
|
1462
1638
|
resource = options.resource,
|
|
1463
1639
|
fieldNames = options.fieldNames,
|
|
1464
|
-
others = _objectWithoutProperties(options,
|
|
1640
|
+
others = _objectWithoutProperties(options, _excluded10);
|
|
1465
1641
|
var schema = {
|
|
1466
1642
|
type: 'void',
|
|
1467
1643
|
'x-acl-action': "".concat(resource || collection, ":list"),
|
|
@@ -1589,7 +1765,7 @@ var createKanbanBlockSchema = function createKanbanBlockSchema(options) {
|
|
|
1589
1765
|
var collection = options.collection,
|
|
1590
1766
|
resource = options.resource,
|
|
1591
1767
|
groupField = options.groupField,
|
|
1592
|
-
others = _objectWithoutProperties(options,
|
|
1768
|
+
others = _objectWithoutProperties(options, _excluded11);
|
|
1593
1769
|
var schema = {
|
|
1594
1770
|
type: 'void',
|
|
1595
1771
|
'x-acl-action': "".concat(resource || collection, ":list"),
|
|
@@ -1612,7 +1788,7 @@ var createKanbanBlockSchema = function createKanbanBlockSchema(options) {
|
|
|
1612
1788
|
'x-component': 'ActionBar',
|
|
1613
1789
|
'x-component-props': {
|
|
1614
1790
|
style: {
|
|
1615
|
-
marginBottom:
|
|
1791
|
+
marginBottom: 'var(--nb-spacing)'
|
|
1616
1792
|
}
|
|
1617
1793
|
},
|
|
1618
1794
|
properties: {}
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.GeneralSchemaItems = void 0;
|
|
7
|
+
var _react = require("@formily/react");
|
|
8
|
+
var _react2 = _interopRequireDefault(require("react"));
|
|
9
|
+
var _reactI18next = require("react-i18next");
|
|
10
|
+
var _collectionManager = require("../collection-manager");
|
|
11
|
+
var _schemaComponent = require("../schema-component");
|
|
12
|
+
var _schemaSettings = require("../schema-settings");
|
|
13
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
|
+
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); }
|
|
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; }
|
|
16
|
+
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; }
|
|
17
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
18
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
19
|
+
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); }
|
|
20
|
+
var GeneralSchemaItems = (0, _react.observer)(function (props) {
|
|
21
|
+
var _collectionField$uiSc, _field$decoratorProps, _fieldSchema$xDecora;
|
|
22
|
+
var _props$required = props.required,
|
|
23
|
+
required = _props$required === void 0 ? true : _props$required;
|
|
24
|
+
var _useCollectionManager = (0, _collectionManager.useCollectionManager)(),
|
|
25
|
+
getCollectionJoinField = _useCollectionManager.getCollectionJoinField;
|
|
26
|
+
var _useCollection = (0, _collectionManager.useCollection)(),
|
|
27
|
+
getField = _useCollection.getField;
|
|
28
|
+
var field = (0, _react.useField)();
|
|
29
|
+
var fieldSchema = (0, _react.useFieldSchema)();
|
|
30
|
+
var _useTranslation = (0, _reactI18next.useTranslation)(),
|
|
31
|
+
t = _useTranslation.t;
|
|
32
|
+
var _useDesignable = (0, _schemaComponent.useDesignable)(),
|
|
33
|
+
dn = _useDesignable.dn,
|
|
34
|
+
refresh = _useDesignable.refresh;
|
|
35
|
+
var collectionField = getField(fieldSchema['name']) || getCollectionJoinField(fieldSchema['x-collection-field']);
|
|
36
|
+
return /*#__PURE__*/_react2.default.createElement(_react2.default.Fragment, null, collectionField && /*#__PURE__*/_react2.default.createElement(_schemaSettings.SchemaSettings.ModalItem, {
|
|
37
|
+
key: "edit-field-title",
|
|
38
|
+
title: t('Edit field title'),
|
|
39
|
+
schema: {
|
|
40
|
+
type: 'object',
|
|
41
|
+
title: t('Edit field title'),
|
|
42
|
+
properties: {
|
|
43
|
+
title: {
|
|
44
|
+
title: t('Field title'),
|
|
45
|
+
default: field === null || field === void 0 ? void 0 : field.title,
|
|
46
|
+
description: "".concat(t('Original field title: ')).concat(collectionField === null || collectionField === void 0 ? void 0 : (_collectionField$uiSc = collectionField.uiSchema) === null || _collectionField$uiSc === void 0 ? void 0 : _collectionField$uiSc.title),
|
|
47
|
+
'x-decorator': 'FormItem',
|
|
48
|
+
'x-component': 'Input',
|
|
49
|
+
'x-component-props': {}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
onSubmit: function onSubmit(_ref) {
|
|
54
|
+
var title = _ref.title;
|
|
55
|
+
if (title) {
|
|
56
|
+
field.title = title;
|
|
57
|
+
fieldSchema.title = title;
|
|
58
|
+
dn.emit('patch', {
|
|
59
|
+
schema: {
|
|
60
|
+
'x-uid': fieldSchema['x-uid'],
|
|
61
|
+
title: fieldSchema.title
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
dn.refresh();
|
|
66
|
+
}
|
|
67
|
+
}), /*#__PURE__*/_react2.default.createElement(_schemaSettings.SchemaSettings.SwitchItem, {
|
|
68
|
+
checked: (_field$decoratorProps = field.decoratorProps.showTitle) !== null && _field$decoratorProps !== void 0 ? _field$decoratorProps : true,
|
|
69
|
+
title: t('Display title'),
|
|
70
|
+
onChange: function onChange(checked) {
|
|
71
|
+
fieldSchema['x-decorator-props'] = fieldSchema['x-decorator-props'] || {};
|
|
72
|
+
fieldSchema['x-decorator-props']['showTitle'] = checked;
|
|
73
|
+
field.decoratorProps.showTitle = checked;
|
|
74
|
+
dn.emit('patch', {
|
|
75
|
+
schema: {
|
|
76
|
+
'x-uid': fieldSchema['x-uid'],
|
|
77
|
+
'x-decorator-props': _objectSpread(_objectSpread({}, fieldSchema['x-decorator-props']), {}, {
|
|
78
|
+
showTitle: checked
|
|
79
|
+
})
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
dn.refresh();
|
|
83
|
+
}
|
|
84
|
+
}), !field.readPretty && /*#__PURE__*/_react2.default.createElement(_schemaSettings.SchemaSettings.ModalItem, {
|
|
85
|
+
key: "edit-description",
|
|
86
|
+
title: t('Edit description'),
|
|
87
|
+
schema: {
|
|
88
|
+
type: 'object',
|
|
89
|
+
title: t('Edit description'),
|
|
90
|
+
properties: {
|
|
91
|
+
description: {
|
|
92
|
+
// title: t('Description'),
|
|
93
|
+
default: field === null || field === void 0 ? void 0 : field.description,
|
|
94
|
+
'x-decorator': 'FormItem',
|
|
95
|
+
'x-component': 'Input.TextArea',
|
|
96
|
+
'x-component-props': {}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
onSubmit: function onSubmit(_ref2) {
|
|
101
|
+
var description = _ref2.description;
|
|
102
|
+
field.description = description;
|
|
103
|
+
fieldSchema.description = description;
|
|
104
|
+
dn.emit('patch', {
|
|
105
|
+
schema: {
|
|
106
|
+
'x-uid': fieldSchema['x-uid'],
|
|
107
|
+
description: fieldSchema.description
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
dn.refresh();
|
|
111
|
+
}
|
|
112
|
+
}), field.readPretty && /*#__PURE__*/_react2.default.createElement(_schemaSettings.SchemaSettings.ModalItem, {
|
|
113
|
+
key: "edit-tooltip",
|
|
114
|
+
title: t('Edit tooltip'),
|
|
115
|
+
schema: {
|
|
116
|
+
type: 'object',
|
|
117
|
+
title: t('Edit description'),
|
|
118
|
+
properties: {
|
|
119
|
+
tooltip: {
|
|
120
|
+
default: fieldSchema === null || fieldSchema === void 0 ? void 0 : (_fieldSchema$xDecora = fieldSchema['x-decorator-props']) === null || _fieldSchema$xDecora === void 0 ? void 0 : _fieldSchema$xDecora.tooltip,
|
|
121
|
+
'x-decorator': 'FormItem',
|
|
122
|
+
'x-component': 'Input.TextArea',
|
|
123
|
+
'x-component-props': {}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
},
|
|
127
|
+
onSubmit: function onSubmit(_ref3) {
|
|
128
|
+
var tooltip = _ref3.tooltip;
|
|
129
|
+
field.decoratorProps.tooltip = tooltip;
|
|
130
|
+
fieldSchema['x-decorator-props'] = fieldSchema['x-decorator-props'] || {};
|
|
131
|
+
fieldSchema['x-decorator-props']['tooltip'] = tooltip;
|
|
132
|
+
dn.emit('patch', {
|
|
133
|
+
schema: {
|
|
134
|
+
'x-uid': fieldSchema['x-uid'],
|
|
135
|
+
'x-decorator-props': fieldSchema['x-decorator-props']
|
|
136
|
+
}
|
|
137
|
+
});
|
|
138
|
+
dn.refresh();
|
|
139
|
+
}
|
|
140
|
+
}), !field.readPretty && fieldSchema['x-component'] !== 'FormField' && required && /*#__PURE__*/_react2.default.createElement(_schemaSettings.SchemaSettings.SwitchItem, {
|
|
141
|
+
key: "required",
|
|
142
|
+
title: t('Required'),
|
|
143
|
+
checked: fieldSchema.required,
|
|
144
|
+
onChange: function onChange(required) {
|
|
145
|
+
var schema = _defineProperty({}, 'x-uid', fieldSchema['x-uid']);
|
|
146
|
+
field.required = required;
|
|
147
|
+
fieldSchema['required'] = required;
|
|
148
|
+
schema['required'] = required;
|
|
149
|
+
dn.emit('patch', {
|
|
150
|
+
schema: schema
|
|
151
|
+
});
|
|
152
|
+
refresh();
|
|
153
|
+
}
|
|
154
|
+
}));
|
|
155
|
+
});
|
|
156
|
+
exports.GeneralSchemaItems = GeneralSchemaItems;
|
|
@@ -13,4 +13,15 @@ Object.keys(_OpenModeSchemaItems).forEach(function (key) {
|
|
|
13
13
|
return _OpenModeSchemaItems[key];
|
|
14
14
|
}
|
|
15
15
|
});
|
|
16
|
+
});
|
|
17
|
+
var _GeneralSchemaItems = require("./GeneralSchemaItems");
|
|
18
|
+
Object.keys(_GeneralSchemaItems).forEach(function (key) {
|
|
19
|
+
if (key === "default" || key === "__esModule") return;
|
|
20
|
+
if (key in exports && exports[key] === _GeneralSchemaItems[key]) return;
|
|
21
|
+
Object.defineProperty(exports, key, {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function get() {
|
|
24
|
+
return _GeneralSchemaItems[key];
|
|
25
|
+
}
|
|
26
|
+
});
|
|
16
27
|
});
|