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