@koi-design/uxd-ui 14.0.2 → 14.0.3
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/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/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/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/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/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/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/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/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/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/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/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/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/var.less +2 -2
- 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/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/spin/index.css +1 -1
- package/styles/components/tag/index.css +1 -1
- package/styles/components/tag/var.less +17 -17
- 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 -9
- package/styles/index.css +1 -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/Menu/MenuItem.vue.d.ts +33 -33
- package/types/components/Menu/index.d.ts +33 -33
- 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/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/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/uxd-ui.css +1 -1
- package/uxd-ui.esm.min.mjs +6 -6
- package/uxd-ui.esm.mjs +122 -64
- package/uxd-ui.umd.js +121 -62
- package/uxd-ui.umd.min.js +6 -6
|
@@ -95,8 +95,8 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
95
95
|
default: boolean;
|
|
96
96
|
};
|
|
97
97
|
color: {
|
|
98
|
-
type: import("vue").PropType<"
|
|
99
|
-
default: "
|
|
98
|
+
type: import("vue").PropType<"light" | "red">;
|
|
99
|
+
default: "light" | "red";
|
|
100
100
|
validator: (val: string) => boolean;
|
|
101
101
|
};
|
|
102
102
|
}>> & Readonly<{
|
|
@@ -108,41 +108,41 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
108
108
|
prefixCls: import("vue").ComputedRef<string>;
|
|
109
109
|
arrowStyle: import("vue").ComputedRef<{
|
|
110
110
|
top: string;
|
|
111
|
+
right: string;
|
|
111
112
|
transform: string;
|
|
112
113
|
bottom?: undefined;
|
|
113
114
|
left?: undefined;
|
|
114
|
-
right?: undefined;
|
|
115
115
|
} | {
|
|
116
116
|
bottom: string;
|
|
117
|
+
right: string;
|
|
117
118
|
transform: string;
|
|
118
119
|
top?: undefined;
|
|
119
120
|
left?: undefined;
|
|
120
|
-
right?: undefined;
|
|
121
121
|
} | {
|
|
122
|
+
top: string;
|
|
122
123
|
left: string;
|
|
123
124
|
transform: string;
|
|
124
|
-
top?: undefined;
|
|
125
|
-
bottom?: undefined;
|
|
126
125
|
right?: undefined;
|
|
126
|
+
bottom?: undefined;
|
|
127
127
|
} | {
|
|
128
|
-
|
|
128
|
+
bottom: string;
|
|
129
|
+
left: string;
|
|
129
130
|
transform: string;
|
|
130
131
|
top?: undefined;
|
|
131
|
-
|
|
132
|
-
left?: undefined;
|
|
132
|
+
right?: undefined;
|
|
133
133
|
} | {
|
|
134
134
|
top?: undefined;
|
|
135
|
+
right?: undefined;
|
|
135
136
|
transform?: undefined;
|
|
136
137
|
bottom?: undefined;
|
|
137
138
|
left?: undefined;
|
|
138
|
-
right?: undefined;
|
|
139
139
|
}>;
|
|
140
140
|
onVisibleChange: (val: boolean) => void;
|
|
141
141
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
142
142
|
'visible-change': (v: boolean) => boolean;
|
|
143
143
|
'update:visible': (v: boolean) => boolean;
|
|
144
144
|
}, import("vue").PublicProps, {
|
|
145
|
-
color: "
|
|
145
|
+
color: "light" | "red";
|
|
146
146
|
offset: number[];
|
|
147
147
|
visible: boolean;
|
|
148
148
|
placement: "top" | "bottom" | "auto" | "auto-start" | "auto-end" | "top-start" | "top-end" | "bottom-start" | "bottom-end" | "right" | "right-start" | "right-end" | "left" | "left-start" | "left-end";
|
|
@@ -396,8 +396,8 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
396
396
|
default: boolean;
|
|
397
397
|
};
|
|
398
398
|
color: {
|
|
399
|
-
type: import("vue").PropType<"
|
|
400
|
-
default: "
|
|
399
|
+
type: import("vue").PropType<"light" | "red">;
|
|
400
|
+
default: "light" | "red";
|
|
401
401
|
validator: (val: string) => boolean;
|
|
402
402
|
};
|
|
403
403
|
}>> & Readonly<{
|
|
@@ -409,38 +409,38 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
409
409
|
prefixCls: import("vue").ComputedRef<string>;
|
|
410
410
|
arrowStyle: import("vue").ComputedRef<{
|
|
411
411
|
top: string;
|
|
412
|
+
right: string;
|
|
412
413
|
transform: string;
|
|
413
414
|
bottom?: undefined;
|
|
414
415
|
left?: undefined;
|
|
415
|
-
right?: undefined;
|
|
416
416
|
} | {
|
|
417
417
|
bottom: string;
|
|
418
|
+
right: string;
|
|
418
419
|
transform: string;
|
|
419
420
|
top?: undefined;
|
|
420
421
|
left?: undefined;
|
|
421
|
-
right?: undefined;
|
|
422
422
|
} | {
|
|
423
|
+
top: string;
|
|
423
424
|
left: string;
|
|
424
425
|
transform: string;
|
|
425
|
-
top?: undefined;
|
|
426
|
-
bottom?: undefined;
|
|
427
426
|
right?: undefined;
|
|
427
|
+
bottom?: undefined;
|
|
428
428
|
} | {
|
|
429
|
-
|
|
429
|
+
bottom: string;
|
|
430
|
+
left: string;
|
|
430
431
|
transform: string;
|
|
431
432
|
top?: undefined;
|
|
432
|
-
|
|
433
|
-
left?: undefined;
|
|
433
|
+
right?: undefined;
|
|
434
434
|
} | {
|
|
435
435
|
top?: undefined;
|
|
436
|
+
right?: undefined;
|
|
436
437
|
transform?: undefined;
|
|
437
438
|
bottom?: undefined;
|
|
438
439
|
left?: undefined;
|
|
439
|
-
right?: undefined;
|
|
440
440
|
}>;
|
|
441
441
|
onVisibleChange: (val: boolean) => void;
|
|
442
442
|
}, {}, {}, {}, {
|
|
443
|
-
color: "
|
|
443
|
+
color: "light" | "red";
|
|
444
444
|
offset: number[];
|
|
445
445
|
visible: boolean;
|
|
446
446
|
placement: "top" | "bottom" | "auto" | "auto-start" | "auto-end" | "top-start" | "top-end" | "bottom-start" | "bottom-end" | "right" | "right-start" | "right-end" | "left" | "left-start" | "left-end";
|
|
@@ -503,8 +503,8 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
503
503
|
default: boolean;
|
|
504
504
|
};
|
|
505
505
|
color: {
|
|
506
|
-
type: import("vue").PropType<"
|
|
507
|
-
default: "
|
|
506
|
+
type: import("vue").PropType<"light" | "red">;
|
|
507
|
+
default: "light" | "red";
|
|
508
508
|
validator: (val: string) => boolean;
|
|
509
509
|
};
|
|
510
510
|
}>> & Readonly<{
|
|
@@ -516,41 +516,41 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
516
516
|
prefixCls: import("vue").ComputedRef<string>;
|
|
517
517
|
arrowStyle: import("vue").ComputedRef<{
|
|
518
518
|
top: string;
|
|
519
|
+
right: string;
|
|
519
520
|
transform: string;
|
|
520
521
|
bottom?: undefined;
|
|
521
522
|
left?: undefined;
|
|
522
|
-
right?: undefined;
|
|
523
523
|
} | {
|
|
524
524
|
bottom: string;
|
|
525
|
+
right: string;
|
|
525
526
|
transform: string;
|
|
526
527
|
top?: undefined;
|
|
527
528
|
left?: undefined;
|
|
528
|
-
right?: undefined;
|
|
529
529
|
} | {
|
|
530
|
+
top: string;
|
|
530
531
|
left: string;
|
|
531
532
|
transform: string;
|
|
532
|
-
top?: undefined;
|
|
533
|
-
bottom?: undefined;
|
|
534
533
|
right?: undefined;
|
|
534
|
+
bottom?: undefined;
|
|
535
535
|
} | {
|
|
536
|
-
|
|
536
|
+
bottom: string;
|
|
537
|
+
left: string;
|
|
537
538
|
transform: string;
|
|
538
539
|
top?: undefined;
|
|
539
|
-
|
|
540
|
-
left?: undefined;
|
|
540
|
+
right?: undefined;
|
|
541
541
|
} | {
|
|
542
542
|
top?: undefined;
|
|
543
|
+
right?: undefined;
|
|
543
544
|
transform?: undefined;
|
|
544
545
|
bottom?: undefined;
|
|
545
546
|
left?: undefined;
|
|
546
|
-
right?: undefined;
|
|
547
547
|
}>;
|
|
548
548
|
onVisibleChange: (val: boolean) => void;
|
|
549
549
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
550
550
|
'visible-change': (v: boolean) => boolean;
|
|
551
551
|
'update:visible': (v: boolean) => boolean;
|
|
552
552
|
}, string, {
|
|
553
|
-
color: "
|
|
553
|
+
color: "light" | "red";
|
|
554
554
|
offset: number[];
|
|
555
555
|
visible: boolean;
|
|
556
556
|
placement: "top" | "bottom" | "auto" | "auto-start" | "auto-end" | "top-start" | "top-end" | "bottom-start" | "bottom-end" | "right" | "right-start" | "right-end" | "left" | "left-start" | "left-end";
|
|
@@ -344,8 +344,8 @@ export declare const UMenu: {
|
|
|
344
344
|
default: boolean;
|
|
345
345
|
};
|
|
346
346
|
color: {
|
|
347
|
-
type: import("vue").PropType<"
|
|
348
|
-
default: "
|
|
347
|
+
type: import("vue").PropType<"light" | "red">;
|
|
348
|
+
default: "light" | "red";
|
|
349
349
|
validator: (val: string) => boolean;
|
|
350
350
|
};
|
|
351
351
|
}>> & Readonly<{
|
|
@@ -357,41 +357,41 @@ export declare const UMenu: {
|
|
|
357
357
|
prefixCls: import("vue").ComputedRef<string>;
|
|
358
358
|
arrowStyle: import("vue").ComputedRef<{
|
|
359
359
|
top: string;
|
|
360
|
+
right: string;
|
|
360
361
|
transform: string;
|
|
361
362
|
bottom?: undefined;
|
|
362
363
|
left?: undefined;
|
|
363
|
-
right?: undefined;
|
|
364
364
|
} | {
|
|
365
365
|
bottom: string;
|
|
366
|
+
right: string;
|
|
366
367
|
transform: string;
|
|
367
368
|
top?: undefined;
|
|
368
369
|
left?: undefined;
|
|
369
|
-
right?: undefined;
|
|
370
370
|
} | {
|
|
371
|
+
top: string;
|
|
371
372
|
left: string;
|
|
372
373
|
transform: string;
|
|
373
|
-
top?: undefined;
|
|
374
|
-
bottom?: undefined;
|
|
375
374
|
right?: undefined;
|
|
375
|
+
bottom?: undefined;
|
|
376
376
|
} | {
|
|
377
|
-
|
|
377
|
+
bottom: string;
|
|
378
|
+
left: string;
|
|
378
379
|
transform: string;
|
|
379
380
|
top?: undefined;
|
|
380
|
-
|
|
381
|
-
left?: undefined;
|
|
381
|
+
right?: undefined;
|
|
382
382
|
} | {
|
|
383
383
|
top?: undefined;
|
|
384
|
+
right?: undefined;
|
|
384
385
|
transform?: undefined;
|
|
385
386
|
bottom?: undefined;
|
|
386
387
|
left?: undefined;
|
|
387
|
-
right?: undefined;
|
|
388
388
|
}>;
|
|
389
389
|
onVisibleChange: (val: boolean) => void;
|
|
390
390
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
391
391
|
'visible-change': (v: boolean) => boolean;
|
|
392
392
|
'update:visible': (v: boolean) => boolean;
|
|
393
393
|
}, import("vue").PublicProps, {
|
|
394
|
-
color: "
|
|
394
|
+
color: "light" | "red";
|
|
395
395
|
offset: number[];
|
|
396
396
|
visible: boolean;
|
|
397
397
|
placement: "top" | "bottom" | "auto" | "auto-start" | "auto-end" | "top-start" | "top-end" | "bottom-start" | "bottom-end" | "right" | "right-start" | "right-end" | "left" | "left-start" | "left-end";
|
|
@@ -645,8 +645,8 @@ export declare const UMenu: {
|
|
|
645
645
|
default: boolean;
|
|
646
646
|
};
|
|
647
647
|
color: {
|
|
648
|
-
type: import("vue").PropType<"
|
|
649
|
-
default: "
|
|
648
|
+
type: import("vue").PropType<"light" | "red">;
|
|
649
|
+
default: "light" | "red";
|
|
650
650
|
validator: (val: string) => boolean;
|
|
651
651
|
};
|
|
652
652
|
}>> & Readonly<{
|
|
@@ -658,38 +658,38 @@ export declare const UMenu: {
|
|
|
658
658
|
prefixCls: import("vue").ComputedRef<string>;
|
|
659
659
|
arrowStyle: import("vue").ComputedRef<{
|
|
660
660
|
top: string;
|
|
661
|
+
right: string;
|
|
661
662
|
transform: string;
|
|
662
663
|
bottom?: undefined;
|
|
663
664
|
left?: undefined;
|
|
664
|
-
right?: undefined;
|
|
665
665
|
} | {
|
|
666
666
|
bottom: string;
|
|
667
|
+
right: string;
|
|
667
668
|
transform: string;
|
|
668
669
|
top?: undefined;
|
|
669
670
|
left?: undefined;
|
|
670
|
-
right?: undefined;
|
|
671
671
|
} | {
|
|
672
|
+
top: string;
|
|
672
673
|
left: string;
|
|
673
674
|
transform: string;
|
|
674
|
-
top?: undefined;
|
|
675
|
-
bottom?: undefined;
|
|
676
675
|
right?: undefined;
|
|
676
|
+
bottom?: undefined;
|
|
677
677
|
} | {
|
|
678
|
-
|
|
678
|
+
bottom: string;
|
|
679
|
+
left: string;
|
|
679
680
|
transform: string;
|
|
680
681
|
top?: undefined;
|
|
681
|
-
|
|
682
|
-
left?: undefined;
|
|
682
|
+
right?: undefined;
|
|
683
683
|
} | {
|
|
684
684
|
top?: undefined;
|
|
685
|
+
right?: undefined;
|
|
685
686
|
transform?: undefined;
|
|
686
687
|
bottom?: undefined;
|
|
687
688
|
left?: undefined;
|
|
688
|
-
right?: undefined;
|
|
689
689
|
}>;
|
|
690
690
|
onVisibleChange: (val: boolean) => void;
|
|
691
691
|
}, {}, {}, {}, {
|
|
692
|
-
color: "
|
|
692
|
+
color: "light" | "red";
|
|
693
693
|
offset: number[];
|
|
694
694
|
visible: boolean;
|
|
695
695
|
placement: "top" | "bottom" | "auto" | "auto-start" | "auto-end" | "top-start" | "top-end" | "bottom-start" | "bottom-end" | "right" | "right-start" | "right-end" | "left" | "left-start" | "left-end";
|
|
@@ -752,8 +752,8 @@ export declare const UMenu: {
|
|
|
752
752
|
default: boolean;
|
|
753
753
|
};
|
|
754
754
|
color: {
|
|
755
|
-
type: import("vue").PropType<"
|
|
756
|
-
default: "
|
|
755
|
+
type: import("vue").PropType<"light" | "red">;
|
|
756
|
+
default: "light" | "red";
|
|
757
757
|
validator: (val: string) => boolean;
|
|
758
758
|
};
|
|
759
759
|
}>> & Readonly<{
|
|
@@ -765,41 +765,41 @@ export declare const UMenu: {
|
|
|
765
765
|
prefixCls: import("vue").ComputedRef<string>;
|
|
766
766
|
arrowStyle: import("vue").ComputedRef<{
|
|
767
767
|
top: string;
|
|
768
|
+
right: string;
|
|
768
769
|
transform: string;
|
|
769
770
|
bottom?: undefined;
|
|
770
771
|
left?: undefined;
|
|
771
|
-
right?: undefined;
|
|
772
772
|
} | {
|
|
773
773
|
bottom: string;
|
|
774
|
+
right: string;
|
|
774
775
|
transform: string;
|
|
775
776
|
top?: undefined;
|
|
776
777
|
left?: undefined;
|
|
777
|
-
right?: undefined;
|
|
778
778
|
} | {
|
|
779
|
+
top: string;
|
|
779
780
|
left: string;
|
|
780
781
|
transform: string;
|
|
781
|
-
top?: undefined;
|
|
782
|
-
bottom?: undefined;
|
|
783
782
|
right?: undefined;
|
|
783
|
+
bottom?: undefined;
|
|
784
784
|
} | {
|
|
785
|
-
|
|
785
|
+
bottom: string;
|
|
786
|
+
left: string;
|
|
786
787
|
transform: string;
|
|
787
788
|
top?: undefined;
|
|
788
|
-
|
|
789
|
-
left?: undefined;
|
|
789
|
+
right?: undefined;
|
|
790
790
|
} | {
|
|
791
791
|
top?: undefined;
|
|
792
|
+
right?: undefined;
|
|
792
793
|
transform?: undefined;
|
|
793
794
|
bottom?: undefined;
|
|
794
795
|
left?: undefined;
|
|
795
|
-
right?: undefined;
|
|
796
796
|
}>;
|
|
797
797
|
onVisibleChange: (val: boolean) => void;
|
|
798
798
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
799
799
|
'visible-change': (v: boolean) => boolean;
|
|
800
800
|
'update:visible': (v: boolean) => boolean;
|
|
801
801
|
}, string, {
|
|
802
|
-
color: "
|
|
802
|
+
color: "light" | "red";
|
|
803
803
|
offset: number[];
|
|
804
804
|
visible: boolean;
|
|
805
805
|
placement: "top" | "bottom" | "auto" | "auto-start" | "auto-end" | "top-start" | "top-end" | "bottom-start" | "bottom-end" | "right" | "right-start" | "right-end" | "left" | "left-start" | "left-end";
|
|
@@ -38,7 +38,8 @@ const getMessageInstance = () => {
|
|
|
38
38
|
const notice = (args) => {
|
|
39
39
|
const {
|
|
40
40
|
type,
|
|
41
|
-
content
|
|
41
|
+
content,
|
|
42
|
+
showIcon = true
|
|
42
43
|
} = args;
|
|
43
44
|
const duration = args.duration !== void 0 ? args.duration : defaultDuration;
|
|
44
45
|
const iconType = iconTypes[type];
|
|
@@ -55,8 +56,8 @@ const notice = (args) => {
|
|
|
55
56
|
background: args.background,
|
|
56
57
|
content: () => vue.createVNode("div", {
|
|
57
58
|
"class": `${prefixCls}-custom-content ${prefixCls}-${type}`,
|
|
58
|
-
"data-
|
|
59
|
-
}, [vue.createVNode(index.UIcon, {
|
|
59
|
+
"data-type": type
|
|
60
|
+
}, [showIcon && vue.createVNode(index.UIcon, {
|
|
60
61
|
"spin": type === "loading"
|
|
61
62
|
}, {
|
|
62
63
|
default: () => [vue.createVNode(iconType, null, null)]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Message.js","sources":["../../../../src/components/Message/Message.tsx"],"sourcesContent":["import type { Component } from 'vue';\nimport Notification from '@uxd-ui/components/Notification';\nimport UIcon from '@uxd-ui/components/Icon';\nimport { Info, CheckCircle, AlertCircle, CircleX, LoaderCircle } from 'lucide-vue-next';\nimport type { NoticationPublicInstance } from '../Notification/Notication.type';\nimport type { MessageOption, MessageParams, MessageType } from './Message.type';\n\nlet prefixCls = 'uui-message';\nconst prefixKey = 'uui_message_key_';\nlet defaultDuration = 3;\nlet defaultTop = '24px';\nlet key = 0;\nlet messageInstance: NoticationPublicInstance | null;\nlet transitionName = 'move-up';\nlet maxCount: number;\n\nconst iconTypes: Record<MessageType, Component> = {\n info: Info,\n success: CheckCircle,\n warning: AlertCircle,\n error: CircleX,\n loading: LoaderCircle\n};\n\nconst getMessageInstance = () => {\n messageInstance =\n messageInstance ||\n (Notification.newInstance({\n prefixCls,\n transitionName,\n style: { top: defaultTop },\n maxCount,\n type: 'message'\n }) as NoticationPublicInstance);\n return messageInstance;\n};\n\nconst notice = (args: MessageParams) => {\n const { type, content } = args;\n const duration = args.duration !== undefined ? args.duration : defaultDuration;\n const iconType = iconTypes[type];\n key += 1;\n const target = args.key || `${prefixKey}${key}`;\n\n const instance = getMessageInstance();\n instance &&\n instance.notice({\n key: target,\n duration,\n style: {},\n msgType: type,\n closable: args.closable,\n onClose: args.onClose,\n background: args.background,\n content: () => (\n <div class={`${prefixCls}-custom-content ${prefixCls}-${type}`} data-
|
|
1
|
+
{"version":3,"file":"Message.js","sources":["../../../../src/components/Message/Message.tsx"],"sourcesContent":["import type { Component } from 'vue';\nimport Notification from '@uxd-ui/components/Notification';\nimport UIcon from '@uxd-ui/components/Icon';\nimport { Info, CheckCircle, AlertCircle, CircleX, LoaderCircle } from 'lucide-vue-next';\nimport type { NoticationPublicInstance } from '../Notification/Notication.type';\nimport type { MessageOption, MessageParams, MessageType } from './Message.type';\n\nlet prefixCls = 'uui-message';\nconst prefixKey = 'uui_message_key_';\nlet defaultDuration = 3;\nlet defaultTop = '24px';\nlet key = 0;\nlet messageInstance: NoticationPublicInstance | null;\nlet transitionName = 'move-up';\nlet maxCount: number;\n\nconst iconTypes: Record<MessageType, Component> = {\n info: Info,\n success: CheckCircle,\n warning: AlertCircle,\n error: CircleX,\n loading: LoaderCircle\n};\n\nconst getMessageInstance = () => {\n messageInstance =\n messageInstance ||\n (Notification.newInstance({\n prefixCls,\n transitionName,\n style: { top: defaultTop },\n maxCount,\n type: 'message'\n }) as NoticationPublicInstance);\n return messageInstance;\n};\n\nconst notice = (args: MessageParams) => {\n const { type, content, showIcon = true } = args;\n const duration = args.duration !== undefined ? args.duration : defaultDuration;\n const iconType = iconTypes[type];\n key += 1;\n const target = args.key || `${prefixKey}${key}`;\n\n const instance = getMessageInstance();\n instance &&\n instance.notice({\n key: target,\n duration,\n style: {},\n msgType: type,\n closable: args.closable,\n onClose: args.onClose,\n background: args.background,\n content: () => (\n <div class={`${prefixCls}-custom-content ${prefixCls}-${type}`} data-type={type}>\n {showIcon && (\n <UIcon spin={type === 'loading'}>\n <iconType />\n </UIcon>\n )}\n <span>{typeof content === 'function' ? content() : content}</span>\n </div>\n )\n });\n\n const result = () => {\n if (messageInstance) {\n messageInstance.remove(target);\n }\n };\n return result;\n};\n\nconst api = {\n config(options: MessageOption) {\n if (options.top !== undefined) {\n defaultTop = options.top;\n messageInstance = null;\n }\n if (options.duration !== undefined) {\n defaultDuration = options.duration;\n messageInstance = null;\n }\n if (options.prefixCls !== undefined) {\n prefixCls = options.prefixCls;\n }\n if (options.transitionName !== undefined) {\n transitionName = options.transitionName;\n messageInstance = null;\n }\n if (options.maxCount !== undefined) {\n maxCount = options.maxCount;\n messageInstance = null;\n }\n },\n message(type: MessageType, options: string | Omit<MessageParams, 'type'>, duration?: number) {\n let opt: MessageParams;\n if (typeof options === 'string') {\n opt = {\n type,\n content: options,\n duration\n };\n } else {\n opt = {\n type,\n ...options,\n ...(duration ? { duration } : {})\n };\n }\n return notice(opt);\n },\n close(closeKey: string) {\n if (messageInstance) {\n messageInstance.remove(closeKey);\n }\n },\n destroy() {\n if (messageInstance) {\n messageInstance.destroy();\n messageInstance = null;\n }\n }\n};\n\nexport type MessageFunction = (options: string | Omit<MessageParams, 'type'>, duration?: number) => () => void;\n\nexport interface Message {\n config(options: MessageOption): void;\n message(type: MessageType, options: string | Omit<MessageParams, 'type'>, duration?: number | undefined): () => void;\n close(closeKey: string): void;\n destroy(): void;\n success: MessageFunction;\n info: MessageFunction;\n error: MessageFunction;\n warning: MessageFunction;\n loading: MessageFunction;\n}\n\n(['success', 'info', 'error', 'warning', 'loading'] as MessageType[]).forEach((type) => {\n (api as Message)[type] = (options: string | Omit<MessageParams, 'type'>, duration?: number) => {\n return api.message(type, options, duration);\n };\n});\n\nexport default api as Message;\n"],"names":["prefixCls","prefixKey","defaultDuration","defaultTop","key","messageInstance","transitionName","maxCount","iconTypes","info","Info","success","CheckCircle","warning","AlertCircle","error","CircleX","loading","LoaderCircle","getMessageInstance","Notification","newInstance","style","top","type","notice","args","content","showIcon","duration","undefined","iconType","target","instance","msgType","closable","onClose","background","_createVNode","UIcon","default","result","remove","api","config","options","message","opt","close","closeKey","destroy","forEach"],"mappings":";;;;;;;;;;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@@ var Notification = require('../Notification/Notification.js');
|
|
|
11
11
|
let prefixCls = "uui-notice";
|
|
12
12
|
const prefixKey = "uui_notice_key_";
|
|
13
13
|
let defaultDuration = 4.5;
|
|
14
|
-
let defaultPlacement = "
|
|
15
|
-
let defaultBottom = "
|
|
16
|
-
let defaultTop = "
|
|
14
|
+
let defaultPlacement = "bottom-right";
|
|
15
|
+
let defaultBottom = "0px";
|
|
16
|
+
let defaultTop = "0px";
|
|
17
17
|
let key = 0;
|
|
18
18
|
const noticeInstance = {};
|
|
19
19
|
const transitionName = "move-notice";
|
|
@@ -88,7 +88,8 @@ const notice = (args) => {
|
|
|
88
88
|
placement,
|
|
89
89
|
top,
|
|
90
90
|
bottom,
|
|
91
|
-
|
|
91
|
+
action,
|
|
92
|
+
showIcon = true
|
|
92
93
|
} = args;
|
|
93
94
|
const duration = args.duration !== void 0 ? args.duration : defaultDuration;
|
|
94
95
|
let iconType = propIconType || void 0;
|
|
@@ -102,15 +103,14 @@ const notice = (args) => {
|
|
|
102
103
|
top,
|
|
103
104
|
bottom
|
|
104
105
|
});
|
|
105
|
-
const IconNode = iconType ? vue.createVNode("span", {
|
|
106
|
-
"class": `${prefixCls}-icon ${prefixCls}-icon-${type}
|
|
107
|
-
"data-color": type || void 0
|
|
106
|
+
const IconNode = showIcon && iconType ? vue.createVNode("span", {
|
|
107
|
+
"class": `${prefixCls}-icon ${prefixCls}-icon-${type}`
|
|
108
108
|
}, [vue.createVNode(index.UIcon, {
|
|
109
109
|
"class": `${iconClass || ""}`
|
|
110
110
|
}, {
|
|
111
111
|
default: () => [vue.createVNode(iconType, null, null)]
|
|
112
112
|
})]) : null;
|
|
113
|
-
const withIconCls = iconType ? `${prefixCls}-with-icon ${prefixCls}-with-${type} ` : "";
|
|
113
|
+
const withIconCls = showIcon && iconType ? `${prefixCls}-with-icon ${prefixCls}-with-${type} ` : "";
|
|
114
114
|
const withDescCls = desc ? `${prefixCls}-with-desc` : "";
|
|
115
115
|
instance.notice({
|
|
116
116
|
key: target,
|
|
@@ -120,14 +120,16 @@ const notice = (args) => {
|
|
|
120
120
|
style: args.style || {},
|
|
121
121
|
class: args.class,
|
|
122
122
|
content: () => vue.createVNode("div", {
|
|
123
|
-
"class": `${withIconCls} ${withDescCls}
|
|
124
|
-
|
|
123
|
+
"class": `${prefixCls}-wrapper ${withIconCls} ${withDescCls}`,
|
|
124
|
+
"data-type": type || void 0
|
|
125
|
+
}, [IconNode, vue.createVNode("div", null, [vue.createVNode("div", {
|
|
125
126
|
"class": `${prefixCls}-title`
|
|
126
127
|
}, [typeof title === "function" ? title() : title]), vue.createVNode("div", {
|
|
127
128
|
"class": `${prefixCls}-desc`
|
|
128
|
-
}, [typeof desc === "function" ? desc() : desc]),
|
|
129
|
-
"class": `${prefixCls}-btn
|
|
130
|
-
|
|
129
|
+
}, [typeof desc === "function" ? desc() : desc])]), action ? vue.createVNode("button", {
|
|
130
|
+
"class": `${prefixCls}-btn`,
|
|
131
|
+
"onClick": args.onAction
|
|
132
|
+
}, [action]) : null])
|
|
131
133
|
});
|
|
132
134
|
const result = () => {
|
|
133
135
|
const cls = `${prefixCls}-${placement}`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Notice.js","sources":["../../../../src/components/Notice/Notice.tsx"],"sourcesContent":["import type { Component } from 'vue';\nimport Notification from '@uxd-ui/components/Notification';\nimport UIcon from '@uxd-ui/components/Icon';\nimport { Info, CircleCheck, CircleAlert, CircleX } from 'lucide-vue-next';\nimport type { NoticationPublicInstance } from '../Notification/Notication.type';\nimport type { Notice, NoticeOptions, NoticeParams, NoticePlacement, NoticeType } from './Notice.type';\n\nlet prefixCls = 'uui-notice';\nconst prefixKey = 'uui_notice_key_';\nlet defaultDuration = 4.5;\nlet defaultPlacement: NoticePlacement = '
|
|
1
|
+
{"version":3,"file":"Notice.js","sources":["../../../../src/components/Notice/Notice.tsx"],"sourcesContent":["import type { Component } from 'vue';\nimport Notification from '@uxd-ui/components/Notification';\nimport UIcon from '@uxd-ui/components/Icon';\nimport { Info, CircleCheck, CircleAlert, CircleX } from 'lucide-vue-next';\nimport type { NoticationPublicInstance } from '../Notification/Notication.type';\nimport type { Notice, NoticeOptions, NoticeParams, NoticePlacement, NoticeType } from './Notice.type';\n\nlet prefixCls = 'uui-notice';\nconst prefixKey = 'uui_notice_key_';\nlet defaultDuration = 4.5;\nlet defaultPlacement: NoticePlacement = 'bottom-right';\nlet defaultBottom = '0px';\nlet defaultTop = '0px';\nlet key = 0;\nconst noticeInstance: Record<string, NoticationPublicInstance> = {};\nconst transitionName = 'move-notice';\nlet maxCount: number;\n\nconst iconTypes: Record<NoticeType, Component[]> = {\n info: [Info, Info],\n success: [CircleCheck, CircleCheck],\n warning: [CircleAlert, CircleAlert],\n error: [CircleX, CircleX]\n};\n\nconst getStyle = (placement: NoticePlacement, top = defaultTop, bottom = defaultBottom) => {\n let style;\n switch (placement) {\n case 'top-left':\n style = {\n left: '0px',\n top,\n bottom: 'auto'\n };\n break;\n case 'top-right':\n style = {\n right: '0px',\n top,\n bottom: 'auto'\n };\n break;\n case 'bottom-left':\n style = {\n left: '0px',\n top: 'auto',\n bottom\n };\n break;\n default:\n style = {\n right: '0px',\n top: 'auto',\n bottom\n };\n break;\n }\n return style;\n};\n\nconst getNoticeInstance = ({ placement = defaultPlacement, top, bottom }: NoticeParams) => {\n const cls = `${prefixCls}-${placement}`;\n if (noticeInstance[cls]) {\n return noticeInstance[cls];\n }\n const instance: NoticationPublicInstance = Notification.newInstance({\n prefixCls,\n class: cls,\n style: getStyle(placement, top, bottom),\n transitionName,\n maxCount,\n type: 'notice'\n });\n noticeInstance[cls] = instance;\n return instance;\n};\n\nconst notice = (args: NoticeParams) => {\n const { type, iconType: propIconType, iconClass, title, desc, placement, top, bottom, action, showIcon = true } = args;\n const duration = args.duration !== undefined ? args.duration : defaultDuration;\n let iconType = propIconType || undefined;\n if (type && !iconType) {\n iconType = desc ? iconTypes[type][1] : iconTypes[type][0];\n }\n key += 1;\n const target = args.key || `${prefixKey}${key}`;\n const instance = getNoticeInstance({\n placement,\n top,\n bottom\n } as NoticeParams);\n\n // const computedColor = {\n // info: 'blue',\n // error: 'red',\n // warning: 'orange',\n // success: 'green'\n // };\n\n const IconNode =\n showIcon && iconType ? (\n <span class={`${prefixCls}-icon ${prefixCls}-icon-${type}`}>\n <UIcon class={`${iconClass || ''}`}>\n <iconType />\n </UIcon>\n </span>\n ) : null;\n const withIconCls = showIcon && iconType ? `${prefixCls}-with-icon ${prefixCls}-with-${type} ` : '';\n const withDescCls = desc ? `${prefixCls}-with-desc` : '';\n instance.notice({\n key: target,\n duration,\n closable: true,\n onClose: args.onClose,\n style: args.style || {},\n class: args.class,\n content: () => (\n <div class={`${prefixCls}-wrapper ${withIconCls} ${withDescCls}`} data-type={type || undefined}>\n {IconNode}\n <div>\n <div class={`${prefixCls}-title`}>{typeof title === 'function' ? title() : title}</div>\n <div class={`${prefixCls}-desc`}>{typeof desc === 'function' ? desc() : desc}</div>\n </div>\n {action ? (\n <button class={`${prefixCls}-btn`} onClick={args.onAction}>\n {action}\n </button>\n ) : null}\n </div>\n )\n });\n\n const result = () => {\n const cls = `${prefixCls}-${placement}`;\n if (noticeInstance[cls]) {\n noticeInstance[cls].remove(target);\n }\n };\n return result;\n};\n\nconst api = {\n config(options: NoticeOptions) {\n if (options.duration !== undefined) {\n defaultDuration = options.duration;\n }\n if (options.placement !== undefined) {\n defaultPlacement = options.placement;\n }\n if (options.bottom !== undefined) {\n defaultBottom = typeof options.bottom === 'number' ? `${options.bottom}px` : options.bottom;\n }\n if (options.top !== undefined) {\n defaultTop = typeof options.top === 'number' ? `${options.top}px` : options.top;\n }\n if (options.prefixCls !== undefined) {\n prefixCls = options.prefixCls;\n }\n if (options.maxCount !== undefined) {\n maxCount = options.maxCount;\n }\n },\n open: notice,\n close(closeKey: string) {\n Object.keys(noticeInstance).forEach((cls) => {\n noticeInstance[cls].remove(closeKey);\n });\n },\n destroy() {\n Object.keys(noticeInstance).forEach((cls) => {\n noticeInstance[cls].destroy();\n delete noticeInstance[cls];\n });\n }\n};\n\n(['success', 'info', 'error', 'warning'] as NoticeType[]).forEach((type) => {\n (api as Notice)[type] = (args: Omit<NoticeParams, 'type'>) => {\n return api.open({ type, ...args });\n };\n});\n\nexport default api as Notice;\n"],"names":["prefixCls","prefixKey","defaultDuration","defaultPlacement","defaultBottom","defaultTop","key","noticeInstance","transitionName","maxCount","iconTypes","info","Info","success","CircleCheck","warning","CircleAlert","error","CircleX","getStyle","placement","top","bottom","style","left","right","getNoticeInstance","cls","instance","Notification","newInstance","class","type","notice","args","iconType","propIconType","iconClass","title","desc","action","showIcon","duration","undefined","target","IconNode","_createVNode","UIcon","default","withIconCls","withDescCls","closable","onClose","content","onAction","result","remove","api","config","options","open","close","closeKey","Object","keys","forEach","destroy"],"mappings":";;;;;;;;;;AAOA,IAAIA,YAAY;AAChB,MAAMC,YAAY;AAClB,IAAIC,kBAAkB;AACtB,IAAIC,mBAAoC;AACxC,IAAIC,gBAAgB;AACpB,IAAIC,aAAa;AACjB,IAAIC,MAAM;AACV,MAAMC,iBAA2D;AACjE,MAAMC,iBAAiB;AACvB,IAAIC;AAEJ,MAAMC,YAA6C;AAAA,EACjDC,MAAM,CAACC,oBAAMA,kBAAI;AAAA,EACjBC,SAAS,CAACC,2BAAaA,yBAAW;AAAA,EAClCC,SAAS,CAACC,2BAAaA,yBAAW;AAAA,EAClCC,OAAO,CAACC,uBAASA,qBAAO;AAC1B;AAEA,MAAMC,WAAWA,CAACC,WAA4BC,MAAMhB,YAAYiB,SAASlB,kBAAkB;AACzF,MAAImB;AACJ,UAAQH;AAAAA,SACD;AACHG,cAAQ;AAAA,QACNC,MAAM;AAAA,QACNH;AAAAA,QACAC,QAAQ;AAAA;AAEV;AAAA,SACG;AACHC,cAAQ;AAAA,QACNE,OAAO;AAAA,QACPJ;AAAAA,QACAC,QAAQ;AAAA;AAEV;AAAA,SACG;AACHC,cAAQ;AAAA,QACNC,MAAM;AAAA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QAAQtC,QAAQ,WAAW,GAAGsC,QAAQtC,UAAUsC,QAAQtC;AAAAA;AAE9E,QAAIsC,QAAQ3D,cAAc2C,QAAW;AACnC3C,kBAAY2D,QAAQ3D;AAAAA;AAEtB,QAAI2D,QAAQlD,aAAakC,QAAW;AAClClC,iBAAWkD,QAAQlD;AAAAA;AACrB;AACF,EACAmD,MAAM3B;AAAAA,EACN4B,MAAMC,UAAkB;AACtBC,WAAOC,KAAKzD,cAAc,EAAE0D,QAAStC,SAAQ;AAC3CpB,qBAAeoB,KAAK6B,OAAOM,QAAQ;AAAA,KACpC;AAAA;AACH,EACAI,UAAU;AACRH,WAAOC,KAAKzD,cAAc,EAAE0D,QAAStC,SAAQ;AAC3CpB,qBAAeoB,KAAKuC;AACpB,aAAO3D,eAAeoB;AAAAA,KACvB;AAAA;AAEL;AAEC,CAAC,WAAW,QAAQ,SAAS,SAAS,EAAmBsC,QAASjC,UAAS;AACzEyB,MAAezB,QAASE,UAAqC;AAC5D,WAAOuB,IAAIG,KAAK;AAAA,MAAE5B;AAAAA,MAAM,GAAGE;AAAAA,KAAM;AAAA;AAErC,CAAC;;;;"}
|
|
@@ -5,16 +5,17 @@ export interface NoticeParams {
|
|
|
5
5
|
key?: string;
|
|
6
6
|
type?: NoticeType;
|
|
7
7
|
iconType?: Component;
|
|
8
|
+
showIcon?: boolean;
|
|
8
9
|
iconClass?: string;
|
|
9
10
|
title?: string | (() => VNodeChild);
|
|
10
11
|
desc?: string | (() => VNodeChild);
|
|
11
12
|
placement?: NoticePlacement;
|
|
12
13
|
top?: string;
|
|
13
14
|
bottom?: string;
|
|
14
|
-
|
|
15
|
+
action?: string;
|
|
15
16
|
duration?: number;
|
|
16
17
|
onClose?: () => void;
|
|
17
|
-
|
|
18
|
+
onAction?: () => void;
|
|
18
19
|
style?: CSSProperties;
|
|
19
20
|
class?: string;
|
|
20
21
|
}
|
|
@@ -109,11 +109,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
109
109
|
}
|
|
110
110
|
])
|
|
111
111
|
}, [
|
|
112
|
-
vue.
|
|
113
|
-
class: vue.normalizeClass(`${_ctx.prefixCls}-content-text`)
|
|
114
|
-
}, [
|
|
115
|
-
vue.createVNode(_component_Render, { render: _ctx.content }, null, 8, ["render"])
|
|
116
|
-
], 2),
|
|
112
|
+
vue.createVNode(_component_Render, { render: _ctx.content }, null, 8, ["render"]),
|
|
117
113
|
_ctx.closable ? (vue.openBlock(), vue.createElementBlock("a", {
|
|
118
114
|
key: 0,
|
|
119
115
|
tabindex: "0",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Notice.js","sources":["../../../../src/components/Notification/Notice.vue"],"sourcesContent":["<template>\n <div\n :class=\"[\n prefixCls,\n {\n [`${prefixCls}-closable`]: closable,\n [`${prefixCls}-background`]: background\n }\n ]\"\n @mouseenter=\"clearCloseTimer\"\n @mouseleave=\"startCloseTimer\"\n >\n <div\n :class=\"[\n `${prefixCls}-content`,\n {\n [`${prefixCls}-content-${msgType}`]: msgType\n }\n ]\"\n >\n <
|
|
1
|
+
{"version":3,"file":"Notice.js","sources":["../../../../src/components/Notification/Notice.vue"],"sourcesContent":["<template>\n <div\n :class=\"[\n prefixCls,\n {\n [`${prefixCls}-closable`]: closable,\n [`${prefixCls}-background`]: background\n }\n ]\"\n @mouseenter=\"clearCloseTimer\"\n @mouseleave=\"startCloseTimer\"\n >\n <div\n :class=\"[\n `${prefixCls}-content`,\n {\n [`${prefixCls}-content-${msgType}`]: msgType\n }\n ]\"\n >\n <Render :render=\"content\" />\n\n <a v-if=\"closable\" tabindex=\"0\" :class=\"`${prefixCls}-close`\" @click.stop.prevent=\"handleClose\">\n <UIcon>\n <X />\n </UIcon>\n </a>\n </div>\n </div>\n</template>\n\n<script lang=\"ts\">\nimport { defineComponent, computed, onMounted, onBeforeUnmount, watch } from 'vue';\nimport type { PropType, VNodeChild } from 'vue';\nimport { X } from 'lucide-vue-next';\nimport UIcon from '@uxd-ui/components/Icon';\nimport type { JSX } from 'vue/jsx-runtime';\nimport Render from '../base/Render';\nimport type { NoticeProps } from './Notication.type';\n\nexport default defineComponent({\n components: {\n UIcon,\n X,\n Render\n },\n props: {\n prefix: {\n type: String\n },\n duration: {\n type: Number,\n default: 1.5\n },\n closable: {\n type: Boolean,\n default: undefined as undefined\n },\n onClose: {\n type: Function as PropType<() => void>\n },\n content: {\n type: Function as PropType<() => VNodeChild | JSX.Element>\n },\n background: {\n type: Boolean,\n default: undefined as undefined\n },\n msgType: {\n type: String\n }\n },\n emits: ['close'],\n setup(props: NoticeProps, { emit }) {\n const prefixCls = computed(() => {\n return `${props.prefix}-notice`;\n });\n\n let closeTimer: any = null;\n let willDestory = false;\n\n const clearCloseTimer = () => {\n if (closeTimer) {\n clearTimeout(closeTimer);\n closeTimer = null;\n }\n };\n\n const handleClose = () => {\n clearCloseTimer();\n emit('close');\n };\n\n const startCloseTimer = () => {\n clearCloseTimer();\n if (props.duration !== 0 && !willDestory) {\n closeTimer = setTimeout(() => {\n handleClose();\n }, props.duration * 1000);\n }\n };\n\n onMounted(() => {\n startCloseTimer();\n });\n\n onBeforeUnmount(() => {\n clearCloseTimer();\n willDestory = true;\n });\n\n watch(\n () => props.duration,\n () => {\n startCloseTimer();\n }\n );\n\n return {\n prefixCls,\n handleClose,\n startCloseTimer,\n clearCloseTimer\n };\n }\n});\n</script>\n"],"names":["defineComponent","UIcon","X","Render","computed","_createElementBlock","_normalizeClass","_createElementVNode","_createVNode"],"mappings":";;;;;;;;;;AAwCA,MAAK,YAAaA,oBAAa;AAAA,EAC7B,YAAY;AAAA,WACVC;AAAA,OACAC;AAAA,YACAC;AAAA;AACF,EACA,OAAO;AAAA,IACL,QAAQ;AAAA,MACN,MAAM;AAAA;AACR,IACA,UAAU;AAAA,MACR,MAAM;AAAA,MACN,SAAS;AAAA;AACX,IACA,UAAU;AAAA,MACR,MAAM;AAAA,MACN,SAAS;AAAA;AACX,IACA,SAAS;AAAA,MACP,MAA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