@adyen/bento-vue2 1.7.0 → 1.8.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.
Files changed (223) hide show
  1. package/dist/@types/components.d.ts +2 -0
  2. package/dist/@types/packages/core/src/components/button/button.types.d.ts +1 -1
  3. package/dist/@types/packages/vue2/src/components/action-bar/action-bar.vue.d.ts +11 -0
  4. package/dist/@types/packages/vue2/src/components/button/components/button-actions/button-actions.types.d.ts +1 -1
  5. package/dist/@types/packages/vue2/src/components/button/components/button-actions/button-actions.vue.d.ts +7 -2
  6. package/dist/@types/packages/vue2/src/components/button/components/loading-button/loading-button.vue.d.ts +28 -18
  7. package/dist/@types/packages/vue2/src/components/checkbox/checkbox.vue.d.ts +25 -0
  8. package/dist/@types/packages/vue2/src/components/data-grid/data-grid.vue.d.ts +13 -1
  9. package/dist/@types/packages/vue2/src/components/date-picker/date-picker.vue.d.ts +9 -0
  10. package/dist/@types/packages/vue2/src/components/date-range-picker/components/date-range-picker-calendar/date-range-picker-calendar.types.d.ts +6 -2
  11. package/dist/@types/packages/vue2/src/components/date-range-picker/components/date-range-picker-calendar/date-range-picker-calendar.vue.d.ts +153 -12
  12. package/dist/@types/packages/vue2/src/components/date-range-picker/date-range-picker.types.d.ts +1 -1
  13. package/dist/@types/packages/vue2/src/components/date-range-picker/date-range-picker.vue.d.ts +18 -0
  14. package/dist/@types/packages/vue2/src/components/dropdown/components/dropdown-options-container/dropdown-options-container.vue.d.ts +320 -21
  15. package/dist/@types/packages/vue2/src/components/dropdown/components/variants/dropdown-avatar/dropdown-avatar.vue.d.ts +9 -0
  16. package/dist/@types/packages/vue2/src/components/dropdown/components/variants/dropdown-country/dropdown-country.vue.d.ts +9 -0
  17. package/dist/@types/packages/vue2/src/components/dropdown/components/variants/dropdown-currency/dropdown-currency.vue.d.ts +9 -0
  18. package/dist/@types/packages/vue2/src/components/dropdown/components/variants/dropdown-payment-method/dropdown-payment-method.vue.d.ts +9 -0
  19. package/dist/@types/packages/vue2/src/components/dropdown/components/variants/dropdown-tag/dropdown-tag.vue.d.ts +9 -0
  20. package/dist/@types/packages/vue2/src/components/dropdown/dropdown.vue.d.ts +12 -3
  21. package/dist/@types/packages/vue2/src/components/filter-bar/components/all-filters-modal/all-filters-modal.vue.d.ts +30 -24
  22. package/dist/@types/packages/vue2/src/components/filter-bar/components/date-range-filter/date-range-filter.vue.d.ts +1 -0
  23. package/dist/@types/packages/vue2/src/components/input-field/input-field.vue.d.ts +9 -0
  24. package/dist/@types/packages/vue2/src/components/internal/calendar/calendar.types.d.ts +12 -0
  25. package/dist/@types/packages/vue2/src/components/internal/calendar/calendar.vue.d.ts +11 -1
  26. package/dist/@types/packages/vue2/src/components/internal/calendar/components/calendar-month/composables/granular-min-max-date.d.ts +2 -0
  27. package/dist/@types/packages/vue2/src/components/internal/calendar/components/calendar-month/composables/granular-min-max-date.types.d.ts +13 -0
  28. package/dist/@types/packages/vue2/src/components/internal/calendar/composables/use-granularity-adjustments.d.ts +2 -0
  29. package/dist/@types/packages/vue2/src/components/internal/calendar/composables/use-granularity-adjustments.types.d.ts +14 -0
  30. package/dist/@types/packages/vue2/src/components/internal/calendar/composables/use-granularity-memory.d.ts +2 -0
  31. package/dist/@types/packages/vue2/src/components/internal/calendar/composables/use-granularity-memory.types.d.ts +22 -0
  32. package/dist/@types/packages/vue2/src/components/internal/controls-group/controls-group.vue.d.ts +1 -1
  33. package/dist/@types/packages/vue2/src/components/internal/field-label/field-label.vue.d.ts +48 -0
  34. package/dist/@types/packages/vue2/src/components/internal/field-label/index.d.ts +1 -0
  35. package/dist/@types/packages/vue2/src/components/internal/grid-layout/grid-layout.vue.d.ts +11 -0
  36. package/dist/@types/packages/vue2/src/components/internal/index.d.ts +1 -0
  37. package/dist/@types/packages/vue2/src/components/modal/components/base-modal/base-modal.vue.d.ts +2 -1
  38. package/dist/@types/packages/vue2/src/components/popover/popover.keys.d.ts +1 -0
  39. package/dist/@types/packages/vue2/src/components/popover/popover.vue.d.ts +16 -22
  40. package/dist/@types/packages/vue2/src/components/structured-list/components/structered-list-item/structured-list-item.vue.d.ts +1 -0
  41. package/dist/@types/packages/vue2/src/components/structured-list/structured-list.keys.d.ts +1 -0
  42. package/dist/@types/packages/vue2/src/components/structured-list/structured-list.vue.d.ts +20 -1
  43. package/dist/@types/packages/vue2/src/components/summary-grid/summary-grid.types.d.ts +4 -4
  44. package/dist/@types/packages/vue2/src/components/textarea/textarea.vue.d.ts +9 -0
  45. package/dist/@types/packages/vue2/src/components/timeline/components/timeline-item/timeline-item.vue.d.ts +19 -2
  46. package/dist/@types/packages/vue2/src/components/timeline/timeline.types.d.ts +4 -2
  47. package/dist/@types/packages/vue2/src/components/timeline/timeline.vue.d.ts +18 -2
  48. package/dist/@types/packages/vue2/src/index.d.ts +1 -0
  49. package/dist/accordion.js +1 -1
  50. package/dist/action-bar.js +112 -93
  51. package/dist/action-bar.js.map +1 -1
  52. package/dist/alert.js +1 -1
  53. package/dist/assets/base-modal.css +1 -1
  54. package/dist/assets/calendar.css +1 -1
  55. package/dist/assets/checkbox.css +1 -1
  56. package/dist/assets/controls-group.css +1 -1
  57. package/dist/assets/dropdown.css +1 -1
  58. package/dist/assets/field-label.css +1 -0
  59. package/dist/assets/grid-layout.css +1 -1
  60. package/dist/assets/index.css +1 -1
  61. package/dist/assets/index11.css +1 -1
  62. package/dist/assets/index12.css +1 -1
  63. package/dist/assets/index13.css +1 -1
  64. package/dist/assets/index14.css +1 -1
  65. package/dist/assets/index15.css +1 -1
  66. package/dist/assets/index16.css +1 -1
  67. package/dist/assets/index17.css +1 -1
  68. package/dist/assets/index18.css +1 -1
  69. package/dist/assets/index19.css +1 -1
  70. package/dist/assets/index2.css +1 -1
  71. package/dist/assets/index20.css +1 -1
  72. package/dist/assets/index21.css +1 -1
  73. package/dist/assets/index22.css +1 -1
  74. package/dist/assets/index23.css +1 -1
  75. package/dist/assets/index24.css +1 -1
  76. package/dist/assets/index25.css +1 -1
  77. package/dist/assets/index26.css +1 -1
  78. package/dist/assets/index27.css +1 -1
  79. package/dist/assets/index28.css +1 -1
  80. package/dist/assets/index29.css +1 -1
  81. package/dist/assets/index3.css +1 -1
  82. package/dist/assets/index30.css +1 -1
  83. package/dist/assets/index32.css +1 -1
  84. package/dist/assets/index33.css +1 -1
  85. package/dist/assets/index34.css +1 -1
  86. package/dist/assets/index35.css +1 -1
  87. package/dist/assets/index36.css +1 -1
  88. package/dist/assets/index37.css +1 -1
  89. package/dist/assets/index38.css +1 -1
  90. package/dist/assets/index39.css +1 -1
  91. package/dist/assets/index4.css +1 -1
  92. package/dist/assets/index40.css +1 -1
  93. package/dist/assets/index41.css +1 -1
  94. package/dist/assets/index42.css +1 -1
  95. package/dist/assets/index43.css +1 -1
  96. package/dist/assets/index44.css +1 -1
  97. package/dist/assets/index45.css +1 -1
  98. package/dist/assets/index5.css +1 -1
  99. package/dist/assets/index6.css +1 -1
  100. package/dist/assets/index7.css +1 -1
  101. package/dist/assets/index8.css +1 -1
  102. package/dist/assets/index9.css +1 -1
  103. package/dist/assets/loading-button.css +1 -1
  104. package/dist/avatar-image.js +1 -1
  105. package/dist/badge.js +1 -1
  106. package/dist/button.js +38 -35
  107. package/dist/button.js.map +1 -1
  108. package/dist/card.js +1 -1
  109. package/dist/checkbox.js +5 -5
  110. package/dist/chunks/{base-modal.88e7b9d4.js → base-modal.31634fe8.js} +60 -49
  111. package/dist/chunks/base-modal.31634fe8.js.map +1 -0
  112. package/dist/chunks/{button-actions-with-menu.a5413243.js → button-actions-with-menu.5faea13e.js} +5 -5
  113. package/dist/chunks/{button-actions-with-menu.a5413243.js.map → button-actions-with-menu.5faea13e.js.map} +1 -1
  114. package/dist/chunks/button.e09d5980.js.map +1 -1
  115. package/dist/chunks/calendar.47e9e755.js +959 -0
  116. package/dist/chunks/calendar.47e9e755.js.map +1 -0
  117. package/dist/chunks/{checkbox.5343e28e.js → checkbox.2277450e.js} +67 -56
  118. package/dist/chunks/checkbox.2277450e.js.map +1 -0
  119. package/dist/chunks/controls-group.6c5bfccd.js +79 -0
  120. package/dist/chunks/controls-group.6c5bfccd.js.map +1 -0
  121. package/dist/chunks/{copy.346eadb1.js → copy.a85c2e9f.js} +3 -3
  122. package/dist/chunks/{copy.346eadb1.js.map → copy.a85c2e9f.js.map} +1 -1
  123. package/dist/chunks/{dropdown.f1253a54.js → dropdown.ce937989.js} +200 -196
  124. package/dist/chunks/dropdown.ce937989.js.map +1 -0
  125. package/dist/chunks/field-label.330edb60.js +107 -0
  126. package/dist/chunks/field-label.330edb60.js.map +1 -0
  127. package/dist/chunks/{grid-layout.b7e0d964.js → grid-layout.a806acb2.js} +36 -27
  128. package/dist/chunks/grid-layout.a806acb2.js.map +1 -0
  129. package/dist/chunks/index.210d2169.js +290 -0
  130. package/dist/chunks/index.210d2169.js.map +1 -0
  131. package/dist/chunks/{index.8ac70774.js → index.66503760.js} +3 -3
  132. package/dist/chunks/{index.8ac70774.js.map → index.66503760.js.map} +1 -1
  133. package/dist/chunks/{index.2625175a.js → index.86fc63ca.js} +30 -28
  134. package/dist/chunks/{index.2625175a.js.map → index.86fc63ca.js.map} +1 -1
  135. package/dist/chunks/{index.a201f750.js → index.89942d3a.js} +4 -5
  136. package/dist/chunks/{index.a201f750.js.map → index.89942d3a.js.map} +1 -1
  137. package/dist/chunks/index.a5de5242.js +130 -0
  138. package/dist/chunks/index.a5de5242.js.map +1 -0
  139. package/dist/chunks/index.a99ffd48.js +634 -0
  140. package/dist/chunks/index.a99ffd48.js.map +1 -0
  141. package/dist/chunks/index.d80206ed.js +10 -0
  142. package/dist/chunks/index.d80206ed.js.map +1 -0
  143. package/dist/chunks/{index.37283390.js → index.d8bd7596.js} +96 -99
  144. package/dist/chunks/{index.37283390.js.map → index.d8bd7596.js.map} +1 -1
  145. package/dist/chunks/{listbox-option-tag.6a09e8e2.js → listbox-option-tag.97af47fc.js} +6 -7
  146. package/dist/chunks/{listbox-option-tag.6a09e8e2.js.map → listbox-option-tag.97af47fc.js.map} +1 -1
  147. package/dist/chunks/{listbox.73c38f38.js → listbox.d039b178.js} +5 -6
  148. package/dist/chunks/{listbox.73c38f38.js.map → listbox.d039b178.js.map} +1 -1
  149. package/dist/chunks/loading-button.9a9cbbad.js +89 -0
  150. package/dist/chunks/loading-button.9a9cbbad.js.map +1 -0
  151. package/dist/chunks/{tooltip.104e5fac.js → tooltip.ecd0f707.js} +2 -2
  152. package/dist/chunks/{tooltip.104e5fac.js.map → tooltip.ecd0f707.js.map} +1 -1
  153. package/dist/code-snippet.js +4 -4
  154. package/dist/code-snippet.js.map +1 -1
  155. package/dist/country.js +1 -1
  156. package/dist/data-grid.js +563 -541
  157. package/dist/data-grid.js.map +1 -1
  158. package/dist/date-picker.js +83 -80
  159. package/dist/date-picker.js.map +1 -1
  160. package/dist/date-range-picker.js +2 -2
  161. package/dist/divider.js +1 -1
  162. package/dist/dropdown.js +3 -3
  163. package/dist/empty-state.js +1 -1
  164. package/dist/filter-bar.js +13 -12
  165. package/dist/filter-bar.js.map +1 -1
  166. package/dist/focus-trap.js +1 -1
  167. package/dist/form-layout.js +1 -1
  168. package/dist/header.js +63 -67
  169. package/dist/header.js.map +1 -1
  170. package/dist/index.js +211 -209
  171. package/dist/index.js.map +1 -1
  172. package/dist/info-icon.js +3 -3
  173. package/dist/input-field.js +57 -55
  174. package/dist/input-field.js.map +1 -1
  175. package/dist/internal.js +13 -12
  176. package/dist/link.js +1 -1
  177. package/dist/loading-indicator.js +1 -1
  178. package/dist/menu.js +1 -1
  179. package/dist/modal.js +2 -2
  180. package/dist/modal.js.map +1 -1
  181. package/dist/pagination.js +2 -2
  182. package/dist/payment-method.js +1 -1
  183. package/dist/popover.js +3 -305
  184. package/dist/popover.js.map +1 -1
  185. package/dist/popper-container.js +1 -1
  186. package/dist/radio-group.js +3 -3
  187. package/dist/search-bar.js +2 -2
  188. package/dist/segmented-control.js +2 -2
  189. package/dist/sidepanel.js +2 -2
  190. package/dist/status.js +1 -1
  191. package/dist/stepper.js +1 -1
  192. package/dist/structured-list.js +1 -1
  193. package/dist/summary-grid.js +3 -3
  194. package/dist/summary-grid.js.map +1 -1
  195. package/dist/tabs.js +1 -1
  196. package/dist/tag.js +2 -2
  197. package/dist/textarea.js +59 -56
  198. package/dist/textarea.js.map +1 -1
  199. package/dist/timeline.js +226 -173
  200. package/dist/timeline.js.map +1 -1
  201. package/dist/toast.js +1 -1
  202. package/dist/toggle.js +1 -1
  203. package/dist/tutorial.js +7 -7
  204. package/dist/web-types.json +519 -393
  205. package/package.json +3 -3
  206. package/dist/@types/packages/vue2/src/components/modal/components/base-modal/__mocks__/base-modal.vue.d.ts +0 -118
  207. package/dist/assets/error-message.css +0 -1
  208. package/dist/chunks/base-modal.88e7b9d4.js.map +0 -1
  209. package/dist/chunks/calendar.24d0ac04.js +0 -821
  210. package/dist/chunks/calendar.24d0ac04.js.map +0 -1
  211. package/dist/chunks/checkbox.5343e28e.js.map +0 -1
  212. package/dist/chunks/controls-group.2a21bd83.js +0 -87
  213. package/dist/chunks/controls-group.2a21bd83.js.map +0 -1
  214. package/dist/chunks/dropdown.f1253a54.js.map +0 -1
  215. package/dist/chunks/error-message.8302a46c.js +0 -47
  216. package/dist/chunks/error-message.8302a46c.js.map +0 -1
  217. package/dist/chunks/grid-layout.b7e0d964.js.map +0 -1
  218. package/dist/chunks/index.d6b5f5e1.js +0 -112
  219. package/dist/chunks/index.d6b5f5e1.js.map +0 -1
  220. package/dist/chunks/index.e566354f.js +0 -532
  221. package/dist/chunks/index.e566354f.js.map +0 -1
  222. package/dist/chunks/loading-button.c65682d6.js +0 -86
  223. package/dist/chunks/loading-button.c65682d6.js.map +0 -1
