@coreui/vue-pro 5.3.0 → 5.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/cjs/components/calendar/CCalendar.d.ts +76 -0
- package/dist/cjs/components/calendar/CCalendar.js +57 -5
- package/dist/cjs/components/calendar/CCalendar.js.map +1 -1
- package/dist/cjs/components/calendar/utils.js +1 -3
- package/dist/cjs/components/calendar/utils.js.map +1 -1
- package/dist/cjs/components/conditional-teleport/CConditionalTeleport.d.ts +2 -2
- package/dist/cjs/components/conditional-teleport/CConditionalTeleport.js +1 -1
- package/dist/cjs/components/date-picker/CDatePicker.d.ts +82 -6
- package/dist/cjs/components/date-picker/CDatePicker.js +39 -3
- package/dist/cjs/components/date-picker/CDatePicker.js.map +1 -1
- package/dist/cjs/components/date-range-picker/CDateRangePicker.d.ts +82 -6
- package/dist/cjs/components/date-range-picker/CDateRangePicker.js +43 -3
- package/dist/cjs/components/date-range-picker/CDateRangePicker.js.map +1 -1
- package/dist/cjs/components/dropdown/CDropdown.d.ts +4 -4
- package/dist/cjs/components/dropdown/CDropdown.js +2 -2
- package/dist/cjs/components/dropdown/CDropdownToggle.d.ts +2 -2
- package/dist/cjs/components/dropdown/CDropdownToggle.js +1 -1
- package/dist/cjs/components/header/CHeader.d.ts +17 -1
- package/dist/cjs/components/header/CHeader.js +8 -1
- package/dist/cjs/components/header/CHeader.js.map +1 -1
- package/dist/cjs/components/modal/CModal.d.ts +43 -5
- package/dist/cjs/components/modal/CModal.js +41 -17
- package/dist/cjs/components/modal/CModal.js.map +1 -1
- package/dist/cjs/components/popover/CPopover.d.ts +2 -2
- package/dist/cjs/components/popover/CPopover.js +1 -1
- package/dist/cjs/components/time-picker/CTimePicker.js +1 -1
- package/dist/cjs/components/tooltip/CTooltip.d.ts +2 -2
- package/dist/cjs/components/tooltip/CTooltip.js +1 -1
- package/dist/esm/components/calendar/CCalendar.d.ts +76 -0
- package/dist/esm/components/calendar/CCalendar.js +58 -6
- package/dist/esm/components/calendar/CCalendar.js.map +1 -1
- package/dist/esm/components/calendar/utils.js +1 -3
- package/dist/esm/components/calendar/utils.js.map +1 -1
- package/dist/esm/components/conditional-teleport/CConditionalTeleport.d.ts +2 -2
- package/dist/esm/components/conditional-teleport/CConditionalTeleport.js +1 -1
- package/dist/esm/components/date-picker/CDatePicker.d.ts +82 -6
- package/dist/esm/components/date-picker/CDatePicker.js +39 -3
- package/dist/esm/components/date-picker/CDatePicker.js.map +1 -1
- package/dist/esm/components/date-range-picker/CDateRangePicker.d.ts +82 -6
- package/dist/esm/components/date-range-picker/CDateRangePicker.js +43 -3
- package/dist/esm/components/date-range-picker/CDateRangePicker.js.map +1 -1
- package/dist/esm/components/dropdown/CDropdown.d.ts +4 -4
- package/dist/esm/components/dropdown/CDropdown.js +2 -2
- package/dist/esm/components/dropdown/CDropdownToggle.d.ts +2 -2
- package/dist/esm/components/dropdown/CDropdownToggle.js +1 -1
- package/dist/esm/components/header/CHeader.d.ts +17 -1
- package/dist/esm/components/header/CHeader.js +8 -1
- package/dist/esm/components/header/CHeader.js.map +1 -1
- package/dist/esm/components/modal/CModal.d.ts +43 -5
- package/dist/esm/components/modal/CModal.js +41 -17
- package/dist/esm/components/modal/CModal.js.map +1 -1
- package/dist/esm/components/popover/CPopover.d.ts +2 -2
- package/dist/esm/components/popover/CPopover.js +1 -1
- package/dist/esm/components/time-picker/CTimePicker.js +1 -1
- package/dist/esm/components/tooltip/CTooltip.d.ts +2 -2
- package/dist/esm/components/tooltip/CTooltip.js +1 -1
- package/package.json +5 -5
- package/src/components/calendar/CCalendar.ts +57 -5
- package/src/components/calendar/utils.ts +1 -4
- package/src/components/conditional-teleport/CConditionalTeleport.ts +1 -1
- package/src/components/date-picker/CDatePicker.ts +39 -3
- package/src/components/date-range-picker/CDateRangePicker.ts +43 -3
- package/src/components/dropdown/CDropdown.ts +2 -2
- package/src/components/dropdown/CDropdownToggle.ts +1 -1
- package/src/components/header/CHeader.ts +8 -1
- package/src/components/header/__tests__/CHeader.spec.ts +19 -0
- package/src/components/modal/CModal.ts +49 -19
- package/src/components/popover/CPopover.ts +1 -1
- package/src/components/time-picker/CTimePicker.ts +1 -1
- package/src/components/tooltip/CTooltip.ts +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { RendererElement } from 'vue';
|
|
1
|
+
import { PropType, RendererElement } from 'vue';
|
|
2
2
|
declare const CModal: import("vue").DefineComponent<{
|
|
3
3
|
/**
|
|
4
4
|
* Align the modal in the center or top of the screen.
|
|
@@ -19,6 +19,15 @@ declare const CModal: import("vue").DefineComponent<{
|
|
|
19
19
|
default: boolean;
|
|
20
20
|
validator: (value: boolean | string) => boolean;
|
|
21
21
|
};
|
|
22
|
+
/**
|
|
23
|
+
* Appends the vue popover to a specific element. You can pass an HTML element or function that returns a single element. By default `document.body`.
|
|
24
|
+
*
|
|
25
|
+
* @since 5.3.0
|
|
26
|
+
*/
|
|
27
|
+
container: {
|
|
28
|
+
type: PropType<HTMLElement | (() => HTMLElement) | string>;
|
|
29
|
+
default: string;
|
|
30
|
+
};
|
|
22
31
|
/**
|
|
23
32
|
* A string of all className you want applied to the modal content component.
|
|
24
33
|
*/
|
|
@@ -26,7 +35,7 @@ declare const CModal: import("vue").DefineComponent<{
|
|
|
26
35
|
/**
|
|
27
36
|
* Puts the focus on the modal when shown.
|
|
28
37
|
*
|
|
29
|
-
* @since
|
|
38
|
+
* @since 5.0.0
|
|
30
39
|
*/
|
|
31
40
|
focus: {
|
|
32
41
|
type: BooleanConstructor;
|
|
@@ -61,6 +70,15 @@ declare const CModal: import("vue").DefineComponent<{
|
|
|
61
70
|
type: StringConstructor;
|
|
62
71
|
validator: (value: string) => boolean;
|
|
63
72
|
};
|
|
73
|
+
/**
|
|
74
|
+
* Generates modal using Teleport.
|
|
75
|
+
*
|
|
76
|
+
* @since 5.3.0
|
|
77
|
+
*/
|
|
78
|
+
teleport: {
|
|
79
|
+
type: BooleanConstructor;
|
|
80
|
+
default: boolean;
|
|
81
|
+
};
|
|
64
82
|
/**
|
|
65
83
|
* Remove animation to create modal that simply appear rather than fade in to view.
|
|
66
84
|
*/
|
|
@@ -79,9 +97,9 @@ declare const CModal: import("vue").DefineComponent<{
|
|
|
79
97
|
* Toggle the visibility of alert component.
|
|
80
98
|
*/
|
|
81
99
|
visible: BooleanConstructor;
|
|
82
|
-
}, () =>
|
|
100
|
+
}, () => import("vue").VNode<import("vue").RendererNode, RendererElement, {
|
|
83
101
|
[key: string]: any;
|
|
84
|
-
}
|
|
102
|
+
}>, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("close" | "show" | "close-prevented")[], "close" | "show" | "close-prevented", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
85
103
|
/**
|
|
86
104
|
* Align the modal in the center or top of the screen.
|
|
87
105
|
*
|
|
@@ -101,6 +119,15 @@ declare const CModal: import("vue").DefineComponent<{
|
|
|
101
119
|
default: boolean;
|
|
102
120
|
validator: (value: boolean | string) => boolean;
|
|
103
121
|
};
|
|
122
|
+
/**
|
|
123
|
+
* Appends the vue popover to a specific element. You can pass an HTML element or function that returns a single element. By default `document.body`.
|
|
124
|
+
*
|
|
125
|
+
* @since 5.3.0
|
|
126
|
+
*/
|
|
127
|
+
container: {
|
|
128
|
+
type: PropType<HTMLElement | (() => HTMLElement) | string>;
|
|
129
|
+
default: string;
|
|
130
|
+
};
|
|
104
131
|
/**
|
|
105
132
|
* A string of all className you want applied to the modal content component.
|
|
106
133
|
*/
|
|
@@ -108,7 +135,7 @@ declare const CModal: import("vue").DefineComponent<{
|
|
|
108
135
|
/**
|
|
109
136
|
* Puts the focus on the modal when shown.
|
|
110
137
|
*
|
|
111
|
-
* @since
|
|
138
|
+
* @since 5.0.0
|
|
112
139
|
*/
|
|
113
140
|
focus: {
|
|
114
141
|
type: BooleanConstructor;
|
|
@@ -143,6 +170,15 @@ declare const CModal: import("vue").DefineComponent<{
|
|
|
143
170
|
type: StringConstructor;
|
|
144
171
|
validator: (value: string) => boolean;
|
|
145
172
|
};
|
|
173
|
+
/**
|
|
174
|
+
* Generates modal using Teleport.
|
|
175
|
+
*
|
|
176
|
+
* @since 5.3.0
|
|
177
|
+
*/
|
|
178
|
+
teleport: {
|
|
179
|
+
type: BooleanConstructor;
|
|
180
|
+
default: boolean;
|
|
181
|
+
};
|
|
146
182
|
/**
|
|
147
183
|
* Remove animation to create modal that simply appear rather than fade in to view.
|
|
148
184
|
*/
|
|
@@ -169,6 +205,8 @@ declare const CModal: import("vue").DefineComponent<{
|
|
|
169
205
|
focus: boolean;
|
|
170
206
|
transition: boolean;
|
|
171
207
|
visible: boolean;
|
|
208
|
+
container: string | HTMLElement | (() => HTMLElement);
|
|
209
|
+
teleport: boolean;
|
|
172
210
|
alignment: string;
|
|
173
211
|
backdrop: string | boolean;
|
|
174
212
|
keyboard: boolean;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var vue = require('vue');
|
|
4
4
|
var CBackdrop = require('../backdrop/CBackdrop.js');
|
|
5
|
+
var CConditionalTeleport = require('../conditional-teleport/CConditionalTeleport.js');
|
|
5
6
|
var transition = require('../../utils/transition.js');
|
|
6
7
|
|
|
7
8
|
const CModal = vue.defineComponent({
|
|
@@ -37,6 +38,15 @@ const CModal = vue.defineComponent({
|
|
|
37
38
|
return false;
|
|
38
39
|
},
|
|
39
40
|
},
|
|
41
|
+
/**
|
|
42
|
+
* Appends the vue popover to a specific element. You can pass an HTML element or function that returns a single element. By default `document.body`.
|
|
43
|
+
*
|
|
44
|
+
* @since 5.3.0
|
|
45
|
+
*/
|
|
46
|
+
container: {
|
|
47
|
+
type: [Object, String],
|
|
48
|
+
default: 'body',
|
|
49
|
+
},
|
|
40
50
|
/**
|
|
41
51
|
* A string of all className you want applied to the modal content component.
|
|
42
52
|
*/
|
|
@@ -44,7 +54,7 @@ const CModal = vue.defineComponent({
|
|
|
44
54
|
/**
|
|
45
55
|
* Puts the focus on the modal when shown.
|
|
46
56
|
*
|
|
47
|
-
* @since
|
|
57
|
+
* @since 5.0.0
|
|
48
58
|
*/
|
|
49
59
|
focus: {
|
|
50
60
|
type: Boolean,
|
|
@@ -89,6 +99,15 @@ const CModal = vue.defineComponent({
|
|
|
89
99
|
return ['sm', 'lg', 'xl'].includes(value);
|
|
90
100
|
},
|
|
91
101
|
},
|
|
102
|
+
/**
|
|
103
|
+
* Generates modal using Teleport.
|
|
104
|
+
*
|
|
105
|
+
* @since 5.3.0
|
|
106
|
+
*/
|
|
107
|
+
teleport: {
|
|
108
|
+
type: Boolean,
|
|
109
|
+
default: false,
|
|
110
|
+
},
|
|
92
111
|
/**
|
|
93
112
|
* Remove animation to create modal that simply appear rather than fade in to view.
|
|
94
113
|
*/
|
|
@@ -222,22 +241,27 @@ const CModal = vue.defineComponent({
|
|
|
222
241
|
},
|
|
223
242
|
],
|
|
224
243
|
}, vue.h('div', { class: ['modal-content', props.contentClassName], ref: modalContentRef }, slots.default && slots.default())));
|
|
225
|
-
return () =>
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
244
|
+
return () => vue.h(CConditionalTeleport.CConditionalTeleport, {
|
|
245
|
+
container: props.container,
|
|
246
|
+
teleport: props.teleport,
|
|
247
|
+
}, {
|
|
248
|
+
default: () => [
|
|
249
|
+
vue.h(vue.Transition, {
|
|
250
|
+
css: false,
|
|
251
|
+
onEnter: (el, done) => handleEnter(el, done),
|
|
252
|
+
onAfterEnter: () => handleAfterEnter(),
|
|
253
|
+
onLeave: (el, done) => handleLeave(el, done),
|
|
254
|
+
onAfterLeave: (el) => handleAfterLeave(el),
|
|
255
|
+
}, () => props.unmountOnClose
|
|
256
|
+
? visible.value && modal()
|
|
257
|
+
: vue.withDirectives(modal(), [[vue.vShow, visible.value]])),
|
|
258
|
+
props.backdrop &&
|
|
259
|
+
vue.h(CBackdrop.CBackdrop, {
|
|
260
|
+
class: 'modal-backdrop',
|
|
261
|
+
visible: visible.value,
|
|
262
|
+
}),
|
|
263
|
+
],
|
|
264
|
+
});
|
|
241
265
|
},
|
|
242
266
|
});
|
|
243
267
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CModal.js","sources":["../../../../src/components/modal/CModal.ts"],"sourcesContent":[null],"names":["defineComponent","ref","watch","executeAfterTransition","provide","h","Transition","withDirectives","vShow","CBackdrop"],"mappings":"
|
|
1
|
+
{"version":3,"file":"CModal.js","sources":["../../../../src/components/modal/CModal.ts"],"sourcesContent":[null],"names":["defineComponent","ref","watch","executeAfterTransition","provide","h","CConditionalTeleport","Transition","withDirectives","vShow","CBackdrop"],"mappings":";;;;;;;AAkBM,MAAA,MAAM,GAAGA,mBAAe,CAAC;AAC7B,IAAA,IAAI,EAAE,QAAQ;AACd,IAAA,YAAY,EAAE,KAAK;AACnB,IAAA,KAAK,EAAE;AACL;;;;AAIG;AACH,QAAA,SAAS,EAAE;AACT,YAAA,OAAO,EAAE,KAAK;AACd,YAAA,SAAS,EAAE,CAAC,KAAa,KAAI;gBAC3B,OAAO,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAA;aACzC;AACF,SAAA;AACD;;;;AAIG;AACH,QAAA,QAAQ,EAAE;AACR,YAAA,IAAI,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC;AACvB,YAAA,OAAO,EAAE,IAAI;AACb,YAAA,SAAS,EAAE,CAAC,KAAuB,KAAI;AACrC,gBAAA,IAAI,OAAO,KAAK,IAAI,QAAQ,EAAE;oBAC5B,OAAO,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAA;iBAClC;AACD,gBAAA,IAAI,OAAO,KAAK,IAAI,SAAS,E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A,KAAK,EAAE,gBAAgB;wBACvB,OAAO,EAAE,OAAO,CAAC,KAAK;qBACvB,CAAC;AACL,aAAA;AACF,SAAA,CACF,CAAA;KACJ;AACF,CAAA;;;;"}
|
|
@@ -14,7 +14,7 @@ declare const CPopover: import("vue").DefineComponent<{
|
|
|
14
14
|
/**
|
|
15
15
|
* Appends the vue popover to a specific element. You can pass an HTML element or function that returns a single element. By default `document.body`.
|
|
16
16
|
*
|
|
17
|
-
* @since
|
|
17
|
+
* @since 5.0.0
|
|
18
18
|
*/
|
|
19
19
|
container: {
|
|
20
20
|
type: PropType<HTMLElement | (() => HTMLElement) | string>;
|
|
@@ -96,7 +96,7 @@ declare const CPopover: import("vue").DefineComponent<{
|
|
|
96
96
|
/**
|
|
97
97
|
* Appends the vue popover to a specific element. You can pass an HTML element or function that returns a single element. By default `document.body`.
|
|
98
98
|
*
|
|
99
|
-
* @since
|
|
99
|
+
* @since 5.0.0
|
|
100
100
|
*/
|
|
101
101
|
container: {
|
|
102
102
|
type: PropType<HTMLElement | (() => HTMLElement) | string>;
|
|
@@ -23,7 +23,7 @@ const CPopover = vue.defineComponent({
|
|
|
23
23
|
/**
|
|
24
24
|
* Appends the vue popover to a specific element. You can pass an HTML element or function that returns a single element. By default `document.body`.
|
|
25
25
|
*
|
|
26
|
-
* @since
|
|
26
|
+
* @since 5.0.0
|
|
27
27
|
*/
|
|
28
28
|
container: {
|
|
29
29
|
type: [Object, String],
|
|
@@ -14,7 +14,7 @@ declare const CTooltip: import("vue").DefineComponent<{
|
|
|
14
14
|
/**
|
|
15
15
|
* Appends the vue tooltip to a specific element. You can pass an HTML element or function that returns a single element. By default `document.body`.
|
|
16
16
|
*
|
|
17
|
-
* @since
|
|
17
|
+
* @since 5.0.0
|
|
18
18
|
*/
|
|
19
19
|
container: {
|
|
20
20
|
type: PropType<HTMLElement | (() => HTMLElement) | string>;
|
|
@@ -92,7 +92,7 @@ declare const CTooltip: import("vue").DefineComponent<{
|
|
|
92
92
|
/**
|
|
93
93
|
* Appends the vue tooltip to a specific element. You can pass an HTML element or function that returns a single element. By default `document.body`.
|
|
94
94
|
*
|
|
95
|
-
* @since
|
|
95
|
+
* @since 5.0.0
|
|
96
96
|
*/
|
|
97
97
|
container: {
|
|
98
98
|
type: PropType<HTMLElement | (() => HTMLElement) | string>;
|
|
@@ -23,7 +23,7 @@ const CTooltip = vue.defineComponent({
|
|
|
23
23
|
/**
|
|
24
24
|
* Appends the vue tooltip to a specific element. You can pass an HTML element or function that returns a single element. By default `document.body`.
|
|
25
25
|
*
|
|
26
|
-
* @since
|
|
26
|
+
* @since 5.0.0
|
|
27
27
|
*/
|
|
28
28
|
container: {
|
|
29
29
|
type: [Object, String],
|
|
@@ -1,5 +1,41 @@
|
|
|
1
1
|
import { PropType } from 'vue';
|
|
2
2
|
declare const CCalendar: import("vue").DefineComponent<{
|
|
3
|
+
/**
|
|
4
|
+
* A string that provides an accessible label for the button that navigates to the next month in the calendar. This label is read by screen readers to describe the action associated with the button.
|
|
5
|
+
*
|
|
6
|
+
* @since 5.4.0
|
|
7
|
+
*/
|
|
8
|
+
ariaNavNextMonthLabel: {
|
|
9
|
+
type: StringConstructor;
|
|
10
|
+
default: string;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* A string that provides an accessible label for the button that navigates to the next year in the calendar. This label is intended for screen readers to help users understand the button's functionality.
|
|
14
|
+
*
|
|
15
|
+
* @since 5.4.0
|
|
16
|
+
*/
|
|
17
|
+
ariaNavNextYearLabel: {
|
|
18
|
+
type: StringConstructor;
|
|
19
|
+
default: string;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* A string that provides an accessible label for the button that navigates to the previous month in the calendar. Screen readers will use this label to explain the purpose of the button.
|
|
23
|
+
*
|
|
24
|
+
* @since 5.4.0
|
|
25
|
+
*/
|
|
26
|
+
ariaNavPrevMonthLabel: {
|
|
27
|
+
type: StringConstructor;
|
|
28
|
+
default: string;
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* A string that provides an accessible label for the button that navigates to the previous year in the calendar. This label helps screen reader users understand the button's function.
|
|
32
|
+
*
|
|
33
|
+
* @since 5.4.0
|
|
34
|
+
*/
|
|
35
|
+
ariaNavPrevYearLabel: {
|
|
36
|
+
type: StringConstructor;
|
|
37
|
+
default: string;
|
|
38
|
+
};
|
|
3
39
|
/**
|
|
4
40
|
* Default date of the component
|
|
5
41
|
*/
|
|
@@ -137,6 +173,42 @@ declare const CCalendar: import("vue").DefineComponent<{
|
|
|
137
173
|
}, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
138
174
|
[key: string]: any;
|
|
139
175
|
}>, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("date-hover" | "calendar-date-change" | "start-date-change" | "end-date-change")[], "date-hover" | "calendar-date-change" | "start-date-change" | "end-date-change", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
176
|
+
/**
|
|
177
|
+
* A string that provides an accessible label for the button that navigates to the next month in the calendar. This label is read by screen readers to describe the action associated with the button.
|
|
178
|
+
*
|
|
179
|
+
* @since 5.4.0
|
|
180
|
+
*/
|
|
181
|
+
ariaNavNextMonthLabel: {
|
|
182
|
+
type: StringConstructor;
|
|
183
|
+
default: string;
|
|
184
|
+
};
|
|
185
|
+
/**
|
|
186
|
+
* A string that provides an accessible label for the button that navigates to the next year in the calendar. This label is intended for screen readers to help users understand the button's functionality.
|
|
187
|
+
*
|
|
188
|
+
* @since 5.4.0
|
|
189
|
+
*/
|
|
190
|
+
ariaNavNextYearLabel: {
|
|
191
|
+
type: StringConstructor;
|
|
192
|
+
default: string;
|
|
193
|
+
};
|
|
194
|
+
/**
|
|
195
|
+
* A string that provides an accessible label for the button that navigates to the previous month in the calendar. Screen readers will use this label to explain the purpose of the button.
|
|
196
|
+
*
|
|
197
|
+
* @since 5.4.0
|
|
198
|
+
*/
|
|
199
|
+
ariaNavPrevMonthLabel: {
|
|
200
|
+
type: StringConstructor;
|
|
201
|
+
default: string;
|
|
202
|
+
};
|
|
203
|
+
/**
|
|
204
|
+
* A string that provides an accessible label for the button that navigates to the previous year in the calendar. This label helps screen reader users understand the button's function.
|
|
205
|
+
*
|
|
206
|
+
* @since 5.4.0
|
|
207
|
+
*/
|
|
208
|
+
ariaNavPrevYearLabel: {
|
|
209
|
+
type: StringConstructor;
|
|
210
|
+
default: string;
|
|
211
|
+
};
|
|
140
212
|
/**
|
|
141
213
|
* Default date of the component
|
|
142
214
|
*/
|
|
@@ -277,6 +349,10 @@ declare const CCalendar: import("vue").DefineComponent<{
|
|
|
277
349
|
"onStart-date-change"?: ((...args: any[]) => any) | undefined;
|
|
278
350
|
"onEnd-date-change"?: ((...args: any[]) => any) | undefined;
|
|
279
351
|
}, {
|
|
352
|
+
ariaNavNextMonthLabel: string;
|
|
353
|
+
ariaNavNextYearLabel: string;
|
|
354
|
+
ariaNavPrevMonthLabel: string;
|
|
355
|
+
ariaNavPrevYearLabel: string;
|
|
280
356
|
calendars: number;
|
|
281
357
|
dayFormat: string | Function;
|
|
282
358
|
firstDayOfWeek: number;
|
|
@@ -1,10 +1,46 @@
|
|
|
1
1
|
import { defineComponent, ref, watch, h } from 'vue';
|
|
2
2
|
import { CButton } from '../button/CButton.js';
|
|
3
|
-
import { convertToDateObject, isSameDateAs, getDateBySelectionType, getCalendarDate, getMonthDetails, createGroupsInArray, getMonthsNames, getYears, isDateDisabled,
|
|
3
|
+
import { convertToDateObject, isSameDateAs, getDateBySelectionType, getCalendarDate, getMonthDetails, createGroupsInArray, getMonthsNames, getYears, isDateDisabled, isDateSelected, isDateInRange, isToday, isDisableDateInRange } from './utils.js';
|
|
4
4
|
|
|
5
5
|
const CCalendar = defineComponent({
|
|
6
6
|
name: 'CCalendar',
|
|
7
7
|
props: {
|
|
8
|
+
/**
|
|
9
|
+
* A string that provides an accessible label for the button that navigates to the next month in the calendar. This label is read by screen readers to describe the action associated with the button.
|
|
10
|
+
*
|
|
11
|
+
* @since 5.4.0
|
|
12
|
+
*/
|
|
13
|
+
ariaNavNextMonthLabel: {
|
|
14
|
+
type: String,
|
|
15
|
+
default: 'Next month',
|
|
16
|
+
},
|
|
17
|
+
/**
|
|
18
|
+
* A string that provides an accessible label for the button that navigates to the next year in the calendar. This label is intended for screen readers to help users understand the button's functionality.
|
|
19
|
+
*
|
|
20
|
+
* @since 5.4.0
|
|
21
|
+
*/
|
|
22
|
+
ariaNavNextYearLabel: {
|
|
23
|
+
type: String,
|
|
24
|
+
default: 'Next year',
|
|
25
|
+
},
|
|
26
|
+
/**
|
|
27
|
+
* A string that provides an accessible label for the button that navigates to the previous month in the calendar. Screen readers will use this label to explain the purpose of the button.
|
|
28
|
+
*
|
|
29
|
+
* @since 5.4.0
|
|
30
|
+
*/
|
|
31
|
+
ariaNavPrevMonthLabel: {
|
|
32
|
+
type: String,
|
|
33
|
+
default: 'Previous month',
|
|
34
|
+
},
|
|
35
|
+
/**
|
|
36
|
+
* A string that provides an accessible label for the button that navigates to the previous year in the calendar. This label helps screen reader users understand the button's function.
|
|
37
|
+
*
|
|
38
|
+
* @since 5.4.0
|
|
39
|
+
*/
|
|
40
|
+
ariaNavPrevYearLabel: {
|
|
41
|
+
type: String,
|
|
42
|
+
default: 'Previous year',
|
|
43
|
+
},
|
|
8
44
|
/**
|
|
9
45
|
* Default date of the component
|
|
10
46
|
*/
|
|
@@ -453,7 +489,10 @@ const CCalendar = defineComponent({
|
|
|
453
489
|
props.showWeekNumber &&
|
|
454
490
|
h('th', { class: 'calendar-cell' }, h('div', { class: 'calendar-header-cell-inner' }, props.weekNumbersLabel)),
|
|
455
491
|
weekDays.map(({ date }) => {
|
|
456
|
-
return h('th', {
|
|
492
|
+
return h('th', {
|
|
493
|
+
class: 'calendar-cell',
|
|
494
|
+
abbr: date.toLocaleDateString(props.locale, { weekday: 'long' }),
|
|
495
|
+
}, h('div', {
|
|
457
496
|
class: 'calendar-header-cell-inner',
|
|
458
497
|
}, typeof props.weekdayFormat === 'function'
|
|
459
498
|
? props.weekdayFormat(date)
|
|
@@ -473,6 +512,7 @@ const CCalendar = defineComponent({
|
|
|
473
512
|
? `${_calendarDate.getFullYear()}W53`
|
|
474
513
|
: `${_calendarDate.getFullYear()}W${week.weekNumber}`, props.selectionType);
|
|
475
514
|
const isDisabled = isDateDisabled(date, minDate.value, maxDate.value, props.disabledDates);
|
|
515
|
+
const isSelected = isDateSelected(date, startDate.value, endDate.value);
|
|
476
516
|
const current = week.days.some((day) => day.month === 'current');
|
|
477
517
|
return h('tr', {
|
|
478
518
|
class: [
|
|
@@ -484,10 +524,11 @@ const CCalendar = defineComponent({
|
|
|
484
524
|
'range-hover': props.selectionType === 'week' && hoverDate.value && selectEndDate.value
|
|
485
525
|
? isDateInRange(date, startDate.value, hoverDate.value)
|
|
486
526
|
: isDateInRange(date, hoverDate.value, endDate.value),
|
|
487
|
-
selected:
|
|
527
|
+
selected: isSelected,
|
|
488
528
|
},
|
|
489
529
|
],
|
|
490
530
|
tabindex: props.selectionType === 'week' && current && !isDisabled ? 0 : -1,
|
|
531
|
+
...(isSelected && { 'aria-selected': true }),
|
|
491
532
|
...(props.selectionType === 'week' &&
|
|
492
533
|
!isDisabled && {
|
|
493
534
|
onBlur: () => handleCalendarMouseLeave(),
|
|
@@ -502,6 +543,7 @@ const CCalendar = defineComponent({
|
|
|
502
543
|
h('th', { class: 'calendar-cell-week-number' }, week.weekNumber === 0 ? 53 : week.weekNumber),
|
|
503
544
|
week.days.map(({ date, month }) => {
|
|
504
545
|
const isDisabled = isDateDisabled(date, minDate.value, maxDate.value, props.disabledDates);
|
|
546
|
+
const isSelected = isDateSelected(date, startDate.value, endDate.value);
|
|
505
547
|
return month === 'current' || props.showAdjacementDays
|
|
506
548
|
? h('td', {
|
|
507
549
|
class: [
|
|
@@ -516,7 +558,7 @@ const CCalendar = defineComponent({
|
|
|
516
558
|
: isDateInRange(date, hoverDate.value, endDate.value)),
|
|
517
559
|
range: month === 'current' &&
|
|
518
560
|
isDateInRange(date, startDate.value, endDate.value),
|
|
519
|
-
selected:
|
|
561
|
+
selected: isSelected,
|
|
520
562
|
}),
|
|
521
563
|
[month]: true,
|
|
522
564
|
today: month === 'current' && isToday(date),
|
|
@@ -528,6 +570,7 @@ const CCalendar = defineComponent({
|
|
|
528
570
|
? 0
|
|
529
571
|
: -1,
|
|
530
572
|
title: date.toLocaleDateString(props.locale),
|
|
573
|
+
...(isSelected && { 'aria-selected': true }),
|
|
531
574
|
...(props.selectionType === 'day' &&
|
|
532
575
|
(month === 'current' || props.selectAdjacementDays) && {
|
|
533
576
|
onBlur: () => handleCalendarMouseLeave(),
|
|
@@ -558,12 +601,13 @@ const CCalendar = defineComponent({
|
|
|
558
601
|
const monthNumber = index * 3 + idx;
|
|
559
602
|
const date = new Date(_calendarDate.getFullYear(), monthNumber, 1);
|
|
560
603
|
const isDisabled = isDateDisabled(date, minDate.value, maxDate.value, props.disabledDates);
|
|
604
|
+
const isSelected = isDateSelected(date, startDate.value, endDate.value);
|
|
561
605
|
return h('td', {
|
|
562
606
|
class: [
|
|
563
607
|
'calendar-cell',
|
|
564
608
|
{
|
|
565
609
|
disabled: isDisabled,
|
|
566
|
-
selected:
|
|
610
|
+
selected: isSelected,
|
|
567
611
|
'range-hover': props.selectionType === 'month' &&
|
|
568
612
|
(hoverDate.value && selectEndDate
|
|
569
613
|
? isDateInRange(date, startDate.value, hoverDate.value)
|
|
@@ -572,6 +616,7 @@ const CCalendar = defineComponent({
|
|
|
572
616
|
},
|
|
573
617
|
],
|
|
574
618
|
tabindex: isDisabled ? -1 : 0,
|
|
619
|
+
...(isSelected && { 'aria-selected': true }),
|
|
575
620
|
...(!isDisabled && {
|
|
576
621
|
onBlur: () => handleCalendarMouseLeave(),
|
|
577
622
|
onClick: () => handleCalendarClick(date),
|
|
@@ -588,12 +633,13 @@ const CCalendar = defineComponent({
|
|
|
588
633
|
return h('tr', {}, row.map((year) => {
|
|
589
634
|
const date = new Date(year, 0, 1);
|
|
590
635
|
const isDisabled = isDateDisabled(date, minDate.value, maxDate.value, props.disabledDates);
|
|
636
|
+
const isSelected = isDateSelected(date, startDate.value, endDate.value);
|
|
591
637
|
return h('td', {
|
|
592
638
|
class: [
|
|
593
639
|
'calendar-cell year',
|
|
594
640
|
{
|
|
595
641
|
disabled: isDisabled,
|
|
596
|
-
selected:
|
|
642
|
+
selected: isSelected,
|
|
597
643
|
'range-hover': props.selectionType === 'year' &&
|
|
598
644
|
(hoverDate.value && selectEndDate
|
|
599
645
|
? isDateInRange(date, startDate.value, hoverDate.value)
|
|
@@ -602,6 +648,7 @@ const CCalendar = defineComponent({
|
|
|
602
648
|
},
|
|
603
649
|
],
|
|
604
650
|
tabindex: isDisabled ? -1 : 0,
|
|
651
|
+
...(isSelected && { 'aria-selected': true }),
|
|
605
652
|
...(!isDisabled && {
|
|
606
653
|
onBlur: () => handleCalendarMouseLeave(),
|
|
607
654
|
onClick: () => handleCalendarClick(date),
|
|
@@ -625,6 +672,7 @@ const CCalendar = defineComponent({
|
|
|
625
672
|
h(CButton, {
|
|
626
673
|
color: 'transparent',
|
|
627
674
|
size: 'sm',
|
|
675
|
+
'aria-label': props.ariaNavPrevYearLabel,
|
|
628
676
|
onClick: () => handleNavigationOnClick('prev', true),
|
|
629
677
|
}, {
|
|
630
678
|
/**
|
|
@@ -638,6 +686,7 @@ const CCalendar = defineComponent({
|
|
|
638
686
|
h(CButton, {
|
|
639
687
|
color: 'transparent',
|
|
640
688
|
size: 'sm',
|
|
689
|
+
'aria-label': props.ariaNavPrevMonthLabel,
|
|
641
690
|
onClick: () => handleNavigationOnClick('prev'),
|
|
642
691
|
}, {
|
|
643
692
|
/**
|
|
@@ -650,6 +699,7 @@ const CCalendar = defineComponent({
|
|
|
650
699
|
]),
|
|
651
700
|
h('div', {
|
|
652
701
|
class: 'calendar-nav-date',
|
|
702
|
+
'aria-live': 'polite',
|
|
653
703
|
...(props.navYearFirst && { style: { display: 'flex', justifyContent: 'center' } }),
|
|
654
704
|
}, [
|
|
655
705
|
view.value === 'days' &&
|
|
@@ -679,6 +729,7 @@ const CCalendar = defineComponent({
|
|
|
679
729
|
h(CButton, {
|
|
680
730
|
color: 'transparent',
|
|
681
731
|
size: 'sm',
|
|
732
|
+
'aria-label': props.ariaNavNextMonthLabel,
|
|
682
733
|
onClick: () => handleNavigationOnClick('next'),
|
|
683
734
|
}, {
|
|
684
735
|
/**
|
|
@@ -691,6 +742,7 @@ const CCalendar = defineComponent({
|
|
|
691
742
|
h(CButton, {
|
|
692
743
|
color: 'transparent',
|
|
693
744
|
size: 'sm',
|
|
745
|
+
'aria-label': props.ariaNavNextYearLabel,
|
|
694
746
|
onClick: () => handleNavigationOnClick('next', true),
|
|
695
747
|
}, {
|
|
696
748
|
/**
|