@dialpad/dialtone-vue 3.204.1 → 3.205.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.
@@ -1,38 +1,45 @@
1
- import { ref as E, computed as N, watch as w, onMounted as Z, openBlock as $, createBlock as ee, unref as t, withCtx as p, createVNode as d, createElementVNode as M, toDisplayString as O, nextTick as L, createElementBlock as g, Fragment as B, renderList as V, normalizeClass as ne, createTextVNode as le, getCurrentInstance as re } from "vue";
1
+ import { ref as E, computed as N, watch as x, onMounted as Z, openBlock as $, createBlock as ee, unref as t, withCtx as k, createVNode as d, createElementVNode as w, toDisplayString as Y, nextTick as O, createElementBlock as g, Fragment as B, renderList as V, normalizeClass as ne, createTextVNode as le, getCurrentInstance as re } from "vue";
2
2
  import { DtIconChevronsLeft as oe, DtIconChevronLeft as se, DtIconChevronRight as ue, DtIconChevronsRight as ie } from "@dialpad/dialtone-icons/vue3";
3
- import { getMonth as G, getYear as q, subMonths as W, endOfMonth as j, startOfDay as P, addMonths as J, startOfMonth as Q, getDate as ce, set as de } from "date-fns";
4
- import { getCalendarDays as fe, formatMonth as De, getWeekDayNames as ve, calculateNextFocusDate as me, calculatePrevFocusDate as pe, formatDate as ke } from "./utils.js";
5
- import { INTL_MONTH_FORMAT as te, WEEK_START as be } from "./datepicker-constants.js";
6
- import { returnFirstEl as v, warnIfUnmounted as ye } from "../../common/utils/index.js";
3
+ import { getMonth as G, getYear as q, subMonths as j, endOfMonth as J, startOfDay as L, addMonths as Q, startOfMonth as W, getDate as ce, set as de } from "date-fns";
4
+ import { getCalendarDays as fe, formatMonth as De, getWeekDayNames as ve, calculateNextFocusDate as me, calculatePrevFocusDate as ke, formatDate as be } from "./utils.js";
5
+ import { INTL_MONTH_FORMAT as te } from "./datepicker-constants.js";
6
+ import { returnFirstEl as v, warnIfUnmounted as pe } from "../../common/utils/index.js";
7
7
  import { DialtoneLocalization as U } from "../../localization/index.js";
