@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
|
@@ -4,13 +4,12 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.actionDesignerCss = exports.CreateRecordAction = void 0;
|
|
7
|
+
exports.actionDesignerCss = exports.CreateRecordAction = exports.CreateAction = void 0;
|
|
8
8
|
var _icons = require("@ant-design/icons");
|
|
9
9
|
var _css = require("@emotion/css");
|
|
10
10
|
var _react = require("@formily/react");
|
|
11
11
|
var _antd = require("antd");
|
|
12
12
|
var _react2 = _interopRequireWildcard(require("react"));
|
|
13
|
-
var _reactI18next = require("react-i18next");
|
|
14
13
|
var _ = require("../../");
|
|
15
14
|
var _ACLProvider = require("../../acl/ACLProvider");
|
|
16
15
|
var _collectionManager = require("../../collection-manager");
|
|
@@ -75,18 +74,60 @@ var actionAclCheck = function actionAclCheck(actionPath) {
|
|
|
75
74
|
return true;
|
|
76
75
|
};
|
|
77
76
|
var CreateRecordAction = (0, _react.observer)(function (props) {
|
|
78
|
-
var _field$data, _field$data2;
|
|
79
77
|
var _useState = (0, _react2.useState)(false),
|
|
80
78
|
_useState2 = _slicedToArray(_useState, 2),
|
|
81
79
|
visible = _useState2[0],
|
|
82
80
|
setVisible = _useState2[1];
|
|
83
81
|
var collection = (0, _collectionManager.useCollection)();
|
|
84
82
|
var fieldSchema = (0, _react.useFieldSchema)();
|
|
83
|
+
var field = (0, _react.useField)();
|
|
84
|
+
var _useState3 = (0, _react2.useState)(collection.name),
|
|
85
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
86
|
+
currentCollection = _useState4[0],
|
|
87
|
+
setCurrentCollection = _useState4[1];
|
|
88
|
+
var linkageRules = (fieldSchema === null || fieldSchema === void 0 ? void 0 : fieldSchema['x-linkage-rules']) || [];
|
|
89
|
+
var values = (0, _recordProvider.useRecord)();
|
|
90
|
+
var ctx = (0, _schemaComponent.useActionContext)();
|
|
91
|
+
(0, _react2.useEffect)(function () {
|
|
92
|
+
field.linkageProperty = {};
|
|
93
|
+
linkageRules.filter(function (k) {
|
|
94
|
+
return !k.disabled;
|
|
95
|
+
}).map(function (v) {
|
|
96
|
+
var _v$actions;
|
|
97
|
+
return (_v$actions = v.actions) === null || _v$actions === void 0 ? void 0 : _v$actions.map(function (h) {
|
|
98
|
+
(0, _utils.linkageAction)(h.operator, field, v.condition, values);
|
|
99
|
+
});
|
|
100
|
+
});
|
|
101
|
+
}, [linkageRules, values]);
|
|
102
|
+
return /*#__PURE__*/_react2.default.createElement("div", {
|
|
103
|
+
className: actionDesignerCss
|
|
104
|
+
}, /*#__PURE__*/_react2.default.createElement(_schemaComponent.ActionContext.Provider, {
|
|
105
|
+
value: _objectSpread(_objectSpread({}, ctx), {}, {
|
|
106
|
+
visible: visible,
|
|
107
|
+
setVisible: setVisible
|
|
108
|
+
})
|
|
109
|
+
}, /*#__PURE__*/_react2.default.createElement(CreateAction, _objectSpread(_objectSpread({}, props), {}, {
|
|
110
|
+
onClick: function onClick(name) {
|
|
111
|
+
setVisible(true);
|
|
112
|
+
setCurrentCollection(name);
|
|
113
|
+
}
|
|
114
|
+
})), /*#__PURE__*/_react2.default.createElement(_collectionManager.CollectionProvider, {
|
|
115
|
+
name: currentCollection
|
|
116
|
+
}, /*#__PURE__*/_react2.default.createElement(_react.RecursionField, {
|
|
117
|
+
schema: fieldSchema,
|
|
118
|
+
basePath: field.address,
|
|
119
|
+
onlyRenderProperties: true
|
|
120
|
+
}))));
|
|
121
|
+
});
|
|
122
|
+
exports.CreateRecordAction = CreateRecordAction;
|
|
123
|
+
var CreateAction = (0, _react.observer)(function (props) {
|
|
124
|
+
var _field$data, _field$data2;
|
|
125
|
+
var _onClick = props.onClick;
|
|
126
|
+
var collection = (0, _collectionManager.useCollection)();
|
|
127
|
+
var fieldSchema = (0, _react.useFieldSchema)();
|
|
85
128
|
var enableChildren = fieldSchema['x-enable-children'] || [];
|
|
86
129
|
var allowAddToCurrent = fieldSchema === null || fieldSchema === void 0 ? void 0 : fieldSchema['x-allow-add-to-current'];
|
|
87
130
|
var field = (0, _react.useField)();
|
|
88
|
-
var _useTranslation = (0, _reactI18next.useTranslation)(),
|
|
89
|
-
t = _useTranslation.t;
|
|
90
131
|
var componentType = field.componentProps.type || 'primary';
|
|
91
132
|
var _useCollectionManager = (0, _collectionManager.useCollectionManager)(),
|
|
92
133
|
getChildrenCollections = _useCollectionManager.getChildrenCollections;
|
|
@@ -107,13 +148,8 @@ var CreateRecordAction = (0, _react.observer)(function (props) {
|
|
|
107
148
|
}).filter(function (v) {
|
|
108
149
|
return v && actionAclCheck("".concat(v.name, ":create"));
|
|
109
150
|
});
|
|
110
|
-
var _useState3 = (0, _react2.useState)(collection.name),
|
|
111
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
112
|
-
currentCollection = _useState4[0],
|
|
113
|
-
setCurrentCollection = _useState4[1];
|
|
114
151
|
var linkageRules = (fieldSchema === null || fieldSchema === void 0 ? void 0 : fieldSchema['x-linkage-rules']) || [];
|
|
115
152
|
var values = (0, _recordProvider.useRecord)();
|
|
116
|
-
var ctx = (0, _schemaComponent.useActionContext)();
|
|
117
153
|
var compile = (0, _schemaComponent.useCompile)();
|
|
118
154
|
var _useDesignable = (0, _.useDesignable)(),
|
|
119
155
|
designable = _useDesignable.designable;
|
|
@@ -122,8 +158,7 @@ var CreateRecordAction = (0, _react.observer)(function (props) {
|
|
|
122
158
|
return /*#__PURE__*/_react2.default.createElement(_antd.Menu.Item, {
|
|
123
159
|
key: option.name,
|
|
124
160
|
onClick: function onClick(info) {
|
|
125
|
-
|
|
126
|
-
setCurrentCollection(option.name);
|
|
161
|
+
_onClick === null || _onClick === void 0 ? void 0 : _onClick(option.name);
|
|
127
162
|
}
|
|
128
163
|
}, compile(option.title));
|
|
129
164
|
}));
|
|
@@ -132,19 +167,14 @@ var CreateRecordAction = (0, _react.observer)(function (props) {
|
|
|
132
167
|
linkageRules.filter(function (k) {
|
|
133
168
|
return !k.disabled;
|
|
134
169
|
}).map(function (v) {
|
|
135
|
-
var _v$
|
|
136
|
-
return (_v$
|
|
170
|
+
var _v$actions2;
|
|
171
|
+
return (_v$actions2 = v.actions) === null || _v$actions2 === void 0 ? void 0 : _v$actions2.map(function (h) {
|
|
137
172
|
(0, _utils.linkageAction)(h.operator, field, v.condition, values);
|
|
138
173
|
});
|
|
139
174
|
});
|
|
140
175
|
}, [linkageRules, values]);
|
|
141
176
|
return /*#__PURE__*/_react2.default.createElement("div", {
|
|
142
177
|
className: actionDesignerCss
|
|
143
|
-
}, /*#__PURE__*/_react2.default.createElement(_schemaComponent.ActionContext.Provider, {
|
|
144
|
-
value: _objectSpread(_objectSpread({}, ctx), {}, {
|
|
145
|
-
visible: visible,
|
|
146
|
-
setVisible: setVisible
|
|
147
|
-
})
|
|
148
178
|
}, (inheritsCollections === null || inheritsCollections === void 0 ? void 0 : inheritsCollections.length) > 0 ? allowAddToCurrent === undefined || allowAddToCurrent ? /*#__PURE__*/_react2.default.createElement(_antd.Dropdown.Button, {
|
|
149
179
|
type: componentType,
|
|
150
180
|
icon: /*#__PURE__*/_react2.default.createElement(_icons.DownOutlined, null),
|
|
@@ -158,33 +188,25 @@ var CreateRecordAction = (0, _react.observer)(function (props) {
|
|
|
158
188
|
},
|
|
159
189
|
overlay: menu,
|
|
160
190
|
onClick: function onClick(info) {
|
|
161
|
-
|
|
162
|
-
setCurrentCollection(collection.name);
|
|
191
|
+
_onClick === null || _onClick === void 0 ? void 0 : _onClick(collection.name);
|
|
163
192
|
}
|
|
164
193
|
}, icon, props.children) : /*#__PURE__*/_react2.default.createElement(_antd.Dropdown, {
|
|
165
194
|
overlay: menu
|
|
166
195
|
}, /*#__PURE__*/_react2.default.createElement(_antd.Button, {
|
|
167
196
|
icon: icon,
|
|
168
|
-
type:
|
|
197
|
+
type: componentType
|
|
169
198
|
}, props.children, " ", /*#__PURE__*/_react2.default.createElement(_icons.DownOutlined, null))) : /*#__PURE__*/_react2.default.createElement(_antd.Button, {
|
|
170
199
|
type: componentType,
|
|
171
200
|
disabled: field.disabled,
|
|
172
201
|
danger: componentType === 'danger',
|
|
173
202
|
icon: icon,
|
|
174
203
|
onClick: function onClick(info) {
|
|
175
|
-
|
|
176
|
-
setCurrentCollection(collection.name);
|
|
204
|
+
_onClick === null || _onClick === void 0 ? void 0 : _onClick(collection.name);
|
|
177
205
|
},
|
|
178
206
|
style: {
|
|
179
207
|
display: !designable && (field === null || field === void 0 ? void 0 : (_field$data = field.data) === null || _field$data === void 0 ? void 0 : _field$data.hidden) && 'none',
|
|
180
208
|
opacity: designable && (field === null || field === void 0 ? void 0 : (_field$data2 = field.data) === null || _field$data2 === void 0 ? void 0 : _field$data2.hidden) && 0.1
|
|
181
209
|
}
|
|
182
|
-
}, props.children)
|
|
183
|
-
name: currentCollection
|
|
184
|
-
}, /*#__PURE__*/_react2.default.createElement(_react.RecursionField, {
|
|
185
|
-
schema: fieldSchema,
|
|
186
|
-
basePath: field.address,
|
|
187
|
-
onlyRenderProperties: true
|
|
188
|
-
}))));
|
|
210
|
+
}, props.children));
|
|
189
211
|
});
|
|
190
|
-
exports.
|
|
212
|
+
exports.CreateAction = CreateAction;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const DeletedField: () => JSX.Element;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.DeletedField = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _reactI18next = require("react-i18next");
|
|
9
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
|
+
var DeletedField = function DeletedField() {
|
|
11
|
+
var _useTranslation = (0, _reactI18next.useTranslation)(),
|
|
12
|
+
t = _useTranslation.t;
|
|
13
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
14
|
+
style: {
|
|
15
|
+
color: '#ccc'
|
|
16
|
+
}
|
|
17
|
+
}, t('The field has bee deleted'));
|
|
18
|
+
};
|
|
19
|
+
exports.DeletedField = DeletedField;
|
|
@@ -12,6 +12,7 @@ var _reactI18next = require("react-i18next");
|
|
|
12
12
|
var _blockProvider = require("../../../block-provider");
|
|
13
13
|
var _collectionManager = require("../../../collection-manager");
|
|
14
14
|
var _schemaComponent = require("../../../schema-component");
|
|
15
|
+
var _DeletedField = require("../DeletedField");
|
|
15
16
|
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); }
|
|
16
17
|
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; }
|
|
17
18
|
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); }
|
|
@@ -86,7 +87,8 @@ var InternalField = function InternalField(props) {
|
|
|
86
87
|
var CollectionField = (0, _react.connect)(function (props) {
|
|
87
88
|
var fieldSchema = (0, _react.useFieldSchema)();
|
|
88
89
|
return /*#__PURE__*/_react2.default.createElement(_collectionManager.CollectionFieldProvider, {
|
|
89
|
-
name: fieldSchema.name
|
|
90
|
+
name: fieldSchema.name,
|
|
91
|
+
fallback: /*#__PURE__*/_react2.default.createElement(_DeletedField.DeletedField, null)
|
|
90
92
|
}, /*#__PURE__*/_react2.default.createElement(InternalField, _objectSpread({}, props)));
|
|
91
93
|
});
|
|
92
94
|
var AssignedFieldValueType;
|
|
@@ -146,12 +148,12 @@ var AssignedField = function AssignedField(props) {
|
|
|
146
148
|
name: 'currentUser',
|
|
147
149
|
title: t('Current user')
|
|
148
150
|
}];
|
|
149
|
-
if (dateTimeFields.includes(collectionField.interface)) {
|
|
151
|
+
if (dateTimeFields.includes(collectionField === null || collectionField === void 0 ? void 0 : collectionField.interface)) {
|
|
150
152
|
opt.unshift({
|
|
151
153
|
name: 'currentTime',
|
|
152
154
|
title: t('Current time')
|
|
153
155
|
});
|
|
154
|
-
}
|
|
156
|
+
}
|
|
155
157
|
setOptions(compile(opt));
|
|
156
158
|
}, []);
|
|
157
159
|
(0, _react2.useEffect)(function () {
|
|
@@ -190,6 +192,34 @@ var AssignedField = function AssignedField(props) {
|
|
|
190
192
|
var userChangeHandler = function userChangeHandler(val) {
|
|
191
193
|
setUserValue(val);
|
|
192
194
|
};
|
|
195
|
+
var useFieldMemo = (0, _react2.useMemo)(function () {
|
|
196
|
+
if (!collectionField) {
|
|
197
|
+
return /*#__PURE__*/_react2.default.createElement(_DeletedField.DeletedField, null);
|
|
198
|
+
}
|
|
199
|
+
if (type === AssignedFieldValueType.ConstantValue) {
|
|
200
|
+
return /*#__PURE__*/_react2.default.createElement(CollectionField, _objectSpread(_objectSpread({}, props), {}, {
|
|
201
|
+
value: value,
|
|
202
|
+
onChange: valueChangeHandler,
|
|
203
|
+
style: {
|
|
204
|
+
minWidth: 150
|
|
205
|
+
}
|
|
206
|
+
}));
|
|
207
|
+
} else {
|
|
208
|
+
return /*#__PURE__*/_react2.default.createElement(_antd.Select, {
|
|
209
|
+
defaultValue: fieldType,
|
|
210
|
+
value: fieldType,
|
|
211
|
+
style: {
|
|
212
|
+
minWidth: 150
|
|
213
|
+
},
|
|
214
|
+
onChange: fieldTypeChangeHandler
|
|
215
|
+
}, options === null || options === void 0 ? void 0 : options.map(function (opt) {
|
|
216
|
+
return /*#__PURE__*/_react2.default.createElement(_antd.Select.Option, {
|
|
217
|
+
key: opt.name,
|
|
218
|
+
value: opt.name
|
|
219
|
+
}, opt.title);
|
|
220
|
+
}));
|
|
221
|
+
}
|
|
222
|
+
}, [collectionField, type, value, fieldType]);
|
|
193
223
|
return /*#__PURE__*/_react2.default.createElement(_antd.Space, null, /*#__PURE__*/_react2.default.createElement(_antd.Select, {
|
|
194
224
|
defaultValue: type,
|
|
195
225
|
value: type,
|
|
@@ -201,25 +231,7 @@ var AssignedField = function AssignedField(props) {
|
|
|
201
231
|
value: AssignedFieldValueType.ConstantValue
|
|
202
232
|
}, t('Constant value')), /*#__PURE__*/_react2.default.createElement(_antd.Select.Option, {
|
|
203
233
|
value: AssignedFieldValueType.DynamicValue
|
|
204
|
-
}, t('Dynamic value'))),
|
|
205
|
-
value: value,
|
|
206
|
-
onChange: valueChangeHandler,
|
|
207
|
-
style: {
|
|
208
|
-
minWidth: 150
|
|
209
|
-
}
|
|
210
|
-
})) : /*#__PURE__*/_react2.default.createElement(_antd.Select, {
|
|
211
|
-
defaultValue: fieldType,
|
|
212
|
-
value: fieldType,
|
|
213
|
-
style: {
|
|
214
|
-
minWidth: 150
|
|
215
|
-
},
|
|
216
|
-
onChange: fieldTypeChangeHandler
|
|
217
|
-
}, options === null || options === void 0 ? void 0 : options.map(function (opt) {
|
|
218
|
-
return /*#__PURE__*/_react2.default.createElement(_antd.Select.Option, {
|
|
219
|
-
key: opt.name,
|
|
220
|
-
value: opt.name
|
|
221
|
-
}, opt.title);
|
|
222
|
-
})), fieldType === 'currentRecord' && /*#__PURE__*/_react2.default.createElement(_antd.Cascader, {
|
|
234
|
+
}, t('Dynamic value'))), useFieldMemo, fieldType === 'currentRecord' && /*#__PURE__*/_react2.default.createElement(_antd.Cascader, {
|
|
223
235
|
fieldNames: {
|
|
224
236
|
label: 'title',
|
|
225
237
|
value: 'name',
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const GridCardBlockInitializer: (props: any) => JSX.Element;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.GridCardBlockInitializer = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _icons = require("@ant-design/icons");
|
|
9
|
+
var _utils = require("../utils");
|
|
10
|
+
var _DataBlockInitializer = require("./DataBlockInitializer");
|
|
11
|
+
var _collectionManager = require("../../collection-manager");
|
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
+
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); }
|
|
14
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
15
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
16
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
17
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
18
|
+
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; }
|
|
19
|
+
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; }
|
|
20
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
21
|
+
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); }
|
|
22
|
+
var GridCardBlockInitializer = function GridCardBlockInitializer(props) {
|
|
23
|
+
var insert = props.insert;
|
|
24
|
+
var _useCollectionManager = (0, _collectionManager.useCollectionManager)(),
|
|
25
|
+
getCollection = _useCollectionManager.getCollection;
|
|
26
|
+
return /*#__PURE__*/_react.default.createElement(_DataBlockInitializer.DataBlockInitializer, _objectSpread(_objectSpread({}, props), {}, {
|
|
27
|
+
icon: /*#__PURE__*/_react.default.createElement(_icons.OrderedListOutlined, null),
|
|
28
|
+
componentType: 'GridCard',
|
|
29
|
+
onCreateBlockSchema: function () {
|
|
30
|
+
var _onCreateBlockSchema = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(_ref) {
|
|
31
|
+
var item, collection, schema;
|
|
32
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
33
|
+
while (1) switch (_context.prev = _context.next) {
|
|
34
|
+
case 0:
|
|
35
|
+
item = _ref.item;
|
|
36
|
+
collection = getCollection(item.name);
|
|
37
|
+
schema = (0, _utils.createGridCardBlockSchema)({
|
|
38
|
+
collection: item.name,
|
|
39
|
+
rowKey: collection.filterTargetKey || 'id'
|
|
40
|
+
});
|
|
41
|
+
insert(schema);
|
|
42
|
+
case 4:
|
|
43
|
+
case "end":
|
|
44
|
+
return _context.stop();
|
|
45
|
+
}
|
|
46
|
+
}, _callee);
|
|
47
|
+
}));
|
|
48
|
+
function onCreateBlockSchema(_x) {
|
|
49
|
+
return _onCreateBlockSchema.apply(this, arguments);
|
|
50
|
+
}
|
|
51
|
+
return onCreateBlockSchema;
|
|
52
|
+
}()
|
|
53
|
+
}));
|
|
54
|
+
};
|
|
55
|
+
exports.GridCardBlockInitializer = GridCardBlockInitializer;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const ListBlockInitializer: (props: any) => JSX.Element;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.ListBlockInitializer = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _icons = require("@ant-design/icons");
|
|
9
|
+
var _utils = require("../utils");
|
|
10
|
+
var _DataBlockInitializer = require("./DataBlockInitializer");
|
|
11
|
+
var _collectionManager = require("../../collection-manager");
|
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
+
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); }
|
|
14
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
15
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
16
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
17
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
18
|
+
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; }
|
|
19
|
+
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; }
|
|
20
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
21
|
+
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); }
|
|
22
|
+
var ListBlockInitializer = function ListBlockInitializer(props) {
|
|
23
|
+
var insert = props.insert;
|
|
24
|
+
var _useCollectionManager = (0, _collectionManager.useCollectionManager)(),
|
|
25
|
+
getCollection = _useCollectionManager.getCollection;
|
|
26
|
+
return /*#__PURE__*/_react.default.createElement(_DataBlockInitializer.DataBlockInitializer, _objectSpread(_objectSpread({}, props), {}, {
|
|
27
|
+
icon: /*#__PURE__*/_react.default.createElement(_icons.OrderedListOutlined, null),
|
|
28
|
+
componentType: 'List',
|
|
29
|
+
onCreateBlockSchema: function () {
|
|
30
|
+
var _onCreateBlockSchema = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(_ref) {
|
|
31
|
+
var item, collection, schema;
|
|
32
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
33
|
+
while (1) switch (_context.prev = _context.next) {
|
|
34
|
+
case 0:
|
|
35
|
+
item = _ref.item;
|
|
36
|
+
collection = getCollection(item.name);
|
|
37
|
+
schema = (0, _utils.createListBlockSchema)({
|
|
38
|
+
collection: item.name,
|
|
39
|
+
rowKey: collection.filterTargetKey || 'id'
|
|
40
|
+
});
|
|
41
|
+
insert(schema);
|
|
42
|
+
case 4:
|
|
43
|
+
case "end":
|
|
44
|
+
return _context.stop();
|
|
45
|
+
}
|
|
46
|
+
}, _callee);
|
|
47
|
+
}));
|
|
48
|
+
function onCreateBlockSchema(_x) {
|
|
49
|
+
return _onCreateBlockSchema.apply(this, arguments);
|
|
50
|
+
}
|
|
51
|
+
return onCreateBlockSchema;
|
|
52
|
+
}()
|
|
53
|
+
}));
|
|
54
|
+
};
|
|
55
|
+
exports.ListBlockInitializer = ListBlockInitializer;
|
|
@@ -28,8 +28,10 @@ export * from './FilterFormBlockInitializer';
|
|
|
28
28
|
export * from './FormBlockInitializer';
|
|
29
29
|
export * from './G2PlotInitializer';
|
|
30
30
|
export * from './GanttBlockInitializer';
|
|
31
|
+
export * from './GridCardBlockInitializer';
|
|
31
32
|
export * from './InitializerWithSwitch';
|
|
32
33
|
export * from './KanbanBlockInitializer';
|
|
34
|
+
export * from './ListBlockInitializer';
|
|
33
35
|
export * from './MarkdownBlockInitializer';
|
|
34
36
|
export * from './PrintActionInitializer';
|
|
35
37
|
export * from './RecordAssociationBlockInitializer';
|
|
@@ -40,6 +42,7 @@ export * from './RecordFormBlockInitializer';
|
|
|
40
42
|
export * from './RecordReadPrettyAssociationFormBlockInitializer';
|
|
41
43
|
export * from './RecordReadPrettyFormBlockInitializer';
|
|
42
44
|
export * from './RefreshActionInitializer';
|
|
45
|
+
export * from './SelectActionInitializer';
|
|
43
46
|
export * from './SubmitActionInitializer';
|
|
44
47
|
export * from './TableActionColumnInitializer';
|
|
45
48
|
export * from './TableBlockInitializer';
|
|
@@ -48,4 +51,3 @@ export * from './TableSelectorInitializer';
|
|
|
48
51
|
export * from './UpdateActionInitializer';
|
|
49
52
|
export * from './UpdateSubmitActionInitializer';
|
|
50
53
|
export * from './ViewActionInitializer';
|
|
51
|
-
export * from './SelectActionInitializer';
|
|
@@ -333,6 +333,17 @@ Object.keys(_GanttBlockInitializer).forEach(function (key) {
|
|
|
333
333
|
}
|
|
334
334
|
});
|
|
335
335
|
});
|
|
336
|
+
var _GridCardBlockInitializer = require("./GridCardBlockInitializer");
|
|
337
|
+
Object.keys(_GridCardBlockInitializer).forEach(function (key) {
|
|
338
|
+
if (key === "default" || key === "__esModule") return;
|
|
339
|
+
if (key in exports && exports[key] === _GridCardBlockInitializer[key]) return;
|
|
340
|
+
Object.defineProperty(exports, key, {
|
|
341
|
+
enumerable: true,
|
|
342
|
+
get: function get() {
|
|
343
|
+
return _GridCardBlockInitializer[key];
|
|
344
|
+
}
|
|
345
|
+
});
|
|
346
|
+
});
|
|
336
347
|
var _InitializerWithSwitch = require("./InitializerWithSwitch");
|
|
337
348
|
Object.keys(_InitializerWithSwitch).forEach(function (key) {
|
|
338
349
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -355,6 +366,17 @@ Object.keys(_KanbanBlockInitializer).forEach(function (key) {
|
|
|
355
366
|
}
|
|
356
367
|
});
|
|
357
368
|
});
|
|
369
|
+
var _ListBlockInitializer = require("./ListBlockInitializer");
|
|
370
|
+
Object.keys(_ListBlockInitializer).forEach(function (key) {
|
|
371
|
+
if (key === "default" || key === "__esModule") return;
|
|
372
|
+
if (key in exports && exports[key] === _ListBlockInitializer[key]) return;
|
|
373
|
+
Object.defineProperty(exports, key, {
|
|
374
|
+
enumerable: true,
|
|
375
|
+
get: function get() {
|
|
376
|
+
return _ListBlockInitializer[key];
|
|
377
|
+
}
|
|
378
|
+
});
|
|
379
|
+
});
|
|
358
380
|
var _MarkdownBlockInitializer = require("./MarkdownBlockInitializer");
|
|
359
381
|
Object.keys(_MarkdownBlockInitializer).forEach(function (key) {
|
|
360
382
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -465,6 +487,17 @@ Object.keys(_RefreshActionInitializer).forEach(function (key) {
|
|
|
465
487
|
}
|
|
466
488
|
});
|
|
467
489
|
});
|
|
490
|
+
var _SelectActionInitializer = require("./SelectActionInitializer");
|
|
491
|
+
Object.keys(_SelectActionInitializer).forEach(function (key) {
|
|
492
|
+
if (key === "default" || key === "__esModule") return;
|
|
493
|
+
if (key in exports && exports[key] === _SelectActionInitializer[key]) return;
|
|
494
|
+
Object.defineProperty(exports, key, {
|
|
495
|
+
enumerable: true,
|
|
496
|
+
get: function get() {
|
|
497
|
+
return _SelectActionInitializer[key];
|
|
498
|
+
}
|
|
499
|
+
});
|
|
500
|
+
});
|
|
468
501
|
var _SubmitActionInitializer = require("./SubmitActionInitializer");
|
|
469
502
|
Object.keys(_SubmitActionInitializer).forEach(function (key) {
|
|
470
503
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -552,15 +585,4 @@ Object.keys(_ViewActionInitializer).forEach(function (key) {
|
|
|
552
585
|
return _ViewActionInitializer[key];
|
|
553
586
|
}
|
|
554
587
|
});
|
|
555
|
-
});
|
|
556
|
-
var _SelectActionInitializer = require("./SelectActionInitializer");
|
|
557
|
-
Object.keys(_SelectActionInitializer).forEach(function (key) {
|
|
558
|
-
if (key === "default" || key === "__esModule") return;
|
|
559
|
-
if (key in exports && exports[key] === _SelectActionInitializer[key]) return;
|
|
560
|
-
Object.defineProperty(exports, key, {
|
|
561
|
-
enumerable: true,
|
|
562
|
-
get: function get() {
|
|
563
|
-
return _SelectActionInitializer[key];
|
|
564
|
-
}
|
|
565
|
-
});
|
|
566
588
|
});
|