@koi-design/uxd-ui 14.0.2 → 14.0.4
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/components/Alert/Alert.mjs +10 -24
- package/es/components/Alert/Alert.mjs.map +1 -1
- package/es/components/Alert/Alert.type.d.ts +5 -7
- package/es/components/Alert/Alert.type.mjs +4 -7
- package/es/components/Alert/Alert.type.mjs.map +1 -1
- package/es/components/Alert/Alert.vue.d.ts +5 -15
- package/es/components/Alert/index.d.ts +9 -27
- package/es/components/Alert/index.mjs +1 -1
- package/es/components/Badge/Badge.mjs +3 -5
- package/es/components/Badge/Badge.mjs.map +1 -1
- package/es/components/Calendar/Calendar.vue.d.ts +2 -2
- package/es/components/Calendar/index.d.ts +6 -6
- package/es/components/DatePicker/DatePicker.vue.d.ts +14 -14
- package/es/components/DatePicker/Panel/DatePickerPanel.vue.d.ts +4 -4
- package/es/components/DatePicker/Panel/DateRangePanel.vue.d.ts +6 -6
- package/es/components/DatePicker/Panel/RangePart.vue.d.ts +2 -2
- package/es/components/DatePicker/Trigger/DateRangeInput.vue.d.ts +4 -4
- package/es/components/DatePicker/index.d.ts +28 -28
- package/es/components/Drawer/Drawer.d.ts +9 -0
- package/es/components/Drawer/Drawer.mjs +10 -8
- package/es/components/Drawer/Drawer.mjs.map +1 -1
- package/es/components/Drawer/Drawer.type.d.ts +4 -0
- package/es/components/Drawer/Drawer.type.mjs +4 -0
- package/es/components/Drawer/Drawer.type.mjs.map +1 -1
- package/es/components/Drawer/index.d.ts +15 -0
- package/es/components/Mask/Mask.d.ts +2 -1
- package/es/components/Mask/Mask.mjs +6 -2
- package/es/components/Mask/Mask.mjs.map +1 -1
- package/es/components/Mask/index.d.ts +5 -2
- package/es/components/Menu/MenuItem.vue.d.ts +33 -33
- package/es/components/Menu/index.d.ts +33 -33
- package/es/components/Message/Message.mjs +4 -3
- package/es/components/Message/Message.mjs.map +1 -1
- package/es/components/Message/Message.type.d.ts +1 -0
- package/es/components/Notice/Notice.mjs +15 -13
- package/es/components/Notice/Notice.mjs.map +1 -1
- package/es/components/Notice/Notice.type.d.ts +3 -2
- package/es/components/Notification/Notice.mjs +1 -5
- package/es/components/Notification/Notice.mjs.map +1 -1
- package/es/components/Notification/Notification.mjs.map +1 -1
- package/es/components/Rate/Rate.vue.d.ts +33 -33
- package/es/components/Rate/index.d.ts +66 -66
- package/es/components/Slider/Slider.d.ts +0 -20
- package/es/components/Slider/Slider.mjs +1 -2
- package/es/components/Slider/Slider.mjs.map +1 -1
- package/es/components/Slider/Slider.type.d.ts +0 -9
- package/es/components/Slider/Slider.type.mjs +0 -13
- package/es/components/Slider/Slider.type.mjs.map +1 -1
- package/es/components/Slider/index.d.ts +0 -33
- package/es/components/Statistic/Statistic.vue.d.ts +33 -33
- package/es/components/Statistic/index.d.ts +66 -66
- package/es/components/Table/BaseTable.vue.d.ts +132 -132
- package/es/components/Table/BodyTable.vue.d.ts +132 -132
- package/es/components/Table/HeadTable.vue.d.ts +132 -132
- package/es/components/Table/Table.vue.d.ts +264 -264
- package/es/components/Table/TableBox.vue.d.ts +264 -264
- package/es/components/Table/tableUnits/ExpandRows.vue.d.ts +33 -33
- package/es/components/Table/tableUnits/FilterDropdown.vue.d.ts +66 -66
- package/es/components/Table/tableUnits/SelectionCheckAll.vue.d.ts +66 -66
- package/es/components/Table/tableUnits/TableBody.vue.d.ts +66 -66
- package/es/components/Table/tableUnits/TableCell.vue.d.ts +33 -33
- package/es/components/Table/tableUnits/TableHeader.vue.d.ts +66 -66
- package/es/components/Table/tableUnits/TableHeaderRow.vue.d.ts +66 -66
- package/es/components/Table/tableUnits/TableRow.vue.d.ts +33 -33
- package/es/components/Tag/Tag.mjs +6 -9
- package/es/components/Tag/Tag.mjs.map +1 -1
- package/es/components/Tag/Tag.type.d.ts +0 -4
- package/es/components/Tag/Tag.type.mjs +0 -4
- package/es/components/Tag/Tag.type.mjs.map +1 -1
- package/es/components/Tag/Tag.vue.d.ts +7 -20
- package/es/components/Tag/index.d.ts +21 -48
- package/es/components/ThemePanel/ThemePanel.vue.d.ts +33 -33
- package/es/components/ThemePanel/index.d.ts +66 -66
- package/es/components/TimePicker/Panel/TimeRangePane.vue.d.ts +4 -4
- package/es/components/TimePicker/TimePicker.vue.d.ts +12 -12
- package/es/components/TimePicker/Trigger/TimeRangeInput.vue.d.ts +4 -4
- package/es/components/TimePicker/index.d.ts +28 -28
- package/es/components/Tooltip/Tooltip.mjs +84 -8
- package/es/components/Tooltip/Tooltip.mjs.map +1 -1
- package/es/components/Tooltip/Tooltip.type.d.ts +2 -2
- package/es/components/Tooltip/Tooltip.type.mjs +1 -3
- package/es/components/Tooltip/Tooltip.type.mjs.map +1 -1
- package/es/components/Tooltip/Tooltip.vue.d.ts +13 -13
- package/es/components/Tooltip/index.d.ts +33 -33
- package/es/components/TreeSelect/TreeSelect.vue.d.ts +1 -1
- package/es/components/TreeSelect/index.d.ts +3 -3
- package/es/components/index.mjs +1 -1
- package/es/index.mjs +1 -1
- package/lib/components/Alert/Alert.js +9 -23
- package/lib/components/Alert/Alert.js.map +1 -1
- package/lib/components/Alert/Alert.type.d.ts +5 -7
- package/lib/components/Alert/Alert.type.js +4 -6
- package/lib/components/Alert/Alert.type.js.map +1 -1
- package/lib/components/Alert/Alert.vue.d.ts +5 -15
- package/lib/components/Alert/index.d.ts +9 -27
- package/lib/components/Alert/index.js +1 -0
- package/lib/components/Alert/index.js.map +1 -1
- package/lib/components/Badge/Badge.js +3 -5
- package/lib/components/Badge/Badge.js.map +1 -1
- package/lib/components/Calendar/Calendar.vue.d.ts +2 -2
- package/lib/components/Calendar/index.d.ts +6 -6
- package/lib/components/DatePicker/DatePicker.vue.d.ts +14 -14
- package/lib/components/DatePicker/Panel/DatePickerPanel.vue.d.ts +4 -4
- package/lib/components/DatePicker/Panel/DateRangePanel.vue.d.ts +6 -6
- package/lib/components/DatePicker/Panel/RangePart.vue.d.ts +2 -2
- package/lib/components/DatePicker/Trigger/DateRangeInput.vue.d.ts +4 -4
- package/lib/components/DatePicker/index.d.ts +28 -28
- package/lib/components/Drawer/Drawer.d.ts +9 -0
- package/lib/components/Drawer/Drawer.js +10 -8
- package/lib/components/Drawer/Drawer.js.map +1 -1
- package/lib/components/Drawer/Drawer.type.d.ts +4 -0
- package/lib/components/Drawer/Drawer.type.js +4 -0
- package/lib/components/Drawer/Drawer.type.js.map +1 -1
- package/lib/components/Drawer/index.d.ts +15 -0
- package/lib/components/Mask/Mask.d.ts +2 -1
- package/lib/components/Mask/Mask.js +6 -2
- package/lib/components/Mask/Mask.js.map +1 -1
- package/lib/components/Mask/index.d.ts +5 -2
- package/lib/components/Menu/MenuItem.vue.d.ts +33 -33
- package/lib/components/Menu/index.d.ts +33 -33
- package/lib/components/Message/Message.js +4 -3
- package/lib/components/Message/Message.js.map +1 -1
- package/lib/components/Message/Message.type.d.ts +1 -0
- package/lib/components/Notice/Notice.js +15 -13
- package/lib/components/Notice/Notice.js.map +1 -1
- package/lib/components/Notice/Notice.type.d.ts +3 -2
- package/lib/components/Notification/Notice.js +1 -5
- package/lib/components/Notification/Notice.js.map +1 -1
- package/lib/components/Notification/Notification.js.map +1 -1
- package/lib/components/Rate/Rate.vue.d.ts +33 -33
- package/lib/components/Rate/index.d.ts +66 -66
- package/lib/components/Slider/Slider.d.ts +0 -20
- package/lib/components/Slider/Slider.js +1 -2
- package/lib/components/Slider/Slider.js.map +1 -1
- package/lib/components/Slider/Slider.type.d.ts +0 -9
- package/lib/components/Slider/Slider.type.js +0 -13
- package/lib/components/Slider/Slider.type.js.map +1 -1
- package/lib/components/Slider/index.d.ts +0 -33
- package/lib/components/Statistic/Statistic.vue.d.ts +33 -33
- package/lib/components/Statistic/index.d.ts +66 -66
- package/lib/components/Table/BaseTable.vue.d.ts +132 -132
- package/lib/components/Table/BodyTable.vue.d.ts +132 -132
- package/lib/components/Table/HeadTable.vue.d.ts +132 -132
- package/lib/components/Table/Table.vue.d.ts +264 -264
- package/lib/components/Table/TableBox.vue.d.ts +264 -264
- package/lib/components/Table/tableUnits/ExpandRows.vue.d.ts +33 -33
- package/lib/components/Table/tableUnits/FilterDropdown.vue.d.ts +66 -66
- package/lib/components/Table/tableUnits/SelectionCheckAll.vue.d.ts +66 -66
- package/lib/components/Table/tableUnits/TableBody.vue.d.ts +66 -66
- package/lib/components/Table/tableUnits/TableCell.vue.d.ts +33 -33
- package/lib/components/Table/tableUnits/TableHeader.vue.d.ts +66 -66
- package/lib/components/Table/tableUnits/TableHeaderRow.vue.d.ts +66 -66
- package/lib/components/Table/tableUnits/TableRow.vue.d.ts +33 -33
- package/lib/components/Tag/Tag.js +6 -9
- package/lib/components/Tag/Tag.js.map +1 -1
- package/lib/components/Tag/Tag.type.d.ts +0 -4
- package/lib/components/Tag/Tag.type.js +0 -4
- package/lib/components/Tag/Tag.type.js.map +1 -1
- package/lib/components/Tag/Tag.vue.d.ts +7 -20
- package/lib/components/Tag/index.d.ts +21 -48
- package/lib/components/ThemePanel/ThemePanel.vue.d.ts +33 -33
- package/lib/components/ThemePanel/index.d.ts +66 -66
- package/lib/components/TimePicker/Panel/TimeRangePane.vue.d.ts +4 -4
- package/lib/components/TimePicker/TimePicker.vue.d.ts +12 -12
- package/lib/components/TimePicker/Trigger/TimeRangeInput.vue.d.ts +4 -4
- package/lib/components/TimePicker/index.d.ts +28 -28
- package/lib/components/Tooltip/Tooltip.js +84 -8
- package/lib/components/Tooltip/Tooltip.js.map +1 -1
- package/lib/components/Tooltip/Tooltip.type.d.ts +2 -2
- package/lib/components/Tooltip/Tooltip.type.js +1 -3
- package/lib/components/Tooltip/Tooltip.type.js.map +1 -1
- package/lib/components/Tooltip/Tooltip.vue.d.ts +13 -13
- package/lib/components/Tooltip/index.d.ts +33 -33
- package/lib/components/TreeSelect/TreeSelect.vue.d.ts +1 -1
- package/lib/components/TreeSelect/index.d.ts +3 -3
- package/lib/components/index.js +1 -0
- package/lib/components/index.js.map +1 -1
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/package.json +1 -1
- package/styles/components/alert/index.css +1 -1
- package/styles/components/alert/index.less +51 -48
- package/styles/components/alert/var.less +8 -42
- package/styles/components/autoComplete/index.css +1 -1
- package/styles/components/avatar/index.css +1 -1
- package/styles/components/badge/index.css +1 -1
- package/styles/components/badge/index.less +14 -48
- package/styles/components/badge/var.less +7 -17
- package/styles/components/button/index.css +1 -1
- package/styles/components/carousel/index.css +1 -1
- package/styles/components/cascader/index.css +1 -1
- package/styles/components/datePicker/index.css +1 -1
- package/styles/components/drawer/index.css +1 -1
- package/styles/components/drawer/index.less +43 -49
- package/styles/components/drawer/var.less +7 -20
- package/styles/components/form/index.css +1 -1
- package/styles/components/icon/index.css +1 -1
- package/styles/components/input/index.css +1 -1
- package/styles/components/inputNumber/index.css +1 -1
- package/styles/components/link/index.css +1 -1
- package/styles/components/mentions/index.css +1 -1
- package/styles/components/message/index.css +1 -1
- package/styles/components/message/index.less +63 -30
- package/styles/components/message/var.less +6 -27
- package/styles/components/modal/index.css +1 -1
- package/styles/components/notice/index.css +1 -1
- package/styles/components/notice/index.less +93 -49
- package/styles/components/notice/var.less +10 -33
- package/styles/components/select/index.css +1 -1
- package/styles/components/slider/index.css +1 -1
- package/styles/components/slider/index.less +36 -156
- package/styles/components/slider/var.less +5 -33
- package/styles/components/spin/index.css +1 -1
- package/styles/components/tag/index.css +1 -1
- package/styles/components/tag/index.less +12 -25
- package/styles/components/tag/var.less +26 -84
- package/styles/components/timePicker/index.css +1 -1
- package/styles/components/tooltip/index.css +1 -1
- package/styles/components/tooltip/index.less +3 -55
- package/styles/components/tooltip/var.less +15 -14
- package/styles/cssVariable.css +1 -1
- package/styles/cssVariable.less +8 -10
- package/styles/index.css +1 -1
- package/styles/mixins/index.less +0 -1
- package/types/components/Alert/Alert.type.d.ts +5 -7
- package/types/components/Alert/Alert.vue.d.ts +5 -15
- package/types/components/Alert/index.d.ts +9 -27
- package/types/components/Calendar/Calendar.vue.d.ts +2 -2
- package/types/components/Calendar/index.d.ts +6 -6
- package/types/components/DatePicker/DatePicker.vue.d.ts +14 -14
- package/types/components/DatePicker/Panel/DatePickerPanel.vue.d.ts +4 -4
- package/types/components/DatePicker/Panel/DateRangePanel.vue.d.ts +6 -6
- package/types/components/DatePicker/Panel/RangePart.vue.d.ts +2 -2
- package/types/components/DatePicker/Trigger/DateRangeInput.vue.d.ts +4 -4
- package/types/components/DatePicker/index.d.ts +28 -28
- package/types/components/Drawer/Drawer.d.ts +9 -0
- package/types/components/Drawer/Drawer.type.d.ts +4 -0
- package/types/components/Drawer/index.d.ts +15 -0
- package/types/components/Mask/Mask.d.ts +2 -1
- package/types/components/Mask/index.d.ts +5 -2
- package/types/components/Menu/MenuItem.vue.d.ts +33 -33
- package/types/components/Menu/index.d.ts +33 -33
- package/types/components/Message/Message.type.d.ts +1 -0
- package/types/components/Notice/Notice.type.d.ts +3 -2
- package/types/components/Rate/Rate.vue.d.ts +33 -33
- package/types/components/Rate/index.d.ts +66 -66
- package/types/components/Slider/Slider.d.ts +0 -20
- package/types/components/Slider/Slider.type.d.ts +0 -9
- package/types/components/Slider/index.d.ts +0 -33
- package/types/components/Statistic/Statistic.vue.d.ts +33 -33
- package/types/components/Statistic/index.d.ts +66 -66
- package/types/components/Table/BaseTable.vue.d.ts +132 -132
- package/types/components/Table/BodyTable.vue.d.ts +132 -132
- package/types/components/Table/HeadTable.vue.d.ts +132 -132
- package/types/components/Table/Table.vue.d.ts +264 -264
- package/types/components/Table/TableBox.vue.d.ts +264 -264
- package/types/components/Table/tableUnits/ExpandRows.vue.d.ts +33 -33
- package/types/components/Table/tableUnits/FilterDropdown.vue.d.ts +66 -66
- package/types/components/Table/tableUnits/SelectionCheckAll.vue.d.ts +66 -66
- package/types/components/Table/tableUnits/TableBody.vue.d.ts +66 -66
- package/types/components/Table/tableUnits/TableCell.vue.d.ts +33 -33
- package/types/components/Table/tableUnits/TableHeader.vue.d.ts +66 -66
- package/types/components/Table/tableUnits/TableHeaderRow.vue.d.ts +66 -66
- package/types/components/Table/tableUnits/TableRow.vue.d.ts +33 -33
- package/types/components/Tag/Tag.type.d.ts +0 -4
- package/types/components/Tag/Tag.vue.d.ts +7 -20
- package/types/components/Tag/index.d.ts +21 -48
- package/types/components/ThemePanel/ThemePanel.vue.d.ts +33 -33
- package/types/components/ThemePanel/index.d.ts +66 -66
- package/types/components/TimePicker/Panel/TimeRangePane.vue.d.ts +4 -4
- package/types/components/TimePicker/TimePicker.vue.d.ts +12 -12
- package/types/components/TimePicker/Trigger/TimeRangeInput.vue.d.ts +4 -4
- package/types/components/TimePicker/index.d.ts +28 -28
- package/types/components/Tooltip/Tooltip.type.d.ts +2 -2
- package/types/components/Tooltip/Tooltip.vue.d.ts +13 -13
- package/types/components/Tooltip/index.d.ts +33 -33
- package/types/components/TreeSelect/TreeSelect.vue.d.ts +1 -1
- package/types/components/TreeSelect/index.d.ts +3 -3
- package/uxd-ui.css +1 -1
- package/uxd-ui.esm.min.mjs +6 -6
- package/uxd-ui.esm.mjs +152 -103
- package/uxd-ui.umd.js +151 -101
- package/uxd-ui.umd.min.js +6 -6
- package/styles/mixins/close.less +0 -12
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { X,
|
|
1
|
+
import { X, Terminal, CircleAlert, Info, CircleCheck } from 'lucide-vue-next';
|
|
2
2
|
import { defineComponent, ref, computed, watch, resolveComponent, openBlock, createBlock, Transition, withCtx, createElementBlock, normalizeClass, createVNode, resolveDynamicComponent, createCommentVNode, createElementVNode, renderSlot, toDisplayString } from 'vue';
|
|
3
3
|
import { UIcon } from '../Icon/index.mjs';
|
|
4
4
|
import useGlobalConfig from '../base/hooks/useGlobalConfig.mjs';
|
|
@@ -25,9 +25,10 @@ const _sfc_main = defineComponent({
|
|
|
25
25
|
case "warning":
|
|
26
26
|
return CircleAlert;
|
|
27
27
|
case "error":
|
|
28
|
-
|
|
28
|
+
case "error-outline":
|
|
29
|
+
return CircleAlert;
|
|
29
30
|
default:
|
|
30
|
-
return
|
|
31
|
+
return Terminal;
|
|
31
32
|
}
|
|
32
33
|
});
|
|
33
34
|
const handleClose = (e) => {
|
|
@@ -47,28 +48,15 @@ const _sfc_main = defineComponent({
|
|
|
47
48
|
props.afterClose();
|
|
48
49
|
}
|
|
49
50
|
};
|
|
50
|
-
const computedColor = computed(() => {
|
|
51
|
-
switch (props.type) {
|
|
52
|
-
case "info":
|
|
53
|
-
case "error":
|
|
54
|
-
case "warning":
|
|
55
|
-
case "success":
|
|
56
|
-
return props.type;
|
|
57
|
-
default:
|
|
58
|
-
return void 0;
|
|
59
|
-
}
|
|
60
|
-
});
|
|
61
51
|
return {
|
|
62
52
|
prefixCls,
|
|
63
53
|
iconType,
|
|
64
54
|
stateVisible,
|
|
65
55
|
handleClose,
|
|
66
|
-
onTransitionOver
|
|
67
|
-
computedColor
|
|
56
|
+
onTransitionOver
|
|
68
57
|
};
|
|
69
58
|
}
|
|
70
59
|
});
|
|
71
|
-
const _hoisted_1 = ["data-color"];
|
|
72
60
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
73
61
|
const _component_UIcon = resolveComponent("UIcon");
|
|
74
62
|
const _component_X = resolveComponent("X");
|
|
@@ -84,11 +72,9 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
84
72
|
`${_ctx.prefixCls}-${_ctx.type}`,
|
|
85
73
|
{
|
|
86
74
|
[`${_ctx.prefixCls}-with-icon`]: _ctx.showIcon,
|
|
87
|
-
[`${_ctx.prefixCls}-with-desc`]: _ctx.description
|
|
88
|
-
[`${_ctx.prefixCls}-with-banner`]: _ctx.banner
|
|
75
|
+
[`${_ctx.prefixCls}-with-desc`]: _ctx.description
|
|
89
76
|
}
|
|
90
|
-
])
|
|
91
|
-
"data-color": _ctx.computedColor
|
|
77
|
+
])
|
|
92
78
|
}, [
|
|
93
79
|
_ctx.showIcon ? (openBlock(), createElementBlock("span", {
|
|
94
80
|
key: 0,
|
|
@@ -101,12 +87,12 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
101
87
|
_: 1
|
|
102
88
|
})
|
|
103
89
|
], 2)) : createCommentVNode("v-if", true),
|
|
104
|
-
createElementVNode("
|
|
90
|
+
createElementVNode("div", {
|
|
105
91
|
class: normalizeClass(`${_ctx.prefixCls}-message`)
|
|
106
92
|
}, [
|
|
107
93
|
renderSlot(_ctx.$slots, "default")
|
|
108
94
|
], 2),
|
|
109
|
-
createElementVNode("
|
|
95
|
+
createElementVNode("div", {
|
|
110
96
|
class: normalizeClass(`${_ctx.prefixCls}-desc`)
|
|
111
97
|
}, toDisplayString(_ctx.description), 3),
|
|
112
98
|
_ctx.closable ? (openBlock(), createElementBlock("a", {
|
|
@@ -123,7 +109,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
123
109
|
})
|
|
124
110
|
])
|
|
125
111
|
], 2)) : createCommentVNode("v-if", true)
|
|
126
|
-
],
|
|
112
|
+
], 2)) : createCommentVNode("v-if", true)
|
|
127
113
|
]),
|
|
128
114
|
_: 3
|
|
129
115
|
}, 8, ["onAfterLeave"]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Alert.mjs","sources":["../../../../src/components/Alert/Alert.vue"],"sourcesContent":["<template>\n <transition name=\"fade\" @after-leave=\"onTransitionOver\">\n <div\n v-if=\"stateVisible\"\n :class=\"[\n prefixCls,\n `${prefixCls}-${type}`,\n {\n [`${prefixCls}-with-icon`]: showIcon,\n [`${prefixCls}-with-desc`]: description
|
|
1
|
+
{"version":3,"file":"Alert.mjs","sources":["../../../../src/components/Alert/Alert.vue"],"sourcesContent":["<template>\n <transition name=\"fade\" @after-leave=\"onTransitionOver\">\n <div\n v-if=\"stateVisible\"\n :class=\"[\n prefixCls,\n `${prefixCls}-${type}`,\n {\n [`${prefixCls}-with-icon`]: showIcon,\n [`${prefixCls}-with-desc`]: description\n }\n ]\"\n >\n <span v-if=\"showIcon\" :class=\"`${prefixCls}-icon`\">\n <UIcon>\n <component :is=\"icon || iconType\" />\n </UIcon>\n </span>\n\n <div :class=\"`${prefixCls}-message`\"><slot /></div>\n <div :class=\"`${prefixCls}-desc`\">{{ description }}</div>\n\n <a v-if=\"closable\" :class=\"`${prefixCls}-close`\" @click=\"handleClose\">\n <slot name=\"close\">\n <UIcon>\n <X />\n </UIcon>\n </slot>\n </a>\n </div>\n </transition>\n</template>\n\n<script lang=\"ts\">\nimport { CircleCheck, Info, CircleAlert, X, Terminal } from 'lucide-vue-next';\nimport { defineComponent, computed, ref, watch } from 'vue';\nimport UIcon from '@uxd-ui/components/Icon';\nimport useGlobalConfig from '../base/hooks/useGlobalConfig';\nimport { alertProps, alertEmits } from './Alert.type';\n\nexport default defineComponent({\n name: 'UAlert',\n components: {\n UIcon,\n X\n },\n props: alertProps,\n emits: alertEmits,\n setup(props, { emit }) {\n const { prefixCls } = useGlobalConfig('alert');\n const stateVisible = ref(props.visible);\n const iconType = computed(() => {\n switch (props.type) {\n case 'success':\n return CircleCheck;\n\n case 'info':\n return Info;\n\n case 'warning':\n return CircleAlert;\n\n case 'error':\n case 'error-outline':\n return CircleAlert;\n\n default:\n return Terminal;\n }\n });\n const handleClose = (e: Event) => {\n e.stopPropagation();\n emit('close', e);\n stateVisible.value = false;\n emit('update:visible', false);\n };\n\n watch(\n () => props.visible,\n (val) => {\n stateVisible.value = val;\n }\n );\n\n const onTransitionOver = () => {\n if (!stateVisible.value && props.afterClose) {\n props.afterClose();\n }\n };\n\n return {\n prefixCls,\n iconType,\n stateVisible,\n handleClose,\n onTransitionOver\n };\n }\n});\n</script>\n"],"names":["_createBlock","_Transition","_createElementBlock","_normalizeClass","_createVNode","_resolveDynamicComponent","_createElementVNode","_renderSlot"],"mappings":";;;;;;;AAwCA,MAAK,YAAa,gBAAa;AAAA,EAC7B,MAAM;AAAA,EACN,YAAY;AAAA,IACV;AAAA,IACA;AAAA;AACF,EACA,OAAO;AAAA,EACP,OAAO;AAAA,EACP,MAAM,OAAO,EAAE,QAAQ;UACf,EAAE,cAAc,gBAAgB,OAAO;UACvC,eAAe,IAAI,MAAM,OAAO;UAChC,WAAW,SAAS,MAAM;cACtB,MAAM;AAAA,aACP;iBACI;AAAA,aAEJ;iBACI;AAAA,aAEJ;iBACI;AAAA,aAEJ;AAAA,aACA;iBACI;AAAA;iBAGA;AAAA;AAAA,KAEZ;UACK,cAAc,CAAC,MAAa;QAC9B;WACG,SAAS,CAAC;mBACF,QAAQ;WAChB,kBAAkB,KAAK;AAAA;;MAI5B,MAAM,MAAM;AAAA,MACZ,CAAC,QAAQ;qBACM,QAAQ;AAAA;AACvB;UAGI,mBAAmB,MAAM;UACzB,CAAC,aAAa,SAAS,MAAM,YAAY;cACrC;AAAW;AACnB;WAGK;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA;AACF;AAEJ,CAAC;;;;sBAjGCA,YA6BaC;IA7BD,MAAK;AAAA,IAAQ,cAAa;;qBACpC,MA2BM;AAAA,MA1BE,kCADRC,mBA2BM;;QAzBH,OAAKC;UAAY;aAAsB,kBAAa;;gBAAgC,6BAAwB;gBAAwB,6BAAwB;;;;QASjJ,8BAAZD,mBAIO;;UAJgB,OAAKC,kBAAK,qBAAS;AAAA;UACxCC,YAEQ;6BADN,MAAoC;AAAA,4BAApCJ,YAAoCK,wBAApB,aAAQ,aAAQ;;;;;QAIpCC,mBAAmD;UAA7C,OAAKH,kBAAK,wBAAS;AAAA;UAAYI,WAAQ;;QAC7CD,mBAAyD;UAAnD,OAAKH,kBAAK,qBAAS;AAAA,2BAAY,gBAAW;QAEvC,8BAATD,mBAMI;;UANgB,OAAKC,kBAAK,sBAAS;AAAA,UAAW,SAAK,uCAAE;;UACvDI,WAIO,0BAJP,MAIO;AAAA,YAHLH,YAEQ;+BADN,MAAK;AAAA,gBAALA,YAAK;;;;;;;;;;;;;;;"}
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import type { ExtractPropTypes, PropType } from 'vue';
|
|
2
2
|
import type { IconPropType } from '../../utils/globalType';
|
|
3
3
|
import type Alert from './Alert.vue';
|
|
4
|
-
export declare const alertType: readonly ["success", "info", "warning", "error"];
|
|
4
|
+
export declare const alertType: readonly ["default", "success", "info", "warning", "error", "error-outline"];
|
|
5
5
|
export declare type AlertType = (typeof alertType)[number];
|
|
6
|
+
export declare const alertVariant: readonly ["surface", "outline"];
|
|
7
|
+
export declare type AlertVariant = (typeof alertVariant)[number];
|
|
6
8
|
export declare const alertProps: {
|
|
7
9
|
type: {
|
|
8
|
-
type: PropType<"error" | "success" | "info" | "warning">;
|
|
9
|
-
validator: (val: "error" | "success" | "info" | "warning") => boolean;
|
|
10
|
+
type: PropType<"error" | "success" | "info" | "warning" | "default" | "error-outline">;
|
|
11
|
+
validator: (val: "error" | "success" | "info" | "warning" | "default" | "error-outline") => boolean;
|
|
10
12
|
default: string;
|
|
11
13
|
};
|
|
12
14
|
closable: {
|
|
@@ -27,10 +29,6 @@ export declare const alertProps: {
|
|
|
27
29
|
type: StringConstructor;
|
|
28
30
|
default: string;
|
|
29
31
|
};
|
|
30
|
-
banner: {
|
|
31
|
-
type: BooleanConstructor;
|
|
32
|
-
default: boolean;
|
|
33
|
-
};
|
|
34
32
|
visible: {
|
|
35
33
|
type: BooleanConstructor;
|
|
36
34
|
default: boolean;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { oneOf } from '../../utils/propsValidators.mjs';
|
|
2
2
|
|
|
3
|
-
const alertType = ["success", "info", "warning", "error"];
|
|
3
|
+
const alertType = ["default", "success", "info", "warning", "error", "error-outline"];
|
|
4
|
+
const alertVariant = ["surface", "outline"];
|
|
4
5
|
const alertProps = {
|
|
5
6
|
type: {
|
|
6
7
|
type: String,
|
|
7
8
|
validator: oneOf(alertType),
|
|
8
|
-
default: "
|
|
9
|
+
default: "default"
|
|
9
10
|
},
|
|
10
11
|
closable: {
|
|
11
12
|
type: Boolean,
|
|
@@ -25,10 +26,6 @@ const alertProps = {
|
|
|
25
26
|
type: String,
|
|
26
27
|
default: ""
|
|
27
28
|
},
|
|
28
|
-
banner: {
|
|
29
|
-
type: Boolean,
|
|
30
|
-
default: false
|
|
31
|
-
},
|
|
32
29
|
visible: {
|
|
33
30
|
type: Boolean,
|
|
34
31
|
default: true
|
|
@@ -39,5 +36,5 @@ const alertEmits = {
|
|
|
39
36
|
"update:visible": (v) => typeof v === "boolean"
|
|
40
37
|
};
|
|
41
38
|
|
|
42
|
-
export { alertEmits, alertProps, alertType };
|
|
39
|
+
export { alertEmits, alertProps, alertType, alertVariant };
|
|
43
40
|
//# sourceMappingURL=Alert.type.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Alert.type.mjs","sources":["../../../../src/components/Alert/Alert.type.ts"],"sourcesContent":["import type { ExtractPropTypes, PropType } from 'vue';\nimport type { IconPropType } from '../../utils/globalType';\nimport { oneOf } from '../../utils/propsValidators';\nimport type Alert from './Alert.vue';\n\nexport const alertType = ['success', 'info', 'warning', 'error'] as const;\n\nexport type AlertType = (typeof alertType)[number];\n\nexport const alertProps = {\n type: {\n type: String as PropType<AlertType>,\n validator: oneOf(alertType),\n default: '
|
|
1
|
+
{"version":3,"file":"Alert.type.mjs","sources":["../../../../src/components/Alert/Alert.type.ts"],"sourcesContent":["import type { ExtractPropTypes, PropType } from 'vue';\nimport type { IconPropType } from '../../utils/globalType';\nimport { oneOf } from '../../utils/propsValidators';\nimport type Alert from './Alert.vue';\n\nexport const alertType = ['default', 'success', 'info', 'warning', 'error', 'error-outline'] as const;\n\nexport type AlertType = (typeof alertType)[number];\n\nexport const alertVariant = ['surface', 'outline'] as const;\n\nexport type AlertVariant = (typeof alertVariant)[number];\n\nexport const alertProps = {\n type: {\n type: String as PropType<AlertType>,\n validator: oneOf(alertType),\n default: 'default'\n },\n closable: {\n type: Boolean,\n default: false\n },\n afterClose: {\n type: Function as PropType<() => void>\n },\n showIcon: {\n type: Boolean,\n default: false\n },\n icon: {\n type: [String, Object] as PropType<IconPropType>\n },\n description: {\n type: String,\n default: ''\n },\n visible: {\n type: Boolean,\n default: true\n }\n};\n\nexport type AlertProps = ExtractPropTypes<typeof alertProps>;\n\nexport const alertEmits = {\n close: (e: Event) => e instanceof Event,\n 'update:visible': (v: boolean) => typeof v === 'boolean'\n};\n\nexport type AlertInstanceType = InstanceType<typeof Alert>;\n"],"names":[],"mappings":";;MAKa,YAAY,CAAC,WAAW,WAAW,QAAQ,WAAW,SAAS,eAAe;MAI9E,eAAe,CAAC,WAAW,SAAS;MAIpC,aAAa;AAAA,EACxB,MAAM;AAAA,IACJ,MAAM;AAAA,IACN,WAAW,MAAM,SAAS;AAAA,IAC1B,SAAS;AAAA;AACX,EACA,UAAU;AAAA,IACR,MAAM;AAAA,IACN,SAAS;AAAA;AACX,EACA,YAAY;AAAA,IACV,MAAM;AAAA;AACR,EACA,UAAU;AAAA,IACR,MAAM;AAAA,IACN,SAAS;AAAA;AACX,EACA,MAAM;AAAA,IACJ,MAAM,CAAC,QAAQ,MAAM;AAAA;AACvB,EACA,aAAa;AAAA,IACX,MAAM;AAAA,IACN,SAAS;AAAA;AACX,EACA,SAAS;AAAA,IACP,MAAM;AAAA,IACN,SAAS;AAAA;AAEb;MAIa,aAAa;AAAA,EACxB,OAAO,CAAC,MAAa,aAAa;AAAA,EAClC,kBAAkB,CAAC,MAAe,OAAO,MAAM;AACjD;;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
2
2
|
type: {
|
|
3
|
-
type: import("vue").PropType<"error" | "success" | "info" | "warning">;
|
|
4
|
-
validator: (val: "error" | "success" | "info" | "warning") => boolean;
|
|
3
|
+
type: import("vue").PropType<"error" | "success" | "info" | "warning" | "default" | "error-outline">;
|
|
4
|
+
validator: (val: "error" | "success" | "info" | "warning" | "default" | "error-outline") => boolean;
|
|
5
5
|
default: string;
|
|
6
6
|
};
|
|
7
7
|
closable: {
|
|
@@ -22,10 +22,6 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
22
22
|
type: StringConstructor;
|
|
23
23
|
default: string;
|
|
24
24
|
};
|
|
25
|
-
banner: {
|
|
26
|
-
type: BooleanConstructor;
|
|
27
|
-
default: boolean;
|
|
28
|
-
};
|
|
29
25
|
visible: {
|
|
30
26
|
type: BooleanConstructor;
|
|
31
27
|
default: boolean;
|
|
@@ -36,14 +32,13 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
36
32
|
stateVisible: import("vue").Ref<boolean, boolean>;
|
|
37
33
|
handleClose: (e: Event) => void;
|
|
38
34
|
onTransitionOver: () => void;
|
|
39
|
-
computedColor: import("vue").ComputedRef<"error" | "success" | "info" | "warning">;
|
|
40
35
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
41
36
|
close: (e: Event) => boolean;
|
|
42
37
|
'update:visible': (v: boolean) => boolean;
|
|
43
38
|
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
44
39
|
type: {
|
|
45
|
-
type: import("vue").PropType<"error" | "success" | "info" | "warning">;
|
|
46
|
-
validator: (val: "error" | "success" | "info" | "warning") => boolean;
|
|
40
|
+
type: import("vue").PropType<"error" | "success" | "info" | "warning" | "default" | "error-outline">;
|
|
41
|
+
validator: (val: "error" | "success" | "info" | "warning" | "default" | "error-outline") => boolean;
|
|
47
42
|
default: string;
|
|
48
43
|
};
|
|
49
44
|
closable: {
|
|
@@ -64,10 +59,6 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
64
59
|
type: StringConstructor;
|
|
65
60
|
default: string;
|
|
66
61
|
};
|
|
67
|
-
banner: {
|
|
68
|
-
type: BooleanConstructor;
|
|
69
|
-
default: boolean;
|
|
70
|
-
};
|
|
71
62
|
visible: {
|
|
72
63
|
type: BooleanConstructor;
|
|
73
64
|
default: boolean;
|
|
@@ -76,11 +67,10 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
76
67
|
onClose?: (e: Event) => any;
|
|
77
68
|
"onUpdate:visible"?: (v: boolean) => any;
|
|
78
69
|
}>, {
|
|
79
|
-
type: "error" | "success" | "info" | "warning";
|
|
70
|
+
type: "error" | "success" | "info" | "warning" | "default" | "error-outline";
|
|
80
71
|
closable: boolean;
|
|
81
72
|
showIcon: boolean;
|
|
82
73
|
description: string;
|
|
83
|
-
banner: boolean;
|
|
84
74
|
visible: boolean;
|
|
85
75
|
}, {}, {
|
|
86
76
|
UIcon: {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export declare const UAlert: {
|
|
2
2
|
new (...args: any[]): import("vue").CreateComponentPublicInstanceWithMixins<Readonly<import("vue").ExtractPropTypes<{
|
|
3
3
|
type: {
|
|
4
|
-
type: import("vue").PropType<"error" | "success" | "info" | "warning">;
|
|
5
|
-
validator: (val: "error" | "success" | "info" | "warning") => boolean;
|
|
4
|
+
type: import("vue").PropType<"error" | "success" | "info" | "warning" | "default" | "error-outline">;
|
|
5
|
+
validator: (val: "error" | "success" | "info" | "warning" | "default" | "error-outline") => boolean;
|
|
6
6
|
default: string;
|
|
7
7
|
};
|
|
8
8
|
closable: {
|
|
@@ -23,10 +23,6 @@ export declare const UAlert: {
|
|
|
23
23
|
type: StringConstructor;
|
|
24
24
|
default: string;
|
|
25
25
|
};
|
|
26
|
-
banner: {
|
|
27
|
-
type: BooleanConstructor;
|
|
28
|
-
default: boolean;
|
|
29
|
-
};
|
|
30
26
|
visible: {
|
|
31
27
|
type: BooleanConstructor;
|
|
32
28
|
default: boolean;
|
|
@@ -40,16 +36,14 @@ export declare const UAlert: {
|
|
|
40
36
|
stateVisible: import("vue").Ref<boolean, boolean>;
|
|
41
37
|
handleClose: (e: Event) => void;
|
|
42
38
|
onTransitionOver: () => void;
|
|
43
|
-
computedColor: import("vue").ComputedRef<"error" | "success" | "info" | "warning">;
|
|
44
39
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
45
40
|
close: (e: Event) => boolean;
|
|
46
41
|
'update:visible': (v: boolean) => boolean;
|
|
47
42
|
}, import("vue").PublicProps, {
|
|
48
|
-
type: "error" | "success" | "info" | "warning";
|
|
43
|
+
type: "error" | "success" | "info" | "warning" | "default" | "error-outline";
|
|
49
44
|
closable: boolean;
|
|
50
45
|
showIcon: boolean;
|
|
51
46
|
description: string;
|
|
52
|
-
banner: boolean;
|
|
53
47
|
visible: boolean;
|
|
54
48
|
}, true, {}, {}, {
|
|
55
49
|
UIcon: {
|
|
@@ -193,8 +187,8 @@ export declare const UAlert: {
|
|
|
193
187
|
Defaults: {};
|
|
194
188
|
}, Readonly<import("vue").ExtractPropTypes<{
|
|
195
189
|
type: {
|
|
196
|
-
type: import("vue").PropType<"error" | "success" | "info" | "warning">;
|
|
197
|
-
validator: (val: "error" | "success" | "info" | "warning") => boolean;
|
|
190
|
+
type: import("vue").PropType<"error" | "success" | "info" | "warning" | "default" | "error-outline">;
|
|
191
|
+
validator: (val: "error" | "success" | "info" | "warning" | "default" | "error-outline") => boolean;
|
|
198
192
|
default: string;
|
|
199
193
|
};
|
|
200
194
|
closable: {
|
|
@@ -215,10 +209,6 @@ export declare const UAlert: {
|
|
|
215
209
|
type: StringConstructor;
|
|
216
210
|
default: string;
|
|
217
211
|
};
|
|
218
|
-
banner: {
|
|
219
|
-
type: BooleanConstructor;
|
|
220
|
-
default: boolean;
|
|
221
|
-
};
|
|
222
212
|
visible: {
|
|
223
213
|
type: BooleanConstructor;
|
|
224
214
|
default: boolean;
|
|
@@ -232,13 +222,11 @@ export declare const UAlert: {
|
|
|
232
222
|
stateVisible: import("vue").Ref<boolean, boolean>;
|
|
233
223
|
handleClose: (e: Event) => void;
|
|
234
224
|
onTransitionOver: () => void;
|
|
235
|
-
computedColor: import("vue").ComputedRef<"error" | "success" | "info" | "warning">;
|
|
236
225
|
}, {}, {}, {}, {
|
|
237
|
-
type: "error" | "success" | "info" | "warning";
|
|
226
|
+
type: "error" | "success" | "info" | "warning" | "default" | "error-outline";
|
|
238
227
|
closable: boolean;
|
|
239
228
|
showIcon: boolean;
|
|
240
229
|
description: string;
|
|
241
|
-
banner: boolean;
|
|
242
230
|
visible: boolean;
|
|
243
231
|
}>;
|
|
244
232
|
__isFragment?: never;
|
|
@@ -246,8 +234,8 @@ export declare const UAlert: {
|
|
|
246
234
|
__isSuspense?: never;
|
|
247
235
|
} & import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
|
|
248
236
|
type: {
|
|
249
|
-
type: import("vue").PropType<"error" | "success" | "info" | "warning">;
|
|
250
|
-
validator: (val: "error" | "success" | "info" | "warning") => boolean;
|
|
237
|
+
type: import("vue").PropType<"error" | "success" | "info" | "warning" | "default" | "error-outline">;
|
|
238
|
+
validator: (val: "error" | "success" | "info" | "warning" | "default" | "error-outline") => boolean;
|
|
251
239
|
default: string;
|
|
252
240
|
};
|
|
253
241
|
closable: {
|
|
@@ -268,10 +256,6 @@ export declare const UAlert: {
|
|
|
268
256
|
type: StringConstructor;
|
|
269
257
|
default: string;
|
|
270
258
|
};
|
|
271
|
-
banner: {
|
|
272
|
-
type: BooleanConstructor;
|
|
273
|
-
default: boolean;
|
|
274
|
-
};
|
|
275
259
|
visible: {
|
|
276
260
|
type: BooleanConstructor;
|
|
277
261
|
default: boolean;
|
|
@@ -285,16 +269,14 @@ export declare const UAlert: {
|
|
|
285
269
|
stateVisible: import("vue").Ref<boolean, boolean>;
|
|
286
270
|
handleClose: (e: Event) => void;
|
|
287
271
|
onTransitionOver: () => void;
|
|
288
|
-
computedColor: import("vue").ComputedRef<"error" | "success" | "info" | "warning">;
|
|
289
272
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
290
273
|
close: (e: Event) => boolean;
|
|
291
274
|
'update:visible': (v: boolean) => boolean;
|
|
292
275
|
}, string, {
|
|
293
|
-
type: "error" | "success" | "info" | "warning";
|
|
276
|
+
type: "error" | "success" | "info" | "warning" | "default" | "error-outline";
|
|
294
277
|
closable: boolean;
|
|
295
278
|
showIcon: boolean;
|
|
296
279
|
description: string;
|
|
297
|
-
banner: boolean;
|
|
298
280
|
visible: boolean;
|
|
299
281
|
}, {}, string, {}, {
|
|
300
282
|
UIcon: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { withInstall } from '../../utils/install.mjs';
|
|
2
2
|
import Alert from './Alert.mjs';
|
|
3
|
-
export { alertEmits, alertProps, alertType } from './Alert.type.mjs';
|
|
3
|
+
export { alertEmits, alertProps, alertType, alertVariant } from './Alert.type.mjs';
|
|
4
4
|
|
|
5
5
|
const UAlert = withInstall(Alert);
|
|
6
6
|
|
|
@@ -17,13 +17,11 @@ const _sfc_main = defineComponent({
|
|
|
17
17
|
if (props.status) {
|
|
18
18
|
switch (props.status) {
|
|
19
19
|
case "success":
|
|
20
|
-
return "green";
|
|
21
|
-
case "processing":
|
|
22
|
-
return "blue";
|
|
23
20
|
case "error":
|
|
24
|
-
return "red";
|
|
25
21
|
case "warning":
|
|
26
|
-
return
|
|
22
|
+
return props.status;
|
|
23
|
+
case "processing":
|
|
24
|
+
return "primary";
|
|
27
25
|
default:
|
|
28
26
|
return void 0;
|
|
29
27
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Badge.mjs","sources":["../../../../src/components/Badge/Badge.vue"],"sourcesContent":["<template>\n <span v-if=\"dot\" :class=\"prefixCls\">\n <slot />\n <sup v-show=\"badgeShow\" :class=\"`${prefixCls}-dot`\" :style=\"styles\" />\n </span>\n <span v-else-if=\"status || color\" :class=\"prefixCls\" class=\"uui-badge-status\">\n <span\n :class=\"[\n `${prefixCls}-status-dot`,\n {\n [`${prefixCls}-status-default`]: status === 'default',\n [`${prefixCls}-status-color`]: isColorStatus\n }\n ]\"\n :data-color=\"computedColor\"\n :style=\"statusStyles\"\n />\n <span class=\"uui-badge-status-text\">\n <slot name=\"text\">{{ text }}</slot>\n </span>\n </span>\n <span v-else :class=\"prefixCls\">\n <slot />\n <sup\n v-if=\"$slots.count\"\n :style=\"styles\"\n :class=\"[\n `${prefixCls}-count`,\n `${prefixCls}-count-custom`,\n {\n [`${className}`]: !!className\n }\n ]\"\n >\n <slot name=\"count\" />\n </sup>\n <sup\n v-else-if=\"hasCount\"\n v-show=\"badgeShow\"\n :style=\"styles\"\n :class=\"[\n `${prefixCls}-count`,\n {\n [`${className}`]: !!className,\n [`${prefixCls}-count-alone`]: $slots.default === undefined,\n [`${prefixCls}-count-type`]: !!type\n }\n ]\"\n :data-color=\"computedColor\"\n >\n <slot name=\"text\">{{ finalCount }}</slot>\n </sup>\n </span>\n</template>\n\n<script lang=\"ts\">\nimport { defineComponent, computed } from 'vue';\nimport type { CSSProperties } from 'vue';\nimport useGlobalConfig from '../base/hooks/useGlobalConfig';\nimport { badgeProps } from './Badge.type';\nimport type { BadgeStatus, BadgeType } from './Badge.type';\nimport { colorType } from '../../utils/globalType';\n\nconst initColorList = colorType.toString().split(',');\n\nexport default defineComponent({\n name: 'UBadge',\n props: badgeProps,\n setup(props) {\n const { prefixCls } = useGlobalConfig('badge');\n\n const isColorStatus = computed(() => {\n return (!!props.color && initColorList.includes(props.color)) || (!!props.status && props.status !== 'default');\n });\n\n const computedColor = computed(() => {\n if (props.status) {\n switch (props.status as BadgeStatus) {\n case 'success':\n
|
|
1
|
+
{"version":3,"file":"Badge.mjs","sources":["../../../../src/components/Badge/Badge.vue"],"sourcesContent":["<template>\n <span v-if=\"dot\" :class=\"prefixCls\">\n <slot />\n <sup v-show=\"badgeShow\" :class=\"`${prefixCls}-dot`\" :style=\"styles\" />\n </span>\n <span v-else-if=\"status || color\" :class=\"prefixCls\" class=\"uui-badge-status\">\n <span\n :class=\"[\n `${prefixCls}-status-dot`,\n {\n [`${prefixCls}-status-default`]: status === 'default',\n [`${prefixCls}-status-color`]: isColorStatus\n }\n ]\"\n :data-color=\"computedColor\"\n :style=\"statusStyles\"\n />\n <span class=\"uui-badge-status-text\">\n <slot name=\"text\">{{ text }}</slot>\n </span>\n </span>\n <span v-else :class=\"prefixCls\">\n <slot />\n <sup\n v-if=\"$slots.count\"\n :style=\"styles\"\n :class=\"[\n `${prefixCls}-count`,\n `${prefixCls}-count-custom`,\n {\n [`${className}`]: !!className\n }\n ]\"\n >\n <slot name=\"count\" />\n </sup>\n <sup\n v-else-if=\"hasCount\"\n v-show=\"badgeShow\"\n :style=\"styles\"\n :class=\"[\n `${prefixCls}-count`,\n {\n [`${className}`]: !!className,\n [`${prefixCls}-count-alone`]: $slots.default === undefined,\n [`${prefixCls}-count-type`]: !!type\n }\n ]\"\n :data-color=\"computedColor\"\n >\n <slot name=\"text\">{{ finalCount }}</slot>\n </sup>\n </span>\n</template>\n\n<script lang=\"ts\">\nimport { defineComponent, computed } from 'vue';\nimport type { CSSProperties } from 'vue';\nimport useGlobalConfig from '../base/hooks/useGlobalConfig';\nimport { badgeProps } from './Badge.type';\nimport type { BadgeStatus, BadgeType } from './Badge.type';\nimport { colorType } from '../../utils/globalType';\n\nconst initColorList = colorType.toString().split(',');\n\nexport default defineComponent({\n name: 'UBadge',\n props: badgeProps,\n setup(props) {\n const { prefixCls } = useGlobalConfig('badge');\n\n const isColorStatus = computed(() => {\n return (!!props.color && initColorList.includes(props.color)) || (!!props.status && props.status !== 'default');\n });\n\n const computedColor = computed(() => {\n if (props.status) {\n switch (props.status as BadgeStatus) {\n case 'success':\n case 'error':\n case 'warning':\n return props.status;\n case 'processing':\n return 'primary';\n\n default:\n return undefined;\n }\n }\n if (props.color) {\n return props.color && initColorList.includes(props.color) ? props.color : undefined;\n }\n if (props.type) {\n switch (props.type as BadgeType) {\n case 'success':\n case 'primary':\n case 'normal':\n case 'error':\n case 'warning':\n return props.type;\n default:\n return undefined;\n }\n }\n return undefined;\n });\n\n const statusStyles = computed(() => {\n return initColorList.includes(props.color) ? {} : { backgroundColor: props.color };\n });\n\n const styles = computed(() => {\n const style: CSSProperties = {} as CSSProperties;\n if (props.offset && props.offset.length === 2) {\n style.marginTop = `${props.offset[0]}px`;\n style.marginRight = `${props.offset[1]}px`;\n }\n return style;\n });\n\n const finalCount = computed(() => {\n if (props.text !== '') return props.text;\n return props.count !== undefined && Math.floor(props.count) >= Math.floor(props.overflowCount) ? `${props.overflowCount}+` : props.count;\n });\n\n const badgeShow = computed(() => {\n let status = false;\n\n if (props.count) {\n status = Math.floor(props.count) !== 0;\n }\n\n if (props.dot) {\n status = true;\n if (props.count !== undefined) {\n if (Math.floor(props.count) === 0) {\n status = false;\n }\n }\n }\n\n if (props.text !== '') status = true;\n\n return status || props.showZero;\n });\n\n const hasCount = computed(() => {\n if (props.count || props.text !== '') return true;\n if (props.showZero && props.count !== undefined && Math.floor(props.count) === 0) return true;\n return false;\n });\n\n return {\n prefixCls,\n styles,\n badgeShow,\n isColorStatus,\n statusStyles,\n hasCount,\n finalCount,\n computedColor\n };\n }\n});\n</script>\n"],"names":["_createElementBlock","_normalizeClass","_renderSlot","_createElementVNode","_normalizeStyle"],"mappings":"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"}
|
|
@@ -53,7 +53,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
53
53
|
(value: number): Dayjs;
|
|
54
54
|
};
|
|
55
55
|
day: {
|
|
56
|
-
(): 0 | 2 | 1 | 4 | 3 | 5
|
|
56
|
+
(): 0 | 2 | 1 | 6 | 4 | 3 | 5;
|
|
57
57
|
(value: number): Dayjs;
|
|
58
58
|
};
|
|
59
59
|
hour: {
|
|
@@ -142,7 +142,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
142
142
|
(value: number): Dayjs;
|
|
143
143
|
};
|
|
144
144
|
day: {
|
|
145
|
-
(): 0 | 2 | 1 | 4 | 3 | 5
|
|
145
|
+
(): 0 | 2 | 1 | 6 | 4 | 3 | 5;
|
|
146
146
|
(value: number): Dayjs;
|
|
147
147
|
};
|
|
148
148
|
hour: {
|
|
@@ -58,7 +58,7 @@ export declare const UCalendar: {
|
|
|
58
58
|
(value: number): import("dayjs").Dayjs;
|
|
59
59
|
};
|
|
60
60
|
day: {
|
|
61
|
-
(): 0 | 2 | 1 | 4 | 3 | 5
|
|
61
|
+
(): 0 | 2 | 1 | 6 | 4 | 3 | 5;
|
|
62
62
|
(value: number): import("dayjs").Dayjs;
|
|
63
63
|
};
|
|
64
64
|
hour: {
|
|
@@ -147,7 +147,7 @@ export declare const UCalendar: {
|
|
|
147
147
|
(value: number): import("dayjs").Dayjs;
|
|
148
148
|
};
|
|
149
149
|
day: {
|
|
150
|
-
(): 0 | 2 | 1 | 4 | 3 | 5
|
|
150
|
+
(): 0 | 2 | 1 | 6 | 4 | 3 | 5;
|
|
151
151
|
(value: number): import("dayjs").Dayjs;
|
|
152
152
|
};
|
|
153
153
|
hour: {
|
|
@@ -1784,7 +1784,7 @@ export declare const UCalendar: {
|
|
|
1784
1784
|
(value: number): import("dayjs").Dayjs;
|
|
1785
1785
|
};
|
|
1786
1786
|
day: {
|
|
1787
|
-
(): 0 | 2 | 1 | 4 | 3 | 5
|
|
1787
|
+
(): 0 | 2 | 1 | 6 | 4 | 3 | 5;
|
|
1788
1788
|
(value: number): import("dayjs").Dayjs;
|
|
1789
1789
|
};
|
|
1790
1790
|
hour: {
|
|
@@ -1873,7 +1873,7 @@ export declare const UCalendar: {
|
|
|
1873
1873
|
(value: number): import("dayjs").Dayjs;
|
|
1874
1874
|
};
|
|
1875
1875
|
day: {
|
|
1876
|
-
(): 0 | 2 | 1 | 4 | 3 | 5
|
|
1876
|
+
(): 0 | 2 | 1 | 6 | 4 | 3 | 5;
|
|
1877
1877
|
(value: number): import("dayjs").Dayjs;
|
|
1878
1878
|
};
|
|
1879
1879
|
hour: {
|
|
@@ -2022,7 +2022,7 @@ export declare const UCalendar: {
|
|
|
2022
2022
|
(value: number): import("dayjs").Dayjs;
|
|
2023
2023
|
};
|
|
2024
2024
|
day: {
|
|
2025
|
-
(): 0 | 2 | 1 | 4 | 3 | 5
|
|
2025
|
+
(): 0 | 2 | 1 | 6 | 4 | 3 | 5;
|
|
2026
2026
|
(value: number): import("dayjs").Dayjs;
|
|
2027
2027
|
};
|
|
2028
2028
|
hour: {
|
|
@@ -2111,7 +2111,7 @@ export declare const UCalendar: {
|
|
|
2111
2111
|
(value: number): import("dayjs").Dayjs;
|
|
2112
2112
|
};
|
|
2113
2113
|
day: {
|
|
2114
|
-
(): 0 | 2 | 1 | 4 | 3 | 5
|
|
2114
|
+
(): 0 | 2 | 1 | 6 | 4 | 3 | 5;
|
|
2115
2115
|
(value: number): import("dayjs").Dayjs;
|
|
2116
2116
|
};
|
|
2117
2117
|
hour: {
|
|
@@ -763,7 +763,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
763
763
|
(value: number): import("dayjs").Dayjs;
|
|
764
764
|
};
|
|
765
765
|
day: {
|
|
766
|
-
(): 0 | 2 | 1 | 4 | 3 | 5
|
|
766
|
+
(): 0 | 2 | 1 | 6 | 4 | 3 | 5;
|
|
767
767
|
(value: number): import("dayjs").Dayjs;
|
|
768
768
|
};
|
|
769
769
|
hour: {
|
|
@@ -852,7 +852,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
852
852
|
(value: number): import("dayjs").Dayjs;
|
|
853
853
|
};
|
|
854
854
|
day: {
|
|
855
|
-
(): 0 | 2 | 1 | 4 | 3 | 5
|
|
855
|
+
(): 0 | 2 | 1 | 6 | 4 | 3 | 5;
|
|
856
856
|
(value: number): import("dayjs").Dayjs;
|
|
857
857
|
};
|
|
858
858
|
hour: {
|
|
@@ -942,7 +942,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
942
942
|
(value: number): import("dayjs").Dayjs;
|
|
943
943
|
};
|
|
944
944
|
day: {
|
|
945
|
-
(): 0 | 2 | 1 | 4 | 3 | 5
|
|
945
|
+
(): 0 | 2 | 1 | 6 | 4 | 3 | 5;
|
|
946
946
|
(value: number): import("dayjs").Dayjs;
|
|
947
947
|
};
|
|
948
948
|
hour: {
|
|
@@ -1031,7 +1031,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
1031
1031
|
(value: number): import("dayjs").Dayjs;
|
|
1032
1032
|
};
|
|
1033
1033
|
day: {
|
|
1034
|
-
(): 0 | 2 | 1 | 4 | 3 | 5
|
|
1034
|
+
(): 0 | 2 | 1 | 6 | 4 | 3 | 5;
|
|
1035
1035
|
(value: number): import("dayjs").Dayjs;
|
|
1036
1036
|
};
|
|
1037
1037
|
hour: {
|
|
@@ -1370,7 +1370,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
1370
1370
|
(value: number): import("dayjs").Dayjs;
|
|
1371
1371
|
};
|
|
1372
1372
|
day: {
|
|
1373
|
-
(): 0 | 2 | 1 | 4 | 3 | 5
|
|
1373
|
+
(): 0 | 2 | 1 | 6 | 4 | 3 | 5;
|
|
1374
1374
|
(value: number): import("dayjs").Dayjs;
|
|
1375
1375
|
};
|
|
1376
1376
|
hour: {
|
|
@@ -1459,7 +1459,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
1459
1459
|
(value: number): import("dayjs").Dayjs;
|
|
1460
1460
|
};
|
|
1461
1461
|
day: {
|
|
1462
|
-
(): 0 | 2 | 1 | 4 | 3 | 5
|
|
1462
|
+
(): 0 | 2 | 1 | 6 | 4 | 3 | 5;
|
|
1463
1463
|
(value: number): import("dayjs").Dayjs;
|
|
1464
1464
|
};
|
|
1465
1465
|
hour: {
|
|
@@ -1549,7 +1549,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
1549
1549
|
(value: number): import("dayjs").Dayjs;
|
|
1550
1550
|
};
|
|
1551
1551
|
day: {
|
|
1552
|
-
(): 0 | 2 | 1 | 4 | 3 | 5
|
|
1552
|
+
(): 0 | 2 | 1 | 6 | 4 | 3 | 5;
|
|
1553
1553
|
(value: number): import("dayjs").Dayjs;
|
|
1554
1554
|
};
|
|
1555
1555
|
hour: {
|
|
@@ -1638,7 +1638,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
1638
1638
|
(value: number): import("dayjs").Dayjs;
|
|
1639
1639
|
};
|
|
1640
1640
|
day: {
|
|
1641
|
-
(): 0 | 2 | 1 | 4 | 3 | 5
|
|
1641
|
+
(): 0 | 2 | 1 | 6 | 4 | 3 | 5;
|
|
1642
1642
|
(value: number): import("dayjs").Dayjs;
|
|
1643
1643
|
};
|
|
1644
1644
|
hour: {
|
|
@@ -4539,7 +4539,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
4539
4539
|
(value: number): import("dayjs").Dayjs;
|
|
4540
4540
|
};
|
|
4541
4541
|
day: {
|
|
4542
|
-
(): 0 | 2 | 1 | 4 | 3 | 5
|
|
4542
|
+
(): 0 | 2 | 1 | 6 | 4 | 3 | 5;
|
|
4543
4543
|
(value: number): import("dayjs").Dayjs;
|
|
4544
4544
|
};
|
|
4545
4545
|
hour: {
|
|
@@ -4628,7 +4628,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
4628
4628
|
(value: number): import("dayjs").Dayjs;
|
|
4629
4629
|
};
|
|
4630
4630
|
day: {
|
|
4631
|
-
(): 0 | 2 | 1 | 4 | 3 | 5
|
|
4631
|
+
(): 0 | 2 | 1 | 6 | 4 | 3 | 5;
|
|
4632
4632
|
(value: number): import("dayjs").Dayjs;
|
|
4633
4633
|
};
|
|
4634
4634
|
hour: {
|
|
@@ -4718,7 +4718,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
4718
4718
|
(value: number): import("dayjs").Dayjs;
|
|
4719
4719
|
};
|
|
4720
4720
|
day: {
|
|
4721
|
-
(): 0 | 2 | 1 | 4 | 3 | 5
|
|
4721
|
+
(): 0 | 2 | 1 | 6 | 4 | 3 | 5;
|
|
4722
4722
|
(value: number): import("dayjs").Dayjs;
|
|
4723
4723
|
};
|
|
4724
4724
|
hour: {
|
|
@@ -4807,7 +4807,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
4807
4807
|
(value: number): import("dayjs").Dayjs;
|
|
4808
4808
|
};
|
|
4809
4809
|
day: {
|
|
4810
|
-
(): 0 | 2 | 1 | 4 | 3 | 5
|
|
4810
|
+
(): 0 | 2 | 1 | 6 | 4 | 3 | 5;
|
|
4811
4811
|
(value: number): import("dayjs").Dayjs;
|
|
4812
4812
|
};
|
|
4813
4813
|
hour: {
|
|
@@ -5041,7 +5041,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
5041
5041
|
(value: number): import("dayjs").Dayjs;
|
|
5042
5042
|
};
|
|
5043
5043
|
day: {
|
|
5044
|
-
(): 0 | 2 | 1 | 4 | 3 | 5
|
|
5044
|
+
(): 0 | 2 | 1 | 6 | 4 | 3 | 5;
|
|
5045
5045
|
(value: number): import("dayjs").Dayjs;
|
|
5046
5046
|
};
|
|
5047
5047
|
hour: {
|
|
@@ -5130,7 +5130,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
5130
5130
|
(value: number): import("dayjs").Dayjs;
|
|
5131
5131
|
};
|
|
5132
5132
|
day: {
|
|
5133
|
-
(): 0 | 2 | 1 | 4 | 3 | 5
|
|
5133
|
+
(): 0 | 2 | 1 | 6 | 4 | 3 | 5;
|
|
5134
5134
|
(value: number): import("dayjs").Dayjs;
|
|
5135
5135
|
};
|
|
5136
5136
|
hour: {
|