@adyen/bento-vue3 1.57.0 → 1.58.0

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