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