@adyen/bento-vue2 1.62.0 → 1.63.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 (145) hide show
  1. package/dist/@types/index.d.ts +181 -235
  2. package/dist/accordion.js +1 -1
  3. package/dist/action-bar.js +1 -1
  4. package/dist/assets/accordion-item.css +1 -1
  5. package/dist/assets/action-bar.css +1 -1
  6. package/dist/assets/base-modal.css +1 -1
  7. package/dist/assets/card.css +1 -1
  8. package/dist/assets/checkbox-input.css +1 -1
  9. package/dist/assets/data-grid.css +1 -1
  10. package/dist/assets/date-range-picker.css +1 -1
  11. package/dist/assets/dialog-page.css +1 -1
  12. package/dist/assets/file-uploader.css +1 -1
  13. package/dist/assets/header-with-views.css +1 -1
  14. package/dist/assets/inspector.css +1 -1
  15. package/dist/assets/listbox-option-tag.css +1 -1
  16. package/dist/assets/menu.css +1 -1
  17. package/dist/assets/modal-fullscreen.css +1 -1
  18. package/dist/assets/popover.css +1 -1
  19. package/dist/assets/sidepanel.css +1 -1
  20. package/dist/assets/use-cached-selected-values.css +1 -1
  21. package/dist/card.js +1 -1
  22. package/dist/checkbox.js +3 -3
  23. package/dist/chunks/{accordion-item.D1t0oHlP.js → accordion-item.BNtdoVto.js} +9 -8
  24. package/dist/chunks/{accordion-item.D1t0oHlP.js.map → accordion-item.BNtdoVto.js.map} +1 -1
  25. package/dist/chunks/{action-bar.whU1em8H.js → action-bar.Dsp7iRxz.js} +2 -2
  26. package/dist/chunks/{action-bar.whU1em8H.js.map → action-bar.Dsp7iRxz.js.map} +1 -1
  27. package/dist/chunks/{button-actions-with-menu.RoaQFPKT.js → button-actions-with-menu.CtW_16tY.js} +2 -2
  28. package/dist/chunks/{button-actions-with-menu.RoaQFPKT.js.map → button-actions-with-menu.CtW_16tY.js.map} +1 -1
  29. package/dist/chunks/{calendar.DoOFNX-Z.js → calendar.DbTC35rM.js} +2 -2
  30. package/dist/chunks/{calendar.DoOFNX-Z.js.map → calendar.DbTC35rM.js.map} +1 -1
  31. package/dist/chunks/card.CypgT0Ji.js +136 -0
  32. package/dist/chunks/card.CypgT0Ji.js.map +1 -0
  33. package/dist/chunks/{checkbox-group.B0IGYf1q.js → checkbox-group.6y92U6AF.js} +2 -2
  34. package/dist/chunks/{checkbox-group.B0IGYf1q.js.map → checkbox-group.6y92U6AF.js.map} +1 -1
  35. package/dist/chunks/checkbox-input.CNWigbX4.js +117 -0
  36. package/dist/chunks/checkbox-input.CNWigbX4.js.map +1 -0
  37. package/dist/chunks/{checkbox.DkCukYh0.js → checkbox.C9nJVvMq.js} +9 -8
  38. package/dist/chunks/{checkbox.DkCukYh0.js.map → checkbox.C9nJVvMq.js.map} +1 -1
  39. package/dist/chunks/chevron-down.eYtgv5ly.js +24 -0
  40. package/dist/chunks/chevron-down.eYtgv5ly.js.map +1 -0
  41. package/dist/chunks/{chevron-left.BS24hEFa.js → chevron-right.C--ZOC9j.js} +5 -5
  42. package/dist/chunks/chevron-right.C--ZOC9j.js.map +1 -0
  43. package/dist/chunks/chevron-up.d8cwIlA_.js +24 -0
  44. package/dist/chunks/chevron-up.d8cwIlA_.js.map +1 -0
  45. package/dist/chunks/{code-snippet.n93oYvH4.js → code-snippet.CBU8Tlbs.js} +2 -2
  46. package/dist/chunks/{code-snippet.n93oYvH4.js.map → code-snippet.CBU8Tlbs.js.map} +1 -1
  47. package/dist/chunks/{dashboard-section.BEw-n-XQ.js → dashboard-section.CspNW0CA.js} +3 -3
  48. package/dist/chunks/{dashboard-section.BEw-n-XQ.js.map → dashboard-section.CspNW0CA.js.map} +1 -1
  49. package/dist/chunks/{data-grid-template.DGFmCUII.js → data-grid-template.BhzgqkZp.js} +3 -3
  50. package/dist/chunks/{data-grid-template.DGFmCUII.js.map → data-grid-template.BhzgqkZp.js.map} +1 -1
  51. package/dist/chunks/{data-grid.BcGRXt9C.js → data-grid.BfsBhYpW.js} +451 -452
  52. package/dist/chunks/data-grid.BfsBhYpW.js.map +1 -0
  53. package/dist/chunks/{date-picker.Dc_HdQnr.js → date-picker.CPQ6WLZE.js} +3 -3
  54. package/dist/chunks/{date-picker.Dc_HdQnr.js.map → date-picker.CPQ6WLZE.js.map} +1 -1
  55. package/dist/chunks/date-range-picker.CNB28UaM.js +1005 -0
  56. package/dist/chunks/date-range-picker.CNB28UaM.js.map +1 -0
  57. package/dist/chunks/{dropdown-default-textbox.7PMxHqoa.js → dropdown-default-textbox.BNuuA4ES.js} +15 -14
  58. package/dist/chunks/{dropdown-default-textbox.7PMxHqoa.js.map → dropdown-default-textbox.BNuuA4ES.js.map} +1 -1
  59. package/dist/chunks/{dropdown-tag.qKSu6xYY.js → dropdown-tag.DmVsDrL_.js} +3 -3
  60. package/dist/chunks/{dropdown-tag.qKSu6xYY.js.map → dropdown-tag.DmVsDrL_.js.map} +1 -1
  61. package/dist/chunks/{dropdown.BNLPzKbr.js → dropdown.B_PWXFtT.js} +3 -3
  62. package/dist/chunks/{dropdown.BNLPzKbr.js.map → dropdown.B_PWXFtT.js.map} +1 -1
  63. package/dist/chunks/es6.n1ewaW31.js.map +1 -1
  64. package/dist/chunks/{filter-bar.TiqZofNt.js → filter-bar.D6HeYnzZ.js} +15 -14
  65. package/dist/chunks/{filter-bar.TiqZofNt.js.map → filter-bar.D6HeYnzZ.js.map} +1 -1
  66. package/dist/chunks/{fixed-scroller.Ctz5dFqz.js → fixed-scroller.XN-jvWqb.js} +12 -12
  67. package/dist/chunks/fixed-scroller.XN-jvWqb.js.map +1 -0
  68. package/dist/chunks/{header-with-views.MFHmiIXb.js → header-with-views.Dkn8IDew.js} +270 -270
  69. package/dist/chunks/header-with-views.Dkn8IDew.js.map +1 -0
  70. package/dist/chunks/{header.B1PrBQG0.js → header.DNzQO7u-.js} +2 -2
  71. package/dist/chunks/{header.B1PrBQG0.js.map → header.DNzQO7u-.js.map} +1 -1
  72. package/dist/chunks/{input-field-password.BlX3Icgt.js → input-field-password.CY3eRVpe.js} +3 -3
  73. package/dist/chunks/{input-field-password.BlX3Icgt.js.map → input-field-password.CY3eRVpe.js.map} +1 -1
  74. package/dist/chunks/{input-field-phone-number.Ofvi2A48.js → input-field-phone-number.CN5qZ0VL.js} +3 -3
  75. package/dist/chunks/{input-field-phone-number.Ofvi2A48.js.map → input-field-phone-number.CN5qZ0VL.js.map} +1 -1
  76. package/dist/chunks/{input-field.Dck9dAeK.js → input-field.DKhsSYF8.js} +2 -2
  77. package/dist/chunks/{input-field.Dck9dAeK.js.map → input-field.DKhsSYF8.js.map} +1 -1
  78. package/dist/chunks/{listbox-option-tag.EzSkn_lM.js → listbox-option-tag.DFmB_TuD.js} +9 -9
  79. package/dist/chunks/listbox-option-tag.DFmB_TuD.js.map +1 -0
  80. package/dist/chunks/menu.W_kuhRKI.js +514 -0
  81. package/dist/chunks/menu.W_kuhRKI.js.map +1 -0
  82. package/dist/chunks/minus-small.DJacLGTw.js +27 -0
  83. package/dist/chunks/minus-small.DJacLGTw.js.map +1 -0
  84. package/dist/chunks/{pagination.BvhUFgsT.js → pagination.DvP8FqiW.js} +2 -2
  85. package/dist/chunks/{pagination.BvhUFgsT.js.map → pagination.DvP8FqiW.js.map} +1 -1
  86. package/dist/chunks/{rich-text-editor.BTJpOiYL.js → rich-text-editor.aSOSl4Rz.js} +2 -2
  87. package/dist/chunks/{rich-text-editor.BTJpOiYL.js.map → rich-text-editor.aSOSl4Rz.js.map} +1 -1
  88. package/dist/chunks/{search-bar.Ch1dLZAb.js → search-bar.Sh4A8UId.js} +3 -3
  89. package/dist/chunks/{search-bar.Ch1dLZAb.js.map → search-bar.Sh4A8UId.js.map} +1 -1
  90. package/dist/chunks/{secondary-nav.DBssP9fQ.js → secondary-nav.BFtGx_IN.js} +2 -2
  91. package/dist/chunks/{secondary-nav.DBssP9fQ.js.map → secondary-nav.BFtGx_IN.js.map} +1 -1
  92. package/dist/chunks/{selection-card-group.CjFm-cAm.js → selection-card-group.CrWy35QU.js} +2 -2
  93. package/dist/chunks/{selection-card-group.CjFm-cAm.js.map → selection-card-group.CrWy35QU.js.map} +1 -1
  94. package/dist/chunks/{tabs.zkTl2PQR.js → tabs.Dx6teJGW.js} +2 -2
  95. package/dist/chunks/{tabs.zkTl2PQR.js.map → tabs.Dx6teJGW.js.map} +1 -1
  96. package/dist/chunks/{tutorial.C9PYfB4z.js → tutorial.BNZh6N3h.js} +2 -2
  97. package/dist/chunks/{tutorial.C9PYfB4z.js.map → tutorial.BNZh6N3h.js.map} +1 -1
  98. package/dist/chunks/{use-cached-selected-values.Da6xbfzO.js → use-cached-selected-values.CDBmVxYM.js} +514 -481
  99. package/dist/chunks/use-cached-selected-values.CDBmVxYM.js.map +1 -0
  100. package/dist/code-snippet.js +1 -1
  101. package/dist/dashboard-template.js +1 -1
  102. package/dist/data-grid-template.js +1 -1
  103. package/dist/data-grid.js +1 -1
  104. package/dist/date-picker.js +2 -2
  105. package/dist/date-range-picker.js +2 -2
  106. package/dist/dropdown.js +4 -4
  107. package/dist/filter-bar.js +1 -1
  108. package/dist/header-with-views.js +1 -1
  109. package/dist/header.js +1 -1
  110. package/dist/index.js +31 -31
  111. package/dist/input-field-password.js +1 -1
  112. package/dist/input-field-phone-number.js +1 -1
  113. package/dist/input-field.js +1 -1
  114. package/dist/internal.js +5 -5
  115. package/dist/menu.js +1 -1
  116. package/dist/pagination.js +1 -1
  117. package/dist/rich-text-editor.js +1 -1
  118. package/dist/search-bar.js +2 -2
  119. package/dist/secondary-nav.js +1 -1
  120. package/dist/selection-card.js +1 -1
  121. package/dist/styles/bento-dark.css +4 -0
  122. package/dist/styles/bento-light.css +4 -0
  123. package/dist/styles/bento.css +4 -0
  124. package/dist/styles/legacy.css +4 -0
  125. package/dist/styles/styleguide.css +4 -0
  126. package/dist/tabs.js +1 -1
  127. package/dist/tutorial.js +1 -1
  128. package/dist/web-types.json +176 -120
  129. package/package.json +7 -7
  130. package/dist/chunks/card.Cu6MicVI.js +0 -123
  131. package/dist/chunks/card.Cu6MicVI.js.map +0 -1
  132. package/dist/chunks/checkbox-input.B-4Rw5mp.js +0 -137
  133. package/dist/chunks/checkbox-input.B-4Rw5mp.js.map +0 -1
  134. package/dist/chunks/chevron-left.BS24hEFa.js.map +0 -1
  135. package/dist/chunks/chevron-up.CHK1E4p9.js +0 -43
  136. package/dist/chunks/chevron-up.CHK1E4p9.js.map +0 -1
  137. package/dist/chunks/data-grid.BcGRXt9C.js.map +0 -1
  138. package/dist/chunks/date-range-picker.D6xJAHoB.js +0 -977
  139. package/dist/chunks/date-range-picker.D6xJAHoB.js.map +0 -1
  140. package/dist/chunks/fixed-scroller.Ctz5dFqz.js.map +0 -1
  141. package/dist/chunks/header-with-views.MFHmiIXb.js.map +0 -1
  142. package/dist/chunks/listbox-option-tag.EzSkn_lM.js.map +0 -1
  143. package/dist/chunks/menu.CTVbNfuo.js +0 -601
  144. package/dist/chunks/menu.CTVbNfuo.js.map +0 -1
  145. package/dist/chunks/use-cached-selected-values.Da6xbfzO.js.map +0 -1
