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/alert/src/Alert.js
CHANGED
|
@@ -2,8 +2,8 @@ import { h, ref, computed, defineComponent, mergeProps } from 'vue';
|
|
|
2
2
|
import { getMargin } from 'seemly';
|
|
3
3
|
import { InfoIcon, SuccessIcon, WarningIcon, ErrorIcon } from '../../_internal/icons';
|
|
4
4
|
import { NFadeInExpandTransition, NBaseClose, NBaseIcon } from '../../_internal';
|
|
5
|
-
import { useConfig, useTheme } from '../../_mixins';
|
|
6
|
-
import { warn, createKey } from '../../_utils';
|
|
5
|
+
import { useConfig, useTheme, useThemeClass } from '../../_mixins';
|
|
6
|
+
import { warn, createKey, resolveSlot, resolveWrappedSlot } from '../../_utils';
|
|
7
7
|
import { alertLight } from '../styles';
|
|
8
8
|
import style from './styles/index.cssr';
|
|
9
9
|
const alertProps = Object.assign(Object.assign({}, useTheme.props), { title: {
|
|
@@ -36,9 +36,9 @@ export default defineComponent({
|
|
|
36
36
|
inheritAttrs: false,
|
|
37
37
|
props: alertProps,
|
|
38
38
|
setup(props) {
|
|
39
|
-
const { mergedClsPrefixRef } = useConfig(props);
|
|
39
|
+
const { mergedClsPrefixRef, inlineThemeDisabled } = useConfig(props);
|
|
40
40
|
const themeRef = useTheme('Alert', '-alert', style, alertLight, props, mergedClsPrefixRef);
|
|
41
|
-
const
|
|
41
|
+
const cssVarsRef = computed(() => {
|
|
42
42
|
const { common: { cubicBezierEaseInOut }, self } = themeRef.value;
|
|
43
43
|
const { fontSize, borderRadius, titleFontWeight, lineHeight, iconSize, iconMargin, closeSize, closeMargin, padding } = self;
|
|
44
44
|
const { type } = props;
|
|
@@ -66,6 +66,11 @@ export default defineComponent({
|
|
|
66
66
|
'--n-icon-margin-right': right
|
|
67
67
|
};
|
|
68
68
|
});
|
|
69
|
+
const themeClassHandle = inlineThemeDisabled
|
|
70
|
+
? useThemeClass('alert', computed(() => {
|
|
71
|
+
return props.type[0];
|
|
72
|
+
}), cssVarsRef, props)
|
|
73
|
+
: undefined;
|
|
69
74
|
const visibleRef = ref(true);
|
|
70
75
|
const doAfterLeave = () => {
|
|
71
76
|
const { onAfterLeave, onAfterHide // deprecated
|
|
@@ -92,16 +97,21 @@ export default defineComponent({
|
|
|
92
97
|
handleCloseClick,
|
|
93
98
|
handleAfterLeave,
|
|
94
99
|
mergedTheme: themeRef,
|
|
95
|
-
cssVars
|
|
100
|
+
cssVars: inlineThemeDisabled ? undefined : cssVarsRef,
|
|
101
|
+
themeClass: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.themeClass,
|
|
102
|
+
onRender: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.onRender
|
|
96
103
|
};
|
|
97
104
|
},
|
|
98
105
|
render() {
|
|
106
|
+
var _a;
|
|
107
|
+
(_a = this.onRender) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
99
108
|
return (h(NFadeInExpandTransition, { onAfterLeave: this.handleAfterLeave }, {
|
|
100
109
|
default: () => {
|
|
101
110
|
const { mergedClsPrefix, $slots } = this;
|
|
102
111
|
const attrs = {
|
|
103
112
|
class: [
|
|
104
113
|
`${mergedClsPrefix}-alert`,
|
|
114
|
+
this.themeClass,
|
|
105
115
|
this.showIcon && `${mergedClsPrefix}-alert--show-icon`
|
|
106
116
|
],
|
|
107
117
|
style: this.cssVars,
|
|
@@ -109,24 +119,29 @@ export default defineComponent({
|
|
|
109
119
|
};
|
|
110
120
|
return this.visible ? (h("div", Object.assign({}, mergeProps(this.$attrs, attrs)),
|
|
111
121
|
this.closable && (h(NBaseClose, { clsPrefix: mergedClsPrefix, class: `${mergedClsPrefix}-alert__close`, onClick: this.handleCloseClick })),
|
|
112
|
-
this.showIcon && (h("div", { class: `${mergedClsPrefix}-alert__icon`, "aria-hidden": "true" }, $slots.icon
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
122
|
+
this.showIcon && (h("div", { class: `${mergedClsPrefix}-alert__icon`, "aria-hidden": "true" }, resolveSlot($slots.icon, () => [
|
|
123
|
+
h(NBaseIcon, { clsPrefix: mergedClsPrefix }, {
|
|
124
|
+
default: () => {
|
|
125
|
+
switch (this.type) {
|
|
126
|
+
case 'success':
|
|
127
|
+
return h(SuccessIcon, null);
|
|
128
|
+
case 'info':
|
|
129
|
+
return h(InfoIcon, null);
|
|
130
|
+
case 'warning':
|
|
131
|
+
return h(WarningIcon, null);
|
|
132
|
+
case 'error':
|
|
133
|
+
return h(ErrorIcon, null);
|
|
134
|
+
default:
|
|
135
|
+
return null;
|
|
136
|
+
}
|
|
125
137
|
}
|
|
126
|
-
}
|
|
127
|
-
|
|
138
|
+
})
|
|
139
|
+
]))),
|
|
128
140
|
h("div", { class: `${mergedClsPrefix}-alert-body` },
|
|
129
|
-
|
|
141
|
+
resolveWrappedSlot($slots.header, (children) => {
|
|
142
|
+
const mergedChildren = children || this.title;
|
|
143
|
+
return mergedChildren ? (h("div", { class: `${mergedClsPrefix}-alert-body__title` }, mergedChildren)) : null;
|
|
144
|
+
}),
|
|
130
145
|
$slots.default && (h("div", { class: `${mergedClsPrefix}-alert-body__content` }, $slots))))) : null;
|
|
131
146
|
}
|
|
132
147
|
}));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { h, defineComponent, computed, ref } from 'vue';
|
|
2
2
|
import { NAffix } from '../../affix';
|
|
3
3
|
import { affixProps, affixPropKeys } from '../../affix/src/Affix';
|
|
4
|
-
import { useConfig, useTheme } from '../../_mixins';
|
|
4
|
+
import { useConfig, useTheme, useThemeClass } from '../../_mixins';
|
|
5
5
|
import { keep } from '../../_utils';
|
|
6
6
|
import { anchorLight } from '../styles';
|
|
7
7
|
import style from './styles/index.cssr';
|
|
@@ -11,7 +11,7 @@ export default defineComponent({
|
|
|
11
11
|
name: 'Anchor',
|
|
12
12
|
props: anchorProps,
|
|
13
13
|
setup(props, { slots }) {
|
|
14
|
-
const { mergedClsPrefixRef } = useConfig(props);
|
|
14
|
+
const { mergedClsPrefixRef, inlineThemeDisabled } = useConfig(props);
|
|
15
15
|
const themeRef = useTheme('Anchor', '-anchor', style, anchorLight, props, mergedClsPrefixRef);
|
|
16
16
|
const anchorRef = ref(null);
|
|
17
17
|
const cssVarsRef = computed(() => {
|
|
@@ -31,13 +31,19 @@ export default defineComponent({
|
|
|
31
31
|
'--n-rail-width': railWidth
|
|
32
32
|
};
|
|
33
33
|
});
|
|
34
|
+
const themeClassHandle = inlineThemeDisabled
|
|
35
|
+
? useThemeClass('anchor', undefined, cssVarsRef, props)
|
|
36
|
+
: undefined;
|
|
34
37
|
return {
|
|
35
38
|
scrollTo(href) {
|
|
36
39
|
var _a;
|
|
37
40
|
(_a = anchorRef.value) === null || _a === void 0 ? void 0 : _a.setActiveHref(href);
|
|
38
41
|
},
|
|
39
42
|
renderAnchor: () => {
|
|
40
|
-
|
|
43
|
+
themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.onRender();
|
|
44
|
+
return (h(NBaseAnchor, Object.assign({ ref: anchorRef, style: inlineThemeDisabled
|
|
45
|
+
? undefined
|
|
46
|
+
: cssVarsRef.value, class: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.themeClass.value }, keep(props, baseAnchorPropKeys), { mergedClsPrefix: mergedClsPrefixRef.value }), slots));
|
|
41
47
|
}
|
|
42
48
|
};
|
|
43
49
|
},
|
|
@@ -1081,7 +1081,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1081
1081
|
cssVars: import("vue").ComputedRef<{
|
|
1082
1082
|
'--n-menu-box-shadow': string;
|
|
1083
1083
|
'--n-bezier': string;
|
|
1084
|
-
}
|
|
1084
|
+
}> | undefined;
|
|
1085
|
+
themeClass: import("vue").Ref<string> | undefined;
|
|
1086
|
+
onRender: (() => void) | undefined;
|
|
1085
1087
|
mergedBordered: import("vue").ComputedRef<boolean>;
|
|
1086
1088
|
namespace: import("vue").ComputedRef<string | undefined>;
|
|
1087
1089
|
mergedClsPrefix: import("vue").ComputedRef<string>;
|
|
@@ -4,7 +4,7 @@ import { VBinder, VTarget, VFollower } from 'vueuc';
|
|
|
4
4
|
import { clickoutside } from 'vdirs';
|
|
5
5
|
import { useIsMounted, useMergedState } from 'vooks';
|
|
6
6
|
import { tmOptions } from '../../select/src/utils';
|
|
7
|
-
import { useFormItem, useTheme, useConfig } from '../../_mixins';
|
|
7
|
+
import { useFormItem, useTheme, useConfig, useThemeClass } from '../../_mixins';
|
|
8
8
|
import { call, useAdjustedTo, getFirstSlotVNode, warnOnce } from '../../_utils';
|
|
9
9
|
import { NInternalSelectMenu } from '../../_internal';
|
|
10
10
|
import { NInput } from '../../input';
|
|
@@ -46,7 +46,7 @@ export default defineComponent({
|
|
|
46
46
|
}
|
|
47
47
|
});
|
|
48
48
|
}
|
|
49
|
-
const { mergedBorderedRef, namespaceRef, mergedClsPrefixRef } = useConfig(props);
|
|
49
|
+
const { mergedBorderedRef, namespaceRef, mergedClsPrefixRef, inlineThemeDisabled } = useConfig(props);
|
|
50
50
|
const formItem = useFormItem(props);
|
|
51
51
|
const { mergedSizeRef, mergedDisabledRef, mergedStatusRef } = formItem;
|
|
52
52
|
const triggerElRef = ref(null);
|
|
@@ -183,6 +183,16 @@ export default defineComponent({
|
|
|
183
183
|
(_b = document.activeElement) === null || _b === void 0 ? void 0 : _b.blur();
|
|
184
184
|
}
|
|
185
185
|
}
|
|
186
|
+
const cssVarsRef = computed(() => {
|
|
187
|
+
const { common: { cubicBezierEaseInOut }, self: { menuBoxShadow } } = themeRef.value;
|
|
188
|
+
return {
|
|
189
|
+
'--n-menu-box-shadow': menuBoxShadow,
|
|
190
|
+
'--n-bezier': cubicBezierEaseInOut
|
|
191
|
+
};
|
|
192
|
+
});
|
|
193
|
+
const themeClassHandle = inlineThemeDisabled
|
|
194
|
+
? useThemeClass('auto-complete', undefined, cssVarsRef, props)
|
|
195
|
+
: undefined;
|
|
186
196
|
return {
|
|
187
197
|
uncontrolledValue: uncontrolledValueRef,
|
|
188
198
|
mergedValue: mergedValueRef,
|
|
@@ -205,13 +215,9 @@ export default defineComponent({
|
|
|
205
215
|
handleCompositionEnd,
|
|
206
216
|
handleKeyDown,
|
|
207
217
|
mergedTheme: themeRef,
|
|
208
|
-
cssVars:
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
'--n-menu-box-shadow': menuBoxShadow,
|
|
212
|
-
'--n-bezier': cubicBezierEaseInOut
|
|
213
|
-
};
|
|
214
|
-
}),
|
|
218
|
+
cssVars: inlineThemeDisabled ? undefined : cssVarsRef,
|
|
219
|
+
themeClass: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.themeClass,
|
|
220
|
+
onRender: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.onRender,
|
|
215
221
|
mergedBordered: mergedBorderedRef,
|
|
216
222
|
namespace: namespaceRef,
|
|
217
223
|
mergedClsPrefix: mergedClsPrefixRef
|
|
@@ -235,17 +241,24 @@ export default defineComponent({
|
|
|
235
241
|
}
|
|
236
242
|
const { mergedTheme } = this;
|
|
237
243
|
return (h(NInput, { status: this.mergedStatus, theme: mergedTheme.peers.Input, themeOverrides: mergedTheme.peerOverrides.Input, bordered: this.mergedBordered, value: this.mergedValue, placeholder: this.placeholder, size: this.mergedSize, disabled: this.mergedDisabled, clearable: this.clearable, loading: this.loading, inputProps: this.inputProps, onClear: this.handleClear, onFocus: this.handleFocus, onUpdateValue: this.handleInput, onBlur: this.handleBlur }, {
|
|
238
|
-
suffix: this.$slots.suffix,
|
|
239
|
-
prefix: this.$slots.prefix
|
|
244
|
+
suffix: () => { var _a, _b; return (_b = (_a = this.$slots).suffix) === null || _b === void 0 ? void 0 : _b.call(_a); },
|
|
245
|
+
prefix: () => { var _a, _b; return (_b = (_a = this.$slots).prefix) === null || _b === void 0 ? void 0 : _b.call(_a); }
|
|
240
246
|
}));
|
|
241
247
|
}
|
|
242
248
|
}),
|
|
243
249
|
h(VFollower, { show: this.active, to: this.adjustedTo, containerClass: this.namespace, zIndex: this.zIndex, teleportDisabled: this.adjustedTo === useAdjustedTo.tdkey, placement: this.placement, width: "target" }, {
|
|
244
250
|
default: () => (h(Transition, { name: "fade-in-scale-up-transition", appear: this.isMounted }, {
|
|
245
|
-
default: () =>
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
251
|
+
default: () => {
|
|
252
|
+
var _a;
|
|
253
|
+
(_a = this.onRender) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
254
|
+
return this.active
|
|
255
|
+
? withDirectives(h(NInternalSelectMenu, { clsPrefix: mergedClsPrefix, ref: "menuInstRef", theme: this.mergedTheme.peers.InternalSelectMenu, themeOverrides: this.mergedTheme.peerOverrides
|
|
256
|
+
.InternalSelectMenu, "auto-pending": true, class: [
|
|
257
|
+
`${mergedClsPrefix}-auto-complete-menu`,
|
|
258
|
+
this.themeClass
|
|
259
|
+
], style: this.cssVars, treeMate: this.treeMate, multiple: false, renderLabel: this.renderLabel, renderOption: this.renderOption, size: "medium", onToggle: this.handleToggle }), [[clickoutside, this.handleClickOutsideMenu]])
|
|
260
|
+
: null;
|
|
261
|
+
}
|
|
249
262
|
}))
|
|
250
263
|
})
|
|
251
264
|
]
|
|
@@ -136,7 +136,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
136
136
|
'--n-color-popover': string;
|
|
137
137
|
'--n-bezier': string;
|
|
138
138
|
'--n-merged-size': string;
|
|
139
|
-
}
|
|
139
|
+
}> | undefined;
|
|
140
|
+
themeClass: import("vue").Ref<string> | undefined;
|
|
141
|
+
onRender: (() => void) | undefined;
|
|
140
142
|
hasLoadError: import("vue").Ref<boolean>;
|
|
141
143
|
handleError: (e: Event) => void;
|
|
142
144
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
package/es/avatar/src/Avatar.js
CHANGED
|
@@ -2,9 +2,9 @@ import { h, ref, computed, defineComponent, inject, watch } from 'vue';
|
|
|
2
2
|
import { VResizeObserver } from 'vueuc';
|
|
3
3
|
import { avatarGroupInjectionKey } from './context';
|
|
4
4
|
import { tagInjectionKey } from '../../tag/src/Tag';
|
|
5
|
-
import { useConfig, useTheme } from '../../_mixins';
|
|
5
|
+
import { useConfig, useTheme, useThemeClass } from '../../_mixins';
|
|
6
6
|
import { avatarLight } from '../styles';
|
|
7
|
-
import { createKey } from '../../_utils';
|
|
7
|
+
import { createKey, color2Class, resolveWrappedSlot } from '../../_utils';
|
|
8
8
|
import style from './styles/index.cssr';
|
|
9
9
|
export const avatarProps = Object.assign(Object.assign({}, useTheme.props), { size: [String, Number], src: String, circle: {
|
|
10
10
|
type: Boolean,
|
|
@@ -22,7 +22,7 @@ export default defineComponent({
|
|
|
22
22
|
name: 'Avatar',
|
|
23
23
|
props: avatarProps,
|
|
24
24
|
setup(props) {
|
|
25
|
-
const { mergedClsPrefixRef } = useConfig(props);
|
|
25
|
+
const { mergedClsPrefixRef, inlineThemeDisabled } = useConfig(props);
|
|
26
26
|
const hasLoadErrorRef = ref(false);
|
|
27
27
|
let memoedTextHtml = null;
|
|
28
28
|
const textRef = ref(null);
|
|
@@ -79,54 +79,89 @@ export default defineComponent({
|
|
|
79
79
|
}
|
|
80
80
|
};
|
|
81
81
|
watch(() => props.src, () => (hasLoadErrorRef.value = false));
|
|
82
|
+
const cssVarsRef = computed(() => {
|
|
83
|
+
const size = mergedSizeRef.value;
|
|
84
|
+
const round = mergedRoundRef.value;
|
|
85
|
+
const bordered = mergedBorderedRef.value;
|
|
86
|
+
const { color: propColor } = props;
|
|
87
|
+
const { self: { borderRadius, fontSize, color, border, colorModal, colorPopover }, common: { cubicBezierEaseInOut } } = themeRef.value;
|
|
88
|
+
let height;
|
|
89
|
+
if (typeof size === 'number') {
|
|
90
|
+
height = `${size}px`;
|
|
91
|
+
}
|
|
92
|
+
else {
|
|
93
|
+
height = themeRef.value.self[createKey('height', size)];
|
|
94
|
+
}
|
|
95
|
+
return {
|
|
96
|
+
'--n-font-size': fontSize,
|
|
97
|
+
'--n-border': bordered ? border : 'none',
|
|
98
|
+
'--n-border-radius': round ? '50%' : borderRadius,
|
|
99
|
+
'--n-color': propColor || color,
|
|
100
|
+
'--n-color-modal': propColor || colorModal,
|
|
101
|
+
'--n-color-popover': propColor || colorPopover,
|
|
102
|
+
'--n-bezier': cubicBezierEaseInOut,
|
|
103
|
+
'--n-merged-size': `var(--n-avatar-size-override, ${height})`
|
|
104
|
+
};
|
|
105
|
+
});
|
|
106
|
+
const themeClassHandle = inlineThemeDisabled
|
|
107
|
+
? useThemeClass('avatar', computed(() => {
|
|
108
|
+
const size = mergedSizeRef.value;
|
|
109
|
+
const round = mergedRoundRef.value;
|
|
110
|
+
const bordered = mergedBorderedRef.value;
|
|
111
|
+
const { color } = props;
|
|
112
|
+
let hash = '';
|
|
113
|
+
if (size) {
|
|
114
|
+
if (typeof size === 'number') {
|
|
115
|
+
hash += `a${size}`;
|
|
116
|
+
}
|
|
117
|
+
else {
|
|
118
|
+
hash += size[0];
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
if (round) {
|
|
122
|
+
hash += 'b';
|
|
123
|
+
}
|
|
124
|
+
if (bordered) {
|
|
125
|
+
hash += 'c';
|
|
126
|
+
}
|
|
127
|
+
if (color) {
|
|
128
|
+
hash += color2Class(color);
|
|
129
|
+
}
|
|
130
|
+
return hash;
|
|
131
|
+
}), cssVarsRef, props)
|
|
132
|
+
: undefined;
|
|
82
133
|
return {
|
|
83
134
|
textRef,
|
|
84
135
|
selfRef,
|
|
85
136
|
mergedRoundRef,
|
|
86
137
|
mergedClsPrefix: mergedClsPrefixRef,
|
|
87
138
|
fitTextTransform,
|
|
88
|
-
cssVars:
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
const bordered = mergedBorderedRef.value;
|
|
92
|
-
const { color: propColor } = props;
|
|
93
|
-
const { self: { borderRadius, fontSize, color, border, colorModal, colorPopover }, common: { cubicBezierEaseInOut } } = themeRef.value;
|
|
94
|
-
let height;
|
|
95
|
-
if (typeof size === 'number') {
|
|
96
|
-
height = `${size}px`;
|
|
97
|
-
}
|
|
98
|
-
else {
|
|
99
|
-
height = themeRef.value.self[createKey('height', size)];
|
|
100
|
-
}
|
|
101
|
-
return {
|
|
102
|
-
'--n-font-size': fontSize,
|
|
103
|
-
'--n-border': bordered ? border : 'none',
|
|
104
|
-
'--n-border-radius': round ? '50%' : borderRadius,
|
|
105
|
-
'--n-color': propColor || color,
|
|
106
|
-
'--n-color-modal': propColor || colorModal,
|
|
107
|
-
'--n-color-popover': propColor || colorPopover,
|
|
108
|
-
'--n-bezier': cubicBezierEaseInOut,
|
|
109
|
-
'--n-merged-size': `var(--n-avatar-size-override, ${height})`
|
|
110
|
-
};
|
|
111
|
-
}),
|
|
139
|
+
cssVars: inlineThemeDisabled ? undefined : cssVarsRef,
|
|
140
|
+
themeClass: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.themeClass,
|
|
141
|
+
onRender: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.onRender,
|
|
112
142
|
hasLoadError: hasLoadErrorRef,
|
|
113
143
|
handleError
|
|
114
144
|
};
|
|
115
145
|
},
|
|
116
146
|
render() {
|
|
117
|
-
const { $slots, src, mergedClsPrefix } = this;
|
|
147
|
+
const { $slots, src, mergedClsPrefix, onRender } = this;
|
|
148
|
+
onRender === null || onRender === void 0 ? void 0 : onRender();
|
|
118
149
|
let img;
|
|
119
150
|
if (this.hasLoadError) {
|
|
120
151
|
img = h("img", { src: this.fallbackSrc, style: { objectFit: this.objectFit } });
|
|
121
152
|
}
|
|
122
|
-
else if (!(!$slots.default && src)) {
|
|
123
|
-
img = (h(VResizeObserver, { onResize: this.fitTextTransform }, {
|
|
124
|
-
default: () => (h("span", { ref: "textRef", class: `${mergedClsPrefix}-avatar__text` }, $slots))
|
|
125
|
-
}));
|
|
126
|
-
}
|
|
127
153
|
else {
|
|
128
|
-
img = (
|
|
154
|
+
img = resolveWrappedSlot($slots.default, (children) => {
|
|
155
|
+
if (children) {
|
|
156
|
+
return (h(VResizeObserver, { onResize: this.fitTextTransform }, {
|
|
157
|
+
default: () => (h("span", { ref: "textRef", class: `${mergedClsPrefix}-avatar__text` }, children))
|
|
158
|
+
}));
|
|
159
|
+
}
|
|
160
|
+
else if (src) {
|
|
161
|
+
return (h("img", { src: src, onError: this.handleError, style: { objectFit: this.objectFit } }));
|
|
162
|
+
}
|
|
163
|
+
});
|
|
129
164
|
}
|
|
130
|
-
return (h("span", { ref: "selfRef", class: `${mergedClsPrefix}-avatar`, style: this.cssVars }, img));
|
|
165
|
+
return (h("span", { ref: "selfRef", class: [`${mergedClsPrefix}-avatar`, this.themeClass], style: this.cssVars }, img));
|
|
131
166
|
}
|
|
132
167
|
});
|
|
@@ -26,21 +26,9 @@ declare const backTopProps: {
|
|
|
26
26
|
readonly type: FunctionConstructor;
|
|
27
27
|
readonly default: () => void;
|
|
28
28
|
};
|
|
29
|
-
readonly target:
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
readonly default: undefined;
|
|
33
|
-
};
|
|
34
|
-
readonly onShow: {
|
|
35
|
-
readonly type: PropType<(() => void) | undefined>;
|
|
36
|
-
readonly validator: () => boolean;
|
|
37
|
-
readonly default: undefined;
|
|
38
|
-
};
|
|
39
|
-
readonly onHide: {
|
|
40
|
-
readonly type: PropType<(() => void) | undefined>;
|
|
41
|
-
readonly validator: () => boolean;
|
|
42
|
-
readonly default: undefined;
|
|
43
|
-
};
|
|
29
|
+
readonly target: PropType<() => HTMLElement>;
|
|
30
|
+
readonly onShow: PropType<() => void>;
|
|
31
|
+
readonly onHide: PropType<() => void>;
|
|
44
32
|
readonly theme: PropType<import("../../_mixins").Theme<"BackTop", {
|
|
45
33
|
color: string;
|
|
46
34
|
textColor: string;
|
|
@@ -111,21 +99,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
111
99
|
readonly type: FunctionConstructor;
|
|
112
100
|
readonly default: () => void;
|
|
113
101
|
};
|
|
114
|
-
readonly target:
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
readonly default: undefined;
|
|
118
|
-
};
|
|
119
|
-
readonly onShow: {
|
|
120
|
-
readonly type: PropType<(() => void) | undefined>;
|
|
121
|
-
readonly validator: () => boolean;
|
|
122
|
-
readonly default: undefined;
|
|
123
|
-
};
|
|
124
|
-
readonly onHide: {
|
|
125
|
-
readonly type: PropType<(() => void) | undefined>;
|
|
126
|
-
readonly validator: () => boolean;
|
|
127
|
-
readonly default: undefined;
|
|
128
|
-
};
|
|
102
|
+
readonly target: PropType<() => HTMLElement>;
|
|
103
|
+
readonly onShow: PropType<() => void>;
|
|
104
|
+
readonly onHide: PropType<() => void>;
|
|
129
105
|
readonly theme: PropType<import("../../_mixins").Theme<"BackTop", {
|
|
130
106
|
color: string;
|
|
131
107
|
textColor: string;
|
|
@@ -198,7 +174,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
198
174
|
'--n-icon-color-hover': string;
|
|
199
175
|
'--n-icon-color-pressed': string;
|
|
200
176
|
'--n-text-color': string;
|
|
201
|
-
}
|
|
177
|
+
}> | undefined;
|
|
178
|
+
themeClass: import("vue").Ref<string> | undefined;
|
|
179
|
+
onRender: (() => void) | undefined;
|
|
202
180
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
203
181
|
readonly show: {
|
|
204
182
|
readonly type: PropType<boolean | undefined>;
|
|
@@ -225,21 +203,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
225
203
|
readonly type: FunctionConstructor;
|
|
226
204
|
readonly default: () => void;
|
|
227
205
|
};
|
|
228
|
-
readonly target:
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
readonly default: undefined;
|
|
232
|
-
};
|
|
233
|
-
readonly onShow: {
|
|
234
|
-
readonly type: PropType<(() => void) | undefined>;
|
|
235
|
-
readonly validator: () => boolean;
|
|
236
|
-
readonly default: undefined;
|
|
237
|
-
};
|
|
238
|
-
readonly onHide: {
|
|
239
|
-
readonly type: PropType<(() => void) | undefined>;
|
|
240
|
-
readonly validator: () => boolean;
|
|
241
|
-
readonly default: undefined;
|
|
242
|
-
};
|
|
206
|
+
readonly target: PropType<() => HTMLElement>;
|
|
207
|
+
readonly onShow: PropType<() => void>;
|
|
208
|
+
readonly onHide: PropType<() => void>;
|
|
243
209
|
readonly theme: PropType<import("../../_mixins").Theme<"BackTop", {
|
|
244
210
|
color: string;
|
|
245
211
|
textColor: string;
|
|
@@ -286,11 +252,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
286
252
|
right: string | number;
|
|
287
253
|
bottom: string | number;
|
|
288
254
|
show: boolean | undefined;
|
|
289
|
-
target: () => HTMLElement | undefined;
|
|
290
255
|
to: string | HTMLElement;
|
|
291
256
|
"onUpdate:show": Function;
|
|
292
|
-
onShow: (() => void) | undefined;
|
|
293
|
-
onHide: (() => void) | undefined;
|
|
294
257
|
visibilityHeight: number;
|
|
295
258
|
}>;
|
|
296
259
|
export default _default;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { h, ref, computed, toRef, watch, nextTick, defineComponent, mergeProps, Transition, onMounted, onBeforeUnmount } from 'vue';
|
|
1
|
+
import { h, ref, computed, toRef, watch, nextTick, defineComponent, mergeProps, Transition, onMounted, onBeforeUnmount, watchEffect } from 'vue';
|
|
2
2
|
import { VLazyTeleport } from 'vueuc';
|
|
3
3
|
import { useIsMounted, useMergedState } from 'vooks';
|
|
4
4
|
import { getScrollParent, unwrapElement } from 'seemly';
|
|
5
|
-
import { useConfig, useTheme } from '../../_mixins';
|
|
5
|
+
import { useConfig, useTheme, useThemeClass } from '../../_mixins';
|
|
6
6
|
import { NBaseIcon } from '../../_internal';
|
|
7
|
-
import { formatLength, warn } from '../../_utils';
|
|
7
|
+
import { formatLength, resolveSlot, warn, warnOnce } from '../../_utils';
|
|
8
8
|
import { backTopLight } from '../styles';
|
|
9
9
|
import BackTopIcon from './BackTopIcon';
|
|
10
10
|
import style from './styles/index.cssr';
|
|
@@ -28,35 +28,27 @@ const backTopProps = Object.assign(Object.assign({}, useTheme.props), { show: {
|
|
|
28
28
|
default: () => { }
|
|
29
29
|
},
|
|
30
30
|
// deprecated
|
|
31
|
-
target:
|
|
32
|
-
type: Function,
|
|
33
|
-
validator: () => {
|
|
34
|
-
warn('back-top', '`target` is deprecated, please use `listen-to` instead.');
|
|
35
|
-
return true;
|
|
36
|
-
},
|
|
37
|
-
default: undefined
|
|
38
|
-
}, onShow: {
|
|
39
|
-
type: Function,
|
|
40
|
-
validator: () => {
|
|
41
|
-
warn('back-top', '`on-show` is deprecated, please use `on-update:show` instead.');
|
|
42
|
-
return true;
|
|
43
|
-
},
|
|
44
|
-
default: undefined
|
|
45
|
-
}, onHide: {
|
|
46
|
-
type: Function,
|
|
47
|
-
validator: () => {
|
|
48
|
-
warn('back-top', '`on-hide` is deprecated, please use `on-update:show` instead.');
|
|
49
|
-
return true;
|
|
50
|
-
},
|
|
51
|
-
default: undefined
|
|
52
|
-
} });
|
|
31
|
+
target: Function, onShow: Function, onHide: Function });
|
|
53
32
|
export default defineComponent({
|
|
54
33
|
name: 'BackTop',
|
|
55
34
|
// make style applied to back-top button
|
|
56
35
|
inheritAttrs: false,
|
|
57
36
|
props: backTopProps,
|
|
58
37
|
setup(props) {
|
|
59
|
-
|
|
38
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
39
|
+
watchEffect(() => {
|
|
40
|
+
if (props.target !== undefined) {
|
|
41
|
+
warnOnce('back-top', '`target` is deprecated, please use `listen-to` instead.');
|
|
42
|
+
}
|
|
43
|
+
if (props.onShow !== undefined) {
|
|
44
|
+
warnOnce('back-top', '`on-show` is deprecated, please use `on-update:show` instead.');
|
|
45
|
+
}
|
|
46
|
+
if (props.onHide !== undefined) {
|
|
47
|
+
warnOnce('back-top', '`on-hide` is deprecated, please use `on-update:show` instead.');
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
const { mergedClsPrefixRef, inlineThemeDisabled } = useConfig(props);
|
|
60
52
|
const scrollTopRef = ref(null);
|
|
61
53
|
const uncontrolledShowRef = computed(() => {
|
|
62
54
|
if (scrollTopRef.value === null)
|
|
@@ -157,6 +149,27 @@ export default defineComponent({
|
|
|
157
149
|
scrollElement.removeEventListener('scroll', handleScroll);
|
|
158
150
|
}
|
|
159
151
|
});
|
|
152
|
+
const cssVarsRef = computed(() => {
|
|
153
|
+
const { self: { color, boxShadow, boxShadowHover, boxShadowPressed, iconColor, iconColorHover, iconColorPressed, width, height, iconSize, borderRadius, textColor }, common: { cubicBezierEaseInOut } } = themeRef.value;
|
|
154
|
+
return {
|
|
155
|
+
'--n-bezier': cubicBezierEaseInOut,
|
|
156
|
+
'--n-border-radius': borderRadius,
|
|
157
|
+
'--n-height': height,
|
|
158
|
+
'--n-width': width,
|
|
159
|
+
'--n-box-shadow': boxShadow,
|
|
160
|
+
'--n-box-shadow-hover': boxShadowHover,
|
|
161
|
+
'--n-box-shadow-pressed': boxShadowPressed,
|
|
162
|
+
'--n-color': color,
|
|
163
|
+
'--n-icon-size': iconSize,
|
|
164
|
+
'--n-icon-color': iconColor,
|
|
165
|
+
'--n-icon-color-hover': iconColorHover,
|
|
166
|
+
'--n-icon-color-pressed': iconColorPressed,
|
|
167
|
+
'--n-text-color': textColor
|
|
168
|
+
};
|
|
169
|
+
});
|
|
170
|
+
const themeClassHandle = inlineThemeDisabled
|
|
171
|
+
? useThemeClass('back-top', undefined, cssVarsRef, props)
|
|
172
|
+
: undefined;
|
|
160
173
|
return {
|
|
161
174
|
placeholderRef,
|
|
162
175
|
style: styleRef,
|
|
@@ -170,24 +183,9 @@ export default defineComponent({
|
|
|
170
183
|
handleAfterEnter,
|
|
171
184
|
handleScroll,
|
|
172
185
|
handleClick,
|
|
173
|
-
cssVars:
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
'--n-bezier': cubicBezierEaseInOut,
|
|
177
|
-
'--n-border-radius': borderRadius,
|
|
178
|
-
'--n-height': height,
|
|
179
|
-
'--n-width': width,
|
|
180
|
-
'--n-box-shadow': boxShadow,
|
|
181
|
-
'--n-box-shadow-hover': boxShadowHover,
|
|
182
|
-
'--n-box-shadow-pressed': boxShadowPressed,
|
|
183
|
-
'--n-color': color,
|
|
184
|
-
'--n-icon-size': iconSize,
|
|
185
|
-
'--n-icon-color': iconColor,
|
|
186
|
-
'--n-icon-color-hover': iconColorHover,
|
|
187
|
-
'--n-icon-color-pressed': iconColorPressed,
|
|
188
|
-
'--n-text-color': textColor
|
|
189
|
-
};
|
|
190
|
-
})
|
|
186
|
+
cssVars: inlineThemeDisabled ? undefined : cssVarsRef,
|
|
187
|
+
themeClass: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.themeClass,
|
|
188
|
+
onRender: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.onRender
|
|
191
189
|
};
|
|
192
190
|
},
|
|
193
191
|
render() {
|
|
@@ -195,20 +193,24 @@ export default defineComponent({
|
|
|
195
193
|
return (h("div", { ref: "placeholderRef", class: `${mergedClsPrefix}-back-top-placeholder`, style: "display: none", "aria-hidden": true },
|
|
196
194
|
h(VLazyTeleport, { to: this.to, show: this.mergedShow }, {
|
|
197
195
|
default: () => (h(Transition, { name: "fade-in-scale-up-transition", appear: this.isMounted, onAfterEnter: this.handleAfterEnter }, {
|
|
198
|
-
default: () =>
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
196
|
+
default: () => {
|
|
197
|
+
var _a;
|
|
198
|
+
(_a = this.onRender) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
199
|
+
return this.mergedShow
|
|
200
|
+
? h('div', mergeProps(this.$attrs, {
|
|
201
|
+
class: [
|
|
202
|
+
`${mergedClsPrefix}-back-top`,
|
|
203
|
+
this.themeClass,
|
|
204
|
+
this.transitionDisabled &&
|
|
205
|
+
`${mergedClsPrefix}-back-top--transition-disabled`
|
|
206
|
+
],
|
|
207
|
+
style: [this.style, this.cssVars],
|
|
208
|
+
onClick: this.handleClick
|
|
209
|
+
}), resolveSlot(this.$slots.default, () => [
|
|
210
|
+
h(NBaseIcon, { clsPrefix: mergedClsPrefix }, { default: () => BackTopIcon })
|
|
211
|
+
]))
|
|
212
|
+
: null;
|
|
213
|
+
}
|
|
212
214
|
}))
|
|
213
215
|
})));
|
|
214
216
|
}
|