amis-ui 1.0.0-beta.0
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/dist/components/404.d.ts +54 -0
- package/dist/components/404.js +44 -0
- package/dist/components/Alert.d.ts +560 -0
- package/dist/components/Alert.js +201 -0
- package/dist/components/Alert2.d.ts +66 -0
- package/dist/components/Alert2.js +69 -0
- package/dist/components/AnchorNav.d.ts +118 -0
- package/dist/components/AnchorNav.js +181 -0
- package/dist/components/ArrayInput.d.ts +625 -0
- package/dist/components/ArrayInput.js +162 -0
- package/dist/components/AsideNav.d.ts +142 -0
- package/dist/components/AsideNav.js +139 -0
- package/dist/components/AssociatedSelection.d.ts +491 -0
- package/dist/components/AssociatedSelection.js +113 -0
- package/dist/components/Avatar.d.ts +113 -0
- package/dist/components/Avatar.js +150 -0
- package/dist/components/Badge.d.ts +120 -0
- package/dist/components/BaiduMapPicker.d.ts +86 -0
- package/dist/components/BarCode.d.ts +58 -0
- package/dist/components/Breadcrumb.d.ts +115 -0
- package/dist/components/Breadcrumb.js +173 -0
- package/dist/components/Button.d.ts +74 -0
- package/dist/components/Button.js +73 -0
- package/dist/components/CalendarMobile.d.ts +353 -0
- package/dist/components/CalendarMobile.js +541 -0
- package/dist/components/Card.d.ts +75 -0
- package/dist/components/Cascader.d.ts +109 -0
- package/dist/components/ChainedSelection.d.ts +480 -0
- package/dist/components/ChainedSelection.js +131 -0
- package/dist/components/Checkbox.d.ts +69 -0
- package/dist/components/Checkbox.js +73 -0
- package/dist/components/CityArea.d.ts +307 -0
- package/dist/components/CityDB.d.ts +13 -0
- package/dist/components/CodeMirror.d.ts +25 -0
- package/dist/components/CodeMirror.js +113 -0
- package/dist/components/Collapse.d.ts +92 -0
- package/dist/components/Collapse.js +166 -0
- package/dist/components/CollapseGroup.d.ts +68 -0
- package/dist/components/CollapseGroup.js +96 -0
- package/dist/components/ColorPicker.d.ts +524 -0
- package/dist/components/ContextMenu.d.ts +96 -0
- package/dist/components/ContextMenu.js +225 -0
- package/dist/components/DatePicker.d.ts +619 -0
- package/dist/components/DatePicker.js +534 -0
- package/dist/components/DateRangePicker.d.ts +876 -0
- package/dist/components/DateRangePicker.js +1050 -0
- package/dist/components/Drawer.d.ts +95 -0
- package/dist/components/Drawer.js +262 -0
- package/dist/components/Editor.d.ts +605 -0
- package/dist/components/Editor.js +245 -0
- package/dist/components/Form.d.ts +22 -0
- package/dist/components/FormField.d.ts +65 -0
- package/dist/components/GridNav.d.ts +52 -0
- package/dist/components/GroupedSelection.d.ts +467 -0
- package/dist/components/GroupedSelection.js +71 -0
- package/dist/components/Html.d.ts +83 -0
- package/dist/components/Html.js +61 -0
- package/dist/components/ImageGallery.d.ts +297 -0
- package/dist/components/Input.d.ts +16 -0
- package/dist/components/Input.js +70 -0
- package/dist/components/InputBox.d.ts +99 -0
- package/dist/components/InputBox.js +106 -0
- package/dist/components/InputBoxWithSuggestion.d.ts +280 -0
- package/dist/components/InputBoxWithSuggestion.js +75 -0
- package/dist/components/Layout.d.ts +144 -0
- package/dist/components/Layout.js +75 -0
- package/dist/components/Link.d.ts +62 -0
- package/dist/components/ListGroup.d.ts +76 -0
- package/dist/components/ListGroup.js +40 -0
- package/dist/components/ListMenu.d.ts +573 -0
- package/dist/components/LocationPicker.d.ts +427 -0
- package/dist/components/Markdown.d.ts +20 -0
- package/dist/components/Modal.d.ts +1278 -0
- package/dist/components/Modal.js +159 -0
- package/dist/components/ModalManager.d.ts +17 -0
- package/dist/components/ModalManager.js +53 -0
- package/dist/components/MonthRangePicker.d.ts +748 -0
- package/dist/components/NumberInput.d.ts +89 -0
- package/dist/components/NumberInput.js +147 -0
- package/dist/components/Overlay.d.ts +41 -0
- package/dist/components/Overlay.js +218 -0
- package/dist/components/Pagination.d.ts +685 -0
- package/dist/components/Picker.d.ts +284 -0
- package/dist/components/Picker.js +82 -0
- package/dist/components/PickerColumn.d.ts +63 -0
- package/dist/components/PickerColumn.js +285 -0
- package/dist/components/PickerContainer.d.ts +303 -0
- package/dist/components/PickerContainer.js +158 -0
- package/dist/components/PopOver.d.ts +90 -0
- package/dist/components/PopOver.js +98 -0
- package/dist/components/PopOverContainer.d.ts +28 -0
- package/dist/components/PopOverContainer.js +101 -0
- package/dist/components/PopUp.d.ts +578 -0
- package/dist/components/PopUp.js +96 -0
- package/dist/components/Progress.d.ts +68 -0
- package/dist/components/PullRefresh.d.ts +64 -0
- package/dist/components/PullRefresh.js +149 -0
- package/dist/components/Radios.d.ts +180 -0
- package/dist/components/Radios.js +121 -0
- package/dist/components/Range.d.ts +122 -0
- package/dist/components/Range.js +418 -0
- package/dist/components/Rating.d.ts +252 -0
- package/dist/components/Rating.js +324 -0
- package/dist/components/ResultBox.d.ts +290 -0
- package/dist/components/ResultBox.js +156 -0
- package/dist/components/ResultList.d.ts +319 -0
- package/dist/components/ResultList.js +192 -0
- package/dist/components/ResultTableList.d.ts +708 -0
- package/dist/components/ResultTableList.js +135 -0
- package/dist/components/ResultTreeList.d.ts +308 -0
- package/dist/components/ResultTreeList.js +217 -0
- package/dist/components/RichText.d.ts +45 -0
- package/dist/components/SearchBox.d.ts +504 -0
- package/dist/components/SearchBox.js +137 -0
- package/dist/components/Select.d.ts +6280 -0
- package/dist/components/Select.js +772 -0
- package/dist/components/Selection.d.ts +510 -0
- package/dist/components/Selection.js +151 -0
- package/dist/components/SparkLine.d.ts +403 -0
- package/dist/components/SparkLine.js +71 -0
- package/dist/components/Spinner.d.ts +174 -0
- package/dist/components/Spinner.js +77 -0
- package/dist/components/Steps.d.ts +110 -0
- package/dist/components/Switch.d.ts +101 -0
- package/dist/components/Switch.js +73 -0
- package/dist/components/TableSelection.d.ts +695 -0
- package/dist/components/TableSelection.js +88 -0
- package/dist/components/Tabs.d.ts +210 -0
- package/dist/components/Tabs.js +486 -0
- package/dist/components/TabsTransfer.d.ts +297 -0
- package/dist/components/TabsTransfer.js +220 -0
- package/dist/components/TabsTransferPicker.d.ts +273 -0
- package/dist/components/Tag.d.ts +104 -0
- package/dist/components/Textarea.d.ts +568 -0
- package/dist/components/Textarea.js +144 -0
- package/dist/components/Timeline.d.ts +47 -0
- package/dist/components/TimelineItem.d.ts +297 -0
- package/dist/components/Tinymce.d.ts +55 -0
- package/dist/components/TitleBar.d.ts +115 -0
- package/dist/components/TitleBar.js +57 -0
- package/dist/components/Toast.d.ts +358 -0
- package/dist/components/Toast.js +260 -0
- package/dist/components/Tooltip.d.ts +65 -0
- package/dist/components/Tooltip.js +45 -0
- package/dist/components/TooltipWrapper.d.ts +155 -0
- package/dist/components/TooltipWrapper.js +192 -0
- package/dist/components/Transfer.d.ts +1243 -0
- package/dist/components/Transfer.js +332 -0
- package/dist/components/TransferDropDown.d.ts +271 -0
- package/dist/components/TransferPicker.d.ts +277 -0
- package/dist/components/TransferSearch.d.ts +292 -0
- package/dist/components/TransferSearch.js +104 -0
- package/dist/components/Tree.d.ts +1708 -0
- package/dist/components/Tree.js +773 -0
- package/dist/components/TreeSelection.d.ts +526 -0
- package/dist/components/TreeSelection.js +209 -0
- package/dist/components/UserSelect.d.ts +500 -0
- package/dist/components/UserTabSelect.d.ts +320 -0
- package/dist/components/WithRemoteConfig.d.ts +386 -0
- package/dist/components/WithRemoteConfig.js +268 -0
- package/dist/components/WithStore.d.ts +75 -0
- package/dist/components/WithStore.js +57 -0
- package/dist/components/calendar/Calendar.d.ts +64 -0
- package/dist/components/calendar/Calendar.js +499 -0
- package/dist/components/calendar/CalendarContainer.d.ts +10 -0
- package/dist/components/calendar/CalendarContainer.js +35 -0
- package/dist/components/calendar/DaysView.d.ts +170 -0
- package/dist/components/calendar/DaysView.js +453 -0
- package/dist/components/calendar/MonthsView.d.ts +128 -0
- package/dist/components/calendar/MonthsView.js +168 -0
- package/dist/components/calendar/QuartersView.d.ts +92 -0
- package/dist/components/calendar/QuartersView.js +93 -0
- package/dist/components/calendar/TimeView.d.ts +178 -0
- package/dist/components/calendar/TimeView.js +474 -0
- package/dist/components/calendar/YearsView.d.ts +102 -0
- package/dist/components/calendar/YearsView.js +131 -0
- package/dist/components/condition-builder/Expression.d.ts +298 -0
- package/dist/components/condition-builder/Field.d.ts +280 -0
- package/dist/components/condition-builder/Formula.d.ts +269 -0
- package/dist/components/condition-builder/Func.d.ts +279 -0
- package/dist/components/condition-builder/Group.d.ts +296 -0
- package/dist/components/condition-builder/GroupOrItem.d.ts +72 -0
- package/dist/components/condition-builder/InputSwitch.d.ts +47 -0
- package/dist/components/condition-builder/Item.d.ts +292 -0
- package/dist/components/condition-builder/Value.d.ts +277 -0
- package/dist/components/condition-builder/config.d.ts +35 -0
- package/dist/components/condition-builder/index.d.ts +303 -0
- package/dist/components/condition-builder/types.d.ts +150 -0
- package/dist/components/formula/Editor.d.ts +362 -0
- package/dist/components/formula/Editor.js +217 -0
- package/dist/components/formula/FuncList.d.ts +48 -0
- package/dist/components/formula/FuncList.js +57 -0
- package/dist/components/formula/Picker.d.ts +440 -0
- package/dist/components/formula/Picker.js +231 -0
- package/dist/components/formula/VariableList.d.ts +54 -0
- package/dist/components/formula/VariableList.js +49 -0
- package/dist/components/formula/plugin.d.ts +27 -0
- package/dist/components/formula/plugin.js +211 -0
- package/dist/components/icons.d.ts +45 -0
- package/dist/components/icons.js +270 -0
- package/dist/components/index.d.ts +64 -0
- package/dist/components/json-schema/Array.d.ts +3 -0
- package/dist/components/json-schema/Array.js +136 -0
- package/dist/components/json-schema/Item.d.ts +3 -0
- package/dist/components/json-schema/Item.js +45 -0
- package/dist/components/json-schema/Object.d.ts +3 -0
- package/dist/components/json-schema/Object.js +189 -0
- package/dist/components/json-schema/index.d.ts +277 -0
- package/dist/components/json-schema/index.js +28 -0
- package/dist/components/schema-editor/Array.d.ts +11 -0
- package/dist/components/schema-editor/Common.d.ts +29 -0
- package/dist/components/schema-editor/Item.d.ts +8 -0
- package/dist/components/schema-editor/Object.d.ts +44 -0
- package/dist/components/schema-editor/SchemaVariableList.d.ts +193 -0
- package/dist/components/schema-editor/SchemaVariableList.js +83 -0
- package/dist/components/schema-editor/SchemaVariableListPicker.d.ts +186 -0
- package/dist/components/schema-editor/SchemaVariableListPicker.js +43 -0
- package/dist/components/schema-editor/index.d.ts +303 -0
- package/dist/components/table/Cell.d.ts +489 -0
- package/dist/components/table/Cell.js +47 -0
- package/dist/components/table/HeadCellDropDown.d.ts +293 -0
- package/dist/components/table/HeadCellDropDown.js +64 -0
- package/dist/components/table/HeadCellFilter.d.ts +419 -0
- package/dist/components/table/HeadCellFilter.js +146 -0
- package/dist/components/table/HeadCellSelect.d.ts +364 -0
- package/dist/components/table/HeadCellSelect.js +57 -0
- package/dist/components/table/HeadCellSort.d.ts +278 -0
- package/dist/components/table/HeadCellSort.js +83 -0
- package/dist/components/table/ItemActionsWrapper.d.ts +10 -0
- package/dist/components/table/ItemActionsWrapper.js +37 -0
- package/dist/components/table/index.d.ts +794 -0
- package/dist/components/table/index.js +1250 -0
- package/dist/components/virtual-list/SizeAndPositionManager.d.ts +70 -0
- package/dist/components/virtual-list/SizeAndPositionManager.js +220 -0
- package/dist/components/virtual-list/constants.d.ts +34 -0
- package/dist/components/virtual-list/constants.js +53 -0
- package/dist/components/virtual-list/index.d.ts +94 -0
- package/dist/components/virtual-list/index.js +309 -0
- package/dist/hooks/index.d.ts +7 -0
- package/dist/hooks/use-set-state.d.ts +2 -0
- package/dist/hooks/use-set-state.js +27 -0
- package/dist/hooks/use-touch.d.ts +16 -0
- package/dist/hooks/use-touch.js +81 -0
- package/dist/hooks/use-update-effect.d.ts +3 -0
- package/dist/hooks/use-update-effect.js +25 -0
- package/dist/hooks/use-validation-resolver.d.ts +2 -0
- package/dist/hooks/use-validation-resolver.js +59 -0
- package/dist/icons/alert-danger.svg.js +48 -0
- package/dist/icons/alert-info.svg.js +48 -0
- package/dist/icons/alert-success.svg.js +48 -0
- package/dist/icons/alert-warning.svg.js +48 -0
- package/dist/icons/back.svg.js +47 -0
- package/dist/icons/calendar.svg.js +56 -0
- package/dist/icons/caret.svg.js +46 -0
- package/dist/icons/check.svg.js +45 -0
- package/dist/icons/clock.svg.js +56 -0
- package/dist/icons/close-small.svg.js +49 -0
- package/dist/icons/close.svg.js +45 -0
- package/dist/icons/cloud-upload.svg.js +57 -0
- package/dist/icons/column-filter.svg.js +47 -0
- package/dist/icons/columns.svg.js +46 -0
- package/dist/icons/compress-alt.svg.js +46 -0
- package/dist/icons/copy.svg.js +51 -0
- package/dist/icons/date.svg.js +52 -0
- package/dist/icons/department.svg.js +78 -0
- package/dist/icons/desk-empty.svg.js +99 -0
- package/dist/icons/dot.svg.js +62 -0
- package/dist/icons/down-arrow-bold.svg.js +48 -0
- package/dist/icons/download.svg.js +50 -0
- package/dist/icons/drag-bar.svg.js +79 -0
- package/dist/icons/drag.svg.js +48 -0
- package/dist/icons/edit.svg.js +48 -0
- package/dist/icons/ellipsis-v.svg.js +47 -0
- package/dist/icons/enter.svg.js +45 -0
- package/dist/icons/exchange.svg.js +47 -0
- package/dist/icons/expand-alt.svg.js +46 -0
- package/dist/icons/fail.svg.js +54 -0
- package/dist/icons/file.svg.js +47 -0
- package/dist/icons/filter.svg.js +46 -0
- package/dist/icons/folder.svg.js +49 -0
- package/dist/icons/function.svg.js +48 -0
- package/dist/icons/home.svg.js +46 -0
- package/dist/icons/image.svg.js +45 -0
- package/dist/icons/info-circle.svg.js +46 -0
- package/dist/icons/info.svg.js +52 -0
- package/dist/icons/input-clear.svg.js +48 -0
- package/dist/icons/invisible.svg.js +48 -0
- package/dist/icons/left-arrow.svg.js +46 -0
- package/dist/icons/loading-outline.svg.js +49 -0
- package/dist/icons/location.svg.js +46 -0
- package/dist/icons/menu.svg.js +48 -0
- package/dist/icons/minus.svg.js +46 -0
- package/dist/icons/move.svg.js +47 -0
- package/dist/icons/mute.svg.js +46 -0
- package/dist/icons/pause.svg.js +46 -0
- package/dist/icons/pencil.svg.js +46 -0
- package/dist/icons/play.svg.js +45 -0
- package/dist/icons/plus-cicle.svg.js +47 -0
- package/dist/icons/plus-fine.svg.js +48 -0
- package/dist/icons/plus.svg.js +47 -0
- package/dist/icons/post.svg.js +74 -0
- package/dist/icons/question-mark.svg.js +51 -0
- package/dist/icons/question.svg.js +46 -0
- package/dist/icons/redo.svg.js +46 -0
- package/dist/icons/refresh.svg.js +47 -0
- package/dist/icons/reload.svg.js +46 -0
- package/dist/icons/remove.svg.js +48 -0
- package/dist/icons/retry.svg.js +51 -0
- package/dist/icons/right-arrow-bold.svg.js +46 -0
- package/dist/icons/right-arrow.svg.js +46 -0
- package/dist/icons/role.svg.js +69 -0
- package/dist/icons/schedule.svg.js +49 -0
- package/dist/icons/search.svg.js +45 -0
- package/dist/icons/setting.svg.js +47 -0
- package/dist/icons/slider-handle-icon.svg.js +48 -0
- package/dist/icons/sort-asc.svg.js +46 -0
- package/dist/icons/sort-default.svg.js +47 -0
- package/dist/icons/sort-desc.svg.js +46 -0
- package/dist/icons/star.svg.js +47 -0
- package/dist/icons/status-close.svg.js +49 -0
- package/dist/icons/status-fail.svg.js +48 -0
- package/dist/icons/status-info.svg.js +52 -0
- package/dist/icons/status-success.svg.js +48 -0
- package/dist/icons/status-warning.svg.js +52 -0
- package/dist/icons/success.svg.js +52 -0
- package/dist/icons/transparent.svg.js +65 -0
- package/dist/icons/trash.svg.js +48 -0
- package/dist/icons/tree-down.svg.js +47 -0
- package/dist/icons/undo.svg.js +46 -0
- package/dist/icons/upload.svg.js +48 -0
- package/dist/icons/user-remove.svg.js +59 -0
- package/dist/icons/view.svg.js +48 -0
- package/dist/icons/volume.svg.js +49 -0
- package/dist/icons/warning-mark.svg.js +49 -0
- package/dist/icons/warning.svg.js +46 -0
- package/dist/icons/window-restore.svg.js +46 -0
- package/dist/icons/zoom-in.svg.js +46 -0
- package/dist/icons/zoom-out.svg.js +46 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +151 -0
- package/dist/locale/de-DE.d.ts +1 -0
- package/dist/locale/de-DE.js +344 -0
- package/dist/locale/en-US.d.ts +1 -0
- package/dist/locale/en-US.js +347 -0
- package/dist/locale/zh-CN.d.ts +1 -0
- package/dist/locale/zh-CN.js +358 -0
- package/dist/themes/ang.d.ts +3 -0
- package/dist/themes/ang.js +20 -0
- package/dist/themes/antd.d.ts +1 -0
- package/dist/themes/antd.js +44 -0
- package/dist/themes/cxd.d.ts +3 -0
- package/dist/themes/cxd.js +459 -0
- package/dist/themes/dark.d.ts +3 -0
- package/dist/themes/dark.js +28 -0
- package/dist/themes/default.d.ts +4 -0
- package/esm-dist/components/404.d.ts +54 -0
- package/esm-dist/components/404.js +35 -0
- package/esm-dist/components/Alert.d.ts +560 -0
- package/esm-dist/components/Alert.js +188 -0
- package/esm-dist/components/Alert2.d.ts +66 -0
- package/esm-dist/components/Alert2.js +60 -0
- package/esm-dist/components/AnchorNav.d.ts +118 -0
- package/esm-dist/components/AnchorNav.js +171 -0
- package/esm-dist/components/ArrayInput.d.ts +625 -0
- package/esm-dist/components/ArrayInput.js +152 -0
- package/esm-dist/components/AsideNav.d.ts +142 -0
- package/esm-dist/components/AsideNav.js +130 -0
- package/esm-dist/components/AssociatedSelection.d.ts +491 -0
- package/esm-dist/components/AssociatedSelection.js +104 -0
- package/esm-dist/components/Avatar.d.ts +113 -0
- package/esm-dist/components/Avatar.js +125 -0
- package/esm-dist/components/Badge.d.ts +120 -0
- package/esm-dist/components/BaiduMapPicker.d.ts +86 -0
- package/esm-dist/components/BarCode.d.ts +58 -0
- package/esm-dist/components/Breadcrumb.d.ts +115 -0
- package/esm-dist/components/Breadcrumb.js +163 -0
- package/esm-dist/components/Button.d.ts +74 -0
- package/esm-dist/components/Button.js +64 -0
- package/esm-dist/components/CalendarMobile.d.ts +353 -0
- package/esm-dist/components/CalendarMobile.js +531 -0
- package/esm-dist/components/Card.d.ts +75 -0
- package/esm-dist/components/Cascader.d.ts +109 -0
- package/esm-dist/components/ChainedSelection.d.ts +480 -0
- package/esm-dist/components/ChainedSelection.js +121 -0
- package/esm-dist/components/Checkbox.d.ts +69 -0
- package/esm-dist/components/Checkbox.js +64 -0
- package/esm-dist/components/CityArea.d.ts +307 -0
- package/esm-dist/components/CityDB.d.ts +13 -0
- package/esm-dist/components/CodeMirror.d.ts +25 -0
- package/esm-dist/components/CodeMirror.js +104 -0
- package/esm-dist/components/Collapse.d.ts +92 -0
- package/esm-dist/components/Collapse.js +156 -0
- package/esm-dist/components/CollapseGroup.d.ts +68 -0
- package/esm-dist/components/CollapseGroup.js +88 -0
- package/esm-dist/components/ColorPicker.d.ts +524 -0
- package/esm-dist/components/ContextMenu.d.ts +96 -0
- package/esm-dist/components/ContextMenu.js +213 -0
- package/esm-dist/components/DatePicker.d.ts +619 -0
- package/esm-dist/components/DatePicker.js +524 -0
- package/esm-dist/components/DateRangePicker.d.ts +876 -0
- package/esm-dist/components/DateRangePicker.js +1038 -0
- package/esm-dist/components/Drawer.d.ts +95 -0
- package/esm-dist/components/Drawer.js +250 -0
- package/esm-dist/components/Editor.d.ts +605 -0
- package/esm-dist/components/Editor.js +234 -0
- package/esm-dist/components/Form.d.ts +22 -0
- package/esm-dist/components/FormField.d.ts +65 -0
- package/esm-dist/components/GridNav.d.ts +52 -0
- package/esm-dist/components/GroupedSelection.d.ts +467 -0
- package/esm-dist/components/GroupedSelection.js +62 -0
- package/esm-dist/components/Html.d.ts +83 -0
- package/esm-dist/components/Html.js +52 -0
- package/esm-dist/components/ImageGallery.d.ts +297 -0
- package/esm-dist/components/Input.d.ts +16 -0
- package/esm-dist/components/Input.js +62 -0
- package/esm-dist/components/InputBox.d.ts +99 -0
- package/esm-dist/components/InputBox.js +97 -0
- package/esm-dist/components/InputBoxWithSuggestion.d.ts +280 -0
- package/esm-dist/components/InputBoxWithSuggestion.js +66 -0
- package/esm-dist/components/Layout.d.ts +144 -0
- package/esm-dist/components/Layout.js +66 -0
- package/esm-dist/components/Link.d.ts +62 -0
- package/esm-dist/components/ListGroup.d.ts +76 -0
- package/esm-dist/components/ListGroup.js +31 -0
- package/esm-dist/components/ListMenu.d.ts +573 -0
- package/esm-dist/components/LocationPicker.d.ts +427 -0
- package/esm-dist/components/Markdown.d.ts +20 -0
- package/esm-dist/components/Modal.d.ts +1278 -0
- package/esm-dist/components/Modal.js +148 -0
- package/esm-dist/components/ModalManager.d.ts +17 -0
- package/esm-dist/components/ModalManager.js +42 -0
- package/esm-dist/components/MonthRangePicker.d.ts +748 -0
- package/esm-dist/components/NumberInput.d.ts +89 -0
- package/esm-dist/components/NumberInput.js +136 -0
- package/esm-dist/components/Overlay.d.ts +41 -0
- package/esm-dist/components/Overlay.js +207 -0
- package/esm-dist/components/Pagination.d.ts +685 -0
- package/esm-dist/components/Picker.d.ts +284 -0
- package/esm-dist/components/Picker.js +74 -0
- package/esm-dist/components/PickerColumn.d.ts +63 -0
- package/esm-dist/components/PickerColumn.js +275 -0
- package/esm-dist/components/PickerContainer.d.ts +303 -0
- package/esm-dist/components/PickerContainer.js +149 -0
- package/esm-dist/components/PopOver.d.ts +90 -0
- package/esm-dist/components/PopOver.js +89 -0
- package/esm-dist/components/PopOverContainer.d.ts +28 -0
- package/esm-dist/components/PopOverContainer.js +92 -0
- package/esm-dist/components/PopUp.d.ts +578 -0
- package/esm-dist/components/PopUp.js +85 -0
- package/esm-dist/components/Progress.d.ts +68 -0
- package/esm-dist/components/PullRefresh.d.ts +64 -0
- package/esm-dist/components/PullRefresh.js +141 -0
- package/esm-dist/components/Radios.d.ts +180 -0
- package/esm-dist/components/Radios.js +112 -0
- package/esm-dist/components/Range.d.ts +122 -0
- package/esm-dist/components/Range.js +405 -0
- package/esm-dist/components/Rating.d.ts +252 -0
- package/esm-dist/components/Rating.js +315 -0
- package/esm-dist/components/ResultBox.d.ts +290 -0
- package/esm-dist/components/ResultBox.js +146 -0
- package/esm-dist/components/ResultList.d.ts +319 -0
- package/esm-dist/components/ResultList.js +182 -0
- package/esm-dist/components/ResultTableList.d.ts +708 -0
- package/esm-dist/components/ResultTableList.js +126 -0
- package/esm-dist/components/ResultTreeList.d.ts +308 -0
- package/esm-dist/components/ResultTreeList.js +208 -0
- package/esm-dist/components/RichText.d.ts +45 -0
- package/esm-dist/components/SearchBox.d.ts +504 -0
- package/esm-dist/components/SearchBox.js +127 -0
- package/esm-dist/components/Select.d.ts +6281 -0
- package/esm-dist/components/Select.js +756 -0
- package/esm-dist/components/Selection.d.ts +510 -0
- package/esm-dist/components/Selection.js +140 -0
- package/esm-dist/components/SparkLine.d.ts +403 -0
- package/esm-dist/components/SparkLine.js +62 -0
- package/esm-dist/components/Spinner.d.ts +174 -0
- package/esm-dist/components/Spinner.js +67 -0
- package/esm-dist/components/Steps.d.ts +110 -0
- package/esm-dist/components/Switch.d.ts +101 -0
- package/esm-dist/components/Switch.js +64 -0
- package/esm-dist/components/TableSelection.d.ts +695 -0
- package/esm-dist/components/TableSelection.js +79 -0
- package/esm-dist/components/Tabs.d.ts +210 -0
- package/esm-dist/components/Tabs.js +473 -0
- package/esm-dist/components/TabsTransfer.d.ts +297 -0
- package/esm-dist/components/TabsTransfer.js +210 -0
- package/esm-dist/components/TabsTransferPicker.d.ts +273 -0
- package/esm-dist/components/Tag.d.ts +104 -0
- package/esm-dist/components/Textarea.d.ts +568 -0
- package/esm-dist/components/Textarea.js +134 -0
- package/esm-dist/components/Timeline.d.ts +47 -0
- package/esm-dist/components/TimelineItem.d.ts +297 -0
- package/esm-dist/components/Tinymce.d.ts +55 -0
- package/esm-dist/components/TitleBar.d.ts +115 -0
- package/esm-dist/components/TitleBar.js +48 -0
- package/esm-dist/components/Toast.d.ts +358 -0
- package/esm-dist/components/Toast.js +247 -0
- package/esm-dist/components/Tooltip.d.ts +65 -0
- package/esm-dist/components/Tooltip.js +36 -0
- package/esm-dist/components/TooltipWrapper.d.ts +155 -0
- package/esm-dist/components/TooltipWrapper.js +183 -0
- package/esm-dist/components/Transfer.d.ts +1243 -0
- package/esm-dist/components/Transfer.js +323 -0
- package/esm-dist/components/TransferDropDown.d.ts +271 -0
- package/esm-dist/components/TransferPicker.d.ts +277 -0
- package/esm-dist/components/TransferSearch.d.ts +292 -0
- package/esm-dist/components/TransferSearch.js +95 -0
- package/esm-dist/components/Tree.d.ts +1708 -0
- package/esm-dist/components/Tree.js +764 -0
- package/esm-dist/components/TreeSelection.d.ts +526 -0
- package/esm-dist/components/TreeSelection.js +200 -0
- package/esm-dist/components/UserSelect.d.ts +500 -0
- package/esm-dist/components/UserTabSelect.d.ts +320 -0
- package/esm-dist/components/WithRemoteConfig.d.ts +386 -0
- package/esm-dist/components/WithRemoteConfig.js +257 -0
- package/esm-dist/components/WithStore.d.ts +75 -0
- package/esm-dist/components/WithStore.js +48 -0
- package/esm-dist/components/calendar/Calendar.d.ts +64 -0
- package/esm-dist/components/calendar/Calendar.js +489 -0
- package/esm-dist/components/calendar/CalendarContainer.d.ts +10 -0
- package/esm-dist/components/calendar/CalendarContainer.js +27 -0
- package/esm-dist/components/calendar/DaysView.d.ts +170 -0
- package/esm-dist/components/calendar/DaysView.js +440 -0
- package/esm-dist/components/calendar/MonthsView.d.ts +128 -0
- package/esm-dist/components/calendar/MonthsView.js +158 -0
- package/esm-dist/components/calendar/QuartersView.d.ts +92 -0
- package/esm-dist/components/calendar/QuartersView.js +83 -0
- package/esm-dist/components/calendar/TimeView.d.ts +178 -0
- package/esm-dist/components/calendar/TimeView.js +462 -0
- package/esm-dist/components/calendar/YearsView.d.ts +102 -0
- package/esm-dist/components/calendar/YearsView.js +121 -0
- package/esm-dist/components/condition-builder/Expression.d.ts +298 -0
- package/esm-dist/components/condition-builder/Field.d.ts +280 -0
- package/esm-dist/components/condition-builder/Formula.d.ts +269 -0
- package/esm-dist/components/condition-builder/Func.d.ts +279 -0
- package/esm-dist/components/condition-builder/Group.d.ts +296 -0
- package/esm-dist/components/condition-builder/GroupOrItem.d.ts +72 -0
- package/esm-dist/components/condition-builder/InputSwitch.d.ts +47 -0
- package/esm-dist/components/condition-builder/Item.d.ts +292 -0
- package/esm-dist/components/condition-builder/Value.d.ts +277 -0
- package/esm-dist/components/condition-builder/config.d.ts +35 -0
- package/esm-dist/components/condition-builder/index.d.ts +303 -0
- package/esm-dist/components/condition-builder/types.d.ts +150 -0
- package/esm-dist/components/formula/Editor.d.ts +362 -0
- package/esm-dist/components/formula/Editor.js +208 -0
- package/esm-dist/components/formula/FuncList.d.ts +48 -0
- package/esm-dist/components/formula/FuncList.js +48 -0
- package/esm-dist/components/formula/Picker.d.ts +440 -0
- package/esm-dist/components/formula/Picker.js +222 -0
- package/esm-dist/components/formula/VariableList.d.ts +54 -0
- package/esm-dist/components/formula/VariableList.js +41 -0
- package/esm-dist/components/formula/plugin.d.ts +27 -0
- package/esm-dist/components/formula/plugin.js +206 -0
- package/esm-dist/components/icons.d.ts +45 -0
- package/esm-dist/components/icons.js +249 -0
- package/esm-dist/components/index.d.ts +64 -0
- package/esm-dist/components/json-schema/Array.d.ts +3 -0
- package/esm-dist/components/json-schema/Array.js +128 -0
- package/esm-dist/components/json-schema/Item.d.ts +3 -0
- package/esm-dist/components/json-schema/Item.js +37 -0
- package/esm-dist/components/json-schema/Object.d.ts +3 -0
- package/esm-dist/components/json-schema/Object.js +181 -0
- package/esm-dist/components/json-schema/index.d.ts +277 -0
- package/esm-dist/components/json-schema/index.js +20 -0
- package/esm-dist/components/schema-editor/Array.d.ts +11 -0
- package/esm-dist/components/schema-editor/Common.d.ts +29 -0
- package/esm-dist/components/schema-editor/Item.d.ts +8 -0
- package/esm-dist/components/schema-editor/Object.d.ts +44 -0
- package/esm-dist/components/schema-editor/SchemaVariableList.d.ts +193 -0
- package/esm-dist/components/schema-editor/SchemaVariableList.js +74 -0
- package/esm-dist/components/schema-editor/SchemaVariableListPicker.d.ts +186 -0
- package/esm-dist/components/schema-editor/SchemaVariableListPicker.js +34 -0
- package/esm-dist/components/schema-editor/index.d.ts +303 -0
- package/esm-dist/components/table/Cell.d.ts +489 -0
- package/esm-dist/components/table/Cell.js +38 -0
- package/esm-dist/components/table/HeadCellDropDown.d.ts +293 -0
- package/esm-dist/components/table/HeadCellDropDown.js +55 -0
- package/esm-dist/components/table/HeadCellFilter.d.ts +419 -0
- package/esm-dist/components/table/HeadCellFilter.js +136 -0
- package/esm-dist/components/table/HeadCellSelect.d.ts +364 -0
- package/esm-dist/components/table/HeadCellSelect.js +48 -0
- package/esm-dist/components/table/HeadCellSort.d.ts +278 -0
- package/esm-dist/components/table/HeadCellSort.js +74 -0
- package/esm-dist/components/table/ItemActionsWrapper.d.ts +10 -0
- package/esm-dist/components/table/ItemActionsWrapper.js +29 -0
- package/esm-dist/components/table/index.d.ts +794 -0
- package/esm-dist/components/table/index.js +1234 -0
- package/esm-dist/components/virtual-list/SizeAndPositionManager.d.ts +70 -0
- package/esm-dist/components/virtual-list/SizeAndPositionManager.js +216 -0
- package/esm-dist/components/virtual-list/constants.d.ts +34 -0
- package/esm-dist/components/virtual-list/constants.js +45 -0
- package/esm-dist/components/virtual-list/index.d.ts +94 -0
- package/esm-dist/components/virtual-list/index.js +281 -0
- package/esm-dist/hooks/index.d.ts +7 -0
- package/esm-dist/hooks/use-set-state.d.ts +2 -0
- package/esm-dist/hooks/use-set-state.js +19 -0
- package/esm-dist/hooks/use-touch.d.ts +16 -0
- package/esm-dist/hooks/use-touch.js +77 -0
- package/esm-dist/hooks/use-update-effect.d.ts +3 -0
- package/esm-dist/hooks/use-update-effect.js +21 -0
- package/esm-dist/hooks/use-validation-resolver.d.ts +2 -0
- package/esm-dist/hooks/use-validation-resolver.js +49 -0
- package/esm-dist/icons/alert-danger.svg.js +24 -0
- package/esm-dist/icons/alert-info.svg.js +24 -0
- package/esm-dist/icons/alert-success.svg.js +24 -0
- package/esm-dist/icons/alert-warning.svg.js +24 -0
- package/esm-dist/icons/back.svg.js +23 -0
- package/esm-dist/icons/calendar.svg.js +32 -0
- package/esm-dist/icons/caret.svg.js +22 -0
- package/esm-dist/icons/check.svg.js +21 -0
- package/esm-dist/icons/clock.svg.js +32 -0
- package/esm-dist/icons/close-small.svg.js +25 -0
- package/esm-dist/icons/close.svg.js +21 -0
- package/esm-dist/icons/cloud-upload.svg.js +33 -0
- package/esm-dist/icons/column-filter.svg.js +23 -0
- package/esm-dist/icons/columns.svg.js +22 -0
- package/esm-dist/icons/compress-alt.svg.js +22 -0
- package/esm-dist/icons/copy.svg.js +27 -0
- package/esm-dist/icons/date.svg.js +28 -0
- package/esm-dist/icons/department.svg.js +54 -0
- package/esm-dist/icons/desk-empty.svg.js +75 -0
- package/esm-dist/icons/dot.svg.js +38 -0
- package/esm-dist/icons/down-arrow-bold.svg.js +24 -0
- package/esm-dist/icons/download.svg.js +26 -0
- package/esm-dist/icons/drag-bar.svg.js +55 -0
- package/esm-dist/icons/drag.svg.js +24 -0
- package/esm-dist/icons/edit.svg.js +24 -0
- package/esm-dist/icons/ellipsis-v.svg.js +23 -0
- package/esm-dist/icons/enter.svg.js +21 -0
- package/esm-dist/icons/exchange.svg.js +23 -0
- package/esm-dist/icons/expand-alt.svg.js +22 -0
- package/esm-dist/icons/fail.svg.js +30 -0
- package/esm-dist/icons/file.svg.js +23 -0
- package/esm-dist/icons/filter.svg.js +22 -0
- package/esm-dist/icons/folder.svg.js +25 -0
- package/esm-dist/icons/function.svg.js +24 -0
- package/esm-dist/icons/home.svg.js +22 -0
- package/esm-dist/icons/image.svg.js +21 -0
- package/esm-dist/icons/info-circle.svg.js +22 -0
- package/esm-dist/icons/info.svg.js +28 -0
- package/esm-dist/icons/input-clear.svg.js +24 -0
- package/esm-dist/icons/invisible.svg.js +24 -0
- package/esm-dist/icons/left-arrow.svg.js +22 -0
- package/esm-dist/icons/loading-outline.svg.js +25 -0
- package/esm-dist/icons/location.svg.js +22 -0
- package/esm-dist/icons/menu.svg.js +24 -0
- package/esm-dist/icons/minus.svg.js +22 -0
- package/esm-dist/icons/move.svg.js +23 -0
- package/esm-dist/icons/mute.svg.js +22 -0
- package/esm-dist/icons/pause.svg.js +22 -0
- package/esm-dist/icons/pencil.svg.js +22 -0
- package/esm-dist/icons/play.svg.js +21 -0
- package/esm-dist/icons/plus-cicle.svg.js +23 -0
- package/esm-dist/icons/plus-fine.svg.js +24 -0
- package/esm-dist/icons/plus.svg.js +23 -0
- package/esm-dist/icons/post.svg.js +50 -0
- package/esm-dist/icons/question-mark.svg.js +27 -0
- package/esm-dist/icons/question.svg.js +22 -0
- package/esm-dist/icons/redo.svg.js +22 -0
- package/esm-dist/icons/refresh.svg.js +23 -0
- package/esm-dist/icons/reload.svg.js +22 -0
- package/esm-dist/icons/remove.svg.js +24 -0
- package/esm-dist/icons/retry.svg.js +27 -0
- package/esm-dist/icons/right-arrow-bold.svg.js +22 -0
- package/esm-dist/icons/right-arrow.svg.js +22 -0
- package/esm-dist/icons/role.svg.js +45 -0
- package/esm-dist/icons/schedule.svg.js +25 -0
- package/esm-dist/icons/search.svg.js +21 -0
- package/esm-dist/icons/setting.svg.js +23 -0
- package/esm-dist/icons/slider-handle-icon.svg.js +24 -0
- package/esm-dist/icons/sort-asc.svg.js +22 -0
- package/esm-dist/icons/sort-default.svg.js +23 -0
- package/esm-dist/icons/sort-desc.svg.js +22 -0
- package/esm-dist/icons/star.svg.js +23 -0
- package/esm-dist/icons/status-close.svg.js +25 -0
- package/esm-dist/icons/status-fail.svg.js +24 -0
- package/esm-dist/icons/status-info.svg.js +28 -0
- package/esm-dist/icons/status-success.svg.js +24 -0
- package/esm-dist/icons/status-warning.svg.js +28 -0
- package/esm-dist/icons/success.svg.js +28 -0
- package/esm-dist/icons/transparent.svg.js +41 -0
- package/esm-dist/icons/trash.svg.js +24 -0
- package/esm-dist/icons/tree-down.svg.js +23 -0
- package/esm-dist/icons/undo.svg.js +22 -0
- package/esm-dist/icons/upload.svg.js +24 -0
- package/esm-dist/icons/user-remove.svg.js +35 -0
- package/esm-dist/icons/view.svg.js +24 -0
- package/esm-dist/icons/volume.svg.js +25 -0
- package/esm-dist/icons/warning-mark.svg.js +25 -0
- package/esm-dist/icons/warning.svg.js +22 -0
- package/esm-dist/icons/window-restore.svg.js +22 -0
- package/esm-dist/icons/zoom-in.svg.js +22 -0
- package/esm-dist/icons/zoom-out.svg.js +22 -0
- package/esm-dist/index.d.ts +10 -0
- package/esm-dist/index.js +74 -0
- package/esm-dist/locale/de-DE.d.ts +1 -0
- package/esm-dist/locale/de-DE.js +342 -0
- package/esm-dist/locale/en-US.d.ts +1 -0
- package/esm-dist/locale/en-US.js +345 -0
- package/esm-dist/locale/zh-CN.d.ts +1 -0
- package/esm-dist/locale/zh-CN.js +356 -0
- package/esm-dist/themes/ang.d.ts +3 -0
- package/esm-dist/themes/ang.js +15 -0
- package/esm-dist/themes/antd.d.ts +1 -0
- package/esm-dist/themes/antd.js +42 -0
- package/esm-dist/themes/cxd.d.ts +3 -0
- package/esm-dist/themes/cxd.js +455 -0
- package/esm-dist/themes/dark.d.ts +3 -0
- package/esm-dist/themes/dark.js +23 -0
- package/esm-dist/themes/default.d.ts +4 -0
- package/package.json +71 -0
- package/rollup.config.js +129 -0
- package/scss/README.md +9 -0
- package/scss/_functions.scss +101 -0
- package/scss/_mixins.scss +472 -0
- package/scss/_properties.scss +1702 -0
- package/scss/_thirds.scss +8 -0
- package/scss/_utilities.scss +1753 -0
- package/scss/_variables.scss +417 -0
- package/scss/base/_common.scss +3 -0
- package/scss/base/_normalize.scss +361 -0
- package/scss/base/_reset.scss +18 -0
- package/scss/base/_typography.scss +59 -0
- package/scss/components/_alert.scss +82 -0
- package/scss/components/_anchor-nav.scss +115 -0
- package/scss/components/_app.scss +31 -0
- package/scss/components/_array-input.scss +101 -0
- package/scss/components/_audio.scss +146 -0
- package/scss/components/_avatar.scss +55 -0
- package/scss/components/_badge.scss +136 -0
- package/scss/components/_barcode.scss +6 -0
- package/scss/components/_breadcrumb.scss +98 -0
- package/scss/components/_button-group.scss +131 -0
- package/scss/components/_button.scss +379 -0
- package/scss/components/_calendar.scss +395 -0
- package/scss/components/_card.scss +359 -0
- package/scss/components/_card2.scss +28 -0
- package/scss/components/_cards.scss +187 -0
- package/scss/components/_carousel.scss +197 -0
- package/scss/components/_cascader.scss +102 -0
- package/scss/components/_chart.scss +20 -0
- package/scss/components/_city-area.scss +29 -0
- package/scss/components/_collapse-group.scss +30 -0
- package/scss/components/_collapse.scss +120 -0
- package/scss/components/_color.scss +18 -0
- package/scss/components/_column-toggler.scss +244 -0
- package/scss/components/_condition-builder.scss +280 -0
- package/scss/components/_context-menu.scss +206 -0
- package/scss/components/_copyable.scss +10 -0
- package/scss/components/_crud.scss +151 -0
- package/scss/components/_debug.scss +170 -0
- package/scss/components/_divider.scss +11 -0
- package/scss/components/_drawer.scss +314 -0
- package/scss/components/_dropdown.scss +144 -0
- package/scss/components/_each.scss +7 -0
- package/scss/components/_formula.scss +407 -0
- package/scss/components/_grid-nav.scss +128 -0
- package/scss/components/_icon.scss +4 -0
- package/scss/components/_image-gallery.scss +205 -0
- package/scss/components/_images.scss +186 -0
- package/scss/components/_input-box.scss +74 -0
- package/scss/components/_json-schema-editor.scss +126 -0
- package/scss/components/_json-schema.scss +124 -0
- package/scss/components/_json.scss +7 -0
- package/scss/components/_link.scss +6 -0
- package/scss/components/_list-menu.scss +74 -0
- package/scss/components/_list.scss +249 -0
- package/scss/components/_log.scss +141 -0
- package/scss/components/_mapping.scss +6 -0
- package/scss/components/_markdown.scss +266 -0
- package/scss/components/_modal.scss +252 -0
- package/scss/components/_nav.scss +310 -0
- package/scss/components/_page.scss +144 -0
- package/scss/components/_pagination.scss +200 -0
- package/scss/components/_panel.scss +229 -0
- package/scss/components/_picker-columns.scss +140 -0
- package/scss/components/_popover.scss +54 -0
- package/scss/components/_popoverable.scss +62 -0
- package/scss/components/_popup.scss +160 -0
- package/scss/components/_portlet.scss +51 -0
- package/scss/components/_progress.scss +142 -0
- package/scss/components/_property.scss +47 -0
- package/scss/components/_pull-refresh.scss +25 -0
- package/scss/components/_quick-edit.scss +56 -0
- package/scss/components/_remark.scss +58 -0
- package/scss/components/_result-box.scss +246 -0
- package/scss/components/_search-box.scss +138 -0
- package/scss/components/_service.scss +3 -0
- package/scss/components/_sparkline.scss +18 -0
- package/scss/components/_spinner.scss +176 -0
- package/scss/components/_status.scss +102 -0
- package/scss/components/_steps.scss +394 -0
- package/scss/components/_table-v2.scss +912 -0
- package/scss/components/_table.scss +936 -0
- package/scss/components/_tabs.scss +1021 -0
- package/scss/components/_tag.scss +177 -0
- package/scss/components/_timeline.scss +198 -0
- package/scss/components/_toast.scss +272 -0
- package/scss/components/_tooltip.scss +339 -0
- package/scss/components/_tpl.scss +5 -0
- package/scss/components/_video.scss +38 -0
- package/scss/components/_wizard.scss +270 -0
- package/scss/components/_wrapper.scss +21 -0
- package/scss/components/form/_chained-select.scss +5 -0
- package/scss/components/form/_checks.scss +513 -0
- package/scss/components/form/_city.scss +33 -0
- package/scss/components/form/_color.scss +119 -0
- package/scss/components/form/_combo.scss +316 -0
- package/scss/components/form/_date-range.scss +222 -0
- package/scss/components/form/_date.scss +633 -0
- package/scss/components/form/_editor.scss +125 -0
- package/scss/components/form/_excel.scss +42 -0
- package/scss/components/form/_fieldset.scss +136 -0
- package/scss/components/form/_file.scss +246 -0
- package/scss/components/form/_form.scss +617 -0
- package/scss/components/form/_group.scss +116 -0
- package/scss/components/form/_icon-picker.scss +107 -0
- package/scss/components/form/_image.scss +266 -0
- package/scss/components/form/_input-group.scss +150 -0
- package/scss/components/form/_list.scss +122 -0
- package/scss/components/form/_location.scss +140 -0
- package/scss/components/form/_matrix.scss +5 -0
- package/scss/components/form/_nested-select.scss +106 -0
- package/scss/components/form/_number.scss +312 -0
- package/scss/components/form/_picker.scss +101 -0
- package/scss/components/form/_qr-code.scss +4 -0
- package/scss/components/form/_range.scss +274 -0
- package/scss/components/form/_rating.scss +74 -0
- package/scss/components/form/_repeat.scss +40 -0
- package/scss/components/form/_result-list.scss +87 -0
- package/scss/components/form/_rich-text.scss +116 -0
- package/scss/components/form/_select.scss +447 -0
- package/scss/components/form/_selection.scss +350 -0
- package/scss/components/form/_sub-form.scss +118 -0
- package/scss/components/form/_switch.scss +102 -0
- package/scss/components/form/_tag.scss +92 -0
- package/scss/components/form/_text.scss +307 -0
- package/scss/components/form/_textarea.scss +62 -0
- package/scss/components/form/_tinymce.scss +6 -0
- package/scss/components/form/_transfer.scss +320 -0
- package/scss/components/form/_tree-select.scss +39 -0
- package/scss/components/form/_tree.scss +317 -0
- package/scss/components/form/_user-select.scss +422 -0
- package/scss/components/react-datetime.scss +247 -0
- package/scss/helper/background/_background-color.scss +214 -0
- package/scss/helper/border/_border-color.scss +178 -0
- package/scss/helper/border/_border-radius.scss +152 -0
- package/scss/helper/border/_border-style.scss +40 -0
- package/scss/helper/border/_border-width.scss +72 -0
- package/scss/helper/box-alignment/_align-content.scss +44 -0
- package/scss/helper/box-alignment/_align-items.scss +41 -0
- package/scss/helper/box-alignment/_align-self.scss +40 -0
- package/scss/helper/box-alignment/_justify-content.scss +44 -0
- package/scss/helper/box-alignment/_justify-items.scss +40 -0
- package/scss/helper/box-alignment/_justify-self.scss +40 -0
- package/scss/helper/box-alignment/_place-content.scss +48 -0
- package/scss/helper/box-alignment/_place-items.scss +40 -0
- package/scss/helper/box-alignment/_place-self.scss +40 -0
- package/scss/helper/effect/_box-shadow.scss +74 -0
- package/scss/helper/effect/_opacity.scss +66 -0
- package/scss/helper/flex/_direction.scss +41 -0
- package/scss/helper/flex/_flex.scss +38 -0
- package/scss/helper/flex/_grow.scss +28 -0
- package/scss/helper/flex/_order.scss +56 -0
- package/scss/helper/flex/_shrink.scss +27 -0
- package/scss/helper/flex/_wrap.scss +36 -0
- package/scss/helper/grid/_auto-columns.scss +38 -0
- package/scss/helper/grid/_auto-flow.scss +38 -0
- package/scss/helper/grid/_auto-rows.scss +38 -0
- package/scss/helper/grid/_column-start-end.scss +201 -0
- package/scss/helper/grid/_columns.scss +74 -0
- package/scss/helper/grid/_gap.scss +154 -0
- package/scss/helper/grid/_row-start-end.scss +201 -0
- package/scss/helper/grid/_rows.scss +50 -0
- package/scss/helper/layout/_box-sizing.scss +51 -0
- package/scss/helper/layout/_clear.scss +56 -0
- package/scss/helper/layout/_display.scss +82 -0
- package/scss/helper/layout/_float.scss +71 -0
- package/scss/helper/layout/_overflow.scss +85 -0
- package/scss/helper/layout/_position.scss +55 -0
- package/scss/helper/layout/_top-right-bottom-left.scss +292 -0
- package/scss/helper/layout/_visibility.scss +42 -0
- package/scss/helper/layout/_z-index.scss +67 -0
- package/scss/helper/sizing/_height.scss +161 -0
- package/scss/helper/sizing/_width.scss +158 -0
- package/scss/helper/spacing/_margin.scss +821 -0
- package/scss/helper/spacing/_padding.scss +394 -0
- package/scss/helper/spacing/_space-between.scss +224 -0
- package/scss/helper/typography/_font-family.scss +28 -0
- package/scss/helper/typography/_font-size.scss +40 -0
- package/scss/helper/typography/_font-style.scss +31 -0
- package/scss/helper/typography/_font-weight.scss +49 -0
- package/scss/helper/typography/_letter-spacing.scss +43 -0
- package/scss/helper/typography/_line-height.scss +59 -0
- package/scss/helper/typography/_list-style-type.scss +43 -0
- package/scss/helper/typography/_text-align.scss +34 -0
- package/scss/helper/typography/_text-color.scss +184 -0
- package/scss/helper/typography/_text-decoration.scss +34 -0
- package/scss/helper/typography/_text-overflow.scss +40 -0
- package/scss/helper/typography/_text-transform.scss +40 -0
- package/scss/helper/typography/_vertical-align.scss +44 -0
- package/scss/helper/typography/_whitespace.scss +42 -0
- package/scss/helper/typography/_word-break.scss +36 -0
- package/scss/helper.scss +70 -0
- package/scss/layout/_aside.scss +361 -0
- package/scss/layout/_grid.scss +171 -0
- package/scss/layout/_hbox.scss +127 -0
- package/scss/layout/_header.scss +0 -0
- package/scss/layout/_layout.scss +458 -0
- package/scss/layout/_vbox.scss +38 -0
- package/scss/themes/_ang-variables.scss +132 -0
- package/scss/themes/_antd-colors.scss +149 -0
- package/scss/themes/_antd-variables.scss +171 -0
- package/scss/themes/_common.scss +138 -0
- package/scss/themes/_cxd-colors.scss +56 -0
- package/scss/themes/_cxd-variables.scss +687 -0
- package/scss/themes/_dark-variables.scss +129 -0
- package/scss/themes/ang-ie11.scss +1 -0
- package/scss/themes/ang.scss +4 -0
- package/scss/themes/antd-ie11.scss +1 -0
- package/scss/themes/antd.scss +5 -0
- package/scss/themes/cxd-ie11.scss +1 -0
- package/scss/themes/cxd.scss +426 -0
- package/scss/themes/dark-ie11.scss +1 -0
- package/scss/themes/dark.scss +3 -0
- package/scss/themes/default.scss +2 -0
- package/scss/themes/extract-antd-color.py +27 -0
- package/src/components/404.tsx +49 -0
- package/src/components/Alert.tsx +300 -0
- package/src/components/Alert2.tsx +117 -0
- package/src/components/AnchorNav.tsx +265 -0
- package/src/components/ArrayInput.tsx +234 -0
- package/src/components/AsideNav.tsx +280 -0
- package/src/components/AssociatedSelection.tsx +243 -0
- package/src/components/Avatar.tsx +255 -0
- package/src/components/Badge.tsx +300 -0
- package/src/components/BaiduMapPicker.tsx +394 -0
- package/src/components/BarCode.tsx +50 -0
- package/src/components/Breadcrumb.tsx +294 -0
- package/src/components/Button.tsx +149 -0
- package/src/components/CalendarMobile.tsx +803 -0
- package/src/components/Card.tsx +206 -0
- package/src/components/Cascader.tsx +596 -0
- package/src/components/ChainedSelection.tsx +253 -0
- package/src/components/Checkbox.tsx +117 -0
- package/src/components/CityArea.tsx +318 -0
- package/src/components/CityDB.ts +4109 -0
- package/src/components/CodeMirror.tsx +99 -0
- package/src/components/Collapse.tsx +253 -0
- package/src/components/CollapseGroup.tsx +133 -0
- package/src/components/ColorPicker.tsx +374 -0
- package/src/components/ContextMenu.tsx +313 -0
- package/src/components/DatePicker.tsx +879 -0
- package/src/components/DateRangePicker.tsx +1500 -0
- package/src/components/Drawer.tsx +357 -0
- package/src/components/Editor.tsx +341 -0
- package/src/components/Form.tsx +70 -0
- package/src/components/FormField.tsx +127 -0
- package/src/components/GridNav.tsx +233 -0
- package/src/components/GroupedSelection.tsx +123 -0
- package/src/components/Html.tsx +75 -0
- package/src/components/ImageGallery.tsx +179 -0
- package/src/components/Input.tsx +72 -0
- package/src/components/InputBox.tsx +126 -0
- package/src/components/InputBoxWithSuggestion.tsx +113 -0
- package/src/components/Layout.tsx +123 -0
- package/src/components/Link.tsx +85 -0
- package/src/components/ListGroup.tsx +72 -0
- package/src/components/ListMenu.tsx +112 -0
- package/src/components/LocationPicker.tsx +213 -0
- package/src/components/Markdown.tsx +53 -0
- package/src/components/Modal.tsx +294 -0
- package/src/components/ModalManager.ts +49 -0
- package/src/components/MonthRangePicker.tsx +699 -0
- package/src/components/NumberInput.tsx +255 -0
- package/src/components/Overlay.tsx +317 -0
- package/src/components/Pagination.tsx +526 -0
- package/src/components/Picker.tsx +161 -0
- package/src/components/PickerColumn.tsx +400 -0
- package/src/components/PickerContainer.tsx +178 -0
- package/src/components/PopOver.tsx +155 -0
- package/src/components/PopOverContainer.tsx +114 -0
- package/src/components/PopUp.tsx +161 -0
- package/src/components/Progress.tsx +173 -0
- package/src/components/PullRefresh.tsx +197 -0
- package/src/components/Radios.tsx +198 -0
- package/src/components/Range.tsx +561 -0
- package/src/components/Rating.tsx +421 -0
- package/src/components/ResultBox.tsx +224 -0
- package/src/components/ResultList.tsx +300 -0
- package/src/components/ResultTableList.tsx +229 -0
- package/src/components/ResultTreeList.tsx +312 -0
- package/src/components/RichText.tsx +312 -0
- package/src/components/SearchBox.tsx +175 -0
- package/src/components/Select.tsx +1229 -0
- package/src/components/Selection.tsx +232 -0
- package/src/components/SparkLine.tsx +111 -0
- package/src/components/Spinner.tsx +126 -0
- package/src/components/Steps.tsx +221 -0
- package/src/components/Switch.tsx +122 -0
- package/src/components/TableSelection.tsx +183 -0
- package/src/components/Tabs.tsx +747 -0
- package/src/components/TabsTransfer.tsx +422 -0
- package/src/components/TabsTransferPicker.tsx +111 -0
- package/src/components/Tag.tsx +179 -0
- package/src/components/Textarea.tsx +234 -0
- package/src/components/Timeline.tsx +36 -0
- package/src/components/TimelineItem.tsx +140 -0
- package/src/components/Tinymce.tsx +614 -0
- package/src/components/TitleBar.tsx +61 -0
- package/src/components/Toast.tsx +421 -0
- package/src/components/Tooltip.tsx +78 -0
- package/src/components/TooltipWrapper.tsx +366 -0
- package/src/components/Transfer.tsx +755 -0
- package/src/components/TransferDropDown.tsx +136 -0
- package/src/components/TransferPicker.tsx +118 -0
- package/src/components/TransferSearch.tsx +126 -0
- package/src/components/Tree.tsx +1183 -0
- package/src/components/TreeSelection.tsx +315 -0
- package/src/components/UserSelect.tsx +850 -0
- package/src/components/UserTabSelect.tsx +261 -0
- package/src/components/WithRemoteConfig.tsx +406 -0
- package/src/components/WithStore.tsx +73 -0
- package/src/components/calendar/Calendar.tsx +710 -0
- package/src/components/calendar/CalendarContainer.tsx +30 -0
- package/src/components/calendar/DaysView.tsx +812 -0
- package/src/components/calendar/MonthsView.tsx +288 -0
- package/src/components/calendar/QuartersView.tsx +156 -0
- package/src/components/calendar/TimeView.tsx +742 -0
- package/src/components/calendar/YearsView.tsx +214 -0
- package/src/components/condition-builder/Expression.tsx +244 -0
- package/src/components/condition-builder/Field.tsx +152 -0
- package/src/components/condition-builder/Formula.tsx +39 -0
- package/src/components/condition-builder/Func.tsx +141 -0
- package/src/components/condition-builder/Group.tsx +258 -0
- package/src/components/condition-builder/GroupOrItem.tsx +161 -0
- package/src/components/condition-builder/InputSwitch.tsx +51 -0
- package/src/components/condition-builder/Item.tsx +427 -0
- package/src/components/condition-builder/Value.tsx +162 -0
- package/src/components/condition-builder/config.ts +133 -0
- package/src/components/condition-builder/index.tsx +269 -0
- package/src/components/condition-builder/types.ts +218 -0
- package/src/components/formula/Editor.tsx +337 -0
- package/src/components/formula/FuncList.tsx +113 -0
- package/src/components/formula/Picker.tsx +415 -0
- package/src/components/formula/VariableList.tsx +126 -0
- package/src/components/formula/plugin.ts +252 -0
- package/src/components/icons.tsx +267 -0
- package/src/components/index.tsx +133 -0
- package/src/components/json-schema/Array.tsx +216 -0
- package/src/components/json-schema/Item.tsx +47 -0
- package/src/components/json-schema/Object.tsx +339 -0
- package/src/components/json-schema/index.tsx +48 -0
- package/src/components/schema-editor/Array.tsx +99 -0
- package/src/components/schema-editor/Common.tsx +191 -0
- package/src/components/schema-editor/Item.tsx +30 -0
- package/src/components/schema-editor/Object.tsx +302 -0
- package/src/components/schema-editor/SchemaVariableList.tsx +98 -0
- package/src/components/schema-editor/SchemaVariableListPicker.tsx +68 -0
- package/src/components/schema-editor/index.tsx +228 -0
- package/src/components/table/Cell.tsx +71 -0
- package/src/components/table/HeadCellDropDown.tsx +112 -0
- package/src/components/table/HeadCellFilter.tsx +230 -0
- package/src/components/table/HeadCellSelect.tsx +97 -0
- package/src/components/table/HeadCellSort.tsx +99 -0
- package/src/components/table/ItemActionsWrapper.tsx +37 -0
- package/src/components/table/index.tsx +2012 -0
- package/src/components/virtual-list/SizeAndPositionManager.ts +308 -0
- package/src/components/virtual-list/constants.ts +41 -0
- package/src/components/virtual-list/index.tsx +447 -0
- package/src/custom.d.ts +14 -0
- package/src/hooks/index.ts +7 -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/hooks/use-validation-resolver.ts +47 -0
- package/src/icons/alert-danger.svg +1 -0
- package/src/icons/alert-info.svg +1 -0
- package/src/icons/alert-success.svg +1 -0
- package/src/icons/alert-warning.svg +1 -0
- package/src/icons/back.svg +11 -0
- package/src/icons/calendar.svg +27 -0
- package/src/icons/caret.svg +7 -0
- package/src/icons/check.svg +9 -0
- package/src/icons/clock.svg +1 -0
- package/src/icons/close-small.svg +5 -0
- package/src/icons/close.svg +4 -0
- package/src/icons/cloud-upload.svg +22 -0
- package/src/icons/column-filter.svg +9 -0
- package/src/icons/columns.svg +7 -0
- package/src/icons/compress-alt.svg +3 -0
- package/src/icons/copy.svg +9 -0
- package/src/icons/date.svg +9 -0
- package/src/icons/department.svg +17 -0
- package/src/icons/desk-empty.svg +25 -0
- package/src/icons/dot.svg +11 -0
- package/src/icons/down-arrow-bold.svg +10 -0
- package/src/icons/download.svg +4 -0
- package/src/icons/drag-bar.svg +13 -0
- package/src/icons/drag.svg +8 -0
- package/src/icons/edit.svg +8 -0
- package/src/icons/ellipsis-v.svg +9 -0
- package/src/icons/enter.svg +4 -0
- package/src/icons/exchange.svg +7 -0
- package/src/icons/expand-alt.svg +3 -0
- package/src/icons/fail.svg +8 -0
- package/src/icons/file.svg +8 -0
- package/src/icons/filter.svg +7 -0
- package/src/icons/folder.svg +9 -0
- package/src/icons/function.svg +4 -0
- package/src/icons/home.svg +7 -0
- package/src/icons/image.svg +1 -0
- package/src/icons/info-circle.svg +7 -0
- package/src/icons/info.svg +8 -0
- package/src/icons/input-clear.svg +1 -0
- package/src/icons/invisible.svg +10 -0
- package/src/icons/left-arrow.svg +7 -0
- package/src/icons/loading-outline.svg +4 -0
- package/src/icons/location.svg +10 -0
- package/src/icons/menu.svg +2 -0
- package/src/icons/minus.svg +7 -0
- package/src/icons/move.svg +8 -0
- package/src/icons/mute.svg +4 -0
- package/src/icons/pause.svg +5 -0
- package/src/icons/pencil.svg +7 -0
- package/src/icons/play.svg +4 -0
- package/src/icons/plus-cicle.svg +9 -0
- package/src/icons/plus-fine.svg +10 -0
- package/src/icons/plus.svg +9 -0
- package/src/icons/post.svg +15 -0
- package/src/icons/question-mark.svg +12 -0
- package/src/icons/question.svg +7 -0
- package/src/icons/redo.svg +7 -0
- package/src/icons/refresh.svg +7 -0
- package/src/icons/reload.svg +6 -0
- package/src/icons/remove.svg +10 -0
- package/src/icons/retry.svg +8 -0
- package/src/icons/right-arrow-bold.svg +7 -0
- package/src/icons/right-arrow.svg +7 -0
- package/src/icons/role.svg +14 -0
- package/src/icons/schedule.svg +9 -0
- package/src/icons/search.svg +4 -0
- package/src/icons/setting.svg +9 -0
- package/src/icons/slider-handle-icon.svg +6 -0
- package/src/icons/sort-asc.svg +7 -0
- package/src/icons/sort-default.svg +9 -0
- package/src/icons/sort-desc.svg +7 -0
- package/src/icons/star.svg +12 -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/icons/success.svg +10 -0
- package/src/icons/transparent.svg +11 -0
- package/src/icons/trash.svg +8 -0
- package/src/icons/tree-down.svg +5 -0
- package/src/icons/undo.svg +7 -0
- package/src/icons/upload.svg +9 -0
- package/src/icons/user-remove.svg +12 -0
- package/src/icons/view.svg +10 -0
- package/src/icons/volume.svg +5 -0
- package/src/icons/warning-mark.svg +13 -0
- package/src/icons/warning.svg +7 -0
- package/src/icons/window-restore.svg +7 -0
- package/src/icons/zoom-in.svg +7 -0
- package/src/icons/zoom-out.svg +7 -0
- package/src/index.tsx +11 -0
- package/src/locale/de-DE.ts +357 -0
- package/src/locale/en-US.ts +346 -0
- package/src/locale/zh-CN.ts +351 -0
- package/src/themes/ang.ts +8 -0
- package/src/themes/antd.ts +44 -0
- package/src/themes/cxd.ts +458 -0
- package/src/themes/dark.ts +16 -0
- package/src/themes/default.ts +5 -0
- package/tsconfig.json +14 -0
- package/tsconfig.tsbuildinfo +1 -0
|
@@ -0,0 +1,1229 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file Select
|
|
3
|
+
* @description
|
|
4
|
+
* @author fex
|
|
5
|
+
* @date 2017-11-07
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import {uncontrollable} from 'uncontrollable';
|
|
9
|
+
import React from 'react';
|
|
10
|
+
import VirtualList from './virtual-list';
|
|
11
|
+
import Overlay from './Overlay';
|
|
12
|
+
import PopOver from './PopOver';
|
|
13
|
+
import TooltipWrapper from './TooltipWrapper';
|
|
14
|
+
import Downshift, {ControllerStateAndHelpers} from 'downshift';
|
|
15
|
+
import {closeIcon, Icon} from './icons';
|
|
16
|
+
// @ts-ignore
|
|
17
|
+
import {matchSorter} from 'match-sorter';
|
|
18
|
+
import {
|
|
19
|
+
noop,
|
|
20
|
+
isObject,
|
|
21
|
+
findTree,
|
|
22
|
+
autobind,
|
|
23
|
+
ucFirst,
|
|
24
|
+
normalizeNodePath,
|
|
25
|
+
isMobile
|
|
26
|
+
} from 'amis-core';
|
|
27
|
+
import find from 'lodash/find';
|
|
28
|
+
import isPlainObject from 'lodash/isPlainObject';
|
|
29
|
+
import union from 'lodash/union';
|
|
30
|
+
import {highlight} from 'amis-core';
|
|
31
|
+
import {findDOMNode} from 'react-dom';
|
|
32
|
+
import {ClassNamesFn, themeable, ThemeProps} from 'amis-core';
|
|
33
|
+
import Checkbox from './Checkbox';
|
|
34
|
+
import Input from './Input';
|
|
35
|
+
import {LocaleProps, localeable} from 'amis-core';
|
|
36
|
+
import Spinner from './Spinner';
|
|
37
|
+
import type {Option, Options} from 'amis-core/dist/Schema';
|
|
38
|
+
import {RemoteOptionsProps, withRemoteConfig} from './WithRemoteConfig';
|
|
39
|
+
import Picker from './Picker';
|
|
40
|
+
import PopUp from './PopUp';
|
|
41
|
+
|
|
42
|
+
export {Option, Options};
|
|
43
|
+
|
|
44
|
+
export interface OptionProps {
|
|
45
|
+
className?: string;
|
|
46
|
+
multi?: boolean;
|
|
47
|
+
multiple?: boolean;
|
|
48
|
+
valueField?: string;
|
|
49
|
+
labelField?: string;
|
|
50
|
+
simpleValue?: boolean; // 默认onChange 出去是整个 option 节点,如果配置了 simpleValue 就只包含值。
|
|
51
|
+
options: Options;
|
|
52
|
+
loading?: boolean;
|
|
53
|
+
joinValues?: boolean;
|
|
54
|
+
extractValue?: boolean;
|
|
55
|
+
delimiter?: string;
|
|
56
|
+
clearable?: boolean;
|
|
57
|
+
resetValue: any;
|
|
58
|
+
placeholder?: string;
|
|
59
|
+
disabled?: boolean;
|
|
60
|
+
creatable?: boolean;
|
|
61
|
+
pathSeparator?: string;
|
|
62
|
+
hasError?: boolean;
|
|
63
|
+
block?: boolean;
|
|
64
|
+
onAdd?: (
|
|
65
|
+
idx?: number | Array<number>,
|
|
66
|
+
value?: any,
|
|
67
|
+
skipForm?: boolean
|
|
68
|
+
) => void;
|
|
69
|
+
editable?: boolean;
|
|
70
|
+
onEdit?: (value: Option, origin?: Option, skipForm?: boolean) => void;
|
|
71
|
+
removable?: boolean;
|
|
72
|
+
onDelete?: (value: Option) => void;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export type OptionValue = string | number | null | undefined | Option;
|
|
76
|
+
|
|
77
|
+
export function value2array(
|
|
78
|
+
value: OptionValue | Array<OptionValue>,
|
|
79
|
+
props: Pick<
|
|
80
|
+
OptionProps,
|
|
81
|
+
| 'multi'
|
|
82
|
+
| 'multiple'
|
|
83
|
+
| 'delimiter'
|
|
84
|
+
| 'valueField'
|
|
85
|
+
| 'labelField'
|
|
86
|
+
| 'options'
|
|
87
|
+
| 'pathSeparator'
|
|
88
|
+
>,
|
|
89
|
+
enableNodePath: boolean = false
|
|
90
|
+
): Array<Option> {
|
|
91
|
+
if (enableNodePath) {
|
|
92
|
+
value = normalizeNodePath(
|
|
93
|
+
value,
|
|
94
|
+
enableNodePath,
|
|
95
|
+
props.labelField,
|
|
96
|
+
props.valueField,
|
|
97
|
+
props.pathSeparator,
|
|
98
|
+
props.delimiter
|
|
99
|
+
).nodeValueArray;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
if (props.multi || props.multiple) {
|
|
103
|
+
if (typeof value === 'string') {
|
|
104
|
+
value = value.split(props.delimiter || ',');
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
if (!Array.isArray(value)) {
|
|
108
|
+
if (value === null || value === undefined) {
|
|
109
|
+
return [];
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
value = [value];
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
return value
|
|
116
|
+
.map(
|
|
117
|
+
(value: any) =>
|
|
118
|
+
expandValue(value, props.options, props.valueField) ||
|
|
119
|
+
(isObject(value) && value.hasOwnProperty(props.valueField || 'value')
|
|
120
|
+
? value
|
|
121
|
+
: undefined)
|
|
122
|
+
)
|
|
123
|
+
.filter((item: any) => item) as Array<Option>;
|
|
124
|
+
} else if (Array.isArray(value)) {
|
|
125
|
+
value = value[0];
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
let expandedValue = expandValue(
|
|
129
|
+
value as OptionValue,
|
|
130
|
+
props.options,
|
|
131
|
+
props.valueField
|
|
132
|
+
);
|
|
133
|
+
return expandedValue
|
|
134
|
+
? [expandedValue]
|
|
135
|
+
: isObject(value) &&
|
|
136
|
+
(value as Option).hasOwnProperty(props.valueField || 'value')
|
|
137
|
+
? [value as Option]
|
|
138
|
+
: [];
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
export function expandValue(
|
|
142
|
+
value: OptionValue,
|
|
143
|
+
options: Options,
|
|
144
|
+
valueField = 'value'
|
|
145
|
+
): Option | null {
|
|
146
|
+
const valueType = typeof value;
|
|
147
|
+
|
|
148
|
+
if (
|
|
149
|
+
valueType !== 'string' &&
|
|
150
|
+
valueType !== 'number' &&
|
|
151
|
+
valueType !== 'boolean' &&
|
|
152
|
+
valueType !== 'object'
|
|
153
|
+
) {
|
|
154
|
+
return value as Option;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
if (!options) {
|
|
158
|
+
return null;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
if (
|
|
162
|
+
valueType === 'object' &&
|
|
163
|
+
value &&
|
|
164
|
+
value.hasOwnProperty(valueField || 'value')
|
|
165
|
+
) {
|
|
166
|
+
value = (value as Option)[valueField || 'value'] ?? '';
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
return findTree(
|
|
170
|
+
options,
|
|
171
|
+
optionValueCompare(value, valueField || 'value')
|
|
172
|
+
) as Option;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
export function matchOptionValue(
|
|
176
|
+
a: OptionValue,
|
|
177
|
+
b: Option,
|
|
178
|
+
valueField: string = 'value'
|
|
179
|
+
) {
|
|
180
|
+
return isObject(a)
|
|
181
|
+
? a === b[valueField || 'value']
|
|
182
|
+
: String(b[valueField || 'value']) === String(a);
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
export function optionValueCompare(
|
|
186
|
+
a: OptionValue,
|
|
187
|
+
valueField: string = 'value'
|
|
188
|
+
) {
|
|
189
|
+
return (b: Option) => matchOptionValue(a, b, valueField);
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
export function normalizeOptions(
|
|
193
|
+
options: string | {[propName: string]: string} | Array<string> | Options,
|
|
194
|
+
share: {
|
|
195
|
+
values: Array<any>;
|
|
196
|
+
options: Array<any>;
|
|
197
|
+
} = {
|
|
198
|
+
values: [],
|
|
199
|
+
options: []
|
|
200
|
+
},
|
|
201
|
+
valueField = 'value'
|
|
202
|
+
): Options {
|
|
203
|
+
if (typeof options === 'string') {
|
|
204
|
+
return options.split(',').map(item => {
|
|
205
|
+
const idx = share.values.indexOf(item);
|
|
206
|
+
if (~idx) {
|
|
207
|
+
return share.options[idx];
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
const option = {
|
|
211
|
+
label: item,
|
|
212
|
+
value: item
|
|
213
|
+
};
|
|
214
|
+
|
|
215
|
+
share.values.push(option.value);
|
|
216
|
+
share.options.push(option);
|
|
217
|
+
|
|
218
|
+
return option;
|
|
219
|
+
});
|
|
220
|
+
} else if (
|
|
221
|
+
Array.isArray(options as Array<string>) &&
|
|
222
|
+
typeof (options as Array<string>)[0] === 'string'
|
|
223
|
+
) {
|
|
224
|
+
return (options as Array<string>).map(item => {
|
|
225
|
+
const idx = share.values.indexOf(item);
|
|
226
|
+
if (~idx) {
|
|
227
|
+
return share.options[idx];
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
const option = {
|
|
231
|
+
label: item,
|
|
232
|
+
value: item
|
|
233
|
+
};
|
|
234
|
+
|
|
235
|
+
share.values.push(option.value);
|
|
236
|
+
share.options.push(option);
|
|
237
|
+
|
|
238
|
+
return option;
|
|
239
|
+
});
|
|
240
|
+
} else if (Array.isArray(options as Options)) {
|
|
241
|
+
return (options as Options).map(item => {
|
|
242
|
+
const value = item && item[valueField];
|
|
243
|
+
|
|
244
|
+
const idx =
|
|
245
|
+
value !== undefined && !item.children
|
|
246
|
+
? share.values.indexOf(value)
|
|
247
|
+
: -1;
|
|
248
|
+
|
|
249
|
+
if (~idx) {
|
|
250
|
+
return share.options[idx];
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
const option = {
|
|
254
|
+
...item,
|
|
255
|
+
value
|
|
256
|
+
};
|
|
257
|
+
|
|
258
|
+
if (typeof option.children !== 'undefined') {
|
|
259
|
+
option.children = normalizeOptions(option.children, share, valueField);
|
|
260
|
+
} else if (value !== undefined) {
|
|
261
|
+
share.values.push(value);
|
|
262
|
+
share.options.push(option);
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
return option;
|
|
266
|
+
});
|
|
267
|
+
} else if (isPlainObject(options)) {
|
|
268
|
+
return Object.keys(options).map(key => {
|
|
269
|
+
const idx = share.values.indexOf(key);
|
|
270
|
+
if (~idx) {
|
|
271
|
+
return share.options[idx];
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
const option = {
|
|
275
|
+
label: (options as {[propName: string]: string})[key] as string,
|
|
276
|
+
value: key
|
|
277
|
+
};
|
|
278
|
+
|
|
279
|
+
share.values.push(option.value);
|
|
280
|
+
share.options.push(option);
|
|
281
|
+
|
|
282
|
+
return option;
|
|
283
|
+
});
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
return [];
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
const DownshiftChangeTypes = Downshift.stateChangeTypes;
|
|
290
|
+
|
|
291
|
+
interface SelectProps extends OptionProps, ThemeProps, LocaleProps {
|
|
292
|
+
className?: string;
|
|
293
|
+
popoverClassName?: string;
|
|
294
|
+
creatable: boolean;
|
|
295
|
+
createBtnLabel: string;
|
|
296
|
+
multiple: boolean;
|
|
297
|
+
valuesNoWrap?: boolean;
|
|
298
|
+
valueField: string;
|
|
299
|
+
labelField: string;
|
|
300
|
+
renderMenu?: (
|
|
301
|
+
item: Option,
|
|
302
|
+
states: {
|
|
303
|
+
index: number;
|
|
304
|
+
multiple?: boolean;
|
|
305
|
+
checkAll?: boolean;
|
|
306
|
+
checked: boolean;
|
|
307
|
+
onChange: () => void;
|
|
308
|
+
inputValue?: string;
|
|
309
|
+
searchable?: boolean;
|
|
310
|
+
}
|
|
311
|
+
) => JSX.Element;
|
|
312
|
+
searchable?: boolean;
|
|
313
|
+
options: Array<Option>;
|
|
314
|
+
value: any;
|
|
315
|
+
loadOptions?: Function;
|
|
316
|
+
searchPromptText: string;
|
|
317
|
+
loadingPlaceholder: string;
|
|
318
|
+
spinnerClassName?: string;
|
|
319
|
+
noResultsText: string;
|
|
320
|
+
clearable: boolean;
|
|
321
|
+
clearAllText: string;
|
|
322
|
+
clearValueText: string;
|
|
323
|
+
placeholder: string;
|
|
324
|
+
inline: boolean;
|
|
325
|
+
disabled: boolean;
|
|
326
|
+
popOverContainer?: any;
|
|
327
|
+
overlayPlacement?: string;
|
|
328
|
+
onChange: (value: void | string | Option | Array<Option>) => void;
|
|
329
|
+
onFocus?: Function;
|
|
330
|
+
onBlur?: Function;
|
|
331
|
+
checkAll?: boolean;
|
|
332
|
+
checkAllLabel?: string;
|
|
333
|
+
checkAllBySearch?: boolean;
|
|
334
|
+
defaultCheckAll?: boolean;
|
|
335
|
+
simpleValue?: boolean;
|
|
336
|
+
defaultOpen?: boolean;
|
|
337
|
+
useMobileUI?: boolean;
|
|
338
|
+
|
|
339
|
+
/**
|
|
340
|
+
* 边框模式,全边框,还是半边框,或者没边框。
|
|
341
|
+
*/
|
|
342
|
+
borderMode?: 'full' | 'half' | 'none';
|
|
343
|
+
/**
|
|
344
|
+
* 是否隐藏已选项
|
|
345
|
+
*/
|
|
346
|
+
hideSelected?: boolean;
|
|
347
|
+
|
|
348
|
+
/**
|
|
349
|
+
* 移动端样式类名
|
|
350
|
+
*/
|
|
351
|
+
mobileClassName?: string;
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
interface SelectState {
|
|
355
|
+
itemHeight: number;
|
|
356
|
+
isOpen: boolean;
|
|
357
|
+
isFocused: boolean;
|
|
358
|
+
inputValue: string;
|
|
359
|
+
highlightedIndex: number;
|
|
360
|
+
selection: Array<Option>;
|
|
361
|
+
pickerSelectItem: any;
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
export class Select extends React.Component<SelectProps, SelectState> {
|
|
365
|
+
static defaultProps = {
|
|
366
|
+
multiple: false,
|
|
367
|
+
clearable: true,
|
|
368
|
+
creatable: false,
|
|
369
|
+
createBtnLabel: 'Select.createLabel',
|
|
370
|
+
searchPromptText: 'Select.searchPromptText',
|
|
371
|
+
loadingPlaceholder: 'loading',
|
|
372
|
+
noResultsText: 'noResult',
|
|
373
|
+
clearAllText: 'Select.clearAll',
|
|
374
|
+
clearValueText: 'Select.clear',
|
|
375
|
+
placeholder: 'Select.placeholder',
|
|
376
|
+
valueField: 'value',
|
|
377
|
+
labelField: 'label',
|
|
378
|
+
resetValue: '',
|
|
379
|
+
inline: false,
|
|
380
|
+
disabled: false,
|
|
381
|
+
checkAll: false,
|
|
382
|
+
checkAllLabel: 'Select.checkAll',
|
|
383
|
+
defaultCheckAll: false,
|
|
384
|
+
overlayPlacement: 'auto'
|
|
385
|
+
};
|
|
386
|
+
|
|
387
|
+
input: HTMLInputElement;
|
|
388
|
+
target: HTMLElement;
|
|
389
|
+
menu: React.RefObject<HTMLDivElement> = React.createRef();
|
|
390
|
+
constructor(props: SelectProps) {
|
|
391
|
+
super(props);
|
|
392
|
+
|
|
393
|
+
this.state = {
|
|
394
|
+
isOpen: props.defaultOpen || false,
|
|
395
|
+
isFocused: false,
|
|
396
|
+
inputValue: '',
|
|
397
|
+
highlightedIndex: -1,
|
|
398
|
+
selection: value2array(props.value, props),
|
|
399
|
+
itemHeight: 35,
|
|
400
|
+
pickerSelectItem: ''
|
|
401
|
+
};
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
componentDidMount() {
|
|
405
|
+
const {loadOptions} = this.props;
|
|
406
|
+
loadOptions && loadOptions('');
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
componentDidUpdate(prevProps: SelectProps) {
|
|
410
|
+
const props = this.props;
|
|
411
|
+
let fn: () => void = noop;
|
|
412
|
+
|
|
413
|
+
if (
|
|
414
|
+
JSON.stringify(props.value) !== JSON.stringify(prevProps.value) ||
|
|
415
|
+
JSON.stringify(props.options) !== JSON.stringify(prevProps.options)
|
|
416
|
+
) {
|
|
417
|
+
const selection: Array<Option> = value2array(props.value, props);
|
|
418
|
+
this.setState(
|
|
419
|
+
{
|
|
420
|
+
selection: selection
|
|
421
|
+
},
|
|
422
|
+
fn
|
|
423
|
+
);
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
@autobind
|
|
428
|
+
open() {
|
|
429
|
+
this.props.disabled ||
|
|
430
|
+
this.setState(
|
|
431
|
+
{
|
|
432
|
+
isOpen: true,
|
|
433
|
+
highlightedIndex: -1
|
|
434
|
+
},
|
|
435
|
+
() => setTimeout(this.focus, 500)
|
|
436
|
+
);
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
@autobind
|
|
440
|
+
close() {
|
|
441
|
+
this.setState({
|
|
442
|
+
isOpen: false
|
|
443
|
+
});
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
@autobind
|
|
447
|
+
confirm() {
|
|
448
|
+
// @ts-ignore
|
|
449
|
+
this.handleChange(this.state.pickerSelectItem);
|
|
450
|
+
this.setState({
|
|
451
|
+
isOpen: false
|
|
452
|
+
});
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
@autobind
|
|
456
|
+
toggle(e?: React.MouseEvent<HTMLDivElement>) {
|
|
457
|
+
if (
|
|
458
|
+
e &&
|
|
459
|
+
this.menu.current &&
|
|
460
|
+
this.menu.current.contains(e.target as HTMLElement)
|
|
461
|
+
) {
|
|
462
|
+
return;
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
this.props.disabled ||
|
|
466
|
+
this.setState(
|
|
467
|
+
{
|
|
468
|
+
isOpen: !this.state.isOpen,
|
|
469
|
+
highlightedIndex: -1
|
|
470
|
+
},
|
|
471
|
+
this.state.isOpen ? undefined : () => setTimeout(this.focus, 500)
|
|
472
|
+
);
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
@autobind
|
|
476
|
+
onFocus(e: any) {
|
|
477
|
+
const {simpleValue} = this.props;
|
|
478
|
+
const {selection} = this.state;
|
|
479
|
+
const value = simpleValue ? selection.map(item => item.value) : selection;
|
|
480
|
+
|
|
481
|
+
this.props.disabled ||
|
|
482
|
+
this.state.isOpen ||
|
|
483
|
+
this.setState(
|
|
484
|
+
{
|
|
485
|
+
isFocused: true
|
|
486
|
+
},
|
|
487
|
+
this.focus
|
|
488
|
+
);
|
|
489
|
+
|
|
490
|
+
this.props.onFocus &&
|
|
491
|
+
this.props.onFocus({
|
|
492
|
+
...e,
|
|
493
|
+
value
|
|
494
|
+
});
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
@autobind
|
|
498
|
+
onBlur(e: any) {
|
|
499
|
+
const {simpleValue} = this.props;
|
|
500
|
+
const {selection} = this.state;
|
|
501
|
+
const value = simpleValue ? selection.map(item => item.value) : selection;
|
|
502
|
+
|
|
503
|
+
this.setState({
|
|
504
|
+
isFocused: false
|
|
505
|
+
});
|
|
506
|
+
|
|
507
|
+
this.props.onBlur &&
|
|
508
|
+
this.props.onBlur({
|
|
509
|
+
...e,
|
|
510
|
+
value
|
|
511
|
+
});
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
@autobind
|
|
515
|
+
focus() {
|
|
516
|
+
this.input
|
|
517
|
+
? this.input.focus()
|
|
518
|
+
: this.getTarget() && this.getTarget().focus();
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
blur() {
|
|
522
|
+
this.input
|
|
523
|
+
? this.input.blur()
|
|
524
|
+
: this.getTarget() && this.getTarget().blur();
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
@autobind
|
|
528
|
+
getTarget() {
|
|
529
|
+
if (!this.target) {
|
|
530
|
+
this.target = findDOMNode(this) as HTMLElement;
|
|
531
|
+
}
|
|
532
|
+
return this.target as HTMLElement;
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
@autobind
|
|
536
|
+
inputRef(ref: HTMLInputElement) {
|
|
537
|
+
this.input = ref;
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
@autobind
|
|
541
|
+
toggleCheckAll() {
|
|
542
|
+
const {
|
|
543
|
+
options,
|
|
544
|
+
onChange,
|
|
545
|
+
simpleValue,
|
|
546
|
+
checkAllBySearch,
|
|
547
|
+
labelField,
|
|
548
|
+
valueField
|
|
549
|
+
} = this.props;
|
|
550
|
+
const inputValue = this.state.inputValue;
|
|
551
|
+
let {selection} = this.state;
|
|
552
|
+
let filtedOptions: Array<Option> =
|
|
553
|
+
inputValue && checkAllBySearch
|
|
554
|
+
? matchSorter(options, inputValue, {
|
|
555
|
+
keys: [labelField || 'label', valueField || 'value']
|
|
556
|
+
})
|
|
557
|
+
: options.concat();
|
|
558
|
+
const optionsValues = filtedOptions.map(option => option.value);
|
|
559
|
+
const selectionValues = selection.map(select => select.value);
|
|
560
|
+
const checkedAll = optionsValues.every(
|
|
561
|
+
option => selectionValues.indexOf(option) > -1
|
|
562
|
+
);
|
|
563
|
+
|
|
564
|
+
selection = checkedAll ? [] : filtedOptions;
|
|
565
|
+
onChange(simpleValue ? selection.map(item => item.value) : selection);
|
|
566
|
+
}
|
|
567
|
+
|
|
568
|
+
removeItem(index: number, e?: React.MouseEvent<HTMLElement>) {
|
|
569
|
+
const {onChange, simpleValue, disabled} = this.props;
|
|
570
|
+
if (disabled) {
|
|
571
|
+
return;
|
|
572
|
+
}
|
|
573
|
+
let {selection: value} = this.state;
|
|
574
|
+
|
|
575
|
+
e && e.stopPropagation();
|
|
576
|
+
value = Array.isArray(value) ? value.concat() : [value];
|
|
577
|
+
value.splice(index, 1);
|
|
578
|
+
|
|
579
|
+
onChange(simpleValue ? value.map(item => item.value) : value);
|
|
580
|
+
}
|
|
581
|
+
|
|
582
|
+
@autobind
|
|
583
|
+
handleInputChange(evt: React.ChangeEvent<HTMLInputElement>) {
|
|
584
|
+
const {loadOptions} = this.props;
|
|
585
|
+
this.setState(
|
|
586
|
+
{
|
|
587
|
+
inputValue: evt.currentTarget.value
|
|
588
|
+
},
|
|
589
|
+
() => loadOptions && loadOptions(this.state.inputValue)
|
|
590
|
+
);
|
|
591
|
+
}
|
|
592
|
+
|
|
593
|
+
@autobind
|
|
594
|
+
handlePickerChange(selectItem: any, index: number, confirm?: boolean) {
|
|
595
|
+
if (!this.props.multiple) {
|
|
596
|
+
selectItem = selectItem[0];
|
|
597
|
+
}
|
|
598
|
+
this.setState({
|
|
599
|
+
pickerSelectItem: selectItem
|
|
600
|
+
});
|
|
601
|
+
// 直接选中选项
|
|
602
|
+
if (confirm) {
|
|
603
|
+
this.handleChange(selectItem);
|
|
604
|
+
}
|
|
605
|
+
}
|
|
606
|
+
|
|
607
|
+
@autobind
|
|
608
|
+
handleChange(selectItem: any) {
|
|
609
|
+
const {onChange, multiple, simpleValue, valueField} = this.props;
|
|
610
|
+
let {selection} = this.state;
|
|
611
|
+
|
|
612
|
+
if (multiple) {
|
|
613
|
+
const selectionValues = selection.map(item => item[valueField]);
|
|
614
|
+
selection = selection.concat();
|
|
615
|
+
const idx = selectionValues.indexOf(selectItem[valueField]);
|
|
616
|
+
if (~idx) {
|
|
617
|
+
selection.splice(idx, 1);
|
|
618
|
+
} else {
|
|
619
|
+
selection.push(selectItem);
|
|
620
|
+
}
|
|
621
|
+
onChange(
|
|
622
|
+
simpleValue ? selection.map(item => item[valueField]) : selection
|
|
623
|
+
);
|
|
624
|
+
} else {
|
|
625
|
+
onChange(simpleValue ? selectItem[valueField] : selectItem);
|
|
626
|
+
}
|
|
627
|
+
}
|
|
628
|
+
|
|
629
|
+
@autobind
|
|
630
|
+
handleStateChange(changes: any) {
|
|
631
|
+
const {multiple, checkAll} = this.props;
|
|
632
|
+
let update: any = {};
|
|
633
|
+
|
|
634
|
+
switch (changes.type) {
|
|
635
|
+
case DownshiftChangeTypes.keyDownEnter:
|
|
636
|
+
case DownshiftChangeTypes.clickItem:
|
|
637
|
+
update = {
|
|
638
|
+
...update,
|
|
639
|
+
isOpen: multiple ? true : false,
|
|
640
|
+
isFocused: multiple && checkAll ? true : false
|
|
641
|
+
};
|
|
642
|
+
break;
|
|
643
|
+
case DownshiftChangeTypes.controlledPropUpdatedSelectedItem:
|
|
644
|
+
break;
|
|
645
|
+
case DownshiftChangeTypes.changeInput:
|
|
646
|
+
update.highlightedIndex = 0;
|
|
647
|
+
break;
|
|
648
|
+
case DownshiftChangeTypes.keyDownArrowDown:
|
|
649
|
+
case DownshiftChangeTypes.keyDownArrowUp:
|
|
650
|
+
case DownshiftChangeTypes.itemMouseEnter:
|
|
651
|
+
update = {
|
|
652
|
+
...update,
|
|
653
|
+
...changes
|
|
654
|
+
};
|
|
655
|
+
break;
|
|
656
|
+
}
|
|
657
|
+
|
|
658
|
+
if (Object.keys(update).length) {
|
|
659
|
+
this.setState(update);
|
|
660
|
+
}
|
|
661
|
+
}
|
|
662
|
+
|
|
663
|
+
@autobind
|
|
664
|
+
handleKeyPress(e: React.KeyboardEvent) {
|
|
665
|
+
if (this.props.multiple && e.key === ' ') {
|
|
666
|
+
this.toggle();
|
|
667
|
+
e.preventDefault();
|
|
668
|
+
}
|
|
669
|
+
}
|
|
670
|
+
|
|
671
|
+
@autobind
|
|
672
|
+
clearValue(e: React.MouseEvent<any>) {
|
|
673
|
+
const onChange = this.props.onChange;
|
|
674
|
+
e.preventDefault();
|
|
675
|
+
e.stopPropagation();
|
|
676
|
+
onChange(this.props.resetValue);
|
|
677
|
+
}
|
|
678
|
+
|
|
679
|
+
@autobind
|
|
680
|
+
clearSearchValue() {
|
|
681
|
+
const {loadOptions} = this.props;
|
|
682
|
+
this.setState(
|
|
683
|
+
{
|
|
684
|
+
inputValue: ''
|
|
685
|
+
},
|
|
686
|
+
() => loadOptions?.('')
|
|
687
|
+
);
|
|
688
|
+
}
|
|
689
|
+
|
|
690
|
+
@autobind
|
|
691
|
+
handleAddClick() {
|
|
692
|
+
const {onAdd} = this.props;
|
|
693
|
+
onAdd && onAdd();
|
|
694
|
+
}
|
|
695
|
+
|
|
696
|
+
@autobind
|
|
697
|
+
handleEditClick(e: Event, item: any) {
|
|
698
|
+
const {onEdit} = this.props;
|
|
699
|
+
e.preventDefault();
|
|
700
|
+
e.stopPropagation();
|
|
701
|
+
onEdit && onEdit(item);
|
|
702
|
+
}
|
|
703
|
+
|
|
704
|
+
@autobind
|
|
705
|
+
handleDeleteClick(e: Event, item: any) {
|
|
706
|
+
const {onDelete} = this.props;
|
|
707
|
+
e.preventDefault();
|
|
708
|
+
e.stopPropagation();
|
|
709
|
+
onDelete && onDelete(item);
|
|
710
|
+
}
|
|
711
|
+
|
|
712
|
+
@autobind
|
|
713
|
+
menuItemRef(ref: any) {
|
|
714
|
+
ref && this.setState({itemHeight: ref.offsetHeight});
|
|
715
|
+
}
|
|
716
|
+
|
|
717
|
+
renderValue({inputValue, isOpen}: ControllerStateAndHelpers<any>) {
|
|
718
|
+
const {
|
|
719
|
+
classnames: cx,
|
|
720
|
+
multiple,
|
|
721
|
+
valuesNoWrap,
|
|
722
|
+
placeholder,
|
|
723
|
+
labelField,
|
|
724
|
+
disabled,
|
|
725
|
+
translate: __
|
|
726
|
+
} = this.props;
|
|
727
|
+
|
|
728
|
+
const selection = this.state.selection;
|
|
729
|
+
// console.log('selection', selection);
|
|
730
|
+
|
|
731
|
+
if (!selection.length) {
|
|
732
|
+
return (
|
|
733
|
+
<div key="placeholder" className={cx('Select-placeholder')}>
|
|
734
|
+
{__(placeholder)}
|
|
735
|
+
</div>
|
|
736
|
+
);
|
|
737
|
+
}
|
|
738
|
+
|
|
739
|
+
return selection.map((item, index) => {
|
|
740
|
+
if (!multiple) {
|
|
741
|
+
return (
|
|
742
|
+
<div
|
|
743
|
+
className={cx('Select-value', {
|
|
744
|
+
'is-disabled': disabled,
|
|
745
|
+
'is-invalid': item.__unmatched
|
|
746
|
+
})}
|
|
747
|
+
key={index}
|
|
748
|
+
>
|
|
749
|
+
{item[labelField || 'label']}
|
|
750
|
+
</div>
|
|
751
|
+
);
|
|
752
|
+
}
|
|
753
|
+
|
|
754
|
+
return valuesNoWrap ? (
|
|
755
|
+
`${item[labelField || 'label']}${
|
|
756
|
+
index === selection.length - 1 ? '' : ' + '
|
|
757
|
+
}`
|
|
758
|
+
) : (
|
|
759
|
+
<TooltipWrapper
|
|
760
|
+
placement={'top'}
|
|
761
|
+
tooltip={item[labelField || 'label']}
|
|
762
|
+
trigger={'hover'}
|
|
763
|
+
key={index}
|
|
764
|
+
>
|
|
765
|
+
<div
|
|
766
|
+
className={cx('Select-value', {
|
|
767
|
+
'is-disabled': disabled,
|
|
768
|
+
'is-invalid': item.__unmatched
|
|
769
|
+
})}
|
|
770
|
+
>
|
|
771
|
+
<span className={cx('Select-valueLabel')}>
|
|
772
|
+
{item[labelField || 'label']}
|
|
773
|
+
</span>
|
|
774
|
+
<span
|
|
775
|
+
className={cx('Select-valueIcon', {
|
|
776
|
+
'is-disabled': disabled || item.disabled
|
|
777
|
+
})}
|
|
778
|
+
onClick={this.removeItem.bind(this, index)}
|
|
779
|
+
>
|
|
780
|
+
<Icon icon="close" className="icon" />
|
|
781
|
+
</span>
|
|
782
|
+
</div>
|
|
783
|
+
</TooltipWrapper>
|
|
784
|
+
);
|
|
785
|
+
});
|
|
786
|
+
}
|
|
787
|
+
|
|
788
|
+
renderOuter({
|
|
789
|
+
selectedItem,
|
|
790
|
+
getItemProps,
|
|
791
|
+
highlightedIndex,
|
|
792
|
+
inputValue,
|
|
793
|
+
isOpen,
|
|
794
|
+
getToggleButtonProps,
|
|
795
|
+
getInputProps
|
|
796
|
+
}: ControllerStateAndHelpers<any>) {
|
|
797
|
+
const {
|
|
798
|
+
popOverContainer,
|
|
799
|
+
options,
|
|
800
|
+
value,
|
|
801
|
+
valueField,
|
|
802
|
+
labelField,
|
|
803
|
+
noResultsText,
|
|
804
|
+
loadOptions,
|
|
805
|
+
creatable,
|
|
806
|
+
multiple,
|
|
807
|
+
valuesNoWrap,
|
|
808
|
+
classnames: cx,
|
|
809
|
+
popoverClassName,
|
|
810
|
+
checkAll,
|
|
811
|
+
checkAllLabel,
|
|
812
|
+
checkAllBySearch,
|
|
813
|
+
searchable,
|
|
814
|
+
createBtnLabel,
|
|
815
|
+
disabled,
|
|
816
|
+
searchPromptText,
|
|
817
|
+
editable,
|
|
818
|
+
removable,
|
|
819
|
+
overlayPlacement,
|
|
820
|
+
translate: __,
|
|
821
|
+
hideSelected,
|
|
822
|
+
renderMenu,
|
|
823
|
+
mobileClassName,
|
|
824
|
+
useMobileUI = false
|
|
825
|
+
} = this.props;
|
|
826
|
+
const {selection} = this.state;
|
|
827
|
+
|
|
828
|
+
let checkedAll = false;
|
|
829
|
+
let checkedPartial = false;
|
|
830
|
+
let filtedOptions: Array<Option> = (
|
|
831
|
+
inputValue && isOpen && !loadOptions
|
|
832
|
+
? matchSorter(options, inputValue, {
|
|
833
|
+
keys: [labelField || 'label', valueField || 'value']
|
|
834
|
+
})
|
|
835
|
+
: options.concat()
|
|
836
|
+
).filter((option: Option) => !option.hidden && option.visible !== false);
|
|
837
|
+
|
|
838
|
+
const selectionValues = selection.map(select => select[valueField]);
|
|
839
|
+
if (multiple && checkAll) {
|
|
840
|
+
const optionsValues = (checkAllBySearch ? filtedOptions : options).map(
|
|
841
|
+
option => option[valueField]
|
|
842
|
+
);
|
|
843
|
+
|
|
844
|
+
checkedAll = optionsValues.every(
|
|
845
|
+
option => selectionValues.indexOf(option) > -1
|
|
846
|
+
);
|
|
847
|
+
checkedPartial = optionsValues.some(
|
|
848
|
+
option => selectionValues.indexOf(option) > -1
|
|
849
|
+
);
|
|
850
|
+
}
|
|
851
|
+
|
|
852
|
+
const itemHeight = this.state.itemHeight;
|
|
853
|
+
|
|
854
|
+
// 渲染单个选项
|
|
855
|
+
const renderItem = ({index, style}: {index: number; style?: object}) => {
|
|
856
|
+
const item = filtedOptions[index];
|
|
857
|
+
if (!item) {
|
|
858
|
+
return null;
|
|
859
|
+
}
|
|
860
|
+
const checked =
|
|
861
|
+
selectedItem === item || !!~selectionValues.indexOf(item[valueField]);
|
|
862
|
+
if (hideSelected && checked) {
|
|
863
|
+
return null;
|
|
864
|
+
}
|
|
865
|
+
return (
|
|
866
|
+
<div
|
|
867
|
+
{...getItemProps({
|
|
868
|
+
key:
|
|
869
|
+
typeof item.value === 'string'
|
|
870
|
+
? `${item.label}-${item.value}`
|
|
871
|
+
: index,
|
|
872
|
+
index,
|
|
873
|
+
item,
|
|
874
|
+
disabled: item.disabled
|
|
875
|
+
})}
|
|
876
|
+
style={style}
|
|
877
|
+
className={cx(`Select-option`, {
|
|
878
|
+
'is-disabled': item.disabled,
|
|
879
|
+
'is-highlight': highlightedIndex === index,
|
|
880
|
+
'is-active': checked
|
|
881
|
+
})}
|
|
882
|
+
>
|
|
883
|
+
{removable ? (
|
|
884
|
+
<a data-tooltip={__('Select.clear')} data-position="left">
|
|
885
|
+
<Icon
|
|
886
|
+
icon="close"
|
|
887
|
+
className="icon"
|
|
888
|
+
onClick={(e: any) => this.handleDeleteClick(e, item)}
|
|
889
|
+
/>
|
|
890
|
+
</a>
|
|
891
|
+
) : null}
|
|
892
|
+
{editable ? (
|
|
893
|
+
<a data-tooltip="编辑" data-position="left">
|
|
894
|
+
<Icon
|
|
895
|
+
icon="pencil"
|
|
896
|
+
className="icon"
|
|
897
|
+
onClick={(e: any) => this.handleEditClick(e, item)}
|
|
898
|
+
/>
|
|
899
|
+
</a>
|
|
900
|
+
) : null}
|
|
901
|
+
|
|
902
|
+
{renderMenu ? (
|
|
903
|
+
multiple ? (
|
|
904
|
+
<Checkbox
|
|
905
|
+
checked={checked}
|
|
906
|
+
trueValue={item.value}
|
|
907
|
+
onChange={() => {
|
|
908
|
+
this.handleChange(item);
|
|
909
|
+
}}
|
|
910
|
+
disabled={item.disabled}
|
|
911
|
+
>
|
|
912
|
+
{renderMenu(item, {
|
|
913
|
+
multiple,
|
|
914
|
+
checkAll,
|
|
915
|
+
checked,
|
|
916
|
+
onChange: () => this.handleChange(item),
|
|
917
|
+
inputValue: inputValue || '',
|
|
918
|
+
searchable,
|
|
919
|
+
index
|
|
920
|
+
})}
|
|
921
|
+
</Checkbox>
|
|
922
|
+
) : (
|
|
923
|
+
renderMenu(item, {
|
|
924
|
+
multiple,
|
|
925
|
+
checkAll,
|
|
926
|
+
checked,
|
|
927
|
+
onChange: () => this.handleChange(item),
|
|
928
|
+
inputValue: inputValue || '',
|
|
929
|
+
searchable,
|
|
930
|
+
index
|
|
931
|
+
})
|
|
932
|
+
)
|
|
933
|
+
) : multiple ? (
|
|
934
|
+
<Checkbox
|
|
935
|
+
checked={checked}
|
|
936
|
+
trueValue={item.value}
|
|
937
|
+
onChange={() => {
|
|
938
|
+
this.handleChange(item);
|
|
939
|
+
}}
|
|
940
|
+
disabled={item.disabled}
|
|
941
|
+
size="sm"
|
|
942
|
+
>
|
|
943
|
+
{item.disabled
|
|
944
|
+
? item[labelField]
|
|
945
|
+
: highlight(
|
|
946
|
+
item[labelField],
|
|
947
|
+
inputValue as string,
|
|
948
|
+
cx('Select-option-hl')
|
|
949
|
+
)}
|
|
950
|
+
|
|
951
|
+
{item.tip}
|
|
952
|
+
</Checkbox>
|
|
953
|
+
) : (
|
|
954
|
+
<span>
|
|
955
|
+
{item.disabled
|
|
956
|
+
? item[labelField]
|
|
957
|
+
: highlight(
|
|
958
|
+
item[labelField],
|
|
959
|
+
inputValue as string,
|
|
960
|
+
cx('Select-option-hl')
|
|
961
|
+
)}
|
|
962
|
+
{item.tip}
|
|
963
|
+
</span>
|
|
964
|
+
)}
|
|
965
|
+
</div>
|
|
966
|
+
);
|
|
967
|
+
};
|
|
968
|
+
|
|
969
|
+
const mobileUI = isMobile() && useMobileUI;
|
|
970
|
+
const column = {
|
|
971
|
+
labelField: 'label',
|
|
972
|
+
options: filtedOptions
|
|
973
|
+
};
|
|
974
|
+
const menu = (
|
|
975
|
+
<div
|
|
976
|
+
ref={this.menu}
|
|
977
|
+
className={cx('Select-menu', {
|
|
978
|
+
'Select--longlist':
|
|
979
|
+
filtedOptions.length && filtedOptions.length > 100,
|
|
980
|
+
'is-mobile': mobileUI
|
|
981
|
+
})}
|
|
982
|
+
>
|
|
983
|
+
{searchable ? (
|
|
984
|
+
<div
|
|
985
|
+
className={cx(`Select-input`, {
|
|
986
|
+
'is-focused': this.state.isFocused
|
|
987
|
+
})}
|
|
988
|
+
>
|
|
989
|
+
<Icon icon="search" className="icon" />
|
|
990
|
+
<Input
|
|
991
|
+
{...getInputProps({
|
|
992
|
+
onFocus: this.onFocus,
|
|
993
|
+
onBlur: this.onBlur,
|
|
994
|
+
disabled: disabled,
|
|
995
|
+
placeholder: __(searchPromptText),
|
|
996
|
+
onChange: this.handleInputChange,
|
|
997
|
+
ref: this.inputRef
|
|
998
|
+
})}
|
|
999
|
+
/>
|
|
1000
|
+
{inputValue?.length ? (
|
|
1001
|
+
<a onClick={this.clearSearchValue} className={cx('Select-clear')}>
|
|
1002
|
+
<Icon icon="close" className="icon" />
|
|
1003
|
+
</a>
|
|
1004
|
+
) : null}
|
|
1005
|
+
</div>
|
|
1006
|
+
) : null}
|
|
1007
|
+
{multiple && valuesNoWrap ? (
|
|
1008
|
+
<div className={cx('Select-option')}>
|
|
1009
|
+
已选择({selectionValues.length})
|
|
1010
|
+
</div>
|
|
1011
|
+
) : null}
|
|
1012
|
+
{multiple && checkAll && filtedOptions.length ? (
|
|
1013
|
+
<div className={cx('Select-option')}>
|
|
1014
|
+
<Checkbox
|
|
1015
|
+
checked={checkedPartial}
|
|
1016
|
+
partial={checkedPartial && !checkedAll}
|
|
1017
|
+
onChange={this.toggleCheckAll}
|
|
1018
|
+
size="sm"
|
|
1019
|
+
>
|
|
1020
|
+
{__(checkAllLabel)}
|
|
1021
|
+
</Checkbox>
|
|
1022
|
+
</div>
|
|
1023
|
+
) : null}
|
|
1024
|
+
|
|
1025
|
+
<div ref={this.menuItemRef} className={cx('Select-option invisible')}>
|
|
1026
|
+
{multiple ? (
|
|
1027
|
+
<Checkbox size="sm">Placeholder</Checkbox>
|
|
1028
|
+
) : (
|
|
1029
|
+
<span>Placeholder</span>
|
|
1030
|
+
)}
|
|
1031
|
+
</div>
|
|
1032
|
+
|
|
1033
|
+
{creatable && !disabled ? (
|
|
1034
|
+
<a className={cx('Select-addBtn')} onClick={this.handleAddClick}>
|
|
1035
|
+
<Icon icon="plus" className="icon" />
|
|
1036
|
+
{__(createBtnLabel)}
|
|
1037
|
+
</a>
|
|
1038
|
+
) : null}
|
|
1039
|
+
|
|
1040
|
+
{filtedOptions.length ? (
|
|
1041
|
+
filtedOptions.length > 100 ? ( // 超过 100 行数据才启用 virtuallist 避免滚动条问题
|
|
1042
|
+
<VirtualList
|
|
1043
|
+
height={
|
|
1044
|
+
filtedOptions.length > 8
|
|
1045
|
+
? 266
|
|
1046
|
+
: filtedOptions.length * itemHeight
|
|
1047
|
+
}
|
|
1048
|
+
itemCount={filtedOptions.length}
|
|
1049
|
+
itemSize={itemHeight}
|
|
1050
|
+
renderItem={renderItem}
|
|
1051
|
+
/>
|
|
1052
|
+
) : (
|
|
1053
|
+
filtedOptions.map((item, index) => {
|
|
1054
|
+
return renderItem({index});
|
|
1055
|
+
})
|
|
1056
|
+
)
|
|
1057
|
+
) : (
|
|
1058
|
+
<div className={cx('Select-noResult')}>{__(noResultsText)}</div>
|
|
1059
|
+
)}
|
|
1060
|
+
</div>
|
|
1061
|
+
);
|
|
1062
|
+
return mobileUI ? (
|
|
1063
|
+
<PopUp
|
|
1064
|
+
className={cx(`Select-popup`)}
|
|
1065
|
+
container={popOverContainer}
|
|
1066
|
+
isShow={this.state.isOpen}
|
|
1067
|
+
onHide={this.close}
|
|
1068
|
+
>
|
|
1069
|
+
{menu}
|
|
1070
|
+
</PopUp>
|
|
1071
|
+
) : (
|
|
1072
|
+
<Overlay
|
|
1073
|
+
container={popOverContainer || this.getTarget}
|
|
1074
|
+
target={this.getTarget}
|
|
1075
|
+
placement={overlayPlacement}
|
|
1076
|
+
show
|
|
1077
|
+
>
|
|
1078
|
+
<PopOver
|
|
1079
|
+
overlay
|
|
1080
|
+
className={cx('Select-popover')}
|
|
1081
|
+
style={{
|
|
1082
|
+
minWidth: this.target ? this.target.offsetWidth : 'auto'
|
|
1083
|
+
}}
|
|
1084
|
+
onHide={this.close}
|
|
1085
|
+
>
|
|
1086
|
+
{menu}
|
|
1087
|
+
</PopOver>
|
|
1088
|
+
</Overlay>
|
|
1089
|
+
);
|
|
1090
|
+
}
|
|
1091
|
+
|
|
1092
|
+
render() {
|
|
1093
|
+
const {
|
|
1094
|
+
classnames: cx,
|
|
1095
|
+
multiple,
|
|
1096
|
+
valuesNoWrap,
|
|
1097
|
+
searchable,
|
|
1098
|
+
inline,
|
|
1099
|
+
block,
|
|
1100
|
+
className,
|
|
1101
|
+
value,
|
|
1102
|
+
loading,
|
|
1103
|
+
clearable,
|
|
1104
|
+
labelField,
|
|
1105
|
+
disabled,
|
|
1106
|
+
checkAll,
|
|
1107
|
+
borderMode,
|
|
1108
|
+
useMobileUI,
|
|
1109
|
+
hasError
|
|
1110
|
+
} = this.props;
|
|
1111
|
+
|
|
1112
|
+
const selection = this.state.selection;
|
|
1113
|
+
const inputValue = this.state.inputValue;
|
|
1114
|
+
const resetValue = this.props.resetValue;
|
|
1115
|
+
const mobileUI = useMobileUI && isMobile();
|
|
1116
|
+
return (
|
|
1117
|
+
<Downshift
|
|
1118
|
+
selectedItem={selection}
|
|
1119
|
+
highlightedIndex={this.state.highlightedIndex}
|
|
1120
|
+
isOpen={this.state.isOpen}
|
|
1121
|
+
inputValue={inputValue}
|
|
1122
|
+
onChange={
|
|
1123
|
+
/*展示 Checkbox 的时候,会出发多次 onChange 原因待查*/
|
|
1124
|
+
multiple ? noop : this.handleChange
|
|
1125
|
+
}
|
|
1126
|
+
onStateChange={this.handleStateChange}
|
|
1127
|
+
itemToString={item => (item ? `${item[labelField]}` : '')}
|
|
1128
|
+
>
|
|
1129
|
+
{(options: ControllerStateAndHelpers<any>) => {
|
|
1130
|
+
const {isOpen} = options;
|
|
1131
|
+
return (
|
|
1132
|
+
<div
|
|
1133
|
+
tabIndex={disabled ? -1 : 0}
|
|
1134
|
+
onKeyPress={this.handleKeyPress}
|
|
1135
|
+
onClick={this.toggle}
|
|
1136
|
+
onFocus={this.onFocus}
|
|
1137
|
+
onBlur={this.onBlur}
|
|
1138
|
+
className={cx(
|
|
1139
|
+
`Select`,
|
|
1140
|
+
{
|
|
1141
|
+
[`Select--multi`]: multiple,
|
|
1142
|
+
[`Select--inline`]: inline,
|
|
1143
|
+
[`Select--block`]: block,
|
|
1144
|
+
[`Select--searchable`]: searchable,
|
|
1145
|
+
'is-opened': isOpen,
|
|
1146
|
+
'is-focused': this.state.isFocused,
|
|
1147
|
+
'is-disabled': disabled,
|
|
1148
|
+
'is-mobile': mobileUI,
|
|
1149
|
+
'is-error': hasError,
|
|
1150
|
+
[`Select--border${ucFirst(borderMode)}`]: borderMode
|
|
1151
|
+
},
|
|
1152
|
+
className
|
|
1153
|
+
)}
|
|
1154
|
+
>
|
|
1155
|
+
<div
|
|
1156
|
+
className={cx(`Select-valueWrap`, {
|
|
1157
|
+
'Select-valuesNoWrap': valuesNoWrap
|
|
1158
|
+
})}
|
|
1159
|
+
>
|
|
1160
|
+
{this.renderValue(options)}
|
|
1161
|
+
</div>
|
|
1162
|
+
{clearable &&
|
|
1163
|
+
!disabled &&
|
|
1164
|
+
(Array.isArray(value)
|
|
1165
|
+
? value.length
|
|
1166
|
+
: value != null && value !== resetValue) ? (
|
|
1167
|
+
<a onClick={this.clearValue} className={cx('Select-clear')}>
|
|
1168
|
+
<Icon icon="close-small" className="icon" />
|
|
1169
|
+
</a>
|
|
1170
|
+
) : null}
|
|
1171
|
+
{loading ? (
|
|
1172
|
+
<Spinner
|
|
1173
|
+
show
|
|
1174
|
+
icon="reload"
|
|
1175
|
+
size="sm"
|
|
1176
|
+
spinnerClassName={cx('Select-spinner')}
|
|
1177
|
+
/>
|
|
1178
|
+
) : null}
|
|
1179
|
+
|
|
1180
|
+
<span className={cx('Select-arrow')}>
|
|
1181
|
+
<Icon icon="right-arrow-bold" className="icon" />
|
|
1182
|
+
</span>
|
|
1183
|
+
{isOpen ? this.renderOuter(options) : null}
|
|
1184
|
+
</div>
|
|
1185
|
+
);
|
|
1186
|
+
}}
|
|
1187
|
+
</Downshift>
|
|
1188
|
+
);
|
|
1189
|
+
}
|
|
1190
|
+
}
|
|
1191
|
+
|
|
1192
|
+
const EnhancedSelect = themeable(
|
|
1193
|
+
localeable(
|
|
1194
|
+
uncontrollable(Select, {
|
|
1195
|
+
value: 'onChange'
|
|
1196
|
+
})
|
|
1197
|
+
)
|
|
1198
|
+
);
|
|
1199
|
+
|
|
1200
|
+
export default EnhancedSelect;
|
|
1201
|
+
export const SelectWithRemoteOptions = withRemoteConfig<Array<Options>>({
|
|
1202
|
+
adaptor: data => data.options || data.items || data.rows || data,
|
|
1203
|
+
normalizeConfig: (options: any, origin) => {
|
|
1204
|
+
options = normalizeOptions(options);
|
|
1205
|
+
|
|
1206
|
+
if (Array.isArray(options)) {
|
|
1207
|
+
return options.concat();
|
|
1208
|
+
}
|
|
1209
|
+
|
|
1210
|
+
return origin;
|
|
1211
|
+
}
|
|
1212
|
+
})(
|
|
1213
|
+
class extends React.Component<
|
|
1214
|
+
RemoteOptionsProps<Array<Options>> &
|
|
1215
|
+
React.ComponentProps<typeof EnhancedSelect>
|
|
1216
|
+
> {
|
|
1217
|
+
render() {
|
|
1218
|
+
const {loading, config, deferLoad, updateConfig, ...rest} = this.props;
|
|
1219
|
+
|
|
1220
|
+
return (
|
|
1221
|
+
<EnhancedSelect
|
|
1222
|
+
{...rest}
|
|
1223
|
+
options={config || rest.options || []}
|
|
1224
|
+
loading={loading}
|
|
1225
|
+
/>
|
|
1226
|
+
);
|
|
1227
|
+
}
|
|
1228
|
+
}
|
|
1229
|
+
);
|