@@ -0,0 +1,1005 @@
1
+ import { reactive as fe, defineComponent as Be, ref as h, computed as T, onMounted as qe, toRaw as ge, toRef as Se, watch as pe } from "vue";
2
+ import { B as nt } from "./divider.Cc4JFWG_.js";
3
+ import { B as rt } from "./popover.B05xkQ4e.js";
4
+ import { B as Le, d as st } from "./typography.J1v_SPG3.js";
5
+ import { D as it } from "./dropdown-default-textbox.BNuuA4ES.js";
6
+ import { r as O, t as j, g as ye } from "./get-date-locale.BN8xEjY0.js";
7
+ import { g as se } from "./generate-uid.NJ8tVoha.js";
8
+ import { u as Te } from "./i18n.BQkEbtPM.js";
9
+ import { t as oe, f as ae } from "./date.dYFFEunA.js";
10
+ import { e as Ye, f as ie, i as B, g as Z, h as ke, j as ot, k as Ee, l as lt, s as he, m as ut, n as Oe, a as $, u as dt } from "./calendar.DbTC35rM.js";
11
+ import { f as we, v as ct, D as I } from "./date-input.BqBdAO1E.js";
12
+ import { u as Dt } from "./use-form-layout-loading.D3lALhtC.js";
13
+ import "./index.Cl4_42j5.js";
14
+ import { B as mt } from "./input-field.DKhsSYF8.js";
15
+ import { B as ft } from "./dropdown.B_PWXFtT.js";
16
+ import { B as vt } from "./segmented-control.B-uxKqMN.js";
17
+ import { d as ce } from "./debounce.DUTu11PS.js";
18
+ import { u as pt } from "./use-has-slot.C9lQZ6nz.js";
19
+ import { e as C, a as Me } from "./index.BDuTpjD8.js";
20
+ import { n as Qe } from "./_plugin-vue2_normalizer.CeySl7Fu.js";
21
+ import { B as gt } from "./directive.Cbdox5VL.js";
22
+ import { F as yt, E as Tt } from "./error-message.BeExHHgv.js";
23
+ import { B as _t, c as Rt } from "./button-actions._OIvTdKt.js";
24
+ import "../assets/date-range-picker.css";
25
+ function $e(t, e) {
26
+ O(2, arguments);
27
+ var n = oe(e), l = n * 3;
28
+ return Ye(t, l);
29
+ }
30
+ function Ce(t) {
31
+ O(1, arguments);
32
+ var e = j(t), n = Math.floor(e.getMonth() / 3) + 1;
33
+ return n;
34
+ }
35
+ function Ae(t) {
36
+ return O(1, arguments), j(t).getFullYear();
37
+ }
38
+ function De(t, e) {
39
+ O(2, arguments);
40
+ var n = j(t), l = j(e);
41
+ return n.getTime() === l.getTime();
42
+ }
43
+ function bt(t, e) {
44
+ O(2, arguments);
45
+ var n = ie(t), l = ie(e);
46
+ return n.getTime() === l.getTime();
47
+ }
48
+ function xe(t) {
49
+ O(1, arguments);
50
+ var e = j(t);
51
+ return e.setMilliseconds(0), e;
52
+ }
53
+ function Ue(t, e) {
54
+ O(2, arguments);
55
+ var n = xe(t), l = xe(e);
56
+ return n.getTime() === l.getTime();
57
+ }
58
+ function It(t) {
59
+ return O(1, arguments), B(t, Date.now());
60
+ }
61
+ function St(t, e) {
62
+ O(2, arguments);
63
+ var n = j(t), l = oe(e);
64
+ return n.setHours(l), n;
65
+ }
66
+ function kt(t, e) {
67
+ O(2, arguments);
68
+ var n = j(t), l = oe(e);
69
+ return n.setMinutes(l), n;
70
+ }
71
+ function Et(t, e) {
72
+ O(2, arguments);
73
+ var n = j(t), l = oe(e);
74
+ return n.setSeconds(l), n;
75
+ }
76
+ function ht(t, e) {
77
+ O(2, arguments);
78
+ var n = oe(e);
79
+ return $e(t, -n);
80
+ }
81
+ function X(t) {
82
+ if (t == null)
83
+ return Z(/* @__PURE__ */ new Date());
84
+ const [e, n, l] = t.split("-").map((o) => parseInt(o, 10));
85
+ return new Date(e, n - 1, l);
86
+ }
87
+ const Ot = ({
88
+ firstDayOfWeek: t,
89
+ min: e,
90
+ max: n
91
+ }) => ({ getGranularCalendarLimits: (o) => {
92
+ let D = Z(e), f = C(n);
93
+ if ((o == null ? void 0 : o.type) === "weekly") {
94
+ if (o.earliest)
95
+ D = Z(o.earliest);
96
+ else {
97
+ const y = ke(D, { weekStartsOn: t });
98
+ B(D, y) || (D = Z(ot(Ee(D, { weekStartsOn: t }), 1)));
99
+ }
100
+ if (o.latest)
101
+ f = C(o.latest);
102
+ else {
103
+ const y = Ee(f, { weekStartsOn: t });
104
+ B(f, y) || (f = C(lt(ke(f, { weekStartsOn: t }), 1)));
105
+ }
106
+ }
107
+ if ((o == null ? void 0 : o.type) === "monthly") {
108
+ if (o.earliest)
109
+ D = Z(o.earliest);
110
+ else {
111
+ const y = he(D);
112
+ B(D, y) || (D = he(Ye(D, 1)));
113
+ }
114
+ if (o.latest)
115
+ f = C(o.latest);
116
+ else {
117
+ const y = Me(f);
118
+ B(f, y) || (f = Me(ut(f, 1)));
119
+ }
120
+ }
121
+ if ((o == null ? void 0 : o.type) === "quarterly") {
122
+ if (o.earliest)
123
+ D = ie(o.earliest);
124
+ else {
125
+ const y = ie(D);
126
+ B(D, y) || (D = ie($e(D, 1)));
127
+ }
128
+ if (o.latest)
129
+ f = C(o.latest);
130
+ else {
131
+ const y = Oe(f);
132
+ B(f, y) || (f = Oe(ht(f, 1)));
133
+ }
134
+ }
135
+ return { min: D, max: f };
136
+ } }), wt = () => {
137
+ const t = fe({
138
+ daily: null,
139
+ weekly: null,
140
+ monthly: null,
141
+ quarterly: null
142
+ });
143
+ return {
144
+ savedRanges: t,
145
+ saveRange: (l, o) => {
146
+ t[l] = o;
147
+ },
148
+ resetSavedRanges: () => {
149
+ t.daily = null, t.weekly = null, t.monthly = null, t.quarterly = null;
150
+ }
151
+ };
152
+ };
153
+ var p = /* @__PURE__ */ ((t) => (t.CUSTOM_RANGE = "custom-range", t.INPUT = "input", t.ERROR = "error", t.FORM_DATE = "form-date", t.START_DATE_SELECTED = "start-date-selected", t))(p || {});
154
+ const Mt = /[\d]/, Ct = /^\d{2}$/, At = /^\d{2}:\d{2}$/, xt = (t) => {
155
+ const { selectionStart: e } = t.target, n = ["Backspace", "Tab", "ArrowLeft", "ArrowRight"], l = Mt.test(t.key) || n.includes(t.key), o = [1, 2, 4, 5].includes(e) && t.key === ":";
156
+ !l && !o && t.preventDefault();
157
+ }, Fe = (t) => {
158
+ if (!t)
159
+ return t;
160
+ let e = t;
161
+ if (e.length === 1 && parseInt(t, 10) > 2)
162
+ return `0${e}:`;
163
+ const [n, l] = e.slice(-2);
164
+ return [2, 5].includes(e.length) && l === ":" && (e = `${e.slice(0, e.length - 2)}0${n}`), (Ct.test(e) || At.test(e)) && (e += ":"), e;
165
+ }, Ut = {
166
+ "en-US": {
167
+ customRange: "Custom range",
168
+ daily: "Daily",
169
+ dateFrom: "Date from",
170
+ dateTo: "Date to",
171
+ lastMonth: "Last month",
172
+ lastSevenDays: "Last 7 days",
173
+ lastThreeMonths: "Last three months",
174
+ monthly: "Monthly",
175
+ quarterly: "Quarterly",
176
+ timeFrom: "Time from",
177
+ timeTo: "Time to",
178
+ weekly: "Weekly"
179
+ },
180
+ "ja-JP": {
181
+ customRange: "カスタム範囲を選択",
182
+ daily: "毎日",
183
+ lastMonth: "先月",
184
+ lastSevenDays: "過去7日間",
185
+ monthly: "毎月",
186
+ weekly: "毎週"
187
+ },
188
+ "pt-BR": {
189
+ customRange: "Selecione um intervalo personalizado",
190
+ daily: "Diário",
191
+ lastMonth: "Último mês",
192
+ lastSevenDays: "Últimos 7 dias",
193
+ monthly: "Mensal",
194
+ weekly: "Semanal"
195
+ }
196
+ }, Ne = 300, Pe = "customRange", Ft = Be({
197
+ i18n: { messages: Ut },
198
+ name: "date-range-picker-calendar",
199
+ components: {
200
+ BentoDropdown: ft,
201
+ BentoInputField: mt,
202
+ BentoSegmentedControl: vt,
203
+ BentoTypography: Le,
204
+ Calendar: $
205
+ },
206
+ props: {
207
+ /**
208
+ * Allows user to enter time values in the form
209
+ */
210
+ allowTimeInput: { type: Boolean, default: !1 },
211
+ /**
212
+ * Ranges form persistance data
213
+ */
214
+ dateFormData: {
215
+ type: Object,
216
+ default: () => ({ startDate: void 0, endDate: void 0, startTime: void 0, endTime: void 0 })
217
+ },
218
+ /**
219
+ * Allows you to set the first day of the week. 0 is sunday, 1 is monday, 6 is saturday
220
+ */
221
+ firstDayOfWeek: $.props.firstDayOfWeek,
222
+ /**
223
+ * A list of available granularities.
224
+ * If present, the date picker will display a segmented control to change granularity.
225
+ */
226
+ granularities: {
227
+ type: Array,
228
+ default: null
229
+ },
230
+ /**
231
+ * Indicate if a date should be disabled or not
232
+ */
233
+ isDateDisabled: $.props.isDateDisabled,
234
+ /**
235
+ * Set a maximum number of dates to be selectable by the range.
236
+ */
237
+ maxRange: $.props.maxRange,
238
+ /**
239
+ * Sets a minimum limit for selectable dates - dates before `min` will not be selectable
240
+ */
241
+ min: $.props.min,
242
+ /**
243
+ * Sets a maximum limit for selectable dates - dates after `max` will not be selectable
244
+ */
245
+ max: $.props.max,
246
+ /**
247
+ * Number of months rendered on pane
248
+ */
249
+ numberOfMonths: $.props.numberOfMonths,
250
+ /**
251
+ * Displays the end date's month when the calendar is opened. Defaults to false i.e. the start date's month is displayed.
252
+ */
253
+ showEndDateOnOpen: { type: Boolean, default: !1 },
254
+ /**
255
+ * Enables the custom range selector.
256
+ * If provided, must be an array that sets the custom range dropdown items. Items are of the structure:
257
+ * `label` - label of custom range item.
258
+ * `value` - a unique key of the custom range item.
259
+ * `data` - an object `{ startDate: Date; endDate: Date }` to set the date picker range to upon selecting.
260
+ */
261
+ quickSelectRanges: {
262
+ type: Array,
263
+ default: void 0
264
+ },
265
+ /**
266
+ * Selected date
267
+ */
268
+ value: { type: Object, default: void 0 },
269
+ /**
270
+ * The type of calendar to display. Defaults to showing days.
271
+ */
272
+ variant: $.props.variant
273
+ },
274
+ emits: [
275
+ p.CUSTOM_RANGE,
276
+ p.INPUT,
277
+ p.ERROR,
278
+ p.FORM_DATE,
279
+ p.START_DATE_SELECTED
280
+ ],
281
+ setup(t, { emit: e, slots: n }) {
282
+ var _e, Re, be, Ie;
283
+ const { locale: l, t: o } = Te(), D = ye(), f = h({}), y = T(() => t.variant === "month" ? "monthly" : "daily"), r = fe({
284
+ startDate: (_e = t.value) == null ? void 0 : _e.startDate,
285
+ endDate: (Re = t.value) == null ? void 0 : Re.endDate,
286
+ range: (be = t.value) == null ? void 0 : be.range,
287
+ ...t.granularities ? {
288
+ granularity: ((Ie = t.value) == null ? void 0 : Ie.granularity) || y.value
289
+ } : {}
290
+ });
291
+ function g(a) {
292
+ return a ? new Date(
293
+ a.getUTCFullYear(),
294
+ a.getUTCMonth(),
295
+ a.getUTCDate(),
296
+ a.getUTCHours(),
297
+ a.getUTCMinutes(),
298
+ a.getUTCSeconds()
299
+ ) : null;
300
+ }
301
+ const w = T(() => {
302
+ var a, i;
303
+ return (
304
+ // eslint-disable-next-line consistent-return
305
+ ((i = (a = t == null ? void 0 : t.quickSelectRanges) == null ? void 0 : a.find(({ value: u, data: d }) => {
306
+ var b;
307
+ if (!d.endDate) {
308
+ if (d.isRelativeToNow) {
309
+ const E = (b = f.value) == null ? void 0 : b[u];
310
+ return E ? De(
311
+ g(E.startDate),
312
+ g(r.startDate)
313
+ ) && De(
314
+ g(E.endDate),
315
+ g(r.endDate)
316
+ ) : (
317
+ // If not stored calculated dates, fall back to comparing the quick select item's value
318
+ // with the internal range's stored range identifier.
319
+ u === r.range
320
+ );
321
+ }
322
+ return De(
323
+ g(d.startDate),
324
+ g(r.startDate)
325
+ ) && De(
326
+ g(r.endDate),
327
+ g(C(r.endDate))
328
+ ) && It(g(r.endDate));
329
+ }
330
+ if (t.allowTimeInput)
331
+ return Ue(
332
+ g(d.startDate),
333
+ g(r.startDate)
334
+ ) && Ue(g(d.endDate), g(r.endDate));
335
+ if (d.endDate)
336
+ return B(d.startDate, r.startDate) && B(d.endDate, r.endDate);
337
+ })) == null ? void 0 : i.value) ?? Pe
338
+ );
339
+ }), ne = T(() => ({
340
+ "b-date-range-picker-calendar__form-input-wrapper": t.allowTimeInput
341
+ })), _ = T(() => [
342
+ { label: o("customRange"), value: Pe },
343
+ ...t.quickSelectRanges ? t.quickSelectRanges : []
344
+ ]), A = T(
345
+ () => {
346
+ var a;
347
+ return ((a = t.granularities) == null ? void 0 : a.find(({ type: i }) => i === r.granularity)) || null;
348
+ }
349
+ ), k = T(
350
+ () => {
351
+ var a;
352
+ return ((a = t.granularities) == null ? void 0 : a.map(({ type: i, disabled: u }) => ({
353
+ label: o(i),
354
+ value: i,
355
+ disabled: u
356
+ }))) ?? [];
357
+ }
358
+ ), { getGranularCalendarLimits: ee } = Ot(t), m = T(
359
+ () => t.granularities ? ee(A.value) : { min: Z(t.min), max: C(t.max) }
360
+ ), {
361
+ adjustDateForQuarterly: G,
362
+ adjustDateForMonthly: te,
363
+ adjustDateForWeekly: x,
364
+ adjustStartDateInputForWeekly: v,
365
+ adjustEndDateInputForWeekly: U,
366
+ adjustStartDateInputForMonthly: F,
367
+ adjustEndDateInputForMonthly: H,
368
+ adjustStartDateInputForQuarterly: ve,
369
+ adjustEndDateInputForQuarterly: le
370
+ } = dt(t.firstDayOfWeek), { savedRanges: N, saveRange: q, resetSavedRanges: W } = wt(), S = (a) => a ? ae(a, I.NUMERIC_DATE_YEAR_FIRST, {
371
+ locale: D[l.value.substring(0, 2)] || D.enUS
372
+ }) : "", L = (a) => a ? ae(a, I.HOUR_MINUTE_SECONDS, {
373
+ locale: D[l.value.substring(0, 2)] || D.enUS
374
+ }) : "", Y = h(!1), V = h(!1), K = h(!1), z = h(!1), s = fe({
375
+ startDate: t.dateFormData.startDate,
376
+ endDate: t.dateFormData.endDate,
377
+ startTime: t.dateFormData.startTime,
378
+ endTime: t.dateFormData.endTime
379
+ }), ue = (a) => /^(?:[01]\d|2[01234]):(?:[012345]\d):(?:[012345]\d)$/.test(a), M = (a, i) => {
380
+ if (!i || !ue(i) || t.variant === "month")
381
+ return a;
382
+ let u = new Date(a);
383
+ const [d, b, E] = i.split(":");
384
+ return u = St(u, parseInt(d, 10)), u = kt(u, parseInt(b, 10)), u = Et(u, parseInt(E, 10)), u;
385
+ }, c = (a) => {
386
+ s.startTime = L(Z(a.startDate)), s.endTime = L(C(a.endDate)), r.startDate = M(a.startDate, s.startTime), r.endDate = M(a.endDate, s.endTime), r.range = null, t.granularities && W(), e(p.INPUT, {
387
+ ...r,
388
+ range: w.value
389
+ });
390
+ }, R = (a) => {
391
+ const i = (d) => t.min && d <= t.min || t.max && d >= t.max ? !1 : t.isDateDisabled ? !t.isDateDisabled(d) : !0;
392
+ return /^\d{4}-(0?[1-9]|1[012])-(0?[1-9]|[12][0-9]|3[01])$/.test(a) && i(new Date(a));
393
+ };
394
+ qe(() => {
395
+ t.dateFormData.startDate && !R(t.dateFormData.startDate) ? Y.value = !0 : (Y.value = !1, K.value = !1), t.dateFormData.endDate && !R(t.dateFormData.endDate) ? V.value = !0 : (V.value = !1, z.value = !1);
396
+ });
397
+ const J = (a) => {
398
+ var i;
399
+ s.startDate = S(a), s.startTime ? K.value && (s.startTime = (i = t.dateFormData) == null ? void 0 : i.startTime) : s.startTime = L(a), Y.value = !1, K.value = !1, e(p.START_DATE_SELECTED, a);
400
+ }, Q = (a) => {
401
+ var i;
402
+ s.endDate = S(a), s.endTime ? z.value && (s.endTime = (i = t.dateFormData) == null ? void 0 : i.endTime) : s.endTime = L(C(a)), V.value = !1, z.value = !1;
403
+ }, re = (a) => {
404
+ const i = t.value[a];
405
+ if (i)
406
+ return i;
407
+ if (t.dateFormData[a] && R(t.dateFormData[a]))
408
+ return new Date(t.dateFormData[a]);
409
+ }, je = ce((a) => {
410
+ var i;
411
+ if (R(a)) {
412
+ let u = a;
413
+ switch (Y.value = !1, (i = A.value) == null ? void 0 : i.type) {
414
+ case "weekly":
415
+ u = v(
416
+ a,
417
+ S,
418
+ m.value.min,
419
+ m.value.max
420
+ ), s.startDate = u;
421
+ break;
422
+ case "monthly":
423
+ u = F(
424
+ a,
425
+ S,
426
+ m.value.min,
427
+ m.value.max
428
+ ), s.startDate = u;
429
+ break;
430
+ case "quarterly":
431
+ u = ve(
432
+ a,
433
+ S,
434
+ m.value.min,
435
+ m.value.max
436
+ ), s.startDate = u;
437
+ break;
438
+ }
439
+ const d = X(u);
440
+ r.startDate = M(d, s.startTime), r.endDate = M(
441
+ X(s.endDate),
442
+ s.endTime
443
+ ), R(s.endDate) && (r.endDate = M(
444
+ X(s.endDate),
445
+ s.endTime
446
+ ));
447
+ const b = re("endDate");
448
+ r.range = null, e(p.FORM_DATE, {
449
+ startDate: d,
450
+ endDate: b
451
+ }), e(p.INPUT, {
452
+ ...r,
453
+ range: w.value
454
+ });
455
+ } else
456
+ Y.value = !0, e(p.ERROR, { ...s });
457
+ }, Ne), Ge = (a) => {
458
+ s.startDate = we(a), je(s.startDate);
459
+ }, He = ce((a) => {
460
+ var i;
461
+ if (R(a)) {
462
+ let u = a;
463
+ switch (V.value = !1, (i = A.value) == null ? void 0 : i.type) {
464
+ case "weekly":
465
+ u = U(
466
+ a,
467
+ S,
468
+ m.value.min,
469
+ m.value.max
470
+ ), s.endDate = u;
471
+ break;
472
+ case "monthly":
473
+ u = H(
474
+ a,
475
+ S,
476
+ m.value.min,
477
+ m.value.max
478
+ ), s.endDate = u;
479
+ break;
480
+ case "quarterly":
481
+ u = le(
482
+ a,
483
+ S,
484
+ m.value.min,
485
+ m.value.max
486
+ ), s.endDate = u;
487
+ break;
488
+ }
489
+ const d = X(u);
490
+ r.endDate = M(d, s.endTime), R(s.startDate) && (r.startDate = M(
491
+ X(s.startDate),
492
+ s.startTime
493
+ ));
494
+ const b = re("startDate");
495
+ r.range = null, e(p.FORM_DATE, {
496
+ startDate: b,
497
+ endDate: d
498
+ }), e(p.INPUT, {
499
+ ...r,
500
+ range: w.value
501
+ });
502
+ } else
503
+ V.value = !0, e(p.ERROR, { ...s });
504
+ }, Ne), We = (a) => {
505
+ s.endDate = we(a), He(s.endDate);
506
+ }, Ve = (a) => {
507
+ ct(a);
508
+ }, Ke = ce((a) => {
509
+ if (ue(a)) {
510
+ K.value = !1, r.startDate = M(r.startDate, a);
511
+ const i = re("endDate");
512
+ e(p.FORM_DATE, {
513
+ startDate: r.startDate,
514
+ endDate: i,
515
+ startTime: a,
516
+ endTime: s.endTime ?? t.dateFormData.endTime
517
+ }), e(p.INPUT, {
518
+ ...r,
519
+ range: w.value
520
+ });
521
+ } else
522
+ K.value = !0, e(p.ERROR, { ...s });
523
+ }), ze = ce((a) => {
524
+ ue(a) ? (z.value = !1, r.endDate = M(r.endDate, a), e(p.FORM_DATE, {
525
+ startDate: r.startDate,
526
+ endDate: r.endDate,
527
+ startTime: s.startTime ?? t.dateFormData.startTime,
528
+ endTime: a
529
+ }), e(p.INPUT, {
530
+ ...r,
531
+ range: w.value
532
+ })) : (z.value = !0, e(p.ERROR, { ...s }));
533
+ }), Je = (a) => {
534
+ s.startTime = Fe(a), Ke(s.startTime);
535
+ }, Xe = (a) => {
536
+ s.endTime = Fe(a), ze(s.endTime);
537
+ }, Ze = (a) => {
538
+ xt(a);
539
+ }, de = (a, i, u, d) => {
540
+ r.startDate = a, r.endDate = i, u && (r.granularity = u), d && (r.range = d);
541
+ }, et = (a) => {
542
+ var u;
543
+ const i = (u = t.quickSelectRanges) == null ? void 0 : u.find(({ value: d }) => d === a);
544
+ if (i) {
545
+ W();
546
+ const d = i.data, b = d.endDate || (d.isRelativeToNow ? new Date(Date.now()) : C(new Date(Date.now()))), E = d.isRelativeToNow && d.timeDifference ? new Date(b.getTime() - d.timeDifference) : d.startDate;
547
+ s.endDate = S(b), s.startDate = S(E), de(E, b, null, a), t.granularities && (r.granularity = d.granularity || y.value), s.startTime = L(E), s.endTime = L(b), r.startDate = E, r.endDate = b, d.isRelativeToNow && (f.value = {
548
+ ...f.value,
549
+ [a]: {
550
+ startDate: E,
551
+ endDate: b
552
+ }
553
+ }), e(p.CUSTOM_RANGE, {
554
+ ...i.data,
555
+ startDate: E,
556
+ endDate: b,
557
+ range: i.value
558
+ });
559
+ }
560
+ }, tt = {
561
+ weekly: x,
562
+ monthly: te,
563
+ quarterly: G
564
+ }, at = (a) => {
565
+ const i = r.granularity;
566
+ if (r.granularity = a, i && q(i, structuredClone(ge(r))), r.startDate && r.endDate) {
567
+ switch (a) {
568
+ case "quarterly":
569
+ case "monthly":
570
+ case "weekly": {
571
+ if (N[a]) {
572
+ de(N[a].startDate, N[a].endDate, a);
573
+ break;
574
+ }
575
+ const { startDate: u, endDate: d } = tt[a](
576
+ r.startDate,
577
+ r.endDate,
578
+ m.value.min,
579
+ m.value.max
580
+ );
581
+ de(u, d, a);
582
+ break;
583
+ }
584
+ case "daily":
585
+ N.daily && de(N.daily.startDate, N.daily.endDate, a);
586
+ break;
587
+ }
588
+ s.startDate = S(r.startDate), s.endDate = S(r.endDate), e(p.INPUT, {
589
+ ...r,
590
+ range: w.value
591
+ });
592
+ }
593
+ };
594
+ return {
595
+ // Values
596
+ internalRangeDate: r,
597
+ dateTextInput: s,
598
+ endDateError: V,
599
+ endTimeError: z,
600
+ granularityItems: k,
601
+ selectedGranularity: A,
602
+ computedMinMax: m,
603
+ selectedRangeSelectorValue: w,
604
+ startDateError: Y,
605
+ startTimeError: K,
606
+ quickSelectRangeDefaultItems: _,
607
+ formInputWrapperConditionalClasses: ne,
608
+ // Methods
609
+ hasSlot: pt(n),
610
+ t: o,
611
+ // Events
612
+ onDateInput: c,
613
+ onDateInputKeyDown: Ve,
614
+ onEndDateInput: We,
615
+ onEndDateSelected: Q,
616
+ onEndTimeInput: Xe,
617
+ onGranularityInput: at,
618
+ onRangeSelectorInput: et,
619
+ onStartDateInput: Ge,
620
+ onStartDateSelected: J,
621
+ onStartTimeInput: Je,
622
+ onTimeInputKeyDown: Ze
623
+ };
624
+ }
625
+ });
626
+ var Nt = function() {
627
+ var e = this, n = e._self._c;
628
+ return e._self._setupProxy, n("div", { staticClass: "b-date-range-picker-calendar" }, [n("div", { staticClass: "b-date-range-picker-calendar__form-container" }, [n("div", { staticClass: "b-date-range-picker-calendar__form" }, [e.hasSlot("title") ? [e._t("title")] : e._e(), e.quickSelectRanges ? n("bento-dropdown", { attrs: { "aria-label": e.t("customRange"), items: e.quickSelectRangeDefaultItems, value: e.selectedRangeSelectorValue }, on: { input: e.onRangeSelectorInput } }) : e._e(), e.granularities ? n("bento-segmented-control", { attrs: { items: e.granularityItems, "model-value": e.internalRangeDate.granularity, "full-width": "" }, on: { "update:model-value": e.onGranularityInput } }) : e._e(), n("div", [n("bento-typography", { staticClass: "b-date-range-picker-calendar__label", attrs: { stronger: "", el: "span" } }, [e._v(" From ")]), n("div", { class: e.formInputWrapperConditionalClasses }, [n("bento-input-field", { staticClass: "b-date-range-picker-calendar__form-input", attrs: { "aria-label": e.t("dateFrom"), value: e.dateTextInput.startDate, error: e.startDateError }, on: { input: e.onStartDateInput, keydown: e.onDateInputKeyDown }, scopedSlots: e._u([{ key: "description", fn: function() {
629
+ return [e._v("YYYY-MM-DD")];
630
+ }, proxy: !0 }]) }), e.allowTimeInput ? n("bento-input-field", { staticClass: "b-date-range-picker-calendar__form-input", attrs: { "aria-label": e.t("timeFrom"), value: e.dateTextInput.startTime, error: e.startTimeError }, on: { input: e.onStartTimeInput, keydown: e.onTimeInputKeyDown }, scopedSlots: e._u([{ key: "description", fn: function() {
631
+ return [e._v("HH:MM:SS")];
632
+ }, proxy: !0 }], null, !1, 3442289499) }) : e._e()], 1)], 1), n("div", [n("bento-typography", { staticClass: "b-date-range-picker-calendar__label", attrs: { stronger: "", el: "span" } }, [e._v(" To ")]), n("div", { class: e.formInputWrapperConditionalClasses }, [n("bento-input-field", { staticClass: "b-date-range-picker-calendar__form-input", attrs: { "aria-label": e.t("dateTo"), value: e.dateTextInput.endDate, error: e.endDateError }, on: { input: e.onEndDateInput, keydown: e.onDateInputKeyDown }, scopedSlots: e._u([{ key: "description", fn: function() {
633
+ return [e._v("YYYY-MM-DD")];
634
+ }, proxy: !0 }]) }), e.allowTimeInput ? n("bento-input-field", { staticClass: "b-date-range-picker-calendar__form-input", attrs: { "aria-label": e.t("timeTo"), value: e.dateTextInput.endTime, error: e.endTimeError }, on: { input: e.onEndTimeInput, keydown: e.onTimeInputKeyDown }, scopedSlots: e._u([{ key: "description", fn: function() {
635
+ return [e._v("HH:MM:SS")];
636
+ }, proxy: !0 }], null, !1, 3442289499) }) : e._e()], 1)], 1)], 2), e.hasSlot("actions") ? n("div", [e._t("actions")], 2) : e._e()]), n("div", { staticClass: "b-date-range-picker-calendar__calendars-container" }, [n("calendar", { attrs: { value: e.internalRangeDate, "first-day-of-week": e.firstDayOfWeek, "is-date-disabled": e.isDateDisabled, "max-range": e.maxRange, min: e.computedMinMax.min, max: e.computedMinMax.max, "number-of-months": e.numberOfMonths, "show-end-date-on-open": e.showEndDateOnOpen, granularity: e.selectedGranularity, variant: e.variant, "is-range": "" }, on: { input: e.onDateInput, "start-date-selected": e.onStartDateSelected, "end-date-selected": e.onEndDateSelected } })], 1)]);
637
+ }, Pt = [], Bt = /* @__PURE__ */ Qe(
638
+ Ft,
639
+ Nt,
640
+ Pt,
641
+ !1,
642
+ null,
643
+ "bb72f95a"
644
+ );
645
+ const P = Bt.exports, qt = ({
646
+ datePickerValue: t,
647
+ isDateIncorrect: e,
648
+ quickSelectRanges: n,
649
+ isMonthVariant: l
650
+ }) => {
651
+ var _, A, k, ee;
652
+ const { locale: o, t: D } = Te(), f = ye(), y = (m) => !!m && !isNaN(m.getTime()), r = (m, G) => y(m) ? ae(m, G, {
653
+ locale: f[o.value.substring(0, 2)] || f.enUS
654
+ }) : void 0, g = fe({
655
+ startDate: r((_ = t.value) == null ? void 0 : _.startDate, I.NUMERIC_DATE_YEAR_FIRST),
656
+ endDate: r((A = t.value) == null ? void 0 : A.endDate, I.NUMERIC_DATE_YEAR_FIRST),
657
+ startTime: r((k = t.value) == null ? void 0 : k.startDate, I.HOUR_MINUTE_SECONDS),
658
+ endTime: r((ee = t.value) == null ? void 0 : ee.endDate, I.HOUR_MINUTE_SECONDS)
659
+ });
660
+ return {
661
+ // Values
662
+ dateDisplayValue: T(() => {
663
+ var x;
664
+ if (e.value)
665
+ return `${g.startDate || ""} - ${g.endDate || ""}`;
666
+ if (!t.value || !t.value.startDate && !t.value.endDate)
667
+ return D("selectDateRange");
668
+ if ((x = n.value) != null && x.length) {
669
+ const v = n.value.find(({ value: U }) => {
670
+ var F;
671
+ return U === ((F = t.value) == null ? void 0 : F.range);
672
+ });
673
+ if (v)
674
+ return v.label;
675
+ }
676
+ if (t.value.granularity === "quarterly") {
677
+ const { startDate: v, endDate: U } = t.value, F = D("quarter", { quarter: Ce(v), year: Ae(v) });
678
+ if (bt(v, U))
679
+ return F;
680
+ const H = D("quarter", { quarter: Ce(U), year: Ae(U) });
681
+ return `${F} - ${H}`;
682
+ }
683
+ const { startDate: m, endDate: G } = g, te = l != null && l.value ? I.LONG_MONTH_YEAR : I.FULL_DATE_MONTH_FIRST;
684
+ return `${r(X(m), te)} - ${r(
685
+ X(G),
686
+ te
687
+ )}`;
688
+ }),
689
+ textInputDisplayValue: g,
690
+ // Methods
691
+ formatTextInputDisplayValue: () => ""
692
+ };
693
+ };
694
+ var me = /* @__PURE__ */ ((t) => (t.INPUT = "input", t))(me || {});
695
+ const Lt = {
696
+ "en-US": {
697
+ apply: "Apply",
698
+ cancel: "Cancel",
699
+ dateRangePicker: "Date range picker {name}",
700
+ provideDateInAFormat: "Provide date in a YYYY-MM-DD format",
701
+ quarter: "Q{quarter} {year}",
702
+ selectDate: "Select a date",
703
+ selectDateRange: "Select a date range",
704
+ selectedDateIsNotAvailable: "Selected date is not available"
705
+ },
706
+ "ja-JP": {
707
+ apply: "適用",
708
+ cancel: "キャンセル",
709
+ selectDate: "日付を選択"
710
+ },
711
+ "pt-BR": {
712
+ apply: "Aplicar",
713
+ cancel: "Cancelar",
714
+ selectDate: "Selecione uma data"
715
+ }
716
+ }, Yt = Be({
717
+ i18n: { messages: Lt },
718
+ name: "bento-date-range-picker",
719
+ components: {
720
+ BentoButtonActions: _t,
721
+ BentoDivider: nt,
722
+ BentoTypography: Le,
723
+ BentoPopover: rt,
724
+ DateRangePickerCalendar: P,
725
+ DropdownInputDefault: it,
726
+ ErrorMessage: Tt,
727
+ FieldLabel: yt
728
+ },
729
+ directives: { BentoClickOutsideDirective: gt },
730
+ props: {
731
+ /**
732
+ * Allows user to enter time values in the form
733
+ */
734
+ allowTimeInput: { type: Boolean, default: !1 },
735
+ /**
736
+ * Descriptive supporting text visbile underneath the dropdown.
737
+ */
738
+ description: { type: String, default: void 0 },
739
+ /**
740
+ * Disables dropdown functionality.
741
+ */
742
+ disabled: { type: Boolean, default: !1 },
743
+ /**
744
+ * Displays component in an error state with an error message
745
+ */
746
+ errorMessage: { type: String, default: null },
747
+ /**
748
+ * Allows user to set the first day of the week. 0 is sunday, 1 is monday, 6 is saturday
749
+ */
750
+ firstDayOfWeek: P.props.firstDayOfWeek,
751
+ /**
752
+ * A list of available granularities.
753
+ * If present, the date picker will display a segmented control to change granularity.
754
+ */
755
+ granularities: P.props.granularities,
756
+ /**
757
+ * Indicate if a date should be disabled or not
758
+ */
759
+ isDateDisabled: P.props.isDateDisabled,
760
+ /**
761
+ * Text that is displayed as a label above the element.
762
+ */
763
+ label: { type: String, default: void 0 },
764
+ /**
765
+ * Upon opening date range picker, end date's month will be pre-selected.
766
+ */
767
+ showEndDateOnOpen: { type: Boolean, default: !1 },
768
+ /**
769
+ * Highlights the dropdown is optional.
770
+ */
771
+ optional: { type: Boolean, default: !1 },
772
+ /**
773
+ * The Boolean readonly property, when present, makes the element not mutable, meaning the user can not edit the date range picker.
774
+ */
775
+ readonly: { type: Boolean, default: !1 },
776
+ /**
777
+ * Highlights the dropdown is required.
778
+ */
779
+ required: { type: Boolean, default: !1 },
780
+ /**
781
+ * Adds a info icon next to the label to display the passed tooltip message.
782
+ */
783
+ tooltipText: { type: String, default: null },
784
+ /**
785
+ * Enables the range selector.
786
+ * If provided, must be an array that sets the custom range dropdown items. Items are of the structure:
787
+ * `label` - label of custom range item.
788
+ * `value` - a unique key of the custom range item.
789
+ * `data` - an object `{ startDate: Date; endDate: Date }` to set the date picker range to upon selecting.
790
+ */
791
+ quickSelectRanges: {
792
+ type: Array,
793
+ default: void 0
794
+ },
795
+ /**
796
+ * Set a maximum number of dates to be selectable by the range.
797
+ */
798
+ maxRange: P.props.maxRange,
799
+ /**
800
+ * Sets a minimum limit for selectable dates - dates before `min` will not be selectable
801
+ */
802
+ min: P.props.min,
803
+ /**
804
+ * Sets a maximum limit for selectable dates - dates after `max` will not be selectable
805
+ */
806
+ max: P.props.max,
807
+ /**
808
+ * Number of months rendered on pane
809
+ */
810
+ numberOfMonths: P.props.numberOfMonths,
811
+ /**
812
+ * Selected date
813
+ */
814
+ value: P.props.value,
815
+ /**
816
+ * The type of calendar to display. Defaults to showing days.
817
+ */
818
+ variant: {
819
+ type: String,
820
+ default: void 0
821
+ // Default will be set by @/internal/calendar
822
+ },
823
+ /**
824
+ * Enables the date picker selection to persist until it is explicitly applied.
825
+ * Displays a set of buttons: Apply and Cancel.
826
+ *
827
+ * @deprecated This will be the default behaviour in v2.0.0.
828
+ */
829
+ hasActions: { type: Boolean, default: !1 }
830
+ },
831
+ emits: [me.INPUT],
832
+ setup(t, { emit: e }) {
833
+ const { locale: n, t: l } = Te(), o = ye(), D = se("bento-date-range-picker-container"), f = se("bento-date-range-picker-label"), y = se("bento-date-range-picker-description"), r = se("bento-date-range-picker-error"), g = se("bento-date-range-picker-date-error"), w = T(
834
+ () => t.label || l("dateRangePicker", { name: D })
835
+ ), ne = T(() => (t == null ? void 0 : t.quickSelectRanges) && t.quickSelectRanges.map((c) => {
836
+ const R = c.data.endDate ? void 0 : new Date(Date.now()).getTime() - c.data.startDate.getTime();
837
+ return {
838
+ ...c,
839
+ data: {
840
+ ...c.data,
841
+ // Adding timeDifference to calculate an up-to-date endDate on range selection
842
+ timeDifference: R
843
+ }
844
+ };
845
+ })), _ = h(!1), A = h(null), k = h(!1), { isReadOnly: ee } = Dt(Se(t, "readonly"));
846
+ pe(
847
+ () => t.disabled,
848
+ () => {
849
+ t.disabled && k.value && (k.value = !1);
850
+ }
851
+ );
852
+ const m = T(() => t.hasActions ? !W.value && _.value : _.value), G = T(() => ({
853
+ "b-date-range-picker__description--error": !!t.errorMessage || m.value
854
+ })), te = T(() => t.variant === "month"), { dateDisplayValue: x, textInputDisplayValue: v } = qt({
855
+ datePickerValue: Se(t, "value"),
856
+ isDateIncorrect: _,
857
+ quickSelectRanges: ne,
858
+ isMonthVariant: te
859
+ }), U = T(
860
+ () => `${t.description ? y : ""} ${t.errorMessage ? r : ""} ${_.value ? g : ""}`.trim() || null
861
+ ), F = T(() => t.allowTimeInput && t.variant !== "month"), H = () => {
862
+ k.value = !1;
863
+ }, ve = () => {
864
+ k.value = !0;
865
+ }, le = h(x.value), N = h(
866
+ // textInputDisplayValue is a reactive object
867
+ structuredClone(ge(v))
868
+ ), q = h(t.value), W = h(!0), S = T(
869
+ () => t.hasActions ? N.value : v
870
+ ), L = T(
871
+ () => t.hasActions ? le.value : x.value
872
+ );
873
+ qe(() => {
874
+ if (t.hasActions || st(
875
+ 'BentoDateRangePicker "hasActions" property',
876
+ `Set the BentoDateRangePicker "hasActions" property true which will display the "Apply" and "Cancel" buttons.
877
+ This will be the default behavior in the v2 and "hasActions" will be removed.`,
878
+ "2.0.0"
879
+ ), t.granularities && t.variant !== "month" && t.granularities.find(({ type: c }) => c === "quarterly"))
880
+ throw new Error(
881
+ 'Quarterly granularity is only supported by BentoDateRangePicker with variant: "month"'
882
+ );
883
+ }), pe(
884
+ () => t.value,
885
+ () => {
886
+ le.value = x.value, N.value = structuredClone(ge(v));
887
+ }
888
+ );
889
+ const Y = T(() => [
890
+ {
891
+ title: l("apply"),
892
+ event: () => {
893
+ e(me.INPUT, q.value), H(), W.value = !0;
894
+ },
895
+ disabled: W.value
896
+ },
897
+ {
898
+ title: l("cancel"),
899
+ event: H
900
+ }
901
+ ]);
902
+ return pe(q, (c) => {
903
+ if (t.hasActions) {
904
+ W.value = _.value;
905
+ return;
906
+ }
907
+ e(me.INPUT, c);
908
+ }), {
909
+ // Refs
910
+ inputContainerRef: A,
911
+ // Values,
912
+ adjustedQuickSelectRanges: ne,
913
+ dateDisplayValue: x,
914
+ datePickerContainerId: D,
915
+ descriptionConditionalClasses: G,
916
+ displayedTextInputValue: S,
917
+ displayedDateValue: L,
918
+ isDateIncorrect: _,
919
+ isDateRangePickerOpen: k,
920
+ isReadOnly: ee,
921
+ labelId: f,
922
+ descriptionId: y,
923
+ dateErrorId: g,
924
+ errorId: r,
925
+ popoverAriaLabel: w,
926
+ shouldDisplayError: m,
927
+ ariaDescribedBy: U,
928
+ textInputDisplayValue: v,
929
+ rangePickerButtonActions: Y,
930
+ BentoButtonActionsLayout: Rt,
931
+ withTimeInput: F,
932
+ // Events
933
+ closeDateRangePicker: H,
934
+ clearDateRangePickerValue: async () => {
935
+ _.value && (_.value = !1), q.value = null;
936
+ },
937
+ openDateRangePicker: ve,
938
+ onRangeSelectorInput: (c) => {
939
+ if (c) {
940
+ const R = (Q, re) => Q ? ae(Q, re, {
941
+ locale: o[n.value.substring(0, 2)] || o.enUS
942
+ }) : void 0, J = (Q) => ae(Q, I.NUMERIC_DATE_YEAR_FIRST, {
943
+ locale: o[n.value.substring(0, 2)] || o.enUS
944
+ });
945
+ v.startDate = J(c.startDate), v.endDate = J(c.endDate), v.startTime = R(
946
+ c.startDate,
947
+ I.HOUR_MINUTE_SECONDS
948
+ ), v.endTime = R(
949
+ c.endDate,
950
+ I.HOUR_MINUTE_SECONDS
951
+ ), q.value = c;
952
+ }
953
+ },
954
+ onEnterPressedOverInput: () => {
955
+ if (!k.value) {
956
+ k.value = !0;
957
+ return;
958
+ }
959
+ _.value || (k.value = !1);
960
+ },
961
+ onDateRangePickerInput: (c) => {
962
+ _.value = !1;
963
+ const R = (J, Q) => J ? ae(J, Q, {
964
+ locale: o[n.value.substring(0, 2)] || o.enUS
965
+ }) : void 0;
966
+ v.startDate = R(
967
+ c.startDate,
968
+ I.NUMERIC_DATE_YEAR_FIRST
969
+ ), v.endDate = R(c.endDate, I.NUMERIC_DATE_YEAR_FIRST), v.startTime = R(c.startDate, I.HOUR_MINUTE_SECONDS), v.endTime = R(c.endDate, I.HOUR_MINUTE_SECONDS), q.value = c;
970
+ },
971
+ onDateRangePickerError: (c) => {
972
+ _.value = !0, v.startDate = c.startDate, v.endDate = c.endDate, q.value = { startDate: null, endDate: null };
973
+ },
974
+ onDateRangePickerFormDateInputUpdate: (c) => {
975
+ _.value = !1, c.startTime && (v.startTime = c.startTime), c.endTime && (v.endTime = c.endTime);
976
+ },
977
+ // Translations
978
+ t: l
979
+ };
980
+ }
981
+ });
982
+ var Qt = function() {
983
+ var e = this, n = e._self._c;
984
+ return e._self._setupProxy, n("div", { directives: [{ name: "bento-click-outside-directive", rawName: "v-bento-click-outside-directive", value: e.closeDateRangePicker, expression: "closeDateRangePicker" }], staticClass: "b-date-range-picker" }, [e.label ? n("field-label", { attrs: { id: e.labelId, label: e.label, "tooltip-text": e.tooltipText, optional: e.optional, required: e.required } }) : e._e(), n("div", { on: { keydown: function(l) {
985
+ return !l.type.indexOf("key") && e._k(l.keyCode, "enter", 13, l.key, "Enter") ? null : e.onEnterPressedOverInput.apply(null, arguments);
986
+ } } }, [n("dropdown-input-default", { ref: "inputContainerRef", attrs: { "always-combobox-is-input": "", ariaControls: e.datePickerContainerId, ariaExpanded: e.isDateRangePickerOpen, "aria-labelledby": e.label ? e.labelId : null, "aria-describedby": e.ariaDescribedBy, disabled: e.disabled, "is-invalid": !!e.errorMessage || e.shouldDisplayError, open: e.isDateRangePickerOpen, "display-value": e.displayedDateValue, readonly: e.isReadOnly }, on: { open: e.openDateRangePicker, clear: e.clearDateRangePickerValue, close: e.closeDateRangePicker } })], 1), e.shouldDisplayError ? n("error-message", { staticClass: "b-date-range-picker__error-message", attrs: { id: e.dateErrorId, "error-message": e.t("provideDateInAFormat") } }) : e._e(), e.errorMessage ? n("error-message", { staticClass: "b-date-range-picker__error-message", attrs: { id: e.errorId, "error-message": e.errorMessage } }) : e._e(), e.description ? n("bento-typography", { staticClass: "b-date-range-picker__description", class: e.descriptionConditionalClasses, attrs: { id: e.descriptionId, el: "span" } }, [e._v(" " + e._s(e.description) + " ")]) : e._e(), e.inputContainerRef ? n("bento-popover", { staticClass: "b-date-range-picker__container", attrs: { id: e.datePickerContainerId, open: e.isDateRangePickerOpen, "target-element": e.inputContainerRef, "disable-focus-trap": !0, "aria-label": e.popoverAriaLabel, position: "bottom-start", "without-space": "", "fit-content": "" } }, [n("date-range-picker-calendar", { attrs: { "allow-time-input": e.withTimeInput, "quick-select-ranges": e.adjustedQuickSelectRanges, value: e.value, "first-day-of-week": e.firstDayOfWeek, granularities: e.granularities, "is-date-disabled": e.isDateDisabled, "max-range": e.maxRange, min: e.min, max: e.max, "number-of-months": e.numberOfMonths, "show-end-date-on-open": e.showEndDateOnOpen, "date-form-data": e.displayedTextInputValue, variant: e.variant }, on: { "custom-range": e.onRangeSelectorInput, input: e.onDateRangePickerInput, error: e.onDateRangePickerError, "form-date": e.onDateRangePickerFormDateInputUpdate }, scopedSlots: e._u([e.hasActions ? { key: "actions", fn: function() {
987
+ return [n("bento-divider"), n("div", { staticClass: "b-date-range-picker__footer" }, [n("bento-button-actions", { attrs: { actions: e.rangePickerButtonActions, layout: e.BentoButtonActionsLayout.SPACE_BETWEEN } })], 1)];
988
+ }, proxy: !0 } : null], null, !0) })], 1) : e._e()], 1);
989
+ }, $t = [], jt = /* @__PURE__ */ Qe(
990
+ Yt,
991
+ Qt,
992
+ $t,
993
+ !1,
994
+ null,
995
+ "288c6da8"
996
+ );
997
+ const fa = jt.exports;
998
+ export {
999
+ fa as B,
1000
+ P as D,
1001
+ me as a,
1002
+ It as b,
1003
+ De as i
1004
+ };
1005
+ //# sourceMappingURL=date-range-picker.CNB28UaM.js.map