@paperless/core 2.15.0 → 2.15.2

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.
Files changed (65) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/dist/build/p-481a8ecd.entry.js +2 -0
  3. package/dist/build/p-481a8ecd.entry.js.map +1 -0
  4. package/dist/build/p-6aa5fec2.entry.js +2 -0
  5. package/dist/build/p-6aa5fec2.entry.js.map +1 -0
  6. package/dist/build/p-BYMwCs48.js +2 -0
  7. package/dist/build/p-BYMwCs48.js.map +1 -0
  8. package/dist/build/p-calendar.entry.esm.js.map +1 -1
  9. package/dist/build/p-datepicker.entry.esm.js.map +1 -1
  10. package/dist/build/{p-41efd48b.js → p-f967fae6.js} +1 -1
  11. package/dist/build/paperless.esm.js +1 -1
  12. package/dist/cjs/{index-Dt9qqH1T.js → index-BrXouTWt.js} +142 -2
  13. package/dist/cjs/index-BrXouTWt.js.map +1 -0
  14. package/dist/cjs/p-calendar.cjs.entry.js +32 -164
  15. package/dist/cjs/p-calendar.cjs.entry.js.map +1 -1
  16. package/dist/cjs/p-calendar.entry.cjs.js.map +1 -1
  17. package/dist/cjs/p-datepicker.cjs.entry.js +23 -13
  18. package/dist/cjs/p-datepicker.cjs.entry.js.map +1 -1
  19. package/dist/cjs/p-datepicker.entry.cjs.js.map +1 -1
  20. package/dist/collection/components/molecules/calendar/calendar.component.js +17 -13
  21. package/dist/collection/components/molecules/calendar/calendar.component.js.map +1 -1
  22. package/dist/collection/components/molecules/datepicker/datepicker.component.js +31 -16
  23. package/dist/collection/components/molecules/datepicker/datepicker.component.js.map +1 -1
  24. package/dist/components/{p-3yDjwtDu.js → p-CLnjjZGE.js} +16 -12
  25. package/dist/components/p-CLnjjZGE.js.map +1 -0
  26. package/dist/components/p-calendar.js +1 -1
  27. package/dist/components/p-datepicker.js +23 -13
  28. package/dist/components/p-datepicker.js.map +1 -1
  29. package/dist/esm/{index-EKSDxqjG.js → index-BYMwCs48.js} +139 -3
  30. package/dist/esm/index-BYMwCs48.js.map +1 -0
  31. package/dist/esm/p-calendar.entry.js +14 -146
  32. package/dist/esm/p-calendar.entry.js.map +1 -1
  33. package/dist/esm/p-datepicker.entry.js +23 -13
  34. package/dist/esm/p-datepicker.entry.js.map +1 -1
  35. package/dist/index.html +1 -1
  36. package/dist/paperless/p-481a8ecd.entry.js +2 -0
  37. package/dist/paperless/p-481a8ecd.entry.js.map +1 -0
  38. package/dist/paperless/p-6aa5fec2.entry.js +2 -0
  39. package/dist/paperless/p-6aa5fec2.entry.js.map +1 -0
  40. package/dist/paperless/p-BYMwCs48.js +2 -0
  41. package/dist/paperless/p-BYMwCs48.js.map +1 -0
  42. package/dist/paperless/p-calendar.entry.esm.js.map +1 -1
  43. package/dist/paperless/p-datepicker.entry.esm.js.map +1 -1
  44. package/dist/paperless/paperless.esm.js +1 -1
  45. package/dist/sw.js +1 -1
  46. package/dist/sw.js.map +1 -1
  47. package/dist/types/components/molecules/calendar/calendar.component.d.ts +2 -2
  48. package/dist/types/components/molecules/datepicker/datepicker.component.d.ts +5 -4
  49. package/dist/types/components.d.ts +8 -8
  50. package/package.json +1 -1
  51. package/dist/build/p-60974307.entry.js +0 -2
  52. package/dist/build/p-60974307.entry.js.map +0 -1
  53. package/dist/build/p-EKSDxqjG.js +0 -2
  54. package/dist/build/p-EKSDxqjG.js.map +0 -1
  55. package/dist/build/p-aeb59c96.entry.js +0 -2
  56. package/dist/build/p-aeb59c96.entry.js.map +0 -1
  57. package/dist/cjs/index-Dt9qqH1T.js.map +0 -1
  58. package/dist/components/p-3yDjwtDu.js.map +0 -1
  59. package/dist/esm/index-EKSDxqjG.js.map +0 -1
  60. package/dist/paperless/p-60974307.entry.js +0 -2
  61. package/dist/paperless/p-60974307.entry.js.map +0 -1
  62. package/dist/paperless/p-EKSDxqjG.js +0 -2
  63. package/dist/paperless/p-EKSDxqjG.js.map +0 -1
  64. package/dist/paperless/p-aeb59c96.entry.js +0 -2
  65. package/dist/paperless/p-aeb59c96.entry.js.map +0 -1
@@ -3,7 +3,7 @@ import { c as cva } from './index-CO0T2jO4.js';
3
3
  import { c as cn } from './cn-BniKgfyU.js';
4
4
  import { b as state } from './state-DKMgUotc.js';
5
5
  import { T as ThemedHost } from './themed-host.component-C8HmhEcP.js';
6
- import { r as requiredArgs, t as toDate, c as toInteger, o as isBefore, p as isAfter, n as isValid, x as isSameDay, y as isWeekend, q as format, u as locale, l as locale$1, v as startOfDay, w as startOfMonth } from './index-EKSDxqjG.js';
6
+ import { r as requiredArgs, t as toDate, c as toInteger, o as isBefore, p as isAfter, n as isValid, x as isSameDay, y as isWeekend, q as format, u as locale, l as locale$1, A as getYear, B as setYear, C as addMonths, z as addYears, v as startOfDay, w as startOfMonth } from './index-BYMwCs48.js';
7
7
  import './clsx-ChV9xqsO.js';
8
8
 
9
9
  /**
@@ -39,89 +39,6 @@ function addDays(dirtyDate, dirtyAmount) {
39
39
  return date;
40
40
  }
41
41
 
42
- /**
43
- * @name addMonths
44
- * @category Month Helpers
45
- * @summary Add the specified number of months to the given date.
46
- *
47
- * @description
48
- * Add the specified number of months to the given date.
49
- *
50
- * @param {Date|Number} date - the date to be changed
51
- * @param {Number} amount - the amount of months to be added. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.
52
- * @returns {Date} the new date with the months added
53
- * @throws {TypeError} 2 arguments required
54
- *
55
- * @example
56
- * // Add 5 months to 1 September 2014:
57
- * const result = addMonths(new Date(2014, 8, 1), 5)
58
- * //=> Sun Feb 01 2015 00:00:00
59
- */
60
- function addMonths(dirtyDate, dirtyAmount) {
61
- requiredArgs(2, arguments);
62
- var date = toDate(dirtyDate);
63
- var amount = toInteger(dirtyAmount);
64
- if (isNaN(amount)) {
65
- return new Date(NaN);
66
- }
67
- if (!amount) {
68
- // If 0 months, no-op to avoid changing times in the hour before end of DST
69
- return date;
70
- }
71
- var dayOfMonth = date.getDate();
72
-
73
- // The JS Date object supports date math by accepting out-of-bounds values for
74
- // month, day, etc. For example, new Date(2020, 0, 0) returns 31 Dec 2019 and
75
- // new Date(2020, 13, 1) returns 1 Feb 2021. This is *almost* the behavior we
76
- // want except that dates will wrap around the end of a month, meaning that
77
- // new Date(2020, 13, 31) will return 3 Mar 2021 not 28 Feb 2021 as desired. So
78
- // we'll default to the end of the desired month by adding 1 to the desired
79
- // month and using a date of 0 to back up one day to the end of the desired
80
- // month.
81
- var endOfDesiredMonth = new Date(date.getTime());
82
- endOfDesiredMonth.setMonth(date.getMonth() + amount + 1, 0);
83
- var daysInMonth = endOfDesiredMonth.getDate();
84
- if (dayOfMonth >= daysInMonth) {
85
- // If we're already at the end of the month, then this is the correct date
86
- // and we're done.
87
- return endOfDesiredMonth;
88
- } else {
89
- // Otherwise, we now know that setting the original day-of-month value won't
90
- // cause an overflow, so set the desired day-of-month. Note that we can't
91
- // just set the date of `endOfDesiredMonth` because that object may have had
92
- // its time changed in the unusual case where where a DST transition was on
93
- // the last day of the month and its local time was in the hour skipped or
94
- // repeated next to a DST transition. So we use `date` instead which is
95
- // guaranteed to still have the original time.
96
- date.setFullYear(endOfDesiredMonth.getFullYear(), endOfDesiredMonth.getMonth(), dayOfMonth);
97
- return date;
98
- }
99
- }
100
-
101
- /**
102
- * @name addYears
103
- * @category Year Helpers
104
- * @summary Add the specified number of years to the given date.
105
- *
106
- * @description
107
- * Add the specified number of years to the given date.
108
- *
109
- * @param {Date|Number} date - the date to be changed
110
- * @param {Number} amount - the amount of years to be added. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.
111
- * @returns {Date} the new date with the years added
112
- * @throws {TypeError} 2 arguments required
113
- *
114
- * @example
115
- * // Add 5 years to 1 September 2014:
116
- * const result = addYears(new Date(2014, 8, 1), 5)
117
- * //=> Sun Sep 01 2019 00:00:00
118
- */
119
- function addYears(dirtyDate, dirtyAmount) {
120
- requiredArgs(2, arguments);
121
- var amount = toInteger(dirtyAmount);
122
- return addMonths(dirtyDate, amount * 12);
123
- }
124
-
125
42
  /**
126
43
  * @name endOfMonth
127
44
  * @category Month Helpers
@@ -201,28 +118,6 @@ function getDaysInMonth(dirtyDate) {
201
118
  return lastDayOfMonth.getDate();
202
119
  }
203
120
 
204
- /**
205
- * @name getYear
206
- * @category Year Helpers
207
- * @summary Get the year of the given date.
208
- *
209
- * @description
210
- * Get the year of the given date.
211
- *
212
- * @param {Date|Number} date - the given date
213
- * @returns {Number} the year
214
- * @throws {TypeError} 1 argument required
215
- *
216
- * @example
217
- * // Which year is 2 July 2014?
218
- * const result = getYear(new Date(2014, 6, 2))
219
- * //=> 2014
220
- */
221
- function getYear(dirtyDate) {
222
- requiredArgs(1, arguments);
223
- return toDate(dirtyDate).getFullYear();
224
- }
225
-
226
121
  /**
227
122
  * @name isSameMonth
228
123
  * @category Month Helpers
@@ -338,37 +233,6 @@ function setDate(dirtyDate, dirtyDayOfMonth) {
338
233
  return date;
339
234
  }
340
235
 
341
- /**
342
- * @name setYear
343
- * @category Year Helpers
344
- * @summary Set the year to the given date.
345
- *
346
- * @description
347
- * Set the year to the given date.
348
- *
349
- * @param {Date|Number} date - the date to be changed
350
- * @param {Number} year - the year of the new date
351
- * @returns {Date} the new date with the year set
352
- * @throws {TypeError} 2 arguments required
353
- *
354
- * @example
355
- * // Set year 2013 to 1 September 2014:
356
- * const result = setYear(new Date(2014, 8, 1), 2013)
357
- * //=> Sun Sep 01 2013 00:00:00
358
- */
359
- function setYear(dirtyDate, dirtyYear) {
360
- requiredArgs(2, arguments);
361
- var date = toDate(dirtyDate);
362
- var year = toInteger(dirtyYear);
363
-
364
- // Check if date is Invalid Date because Date.prototype.setFullYear ignores the value of Invalid Date
365
- if (isNaN(date.getTime())) {
366
- return new Date(NaN);
367
- }
368
- date.setFullYear(year);
369
- return date;
370
- }
371
-
372
236
  const calendarComponentCss = "*{box-sizing:border-box}.static{position:static!important}.col-start-1{grid-column-start:1!important}.col-start-2{grid-column-start:2!important}.col-start-3{grid-column-start:3!important}.col-start-4{grid-column-start:4!important}.col-start-5{grid-column-start:5!important}.col-start-6{grid-column-start:6!important}.col-start-7{grid-column-start:7!important}.ml-auto{margin-left:auto!important}.flex{display:flex!important}.grid{display:grid!important}.h-8{height:2rem!important}.h-auto{height:auto!important}.h-full{height:100%!important}.max-h-\\[15rem\\]{max-height:15rem!important}.min-h-\\[12rem\\]{min-height:12rem!important}.min-h-\\[15rem\\]{min-height:15rem!important}.w-8{width:2rem!important}.w-\\[17\\.5rem\\]{width:17.5rem!important}.w-full{width:100%!important}.flex-1{flex:1 1 0%!important}.cursor-not-allowed{cursor:not-allowed!important}.cursor-pointer{cursor:pointer!important}.grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))!important}.grid-cols-7{grid-template-columns:repeat(7,minmax(0,1fr))!important}.flex-col{flex-direction:column!important}.flex-wrap{flex-wrap:wrap!important}.items-start{align-items:flex-start!important}.items-center{align-items:center!important}.justify-center{justify-content:center!important}.justify-between{justify-content:space-between!important}.gap-1{gap:.25rem!important}.gap-2{gap:.5rem!important}.gap-4{gap:1rem!important}.overflow-scroll{overflow:scroll!important}.rounded-lg{border-radius:.5rem!important}.border{border-width:1px!important}.border-solid{border-style:solid!important}.border-off-white-700{--tw-border-opacity:1!important;border-color:rgb(222 219 213/var(--tw-border-opacity,1))!important}.border-storm-100{--tw-border-opacity:1!important;border-color:rgb(209 210 212/var(--tw-border-opacity,1))!important}.bg-off-white-300{--tw-bg-opacity:1!important;background-color:rgb(248 247 244/var(--tw-bg-opacity,1))!important}.p-1{padding:.25rem!important}.p-2{padding:.5rem!important}.text-center{text-align:center!important}.text-sm{font-size:.875rem!important;line-height:1.25rem!important}.text-xs{font-size:.75rem!important;line-height:1rem!important}.font-semibold{font-weight:600!important}.text-hurricane-200,.text-storm-200{--tw-text-opacity:1!important;color:rgb(163 165 169/var(--tw-text-opacity,1))!important}.text-storm-300{--tw-text-opacity:1!important;color:rgb(116 120 127/var(--tw-text-opacity,1))!important}.text-storm-500{color:rgb(24 30 41/var(--tw-text-opacity,1))!important}.text-storm-500,.text-white{--tw-text-opacity:1!important}.text-white{color:rgb(255 255 255/var(--tw-text-opacity,1))!important}.opacity-60{opacity:.6!important}.drop-shadow-2{--tw-drop-shadow:drop-shadow(0 1px 1px rgba(0,2,2,.04)) drop-shadow(0 2px 2px rgba(0,2,2,.04)) drop-shadow(0 4px 4px rgba(0,2,2,.04))!important}.drop-shadow-2,.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)!important}.hover\\:bg-white-600:hover{--tw-bg-opacity:1!important;background-color:rgb(250 250 250/var(--tw-bg-opacity,1))!important}.hover\\:text-storm-500:hover{--tw-text-opacity:1!important;color:rgb(24 30 41/var(--tw-text-opacity,1))!important}.dark\\:border-none:where(:host([data-theme=dark]),:host([data-theme=dark]) *){border-style:none!important}.dark\\:bg-hurricane-200:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-bg-opacity:1!important;background-color:rgb(163 165 169/var(--tw-bg-opacity,1))!important}.dark\\:bg-white\\/15:where(:host([data-theme=dark]),:host([data-theme=dark]) *){background-color:hsla(0,0%,100%,.15)!important}.dark\\:text-hurricane-200:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-text-opacity:1!important;color:rgb(163 165 169/var(--tw-text-opacity,1))!important}.dark\\:text-white:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-text-opacity:1!important;color:rgb(255 255 255/var(--tw-text-opacity,1))!important}.dark\\:hover\\:bg-hurricane-300:hover:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-bg-opacity:1!important;background-color:rgb(116 120 127/var(--tw-bg-opacity,1))!important}.dark\\:hover\\:text-white:hover:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-text-opacity:1!important;color:rgb(255 255 255/var(--tw-text-opacity,1))!important}.dark\\:border-none:where([data-theme=dark],[data-theme=dark] *){border-style:none!important}.dark\\:bg-hurricane-200:where([data-theme=dark],[data-theme=dark] *){--tw-bg-opacity:1!important;background-color:rgb(163 165 169/var(--tw-bg-opacity,1))!important}.dark\\:bg-white\\/15:where([data-theme=dark],[data-theme=dark] *){background-color:hsla(0,0%,100%,.15)!important}.dark\\:text-hurricane-200:where([data-theme=dark],[data-theme=dark] *){--tw-text-opacity:1!important;color:rgb(163 165 169/var(--tw-text-opacity,1))!important}.dark\\:text-white:where([data-theme=dark],[data-theme=dark] *){--tw-text-opacity:1!important;color:rgb(255 255 255/var(--tw-text-opacity,1))!important}.dark\\:hover\\:bg-hurricane-300:hover:where([data-theme=dark],[data-theme=dark] *){--tw-bg-opacity:1!important;background-color:rgb(116 120 127/var(--tw-bg-opacity,1))!important}.dark\\:hover\\:text-white:hover:where([data-theme=dark],[data-theme=dark] *){--tw-text-opacity:1!important;color:rgb(255 255 255/var(--tw-text-opacity,1))!important}";
