amis-ui 3.4.2 → 3.5.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.js +1 -1
- package/esm/components/Alert.d.ts +1 -0
- package/esm/components/Alert.js +4 -2
- package/esm/components/Alert2.js +1 -1
- package/esm/components/AnchorNav.js +1 -1
- package/esm/components/ArrayInput.js +1 -1
- package/esm/components/AsideNav.js +1 -1
- package/esm/components/AssociatedSelection.js +1 -1
- package/esm/components/Avatar.js +1 -1
- package/esm/components/Badge.js +1 -1
- package/esm/components/BaiduMapPicker.js +1 -1
- package/esm/components/BarCode.js +1 -1
- package/esm/components/Breadcrumb.js +1 -1
- package/esm/components/Button.js +1 -1
- package/esm/components/CalendarMobile.js +1 -1
- package/esm/components/Card.js +1 -1
- package/esm/components/Cascader.js +1 -1
- package/esm/components/ChainedDropdownSelection.js +1 -1
- package/esm/components/ChainedSelection.js +5 -3
- package/esm/components/Checkbox.js +1 -1
- package/esm/components/CityArea.js +1 -1
- package/esm/components/CityDB.js +1 -1
- package/esm/components/CodeMirror.js +1 -1
- package/esm/components/Collapse.js +2 -2
- package/esm/components/CollapseGroup.js +1 -1
- package/esm/components/ColorPicker.js +1 -1
- package/esm/components/Combo.js +1 -1
- package/esm/components/ConfirmBox.js +1 -1
- package/esm/components/ContextMenu.d.ts +1 -0
- package/esm/components/ContextMenu.js +4 -2
- package/esm/components/DatePicker.js +1 -1
- package/esm/components/DateRangePicker.js +1 -1
- package/esm/components/DndContainer.js +1 -1
- package/esm/components/Drawer.js +1 -1
- package/esm/components/DropDownSelection.js +3 -2
- package/esm/components/Editor.js +1 -1
- package/esm/components/Form.js +1 -1
- package/esm/components/FormField.js +1 -1
- package/esm/components/GaodeMapPicker.js +1 -1
- package/esm/components/GridNav.js +1 -1
- package/esm/components/GroupedSelection.js +7 -4
- package/esm/components/Html.js +1 -1
- package/esm/components/ImageGallery.d.ts +15 -3
- package/esm/components/ImageGallery.js +76 -10
- package/esm/components/Input.js +1 -1
- package/esm/components/InputBox.js +1 -1
- package/esm/components/InputBoxWithSuggestion.js +3 -2
- package/esm/components/InputTable.js +1 -1
- package/esm/components/Layout.js +1 -1
- package/esm/components/Link.js +1 -1
- package/esm/components/ListGroup.d.ts +10 -10
- package/esm/components/ListGroup.js +1 -1
- package/esm/components/ListMenu.js +1 -1
- package/esm/components/LocationPicker.js +1 -1
- package/esm/components/Markdown.js +1 -1
- package/esm/components/Modal.js +6 -11
- package/esm/components/ModalManager.js +1 -1
- package/esm/components/MultilineText.js +1 -1
- package/esm/components/NumberInput.js +1 -1
- package/esm/components/Pagination.d.ts +42 -41
- package/esm/components/Pagination.js +24 -8
- package/esm/components/Picker.js +1 -1
- package/esm/components/PickerColumn.js +1 -1
- package/esm/components/PickerContainer.js +1 -1
- package/esm/components/PopOverContainer.js +1 -1
- package/esm/components/PopUp.js +1 -1
- package/esm/components/Progress.js +1 -1
- package/esm/components/PullRefresh.js +1 -1
- package/esm/components/Radios.js +1 -1
- package/esm/components/Range.js +1 -1
- package/esm/components/Rating.js +1 -1
- package/esm/components/ResultBox.js +15 -13
- package/esm/components/ResultList.d.ts +2 -1
- package/esm/components/ResultList.js +12 -3
- package/esm/components/ResultTableList.js +1 -1
- package/esm/components/ResultTreeList.js +1 -1
- package/esm/components/RichText.js +1 -1
- package/esm/components/SearchBox.js +1 -1
- package/esm/components/Select.js +1 -1
- package/esm/components/SelectMobile.js +7 -4
- package/esm/components/Selection.d.ts +2 -1
- package/esm/components/Selection.js +11 -4
- package/esm/components/SparkLine.js +1 -1
- package/esm/components/Spinner.js +1 -1
- package/esm/components/Steps.js +8 -4
- package/esm/components/Switch.js +1 -1
- package/esm/components/TableSelection.js +1 -1
- package/esm/components/Tabs.js +1 -1
- package/esm/components/TabsTransfer.js +1 -1
- package/esm/components/TabsTransferPicker.js +1 -1
- package/esm/components/Tag.js +1 -1
- package/esm/components/Textarea.js +1 -1
- package/esm/components/Timeline.js +1 -1
- package/esm/components/TimelineItem.js +1 -1
- package/esm/components/Tinymce.js +1 -1
- package/esm/components/TitleBar.js +1 -1
- package/esm/components/Toast.js +1 -1
- package/esm/components/Tooltip.js +1 -1
- package/esm/components/TooltipWrapper.js +1 -1
- package/esm/components/Transfer.js +5 -5
- package/esm/components/TransferDropDown.js +1 -1
- package/esm/components/TransferPicker.js +1 -1
- package/esm/components/TransferSearch.js +1 -1
- package/esm/components/Tree.js +13 -8
- package/esm/components/TreeSelection.js +3 -2
- package/esm/components/UserSelect.js +1 -1
- package/esm/components/UserTabSelect.js +1 -1
- package/esm/components/WithRemoteConfig.js +1 -1
- package/esm/components/WithStore.js +1 -1
- package/esm/components/calendar/Calendar.js +1 -1
- package/esm/components/calendar/CalendarContainer.js +1 -1
- package/esm/components/calendar/DaysView.js +1 -1
- package/esm/components/calendar/MonthsView.js +1 -1
- package/esm/components/calendar/QuartersView.js +1 -1
- package/esm/components/calendar/TimeView.js +1 -1
- package/esm/components/calendar/YearsView.js +1 -1
- package/esm/components/condition-builder/Expression.js +1 -1
- package/esm/components/condition-builder/Field.js +1 -1
- package/esm/components/condition-builder/Func.js +1 -1
- package/esm/components/condition-builder/Group.js +1 -1
- package/esm/components/condition-builder/GroupOrItem.js +1 -1
- package/esm/components/condition-builder/InputSwitch.js +1 -1
- package/esm/components/condition-builder/Item.js +1 -1
- package/esm/components/condition-builder/Value.js +1 -1
- package/esm/components/condition-builder/config.js +1 -1
- package/esm/components/condition-builder/index.js +1 -1
- package/esm/components/formula/Editor.js +1 -1
- package/esm/components/formula/FuncList.js +1 -1
- package/esm/components/formula/Input.js +1 -1
- package/esm/components/formula/Picker.js +1 -1
- package/esm/components/formula/VariableList.js +7 -6
- package/esm/components/formula/plugin.js +1 -1
- package/esm/components/icons.js +17 -17
- package/esm/components/json-schema/Array.js +1 -1
- package/esm/components/json-schema/Item.js +1 -1
- package/esm/components/json-schema/Object.js +1 -1
- package/esm/components/json-schema/index.js +1 -1
- package/esm/components/menu/MenuContext.js +1 -1
- package/esm/components/menu/MenuItem.js +1 -1
- package/esm/components/menu/SubMenu.js +1 -1
- package/esm/components/menu/index.js +1 -1
- package/esm/components/schema-editor/Array.js +1 -1
- package/esm/components/schema-editor/Common.js +1 -1
- package/esm/components/schema-editor/Item.js +1 -1
- package/esm/components/schema-editor/Object.js +1 -1
- package/esm/components/schema-editor/SchemaVariableList.js +1 -1
- package/esm/components/schema-editor/SchemaVariableListPicker.js +1 -1
- package/esm/components/schema-editor/index.js +1 -1
- package/esm/components/table/Cell.js +3 -3
- package/esm/components/table/ColGroup.d.ts +19 -0
- package/esm/components/table/ColGroup.js +52 -0
- package/esm/components/table/HeadCellDropDown.js +1 -1
- package/esm/components/table/HeadCellFilter.js +1 -1
- package/esm/components/table/HeadCellSelect.js +1 -1
- package/esm/components/table/HeadCellSort.js +1 -1
- package/esm/components/table/ItemActionsWrapper.js +1 -1
- package/esm/components/table/index.d.ts +56 -3
- package/esm/components/table/index.js +149 -89
- package/esm/components/virtual-list/AutoSizer.js +1 -1
- package/esm/components/virtual-list/SizeAndPositionManager.js +1 -1
- package/esm/components/virtual-list/constants.js +1 -1
- package/esm/components/virtual-list/index.js +1 -1
- package/esm/hooks/use-set-state.js +1 -1
- package/esm/hooks/use-sub-form.js +1 -1
- package/esm/hooks/use-touch.js +1 -1
- package/esm/hooks/use-update-effect.js +1 -1
- package/esm/hooks/use-validation-resolver.js +1 -1
- package/esm/icons/alert-danger.svg.js +1 -1
- package/esm/icons/alert-info.svg.js +1 -1
- package/esm/icons/alert-success.svg.js +1 -1
- package/esm/icons/alert-warning.svg.js +1 -1
- package/esm/icons/back.svg.js +1 -1
- package/esm/icons/calendar.svg.js +1 -1
- package/esm/icons/caret.svg.js +1 -1
- package/esm/icons/check.svg.js +1 -1
- package/esm/icons/clock.svg.js +1 -1
- package/esm/icons/close-small.svg.js +1 -1
- package/esm/icons/close.svg.js +1 -1
- package/esm/icons/cloud-upload.svg.js +1 -1
- package/esm/icons/column-filter.svg.js +1 -1
- package/esm/icons/columns.svg.js +1 -1
- package/esm/icons/compress-alt.svg.js +1 -1
- package/esm/icons/copy.svg.js +1 -1
- package/esm/icons/date.svg.js +1 -1
- package/esm/icons/department.svg.js +1 -1
- package/esm/icons/desk-empty.svg.js +1 -1
- package/esm/icons/dot.svg.js +1 -1
- package/esm/icons/down-arrow-bold.svg.js +1 -1
- package/esm/icons/down.svg.js +1 -1
- package/esm/icons/download.svg.js +1 -1
- package/esm/icons/drag-bar.svg.js +1 -1
- package/esm/icons/drag.svg.js +1 -1
- package/esm/icons/edit.svg.js +1 -1
- package/esm/icons/ellipsis-v.svg.js +1 -1
- package/esm/icons/enter.svg.js +1 -1
- package/esm/icons/exchange.svg.js +1 -1
- package/esm/icons/expand-alt.svg.js +1 -1
- package/esm/icons/fail.svg.js +1 -1
- package/esm/icons/file.svg.js +1 -1
- package/esm/icons/filter.svg.js +1 -1
- package/esm/icons/folder.svg.js +1 -1
- package/esm/icons/function.svg.js +1 -1
- package/esm/icons/home.svg.js +1 -1
- package/esm/icons/if.svg.js +1 -1
- package/esm/icons/image.svg.js +1 -1
- package/esm/icons/info-circle.svg.js +1 -1
- package/esm/icons/info.svg.js +1 -1
- package/esm/icons/input-clear.svg.js +1 -1
- package/esm/icons/invisible.svg.js +1 -1
- package/esm/icons/left-arrow.svg.js +1 -1
- package/esm/icons/loading-outline.svg.js +1 -1
- package/esm/icons/location.svg.js +1 -1
- package/esm/icons/menu.svg.js +1 -1
- package/esm/icons/minus.svg.js +1 -1
- package/esm/icons/move.svg.js +1 -1
- package/esm/icons/mute.svg.js +1 -1
- package/esm/icons/new-edit.svg.js +1 -1
- package/esm/icons/pause.svg.js +1 -1
- package/esm/icons/pencil.svg.js +1 -1
- package/esm/icons/play.svg.js +1 -1
- package/esm/icons/plus-cicle.svg.js +1 -1
- package/esm/icons/plus-fine.svg.js +1 -1
- package/esm/icons/plus.svg.js +1 -1
- package/esm/icons/post.svg.js +1 -1
- package/esm/icons/question-mark.svg.js +1 -1
- package/esm/icons/question.svg.js +1 -1
- package/esm/icons/redo.svg.js +1 -1
- package/esm/icons/refresh.svg.js +1 -1
- package/esm/icons/reload.svg.js +1 -1
- package/esm/icons/remove.svg.js +1 -1
- package/esm/icons/retry.svg.js +1 -1
- package/esm/icons/right-arrow-bold.svg.js +1 -1
- package/esm/icons/right-arrow.svg.js +1 -1
- package/esm/icons/right-double-arrow.svg.js +1 -1
- package/esm/icons/role.svg.js +1 -1
- package/esm/icons/rotate-left.svg.js +1 -1
- package/esm/icons/rotate-right.svg.js +1 -1
- package/esm/icons/scale-origin.svg.js +1 -1
- package/esm/icons/schedule.svg.js +1 -1
- package/esm/icons/search.svg.js +1 -1
- package/esm/icons/setting.svg.js +1 -1
- package/esm/icons/slider-handle-icon.svg.js +1 -1
- package/esm/icons/sort-asc.svg.js +1 -1
- package/esm/icons/sort-default.svg.js +1 -1
- package/esm/icons/sort-desc.svg.js +1 -1
- package/esm/icons/star.svg.js +1 -1
- package/esm/icons/status-close.svg.js +1 -1
- package/esm/icons/steps-finsh.svg.js +1 -1
- package/esm/icons/success.svg.js +1 -1
- package/esm/icons/transparent.svg.js +1 -1
- package/esm/icons/trash.svg.js +1 -1
- package/esm/icons/tree-down.svg.js +1 -1
- package/esm/icons/undo.svg.js +1 -1
- package/esm/icons/upload.svg.js +1 -1
- package/esm/icons/user-remove.svg.js +1 -1
- package/esm/icons/view.svg.js +1 -1
- package/esm/icons/volume.svg.js +1 -1
- package/esm/icons/warning-mark.svg.js +1 -1
- package/esm/icons/warning.svg.js +1 -1
- package/esm/icons/window-restore.svg.js +1 -1
- package/esm/icons/zoom-in.svg.js +1 -1
- package/esm/icons/zoom-out.svg.js +1 -1
- package/esm/index.js +1 -1
- package/esm/locale/de-DE.js +2 -1
- package/esm/locale/en-US.js +2 -1
- package/esm/locale/zh-CN.js +2 -1
- package/esm/themes/ang.js +1 -1
- package/esm/themes/antd.js +1 -1
- package/esm/themes/cxd.js +1 -1
- package/esm/themes/dark.js +1 -1
- package/lib/components/404.js +1 -1
- package/lib/components/Alert.d.ts +121 -120
- package/lib/components/Alert.js +4 -2
- package/lib/components/Alert2.d.ts +20 -20
- package/lib/components/Alert2.js +1 -1
- package/lib/components/AnchorNav.d.ts +20 -20
- package/lib/components/AnchorNav.js +1 -1
- package/lib/components/ArrayInput.d.ts +40 -40
- package/lib/components/ArrayInput.js +1 -1
- package/lib/components/AsideNav.js +1 -1
- package/lib/components/AssociatedSelection.d.ts +80 -80
- package/lib/components/AssociatedSelection.js +1 -1
- package/lib/components/Avatar.d.ts +90 -90
- package/lib/components/Avatar.js +1 -1
- package/lib/components/Badge.js +1 -1
- package/lib/components/BaiduMapPicker.js +1 -1
- package/lib/components/BarCode.js +1 -1
- package/lib/components/Breadcrumb.js +1 -1
- package/lib/components/Button.d.ts +20 -20
- package/lib/components/Button.js +1 -1
- package/lib/components/CalendarMobile.d.ts +40 -40
- package/lib/components/CalendarMobile.js +1 -1
- package/lib/components/Card.d.ts +100 -100
- package/lib/components/Card.js +1 -1
- package/lib/components/Cascader.js +1 -1
- package/lib/components/ChainedDropdownSelection.d.ts +80 -80
- package/lib/components/ChainedDropdownSelection.js +1 -1
- package/lib/components/ChainedSelection.d.ts +80 -80
- package/lib/components/ChainedSelection.js +5 -3
- package/lib/components/Checkbox.d.ts +10 -10
- package/lib/components/Checkbox.js +1 -1
- package/lib/components/CityArea.js +1 -1
- package/lib/components/CityDB.js +1 -1
- package/lib/components/CodeMirror.js +1 -1
- package/lib/components/Collapse.d.ts +130 -130
- package/lib/components/Collapse.js +2 -2
- package/lib/components/CollapseGroup.d.ts +20 -20
- package/lib/components/CollapseGroup.js +1 -1
- package/lib/components/ColorPicker.d.ts +80 -80
- package/lib/components/ColorPicker.js +1 -1
- package/lib/components/Combo.js +1 -1
- package/lib/components/ConfirmBox.d.ts +80 -80
- package/lib/components/ConfirmBox.js +1 -1
- package/lib/components/ContextMenu.d.ts +1 -0
- package/lib/components/ContextMenu.js +4 -2
- package/lib/components/DatePicker.d.ts +81 -81
- package/lib/components/DatePicker.js +1 -1
- package/lib/components/DateRangePicker.d.ts +120 -120
- package/lib/components/DateRangePicker.js +1 -1
- package/lib/components/DndContainer.js +1 -1
- package/lib/components/Drawer.d.ts +40 -40
- package/lib/components/Drawer.js +1 -1
- package/lib/components/DropDownSelection.d.ts +80 -80
- package/lib/components/DropDownSelection.js +3 -2
- package/lib/components/Editor.d.ts +40 -40
- package/lib/components/Editor.js +1 -1
- package/lib/components/Form.js +1 -1
- package/lib/components/FormField.js +1 -1
- package/lib/components/GaodeMapPicker.js +1 -1
- package/lib/components/GridNav.js +1 -1
- package/lib/components/GroupedSelection.d.ts +80 -80
- package/lib/components/GroupedSelection.js +7 -4
- package/lib/components/Html.js +1 -1
- package/lib/components/ImageGallery.d.ts +55 -43
- package/lib/components/ImageGallery.js +76 -10
- package/lib/components/Input.js +1 -1
- package/lib/components/InputBox.d.ts +10 -10
- package/lib/components/InputBox.js +1 -1
- package/lib/components/InputBoxWithSuggestion.js +3 -2
- package/lib/components/InputTable.js +1 -1
- package/lib/components/Layout.d.ts +10 -10
- package/lib/components/Layout.js +1 -1
- package/lib/components/Link.js +1 -1
- package/lib/components/ListGroup.d.ts +10 -10
- package/lib/components/ListGroup.js +1 -1
- package/lib/components/ListMenu.d.ts +80 -80
- package/lib/components/ListMenu.js +1 -1
- package/lib/components/LocationPicker.d.ts +40 -40
- package/lib/components/LocationPicker.js +1 -1
- package/lib/components/Markdown.js +1 -1
- package/lib/components/Modal.d.ts +80 -80
- package/lib/components/Modal.js +6 -11
- package/lib/components/ModalManager.js +1 -1
- package/lib/components/MonthRangePicker.d.ts +120 -120
- package/lib/components/MultilineText.d.ts +40 -40
- package/lib/components/MultilineText.js +1 -1
- package/lib/components/NumberInput.d.ts +20 -20
- package/lib/components/NumberInput.js +1 -1
- package/lib/components/Pagination.d.ts +42 -41
- package/lib/components/Pagination.js +22 -6
- package/lib/components/Picker.js +1 -1
- package/lib/components/PickerColumn.js +1 -1
- package/lib/components/PickerContainer.js +1 -1
- package/lib/components/PopOverContainer.js +1 -1
- package/lib/components/PopUp.d.ts +80 -80
- package/lib/components/PopUp.js +1 -1
- package/lib/components/Progress.d.ts +50 -50
- package/lib/components/Progress.js +1 -1
- package/lib/components/PullRefresh.js +1 -1
- package/lib/components/Radios.d.ts +20 -20
- package/lib/components/Radios.js +1 -1
- package/lib/components/Range.js +1 -1
- package/lib/components/Rating.d.ts +20 -20
- package/lib/components/Rating.js +1 -1
- package/lib/components/ResultBox.d.ts +80 -80
- package/lib/components/ResultBox.js +15 -13
- package/lib/components/ResultList.d.ts +42 -41
- package/lib/components/ResultList.js +12 -3
- package/lib/components/ResultTableList.d.ts +80 -80
- package/lib/components/ResultTableList.js +1 -1
- package/lib/components/ResultTreeList.d.ts +40 -40
- package/lib/components/ResultTreeList.js +1 -1
- package/lib/components/RichText.js +1 -1
- package/lib/components/SearchBox.d.ts +80 -80
- package/lib/components/SearchBox.js +1 -1
- package/lib/components/Select.d.ts +1551 -1552
- package/lib/components/Select.js +1 -1
- package/lib/components/SelectMobile.js +7 -4
- package/lib/components/Selection.d.ts +82 -81
- package/lib/components/Selection.js +11 -4
- package/lib/components/SparkLine.d.ts +40 -40
- package/lib/components/SparkLine.js +1 -1
- package/lib/components/Spinner.d.ts +60 -60
- package/lib/components/Spinner.js +1 -1
- package/lib/components/Steps.js +8 -4
- package/lib/components/Switch.d.ts +10 -10
- package/lib/components/Switch.js +1 -1
- package/lib/components/TableSelection.d.ts +80 -80
- package/lib/components/TableSelection.js +1 -1
- package/lib/components/Tabs.d.ts +80 -80
- package/lib/components/Tabs.js +1 -1
- package/lib/components/TabsTransfer.d.ts +40 -40
- package/lib/components/TabsTransfer.js +1 -1
- package/lib/components/TabsTransferPicker.js +1 -1
- package/lib/components/Tag.d.ts +60 -60
- package/lib/components/Tag.js +1 -1
- package/lib/components/Textarea.d.ts +40 -40
- package/lib/components/Textarea.js +1 -1
- package/lib/components/Timeline.js +1 -1
- package/lib/components/TimelineItem.js +1 -1
- package/lib/components/Tinymce.js +1 -1
- package/lib/components/TitleBar.d.ts +10 -10
- package/lib/components/TitleBar.js +1 -1
- package/lib/components/Toast.d.ts +120 -120
- package/lib/components/Toast.js +1 -1
- package/lib/components/Tooltip.js +1 -1
- package/lib/components/TooltipWrapper.d.ts +30 -30
- package/lib/components/TooltipWrapper.js +1 -1
- package/lib/components/Transfer.d.ts +169 -169
- package/lib/components/Transfer.js +5 -5
- package/lib/components/TransferDropDown.d.ts +160 -160
- package/lib/components/TransferDropDown.js +1 -1
- package/lib/components/TransferPicker.js +1 -1
- package/lib/components/TransferSearch.js +1 -1
- package/lib/components/Tree.d.ts +200 -200
- package/lib/components/Tree.js +13 -8
- package/lib/components/TreeSelection.d.ts +80 -80
- package/lib/components/TreeSelection.js +3 -2
- package/lib/components/UserSelect.d.ts +40 -40
- package/lib/components/UserSelect.js +1 -1
- package/lib/components/UserTabSelect.d.ts +40 -40
- package/lib/components/UserTabSelect.js +1 -1
- package/lib/components/WithRemoteConfig.d.ts +0 -1
- package/lib/components/WithRemoteConfig.js +1 -1
- package/lib/components/WithStore.js +1 -1
- package/lib/components/calendar/Calendar.js +1 -1
- package/lib/components/calendar/CalendarContainer.js +1 -1
- package/lib/components/calendar/DaysView.js +1 -1
- package/lib/components/calendar/MonthsView.js +1 -1
- package/lib/components/calendar/QuartersView.js +1 -1
- package/lib/components/calendar/TimeView.js +1 -1
- package/lib/components/calendar/YearsView.js +1 -1
- package/lib/components/condition-builder/Expression.js +1 -1
- package/lib/components/condition-builder/Field.js +1 -1
- package/lib/components/condition-builder/Func.js +1 -1
- package/lib/components/condition-builder/Group.js +1 -1
- package/lib/components/condition-builder/GroupOrItem.js +1 -1
- package/lib/components/condition-builder/InputSwitch.js +1 -1
- package/lib/components/condition-builder/Item.js +1 -1
- package/lib/components/condition-builder/Value.js +1 -1
- package/lib/components/condition-builder/config.js +1 -1
- package/lib/components/condition-builder/index.js +1 -1
- package/lib/components/formula/Editor.d.ts +40 -40
- package/lib/components/formula/Editor.js +1 -1
- package/lib/components/formula/FuncList.js +1 -1
- package/lib/components/formula/Input.js +1 -1
- package/lib/components/formula/Picker.d.ts +40 -40
- package/lib/components/formula/Picker.js +1 -1
- package/lib/components/formula/VariableList.js +7 -6
- package/lib/components/formula/plugin.js +1 -1
- package/lib/components/icons.js +17 -17
- package/lib/components/json-schema/Array.js +1 -1
- package/lib/components/json-schema/Item.js +1 -1
- package/lib/components/json-schema/Object.js +1 -1
- package/lib/components/json-schema/index.js +1 -1
- package/lib/components/menu/MenuContext.js +1 -1
- package/lib/components/menu/MenuItem.js +1 -1
- package/lib/components/menu/SubMenu.js +1 -1
- package/lib/components/menu/index.d.ts +50 -50
- package/lib/components/menu/index.js +1 -1
- package/lib/components/schema-editor/Array.js +1 -1
- package/lib/components/schema-editor/Common.js +1 -1
- package/lib/components/schema-editor/Item.js +1 -1
- package/lib/components/schema-editor/Object.js +1 -1
- package/lib/components/schema-editor/SchemaVariableList.js +1 -1
- package/lib/components/schema-editor/SchemaVariableListPicker.js +1 -1
- package/lib/components/schema-editor/index.d.ts +200 -200
- package/lib/components/schema-editor/index.js +1 -1
- package/lib/components/table/Cell.d.ts +40 -40
- package/lib/components/table/Cell.js +3 -3
- package/lib/components/table/ColGroup.d.ts +19 -0
- package/lib/components/table/ColGroup.js +64 -0
- package/lib/components/table/HeadCellDropDown.js +1 -1
- package/lib/components/table/HeadCellFilter.d.ts +80 -80
- package/lib/components/table/HeadCellFilter.js +1 -1
- package/lib/components/table/HeadCellSelect.d.ts +40 -40
- package/lib/components/table/HeadCellSelect.js +1 -1
- package/lib/components/table/HeadCellSort.js +1 -1
- package/lib/components/table/ItemActionsWrapper.js +1 -1
- package/lib/components/table/index.d.ts +136 -83
- package/lib/components/table/index.js +149 -88
- package/lib/components/virtual-list/AutoSizer.js +1 -1
- package/lib/components/virtual-list/SizeAndPositionManager.js +1 -1
- package/lib/components/virtual-list/constants.js +1 -1
- package/lib/components/virtual-list/index.js +1 -1
- package/lib/hooks/use-set-state.js +1 -1
- package/lib/hooks/use-sub-form.js +1 -1
- package/lib/hooks/use-touch.js +1 -1
- package/lib/hooks/use-update-effect.js +1 -1
- package/lib/hooks/use-validation-resolver.js +1 -1
- package/lib/icons/alert-danger.svg.js +1 -1
- package/lib/icons/alert-info.svg.js +1 -1
- package/lib/icons/alert-success.svg.js +1 -1
- package/lib/icons/alert-warning.svg.js +1 -1
- package/lib/icons/back.svg.js +1 -1
- package/lib/icons/calendar.svg.js +1 -1
- package/lib/icons/caret.svg.js +1 -1
- package/lib/icons/check.svg.js +1 -1
- package/lib/icons/clock.svg.js +1 -1
- package/lib/icons/close-small.svg.js +1 -1
- package/lib/icons/close.svg.js +1 -1
- package/lib/icons/cloud-upload.svg.js +1 -1
- package/lib/icons/column-filter.svg.js +1 -1
- package/lib/icons/columns.svg.js +1 -1
- package/lib/icons/compress-alt.svg.js +1 -1
- package/lib/icons/copy.svg.js +1 -1
- package/lib/icons/date.svg.js +1 -1
- package/lib/icons/department.svg.js +1 -1
- package/lib/icons/desk-empty.svg.js +1 -1
- package/lib/icons/dot.svg.js +1 -1
- package/lib/icons/down-arrow-bold.svg.js +1 -1
- package/lib/icons/down.svg.js +1 -1
- package/lib/icons/download.svg.js +1 -1
- package/lib/icons/drag-bar.svg.js +1 -1
- package/lib/icons/drag.svg.js +1 -1
- package/lib/icons/edit.svg.js +1 -1
- package/lib/icons/ellipsis-v.svg.js +1 -1
- package/lib/icons/enter.svg.js +1 -1
- package/lib/icons/exchange.svg.js +1 -1
- package/lib/icons/expand-alt.svg.js +1 -1
- package/lib/icons/fail.svg.js +1 -1
- package/lib/icons/file.svg.js +1 -1
- package/lib/icons/filter.svg.js +1 -1
- package/lib/icons/folder.svg.js +1 -1
- package/lib/icons/function.svg.js +1 -1
- package/lib/icons/home.svg.js +1 -1
- package/lib/icons/if.svg.js +1 -1
- package/lib/icons/image.svg.js +1 -1
- package/lib/icons/info-circle.svg.js +1 -1
- package/lib/icons/info.svg.js +1 -1
- package/lib/icons/input-clear.svg.js +1 -1
- package/lib/icons/invisible.svg.js +1 -1
- package/lib/icons/left-arrow.svg.js +1 -1
- package/lib/icons/loading-outline.svg.js +1 -1
- package/lib/icons/location.svg.js +1 -1
- package/lib/icons/menu.svg.js +1 -1
- package/lib/icons/minus.svg.js +1 -1
- package/lib/icons/move.svg.js +1 -1
- package/lib/icons/mute.svg.js +1 -1
- package/lib/icons/new-edit.svg.js +1 -1
- package/lib/icons/pause.svg.js +1 -1
- package/lib/icons/pencil.svg.js +1 -1
- package/lib/icons/play.svg.js +1 -1
- package/lib/icons/plus-cicle.svg.js +1 -1
- package/lib/icons/plus-fine.svg.js +1 -1
- package/lib/icons/plus.svg.js +1 -1
- package/lib/icons/post.svg.js +1 -1
- package/lib/icons/question-mark.svg.js +1 -1
- package/lib/icons/question.svg.js +1 -1
- package/lib/icons/redo.svg.js +1 -1
- package/lib/icons/refresh.svg.js +1 -1
- package/lib/icons/reload.svg.js +1 -1
- package/lib/icons/remove.svg.js +1 -1
- package/lib/icons/retry.svg.js +1 -1
- package/lib/icons/right-arrow-bold.svg.js +1 -1
- package/lib/icons/right-arrow.svg.js +1 -1
- package/lib/icons/right-double-arrow.svg.js +1 -1
- package/lib/icons/role.svg.js +1 -1
- package/lib/icons/rotate-left.svg.js +1 -1
- package/lib/icons/rotate-right.svg.js +1 -1
- package/lib/icons/scale-origin.svg.js +1 -1
- package/lib/icons/schedule.svg.js +1 -1
- package/lib/icons/search.svg.js +1 -1
- package/lib/icons/setting.svg.js +1 -1
- package/lib/icons/slider-handle-icon.svg.js +1 -1
- package/lib/icons/sort-asc.svg.js +1 -1
- package/lib/icons/sort-default.svg.js +1 -1
- package/lib/icons/sort-desc.svg.js +1 -1
- package/lib/icons/star.svg.js +1 -1
- package/lib/icons/status-close.svg.js +1 -1
- package/lib/icons/steps-finsh.svg.js +1 -1
- package/lib/icons/success.svg.js +1 -1
- package/lib/icons/transparent.svg.js +1 -1
- package/lib/icons/trash.svg.js +1 -1
- package/lib/icons/tree-down.svg.js +1 -1
- package/lib/icons/undo.svg.js +1 -1
- package/lib/icons/upload.svg.js +1 -1
- package/lib/icons/user-remove.svg.js +1 -1
- package/lib/icons/view.svg.js +1 -1
- package/lib/icons/volume.svg.js +1 -1
- package/lib/icons/warning-mark.svg.js +1 -1
- package/lib/icons/warning.svg.js +1 -1
- package/lib/icons/window-restore.svg.js +1 -1
- package/lib/icons/zoom-in.svg.js +1 -1
- package/lib/icons/zoom-out.svg.js +1 -1
- package/lib/index.js +1 -1
- package/lib/locale/de-DE.js +2 -1
- package/lib/locale/en-US.js +2 -1
- package/lib/locale/zh-CN.js +2 -1
- package/lib/scss/helper.scss.js +1 -1
- package/lib/scss/themes/ang.scss.js +1 -1
- package/lib/scss/themes/antd.scss.js +1 -1
- package/lib/scss/themes/cxd.scss.js +1 -1
- package/lib/scss/themes/dark.scss.js +1 -1
- package/lib/scss/themes/default.scss.js +1 -1
- package/lib/themes/ang.css +264 -139
- package/lib/themes/ang.js +1 -1
- package/lib/themes/antd.css +264 -139
- package/lib/themes/antd.js +1 -1
- package/lib/themes/cxd.css +264 -139
- package/lib/themes/cxd.js +1 -1
- package/lib/themes/dark.css +264 -139
- package/lib/themes/dark.js +1 -1
- package/lib/themes/default.css +264 -139
- package/package.json +4 -4
- package/scss/_components.scss +9 -2
- package/scss/_properties.scss +3 -0
- package/scss/components/_cards.scss +1 -0
- package/scss/components/_collapse.scss +31 -1
- package/scss/components/_divider.scss +37 -2
- package/scss/components/_formula.scss +2 -1
- package/scss/components/_image-gallery.scss +10 -0
- package/scss/components/_list.scss +1 -0
- package/scss/components/_menu.scss +6 -3
- package/scss/components/_modal.scss +5 -5
- package/scss/components/_nav.scss +26 -0
- package/scss/components/_page.scss +13 -0
- package/scss/components/_panel.scss +3 -13
- package/scss/components/_result-box.scss +8 -0
- package/scss/components/_table.scss +20 -1
- package/scss/components/_table2.scss +4 -15
- package/scss/components/form/_combo.scss +9 -2
- package/scss/components/form/_file.scss +2 -0
- package/scss/components/form/_icon-select.scss +0 -1
- package/scss/components/form/_list.scss +15 -0
- package/scss/components/form/_result-list.scss +1 -0
- package/scss/components/form/_selection.scss +7 -0
- package/scss/components/form/_textarea.scss +5 -5
- package/scss/components/form/_tree.scss +1 -1
- package/scss/layout/_layout.scss +2 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* amis-ui v3.
|
|
2
|
+
* amis-ui v3.5.0
|
|
3
3
|
* Copyright 2018-2023 fex
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -10,9 +10,10 @@ import findLastIndex from 'lodash/findLastIndex';
|
|
|
10
10
|
import find from 'lodash/find';
|
|
11
11
|
import isEqual from 'lodash/isEqual';
|
|
12
12
|
import filter from 'lodash/filter';
|
|
13
|
+
import debounce from 'lodash/debounce';
|
|
13
14
|
import intersection from 'lodash/intersection';
|
|
14
15
|
import Sortable from 'sortablejs';
|
|
15
|
-
import { isObject, isBreakpoint, autobind, themeable, localeable, guid } from 'amis-core';
|
|
16
|
+
import { resizeSensor, isObject, isBreakpoint, autobind, themeable, localeable, guid } from 'amis-core';
|
|
16
17
|
import { Icon } from '../icons.js';
|
|
17
18
|
import Checkbox from '../Checkbox.js';
|
|
18
19
|
import Spinner from '../Spinner.js';
|
|
@@ -21,6 +22,7 @@ import HeadCellFilter from './HeadCellFilter.js';
|
|
|
21
22
|
import HeadCellSelect from './HeadCellSelect.js';
|
|
22
23
|
import ItemActionsWrapper from './ItemActionsWrapper.js';
|
|
23
24
|
import Cell from './Cell.js';
|
|
25
|
+
import ColGroup from './ColGroup.js';
|
|
24
26
|
|
|
25
27
|
/**
|
|
26
28
|
* @file Table
|
|
@@ -141,6 +143,11 @@ var Table = /** @class */ (function (_super) {
|
|
|
141
143
|
_this.headerDom = React__default.createRef();
|
|
142
144
|
_this.tfootDom = React__default.createRef();
|
|
143
145
|
_this.footDom = React__default.createRef();
|
|
146
|
+
_this.toDispose = [];
|
|
147
|
+
_this.updateTableInfoLazy = debounce(_this.updateTableInfo.bind(_this), 250, {
|
|
148
|
+
trailing: true,
|
|
149
|
+
leading: false
|
|
150
|
+
});
|
|
144
151
|
if (props.rowSelection) {
|
|
145
152
|
var selectedResult = _this.getSelectedRows(props.dataSource, (_a = props.rowSelection) === null || _a === void 0 ? void 0 : _a.selectedRowKeys);
|
|
146
153
|
_this.selectedRows = selectedResult.selectedRows;
|
|
@@ -154,7 +161,7 @@ var Table = /** @class */ (function (_super) {
|
|
|
154
161
|
expandedRowKeys: __spreadArray(__spreadArray([], __read((props.expandable ? props.expandable.expandedRowKeys || [] : [])), false), __read((props.expandable
|
|
155
162
|
? props.expandable.defaultExpandedRowKeys || []
|
|
156
163
|
: [])), false),
|
|
157
|
-
colWidths:
|
|
164
|
+
colWidths: {},
|
|
158
165
|
hoverRow: null
|
|
159
166
|
};
|
|
160
167
|
return _this;
|
|
@@ -225,6 +232,8 @@ var Table = /** @class */ (function (_super) {
|
|
|
225
232
|
this.initDragging();
|
|
226
233
|
}
|
|
227
234
|
this.updateStickyHeader();
|
|
235
|
+
var currentNode = findDOMNode(this);
|
|
236
|
+
this.toDispose.push(resizeSensor(currentNode, this.updateTableInfoLazy, false, 'width'));
|
|
228
237
|
};
|
|
229
238
|
Table.prototype.componentDidUpdate = function (prevProps, prevState) {
|
|
230
239
|
var _this = this;
|
|
@@ -237,7 +246,6 @@ var Table = /** @class */ (function (_super) {
|
|
|
237
246
|
dataSource: __spreadArray([], __read(this.props.dataSource), false)
|
|
238
247
|
}, function () {
|
|
239
248
|
_this.updateTableFixedRows();
|
|
240
|
-
_this.syncTableWidth();
|
|
241
249
|
});
|
|
242
250
|
}
|
|
243
251
|
// 选择项发生了变化触发
|
|
@@ -290,6 +298,9 @@ var Table = /** @class */ (function (_super) {
|
|
|
290
298
|
if (prevProps.sticky !== this.props.sticky) {
|
|
291
299
|
this.updateStickyHeader();
|
|
292
300
|
}
|
|
301
|
+
if (prevProps.columns !== this.props.columns) {
|
|
302
|
+
this.updateTableFixedRows();
|
|
303
|
+
}
|
|
293
304
|
};
|
|
294
305
|
Table.prototype.componentWillUnmount = function () {
|
|
295
306
|
var _this = this;
|
|
@@ -300,6 +311,9 @@ var Table = /** @class */ (function (_super) {
|
|
|
300
311
|
ref.current.removeEventListener('wheel', _this.onWheel.bind(_this));
|
|
301
312
|
});
|
|
302
313
|
this.destroyDragging();
|
|
314
|
+
this.toDispose.forEach(function (fn) { return fn(); });
|
|
315
|
+
this.toDispose = [];
|
|
316
|
+
this.updateTableInfoLazy.cancel();
|
|
303
317
|
};
|
|
304
318
|
Table.prototype.initDragging = function () {
|
|
305
319
|
var _this = this;
|
|
@@ -377,6 +391,7 @@ var Table = /** @class */ (function (_super) {
|
|
|
377
391
|
var children = row.children;
|
|
378
392
|
for (var i = 0; i < children.length; i++) {
|
|
379
393
|
var dom = children[i];
|
|
394
|
+
dom.style.removeProperty('left');
|
|
380
395
|
var fixed = columns[i] ? columns[i].fixed || '' : '';
|
|
381
396
|
if (isFixedLeftColumn(fixed)) {
|
|
382
397
|
dom.style.left =
|
|
@@ -388,6 +403,9 @@ var Table = /** @class */ (function (_super) {
|
|
|
388
403
|
? getAfterRightWidth(children, i, columns) + 'px'
|
|
389
404
|
: '0';
|
|
390
405
|
}
|
|
406
|
+
dom.classList.remove(cx('Table-cell-fix-left-last'));
|
|
407
|
+
dom.classList.remove(cx('Table-cell-fix-right-first'));
|
|
408
|
+
dom.classList.remove(cx('Table-cell-fix-right-first-prev'));
|
|
391
409
|
}
|
|
392
410
|
// 最后一个左fixed的添加样式
|
|
393
411
|
var leftIndex = findLastIndex(columns, function (column) {
|
|
@@ -465,18 +483,18 @@ var Table = /** @class */ (function (_super) {
|
|
|
465
483
|
this.updateSummaryFixedRow(children, columns);
|
|
466
484
|
}
|
|
467
485
|
};
|
|
468
|
-
Table.prototype.renderColGroup = function () {
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
}))
|
|
486
|
+
Table.prototype.renderColGroup = function (showReal) {
|
|
487
|
+
var _a = this.props, scroll = _a.scroll, tableLayout = _a.tableLayout;
|
|
488
|
+
var isFixed = !!((scroll && scroll.x) || tableLayout === 'fixed');
|
|
489
|
+
return (React__default.createElement(ColGroup, { columns: this.tdColumns, colWidths: this.state.colWidths, isFixed: isFixed, syncTableWidth: this.syncTableWidth, initTableWidth: this.initTableWidth, showReal: showReal }));
|
|
472
490
|
};
|
|
473
491
|
Table.prototype.onResizeMouseDown = function (event, index) {
|
|
474
492
|
// 点击记录起始坐标
|
|
475
493
|
this.resizeStart = event.clientX;
|
|
476
494
|
this.resizeTarget = event.currentTarget;
|
|
477
|
-
var
|
|
495
|
+
var column = this.tdColumns[index];
|
|
478
496
|
this.resizeIndex = index;
|
|
479
|
-
this.resizeWidth = this.state.colWidths[
|
|
497
|
+
this.resizeWidth = this.state.colWidths[column.name].width;
|
|
480
498
|
this.resizeTarget.classList.add('is-resizing');
|
|
481
499
|
document.addEventListener('mousemove', this.onResizeMouseMove);
|
|
482
500
|
document.addEventListener('mouseup', this.onResizeMouseUp);
|
|
@@ -487,18 +505,18 @@ var Table = /** @class */ (function (_super) {
|
|
|
487
505
|
if (this.resizeTarget) {
|
|
488
506
|
// 计算横向移动距离
|
|
489
507
|
var distance = event.clientX - this.resizeStart;
|
|
508
|
+
var column = this.tdColumns[this.resizeIndex];
|
|
490
509
|
var newWidth = 0;
|
|
491
510
|
if (distance > 0) {
|
|
492
511
|
newWidth = this.resizeWidth + distance;
|
|
493
512
|
}
|
|
494
513
|
else {
|
|
495
514
|
// 缩短列
|
|
496
|
-
newWidth = Math.max(this.resizeWidth + distance, DefaultCellWidth,
|
|
515
|
+
newWidth = Math.max(this.resizeWidth + distance, DefaultCellWidth, column.minWidth || 0);
|
|
497
516
|
}
|
|
498
|
-
var extraCount = this.getExtraColumnCount();
|
|
499
517
|
var colWidths = this.state.colWidths;
|
|
500
|
-
colWidths[
|
|
501
|
-
this.setState({ colWidths:
|
|
518
|
+
colWidths[column.name].width = newWidth;
|
|
519
|
+
this.setState({ colWidths: __assign({}, colWidths) });
|
|
502
520
|
}
|
|
503
521
|
event && event.stopPropagation();
|
|
504
522
|
};
|
|
@@ -645,7 +663,7 @@ var Table = /** @class */ (function (_super) {
|
|
|
645
663
|
resizable ? (React__default.createElement("i", { className: cx('Table-thead-resizable'), onMouseDown: function (e) { return _this.onResizeMouseDown(e, cIndex); } })) : null)) : null;
|
|
646
664
|
return (React__default.createElement(Cell, { wrapperComponent: "th", rowSpan: item.rowSpan, colSpan: item.colSpan, key: "cell-".concat(i), fixed: item.fixed === true ? 'left' : item.fixed, className: cx({
|
|
647
665
|
'Table-cell-last': i === maxCount - 1 && i === data.length - 1
|
|
648
|
-
}), groupId: item.groupId, depth: item.depth, col: cIndex > -1 ? cIndex.toString() : undefined
|
|
666
|
+
}), groupId: item.groupId, depth: item.depth, col: cIndex > -1 ? cIndex.toString() : undefined }, typeof item.title === 'function'
|
|
649
667
|
? item.title(children)
|
|
650
668
|
: item.title));
|
|
651
669
|
}),
|
|
@@ -680,11 +698,11 @@ var Table = /** @class */ (function (_super) {
|
|
|
680
698
|
};
|
|
681
699
|
Table.prototype.onRowMouseEnter = function (event, record, rowIndex) {
|
|
682
700
|
return __awaiter(this, void 0, void 0, function () {
|
|
683
|
-
var _a,
|
|
701
|
+
var _a, onRow, itemActions, prevented, target;
|
|
684
702
|
return __generator(this, function (_b) {
|
|
685
703
|
switch (_b.label) {
|
|
686
704
|
case 0:
|
|
687
|
-
_a = this.props,
|
|
705
|
+
_a = this.props, onRow = _a.onRow, itemActions = _a.itemActions;
|
|
688
706
|
if (!(onRow && onRow.onRowMouseEnter)) return [3 /*break*/, 2];
|
|
689
707
|
return [4 /*yield*/, onRow.onRowMouseEnter(event, record, rowIndex)];
|
|
690
708
|
case 1:
|
|
@@ -694,17 +712,7 @@ var Table = /** @class */ (function (_super) {
|
|
|
694
712
|
}
|
|
695
713
|
_b.label = 2;
|
|
696
714
|
case 2:
|
|
697
|
-
|
|
698
|
-
while (parent && parent.tagName !== 'TR') {
|
|
699
|
-
parent = parent.parentElement;
|
|
700
|
-
}
|
|
701
|
-
if (parent && !parent.classList.contains(cx('Table-row-disabled'))) {
|
|
702
|
-
for (i = 0; i < parent.children.length; i++) {
|
|
703
|
-
td = parent.children[i];
|
|
704
|
-
td.classList.add(cx('Table-cell-row-hover')); // 保证有列fixed的时候样式一致
|
|
705
|
-
}
|
|
706
|
-
}
|
|
707
|
-
if (record) {
|
|
715
|
+
if (record && itemActions) {
|
|
708
716
|
target = event.target;
|
|
709
717
|
if ((target === null || target === void 0 ? void 0 : target.tagName) !== 'TR') {
|
|
710
718
|
target = target === null || target === void 0 ? void 0 : target.closest('tr');
|
|
@@ -718,37 +726,19 @@ var Table = /** @class */ (function (_super) {
|
|
|
718
726
|
};
|
|
719
727
|
Table.prototype.onRowMouseLeave = function (event, record, rowIndex) {
|
|
720
728
|
return __awaiter(this, void 0, void 0, function () {
|
|
721
|
-
var
|
|
722
|
-
return __generator(this, function (
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
case 1:
|
|
729
|
-
prevented = _b.sent();
|
|
730
|
-
if (prevented) {
|
|
731
|
-
return [2 /*return*/];
|
|
732
|
-
}
|
|
733
|
-
_b.label = 2;
|
|
734
|
-
case 2:
|
|
735
|
-
parent = event.target;
|
|
736
|
-
while (parent && parent.tagName !== 'TR') {
|
|
737
|
-
parent = parent.parentElement;
|
|
738
|
-
}
|
|
739
|
-
if (parent) {
|
|
740
|
-
for (i = 0; i < parent.children.length; i++) {
|
|
741
|
-
td = parent.children[i];
|
|
742
|
-
td.classList.remove(cx('Table-cell-row-hover'));
|
|
743
|
-
}
|
|
744
|
-
}
|
|
745
|
-
return [2 /*return*/];
|
|
746
|
-
}
|
|
729
|
+
var onRow;
|
|
730
|
+
return __generator(this, function (_a) {
|
|
731
|
+
onRow = this.props.onRow;
|
|
732
|
+
onRow &&
|
|
733
|
+
onRow.onRowMouseLeave &&
|
|
734
|
+
onRow.onRowMouseLeave(event, record, rowIndex);
|
|
735
|
+
return [2 /*return*/];
|
|
747
736
|
});
|
|
748
737
|
});
|
|
749
738
|
};
|
|
750
739
|
Table.prototype.onMouseLeave = function () {
|
|
751
|
-
|
|
740
|
+
var itemActions = this.props.itemActions;
|
|
741
|
+
itemActions && this.setState({ hoverRow: null });
|
|
752
742
|
};
|
|
753
743
|
Table.prototype.onExpandRows = function (data) {
|
|
754
744
|
var _this = this;
|
|
@@ -895,7 +885,7 @@ var Table = /** @class */ (function (_super) {
|
|
|
895
885
|
// 为了支持灵活合并单元格,renderers层的Table2传递的render方法,返回{children: <ReactElement>, props: {rowSpan, colSpan}}
|
|
896
886
|
// 但直接使用amis-ui的table,render方法一般直接返回ReactElement
|
|
897
887
|
var render = item.render && typeof item.render === 'function'
|
|
898
|
-
? item.render(data[item.name], data, rowIndex, i)
|
|
888
|
+
? item.render(data[item.name], data, rowIndex, i, levels)
|
|
899
889
|
: null;
|
|
900
890
|
var props = { rowSpan: 1, colSpan: 1 };
|
|
901
891
|
var children = render;
|
|
@@ -914,7 +904,7 @@ var Table = /** @class */ (function (_super) {
|
|
|
914
904
|
: '';
|
|
915
905
|
return props.rowSpan === 0 || props.colSpan === 0 ? null : (React__default.createElement(Cell, __assign({ key: i }, props, { fixed: item.fixed === true ? 'left' : item.fixed, column: item, groupId: item.groupId, className: cx((_a = {},
|
|
916
906
|
_a["".concat(className)] = !!className,
|
|
917
|
-
_a)) }),
|
|
907
|
+
_a)), col: i > -1 ? i.toString() : undefined }),
|
|
918
908
|
React__default.createElement("div", { className: cx('Table-cell-wrapper', (_b = {},
|
|
919
909
|
_b[cx('Table-cell-wrapper-prefix')] = i === 0 &&
|
|
920
910
|
(!!indentDom || (levels.length === 0 && hasChildrenRow)),
|
|
@@ -1121,19 +1111,21 @@ var Table = /** @class */ (function (_super) {
|
|
|
1121
1111
|
this.updateTableDom(target);
|
|
1122
1112
|
};
|
|
1123
1113
|
Table.prototype.renderTable = function () {
|
|
1124
|
-
var _a = this.props, scroll = _a.scroll, footSummary = _a.footSummary,
|
|
1114
|
+
var _a = this.props, scroll = _a.scroll, footSummary = _a.footSummary, showHeader = _a.showHeader, itemActions = _a.itemActions, tableLayout = _a.tableLayout, cx = _a.classnames;
|
|
1125
1115
|
var hasScrollX = scroll && scroll.x;
|
|
1126
1116
|
var hoverRow = this.state.hoverRow;
|
|
1127
|
-
var tableStyle = hasScrollX
|
|
1117
|
+
var tableStyle = hasScrollX
|
|
1118
|
+
? { width: scroll.x + 'px', tableLayout: 'fixed' }
|
|
1119
|
+
: {};
|
|
1128
1120
|
return (React__default.createElement("div", { ref: this.contentDom, className: cx('Table-content'), style: hasScrollX ? { overflow: 'auto hidden' } : {}, onMouseLeave: this.onMouseLeave.bind(this), onScroll: this.onTableContentScroll.bind(this) },
|
|
1129
1121
|
itemActions && hoverRow ? (React__default.createElement(ItemActionsWrapper, { dom: hoverRow.target, classnames: cx }, typeof itemActions === 'function'
|
|
1130
1122
|
? itemActions(hoverRow.record, hoverRow.rowIndex)
|
|
1131
1123
|
: null)) : null,
|
|
1132
|
-
React__default.createElement("table", { style: __assign(__assign({}, tableStyle), { tableLayout: 'fixed' }), className: cx('Table-table') },
|
|
1124
|
+
React__default.createElement("table", { style: __assign(__assign({}, tableStyle), { tableLayout: tableLayout === 'fixed' ? 'fixed' : 'auto' }), className: cx('Table-table') },
|
|
1133
1125
|
this.renderColGroup(),
|
|
1134
1126
|
showHeader ? this.renderTHead() : null,
|
|
1135
1127
|
this.renderTBody(),
|
|
1136
|
-
|
|
1128
|
+
footSummary ? this.renderTFoot() : null)));
|
|
1137
1129
|
};
|
|
1138
1130
|
Table.prototype.renderScrollTableHeader = function () {
|
|
1139
1131
|
var _a;
|
|
@@ -1152,7 +1144,7 @@ var Table = /** @class */ (function (_super) {
|
|
|
1152
1144
|
_a[cx('Table-sticky-holder')] = !!sticky,
|
|
1153
1145
|
_a)), style: style },
|
|
1154
1146
|
React__default.createElement("table", { className: cx('Table-table'), style: __assign(__assign({}, tableStyle), { tableLayout: 'fixed' }) },
|
|
1155
|
-
this.renderColGroup(),
|
|
1147
|
+
this.renderColGroup(true),
|
|
1156
1148
|
showHeader ? this.renderTHead() : null,
|
|
1157
1149
|
headSummary ? (React__default.createElement("tbody", null, this.renderSummaryRow(headSummary))) : null)));
|
|
1158
1150
|
};
|
|
@@ -1184,31 +1176,76 @@ var Table = /** @class */ (function (_super) {
|
|
|
1184
1176
|
React__default.createElement("table", { className: cx('Table-table'), style: { width: (scroll === null || scroll === void 0 ? void 0 : scroll.x) + 'px' || '100%', tableLayout: 'fixed' } }, this.renderTFoot())));
|
|
1185
1177
|
};
|
|
1186
1178
|
Table.prototype.renderScrollTable = function () {
|
|
1187
|
-
var _a = this.props, footSummary = _a.footSummary,
|
|
1179
|
+
var _a = this.props, footSummary = _a.footSummary, cx = _a.classnames;
|
|
1188
1180
|
return (React__default.createElement("div", { className: cx('Table-container') },
|
|
1189
1181
|
this.renderScrollTableHeader(),
|
|
1190
1182
|
this.renderScrollTableBody(),
|
|
1191
|
-
|
|
1183
|
+
footSummary ? this.renderScrollTableFoot() : null));
|
|
1192
1184
|
};
|
|
1193
1185
|
Table.prototype.syncTableWidth = function () {
|
|
1194
1186
|
var _this = this;
|
|
1195
|
-
var
|
|
1187
|
+
var tbodyDom = this.tbodyDom.current;
|
|
1188
|
+
if (!tbodyDom) {
|
|
1189
|
+
return;
|
|
1190
|
+
}
|
|
1191
|
+
var cols = [].slice.call(tbodyDom === null || tbodyDom === void 0 ? void 0 : tbodyDom.querySelectorAll(':scope>tr>td[data-col]'));
|
|
1192
|
+
var colWidths = {};
|
|
1193
|
+
cols.forEach(function (col) {
|
|
1194
|
+
var index = parseInt(col.getAttribute('data-col'), 10);
|
|
1195
|
+
var column = _this.tdColumns[index];
|
|
1196
|
+
var item = _this.state.colWidths[column.name];
|
|
1197
|
+
if (column) {
|
|
1198
|
+
colWidths[column.name] = {
|
|
1199
|
+
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,
|
|
1200
|
+
minWidth: column === null || column === void 0 ? void 0 : column.minWidth,
|
|
1201
|
+
realWidth: col.offsetWidth,
|
|
1202
|
+
originWidth: column === null || column === void 0 ? void 0 : column.width
|
|
1203
|
+
};
|
|
1204
|
+
}
|
|
1205
|
+
});
|
|
1206
|
+
if (!isEqual(colWidths, this.state.colWidths)) {
|
|
1207
|
+
this.setState({ colWidths: colWidths });
|
|
1208
|
+
}
|
|
1209
|
+
};
|
|
1210
|
+
Table.prototype.initTableWidth = function () {
|
|
1211
|
+
var _this = this;
|
|
1212
|
+
var _a;
|
|
1196
1213
|
var tableWrapperDom = this.contentDom.current;
|
|
1197
1214
|
if (!tableWrapperDom) {
|
|
1198
1215
|
return;
|
|
1199
1216
|
}
|
|
1217
|
+
var _b = this.props, scroll = _b.scroll, tableLayout = _b.tableLayout;
|
|
1200
1218
|
var table = tableWrapperDom.querySelector('table');
|
|
1201
|
-
var tableWidth = tableWrapperDom.offsetWidth;
|
|
1219
|
+
var tableWidth = scroll && scroll.x ? scroll.x : tableWrapperDom.offsetWidth;
|
|
1202
1220
|
var thead = (_a = this.theadDom) === null || _a === void 0 ? void 0 : _a.current;
|
|
1203
|
-
var
|
|
1221
|
+
var tbody = null;
|
|
1222
|
+
var htmls = [];
|
|
1223
|
+
var isFixed = tableLayout === 'fixed' || (scroll && scroll.x);
|
|
1224
|
+
var someSettedWidth = this.tdColumns.some(function (column) { return column.width; });
|
|
1225
|
+
var minWidths = {};
|
|
1226
|
+
// fixed 模式需要参考 auto 获得列最小宽度
|
|
1227
|
+
if (isFixed) {
|
|
1228
|
+
tbody = (table === null || table === void 0 ? void 0 : table.querySelector(':scope>tbody')) || null;
|
|
1229
|
+
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>"));
|
|
1230
|
+
}
|
|
1231
|
+
if (someSettedWidth || isFixed) {
|
|
1232
|
+
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>"));
|
|
1233
|
+
}
|
|
1234
|
+
if (!htmls.length) {
|
|
1235
|
+
return;
|
|
1236
|
+
}
|
|
1204
1237
|
var div = document.createElement('div');
|
|
1205
1238
|
div.className = 'amis-scope'; // jssdk 里面 css 会在这一层
|
|
1206
1239
|
div.style.cssText += "visibility: hidden!important;";
|
|
1207
|
-
div.innerHTML =
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1240
|
+
div.innerHTML = htmls.join('');
|
|
1241
|
+
var ths1 = [];
|
|
1242
|
+
var ths2 = [];
|
|
1243
|
+
if (isFixed) {
|
|
1244
|
+
ths1 = [].slice.call(div.querySelectorAll(':scope>table:first-child>thead>tr>th[data-col]'));
|
|
1245
|
+
}
|
|
1246
|
+
if (someSettedWidth || isFixed) {
|
|
1247
|
+
ths2 = [].slice.call(div.querySelectorAll(':scope>table:last-child>thead>tr>th[data-col]'));
|
|
1248
|
+
}
|
|
1212
1249
|
ths1.forEach(function (th) {
|
|
1213
1250
|
th.style.cssText += 'width: 0';
|
|
1214
1251
|
});
|
|
@@ -1221,26 +1258,44 @@ var Table = /** @class */ (function (_super) {
|
|
|
1221
1258
|
: '');
|
|
1222
1259
|
});
|
|
1223
1260
|
document.body.appendChild(div);
|
|
1224
|
-
var
|
|
1261
|
+
var colWidths = {};
|
|
1225
1262
|
ths1.forEach(function (th) {
|
|
1226
|
-
|
|
1263
|
+
var index = parseInt(th.getAttribute('data-col'), 10);
|
|
1264
|
+
var column = _this.tdColumns[index];
|
|
1265
|
+
minWidths[index] = th.clientWidth;
|
|
1266
|
+
if (colWidths[index]) {
|
|
1267
|
+
colWidths[column === null || column === void 0 ? void 0 : column.name].minWidth = th.clientWidth;
|
|
1268
|
+
}
|
|
1269
|
+
else {
|
|
1270
|
+
colWidths[column === null || column === void 0 ? void 0 : column.name] = { minWidth: th.clientWidth };
|
|
1271
|
+
}
|
|
1227
1272
|
});
|
|
1228
|
-
|
|
1229
|
-
|
|
1273
|
+
ths2.forEach(function (col) {
|
|
1274
|
+
var index = parseInt(col.getAttribute('data-col'), 10);
|
|
1230
1275
|
var column = _this.tdColumns[index];
|
|
1231
|
-
|
|
1276
|
+
if (column && (column.width || isFixed)) {
|
|
1277
|
+
var width = Math.max(typeof column.width === 'number' ? column.width : col.clientWidth, minWidths[index] || 0);
|
|
1278
|
+
if (colWidths[column === null || column === void 0 ? void 0 : column.name]) {
|
|
1279
|
+
colWidths[column === null || column === void 0 ? void 0 : column.name].width = width;
|
|
1280
|
+
}
|
|
1281
|
+
else {
|
|
1282
|
+
colWidths[column === null || column === void 0 ? void 0 : column.name] = { width: width };
|
|
1283
|
+
}
|
|
1284
|
+
if (column.width) {
|
|
1285
|
+
colWidths[column === null || column === void 0 ? void 0 : column.name].originWidth = column.width;
|
|
1286
|
+
}
|
|
1287
|
+
}
|
|
1232
1288
|
});
|
|
1233
|
-
|
|
1289
|
+
if (!isEqual(colWidths, this.state.colWidths)) {
|
|
1290
|
+
this.setState({ colWidths: colWidths });
|
|
1291
|
+
}
|
|
1234
1292
|
document.body.removeChild(div);
|
|
1235
1293
|
};
|
|
1236
|
-
Table.prototype.
|
|
1237
|
-
if (!ref) {
|
|
1238
|
-
return;
|
|
1239
|
-
}
|
|
1294
|
+
Table.prototype.updateTableInfo = function () {
|
|
1240
1295
|
if (this.resizeTarget) {
|
|
1241
1296
|
return;
|
|
1242
1297
|
}
|
|
1243
|
-
this.
|
|
1298
|
+
this.initTableWidth();
|
|
1244
1299
|
};
|
|
1245
1300
|
Table.prototype.render = function () {
|
|
1246
1301
|
var _a;
|
|
@@ -1254,7 +1309,6 @@ var Table = /** @class */ (function (_super) {
|
|
|
1254
1309
|
var hasScrollY = scroll && scroll.y;
|
|
1255
1310
|
// 是否设置了横向滚动
|
|
1256
1311
|
var hasScrollX = scroll && scroll.x;
|
|
1257
|
-
var columnWidthReady = this.state.colWidths.length > 0;
|
|
1258
1312
|
return (React__default.createElement("div", { ref: this.tableDom, className: cx('Table2', className, (_a = {},
|
|
1259
1313
|
_a[cx('Table-scroll-horizontal')] = hasScrollX,
|
|
1260
1314
|
_a[cx("Table-".concat(size))] = size,
|
|
@@ -1263,8 +1317,7 @@ var Table = /** @class */ (function (_super) {
|
|
|
1263
1317
|
_a)) },
|
|
1264
1318
|
title ? (React__default.createElement("div", { className: cx('Table-title') }, typeof title === 'function' ? title() : title)) : null,
|
|
1265
1319
|
hasScrollY || sticky ? (this.renderScrollTable()) : (React__default.createElement("div", { className: cx('Table-container') }, this.renderTable())),
|
|
1266
|
-
footer ? (React__default.createElement("div", { className: cx('Table-footer') }, typeof footer === 'function' ? footer() : footer)) : null
|
|
1267
|
-
columnWidthReady ? null : React__default.createElement("span", { ref: this.updateTableInfoRef })));
|
|
1320
|
+
footer ? (React__default.createElement("div", { className: cx('Table-footer') }, typeof footer === 'function' ? footer() : footer)) : null));
|
|
1268
1321
|
};
|
|
1269
1322
|
Table.defaultProps = {
|
|
1270
1323
|
title: '',
|
|
@@ -1273,7 +1326,8 @@ var Table = /** @class */ (function (_super) {
|
|
|
1273
1326
|
columns: [],
|
|
1274
1327
|
indentSize: 15,
|
|
1275
1328
|
placeholder: '暂无数据',
|
|
1276
|
-
showHeader: true
|
|
1329
|
+
showHeader: true,
|
|
1330
|
+
tableLayout: 'auto'
|
|
1277
1331
|
};
|
|
1278
1332
|
__decorate([
|
|
1279
1333
|
autobind,
|
|
@@ -1302,9 +1356,15 @@ var Table = /** @class */ (function (_super) {
|
|
|
1302
1356
|
__decorate([
|
|
1303
1357
|
autobind,
|
|
1304
1358
|
__metadata("design:type", Function),
|
|
1305
|
-
__metadata("design:paramtypes", [
|
|
1359
|
+
__metadata("design:paramtypes", []),
|
|
1360
|
+
__metadata("design:returntype", void 0)
|
|
1361
|
+
], Table.prototype, "initTableWidth", null);
|
|
1362
|
+
__decorate([
|
|
1363
|
+
autobind,
|
|
1364
|
+
__metadata("design:type", Function),
|
|
1365
|
+
__metadata("design:paramtypes", []),
|
|
1306
1366
|
__metadata("design:returntype", void 0)
|
|
1307
|
-
], Table.prototype, "
|
|
1367
|
+
], Table.prototype, "updateTableInfo", null);
|
|
1308
1368
|
return Table;
|
|
1309
1369
|
}(React__default.PureComponent));
|
|
1310
1370
|
var index = themeable(localeable(Table));
|
package/esm/hooks/use-touch.js
CHANGED
package/esm/icons/back.svg.js
CHANGED
package/esm/icons/caret.svg.js
CHANGED
package/esm/icons/check.svg.js
CHANGED
package/esm/icons/clock.svg.js
CHANGED
package/esm/icons/close.svg.js
CHANGED