naive-ui 2.21.2 → 2.22.0
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 +15 -0
- package/es/_internal/scrollbar/src/ScrollBar.js +13 -7
- package/es/_internal/selection/src/Selection.js +11 -9
- package/es/_internal/selection/src/styles/index.cssr.js +6 -2
- 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/avatar/src/Avatar.d.ts +5 -3
- package/es/avatar/src/Avatar.js +7 -5
- package/es/avatar/src/styles/index.cssr.js +3 -5
- package/es/button/src/Button.d.ts +60 -60
- package/es/button/src/Button.js +107 -106
- package/es/button/src/styles/button.cssr.js +83 -80
- package/es/button/styles/dark.js +3 -3
- package/es/button/styles/light.d.ts +3 -3
- package/es/button/styles/light.js +1 -1
- package/es/calendar/src/Calendar.d.ts +37 -30
- package/es/calendar/styles/light.d.ts +3 -3
- 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/color-picker/src/ColorInputUnit.d.ts +3 -3
- package/es/color-picker/src/ColorPicker.d.ts +27 -27
- package/es/color-picker/styles/light.d.ts +3 -3
- package/es/config-provider/src/ConfigProvider.d.ts +21 -0
- package/es/data-table/src/DataTable.d.ts +30 -30
- package/es/data-table/src/DataTable.js +7 -14
- package/es/data-table/src/HeaderButton/FilterButton.d.ts +3 -3
- package/es/data-table/src/HeaderButton/FilterMenu.d.ts +3 -3
- package/es/data-table/src/MainTable.js +2 -3
- package/es/data-table/src/TableParts/Body.d.ts +18 -7
- package/es/data-table/src/TableParts/Body.js +80 -28
- package/es/data-table/src/TableParts/Cell.d.ts +6 -6
- package/es/data-table/src/TableParts/Header.d.ts +3 -3
- package/es/data-table/src/TableParts/Header.js +1 -1
- package/es/data-table/src/interface.d.ts +4 -1
- package/es/data-table/src/styles/index.cssr.js +9 -12
- 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 +4 -1
- package/es/data-table/styles/_common.js +1 -1
- package/es/data-table/styles/light.d.ts +3 -3
- package/es/date-picker/src/DatePicker.d.ts +94 -69
- package/es/date-picker/src/DatePicker.js +47 -20
- 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 +23 -10
- package/es/date-picker/src/panel/date.js +2 -2
- package/es/date-picker/src/panel/daterange.d.ts +21 -9
- package/es/date-picker/src/panel/daterange.js +2 -2
- package/es/date-picker/src/panel/datetime.d.ts +23 -16
- package/es/date-picker/src/panel/datetime.js +2 -2
- package/es/date-picker/src/panel/datetimerange.d.ts +21 -9
- package/es/date-picker/src/panel/datetimerange.js +2 -2
- package/es/date-picker/src/panel/month.d.ts +27 -20
- package/es/date-picker/src/panel/month.js +23 -12
- package/es/date-picker/src/panel/use-calendar.d.ts +25 -43
- package/es/date-picker/src/panel/use-calendar.js +35 -18
- package/es/date-picker/src/panel/use-dual-calendar.d.ts +21 -40
- package/es/date-picker/src/panel/use-dual-calendar.js +23 -8
- package/es/date-picker/src/panel/use-panel-common.d.ts +21 -36
- package/es/date-picker/src/panel/use-panel-common.js +2 -2
- 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 +10 -6
- package/es/dialog/src/Dialog.d.ts +21 -21
- package/es/dialog/src/styles/index.cssr.js +1 -0
- package/es/dialog/styles/light.d.ts +3 -3
- package/es/dynamic-input/src/DynamicInput.d.ts +30 -30
- package/es/dynamic-input/src/InputPreset.d.ts +3 -3
- package/es/dynamic-input/src/PairPreset.d.ts +3 -3
- package/es/dynamic-input/styles/light.d.ts +3 -3
- package/es/dynamic-tags/src/DynamicTags.d.ts +30 -30
- package/es/dynamic-tags/styles/light.d.ts +3 -3
- package/es/element/index.d.ts +1 -0
- package/es/element/index.js +1 -0
- package/es/form/src/interface.d.ts +5 -4
- package/es/image/src/Image.d.ts +25 -16
- package/es/image/src/Image.js +35 -11
- package/es/image/src/ImageGroup.js +2 -2
- package/es/image/src/styles/index.cssr.js +4 -3
- package/es/input/src/Input.js +2 -0
- package/es/input/src/styles/input.cssr.js +2 -1
- package/es/input-number/src/InputNumber.d.ts +30 -30
- package/es/input-number/src/InputNumber.js +10 -5
- package/es/input-number/src/utils.d.ts +1 -0
- package/es/input-number/src/utils.js +4 -0
- package/es/input-number/styles/light.d.ts +3 -3
- package/es/locales/common/deDE.js +8 -0
- package/es/locales/common/enUS.d.ts +7 -0
- package/es/locales/common/enUS.js +8 -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 -93
- package/es/locales/common/idID.js +8 -0
- package/es/locales/common/jaJP.js +8 -0
- package/es/locales/common/nbNO.js +8 -0
- package/es/locales/common/ruRU.js +8 -0
- package/es/locales/common/ukUA.js +8 -0
- package/es/locales/common/zhCN.js +7 -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/modal/src/BodyWrapper.d.ts +6 -6
- package/es/modal/src/Modal.d.ts +36 -36
- package/es/modal/styles/light.d.ts +3 -3
- package/es/page-header/src/PageHeader.js +3 -3
- package/es/page-header/src/styles/index.cssr.js +2 -4
- package/es/popconfirm/src/Popconfirm.d.ts +30 -30
- package/es/popconfirm/styles/light.d.ts +3 -3
- 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/switch/src/Switch.d.ts +16 -1
- package/es/switch/src/Switch.js +17 -4
- package/es/switch/src/styles/index.cssr.js +1 -1
- package/es/tabs/src/styles/index.cssr.js +1 -0
- package/es/tag/src/styles/index.cssr.js +1 -1
- package/es/theme-editor/src/ThemeEditor.js +9 -2
- package/es/time-picker/src/Panel.d.ts +3 -3
- package/es/time-picker/src/TimePicker.d.ts +30 -30
- package/es/time-picker/styles/light.d.ts +3 -3
- package/es/transfer/src/Transfer.d.ts +30 -30
- package/es/transfer/src/TransferFilter.d.ts +3 -3
- package/es/transfer/src/TransferList.d.ts +3 -3
- package/es/transfer/src/TransferListItem.d.ts +3 -3
- package/es/transfer/styles/light.d.ts +3 -3
- package/es/tree/src/Tree.d.ts +8 -4
- package/es/tree/src/Tree.js +32 -6
- package/es/tree-select/src/TreeSelect.d.ts +38 -1
- package/es/tree-select/src/TreeSelect.js +25 -10
- package/es/tree-select/src/styles/index.cssr.js +11 -2
- package/es/tree-select/styles/light.d.ts +6 -0
- package/es/tree-select/styles/light.js +5 -2
- package/es/upload/src/Upload.d.ts +41 -30
- package/es/upload/src/Upload.js +33 -23
- package/es/upload/src/UploadFile.d.ts +4 -4
- package/es/upload/src/UploadFileList.js +4 -2
- package/es/upload/src/UploadProgress.d.ts +3 -3
- package/es/upload/src/interface.d.ts +1 -0
- package/es/upload/src/styles/index.cssr.js +2 -3
- package/es/upload/styles/light.d.ts +3 -3
- 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 +15 -0
- package/lib/_internal/scrollbar/src/ScrollBar.js +13 -7
- package/lib/_internal/selection/src/Selection.js +11 -9
- package/lib/_internal/selection/src/styles/index.cssr.js +6 -2
- 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/avatar/src/Avatar.d.ts +5 -3
- package/lib/avatar/src/Avatar.js +7 -5
- package/lib/avatar/src/styles/index.cssr.js +3 -5
- package/lib/button/src/Button.d.ts +60 -60
- package/lib/button/src/Button.js +107 -106
- package/lib/button/src/styles/button.cssr.js +83 -80
- package/lib/button/styles/dark.js +3 -3
- package/lib/button/styles/light.d.ts +3 -3
- package/lib/button/styles/light.js +1 -1
- package/lib/calendar/src/Calendar.d.ts +37 -30
- package/lib/calendar/styles/light.d.ts +3 -3
- 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/color-picker/src/ColorInputUnit.d.ts +3 -3
- package/lib/color-picker/src/ColorPicker.d.ts +27 -27
- package/lib/color-picker/styles/light.d.ts +3 -3
- package/lib/config-provider/src/ConfigProvider.d.ts +21 -0
- package/lib/data-table/src/DataTable.d.ts +30 -30
- package/lib/data-table/src/DataTable.js +6 -13
- package/lib/data-table/src/HeaderButton/FilterButton.d.ts +3 -3
- package/lib/data-table/src/HeaderButton/FilterMenu.d.ts +3 -3
- package/lib/data-table/src/MainTable.js +1 -2
- package/lib/data-table/src/TableParts/Body.d.ts +18 -7
- package/lib/data-table/src/TableParts/Body.js +78 -26
- package/lib/data-table/src/TableParts/Cell.d.ts +6 -6
- package/lib/data-table/src/TableParts/Header.d.ts +3 -3
- package/lib/data-table/src/TableParts/Header.js +1 -1
- package/lib/data-table/src/interface.d.ts +4 -1
- package/lib/data-table/src/styles/index.cssr.js +9 -12
- 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 +4 -1
- package/lib/data-table/styles/_common.js +1 -1
- package/lib/data-table/styles/light.d.ts +3 -3
- package/lib/date-picker/src/DatePicker.d.ts +94 -69
- package/lib/date-picker/src/DatePicker.js +46 -19
- 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 +23 -10
- package/lib/date-picker/src/panel/date.js +1 -1
- package/lib/date-picker/src/panel/daterange.d.ts +21 -9
- package/lib/date-picker/src/panel/daterange.js +1 -1
- package/lib/date-picker/src/panel/datetime.d.ts +23 -16
- package/lib/date-picker/src/panel/datetime.js +1 -1
- package/lib/date-picker/src/panel/datetimerange.d.ts +21 -9
- package/lib/date-picker/src/panel/datetimerange.js +2 -2
- package/lib/date-picker/src/panel/month.d.ts +27 -20
- package/lib/date-picker/src/panel/month.js +23 -12
- package/lib/date-picker/src/panel/use-calendar.d.ts +25 -43
- package/lib/date-picker/src/panel/use-calendar.js +34 -16
- package/lib/date-picker/src/panel/use-dual-calendar.d.ts +21 -40
- package/lib/date-picker/src/panel/use-dual-calendar.js +22 -6
- package/lib/date-picker/src/panel/use-panel-common.d.ts +21 -36
- package/lib/date-picker/src/panel/use-panel-common.js +3 -2
- 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 +10 -6
- package/lib/dialog/src/Dialog.d.ts +21 -21
- package/lib/dialog/src/styles/index.cssr.js +1 -0
- package/lib/dialog/styles/light.d.ts +3 -3
- package/lib/dynamic-input/src/DynamicInput.d.ts +30 -30
- package/lib/dynamic-input/src/InputPreset.d.ts +3 -3
- package/lib/dynamic-input/src/PairPreset.d.ts +3 -3
- package/lib/dynamic-input/styles/light.d.ts +3 -3
- package/lib/dynamic-tags/src/DynamicTags.d.ts +30 -30
- package/lib/dynamic-tags/styles/light.d.ts +3 -3
- package/lib/element/index.d.ts +1 -0
- package/lib/element/index.js +3 -1
- package/lib/form/src/interface.d.ts +5 -4
- package/lib/image/src/Image.d.ts +25 -16
- package/lib/image/src/Image.js +34 -10
- package/lib/image/src/ImageGroup.js +2 -2
- package/lib/image/src/styles/index.cssr.js +3 -2
- package/lib/input/src/Input.js +2 -0
- package/lib/input/src/styles/input.cssr.js +2 -1
- package/lib/input-number/src/InputNumber.d.ts +30 -30
- package/lib/input-number/src/InputNumber.js +9 -4
- package/lib/input-number/src/utils.d.ts +1 -0
- package/lib/input-number/src/utils.js +6 -1
- package/lib/input-number/styles/light.d.ts +3 -3
- package/lib/locales/common/deDE.js +8 -0
- package/lib/locales/common/enUS.d.ts +7 -0
- package/lib/locales/common/enUS.js +8 -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 -93
- package/lib/locales/common/idID.js +8 -0
- package/lib/locales/common/jaJP.js +8 -0
- package/lib/locales/common/nbNO.js +8 -0
- package/lib/locales/common/ruRU.js +8 -0
- package/lib/locales/common/ukUA.js +8 -0
- package/lib/locales/common/zhCN.js +7 -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/modal/src/BodyWrapper.d.ts +6 -6
- package/lib/modal/src/Modal.d.ts +36 -36
- package/lib/modal/styles/light.d.ts +3 -3
- package/lib/page-header/src/PageHeader.js +3 -3
- package/lib/page-header/src/styles/index.cssr.js +2 -4
- package/lib/popconfirm/src/Popconfirm.d.ts +30 -30
- package/lib/popconfirm/styles/light.d.ts +3 -3
- 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/switch/src/Switch.d.ts +16 -1
- package/lib/switch/src/Switch.js +17 -4
- package/lib/switch/src/styles/index.cssr.js +1 -1
- package/lib/tabs/src/styles/index.cssr.js +1 -0
- package/lib/tag/src/styles/index.cssr.js +1 -1
- package/lib/theme-editor/src/ThemeEditor.js +9 -2
- package/lib/time-picker/src/Panel.d.ts +3 -3
- package/lib/time-picker/src/TimePicker.d.ts +30 -30
- package/lib/time-picker/styles/light.d.ts +3 -3
- package/lib/transfer/src/Transfer.d.ts +30 -30
- package/lib/transfer/src/TransferFilter.d.ts +3 -3
- package/lib/transfer/src/TransferList.d.ts +3 -3
- package/lib/transfer/src/TransferListItem.d.ts +3 -3
- package/lib/transfer/styles/light.d.ts +3 -3
- package/lib/tree/src/Tree.d.ts +8 -4
- package/lib/tree/src/Tree.js +32 -6
- package/lib/tree-select/src/TreeSelect.d.ts +38 -1
- package/lib/tree-select/src/TreeSelect.js +24 -9
- package/lib/tree-select/src/styles/index.cssr.js +11 -2
- package/lib/tree-select/styles/light.d.ts +6 -0
- package/lib/tree-select/styles/light.js +5 -2
- package/lib/upload/src/Upload.d.ts +41 -30
- package/lib/upload/src/Upload.js +33 -23
- package/lib/upload/src/UploadFile.d.ts +4 -4
- package/lib/upload/src/UploadFileList.js +4 -2
- package/lib/upload/src/UploadProgress.d.ts +3 -3
- package/lib/upload/src/interface.d.ts +1 -0
- package/lib/upload/src/styles/index.cssr.js +2 -3
- package/lib/upload/styles/light.d.ts +3 -3
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +5 -4
- package/web-types.json +99 -7
package/es/avatar/src/Avatar.js
CHANGED
|
@@ -8,10 +8,12 @@ import style from './styles/index.cssr';
|
|
|
8
8
|
const avatarProps = Object.assign(Object.assign({}, useTheme.props), { size: {
|
|
9
9
|
type: [String, Number],
|
|
10
10
|
default: 'medium'
|
|
11
|
-
}, src: String, circle: Boolean,
|
|
11
|
+
}, src: String, circle: Boolean, objectFit: {
|
|
12
12
|
type: String,
|
|
13
13
|
default: 'fill'
|
|
14
|
-
}, round: Boolean, onError: Function, fallbackSrc: String
|
|
14
|
+
}, round: Boolean, onError: Function, fallbackSrc: String,
|
|
15
|
+
/** @deprecated */
|
|
16
|
+
color: String });
|
|
15
17
|
export default defineComponent({
|
|
16
18
|
name: 'Avatar',
|
|
17
19
|
props: avatarProps,
|
|
@@ -62,7 +64,7 @@ export default defineComponent({
|
|
|
62
64
|
mergedClsPrefix: mergedClsPrefixRef,
|
|
63
65
|
fitTextTransform,
|
|
64
66
|
cssVars: computed(() => {
|
|
65
|
-
const { size } = props;
|
|
67
|
+
const { size, color: propColor } = props;
|
|
66
68
|
const { self: { borderRadius, fontSize, color }, common: { cubicBezierEaseInOut } } = themeRef.value;
|
|
67
69
|
let height;
|
|
68
70
|
if (typeof size === 'number') {
|
|
@@ -74,7 +76,7 @@ export default defineComponent({
|
|
|
74
76
|
return {
|
|
75
77
|
'--font-size': fontSize,
|
|
76
78
|
'--border-radius': mergedRoundRef.value ? '50%' : borderRadius,
|
|
77
|
-
'--color': color,
|
|
79
|
+
'--color': propColor || color,
|
|
78
80
|
'--bezier': cubicBezierEaseInOut,
|
|
79
81
|
'--merged-size': `var(--avatar-size-override, ${height})`
|
|
80
82
|
};
|
|
@@ -91,7 +93,7 @@ export default defineComponent({
|
|
|
91
93
|
}
|
|
92
94
|
else if (!(!$slots.default && src)) {
|
|
93
95
|
img = (h(VResizeObserver, { onResize: this.fitTextTransform }, {
|
|
94
|
-
default: () => (h("span", { ref: "textRef", class: `${mergedClsPrefix}-avatar__text
|
|
96
|
+
default: () => (h("span", { ref: "textRef", class: `${mergedClsPrefix}-avatar__text` }, $slots))
|
|
95
97
|
}));
|
|
96
98
|
}
|
|
97
99
|
else {
|
|
@@ -3,7 +3,7 @@ import { c, cE, cB } from '../../../_utils/cssr'; // vars:
|
|
|
3
3
|
// --border-radius
|
|
4
4
|
// --color
|
|
5
5
|
// --bezier
|
|
6
|
-
// --size
|
|
6
|
+
// --merged-size
|
|
7
7
|
|
|
8
8
|
export default cB('avatar', `
|
|
9
9
|
width: var(--merged-size);
|
|
@@ -30,7 +30,5 @@ export default cB('avatar', `
|
|
|
30
30
|
top: 50%;
|
|
31
31
|
`), cB('icon', `
|
|
32
32
|
vertical-align: bottom;
|
|
33
|
-
font-size: var(--size);
|
|
34
|
-
`), cE('text',
|
|
35
|
-
lineHeight: 1.25
|
|
36
|
-
})]);
|
|
33
|
+
font-size: calc(var(--merged-size) - 6px);
|
|
34
|
+
`), cE('text', 'line-height: 1.25')]);
|
|
@@ -60,9 +60,9 @@ declare const buttonProps: {
|
|
|
60
60
|
fontSizeMedium: string;
|
|
61
61
|
fontSizeLarge: string;
|
|
62
62
|
opacityDisabled: string;
|
|
63
|
-
colorOpacitySecondary:
|
|
64
|
-
colorOpacitySecondaryHover:
|
|
65
|
-
colorOpacitySecondaryPressed:
|
|
63
|
+
colorOpacitySecondary: string;
|
|
64
|
+
colorOpacitySecondaryHover: string;
|
|
65
|
+
colorOpacitySecondaryPressed: string;
|
|
66
66
|
colorSecondary: string;
|
|
67
67
|
colorSecondaryHover: string;
|
|
68
68
|
colorSecondaryPressed: string;
|
|
@@ -264,9 +264,9 @@ declare const buttonProps: {
|
|
|
264
264
|
fontSizeMedium: string;
|
|
265
265
|
fontSizeLarge: string;
|
|
266
266
|
opacityDisabled: string;
|
|
267
|
-
colorOpacitySecondary:
|
|
268
|
-
colorOpacitySecondaryHover:
|
|
269
|
-
colorOpacitySecondaryPressed:
|
|
267
|
+
colorOpacitySecondary: string;
|
|
268
|
+
colorOpacitySecondaryHover: string;
|
|
269
|
+
colorOpacitySecondaryPressed: string;
|
|
270
270
|
colorSecondary: string;
|
|
271
271
|
colorSecondaryHover: string;
|
|
272
272
|
colorSecondaryPressed: string;
|
|
@@ -468,9 +468,9 @@ declare const buttonProps: {
|
|
|
468
468
|
fontSizeMedium: string;
|
|
469
469
|
fontSizeLarge: string;
|
|
470
470
|
opacityDisabled: string;
|
|
471
|
-
colorOpacitySecondary:
|
|
472
|
-
colorOpacitySecondaryHover:
|
|
473
|
-
colorOpacitySecondaryPressed:
|
|
471
|
+
colorOpacitySecondary: string;
|
|
472
|
+
colorOpacitySecondaryHover: string;
|
|
473
|
+
colorOpacitySecondaryPressed: string;
|
|
474
474
|
colorSecondary: string;
|
|
475
475
|
colorSecondaryHover: string;
|
|
476
476
|
colorSecondaryPressed: string;
|
|
@@ -719,9 +719,9 @@ declare const Button: import("vue").DefineComponent<{
|
|
|
719
719
|
fontSizeMedium: string;
|
|
720
720
|
fontSizeLarge: string;
|
|
721
721
|
opacityDisabled: string;
|
|
722
|
-
colorOpacitySecondary:
|
|
723
|
-
colorOpacitySecondaryHover:
|
|
724
|
-
colorOpacitySecondaryPressed:
|
|
722
|
+
colorOpacitySecondary: string;
|
|
723
|
+
colorOpacitySecondaryHover: string;
|
|
724
|
+
colorOpacitySecondaryPressed: string;
|
|
725
725
|
colorSecondary: string;
|
|
726
726
|
colorSecondaryHover: string;
|
|
727
727
|
colorSecondaryPressed: string;
|
|
@@ -923,9 +923,9 @@ declare const Button: import("vue").DefineComponent<{
|
|
|
923
923
|
fontSizeMedium: string;
|
|
924
924
|
fontSizeLarge: string;
|
|
925
925
|
opacityDisabled: string;
|
|
926
|
-
colorOpacitySecondary:
|
|
927
|
-
colorOpacitySecondaryHover:
|
|
928
|
-
colorOpacitySecondaryPressed:
|
|
926
|
+
colorOpacitySecondary: string;
|
|
927
|
+
colorOpacitySecondaryHover: string;
|
|
928
|
+
colorOpacitySecondaryPressed: string;
|
|
929
929
|
colorSecondary: string;
|
|
930
930
|
colorSecondaryHover: string;
|
|
931
931
|
colorSecondaryPressed: string;
|
|
@@ -1127,9 +1127,9 @@ declare const Button: import("vue").DefineComponent<{
|
|
|
1127
1127
|
fontSizeMedium: string;
|
|
1128
1128
|
fontSizeLarge: string;
|
|
1129
1129
|
opacityDisabled: string;
|
|
1130
|
-
colorOpacitySecondary:
|
|
1131
|
-
colorOpacitySecondaryHover:
|
|
1132
|
-
colorOpacitySecondaryPressed:
|
|
1130
|
+
colorOpacitySecondary: string;
|
|
1131
|
+
colorOpacitySecondaryHover: string;
|
|
1132
|
+
colorOpacitySecondaryPressed: string;
|
|
1133
1133
|
colorSecondary: string;
|
|
1134
1134
|
colorSecondaryHover: string;
|
|
1135
1135
|
colorSecondaryPressed: string;
|
|
@@ -1334,42 +1334,42 @@ declare const Button: import("vue").DefineComponent<{
|
|
|
1334
1334
|
handleKeyup: (e: KeyboardEvent) => void;
|
|
1335
1335
|
handleClick: (e: MouseEvent) => void;
|
|
1336
1336
|
customColorCssVars: import("vue").ComputedRef<{
|
|
1337
|
-
'--border-color': string;
|
|
1338
|
-
'--border-color-hover': string;
|
|
1339
|
-
'--border-color-pressed': string;
|
|
1340
|
-
'--border-color-focus': string;
|
|
1341
|
-
'--border-color-disabled': string;
|
|
1337
|
+
'--n-border-color': string;
|
|
1338
|
+
'--n-border-color-hover': string;
|
|
1339
|
+
'--n-border-color-pressed': string;
|
|
1340
|
+
'--n-border-color-focus': string;
|
|
1341
|
+
'--n-border-color-disabled': string;
|
|
1342
1342
|
} | null>;
|
|
1343
1343
|
cssVars: import("vue").ComputedRef<{
|
|
1344
|
-
'--width': string;
|
|
1345
|
-
'--height': string;
|
|
1346
|
-
'--font-size': string;
|
|
1347
|
-
'--padding': string;
|
|
1348
|
-
'--icon-size': string;
|
|
1349
|
-
'--icon-margin': string;
|
|
1350
|
-
'--border-radius': string;
|
|
1351
|
-
'--border': string;
|
|
1352
|
-
'--border-hover': string;
|
|
1353
|
-
'--border-pressed': string;
|
|
1354
|
-
'--border-focus': string;
|
|
1355
|
-
'--border-disabled': string;
|
|
1356
|
-
'--color': string;
|
|
1357
|
-
'--color-hover': string;
|
|
1358
|
-
'--color-pressed': string;
|
|
1359
|
-
'--color-focus': string;
|
|
1360
|
-
'--color-disabled': string;
|
|
1361
|
-
'--ripple-color': string;
|
|
1362
|
-
'--text-color': string;
|
|
1363
|
-
'--text-color-hover': string;
|
|
1364
|
-
'--text-color-pressed': string;
|
|
1365
|
-
'--text-color-focus': string;
|
|
1366
|
-
'--text-color-disabled': string;
|
|
1344
|
+
'--n-width': string;
|
|
1345
|
+
'--n-height': string;
|
|
1346
|
+
'--n-font-size': string;
|
|
1347
|
+
'--n-padding': string;
|
|
1348
|
+
'--n-icon-size': string;
|
|
1349
|
+
'--n-icon-margin': string;
|
|
1350
|
+
'--n-border-radius': string;
|
|
1351
|
+
'--n-border': string;
|
|
1352
|
+
'--n-border-hover': string;
|
|
1353
|
+
'--n-border-pressed': string;
|
|
1354
|
+
'--n-border-focus': string;
|
|
1355
|
+
'--n-border-disabled': string;
|
|
1356
|
+
'--n-color': string;
|
|
1357
|
+
'--n-color-hover': string;
|
|
1358
|
+
'--n-color-pressed': string;
|
|
1359
|
+
'--n-color-focus': string;
|
|
1360
|
+
'--n-color-disabled': string;
|
|
1361
|
+
'--n-ripple-color': string;
|
|
1362
|
+
'--n-text-color': string;
|
|
1363
|
+
'--n-text-color-hover': string;
|
|
1364
|
+
'--n-text-color-pressed': string;
|
|
1365
|
+
'--n-text-color-focus': string;
|
|
1366
|
+
'--n-text-color-disabled': string;
|
|
1367
1367
|
fontWeight: string;
|
|
1368
|
-
'--bezier': string;
|
|
1369
|
-
'--bezier-ease-out': string;
|
|
1370
|
-
'--ripple-duration': string;
|
|
1371
|
-
'--opacity-disabled': string;
|
|
1372
|
-
'--wave-opacity': string;
|
|
1368
|
+
'--n-bezier': string;
|
|
1369
|
+
'--n-bezier-ease-out': string;
|
|
1370
|
+
'--n-ripple-duration': string;
|
|
1371
|
+
'--n-opacity-disabled': string;
|
|
1372
|
+
'--n-wave-opacity': string;
|
|
1373
1373
|
}>;
|
|
1374
1374
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<{
|
|
1375
1375
|
readonly color?: unknown;
|
|
@@ -1436,9 +1436,9 @@ declare const Button: import("vue").DefineComponent<{
|
|
|
1436
1436
|
fontSizeMedium: string;
|
|
1437
1437
|
fontSizeLarge: string;
|
|
1438
1438
|
opacityDisabled: string;
|
|
1439
|
-
colorOpacitySecondary:
|
|
1440
|
-
colorOpacitySecondaryHover:
|
|
1441
|
-
colorOpacitySecondaryPressed:
|
|
1439
|
+
colorOpacitySecondary: string;
|
|
1440
|
+
colorOpacitySecondaryHover: string;
|
|
1441
|
+
colorOpacitySecondaryPressed: string;
|
|
1442
1442
|
colorSecondary: string;
|
|
1443
1443
|
colorSecondaryHover: string;
|
|
1444
1444
|
colorSecondaryPressed: string;
|
|
@@ -1640,9 +1640,9 @@ declare const Button: import("vue").DefineComponent<{
|
|
|
1640
1640
|
fontSizeMedium: string;
|
|
1641
1641
|
fontSizeLarge: string;
|
|
1642
1642
|
opacityDisabled: string;
|
|
1643
|
-
colorOpacitySecondary:
|
|
1644
|
-
colorOpacitySecondaryHover:
|
|
1645
|
-
colorOpacitySecondaryPressed:
|
|
1643
|
+
colorOpacitySecondary: string;
|
|
1644
|
+
colorOpacitySecondaryHover: string;
|
|
1645
|
+
colorOpacitySecondaryPressed: string;
|
|
1646
1646
|
colorSecondary: string;
|
|
1647
1647
|
colorSecondaryHover: string;
|
|
1648
1648
|
colorSecondaryPressed: string;
|
|
@@ -1844,9 +1844,9 @@ declare const Button: import("vue").DefineComponent<{
|
|
|
1844
1844
|
fontSizeMedium: string;
|
|
1845
1845
|
fontSizeLarge: string;
|
|
1846
1846
|
opacityDisabled: string;
|
|
1847
|
-
colorOpacitySecondary:
|
|
1848
|
-
colorOpacitySecondaryHover:
|
|
1849
|
-
colorOpacitySecondaryPressed:
|
|
1847
|
+
colorOpacitySecondary: string;
|
|
1848
|
+
colorOpacitySecondaryHover: string;
|
|
1849
|
+
colorOpacitySecondaryPressed: string;
|
|
1850
1850
|
colorSecondary: string;
|
|
1851
1851
|
colorSecondaryHover: string;
|
|
1852
1852
|
colorSecondaryPressed: string;
|
package/es/button/src/Button.js
CHANGED
|
@@ -86,7 +86,7 @@ const Button = defineComponent({
|
|
|
86
86
|
}
|
|
87
87
|
};
|
|
88
88
|
const handleClick = (e) => {
|
|
89
|
-
if (!props.disabled) {
|
|
89
|
+
if (!props.disabled && !props.loading) {
|
|
90
90
|
const { onClick } = props;
|
|
91
91
|
if (onClick)
|
|
92
92
|
call(onClick, e);
|
|
@@ -112,7 +112,7 @@ const Button = defineComponent({
|
|
|
112
112
|
switch (e.code) {
|
|
113
113
|
case 'Enter':
|
|
114
114
|
case 'NumpadEnter':
|
|
115
|
-
if (!props.keyboard) {
|
|
115
|
+
if (!props.keyboard || props.loading) {
|
|
116
116
|
e.preventDefault();
|
|
117
117
|
return;
|
|
118
118
|
}
|
|
@@ -145,11 +145,11 @@ const Button = defineComponent({
|
|
|
145
145
|
return null;
|
|
146
146
|
const hoverColor = createHoverColor(color);
|
|
147
147
|
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
|
|
148
|
+
'--n-border-color': color,
|
|
149
|
+
'--n-border-color-hover': hoverColor,
|
|
150
|
+
'--n-border-color-pressed': createPressedColor(color),
|
|
151
|
+
'--n-border-color-focus': hoverColor,
|
|
152
|
+
'--n-border-color-disabled': color
|
|
153
153
|
};
|
|
154
154
|
}),
|
|
155
155
|
cssVars: computed(() => {
|
|
@@ -164,17 +164,17 @@ const Button = defineComponent({
|
|
|
164
164
|
};
|
|
165
165
|
// color
|
|
166
166
|
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'
|
|
167
|
+
'--n-color': 'initial',
|
|
168
|
+
'--n-color-hover': 'initial',
|
|
169
|
+
'--n-color-pressed': 'initial',
|
|
170
|
+
'--n-color-focus': 'initial',
|
|
171
|
+
'--n-color-disabled': 'initial',
|
|
172
|
+
'--n-ripple-color': 'initial',
|
|
173
|
+
'--n-text-color': 'initial',
|
|
174
|
+
'--n-text-color-hover': 'initial',
|
|
175
|
+
'--n-text-color-pressed': 'initial',
|
|
176
|
+
'--n-text-color-focus': 'initial',
|
|
177
|
+
'--n-text-color-disabled': 'initial'
|
|
178
178
|
};
|
|
179
179
|
const typeIsTertiary = type === 'tertiary';
|
|
180
180
|
const typeIsDefault = type === 'default';
|
|
@@ -183,46 +183,46 @@ const Button = defineComponent({
|
|
|
183
183
|
const propTextColor = textColor || color;
|
|
184
184
|
const mergedTextColor = propTextColor || self[createKey('textColorText', mergedType)];
|
|
185
185
|
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
|
|
186
|
+
'--n-color': '#0000',
|
|
187
|
+
'--n-color-hover': '#0000',
|
|
188
|
+
'--n-color-pressed': '#0000',
|
|
189
|
+
'--n-color-focus': '#0000',
|
|
190
|
+
'--n-color-disabled': '#0000',
|
|
191
|
+
'--n-ripple-color': '#0000',
|
|
192
|
+
'--n-text-color': mergedTextColor,
|
|
193
|
+
'--n-text-color-hover': propTextColor
|
|
194
194
|
? createHoverColor(propTextColor)
|
|
195
195
|
: self[createKey('textColorTextHover', mergedType)],
|
|
196
|
-
'--text-color-pressed': propTextColor
|
|
196
|
+
'--n-text-color-pressed': propTextColor
|
|
197
197
|
? createPressedColor(propTextColor)
|
|
198
198
|
: self[createKey('textColorTextPressed', mergedType)],
|
|
199
|
-
'--text-color-focus': propTextColor
|
|
199
|
+
'--n-text-color-focus': propTextColor
|
|
200
200
|
? createHoverColor(propTextColor)
|
|
201
201
|
: self[createKey('textColorTextHover', mergedType)],
|
|
202
|
-
'--text-color-disabled': propTextColor ||
|
|
202
|
+
'--n-text-color-disabled': propTextColor ||
|
|
203
203
|
self[createKey('textColorTextDisabled', mergedType)]
|
|
204
204
|
};
|
|
205
205
|
}
|
|
206
206
|
else if (ghost || dashed) {
|
|
207
207
|
const mergedTextColor = textColor || color;
|
|
208
208
|
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
|
|
209
|
+
'--n-color': '#0000',
|
|
210
|
+
'--n-color-hover': '#0000',
|
|
211
|
+
'--n-color-pressed': '#0000',
|
|
212
|
+
'--n-color-focus': '#0000',
|
|
213
|
+
'--n-color-disabled': '#0000',
|
|
214
|
+
'--n-ripple-color': color || self[createKey('rippleColor', mergedType)],
|
|
215
|
+
'--n-text-color': mergedTextColor || self[createKey('textColorGhost', mergedType)],
|
|
216
|
+
'--n-text-color-hover': mergedTextColor
|
|
217
217
|
? createHoverColor(mergedTextColor)
|
|
218
218
|
: self[createKey('textColorGhostHover', mergedType)],
|
|
219
|
-
'--text-color-pressed': mergedTextColor
|
|
219
|
+
'--n-text-color-pressed': mergedTextColor
|
|
220
220
|
? createPressedColor(mergedTextColor)
|
|
221
221
|
: self[createKey('textColorGhostPressed', mergedType)],
|
|
222
|
-
'--text-color-focus': mergedTextColor
|
|
222
|
+
'--n-text-color-focus': mergedTextColor
|
|
223
223
|
? createHoverColor(mergedTextColor)
|
|
224
224
|
: self[createKey('textColorGhostHover', mergedType)],
|
|
225
|
-
'--text-color-disabled': mergedTextColor ||
|
|
225
|
+
'--n-text-color-disabled': mergedTextColor ||
|
|
226
226
|
self[createKey('textColorGhostDisabled', mergedType)]
|
|
227
227
|
};
|
|
228
228
|
}
|
|
@@ -235,33 +235,33 @@ const Button = defineComponent({
|
|
|
235
235
|
const mergedTextColor = color || typeTextColor;
|
|
236
236
|
const isColoredType = type !== 'default' && type !== 'tertiary';
|
|
237
237
|
colorProps = {
|
|
238
|
-
'--color': isColoredType
|
|
238
|
+
'--n-color': isColoredType
|
|
239
239
|
? changeColor(mergedTextColor, {
|
|
240
|
-
alpha: self.colorOpacitySecondary
|
|
240
|
+
alpha: Number(self.colorOpacitySecondary)
|
|
241
241
|
})
|
|
242
242
|
: self.colorSecondary,
|
|
243
|
-
'--color-hover': isColoredType
|
|
243
|
+
'--n-color-hover': isColoredType
|
|
244
244
|
? changeColor(mergedTextColor, {
|
|
245
|
-
alpha: self.colorOpacitySecondaryHover
|
|
245
|
+
alpha: Number(self.colorOpacitySecondaryHover)
|
|
246
246
|
})
|
|
247
247
|
: self.colorSecondaryHover,
|
|
248
|
-
'--color-pressed': isColoredType
|
|
248
|
+
'--n-color-pressed': isColoredType
|
|
249
249
|
? changeColor(mergedTextColor, {
|
|
250
|
-
alpha: self.colorOpacitySecondaryPressed
|
|
250
|
+
alpha: Number(self.colorOpacitySecondaryPressed)
|
|
251
251
|
})
|
|
252
252
|
: self.colorSecondaryPressed,
|
|
253
|
-
'--color-focus': isColoredType
|
|
253
|
+
'--n-color-focus': isColoredType
|
|
254
254
|
? changeColor(mergedTextColor, {
|
|
255
|
-
alpha: self.colorOpacitySecondaryHover
|
|
255
|
+
alpha: Number(self.colorOpacitySecondaryHover)
|
|
256
256
|
})
|
|
257
257
|
: 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
|
|
258
|
+
'--n-color-disabled': self.colorSecondary,
|
|
259
|
+
'--n-ripple-color': '#0000',
|
|
260
|
+
'--n-text-color': mergedTextColor,
|
|
261
|
+
'--n-text-color-hover': mergedTextColor,
|
|
262
|
+
'--n-text-color-pressed': mergedTextColor,
|
|
263
|
+
'--n-text-color-focus': mergedTextColor,
|
|
264
|
+
'--n-text-color-disabled': mergedTextColor
|
|
265
265
|
};
|
|
266
266
|
}
|
|
267
267
|
else if (tertiary || quaternary) {
|
|
@@ -272,59 +272,59 @@ const Button = defineComponent({
|
|
|
272
272
|
: self[createKey('color', mergedType)];
|
|
273
273
|
const mergedColor = color || typeColor;
|
|
274
274
|
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;
|
|
275
|
+
colorProps['--n-color'] = self.colorTertiary;
|
|
276
|
+
colorProps['--n-color-hover'] = self.colorTertiaryHover;
|
|
277
|
+
colorProps['--n-color-pressed'] = self.colorTertiaryPressed;
|
|
278
|
+
colorProps['--n-color-focus'] = self.colorSecondaryHover;
|
|
279
|
+
colorProps['--n-color-disabled'] = self.colorTertiary;
|
|
280
280
|
}
|
|
281
281
|
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;
|
|
282
|
+
colorProps['--n-color'] = self.colorQuaternary;
|
|
283
|
+
colorProps['--n-color-hover'] = self.colorQuaternaryHover;
|
|
284
|
+
colorProps['--n-color-pressed'] = self.colorQuaternaryPressed;
|
|
285
|
+
colorProps['--n-color-focus'] = self.colorQuaternaryHover;
|
|
286
|
+
colorProps['--n-color-disabled'] = self.colorQuaternary;
|
|
287
287
|
}
|
|
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;
|
|
288
|
+
colorProps['--n-ripple-color'] = '#0000';
|
|
289
|
+
colorProps['--n-text-color'] = mergedColor;
|
|
290
|
+
colorProps['--n-text-color-hover'] = mergedColor;
|
|
291
|
+
colorProps['--n-text-color-pressed'] = mergedColor;
|
|
292
|
+
colorProps['--n-text-color-focus'] = mergedColor;
|
|
293
|
+
colorProps['--n-text-color-disabled'] = mergedColor;
|
|
294
294
|
}
|
|
295
295
|
else {
|
|
296
296
|
colorProps = {
|
|
297
|
-
'--color': color || self[createKey('color', mergedType)],
|
|
298
|
-
'--color-hover': color
|
|
297
|
+
'--n-color': color || self[createKey('color', mergedType)],
|
|
298
|
+
'--n-color-hover': color
|
|
299
299
|
? createHoverColor(color)
|
|
300
300
|
: self[createKey('colorHover', mergedType)],
|
|
301
|
-
'--color-pressed': color
|
|
301
|
+
'--n-color-pressed': color
|
|
302
302
|
? createPressedColor(color)
|
|
303
303
|
: self[createKey('colorPressed', mergedType)],
|
|
304
|
-
'--color-focus': color
|
|
304
|
+
'--n-color-focus': color
|
|
305
305
|
? createHoverColor(color)
|
|
306
306
|
: self[createKey('colorFocus', mergedType)],
|
|
307
|
-
'--color-disabled': color || self[createKey('colorDisabled', mergedType)],
|
|
308
|
-
'--ripple-color': color || self[createKey('rippleColor', mergedType)],
|
|
309
|
-
'--text-color': textColor ||
|
|
307
|
+
'--n-color-disabled': color || self[createKey('colorDisabled', mergedType)],
|
|
308
|
+
'--n-ripple-color': color || self[createKey('rippleColor', mergedType)],
|
|
309
|
+
'--n-text-color': textColor ||
|
|
310
310
|
(color
|
|
311
311
|
? self.textColorPrimary
|
|
312
312
|
: typeIsTertiary
|
|
313
313
|
? self.textColorTertiary
|
|
314
314
|
: self[createKey('textColor', mergedType)]),
|
|
315
|
-
'--text-color-hover': textColor ||
|
|
315
|
+
'--n-text-color-hover': textColor ||
|
|
316
316
|
(color
|
|
317
317
|
? self.textColorHoverPrimary
|
|
318
318
|
: self[createKey('textColorHover', mergedType)]),
|
|
319
|
-
'--text-color-pressed': textColor ||
|
|
319
|
+
'--n-text-color-pressed': textColor ||
|
|
320
320
|
(color
|
|
321
321
|
? self.textColorPressedPrimary
|
|
322
322
|
: self[createKey('textColorPressed', mergedType)]),
|
|
323
|
-
'--text-color-focus': textColor ||
|
|
323
|
+
'--n-text-color-focus': textColor ||
|
|
324
324
|
(color
|
|
325
325
|
? self.textColorFocusPrimary
|
|
326
326
|
: self[createKey('textColorFocus', mergedType)]),
|
|
327
|
-
'--text-color-disabled': textColor ||
|
|
327
|
+
'--n-text-color-disabled': textColor ||
|
|
328
328
|
(color
|
|
329
329
|
? self.textColorDisabledPrimary
|
|
330
330
|
: self[createKey('textColorDisabled', mergedType)])
|
|
@@ -332,52 +332,52 @@ const Button = defineComponent({
|
|
|
332
332
|
}
|
|
333
333
|
// border
|
|
334
334
|
let borderProps = {
|
|
335
|
-
'--border': 'initial',
|
|
336
|
-
'--border-hover': 'initial',
|
|
337
|
-
'--border-pressed': 'initial',
|
|
338
|
-
'--border-focus': 'initial',
|
|
339
|
-
'--border-disabled': 'initial'
|
|
335
|
+
'--n-border': 'initial',
|
|
336
|
+
'--n-border-hover': 'initial',
|
|
337
|
+
'--n-border-pressed': 'initial',
|
|
338
|
+
'--n-border-focus': 'initial',
|
|
339
|
+
'--n-border-disabled': 'initial'
|
|
340
340
|
};
|
|
341
341
|
if (text) {
|
|
342
342
|
borderProps = {
|
|
343
|
-
'--border': 'none',
|
|
344
|
-
'--border-hover': 'none',
|
|
345
|
-
'--border-pressed': 'none',
|
|
346
|
-
'--border-focus': 'none',
|
|
347
|
-
'--border-disabled': 'none'
|
|
343
|
+
'--n-border': 'none',
|
|
344
|
+
'--n-border-hover': 'none',
|
|
345
|
+
'--n-border-pressed': 'none',
|
|
346
|
+
'--n-border-focus': 'none',
|
|
347
|
+
'--n-border-disabled': 'none'
|
|
348
348
|
};
|
|
349
349
|
}
|
|
350
350
|
else {
|
|
351
351
|
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)]
|
|
352
|
+
'--n-border': self[createKey('border', mergedType)],
|
|
353
|
+
'--n-border-hover': self[createKey('borderHover', mergedType)],
|
|
354
|
+
'--n-border-pressed': self[createKey('borderPressed', mergedType)],
|
|
355
|
+
'--n-border-focus': self[createKey('borderFocus', mergedType)],
|
|
356
|
+
'--n-border-disabled': self[createKey('borderDisabled', mergedType)]
|
|
357
357
|
};
|
|
358
358
|
}
|
|
359
359
|
// size
|
|
360
360
|
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
361
|
const sizeProps = {
|
|
362
|
-
'--width': circle && !text ? height : 'initial',
|
|
363
|
-
'--height': text ? 'initial' : height,
|
|
364
|
-
'--font-size': fontSize,
|
|
365
|
-
'--padding': circle
|
|
362
|
+
'--n-width': circle && !text ? height : 'initial',
|
|
363
|
+
'--n-height': text ? 'initial' : height,
|
|
364
|
+
'--n-font-size': fontSize,
|
|
365
|
+
'--n-padding': circle
|
|
366
366
|
? 'initial'
|
|
367
367
|
: text
|
|
368
368
|
? 'initial'
|
|
369
369
|
: round
|
|
370
370
|
? paddingRound
|
|
371
371
|
: padding,
|
|
372
|
-
'--icon-size': iconSize,
|
|
373
|
-
'--icon-margin': iconMargin,
|
|
374
|
-
'--border-radius': text
|
|
372
|
+
'--n-icon-size': iconSize,
|
|
373
|
+
'--n-icon-margin': iconMargin,
|
|
374
|
+
'--n-border-radius': text
|
|
375
375
|
? 'initial'
|
|
376
376
|
: circle || round
|
|
377
377
|
? height
|
|
378
378
|
: borderRadius
|
|
379
379
|
};
|
|
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);
|
|
380
|
+
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
381
|
})
|
|
382
382
|
};
|
|
383
383
|
},
|
|
@@ -394,9 +394,10 @@ const Button = defineComponent({
|
|
|
394
394
|
!this.text && this.dashed && `${mergedClsPrefix}-button--dashed`,
|
|
395
395
|
this.color && `${mergedClsPrefix}-button--color`,
|
|
396
396
|
this.secondary && `${mergedClsPrefix}-button--secondary`,
|
|
397
|
+
this.loading && `${mergedClsPrefix}-button--loading`,
|
|
397
398
|
this.ghost && `${mergedClsPrefix}-button--ghost` // required for button group border collapse
|
|
398
399
|
], 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("
|
|
400
|
+
$slots.default && this.iconPlacement === 'right' ? (h("span", { class: `${mergedClsPrefix}-button__content` }, $slots)) : null,
|
|
400
401
|
h(NFadeInExpandTransition, { width: true }, {
|
|
401
402
|
default: () => $slots.icon || this.loading ? (h("span", { class: `${mergedClsPrefix}-button__icon`, style: {
|
|
402
403
|
margin: !$slots.default ? 0 : ''
|