naive-ui 2.25.2 → 2.25.5
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 +8 -7
- 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.d.ts +3 -1
- package/es/dynamic-input/src/DynamicInput.js +18 -11
- 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/legacy-grid/src/styles/index.cssr.js +1 -1
- 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/Mention.d.ts +3 -1
- package/es/mention/src/Mention.js +20 -10
- 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 +79 -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 +9 -8
- 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.d.ts +3 -1
- package/lib/dynamic-input/src/DynamicInput.js +17 -10
- 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/legacy-grid/src/styles/index.cssr.js +1 -1
- 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/Mention.d.ts +3 -1
- package/lib/mention/src/Mention.js +19 -9
- 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 +79 -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/input/src/Input.js
CHANGED
|
@@ -5,7 +5,7 @@ import { VResizeObserver } from 'vueuc';
|
|
|
5
5
|
import { off, on } from 'evtd';
|
|
6
6
|
import { EyeIcon, EyeOffIcon } from '../../_internal/icons';
|
|
7
7
|
import { NBaseClear, NBaseIcon, NBaseSuffix, NScrollbar } from '../../_internal';
|
|
8
|
-
import { useTheme, useLocale, useFormItem, useConfig } from '../../_mixins';
|
|
8
|
+
import { useTheme, useLocale, useFormItem, useConfig, useThemeClass } from '../../_mixins';
|
|
9
9
|
import { call, createKey, resolveSlot, resolveWrappedSlot, warnOnce } from '../../_utils';
|
|
10
10
|
import { inputLight } from '../styles';
|
|
11
11
|
import { inputInjectionKey } from './interface';
|
|
@@ -61,7 +61,7 @@ export default defineComponent({
|
|
|
61
61
|
}
|
|
62
62
|
});
|
|
63
63
|
}
|
|
64
|
-
const { mergedClsPrefixRef, mergedBorderedRef } = useConfig(props);
|
|
64
|
+
const { mergedClsPrefixRef, mergedBorderedRef, inlineThemeDisabled } = useConfig(props);
|
|
65
65
|
const themeRef = useTheme('Input', '-input', style, inputLight, props, mergedClsPrefixRef);
|
|
66
66
|
// dom refs
|
|
67
67
|
const wrapperElRef = ref(null);
|
|
@@ -628,6 +628,69 @@ export default defineComponent({
|
|
|
628
628
|
deactivate,
|
|
629
629
|
activate
|
|
630
630
|
};
|
|
631
|
+
const cssVarsRef = computed(() => {
|
|
632
|
+
const { value: size } = mergedSizeRef;
|
|
633
|
+
const { common: { cubicBezierEaseInOut }, self: { color, borderRadius, textColor, caretColor, caretColorError, caretColorWarning, textDecorationColor, border, borderDisabled, borderHover, borderFocus, placeholderColor, placeholderColorDisabled, lineHeightTextarea, colorDisabled, colorFocus, textColorDisabled, boxShadowFocus, iconSize, colorFocusWarning, boxShadowFocusWarning, borderWarning, borderFocusWarning, borderHoverWarning, colorFocusError, boxShadowFocusError, borderError, borderFocusError, borderHoverError, clearSize, clearColor, clearColorHover, clearColorPressed, iconColor, iconColorDisabled, suffixTextColor, countTextColor, iconColorHover, iconColorPressed, loadingColor, loadingColorError, loadingColorWarning, [createKey('padding', size)]: padding, [createKey('fontSize', size)]: fontSize, [createKey('height', size)]: height } } = themeRef.value;
|
|
634
|
+
const { left: paddingLeft, right: paddingRight } = getPadding(padding);
|
|
635
|
+
return {
|
|
636
|
+
'--n-bezier': cubicBezierEaseInOut,
|
|
637
|
+
'--n-count-text-color': countTextColor,
|
|
638
|
+
'--n-color': color,
|
|
639
|
+
'--n-font-size': fontSize,
|
|
640
|
+
'--n-border-radius': borderRadius,
|
|
641
|
+
'--n-height': height,
|
|
642
|
+
'--n-padding-left': paddingLeft,
|
|
643
|
+
'--n-padding-right': paddingRight,
|
|
644
|
+
'--n-text-color': textColor,
|
|
645
|
+
'--n-caret-color': caretColor,
|
|
646
|
+
'--n-text-decoration-color': textDecorationColor,
|
|
647
|
+
'--n-border': border,
|
|
648
|
+
'--n-border-disabled': borderDisabled,
|
|
649
|
+
'--n-border-hover': borderHover,
|
|
650
|
+
'--n-border-focus': borderFocus,
|
|
651
|
+
'--n-placeholder-color': placeholderColor,
|
|
652
|
+
'--n-placeholder-color-disabled': placeholderColorDisabled,
|
|
653
|
+
'--n-icon-size': iconSize,
|
|
654
|
+
'--n-line-height-textarea': lineHeightTextarea,
|
|
655
|
+
'--n-color-disabled': colorDisabled,
|
|
656
|
+
'--n-color-focus': colorFocus,
|
|
657
|
+
'--n-text-color-disabled': textColorDisabled,
|
|
658
|
+
'--n-box-shadow-focus': boxShadowFocus,
|
|
659
|
+
'--n-loading-color': loadingColor,
|
|
660
|
+
// form warning
|
|
661
|
+
'--n-caret-color-warning': caretColorWarning,
|
|
662
|
+
'--n-color-focus-warning': colorFocusWarning,
|
|
663
|
+
'--n-box-shadow-focus-warning': boxShadowFocusWarning,
|
|
664
|
+
'--n-border-warning': borderWarning,
|
|
665
|
+
'--n-border-focus-warning': borderFocusWarning,
|
|
666
|
+
'--n-border-hover-warning': borderHoverWarning,
|
|
667
|
+
'--n-loading-color-warning': loadingColorWarning,
|
|
668
|
+
// form error
|
|
669
|
+
'--n-caret-color-error': caretColorError,
|
|
670
|
+
'--n-color-focus-error': colorFocusError,
|
|
671
|
+
'--n-box-shadow-focus-error': boxShadowFocusError,
|
|
672
|
+
'--n-border-error': borderError,
|
|
673
|
+
'--n-border-focus-error': borderFocusError,
|
|
674
|
+
'--n-border-hover-error': borderHoverError,
|
|
675
|
+
'--n-loading-color-error': loadingColorError,
|
|
676
|
+
// clear-button
|
|
677
|
+
'--n-clear-color': clearColor,
|
|
678
|
+
'--n-clear-size': clearSize,
|
|
679
|
+
'--n-clear-color-hover': clearColorHover,
|
|
680
|
+
'--n-clear-color-pressed': clearColorPressed,
|
|
681
|
+
'--n-icon-color': iconColor,
|
|
682
|
+
'--n-icon-color-hover': iconColorHover,
|
|
683
|
+
'--n-icon-color-pressed': iconColorPressed,
|
|
684
|
+
'--n-icon-color-disabled': iconColorDisabled,
|
|
685
|
+
'--n-suffix-text-color': suffixTextColor
|
|
686
|
+
};
|
|
687
|
+
});
|
|
688
|
+
const themeClassHandle = inlineThemeDisabled
|
|
689
|
+
? useThemeClass('input', computed(() => {
|
|
690
|
+
const { value: size } = mergedSizeRef;
|
|
691
|
+
return size[0];
|
|
692
|
+
}), cssVarsRef, props)
|
|
693
|
+
: undefined;
|
|
631
694
|
return Object.assign(Object.assign({}, exposedProps), {
|
|
632
695
|
// DOM ref
|
|
633
696
|
wrapperElRef,
|
|
@@ -659,69 +722,14 @@ export default defineComponent({
|
|
|
659
722
|
handleWrapperKeyDown,
|
|
660
723
|
handleTextAreaMirrorResize, getTextareaScrollContainer: () => {
|
|
661
724
|
return textareaElRef.value;
|
|
662
|
-
}, mergedTheme: themeRef, cssVars:
|
|
663
|
-
const { value: size } = mergedSizeRef;
|
|
664
|
-
const { common: { cubicBezierEaseInOut }, self: { color, borderRadius, textColor, caretColor, caretColorError, caretColorWarning, textDecorationColor, border, borderDisabled, borderHover, borderFocus, placeholderColor, placeholderColorDisabled, lineHeightTextarea, colorDisabled, colorFocus, textColorDisabled, boxShadowFocus, iconSize, colorFocusWarning, boxShadowFocusWarning, borderWarning, borderFocusWarning, borderHoverWarning, colorFocusError, boxShadowFocusError, borderError, borderFocusError, borderHoverError, clearSize, clearColor, clearColorHover, clearColorPressed, iconColor, iconColorDisabled, suffixTextColor, countTextColor, iconColorHover, iconColorPressed, loadingColor, loadingColorError, loadingColorWarning, [createKey('padding', size)]: padding, [createKey('fontSize', size)]: fontSize, [createKey('height', size)]: height } } = themeRef.value;
|
|
665
|
-
const { left: paddingLeft, right: paddingRight } = getPadding(padding);
|
|
666
|
-
return {
|
|
667
|
-
'--n-bezier': cubicBezierEaseInOut,
|
|
668
|
-
'--n-count-text-color': countTextColor,
|
|
669
|
-
'--n-color': color,
|
|
670
|
-
'--n-font-size': fontSize,
|
|
671
|
-
'--n-border-radius': borderRadius,
|
|
672
|
-
'--n-height': height,
|
|
673
|
-
'--n-padding-left': paddingLeft,
|
|
674
|
-
'--n-padding-right': paddingRight,
|
|
675
|
-
'--n-text-color': textColor,
|
|
676
|
-
'--n-caret-color': caretColor,
|
|
677
|
-
'--n-text-decoration-color': textDecorationColor,
|
|
678
|
-
'--n-border': border,
|
|
679
|
-
'--n-border-disabled': borderDisabled,
|
|
680
|
-
'--n-border-hover': borderHover,
|
|
681
|
-
'--n-border-focus': borderFocus,
|
|
682
|
-
'--n-placeholder-color': placeholderColor,
|
|
683
|
-
'--n-placeholder-color-disabled': placeholderColorDisabled,
|
|
684
|
-
'--n-icon-size': iconSize,
|
|
685
|
-
'--n-line-height-textarea': lineHeightTextarea,
|
|
686
|
-
'--n-color-disabled': colorDisabled,
|
|
687
|
-
'--n-color-focus': colorFocus,
|
|
688
|
-
'--n-text-color-disabled': textColorDisabled,
|
|
689
|
-
'--n-box-shadow-focus': boxShadowFocus,
|
|
690
|
-
'--n-loading-color': loadingColor,
|
|
691
|
-
// form warning
|
|
692
|
-
'--n-caret-color-warning': caretColorWarning,
|
|
693
|
-
'--n-color-focus-warning': colorFocusWarning,
|
|
694
|
-
'--n-box-shadow-focus-warning': boxShadowFocusWarning,
|
|
695
|
-
'--n-border-warning': borderWarning,
|
|
696
|
-
'--n-border-focus-warning': borderFocusWarning,
|
|
697
|
-
'--n-border-hover-warning': borderHoverWarning,
|
|
698
|
-
'--n-loading-color-warning': loadingColorWarning,
|
|
699
|
-
// form error
|
|
700
|
-
'--n-caret-color-error': caretColorError,
|
|
701
|
-
'--n-color-focus-error': colorFocusError,
|
|
702
|
-
'--n-box-shadow-focus-error': boxShadowFocusError,
|
|
703
|
-
'--n-border-error': borderError,
|
|
704
|
-
'--n-border-focus-error': borderFocusError,
|
|
705
|
-
'--n-border-hover-error': borderHoverError,
|
|
706
|
-
'--n-loading-color-error': loadingColorError,
|
|
707
|
-
// clear-button
|
|
708
|
-
'--n-clear-color': clearColor,
|
|
709
|
-
'--n-clear-size': clearSize,
|
|
710
|
-
'--n-clear-color-hover': clearColorHover,
|
|
711
|
-
'--n-clear-color-pressed': clearColorPressed,
|
|
712
|
-
'--n-icon-color': iconColor,
|
|
713
|
-
'--n-icon-color-hover': iconColorHover,
|
|
714
|
-
'--n-icon-color-pressed': iconColorPressed,
|
|
715
|
-
'--n-icon-color-disabled': iconColorDisabled,
|
|
716
|
-
'--n-suffix-text-color': suffixTextColor
|
|
717
|
-
};
|
|
718
|
-
}) });
|
|
725
|
+
}, mergedTheme: themeRef, cssVars: inlineThemeDisabled ? undefined : cssVarsRef, themeClass: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.themeClass, onRender: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.onRender });
|
|
719
726
|
},
|
|
720
727
|
render() {
|
|
721
|
-
|
|
722
|
-
|
|
728
|
+
const { mergedClsPrefix, mergedStatus, themeClass, onRender, $slots } = this;
|
|
729
|
+
onRender === null || onRender === void 0 ? void 0 : onRender();
|
|
723
730
|
return (h("div", { ref: "wrapperElRef", class: [
|
|
724
731
|
`${mergedClsPrefix}-input`,
|
|
732
|
+
themeClass,
|
|
725
733
|
mergedStatus && `${mergedClsPrefix}-input--${mergedStatus}-status`,
|
|
726
734
|
{
|
|
727
735
|
[`${mergedClsPrefix}-input--disabled`]: this.mergedDisabled,
|
|
@@ -737,9 +745,7 @@ export default defineComponent({
|
|
|
737
745
|
? 0
|
|
738
746
|
: undefined, onFocus: this.handleWrapperFocus, onBlur: this.handleWrapperBlur, onClick: this.handleClick, onMousedown: this.handleMouseDown, onMouseenter: this.handleMouseEnter, onMouseleave: this.handleMouseLeave, onCompositionstart: this.handleCompositionStart, onCompositionend: this.handleCompositionEnd, onKeyup: this.onKeyup, onKeydown: this.handleWrapperKeyDown },
|
|
739
747
|
h("div", { class: `${mergedClsPrefix}-input-wrapper` },
|
|
740
|
-
resolveWrappedSlot($slots.prefix, (children) =>
|
|
741
|
-
h("div", { class: `${mergedClsPrefix}-input__prefix` }, children)
|
|
742
|
-
]),
|
|
748
|
+
resolveWrappedSlot($slots.prefix, (children) => children && (h("div", { class: `${mergedClsPrefix}-input__prefix` }, children))),
|
|
743
749
|
this.type === 'textarea' ? (h(NScrollbar, { ref: "textareaScrollbarInstRef", class: `${mergedClsPrefix}-input__textarea`, container: this.getTextareaScrollContainer, triggerDisplayManually: true, useUnifiedContainer: true }, {
|
|
744
750
|
default: () => {
|
|
745
751
|
return (h(Fragment, null,
|
|
@@ -763,22 +769,26 @@ export default defineComponent({
|
|
|
763
769
|
h("span", null, this.mergedPlaceholder[0]))) : null,
|
|
764
770
|
this.autosize ? (h("div", { class: `${mergedClsPrefix}-input__input-mirror`, key: "mirror", ref: "inputMirrorElRef" }, "\u00A0")) : null)),
|
|
765
771
|
!this.pair &&
|
|
766
|
-
($slots.suffix
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
772
|
+
resolveWrappedSlot($slots.suffix, (children) => {
|
|
773
|
+
return children ||
|
|
774
|
+
this.clearable ||
|
|
775
|
+
this.showCount ||
|
|
776
|
+
this.mergedShowPasswordOn ||
|
|
777
|
+
this.loading !== undefined ? (h("div", { class: `${mergedClsPrefix}-input__suffix` }, [
|
|
778
|
+
resolveWrappedSlot($slots.clear, (children) => {
|
|
779
|
+
return ((this.clearable || children) && (h(NBaseClear, { clsPrefix: mergedClsPrefix, show: this.showClearButton, onClear: this.handleClear }, { default: () => children })));
|
|
780
|
+
}),
|
|
781
|
+
!this.internalLoadingBeforeSuffix ? children : null,
|
|
782
|
+
this.loading !== undefined ? (h(NBaseSuffix, { clsPrefix: mergedClsPrefix, loading: this.loading, showArrow: false, showClear: false, style: this.cssVars })) : null,
|
|
783
|
+
this.internalLoadingBeforeSuffix ? children : null,
|
|
784
|
+
this.showCount && this.type !== 'textarea' ? (h(WordCount, null, {
|
|
785
|
+
default: (props) => { var _a; return (_a = $slots.count) === null || _a === void 0 ? void 0 : _a.call($slots, props); }
|
|
786
|
+
})) : null,
|
|
787
|
+
this.mergedShowPasswordOn && this.type === 'password' ? (h(NBaseIcon, { clsPrefix: mergedClsPrefix, class: `${mergedClsPrefix}-input__eye`, onMousedown: this.handlePasswordToggleMousedown, onClick: this.handlePasswordToggleClick }, {
|
|
788
|
+
default: () => this.passwordVisible ? h(EyeIcon, null) : h(EyeOffIcon, null)
|
|
789
|
+
})) : null
|
|
790
|
+
])) : null;
|
|
791
|
+
})),
|
|
782
792
|
this.pair ? (h("span", { class: `${mergedClsPrefix}-input__separator` }, resolveSlot($slots.separator, () => [this.separator]))) : null,
|
|
783
793
|
this.pair ? (h("div", { class: `${mergedClsPrefix}-input-wrapper` },
|
|
784
794
|
h("div", { class: `${mergedClsPrefix}-input__input` },
|
|
@@ -787,10 +797,12 @@ export default defineComponent({
|
|
|
787
797
|
: undefined, readonly: this.readonly, style: this.textDecorationStyle[1], onBlur: this.handleInputBlur, onFocus: this.handleInputFocus, onInput: (e) => this.handleInput(e, 1), onChange: (e) => this.handleChange(e, 1) }),
|
|
788
798
|
this.showPlaceholder2 ? (h("div", { class: `${mergedClsPrefix}-input__placeholder` },
|
|
789
799
|
h("span", null, this.mergedPlaceholder[1]))) : null),
|
|
790
|
-
|
|
791
|
-
this.clearable && (h(
|
|
792
|
-
|
|
793
|
-
|
|
800
|
+
resolveWrappedSlot($slots.suffix, (children) => {
|
|
801
|
+
return ((this.clearable || children) && (h("div", { class: `${mergedClsPrefix}-input__suffix` }, [
|
|
802
|
+
this.clearable && (h(NBaseClear, { clsPrefix: mergedClsPrefix, show: this.showClearButton, onClear: this.handleClear }, { default: () => { var _a; return (_a = $slots.clear) === null || _a === void 0 ? void 0 : _a.call($slots); } })),
|
|
803
|
+
children
|
|
804
|
+
])));
|
|
805
|
+
}))) : null,
|
|
794
806
|
this.mergedBordered ? (h("div", { class: `${mergedClsPrefix}-input__border` })) : null,
|
|
795
807
|
this.mergedBordered ? (h("div", { class: `${mergedClsPrefix}-input__state-border` })) : null,
|
|
796
808
|
this.showCount && this.type === 'textarea' ? (h(WordCount, null, { default: (props) => { var _a; return (_a = $slots.count) === null || _a === void 0 ? void 0 : _a.call($slots, props); } })) : null));
|
|
@@ -186,10 +186,10 @@ cM('pair', [cE('input-el, placeholder', 'text-align: center;'), cE('separator',
|
|
|
186
186
|
color: var(--n-icon-color-hover);
|
|
187
187
|
`), c('&:active', `
|
|
188
188
|
color: var(--n-icon-color-pressed);
|
|
189
|
-
`)]), cM('focus', 'background-color: var(--n-color-focus);', [cE('state-border', `
|
|
189
|
+
`)]), c('&:hover', [cE('state-border', 'border: var(--n-border-hover);')]), cM('focus', 'background-color: var(--n-color-focus);', [cE('state-border', `
|
|
190
190
|
border: var(--n-border-focus);
|
|
191
191
|
box-shadow: var(--n-box-shadow-focus);
|
|
192
|
-
`)])
|
|
192
|
+
`)])]), cE('border, state-border', `
|
|
193
193
|
box-sizing: border-box;
|
|
194
194
|
position: absolute;
|
|
195
195
|
left: 0;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PropType } from 'vue';
|
|
2
|
-
import
|
|
2
|
+
import { MaybeArray, ExtractPublicPropTypes } from '../../_utils';
|
|
3
3
|
import type { OnUpdateValue } from './interface';
|
|
4
4
|
declare const inputNumberProps: {
|
|
5
5
|
loading: {
|
|
@@ -50,11 +50,7 @@ declare const inputNumberProps: {
|
|
|
50
50
|
onFocus: PropType<MaybeArray<(e: FocusEvent) => void>>;
|
|
51
51
|
onBlur: PropType<MaybeArray<(e: FocusEvent) => void>>;
|
|
52
52
|
onClear: PropType<MaybeArray<(e: MouseEvent) => void>>;
|
|
53
|
-
onChange:
|
|
54
|
-
type: PropType<MaybeArray<OnUpdateValue> | undefined>;
|
|
55
|
-
validator: () => boolean;
|
|
56
|
-
default: undefined;
|
|
57
|
-
};
|
|
53
|
+
onChange: PropType<MaybeArray<OnUpdateValue>>;
|
|
58
54
|
theme: PropType<import("../../_mixins").Theme<"InputNumber", {
|
|
59
55
|
iconColorDisabled: string;
|
|
60
56
|
}, {
|
|
@@ -910,11 +906,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
910
906
|
onFocus: PropType<MaybeArray<(e: FocusEvent) => void>>;
|
|
911
907
|
onBlur: PropType<MaybeArray<(e: FocusEvent) => void>>;
|
|
912
908
|
onClear: PropType<MaybeArray<(e: MouseEvent) => void>>;
|
|
913
|
-
onChange:
|
|
914
|
-
type: PropType<MaybeArray<OnUpdateValue> | undefined>;
|
|
915
|
-
validator: () => boolean;
|
|
916
|
-
default: undefined;
|
|
917
|
-
};
|
|
909
|
+
onChange: PropType<MaybeArray<OnUpdateValue>>;
|
|
918
910
|
theme: PropType<import("../../_mixins").Theme<"InputNumber", {
|
|
919
911
|
iconColorDisabled: string;
|
|
920
912
|
}, {
|
|
@@ -1755,6 +1747,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1755
1747
|
handleMouseDown: (e: MouseEvent) => void;
|
|
1756
1748
|
handleAddClick: () => void;
|
|
1757
1749
|
handleMinusClick: () => void;
|
|
1750
|
+
handleAddMousedown: () => void;
|
|
1751
|
+
handleMinusMousedown: () => void;
|
|
1758
1752
|
handleKeyDown: (e: KeyboardEvent) => void;
|
|
1759
1753
|
handleUpdateDisplayedValue: (value: string) => void;
|
|
1760
1754
|
mergedTheme: import("vue").ComputedRef<{
|
|
@@ -2203,11 +2197,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
2203
2197
|
onFocus: PropType<MaybeArray<(e: FocusEvent) => void>>;
|
|
2204
2198
|
onBlur: PropType<MaybeArray<(e: FocusEvent) => void>>;
|
|
2205
2199
|
onClear: PropType<MaybeArray<(e: MouseEvent) => void>>;
|
|
2206
|
-
onChange:
|
|
2207
|
-
type: PropType<MaybeArray<OnUpdateValue> | undefined>;
|
|
2208
|
-
validator: () => boolean;
|
|
2209
|
-
default: undefined;
|
|
2210
|
-
};
|
|
2200
|
+
onChange: PropType<MaybeArray<OnUpdateValue>>;
|
|
2211
2201
|
theme: PropType<import("../../_mixins").Theme<"InputNumber", {
|
|
2212
2202
|
iconColorDisabled: string;
|
|
2213
2203
|
}, {
|
|
@@ -3016,7 +3006,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
3016
3006
|
readonly: boolean;
|
|
3017
3007
|
disabled: boolean | undefined;
|
|
3018
3008
|
step: string | number;
|
|
3019
|
-
onChange: MaybeArray<OnUpdateValue> | undefined;
|
|
3020
3009
|
loading: boolean;
|
|
3021
3010
|
bordered: boolean | undefined;
|
|
3022
3011
|
clearable: boolean;
|
|
@@ -1,15 +1,18 @@
|
|
|
1
|
-
import { h, defineComponent, ref, toRef, watch, computed } from 'vue';
|
|
1
|
+
import { h, defineComponent, ref, toRef, watch, computed, watchEffect } from 'vue';
|
|
2
2
|
import { rgba } from 'seemly';
|
|
3
3
|
import { useMemo, useMergedState } from 'vooks';
|
|
4
|
+
import { on } from 'evtd';
|
|
4
5
|
import { RemoveIcon, AddIcon } from '../../_internal/icons';
|
|
5
6
|
import { NInput } from '../../input';
|
|
6
7
|
import { NBaseIcon } from '../../_internal';
|
|
7
|
-
import {
|
|
8
|
+
import { NxButton } from '../../button';
|
|
8
9
|
import { useTheme, useFormItem, useLocale, useConfig } from '../../_mixins';
|
|
9
|
-
import {
|
|
10
|
+
import { warnOnce, call } from '../../_utils';
|
|
10
11
|
import { inputNumberLight } from '../styles';
|
|
11
12
|
import { parse, validator, format, parseNumber, isWipValue } from './utils';
|
|
12
13
|
import style from './styles/input-number.cssr';
|
|
14
|
+
const HOLDING_CHANGE_THRESHOLD = 800;
|
|
15
|
+
const HOLDING_CHANGE_INTERVAL = 100;
|
|
13
16
|
const inputNumberProps = Object.assign(Object.assign({}, useTheme.props), { loading: {
|
|
14
17
|
type: Boolean,
|
|
15
18
|
default: undefined
|
|
@@ -36,20 +39,18 @@ const inputNumberProps = Object.assign(Object.assign({}, useTheme.props), { load
|
|
|
36
39
|
default: true
|
|
37
40
|
}, 'onUpdate:value': [Function, Array], onUpdateValue: [Function, Array], onFocus: [Function, Array], onBlur: [Function, Array], onClear: [Function, Array],
|
|
38
41
|
// deprecated
|
|
39
|
-
onChange:
|
|
40
|
-
type: [Function, Array],
|
|
41
|
-
validator: () => {
|
|
42
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
43
|
-
warn('input-number', '`on-change` is deprecated, please use `on-update:value` instead.');
|
|
44
|
-
}
|
|
45
|
-
return true;
|
|
46
|
-
},
|
|
47
|
-
default: undefined
|
|
48
|
-
} });
|
|
42
|
+
onChange: [Function, Array] });
|
|
49
43
|
export default defineComponent({
|
|
50
44
|
name: 'InputNumber',
|
|
51
45
|
props: inputNumberProps,
|
|
52
46
|
setup(props) {
|
|
47
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
48
|
+
watchEffect(() => {
|
|
49
|
+
if (props.onChange !== undefined) {
|
|
50
|
+
warnOnce('input-number', '`on-change` is deprecated, please use `on-update:value` instead');
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
}
|
|
53
54
|
const { mergedBorderedRef, mergedClsPrefixRef } = useConfig(props);
|
|
54
55
|
const themeRef = useTheme('InputNumber', '-input-number', style, inputNumberLight, props, mergedClsPrefixRef);
|
|
55
56
|
const { localeRef } = useLocale('InputNumber');
|
|
@@ -235,8 +236,10 @@ export default defineComponent({
|
|
|
235
236
|
}
|
|
236
237
|
function doAdd() {
|
|
237
238
|
const { value: addable } = addableRef;
|
|
238
|
-
if (!addable)
|
|
239
|
+
if (!addable) {
|
|
240
|
+
clearAddHoldTimeout();
|
|
239
241
|
return;
|
|
242
|
+
}
|
|
240
243
|
const { value: mergedValue } = mergedValueRef;
|
|
241
244
|
if (mergedValue === null) {
|
|
242
245
|
if (!props.validator) {
|
|
@@ -250,8 +253,10 @@ export default defineComponent({
|
|
|
250
253
|
}
|
|
251
254
|
function doMinus() {
|
|
252
255
|
const { value: minusable } = minusableRef;
|
|
253
|
-
if (!minusable)
|
|
256
|
+
if (!minusable) {
|
|
257
|
+
clearMinusHoldTimeout();
|
|
254
258
|
return;
|
|
259
|
+
}
|
|
255
260
|
const { value: mergedValue } = mergedValueRef;
|
|
256
261
|
if (mergedValue === null) {
|
|
257
262
|
if (!props.validator) {
|
|
@@ -294,8 +299,60 @@ export default defineComponent({
|
|
|
294
299
|
}
|
|
295
300
|
(_c = inputInstRef.value) === null || _c === void 0 ? void 0 : _c.activate();
|
|
296
301
|
}
|
|
297
|
-
|
|
298
|
-
|
|
302
|
+
let minusHoldStateIntervalId = null;
|
|
303
|
+
let addHoldStateIntervalId = null;
|
|
304
|
+
let firstMinusMousedownId = null;
|
|
305
|
+
function clearMinusHoldTimeout() {
|
|
306
|
+
if (firstMinusMousedownId) {
|
|
307
|
+
window.clearTimeout(firstMinusMousedownId);
|
|
308
|
+
firstMinusMousedownId = null;
|
|
309
|
+
}
|
|
310
|
+
if (minusHoldStateIntervalId) {
|
|
311
|
+
window.clearInterval(minusHoldStateIntervalId);
|
|
312
|
+
minusHoldStateIntervalId = null;
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
function clearAddHoldTimeout() {
|
|
316
|
+
if (firstAddMousedownId) {
|
|
317
|
+
window.clearTimeout(firstAddMousedownId);
|
|
318
|
+
firstAddMousedownId = null;
|
|
319
|
+
}
|
|
320
|
+
if (addHoldStateIntervalId) {
|
|
321
|
+
window.clearInterval(addHoldStateIntervalId);
|
|
322
|
+
addHoldStateIntervalId = null;
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
function handleMinusMousedown() {
|
|
326
|
+
firstMinusMousedownId = window.setTimeout(() => {
|
|
327
|
+
minusHoldStateIntervalId = window.setInterval(() => {
|
|
328
|
+
doMinus();
|
|
329
|
+
}, HOLDING_CHANGE_INTERVAL);
|
|
330
|
+
}, HOLDING_CHANGE_THRESHOLD);
|
|
331
|
+
on('mouseup', document, () => {
|
|
332
|
+
window.setTimeout(clearMinusHoldTimeout, 0);
|
|
333
|
+
});
|
|
334
|
+
}
|
|
335
|
+
let firstAddMousedownId = null;
|
|
336
|
+
function handleAddMousedown() {
|
|
337
|
+
firstAddMousedownId = window.setTimeout(() => {
|
|
338
|
+
addHoldStateIntervalId = window.setInterval(() => {
|
|
339
|
+
doAdd();
|
|
340
|
+
}, HOLDING_CHANGE_INTERVAL);
|
|
341
|
+
}, HOLDING_CHANGE_THRESHOLD);
|
|
342
|
+
on('mouseup', document, () => {
|
|
343
|
+
window.setTimeout(clearAddHoldTimeout, 0);
|
|
344
|
+
});
|
|
345
|
+
}
|
|
346
|
+
const handleAddClick = () => {
|
|
347
|
+
if (addHoldStateIntervalId)
|
|
348
|
+
return;
|
|
349
|
+
doAdd();
|
|
350
|
+
};
|
|
351
|
+
const handleMinusClick = () => {
|
|
352
|
+
if (minusHoldStateIntervalId)
|
|
353
|
+
return;
|
|
354
|
+
doMinus();
|
|
355
|
+
};
|
|
299
356
|
function handleKeyDown(e) {
|
|
300
357
|
var _a, _b;
|
|
301
358
|
if (e.code === 'Enter' || e.code === 'NumpadEnter') {
|
|
@@ -349,6 +406,8 @@ export default defineComponent({
|
|
|
349
406
|
handleMouseDown,
|
|
350
407
|
handleAddClick,
|
|
351
408
|
handleMinusClick,
|
|
409
|
+
handleAddMousedown,
|
|
410
|
+
handleMinusMousedown,
|
|
352
411
|
handleKeyDown,
|
|
353
412
|
handleUpdateDisplayedValue,
|
|
354
413
|
// theme
|
|
@@ -375,12 +434,12 @@ export default defineComponent({
|
|
|
375
434
|
return this.showButton
|
|
376
435
|
? [
|
|
377
436
|
this.$slots.suffix && (h("span", { class: `${mergedClsPrefix}-input-number-suffix` }, { default: this.$slots.suffix })),
|
|
378
|
-
h(
|
|
379
|
-
default: () => (h(NBaseIcon, { clsPrefix: mergedClsPrefix }, {
|
|
437
|
+
h(NxButton, { text: true, disabled: !this.minusable || this.mergedDisabled || this.readonly, focusable: false, builtinThemeOverrides: this.buttonThemeOverrides, onClick: this.handleMinusClick, onMousedown: this.handleMinusMousedown, ref: "minusButtonInstRef" }, {
|
|
438
|
+
default: () => (h(NBaseIcon, { clsPrefix: mergedClsPrefix, "aria-disabled": true }, {
|
|
380
439
|
default: () => h(RemoveIcon, null)
|
|
381
440
|
}))
|
|
382
441
|
}),
|
|
383
|
-
h(
|
|
442
|
+
h(NxButton, { text: true, disabled: !this.addable || this.mergedDisabled || this.readonly, focusable: false, builtinThemeOverrides: this.buttonThemeOverrides, onClick: this.handleAddClick, onMousedown: this.handleAddMousedown, ref: "addButtonInstRef" }, {
|
|
384
443
|
default: () => (h(NBaseIcon, { clsPrefix: mergedClsPrefix }, {
|
|
385
444
|
default: () => h(AddIcon, null)
|
|
386
445
|
}))
|
|
@@ -167,6 +167,7 @@ export declare function createLayoutComponent(isContent: boolean): import("vue")
|
|
|
167
167
|
containerScrollTop: number;
|
|
168
168
|
syncUnifiedContainer: () => void;
|
|
169
169
|
scrollTo: import("../../_internal/scrollbar/src/ScrollBar").ScrollTo;
|
|
170
|
+
scrollBy: import("../../_internal/scrollbar/src/ScrollBar").ScrollBy;
|
|
170
171
|
sync: () => void;
|
|
171
172
|
handleMouseEnterWrapper: () => void;
|
|
172
173
|
handleMouseLeaveWrapper: () => void;
|
|
@@ -319,7 +320,9 @@ export declare function createLayoutComponent(isContent: boolean): import("vue")
|
|
|
319
320
|
'--n-bezier': string;
|
|
320
321
|
'--n-color': string;
|
|
321
322
|
'--n-text-color': string;
|
|
322
|
-
}
|
|
323
|
+
}> | undefined;
|
|
324
|
+
themeClass: import("vue").Ref<string> | undefined;
|
|
325
|
+
onRender: (() => void) | undefined;
|
|
323
326
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
|
|
324
327
|
embedded: BooleanConstructor;
|
|
325
328
|
position: {
|
|
@@ -560,6 +563,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
560
563
|
containerScrollTop: number;
|
|
561
564
|
syncUnifiedContainer: () => void;
|
|
562
565
|
scrollTo: import("../../_internal/scrollbar/src/ScrollBar").ScrollTo;
|
|
566
|
+
scrollBy: import("../../_internal/scrollbar/src/ScrollBar").ScrollBy;
|
|
563
567
|
sync: () => void;
|
|
564
568
|
handleMouseEnterWrapper: () => void;
|
|
565
569
|
handleMouseLeaveWrapper: () => void;
|
|
@@ -712,7 +716,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
712
716
|
'--n-bezier': string;
|
|
713
717
|
'--n-color': string;
|
|
714
718
|
'--n-text-color': string;
|
|
715
|
-
}
|
|
719
|
+
}> | undefined;
|
|
720
|
+
themeClass: import("vue").Ref<string> | undefined;
|
|
721
|
+
onRender: (() => void) | undefined;
|
|
716
722
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
|
|
717
723
|
embedded: BooleanConstructor;
|
|
718
724
|
position: {
|
package/es/layout/src/Layout.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { h, defineComponent, computed, ref, provide } from 'vue';
|
|
2
2
|
import { NScrollbar } from '../../_internal';
|
|
3
|
-
import { useConfig, useTheme } from '../../_mixins';
|
|
3
|
+
import { useConfig, useTheme, useThemeClass } from '../../_mixins';
|
|
4
4
|
import { layoutLight } from '../styles';
|
|
5
5
|
import style from './styles/layout.cssr';
|
|
6
6
|
import { positionProp } from './interface';
|
|
@@ -33,7 +33,7 @@ export function createLayoutComponent(isContent) {
|
|
|
33
33
|
setup(props) {
|
|
34
34
|
const scrollableElRef = ref(null);
|
|
35
35
|
const scrollbarInstRef = ref(null);
|
|
36
|
-
const { mergedClsPrefixRef } = useConfig(props);
|
|
36
|
+
const { mergedClsPrefixRef, inlineThemeDisabled } = useConfig(props);
|
|
37
37
|
const themeRef = useTheme('Layout', '-layout', style, layoutLight, props, mergedClsPrefixRef);
|
|
38
38
|
function scrollTo(options, y) {
|
|
39
39
|
if (props.nativeScrollbar) {
|
|
@@ -64,21 +64,28 @@ export function createLayoutComponent(isContent) {
|
|
|
64
64
|
const exposedMethods = {
|
|
65
65
|
scrollTo
|
|
66
66
|
};
|
|
67
|
+
const cssVarsRef = computed(() => {
|
|
68
|
+
const { common: { cubicBezierEaseInOut }, self } = themeRef.value;
|
|
69
|
+
return {
|
|
70
|
+
'--n-bezier': cubicBezierEaseInOut,
|
|
71
|
+
'--n-color': props.embedded ? self.colorEmbedded : self.color,
|
|
72
|
+
'--n-text-color': self.textColor
|
|
73
|
+
};
|
|
74
|
+
});
|
|
75
|
+
const themeClassHandle = inlineThemeDisabled
|
|
76
|
+
? useThemeClass('layout', undefined, cssVarsRef, props)
|
|
77
|
+
: undefined;
|
|
67
78
|
return Object.assign({ mergedClsPrefix: mergedClsPrefixRef, scrollableElRef,
|
|
68
79
|
scrollbarInstRef,
|
|
69
|
-
hasSiderStyle, mergedTheme: themeRef, cssVars:
|
|
70
|
-
const { common: { cubicBezierEaseInOut }, self } = themeRef.value;
|
|
71
|
-
return {
|
|
72
|
-
'--n-bezier': cubicBezierEaseInOut,
|
|
73
|
-
'--n-color': props.embedded ? self.colorEmbedded : self.color,
|
|
74
|
-
'--n-text-color': self.textColor
|
|
75
|
-
};
|
|
76
|
-
}) }, exposedMethods);
|
|
80
|
+
hasSiderStyle, mergedTheme: themeRef, 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);
|
|
77
81
|
},
|
|
78
82
|
render() {
|
|
83
|
+
var _a;
|
|
79
84
|
const { mergedClsPrefix, hasSider } = this;
|
|
85
|
+
(_a = this.onRender) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
80
86
|
const hasSiderStyle = hasSider ? this.hasSiderStyle : undefined;
|
|
81
87
|
const layoutClass = [
|
|
88
|
+
this.themeClass,
|
|
82
89
|
isContent && `${mergedClsPrefix}-layout-content`,
|
|
83
90
|
`${mergedClsPrefix}-layout`,
|
|
84
91
|
`${mergedClsPrefix}-layout--${this.position}-positioned`
|
|
@@ -119,6 +119,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
119
119
|
containerScrollTop: number;
|
|
120
120
|
syncUnifiedContainer: () => void;
|
|
121
121
|
scrollTo: import("../../_internal/scrollbar/src/ScrollBar").ScrollTo;
|
|
122
|
+
scrollBy: import("../../_internal/scrollbar/src/ScrollBar").ScrollBy;
|
|
122
123
|
sync: () => void;
|
|
123
124
|
handleMouseEnterWrapper: () => void;
|
|
124
125
|
handleMouseLeaveWrapper: () => void;
|
|
@@ -271,7 +272,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
271
272
|
'--n-bezier': string;
|
|
272
273
|
'--n-color': string;
|
|
273
274
|
'--n-text-color': string;
|
|
274
|
-
}
|
|
275
|
+
}> | undefined;
|
|
276
|
+
themeClass: import("vue").Ref<string> | undefined;
|
|
277
|
+
onRender: (() => void) | undefined;
|
|
275
278
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
276
279
|
embedded: BooleanConstructor;
|
|
277
280
|
position: {
|
|
@@ -197,7 +197,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
197
197
|
}>>>;
|
|
198
198
|
}, {
|
|
199
199
|
mergedClsPrefix: import("vue").ComputedRef<string>;
|
|
200
|
-
cssVars: import("vue").ComputedRef<any
|
|
200
|
+
cssVars: import("vue").ComputedRef<any> | undefined;
|
|
201
|
+
themeClass: import("vue").Ref<string> | undefined;
|
|
202
|
+
onRender: (() => void) | undefined;
|
|
201
203
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
202
204
|
inverted: BooleanConstructor;
|
|
203
205
|
position: {
|