8
- import Y from "../stack/stack.js";
9
- import R from "../tooltip/tooltip.js";
10
- import C from "../button/button.js";
11
- function he(l, o) {
12
- const u = E(G(l.selectedDate)), a = E(q(l.selectedDate)), n = E(null), r = E(0), m = E([]), D = new U(), h = N(() => fe(u.value, a.value, n.value, l.minDate, l.maxDate)), k = N(() => {
13
- if (!l.minDate) return !1;
14
- const e = W(new Date(a.value, u.value, 1), 1);
15
- return j(e) < P(l.minDate);
8
+ import R from "../stack/stack.js";
9
+ import P from "../tooltip/tooltip.js";
10
+ import I from "../button/button.js";
11
+ function ye(n, o) {
12
+ const u = E(G(n.selectedDate)), a = E(q(n.selectedDate)), l = E(null), r = E(0), m = E([]), D = new U(), h = N(() => fe(
13
+ u.value,
14
+ a.value,
15
+ l.value,
16
+ n.minDate,
17
+ n.maxDate,
18
+ n.weekStartsOn
19
+ )), b = N(() => {
20
+ if (!n.minDate) return !1;
21
+ const e = j(new Date(a.value, u.value, 1), 1);
22
+ return J(e) < L(n.minDate);
16
23
  }), _ = N(() => {
17
- if (!l.maxDate) return !1;
18
- const e = J(new Date(a.value, u.value, 1), 1);
19
- return Q(e) > P(l.maxDate);
20
- }), b = N(() => {
21
- if (!l.minDate) return !1;
24
+ if (!n.maxDate) return !1;
25
+ const e = Q(new Date(a.value, u.value, 1), 1);
26
+ return W(e) > L(n.maxDate);
27
+ }), p = N(() => {
28
+ if (!n.minDate) return !1;
22
29
  const e = new Date(a.value - 1, u.value, 1);
23
- return j(e) < P(l.minDate);
30
+ return J(e) < L(n.minDate);
24
31
  }), T = N(() => {
25
- if (!l.maxDate) return !1;
32
+ if (!n.maxDate) return !1;
26
33
  const e = new Date(a.value + 1, u.value, 1);
27
- return Q(e) > P(l.maxDate);
34
+ return W(e) > L(n.maxDate);
28
35
  });
29
- w(u, () => {
30
- x(), o("calendar-days", h.value);
31
- }, { immediate: !0 }), w(a, () => {
32
- x(), o("calendar-days", h.value);
33
- }, { immediate: !0 }), w(() => l.minDate, () => {
36
+ x(u, () => {
37
+ M(), o("calendar-days", h.value);
38
+ }, { immediate: !0 }), x(a, () => {
39
+ M(), o("calendar-days", h.value);
40
+ }, { immediate: !0 }), x(() => n.minDate, () => {
34
41
  o("calendar-days", h.value);
35
- }), w(() => l.maxDate, () => {
42
+ }), x(() => n.maxDate, () => {
36
43
  o("calendar-days", h.value);
37
44
  });
38
45
  function s(e) {
@@ -63,29 +70,29 @@ function he(l, o) {
63
70
  break;
64
71
  }
65
72
  }
66
- function x() {
67
- const e = q(l.selectedDate), I = G(l.selectedDate);
68
- e !== a.value || I !== u.value ? n.value = null : n.value = ce(l.selectedDate);
73
+ function M() {
74
+ const e = q(n.selectedDate), C = G(n.selectedDate);
75
+ e !== a.value || C !== u.value ? l.value = null : l.value = ce(n.selectedDate);
69
76
  }
70
77
  function y(e) {
71
- if (e === -1 && k.value || e === 1 && _.value) return;
78
+ if (e === -1 && b.value || e === 1 && _.value) return;
72
79
  (u.value === 0 && e === -1 || u.value === 11 && e === 1) && (a.value += e);
73
- const I = de(l.selectedDate, { month: u.value, year: a.value }), ae = e === 1 ? J(I, 1) : W(I, 1);
80
+ const C = de(n.selectedDate, { month: u.value, year: a.value }), ae = e === 1 ? Q(C, 1) : j(C, 1);
74
81
  u.value = G(ae);
75
82
  }
76
83
  function K(e) {
77
- e === -1 && b.value || e === 1 && T.value || (a.value = a.value + e);
84
+ e === -1 && p.value || e === 1 && T.value || (a.value = a.value + e);
78
85
  }
79
- function F() {
86
+ function S() {
80
87
  y(1);
81
88
  }
82
- function z() {
89
+ function F() {
83
90
  y(-1);
84
91
  }
85
- function H() {
92
+ function z() {
86
93
  return `${D.$t("DIALTONE_DATEPICKER_CHANGE_TO")} ${D.$t("DIALTONE_DATEPICKER_PREVIOUS_YEAR")} ${a.value - 1}`;
87
94
  }
88
- function S() {
95
+ function H() {
89
96
  return `${D.$t("DIALTONE_DATEPICKER_CHANGE_TO")} ${D.$t("DIALTONE_DATEPICKER_PREVIOUS_MONTH")} ${s(u.value - 1)}`;
90
97
  }
91
98
  function X() {
@@ -103,22 +110,22 @@ function he(l, o) {
103
110
  handleKeyDown: f,
104
111
  changeMonth: y,
105
112
  changeYear: K,
106
- goToNextMonth: F,
107
- goToPrevMonth: z,
108
- isPrevMonthDisabled: k,
113
+ goToNextMonth: S,
114
+ goToPrevMonth: F,
115
+ isPrevMonthDisabled: b,
109
116
  isNextMonthDisabled: _,
110
- isPrevYearDisabled: b,
117
+ isPrevYearDisabled: p,
111
118
  isNextYearDisabled: T,
112
- previousYearAriaLabel: H,
113
- previousMonthAriaLabel: S,
119
+ previousYearAriaLabel: z,
120
+ previousMonthAriaLabel: H,
114
121
  nextYearAriaLabel: X,
115
122
  nextMonthAriaLabel: c
116
123
  };
117
124
  }
118
- const _e = {
125
+ const he = {
119
126
  id: "calendar-heading",
120
127
  class: "d-datepicker__month-year-title"
121
- }, $e = {
128
+ }, _e = {
122
129
  __name: "month-year-picker",
123
130
  props: {
124
131
  selectedDate: {
@@ -132,6 +139,11 @@ const _e = {
132
139
  maxDate: {
133
140
  type: Date,
134
141
  default: null
142
+ },
143
+ weekStartsOn: {
144
+ type: Number,
145
+ default: 0,
146
+ validator: (n) => Number.isInteger(n) && n >= 0 && n <= 6
135
147
  }
136
148
  },
137
149
  emits: [
@@ -161,58 +173,58 @@ const _e = {
161
173
  */
162
174
  "close-datepicker"
163
175
  ],
164
- setup(l, { expose: o, emit: u }) {
165
- const a = l, n = u, r = new U(), {
176
+ setup(n, { expose: o, emit: u }) {
177
+ const a = n, l = u, r = new U(), {
166
178
  selectMonth: m,
167
179
  selectYear: D,
168
180
  formattedMonth: h,
169
- setDayRef: k,
181
+ setDayRef: b,
170
182
  focusMonthYearPicker: _,
171
- handleKeyDown: b,
183
+ handleKeyDown: p,
172
184
  changeMonth: T,
173
185
  changeYear: s,
174
186
  goToNextMonth: i,
175
187
  goToPrevMonth: A,
176
188
  isPrevMonthDisabled: f,
177
- isNextMonthDisabled: x,
189
+ isNextMonthDisabled: M,
178
190
  isPrevYearDisabled: y,
179
191
  isNextYearDisabled: K,
180
- previousYearAriaLabel: F,
181
- previousMonthAriaLabel: z,
182
- nextMonthAriaLabel: H,
183
- nextYearAriaLabel: S
184
- } = he(a, n);
192
+ previousYearAriaLabel: S,
193
+ previousMonthAriaLabel: F,
194
+ nextMonthAriaLabel: z,
195
+ nextYearAriaLabel: H
196
+ } = ye(a, l);
185
197
  return Z(() => {
186
198
  _();
187
199
  }), o({
188
200
  focusMonthYearPicker: _,
189
201
  goToNextMonth: i,
190
202
  goToPrevMonth: A
191
- }), (X, c) => ($(), ee(t(Y), {
203
+ }), (X, c) => ($(), ee(t(R), {
192
204
  class: "d-datepicker__month-year",
193
205
  direction: "row",
194
206
  gap: "300"
195
207
  }, {
196
- default: p(() => [
197
- d(t(Y), {
208
+ default: k(() => [
209
+ d(t(R), {
198
210
  as: "nav",
199
211
  class: "d-datepicker__nav",
200
212
  direction: "row",
201
213
  gap: "200"
202
214
  }, {
203
- default: p(() => [
204
- d(t(R), {
215
+ default: k(() => [
216
+ d(t(P), {
205
217
  "fallback-placements": ["top-start", "auto"],
206
218
  message: t(r).$t("DIALTONE_DATEPICKER_PREVIOUS_YEAR"),
207
219
  placement: "top"
208
220
  }, {
209
- anchor: p(() => [
210
- d(t(C), {
221
+ anchor: k(() => [
222
+ d(t(I), {
211
223
  id: "prevYearButton",
212
224
  ref: (e) => {
213
- e && t(k)(e);
225
+ e && t(b)(e);
214
226
  },
215
- "aria-label": t(F)(),
227
+ "aria-label": t(S)(),
216
228
  circle: !0,
217
229
  disabled: t(y),
218
230
  class: "d-datepicker__nav-btn",
@@ -221,9 +233,9 @@ const _e = {
221
233
  size: "xs",
222
234
  type: "button",
223
235
  onClick: c[0] || (c[0] = (e) => t(s)(-1)),
224
- onKeydown: c[1] || (c[1] = (e) => t(b)(e))
236
+ onKeydown: c[1] || (c[1] = (e) => t(p)(e))
225
237
  }, {
226
- default: p(() => [
238
+ default: k(() => [
227
239
  d(t(oe), { size: "200" })
228
240
  ]),
229
241
  _: 1
@@ -231,18 +243,18 @@ const _e = {
231
243
  ]),
232
244
  _: 1
233
245
  }, 8, ["message"]),
234
- d(t(R), {
246
+ d(t(P), {
235
247
  "fallback-placements": ["top-start", "auto"],
236
248
  message: t(r).$t("DIALTONE_DATEPICKER_PREVIOUS_MONTH"),
237
249
  placement: "top"
238
250
  }, {
239
- anchor: p(() => [
240
- d(t(C), {
251
+ anchor: k(() => [
252
+ d(t(I), {
241
253
  id: "prevMonthButton",
242
254
  ref: (e) => {
243
- e && t(k)(e);
255
+ e && t(b)(e);
244
256
  },
245
- "aria-label": t(z)(),
257
+ "aria-label": t(F)(),
246
258
  circle: !0,
247
259
  disabled: t(f),
248
260
  class: "d-datepicker__nav-btn",
@@ -251,9 +263,9 @@ const _e = {
251
263
  size: "xs",
252
264
  type: "button",
253
265
  onClick: c[2] || (c[2] = (e) => t(T)(-1)),
254
- onKeydown: c[3] || (c[3] = (e) => t(b)(e))
266
+ onKeydown: c[3] || (c[3] = (e) => t(p)(e))
255
267
  }, {
256
- default: p(() => [
268
+ default: k(() => [
257
269
  d(t(se), { size: "200" })
258
270
  ]),
259
271
  _: 1
@@ -264,37 +276,37 @@ const _e = {
264
276
  ]),
265
277
  _: 1
266
278
  }),
267
- M("div", _e, O(t(h)(t(m))) + " " + O(t(D)), 1),
268
- d(t(Y), {
279
+ w("div", he, Y(t(h)(t(m))) + " " + Y(t(D)), 1),
280
+ d(t(R), {
269
281
  as: "nav",
270
282
  class: "d-datepicker__nav",
271
283
  direction: "row",
272
284
  gap: "200"
273
285
  }, {
274
- default: p(() => [
275
- d(t(R), {
286
+ default: k(() => [
287
+ d(t(P), {
276
288
  "fallback-placements": ["top-end", "auto"],
277
289
  message: t(r).$t("DIALTONE_DATEPICKER_NEXT_MONTH"),
278
290
  placement: "top"
279
291
  }, {
280
- anchor: p(() => [
281
- d(t(C), {
292
+ anchor: k(() => [
293
+ d(t(I), {
282
294
  id: "nextMonthButton",
283
295
  ref: (e) => {
284
- e && t(k)(e);
296
+ e && t(b)(e);
285
297
  },
286
- "aria-label": t(H)(),
298
+ "aria-label": t(z)(),
287
299
  circle: !0,
288
- disabled: t(x),
300
+ disabled: t(M),
289
301
  class: "d-datepicker__nav-btn",
290
302
  importance: "clear",
291
303
  kind: "muted",
292
304
  size: "xs",
293
305
  type: "button",
294
306
  onClick: c[4] || (c[4] = (e) => t(T)(1)),
295
- onKeydown: c[5] || (c[5] = (e) => t(b)(e))
307
+ onKeydown: c[5] || (c[5] = (e) => t(p)(e))
296
308
  }, {
297
- default: p(() => [
309
+ default: k(() => [
298
310
  d(t(ue), { size: "200" })
299
311
  ]),
300
312
  _: 1
@@ -302,18 +314,18 @@ const _e = {
302
314
  ]),
303
315
  _: 1
304
316
  }, 8, ["message"]),
305
- d(t(R), {
317
+ d(t(P), {
306
318
  "fallback-placements": ["top-end", "auto"],
307
319
  message: t(r).$t("DIALTONE_DATEPICKER_NEXT_YEAR"),
308
320
  placement: "top"
309
321
  }, {
310
- anchor: p(() => [
311
- d(t(C), {
322
+ anchor: k(() => [
323
+ d(t(I), {
312
324
  id: "nextYearButton",
313
325
  ref: (e) => {
314
- e && t(k)(e);
326
+ e && t(b)(e);
315
327
  },
316
- "aria-label": t(S)(),
328
+ "aria-label": t(H)(),
317
329
  circle: !0,
318
330
  disabled: t(K),
319
331
  class: "d-datepicker__nav-btn",
@@ -322,9 +334,9 @@ const _e = {
322
334
  size: "xs",
323
335
  type: "button",
324
336
  onClick: c[6] || (c[6] = (e) => t(s)(1)),
325
- onKeydown: c[7] || (c[7] = (e) => t(b)(e))
337
+ onKeydown: c[7] || (c[7] = (e) => t(p)(e))
326
338
  }, {
327
- default: p(() => [
339
+ default: k(() => [
328
340
  d(t(ie), { size: "200" })
329
341
  ]),
330
342
  _: 1
@@ -340,46 +352,46 @@ const _e = {
340
352
  }));
341
353
  }
342
354
  };
343
- function Ee(l, o) {
344
- const u = E(null), a = E(0), n = E([]), r = new U(), m = N(() => ve(l.locale, be));
345
- w(() => l.calendarDays, () => {
346
- a.value = 0, n.value = [], u.value = null;
355
+ function $e(n, o) {
356
+ const u = E(null), a = E(0), l = E([]), r = new U(), m = N(() => ve(n.locale, n.weekStartsOn));
357
+ x(() => n.calendarDays, () => {
358
+ a.value = 0, l.value = [], u.value = null;
347
359
  });
348
360
  function D(s) {
349
- return r.$t("DIALTONE_DATEPICKER_SELECT_DAY") + ` ${ke(s.value, te, r.currentLocale)}`;
361
+ return r.$t("DIALTONE_DATEPICKER_SELECT_DAY") + ` ${be(s.value, te, r.currentLocale)}`;
350
362
  }
351
363
  function h(s, i) {
352
- !n.value.some((A) => A.el === s) && !i.disabled && n.value.push({ el: s, day: i });
364
+ !l.value.some((A) => A.el === s) && !i.disabled && l.value.push({ el: s, day: i });
353
365
  }
354
- function k(s) {
366
+ function b(s) {
355
367
  switch (s.key) {
356
368
  case "ArrowUp":
357
369
  s.preventDefault(), a.value -= 7;
358
370
  try {
359
- v(n.value[a.value].el.$el).focus();
371
+ v(l.value[a.value].el.$el).focus();
360
372
  } catch {
361
- const i = pe(n.value[a.value + 7].day.value);
362
- o("go-to-prev-month"), L(() => {
363
- v(n.value[i - 1].el.$el).focus(), a.value += i - 1;
373
+ const i = ke(l.value[a.value + 7].day.value);
374
+ o("go-to-prev-month"), O(() => {
375
+ v(l.value[i - 1].el.$el).focus(), a.value += i - 1;
364
376
  });
365
377
  }
366
378
  break;
367
379
  case "ArrowDown":
368
380
  s.preventDefault(), a.value += 7;
369
381
  try {
370
- v(n.value[a.value].el.$el).focus();
382
+ v(l.value[a.value].el.$el).focus();
371
383
  } catch {
372
- const i = me(n.value[a.value - 7].day.value);
373
- o("go-to-next-month"), L(() => {
374
- v(n.value[i - 1].el.$el).focus(), a.value += i - 1;
384
+ const i = me(l.value[a.value - 7].day.value);
385
+ o("go-to-next-month"), O(() => {
386
+ v(l.value[i - 1].el.$el).focus(), a.value += i - 1;
375
387
  });
376
388
  }
377
389
  break;
378
390
  case "ArrowLeft":
379
- s.preventDefault(), a.value > 0 ? (a.value -= 1, v(n.value[a.value].el.$el).focus()) : (o("go-to-prev-month"), b());
391
+ s.preventDefault(), a.value > 0 ? (a.value -= 1, v(l.value[a.value].el.$el).focus()) : (o("go-to-prev-month"), p());
380
392
  break;
381
393
  case "ArrowRight":
382
- s.preventDefault(), a.value < n.value.length - 1 ? (a.value += 1, v(n.value[a.value].el.$el).focus()) : (o("go-to-next-month"), _());
394
+ s.preventDefault(), a.value < l.value.length - 1 ? (a.value += 1, v(l.value[a.value].el.$el).focus()) : (o("go-to-next-month"), _());
383
395
  break;
384
396
  case "Tab":
385
397
  s.preventDefault(), o("focus-month-year-picker");
@@ -390,13 +402,13 @@ function Ee(l, o) {
390
402
  }
391
403
  }
392
404
  function _() {
393
- a.value = 0, L(() => {
394
- v(n.value[a.value].el.$el).focus();
405
+ a.value = 0, O(() => {
406
+ v(l.value[a.value].el.$el).focus();
395
407
  });
396
408
  }
397
- function b() {
398
- L(() => {
399
- a.value = n.value.length - 1, v(n.value[a.value].el.$el).focus();
409
+ function p() {
410
+ O(() => {
411
+ a.value = l.value.length - 1, v(l.value[a.value].el.$el).focus();
400
412
  });
401
413
  }
402
414
  function T(s) {
@@ -407,20 +419,25 @@ function Ee(l, o) {
407
419
  weekDays: m,
408
420
  dayAriaLabel: D,
409
421
  setDayRef: h,
410
- handleKeyDown: k,
422
+ handleKeyDown: b,
411
423
  focusFirstDay: _,
412
424
  selectDay: T
413
425
  };
414
426
  }
415
- const Te = {
427
+ const Ee = {
416
428
  class: "d-datepicker__calendar",
417
429
  "aria-labelledby": "calendar-heading"
418
- }, Ae = ["title", "aria-label"], ge = {
430
+ }, Te = ["title", "aria-label"], Ae = {
419
431
  __name: "calendar",
420
432
  props: {
421
433
  calendarDays: {
422
434
  type: Array,
423
435
  required: !0
436
+ },
437
+ weekStartsOn: {
438
+ type: Number,
439
+ default: 0,
440
+ validator: (n) => Number.isInteger(n) && n >= 0 && n <= 6
424
441
  }
425
442
  },
426
443
  emits: [
@@ -456,42 +473,42 @@ const Te = {
456
473
  */
457
474
  "go-to-prev-month"
458
475
  ],
459
- setup(l, { expose: o, emit: u }) {
460
- const a = l, n = u, {
476
+ setup(n, { expose: o, emit: u }) {
477
+ const a = n, l = u, {
461
478
  selectedDay: r,
462
479
  weekDays: m,
463
480
  dayAriaLabel: D,
464
481
  setDayRef: h,
465
- handleKeyDown: k,
482
+ handleKeyDown: b,
466
483
  focusFirstDay: _,
467
- selectDay: b
468
- } = Ee(a, n);
484
+ selectDay: p
485
+ } = $e(a, l);
469
486
  return o({
470
487
  focusFirstDay: _
471
- }), (T, s) => ($(), g("table", Te, [
472
- M("thead", null, [
473
- M("tr", null, [
488
+ }), (T, s) => ($(), g("table", Ee, [
489
+ w("thead", null, [
490
+ w("tr", null, [
474
491
  ($(!0), g(B, null, V(t(m), (i) => ($(), g("th", {
475
492
  key: i,
476
493
  scope: "col",
477
494
  class: "d-datepicker__cell d-datepicker__cell--header"
478
495
  }, [
479
- M("span", {
496
+ w("span", {
480
497
  class: "d-datepicker__weekday",
481
498
  title: i,
482
499
  "aria-label": i
483
- }, O(i), 9, Ae)
500
+ }, Y(i), 9, Te)
484
501
  ]))), 128))
485
502
  ])
486
503
  ]),
487
- M("tbody", null, [
488
- ($(!0), g(B, null, V(l.calendarDays, (i, A) => ($(), g("tr", { key: A }, [
489
- ($(!0), g(B, null, V(i.days, (f, x) => ($(), g("td", {
490
- key: A + x,
504
+ w("tbody", null, [
505
+ ($(!0), g(B, null, V(n.calendarDays, (i, A) => ($(), g("tr", { key: A }, [
506
+ ($(!0), g(B, null, V(i.days, (f, M) => ($(), g("td", {
507
+ key: A + M,
491
508
  class: "d-datepicker__cell",
492
509
  role: "listbox"
493
510
  }, [
494
- d(t(C), {
511
+ d(t(I), {
495
512
  ref_for: !0,
496
513
  ref: (y) => {
497
514
  y && t(h)(y, f);
@@ -508,11 +525,11 @@ const Te = {
508
525
  "aria-selected": t(r) ? f.text === t(r) && !f.disabled : f.selected,
509
526
  "aria-label": t(D)(f),
510
527
  role: "option",
511
- onClick: (y) => t(b)(f),
512
- onKeydown: s[0] || (s[0] = (y) => t(k)(y))
528
+ onClick: (y) => t(p)(f),
529
+ onKeydown: s[0] || (s[0] = (y) => t(b)(y))
513
530
  }, {
514
- default: p(() => [
515
- le(O(f.text), 1)
531
+ default: k(() => [
532
+ le(Y(f.text), 1)
516
533
  ]),
517
534
  _: 2
518
535
  }, 1032, ["disabled", "class", "aria-selected", "aria-label", "onClick"])
@@ -521,7 +538,7 @@ const Te = {
521
538
  ])
522
539
  ]));
523
540
  }
524
- }, Me = { class: "d-datepicker__hd" }, xe = { class: "d-datepicker__bd" }, Fe = {
541
+ }, ge = { class: "d-datepicker__hd" }, we = { class: "d-datepicker__bd" }, Ke = {
525
542
  __name: "datepicker",
526
543
  props: {
527
544
  /**
@@ -552,7 +569,17 @@ const Te = {
552
569
  maxDate: {
553
570
  type: Date,
554
571
  default: null,
555
- validator: (l, o) => l && o.minDate && l < o.minDate ? (console.warn("[DtDatepicker]: maxDate must be after or equal to minDate."), !1) : !0
572
+ validator: (n, o) => n && o.minDate && n < o.minDate ? (console.warn("[DtDatepicker]: maxDate must be after or equal to minDate."), !1) : !0
573
+ },
574
+ /**
575
+ * Day the week starts on. 0 = Sunday, 1 = Monday, ... 6 = Saturday.
576
+ *
577
+ * @values 0, 1, 2, 3, 4, 5, 6
578
+ */
579
+ weekStartsOn: {
580
+ type: Number,
581
+ default: 0,
582
+ validator: (n) => Number.isInteger(n) && n >= 0 && n <= 6
556
583
  }
557
584
  },
558
585
  emits: [
@@ -570,41 +597,43 @@ const Te = {
570
597
  */
571
598
  "close-datepicker"
572
599
  ],
573
- setup(l) {
600
+ setup(n) {
574
601
  const o = E([]);
575
602
  function u(a) {
576
603
  o.value = a;
577
604
  }
578
605
  return Z(() => {
579
606
  const a = re();
580
- ye(v(a.proxy.$el), "datepicker");
581
- }), (a, n) => ($(), ee(t(Y), {
607
+ pe(v(a.proxy.$el), "datepicker");
608
+ }), (a, l) => ($(), ee(t(R), {
582
609
  class: "d-datepicker",
583
610
  gap: "400"
584
611
  }, {
585
- default: p(() => [
586
- M("div", Me, [
587
- d($e, {
612
+ default: k(() => [
613
+ w("div", ge, [
614
+ d(_e, {
588
615
  ref: "monthYearPicker",
589
- "selected-date": l.selectedDate,
590
- "min-date": l.minDate,
591
- "max-date": l.maxDate,
616
+ "selected-date": n.selectedDate,
617
+ "min-date": n.minDate,
618
+ "max-date": n.maxDate,
619
+ "week-starts-on": n.weekStartsOn,
592
620
  onCalendarDays: u,
593
- onFocusFirstDay: n[0] || (n[0] = (r) => a.$refs.calendar.focusFirstDay()),
594
- onFocusLastDay: n[1] || (n[1] = (r) => a.$refs.calendar.focusLastDay()),
595
- onCloseDatepicker: n[2] || (n[2] = (r) => a.$emit("close-datepicker"))
596
- }, null, 8, ["selected-date", "min-date", "max-date"])
621
+ onFocusFirstDay: l[0] || (l[0] = (r) => a.$refs.calendar.focusFirstDay()),
622
+ onFocusLastDay: l[1] || (l[1] = (r) => a.$refs.calendar.focusLastDay()),
623
+ onCloseDatepicker: l[2] || (l[2] = (r) => a.$emit("close-datepicker"))
624
+ }, null, 8, ["selected-date", "min-date", "max-date", "week-starts-on"])
597
625
  ]),
598
- M("div", xe, [
599
- d(ge, {
626
+ w("div", we, [
627
+ d(Ae, {
600
628
  ref: "calendar",
601
629
  "calendar-days": o.value,
602
- onSelectDate: n[3] || (n[3] = (r) => a.$emit("selected-date", r)),
603
- onFocusMonthYearPicker: n[4] || (n[4] = (r) => a.$refs.monthYearPicker.focusMonthYearPicker()),
604
- onCloseDatepicker: n[5] || (n[5] = (r) => a.$emit("close-datepicker")),
605
- onGoToNextMonth: n[6] || (n[6] = (r) => a.$refs.monthYearPicker.goToNextMonth()),
606
- onGoToPrevMonth: n[7] || (n[7] = (r) => a.$refs.monthYearPicker.goToPrevMonth())
607
- }, null, 8, ["calendar-days"])
630
+ "week-starts-on": n.weekStartsOn,
631
+ onSelectDate: l[3] || (l[3] = (r) => a.$emit("selected-date", r)),
632
+ onFocusMonthYearPicker: l[4] || (l[4] = (r) => a.$refs.monthYearPicker.focusMonthYearPicker()),
633
+ onCloseDatepicker: l[5] || (l[5] = (r) => a.$emit("close-datepicker")),
634
+ onGoToNextMonth: l[6] || (l[6] = (r) => a.$refs.monthYearPicker.goToNextMonth()),
635
+ onGoToPrevMonth: l[7] || (l[7] = (r) => a.$refs.monthYearPicker.goToPrevMonth())
636
+ }, null, 8, ["calendar-days", "week-starts-on"])
608
637
  ])
609
638
  ]),
610
639
  _: 1
@@ -612,6 +641,6 @@ const Te = {
612
641
  }
613
642
  };
614
643
  export {
615
- Fe as default
644
+ Ke as default
616
645
  };
617
646
  //# sourceMappingURL=datepicker.js.map