@adyen/bento-vue2 1.76.2 → 1.77.1

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