naive-ui 2.25.3 → 2.25.6
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/scrollbar/src/ScrollBar.d.ts +1 -0
- package/es/_internal/select-menu/src/SelectMenu.d.ts +1 -0
- package/es/_mixins/use-css-vars-class.js +2 -1
- package/es/button/src/styles/button-rtl.cssr.js +2 -2
- package/es/cascader/src/Cascader.d.ts +10 -0
- package/es/cascader/src/CascaderMenu.d.ts +1 -0
- package/es/cascader/src/CascaderOption.d.ts +1 -0
- package/es/cascader/src/CascaderSelectMenu.d.ts +1 -0
- package/es/cascader/src/CascaderSubmenu.d.ts +2 -0
- package/es/cascader/styles/light.d.ts +1 -0
- package/es/checkbox/src/Checkbox.d.ts +12 -0
- package/es/checkbox/src/Checkbox.js +14 -7
- package/es/checkbox/src/styles/index.cssr.js +16 -8
- package/es/checkbox/src/styles/rtl.cssr.d.ts +2 -0
- package/es/checkbox/src/styles/rtl.cssr.js +4 -0
- package/es/checkbox/styles/index.d.ts +1 -0
- package/es/checkbox/styles/index.js +1 -0
- package/es/checkbox/styles/light.d.ts +1 -0
- package/es/checkbox/styles/light.js +2 -2
- package/es/checkbox/styles/rtl.d.ts +2 -0
- package/es/checkbox/styles/rtl.js +5 -0
- package/es/code/src/Code.js +3 -1
- package/es/collapse/src/Collapse.d.ts +1 -0
- package/es/collapse/src/Collapse.js +9 -2
- package/es/collapse/src/CollapseItem.d.ts +1 -0
- package/es/collapse/src/CollapseItem.js +8 -3
- package/es/collapse/src/styles/rtl.cssr.d.ts +2 -0
- package/es/collapse/src/styles/rtl.cssr.js +15 -0
- package/es/collapse/styles/index.d.ts +1 -0
- package/es/collapse/styles/index.js +1 -0
- package/es/collapse/styles/rtl.d.ts +2 -0
- package/es/collapse/styles/rtl.js +5 -0
- package/es/collapse-transition/src/CollapseTransition.d.ts +3 -1
- package/es/collapse-transition/src/CollapseTransition.js +27 -14
- package/es/config-provider/src/ConfigProvider.js +6 -0
- package/es/config-provider/src/internal-interface.d.ts +1 -0
- package/es/data-table/src/DataTable.d.ts +20 -0
- package/es/data-table/src/HeaderButton/FilterButton.d.ts +2 -0
- package/es/data-table/src/HeaderButton/FilterMenu.d.ts +2 -0
- package/es/data-table/src/TableParts/Body.d.ts +3 -0
- package/es/data-table/src/TableParts/Cell.d.ts +4 -0
- package/es/data-table/src/TableParts/Header.d.ts +2 -0
- package/es/data-table/styles/light.d.ts +2 -0
- package/es/date-picker/src/DatePicker.d.ts +7 -2
- package/es/date-picker/src/DatePicker.js +80 -68
- package/es/date-picker/src/panel/date.d.ts +6 -0
- package/es/date-picker/src/panel/date.js +7 -2
- package/es/date-picker/src/panel/daterange.d.ts +4 -0
- package/es/date-picker/src/panel/daterange.js +7 -2
- package/es/date-picker/src/panel/datetime.d.ts +6 -0
- package/es/date-picker/src/panel/datetime.js +7 -2
- package/es/date-picker/src/panel/datetimerange.d.ts +4 -0
- package/es/date-picker/src/panel/datetimerange.js +7 -2
- package/es/date-picker/src/panel/month.d.ts +6 -0
- package/es/date-picker/src/panel/month.js +4 -2
- package/es/date-picker/src/panel/panelHeader.d.ts +10 -0
- package/es/date-picker/src/panel/use-calendar.d.ts +4 -0
- package/es/date-picker/src/panel/use-dual-calendar.d.ts +2 -0
- package/es/date-picker/src/panel/use-panel-common.d.ts +2 -0
- package/es/date-picker/src/panel/use-panel-common.js +3 -1
- package/es/drawer/src/Drawer.d.ts +3 -1
- package/es/drawer/src/Drawer.js +39 -27
- package/es/dropdown/src/Dropdown.d.ts +7 -5
- package/es/dropdown/src/Dropdown.js +59 -52
- package/es/dynamic-input/src/DynamicInput.d.ts +3 -1
- package/es/dynamic-input/src/DynamicInput.js +17 -10
- package/es/form/src/FormItem.d.ts +3 -1
- package/es/form/src/FormItem.js +40 -33
- package/es/form/src/FormItemRow.js +1 -1
- package/es/gradient-text/src/GradientText.d.ts +3 -1
- package/es/gradient-text/src/GradientText.js +23 -15
- package/es/icon/src/Icon.d.ts +3 -5
- package/es/icon/src/Icon.js +29 -19
- package/es/image/src/ImagePreview.d.ts +3 -1
- package/es/image/src/ImagePreview.js +28 -15
- package/es/input/src/Input.d.ts +4 -1
- package/es/input/src/Input.js +27 -6
- package/es/input/src/InputGroupLabel.d.ts +3 -1
- package/es/input/src/InputGroupLabel.js +26 -19
- package/es/input/src/styles/input.cssr.js +1 -0
- package/es/input/src/styles/rtl.cssr.d.ts +2 -0
- package/es/input/src/styles/rtl.cssr.js +16 -0
- package/es/input/styles/index.d.ts +1 -0
- package/es/input/styles/index.js +1 -0
- package/es/input/styles/rtl.d.ts +2 -0
- package/es/input/styles/rtl.js +5 -0
- package/es/input-number/src/InputNumber.d.ts +1 -0
- package/es/input-number/src/InputNumber.js +8 -3
- package/es/input-number/src/styles/rtl.cssr.d.ts +2 -0
- package/es/input-number/src/styles/rtl.cssr.js +4 -0
- package/es/input-number/styles/index.d.ts +1 -0
- package/es/input-number/styles/index.js +1 -0
- package/es/input-number/styles/rtl.d.ts +2 -0
- package/es/input-number/styles/rtl.js +8 -0
- package/es/layout/src/Layout.d.ts +2 -0
- package/es/layout/src/LayoutContent.d.ts +1 -0
- package/es/layout/src/LayoutSider.d.ts +1 -0
- package/es/legacy-grid/src/styles/index.cssr.js +1 -1
- package/es/list/src/List.d.ts +3 -1
- package/es/list/src/List.js +27 -19
- package/es/loading-bar/src/LoadingBar.d.ts +3 -1
- package/es/loading-bar/src/LoadingBar.js +29 -15
- package/es/log/src/Log.d.ts +1 -0
- package/es/mention/src/Mention.d.ts +3 -1
- package/es/mention/src/Mention.js +20 -10
- package/es/message/src/Message.d.ts +12 -24
- package/es/message/src/Message.js +57 -40
- package/es/message/src/MessageEnvironment.d.ts +9 -0
- package/es/message/src/MessageEnvironment.js +1 -1
- package/es/message/src/MessageProvider.d.ts +67 -0
- package/es/message/src/MessageProvider.js +3 -0
- package/es/message/src/message-props.d.ts +4 -0
- package/es/message/src/message-props.js +4 -0
- package/es/message/src/styles/index.cssr.js +2 -1
- package/es/message/src/types.d.ts +3 -1
- package/es/message/styles/light.d.ts +7 -0
- package/es/message/styles/light.js +1 -1
- package/es/modal/src/BodyWrapper.d.ts +1 -0
- package/es/notification/src/Notification.d.ts +3 -1
- package/es/notification/src/Notification.js +44 -32
- package/es/notification/src/NotificationProvider.d.ts +1 -0
- package/es/notification/src/NotificationProvider.js +1 -0
- package/es/popconfirm/src/Popconfirm.d.ts +3 -2
- package/es/popconfirm/src/Popconfirm.js +2 -1
- package/es/popconfirm/src/PopconfirmPanel.d.ts +3 -1
- package/es/popconfirm/src/PopconfirmPanel.js +32 -25
- package/es/popconfirm/src/interface.d.ts +2 -0
- package/es/popover/src/PopoverBody.d.ts +4 -0
- package/es/popover/src/PopoverBody.js +3 -2
- package/es/popover/src/styles/index.cssr.js +49 -29
- package/es/radio/src/Radio.d.ts +7 -0
- package/es/radio/src/Radio.js +14 -7
- package/es/radio/src/RadioGroup.d.ts +9 -0
- package/es/radio/src/styles/radio.cssr.js +16 -9
- package/es/radio/styles/dark.js +2 -2
- package/es/radio/styles/light.d.ts +1 -0
- package/es/radio/styles/light.js +2 -2
- package/es/scrollbar/src/ScrollBar.d.ts +1 -0
- package/es/select/src/Select.d.ts +3 -1
- package/es/select/src/Select.js +31 -23
- package/es/slider/src/Slider.d.ts +6 -2
- package/es/slider/src/Slider.js +74 -51
- package/es/steps/src/Step.d.ts +3 -1
- package/es/steps/src/Step.js +32 -20
- package/es/styles.d.ts +4 -4
- package/es/styles.js +4 -4
- package/es/tabs/src/styles/index.cssr.js +2 -0
- package/es/time-picker/src/Panel.js +4 -4
- package/es/time-picker/src/TimePicker.d.ts +12 -4
- package/es/time-picker/src/TimePicker.js +90 -35
- package/es/timeline/src/Timeline.d.ts +9 -9
- package/es/timeline/src/TimelineItem.d.ts +4 -2
- package/es/timeline/src/TimelineItem.js +34 -20
- package/es/timeline/styles/_common.d.ts +1 -1
- package/es/timeline/styles/_common.js +1 -1
- package/es/timeline/styles/light.d.ts +1 -1
- package/es/transfer/src/Transfer.d.ts +10 -0
- package/es/transfer/src/TransferFilter.d.ts +1 -0
- package/es/transfer/src/TransferList.d.ts +2 -0
- package/es/transfer/src/TransferListItem.d.ts +1 -0
- package/es/transfer/styles/light.d.ts +1 -0
- package/es/tree/src/Tree.d.ts +16 -3
- package/es/tree/src/Tree.js +50 -28
- package/es/tree/src/TreeNodeCheckbox.d.ts +1 -0
- package/es/tree/styles/light.d.ts +1 -0
- package/es/tree-select/src/TreeSelect.d.ts +23 -10
- package/es/tree-select/src/TreeSelect.js +26 -17
- package/es/tree-select/styles/light.d.ts +1 -0
- package/es/upload/src/Upload.d.ts +3 -1
- package/es/upload/src/Upload.js +23 -13
- package/es/upload/src/UploadFileList.js +8 -3
- package/es/upload/src/interface.d.ts +3 -1
- package/es/version.d.ts +1 -1
- package/es/version.js +1 -1
- package/lib/_internal/scrollbar/src/ScrollBar.d.ts +1 -0
- package/lib/_internal/select-menu/src/SelectMenu.d.ts +1 -0
- package/lib/_mixins/use-css-vars-class.js +2 -1
- package/lib/button/src/styles/button-rtl.cssr.js +2 -2
- package/lib/cascader/src/Cascader.d.ts +10 -0
- package/lib/cascader/src/CascaderMenu.d.ts +1 -0
- package/lib/cascader/src/CascaderOption.d.ts +1 -0
- package/lib/cascader/src/CascaderSelectMenu.d.ts +1 -0
- package/lib/cascader/src/CascaderSubmenu.d.ts +2 -0
- package/lib/cascader/styles/light.d.ts +1 -0
- package/lib/checkbox/src/Checkbox.d.ts +12 -0
- package/lib/checkbox/src/Checkbox.js +14 -7
- package/lib/checkbox/src/styles/index.cssr.js +16 -8
- package/lib/checkbox/src/styles/rtl.cssr.d.ts +2 -0
- package/lib/checkbox/src/styles/rtl.cssr.js +11 -0
- package/lib/checkbox/styles/index.d.ts +1 -0
- package/lib/checkbox/styles/index.js +3 -1
- package/lib/checkbox/styles/light.d.ts +1 -0
- package/lib/checkbox/styles/light.js +2 -2
- package/lib/checkbox/styles/rtl.d.ts +2 -0
- package/lib/checkbox/styles/rtl.js +11 -0
- package/lib/code/src/Code.js +3 -1
- package/lib/collapse/src/Collapse.d.ts +1 -0
- package/lib/collapse/src/Collapse.js +9 -2
- package/lib/collapse/src/CollapseItem.d.ts +1 -0
- package/lib/collapse/src/CollapseItem.js +7 -2
- package/lib/collapse/src/styles/rtl.cssr.d.ts +2 -0
- package/lib/collapse/src/styles/rtl.cssr.js +22 -0
- package/lib/collapse/styles/index.d.ts +1 -0
- package/lib/collapse/styles/index.js +3 -1
- package/lib/collapse/styles/rtl.d.ts +2 -0
- package/lib/collapse/styles/rtl.js +11 -0
- package/lib/collapse-transition/src/CollapseTransition.d.ts +3 -1
- package/lib/collapse-transition/src/CollapseTransition.js +26 -13
- package/lib/config-provider/src/ConfigProvider.js +6 -0
- package/lib/config-provider/src/internal-interface.d.ts +1 -0
- package/lib/data-table/src/DataTable.d.ts +20 -0
- package/lib/data-table/src/HeaderButton/FilterButton.d.ts +2 -0
- package/lib/data-table/src/HeaderButton/FilterMenu.d.ts +2 -0
- package/lib/data-table/src/TableParts/Body.d.ts +3 -0
- package/lib/data-table/src/TableParts/Cell.d.ts +4 -0
- package/lib/data-table/src/TableParts/Header.d.ts +2 -0
- package/lib/data-table/styles/light.d.ts +2 -0
- package/lib/date-picker/src/DatePicker.d.ts +7 -2
- package/lib/date-picker/src/DatePicker.js +79 -67
- package/lib/date-picker/src/panel/date.d.ts +6 -0
- package/lib/date-picker/src/panel/date.js +7 -2
- package/lib/date-picker/src/panel/daterange.d.ts +4 -0
- package/lib/date-picker/src/panel/daterange.js +7 -2
- package/lib/date-picker/src/panel/datetime.d.ts +6 -0
- package/lib/date-picker/src/panel/datetime.js +7 -2
- package/lib/date-picker/src/panel/datetimerange.d.ts +4 -0
- package/lib/date-picker/src/panel/datetimerange.js +7 -2
- package/lib/date-picker/src/panel/month.d.ts +6 -0
- package/lib/date-picker/src/panel/month.js +4 -2
- package/lib/date-picker/src/panel/panelHeader.d.ts +10 -0
- package/lib/date-picker/src/panel/use-calendar.d.ts +4 -0
- package/lib/date-picker/src/panel/use-dual-calendar.d.ts +2 -0
- package/lib/date-picker/src/panel/use-panel-common.d.ts +2 -0
- package/lib/date-picker/src/panel/use-panel-common.js +3 -1
- package/lib/drawer/src/Drawer.d.ts +4 -1
- package/lib/drawer/src/Drawer.js +38 -26
- package/lib/dropdown/src/Dropdown.d.ts +7 -5
- package/lib/dropdown/src/Dropdown.js +58 -51
- package/lib/dynamic-input/src/DynamicInput.d.ts +3 -1
- package/lib/dynamic-input/src/DynamicInput.js +16 -9
- package/lib/form/src/FormItem.d.ts +3 -1
- package/lib/form/src/FormItem.js +39 -32
- package/lib/form/src/FormItemRow.js +1 -1
- package/lib/gradient-text/src/GradientText.d.ts +3 -1
- package/lib/gradient-text/src/GradientText.js +22 -14
- package/lib/icon/src/Icon.d.ts +3 -5
- package/lib/icon/src/Icon.js +28 -18
- package/lib/image/src/ImagePreview.d.ts +3 -1
- package/lib/image/src/ImagePreview.js +27 -14
- package/lib/input/src/Input.d.ts +4 -1
- package/lib/input/src/Input.js +27 -6
- package/lib/input/src/InputGroupLabel.d.ts +3 -1
- package/lib/input/src/InputGroupLabel.js +25 -18
- package/lib/input/src/styles/input.cssr.js +1 -0
- package/lib/input/src/styles/rtl.cssr.d.ts +2 -0
- package/lib/input/src/styles/rtl.cssr.js +23 -0
- package/lib/input/styles/index.d.ts +1 -0
- package/lib/input/styles/index.js +3 -1
- package/lib/input/styles/rtl.d.ts +2 -0
- package/lib/input/styles/rtl.js +11 -0
- package/lib/input-number/src/InputNumber.d.ts +1 -0
- package/lib/input-number/src/InputNumber.js +8 -3
- package/lib/input-number/src/styles/rtl.cssr.d.ts +2 -0
- package/lib/input-number/src/styles/rtl.cssr.js +11 -0
- package/lib/input-number/styles/index.d.ts +1 -0
- package/lib/input-number/styles/index.js +3 -1
- package/lib/input-number/styles/rtl.d.ts +2 -0
- package/lib/input-number/styles/rtl.js +14 -0
- package/lib/layout/src/Layout.d.ts +2 -0
- package/lib/layout/src/LayoutContent.d.ts +1 -0
- package/lib/layout/src/LayoutSider.d.ts +1 -0
- package/lib/legacy-grid/src/styles/index.cssr.js +1 -1
- package/lib/list/src/List.d.ts +3 -1
- package/lib/list/src/List.js +26 -18
- package/lib/loading-bar/src/LoadingBar.d.ts +3 -1
- package/lib/loading-bar/src/LoadingBar.js +28 -14
- package/lib/log/src/Log.d.ts +1 -0
- package/lib/mention/src/Mention.d.ts +3 -1
- package/lib/mention/src/Mention.js +19 -9
- package/lib/message/src/Message.d.ts +12 -24
- package/lib/message/src/Message.js +56 -39
- package/lib/message/src/MessageEnvironment.d.ts +9 -0
- package/lib/message/src/MessageEnvironment.js +1 -1
- package/lib/message/src/MessageProvider.d.ts +67 -0
- package/lib/message/src/MessageProvider.js +3 -0
- package/lib/message/src/message-props.d.ts +4 -0
- package/lib/message/src/message-props.js +4 -0
- package/lib/message/src/styles/index.cssr.js +2 -1
- package/lib/message/src/types.d.ts +3 -1
- package/lib/message/styles/light.d.ts +7 -0
- package/lib/message/styles/light.js +1 -1
- package/lib/modal/src/BodyWrapper.d.ts +1 -0
- package/lib/notification/src/Notification.d.ts +3 -1
- package/lib/notification/src/Notification.js +44 -32
- package/lib/notification/src/NotificationProvider.d.ts +1 -0
- package/lib/notification/src/NotificationProvider.js +1 -0
- package/lib/popconfirm/src/Popconfirm.d.ts +3 -2
- package/lib/popconfirm/src/Popconfirm.js +2 -1
- package/lib/popconfirm/src/PopconfirmPanel.d.ts +3 -1
- package/lib/popconfirm/src/PopconfirmPanel.js +30 -23
- package/lib/popconfirm/src/interface.d.ts +2 -0
- package/lib/popover/src/PopoverBody.d.ts +4 -0
- package/lib/popover/src/PopoverBody.js +3 -2
- package/lib/popover/src/styles/index.cssr.js +50 -29
- package/lib/radio/src/Radio.d.ts +7 -0
- package/lib/radio/src/Radio.js +13 -6
- package/lib/radio/src/RadioGroup.d.ts +9 -0
- package/lib/radio/src/styles/radio.cssr.js +16 -9
- package/lib/radio/styles/dark.js +2 -2
- package/lib/radio/styles/light.d.ts +1 -0
- package/lib/radio/styles/light.js +2 -2
- package/lib/scrollbar/src/ScrollBar.d.ts +1 -0
- package/lib/select/src/Select.d.ts +3 -1
- package/lib/select/src/Select.js +30 -22
- package/lib/slider/src/Slider.d.ts +6 -2
- package/lib/slider/src/Slider.js +73 -50
- package/lib/steps/src/Step.d.ts +3 -1
- package/lib/steps/src/Step.js +32 -20
- package/lib/styles.d.ts +4 -4
- package/lib/styles.js +6 -2
- package/lib/tabs/src/styles/index.cssr.js +2 -0
- package/lib/time-picker/src/Panel.js +4 -4
- package/lib/time-picker/src/TimePicker.d.ts +12 -4
- package/lib/time-picker/src/TimePicker.js +89 -34
- package/lib/timeline/src/Timeline.d.ts +9 -9
- package/lib/timeline/src/TimelineItem.d.ts +4 -2
- package/lib/timeline/src/TimelineItem.js +34 -20
- package/lib/timeline/styles/_common.d.ts +1 -1
- package/lib/timeline/styles/_common.js +1 -1
- package/lib/timeline/styles/light.d.ts +1 -1
- package/lib/transfer/src/Transfer.d.ts +10 -0
- package/lib/transfer/src/TransferFilter.d.ts +1 -0
- package/lib/transfer/src/TransferList.d.ts +2 -0
- package/lib/transfer/src/TransferListItem.d.ts +1 -0
- package/lib/transfer/styles/light.d.ts +1 -0
- package/lib/tree/src/Tree.d.ts +16 -3
- package/lib/tree/src/Tree.js +49 -27
- package/lib/tree/src/TreeNodeCheckbox.d.ts +1 -0
- package/lib/tree/styles/light.d.ts +1 -0
- package/lib/tree-select/src/TreeSelect.d.ts +23 -10
- package/lib/tree-select/src/TreeSelect.js +25 -16
- package/lib/tree-select/styles/light.d.ts +1 -0
- package/lib/upload/src/Upload.d.ts +3 -1
- package/lib/upload/src/Upload.js +22 -12
- package/lib/upload/src/UploadFileList.js +8 -3
- package/lib/upload/src/interface.d.ts +3 -1
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +2 -2
- package/web-types.json +1 -1
|
@@ -2,7 +2,7 @@ import { computed, h, defineComponent, inject } from 'vue';
|
|
|
2
2
|
import { InfoIcon, SuccessIcon, WarningIcon, ErrorIcon } from '../../_internal/icons';
|
|
3
3
|
import { NIconSwitchTransition, NBaseLoading, NBaseIcon, NBaseClose } from '../../_internal';
|
|
4
4
|
import { render, createKey } from '../../_utils';
|
|
5
|
-
import { useTheme } from '../../_mixins';
|
|
5
|
+
import { useConfig, useTheme, useThemeClass } from '../../_mixins';
|
|
6
6
|
import { messageLight } from '../styles';
|
|
7
7
|
import { messageProps } from './message-props';
|
|
8
8
|
import { messageProviderInjectionKey } from './context';
|
|
@@ -11,16 +11,49 @@ const iconMap = {
|
|
|
11
11
|
info: h(InfoIcon, null),
|
|
12
12
|
success: h(SuccessIcon, null),
|
|
13
13
|
warning: h(WarningIcon, null),
|
|
14
|
-
error: h(ErrorIcon, null)
|
|
14
|
+
error: h(ErrorIcon, null),
|
|
15
|
+
default: null
|
|
15
16
|
};
|
|
16
17
|
export default defineComponent({
|
|
17
18
|
name: 'Message',
|
|
18
19
|
props: Object.assign(Object.assign({}, messageProps), { render: Function }),
|
|
19
20
|
setup(props) {
|
|
21
|
+
const { inlineThemeDisabled } = useConfig();
|
|
20
22
|
const { props: messageProviderProps, mergedClsPrefixRef
|
|
21
23
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
22
24
|
} = inject(messageProviderInjectionKey);
|
|
23
25
|
const themeRef = useTheme('Message', '-message', style, messageLight, messageProviderProps, mergedClsPrefixRef);
|
|
26
|
+
const cssVarsRef = computed(() => {
|
|
27
|
+
const { type } = props;
|
|
28
|
+
const { common: { cubicBezierEaseInOut }, self: { padding, margin, maxWidth, iconMargin, closeMargin, closeSize, iconSize, fontSize, lineHeight, borderRadius, iconColorInfo, iconColorSuccess, iconColorWarning, iconColorError, iconColorLoading, [createKey('textColor', type)]: textColor, [createKey('boxShadow', type)]: boxShadow, [createKey('color', type)]: color, [createKey('closeColor', type)]: closeColor, [createKey('closeColorPressed', type)]: closeColorPressed, [createKey('closeColorHover', type)]: closeColorHover } } = themeRef.value;
|
|
29
|
+
return {
|
|
30
|
+
'--n-bezier': cubicBezierEaseInOut,
|
|
31
|
+
'--n-margin': margin,
|
|
32
|
+
'--n-padding': padding,
|
|
33
|
+
'--n-max-width': maxWidth,
|
|
34
|
+
'--n-font-size': fontSize,
|
|
35
|
+
'--n-icon-margin': iconMargin,
|
|
36
|
+
'--n-icon-size': iconSize,
|
|
37
|
+
'--n-close-size': closeSize,
|
|
38
|
+
'--n-close-margin': closeMargin,
|
|
39
|
+
'--n-text-color': textColor,
|
|
40
|
+
'--n-color': color,
|
|
41
|
+
'--n-box-shadow': boxShadow,
|
|
42
|
+
'--n-icon-color-info': iconColorInfo,
|
|
43
|
+
'--n-icon-color-success': iconColorSuccess,
|
|
44
|
+
'--n-icon-color-warning': iconColorWarning,
|
|
45
|
+
'--n-icon-color-error': iconColorError,
|
|
46
|
+
'--n-icon-color-loading': iconColorLoading,
|
|
47
|
+
'--n-close-color': closeColor,
|
|
48
|
+
'--n-close-color-pressed': closeColorPressed,
|
|
49
|
+
'--n-close-color-hover': closeColorHover,
|
|
50
|
+
'--n-line-height': lineHeight,
|
|
51
|
+
'--n-border-radius': borderRadius
|
|
52
|
+
};
|
|
53
|
+
});
|
|
54
|
+
const themeClassHandle = inlineThemeDisabled
|
|
55
|
+
? useThemeClass('message', computed(() => props.type[0]), cssVarsRef, {})
|
|
56
|
+
: undefined;
|
|
24
57
|
return {
|
|
25
58
|
mergedClsPrefix: mergedClsPrefixRef,
|
|
26
59
|
messageProviderProps,
|
|
@@ -28,48 +61,29 @@ export default defineComponent({
|
|
|
28
61
|
var _a;
|
|
29
62
|
(_a = props.onClose) === null || _a === void 0 ? void 0 : _a.call(props);
|
|
30
63
|
},
|
|
31
|
-
cssVars:
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
return {
|
|
35
|
-
'--n-bezier': cubicBezierEaseInOut,
|
|
36
|
-
'--n-margin': margin,
|
|
37
|
-
'--n-padding': padding,
|
|
38
|
-
'--n-max-width': maxWidth,
|
|
39
|
-
'--n-font-size': fontSize,
|
|
40
|
-
'--n-icon-margin': iconMargin,
|
|
41
|
-
'--n-icon-size': iconSize,
|
|
42
|
-
'--n-close-size': closeSize,
|
|
43
|
-
'--n-close-margin': closeMargin,
|
|
44
|
-
'--n-text-color': textColor,
|
|
45
|
-
'--n-color': color,
|
|
46
|
-
'--n-box-shadow': boxShadow,
|
|
47
|
-
'--n-icon-color-info': iconColorInfo,
|
|
48
|
-
'--n-icon-color-success': iconColorSuccess,
|
|
49
|
-
'--n-icon-color-warning': iconColorWarning,
|
|
50
|
-
'--n-icon-color-error': iconColorError,
|
|
51
|
-
'--n-icon-color-loading': iconColorLoading,
|
|
52
|
-
'--n-close-color': closeColor,
|
|
53
|
-
'--n-close-color-pressed': closeColorPressed,
|
|
54
|
-
'--n-close-color-hover': closeColorHover,
|
|
55
|
-
'--n-line-height': lineHeight,
|
|
56
|
-
'--n-border-radius': borderRadius
|
|
57
|
-
};
|
|
58
|
-
}),
|
|
64
|
+
cssVars: inlineThemeDisabled ? undefined : inlineThemeDisabled,
|
|
65
|
+
themeClass: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.themeClass,
|
|
66
|
+
onRender: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.onRender,
|
|
59
67
|
placement: messageProviderProps.placement
|
|
60
68
|
};
|
|
61
69
|
},
|
|
62
70
|
render() {
|
|
63
|
-
const { render: renderMessage, type, closable, content, mergedClsPrefix, cssVars, icon, handleClose } = this;
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
71
|
+
const { render: renderMessage, type, closable, content, mergedClsPrefix, cssVars, themeClass, onRender, icon, handleClose, showIcon } = this;
|
|
72
|
+
onRender === null || onRender === void 0 ? void 0 : onRender();
|
|
73
|
+
let iconNode;
|
|
74
|
+
return (h("div", { class: [`${mergedClsPrefix}-message-wrapper`, themeClass], onMouseenter: this.onMouseenter, onMouseleave: this.onMouseleave, style: [
|
|
75
|
+
{
|
|
76
|
+
alignItems: this.placement.startsWith('top')
|
|
77
|
+
? 'flex-start'
|
|
78
|
+
: 'flex-end'
|
|
79
|
+
},
|
|
80
|
+
cssVars
|
|
81
|
+
] }, renderMessage ? (renderMessage(this.$props)) : (h("div", { class: `${mergedClsPrefix}-message ${mergedClsPrefix}-message--${type}-type` },
|
|
82
|
+
(iconNode = createIconVNode(icon, type, mergedClsPrefix)) &&
|
|
83
|
+
showIcon ? (h("div", { class: `${mergedClsPrefix}-message__icon ${mergedClsPrefix}-message__icon--${type}-type` },
|
|
70
84
|
h(NIconSwitchTransition, null, {
|
|
71
|
-
default: () =>
|
|
72
|
-
})),
|
|
85
|
+
default: () => iconNode
|
|
86
|
+
}))) : null,
|
|
73
87
|
h("div", { class: `${mergedClsPrefix}-message__content` }, render(content)),
|
|
74
88
|
closable ? (h(NBaseClose, { clsPrefix: mergedClsPrefix, class: `${mergedClsPrefix}-message__close`, onClick: handleClose })) : null))));
|
|
75
89
|
}
|
|
@@ -79,8 +93,11 @@ function createIconVNode(icon, type, clsPrefix) {
|
|
|
79
93
|
return icon();
|
|
80
94
|
}
|
|
81
95
|
else {
|
|
96
|
+
const innerIcon = type === 'loading' ? (h(NBaseLoading, { clsPrefix: clsPrefix, strokeWidth: 24, scale: 0.85 })) : (iconMap[type]);
|
|
97
|
+
if (!innerIcon)
|
|
98
|
+
return null;
|
|
82
99
|
return (h(NBaseIcon, { clsPrefix: clsPrefix, key: type }, {
|
|
83
|
-
default: () =>
|
|
100
|
+
default: () => innerIcon
|
|
84
101
|
}));
|
|
85
102
|
}
|
|
86
103
|
}
|
|
@@ -19,6 +19,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
19
19
|
readonly default: "info";
|
|
20
20
|
};
|
|
21
21
|
content: PropType<string | number | (() => import("vue").VNodeChild)>;
|
|
22
|
+
showIcon: {
|
|
23
|
+
readonly type: BooleanConstructor;
|
|
24
|
+
readonly default: true;
|
|
25
|
+
};
|
|
22
26
|
closable: BooleanConstructor;
|
|
23
27
|
keepAliveOnHover: BooleanConstructor;
|
|
24
28
|
onClose: PropType<() => void>;
|
|
@@ -52,6 +56,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
52
56
|
readonly default: "info";
|
|
53
57
|
};
|
|
54
58
|
content: PropType<string | number | (() => import("vue").VNodeChild)>;
|
|
59
|
+
showIcon: {
|
|
60
|
+
readonly type: BooleanConstructor;
|
|
61
|
+
readonly default: true;
|
|
62
|
+
};
|
|
55
63
|
closable: BooleanConstructor;
|
|
56
64
|
keepAliveOnHover: BooleanConstructor;
|
|
57
65
|
onClose: PropType<() => void>;
|
|
@@ -60,6 +68,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
60
68
|
}>>, {
|
|
61
69
|
type: import("./types").MessageType;
|
|
62
70
|
duration: number;
|
|
71
|
+
showIcon: boolean;
|
|
63
72
|
closable: boolean;
|
|
64
73
|
keepAliveOnHover: boolean;
|
|
65
74
|
}>;
|
|
@@ -84,7 +84,7 @@ export default defineComponent({
|
|
|
84
84
|
render() {
|
|
85
85
|
return (h(NFadeInExpandTransition, { appear: true, onAfterLeave: this.handleAfterLeave, onLeave: this.onLeave }, {
|
|
86
86
|
default: () => [
|
|
87
|
-
this.show ? (h(NMessage, { content: this.content, type: this.type, icon: this.icon, closable: this.closable, onClose: this.handleClose, onMouseenter: this.keepAliveOnHover ? this.handleMouseenter : undefined, onMouseleave: this.keepAliveOnHover ? this.handleMouseleave : undefined })) : null
|
|
87
|
+
this.show ? (h(NMessage, { content: this.content, type: this.type, icon: this.icon, showIcon: this.showIcon, closable: this.closable, onClose: this.handleClose, onMouseenter: this.keepAliveOnHover ? this.handleMouseenter : undefined, onMouseleave: this.keepAliveOnHover ? this.handleMouseleave : undefined })) : null
|
|
88
88
|
]
|
|
89
89
|
}));
|
|
90
90
|
}
|
|
@@ -3,6 +3,7 @@ import type { ExtractPublicPropTypes } from '../../_utils';
|
|
|
3
3
|
import type { MessageOptions, MessageType } from './types';
|
|
4
4
|
declare type ContentType = string | (() => VNodeChild);
|
|
5
5
|
export interface MessageApiInjection {
|
|
6
|
+
create: (content: ContentType, options?: MessageOptions) => MessageReactive;
|
|
6
7
|
info: (content: ContentType, options?: MessageOptions) => MessageReactive;
|
|
7
8
|
success: (content: ContentType, options?: MessageOptions) => MessageReactive;
|
|
8
9
|
warning: (content: ContentType, options?: MessageOptions) => MessageReactive;
|
|
@@ -17,6 +18,7 @@ export interface MessageReactive {
|
|
|
17
18
|
keepAliveOnHover?: boolean;
|
|
18
19
|
type: MessageType;
|
|
19
20
|
icon?: () => VNodeChild;
|
|
21
|
+
showIcon?: boolean;
|
|
20
22
|
onClose?: () => void;
|
|
21
23
|
destroy: () => void;
|
|
22
24
|
}
|
|
@@ -36,26 +38,33 @@ declare const messageProviderProps: {
|
|
|
36
38
|
closable: BooleanConstructor;
|
|
37
39
|
containerStyle: PropType<string | CSSProperties>;
|
|
38
40
|
theme: PropType<import("../../_mixins").Theme<"Message", {
|
|
41
|
+
textColor: string;
|
|
39
42
|
textColorInfo: string;
|
|
40
43
|
textColorSuccess: string;
|
|
41
44
|
textColorError: string;
|
|
42
45
|
textColorWarning: string;
|
|
43
46
|
textColorLoading: string;
|
|
47
|
+
color: string;
|
|
44
48
|
colorInfo: string;
|
|
45
49
|
colorSuccess: string;
|
|
46
50
|
colorError: string;
|
|
47
51
|
colorWarning: string;
|
|
48
52
|
colorLoading: string;
|
|
53
|
+
boxShadow: string;
|
|
49
54
|
boxShadowInfo: string;
|
|
50
55
|
boxShadowSuccess: string;
|
|
51
56
|
boxShadowError: string;
|
|
52
57
|
boxShadowWarning: string;
|
|
53
58
|
boxShadowLoading: string;
|
|
59
|
+
iconColor: string;
|
|
54
60
|
iconColorInfo: string;
|
|
55
61
|
iconColorSuccess: string;
|
|
56
62
|
iconColorWarning: string;
|
|
57
63
|
iconColorError: string;
|
|
58
64
|
iconColorLoading: string;
|
|
65
|
+
closeColor: string;
|
|
66
|
+
closeColorHover: string;
|
|
67
|
+
closeColorPressed: string;
|
|
59
68
|
closeColorInfo: string;
|
|
60
69
|
closeColorHoverInfo: string;
|
|
61
70
|
closeColorPressedInfo: string;
|
|
@@ -85,26 +94,33 @@ declare const messageProviderProps: {
|
|
|
85
94
|
fontSize: string;
|
|
86
95
|
}, any>>;
|
|
87
96
|
themeOverrides: PropType<import("../../_mixins/use-theme").ExtractThemeOverrides<import("../../_mixins").Theme<"Message", {
|
|
97
|
+
textColor: string;
|
|
88
98
|
textColorInfo: string;
|
|
89
99
|
textColorSuccess: string;
|
|
90
100
|
textColorError: string;
|
|
91
101
|
textColorWarning: string;
|
|
92
102
|
textColorLoading: string;
|
|
103
|
+
color: string;
|
|
93
104
|
colorInfo: string;
|
|
94
105
|
colorSuccess: string;
|
|
95
106
|
colorError: string;
|
|
96
107
|
colorWarning: string;
|
|
97
108
|
colorLoading: string;
|
|
109
|
+
boxShadow: string;
|
|
98
110
|
boxShadowInfo: string;
|
|
99
111
|
boxShadowSuccess: string;
|
|
100
112
|
boxShadowError: string;
|
|
101
113
|
boxShadowWarning: string;
|
|
102
114
|
boxShadowLoading: string;
|
|
115
|
+
iconColor: string;
|
|
103
116
|
iconColorInfo: string;
|
|
104
117
|
iconColorSuccess: string;
|
|
105
118
|
iconColorWarning: string;
|
|
106
119
|
iconColorError: string;
|
|
107
120
|
iconColorLoading: string;
|
|
121
|
+
closeColor: string;
|
|
122
|
+
closeColorHover: string;
|
|
123
|
+
closeColorPressed: string;
|
|
108
124
|
closeColorInfo: string;
|
|
109
125
|
closeColorHoverInfo: string;
|
|
110
126
|
closeColorPressedInfo: string;
|
|
@@ -134,26 +150,33 @@ declare const messageProviderProps: {
|
|
|
134
150
|
fontSize: string;
|
|
135
151
|
}, any>>>;
|
|
136
152
|
builtinThemeOverrides: PropType<import("../../_mixins/use-theme").ExtractThemeOverrides<import("../../_mixins").Theme<"Message", {
|
|
153
|
+
textColor: string;
|
|
137
154
|
textColorInfo: string;
|
|
138
155
|
textColorSuccess: string;
|
|
139
156
|
textColorError: string;
|
|
140
157
|
textColorWarning: string;
|
|
141
158
|
textColorLoading: string;
|
|
159
|
+
color: string;
|
|
142
160
|
colorInfo: string;
|
|
143
161
|
colorSuccess: string;
|
|
144
162
|
colorError: string;
|
|
145
163
|
colorWarning: string;
|
|
146
164
|
colorLoading: string;
|
|
165
|
+
boxShadow: string;
|
|
147
166
|
boxShadowInfo: string;
|
|
148
167
|
boxShadowSuccess: string;
|
|
149
168
|
boxShadowError: string;
|
|
150
169
|
boxShadowWarning: string;
|
|
151
170
|
boxShadowLoading: string;
|
|
171
|
+
iconColor: string;
|
|
152
172
|
iconColorInfo: string;
|
|
153
173
|
iconColorSuccess: string;
|
|
154
174
|
iconColorWarning: string;
|
|
155
175
|
iconColorError: string;
|
|
156
176
|
iconColorLoading: string;
|
|
177
|
+
closeColor: string;
|
|
178
|
+
closeColorHover: string;
|
|
179
|
+
closeColorPressed: string;
|
|
157
180
|
closeColorInfo: string;
|
|
158
181
|
closeColorHoverInfo: string;
|
|
159
182
|
closeColorPressedInfo: string;
|
|
@@ -200,26 +223,33 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
200
223
|
closable: BooleanConstructor;
|
|
201
224
|
containerStyle: PropType<string | CSSProperties>;
|
|
202
225
|
theme: PropType<import("../../_mixins").Theme<"Message", {
|
|
226
|
+
textColor: string;
|
|
203
227
|
textColorInfo: string;
|
|
204
228
|
textColorSuccess: string;
|
|
205
229
|
textColorError: string;
|
|
206
230
|
textColorWarning: string;
|
|
207
231
|
textColorLoading: string;
|
|
232
|
+
color: string;
|
|
208
233
|
colorInfo: string;
|
|
209
234
|
colorSuccess: string;
|
|
210
235
|
colorError: string;
|
|
211
236
|
colorWarning: string;
|
|
212
237
|
colorLoading: string;
|
|
238
|
+
boxShadow: string;
|
|
213
239
|
boxShadowInfo: string;
|
|
214
240
|
boxShadowSuccess: string;
|
|
215
241
|
boxShadowError: string;
|
|
216
242
|
boxShadowWarning: string;
|
|
217
243
|
boxShadowLoading: string;
|
|
244
|
+
iconColor: string;
|
|
218
245
|
iconColorInfo: string;
|
|
219
246
|
iconColorSuccess: string;
|
|
220
247
|
iconColorWarning: string;
|
|
221
248
|
iconColorError: string;
|
|
222
249
|
iconColorLoading: string;
|
|
250
|
+
closeColor: string;
|
|
251
|
+
closeColorHover: string;
|
|
252
|
+
closeColorPressed: string;
|
|
223
253
|
closeColorInfo: string;
|
|
224
254
|
closeColorHoverInfo: string;
|
|
225
255
|
closeColorPressedInfo: string;
|
|
@@ -249,26 +279,33 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
249
279
|
fontSize: string;
|
|
250
280
|
}, any>>;
|
|
251
281
|
themeOverrides: PropType<import("../../_mixins/use-theme").ExtractThemeOverrides<import("../../_mixins").Theme<"Message", {
|
|
282
|
+
textColor: string;
|
|
252
283
|
textColorInfo: string;
|
|
253
284
|
textColorSuccess: string;
|
|
254
285
|
textColorError: string;
|
|
255
286
|
textColorWarning: string;
|
|
256
287
|
textColorLoading: string;
|
|
288
|
+
color: string;
|
|
257
289
|
colorInfo: string;
|
|
258
290
|
colorSuccess: string;
|
|
259
291
|
colorError: string;
|
|
260
292
|
colorWarning: string;
|
|
261
293
|
colorLoading: string;
|
|
294
|
+
boxShadow: string;
|
|
262
295
|
boxShadowInfo: string;
|
|
263
296
|
boxShadowSuccess: string;
|
|
264
297
|
boxShadowError: string;
|
|
265
298
|
boxShadowWarning: string;
|
|
266
299
|
boxShadowLoading: string;
|
|
300
|
+
iconColor: string;
|
|
267
301
|
iconColorInfo: string;
|
|
268
302
|
iconColorSuccess: string;
|
|
269
303
|
iconColorWarning: string;
|
|
270
304
|
iconColorError: string;
|
|
271
305
|
iconColorLoading: string;
|
|
306
|
+
closeColor: string;
|
|
307
|
+
closeColorHover: string;
|
|
308
|
+
closeColorPressed: string;
|
|
272
309
|
closeColorInfo: string;
|
|
273
310
|
closeColorHoverInfo: string;
|
|
274
311
|
closeColorPressedInfo: string;
|
|
@@ -298,26 +335,33 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
298
335
|
fontSize: string;
|
|
299
336
|
}, any>>>;
|
|
300
337
|
builtinThemeOverrides: PropType<import("../../_mixins/use-theme").ExtractThemeOverrides<import("../../_mixins").Theme<"Message", {
|
|
338
|
+
textColor: string;
|
|
301
339
|
textColorInfo: string;
|
|
302
340
|
textColorSuccess: string;
|
|
303
341
|
textColorError: string;
|
|
304
342
|
textColorWarning: string;
|
|
305
343
|
textColorLoading: string;
|
|
344
|
+
color: string;
|
|
306
345
|
colorInfo: string;
|
|
307
346
|
colorSuccess: string;
|
|
308
347
|
colorError: string;
|
|
309
348
|
colorWarning: string;
|
|
310
349
|
colorLoading: string;
|
|
350
|
+
boxShadow: string;
|
|
311
351
|
boxShadowInfo: string;
|
|
312
352
|
boxShadowSuccess: string;
|
|
313
353
|
boxShadowError: string;
|
|
314
354
|
boxShadowWarning: string;
|
|
315
355
|
boxShadowLoading: string;
|
|
356
|
+
iconColor: string;
|
|
316
357
|
iconColorInfo: string;
|
|
317
358
|
iconColorSuccess: string;
|
|
318
359
|
iconColorWarning: string;
|
|
319
360
|
iconColorError: string;
|
|
320
361
|
iconColorLoading: string;
|
|
362
|
+
closeColor: string;
|
|
363
|
+
closeColorHover: string;
|
|
364
|
+
closeColorPressed: string;
|
|
321
365
|
closeColorInfo: string;
|
|
322
366
|
closeColorHoverInfo: string;
|
|
323
367
|
closeColorPressedInfo: string;
|
|
@@ -358,6 +402,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
358
402
|
keepAliveOnHover?: boolean | undefined;
|
|
359
403
|
type: MessageType;
|
|
360
404
|
icon?: (() => VNodeChild) | undefined;
|
|
405
|
+
showIcon?: boolean | undefined;
|
|
361
406
|
onClose?: (() => void) | undefined;
|
|
362
407
|
destroy: () => void;
|
|
363
408
|
};
|
|
@@ -370,6 +415,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
370
415
|
keepAliveOnHover?: boolean | undefined;
|
|
371
416
|
type: MessageType;
|
|
372
417
|
icon?: (() => VNodeChild) | undefined;
|
|
418
|
+
showIcon?: boolean | undefined;
|
|
373
419
|
onClose?: (() => void) | undefined;
|
|
374
420
|
destroy: () => void;
|
|
375
421
|
}[]>;
|
|
@@ -389,26 +435,33 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
389
435
|
closable: BooleanConstructor;
|
|
390
436
|
containerStyle: PropType<string | CSSProperties>;
|
|
391
437
|
theme: PropType<import("../../_mixins").Theme<"Message", {
|
|
438
|
+
textColor: string;
|
|
392
439
|
textColorInfo: string;
|
|
393
440
|
textColorSuccess: string;
|
|
394
441
|
textColorError: string;
|
|
395
442
|
textColorWarning: string;
|
|
396
443
|
textColorLoading: string;
|
|
444
|
+
color: string;
|
|
397
445
|
colorInfo: string;
|
|
398
446
|
colorSuccess: string;
|
|
399
447
|
colorError: string;
|
|
400
448
|
colorWarning: string;
|
|
401
449
|
colorLoading: string;
|
|
450
|
+
boxShadow: string;
|
|
402
451
|
boxShadowInfo: string;
|
|
403
452
|
boxShadowSuccess: string;
|
|
404
453
|
boxShadowError: string;
|
|
405
454
|
boxShadowWarning: string;
|
|
406
455
|
boxShadowLoading: string;
|
|
456
|
+
iconColor: string;
|
|
407
457
|
iconColorInfo: string;
|
|
408
458
|
iconColorSuccess: string;
|
|
409
459
|
iconColorWarning: string;
|
|
410
460
|
iconColorError: string;
|
|
411
461
|
iconColorLoading: string;
|
|
462
|
+
closeColor: string;
|
|
463
|
+
closeColorHover: string;
|
|
464
|
+
closeColorPressed: string;
|
|
412
465
|
closeColorInfo: string;
|
|
413
466
|
closeColorHoverInfo: string;
|
|
414
467
|
closeColorPressedInfo: string;
|
|
@@ -438,26 +491,33 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
438
491
|
fontSize: string;
|
|
439
492
|
}, any>>;
|
|
440
493
|
themeOverrides: PropType<import("../../_mixins/use-theme").ExtractThemeOverrides<import("../../_mixins").Theme<"Message", {
|
|
494
|
+
textColor: string;
|
|
441
495
|
textColorInfo: string;
|
|
442
496
|
textColorSuccess: string;
|
|
443
497
|
textColorError: string;
|
|
444
498
|
textColorWarning: string;
|
|
445
499
|
textColorLoading: string;
|
|
500
|
+
color: string;
|
|
446
501
|
colorInfo: string;
|
|
447
502
|
colorSuccess: string;
|
|
448
503
|
colorError: string;
|
|
449
504
|
colorWarning: string;
|
|
450
505
|
colorLoading: string;
|
|
506
|
+
boxShadow: string;
|
|
451
507
|
boxShadowInfo: string;
|
|
452
508
|
boxShadowSuccess: string;
|
|
453
509
|
boxShadowError: string;
|
|
454
510
|
boxShadowWarning: string;
|
|
455
511
|
boxShadowLoading: string;
|
|
512
|
+
iconColor: string;
|
|
456
513
|
iconColorInfo: string;
|
|
457
514
|
iconColorSuccess: string;
|
|
458
515
|
iconColorWarning: string;
|
|
459
516
|
iconColorError: string;
|
|
460
517
|
iconColorLoading: string;
|
|
518
|
+
closeColor: string;
|
|
519
|
+
closeColorHover: string;
|
|
520
|
+
closeColorPressed: string;
|
|
461
521
|
closeColorInfo: string;
|
|
462
522
|
closeColorHoverInfo: string;
|
|
463
523
|
closeColorPressedInfo: string;
|
|
@@ -487,26 +547,33 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
487
547
|
fontSize: string;
|
|
488
548
|
}, any>>>;
|
|
489
549
|
builtinThemeOverrides: PropType<import("../../_mixins/use-theme").ExtractThemeOverrides<import("../../_mixins").Theme<"Message", {
|
|
550
|
+
textColor: string;
|
|
490
551
|
textColorInfo: string;
|
|
491
552
|
textColorSuccess: string;
|
|
492
553
|
textColorError: string;
|
|
493
554
|
textColorWarning: string;
|
|
494
555
|
textColorLoading: string;
|
|
556
|
+
color: string;
|
|
495
557
|
colorInfo: string;
|
|
496
558
|
colorSuccess: string;
|
|
497
559
|
colorError: string;
|
|
498
560
|
colorWarning: string;
|
|
499
561
|
colorLoading: string;
|
|
562
|
+
boxShadow: string;
|
|
500
563
|
boxShadowInfo: string;
|
|
501
564
|
boxShadowSuccess: string;
|
|
502
565
|
boxShadowError: string;
|
|
503
566
|
boxShadowWarning: string;
|
|
504
567
|
boxShadowLoading: string;
|
|
568
|
+
iconColor: string;
|
|
505
569
|
iconColorInfo: string;
|
|
506
570
|
iconColorSuccess: string;
|
|
507
571
|
iconColorWarning: string;
|
|
508
572
|
iconColorError: string;
|
|
509
573
|
iconColorLoading: string;
|
|
574
|
+
closeColor: string;
|
|
575
|
+
closeColorHover: string;
|
|
576
|
+
closeColorPressed: string;
|
|
510
577
|
closeColorInfo: string;
|
|
511
578
|
closeColorHoverInfo: string;
|
|
512
579
|
closeColorPressedInfo: string;
|
|
@@ -19,6 +19,9 @@ export default defineComponent({
|
|
|
19
19
|
const messageListRef = ref([]);
|
|
20
20
|
const messageRefs = ref({});
|
|
21
21
|
const api = {
|
|
22
|
+
create(content, options) {
|
|
23
|
+
return create(content, Object.assign({ type: 'default' }, options));
|
|
24
|
+
},
|
|
22
25
|
info(content, options) {
|
|
23
26
|
return create(content, Object.assign(Object.assign({}, options), { type: 'info' }));
|
|
24
27
|
},
|
|
@@ -8,6 +8,10 @@ export declare const messageProps: {
|
|
|
8
8
|
readonly default: "info";
|
|
9
9
|
};
|
|
10
10
|
readonly content: PropType<string | number | (() => VNodeChild)>;
|
|
11
|
+
readonly showIcon: {
|
|
12
|
+
readonly type: BooleanConstructor;
|
|
13
|
+
readonly default: true;
|
|
14
|
+
};
|
|
11
15
|
readonly closable: BooleanConstructor;
|
|
12
16
|
readonly keepAliveOnHover: BooleanConstructor;
|
|
13
17
|
readonly onClose: PropType<() => void>;
|
|
@@ -13,6 +13,7 @@ import fadeInHeightExpand from '../../../_styles/transitions/fade-in-height-expa
|
|
|
13
13
|
// --n-text-color
|
|
14
14
|
// --n-color
|
|
15
15
|
// --n-box-shadow
|
|
16
|
+
// --n-icon-color-default
|
|
16
17
|
// --n-icon-color-info
|
|
17
18
|
// --n-icon-color-success
|
|
18
19
|
// --n-icon-color-warning
|
|
@@ -67,7 +68,7 @@ export default c([cB('message-wrapper', `
|
|
|
67
68
|
width: var(--n-icon-size);
|
|
68
69
|
font-size: var(--n-icon-size);
|
|
69
70
|
flex-shrink: 0;
|
|
70
|
-
`, [['info', 'success', 'warning', 'error', 'loading'].map(type => cM(`${type}-type`, [c('> *', `
|
|
71
|
+
`, [['default', 'info', 'success', 'warning', 'error', 'loading'].map(type => cM(`${type}-type`, [c('> *', `
|
|
71
72
|
color: var(--n-icon-color-${type});
|
|
72
73
|
transition: color .3s var(--n-bezier);
|
|
73
74
|
`)])), c('> *', `
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import { VNodeChild } from 'vue';
|
|
2
2
|
import type { MessageSetupProps } from './message-props';
|
|
3
|
-
export declare type MessageType = 'info' | 'success' | 'warning' | 'error' | 'loading';
|
|
3
|
+
export declare type MessageType = 'info' | 'success' | 'warning' | 'error' | 'loading' | 'default';
|
|
4
4
|
export declare type RenderMessageProps = Pick<MessageSetupProps, 'closable' | 'content' | 'icon' | 'onClose' | 'type'>;
|
|
5
5
|
export declare type MessageRenderMessage = (props: RenderMessageProps) => VNodeChild;
|
|
6
6
|
export interface MessageOptions {
|
|
7
|
+
type?: MessageType;
|
|
7
8
|
render?: MessageRenderMessage;
|
|
8
9
|
duration?: number;
|
|
9
10
|
closable?: boolean;
|
|
10
11
|
keepAliveOnHover?: boolean;
|
|
11
12
|
icon?: () => VNodeChild;
|
|
13
|
+
showIcon?: boolean;
|
|
12
14
|
onClose?: () => void;
|
|
13
15
|
onLeave?: () => void;
|
|
14
16
|
onAfterLeave?: () => void;
|
|
@@ -1,26 +1,33 @@
|
|
|
1
1
|
import type { ThemeCommonVars } from '../../_styles/common';
|
|
2
2
|
import { Theme } from '../../_mixins/use-theme';
|
|
3
3
|
export declare const self: (vars: ThemeCommonVars) => {
|
|
4
|
+
textColor: string;
|
|
4
5
|
textColorInfo: string;
|
|
5
6
|
textColorSuccess: string;
|
|
6
7
|
textColorError: string;
|
|
7
8
|
textColorWarning: string;
|
|
8
9
|
textColorLoading: string;
|
|
10
|
+
color: string;
|
|
9
11
|
colorInfo: string;
|
|
10
12
|
colorSuccess: string;
|
|
11
13
|
colorError: string;
|
|
12
14
|
colorWarning: string;
|
|
13
15
|
colorLoading: string;
|
|
16
|
+
boxShadow: string;
|
|
14
17
|
boxShadowInfo: string;
|
|
15
18
|
boxShadowSuccess: string;
|
|
16
19
|
boxShadowError: string;
|
|
17
20
|
boxShadowWarning: string;
|
|
18
21
|
boxShadowLoading: string;
|
|
22
|
+
iconColor: string;
|
|
19
23
|
iconColorInfo: string;
|
|
20
24
|
iconColorSuccess: string;
|
|
21
25
|
iconColorWarning: string;
|
|
22
26
|
iconColorError: string;
|
|
23
27
|
iconColorLoading: string;
|
|
28
|
+
closeColor: string;
|
|
29
|
+
closeColorHover: string;
|
|
30
|
+
closeColorPressed: string;
|
|
24
31
|
closeColorInfo: string;
|
|
25
32
|
closeColorHoverInfo: string;
|
|
26
33
|
closeColorPressedInfo: string;
|
|
@@ -2,7 +2,7 @@ import commonVariables from './_common';
|
|
|
2
2
|
import { commonLight } from '../../_styles/common';
|
|
3
3
|
export const self = (vars) => {
|
|
4
4
|
const { textColor2, closeColor, closeColorHover, closeColorPressed, infoColor, successColor, errorColor, warningColor, popoverColor, boxShadow2, primaryColor, lineHeight, borderRadius } = vars;
|
|
5
|
-
return Object.assign(Object.assign({}, commonVariables), { textColorInfo: textColor2, textColorSuccess: textColor2, textColorError: textColor2, textColorWarning: textColor2, textColorLoading: textColor2, colorInfo: popoverColor, colorSuccess: popoverColor, colorError: popoverColor, colorWarning: popoverColor, colorLoading: popoverColor, boxShadowInfo: boxShadow2, boxShadowSuccess: boxShadow2, boxShadowError: boxShadow2, boxShadowWarning: boxShadow2, boxShadowLoading: boxShadow2, iconColorInfo: infoColor, iconColorSuccess: successColor, iconColorWarning: warningColor, iconColorError: errorColor, iconColorLoading: primaryColor, closeColorInfo: closeColor, closeColorHoverInfo: closeColorHover, closeColorPressedInfo: closeColorPressed, closeColorSuccess: closeColor, closeColorHoverSuccess: closeColorHover, closeColorPressedSuccess: closeColorPressed, closeColorError: closeColor, closeColorHoverError: closeColorHover, closeColorPressedError: closeColorPressed, closeColorWarning: closeColor, closeColorHoverWarning: closeColorHover, closeColorPressedWarning: closeColorPressed, closeColorLoading: closeColor, closeColorHoverLoading: closeColorHover, closeColorPressedLoading: closeColorPressed, loadingColor: primaryColor, lineHeight,
|
|
5
|
+
return Object.assign(Object.assign({}, commonVariables), { textColor: textColor2, textColorInfo: textColor2, textColorSuccess: textColor2, textColorError: textColor2, textColorWarning: textColor2, textColorLoading: textColor2, color: popoverColor, colorInfo: popoverColor, colorSuccess: popoverColor, colorError: popoverColor, colorWarning: popoverColor, colorLoading: popoverColor, boxShadow: boxShadow2, boxShadowInfo: boxShadow2, boxShadowSuccess: boxShadow2, boxShadowError: boxShadow2, boxShadowWarning: boxShadow2, boxShadowLoading: boxShadow2, iconColor: textColor2, iconColorInfo: infoColor, iconColorSuccess: successColor, iconColorWarning: warningColor, iconColorError: errorColor, iconColorLoading: primaryColor, closeColor: closeColor, closeColorHover: closeColorHover, closeColorPressed: closeColorPressed, closeColorInfo: closeColor, closeColorHoverInfo: closeColorHover, closeColorPressedInfo: closeColorPressed, closeColorSuccess: closeColor, closeColorHoverSuccess: closeColorHover, closeColorPressedSuccess: closeColorPressed, closeColorError: closeColor, closeColorHoverError: closeColorHover, closeColorPressedError: closeColorPressed, closeColorWarning: closeColor, closeColorHoverWarning: closeColorHover, closeColorPressedWarning: closeColorPressed, closeColorLoading: closeColor, closeColorHoverLoading: closeColorHover, closeColorPressedLoading: closeColorPressed, loadingColor: primaryColor, lineHeight,
|
|
6
6
|
borderRadius });
|
|
7
7
|
};
|
|
8
8
|
const messageLight = {
|
|
@@ -685,6 +685,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
685
685
|
mergedClsPrefix: import("vue").Ref<string>;
|
|
686
686
|
bodyRef: import("vue").Ref<ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | HTMLElement | null>;
|
|
687
687
|
scrollbarRef: import("vue").Ref<{
|
|
688
|
+
$el: HTMLElement;
|
|
688
689
|
containerRef: HTMLElement | null;
|
|
689
690
|
contentRef: HTMLElement | null;
|
|
690
691
|
containerScrollTop: number;
|
|
@@ -68,7 +68,9 @@ export declare const Notification: import("vue").DefineComponent<{
|
|
|
68
68
|
'--n-padding-right': string;
|
|
69
69
|
'--n-padding-top': string;
|
|
70
70
|
'--n-padding-bottom': string;
|
|
71
|
-
}
|
|
71
|
+
}> | undefined;
|
|
72
|
+
themeClass: import("vue").Ref<string> | undefined;
|
|
73
|
+
onRender: (() => void) | undefined;
|
|
72
74
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
73
75
|
readonly closable: {
|
|
74
76
|
readonly type: BooleanConstructor;
|