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,1183 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file Tree
|
|
3
|
+
* @description 树形组件
|
|
4
|
+
* @author fex
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import React from 'react';
|
|
8
|
+
import {
|
|
9
|
+
eachTree,
|
|
10
|
+
isVisible,
|
|
11
|
+
autobind,
|
|
12
|
+
findTreeIndex,
|
|
13
|
+
hasAbility,
|
|
14
|
+
createObject,
|
|
15
|
+
getTreeParent,
|
|
16
|
+
getTreeAncestors,
|
|
17
|
+
cloneObject
|
|
18
|
+
} from 'amis-core';
|
|
19
|
+
import {Option, Options, value2array} from './Select';
|
|
20
|
+
import {ClassNamesFn, themeable, ThemeProps, highlight} from 'amis-core';
|
|
21
|
+
import {Icon, getIcon} from './icons';
|
|
22
|
+
import Checkbox from './Checkbox';
|
|
23
|
+
import {LocaleProps, localeable} from 'amis-core';
|
|
24
|
+
import Spinner from './Spinner';
|
|
25
|
+
import {ItemRenderStates} from './Selection';
|
|
26
|
+
|
|
27
|
+
interface IDropIndicator {
|
|
28
|
+
left: number;
|
|
29
|
+
top: number;
|
|
30
|
+
width: number;
|
|
31
|
+
height?: number;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export interface IDropInfo {
|
|
35
|
+
dragNode: Option | null;
|
|
36
|
+
node: Option;
|
|
37
|
+
position: 'top' | 'bottom' | 'self';
|
|
38
|
+
indicator: IDropIndicator;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
interface TreeSelectorProps extends ThemeProps, LocaleProps {
|
|
42
|
+
highlightTxt?: string;
|
|
43
|
+
|
|
44
|
+
onRef?: any;
|
|
45
|
+
|
|
46
|
+
showIcon?: boolean;
|
|
47
|
+
// 是否默认都展开
|
|
48
|
+
initiallyOpen?: boolean;
|
|
49
|
+
// 默认展开的级数,从1开始,只有initiallyOpen不是true时生效
|
|
50
|
+
unfoldedLevel?: number;
|
|
51
|
+
// 单选时,是否展示radio
|
|
52
|
+
showRadio?: boolean;
|
|
53
|
+
multiple?: boolean;
|
|
54
|
+
// 是否都不可用
|
|
55
|
+
disabled?: boolean;
|
|
56
|
+
// 多选时,选中父节点时,是否将其所有子节点也融合到取值中,默认是不融合
|
|
57
|
+
withChildren?: boolean;
|
|
58
|
+
// 多选时,选中父节点时,是否只将起子节点加入到值中。
|
|
59
|
+
onlyChildren?: boolean;
|
|
60
|
+
// 单选时,只运行选择子节点
|
|
61
|
+
onlyLeaf?: boolean;
|
|
62
|
+
// 名称、取值等字段名映射
|
|
63
|
+
labelField: string;
|
|
64
|
+
valueField: string;
|
|
65
|
+
iconField: string;
|
|
66
|
+
unfoldedField: string;
|
|
67
|
+
foldedField: string;
|
|
68
|
+
disabledField: string;
|
|
69
|
+
|
|
70
|
+
// 是否显示 outline 辅助线
|
|
71
|
+
showOutline?: boolean;
|
|
72
|
+
|
|
73
|
+
className?: string;
|
|
74
|
+
itemClassName?: string;
|
|
75
|
+
joinValues?: boolean;
|
|
76
|
+
extractValue?: boolean;
|
|
77
|
+
delimiter?: string;
|
|
78
|
+
options: Options;
|
|
79
|
+
value: any;
|
|
80
|
+
onChange: Function;
|
|
81
|
+
placeholder?: string;
|
|
82
|
+
hideRoot?: boolean;
|
|
83
|
+
rootLabel?: string;
|
|
84
|
+
rootValue?: any;
|
|
85
|
+
// 是否开启节点路径记录
|
|
86
|
+
enableNodePath?: boolean;
|
|
87
|
+
// 路径节点的分隔符
|
|
88
|
+
pathSeparator?: string;
|
|
89
|
+
// 已选择节点路径
|
|
90
|
+
nodePath: any[];
|
|
91
|
+
// ui级联关系,true代表级联选中,false代表不级联,默认为true
|
|
92
|
+
autoCheckChildren: boolean;
|
|
93
|
+
|
|
94
|
+
/*
|
|
95
|
+
* 该属性代表数据级联关系,autoCheckChildren为true时生效,默认为false,具体数据级联关系如下:
|
|
96
|
+
* 1.casacde为false,ui行为为级联选中子节点,子节点禁用;值只包含父节点的值
|
|
97
|
+
* 2.cascade为false,withChildren为true,ui行为为级联选中子节点,子节点禁用;值包含父子节点的值
|
|
98
|
+
* 3.cascade为true,ui行为级联选中子节点,子节点可反选,值包含父子节点的值,此时withChildren属性失效
|
|
99
|
+
* 4.cascade不论为true还是false,onlyChildren为true,ui行为级联选中子节点,子节点可反选,值只包含子节点的值
|
|
100
|
+
*/
|
|
101
|
+
cascade?: boolean;
|
|
102
|
+
|
|
103
|
+
selfDisabledAffectChildren?: boolean;
|
|
104
|
+
minLength?: number;
|
|
105
|
+
maxLength?: number;
|
|
106
|
+
// 是否为内建 增、改、删。当有复杂表单的时候直接抛出去让外层能统一处理
|
|
107
|
+
bultinCUD?: boolean;
|
|
108
|
+
rootCreatable?: boolean;
|
|
109
|
+
rootCreateTip?: string;
|
|
110
|
+
creatable?: boolean;
|
|
111
|
+
createTip?: string;
|
|
112
|
+
onAdd?: (
|
|
113
|
+
idx?: number | Array<number>,
|
|
114
|
+
value?: any,
|
|
115
|
+
skipForm?: boolean
|
|
116
|
+
) => void;
|
|
117
|
+
editable?: boolean;
|
|
118
|
+
editTip?: string;
|
|
119
|
+
onEdit?: (value: Option, origin?: Option, skipForm?: boolean) => void;
|
|
120
|
+
removable?: boolean;
|
|
121
|
+
removeTip?: string;
|
|
122
|
+
onDelete?: (value: Option) => void;
|
|
123
|
+
onDeferLoad?: (option: Option) => void;
|
|
124
|
+
onExpandTree?: (nodePathArr: any[]) => void;
|
|
125
|
+
draggable?: boolean;
|
|
126
|
+
onMove?: (dropInfo: IDropInfo) => void;
|
|
127
|
+
itemRender?: (option: Option, states: ItemRenderStates) => JSX.Element;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
interface TreeSelectorState {
|
|
131
|
+
value: Array<any>;
|
|
132
|
+
inputValue: string;
|
|
133
|
+
addingParent: Option | null;
|
|
134
|
+
isAdding: boolean;
|
|
135
|
+
isEditing: boolean;
|
|
136
|
+
editingItem: Option | null;
|
|
137
|
+
|
|
138
|
+
// 拖拽指示器
|
|
139
|
+
dropIndicator?: IDropIndicator;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
export class TreeSelector extends React.Component<
|
|
143
|
+
TreeSelectorProps,
|
|
144
|
+
TreeSelectorState
|
|
145
|
+
> {
|
|
146
|
+
static defaultProps = {
|
|
147
|
+
showIcon: true,
|
|
148
|
+
showOutline: false,
|
|
149
|
+
initiallyOpen: true,
|
|
150
|
+
unfoldedLevel: 1,
|
|
151
|
+
showRadio: false,
|
|
152
|
+
multiple: false,
|
|
153
|
+
disabled: false,
|
|
154
|
+
withChildren: false,
|
|
155
|
+
onlyChildren: false,
|
|
156
|
+
labelField: 'label',
|
|
157
|
+
valueField: 'value',
|
|
158
|
+
iconField: 'icon',
|
|
159
|
+
unfoldedField: 'unfolded',
|
|
160
|
+
foldedField: 'foled',
|
|
161
|
+
disabledField: 'disabled',
|
|
162
|
+
joinValues: true,
|
|
163
|
+
extractValue: false,
|
|
164
|
+
delimiter: ',',
|
|
165
|
+
hideRoot: true,
|
|
166
|
+
rootLabel: 'Tree.root',
|
|
167
|
+
rootValue: 0,
|
|
168
|
+
autoCheckChildren: true,
|
|
169
|
+
cascade: false,
|
|
170
|
+
selfDisabledAffectChildren: true,
|
|
171
|
+
rootCreateTip: 'Tree.addRoot',
|
|
172
|
+
createTip: 'Tree.addChild',
|
|
173
|
+
editTip: 'Tree.editNode',
|
|
174
|
+
removeTip: 'Tree.removeNode',
|
|
175
|
+
enableNodePath: false,
|
|
176
|
+
pathSeparator: '/',
|
|
177
|
+
nodePath: []
|
|
178
|
+
};
|
|
179
|
+
|
|
180
|
+
unfolded: WeakMap<Object, boolean> = new WeakMap();
|
|
181
|
+
dragNode: Option | null;
|
|
182
|
+
dropInfo: IDropInfo | null;
|
|
183
|
+
startPoint: {
|
|
184
|
+
x: number;
|
|
185
|
+
y: number;
|
|
186
|
+
} = {
|
|
187
|
+
x: 0,
|
|
188
|
+
y: 0
|
|
189
|
+
};
|
|
190
|
+
root = React.createRef<HTMLDivElement>();
|
|
191
|
+
|
|
192
|
+
constructor(props: TreeSelectorProps) {
|
|
193
|
+
super(props);
|
|
194
|
+
this.state = {
|
|
195
|
+
value: value2array(
|
|
196
|
+
props.value,
|
|
197
|
+
{
|
|
198
|
+
multiple: props.multiple,
|
|
199
|
+
delimiter: props.delimiter,
|
|
200
|
+
valueField: props.valueField,
|
|
201
|
+
labelField: props.labelField,
|
|
202
|
+
options: props.options,
|
|
203
|
+
pathSeparator: props.pathSeparator
|
|
204
|
+
},
|
|
205
|
+
props.enableNodePath
|
|
206
|
+
),
|
|
207
|
+
|
|
208
|
+
inputValue: '',
|
|
209
|
+
addingParent: null,
|
|
210
|
+
isAdding: false,
|
|
211
|
+
isEditing: false,
|
|
212
|
+
editingItem: null,
|
|
213
|
+
dropIndicator: undefined
|
|
214
|
+
};
|
|
215
|
+
|
|
216
|
+
this.syncUnFolded(props);
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
componentDidMount() {
|
|
220
|
+
const {enableNodePath} = this.props;
|
|
221
|
+
|
|
222
|
+
// onRef只有渲染器的情况才会使用
|
|
223
|
+
this.props.onRef?.(this);
|
|
224
|
+
enableNodePath && this.expandLazyLoadNodes();
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
componentDidUpdate(prevProps: TreeSelectorProps) {
|
|
228
|
+
const props = this.props;
|
|
229
|
+
|
|
230
|
+
if (prevProps.options !== props.options) {
|
|
231
|
+
this.syncUnFolded(props);
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
if (
|
|
235
|
+
prevProps.value !== props.value ||
|
|
236
|
+
prevProps.options !== props.options
|
|
237
|
+
) {
|
|
238
|
+
this.setState({
|
|
239
|
+
value: value2array(
|
|
240
|
+
props.value,
|
|
241
|
+
{
|
|
242
|
+
multiple: props.multiple,
|
|
243
|
+
delimiter: props.delimiter,
|
|
244
|
+
valueField: props.valueField,
|
|
245
|
+
options: props.options
|
|
246
|
+
},
|
|
247
|
+
props.enableNodePath
|
|
248
|
+
)
|
|
249
|
+
});
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
/**
|
|
254
|
+
* 展开懒加载节点的父节点
|
|
255
|
+
*/
|
|
256
|
+
expandLazyLoadNodes() {
|
|
257
|
+
const {pathSeparator, onExpandTree, nodePath = []} = this.props;
|
|
258
|
+
const nodePathArr = nodePath.map(path =>
|
|
259
|
+
path ? path.toString().split(pathSeparator) : []
|
|
260
|
+
);
|
|
261
|
+
onExpandTree?.(nodePathArr);
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
syncUnFolded(props: TreeSelectorProps, unfoldedLevel?: number) {
|
|
265
|
+
// 传入默认展开层级需要重新初始化unfolded
|
|
266
|
+
let initFoldedLevel = typeof unfoldedLevel !== 'undefined';
|
|
267
|
+
let expandLevel =
|
|
268
|
+
Number(initFoldedLevel ? unfoldedLevel : props.unfoldedLevel) - 1;
|
|
269
|
+
|
|
270
|
+
// 初始化树节点的展开状态
|
|
271
|
+
let unfolded = this.unfolded;
|
|
272
|
+
const {foldedField, unfoldedField} = this.props;
|
|
273
|
+
|
|
274
|
+
eachTree(props.options, (node: Option, index, level) => {
|
|
275
|
+
if (unfolded.has(node) && !initFoldedLevel) {
|
|
276
|
+
return;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
if (node.children && node.children.length) {
|
|
280
|
+
let ret: any = true;
|
|
281
|
+
|
|
282
|
+
if (node.defer && node.loaded && !initFoldedLevel) {
|
|
283
|
+
ret = true;
|
|
284
|
+
} else if (
|
|
285
|
+
unfoldedField &&
|
|
286
|
+
typeof node[unfoldedField] !== 'undefined'
|
|
287
|
+
) {
|
|
288
|
+
ret = !!node[unfoldedField];
|
|
289
|
+
} else if (foldedField && typeof node[foldedField] !== 'undefined') {
|
|
290
|
+
ret = !node[foldedField];
|
|
291
|
+
} else {
|
|
292
|
+
ret = !!props.initiallyOpen && !initFoldedLevel;
|
|
293
|
+
if (!ret && level <= (expandLevel as number)) {
|
|
294
|
+
ret = true;
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
unfolded.set(node, ret);
|
|
298
|
+
}
|
|
299
|
+
});
|
|
300
|
+
|
|
301
|
+
initFoldedLevel && this.forceUpdate();
|
|
302
|
+
|
|
303
|
+
return unfolded;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
@autobind
|
|
307
|
+
toggleUnfolded(node: any) {
|
|
308
|
+
const unfolded = this.unfolded;
|
|
309
|
+
const {onDeferLoad} = this.props;
|
|
310
|
+
|
|
311
|
+
if (node.defer && !node.loaded) {
|
|
312
|
+
onDeferLoad?.(node);
|
|
313
|
+
return;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
unfolded.set(node, !unfolded.get(node));
|
|
317
|
+
this.forceUpdate();
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
isUnfolded(node: any) {
|
|
321
|
+
const unfolded = this.unfolded;
|
|
322
|
+
return unfolded.get(node);
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
@autobind
|
|
326
|
+
clearSelect() {
|
|
327
|
+
this.setState(
|
|
328
|
+
{
|
|
329
|
+
value: []
|
|
330
|
+
},
|
|
331
|
+
() => {
|
|
332
|
+
const {joinValues, rootValue, onChange} = this.props;
|
|
333
|
+
|
|
334
|
+
onChange(joinValues ? rootValue : []);
|
|
335
|
+
}
|
|
336
|
+
);
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
/**
|
|
340
|
+
* enableNodePath为true时,将label和value转换成node path格式
|
|
341
|
+
*/
|
|
342
|
+
transform2NodePath(value: any) {
|
|
343
|
+
const {
|
|
344
|
+
multiple,
|
|
345
|
+
options,
|
|
346
|
+
valueField,
|
|
347
|
+
labelField,
|
|
348
|
+
joinValues,
|
|
349
|
+
extractValue,
|
|
350
|
+
pathSeparator,
|
|
351
|
+
delimiter
|
|
352
|
+
} = this.props;
|
|
353
|
+
|
|
354
|
+
const nodesValuePath: string[] = [];
|
|
355
|
+
const selectedNodes = Array.isArray(value) ? value.concat() : [value];
|
|
356
|
+
const selectedNodesPath = selectedNodes.map(node => {
|
|
357
|
+
const nodePath = getTreeAncestors(options, node, true)?.reduce(
|
|
358
|
+
(acc, node) => {
|
|
359
|
+
acc[labelField as string].push(node[labelField as string]);
|
|
360
|
+
acc[valueField as string].push(node[valueField as string]);
|
|
361
|
+
return acc;
|
|
362
|
+
},
|
|
363
|
+
{[labelField as string]: [], [valueField as string]: []}
|
|
364
|
+
);
|
|
365
|
+
const nodeValuePath = nodePath[valueField as string].join(pathSeparator);
|
|
366
|
+
|
|
367
|
+
nodesValuePath.push(nodeValuePath);
|
|
368
|
+
return {
|
|
369
|
+
...node,
|
|
370
|
+
[labelField]: nodePath[labelField as string].join(pathSeparator),
|
|
371
|
+
[valueField]: nodeValuePath
|
|
372
|
+
};
|
|
373
|
+
});
|
|
374
|
+
|
|
375
|
+
if (multiple) {
|
|
376
|
+
return joinValues
|
|
377
|
+
? nodesValuePath.join(delimiter)
|
|
378
|
+
: extractValue
|
|
379
|
+
? nodesValuePath
|
|
380
|
+
: selectedNodesPath;
|
|
381
|
+
} else {
|
|
382
|
+
return joinValues || extractValue
|
|
383
|
+
? selectedNodesPath[0][valueField]
|
|
384
|
+
: selectedNodesPath[0];
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
@autobind
|
|
389
|
+
handleSelect(node: any, value?: any) {
|
|
390
|
+
const {joinValues, valueField, onChange, enableNodePath, onlyLeaf} =
|
|
391
|
+
this.props;
|
|
392
|
+
|
|
393
|
+
if (node[valueField as string] === undefined) {
|
|
394
|
+
if (node.defer && !node.loaded) {
|
|
395
|
+
this.toggleUnfolded(node);
|
|
396
|
+
}
|
|
397
|
+
return;
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
if (onlyLeaf && node.children) {
|
|
401
|
+
return;
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
this.setState(
|
|
405
|
+
{
|
|
406
|
+
value: [node]
|
|
407
|
+
},
|
|
408
|
+
() => {
|
|
409
|
+
onChange(
|
|
410
|
+
enableNodePath
|
|
411
|
+
? this.transform2NodePath(node)
|
|
412
|
+
: joinValues
|
|
413
|
+
? node[valueField as string]
|
|
414
|
+
: node
|
|
415
|
+
);
|
|
416
|
+
}
|
|
417
|
+
);
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
@autobind
|
|
421
|
+
handleCheck(item: any, checked: boolean) {
|
|
422
|
+
const props = this.props;
|
|
423
|
+
const value = this.state.value.concat();
|
|
424
|
+
const idx = value.indexOf(item);
|
|
425
|
+
const {onlyChildren, withChildren, cascade, autoCheckChildren} = props;
|
|
426
|
+
if (checked) {
|
|
427
|
+
~idx || value.push(item);
|
|
428
|
+
// cascade 为 true 表示父节点跟子节点没有级联关系。
|
|
429
|
+
if (autoCheckChildren) {
|
|
430
|
+
const children = item.children ? item.children.concat([]) : [];
|
|
431
|
+
if (onlyChildren) {
|
|
432
|
+
// 父级选中的时候,子节点也都选中,但是自己不选中
|
|
433
|
+
!~idx && children.length && value.pop();
|
|
434
|
+
|
|
435
|
+
while (children.length) {
|
|
436
|
+
let child = children.shift();
|
|
437
|
+
let index = value.indexOf(child);
|
|
438
|
+
|
|
439
|
+
if (child.children && child.children.length) {
|
|
440
|
+
children.push.apply(children, child.children);
|
|
441
|
+
} else if (!~index && child.value !== 'undefined') {
|
|
442
|
+
value.push(child);
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
} else {
|
|
446
|
+
// 只要父节点选择了,子节点就不需要了,全部去掉勾选. withChildren时相反
|
|
447
|
+
while (children.length) {
|
|
448
|
+
let child = children.shift();
|
|
449
|
+
let index = value.indexOf(child);
|
|
450
|
+
|
|
451
|
+
if (~index) {
|
|
452
|
+
value.splice(index, 1);
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
if (withChildren || cascade) {
|
|
456
|
+
value.push(child);
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
if (child.children && child.children.length) {
|
|
460
|
+
children.push.apply(children, child.children);
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
let toCheck = item;
|
|
465
|
+
|
|
466
|
+
while (true) {
|
|
467
|
+
const parent = getTreeParent(props.options, toCheck);
|
|
468
|
+
if (parent?.value) {
|
|
469
|
+
// 如果所有孩子节点都勾选了,应该自动勾选父级。
|
|
470
|
+
|
|
471
|
+
if (
|
|
472
|
+
parent.children.every((child: any) => ~value.indexOf(child))
|
|
473
|
+
) {
|
|
474
|
+
if (!cascade && !withChildren) {
|
|
475
|
+
parent.children.forEach((child: any) => {
|
|
476
|
+
const index = value.indexOf(child);
|
|
477
|
+
if (~index) {
|
|
478
|
+
value.splice(index, 1);
|
|
479
|
+
}
|
|
480
|
+
});
|
|
481
|
+
}
|
|
482
|
+
value.push(parent);
|
|
483
|
+
toCheck = parent;
|
|
484
|
+
continue;
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
break;
|
|
488
|
+
}
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
} else {
|
|
492
|
+
~idx && value.splice(idx, 1);
|
|
493
|
+
if (autoCheckChildren) {
|
|
494
|
+
if (cascade || withChildren || onlyChildren) {
|
|
495
|
+
const children = item.children ? item.children.concat([]) : [];
|
|
496
|
+
while (children.length) {
|
|
497
|
+
let child = children.shift();
|
|
498
|
+
let index = value.indexOf(child);
|
|
499
|
+
if (~index) {
|
|
500
|
+
value.splice(index, 1);
|
|
501
|
+
}
|
|
502
|
+
if (child.children && child.children.length) {
|
|
503
|
+
children.push.apply(children, child.children);
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
this.setState(
|
|
511
|
+
{
|
|
512
|
+
value
|
|
513
|
+
},
|
|
514
|
+
() => {
|
|
515
|
+
const {
|
|
516
|
+
joinValues,
|
|
517
|
+
extractValue,
|
|
518
|
+
valueField,
|
|
519
|
+
delimiter,
|
|
520
|
+
onChange,
|
|
521
|
+
enableNodePath
|
|
522
|
+
} = props;
|
|
523
|
+
|
|
524
|
+
onChange(
|
|
525
|
+
enableNodePath
|
|
526
|
+
? this.transform2NodePath(value)
|
|
527
|
+
: joinValues
|
|
528
|
+
? value.map(item => item[valueField as string]).join(delimiter)
|
|
529
|
+
: extractValue
|
|
530
|
+
? value.map(item => item[valueField as string])
|
|
531
|
+
: value
|
|
532
|
+
);
|
|
533
|
+
}
|
|
534
|
+
);
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
@autobind
|
|
538
|
+
handleAdd(parent: Option | null = null) {
|
|
539
|
+
const {bultinCUD, onAdd, options} = this.props;
|
|
540
|
+
|
|
541
|
+
if (!bultinCUD) {
|
|
542
|
+
const idxes = findTreeIndex(options, item => item === parent) || [];
|
|
543
|
+
return onAdd && onAdd(idxes.concat(0));
|
|
544
|
+
} else {
|
|
545
|
+
this.setState({
|
|
546
|
+
isEditing: false,
|
|
547
|
+
isAdding: true,
|
|
548
|
+
addingParent: parent
|
|
549
|
+
});
|
|
550
|
+
}
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
@autobind
|
|
554
|
+
handleEdit(item: Option) {
|
|
555
|
+
const {bultinCUD, onEdit, labelField, options} = this.props;
|
|
556
|
+
|
|
557
|
+
if (!bultinCUD) {
|
|
558
|
+
onEdit?.(item);
|
|
559
|
+
} else {
|
|
560
|
+
this.setState({
|
|
561
|
+
isEditing: true,
|
|
562
|
+
isAdding: false,
|
|
563
|
+
editingItem: item,
|
|
564
|
+
inputValue: item[labelField]
|
|
565
|
+
});
|
|
566
|
+
}
|
|
567
|
+
}
|
|
568
|
+
|
|
569
|
+
@autobind
|
|
570
|
+
handleRemove(item: Option) {
|
|
571
|
+
const {onDelete} = this.props;
|
|
572
|
+
|
|
573
|
+
onDelete && onDelete(item);
|
|
574
|
+
}
|
|
575
|
+
|
|
576
|
+
@autobind
|
|
577
|
+
handleInputChange(e: React.ChangeEvent<HTMLInputElement>) {
|
|
578
|
+
this.setState({
|
|
579
|
+
inputValue: e.currentTarget.value
|
|
580
|
+
});
|
|
581
|
+
}
|
|
582
|
+
|
|
583
|
+
@autobind
|
|
584
|
+
handleConfirm() {
|
|
585
|
+
const {
|
|
586
|
+
inputValue: value,
|
|
587
|
+
isAdding,
|
|
588
|
+
addingParent,
|
|
589
|
+
editingItem,
|
|
590
|
+
isEditing
|
|
591
|
+
} = this.state;
|
|
592
|
+
|
|
593
|
+
if (!value) {
|
|
594
|
+
return;
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
const {labelField, onAdd, options, onEdit} = this.props;
|
|
598
|
+
this.setState(
|
|
599
|
+
{
|
|
600
|
+
inputValue: '',
|
|
601
|
+
isAdding: false,
|
|
602
|
+
isEditing: false
|
|
603
|
+
},
|
|
604
|
+
() => {
|
|
605
|
+
if (isAdding && onAdd) {
|
|
606
|
+
const idxes =
|
|
607
|
+
(addingParent &&
|
|
608
|
+
findTreeIndex(options, item => item === addingParent)) ||
|
|
609
|
+
[];
|
|
610
|
+
onAdd(idxes.concat(0), {[labelField]: value}, true);
|
|
611
|
+
} else if (isEditing && onEdit) {
|
|
612
|
+
onEdit(
|
|
613
|
+
{
|
|
614
|
+
...editingItem,
|
|
615
|
+
[labelField]: value
|
|
616
|
+
},
|
|
617
|
+
editingItem!,
|
|
618
|
+
true
|
|
619
|
+
);
|
|
620
|
+
}
|
|
621
|
+
}
|
|
622
|
+
);
|
|
623
|
+
}
|
|
624
|
+
|
|
625
|
+
@autobind
|
|
626
|
+
handleCancel() {
|
|
627
|
+
this.setState({
|
|
628
|
+
inputValue: '',
|
|
629
|
+
isAdding: false,
|
|
630
|
+
isEditing: false
|
|
631
|
+
});
|
|
632
|
+
}
|
|
633
|
+
|
|
634
|
+
renderInput(prfix: JSX.Element | null = null) {
|
|
635
|
+
const {classnames: cx, translate: __} = this.props;
|
|
636
|
+
const {inputValue} = this.state;
|
|
637
|
+
|
|
638
|
+
return (
|
|
639
|
+
<div className={cx('Tree-itemLabel')}>
|
|
640
|
+
<div className={cx('Tree-itemInput')}>
|
|
641
|
+
{prfix}
|
|
642
|
+
<input
|
|
643
|
+
onChange={this.handleInputChange}
|
|
644
|
+
value={inputValue}
|
|
645
|
+
placeholder={__('placeholder.enter')}
|
|
646
|
+
/>
|
|
647
|
+
<a data-tooltip={__('cancel')} onClick={this.handleCancel}>
|
|
648
|
+
<Icon icon="close" className="icon" />
|
|
649
|
+
</a>
|
|
650
|
+
<a data-tooltip={__('confirm')} onClick={this.handleConfirm}>
|
|
651
|
+
<Icon icon="check" className="icon" />
|
|
652
|
+
</a>
|
|
653
|
+
</div>
|
|
654
|
+
</div>
|
|
655
|
+
);
|
|
656
|
+
}
|
|
657
|
+
|
|
658
|
+
getOffsetPosition(element: HTMLElement) {
|
|
659
|
+
let left = 0;
|
|
660
|
+
let top = 0;
|
|
661
|
+
|
|
662
|
+
while (element.offsetParent) {
|
|
663
|
+
left += element.offsetLeft;
|
|
664
|
+
top += element.offsetTop;
|
|
665
|
+
element = element.offsetParent as HTMLElement;
|
|
666
|
+
}
|
|
667
|
+
return {left, top};
|
|
668
|
+
}
|
|
669
|
+
|
|
670
|
+
@autobind
|
|
671
|
+
getDropInfo(e: React.DragEvent<Element>, node: Option): IDropInfo {
|
|
672
|
+
let rect = e.currentTarget.getBoundingClientRect();
|
|
673
|
+
const dragNode = this.dragNode;
|
|
674
|
+
const deltaX = Math.min(50, rect.width * 0.3);
|
|
675
|
+
const gap = node?.children?.length ? 0 : 16;
|
|
676
|
+
|
|
677
|
+
// 计算相对位置
|
|
678
|
+
let offset = this.getOffsetPosition(this.root.current!);
|
|
679
|
+
let targetOffset = this.getOffsetPosition(e.currentTarget as HTMLElement);
|
|
680
|
+
let left = targetOffset.left - offset.left;
|
|
681
|
+
let top = targetOffset.top - offset.top;
|
|
682
|
+
|
|
683
|
+
let {clientX, clientY} = e;
|
|
684
|
+
let position: IDropInfo['position'] =
|
|
685
|
+
clientY >= rect.top + rect.height / 2 ? 'bottom' : 'top';
|
|
686
|
+
let indicator;
|
|
687
|
+
if (position === 'bottom' && clientX >= this.startPoint.x + deltaX) {
|
|
688
|
+
position = 'self';
|
|
689
|
+
indicator = {
|
|
690
|
+
top: top,
|
|
691
|
+
left: left,
|
|
692
|
+
width: rect.width,
|
|
693
|
+
height: rect.height
|
|
694
|
+
};
|
|
695
|
+
} else {
|
|
696
|
+
indicator = {
|
|
697
|
+
top: position === 'bottom' ? top + rect.height : top,
|
|
698
|
+
left: left + gap,
|
|
699
|
+
width: rect.width - gap
|
|
700
|
+
};
|
|
701
|
+
}
|
|
702
|
+
|
|
703
|
+
return {
|
|
704
|
+
node,
|
|
705
|
+
dragNode,
|
|
706
|
+
position,
|
|
707
|
+
indicator
|
|
708
|
+
};
|
|
709
|
+
}
|
|
710
|
+
|
|
711
|
+
@autobind
|
|
712
|
+
updateDropIndicator(e: React.DragEvent<Element>, node: Option) {
|
|
713
|
+
const gap = node?.children?.length ? 0 : 16;
|
|
714
|
+
this.dropInfo = this.getDropInfo(e, node);
|
|
715
|
+
let {dragNode, indicator} = this.dropInfo;
|
|
716
|
+
if (node === dragNode) {
|
|
717
|
+
this.setState({dropIndicator: undefined});
|
|
718
|
+
return;
|
|
719
|
+
}
|
|
720
|
+
this.setState({
|
|
721
|
+
dropIndicator: indicator
|
|
722
|
+
});
|
|
723
|
+
}
|
|
724
|
+
|
|
725
|
+
@autobind
|
|
726
|
+
onDragStart(node: Option) {
|
|
727
|
+
let draggable = this.props.draggable;
|
|
728
|
+
return (e: React.DragEvent<Element>) => {
|
|
729
|
+
if (draggable) {
|
|
730
|
+
e.dataTransfer.effectAllowed = 'copyMove';
|
|
731
|
+
|
|
732
|
+
this.dragNode = node;
|
|
733
|
+
this.dropInfo = null;
|
|
734
|
+
this.startPoint = {
|
|
735
|
+
x: e.clientX,
|
|
736
|
+
y: e.clientY
|
|
737
|
+
};
|
|
738
|
+
|
|
739
|
+
if (node?.children?.length) {
|
|
740
|
+
this.unfolded.set(node, false);
|
|
741
|
+
this.forceUpdate();
|
|
742
|
+
}
|
|
743
|
+
} else {
|
|
744
|
+
this.dragNode = null;
|
|
745
|
+
this.dropInfo = null;
|
|
746
|
+
}
|
|
747
|
+
e.stopPropagation();
|
|
748
|
+
};
|
|
749
|
+
}
|
|
750
|
+
|
|
751
|
+
@autobind
|
|
752
|
+
onDragOver(node: Option) {
|
|
753
|
+
return (e: React.DragEvent<Element>) => {
|
|
754
|
+
if (!this.dragNode) {
|
|
755
|
+
return;
|
|
756
|
+
}
|
|
757
|
+
this.updateDropIndicator(e, node);
|
|
758
|
+
e.preventDefault();
|
|
759
|
+
};
|
|
760
|
+
}
|
|
761
|
+
|
|
762
|
+
@autobind
|
|
763
|
+
onDragEnd(dragNode: Option) {
|
|
764
|
+
return (e: React.DragEvent<Element>) => {
|
|
765
|
+
this.setState({
|
|
766
|
+
dropIndicator: undefined
|
|
767
|
+
});
|
|
768
|
+
let node = this.dropInfo?.node;
|
|
769
|
+
if (!this.dropInfo || !node || dragNode === node) {
|
|
770
|
+
return;
|
|
771
|
+
}
|
|
772
|
+
this.props.onMove?.(this.dropInfo);
|
|
773
|
+
this.dragNode = null;
|
|
774
|
+
this.dropInfo = null;
|
|
775
|
+
e.preventDefault();
|
|
776
|
+
};
|
|
777
|
+
}
|
|
778
|
+
|
|
779
|
+
@autobind
|
|
780
|
+
renderList(
|
|
781
|
+
list: Options,
|
|
782
|
+
value: Option[],
|
|
783
|
+
uncheckable: boolean
|
|
784
|
+
): {dom: Array<JSX.Element | null>; childrenChecked: number} {
|
|
785
|
+
const {
|
|
786
|
+
itemClassName,
|
|
787
|
+
showIcon,
|
|
788
|
+
showRadio,
|
|
789
|
+
multiple,
|
|
790
|
+
disabled,
|
|
791
|
+
labelField,
|
|
792
|
+
valueField,
|
|
793
|
+
iconField,
|
|
794
|
+
disabledField,
|
|
795
|
+
autoCheckChildren,
|
|
796
|
+
cascade,
|
|
797
|
+
selfDisabledAffectChildren,
|
|
798
|
+
onlyChildren,
|
|
799
|
+
classnames: cx,
|
|
800
|
+
highlightTxt,
|
|
801
|
+
options,
|
|
802
|
+
maxLength,
|
|
803
|
+
minLength,
|
|
804
|
+
creatable,
|
|
805
|
+
editable,
|
|
806
|
+
removable,
|
|
807
|
+
createTip,
|
|
808
|
+
editTip,
|
|
809
|
+
removeTip,
|
|
810
|
+
translate: __,
|
|
811
|
+
itemRender,
|
|
812
|
+
draggable
|
|
813
|
+
} = this.props;
|
|
814
|
+
const {
|
|
815
|
+
value: stateValue,
|
|
816
|
+
isAdding,
|
|
817
|
+
addingParent,
|
|
818
|
+
editingItem,
|
|
819
|
+
isEditing
|
|
820
|
+
} = this.state;
|
|
821
|
+
|
|
822
|
+
let childrenChecked = 0;
|
|
823
|
+
let ret = list.map((item, key) => {
|
|
824
|
+
if (!isVisible(item as any, options)) {
|
|
825
|
+
return null;
|
|
826
|
+
}
|
|
827
|
+
const checked = !!~value.indexOf(item);
|
|
828
|
+
const selfDisabled = item[disabledField];
|
|
829
|
+
let selfChecked = !!uncheckable || checked;
|
|
830
|
+
let childrenItems = null;
|
|
831
|
+
let selfChildrenChecked = false;
|
|
832
|
+
if (item.children && item.children.length) {
|
|
833
|
+
childrenItems = this.renderList(
|
|
834
|
+
item.children,
|
|
835
|
+
value,
|
|
836
|
+
!autoCheckChildren || cascade
|
|
837
|
+
? false
|
|
838
|
+
: uncheckable ||
|
|
839
|
+
(selfDisabledAffectChildren ? selfDisabled : false) ||
|
|
840
|
+
(multiple && checked)
|
|
841
|
+
);
|
|
842
|
+
selfChildrenChecked = !!childrenItems.childrenChecked;
|
|
843
|
+
if (
|
|
844
|
+
!selfChecked &&
|
|
845
|
+
onlyChildren &&
|
|
846
|
+
autoCheckChildren &&
|
|
847
|
+
item.children.length === childrenItems.childrenChecked
|
|
848
|
+
) {
|
|
849
|
+
selfChecked = true;
|
|
850
|
+
}
|
|
851
|
+
childrenItems = childrenItems.dom;
|
|
852
|
+
}
|
|
853
|
+
|
|
854
|
+
if ((onlyChildren ? selfChecked : selfChildrenChecked) || checked) {
|
|
855
|
+
childrenChecked++;
|
|
856
|
+
}
|
|
857
|
+
|
|
858
|
+
let nodeDisabled =
|
|
859
|
+
!!uncheckable ||
|
|
860
|
+
!!disabled ||
|
|
861
|
+
selfDisabled ||
|
|
862
|
+
(multiple && !autoCheckChildren && !item[valueField]);
|
|
863
|
+
|
|
864
|
+
if (
|
|
865
|
+
!nodeDisabled &&
|
|
866
|
+
((maxLength && !selfChecked && stateValue.length >= maxLength) ||
|
|
867
|
+
(minLength && selfChecked && stateValue.length <= minLength))
|
|
868
|
+
) {
|
|
869
|
+
nodeDisabled = true;
|
|
870
|
+
}
|
|
871
|
+
const checkbox: JSX.Element | null = multiple ? (
|
|
872
|
+
<Checkbox
|
|
873
|
+
size="sm"
|
|
874
|
+
disabled={nodeDisabled}
|
|
875
|
+
checked={selfChecked || (autoCheckChildren && selfChildrenChecked)}
|
|
876
|
+
partial={!selfChecked}
|
|
877
|
+
onChange={this.handleCheck.bind(this, item, !selfChecked)}
|
|
878
|
+
/>
|
|
879
|
+
) : showRadio ? (
|
|
880
|
+
<Checkbox
|
|
881
|
+
size="sm"
|
|
882
|
+
disabled={nodeDisabled}
|
|
883
|
+
checked={checked}
|
|
884
|
+
onChange={this.handleSelect.bind(this, item)}
|
|
885
|
+
/>
|
|
886
|
+
) : null;
|
|
887
|
+
|
|
888
|
+
const isLeaf =
|
|
889
|
+
(!item.children || !item.children.length) && !item.placeholder;
|
|
890
|
+
|
|
891
|
+
const iconValue = item[iconField] || (childrenItems ? 'folder' : 'file');
|
|
892
|
+
|
|
893
|
+
return (
|
|
894
|
+
<li
|
|
895
|
+
key={key}
|
|
896
|
+
className={cx(`Tree-item ${itemClassName || ''}`, {
|
|
897
|
+
'Tree-item--isLeaf': isLeaf
|
|
898
|
+
})}
|
|
899
|
+
>
|
|
900
|
+
{isEditing && editingItem === item ? (
|
|
901
|
+
this.renderInput(checkbox)
|
|
902
|
+
) : (
|
|
903
|
+
<div
|
|
904
|
+
className={cx('Tree-itemLabel', {
|
|
905
|
+
'is-children-checked':
|
|
906
|
+
multiple && !cascade && selfChildrenChecked && !nodeDisabled,
|
|
907
|
+
'is-checked': checked,
|
|
908
|
+
'is-disabled': nodeDisabled
|
|
909
|
+
})}
|
|
910
|
+
draggable={draggable}
|
|
911
|
+
onDragStart={this.onDragStart(item)}
|
|
912
|
+
onDragOver={this.onDragOver(item)}
|
|
913
|
+
onDragEnd={this.onDragEnd(item)}
|
|
914
|
+
>
|
|
915
|
+
{draggable && (
|
|
916
|
+
<a className={cx('Tree-itemDrager drag-bar')}>
|
|
917
|
+
<Icon icon="drag-bar" className="icon" />
|
|
918
|
+
</a>
|
|
919
|
+
)}
|
|
920
|
+
|
|
921
|
+
{item.loading ? (
|
|
922
|
+
<Spinner
|
|
923
|
+
size="sm"
|
|
924
|
+
show
|
|
925
|
+
icon="reload"
|
|
926
|
+
spinnerClassName={cx('Tree-spinner')}
|
|
927
|
+
/>
|
|
928
|
+
) : !isLeaf || (item.defer && !item.loaded) ? (
|
|
929
|
+
<div
|
|
930
|
+
onClick={() => this.toggleUnfolded(item)}
|
|
931
|
+
className={cx('Tree-itemArrow', {
|
|
932
|
+
'is-folded': !this.isUnfolded(item)
|
|
933
|
+
})}
|
|
934
|
+
>
|
|
935
|
+
<Icon icon="down-arrow-bold" className="icon" />
|
|
936
|
+
</div>
|
|
937
|
+
) : (
|
|
938
|
+
<span className={cx('Tree-itemArrowPlaceholder')} />
|
|
939
|
+
)}
|
|
940
|
+
|
|
941
|
+
{checkbox}
|
|
942
|
+
|
|
943
|
+
{showIcon ? (
|
|
944
|
+
<i
|
|
945
|
+
className={cx(
|
|
946
|
+
`Tree-itemIcon ${
|
|
947
|
+
childrenItems ? 'Tree-folderIcon' : 'Tree-leafIcon'
|
|
948
|
+
}`
|
|
949
|
+
)}
|
|
950
|
+
onClick={() =>
|
|
951
|
+
!nodeDisabled &&
|
|
952
|
+
(multiple
|
|
953
|
+
? this.handleCheck(item, !selfChecked)
|
|
954
|
+
: this.handleSelect(item))
|
|
955
|
+
}
|
|
956
|
+
>
|
|
957
|
+
{getIcon(iconValue) ? (
|
|
958
|
+
<Icon icon={iconValue} className="icon" />
|
|
959
|
+
) : (
|
|
960
|
+
<i className={iconValue}></i>
|
|
961
|
+
)}
|
|
962
|
+
</i>
|
|
963
|
+
) : null}
|
|
964
|
+
|
|
965
|
+
<span
|
|
966
|
+
className={cx('Tree-itemText')}
|
|
967
|
+
onClick={() =>
|
|
968
|
+
!nodeDisabled &&
|
|
969
|
+
(multiple
|
|
970
|
+
? this.handleCheck(item, !selfChecked)
|
|
971
|
+
: this.handleSelect(item))
|
|
972
|
+
}
|
|
973
|
+
>
|
|
974
|
+
{highlightTxt
|
|
975
|
+
? highlight(`${item[labelField]}`, highlightTxt)
|
|
976
|
+
: itemRender
|
|
977
|
+
? itemRender(item, {
|
|
978
|
+
index: key,
|
|
979
|
+
multiple: multiple,
|
|
980
|
+
checked: checked,
|
|
981
|
+
onChange: () => this.handleCheck(item, !selfChecked),
|
|
982
|
+
disabled: disabled || item.disabled
|
|
983
|
+
})
|
|
984
|
+
: `${item[labelField]}`}
|
|
985
|
+
</span>
|
|
986
|
+
|
|
987
|
+
{!nodeDisabled &&
|
|
988
|
+
!isAdding &&
|
|
989
|
+
!isEditing &&
|
|
990
|
+
!(item.defer && !item.loaded) ? (
|
|
991
|
+
<div className={cx('Tree-item-icons')}>
|
|
992
|
+
{creatable && hasAbility(item, 'creatable') ? (
|
|
993
|
+
<a
|
|
994
|
+
onClick={this.handleAdd.bind(this, item)}
|
|
995
|
+
data-tooltip={__(createTip)}
|
|
996
|
+
data-position="left"
|
|
997
|
+
>
|
|
998
|
+
<Icon icon="plus" className="icon" />
|
|
999
|
+
</a>
|
|
1000
|
+
) : null}
|
|
1001
|
+
|
|
1002
|
+
{removable && hasAbility(item, 'removable') ? (
|
|
1003
|
+
<a
|
|
1004
|
+
onClick={this.handleRemove.bind(this, item)}
|
|
1005
|
+
data-tooltip={__(removeTip)}
|
|
1006
|
+
data-position="left"
|
|
1007
|
+
>
|
|
1008
|
+
<Icon icon="minus" className="icon" />
|
|
1009
|
+
</a>
|
|
1010
|
+
) : null}
|
|
1011
|
+
|
|
1012
|
+
{editable && hasAbility(item, 'editable') ? (
|
|
1013
|
+
<a
|
|
1014
|
+
onClick={this.handleEdit.bind(this, item)}
|
|
1015
|
+
data-tooltip={__(editTip)}
|
|
1016
|
+
data-position="left"
|
|
1017
|
+
>
|
|
1018
|
+
<Icon icon="pencil" className="icon" />
|
|
1019
|
+
</a>
|
|
1020
|
+
) : null}
|
|
1021
|
+
</div>
|
|
1022
|
+
) : null}
|
|
1023
|
+
</div>
|
|
1024
|
+
)}
|
|
1025
|
+
{/* 有children而且为展开状态 或者 添加child时 */}
|
|
1026
|
+
{(childrenItems && this.isUnfolded(item)) ||
|
|
1027
|
+
(isAdding && addingParent === item) ? (
|
|
1028
|
+
<ul className={cx('Tree-sublist')}>
|
|
1029
|
+
{isAdding && addingParent === item ? (
|
|
1030
|
+
<li className={cx('Tree-item')}>
|
|
1031
|
+
{this.renderInput(
|
|
1032
|
+
checkbox
|
|
1033
|
+
? React.cloneElement(checkbox, {
|
|
1034
|
+
checked: false,
|
|
1035
|
+
disabled: true
|
|
1036
|
+
})
|
|
1037
|
+
: null
|
|
1038
|
+
)}
|
|
1039
|
+
</li>
|
|
1040
|
+
) : null}
|
|
1041
|
+
{childrenItems}
|
|
1042
|
+
</ul>
|
|
1043
|
+
) : !childrenItems && item.placeholder && this.isUnfolded(item) ? (
|
|
1044
|
+
<ul className={cx('Tree-sublist')}>
|
|
1045
|
+
<li className={cx('Tree-item')}>
|
|
1046
|
+
<div className={cx('Tree-placeholder')}>{item.placeholder}</div>
|
|
1047
|
+
</li>
|
|
1048
|
+
</ul>
|
|
1049
|
+
) : null}
|
|
1050
|
+
</li>
|
|
1051
|
+
);
|
|
1052
|
+
});
|
|
1053
|
+
|
|
1054
|
+
return {
|
|
1055
|
+
dom: ret,
|
|
1056
|
+
childrenChecked
|
|
1057
|
+
};
|
|
1058
|
+
}
|
|
1059
|
+
|
|
1060
|
+
render() {
|
|
1061
|
+
const {
|
|
1062
|
+
className,
|
|
1063
|
+
placeholder,
|
|
1064
|
+
hideRoot,
|
|
1065
|
+
rootLabel,
|
|
1066
|
+
showOutline,
|
|
1067
|
+
showIcon,
|
|
1068
|
+
classnames: cx,
|
|
1069
|
+
creatable,
|
|
1070
|
+
rootCreatable,
|
|
1071
|
+
rootCreateTip,
|
|
1072
|
+
disabled,
|
|
1073
|
+
draggable,
|
|
1074
|
+
translate: __
|
|
1075
|
+
} = this.props;
|
|
1076
|
+
let options = this.props.options;
|
|
1077
|
+
const {
|
|
1078
|
+
value,
|
|
1079
|
+
isAdding,
|
|
1080
|
+
addingParent,
|
|
1081
|
+
isEditing,
|
|
1082
|
+
inputValue,
|
|
1083
|
+
dropIndicator
|
|
1084
|
+
} = this.state;
|
|
1085
|
+
|
|
1086
|
+
let addBtn = null;
|
|
1087
|
+
|
|
1088
|
+
if (creatable && rootCreatable !== false && hideRoot) {
|
|
1089
|
+
addBtn = (
|
|
1090
|
+
<a
|
|
1091
|
+
className={cx('Tree-addTopBtn', {
|
|
1092
|
+
'is-disabled': isAdding || isEditing
|
|
1093
|
+
})}
|
|
1094
|
+
onClick={this.handleAdd.bind(this, null)}
|
|
1095
|
+
>
|
|
1096
|
+
<Icon icon="plus" className="icon" />
|
|
1097
|
+
<span>{__(rootCreateTip)}</span>
|
|
1098
|
+
</a>
|
|
1099
|
+
);
|
|
1100
|
+
}
|
|
1101
|
+
|
|
1102
|
+
return (
|
|
1103
|
+
<div
|
|
1104
|
+
className={cx(`Tree ${className || ''}`, {
|
|
1105
|
+
'Tree--outline': showOutline,
|
|
1106
|
+
'is-disabled': disabled,
|
|
1107
|
+
'is-draggable': draggable
|
|
1108
|
+
})}
|
|
1109
|
+
ref={this.root}
|
|
1110
|
+
>
|
|
1111
|
+
{(options && options.length) || addBtn || hideRoot === false ? (
|
|
1112
|
+
<ul className={cx('Tree-list')}>
|
|
1113
|
+
{hideRoot ? (
|
|
1114
|
+
<>
|
|
1115
|
+
{addBtn}
|
|
1116
|
+
{isAdding && !addingParent ? (
|
|
1117
|
+
<li className={cx('Tree-item')}>{this.renderInput()}</li>
|
|
1118
|
+
) : null}
|
|
1119
|
+
{this.renderList(options, value, false).dom}
|
|
1120
|
+
</>
|
|
1121
|
+
) : (
|
|
1122
|
+
<li
|
|
1123
|
+
className={cx('Tree-rootItem', {
|
|
1124
|
+
'is-checked': !value || !value.length
|
|
1125
|
+
})}
|
|
1126
|
+
>
|
|
1127
|
+
<div className={cx('Tree-itemLabel')}>
|
|
1128
|
+
<span
|
|
1129
|
+
className={cx('Tree-itemText')}
|
|
1130
|
+
onClick={this.clearSelect}
|
|
1131
|
+
>
|
|
1132
|
+
{showIcon ? (
|
|
1133
|
+
<i className={cx('Tree-itemIcon Tree-rootIcon')}>
|
|
1134
|
+
<Icon icon="home" className="icon" />
|
|
1135
|
+
</i>
|
|
1136
|
+
) : null}
|
|
1137
|
+
{rootLabel}
|
|
1138
|
+
</span>
|
|
1139
|
+
{!disabled &&
|
|
1140
|
+
creatable &&
|
|
1141
|
+
rootCreatable !== false &&
|
|
1142
|
+
!isAdding &&
|
|
1143
|
+
!isEditing ? (
|
|
1144
|
+
<div className={cx('Tree-item-icons')}>
|
|
1145
|
+
{creatable ? (
|
|
1146
|
+
<a
|
|
1147
|
+
onClick={this.handleAdd.bind(this, null)}
|
|
1148
|
+
data-tooltip={rootCreateTip}
|
|
1149
|
+
data-position="left"
|
|
1150
|
+
>
|
|
1151
|
+
<Icon icon="plus" className="icon" />
|
|
1152
|
+
</a>
|
|
1153
|
+
) : null}
|
|
1154
|
+
</div>
|
|
1155
|
+
) : null}
|
|
1156
|
+
</div>
|
|
1157
|
+
<ul className={cx('Tree-sublist')}>
|
|
1158
|
+
{isAdding && !addingParent ? (
|
|
1159
|
+
<li className={cx('Tree-item')}>{this.renderInput()}</li>
|
|
1160
|
+
) : null}
|
|
1161
|
+
{this.renderList(options, value, false).dom}
|
|
1162
|
+
</ul>
|
|
1163
|
+
</li>
|
|
1164
|
+
)}
|
|
1165
|
+
</ul>
|
|
1166
|
+
) : (
|
|
1167
|
+
<div className={cx('Tree-placeholder')}>{placeholder}</div>
|
|
1168
|
+
)}
|
|
1169
|
+
|
|
1170
|
+
{dropIndicator && (
|
|
1171
|
+
<div
|
|
1172
|
+
className={cx('Tree-dropIndicator', {
|
|
1173
|
+
'Tree-dropIndicator--hover': !!dropIndicator.height
|
|
1174
|
+
})}
|
|
1175
|
+
style={dropIndicator}
|
|
1176
|
+
/>
|
|
1177
|
+
)}
|
|
1178
|
+
</div>
|
|
1179
|
+
);
|
|
1180
|
+
}
|
|
1181
|
+
}
|
|
1182
|
+
|
|
1183
|
+
export default themeable(localeable(TreeSelector));
|