naive-ui 2.21.5 → 2.23.2
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/es/_internal/clear/src/styles/index.cssr.js +10 -10
- package/es/_internal/close/src/styles/index.cssr.js +8 -8
- package/es/_internal/icons/Close.js +1 -1
- package/es/_internal/scrollbar/src/ScrollBar.d.ts +10 -6
- package/es/_internal/scrollbar/src/ScrollBar.js +15 -11
- package/es/_internal/scrollbar/src/styles/index.cssr.js +15 -15
- package/es/_internal/select-menu/src/SelectMenu.d.ts +21 -21
- package/es/_internal/select-menu/src/SelectMenu.js +21 -21
- package/es/_internal/select-menu/src/styles/index.cssr.js +35 -35
- package/es/_internal/select-menu/styles/_common.js +1 -1
- package/es/_internal/selection/src/Selection.d.ts +44 -44
- package/es/_internal/selection/src/Selection.js +55 -53
- package/es/_internal/selection/src/styles/index.cssr.js +84 -80
- package/es/_mixins/common.d.ts +1 -0
- package/es/_mixins/common.js +1 -0
- package/es/_mixins/index.d.ts +1 -0
- package/es/_mixins/index.js +1 -0
- package/es/_mixins/use-css-vars-class.d.ts +2 -0
- package/es/_mixins/use-css-vars-class.js +22 -0
- package/es/_mixins/use-rtl.js +2 -0
- package/es/_mixins/use-style.js +3 -0
- package/es/_mixins/use-theme.js +3 -0
- package/es/_utils/composable/use-houdini.js +12 -9
- package/es/alert/src/Alert.d.ts +22 -22
- package/es/alert/src/Alert.js +22 -22
- package/es/alert/src/styles/index.cssr.js +45 -45
- package/es/anchor/src/AnchorAdapter.js +12 -12
- package/es/anchor/src/styles/index.cssr.js +41 -41
- package/es/auto-complete/src/AutoComplete.d.ts +2 -2
- package/es/auto-complete/src/AutoComplete.js +2 -2
- package/es/auto-complete/src/styles/index.cssr.js +4 -4
- package/es/avatar/index.d.ts +2 -0
- package/es/avatar/index.js +1 -0
- package/es/avatar/src/Avatar.d.ts +77 -36
- package/es/avatar/src/Avatar.js +46 -16
- package/es/avatar/src/AvatarGroup.d.ts +52 -0
- package/es/avatar/src/AvatarGroup.js +61 -0
- package/es/avatar/src/interface.d.ts +2 -0
- package/es/avatar/src/interface.js +1 -0
- package/es/avatar/src/styles/avatar-group.cssr.d.ts +2 -0
- package/es/avatar/src/styles/avatar-group.cssr.js +14 -0
- package/es/avatar/src/styles/index.cssr.js +21 -18
- package/es/avatar/styles/light.d.ts +3 -0
- package/es/avatar/styles/light.js +6 -2
- package/es/back-top/src/BackTop.d.ts +13 -13
- package/es/back-top/src/BackTop.js +13 -13
- package/es/back-top/src/styles/index.cssr.js +29 -29
- package/es/badge/src/Badge.d.ts +6 -6
- package/es/badge/src/Badge.js +6 -6
- package/es/badge/src/styles/index.cssr.js +15 -15
- package/es/breadcrumb/src/Breadcrumb.d.ts +8 -8
- package/es/breadcrumb/src/Breadcrumb.js +8 -8
- package/es/breadcrumb/src/styles/index.cssr.js +23 -23
- package/es/button/src/Button.d.ts +43 -38
- package/es/button/src/Button.js +124 -116
- package/es/button/src/styles/button.cssr.js +83 -80
- package/es/button/styles/light.js +1 -1
- package/es/calendar/src/Calendar.d.ts +23 -21
- package/es/calendar/src/Calendar.js +21 -21
- package/es/calendar/src/styles/index.cssr.js +57 -57
- package/es/card/src/Card.d.ts +28 -23
- package/es/card/src/Card.js +24 -23
- package/es/card/src/styles/index.cssr.js +71 -69
- package/es/carousel/src/Carousel.d.ts +5 -5
- package/es/carousel/src/Carousel.js +5 -5
- package/es/carousel/src/styles/index.cssr.js +10 -10
- package/es/cascader/src/Cascader.d.ts +160 -17
- package/es/cascader/src/Cascader.js +32 -24
- package/es/cascader/src/CascaderMenu.d.ts +345 -0
- package/es/cascader/src/CascaderMenu.js +7 -6
- package/es/cascader/src/CascaderOption.d.ts +18 -0
- package/es/cascader/src/CascaderSelectMenu.d.ts +18 -0
- package/es/cascader/src/CascaderSubmenu.d.ts +18 -0
- package/es/cascader/src/styles/index.cssr.js +44 -44
- package/es/cascader/styles/dark.js +3 -1
- package/es/cascader/styles/light.d.ts +13 -0
- package/es/cascader/styles/light.js +4 -2
- package/es/checkbox/src/Checkbox.d.ts +23 -23
- package/es/checkbox/src/Checkbox.js +23 -23
- package/es/checkbox/src/styles/index.cssr.js +58 -58
- package/es/code/src/Code.d.ts +14 -14
- package/es/code/src/Code.js +26 -17
- package/es/code/src/styles/index.cssr.js +28 -28
- package/es/collapse/src/Collapse.d.ts +8 -8
- package/es/collapse/src/Collapse.js +8 -8
- package/es/collapse/src/styles/index.cssr.js +24 -24
- package/es/collapse-transition/src/CollapseTransition.d.ts +1 -1
- package/es/collapse-transition/src/CollapseTransition.js +1 -1
- package/es/color-picker/src/ColorPicker.d.ts +10 -10
- package/es/color-picker/src/ColorPicker.js +10 -10
- package/es/color-picker/src/styles/index.cssr.js +28 -28
- package/es/components.d.ts +2 -0
- package/es/components.js +2 -0
- package/es/config-provider/src/ConfigProvider.d.ts +6 -0
- package/es/countdown/index.d.ts +2 -0
- package/es/countdown/index.js +1 -0
- package/es/countdown/src/Countdown.d.ts +72 -0
- package/es/countdown/src/Countdown.js +126 -0
- package/es/countdown/src/utils.d.ts +0 -0
- package/es/countdown/src/utils.js +1 -0
- package/es/data-table/src/DataTable.d.ts +39 -39
- package/es/data-table/src/DataTable.js +49 -55
- package/es/data-table/src/MainTable.js +2 -3
- package/es/data-table/src/TableParts/Body.d.ts +15 -4
- package/es/data-table/src/TableParts/Body.js +82 -28
- package/es/data-table/src/TableParts/Cell.js +2 -3
- package/es/data-table/src/TableParts/Header.js +2 -2
- package/es/data-table/src/interface.d.ts +4 -1
- package/es/data-table/src/styles/index.cssr.js +133 -132
- package/es/data-table/src/use-check.js +6 -2
- package/es/data-table/src/use-scroll.d.ts +2 -0
- package/es/data-table/src/use-scroll.js +34 -4
- package/es/data-table/src/use-table-data.js +3 -1
- package/es/data-table/styles/_common.js +1 -1
- package/es/date-picker/src/DatePicker.d.ts +70 -46
- package/es/date-picker/src/DatePicker.js +61 -52
- package/es/date-picker/src/config.d.ts +1 -1
- package/es/date-picker/src/interface.d.ts +2 -1
- package/es/date-picker/src/panel/date.d.ts +13 -10
- package/es/date-picker/src/panel/date.js +2 -2
- package/es/date-picker/src/panel/daterange.d.ts +11 -9
- package/es/date-picker/src/panel/daterange.js +2 -2
- package/es/date-picker/src/panel/datetime.d.ts +13 -16
- package/es/date-picker/src/panel/datetime.js +2 -2
- package/es/date-picker/src/panel/datetimerange.d.ts +11 -9
- package/es/date-picker/src/panel/datetimerange.js +2 -2
- package/es/date-picker/src/panel/month.d.ts +17 -20
- package/es/date-picker/src/panel/month.js +23 -12
- package/es/date-picker/src/panel/use-calendar.d.ts +13 -39
- package/es/date-picker/src/panel/use-calendar.js +41 -23
- package/es/date-picker/src/panel/use-dual-calendar.d.ts +9 -36
- package/es/date-picker/src/panel/use-dual-calendar.js +35 -21
- package/es/date-picker/src/panel/use-panel-common.d.ts +9 -32
- package/es/date-picker/src/panel/use-panel-common.js +4 -8
- package/es/date-picker/src/styles/index.cssr.js +115 -115
- package/es/date-picker/src/utils.d.ts +19 -3
- package/es/date-picker/src/utils.js +40 -5
- package/es/date-picker/styles/_common.d.ts +2 -0
- package/es/date-picker/styles/_common.js +3 -1
- package/es/date-picker/styles/light.d.ts +4 -0
- package/es/descriptions/src/Descriptions.d.ts +18 -18
- package/es/descriptions/src/Descriptions.js +19 -20
- package/es/descriptions/src/styles/index.cssr.js +61 -61
- package/es/dialog/src/Dialog.d.ts +24 -24
- package/es/dialog/src/Dialog.js +22 -22
- package/es/dialog/src/DialogEnvironment.d.ts +2 -2
- package/es/dialog/src/DialogProvider.d.ts +1 -1
- package/es/dialog/src/styles/index.cssr.js +45 -45
- package/es/divider/src/Divider.d.ts +4 -4
- package/es/divider/src/Divider.js +4 -4
- package/es/divider/src/styles/index.cssr.js +12 -12
- package/es/drawer/src/Drawer.d.ts +19 -19
- package/es/drawer/src/Drawer.js +19 -19
- package/es/drawer/src/styles/index.cssr.js +41 -40
- package/es/dropdown/src/Dropdown.js +34 -32
- package/es/dropdown/src/styles/index.cssr.js +59 -59
- package/es/dynamic-tags/src/DynamicTags.d.ts +1 -1
- package/es/dynamic-tags/src/DynamicTags.js +1 -1
- package/es/dynamic-tags/src/styles/index.cssr.js +1 -1
- package/es/empty/src/Empty.d.ts +19 -15
- package/es/empty/src/Empty.js +12 -12
- package/es/empty/src/styles/index.cssr.js +20 -19
- package/es/form/src/Form.d.ts +27 -27
- package/es/form/src/FormItem.d.ts +42 -42
- package/es/form/src/FormItem.js +15 -15
- package/es/form/src/FormItemCol.d.ts +33 -27
- package/es/form/src/FormItemCol.js +1 -0
- package/es/form/src/FormItemGridItem.d.ts +33 -27
- package/es/form/src/FormItemGridItem.js +1 -0
- package/es/form/src/FormItemRow.d.ts +33 -27
- package/es/form/src/FormItemRow.js +1 -0
- package/es/form/src/styles/form-item.cssr.js +37 -37
- package/es/form/styles/_common.d.ts +0 -3
- package/es/form/styles/_common.js +0 -3
- package/es/form/styles/light.d.ts +3 -3
- package/es/form/styles/light.js +2 -2
- package/es/gradient-text/src/GradientText.d.ts +5 -5
- package/es/gradient-text/src/GradientText.js +5 -5
- package/es/gradient-text/src/styles/index.cssr.js +9 -9
- package/es/icon/src/Icon.d.ts +6 -6
- package/es/icon/src/Icon.js +4 -4
- package/es/icon/src/styles/index.cssr.js +7 -7
- package/es/image/src/Image.js +8 -12
- package/es/image/src/ImagePreview.d.ts +2 -2
- package/es/image/src/ImagePreview.js +13 -12
- package/es/image/src/styles/index.cssr.js +5 -5
- package/es/input/src/Input.d.ts +52 -47
- package/es/input/src/Input.js +54 -49
- package/es/input/src/InputGroupLabel.d.ts +8 -8
- package/es/input/src/InputGroupLabel.js +8 -8
- package/es/input/src/styles/input-group-label.cssr.js +18 -18
- package/es/input/src/styles/input.cssr.js +108 -109
- package/es/input-number/src/InputNumber.d.ts +11 -0
- package/es/input-number/src/InputNumber.js +5 -2
- package/es/input-number/src/utils.js +2 -1
- package/es/layout/src/Layout.d.ts +6 -6
- package/es/layout/src/Layout.js +3 -3
- package/es/layout/src/LayoutContent.d.ts +3 -3
- package/es/layout/src/LayoutFooter.js +7 -7
- package/es/layout/src/LayoutHeader.js +7 -7
- package/es/layout/src/LayoutSider.js +13 -13
- package/es/layout/src/styles/layout-footer.cssr.js +11 -11
- package/es/layout/src/styles/layout-header.cssr.js +11 -11
- package/es/layout/src/styles/layout-sider.cssr.js +32 -32
- package/es/layout/src/styles/layout.cssr.js +8 -8
- package/es/list/src/List.d.ts +10 -10
- package/es/list/src/List.js +10 -10
- package/es/list/src/styles/index.cssr.js +30 -30
- package/es/loading-bar/src/LoadingBar.d.ts +3 -3
- package/es/loading-bar/src/LoadingBar.js +3 -3
- package/es/loading-bar/src/styles/index.cssr.js +7 -7
- package/es/locales/common/deDE.js +2 -0
- package/es/locales/common/enUS.d.ts +2 -0
- package/es/locales/common/enUS.js +2 -0
- package/es/locales/common/frFR.js +7 -5
- package/es/locales/common/idID.js +2 -0
- package/es/locales/common/jaJP.js +2 -0
- package/es/locales/common/nbNO.js +2 -0
- package/es/locales/common/ruRU.js +2 -0
- package/es/locales/common/ukUA.js +2 -0
- package/es/locales/common/zhCN.js +2 -0
- package/es/locales/common/zhTW.d.ts +3 -0
- package/es/locales/common/zhTW.js +100 -0
- package/es/locales/date/zhTW.d.ts +3 -0
- package/es/locales/date/zhTW.js +6 -0
- package/es/locales/index.d.ts +2 -0
- package/es/locales/index.js +2 -0
- package/es/log/src/Log.d.ts +6 -6
- package/es/log/src/Log.js +6 -6
- package/es/log/src/styles/index.cssr.js +16 -18
- package/es/mention/src/Mention.d.ts +1 -1
- package/es/mention/src/Mention.js +1 -1
- package/es/mention/src/styles/index.cssr.js +2 -2
- package/es/menu/src/Menu.js +43 -40
- package/es/menu/src/styles/index.cssr.js +71 -71
- package/es/message/src/Message.d.ts +22 -22
- package/es/message/src/Message.js +22 -22
- package/es/message/src/styles/index.cssr.js +48 -48
- package/es/modal/src/BodyWrapper.d.ts +11 -2
- package/es/modal/src/BodyWrapper.js +23 -17
- package/es/modal/src/Modal.d.ts +14 -8
- package/es/modal/src/Modal.js +13 -7
- package/es/modal/src/presetProps.d.ts +2 -1
- package/es/modal/src/styles/index.cssr.js +8 -8
- package/es/notification/src/Notification.d.ts +24 -24
- package/es/notification/src/Notification.js +24 -24
- package/es/notification/src/styles/index.cssr.js +65 -65
- package/es/number-animation/index.d.ts +3 -0
- package/es/number-animation/index.js +1 -0
- package/es/number-animation/src/NumberAnimation.d.ts +79 -0
- package/es/number-animation/src/NumberAnimation.js +81 -0
- package/es/number-animation/src/utils.d.ts +8 -0
- package/es/number-animation/src/utils.js +17 -0
- package/es/page-header/src/PageHeader.d.ts +10 -10
- package/es/page-header/src/PageHeader.js +13 -13
- package/es/page-header/src/styles/index.cssr.js +25 -27
- package/es/pagination/src/Pagination.d.ts +42 -41
- package/es/pagination/src/Pagination.js +52 -45
- package/es/pagination/src/styles/index.cssr.js +81 -81
- package/es/popconfirm/src/Popconfirm.d.ts +2 -2
- package/es/popconfirm/src/PopconfirmPanel.d.ts +4 -4
- package/es/popconfirm/src/PopconfirmPanel.js +4 -4
- package/es/popconfirm/src/styles/index.cssr.js +8 -8
- package/es/popover/src/Popover.js +4 -1
- package/es/popover/src/PopoverBody.js +18 -18
- package/es/popover/src/styles/index.cssr.js +62 -62
- package/es/popselect/src/Popselect.d.ts +2 -11
- package/es/popselect/src/Popselect.js +2 -2
- package/es/popselect/src/PopselectPanel.d.ts +3 -11
- package/es/popselect/src/PopselectPanel.js +17 -11
- package/es/progress/src/Progress.d.ts +14 -14
- package/es/progress/src/Progress.js +14 -14
- package/es/progress/src/styles/index.cssr.js +53 -53
- package/es/radio/src/Radio.d.ts +15 -15
- package/es/radio/src/Radio.js +18 -18
- package/es/radio/src/RadioButton.js +4 -5
- package/es/radio/src/RadioGroup.d.ts +14 -14
- package/es/radio/src/RadioGroup.js +14 -14
- package/es/radio/src/styles/radio-group.cssr.js +51 -47
- package/es/radio/src/styles/radio.cssr.js +44 -40
- package/es/radio/src/use-radio.d.ts +0 -3
- package/es/radio/src/use-radio.js +1 -26
- package/es/rate/src/Rate.d.ts +4 -4
- package/es/rate/src/Rate.js +4 -4
- package/es/rate/src/styles/index.cssr.js +11 -11
- package/es/result/src/Result.d.ts +9 -9
- package/es/result/src/Result.js +9 -9
- package/es/result/src/styles/index.cssr.js +20 -20
- package/es/select/src/Select.d.ts +1 -1
- package/es/select/src/Select.js +1 -1
- package/es/select/src/styles/index.cssr.js +2 -2
- package/es/skeleton/src/Skeleton.d.ts +3 -3
- package/es/skeleton/src/Skeleton.js +3 -3
- package/es/skeleton/src/styles/index.cssr.js +12 -12
- package/es/slider/src/Slider.d.ts +29 -29
- package/es/slider/src/Slider.js +29 -29
- package/es/slider/src/styles/index.cssr.js +87 -87
- package/es/spin/src/Spin.d.ts +5 -5
- package/es/spin/src/Spin.js +5 -5
- package/es/spin/src/styles/index.cssr.js +15 -15
- package/es/statistic/src/Statistic.d.ts +25 -45
- package/es/statistic/src/Statistic.js +12 -19
- package/es/statistic/src/styles/index.cssr.js +19 -19
- package/es/steps/src/Step.d.ts +12 -12
- package/es/steps/src/Step.js +12 -12
- package/es/steps/src/styles/index.cssr.js +46 -46
- package/es/switch/src/Switch.d.ts +19 -19
- package/es/switch/src/Switch.js +26 -19
- package/es/switch/src/styles/index.cssr.js +59 -57
- package/es/table/src/Table.d.ts +21 -21
- package/es/table/src/Table.js +21 -21
- package/es/table/src/styles/index.cssr.js +55 -55
- package/es/tabs/src/styles/index.cssr.js +5 -1
- package/es/tabs/styles/light.js +1 -1
- package/es/tag/src/Tag.d.ts +27 -26
- package/es/tag/src/Tag.js +27 -26
- package/es/tag/src/styles/index.cssr.js +55 -55
- package/es/tag/src/styles/rtl.cssr.js +1 -1
- package/es/thing/src/Thing.js +5 -5
- package/es/thing/src/styles/index.cssr.js +11 -11
- package/es/time-picker/src/TimePicker.d.ts +19 -19
- package/es/time-picker/src/TimePicker.js +17 -17
- package/es/time-picker/src/styles/index.cssr.js +47 -47
- package/es/timeline/src/TimelineItem.d.ts +12 -12
- package/es/timeline/src/TimelineItem.js +12 -12
- package/es/timeline/src/styles/index.cssr.js +44 -44
- package/es/transfer/src/Transfer.d.ts +21 -21
- package/es/transfer/src/Transfer.js +21 -21
- package/es/transfer/src/TransferList.js +5 -7
- package/es/transfer/src/styles/index.cssr.js +47 -42
- package/es/tree/src/Tree.d.ts +11 -11
- package/es/tree/src/Tree.js +11 -11
- package/es/tree/src/dnd.js +2 -2
- package/es/tree/src/styles/index.cssr.js +33 -33
- package/es/tree-select/src/TreeSelect.d.ts +43 -6
- package/es/tree-select/src/TreeSelect.js +29 -14
- package/es/tree-select/src/styles/index.cssr.js +20 -11
- package/es/tree-select/styles/light.d.ts +6 -0
- package/es/tree-select/styles/light.js +5 -2
- package/es/typography/src/a.d.ts +2 -2
- package/es/typography/src/a.js +2 -2
- package/es/typography/src/blockquote.d.ts +5 -5
- package/es/typography/src/blockquote.js +5 -5
- package/es/typography/src/create-header.d.ts +8 -8
- package/es/typography/src/create-header.js +8 -8
- package/es/typography/src/headers.d.ts +48 -48
- package/es/typography/src/hr.d.ts +2 -1
- package/es/typography/src/hr.js +3 -1
- package/es/typography/src/ol.d.ts +7 -7
- package/es/typography/src/ol.js +7 -7
- package/es/typography/src/p.d.ts +5 -5
- package/es/typography/src/p.js +5 -5
- package/es/typography/src/styles/a.cssr.js +6 -6
- package/es/typography/src/styles/blockquote.cssr.js +11 -11
- package/es/typography/src/styles/header.cssr.js +19 -19
- package/es/typography/src/styles/hr.cssr.js +3 -3
- package/es/typography/src/styles/list.cssr.js +15 -15
- package/es/typography/src/styles/p.cssr.js +10 -10
- package/es/typography/src/styles/text.cssr.js +18 -18
- package/es/typography/src/text.d.ts +8 -7
- package/es/typography/src/text.js +9 -8
- package/es/typography/src/ul.d.ts +7 -7
- package/es/typography/src/ul.js +7 -7
- package/es/upload/src/Upload.d.ts +1 -1
- package/es/upload/src/Upload.js +16 -16
- package/es/upload/src/styles/index.cssr.js +36 -36
- package/es/version.d.ts +1 -1
- package/es/version.js +1 -1
- package/lib/_internal/clear/src/styles/index.cssr.js +10 -10
- package/lib/_internal/close/src/styles/index.cssr.js +8 -8
- package/lib/_internal/icons/Close.js +1 -1
- package/lib/_internal/scrollbar/src/ScrollBar.d.ts +10 -6
- package/lib/_internal/scrollbar/src/ScrollBar.js +15 -11
- package/lib/_internal/scrollbar/src/styles/index.cssr.js +15 -15
- package/lib/_internal/select-menu/src/SelectMenu.d.ts +21 -21
- package/lib/_internal/select-menu/src/SelectMenu.js +21 -21
- package/lib/_internal/select-menu/src/styles/index.cssr.js +35 -35
- package/lib/_internal/select-menu/styles/_common.js +1 -1
- package/lib/_internal/selection/src/Selection.d.ts +44 -44
- package/lib/_internal/selection/src/Selection.js +55 -53
- package/lib/_internal/selection/src/styles/index.cssr.js +84 -80
- package/lib/_mixins/common.d.ts +1 -0
- package/lib/_mixins/common.js +4 -0
- package/lib/_mixins/index.d.ts +1 -0
- package/lib/_mixins/index.js +3 -1
- package/lib/_mixins/use-css-vars-class.d.ts +2 -0
- package/lib/_mixins/use-css-vars-class.js +29 -0
- package/lib/_mixins/use-rtl.js +2 -0
- package/lib/_mixins/use-style.js +3 -0
- package/lib/_mixins/use-theme.js +3 -0
- package/lib/_utils/composable/use-houdini.js +12 -9
- package/lib/alert/src/Alert.d.ts +22 -22
- package/lib/alert/src/Alert.js +22 -22
- package/lib/alert/src/styles/index.cssr.js +45 -45
- package/lib/anchor/src/AnchorAdapter.js +12 -12
- package/lib/anchor/src/styles/index.cssr.js +41 -41
- package/lib/auto-complete/src/AutoComplete.d.ts +2 -2
- package/lib/auto-complete/src/AutoComplete.js +2 -2
- package/lib/auto-complete/src/styles/index.cssr.js +4 -4
- package/lib/avatar/index.d.ts +2 -0
- package/lib/avatar/index.js +3 -1
- package/lib/avatar/src/Avatar.d.ts +77 -36
- package/lib/avatar/src/Avatar.js +48 -17
- package/lib/avatar/src/AvatarGroup.d.ts +52 -0
- package/lib/avatar/src/AvatarGroup.js +67 -0
- package/lib/avatar/src/interface.d.ts +2 -0
- package/lib/avatar/src/interface.js +2 -0
- package/lib/avatar/src/styles/avatar-group.cssr.d.ts +2 -0
- package/lib/avatar/src/styles/avatar-group.cssr.js +21 -0
- package/lib/avatar/src/styles/index.cssr.js +20 -17
- package/lib/avatar/styles/light.d.ts +3 -0
- package/lib/avatar/styles/light.js +6 -2
- package/lib/back-top/src/BackTop.d.ts +13 -13
- package/lib/back-top/src/BackTop.js +13 -13
- package/lib/back-top/src/styles/index.cssr.js +29 -29
- package/lib/badge/src/Badge.d.ts +6 -6
- package/lib/badge/src/Badge.js +6 -6
- package/lib/badge/src/styles/index.cssr.js +15 -15
- package/lib/breadcrumb/src/Breadcrumb.d.ts +8 -8
- package/lib/breadcrumb/src/Breadcrumb.js +8 -8
- package/lib/breadcrumb/src/styles/index.cssr.js +23 -23
- package/lib/button/src/Button.d.ts +43 -38
- package/lib/button/src/Button.js +123 -115
- package/lib/button/src/styles/button.cssr.js +83 -80
- package/lib/button/styles/light.js +1 -1
- package/lib/calendar/src/Calendar.d.ts +23 -21
- package/lib/calendar/src/Calendar.js +21 -21
- package/lib/calendar/src/styles/index.cssr.js +57 -57
- package/lib/card/src/Card.d.ts +28 -23
- package/lib/card/src/Card.js +24 -23
- package/lib/card/src/styles/index.cssr.js +71 -69
- package/lib/carousel/src/Carousel.d.ts +5 -5
- package/lib/carousel/src/Carousel.js +5 -5
- package/lib/carousel/src/styles/index.cssr.js +10 -10
- package/lib/cascader/src/Cascader.d.ts +160 -17
- package/lib/cascader/src/Cascader.js +32 -24
- package/lib/cascader/src/CascaderMenu.d.ts +345 -0
- package/lib/cascader/src/CascaderMenu.js +7 -6
- package/lib/cascader/src/CascaderOption.d.ts +18 -0
- package/lib/cascader/src/CascaderSelectMenu.d.ts +18 -0
- package/lib/cascader/src/CascaderSubmenu.d.ts +18 -0
- package/lib/cascader/src/styles/index.cssr.js +44 -44
- package/lib/cascader/styles/dark.js +3 -1
- package/lib/cascader/styles/light.d.ts +13 -0
- package/lib/cascader/styles/light.js +4 -2
- package/lib/checkbox/src/Checkbox.d.ts +23 -23
- package/lib/checkbox/src/Checkbox.js +23 -23
- package/lib/checkbox/src/styles/index.cssr.js +58 -58
- package/lib/code/src/Code.d.ts +14 -14
- package/lib/code/src/Code.js +26 -17
- package/lib/code/src/styles/index.cssr.js +28 -28
- package/lib/collapse/src/Collapse.d.ts +8 -8
- package/lib/collapse/src/Collapse.js +8 -8
- package/lib/collapse/src/styles/index.cssr.js +24 -24
- package/lib/collapse-transition/src/CollapseTransition.d.ts +1 -1
- package/lib/collapse-transition/src/CollapseTransition.js +1 -1
- package/lib/color-picker/src/ColorPicker.d.ts +10 -10
- package/lib/color-picker/src/ColorPicker.js +10 -10
- package/lib/color-picker/src/styles/index.cssr.js +28 -28
- package/lib/components.d.ts +2 -0
- package/lib/components.js +2 -0
- package/lib/config-provider/src/ConfigProvider.d.ts +6 -0
- package/lib/countdown/index.d.ts +2 -0
- package/lib/countdown/index.js +8 -0
- package/lib/countdown/src/Countdown.d.ts +72 -0
- package/lib/countdown/src/Countdown.js +128 -0
- package/lib/countdown/src/utils.d.ts +0 -0
- package/lib/countdown/src/utils.js +1 -0
- package/lib/data-table/src/DataTable.d.ts +39 -39
- package/lib/data-table/src/DataTable.js +48 -54
- package/lib/data-table/src/MainTable.js +1 -2
- package/lib/data-table/src/TableParts/Body.d.ts +15 -4
- package/lib/data-table/src/TableParts/Body.js +80 -26
- package/lib/data-table/src/TableParts/Cell.js +2 -3
- package/lib/data-table/src/TableParts/Header.js +2 -2
- package/lib/data-table/src/interface.d.ts +4 -1
- package/lib/data-table/src/styles/index.cssr.js +133 -132
- package/lib/data-table/src/use-check.js +6 -2
- package/lib/data-table/src/use-scroll.d.ts +2 -0
- package/lib/data-table/src/use-scroll.js +34 -4
- package/lib/data-table/src/use-table-data.js +3 -1
- package/lib/data-table/styles/_common.js +1 -1
- package/lib/date-picker/src/DatePicker.d.ts +70 -46
- package/lib/date-picker/src/DatePicker.js +61 -52
- package/lib/date-picker/src/config.d.ts +1 -1
- package/lib/date-picker/src/interface.d.ts +2 -1
- package/lib/date-picker/src/panel/date.d.ts +13 -10
- package/lib/date-picker/src/panel/date.js +1 -1
- package/lib/date-picker/src/panel/daterange.d.ts +11 -9
- package/lib/date-picker/src/panel/daterange.js +1 -1
- package/lib/date-picker/src/panel/datetime.d.ts +13 -16
- package/lib/date-picker/src/panel/datetime.js +1 -1
- package/lib/date-picker/src/panel/datetimerange.d.ts +11 -9
- package/lib/date-picker/src/panel/datetimerange.js +2 -2
- package/lib/date-picker/src/panel/month.d.ts +17 -20
- package/lib/date-picker/src/panel/month.js +23 -12
- package/lib/date-picker/src/panel/use-calendar.d.ts +13 -39
- package/lib/date-picker/src/panel/use-calendar.js +40 -21
- package/lib/date-picker/src/panel/use-dual-calendar.d.ts +9 -36
- package/lib/date-picker/src/panel/use-dual-calendar.js +34 -19
- package/lib/date-picker/src/panel/use-panel-common.d.ts +9 -32
- package/lib/date-picker/src/panel/use-panel-common.js +5 -8
- package/lib/date-picker/src/styles/index.cssr.js +115 -115
- package/lib/date-picker/src/utils.d.ts +19 -3
- package/lib/date-picker/src/utils.js +41 -4
- package/lib/date-picker/styles/_common.d.ts +2 -0
- package/lib/date-picker/styles/_common.js +3 -1
- package/lib/date-picker/styles/light.d.ts +4 -0
- package/lib/descriptions/src/Descriptions.d.ts +18 -18
- package/lib/descriptions/src/Descriptions.js +19 -20
- package/lib/descriptions/src/styles/index.cssr.js +61 -61
- package/lib/dialog/src/Dialog.d.ts +24 -24
- package/lib/dialog/src/Dialog.js +22 -22
- package/lib/dialog/src/DialogEnvironment.d.ts +2 -2
- package/lib/dialog/src/DialogProvider.d.ts +1 -1
- package/lib/dialog/src/styles/index.cssr.js +45 -45
- package/lib/divider/src/Divider.d.ts +4 -4
- package/lib/divider/src/Divider.js +4 -4
- package/lib/divider/src/styles/index.cssr.js +12 -12
- package/lib/drawer/src/Drawer.d.ts +19 -19
- package/lib/drawer/src/Drawer.js +19 -19
- package/lib/drawer/src/styles/index.cssr.js +41 -40
- package/lib/dropdown/src/Dropdown.js +34 -32
- package/lib/dropdown/src/styles/index.cssr.js +59 -59
- package/lib/dynamic-tags/src/DynamicTags.d.ts +1 -1
- package/lib/dynamic-tags/src/DynamicTags.js +1 -1
- package/lib/dynamic-tags/src/styles/index.cssr.js +1 -1
- package/lib/empty/src/Empty.d.ts +19 -15
- package/lib/empty/src/Empty.js +12 -12
- package/lib/empty/src/styles/index.cssr.js +19 -18
- package/lib/form/src/Form.d.ts +27 -27
- package/lib/form/src/FormItem.d.ts +42 -42
- package/lib/form/src/FormItem.js +15 -15
- package/lib/form/src/FormItemCol.d.ts +33 -27
- package/lib/form/src/FormItemCol.js +1 -0
- package/lib/form/src/FormItemGridItem.d.ts +33 -27
- package/lib/form/src/FormItemGridItem.js +1 -0
- package/lib/form/src/FormItemRow.d.ts +33 -27
- package/lib/form/src/FormItemRow.js +1 -0
- package/lib/form/src/styles/form-item.cssr.js +37 -37
- package/lib/form/styles/_common.d.ts +0 -3
- package/lib/form/styles/_common.js +0 -3
- package/lib/form/styles/light.d.ts +3 -3
- package/lib/form/styles/light.js +2 -2
- package/lib/gradient-text/src/GradientText.d.ts +5 -5
- package/lib/gradient-text/src/GradientText.js +5 -5
- package/lib/gradient-text/src/styles/index.cssr.js +9 -9
- package/lib/icon/src/Icon.d.ts +6 -6
- package/lib/icon/src/Icon.js +4 -4
- package/lib/icon/src/styles/index.cssr.js +7 -7
- package/lib/image/src/Image.js +7 -11
- package/lib/image/src/ImagePreview.d.ts +2 -2
- package/lib/image/src/ImagePreview.js +12 -11
- package/lib/image/src/styles/index.cssr.js +5 -5
- package/lib/input/src/Input.d.ts +52 -47
- package/lib/input/src/Input.js +54 -49
- package/lib/input/src/InputGroupLabel.d.ts +8 -8
- package/lib/input/src/InputGroupLabel.js +8 -8
- package/lib/input/src/styles/input-group-label.cssr.js +18 -18
- package/lib/input/src/styles/input.cssr.js +108 -109
- package/lib/input-number/src/InputNumber.d.ts +11 -0
- package/lib/input-number/src/InputNumber.js +5 -2
- package/lib/input-number/src/utils.js +2 -1
- package/lib/layout/src/Layout.d.ts +6 -6
- package/lib/layout/src/Layout.js +3 -3
- package/lib/layout/src/LayoutContent.d.ts +3 -3
- package/lib/layout/src/LayoutFooter.js +7 -7
- package/lib/layout/src/LayoutHeader.js +7 -7
- package/lib/layout/src/LayoutSider.js +13 -13
- package/lib/layout/src/styles/layout-footer.cssr.js +11 -11
- package/lib/layout/src/styles/layout-header.cssr.js +11 -11
- package/lib/layout/src/styles/layout-sider.cssr.js +32 -32
- package/lib/layout/src/styles/layout.cssr.js +8 -8
- package/lib/list/src/List.d.ts +10 -10
- package/lib/list/src/List.js +10 -10
- package/lib/list/src/styles/index.cssr.js +30 -30
- package/lib/loading-bar/src/LoadingBar.d.ts +3 -3
- package/lib/loading-bar/src/LoadingBar.js +3 -3
- package/lib/loading-bar/src/styles/index.cssr.js +7 -7
- package/lib/locales/common/deDE.js +2 -0
- package/lib/locales/common/enUS.d.ts +2 -0
- package/lib/locales/common/enUS.js +2 -0
- package/lib/locales/common/frFR.js +7 -5
- package/lib/locales/common/idID.js +2 -0
- package/lib/locales/common/jaJP.js +2 -0
- package/lib/locales/common/nbNO.js +2 -0
- package/lib/locales/common/ruRU.js +2 -0
- package/lib/locales/common/ukUA.js +2 -0
- package/lib/locales/common/zhCN.js +2 -0
- package/lib/locales/common/zhTW.d.ts +3 -0
- package/lib/locales/common/zhTW.js +102 -0
- package/lib/locales/date/zhTW.d.ts +3 -0
- package/lib/locales/date/zhTW.js +11 -0
- package/lib/locales/index.d.ts +2 -0
- package/lib/locales/index.js +5 -1
- package/lib/log/src/Log.d.ts +6 -6
- package/lib/log/src/Log.js +6 -6
- package/lib/log/src/styles/index.cssr.js +16 -18
- package/lib/mention/src/Mention.d.ts +1 -1
- package/lib/mention/src/Mention.js +1 -1
- package/lib/mention/src/styles/index.cssr.js +2 -2
- package/lib/menu/src/Menu.js +43 -40
- package/lib/menu/src/styles/index.cssr.js +71 -71
- package/lib/message/src/Message.d.ts +22 -22
- package/lib/message/src/Message.js +22 -22
- package/lib/message/src/styles/index.cssr.js +48 -48
- package/lib/modal/src/BodyWrapper.d.ts +11 -2
- package/lib/modal/src/BodyWrapper.js +23 -17
- package/lib/modal/src/Modal.d.ts +14 -8
- package/lib/modal/src/Modal.js +13 -7
- package/lib/modal/src/presetProps.d.ts +2 -1
- package/lib/modal/src/styles/index.cssr.js +8 -8
- package/lib/notification/src/Notification.d.ts +24 -24
- package/lib/notification/src/Notification.js +24 -24
- package/lib/notification/src/styles/index.cssr.js +65 -65
- package/lib/number-animation/index.d.ts +3 -0
- package/lib/number-animation/index.js +8 -0
- package/lib/number-animation/src/NumberAnimation.d.ts +79 -0
- package/lib/number-animation/src/NumberAnimation.js +83 -0
- package/lib/number-animation/src/utils.d.ts +8 -0
- package/lib/number-animation/src/utils.js +21 -0
- package/lib/page-header/src/PageHeader.d.ts +10 -10
- package/lib/page-header/src/PageHeader.js +13 -13
- package/lib/page-header/src/styles/index.cssr.js +25 -27
- package/lib/pagination/src/Pagination.d.ts +42 -41
- package/lib/pagination/src/Pagination.js +52 -45
- package/lib/pagination/src/styles/index.cssr.js +81 -81
- package/lib/popconfirm/src/Popconfirm.d.ts +2 -2
- package/lib/popconfirm/src/PopconfirmPanel.d.ts +4 -4
- package/lib/popconfirm/src/PopconfirmPanel.js +4 -4
- package/lib/popconfirm/src/styles/index.cssr.js +8 -8
- package/lib/popover/src/Popover.js +4 -1
- package/lib/popover/src/PopoverBody.js +18 -18
- package/lib/popover/src/styles/index.cssr.js +62 -62
- package/lib/popselect/src/Popselect.d.ts +2 -11
- package/lib/popselect/src/Popselect.js +2 -2
- package/lib/popselect/src/PopselectPanel.d.ts +3 -11
- package/lib/popselect/src/PopselectPanel.js +16 -10
- package/lib/progress/src/Progress.d.ts +14 -14
- package/lib/progress/src/Progress.js +14 -14
- package/lib/progress/src/styles/index.cssr.js +53 -53
- package/lib/radio/src/Radio.d.ts +15 -15
- package/lib/radio/src/Radio.js +18 -18
- package/lib/radio/src/RadioButton.js +4 -5
- package/lib/radio/src/RadioGroup.d.ts +14 -14
- package/lib/radio/src/RadioGroup.js +14 -14
- package/lib/radio/src/styles/radio-group.cssr.js +51 -47
- package/lib/radio/src/styles/radio.cssr.js +44 -40
- package/lib/radio/src/use-radio.d.ts +0 -3
- package/lib/radio/src/use-radio.js +1 -26
- package/lib/rate/src/Rate.d.ts +4 -4
- package/lib/rate/src/Rate.js +4 -4
- package/lib/rate/src/styles/index.cssr.js +11 -11
- package/lib/result/src/Result.d.ts +9 -9
- package/lib/result/src/Result.js +9 -9
- package/lib/result/src/styles/index.cssr.js +20 -20
- package/lib/select/src/Select.d.ts +1 -1
- package/lib/select/src/Select.js +1 -1
- package/lib/select/src/styles/index.cssr.js +2 -2
- package/lib/skeleton/src/Skeleton.d.ts +3 -3
- package/lib/skeleton/src/Skeleton.js +3 -3
- package/lib/skeleton/src/styles/index.cssr.js +12 -12
- package/lib/slider/src/Slider.d.ts +29 -29
- package/lib/slider/src/Slider.js +29 -29
- package/lib/slider/src/styles/index.cssr.js +87 -87
- package/lib/spin/src/Spin.d.ts +5 -5
- package/lib/spin/src/Spin.js +5 -5
- package/lib/spin/src/styles/index.cssr.js +15 -15
- package/lib/statistic/src/Statistic.d.ts +25 -45
- package/lib/statistic/src/Statistic.js +12 -19
- package/lib/statistic/src/styles/index.cssr.js +19 -19
- package/lib/steps/src/Step.d.ts +12 -12
- package/lib/steps/src/Step.js +12 -12
- package/lib/steps/src/styles/index.cssr.js +46 -46
- package/lib/switch/src/Switch.d.ts +19 -19
- package/lib/switch/src/Switch.js +26 -19
- package/lib/switch/src/styles/index.cssr.js +59 -57
- package/lib/table/src/Table.d.ts +21 -21
- package/lib/table/src/Table.js +21 -21
- package/lib/table/src/styles/index.cssr.js +55 -55
- package/lib/tabs/src/styles/index.cssr.js +5 -1
- package/lib/tabs/styles/light.js +1 -1
- package/lib/tag/src/Tag.d.ts +27 -26
- package/lib/tag/src/Tag.js +27 -26
- package/lib/tag/src/styles/index.cssr.js +55 -55
- package/lib/tag/src/styles/rtl.cssr.js +1 -1
- package/lib/thing/src/Thing.js +5 -5
- package/lib/thing/src/styles/index.cssr.js +11 -11
- package/lib/time-picker/src/TimePicker.d.ts +19 -19
- package/lib/time-picker/src/TimePicker.js +17 -17
- package/lib/time-picker/src/styles/index.cssr.js +47 -47
- package/lib/timeline/src/TimelineItem.d.ts +12 -12
- package/lib/timeline/src/TimelineItem.js +12 -12
- package/lib/timeline/src/styles/index.cssr.js +44 -44
- package/lib/transfer/src/Transfer.d.ts +21 -21
- package/lib/transfer/src/Transfer.js +21 -21
- package/lib/transfer/src/TransferList.js +5 -7
- package/lib/transfer/src/styles/index.cssr.js +47 -42
- package/lib/tree/src/Tree.d.ts +11 -11
- package/lib/tree/src/Tree.js +11 -11
- package/lib/tree/src/dnd.js +2 -2
- package/lib/tree/src/styles/index.cssr.js +33 -33
- package/lib/tree-select/src/TreeSelect.d.ts +43 -6
- package/lib/tree-select/src/TreeSelect.js +28 -13
- package/lib/tree-select/src/styles/index.cssr.js +20 -11
- package/lib/tree-select/styles/light.d.ts +6 -0
- package/lib/tree-select/styles/light.js +5 -2
- package/lib/typography/src/a.d.ts +2 -2
- package/lib/typography/src/a.js +2 -2
- package/lib/typography/src/blockquote.d.ts +5 -5
- package/lib/typography/src/blockquote.js +5 -5
- package/lib/typography/src/create-header.d.ts +8 -8
- package/lib/typography/src/create-header.js +8 -8
- package/lib/typography/src/headers.d.ts +48 -48
- package/lib/typography/src/hr.d.ts +2 -1
- package/lib/typography/src/hr.js +3 -1
- package/lib/typography/src/ol.d.ts +7 -7
- package/lib/typography/src/ol.js +7 -7
- package/lib/typography/src/p.d.ts +5 -5
- package/lib/typography/src/p.js +5 -5
- package/lib/typography/src/styles/a.cssr.js +6 -6
- package/lib/typography/src/styles/blockquote.cssr.js +11 -11
- package/lib/typography/src/styles/header.cssr.js +19 -19
- package/lib/typography/src/styles/hr.cssr.js +3 -3
- package/lib/typography/src/styles/list.cssr.js +15 -15
- package/lib/typography/src/styles/p.cssr.js +10 -10
- package/lib/typography/src/styles/text.cssr.js +18 -18
- package/lib/typography/src/text.d.ts +8 -7
- package/lib/typography/src/text.js +9 -8
- package/lib/typography/src/ul.d.ts +7 -7
- package/lib/typography/src/ul.js +7 -7
- package/lib/upload/src/Upload.d.ts +1 -1
- package/lib/upload/src/Upload.js +16 -16
- package/lib/upload/src/styles/index.cssr.js +36 -36
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +38 -36
- package/web-types.json +252 -11
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const vue_1 = require("vue");
|
|
4
|
+
const countdownProps = {
|
|
5
|
+
label: String,
|
|
6
|
+
duration: {
|
|
7
|
+
type: Number,
|
|
8
|
+
default: 0
|
|
9
|
+
},
|
|
10
|
+
active: {
|
|
11
|
+
type: Boolean,
|
|
12
|
+
default: true
|
|
13
|
+
},
|
|
14
|
+
precision: {
|
|
15
|
+
type: Number,
|
|
16
|
+
default: 0
|
|
17
|
+
},
|
|
18
|
+
render: Function,
|
|
19
|
+
onFinish: Function
|
|
20
|
+
};
|
|
21
|
+
exports.default = (0, vue_1.defineComponent)({
|
|
22
|
+
name: 'Countdown',
|
|
23
|
+
props: countdownProps,
|
|
24
|
+
setup(props) {
|
|
25
|
+
let timerId = null;
|
|
26
|
+
let rafId = null;
|
|
27
|
+
let elapsed = 0;
|
|
28
|
+
let finished = false;
|
|
29
|
+
const timeInfo = (0, vue_1.reactive)({
|
|
30
|
+
hours: 0,
|
|
31
|
+
minutes: 0,
|
|
32
|
+
seconds: 0,
|
|
33
|
+
milliseconds: 0
|
|
34
|
+
});
|
|
35
|
+
deriveDisplayValue(props.duration);
|
|
36
|
+
let pnow = -1;
|
|
37
|
+
function getDistance(time) {
|
|
38
|
+
return props.duration - elapsed + pnow - time;
|
|
39
|
+
}
|
|
40
|
+
function deriveDisplayValue(distance) {
|
|
41
|
+
const hours = Math.floor(distance / 3600000);
|
|
42
|
+
const minutes = Math.floor((distance % 3600000) / 60000);
|
|
43
|
+
const seconds = Math.floor((distance % 60000) / 1000);
|
|
44
|
+
const milliseconds = Math.floor(distance % 1000);
|
|
45
|
+
timeInfo.hours = hours;
|
|
46
|
+
timeInfo.minutes = minutes;
|
|
47
|
+
timeInfo.seconds = seconds;
|
|
48
|
+
timeInfo.milliseconds = milliseconds;
|
|
49
|
+
}
|
|
50
|
+
function getDisplayValue(info) {
|
|
51
|
+
const { hours, minutes, seconds, milliseconds } = info;
|
|
52
|
+
const { precision } = props;
|
|
53
|
+
switch (precision) {
|
|
54
|
+
case 0:
|
|
55
|
+
return `${String(hours).padStart(2, '0')}:${String(minutes).padStart(2, '0')}:${String(seconds).padStart(2, '0')}`;
|
|
56
|
+
default:
|
|
57
|
+
return `${String(hours).padStart(2, '0')}:${String(minutes).padStart(2, '0')}:${String(seconds).padStart(2, '0')}.${String(Math.floor(milliseconds / (precision === 1 ? 100 : precision === 2 ? 10 : 1))).padStart(precision, '0')}`;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
const frame = () => {
|
|
61
|
+
var _a;
|
|
62
|
+
const { precision } = props;
|
|
63
|
+
const distance = getDistance(performance.now());
|
|
64
|
+
if (distance <= 0) {
|
|
65
|
+
deriveDisplayValue(0);
|
|
66
|
+
stopTimer();
|
|
67
|
+
if (!finished) {
|
|
68
|
+
(_a = props.onFinish) === null || _a === void 0 ? void 0 : _a.call(props);
|
|
69
|
+
finished = true;
|
|
70
|
+
}
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
let leftTime;
|
|
74
|
+
switch (precision) {
|
|
75
|
+
case 3:
|
|
76
|
+
case 2:
|
|
77
|
+
leftTime = distance % 34; // about 30 fps
|
|
78
|
+
break;
|
|
79
|
+
case 1:
|
|
80
|
+
leftTime = distance % 100;
|
|
81
|
+
break;
|
|
82
|
+
default:
|
|
83
|
+
leftTime = distance % 1000;
|
|
84
|
+
}
|
|
85
|
+
deriveDisplayValue(distance);
|
|
86
|
+
timerId = window.setTimeout(() => {
|
|
87
|
+
frame();
|
|
88
|
+
}, leftTime);
|
|
89
|
+
};
|
|
90
|
+
const stopTimer = () => {
|
|
91
|
+
if (timerId !== null) {
|
|
92
|
+
window.clearTimeout(timerId);
|
|
93
|
+
timerId = null;
|
|
94
|
+
}
|
|
95
|
+
if (rafId !== null) {
|
|
96
|
+
window.cancelAnimationFrame(rafId);
|
|
97
|
+
rafId = null;
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
(0, vue_1.onMounted)(() => {
|
|
101
|
+
(0, vue_1.watchEffect)(() => {
|
|
102
|
+
if (props.active) {
|
|
103
|
+
pnow = performance.now();
|
|
104
|
+
frame();
|
|
105
|
+
}
|
|
106
|
+
else {
|
|
107
|
+
const now = performance.now();
|
|
108
|
+
if (pnow !== -1) {
|
|
109
|
+
elapsed += now - pnow;
|
|
110
|
+
}
|
|
111
|
+
stopTimer();
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
});
|
|
115
|
+
(0, vue_1.onBeforeUnmount)(() => {
|
|
116
|
+
stopTimer();
|
|
117
|
+
});
|
|
118
|
+
return () => {
|
|
119
|
+
const { render } = props;
|
|
120
|
+
if (render) {
|
|
121
|
+
return render(timeInfo);
|
|
122
|
+
}
|
|
123
|
+
else {
|
|
124
|
+
return getDisplayValue(timeInfo);
|
|
125
|
+
}
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
});
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -3817,45 +3817,45 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
3817
3817
|
}>>>;
|
|
3818
3818
|
}, {
|
|
3819
3819
|
cssVars: import("vue").ComputedRef<{
|
|
3820
|
-
'--font-size': string;
|
|
3821
|
-
'--th-padding': string;
|
|
3822
|
-
'--td-padding': string;
|
|
3823
|
-
'--bezier': string;
|
|
3824
|
-
'--border-radius': string;
|
|
3825
|
-
'--line-height': string;
|
|
3826
|
-
'--border-color': string;
|
|
3827
|
-
'--border-color-modal': string;
|
|
3828
|
-
'--border-color-popover': string;
|
|
3829
|
-
'--th-color': string;
|
|
3830
|
-
'--th-color-hover': string;
|
|
3831
|
-
'--th-color-modal': string;
|
|
3832
|
-
'--th-color-hover-modal': string;
|
|
3833
|
-
'--th-color-popover': string;
|
|
3834
|
-
'--th-color-hover-popover': string;
|
|
3835
|
-
'--td-color': string;
|
|
3836
|
-
'--td-color-hover': string;
|
|
3837
|
-
'--td-color-modal': string;
|
|
3838
|
-
'--td-color-hover-modal': string;
|
|
3839
|
-
'--td-color-popover': string;
|
|
3840
|
-
'--td-color-hover-popover': string;
|
|
3841
|
-
'--th-text-color': string;
|
|
3842
|
-
'--td-text-color': string;
|
|
3843
|
-
'--th-font-weight': string;
|
|
3844
|
-
'--th-button-color-hover': string;
|
|
3845
|
-
'--th-icon-color': string;
|
|
3846
|
-
'--th-icon-color-active': string;
|
|
3847
|
-
'--filter-size': string;
|
|
3848
|
-
'--pagination-margin': string;
|
|
3849
|
-
'--empty-padding': string;
|
|
3850
|
-
'--box-shadow-before': string;
|
|
3851
|
-
'--box-shadow-after': string;
|
|
3852
|
-
'--sorter-size': string;
|
|
3853
|
-
'--loading-size': string;
|
|
3854
|
-
'--loading-color': string;
|
|
3855
|
-
'--opacity-loading': string;
|
|
3856
|
-
'--td-color-striped': string;
|
|
3857
|
-
'--td-color-striped-modal': string;
|
|
3858
|
-
'--td-color-striped-popover': string;
|
|
3820
|
+
'--n-font-size': string;
|
|
3821
|
+
'--n-th-padding': string;
|
|
3822
|
+
'--n-td-padding': string;
|
|
3823
|
+
'--n-bezier': string;
|
|
3824
|
+
'--n-border-radius': string;
|
|
3825
|
+
'--n-line-height': string;
|
|
3826
|
+
'--n-border-color': string;
|
|
3827
|
+
'--n-border-color-modal': string;
|
|
3828
|
+
'--n-border-color-popover': string;
|
|
3829
|
+
'--n-th-color': string;
|
|
3830
|
+
'--n-th-color-hover': string;
|
|
3831
|
+
'--n-th-color-modal': string;
|
|
3832
|
+
'--n-th-color-hover-modal': string;
|
|
3833
|
+
'--n-th-color-popover': string;
|
|
3834
|
+
'--n-th-color-hover-popover': string;
|
|
3835
|
+
'--n-td-color': string;
|
|
3836
|
+
'--n-td-color-hover': string;
|
|
3837
|
+
'--n-td-color-modal': string;
|
|
3838
|
+
'--n-td-color-hover-modal': string;
|
|
3839
|
+
'--n-n-td-color-popover': string;
|
|
3840
|
+
'--n-td-color-hover-popover': string;
|
|
3841
|
+
'--n-th-text-color': string;
|
|
3842
|
+
'--n-td-text-color': string;
|
|
3843
|
+
'--n-th-font-weight': string;
|
|
3844
|
+
'--n-th-button-color-hover': string;
|
|
3845
|
+
'--n-th-icon-color': string;
|
|
3846
|
+
'--n-th-icon-color-active': string;
|
|
3847
|
+
'--n-filter-size': string;
|
|
3848
|
+
'--n-pagination-margin': string;
|
|
3849
|
+
'--n-empty-padding': string;
|
|
3850
|
+
'--n-box-shadow-before': string;
|
|
3851
|
+
'--n-box-shadow-after': string;
|
|
3852
|
+
'--n-sorter-size': string;
|
|
3853
|
+
'--n-loading-size': string;
|
|
3854
|
+
'--n-loading-color': string;
|
|
3855
|
+
'--n-opacity-loading': string;
|
|
3856
|
+
'--n-td-color-striped': string;
|
|
3857
|
+
'--n-td-color-striped-modal': string;
|
|
3858
|
+
'--n-td-color-striped-popover': string;
|
|
3859
3859
|
}>;
|
|
3860
3860
|
filter: (filters: import("./interface").FilterState | null) => void;
|
|
3861
3861
|
filters: (filters: import("./interface").FilterState | null) => void;
|
|
@@ -8,7 +8,6 @@ const vue_1 = require("vue");
|
|
|
8
8
|
const seemly_1 = require("seemly");
|
|
9
9
|
const _mixins_1 = require("../../_mixins");
|
|
10
10
|
const _internal_1 = require("../../_internal");
|
|
11
|
-
const empty_1 = require("../../empty");
|
|
12
11
|
const pagination_1 = require("../../pagination");
|
|
13
12
|
const _utils_1 = require("../../_utils");
|
|
14
13
|
const styles_1 = require("../styles");
|
|
@@ -113,7 +112,7 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
113
112
|
name: 'DataTable',
|
|
114
113
|
alias: ['AdvancedTable'],
|
|
115
114
|
props: exports.dataTableProps,
|
|
116
|
-
setup(props) {
|
|
115
|
+
setup(props, { slots }) {
|
|
117
116
|
const { mergedBorderedRef, mergedClsPrefixRef } = (0, _mixins_1.useConfig)(props);
|
|
118
117
|
const mergedBottomBorderedRef = (0, vue_1.computed)(() => {
|
|
119
118
|
const { bottomBordered } = props;
|
|
@@ -137,7 +136,7 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
137
136
|
paginatedDataRef
|
|
138
137
|
});
|
|
139
138
|
const { mergedExpandedRowKeysRef, renderExpandRef, doUpdateExpandedRowKeys } = (0, use_expand_1.useExpand)(props);
|
|
140
|
-
const { handleTableBodyScroll, handleTableHeaderScroll, syncScrollState, setHeaderScrollLeft, leftActiveFixedColKeyRef, rightActiveFixedColKeyRef, leftFixedColumnsRef, rightFixedColumnsRef, fixedColumnLeftMapRef, fixedColumnRightMapRef } = (0, use_scroll_1.useScroll)(props, {
|
|
139
|
+
const { handleTableBodyScroll, handleTableHeaderScroll, syncScrollState, setHeaderScrollLeft, leftActiveFixedColKeyRef, leftActiveFixedChildrenColKeysRef, rightActiveFixedColKeyRef, rightActiveFixedChildrenColKeysRef, leftFixedColumnsRef, rightFixedColumnsRef, fixedColumnLeftMapRef, fixedColumnRightMapRef } = (0, use_scroll_1.useScroll)(props, {
|
|
141
140
|
scrollPartRef,
|
|
142
141
|
bodyWidthRef,
|
|
143
142
|
mainTableInstRef,
|
|
@@ -157,6 +156,7 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
157
156
|
return props.tableLayout;
|
|
158
157
|
});
|
|
159
158
|
(0, vue_1.provide)(interface_1.dataTableInjectionKey, {
|
|
159
|
+
slots,
|
|
160
160
|
indentRef: (0, vue_1.toRef)(props, 'indent'),
|
|
161
161
|
firstContentfulColIndexRef,
|
|
162
162
|
bodyWidthRef,
|
|
@@ -169,7 +169,9 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
169
169
|
colsRef,
|
|
170
170
|
paginatedDataRef,
|
|
171
171
|
leftActiveFixedColKeyRef,
|
|
172
|
+
leftActiveFixedChildrenColKeysRef,
|
|
172
173
|
rightActiveFixedColKeyRef,
|
|
174
|
+
rightActiveFixedChildrenColKeysRef,
|
|
173
175
|
leftFixedColumnsRef,
|
|
174
176
|
rightFixedColumnsRef,
|
|
175
177
|
fixedColumnLeftMapRef,
|
|
@@ -204,9 +206,9 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
204
206
|
const { self: { actionDividerColor, actionPadding, actionButtonMargin } } = themeRef.value;
|
|
205
207
|
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions
|
|
206
208
|
return {
|
|
207
|
-
'--action-padding': actionPadding,
|
|
208
|
-
'--action-button-margin': actionButtonMargin,
|
|
209
|
-
'--action-divider-color': actionDividerColor
|
|
209
|
+
'--n-action-padding': actionPadding,
|
|
210
|
+
'--n-action-button-margin': actionButtonMargin,
|
|
211
|
+
'--n-action-divider-color': actionDividerColor
|
|
210
212
|
};
|
|
211
213
|
}),
|
|
212
214
|
mergedTableLayoutRef,
|
|
@@ -239,45 +241,45 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
239
241
|
const { size } = props;
|
|
240
242
|
const { common: { cubicBezierEaseInOut }, self: { borderColor, tdColorHover, thColor, thColorHover, tdColor, tdTextColor, thTextColor, thFontWeight, thButtonColorHover, thIconColor, thIconColorActive, filterSize, borderRadius, lineHeight, tdColorModal, thColorModal, borderColorModal, thColorHoverModal, tdColorHoverModal, borderColorPopover, thColorPopover, tdColorPopover, tdColorHoverPopover, thColorHoverPopover, paginationMargin, emptyPadding, boxShadowAfter, boxShadowBefore, sorterSize, loadingColor, loadingSize, opacityLoading, tdColorStriped, tdColorStripedModal, tdColorStripedPopover, [(0, _utils_1.createKey)('fontSize', size)]: fontSize, [(0, _utils_1.createKey)('thPadding', size)]: thPadding, [(0, _utils_1.createKey)('tdPadding', size)]: tdPadding } } = themeRef.value;
|
|
241
243
|
return {
|
|
242
|
-
'--font-size': fontSize,
|
|
243
|
-
'--th-padding': thPadding,
|
|
244
|
-
'--td-padding': tdPadding,
|
|
245
|
-
'--bezier': cubicBezierEaseInOut,
|
|
246
|
-
'--border-radius': borderRadius,
|
|
247
|
-
'--line-height': lineHeight,
|
|
248
|
-
'--border-color': borderColor,
|
|
249
|
-
'--border-color-modal': borderColorModal,
|
|
250
|
-
'--border-color-popover': borderColorPopover,
|
|
251
|
-
'--th-color': thColor,
|
|
252
|
-
'--th-color-hover': thColorHover,
|
|
253
|
-
'--th-color-modal': thColorModal,
|
|
254
|
-
'--th-color-hover-modal': thColorHoverModal,
|
|
255
|
-
'--th-color-popover': thColorPopover,
|
|
256
|
-
'--th-color-hover-popover': thColorHoverPopover,
|
|
257
|
-
'--td-color': tdColor,
|
|
258
|
-
'--td-color-hover': tdColorHover,
|
|
259
|
-
'--td-color-modal': tdColorModal,
|
|
260
|
-
'--td-color-hover-modal': tdColorHoverModal,
|
|
261
|
-
'--td-color-popover': tdColorPopover,
|
|
262
|
-
'--td-color-hover-popover': tdColorHoverPopover,
|
|
263
|
-
'--th-text-color': thTextColor,
|
|
264
|
-
'--td-text-color': tdTextColor,
|
|
265
|
-
'--th-font-weight': thFontWeight,
|
|
266
|
-
'--th-button-color-hover': thButtonColorHover,
|
|
267
|
-
'--th-icon-color': thIconColor,
|
|
268
|
-
'--th-icon-color-active': thIconColorActive,
|
|
269
|
-
'--filter-size': filterSize,
|
|
270
|
-
'--pagination-margin': paginationMargin,
|
|
271
|
-
'--empty-padding': emptyPadding,
|
|
272
|
-
'--box-shadow-before': boxShadowBefore,
|
|
273
|
-
'--box-shadow-after': boxShadowAfter,
|
|
274
|
-
'--sorter-size': sorterSize,
|
|
275
|
-
'--loading-size': loadingSize,
|
|
276
|
-
'--loading-color': loadingColor,
|
|
277
|
-
'--opacity-loading': opacityLoading,
|
|
278
|
-
'--td-color-striped': tdColorStriped,
|
|
279
|
-
'--td-color-striped-modal': tdColorStripedModal,
|
|
280
|
-
'--td-color-striped-popover': tdColorStripedPopover
|
|
244
|
+
'--n-font-size': fontSize,
|
|
245
|
+
'--n-th-padding': thPadding,
|
|
246
|
+
'--n-td-padding': tdPadding,
|
|
247
|
+
'--n-bezier': cubicBezierEaseInOut,
|
|
248
|
+
'--n-border-radius': borderRadius,
|
|
249
|
+
'--n-line-height': lineHeight,
|
|
250
|
+
'--n-border-color': borderColor,
|
|
251
|
+
'--n-border-color-modal': borderColorModal,
|
|
252
|
+
'--n-border-color-popover': borderColorPopover,
|
|
253
|
+
'--n-th-color': thColor,
|
|
254
|
+
'--n-th-color-hover': thColorHover,
|
|
255
|
+
'--n-th-color-modal': thColorModal,
|
|
256
|
+
'--n-th-color-hover-modal': thColorHoverModal,
|
|
257
|
+
'--n-th-color-popover': thColorPopover,
|
|
258
|
+
'--n-th-color-hover-popover': thColorHoverPopover,
|
|
259
|
+
'--n-td-color': tdColor,
|
|
260
|
+
'--n-td-color-hover': tdColorHover,
|
|
261
|
+
'--n-td-color-modal': tdColorModal,
|
|
262
|
+
'--n-td-color-hover-modal': tdColorHoverModal,
|
|
263
|
+
'--n-n-td-color-popover': tdColorPopover,
|
|
264
|
+
'--n-td-color-hover-popover': tdColorHoverPopover,
|
|
265
|
+
'--n-th-text-color': thTextColor,
|
|
266
|
+
'--n-td-text-color': tdTextColor,
|
|
267
|
+
'--n-th-font-weight': thFontWeight,
|
|
268
|
+
'--n-th-button-color-hover': thButtonColorHover,
|
|
269
|
+
'--n-th-icon-color': thIconColor,
|
|
270
|
+
'--n-th-icon-color-active': thIconColorActive,
|
|
271
|
+
'--n-filter-size': filterSize,
|
|
272
|
+
'--n-pagination-margin': paginationMargin,
|
|
273
|
+
'--n-empty-padding': emptyPadding,
|
|
274
|
+
'--n-box-shadow-before': boxShadowBefore,
|
|
275
|
+
'--n-box-shadow-after': boxShadowAfter,
|
|
276
|
+
'--n-sorter-size': sorterSize,
|
|
277
|
+
'--n-loading-size': loadingSize,
|
|
278
|
+
'--n-loading-color': loadingColor,
|
|
279
|
+
'--n-opacity-loading': opacityLoading,
|
|
280
|
+
'--n-td-color-striped': tdColorStriped,
|
|
281
|
+
'--n-td-color-striped-modal': tdColorStripedModal,
|
|
282
|
+
'--n-td-color-striped-popover': tdColorStripedPopover
|
|
281
283
|
};
|
|
282
284
|
}) });
|
|
283
285
|
},
|
|
@@ -295,15 +297,7 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
295
297
|
}
|
|
296
298
|
], style: this.cssVars },
|
|
297
299
|
(0, vue_1.h)("div", { class: `${mergedClsPrefix}-data-table-wrapper` },
|
|
298
|
-
(0, vue_1.h)(MainTable_1.default, { ref: "mainTableInstRef" },
|
|
299
|
-
default: () => this.paginatedData.length === 0 ? ((0, vue_1.h)("div", { class: [
|
|
300
|
-
`${mergedClsPrefix}-data-table-empty`,
|
|
301
|
-
this.loading &&
|
|
302
|
-
`${mergedClsPrefix}-data-table-empty--hide`
|
|
303
|
-
] }, (0, vue_1.renderSlot)(this.$slots, 'empty', undefined, () => [
|
|
304
|
-
(0, vue_1.h)(empty_1.NEmpty, { theme: this.mergedTheme.peers.Empty, themeOverrides: this.mergedTheme.peerOverrides.Empty })
|
|
305
|
-
]))) : null
|
|
306
|
-
})),
|
|
300
|
+
(0, vue_1.h)(MainTable_1.default, { ref: "mainTableInstRef" })),
|
|
307
301
|
this.pagination ? ((0, vue_1.h)("div", { class: `${mergedClsPrefix}-data-table__pagination` },
|
|
308
302
|
(0, vue_1.h)(pagination_1.NPagination, Object.assign({ theme: this.mergedTheme.peers.Pagination, themeOverrides: this.mergedTheme.peerOverrides.Pagination, disabled: this.loading }, this.mergedPagination)))) : null,
|
|
309
303
|
(0, vue_1.h)(vue_1.Transition, { name: "fade-in-scale-up-transition" }, {
|
|
@@ -72,7 +72,6 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
72
72
|
const headerInBody = maxHeight === undefined && !flexHeight;
|
|
73
73
|
return ((0, vue_1.h)("div", { class: `${mergedClsPrefix}-data-table-base-table`, ref: "selfElRef" },
|
|
74
74
|
headerInBody ? null : (0, vue_1.h)(Header_1.default, { ref: "headerInstRef" }),
|
|
75
|
-
(0, vue_1.h)(Body_1.default, { ref: "bodyInstRef",
|
|
76
|
-
(0, vue_1.renderSlot)(this.$slots, 'default')));
|
|
75
|
+
(0, vue_1.h)(Body_1.default, { ref: "bodyInstRef", bodyStyle: this.bodyStyle, showHeader: headerInBody, flexHeight: flexHeight, onResize: this.handleBodyResize })));
|
|
77
76
|
}
|
|
78
77
|
});
|
|
@@ -1,12 +1,16 @@
|
|
|
1
|
-
import { PropType } from 'vue';
|
|
2
|
-
import { RowKey, TmNode } from '../interface';
|
|
1
|
+
import { PropType, CSSProperties } from 'vue';
|
|
2
|
+
import { RowKey, ColumnKey, TmNode } from '../interface';
|
|
3
3
|
import type { ColItem } from '../use-group-header';
|
|
4
4
|
declare const _default: import("vue").DefineComponent<{
|
|
5
5
|
onResize: PropType<(e: ResizeObserverEntry) => void>;
|
|
6
6
|
showHeader: BooleanConstructor;
|
|
7
7
|
flexHeight: BooleanConstructor;
|
|
8
|
+
bodyStyle: PropType<CSSProperties>;
|
|
8
9
|
}, {
|
|
9
10
|
getScrollContainer: () => HTMLElement | null;
|
|
11
|
+
dataTableSlots: Readonly<{
|
|
12
|
+
[name: string]: import("vue").Slot | undefined;
|
|
13
|
+
}>;
|
|
10
14
|
componentId: string;
|
|
11
15
|
scrollbarInstRef: import("vue").Ref<{
|
|
12
16
|
scrollTo: import("../../../_internal/scrollbar/src/ScrollBar").ScrollTo;
|
|
@@ -20,6 +24,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
20
24
|
itemsElRef: HTMLElement | null;
|
|
21
25
|
scrollTo: import("vueuc/lib/virtual-list/src/VirtualList").ScrollTo;
|
|
22
26
|
} | null>;
|
|
27
|
+
emptyElRef: import("vue").Ref<HTMLElement | null>;
|
|
23
28
|
summary: import("vue").Ref<import("../interface").CreateSummary<import("../interface").InternalRowData> | undefined>;
|
|
24
29
|
mergedClsPrefix: import("vue").Ref<string>;
|
|
25
30
|
mergedTheme: import("vue").Ref<{
|
|
@@ -976,17 +981,21 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
976
981
|
}>;
|
|
977
982
|
scrollX: import("vue").Ref<string | number | undefined>;
|
|
978
983
|
cols: import("vue").Ref<ColItem[]>;
|
|
984
|
+
loading: import("vue").Ref<boolean>;
|
|
985
|
+
bodyShowHeaderOnly: import("vue").ComputedRef<boolean>;
|
|
986
|
+
shouldDisplaySomeTablePart: import("vue").ComputedRef<boolean>;
|
|
987
|
+
empty: import("vue").ComputedRef<boolean>;
|
|
979
988
|
paginatedData: import("vue").ComputedRef<{
|
|
980
989
|
tmNode: TmNode;
|
|
981
990
|
key: import("treemate").Key;
|
|
982
991
|
striped: boolean;
|
|
983
992
|
}[]>;
|
|
984
993
|
rawPaginatedData: import("vue").Ref<import("../interface").InternalRowData[]>;
|
|
985
|
-
fixedColumnLeftMap: import("vue").Ref<Record<
|
|
994
|
+
fixedColumnLeftMap: import("vue").Ref<Record<ColumnKey, {
|
|
986
995
|
start: number;
|
|
987
996
|
end: number;
|
|
988
997
|
} | undefined>>;
|
|
989
|
-
fixedColumnRightMap: import("vue").Ref<Record<
|
|
998
|
+
fixedColumnRightMap: import("vue").Ref<Record<ColumnKey, {
|
|
990
999
|
start: number;
|
|
991
1000
|
end: number;
|
|
992
1001
|
} | undefined>>;
|
|
@@ -1019,11 +1028,13 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1019
1028
|
onResize?: unknown;
|
|
1020
1029
|
showHeader?: unknown;
|
|
1021
1030
|
flexHeight?: unknown;
|
|
1031
|
+
bodyStyle?: unknown;
|
|
1022
1032
|
} & {
|
|
1023
1033
|
flexHeight: boolean;
|
|
1024
1034
|
showHeader: boolean;
|
|
1025
1035
|
} & {
|
|
1026
1036
|
onResize?: ((e: ResizeObserverEntry) => void) | undefined;
|
|
1037
|
+
bodyStyle?: CSSProperties | undefined;
|
|
1027
1038
|
}>, {
|
|
1028
1039
|
flexHeight: boolean;
|
|
1029
1040
|
showHeader: boolean;
|
|
@@ -7,9 +7,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
7
7
|
const vue_1 = require("vue");
|
|
8
8
|
const seemly_1 = require("seemly");
|
|
9
9
|
const vueuc_1 = require("vueuc");
|
|
10
|
+
const vooks_1 = require("vooks");
|
|
11
|
+
const common_1 = require("../../../_mixins/common");
|
|
10
12
|
const cssr_1 = require("../../../_utils/cssr");
|
|
11
13
|
const _internal_1 = require("../../../_internal");
|
|
12
14
|
const _utils_1 = require("../../../_utils");
|
|
15
|
+
const empty_1 = require("../../../empty");
|
|
13
16
|
const interface_1 = require("../interface");
|
|
14
17
|
const utils_1 = require("../utils");
|
|
15
18
|
const Cell_1 = __importDefault(require("./Cell"));
|
|
@@ -75,14 +78,24 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
75
78
|
props: {
|
|
76
79
|
onResize: Function,
|
|
77
80
|
showHeader: Boolean,
|
|
78
|
-
flexHeight: Boolean
|
|
81
|
+
flexHeight: Boolean,
|
|
82
|
+
bodyStyle: Object
|
|
79
83
|
},
|
|
80
84
|
setup(props) {
|
|
81
|
-
const { mergedExpandedRowKeysRef, mergedClsPrefixRef, mergedThemeRef, scrollXRef, colsRef, paginatedDataRef, rawPaginatedDataRef, fixedColumnLeftMapRef, fixedColumnRightMapRef, mergedCurrentPageRef, rowClassNameRef, leftActiveFixedColKeyRef, rightActiveFixedColKeyRef, renderExpandRef, hoverKeyRef, summaryRef, mergedSortStateRef, virtualScrollRef, componentId, scrollPartRef, mergedTableLayoutRef, hasChildrenRef, firstContentfulColIndexRef, indentRef, rowPropsRef, maxHeightRef, stripedRef, setHeaderScrollLeft, doUpdateExpandedRowKeys, handleTableBodyScroll, doCheck, doUncheck
|
|
85
|
+
const { slots: dataTableSlots, mergedExpandedRowKeysRef, mergedClsPrefixRef, mergedThemeRef, scrollXRef, colsRef, paginatedDataRef, rawPaginatedDataRef, fixedColumnLeftMapRef, fixedColumnRightMapRef, mergedCurrentPageRef, rowClassNameRef, leftActiveFixedColKeyRef, leftActiveFixedChildrenColKeysRef, rightActiveFixedColKeyRef, rightActiveFixedChildrenColKeysRef, renderExpandRef, hoverKeyRef, summaryRef, mergedSortStateRef, virtualScrollRef, componentId, scrollPartRef, mergedTableLayoutRef, hasChildrenRef, firstContentfulColIndexRef, indentRef, rowPropsRef, maxHeightRef, stripedRef, loadingRef, setHeaderScrollLeft, doUpdateExpandedRowKeys, handleTableBodyScroll, doCheck, doUncheck
|
|
82
86
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
83
87
|
} = (0, vue_1.inject)(interface_1.dataTableInjectionKey);
|
|
84
88
|
const scrollbarInstRef = (0, vue_1.ref)(null);
|
|
85
89
|
const virtualListRef = (0, vue_1.ref)(null);
|
|
90
|
+
const emptyElRef = (0, vue_1.ref)(null);
|
|
91
|
+
const emptyRef = (0, vooks_1.useMemo)(() => paginatedDataRef.value.length === 0);
|
|
92
|
+
// If header is not inside & empty is displayed, no table part would be
|
|
93
|
+
// shown. So to collect a body width, we need to put a ref on empty element
|
|
94
|
+
const shouldDisplaySomeTablePartRef = (0, vooks_1.useMemo)(() => props.showHeader || !emptyRef.value);
|
|
95
|
+
// If no body is shown, we shouldn't show scrollbar
|
|
96
|
+
const bodyShowHeaderOnlyRef = (0, vooks_1.useMemo)(() => {
|
|
97
|
+
return props.showHeader || emptyRef.value;
|
|
98
|
+
});
|
|
86
99
|
let lastSelectedKey = '';
|
|
87
100
|
const mergedExpandedRowKeySetRef = (0, vue_1.computed)(() => {
|
|
88
101
|
return new Set(mergedExpandedRowKeysRef.value);
|
|
@@ -119,6 +132,15 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
119
132
|
lastSelectedKey = tmNode.key;
|
|
120
133
|
}
|
|
121
134
|
function getScrollContainer() {
|
|
135
|
+
if (!shouldDisplaySomeTablePartRef.value) {
|
|
136
|
+
const { value: emptyEl } = emptyElRef;
|
|
137
|
+
if (emptyEl) {
|
|
138
|
+
return emptyEl;
|
|
139
|
+
}
|
|
140
|
+
else {
|
|
141
|
+
return null;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
122
144
|
if (virtualScrollRef.value) {
|
|
123
145
|
return virtualListContainer();
|
|
124
146
|
}
|
|
@@ -170,36 +192,48 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
170
192
|
};
|
|
171
193
|
// manually control shadow style to avoid rerender
|
|
172
194
|
const style = (0, cssr_1.c)([
|
|
173
|
-
({ props: cProps }) =>
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
195
|
+
({ props: cProps }) => {
|
|
196
|
+
const createActiveLeftFixedStyle = (leftActiveFixedColKey) => {
|
|
197
|
+
if (leftActiveFixedColKey === null)
|
|
198
|
+
return null;
|
|
199
|
+
return (0, cssr_1.c)(`[data-n-id="${cProps.componentId}"] [data-col-key="${leftActiveFixedColKey}"]::after`, { boxShadow: 'var(--n-box-shadow-after)' });
|
|
200
|
+
};
|
|
201
|
+
const createActiveRightFixedStyle = (rightActiveFixedColKey) => {
|
|
202
|
+
if (rightActiveFixedColKey === null)
|
|
203
|
+
return null;
|
|
204
|
+
return (0, cssr_1.c)(`[data-n-id="${cProps.componentId}"] [data-col-key="${rightActiveFixedColKey}"]::before`, { boxShadow: 'var(--n-box-shadow-before)' });
|
|
205
|
+
};
|
|
206
|
+
return (0, cssr_1.c)([
|
|
207
|
+
createActiveLeftFixedStyle(cProps.leftActiveFixedColKey),
|
|
208
|
+
createActiveRightFixedStyle(cProps.rightActiveFixedColKey),
|
|
209
|
+
cProps.leftActiveFixedChildrenColKeys.map((leftActiveFixedColKey) => createActiveLeftFixedStyle(leftActiveFixedColKey)),
|
|
210
|
+
cProps.rightActiveFixedChildrenColKeys.map((rightActiveFixedColKey) => createActiveRightFixedStyle(rightActiveFixedColKey))
|
|
211
|
+
]);
|
|
212
|
+
}
|
|
185
213
|
]);
|
|
186
214
|
let fixedStyleMounted = false;
|
|
187
215
|
(0, vue_1.watchEffect)(() => {
|
|
188
216
|
const { value: leftActiveFixedColKey } = leftActiveFixedColKeyRef;
|
|
217
|
+
const { value: leftActiveFixedChildrenColKeys } = leftActiveFixedChildrenColKeysRef;
|
|
189
218
|
const { value: rightActiveFixedColKey } = rightActiveFixedColKeyRef;
|
|
219
|
+
const { value: rightActiveFixedChildrenColKeys } = rightActiveFixedChildrenColKeysRef;
|
|
190
220
|
if (!fixedStyleMounted &&
|
|
191
221
|
leftActiveFixedColKey === null &&
|
|
192
222
|
rightActiveFixedColKey === null) {
|
|
193
223
|
return;
|
|
194
224
|
}
|
|
225
|
+
const cProps = {
|
|
226
|
+
leftActiveFixedColKey,
|
|
227
|
+
leftActiveFixedChildrenColKeys,
|
|
228
|
+
rightActiveFixedColKey,
|
|
229
|
+
rightActiveFixedChildrenColKeys,
|
|
230
|
+
componentId
|
|
231
|
+
};
|
|
195
232
|
style.mount({
|
|
196
233
|
id: `n-${componentId}`,
|
|
197
234
|
force: true,
|
|
198
|
-
props:
|
|
199
|
-
|
|
200
|
-
rightActiveFixedColKey,
|
|
201
|
-
componentId
|
|
202
|
-
}
|
|
235
|
+
props: cProps,
|
|
236
|
+
anchorMetaName: common_1.cssrAnchorMetaName
|
|
203
237
|
});
|
|
204
238
|
fixedStyleMounted = true;
|
|
205
239
|
});
|
|
@@ -208,9 +242,11 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
208
242
|
id: `n-${componentId}`
|
|
209
243
|
});
|
|
210
244
|
});
|
|
211
|
-
return Object.assign({
|
|
245
|
+
return Object.assign({ dataTableSlots,
|
|
246
|
+
componentId,
|
|
212
247
|
scrollbarInstRef,
|
|
213
|
-
virtualListRef,
|
|
248
|
+
virtualListRef,
|
|
249
|
+
emptyElRef, summary: summaryRef, mergedClsPrefix: mergedClsPrefixRef, mergedTheme: mergedThemeRef, scrollX: scrollXRef, cols: colsRef, loading: loadingRef, bodyShowHeaderOnly: bodyShowHeaderOnlyRef, shouldDisplaySomeTablePart: shouldDisplaySomeTablePartRef, empty: emptyRef, paginatedData: (0, vue_1.computed)(() => {
|
|
214
250
|
const { value: striped } = stripedRef;
|
|
215
251
|
return paginatedDataRef.value.map(striped
|
|
216
252
|
? (tmNode, index) => {
|
|
@@ -252,13 +288,13 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
252
288
|
};
|
|
253
289
|
if (scrollX)
|
|
254
290
|
contentStyle.width = '100%';
|
|
255
|
-
|
|
291
|
+
const tableNode = ((0, vue_1.h)(_internal_1.NScrollbar, { ref: "scrollbarInstRef", scrollable: scrollable || isBasicAutoLayout, class: `${mergedClsPrefix}-data-table-base-table-body`, style: this.bodyStyle, theme: mergedTheme.peers.Scrollbar, themeOverrides: mergedTheme.peerOverrides.Scrollbar, contentStyle: contentStyle, container: virtualScroll ? this.virtualListContainer : undefined, content: virtualScroll ? this.virtualListContent : undefined, horizontalRailStyle: { zIndex: 3 }, verticalRailStyle: { zIndex: 3 }, xScrollable: xScrollable, onScroll: virtualScroll ? undefined : this.handleTableBodyScroll, internalOnUpdateScrollLeft: setHeaderScrollLeft, onResize: onResize }, {
|
|
256
292
|
default: () => {
|
|
257
293
|
// coordinate to pass if there are cells that cross row & col
|
|
258
294
|
const cordToPass = {};
|
|
259
295
|
// coordinate to related hover keys
|
|
260
296
|
const cordKey = {};
|
|
261
|
-
const { cols, paginatedData, mergedTheme, fixedColumnLeftMap, fixedColumnRightMap, currentPage, rowClassName, mergedSortState, mergedExpandedRowKeySet, componentId,
|
|
297
|
+
const { cols, paginatedData, mergedTheme, fixedColumnLeftMap, fixedColumnRightMap, currentPage, rowClassName, mergedSortState, mergedExpandedRowKeySet, componentId, hasChildren, firstContentfulColIndex, rowProps, handleMouseenterTable, handleMouseleaveTable, renderExpand, summary, handleCheckboxUpdateChecked, handleUpdateExpanded } = this;
|
|
262
298
|
const { length: colCount } = cols;
|
|
263
299
|
let mergedData;
|
|
264
300
|
// if there is children in data, we should expand mergedData first
|
|
@@ -343,6 +379,7 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
343
379
|
this.hoverKey = rowKey;
|
|
344
380
|
}, key: rowKey, class: [
|
|
345
381
|
`${mergedClsPrefix}-data-table-tr`,
|
|
382
|
+
isSummary && `${mergedClsPrefix}-data-table-tr--summary`,
|
|
346
383
|
striped && `${mergedClsPrefix}-data-table-tr--striped`,
|
|
347
384
|
mergedRowClassName
|
|
348
385
|
] }, props), cols.map((col, colIndex) => {
|
|
@@ -441,10 +478,10 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
441
478
|
tableLayout: this.mergedTableLayout
|
|
442
479
|
} },
|
|
443
480
|
(0, vue_1.h)("colgroup", null, cols.map((col) => ((0, vue_1.h)("col", { key: col.key, style: col.style })))),
|
|
444
|
-
showHeader ? (0, vue_1.h)(Header_1.default, { discrete: false }) : null,
|
|
445
|
-
(0, vue_1.h)("tbody", { "data-n-id": componentId, class: `${mergedClsPrefix}-data-table-tbody` }, displayedData.map((rowInfo, rowIndex) => {
|
|
481
|
+
this.showHeader ? (0, vue_1.h)(Header_1.default, { discrete: false }) : null,
|
|
482
|
+
!this.empty ? ((0, vue_1.h)("tbody", { "data-n-id": componentId, class: `${mergedClsPrefix}-data-table-tbody` }, displayedData.map((rowInfo, rowIndex) => {
|
|
446
483
|
return renderRow(rowInfo, rowIndex, false);
|
|
447
|
-
}))));
|
|
484
|
+
}))) : null));
|
|
448
485
|
}
|
|
449
486
|
else {
|
|
450
487
|
return ((0, vue_1.h)(vueuc_1.VirtualList, { ref: "virtualListRef", items: displayedData, itemSize: 28, visibleItemsTag: VirtualListItemWrapper, visibleItemsProps: {
|
|
@@ -459,5 +496,22 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
459
496
|
}
|
|
460
497
|
}
|
|
461
498
|
}));
|
|
499
|
+
if (this.empty) {
|
|
500
|
+
const createEmptyNode = () => ((0, vue_1.h)("div", { class: [
|
|
501
|
+
`${mergedClsPrefix}-data-table-empty`,
|
|
502
|
+
this.loading && `${mergedClsPrefix}-data-table-empty--hide`
|
|
503
|
+
], style: this.bodyStyle, ref: "emptyElRef" }, (0, vue_1.renderSlot)(this.dataTableSlots, 'empty', undefined, () => [
|
|
504
|
+
(0, vue_1.h)(empty_1.NEmpty, { theme: this.mergedTheme.peers.Empty, themeOverrides: this.mergedTheme.peerOverrides.Empty })
|
|
505
|
+
])));
|
|
506
|
+
if (this.shouldDisplaySomeTablePart) {
|
|
507
|
+
return ((0, vue_1.h)(vue_1.Fragment, null,
|
|
508
|
+
tableNode,
|
|
509
|
+
createEmptyNode()));
|
|
510
|
+
}
|
|
511
|
+
else {
|
|
512
|
+
return ((0, vue_1.h)(vueuc_1.VResizeObserver, { onResize: this.onResize }, { default: createEmptyNode }));
|
|
513
|
+
}
|
|
514
|
+
}
|
|
515
|
+
return tableNode;
|
|
462
516
|
}
|
|
463
517
|
});
|