amis-ui 6.13.0-beta.8 → 6.13.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/esm/components/404.d.ts +53 -0
- package/esm/components/404.js +35 -0
- package/esm/components/Alert.d.ts +615 -0
- package/esm/components/Alert.js +266 -0
- package/esm/components/Alert2.d.ts +117 -0
- package/esm/components/Alert2.js +58 -0
- package/esm/components/AlphabetIndexer.d.ts +11 -0
- package/esm/components/AlphabetIndexer.js +48 -0
- package/esm/components/AnchorNav.d.ts +162 -0
- package/esm/components/AnchorNav.js +153 -0
- package/esm/components/AnchorNavSection.d.ts +2 -0
- package/esm/components/AnchorNavSection.js +7 -0
- package/esm/components/ArrayInput.d.ts +617 -0
- package/esm/components/ArrayInput.js +147 -0
- package/esm/components/AsideNav.d.ts +142 -0
- package/esm/components/AsideNav.js +133 -0
- package/esm/components/AssociatedSelection.d.ts +564 -0
- package/esm/components/AssociatedSelection.js +107 -0
- package/esm/components/AutoFoldedList.d.ts +87 -0
- package/esm/components/AutoFoldedList.js +124 -0
- package/esm/components/AutoSizer.d.ts +2 -0
- package/esm/components/AutoSizer.js +8 -0
- package/esm/components/Avatar.d.ts +374 -0
- package/esm/components/Avatar.js +126 -0
- package/esm/components/Badge.d.ts +118 -0
- package/esm/components/Badge.js +154 -0
- package/esm/components/BaiduMapPicker.d.ts +100 -0
- package/esm/components/BaiduMapPicker.js +366 -0
- package/esm/components/BarCode.d.ts +56 -0
- package/esm/components/BarCode.js +42 -0
- package/esm/components/Breadcrumb.d.ts +115 -0
- package/esm/components/Breadcrumb.js +160 -0
- package/esm/components/Button.d.ts +147 -0
- package/esm/components/Button.js +63 -0
- package/esm/components/CalendarMobile.d.ts +431 -0
- package/esm/components/CalendarMobile.js +538 -0
- package/esm/components/Card.d.ts +444 -0
- package/esm/components/Card.js +88 -0
- package/esm/components/Cascader.d.ts +108 -0
- package/esm/components/Cascader.js +515 -0
- package/esm/components/ChainedDropdownSelection.d.ts +561 -0
- package/esm/components/ChainedDropdownSelection.js +104 -0
- package/esm/components/ChainedSelection.d.ts +554 -0
- package/esm/components/ChainedSelection.js +184 -0
- package/esm/components/Checkbox.d.ts +110 -0
- package/esm/components/Checkbox.js +87 -0
- package/esm/components/CityArea.d.ts +299 -0
- package/esm/components/CityArea.js +190 -0
- package/esm/components/CityDB.d.ts +13 -0
- package/esm/components/CityDB.js +3942 -0
- package/esm/components/CodeMirror.d.ts +29 -0
- package/esm/components/CodeMirror.js +140 -0
- package/esm/components/Collapse.d.ts +447 -0
- package/esm/components/Collapse.js +184 -0
- package/esm/components/CollapseGroup.d.ts +219 -0
- package/esm/components/CollapseGroup.js +117 -0
- package/esm/components/ColorPicker.d.ts +530 -0
- package/esm/components/ColorPicker.js +260 -0
- package/esm/components/Combo.d.ts +354 -0
- package/esm/components/Combo.js +212 -0
- package/esm/components/ConditionBuilder.d.ts +2 -0
- package/esm/components/ConditionBuilder.js +7 -0
- package/esm/components/ConfirmBox.d.ts +322 -0
- package/esm/components/ConfirmBox.js +129 -0
- package/esm/components/ContextMenu.d.ts +115 -0
- package/esm/components/ContextMenu.js +310 -0
- package/esm/components/DatePicker.d.ts +638 -0
- package/esm/components/DatePicker.js +717 -0
- package/esm/components/DateRangePicker.d.ts +1046 -0
- package/esm/components/DateRangePicker.js +1386 -0
- package/esm/components/DiffEditor.d.ts +21 -0
- package/esm/components/DiffEditor.js +119 -0
- package/esm/components/DndContainer.d.ts +205 -0
- package/esm/components/DndContainer.js +25 -0
- package/esm/components/Drawer.d.ts +159 -0
- package/esm/components/Drawer.js +272 -0
- package/esm/components/DropDownSelection.d.ts +557 -0
- package/esm/components/DropDownSelection.js +78 -0
- package/esm/components/DropdownContextMenus.d.ts +84 -0
- package/esm/components/DropdownContextMenus.js +93 -0
- package/esm/components/Editor.d.ts +681 -0
- package/esm/components/Editor.js +238 -0
- package/esm/components/Form.d.ts +31 -0
- package/esm/components/Form.js +84 -0
- package/esm/components/FormField.d.ts +287 -0
- package/esm/components/FormField.js +78 -0
- package/esm/components/FormulaPicker.d.ts +2 -0
- package/esm/components/FormulaPicker.js +7 -0
- package/esm/components/GaodeMapPicker.d.ts +89 -0
- package/esm/components/GaodeMapPicker.js +204 -0
- package/esm/components/GridNav.d.ts +53 -0
- package/esm/components/GridNav.js +125 -0
- package/esm/components/GridNavItem.d.ts +2 -0
- package/esm/components/GridNavItem.js +7 -0
- package/esm/components/GroupedSelection.d.ts +543 -0
- package/esm/components/GroupedSelection.js +138 -0
- package/esm/components/HeadCellDropDown.d.ts +2 -0
- package/esm/components/HeadCellDropDown.js +7 -0
- package/esm/components/HorizontalScroll.d.ts +75 -0
- package/esm/components/HorizontalScroll.js +271 -0
- package/esm/components/Html.d.ts +82 -0
- package/esm/components/Html.js +52 -0
- package/esm/components/Icon.d.ts +2 -0
- package/esm/components/Icon.js +7 -0
- package/esm/components/ImageGallery.d.ts +465 -0
- package/esm/components/ImageGallery.js +396 -0
- package/esm/components/Input.d.ts +18 -0
- package/esm/components/Input.js +75 -0
- package/esm/components/InputBox.d.ts +100 -0
- package/esm/components/InputBox.js +98 -0
- package/esm/components/InputBoxWithSuggestion.d.ts +272 -0
- package/esm/components/InputBoxWithSuggestion.js +69 -0
- package/esm/components/InputJSONSchema.d.ts +2 -0
- package/esm/components/InputJSONSchema.js +7 -0
- package/esm/components/InputTable.d.ts +317 -0
- package/esm/components/InputTable.js +176 -0
- package/esm/components/JSONSchemaEditor.d.ts +2 -0
- package/esm/components/JSONSchemaEditor.js +7 -0
- package/esm/components/Layout.d.ts +74 -0
- package/esm/components/Layout.js +60 -0
- package/esm/components/Link.d.ts +60 -0
- package/esm/components/Link.js +44 -0
- package/esm/components/ListGroup.d.ts +77 -0
- package/esm/components/ListGroup.js +31 -0
- package/esm/components/ListMenu.d.ts +568 -0
- package/esm/components/ListMenu.js +62 -0
- package/esm/components/LocationPicker.d.ts +467 -0
- package/esm/components/LocationPicker.js +208 -0
- package/esm/components/Markdown.d.ts +25 -0
- package/esm/components/Markdown.js +70 -0
- package/esm/components/Menu.d.ts +2 -0
- package/esm/components/Menu.js +7 -0
- package/esm/components/MixedInput.d.ts +55 -0
- package/esm/components/MixedInput.js +88 -0
- package/esm/components/MobileDevTool.d.ts +12 -0
- package/esm/components/MobileDevTool.js +312 -0
- package/esm/components/Modal.d.ts +1316 -0
- package/esm/components/Modal.js +261 -0
- package/esm/components/ModalManager.d.ts +17 -0
- package/esm/components/ModalManager.js +42 -0
- package/esm/components/MonthRangePicker.d.ts +744 -0
- package/esm/components/MultilineText.d.ts +454 -0
- package/esm/components/MultilineText.js +90 -0
- package/esm/components/NumberInput.d.ts +201 -0
- package/esm/components/NumberInput.js +274 -0
- package/esm/components/OverflowTpl.d.ts +61 -0
- package/esm/components/OverflowTpl.js +101 -0
- package/esm/components/Pagination.d.ts +812 -0
- package/esm/components/Pagination.js +377 -0
- package/esm/components/PdfViewer.d.ts +49 -0
- package/esm/components/PdfViewer.js +83 -0
- package/esm/components/Picker.d.ts +277 -0
- package/esm/components/Picker.js +73 -0
- package/esm/components/PickerColumn.d.ts +62 -0
- package/esm/components/PickerColumn.js +276 -0
- package/esm/components/PickerContainer.d.ts +291 -0
- package/esm/components/PickerContainer.js +157 -0
- package/esm/components/PopOverContainer.d.ts +59 -0
- package/esm/components/PopOverContainer.js +149 -0
- package/esm/components/PopUp.d.ts +573 -0
- package/esm/components/PopUp.js +85 -0
- package/esm/components/Progress.d.ts +311 -0
- package/esm/components/Progress.js +136 -0
- package/esm/components/PullRefresh.d.ts +79 -0
- package/esm/components/PullRefresh.js +172 -0
- package/esm/components/Radios.d.ts +170 -0
- package/esm/components/Radios.js +129 -0
- package/esm/components/Range.d.ts +131 -0
- package/esm/components/Range.js +517 -0
- package/esm/components/Rating.d.ts +227 -0
- package/esm/components/Rating.js +341 -0
- package/esm/components/ResultBox.d.ts +532 -0
- package/esm/components/ResultBox.js +195 -0
- package/esm/components/ResultList.d.ts +554 -0
- package/esm/components/ResultList.js +254 -0
- package/esm/components/ResultTableList.d.ts +786 -0
- package/esm/components/ResultTableList.js +152 -0
- package/esm/components/ResultTreeList.d.ts +425 -0
- package/esm/components/ResultTreeList.js +241 -0
- package/esm/components/RichText.d.ts +48 -0
- package/esm/components/RichText.js +271 -0
- package/esm/components/SearchBox.d.ts +625 -0
- package/esm/components/SearchBox.js +299 -0
- package/esm/components/Select.d.ts +6498 -0
- package/esm/components/Select.js +815 -0
- package/esm/components/SelectMobile.d.ts +38 -0
- package/esm/components/SelectMobile.js +370 -0
- package/esm/components/Selection.d.ts +598 -0
- package/esm/components/Selection.js +166 -0
- package/esm/components/Shape.d.ts +58 -0
- package/esm/components/Shape.js +429 -0
- package/esm/components/Signature.d.ts +279 -0
- package/esm/components/Signature.js +293 -0
- package/esm/components/Slider.d.ts +56 -0
- package/esm/components/Slider.js +140 -0
- package/esm/components/SparkLine.d.ts +397 -0
- package/esm/components/SparkLine.js +62 -0
- package/esm/components/Spinner.d.ts +266 -0
- package/esm/components/Spinner.js +202 -0
- package/esm/components/Steps.d.ts +117 -0
- package/esm/components/Steps.js +76 -0
- package/esm/components/Switch.d.ts +105 -0
- package/esm/components/Switch.js +73 -0
- package/esm/components/Tab.d.ts +2 -0
- package/esm/components/Tab.js +7 -0
- package/esm/components/Table.d.ts +2 -0
- package/esm/components/Table.js +7 -0
- package/esm/components/TableSelection.d.ts +791 -0
- package/esm/components/TableSelection.js +169 -0
- package/esm/components/Tabs.d.ts +670 -0
- package/esm/components/Tabs.js +607 -0
- package/esm/components/TabsTransfer.d.ts +423 -0
- package/esm/components/TabsTransfer.js +221 -0
- package/esm/components/TabsTransferPicker.d.ts +267 -0
- package/esm/components/TabsTransferPicker.js +81 -0
- package/esm/components/Tag.d.ts +318 -0
- package/esm/components/Tag.js +137 -0
- package/esm/components/Textarea.d.ts +564 -0
- package/esm/components/Textarea.js +147 -0
- package/esm/components/Timeline.d.ts +56 -0
- package/esm/components/Timeline.js +60 -0
- package/esm/components/TimelineItem.d.ts +1292 -0
- package/esm/components/TimelineItem.js +101 -0
- package/esm/components/Tinymce.d.ts +66 -0
- package/esm/components/Tinymce.js +632 -0
- package/esm/components/TitleBar.d.ts +123 -0
- package/esm/components/TitleBar.js +48 -0
- package/esm/components/Toast.d.ts +591 -0
- package/esm/components/Toast.js +247 -0
- package/esm/components/Tooltip.d.ts +65 -0
- package/esm/components/Tooltip.js +36 -0
- package/esm/components/TooltipWrapper.d.ts +217 -0
- package/esm/components/TooltipWrapper.js +181 -0
- package/esm/components/Transfer.d.ts +1844 -0
- package/esm/components/Transfer.js +485 -0
- package/esm/components/TransferDropDown.d.ts +634 -0
- package/esm/components/TransferDropDown.js +98 -0
- package/esm/components/TransferPicker.d.ts +275 -0
- package/esm/components/TransferPicker.js +98 -0
- package/esm/components/TransferSearch.d.ts +283 -0
- package/esm/components/TransferSearch.js +100 -0
- package/esm/components/Tree.d.ts +1953 -0
- package/esm/components/Tree.js +1220 -0
- package/esm/components/TreeSelection.d.ts +601 -0
- package/esm/components/TreeSelection.js +201 -0
- package/esm/components/UserSelect.d.ts +541 -0
- package/esm/components/UserSelect.js +674 -0
- package/esm/components/UserTabSelect.d.ts +315 -0
- package/esm/components/UserTabSelect.js +227 -0
- package/esm/components/VerificationCode.d.ts +116 -0
- package/esm/components/VerificationCode.js +172 -0
- package/esm/components/VirtualList.d.ts +2 -0
- package/esm/components/VirtualList.js +7 -0
- package/esm/components/WithRemoteConfig.d.ts +383 -0
- package/esm/components/WithRemoteConfig.js +302 -0
- package/esm/components/WithStore.d.ts +72 -0
- package/esm/components/WithStore.js +48 -0
- package/esm/components/calendar/Calendar.d.ts +83 -0
- package/esm/components/calendar/Calendar.js +529 -0
- package/esm/components/calendar/CalendarContainer.d.ts +10 -0
- package/esm/components/calendar/CalendarContainer.js +27 -0
- package/esm/components/calendar/DaysView.d.ts +184 -0
- package/esm/components/calendar/DaysView.js +528 -0
- package/esm/components/calendar/MonthsView.d.ts +133 -0
- package/esm/components/calendar/MonthsView.js +175 -0
- package/esm/components/calendar/QuartersView.d.ts +102 -0
- package/esm/components/calendar/QuartersView.js +125 -0
- package/esm/components/calendar/TimeView.d.ts +183 -0
- package/esm/components/calendar/TimeView.js +559 -0
- package/esm/components/calendar/YearsView.d.ts +102 -0
- package/esm/components/calendar/YearsView.js +122 -0
- package/esm/components/condition-builder/Expression.d.ts +292 -0
- package/esm/components/condition-builder/Expression.js +121 -0
- package/esm/components/condition-builder/Field.d.ts +272 -0
- package/esm/components/condition-builder/Field.js +32 -0
- package/esm/components/condition-builder/Formula.d.ts +261 -0
- package/esm/components/condition-builder/Func.d.ts +273 -0
- package/esm/components/condition-builder/Func.js +75 -0
- package/esm/components/condition-builder/Group.d.ts +310 -0
- package/esm/components/condition-builder/Group.js +191 -0
- package/esm/components/condition-builder/GroupOrItem.d.ts +87 -0
- package/esm/components/condition-builder/GroupOrItem.js +105 -0
- package/esm/components/condition-builder/InputSwitch.d.ts +47 -0
- package/esm/components/condition-builder/InputSwitch.js +28 -0
- package/esm/components/condition-builder/Item.d.ts +287 -0
- package/esm/components/condition-builder/Item.js +232 -0
- package/esm/components/condition-builder/Value.d.ts +274 -0
- package/esm/components/condition-builder/Value.js +114 -0
- package/esm/components/condition-builder/config.d.ts +36 -0
- package/esm/components/condition-builder/config.js +120 -0
- package/esm/components/condition-builder/index.d.ts +319 -0
- package/esm/components/condition-builder/index.js +228 -0
- package/esm/components/condition-builder/types.d.ts +116 -0
- package/esm/components/formula/CodeEditor.d.ts +92 -0
- package/esm/components/formula/CodeEditor.js +99 -0
- package/esm/components/formula/Editor.d.ts +516 -0
- package/esm/components/formula/Editor.js +446 -0
- package/esm/components/formula/FuncList.d.ts +46 -0
- package/esm/components/formula/FuncList.js +64 -0
- package/esm/components/formula/Input.d.ts +292 -0
- package/esm/components/formula/Input.js +122 -0
- package/esm/components/formula/Picker.d.ts +492 -0
- package/esm/components/formula/Picker.js +454 -0
- package/esm/components/formula/VariableList.d.ts +58 -0
- package/esm/components/formula/VariableList.js +183 -0
- package/esm/components/formula/plugin.d.ts +51 -0
- package/esm/components/formula/plugin.js +372 -0
- package/esm/components/icons.d.ts +61 -0
- package/esm/components/icons.js +458 -0
- package/esm/components/index.d.ts +138 -0
- package/esm/components/json-schema/Array.d.ts +3 -0
- package/esm/components/json-schema/Array.js +129 -0
- package/esm/components/json-schema/Item.d.ts +5 -0
- package/esm/components/json-schema/Item.js +63 -0
- package/esm/components/json-schema/Object.d.ts +5 -0
- package/esm/components/json-schema/Object.js +265 -0
- package/esm/components/json-schema/index.d.ts +272 -0
- package/esm/components/json-schema/index.js +29 -0
- package/esm/components/menu/MenuContext.d.ts +83 -0
- package/esm/components/menu/MenuContext.js +25 -0
- package/esm/components/menu/MenuItem.d.ts +81 -0
- package/esm/components/menu/MenuItem.js +112 -0
- package/esm/components/menu/PanelMenu.d.ts +46 -0
- package/esm/components/menu/PanelMenu.js +68 -0
- package/esm/components/menu/SubMenu.d.ts +84 -0
- package/esm/components/menu/SubMenu.js +137 -0
- package/esm/components/menu/index.d.ts +381 -0
- package/esm/components/menu/index.js +369 -0
- package/esm/components/schema-editor/Array.d.ts +11 -0
- package/esm/components/schema-editor/Array.js +84 -0
- package/esm/components/schema-editor/Common.d.ts +61 -0
- package/esm/components/schema-editor/Common.js +161 -0
- package/esm/components/schema-editor/Item.d.ts +8 -0
- package/esm/components/schema-editor/Item.js +24 -0
- package/esm/components/schema-editor/Object.d.ts +51 -0
- package/esm/components/schema-editor/Object.js +294 -0
- package/esm/components/schema-editor/SchemaVariableList.d.ts +186 -0
- package/esm/components/schema-editor/SchemaVariableList.js +74 -0
- package/esm/components/schema-editor/SchemaVariableListPicker.d.ts +179 -0
- package/esm/components/schema-editor/SchemaVariableListPicker.js +34 -0
- package/esm/components/schema-editor/index.d.ts +797 -0
- package/esm/components/schema-editor/index.js +122 -0
- package/esm/components/table/Cell.d.ts +36 -0
- package/esm/components/table/Cell.js +43 -0
- package/esm/components/table/ColGroup.d.ts +24 -0
- package/esm/components/table/ColGroup.js +58 -0
- package/esm/components/table/Head.d.ts +45 -0
- package/esm/components/table/Head.js +150 -0
- package/esm/components/table/HeadCellDropDown.d.ts +289 -0
- package/esm/components/table/HeadCellDropDown.js +55 -0
- package/esm/components/table/HeadCellFilter.d.ts +414 -0
- package/esm/components/table/HeadCellFilter.js +131 -0
- package/esm/components/table/HeadCellSelect.d.ts +357 -0
- package/esm/components/table/HeadCellSelect.js +52 -0
- package/esm/components/table/HeadCellSort.d.ts +278 -0
- package/esm/components/table/HeadCellSort.js +88 -0
- package/esm/components/table/ItemActionsWrapper.d.ts +10 -0
- package/esm/components/table/ItemActionsWrapper.js +29 -0
- package/esm/components/table/Row.d.ts +56 -0
- package/esm/components/table/Row.js +224 -0
- package/esm/components/table/SummaryRow.d.ts +28 -0
- package/esm/components/table/SummaryRow.js +73 -0
- package/esm/components/table/index.d.ts +852 -0
- package/esm/components/table/index.js +1069 -0
- package/esm/components/table/util.d.ts +56 -0
- package/esm/components/table/util.js +276 -0
- package/esm/components/virtual-list/AutoSizer.d.ts +19 -0
- package/esm/components/virtual-list/AutoSizer.js +49 -0
- package/esm/components/virtual-list/SizeAndPositionManager.d.ts +70 -0
- package/esm/components/virtual-list/SizeAndPositionManager.js +216 -0
- package/esm/components/virtual-list/constants.d.ts +34 -0
- package/esm/components/virtual-list/constants.js +45 -0
- package/esm/components/virtual-list/index.d.ts +99 -0
- package/esm/components/virtual-list/index.js +288 -0
- package/esm/components/withBadge.d.ts +2 -0
- package/esm/components/withBadge.js +7 -0
- package/esm/hooks/index.d.ts +8 -0
- package/esm/hooks/use-click-away.d.ts +12 -0
- package/esm/hooks/use-click-away.js +55 -0
- package/esm/hooks/use-on-screen.d.ts +2 -0
- package/esm/hooks/use-on-screen.js +28 -0
- package/esm/hooks/use-set-state.d.ts +2 -0
- package/esm/hooks/use-set-state.js +19 -0
- package/esm/hooks/use-sub-form.d.ts +4 -0
- package/esm/hooks/use-sub-form.js +39 -0
- package/esm/hooks/use-touch.d.ts +16 -0
- package/esm/hooks/use-touch.js +77 -0
- package/esm/hooks/use-update-effect.d.ts +3 -0
- package/esm/hooks/use-update-effect.js +21 -0
- package/esm/hooks/use-validation-resolver.d.ts +7 -0
- package/esm/hooks/use-validation-resolver.js +115 -0
- package/esm/icons/alert-danger.svg.js +22 -0
- package/esm/icons/alert-info.svg.js +22 -0
- package/esm/icons/alert-success.svg.js +22 -0
- package/esm/icons/alert-warning.svg.js +22 -0
- package/esm/icons/arrow-double-left.svg.js +24 -0
- package/esm/icons/arrow-double-right.svg.js +24 -0
- package/esm/icons/back.svg.js +21 -0
- package/esm/icons/calendar.svg.js +31 -0
- package/esm/icons/caret.svg.js +21 -0
- package/esm/icons/check.svg.js +21 -0
- package/esm/icons/clock.svg.js +29 -0
- package/esm/icons/close-small.svg.js +24 -0
- package/esm/icons/close.svg.js +21 -0
- package/esm/icons/cloud-upload.svg.js +22 -0
- package/esm/icons/column-filter.svg.js +22 -0
- package/esm/icons/columns.svg.js +21 -0
- package/esm/icons/compress-alt.svg.js +21 -0
- package/esm/icons/copy.svg.js +26 -0
- package/esm/icons/date.svg.js +26 -0
- package/esm/icons/department.svg.js +52 -0
- package/esm/icons/desk-empty.svg.js +73 -0
- package/esm/icons/dot.svg.js +36 -0
- package/esm/icons/down-arrow-bold.svg.js +22 -0
- package/esm/icons/down.svg.js +23 -0
- package/esm/icons/download.svg.js +24 -0
- package/esm/icons/drag-bar.svg.js +53 -0
- package/esm/icons/drag.svg.js +22 -0
- package/esm/icons/edit.svg.js +21 -0
- package/esm/icons/ellipsis-v.svg.js +21 -0
- package/esm/icons/enter.svg.js +20 -0
- package/esm/icons/exchange.svg.js +21 -0
- package/esm/icons/expand-alt.svg.js +21 -0
- package/esm/icons/fail.svg.js +31 -0
- package/esm/icons/file.svg.js +22 -0
- package/esm/icons/filter.svg.js +21 -0
- package/esm/icons/folder.svg.js +24 -0
- package/esm/icons/fullscreen.svg.js +21 -0
- package/esm/icons/function.svg.js +21 -0
- package/esm/icons/home.svg.js +21 -0
- package/esm/icons/if.svg.js +21 -0
- package/esm/icons/image.svg.js +20 -0
- package/esm/icons/info-circle.svg.js +21 -0
- package/esm/icons/info.svg.js +27 -0
- package/esm/icons/input-clear.svg.js +20 -0
- package/esm/icons/invisible.svg.js +22 -0
- package/esm/icons/left-arrow.svg.js +23 -0
- package/esm/icons/loading-outline.svg.js +21 -0
- package/esm/icons/location.svg.js +20 -0
- package/esm/icons/menu.svg.js +20 -0
- package/esm/icons/minus.svg.js +21 -0
- package/esm/icons/move.svg.js +22 -0
- package/esm/icons/mute.svg.js +21 -0
- package/esm/icons/new-edit.svg.js +22 -0
- package/esm/icons/pause.svg.js +21 -0
- package/esm/icons/pencil.svg.js +21 -0
- package/esm/icons/play.svg.js +20 -0
- package/esm/icons/plus-cicle.svg.js +20 -0
- package/esm/icons/plus-fine.svg.js +21 -0
- package/esm/icons/plus.svg.js +21 -0
- package/esm/icons/post.svg.js +48 -0
- package/esm/icons/question-mark.svg.js +26 -0
- package/esm/icons/question.svg.js +21 -0
- package/esm/icons/question2.svg.js +34 -0
- package/esm/icons/redo.svg.js +21 -0
- package/esm/icons/refresh.svg.js +21 -0
- package/esm/icons/reload.svg.js +21 -0
- package/esm/icons/remove.svg.js +21 -0
- package/esm/icons/retry.svg.js +24 -0
- package/esm/icons/right-arrow-bold.svg.js +21 -0
- package/esm/icons/right-arrow.svg.js +23 -0
- package/esm/icons/right-double-arrow.svg.js +22 -0
- package/esm/icons/role.svg.js +43 -0
- package/esm/icons/rotate-left.svg.js +22 -0
- package/esm/icons/rotate-right.svg.js +22 -0
- package/esm/icons/rotate-screen.svg.js +21 -0
- package/esm/icons/scale-origin.svg.js +24 -0
- package/esm/icons/schedule.svg.js +24 -0
- package/esm/icons/search.svg.js +21 -0
- package/esm/icons/setting.svg.js +21 -0
- package/esm/icons/slider-handle-icon.svg.js +22 -0
- package/esm/icons/sort-asc.svg.js +21 -0
- package/esm/icons/sort-default.svg.js +21 -0
- package/esm/icons/sort-desc.svg.js +21 -0
- package/esm/icons/star.svg.js +21 -0
- package/esm/icons/status-close.svg.js +23 -0
- package/esm/icons/steps-finsh.svg.js +22 -0
- package/esm/icons/sub-plus.svg.js +20 -0
- package/esm/icons/success.svg.js +29 -0
- package/esm/icons/transparent.svg.js +38 -0
- package/esm/icons/trash.svg.js +22 -0
- package/esm/icons/tree-down.svg.js +21 -0
- package/esm/icons/undo-normal.svg.js +25 -0
- package/esm/icons/undo.svg.js +21 -0
- package/esm/icons/unfullscreen.svg.js +21 -0
- package/esm/icons/upload.svg.js +21 -0
- package/esm/icons/user-remove.svg.js +33 -0
- package/esm/icons/view.svg.js +22 -0
- package/esm/icons/volume.svg.js +24 -0
- package/esm/icons/warning-mark.svg.js +22 -0
- package/esm/icons/warning.svg.js +21 -0
- package/esm/icons/window-restore.svg.js +21 -0
- package/esm/icons/zoom-in.svg.js +21 -0
- package/esm/icons/zoom-out.svg.js +21 -0
- package/esm/index.d.ts +15 -0
- package/esm/index.js +156 -0
- package/esm/locale/de-DE.d.ts +1 -0
- package/esm/locale/de-DE.js +421 -0
- package/esm/locale/en-US.d.ts +1 -0
- package/esm/locale/en-US.js +427 -0
- package/esm/locale/zh-CN.d.ts +1 -0
- package/esm/locale/zh-CN.js +436 -0
- package/esm/themes/ang.d.ts +3 -0
- package/esm/themes/ang.js +15 -0
- package/esm/themes/antd.d.ts +1 -0
- package/esm/themes/antd.js +42 -0
- package/esm/themes/cxd.d.ts +3 -0
- package/esm/themes/cxd.js +455 -0
- package/esm/themes/dark.d.ts +3 -0
- package/esm/themes/dark.js +23 -0
- package/esm/themes/default.d.ts +4 -0
- package/esm/utils/index.d.ts +2 -0
- package/esm/utils/smoothSignature.d.ts +86 -0
- package/esm/utils/vectorComputed.d.ts +20 -0
- package/esm/utils/vectorComputed.js +75 -0
- package/esm/withRemoteConfig.d.ts +2 -0
- package/esm/withRemoteConfig.js +7 -0
- package/esm/withStore.d.ts +2 -0
- package/esm/withStore.js +7 -0
- package/lib/components/404.d.ts +53 -0
- package/lib/components/404.js +43 -0
- package/lib/components/Alert.d.ts +615 -0
- package/lib/components/Alert.js +279 -0
- package/lib/components/Alert2.d.ts +117 -0
- package/lib/components/Alert2.js +66 -0
- package/lib/components/AlphabetIndexer.d.ts +11 -0
- package/lib/components/AlphabetIndexer.js +59 -0
- package/lib/components/AnchorNav.d.ts +162 -0
- package/lib/components/AnchorNav.js +162 -0
- package/lib/components/AnchorNavSection.d.ts +2 -0
- package/lib/components/AnchorNavSection.js +14 -0
- package/lib/components/ArrayInput.d.ts +617 -0
- package/lib/components/ArrayInput.js +160 -0
- package/lib/components/AsideNav.d.ts +142 -0
- package/lib/components/AsideNav.js +140 -0
- package/lib/components/AssociatedSelection.d.ts +564 -0
- package/lib/components/AssociatedSelection.js +110 -0
- package/lib/components/AutoFoldedList.d.ts +87 -0
- package/lib/components/AutoFoldedList.js +128 -0
- package/lib/components/AutoSizer.d.ts +2 -0
- package/lib/components/AutoSizer.js +15 -0
- package/lib/components/Avatar.d.ts +374 -0
- package/lib/components/Avatar.js +154 -0
- package/lib/components/Badge.d.ts +118 -0
- package/lib/components/Badge.js +165 -0
- package/lib/components/BaiduMapPicker.d.ts +100 -0
- package/lib/components/BaiduMapPicker.js +379 -0
- package/lib/components/BarCode.d.ts +56 -0
- package/lib/components/BarCode.js +52 -0
- package/lib/components/Breadcrumb.d.ts +115 -0
- package/lib/components/Breadcrumb.js +170 -0
- package/lib/components/Button.d.ts +147 -0
- package/lib/components/Button.js +71 -0
- package/lib/components/CalendarMobile.d.ts +431 -0
- package/lib/components/CalendarMobile.js +546 -0
- package/lib/components/Card.d.ts +444 -0
- package/lib/components/Card.js +100 -0
- package/lib/components/Cascader.d.ts +108 -0
- package/lib/components/Cascader.js +527 -0
- package/lib/components/ChainedDropdownSelection.d.ts +561 -0
- package/lib/components/ChainedDropdownSelection.js +116 -0
- package/lib/components/ChainedSelection.d.ts +554 -0
- package/lib/components/ChainedSelection.js +197 -0
- package/lib/components/Checkbox.d.ts +110 -0
- package/lib/components/Checkbox.js +95 -0
- package/lib/components/CityArea.d.ts +299 -0
- package/lib/components/CityArea.js +197 -0
- package/lib/components/CityDB.d.ts +13 -0
- package/lib/components/CityDB.js +3949 -0
- package/lib/components/CodeMirror.d.ts +29 -0
- package/lib/components/CodeMirror.js +152 -0
- package/lib/components/Collapse.d.ts +447 -0
- package/lib/components/Collapse.js +192 -0
- package/lib/components/CollapseGroup.d.ts +219 -0
- package/lib/components/CollapseGroup.js +124 -0
- package/lib/components/ColorPicker.d.ts +530 -0
- package/lib/components/ColorPicker.js +267 -0
- package/lib/components/Combo.d.ts +354 -0
- package/lib/components/Combo.js +165 -0
- package/lib/components/ConditionBuilder.d.ts +2 -0
- package/lib/components/ConditionBuilder.js +14 -0
- package/lib/components/ConfirmBox.d.ts +322 -0
- package/lib/components/ConfirmBox.js +141 -0
- package/lib/components/ContextMenu.d.ts +115 -0
- package/lib/components/ContextMenu.js +327 -0
- package/lib/components/DatePicker.d.ts +638 -0
- package/lib/components/DatePicker.js +725 -0
- package/lib/components/DateRangePicker.d.ts +1046 -0
- package/lib/components/DateRangePicker.js +1398 -0
- package/lib/components/DiffEditor.d.ts +21 -0
- package/lib/components/DiffEditor.js +130 -0
- package/lib/components/DndContainer.d.ts +205 -0
- package/lib/components/DndContainer.js +32 -0
- package/lib/components/Drawer.d.ts +159 -0
- package/lib/components/Drawer.js +282 -0
- package/lib/components/DropDownSelection.d.ts +557 -0
- package/lib/components/DropDownSelection.js +85 -0
- package/lib/components/DropdownContextMenus.d.ts +84 -0
- package/lib/components/DropdownContextMenus.js +101 -0
- package/lib/components/Editor.d.ts +681 -0
- package/lib/components/Editor.js +246 -0
- package/lib/components/Form.d.ts +31 -0
- package/lib/components/Form.js +97 -0
- package/lib/components/FormField.d.ts +287 -0
- package/lib/components/FormField.js +90 -0
- package/lib/components/FormulaPicker.d.ts +2 -0
- package/lib/components/FormulaPicker.js +14 -0
- package/lib/components/GaodeMapPicker.d.ts +89 -0
- package/lib/components/GaodeMapPicker.js +217 -0
- package/lib/components/GridNav.d.ts +53 -0
- package/lib/components/GridNav.js +133 -0
- package/lib/components/GridNavItem.d.ts +2 -0
- package/lib/components/GridNavItem.js +14 -0
- package/lib/components/GroupedSelection.d.ts +543 -0
- package/lib/components/GroupedSelection.js +150 -0
- package/lib/components/HeadCellDropDown.d.ts +2 -0
- package/lib/components/HeadCellDropDown.js +14 -0
- package/lib/components/HorizontalScroll.d.ts +75 -0
- package/lib/components/HorizontalScroll.js +283 -0
- package/lib/components/Html.d.ts +82 -0
- package/lib/components/Html.js +59 -0
- package/lib/components/Icon.d.ts +2 -0
- package/lib/components/Icon.js +14 -0
- package/lib/components/ImageGallery.d.ts +465 -0
- package/lib/components/ImageGallery.js +409 -0
- package/lib/components/Input.d.ts +18 -0
- package/lib/components/Input.js +86 -0
- package/lib/components/InputBox.d.ts +100 -0
- package/lib/components/InputBox.js +110 -0
- package/lib/components/InputBoxWithSuggestion.d.ts +272 -0
- package/lib/components/InputBoxWithSuggestion.js +81 -0
- package/lib/components/InputJSONSchema.d.ts +2 -0
- package/lib/components/InputJSONSchema.js +14 -0
- package/lib/components/InputTable.d.ts +317 -0
- package/lib/components/InputTable.js +189 -0
- package/lib/components/JSONSchemaEditor.d.ts +2 -0
- package/lib/components/JSONSchemaEditor.js +14 -0
- package/lib/components/Layout.d.ts +74 -0
- package/lib/components/Layout.js +56 -0
- package/lib/components/Link.d.ts +60 -0
- package/lib/components/Link.js +56 -0
- package/lib/components/ListGroup.d.ts +77 -0
- package/lib/components/ListGroup.js +43 -0
- package/lib/components/ListMenu.d.ts +568 -0
- package/lib/components/ListMenu.js +74 -0
- package/lib/components/LocationPicker.d.ts +467 -0
- package/lib/components/LocationPicker.js +220 -0
- package/lib/components/Markdown.d.ts +25 -0
- package/lib/components/Markdown.js +83 -0
- package/lib/components/Menu.d.ts +2 -0
- package/lib/components/Menu.js +14 -0
- package/lib/components/MixedInput.d.ts +55 -0
- package/lib/components/MixedInput.js +99 -0
- package/lib/components/MobileDevTool.d.ts +12 -0
- package/lib/components/MobileDevTool.js +325 -0
- package/lib/components/Modal.d.ts +1316 -0
- package/lib/components/Modal.js +272 -0
- package/lib/components/ModalManager.d.ts +17 -0
- package/lib/components/ModalManager.js +53 -0
- package/lib/components/MonthRangePicker.d.ts +744 -0
- package/lib/components/MultilineText.d.ts +454 -0
- package/lib/components/MultilineText.js +102 -0
- package/lib/components/NumberInput.d.ts +201 -0
- package/lib/components/NumberInput.js +289 -0
- package/lib/components/OverflowTpl.d.ts +61 -0
- package/lib/components/OverflowTpl.js +109 -0
- package/lib/components/Pagination.d.ts +812 -0
- package/lib/components/Pagination.js +390 -0
- package/lib/components/PdfViewer.d.ts +49 -0
- package/lib/components/PdfViewer.js +89 -0
- package/lib/components/Picker.d.ts +277 -0
- package/lib/components/Picker.js +80 -0
- package/lib/components/PickerColumn.d.ts +62 -0
- package/lib/components/PickerColumn.js +288 -0
- package/lib/components/PickerContainer.d.ts +291 -0
- package/lib/components/PickerContainer.js +169 -0
- package/lib/components/PopOverContainer.d.ts +59 -0
- package/lib/components/PopOverContainer.js +162 -0
- package/lib/components/PopUp.d.ts +573 -0
- package/lib/components/PopUp.js +94 -0
- package/lib/components/Progress.d.ts +311 -0
- package/lib/components/Progress.js +148 -0
- package/lib/components/PullRefresh.d.ts +79 -0
- package/lib/components/PullRefresh.js +178 -0
- package/lib/components/Radios.d.ts +170 -0
- package/lib/components/Radios.js +126 -0
- package/lib/components/Range.d.ts +131 -0
- package/lib/components/Range.js +528 -0
- package/lib/components/Rating.d.ts +227 -0
- package/lib/components/Rating.js +349 -0
- package/lib/components/ResultBox.d.ts +532 -0
- package/lib/components/ResultBox.js +209 -0
- package/lib/components/ResultList.d.ts +554 -0
- package/lib/components/ResultList.js +268 -0
- package/lib/components/ResultTableList.d.ts +786 -0
- package/lib/components/ResultTableList.js +161 -0
- package/lib/components/ResultTreeList.d.ts +425 -0
- package/lib/components/ResultTreeList.js +256 -0
- package/lib/components/RichText.d.ts +48 -0
- package/lib/components/RichText.js +283 -0
- package/lib/components/SearchBox.d.ts +625 -0
- package/lib/components/SearchBox.js +315 -0
- package/lib/components/Select.d.ts +6497 -0
- package/lib/components/Select.js +832 -0
- package/lib/components/SelectMobile.d.ts +38 -0
- package/lib/components/SelectMobile.js +382 -0
- package/lib/components/Selection.d.ts +598 -0
- package/lib/components/Selection.js +176 -0
- package/lib/components/Shape.d.ts +58 -0
- package/lib/components/Shape.js +434 -0
- package/lib/components/Signature.d.ts +279 -0
- package/lib/components/Signature.js +297 -0
- package/lib/components/Slider.d.ts +56 -0
- package/lib/components/Slider.js +146 -0
- package/lib/components/SparkLine.d.ts +397 -0
- package/lib/components/SparkLine.js +74 -0
- package/lib/components/Spinner.d.ts +266 -0
- package/lib/components/Spinner.js +210 -0
- package/lib/components/Steps.d.ts +117 -0
- package/lib/components/Steps.js +84 -0
- package/lib/components/Switch.d.ts +105 -0
- package/lib/components/Switch.js +80 -0
- package/lib/components/Tab.d.ts +2 -0
- package/lib/components/Tab.js +14 -0
- package/lib/components/Table.d.ts +2 -0
- package/lib/components/Table.js +14 -0
- package/lib/components/TableSelection.d.ts +791 -0
- package/lib/components/TableSelection.js +183 -0
- package/lib/components/Tabs.d.ts +670 -0
- package/lib/components/Tabs.js +618 -0
- package/lib/components/TabsTransfer.d.ts +423 -0
- package/lib/components/TabsTransfer.js +234 -0
- package/lib/components/TabsTransferPicker.d.ts +267 -0
- package/lib/components/TabsTransferPicker.js +93 -0
- package/lib/components/Tag.d.ts +318 -0
- package/lib/components/Tag.js +146 -0
- package/lib/components/Textarea.d.ts +564 -0
- package/lib/components/Textarea.js +160 -0
- package/lib/components/Timeline.d.ts +56 -0
- package/lib/components/Timeline.js +68 -0
- package/lib/components/TimelineItem.d.ts +1292 -0
- package/lib/components/TimelineItem.js +118 -0
- package/lib/components/Tinymce.d.ts +66 -0
- package/lib/components/Tinymce.js +648 -0
- package/lib/components/TitleBar.d.ts +123 -0
- package/lib/components/TitleBar.js +51 -0
- package/lib/components/Toast.d.ts +591 -0
- package/lib/components/Toast.js +258 -0
- package/lib/components/Tooltip.d.ts +65 -0
- package/lib/components/Tooltip.js +43 -0
- package/lib/components/TooltipWrapper.d.ts +217 -0
- package/lib/components/TooltipWrapper.js +188 -0
- package/lib/components/Transfer.d.ts +1844 -0
- package/lib/components/Transfer.js +502 -0
- package/lib/components/TransferDropDown.d.ts +634 -0
- package/lib/components/TransferDropDown.js +106 -0
- package/lib/components/TransferPicker.d.ts +275 -0
- package/lib/components/TransferPicker.js +110 -0
- package/lib/components/TransferSearch.d.ts +283 -0
- package/lib/components/TransferSearch.js +113 -0
- package/lib/components/Tree.d.ts +1953 -0
- package/lib/components/Tree.js +1214 -0
- package/lib/components/TreeSelection.d.ts +601 -0
- package/lib/components/TreeSelection.js +209 -0
- package/lib/components/UserSelect.d.ts +541 -0
- package/lib/components/UserSelect.js +685 -0
- package/lib/components/UserTabSelect.d.ts +315 -0
- package/lib/components/UserTabSelect.js +235 -0
- package/lib/components/VerificationCode.d.ts +116 -0
- package/lib/components/VerificationCode.js +191 -0
- package/lib/components/VirtualList.d.ts +2 -0
- package/lib/components/VirtualList.js +14 -0
- package/lib/components/WithRemoteConfig.d.ts +382 -0
- package/lib/components/WithRemoteConfig.js +316 -0
- package/lib/components/WithStore.d.ts +72 -0
- package/lib/components/WithStore.js +61 -0
- package/lib/components/calendar/Calendar.d.ts +83 -0
- package/lib/components/calendar/Calendar.js +542 -0
- package/lib/components/calendar/CalendarContainer.d.ts +10 -0
- package/lib/components/calendar/CalendarContainer.js +38 -0
- package/lib/components/calendar/DaysView.d.ts +184 -0
- package/lib/components/calendar/DaysView.js +547 -0
- package/lib/components/calendar/MonthsView.d.ts +133 -0
- package/lib/components/calendar/MonthsView.js +188 -0
- package/lib/components/calendar/QuartersView.d.ts +102 -0
- package/lib/components/calendar/QuartersView.js +138 -0
- package/lib/components/calendar/TimeView.d.ts +183 -0
- package/lib/components/calendar/TimeView.js +574 -0
- package/lib/components/calendar/YearsView.d.ts +102 -0
- package/lib/components/calendar/YearsView.js +135 -0
- package/lib/components/condition-builder/Expression.d.ts +292 -0
- package/lib/components/condition-builder/Expression.js +133 -0
- package/lib/components/condition-builder/Field.d.ts +272 -0
- package/lib/components/condition-builder/Field.js +44 -0
- package/lib/components/condition-builder/Formula.d.ts +261 -0
- package/lib/components/condition-builder/Func.d.ts +273 -0
- package/lib/components/condition-builder/Func.js +87 -0
- package/lib/components/condition-builder/Group.d.ts +310 -0
- package/lib/components/condition-builder/Group.js +203 -0
- package/lib/components/condition-builder/GroupOrItem.d.ts +87 -0
- package/lib/components/condition-builder/GroupOrItem.js +117 -0
- package/lib/components/condition-builder/InputSwitch.d.ts +47 -0
- package/lib/components/condition-builder/InputSwitch.js +36 -0
- package/lib/components/condition-builder/Item.d.ts +287 -0
- package/lib/components/condition-builder/Item.js +244 -0
- package/lib/components/condition-builder/Value.d.ts +274 -0
- package/lib/components/condition-builder/Value.js +127 -0
- package/lib/components/condition-builder/config.d.ts +36 -0
- package/lib/components/condition-builder/config.js +125 -0
- package/lib/components/condition-builder/index.d.ts +319 -0
- package/lib/components/condition-builder/index.js +240 -0
- package/lib/components/condition-builder/types.d.ts +116 -0
- package/lib/components/formula/CodeEditor.d.ts +92 -0
- package/lib/components/formula/CodeEditor.js +110 -0
- package/lib/components/formula/Editor.d.ts +516 -0
- package/lib/components/formula/Editor.js +460 -0
- package/lib/components/formula/FuncList.d.ts +46 -0
- package/lib/components/formula/FuncList.js +76 -0
- package/lib/components/formula/Input.d.ts +292 -0
- package/lib/components/formula/Input.js +134 -0
- package/lib/components/formula/Picker.d.ts +492 -0
- package/lib/components/formula/Picker.js +467 -0
- package/lib/components/formula/VariableList.d.ts +58 -0
- package/lib/components/formula/VariableList.js +194 -0
- package/lib/components/formula/plugin.d.ts +51 -0
- package/lib/components/formula/plugin.js +381 -0
- package/lib/components/icons.d.ts +61 -0
- package/lib/components/icons.js +486 -0
- package/lib/components/index.d.ts +138 -0
- package/lib/components/json-schema/Array.d.ts +3 -0
- package/lib/components/json-schema/Array.js +140 -0
- package/lib/components/json-schema/Item.d.ts +5 -0
- package/lib/components/json-schema/Item.js +75 -0
- package/lib/components/json-schema/Object.d.ts +5 -0
- package/lib/components/json-schema/Object.js +278 -0
- package/lib/components/json-schema/index.d.ts +272 -0
- package/lib/components/json-schema/index.js +40 -0
- package/lib/components/menu/MenuContext.d.ts +83 -0
- package/lib/components/menu/MenuContext.js +29 -0
- package/lib/components/menu/MenuItem.d.ts +81 -0
- package/lib/components/menu/MenuItem.js +120 -0
- package/lib/components/menu/PanelMenu.d.ts +46 -0
- package/lib/components/menu/PanelMenu.js +74 -0
- package/lib/components/menu/SubMenu.d.ts +84 -0
- package/lib/components/menu/SubMenu.js +145 -0
- package/lib/components/menu/index.d.ts +381 -0
- package/lib/components/menu/index.js +379 -0
- package/lib/components/schema-editor/Array.d.ts +11 -0
- package/lib/components/schema-editor/Array.js +95 -0
- package/lib/components/schema-editor/Common.d.ts +61 -0
- package/lib/components/schema-editor/Common.js +174 -0
- package/lib/components/schema-editor/Item.d.ts +8 -0
- package/lib/components/schema-editor/Item.js +35 -0
- package/lib/components/schema-editor/Object.d.ts +51 -0
- package/lib/components/schema-editor/Object.js +305 -0
- package/lib/components/schema-editor/SchemaVariableList.d.ts +186 -0
- package/lib/components/schema-editor/SchemaVariableList.js +86 -0
- package/lib/components/schema-editor/SchemaVariableListPicker.d.ts +179 -0
- package/lib/components/schema-editor/SchemaVariableListPicker.js +46 -0
- package/lib/components/schema-editor/index.d.ts +797 -0
- package/lib/components/schema-editor/index.js +131 -0
- package/lib/components/table/Cell.d.ts +36 -0
- package/lib/components/table/Cell.js +50 -0
- package/lib/components/table/ColGroup.d.ts +24 -0
- package/lib/components/table/ColGroup.js +69 -0
- package/lib/components/table/Head.d.ts +45 -0
- package/lib/components/table/Head.js +157 -0
- package/lib/components/table/HeadCellDropDown.d.ts +289 -0
- package/lib/components/table/HeadCellDropDown.js +63 -0
- package/lib/components/table/HeadCellFilter.d.ts +414 -0
- package/lib/components/table/HeadCellFilter.js +140 -0
- package/lib/components/table/HeadCellSelect.d.ts +357 -0
- package/lib/components/table/HeadCellSelect.js +60 -0
- package/lib/components/table/HeadCellSort.d.ts +278 -0
- package/lib/components/table/HeadCellSort.js +96 -0
- package/lib/components/table/ItemActionsWrapper.d.ts +10 -0
- package/lib/components/table/ItemActionsWrapper.js +40 -0
- package/lib/components/table/Row.d.ts +56 -0
- package/lib/components/table/Row.js +231 -0
- package/lib/components/table/SummaryRow.d.ts +28 -0
- package/lib/components/table/SummaryRow.js +81 -0
- package/lib/components/table/index.d.ts +852 -0
- package/lib/components/table/index.js +1083 -0
- package/lib/components/table/util.d.ts +56 -0
- package/lib/components/table/util.js +298 -0
- package/lib/components/virtual-list/AutoSizer.d.ts +19 -0
- package/lib/components/virtual-list/AutoSizer.js +76 -0
- package/lib/components/virtual-list/SizeAndPositionManager.d.ts +70 -0
- package/lib/components/virtual-list/SizeAndPositionManager.js +220 -0
- package/lib/components/virtual-list/constants.d.ts +34 -0
- package/lib/components/virtual-list/constants.js +53 -0
- package/lib/components/virtual-list/index.d.ts +99 -0
- package/lib/components/virtual-list/index.js +317 -0
- package/lib/components/withBadge.d.ts +2 -0
- package/lib/components/withBadge.js +14 -0
- package/lib/helper.css +47744 -0
- package/lib/hooks/index.d.ts +8 -0
- package/lib/hooks/use-click-away.d.ts +12 -0
- package/lib/hooks/use-click-away.js +59 -0
- package/lib/hooks/use-on-screen.d.ts +2 -0
- package/lib/hooks/use-on-screen.js +32 -0
- package/lib/hooks/use-set-state.d.ts +2 -0
- package/lib/hooks/use-set-state.js +27 -0
- package/lib/hooks/use-sub-form.d.ts +4 -0
- package/lib/hooks/use-sub-form.js +48 -0
- package/lib/hooks/use-touch.d.ts +16 -0
- package/lib/hooks/use-touch.js +81 -0
- package/lib/hooks/use-update-effect.d.ts +3 -0
- package/lib/hooks/use-update-effect.js +25 -0
- package/lib/hooks/use-validation-resolver.d.ts +7 -0
- package/lib/hooks/use-validation-resolver.js +125 -0
- package/lib/icons/alert-danger.svg.js +29 -0
- package/lib/icons/alert-info.svg.js +29 -0
- package/lib/icons/alert-success.svg.js +29 -0
- package/lib/icons/alert-warning.svg.js +29 -0
- package/lib/icons/arrow-double-left.svg.js +31 -0
- package/lib/icons/arrow-double-right.svg.js +31 -0
- package/lib/icons/back.svg.js +28 -0
- package/lib/icons/calendar.svg.js +38 -0
- package/lib/icons/caret.svg.js +28 -0
- package/lib/icons/check.svg.js +28 -0
- package/lib/icons/clock.svg.js +36 -0
- package/lib/icons/close-small.svg.js +31 -0
- package/lib/icons/close.svg.js +28 -0
- package/lib/icons/cloud-upload.svg.js +29 -0
- package/lib/icons/column-filter.svg.js +29 -0
- package/lib/icons/columns.svg.js +28 -0
- package/lib/icons/compress-alt.svg.js +28 -0
- package/lib/icons/copy.svg.js +33 -0
- package/lib/icons/date.svg.js +33 -0
- package/lib/icons/department.svg.js +59 -0
- package/lib/icons/desk-empty.svg.js +80 -0
- package/lib/icons/dot.svg.js +43 -0
- package/lib/icons/down-arrow-bold.svg.js +29 -0
- package/lib/icons/down.svg.js +30 -0
- package/lib/icons/download.svg.js +31 -0
- package/lib/icons/drag-bar.svg.js +60 -0
- package/lib/icons/drag.svg.js +29 -0
- package/lib/icons/edit.svg.js +28 -0
- package/lib/icons/ellipsis-v.svg.js +28 -0
- package/lib/icons/enter.svg.js +27 -0
- package/lib/icons/exchange.svg.js +28 -0
- package/lib/icons/expand-alt.svg.js +28 -0
- package/lib/icons/fail.svg.js +38 -0
- package/lib/icons/file.svg.js +29 -0
- package/lib/icons/filter.svg.js +28 -0
- package/lib/icons/folder.svg.js +31 -0
- package/lib/icons/fullscreen.svg.js +28 -0
- package/lib/icons/function.svg.js +28 -0
- package/lib/icons/home.svg.js +28 -0
- package/lib/icons/if.svg.js +28 -0
- package/lib/icons/image.svg.js +27 -0
- package/lib/icons/info-circle.svg.js +28 -0
- package/lib/icons/info.svg.js +34 -0
- package/lib/icons/input-clear.svg.js +27 -0
- package/lib/icons/invisible.svg.js +29 -0
- package/lib/icons/left-arrow.svg.js +30 -0
- package/lib/icons/loading-outline.svg.js +28 -0
- package/lib/icons/location.svg.js +27 -0
- package/lib/icons/menu.svg.js +27 -0
- package/lib/icons/minus.svg.js +28 -0
- package/lib/icons/move.svg.js +29 -0
- package/lib/icons/mute.svg.js +28 -0
- package/lib/icons/new-edit.svg.js +29 -0
- package/lib/icons/pause.svg.js +28 -0
- package/lib/icons/pencil.svg.js +28 -0
- package/lib/icons/play.svg.js +27 -0
- package/lib/icons/plus-cicle.svg.js +27 -0
- package/lib/icons/plus-fine.svg.js +28 -0
- package/lib/icons/plus.svg.js +28 -0
- package/lib/icons/post.svg.js +55 -0
- package/lib/icons/question-mark.svg.js +33 -0
- package/lib/icons/question.svg.js +28 -0
- package/lib/icons/question2.svg.js +41 -0
- package/lib/icons/redo.svg.js +28 -0
- package/lib/icons/refresh.svg.js +28 -0
- package/lib/icons/reload.svg.js +28 -0
- package/lib/icons/remove.svg.js +28 -0
- package/lib/icons/retry.svg.js +31 -0
- package/lib/icons/right-arrow-bold.svg.js +28 -0
- package/lib/icons/right-arrow.svg.js +30 -0
- package/lib/icons/right-double-arrow.svg.js +29 -0
- package/lib/icons/role.svg.js +50 -0
- package/lib/icons/rotate-left.svg.js +29 -0
- package/lib/icons/rotate-right.svg.js +29 -0
- package/lib/icons/rotate-screen.svg.js +28 -0
- package/lib/icons/scale-origin.svg.js +31 -0
- package/lib/icons/schedule.svg.js +31 -0
- package/lib/icons/search.svg.js +28 -0
- package/lib/icons/setting.svg.js +28 -0
- package/lib/icons/slider-handle-icon.svg.js +29 -0
- package/lib/icons/sort-asc.svg.js +28 -0
- package/lib/icons/sort-default.svg.js +28 -0
- package/lib/icons/sort-desc.svg.js +28 -0
- package/lib/icons/star.svg.js +28 -0
- package/lib/icons/status-close.svg.js +30 -0
- package/lib/icons/steps-finsh.svg.js +29 -0
- package/lib/icons/sub-plus.svg.js +27 -0
- package/lib/icons/success.svg.js +36 -0
- package/lib/icons/transparent.svg.js +45 -0
- package/lib/icons/trash.svg.js +29 -0
- package/lib/icons/tree-down.svg.js +28 -0
- package/lib/icons/undo-normal.svg.js +32 -0
- package/lib/icons/undo.svg.js +28 -0
- package/lib/icons/unfullscreen.svg.js +28 -0
- package/lib/icons/upload.svg.js +28 -0
- package/lib/icons/user-remove.svg.js +40 -0
- package/lib/icons/view.svg.js +29 -0
- package/lib/icons/volume.svg.js +31 -0
- package/lib/icons/warning-mark.svg.js +29 -0
- package/lib/icons/warning.svg.js +28 -0
- package/lib/icons/window-restore.svg.js +28 -0
- package/lib/icons/zoom-in.svg.js +28 -0
- package/lib/icons/zoom-out.svg.js +28 -0
- package/lib/index.d.ts +15 -0
- package/lib/index.js +348 -0
- package/lib/locale/de-DE.d.ts +1 -0
- package/lib/locale/de-DE.js +423 -0
- package/lib/locale/en-US.d.ts +1 -0
- package/lib/locale/en-US.js +429 -0
- package/lib/locale/zh-CN.d.ts +1 -0
- package/lib/locale/zh-CN.js +438 -0
- package/lib/scss/helper.scss.js +12 -0
- package/lib/scss/themes/ang.scss.js +12 -0
- package/lib/scss/themes/antd.scss.js +12 -0
- package/lib/scss/themes/cxd.scss.js +12 -0
- package/lib/scss/themes/dark.scss.js +12 -0
- package/lib/scss/themes/default.scss.js +12 -0
- package/lib/themes/ang.css +46414 -0
- package/lib/themes/ang.d.ts +3 -0
- package/lib/themes/ang.js +20 -0
- package/lib/themes/antd.css +46401 -0
- package/lib/themes/antd.d.ts +1 -0
- package/lib/themes/antd.js +44 -0
- package/lib/themes/cxd.css +46390 -0
- package/lib/themes/cxd.d.ts +3 -0
- package/lib/themes/cxd.js +459 -0
- package/lib/themes/dark.css +46421 -0
- package/lib/themes/dark.d.ts +3 -0
- package/lib/themes/dark.js +28 -0
- package/lib/themes/default.css +46390 -0
- package/lib/themes/default.d.ts +4 -0
- package/lib/utils/index.d.ts +2 -0
- package/lib/utils/smoothSignature.d.ts +86 -0
- package/lib/utils/vectorComputed.d.ts +20 -0
- package/lib/utils/vectorComputed.js +84 -0
- package/lib/withRemoteConfig.d.ts +2 -0
- package/lib/withRemoteConfig.js +14 -0
- package/lib/withStore.d.ts +2 -0
- package/lib/withStore.js +14 -0
- package/package.json +8 -4
- package/scss/_components.scss +4 -7
- package/scss/_mixins.scss +1 -0
- package/scss/_properties.scss +1 -1
- package/scss/components/_auto-folder.scss +40 -0
- package/scss/components/_cascader.scss +22 -2
- package/scss/components/_condition-builder.scss +1 -0
- package/scss/components/_crud.scss +32 -0
- package/scss/components/_modal.scss +13 -0
- package/scss/components/_page.scss +0 -1
- package/scss/components/_pagination.scss +1 -2
- package/scss/components/_result-box.scss +15 -3
- package/scss/components/_table.scss +2 -0
- package/scss/components/form/_combo.scss +13 -0
- package/scss/components/form/_form.scss +14 -1
- package/scss/components/form/_icon-picker.scss +1 -0
- package/scss/components/form/_input-group.scss +23 -2
- package/scss/components/form/_nested-select.scss +10 -0
- package/scss/components/form/_picker.scss +33 -0
- package/scss/components/form/_select.scss +30 -4
- package/scss/components/form/_selection.scss +2 -0
- package/scss/components/form/_tree.scss +8 -9
- package/scss/layout/_layout.scss +1 -0
- package/scss/themes/_common.scss +1 -0
|
@@ -0,0 +1,1069 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* amis-ui v6.13.0
|
|
3
|
+
* Copyright 2018-2025 fex
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { __extends, __spreadArray, __read, __awaiter, __generator, __assign, __decorate, __metadata } from 'tslib';
|
|
7
|
+
import React__default from 'react';
|
|
8
|
+
import { findDOMNode } from 'react-dom';
|
|
9
|
+
import find from 'lodash/find';
|
|
10
|
+
import isEqual from 'lodash/isEqual';
|
|
11
|
+
import debounce from 'lodash/debounce';
|
|
12
|
+
import intersection from 'lodash/intersection';
|
|
13
|
+
import Sortable from 'sortablejs';
|
|
14
|
+
import { resizeSensor, offset, getScrollParent, position, getStyleNumber, isObject, filterTree, autobind, themeable, localeable } from 'amis-core';
|
|
15
|
+
import Spinner from '../Spinner.js';
|
|
16
|
+
import ItemActionsWrapper from './ItemActionsWrapper.js';
|
|
17
|
+
import BodyCell from './Cell.js';
|
|
18
|
+
import ColGroup from './ColGroup.js';
|
|
19
|
+
import LazyRow from './Row.js';
|
|
20
|
+
import Head from './Head.js';
|
|
21
|
+
import SummaryRows from './SummaryRow.js';
|
|
22
|
+
import { getRowsByKeys, levelsSplit, getDataChildrenKeys, checkChildrenRow, getSortData, getBuildColumns } from './util.js';
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* @file Table
|
|
26
|
+
* @author fex
|
|
27
|
+
*/
|
|
28
|
+
var DefaultCellWidth = 40;
|
|
29
|
+
var Table = /** @class */ (function (_super) {
|
|
30
|
+
__extends(Table, _super);
|
|
31
|
+
function Table(props) {
|
|
32
|
+
var _this = _super.call(this, props) || this;
|
|
33
|
+
_this.tableDom = React__default.createRef();
|
|
34
|
+
_this.tbodyDom = React__default.createRef();
|
|
35
|
+
_this.contentDom = React__default.createRef();
|
|
36
|
+
_this.headerDom = React__default.createRef();
|
|
37
|
+
_this.footDom = React__default.createRef();
|
|
38
|
+
_this.containerDom = React__default.createRef();
|
|
39
|
+
_this.toDispose = [];
|
|
40
|
+
_this.updateTableInfoLazy = debounce(_this.updateTableInfo.bind(_this), 250, {
|
|
41
|
+
trailing: true,
|
|
42
|
+
leading: false
|
|
43
|
+
});
|
|
44
|
+
_this.updateAutoFillHeightLazy = debounce(_this.updateAutoFillHeight.bind(_this), 250, {
|
|
45
|
+
trailing: true,
|
|
46
|
+
leading: false
|
|
47
|
+
});
|
|
48
|
+
_this.state = {
|
|
49
|
+
selectedRowKeys: props.rowSelection
|
|
50
|
+
? props.rowSelection.selectedRowKeys.map(function (key) { return key; }) || []
|
|
51
|
+
: [],
|
|
52
|
+
expandedRowKeys: __spreadArray(__spreadArray([], __read((props.expandable ? props.expandable.expandedRowKeys || [] : [])), false), __read((props.expandable
|
|
53
|
+
? props.expandable.defaultExpandedRowKeys || []
|
|
54
|
+
: [])), false),
|
|
55
|
+
colWidths: {},
|
|
56
|
+
hoverRow: null
|
|
57
|
+
};
|
|
58
|
+
return _this;
|
|
59
|
+
}
|
|
60
|
+
Table.prototype.getPopOverContainer = function () {
|
|
61
|
+
return findDOMNode(this);
|
|
62
|
+
};
|
|
63
|
+
Table.prototype.componentDidMount = function () {
|
|
64
|
+
var _this = this;
|
|
65
|
+
var _a, _b, _c, _d, _e;
|
|
66
|
+
(_b = (_a = this.props) === null || _a === void 0 ? void 0 : _a.onRef) === null || _b === void 0 ? void 0 : _b.call(_a, this);
|
|
67
|
+
if (this.props.loading) {
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
if ((_c = this.headerDom) === null || _c === void 0 ? void 0 : _c.current) {
|
|
71
|
+
// overflow设置为hidden的情况
|
|
72
|
+
var hiddenDomRefs = [this.headerDom, this.footDom];
|
|
73
|
+
hiddenDomRefs.forEach(function (ref) {
|
|
74
|
+
return ref &&
|
|
75
|
+
ref.current &&
|
|
76
|
+
ref.current.addEventListener('wheel', _this.onWheel.bind(_this));
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
var current = (_d = this.contentDom) === null || _d === void 0 ? void 0 : _d.current;
|
|
80
|
+
current && this.updateTableDom(current);
|
|
81
|
+
if (this.props.draggable && ((_e = this.tbodyDom) === null || _e === void 0 ? void 0 : _e.current)) {
|
|
82
|
+
this.initDragging();
|
|
83
|
+
}
|
|
84
|
+
this.updateStickyHeader();
|
|
85
|
+
var currentNode = findDOMNode(this);
|
|
86
|
+
if (this.props.autoFillHeight) {
|
|
87
|
+
this.toDispose.push(resizeSensor(currentNode.parentElement, this.updateAutoFillHeightLazy, false, 'height'));
|
|
88
|
+
this.updateAutoFillHeight();
|
|
89
|
+
}
|
|
90
|
+
this.toDispose.push(resizeSensor(currentNode, this.updateTableInfoLazy, false, 'width'));
|
|
91
|
+
};
|
|
92
|
+
Table.prototype.componentDidUpdate = function (prevProps, prevState) {
|
|
93
|
+
var _a, _b, _c, _d;
|
|
94
|
+
if (prevProps.autoFillHeight !== this.props.autoFillHeight ||
|
|
95
|
+
(prevProps.loading !== this.props.loading && this.props.autoFillHeight)) {
|
|
96
|
+
this.updateAutoFillHeight();
|
|
97
|
+
}
|
|
98
|
+
// 选择项发生了变化触发
|
|
99
|
+
if (!isEqual(prevState.selectedRowKeys, this.state.selectedRowKeys)) {
|
|
100
|
+
var rowSelectionKeyField = this.getRowSelectionKeyField();
|
|
101
|
+
var childrenColumnName = this.getChildrenColumnName();
|
|
102
|
+
// 更新保存的已选择行数据
|
|
103
|
+
var selectedResult = getRowsByKeys(this.props.dataSource, this.state.selectedRowKeys, rowSelectionKeyField, childrenColumnName);
|
|
104
|
+
var rowSelection = this.props.rowSelection;
|
|
105
|
+
rowSelection &&
|
|
106
|
+
rowSelection.onChange &&
|
|
107
|
+
rowSelection.onChange(this.state.selectedRowKeys, selectedResult.selectedRows);
|
|
108
|
+
}
|
|
109
|
+
// 外部传入的选择项发生了变化
|
|
110
|
+
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)) {
|
|
111
|
+
if (this.props.rowSelection) {
|
|
112
|
+
this.setState({
|
|
113
|
+
selectedRowKeys: this.props.rowSelection.selectedRowKeys
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
// 外部传入的展开项发生了变化
|
|
118
|
+
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)) {
|
|
119
|
+
if (this.props.expandable) {
|
|
120
|
+
this.setState({
|
|
121
|
+
expandedRowKeys: this.props.expandable.expandedRowKeys || []
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
// 展开行变化时触发
|
|
126
|
+
if (!isEqual(prevState.expandedRowKeys, this.state.expandedRowKeys)) {
|
|
127
|
+
if (this.props.expandable) {
|
|
128
|
+
var childrenColumnName = this.getChildrenColumnName();
|
|
129
|
+
var expandableKeyField = this.getExpandableKeyField();
|
|
130
|
+
var onExpandedRowsChange = this.props.expandable.onExpandedRowsChange;
|
|
131
|
+
var expandedResult = getRowsByKeys(this.props.dataSource, this.state.selectedRowKeys, expandableKeyField, childrenColumnName);
|
|
132
|
+
onExpandedRowsChange &&
|
|
133
|
+
onExpandedRowsChange(expandedResult.selectedRows);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
// sticky属性发生了变化
|
|
137
|
+
if (prevProps.sticky !== this.props.sticky) {
|
|
138
|
+
this.updateStickyHeader();
|
|
139
|
+
}
|
|
140
|
+
if (prevProps.columns !== this.props.columns) {
|
|
141
|
+
this.syncTableWidth();
|
|
142
|
+
}
|
|
143
|
+
};
|
|
144
|
+
Table.prototype.componentWillUnmount = function () {
|
|
145
|
+
var _this = this;
|
|
146
|
+
var hiddenDomRefs = [this.headerDom, this.footDom];
|
|
147
|
+
hiddenDomRefs.forEach(function (ref) {
|
|
148
|
+
return ref &&
|
|
149
|
+
ref.current &&
|
|
150
|
+
ref.current.removeEventListener('wheel', _this.onWheel.bind(_this));
|
|
151
|
+
});
|
|
152
|
+
this.destroyDragging();
|
|
153
|
+
this.toDispose.forEach(function (fn) { return fn(); });
|
|
154
|
+
this.toDispose = [];
|
|
155
|
+
this.updateTableInfoLazy.cancel();
|
|
156
|
+
this.updateAutoFillHeightLazy.cancel();
|
|
157
|
+
};
|
|
158
|
+
/**
|
|
159
|
+
* 自动设置表格高度占满界面剩余区域
|
|
160
|
+
* 用 css 实现有点麻烦,要改很多结构,所以先用 dom hack 了,避免对之前的功能有影响
|
|
161
|
+
*/
|
|
162
|
+
Table.prototype.updateAutoFillHeight = function () {
|
|
163
|
+
var tableContent = this.containerDom.current;
|
|
164
|
+
if (!tableContent) {
|
|
165
|
+
return;
|
|
166
|
+
}
|
|
167
|
+
tableContent.removeAttribute('style');
|
|
168
|
+
var autoFillHeight = this.props.autoFillHeight;
|
|
169
|
+
if (!autoFillHeight) {
|
|
170
|
+
return;
|
|
171
|
+
}
|
|
172
|
+
// 计算 table-content 在 dom 中的位置
|
|
173
|
+
var viewportHeight = window.innerHeight;
|
|
174
|
+
var tableContentTop = offset(tableContent).top;
|
|
175
|
+
var parent = getScrollParent(tableContent.parentElement);
|
|
176
|
+
if (parent && parent !== document.body) {
|
|
177
|
+
viewportHeight = parent.clientHeight - 1;
|
|
178
|
+
tableContentTop = position(tableContent, parent).top;
|
|
179
|
+
}
|
|
180
|
+
var tableContentBottom = 0;
|
|
181
|
+
var selfNode = tableContent;
|
|
182
|
+
var parentNode = selfNode.parentElement;
|
|
183
|
+
while (parentNode) {
|
|
184
|
+
var paddingBottom = getStyleNumber(parentNode, 'padding-bottom');
|
|
185
|
+
var borderBottom = getStyleNumber(parentNode, 'border-bottom-width');
|
|
186
|
+
var nextSiblingHeight = 0;
|
|
187
|
+
var nextSibling = selfNode.nextElementSibling;
|
|
188
|
+
while (nextSibling) {
|
|
189
|
+
var positon = getComputedStyle(nextSibling).position;
|
|
190
|
+
if (positon !== 'absolute' && positon !== 'fixed') {
|
|
191
|
+
nextSiblingHeight +=
|
|
192
|
+
nextSibling.offsetHeight +
|
|
193
|
+
getStyleNumber(nextSibling, 'margin-bottom');
|
|
194
|
+
}
|
|
195
|
+
nextSibling = nextSibling.nextElementSibling;
|
|
196
|
+
}
|
|
197
|
+
var marginBottom = getStyleNumber(selfNode, 'margin-bottom');
|
|
198
|
+
tableContentBottom +=
|
|
199
|
+
paddingBottom + borderBottom + marginBottom + nextSiblingHeight;
|
|
200
|
+
selfNode = parentNode;
|
|
201
|
+
parentNode = selfNode.parentElement;
|
|
202
|
+
if (parent && parent !== document.body && parent === selfNode) {
|
|
203
|
+
break;
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
var heightField = autoFillHeight && autoFillHeight.maxHeight
|
|
207
|
+
? 'maxHeight'
|
|
208
|
+
: 'height';
|
|
209
|
+
var heightValue = isObject(autoFillHeight)
|
|
210
|
+
? autoFillHeight[heightField]
|
|
211
|
+
: 0;
|
|
212
|
+
var tableContentHeight = heightValue
|
|
213
|
+
? heightValue
|
|
214
|
+
: Math.round(viewportHeight - tableContentTop - tableContentBottom);
|
|
215
|
+
if (tableContentHeight > 0) {
|
|
216
|
+
tableContent.style[heightField] = "".concat(tableContentHeight, "px");
|
|
217
|
+
tableContent.style['overflow'] = 'auto';
|
|
218
|
+
}
|
|
219
|
+
};
|
|
220
|
+
Table.prototype.initDragging = function () {
|
|
221
|
+
var _this = this;
|
|
222
|
+
var _a;
|
|
223
|
+
var _b = this.props, cx = _b.classnames, onDrag = _b.onDrag;
|
|
224
|
+
this.sortable = new Sortable((_a = this.tbodyDom) === null || _a === void 0 ? void 0 : _a.current, {
|
|
225
|
+
group: 'table',
|
|
226
|
+
animation: 150,
|
|
227
|
+
handle: ".".concat(cx('Table-dragCell')),
|
|
228
|
+
ghostClass: 'is-dragging',
|
|
229
|
+
onMove: function (e) {
|
|
230
|
+
var dragged = e.dragged;
|
|
231
|
+
var related = e.related;
|
|
232
|
+
if (related &&
|
|
233
|
+
related.classList.contains("".concat(cx('Table-summary-row')))) {
|
|
234
|
+
return false;
|
|
235
|
+
}
|
|
236
|
+
var draggedLevels = dragged.getAttribute('row-levels');
|
|
237
|
+
var relatedLevels = related.getAttribute('row-levels');
|
|
238
|
+
// 嵌套展示 不属于同一层的 不允许拖动
|
|
239
|
+
// 否则涉及到试图的更新,比如子元素都被拖完了
|
|
240
|
+
if (draggedLevels !== relatedLevels) {
|
|
241
|
+
return false;
|
|
242
|
+
}
|
|
243
|
+
return true;
|
|
244
|
+
},
|
|
245
|
+
onEnd: function (e) { return __awaiter(_this, void 0, void 0, function () {
|
|
246
|
+
var oldIndex, newIndex, rowLevels, i;
|
|
247
|
+
return __generator(this, function (_a) {
|
|
248
|
+
// 没有移动
|
|
249
|
+
if (e.newIndex === e.oldIndex) {
|
|
250
|
+
return [2 /*return*/];
|
|
251
|
+
}
|
|
252
|
+
oldIndex = e.oldIndex;
|
|
253
|
+
newIndex = e.newIndex;
|
|
254
|
+
rowLevels = levelsSplit(e.item.getAttribute('row-levels'));
|
|
255
|
+
if (rowLevels.length) {
|
|
256
|
+
i = 0;
|
|
257
|
+
while (i < rowLevels.length) {
|
|
258
|
+
oldIndex = oldIndex - rowLevels[i] - 1;
|
|
259
|
+
newIndex = newIndex - rowLevels[i] - 1;
|
|
260
|
+
i++;
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
onDrag && onDrag(oldIndex, newIndex, rowLevels);
|
|
264
|
+
return [2 /*return*/];
|
|
265
|
+
});
|
|
266
|
+
}); }
|
|
267
|
+
});
|
|
268
|
+
};
|
|
269
|
+
Table.prototype.destroyDragging = function () {
|
|
270
|
+
this.sortable && this.sortable.destroy();
|
|
271
|
+
this.sortable = null;
|
|
272
|
+
};
|
|
273
|
+
Table.prototype.updateStickyHeader = function () {
|
|
274
|
+
var _this = this;
|
|
275
|
+
var _a, _b;
|
|
276
|
+
if (this.props.sticky) {
|
|
277
|
+
// 如果设置了sticky 如果父元素设置了overflow: auto top值还需要考虑padding值
|
|
278
|
+
var parent_1 = (_b = (_a = this.headerDom) === null || _a === void 0 ? void 0 : _a.current) === null || _b === void 0 ? void 0 : _b.parentElement;
|
|
279
|
+
setTimeout(function () {
|
|
280
|
+
while (parent_1 &&
|
|
281
|
+
window.getComputedStyle(parent_1, null).getPropertyValue('overflow') !==
|
|
282
|
+
'auto') {
|
|
283
|
+
parent_1 = parent_1.parentElement;
|
|
284
|
+
}
|
|
285
|
+
if (parent_1 &&
|
|
286
|
+
window.getComputedStyle(parent_1, null).getPropertyValue('overflow') ===
|
|
287
|
+
'auto') {
|
|
288
|
+
var paddingTop = window
|
|
289
|
+
.getComputedStyle(parent_1, null)
|
|
290
|
+
.getPropertyValue('padding-top');
|
|
291
|
+
if (paddingTop && _this.headerDom && _this.headerDom.current) {
|
|
292
|
+
_this.headerDom.current.style.top = '-' + paddingTop;
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
});
|
|
296
|
+
}
|
|
297
|
+
};
|
|
298
|
+
Table.prototype.renderColGroup = function (showReal) {
|
|
299
|
+
var _a = this.props, scroll = _a.scroll, tableLayout = _a.tableLayout, columns = _a.columns, rowSelection = _a.rowSelection, expandable = _a.expandable, draggable = _a.draggable;
|
|
300
|
+
var isFixed = !!((scroll && scroll.x) || tableLayout === 'fixed');
|
|
301
|
+
return (React__default.createElement(ColGroup, { columns: columns, colWidths: this.state.colWidths, isFixed: isFixed, syncTableWidth: this.syncTableWidth, initTableWidth: this.initTableWidth, selectable: !!rowSelection, expandable: !!expandable, draggable: !!draggable, rowSelectionColumnWidth: (rowSelection === null || rowSelection === void 0 ? void 0 : rowSelection.columnWidth) || DefaultCellWidth, expandableColumnWidth: (expandable === null || expandable === void 0 ? void 0 : expandable.columnWidth) || DefaultCellWidth, isRightExpandable: this.isRightExpandable(), isLeftExpandable: this.isLeftExpandable(), showReal: showReal }));
|
|
302
|
+
};
|
|
303
|
+
Table.prototype.onResizeMouseDown = function (event, index) {
|
|
304
|
+
// 点击记录起始坐标
|
|
305
|
+
this.resizeStart = event.clientX;
|
|
306
|
+
this.resizeTarget = event.currentTarget;
|
|
307
|
+
var column = this.tdColumns[index];
|
|
308
|
+
this.resizeIndex = index;
|
|
309
|
+
var colWidth = this.state.colWidths[column.name];
|
|
310
|
+
this.resizeWidth = colWidth.width || colWidth.realWidth;
|
|
311
|
+
this.resizeTarget.classList.add('is-resizing');
|
|
312
|
+
document.addEventListener('mousemove', this.onResizeMouseMove);
|
|
313
|
+
document.addEventListener('mouseup', this.onResizeMouseUp);
|
|
314
|
+
event && event.stopPropagation();
|
|
315
|
+
};
|
|
316
|
+
Table.prototype.onResizeMouseMove = function (event) {
|
|
317
|
+
// 点击了调整列宽
|
|
318
|
+
if (this.resizeTarget) {
|
|
319
|
+
// 计算横向移动距离
|
|
320
|
+
var distance = event.clientX - this.resizeStart;
|
|
321
|
+
var column = this.tdColumns[this.resizeIndex];
|
|
322
|
+
var newWidth = 0;
|
|
323
|
+
if (distance > 0) {
|
|
324
|
+
newWidth = this.resizeWidth + distance;
|
|
325
|
+
}
|
|
326
|
+
else {
|
|
327
|
+
// 缩短列
|
|
328
|
+
newWidth = Math.max(this.resizeWidth + distance, DefaultCellWidth, column.minWidth || 0);
|
|
329
|
+
}
|
|
330
|
+
var colWidths = this.state.colWidths;
|
|
331
|
+
colWidths[column.name].width = newWidth;
|
|
332
|
+
this.setState({ colWidths: __assign({}, colWidths) });
|
|
333
|
+
}
|
|
334
|
+
event && event.stopPropagation();
|
|
335
|
+
};
|
|
336
|
+
Table.prototype.onResizeMouseUp = function (event) {
|
|
337
|
+
this.resizeTarget.classList.remove('is-resizing');
|
|
338
|
+
document.removeEventListener('mousemove', this.onResizeMouseMove);
|
|
339
|
+
document.removeEventListener('mouseup', this.onResizeMouseUp);
|
|
340
|
+
this.resizeStart = -1;
|
|
341
|
+
this.resizeWidth = 0;
|
|
342
|
+
delete this.resizeTarget;
|
|
343
|
+
};
|
|
344
|
+
Table.prototype.renderHead = function () {
|
|
345
|
+
var _this = this;
|
|
346
|
+
var _a;
|
|
347
|
+
var _b = this.props, columns = _b.columns, cx = _b.classnames, classPrefix = _b.classPrefix, expandable = _b.expandable, rowSelection = _b.rowSelection, draggable = _b.draggable, resizable = _b.resizable, dataSource = _b.dataSource, onSort = _b.onSort, onSelectAll = _b.onSelectAll, onFilter = _b.onFilter, testIdBuilder = _b.testIdBuilder, headerClassName = _b.headerClassName, sticky = _b.sticky, autoFillHeight = _b.autoFillHeight, scroll = _b.scroll;
|
|
348
|
+
var rowSelectionKeyField = this.getRowSelectionKeyField();
|
|
349
|
+
var dataList = rowSelection && rowSelection.getCheckboxProps
|
|
350
|
+
? filterTree(dataSource, function (data, index, level) {
|
|
351
|
+
var props = rowSelection.getCheckboxProps(data, index);
|
|
352
|
+
return !props.disabled;
|
|
353
|
+
})
|
|
354
|
+
: dataSource;
|
|
355
|
+
var hasScrollY = scroll && scroll.y;
|
|
356
|
+
var selfSticky = !!(hasScrollY || (sticky && autoFillHeight));
|
|
357
|
+
return (React__default.createElement(Head, { key: "thead", selfSticky: selfSticky, columns: columns, draggable: !!draggable, selectable: !!rowSelection, rowSelectionFixed: !!(rowSelection === null || rowSelection === void 0 ? void 0 : rowSelection.fixed), rowSelectionType: rowSelection === null || rowSelection === void 0 ? void 0 : rowSelection.type, selections: rowSelection === null || rowSelection === void 0 ? void 0 : rowSelection.selections, rowSelectionKeyField: rowSelectionKeyField, maxSelectedLength: rowSelection === null || rowSelection === void 0 ? void 0 : rowSelection.maxSelectedLength, isExpandable: this.isExpandableTable(), isRightExpandable: this.isRightExpandable(), isLeftExpandable: this.isLeftExpandable(), selectedRowKeys: this.state.selectedRowKeys, dataSource: dataList, resizable: resizable, expandable: !!expandable, expandableFixed: expandable === null || expandable === void 0 ? void 0 : expandable.fixed, childrenColumnName: this.getChildrenColumnName(), orderBy: (_a = this.state.sort) === null || _a === void 0 ? void 0 : _a.orderBy, popOverContainer: this.getPopOverContainer, classnames: cx, className: headerClassName, classPrefix: classPrefix, onSort: function (payload, column) {
|
|
358
|
+
_this.setState({
|
|
359
|
+
sort: payload
|
|
360
|
+
});
|
|
361
|
+
onSort && onSort(payload);
|
|
362
|
+
}, onSelectAll: function (value, selectedRowKeys, selectedRows, restSelectedKeys) { return __awaiter(_this, void 0, void 0, function () {
|
|
363
|
+
var prevented, keys;
|
|
364
|
+
return __generator(this, function (_a) {
|
|
365
|
+
switch (_a.label) {
|
|
366
|
+
case 0:
|
|
367
|
+
if (!onSelectAll) return [3 /*break*/, 2];
|
|
368
|
+
return [4 /*yield*/, onSelectAll(selectedRows, value ? selectedRowKeys : [], value ? [] : selectedRows)];
|
|
369
|
+
case 1:
|
|
370
|
+
prevented = _a.sent();
|
|
371
|
+
if (prevented) {
|
|
372
|
+
return [2 /*return*/];
|
|
373
|
+
}
|
|
374
|
+
_a.label = 2;
|
|
375
|
+
case 2:
|
|
376
|
+
keys = __spreadArray(__spreadArray([], __read(selectedRowKeys), false), __read(restSelectedKeys // 更新数据要把非当前页的数据也加上
|
|
377
|
+
), false);
|
|
378
|
+
if (!isEqual(keys, this.state.selectedRowKeys)) {
|
|
379
|
+
this.setState({ selectedRowKeys: keys });
|
|
380
|
+
}
|
|
381
|
+
return [2 /*return*/];
|
|
382
|
+
}
|
|
383
|
+
});
|
|
384
|
+
}); }, onFilter: onFilter, onResizeMouseDown: this.onResizeMouseDown.bind(this), testIdBuilder: testIdBuilder === null || testIdBuilder === void 0 ? void 0 : testIdBuilder.getChild('head') }));
|
|
385
|
+
};
|
|
386
|
+
Table.prototype.onRowClick = function (event, record, rowIndex) {
|
|
387
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
388
|
+
var _a, rowSelection, onRow, prevented, defaultKey_1, isSelected;
|
|
389
|
+
return __generator(this, function (_b) {
|
|
390
|
+
switch (_b.label) {
|
|
391
|
+
case 0:
|
|
392
|
+
_a = this.props, rowSelection = _a.rowSelection, onRow = _a.onRow;
|
|
393
|
+
if (!(onRow && onRow.onRowClick)) return [3 /*break*/, 2];
|
|
394
|
+
return [4 /*yield*/, onRow.onRowClick(event, record, rowIndex)];
|
|
395
|
+
case 1:
|
|
396
|
+
prevented = _b.sent();
|
|
397
|
+
if (prevented) {
|
|
398
|
+
return [2 /*return*/];
|
|
399
|
+
}
|
|
400
|
+
_b.label = 2;
|
|
401
|
+
case 2:
|
|
402
|
+
if (rowSelection && rowSelection.type && rowSelection.rowClick) {
|
|
403
|
+
defaultKey_1 = this.getRowSelectionKeyField();
|
|
404
|
+
isSelected = !!find(this.state.selectedRowKeys, function (key) { return key === record[defaultKey_1]; });
|
|
405
|
+
this.selectedSingleRow(!isSelected, record);
|
|
406
|
+
}
|
|
407
|
+
return [2 /*return*/];
|
|
408
|
+
}
|
|
409
|
+
});
|
|
410
|
+
});
|
|
411
|
+
};
|
|
412
|
+
Table.prototype.onRowDbClick = function (event, record, rowIndex) {
|
|
413
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
414
|
+
var onRow, prevented;
|
|
415
|
+
return __generator(this, function (_a) {
|
|
416
|
+
switch (_a.label) {
|
|
417
|
+
case 0:
|
|
418
|
+
onRow = this.props.onRow;
|
|
419
|
+
if (!(onRow && onRow.onRowDbClick)) return [3 /*break*/, 2];
|
|
420
|
+
return [4 /*yield*/, onRow.onRowDbClick(event, record, rowIndex)];
|
|
421
|
+
case 1:
|
|
422
|
+
prevented = _a.sent();
|
|
423
|
+
if (prevented === false) {
|
|
424
|
+
return [2 /*return*/];
|
|
425
|
+
}
|
|
426
|
+
_a.label = 2;
|
|
427
|
+
case 2: return [2 /*return*/];
|
|
428
|
+
}
|
|
429
|
+
});
|
|
430
|
+
});
|
|
431
|
+
};
|
|
432
|
+
Table.prototype.onRowMouseEnter = function (event, record, rowIndex) {
|
|
433
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
434
|
+
var _a, onRow, itemActions, prevented, target;
|
|
435
|
+
return __generator(this, function (_b) {
|
|
436
|
+
switch (_b.label) {
|
|
437
|
+
case 0:
|
|
438
|
+
_a = this.props, onRow = _a.onRow, itemActions = _a.itemActions;
|
|
439
|
+
if (!(onRow && onRow.onRowMouseEnter)) return [3 /*break*/, 2];
|
|
440
|
+
return [4 /*yield*/, onRow.onRowMouseEnter(event, record, rowIndex)];
|
|
441
|
+
case 1:
|
|
442
|
+
prevented = _b.sent();
|
|
443
|
+
if (prevented) {
|
|
444
|
+
return [2 /*return*/];
|
|
445
|
+
}
|
|
446
|
+
_b.label = 2;
|
|
447
|
+
case 2:
|
|
448
|
+
if (record && itemActions) {
|
|
449
|
+
target = event.target;
|
|
450
|
+
if ((target === null || target === void 0 ? void 0 : target.tagName) !== 'TR') {
|
|
451
|
+
target = target === null || target === void 0 ? void 0 : target.closest('tr');
|
|
452
|
+
}
|
|
453
|
+
this.setState({ hoverRow: { target: target, rowIndex: rowIndex, record: record } });
|
|
454
|
+
}
|
|
455
|
+
return [2 /*return*/];
|
|
456
|
+
}
|
|
457
|
+
});
|
|
458
|
+
});
|
|
459
|
+
};
|
|
460
|
+
Table.prototype.onRowMouseLeave = function (event, record, rowIndex) {
|
|
461
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
462
|
+
var onRow;
|
|
463
|
+
return __generator(this, function (_a) {
|
|
464
|
+
onRow = this.props.onRow;
|
|
465
|
+
onRow &&
|
|
466
|
+
onRow.onRowMouseLeave &&
|
|
467
|
+
onRow.onRowMouseLeave(event, record, rowIndex);
|
|
468
|
+
return [2 /*return*/];
|
|
469
|
+
});
|
|
470
|
+
});
|
|
471
|
+
};
|
|
472
|
+
Table.prototype.onMouseLeave = function () {
|
|
473
|
+
var itemActions = this.props.itemActions;
|
|
474
|
+
itemActions && this.setState({ hoverRow: null });
|
|
475
|
+
};
|
|
476
|
+
Table.prototype.onExpandRows = function (data) {
|
|
477
|
+
var _this = this;
|
|
478
|
+
var expandedRowKeys = this.state.expandedRowKeys;
|
|
479
|
+
var expandable = this.props.expandable;
|
|
480
|
+
var keys = data.map(function (d) { return d[_this.getExpandableKeyField()]; });
|
|
481
|
+
this.setState({ expandedRowKeys: __spreadArray(__spreadArray([], __read(expandedRowKeys), false), __read(keys), false) });
|
|
482
|
+
(expandable === null || expandable === void 0 ? void 0 : expandable.onExpand) && (expandable === null || expandable === void 0 ? void 0 : expandable.onExpand(true, data));
|
|
483
|
+
};
|
|
484
|
+
Table.prototype.onCollapseRows = function (data) {
|
|
485
|
+
var _this = this;
|
|
486
|
+
var expandedRowKeys = this.state.expandedRowKeys;
|
|
487
|
+
var expandable = this.props.expandable;
|
|
488
|
+
var keys = data.map(function (d) { return d[_this.getExpandableKeyField()]; });
|
|
489
|
+
this.setState({
|
|
490
|
+
expandedRowKeys: expandedRowKeys.filter(function (k) { return !keys.find(function (v) { return v == k; }); } // 模糊匹配 否则'3'、3匹配不上
|
|
491
|
+
)
|
|
492
|
+
});
|
|
493
|
+
(expandable === null || expandable === void 0 ? void 0 : expandable.onExpand) && (expandable === null || expandable === void 0 ? void 0 : expandable.onExpand(true, data));
|
|
494
|
+
};
|
|
495
|
+
Table.prototype.getChildrenColumnName = function () {
|
|
496
|
+
var childrenColumnName = this.props.childrenColumnName;
|
|
497
|
+
return childrenColumnName || 'children';
|
|
498
|
+
};
|
|
499
|
+
Table.prototype.getRowSelectionKeyField = function () {
|
|
500
|
+
var _a = this.props, rowSelection = _a.rowSelection, keyField = _a.keyField;
|
|
501
|
+
return (rowSelection === null || rowSelection === void 0 ? void 0 : rowSelection.keyField) || keyField || 'key';
|
|
502
|
+
};
|
|
503
|
+
Table.prototype.getExpandableKeyField = function () {
|
|
504
|
+
var _a = this.props, expandable = _a.expandable, keyField = _a.keyField;
|
|
505
|
+
return (expandable === null || expandable === void 0 ? void 0 : expandable.keyField) || keyField || 'key';
|
|
506
|
+
};
|
|
507
|
+
Table.prototype.hasCheckedChildrenRows = function (data) {
|
|
508
|
+
var selectedRowKeys = this.state.selectedRowKeys;
|
|
509
|
+
var childrenColumnName = this.getChildrenColumnName();
|
|
510
|
+
var rowSelectionKeyField = this.getRowSelectionKeyField();
|
|
511
|
+
var childrenKeys = getDataChildrenKeys(data, childrenColumnName, rowSelectionKeyField);
|
|
512
|
+
var length = intersection(selectedRowKeys, childrenKeys).length;
|
|
513
|
+
return length > 0;
|
|
514
|
+
};
|
|
515
|
+
Table.prototype.getSelectedRowKeys = function (isSelected, data) {
|
|
516
|
+
var rowSelection = this.props.rowSelection;
|
|
517
|
+
var rowSelectionKeyField = this.getRowSelectionKeyField();
|
|
518
|
+
var childrenColumnName = this.getChildrenColumnName();
|
|
519
|
+
var isRadio = rowSelection && rowSelection.type === 'radio';
|
|
520
|
+
var selected = [];
|
|
521
|
+
if (isSelected) {
|
|
522
|
+
if (isRadio) {
|
|
523
|
+
selected = [data[rowSelectionKeyField]];
|
|
524
|
+
}
|
|
525
|
+
else {
|
|
526
|
+
selected = __spreadArray(__spreadArray(__spreadArray([], __read(this.state.selectedRowKeys), false), [
|
|
527
|
+
data[rowSelectionKeyField]
|
|
528
|
+
], false), __read(getDataChildrenKeys(data, childrenColumnName, rowSelectionKeyField)), false).filter(function (key, i, a) { return a.indexOf(key) === i; });
|
|
529
|
+
}
|
|
530
|
+
}
|
|
531
|
+
else {
|
|
532
|
+
if (!isRadio) {
|
|
533
|
+
selected = this.state.selectedRowKeys.filter(function (key) {
|
|
534
|
+
return !__spreadArray([
|
|
535
|
+
data[rowSelectionKeyField]
|
|
536
|
+
], __read(getDataChildrenKeys(data, childrenColumnName, rowSelectionKeyField)), false).includes(key);
|
|
537
|
+
});
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
return selected;
|
|
541
|
+
};
|
|
542
|
+
Table.prototype.selectedSingleRow = function (value, data) {
|
|
543
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
544
|
+
var _a, onSelect, dataSource, selectedRowKeys, rowSelectionKeyField, childrenColumnName, selectedResult, prevented;
|
|
545
|
+
return __generator(this, function (_b) {
|
|
546
|
+
switch (_b.label) {
|
|
547
|
+
case 0:
|
|
548
|
+
_a = this.props, onSelect = _a.onSelect, dataSource = _a.dataSource;
|
|
549
|
+
selectedRowKeys = this.getSelectedRowKeys(value, data);
|
|
550
|
+
if (!onSelect) return [3 /*break*/, 2];
|
|
551
|
+
rowSelectionKeyField = this.getRowSelectionKeyField();
|
|
552
|
+
childrenColumnName = this.getChildrenColumnName();
|
|
553
|
+
selectedResult = getRowsByKeys(dataSource, selectedRowKeys, rowSelectionKeyField, childrenColumnName);
|
|
554
|
+
return [4 /*yield*/, onSelect(selectedResult.selectedRows, selectedRowKeys, selectedResult.unSelectedRows)];
|
|
555
|
+
case 1:
|
|
556
|
+
prevented = _b.sent();
|
|
557
|
+
if (prevented) {
|
|
558
|
+
return [2 /*return*/];
|
|
559
|
+
}
|
|
560
|
+
_b.label = 2;
|
|
561
|
+
case 2:
|
|
562
|
+
if (!isEqual(this.state.selectedRowKeys, selectedRowKeys)) {
|
|
563
|
+
this.setState({ selectedRowKeys: selectedRowKeys });
|
|
564
|
+
}
|
|
565
|
+
return [2 /*return*/];
|
|
566
|
+
}
|
|
567
|
+
});
|
|
568
|
+
});
|
|
569
|
+
};
|
|
570
|
+
// 展开和嵌套不能共存
|
|
571
|
+
Table.prototype.isExpandableRow = function (data, rowIndex) {
|
|
572
|
+
var expandable = this.props.expandable;
|
|
573
|
+
return (expandable &&
|
|
574
|
+
(!expandable.rowExpandable ||
|
|
575
|
+
(expandable.rowExpandable && expandable.rowExpandable(data, rowIndex))));
|
|
576
|
+
};
|
|
577
|
+
Table.prototype.isExpanded = function (record) {
|
|
578
|
+
var expandableKeyField = this.getExpandableKeyField();
|
|
579
|
+
return !!find(this.state.expandedRowKeys, function (key) { return key == record[expandableKeyField]; }); // == 匹配 否则'3'、3匹配不上
|
|
580
|
+
};
|
|
581
|
+
Table.prototype.renderRow = function (data, rowIndex, levels) {
|
|
582
|
+
var _this = this;
|
|
583
|
+
var _a = this.props, rowSelection = _a.rowSelection, expandable = _a.expandable, indentSize = _a.indentSize, lineHeight = _a.lineHeight, draggable = _a.draggable, rowClassName = _a.rowClassName, keyField = _a.keyField, columns = _a.columns, lazyRenderAfter = _a.lazyRenderAfter, classPrefix = _a.classPrefix, cx = _a.classnames, testIdBuilder = _a.testIdBuilder;
|
|
584
|
+
var rowSelectionKeyField = this.getRowSelectionKeyField();
|
|
585
|
+
var isChecked = !!find(this.state.selectedRowKeys, function (key) { return key === data[rowSelectionKeyField]; });
|
|
586
|
+
var rowTIDBuilder = testIdBuilder === null || testIdBuilder === void 0 ? void 0 : testIdBuilder.getChild("row-".concat(rowIndex));
|
|
587
|
+
var childrenColumnName = this.getChildrenColumnName();
|
|
588
|
+
// 当前行是否可展开
|
|
589
|
+
var isExpandableRow = this.isExpandableRow(data, rowIndex);
|
|
590
|
+
var hasChildrenRow = checkChildrenRow(data, childrenColumnName);
|
|
591
|
+
var hasChildrenChecked = !!rowSelection && hasChildrenRow && this.hasCheckedChildrenRows(data);
|
|
592
|
+
var expandedRowClassName = expandable &&
|
|
593
|
+
expandable.expandedRowClassName &&
|
|
594
|
+
typeof expandable.expandedRowClassName === 'function'
|
|
595
|
+
? expandable.expandedRowClassName(data, rowIndex)
|
|
596
|
+
: '';
|
|
597
|
+
var isExpanded = this.isExpanded(data);
|
|
598
|
+
var checkboxProps = rowSelection && rowSelection.getCheckboxProps
|
|
599
|
+
? rowSelection.getCheckboxProps(data, rowIndex)
|
|
600
|
+
: {};
|
|
601
|
+
var children = !expandable && childrenColumnName && hasChildrenRow && isExpanded
|
|
602
|
+
? data[childrenColumnName].map(function (item, index) {
|
|
603
|
+
return _this.renderRow(item, index, __spreadArray(__spreadArray([], __read(levels), false), [rowIndex], false));
|
|
604
|
+
})
|
|
605
|
+
: null;
|
|
606
|
+
return [
|
|
607
|
+
React__default.createElement(LazyRow, __assign({ key: "row-".concat(rowIndex), data: data, rowIndex: rowIndex, levels: levels.join(','), columns: columns, selectable: !!rowSelection, rowSelectionFixed: !!(rowSelection === null || rowSelection === void 0 ? void 0 : rowSelection.fixed), rowSelectionType: (rowSelection === null || rowSelection === void 0 ? void 0 : rowSelection.type) || 'checkbox', rowClickIgControl: !!(rowSelection === null || rowSelection === void 0 ? void 0 : rowSelection.rowClickIgControl), expandable: !!expandable, expandableFixed: expandable === null || expandable === void 0 ? void 0 : expandable.fixed, expandedRowClassName: expandedRowClassName, expandedRowRender: expandable === null || expandable === void 0 ? void 0 : expandable.expandedRowRender, isExpanded: isExpanded, hasChildrenRow: hasChildrenRow, hasChildrenChecked: hasChildrenChecked, indentSize: indentSize, lineHeight: lineHeight, draggable: !!draggable, isExpandable: this.isExpandableTable(), isExpandableRow: isExpandableRow, colCount: this.getExtraColumnCount(), isRightExpandable: this.isRightExpandable(), isLeftExpandable: this.isLeftExpandable(), isChecked: isChecked, rowClassName: rowClassName, onExpand: this.onExpandRows, onCollapse: this.onCollapseRows, onMouseEnter: this.onRowMouseEnter, onMouseLeave: this.onRowMouseLeave, onClick: this.onRowClick, onDoubleClick: this.onRowDbClick, onChange: this.onRowChange, childrenColumnName: this.getChildrenColumnName(), keyField: keyField, lazyRenderAfter: lazyRenderAfter, classnames: cx, classPrefix: classPrefix, testIdBuilder: rowTIDBuilder }, checkboxProps)),
|
|
608
|
+
children
|
|
609
|
+
];
|
|
610
|
+
};
|
|
611
|
+
Table.prototype.onRowChange = function (value, record) {
|
|
612
|
+
var rowSelection = this.props.rowSelection;
|
|
613
|
+
if (!(rowSelection && rowSelection.rowClick)) {
|
|
614
|
+
this.selectedSingleRow(value, record);
|
|
615
|
+
}
|
|
616
|
+
};
|
|
617
|
+
Table.prototype.renderBody = function () {
|
|
618
|
+
var _this = this;
|
|
619
|
+
var _a = this.props, cx = _a.classnames, headSummary = _a.headSummary, scroll = _a.scroll, placeholder = _a.placeholder, sticky = _a.sticky, loading = _a.loading, loadingConfig = _a.loadingConfig, classPrefix = _a.classPrefix;
|
|
620
|
+
var tdColumns = this.tdColumns;
|
|
621
|
+
var hasScrollY = scroll && scroll.y;
|
|
622
|
+
var colCount = this.getExtraColumnCount();
|
|
623
|
+
var childrenColumnName = this.getChildrenColumnName();
|
|
624
|
+
var dataSource = getSortData(this.props.dataSource, tdColumns, childrenColumnName, this.state.sort);
|
|
625
|
+
return (React__default.createElement("tbody", { ref: this.tbodyDom, className: cx('Table-tbody') },
|
|
626
|
+
dataSource.map(function (data, index) { return _this.renderRow(data, index, []); }),
|
|
627
|
+
!hasScrollY && !sticky && headSummary
|
|
628
|
+
? this.renderSummaryRow(headSummary)
|
|
629
|
+
: null,
|
|
630
|
+
!!loading ? (React__default.createElement("tr", { className: cx('Table-row', 'Table-loading-row') },
|
|
631
|
+
React__default.createElement(BodyCell, { classnames: cx, classPrefix: classPrefix, colSpan: tdColumns.length + colCount },
|
|
632
|
+
React__default.createElement("div", { className: cx('Table-loading') }, typeof loading === 'boolean' ? (React__default.createElement(Spinner, { overlay: true, show: loading, loadingConfig: loadingConfig })) : React__default.isValidElement(loading) ? (loading) : null)))) : !dataSource.length ? (React__default.createElement("tr", { className: cx('Table-row', 'Table-empty-row') },
|
|
633
|
+
React__default.createElement(BodyCell, { classnames: cx, classPrefix: classPrefix, colSpan: tdColumns.length + colCount },
|
|
634
|
+
React__default.createElement("div", { className: cx('Table-empty') }, typeof placeholder === 'function'
|
|
635
|
+
? placeholder()
|
|
636
|
+
: placeholder)))) : null));
|
|
637
|
+
};
|
|
638
|
+
Table.prototype.isExpandableTable = function () {
|
|
639
|
+
var expandable = this.props.expandable;
|
|
640
|
+
// 设置了expandable 优先级更高
|
|
641
|
+
// 就不支持默认嵌套了
|
|
642
|
+
return !!expandable;
|
|
643
|
+
};
|
|
644
|
+
// 展开列放到右侧 会影响之前的一些合并的规则
|
|
645
|
+
Table.prototype.isRightExpandable = function () {
|
|
646
|
+
var expandable = this.props.expandable;
|
|
647
|
+
return expandable && expandable.position === 'right';
|
|
648
|
+
};
|
|
649
|
+
// 展开列放到左侧 还有一种情况是position为none 无展开按钮
|
|
650
|
+
Table.prototype.isLeftExpandable = function () {
|
|
651
|
+
var expandable = this.props.expandable;
|
|
652
|
+
return (expandable && (!expandable.position || expandable.position === 'left'));
|
|
653
|
+
};
|
|
654
|
+
// 计算自动增加的列数
|
|
655
|
+
// 选择、拖拽、展开
|
|
656
|
+
Table.prototype.getExtraColumnCount = function () {
|
|
657
|
+
var _a = this.props, draggable = _a.draggable, rowSelection = _a.rowSelection, expandable = _a.expandable;
|
|
658
|
+
var count = 0;
|
|
659
|
+
if (draggable) {
|
|
660
|
+
count++;
|
|
661
|
+
}
|
|
662
|
+
else {
|
|
663
|
+
if (this.isExpandableTable() && (expandable === null || expandable === void 0 ? void 0 : expandable.position) !== 'none') {
|
|
664
|
+
count++;
|
|
665
|
+
}
|
|
666
|
+
if (rowSelection) {
|
|
667
|
+
count++;
|
|
668
|
+
}
|
|
669
|
+
}
|
|
670
|
+
return count;
|
|
671
|
+
};
|
|
672
|
+
Table.prototype.renderSummaryRow = function (summary) {
|
|
673
|
+
var _a = this.props, cx = _a.classnames, classPrefix = _a.classPrefix, dataSource = _a.dataSource;
|
|
674
|
+
if (typeof summary === 'function') {
|
|
675
|
+
return summary(dataSource);
|
|
676
|
+
}
|
|
677
|
+
if (React__default.isValidElement(summary)) {
|
|
678
|
+
return summary;
|
|
679
|
+
}
|
|
680
|
+
return (React__default.createElement(SummaryRows, { summary: summary, colCount: this.getExtraColumnCount(), isRightExpandable: this.isRightExpandable(), classnames: cx, classPrefix: classPrefix, dataSource: dataSource, onMouseEnter: this.onRowMouseEnter, onMouseLeave: this.onRowMouseLeave }));
|
|
681
|
+
};
|
|
682
|
+
Table.prototype.renderFoot = function () {
|
|
683
|
+
var _a = this.props, cx = _a.classnames, footSummary = _a.footSummary;
|
|
684
|
+
return (React__default.createElement("tfoot", { className: cx('Table-summary') }, this.renderSummaryRow(footSummary)));
|
|
685
|
+
};
|
|
686
|
+
Table.prototype.updateTableDom = function (dom) {
|
|
687
|
+
var cx = this.props.classnames;
|
|
688
|
+
var scrollLeft = dom.scrollLeft, scrollWidth = dom.scrollWidth, offsetWidth = dom.offsetWidth;
|
|
689
|
+
var table = this.tableDom.current;
|
|
690
|
+
var leftCalss = cx('Table-ping-left');
|
|
691
|
+
if (scrollLeft > 0) {
|
|
692
|
+
table === null || table === void 0 ? void 0 : table.classList.add(leftCalss);
|
|
693
|
+
}
|
|
694
|
+
else {
|
|
695
|
+
table === null || table === void 0 ? void 0 : table.classList.remove(leftCalss);
|
|
696
|
+
}
|
|
697
|
+
var rightClass = cx('Table-ping-right');
|
|
698
|
+
if (scrollLeft + offsetWidth < scrollWidth) {
|
|
699
|
+
table === null || table === void 0 ? void 0 : table.classList.add(rightClass);
|
|
700
|
+
}
|
|
701
|
+
else {
|
|
702
|
+
table === null || table === void 0 ? void 0 : table.classList.remove(rightClass);
|
|
703
|
+
}
|
|
704
|
+
};
|
|
705
|
+
Table.prototype.onTableContentScroll = function (event) {
|
|
706
|
+
this.updateTableDom(event.target);
|
|
707
|
+
};
|
|
708
|
+
Table.prototype.onWheel = function (event) {
|
|
709
|
+
var _a = event, currentTarget = _a.currentTarget, deltaX = _a.deltaX;
|
|
710
|
+
if (deltaX) {
|
|
711
|
+
this.onTableScroll({
|
|
712
|
+
target: currentTarget,
|
|
713
|
+
scrollLeft: currentTarget.scrollLeft + deltaX
|
|
714
|
+
});
|
|
715
|
+
event.preventDefault();
|
|
716
|
+
}
|
|
717
|
+
};
|
|
718
|
+
Table.prototype.onTableScroll = function (event) {
|
|
719
|
+
var scrollDomRefs = [this.headerDom, this.contentDom, this.footDom];
|
|
720
|
+
var target = event.target, scrollLeft = event.scrollLeft;
|
|
721
|
+
scrollDomRefs.forEach(function (ref) {
|
|
722
|
+
var current = ref && ref.current;
|
|
723
|
+
if (current && current !== target) {
|
|
724
|
+
current.scrollLeft = scrollLeft || target.scrollLeft;
|
|
725
|
+
}
|
|
726
|
+
});
|
|
727
|
+
this.updateTableDom(target);
|
|
728
|
+
};
|
|
729
|
+
Table.prototype.renderTable = function () {
|
|
730
|
+
var _a = this.props, scroll = _a.scroll, footSummary = _a.footSummary, showHeader = _a.showHeader, itemActions = _a.itemActions, tableLayout = _a.tableLayout, cx = _a.classnames, bodyClassname = _a.bodyClassname;
|
|
731
|
+
var hasScrollX = scroll && scroll.x;
|
|
732
|
+
var hoverRow = this.state.hoverRow;
|
|
733
|
+
var tableStyle = hasScrollX
|
|
734
|
+
? { width: scroll.x + 'px', tableLayout: 'fixed' }
|
|
735
|
+
: {};
|
|
736
|
+
return (React__default.createElement("div", { ref: this.contentDom, className: cx('Table-content'), style: hasScrollX ? { overflow: 'auto hidden' } : {}, onMouseLeave: this.onMouseLeave, onScroll: this.onTableContentScroll.bind(this) },
|
|
737
|
+
itemActions && hoverRow ? (React__default.createElement(ItemActionsWrapper, { dom: hoverRow.target, classnames: cx }, typeof itemActions === 'function'
|
|
738
|
+
? itemActions(hoverRow.record, hoverRow.rowIndex)
|
|
739
|
+
: null)) : null,
|
|
740
|
+
React__default.createElement("table", { style: __assign(__assign({}, tableStyle), { tableLayout: tableLayout === 'fixed' ? 'fixed' : 'auto' }), className: cx('Table-table', bodyClassname) },
|
|
741
|
+
this.renderColGroup(),
|
|
742
|
+
showHeader ? this.renderHead() : null,
|
|
743
|
+
this.renderBody(),
|
|
744
|
+
footSummary ? this.renderFoot() : null)));
|
|
745
|
+
};
|
|
746
|
+
Table.prototype.renderScrollTableHeader = function () {
|
|
747
|
+
var _a;
|
|
748
|
+
var _b = this.props, scroll = _b.scroll, headSummary = _b.headSummary, sticky = _b.sticky, showHeader = _b.showHeader, cx = _b.classnames, headerClassName = _b.headerClassName;
|
|
749
|
+
var style = { overflow: 'hidden' };
|
|
750
|
+
if (!!sticky) {
|
|
751
|
+
Object.assign(style, { top: 0 });
|
|
752
|
+
}
|
|
753
|
+
var tableStyle = {};
|
|
754
|
+
if (scroll && (scroll.y || scroll.x)) {
|
|
755
|
+
Object.assign(tableStyle, {
|
|
756
|
+
width: scroll && scroll.x
|
|
757
|
+
? typeof scroll.x === 'number'
|
|
758
|
+
? scroll.x + 'px'
|
|
759
|
+
: scroll.x
|
|
760
|
+
: '100%'
|
|
761
|
+
});
|
|
762
|
+
}
|
|
763
|
+
return (React__default.createElement("div", { ref: this.headerDom, className: cx('Table-header', (_a = {},
|
|
764
|
+
_a[cx('Table-sticky-holder')] = !!sticky,
|
|
765
|
+
_a), headerClassName), style: style },
|
|
766
|
+
React__default.createElement("table", { className: cx('Table-table'), style: __assign(__assign({}, tableStyle), { tableLayout: 'fixed' }) },
|
|
767
|
+
this.renderColGroup(true),
|
|
768
|
+
showHeader ? this.renderHead() : null,
|
|
769
|
+
headSummary ? (React__default.createElement("tbody", null, this.renderSummaryRow(headSummary))) : null)));
|
|
770
|
+
};
|
|
771
|
+
Table.prototype.renderScrollTableBody = function () {
|
|
772
|
+
var _a = this.props, scroll = _a.scroll, itemActions = _a.itemActions, cx = _a.classnames, bodyClassname = _a.bodyClassname;
|
|
773
|
+
var style = {};
|
|
774
|
+
var tableStyle = {};
|
|
775
|
+
if (scroll && (scroll.y || scroll.x)) {
|
|
776
|
+
Object.assign(style, {
|
|
777
|
+
overflow: 'auto scroll',
|
|
778
|
+
maxHeight: scroll.y
|
|
779
|
+
});
|
|
780
|
+
Object.assign(tableStyle, {
|
|
781
|
+
width: scroll && scroll.x
|
|
782
|
+
? typeof scroll.x === 'number'
|
|
783
|
+
? scroll.x + 'px'
|
|
784
|
+
: scroll.x
|
|
785
|
+
: '100%'
|
|
786
|
+
});
|
|
787
|
+
}
|
|
788
|
+
var hoverRow = this.state.hoverRow;
|
|
789
|
+
return (React__default.createElement("div", { ref: this.contentDom, className: cx('Table-body'), style: style, onMouseLeave: this.onMouseLeave, onScroll: this.onTableScroll },
|
|
790
|
+
itemActions && hoverRow ? (React__default.createElement(ItemActionsWrapper, { dom: hoverRow.target, classnames: cx }, typeof itemActions === 'function'
|
|
791
|
+
? itemActions(hoverRow.record, hoverRow.rowIndex)
|
|
792
|
+
: null)) : null,
|
|
793
|
+
React__default.createElement("table", { className: cx('Table-table', bodyClassname), style: __assign(__assign({}, tableStyle), { tableLayout: 'fixed' }) },
|
|
794
|
+
this.renderColGroup(),
|
|
795
|
+
this.renderBody())));
|
|
796
|
+
};
|
|
797
|
+
Table.prototype.renderScrollTableFoot = function () {
|
|
798
|
+
var _a = this.props, scroll = _a.scroll, cx = _a.classnames;
|
|
799
|
+
return (React__default.createElement("div", { ref: this.footDom, className: cx('Table-summary'), style: { overflow: 'hidden' } },
|
|
800
|
+
React__default.createElement("table", { className: cx('Table-table'), style: { width: (scroll === null || scroll === void 0 ? void 0 : scroll.x) + 'px' || '100%', tableLayout: 'fixed' } }, this.renderFoot())));
|
|
801
|
+
};
|
|
802
|
+
Table.prototype.renderScrollTable = function () {
|
|
803
|
+
// todo 这个模式有个很大的问题就是依赖 tablelayout 的 fixed 模式,这就意味这列的宽度都得配置
|
|
804
|
+
var _a = this.props, footSummary = _a.footSummary, cx = _a.classnames;
|
|
805
|
+
return (React__default.createElement("div", { className: cx('Table-container'), ref: this.containerDom },
|
|
806
|
+
this.renderScrollTableHeader(),
|
|
807
|
+
this.renderScrollTableBody(),
|
|
808
|
+
footSummary ? this.renderScrollTableFoot() : null));
|
|
809
|
+
};
|
|
810
|
+
Table.prototype.syncTableWidth = function () {
|
|
811
|
+
var _this = this;
|
|
812
|
+
var tbodyDom = this.tbodyDom.current;
|
|
813
|
+
if (!tbodyDom) {
|
|
814
|
+
return;
|
|
815
|
+
}
|
|
816
|
+
var cols = [].slice.call(tbodyDom === null || tbodyDom === void 0 ? void 0 : tbodyDom.querySelectorAll(':scope>tr:last-child>td[data-col]'));
|
|
817
|
+
var colWidths = {};
|
|
818
|
+
cols.forEach(function (col) {
|
|
819
|
+
var index = parseInt(col.getAttribute('data-col'), 10);
|
|
820
|
+
var column = _this.tdColumns[index];
|
|
821
|
+
var item = _this.state.colWidths[column.name];
|
|
822
|
+
if (column) {
|
|
823
|
+
colWidths[column.name] = {
|
|
824
|
+
width: (item === null || item === void 0 ? void 0 : item.originWidth) !== (column === null || column === void 0 ? void 0 : column.width) ? column === null || column === void 0 ? void 0 : column.width : item === null || item === void 0 ? void 0 : item.width,
|
|
825
|
+
minWidth: column === null || column === void 0 ? void 0 : column.minWidth,
|
|
826
|
+
realWidth: col.offsetWidth,
|
|
827
|
+
originWidth: column === null || column === void 0 ? void 0 : column.width
|
|
828
|
+
};
|
|
829
|
+
}
|
|
830
|
+
});
|
|
831
|
+
if (!isEqual(colWidths, this.state.colWidths)) {
|
|
832
|
+
this.setState({ colWidths: colWidths });
|
|
833
|
+
}
|
|
834
|
+
};
|
|
835
|
+
Table.prototype.initTableWidth = function () {
|
|
836
|
+
var _this = this;
|
|
837
|
+
var tableWrapperDom = this.contentDom.current;
|
|
838
|
+
if (!tableWrapperDom) {
|
|
839
|
+
return;
|
|
840
|
+
}
|
|
841
|
+
var _a = this.props, scroll = _a.scroll, tableLayout = _a.tableLayout;
|
|
842
|
+
var table = tableWrapperDom.querySelector('table');
|
|
843
|
+
var thead = tableWrapperDom.querySelector('thead');
|
|
844
|
+
if (!thead) {
|
|
845
|
+
if (this.headerDom.current) {
|
|
846
|
+
thead = this.headerDom.current.querySelector('thead');
|
|
847
|
+
}
|
|
848
|
+
}
|
|
849
|
+
var tableWidth = scroll && scroll.x ? scroll.x : tableWrapperDom.offsetWidth;
|
|
850
|
+
var tbody = null;
|
|
851
|
+
var htmls = [];
|
|
852
|
+
var isFixed = tableLayout === 'fixed' || (scroll && scroll.x);
|
|
853
|
+
var someSettedWidth = this.tdColumns.some(function (column) { return column.width; });
|
|
854
|
+
var minWidths = {};
|
|
855
|
+
// fixed 模式需要参考 auto 获得列最小宽度
|
|
856
|
+
if (isFixed) {
|
|
857
|
+
tbody = (table === null || table === void 0 ? void 0 : table.querySelector(':scope>tbody')) || null;
|
|
858
|
+
htmls.push("<table style=\"table-layout:auto!important;width:0!important;min-width:0!important;\" class=\"".concat(table === null || table === void 0 ? void 0 : table.className, "\">").concat(thead === null || thead === void 0 ? void 0 : thead.outerHTML, "</table>"));
|
|
859
|
+
}
|
|
860
|
+
if (someSettedWidth || isFixed) {
|
|
861
|
+
htmls.push("<table style=\"table-layout:auto!important;min-width:".concat(tableWidth, "px!important;width:").concat(tableWidth, "px!important;\" class=\"").concat(table === null || table === void 0 ? void 0 : table.className, "\">").concat(thead ? thead.outerHTML : '').concat(tbody ? "<tbody>".concat(tbody.innerHTML, "</tbody>") : '', "</table>"));
|
|
862
|
+
}
|
|
863
|
+
if (!htmls.length) {
|
|
864
|
+
return;
|
|
865
|
+
}
|
|
866
|
+
var div = document.createElement('div');
|
|
867
|
+
div.className = 'amis-scope'; // jssdk 里面 css 会在这一层
|
|
868
|
+
div.style.cssText += "visibility: hidden!important;";
|
|
869
|
+
div.innerHTML = htmls.join('');
|
|
870
|
+
var ths1 = [];
|
|
871
|
+
var ths2 = [];
|
|
872
|
+
if (isFixed) {
|
|
873
|
+
ths1 = [].slice.call(div.querySelectorAll(':scope>table:first-child>thead>tr>th[data-col]'));
|
|
874
|
+
}
|
|
875
|
+
if (someSettedWidth || isFixed) {
|
|
876
|
+
ths2 = [].slice.call(div.querySelectorAll(':scope>table:last-child>thead>tr>th[data-col]'));
|
|
877
|
+
}
|
|
878
|
+
ths1.forEach(function (th) {
|
|
879
|
+
th.style.cssText += 'width: 0';
|
|
880
|
+
});
|
|
881
|
+
ths2.forEach(function (th, index) {
|
|
882
|
+
var column = _this.tdColumns[index];
|
|
883
|
+
th.style.cssText += "".concat(typeof (column === null || column === void 0 ? void 0 : column.width) === 'number'
|
|
884
|
+
? "width: ".concat(column === null || column === void 0 ? void 0 : column.width, "px;")
|
|
885
|
+
: (column === null || column === void 0 ? void 0 : column.width)
|
|
886
|
+
? "width: ".concat(column === null || column === void 0 ? void 0 : column.width, ";")
|
|
887
|
+
: '');
|
|
888
|
+
});
|
|
889
|
+
document.body.appendChild(div);
|
|
890
|
+
var colWidths = {};
|
|
891
|
+
ths1.forEach(function (th) {
|
|
892
|
+
var index = parseInt(th.getAttribute('data-col'), 10);
|
|
893
|
+
var column = _this.tdColumns[index];
|
|
894
|
+
minWidths[index] = th.clientWidth;
|
|
895
|
+
if (colWidths[index]) {
|
|
896
|
+
colWidths[column === null || column === void 0 ? void 0 : column.name].minWidth = th.clientWidth;
|
|
897
|
+
}
|
|
898
|
+
else {
|
|
899
|
+
colWidths[column === null || column === void 0 ? void 0 : column.name] = { minWidth: th.clientWidth };
|
|
900
|
+
}
|
|
901
|
+
});
|
|
902
|
+
ths2.forEach(function (col) {
|
|
903
|
+
var index = parseInt(col.getAttribute('data-col'), 10);
|
|
904
|
+
var column = _this.tdColumns[index];
|
|
905
|
+
if (column && (column.width || isFixed)) {
|
|
906
|
+
var width = Math.max(typeof column.width === 'number' ? column.width : col.clientWidth, minWidths[index] || 0);
|
|
907
|
+
if (colWidths[column === null || column === void 0 ? void 0 : column.name]) {
|
|
908
|
+
colWidths[column === null || column === void 0 ? void 0 : column.name].width = width;
|
|
909
|
+
}
|
|
910
|
+
else {
|
|
911
|
+
colWidths[column === null || column === void 0 ? void 0 : column.name] = { width: width };
|
|
912
|
+
}
|
|
913
|
+
if (column.width) {
|
|
914
|
+
colWidths[column === null || column === void 0 ? void 0 : column.name].originWidth = column.width;
|
|
915
|
+
}
|
|
916
|
+
}
|
|
917
|
+
});
|
|
918
|
+
if (!isEqual(colWidths, this.state.colWidths)) {
|
|
919
|
+
this.setState({ colWidths: colWidths });
|
|
920
|
+
}
|
|
921
|
+
document.body.removeChild(div);
|
|
922
|
+
};
|
|
923
|
+
Table.prototype.updateTableInfo = function () {
|
|
924
|
+
if (this.resizeTarget) {
|
|
925
|
+
return;
|
|
926
|
+
}
|
|
927
|
+
this.syncTableWidth();
|
|
928
|
+
this.initTableWidth();
|
|
929
|
+
};
|
|
930
|
+
Table.prototype.render = function () {
|
|
931
|
+
var _a, _b;
|
|
932
|
+
var _c = this.props, title = _c.title, footer = _c.footer, className = _c.className, scroll = _c.scroll, size = _c.size, bordered = _c.bordered, resizable = _c.resizable, columns = _c.columns, sticky = _c.sticky, autoFillHeight = _c.autoFillHeight, cx = _c.classnames;
|
|
933
|
+
var _d = getBuildColumns(columns), thColumns = _d.thColumns, tdColumns = _d.tdColumns;
|
|
934
|
+
this.thColumns = thColumns;
|
|
935
|
+
this.tdColumns = tdColumns;
|
|
936
|
+
// 是否设置了纵向滚动
|
|
937
|
+
var hasScrollY = scroll && scroll.y;
|
|
938
|
+
// 是否设置了横向滚动
|
|
939
|
+
var hasScrollX = scroll && scroll.x;
|
|
940
|
+
var style = {};
|
|
941
|
+
if (hasScrollY) {
|
|
942
|
+
Object.assign(style, {
|
|
943
|
+
overflow: 'auto scroll',
|
|
944
|
+
maxHeight: scroll.y
|
|
945
|
+
});
|
|
946
|
+
}
|
|
947
|
+
return (React__default.createElement("div", { ref: this.tableDom, className: cx('Table2', className, (_a = {},
|
|
948
|
+
_a[cx('Table-scroll-horizontal')] = hasScrollX,
|
|
949
|
+
_a[cx("Table-".concat(size))] = size,
|
|
950
|
+
_a[cx('Table-bordered')] = bordered,
|
|
951
|
+
_a[cx('Table-resizable')] = resizable,
|
|
952
|
+
_a)) },
|
|
953
|
+
title ? (React__default.createElement("div", { className: cx('Table-title') }, typeof title === 'function' ? title() : title)) : null,
|
|
954
|
+
hasScrollY && !autoFillHeight ? (this.renderScrollTable()) : (React__default.createElement("div", { className: cx('Table-container', (_b = {},
|
|
955
|
+
_b[cx('Table-container-self-sticky')] = hasScrollY || (sticky && autoFillHeight),
|
|
956
|
+
_b)), style: style, ref: this.containerDom }, this.renderTable())),
|
|
957
|
+
footer ? (React__default.createElement("div", { className: cx('Table-footer') }, typeof footer === 'function' ? footer() : footer)) : null));
|
|
958
|
+
};
|
|
959
|
+
Table.defaultProps = {
|
|
960
|
+
title: '',
|
|
961
|
+
className: '',
|
|
962
|
+
dataSource: [],
|
|
963
|
+
columns: [],
|
|
964
|
+
indentSize: 15,
|
|
965
|
+
placeholder: '暂无数据',
|
|
966
|
+
showHeader: true,
|
|
967
|
+
tableLayout: 'auto'
|
|
968
|
+
};
|
|
969
|
+
__decorate([
|
|
970
|
+
autobind,
|
|
971
|
+
__metadata("design:type", Function),
|
|
972
|
+
__metadata("design:paramtypes", []),
|
|
973
|
+
__metadata("design:returntype", void 0)
|
|
974
|
+
], Table.prototype, "getPopOverContainer", null);
|
|
975
|
+
__decorate([
|
|
976
|
+
autobind,
|
|
977
|
+
__metadata("design:type", Function),
|
|
978
|
+
__metadata("design:paramtypes", []),
|
|
979
|
+
__metadata("design:returntype", void 0)
|
|
980
|
+
], Table.prototype, "updateAutoFillHeight", null);
|
|
981
|
+
__decorate([
|
|
982
|
+
autobind,
|
|
983
|
+
__metadata("design:type", Function),
|
|
984
|
+
__metadata("design:paramtypes", [Object]),
|
|
985
|
+
__metadata("design:returntype", void 0)
|
|
986
|
+
], Table.prototype, "onResizeMouseMove", null);
|
|
987
|
+
__decorate([
|
|
988
|
+
autobind,
|
|
989
|
+
__metadata("design:type", Function),
|
|
990
|
+
__metadata("design:paramtypes", [MouseEvent]),
|
|
991
|
+
__metadata("design:returntype", void 0)
|
|
992
|
+
], Table.prototype, "onResizeMouseUp", null);
|
|
993
|
+
__decorate([
|
|
994
|
+
autobind,
|
|
995
|
+
__metadata("design:type", Function),
|
|
996
|
+
__metadata("design:paramtypes", [Object, Object, Number]),
|
|
997
|
+
__metadata("design:returntype", Promise)
|
|
998
|
+
], Table.prototype, "onRowClick", null);
|
|
999
|
+
__decorate([
|
|
1000
|
+
autobind,
|
|
1001
|
+
__metadata("design:type", Function),
|
|
1002
|
+
__metadata("design:paramtypes", [Object, Object, Number]),
|
|
1003
|
+
__metadata("design:returntype", Promise)
|
|
1004
|
+
], Table.prototype, "onRowDbClick", null);
|
|
1005
|
+
__decorate([
|
|
1006
|
+
autobind,
|
|
1007
|
+
__metadata("design:type", Function),
|
|
1008
|
+
__metadata("design:paramtypes", [Object, Object, Number]),
|
|
1009
|
+
__metadata("design:returntype", Promise)
|
|
1010
|
+
], Table.prototype, "onRowMouseEnter", null);
|
|
1011
|
+
__decorate([
|
|
1012
|
+
autobind,
|
|
1013
|
+
__metadata("design:type", Function),
|
|
1014
|
+
__metadata("design:paramtypes", [Object, Object, Number]),
|
|
1015
|
+
__metadata("design:returntype", Promise)
|
|
1016
|
+
], Table.prototype, "onRowMouseLeave", null);
|
|
1017
|
+
__decorate([
|
|
1018
|
+
autobind,
|
|
1019
|
+
__metadata("design:type", Function),
|
|
1020
|
+
__metadata("design:paramtypes", []),
|
|
1021
|
+
__metadata("design:returntype", void 0)
|
|
1022
|
+
], Table.prototype, "onMouseLeave", null);
|
|
1023
|
+
__decorate([
|
|
1024
|
+
autobind,
|
|
1025
|
+
__metadata("design:type", Function),
|
|
1026
|
+
__metadata("design:paramtypes", [Array]),
|
|
1027
|
+
__metadata("design:returntype", void 0)
|
|
1028
|
+
], Table.prototype, "onExpandRows", null);
|
|
1029
|
+
__decorate([
|
|
1030
|
+
autobind,
|
|
1031
|
+
__metadata("design:type", Function),
|
|
1032
|
+
__metadata("design:paramtypes", [Array]),
|
|
1033
|
+
__metadata("design:returntype", void 0)
|
|
1034
|
+
], Table.prototype, "onCollapseRows", null);
|
|
1035
|
+
__decorate([
|
|
1036
|
+
autobind,
|
|
1037
|
+
__metadata("design:type", Function),
|
|
1038
|
+
__metadata("design:paramtypes", [Boolean, Object]),
|
|
1039
|
+
__metadata("design:returntype", void 0)
|
|
1040
|
+
], Table.prototype, "onRowChange", null);
|
|
1041
|
+
__decorate([
|
|
1042
|
+
autobind,
|
|
1043
|
+
__metadata("design:type", Function),
|
|
1044
|
+
__metadata("design:paramtypes", [Object]),
|
|
1045
|
+
__metadata("design:returntype", void 0)
|
|
1046
|
+
], Table.prototype, "onTableScroll", null);
|
|
1047
|
+
__decorate([
|
|
1048
|
+
autobind,
|
|
1049
|
+
__metadata("design:type", Function),
|
|
1050
|
+
__metadata("design:paramtypes", []),
|
|
1051
|
+
__metadata("design:returntype", void 0)
|
|
1052
|
+
], Table.prototype, "syncTableWidth", null);
|
|
1053
|
+
__decorate([
|
|
1054
|
+
autobind,
|
|
1055
|
+
__metadata("design:type", Function),
|
|
1056
|
+
__metadata("design:paramtypes", []),
|
|
1057
|
+
__metadata("design:returntype", void 0)
|
|
1058
|
+
], Table.prototype, "initTableWidth", null);
|
|
1059
|
+
__decorate([
|
|
1060
|
+
autobind,
|
|
1061
|
+
__metadata("design:type", Function),
|
|
1062
|
+
__metadata("design:paramtypes", []),
|
|
1063
|
+
__metadata("design:returntype", void 0)
|
|
1064
|
+
], Table.prototype, "updateTableInfo", null);
|
|
1065
|
+
return Table;
|
|
1066
|
+
}(React__default.PureComponent));
|
|
1067
|
+
var Table$1 = themeable(localeable(Table));
|
|
1068
|
+
|
|
1069
|
+
export { DefaultCellWidth, Table, Table$1 as default };
|