@nocobase/client 0.9.2-alpha.4 → 0.9.4-alpha.1
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/DetailsBlockProvider.js +13 -1
- package/es/block-provider/FormBlockProvider.js +30 -13
- package/es/block-provider/hooks/index.d.ts +10 -0
- package/es/block-provider/hooks/index.js +521 -283
- 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 +2 -5
- package/es/collection-manager/Configuration/ConfigurationTabs.js +7 -6
- package/es/collection-manager/Configuration/EditFieldAction.js +0 -1
- package/es/collection-manager/Configuration/OverridingCollectionField.js +0 -1
- package/es/collection-manager/action-hooks.d.ts +1 -1
- package/es/collection-manager/action-hooks.js +18 -7
- package/es/collection-manager/hooks/useCollection.d.ts +1 -1
- package/es/collection-manager/hooks/useCollectionDataSource.js +4 -4
- package/es/collection-manager/interfaces/createdBy.js +1 -1
- package/es/collection-manager/interfaces/linkTo.js +3 -39
- package/es/collection-manager/interfaces/m2m.js +4 -38
- package/es/collection-manager/interfaces/m2o.js +4 -38
- package/es/collection-manager/interfaces/o2m.js +4 -68
- package/es/collection-manager/interfaces/o2o.js +25 -119
- package/es/collection-manager/interfaces/updatedBy.js +1 -1
- package/es/collection-manager/templates/expression.js +1 -1
- package/es/collection-manager/templates/tree.js +2 -2
- package/es/filter-provider/FilterProvider.js +3 -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 +19 -1
- package/es/locale/en_US.js +22 -4
- package/es/locale/es_ES.d.ts +692 -0
- package/es/locale/es_ES.js +691 -0
- package/es/locale/ja_JP.d.ts +8 -1
- package/es/locale/ja_JP.js +9 -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 +27 -1
- package/es/locale/zh_CN.js +28 -2
- 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 +10 -8
- package/es/schema-component/antd/action/Action.Drawer.js +4 -1
- package/es/schema-component/antd/action/ActionBar.js +25 -18
- package/es/schema-component/antd/association-field/AssociationFieldProvider.d.ts +2 -0
- package/es/schema-component/antd/association-field/AssociationFieldProvider.js +30 -0
- package/es/schema-component/antd/association-field/AssociationSelect.d.ts +14 -0
- package/es/schema-component/antd/association-field/AssociationSelect.js +63 -0
- package/es/schema-component/antd/association-field/Editable.d.ts +2 -0
- package/es/schema-component/antd/association-field/Editable.js +112 -0
- package/es/schema-component/antd/association-field/FileManager.d.ts +4 -0
- package/es/schema-component/antd/association-field/FileManager.js +243 -0
- package/es/schema-component/antd/association-field/InternalNester.d.ts +1 -0
- package/es/schema-component/antd/association-field/InternalNester.js +29 -0
- package/es/schema-component/antd/association-field/InternalPicker.d.ts +2 -0
- package/es/schema-component/antd/association-field/InternalPicker.js +236 -0
- package/es/schema-component/antd/association-field/InternalSubTable.d.ts +1 -0
- package/es/schema-component/antd/association-field/InternalSubTable.js +28 -0
- package/es/schema-component/antd/association-field/InternalViewer.d.ts +2 -0
- package/es/schema-component/antd/association-field/InternalViewer.js +112 -0
- package/es/schema-component/antd/association-field/Nester.d.ts +1 -0
- package/es/schema-component/antd/association-field/Nester.js +71 -0
- package/es/schema-component/antd/association-field/ReadPretty.d.ts +2 -0
- package/es/schema-component/antd/association-field/ReadPretty.js +22 -0
- package/es/schema-component/antd/association-field/SubTable.d.ts +1 -0
- package/es/schema-component/antd/association-field/SubTable.js +25 -0
- 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 +8 -0
- package/es/schema-component/antd/association-field/context.js +2 -0
- package/es/schema-component/antd/association-field/hooks.d.ts +9 -0
- package/es/schema-component/antd/association-field/hooks.js +96 -0
- package/es/schema-component/antd/association-field/index.d.ts +1 -0
- package/es/schema-component/antd/association-field/index.js +14 -0
- package/es/schema-component/antd/association-field/schema.d.ts +142 -0
- package/es/schema-component/antd/association-field/schema.js +141 -0
- package/es/schema-component/antd/association-field/util.d.ts +8 -0
- package/es/schema-component/antd/association-field/util.js +84 -0
- 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/expand-action/Expand.Action.Design.d.ts +1 -0
- package/es/schema-component/antd/expand-action/Expand.Action.Design.js +112 -0
- package/es/schema-component/antd/expand-action/Expand.Action.d.ts +1 -0
- package/es/schema-component/antd/expand-action/Expand.Action.js +40 -0
- package/es/schema-component/antd/expand-action/index.d.ts +1 -0
- package/es/schema-component/antd/expand-action/index.js +5 -0
- package/es/schema-component/antd/filter/Filter.Action.Designer.js +10 -12
- package/es/schema-component/antd/filter/FilterItem.js +1 -1
- package/es/schema-component/antd/filter/useOperators.d.ts +1 -1
- package/es/schema-component/antd/form/Form.js +4 -4
- package/es/schema-component/antd/form-item/FormItem.d.ts +2 -1
- package/es/schema-component/antd/form-item/FormItem.js +263 -168
- package/es/schema-component/antd/form-item/SchemaSettingOptions.js +39 -61
- 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 +40 -12
- package/es/schema-component/antd/form-v2/utils.js +3 -1
- package/es/schema-component/antd/gantt/components/other/tooltip.js +1 -1
- 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/index.d.ts +5 -1
- package/es/schema-component/antd/index.js +5 -1
- 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/menu/Menu.js +6 -3
- package/es/schema-component/antd/record-picker/InputRecordPicker.d.ts +1 -0
- package/es/schema-component/antd/record-picker/InputRecordPicker.js +32 -12
- package/es/schema-component/antd/remote-select/RemoteSelect.js +23 -23
- package/es/schema-component/antd/select/Select.js +2 -0
- package/es/schema-component/antd/table/Table.Void.Designer.js +1 -0
- package/es/schema-component/antd/table-v2/Table.Column.Designer.js +18 -9
- package/es/schema-component/antd/table-v2/Table.Index.d.ts +1 -0
- package/es/schema-component/antd/table-v2/Table.Index.js +6 -0
- package/es/schema-component/antd/table-v2/Table.js +9 -5
- 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/table-v2/index.js +3 -1
- package/es/schema-component/antd/table-v2/utils.js +1 -1
- package/es/schema-component/antd/variable/Input.js +11 -8
- package/es/schema-component/antd/variable/TextArea.js +2 -5
- package/es/schema-component/common/dnd-context/index.js +3 -2
- package/es/schema-component/common/sortable-item/SortableItem.js +4 -1
- package/es/schema-component/common/utils/uitls.js +1 -1
- package/es/schema-component/core/SchemaComponentProvider.js +2 -2
- package/es/schema-component/hooks/index.d.ts +1 -0
- package/es/schema-component/hooks/index.js +2 -1
- package/es/schema-component/hooks/useFieldModeOptions.d.ts +4 -0
- package/es/schema-component/hooks/useFieldModeOptions.js +105 -0
- 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 +2 -1
- package/es/schema-initializer/components/CreateRecordAction.js +55 -33
- 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/ExpandActionInitializer.d.ts +0 -1
- package/es/schema-initializer/items/ExpandActionInitializer.js +9 -34
- 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/SelectActionInitializer.d.ts +1 -0
- package/es/schema-initializer/items/SelectActionInitializer.js +65 -0
- package/es/schema-initializer/items/index.d.ts +3 -0
- package/es/schema-initializer/items/index.js +3 -0
- package/es/schema-initializer/utils.d.ts +112 -0
- package/es/schema-initializer/utils.js +224 -38
- 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/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/LinkageRules/FilterDynamicComponent.js +1 -1
- package/es/schema-settings/LinkageRules/Variables.d.ts +1 -1
- package/es/schema-settings/LinkageRules/Variables.js +7 -4
- package/es/schema-settings/SchemaSettings.d.ts +1 -1
- package/es/schema-settings/SchemaSettings.js +53 -29
- 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/user/CurrentUser.js +118 -10
- 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/DetailsBlockProvider.js +13 -1
- package/lib/block-provider/FormBlockProvider.js +31 -15
- package/lib/block-provider/hooks/index.d.ts +10 -0
- package/lib/block-provider/hooks/index.js +531 -290
- 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 +2 -5
- package/lib/collection-manager/Configuration/ConfigurationTabs.js +7 -6
- package/lib/collection-manager/Configuration/EditFieldAction.js +0 -1
- package/lib/collection-manager/Configuration/OverridingCollectionField.js +0 -1
- package/lib/collection-manager/action-hooks.d.ts +1 -1
- package/lib/collection-manager/action-hooks.js +18 -7
- package/lib/collection-manager/hooks/useCollection.d.ts +1 -1
- package/lib/collection-manager/hooks/useCollectionDataSource.js +4 -4
- package/lib/collection-manager/interfaces/createdBy.js +1 -1
- package/lib/collection-manager/interfaces/linkTo.js +2 -38
- package/lib/collection-manager/interfaces/m2m.js +3 -37
- package/lib/collection-manager/interfaces/m2o.js +3 -37
- package/lib/collection-manager/interfaces/o2m.js +6 -70
- package/lib/collection-manager/interfaces/o2o.js +30 -124
- package/lib/collection-manager/interfaces/updatedBy.js +1 -1
- package/lib/collection-manager/templates/expression.js +1 -1
- package/lib/collection-manager/templates/tree.js +2 -2
- package/lib/filter-provider/FilterProvider.js +3 -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 +19 -1
- package/lib/locale/en_US.js +22 -4
- package/lib/locale/es_ES.d.ts +692 -0
- package/lib/locale/es_ES.js +698 -0
- package/lib/locale/ja_JP.d.ts +8 -1
- package/lib/locale/ja_JP.js +9 -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 +27 -1
- package/lib/locale/zh_CN.js +28 -2
- 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 +10 -8
- package/lib/schema-component/antd/action/Action.Drawer.js +4 -1
- package/lib/schema-component/antd/action/ActionBar.js +23 -16
- package/lib/schema-component/antd/association-field/AssociationFieldProvider.d.ts +2 -0
- package/lib/schema-component/antd/association-field/AssociationFieldProvider.js +40 -0
- package/lib/schema-component/antd/association-field/AssociationSelect.d.ts +14 -0
- package/lib/schema-component/antd/association-field/AssociationSelect.js +72 -0
- package/lib/schema-component/antd/association-field/Editable.d.ts +2 -0
- package/lib/schema-component/antd/association-field/Editable.js +121 -0
- package/lib/schema-component/antd/association-field/FileManager.d.ts +4 -0
- package/lib/schema-component/antd/association-field/FileManager.js +253 -0
- package/lib/schema-component/antd/association-field/InternalNester.d.ts +1 -0
- package/lib/schema-component/antd/association-field/InternalNester.js +39 -0
- package/lib/schema-component/antd/association-field/InternalPicker.d.ts +2 -0
- package/lib/schema-component/antd/association-field/InternalPicker.js +246 -0
- package/lib/schema-component/antd/association-field/InternalSubTable.d.ts +1 -0
- package/lib/schema-component/antd/association-field/InternalSubTable.js +39 -0
- package/lib/schema-component/antd/association-field/InternalViewer.d.ts +2 -0
- package/lib/schema-component/antd/association-field/InternalViewer.js +123 -0
- package/lib/schema-component/antd/association-field/Nester.d.ts +1 -0
- package/lib/schema-component/antd/association-field/Nester.js +80 -0
- package/lib/schema-component/antd/association-field/ReadPretty.d.ts +2 -0
- package/lib/schema-component/antd/association-field/ReadPretty.js +30 -0
- package/lib/schema-component/antd/association-field/SubTable.d.ts +1 -0
- package/lib/schema-component/antd/association-field/SubTable.js +33 -0
- 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 +8 -0
- package/lib/schema-component/antd/association-field/context.js +9 -0
- package/lib/schema-component/antd/association-field/hooks.d.ts +9 -0
- package/lib/schema-component/antd/association-field/hooks.js +107 -0
- package/lib/schema-component/antd/association-field/index.d.ts +1 -0
- package/lib/schema-component/antd/association-field/index.js +21 -0
- package/lib/schema-component/antd/association-field/schema.d.ts +142 -0
- package/lib/schema-component/antd/association-field/schema.js +148 -0
- package/lib/schema-component/antd/association-field/util.d.ts +8 -0
- package/lib/schema-component/antd/association-field/util.js +98 -0
- 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/expand-action/Expand.Action.Design.d.ts +1 -0
- package/lib/schema-component/antd/expand-action/Expand.Action.Design.js +120 -0
- package/lib/schema-component/antd/expand-action/Expand.Action.d.ts +1 -0
- package/lib/schema-component/antd/expand-action/Expand.Action.js +48 -0
- package/lib/schema-component/antd/expand-action/index.d.ts +1 -0
- package/lib/schema-component/antd/expand-action/index.js +12 -0
- package/lib/schema-component/antd/filter/Filter.Action.Designer.js +10 -12
- package/lib/schema-component/antd/filter/FilterItem.js +1 -1
- package/lib/schema-component/antd/filter/useOperators.d.ts +1 -1
- package/lib/schema-component/antd/form/Form.js +4 -4
- package/lib/schema-component/antd/form-item/FormItem.d.ts +2 -1
- package/lib/schema-component/antd/form-item/FormItem.js +258 -162
- package/lib/schema-component/antd/form-item/SchemaSettingOptions.js +37 -59
- 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 +39 -11
- package/lib/schema-component/antd/form-v2/utils.js +3 -1
- package/lib/schema-component/antd/gantt/components/other/tooltip.js +1 -1
- 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/index.d.ts +5 -1
- package/lib/schema-component/antd/index.js +55 -11
- 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/menu/Menu.js +6 -3
- package/lib/schema-component/antd/record-picker/InputRecordPicker.d.ts +1 -0
- package/lib/schema-component/antd/record-picker/InputRecordPicker.js +34 -13
- package/lib/schema-component/antd/remote-select/RemoteSelect.js +22 -22
- package/lib/schema-component/antd/select/Select.js +2 -0
- package/lib/schema-component/antd/table/Table.Void.Designer.js +1 -0
- package/lib/schema-component/antd/table-v2/Table.Column.Designer.js +18 -9
- package/lib/schema-component/antd/table-v2/Table.Index.d.ts +1 -0
- package/lib/schema-component/antd/table-v2/Table.Index.js +14 -0
- package/lib/schema-component/antd/table-v2/Table.js +9 -5
- 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/table-v2/index.js +3 -1
- package/lib/schema-component/antd/table-v2/utils.js +1 -1
- package/lib/schema-component/antd/variable/Input.js +11 -8
- package/lib/schema-component/antd/variable/TextArea.js +2 -5
- package/lib/schema-component/common/dnd-context/index.js +3 -2
- package/lib/schema-component/common/sortable-item/SortableItem.js +4 -1
- package/lib/schema-component/common/utils/uitls.js +1 -1
- package/lib/schema-component/core/SchemaComponentProvider.js +2 -2
- package/lib/schema-component/hooks/index.d.ts +1 -0
- package/lib/schema-component/hooks/index.js +11 -0
- package/lib/schema-component/hooks/useFieldModeOptions.d.ts +4 -0
- package/lib/schema-component/hooks/useFieldModeOptions.js +112 -0
- 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 +2 -1
- package/lib/schema-initializer/components/CreateRecordAction.js +58 -35
- 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/ExpandActionInitializer.d.ts +0 -1
- package/lib/schema-initializer/items/ExpandActionInitializer.js +11 -37
- 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/SelectActionInitializer.d.ts +1 -0
- package/lib/schema-initializer/items/SelectActionInitializer.js +73 -0
- package/lib/schema-initializer/items/index.d.ts +3 -0
- package/lib/schema-initializer/items/index.js +33 -0
- package/lib/schema-initializer/utils.d.ts +112 -0
- package/lib/schema-initializer/utils.js +227 -39
- 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/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/LinkageRules/FilterDynamicComponent.js +1 -1
- package/lib/schema-settings/LinkageRules/Variables.d.ts +1 -1
- package/lib/schema-settings/LinkageRules/Variables.js +7 -4
- 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/user/CurrentUser.js +116 -8
- package/package.json +5 -6
- package/tsconfig.json +8 -0
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useListItemProps = exports.useListBlockContext = exports.ListBlockProvider = exports.ListBlockContext = void 0;
|
|
7
|
+
var _core = require("@formily/core");
|
|
8
|
+
var _react = require("@formily/react");
|
|
9
|
+
var _react2 = _interopRequireWildcard(require("react"));
|
|
10
|
+
var _antd = require("@formily/antd");
|
|
11
|
+
var _hooks = require("../../../block-provider/hooks");
|
|
12
|
+
var _blockProvider = require("../../../block-provider");
|
|
13
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
14
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
15
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
16
|
+
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; }
|
|
17
|
+
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; }
|
|
18
|
+
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; }
|
|
19
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
20
|
+
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); }
|
|
21
|
+
var ListBlockContext = /*#__PURE__*/(0, _react2.createContext)({});
|
|
22
|
+
exports.ListBlockContext = ListBlockContext;
|
|
23
|
+
var InternalListBlockProvider = function InternalListBlockProvider(props) {
|
|
24
|
+
var _service$data2;
|
|
25
|
+
var _useBlockRequestConte = (0, _blockProvider.useBlockRequestContext)(),
|
|
26
|
+
resource = _useBlockRequestConte.resource,
|
|
27
|
+
service = _useBlockRequestConte.service;
|
|
28
|
+
var field = (0, _react.useField)();
|
|
29
|
+
var form = (0, _react2.useMemo)(function () {
|
|
30
|
+
return (0, _core.createForm)({
|
|
31
|
+
readPretty: true
|
|
32
|
+
});
|
|
33
|
+
}, []);
|
|
34
|
+
(0, _react2.useEffect)(function () {
|
|
35
|
+
if (!(service === null || service === void 0 ? void 0 : service.loading)) {
|
|
36
|
+
var _service$data;
|
|
37
|
+
form.setValuesIn(field.address.concat('list').toString(), service === null || service === void 0 ? void 0 : (_service$data = service.data) === null || _service$data === void 0 ? void 0 : _service$data.data);
|
|
38
|
+
}
|
|
39
|
+
}, [service === null || service === void 0 ? void 0 : (_service$data2 = service.data) === null || _service$data2 === void 0 ? void 0 : _service$data2.data, service === null || service === void 0 ? void 0 : service.loading]);
|
|
40
|
+
return /*#__PURE__*/_react2.default.createElement(ListBlockContext.Provider, {
|
|
41
|
+
value: {
|
|
42
|
+
service: service,
|
|
43
|
+
resource: resource
|
|
44
|
+
}
|
|
45
|
+
}, /*#__PURE__*/_react2.default.createElement(_react.FormContext.Provider, {
|
|
46
|
+
value: form
|
|
47
|
+
}, /*#__PURE__*/_react2.default.createElement(_antd.FormLayout, {
|
|
48
|
+
layout: 'vertical'
|
|
49
|
+
}, props.children)));
|
|
50
|
+
};
|
|
51
|
+
var ListBlockProvider = function ListBlockProvider(props) {
|
|
52
|
+
var params = _objectSpread({}, props.params);
|
|
53
|
+
var collection = props.collection;
|
|
54
|
+
var _useAssociationNames = (0, _hooks.useAssociationNames)(collection),
|
|
55
|
+
appends = _useAssociationNames.appends;
|
|
56
|
+
if (!Object.keys(params).includes('appends')) {
|
|
57
|
+
params['appends'] = appends;
|
|
58
|
+
}
|
|
59
|
+
return /*#__PURE__*/_react2.default.createElement(_blockProvider.BlockProvider, _objectSpread(_objectSpread({}, props), {}, {
|
|
60
|
+
params: params
|
|
61
|
+
}), /*#__PURE__*/_react2.default.createElement(InternalListBlockProvider, _objectSpread({}, props)));
|
|
62
|
+
};
|
|
63
|
+
exports.ListBlockProvider = ListBlockProvider;
|
|
64
|
+
var useListBlockContext = function useListBlockContext() {
|
|
65
|
+
return (0, _react2.useContext)(ListBlockContext);
|
|
66
|
+
};
|
|
67
|
+
exports.useListBlockContext = useListBlockContext;
|
|
68
|
+
var useListItemProps = function useListItemProps() {
|
|
69
|
+
return {};
|
|
70
|
+
};
|
|
71
|
+
exports.useListItemProps = useListItemProps;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const ListDesigner: () => JSX.Element;
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.ListDesigner = void 0;
|
|
7
|
+
var _react = require("@formily/react");
|
|
8
|
+
var _react2 = _interopRequireDefault(require("react"));
|
|
9
|
+
var _antd = require("@formily/antd");
|
|
10
|
+
var _List = require("./List.Decorator");
|
|
11
|
+
var _lodash = _interopRequireDefault(require("lodash"));
|
|
12
|
+
var _reactI18next = require("react-i18next");
|
|
13
|
+
var _collectionManager = require("../../../collection-manager");
|
|
14
|
+
var _schemaSettings = require("../../../schema-settings");
|
|
15
|
+
var _schemaTemplates = require("../../../schema-templates");
|
|
16
|
+
var _hooks = require("../../hooks");
|
|
17
|
+
var _filter = require("../filter");
|
|
18
|
+
var _FilterDynamicComponent = require("../table-v2/FilterDynamicComponent");
|
|
19
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
20
|
+
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); }
|
|
21
|
+
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; }
|
|
22
|
+
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; }
|
|
23
|
+
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; }
|
|
24
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
25
|
+
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); }
|
|
26
|
+
var ListDesigner = function ListDesigner() {
|
|
27
|
+
var _fieldSchema$xDecora, _fieldSchema$xDecora$, _fieldSchema$xDecora2, _fieldSchema$xDecora3, _fieldSchema$xDecora4, _field$decoratorProps, _field$decoratorProps2;
|
|
28
|
+
var _useCollection = (0, _collectionManager.useCollection)(),
|
|
29
|
+
name = _useCollection.name,
|
|
30
|
+
title = _useCollection.title;
|
|
31
|
+
var template = (0, _schemaTemplates.useSchemaTemplate)();
|
|
32
|
+
var _useTranslation = (0, _reactI18next.useTranslation)(),
|
|
33
|
+
t = _useTranslation.t;
|
|
34
|
+
var fieldSchema = (0, _react.useFieldSchema)();
|
|
35
|
+
var field = (0, _react.useField)();
|
|
36
|
+
var dataSource = (0, _collectionManager.useCollectionFilterOptions)(name);
|
|
37
|
+
var _useListBlockContext = (0, _List.useListBlockContext)(),
|
|
38
|
+
service = _useListBlockContext.service;
|
|
39
|
+
var _useDesignable = (0, _hooks.useDesignable)(),
|
|
40
|
+
dn = _useDesignable.dn;
|
|
41
|
+
var sortFields = (0, _collectionManager.useSortFields)(name);
|
|
42
|
+
var defaultFilter = (fieldSchema === null || fieldSchema === void 0 ? void 0 : (_fieldSchema$xDecora = fieldSchema['x-decorator-props']) === null || _fieldSchema$xDecora === void 0 ? void 0 : (_fieldSchema$xDecora$ = _fieldSchema$xDecora.params) === null || _fieldSchema$xDecora$ === void 0 ? void 0 : _fieldSchema$xDecora$.filter) || {};
|
|
43
|
+
var defaultSort = (fieldSchema === null || fieldSchema === void 0 ? void 0 : (_fieldSchema$xDecora2 = fieldSchema['x-decorator-props']) === null || _fieldSchema$xDecora2 === void 0 ? void 0 : (_fieldSchema$xDecora3 = _fieldSchema$xDecora2.params) === null || _fieldSchema$xDecora3 === void 0 ? void 0 : _fieldSchema$xDecora3.sort) || [];
|
|
44
|
+
var defaultResource = fieldSchema === null || fieldSchema === void 0 ? void 0 : (_fieldSchema$xDecora4 = fieldSchema['x-decorator-props']) === null || _fieldSchema$xDecora4 === void 0 ? void 0 : _fieldSchema$xDecora4.resource;
|
|
45
|
+
var sort = defaultSort === null || defaultSort === void 0 ? void 0 : defaultSort.map(function (item) {
|
|
46
|
+
return item.startsWith('-') ? {
|
|
47
|
+
field: item.substring(1),
|
|
48
|
+
direction: 'desc'
|
|
49
|
+
} : {
|
|
50
|
+
field: item,
|
|
51
|
+
direction: 'asc'
|
|
52
|
+
};
|
|
53
|
+
});
|
|
54
|
+
return /*#__PURE__*/_react2.default.createElement(_schemaSettings.GeneralSchemaDesigner, {
|
|
55
|
+
template: template,
|
|
56
|
+
title: title || name
|
|
57
|
+
}, /*#__PURE__*/_react2.default.createElement(_schemaSettings.SchemaSettings.BlockTitleItem, null), /*#__PURE__*/_react2.default.createElement(_schemaSettings.SchemaSettings.ModalItem, {
|
|
58
|
+
title: t('Set the data scope'),
|
|
59
|
+
schema: {
|
|
60
|
+
type: 'object',
|
|
61
|
+
title: t('Set the data scope'),
|
|
62
|
+
properties: {
|
|
63
|
+
filter: {
|
|
64
|
+
default: defaultFilter,
|
|
65
|
+
// title: '数据范围',
|
|
66
|
+
enum: dataSource,
|
|
67
|
+
'x-component': 'Filter',
|
|
68
|
+
'x-component-props': {
|
|
69
|
+
dynamicComponent: function dynamicComponent(props) {
|
|
70
|
+
return (0, _FilterDynamicComponent.FilterDynamicComponent)(_objectSpread({}, props));
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
onSubmit: function onSubmit(_ref) {
|
|
77
|
+
var _schema;
|
|
78
|
+
var filter = _ref.filter;
|
|
79
|
+
filter = (0, _filter.removeNullCondition)(filter);
|
|
80
|
+
_lodash.default.set(fieldSchema, 'x-decorator-props.params.filter', filter);
|
|
81
|
+
field.decoratorProps.params = _objectSpread(_objectSpread({}, fieldSchema['x-decorator-props'].params), {}, {
|
|
82
|
+
page: 1
|
|
83
|
+
});
|
|
84
|
+
dn.emit('patch', {
|
|
85
|
+
schema: (_schema = {}, _defineProperty(_schema, 'x-uid', fieldSchema['x-uid']), _defineProperty(_schema, 'x-decorator-props', fieldSchema['x-decorator-props']), _schema)
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
}), /*#__PURE__*/_react2.default.createElement(_schemaSettings.SchemaSettings.ModalItem, {
|
|
89
|
+
title: t('Set default sorting rules'),
|
|
90
|
+
components: {
|
|
91
|
+
ArrayItems: _antd.ArrayItems
|
|
92
|
+
},
|
|
93
|
+
schema: {
|
|
94
|
+
type: 'object',
|
|
95
|
+
title: t('Set default sorting rules'),
|
|
96
|
+
properties: {
|
|
97
|
+
sort: {
|
|
98
|
+
type: 'array',
|
|
99
|
+
default: sort,
|
|
100
|
+
'x-component': 'ArrayItems',
|
|
101
|
+
'x-decorator': 'FormItem',
|
|
102
|
+
items: {
|
|
103
|
+
type: 'object',
|
|
104
|
+
properties: {
|
|
105
|
+
space: {
|
|
106
|
+
type: 'void',
|
|
107
|
+
'x-component': 'Space',
|
|
108
|
+
properties: {
|
|
109
|
+
sort: {
|
|
110
|
+
type: 'void',
|
|
111
|
+
'x-decorator': 'FormItem',
|
|
112
|
+
'x-component': 'ArrayItems.SortHandle'
|
|
113
|
+
},
|
|
114
|
+
field: {
|
|
115
|
+
type: 'string',
|
|
116
|
+
enum: sortFields,
|
|
117
|
+
'x-decorator': 'FormItem',
|
|
118
|
+
'x-component': 'Select',
|
|
119
|
+
'x-component-props': {
|
|
120
|
+
style: {
|
|
121
|
+
width: 260
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
},
|
|
125
|
+
direction: {
|
|
126
|
+
type: 'string',
|
|
127
|
+
'x-decorator': 'FormItem',
|
|
128
|
+
'x-component': 'Radio.Group',
|
|
129
|
+
'x-component-props': {
|
|
130
|
+
optionType: 'button'
|
|
131
|
+
},
|
|
132
|
+
enum: [{
|
|
133
|
+
label: t('ASC'),
|
|
134
|
+
value: 'asc'
|
|
135
|
+
}, {
|
|
136
|
+
label: t('DESC'),
|
|
137
|
+
value: 'desc'
|
|
138
|
+
}]
|
|
139
|
+
},
|
|
140
|
+
remove: {
|
|
141
|
+
type: 'void',
|
|
142
|
+
'x-decorator': 'FormItem',
|
|
143
|
+
'x-component': 'ArrayItems.Remove'
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
},
|
|
149
|
+
properties: {
|
|
150
|
+
add: {
|
|
151
|
+
type: 'void',
|
|
152
|
+
title: t('Add sort field'),
|
|
153
|
+
'x-component': 'ArrayItems.Addition'
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
},
|
|
159
|
+
onSubmit: function onSubmit(_ref2) {
|
|
160
|
+
var _schema2;
|
|
161
|
+
var sort = _ref2.sort;
|
|
162
|
+
var sortArr = sort.map(function (item) {
|
|
163
|
+
return item.direction === 'desc' ? "-".concat(item.field) : item.field;
|
|
164
|
+
});
|
|
165
|
+
_lodash.default.set(fieldSchema, 'x-decorator-props.params.sort', sortArr);
|
|
166
|
+
field.decoratorProps.params = _objectSpread(_objectSpread({}, fieldSchema['x-decorator-props'].params), {}, {
|
|
167
|
+
page: 1
|
|
168
|
+
});
|
|
169
|
+
dn.emit('patch', {
|
|
170
|
+
schema: (_schema2 = {}, _defineProperty(_schema2, 'x-uid', fieldSchema['x-uid']), _defineProperty(_schema2, 'x-decorator-props', fieldSchema['x-decorator-props']), _schema2)
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
}), /*#__PURE__*/_react2.default.createElement(_schemaSettings.SchemaSettings.SelectItem, {
|
|
174
|
+
title: t('Records per page'),
|
|
175
|
+
value: ((_field$decoratorProps = field.decoratorProps) === null || _field$decoratorProps === void 0 ? void 0 : (_field$decoratorProps2 = _field$decoratorProps.params) === null || _field$decoratorProps2 === void 0 ? void 0 : _field$decoratorProps2.pageSize) || 20,
|
|
176
|
+
options: [{
|
|
177
|
+
label: '10',
|
|
178
|
+
value: 10
|
|
179
|
+
}, {
|
|
180
|
+
label: '20',
|
|
181
|
+
value: 20
|
|
182
|
+
}, {
|
|
183
|
+
label: '50',
|
|
184
|
+
value: 50
|
|
185
|
+
}, {
|
|
186
|
+
label: '80',
|
|
187
|
+
value: 80
|
|
188
|
+
}, {
|
|
189
|
+
label: '100',
|
|
190
|
+
value: 100
|
|
191
|
+
}],
|
|
192
|
+
onChange: function onChange(pageSize) {
|
|
193
|
+
var _schema3;
|
|
194
|
+
_lodash.default.set(fieldSchema, 'x-decorator-props.params.pageSize', pageSize);
|
|
195
|
+
field.decoratorProps.params = _objectSpread(_objectSpread({}, fieldSchema['x-decorator-props'].params), {}, {
|
|
196
|
+
page: 1
|
|
197
|
+
});
|
|
198
|
+
dn.emit('patch', {
|
|
199
|
+
schema: (_schema3 = {}, _defineProperty(_schema3, 'x-uid', fieldSchema['x-uid']), _defineProperty(_schema3, 'x-decorator-props', fieldSchema['x-decorator-props']), _schema3)
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
}), /*#__PURE__*/_react2.default.createElement(_schemaSettings.SchemaSettings.Template, {
|
|
203
|
+
componentName: 'List',
|
|
204
|
+
collectionName: name,
|
|
205
|
+
resourceName: defaultResource
|
|
206
|
+
}), /*#__PURE__*/_react2.default.createElement(_schemaSettings.SchemaSettings.Divider, null), /*#__PURE__*/_react2.default.createElement(_schemaSettings.SchemaSettings.Remove, {
|
|
207
|
+
removeParentsIfNoChildren: true,
|
|
208
|
+
breakRemoveOn: {
|
|
209
|
+
'x-component': 'Grid'
|
|
210
|
+
}
|
|
211
|
+
}));
|
|
212
|
+
};
|
|
213
|
+
exports.ListDesigner = ListDesigner;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const ListItem: (props: any) => JSX.Element;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.ListItem = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _css = require("@emotion/css");
|
|
9
|
+
var _react2 = require("@formily/react");
|
|
10
|
+
var _recordProvider = require("../../../record-provider");
|
|
11
|
+
var _templateObject;
|
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
+
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
14
|
+
var itemCss = (0, _css.css)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n width: 100%;\n flex-direction: column;\n gap: 8px;\n padding: 12px 0;\n border-bottom: 1px solid #f0f0f0;\n"])));
|
|
15
|
+
var ListItem = function ListItem(props) {
|
|
16
|
+
var field = (0, _react2.useField)();
|
|
17
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
18
|
+
className: itemCss
|
|
19
|
+
}, /*#__PURE__*/_react.default.createElement(_recordProvider.RecordSimpleProvider, {
|
|
20
|
+
value: field.value
|
|
21
|
+
}, props.children));
|
|
22
|
+
};
|
|
23
|
+
exports.ListItem = ListItem;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ListDesigner } from './List.Designer';
|
|
2
|
+
import { ListBlockProvider } from './List.Decorator';
|
|
3
|
+
import { ListItem } from './List.Item';
|
|
4
|
+
export declare const List: ((props: any) => JSX.Element) & {
|
|
5
|
+
Item: typeof ListItem;
|
|
6
|
+
Designer: typeof ListDesigner;
|
|
7
|
+
Decorator: typeof ListBlockProvider;
|
|
8
|
+
};
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
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); }
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.List = void 0;
|
|
8
|
+
var _List = require("./List.Designer");
|
|
9
|
+
var _List2 = require("./List.Decorator");
|
|
10
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
+
var _react2 = require("@formily/react");
|
|
12
|
+
var _css = require("@emotion/css");
|
|
13
|
+
var _antd = require("antd");
|
|
14
|
+
var _hooks = require("./hooks");
|
|
15
|
+
var _common = require("../../common");
|
|
16
|
+
var _core = require("../../core");
|
|
17
|
+
var _hooks2 = require("../../hooks");
|
|
18
|
+
var _List3 = require("./List.Item");
|
|
19
|
+
var _templateObject;
|
|
20
|
+
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); }
|
|
21
|
+
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; }
|
|
22
|
+
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; }
|
|
23
|
+
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; }
|
|
24
|
+
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; }
|
|
25
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
26
|
+
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); }
|
|
27
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
28
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
29
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
30
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
31
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
32
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
33
|
+
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
34
|
+
var designerCss = (0, _css.css)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n width: 100%;\n margin-bottom: var(--nb-spacing);\n &:hover {\n > .general-schema-designer {\n display: block;\n }\n }\n\n > .general-schema-designer {\n position: absolute;\n z-index: 999;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n display: none;\n background: rgba(241, 139, 98, 0.06);\n border: 0;\n pointer-events: none;\n > .general-schema-designer-icons {\n position: absolute;\n right: 2px;\n top: 2px;\n line-height: 16px;\n pointer-events: all;\n .ant-space-item {\n background-color: #f18b62;\n color: #fff;\n line-height: 16px;\n width: 16px;\n padding-left: 1px;\n }\n }\n }\n"])));
|
|
35
|
+
var InternalList = function InternalList(props) {
|
|
36
|
+
var _service$data, _field$value;
|
|
37
|
+
var _useListBlockContext = (0, _List2.useListBlockContext)(),
|
|
38
|
+
service = _useListBlockContext.service;
|
|
39
|
+
var run = service.run,
|
|
40
|
+
params = service.params;
|
|
41
|
+
var fieldSchema = (0, _react2.useFieldSchema)();
|
|
42
|
+
var Designer = (0, _hooks2.useDesigner)();
|
|
43
|
+
var meta = service === null || service === void 0 ? void 0 : (_service$data = service.data) === null || _service$data === void 0 ? void 0 : _service$data.meta;
|
|
44
|
+
var field = (0, _react2.useField)();
|
|
45
|
+
var _useState = (0, _react.useState)(new Map()),
|
|
46
|
+
_useState2 = _slicedToArray(_useState, 1),
|
|
47
|
+
schemaMap = _useState2[0];
|
|
48
|
+
var getSchema = (0, _react.useCallback)(function (key) {
|
|
49
|
+
if (!schemaMap.has(key)) {
|
|
50
|
+
schemaMap.set(key, new _react2.Schema({
|
|
51
|
+
type: 'object',
|
|
52
|
+
properties: _defineProperty({}, key, fieldSchema.properties['item'])
|
|
53
|
+
}));
|
|
54
|
+
}
|
|
55
|
+
return schemaMap.get(key);
|
|
56
|
+
}, [fieldSchema.properties, schemaMap]);
|
|
57
|
+
var onPaginationChange = (0, _react.useCallback)(function (page, pageSize) {
|
|
58
|
+
run(_objectSpread(_objectSpread({}, params === null || params === void 0 ? void 0 : params[0]), {}, {
|
|
59
|
+
page: page,
|
|
60
|
+
pageSize: pageSize
|
|
61
|
+
}));
|
|
62
|
+
}, [run, params]);
|
|
63
|
+
return /*#__PURE__*/_react.default.createElement(_core.SchemaComponentOptions, {
|
|
64
|
+
scope: {
|
|
65
|
+
useListItemProps: _List2.useListItemProps,
|
|
66
|
+
useListActionBarProps: _hooks.useListActionBarProps
|
|
67
|
+
}
|
|
68
|
+
}, /*#__PURE__*/_react.default.createElement(_common.SortableItem, {
|
|
69
|
+
className: (0, _css.cx)('nb-list', designerCss)
|
|
70
|
+
}, /*#__PURE__*/_react.default.createElement(_antd.List, {
|
|
71
|
+
pagination: !meta || meta.count <= meta.pageSize ? false : {
|
|
72
|
+
onChange: onPaginationChange,
|
|
73
|
+
total: (meta === null || meta === void 0 ? void 0 : meta.count) || 0,
|
|
74
|
+
pageSize: (meta === null || meta === void 0 ? void 0 : meta.pageSize) || 10,
|
|
75
|
+
current: (meta === null || meta === void 0 ? void 0 : meta.page) || 1
|
|
76
|
+
},
|
|
77
|
+
loading: service === null || service === void 0 ? void 0 : service.loading
|
|
78
|
+
}, (_field$value = field.value) === null || _field$value === void 0 ? void 0 : _field$value.map(function (item, index) {
|
|
79
|
+
return /*#__PURE__*/_react.default.createElement(_react2.RecursionField, {
|
|
80
|
+
basePath: field.address,
|
|
81
|
+
key: index,
|
|
82
|
+
name: index,
|
|
83
|
+
onlyRenderProperties: true,
|
|
84
|
+
schema: getSchema(index)
|
|
85
|
+
});
|
|
86
|
+
})), /*#__PURE__*/_react.default.createElement(Designer, null)));
|
|
87
|
+
};
|
|
88
|
+
var List = InternalList;
|
|
89
|
+
exports.List = List;
|
|
90
|
+
List.Item = _List3.ListItem;
|
|
91
|
+
List.Designer = _List.ListDesigner;
|
|
92
|
+
List.Decorator = _List2.ListBlockProvider;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useListActionBarProps = void 0;
|
|
7
|
+
var spaceProps = {
|
|
8
|
+
size: ['large', 'small'],
|
|
9
|
+
wrap: true
|
|
10
|
+
};
|
|
11
|
+
var useListActionBarProps = function useListActionBarProps() {
|
|
12
|
+
return {
|
|
13
|
+
spaceProps: spaceProps
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
exports.useListActionBarProps = useListActionBarProps;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './List';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _List = require("./List");
|
|
7
|
+
Object.keys(_List).forEach(function (key) {
|
|
8
|
+
if (key === "default" || key === "__esModule") return;
|
|
9
|
+
if (key in exports && exports[key] === _List[key]) return;
|
|
10
|
+
Object.defineProperty(exports, key, {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function get() {
|
|
13
|
+
return _List[key];
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
});
|
|
@@ -241,7 +241,8 @@ Menu.Item = (0, _react.observer)(function (props) {
|
|
|
241
241
|
eventKey: schema.name,
|
|
242
242
|
schema: schema
|
|
243
243
|
}), /*#__PURE__*/_react2.default.createElement(_.SortableItem, {
|
|
244
|
-
className: designerCss
|
|
244
|
+
className: designerCss,
|
|
245
|
+
removeParentsIfNoChildren: false
|
|
245
246
|
}, /*#__PURE__*/_react2.default.createElement(_2.Icon, {
|
|
246
247
|
type: icon
|
|
247
248
|
}), /*#__PURE__*/_react2.default.createElement("span", {
|
|
@@ -263,7 +264,8 @@ Menu.URL = (0, _react.observer)(function (props) {
|
|
|
263
264
|
window.open(props.href, '_blank');
|
|
264
265
|
}
|
|
265
266
|
}), /*#__PURE__*/_react2.default.createElement(_.SortableItem, {
|
|
266
|
-
className: designerCss
|
|
267
|
+
className: designerCss,
|
|
268
|
+
removeParentsIfNoChildren: false
|
|
267
269
|
}, /*#__PURE__*/_react2.default.createElement(_2.Icon, {
|
|
268
270
|
type: icon
|
|
269
271
|
}), /*#__PURE__*/_react2.default.createElement("span", {
|
|
@@ -285,7 +287,8 @@ Menu.SubMenu = (0, _react.observer)(function (props) {
|
|
|
285
287
|
key: schema.name,
|
|
286
288
|
eventKey: schema.name,
|
|
287
289
|
title: /*#__PURE__*/_react2.default.createElement(_.SortableItem, {
|
|
288
|
-
className: subMenuDesignerCss
|
|
290
|
+
className: subMenuDesignerCss,
|
|
291
|
+
removeParentsIfNoChildren: false
|
|
289
292
|
}, /*#__PURE__*/_react2.default.createElement(_2.Icon, {
|
|
290
293
|
type: icon
|
|
291
294
|
}), field.title, /*#__PURE__*/_react2.default.createElement(Designer, null))
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
export declare const RecordPickerContext: React.Context<any>;
|
|
3
3
|
export declare const InputRecordPicker: React.FC<any>;
|
|
4
|
+
export declare const RecordPickerProvider: (props: any) => JSX.Element;
|
|
4
5
|
export declare function isShowFilePicker(labelUiSchema: any): boolean;
|
|
@@ -4,7 +4,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.RecordPickerContext = exports.InputRecordPicker = void 0;
|
|
7
|
+
exports.RecordPickerProvider = exports.RecordPickerContext = exports.InputRecordPicker = void 0;
|
|
8
8
|
exports.isShowFilePicker = isShowFilePicker;
|
|
9
9
|
var _react = require("@formily/react");
|
|
10
10
|
var _antd = require("antd");
|
|
@@ -19,7 +19,8 @@ var _preview = require("../preview");
|
|
|
19
19
|
var _useFieldNames = require("./useFieldNames");
|
|
20
20
|
var _util = require("./util");
|
|
21
21
|
var _excluded = ["onRowSelectionChange", "rowKey"],
|
|
22
|
-
_excluded2 = ["value", "multiple", "onChange", "quickUpload", "selectFile"]
|
|
22
|
+
_excluded2 = ["value", "multiple", "onChange", "quickUpload", "selectFile"],
|
|
23
|
+
_excluded3 = ["multiple", "onChange", "selectedRows", "setSelectedRows", "options", "collectionField"];
|
|
23
24
|
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); }
|
|
24
25
|
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; }
|
|
25
26
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
@@ -73,7 +74,7 @@ var useTableSelectorProps = function useTableSelectorProps() {
|
|
|
73
74
|
rowKey: rowKey,
|
|
74
75
|
rowSelection: {
|
|
75
76
|
type: multiple ? 'checkbox' : 'radio',
|
|
76
|
-
selectedRowKeys: rcSelectRows.filter(function (item) {
|
|
77
|
+
selectedRowKeys: rcSelectRows === null || rcSelectRows === void 0 ? void 0 : rcSelectRows.filter(function (item) {
|
|
77
78
|
return options.every(function (row) {
|
|
78
79
|
return row[rowKey] !== item[rowKey];
|
|
79
80
|
});
|
|
@@ -221,6 +222,7 @@ var InputRecordPicker = function InputRecordPicker(props) {
|
|
|
221
222
|
var _value = multiple ? [] : null;
|
|
222
223
|
_onChange(_value);
|
|
223
224
|
setSelectedRows(_value);
|
|
225
|
+
setOptions([]);
|
|
224
226
|
} else if (Array.isArray(changed)) {
|
|
225
227
|
if (!changed.length) {
|
|
226
228
|
_onChange([]);
|
|
@@ -250,6 +252,26 @@ var InputRecordPicker = function InputRecordPicker(props) {
|
|
|
250
252
|
}));
|
|
251
253
|
};
|
|
252
254
|
exports.InputRecordPicker = InputRecordPicker;
|
|
255
|
+
var RecordPickerProvider = function RecordPickerProvider(props) {
|
|
256
|
+
var multiple = props.multiple,
|
|
257
|
+
onChange = props.onChange,
|
|
258
|
+
selectedRows = props.selectedRows,
|
|
259
|
+
setSelectedRows = props.setSelectedRows,
|
|
260
|
+
options = props.options,
|
|
261
|
+
collectionField = props.collectionField,
|
|
262
|
+
other = _objectWithoutProperties(props, _excluded3);
|
|
263
|
+
return /*#__PURE__*/_react2.default.createElement(RecordPickerContext.Provider, {
|
|
264
|
+
value: _objectSpread({
|
|
265
|
+
multiple: multiple,
|
|
266
|
+
onChange: onChange,
|
|
267
|
+
selectedRows: selectedRows,
|
|
268
|
+
setSelectedRows: setSelectedRows,
|
|
269
|
+
options: options,
|
|
270
|
+
collectionField: collectionField
|
|
271
|
+
}, other)
|
|
272
|
+
}, props.children);
|
|
273
|
+
};
|
|
274
|
+
exports.RecordPickerProvider = RecordPickerProvider;
|
|
253
275
|
var Drawer = function Drawer(_ref) {
|
|
254
276
|
var multiple = _ref.multiple,
|
|
255
277
|
onChange = _ref.onChange,
|
|
@@ -270,16 +292,15 @@ var Drawer = function Drawer(_ref) {
|
|
|
270
292
|
} : {};
|
|
271
293
|
return filter;
|
|
272
294
|
};
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
}, /*#__PURE__*/_react2.default.createElement(_collectionManager.CollectionProvider, {
|
|
295
|
+
var recordPickerProps = {
|
|
296
|
+
multiple: multiple,
|
|
297
|
+
onChange: onChange,
|
|
298
|
+
selectedRows: selectedRows,
|
|
299
|
+
setSelectedRows: setSelectedRows,
|
|
300
|
+
options: options,
|
|
301
|
+
collectionField: collectionField
|
|
302
|
+
};
|
|
303
|
+
return /*#__PURE__*/_react2.default.createElement(RecordPickerProvider, _objectSpread({}, recordPickerProps), /*#__PURE__*/_react2.default.createElement(_collectionManager.CollectionProvider, {
|
|
283
304
|
allowNull: true,
|
|
284
305
|
name: collectionField === null || collectionField === void 0 ? void 0 : collectionField.target
|
|
285
306
|
}, /*#__PURE__*/_react2.default.createElement(_action.ActionContext.Provider, {
|