naive-ui 2.21.4 → 2.23.1
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/close/src/styles/index.cssr.js +6 -5
- package/es/_internal/scrollbar/src/ScrollBar.d.ts +4 -0
- package/es/_internal/scrollbar/src/ScrollBar.js +5 -2
- package/es/_internal/selection/src/Selection.js +11 -9
- package/es/_internal/selection/src/styles/index.cssr.js +6 -2
- package/es/_utils/composable/use-houdini.js +10 -7
- package/es/alert/src/Alert.d.ts +20 -20
- package/es/alert/src/Alert.js +22 -22
- package/es/alert/src/styles/index.cssr.js +45 -45
- package/es/anchor/src/AnchorAdapter.js +12 -12
- package/es/anchor/src/styles/index.cssr.js +41 -41
- package/es/auto-complete/src/AutoComplete.d.ts +2 -2
- package/es/auto-complete/src/AutoComplete.js +2 -2
- package/es/auto-complete/src/styles/index.cssr.js +4 -4
- package/es/avatar/src/Avatar.d.ts +10 -8
- package/es/avatar/src/Avatar.js +11 -9
- package/es/avatar/src/styles/index.cssr.js +14 -16
- package/es/back-top/src/BackTop.d.ts +13 -13
- package/es/back-top/src/BackTop.js +13 -13
- package/es/back-top/src/styles/index.cssr.js +29 -29
- package/es/badge/src/Badge.d.ts +6 -6
- package/es/badge/src/Badge.js +6 -6
- package/es/badge/src/styles/index.cssr.js +15 -15
- package/es/button/src/Button.d.ts +43 -38
- package/es/button/src/Button.js +124 -116
- package/es/button/src/styles/button.cssr.js +83 -80
- package/es/button/styles/light.js +1 -1
- package/es/calendar/src/Calendar.d.ts +6 -0
- package/es/cascader/src/Cascader.d.ts +135 -0
- package/es/cascader/src/Cascader.js +2 -4
- package/es/cascader/src/CascaderMenu.d.ts +345 -0
- package/es/cascader/src/CascaderMenu.js +6 -5
- package/es/cascader/src/CascaderOption.d.ts +18 -0
- package/es/cascader/src/CascaderSelectMenu.d.ts +18 -0
- package/es/cascader/src/CascaderSubmenu.d.ts +18 -0
- package/es/cascader/styles/dark.js +3 -1
- package/es/cascader/styles/light.d.ts +13 -0
- package/es/cascader/styles/light.js +3 -1
- package/es/config-provider/src/ConfigProvider.d.ts +18 -0
- package/es/data-table/src/DataTable.js +7 -13
- package/es/data-table/src/MainTable.js +2 -3
- package/es/data-table/src/TableParts/Body.d.ts +15 -4
- package/es/data-table/src/TableParts/Body.js +80 -28
- package/es/data-table/src/TableParts/Cell.js +2 -3
- package/es/data-table/src/TableParts/Header.js +2 -2
- package/es/data-table/src/interface.d.ts +4 -1
- package/es/data-table/src/styles/index.cssr.js +4 -3
- package/es/data-table/src/use-check.js +6 -2
- package/es/data-table/src/use-scroll.d.ts +2 -0
- package/es/data-table/src/use-scroll.js +34 -4
- package/es/data-table/src/use-table-data.js +3 -1
- package/es/data-table/styles/_common.js +1 -1
- package/es/date-picker/src/DatePicker.d.ts +30 -5
- package/es/date-picker/src/DatePicker.js +32 -9
- package/es/date-picker/src/config.d.ts +1 -9
- package/es/date-picker/src/config.js +0 -8
- package/es/date-picker/src/interface.d.ts +2 -1
- package/es/date-picker/src/panel/date.d.ts +17 -10
- package/es/date-picker/src/panel/date.js +2 -2
- package/es/date-picker/src/panel/daterange.d.ts +15 -9
- package/es/date-picker/src/panel/daterange.js +2 -2
- package/es/date-picker/src/panel/datetime.d.ts +17 -16
- package/es/date-picker/src/panel/datetime.js +2 -2
- package/es/date-picker/src/panel/datetimerange.d.ts +15 -9
- package/es/date-picker/src/panel/datetimerange.js +2 -2
- package/es/date-picker/src/panel/month.d.ts +21 -20
- package/es/date-picker/src/panel/month.js +23 -12
- package/es/date-picker/src/panel/use-calendar.d.ts +17 -39
- package/es/date-picker/src/panel/use-calendar.js +41 -23
- package/es/date-picker/src/panel/use-dual-calendar.d.ts +13 -36
- package/es/date-picker/src/panel/use-dual-calendar.js +35 -21
- package/es/date-picker/src/panel/use-panel-common.d.ts +13 -32
- package/es/date-picker/src/panel/use-panel-common.js +4 -8
- package/es/date-picker/src/utils.d.ts +19 -3
- package/es/date-picker/src/utils.js +40 -5
- package/es/date-picker/styles/_common.d.ts +2 -0
- package/es/date-picker/styles/_common.js +3 -1
- package/es/date-picker/styles/light.d.ts +4 -0
- package/es/dialog/src/Dialog.d.ts +21 -21
- package/es/dialog/src/Dialog.js +23 -23
- package/es/dialog/src/styles/index.cssr.js +45 -45
- package/es/divider/src/Divider.d.ts +4 -4
- package/es/divider/src/Divider.js +4 -4
- package/es/divider/src/styles/index.cssr.js +12 -12
- package/es/dynamic-tags/src/DynamicTags.d.ts +1 -1
- package/es/dynamic-tags/src/DynamicTags.js +1 -1
- package/es/dynamic-tags/src/styles/index.cssr.js +1 -1
- package/es/form/src/Form.d.ts +27 -27
- package/es/form/src/FormItem.d.ts +27 -27
- package/es/form/src/FormItemCol.d.ts +27 -27
- package/es/form/src/FormItemGridItem.d.ts +27 -27
- package/es/form/src/FormItemRow.d.ts +27 -27
- package/es/form/styles/_common.d.ts +0 -3
- package/es/form/styles/_common.js +0 -3
- package/es/form/styles/light.d.ts +3 -3
- package/es/form/styles/light.js +2 -2
- package/es/image/src/Image.js +8 -12
- package/es/input/src/Input.js +2 -0
- package/es/input-number/src/InputNumber.js +2 -0
- package/es/input-number/src/utils.js +1 -1
- package/es/locales/common/deDE.js +6 -0
- package/es/locales/common/enUS.d.ts +6 -0
- package/es/locales/common/enUS.js +7 -1
- package/es/locales/common/frFR.d.ts +3 -0
- package/es/locales/common/frFR.js +101 -0
- package/es/locales/common/idID.d.ts +2 -94
- package/es/locales/common/idID.js +6 -0
- package/es/locales/common/jaJP.js +6 -0
- package/es/locales/common/nbNO.js +6 -0
- package/es/locales/common/ruRU.js +6 -0
- package/es/locales/common/ukUA.js +6 -0
- package/es/locales/common/zhCN.js +6 -0
- package/es/locales/common/zhTW.d.ts +3 -0
- package/es/locales/common/zhTW.js +100 -0
- package/es/locales/date/frFR.d.ts +3 -0
- package/es/locales/date/frFR.js +6 -0
- package/es/locales/date/idID.d.ts +1 -6
- package/es/locales/date/zhTW.d.ts +3 -0
- package/es/locales/date/zhTW.js +6 -0
- package/es/locales/index.d.ts +4 -0
- package/es/locales/index.js +4 -0
- package/es/log/src/Log.d.ts +6 -6
- package/es/log/src/Log.js +6 -6
- package/es/log/src/styles/index.cssr.js +16 -18
- package/es/page-header/src/PageHeader.js +3 -3
- package/es/page-header/src/styles/index.cssr.js +2 -4
- package/es/popover/src/Popover.js +4 -1
- package/es/popover/src/PopoverBody.js +3 -3
- package/es/popselect/src/Popselect.d.ts +2 -11
- package/es/popselect/src/Popselect.js +2 -2
- package/es/popselect/src/PopselectPanel.d.ts +3 -11
- package/es/popselect/src/PopselectPanel.js +17 -11
- package/es/radio/src/Radio.js +3 -3
- package/es/radio/src/RadioButton.js +4 -5
- package/es/radio/src/styles/radio-group.cssr.js +8 -4
- package/es/radio/src/styles/radio.cssr.js +8 -4
- package/es/radio/src/use-radio.d.ts +0 -3
- package/es/radio/src/use-radio.js +1 -26
- package/es/steps/src/Step.d.ts +12 -12
- package/es/steps/src/Step.js +12 -12
- package/es/steps/src/styles/index.cssr.js +46 -46
- package/es/switch/src/Switch.d.ts +19 -19
- package/es/switch/src/Switch.js +26 -19
- package/es/switch/src/styles/index.cssr.js +59 -57
- package/es/tabs/src/styles/index.cssr.js +1 -0
- package/es/tag/src/Tag.d.ts +26 -26
- package/es/tag/src/Tag.js +26 -26
- package/es/tag/src/styles/index.cssr.js +55 -55
- package/es/tag/src/styles/rtl.cssr.js +1 -1
- package/es/time-picker/src/TimePicker.d.ts +17 -17
- package/es/time-picker/src/TimePicker.js +17 -17
- package/es/time-picker/src/styles/index.cssr.js +47 -47
- package/es/timeline/src/TimelineItem.d.ts +12 -12
- package/es/timeline/src/TimelineItem.js +12 -12
- package/es/timeline/src/styles/index.cssr.js +44 -44
- package/es/transfer/src/styles/index.cssr.js +9 -4
- package/es/tree/src/Tree.d.ts +11 -11
- package/es/tree/src/Tree.js +11 -11
- package/es/tree/src/dnd.js +2 -2
- package/es/tree/src/styles/index.cssr.js +33 -33
- package/es/tree-select/src/TreeSelect.d.ts +43 -6
- package/es/tree-select/src/TreeSelect.js +29 -14
- package/es/tree-select/src/styles/index.cssr.js +20 -11
- package/es/tree-select/styles/light.d.ts +6 -0
- package/es/tree-select/styles/light.js +5 -2
- package/es/typography/src/a.d.ts +2 -2
- package/es/typography/src/a.js +2 -2
- package/es/typography/src/blockquote.d.ts +5 -5
- package/es/typography/src/blockquote.js +5 -5
- package/es/typography/src/create-header.d.ts +8 -8
- package/es/typography/src/create-header.js +8 -8
- package/es/typography/src/headers.d.ts +48 -48
- package/es/typography/src/hr.d.ts +2 -1
- package/es/typography/src/hr.js +3 -1
- package/es/typography/src/ol.d.ts +7 -7
- package/es/typography/src/ol.js +7 -7
- package/es/typography/src/p.d.ts +5 -5
- package/es/typography/src/p.js +5 -5
- package/es/typography/src/styles/a.cssr.js +6 -6
- package/es/typography/src/styles/blockquote.cssr.js +11 -11
- package/es/typography/src/styles/header.cssr.js +19 -19
- package/es/typography/src/styles/hr.cssr.js +3 -3
- package/es/typography/src/styles/list.cssr.js +15 -15
- package/es/typography/src/styles/p.cssr.js +10 -10
- package/es/typography/src/styles/text.cssr.js +18 -18
- package/es/typography/src/text.d.ts +8 -7
- package/es/typography/src/text.js +9 -8
- package/es/typography/src/ul.d.ts +7 -7
- package/es/typography/src/ul.js +7 -7
- package/es/upload/src/Upload.js +16 -16
- package/es/upload/src/styles/index.cssr.js +36 -36
- package/es/version.d.ts +1 -1
- package/es/version.js +1 -1
- package/lib/_internal/close/src/styles/index.cssr.js +6 -5
- package/lib/_internal/scrollbar/src/ScrollBar.d.ts +4 -0
- package/lib/_internal/scrollbar/src/ScrollBar.js +5 -2
- package/lib/_internal/selection/src/Selection.js +11 -9
- package/lib/_internal/selection/src/styles/index.cssr.js +6 -2
- package/lib/_utils/composable/use-houdini.js +10 -7
- package/lib/alert/src/Alert.d.ts +20 -20
- package/lib/alert/src/Alert.js +22 -22
- package/lib/alert/src/styles/index.cssr.js +45 -45
- package/lib/anchor/src/AnchorAdapter.js +12 -12
- package/lib/anchor/src/styles/index.cssr.js +41 -41
- package/lib/auto-complete/src/AutoComplete.d.ts +2 -2
- package/lib/auto-complete/src/AutoComplete.js +2 -2
- package/lib/auto-complete/src/styles/index.cssr.js +4 -4
- package/lib/avatar/src/Avatar.d.ts +10 -8
- package/lib/avatar/src/Avatar.js +11 -9
- package/lib/avatar/src/styles/index.cssr.js +14 -16
- package/lib/back-top/src/BackTop.d.ts +13 -13
- package/lib/back-top/src/BackTop.js +13 -13
- package/lib/back-top/src/styles/index.cssr.js +29 -29
- package/lib/badge/src/Badge.d.ts +6 -6
- package/lib/badge/src/Badge.js +6 -6
- package/lib/badge/src/styles/index.cssr.js +15 -15
- package/lib/button/src/Button.d.ts +43 -38
- package/lib/button/src/Button.js +123 -115
- package/lib/button/src/styles/button.cssr.js +83 -80
- package/lib/button/styles/light.js +1 -1
- package/lib/calendar/src/Calendar.d.ts +6 -0
- package/lib/cascader/src/Cascader.d.ts +135 -0
- package/lib/cascader/src/Cascader.js +2 -4
- package/lib/cascader/src/CascaderMenu.d.ts +345 -0
- package/lib/cascader/src/CascaderMenu.js +6 -5
- package/lib/cascader/src/CascaderOption.d.ts +18 -0
- package/lib/cascader/src/CascaderSelectMenu.d.ts +18 -0
- package/lib/cascader/src/CascaderSubmenu.d.ts +18 -0
- package/lib/cascader/styles/dark.js +3 -1
- package/lib/cascader/styles/light.d.ts +13 -0
- package/lib/cascader/styles/light.js +3 -1
- package/lib/config-provider/src/ConfigProvider.d.ts +18 -0
- package/lib/data-table/src/DataTable.js +6 -12
- package/lib/data-table/src/MainTable.js +1 -2
- package/lib/data-table/src/TableParts/Body.d.ts +15 -4
- package/lib/data-table/src/TableParts/Body.js +78 -26
- package/lib/data-table/src/TableParts/Cell.js +2 -3
- package/lib/data-table/src/TableParts/Header.js +2 -2
- package/lib/data-table/src/interface.d.ts +4 -1
- package/lib/data-table/src/styles/index.cssr.js +4 -3
- package/lib/data-table/src/use-check.js +6 -2
- package/lib/data-table/src/use-scroll.d.ts +2 -0
- package/lib/data-table/src/use-scroll.js +34 -4
- package/lib/data-table/src/use-table-data.js +3 -1
- package/lib/data-table/styles/_common.js +1 -1
- package/lib/date-picker/src/DatePicker.d.ts +30 -5
- package/lib/date-picker/src/DatePicker.js +31 -8
- package/lib/date-picker/src/config.d.ts +1 -9
- package/lib/date-picker/src/config.js +1 -9
- package/lib/date-picker/src/interface.d.ts +2 -1
- package/lib/date-picker/src/panel/date.d.ts +17 -10
- package/lib/date-picker/src/panel/date.js +1 -1
- package/lib/date-picker/src/panel/daterange.d.ts +15 -9
- package/lib/date-picker/src/panel/daterange.js +1 -1
- package/lib/date-picker/src/panel/datetime.d.ts +17 -16
- package/lib/date-picker/src/panel/datetime.js +1 -1
- package/lib/date-picker/src/panel/datetimerange.d.ts +15 -9
- package/lib/date-picker/src/panel/datetimerange.js +2 -2
- package/lib/date-picker/src/panel/month.d.ts +21 -20
- package/lib/date-picker/src/panel/month.js +23 -12
- package/lib/date-picker/src/panel/use-calendar.d.ts +17 -39
- package/lib/date-picker/src/panel/use-calendar.js +40 -21
- package/lib/date-picker/src/panel/use-dual-calendar.d.ts +13 -36
- package/lib/date-picker/src/panel/use-dual-calendar.js +34 -19
- package/lib/date-picker/src/panel/use-panel-common.d.ts +13 -32
- package/lib/date-picker/src/panel/use-panel-common.js +5 -8
- package/lib/date-picker/src/utils.d.ts +19 -3
- package/lib/date-picker/src/utils.js +41 -4
- package/lib/date-picker/styles/_common.d.ts +2 -0
- package/lib/date-picker/styles/_common.js +3 -1
- package/lib/date-picker/styles/light.d.ts +4 -0
- package/lib/dialog/src/Dialog.d.ts +21 -21
- package/lib/dialog/src/Dialog.js +23 -23
- package/lib/dialog/src/styles/index.cssr.js +45 -45
- package/lib/divider/src/Divider.d.ts +4 -4
- package/lib/divider/src/Divider.js +4 -4
- package/lib/divider/src/styles/index.cssr.js +12 -12
- package/lib/dynamic-tags/src/DynamicTags.d.ts +1 -1
- package/lib/dynamic-tags/src/DynamicTags.js +1 -1
- package/lib/dynamic-tags/src/styles/index.cssr.js +1 -1
- package/lib/form/src/Form.d.ts +27 -27
- package/lib/form/src/FormItem.d.ts +27 -27
- package/lib/form/src/FormItemCol.d.ts +27 -27
- package/lib/form/src/FormItemGridItem.d.ts +27 -27
- package/lib/form/src/FormItemRow.d.ts +27 -27
- package/lib/form/styles/_common.d.ts +0 -3
- package/lib/form/styles/_common.js +0 -3
- package/lib/form/styles/light.d.ts +3 -3
- package/lib/form/styles/light.js +2 -2
- package/lib/image/src/Image.js +7 -11
- package/lib/input/src/Input.js +2 -0
- package/lib/input-number/src/InputNumber.js +2 -0
- package/lib/input-number/src/utils.js +1 -1
- package/lib/locales/common/deDE.js +6 -0
- package/lib/locales/common/enUS.d.ts +6 -0
- package/lib/locales/common/enUS.js +7 -1
- package/lib/locales/common/frFR.d.ts +3 -0
- package/lib/locales/common/frFR.js +103 -0
- package/lib/locales/common/idID.d.ts +2 -94
- package/lib/locales/common/idID.js +6 -0
- package/lib/locales/common/jaJP.js +6 -0
- package/lib/locales/common/nbNO.js +6 -0
- package/lib/locales/common/ruRU.js +6 -0
- package/lib/locales/common/ukUA.js +6 -0
- package/lib/locales/common/zhCN.js +6 -0
- package/lib/locales/common/zhTW.d.ts +3 -0
- package/lib/locales/common/zhTW.js +102 -0
- package/lib/locales/date/frFR.d.ts +3 -0
- package/lib/locales/date/frFR.js +11 -0
- package/lib/locales/date/idID.d.ts +1 -6
- package/lib/locales/date/zhTW.d.ts +3 -0
- package/lib/locales/date/zhTW.js +11 -0
- package/lib/locales/index.d.ts +4 -0
- package/lib/locales/index.js +9 -1
- package/lib/log/src/Log.d.ts +6 -6
- package/lib/log/src/Log.js +6 -6
- package/lib/log/src/styles/index.cssr.js +16 -18
- package/lib/page-header/src/PageHeader.js +3 -3
- package/lib/page-header/src/styles/index.cssr.js +2 -4
- package/lib/popover/src/Popover.js +4 -1
- package/lib/popover/src/PopoverBody.js +3 -3
- package/lib/popselect/src/Popselect.d.ts +2 -11
- package/lib/popselect/src/Popselect.js +2 -2
- package/lib/popselect/src/PopselectPanel.d.ts +3 -11
- package/lib/popselect/src/PopselectPanel.js +16 -10
- package/lib/radio/src/Radio.js +3 -3
- package/lib/radio/src/RadioButton.js +4 -5
- package/lib/radio/src/styles/radio-group.cssr.js +8 -4
- package/lib/radio/src/styles/radio.cssr.js +8 -4
- package/lib/radio/src/use-radio.d.ts +0 -3
- package/lib/radio/src/use-radio.js +1 -26
- package/lib/steps/src/Step.d.ts +12 -12
- package/lib/steps/src/Step.js +12 -12
- package/lib/steps/src/styles/index.cssr.js +46 -46
- package/lib/switch/src/Switch.d.ts +19 -19
- package/lib/switch/src/Switch.js +26 -19
- package/lib/switch/src/styles/index.cssr.js +59 -57
- package/lib/tabs/src/styles/index.cssr.js +1 -0
- package/lib/tag/src/Tag.d.ts +26 -26
- package/lib/tag/src/Tag.js +26 -26
- package/lib/tag/src/styles/index.cssr.js +55 -55
- package/lib/tag/src/styles/rtl.cssr.js +1 -1
- package/lib/time-picker/src/TimePicker.d.ts +17 -17
- package/lib/time-picker/src/TimePicker.js +17 -17
- package/lib/time-picker/src/styles/index.cssr.js +47 -47
- package/lib/timeline/src/TimelineItem.d.ts +12 -12
- package/lib/timeline/src/TimelineItem.js +12 -12
- package/lib/timeline/src/styles/index.cssr.js +44 -44
- package/lib/transfer/src/styles/index.cssr.js +9 -4
- package/lib/tree/src/Tree.d.ts +11 -11
- package/lib/tree/src/Tree.js +11 -11
- package/lib/tree/src/dnd.js +2 -2
- package/lib/tree/src/styles/index.cssr.js +33 -33
- package/lib/tree-select/src/TreeSelect.d.ts +43 -6
- package/lib/tree-select/src/TreeSelect.js +28 -13
- package/lib/tree-select/src/styles/index.cssr.js +20 -11
- package/lib/tree-select/styles/light.d.ts +6 -0
- package/lib/tree-select/styles/light.js +5 -2
- package/lib/typography/src/a.d.ts +2 -2
- package/lib/typography/src/a.js +2 -2
- package/lib/typography/src/blockquote.d.ts +5 -5
- package/lib/typography/src/blockquote.js +5 -5
- package/lib/typography/src/create-header.d.ts +8 -8
- package/lib/typography/src/create-header.js +8 -8
- package/lib/typography/src/headers.d.ts +48 -48
- package/lib/typography/src/hr.d.ts +2 -1
- package/lib/typography/src/hr.js +3 -1
- package/lib/typography/src/ol.d.ts +7 -7
- package/lib/typography/src/ol.js +7 -7
- package/lib/typography/src/p.d.ts +5 -5
- package/lib/typography/src/p.js +5 -5
- package/lib/typography/src/styles/a.cssr.js +6 -6
- package/lib/typography/src/styles/blockquote.cssr.js +11 -11
- package/lib/typography/src/styles/header.cssr.js +19 -19
- package/lib/typography/src/styles/hr.cssr.js +3 -3
- package/lib/typography/src/styles/list.cssr.js +15 -15
- package/lib/typography/src/styles/p.cssr.js +10 -10
- package/lib/typography/src/styles/text.cssr.js +18 -18
- package/lib/typography/src/text.d.ts +8 -7
- package/lib/typography/src/text.js +9 -8
- package/lib/typography/src/ul.d.ts +7 -7
- package/lib/typography/src/ul.js +7 -7
- package/lib/upload/src/Upload.js +16 -16
- package/lib/upload/src/styles/index.cssr.js +36 -36
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +29 -28
- package/web-types.json +25 -7
package/es/button/src/Button.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { h, ref, computed, inject, defineComponent, renderSlot, watchEffect } from 'vue';
|
|
1
|
+
import { h, ref, computed, inject, onMounted, defineComponent, renderSlot, watchEffect } from 'vue';
|
|
2
2
|
import { useMemo } from 'vooks';
|
|
3
3
|
import { createHoverColor, createPressedColor } from '../../_utils/color/index';
|
|
4
4
|
import { useConfig, useFormItem, useTheme } from '../../_mixins';
|
|
@@ -27,10 +27,10 @@ const buttonProps = Object.assign(Object.assign({}, useTheme.props), { color: St
|
|
|
27
27
|
}, attrType: {
|
|
28
28
|
type: String,
|
|
29
29
|
default: 'button'
|
|
30
|
-
},
|
|
30
|
+
}, bordered: {
|
|
31
31
|
type: Boolean,
|
|
32
32
|
default: true
|
|
33
|
-
} });
|
|
33
|
+
}, onClick: [Function, Array], internalAutoFocus: Boolean });
|
|
34
34
|
const Button = defineComponent({
|
|
35
35
|
name: 'Button',
|
|
36
36
|
props: buttonProps,
|
|
@@ -44,9 +44,18 @@ const Button = defineComponent({
|
|
|
44
44
|
}
|
|
45
45
|
});
|
|
46
46
|
}
|
|
47
|
-
const
|
|
48
|
-
const
|
|
47
|
+
const selfElRef = ref(null);
|
|
48
|
+
const waveElRef = ref(null);
|
|
49
49
|
const enterPressedRef = ref(false);
|
|
50
|
+
onMounted(() => {
|
|
51
|
+
const { value: selfEl } = selfElRef;
|
|
52
|
+
if (selfEl &&
|
|
53
|
+
!props.disabled &&
|
|
54
|
+
props.focusable &&
|
|
55
|
+
props.internalAutoFocus) {
|
|
56
|
+
selfEl.focus({ preventScroll: true });
|
|
57
|
+
}
|
|
58
|
+
});
|
|
50
59
|
const showBorderRef = useMemo(() => {
|
|
51
60
|
return (!props.quaternary &&
|
|
52
61
|
!props.tertiary &&
|
|
@@ -82,19 +91,17 @@ const Button = defineComponent({
|
|
|
82
91
|
return;
|
|
83
92
|
}
|
|
84
93
|
if (mergedFocusableRef.value) {
|
|
85
|
-
(_a =
|
|
94
|
+
(_a = selfElRef.value) === null || _a === void 0 ? void 0 : _a.focus({ preventScroll: true });
|
|
86
95
|
}
|
|
87
96
|
};
|
|
88
97
|
const handleClick = (e) => {
|
|
89
|
-
|
|
98
|
+
var _a;
|
|
99
|
+
if (!props.disabled && !props.loading) {
|
|
90
100
|
const { onClick } = props;
|
|
91
101
|
if (onClick)
|
|
92
102
|
call(onClick, e);
|
|
93
103
|
if (!props.text) {
|
|
94
|
-
|
|
95
|
-
if (value) {
|
|
96
|
-
value.play();
|
|
97
|
-
}
|
|
104
|
+
(_a = waveElRef.value) === null || _a === void 0 ? void 0 : _a.play();
|
|
98
105
|
}
|
|
99
106
|
}
|
|
100
107
|
};
|
|
@@ -112,7 +119,7 @@ const Button = defineComponent({
|
|
|
112
119
|
switch (e.code) {
|
|
113
120
|
case 'Enter':
|
|
114
121
|
case 'NumpadEnter':
|
|
115
|
-
if (!props.keyboard) {
|
|
122
|
+
if (!props.keyboard || props.loading) {
|
|
116
123
|
e.preventDefault();
|
|
117
124
|
return;
|
|
118
125
|
}
|
|
@@ -126,8 +133,8 @@ const Button = defineComponent({
|
|
|
126
133
|
const themeRef = useTheme('Button', 'Button', style, buttonLight, props, mergedClsPrefixRef);
|
|
127
134
|
const rtlEnabledRef = useRtl('Button', NConfigProvider === null || NConfigProvider === void 0 ? void 0 : NConfigProvider.mergedRtlRef, mergedClsPrefixRef);
|
|
128
135
|
return {
|
|
129
|
-
|
|
130
|
-
|
|
136
|
+
selfElRef,
|
|
137
|
+
waveElRef,
|
|
131
138
|
mergedClsPrefix: mergedClsPrefixRef,
|
|
132
139
|
mergedFocusable: mergedFocusableRef,
|
|
133
140
|
mergedSize: mergedSizeRef,
|
|
@@ -145,11 +152,11 @@ const Button = defineComponent({
|
|
|
145
152
|
return null;
|
|
146
153
|
const hoverColor = createHoverColor(color);
|
|
147
154
|
return {
|
|
148
|
-
'--border-color': color,
|
|
149
|
-
'--border-color-hover': hoverColor,
|
|
150
|
-
'--border-color-pressed': createPressedColor(color),
|
|
151
|
-
'--border-color-focus': hoverColor,
|
|
152
|
-
'--border-color-disabled': color
|
|
155
|
+
'--n-border-color': color,
|
|
156
|
+
'--n-border-color-hover': hoverColor,
|
|
157
|
+
'--n-border-color-pressed': createPressedColor(color),
|
|
158
|
+
'--n-border-color-focus': hoverColor,
|
|
159
|
+
'--n-border-color-disabled': color
|
|
153
160
|
};
|
|
154
161
|
}),
|
|
155
162
|
cssVars: computed(() => {
|
|
@@ -164,17 +171,17 @@ const Button = defineComponent({
|
|
|
164
171
|
};
|
|
165
172
|
// color
|
|
166
173
|
let colorProps = {
|
|
167
|
-
'--color': 'initial',
|
|
168
|
-
'--color-hover': 'initial',
|
|
169
|
-
'--color-pressed': 'initial',
|
|
170
|
-
'--color-focus': 'initial',
|
|
171
|
-
'--color-disabled': 'initial',
|
|
172
|
-
'--ripple-color': 'initial',
|
|
173
|
-
'--text-color': 'initial',
|
|
174
|
-
'--text-color-hover': 'initial',
|
|
175
|
-
'--text-color-pressed': 'initial',
|
|
176
|
-
'--text-color-focus': 'initial',
|
|
177
|
-
'--text-color-disabled': 'initial'
|
|
174
|
+
'--n-color': 'initial',
|
|
175
|
+
'--n-color-hover': 'initial',
|
|
176
|
+
'--n-color-pressed': 'initial',
|
|
177
|
+
'--n-color-focus': 'initial',
|
|
178
|
+
'--n-color-disabled': 'initial',
|
|
179
|
+
'--n-ripple-color': 'initial',
|
|
180
|
+
'--n-text-color': 'initial',
|
|
181
|
+
'--n-text-color-hover': 'initial',
|
|
182
|
+
'--n-text-color-pressed': 'initial',
|
|
183
|
+
'--n-text-color-focus': 'initial',
|
|
184
|
+
'--n-text-color-disabled': 'initial'
|
|
178
185
|
};
|
|
179
186
|
const typeIsTertiary = type === 'tertiary';
|
|
180
187
|
const typeIsDefault = type === 'default';
|
|
@@ -183,46 +190,46 @@ const Button = defineComponent({
|
|
|
183
190
|
const propTextColor = textColor || color;
|
|
184
191
|
const mergedTextColor = propTextColor || self[createKey('textColorText', mergedType)];
|
|
185
192
|
colorProps = {
|
|
186
|
-
'--color': '#0000',
|
|
187
|
-
'--color-hover': '#0000',
|
|
188
|
-
'--color-pressed': '#0000',
|
|
189
|
-
'--color-focus': '#0000',
|
|
190
|
-
'--color-disabled': '#0000',
|
|
191
|
-
'--ripple-color': '#0000',
|
|
192
|
-
'--text-color': mergedTextColor,
|
|
193
|
-
'--text-color-hover': propTextColor
|
|
193
|
+
'--n-color': '#0000',
|
|
194
|
+
'--n-color-hover': '#0000',
|
|
195
|
+
'--n-color-pressed': '#0000',
|
|
196
|
+
'--n-color-focus': '#0000',
|
|
197
|
+
'--n-color-disabled': '#0000',
|
|
198
|
+
'--n-ripple-color': '#0000',
|
|
199
|
+
'--n-text-color': mergedTextColor,
|
|
200
|
+
'--n-text-color-hover': propTextColor
|
|
194
201
|
? createHoverColor(propTextColor)
|
|
195
202
|
: self[createKey('textColorTextHover', mergedType)],
|
|
196
|
-
'--text-color-pressed': propTextColor
|
|
203
|
+
'--n-text-color-pressed': propTextColor
|
|
197
204
|
? createPressedColor(propTextColor)
|
|
198
205
|
: self[createKey('textColorTextPressed', mergedType)],
|
|
199
|
-
'--text-color-focus': propTextColor
|
|
206
|
+
'--n-text-color-focus': propTextColor
|
|
200
207
|
? createHoverColor(propTextColor)
|
|
201
208
|
: self[createKey('textColorTextHover', mergedType)],
|
|
202
|
-
'--text-color-disabled': propTextColor ||
|
|
209
|
+
'--n-text-color-disabled': propTextColor ||
|
|
203
210
|
self[createKey('textColorTextDisabled', mergedType)]
|
|
204
211
|
};
|
|
205
212
|
}
|
|
206
213
|
else if (ghost || dashed) {
|
|
207
214
|
const mergedTextColor = textColor || color;
|
|
208
215
|
colorProps = {
|
|
209
|
-
'--color': '#0000',
|
|
210
|
-
'--color-hover': '#0000',
|
|
211
|
-
'--color-pressed': '#0000',
|
|
212
|
-
'--color-focus': '#0000',
|
|
213
|
-
'--color-disabled': '#0000',
|
|
214
|
-
'--ripple-color': color || self[createKey('rippleColor', mergedType)],
|
|
215
|
-
'--text-color': mergedTextColor || self[createKey('textColorGhost', mergedType)],
|
|
216
|
-
'--text-color-hover': mergedTextColor
|
|
216
|
+
'--n-color': '#0000',
|
|
217
|
+
'--n-color-hover': '#0000',
|
|
218
|
+
'--n-color-pressed': '#0000',
|
|
219
|
+
'--n-color-focus': '#0000',
|
|
220
|
+
'--n-color-disabled': '#0000',
|
|
221
|
+
'--n-ripple-color': color || self[createKey('rippleColor', mergedType)],
|
|
222
|
+
'--n-text-color': mergedTextColor || self[createKey('textColorGhost', mergedType)],
|
|
223
|
+
'--n-text-color-hover': mergedTextColor
|
|
217
224
|
? createHoverColor(mergedTextColor)
|
|
218
225
|
: self[createKey('textColorGhostHover', mergedType)],
|
|
219
|
-
'--text-color-pressed': mergedTextColor
|
|
226
|
+
'--n-text-color-pressed': mergedTextColor
|
|
220
227
|
? createPressedColor(mergedTextColor)
|
|
221
228
|
: self[createKey('textColorGhostPressed', mergedType)],
|
|
222
|
-
'--text-color-focus': mergedTextColor
|
|
229
|
+
'--n-text-color-focus': mergedTextColor
|
|
223
230
|
? createHoverColor(mergedTextColor)
|
|
224
231
|
: self[createKey('textColorGhostHover', mergedType)],
|
|
225
|
-
'--text-color-disabled': mergedTextColor ||
|
|
232
|
+
'--n-text-color-disabled': mergedTextColor ||
|
|
226
233
|
self[createKey('textColorGhostDisabled', mergedType)]
|
|
227
234
|
};
|
|
228
235
|
}
|
|
@@ -235,33 +242,33 @@ const Button = defineComponent({
|
|
|
235
242
|
const mergedTextColor = color || typeTextColor;
|
|
236
243
|
const isColoredType = type !== 'default' && type !== 'tertiary';
|
|
237
244
|
colorProps = {
|
|
238
|
-
'--color': isColoredType
|
|
245
|
+
'--n-color': isColoredType
|
|
239
246
|
? changeColor(mergedTextColor, {
|
|
240
247
|
alpha: Number(self.colorOpacitySecondary)
|
|
241
248
|
})
|
|
242
249
|
: self.colorSecondary,
|
|
243
|
-
'--color-hover': isColoredType
|
|
250
|
+
'--n-color-hover': isColoredType
|
|
244
251
|
? changeColor(mergedTextColor, {
|
|
245
252
|
alpha: Number(self.colorOpacitySecondaryHover)
|
|
246
253
|
})
|
|
247
254
|
: self.colorSecondaryHover,
|
|
248
|
-
'--color-pressed': isColoredType
|
|
255
|
+
'--n-color-pressed': isColoredType
|
|
249
256
|
? changeColor(mergedTextColor, {
|
|
250
257
|
alpha: Number(self.colorOpacitySecondaryPressed)
|
|
251
258
|
})
|
|
252
259
|
: self.colorSecondaryPressed,
|
|
253
|
-
'--color-focus': isColoredType
|
|
260
|
+
'--n-color-focus': isColoredType
|
|
254
261
|
? changeColor(mergedTextColor, {
|
|
255
262
|
alpha: Number(self.colorOpacitySecondaryHover)
|
|
256
263
|
})
|
|
257
264
|
: self.colorSecondaryHover,
|
|
258
|
-
'--color-disabled': self.colorSecondary,
|
|
259
|
-
'--ripple-color': '#0000',
|
|
260
|
-
'--text-color': mergedTextColor,
|
|
261
|
-
'--text-color-hover': mergedTextColor,
|
|
262
|
-
'--text-color-pressed': mergedTextColor,
|
|
263
|
-
'--text-color-focus': mergedTextColor,
|
|
264
|
-
'--text-color-disabled': mergedTextColor
|
|
265
|
+
'--n-color-disabled': self.colorSecondary,
|
|
266
|
+
'--n-ripple-color': '#0000',
|
|
267
|
+
'--n-text-color': mergedTextColor,
|
|
268
|
+
'--n-text-color-hover': mergedTextColor,
|
|
269
|
+
'--n-text-color-pressed': mergedTextColor,
|
|
270
|
+
'--n-text-color-focus': mergedTextColor,
|
|
271
|
+
'--n-text-color-disabled': mergedTextColor
|
|
265
272
|
};
|
|
266
273
|
}
|
|
267
274
|
else if (tertiary || quaternary) {
|
|
@@ -272,59 +279,59 @@ const Button = defineComponent({
|
|
|
272
279
|
: self[createKey('color', mergedType)];
|
|
273
280
|
const mergedColor = color || typeColor;
|
|
274
281
|
if (tertiary) {
|
|
275
|
-
colorProps['--color'] = self.colorTertiary;
|
|
276
|
-
colorProps['--color-hover'] = self.colorTertiaryHover;
|
|
277
|
-
colorProps['--color-pressed'] = self.colorTertiaryPressed;
|
|
278
|
-
colorProps['--color-focus'] = self.colorSecondaryHover;
|
|
279
|
-
colorProps['--color-disabled'] = self.colorTertiary;
|
|
282
|
+
colorProps['--n-color'] = self.colorTertiary;
|
|
283
|
+
colorProps['--n-color-hover'] = self.colorTertiaryHover;
|
|
284
|
+
colorProps['--n-color-pressed'] = self.colorTertiaryPressed;
|
|
285
|
+
colorProps['--n-color-focus'] = self.colorSecondaryHover;
|
|
286
|
+
colorProps['--n-color-disabled'] = self.colorTertiary;
|
|
280
287
|
}
|
|
281
288
|
else {
|
|
282
|
-
colorProps['--color'] = self.colorQuaternary;
|
|
283
|
-
colorProps['--color-hover'] = self.colorQuaternaryHover;
|
|
284
|
-
colorProps['--color-pressed'] = self.colorQuaternaryPressed;
|
|
285
|
-
colorProps['--color-focus'] = self.colorQuaternaryHover;
|
|
286
|
-
colorProps['--color-disabled'] = self.colorQuaternary;
|
|
289
|
+
colorProps['--n-color'] = self.colorQuaternary;
|
|
290
|
+
colorProps['--n-color-hover'] = self.colorQuaternaryHover;
|
|
291
|
+
colorProps['--n-color-pressed'] = self.colorQuaternaryPressed;
|
|
292
|
+
colorProps['--n-color-focus'] = self.colorQuaternaryHover;
|
|
293
|
+
colorProps['--n-color-disabled'] = self.colorQuaternary;
|
|
287
294
|
}
|
|
288
|
-
colorProps['--ripple-color'] = '#0000';
|
|
289
|
-
colorProps['--text-color'] = mergedColor;
|
|
290
|
-
colorProps['--text-color-hover'] = mergedColor;
|
|
291
|
-
colorProps['--text-color-pressed'] = mergedColor;
|
|
292
|
-
colorProps['--text-color-focus'] = mergedColor;
|
|
293
|
-
colorProps['--text-color-disabled'] = mergedColor;
|
|
295
|
+
colorProps['--n-ripple-color'] = '#0000';
|
|
296
|
+
colorProps['--n-text-color'] = mergedColor;
|
|
297
|
+
colorProps['--n-text-color-hover'] = mergedColor;
|
|
298
|
+
colorProps['--n-text-color-pressed'] = mergedColor;
|
|
299
|
+
colorProps['--n-text-color-focus'] = mergedColor;
|
|
300
|
+
colorProps['--n-text-color-disabled'] = mergedColor;
|
|
294
301
|
}
|
|
295
302
|
else {
|
|
296
303
|
colorProps = {
|
|
297
|
-
'--color': color || self[createKey('color', mergedType)],
|
|
298
|
-
'--color-hover': color
|
|
304
|
+
'--n-color': color || self[createKey('color', mergedType)],
|
|
305
|
+
'--n-color-hover': color
|
|
299
306
|
? createHoverColor(color)
|
|
300
307
|
: self[createKey('colorHover', mergedType)],
|
|
301
|
-
'--color-pressed': color
|
|
308
|
+
'--n-color-pressed': color
|
|
302
309
|
? createPressedColor(color)
|
|
303
310
|
: self[createKey('colorPressed', mergedType)],
|
|
304
|
-
'--color-focus': color
|
|
311
|
+
'--n-color-focus': color
|
|
305
312
|
? createHoverColor(color)
|
|
306
313
|
: self[createKey('colorFocus', mergedType)],
|
|
307
|
-
'--color-disabled': color || self[createKey('colorDisabled', mergedType)],
|
|
308
|
-
'--ripple-color': color || self[createKey('rippleColor', mergedType)],
|
|
309
|
-
'--text-color': textColor ||
|
|
314
|
+
'--n-color-disabled': color || self[createKey('colorDisabled', mergedType)],
|
|
315
|
+
'--n-ripple-color': color || self[createKey('rippleColor', mergedType)],
|
|
316
|
+
'--n-text-color': textColor ||
|
|
310
317
|
(color
|
|
311
318
|
? self.textColorPrimary
|
|
312
319
|
: typeIsTertiary
|
|
313
320
|
? self.textColorTertiary
|
|
314
321
|
: self[createKey('textColor', mergedType)]),
|
|
315
|
-
'--text-color-hover': textColor ||
|
|
322
|
+
'--n-text-color-hover': textColor ||
|
|
316
323
|
(color
|
|
317
324
|
? self.textColorHoverPrimary
|
|
318
325
|
: self[createKey('textColorHover', mergedType)]),
|
|
319
|
-
'--text-color-pressed': textColor ||
|
|
326
|
+
'--n-text-color-pressed': textColor ||
|
|
320
327
|
(color
|
|
321
328
|
? self.textColorPressedPrimary
|
|
322
329
|
: self[createKey('textColorPressed', mergedType)]),
|
|
323
|
-
'--text-color-focus': textColor ||
|
|
330
|
+
'--n-text-color-focus': textColor ||
|
|
324
331
|
(color
|
|
325
332
|
? self.textColorFocusPrimary
|
|
326
333
|
: self[createKey('textColorFocus', mergedType)]),
|
|
327
|
-
'--text-color-disabled': textColor ||
|
|
334
|
+
'--n-text-color-disabled': textColor ||
|
|
328
335
|
(color
|
|
329
336
|
? self.textColorDisabledPrimary
|
|
330
337
|
: self[createKey('textColorDisabled', mergedType)])
|
|
@@ -332,58 +339,58 @@ const Button = defineComponent({
|
|
|
332
339
|
}
|
|
333
340
|
// border
|
|
334
341
|
let borderProps = {
|
|
335
|
-
'--border': 'initial',
|
|
336
|
-
'--border-hover': 'initial',
|
|
337
|
-
'--border-pressed': 'initial',
|
|
338
|
-
'--border-focus': 'initial',
|
|
339
|
-
'--border-disabled': 'initial'
|
|
342
|
+
'--n-border': 'initial',
|
|
343
|
+
'--n-border-hover': 'initial',
|
|
344
|
+
'--n-border-pressed': 'initial',
|
|
345
|
+
'--n-border-focus': 'initial',
|
|
346
|
+
'--n-border-disabled': 'initial'
|
|
340
347
|
};
|
|
341
348
|
if (text) {
|
|
342
349
|
borderProps = {
|
|
343
|
-
'--border': 'none',
|
|
344
|
-
'--border-hover': 'none',
|
|
345
|
-
'--border-pressed': 'none',
|
|
346
|
-
'--border-focus': 'none',
|
|
347
|
-
'--border-disabled': 'none'
|
|
350
|
+
'--n-border': 'none',
|
|
351
|
+
'--n-border-hover': 'none',
|
|
352
|
+
'--n-border-pressed': 'none',
|
|
353
|
+
'--n-border-focus': 'none',
|
|
354
|
+
'--n-border-disabled': 'none'
|
|
348
355
|
};
|
|
349
356
|
}
|
|
350
357
|
else {
|
|
351
358
|
borderProps = {
|
|
352
|
-
'--border': self[createKey('border', mergedType)],
|
|
353
|
-
'--border-hover': self[createKey('borderHover', mergedType)],
|
|
354
|
-
'--border-pressed': self[createKey('borderPressed', mergedType)],
|
|
355
|
-
'--border-focus': self[createKey('borderFocus', mergedType)],
|
|
356
|
-
'--border-disabled': self[createKey('borderDisabled', mergedType)]
|
|
359
|
+
'--n-border': self[createKey('border', mergedType)],
|
|
360
|
+
'--n-border-hover': self[createKey('borderHover', mergedType)],
|
|
361
|
+
'--n-border-pressed': self[createKey('borderPressed', mergedType)],
|
|
362
|
+
'--n-border-focus': self[createKey('borderFocus', mergedType)],
|
|
363
|
+
'--n-border-disabled': self[createKey('borderDisabled', mergedType)]
|
|
357
364
|
};
|
|
358
365
|
}
|
|
359
366
|
// size
|
|
360
367
|
const { [createKey('height', size)]: height, [createKey('fontSize', size)]: fontSize, [createKey('padding', size)]: padding, [createKey('paddingRound', size)]: paddingRound, [createKey('iconSize', size)]: iconSize, [createKey('borderRadius', size)]: borderRadius, [createKey('iconMargin', size)]: iconMargin, waveOpacity } = self;
|
|
361
368
|
const sizeProps = {
|
|
362
|
-
'--width': circle && !text ? height : 'initial',
|
|
363
|
-
'--height': text ? 'initial' : height,
|
|
364
|
-
'--font-size': fontSize,
|
|
365
|
-
'--padding': circle
|
|
369
|
+
'--n-width': circle && !text ? height : 'initial',
|
|
370
|
+
'--n-height': text ? 'initial' : height,
|
|
371
|
+
'--n-font-size': fontSize,
|
|
372
|
+
'--n-padding': circle
|
|
366
373
|
? 'initial'
|
|
367
374
|
: text
|
|
368
375
|
? 'initial'
|
|
369
376
|
: round
|
|
370
377
|
? paddingRound
|
|
371
378
|
: padding,
|
|
372
|
-
'--icon-size': iconSize,
|
|
373
|
-
'--icon-margin': iconMargin,
|
|
374
|
-
'--border-radius': text
|
|
379
|
+
'--n-icon-size': iconSize,
|
|
380
|
+
'--n-icon-margin': iconMargin,
|
|
381
|
+
'--n-border-radius': text
|
|
375
382
|
? 'initial'
|
|
376
383
|
: circle || round
|
|
377
384
|
? height
|
|
378
385
|
: borderRadius
|
|
379
386
|
};
|
|
380
|
-
return Object.assign(Object.assign(Object.assign(Object.assign({ '--bezier': cubicBezierEaseInOut, '--bezier-ease-out': cubicBezierEaseOut, '--ripple-duration': rippleDuration, '--opacity-disabled': opacityDisabled, '--wave-opacity': waveOpacity }, fontProps), colorProps), borderProps), sizeProps);
|
|
387
|
+
return Object.assign(Object.assign(Object.assign(Object.assign({ '--n-bezier': cubicBezierEaseInOut, '--n-bezier-ease-out': cubicBezierEaseOut, '--n-ripple-duration': rippleDuration, '--n-opacity-disabled': opacityDisabled, '--n-wave-opacity': waveOpacity }, fontProps), colorProps), borderProps), sizeProps);
|
|
381
388
|
})
|
|
382
389
|
};
|
|
383
390
|
},
|
|
384
391
|
render() {
|
|
385
392
|
const { $slots, mergedClsPrefix, tag: Component } = this;
|
|
386
|
-
return (h(Component, { ref: "
|
|
393
|
+
return (h(Component, { ref: "selfElRef", class: [
|
|
387
394
|
`${mergedClsPrefix}-button`,
|
|
388
395
|
`${mergedClsPrefix}-button--${this.type}-type`,
|
|
389
396
|
`${mergedClsPrefix}-button--${this.mergedSize}-type`,
|
|
@@ -394,9 +401,10 @@ const Button = defineComponent({
|
|
|
394
401
|
!this.text && this.dashed && `${mergedClsPrefix}-button--dashed`,
|
|
395
402
|
this.color && `${mergedClsPrefix}-button--color`,
|
|
396
403
|
this.secondary && `${mergedClsPrefix}-button--secondary`,
|
|
404
|
+
this.loading && `${mergedClsPrefix}-button--loading`,
|
|
397
405
|
this.ghost && `${mergedClsPrefix}-button--ghost` // required for button group border collapse
|
|
398
406
|
], tabindex: this.mergedFocusable ? 0 : -1, type: this.attrType, style: this.cssVars, disabled: this.disabled, onClick: this.handleClick, onBlur: this.handleBlur, onMousedown: this.handleMousedown, onKeyup: this.handleKeyup, onKeydown: this.handleKeydown },
|
|
399
|
-
$slots.default && this.iconPlacement === 'right' ? (h("
|
|
407
|
+
$slots.default && this.iconPlacement === 'right' ? (h("span", { class: `${mergedClsPrefix}-button__content` }, $slots)) : null,
|
|
400
408
|
h(NFadeInExpandTransition, { width: true }, {
|
|
401
409
|
default: () => $slots.icon || this.loading ? (h("span", { class: `${mergedClsPrefix}-button__icon`, style: {
|
|
402
410
|
margin: !$slots.default ? 0 : ''
|
|
@@ -406,7 +414,7 @@ const Button = defineComponent({
|
|
|
406
414
|
}))) : null
|
|
407
415
|
}),
|
|
408
416
|
$slots.default && this.iconPlacement === 'left' ? (h("span", { class: `${mergedClsPrefix}-button__content` }, $slots)) : null,
|
|
409
|
-
!this.text ? (h(NBaseWave, { ref: "
|
|
417
|
+
!this.text ? (h(NBaseWave, { ref: "waveElRef", clsPrefix: mergedClsPrefix })) : null,
|
|
410
418
|
this.showBorder ? (h("div", { "aria-hidden": true, class: `${mergedClsPrefix}-button__border`, style: this.customColorCssVars })) : null,
|
|
411
419
|
this.showBorder ? (h("div", { "aria-hidden": true, class: `${mergedClsPrefix}-button__state-border`, style: this.customColorCssVars })) : null));
|
|
412
420
|
}
|