@adyen/bento-vue3 1.57.0 → 1.58.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 (184) hide show
  1. package/dist/@types/components.d.ts +2 -0
  2. package/dist/@types/index.d.ts +191 -52
  3. package/dist/action-bar.js +1 -1
  4. package/dist/assets/accordion-item.css +1 -1
  5. package/dist/assets/action-bar.css +1 -1
  6. package/dist/assets/base-modal.css +1 -1
  7. package/dist/assets/card.css +1 -1
  8. package/dist/assets/data-grid-template.css +1 -1
  9. package/dist/assets/data-grid.css +1 -1
  10. package/dist/assets/date-range-picker.css +1 -1
  11. package/dist/assets/dialog-page.css +1 -1
  12. package/dist/assets/file-uploader.css +1 -1
  13. package/dist/assets/filter-bar.css +1 -1
  14. package/dist/assets/input-field-password.css +1 -1
  15. package/dist/assets/inspector.css +1 -1
  16. package/dist/assets/menu.css +1 -1
  17. package/dist/assets/modal-fullscreen.css +1 -1
  18. package/dist/assets/pagination.css +1 -1
  19. package/dist/assets/popover.css +1 -1
  20. package/dist/assets/sidepanel.css +1 -1
  21. package/dist/button.js +1 -1
  22. package/dist/card.js +1 -1
  23. package/dist/checkbox.js +2 -2
  24. package/dist/chunks/{action-bar.BOCrfaHz.js → action-bar.C3YC7Cvq.js} +4 -4
  25. package/dist/chunks/{action-bar.BOCrfaHz.js.map → action-bar.C3YC7Cvq.js.map} +1 -1
  26. package/dist/chunks/{base-modal.DhzWPnD5.js → base-modal.C9t8wOxU.js} +2 -2
  27. package/dist/chunks/{base-modal.DhzWPnD5.js.map → base-modal.C9t8wOxU.js.map} +1 -1
  28. package/dist/chunks/{button-actions-with-menu.CkyIwzNi.js → button-actions-with-menu.DVvlTcnv.js} +4 -4
  29. package/dist/chunks/{button-actions-with-menu.CkyIwzNi.js.map → button-actions-with-menu.DVvlTcnv.js.map} +1 -1
  30. package/dist/chunks/{button-actions.DWGBFisz.js → button-actions.WnxN4KnV.js} +2 -2
  31. package/dist/chunks/{button-actions.DWGBFisz.js.map → button-actions.WnxN4KnV.js.map} +1 -1
  32. package/dist/chunks/calendar.DzwpAB0z.js +1288 -0
  33. package/dist/chunks/calendar.DzwpAB0z.js.map +1 -0
  34. package/dist/chunks/{card.DguoAMcm.js → card.PFtc1o__.js} +2 -2
  35. package/dist/chunks/{card.DguoAMcm.js.map → card.PFtc1o__.js.map} +1 -1
  36. package/dist/chunks/{checkbox-group.CZ-J707C.js → checkbox-group.tAmTjBdy.js} +4 -4
  37. package/dist/chunks/{checkbox-group.CZ-J707C.js.map → checkbox-group.tAmTjBdy.js.map} +1 -1
  38. package/dist/chunks/{checkbox.CMuObeL7.js → checkbox.H3fMdGno.js} +17 -17
  39. package/dist/chunks/{checkbox.CMuObeL7.js.map → checkbox.H3fMdGno.js.map} +1 -1
  40. package/dist/chunks/{code-snippet.WgKhySvn.js → code-snippet.EAwTnNST.js} +5 -5
  41. package/dist/chunks/{code-snippet.WgKhySvn.js.map → code-snippet.EAwTnNST.js.map} +1 -1
  42. package/dist/chunks/{controls-group.DsGEDyTw.js → controls-group.CQZTslGW.js} +2 -2
  43. package/dist/chunks/{controls-group.DsGEDyTw.js.map → controls-group.CQZTslGW.js.map} +1 -1
  44. package/dist/chunks/{copy.QuF9bDfT.js → copy.Ce8Mdpir.js} +2 -2
  45. package/dist/chunks/{copy.QuF9bDfT.js.map → copy.Ce8Mdpir.js.map} +1 -1
  46. package/dist/chunks/{dashboard-section.fZiEAres.js → dashboard-section.D5fPiyCI.js} +2 -2
  47. package/dist/chunks/{dashboard-section.fZiEAres.js.map → dashboard-section.D5fPiyCI.js.map} +1 -1
  48. package/dist/chunks/{dashed-underline.BZ_oZeHs.js → dashed-underline.CMScTPOb.js} +3 -3
  49. package/dist/chunks/{dashed-underline.BZ_oZeHs.js.map → dashed-underline.CMScTPOb.js.map} +1 -1
  50. package/dist/chunks/{data-grid-template.Cw-0-al0.js → data-grid-template.Qig0zkMz.js} +2 -2
  51. package/dist/chunks/{data-grid-template.Cw-0-al0.js.map → data-grid-template.Qig0zkMz.js.map} +1 -1
  52. package/dist/chunks/data-grid.C98jzhfU.js +3611 -0
  53. package/dist/chunks/data-grid.C98jzhfU.js.map +1 -0
  54. package/dist/chunks/{date-picker.CWGFy7Hb.js → date-picker.Bmkc0eYL.js} +17 -17
  55. package/dist/chunks/{date-picker.CWGFy7Hb.js.map → date-picker.Bmkc0eYL.js.map} +1 -1
  56. package/dist/chunks/date-range-picker.D-_e1W8W.js +1171 -0
  57. package/dist/chunks/date-range-picker.D-_e1W8W.js.map +1 -0
  58. package/dist/chunks/{dropdown-tag.DCat3Pd2.js → dropdown-tag.9Uuos_mS.js} +3 -3
  59. package/dist/chunks/{dropdown-tag.DCat3Pd2.js.map → dropdown-tag.9Uuos_mS.js.map} +1 -1
  60. package/dist/chunks/{dropdown.D4lL2ytb.js → dropdown.CnMnzXc2.js} +29 -29
  61. package/dist/chunks/{dropdown.D4lL2ytb.js.map → dropdown.CnMnzXc2.js.map} +1 -1
  62. package/dist/chunks/{error-message.CjdvgIAh.js → error-message.KTNWtFyf.js} +2 -2
  63. package/dist/chunks/{error-message.CjdvgIAh.js.map → error-message.KTNWtFyf.js.map} +1 -1
  64. package/dist/chunks/{es6.BtaxuP0b.js → es6.BA9GH7QZ.js} +2 -2
  65. package/dist/chunks/{es6.BtaxuP0b.js.map → es6.BA9GH7QZ.js.map} +1 -1
  66. package/dist/chunks/{file-uploader.faOTOytJ.js → file-uploader.DzGfFhY9.js} +3 -3
  67. package/dist/chunks/{file-uploader.faOTOytJ.js.map → file-uploader.DzGfFhY9.js.map} +1 -1
  68. package/dist/chunks/{filter-bar.BbLKMSsn.js → filter-bar.CY2ZlyD4.js} +1015 -959
  69. package/dist/chunks/filter-bar.CY2ZlyD4.js.map +1 -0
  70. package/dist/chunks/{footer-actions.CQARYj4Q.js → footer-actions.DqKdjjjh.js} +2 -2
  71. package/dist/chunks/{footer-actions.CQARYj4Q.js.map → footer-actions.DqKdjjjh.js.map} +1 -1
  72. package/dist/chunks/{header-with-views.WANsHlGK.js → header-with-views.B-d7Y1qK.js} +10 -10
  73. package/dist/chunks/{header-with-views.WANsHlGK.js.map → header-with-views.B-d7Y1qK.js.map} +1 -1
  74. package/dist/chunks/{header.DAuIurUM.js → header.Nh7Jph4R.js} +4 -4
  75. package/dist/chunks/{header.DAuIurUM.js.map → header.Nh7Jph4R.js.map} +1 -1
  76. package/dist/chunks/{info-icon-with-popover.J10ERGQ2.js → info-icon-with-popover.CZGbqWFt.js} +2 -2
  77. package/dist/chunks/{info-icon-with-popover.J10ERGQ2.js.map → info-icon-with-popover.CZGbqWFt.js.map} +1 -1
  78. package/dist/chunks/{info-icon.71yYfuEc.js → info-icon.DOH8zIvI.js} +2 -2
  79. package/dist/chunks/{info-icon.71yYfuEc.js.map → info-icon.DOH8zIvI.js.map} +1 -1
  80. package/dist/chunks/input-field-password.B5uy0EiK.js +366 -0
  81. package/dist/chunks/input-field-password.B5uy0EiK.js.map +1 -0
  82. package/dist/chunks/{input-field-phone-number.DPNOepAt.js → input-field-phone-number.Ck6XS73k.js} +3 -3
  83. package/dist/chunks/{input-field-phone-number.DPNOepAt.js.map → input-field-phone-number.Ck6XS73k.js.map} +1 -1
  84. package/dist/chunks/{input-field.CtV60WoD.js → input-field.CUfSQLYO.js} +3 -3
  85. package/dist/chunks/{input-field.CtV60WoD.js.map → input-field.CUfSQLYO.js.map} +1 -1
  86. package/dist/chunks/{listbox-option-tag.DsnH9Q9j.js → listbox-option-tag.v1qrgVav.js} +2 -2
  87. package/dist/chunks/{listbox-option-tag.DsnH9Q9j.js.map → listbox-option-tag.v1qrgVav.js.map} +1 -1
  88. package/dist/chunks/{menu.BOj630ue.js → menu.BmSWTWp2.js} +2 -2
  89. package/dist/chunks/{menu.BOj630ue.js.map → menu.BmSWTWp2.js.map} +1 -1
  90. package/dist/chunks/{modal-fullscreen.D1hncuS7.js → modal-fullscreen.B73FGuMI.js} +2 -2
  91. package/dist/chunks/{modal-fullscreen.D1hncuS7.js.map → modal-fullscreen.B73FGuMI.js.map} +1 -1
  92. package/dist/chunks/{modal.vue_vue_type_script_setup_true_lang.y7pMBxB0.js → modal.vue_vue_type_script_setup_true_lang.hMWefloS.js} +4 -4
  93. package/dist/chunks/{modal.vue_vue_type_script_setup_true_lang.y7pMBxB0.js.map → modal.vue_vue_type_script_setup_true_lang.hMWefloS.js.map} +1 -1
  94. package/dist/chunks/pagination.BfA6pOGB.js +461 -0
  95. package/dist/chunks/pagination.BfA6pOGB.js.map +1 -0
  96. package/dist/chunks/{popover.BzzdIK19.js → popover.DiIZe9RM.js} +2 -2
  97. package/dist/chunks/{popover.BzzdIK19.js.map → popover.DiIZe9RM.js.map} +1 -1
  98. package/dist/chunks/{radio-group.seLW9WC9.js → radio-group.DG_SxGuf.js} +4 -4
  99. package/dist/chunks/{radio-group.seLW9WC9.js.map → radio-group.DG_SxGuf.js.map} +1 -1
  100. package/dist/chunks/rich-text-editor.zXIxJKs8.js +6221 -0
  101. package/dist/chunks/rich-text-editor.zXIxJKs8.js.map +1 -0
  102. package/dist/chunks/{search-bar.DgDUdcot.js → search-bar.BUG88A0q.js} +3 -3
  103. package/dist/chunks/{search-bar.DgDUdcot.js.map → search-bar.BUG88A0q.js.map} +1 -1
  104. package/dist/chunks/{secondary-nav.C3TEPrCq.js → secondary-nav.igRQouwn.js} +3 -3
  105. package/dist/chunks/{secondary-nav.C3TEPrCq.js.map → secondary-nav.igRQouwn.js.map} +1 -1
  106. package/dist/chunks/{segmented-control.B2cS73wG.js → segmented-control.ClJS7gzl.js} +2 -2
  107. package/dist/chunks/{segmented-control.B2cS73wG.js.map → segmented-control.ClJS7gzl.js.map} +1 -1
  108. package/dist/chunks/{selection-card-group.gd66OMqI.js → selection-card-group.CdRPwD-M.js} +12 -12
  109. package/dist/chunks/{selection-card-group.gd66OMqI.js.map → selection-card-group.CdRPwD-M.js.map} +1 -1
  110. package/dist/chunks/{sidepanel.9wJbIvIS.js → sidepanel.C4z6LXMz.js} +2 -2
  111. package/dist/chunks/{sidepanel.9wJbIvIS.js.map → sidepanel.C4z6LXMz.js.map} +1 -1
  112. package/dist/chunks/{structured-list-item.CzzWSj5s.js → structured-list-item.BDps9Y9e.js} +4 -4
  113. package/dist/chunks/{structured-list-item.CzzWSj5s.js.map → structured-list-item.BDps9Y9e.js.map} +1 -1
  114. package/dist/chunks/{summary-grid.types.IZdK-Mvh.js → summary-grid.types.DMCKjGMN.js} +5 -5
  115. package/dist/chunks/{summary-grid.types.IZdK-Mvh.js.map → summary-grid.types.DMCKjGMN.js.map} +1 -1
  116. package/dist/chunks/{tag.iiCQSgG9.js → tag.uRkpY4u1.js} +2 -2
  117. package/dist/chunks/{tag.iiCQSgG9.js.map → tag.uRkpY4u1.js.map} +1 -1
  118. package/dist/chunks/{textarea.DY0kNx0r.js → textarea.Dzy0cs2N.js} +2 -2
  119. package/dist/chunks/{textarea.DY0kNx0r.js.map → textarea.Dzy0cs2N.js.map} +1 -1
  120. package/dist/chunks/{timeline-item.dleRa6Yu.js → timeline-item.CuSRjcnT.js} +5 -5
  121. package/dist/chunks/{timeline-item.dleRa6Yu.js.map → timeline-item.CuSRjcnT.js.map} +1 -1
  122. package/dist/chunks/{tooltip.Di6i0aTd.js → tooltip.CFgesodr.js} +71 -71
  123. package/dist/chunks/{tooltip.Di6i0aTd.js.map → tooltip.CFgesodr.js.map} +1 -1
  124. package/dist/chunks/{tutorial.vue_vue_type_script_setup_true_lang.A0Wcwr8f.js → tutorial.vue_vue_type_script_setup_true_lang.s21s5Oso.js} +4 -4
  125. package/dist/chunks/{tutorial.vue_vue_type_script_setup_true_lang.A0Wcwr8f.js.map → tutorial.vue_vue_type_script_setup_true_lang.s21s5Oso.js.map} +1 -1
  126. package/dist/chunks/{use-cached-selected-values.BgoZ5uGq.js → use-cached-selected-values.CE98s5Ai.js} +3 -3
  127. package/dist/chunks/{use-cached-selected-values.BgoZ5uGq.js.map → use-cached-selected-values.CE98s5Ai.js.map} +1 -1
  128. package/dist/code-snippet.js +1 -1
  129. package/dist/dashboard-template.js +1 -1
  130. package/dist/dashed-underline.js +1 -1
  131. package/dist/data-grid-template.js +1 -1
  132. package/dist/data-grid.js +1 -1
  133. package/dist/date-picker.js +2 -2
  134. package/dist/date-range-picker.js +2 -2
  135. package/dist/dropdown.js +3 -3
  136. package/dist/file-uploader.js +1 -1
  137. package/dist/filter-bar.js +1 -1
  138. package/dist/header-with-views.js +1 -1
  139. package/dist/header.js +1 -1
  140. package/dist/index.js +156 -154
  141. package/dist/index.js.map +1 -1
  142. package/dist/info-icon.js +1 -1
  143. package/dist/input-field-password.js +1 -1
  144. package/dist/input-field-phone-number.js +1 -1
  145. package/dist/input-field.js +1 -1
  146. package/dist/internal.js +10 -10
  147. package/dist/menu.js +1 -1
  148. package/dist/modal-fullscreen.js +1 -1
  149. package/dist/modal.js +2 -2
  150. package/dist/pagination.js +1 -1
  151. package/dist/popover.js +1 -1
  152. package/dist/radio-group.js +1 -1
  153. package/dist/rich-text-editor.js +2 -6218
  154. package/dist/rich-text-editor.js.map +1 -1
  155. package/dist/search-bar.js +2 -2
  156. package/dist/secondary-nav.js +1 -1
  157. package/dist/segmented-control.js +1 -1
  158. package/dist/selection-card.js +1 -1
  159. package/dist/sidepanel.js +1 -1
  160. package/dist/structured-list.js +1 -1
  161. package/dist/styles/bento-dark.css +15 -15
  162. package/dist/styles/bento-light.css +95 -95
  163. package/dist/styles/bento.css +95 -95
  164. package/dist/styles/legacy.css +96 -96
  165. package/dist/styles/styleguide.css +96 -96
  166. package/dist/styles/utility.css +64 -64
  167. package/dist/summary-grid.js +1 -1
  168. package/dist/tag.js +1 -1
  169. package/dist/textarea.js +1 -1
  170. package/dist/timeline.js +1 -1
  171. package/dist/tutorial.js +1 -1
  172. package/dist/web-types.json +1 -1
  173. package/package.json +3 -3
  174. package/dist/chunks/calendar.D61aBwg1.js +0 -1249
  175. package/dist/chunks/calendar.D61aBwg1.js.map +0 -1
  176. package/dist/chunks/data-grid.BVcmZ1X_.js +0 -3519
  177. package/dist/chunks/data-grid.BVcmZ1X_.js.map +0 -1
  178. package/dist/chunks/date-range-picker.RzinIKLS.js +0 -1110
  179. package/dist/chunks/date-range-picker.RzinIKLS.js.map +0 -1
  180. package/dist/chunks/filter-bar.BbLKMSsn.js.map +0 -1
  181. package/dist/chunks/input-field-password.Bv_0ulNg.js +0 -348
  182. package/dist/chunks/input-field-password.Bv_0ulNg.js.map +0 -1
  183. package/dist/chunks/pagination.fwhC8tEq.js +0 -445
  184. package/dist/chunks/pagination.fwhC8tEq.js.map +0 -1
