amis 1.4.1 → 1.4.2-beta.13
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/README.md +1 -1
- package/lib/Schema.d.ts +26 -2
- package/lib/Schema.js.map +1 -1
- package/lib/components/Alert.js +3 -1
- package/lib/components/Alert.js.map +2 -2
- package/lib/components/AnchorNav.d.ts +22 -21
- package/lib/components/AnchorNav.js +7 -3
- package/lib/components/AnchorNav.js.map +2 -2
- package/lib/components/ArrayInput.d.ts +84 -84
- package/lib/components/AssociatedSelection.d.ts +930 -0
- package/lib/components/AssociatedSelection.js +89 -0
- package/lib/components/AssociatedSelection.js.map +13 -0
- package/lib/components/Badge.d.ts +2 -2
- package/lib/components/Badge.js +13 -7
- package/lib/components/Badge.js.map +2 -2
- package/lib/components/{ChainedCheckboxes.d.ts → ChainedSelection.d.ts} +267 -98
- package/lib/components/{ChainedCheckboxes.js → ChainedSelection.js} +30 -24
- package/lib/components/ChainedSelection.js.map +13 -0
- package/lib/components/Collapse.js +1 -1
- package/lib/components/Collapse.js.map +2 -2
- package/lib/components/ColorPicker.d.ts +84 -84
- package/lib/components/DatePicker.d.ts +84 -84
- package/lib/components/DatePicker.js +1 -1
- package/lib/components/DatePicker.js.map +2 -2
- package/lib/components/DateRangePicker.d.ts +84 -84
- package/lib/components/DateRangePicker.js +1 -1
- package/lib/components/DateRangePicker.js.map +2 -2
- package/lib/components/Editor.d.ts +84 -84
- package/lib/components/GroupedSelection.d.ts +907 -0
- package/lib/components/GroupedSelection.js +48 -0
- package/lib/components/GroupedSelection.js.map +13 -0
- package/lib/components/InputBox.d.ts +22 -21
- package/lib/components/InputBox.js +11 -3
- package/lib/components/InputBox.js.map +2 -2
- package/lib/components/Link.d.ts +84 -0
- package/lib/components/Link.js +43 -0
- package/lib/components/Link.js.map +13 -0
- package/lib/components/ListGroup.d.ts +21 -21
- package/lib/components/ModalManager.js +1 -1
- package/lib/components/ModalManager.js.map +2 -2
- package/lib/components/MonthRangePicker.d.ts +84 -84
- package/lib/components/MonthRangePicker.js +1 -1
- package/lib/components/MonthRangePicker.js.map +2 -2
- package/lib/components/NumberInput.d.ts +20 -20
- package/lib/components/PickerColumn.d.ts +514 -0
- package/lib/components/PickerColumn.js +279 -0
- package/lib/components/PickerColumn.js.map +13 -0
- package/lib/components/PickerContainer.d.ts +513 -0
- package/lib/components/PickerContainer.js +96 -0
- package/lib/components/PickerContainer.js.map +13 -0
- package/lib/components/Radios.d.ts +22 -21
- package/lib/components/Radios.js +1 -0
- package/lib/components/Radios.js.map +2 -2
- package/lib/components/Rating.d.ts +21 -21
- package/lib/components/ResultBox.d.ts +84 -84
- package/lib/components/ResultBox.js +10 -2
- package/lib/components/ResultBox.js.map +2 -2
- package/lib/components/RichText.js +17 -53
- package/lib/components/RichText.js.map +2 -2
- package/lib/components/SearchBox.d.ts +84 -84
- package/lib/components/SearchBox.js +4 -4
- package/lib/components/SearchBox.js.map +2 -2
- package/lib/components/Select.d.ts +245 -237
- package/lib/components/Select.js +28 -4
- package/lib/components/Select.js.map +2 -2
- package/lib/components/{Checkboxes.d.ts → Selection.d.ts} +273 -98
- package/lib/components/Selection.js +134 -0
- package/lib/components/Selection.js.map +13 -0
- package/lib/components/SparkLine.d.ts +85 -84
- package/lib/components/SparkLine.js +2 -2
- package/lib/components/SparkLine.js.map +2 -2
- package/lib/components/{TableCheckboxes.d.ts → TableSelection.d.ts} +266 -96
- package/lib/components/{TableCheckboxes.js → TableSelection.js} +30 -30
- package/lib/components/TableSelection.js.map +13 -0
- package/lib/components/Tabs.d.ts +20 -20
- package/lib/components/TabsTransfer.d.ts +84 -84
- package/lib/components/TabsTransfer.js +9 -9
- package/lib/components/TabsTransfer.js.map +2 -2
- package/lib/components/TabsTransferPicker.d.ts +489 -0
- package/lib/components/TabsTransferPicker.js +60 -0
- package/lib/components/TabsTransferPicker.js.map +13 -0
- package/lib/components/Toast.js +2 -2
- package/lib/components/Toast.js.map +2 -2
- package/lib/components/Transfer.d.ts +908 -274
- package/lib/components/Transfer.js +31 -24
- package/lib/components/Transfer.js.map +2 -2
- package/lib/components/TransferDropDown.d.ts +488 -0
- package/lib/components/TransferDropDown.js +59 -0
- package/lib/components/TransferDropDown.js.map +13 -0
- package/lib/components/TransferPicker.d.ts +493 -0
- package/lib/components/TransferPicker.js +60 -0
- package/lib/components/TransferPicker.js.map +13 -0
- package/lib/components/Tree.d.ts +84 -84
- package/lib/components/Tree.js +5 -3
- package/lib/components/Tree.js.map +2 -2
- package/lib/components/{TreeCheckboxes.d.ts → TreeSelection.d.ts} +269 -99
- package/lib/components/{TreeCheckboxes.js → TreeSelection.js} +36 -32
- package/lib/components/TreeSelection.js.map +13 -0
- package/lib/components/WithRemoteConfig.js +1 -1
- package/lib/components/WithRemoteConfig.js.map +2 -2
- package/lib/components/condition-builder/Field.js +5 -2
- package/lib/components/condition-builder/Field.js.map +2 -2
- package/lib/components/condition-builder/Func.js +2 -2
- package/lib/components/condition-builder/Func.js.map +2 -2
- package/lib/components/condition-builder/InputSwitch.js +2 -2
- package/lib/components/condition-builder/InputSwitch.js.map +2 -2
- package/lib/components/condition-builder/Item.js +3 -3
- package/lib/components/condition-builder/Item.js.map +2 -2
- package/lib/components/icons.js +14 -0
- package/lib/components/icons.js.map +2 -2
- package/lib/components/index.d.ts +8 -8
- package/lib/components/index.js +16 -16
- package/lib/components/index.js.map +2 -2
- package/lib/envOverwrite.js.map +2 -2
- package/lib/factory.d.ts +4 -0
- package/lib/factory.js +4 -2
- package/lib/factory.js.map +2 -2
- package/lib/helper.css.map +1 -1
- package/lib/hooks/index.d.ts +5 -0
- package/lib/hooks/index.js +14 -0
- package/lib/hooks/index.js.map +13 -0
- package/lib/hooks/use-set-state.d.ts +2 -0
- package/lib/hooks/use-set-state.js +15 -0
- package/lib/hooks/use-set-state.js.map +13 -0
- package/lib/hooks/use-touch.d.ts +16 -0
- package/lib/hooks/use-touch.js +73 -0
- package/lib/hooks/use-touch.js.map +13 -0
- package/lib/hooks/use-update-effect.d.ts +3 -0
- package/lib/hooks/use-update-effect.js +17 -0
- package/lib/hooks/use-update-effect.js.map +13 -0
- package/lib/icons/clock.js +10 -0
- package/lib/icons/download.js +7 -0
- package/lib/icons/status-close.js +11 -0
- package/lib/icons/status-fail.js +11 -0
- package/lib/icons/status-info.js +10 -0
- package/lib/icons/status-success.js +11 -0
- package/lib/icons/status-warning.js +10 -0
- package/lib/index.d.ts +3 -0
- package/lib/index.js +4 -1
- package/lib/index.js.map +2 -2
- package/lib/locale/de-DE.js +4 -0
- package/lib/locale/de-DE.js.map +2 -2
- package/lib/locale/en-US.js +5 -0
- package/lib/locale/en-US.js.map +2 -2
- package/lib/locale/zh-CN.js +8 -3
- package/lib/locale/zh-CN.js.map +2 -2
- package/lib/renderers/Action.d.ts +8 -0
- package/lib/renderers/Action.js +17 -4
- package/lib/renderers/Action.js.map +2 -2
- package/lib/renderers/AnchorNav.d.ts +1 -0
- package/lib/renderers/AnchorNav.js +2 -2
- package/lib/renderers/AnchorNav.js.map +2 -2
- package/lib/renderers/Avatar.js +3 -3
- package/lib/renderers/Avatar.js.map +2 -2
- package/lib/renderers/Breadcrumb.js +1 -1
- package/lib/renderers/Breadcrumb.js.map +2 -2
- package/lib/renderers/CRUD.d.ts +9 -0
- package/lib/renderers/CRUD.js +43 -8
- package/lib/renderers/CRUD.js.map +2 -2
- package/lib/renderers/Card.d.ts +4 -0
- package/lib/renderers/Card.js +29 -23
- package/lib/renderers/Card.js.map +2 -2
- package/lib/renderers/Chart.js +1 -1
- package/lib/renderers/Chart.js.map +2 -2
- package/lib/renderers/Collapse.js +3 -2
- package/lib/renderers/Collapse.js.map +2 -2
- package/lib/renderers/Dialog.js +0 -3
- package/lib/renderers/Dialog.js.map +2 -2
- package/lib/renderers/Drawer.js +0 -3
- package/lib/renderers/Drawer.js.map +2 -2
- package/lib/renderers/DropDownButton.d.ts +5 -1
- package/lib/renderers/DropDownButton.js +8 -6
- package/lib/renderers/DropDownButton.js.map +2 -2
- package/lib/renderers/Form/Checkbox.d.ts +5 -0
- package/lib/renderers/Form/Checkbox.js +4 -0
- package/lib/renderers/Form/Checkbox.js.map +2 -2
- package/lib/renderers/Form/Combo.js +2 -2
- package/lib/renderers/Form/Combo.js.map +2 -2
- package/lib/renderers/Form/DiffEditor.d.ts +4 -3
- package/lib/renderers/Form/Editor.d.ts +3 -2
- package/lib/renderers/Form/InputCity.d.ts +84 -84
- package/lib/renderers/Form/InputCity.js +7 -6
- package/lib/renderers/Form/InputCity.js.map +2 -2
- package/lib/renderers/Form/InputColor.d.ts +84 -84
- package/lib/renderers/Form/InputFile.d.ts +6 -0
- package/lib/renderers/Form/InputFile.js +30 -10
- package/lib/renderers/Form/InputFile.js.map +2 -2
- package/lib/renderers/Form/InputImage.js +16 -7
- package/lib/renderers/Form/InputImage.js.map +2 -2
- package/lib/renderers/Form/Item.d.ts +1 -1
- package/lib/renderers/Form/Item.js.map +1 -1
- package/lib/renderers/Form/Options.js +19 -6
- package/lib/renderers/Form/Options.js.map +2 -2
- package/lib/renderers/Form/Picker.js +2 -2
- package/lib/renderers/Form/Picker.js.map +2 -2
- package/lib/renderers/Form/Select.d.ts +42 -4
- package/lib/renderers/Form/Select.js +37 -3
- package/lib/renderers/Form/Select.js.map +2 -2
- package/lib/renderers/Form/TabsTransferPicker.d.ts +48 -0
- package/lib/renderers/Form/TabsTransferPicker.js +29 -0
- package/lib/renderers/Form/TabsTransferPicker.js.map +13 -0
- package/lib/renderers/Form/Transfer.js +18 -3
- package/lib/renderers/Form/Transfer.js.map +2 -2
- package/lib/renderers/Form/TransferPicker.d.ts +52 -0
- package/lib/renderers/Form/TransferPicker.js +43 -0
- package/lib/renderers/Form/TransferPicker.js.map +13 -0
- package/lib/renderers/Form/TreeSelect.js +2 -2
- package/lib/renderers/Form/TreeSelect.js.map +2 -2
- package/lib/renderers/Form/index.d.ts +5 -0
- package/lib/renderers/Form/index.js +5 -3
- package/lib/renderers/Form/index.js.map +2 -2
- package/lib/renderers/Form/wrapControl.js +15 -3
- package/lib/renderers/Form/wrapControl.js.map +2 -2
- package/lib/renderers/IFrame.js +3 -5
- package/lib/renderers/IFrame.js.map +2 -2
- package/lib/renderers/Image.d.ts +1 -0
- package/lib/renderers/Image.js +15 -1
- package/lib/renderers/Image.js.map +2 -2
- package/lib/renderers/Json.d.ts +4 -0
- package/lib/renderers/Json.js +4 -13
- package/lib/renderers/Json.js.map +2 -2
- package/lib/renderers/Link.d.ts +18 -3
- package/lib/renderers/Link.js +27 -15
- package/lib/renderers/Link.js.map +2 -2
- package/lib/renderers/List.js +1 -1
- package/lib/renderers/List.js.map +2 -2
- package/lib/renderers/Log.d.ts +2 -2
- package/lib/renderers/Log.js +7 -1
- package/lib/renderers/Log.js.map +2 -2
- package/lib/renderers/Mapping.d.ts +9 -2
- package/lib/renderers/Mapping.js +18 -6
- package/lib/renderers/Mapping.js.map +2 -2
- package/lib/renderers/Nav.d.ts +62 -36
- package/lib/renderers/Nav.js +272 -96
- package/lib/renderers/Nav.js.map +2 -2
- package/lib/renderers/Portlet.d.ts +125 -0
- package/lib/renderers/Portlet.js +156 -0
- package/lib/renderers/Portlet.js.map +13 -0
- package/lib/renderers/Property.js +2 -1
- package/lib/renderers/Property.js.map +2 -2
- package/lib/renderers/SearchBox.d.ts +6 -1
- package/lib/renderers/SearchBox.js +19 -5
- package/lib/renderers/SearchBox.js.map +2 -2
- package/lib/renderers/SparkLine.d.ts +4 -0
- package/lib/renderers/SparkLine.js.map +2 -2
- package/lib/renderers/Table/ColumnToggler.d.ts +113 -0
- package/lib/renderers/Table/ColumnToggler.js +216 -0
- package/lib/renderers/Table/ColumnToggler.js.map +13 -0
- package/lib/renderers/Table/ItemActionsWrapper.d.ts +11 -0
- package/lib/renderers/Table/ItemActionsWrapper.js +31 -0
- package/lib/renderers/Table/ItemActionsWrapper.js.map +13 -0
- package/lib/renderers/Table/TableBody.d.ts +4 -0
- package/lib/renderers/Table/TableCell.js +3 -1
- package/lib/renderers/Table/TableCell.js.map +2 -2
- package/lib/renderers/Table/TableContent.d.ts +4 -1
- package/lib/renderers/Table/TableContent.js +21 -1
- package/lib/renderers/Table/TableContent.js.map +2 -2
- package/lib/renderers/Table/index.d.ts +19 -2
- package/lib/renderers/Table/index.js +172 -57
- package/lib/renderers/Table/index.js.map +2 -2
- package/lib/renderers/Tabs.js +9 -1
- package/lib/renderers/Tabs.js.map +2 -2
- package/lib/renderers/WebComponent.js +1 -1
- package/lib/renderers/WebComponent.js.map +2 -2
- package/lib/store/combo.d.ts +2 -16
- package/lib/store/crud.js +3 -7
- package/lib/store/crud.js.map +2 -2
- package/lib/store/form.d.ts +1 -1
- package/lib/store/form.js +5 -6
- package/lib/store/form.js.map +2 -2
- package/lib/store/service.js +5 -4
- package/lib/store/service.js.map +2 -2
- package/lib/store/table.d.ts +260 -3
- package/lib/store/table.js +69 -11
- package/lib/store/table.js.map +2 -2
- package/lib/themes/ang-ie11.css +888 -238
- package/lib/themes/ang.css +888 -238
- package/lib/themes/ang.css.map +1 -1
- package/lib/themes/antd-ie11.css +888 -238
- package/lib/themes/antd.css +888 -238
- package/lib/themes/antd.css.map +1 -1
- package/lib/themes/cxd-ie11.css +1446 -457
- package/lib/themes/cxd.css +1446 -457
- package/lib/themes/cxd.css.map +1 -1
- package/lib/themes/dark-ie11.css +888 -238
- package/lib/themes/dark.css +888 -238
- package/lib/themes/dark.css.map +1 -1
- package/lib/themes/default.css +1446 -457
- package/lib/themes/default.css.map +1 -1
- package/lib/types.d.ts +37 -0
- package/lib/types.js +0 -5
- package/lib/types.js.map +2 -2
- package/lib/utils/api.d.ts +3 -2
- package/lib/utils/api.js +31 -15
- package/lib/utils/api.js.map +2 -2
- package/lib/utils/dom.d.ts +4 -0
- package/lib/utils/dom.js +11 -1
- package/lib/utils/dom.js.map +2 -2
- package/lib/utils/handleAction.d.ts +7 -0
- package/lib/utils/handleAction.js +30 -0
- package/lib/utils/handleAction.js.map +13 -0
- package/lib/utils/helper.d.ts +3 -1
- package/lib/utils/helper.js +14 -5
- package/lib/utils/helper.js.map +2 -2
- package/lib/utils/icon.js +3 -0
- package/lib/utils/icon.js.map +2 -2
- package/lib/utils/tpl-builtin.d.ts +1 -1
- package/lib/utils/tpl-builtin.js +25 -15
- package/lib/utils/tpl-builtin.js.map +2 -2
- package/package.json +1 -1
- package/schema.json +3341 -998
- package/scss/_mixins.scss +1 -3
- package/scss/_properties.scss +63 -4
- package/scss/_utilities.scss +4 -0
- package/scss/base/_common.scss +3 -0
- package/scss/base/_normalize.scss +2 -0
- package/scss/components/_anchor-nav.scss +88 -29
- package/scss/components/_button.scss +4 -5
- package/scss/components/_card.scss +8 -14
- package/scss/components/_collapse.scss +41 -8
- package/scss/components/_column-toggler.scss +234 -0
- package/scss/components/_dropdown.scss +2 -1
- package/scss/components/_images.scss +2 -1
- package/scss/components/_input-box.scss +1 -0
- package/scss/components/_link.scss +6 -0
- package/scss/components/_mapping.scss +6 -0
- package/scss/components/_nav.scss +231 -223
- package/scss/components/_page.scss +5 -4
- package/scss/components/_picker-columns.scss +124 -0
- package/scss/components/_popover.scss +13 -0
- package/scss/components/_portlet.scss +51 -0
- package/scss/components/_progress.scss +2 -0
- package/scss/components/_result-box.scss +1 -0
- package/scss/components/_status.scss +1 -1
- package/scss/components/_steps.scss +1 -1
- package/scss/components/_table.scss +51 -1
- package/scss/components/form/_checks.scss +0 -351
- package/scss/components/form/_color.scss +1 -0
- package/scss/components/form/_date-range.scss +2 -0
- package/scss/components/form/_date.scss +2 -0
- package/scss/components/form/_fieldset.scss +6 -3
- package/scss/components/form/_file.scss +16 -4
- package/scss/components/form/_form.scss +48 -0
- package/scss/components/form/_image.scss +7 -2
- package/scss/components/form/_list.scss +1 -0
- package/scss/components/form/_location.scss +1 -1
- package/scss/components/form/_selection.scss +354 -0
- package/scss/components/form/_text.scss +13 -0
- package/scss/components/form/_textarea.scss +10 -0
- package/scss/components/form/_transfer.scss +77 -18
- package/scss/themes/_common.scss +7 -0
- package/scss/themes/_cxd-colors.scss +56 -0
- package/scss/themes/_cxd-variables.scss +217 -89
- package/scss/themes/cxd.scss +370 -0
- package/sdk/ang-ie11.css +1117 -392
- package/sdk/ang.css +1110 -342
- package/sdk/antd-ie11.css +1105 -380
- package/sdk/antd.css +1110 -342
- package/sdk/charts.js +13 -13
- package/sdk/color-picker.js +65 -69
- package/sdk/cropperjs.js +2 -2
- package/sdk/cxd-ie11.css +2086 -1062
- package/sdk/cxd.css +1643 -495
- package/sdk/dark-ie11.css +1117 -392
- package/sdk/dark.css +1110 -342
- package/sdk/exceljs.js +1 -1
- package/sdk/helper.css.map +1 -1
- package/sdk/iconfont.svg +2513 -0
- package/sdk/iconfont.ttf +0 -0
- package/sdk/iconfont.woff +0 -0
- package/sdk/ie11-patch.css +1 -0
- package/sdk/locale/de-DE.js +4 -0
- package/sdk/markdown.js +69 -69
- package/sdk/papaparse.js +1 -1
- package/sdk/renderers/Form/CityDB.js +1 -1
- package/sdk/rest.js +20 -28
- package/sdk/rich-text.js +62 -62
- package/sdk/sdk-ie11.css +2086 -1062
- package/sdk/sdk.css +1643 -495
- package/sdk/sdk.js +1219 -1165
- package/sdk/thirds/hls.js/hls.js +1 -1
- package/sdk/thirds/mpegts.js/mpegts.js +1 -1
- package/sdk/tinymce.js +57 -57
- package/src/Schema.ts +32 -0
- package/src/components/Alert.tsx +3 -1
- package/src/components/AnchorNav.tsx +15 -4
- package/src/components/{AssociatedCheckboxes.tsx → AssociatedSelection.tsx} +41 -37
- package/src/components/Badge.tsx +38 -26
- package/src/components/{ChainedCheckboxes.tsx → ChainedSelection.tsx} +57 -40
- package/src/components/Collapse.tsx +14 -9
- package/src/components/DatePicker.tsx +1 -1
- package/src/components/DateRangePicker.tsx +23 -11
- package/src/components/{ListCheckboxes.tsx → GroupedSelection.tsx} +26 -21
- package/src/components/InputBox.tsx +11 -10
- package/src/components/Link.tsx +85 -0
- package/src/components/ModalManager.ts +1 -1
- package/src/components/MonthRangePicker.tsx +10 -2
- package/src/components/PickerColumn.tsx +429 -0
- package/src/components/PickerContainer.tsx +128 -0
- package/src/components/Radios.tsx +3 -8
- package/src/components/ResultBox.tsx +9 -9
- package/src/components/RichText.tsx +17 -57
- package/src/components/SearchBox.tsx +4 -5
- package/src/components/Select.tsx +60 -5
- package/src/components/{Checkboxes.tsx → Selection.tsx} +75 -21
- package/src/components/SparkLine.tsx +4 -1
- package/src/components/{TableCheckboxes.tsx → TableSelection.tsx} +46 -25
- package/src/components/TabsTransfer.tsx +13 -7
- package/src/components/TabsTransferPicker.tsx +85 -0
- package/src/components/Toast.tsx +5 -5
- package/src/components/Transfer.tsx +71 -50
- package/src/components/TransferDropDown.tsx +120 -0
- package/src/components/TransferPicker.tsx +91 -0
- package/src/components/Tree.tsx +6 -8
- package/src/components/{TreeCheckboxes.tsx → TreeSelection.tsx} +33 -26
- package/src/components/WithRemoteConfig.tsx +7 -2
- package/src/components/condition-builder/Field.tsx +5 -5
- package/src/components/condition-builder/Func.tsx +3 -3
- package/src/components/condition-builder/InputSwitch.tsx +3 -3
- package/src/components/condition-builder/Item.tsx +5 -12
- package/src/components/icons.tsx +15 -0
- package/src/components/index.tsx +13 -13
- package/src/envOverwrite.ts +0 -1
- package/src/factory.tsx +18 -3
- package/src/hooks/index.ts +5 -0
- package/src/hooks/use-set-state.ts +19 -0
- package/src/hooks/use-touch.ts +100 -0
- package/src/hooks/use-update-effect.ts +16 -0
- package/src/icons/clock.svg +1 -0
- package/src/icons/download.svg +4 -0
- package/src/icons/status-close.svg +10 -0
- package/src/icons/status-fail.svg +10 -0
- package/src/icons/status-info.svg +8 -0
- package/src/icons/status-success.svg +10 -0
- package/src/icons/status-warning.svg +8 -0
- package/src/index.tsx +3 -0
- package/src/locale/de-DE.ts +4 -0
- package/src/locale/en-US.ts +5 -0
- package/src/locale/zh-CN.ts +8 -3
- package/src/renderers/Action.tsx +33 -2
- package/src/renderers/AnchorNav.tsx +4 -0
- package/src/renderers/Avatar.tsx +8 -4
- package/src/renderers/Breadcrumb.tsx +5 -1
- package/src/renderers/CRUD.tsx +63 -28
- package/src/renderers/Card.tsx +63 -34
- package/src/renderers/Chart.tsx +6 -2
- package/src/renderers/Collapse.tsx +4 -2
- package/src/renderers/Dialog.tsx +0 -4
- package/src/renderers/Drawer.tsx +0 -4
- package/src/renderers/DropDownButton.tsx +18 -13
- package/src/renderers/Form/Checkbox.tsx +8 -0
- package/src/renderers/Form/Combo.tsx +2 -3
- package/src/renderers/Form/InputCity.tsx +4 -8
- package/src/renderers/Form/InputFile.tsx +66 -24
- package/src/renderers/Form/InputImage.tsx +16 -5
- package/src/renderers/Form/Item.tsx +3 -2
- package/src/renderers/Form/Options.tsx +32 -7
- package/src/renderers/Form/Picker.tsx +3 -2
- package/src/renderers/Form/Select.tsx +162 -21
- package/src/renderers/Form/TabsTransferPicker.tsx +123 -0
- package/src/renderers/Form/Transfer.tsx +19 -4
- package/src/renderers/Form/TransferPicker.tsx +145 -0
- package/src/renderers/Form/TreeSelect.tsx +25 -0
- package/src/renderers/Form/index.tsx +15 -2
- package/src/renderers/Form/wrapControl.tsx +28 -3
- package/src/renderers/IFrame.tsx +4 -5
- package/src/renderers/Image.tsx +10 -0
- package/src/renderers/Json.tsx +9 -9
- package/src/renderers/Link.tsx +53 -14
- package/src/renderers/List.tsx +1 -1
- package/src/renderers/Log.tsx +16 -3
- package/src/renderers/Mapping.tsx +27 -11
- package/src/renderers/Nav.tsx +325 -122
- package/src/renderers/Portlet.tsx +423 -0
- package/src/renderers/Property.tsx +3 -2
- package/src/renderers/SearchBox.tsx +23 -4
- package/src/renderers/SparkLine.tsx +5 -0
- package/src/renderers/Table/ColumnToggler.tsx +544 -0
- package/src/renderers/Table/ItemActionsWrapper.tsx +44 -0
- package/src/renderers/Table/TableCell.tsx +16 -1
- package/src/renderers/Table/TableContent.tsx +40 -2
- package/src/renderers/Table/index.tsx +257 -80
- package/src/renderers/Tabs.tsx +9 -1
- package/src/renderers/WebComponent.tsx +2 -2
- package/src/store/crud.ts +3 -8
- package/src/store/form.ts +5 -10
- package/src/store/service.ts +5 -4
- package/src/store/table.ts +103 -11
- package/src/types.ts +57 -0
- package/src/utils/api.ts +52 -23
- package/src/utils/dom.tsx +12 -0
- package/src/utils/handleAction.ts +41 -0
- package/src/utils/helper.ts +12 -4
- package/src/utils/icon.tsx +4 -0
- package/src/utils/tpl-builtin.ts +48 -17
- package/dump.rdb +0 -0
- package/lib/components/AssociatedCheckboxes.d.ts +0 -762
- package/lib/components/AssociatedCheckboxes.js +0 -90
- package/lib/components/AssociatedCheckboxes.js.map +0 -13
- package/lib/components/ChainedCheckboxes.js.map +0 -13
- package/lib/components/Checkboxes.js +0 -101
- package/lib/components/Checkboxes.js.map +0 -13
- package/lib/components/ListCheckboxes.d.ts +0 -739
- package/lib/components/ListCheckboxes.js +0 -48
- package/lib/components/ListCheckboxes.js.map +0 -13
- package/lib/components/ListRadios.d.ts +0 -763
- package/lib/components/ListRadios.js +0 -86
- package/lib/components/ListRadios.js.map +0 -13
- package/lib/components/TableCheckboxes.js.map +0 -13
- package/lib/components/TreeCheckboxes.js.map +0 -13
- package/lib/components/TreeRadios.d.ts +0 -838
- package/lib/components/TreeRadios.js +0 -116
- package/lib/components/TreeRadios.js.map +0 -13
- package/sdk.zip +0 -0
- package/src/components/ListRadios.tsx +0 -159
- package/src/components/TreeRadios.tsx +0 -202
@@ -18,8 +18,10 @@ import {dataMapping} from '../../utils/tpl-builtin';
|
|
18
18
|
import {
|
19
19
|
SchemaApi,
|
20
20
|
SchemaClassName,
|
21
|
-
SchemaTokenizeableString
|
21
|
+
SchemaTokenizeableString,
|
22
|
+
SchemaUrlPath
|
22
23
|
} from '../../Schema';
|
24
|
+
import merge from 'lodash/merge';
|
23
25
|
|
24
26
|
/**
|
25
27
|
* File 文件上传控件
|
@@ -88,6 +90,11 @@ export interface FileControlSchema extends FormBaseControl {
|
|
88
90
|
*/
|
89
91
|
downloadUrl?: SchemaApi;
|
90
92
|
|
93
|
+
/**
|
94
|
+
* 模板下载地址
|
95
|
+
*/
|
96
|
+
templateUrl?: SchemaApi;
|
97
|
+
|
91
98
|
/**
|
92
99
|
* 默认 `file`, 如果你不想自己存储,则可以忽略此属性。
|
93
100
|
* @default file
|
@@ -275,6 +282,7 @@ export default class FileControl extends React.Component<FileProps, FileState> {
|
|
275
282
|
extractValue: false,
|
276
283
|
delimiter: ',',
|
277
284
|
downloadUrl: '', // '/api/file/'
|
285
|
+
templateUrl: '',
|
278
286
|
useChunk: 'auto',
|
279
287
|
chunkSize: 5 * 1024 * 1024, // 文件大于5M, 自动分块上传
|
280
288
|
startChunkApi: '/api/upload/startChunk',
|
@@ -356,11 +364,12 @@ export default class FileControl extends React.Component<FileProps, FileState> {
|
|
356
364
|
if (value && value instanceof Blob) {
|
357
365
|
files = [value as any];
|
358
366
|
} else if (value) {
|
359
|
-
files = (
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
367
|
+
files = (
|
368
|
+
Array.isArray(value)
|
369
|
+
? value
|
370
|
+
: joinValues
|
371
|
+
? `${(value as any)[valueField] || value}`.split(delimiter)
|
372
|
+
: [value as any]
|
364
373
|
)
|
365
374
|
.map(item => FileControl.valueToFile(item, props) as FileValue)
|
366
375
|
.filter(item => item);
|
@@ -386,6 +395,7 @@ export default class FileControl extends React.Component<FileProps, FileState> {
|
|
386
395
|
this.uploadBigFile = this.uploadBigFile.bind(this);
|
387
396
|
this.handleSelect = this.handleSelect.bind(this);
|
388
397
|
this.syncAutoFill = this.syncAutoFill.bind(this);
|
398
|
+
this.downloadTpl = this.downloadTpl.bind(this);
|
389
399
|
}
|
390
400
|
|
391
401
|
componentDidMount() {
|
@@ -402,11 +412,12 @@ export default class FileControl extends React.Component<FileProps, FileState> {
|
|
402
412
|
let files: Array<FileValue> = [];
|
403
413
|
|
404
414
|
if (value) {
|
405
|
-
files = (
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
415
|
+
files = (
|
416
|
+
Array.isArray(value)
|
417
|
+
? value
|
418
|
+
: joinValues && typeof value === 'string'
|
419
|
+
? value.split(delimiter)
|
420
|
+
: [value as any]
|
410
421
|
)
|
411
422
|
.map(item => {
|
412
423
|
let obj = FileControl.valueToFile(
|
@@ -532,7 +543,7 @@ export default class FileControl extends React.Component<FileProps, FileState> {
|
|
532
543
|
e.preventDefault();
|
533
544
|
e.stopPropagation();
|
534
545
|
|
535
|
-
const {
|
546
|
+
const {downloadUrl} = this.props;
|
536
547
|
const urlField = this.props.urlField || 'url';
|
537
548
|
const valueField = this.props.valueField || 'value';
|
538
549
|
|
@@ -547,10 +558,23 @@ export default class FileControl extends React.Component<FileProps, FileState> {
|
|
547
558
|
? downloadUrl
|
548
559
|
: `${fileUrl}`;
|
549
560
|
|
561
|
+
this.handleApi(api, file);
|
562
|
+
}
|
563
|
+
|
564
|
+
downloadTpl(e: React.MouseEvent) {
|
565
|
+
e.preventDefault();
|
566
|
+
e.stopPropagation();
|
567
|
+
|
568
|
+
this.handleApi(this.props.templateUrl || '');
|
569
|
+
}
|
570
|
+
|
571
|
+
handleApi(api: SchemaApi, payload?: object) {
|
572
|
+
const {data, env} = this.props;
|
550
573
|
if (api) {
|
551
574
|
const ctx = createObject(data, {
|
552
|
-
...
|
575
|
+
...payload
|
553
576
|
});
|
577
|
+
|
554
578
|
const apiObject = normalizeApi(api);
|
555
579
|
|
556
580
|
if (apiObject.method?.toLowerCase() === 'get' && !apiObject.data) {
|
@@ -851,8 +875,8 @@ export default class FileControl extends React.Component<FileProps, FileState> {
|
|
851
875
|
}
|
852
876
|
|
853
877
|
syncAutoFill() {
|
854
|
-
const {autoFill, multiple, onBulkChange} = this.props;
|
855
|
-
if (!isEmpty(autoFill)) {
|
878
|
+
const {autoFill, multiple, onBulkChange, data} = this.props;
|
879
|
+
if (!isEmpty(autoFill) && onBulkChange) {
|
856
880
|
const files = this.state.files.filter(
|
857
881
|
file => ~['uploaded', 'init', 'ready'].indexOf(file.state as string)
|
858
882
|
);
|
@@ -864,7 +888,12 @@ export default class FileControl extends React.Component<FileProps, FileState> {
|
|
864
888
|
}
|
865
889
|
: files[0]
|
866
890
|
);
|
867
|
-
|
891
|
+
Object.keys(toSync).forEach(key => {
|
892
|
+
if (isPlainObject(toSync[key]) && isPlainObject(data[key])) {
|
893
|
+
toSync[key] = merge({}, data[key], toSync[key]);
|
894
|
+
}
|
895
|
+
});
|
896
|
+
onBulkChange(toSync);
|
868
897
|
}
|
869
898
|
}
|
870
899
|
|
@@ -1163,7 +1192,8 @@ export default class FileControl extends React.Component<FileProps, FileState> {
|
|
1163
1192
|
classnames: cx,
|
1164
1193
|
translate: __,
|
1165
1194
|
render,
|
1166
|
-
downloadUrl
|
1195
|
+
downloadUrl,
|
1196
|
+
templateUrl
|
1167
1197
|
} = this.props;
|
1168
1198
|
let {files, uploading, error} = this.state;
|
1169
1199
|
const nameField = this.props.nameField || 'name';
|
@@ -1186,6 +1216,16 @@ export default class FileControl extends React.Component<FileProps, FileState> {
|
|
1186
1216
|
|
1187
1217
|
return (
|
1188
1218
|
<div className={cx('FileControl', className)}>
|
1219
|
+
{templateUrl ? (
|
1220
|
+
<a
|
1221
|
+
className={cx('FileControl-templateInfo')}
|
1222
|
+
onClick={this.downloadTpl.bind(this)}
|
1223
|
+
>
|
1224
|
+
<Icon icon="download" className="icon" />
|
1225
|
+
<span>{__('File.downloadTpl')}</span>
|
1226
|
+
</a>
|
1227
|
+
) : null}
|
1228
|
+
|
1189
1229
|
<DropZone
|
1190
1230
|
disabled={disabled}
|
1191
1231
|
key="drop-zone"
|
@@ -1223,13 +1263,15 @@ export default class FileControl extends React.Component<FileProps, FileState> {
|
|
1223
1263
|
onClick={this.handleSelect}
|
1224
1264
|
>
|
1225
1265
|
<Icon icon="upload" className="icon" />
|
1226
|
-
|
1227
|
-
|
1228
|
-
|
1229
|
-
|
1230
|
-
|
1231
|
-
|
1232
|
-
|
1266
|
+
<span>
|
1267
|
+
{!multiple && files.length
|
1268
|
+
? __('File.repick')
|
1269
|
+
: multiple && files.length
|
1270
|
+
? __('File.continueAdd')
|
1271
|
+
: btnLabel
|
1272
|
+
? btnLabel
|
1273
|
+
: __('File.upload')}
|
1274
|
+
</span>
|
1233
1275
|
</Button>
|
1234
1276
|
) : null}
|
1235
1277
|
|
@@ -29,6 +29,8 @@ import {
|
|
29
29
|
SchemaUrlPath
|
30
30
|
} from '../../Schema';
|
31
31
|
import {filter} from '../../utils/tpl';
|
32
|
+
import isPlainObject from 'lodash/isPlainObject';
|
33
|
+
import merge from 'lodash/merge';
|
32
34
|
|
33
35
|
/**
|
34
36
|
* Image 图片上传控件
|
@@ -790,8 +792,8 @@ export default class ImageControl extends React.Component<
|
|
790
792
|
}
|
791
793
|
|
792
794
|
syncAutoFill() {
|
793
|
-
const {autoFill, multiple, onBulkChange} = this.props;
|
794
|
-
if (!isEmpty(autoFill)) {
|
795
|
+
const {autoFill, multiple, onBulkChange, data} = this.props;
|
796
|
+
if (!isEmpty(autoFill) && onBulkChange) {
|
795
797
|
const files = this.state.files.filter(
|
796
798
|
file => ~['uploaded', 'init', 'ready'].indexOf(file.state as string)
|
797
799
|
);
|
@@ -803,7 +805,13 @@ export default class ImageControl extends React.Component<
|
|
803
805
|
}
|
804
806
|
: files[0]
|
805
807
|
);
|
806
|
-
|
808
|
+
|
809
|
+
Object.keys(toSync).forEach(key => {
|
810
|
+
if (isPlainObject(toSync[key]) && isPlainObject(data[key])) {
|
811
|
+
toSync[key] = merge({}, data[key], toSync[key]);
|
812
|
+
}
|
813
|
+
});
|
814
|
+
onBulkChange(toSync);
|
807
815
|
}
|
808
816
|
}
|
809
817
|
|
@@ -1377,7 +1385,6 @@ export default class ImageControl extends React.Component<
|
|
1377
1385
|
fixedSize ? fixedSizeClassName : ''
|
1378
1386
|
)}
|
1379
1387
|
>
|
1380
|
-
<p>{__('File.uploading')}</p>
|
1381
1388
|
<div className={cx('ImageControl-progress')}>
|
1382
1389
|
<span
|
1383
1390
|
style={{
|
@@ -1390,6 +1397,7 @@ export default class ImageControl extends React.Component<
|
|
1390
1397
|
)}
|
1391
1398
|
/>
|
1392
1399
|
</div>
|
1400
|
+
<p>{__('File.uploading')}</p>
|
1393
1401
|
</div>
|
1394
1402
|
</>
|
1395
1403
|
) : (
|
@@ -1524,7 +1532,10 @@ export default class ImageControl extends React.Component<
|
|
1524
1532
|
thumbRatio={thumbRatio}
|
1525
1533
|
/>
|
1526
1534
|
) : (
|
1527
|
-
|
1535
|
+
<>
|
1536
|
+
<Icon icon="plus" className="icon" />
|
1537
|
+
<span>{__('File.upload')}</span>
|
1538
|
+
</>
|
1528
1539
|
)}
|
1529
1540
|
|
1530
1541
|
{isFocused ? (
|
@@ -314,7 +314,7 @@ export interface FormItemProps extends RendererProps {
|
|
314
314
|
submitOnChange?: boolean,
|
315
315
|
changeImmediately?: boolean
|
316
316
|
) => void;
|
317
|
-
onBulkChange
|
317
|
+
onBulkChange?: (
|
318
318
|
values: {[propName: string]: any},
|
319
319
|
submitOnChange?: boolean
|
320
320
|
) => void;
|
@@ -1089,7 +1089,8 @@ export const detectProps = [
|
|
1089
1089
|
'items',
|
1090
1090
|
'showCounter',
|
1091
1091
|
'minLength',
|
1092
|
-
'maxLength'
|
1092
|
+
'maxLength',
|
1093
|
+
'embed'
|
1093
1094
|
];
|
1094
1095
|
|
1095
1096
|
export function asFormItem(config: Omit<FormItemConfig, 'component'>) {
|
@@ -48,6 +48,8 @@ import {
|
|
48
48
|
SchemaObject,
|
49
49
|
SchemaTokenizeableString
|
50
50
|
} from '../../Schema';
|
51
|
+
import isPlainObject from 'lodash/isPlainObject';
|
52
|
+
import merge from 'lodash/merge';
|
51
53
|
|
52
54
|
export {Option};
|
53
55
|
|
@@ -270,7 +272,8 @@ export function registerOptionsControl(config: OptionsConfig) {
|
|
270
272
|
: [];
|
271
273
|
static ComposedComponent = Control;
|
272
274
|
|
273
|
-
|
275
|
+
toDispose: Array<() => void> = [];
|
276
|
+
|
274
277
|
input: any;
|
275
278
|
mounted = false;
|
276
279
|
|
@@ -302,9 +305,18 @@ export function registerOptionsControl(config: OptionsConfig) {
|
|
302
305
|
data
|
303
306
|
);
|
304
307
|
|
305
|
-
this.
|
306
|
-
(
|
307
|
-
|
308
|
+
this.toDispose.push(
|
309
|
+
reaction(
|
310
|
+
() => JSON.stringify([formItem.loading, formItem.filteredOptions]),
|
311
|
+
() => this.mounted && this.forceUpdate()
|
312
|
+
)
|
313
|
+
);
|
314
|
+
|
315
|
+
this.toDispose.push(
|
316
|
+
reaction(
|
317
|
+
() => JSON.stringify(formItem.options),
|
318
|
+
() => this.mounted && this.syncAutoFill(formItem.tmpValue)
|
319
|
+
)
|
308
320
|
);
|
309
321
|
// 默认全选。这里会和默认值\回填值逻辑冲突,所以如果有配置source则不执行默认全选
|
310
322
|
if (
|
@@ -432,14 +444,20 @@ export function registerOptionsControl(config: OptionsConfig) {
|
|
432
444
|
|
433
445
|
componentWillUnmount() {
|
434
446
|
this.props.removeHook?.(this.reload, 'init');
|
435
|
-
this.
|
447
|
+
this.toDispose.forEach(fn => fn());
|
448
|
+
this.toDispose = [];
|
436
449
|
}
|
437
450
|
|
438
451
|
syncAutoFill(value: any) {
|
439
452
|
const {autoFill, multiple, onBulkChange, data} = this.props;
|
440
453
|
const formItem = this.props.formItem as IFormItemStore;
|
441
454
|
|
442
|
-
if (
|
455
|
+
if (
|
456
|
+
onBulkChange &&
|
457
|
+
autoFill &&
|
458
|
+
!isEmpty(autoFill) &&
|
459
|
+
formItem.filteredOptions.length
|
460
|
+
) {
|
443
461
|
const selectedOptions = formItem.getSelectedOptions(value);
|
444
462
|
const toSync = dataMapping(
|
445
463
|
autoFill,
|
@@ -471,7 +489,14 @@ export function registerOptionsControl(config: OptionsConfig) {
|
|
471
489
|
selectedOptions[0]
|
472
490
|
)
|
473
491
|
);
|
474
|
-
|
492
|
+
|
493
|
+
Object.keys(toSync).forEach(key => {
|
494
|
+
if (isPlainObject(toSync[key]) && isPlainObject(data[key])) {
|
495
|
+
toSync[key] = merge({}, data[key], toSync[key]);
|
496
|
+
}
|
497
|
+
});
|
498
|
+
|
499
|
+
onBulkChange(toSync);
|
475
500
|
}
|
476
501
|
}
|
477
502
|
|
@@ -397,14 +397,15 @@ export default class PickerControl extends React.PureComponent<
|
|
397
397
|
options,
|
398
398
|
multiple,
|
399
399
|
valueField,
|
400
|
-
embed
|
400
|
+
embed,
|
401
|
+
source
|
401
402
|
} = this.props;
|
402
403
|
|
403
404
|
return render('modal-body', this.state.schema, {
|
404
405
|
value: selectedOptions,
|
405
406
|
valueField,
|
406
407
|
primaryField: valueField,
|
407
|
-
options: options,
|
408
|
+
options: source ? [] : options,
|
408
409
|
multiple,
|
409
410
|
onSelect: embed ? this.handleChange : undefined,
|
410
411
|
ref: this.crudRef,
|
@@ -14,6 +14,9 @@ import {isEffectiveApi} from '../../utils/api';
|
|
14
14
|
import {isEmpty, createObject, autobind} from '../../utils/helper';
|
15
15
|
import {dataMapping} from '../../utils/tpl-builtin';
|
16
16
|
import {SchemaApi} from '../../Schema';
|
17
|
+
import Spinner from '../../components/Spinner';
|
18
|
+
import {BaseTransferRenderer, TransferControlSchema} from './Transfer';
|
19
|
+
import TransferDropDown from '../../components/TransferDropDown';
|
17
20
|
|
18
21
|
/**
|
19
22
|
* Select 下拉选择框。
|
@@ -28,11 +31,6 @@ export interface SelectControlSchema extends FormOptionsControl {
|
|
28
31
|
*/
|
29
32
|
autoComplete?: SchemaApi;
|
30
33
|
|
31
|
-
/**
|
32
|
-
* 是否可以搜索值
|
33
|
-
*/
|
34
|
-
searchable?: boolean;
|
35
|
-
|
36
34
|
/**
|
37
35
|
* 可以自定义菜单展示。
|
38
36
|
*/
|
@@ -42,6 +40,51 @@ export interface SelectControlSchema extends FormOptionsControl {
|
|
42
40
|
* 边框模式,全边框,还是半边框,或者没边框。
|
43
41
|
*/
|
44
42
|
borderMode?: 'full' | 'half' | 'none';
|
43
|
+
|
44
|
+
/**
|
45
|
+
* 勾选展示模式
|
46
|
+
*/
|
47
|
+
selectMode?: 'table' | 'group' | 'tree' | 'chained' | 'associated';
|
48
|
+
|
49
|
+
/**
|
50
|
+
* 当 selectMode 为 associated 时用来定义左侧的选项
|
51
|
+
*/
|
52
|
+
leftOptions?: Array<Option>;
|
53
|
+
|
54
|
+
/**
|
55
|
+
* 当 selectMode 为 associated 时用来定义左侧的选择模式
|
56
|
+
*/
|
57
|
+
leftMode?: 'tree' | 'list';
|
58
|
+
|
59
|
+
/**
|
60
|
+
* 当 selectMode 为 associated 时用来定义右侧的选择模式
|
61
|
+
*/
|
62
|
+
rightMode?: 'table' | 'list' | 'tree' | 'chained';
|
63
|
+
|
64
|
+
/**
|
65
|
+
* 搜索结果展示模式
|
66
|
+
*/
|
67
|
+
searchResultMode?: 'table' | 'list' | 'tree' | 'chained';
|
68
|
+
|
69
|
+
/**
|
70
|
+
* 当 selectMode 为 table 时定义表格列信息。
|
71
|
+
*/
|
72
|
+
columns?: Array<any>;
|
73
|
+
|
74
|
+
/**
|
75
|
+
* 当 searchResultMode 为 table 时定义表格列信息。
|
76
|
+
*/
|
77
|
+
searchResultColumns?: Array<any>;
|
78
|
+
|
79
|
+
/**
|
80
|
+
* 可搜索?
|
81
|
+
*/
|
82
|
+
searchable?: boolean;
|
83
|
+
|
84
|
+
/**
|
85
|
+
* 搜索 API
|
86
|
+
*/
|
87
|
+
searchApi?: SchemaApi;
|
45
88
|
}
|
46
89
|
|
47
90
|
export interface SelectProps extends OptionsControlProps {
|
@@ -220,6 +263,18 @@ export default class SelectControl extends React.Component<SelectProps, any> {
|
|
220
263
|
reload && reload();
|
221
264
|
}
|
222
265
|
|
266
|
+
option2value() {}
|
267
|
+
|
268
|
+
renderOtherMode() {
|
269
|
+
const {selectMode, ...rest} = this.props;
|
270
|
+
return (
|
271
|
+
<TransferDropdownRenderer
|
272
|
+
{...rest}
|
273
|
+
selectMode={selectMode === 'group' ? 'list' : selectMode}
|
274
|
+
/>
|
275
|
+
);
|
276
|
+
}
|
277
|
+
|
223
278
|
render() {
|
224
279
|
let {
|
225
280
|
autoComplete,
|
@@ -241,6 +296,7 @@ export default class SelectControl extends React.Component<SelectProps, any> {
|
|
241
296
|
render,
|
242
297
|
menuTpl,
|
243
298
|
borderMode,
|
299
|
+
selectMode,
|
244
300
|
...rest
|
245
301
|
} = this.props;
|
246
302
|
|
@@ -250,25 +306,110 @@ export default class SelectControl extends React.Component<SelectProps, any> {
|
|
250
306
|
|
251
307
|
return (
|
252
308
|
<div className={cx(`${classPrefix}SelectControl`, className)}>
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
309
|
+
{['table', 'list', 'group', 'tree', 'chained', 'associated'].includes(
|
310
|
+
selectMode
|
311
|
+
) ? (
|
312
|
+
this.renderOtherMode()
|
313
|
+
) : (
|
314
|
+
<Select
|
315
|
+
{...rest}
|
316
|
+
borderMode={borderMode}
|
317
|
+
placeholder={placeholder}
|
318
|
+
multiple={multiple || multi}
|
319
|
+
ref={this.inputRef}
|
320
|
+
value={selectedOptions}
|
321
|
+
options={options}
|
322
|
+
loadOptions={
|
323
|
+
isEffectiveApi(autoComplete) ? this.lazyloadRemote : undefined
|
324
|
+
}
|
325
|
+
creatable={creatable}
|
326
|
+
searchable={searchable || !!autoComplete}
|
327
|
+
onChange={this.changeValue}
|
328
|
+
loading={loading}
|
329
|
+
noResultsText={noResultsText}
|
330
|
+
renderMenu={menuTpl ? this.renderMenu : undefined}
|
331
|
+
/>
|
332
|
+
)}
|
333
|
+
</div>
|
334
|
+
);
|
335
|
+
}
|
336
|
+
}
|
337
|
+
|
338
|
+
export interface TransferDropDownProps
|
339
|
+
extends OptionsControlProps,
|
340
|
+
Omit<
|
341
|
+
TransferControlSchema,
|
342
|
+
| 'type'
|
343
|
+
| 'options'
|
344
|
+
| 'inputClassName'
|
345
|
+
| 'className'
|
346
|
+
| 'descriptionClassName'
|
347
|
+
> {
|
348
|
+
borderMode?: 'full' | 'half' | 'none';
|
349
|
+
}
|
350
|
+
|
351
|
+
class TransferDropdownRenderer extends BaseTransferRenderer<TransferDropDownProps> {
|
352
|
+
render() {
|
353
|
+
const {
|
354
|
+
className,
|
355
|
+
classnames: cx,
|
356
|
+
selectedOptions,
|
357
|
+
sortable,
|
358
|
+
loading,
|
359
|
+
searchable,
|
360
|
+
searchResultMode,
|
361
|
+
showArrow,
|
362
|
+
deferLoad,
|
363
|
+
disabled,
|
364
|
+
selectTitle,
|
365
|
+
selectMode,
|
366
|
+
multiple,
|
367
|
+
columns,
|
368
|
+
leftMode,
|
369
|
+
borderMode
|
370
|
+
} = this.props;
|
371
|
+
|
372
|
+
// 目前 LeftOptions 没有接口可以动态加载
|
373
|
+
// 为了方便可以快速实现动态化,让选项的第一个成员携带
|
374
|
+
// LeftOptions 信息
|
375
|
+
let {options, leftOptions, leftDefaultValue} = this.props;
|
376
|
+
if (
|
377
|
+
selectMode === 'associated' &&
|
378
|
+
options &&
|
379
|
+
options.length === 1 &&
|
380
|
+
options[0].leftOptions &&
|
381
|
+
Array.isArray(options[0].children)
|
382
|
+
) {
|
383
|
+
leftOptions = options[0].leftOptions;
|
384
|
+
leftDefaultValue = options[0].leftDefaultValue ?? leftDefaultValue;
|
385
|
+
options = options[0].children;
|
386
|
+
}
|
387
|
+
|
388
|
+
return (
|
389
|
+
<>
|
390
|
+
<TransferDropDown
|
391
|
+
selectMode={selectMode}
|
392
|
+
className={className}
|
259
393
|
value={selectedOptions}
|
394
|
+
disabled={disabled}
|
260
395
|
options={options}
|
261
|
-
|
262
|
-
|
263
|
-
}
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
396
|
+
onChange={this.handleChange}
|
397
|
+
option2value={this.option2value}
|
398
|
+
sortable={sortable}
|
399
|
+
searchResultMode={searchResultMode}
|
400
|
+
onSearch={searchable ? this.handleSearch : undefined}
|
401
|
+
showArrow={showArrow}
|
402
|
+
onDeferLoad={deferLoad}
|
403
|
+
selectTitle={selectTitle}
|
404
|
+
multiple={multiple}
|
405
|
+
columns={columns}
|
406
|
+
leftMode={leftMode}
|
407
|
+
leftOptions={leftOptions}
|
408
|
+
borderMode={borderMode}
|
270
409
|
/>
|
271
|
-
|
410
|
+
|
411
|
+
<Spinner overlay key="info" show={loading} />
|
412
|
+
</>
|
272
413
|
);
|
273
414
|
}
|
274
415
|
}
|