@@ -0,0 +1,959 @@
1
+ import { defineComponent as le, computed as I, ref as $, watch as j, nextTick as Ne, toRef as F, reactive as ie, toRaw as Te } from "vue";
2
+ import { r as E, t as S, g as fe, e as oe, d as Ee, f as Se } from "./index.f55fdc32.js";
3
+ import { t as O, B as we, a as be, f as ve } from "./index.b83f8b7e.js";
4
+ import { e as De } from "./index.d80206ed.js";
5
+ import { a as Me } from "./button.e09d5980.js";
6
+ import { B as Oe } from "./index.965ac1af.js";
7
+ import { u as Ie } from "./i18n.155748d6.js";
8
+ import { g as pe } from "./unique-id.a2a2b458.js";
9
+ import { C as xe, a as Re } from "./chevron-left.c10778d3.js";
10
+ import { n as ce } from "./_plugin-vue2_normalizer.71e2aa87.js";
11
+ import { a as Pe } from "./keyboard-navigation.ca47dfa8.js";
12
+ import "../assets/calendar.css";
13
+ function G(e, t) {
14
+ E(2, arguments);
15
+ var n = S(e), a = O(t);
16
+ return isNaN(a) ? /* @__PURE__ */ new Date(NaN) : (a && n.setDate(n.getDate() + a), n);
17
+ }
18
+ function W(e, t) {
19
+ E(2, arguments);
20
+ var n = S(e), a = O(t);
21
+ if (isNaN(a))
22
+ return /* @__PURE__ */ new Date(NaN);
23
+ if (!a)
24
+ return n;
25
+ var s = n.getDate(), r = new Date(n.getTime());
26
+ r.setMonth(n.getMonth() + a + 1, 0);
27
+ var l = r.getDate();
28
+ return s >= l ? r : (n.setFullYear(r.getFullYear(), r.getMonth(), s), n);
29
+ }
30
+ function ee(e, t) {
31
+ E(1, arguments);
32
+ var n = t || {}, a = n.locale, s = a && a.options && a.options.weekStartsOn, r = s == null ? 0 : O(s), l = n.weekStartsOn == null ? r : O(n.weekStartsOn);
33
+ if (!(l >= 0 && l <= 6))
34
+ throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");
35
+ var u = S(e), h = u.getDay(), c = (h < l ? 7 : 0) + h - l;
36
+ return u.setDate(u.getDate() - c), u.setHours(0, 0, 0, 0), u;
37
+ }
38
+ function C(e) {
39
+ E(1, arguments);
40
+ var t = S(e);
41
+ return t.setHours(0, 0, 0, 0), t;
42
+ }
43
+ var Ae = 864e5;
44
+ function Le(e, t) {
45
+ E(2, arguments);
46
+ var n = C(e), a = C(t), s = n.getTime() - fe(n), r = a.getTime() - fe(a);
47
+ return Math.round((s - r) / Ae);
48
+ }
49
+ function he(e, t) {
50
+ E(2, arguments);
51
+ var n = O(t), a = n * 7;
52
+ return G(e, a);
53
+ }
54
+ function Z(e, t) {
55
+ E(2, arguments);
56
+ var n = C(e), a = C(t);
57
+ return n.getTime() === a.getTime();
58
+ }
59
+ function me(e, t) {
60
+ var n = e.getFullYear() - t.getFullYear() || e.getMonth() - t.getMonth() || e.getDate() - t.getDate() || e.getHours() - t.getHours() || e.getMinutes() - t.getMinutes() || e.getSeconds() - t.getSeconds() || e.getMilliseconds() - t.getMilliseconds();
61
+ return n < 0 ? -1 : n > 0 ? 1 : n;
62
+ }
63
+ function Ue(e, t) {
64
+ E(2, arguments);
65
+ var n = S(e), a = S(t), s = me(n, a), r = Math.abs(Le(n, a));
66
+ n.setDate(n.getDate() - s * r);
67
+ var l = +(me(n, a) === -s), u = s * (r - l);
68
+ return u === 0 ? 0 : u;
69
+ }
70
+ function te(e) {
71
+ E(1, arguments);
72
+ var t = S(e);
73
+ return t.setDate(1), t.setHours(0, 0, 0, 0), t;
74
+ }
75
+ function ue(e, t) {
76
+ E(1, arguments);
77
+ var n = t || {}, a = n.locale, s = a && a.options && a.options.weekStartsOn, r = s == null ? 0 : O(s), l = n.weekStartsOn == null ? r : O(n.weekStartsOn);
78
+ if (!(l >= 0 && l <= 6))
79
+ throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");
80
+ var u = S(e), h = u.getDay(), c = (h < l ? -7 : 0) + 6 - (h - l);
81
+ return u.setDate(u.getDate() + c), u.setHours(23, 59, 59, 999), u;
82
+ }
83
+ function We(e, t) {
84
+ E(2, arguments);
85
+ var n = O(t);
86
+ return G(e, -n);
87
+ }
88
+ function X(e, t) {
89
+ E(2, arguments);
90
+ var n = O(t);
91
+ return W(e, -n);
92
+ }
93
+ function Ce(e, t) {
94
+ E(2, arguments);
95
+ var n = S(e), a = S(t);
96
+ return n.getTime() > a.getTime();
97
+ }
98
+ function Ye(e, t) {
99
+ E(2, arguments);
100
+ var n = S(e), a = S(t);
101
+ return n.getTime() < a.getTime();
102
+ }
103
+ function ye(e, t) {
104
+ E(2, arguments);
105
+ var n = S(e).getTime(), a = S(t.start).getTime(), s = S(t.end).getTime();
106
+ if (!(a <= s))
107
+ throw new RangeError("Invalid interval");
108
+ return n >= a && n <= s;
109
+ }
110
+ function Fe(e, t, n) {
111
+ E(2, arguments);
112
+ var a = n || {}, s = a.locale, r = s && s.options && s.options.weekStartsOn, l = r == null ? 0 : O(r), u = a.weekStartsOn == null ? l : O(a.weekStartsOn);
113
+ if (!(u >= 0 && u <= 6))
114
+ throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");
115
+ var h = S(e), c = O(t), D = h.getDay(), d = c % 7, i = (d + 7) % 7, k = 7 - u, N = c < 0 || c > 6 ? c - (D + k) % 7 : (i + k) % 7 - (D + k) % 7;
116
+ return G(h, N);
117
+ }
118
+ function $e(e, t) {
119
+ E(2, arguments);
120
+ var n = O(t);
121
+ return he(e, -n);
122
+ }
123
+ var p = /* @__PURE__ */ ((e) => (e.SINGLE = "single", e.MIDDLE = "middle", e.BEGINNING = "beginning", e.END = "end", e))(p || {}), U = /* @__PURE__ */ ((e) => (e.SINGLE = "single", e.MIDDLE = "middle", e.BEGINNING = "beginning", e.END = "end", e.SELECTED = "selected", e.UNSELECTED = "unselected", e.CURRENT_DAY = "current-day", e.DISABLED = "disabled", e))(U || {}), Q = /* @__PURE__ */ ((e) => (e.CLICK = "click", e.MOUSE_OVER = "mouseover", e))(Q || {});
124
+ const je = le({
125
+ name: "calendar-month-day",
126
+ components: { BentoDate: we },
127
+ inheritAttrs: !0,
128
+ props: {
129
+ /**
130
+ * Date to be displayed as the calendar day. From 1st to 31st (or end of the month defined in the date)
131
+ */
132
+ day: { type: Date, required: !0 },
133
+ /**
134
+ * Indicate if a date should be disabled or not
135
+ */
136
+ disabled: { type: Boolean, default: !1 },
137
+ /**
138
+ * Changes the state of the calendar day to selected.
139
+ */
140
+ selected: { type: Boolean, default: !1 },
141
+ /**
142
+ * When the day is selected, this indicates if the selection is a single date or part of a range.
143
+ * If it's a range it can be at the beginning, middle or end of the selection.
144
+ */
145
+ variant: {
146
+ type: String,
147
+ default: p.SINGLE,
148
+ validator: (e) => Object.values(p).includes(e)
149
+ }
150
+ },
151
+ emits: [Q.CLICK, Q.MOUSE_OVER],
152
+ setup(e, { emit: t }) {
153
+ const n = I(() => {
154
+ const r = /* @__PURE__ */ new Date();
155
+ return e.day.getDate() === r.getDate() && e.day.getMonth() === r.getMonth() && e.day.getFullYear() === r.getFullYear();
156
+ });
157
+ return {
158
+ // Values
159
+ conditionalClasses: I(() => ({
160
+ // Variants
161
+ [`b-calendar-month-day--${U.BEGINNING}`]: e.variant === p.BEGINNING,
162
+ [`b-calendar-month-day--${U.MIDDLE}`]: e.variant === p.MIDDLE,
163
+ [`b-calendar-month-day--${U.END}`]: e.variant === p.END,
164
+ [`b-calendar-month-day--${U.SINGLE}`]: e.variant === p.SINGLE,
165
+ // Selected
166
+ [`b-calendar-month-day--${U.UNSELECTED}`]: !e.selected,
167
+ [`b-calendar-month-day--${U.SELECTED}`]: e.selected,
168
+ // Current Day
169
+ [`b-calendar-month-day--${U.CURRENT_DAY}`]: n.value,
170
+ // Disabled
171
+ [`b-calendar-month-day--${U.DISABLED}`]: e.disabled
172
+ })),
173
+ // Enums
174
+ BentoDateFormat: be,
175
+ CalendarMonthDayEvent: Q,
176
+ // Events
177
+ onClick: (r, l) => {
178
+ e.disabled ? (r.preventDefault(), r.stopPropagation()) : t(Q.CLICK, l, e.day);
179
+ }
180
+ };
181
+ }
182
+ });
183
+ var Ge = function() {
184
+ var t = this, n = t._self._c;
185
+ return t._self._setupProxy, n("td", { staticClass: "b-calendar-month-day", class: t.conditionalClasses, attrs: { tabindex: t.selected ? "0" : "-1", "aria-selected": t.selected ? t.selected : void 0 }, on: { click: (a) => t.onClick(a, t.day), mouseover: function(a) {
186
+ return t.$emit(t.CalendarMonthDayEvent.MOUSE_OVER);
187
+ }, keydown: function(a) {
188
+ return !a.type.indexOf("key") && t._k(a.keyCode, "space", 32, a.key, [" ", "Spacebar"]) && t._k(a.keyCode, "enter", 13, a.key, "Enter") ? null : ((s) => t.onClick(s, t.day)).apply(null, arguments);
189
+ } } }, [n("div", { staticClass: "b-calendar-month-day__wrapper" }, [n("bento-date", { staticClass: "b-calendar-month-day__label", attrs: { date: t.day, format: t.BentoDateFormat.DAY_OF_MONTH } })], 1)]);
190
+ }, Be = [], He = /* @__PURE__ */ ce(
191
+ je,
192
+ Ge,
193
+ Be,
194
+ !1,
195
+ null,
196
+ "404de012",
197
+ null,
198
+ null
199
+ );
200
+ const Ve = He.exports;
201
+ var A = /* @__PURE__ */ ((e) => (e.INPUT = "input", e.MOUSE_OVER = "mouseover", e.NEXT_MONTH = "nextMonth", e.PREVIOUS_MONTH = "previousMonth", e))(A || {}), x = /* @__PURE__ */ ((e) => (e.FIRST = "first", e.LAST = "last", e.MIDDLE = "middle", e.UNIQUE = "unique", e))(x || {}), K = /* @__PURE__ */ ((e) => (e[e.MONDAY = 1] = "MONDAY", e[e.SATURDAY = 6] = "SATURDAY", e[e.SUNDAY = 0] = "SUNDAY", e))(K || {});
202
+ function qe(e) {
203
+ return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
204
+ }
205
+ var ae = {}, Qe = {
206
+ get exports() {
207
+ return ae;
208
+ },
209
+ set exports(e) {
210
+ ae = e;
211
+ }
212
+ }, z = {}, Ke = {
213
+ get exports() {
214
+ return z;
215
+ },
216
+ set exports(e) {
217
+ z = e;
218
+ }
219
+ };
220
+ (function(e, t) {
221
+ Object.defineProperty(t, "__esModule", {
222
+ value: !0
223
+ }), t.default = n;
224
+ function n(a) {
225
+ if (a === null || a === !0 || a === !1)
226
+ return NaN;
227
+ var s = Number(a);
228
+ return isNaN(s) ? s : s < 0 ? Math.ceil(s) : Math.floor(s);
229
+ }
230
+ e.exports = t.default;
231
+ })(Ke, z);
232
+ var ne = {}, Xe = {
233
+ get exports() {
234
+ return ne;
235
+ },
236
+ set exports(e) {
237
+ ne = e;
238
+ }
239
+ }, re = {}, ze = {
240
+ get exports() {
241
+ return re;
242
+ },
243
+ set exports(e) {
244
+ re = e;
245
+ }
246
+ }, B = {}, Je = {
247
+ get exports() {
248
+ return B;
249
+ },
250
+ set exports(e) {
251
+ B = e;
252
+ }
253
+ };
254
+ (function(e, t) {
255
+ Object.defineProperty(t, "__esModule", {
256
+ value: !0
257
+ }), t.default = n;
258
+ function n(a, s) {
259
+ if (s.length < a)
260
+ throw new TypeError(a + " argument" + (a > 1 ? "s" : "") + " required, but only " + s.length + " present");
261
+ }
262
+ e.exports = t.default;
263
+ })(Je, B);
264
+ (function(e, t) {
265
+ Object.defineProperty(t, "__esModule", {
266
+ value: !0
267
+ }), t.default = s;
268
+ var n = a(B);
269
+ function a(r) {
270
+ return r && r.__esModule ? r : { default: r };
271
+ }
272
+ function s(r) {
273
+ (0, n.default)(1, arguments);
274
+ var l = Object.prototype.toString.call(r);
275
+ return r instanceof Date || typeof r == "object" && l === "[object Date]" ? new Date(r.getTime()) : typeof r == "number" || l === "[object Number]" ? new Date(r) : ((typeof r == "string" || l === "[object String]") && typeof console < "u" && (console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://git.io/fjule"), console.warn(new Error().stack)), /* @__PURE__ */ new Date(NaN));
276
+ }
277
+ e.exports = t.default;
278
+ })(ze, re);
279
+ (function(e, t) {
280
+ Object.defineProperty(t, "__esModule", {
281
+ value: !0
282
+ }), t.default = l;
283
+ var n = r(z), a = r(re), s = r(B);
284
+ function r(u) {
285
+ return u && u.__esModule ? u : { default: u };
286
+ }
287
+ function l(u, h) {
288
+ (0, s.default)(2, arguments);
289
+ var c = (0, a.default)(u), D = (0, n.default)(h);
290
+ return isNaN(D) ? /* @__PURE__ */ new Date(NaN) : (D && c.setDate(c.getDate() + D), c);
291
+ }
292
+ e.exports = t.default;
293
+ })(Xe, ne);
294
+ (function(e, t) {
295
+ Object.defineProperty(t, "__esModule", {
296
+ value: !0
297
+ }), t.default = l;
298
+ var n = r(z), a = r(ne), s = r(B);
299
+ function r(u) {
300
+ return u && u.__esModule ? u : { default: u };
301
+ }
302
+ function l(u, h) {
303
+ (0, s.default)(2, arguments);
304
+ var c = (0, n.default)(h);
305
+ return (0, a.default)(u, -c);
306
+ }
307
+ e.exports = t.default;
308
+ })(Qe, ae);
309
+ const _e = /* @__PURE__ */ qe(ae), Ze = ({ currentSelectedDate: e, month: t, isDateDisabled: n, firstDayOfWeek: a }, s) => {
310
+ const r = $(new Date(t.value));
311
+ j(
312
+ t,
313
+ () => {
314
+ r.value = t.value;
315
+ },
316
+ { immediate: !0 }
317
+ );
318
+ const l = $(new Date(e.value));
319
+ j(e, () => {
320
+ l.value = e.value;
321
+ });
322
+ const u = $({}), h = (o) => (f) => {
323
+ u.value[o.toDateString()] = f;
324
+ }, c = () => {
325
+ u.value = {};
326
+ }, D = (o = 1) => {
327
+ r.value = W(r.value, o), s(A.NEXT_MONTH, o), c();
328
+ }, d = (o = 1) => {
329
+ r.value = X(r.value, o), s(A.PREVIOUS_MONTH, o), c();
330
+ }, i = (o) => {
331
+ const f = !!u.value[o == null ? void 0 : o.toDateString()];
332
+ o && f && u.value[o.toDateString()].$el.focus();
333
+ }, k = (o) => {
334
+ o.preventDefault(), o.stopImmediatePropagation(), o.stopPropagation();
335
+ }, N = ({ nextDate: o, isIncreasingDays: f, amountOfMonths: R, isCalendarButtonsNav: J }) => {
336
+ if (!J && n && n(o))
337
+ return;
338
+ o.getMonth() === l.value.getMonth() && o.getFullYear() === l.value.getFullYear() ? (l.value = o, i(o)) : (f ? D(R) : d(R), Ne(() => {
339
+ const se = o.getMonth() === r.value.getMonth() && o.getFullYear() === r.value.getFullYear();
340
+ n && n(o) || !se || J || (l.value = o, i(o));
341
+ }));
342
+ };
343
+ return {
344
+ // Calendar days ref
345
+ calendarRef: u,
346
+ addDayRef: h,
347
+ /**
348
+ * Month navigation
349
+ */
350
+ showNextMonth: D,
351
+ showPreviousMonth: d,
352
+ /**
353
+ * Focus method
354
+ */
355
+ focusOnDate: i,
356
+ /**
357
+ * Day navigation
358
+ */
359
+ // ArrowRight
360
+ moveToNextDay: (o) => {
361
+ k(o);
362
+ const f = 1;
363
+ N({ nextDate: G(l.value, f), isIncreasingDays: !0 });
364
+ },
365
+ // ArrowLeft
366
+ moveToPreviousDay: (o) => {
367
+ k(o);
368
+ const f = 1;
369
+ N({ nextDate: _e(l.value, f), isIncreasingDays: !1 });
370
+ },
371
+ // ArrowUp
372
+ moveToPreviousWeek: (o) => {
373
+ k(o);
374
+ const f = 7;
375
+ N({ nextDate: _e(l.value, f), isIncreasingDays: !1 });
376
+ },
377
+ // ArrowDown
378
+ moveToNextWeek: (o) => {
379
+ k(o);
380
+ const f = 7;
381
+ N({ nextDate: G(l.value, f), isIncreasingDays: !0 });
382
+ },
383
+ // Home
384
+ moveToFirstDayOfWeek: (o) => {
385
+ k(o), N({
386
+ nextDate: ee(l.value, { weekStartsOn: a }),
387
+ isIncreasingDays: !1
388
+ });
389
+ },
390
+ // End
391
+ moveToLastDayOfWeek: (o) => {
392
+ k(o), N({
393
+ nextDate: ue(l.value, { weekStartsOn: a }),
394
+ isIncreasingDays: !0
395
+ });
396
+ },
397
+ // PageUp
398
+ moveToPreviousMonth: (o, f = !1) => {
399
+ k(o);
400
+ const R = 1;
401
+ N({
402
+ nextDate: X(l.value, R),
403
+ isIncreasingDays: !1,
404
+ amountOfMonths: R,
405
+ isCalendarButtonsNav: f
406
+ });
407
+ },
408
+ // Shift+PageUp
409
+ moveToPreviousYear: (o) => {
410
+ k(o);
411
+ const f = 12;
412
+ N({
413
+ nextDate: X(l.value, f),
414
+ isIncreasingDays: !1,
415
+ amountOfMonths: f
416
+ });
417
+ },
418
+ // PageDown
419
+ moveToNextMonth: (o, f = !1) => {
420
+ k(o);
421
+ const R = 1;
422
+ N({
423
+ nextDate: W(l.value, R),
424
+ isIncreasingDays: !0,
425
+ amountOfMonths: R,
426
+ isCalendarButtonsNav: f
427
+ });
428
+ },
429
+ // Shift-PageDown
430
+ moveToNextYear: (o) => {
431
+ k(o);
432
+ const f = 12;
433
+ N({
434
+ nextDate: W(l.value, f),
435
+ isIncreasingDays: !0,
436
+ amountOfMonths: f
437
+ });
438
+ },
439
+ // Values
440
+ internalDate: l,
441
+ baseDate: r
442
+ };
443
+ }, et = {
444
+ "en-US": {
445
+ nextMonth: "Next month",
446
+ previousMonth: "Previous month"
447
+ }
448
+ }, tt = le({
449
+ i18n: { messages: et },
450
+ name: "calendar-month",
451
+ components: {
452
+ BentoButton: Me,
453
+ BentoTypography: Oe,
454
+ CalendarMonthDay: Ve,
455
+ ChevronLeftIcon: xe,
456
+ ChevronRightIcon: Re
457
+ },
458
+ directives: { BentoKeyboardNavigationDirective: Pe },
459
+ props: {
460
+ /**
461
+ * end of the selected range
462
+ */
463
+ endDate: { type: Date, default: null },
464
+ /**
465
+ * Allows you to set the first day of the week. 0 is sunday, 1 is monday, 6 is saturday
466
+ */
467
+ firstDayOfWeek: {
468
+ type: Number,
469
+ default: K.MONDAY,
470
+ validator: (e) => Object.values(K).includes(e)
471
+ },
472
+ /**
473
+ * Indicate if a date should be disabled or not
474
+ */
475
+ isDateDisabled: { type: Function, default: void 0 },
476
+ /**
477
+ * Indicates if the calendar is part of a range date picker or a sigle date picker
478
+ */
479
+ isRange: { type: Boolean, default: !1 },
480
+ /**
481
+ * Sets a minimum limit for selectable dates - dates before `min` will not be selectable
482
+ */
483
+ min: { type: Date, default: null },
484
+ /**
485
+ * Sets a maximum limit for selectable dates - dates after `max` will not be selectable
486
+ */
487
+ max: { type: Date, default: null },
488
+ /**
489
+ * Month of the year to be displayed in the calendar
490
+ */
491
+ month: { type: Date, required: !0 },
492
+ /**
493
+ * When rendering multiple calendars, this property allows to render the
494
+ * Next and Previous calendar buttons to the right, left or not at all
495
+ * depending on the position: Unique (only 1), First, Middle or Last
496
+ */
497
+ position: {
498
+ type: String,
499
+ default: x.UNIQUE,
500
+ validator: (e) => Object.values(x).includes(e)
501
+ },
502
+ /**
503
+ * start of the selected range
504
+ */
505
+ startDate: { type: Date, default: null }
506
+ // can be undefined, eslint complains without default
507
+ },
508
+ emits: [
509
+ A.INPUT,
510
+ A.NEXT_MONTH,
511
+ A.PREVIOUS_MONTH,
512
+ A.MOUSE_OVER
513
+ ],
514
+ setup(e, { emit: t }) {
515
+ const { locale: n } = Ie(), a = { de: Ee, enUS: oe, fr: Se }, s = pe("bento-date-picker-month-label"), r = I(
516
+ () => (g) => {
517
+ var P;
518
+ return e.min && g < e.min || e.max && g > e.max || ((P = e.isDateDisabled) == null ? void 0 : P.call(e, g));
519
+ }
520
+ ), {
521
+ internalDate: l,
522
+ baseDate: u,
523
+ // Calendar refs
524
+ addDayRef: h,
525
+ // Month navigation
526
+ showNextMonth: c,
527
+ showPreviousMonth: D,
528
+ // Day navigation
529
+ moveToNextDay: d,
530
+ moveToPreviousDay: i,
531
+ moveToPreviousWeek: k,
532
+ moveToNextWeek: N,
533
+ moveToFirstDayOfWeek: m,
534
+ moveToLastDayOfWeek: w,
535
+ moveToPreviousMonth: T,
536
+ moveToPreviousYear: H,
537
+ moveToNextMonth: V,
538
+ moveToNextYear: v,
539
+ focusOnDate: y
540
+ } = Ze(
541
+ {
542
+ currentSelectedDate: F(e, "startDate"),
543
+ month: F(e, "month"),
544
+ isDateDisabled: r.value,
545
+ firstDayOfWeek: e.firstDayOfWeek
546
+ },
547
+ t
548
+ ), b = I(
549
+ () => Object.values(K).includes(e.firstDayOfWeek) ? e.firstDayOfWeek : K.MONDAY
550
+ ), _ = I(
551
+ () => [x.FIRST, x.UNIQUE].includes(e.position)
552
+ ), L = I(
553
+ () => [x.LAST, x.UNIQUE].includes(e.position)
554
+ ), o = I(
555
+ () => ve(u.value, "MMMM yyyy", {
556
+ locale: a[n.value.substring(0, 2)] || oe
557
+ })
558
+ ), f = I(
559
+ () => new Array(7).fill(/* @__PURE__ */ new Date()).map((g, P) => {
560
+ const q = Fe(g, b.value + P);
561
+ return ve(q, "EEE", {
562
+ locale: a[n.value.substring(0, 2)] || oe
563
+ });
564
+ })
565
+ ), R = I(() => {
566
+ const g = [], P = te(e.month);
567
+ let q = g[g.push([]) - 1];
568
+ for (; P.getMonth() === e.month.getMonth(); )
569
+ P.getDay() - b.value === 0 && q.length > 0 && (q = g[g.push([]) - 1]), q.push(C(P)), P.setDate(P.getDate() + 1);
570
+ return g;
571
+ }), J = (g) => {
572
+ t(A.INPUT, g);
573
+ }, de = (g) => {
574
+ if (!e.isRange || Z(e.startDate, e.endDate))
575
+ return p.SINGLE;
576
+ if (e.startDate && Z(e.startDate, g))
577
+ return p.BEGINNING;
578
+ if (e.endDate && Z(e.endDate, g))
579
+ return p.END;
580
+ if (e.startDate && e.endDate && ye(g, { start: e.startDate, end: e.endDate }))
581
+ return p.MIDDLE;
582
+ }, se = (g) => l.value && Z(l.value, g) ? !0 : e.startDate && e.endDate && ye(g, { start: e.startDate, end: e.endDate }), ge = () => {
583
+ t(A.INPUT, l);
584
+ }, ke = e.isRange ? {} : {
585
+ "keydown:arrow-right": d,
586
+ "keydown:arrow-left": i,
587
+ "keydown:arrow-up": k,
588
+ "keydown:arrow-down": N,
589
+ "keydown:home": m,
590
+ "keydown:end": w,
591
+ "keydown:page-up": T,
592
+ "keydown:shift-page-up": H,
593
+ "keydown:page-down": V,
594
+ "keydown:shift-page-down": v
595
+ };
596
+ return {
597
+ // Refs
598
+ addDayRef: h,
599
+ // Values
600
+ computedIsDateDisabled: r,
601
+ daysOfWeek: f,
602
+ weeksOfMonth: R,
603
+ formattedMonthDate: o,
604
+ shouldShowNextMonthButton: L,
605
+ shouldShowPreviousMonthButton: _,
606
+ monthLabelId: s,
607
+ // Enums
608
+ CalendarMonthEvent: A,
609
+ // Functions
610
+ isSelectedDate: se,
611
+ showNextMonth: c,
612
+ showPreviousMonth: D,
613
+ dayVariant: de,
614
+ confirmNavigationDate: ge,
615
+ // Events
616
+ onDayClicked: J,
617
+ listeners: ke,
618
+ // Exposed methods
619
+ focusOnDate: y,
620
+ moveToNextDay: d,
621
+ moveToPreviousDay: i,
622
+ moveToPreviousWeek: k,
623
+ moveToNextWeek: N,
624
+ moveToFirstDayOfWeek: m,
625
+ moveToLastDayOfWeek: w,
626
+ moveToPreviousMonth: T,
627
+ moveToPreviousYear: H,
628
+ moveToNextMonth: V,
629
+ moveToNextYear: v
630
+ };
631
+ }
632
+ });
633
+ var at = function() {
634
+ var t = this, n = t._self._c;
635
+ return t._self._setupProxy, n("div", t._g({ directives: [{ name: "bento-keyboard-navigation-directive", rawName: "v-bento-keyboard-navigation-directive" }], staticClass: "b-calendar-month" }, t.listeners), [n("div", { staticClass: "b-calendar-month__month-selector" }, [n("div", { staticClass: "b-calendar-month__previous" }, [t.shouldShowPreviousMonthButton ? n("bento-button", { attrs: { variant: "tertiary" }, on: { click: function(a) {
636
+ return t.moveToPreviousMonth(a, !0);
637
+ } }, scopedSlots: t._u([{ key: "iconLeft", fn: function() {
638
+ return [n("chevron-left-icon", { attrs: { "svg-title": t.$t("previousMonth") } })];
639
+ }, proxy: !0 }], null, !1, 351640624) }) : t._e()], 1), n("bento-typography", { attrs: { id: t.monthLabelId, el: "h2", variant: "title", "aria-live": "polite" } }, [t._v(" " + t._s(t.formattedMonthDate) + " ")]), n("div", { staticClass: "b-calendar-month__next" }, [t.shouldShowNextMonthButton ? n("bento-button", { attrs: { variant: "tertiary" }, on: { click: function(a) {
640
+ return t.moveToNextMonth(a, !0);
641
+ } }, scopedSlots: t._u([{ key: "iconLeft", fn: function() {
642
+ return [n("chevron-right-icon", { attrs: { "svg-title": t.$t("nextMonth") } })];
643
+ }, proxy: !0 }], null, !1, 1260976669) }) : t._e()], 1)], 1), n("table", { staticClass: "b-calendar-month__month-container", attrs: { role: "grid", "aria-labelledby": t.monthLabelId } }, [n("thead", [n("tr", { staticClass: "b-calendar-month__week-header" }, t._l(t.daysOfWeek, function(a, s) {
644
+ return n("th", { key: s, staticClass: "b-calendar-month__day-of-week" }, [n("bento-typography", { staticClass: "b-calendar-month__day-of-week-font", attrs: { el: "span", variant: "caption" } }, [t._v(" " + t._s(a) + " ")])], 1);
645
+ }), 0)]), n("tbody", t._l(t.weeksOfMonth, function(a, s) {
646
+ return n("tr", { key: s }, [s === 0 && a.length < 7 ? n("td", { attrs: { colspan: 7 - a.length } }) : t._e(), t._l(a, function(r, l) {
647
+ return n("calendar-month-day", { key: `calendar-day-${l}`, ref: t.addDayRef(r), refInFor: !0, attrs: { day: r, disabled: t.computedIsDateDisabled(r), selected: t.isSelectedDate(r), variant: t.dayVariant(r) }, on: { click: t.onDayClicked, mouseover: function(u) {
648
+ return t.$emit(t.CalendarMonthEvent.MOUSE_OVER, r);
649
+ } } });
650
+ })], 2);
651
+ }), 0)])]);
652
+ }, nt = [], rt = /* @__PURE__ */ ce(
653
+ tt,
654
+ at,
655
+ nt,
656
+ !1,
657
+ null,
658
+ "be42e964",
659
+ null,
660
+ null
661
+ );
662
+ const Y = rt.exports;
663
+ var M = /* @__PURE__ */ ((e) => (e.INPUT = "input", e.START_DATE_SELECTED = "start-date-selected", e.END_DATE_SELECTED = "end-date-selected", e))(M || {});
664
+ const st = ({ selectedDate: e }, t) => {
665
+ const n = ie({
666
+ startDate: null,
667
+ endDate: null
668
+ });
669
+ return j(
670
+ () => e.value,
671
+ () => {
672
+ n.startDate = e.value, n.endDate = void 0;
673
+ },
674
+ { immediate: !0 }
675
+ ), {
676
+ internalValue: n,
677
+ onDateInput: (s) => {
678
+ t(M.INPUT, s);
679
+ },
680
+ // Empty function to prevent the listeners from throwing a warning
681
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
682
+ onMouseOver: () => {
683
+ }
684
+ };
685
+ }, ot = (e, t, n) => {
686
+ const a = (c, D) => {
687
+ let d = ee(c, { weekStartsOn: e }), i = ue(D || c, { weekStartsOn: e });
688
+ return t && d < t && (d = ee(he(t, 1), { weekStartsOn: e })), n && i > n && (i = ue($e(n, 1), { weekStartsOn: e })), d > i && (d = ee(i)), { startDate: d, endDate: i };
689
+ }, s = (c, D) => {
690
+ let d = te(c), i = De(D || c);
691
+ return t && d < t && (d = te(W(t, 1))), n && i > n && (i = De(X(n, 1))), d > i && (d = te(i)), { startDate: d, endDate: i };
692
+ };
693
+ return {
694
+ adjustDateForWeekly: a,
695
+ adjustDateForMonthly: s,
696
+ adjustStartDateInputForWeekly: (c, D) => {
697
+ const { startDate: d } = a(new Date(c));
698
+ return D(d);
699
+ },
700
+ adjustEndDateInputForWeekly: (c, D) => {
701
+ const { endDate: d } = a(new Date(c));
702
+ return D(d);
703
+ },
704
+ adjustStartDateInputForMonthly: (c, D) => {
705
+ const { startDate: d } = s(new Date(c));
706
+ return D(d);
707
+ },
708
+ adjustEndDateInputForMonthly: (c, D) => {
709
+ const { endDate: d } = s(new Date(c));
710
+ return D(d);
711
+ }
712
+ };
713
+ }, ut = () => {
714
+ const e = ie({
715
+ daily: null,
716
+ weekly: null,
717
+ monthly: null
718
+ });
719
+ return {
720
+ savedRanges: e,
721
+ saveRange: (a, s) => {
722
+ e[a] = s;
723
+ },
724
+ resetSavedRange: (a) => {
725
+ e[a] = null;
726
+ }
727
+ };
728
+ }, lt = ({ selectedDate: e, isDateDisabled: t, maxRange: n, granularity: a, firstDayOfWeek: s, min: r, max: l }, u) => {
729
+ const { adjustDateForWeekly: D, adjustDateForMonthly: d } = ot(s, r, l), { savedRanges: i, saveRange: k, resetSavedRange: N } = ut(), m = ie({
730
+ startDate: null,
731
+ endDate: null
732
+ }), w = $(null);
733
+ j(
734
+ () => e.value,
735
+ () => {
736
+ let { startDate: v = null, endDate: y = null } = e.value || {};
737
+ v && (v = C(v)), y && (y = C(y)), !(v && t && t(v) || y && t && t(y) || v && y && Ce(v, y)) && (m.startDate = v, m.endDate = y);
738
+ },
739
+ { immediate: !0 }
740
+ );
741
+ const T = (v, y, b) => {
742
+ if (m.startDate = v, m.endDate = y, n.value) {
743
+ const _ = Ue(y, v) - n.value;
744
+ _ > 0 && (b < 1 ? (m.startDate = v, m.endDate = We(y, _)) : (m.startDate = G(v, _), m.endDate = y));
745
+ }
746
+ u(M.START_DATE_SELECTED, m.startDate), u(M.END_DATE_SELECTED, m.endDate);
747
+ }, H = (v) => {
748
+ var y, b;
749
+ if (w.value)
750
+ w.value = null, u(M.INPUT, m), a.value && N(a.value.type);
751
+ else {
752
+ let _ = v;
753
+ if (((y = a == null ? void 0 : a.value) == null ? void 0 : y.type) === "weekly") {
754
+ const { startDate: L, endDate: o } = D(v);
755
+ _ = L, T(_, o);
756
+ }
757
+ if (((b = a == null ? void 0 : a.value) == null ? void 0 : b.type) === "monthly") {
758
+ const { startDate: L, endDate: o } = d(v);
759
+ _ = L, T(_, o);
760
+ }
761
+ w.value = _, u(M.START_DATE_SELECTED, _), u(M.END_DATE_SELECTED, _);
762
+ }
763
+ }, V = (v) => {
764
+ var y, b, _, L;
765
+ if (!(!w.value || t && t(v)))
766
+ if (Ye(v, w.value)) {
767
+ if (((y = a == null ? void 0 : a.value) == null ? void 0 : y.type) === "weekly") {
768
+ const { startDate: o, endDate: f } = D(v, w.value);
769
+ T(o, f, -1);
770
+ return;
771
+ }
772
+ if (((b = a == null ? void 0 : a.value) == null ? void 0 : b.type) === "monthly") {
773
+ const { startDate: o, endDate: f } = d(v, w.value);
774
+ T(o, f, -1);
775
+ return;
776
+ }
777
+ T(v, w.value, -1);
778
+ } else {
779
+ if (((_ = a == null ? void 0 : a.value) == null ? void 0 : _.type) === "weekly") {
780
+ const { startDate: o, endDate: f } = D(w.value, v);
781
+ T(o, f, 1);
782
+ return;
783
+ }
784
+ if (((L = a == null ? void 0 : a.value) == null ? void 0 : L.type) === "monthly") {
785
+ const { startDate: o, endDate: f } = d(w.value, v);
786
+ T(o, f, 1);
787
+ return;
788
+ }
789
+ T(w.value, v, 1);
790
+ }
791
+ };
792
+ return j(a, (v, y) => {
793
+ switch (k(y.type, structuredClone(Te(m))), v.type) {
794
+ case "monthly": {
795
+ if (i.monthly) {
796
+ T(i.monthly.startDate, i.monthly.endDate), u(M.INPUT, m);
797
+ return;
798
+ }
799
+ const { startDate: b, endDate: _ } = d(m.startDate, m.endDate);
800
+ T(b, _), u(M.INPUT, m);
801
+ break;
802
+ }
803
+ case "weekly": {
804
+ if (i.weekly) {
805
+ T(i.weekly.startDate, i.weekly.endDate), u(M.INPUT, m);
806
+ return;
807
+ }
808
+ const { startDate: b, endDate: _ } = D(m.startDate, m.endDate);
809
+ T(b, _), u(M.INPUT, m);
810
+ break;
811
+ }
812
+ case "daily":
813
+ default:
814
+ i.daily && T(i.daily.startDate, i.daily.endDate), u(M.INPUT, m);
815
+ break;
816
+ }
817
+ }), {
818
+ internalValue: m,
819
+ onDateInput: H,
820
+ onMouseOver: V
821
+ };
822
+ }, it = le({
823
+ name: "calendar",
824
+ components: { CalendarMonth: Y },
825
+ props: {
826
+ /**
827
+ * Allows you to set the first day of the week. 0 is sunday, 1 is monday, 6 is saturday
828
+ */
829
+ firstDayOfWeek: Y.props.firstDayOfWeek,
830
+ /**
831
+ * The selected granularity configuration
832
+ */
833
+ granularity: {
834
+ type: Object,
835
+ default: null
836
+ },
837
+ /**
838
+ * Indicate if a date should be disabled or not
839
+ */
840
+ isDateDisabled: Y.props.isDateDisabled,
841
+ /**
842
+ * Enables the Date Range calendar
843
+ */
844
+ isRange: Y.props.isRange,
845
+ /**
846
+ * Set a maximum number of dates to be selectable by the range.
847
+ */
848
+ maxRange: { type: Number, default: null, validator: (e) => !e || e > 0 },
849
+ /**
850
+ * Sets a minimum limit for selectable dates - dates before `min` will not be selectable
851
+ */
852
+ min: Y.props.min,
853
+ /**
854
+ * Sets a maximum limit for selectable dates - dates after `max` will not be selectable
855
+ */
856
+ max: Y.props.max,
857
+ /**
858
+ * Number of months rendered on pane
859
+ */
860
+ numberOfMonths: {
861
+ type: Number,
862
+ default: 3,
863
+ validator: (e) => e >= 1
864
+ },
865
+ /**
866
+ * Selected date. Can be a single Date or a CalendarRangeDate
867
+ * instance that contains startDate and endDate attributes.
868
+ */
869
+ value: { type: [Date, Object], default: void 0 }
870
+ },
871
+ emit: [M.INPUT, M.START_DATE_SELECTED, M.END_DATE_SELECTED],
872
+ setup(e, { emit: t }) {
873
+ const n = $(null), a = $();
874
+ j(
875
+ () => e.value,
876
+ () => {
877
+ var i;
878
+ e.isRange ? a.value = ((i = e.value) == null ? void 0 : i.startDate) || /* @__PURE__ */ new Date() : a.value = e.value || /* @__PURE__ */ new Date();
879
+ },
880
+ { immediate: !0 }
881
+ );
882
+ const s = I(() => ({
883
+ "b-calendar__range": e.isRange
884
+ })), {
885
+ internalValue: r,
886
+ onDateInput: l,
887
+ onMouseOver: u
888
+ } = e.isRange ? lt(
889
+ {
890
+ selectedDate: F(e, "value"),
891
+ isDateDisabled: e.isDateDisabled,
892
+ maxRange: F(e, "maxRange"),
893
+ granularity: F(e, "granularity"),
894
+ firstDayOfWeek: e.firstDayOfWeek,
895
+ min: e.min,
896
+ max: e.max
897
+ },
898
+ t
899
+ ) : st(
900
+ {
901
+ selectedDate: F(e, "value"),
902
+ firstDayOfWeek: e.firstDayOfWeek
903
+ },
904
+ t
905
+ ), h = (i) => e.numberOfMonths === 1 ? x.UNIQUE : i === 0 ? x.FIRST : i === e.numberOfMonths - 1 ? x.LAST : x.MIDDLE, c = I(
906
+ () => (i) => W(a.value, i)
907
+ );
908
+ return {
909
+ // Refs
910
+ calendarRef: n,
911
+ // Values
912
+ baseDate: a,
913
+ conditionalClasses: s,
914
+ internalValue: r,
915
+ // Methods
916
+ calculateOffsetMonth: c,
917
+ calendarPosition: h,
918
+ // Events
919
+ onDateInput: l,
920
+ onMouseOver: u,
921
+ calculateNextMonths: (i = 1) => {
922
+ a.value = W(a.value, i);
923
+ },
924
+ calculatePreviousMonths: (i = 1) => {
925
+ a.value = X(a.value, i);
926
+ }
927
+ };
928
+ }
929
+ });
930
+ var ct = function() {
931
+ var t = this, n = t._self._c;
932
+ return t._self._setupProxy, n("div", { staticClass: "b-calendar", class: t.conditionalClasses }, t._l(t.numberOfMonths, function(a, s) {
933
+ return n("calendar-month", { key: `calendar-${s}`, ref: t.numberOfMonths === 1 ? "calendarRef" : null, refInFor: !0, attrs: { "first-day-of-week": t.firstDayOfWeek, "is-date-disabled": t.isDateDisabled, month: t.calculateOffsetMonth(s), position: t.calendarPosition(s), min: t.min, max: t.max, "is-range": t.isRange, "start-date": t.internalValue.startDate, "end-date": t.internalValue.endDate, granularity: t.granularity }, on: { input: t.onDateInput, mouseover: t.onMouseOver, nextMonth: t.calculateNextMonths, previousMonth: t.calculatePreviousMonths } });
934
+ }), 1);
935
+ }, dt = [], ft = /* @__PURE__ */ ce(
936
+ it,
937
+ ct,
938
+ dt,
939
+ !1,
940
+ null,
941
+ "57c97924",
942
+ null,
943
+ null
944
+ );
945
+ const St = ft.exports;
946
+ export {
947
+ St as C,
948
+ M as a,
949
+ K as b,
950
+ ee as c,
951
+ We as d,
952
+ ue as e,
953
+ te as f,
954
+ W as g,
955
+ Z as i,
956
+ C as s,
957
+ ot as u
958
+ };
959
+ //# sourceMappingURL=calendar.47e9e755.js.map