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,1234 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* amis-ui v1.0.0-beta.0
|
|
3
|
+
* Copyright 2018-2022 fex
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { __extends, __spreadArray, __awaiter, __generator, __assign, __rest } from 'tslib';
|
|
7
|
+
import React__default from 'react';
|
|
8
|
+
import { findDOMNode } from 'react-dom';
|
|
9
|
+
import findLastIndex from 'lodash/findLastIndex';
|
|
10
|
+
import find from 'lodash/find';
|
|
11
|
+
import isEqual from 'lodash/isEqual';
|
|
12
|
+
import filter from 'lodash/filter';
|
|
13
|
+
import intersection from 'lodash/intersection';
|
|
14
|
+
import cloneDeep from 'lodash/cloneDeep';
|
|
15
|
+
import Sortable from 'sortablejs';
|
|
16
|
+
import { isObject, isBreakpoint, themeable, localeable, guid } from 'amis-core';
|
|
17
|
+
import { Icon } from '../icons.js';
|
|
18
|
+
import CheckBox from '../Checkbox.js';
|
|
19
|
+
import Spinner from '../Spinner.js';
|
|
20
|
+
import HeadCellSort from './HeadCellSort.js';
|
|
21
|
+
import HeadCellFilter from './HeadCellFilter.js';
|
|
22
|
+
import HeadCellSelect from './HeadCellSelect.js';
|
|
23
|
+
import ItemActionsWrapper from './ItemActionsWrapper.js';
|
|
24
|
+
import Cell from './Cell.js';
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* @file Table
|
|
28
|
+
* @author fex
|
|
29
|
+
*/
|
|
30
|
+
function getMaxLevelThRowSpan(columns) {
|
|
31
|
+
var maxLevel = 0;
|
|
32
|
+
Array.isArray(columns) &&
|
|
33
|
+
columns.forEach(function (c) {
|
|
34
|
+
var level = getThRowSpan(c);
|
|
35
|
+
if (maxLevel < level) {
|
|
36
|
+
maxLevel = level;
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
return maxLevel;
|
|
40
|
+
}
|
|
41
|
+
function getThRowSpan(column) {
|
|
42
|
+
if (!column.children || (column.children && !column.children.length)) {
|
|
43
|
+
return 1;
|
|
44
|
+
}
|
|
45
|
+
return 1 + getMaxLevelThRowSpan(column.children);
|
|
46
|
+
}
|
|
47
|
+
function getThColSpan(column) {
|
|
48
|
+
if (!column.children || (column.children && !column.children.length)) {
|
|
49
|
+
return 1;
|
|
50
|
+
}
|
|
51
|
+
var childrenLength = 0;
|
|
52
|
+
column.children.forEach(function (item) { return (childrenLength += getThColSpan(item)); });
|
|
53
|
+
return childrenLength;
|
|
54
|
+
}
|
|
55
|
+
function buildColumns(columns, thColumns, tdColumns, depth, id, fixed) {
|
|
56
|
+
if (columns === void 0) { columns = []; }
|
|
57
|
+
if (tdColumns === void 0) { tdColumns = []; }
|
|
58
|
+
if (depth === void 0) { depth = 0; }
|
|
59
|
+
var maxLevel = getMaxLevelThRowSpan(columns);
|
|
60
|
+
// 在处理表头时,如果父级column设置了fixed属性,那么所有children保持一致
|
|
61
|
+
Array.isArray(columns) &&
|
|
62
|
+
columns.forEach(function (column) {
|
|
63
|
+
var groupId = id || guid();
|
|
64
|
+
var childMaxLevel = 0;
|
|
65
|
+
if (column.children) {
|
|
66
|
+
childMaxLevel = getMaxLevelThRowSpan(column.children);
|
|
67
|
+
}
|
|
68
|
+
var newColumn = __assign(__assign({}, column), { rowSpan: childMaxLevel ? 1 : maxLevel - childMaxLevel + depth, colSpan: getThColSpan(column), groupId: groupId, depth: depth });
|
|
69
|
+
var tdColumn = __assign(__assign({}, column), { groupId: groupId });
|
|
70
|
+
if (fixed) {
|
|
71
|
+
newColumn.fixed = fixed;
|
|
72
|
+
tdColumn.fixed = fixed;
|
|
73
|
+
}
|
|
74
|
+
if (!thColumns[depth]) {
|
|
75
|
+
thColumns[depth] = [];
|
|
76
|
+
}
|
|
77
|
+
thColumns[depth].push(newColumn);
|
|
78
|
+
if (column.children && column.children.length > 0) {
|
|
79
|
+
buildColumns(column.children, thColumns, tdColumns, depth + 1, groupId, column.fixed);
|
|
80
|
+
}
|
|
81
|
+
else {
|
|
82
|
+
tdColumn.children; var rest = __rest(tdColumn, ["children"]);
|
|
83
|
+
tdColumns.push(rest);
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
function isFixedLeftColumn(fixed) {
|
|
88
|
+
return fixed === true || fixed === 'left';
|
|
89
|
+
}
|
|
90
|
+
function isFixedRightColumn(fixed) {
|
|
91
|
+
return fixed === 'right';
|
|
92
|
+
}
|
|
93
|
+
function getPreviousLeftWidth(doms, index, columns) {
|
|
94
|
+
var width = 0;
|
|
95
|
+
for (var i = 0; i < index; i++) {
|
|
96
|
+
if (columns && columns[i] && isFixedLeftColumn(columns[i].fixed)) {
|
|
97
|
+
var dom = doms[i];
|
|
98
|
+
width += dom.offsetWidth;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
return width;
|
|
102
|
+
}
|
|
103
|
+
function getAfterRightWidth(doms, index, columns) {
|
|
104
|
+
var width = 0;
|
|
105
|
+
for (var i = doms.length - 0; i > index; i--) {
|
|
106
|
+
if (columns && columns[i] && isFixedRightColumn(columns[i].fixed)) {
|
|
107
|
+
var dom = doms[i];
|
|
108
|
+
width += dom.offsetWidth;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
return width;
|
|
112
|
+
}
|
|
113
|
+
function hasFixedColumn(columns) {
|
|
114
|
+
return find(columns, function (column) { return column.fixed; });
|
|
115
|
+
}
|
|
116
|
+
function getSummaryColumns(summary) {
|
|
117
|
+
if (!summary) {
|
|
118
|
+
return [];
|
|
119
|
+
}
|
|
120
|
+
var last = [];
|
|
121
|
+
var first = [];
|
|
122
|
+
summary.forEach(function (item) {
|
|
123
|
+
if (isObject(item)) {
|
|
124
|
+
first.push(item);
|
|
125
|
+
}
|
|
126
|
+
else if (Array.isArray(item)) {
|
|
127
|
+
last.push(item);
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
|
+
return __spreadArray([first], last, true);
|
|
131
|
+
}
|
|
132
|
+
var DefaultCellWidth = 40;
|
|
133
|
+
var Table = /** @class */ (function (_super) {
|
|
134
|
+
__extends(Table, _super);
|
|
135
|
+
function Table(props) {
|
|
136
|
+
var _this = this;
|
|
137
|
+
var _a;
|
|
138
|
+
_this = _super.call(this, props) || this;
|
|
139
|
+
_this.tableDom = React__default.createRef();
|
|
140
|
+
_this.theadDom = React__default.createRef();
|
|
141
|
+
_this.tbodyDom = React__default.createRef();
|
|
142
|
+
_this.contentDom = React__default.createRef();
|
|
143
|
+
_this.headerDom = React__default.createRef();
|
|
144
|
+
_this.bodyDom = React__default.createRef();
|
|
145
|
+
_this.tfootDom = React__default.createRef();
|
|
146
|
+
_this.footDom = React__default.createRef();
|
|
147
|
+
_this.selectedRows = props.rowSelection
|
|
148
|
+
? _this.getSelectedRows(props.dataSource, (_a = props.rowSelection) === null || _a === void 0 ? void 0 : _a.selectedRowKeys)
|
|
149
|
+
: [];
|
|
150
|
+
_this.state = {
|
|
151
|
+
selectedRowKeys: props.rowSelection
|
|
152
|
+
? props.rowSelection.selectedRowKeys.map(function (key) { return key; }) || []
|
|
153
|
+
: [],
|
|
154
|
+
dataSource: props.dataSource || [],
|
|
155
|
+
expandedRowKeys: __spreadArray(__spreadArray([], (props.expandable ? props.expandable.expandedRowKeys || [] : []), true), (props.expandable
|
|
156
|
+
? props.expandable.defaultExpandedRowKeys || []
|
|
157
|
+
: []), true),
|
|
158
|
+
colWidths: [],
|
|
159
|
+
hoverRow: null
|
|
160
|
+
};
|
|
161
|
+
_this.onTableContentScroll = _this.onTableContentScroll.bind(_this);
|
|
162
|
+
_this.getPopOverContainer = _this.getPopOverContainer.bind(_this);
|
|
163
|
+
return _this;
|
|
164
|
+
}
|
|
165
|
+
Table.prototype.getPopOverContainer = function () {
|
|
166
|
+
return findDOMNode(this);
|
|
167
|
+
};
|
|
168
|
+
Table.prototype.getColWidths = function () {
|
|
169
|
+
var _a, _b;
|
|
170
|
+
var childrens = ((_b = (_a = this.tbodyDom.current) === null || _a === void 0 ? void 0 : _a.children[0]) === null || _b === void 0 ? void 0 : _b.children) || [];
|
|
171
|
+
var colWidths = new Array(childrens ? childrens.length : 0);
|
|
172
|
+
for (var i = 0; i < childrens.length; i++) {
|
|
173
|
+
var child = childrens[i];
|
|
174
|
+
colWidths[i] = child ? child.offsetWidth : null;
|
|
175
|
+
}
|
|
176
|
+
return colWidths;
|
|
177
|
+
};
|
|
178
|
+
Table.prototype.getSelectedRows = function (dataSource, selectedRowKeys) {
|
|
179
|
+
var _this = this;
|
|
180
|
+
var selectedRows = [];
|
|
181
|
+
dataSource.forEach(function (data) {
|
|
182
|
+
if (find(selectedRowKeys, function (key) { return key === data[_this.getRowSelectionKeyField()]; })) {
|
|
183
|
+
selectedRows.push(data);
|
|
184
|
+
}
|
|
185
|
+
});
|
|
186
|
+
return selectedRows;
|
|
187
|
+
};
|
|
188
|
+
Table.prototype.updateTableBodyFixed = function () {
|
|
189
|
+
var tbodyDom = this.tbodyDom && this.tbodyDom.current;
|
|
190
|
+
var tdColumns = __spreadArray([], this.tdColumns, true);
|
|
191
|
+
this.updateTbodyFixedRow(tbodyDom, tdColumns);
|
|
192
|
+
this.updateHeadSummaryFixedRow(tbodyDom);
|
|
193
|
+
};
|
|
194
|
+
Table.prototype.updateColWidths = function () {
|
|
195
|
+
var _this = this;
|
|
196
|
+
this.setState({ colWidths: this.getColWidths() }, function () {
|
|
197
|
+
if (hasFixedColumn(_this.props.columns)) {
|
|
198
|
+
var theadDom = _this.theadDom && _this.theadDom.current;
|
|
199
|
+
var thColumns = _this.thColumns;
|
|
200
|
+
_this.updateTheadFixedRow(theadDom, thColumns);
|
|
201
|
+
_this.updateTableBodyFixed();
|
|
202
|
+
}
|
|
203
|
+
});
|
|
204
|
+
};
|
|
205
|
+
Table.prototype.componentDidMount = function () {
|
|
206
|
+
var _this = this;
|
|
207
|
+
var _a, _b;
|
|
208
|
+
if (this.props.loading) {
|
|
209
|
+
return;
|
|
210
|
+
}
|
|
211
|
+
if (hasFixedColumn(this.props.columns)) {
|
|
212
|
+
var headerDom = this.headerDom && this.headerDom.current;
|
|
213
|
+
if (headerDom) {
|
|
214
|
+
var headerBody = headerDom.getElementsByTagName('tbody');
|
|
215
|
+
headerBody &&
|
|
216
|
+
headerBody[0] &&
|
|
217
|
+
this.updateHeadSummaryFixedRow(headerBody[0]);
|
|
218
|
+
}
|
|
219
|
+
var tfootDom = this.tfootDom && this.tfootDom.current;
|
|
220
|
+
tfootDom && this.updateFootSummaryFixedRow(tfootDom);
|
|
221
|
+
}
|
|
222
|
+
var current = null;
|
|
223
|
+
if (this.contentDom && this.contentDom.current) {
|
|
224
|
+
current = this.contentDom.current;
|
|
225
|
+
current.addEventListener('scroll', this.onTableContentScroll.bind(this));
|
|
226
|
+
}
|
|
227
|
+
else {
|
|
228
|
+
current = (_a = this.headerDom) === null || _a === void 0 ? void 0 : _a.current;
|
|
229
|
+
// overflow设置为hidden的情况
|
|
230
|
+
var hiddenDomRefs = [this.headerDom, this.footDom];
|
|
231
|
+
hiddenDomRefs.forEach(function (ref) {
|
|
232
|
+
return ref &&
|
|
233
|
+
ref.current &&
|
|
234
|
+
ref.current.addEventListener('wheel', _this.onWheel.bind(_this));
|
|
235
|
+
});
|
|
236
|
+
// 横向同步滚动
|
|
237
|
+
var scrollDomRefs = [this.bodyDom];
|
|
238
|
+
scrollDomRefs.forEach(function (ref) {
|
|
239
|
+
return ref &&
|
|
240
|
+
ref.current &&
|
|
241
|
+
ref.current.addEventListener('scroll', _this.onTableScroll.bind(_this));
|
|
242
|
+
});
|
|
243
|
+
}
|
|
244
|
+
current && this.updateTableDom(current);
|
|
245
|
+
if (this.props.draggable) {
|
|
246
|
+
this.initDragging();
|
|
247
|
+
}
|
|
248
|
+
if (this.props.resizable) {
|
|
249
|
+
(_b = this.theadDom.current) === null || _b === void 0 ? void 0 : _b.addEventListener('mouseup', this.onResizeMouseUp.bind(this));
|
|
250
|
+
}
|
|
251
|
+
this.updateStickyHeader();
|
|
252
|
+
this.updateColWidths();
|
|
253
|
+
};
|
|
254
|
+
Table.prototype.componentDidUpdate = function (prevProps, prevState) {
|
|
255
|
+
var _this = this;
|
|
256
|
+
var _a, _b, _c, _d;
|
|
257
|
+
// 数据源发生了变化
|
|
258
|
+
if (!isEqual(prevProps.dataSource, this.props.dataSource)) {
|
|
259
|
+
this.setState({ dataSource: __spreadArray([], this.props.dataSource, true) }, function () {
|
|
260
|
+
return _this.updateColWidths();
|
|
261
|
+
}); // 异步加载数据需求再更新一次
|
|
262
|
+
}
|
|
263
|
+
// 选择项发生了变化触发
|
|
264
|
+
if (!isEqual(prevState.selectedRowKeys, this.state.selectedRowKeys)) {
|
|
265
|
+
// 更新保存的已选择行数据
|
|
266
|
+
this.selectedRows = this.getSelectedRows(this.state.dataSource, this.state.selectedRowKeys);
|
|
267
|
+
var rowSelection = this.props.rowSelection;
|
|
268
|
+
rowSelection &&
|
|
269
|
+
rowSelection.onChange &&
|
|
270
|
+
rowSelection.onChange(this.state.selectedRowKeys, this.selectedRows);
|
|
271
|
+
this.setState({
|
|
272
|
+
selectedRowKeys: this.state.selectedRowKeys.filter(function (key, i, a) { return a.indexOf(key) === i; })
|
|
273
|
+
});
|
|
274
|
+
}
|
|
275
|
+
// 外部传入的选择项发生了变化
|
|
276
|
+
if (!isEqual((_a = prevProps.rowSelection) === null || _a === void 0 ? void 0 : _a.selectedRowKeys, (_b = this.props.rowSelection) === null || _b === void 0 ? void 0 : _b.selectedRowKeys)) {
|
|
277
|
+
if (this.props.rowSelection) {
|
|
278
|
+
this.setState({
|
|
279
|
+
selectedRowKeys: this.props.rowSelection.selectedRowKeys
|
|
280
|
+
});
|
|
281
|
+
this.selectedRows = this.getSelectedRows(this.state.dataSource, this.state.selectedRowKeys);
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
// 外部传入的展开项发生了变化
|
|
285
|
+
if (!isEqual((_c = prevProps === null || prevProps === void 0 ? void 0 : prevProps.expandable) === null || _c === void 0 ? void 0 : _c.expandedRowKeys, (_d = this.props.expandable) === null || _d === void 0 ? void 0 : _d.expandedRowKeys)) {
|
|
286
|
+
if (this.props.expandable) {
|
|
287
|
+
this.setState({
|
|
288
|
+
expandedRowKeys: this.props.expandable.expandedRowKeys || []
|
|
289
|
+
});
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
// 展开行变化时触发
|
|
293
|
+
if (!isEqual(prevState.expandedRowKeys, this.state.expandedRowKeys)) {
|
|
294
|
+
if (this.props.expandable) {
|
|
295
|
+
var _e = this.props.expandable, onExpandedRowsChange = _e.onExpandedRowsChange, keyField_1 = _e.keyField;
|
|
296
|
+
var expandedRows_1 = [];
|
|
297
|
+
this.state.dataSource.forEach(function (item) {
|
|
298
|
+
if (find(_this.state.expandedRowKeys, function (key) { return key == item[keyField_1 || 'key']; })) {
|
|
299
|
+
expandedRows_1.push(item);
|
|
300
|
+
}
|
|
301
|
+
});
|
|
302
|
+
onExpandedRowsChange && onExpandedRowsChange(expandedRows_1);
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
// sticky属性发生了变化
|
|
306
|
+
if (prevProps.sticky !== this.props.sticky) {
|
|
307
|
+
this.updateStickyHeader();
|
|
308
|
+
}
|
|
309
|
+
};
|
|
310
|
+
Table.prototype.componentWillUnmount = function () {
|
|
311
|
+
var _this = this;
|
|
312
|
+
this.contentDom &&
|
|
313
|
+
this.contentDom.current &&
|
|
314
|
+
this.contentDom.current.removeEventListener('scroll', this.onTableContentScroll.bind(this));
|
|
315
|
+
var hiddenDomRefs = [this.headerDom, this.footDom];
|
|
316
|
+
hiddenDomRefs.forEach(function (ref) {
|
|
317
|
+
return ref &&
|
|
318
|
+
ref.current &&
|
|
319
|
+
ref.current.removeEventListener('wheel', _this.onWheel.bind(_this));
|
|
320
|
+
});
|
|
321
|
+
var scrollDomRefs = [this.bodyDom];
|
|
322
|
+
scrollDomRefs.forEach(function (ref) {
|
|
323
|
+
return ref &&
|
|
324
|
+
ref.current &&
|
|
325
|
+
ref.current.removeEventListener('scroll', _this.onTableScroll.bind(_this));
|
|
326
|
+
});
|
|
327
|
+
this.destroyDragging();
|
|
328
|
+
};
|
|
329
|
+
Table.prototype.exchange = function (fromIndex, toIndex, item) {
|
|
330
|
+
var _a = this.props, scroll = _a.scroll, headSummary = _a.headSummary;
|
|
331
|
+
// 如果有头部总结行 fromIndex就会+1
|
|
332
|
+
if ((!scroll || (scroll && !scroll.y)) && headSummary) {
|
|
333
|
+
fromIndex = fromIndex - 1;
|
|
334
|
+
}
|
|
335
|
+
var index = toIndex - fromIndex;
|
|
336
|
+
var levels = item.getAttribute('row-levels');
|
|
337
|
+
var rowIndex = +item.getAttribute('row-index');
|
|
338
|
+
var dataSource = cloneDeep(this.state.dataSource);
|
|
339
|
+
var levelsArray = levels ? levels.split(',') : [];
|
|
340
|
+
var childrenColumnName = this.getChildrenColumnName();
|
|
341
|
+
var data = dataSource;
|
|
342
|
+
var i = 0;
|
|
343
|
+
while (i < levelsArray.length) {
|
|
344
|
+
data = data[levelsArray[i]][childrenColumnName];
|
|
345
|
+
i++;
|
|
346
|
+
}
|
|
347
|
+
if (data && data.length > 0) {
|
|
348
|
+
var row = cloneDeep(data[rowIndex]);
|
|
349
|
+
data.splice(rowIndex, 1);
|
|
350
|
+
data.splice(rowIndex + index, 0, row);
|
|
351
|
+
}
|
|
352
|
+
return data;
|
|
353
|
+
};
|
|
354
|
+
Table.prototype.initDragging = function () {
|
|
355
|
+
var _this = this;
|
|
356
|
+
var _a = this.props, cx = _a.classnames; _a.onDrag;
|
|
357
|
+
this.sortable = new Sortable(this.tbodyDom.current, {
|
|
358
|
+
group: 'table',
|
|
359
|
+
animation: 150,
|
|
360
|
+
handle: ".".concat(cx('Table-dragCell')),
|
|
361
|
+
ghostClass: 'is-dragging',
|
|
362
|
+
onMove: function (e) {
|
|
363
|
+
var dragged = e.dragged;
|
|
364
|
+
var related = e.related;
|
|
365
|
+
if (related &&
|
|
366
|
+
related.classList.contains("".concat(cx('Table-summary-row')))) {
|
|
367
|
+
return false;
|
|
368
|
+
}
|
|
369
|
+
var draggedLevels = dragged.getAttribute('row-levels');
|
|
370
|
+
var relatedLevels = related.getAttribute('row-levels');
|
|
371
|
+
// 嵌套展示 不属于同一层的 不允许拖动
|
|
372
|
+
// 否则涉及到试图的更新,比如子元素都被拖完了
|
|
373
|
+
if (draggedLevels !== relatedLevels) {
|
|
374
|
+
return false;
|
|
375
|
+
}
|
|
376
|
+
return true;
|
|
377
|
+
},
|
|
378
|
+
onEnd: function (e) { return __awaiter(_this, void 0, void 0, function () {
|
|
379
|
+
var onDrag, data, prevented;
|
|
380
|
+
return __generator(this, function (_a) {
|
|
381
|
+
switch (_a.label) {
|
|
382
|
+
case 0:
|
|
383
|
+
// 没有移动
|
|
384
|
+
if (e.newIndex === e.oldIndex) {
|
|
385
|
+
return [2 /*return*/];
|
|
386
|
+
}
|
|
387
|
+
onDrag = this.props.onDrag;
|
|
388
|
+
if (!onDrag) return [3 /*break*/, 2];
|
|
389
|
+
data = this.exchange(e.oldIndex, e.newIndex, e.item);
|
|
390
|
+
return [4 /*yield*/, onDrag(data)];
|
|
391
|
+
case 1:
|
|
392
|
+
prevented = _a.sent();
|
|
393
|
+
if (prevented) {
|
|
394
|
+
return [2 /*return*/];
|
|
395
|
+
}
|
|
396
|
+
_a.label = 2;
|
|
397
|
+
case 2: return [2 /*return*/];
|
|
398
|
+
}
|
|
399
|
+
});
|
|
400
|
+
}); }
|
|
401
|
+
});
|
|
402
|
+
};
|
|
403
|
+
Table.prototype.destroyDragging = function () {
|
|
404
|
+
this.sortable && this.sortable.destroy();
|
|
405
|
+
};
|
|
406
|
+
Table.prototype.updateStickyHeader = function () {
|
|
407
|
+
var _this = this;
|
|
408
|
+
var _a, _b;
|
|
409
|
+
if (this.props.sticky) {
|
|
410
|
+
// 如果设置了sticky 如果父元素设置了overflow: auto top值还需要考虑padding值
|
|
411
|
+
var parent_1 = (_b = (_a = this.headerDom) === null || _a === void 0 ? void 0 : _a.current) === null || _b === void 0 ? void 0 : _b.parentElement;
|
|
412
|
+
setTimeout(function () {
|
|
413
|
+
while (parent_1 &&
|
|
414
|
+
window.getComputedStyle(parent_1, null).getPropertyValue('overflow') !==
|
|
415
|
+
'auto') {
|
|
416
|
+
parent_1 = parent_1.parentElement;
|
|
417
|
+
}
|
|
418
|
+
if (parent_1 &&
|
|
419
|
+
window.getComputedStyle(parent_1, null).getPropertyValue('overflow') ===
|
|
420
|
+
'auto') {
|
|
421
|
+
var paddingTop = window
|
|
422
|
+
.getComputedStyle(parent_1, null)
|
|
423
|
+
.getPropertyValue('padding-top');
|
|
424
|
+
if (paddingTop && _this.headerDom && _this.headerDom.current) {
|
|
425
|
+
_this.headerDom.current.style.top = '-' + paddingTop;
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
});
|
|
429
|
+
}
|
|
430
|
+
};
|
|
431
|
+
// 更新一个tr下的td的left和class
|
|
432
|
+
Table.prototype.updateFixedRow = function (row, columns) {
|
|
433
|
+
var _a, _b, _c;
|
|
434
|
+
var cx = this.props.classnames;
|
|
435
|
+
var children = row.children;
|
|
436
|
+
for (var i = 0; i < children.length; i++) {
|
|
437
|
+
var dom = children[i];
|
|
438
|
+
var fixed = columns[i] ? columns[i].fixed || '' : '';
|
|
439
|
+
if (isFixedLeftColumn(fixed)) {
|
|
440
|
+
dom.style.left =
|
|
441
|
+
i > 0 ? getPreviousLeftWidth(children, i, columns) + 'px' : '0';
|
|
442
|
+
}
|
|
443
|
+
else if (isFixedRightColumn(fixed)) {
|
|
444
|
+
dom.style.right =
|
|
445
|
+
i < children.length - 1
|
|
446
|
+
? getAfterRightWidth(children, i, columns) + 'px'
|
|
447
|
+
: '0';
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
// 最后一个左fixed的添加样式
|
|
451
|
+
var leftIndex = findLastIndex(columns, function (column) {
|
|
452
|
+
return isFixedLeftColumn(column.fixed);
|
|
453
|
+
});
|
|
454
|
+
if (leftIndex > -1) {
|
|
455
|
+
(_a = children[leftIndex]) === null || _a === void 0 ? void 0 : _a.classList.add(cx('Table-cell-fix-left-last'));
|
|
456
|
+
}
|
|
457
|
+
// 第一个右fixed的添加样式
|
|
458
|
+
var rightIndex = columns.findIndex(function (column) {
|
|
459
|
+
return isFixedRightColumn(column.fixed);
|
|
460
|
+
});
|
|
461
|
+
if (rightIndex > -1) {
|
|
462
|
+
(_b = children[rightIndex]) === null || _b === void 0 ? void 0 : _b.classList.add(cx('Table-cell-fix-right-first'));
|
|
463
|
+
if (rightIndex > 0) {
|
|
464
|
+
(_c = children[rightIndex - 1]) === null || _c === void 0 ? void 0 : _c.classList.add(cx('Table-cell-fix-right-first-prev'));
|
|
465
|
+
}
|
|
466
|
+
}
|
|
467
|
+
};
|
|
468
|
+
// 在可选、可展开、可拖拽的情况下,补充column,方便fix处理
|
|
469
|
+
Table.prototype.prependColumns = function (columns) {
|
|
470
|
+
var _a = this.props, rowSelection = _a.rowSelection, expandable = _a.expandable, draggable = _a.draggable;
|
|
471
|
+
if (draggable) {
|
|
472
|
+
columns.unshift({});
|
|
473
|
+
}
|
|
474
|
+
else {
|
|
475
|
+
if (expandable) {
|
|
476
|
+
columns.unshift(expandable);
|
|
477
|
+
}
|
|
478
|
+
if (rowSelection) {
|
|
479
|
+
columns.unshift(rowSelection);
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
};
|
|
483
|
+
Table.prototype.updateTheadFixedRow = function (thead, columns) {
|
|
484
|
+
var children = thead.children;
|
|
485
|
+
for (var i = 0; i < children.length; i++) {
|
|
486
|
+
var cols = __spreadArray([], columns[i], true);
|
|
487
|
+
if (i === 0) {
|
|
488
|
+
this.prependColumns(cols);
|
|
489
|
+
}
|
|
490
|
+
this.updateFixedRow(children[i], cols);
|
|
491
|
+
}
|
|
492
|
+
};
|
|
493
|
+
Table.prototype.updateTbodyFixedRow = function (tbody, columns) {
|
|
494
|
+
var cx = this.props.classnames;
|
|
495
|
+
var children = filter(tbody.children, function (child) {
|
|
496
|
+
return !child.classList.contains(cx('Table-summary-row')) &&
|
|
497
|
+
!child.classList.contains(cx('Table-empty-row'));
|
|
498
|
+
});
|
|
499
|
+
this.prependColumns(columns);
|
|
500
|
+
for (var i = 0; i < children.length; i++) {
|
|
501
|
+
this.updateFixedRow(children[i], columns);
|
|
502
|
+
}
|
|
503
|
+
};
|
|
504
|
+
Table.prototype.updateSummaryFixedRow = function (children, columns) {
|
|
505
|
+
for (var i = 0; i < children.length; i++) {
|
|
506
|
+
this.updateFixedRow(children[i], columns[i]);
|
|
507
|
+
}
|
|
508
|
+
};
|
|
509
|
+
Table.prototype.updateFootSummaryFixedRow = function (tfoot) {
|
|
510
|
+
var footSummary = this.props.footSummary;
|
|
511
|
+
if (Array.isArray(footSummary)) {
|
|
512
|
+
var columns = getSummaryColumns(footSummary);
|
|
513
|
+
this.updateSummaryFixedRow(tfoot.children, columns);
|
|
514
|
+
}
|
|
515
|
+
};
|
|
516
|
+
Table.prototype.updateHeadSummaryFixedRow = function (tbody) {
|
|
517
|
+
var _a = this.props, headSummary = _a.headSummary, cx = _a.classnames;
|
|
518
|
+
if (Array.isArray(headSummary)) {
|
|
519
|
+
var columns = getSummaryColumns(headSummary);
|
|
520
|
+
var children = filter(tbody.children, function (child) {
|
|
521
|
+
return child.classList.contains(cx('Table-summary-row'));
|
|
522
|
+
});
|
|
523
|
+
this.updateSummaryFixedRow(children, columns);
|
|
524
|
+
}
|
|
525
|
+
};
|
|
526
|
+
Table.prototype.renderColGroup = function (colWidths) {
|
|
527
|
+
var _a = this.props, rowSelection = _a.rowSelection, cx = _a.classnames, expandable = _a.expandable, draggable = _a.draggable;
|
|
528
|
+
var tdColumns = this.tdColumns;
|
|
529
|
+
var isExpandable = this.isExpandableTable();
|
|
530
|
+
var extraCount = this.getExtraColumnCount();
|
|
531
|
+
return (React__default.createElement("colgroup", null,
|
|
532
|
+
draggable ? (React__default.createElement("col", { className: cx('Table-drag-col'), style: { width: DefaultCellWidth + 'px' } })) : null,
|
|
533
|
+
!draggable && rowSelection ? (React__default.createElement("col", { className: cx('Table-selection-col'), style: {
|
|
534
|
+
width: (rowSelection.columnWidth || DefaultCellWidth) + 'px'
|
|
535
|
+
} })) : null,
|
|
536
|
+
!draggable && isExpandable ? (React__default.createElement("col", { className: cx('Table-expand-col'), style: {
|
|
537
|
+
width: ((expandable === null || expandable === void 0 ? void 0 : expandable.columnWidth) || DefaultCellWidth) + 'px'
|
|
538
|
+
} })) : null,
|
|
539
|
+
tdColumns.map(function (data, index) {
|
|
540
|
+
var width = colWidths ? colWidths[index + extraCount] : data.width;
|
|
541
|
+
return (React__default.createElement("col", { key: index, style: { width: typeof width === 'number' ? width + 'px' : width }, className: data.className ? cx("Table-colgroup-".concat(data.className)) : '' }));
|
|
542
|
+
})));
|
|
543
|
+
};
|
|
544
|
+
Table.prototype.onResizeMouseDown = function (event, key) {
|
|
545
|
+
// 点击记录起始坐标
|
|
546
|
+
this.resizeStart = event.clientX;
|
|
547
|
+
// 记录点击的列名
|
|
548
|
+
this.resizeKey = key;
|
|
549
|
+
event && event.stopPropagation();
|
|
550
|
+
};
|
|
551
|
+
Table.prototype.onResizeMouseUp = function (event) {
|
|
552
|
+
var _this = this;
|
|
553
|
+
var _a;
|
|
554
|
+
// 点击了调整列宽
|
|
555
|
+
if (this.resizeStart && this.resizeKey) {
|
|
556
|
+
// 计算横向移动距离
|
|
557
|
+
var distance = event.clientX - this.resizeStart;
|
|
558
|
+
var tdColumns = __spreadArray([], this.tdColumns, true);
|
|
559
|
+
var index = tdColumns.findIndex(function (c) { return c.key === _this.resizeKey; }) +
|
|
560
|
+
this.getExtraColumnCount();
|
|
561
|
+
var colGroup = (_a = this.tableDom.current) === null || _a === void 0 ? void 0 : _a.getElementsByTagName('colgroup')[0];
|
|
562
|
+
var currentWidth = 0;
|
|
563
|
+
if (colGroup && colGroup.children[index]) {
|
|
564
|
+
var child = colGroup.children[index];
|
|
565
|
+
currentWidth = child.offsetWidth;
|
|
566
|
+
}
|
|
567
|
+
var newWidth = 0;
|
|
568
|
+
if (colGroup) {
|
|
569
|
+
var maxDistance = 0; // 最多可以移动的距离
|
|
570
|
+
// 调宽列
|
|
571
|
+
if (distance > 0) {
|
|
572
|
+
for (var i = 0; i < colGroup.children.length; i++) {
|
|
573
|
+
var child = colGroup.children[i];
|
|
574
|
+
// 自适应列 保证有一个最小宽度
|
|
575
|
+
// 如果都设置了固定宽度 那一个都拖不动
|
|
576
|
+
if (!this.tdColumns[i].width) {
|
|
577
|
+
maxDistance += child.offsetWidth - DefaultCellWidth;
|
|
578
|
+
}
|
|
579
|
+
}
|
|
580
|
+
if (colGroup.children[index]) {
|
|
581
|
+
var child = colGroup.children[index];
|
|
582
|
+
newWidth = currentWidth + Math.min(distance, maxDistance);
|
|
583
|
+
child.style.width = newWidth + 'px';
|
|
584
|
+
}
|
|
585
|
+
}
|
|
586
|
+
else {
|
|
587
|
+
// 缩短列
|
|
588
|
+
var autoColumns = [];
|
|
589
|
+
for (var i = 0; i < colGroup.children.length; i++) {
|
|
590
|
+
var child = colGroup.children[i];
|
|
591
|
+
// 自适应列 保证有一个最小宽度
|
|
592
|
+
// 如果都设置了固定宽度 那一个都拖不动
|
|
593
|
+
if (!this.tdColumns[i].width) {
|
|
594
|
+
autoColumns.push(child);
|
|
595
|
+
}
|
|
596
|
+
}
|
|
597
|
+
maxDistance = DefaultCellWidth - currentWidth;
|
|
598
|
+
if (colGroup.children[index]) {
|
|
599
|
+
var child = colGroup.children[index];
|
|
600
|
+
newWidth = currentWidth + Math.max(distance, maxDistance);
|
|
601
|
+
child.style.width = newWidth + 'px';
|
|
602
|
+
}
|
|
603
|
+
var gap_1 = Math.abs(Math.max(distance, maxDistance)) / autoColumns.length;
|
|
604
|
+
autoColumns.forEach(function (c) {
|
|
605
|
+
c.style.width = c.offsetWidth + gap_1 + 'px';
|
|
606
|
+
});
|
|
607
|
+
}
|
|
608
|
+
}
|
|
609
|
+
var column = find(tdColumns, function (c) { return c.key === _this.resizeKey; });
|
|
610
|
+
// 只有通过配置设置过的宽度保存到tdColumns
|
|
611
|
+
// 自动分配的不保存
|
|
612
|
+
// 这样可以一直调整了
|
|
613
|
+
if (column && column.width && newWidth) {
|
|
614
|
+
column.width = newWidth;
|
|
615
|
+
}
|
|
616
|
+
this.tdColumns = tdColumns;
|
|
617
|
+
this.resizeStart = 0;
|
|
618
|
+
this.resizeKey = '';
|
|
619
|
+
}
|
|
620
|
+
event && event.stopPropagation();
|
|
621
|
+
};
|
|
622
|
+
Table.prototype.renderTHead = function () {
|
|
623
|
+
var _this = this;
|
|
624
|
+
var _a = this.props, rowSelection = _a.rowSelection, dataSource = _a.dataSource, cx = _a.classnames, onSort = _a.onSort, expandable = _a.expandable, draggable = _a.draggable, resizable = _a.resizable, onSelectAll = _a.onSelectAll, onFilter = _a.onFilter;
|
|
625
|
+
var thColumns = this.thColumns;
|
|
626
|
+
// 获取一行最多th个数
|
|
627
|
+
var maxCount = 0;
|
|
628
|
+
thColumns.forEach(function (columns) {
|
|
629
|
+
if (columns.length > maxCount) {
|
|
630
|
+
maxCount = columns.length;
|
|
631
|
+
}
|
|
632
|
+
});
|
|
633
|
+
var keyField = this.getRowSelectionKeyField();
|
|
634
|
+
var dataList = rowSelection && rowSelection.getCheckboxProps
|
|
635
|
+
? this.state.dataSource.filter(function (data, index) {
|
|
636
|
+
var props = rowSelection.getCheckboxProps(data, index);
|
|
637
|
+
return !props.disabled;
|
|
638
|
+
})
|
|
639
|
+
: this.state.dataSource;
|
|
640
|
+
var isExpandable = this.isExpandableTable();
|
|
641
|
+
var allRowKeys = [];
|
|
642
|
+
var allRows = [];
|
|
643
|
+
dataList.forEach(function (data) {
|
|
644
|
+
allRowKeys.push(data[keyField]);
|
|
645
|
+
allRows.push(data);
|
|
646
|
+
if (!expandable && _this.hasChildrenRow(data)) {
|
|
647
|
+
allRowKeys = __spreadArray(__spreadArray([], allRowKeys, true), _this.getDataChildrenKeys(data), true);
|
|
648
|
+
data[_this.getChildrenColumnName()].forEach(function (item) {
|
|
649
|
+
return allRows.push(item);
|
|
650
|
+
});
|
|
651
|
+
}
|
|
652
|
+
});
|
|
653
|
+
return (React__default.createElement("thead", { ref: this.theadDom, className: cx('Table-thead') }, thColumns.map(function (data, index) {
|
|
654
|
+
return (React__default.createElement("tr", { key: 'th-cell-' + index },
|
|
655
|
+
draggable && index === 0 ? (React__default.createElement(Cell, { wrapperComponent: "th", rowSpan: thColumns.length, className: cx('Table-dragCell') })) : null,
|
|
656
|
+
!draggable && rowSelection && index === 0 ? (React__default.createElement(Cell, { wrapperComponent: "th", rowSpan: thColumns.length, fixed: rowSelection.fixed ? 'left' : '', className: cx('Table-checkCell') }, rowSelection.type !== 'radio'
|
|
657
|
+
? [
|
|
658
|
+
React__default.createElement(CheckBox, { key: "checkAll", partial: _this.state.selectedRowKeys.length > 0 &&
|
|
659
|
+
_this.state.selectedRowKeys.length <
|
|
660
|
+
allRowKeys.length, checked: _this.state.selectedRowKeys.length > 0, onChange: function (value) { return __awaiter(_this, void 0, void 0, function () {
|
|
661
|
+
var changeRows, selectedRows, selectedRowKeys, prevented;
|
|
662
|
+
var _this = this;
|
|
663
|
+
return __generator(this, function (_a) {
|
|
664
|
+
switch (_a.label) {
|
|
665
|
+
case 0:
|
|
666
|
+
if (value) {
|
|
667
|
+
changeRows = dataList.filter(function (data) { return !_this.hasCheckedRows(data); });
|
|
668
|
+
}
|
|
669
|
+
else {
|
|
670
|
+
changeRows = this.selectedRows;
|
|
671
|
+
}
|
|
672
|
+
selectedRows = value ? allRows : [];
|
|
673
|
+
selectedRowKeys = value ? allRowKeys : [];
|
|
674
|
+
if (!onSelectAll) return [3 /*break*/, 2];
|
|
675
|
+
return [4 /*yield*/, onSelectAll(value, selectedRowKeys, selectedRows, changeRows)];
|
|
676
|
+
case 1:
|
|
677
|
+
prevented = _a.sent();
|
|
678
|
+
if (prevented) {
|
|
679
|
+
return [2 /*return*/];
|
|
680
|
+
}
|
|
681
|
+
_a.label = 2;
|
|
682
|
+
case 2:
|
|
683
|
+
this.setState({ selectedRowKeys: selectedRowKeys });
|
|
684
|
+
return [2 /*return*/];
|
|
685
|
+
}
|
|
686
|
+
});
|
|
687
|
+
}); } }),
|
|
688
|
+
rowSelection.selections &&
|
|
689
|
+
rowSelection.selections.length > 0 ? (React__default.createElement(HeadCellSelect, { key: "checkSelection", keys: allRowKeys, selections: rowSelection.selections, popOverContainer: _this.getPopOverContainer })) : null
|
|
690
|
+
]
|
|
691
|
+
: null)) : null,
|
|
692
|
+
!draggable && isExpandable && index === 0 ? (React__default.createElement(Cell, { wrapperComponent: "th", rowSpan: thColumns.length, fixed: expandable && expandable.fixed ? 'left' : '', className: cx('Table-row-expand-icon-cell') })) : null,
|
|
693
|
+
data.map(function (item, i) {
|
|
694
|
+
var sort = null;
|
|
695
|
+
if (item.sorter) {
|
|
696
|
+
sort = (React__default.createElement(HeadCellSort, { column: item, onSort: onSort
|
|
697
|
+
? onSort
|
|
698
|
+
: function (payload) {
|
|
699
|
+
if (typeof item.sorter === 'function') {
|
|
700
|
+
if (payload.orderBy) {
|
|
701
|
+
var sortList = __spreadArray([], _this.state.dataSource, true);
|
|
702
|
+
_this.setState({
|
|
703
|
+
dataSource: sortList.sort(item.sorter)
|
|
704
|
+
});
|
|
705
|
+
}
|
|
706
|
+
else {
|
|
707
|
+
_this.setState({ dataSource: __spreadArray([], dataSource, true) });
|
|
708
|
+
}
|
|
709
|
+
}
|
|
710
|
+
} }));
|
|
711
|
+
}
|
|
712
|
+
var filter = null;
|
|
713
|
+
if (item.filterDropdown) {
|
|
714
|
+
filter = item.filterDropdown;
|
|
715
|
+
}
|
|
716
|
+
else if (item.filters && item.filters.length > 0) {
|
|
717
|
+
filter = (React__default.createElement(HeadCellFilter, { column: item, popOverContainer: _this.getPopOverContainer, onFilter: onFilter }));
|
|
718
|
+
}
|
|
719
|
+
var children = (React__default.createElement("span", null,
|
|
720
|
+
sort,
|
|
721
|
+
filter,
|
|
722
|
+
resizable ? (React__default.createElement("i", { className: cx('Table-thead-resizable'), onMouseDown: function (e) { return _this.onResizeMouseDown(e, item.key); } })) : null));
|
|
723
|
+
return (React__default.createElement(Cell, { wrapperComponent: "th", rowSpan: item.rowSpan, colSpan: item.colSpan, key: "cell-".concat(i), fixed: item.fixed === true ? 'left' : item.fixed, className: cx({
|
|
724
|
+
'Table-cell-last': i === maxCount - 1 && i === data.length - 1
|
|
725
|
+
}), groupId: item.groupId, depth: item.depth }, typeof item.title === 'function'
|
|
726
|
+
? item.title(children)
|
|
727
|
+
: item.title));
|
|
728
|
+
})));
|
|
729
|
+
})));
|
|
730
|
+
};
|
|
731
|
+
Table.prototype.onRowClick = function (event, record, rowIndex) {
|
|
732
|
+
var _a = this.props, rowSelection = _a.rowSelection, onRow = _a.onRow;
|
|
733
|
+
if (rowSelection && rowSelection.type && rowSelection.rowClick) {
|
|
734
|
+
var defaultKey_1 = this.getRowSelectionKeyField();
|
|
735
|
+
var isSelected = !!find(this.state.selectedRowKeys, function (key) { return key === record[defaultKey_1]; });
|
|
736
|
+
this.selectedSingleRow(!isSelected, record);
|
|
737
|
+
}
|
|
738
|
+
if (record && onRow) {
|
|
739
|
+
onRow.onRowClick && onRow.onRowClick(event, record, rowIndex);
|
|
740
|
+
}
|
|
741
|
+
};
|
|
742
|
+
Table.prototype.onRowMouseEnter = function (event, record, rowIndex) {
|
|
743
|
+
var _a = this.props, cx = _a.classnames, onRow = _a.onRow;
|
|
744
|
+
var parent = event.target;
|
|
745
|
+
while (parent && parent.tagName !== 'TR') {
|
|
746
|
+
parent = parent.parentElement;
|
|
747
|
+
}
|
|
748
|
+
if (parent && !parent.classList.contains(cx('Table-row-disabled'))) {
|
|
749
|
+
for (var i = 0; i < parent.children.length; i++) {
|
|
750
|
+
var td = parent.children[i];
|
|
751
|
+
td.classList.add(cx('Table-cell-row-hover')); // 保证有列fixed的时候样式一致
|
|
752
|
+
}
|
|
753
|
+
}
|
|
754
|
+
if (record) {
|
|
755
|
+
var target = event.target;
|
|
756
|
+
if (target.tagName !== 'TR') {
|
|
757
|
+
target = target.closest('tr');
|
|
758
|
+
}
|
|
759
|
+
this.setState({ hoverRow: { target: target, rowIndex: rowIndex, record: record } }, function () {
|
|
760
|
+
if (onRow) {
|
|
761
|
+
onRow.onRowMouseEnter &&
|
|
762
|
+
onRow.onRowMouseEnter(event, record, rowIndex);
|
|
763
|
+
}
|
|
764
|
+
});
|
|
765
|
+
}
|
|
766
|
+
};
|
|
767
|
+
Table.prototype.onRowMouseLeave = function (event, record, rowIndex) {
|
|
768
|
+
var _a = this.props, cx = _a.classnames, onRow = _a.onRow;
|
|
769
|
+
var parent = event.target;
|
|
770
|
+
while (parent && parent.tagName !== 'TR') {
|
|
771
|
+
parent = parent.parentElement;
|
|
772
|
+
}
|
|
773
|
+
if (parent) {
|
|
774
|
+
for (var i = 0; i < parent.children.length; i++) {
|
|
775
|
+
var td = parent.children[i];
|
|
776
|
+
td.classList.remove(cx('Table-cell-row-hover'));
|
|
777
|
+
}
|
|
778
|
+
}
|
|
779
|
+
if (record) {
|
|
780
|
+
if (onRow) {
|
|
781
|
+
onRow.onRowMouseLeave && onRow.onRowMouseLeave(event, record, rowIndex);
|
|
782
|
+
}
|
|
783
|
+
}
|
|
784
|
+
};
|
|
785
|
+
Table.prototype.onMouseLeave = function (event) {
|
|
786
|
+
this.setState({ hoverRow: null });
|
|
787
|
+
};
|
|
788
|
+
Table.prototype.onExpandRow = function (data) {
|
|
789
|
+
var expandedRowKeys = this.state.expandedRowKeys;
|
|
790
|
+
var expandable = this.props.expandable;
|
|
791
|
+
var key = data[this.getExpandableKeyField()];
|
|
792
|
+
this.setState({ expandedRowKeys: __spreadArray(__spreadArray([], expandedRowKeys, true), [key], false) });
|
|
793
|
+
(expandable === null || expandable === void 0 ? void 0 : expandable.onExpand) && (expandable === null || expandable === void 0 ? void 0 : expandable.onExpand(true, data));
|
|
794
|
+
};
|
|
795
|
+
Table.prototype.onCollapseRow = function (data) {
|
|
796
|
+
var expandedRowKeys = this.state.expandedRowKeys;
|
|
797
|
+
var expandable = this.props.expandable;
|
|
798
|
+
var key = data[this.getExpandableKeyField()];
|
|
799
|
+
// 还是得模糊匹配 否则'3'、3匹配不上
|
|
800
|
+
this.setState({ expandedRowKeys: expandedRowKeys.filter(function (k) { return k != key; }) });
|
|
801
|
+
(expandable === null || expandable === void 0 ? void 0 : expandable.onExpand) && (expandable === null || expandable === void 0 ? void 0 : expandable.onExpand(false, data));
|
|
802
|
+
};
|
|
803
|
+
Table.prototype.getChildrenColumnName = function () {
|
|
804
|
+
var childrenColumnName = this.props.childrenColumnName;
|
|
805
|
+
return childrenColumnName || 'children';
|
|
806
|
+
};
|
|
807
|
+
Table.prototype.getRowSelectionKeyField = function () {
|
|
808
|
+
var rowSelection = this.props.rowSelection;
|
|
809
|
+
return rowSelection ? rowSelection.keyField || 'key' : '';
|
|
810
|
+
};
|
|
811
|
+
Table.prototype.getExpandableKeyField = function () {
|
|
812
|
+
var _a = this.props, expandable = _a.expandable, keyField = _a.keyField;
|
|
813
|
+
return (expandable === null || expandable === void 0 ? void 0 : expandable.keyField) || keyField || 'key';
|
|
814
|
+
};
|
|
815
|
+
Table.prototype.hasChildrenRow = function (data) {
|
|
816
|
+
var key = this.getChildrenColumnName();
|
|
817
|
+
return data[key] && Array.isArray(data[key]) && data[key].length > 0;
|
|
818
|
+
};
|
|
819
|
+
// 展开和嵌套不能共存
|
|
820
|
+
Table.prototype.isExpandableRow = function (data, rowIndex) {
|
|
821
|
+
var expandable = this.props.expandable;
|
|
822
|
+
return (expandable &&
|
|
823
|
+
expandable.rowExpandable &&
|
|
824
|
+
expandable.rowExpandable(data, rowIndex));
|
|
825
|
+
};
|
|
826
|
+
// 获取当前行数据所有子行的key值
|
|
827
|
+
Table.prototype.getDataChildrenKeys = function (data) {
|
|
828
|
+
var _this = this;
|
|
829
|
+
var keys = [];
|
|
830
|
+
if (this.hasChildrenRow(data)) {
|
|
831
|
+
var key = this.getChildrenColumnName();
|
|
832
|
+
data[key].forEach(function (item) {
|
|
833
|
+
return (keys = __spreadArray(__spreadArray(__spreadArray([], keys, true), _this.getDataChildrenKeys(item), true), [
|
|
834
|
+
item[_this.getRowSelectionKeyField()]
|
|
835
|
+
], false));
|
|
836
|
+
});
|
|
837
|
+
}
|
|
838
|
+
return keys;
|
|
839
|
+
};
|
|
840
|
+
Table.prototype.hasCheckedRows = function (data) {
|
|
841
|
+
var selectedRowKeys = this.state.selectedRowKeys;
|
|
842
|
+
var childrenKeys = this.getDataChildrenKeys(data);
|
|
843
|
+
return (intersection(selectedRowKeys, __spreadArray(__spreadArray([], childrenKeys, true), [
|
|
844
|
+
data[this.getRowSelectionKeyField()]
|
|
845
|
+
], false)).length > 0);
|
|
846
|
+
};
|
|
847
|
+
Table.prototype.hasCheckedChildrenRows = function (data) {
|
|
848
|
+
var selectedRowKeys = this.state.selectedRowKeys;
|
|
849
|
+
var childrenKeys = this.getDataChildrenKeys(data);
|
|
850
|
+
var length = intersection(selectedRowKeys, childrenKeys).length;
|
|
851
|
+
return length > 0;
|
|
852
|
+
};
|
|
853
|
+
Table.prototype.getExpandedIcons = function (isExpanded, record) {
|
|
854
|
+
var cx = this.props.classnames;
|
|
855
|
+
return isExpanded ? (React__default.createElement("i", { className: cx('Table-expandBtn', 'is-active'), onClick: this.onCollapseRow.bind(this, record) },
|
|
856
|
+
React__default.createElement(Icon, { icon: "right-arrow-bold", className: "icon" }))) : (React__default.createElement("i", { className: cx('Table-expandBtn'), onClick: this.onExpandRow.bind(this, record) },
|
|
857
|
+
React__default.createElement(Icon, { icon: "right-arrow-bold", className: "icon" })));
|
|
858
|
+
};
|
|
859
|
+
Table.prototype.selectedSingleRow = function (value, data) {
|
|
860
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
861
|
+
var _a, rowSelection, onSelect, defaultKey, isRadio, prevented;
|
|
862
|
+
var _this = this;
|
|
863
|
+
return __generator(this, function (_b) {
|
|
864
|
+
switch (_b.label) {
|
|
865
|
+
case 0:
|
|
866
|
+
_a = this.props, rowSelection = _a.rowSelection, onSelect = _a.onSelect;
|
|
867
|
+
defaultKey = this.getRowSelectionKeyField();
|
|
868
|
+
isRadio = rowSelection && rowSelection.type === 'radio';
|
|
869
|
+
if (!onSelect) return [3 /*break*/, 2];
|
|
870
|
+
return [4 /*yield*/, onSelect(data, value, this.selectedRows, this.state.selectedRowKeys)];
|
|
871
|
+
case 1:
|
|
872
|
+
prevented = _b.sent();
|
|
873
|
+
if (prevented) {
|
|
874
|
+
return [2 /*return*/];
|
|
875
|
+
}
|
|
876
|
+
_b.label = 2;
|
|
877
|
+
case 2:
|
|
878
|
+
if (value) {
|
|
879
|
+
if (isRadio) {
|
|
880
|
+
this.setState({ selectedRowKeys: [data[defaultKey]] });
|
|
881
|
+
}
|
|
882
|
+
else {
|
|
883
|
+
this.setState(function (prevState) { return ({
|
|
884
|
+
selectedRowKeys: __spreadArray(__spreadArray(__spreadArray([], prevState.selectedRowKeys, true), [
|
|
885
|
+
data[defaultKey]
|
|
886
|
+
], false), _this.getDataChildrenKeys(data), true).filter(function (key, i, a) { return a.indexOf(key) === i; })
|
|
887
|
+
}); });
|
|
888
|
+
}
|
|
889
|
+
}
|
|
890
|
+
else {
|
|
891
|
+
if (!isRadio) {
|
|
892
|
+
this.setState({
|
|
893
|
+
selectedRowKeys: this.state.selectedRowKeys.filter(function (key) {
|
|
894
|
+
return !__spreadArray([data[defaultKey]], _this.getDataChildrenKeys(data), true).includes(key);
|
|
895
|
+
})
|
|
896
|
+
});
|
|
897
|
+
}
|
|
898
|
+
}
|
|
899
|
+
return [2 /*return*/];
|
|
900
|
+
}
|
|
901
|
+
});
|
|
902
|
+
});
|
|
903
|
+
};
|
|
904
|
+
Table.prototype.renderRow = function (data, rowIndex, levels) {
|
|
905
|
+
var _this = this;
|
|
906
|
+
var _a = this.props, cx = _a.classnames, rowSelection = _a.rowSelection, expandable = _a.expandable, draggable = _a.draggable, indentSize = _a.indentSize, rowClassName = _a.rowClassName, lineHeight = _a.lineHeight // 是否设置了固定行高
|
|
907
|
+
;
|
|
908
|
+
var tdColumns = this.tdColumns;
|
|
909
|
+
var isExpandable = this.isExpandableTable();
|
|
910
|
+
var defaultKey = this.getRowSelectionKeyField();
|
|
911
|
+
var colCount = this.getExtraColumnCount();
|
|
912
|
+
// 当前行是否可展开
|
|
913
|
+
var isExpandableRow = this.isExpandableRow(data, rowIndex);
|
|
914
|
+
// 当前行是否有children
|
|
915
|
+
var hasChildrenRow = this.hasChildrenRow(data);
|
|
916
|
+
var isExpanded = !!find(this.state.expandedRowKeys, function (key) { return key == data[_this.getExpandableKeyField()]; }); // == 匹配 否则'3'、3匹配不上
|
|
917
|
+
// 设置缩进效果
|
|
918
|
+
var indentDom = levels.length > 0 ? (React__default.createElement("span", { className: cx('Table-row-indent', "indent-level-".concat(levels.length)), style: levels.length > 0
|
|
919
|
+
? { paddingLeft: indentSize * levels.length + 'px' }
|
|
920
|
+
: {} })) : null;
|
|
921
|
+
var cells = tdColumns.map(function (item, i) {
|
|
922
|
+
var _a, _b;
|
|
923
|
+
var render = item.render && typeof item.render === 'function'
|
|
924
|
+
? item.render(data[item.key], data, rowIndex, i)
|
|
925
|
+
: null;
|
|
926
|
+
var props = { rowSpan: 1, colSpan: 1 };
|
|
927
|
+
var children = render;
|
|
928
|
+
if (render && isObject(render)) {
|
|
929
|
+
props = render.props;
|
|
930
|
+
children = render.children;
|
|
931
|
+
// 如果合并行 且有展开行,那么合并行不生效
|
|
932
|
+
if (props.rowSpan > 1 && isExpandableRow && hasChildrenRow) {
|
|
933
|
+
props.rowSpan === 1;
|
|
934
|
+
}
|
|
935
|
+
}
|
|
936
|
+
var className = typeof item.className === 'function'
|
|
937
|
+
? item.className(data, rowIndex)
|
|
938
|
+
: '';
|
|
939
|
+
return props.rowSpan === 0 || props.colSpan === 0 ? null : (React__default.createElement(Cell, __assign({ key: i }, props, { fixed: item.fixed === true ? 'left' : item.fixed, column: item, groupId: item.groupId, className: cx((_a = {},
|
|
940
|
+
_a["".concat(className)] = !!className,
|
|
941
|
+
_a)) }),
|
|
942
|
+
React__default.createElement("div", { className: cx('Table-cell-wrapper', (_b = {},
|
|
943
|
+
_b[cx('Table-cell-wrapper-prefix')] = i === 0 &&
|
|
944
|
+
(!!indentDom || (levels.length === 0 && hasChildrenRow)),
|
|
945
|
+
_b[cx("Table-cell-height-".concat(lineHeight))] = !!lineHeight,
|
|
946
|
+
_b)) },
|
|
947
|
+
i === 0 && levels.length > 0 ? indentDom : null,
|
|
948
|
+
i === 0 && hasChildrenRow
|
|
949
|
+
? _this.getExpandedIcons(isExpanded, data)
|
|
950
|
+
: null,
|
|
951
|
+
render ? children : data[item.key])));
|
|
952
|
+
});
|
|
953
|
+
var rowClassNameClass = rowClassName && typeof rowClassName === 'function'
|
|
954
|
+
? rowClassName(data, rowIndex)
|
|
955
|
+
: '';
|
|
956
|
+
// 可展开和嵌套不能同时支持
|
|
957
|
+
// 设置了expandable 数据源里有children也就不生效了
|
|
958
|
+
// 拖拽排序 可选、可展开都先不支持了,可以支持嵌套展示
|
|
959
|
+
var checkboxProps = rowSelection && rowSelection.getCheckboxProps
|
|
960
|
+
? rowSelection.getCheckboxProps(data, rowIndex)
|
|
961
|
+
: {};
|
|
962
|
+
var expandedRowClassName = expandable &&
|
|
963
|
+
expandable.expandedRowClassName &&
|
|
964
|
+
typeof expandable.expandedRowClassName === 'function'
|
|
965
|
+
? expandable.expandedRowClassName(data, rowIndex)
|
|
966
|
+
: '';
|
|
967
|
+
var dataKey = this.getChildrenColumnName();
|
|
968
|
+
var children = !draggable && isExpandableRow && isExpanded ? (React__default.createElement("tr", { key: "expanded", className: cx('Table-expanded-row', expandedRowClassName) },
|
|
969
|
+
React__default.createElement(Cell, { colSpan: tdColumns.length + colCount }, expandable &&
|
|
970
|
+
expandable.expandedRowRender &&
|
|
971
|
+
typeof expandable.expandedRowRender === 'function'
|
|
972
|
+
? expandable.expandedRowRender(data, rowIndex)
|
|
973
|
+
: null))) : this.hasChildrenRow(data) && isExpanded ? (data[dataKey].map(function (item, index) {
|
|
974
|
+
return _this.renderRow(item, index, __spreadArray(__spreadArray([], levels, true), [rowIndex], false));
|
|
975
|
+
})) : null;
|
|
976
|
+
var isChecked = !!find(this.state.selectedRowKeys, function (key) { return key === data[defaultKey]; });
|
|
977
|
+
var hasChildrenChecked = this.hasCheckedChildrenRows(data);
|
|
978
|
+
return [
|
|
979
|
+
React__default.createElement("tr", { key: rowIndex, "row-index": rowIndex, "row-levels": levels.join(','), className: cx('Table-row', "Table-row-level-".concat(levels.length), rowClassNameClass, {
|
|
980
|
+
'Table-row-disabled': !!checkboxProps.disabled
|
|
981
|
+
}), onMouseEnter: function (e) { return _this.onRowMouseEnter(e, data, rowIndex); }, onMouseLeave: function (e) { return _this.onRowMouseLeave(e, data, rowIndex); }, onClick: function (e) { return _this.onRowClick(e, data, rowIndex); } },
|
|
982
|
+
draggable ? (React__default.createElement(Cell, { className: cx('Table-dragCell') },
|
|
983
|
+
React__default.createElement(Icon, { icon: "drag-bar", className: "icon" }))) : null,
|
|
984
|
+
!draggable && rowSelection ? (React__default.createElement(Cell, { fixed: rowSelection.fixed ? 'left' : '', className: cx('Table-checkCell') },
|
|
985
|
+
React__default.createElement(CheckBox, __assign({ name: 'Table-checkbox', type: rowSelection.type || 'checkbox', partial: hasChildrenChecked && !isChecked, checked: hasChildrenChecked || isChecked, onChange: function (value, shift) {
|
|
986
|
+
if (!(rowSelection && rowSelection.rowClick)) {
|
|
987
|
+
_this.selectedSingleRow(value, data);
|
|
988
|
+
}
|
|
989
|
+
event && event.stopPropagation();
|
|
990
|
+
} }, checkboxProps)))) : null,
|
|
991
|
+
!draggable && isExpandable ? (React__default.createElement(Cell, { fixed: expandable && expandable.fixed ? 'left' : '', className: cx('Table-cell-expand-icon-cell') }, isExpandableRow || hasChildrenRow
|
|
992
|
+
? this.getExpandedIcons(isExpanded, data)
|
|
993
|
+
: null)) : null,
|
|
994
|
+
cells),
|
|
995
|
+
children
|
|
996
|
+
];
|
|
997
|
+
};
|
|
998
|
+
Table.prototype.renderTBody = function () {
|
|
999
|
+
var _this = this;
|
|
1000
|
+
var _a = this.props, cx = _a.classnames, headSummary = _a.headSummary, scroll = _a.scroll, placeholder = _a.placeholder, sticky = _a.sticky;
|
|
1001
|
+
var tdColumns = this.tdColumns;
|
|
1002
|
+
var hasScrollY = scroll && scroll.y;
|
|
1003
|
+
var colCount = this.getExtraColumnCount();
|
|
1004
|
+
return (React__default.createElement("tbody", { ref: this.tbodyDom, className: cx('Table-tbody') },
|
|
1005
|
+
!hasScrollY && !sticky && headSummary
|
|
1006
|
+
? this.renderSummaryRow(headSummary)
|
|
1007
|
+
: null,
|
|
1008
|
+
!this.state.dataSource.length ? (React__default.createElement("tr", { className: cx('Table-row', 'Table-empty-row') },
|
|
1009
|
+
React__default.createElement(Cell, { colSpan: tdColumns.length + colCount },
|
|
1010
|
+
React__default.createElement("div", { className: cx('Table-empty') }, typeof placeholder === 'function'
|
|
1011
|
+
? placeholder()
|
|
1012
|
+
: placeholder)))) : (this.state.dataSource.map(function (data, index) {
|
|
1013
|
+
return _this.renderRow(data, index, []);
|
|
1014
|
+
}))));
|
|
1015
|
+
};
|
|
1016
|
+
Table.prototype.isExpandableTable = function () {
|
|
1017
|
+
var expandable = this.props.expandable;
|
|
1018
|
+
// 设置了expandable 优先级更高
|
|
1019
|
+
// 就不支持默认嵌套了
|
|
1020
|
+
return !!expandable;
|
|
1021
|
+
};
|
|
1022
|
+
Table.prototype.isNestedTable = function () {
|
|
1023
|
+
var _this = this;
|
|
1024
|
+
var dataSource = this.props.dataSource;
|
|
1025
|
+
return !!find(dataSource, function (item) { return _this.hasChildrenRow(item); });
|
|
1026
|
+
};
|
|
1027
|
+
Table.prototype.getExtraColumnCount = function () {
|
|
1028
|
+
var _a = this.props, draggable = _a.draggable, rowSelection = _a.rowSelection;
|
|
1029
|
+
var count = 0;
|
|
1030
|
+
if (draggable) {
|
|
1031
|
+
count++;
|
|
1032
|
+
}
|
|
1033
|
+
else {
|
|
1034
|
+
if (this.isExpandableTable()) {
|
|
1035
|
+
count++;
|
|
1036
|
+
}
|
|
1037
|
+
if (rowSelection) {
|
|
1038
|
+
count++;
|
|
1039
|
+
}
|
|
1040
|
+
}
|
|
1041
|
+
return count;
|
|
1042
|
+
};
|
|
1043
|
+
Table.prototype.renderSummaryRow = function (summary) {
|
|
1044
|
+
var _this = this;
|
|
1045
|
+
var _a = this.props, cx = _a.classnames, dataSource = _a.dataSource;
|
|
1046
|
+
var cells = [];
|
|
1047
|
+
var trs = [];
|
|
1048
|
+
var colCount = this.getExtraColumnCount();
|
|
1049
|
+
Array.isArray(summary)
|
|
1050
|
+
? summary.forEach(function (s, index) {
|
|
1051
|
+
Array.isArray(s)
|
|
1052
|
+
? trs.push(React__default.createElement("tr", { onMouseEnter: function (e) { return _this.onRowMouseEnter(e); }, onMouseLeave: function (e) { return _this.onRowMouseLeave(e); }, key: 'summary-tr-' + index, className: cx('Table-summary-row') }, s.map(function (d, i) {
|
|
1053
|
+
// 将操作列自动添加到第一列,用户的colSpan只需要关心实际的列数
|
|
1054
|
+
var colSpan = i === 0 ? (d.colSpan || 1) + colCount : d.colSpan;
|
|
1055
|
+
return (React__default.createElement(Cell, { key: 'summary-tr-cell-' + i, fixed: d.fixed, colSpan: colSpan }, typeof d.render === 'function'
|
|
1056
|
+
? d.render(dataSource)
|
|
1057
|
+
: d.render));
|
|
1058
|
+
})))
|
|
1059
|
+
: cells.push(React__default.createElement(Cell, { key: 'summary-cell-' + index, fixed: s.fixed, colSpan: cells.length === 0 ? (s.colSpan || 1) + colCount : s.colSpan }, typeof s.render === 'function'
|
|
1060
|
+
? s.render(dataSource)
|
|
1061
|
+
: s.render));
|
|
1062
|
+
})
|
|
1063
|
+
: null;
|
|
1064
|
+
return summary
|
|
1065
|
+
? typeof summary === 'function'
|
|
1066
|
+
? summary(dataSource)
|
|
1067
|
+
: __spreadArray([
|
|
1068
|
+
cells.length > 0 ? (React__default.createElement("tr", { onMouseEnter: function (e) { return _this.onRowMouseEnter(e); }, onMouseLeave: function (e) { return _this.onRowMouseLeave(e); }, key: "summary-row", className: cx('Table-summary-row') }, cells)) : null
|
|
1069
|
+
], trs, true)
|
|
1070
|
+
: null;
|
|
1071
|
+
};
|
|
1072
|
+
Table.prototype.renderTFoot = function () {
|
|
1073
|
+
var _a = this.props, cx = _a.classnames, footSummary = _a.footSummary;
|
|
1074
|
+
return (React__default.createElement("tfoot", { ref: this.tfootDom, className: cx('Table-summary') }, this.renderSummaryRow(footSummary)));
|
|
1075
|
+
};
|
|
1076
|
+
Table.prototype.updateTableDom = function (dom) {
|
|
1077
|
+
var cx = this.props.classnames;
|
|
1078
|
+
var scrollLeft = dom.scrollLeft, scrollWidth = dom.scrollWidth, offsetWidth = dom.offsetWidth;
|
|
1079
|
+
var table = this.tableDom.current;
|
|
1080
|
+
var leftCalss = cx('Table-ping-left');
|
|
1081
|
+
if (scrollLeft > 0) {
|
|
1082
|
+
table === null || table === void 0 ? void 0 : table.classList.add(leftCalss);
|
|
1083
|
+
}
|
|
1084
|
+
else {
|
|
1085
|
+
table === null || table === void 0 ? void 0 : table.classList.remove(leftCalss);
|
|
1086
|
+
}
|
|
1087
|
+
var rightClass = cx('Table-ping-right');
|
|
1088
|
+
if (scrollLeft + offsetWidth < scrollWidth) {
|
|
1089
|
+
table === null || table === void 0 ? void 0 : table.classList.add(rightClass);
|
|
1090
|
+
}
|
|
1091
|
+
else {
|
|
1092
|
+
table === null || table === void 0 ? void 0 : table.classList.remove(rightClass);
|
|
1093
|
+
}
|
|
1094
|
+
};
|
|
1095
|
+
Table.prototype.onTableContentScroll = function (event) {
|
|
1096
|
+
this.updateTableDom(event.target);
|
|
1097
|
+
};
|
|
1098
|
+
Table.prototype.onWheel = function (event) {
|
|
1099
|
+
var _a = event, currentTarget = _a.currentTarget, deltaX = _a.deltaX;
|
|
1100
|
+
if (deltaX) {
|
|
1101
|
+
this.onTableScroll({
|
|
1102
|
+
target: currentTarget,
|
|
1103
|
+
scrollLeft: currentTarget.scrollLeft + deltaX
|
|
1104
|
+
});
|
|
1105
|
+
event.preventDefault();
|
|
1106
|
+
}
|
|
1107
|
+
};
|
|
1108
|
+
Table.prototype.onTableScroll = function (event) {
|
|
1109
|
+
var scrollDomRefs = [this.headerDom, this.bodyDom, this.footDom];
|
|
1110
|
+
var target = event.target, scrollLeft = event.scrollLeft;
|
|
1111
|
+
scrollDomRefs.forEach(function (ref) {
|
|
1112
|
+
var current = ref && ref.current;
|
|
1113
|
+
if (current && current !== target) {
|
|
1114
|
+
current.scrollLeft = scrollLeft || target.scrollLeft;
|
|
1115
|
+
}
|
|
1116
|
+
});
|
|
1117
|
+
this.updateTableDom(target);
|
|
1118
|
+
};
|
|
1119
|
+
Table.prototype.renderLoading = function () {
|
|
1120
|
+
var _a = this.props, cx = _a.classnames, loading = _a.loading;
|
|
1121
|
+
return (React__default.createElement("div", { className: cx('Table-loading') }, typeof loading === 'boolean' ? React__default.createElement(Spinner, null) : loading));
|
|
1122
|
+
};
|
|
1123
|
+
Table.prototype.renderTable = function () {
|
|
1124
|
+
var _a = this.props, scroll = _a.scroll, footSummary = _a.footSummary, loading = _a.loading, showHeader = _a.showHeader, itemActions = _a.itemActions, cx = _a.classnames;
|
|
1125
|
+
// 设置了横向滚动轴 则table的table-layout为fixed
|
|
1126
|
+
var hasScrollX = scroll && scroll.x;
|
|
1127
|
+
var hoverRow = this.state.hoverRow;
|
|
1128
|
+
return (React__default.createElement("div", { ref: this.contentDom, className: cx('Table-content'), style: hasScrollX ? { overflow: 'auto hidden' } : {}, onMouseLeave: this.onMouseLeave.bind(this) },
|
|
1129
|
+
itemActions && hoverRow ? (React__default.createElement(ItemActionsWrapper, { dom: hoverRow.target, classnames: cx }, typeof itemActions === 'function'
|
|
1130
|
+
? itemActions(hoverRow.record, hoverRow.rowIndex)
|
|
1131
|
+
: null)) : null,
|
|
1132
|
+
React__default.createElement("table", { style: hasScrollX
|
|
1133
|
+
? { width: scroll.x + 'px', tableLayout: 'fixed' }
|
|
1134
|
+
: { tableLayout: 'auto' }, className: cx('Table-table') },
|
|
1135
|
+
this.renderColGroup(),
|
|
1136
|
+
showHeader ? this.renderTHead() : null,
|
|
1137
|
+
!loading ? this.renderTBody() : null,
|
|
1138
|
+
!loading && footSummary ? this.renderTFoot() : null),
|
|
1139
|
+
loading ? this.renderLoading() : null));
|
|
1140
|
+
};
|
|
1141
|
+
Table.prototype.renderScrollTableHeader = function () {
|
|
1142
|
+
var _a;
|
|
1143
|
+
var _b = this.props, scroll = _b.scroll, headSummary = _b.headSummary, sticky = _b.sticky, showHeader = _b.showHeader, cx = _b.classnames;
|
|
1144
|
+
var style = { overflow: 'hidden' };
|
|
1145
|
+
if (!!sticky) {
|
|
1146
|
+
Object.assign(style, { top: 0 });
|
|
1147
|
+
}
|
|
1148
|
+
var tableStyle = {};
|
|
1149
|
+
if (scroll && (scroll.y || scroll.x)) {
|
|
1150
|
+
Object.assign(tableStyle, {
|
|
1151
|
+
width: scroll && scroll.x ? scroll.x + 'px' : '100%',
|
|
1152
|
+
tableLayout: 'fixed'
|
|
1153
|
+
});
|
|
1154
|
+
}
|
|
1155
|
+
return (React__default.createElement("div", { ref: this.headerDom, className: cx('Table-header', (_a = {},
|
|
1156
|
+
_a[cx('Table-sticky-holder')] = !!sticky,
|
|
1157
|
+
_a)), style: style },
|
|
1158
|
+
React__default.createElement("table", { className: cx('Table-table'), style: tableStyle },
|
|
1159
|
+
this.renderColGroup(this.state.colWidths),
|
|
1160
|
+
showHeader ? this.renderTHead() : null,
|
|
1161
|
+
headSummary ? (React__default.createElement("tbody", null, this.renderSummaryRow(headSummary))) : null)));
|
|
1162
|
+
};
|
|
1163
|
+
Table.prototype.renderScrollTableBody = function () {
|
|
1164
|
+
var _a = this.props, scroll = _a.scroll, itemActions = _a.itemActions, cx = _a.classnames;
|
|
1165
|
+
var style = {};
|
|
1166
|
+
var tableStyle = {};
|
|
1167
|
+
if (scroll && (scroll.y || scroll.x)) {
|
|
1168
|
+
Object.assign(style, {
|
|
1169
|
+
overflow: 'auto scroll',
|
|
1170
|
+
maxHeight: scroll.y
|
|
1171
|
+
});
|
|
1172
|
+
Object.assign(tableStyle, {
|
|
1173
|
+
width: scroll && scroll.x ? scroll.x + 'px' : '100%',
|
|
1174
|
+
tableLayout: 'fixed'
|
|
1175
|
+
});
|
|
1176
|
+
}
|
|
1177
|
+
var hoverRow = this.state.hoverRow;
|
|
1178
|
+
return (React__default.createElement("div", { ref: this.bodyDom, className: cx('Table-body'), style: style, onMouseLeave: this.onMouseLeave.bind(this) },
|
|
1179
|
+
itemActions && hoverRow ? (React__default.createElement(ItemActionsWrapper, { dom: hoverRow.target, classnames: cx }, typeof itemActions === 'function'
|
|
1180
|
+
? itemActions(hoverRow.record, hoverRow.rowIndex)
|
|
1181
|
+
: null)) : null,
|
|
1182
|
+
React__default.createElement("table", { className: cx('Table-table'), style: tableStyle },
|
|
1183
|
+
this.renderColGroup(),
|
|
1184
|
+
this.renderTBody())));
|
|
1185
|
+
};
|
|
1186
|
+
Table.prototype.renderScrollTableFoot = function () {
|
|
1187
|
+
var _a = this.props, scroll = _a.scroll, cx = _a.classnames;
|
|
1188
|
+
return (React__default.createElement("div", { ref: this.footDom, className: cx('Table-summary'), style: { overflow: 'hidden' } },
|
|
1189
|
+
React__default.createElement("table", { className: cx('Table-table'), style: { width: (scroll === null || scroll === void 0 ? void 0 : scroll.x) + 'px' || '100%', tableLayout: 'fixed' } }, this.renderTFoot())));
|
|
1190
|
+
};
|
|
1191
|
+
Table.prototype.renderScrollTable = function () {
|
|
1192
|
+
var _a = this.props, footSummary = _a.footSummary, loading = _a.loading, cx = _a.classnames;
|
|
1193
|
+
return (React__default.createElement("div", { className: cx('Table-container') },
|
|
1194
|
+
this.renderScrollTableHeader(),
|
|
1195
|
+
!loading ? this.renderScrollTableBody() : null,
|
|
1196
|
+
!loading && footSummary ? this.renderScrollTableFoot() : null,
|
|
1197
|
+
loading ? this.renderLoading() : null));
|
|
1198
|
+
};
|
|
1199
|
+
Table.prototype.render = function () {
|
|
1200
|
+
var _a;
|
|
1201
|
+
var _b = this.props, title = _b.title, footer = _b.footer, className = _b.className, scroll = _b.scroll, size = _b.size, bordered = _b.bordered, resizable = _b.resizable, columns = _b.columns, sticky = _b.sticky, cx = _b.classnames;
|
|
1202
|
+
// 过滤掉设置了breakpoint属性的列
|
|
1203
|
+
var filterColumns = columns.filter(function (item) { return !item.breakpoint || !isBreakpoint(item.breakpoint); });
|
|
1204
|
+
this.thColumns = [];
|
|
1205
|
+
this.tdColumns = [];
|
|
1206
|
+
buildColumns(filterColumns, this.thColumns, this.tdColumns);
|
|
1207
|
+
// 是否设置了纵向滚动
|
|
1208
|
+
var hasScrollY = scroll && scroll.y;
|
|
1209
|
+
// 是否设置了横向滚动
|
|
1210
|
+
var hasScrollX = scroll && scroll.x;
|
|
1211
|
+
return (React__default.createElement("div", { ref: this.tableDom, className: cx('Table-v2', className, (_a = {},
|
|
1212
|
+
_a[cx('Table-scroll-horizontal')] = hasScrollX,
|
|
1213
|
+
_a[cx("Table-".concat(size))] = size,
|
|
1214
|
+
_a[cx('Table-bordered')] = bordered,
|
|
1215
|
+
_a[cx('Table-resizable')] = resizable,
|
|
1216
|
+
_a)) },
|
|
1217
|
+
title ? (React__default.createElement("div", { className: cx('Table-title') }, typeof title === 'function' ? title() : title)) : null,
|
|
1218
|
+
hasScrollY || sticky ? (this.renderScrollTable()) : (React__default.createElement("div", { className: cx('Table-container') }, this.renderTable())),
|
|
1219
|
+
footer ? (React__default.createElement("div", { className: cx('Table-footer') }, typeof footer === 'function' ? footer() : footer)) : null));
|
|
1220
|
+
};
|
|
1221
|
+
Table.defaultProps = {
|
|
1222
|
+
title: '',
|
|
1223
|
+
className: '',
|
|
1224
|
+
dataSource: [],
|
|
1225
|
+
columns: [],
|
|
1226
|
+
indentSize: 15,
|
|
1227
|
+
placeholder: '暂无数据',
|
|
1228
|
+
showHeader: true
|
|
1229
|
+
};
|
|
1230
|
+
return Table;
|
|
1231
|
+
}(React__default.PureComponent));
|
|
1232
|
+
var index = themeable(localeable(Table));
|
|
1233
|
+
|
|
1234
|
+
export { Table, index as default };
|