@@ -0,0 +1,1171 @@
1
+ import { reactive as Te, defineComponent as ze, computed as T, ref as F, onMounted as Je, toRaw as ke, resolveComponent as E, createElementBlock as Ee, openBlock as w, createElementVNode as Y, createCommentVNode as _, renderSlot as _e, createBlock as K, createVNode as Q, withCtx as V, createTextVNode as ae, normalizeClass as he, toRef as Re, watch as Se, resolveDirective as pt, withDirectives as vt, withKeys as gt, toDisplayString as yt, createSlots as Tt } from "vue";
2
+ import { B as bt } from "./divider.qUOSAbU6.js";
3
+ import { B as It } from "./popover.DiIZe9RM.js";
4
+ import { B as Xe, d as Rt } from "./typography.DN5eC5ch.js";
5
+ import { D as St } from "./dropdown-default-textbox.BNhy-QDH.js";
6
+ import { r as O, t as z, g as we } from "./get-date-locale.BN8xEjY0.js";
7
+ import { g as le } from "./generate-uid.NJ8tVoha.js";
8
+ import { u as Oe } from "./i18n.B6g5VX0q.js";
9
+ import { t as de, f as ue } from "./date.CKXySBQv.js";
10
+ import { e as Ze, f as ie, i as j, g as oe, h as Ue, j as kt, k as Be, l as Et, s as Pe, m as ht, n as Ne, a as W, u as wt } from "./calendar.DzwpAB0z.js";
11
+ import { f as qe, v as Ot, D as h } from "./date-input.BqBdAO1E.js";
12
+ import { u as Mt } from "./use-form-layout-loading.D3lALhtC.js";
13
+ import { B as Ct } from "./directive.Cbdox5VL.js";
14
+ import "./events.FNmSWp_P.js";
15
+ import { B as At } from "./input-field.CUfSQLYO.js";
16
+ import { B as Ft } from "./dropdown.CnMnzXc2.js";
17
+ import { B as _t } from "./segmented-control.ClJS7gzl.js";
18
+ import { d as ge } from "./debounce.DUTu11PS.js";
19
+ import { u as Ut } from "./use-has-slot.B7eQSabc.js";
20
+ import { e as G, a as $e } from "./index.BDuTpjD8.js";
21
+ import { _ as xe } from "./_plugin-vue_export-helper.CHgC5LLL.js";
22
+ import { F as Bt, E as Pt } from "./error-message.KTNWtFyf.js";
23
+ import { B as Nt, c as qt } from "./button-actions.WnxN4KnV.js";
24
+ import "../assets/date-range-picker.css";
25
+ function et(e, a) {
26
+ O(2, arguments);
27
+ var s = de(a), i = s * 3;
28
+ return Ze(e, i);
29
+ }
30
+ function Le(e) {
31
+ O(1, arguments);
32
+ var a = z(e), s = Math.floor(a.getMonth() / 3) + 1;
33
+ return s;
34
+ }
35
+ function Ye(e) {
36
+ return O(1, arguments), z(e).getFullYear();
37
+ }
38
+ function $t(e, a) {
39
+ O(2, arguments);
40
+ var s = z(e), i = z(a);
41
+ return s.getTime() === i.getTime();
42
+ }
43
+ function Lt(e, a) {
44
+ O(2, arguments);
45
+ var s = ie(e), i = ie(a);
46
+ return s.getTime() === i.getTime();
47
+ }
48
+ function Ve(e) {
49
+ O(1, arguments);
50
+ var a = z(e);
51
+ return a.setMilliseconds(0), a;
52
+ }
53
+ function je(e, a) {
54
+ O(2, arguments);
55
+ var s = Ve(e), i = Ve(a);
56
+ return s.getTime() === i.getTime();
57
+ }
58
+ function Yt(e) {
59
+ return O(1, arguments), j(e, Date.now());
60
+ }
61
+ function Vt(e, a) {
62
+ O(2, arguments);
63
+ var s = z(e), i = de(a);
64
+ return s.setHours(i), s;
65
+ }
66
+ function jt(e, a) {
67
+ O(2, arguments);
68
+ var s = z(e), i = de(a);
69
+ return s.setMinutes(i), s;
70
+ }
71
+ function Kt(e, a) {
72
+ O(2, arguments);
73
+ var s = z(e), i = de(a);
74
+ return s.setSeconds(i), s;
75
+ }
76
+ function Qt(e, a) {
77
+ O(2, arguments);
78
+ var s = de(a);
79
+ return et(e, -s);
80
+ }
81
+ function be(e) {
82
+ if (e == null)
83
+ return oe(/* @__PURE__ */ new Date());
84
+ const [a, s, i] = e.split("-").map((l) => parseInt(l, 10));
85
+ return new Date(a, s - 1, i);
86
+ }
87
+ const Gt = ({
88
+ firstDayOfWeek: e,
89
+ min: a,
90
+ max: s
91
+ }) => ({ getGranularCalendarLimits: (l) => {
92
+ let c = oe(a), D = G(s);
93
+ if ((l == null ? void 0 : l.type) === "weekly") {
94
+ if (l.earliest)
95
+ c = oe(l.earliest);
96
+ else {
97
+ const n = Ue(c, { weekStartsOn: e });
98
+ j(c, n) || (c = oe(kt(Be(c, { weekStartsOn: e }), 1)));
99
+ }
100
+ if (l.latest)
101
+ D = G(l.latest);
102
+ else {
103
+ const n = Be(D, { weekStartsOn: e });
104
+ j(D, n) || (D = G(Et(Ue(D, { weekStartsOn: e }), 1)));
105
+ }
106
+ }
107
+ if ((l == null ? void 0 : l.type) === "monthly") {
108
+ if (l.earliest)
109
+ c = oe(l.earliest);
110
+ else {
111
+ const n = Pe(c);
112
+ j(c, n) || (c = Pe(Ze(c, 1)));
113
+ }
114
+ if (l.latest)
115
+ D = G(l.latest);
116
+ else {
117
+ const n = $e(D);
118
+ j(D, n) || (D = $e(ht(D, 1)));
119
+ }
120
+ }
121
+ if ((l == null ? void 0 : l.type) === "quarterly") {
122
+ if (l.earliest)
123
+ c = ie(l.earliest);
124
+ else {
125
+ const n = ie(c);
126
+ j(c, n) || (c = ie(et(c, 1)));
127
+ }
128
+ if (l.latest)
129
+ D = G(l.latest);
130
+ else {
131
+ const n = Ne(D);
132
+ j(D, n) || (D = Ne(Qt(D, 1)));
133
+ }
134
+ }
135
+ return { min: c, max: D };
136
+ } }), Ht = () => {
137
+ const e = Te({
138
+ daily: null,
139
+ weekly: null,
140
+ monthly: null,
141
+ quarterly: null
142
+ });
143
+ return {
144
+ savedRanges: e,
145
+ saveRange: (i, l) => {
146
+ e[i] = l;
147
+ },
148
+ resetSavedRanges: () => {
149
+ e.daily = null, e.weekly = null, e.monthly = null, e.quarterly = null;
150
+ }
151
+ };
152
+ };
153
+ var g = /* @__PURE__ */ ((e) => (e.CUSTOM_RANGE = "custom-range", e.INPUT = "input", e.ERROR = "error", e.FORM_DATE = "form-date", e.START_DATE_SELECTED = "start-date-selected", e))(g || {});
154
+ const Wt = /[\d]/, zt = /^\d{2}$/, Jt = /^\d{2}:\d{2}$/, Xt = (e) => {
155
+ const { selectionStart: a } = e.target, s = Wt.test(e.key) || e.key === "Backspace" || e.key === "Tab", i = [1, 2, 4, 5].includes(a) && e.key === ":";
156
+ !s && !i && e.preventDefault();
157
+ }, Ke = (e) => {
158
+ if (!e)
159
+ return e;
160
+ let a = e;
161
+ if (a.length === 1 && parseInt(e, 10) > 2)
162
+ return `0${a}:`;
163
+ const [s, i] = a.slice(-2);
164
+ return [2, 5].includes(a.length) && i === ":" && (a = `${a.slice(0, a.length - 2)}0${s}`), (zt.test(a) || Jt.test(a)) && (a += ":"), a;
165
+ }, Qe = {
166
+ "en-US": {
167
+ customRange: "Custom range",
168
+ daily: "Daily",
169
+ dateFrom: "Date from",
170
+ dateTo: "Date to",
171
+ lastMonth: "Last month",
172
+ lastSevenDays: "Last 7 days",
173
+ lastThreeMonths: "Last three months",
174
+ monthly: "Monthly",
175
+ quarterly: "Quarterly",
176
+ timeFrom: "Time from",
177
+ timeTo: "Time to",
178
+ weekly: "Weekly"
179
+ },
180
+ "ja-JP": {
181
+ customRange: "カスタム範囲を選択",
182
+ daily: "毎日",
183
+ lastMonth: "先月",
184
+ lastSevenDays: "過去7日間",
185
+ monthly: "毎月",
186
+ weekly: "毎週"
187
+ },
188
+ "pt-BR": {
189
+ customRange: "Selecione um intervalo personalizado",
190
+ daily: "Diário",
191
+ lastMonth: "Último mês",
192
+ lastSevenDays: "Últimos 7 dias",
193
+ monthly: "Mensal",
194
+ weekly: "Semanal"
195
+ }
196
+ }, Ge = 300, He = "customRange", Zt = ze({
197
+ i18n: { messages: Qe },
198
+ name: "date-range-picker-calendar",
199
+ components: {
200
+ BentoDropdown: Ft,
201
+ BentoInputField: At,
202
+ BentoSegmentedControl: _t,
203
+ BentoTypography: Xe,
204
+ Calendar: W
205
+ },
206
+ props: {
207
+ /**
208
+ * Allows user to enter time values in the form
209
+ */
210
+ allowTimeInput: { type: Boolean, default: !1 },
211
+ /**
212
+ * Ranges form persistance data
213
+ */
214
+ dateFormData: {
215
+ type: Object,
216
+ default: () => ({ startDate: void 0, endDate: void 0, startTime: void 0, endTime: void 0 })
217
+ },
218
+ /**
219
+ * Allows you to set the first day of the week. 0 is sunday, 1 is monday, 6 is saturday
220
+ */
221
+ firstDayOfWeek: W.props.firstDayOfWeek,
222
+ /**
223
+ * A list of available granularities.
224
+ * If present, the date picker will display a segmented control to change granularity.
225
+ */
226
+ granularities: {
227
+ type: Array,
228
+ default: null
229
+ },
230
+ /**
231
+ * Indicate if a date should be disabled or not
232
+ */
233
+ isDateDisabled: W.props.isDateDisabled,
234
+ /**
235
+ * Set a maximum number of dates to be selectable by the range.
236
+ */
237
+ maxRange: W.props.maxRange,
238
+ /**
239
+ * Sets a minimum limit for selectable dates - dates before `min` will not be selectable
240
+ */
241
+ min: W.props.min,
242
+ /**
243
+ * Sets a maximum limit for selectable dates - dates after `max` will not be selectable
244
+ */
245
+ max: W.props.max,
246
+ /**
247
+ * Number of months rendered on pane
248
+ */
249
+ numberOfMonths: W.props.numberOfMonths,
250
+ /**
251
+ * Displays the end date's month when the calendar is opened. Defaults to false i.e. the start date's month is displayed.
252
+ */
253
+ showEndDateOnOpen: { type: Boolean, default: !1 },
254
+ /**
255
+ * Enables the custom range selector.
256
+ * If provided, must be an array that sets the custom range dropdown items. Items are of the structure:
257
+ * `label` - label of custom range item.
258
+ * `value` - a unique key of the custom range item.
259
+ * `data` - an object `{ startDate: Date; endDate: Date }` to set the date picker range to upon selecting.
260
+ */
261
+ quickSelectRanges: {
262
+ type: Array,
263
+ default: void 0
264
+ },
265
+ /**
266
+ * Selected date
267
+ */
268
+ value: { type: Object, default: void 0 },
269
+ /**
270
+ * The type of calendar to display. Defaults to showing days.
271
+ */
272
+ variant: W.props.variant
273
+ },
274
+ emits: [
275
+ g.CUSTOM_RANGE,
276
+ g.INPUT,
277
+ g.ERROR,
278
+ g.FORM_DATE,
279
+ g.START_DATE_SELECTED
280
+ ],
281
+ setup(e, { emit: a, slots: s }) {
282
+ var Me, Ce, Ae, Fe;
283
+ const { locale: i, t: l } = Oe({ messages: Qe }), c = we(), D = T(() => e.variant === "month" ? "monthly" : "daily"), n = Te({
284
+ startDate: (Me = e.value) == null ? void 0 : Me.startDate,
285
+ endDate: (Ce = e.value) == null ? void 0 : Ce.endDate,
286
+ range: (Ae = e.value) == null ? void 0 : Ae.range,
287
+ ...e.granularities ? {
288
+ granularity: ((Fe = e.value) == null ? void 0 : Fe.granularity) || D.value
289
+ } : {}
290
+ });
291
+ function p(t) {
292
+ return new Date(
293
+ t.getUTCFullYear(),
294
+ t.getUTCMonth(),
295
+ t.getUTCDate(),
296
+ t.getUTCHours(),
297
+ t.getUTCMinutes(),
298
+ t.getUTCSeconds()
299
+ );
300
+ }
301
+ const v = T(() => {
302
+ var t, r;
303
+ return (
304
+ // eslint-disable-next-line consistent-return
305
+ ((r = (t = e == null ? void 0 : e.quickSelectRanges) == null ? void 0 : t.find(({ value: u, data: d }) => {
306
+ if (!d.endDate)
307
+ return u === n.range || $t(
308
+ p(d.startDate),
309
+ p(n.startDate)
310
+ ) && Yt(n.endDate);
311
+ if (e.allowTimeInput)
312
+ return je(
313
+ p(d.startDate),
314
+ p(n.startDate)
315
+ ) && je(p(d.endDate), p(n.endDate));
316
+ if (d.endDate)
317
+ return j(d.startDate, n.startDate) && j(d.endDate, n.endDate);
318
+ })) == null ? void 0 : r.value) ?? He
319
+ );
320
+ }), H = T(() => ({
321
+ "b-date-range-picker-calendar__form-input-wrapper": e.allowTimeInput
322
+ })), b = T(() => [
323
+ { label: l("customRange"), value: He },
324
+ ...C.value ? C.value : []
325
+ ]), M = T(
326
+ () => {
327
+ var t;
328
+ return ((t = e.granularities) == null ? void 0 : t.find(({ type: r }) => r === n.granularity)) || null;
329
+ }
330
+ ), I = T(
331
+ () => {
332
+ var t;
333
+ return ((t = e.granularities) == null ? void 0 : t.map(({ type: r, disabled: u }) => ({
334
+ label: l(r),
335
+ value: r,
336
+ disabled: u
337
+ }))) ?? [];
338
+ }
339
+ ), C = T(
340
+ () => e.quickSelectRanges && e.quickSelectRanges.map((t) => ({
341
+ ...t,
342
+ data: {
343
+ ...t.data,
344
+ // Adding timeDifference to calculate an up-to-date endDate on range selection
345
+ timeDifference: t.data.endDate ? void 0 : new Date(Date.now()).getTime() - t.data.startDate.getTime()
346
+ }
347
+ }))
348
+ ), { getGranularCalendarLimits: P } = Gt(e), f = T(
349
+ () => e.granularities ? P(M.value) : { min: oe(e.min), max: G(e.max) }
350
+ ), {
351
+ adjustDateForQuarterly: J,
352
+ adjustDateForMonthly: N,
353
+ adjustDateForWeekly: y,
354
+ adjustStartDateInputForWeekly: U,
355
+ adjustEndDateInputForWeekly: q,
356
+ adjustStartDateInputForMonthly: A,
357
+ adjustEndDateInputForMonthly: se,
358
+ adjustStartDateInputForQuarterly: me,
359
+ adjustEndDateInputForQuarterly: ce
360
+ } = wt(e.firstDayOfWeek), { savedRanges: S, saveRange: ne, resetSavedRanges: De } = Ht(), R = (t) => t ? ue(t, h.NUMERIC_DATE_YEAR_FIRST, {
361
+ locale: c[i.value.substring(0, 2)] || c.enUS
362
+ }) : "", re = (t) => t ? ue(t, h.HOUR_MINUTE_SECONDS, {
363
+ locale: c[i.value.substring(0, 2)] || c.enUS
364
+ }) : "", X = F(!1), Z = F(!1), x = F(!1), ee = F(!1), o = Te({
365
+ startDate: e.dateFormData.startDate,
366
+ endDate: e.dateFormData.endDate,
367
+ startTime: e.dateFormData.startTime,
368
+ endTime: e.dateFormData.endTime
369
+ }), fe = (t) => /^(?:[01]\d|2[01234]):(?:[012345]\d):(?:[012345]\d)$/.test(t), m = (t, r) => {
370
+ if (!r || !fe(r) || e.variant === "month")
371
+ return t;
372
+ let u = new Date(t);
373
+ const [d, k, te] = r.split(":");
374
+ return u = Vt(u, parseInt(d, 10)), u = jt(u, parseInt(k, 10)), u = Kt(u, parseInt(te, 10)), u;
375
+ }, $ = (t) => {
376
+ n.startDate = m(t.startDate, o.startTime), n.endDate = m(t.endDate, o.endTime), n.range = null, e.granularities && De(), a(g.INPUT, {
377
+ ...n,
378
+ range: v.value
379
+ });
380
+ }, B = (t) => {
381
+ const r = (d) => e.min && d <= e.min || e.max && d >= e.max ? !1 : e.isDateDisabled ? !e.isDateDisabled(d) : !0;
382
+ return /^\d{4}-(0?[1-9]|1[012])-(0?[1-9]|[12][0-9]|3[01])$/.test(t) && r(new Date(t));
383
+ };
384
+ Je(() => {
385
+ e.dateFormData.startDate && !B(e.dateFormData.startDate) ? X.value = !0 : (X.value = !1, x.value = !1), e.dateFormData.endDate && !B(e.dateFormData.endDate) ? Z.value = !0 : (Z.value = !1, ee.value = !1);
386
+ });
387
+ const Ie = (t) => {
388
+ var r;
389
+ o.startDate = R(t), o.startTime ? x.value && (o.startTime = (r = e.dateFormData) == null ? void 0 : r.startTime) : o.startTime = re(t), X.value = !1, x.value = !1, a(g.START_DATE_SELECTED, t);
390
+ }, tt = (t) => {
391
+ var r;
392
+ o.endDate = R(t), o.endTime ? ee.value && (o.endTime = (r = e.dateFormData) == null ? void 0 : r.endTime) : o.endTime = re(G(t)), Z.value = !1, ee.value = !1;
393
+ }, pe = (t) => {
394
+ const r = e.value[t];
395
+ if (r)
396
+ return r;
397
+ if (e.dateFormData[t] && B(e.dateFormData[t]))
398
+ return new Date(e.dateFormData[t]);
399
+ }, at = ge((t) => {
400
+ var r;
401
+ if (B(t)) {
402
+ let u = t;
403
+ switch (X.value = !1, (r = M.value) == null ? void 0 : r.type) {
404
+ case "weekly":
405
+ u = U(
406
+ t,
407
+ R,
408
+ f.value.min,
409
+ f.value.max
410
+ ), o.startDate = u;
411
+ break;
412
+ case "monthly":
413
+ u = A(
414
+ t,
415
+ R,
416
+ f.value.min,
417
+ f.value.max
418
+ ), o.startDate = u;
419
+ break;
420
+ case "quarterly":
421
+ u = me(
422
+ t,
423
+ R,
424
+ f.value.min,
425
+ f.value.max
426
+ ), o.startDate = u;
427
+ break;
428
+ }
429
+ const d = be(u);
430
+ n.startDate = m(d, o.startTime);
431
+ const k = pe("endDate");
432
+ a(g.FORM_DATE, {
433
+ startDate: d,
434
+ endDate: k
435
+ }), a(g.INPUT, {
436
+ ...n,
437
+ range: v.value
438
+ });
439
+ } else
440
+ X.value = !0, a(g.ERROR, { ...o });
441
+ }, Ge), nt = (t) => {
442
+ o.startDate = qe(t), at(o.startDate);
443
+ }, rt = ge((t) => {
444
+ var r;
445
+ if (B(t)) {
446
+ let u = t;
447
+ switch (Z.value = !1, (r = M.value) == null ? void 0 : r.type) {
448
+ case "weekly":
449
+ u = q(
450
+ t,
451
+ R,
452
+ f.value.min,
453
+ f.value.max
454
+ ), o.endDate = u;
455
+ break;
456
+ case "monthly":
457
+ u = se(
458
+ t,
459
+ R,
460
+ f.value.min,
461
+ f.value.max
462
+ ), o.endDate = u;
463
+ break;
464
+ case "quarterly":
465
+ u = ce(
466
+ t,
467
+ R,
468
+ f.value.min,
469
+ f.value.max
470
+ ), o.endDate = u;
471
+ break;
472
+ }
473
+ const d = be(u);
474
+ n.endDate = m(d, o.endTime);
475
+ const k = pe("startDate");
476
+ a(g.FORM_DATE, {
477
+ startDate: k,
478
+ endDate: d
479
+ }), a(g.INPUT, {
480
+ ...n,
481
+ range: v.value
482
+ });
483
+ } else
484
+ Z.value = !0, a(g.ERROR, { ...o });
485
+ }, Ge), ot = (t) => {
486
+ o.endDate = qe(t), rt(o.endDate);
487
+ }, st = (t) => {
488
+ Ot(t);
489
+ }, lt = ge((t) => {
490
+ if (fe(t)) {
491
+ x.value = !1, n.startDate = m(n.startDate, t);
492
+ const r = pe("endDate");
493
+ a(g.FORM_DATE, {
494
+ startDate: new Date(n.startDate),
495
+ endDate: r,
496
+ startTime: t,
497
+ endTime: e.dateFormData.endTime
498
+ }), a(g.INPUT, {
499
+ ...n,
500
+ range: v.value
501
+ });
502
+ } else
503
+ x.value = !0, a(g.ERROR, { ...o });
504
+ }), it = ge((t) => {
505
+ if (fe(t)) {
506
+ ee.value = !1, n.endDate = m(n.endDate, t);
507
+ const r = pe("startDate");
508
+ n.startDate = m(new Date(r), e.dateFormData.startTime), a(g.FORM_DATE, {
509
+ startDate: m(new Date(r), e.dateFormData.startTime),
510
+ endDate: new Date(n.endDate),
511
+ startTime: e.dateFormData.startTime,
512
+ endTime: t
513
+ }), a(g.INPUT, {
514
+ ...n,
515
+ range: v.value
516
+ });
517
+ } else
518
+ ee.value = !0, a(g.ERROR, { ...o });
519
+ }), ut = (t) => {
520
+ o.startTime = Ke(t), lt(o.startTime);
521
+ }, dt = (t) => {
522
+ o.endTime = Ke(t), it(o.endTime);
523
+ }, mt = (t) => {
524
+ Xt(t);
525
+ }, ve = (t, r, u, d) => {
526
+ n.startDate = t, n.endDate = r, u && (n.granularity = u), d && (n.range = d);
527
+ }, ct = (t) => {
528
+ var u;
529
+ const r = (u = C.value) == null ? void 0 : u.find(({ value: d }) => d === t);
530
+ if (r) {
531
+ De();
532
+ const d = r.data, k = d.endDate || new Date(Date.now()), te = d.timeDifference ? new Date(k.getTime() - d.timeDifference) : d.startDate;
533
+ o.endDate = R(k), o.startDate = R(te), ve(te, k, null, t), e.granularities && (n.granularity = d.granularity || D.value), o.startTime || (o.startTime = re(G(te))), o.endTime || (o.endTime = re(G(k))), n.startDate = te, n.endDate = k, a(g.CUSTOM_RANGE, {
534
+ ...r.data,
535
+ startDate: te,
536
+ endDate: k,
537
+ range: r.value
538
+ });
539
+ }
540
+ }, Dt = {
541
+ weekly: y,
542
+ monthly: N,
543
+ quarterly: J
544
+ }, ft = (t) => {
545
+ const r = n.granularity;
546
+ if (n.granularity = t, r && ne(r, structuredClone(ke(n))), n.startDate && n.endDate) {
547
+ switch (t) {
548
+ case "quarterly":
549
+ case "monthly":
550
+ case "weekly": {
551
+ if (S[t]) {
552
+ ve(S[t].startDate, S[t].endDate, t);
553
+ break;
554
+ }
555
+ const { startDate: u, endDate: d } = Dt[t](
556
+ n.startDate,
557
+ n.endDate,
558
+ f.value.min,
559
+ f.value.max
560
+ );
561
+ ve(u, d, t);
562
+ break;
563
+ }
564
+ case "daily":
565
+ S.daily && ve(S.daily.startDate, S.daily.endDate, t);
566
+ break;
567
+ }
568
+ o.startDate = R(n.startDate), o.endDate = R(n.endDate), a(g.INPUT, {
569
+ ...n,
570
+ range: v.value
571
+ });
572
+ }
573
+ };
574
+ return {
575
+ // Values
576
+ internalRangeDate: n,
577
+ dateTextInput: o,
578
+ endDateError: Z,
579
+ endTimeError: ee,
580
+ granularityItems: I,
581
+ selectedGranularity: M,
582
+ computedMinMax: f,
583
+ selectedRangeSelectorValue: v,
584
+ startDateError: X,
585
+ startTimeError: x,
586
+ adjustedQuickSelectRanges: C,
587
+ quickSelectRangeDefaultItems: b,
588
+ formInputWrapperConditionalClasses: H,
589
+ // Methods
590
+ hasSlot: Ut(s),
591
+ t: l,
592
+ // Events
593
+ onDateInput: $,
594
+ onDateInputKeyDown: st,
595
+ onEndDateInput: ot,
596
+ onEndDateSelected: tt,
597
+ onEndTimeInput: dt,
598
+ onGranularityInput: ft,
599
+ onRangeSelectorInput: ct,
600
+ onStartDateInput: nt,
601
+ onStartDateSelected: Ie,
602
+ onStartTimeInput: ut,
603
+ onTimeInputKeyDown: mt
604
+ };
605
+ }
606
+ }), xt = { class: "b-date-range-picker-calendar" }, ea = { class: "b-date-range-picker-calendar__form-container" }, ta = { class: "b-date-range-picker-calendar__form" }, aa = { key: 0 }, na = { class: "b-date-range-picker-calendar__calendars-container" };
607
+ function ra(e, a, s, i, l, c) {
608
+ const D = E("bento-dropdown"), n = E("bento-segmented-control"), p = E("bento-typography"), v = E("bento-input-field"), H = E("calendar");
609
+ return w(), Ee("div", xt, [
610
+ Y("div", ea, [
611
+ Y("div", ta, [
612
+ e.hasSlot("title") ? _e(e.$slots, "title", { key: 0 }, void 0, !0) : _("", !0),
613
+ e.adjustedQuickSelectRanges ? (w(), K(D, {
614
+ key: 1,
615
+ "aria-label": e.t("customRange"),
616
+ items: e.quickSelectRangeDefaultItems,
617
+ value: e.selectedRangeSelectorValue,
618
+ onInput: e.onRangeSelectorInput
619
+ }, null, 8, ["aria-label", "items", "value", "onInput"])) : _("", !0),
620
+ e.granularities ? (w(), K(n, {
621
+ key: 2,
622
+ items: e.granularityItems,
623
+ "model-value": e.internalRangeDate.granularity,
624
+ "full-width": "",
625
+ "onUpdate:modelValue": e.onGranularityInput
626
+ }, null, 8, ["items", "model-value", "onUpdate:modelValue"])) : _("", !0),
627
+ Y("div", null, [
628
+ Q(p, {
629
+ stronger: "",
630
+ el: "span",
631
+ class: "b-date-range-picker-calendar__label"
632
+ }, {
633
+ default: V(() => a[0] || (a[0] = [
634
+ ae(" From ")
635
+ ])),
636
+ _: 1
637
+ }),
638
+ Y("div", {
639
+ class: he(e.formInputWrapperConditionalClasses)
640
+ }, [
641
+ Q(v, {
642
+ "aria-label": e.t("dateFrom"),
643
+ value: e.dateTextInput.startDate,
644
+ error: e.startDateError,
645
+ class: "b-date-range-picker-calendar__form-input",
646
+ onInput: e.onStartDateInput,
647
+ onKeydown: e.onDateInputKeyDown
648
+ }, {
649
+ description: V(() => a[1] || (a[1] = [
650
+ ae("YYYY-MM-DD")
651
+ ])),
652
+ _: 1
653
+ }, 8, ["aria-label", "value", "error", "onInput", "onKeydown"]),
654
+ e.allowTimeInput ? (w(), K(v, {
655
+ key: 0,
656
+ "aria-label": e.t("timeFrom"),
657
+ value: e.dateTextInput.startTime,
658
+ error: e.startTimeError,
659
+ class: "b-date-range-picker-calendar__form-input",
660
+ onInput: e.onStartTimeInput,
661
+ onKeydown: e.onTimeInputKeyDown
662
+ }, {
663
+ description: V(() => a[2] || (a[2] = [
664
+ ae("HH:MM:SS")
665
+ ])),
666
+ _: 1
667
+ }, 8, ["aria-label", "value", "error", "onInput", "onKeydown"])) : _("", !0)
668
+ ], 2)
669
+ ]),
670
+ Y("div", null, [
671
+ Q(p, {
672
+ stronger: "",
673
+ el: "span",
674
+ class: "b-date-range-picker-calendar__label"
675
+ }, {
676
+ default: V(() => a[3] || (a[3] = [
677
+ ae(" To ")
678
+ ])),
679
+ _: 1
680
+ }),
681
+ Y("div", {
682
+ class: he(e.formInputWrapperConditionalClasses)
683
+ }, [
684
+ Q(v, {
685
+ class: "b-date-range-picker-calendar__form-input",
686
+ "aria-label": e.t("dateTo"),
687
+ value: e.dateTextInput.endDate,
688
+ error: e.endDateError,
689
+ onInput: e.onEndDateInput,
690
+ onKeydown: e.onDateInputKeyDown
691
+ }, {
692
+ description: V(() => a[4] || (a[4] = [
693
+ ae("YYYY-MM-DD")
694
+ ])),
695
+ _: 1
696
+ }, 8, ["aria-label", "value", "error", "onInput", "onKeydown"]),
697
+ e.allowTimeInput ? (w(), K(v, {
698
+ key: 0,
699
+ "aria-label": e.t("timeTo"),
700
+ value: e.dateTextInput.endTime,
701
+ error: e.endTimeError,
702
+ class: "b-date-range-picker-calendar__form-input",
703
+ onInput: e.onEndTimeInput,
704
+ onKeydown: e.onTimeInputKeyDown
705
+ }, {
706
+ description: V(() => a[5] || (a[5] = [
707
+ ae("HH:MM:SS")
708
+ ])),
709
+ _: 1
710
+ }, 8, ["aria-label", "value", "error", "onInput", "onKeydown"])) : _("", !0)
711
+ ], 2)
712
+ ])
713
+ ]),
714
+ e.hasSlot("actions") ? (w(), Ee("div", aa, [
715
+ _e(e.$slots, "actions", {}, void 0, !0)
716
+ ])) : _("", !0)
717
+ ]),
718
+ Y("div", na, [
719
+ Q(H, {
720
+ value: e.internalRangeDate,
721
+ "first-day-of-week": e.firstDayOfWeek,
722
+ "is-date-disabled": e.isDateDisabled,
723
+ "max-range": e.maxRange,
724
+ min: e.computedMinMax.min,
725
+ max: e.computedMinMax.max,
726
+ "number-of-months": e.numberOfMonths,
727
+ "show-end-date-on-open": e.showEndDateOnOpen,
728
+ granularity: e.selectedGranularity,
729
+ variant: e.variant,
730
+ "is-range": "",
731
+ onInput: e.onDateInput,
732
+ onStartDateSelected: e.onStartDateSelected,
733
+ onEndDateSelected: e.onEndDateSelected
734
+ }, null, 8, ["value", "first-day-of-week", "is-date-disabled", "max-range", "min", "max", "number-of-months", "show-end-date-on-open", "granularity", "variant", "onInput", "onStartDateSelected", "onEndDateSelected"])
735
+ ])
736
+ ]);
737
+ }
738
+ const L = /* @__PURE__ */ xe(Zt, [["render", ra], ["__scopeId", "data-v-bb68460c"]]), oa = ({
739
+ datePickerValue: e,
740
+ isDateIncorrect: a,
741
+ quickSelectRanges: s,
742
+ isMonthVariant: i
743
+ }) => {
744
+ var M, I, C, P;
745
+ const { locale: l, t: c } = Oe(), D = we(), n = (f) => !!f && !isNaN(f.getTime()), p = (f, J) => n(f) ? ue(f, J, {
746
+ locale: D[l.value.substring(0, 2)] || D.enUS
747
+ }) : void 0, v = Te({
748
+ startDate: p((M = e.value) == null ? void 0 : M.startDate, h.NUMERIC_DATE_YEAR_FIRST),
749
+ endDate: p((I = e.value) == null ? void 0 : I.endDate, h.NUMERIC_DATE_YEAR_FIRST),
750
+ startTime: p((C = e.value) == null ? void 0 : C.startDate, h.HOUR_MINUTE_SECONDS),
751
+ endTime: p((P = e.value) == null ? void 0 : P.endDate, h.HOUR_MINUTE_SECONDS)
752
+ });
753
+ return {
754
+ // Values
755
+ dateDisplayValue: T(() => {
756
+ var y;
757
+ if (a.value)
758
+ return `${v.startDate || ""} - ${v.endDate || ""}`;
759
+ if (!e.value || !e.value.startDate && !e.value.endDate)
760
+ return c("selectDateRange");
761
+ if ((y = s.value) != null && y.length) {
762
+ const U = s.value.find(({ value: q }) => {
763
+ var A;
764
+ return q === ((A = e.value) == null ? void 0 : A.range);
765
+ });
766
+ if (U)
767
+ return U.label;
768
+ }
769
+ if (e.value.granularity === "quarterly") {
770
+ const { startDate: U, endDate: q } = e.value, A = c("quarter", { quarter: Le(U), year: Ye(U) });
771
+ if (Lt(U, q))
772
+ return A;
773
+ const se = c("quarter", { quarter: Le(q), year: Ye(q) });
774
+ return `${A} - ${se}`;
775
+ }
776
+ const { startDate: f, endDate: J } = v, N = i != null && i.value ? h.LONG_MONTH_YEAR : h.FULL_DATE_MONTH_FIRST;
777
+ return `${p(be(f), N)} - ${p(
778
+ be(J),
779
+ N
780
+ )}`;
781
+ }),
782
+ textInputDisplayValue: v,
783
+ // Methods
784
+ formatTextInputDisplayValue: () => ""
785
+ };
786
+ };
787
+ var ye = /* @__PURE__ */ ((e) => (e.INPUT = "input", e))(ye || {});
788
+ const We = {
789
+ "en-US": {
790
+ apply: "Apply",
791
+ cancel: "Cancel",
792
+ dateRangePicker: "Date range picker {name}",
793
+ provideDateInAFormat: "Provide date in a YYYY-MM-DD format",
794
+ quarter: "Q{quarter} {year}",
795
+ selectDate: "Select a date",
796
+ selectDateRange: "Select a date range",
797
+ selectedDateIsNotAvailable: "Selected date is not available"
798
+ },
799
+ "ja-JP": {
800
+ apply: "適用",
801
+ cancel: "キャンセル",
802
+ selectDate: "日付を選択"
803
+ },
804
+ "pt-BR": {
805
+ apply: "Aplicar",
806
+ cancel: "Cancelar",
807
+ selectDate: "Selecione uma data"
808
+ }
809
+ }, sa = ze({
810
+ i18n: { messages: We },
811
+ name: "bento-date-range-picker",
812
+ components: {
813
+ BentoButtonActions: Nt,
814
+ BentoDivider: bt,
815
+ BentoTypography: Xe,
816
+ BentoPopover: It,
817
+ DateRangePickerCalendar: L,
818
+ DropdownInputDefault: St,
819
+ ErrorMessage: Pt,
820
+ FieldLabel: Bt
821
+ },
822
+ directives: { BentoClickOutsideDirective: Ct },
823
+ props: {
824
+ /**
825
+ * Allows user to enter time values in the form
826
+ */
827
+ allowTimeInput: { type: Boolean, default: !1 },
828
+ /**
829
+ * Descriptive supporting text visbile underneath the dropdown.
830
+ */
831
+ description: { type: String, default: void 0 },
832
+ /**
833
+ * Disables dropdown functionality.
834
+ */
835
+ disabled: { type: Boolean, default: !1 },
836
+ /**
837
+ * Displays component in an error state with an error message
838
+ */
839
+ errorMessage: { type: String, default: null },
840
+ /**
841
+ * Allows user to set the first day of the week. 0 is sunday, 1 is monday, 6 is saturday
842
+ */
843
+ firstDayOfWeek: L.props.firstDayOfWeek,
844
+ /**
845
+ * A list of available granularities.
846
+ * If present, the date picker will display a segmented control to change granularity.
847
+ */
848
+ granularities: L.props.granularities,
849
+ /**
850
+ * Indicate if a date should be disabled or not
851
+ */
852
+ isDateDisabled: L.props.isDateDisabled,
853
+ /**
854
+ * Text that is displayed as a label above the element.
855
+ */
856
+ label: { type: String, default: void 0 },
857
+ /**
858
+ * Upon opening date range picker, end date's month will be pre-selected.
859
+ */
860
+ showEndDateOnOpen: { type: Boolean, default: !1 },
861
+ /**
862
+ * Highlights the dropdown is optional.
863
+ */
864
+ optional: { type: Boolean, default: !1 },
865
+ /**
866
+ * The Boolean readonly property, when present, makes the element not mutable, meaning the user can not edit the date range picker.
867
+ */
868
+ readonly: { type: Boolean, default: !1 },
869
+ /**
870
+ * Highlights the dropdown is required.
871
+ */
872
+ required: { type: Boolean, default: !1 },
873
+ /**
874
+ * Adds a info icon next to the label to display the passed tooltip message.
875
+ */
876
+ tooltipText: { type: String, default: null },
877
+ /**
878
+ * Enables the range selector.
879
+ * If provided, must be an array that sets the custom range dropdown items. Items are of the structure:
880
+ * `label` - label of custom range item.
881
+ * `value` - a unique key of the custom range item.
882
+ * `data` - an object `{ startDate: Date; endDate: Date }` to set the date picker range to upon selecting.
883
+ */
884
+ quickSelectRanges: {
885
+ type: Array,
886
+ default: void 0
887
+ },
888
+ /**
889
+ * Set a maximum number of dates to be selectable by the range.
890
+ */
891
+ maxRange: L.props.maxRange,
892
+ /**
893
+ * Sets a minimum limit for selectable dates - dates before `min` will not be selectable
894
+ */
895
+ min: L.props.min,
896
+ /**
897
+ * Sets a maximum limit for selectable dates - dates after `max` will not be selectable
898
+ */
899
+ max: L.props.max,
900
+ /**
901
+ * Number of months rendered on pane
902
+ */
903
+ numberOfMonths: L.props.numberOfMonths,
904
+ /**
905
+ * Selected date
906
+ */
907
+ value: L.props.value,
908
+ /**
909
+ * The type of calendar to display. Defaults to showing days.
910
+ */
911
+ variant: {
912
+ type: String,
913
+ default: void 0
914
+ // Default will be set by @/internal/calendar
915
+ },
916
+ /**
917
+ * Enables the date picker selection to persist until it is explicitly applied.
918
+ * Displays a set of buttons: Apply and Cancel.
919
+ *
920
+ * @deprecated This will be the default behaviour in v2.0.0.
921
+ */
922
+ hasActions: { type: Boolean, default: !1 }
923
+ },
924
+ emits: [ye.INPUT],
925
+ setup(e, { emit: a }) {
926
+ const { locale: s, t: i } = Oe({ messages: We }), l = we(), c = le("bento-date-range-picker-container"), D = le("bento-date-range-picker-label"), n = le("bento-date-range-picker-description"), p = le("bento-date-range-picker-error"), v = le("bento-date-range-picker-date-error"), H = T(
927
+ () => e.label || i("dateRangePicker", { name: c })
928
+ ), b = F(!1), M = F(null), I = F(!1), { isReadOnly: C } = Mt(Re(e, "readonly"));
929
+ Se(
930
+ () => e.disabled,
931
+ () => {
932
+ e.disabled && I.value && (I.value = !1);
933
+ }
934
+ );
935
+ const P = T(() => e.hasActions ? !ne.value && b.value : b.value), f = T(() => ({
936
+ "b-date-range-picker__description--error": !!e.errorMessage || P.value
937
+ })), J = T(() => e.variant === "month"), { dateDisplayValue: N, textInputDisplayValue: y } = oa({
938
+ datePickerValue: Re(e, "value"),
939
+ isDateIncorrect: b,
940
+ quickSelectRanges: Re(e, "quickSelectRanges"),
941
+ isMonthVariant: J
942
+ }), U = T(
943
+ () => `${e.description ? n : ""} ${e.errorMessage ? p : ""} ${b.value ? v : ""}`.trim() || null
944
+ ), q = T(() => e.allowTimeInput && e.variant !== "month"), A = () => {
945
+ I.value = !1;
946
+ }, se = () => {
947
+ I.value = !0;
948
+ }, me = F(N.value), ce = F(
949
+ // textInputDisplayValue is a reactive object
950
+ structuredClone(ke(y))
951
+ ), S = F(e.value), ne = F(!0), De = T(
952
+ () => e.hasActions ? ce.value : y
953
+ ), R = T(
954
+ () => e.hasActions ? me.value : N.value
955
+ );
956
+ Je(() => {
957
+ if (e.hasActions || Rt(
958
+ 'BentoDateRangePicker "hasActions" property',
959
+ `Set the BentoDateRangePicker "hasActions" property true which will display the "Apply" and "Cancel" buttons.
960
+ This will be the default behavior in the v2 and "hasActions" will be removed.`,
961
+ "2.0.0"
962
+ ), e.granularities && e.variant !== "month" && e.granularities.find(({ type: m }) => m === "quarterly"))
963
+ throw new Error(
964
+ 'Quarterly granularity is only supported by BentoDateRangePicker with variant: "month"'
965
+ );
966
+ }), Se(
967
+ () => e.value,
968
+ () => {
969
+ me.value = N.value, ce.value = structuredClone(ke(y));
970
+ }
971
+ );
972
+ const re = T(() => [
973
+ {
974
+ title: i("apply"),
975
+ event: () => {
976
+ a(ye.INPUT, S.value), A(), ne.value = !0;
977
+ },
978
+ disabled: ne.value
979
+ },
980
+ {
981
+ title: i("cancel"),
982
+ event: A
983
+ }
984
+ ]);
985
+ return Se(S, (m) => {
986
+ if (e.hasActions) {
987
+ ne.value = b.value;
988
+ return;
989
+ }
990
+ a(ye.INPUT, m);
991
+ }), {
992
+ // Refs
993
+ inputContainerRef: M,
994
+ // Values,
995
+ dateDisplayValue: N,
996
+ datePickerContainerId: c,
997
+ descriptionConditionalClasses: f,
998
+ displayedTextInputValue: De,
999
+ displayedDateValue: R,
1000
+ isDateIncorrect: b,
1001
+ isDateRangePickerOpen: I,
1002
+ isReadOnly: C,
1003
+ labelId: D,
1004
+ descriptionId: n,
1005
+ dateErrorId: v,
1006
+ errorId: p,
1007
+ popoverAriaLabel: H,
1008
+ shouldDisplayError: P,
1009
+ ariaDescribedBy: U,
1010
+ textInputDisplayValue: y,
1011
+ rangePickerButtonActions: re,
1012
+ BentoButtonActionsLayout: qt,
1013
+ withTimeInput: q,
1014
+ // Events
1015
+ closeDateRangePicker: A,
1016
+ clearDateRangePickerValue: async () => {
1017
+ b.value && (b.value = !1), S.value = null;
1018
+ },
1019
+ openDateRangePicker: se,
1020
+ onRangeSelectorInput: (m) => {
1021
+ if (m) {
1022
+ const $ = (B) => ue(B, h.NUMERIC_DATE_YEAR_FIRST, {
1023
+ locale: l[s.value.substring(0, 2)] || l.enUS
1024
+ });
1025
+ y.startDate = $(m.startDate), y.endDate = $(m.endDate), S.value = m;
1026
+ }
1027
+ },
1028
+ onEnterPressedOverInput: () => {
1029
+ if (!I.value) {
1030
+ I.value = !0;
1031
+ return;
1032
+ }
1033
+ b.value || (I.value = !1);
1034
+ },
1035
+ onDateRangePickerInput: (m) => {
1036
+ b.value = !1;
1037
+ const $ = (B, Ie) => B ? ue(B, Ie, {
1038
+ locale: l[s.value.substring(0, 2)] || l.enUS
1039
+ }) : void 0;
1040
+ y.startDate = $(
1041
+ m.startDate,
1042
+ h.NUMERIC_DATE_YEAR_FIRST
1043
+ ), y.endDate = $(m.endDate, h.NUMERIC_DATE_YEAR_FIRST), y.startTime = $(m.startDate, h.HOUR_MINUTE_SECONDS), y.endTime = $(m.endDate, h.HOUR_MINUTE_SECONDS), S.value = m;
1044
+ },
1045
+ onDateRangePickerError: (m) => {
1046
+ b.value = !0, y.startDate = m.startDate, y.endDate = m.endDate, S.value = { startDate: null, endDate: null };
1047
+ },
1048
+ onDateRangePickerFormDateInputUpdate: (m) => {
1049
+ b.value = !1, m.startTime && (y.startTime = m.startTime), m.endTime && (y.endTime = m.endTime);
1050
+ },
1051
+ // Translations
1052
+ t: i
1053
+ };
1054
+ }
1055
+ }), la = { class: "b-date-range-picker" }, ia = { class: "b-date-range-picker__footer" };
1056
+ function ua(e, a, s, i, l, c) {
1057
+ const D = E("field-label"), n = E("dropdown-input-default"), p = E("error-message"), v = E("bento-typography"), H = E("bento-divider"), b = E("bento-button-actions"), M = E("date-range-picker-calendar"), I = E("bento-popover"), C = pt("bento-click-outside-directive");
1058
+ return vt((w(), Ee("div", la, [
1059
+ e.label ? (w(), K(D, {
1060
+ key: 0,
1061
+ id: e.labelId,
1062
+ label: e.label,
1063
+ "tooltip-text": e.tooltipText,
1064
+ optional: e.optional,
1065
+ required: e.required
1066
+ }, null, 8, ["id", "label", "tooltip-text", "optional", "required"])) : _("", !0),
1067
+ Y("div", {
1068
+ onKeydown: a[0] || (a[0] = gt((...P) => e.onEnterPressedOverInput && e.onEnterPressedOverInput(...P), ["enter"]))
1069
+ }, [
1070
+ Q(n, {
1071
+ ref: "inputContainerRef",
1072
+ "always-combobox-is-input": "",
1073
+ ariaControls: e.datePickerContainerId,
1074
+ ariaExpanded: e.isDateRangePickerOpen,
1075
+ "aria-labelledby": e.label ? e.labelId : null,
1076
+ "aria-describedby": e.ariaDescribedBy,
1077
+ disabled: e.disabled,
1078
+ "is-invalid": !!e.errorMessage || e.shouldDisplayError,
1079
+ open: e.isDateRangePickerOpen,
1080
+ "display-value": e.displayedDateValue,
1081
+ readonly: e.isReadOnly,
1082
+ onOpen: e.openDateRangePicker,
1083
+ onClear: e.clearDateRangePickerValue,
1084
+ onClose: e.closeDateRangePicker
1085
+ }, null, 8, ["ariaControls", "ariaExpanded", "aria-labelledby", "aria-describedby", "disabled", "is-invalid", "open", "display-value", "readonly", "onOpen", "onClear", "onClose"])
1086
+ ], 32),
1087
+ e.shouldDisplayError ? (w(), K(p, {
1088
+ key: 1,
1089
+ id: e.dateErrorId,
1090
+ "error-message": e.t("provideDateInAFormat"),
1091
+ class: "b-date-range-picker__error-message"
1092
+ }, null, 8, ["id", "error-message"])) : _("", !0),
1093
+ e.errorMessage ? (w(), K(p, {
1094
+ key: 2,
1095
+ id: e.errorId,
1096
+ "error-message": e.errorMessage,
1097
+ class: "b-date-range-picker__error-message"
1098
+ }, null, 8, ["id", "error-message"])) : _("", !0),
1099
+ e.description ? (w(), K(v, {
1100
+ key: 3,
1101
+ id: e.descriptionId,
1102
+ class: he(["b-date-range-picker__description", e.descriptionConditionalClasses]),
1103
+ el: "span"
1104
+ }, {
1105
+ default: V(() => [
1106
+ ae(yt(e.description), 1)
1107
+ ]),
1108
+ _: 1
1109
+ }, 8, ["id", "class"])) : _("", !0),
1110
+ e.inputContainerRef ? (w(), K(I, {
1111
+ key: 4,
1112
+ id: e.datePickerContainerId,
1113
+ class: "b-date-range-picker__container",
1114
+ open: e.isDateRangePickerOpen,
1115
+ "target-element": e.inputContainerRef,
1116
+ "disable-focus-trap": !0,
1117
+ "aria-label": e.popoverAriaLabel,
1118
+ position: "bottom-start",
1119
+ "without-space": "",
1120
+ "fit-content": ""
1121
+ }, {
1122
+ default: V(() => [
1123
+ Q(M, {
1124
+ "allow-time-input": e.withTimeInput,
1125
+ "quick-select-ranges": e.quickSelectRanges,
1126
+ value: e.value,
1127
+ "first-day-of-week": e.firstDayOfWeek,
1128
+ granularities: e.granularities,
1129
+ "is-date-disabled": e.isDateDisabled,
1130
+ "max-range": e.maxRange,
1131
+ min: e.min,
1132
+ max: e.max,
1133
+ "number-of-months": e.numberOfMonths,
1134
+ "show-end-date-on-open": e.showEndDateOnOpen,
1135
+ "date-form-data": e.displayedTextInputValue,
1136
+ variant: e.variant,
1137
+ onCustomRange: e.onRangeSelectorInput,
1138
+ onInput: e.onDateRangePickerInput,
1139
+ onError: e.onDateRangePickerError,
1140
+ onFormDate: e.onDateRangePickerFormDateInputUpdate
1141
+ }, Tt({ _: 2 }, [
1142
+ e.hasActions ? {
1143
+ name: "actions",
1144
+ fn: V(() => [
1145
+ Q(H),
1146
+ Y("div", ia, [
1147
+ Q(b, {
1148
+ actions: e.rangePickerButtonActions,
1149
+ layout: e.BentoButtonActionsLayout.SPACE_BETWEEN
1150
+ }, null, 8, ["actions", "layout"])
1151
+ ])
1152
+ ]),
1153
+ key: "0"
1154
+ } : void 0
1155
+ ]), 1032, ["allow-time-input", "quick-select-ranges", "value", "first-day-of-week", "granularities", "is-date-disabled", "max-range", "min", "max", "number-of-months", "show-end-date-on-open", "date-form-data", "variant", "onCustomRange", "onInput", "onError", "onFormDate"])
1156
+ ]),
1157
+ _: 1
1158
+ }, 8, ["id", "open", "target-element", "aria-label"])) : _("", !0)
1159
+ ])), [
1160
+ [C, e.closeDateRangePicker]
1161
+ ]);
1162
+ }
1163
+ const _a = /* @__PURE__ */ xe(sa, [["render", ua], ["__scopeId", "data-v-5b34fdfc"]]);
1164
+ export {
1165
+ _a as B,
1166
+ L as D,
1167
+ ye as a,
1168
+ Yt as b,
1169
+ $t as i
1170
+ };
1171
+ //# sourceMappingURL=date-range-picker.D-_e1W8W.js.map