naive-ui 2.25.4 → 2.25.7
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/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/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.js +6 -4
- 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/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/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/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.js +6 -4
- 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/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
|
@@ -1712,6 +1712,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1712
1712
|
}, any>;
|
|
1713
1713
|
}>>>;
|
|
1714
1714
|
}, {
|
|
1715
|
+
rtlEnabled: import("vue").Ref<import("../../config-provider/src/internal-interface").RtlItem | undefined> | undefined;
|
|
1715
1716
|
inputInstRef: import("vue").Ref<{
|
|
1716
1717
|
wrapperElRef: HTMLElement | null;
|
|
1717
1718
|
textareaElRef: HTMLTextAreaElement | null;
|
|
@@ -11,6 +11,7 @@ import { warnOnce, call } from '../../_utils';
|
|
|
11
11
|
import { inputNumberLight } from '../styles';
|
|
12
12
|
import { parse, validator, format, parseNumber, isWipValue } from './utils';
|
|
13
13
|
import style from './styles/input-number.cssr';
|
|
14
|
+
import useRtl from '../../_mixins/use-rtl';
|
|
14
15
|
const HOLDING_CHANGE_THRESHOLD = 800;
|
|
15
16
|
const HOLDING_CHANGE_INTERVAL = 100;
|
|
16
17
|
const inputNumberProps = Object.assign(Object.assign({}, useTheme.props), { loading: {
|
|
@@ -51,7 +52,7 @@ export default defineComponent({
|
|
|
51
52
|
}
|
|
52
53
|
});
|
|
53
54
|
}
|
|
54
|
-
const { mergedBorderedRef, mergedClsPrefixRef } = useConfig(props);
|
|
55
|
+
const { mergedBorderedRef, mergedClsPrefixRef, mergedRtlRef } = useConfig(props);
|
|
55
56
|
const themeRef = useTheme('InputNumber', '-input-number', style, inputNumberLight, props, mergedClsPrefixRef);
|
|
56
57
|
const { localeRef } = useLocale('InputNumber');
|
|
57
58
|
const formItem = useFormItem(props);
|
|
@@ -398,7 +399,8 @@ export default defineComponent({
|
|
|
398
399
|
focus: () => { var _a; return (_a = inputInstRef.value) === null || _a === void 0 ? void 0 : _a.focus(); },
|
|
399
400
|
blur: () => { var _a; return (_a = inputInstRef.value) === null || _a === void 0 ? void 0 : _a.blur(); }
|
|
400
401
|
};
|
|
401
|
-
|
|
402
|
+
const rtlEnabledRef = useRtl('InputNumber', mergedRtlRef, mergedClsPrefixRef);
|
|
403
|
+
return Object.assign(Object.assign({}, exposedMethods), { rtlEnabled: rtlEnabledRef, inputInstRef,
|
|
402
404
|
minusButtonInstRef,
|
|
403
405
|
addButtonInstRef, mergedClsPrefix: mergedClsPrefixRef, mergedBordered: mergedBorderedRef, uncontrolledValue: uncontrolledValueRef, mergedValue: mergedValueRef, mergedPlaceholder: mergedPlaceholderRef, displayedValueInvalid: displayedValueInvalidRef, mergedSize: mergedSizeRef, mergedDisabled: mergedDisabledRef, displayedValue: displayedValueRef, addable: addableRef, minusable: minusableRef, mergedStatus: mergedStatusRef, handleFocus,
|
|
404
406
|
handleBlur,
|
|
@@ -426,7 +428,10 @@ export default defineComponent({
|
|
|
426
428
|
},
|
|
427
429
|
render() {
|
|
428
430
|
const { mergedClsPrefix } = this;
|
|
429
|
-
return (h("div", { class:
|
|
431
|
+
return (h("div", { class: [
|
|
432
|
+
`${mergedClsPrefix}-input-number`,
|
|
433
|
+
this.rtlEnabled && `${mergedClsPrefix}-input-number--rtl`
|
|
434
|
+
] },
|
|
430
435
|
h(NInput, { ref: "inputInstRef", status: this.mergedStatus, bordered: this.mergedBordered, loading: this.loading, value: this.displayedValue, onUpdateValue: this.handleUpdateDisplayedValue, theme: this.mergedTheme.peers.Input, themeOverrides: this.mergedTheme.peerOverrides.Input, builtinThemeOverrides: this.inputThemeOverrides, size: this.mergedSize, placeholder: this.mergedPlaceholder, disabled: this.mergedDisabled, readonly: this.readonly, textDecoration: this.displayedValueInvalid ? 'line-through' : undefined, onFocus: this.handleFocus, onBlur: this.handleBlur, onKeydown: this.handleKeyDown, onMousedown: this.handleMouseDown, onClear: this.handleClear, clearable: this.clearable, internalLoadingBeforeSuffix: true }, {
|
|
431
436
|
prefix: () => { var _a, _b; return (_b = (_a = this.$slots).prefix) === null || _b === void 0 ? void 0 : _b.call(_a); },
|
|
432
437
|
suffix: () => {
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import rtlStyle from '../src/styles/rtl.cssr';
|
|
2
|
+
import { inputRtl } from '../../input/styles/rtl';
|
|
3
|
+
import { buttonRtl } from '../../button/styles/rtl';
|
|
4
|
+
export const inputNumberRtl = {
|
|
5
|
+
name: 'InputNumber',
|
|
6
|
+
style: rtlStyle,
|
|
7
|
+
peers: [inputRtl, buttonRtl]
|
|
8
|
+
};
|
|
@@ -162,6 +162,7 @@ export declare function createLayoutComponent(isContent: boolean): import("vue")
|
|
|
162
162
|
mergedClsPrefix: import("vue").ComputedRef<string>;
|
|
163
163
|
scrollableElRef: import("vue").Ref<HTMLElement | null>;
|
|
164
164
|
scrollbarInstRef: import("vue").Ref<{
|
|
165
|
+
$el: HTMLElement;
|
|
165
166
|
containerRef: HTMLElement | null;
|
|
166
167
|
contentRef: HTMLElement | null;
|
|
167
168
|
containerScrollTop: number;
|
|
@@ -558,6 +559,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
558
559
|
mergedClsPrefix: import("vue").ComputedRef<string>;
|
|
559
560
|
scrollableElRef: import("vue").Ref<HTMLElement | null>;
|
|
560
561
|
scrollbarInstRef: import("vue").Ref<{
|
|
562
|
+
$el: HTMLElement;
|
|
561
563
|
containerRef: HTMLElement | null;
|
|
562
564
|
contentRef: HTMLElement | null;
|
|
563
565
|
containerScrollTop: number;
|
|
@@ -114,6 +114,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
114
114
|
mergedClsPrefix: import("vue").ComputedRef<string>;
|
|
115
115
|
scrollableElRef: import("vue").Ref<HTMLElement | null>;
|
|
116
116
|
scrollbarInstRef: import("vue").Ref<{
|
|
117
|
+
$el: HTMLElement;
|
|
117
118
|
containerRef: HTMLElement | null;
|
|
118
119
|
contentRef: HTMLElement | null;
|
|
119
120
|
containerScrollTop: number;
|
|
@@ -201,6 +201,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
201
201
|
scrollTo: ((options: ScrollToOptions) => void) & ((x: number, y: number) => void);
|
|
202
202
|
scrollableElRef: import("vue").Ref<HTMLElement | null>;
|
|
203
203
|
scrollbarInstRef: import("vue").Ref<{
|
|
204
|
+
$el: HTMLElement;
|
|
204
205
|
containerRef: HTMLElement | null;
|
|
205
206
|
contentRef: HTMLElement | null;
|
|
206
207
|
containerScrollTop: number;
|
package/es/list/src/List.d.ts
CHANGED
|
@@ -103,7 +103,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
103
103
|
'--n-border-color-popover': string;
|
|
104
104
|
'--n-color-modal': string;
|
|
105
105
|
'--n-color-popover': string;
|
|
106
|
-
}
|
|
106
|
+
}> | undefined;
|
|
107
|
+
themeClass: Ref<string> | undefined;
|
|
108
|
+
onRender: (() => void) | undefined;
|
|
107
109
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
108
110
|
size: {
|
|
109
111
|
type: PropType<"small" | "medium" | "large">;
|
package/es/list/src/List.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { computed, defineComponent, h, provide } from 'vue';
|
|
2
|
-
import { useConfig, useTheme } from '../../_mixins';
|
|
2
|
+
import { useConfig, useTheme, useThemeClass } from '../../_mixins';
|
|
3
3
|
import { createInjectionKey } from '../../_utils';
|
|
4
4
|
import { listLight } from '../styles';
|
|
5
5
|
import style from './styles/index.cssr';
|
|
@@ -15,36 +15,44 @@ export default defineComponent({
|
|
|
15
15
|
name: 'List',
|
|
16
16
|
props: listProps,
|
|
17
17
|
setup(props) {
|
|
18
|
-
const { mergedClsPrefixRef } = useConfig(props);
|
|
18
|
+
const { mergedClsPrefixRef, inlineThemeDisabled } = useConfig(props);
|
|
19
19
|
const themeRef = useTheme('List', '-list', style, listLight, props, mergedClsPrefixRef);
|
|
20
20
|
provide(listInjectionKey, {
|
|
21
21
|
mergedClsPrefixRef
|
|
22
22
|
});
|
|
23
|
+
const cssVarsRef = computed(() => {
|
|
24
|
+
const { common: { cubicBezierEaseInOut }, self: { fontSize, textColor, color, colorModal, colorPopover, borderColor, borderColorModal, borderColorPopover, borderRadius } } = themeRef.value;
|
|
25
|
+
return {
|
|
26
|
+
'--n-font-size': fontSize,
|
|
27
|
+
'--n-bezier': cubicBezierEaseInOut,
|
|
28
|
+
'--n-text-color': textColor,
|
|
29
|
+
'--n-color': color,
|
|
30
|
+
'--n-border-radius': borderRadius,
|
|
31
|
+
'--n-border-color': borderColor,
|
|
32
|
+
'--n-border-color-modal': borderColorModal,
|
|
33
|
+
'--n-border-color-popover': borderColorPopover,
|
|
34
|
+
'--n-color-modal': colorModal,
|
|
35
|
+
'--n-color-popover': colorPopover
|
|
36
|
+
};
|
|
37
|
+
});
|
|
38
|
+
const themeClassHandle = inlineThemeDisabled
|
|
39
|
+
? useThemeClass('list', undefined, cssVarsRef, props)
|
|
40
|
+
: undefined;
|
|
23
41
|
return {
|
|
24
42
|
mergedClsPrefix: mergedClsPrefixRef,
|
|
25
|
-
cssVars:
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
'--n-font-size': fontSize,
|
|
29
|
-
'--n-bezier': cubicBezierEaseInOut,
|
|
30
|
-
'--n-text-color': textColor,
|
|
31
|
-
'--n-color': color,
|
|
32
|
-
'--n-border-radius': borderRadius,
|
|
33
|
-
'--n-border-color': borderColor,
|
|
34
|
-
'--n-border-color-modal': borderColorModal,
|
|
35
|
-
'--n-border-color-popover': borderColorPopover,
|
|
36
|
-
'--n-color-modal': colorModal,
|
|
37
|
-
'--n-color-popover': colorPopover
|
|
38
|
-
};
|
|
39
|
-
})
|
|
43
|
+
cssVars: inlineThemeDisabled ? undefined : cssVarsRef,
|
|
44
|
+
themeClass: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.themeClass,
|
|
45
|
+
onRender: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.onRender
|
|
40
46
|
};
|
|
41
47
|
},
|
|
42
48
|
render() {
|
|
43
49
|
var _a;
|
|
44
|
-
const { $slots, mergedClsPrefix } = this;
|
|
50
|
+
const { $slots, mergedClsPrefix, onRender } = this;
|
|
51
|
+
onRender === null || onRender === void 0 ? void 0 : onRender();
|
|
45
52
|
return (h("ul", { class: [
|
|
46
53
|
`${mergedClsPrefix}-list`,
|
|
47
|
-
this.bordered && `${mergedClsPrefix}-list--bordered
|
|
54
|
+
this.bordered && `${mergedClsPrefix}-list--bordered`,
|
|
55
|
+
this.themeClass
|
|
48
56
|
], style: this.cssVars },
|
|
49
57
|
$slots.header ? (h("div", { class: `${mergedClsPrefix}-list__header` }, $slots.header())) : null, (_a = $slots.default) === null || _a === void 0 ? void 0 :
|
|
50
58
|
_a.call($slots),
|
|
@@ -16,6 +16,8 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
16
16
|
'--n-height': string;
|
|
17
17
|
'--n-color-loading': string;
|
|
18
18
|
'--n-color-error': string;
|
|
19
|
-
}
|
|
19
|
+
}> | undefined;
|
|
20
|
+
themeClass: import("vue").Ref<string> | undefined;
|
|
21
|
+
onRender: (() => void) | undefined;
|
|
20
22
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
21
23
|
export default _default;
|
|
@@ -8,7 +8,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
10
|
import { h, Transition, computed, defineComponent, inject, withDirectives, vShow, ref, nextTick } from 'vue';
|
|
11
|
-
import { useTheme } from '../../_mixins';
|
|
11
|
+
import { useConfig, useTheme, useThemeClass } from '../../_mixins';
|
|
12
12
|
import { loadingBarLight } from '../styles';
|
|
13
13
|
import { loadingBarProviderInjectionKey } from './context';
|
|
14
14
|
import style from './styles/index.cssr';
|
|
@@ -17,7 +17,8 @@ function createClassName(status, clsPrefix) {
|
|
|
17
17
|
}
|
|
18
18
|
export default defineComponent({
|
|
19
19
|
name: 'LoadingBar',
|
|
20
|
-
setup() {
|
|
20
|
+
setup(props) {
|
|
21
|
+
const { inlineThemeDisabled } = useConfig();
|
|
21
22
|
const { props: providerProps, mergedClsPrefixRef
|
|
22
23
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
23
24
|
} = inject(loadingBarProviderInjectionKey);
|
|
@@ -111,6 +112,17 @@ export default defineComponent({
|
|
|
111
112
|
});
|
|
112
113
|
}
|
|
113
114
|
const themeRef = useTheme('LoadingBar', '-loading-bar', style, loadingBarLight, providerProps, mergedClsPrefixRef);
|
|
115
|
+
const cssVarsRef = computed(() => {
|
|
116
|
+
const { self: { height, colorError, colorLoading } } = themeRef.value;
|
|
117
|
+
return {
|
|
118
|
+
'--n-height': height,
|
|
119
|
+
'--n-color-loading': colorLoading,
|
|
120
|
+
'--n-color-error': colorError
|
|
121
|
+
};
|
|
122
|
+
});
|
|
123
|
+
const themeClassHandle = inlineThemeDisabled
|
|
124
|
+
? useThemeClass('loading-bar', undefined, cssVarsRef, providerProps)
|
|
125
|
+
: undefined;
|
|
114
126
|
return {
|
|
115
127
|
mergedClsPrefix: mergedClsPrefixRef,
|
|
116
128
|
loadingBarRef,
|
|
@@ -125,14 +137,9 @@ export default defineComponent({
|
|
|
125
137
|
handleAfterEnter,
|
|
126
138
|
handleAfterLeave,
|
|
127
139
|
mergedLoadingBarStyle,
|
|
128
|
-
cssVars:
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
'--n-height': height,
|
|
132
|
-
'--n-color-loading': colorLoading,
|
|
133
|
-
'--n-color-error': colorError
|
|
134
|
-
};
|
|
135
|
-
})
|
|
140
|
+
cssVars: inlineThemeDisabled ? undefined : cssVarsRef,
|
|
141
|
+
themeClass: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.themeClass,
|
|
142
|
+
onRender: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.onRender
|
|
136
143
|
};
|
|
137
144
|
},
|
|
138
145
|
render() {
|
|
@@ -140,11 +147,18 @@ export default defineComponent({
|
|
|
140
147
|
return null;
|
|
141
148
|
const { mergedClsPrefix } = this;
|
|
142
149
|
return (h(Transition, { name: "fade-in-transition", appear: true, onEnter: this.handleEnter, onAfterEnter: this.handleAfterEnter, onAfterLeave: this.handleAfterLeave, css: !this.transitionDisabled }, {
|
|
143
|
-
default: () =>
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
150
|
+
default: () => {
|
|
151
|
+
var _a;
|
|
152
|
+
(_a = this.onRender) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
153
|
+
return withDirectives(h("div", { class: [
|
|
154
|
+
`${mergedClsPrefix}-loading-bar-container`,
|
|
155
|
+
this.themeClass
|
|
156
|
+
] },
|
|
157
|
+
h("div", { ref: "loadingBarRef", class: [`${mergedClsPrefix}-loading-bar`], style: [
|
|
158
|
+
this.cssVars,
|
|
159
|
+
this.mergedLoadingBarStyle
|
|
160
|
+
] })), [[vShow, this.loading || (!this.loading && this.entering)]]);
|
|
161
|
+
}
|
|
148
162
|
}));
|
|
149
163
|
}
|
|
150
164
|
});
|
package/es/log/src/Log.d.ts
CHANGED
|
@@ -244,6 +244,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
244
244
|
}, {
|
|
245
245
|
mergedClsPrefix: import("vue").ComputedRef<string>;
|
|
246
246
|
scrollbarRef: Ref<{
|
|
247
|
+
$el: HTMLElement;
|
|
247
248
|
containerRef: HTMLElement | null;
|
|
248
249
|
contentRef: HTMLElement | null;
|
|
249
250
|
containerScrollTop: number;
|
|
@@ -316,9 +316,7 @@ export default defineComponent({
|
|
|
316
316
|
};
|
|
317
317
|
},
|
|
318
318
|
render() {
|
|
319
|
-
var _a;
|
|
320
319
|
const { mergedTheme, mergedClsPrefix, $slots } = this;
|
|
321
|
-
(_a = this.onRender) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
322
320
|
return (h("div", { class: `${mergedClsPrefix}-mention` },
|
|
323
321
|
h(NInput, { status: this.mergedStatus, themeOverrides: mergedTheme.peerOverrides.Input, theme: mergedTheme.peers.Input, size: this.mergedSize, autosize: this.autosize, type: this.type, ref: "inputInstRef", placeholder: this.placeholder, onMousedown: this.handleInputMouseDown, onUpdateValue: this.handleInputUpdateValue, onKeydown: this.handleInputKeyDown, onFocus: this.handleInputFocus, onBlur: this.handleInputBlur, bordered: this.mergedBordered, disabled: this.disabled, value: this.mergedValue }),
|
|
324
322
|
h(VBinder, null, {
|
|
@@ -341,8 +339,12 @@ export default defineComponent({
|
|
|
341
339
|
h(VFollower, { ref: "followerRef", placement: this.placement, show: this.showMenu, containerClass: this.namespace, to: this.adjustedTo, teleportDisabled: this.adjustedTo === useAdjustedTo.tdkey }, {
|
|
342
340
|
default: () => (h(Transition, { name: "fade-in-scale-up-transition", appear: this.isMounted }, {
|
|
343
341
|
default: () => {
|
|
344
|
-
const { mergedTheme } = this;
|
|
345
|
-
|
|
342
|
+
const { mergedTheme, onRender } = this;
|
|
343
|
+
onRender === null || onRender === void 0 ? void 0 : onRender();
|
|
344
|
+
return this.showMenu ? (h(NInternalSelectMenu, { clsPrefix: mergedClsPrefix, theme: mergedTheme.peers.InternalSelectMenu, themeOverrides: mergedTheme.peerOverrides.InternalSelectMenu, autoPending: true, ref: "selectMenuInstRef", class: [
|
|
345
|
+
`${mergedClsPrefix}-mention-menu`,
|
|
346
|
+
this.themeClass
|
|
347
|
+
], loading: this.loading, treeMate: this.treeMate, virtualScroll: false, style: this.cssVars, onToggle: this.handleSelect, renderLabel: this.renderLabel }, $slots)) : null;
|
|
346
348
|
}
|
|
347
349
|
}))
|
|
348
350
|
})
|
|
@@ -8,6 +8,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
8
8
|
readonly default: "info";
|
|
9
9
|
};
|
|
10
10
|
content: PropType<string | number | (() => VNodeChild)>;
|
|
11
|
+
showIcon: {
|
|
12
|
+
readonly type: BooleanConstructor;
|
|
13
|
+
readonly default: true;
|
|
14
|
+
};
|
|
11
15
|
closable: BooleanConstructor;
|
|
12
16
|
keepAliveOnHover: BooleanConstructor;
|
|
13
17
|
onClose: PropType<() => void>;
|
|
@@ -17,30 +21,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
17
21
|
mergedClsPrefix: import("vue").Ref<string>;
|
|
18
22
|
messageProviderProps: import("./MessageProvider").MessageProviderSetupProps;
|
|
19
23
|
handleClose(): void;
|
|
20
|
-
cssVars:
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
'--n-padding': string;
|
|
24
|
-
'--n-max-width': string;
|
|
25
|
-
'--n-font-size': string;
|
|
26
|
-
'--n-icon-margin': string;
|
|
27
|
-
'--n-icon-size': string;
|
|
28
|
-
'--n-close-size': string;
|
|
29
|
-
'--n-close-margin': string;
|
|
30
|
-
'--n-text-color': string;
|
|
31
|
-
'--n-color': string;
|
|
32
|
-
'--n-box-shadow': string;
|
|
33
|
-
'--n-icon-color-info': string;
|
|
34
|
-
'--n-icon-color-success': string;
|
|
35
|
-
'--n-icon-color-warning': string;
|
|
36
|
-
'--n-icon-color-error': string;
|
|
37
|
-
'--n-icon-color-loading': string;
|
|
38
|
-
'--n-close-color': string;
|
|
39
|
-
'--n-close-color-pressed': string;
|
|
40
|
-
'--n-close-color-hover': string;
|
|
41
|
-
'--n-line-height': string;
|
|
42
|
-
'--n-border-radius': string;
|
|
43
|
-
}>;
|
|
24
|
+
cssVars: false | undefined;
|
|
25
|
+
themeClass: import("vue").Ref<string> | undefined;
|
|
26
|
+
onRender: (() => void) | undefined;
|
|
44
27
|
placement: "bottom" | "top" | "top-left" | "top-right" | "bottom-left" | "bottom-right";
|
|
45
28
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
46
29
|
render: PropType<MessageRenderMessage>;
|
|
@@ -50,6 +33,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
50
33
|
readonly default: "info";
|
|
51
34
|
};
|
|
52
35
|
content: PropType<string | number | (() => VNodeChild)>;
|
|
36
|
+
showIcon: {
|
|
37
|
+
readonly type: BooleanConstructor;
|
|
38
|
+
readonly default: true;
|
|
39
|
+
};
|
|
53
40
|
closable: BooleanConstructor;
|
|
54
41
|
keepAliveOnHover: BooleanConstructor;
|
|
55
42
|
onClose: PropType<() => void>;
|
|
@@ -57,6 +44,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
57
44
|
onMouseleave: PropType<(e: MouseEvent) => void>;
|
|
58
45
|
}>>, {
|
|
59
46
|
type: MessageType;
|
|
47
|
+
showIcon: boolean;
|
|
60
48
|
closable: boolean;
|
|
61
49
|
keepAliveOnHover: boolean;
|
|
62
50
|
}>;
|
|
@@ -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
|
}
|