@adyen/bento-vue2 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 (181) 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.nUvnRVwP.js → action-bar.CErJh_wJ.js} +4 -4
  25. package/dist/chunks/{action-bar.nUvnRVwP.js.map → action-bar.CErJh_wJ.js.map} +1 -1
  26. package/dist/chunks/{base-modal.DdznUtgC.js → base-modal.D4x_tmYO.js} +2 -2
  27. package/dist/chunks/{base-modal.DdznUtgC.js.map → base-modal.D4x_tmYO.js.map} +1 -1
  28. package/dist/chunks/{button-actions-with-menu.CDLJMdJh.js → button-actions-with-menu.BHmj0Xvn.js} +4 -4
  29. package/dist/chunks/{button-actions-with-menu.CDLJMdJh.js.map → button-actions-with-menu.BHmj0Xvn.js.map} +1 -1
  30. package/dist/chunks/{button-actions.DUn_iPDm.js → button-actions.V0te_IrY.js} +2 -2
  31. package/dist/chunks/{button-actions.DUn_iPDm.js.map → button-actions.V0te_IrY.js.map} +1 -1
  32. package/dist/chunks/calendar.C7onA58P.js +1166 -0
  33. package/dist/chunks/calendar.C7onA58P.js.map +1 -0
  34. package/dist/chunks/{card.BYUqSnBy.js → card.CC4BEw-7.js} +2 -2
  35. package/dist/chunks/{card.BYUqSnBy.js.map → card.CC4BEw-7.js.map} +1 -1
  36. package/dist/chunks/{checkbox-group.HhNN-r-o.js → checkbox-group.Bev3ogYa.js} +4 -4
  37. package/dist/chunks/{checkbox-group.HhNN-r-o.js.map → checkbox-group.Bev3ogYa.js.map} +1 -1
  38. package/dist/chunks/{checkbox.CkaV8-b-.js → checkbox.DCIphKqu.js} +3 -3
  39. package/dist/chunks/{checkbox.CkaV8-b-.js.map → checkbox.DCIphKqu.js.map} +1 -1
  40. package/dist/chunks/{code-snippet.B1_T5Y4d.js → code-snippet.BjtPvt9m.js} +5 -5
  41. package/dist/chunks/{code-snippet.B1_T5Y4d.js.map → code-snippet.BjtPvt9m.js.map} +1 -1
  42. package/dist/chunks/{controls-group.CG5RvOSi.js → controls-group.CtpaKQIg.js} +2 -2
  43. package/dist/chunks/{controls-group.CG5RvOSi.js.map → controls-group.CtpaKQIg.js.map} +1 -1
  44. package/dist/chunks/{copy.MTsLLiC0.js → copy.BggvtZCO.js} +2 -2
  45. package/dist/chunks/{copy.MTsLLiC0.js.map → copy.BggvtZCO.js.map} +1 -1
  46. package/dist/chunks/{dashboard-section.DYk4LVm8.js → dashboard-section.D9LPEZ88.js} +2 -2
  47. package/dist/chunks/{dashboard-section.DYk4LVm8.js.map → dashboard-section.D9LPEZ88.js.map} +1 -1
  48. package/dist/chunks/{dashed-underline.lDp966e8.js → dashed-underline.DGRnOVkG.js} +3 -3
  49. package/dist/chunks/{dashed-underline.lDp966e8.js.map → dashed-underline.DGRnOVkG.js.map} +1 -1
  50. package/dist/chunks/{data-grid-template.Dcnw2_Du.js → data-grid-template.CwqfhYua.js} +2 -2
  51. package/dist/chunks/{data-grid-template.Dcnw2_Du.js.map → data-grid-template.CwqfhYua.js.map} +1 -1
  52. package/dist/chunks/{data-grid.BNgBYl3r.js → data-grid.Dl3xh62_.js} +1163 -1098
  53. package/dist/chunks/data-grid.Dl3xh62_.js.map +1 -0
  54. package/dist/chunks/{date-picker.S8ABQaHP.js → date-picker.DgF85qSC.js} +15 -15
  55. package/dist/chunks/{date-picker.S8ABQaHP.js.map → date-picker.DgF85qSC.js.map} +1 -1
  56. package/dist/chunks/date-range-picker.CAQY6v7g.js +967 -0
  57. package/dist/chunks/date-range-picker.CAQY6v7g.js.map +1 -0
  58. package/dist/chunks/{dropdown-tag.BiJvxp5n.js → dropdown-tag.Cn6lz_lG.js} +3 -3
  59. package/dist/chunks/{dropdown-tag.BiJvxp5n.js.map → dropdown-tag.Cn6lz_lG.js.map} +1 -1
  60. package/dist/chunks/{dropdown.Qc6K5BzU.js → dropdown.C01pOog2.js} +18 -18
  61. package/dist/chunks/{dropdown.Qc6K5BzU.js.map → dropdown.C01pOog2.js.map} +1 -1
  62. package/dist/chunks/{error-message.JskAm-Td.js → error-message.dQtl9mYG.js} +2 -2
  63. package/dist/chunks/{error-message.JskAm-Td.js.map → error-message.dQtl9mYG.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.DhOTdtfm.js → file-uploader.D81zRKpY.js} +3 -3
  67. package/dist/chunks/{file-uploader.DhOTdtfm.js.map → file-uploader.D81zRKpY.js.map} +1 -1
  68. package/dist/chunks/{filter-bar.BFAsFxQo.js → filter-bar.CcsUi7Xg.js} +603 -575
  69. package/dist/chunks/filter-bar.CcsUi7Xg.js.map +1 -0
  70. package/dist/chunks/{footer-actions.CWOEDPKJ.js → footer-actions.Cn-793_Z.js} +2 -2
  71. package/dist/chunks/{footer-actions.CWOEDPKJ.js.map → footer-actions.Cn-793_Z.js.map} +1 -1
  72. package/dist/chunks/{header-with-views.CO2aEwi4.js → header-with-views.BTd57MWZ.js} +10 -10
  73. package/dist/chunks/{header-with-views.CO2aEwi4.js.map → header-with-views.BTd57MWZ.js.map} +1 -1
  74. package/dist/chunks/{header.byOrhnHk.js → header.Rr0lnNYz.js} +4 -4
  75. package/dist/chunks/{header.byOrhnHk.js.map → header.Rr0lnNYz.js.map} +1 -1
  76. package/dist/chunks/{info-icon-with-popover.Cfng_pMj.js → info-icon-with-popover.B9QgNl-S.js} +2 -2
  77. package/dist/chunks/{info-icon-with-popover.Cfng_pMj.js.map → info-icon-with-popover.B9QgNl-S.js.map} +1 -1
  78. package/dist/chunks/{info-icon.DgCYoVE3.js → info-icon.BL55W9hd.js} +2 -2
  79. package/dist/chunks/{info-icon.DgCYoVE3.js.map → info-icon.BL55W9hd.js.map} +1 -1
  80. package/dist/chunks/input-field-password.DMcXkdVE.js +251 -0
  81. package/dist/chunks/input-field-password.DMcXkdVE.js.map +1 -0
  82. package/dist/chunks/{input-field-phone-number.Bg9XyY_1.js → input-field-phone-number.Cfy_o9aE.js} +3 -3
  83. package/dist/chunks/{input-field-phone-number.Bg9XyY_1.js.map → input-field-phone-number.Cfy_o9aE.js.map} +1 -1
  84. package/dist/chunks/{input-field.DgUkNPXo.js → input-field.CP8Qui6G.js} +3 -3
  85. package/dist/chunks/{input-field.DgUkNPXo.js.map → input-field.CP8Qui6G.js.map} +1 -1
  86. package/dist/chunks/{listbox-option-tag.CBGk4m-_.js → listbox-option-tag.DDmqT1rs.js} +2 -2
  87. package/dist/chunks/{listbox-option-tag.CBGk4m-_.js.map → listbox-option-tag.DDmqT1rs.js.map} +1 -1
  88. package/dist/chunks/{menu.DZEDTBYV.js → menu.Dkesc658.js} +2 -2
  89. package/dist/chunks/{menu.DZEDTBYV.js.map → menu.Dkesc658.js.map} +1 -1
  90. package/dist/chunks/{modal-fullscreen.DRQ4V5tT.js → modal-fullscreen.D1pHbGYd.js} +2 -2
  91. package/dist/chunks/{modal-fullscreen.DRQ4V5tT.js.map → modal-fullscreen.D1pHbGYd.js.map} +1 -1
  92. package/dist/chunks/{modal.DDF63uBR.js → modal.bgya0ObK.js} +4 -4
  93. package/dist/chunks/{modal.DDF63uBR.js.map → modal.bgya0ObK.js.map} +1 -1
  94. package/dist/chunks/{pagination.1PxOrSA9.js → pagination.CaHPf-Ye.js} +82 -73
  95. package/dist/chunks/{pagination.1PxOrSA9.js.map → pagination.CaHPf-Ye.js.map} +1 -1
  96. package/dist/chunks/{popover.DXo3nXew.js → popover.CuOrBXcF.js} +2 -2
  97. package/dist/chunks/{popover.DXo3nXew.js.map → popover.CuOrBXcF.js.map} +1 -1
  98. package/dist/chunks/{radio-group.DtCgLBuL.js → radio-group.9jAj6AKb.js} +4 -4
  99. package/dist/chunks/{radio-group.DtCgLBuL.js.map → radio-group.9jAj6AKb.js.map} +1 -1
  100. package/dist/chunks/rich-text-editor.Ch-ETIRi.js +6203 -0
  101. package/dist/chunks/rich-text-editor.Ch-ETIRi.js.map +1 -0
  102. package/dist/chunks/{search-bar.-Lpxv9sU.js → search-bar.Cs60bUZc.js} +3 -3
  103. package/dist/chunks/{search-bar.-Lpxv9sU.js.map → search-bar.Cs60bUZc.js.map} +1 -1
  104. package/dist/chunks/{secondary-nav.DvTPsW8x.js → secondary-nav.i_Bb4wQF.js} +3 -3
  105. package/dist/chunks/{secondary-nav.DvTPsW8x.js.map → secondary-nav.i_Bb4wQF.js.map} +1 -1
  106. package/dist/chunks/{segmented-control.BQlmGv2x.js → segmented-control.BffWAGrf.js} +2 -2
  107. package/dist/chunks/{segmented-control.BQlmGv2x.js.map → segmented-control.BffWAGrf.js.map} +1 -1
  108. package/dist/chunks/{selection-card-group.BniN7KWU.js → selection-card-group.DTz7k_M7.js} +4 -4
  109. package/dist/chunks/{selection-card-group.BniN7KWU.js.map → selection-card-group.DTz7k_M7.js.map} +1 -1
  110. package/dist/chunks/{sidepanel.DfQaLZEA.js → sidepanel.DuTesKDW.js} +2 -2
  111. package/dist/chunks/{sidepanel.DfQaLZEA.js.map → sidepanel.DuTesKDW.js.map} +1 -1
  112. package/dist/chunks/{structured-list-item.xaedKywV.js → structured-list-item.-vyqAp4Y.js} +4 -4
  113. package/dist/chunks/{structured-list-item.xaedKywV.js.map → structured-list-item.-vyqAp4Y.js.map} +1 -1
  114. package/dist/chunks/{summary-grid.types.CNEeGgWh.js → summary-grid.types.fm_VmUVA.js} +5 -5
  115. package/dist/chunks/{summary-grid.types.CNEeGgWh.js.map → summary-grid.types.fm_VmUVA.js.map} +1 -1
  116. package/dist/chunks/{tag.C7kJJ5Ki.js → tag.DczYlfXd.js} +2 -2
  117. package/dist/chunks/{tag.C7kJJ5Ki.js.map → tag.DczYlfXd.js.map} +1 -1
  118. package/dist/chunks/{textarea.CdA36VsY.js → textarea.B7BgCn_l.js} +2 -2
  119. package/dist/chunks/{textarea.CdA36VsY.js.map → textarea.B7BgCn_l.js.map} +1 -1
  120. package/dist/chunks/{timeline-item.D87PFH_o.js → timeline-item.DdF6EN2w.js} +5 -5
  121. package/dist/chunks/{timeline-item.D87PFH_o.js.map → timeline-item.DdF6EN2w.js.map} +1 -1
  122. package/dist/chunks/{tooltip.8KbMqaXP.js → tooltip.Bm5S2goP.js} +65 -65
  123. package/dist/chunks/{tooltip.8KbMqaXP.js.map → tooltip.Bm5S2goP.js.map} +1 -1
  124. package/dist/chunks/{tutorial.D74hJVBb.js → tutorial.DIYd-V8c.js} +4 -4
  125. package/dist/chunks/{tutorial.D74hJVBb.js.map → tutorial.DIYd-V8c.js.map} +1 -1
  126. package/dist/chunks/{use-cached-selected-values.CSVs_E5A.js → use-cached-selected-values.BrkzIuaE.js} +3 -3
  127. package/dist/chunks/{use-cached-selected-values.CSVs_E5A.js.map → use-cached-selected-values.BrkzIuaE.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 +148 -146
  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 -6200
  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 +53 -7
  173. package/package.json +5 -5
  174. package/dist/chunks/calendar.C0iatn5N.js +0 -1127
  175. package/dist/chunks/calendar.C0iatn5N.js.map +0 -1
  176. package/dist/chunks/data-grid.BNgBYl3r.js.map +0 -1
  177. package/dist/chunks/date-range-picker.CQNhNKK-.js +0 -906
  178. package/dist/chunks/date-range-picker.CQNhNKK-.js.map +0 -1
  179. package/dist/chunks/filter-bar.BFAsFxQo.js.map +0 -1
  180. package/dist/chunks/input-field-password.D6PVCLoF.js +0 -233
  181. package/dist/chunks/input-field-password.D6PVCLoF.js.map +0 -1
@@ -0,0 +1,967 @@
1
+ import { reactive as ce, defineComponent as Pe, computed as g, ref as O, onMounted as Be, toRaw as pe, toRef as fe, watch as ve } from "vue";
2
+ import { B as at } from "./divider.Cc4JFWG_.js";
3
+ import { B as nt } from "./popover.CuOrBXcF.js";
4
+ import { B as Ne, d as rt } from "./typography.J1v_SPG3.js";
5
+ import { D as st } from "./dropdown-default-textbox.AUsF-RIc.js";
6
+ import { r as E, t as L, g as ge } from "./get-date-locale.BN8xEjY0.js";
7
+ import { g as X } from "./generate-uid.NJ8tVoha.js";
8
+ import { u as ye } from "./i18n.BQkEbtPM.js";
9
+ import { t as te, f as ee } from "./date.dYFFEunA.js";
10
+ import { e as qe, f as Z, i as B, g as z, h as Ie, j as ot, k as Se, l as it, s as ke, m as lt, n as Ee, a as q, u as ut } from "./calendar.C7onA58P.js";
11
+ import { f as he, v as dt, D as k } from "./date-input.BqBdAO1E.js";
12
+ import { u as ct } from "./use-form-layout-loading.D3lALhtC.js";
13
+ import "./index.Cl4_42j5.js";
14
+ import { B as Dt } from "./input-field.CP8Qui6G.js";
15
+ import { B as mt } from "./dropdown.C01pOog2.js";
16
+ import { B as ft } from "./segmented-control.BffWAGrf.js";
17
+ import { d as ue } from "./debounce.DUTu11PS.js";
18
+ import { u as vt } from "./use-has-slot.C9lQZ6nz.js";
19
+ import { e as N, a as Oe } from "./index.BDuTpjD8.js";
20
+ import { n as Le } from "./_plugin-vue2_normalizer.CeySl7Fu.js";
21
+ import { B as pt } from "./directive.Cbdox5VL.js";
22
+ import { F as gt, E as yt } from "./error-message.dQtl9mYG.js";
23
+ import { B as Tt, c as _t } from "./button-actions.V0te_IrY.js";
24
+ import "../assets/date-range-picker.css";
25
+ function Ye(t, e) {
26
+ E(2, arguments);
27
+ var n = te(e), i = n * 3;
28
+ return qe(t, i);
29
+ }
30
+ function Me(t) {
31
+ E(1, arguments);
32
+ var e = L(t), n = Math.floor(e.getMonth() / 3) + 1;
33
+ return n;
34
+ }
35
+ function we(t) {
36
+ return E(1, arguments), L(t).getFullYear();
37
+ }
38
+ function Rt(t, e) {
39
+ E(2, arguments);
40
+ var n = L(t), i = L(e);
41
+ return n.getTime() === i.getTime();
42
+ }
43
+ function bt(t, e) {
44
+ E(2, arguments);
45
+ var n = Z(t), i = Z(e);
46
+ return n.getTime() === i.getTime();
47
+ }
48
+ function Ce(t) {
49
+ E(1, arguments);
50
+ var e = L(t);
51
+ return e.setMilliseconds(0), e;
52
+ }
53
+ function xe(t, e) {
54
+ E(2, arguments);
55
+ var n = Ce(t), i = Ce(e);
56
+ return n.getTime() === i.getTime();
57
+ }
58
+ function It(t) {
59
+ return E(1, arguments), B(t, Date.now());
60
+ }
61
+ function St(t, e) {
62
+ E(2, arguments);
63
+ var n = L(t), i = te(e);
64
+ return n.setHours(i), n;
65
+ }
66
+ function kt(t, e) {
67
+ E(2, arguments);
68
+ var n = L(t), i = te(e);
69
+ return n.setMinutes(i), n;
70
+ }
71
+ function Et(t, e) {
72
+ E(2, arguments);
73
+ var n = L(t), i = te(e);
74
+ return n.setSeconds(i), n;
75
+ }
76
+ function ht(t, e) {
77
+ E(2, arguments);
78
+ var n = te(e);
79
+ return Ye(t, -n);
80
+ }
81
+ function De(t) {
82
+ if (t == null)
83
+ return z(/* @__PURE__ */ new Date());
84
+ const [e, n, i] = t.split("-").map((l) => parseInt(l, 10));
85
+ return new Date(e, n - 1, i);
86
+ }
87
+ const Ot = ({
88
+ firstDayOfWeek: t,
89
+ min: e,
90
+ max: n
91
+ }) => ({ getGranularCalendarLimits: (l) => {
92
+ let D = z(e), f = N(n);
93
+ if ((l == null ? void 0 : l.type) === "weekly") {
94
+ if (l.earliest)
95
+ D = z(l.earliest);
96
+ else {
97
+ const r = Ie(D, { weekStartsOn: t });
98
+ B(D, r) || (D = z(ot(Se(D, { weekStartsOn: t }), 1)));
99
+ }
100
+ if (l.latest)
101
+ f = N(l.latest);
102
+ else {
103
+ const r = Se(f, { weekStartsOn: t });
104
+ B(f, r) || (f = N(it(Ie(f, { weekStartsOn: t }), 1)));
105
+ }
106
+ }
107
+ if ((l == null ? void 0 : l.type) === "monthly") {
108
+ if (l.earliest)
109
+ D = z(l.earliest);
110
+ else {
111
+ const r = ke(D);
112
+ B(D, r) || (D = ke(qe(D, 1)));
113
+ }
114
+ if (l.latest)
115
+ f = N(l.latest);
116
+ else {
117
+ const r = Oe(f);
118
+ B(f, r) || (f = Oe(lt(f, 1)));
119
+ }
120
+ }
121
+ if ((l == null ? void 0 : l.type) === "quarterly") {
122
+ if (l.earliest)
123
+ D = Z(l.earliest);
124
+ else {
125
+ const r = Z(D);
126
+ B(D, r) || (D = Z(Ye(D, 1)));
127
+ }
128
+ if (l.latest)
129
+ f = N(l.latest);
130
+ else {
131
+ const r = Ee(f);
132
+ B(f, r) || (f = Ee(ht(f, 1)));
133
+ }
134
+ }
135
+ return { min: D, max: f };
136
+ } }), Mt = () => {
137
+ const t = ce({
138
+ daily: null,
139
+ weekly: null,
140
+ monthly: null,
141
+ quarterly: null
142
+ });
143
+ return {
144
+ savedRanges: t,
145
+ saveRange: (i, l) => {
146
+ t[i] = l;
147
+ },
148
+ resetSavedRanges: () => {
149
+ t.daily = null, t.weekly = null, t.monthly = null, t.quarterly = null;
150
+ }
151
+ };
152
+ };
153
+ 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 || {});
154
+ const wt = /[\d]/, Ct = /^\d{2}$/, xt = /^\d{2}:\d{2}$/, At = (t) => {
155
+ const { selectionStart: e } = t.target, n = wt.test(t.key) || t.key === "Backspace" || t.key === "Tab", i = [1, 2, 4, 5].includes(e) && t.key === ":";
156
+ !n && !i && t.preventDefault();
157
+ }, Ae = (t) => {
158
+ if (!t)
159
+ return t;
160
+ let e = t;
161
+ if (e.length === 1 && parseInt(t, 10) > 2)
162
+ return `0${e}:`;
163
+ const [n, i] = e.slice(-2);
164
+ return [2, 5].includes(e.length) && i === ":" && (e = `${e.slice(0, e.length - 2)}0${n}`), (Ct.test(e) || xt.test(e)) && (e += ":"), e;
165
+ }, Ft = {
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
+ }, Fe = 300, Ue = "customRange", Ut = Pe({
197
+ i18n: { messages: Ft },
198
+ name: "date-range-picker-calendar",
199
+ components: {
200
+ BentoDropdown: mt,
201
+ BentoInputField: Dt,
202
+ BentoSegmentedControl: ft,
203
+ BentoTypography: Ne,
204
+ Calendar: q
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: q.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: q.props.isDateDisabled,
234
+ /**
235
+ * Set a maximum number of dates to be selectable by the range.
236
+ */
237
+ maxRange: q.props.maxRange,
238
+ /**
239
+ * Sets a minimum limit for selectable dates - dates before `min` will not be selectable
240
+ */
241
+ min: q.props.min,
242
+ /**
243
+ * Sets a maximum limit for selectable dates - dates after `max` will not be selectable
244
+ */
245
+ max: q.props.max,
246
+ /**
247
+ * Number of months rendered on pane
248
+ */
249
+ numberOfMonths: q.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: q.props.variant
273
+ },
274
+ emits: [
275
+ v.CUSTOM_RANGE,
276
+ v.INPUT,
277
+ v.ERROR,
278
+ v.FORM_DATE,
279
+ v.START_DATE_SELECTED
280
+ ],
281
+ setup(t, { emit: e, slots: n }) {
282
+ var Te, _e, Re, be;
283
+ const { locale: i, t: l } = ye(), D = ge(), f = g(() => t.variant === "month" ? "monthly" : "daily"), r = ce({
284
+ startDate: (Te = t.value) == null ? void 0 : Te.startDate,
285
+ endDate: (_e = t.value) == null ? void 0 : _e.endDate,
286
+ range: (Re = t.value) == null ? void 0 : Re.range,
287
+ ...t.granularities ? {
288
+ granularity: ((be = t.value) == null ? void 0 : be.granularity) || f.value
289
+ } : {}
290
+ });
291
+ function y(a) {
292
+ return new Date(
293
+ a.getUTCFullYear(),
294
+ a.getUTCMonth(),
295
+ a.getUTCDate(),
296
+ a.getUTCHours(),
297
+ a.getUTCMinutes(),
298
+ a.getUTCSeconds()
299
+ );
300
+ }
301
+ const T = g(() => {
302
+ var a, s;
303
+ return (
304
+ // eslint-disable-next-line consistent-return
305
+ ((s = (a = t == null ? void 0 : t.quickSelectRanges) == null ? void 0 : a.find(({ value: u, data: d }) => {
306
+ if (!d.endDate)
307
+ return u === r.range || Rt(
308
+ y(d.startDate),
309
+ y(r.startDate)
310
+ ) && It(r.endDate);
311
+ if (t.allowTimeInput)
312
+ return xe(
313
+ y(d.startDate),
314
+ y(r.startDate)
315
+ ) && xe(y(d.endDate), y(r.endDate));
316
+ if (d.endDate)
317
+ return B(d.startDate, r.startDate) && B(d.endDate, r.endDate);
318
+ })) == null ? void 0 : s.value) ?? Ue
319
+ );
320
+ }), ae = g(() => ({
321
+ "b-date-range-picker-calendar__form-input-wrapper": t.allowTimeInput
322
+ })), _ = g(() => [
323
+ { label: l("customRange"), value: Ue },
324
+ ...x.value ? x.value : []
325
+ ]), C = g(
326
+ () => {
327
+ var a;
328
+ return ((a = t.granularities) == null ? void 0 : a.find(({ type: s }) => s === r.granularity)) || null;
329
+ }
330
+ ), b = g(
331
+ () => {
332
+ var a;
333
+ return ((a = t.granularities) == null ? void 0 : a.map(({ type: s, disabled: u }) => ({
334
+ label: l(s),
335
+ value: s,
336
+ disabled: u
337
+ }))) ?? [];
338
+ }
339
+ ), x = g(
340
+ () => t.quickSelectRanges && t.quickSelectRanges.map((a) => ({
341
+ ...a,
342
+ data: {
343
+ ...a.data,
344
+ // Adding timeDifference to calculate an up-to-date endDate on range selection
345
+ timeDifference: a.data.endDate ? void 0 : new Date(Date.now()).getTime() - a.data.startDate.getTime()
346
+ }
347
+ }))
348
+ ), { getGranularCalendarLimits: Y } = Ot(t), m = g(
349
+ () => t.granularities ? Y(C.value) : { min: z(t.min), max: N(t.max) }
350
+ ), {
351
+ adjustDateForQuarterly: $,
352
+ adjustDateForMonthly: A,
353
+ adjustDateForWeekly: p,
354
+ adjustStartDateInputForWeekly: M,
355
+ adjustEndDateInputForWeekly: F,
356
+ adjustStartDateInputForMonthly: h,
357
+ adjustEndDateInputForMonthly: J,
358
+ adjustStartDateInputForQuarterly: ne,
359
+ adjustEndDateInputForQuarterly: re
360
+ } = ut(t.firstDayOfWeek), { savedRanges: I, saveRange: W, resetSavedRanges: se } = Mt(), R = (a) => a ? ee(a, k.NUMERIC_DATE_YEAR_FIRST, {
361
+ locale: D[i.value.substring(0, 2)] || D.enUS
362
+ }) : "", K = (a) => a ? ee(a, k.HOUR_MINUTE_SECONDS, {
363
+ locale: D[i.value.substring(0, 2)] || D.enUS
364
+ }) : "", j = O(!1), Q = O(!1), G = O(!1), H = O(!1), o = ce({
365
+ startDate: t.dateFormData.startDate,
366
+ endDate: t.dateFormData.endDate,
367
+ startTime: t.dateFormData.startTime,
368
+ endTime: t.dateFormData.endTime
369
+ }), oe = (a) => /^(?:[01]\d|2[01234]):(?:[012345]\d):(?:[012345]\d)$/.test(a), c = (a, s) => {
370
+ if (!s || !oe(s) || t.variant === "month")
371
+ return a;
372
+ let u = new Date(a);
373
+ const [d, S, V] = s.split(":");
374
+ return u = St(u, parseInt(d, 10)), u = kt(u, parseInt(S, 10)), u = Et(u, parseInt(V, 10)), u;
375
+ }, U = (a) => {
376
+ r.startDate = c(a.startDate, o.startTime), r.endDate = c(a.endDate, o.endTime), r.range = null, t.granularities && se(), e(v.INPUT, {
377
+ ...r,
378
+ range: T.value
379
+ });
380
+ }, w = (a) => {
381
+ const s = (d) => t.min && d <= t.min || t.max && d >= t.max ? !1 : t.isDateDisabled ? !t.isDateDisabled(d) : !0;
382
+ return /^\d{4}-(0?[1-9]|1[012])-(0?[1-9]|[12][0-9]|3[01])$/.test(a) && s(new Date(a));
383
+ };
384
+ Be(() => {
385
+ t.dateFormData.startDate && !w(t.dateFormData.startDate) ? j.value = !0 : (j.value = !1, G.value = !1), t.dateFormData.endDate && !w(t.dateFormData.endDate) ? Q.value = !0 : (Q.value = !1, H.value = !1);
386
+ });
387
+ const me = (a) => {
388
+ var s;
389
+ o.startDate = R(a), o.startTime ? G.value && (o.startTime = (s = t.dateFormData) == null ? void 0 : s.startTime) : o.startTime = K(a), j.value = !1, G.value = !1, e(v.START_DATE_SELECTED, a);
390
+ }, $e = (a) => {
391
+ var s;
392
+ o.endDate = R(a), o.endTime ? H.value && (o.endTime = (s = t.dateFormData) == null ? void 0 : s.endTime) : o.endTime = K(N(a)), Q.value = !1, H.value = !1;
393
+ }, ie = (a) => {
394
+ const s = t.value[a];
395
+ if (s)
396
+ return s;
397
+ if (t.dateFormData[a] && w(t.dateFormData[a]))
398
+ return new Date(t.dateFormData[a]);
399
+ }, je = ue((a) => {
400
+ var s;
401
+ if (w(a)) {
402
+ let u = a;
403
+ switch (j.value = !1, (s = C.value) == null ? void 0 : s.type) {
404
+ case "weekly":
405
+ u = M(
406
+ a,
407
+ R,
408
+ m.value.min,
409
+ m.value.max
410
+ ), o.startDate = u;
411
+ break;
412
+ case "monthly":
413
+ u = h(
414
+ a,
415
+ R,
416
+ m.value.min,
417
+ m.value.max
418
+ ), o.startDate = u;
419
+ break;
420
+ case "quarterly":
421
+ u = ne(
422
+ a,
423
+ R,
424
+ m.value.min,
425
+ m.value.max
426
+ ), o.startDate = u;
427
+ break;
428
+ }
429
+ const d = De(u);
430
+ r.startDate = c(d, o.startTime);
431
+ const S = ie("endDate");
432
+ e(v.FORM_DATE, {
433
+ startDate: d,
434
+ endDate: S
435
+ }), e(v.INPUT, {
436
+ ...r,
437
+ range: T.value
438
+ });
439
+ } else
440
+ j.value = !0, e(v.ERROR, { ...o });
441
+ }, Fe), Qe = (a) => {
442
+ o.startDate = he(a), je(o.startDate);
443
+ }, Ge = ue((a) => {
444
+ var s;
445
+ if (w(a)) {
446
+ let u = a;
447
+ switch (Q.value = !1, (s = C.value) == null ? void 0 : s.type) {
448
+ case "weekly":
449
+ u = F(
450
+ a,
451
+ R,
452
+ m.value.min,
453
+ m.value.max
454
+ ), o.endDate = u;
455
+ break;
456
+ case "monthly":
457
+ u = J(
458
+ a,
459
+ R,
460
+ m.value.min,
461
+ m.value.max
462
+ ), o.endDate = u;
463
+ break;
464
+ case "quarterly":
465
+ u = re(
466
+ a,
467
+ R,
468
+ m.value.min,
469
+ m.value.max
470
+ ), o.endDate = u;
471
+ break;
472
+ }
473
+ const d = De(u);
474
+ r.endDate = c(d, o.endTime);
475
+ const S = ie("startDate");
476
+ e(v.FORM_DATE, {
477
+ startDate: S,
478
+ endDate: d
479
+ }), e(v.INPUT, {
480
+ ...r,
481
+ range: T.value
482
+ });
483
+ } else
484
+ Q.value = !0, e(v.ERROR, { ...o });
485
+ }, Fe), He = (a) => {
486
+ o.endDate = he(a), Ge(o.endDate);
487
+ }, Ve = (a) => {
488
+ dt(a);
489
+ }, We = ue((a) => {
490
+ if (oe(a)) {
491
+ G.value = !1, r.startDate = c(r.startDate, a);
492
+ const s = ie("endDate");
493
+ e(v.FORM_DATE, {
494
+ startDate: new Date(r.startDate),
495
+ endDate: s,
496
+ startTime: a,
497
+ endTime: t.dateFormData.endTime
498
+ }), e(v.INPUT, {
499
+ ...r,
500
+ range: T.value
501
+ });
502
+ } else
503
+ G.value = !0, e(v.ERROR, { ...o });
504
+ }), Ke = ue((a) => {
505
+ if (oe(a)) {
506
+ H.value = !1, r.endDate = c(r.endDate, a);
507
+ const s = ie("startDate");
508
+ r.startDate = c(new Date(s), t.dateFormData.startTime), e(v.FORM_DATE, {
509
+ startDate: c(new Date(s), t.dateFormData.startTime),
510
+ endDate: new Date(r.endDate),
511
+ startTime: t.dateFormData.startTime,
512
+ endTime: a
513
+ }), e(v.INPUT, {
514
+ ...r,
515
+ range: T.value
516
+ });
517
+ } else
518
+ H.value = !0, e(v.ERROR, { ...o });
519
+ }), ze = (a) => {
520
+ o.startTime = Ae(a), We(o.startTime);
521
+ }, Je = (a) => {
522
+ o.endTime = Ae(a), Ke(o.endTime);
523
+ }, Xe = (a) => {
524
+ At(a);
525
+ }, le = (a, s, u, d) => {
526
+ r.startDate = a, r.endDate = s, u && (r.granularity = u), d && (r.range = d);
527
+ }, Ze = (a) => {
528
+ var u;
529
+ const s = (u = x.value) == null ? void 0 : u.find(({ value: d }) => d === a);
530
+ if (s) {
531
+ se();
532
+ const d = s.data, S = d.endDate || new Date(Date.now()), V = d.timeDifference ? new Date(S.getTime() - d.timeDifference) : d.startDate;
533
+ o.endDate = R(S), o.startDate = R(V), le(V, S, null, a), t.granularities && (r.granularity = d.granularity || f.value), o.startTime || (o.startTime = K(N(V))), o.endTime || (o.endTime = K(N(S))), r.startDate = V, r.endDate = S, e(v.CUSTOM_RANGE, {
534
+ ...s.data,
535
+ startDate: V,
536
+ endDate: S,
537
+ range: s.value
538
+ });
539
+ }
540
+ }, et = {
541
+ weekly: p,
542
+ monthly: A,
543
+ quarterly: $
544
+ }, tt = (a) => {
545
+ const s = r.granularity;
546
+ if (r.granularity = a, s && W(s, structuredClone(pe(r))), r.startDate && r.endDate) {
547
+ switch (a) {
548
+ case "quarterly":
549
+ case "monthly":
550
+ case "weekly": {
551
+ if (I[a]) {
552
+ le(I[a].startDate, I[a].endDate, a);
553
+ break;
554
+ }
555
+ const { startDate: u, endDate: d } = et[a](
556
+ r.startDate,
557
+ r.endDate,
558
+ m.value.min,
559
+ m.value.max
560
+ );
561
+ le(u, d, a);
562
+ break;
563
+ }
564
+ case "daily":
565
+ I.daily && le(I.daily.startDate, I.daily.endDate, a);
566
+ break;
567
+ }
568
+ o.startDate = R(r.startDate), o.endDate = R(r.endDate), e(v.INPUT, {
569
+ ...r,
570
+ range: T.value
571
+ });
572
+ }
573
+ };
574
+ return {
575
+ // Values
576
+ internalRangeDate: r,
577
+ dateTextInput: o,
578
+ endDateError: Q,
579
+ endTimeError: H,
580
+ granularityItems: b,
581
+ selectedGranularity: C,
582
+ computedMinMax: m,
583
+ selectedRangeSelectorValue: T,
584
+ startDateError: j,
585
+ startTimeError: G,
586
+ adjustedQuickSelectRanges: x,
587
+ quickSelectRangeDefaultItems: _,
588
+ formInputWrapperConditionalClasses: ae,
589
+ // Methods
590
+ hasSlot: vt(n),
591
+ t: l,
592
+ // Events
593
+ onDateInput: U,
594
+ onDateInputKeyDown: Ve,
595
+ onEndDateInput: He,
596
+ onEndDateSelected: $e,
597
+ onEndTimeInput: Je,
598
+ onGranularityInput: tt,
599
+ onRangeSelectorInput: Ze,
600
+ onStartDateInput: Qe,
601
+ onStartDateSelected: me,
602
+ onStartTimeInput: ze,
603
+ onTimeInputKeyDown: Xe
604
+ };
605
+ }
606
+ });
607
+ var Pt = function() {
608
+ var e = this, n = e._self._c;
609
+ 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.adjustedQuickSelectRanges ? 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() {
610
+ return [e._v("YYYY-MM-DD")];
611
+ }, 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() {
612
+ return [e._v("HH:MM:SS")];
613
+ }, 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() {
614
+ return [e._v("YYYY-MM-DD")];
615
+ }, 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() {
616
+ return [e._v("HH:MM:SS")];
617
+ }, 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)]);
618
+ }, Bt = [], Nt = /* @__PURE__ */ Le(
619
+ Ut,
620
+ Pt,
621
+ Bt,
622
+ !1,
623
+ null,
624
+ "508ade99"
625
+ );
626
+ const P = Nt.exports, qt = ({
627
+ datePickerValue: t,
628
+ isDateIncorrect: e,
629
+ quickSelectRanges: n,
630
+ isMonthVariant: i
631
+ }) => {
632
+ var C, b, x, Y;
633
+ const { locale: l, t: D } = ye(), f = ge(), r = (m) => !!m && !isNaN(m.getTime()), y = (m, $) => r(m) ? ee(m, $, {
634
+ locale: f[l.value.substring(0, 2)] || f.enUS
635
+ }) : void 0, T = ce({
636
+ startDate: y((C = t.value) == null ? void 0 : C.startDate, k.NUMERIC_DATE_YEAR_FIRST),
637
+ endDate: y((b = t.value) == null ? void 0 : b.endDate, k.NUMERIC_DATE_YEAR_FIRST),
638
+ startTime: y((x = t.value) == null ? void 0 : x.startDate, k.HOUR_MINUTE_SECONDS),
639
+ endTime: y((Y = t.value) == null ? void 0 : Y.endDate, k.HOUR_MINUTE_SECONDS)
640
+ });
641
+ return {
642
+ // Values
643
+ dateDisplayValue: g(() => {
644
+ var p;
645
+ if (e.value)
646
+ return `${T.startDate || ""} - ${T.endDate || ""}`;
647
+ if (!t.value || !t.value.startDate && !t.value.endDate)
648
+ return D("selectDateRange");
649
+ if ((p = n.value) != null && p.length) {
650
+ const M = n.value.find(({ value: F }) => {
651
+ var h;
652
+ return F === ((h = t.value) == null ? void 0 : h.range);
653
+ });
654
+ if (M)
655
+ return M.label;
656
+ }
657
+ if (t.value.granularity === "quarterly") {
658
+ const { startDate: M, endDate: F } = t.value, h = D("quarter", { quarter: Me(M), year: we(M) });
659
+ if (bt(M, F))
660
+ return h;
661
+ const J = D("quarter", { quarter: Me(F), year: we(F) });
662
+ return `${h} - ${J}`;
663
+ }
664
+ const { startDate: m, endDate: $ } = T, A = i != null && i.value ? k.LONG_MONTH_YEAR : k.FULL_DATE_MONTH_FIRST;
665
+ return `${y(De(m), A)} - ${y(
666
+ De($),
667
+ A
668
+ )}`;
669
+ }),
670
+ textInputDisplayValue: T,
671
+ // Methods
672
+ formatTextInputDisplayValue: () => ""
673
+ };
674
+ };
675
+ var de = /* @__PURE__ */ ((t) => (t.INPUT = "input", t))(de || {});
676
+ const Lt = {
677
+ "en-US": {
678
+ apply: "Apply",
679
+ cancel: "Cancel",
680
+ dateRangePicker: "Date range picker {name}",
681
+ provideDateInAFormat: "Provide date in a YYYY-MM-DD format",
682
+ quarter: "Q{quarter} {year}",
683
+ selectDate: "Select a date",
684
+ selectDateRange: "Select a date range",
685
+ selectedDateIsNotAvailable: "Selected date is not available"
686
+ },
687
+ "ja-JP": {
688
+ apply: "適用",
689
+ cancel: "キャンセル",
690
+ selectDate: "日付を選択"
691
+ },
692
+ "pt-BR": {
693
+ apply: "Aplicar",
694
+ cancel: "Cancelar",
695
+ selectDate: "Selecione uma data"
696
+ }
697
+ }, Yt = Pe({
698
+ i18n: { messages: Lt },
699
+ name: "bento-date-range-picker",
700
+ components: {
701
+ BentoButtonActions: Tt,
702
+ BentoDivider: at,
703
+ BentoTypography: Ne,
704
+ BentoPopover: nt,
705
+ DateRangePickerCalendar: P,
706
+ DropdownInputDefault: st,
707
+ ErrorMessage: yt,
708
+ FieldLabel: gt
709
+ },
710
+ directives: { BentoClickOutsideDirective: pt },
711
+ props: {
712
+ /**
713
+ * Allows user to enter time values in the form
714
+ */
715
+ allowTimeInput: { type: Boolean, default: !1 },
716
+ /**
717
+ * Descriptive supporting text visbile underneath the dropdown.
718
+ */
719
+ description: { type: String, default: void 0 },
720
+ /**
721
+ * Disables dropdown functionality.
722
+ */
723
+ disabled: { type: Boolean, default: !1 },
724
+ /**
725
+ * Displays component in an error state with an error message
726
+ */
727
+ errorMessage: { type: String, default: null },
728
+ /**
729
+ * Allows user to set the first day of the week. 0 is sunday, 1 is monday, 6 is saturday
730
+ */
731
+ firstDayOfWeek: P.props.firstDayOfWeek,
732
+ /**
733
+ * A list of available granularities.
734
+ * If present, the date picker will display a segmented control to change granularity.
735
+ */
736
+ granularities: P.props.granularities,
737
+ /**
738
+ * Indicate if a date should be disabled or not
739
+ */
740
+ isDateDisabled: P.props.isDateDisabled,
741
+ /**
742
+ * Text that is displayed as a label above the element.
743
+ */
744
+ label: { type: String, default: void 0 },
745
+ /**
746
+ * Upon opening date range picker, end date's month will be pre-selected.
747
+ */
748
+ showEndDateOnOpen: { type: Boolean, default: !1 },
749
+ /**
750
+ * Highlights the dropdown is optional.
751
+ */
752
+ optional: { type: Boolean, default: !1 },
753
+ /**
754
+ * The Boolean readonly property, when present, makes the element not mutable, meaning the user can not edit the date range picker.
755
+ */
756
+ readonly: { type: Boolean, default: !1 },
757
+ /**
758
+ * Highlights the dropdown is required.
759
+ */
760
+ required: { type: Boolean, default: !1 },
761
+ /**
762
+ * Adds a info icon next to the label to display the passed tooltip message.
763
+ */
764
+ tooltipText: { type: String, default: null },
765
+ /**
766
+ * Enables the range selector.
767
+ * If provided, must be an array that sets the custom range dropdown items. Items are of the structure:
768
+ * `label` - label of custom range item.
769
+ * `value` - a unique key of the custom range item.
770
+ * `data` - an object `{ startDate: Date; endDate: Date }` to set the date picker range to upon selecting.
771
+ */
772
+ quickSelectRanges: {
773
+ type: Array,
774
+ default: void 0
775
+ },
776
+ /**
777
+ * Set a maximum number of dates to be selectable by the range.
778
+ */
779
+ maxRange: P.props.maxRange,
780
+ /**
781
+ * Sets a minimum limit for selectable dates - dates before `min` will not be selectable
782
+ */
783
+ min: P.props.min,
784
+ /**
785
+ * Sets a maximum limit for selectable dates - dates after `max` will not be selectable
786
+ */
787
+ max: P.props.max,
788
+ /**
789
+ * Number of months rendered on pane
790
+ */
791
+ numberOfMonths: P.props.numberOfMonths,
792
+ /**
793
+ * Selected date
794
+ */
795
+ value: P.props.value,
796
+ /**
797
+ * The type of calendar to display. Defaults to showing days.
798
+ */
799
+ variant: {
800
+ type: String,
801
+ default: void 0
802
+ // Default will be set by @/internal/calendar
803
+ },
804
+ /**
805
+ * Enables the date picker selection to persist until it is explicitly applied.
806
+ * Displays a set of buttons: Apply and Cancel.
807
+ *
808
+ * @deprecated This will be the default behaviour in v2.0.0.
809
+ */
810
+ hasActions: { type: Boolean, default: !1 }
811
+ },
812
+ emits: [de.INPUT],
813
+ setup(t, { emit: e }) {
814
+ const { locale: n, t: i } = ye(), l = ge(), D = X("bento-date-range-picker-container"), f = X("bento-date-range-picker-label"), r = X("bento-date-range-picker-description"), y = X("bento-date-range-picker-error"), T = X("bento-date-range-picker-date-error"), ae = g(
815
+ () => t.label || i("dateRangePicker", { name: D })
816
+ ), _ = O(!1), C = O(null), b = O(!1), { isReadOnly: x } = ct(fe(t, "readonly"));
817
+ ve(
818
+ () => t.disabled,
819
+ () => {
820
+ t.disabled && b.value && (b.value = !1);
821
+ }
822
+ );
823
+ const Y = g(() => t.hasActions ? !W.value && _.value : _.value), m = g(() => ({
824
+ "b-date-range-picker__description--error": !!t.errorMessage || Y.value
825
+ })), $ = g(() => t.variant === "month"), { dateDisplayValue: A, textInputDisplayValue: p } = qt({
826
+ datePickerValue: fe(t, "value"),
827
+ isDateIncorrect: _,
828
+ quickSelectRanges: fe(t, "quickSelectRanges"),
829
+ isMonthVariant: $
830
+ }), M = g(
831
+ () => `${t.description ? r : ""} ${t.errorMessage ? y : ""} ${_.value ? T : ""}`.trim() || null
832
+ ), F = g(() => t.allowTimeInput && t.variant !== "month"), h = () => {
833
+ b.value = !1;
834
+ }, J = () => {
835
+ b.value = !0;
836
+ }, ne = O(A.value), re = O(
837
+ // textInputDisplayValue is a reactive object
838
+ structuredClone(pe(p))
839
+ ), I = O(t.value), W = O(!0), se = g(
840
+ () => t.hasActions ? re.value : p
841
+ ), R = g(
842
+ () => t.hasActions ? ne.value : A.value
843
+ );
844
+ Be(() => {
845
+ if (t.hasActions || rt(
846
+ 'BentoDateRangePicker "hasActions" property',
847
+ `Set the BentoDateRangePicker "hasActions" property true which will display the "Apply" and "Cancel" buttons.
848
+ This will be the default behavior in the v2 and "hasActions" will be removed.`,
849
+ "2.0.0"
850
+ ), t.granularities && t.variant !== "month" && t.granularities.find(({ type: c }) => c === "quarterly"))
851
+ throw new Error(
852
+ 'Quarterly granularity is only supported by BentoDateRangePicker with variant: "month"'
853
+ );
854
+ }), ve(
855
+ () => t.value,
856
+ () => {
857
+ ne.value = A.value, re.value = structuredClone(pe(p));
858
+ }
859
+ );
860
+ const K = g(() => [
861
+ {
862
+ title: i("apply"),
863
+ event: () => {
864
+ e(de.INPUT, I.value), h(), W.value = !0;
865
+ },
866
+ disabled: W.value
867
+ },
868
+ {
869
+ title: i("cancel"),
870
+ event: h
871
+ }
872
+ ]);
873
+ return ve(I, (c) => {
874
+ if (t.hasActions) {
875
+ W.value = _.value;
876
+ return;
877
+ }
878
+ e(de.INPUT, c);
879
+ }), {
880
+ // Refs
881
+ inputContainerRef: C,
882
+ // Values,
883
+ dateDisplayValue: A,
884
+ datePickerContainerId: D,
885
+ descriptionConditionalClasses: m,
886
+ displayedTextInputValue: se,
887
+ displayedDateValue: R,
888
+ isDateIncorrect: _,
889
+ isDateRangePickerOpen: b,
890
+ isReadOnly: x,
891
+ labelId: f,
892
+ descriptionId: r,
893
+ dateErrorId: T,
894
+ errorId: y,
895
+ popoverAriaLabel: ae,
896
+ shouldDisplayError: Y,
897
+ ariaDescribedBy: M,
898
+ textInputDisplayValue: p,
899
+ rangePickerButtonActions: K,
900
+ BentoButtonActionsLayout: _t,
901
+ withTimeInput: F,
902
+ // Events
903
+ closeDateRangePicker: h,
904
+ clearDateRangePickerValue: async () => {
905
+ _.value && (_.value = !1), I.value = null;
906
+ },
907
+ openDateRangePicker: J,
908
+ onRangeSelectorInput: (c) => {
909
+ if (c) {
910
+ const U = (w) => ee(w, k.NUMERIC_DATE_YEAR_FIRST, {
911
+ locale: l[n.value.substring(0, 2)] || l.enUS
912
+ });
913
+ p.startDate = U(c.startDate), p.endDate = U(c.endDate), I.value = c;
914
+ }
915
+ },
916
+ onEnterPressedOverInput: () => {
917
+ if (!b.value) {
918
+ b.value = !0;
919
+ return;
920
+ }
921
+ _.value || (b.value = !1);
922
+ },
923
+ onDateRangePickerInput: (c) => {
924
+ _.value = !1;
925
+ const U = (w, me) => w ? ee(w, me, {
926
+ locale: l[n.value.substring(0, 2)] || l.enUS
927
+ }) : void 0;
928
+ p.startDate = U(
929
+ c.startDate,
930
+ k.NUMERIC_DATE_YEAR_FIRST
931
+ ), p.endDate = U(c.endDate, k.NUMERIC_DATE_YEAR_FIRST), p.startTime = U(c.startDate, k.HOUR_MINUTE_SECONDS), p.endTime = U(c.endDate, k.HOUR_MINUTE_SECONDS), I.value = c;
932
+ },
933
+ onDateRangePickerError: (c) => {
934
+ _.value = !0, p.startDate = c.startDate, p.endDate = c.endDate, I.value = { startDate: null, endDate: null };
935
+ },
936
+ onDateRangePickerFormDateInputUpdate: (c) => {
937
+ _.value = !1, c.startTime && (p.startTime = c.startTime), c.endTime && (p.endTime = c.endTime);
938
+ },
939
+ // Translations
940
+ t: i
941
+ };
942
+ }
943
+ });
944
+ var $t = function() {
945
+ var e = this, n = e._self._c;
946
+ return e._self._setupProxy, n("div", { directives: [{ name: "bento-click-outside-directive", rawName: "v-bento-click-outside-directive", value: e.closeDateRangePicker, expression: "closeDateRangePicker" }], staticClass: "b-date-range-picker" }, [e.label ? n("field-label", { attrs: { id: e.labelId, label: e.label, "tooltip-text": e.tooltipText, optional: e.optional, required: e.required } }) : e._e(), n("div", { on: { keydown: function(i) {
947
+ return !i.type.indexOf("key") && e._k(i.keyCode, "enter", 13, i.key, "Enter") ? null : e.onEnterPressedOverInput.apply(null, arguments);
948
+ } } }, [n("dropdown-input-default", { ref: "inputContainerRef", attrs: { "always-combobox-is-input": "", ariaControls: e.datePickerContainerId, ariaExpanded: e.isDateRangePickerOpen, "aria-labelledby": e.label ? e.labelId : null, "aria-describedby": e.ariaDescribedBy, disabled: e.disabled, "is-invalid": !!e.errorMessage || e.shouldDisplayError, open: e.isDateRangePickerOpen, "display-value": e.displayedDateValue, readonly: e.isReadOnly }, on: { open: e.openDateRangePicker, clear: e.clearDateRangePickerValue, close: e.closeDateRangePicker } })], 1), e.shouldDisplayError ? n("error-message", { staticClass: "b-date-range-picker__error-message", attrs: { id: e.dateErrorId, "error-message": e.t("provideDateInAFormat") } }) : e._e(), e.errorMessage ? n("error-message", { staticClass: "b-date-range-picker__error-message", attrs: { id: e.errorId, "error-message": e.errorMessage } }) : e._e(), e.description ? n("bento-typography", { staticClass: "b-date-range-picker__description", class: e.descriptionConditionalClasses, attrs: { id: e.descriptionId, el: "span" } }, [e._v(" " + e._s(e.description) + " ")]) : e._e(), e.inputContainerRef ? n("bento-popover", { staticClass: "b-date-range-picker__container", attrs: { id: e.datePickerContainerId, open: e.isDateRangePickerOpen, "target-element": e.inputContainerRef, "disable-focus-trap": !0, "aria-label": e.popoverAriaLabel, position: "bottom-start", "without-space": "", "fit-content": "" } }, [n("date-range-picker-calendar", { attrs: { "allow-time-input": e.withTimeInput, "quick-select-ranges": e.quickSelectRanges, value: e.value, "first-day-of-week": e.firstDayOfWeek, granularities: e.granularities, "is-date-disabled": e.isDateDisabled, "max-range": e.maxRange, min: e.min, max: e.max, "number-of-months": e.numberOfMonths, "show-end-date-on-open": e.showEndDateOnOpen, "date-form-data": e.displayedTextInputValue, variant: e.variant }, on: { "custom-range": e.onRangeSelectorInput, input: e.onDateRangePickerInput, error: e.onDateRangePickerError, "form-date": e.onDateRangePickerFormDateInputUpdate }, scopedSlots: e._u([e.hasActions ? { key: "actions", fn: function() {
949
+ return [n("bento-divider"), n("div", { staticClass: "b-date-range-picker__footer" }, [n("bento-button-actions", { attrs: { actions: e.rangePickerButtonActions, layout: e.BentoButtonActionsLayout.SPACE_BETWEEN } })], 1)];
950
+ }, proxy: !0 } : null], null, !0) })], 1) : e._e()], 1);
951
+ }, jt = [], Qt = /* @__PURE__ */ Le(
952
+ Yt,
953
+ $t,
954
+ jt,
955
+ !1,
956
+ null,
957
+ "f7eae115"
958
+ );
959
+ const fa = Qt.exports;
960
+ export {
961
+ fa as B,
962
+ P as D,
963
+ de as a,
964
+ It as b,
965
+ Rt as i
966
+ };
967
+ //# sourceMappingURL=date-range-picker.CAQY6v7g.js.map