@adyen/bento-vue2 1.96.1 → 1.97.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 (178) hide show
  1. package/dist/@types/index.d.ts +162 -127
  2. package/dist/action-bar.js +1 -1
  3. package/dist/ai-tag.js +1 -1
  4. package/dist/alert.js +1 -1
  5. package/dist/assets/accordion-item.css +1 -1
  6. package/dist/assets/action-bar.css +1 -1
  7. package/dist/assets/alert.css +1 -1
  8. package/dist/assets/base-modal.css +1 -1
  9. package/dist/assets/button-actions.css +1 -1
  10. package/dist/assets/calendar.css +1 -1
  11. package/dist/assets/card.css +1 -1
  12. package/dist/assets/country.css +1 -1
  13. package/dist/assets/data-grid.css +1 -1
  14. package/dist/assets/date-picker.css +1 -1
  15. package/dist/assets/date-range-picker.css +1 -1
  16. package/dist/assets/date-time-picker.css +1 -1
  17. package/dist/assets/dialog-page.css +1 -1
  18. package/dist/assets/dropdown.css +1 -1
  19. package/dist/assets/file-uploader.css +1 -1
  20. package/dist/assets/filter-bar.css +1 -1
  21. package/dist/assets/inspector.css +1 -1
  22. package/dist/assets/modal-fullscreen.css +1 -1
  23. package/dist/assets/navigation-menu-group.css +1 -1
  24. package/dist/assets/secondary-nav.css +1 -1
  25. package/dist/assets/sidepanel.css +1 -1
  26. package/dist/assets/summary-grid.css +1 -1
  27. package/dist/assets/textarea.css +1 -1
  28. package/dist/button.js +1 -1
  29. package/dist/card.js +1 -1
  30. package/dist/checkbox.js +2 -2
  31. package/dist/chunks/{action-bar.Chu-0oVy.js → action-bar.B890LCTe.js} +3 -3
  32. package/dist/chunks/{action-bar.Chu-0oVy.js.map → action-bar.B890LCTe.js.map} +1 -1
  33. package/dist/chunks/{ai-tag.DVmvni7U.js → ai-tag.C8RxACNj.js} +2 -2
  34. package/dist/chunks/{ai-tag.DVmvni7U.js.map → ai-tag.C8RxACNj.js.map} +1 -1
  35. package/dist/chunks/{alert.B4bHCE8V.js → alert.BDkEbdf4.js} +10 -10
  36. package/dist/chunks/{alert.B4bHCE8V.js.map → alert.BDkEbdf4.js.map} +1 -1
  37. package/dist/chunks/{base-modal.CC7gm9fc.js → base-modal.CDMoF3b_.js} +3 -3
  38. package/dist/chunks/{base-modal.CC7gm9fc.js.map → base-modal.CDMoF3b_.js.map} +1 -1
  39. package/dist/chunks/{button-actions-with-menu.BlOBDvdL.js → button-actions-with-menu.DqDQ_gVX.js} +2 -2
  40. package/dist/chunks/{button-actions-with-menu.BlOBDvdL.js.map → button-actions-with-menu.DqDQ_gVX.js.map} +1 -1
  41. package/dist/chunks/{button-actions.D1jRC1fs.js → button-actions.DKc63aCb.js} +122 -110
  42. package/dist/chunks/{button-actions.D1jRC1fs.js.map → button-actions.DKc63aCb.js.map} +1 -1
  43. package/dist/chunks/calendar.BckAv9N_.js +1235 -0
  44. package/dist/chunks/calendar.BckAv9N_.js.map +1 -0
  45. package/dist/chunks/{card.ErZLKN0q.js → card.ChBURa5R.js} +2 -2
  46. package/dist/chunks/{card.ErZLKN0q.js.map → card.ChBURa5R.js.map} +1 -1
  47. package/dist/chunks/{checkbox-group.CNTMMwQr.js → checkbox-group.BAjvgXlc.js} +2 -2
  48. package/dist/chunks/{checkbox-group.CNTMMwQr.js.map → checkbox-group.BAjvgXlc.js.map} +1 -1
  49. package/dist/chunks/{checkbox.BIzqX_eH.js → checkbox.BAQDBNL6.js} +18 -18
  50. package/dist/chunks/{checkbox.BIzqX_eH.js.map → checkbox.BAQDBNL6.js.map} +1 -1
  51. package/dist/chunks/{code-snippet.lcQRsLdZ.js → code-snippet.nUo9bjhC.js} +3 -3
  52. package/dist/chunks/{code-snippet.lcQRsLdZ.js.map → code-snippet.nUo9bjhC.js.map} +1 -1
  53. package/dist/chunks/{country.BEwW8TQo.js → country.nGZJwp_A.js} +2 -2
  54. package/dist/chunks/country.nGZJwp_A.js.map +1 -0
  55. package/dist/chunks/{dashboard-section.DiGQXS9L.js → dashboard-section.BDDVJpxY.js} +2 -2
  56. package/dist/chunks/{dashboard-section.DiGQXS9L.js.map → dashboard-section.BDDVJpxY.js.map} +1 -1
  57. package/dist/chunks/{dashed-underline.Cl07OQID.js → dashed-underline.CfEmbgOv.js} +2 -2
  58. package/dist/chunks/{dashed-underline.Cl07OQID.js.map → dashed-underline.CfEmbgOv.js.map} +1 -1
  59. package/dist/chunks/{data-grid-template.BVppx9kZ.js → data-grid-template.BUlLHTYe.js} +2 -2
  60. package/dist/chunks/{data-grid-template.BVppx9kZ.js.map → data-grid-template.BUlLHTYe.js.map} +1 -1
  61. package/dist/chunks/{data-grid.DQwAkw4U.js → data-grid.0OiCQjFc.js} +28 -29
  62. package/dist/chunks/{data-grid.DQwAkw4U.js.map → data-grid.0OiCQjFc.js.map} +1 -1
  63. package/dist/chunks/date-picker.CsFSskqf.js +245 -0
  64. package/dist/chunks/date-picker.CsFSskqf.js.map +1 -0
  65. package/dist/chunks/date-picker.types.Ckt7zxGy.js.map +1 -1
  66. package/dist/chunks/date-range-picker.Bczgdu5X.js +1250 -0
  67. package/dist/chunks/date-range-picker.Bczgdu5X.js.map +1 -0
  68. package/dist/chunks/date-range-picker.types.Ckt7zxGy.js.map +1 -1
  69. package/dist/chunks/date-time-picker.DT54TiG4.js +177 -0
  70. package/dist/chunks/date-time-picker.DT54TiG4.js.map +1 -0
  71. package/dist/chunks/{draggable-handle.DIhHtHG9.js → draggable-handle.DwJBaf5y.js} +2 -2
  72. package/dist/chunks/{draggable-handle.DIhHtHG9.js.map → draggable-handle.DwJBaf5y.js.map} +1 -1
  73. package/dist/chunks/{dropdown-tag.CuDxdSfb.js → dropdown-tag.BqSrkuwj.js} +2 -2
  74. package/dist/chunks/{dropdown-tag.CuDxdSfb.js.map → dropdown-tag.BqSrkuwj.js.map} +1 -1
  75. package/dist/chunks/dropdown.CIEm6MBB.js +2660 -0
  76. package/dist/chunks/dropdown.CIEm6MBB.js.map +1 -0
  77. package/dist/chunks/{file-uploader.CO2MeHwl.js → file-uploader.DOvQMUHC.js} +2 -2
  78. package/dist/chunks/{file-uploader.CO2MeHwl.js.map → file-uploader.DOvQMUHC.js.map} +1 -1
  79. package/dist/chunks/{filter-bar.DQ9fJXq1.js → filter-bar.DVRPM9tf.js} +318 -319
  80. package/dist/chunks/filter-bar.DVRPM9tf.js.map +1 -0
  81. package/dist/chunks/{footer-actions.CZE9dcmA.js → footer-actions.C1sXd7ti.js} +2 -2
  82. package/dist/chunks/{footer-actions.CZE9dcmA.js.map → footer-actions.C1sXd7ti.js.map} +1 -1
  83. package/dist/chunks/{form-layout-title.CXXdsiK5.js → form-layout-title.xrix5vY3.js} +2 -2
  84. package/dist/chunks/{form-layout-title.CXXdsiK5.js.map → form-layout-title.xrix5vY3.js.map} +1 -1
  85. package/dist/chunks/{header-meta.6rZdOgXD.js → header-meta.D1eb37QJ.js} +2 -2
  86. package/dist/chunks/{header-meta.6rZdOgXD.js.map → header-meta.D1eb37QJ.js.map} +1 -1
  87. package/dist/chunks/{header-with-views.4VNHbNk0.js → header-with-views.Bk6ly102.js} +8 -8
  88. package/dist/chunks/{header-with-views.4VNHbNk0.js.map → header-with-views.Bk6ly102.js.map} +1 -1
  89. package/dist/chunks/{header.BsroOD5b.js → header.CszOmM16.js} +3 -3
  90. package/dist/chunks/{header.BsroOD5b.js.map → header.CszOmM16.js.map} +1 -1
  91. package/dist/chunks/{input-field-password.CRqYWZGS.js → input-field-password.C4Wxsl16.js} +3 -3
  92. package/dist/chunks/{input-field-password.CRqYWZGS.js.map → input-field-password.C4Wxsl16.js.map} +1 -1
  93. package/dist/chunks/{input-field-phone-number.DHiuL0cF.js → input-field-phone-number.BhYTU628.js} +2 -2
  94. package/dist/chunks/{input-field-phone-number.DHiuL0cF.js.map → input-field-phone-number.BhYTU628.js.map} +1 -1
  95. package/dist/chunks/{input-field.BkQZ6Qzl.js → input-field.3tzX7t2y.js} +2 -2
  96. package/dist/chunks/{input-field.BkQZ6Qzl.js.map → input-field.3tzX7t2y.js.map} +1 -1
  97. package/dist/chunks/{input-time.BiOHvUEA.js → input-time.Bf-ZrCPX.js} +34 -34
  98. package/dist/chunks/{input-time.BiOHvUEA.js.map → input-time.Bf-ZrCPX.js.map} +1 -1
  99. package/dist/chunks/{modal-fullscreen.OS6KhVdg.js → modal-fullscreen.Dg1Hi3jB.js} +2 -2
  100. package/dist/chunks/{modal-fullscreen.OS6KhVdg.js.map → modal-fullscreen.Dg1Hi3jB.js.map} +1 -1
  101. package/dist/chunks/{modal.DHL3TGHv.js → modal.DZTEFM_E.js} +4 -4
  102. package/dist/chunks/{modal.DHL3TGHv.js.map → modal.DZTEFM_E.js.map} +1 -1
  103. package/dist/chunks/{pagination.DItyAwy1.js → pagination.C6HIPq58.js} +2 -2
  104. package/dist/chunks/{pagination.DItyAwy1.js.map → pagination.C6HIPq58.js.map} +1 -1
  105. package/dist/chunks/{rich-text-editor.D5URbwnM.js → rich-text-editor.-B96ibAd.js} +3 -3
  106. package/dist/chunks/{rich-text-editor.D5URbwnM.js.map → rich-text-editor.-B96ibAd.js.map} +1 -1
  107. package/dist/chunks/{search-bar.D-WK8eMQ.js → search-bar.DunTxVmZ.js} +5 -5
  108. package/dist/chunks/{search-bar.D-WK8eMQ.js.map → search-bar.DunTxVmZ.js.map} +1 -1
  109. package/dist/chunks/{secondary-nav.C7lEDaoj.js → secondary-nav.CGGPkYpc.js} +2 -2
  110. package/dist/chunks/{secondary-nav.C7lEDaoj.js.map → secondary-nav.CGGPkYpc.js.map} +1 -1
  111. package/dist/chunks/{selection-card-group.CiFW4AZR.js → selection-card-group.ZZ_qF1L1.js} +8 -8
  112. package/dist/chunks/{selection-card-group.CiFW4AZR.js.map → selection-card-group.ZZ_qF1L1.js.map} +1 -1
  113. package/dist/chunks/{sidepanel.B8zQp_MJ.js → sidepanel.ChuW63J7.js} +3 -3
  114. package/dist/chunks/{sidepanel.B8zQp_MJ.js.map → sidepanel.ChuW63J7.js.map} +1 -1
  115. package/dist/chunks/{summary-grid.types.CkqRXOKv.js → summary-grid.types.BnEhhDQz.js} +3 -3
  116. package/dist/chunks/summary-grid.types.BnEhhDQz.js.map +1 -0
  117. package/dist/chunks/{timeline-item.sdxvTjmS.js → timeline-item.DzMh520x.js} +3 -3
  118. package/dist/chunks/{timeline-item.sdxvTjmS.js.map → timeline-item.DzMh520x.js.map} +1 -1
  119. package/dist/chunks/{tutorial.Ba9dqb2j.js → tutorial.CkeL_7Je.js} +2 -2
  120. package/dist/chunks/{tutorial.Ba9dqb2j.js.map → tutorial.CkeL_7Je.js.map} +1 -1
  121. package/dist/chunks/use-bento-delayed-hover.D4rfUUOr.js.map +1 -1
  122. package/dist/chunks/{use-date-input-formatter.B5GQd3s2.js → use-date-input-formatter.Dq9C0nc9.js} +2 -2
  123. package/dist/chunks/{use-date-input-formatter.B5GQd3s2.js.map → use-date-input-formatter.Dq9C0nc9.js.map} +1 -1
  124. package/dist/code-snippet.js +1 -1
  125. package/dist/country.js +1 -1
  126. package/dist/dashboard-template.js +1 -1
  127. package/dist/dashed-underline.js +1 -1
  128. package/dist/data-grid-template.js +1 -1
  129. package/dist/data-grid.js +1 -1
  130. package/dist/date-picker.js +2 -2
  131. package/dist/date-range-picker.js +2 -2
  132. package/dist/date-time-picker.js +1 -1
  133. package/dist/draggable.js +1 -1
  134. package/dist/dropdown.js +10 -11
  135. package/dist/dropdown.js.map +1 -1
  136. package/dist/file-uploader.js +1 -1
  137. package/dist/filter-bar.js +1 -1
  138. package/dist/form-layout.js +1 -1
  139. package/dist/header-with-views.js +1 -1
  140. package/dist/header.js +1 -1
  141. package/dist/index.js +269 -270
  142. package/dist/index.js.map +1 -1
  143. package/dist/input-field-password.js +1 -1
  144. package/dist/input-field-phone-number.js +1 -1
  145. package/dist/input-field.js +1 -1
  146. package/dist/input-time.js +1 -1
  147. package/dist/internal.js +13 -13
  148. package/dist/menu.js +1 -1
  149. package/dist/modal-fullscreen.js +1 -1
  150. package/dist/modal.js +2 -2
  151. package/dist/pagination.js +1 -1
  152. package/dist/popover.js +1 -1
  153. package/dist/rich-text-editor.js +1 -1
  154. package/dist/search-bar.js +2 -2
  155. package/dist/secondary-nav.js +1 -1
  156. package/dist/selection-card.js +1 -1
  157. package/dist/sidepanel.js +1 -1
  158. package/dist/summary-grid.js +1 -1
  159. package/dist/timeline.js +1 -1
  160. package/dist/tutorial.js +1 -1
  161. package/dist/web-types.json +205 -2
  162. package/package.json +3 -3
  163. package/dist/assets/use-cached-selected-values.css +0 -1
  164. package/dist/chunks/calendar.D0JIbmoS.js +0 -1151
  165. package/dist/chunks/calendar.D0JIbmoS.js.map +0 -1
  166. package/dist/chunks/country.BEwW8TQo.js.map +0 -1
  167. package/dist/chunks/date-picker.BWxvyK5J.js +0 -245
  168. package/dist/chunks/date-picker.BWxvyK5J.js.map +0 -1
  169. package/dist/chunks/date-range-picker.gfRJmzXn.js +0 -1114
  170. package/dist/chunks/date-range-picker.gfRJmzXn.js.map +0 -1
  171. package/dist/chunks/date-time-picker.BIl9kFLh.js +0 -129
  172. package/dist/chunks/date-time-picker.BIl9kFLh.js.map +0 -1
  173. package/dist/chunks/dropdown.C70AlvOT.js +0 -1155
  174. package/dist/chunks/dropdown.C70AlvOT.js.map +0 -1
  175. package/dist/chunks/filter-bar.DQ9fJXq1.js.map +0 -1
  176. package/dist/chunks/summary-grid.types.CkqRXOKv.js.map +0 -1
  177. package/dist/chunks/use-cached-selected-values.D0s14AxT.js +0 -1520
  178. package/dist/chunks/use-cached-selected-values.D0s14AxT.js.map +0 -1
