naive-ui 2.25.2 → 2.25.3
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/Clear.d.ts +0 -1
- package/es/_internal/clear/src/Clear.js +1 -3
- package/es/_internal/icons/replaceable.d.ts +1 -1
- package/es/_internal/icons/replaceable.js +5 -4
- package/es/_internal/scrollbar/src/ScrollBar.d.ts +13 -1
- package/es/_internal/scrollbar/src/ScrollBar.js +35 -16
- package/es/_internal/select-menu/src/SelectMenu.d.ts +22 -23
- package/es/_internal/select-menu/src/SelectMenu.js +10 -16
- package/es/_internal/selection/src/Selection.d.ts +5 -5
- package/es/_internal/selection/src/Selection.js +20 -7
- package/es/_mixins/index.d.ts +1 -1
- package/es/_mixins/index.js +1 -1
- package/es/_mixins/use-config.d.ts +6 -3
- package/es/_mixins/use-config.js +5 -1
- package/es/_mixins/use-css-vars-class.d.ts +1 -4
- package/es/_mixins/use-css-vars-class.js +6 -6
- package/es/_utils/vue/resolve-slot.d.ts +5 -2
- package/es/_utils/vue/resolve-slot.js +4 -3
- package/es/alert/src/Alert.d.ts +3 -1
- package/es/alert/src/Alert.js +36 -21
- package/es/anchor/src/AnchorAdapter.js +9 -3
- package/es/auto-complete/src/AutoComplete.d.ts +3 -1
- package/es/auto-complete/src/AutoComplete.js +28 -15
- package/es/avatar/src/Avatar.d.ts +3 -1
- package/es/avatar/src/Avatar.js +70 -35
- package/es/back-top/src/BackTop.d.ts +12 -49
- package/es/back-top/src/BackTop.js +60 -58
- package/es/badge/src/Badge.d.ts +12 -37
- package/es/badge/src/Badge.js +41 -31
- package/es/breadcrumb/src/Breadcrumb.d.ts +3 -1
- package/es/breadcrumb/src/Breadcrumb.js +24 -16
- package/es/button/src/Button.d.ts +7 -6
- package/es/button/src/Button.js +31 -21
- package/es/calendar/src/Calendar.d.ts +3 -1
- package/es/calendar/src/Calendar.js +37 -30
- package/es/card/src/Card.d.ts +2 -2
- package/es/card/src/Card.js +27 -16
- package/es/carousel/src/Carousel.d.ts +3 -1
- package/es/carousel/src/Carousel.js +29 -20
- package/es/cascader/src/Cascader.d.ts +16 -1
- package/es/cascader/src/Cascader.js +53 -31
- package/es/cascader/src/CascaderMenu.js +7 -6
- package/es/cascader/src/CascaderSelectMenu.js +2 -1
- package/es/cascader/src/CascaderSubmenu.d.ts +1 -0
- package/es/cascader/src/interface.d.ts +1 -0
- package/es/checkbox/src/Checkbox.d.ts +6 -4
- package/es/checkbox/src/Checkbox.js +41 -32
- package/es/checkbox/src/styles/index.cssr.js +7 -7
- package/es/code/src/Code.d.ts +3 -1
- package/es/code/src/Code.js +33 -27
- package/es/collapse/src/Collapse.d.ts +3 -1
- package/es/collapse/src/Collapse.js +24 -16
- package/es/color-picker/src/ColorPicker.d.ts +3 -1
- package/es/color-picker/src/ColorPicker.js +20 -7
- package/es/components.d.ts +1 -0
- package/es/components.js +1 -0
- package/es/config-provider/src/ConfigProvider.d.ts +4 -4
- package/es/config-provider/src/ConfigProvider.js +3 -3
- package/es/config-provider/src/internal-interface.d.ts +3 -1
- package/es/countdown/src/Countdown.d.ts +0 -3
- package/es/countdown/src/Countdown.js +0 -1
- package/es/data-table/src/DataTable.d.ts +43 -41
- package/es/data-table/src/DataTable.js +54 -48
- package/es/data-table/src/HeaderButton/FilterButton.js +3 -2
- package/es/data-table/src/HeaderButton/SortButton.js +3 -2
- package/es/data-table/src/TableParts/Body.d.ts +1 -0
- package/es/data-table/src/TableParts/Body.js +4 -2
- package/es/data-table/src/interface.d.ts +1 -1
- package/es/data-table/src/use-table-data.js +19 -7
- package/es/date-picker/src/DatePicker.d.ts +1 -0
- package/es/date-picker/src/DatePicker.js +2 -2
- package/es/date-picker/src/panel/date.d.ts +2 -0
- package/es/date-picker/src/panel/datetime.d.ts +2 -0
- package/es/date-picker/src/panel/month.d.ts +2 -0
- package/es/date-picker/src/panel/panelHeader.d.ts +4 -0
- package/es/date-picker/src/panel/use-calendar.d.ts +2 -0
- package/es/descriptions/src/Descriptions.d.ts +14 -1
- package/es/descriptions/src/Descriptions.js +45 -28
- package/es/descriptions/src/styles/index.cssr.js +2 -1
- package/es/descriptions/styles/light.d.ts +1 -0
- package/es/descriptions/styles/light.js +2 -2
- package/es/dialog/src/Dialog.d.ts +3 -1
- package/es/dialog/src/Dialog.js +57 -56
- package/es/dialog/src/DialogEnvironment.js +1 -1
- package/es/divider/src/Divider.d.ts +3 -1
- package/es/divider/src/Divider.js +20 -11
- package/es/dynamic-input/src/DynamicInput.js +2 -2
- package/es/dynamic-tags/src/DynamicTags.d.ts +3 -1
- package/es/dynamic-tags/src/DynamicTags.js +17 -10
- package/es/element/src/Element.d.ts +3 -1
- package/es/element/src/Element.js +18 -11
- package/es/empty/src/Empty.d.ts +3 -1
- package/es/empty/src/Empty.js +28 -16
- package/es/form/src/FormItem.js +1 -2
- package/es/grid/src/Grid.js +2 -2
- package/es/icon-wrapper/src/IconWrapper.js +6 -8
- package/es/input/src/Input.d.ts +6 -3
- package/es/input/src/Input.js +96 -84
- package/es/input/src/styles/input.cssr.js +2 -2
- package/es/input-number/src/InputNumber.d.ts +6 -17
- package/es/input-number/src/InputNumber.js +79 -20
- package/es/layout/src/Layout.d.ts +8 -2
- package/es/layout/src/Layout.js +17 -10
- package/es/layout/src/LayoutContent.d.ts +4 -1
- package/es/layout/src/LayoutFooter.d.ts +3 -1
- package/es/layout/src/LayoutFooter.js +28 -19
- package/es/layout/src/LayoutHeader.d.ts +3 -1
- package/es/layout/src/LayoutHeader.js +28 -19
- package/es/layout/src/LayoutSider.d.ts +4 -0
- package/es/layout/src/LayoutSider.js +37 -29
- package/es/locales/common/esAR.js +2 -2
- package/es/locales/common/frFR.js +8 -9
- package/es/locales/common/skSK.d.ts +3 -0
- package/es/locales/common/skSK.js +110 -0
- package/es/locales/date/skSK.d.ts +3 -0
- package/es/locales/date/skSK.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 +4 -1
- package/es/log/src/Log.js +20 -15
- package/es/mention/index.d.ts +1 -1
- package/es/mention/src/interface.d.ts +4 -0
- package/es/menu/src/Menu.d.ts +3 -1
- package/es/menu/src/Menu.js +68 -63
- package/es/modal/src/BodyWrapper.d.ts +1 -0
- package/es/modal/src/Modal.d.ts +11 -14
- package/es/modal/src/Modal.js +41 -32
- package/es/notification/src/styles/index.cssr.js +6 -5
- package/es/page-header/src/PageHeader.d.ts +3 -1
- package/es/page-header/src/PageHeader.js +27 -18
- package/es/pagination/src/Pagination.d.ts +13 -1
- package/es/pagination/src/Pagination.js +59 -52
- package/es/popover/src/PopoverBody.js +10 -4
- package/es/progress/src/Progress.d.ts +2 -2
- package/es/progress/src/Progress.js +12 -6
- package/es/radio/src/Radio.d.ts +3 -1
- package/es/radio/src/Radio.js +32 -23
- package/es/radio/src/RadioGroup.d.ts +3 -1
- package/es/radio/src/RadioGroup.js +31 -22
- package/es/rate/src/Rate.d.ts +3 -1
- package/es/rate/src/Rate.js +44 -23
- package/es/result/src/Result.d.ts +4 -2
- package/es/result/src/Result.js +36 -19
- package/es/scrollbar/src/ScrollBar.d.ts +12 -1
- package/es/scrollbar/src/ScrollBar.js +4 -0
- package/es/select/src/Select.d.ts +1 -1
- package/es/select/src/Select.js +5 -4
- package/es/spin/src/Spin.d.ts +3 -1
- package/es/spin/src/Spin.js +31 -21
- package/es/statistic/src/Statistic.d.ts +3 -1
- package/es/statistic/src/Statistic.js +29 -21
- package/es/styles.d.ts +1 -0
- package/es/styles.js +1 -0
- package/es/switch/src/Switch.d.ts +13 -1
- package/es/switch/src/Switch.js +85 -60
- package/es/switch/src/styles/index.cssr.js +21 -8
- package/es/switch/styles/dark.js +2 -2
- package/es/switch/styles/light.d.ts +1 -0
- package/es/switch/styles/light.js +2 -2
- package/es/table/src/Table.d.ts +3 -1
- package/es/table/src/Table.js +40 -29
- package/es/table/src/styles/index.cssr.js +1 -1
- package/es/tabs/src/Tabs.d.ts +25 -23
- package/es/tabs/src/Tabs.js +50 -44
- package/es/tabs/src/styles/index.cssr.js +77 -77
- package/es/tag/src/Tag.d.ts +2 -2
- package/es/tag/src/Tag.js +8 -11
- package/es/theme-editor/src/ThemeEditor.js +4 -3
- package/es/themes/dark.js +3 -1
- package/es/themes/light.js +3 -1
- package/es/thing/src/Thing.js +10 -3
- package/es/time-picker/src/TimePicker.d.ts +4 -0
- package/es/transfer/src/TransferList.d.ts +1 -0
- package/es/tree/src/Tree.d.ts +1 -0
- package/es/tree/src/Tree.js +8 -4
- package/es/tree-select/src/TreeSelect.d.ts +13 -0
- package/es/tree-select/src/TreeSelect.js +6 -2
- package/es/typography/src/a.d.ts +3 -1
- package/es/typography/src/a.js +18 -10
- package/es/typography/src/blockquote.d.ts +3 -1
- package/es/typography/src/blockquote.js +21 -12
- package/es/typography/src/create-header.d.ts +3 -1
- package/es/typography/src/create-header.js +25 -16
- package/es/typography/src/headers.d.ts +18 -6
- package/es/typography/src/hr.d.ts +3 -1
- package/es/typography/src/hr.js +18 -10
- package/es/typography/src/ol.d.ts +3 -1
- package/es/typography/src/ol.js +23 -14
- package/es/typography/src/p.d.ts +3 -1
- package/es/typography/src/p.js +23 -15
- package/es/typography/src/text.d.ts +3 -1
- package/es/typography/src/text.js +31 -23
- package/es/typography/src/ul.d.ts +3 -1
- package/es/typography/src/ul.js +23 -14
- package/es/upload/src/interface.d.ts +1 -1
- package/es/version.d.ts +1 -1
- package/es/version.js +1 -1
- package/es/watermark/index.d.ts +2 -0
- package/es/watermark/index.js +1 -0
- package/es/watermark/src/Watermark.d.ts +285 -0
- package/es/watermark/src/Watermark.js +159 -0
- package/es/watermark/src/styles/index.cssr.d.ts +2 -0
- package/es/watermark/src/styles/index.cssr.js +14 -0
- package/es/watermark/styles/dark.d.ts +3 -0
- package/es/watermark/styles/dark.js +12 -0
- package/es/watermark/styles/index.d.ts +3 -0
- package/es/watermark/styles/index.js +2 -0
- package/es/watermark/styles/light.d.ts +5 -0
- package/es/watermark/styles/light.js +13 -0
- package/lib/_internal/clear/src/Clear.d.ts +0 -1
- package/lib/_internal/clear/src/Clear.js +0 -2
- package/lib/_internal/icons/replaceable.d.ts +1 -1
- package/lib/_internal/icons/replaceable.js +4 -3
- package/lib/_internal/scrollbar/src/ScrollBar.d.ts +13 -1
- package/lib/_internal/scrollbar/src/ScrollBar.js +34 -15
- package/lib/_internal/select-menu/src/SelectMenu.d.ts +22 -23
- package/lib/_internal/select-menu/src/SelectMenu.js +9 -15
- package/lib/_internal/selection/src/Selection.d.ts +5 -5
- package/lib/_internal/selection/src/Selection.js +19 -6
- package/lib/_mixins/index.d.ts +1 -1
- package/lib/_mixins/index.js +1 -2
- package/lib/_mixins/use-config.d.ts +6 -3
- package/lib/_mixins/use-config.js +5 -1
- package/lib/_mixins/use-css-vars-class.d.ts +1 -4
- package/lib/_mixins/use-css-vars-class.js +7 -7
- package/lib/_utils/vue/resolve-slot.d.ts +5 -2
- package/lib/_utils/vue/resolve-slot.js +4 -3
- package/lib/alert/src/Alert.d.ts +3 -1
- package/lib/alert/src/Alert.js +34 -19
- package/lib/anchor/src/AnchorAdapter.js +8 -2
- package/lib/auto-complete/src/AutoComplete.d.ts +3 -1
- package/lib/auto-complete/src/AutoComplete.js +27 -14
- package/lib/avatar/src/Avatar.d.ts +3 -1
- package/lib/avatar/src/Avatar.js +68 -33
- package/lib/back-top/src/BackTop.d.ts +12 -49
- package/lib/back-top/src/BackTop.js +57 -55
- package/lib/badge/src/Badge.d.ts +12 -37
- package/lib/badge/src/Badge.js +39 -29
- package/lib/breadcrumb/src/Breadcrumb.d.ts +3 -1
- package/lib/breadcrumb/src/Breadcrumb.js +23 -15
- package/lib/button/src/Button.d.ts +7 -6
- package/lib/button/src/Button.js +29 -19
- package/lib/calendar/src/Calendar.d.ts +3 -1
- package/lib/calendar/src/Calendar.js +36 -29
- package/lib/card/src/Card.d.ts +2 -2
- package/lib/card/src/Card.js +25 -14
- package/lib/carousel/src/Carousel.d.ts +3 -1
- package/lib/carousel/src/Carousel.js +27 -18
- package/lib/cascader/src/Cascader.d.ts +16 -1
- package/lib/cascader/src/Cascader.js +52 -30
- package/lib/cascader/src/CascaderMenu.js +7 -6
- package/lib/cascader/src/CascaderSelectMenu.js +2 -1
- package/lib/cascader/src/CascaderSubmenu.d.ts +1 -0
- package/lib/cascader/src/interface.d.ts +1 -0
- package/lib/checkbox/src/Checkbox.d.ts +6 -4
- package/lib/checkbox/src/Checkbox.js +40 -31
- package/lib/checkbox/src/styles/index.cssr.js +7 -7
- package/lib/code/src/Code.d.ts +3 -1
- package/lib/code/src/Code.js +32 -26
- package/lib/collapse/src/Collapse.d.ts +3 -1
- package/lib/collapse/src/Collapse.js +23 -15
- package/lib/color-picker/src/ColorPicker.d.ts +3 -1
- package/lib/color-picker/src/ColorPicker.js +19 -6
- package/lib/components.d.ts +1 -0
- package/lib/components.js +1 -0
- package/lib/config-provider/src/ConfigProvider.d.ts +4 -4
- package/lib/config-provider/src/ConfigProvider.js +3 -3
- package/lib/config-provider/src/internal-interface.d.ts +3 -1
- package/lib/countdown/src/Countdown.d.ts +0 -3
- package/lib/countdown/src/Countdown.js +0 -1
- package/lib/data-table/src/DataTable.d.ts +43 -41
- package/lib/data-table/src/DataTable.js +53 -47
- package/lib/data-table/src/HeaderButton/FilterButton.js +3 -2
- package/lib/data-table/src/HeaderButton/SortButton.js +3 -2
- package/lib/data-table/src/TableParts/Body.d.ts +1 -0
- package/lib/data-table/src/TableParts/Body.js +3 -1
- package/lib/data-table/src/interface.d.ts +1 -1
- package/lib/data-table/src/use-table-data.js +19 -7
- package/lib/date-picker/src/DatePicker.d.ts +1 -0
- package/lib/date-picker/src/DatePicker.js +2 -2
- package/lib/date-picker/src/panel/date.d.ts +2 -0
- package/lib/date-picker/src/panel/datetime.d.ts +2 -0
- package/lib/date-picker/src/panel/month.d.ts +2 -0
- package/lib/date-picker/src/panel/panelHeader.d.ts +4 -0
- package/lib/date-picker/src/panel/use-calendar.d.ts +2 -0
- package/lib/descriptions/src/Descriptions.d.ts +14 -1
- package/lib/descriptions/src/Descriptions.js +44 -27
- package/lib/descriptions/src/styles/index.cssr.js +2 -1
- package/lib/descriptions/styles/light.d.ts +1 -0
- package/lib/descriptions/styles/light.js +2 -2
- package/lib/dialog/src/Dialog.d.ts +3 -1
- package/lib/dialog/src/Dialog.js +55 -54
- package/lib/dialog/src/DialogEnvironment.js +1 -1
- package/lib/divider/src/Divider.d.ts +3 -1
- package/lib/divider/src/Divider.js +19 -10
- package/lib/dynamic-input/src/DynamicInput.js +2 -2
- package/lib/dynamic-tags/src/DynamicTags.d.ts +3 -1
- package/lib/dynamic-tags/src/DynamicTags.js +16 -9
- package/lib/element/src/Element.d.ts +3 -1
- package/lib/element/src/Element.js +17 -10
- package/lib/empty/src/Empty.d.ts +3 -1
- package/lib/empty/src/Empty.js +27 -15
- package/lib/form/src/FormItem.js +1 -2
- package/lib/grid/src/Grid.js +2 -2
- package/lib/icon-wrapper/src/IconWrapper.js +5 -7
- package/lib/input/src/Input.d.ts +6 -3
- package/lib/input/src/Input.js +95 -83
- package/lib/input/src/styles/input.cssr.js +2 -2
- package/lib/input-number/src/InputNumber.d.ts +6 -17
- package/lib/input-number/src/InputNumber.js +76 -17
- package/lib/layout/src/Layout.d.ts +8 -2
- package/lib/layout/src/Layout.js +16 -9
- package/lib/layout/src/LayoutContent.d.ts +4 -1
- package/lib/layout/src/LayoutFooter.d.ts +3 -1
- package/lib/layout/src/LayoutFooter.js +27 -18
- package/lib/layout/src/LayoutHeader.d.ts +3 -1
- package/lib/layout/src/LayoutHeader.js +27 -18
- package/lib/layout/src/LayoutSider.d.ts +4 -0
- package/lib/layout/src/LayoutSider.js +36 -28
- package/lib/locales/common/esAR.js +2 -2
- package/lib/locales/common/frFR.js +8 -9
- package/lib/locales/common/skSK.d.ts +3 -0
- package/lib/locales/common/skSK.js +112 -0
- package/lib/locales/date/skSK.d.ts +3 -0
- package/lib/locales/date/skSK.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 +4 -1
- package/lib/log/src/Log.js +19 -14
- package/lib/mention/index.d.ts +1 -1
- package/lib/mention/src/interface.d.ts +4 -0
- package/lib/menu/src/Menu.d.ts +3 -1
- package/lib/menu/src/Menu.js +67 -62
- package/lib/modal/src/BodyWrapper.d.ts +1 -0
- package/lib/modal/src/Modal.d.ts +11 -14
- package/lib/modal/src/Modal.js +40 -31
- package/lib/notification/src/styles/index.cssr.js +6 -5
- package/lib/page-header/src/PageHeader.d.ts +3 -1
- package/lib/page-header/src/PageHeader.js +26 -17
- package/lib/pagination/src/Pagination.d.ts +13 -1
- package/lib/pagination/src/Pagination.js +58 -51
- package/lib/popover/src/PopoverBody.js +9 -3
- package/lib/progress/src/Progress.d.ts +2 -2
- package/lib/progress/src/Progress.js +11 -5
- package/lib/radio/src/Radio.d.ts +3 -1
- package/lib/radio/src/Radio.js +31 -22
- package/lib/radio/src/RadioGroup.d.ts +3 -1
- package/lib/radio/src/RadioGroup.js +30 -21
- package/lib/rate/src/Rate.d.ts +3 -1
- package/lib/rate/src/Rate.js +42 -21
- package/lib/result/src/Result.d.ts +4 -2
- package/lib/result/src/Result.js +35 -18
- package/lib/scrollbar/src/ScrollBar.d.ts +12 -1
- package/lib/scrollbar/src/ScrollBar.js +4 -0
- package/lib/select/src/Select.d.ts +1 -1
- package/lib/select/src/Select.js +5 -4
- package/lib/spin/src/Spin.d.ts +3 -1
- package/lib/spin/src/Spin.js +30 -20
- package/lib/statistic/src/Statistic.d.ts +3 -1
- package/lib/statistic/src/Statistic.js +28 -20
- package/lib/styles.d.ts +1 -0
- package/lib/styles.js +9 -7
- package/lib/switch/src/Switch.d.ts +13 -1
- package/lib/switch/src/Switch.js +81 -56
- package/lib/switch/src/styles/index.cssr.js +21 -8
- package/lib/switch/styles/dark.js +2 -2
- package/lib/switch/styles/light.d.ts +1 -0
- package/lib/switch/styles/light.js +2 -2
- package/lib/table/src/Table.d.ts +3 -1
- package/lib/table/src/Table.js +39 -28
- package/lib/table/src/styles/index.cssr.js +1 -1
- package/lib/tabs/src/Tabs.d.ts +25 -23
- package/lib/tabs/src/Tabs.js +48 -42
- package/lib/tabs/src/styles/index.cssr.js +77 -77
- package/lib/tag/src/Tag.d.ts +2 -2
- package/lib/tag/src/Tag.js +7 -10
- package/lib/theme-editor/src/ThemeEditor.js +2 -1
- package/lib/themes/dark.js +3 -1
- package/lib/themes/light.js +3 -1
- package/lib/thing/src/Thing.js +9 -2
- package/lib/time-picker/src/TimePicker.d.ts +4 -0
- package/lib/transfer/src/TransferList.d.ts +1 -0
- package/lib/tree/src/Tree.d.ts +1 -0
- package/lib/tree/src/Tree.js +8 -4
- package/lib/tree-select/src/TreeSelect.d.ts +13 -0
- package/lib/tree-select/src/TreeSelect.js +6 -2
- package/lib/typography/src/a.d.ts +3 -1
- package/lib/typography/src/a.js +17 -9
- package/lib/typography/src/blockquote.d.ts +3 -1
- package/lib/typography/src/blockquote.js +20 -11
- package/lib/typography/src/create-header.d.ts +3 -1
- package/lib/typography/src/create-header.js +24 -15
- package/lib/typography/src/headers.d.ts +18 -6
- package/lib/typography/src/hr.d.ts +3 -1
- package/lib/typography/src/hr.js +17 -9
- package/lib/typography/src/ol.d.ts +3 -1
- package/lib/typography/src/ol.js +22 -13
- package/lib/typography/src/p.d.ts +3 -1
- package/lib/typography/src/p.js +22 -14
- package/lib/typography/src/text.d.ts +3 -1
- package/lib/typography/src/text.js +30 -22
- package/lib/typography/src/ul.d.ts +3 -1
- package/lib/typography/src/ul.js +22 -13
- package/lib/upload/src/interface.d.ts +1 -1
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/lib/watermark/index.d.ts +2 -0
- package/lib/watermark/index.js +8 -0
- package/lib/watermark/src/Watermark.d.ts +285 -0
- package/lib/watermark/src/Watermark.js +164 -0
- package/lib/watermark/src/styles/index.cssr.d.ts +2 -0
- package/lib/watermark/src/styles/index.cssr.js +21 -0
- package/lib/watermark/styles/dark.d.ts +3 -0
- package/lib/watermark/styles/dark.js +14 -0
- package/lib/watermark/styles/index.d.ts +3 -0
- package/lib/watermark/styles/index.js +10 -0
- package/lib/watermark/styles/light.d.ts +5 -0
- package/lib/watermark/styles/light.js +15 -0
- package/package.json +8 -9
- package/volar.d.ts +1 -0
- package/web-types.json +252 -29
package/es/switch/src/Switch.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { h, ref, toRef, defineComponent, computed,
|
|
1
|
+
import { h, ref, toRef, defineComponent, computed, watchEffect } from 'vue';
|
|
2
2
|
import { depx, pxfy } from 'seemly';
|
|
3
3
|
import { useMergedState } from 'vooks';
|
|
4
|
-
import { useConfig, useFormItem, useTheme } from '../../_mixins';
|
|
5
|
-
import { NBaseLoading } from '../../_internal';
|
|
6
|
-
import { call, createKey, warnOnce } from '../../_utils';
|
|
4
|
+
import { useConfig, useFormItem, useTheme, useThemeClass } from '../../_mixins';
|
|
5
|
+
import { NBaseLoading, NIconSwitchTransition } from '../../_internal';
|
|
6
|
+
import { call, createKey, warnOnce, isSlotEmpty, resolveWrappedSlot } from '../../_utils';
|
|
7
7
|
import { switchLight } from '../styles';
|
|
8
8
|
import style from './styles/index.cssr';
|
|
9
9
|
const switchProps = Object.assign(Object.assign({}, useTheme.props), { size: {
|
|
@@ -41,7 +41,7 @@ export default defineComponent({
|
|
|
41
41
|
}
|
|
42
42
|
});
|
|
43
43
|
}
|
|
44
|
-
const { mergedClsPrefixRef } = useConfig(props);
|
|
44
|
+
const { mergedClsPrefixRef, inlineThemeDisabled } = useConfig(props);
|
|
45
45
|
const themeRef = useTheme('Switch', '-switch', style, switchLight, props, mergedClsPrefixRef);
|
|
46
46
|
const formItem = useFormItem(props);
|
|
47
47
|
const { mergedSizeRef, mergedDisabledRef } = formItem;
|
|
@@ -81,15 +81,13 @@ export default defineComponent({
|
|
|
81
81
|
nTriggerFormBlur();
|
|
82
82
|
}
|
|
83
83
|
function handleClick() {
|
|
84
|
-
if (props.loading)
|
|
84
|
+
if (props.loading || mergedDisabledRef.value)
|
|
85
85
|
return;
|
|
86
|
-
if (
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
doUpdateValue(props.uncheckedValue);
|
|
92
|
-
}
|
|
86
|
+
if (mergedValueRef.value !== props.checkedValue) {
|
|
87
|
+
doUpdateValue(props.checkedValue);
|
|
88
|
+
}
|
|
89
|
+
else {
|
|
90
|
+
doUpdateValue(props.uncheckedValue);
|
|
93
91
|
}
|
|
94
92
|
}
|
|
95
93
|
function handleFocus() {
|
|
@@ -102,21 +100,62 @@ export default defineComponent({
|
|
|
102
100
|
pressedRef.value = false;
|
|
103
101
|
}
|
|
104
102
|
function handleKeyup(e) {
|
|
105
|
-
if (props.loading)
|
|
103
|
+
if (props.loading || mergedDisabledRef.value)
|
|
106
104
|
return;
|
|
107
105
|
if (e.code === 'Space') {
|
|
108
|
-
|
|
106
|
+
if (mergedValueRef.value !== props.checkedValue) {
|
|
107
|
+
doUpdateValue(props.checkedValue);
|
|
108
|
+
}
|
|
109
|
+
else {
|
|
110
|
+
doUpdateValue(props.uncheckedValue);
|
|
111
|
+
}
|
|
109
112
|
pressedRef.value = false;
|
|
110
113
|
}
|
|
111
114
|
}
|
|
112
115
|
function handleKeydown(e) {
|
|
113
|
-
if (props.loading)
|
|
116
|
+
if (props.loading || mergedDisabledRef.value)
|
|
114
117
|
return;
|
|
115
118
|
if (e.code === 'Space') {
|
|
116
119
|
e.preventDefault();
|
|
117
120
|
pressedRef.value = true;
|
|
118
121
|
}
|
|
119
122
|
}
|
|
123
|
+
const cssVarsRef = computed(() => {
|
|
124
|
+
const { value: size } = mergedSizeRef;
|
|
125
|
+
const { self: { opacityDisabled, railColor, railColorActive, buttonBoxShadow, buttonColor, boxShadowFocus, loadingColor, textColor, iconColor, [createKey('buttonHeight', size)]: buttonHeight, [createKey('buttonWidth', size)]: buttonWidth, [createKey('buttonWidthPressed', size)]: buttonWidthPressed, [createKey('railHeight', size)]: railHeight, [createKey('railWidth', size)]: railWidth, [createKey('railBorderRadius', size)]: railBorderRadius, [createKey('buttonBorderRadius', size)]: buttonBorderRadius }, common: { cubicBezierEaseInOut } } = themeRef.value;
|
|
126
|
+
const offset = pxfy((depx(railHeight) - depx(buttonHeight)) / 2);
|
|
127
|
+
const height = pxfy(Math.max(depx(railHeight), depx(buttonHeight)));
|
|
128
|
+
const width = depx(railHeight) > depx(buttonHeight)
|
|
129
|
+
? railWidth
|
|
130
|
+
: pxfy(depx(railWidth) + depx(buttonHeight) - depx(railHeight));
|
|
131
|
+
return {
|
|
132
|
+
'--n-bezier': cubicBezierEaseInOut,
|
|
133
|
+
'--n-button-border-radius': buttonBorderRadius,
|
|
134
|
+
'--n-button-box-shadow': buttonBoxShadow,
|
|
135
|
+
'--n-button-color': buttonColor,
|
|
136
|
+
'--n-button-width': buttonWidth,
|
|
137
|
+
'--n-button-width-pressed': buttonWidthPressed,
|
|
138
|
+
'--n-button-height': buttonHeight,
|
|
139
|
+
'--n-height': height,
|
|
140
|
+
'--n-offset': offset,
|
|
141
|
+
'--n-opacity-disabled': opacityDisabled,
|
|
142
|
+
'--n-rail-border-radius': railBorderRadius,
|
|
143
|
+
'--n-rail-color': railColor,
|
|
144
|
+
'--n-rail-color-active': railColorActive,
|
|
145
|
+
'--n-rail-height': railHeight,
|
|
146
|
+
'--n-rail-width': railWidth,
|
|
147
|
+
'--n-width': width,
|
|
148
|
+
'--n-box-shadow-focus': boxShadowFocus,
|
|
149
|
+
'--n-loading-color': loadingColor,
|
|
150
|
+
'--n-text-color': textColor,
|
|
151
|
+
'--n-icon-color': iconColor
|
|
152
|
+
};
|
|
153
|
+
});
|
|
154
|
+
const themeClassHandle = inlineThemeDisabled
|
|
155
|
+
? useThemeClass('switch', computed(() => {
|
|
156
|
+
return mergedSizeRef.value[0];
|
|
157
|
+
}), cssVarsRef, props)
|
|
158
|
+
: undefined;
|
|
120
159
|
return {
|
|
121
160
|
handleClick,
|
|
122
161
|
handleBlur,
|
|
@@ -129,43 +168,22 @@ export default defineComponent({
|
|
|
129
168
|
mergedValue: mergedValueRef,
|
|
130
169
|
checked: checkedRef,
|
|
131
170
|
mergedDisabled: mergedDisabledRef,
|
|
132
|
-
cssVars:
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
const offset = pxfy((depx(railHeight) - depx(buttonHeight)) / 2);
|
|
136
|
-
const height = pxfy(Math.max(depx(railHeight), depx(buttonHeight)));
|
|
137
|
-
const width = depx(railHeight) > depx(buttonHeight)
|
|
138
|
-
? railWidth
|
|
139
|
-
: pxfy(depx(railWidth) + depx(buttonHeight) - depx(railHeight));
|
|
140
|
-
return {
|
|
141
|
-
'--n-bezier': cubicBezierEaseInOut,
|
|
142
|
-
'--n-button-border-radius': buttonBorderRadius,
|
|
143
|
-
'--n-button-box-shadow': buttonBoxShadow,
|
|
144
|
-
'--n-button-color': buttonColor,
|
|
145
|
-
'--n-button-width': buttonWidth,
|
|
146
|
-
'--n-button-width-pressed': buttonWidthPressed,
|
|
147
|
-
'--n-button-height': buttonHeight,
|
|
148
|
-
'--n-height': height,
|
|
149
|
-
'--n-offset': offset,
|
|
150
|
-
'--n-opacity-disabled': opacityDisabled,
|
|
151
|
-
'--n-rail-border-radius': railBorderRadius,
|
|
152
|
-
'--n-rail-color': railColor,
|
|
153
|
-
'--n-rail-color-active': railColorActive,
|
|
154
|
-
'--n-rail-height': railHeight,
|
|
155
|
-
'--n-rail-width': railWidth,
|
|
156
|
-
'--n-width': width,
|
|
157
|
-
'--n-box-shadow-focus': boxShadowFocus,
|
|
158
|
-
'--n-loading-color': loadingColor,
|
|
159
|
-
'--n-text-color': textColor
|
|
160
|
-
};
|
|
161
|
-
})
|
|
171
|
+
cssVars: inlineThemeDisabled ? undefined : cssVarsRef,
|
|
172
|
+
themeClass: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.themeClass,
|
|
173
|
+
onRender: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.onRender
|
|
162
174
|
};
|
|
163
175
|
},
|
|
164
176
|
render() {
|
|
165
|
-
const { mergedClsPrefix, mergedDisabled, checked, mergedRailStyle, $slots } = this;
|
|
166
|
-
|
|
177
|
+
const { mergedClsPrefix, mergedDisabled, checked, mergedRailStyle, onRender, $slots } = this;
|
|
178
|
+
onRender === null || onRender === void 0 ? void 0 : onRender();
|
|
179
|
+
const { checked: checkedSlot, unchecked: uncheckedSlot, icon: iconSlot, 'checked-icon': checkedIconSlot, 'unchecked-icon': uncheckedIconSlot } = $slots;
|
|
180
|
+
const hasIcon = !(isSlotEmpty(iconSlot) &&
|
|
181
|
+
isSlotEmpty(checkedIconSlot) &&
|
|
182
|
+
isSlotEmpty(uncheckedIconSlot));
|
|
167
183
|
return (h("div", { role: "switch", "aria-checked": checked, class: [
|
|
168
184
|
`${mergedClsPrefix}-switch`,
|
|
185
|
+
this.themeClass,
|
|
186
|
+
hasIcon && `${mergedClsPrefix}-switch--icon`,
|
|
169
187
|
checked && `${mergedClsPrefix}-switch--active`,
|
|
170
188
|
mergedDisabled && `${mergedClsPrefix}-switch--disabled`,
|
|
171
189
|
this.round && `${mergedClsPrefix}-switch--round`,
|
|
@@ -173,18 +191,25 @@ export default defineComponent({
|
|
|
173
191
|
this.pressed && `${mergedClsPrefix}-switch--pressed`
|
|
174
192
|
], tabindex: !this.mergedDisabled ? 0 : undefined, style: this.cssVars, onClick: this.handleClick, onFocus: this.handleFocus, onBlur: this.handleBlur, onKeyup: this.handleKeyup, onKeydown: this.handleKeydown },
|
|
175
193
|
h("div", { class: `${mergedClsPrefix}-switch__rail`, "aria-hidden": "true", style: mergedRailStyle },
|
|
176
|
-
(checkedSlot
|
|
177
|
-
|
|
178
|
-
h("div", { class: `${mergedClsPrefix}-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
194
|
+
resolveWrappedSlot(checkedSlot, (checkedSlotChildren) => resolveWrappedSlot(uncheckedSlot, (uncheckedSlotChildren) => {
|
|
195
|
+
if (checkedSlotChildren || uncheckedSlotChildren) {
|
|
196
|
+
return (h("div", { "aria-hidden": true, class: `${mergedClsPrefix}-switch__children-placeholder` },
|
|
197
|
+
h("div", { class: `${mergedClsPrefix}-switch__rail-placeholder` },
|
|
198
|
+
h("div", { class: `${mergedClsPrefix}-switch__button-placeholder` }),
|
|
199
|
+
checkedSlotChildren),
|
|
200
|
+
h("div", { class: `${mergedClsPrefix}-switch__rail-placeholder` },
|
|
201
|
+
h("div", { class: `${mergedClsPrefix}-switch__button-placeholder` }),
|
|
202
|
+
uncheckedSlotChildren)));
|
|
203
|
+
}
|
|
204
|
+
return null;
|
|
205
|
+
})),
|
|
183
206
|
h("div", { class: `${mergedClsPrefix}-switch__button` },
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
207
|
+
resolveWrappedSlot(iconSlot, (icon) => resolveWrappedSlot(checkedIconSlot, (checkedIcon) => resolveWrappedSlot(uncheckedIconSlot, (uncheckedIcon) => {
|
|
208
|
+
return (h(NIconSwitchTransition, null, {
|
|
209
|
+
default: () => this.loading ? (h(NBaseLoading, { key: "loading", clsPrefix: mergedClsPrefix, strokeWidth: 20 })) : this.checked && (checkedIcon || icon) ? (h("div", { class: `${mergedClsPrefix}-switch__button-icon`, key: checkedIcon ? 'checked-icon' : 'icon' }, checkedIcon || icon)) : !this.checked && (uncheckedIcon || icon) ? (h("div", { class: `${mergedClsPrefix}-switch__button-icon`, key: uncheckedIcon ? 'unchecked-icon' : 'icon' }, uncheckedIcon || icon)) : null
|
|
210
|
+
}));
|
|
211
|
+
}))),
|
|
212
|
+
resolveWrappedSlot(checkedSlot, (children) => children && (h("div", { key: "checked", class: `${mergedClsPrefix}-switch__checked` }, children))),
|
|
213
|
+
resolveWrappedSlot(uncheckedSlot, (children) => children && (h("div", { key: "unchecked", class: `${mergedClsPrefix}-switch__unchecked` }, children)))))));
|
|
189
214
|
}
|
|
190
215
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import iconSwitchTransition from '../../../_styles/transitions/icon-switch.cssr';
|
|
2
2
|
import { c, cB, cE, cM, cNotM } from '../../../_utils/cssr'; // vars:
|
|
3
3
|
// --n-bezier
|
|
4
4
|
// --n-button-border-radius
|
|
@@ -17,6 +17,7 @@ import { c, cB, cE, cM, cNotM } from '../../../_utils/cssr'; // vars:
|
|
|
17
17
|
// --n-box-shadow-focus
|
|
18
18
|
// --n-loading-color
|
|
19
19
|
// --n-text-color
|
|
20
|
+
// --n-icon-color
|
|
20
21
|
|
|
21
22
|
export default cB('switch', `
|
|
22
23
|
height: var(--n-height);
|
|
@@ -48,7 +49,7 @@ export default cB('switch', `
|
|
|
48
49
|
font-size: calc(var(--n-button-width) - 4px);
|
|
49
50
|
color: var(--n-loading-color);
|
|
50
51
|
transition: color .3s var(--n-bezier);
|
|
51
|
-
`, [
|
|
52
|
+
`, [iconSwitchTransition({
|
|
52
53
|
originalTransform: 'translateX(-50%) translateY(-50%)'
|
|
53
54
|
})]), cE('checked, unchecked', `
|
|
54
55
|
transition: color .3s var(--n-bezier);
|
|
@@ -74,7 +75,7 @@ export default cB('switch', `
|
|
|
74
75
|
borderRadius: 'calc(var(--n-rail-height) / 2)'
|
|
75
76
|
}, [cE('button', {
|
|
76
77
|
borderRadius: 'calc(var(--n-button-height) / 2)'
|
|
77
|
-
})])]), cNotM('disabled', [cM('pressed', [cE('rail', [cE('button', {
|
|
78
|
+
})])]), cNotM('disabled', [cNotM('icon', [cM('pressed', [cE('rail', [cE('button', {
|
|
78
79
|
maxWidth: 'var(--n-button-width-pressed)'
|
|
79
80
|
})])]), cE('rail', [c('&:active', [cE('button', {
|
|
80
81
|
maxWidth: 'var(--n-button-width-pressed)'
|
|
@@ -82,7 +83,7 @@ export default cB('switch', `
|
|
|
82
83
|
left: 'calc(100% - var(--n-offset) - var(--n-button-width-pressed))'
|
|
83
84
|
})])]), cE('rail', [c('&:active', [cE('button', {
|
|
84
85
|
left: 'calc(100% - var(--n-offset) - var(--n-button-width-pressed))'
|
|
85
|
-
})])])])]), cM('active', [cE('rail', [cE('button', {
|
|
86
|
+
})])])])])]), cM('active', [cE('rail', [cE('button', {
|
|
86
87
|
left: 'calc(100% - (var(--n-rail-height) + var(--n-button-width)) / 2)'
|
|
87
88
|
})])]), cE('rail', `
|
|
88
89
|
overflow: hidden;
|
|
@@ -95,7 +96,21 @@ export default cB('switch', `
|
|
|
95
96
|
background .3s var(--n-bezier),
|
|
96
97
|
box-shadow .3s var(--n-bezier);
|
|
97
98
|
background-color: var(--n-rail-color);
|
|
98
|
-
`, [cE('button', `
|
|
99
|
+
`, [cE('button-icon', `
|
|
100
|
+
color: var(--n-icon-color);
|
|
101
|
+
transition: color .3s var(--n-bezier);
|
|
102
|
+
font-size: calc(var(--n-button-height) - 4px);
|
|
103
|
+
position: absolute;
|
|
104
|
+
left: 0;
|
|
105
|
+
right: 0;
|
|
106
|
+
top: 0;
|
|
107
|
+
bottom: 0;
|
|
108
|
+
display: flex;
|
|
109
|
+
justify-content: center;
|
|
110
|
+
align-items: center;
|
|
111
|
+
line-height: 1;
|
|
112
|
+
`, [iconSwitchTransition()]), cE('button', `
|
|
113
|
+
align-items: center;
|
|
99
114
|
top: var(--n-offset);
|
|
100
115
|
left: var(--n-offset);
|
|
101
116
|
height: var(--n-button-width);
|
|
@@ -114,9 +129,7 @@ export default cB('switch', `
|
|
|
114
129
|
opacity .3s var(--n-bezier),
|
|
115
130
|
max-width .3s var(--n-bezier),
|
|
116
131
|
box-shadow .3s var(--n-bezier);
|
|
117
|
-
`)]), cM('active', [cE('rail',
|
|
118
|
-
backgroundColor: 'var(--n-rail-color-active)'
|
|
119
|
-
})]), cM('disabled', [cE('rail', `
|
|
132
|
+
`)]), cM('active', [cE('rail', 'background-color: var(--n-rail-color-active);')]), cM('disabled', [cE('rail', `
|
|
120
133
|
cursor: not-allowed;
|
|
121
134
|
opacity: .5;
|
|
122
135
|
`)]), cM('loading', [cE('rail', `
|
package/es/switch/styles/dark.js
CHANGED
|
@@ -5,9 +5,9 @@ const switchDark = {
|
|
|
5
5
|
name: 'Switch',
|
|
6
6
|
common: commonDark,
|
|
7
7
|
self(vars) {
|
|
8
|
-
const { primaryColorSuppl, opacityDisabled, borderRadius, primaryColor, textColor2 } = vars;
|
|
8
|
+
const { primaryColorSuppl, opacityDisabled, borderRadius, primaryColor, textColor2, baseColor } = vars;
|
|
9
9
|
const railOverlayColor = 'rgba(255, 255, 255, .20)';
|
|
10
|
-
return Object.assign(Object.assign({}, commonVars), { textColor: textColor2, loadingColor: primaryColorSuppl, opacityDisabled, railColor: railOverlayColor, railColorActive: primaryColorSuppl, buttonBoxShadow: '0px 2px 4px 0 rgba(0, 0, 0, 0.4)', buttonColor: '#FFF', railBorderRadiusSmall: borderRadius, railBorderRadiusMedium: borderRadius, railBorderRadiusLarge: borderRadius, buttonBorderRadiusSmall: borderRadius, buttonBorderRadiusMedium: borderRadius, buttonBorderRadiusLarge: borderRadius, boxShadowFocus: `0 0 8px 0 ${changeColor(primaryColor, { alpha: 0.3 })}` });
|
|
10
|
+
return Object.assign(Object.assign({}, commonVars), { iconColor: baseColor, textColor: textColor2, loadingColor: primaryColorSuppl, opacityDisabled, railColor: railOverlayColor, railColorActive: primaryColorSuppl, buttonBoxShadow: '0px 2px 4px 0 rgba(0, 0, 0, 0.4)', buttonColor: '#FFF', railBorderRadiusSmall: borderRadius, railBorderRadiusMedium: borderRadius, railBorderRadiusLarge: borderRadius, buttonBorderRadiusSmall: borderRadius, buttonBorderRadiusMedium: borderRadius, buttonBorderRadiusLarge: borderRadius, boxShadowFocus: `0 0 8px 0 ${changeColor(primaryColor, { alpha: 0.3 })}` });
|
|
11
11
|
}
|
|
12
12
|
};
|
|
13
13
|
export default switchDark;
|
|
@@ -2,9 +2,9 @@ import { changeColor } from 'seemly';
|
|
|
2
2
|
import commonVars from './_common';
|
|
3
3
|
import { commonLight } from '../../_styles/common';
|
|
4
4
|
const self = (vars) => {
|
|
5
|
-
const { primaryColor, opacityDisabled, borderRadius } = vars;
|
|
5
|
+
const { primaryColor, opacityDisabled, borderRadius, textColor3 } = vars;
|
|
6
6
|
const railOverlayColor = 'rgba(0, 0, 0, .14)';
|
|
7
|
-
return Object.assign(Object.assign({}, commonVars), { textColor: 'white', loadingColor: primaryColor, opacityDisabled, railColor: railOverlayColor, railColorActive: primaryColor, buttonBoxShadow: '0 1px 4px 0 rgba(0, 0, 0, 0.3), inset 0 0 1px 0 rgba(0, 0, 0, 0.05)', buttonColor: '#FFF', railBorderRadiusSmall: borderRadius, railBorderRadiusMedium: borderRadius, railBorderRadiusLarge: borderRadius, buttonBorderRadiusSmall: borderRadius, buttonBorderRadiusMedium: borderRadius, buttonBorderRadiusLarge: borderRadius, boxShadowFocus: `0 0 0 2px ${changeColor(primaryColor, { alpha: 0.2 })}` });
|
|
7
|
+
return Object.assign(Object.assign({}, commonVars), { iconColor: textColor3, textColor: 'white', loadingColor: primaryColor, opacityDisabled, railColor: railOverlayColor, railColorActive: primaryColor, buttonBoxShadow: '0 1px 4px 0 rgba(0, 0, 0, 0.3), inset 0 0 1px 0 rgba(0, 0, 0, 0.05)', buttonColor: '#FFF', railBorderRadiusSmall: borderRadius, railBorderRadiusMedium: borderRadius, railBorderRadiusLarge: borderRadius, buttonBorderRadiusSmall: borderRadius, buttonBorderRadiusMedium: borderRadius, buttonBorderRadiusLarge: borderRadius, boxShadowFocus: `0 0 0 2px ${changeColor(primaryColor, { alpha: 0.2 })}` });
|
|
8
8
|
};
|
|
9
9
|
const switchLight = {
|
|
10
10
|
name: 'Switch',
|
package/es/table/src/Table.d.ts
CHANGED
|
@@ -232,7 +232,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
232
232
|
'--n-td-color-striped': string;
|
|
233
233
|
'--n-td-color-striped-modal': string;
|
|
234
234
|
'--n-td-color-striped-popover': string;
|
|
235
|
-
}
|
|
235
|
+
}> | undefined;
|
|
236
|
+
themeClass: import("vue").Ref<string> | undefined;
|
|
237
|
+
onRender: (() => void) | undefined;
|
|
236
238
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
237
239
|
bordered: {
|
|
238
240
|
type: BooleanConstructor;
|
package/es/table/src/Table.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent, computed, h } from 'vue';
|
|
2
|
-
import { useConfig, useTheme } from '../../_mixins';
|
|
2
|
+
import { useConfig, useTheme, useThemeClass } from '../../_mixins';
|
|
3
3
|
import { createKey } from '../../_utils';
|
|
4
4
|
import { tableLight } from '../styles';
|
|
5
5
|
import style from './styles/index.cssr';
|
|
@@ -20,43 +20,54 @@ export default defineComponent({
|
|
|
20
20
|
name: 'Table',
|
|
21
21
|
props: tableProps,
|
|
22
22
|
setup(props) {
|
|
23
|
-
const { mergedClsPrefixRef } = useConfig(props);
|
|
23
|
+
const { mergedClsPrefixRef, inlineThemeDisabled } = useConfig(props);
|
|
24
24
|
const themeRef = useTheme('Table', '-table', style, tableLight, props, mergedClsPrefixRef);
|
|
25
|
+
const cssVarsRef = computed(() => {
|
|
26
|
+
const { size } = props;
|
|
27
|
+
const { self: { borderColor, tdColor, tdColorModal, tdColorPopover, thColor, thColorModal, thColorPopover, thTextColor, tdTextColor, borderRadius, thFontWeight, lineHeight, borderColorModal, borderColorPopover, tdColorStriped, tdColorStripedModal, tdColorStripedPopover, [createKey('fontSize', size)]: fontSize, [createKey('tdPadding', size)]: tdPadding, [createKey('thPadding', size)]: thPadding }, common: { cubicBezierEaseInOut } } = themeRef.value;
|
|
28
|
+
return {
|
|
29
|
+
'--n-bezier': cubicBezierEaseInOut,
|
|
30
|
+
'--n-td-color': tdColor,
|
|
31
|
+
'--n-td-color-modal': tdColorModal,
|
|
32
|
+
'--n-td-color-popover': tdColorPopover,
|
|
33
|
+
'--n-td-text-color': tdTextColor,
|
|
34
|
+
'--n-border-color': borderColor,
|
|
35
|
+
'--n-border-color-modal': borderColorModal,
|
|
36
|
+
'--n-border-color-popover': borderColorPopover,
|
|
37
|
+
'--n-border-radius': borderRadius,
|
|
38
|
+
'--n-font-size': fontSize,
|
|
39
|
+
'--n-th-color': thColor,
|
|
40
|
+
'--n-th-color-modal': thColorModal,
|
|
41
|
+
'--n-th-color-popover': thColorPopover,
|
|
42
|
+
'--n-th-font-weight': thFontWeight,
|
|
43
|
+
'--n-th-text-color': thTextColor,
|
|
44
|
+
'--n-line-height': lineHeight,
|
|
45
|
+
'--n-td-padding': tdPadding,
|
|
46
|
+
'--n-th-padding': thPadding,
|
|
47
|
+
'--n-td-color-striped': tdColorStriped,
|
|
48
|
+
'--n-td-color-striped-modal': tdColorStripedModal,
|
|
49
|
+
'--n-td-color-striped-popover': tdColorStripedPopover
|
|
50
|
+
};
|
|
51
|
+
});
|
|
52
|
+
const themeClassHandle = inlineThemeDisabled
|
|
53
|
+
? useThemeClass('table', computed(() => {
|
|
54
|
+
return props.size[0];
|
|
55
|
+
}), cssVarsRef, props)
|
|
56
|
+
: undefined;
|
|
25
57
|
return {
|
|
26
58
|
mergedClsPrefix: mergedClsPrefixRef,
|
|
27
|
-
cssVars:
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
return {
|
|
31
|
-
'--n-bezier': cubicBezierEaseInOut,
|
|
32
|
-
'--n-td-color': tdColor,
|
|
33
|
-
'--n-td-color-modal': tdColorModal,
|
|
34
|
-
'--n-td-color-popover': tdColorPopover,
|
|
35
|
-
'--n-td-text-color': tdTextColor,
|
|
36
|
-
'--n-border-color': borderColor,
|
|
37
|
-
'--n-border-color-modal': borderColorModal,
|
|
38
|
-
'--n-border-color-popover': borderColorPopover,
|
|
39
|
-
'--n-border-radius': borderRadius,
|
|
40
|
-
'--n-font-size': fontSize,
|
|
41
|
-
'--n-th-color': thColor,
|
|
42
|
-
'--n-th-color-modal': thColorModal,
|
|
43
|
-
'--n-th-color-popover': thColorPopover,
|
|
44
|
-
'--n-th-font-weight': thFontWeight,
|
|
45
|
-
'--n-th-text-color': thTextColor,
|
|
46
|
-
'--n-line-height': lineHeight,
|
|
47
|
-
'--n-td-padding': tdPadding,
|
|
48
|
-
'--n-th-padding': thPadding,
|
|
49
|
-
'--n-td-color-striped': tdColorStriped,
|
|
50
|
-
'--n-td-color-striped-modal': tdColorStripedModal,
|
|
51
|
-
'--n-td-color-striped-popover': tdColorStripedPopover
|
|
52
|
-
};
|
|
53
|
-
})
|
|
59
|
+
cssVars: inlineThemeDisabled ? undefined : cssVarsRef,
|
|
60
|
+
themeClass: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.themeClass,
|
|
61
|
+
onRender: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.onRender
|
|
54
62
|
};
|
|
55
63
|
},
|
|
56
64
|
render() {
|
|
65
|
+
var _a;
|
|
57
66
|
const { mergedClsPrefix } = this;
|
|
67
|
+
(_a = this.onRender) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
58
68
|
return (h("table", { class: [
|
|
59
69
|
`${mergedClsPrefix}-table`,
|
|
70
|
+
this.themeClass,
|
|
60
71
|
{
|
|
61
72
|
[`${mergedClsPrefix}-table--bottom-bordered`]: this.bottomBordered,
|
|
62
73
|
[`${mergedClsPrefix}-table--bordered`]: this.bordered,
|
|
@@ -69,7 +69,7 @@ export default c([cB('table', `
|
|
|
69
69
|
border: 1px solid var(--n-merged-border-color);
|
|
70
70
|
border-radius: var(--n-border-radius);
|
|
71
71
|
`, [c('tr', [c('&:last-child', [c('td', `
|
|
72
|
-
border-bottom:
|
|
72
|
+
border-bottom: 0 solid var(--n-merged-border-color);
|
|
73
73
|
`)])])]), cM('single-line', [c('th', `
|
|
74
74
|
border-right: none;
|
|
75
75
|
`), c('td', `
|
package/es/tabs/src/Tabs.d.ts
CHANGED
|
@@ -494,29 +494,31 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
494
494
|
handleScroll: import("lodash").DebouncedFunc<(e: Event) => void>;
|
|
495
495
|
handleTabsResize: import("lodash").DebouncedFunc<(entry: ResizeObserverEntry) => void>;
|
|
496
496
|
cssVars: import("vue").ComputedRef<{
|
|
497
|
-
'--bezier': string;
|
|
498
|
-
'--color-segment': string;
|
|
499
|
-
'--bar-color': string;
|
|
500
|
-
'--tab-font-size': string;
|
|
501
|
-
'--tab-text-color': string;
|
|
502
|
-
'--tab-text-color-active': string;
|
|
503
|
-
'--tab-text-color-disabled': string;
|
|
504
|
-
'--tab-text-color-hover': string;
|
|
505
|
-
'--pane-text-color': string;
|
|
506
|
-
'--tab-border-color': string;
|
|
507
|
-
'--tab-border-radius': string;
|
|
508
|
-
'--close-color': string;
|
|
509
|
-
'--close-color-hover': string;
|
|
510
|
-
'--close-color-pressed': string;
|
|
511
|
-
'--tab-color': string;
|
|
512
|
-
'--tab-font-weight': string;
|
|
513
|
-
'--tab-font-weight-active': string;
|
|
514
|
-
'--tab-padding': string;
|
|
515
|
-
'--tab-gap': string;
|
|
516
|
-
'--pane-padding': string;
|
|
517
|
-
'--font-weight-strong': string;
|
|
518
|
-
'--tab-color-segment': string;
|
|
519
|
-
}
|
|
497
|
+
'--n-bezier': string;
|
|
498
|
+
'--n-color-segment': string;
|
|
499
|
+
'--n-bar-color': string;
|
|
500
|
+
'--n-tab-font-size': string;
|
|
501
|
+
'--n-tab-text-color': string;
|
|
502
|
+
'--n-tab-text-color-active': string;
|
|
503
|
+
'--n-tab-text-color-disabled': string;
|
|
504
|
+
'--n-tab-text-color-hover': string;
|
|
505
|
+
'--n-pane-text-color': string;
|
|
506
|
+
'--n-tab-border-color': string;
|
|
507
|
+
'--n-tab-border-radius': string;
|
|
508
|
+
'--n-close-color': string;
|
|
509
|
+
'--n-close-color-hover': string;
|
|
510
|
+
'--n-close-color-pressed': string;
|
|
511
|
+
'--n-tab-color': string;
|
|
512
|
+
'--n-tab-font-weight': string;
|
|
513
|
+
'--n-tab-font-weight-active': string;
|
|
514
|
+
'--n-tab-padding': string;
|
|
515
|
+
'--n-tab-gap': string;
|
|
516
|
+
'--n-pane-padding': string;
|
|
517
|
+
'--n-font-weight-strong': string;
|
|
518
|
+
'--n-tab-color-segment': string;
|
|
519
|
+
}> | undefined;
|
|
520
|
+
themeClass: import("vue").Ref<string> | undefined;
|
|
521
|
+
onRender: (() => void) | undefined;
|
|
520
522
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
|
|
521
523
|
readonly value: PropType<string | number>;
|
|
522
524
|
readonly defaultValue: PropType<string | number>;
|
package/es/tabs/src/Tabs.js
CHANGED
|
@@ -2,8 +2,8 @@ import { h, ref, defineComponent, computed, provide, watch, toRef, nextTick, wit
|
|
|
2
2
|
import { VResizeObserver, VXScroll } from 'vueuc';
|
|
3
3
|
import { throttle } from 'lodash-es';
|
|
4
4
|
import { useCompitable, onFontsReady, useMergedState } from 'vooks';
|
|
5
|
-
import { useConfig, useTheme } from '../../_mixins';
|
|
6
|
-
import { createKey, call, flatten, warnOnce } from '../../_utils';
|
|
5
|
+
import { useConfig, useTheme, useThemeClass } from '../../_mixins';
|
|
6
|
+
import { createKey, call, flatten, warnOnce, resolveWrappedSlot } from '../../_utils';
|
|
7
7
|
import { tabsLight } from '../styles';
|
|
8
8
|
import { tabsInjectionKey } from './interface';
|
|
9
9
|
import Tab from './Tab';
|
|
@@ -38,7 +38,7 @@ export default defineComponent({
|
|
|
38
38
|
}
|
|
39
39
|
});
|
|
40
40
|
}
|
|
41
|
-
const { mergedClsPrefixRef } = useConfig(props);
|
|
41
|
+
const { mergedClsPrefixRef, inlineThemeDisabled } = useConfig(props);
|
|
42
42
|
const themeRef = useTheme('Tabs', '-tabs', style, tabsLight, props, mergedClsPrefixRef);
|
|
43
43
|
const tabsElRef = ref(null);
|
|
44
44
|
const barElRef = ref(null);
|
|
@@ -241,50 +241,57 @@ export default defineComponent({
|
|
|
241
241
|
updateCurrentBarStyle();
|
|
242
242
|
}
|
|
243
243
|
};
|
|
244
|
+
const cssVarsRef = computed(() => {
|
|
245
|
+
const { value: size } = compitableSizeRef;
|
|
246
|
+
const { type } = props;
|
|
247
|
+
const typeSuffix = {
|
|
248
|
+
card: 'Card',
|
|
249
|
+
bar: 'Bar',
|
|
250
|
+
line: 'Line',
|
|
251
|
+
segment: 'Segment'
|
|
252
|
+
}[type];
|
|
253
|
+
const sizeType = `${size}${typeSuffix}`;
|
|
254
|
+
const { self: { barColor, closeColor, closeColorHover, closeColorPressed, tabColor, tabBorderColor, paneTextColor, tabFontWeight, tabBorderRadius, tabFontWeightActive, colorSegment, fontWeightStrong, tabColorSegment, [createKey('panePadding', size)]: panePadding, [createKey('tabPadding', sizeType)]: tabPadding, [createKey('tabGap', sizeType)]: tabGap, [createKey('tabTextColor', type)]: tabTextColor, [createKey('tabTextColorActive', type)]: tabTextColorActive, [createKey('tabTextColorHover', type)]: tabTextColorHover, [createKey('tabTextColorDisabled', type)]: tabTextColorDisabled, [createKey('tabFontSize', size)]: tabFontSize }, common: { cubicBezierEaseInOut } } = themeRef.value;
|
|
255
|
+
return {
|
|
256
|
+
'--n-bezier': cubicBezierEaseInOut,
|
|
257
|
+
'--n-color-segment': colorSegment,
|
|
258
|
+
'--n-bar-color': barColor,
|
|
259
|
+
'--n-tab-font-size': tabFontSize,
|
|
260
|
+
'--n-tab-text-color': tabTextColor,
|
|
261
|
+
'--n-tab-text-color-active': tabTextColorActive,
|
|
262
|
+
'--n-tab-text-color-disabled': tabTextColorDisabled,
|
|
263
|
+
'--n-tab-text-color-hover': tabTextColorHover,
|
|
264
|
+
'--n-pane-text-color': paneTextColor,
|
|
265
|
+
'--n-tab-border-color': tabBorderColor,
|
|
266
|
+
'--n-tab-border-radius': tabBorderRadius,
|
|
267
|
+
'--n-close-color': closeColor,
|
|
268
|
+
'--n-close-color-hover': closeColorHover,
|
|
269
|
+
'--n-close-color-pressed': closeColorPressed,
|
|
270
|
+
'--n-tab-color': tabColor,
|
|
271
|
+
'--n-tab-font-weight': tabFontWeight,
|
|
272
|
+
'--n-tab-font-weight-active': tabFontWeightActive,
|
|
273
|
+
'--n-tab-padding': tabPadding,
|
|
274
|
+
'--n-tab-gap': tabGap,
|
|
275
|
+
'--n-pane-padding': panePadding,
|
|
276
|
+
'--n-font-weight-strong': fontWeightStrong,
|
|
277
|
+
'--n-tab-color-segment': tabColorSegment
|
|
278
|
+
};
|
|
279
|
+
});
|
|
280
|
+
const themeClassHandle = inlineThemeDisabled
|
|
281
|
+
? useThemeClass('tabs', computed(() => {
|
|
282
|
+
return `${compitableSizeRef.value[0]}${props.type[0]}`;
|
|
283
|
+
}), cssVarsRef, props)
|
|
284
|
+
: undefined;
|
|
244
285
|
return Object.assign({ mergedClsPrefix: mergedClsPrefixRef, mergedValue: mergedValueRef, renderedNames: new Set(), tabsElRef,
|
|
245
286
|
barElRef,
|
|
246
287
|
addTabInstRef,
|
|
247
288
|
xScrollInstRef,
|
|
248
289
|
scrollWrapperElRef, addTabFixed: addTabFixedRef, tabWrapperStyle: tabWrapperStyleRef, handleNavResize, mergedSize: compitableSizeRef, handleScroll,
|
|
249
|
-
handleTabsResize, cssVars:
|
|
250
|
-
const { value: size } = compitableSizeRef;
|
|
251
|
-
const { type } = props;
|
|
252
|
-
const typeSuffix = {
|
|
253
|
-
card: 'Card',
|
|
254
|
-
bar: 'Bar',
|
|
255
|
-
line: 'Line',
|
|
256
|
-
segment: 'Segment'
|
|
257
|
-
}[type];
|
|
258
|
-
const sizeType = `${size}${typeSuffix}`;
|
|
259
|
-
const { self: { barColor, closeColor, closeColorHover, closeColorPressed, tabColor, tabBorderColor, paneTextColor, tabFontWeight, tabBorderRadius, tabFontWeightActive, colorSegment, fontWeightStrong, tabColorSegment, [createKey('panePadding', size)]: panePadding, [createKey('tabPadding', sizeType)]: tabPadding, [createKey('tabGap', sizeType)]: tabGap, [createKey('tabTextColor', type)]: tabTextColor, [createKey('tabTextColorActive', type)]: tabTextColorActive, [createKey('tabTextColorHover', type)]: tabTextColorHover, [createKey('tabTextColorDisabled', type)]: tabTextColorDisabled, [createKey('tabFontSize', size)]: tabFontSize }, common: { cubicBezierEaseInOut } } = themeRef.value;
|
|
260
|
-
return {
|
|
261
|
-
'--bezier': cubicBezierEaseInOut,
|
|
262
|
-
'--color-segment': colorSegment,
|
|
263
|
-
'--bar-color': barColor,
|
|
264
|
-
'--tab-font-size': tabFontSize,
|
|
265
|
-
'--tab-text-color': tabTextColor,
|
|
266
|
-
'--tab-text-color-active': tabTextColorActive,
|
|
267
|
-
'--tab-text-color-disabled': tabTextColorDisabled,
|
|
268
|
-
'--tab-text-color-hover': tabTextColorHover,
|
|
269
|
-
'--pane-text-color': paneTextColor,
|
|
270
|
-
'--tab-border-color': tabBorderColor,
|
|
271
|
-
'--tab-border-radius': tabBorderRadius,
|
|
272
|
-
'--close-color': closeColor,
|
|
273
|
-
'--close-color-hover': closeColorHover,
|
|
274
|
-
'--close-color-pressed': closeColorPressed,
|
|
275
|
-
'--tab-color': tabColor,
|
|
276
|
-
'--tab-font-weight': tabFontWeight,
|
|
277
|
-
'--tab-font-weight-active': tabFontWeightActive,
|
|
278
|
-
'--tab-padding': tabPadding,
|
|
279
|
-
'--tab-gap': tabGap,
|
|
280
|
-
'--pane-padding': panePadding,
|
|
281
|
-
'--font-weight-strong': fontWeightStrong,
|
|
282
|
-
'--tab-color-segment': tabColorSegment
|
|
283
|
-
};
|
|
284
|
-
}) }, exposedMethods);
|
|
290
|
+
handleTabsResize, cssVars: inlineThemeDisabled ? undefined : cssVarsRef, themeClass: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.themeClass, onRender: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.onRender }, exposedMethods);
|
|
285
291
|
},
|
|
286
292
|
render() {
|
|
287
|
-
const { mergedClsPrefix, type, addTabFixed, addable, mergedSize, $slots: { default: defaultSlot, prefix: prefixSlot, suffix: suffixSlot } } = this;
|
|
293
|
+
const { mergedClsPrefix, type, addTabFixed, addable, mergedSize, onRender, $slots: { default: defaultSlot, prefix: prefixSlot, suffix: suffixSlot } } = this;
|
|
294
|
+
onRender === null || onRender === void 0 ? void 0 : onRender();
|
|
288
295
|
const tabPaneChildren = defaultSlot
|
|
289
296
|
? flatten(defaultSlot()).filter((v) => {
|
|
290
297
|
return v.type.__TAB_PANE__ === true;
|
|
@@ -296,13 +303,12 @@ export default defineComponent({
|
|
|
296
303
|
})
|
|
297
304
|
: [];
|
|
298
305
|
const showPane = !tabChildren.length;
|
|
299
|
-
const prefix = prefixSlot ? prefixSlot() : null;
|
|
300
|
-
const suffix = suffixSlot ? suffixSlot() : null;
|
|
301
306
|
const isCard = type === 'card';
|
|
302
307
|
const isSegment = type === 'segment';
|
|
303
308
|
const mergedJustifyContent = !isCard && !isSegment && this.justifyContent;
|
|
304
309
|
return (h("div", { class: [
|
|
305
310
|
`${mergedClsPrefix}-tabs`,
|
|
311
|
+
this.themeClass,
|
|
306
312
|
`${mergedClsPrefix}-tabs--${type}-type`,
|
|
307
313
|
`${mergedClsPrefix}-tabs--${mergedSize}-size`,
|
|
308
314
|
mergedJustifyContent && `${mergedClsPrefix}-tabs--flex`
|
|
@@ -315,7 +321,7 @@ export default defineComponent({
|
|
|
315
321
|
`${mergedClsPrefix}-tabs-nav--${type}-type`,
|
|
316
322
|
`${mergedClsPrefix}-tabs-nav`
|
|
317
323
|
] },
|
|
318
|
-
|
|
324
|
+
resolveWrappedSlot(prefixSlot, (children) => children && (h("div", { class: `${mergedClsPrefix}-tabs-nav__prefix` }, children))),
|
|
319
325
|
isSegment ? (h("div", { class: `${mergedClsPrefix}-tabs-rail` }, showPane
|
|
320
326
|
? tabPaneChildren.map((tabPaneVNode, index) => {
|
|
321
327
|
return (h(Tab, Object.assign({}, tabPaneVNode.props, { internalCreatedByPane: true, internalLeftPadded: index !== 0 }), tabPaneVNode.children
|
|
@@ -376,7 +382,7 @@ export default defineComponent({
|
|
|
376
382
|
addTabFixed && addable && isCard
|
|
377
383
|
? createAddTag(addable, true)
|
|
378
384
|
: null,
|
|
379
|
-
|
|
385
|
+
resolveWrappedSlot(suffixSlot, (children) => children && (h("div", { class: `${mergedClsPrefix}-tabs-nav__suffix` }, children)))),
|
|
380
386
|
showPane &&
|
|
381
387
|
filterMapTabPanes(tabPaneChildren, this.mergedValue, this.renderedNames)));
|
|
382
388
|
}
|