373
237
 
374
238
  const calendar = cva(['w-[17.5rem] flex flex-col gap-4'], {
@@ -425,11 +289,11 @@ const Calendar = class {
425
289
  /**
426
290
  * Min date
427
291
  */
428
- minDate = new Date(1970, 0, 1);
292
+ minDate = null;
429
293
  /**
430
294
  * Max date
431
295
  */
432
- maxDate = this._getAutomaticMax();
296
+ maxDate = null;
433
297
  /**
434
298
  * Wether to disable the weekends
435
299
  */
@@ -464,12 +328,8 @@ const Calendar = class {
464
328
  if (this.disabledDates) {
465
329
  this._parseDisabledDates(this.disabledDates);
466
330
  }
467
- if (this.minDate) {
468
- this._parseMinDate(this.minDate);
469
- }
470
- if (this.maxDate) {
471
- this._parseMaxDate(this.maxDate);
472
- }
331
+ this._parseMinDate(this.minDate);
332
+ this._parseMaxDate(this.maxDate);
473
333
  this._parseValue(this.value);
474
334
  if (this._value) {
475
335
  this._viewDate = this._value;
@@ -503,6 +363,10 @@ const Calendar = class {
503
363
  this._setValue(value);
504
364
  }
505
365
  _parseMinDate(minDate) {
366
+ if (minDate === null || minDate === '') {
367
+ this.minDate = new Date(1970, 0, 1);
368
+ return;
369
+ }
506
370
  if (typeof minDate === 'string') {
507
371
  minDate = new Date(minDate);
508
372
  }
@@ -515,6 +379,10 @@ const Calendar = class {
515
379
  }
516
380
  }
517
381
  _parseMaxDate(maxDate) {
382
+ if (maxDate === null || maxDate === '') {
383
+ this.maxDate = this._getAutomaticMax();
384
+ return;
385
+ }
518
386
  if (typeof maxDate === 'string') {
519
387
  maxDate = new Date(maxDate);
520
388
  }
@@ -552,7 +420,7 @@ const Calendar = class {
552
420
  }
553
421
  }
554
422
  render() {
555
- return (h(ThemedHost, { key: 'a67037bb3c525c3391ed3f233ace8a33f21db910' }, h("div", { key: '33c5b267fdece050bf5c927508f896583b16875d', class: calendar({ variant: this.variant }) }, this._getView())));
423
+ return (h(ThemedHost, { key: 'edef107b0a9b73c1b329b899352d54adcee3a14c' }, h("div", { key: 'aaf6d9578454c5143f3b1b4995a443ed094d7a41', class: calendar({ variant: this.variant }) }, this._getView())));
556
424
  }
557
425
  _checkTodayButton() {
558
426
  if (this._maxDate && isAfter(this._today, this._maxDate)) {
@@ -1 +1 @@
1
- {"version":3,"file":"p-calendar.entry.js","sources":["../../node_modules/date-fns/esm/addDays/index.js","../../node_modules/date-fns/esm/addMonths/index.js","../../node_modules/date-fns/esm/addYears/index.js","../../node_modules/date-fns/esm/endOfMonth/index.js","../../node_modules/date-fns/esm/getDay/index.js","../../node_modules/date-fns/esm/getDaysInMonth/index.js","../../node_modules/date-fns/esm/getYear/index.js","../../node_modules/date-fns/esm/isSameMonth/index.js","../../node_modules/date-fns/esm/isSameYear/index.js","../../node_modules/date-fns/esm/setMonth/index.js","../../node_modules/date-fns/esm/setDate/index.js","../../node_modules/date-fns/esm/setYear/index.js","src/components/molecules/calendar/calendar.component.css?tag=p-calendar&encapsulation=shadow","src/components/molecules/calendar/calendar.component.tsx"],"sourcesContent":["import toInteger from \"../_lib/toInteger/index.js\";\nimport toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name addDays\n * @category Day Helpers\n * @summary Add the specified number of days to the given date.\n *\n * @description\n * Add the specified number of days to the given date.\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} amount - the amount of days to be added. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.\n * @returns {Date} - the new date with the days added\n * @throws {TypeError} - 2 arguments required\n *\n * @example\n * // Add 10 days to 1 September 2014:\n * const result = addDays(new Date(2014, 8, 1), 10)\n * //=> Thu Sep 11 2014 00:00:00\n */\nexport default function addDays(dirtyDate, dirtyAmount) {\n requiredArgs(2, arguments);\n var date = toDate(dirtyDate);\n var amount = toInteger(dirtyAmount);\n if (isNaN(amount)) {\n return new Date(NaN);\n }\n if (!amount) {\n // If 0 days, no-op to avoid changing times in the hour before end of DST\n return date;\n }\n date.setDate(date.getDate() + amount);\n return date;\n}","import toInteger from \"../_lib/toInteger/index.js\";\nimport toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name addMonths\n * @category Month Helpers\n * @summary Add the specified number of months to the given date.\n *\n * @description\n * Add the specified number of months to the given date.\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} amount - the amount of months to be added. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.\n * @returns {Date} the new date with the months added\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Add 5 months to 1 September 2014:\n * const result = addMonths(new Date(2014, 8, 1), 5)\n * //=> Sun Feb 01 2015 00:00:00\n */\nexport default function addMonths(dirtyDate, dirtyAmount) {\n requiredArgs(2, arguments);\n var date = toDate(dirtyDate);\n var amount = toInteger(dirtyAmount);\n if (isNaN(amount)) {\n return new Date(NaN);\n }\n if (!amount) {\n // If 0 months, no-op to avoid changing times in the hour before end of DST\n return date;\n }\n var dayOfMonth = date.getDate();\n\n // The JS Date object supports date math by accepting out-of-bounds values for\n // month, day, etc. For example, new Date(2020, 0, 0) returns 31 Dec 2019 and\n // new Date(2020, 13, 1) returns 1 Feb 2021. This is *almost* the behavior we\n // want except that dates will wrap around the end of a month, meaning that\n // new Date(2020, 13, 31) will return 3 Mar 2021 not 28 Feb 2021 as desired. So\n // we'll default to the end of the desired month by adding 1 to the desired\n // month and using a date of 0 to back up one day to the end of the desired\n // month.\n var endOfDesiredMonth = new Date(date.getTime());\n endOfDesiredMonth.setMonth(date.getMonth() + amount + 1, 0);\n var daysInMonth = endOfDesiredMonth.getDate();\n if (dayOfMonth >= daysInMonth) {\n // If we're already at the end of the month, then this is the correct date\n // and we're done.\n return endOfDesiredMonth;\n } else {\n // Otherwise, we now know that setting the original day-of-month value won't\n // cause an overflow, so set the desired day-of-month. Note that we can't\n // just set the date of `endOfDesiredMonth` because that object may have had\n // its time changed in the unusual case where where a DST transition was on\n // the last day of the month and its local time was in the hour skipped or\n // repeated next to a DST transition. So we use `date` instead which is\n // guaranteed to still have the original time.\n date.setFullYear(endOfDesiredMonth.getFullYear(), endOfDesiredMonth.getMonth(), dayOfMonth);\n return date;\n }\n}","import toInteger from \"../_lib/toInteger/index.js\";\nimport addMonths from \"../addMonths/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name addYears\n * @category Year Helpers\n * @summary Add the specified number of years to the given date.\n *\n * @description\n * Add the specified number of years to the given date.\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} amount - the amount of years to be added. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.\n * @returns {Date} the new date with the years added\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Add 5 years to 1 September 2014:\n * const result = addYears(new Date(2014, 8, 1), 5)\n * //=> Sun Sep 01 2019 00:00:00\n */\nexport default function addYears(dirtyDate, dirtyAmount) {\n requiredArgs(2, arguments);\n var amount = toInteger(dirtyAmount);\n return addMonths(dirtyDate, amount * 12);\n}","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name endOfMonth\n * @category Month Helpers\n * @summary Return the end of a month for the given date.\n *\n * @description\n * Return the end of a month for the given date.\n * The result will be in the local timezone.\n *\n * @param {Date|Number} date - the original date\n * @returns {Date} the end of a month\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // The end of a month for 2 September 2014 11:55:00:\n * const result = endOfMonth(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Tue Sep 30 2014 23:59:59.999\n */\nexport default function endOfMonth(dirtyDate) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate);\n var month = date.getMonth();\n date.setFullYear(date.getFullYear(), month + 1, 0);\n date.setHours(23, 59, 59, 999);\n return date;\n}","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name getDay\n * @category Weekday Helpers\n * @summary Get the day of the week of the given date.\n *\n * @description\n * Get the day of the week of the given date.\n *\n * @param {Date|Number} date - the given date\n * @returns {0|1|2|3|4|5|6} the day of week, 0 represents Sunday\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // Which day of the week is 29 February 2012?\n * const result = getDay(new Date(2012, 1, 29))\n * //=> 3\n */\nexport default function getDay(dirtyDate) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate);\n var day = date.getDay();\n return day;\n}","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name getDaysInMonth\n * @category Month Helpers\n * @summary Get the number of days in a month of the given date.\n *\n * @description\n * Get the number of days in a month of the given date.\n *\n * @param {Date|Number} date - the given date\n * @returns {Number} the number of days in a month\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // How many days are in February 2000?\n * const result = getDaysInMonth(new Date(2000, 1))\n * //=> 29\n */\nexport default function getDaysInMonth(dirtyDate) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate);\n var year = date.getFullYear();\n var monthIndex = date.getMonth();\n var lastDayOfMonth = new Date(0);\n lastDayOfMonth.setFullYear(year, monthIndex + 1, 0);\n lastDayOfMonth.setHours(0, 0, 0, 0);\n return lastDayOfMonth.getDate();\n}","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name getYear\n * @category Year Helpers\n * @summary Get the year of the given date.\n *\n * @description\n * Get the year of the given date.\n *\n * @param {Date|Number} date - the given date\n * @returns {Number} the year\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // Which year is 2 July 2014?\n * const result = getYear(new Date(2014, 6, 2))\n * //=> 2014\n */\nexport default function getYear(dirtyDate) {\n requiredArgs(1, arguments);\n return toDate(dirtyDate).getFullYear();\n}","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name isSameMonth\n * @category Month Helpers\n * @summary Are the given dates in the same month (and year)?\n *\n * @description\n * Are the given dates in the same month (and year)?\n *\n * @param {Date|Number} dateLeft - the first date to check\n * @param {Date|Number} dateRight - the second date to check\n * @returns {Boolean} the dates are in the same month (and year)\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Are 2 September 2014 and 25 September 2014 in the same month?\n * const result = isSameMonth(new Date(2014, 8, 2), new Date(2014, 8, 25))\n * //=> true\n *\n * @example\n * // Are 2 September 2014 and 25 September 2015 in the same month?\n * const result = isSameMonth(new Date(2014, 8, 2), new Date(2015, 8, 25))\n * //=> false\n */\nexport default function isSameMonth(dirtyDateLeft, dirtyDateRight) {\n requiredArgs(2, arguments);\n var dateLeft = toDate(dirtyDateLeft);\n var dateRight = toDate(dirtyDateRight);\n return dateLeft.getFullYear() === dateRight.getFullYear() && dateLeft.getMonth() === dateRight.getMonth();\n}","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name isSameYear\n * @category Year Helpers\n * @summary Are the given dates in the same year?\n *\n * @description\n * Are the given dates in the same year?\n *\n * @param {Date|Number} dateLeft - the first date to check\n * @param {Date|Number} dateRight - the second date to check\n * @returns {Boolean} the dates are in the same year\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Are 2 September 2014 and 25 September 2014 in the same year?\n * const result = isSameYear(new Date(2014, 8, 2), new Date(2014, 8, 25))\n * //=> true\n */\nexport default function isSameYear(dirtyDateLeft, dirtyDateRight) {\n requiredArgs(2, arguments);\n var dateLeft = toDate(dirtyDateLeft);\n var dateRight = toDate(dirtyDateRight);\n return dateLeft.getFullYear() === dateRight.getFullYear();\n}","import toInteger from \"../_lib/toInteger/index.js\";\nimport toDate from \"../toDate/index.js\";\nimport getDaysInMonth from \"../getDaysInMonth/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name setMonth\n * @category Month Helpers\n * @summary Set the month to the given date.\n *\n * @description\n * Set the month to the given date.\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} month - the month of the new date\n * @returns {Date} the new date with the month set\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Set February to 1 September 2014:\n * const result = setMonth(new Date(2014, 8, 1), 1)\n * //=> Sat Feb 01 2014 00:00:00\n */\nexport default function setMonth(dirtyDate, dirtyMonth) {\n requiredArgs(2, arguments);\n var date = toDate(dirtyDate);\n var month = toInteger(dirtyMonth);\n var year = date.getFullYear();\n var day = date.getDate();\n var dateWithDesiredMonth = new Date(0);\n dateWithDesiredMonth.setFullYear(year, month, 15);\n dateWithDesiredMonth.setHours(0, 0, 0, 0);\n var daysInMonth = getDaysInMonth(dateWithDesiredMonth);\n // Set the last day of the new month\n // if the original date was the last day of the longer month\n date.setMonth(month, Math.min(day, daysInMonth));\n return date;\n}","import toInteger from \"../_lib/toInteger/index.js\";\nimport toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name setDate\n * @category Day Helpers\n * @summary Set the day of the month to the given date.\n *\n * @description\n * Set the day of the month to the given date.\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} dayOfMonth - the day of the month of the new date\n * @returns {Date} the new date with the day of the month set\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Set the 30th day of the month to 1 September 2014:\n * const result = setDate(new Date(2014, 8, 1), 30)\n * //=> Tue Sep 30 2014 00:00:00\n */\nexport default function setDate(dirtyDate, dirtyDayOfMonth) {\n requiredArgs(2, arguments);\n var date = toDate(dirtyDate);\n var dayOfMonth = toInteger(dirtyDayOfMonth);\n date.setDate(dayOfMonth);\n return date;\n}","import toInteger from \"../_lib/toInteger/index.js\";\nimport toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name setYear\n * @category Year Helpers\n * @summary Set the year to the given date.\n *\n * @description\n * Set the year to the given date.\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} year - the year of the new date\n * @returns {Date} the new date with the year set\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Set year 2013 to 1 September 2014:\n * const result = setYear(new Date(2014, 8, 1), 2013)\n * //=> Sun Sep 01 2013 00:00:00\n */\nexport default function setYear(dirtyDate, dirtyYear) {\n requiredArgs(2, arguments);\n var date = toDate(dirtyDate);\n var year = toInteger(dirtyYear);\n\n // Check if date is Invalid Date because Date.prototype.setFullYear ignores the value of Invalid Date\n if (isNaN(date.getTime())) {\n return new Date(NaN);\n }\n date.setFullYear(year);\n return date;\n}","","import {\n\tComponent,\n\tEvent,\n\tEventEmitter,\n\th,\n\tProp,\n\tState,\n\tWatch,\n} from '@stencil/core';\nimport { cva } from 'class-variance-authority';\nimport {\n\taddDays,\n\taddMonths,\n\taddYears,\n\tendOfMonth,\n\tformat,\n\tgetDay,\n\tgetDaysInMonth,\n\tgetYear,\n\tisAfter,\n\tisBefore,\n\tisSameDay,\n\tisSameMonth,\n\tisSameYear,\n\tisValid,\n\tisWeekend,\n\tsetDate,\n\tsetMonth,\n\tsetYear,\n\tstartOfDay,\n\tstartOfMonth,\n} from 'date-fns';\nimport { nl, enUS } from 'date-fns/locale';\nimport { cn } from '../../../utils/cn';\nimport { state } from '../../../state';\nimport { ThemedHost } from '../../../internal/themed-host.component';\n\nconst calendar = cva(['w-[17.5rem] flex flex-col gap-4'], {\n\tvariants: {\n\t\tvariant: {\n\t\t\tdefault: ['p-2 rounded-lg drop-shadow-2', 'border border-storm-100'],\n\t\t\tembedded: 'p-1',\n\t\t},\n\t},\n});\n\nconst header = cva(\n\t[\n\t\t'flex items-center gap-2',\n\t\t'w-full p-2 rounded-lg',\n\t\t'bg-off-white-300 dark:bg-white/15',\n\t],\n\t{\n\t\tvariants: {\n\t\t\ttype: {\n\t\t\t\tday: 'justify-between',\n\t\t\t\tmonth: 'justify-between',\n\t\t\t\tyear: 'justify-center',\n\t\t\t},\n\t\t},\n\t}\n);\n\nconst view = cva(['flex flex-col gap-2', 'w-full'], {\n\tvariants: {\n\t\tview: {\n\t\t\tday: 'h-auto min-h-[12rem]',\n\t\t\tmonth: 'min-h-[15rem]',\n\t\t\tyear: 'max-h-[15rem]',\n\t\t},\n\t},\n});\n\n@Component({\n\ttag: 'p-calendar',\n\tstyleUrl: 'calendar.component.css',\n\tshadow: true,\n})\nexport class Calendar {\n\t/**\n\t * The variant of the button\n\t */\n\t@Prop() variant: 'default' | 'embedded' = 'default';\n\n\t/**\n\t * The current value\n\t */\n\t@Prop() value?: Date | string;\n\n\t/**\n\t * Wether to automatically preselect today\n\t */\n\t@Prop() preselectToday: boolean = false;\n\n\t/**\n\t * Disabled dates\n\t */\n\t@Prop() disabledDates?: Array<Date | string> | string;\n\n\t/**\n\t * Min date\n\t */\n\t@Prop() minDate: Date | string = new Date(1970, 0, 1);\n\n\t/**\n\t * Max date\n\t */\n\t@Prop() maxDate: Date | string = this._getAutomaticMax();\n\n\t/**\n\t * Wether to disable the weekends\n\t */\n\t@Prop() disableWeekends: boolean = false;\n\n\t/**\n\t * Wether to enable the today button\n\t */\n\t@Prop() enableToday: boolean = true;\n\n\t/**\n\t * The text to display on the today tooltip\n\t */\n\t@Prop() todayText: string = 'today';\n\n\t/**\n\t * The mode of the datepicker\n\t */\n\t@Prop() mode: 'year' | 'month' | 'day' = 'day';\n\n\t/**\n\t * Event when the value changes\n\t */\n\t@Event({\n\t\tbubbles: false,\n\t})\n\tvalueChange: EventEmitter<any>;\n\n\tprivate _today = new Date();\n\t@State() private _view: 'year' | 'month' | 'day' = this.mode;\n\t@State() private _viewDate = this._today;\n\n\t@State() private _value: Date;\n\t@State() private _minDate: Date;\n\t@State() private _maxDate: Date;\n\t@State() private _disabledDates: Date[] = [];\n\n\t@State() private _enableToday = true;\n\n\tprivate _weekDays = Array.from(Array(7).keys());\n\tprivate _yearItemsRef: HTMLDivElement;\n\n\tcomponentWillLoad() {\n\t\tif (this.disabledDates) {\n\t\t\tthis._parseDisabledDates(this.disabledDates);\n\t\t}\n\n\t\tif (this.minDate) {\n\t\t\tthis._parseMinDate(this.minDate);\n\t\t}\n\n\t\tif (this.maxDate) {\n\t\t\tthis._parseMaxDate(this.maxDate);\n\t\t}\n\n\t\tthis._parseValue(this.value);\n\n\t\tif (this._value) {\n\t\t\tthis._viewDate = this._value;\n\t\t}\n\n\t\tif (isBefore(this._viewDate, this._minDate)) {\n\t\t\tthis._viewDate = this._minDate;\n\t\t}\n\n\t\tif (isAfter(this._viewDate, this._maxDate)) {\n\t\t\tthis._viewDate = this._maxDate;\n\t\t}\n\n\t\tthis._modeChange(this.mode);\n\t}\n\n\tcomponentWillRender() {\n\t\tthis._enableToday = this.enableToday && this._checkTodayButton();\n\t}\n\n\tcomponentDidRender() {\n\t\tif (this._view === 'year') {\n\t\t\tthis._scrollYearIntoView();\n\t\t}\n\t}\n\n\t@Watch('value')\n\tprivate _parseValue(value: string | Date) {\n\t\tif (!value && this.preselectToday) {\n\t\t\tvalue = new Date();\n\t\t}\n\n\t\tif (typeof value === 'string') {\n\t\t\tvalue = new Date(value);\n\t\t}\n\n\t\tif (isValid(value) && !isSameDay(value, this._viewDate)) {\n\t\t\tthis._viewDate = value;\n\t\t}\n\n\t\tthis._setValue(value);\n\t}\n\n\t@Watch('minDate')\n\tprivate _parseMinDate(minDate: string | Date) {\n\t\tif (typeof minDate === 'string') {\n\t\t\tminDate = new Date(minDate);\n\t\t}\n\n\t\tif (!isValid(minDate)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._minDate = minDate;\n\n\t\tif (isBefore(this._viewDate, this._minDate)) {\n\t\t\tthis._viewDate = this._minDate;\n\t\t}\n\t}\n\n\t@Watch('maxDate')\n\tprivate _parseMaxDate(maxDate: string | Date) {\n\t\tif (typeof maxDate === 'string') {\n\t\t\tmaxDate = new Date(maxDate);\n\t\t}\n\n\t\tif (!isValid(maxDate)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._maxDate = maxDate;\n\n\t\tif (isAfter(this._viewDate, this._maxDate)) {\n\t\t\tthis._viewDate = this._maxDate;\n\t\t}\n\t}\n\n\t@Watch('disabledDates')\n\tprivate _parseDisabledDates(disabledDates: Array<string | Date> | string) {\n\t\tif (typeof disabledDates === 'string') {\n\t\t\tdisabledDates = JSON.parse(disabledDates);\n\t\t}\n\n\t\tif (!disabledDates || !Array.isArray(disabledDates)) {\n\t\t\treturn;\n\t\t}\n\n\t\t// normalize all to date\n\t\tthis._disabledDates = disabledDates\n\t\t\t.map(date => {\n\t\t\t\tif (typeof date === 'string') {\n\t\t\t\t\treturn new Date(date);\n\t\t\t\t}\n\n\t\t\t\treturn date;\n\t\t\t})\n\t\t\t.filter(date => isValid(date));\n\t}\n\n\t@Watch('mode')\n\t_modeChange(mode: 'year' | 'month' | 'day') {\n\t\tif (mode === 'year' && this._view !== 'year') {\n\t\t\tthis._view = 'year';\n\t\t}\n\n\t\tif (mode === 'month' && this._view === 'day') {\n\t\t\tthis._view = 'month';\n\t\t}\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<ThemedHost>\n\t\t\t\t<div class={calendar({ variant: this.variant })}>{this._getView()}</div>\n\t\t\t</ThemedHost>\n\t\t);\n\t}\n\n\tprivate _checkTodayButton() {\n\t\tif (this._maxDate && isAfter(this._today, this._maxDate)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (this._minDate && isBefore(this._today, this._minDate)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (this.disableWeekends && isWeekend(this._today)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (this.mode !== 'day') {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}\n\n\tprivate _getView() {\n\t\tif (this._view === 'year') {\n\t\t\treturn this._getYearView();\n\t\t}\n\n\t\tif (this._view === 'month') {\n\t\t\treturn this._getMonthView();\n\t\t}\n\n\t\treturn this._getDayView();\n\t}\n\n\t/* With this, we shall hack the system in ways no one would ever have thought.\n <div class=\"col-start-1 col-start-2 col-start-3 col-start-4 col-start-5 col-start-6 col-start-7\"></div>\n */\n\tprivate _getDayView() {\n\t\tconst daysInMonth = this._generateDaysInMonth();\n\t\treturn (\n\t\t\t<div class={view({ view: 'day' })}>\n\t\t\t\t{this._getHeader('day')}\n\n\t\t\t\t<div class='grid grid-cols-7 justify-between gap-1'>\n\t\t\t\t\t{this._weekDays.map(weekday => (\n\t\t\t\t\t\t<span class='w-8 text-center text-xs text-storm-200'>\n\t\t\t\t\t\t\t{format(\n\t\t\t\t\t\t\t\taddDays(new Date(2022, 7, 1), weekday),\n\t\t\t\t\t\t\t\tstate.locale === 'nl' ? 'EEEEEE' : 'eee',\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tlocale: state.locale === 'nl' ? nl : enUS,\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t))}\n\t\t\t\t\t{daysInMonth.map(day => {\n\t\t\t\t\t\treturn day.active ? (\n\t\t\t\t\t\t\t<p-button\n\t\t\t\t\t\t\t\tvariant='primary'\n\t\t\t\t\t\t\t\tclass={cn('w-8', `col-start-${day.offset}`)}\n\t\t\t\t\t\t\t\tonClick={() => this._setValue(day.date)}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{day.day}\n\t\t\t\t\t\t\t</p-button>\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<time\n\t\t\t\t\t\t\t\tclass={cn(\n\t\t\t\t\t\t\t\t\t'normal flex items-center justify-center rounded-lg',\n\t\t\t\t\t\t\t\t\t'h-8 w-8 text-sm font-semibold',\n\t\t\t\t\t\t\t\t\t'text-storm-300',\n\t\t\t\t\t\t\t\t\t'dark:bg-white/15',\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t'cursor-pointer hover:bg-white-600 hover:text-storm-500 dark:text-white dark:hover:bg-hurricane-300 dark:hover:text-white':\n\t\t\t\t\t\t\t\t\t\t\t!day.disabled,\n\t\t\t\t\t\t\t\t\t\t'dark:text-hurricane-200': day.disabled,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t`col-start-${day.offset}`,\n\t\t\t\t\t\t\t\t\t{ 'cursor-not-allowed opacity-60': day.disabled },\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t'border border-solid border-off-white-700 bg-off-white-300 text-storm-500 dark:border-none dark:bg-hurricane-200 dark:text-white':\n\t\t\t\t\t\t\t\t\t\t\t!day.disabled && isSameDay(day.date, new Date()),\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\tonClick={() => this._setValue(day.date)}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{day.day}\n\t\t\t\t\t\t\t</time>\n\t\t\t\t\t\t);\n\t\t\t\t\t})}\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t);\n\t}\n\n\tprivate _getMonthView() {\n\t\tconst months = this._generateMonths();\n\t\treturn (\n\t\t\t<div class={view({ view: 'month' })}>\n\t\t\t\t{this._getHeader('month')}\n\n\t\t\t\t<div class='flex flex-wrap items-start gap-2'>\n\t\t\t\t\t{months.map(month => (\n\t\t\t\t\t\t<p-button\n\t\t\t\t\t\t\tvariant={month.active ? 'primary' : 'secondary'}\n\t\t\t\t\t\t\tdisabled={month.disabled}\n\t\t\t\t\t\t\tonClick={() => this._setMonth(month.month)}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{format(setMonth(new Date(), month.month), 'MMMM', {\n\t\t\t\t\t\t\t\tlocale: state.locale === 'nl' ? nl : enUS,\n\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t</p-button>\n\t\t\t\t\t))}\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t);\n\t}\n\n\tprivate _getYearView() {\n\t\tconst years = this._generateYears();\n\t\treturn (\n\t\t\t<div class={view({ view: 'year' })}>\n\t\t\t\t{this._getHeader('year')}\n\t\t\t\t<div\n\t\t\t\t\tclass='grid h-full grid-cols-4 gap-2 overflow-scroll'\n\t\t\t\t\tref={ref => (this._yearItemsRef = ref)}\n\t\t\t\t>\n\t\t\t\t\t{years.map(year => (\n\t\t\t\t\t\t<p-button\n\t\t\t\t\t\t\tclass='w-full'\n\t\t\t\t\t\t\tvariant={year.active ? 'primary' : 'secondary'}\n\t\t\t\t\t\t\tonClick={() => this._setYear(year.year)}\n\t\t\t\t\t\t\tdata-active={year.active}\n\t\t\t\t\t\t\tdata-current={year.current}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{year.year}\n\t\t\t\t\t\t</p-button>\n\t\t\t\t\t))}\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t);\n\t}\n\n\tprivate _getHeader(type: 'day' | 'month' | 'year' = 'day') {\n\t\tlet nextFn = num => this._changeMonth(num);\n\t\tlet nextType: 'month' | 'year' = 'month';\n\n\t\tif (type === 'month' || type === 'year') {\n\t\t\tnextFn = num => this._changeYear(num);\n\t\t\tnextType = 'year';\n\t\t}\n\n\t\treturn (\n\t\t\t<div class={header({ type: this.mode })}>\n\t\t\t\t{this.mode !== 'year' && (\n\t\t\t\t\t<p-button\n\t\t\t\t\t\tvariant='secondary'\n\t\t\t\t\t\ticonOnly\n\t\t\t\t\t\ticon='caret'\n\t\t\t\t\t\ticonRotate={90}\n\t\t\t\t\t\tsize='sm'\n\t\t\t\t\t\tonClick={() => nextFn(-1)}\n\t\t\t\t\t\tdisabled={\n\t\t\t\t\t\t\t!this._canSetAmount(nextType, -1) || this._view === 'year'\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\n\t\t\t\t<div\n\t\t\t\t\tclass={cn('flex gap-2', {\n\t\t\t\t\t\t'flex-1': this._enableToday,\n\t\t\t\t\t})}\n\t\t\t\t>\n\t\t\t\t\t{this.mode !== 'year' && (\n\t\t\t\t\t\t<p-button\n\t\t\t\t\t\t\tvariant='secondary'\n\t\t\t\t\t\t\tsize='sm'\n\t\t\t\t\t\t\tonClick={() => this._changeView('month')}\n\t\t\t\t\t\t\tdisabled={!this._canChangeView('month')}\n\t\t\t\t\t\t\tactive={this._view === 'month' && this.mode !== 'month'}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{format(this._viewDate, 'MMMM', {\n\t\t\t\t\t\t\t\tlocale: state.locale === 'nl' ? nl : enUS,\n\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t</p-button>\n\t\t\t\t\t)}\n\n\t\t\t\t\t<p-button\n\t\t\t\t\t\tvariant='secondary'\n\t\t\t\t\t\tsize='sm'\n\t\t\t\t\t\tonClick={() => this._changeView('year')}\n\t\t\t\t\t\tdisabled={!this._canChangeView('year')}\n\t\t\t\t\t\tactive={this._view === 'year' && this.mode !== 'year'}\n\t\t\t\t\t>\n\t\t\t\t\t\t{getYear(this._viewDate)}\n\t\t\t\t\t</p-button>\n\n\t\t\t\t\t{this._enableToday && (\n\t\t\t\t\t\t<p-tooltip\n\t\t\t\t\t\t\tclass='ml-auto'\n\t\t\t\t\t\t\tcontent={this.todayText}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<p-button\n\t\t\t\t\t\t\t\tvariant='secondary'\n\t\t\t\t\t\t\t\tsize='sm'\n\t\t\t\t\t\t\t\ticon='calendar'\n\t\t\t\t\t\t\t\tslot='trigger'\n\t\t\t\t\t\t\t\ticonOnly={true}\n\t\t\t\t\t\t\t\tonClick={() => this._setToday()}\n\t\t\t\t\t\t\t></p-button>\n\t\t\t\t\t\t</p-tooltip>\n\t\t\t\t\t)}\n\t\t\t\t</div>\n\n\t\t\t\t{this.mode !== 'year' && (\n\t\t\t\t\t<p-button\n\t\t\t\t\t\tvariant='secondary'\n\t\t\t\t\t\ticonOnly\n\t\t\t\t\t\ticon='caret'\n\t\t\t\t\t\ticonRotate={-90}\n\t\t\t\t\t\tsize='sm'\n\t\t\t\t\t\tonClick={() => nextFn(1)}\n\t\t\t\t\t\tdisabled={!this._canSetAmount(nextType, 1) || this._view == 'year'}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t</div>\n\t\t);\n\t}\n\n\tprivate _setYear(year: number) {\n\t\tconst date = setYear(this._viewDate, year);\n\t\tif (this.mode !== 'year') {\n\t\t\tthis._viewDate = date;\n\t\t\tthis._view = 'month';\n\t\t\treturn;\n\t\t}\n\n\t\tthis._viewDate = date;\n\t\tthis._setValue(setMonth(setDate(date, 1), 0));\n\t}\n\n\tprivate _setMonth(month: number) {\n\t\tconst date = setMonth(this._viewDate, month);\n\t\tif (this.mode === 'day') {\n\t\t\tthis._viewDate = date;\n\t\t\tthis._view = 'day';\n\t\t\treturn;\n\t\t}\n\n\t\tthis._viewDate = date;\n\t\tthis._setValue(setDate(date, 1));\n\t}\n\n\tprivate _setToday() {\n\t\tthis._viewDate = this._today;\n\t\tthis._setValue(this._today);\n\t\tthis._view = 'day';\n\t}\n\n\tprivate _changeMonth(amount = 1) {\n\t\tconst allowed = this._canSetAmount('month', amount);\n\t\tif (!allowed) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst newDate = addMonths(this._viewDate, amount);\n\t\tthis._viewDate = newDate;\n\t}\n\n\tprivate _changeYear(amount = 1) {\n\t\tconst allowed = this._canSetAmount('year', amount);\n\t\tif (!allowed) {\n\t\t\treturn;\n\t\t}\n\n\t\tlet newDate = addYears(this._viewDate, amount);\n\t\tthis._viewDate = newDate;\n\t}\n\n\tprivate _setValue(value: Date) {\n\t\tif (value === null) {\n\t\t\tthis._value = null;\n\t\t\tthis.valueChange.emit(null);\n\t\t\treturn;\n\t\t}\n\n\t\tif (!isValid(value)) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this._isDisabledDay(value)) {\n\t\t\treturn;\n\t\t}\n\n\t\tvalue = startOfDay(value);\n\t\tconst isSameValue = isSameDay(value, this._value);\n\n\t\tif (isSameValue) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._value = value;\n\t\tthis.valueChange.emit(value);\n\t}\n\n\tprivate _generateDaysInMonth() {\n\t\tconst days = Array.from(Array(getDaysInMonth(this._viewDate)).keys());\n\n\t\treturn days.map(day => {\n\t\t\tday = day + 1;\n\t\t\tconst date = setDate(this._viewDate, day);\n\n\t\t\tconst dayOfWeek = getDay(date);\n\t\t\treturn {\n\t\t\t\tday,\n\t\t\t\tdate,\n\t\t\t\toffset: day === 1 ? (dayOfWeek === 0 ? 7 : dayOfWeek) : false,\n\t\t\t\tcurrent: isSameDay(date, this._today),\n\t\t\t\tactive: isSameDay(date, this._value),\n\t\t\t\tdisabled: this._isDisabledDay(date),\n\t\t\t};\n\t\t});\n\t}\n\n\tprivate _isDisabledDay(day: Date) {\n\t\treturn (\n\t\t\t(isBefore(day, this._minDate) && !isSameDay(day, this._maxDate)) ||\n\t\t\t(isAfter(day, this._maxDate) && !isSameDay(day, this._maxDate)) ||\n\t\t\t((getDay(day) === 0 || getDay(day) === 6) && this.disableWeekends) ||\n\t\t\tthis._disabledDates.findIndex(date => isSameDay(date, day)) >= 0\n\t\t);\n\t}\n\n\tprivate _generateMonths() {\n\t\tconst year = getYear(this._viewDate);\n\t\tconst months = Array.from(Array(12).keys());\n\n\t\treturn months.map(month => {\n\t\t\tconst date = new Date(year, month, 1);\n\t\t\treturn {\n\t\t\t\tmonth,\n\t\t\t\tcurrent: isSameMonth(this._today, date),\n\t\t\t\tactive: isSameMonth(this._value, date),\n\t\t\t\tdisabled:\n\t\t\t\t\tisAfter(date, this._maxDate) ||\n\t\t\t\t\tisBefore(endOfMonth(date), this._minDate),\n\t\t\t};\n\t\t});\n\t}\n\n\tprivate _generateYears() {\n\t\tconst maxYear = getYear(this._maxDate) + 1;\n\t\tconst minYear = getYear(this._minDate);\n\n\t\treturn Array.from(Array(maxYear - minYear).keys()).map(index => {\n\t\t\tconst year = minYear + index;\n\t\t\treturn {\n\t\t\t\tyear,\n\t\t\t\tcurrent: getYear(this._today) === year,\n\t\t\t\tactive: getYear(this._value) === year,\n\t\t\t};\n\t\t});\n\t}\n\n\tprivate _scrollYearIntoView() {\n\t\tconst items = this._yearItemsRef;\n\t\tif (!items) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst active = items.querySelector('p-button[data-active]') as HTMLElement;\n\t\tif (active) {\n\t\t\treturn items.scrollTo({\n\t\t\t\ttop: active.offsetTop - 100,\n\t\t\t});\n\t\t}\n\n\t\tconst current = items.querySelector(\n\t\t\t'p-button[data-current]'\n\t\t) as HTMLElement;\n\t\tif (current) {\n\t\t\treturn items.scrollTo({\n\t\t\t\ttop: current.offsetTop - 100,\n\t\t\t});\n\t\t}\n\t}\n\n\tprivate _changeView(view: 'year' | 'month') {\n\t\tif (!this._canChangeView(view)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._view = view;\n\t}\n\n\tprivate _canChangeView(view: 'year' | 'month') {\n\t\tif (view === 'year') {\n\t\t\tif (isSameYear(this._minDate, this._maxDate)) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\n\t\tif (isSameMonth(this._minDate, this._maxDate)) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}\n\n\tprivate _canSetAmount(type: 'month' | 'year', amount = 1) {\n\t\tif (type === 'month') {\n\t\t\tconst newDate = addMonths(this._viewDate, amount);\n\t\t\tconst startNewDate = startOfMonth(newDate);\n\t\t\tif (\n\t\t\t\t(isBefore(startNewDate, startOfMonth(this._minDate)) &&\n\t\t\t\t\t!isSameDay(startNewDate, this._minDate)) ||\n\t\t\t\tisAfter(startNewDate, endOfMonth(this._maxDate))\n\t\t\t) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tif (type === 'year') {\n\t\t\tlet newDate = addYears(this._viewDate, amount);\n\t\t\tconst year = getYear(newDate);\n\t\t\tif (year < getYear(this._minDate) || year > getYear(this._maxDate)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}\n\n\tprivate _getAutomaticMax() {\n\t\tconst date = addYears(new Date(), 50);\n\n\t\tlet year = getYear(date);\n\t\tyear = Math.ceil(year / 10) * 10;\n\n\t\treturn setYear(date, year);\n\t}\n}\n"],"names":["nl","enUS"],"mappings":";;;;;;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAAS,OAAO,CAAC,SAAS,EAAE,WAAW,EAAE;AACxD,EAAE,YAAY,CAAC,CAAC,EAAE,SAAS,CAAC;AAC5B,EAAE,IAAI,IAAI,GAAG,MAAM,CAAC,SAAS,CAAC;AAC9B,EAAE,IAAI,MAAM,GAAG,SAAS,CAAC,WAAW,CAAC;AACrC,EAAE,IAAI,KAAK,CAAC,MAAM,CAAC,EAAE;AACrB,IAAI,OAAO,IAAI,IAAI,CAAC,GAAG,CAAC;AACxB;AACA,EAAE,IAAI,CAAC,MAAM,EAAE;AACf;AACA,IAAI,OAAO,IAAI;AACf;AACA,EAAE,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,MAAM,CAAC;AACvC,EAAE,OAAO,IAAI;AACb;;AC/BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAAS,SAAS,CAAC,SAAS,EAAE,WAAW,EAAE;A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"version":3,"file":"p-calendar.entry.js","sources":["../../node_modules/date-fns/esm/addDays/index.js","../../node_modules/date-fns/esm/endOfMonth/index.js","../../node_modules/date-fns/esm/getDay/index.js","../../node_modules/date-fns/esm/getDaysInMonth/index.js","../../node_modules/date-fns/esm/isSameMonth/index.js","../../node_modules/date-fns/esm/isSameYear/index.js","../../node_modules/date-fns/esm/setMonth/index.js","../../node_modules/date-fns/esm/setDate/index.js","src/components/molecules/calendar/calendar.component.css?tag=p-calendar&encapsulation=shadow","src/components/molecules/calendar/calendar.component.tsx"],"sourcesContent":["import toInteger from \"../_lib/toInteger/index.js\";\nimport toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name addDays\n * @category Day Helpers\n * @summary Add the specified number of days to the given date.\n *\n * @description\n * Add the specified number of days to the given date.\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} amount - the amount of days to be added. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.\n * @returns {Date} - the new date with the days added\n * @throws {TypeError} - 2 arguments required\n *\n * @example\n * // Add 10 days to 1 September 2014:\n * const result = addDays(new Date(2014, 8, 1), 10)\n * //=> Thu Sep 11 2014 00:00:00\n */\nexport default function addDays(dirtyDate, dirtyAmount) {\n requiredArgs(2, arguments);\n var date = toDate(dirtyDate);\n var amount = toInteger(dirtyAmount);\n if (isNaN(amount)) {\n return new Date(NaN);\n }\n if (!amount) {\n // If 0 days, no-op to avoid changing times in the hour before end of DST\n return date;\n }\n date.setDate(date.getDate() + amount);\n return date;\n}","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name endOfMonth\n * @category Month Helpers\n * @summary Return the end of a month for the given date.\n *\n * @description\n * Return the end of a month for the given date.\n * The result will be in the local timezone.\n *\n * @param {Date|Number} date - the original date\n * @returns {Date} the end of a month\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // The end of a month for 2 September 2014 11:55:00:\n * const result = endOfMonth(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Tue Sep 30 2014 23:59:59.999\n */\nexport default function endOfMonth(dirtyDate) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate);\n var month = date.getMonth();\n date.setFullYear(date.getFullYear(), month + 1, 0);\n date.setHours(23, 59, 59, 999);\n return date;\n}","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name getDay\n * @category Weekday Helpers\n * @summary Get the day of the week of the given date.\n *\n * @description\n * Get the day of the week of the given date.\n *\n * @param {Date|Number} date - the given date\n * @returns {0|1|2|3|4|5|6} the day of week, 0 represents Sunday\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // Which day of the week is 29 February 2012?\n * const result = getDay(new Date(2012, 1, 29))\n * //=> 3\n */\nexport default function getDay(dirtyDate) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate);\n var day = date.getDay();\n return day;\n}","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name getDaysInMonth\n * @category Month Helpers\n * @summary Get the number of days in a month of the given date.\n *\n * @description\n * Get the number of days in a month of the given date.\n *\n * @param {Date|Number} date - the given date\n * @returns {Number} the number of days in a month\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // How many days are in February 2000?\n * const result = getDaysInMonth(new Date(2000, 1))\n * //=> 29\n */\nexport default function getDaysInMonth(dirtyDate) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate);\n var year = date.getFullYear();\n var monthIndex = date.getMonth();\n var lastDayOfMonth = new Date(0);\n lastDayOfMonth.setFullYear(year, monthIndex + 1, 0);\n lastDayOfMonth.setHours(0, 0, 0, 0);\n return lastDayOfMonth.getDate();\n}","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name isSameMonth\n * @category Month Helpers\n * @summary Are the given dates in the same month (and year)?\n *\n * @description\n * Are the given dates in the same month (and year)?\n *\n * @param {Date|Number} dateLeft - the first date to check\n * @param {Date|Number} dateRight - the second date to check\n * @returns {Boolean} the dates are in the same month (and year)\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Are 2 September 2014 and 25 September 2014 in the same month?\n * const result = isSameMonth(new Date(2014, 8, 2), new Date(2014, 8, 25))\n * //=> true\n *\n * @example\n * // Are 2 September 2014 and 25 September 2015 in the same month?\n * const result = isSameMonth(new Date(2014, 8, 2), new Date(2015, 8, 25))\n * //=> false\n */\nexport default function isSameMonth(dirtyDateLeft, dirtyDateRight) {\n requiredArgs(2, arguments);\n var dateLeft = toDate(dirtyDateLeft);\n var dateRight = toDate(dirtyDateRight);\n return dateLeft.getFullYear() === dateRight.getFullYear() && dateLeft.getMonth() === dateRight.getMonth();\n}","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name isSameYear\n * @category Year Helpers\n * @summary Are the given dates in the same year?\n *\n * @description\n * Are the given dates in the same year?\n *\n * @param {Date|Number} dateLeft - the first date to check\n * @param {Date|Number} dateRight - the second date to check\n * @returns {Boolean} the dates are in the same year\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Are 2 September 2014 and 25 September 2014 in the same year?\n * const result = isSameYear(new Date(2014, 8, 2), new Date(2014, 8, 25))\n * //=> true\n */\nexport default function isSameYear(dirtyDateLeft, dirtyDateRight) {\n requiredArgs(2, arguments);\n var dateLeft = toDate(dirtyDateLeft);\n var dateRight = toDate(dirtyDateRight);\n return dateLeft.getFullYear() === dateRight.getFullYear();\n}","import toInteger from \"../_lib/toInteger/index.js\";\nimport toDate from \"../toDate/index.js\";\nimport getDaysInMonth from \"../getDaysInMonth/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name setMonth\n * @category Month Helpers\n * @summary Set the month to the given date.\n *\n * @description\n * Set the month to the given date.\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} month - the month of the new date\n * @returns {Date} the new date with the month set\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Set February to 1 September 2014:\n * const result = setMonth(new Date(2014, 8, 1), 1)\n * //=> Sat Feb 01 2014 00:00:00\n */\nexport default function setMonth(dirtyDate, dirtyMonth) {\n requiredArgs(2, arguments);\n var date = toDate(dirtyDate);\n var month = toInteger(dirtyMonth);\n var year = date.getFullYear();\n var day = date.getDate();\n var dateWithDesiredMonth = new Date(0);\n dateWithDesiredMonth.setFullYear(year, month, 15);\n dateWithDesiredMonth.setHours(0, 0, 0, 0);\n var daysInMonth = getDaysInMonth(dateWithDesiredMonth);\n // Set the last day of the new month\n // if the original date was the last day of the longer month\n date.setMonth(month, Math.min(day, daysInMonth));\n return date;\n}","import toInteger from \"../_lib/toInteger/index.js\";\nimport toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name setDate\n * @category Day Helpers\n * @summary Set the day of the month to the given date.\n *\n * @description\n * Set the day of the month to the given date.\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} dayOfMonth - the day of the month of the new date\n * @returns {Date} the new date with the day of the month set\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Set the 30th day of the month to 1 September 2014:\n * const result = setDate(new Date(2014, 8, 1), 30)\n * //=> Tue Sep 30 2014 00:00:00\n */\nexport default function setDate(dirtyDate, dirtyDayOfMonth) {\n requiredArgs(2, arguments);\n var date = toDate(dirtyDate);\n var dayOfMonth = toInteger(dirtyDayOfMonth);\n date.setDate(dayOfMonth);\n return date;\n}","","import {\n\tComponent,\n\tEvent,\n\tEventEmitter,\n\th,\n\tProp,\n\tState,\n\tWatch,\n} from '@stencil/core';\nimport { cva } from 'class-variance-authority';\nimport {\n\taddDays,\n\taddMonths,\n\taddYears,\n\tendOfMonth,\n\tformat,\n\tgetDay,\n\tgetDaysInMonth,\n\tgetYear,\n\tisAfter,\n\tisBefore,\n\tisSameDay,\n\tisSameMonth,\n\tisSameYear,\n\tisValid,\n\tisWeekend,\n\tsetDate,\n\tsetMonth,\n\tsetYear,\n\tstartOfDay,\n\tstartOfMonth,\n} from 'date-fns';\nimport { nl, enUS } from 'date-fns/locale';\nimport { cn } from '../../../utils/cn';\nimport { state } from '../../../state';\nimport { ThemedHost } from '../../../internal/themed-host.component';\n\nconst calendar = cva(['w-[17.5rem] flex flex-col gap-4'], {\n\tvariants: {\n\t\tvariant: {\n\t\t\tdefault: ['p-2 rounded-lg drop-shadow-2', 'border border-storm-100'],\n\t\t\tembedded: 'p-1',\n\t\t},\n\t},\n});\n\nconst header = cva(\n\t[\n\t\t'flex items-center gap-2',\n\t\t'w-full p-2 rounded-lg',\n\t\t'bg-off-white-300 dark:bg-white/15',\n\t],\n\t{\n\t\tvariants: {\n\t\t\ttype: {\n\t\t\t\tday: 'justify-between',\n\t\t\t\tmonth: 'justify-between',\n\t\t\t\tyear: 'justify-center',\n\t\t\t},\n\t\t},\n\t}\n);\n\nconst view = cva(['flex flex-col gap-2', 'w-full'], {\n\tvariants: {\n\t\tview: {\n\t\t\tday: 'h-auto min-h-[12rem]',\n\t\t\tmonth: 'min-h-[15rem]',\n\t\t\tyear: 'max-h-[15rem]',\n\t\t},\n\t},\n});\n\n@Component({\n\ttag: 'p-calendar',\n\tstyleUrl: 'calendar.component.css',\n\tshadow: true,\n})\nexport class Calendar {\n\t/**\n\t * The variant of the button\n\t */\n\t@Prop() variant: 'default' | 'embedded' = 'default';\n\n\t/**\n\t * The current value\n\t */\n\t@Prop() value?: Date | string;\n\n\t/**\n\t * Wether to automatically preselect today\n\t */\n\t@Prop() preselectToday: boolean = false;\n\n\t/**\n\t * Disabled dates\n\t */\n\t@Prop() disabledDates?: Array<Date | string> | string;\n\n\t/**\n\t * Min date\n\t */\n\t@Prop() minDate: Date | string | null = null;\n\n\t/**\n\t * Max date\n\t */\n\t@Prop() maxDate: Date | string | null = null;\n\n\t/**\n\t * Wether to disable the weekends\n\t */\n\t@Prop() disableWeekends: boolean = false;\n\n\t/**\n\t * Wether to enable the today button\n\t */\n\t@Prop() enableToday: boolean = true;\n\n\t/**\n\t * The text to display on the today tooltip\n\t */\n\t@Prop() todayText: string = 'today';\n\n\t/**\n\t * The mode of the datepicker\n\t */\n\t@Prop() mode: 'year' | 'month' | 'day' = 'day';\n\n\t/**\n\t * Event when the value changes\n\t */\n\t@Event({\n\t\tbubbles: false,\n\t})\n\tvalueChange: EventEmitter<any>;\n\n\tprivate _today = new Date();\n\t@State() private _view: 'year' | 'month' | 'day' = this.mode;\n\t@State() private _viewDate = this._today;\n\n\t@State() private _value: Date;\n\t@State() private _minDate: Date;\n\t@State() private _maxDate: Date;\n\t@State() private _disabledDates: Date[] = [];\n\n\t@State() private _enableToday = true;\n\n\tprivate _weekDays = Array.from(Array(7).keys());\n\tprivate _yearItemsRef: HTMLDivElement;\n\n\tcomponentWillLoad() {\n\t\tif (this.disabledDates) {\n\t\t\tthis._parseDisabledDates(this.disabledDates);\n\t\t}\n\n\t\tthis._parseMinDate(this.minDate);\n\t\tthis._parseMaxDate(this.maxDate);\n\n\t\tthis._parseValue(this.value);\n\n\t\tif (this._value) {\n\t\t\tthis._viewDate = this._value;\n\t\t}\n\n\t\tif (isBefore(this._viewDate, this._minDate)) {\n\t\t\tthis._viewDate = this._minDate;\n\t\t}\n\n\t\tif (isAfter(this._viewDate, this._maxDate)) {\n\t\t\tthis._viewDate = this._maxDate;\n\t\t}\n\n\t\tthis._modeChange(this.mode);\n\t}\n\n\tcomponentWillRender() {\n\t\tthis._enableToday = this.enableToday && this._checkTodayButton();\n\t}\n\n\tcomponentDidRender() {\n\t\tif (this._view === 'year') {\n\t\t\tthis._scrollYearIntoView();\n\t\t}\n\t}\n\n\t@Watch('value')\n\tprivate _parseValue(value: string | Date) {\n\t\tif (!value && this.preselectToday) {\n\t\t\tvalue = new Date();\n\t\t}\n\n\t\tif (typeof value === 'string') {\n\t\t\tvalue = new Date(value);\n\t\t}\n\n\t\tif (isValid(value) && !isSameDay(value, this._viewDate)) {\n\t\t\tthis._viewDate = value;\n\t\t}\n\n\t\tthis._setValue(value);\n\t}\n\n\t@Watch('minDate')\n\tprivate _parseMinDate(minDate: string | Date | null) {\n\t\tif (minDate === null || minDate === '') {\n\t\t\tthis.minDate = new Date(1970, 0, 1);\n\t\t\treturn;\n\t\t}\n\n\t\tif (typeof minDate === 'string') {\n\t\t\tminDate = new Date(minDate);\n\t\t}\n\n\t\tif (!isValid(minDate)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._minDate = minDate;\n\n\t\tif (isBefore(this._viewDate, this._minDate)) {\n\t\t\tthis._viewDate = this._minDate;\n\t\t}\n\t}\n\n\t@Watch('maxDate')\n\tprivate _parseMaxDate(maxDate: string | Date | null) {\n\t\tif (maxDate === null || maxDate === '') {\n\t\t\tthis.maxDate = this._getAutomaticMax();\n\t\t\treturn;\n\t\t}\n\n\t\tif (typeof maxDate === 'string') {\n\t\t\tmaxDate = new Date(maxDate);\n\t\t}\n\n\t\tif (!isValid(maxDate)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._maxDate = maxDate;\n\n\t\tif (isAfter(this._viewDate, this._maxDate)) {\n\t\t\tthis._viewDate = this._maxDate;\n\t\t}\n\t}\n\n\t@Watch('disabledDates')\n\tprivate _parseDisabledDates(disabledDates: Array<string | Date> | string) {\n\t\tif (typeof disabledDates === 'string') {\n\t\t\tdisabledDates = JSON.parse(disabledDates);\n\t\t}\n\n\t\tif (!disabledDates || !Array.isArray(disabledDates)) {\n\t\t\treturn;\n\t\t}\n\n\t\t// normalize all to date\n\t\tthis._disabledDates = disabledDates\n\t\t\t.map(date => {\n\t\t\t\tif (typeof date === 'string') {\n\t\t\t\t\treturn new Date(date);\n\t\t\t\t}\n\n\t\t\t\treturn date;\n\t\t\t})\n\t\t\t.filter(date => isValid(date));\n\t}\n\n\t@Watch('mode')\n\t_modeChange(mode: 'year' | 'month' | 'day') {\n\t\tif (mode === 'year' && this._view !== 'year') {\n\t\t\tthis._view = 'year';\n\t\t}\n\n\t\tif (mode === 'month' && this._view === 'day') {\n\t\t\tthis._view = 'month';\n\t\t}\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<ThemedHost>\n\t\t\t\t<div class={calendar({ variant: this.variant })}>{this._getView()}</div>\n\t\t\t</ThemedHost>\n\t\t);\n\t}\n\n\tprivate _checkTodayButton() {\n\t\tif (this._maxDate && isAfter(this._today, this._maxDate)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (this._minDate && isBefore(this._today, this._minDate)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (this.disableWeekends && isWeekend(this._today)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (this.mode !== 'day') {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}\n\n\tprivate _getView() {\n\t\tif (this._view === 'year') {\n\t\t\treturn this._getYearView();\n\t\t}\n\n\t\tif (this._view === 'month') {\n\t\t\treturn this._getMonthView();\n\t\t}\n\n\t\treturn this._getDayView();\n\t}\n\n\t/* With this, we shall hack the system in ways no one would ever have thought.\n <div class=\"col-start-1 col-start-2 col-start-3 col-start-4 col-start-5 col-start-6 col-start-7\"></div>\n */\n\tprivate _getDayView() {\n\t\tconst daysInMonth = this._generateDaysInMonth();\n\t\treturn (\n\t\t\t<div class={view({ view: 'day' })}>\n\t\t\t\t{this._getHeader('day')}\n\n\t\t\t\t<div class='grid grid-cols-7 justify-between gap-1'>\n\t\t\t\t\t{this._weekDays.map(weekday => (\n\t\t\t\t\t\t<span class='w-8 text-center text-xs text-storm-200'>\n\t\t\t\t\t\t\t{format(\n\t\t\t\t\t\t\t\taddDays(new Date(2022, 7, 1), weekday),\n\t\t\t\t\t\t\t\tstate.locale === 'nl' ? 'EEEEEE' : 'eee',\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tlocale: state.locale === 'nl' ? nl : enUS,\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t))}\n\t\t\t\t\t{daysInMonth.map(day => {\n\t\t\t\t\t\treturn day.active ? (\n\t\t\t\t\t\t\t<p-button\n\t\t\t\t\t\t\t\tvariant='primary'\n\t\t\t\t\t\t\t\tclass={cn('w-8', `col-start-${day.offset}`)}\n\t\t\t\t\t\t\t\tonClick={() => this._setValue(day.date)}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{day.day}\n\t\t\t\t\t\t\t</p-button>\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<time\n\t\t\t\t\t\t\t\tclass={cn(\n\t\t\t\t\t\t\t\t\t'normal flex items-center justify-center rounded-lg',\n\t\t\t\t\t\t\t\t\t'h-8 w-8 text-sm font-semibold',\n\t\t\t\t\t\t\t\t\t'text-storm-300',\n\t\t\t\t\t\t\t\t\t'dark:bg-white/15',\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t'cursor-pointer hover:bg-white-600 hover:text-storm-500 dark:text-white dark:hover:bg-hurricane-300 dark:hover:text-white':\n\t\t\t\t\t\t\t\t\t\t\t!day.disabled,\n\t\t\t\t\t\t\t\t\t\t'dark:text-hurricane-200': day.disabled,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t`col-start-${day.offset}`,\n\t\t\t\t\t\t\t\t\t{ 'cursor-not-allowed opacity-60': day.disabled },\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t'border border-solid border-off-white-700 bg-off-white-300 text-storm-500 dark:border-none dark:bg-hurricane-200 dark:text-white':\n\t\t\t\t\t\t\t\t\t\t\t!day.disabled && isSameDay(day.date, new Date()),\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\tonClick={() => this._setValue(day.date)}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{day.day}\n\t\t\t\t\t\t\t</time>\n\t\t\t\t\t\t);\n\t\t\t\t\t})}\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t);\n\t}\n\n\tprivate _getMonthView() {\n\t\tconst months = this._generateMonths();\n\t\treturn (\n\t\t\t<div class={view({ view: 'month' })}>\n\t\t\t\t{this._getHeader('month')}\n\n\t\t\t\t<div class='flex flex-wrap items-start gap-2'>\n\t\t\t\t\t{months.map(month => (\n\t\t\t\t\t\t<p-button\n\t\t\t\t\t\t\tvariant={month.active ? 'primary' : 'secondary'}\n\t\t\t\t\t\t\tdisabled={month.disabled}\n\t\t\t\t\t\t\tonClick={() => this._setMonth(month.month)}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{format(setMonth(new Date(), month.month), 'MMMM', {\n\t\t\t\t\t\t\t\tlocale: state.locale === 'nl' ? nl : enUS,\n\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t</p-button>\n\t\t\t\t\t))}\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t);\n\t}\n\n\tprivate _getYearView() {\n\t\tconst years = this._generateYears();\n\t\treturn (\n\t\t\t<div class={view({ view: 'year' })}>\n\t\t\t\t{this._getHeader('year')}\n\t\t\t\t<div\n\t\t\t\t\tclass='grid h-full grid-cols-4 gap-2 overflow-scroll'\n\t\t\t\t\tref={ref => (this._yearItemsRef = ref)}\n\t\t\t\t>\n\t\t\t\t\t{years.map(year => (\n\t\t\t\t\t\t<p-button\n\t\t\t\t\t\t\tclass='w-full'\n\t\t\t\t\t\t\tvariant={year.active ? 'primary' : 'secondary'}\n\t\t\t\t\t\t\tonClick={() => this._setYear(year.year)}\n\t\t\t\t\t\t\tdata-active={year.active}\n\t\t\t\t\t\t\tdata-current={year.current}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{year.year}\n\t\t\t\t\t\t</p-button>\n\t\t\t\t\t))}\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t);\n\t}\n\n\tprivate _getHeader(type: 'day' | 'month' | 'year' = 'day') {\n\t\tlet nextFn = num => this._changeMonth(num);\n\t\tlet nextType: 'month' | 'year' = 'month';\n\n\t\tif (type === 'month' || type === 'year') {\n\t\t\tnextFn = num => this._changeYear(num);\n\t\t\tnextType = 'year';\n\t\t}\n\n\t\treturn (\n\t\t\t<div class={header({ type: this.mode })}>\n\t\t\t\t{this.mode !== 'year' && (\n\t\t\t\t\t<p-button\n\t\t\t\t\t\tvariant='secondary'\n\t\t\t\t\t\ticonOnly\n\t\t\t\t\t\ticon='caret'\n\t\t\t\t\t\ticonRotate={90}\n\t\t\t\t\t\tsize='sm'\n\t\t\t\t\t\tonClick={() => nextFn(-1)}\n\t\t\t\t\t\tdisabled={\n\t\t\t\t\t\t\t!this._canSetAmount(nextType, -1) || this._view === 'year'\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\n\t\t\t\t<div\n\t\t\t\t\tclass={cn('flex gap-2', {\n\t\t\t\t\t\t'flex-1': this._enableToday,\n\t\t\t\t\t})}\n\t\t\t\t>\n\t\t\t\t\t{this.mode !== 'year' && (\n\t\t\t\t\t\t<p-button\n\t\t\t\t\t\t\tvariant='secondary'\n\t\t\t\t\t\t\tsize='sm'\n\t\t\t\t\t\t\tonClick={() => this._changeView('month')}\n\t\t\t\t\t\t\tdisabled={!this._canChangeView('month')}\n\t\t\t\t\t\t\tactive={this._view === 'month' && this.mode !== 'month'}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{format(this._viewDate, 'MMMM', {\n\t\t\t\t\t\t\t\tlocale: state.locale === 'nl' ? nl : enUS,\n\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t</p-button>\n\t\t\t\t\t)}\n\n\t\t\t\t\t<p-button\n\t\t\t\t\t\tvariant='secondary'\n\t\t\t\t\t\tsize='sm'\n\t\t\t\t\t\tonClick={() => this._changeView('year')}\n\t\t\t\t\t\tdisabled={!this._canChangeView('year')}\n\t\t\t\t\t\tactive={this._view === 'year' && this.mode !== 'year'}\n\t\t\t\t\t>\n\t\t\t\t\t\t{getYear(this._viewDate)}\n\t\t\t\t\t</p-button>\n\n\t\t\t\t\t{this._enableToday && (\n\t\t\t\t\t\t<p-tooltip\n\t\t\t\t\t\t\tclass='ml-auto'\n\t\t\t\t\t\t\tcontent={this.todayText}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<p-button\n\t\t\t\t\t\t\t\tvariant='secondary'\n\t\t\t\t\t\t\t\tsize='sm'\n\t\t\t\t\t\t\t\ticon='calendar'\n\t\t\t\t\t\t\t\tslot='trigger'\n\t\t\t\t\t\t\t\ticonOnly={true}\n\t\t\t\t\t\t\t\tonClick={() => this._setToday()}\n\t\t\t\t\t\t\t></p-button>\n\t\t\t\t\t\t</p-tooltip>\n\t\t\t\t\t)}\n\t\t\t\t</div>\n\n\t\t\t\t{this.mode !== 'year' && (\n\t\t\t\t\t<p-button\n\t\t\t\t\t\tvariant='secondary'\n\t\t\t\t\t\ticonOnly\n\t\t\t\t\t\ticon='caret'\n\t\t\t\t\t\ticonRotate={-90}\n\t\t\t\t\t\tsize='sm'\n\t\t\t\t\t\tonClick={() => nextFn(1)}\n\t\t\t\t\t\tdisabled={!this._canSetAmount(nextType, 1) || this._view == 'year'}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t</div>\n\t\t);\n\t}\n\n\tprivate _setYear(year: number) {\n\t\tconst date = setYear(this._viewDate, year);\n\t\tif (this.mode !== 'year') {\n\t\t\tthis._viewDate = date;\n\t\t\tthis._view = 'month';\n\t\t\treturn;\n\t\t}\n\n\t\tthis._viewDate = date;\n\t\tthis._setValue(setMonth(setDate(date, 1), 0));\n\t}\n\n\tprivate _setMonth(month: number) {\n\t\tconst date = setMonth(this._viewDate, month);\n\t\tif (this.mode === 'day') {\n\t\t\tthis._viewDate = date;\n\t\t\tthis._view = 'day';\n\t\t\treturn;\n\t\t}\n\n\t\tthis._viewDate = date;\n\t\tthis._setValue(setDate(date, 1));\n\t}\n\n\tprivate _setToday() {\n\t\tthis._viewDate = this._today;\n\t\tthis._setValue(this._today);\n\t\tthis._view = 'day';\n\t}\n\n\tprivate _changeMonth(amount = 1) {\n\t\tconst allowed = this._canSetAmount('month', amount);\n\t\tif (!allowed) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst newDate = addMonths(this._viewDate, amount);\n\t\tthis._viewDate = newDate;\n\t}\n\n\tprivate _changeYear(amount = 1) {\n\t\tconst allowed = this._canSetAmount('year', amount);\n\t\tif (!allowed) {\n\t\t\treturn;\n\t\t}\n\n\t\tlet newDate = addYears(this._viewDate, amount);\n\t\tthis._viewDate = newDate;\n\t}\n\n\tprivate _setValue(value: Date) {\n\t\tif (value === null) {\n\t\t\tthis._value = null;\n\t\t\tthis.valueChange.emit(null);\n\t\t\treturn;\n\t\t}\n\n\t\tif (!isValid(value)) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this._isDisabledDay(value)) {\n\t\t\treturn;\n\t\t}\n\n\t\tvalue = startOfDay(value);\n\t\tconst isSameValue = isSameDay(value, this._value);\n\n\t\tif (isSameValue) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._value = value;\n\t\tthis.valueChange.emit(value);\n\t}\n\n\tprivate _generateDaysInMonth() {\n\t\tconst days = Array.from(Array(getDaysInMonth(this._viewDate)).keys());\n\n\t\treturn days.map(day => {\n\t\t\tday = day + 1;\n\t\t\tconst date = setDate(this._viewDate, day);\n\n\t\t\tconst dayOfWeek = getDay(date);\n\t\t\treturn {\n\t\t\t\tday,\n\t\t\t\tdate,\n\t\t\t\toffset: day === 1 ? (dayOfWeek === 0 ? 7 : dayOfWeek) : false,\n\t\t\t\tcurrent: isSameDay(date, this._today),\n\t\t\t\tactive: isSameDay(date, this._value),\n\t\t\t\tdisabled: this._isDisabledDay(date),\n\t\t\t};\n\t\t});\n\t}\n\n\tprivate _isDisabledDay(day: Date) {\n\t\treturn (\n\t\t\t(isBefore(day, this._minDate) && !isSameDay(day, this._maxDate)) ||\n\t\t\t(isAfter(day, this._maxDate) && !isSameDay(day, this._maxDate)) ||\n\t\t\t((getDay(day) === 0 || getDay(day) === 6) && this.disableWeekends) ||\n\t\t\tthis._disabledDates.findIndex(date => isSameDay(date, day)) >= 0\n\t\t);\n\t}\n\n\tprivate _generateMonths() {\n\t\tconst year = getYear(this._viewDate);\n\t\tconst months = Array.from(Array(12).keys());\n\n\t\treturn months.map(month => {\n\t\t\tconst date = new Date(year, month, 1);\n\t\t\treturn {\n\t\t\t\tmonth,\n\t\t\t\tcurrent: isSameMonth(this._today, date),\n\t\t\t\tactive: isSameMonth(this._value, date),\n\t\t\t\tdisabled:\n\t\t\t\t\tisAfter(date, this._maxDate) ||\n\t\t\t\t\tisBefore(endOfMonth(date), this._minDate),\n\t\t\t};\n\t\t});\n\t}\n\n\tprivate _generateYears() {\n\t\tconst maxYear = getYear(this._maxDate) + 1;\n\t\tconst minYear = getYear(this._minDate);\n\n\t\treturn Array.from(Array(maxYear - minYear).keys()).map(index => {\n\t\t\tconst year = minYear + index;\n\t\t\treturn {\n\t\t\t\tyear,\n\t\t\t\tcurrent: getYear(this._today) === year,\n\t\t\t\tactive: getYear(this._value) === year,\n\t\t\t};\n\t\t});\n\t}\n\n\tprivate _scrollYearIntoView() {\n\t\tconst items = this._yearItemsRef;\n\t\tif (!items) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst active = items.querySelector('p-button[data-active]') as HTMLElement;\n\t\tif (active) {\n\t\t\treturn items.scrollTo({\n\t\t\t\ttop: active.offsetTop - 100,\n\t\t\t});\n\t\t}\n\n\t\tconst current = items.querySelector(\n\t\t\t'p-button[data-current]'\n\t\t) as HTMLElement;\n\t\tif (current) {\n\t\t\treturn items.scrollTo({\n\t\t\t\ttop: current.offsetTop - 100,\n\t\t\t});\n\t\t}\n\t}\n\n\tprivate _changeView(view: 'year' | 'month') {\n\t\tif (!this._canChangeView(view)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._view = view;\n\t}\n\n\tprivate _canChangeView(view: 'year' | 'month') {\n\t\tif (view === 'year') {\n\t\t\tif (isSameYear(this._minDate, this._maxDate)) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\n\t\tif (isSameMonth(this._minDate, this._maxDate)) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}\n\n\tprivate _canSetAmount(type: 'month' | 'year', amount = 1) {\n\t\tif (type === 'month') {\n\t\t\tconst newDate = addMonths(this._viewDate, amount);\n\t\t\tconst startNewDate = startOfMonth(newDate);\n\t\t\tif (\n\t\t\t\t(isBefore(startNewDate, startOfMonth(this._minDate)) &&\n\t\t\t\t\t!isSameDay(startNewDate, this._minDate)) ||\n\t\t\t\tisAfter(startNewDate, endOfMonth(this._maxDate))\n\t\t\t) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tif (type === 'year') {\n\t\t\tlet newDate = addYears(this._viewDate, amount);\n\t\t\tconst year = getYear(newDate);\n\t\t\tif (year < getYear(this._minDate) || year > getYear(this._maxDate)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}\n\n\tprivate _getAutomaticMax() {\n\t\tconst date = addYears(new Date(), 50);\n\n\t\tlet year = getYear(date);\n\t\tyear = Math.ceil(year / 10) * 10;\n\n\t\treturn setYear(date, year);\n\t}\n}\n"],"names":["nl","enUS"],"mappings":";;;;;;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAAS,OAAO,CAAC,SAAS,EAAE,WAAW,EAAE;AACxD,EAAE,YAAY,CAAC,CAAC,EAAE,SAAS,CAAC;AAC5B,EAAE,IAAI,IAAI,GAAG,MAAM,CAAC,SAAS,CAAC;AAC9B,EAAE,IAAI,MAAM,GAAG,SAAS,CAAC,WAAW,CAAC;AACrC,EAAE,IAAI,KAAK,CAAC,MAAM,CAAC,EAAE;AACrB,IAAI,OAAO,IAAI,IAAI,CAAC,GAAG,CAAC;AACxB;AACA,EAAE,IAAI,CAAC,MAAM,EAAE;AACf;AACA,IAAI,OAAO,IAA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AAId,QAAA,IAAI,IAAI,KAAK,MAAM,EAAE;YACpB,IAAI,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,SAAS,EAAE,MAAM,CAAC;AAC9C,YAAA,MAAM,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC;AAC7B,YAAA,IAAI,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE;AACnE,gBAAA,OAAO,KAAK;;;AAId,QAAA,OAAO,IAAI;;IAGJ,gBAAgB,GAAA;QACvB,MAAM,IAAI,GAAG,QAAQ,CAAC,IAAI,IAAI,EAAE,EAAE,EAAE,CAAC;AAErC,QAAA,IAAI,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;QACxB,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,GAAG,EAAE,CAAC,GAAG,EAAE;AAEhC,QAAA,OAAO,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC;;;;;;;;;;;;;;","x_google_ignoreList":[0,1,2,3,4,5,6,7]}
@@ -3,7 +3,7 @@ import { c as childOf } from './child-of-BFSNj6hu.js';
3
3
  import { i as isMobileBrowser } from './is-mobile-browser-DVCJlilm.js';
4
4
  import { a as asBoolean } from './as-boolean-C5CTp9IA.js';
5
5
  import { b as state } from './state-DKMgUotc.js';
6
- import { r as requiredArgs, t as toDate, _ as _typeof, g as getUTCWeekYear, s as startOfUTCWeek, a as startOfUTCISOWeek, b as getUTCWeek, c as toInteger, d as getUTCISOWeek, e as getDefaultOptions, l as locale, f as longFormatters, h as subMilliseconds, i as getTimezoneOffsetInMilliseconds, j as isProtectedWeekYearToken, k as throwProtectedError, m as isProtectedDayOfYearToken, n as isValid, o as isBefore, p as isAfter, q as format, u as locale$1, v as startOfDay, w as startOfMonth, x as isSameDay, y as isWeekend } from './index-EKSDxqjG.js';
6
+ import { r as requiredArgs, t as toDate, _ as _typeof, g as getUTCWeekYear, s as startOfUTCWeek, a as startOfUTCISOWeek, b as getUTCWeek, c as toInteger, d as getUTCISOWeek, e as getDefaultOptions, l as locale, f as longFormatters, h as subMilliseconds, i as getTimezoneOffsetInMilliseconds, j as isProtectedWeekYearToken, k as throwProtectedError, m as isProtectedDayOfYearToken, n as isValid, o as isBefore, p as isAfter, q as format, u as locale$1, v as startOfDay, w as startOfMonth, x as isSameDay, y as isWeekend, z as addYears, A as getYear, B as setYear } from './index-BYMwCs48.js';
7
7
 
8
8
  /**
9
9
  * Days in 1 week.
@@ -2892,11 +2892,11 @@ const Datepicker = class {
2892
2892
  /**
2893
2893
  * Min date
2894
2894
  */
2895
- minDate;
2895
+ minDate = null;
2896
2896
  /**
2897
2897
  * Max date
2898
2898
  */
2899
- maxDate;
2899
+ maxDate = null;
2900
2900
  /**
2901
2901
  * Wether to disable the weekends
2902
2902
  */
@@ -2996,6 +2996,10 @@ const Datepicker = class {
2996
2996
  this._setValue(value);
2997
2997
  }
2998
2998
  parseMinDate(minDate) {
2999
+ if (minDate === null || minDate === '') {
3000
+ this.minDate = new Date(1970, 0, 1);
3001
+ return;
3002
+ }
2999
3003
  if (typeof minDate === 'string') {
3000
3004
  minDate = new Date(minDate);
3001
3005
  }
@@ -3008,6 +3012,10 @@ const Datepicker = class {
3008
3012
  }
3009
3013
  }
3010
3014
  parseMaxDate(maxDate) {
3015
+ if (maxDate === null || maxDate === '') {
3016
+ this.maxDate = this._getAutomaticMax();
3017
+ return;
3018
+ }
3011
3019
  if (typeof maxDate === 'string') {
3012
3020
  maxDate = new Date(maxDate);
3013
3021
  }
@@ -3052,12 +3060,8 @@ const Datepicker = class {
3052
3060
  if (this.disabledDates) {
3053
3061
  this.parseDisabledDates(this.disabledDates);
3054
3062
  }
3055
- if (this.minDate) {
3056
- this.parseMinDate(this.minDate);
3057
- }
3058
- if (this.maxDate) {
3059
- this.parseMaxDate(this.maxDate);
3060
- }
3063
+ this.parseMinDate(this.minDate);
3064
+ this.parseMaxDate(this.maxDate);
3061
3065
  if (this.mode !== 'day' && this.format === this._defaultFormats['day']) {
3062
3066
  this.format = this._defaultFormats[this.mode];
3063
3067
  }
@@ -3065,16 +3069,16 @@ const Datepicker = class {
3065
3069
  this.parseValue(this.value);
3066
3070
  }
3067
3071
  render() {
3068
- return (h("p-dropdown", { key: 'a3946a47842e6a337eeb7a06c6d7bcdffc6d6fb7', allowOverflow: true, strategy: this.strategy, placement: this.placement, disableTriggerClick: true, applyMaxWidth: false, applyFullWidth: false, insideClick: true, show: this._showDropdown, isDatepicker: true }, h("p-field", { key: 'c2bc8883ca1ceb807d3402afcf6a708f176611b9', slot: 'trigger', icon: this.hideIconWhenFilled && !!this._value ? null : 'calendar-multi', iconPosition: 'start', size: this.size, prefix: this.prefix, label: this.label, loading: this.loading, helper: this.helper, required: asBoolean(this.required), showOptional: asBoolean(this.showOptional), error: this.error, forceShowTooltip: !!this.error?.length && !this._showDropdown, autoShowError: false, disabled: asBoolean(this.disabled), focused: this._showDropdown, value: this._getFormattedDate(), placeholder: this.placeholder, onFocus: () => this._onFocus(), onBlur: () => this._onBlur(), onValueChange: ev => this._onValueChange(ev.detail), onInputRefChange: ev => (this._inputRef = ev.detail) }), this.enableNativePicker && this._isMobileBrowser && (h("input", { key: '64b46bd7ad4423a4d8e67098836a3a7f790e85ef', slot: 'trigger', type: this.mode === 'day' ? 'date' : 'month', class: 'pointer-events-none absolute left-0 top-0 z-[-10] overflow-hidden opacity-0', onInput: ev => this._onNativeInput(ev), ref: ref => (this._dateInputRef = ref), value: this._value &&
3072
+ return (h("p-dropdown", { key: 'f958a8b84161a153a41c6e85a76b77d32a20512d', allowOverflow: true, strategy: this.strategy, placement: this.placement, disableTriggerClick: true, applyMaxWidth: false, applyFullWidth: false, insideClick: true, show: this._showDropdown, isDatepicker: true }, h("p-field", { key: 'c08c35d9c1d96f1ae557f46639d8581d0b590002', slot: 'trigger', icon: this.hideIconWhenFilled && !!this._value ? null : 'calendar-multi', iconPosition: 'start', size: this.size, prefix: this.prefix, label: this.label, loading: this.loading, helper: this.helper, required: asBoolean(this.required), showOptional: asBoolean(this.showOptional), error: this.error, forceShowTooltip: !!this.error?.length && !this._showDropdown, autoShowError: false, disabled: asBoolean(this.disabled), focused: this._showDropdown, value: this._getFormattedDate(), placeholder: this.placeholder, onFocus: () => this._onFocus(), onBlur: () => this._onBlur(), onValueChange: ev => this._onValueChange(ev.detail), onInputRefChange: ev => (this._inputRef = ev.detail) }), this.enableNativePicker && this._isMobileBrowser && (h("input", { key: 'f551d9716890a31f4e5956370e4fac08fd8a2bca', slot: 'trigger', type: this.mode === 'day' ? 'date' : 'month', class: 'pointer-events-none absolute left-0 top-0 z-[-10] overflow-hidden opacity-0', onInput: ev => this._onNativeInput(ev), ref: ref => (this._dateInputRef = ref), value: this._value &&
3069
3073
  format(this._value, 'yyyy-MM-dd', {
3070
3074
  locale: state.locale === 'nl' ? locale$1 : locale,
3071
- }), min: this.minDate &&
3072
- format(new Date(this.minDate), 'yyyy-MM-dd', {
3075
+ }), min: this._minDate &&
3076
+ format(new Date(this._minDate), 'yyyy-MM-dd', {
3073
3077
  locale: state.locale === 'nl' ? locale$1 : locale,
3074
3078
  }), max: this.maxDate &&
3075
3079
  format(new Date(this.maxDate), 'yyyy-MM-dd', {
3076
3080
  locale: state.locale === 'nl' ? locale$1 : locale,
3077
- }) })), h("div", { key: '997c17e44f5fa4e053ec79dd558a467a82ca2bc0', slot: 'items' }, h("p-calendar", { key: 'de48e13b9be3b7a412d8dd64ffc4bc8afc92ab34', variant: 'embedded', value: this._value, onValueChange: ({ detail }) => (this.value = detail), preselectToday: this.preselectToday, disabledDates: this.disabledDates, minDate: this.minDate, maxDate: this.maxDate, disableWeekends: this.disableWeekends, enableToday: this.enableToday, todayText: this.todayText, mode: this.mode }))));
3081
+ }) })), h("div", { key: 'b1037b81d561397c3b748502cdd5e85dbaec3a48', slot: 'items' }, h("p-calendar", { key: '35ebe73bd302d35d582a3c65135f1a08f7e05f8e', variant: 'embedded', value: this._value, onValueChange: ({ detail }) => (this.value = detail), preselectToday: this.preselectToday, disabledDates: this.disabledDates, minDate: this.minDate, maxDate: this.maxDate, disableWeekends: this.disableWeekends, enableToday: this.enableToday, todayText: this.todayText, mode: this.mode }))));
3078
3082
  }
3079
3083
  documentClickHandler({ target }) {
3080
3084
  if (!this._showDropdown || childOf(target, this._el)) {
@@ -3200,6 +3204,12 @@ const Datepicker = class {
3200
3204
  locale: state.locale === 'nl' ? locale$1 : locale,
3201
3205
  });
3202
3206
  }
3207
+ _getAutomaticMax() {
3208
+ const date = addYears(new Date(), 50);
3209
+ let year = getYear(date);
3210
+ year = Math.ceil(year / 10) * 10;
3211
+ return setYear(date, year);
3212
+ }
3203
3213
  static get formAssociated() { return true; }
3204
3214
  static get watchers() { return {
3205
3215
  "value": ["parseValue"],