@@ -0,0 +1,1250 @@
1
+ import { defineComponent as _e, computed as m, reactive as De, useSlots as Ra, ref as N, onMounted as aa, toRaw as Ye, watch as me, useAttrs as ba, toRef as Te } from "vue";
2
+ import { b as Ya } from "./index.CJYgd0QI.js";
3
+ import { B as _a } from "./divider.DX5gwN7p.js";
4
+ import { h as ka, B as Ia } from "./button-actions.DKc63aCb.js";
5
+ import { B as ta, d as Qe } from "./typography.C8lPlsbD.js";
6
+ import { B as Aa } from "./alert.BDkEbdf4.js";
7
+ import { B as Sa, g as je, D as Ea } from "./dropdown.CIEm6MBB.js";
8
+ import { B as Fa } from "./segmented-control.C0JtDa4q.js";
9
+ import { u as ke } from "./index.B6WW_F-J.js";
10
+ import { u as xa } from "./use-has-slot.C9lQZ6nz.js";
11
+ import { u as Ie, a as wa } from "./use-date-input-formatter.Dq9C0nc9.js";
12
+ import { u as Pa } from "./use-touch-device.DTqFAbXh.js";
13
+ import { j as ne, k as O, s as I, l as Oa, m as We, n as Ba, f as Ve, o as qa, q as Ca, r as Na, t as Ge, u as za, b as C, v as La, h as Qa, i as ja, e as F, w as Ue, x as $e, g as Wa } from "./calendar.BckAv9N_.js";
14
+ import { e as z, a as Je } from "./differenceInMonths.CpwVtHZX.js";
15
+ import { s as He } from "./startOfWeek.Br5KM4z_.js";
16
+ import { t as pe, n as Va, c as Ga } from "./en-US.BK5uiAND.js";
17
+ import { c as Ua } from "./constructNow.CK0ryPil.js";
18
+ import { s as ce, a as Ke } from "./set-time-in-date.CU7HeZLY.js";
19
+ import { B as $a, i as Xe } from "./input-time.Bf-ZrCPX.js";
20
+ import { B as Ja } from "./input-field.3tzX7t2y.js";
21
+ import { B as Ha } from "./form-layout-group.zE6TNlzD.js";
22
+ import { n as Ae } from "./_plugin-vue2_normalizer.CeySl7Fu.js";
23
+ import { g as te } from "./generate-uid.NJ8tVoha.js";
24
+ import { u as Ka } from "./use-form-layout-loading.CWbjZiwP.js";
25
+ import "./index.Cl4_42j5.js";
26
+ import { u as Xa } from "./form-field.D_2g7vaP.js";
27
+ import { B as Za } from "./directive.BBWhsNtO.js";
28
+ import { F as et } from "./field-label.CdVbAfK-.js";
29
+ import { E as at } from "./error-message.CyERcfdt.js";
30
+ import { B as tt } from "./button-actions.types.BptAXjD8.js";
31
+ import "../assets/date-range-picker.css";
32
+ function Ze(o, t) {
33
+ return pe(o, t == null ? void 0 : t.in).getFullYear();
34
+ }
35
+ function Re(o, t) {
36
+ return +pe(o) == +pe(t);
37
+ }
38
+ function nt(o, t, e) {
39
+ const [a, l] = Va(
40
+ e == null ? void 0 : e.in,
41
+ o,
42
+ t
43
+ );
44
+ return +ne(a) == +ne(l);
45
+ }
46
+ function ea(o, t) {
47
+ const e = pe(o, t == null ? void 0 : t.in);
48
+ return e.setMilliseconds(0), e;
49
+ }
50
+ function be(o, t) {
51
+ return +ea(o) == +ea(t);
52
+ }
53
+ function rt(o, t) {
54
+ return O(
55
+ Ga(o, o),
56
+ Ua(o)
57
+ );
58
+ }
59
+ const st = {
60
+ name: "date-time-input"
61
+ }, ot = /* @__PURE__ */ _e({
62
+ ...st,
63
+ props: {
64
+ dateModelValue: { default: "" },
65
+ dateProps: { default: () => ({}) },
66
+ errorMessage: { default: null },
67
+ showTimeInput: { type: Boolean, default: !1 },
68
+ timeModelValue: { default: "" },
69
+ timeProps: { default: () => ({}) }
70
+ },
71
+ emits: ["update:date-model-value", "date:keydown", "update:time-model-value", "time:error", "time:valid"],
72
+ setup(o) {
73
+ const t = o, e = m(() => ({
74
+ errorMessage: t.errorMessage,
75
+ ...t.dateProps
76
+ })), a = m(() => ({
77
+ errorMessage: t.errorMessage,
78
+ ...t.timeProps
79
+ }));
80
+ return { __sfc: !0, props: t, resolvedDateProps: e, resolvedTimeProps: a, BentoFormLayoutGroup: Ha, BentoInputField: Ja, BentoInputTime: $a };
81
+ }
82
+ });
83
+ var lt = function() {
84
+ var t = this, e = t._self._c, a = t._self._setupProxy;
85
+ return e(a.BentoFormLayoutGroup, { attrs: { layout: t.showTimeInput ? "50-50" : "100", "error-message": t.errorMessage } }, [e(a.BentoInputField, t._b({ attrs: { "model-value": t.dateModelValue }, on: { "update:model-value": function(l) {
86
+ return t.$emit("update:date-model-value", l);
87
+ }, keydown: function(l) {
88
+ return t.$emit("date:keydown", l);
89
+ } } }, "bento-input-field", a.resolvedDateProps, !1)), t.showTimeInput ? e(a.BentoInputTime, t._b({ attrs: { "model-value": t.timeModelValue }, on: { "update:model-value": function(l) {
90
+ return t.$emit("update:time-model-value", l);
91
+ }, "input:error": function(l) {
92
+ return t.$emit("time:error");
93
+ }, "input:valid": function(l) {
94
+ return t.$emit("time:valid");
95
+ } } }, "bento-input-time", a.resolvedTimeProps, !1)) : t._e()], 1);
96
+ }, it = [], ut = /* @__PURE__ */ Ae(
97
+ ot,
98
+ lt,
99
+ it,
100
+ !1,
101
+ null,
102
+ null
103
+ );
104
+ const dt = ut.exports, ct = ({
105
+ firstDayOfWeek: o,
106
+ min: t,
107
+ max: e
108
+ }) => ({ getGranularCalendarLimits: (l) => {
109
+ if (!t && !e)
110
+ return { min: null, max: null };
111
+ let D = t ? I(t) : null, f = e ? z(e) : null;
112
+ if ((l == null ? void 0 : l.type) === "weekly") {
113
+ if (l.earliest)
114
+ D = I(l.earliest);
115
+ else if (D) {
116
+ const h = He(D, { weekStartsOn: o });
117
+ O(D, h) || (D = I(Oa(We(D, { weekStartsOn: o }), 1)));
118
+ }
119
+ if (l.latest)
120
+ f = z(l.latest);
121
+ else if (f) {
122
+ const h = We(f, { weekStartsOn: o });
123
+ O(f, h) || (f = z(Ba(He(f, { weekStartsOn: o }), 1)));
124
+ }
125
+ }
126
+ if ((l == null ? void 0 : l.type) === "monthly") {
127
+ if (l.earliest)
128
+ D = I(l.earliest);
129
+ else if (D) {
130
+ const h = Ve(D);
131
+ O(D, h) || (D = Ve(qa(D, 1)));
132
+ }
133
+ if (l.latest)
134
+ f = z(l.latest);
135
+ else if (f) {
136
+ const h = Je(f);
137
+ O(f, h) || (f = Je(Ca(f, 1)));
138
+ }
139
+ }
140
+ if ((l == null ? void 0 : l.type) === "quarterly") {
141
+ if (l.earliest)
142
+ D = ne(l.earliest);
143
+ else if (D) {
144
+ const h = ne(D);
145
+ O(D, h) || (D = ne(Na(D, 1)));
146
+ }
147
+ if (l.latest)
148
+ f = z(l.latest);
149
+ else if (f) {
150
+ const h = Ge(f);
151
+ O(f, h) || (f = Ge(za(f, 1)));
152
+ }
153
+ }
154
+ return { min: D, max: f };
155
+ } }), mt = () => {
156
+ const o = De({
157
+ daily: null,
158
+ weekly: null,
159
+ monthly: null,
160
+ quarterly: null
161
+ });
162
+ return {
163
+ savedRanges: o,
164
+ saveRange: (a, l) => {
165
+ o[a] = l;
166
+ },
167
+ resetSavedRanges: () => {
168
+ o.daily = null, o.weekly = null, o.monthly = null, o.quarterly = null;
169
+ }
170
+ };
171
+ };
172
+ var v = /* @__PURE__ */ ((o) => (o.CUSTOM_RANGE = "custom-range", o.INPUT = "input", o.ERROR = "error", o.FORM_DATE = "form-date", o.START_DATE_SELECTED = "start-date-selected", o))(v || {});
173
+ const Dt = {
174
+ "de-DE": {
175
+ "DD-MM-YYYY": "TT-MM-JJJJ",
176
+ "MM-DD-YYYY": "MM-TT-JJJJ",
177
+ "YYYY-MM-DD": "JJJJ-MM-TT",
178
+ customRange: "Benutzerdefinierter Bereich",
179
+ daily: "Täglich",
180
+ dateFrom: "Datum von",
181
+ dateTo: "Datum bis",
182
+ invalidDateFormat: "Ungültiges Datumsformat",
183
+ lastMonth: "Letzter Monat",
184
+ lastSevenDays: "Letzte 7 Tage",
185
+ lastThreeMonths: "Letzte drei Monate",
186
+ maxRangeDays: "Sie können bis zu {count} Tag auswählen | Sie können bis zu {count} Tage auswählen",
187
+ maxRangeMonths: "Sie können bis zu {count} Monat auswählen | Sie können bis zu {count} Monate auswählen",
188
+ maxRangeQuarters: "Sie können bis zu {count} Quartal auswählen | Sie können bis zu {count} Quartale auswählen",
189
+ maxRangeWeeks: "Sie können bis zu {count} Woche auswählen | Sie können bis zu {count} Wochen auswählen",
190
+ monthly: "Monatlich",
191
+ quarterly: "Vierteljährlich",
192
+ selectedDateIsNotAvailable: "Ausgewähltes Datum ist nicht verfügbar",
193
+ startDateMustPrecedeEndDate: "Das Anfangsdatum muss vor dem Enddatum liegen",
194
+ timeFrom: "Zeit von",
195
+ timeTo: "Zeit bis",
196
+ weekly: "Wöchentlich"
197
+ },
198
+ "en-GB": {
199
+ "DD-MM-YYYY": "DD-MM-YYYY",
200
+ "MM-DD-YYYY": "MM-DD-YYYY",
201
+ "YYYY-MM-DD": "YYYY-MM-DD",
202
+ customRange: "Custom range",
203
+ daily: "Daily",
204
+ dateFrom: "Date from",
205
+ dateTo: "Date to",
206
+ invalidDateFormat: "Invalid date format",
207
+ lastMonth: "Last month",
208
+ lastSevenDays: "Last 7 days",
209
+ lastThreeMonths: "The last three months",
210
+ maxRangeDays: "You can select up to {count} day | You can select up to {count} days",
211
+ maxRangeMonths: "You can select up to {count} month | You can select up to {count} months",
212
+ maxRangeQuarters: "You can select up to {count} quarter | You can select up to {count} quarters",
213
+ maxRangeWeeks: "You can select up to {count} week | You can select up to {count} weeks",
214
+ monthly: "Monthly",
215
+ quarterly: "Quarterly",
216
+ selectedDateIsNotAvailable: "Selected date is not available",
217
+ startDateMustPrecedeEndDate: "Start date must precede end date",
218
+ timeFrom: "Time from",
219
+ timeTo: "Time to",
220
+ weekly: "Weekly"
221
+ },
222
+ "en-US": {
223
+ "DD-MM-YYYY": "DD-MM-YYYY",
224
+ "MM-DD-YYYY": "MM-DD-YYYY",
225
+ "YYYY-MM-DD": "YYYY-MM-DD",
226
+ customRange: "Custom range",
227
+ daily: "Daily",
228
+ dateFrom: "Date from",
229
+ dateTo: "Date to",
230
+ invalidDateFormat: "Invalid date format",
231
+ lastMonth: "Last month",
232
+ lastSevenDays: "Last 7 days",
233
+ lastThreeMonths: "Last three months",
234
+ maxRangeDays: "You can select up to {count} day | You can select up to {count} days",
235
+ maxRangeMonths: "You can select up to {count} month | You can select up to {count} months",
236
+ maxRangeQuarters: "You can select up to {count} quarter | You can select up to {count} quarters",
237
+ maxRangeWeeks: "You can select up to {count} week | You can select up to {count} weeks",
238
+ monthly: "Monthly",
239
+ quarterly: "Quarterly",
240
+ selectedDateIsNotAvailable: "Selected date is not available",
241
+ startDateMustPrecedeEndDate: "Start date must precede end date",
242
+ timeFrom: "Time from",
243
+ timeTo: "Time to",
244
+ weekly: "Weekly"
245
+ },
246
+ "es-ES": {
247
+ "DD-MM-YYYY": "DD-MM-AAAA",
248
+ "MM-DD-YYYY": "MM-DD-AAAA",
249
+ "YYYY-MM-DD": "AAAA-MM-DD",
250
+ customRange: "Rango personalizado",
251
+ daily: "Diario",
252
+ dateFrom: "Fecha desde",
253
+ dateTo: "Fecha hasta",
254
+ invalidDateFormat: "Formato de fecha no válido",
255
+ lastMonth: "El mes pasado",
256
+ lastSevenDays: "Últimos 7 días",
257
+ lastThreeMonths: "Últimos tres meses",
258
+ maxRangeDays: "Puedes seleccionar hasta {count} día | Puedes seleccionar hasta {count} días",
259
+ maxRangeMonths: "Puedes seleccionar hasta {count} mes | Puedes seleccionar hasta {count} meses",
260
+ maxRangeQuarters: "Puedes seleccionar hasta {count} trimestre | Puedes seleccionar hasta {count} trimestres",
261
+ maxRangeWeeks: "Puedes seleccionar hasta {count} semana | Puedes seleccionar hasta {count} semanas",
262
+ monthly: "Mensualmente",
263
+ quarterly: "Trimestral",
264
+ selectedDateIsNotAvailable: "La fecha seleccionada no está disponible",
265
+ startDateMustPrecedeEndDate: "La fecha de inicio debe ser anterior a la fecha de finalización",
266
+ timeFrom: "Hora desde",
267
+ timeTo: "Hora hasta",
268
+ weekly: "Semanal"
269
+ },
270
+ "es-MX": {
271
+ "DD-MM-YYYY": "DD-MM-AAAA",
272
+ "MM-DD-YYYY": "MM-DD-AAAA",
273
+ "YYYY-MM-DD": "AAAA-MM-DD",
274
+ customRange: "Rango personalizado",
275
+ daily: "Diario",
276
+ dateFrom: "Fecha de",
277
+ dateTo: "Fecha hasta",
278
+ invalidDateFormat: "Formato de fecha no válido",
279
+ lastMonth: "El mes pasado",
280
+ lastSevenDays: "Últimos 7 días",
281
+ lastThreeMonths: "Últimos tres meses",
282
+ maxRangeDays: "Puedes seleccionar hasta {count} día | Puedes seleccionar hasta {count} días",
283
+ maxRangeMonths: "Puedes seleccionar hasta {count} mes | Puedes seleccionar hasta {count} meses",
284
+ maxRangeQuarters: "Puedes seleccionar hasta {count} trimestre | Puedes seleccionar hasta {count} trimestres",
285
+ maxRangeWeeks: "Puedes seleccionar hasta {count} semana | Puedes seleccionar hasta {count} semanas",
286
+ monthly: "Mensual",
287
+ quarterly: "Trimestral",
288
+ selectedDateIsNotAvailable: "La fecha seleccionada no está disponible",
289
+ startDateMustPrecedeEndDate: "La fecha de inicio debe ser anterior a la fecha de finalización",
290
+ timeFrom: "Tiempo desde",
291
+ timeTo: "Es hora de",
292
+ weekly: "Semanal"
293
+ },
294
+ "fr-FR": {
295
+ "DD-MM-YYYY": "JJ-MM-AAAA",
296
+ "MM-DD-YYYY": "MM-JJ-AAAA",
297
+ "YYYY-MM-DD": "AAAA-MM-JJ",
298
+ customRange: "Plage personnalisée",
299
+ daily: "Quotidien",
300
+ dateFrom: "Date de début",
301
+ dateTo: "Date de fin",
302
+ invalidDateFormat: "Format de date non valide",
303
+ lastMonth: "Le mois dernier",
304
+ lastSevenDays: "7 derniers jours",
305
+ lastThreeMonths: "Trois derniers mois",
306
+ maxRangeDays: "Vous pouvez sélectionner jusqu'à {count} jour| Vous pouvez sélectionner jusqu'à {count} jours",
307
+ maxRangeMonths: "Vous pouvez sélectionner jusqu'à {count} mois | Vous pouvez sélectionner jusqu'à {count} mois",
308
+ maxRangeQuarters: "Vous pouvez sélectionner jusqu'à {count} trimestre | Vous pouvez sélectionner jusqu'à {count} trimestres",
309
+ maxRangeWeeks: "Vous pouvez sélectionner jusqu'à {count} semaine | Vous pouvez sélectionner jusqu'à {count} semaines",
310
+ monthly: "Mensuel",
311
+ quarterly: "Trimestriel",
312
+ selectedDateIsNotAvailable: "La date sélectionnée n’est pas disponible",
313
+ startDateMustPrecedeEndDate: "La date de début doit précéder la date de fin",
314
+ timeFrom: "Heure de début",
315
+ timeTo: "Heure de fin",
316
+ weekly: "Hebdomadaire"
317
+ },
318
+ "it-IT": {
319
+ "DD-MM-YYYY": "GG-MM-AAAA",
320
+ "MM-DD-YYYY": "MM-GG-AAAA",
321
+ "YYYY-MM-DD": "AAAA-MM-GG",
322
+ customRange: "Intervallo personalizzato",
323
+ daily: "Giornaliero",
324
+ dateFrom: "Data da",
325
+ dateTo: "Da",
326
+ invalidDateFormat: "Formato data non valido",
327
+ lastMonth: "Il mese scorso",
328
+ lastSevenDays: "Ultimi 7 giorni",
329
+ lastThreeMonths: "Gli ultimi tre mesi",
330
+ maxRangeDays: "Puoi selezionare fino a {count} giorno | Puoi selezionare fino a {count} giorni",
331
+ maxRangeMonths: "Puoi selezionare fino a {count} mese | Puoi selezionare fino a {count} mesi",
332
+ maxRangeQuarters: "Puoi selezionare fino a {count} trimestre | Puoi selezionare fino a {count} trimestri",
333
+ maxRangeWeeks: "Puoi selezionare fino a {count} settimana | Puoi selezionare fino a {count} settimane",
334
+ monthly: "Mensile",
335
+ quarterly: "Trimestrale",
336
+ selectedDateIsNotAvailable: "La data selezionata non è disponibile",
337
+ startDateMustPrecedeEndDate: "La data di inizio deve precedere la data di fine",
338
+ timeFrom: "Tempo dal",
339
+ timeTo: "Tempo fino al",
340
+ weekly: "Settimanale"
341
+ },
342
+ "ja-JP": {
343
+ "DD-MM-YYYY": "DD-MM-YYYY",
344
+ "MM-DD-YYYY": "MM-DD-YYYY",
345
+ "YYYY-MM-DD": "YYYY-MM-DD",
346
+ customRange: "カスタム範囲",
347
+ daily: "毎日",
348
+ dateFrom: "開始日",
349
+ dateTo: "終了日",
350
+ invalidDateFormat: "無効な日付形式",
351
+ lastMonth: "先月",
352
+ lastSevenDays: "過去 7 日間",
353
+ lastThreeMonths: "過去3か月",
354
+ maxRangeDays: "{count}日間まで選択できます | {count}日間まで選択できます",
355
+ maxRangeMonths: "{count}か月まで選択できます | {count}か月まで選択できます",
356
+ maxRangeQuarters: "{count}四半期まで選択できます | {count}四半期まで選択できます",
357
+ maxRangeWeeks: "{count}週間まで選択できます | {count}週間まで選択できます",
358
+ monthly: "毎月",
359
+ quarterly: "四半期ごと",
360
+ selectedDateIsNotAvailable: "選択した日付は利用できません",
361
+ startDateMustPrecedeEndDate: "開始日は終了日より前にする必要があります",
362
+ timeFrom: "開始時刻",
363
+ timeTo: "終了時刻",
364
+ weekly: "毎週"
365
+ },
366
+ "pt-BR": {
367
+ "DD-MM-YYYY": "DD-MM-AAAA",
368
+ "MM-DD-YYYY": "MM-DD-AAAA",
369
+ "YYYY-MM-DD": "AAAA-MM-DD",
370
+ customRange: "Intervalo personalizado",
371
+ daily: "Diário",
372
+ dateFrom: "Data a partir de",
373
+ dateTo: "Data até",
374
+ invalidDateFormat: "Formato de data inválido",
375
+ lastMonth: "Último mês",
376
+ lastSevenDays: "Últimos 7 dias",
377
+ lastThreeMonths: "Últimos 3 meses",
378
+ maxRangeDays: "Você pode selecionar até {count} dia | Você pode selecionar até {count} dias",
379
+ maxRangeMonths: "Você pode selecionar até {count} mês | Você pode selecionar até {count} meses",
380
+ maxRangeQuarters: "Você pode selecionar até {count} trimestre | Você pode selecionar até {count} trimestres",
381
+ maxRangeWeeks: "Você pode selecionar até {count} semana | Você pode selecionar até {count} semanas",
382
+ monthly: "Mensal",
383
+ quarterly: "Trimestral",
384
+ selectedDateIsNotAvailable: "A data selecionada não está disponível",
385
+ startDateMustPrecedeEndDate: "A data de início deve preceder a data de término",
386
+ timeFrom: "Horário a partir de",
387
+ timeTo: "Horário até",
388
+ weekly: "Semanal"
389
+ },
390
+ "zh-CN": {
391
+ "DD-MM-YYYY": "日-月-年",
392
+ "MM-DD-YYYY": "月-日-年",
393
+ "YYYY-MM-DD": "年-月-日",
394
+ customRange: "自定义范围",
395
+ daily: "每日",
396
+ dateFrom: "日期自",
397
+ dateTo: "日期至",
398
+ invalidDateFormat: "日期格式无效",
399
+ lastMonth: "上个月",
400
+ lastSevenDays: "最近 7 天",
401
+ lastThreeMonths: "过去三个月",
402
+ maxRangeDays: "您可以选择最多 {count} 天 | 您可以选择最多 {count} 天",
403
+ maxRangeMonths: "您可以选择最多 {count} 个月 | 您可以选择最多 {count} 个月",
404
+ maxRangeQuarters: "您最多可以选择 {count} 个季度 | 您最多可以选择 {count} 个季度",
405
+ maxRangeWeeks: "您最多可以选择 {count} 周 | 您最多可以选择 {count} 周",
406
+ monthly: "每月",
407
+ quarterly: "每季度",
408
+ selectedDateIsNotAvailable: "所选日期不可用",
409
+ startDateMustPrecedeEndDate: "开始日期必须早于结束日期",
410
+ timeFrom: "时间自",
411
+ timeTo: "是时候",
412
+ weekly: "每周"
413
+ }
414
+ }, pt = {
415
+ name: "date-range-picker-calendar",
416
+ i18n: { messages: Dt }
417
+ }, vt = /* @__PURE__ */ _e({
418
+ ...pt,
419
+ props: {
420
+ /**
421
+ * Allows user to enter time values in the form
422
+ */
423
+ allowTimeInput: { type: Boolean, default: !1 },
424
+ /**
425
+ * Ranges form persistance data
426
+ */
427
+ dateFormData: {
428
+ type: Object,
429
+ default: () => ({ startDate: void 0, endDate: void 0, startTime: void 0, endTime: void 0 })
430
+ },
431
+ /**
432
+ * Allows you to set the first day of the week. 0 is sunday, 1 is monday, 6 is saturday
433
+ */
434
+ firstDayOfWeek: C.props.firstDayOfWeek,
435
+ /**
436
+ * A list of available granularities.
437
+ * If present, the date picker will display a segmented control to change granularity.
438
+ */
439
+ granularities: {
440
+ type: Array,
441
+ default: null
442
+ },
443
+ /**
444
+ * Indicate if a date should be disabled or not
445
+ */
446
+ isDateDisabled: C.props.isDateDisabled,
447
+ /**
448
+ * Set a maximum number of dates to be selectable by the range.
449
+ */
450
+ maxRange: C.props.maxRange,
451
+ /**
452
+ * Sets a minimum limit for selectable dates - dates before `min` will not be selectable
453
+ */
454
+ min: C.props.min,
455
+ /**
456
+ * Sets a maximum limit for selectable dates - dates after `max` will not be selectable
457
+ */
458
+ max: C.props.max,
459
+ /**
460
+ * Number of months rendered on pane
461
+ */
462
+ numberOfMonths: {
463
+ type: C.props.numberOfMonths.type,
464
+ default: C.props.numberOfMonths.default,
465
+ validator: (o) => o >= 0
466
+ },
467
+ /**
468
+ * Displays the end date's month when the calendar is opened. Defaults to false i.e. the start date's month is displayed.
469
+ */
470
+ showEndDateOnOpen: { type: Boolean, default: !1 },
471
+ /**
472
+ * Enables the custom range selector.
473
+ * If provided, must be an array that sets the custom range dropdown items. Items are of the structure:
474
+ * `label` - label of custom range item.
475
+ * `value` - a unique key of the custom range item.
476
+ * `data` - an object `{ startDate: Date; endDate: Date }` to set the date picker range to upon selecting.
477
+ */
478
+ quickSelectRanges: {
479
+ type: Array,
480
+ default: void 0
481
+ },
482
+ /**
483
+ * Selected date
484
+ */
485
+ value: { type: Object, default: void 0 },
486
+ /**
487
+ * The type of calendar to display. Defaults to showing days.
488
+ */
489
+ variant: C.props.variant,
490
+ /**
491
+ * Range of years to be selectable from the year dropdown
492
+ */
493
+ yearRange: C.props.yearRange
494
+ },
495
+ emits: [
496
+ v.CUSTOM_RANGE,
497
+ v.INPUT,
498
+ v.ERROR,
499
+ v.FORM_DATE,
500
+ v.START_DATE_SELECTED
501
+ ],
502
+ setup(o, { emit: t }) {
503
+ var Be, qe, Ce, Ne;
504
+ const e = o, a = 300, l = "customRange", D = {
505
+ daily: "maxRangeDays",
506
+ weekly: "maxRangeWeeks",
507
+ monthly: "maxRangeMonths",
508
+ quarterly: "maxRangeQuarters"
509
+ }, f = Ra(), h = xa(f), { t: x, tc: L } = ke(), { isTouchDevice: M } = Pa(), {
510
+ dateFormat: re,
511
+ isFormatValid: X,
512
+ parseDate: p,
513
+ onKeyDown: j,
514
+ autoFormat: A,
515
+ formatDate: B
516
+ } = Ie(), g = N({}), W = m(() => e.variant === "month" ? "monthly" : "daily"), w = m(() => e.numberOfMonths === 0), r = De({
517
+ startDate: (Be = e.value) == null ? void 0 : Be.startDate,
518
+ endDate: (qe = e.value) == null ? void 0 : qe.endDate,
519
+ range: (Ce = e.value) == null ? void 0 : Ce.range,
520
+ ...e.granularities ? {
521
+ granularity: ((Ne = e.value) == null ? void 0 : Ne.granularity) || W.value
522
+ } : {}
523
+ }), S = m(() => {
524
+ var n, i;
525
+ return (
526
+ // eslint-disable-next-line consistent-return
527
+ ((i = (n = e == null ? void 0 : e.quickSelectRanges) == null ? void 0 : n.find(({ value: c, data: d }) => {
528
+ var _;
529
+ if (!d.endDate) {
530
+ if (d.isRelativeToNow) {
531
+ const y = (_ = g.value) == null ? void 0 : _[c];
532
+ return y ? Re(y.startDate, r.startDate) && Re(y.endDate, r.endDate) : (
533
+ // If not stored calculated dates, fall back to comparing the quick select item's value
534
+ // with the internal range's stored range identifier.
535
+ c === r.range
536
+ );
537
+ }
538
+ return Re(d.startDate, r.startDate) && rt(r.endDate) && (!e.allowTimeInput || be(r.endDate, z(r.endDate))) && (e.granularities ? d.granularity === r.granularity : !0);
539
+ }
540
+ if (e.allowTimeInput)
541
+ return be(d.startDate, r.startDate) && be(d.endDate, r.endDate) && (e.granularities ? d.granularity === r.granularity : !0);
542
+ if (d.endDate)
543
+ return O(d.startDate, r.startDate) && O(d.endDate, r.endDate) && (e.granularities ? d.granularity === r.granularity : !0);
544
+ })) == null ? void 0 : i.value) ?? l
545
+ );
546
+ }), se = m(() => [
547
+ { label: x("customRange"), value: l },
548
+ ...e.quickSelectRanges ? e.quickSelectRanges : []
549
+ ]), Q = m(
550
+ () => {
551
+ var n;
552
+ return ((n = e.granularities) == null ? void 0 : n.find(({ type: i }) => i === r.granularity)) || null;
553
+ }
554
+ ), ve = m(
555
+ () => {
556
+ var n;
557
+ return ((n = e.granularities) == null ? void 0 : n.map(({ type: i, disabled: c }) => ({
558
+ label: x(i),
559
+ value: i,
560
+ disabled: c
561
+ }))) ?? [];
562
+ }
563
+ ), { getGranularCalendarLimits: Z } = ct(e), Y = m(
564
+ () => e.granularities ? Z(Q.value) : { min: e.min ? I(e.min) : null, max: e.max ? z(e.max) : null }
565
+ ), {
566
+ adjustDateForQuarterly: V,
567
+ adjustDateForMonthly: T,
568
+ adjustDateForWeekly: oe,
569
+ adjustStartDateInputForWeekly: le,
570
+ adjustEndDateInputForWeekly: $,
571
+ adjustStartDateInputForMonthly: ie,
572
+ adjustEndDateInputForMonthly: J,
573
+ adjustStartDateInputForQuarterly: H,
574
+ adjustEndDateInputForQuarterly: q
575
+ } = La(e.firstDayOfWeek), { savedRanges: E, saveRange: ue, resetSavedRanges: ee } = mt(), k = (n) => n ? B(n) : "", R = N(null), b = N(null), fe = m(() => R.value ? x(R.value) : null), ge = m(() => b.value ? x(b.value) : null), Se = m(
576
+ () => R.value === "invalidDateFormat" ? null : fe.value
577
+ ), Ee = m(() => b.value === "invalidDateFormat" ? null : ge.value), u = (n, i, c, d) => {
578
+ if (!n || !X(n))
579
+ return "invalidDateFormat";
580
+ const _ = p(n), y = I(_);
581
+ if (e.min && y < I(e.min) || e.max && y > I(e.max) || e.isDateDisabled && e.isDateDisabled(y))
582
+ return "selectedDateIsNotAvailable";
583
+ if (i) {
584
+ const ze = d ? ce(d, 0).getTime() : y.getTime(), Le = d ? ce(i, 0).getTime() : I(i).getTime();
585
+ if (c === "start" ? ze >= Le : ze <= Le)
586
+ return "startDateMustPrecedeEndDate";
587
+ }
588
+ return null;
589
+ }, s = De({
590
+ startDate: e.dateFormData.startDate,
591
+ endDate: e.dateFormData.endDate,
592
+ startTime: e.dateFormData.startTime,
593
+ endTime: e.dateFormData.endTime
594
+ }), K = (n, i) => {
595
+ const c = () => {
596
+ if (i && U(i)) {
597
+ const d = Ke(p(i), n);
598
+ if (e.min && d < ce(e.min, 0) || e.max && d > ce(e.max, 0))
599
+ return !1;
600
+ }
601
+ return !0;
602
+ };
603
+ return Xe(n) && c();
604
+ }, G = m(() => e.variant === "month"), ye = (n) => n ? G.value ? Qa(n) : ja(n) : "", Fe = m(() => ye(r.startDate)), xe = m(() => ye(r.endDate)), na = m(() => M.value ? G.value ? "month" : "date" : "text"), ra = m(() => M.value ? Fe.value : s.startDate), sa = m(() => M.value ? xe.value : s.endDate), P = (n, i) => !i || !Xe(i) || e.variant === "month" ? n : Ke(new Date(n), i), oa = (n) => {
605
+ s.startTime = F(
606
+ e.min && e.allowTimeInput && O(e.min, n.startDate) ? e.min : I(n.startDate)
607
+ ), s.endTime = F(
608
+ e.max && e.allowTimeInput && O(e.max, n.endDate) ? e.max : z(n.endDate)
609
+ ), r.startDate = P(n.startDate, s.startTime), r.endDate = P(n.endDate, s.endTime), r.range = null, e.granularities && ee(), t(v.INPUT, {
610
+ ...r,
611
+ range: S.value
612
+ });
613
+ }, U = (n) => !!n && !u(n);
614
+ aa(() => {
615
+ R.value = e.dateFormData.startDate ? u(e.dateFormData.startDate) : null, b.value = e.dateFormData.endDate ? u(e.dateFormData.endDate) : null;
616
+ });
617
+ const la = (n) => {
618
+ s.startDate = k(n), s.startTime || (s.startTime = F(n)), R.value = null, b.value === "startDateMustPrecedeEndDate" && (b.value = null), t(v.START_DATE_SELECTED, n);
619
+ }, ia = (n) => {
620
+ s.endDate = k(n), s.endTime || (s.endTime = F(z(n))), b.value = null, R.value === "startDateMustPrecedeEndDate" && (R.value = null);
621
+ }, de = (n) => {
622
+ const i = e.value[n];
623
+ if (i)
624
+ return i;
625
+ if (e.dateFormData[n] && U(e.dateFormData[n]))
626
+ return p(e.dateFormData[n]);
627
+ }, Me = (n) => {
628
+ var i;
629
+ if (U(n)) {
630
+ let c = n;
631
+ switch (R.value = null, (i = Q.value) == null ? void 0 : i.type) {
632
+ case "weekly":
633
+ c = le(
634
+ n,
635
+ k,
636
+ Y.value.min,
637
+ Y.value.max
638
+ ), s.startDate = c;
639
+ break;
640
+ case "monthly":
641
+ c = ie(
642
+ n,
643
+ k,
644
+ Y.value.min,
645
+ Y.value.max
646
+ ), s.startDate = c;
647
+ break;
648
+ case "quarterly":
649
+ c = H(
650
+ n,
651
+ k,
652
+ Y.value.min,
653
+ Y.value.max
654
+ ), s.startDate = c;
655
+ break;
656
+ }
657
+ const d = I(p(c));
658
+ r.startDate = P(d, s.startTime), U(s.endDate) && (r.endDate = P(
659
+ I(p(s.endDate)),
660
+ s.endTime
661
+ ));
662
+ const _ = de("endDate"), y = u(
663
+ c,
664
+ e.allowTimeInput ? r.endDate : _,
665
+ "start",
666
+ e.allowTimeInput ? r.startDate : void 0
667
+ );
668
+ if (y) {
669
+ R.value = y, t(v.ERROR, { ...s });
670
+ return;
671
+ }
672
+ b.value === "startDateMustPrecedeEndDate" && (b.value = null), r.range = null, t(v.FORM_DATE, {
673
+ startDate: d,
674
+ endDate: _
675
+ }), t(v.INPUT, {
676
+ ...r,
677
+ range: S.value
678
+ });
679
+ } else
680
+ R.value = u(n), t(v.ERROR, { ...s });
681
+ }, we = je(Me, a), ua = (n) => {
682
+ if (s.startDate = M.value && G.value ? n : A(n), M.value)
683
+ if (G.value && n) {
684
+ const i = Ue(n);
685
+ r.startDate = P(i, s.startTime), r.range = null, t(v.INPUT, {
686
+ ...r,
687
+ range: S.value
688
+ });
689
+ } else s.startDate ? Me(s.startDate) : R.value = null;
690
+ else
691
+ we(s.startDate);
692
+ }, he = (n) => {
693
+ var i;
694
+ if (U(n)) {
695
+ let c = n;
696
+ switch (b.value = null, (i = Q.value) == null ? void 0 : i.type) {
697
+ case "weekly":
698
+ c = $(
699
+ n,
700
+ k,
701
+ Y.value.min,
702
+ Y.value.max
703
+ ), s.endDate = c;
704
+ break;
705
+ case "monthly":
706
+ c = J(
707
+ n,
708
+ k,
709
+ Y.value.min,
710
+ Y.value.max
711
+ ), s.endDate = c;
712
+ break;
713
+ case "quarterly":
714
+ c = q(
715
+ n,
716
+ k,
717
+ Y.value.min,
718
+ Y.value.max
719
+ ), s.endDate = c;
720
+ break;
721
+ }
722
+ const d = I(p(c));
723
+ r.endDate = P(d, s.endTime), U(s.startDate) && (r.startDate = P(
724
+ I(p(s.startDate)),
725
+ s.startTime
726
+ ));
727
+ const _ = de("startDate"), y = u(
728
+ c,
729
+ e.allowTimeInput ? r.startDate : _,
730
+ "end",
731
+ e.allowTimeInput ? r.endDate : void 0
732
+ );
733
+ if (y) {
734
+ b.value = y, t(v.ERROR, { ...s });
735
+ return;
736
+ }
737
+ R.value === "startDateMustPrecedeEndDate" && (R.value = null), r.range = null, t(v.FORM_DATE, {
738
+ startDate: _,
739
+ endDate: d
740
+ }), t(v.INPUT, {
741
+ ...r,
742
+ range: S.value
743
+ });
744
+ } else
745
+ b.value = u(n), t(v.ERROR, { ...s });
746
+ }, Pe = je(he, a), da = (n) => {
747
+ if (s.endDate = M.value && G.value ? n : A(n), M.value)
748
+ if (G.value && n) {
749
+ const i = Ue(n);
750
+ r.endDate = P(i, s.endTime), r.range = null, t(v.INPUT, {
751
+ ...r,
752
+ range: S.value
753
+ });
754
+ } else s.endDate ? he(s.endDate) : b.value = null;
755
+ else
756
+ Pe(s.endDate);
757
+ }, ca = (n) => {
758
+ j(n);
759
+ }, ma = () => {
760
+ t(v.ERROR, { ...s });
761
+ }, Da = () => {
762
+ const n = s.startTime;
763
+ if (!K(n, s.startDate)) {
764
+ t(v.ERROR, { ...s });
765
+ return;
766
+ }
767
+ if (r.startDate = P(r.startDate, n), s.startDate && r.endDate) {
768
+ const c = u(
769
+ s.startDate,
770
+ r.endDate,
771
+ "start",
772
+ r.startDate
773
+ );
774
+ if (c) {
775
+ R.value = c, t(v.ERROR, { ...s });
776
+ return;
777
+ }
778
+ }
779
+ R.value = null, b.value === "startDateMustPrecedeEndDate" && (b.value = null);
780
+ const i = de("endDate");
781
+ t(v.FORM_DATE, {
782
+ startDate: r.startDate,
783
+ endDate: i,
784
+ startTime: n,
785
+ endTime: s.endTime ?? e.dateFormData.endTime
786
+ }), t(v.INPUT, {
787
+ ...r,
788
+ range: S.value
789
+ });
790
+ }, pa = () => {
791
+ t(v.ERROR, { ...s });
792
+ }, va = () => {
793
+ const n = s.endTime;
794
+ if (!K(n, s.endDate)) {
795
+ t(v.ERROR, { ...s });
796
+ return;
797
+ }
798
+ if (r.endDate = P(r.endDate, n), s.endDate && r.startDate) {
799
+ const i = u(
800
+ s.endDate,
801
+ r.startDate,
802
+ "end",
803
+ r.endDate
804
+ );
805
+ if (i) {
806
+ b.value = i, t(v.ERROR, { ...s });
807
+ return;
808
+ }
809
+ }
810
+ b.value = null, R.value === "startDateMustPrecedeEndDate" && (R.value = null), t(v.FORM_DATE, {
811
+ startDate: r.startDate,
812
+ endDate: r.endDate,
813
+ startTime: s.startTime ?? e.dateFormData.startTime,
814
+ endTime: n
815
+ }), t(v.INPUT, {
816
+ ...r,
817
+ range: S.value
818
+ });
819
+ }, fa = (n) => {
820
+ s.startTime = n;
821
+ }, ga = (n) => {
822
+ s.endTime = n;
823
+ }, ae = (n, i, c, d) => {
824
+ r.startDate = n, r.endDate = i, c && (r.granularity = c), d && (r.range = d);
825
+ }, ya = (n) => {
826
+ var c;
827
+ const i = (c = e.quickSelectRanges) == null ? void 0 : c.find(({ value: d }) => d === n);
828
+ if (i) {
829
+ ee();
830
+ const d = i.data, _ = d.endDate || (d.isRelativeToNow ? new Date(Date.now()) : z(new Date(Date.now()))), y = d.isRelativeToNow && d.timeDifference ? new Date(_.getTime() - d.timeDifference) : d.startDate;
831
+ s.endDate = k(_), s.startDate = k(y), ae(y, _, null, n), e.granularities && (r.granularity = d.granularity || W.value), s.startTime = F(y), s.endTime = F(_), r.startDate = y, r.endDate = _, d.isRelativeToNow && (g.value = {
832
+ ...g.value,
833
+ [n]: {
834
+ startDate: y,
835
+ endDate: _
836
+ }
837
+ }), t(v.CUSTOM_RANGE, {
838
+ ...i.data,
839
+ startDate: y,
840
+ endDate: _,
841
+ range: i.value
842
+ });
843
+ }
844
+ }, Oe = {
845
+ weekly: oe,
846
+ monthly: T,
847
+ quarterly: V
848
+ }, Ma = (n) => {
849
+ const i = r.granularity;
850
+ if (r.granularity = n, i && ue(i, structuredClone(Ye(r))), r.startDate && r.endDate) {
851
+ switch (n) {
852
+ case "quarterly":
853
+ case "monthly":
854
+ case "weekly": {
855
+ if (E[n]) {
856
+ ae(E[n].startDate, E[n].endDate, n);
857
+ break;
858
+ }
859
+ const { startDate: c, endDate: d } = Oe[n](
860
+ r.startDate,
861
+ r.endDate,
862
+ Y.value.min,
863
+ Y.value.max
864
+ );
865
+ ae(c, d, n);
866
+ break;
867
+ }
868
+ case "daily":
869
+ E.daily && ae(E.daily.startDate, E.daily.endDate, n);
870
+ break;
871
+ }
872
+ s.startDate = k(r.startDate), s.endDate = k(r.endDate), t(v.INPUT, {
873
+ ...r,
874
+ range: S.value
875
+ });
876
+ }
877
+ }, ha = m(() => ({
878
+ "b-date-range-picker-calendar__form-container--no-calendars": w.value
879
+ })), Ta = m(() => {
880
+ const n = Q.value, i = (n == null ? void 0 : n.maxRange) || e.maxRange;
881
+ if (!i)
882
+ return null;
883
+ const c = D[(n == null ? void 0 : n.type) ?? "daily"];
884
+ return L(c, i, { count: i });
885
+ });
886
+ return { __sfc: !0, FORM_INPUT_DEBOUNCE_TIME: a, RANGE_SELECTOR_CUSTOM_RANGE_KEY: l, maxRangeMessageKeyMap: D, props: e, emit: t, slots: f, hasSlot: h, t: x, tc: L, isTouchDevice: M, dateFormat: re, isFormatValid: X, parseDate: p, onKeyDown: j, autoFormat: A, formatDateUtil: B, calculatedIsRelativeToNowQuickSelectRanges: g, defaultGranularity: W, hasNoCalendars: w, internalRangeDate: r, selectedRangeSelectorValue: S, quickSelectRangeDefaultItems: se, selectedGranularity: Q, granularityItems: ve, getGranularCalendarLimits: Z, computedMinMax: Y, adjustDateForQuarterly: V, adjustDateForMonthly: T, adjustDateForWeekly: oe, adjustStartDateInputForWeekly: le, adjustEndDateInputForWeekly: $, adjustStartDateInputForMonthly: ie, adjustEndDateInputForMonthly: J, adjustStartDateInputForQuarterly: H, adjustEndDateInputForQuarterly: q, savedRanges: E, saveRange: ue, resetSavedRanges: ee, formatDate: k, startDateError: R, endDateError: b, startDateErrorText: fe, endDateErrorText: ge, startSharedError: Se, endSharedError: Ee, getDateErrorMessage: u, dateTextInput: s, isValidTime: K, isMonthVariant: G, formatNativeDate: ye, nativeStartDate: Fe, nativeEndDate: xe, dateInputType: na, startDateValue: ra, endDateValue: sa, setTimeInDateRef: P, onDateInput: oa, isValidDate: U, onStartDateSelected: la, onEndDateSelected: ia, getDate: de, validateStartDate: Me, validateStartDateDebounced: we, onStartDateInput: ua, validateEndDate: he, validateEndDateDebounced: Pe, onEndDateInput: da, onDateInputKeyDown: ca, onStartTimeError: ma, onStartTimeValid: Da, onEndTimeError: pa, onEndTimeValid: va, onStartTimeInput: fa, onEndTimeInput: ga, setInternalRange: ae, onRangeSelectorInput: ya, adjustDate: Oe, onGranularityInput: Ma, computedFormContainerClasses: ha, maxRangeMessage: Ta, Calendar: C, DateTimeInput: dt, BentoAlert: Aa, BentoTypography: ta, BentoDropdown: Sa, BentoSegmentedControl: Fa };
887
+ }
888
+ });
889
+ var ft = function() {
890
+ var t = this, e = t._self._c, a = t._self._setupProxy;
891
+ return e("div", { staticClass: "b-date-range-picker-calendar" }, [e("div", { staticClass: "b-date-range-picker-calendar__form-container", class: a.computedFormContainerClasses, attrs: { "data-testid": "date-range-picker-calendar-form-container" } }, [e("div", { staticClass: "b-date-range-picker-calendar__form" }, [a.hasSlot("title") ? [t._t("title")] : t._e(), t.quickSelectRanges ? e(a.BentoDropdown, { attrs: { "aria-label": a.t("customRange"), items: a.quickSelectRangeDefaultItems, "model-value": a.selectedRangeSelectorValue }, on: { "update:model-value": a.onRangeSelectorInput } }) : t._e(), t.granularities ? e(a.BentoSegmentedControl, { attrs: { items: a.granularityItems, "model-value": a.internalRangeDate.granularity, "full-width": "" }, on: { "update:model-value": a.onGranularityInput } }) : t._e(), a.maxRangeMessage ? e(a.BentoAlert, { attrs: { variant: "tip" }, scopedSlots: t._u([{ key: "description", fn: function() {
892
+ return [t._v(" " + t._s(a.maxRangeMessage) + " ")];
893
+ }, proxy: !0 }], null, !1, 1192229622) }) : t._e(), e("div", [e(a.BentoTypography, { staticClass: "b-date-range-picker-calendar__label", attrs: { stronger: "", el: "span" } }, [t._v(" From ")]), e(a.DateTimeInput, { staticClass: "b-date-range-picker-calendar__form-input", attrs: { "date-model-value": a.startDateValue, "date-props": {
894
+ ariaLabel: a.t("dateFrom"),
895
+ type: a.dateInputType,
896
+ description: a.isTouchDevice ? void 0 : a.t(a.dateFormat),
897
+ errorMessage: a.startDateErrorText
898
+ }, "error-message": a.startSharedError, "show-time-input": t.allowTimeInput, "time-model-value": a.dateTextInput.startTime, "time-props": {
899
+ ariaLabel: a.t("timeFrom"),
900
+ errorMessage: a.startSharedError
901
+ } }, on: { "update:date-model-value": a.onStartDateInput, "date:keydown": a.onDateInputKeyDown, "update:time-model-value": a.onStartTimeInput, "time:error": a.onStartTimeError, "time:valid": a.onStartTimeValid } })], 1), e("div", [e(a.BentoTypography, { staticClass: "b-date-range-picker-calendar__label", attrs: { stronger: "", el: "span" } }, [t._v(" To ")]), e(a.DateTimeInput, { staticClass: "b-date-range-picker-calendar__form-input", attrs: { "date-model-value": a.endDateValue, "date-props": {
902
+ ariaLabel: a.t("dateTo"),
903
+ type: a.dateInputType,
904
+ description: a.isTouchDevice ? void 0 : a.t(a.dateFormat),
905
+ errorMessage: a.endDateErrorText
906
+ }, "error-message": a.endSharedError, "show-time-input": t.allowTimeInput, "time-model-value": a.dateTextInput.endTime, "time-props": {
907
+ ariaLabel: a.t("timeTo"),
908
+ errorMessage: a.endSharedError
909
+ } }, on: { "update:date-model-value": a.onEndDateInput, "date:keydown": a.onDateInputKeyDown, "update:time-model-value": a.onEndTimeInput, "time:error": a.onEndTimeError, "time:valid": a.onEndTimeValid } })], 1)], 2), a.hasSlot("actions") ? e("div", [t._t("actions")], 2) : t._e()]), !a.hasNoCalendars && !a.isTouchDevice ? e("div", { staticClass: "b-date-range-picker-calendar__calendars-container", attrs: { "data-testid": "date-range-picker-calendar-calendar-container" } }, [e(a.Calendar, { attrs: { value: a.internalRangeDate, "first-day-of-week": t.firstDayOfWeek, "is-date-disabled": t.isDateDisabled, "max-range": t.maxRange, min: a.computedMinMax.min, max: a.computedMinMax.max, "number-of-months": t.numberOfMonths, "show-end-date-on-open": t.showEndDateOnOpen, granularity: a.selectedGranularity, variant: t.variant, "year-range": t.yearRange, "is-range": "" }, on: { input: a.onDateInput, "start-date-selected": a.onStartDateSelected, "end-date-selected": a.onEndDateSelected } })], 1) : t._e()]);
910
+ }, gt = [], yt = /* @__PURE__ */ Ae(
911
+ vt,
912
+ ft,
913
+ gt,
914
+ !1,
915
+ null,
916
+ "d09e259b"
917
+ );
918
+ const Mt = yt.exports, ht = {
919
+ "de-DE": {
920
+ apply: "Anwenden",
921
+ cancel: "Abbrechen",
922
+ dateRangePicker: "Datumsbereichauswahl {name}",
923
+ invalidDateFormat: "Ungültiges Datumsformat",
924
+ quarter: "Q{quarter} {year}",
925
+ selectDate: "Wählen Sie ein Datum",
926
+ selectDateRange: "Wählen Sie einen Datumsbereich aus",
927
+ selectedDateIsNotAvailable: "Ausgewähltes Datum ist nicht verfügbar"
928
+ },
929
+ "en-GB": {
930
+ apply: "Apply",
931
+ cancel: "Cancel",
932
+ dateRangePicker: "Date range picker {name}",
933
+ invalidDateFormat: "Invalid date format",
934
+ quarter: "Q{quarter} {year}",
935
+ selectDate: "Select a date",
936
+ selectDateRange: "Select a date range",
937
+ selectedDateIsNotAvailable: "Selected date is not available"
938
+ },
939
+ "en-US": {
940
+ apply: "Apply",
941
+ cancel: "Cancel",
942
+ dateRangePicker: "Date range picker {name}",
943
+ invalidDateFormat: "Invalid date format",
944
+ quarter: "Q{quarter} {year}",
945
+ selectDate: "Select a date",
946
+ selectDateRange: "Select a date range",
947
+ selectedDateIsNotAvailable: "Selected date is not available"
948
+ },
949
+ "es-ES": {
950
+ apply: "Aplicar",
951
+ cancel: "Cancelar",
952
+ dateRangePicker: "Selector de intervalos de fechas {name}",
953
+ invalidDateFormat: "Formato de fecha no válido",
954
+ quarter: "T{quarter} {year}",
955
+ selectDate: "Selecciona una fecha",
956
+ selectDateRange: "Selecciona un rango de fechas",
957
+ selectedDateIsNotAvailable: "La fecha seleccionada no está disponible"
958
+ },
959
+ "es-MX": {
960
+ apply: "Aplicar",
961
+ cancel: "Cancelar",
962
+ dateRangePicker: "Selector de intervalos de fechas {name}",
963
+ invalidDateFormat: "Formato de fecha no válido",
964
+ quarter: "T{quarter} {year}",
965
+ selectDate: "Selecciona una fecha",
966
+ selectDateRange: "Selecciona un rango de fechas",
967
+ selectedDateIsNotAvailable: "La fecha seleccionada no está disponible"
968
+ },
969
+ "fr-FR": {
970
+ apply: "Appliquer",
971
+ cancel: "Annuler",
972
+ dateRangePicker: "Sélecteur de plages de dates {name}",
973
+ invalidDateFormat: "Format de date non valide",
974
+ quarter: "T{quarter} {year}",
975
+ selectDate: "Sélectionnez une date",
976
+ selectDateRange: "Sélectionnez une plage de dates",
977
+ selectedDateIsNotAvailable: "La date sélectionnée n’est pas disponible"
978
+ },
979
+ "it-IT": {
980
+ apply: "Applica",
981
+ cancel: "Annulla",
982
+ dateRangePicker: "Selettore intervallo di date {name}",
983
+ invalidDateFormat: "Formato data non valido",
984
+ quarter: "Q{quarter} {year}",
985
+ selectDate: "Seleziona una data",
986
+ selectDateRange: "Seleziona un intervallo di date",
987
+ selectedDateIsNotAvailable: "La data selezionata non è disponibile"
988
+ },
989
+ "ja-JP": {
990
+ apply: "適用",
991
+ cancel: "キャンセル",
992
+ dateRangePicker: "日付範囲ピッカー {name}",
993
+ invalidDateFormat: "無効な日付形式",
994
+ quarter: "{year}年第{quarter}四半期",
995
+ selectDate: "日付を選択",
996
+ selectDateRange: "日付範囲を選択",
997
+ selectedDateIsNotAvailable: "選択した日付は利用できません"
998
+ },
999
+ "pt-BR": {
1000
+ apply: "Aplicar",
1001
+ cancel: "Cancelar",
1002
+ dateRangePicker: "Seletor de intervalo de datas {name}",
1003
+ invalidDateFormat: "Formato de data inválido",
1004
+ quarter: "{quarter}º trimestre de {year}",
1005
+ selectDate: "Selecione uma data",
1006
+ selectDateRange: "Selecione um intervalo de datas",
1007
+ selectedDateIsNotAvailable: "A data selecionada não está disponível"
1008
+ },
1009
+ "zh-CN": {
1010
+ apply: "应用",
1011
+ cancel: "取消",
1012
+ dateRangePicker: "日期范围选择器 {name}",
1013
+ invalidDateFormat: "日期格式无效",
1014
+ quarter: "{year} {quarter} 季度",
1015
+ selectDate: "选择日期",
1016
+ selectDateRange: "选择日期范围",
1017
+ selectedDateIsNotAvailable: "所选日期不可用"
1018
+ }
1019
+ }, Tt = ({
1020
+ datePickerValue: o,
1021
+ isDateIncorrect: t,
1022
+ quickSelectRanges: e,
1023
+ isMonthVariant: a,
1024
+ withTimeInput: l,
1025
+ placeholder: D
1026
+ }) => {
1027
+ const { locale: f, t: h } = ke(), { dateToInputDateString: x } = Ie(), L = (p) => !!p && !isNaN(p.getTime()), M = De({
1028
+ startDate: null,
1029
+ endDate: null,
1030
+ startTime: null,
1031
+ endTime: null
1032
+ });
1033
+ return me(
1034
+ o,
1035
+ (p) => {
1036
+ M.startDate = x(p == null ? void 0 : p.startDate), M.endDate = x(p == null ? void 0 : p.endDate), M.startTime = F(p == null ? void 0 : p.startDate), M.endTime = F(p == null ? void 0 : p.endDate);
1037
+ },
1038
+ { immediate: !0 }
1039
+ ), {
1040
+ // Values
1041
+ dateDisplayValue: m(() => {
1042
+ var j;
1043
+ if (t.value)
1044
+ return `${M.startDate || ""} - ${M.endDate || ""}`;
1045
+ if (!o.value || !o.value.startDate && !o.value.endDate)
1046
+ return (D == null ? void 0 : D.value) || h("selectDateRange");
1047
+ if ((j = e.value) != null && j.length) {
1048
+ const A = e.value.find(({ value: B }) => {
1049
+ var g;
1050
+ return B === ((g = o.value) == null ? void 0 : g.range);
1051
+ });
1052
+ if (A)
1053
+ return A.label;
1054
+ }
1055
+ if (o.value.granularity === "quarterly") {
1056
+ const { startDate: A, endDate: B } = o.value, g = h("quarter", { quarter: $e(A), year: Ze(A) });
1057
+ if (nt(A, B))
1058
+ return g;
1059
+ const W = h("quarter", { quarter: $e(B), year: Ze(B) });
1060
+ return `${g} - ${W}`;
1061
+ }
1062
+ if (!L(o.value.startDate) || !L(o.value.endDate))
1063
+ return `${M.startDate || ""} - ${M.endDate || ""}`;
1064
+ let p = a != null && a.value ? { month: "long", year: "numeric" } : { month: "short", day: "2-digit", year: "numeric" };
1065
+ return l.value && (p = {
1066
+ ...p,
1067
+ hour: "numeric",
1068
+ minute: "numeric",
1069
+ second: "numeric",
1070
+ hour12: !1
1071
+ }), Wa(f.value, p).formatRange(
1072
+ o.value.startDate,
1073
+ o.value.endDate
1074
+ );
1075
+ }),
1076
+ textInputDisplayValue: M,
1077
+ // Methods
1078
+ formatTextInputDisplayValue: () => ""
1079
+ };
1080
+ }, Rt = {
1081
+ i18n: { messages: ht },
1082
+ name: "bento-date-range-picker",
1083
+ model: { prop: "modelValue" }
1084
+ }, bt = /* @__PURE__ */ _e({
1085
+ ...Rt,
1086
+ props: {
1087
+ description: { default: void 0 },
1088
+ disabled: { type: Boolean, default: !1 },
1089
+ errorMessage: { default: null },
1090
+ label: { default: void 0 },
1091
+ optional: { type: Boolean, default: !1 },
1092
+ placeholder: { default: null },
1093
+ readonly: { type: Boolean, default: !1 },
1094
+ required: { type: Boolean, default: !1 },
1095
+ tooltipText: { default: null },
1096
+ allowTimeInput: { type: Boolean },
1097
+ firstDayOfWeek: { default: void 0 },
1098
+ granularities: null,
1099
+ isDateDisabled: { default: void 0 },
1100
+ showEndDateOnOpen: { type: Boolean, default: !1 },
1101
+ quickSelectRanges: { default: void 0 },
1102
+ maxRange: { default: null },
1103
+ min: { default: null },
1104
+ max: { default: null },
1105
+ numberOfMonths: { default: void 0 },
1106
+ modelValue: { default: null },
1107
+ value: { default: null },
1108
+ variant: { default: void 0 },
1109
+ yearRange: { default: void 0 },
1110
+ hasActions: { type: Boolean, default: !1 }
1111
+ },
1112
+ emits: ["update:model-value", "input"],
1113
+ setup(o, { emit: t }) {
1114
+ const e = o, a = ba(), { t: l } = ke(), { dateToInputDateString: D } = Ie(), f = te("bento-date-range-picker-container"), h = te("bento-date-range-picker-label"), x = te("bento-date-range-picker-description"), L = te("bento-date-range-picker-error"), M = te("bento-date-range-picker-date-error"), re = m(() => e.label || l("dateRangePicker", { name: f })), { resolvedFirstDayOfWeek: X } = wa(Te(e, "firstDayOfWeek")), p = Ya({
1115
+ none: 0,
1116
+ one: 710,
1117
+ // width of date range picker with one panes
1118
+ two: 1030,
1119
+ // width of date range picker with two panes
1120
+ three: 1290
1121
+ // width of date range picker with three panes
1122
+ }), j = m(() => {
1123
+ const u = p.active().value, s = {
1124
+ none: 0,
1125
+ one: 1,
1126
+ two: 2
1127
+ };
1128
+ if (u in s) {
1129
+ const K = s[u];
1130
+ return e.numberOfMonths === void 0 ? K : Math.min(e.numberOfMonths, K);
1131
+ }
1132
+ return e.numberOfMonths;
1133
+ }), A = m(() => (e == null ? void 0 : e.quickSelectRanges) && e.quickSelectRanges.map((u) => {
1134
+ const s = u.data.endDate ? void 0 : new Date(Date.now()).getTime() - u.data.startDate.getTime();
1135
+ return {
1136
+ ...u,
1137
+ data: {
1138
+ ...u.data,
1139
+ // Adding timeDifference to calculate an up-to-date endDate on range selection
1140
+ timeDifference: s
1141
+ }
1142
+ };
1143
+ })), B = m(() => e.label ? h : (a == null ? void 0 : a["aria-labelledby"]) ?? null), g = N(!1), W = N(null), w = N(!1), { isReadOnly: r } = Ka(Te(e, "readonly")), { emitValue: S } = Xa(t);
1144
+ me(
1145
+ () => e.disabled,
1146
+ () => {
1147
+ e.disabled && w.value && (w.value = !1);
1148
+ }
1149
+ );
1150
+ const se = m(() => e.modelValue || e.value), Q = m(() => e.hasActions ? !E.value && g.value : g.value), ve = m(() => ({
1151
+ "b-date-range-picker__description--error": !!e.errorMessage || Q.value
1152
+ })), Z = m(() => e.variant === "month"), Y = m(() => e.allowTimeInput && e.variant !== "month"), { dateDisplayValue: V, textInputDisplayValue: T, formatTextInputDisplayValue: oe } = Tt({
1153
+ datePickerValue: se,
1154
+ isDateIncorrect: g,
1155
+ quickSelectRanges: A,
1156
+ isMonthVariant: Z,
1157
+ withTimeInput: Y,
1158
+ placeholder: Te(e, "placeholder")
1159
+ }), le = m(
1160
+ () => `${e.description ? x : ""} ${e.errorMessage ? L : ""} ${g.value ? M : ""}`.trim() || null
1161
+ ), $ = () => {
1162
+ w.value = !1;
1163
+ }, ie = () => {
1164
+ w.value = !0;
1165
+ }, J = N(V.value), H = N(
1166
+ // textInputDisplayValue is a reactive object
1167
+ structuredClone(Ye(T))
1168
+ ), q = N(e.modelValue ?? e.value), E = N(!0), ue = m(
1169
+ () => e.hasActions ? H.value : T
1170
+ ), ee = m(
1171
+ () => e.hasActions ? J.value : V.value
1172
+ );
1173
+ aa(() => {
1174
+ if (e.hasActions || Qe(
1175
+ 'BentoDateRangePicker "hasActions" property',
1176
+ `Set the BentoDateRangePicker "hasActions" property true which will display the "Apply" and "Cancel" buttons.
1177
+ This will be the default behavior in the v2 and "hasActions" will be removed.`,
1178
+ "2.0.0"
1179
+ ), e.value && Qe(
1180
+ 'BentoDateRangePicker "value" property',
1181
+ 'The use of "value" prop in "BentoDateRangePicker" is no longer supported. Use the "v-model" or "model-value" property instead.',
1182
+ "2.0.0"
1183
+ ), e.granularities && e.variant !== "month" && e.granularities.find(({ type: u }) => u === "quarterly"))
1184
+ throw new Error('Quarterly granularity is only supported by BentoDateRangePicker with variant: "month"');
1185
+ }), me([() => e.value, () => e.modelValue], () => {
1186
+ J.value = V.value, H.value = structuredClone(Ye(T));
1187
+ });
1188
+ const k = m(() => [
1189
+ {
1190
+ title: l("apply"),
1191
+ event: () => {
1192
+ S(q.value), $(), E.value = !0;
1193
+ },
1194
+ disabled: E.value
1195
+ },
1196
+ {
1197
+ title: l("cancel"),
1198
+ event: $
1199
+ }
1200
+ ]);
1201
+ return me(q, (u) => {
1202
+ if (e.hasActions) {
1203
+ E.value = g.value;
1204
+ return;
1205
+ }
1206
+ S(u);
1207
+ }), { __sfc: !0, emit: t, props: e, attrs: a, t: l, dateToInputDateString: D, datePickerContainerId: f, labelId: h, descriptionId: x, errorId: L, dateErrorId: M, popoverAriaLabel: re, resolvedFirstDayOfWeek: X, breakpoints: p, computedNumberOfMonths: j, adjustedQuickSelectRanges: A, dropdownInputAriaLabelledBy: B, isDateIncorrect: g, inputContainerRef: W, isDateRangePickerOpen: w, isReadOnly: r, emitValue: S, internalModelValue: se, shouldDisplayError: Q, descriptionConditionalClasses: ve, isMonthVariant: Z, withTimeInput: Y, dateDisplayValue: V, textInputDisplayValue: T, formatTextInputDisplayValue: oe, ariaDescribedBy: le, closeDateRangePicker: $, openDateRangePicker: ie, localDateDisplayValue: J, localTextInputDisplayValue: H, selectedDate: q, isApplyDisabled: E, displayedTextInputValue: ue, displayedDateValue: ee, rangePickerButtonActions: k, onDateRangePickerInput: (u) => {
1208
+ g.value = !1, T.startDate = D(u.startDate), T.endDate = D(u.endDate), T.startTime = F(u.startDate), T.endTime = F(u.endDate), q.value = u;
1209
+ }, clearDateRangePickerValue: async () => {
1210
+ g.value && (g.value = !1), q.value = null;
1211
+ }, onEnterPressedOverInput: () => {
1212
+ if (!w.value) {
1213
+ w.value = !0;
1214
+ return;
1215
+ }
1216
+ g.value || (w.value = !1);
1217
+ }, onDateRangePickerFormDateInputUpdate: (u) => {
1218
+ g.value = !1, u.startTime && (T.startTime = u.startTime), u.endTime && (T.endTime = u.endTime);
1219
+ }, onDateRangePickerError: (u) => {
1220
+ g.value = !0, T.startDate = u.startDate, T.endDate = u.endDate, q.value = { startDate: null, endDate: null };
1221
+ }, onRangeSelectorInput: (u) => {
1222
+ u && (T.startDate = D(u.startDate), T.endDate = D(u.endDate), T.startTime = F(u.startDate), T.endTime = F(u.endDate), q.value = u);
1223
+ }, BentoButtonActions: Ia, BentoButtonActionsLayout: tt, BentoDivider: _a, BentoPopover: ka, BentoTypography: ta, DateRangePickerCalendar: Mt, DropdownInputDefault: Ea, ErrorMessage: at, FieldLabel: et, vBentoClickOutsideDirective: Za };
1224
+ }
1225
+ });
1226
+ var Yt = function() {
1227
+ var t = this, e = t._self._c, a = t._self._setupProxy;
1228
+ return e("div", { directives: [{ name: "bento-click-outside-directive", rawName: "v-bento-click-outside-directive", value: a.closeDateRangePicker, expression: "closeDateRangePicker" }], staticClass: "b-date-range-picker" }, [t.label ? e(a.FieldLabel, { attrs: { id: a.labelId, label: t.label, "tooltip-text": t.tooltipText, optional: t.optional, required: t.required } }) : t._e(), e("div", { on: { keydown: function(l) {
1229
+ return !l.type.indexOf("key") && t._k(l.keyCode, "enter", 13, l.key, "Enter") ? null : a.onEnterPressedOverInput.apply(null, arguments);
1230
+ } } }, [e(a.DropdownInputDefault, { ref: "inputContainerRef", attrs: { "always-combobox-is-input": "", ariaControls: a.datePickerContainerId, ariaExpanded: a.isDateRangePickerOpen, "aria-labelledby": a.dropdownInputAriaLabelledBy, "aria-describedby": a.ariaDescribedBy, "aria-required": t.required, disabled: t.disabled, "is-invalid": !!t.errorMessage || a.shouldDisplayError, open: a.isDateRangePickerOpen, "display-value": a.displayedDateValue, readonly: a.isReadOnly }, on: { open: a.openDateRangePicker, clear: a.clearDateRangePickerValue, close: a.closeDateRangePicker } })], 1), a.shouldDisplayError ? e(a.ErrorMessage, { staticClass: "b-date-range-picker__error-message", attrs: { id: a.dateErrorId, "error-message": a.t("invalidDateFormat") } }) : t._e(), t.errorMessage ? e(a.ErrorMessage, { staticClass: "b-date-range-picker__error-message", attrs: { id: a.errorId, "error-message": t.errorMessage } }) : t._e(), t.description ? e(a.BentoTypography, { staticClass: "b-date-range-picker__description", class: a.descriptionConditionalClasses, attrs: { id: a.descriptionId, el: "span" } }, [t._v(" " + t._s(t.description) + " ")]) : t._e(), a.inputContainerRef ? e(a.BentoPopover, { staticClass: "b-date-range-picker__container", attrs: { id: a.datePickerContainerId, open: a.isDateRangePickerOpen, "target-element": a.inputContainerRef, "aria-label": a.popoverAriaLabel, position: "bottom-start", "without-space": "", "fit-content": "", "trap-all": "", "overflow-visible": "" }, nativeOn: { keydown: function(l) {
1231
+ return !l.type.indexOf("key") && t._k(l.keyCode, "esc", 27, l.key, ["Esc", "Escape"]) ? null : a.closeDateRangePicker.apply(null, arguments);
1232
+ } } }, [e(a.DateRangePickerCalendar, { attrs: { "allow-time-input": a.withTimeInput, "quick-select-ranges": a.adjustedQuickSelectRanges, value: a.internalModelValue, "first-day-of-week": a.resolvedFirstDayOfWeek, granularities: t.granularities, "is-date-disabled": t.isDateDisabled, "max-range": t.maxRange, min: t.min, max: t.max, "number-of-months": a.computedNumberOfMonths, "show-end-date-on-open": t.showEndDateOnOpen, "date-form-data": a.displayedTextInputValue, variant: t.variant, "year-range": t.yearRange }, on: { "custom-range": a.onRangeSelectorInput, input: a.onDateRangePickerInput, error: a.onDateRangePickerError, "form-date": a.onDateRangePickerFormDateInputUpdate }, scopedSlots: t._u([t.hasActions ? { key: "actions", fn: function() {
1233
+ return [e(a.BentoDivider), e("div", { staticClass: "b-date-range-picker__footer" }, [e(a.BentoButtonActions, { attrs: { actions: a.rangePickerButtonActions, layout: a.BentoButtonActionsLayout.SPACE_BETWEEN } })], 1)];
1234
+ }, proxy: !0 } : null], null, !0) })], 1) : t._e()], 1);
1235
+ }, _t = [], kt = /* @__PURE__ */ Ae(
1236
+ bt,
1237
+ Yt,
1238
+ _t,
1239
+ !1,
1240
+ null,
1241
+ "e2669ac4"
1242
+ );
1243
+ const rn = kt.exports;
1244
+ export {
1245
+ rn as B,
1246
+ Mt as D,
1247
+ rt as a,
1248
+ Re as i
1249
+ };
1250
+ //# sourceMappingURL=date-range-picker.Bczgdu5X.js.map