@adyen/bento-vue3 1.90.0 → 1.91.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 (199) hide show
  1. package/dist/@types/components.d.ts +2 -0
  2. package/dist/@types/index.d.ts +559 -419
  3. package/dist/action-bar.js +1 -1
  4. package/dist/ai-tag.js +1 -1
  5. package/dist/assets/accordion-item.css +1 -1
  6. package/dist/assets/action-bar.css +1 -1
  7. package/dist/assets/base-modal.css +1 -1
  8. package/dist/assets/button-actions.css +1 -1
  9. package/dist/assets/card.css +1 -1
  10. package/dist/assets/data-grid.css +1 -1
  11. package/dist/assets/date-picker.css +1 -1
  12. package/dist/assets/date-range-picker.css +1 -1
  13. package/dist/assets/dialog-page.css +1 -1
  14. package/dist/assets/draggable-handle.css +1 -1
  15. package/dist/assets/dropdown.css +1 -1
  16. package/dist/assets/error-message.css +1 -1
  17. package/dist/assets/field-label.css +1 -0
  18. package/dist/assets/file-uploader.css +1 -1
  19. package/dist/assets/filter-bar.css +1 -1
  20. package/dist/assets/form-layout-title.css +1 -1
  21. package/dist/assets/input-field.css +1 -1
  22. package/dist/assets/input-time.css +1 -1
  23. package/dist/assets/inspector.css +1 -1
  24. package/dist/assets/modal-fullscreen.css +1 -1
  25. package/dist/assets/secondary-nav.css +1 -1
  26. package/dist/assets/sidepanel.css +1 -1
  27. package/dist/assets/use-cached-selected-values.css +1 -1
  28. package/dist/button.js +1 -1
  29. package/dist/card.js +1 -1
  30. package/dist/checkbox.js +2 -2
  31. package/dist/chunks/{action-bar.Pe_hvtja.js → action-bar.BPS3wPde.js} +3 -3
  32. package/dist/chunks/{action-bar.Pe_hvtja.js.map → action-bar.BPS3wPde.js.map} +1 -1
  33. package/dist/chunks/{ai-tag.BSlc78DU.js → ai-tag.D7shWB_x.js} +2 -2
  34. package/dist/chunks/{ai-tag.BSlc78DU.js.map → ai-tag.D7shWB_x.js.map} +1 -1
  35. package/dist/chunks/{base-modal.BjjDrx0z.js → base-modal.BxcS7Pao.js} +4 -4
  36. package/dist/chunks/{base-modal.BjjDrx0z.js.map → base-modal.BxcS7Pao.js.map} +1 -1
  37. package/dist/chunks/{button-actions-with-menu.DvkS16ur.js → button-actions-with-menu.BKdNXYgU.js} +2 -2
  38. package/dist/chunks/{button-actions-with-menu.DvkS16ur.js.map → button-actions-with-menu.BKdNXYgU.js.map} +1 -1
  39. package/dist/chunks/{button-actions.Bh_PZ_fV.js → button-actions.DLiM8KZL.js} +2 -2
  40. package/dist/chunks/{button-actions.Bh_PZ_fV.js.map → button-actions.DLiM8KZL.js.map} +1 -1
  41. package/dist/chunks/{calendar.CH-1Vgeb.js → calendar.qm-kFNQv.js} +275 -257
  42. package/dist/chunks/calendar.qm-kFNQv.js.map +1 -0
  43. package/dist/chunks/{card.BzCGCCzH.js → card.BEChcEqg.js} +2 -2
  44. package/dist/chunks/{card.BzCGCCzH.js.map → card.BEChcEqg.js.map} +1 -1
  45. package/dist/chunks/{checkbox-group.D_fN6Glu.js → checkbox-group.i3W8WO-7.js} +4 -4
  46. package/dist/chunks/{checkbox-group.D_fN6Glu.js.map → checkbox-group.i3W8WO-7.js.map} +1 -1
  47. package/dist/chunks/{checkbox.BlAhQl9N.js → checkbox.BPrymcRl.js} +18 -18
  48. package/dist/chunks/{checkbox.BlAhQl9N.js.map → checkbox.BPrymcRl.js.map} +1 -1
  49. package/dist/chunks/{click-outside.BPylIosK.js → click-outside.B0whuTUU.js} +2 -2
  50. package/dist/chunks/{click-outside.BPylIosK.js.map → click-outside.B0whuTUU.js.map} +1 -1
  51. package/dist/chunks/{code-snippet.BePxxR3q.js → code-snippet.BG5ZmCrb.js} +3 -3
  52. package/dist/chunks/{code-snippet.BePxxR3q.js.map → code-snippet.BG5ZmCrb.js.map} +1 -1
  53. package/dist/chunks/{controls-group.Cxk-0fCy.js → controls-group.DqRpF9bh.js} +2 -2
  54. package/dist/chunks/{controls-group.Cxk-0fCy.js.map → controls-group.DqRpF9bh.js.map} +1 -1
  55. package/dist/chunks/{dashboard-section.CiNDItU2.js → dashboard-section.C7mfUXOl.js} +2 -2
  56. package/dist/chunks/{dashboard-section.CiNDItU2.js.map → dashboard-section.C7mfUXOl.js.map} +1 -1
  57. package/dist/chunks/{dashed-underline.CwdpUz76.js → dashed-underline.B50DIXjK.js} +2 -2
  58. package/dist/chunks/{dashed-underline.CwdpUz76.js.map → dashed-underline.B50DIXjK.js.map} +1 -1
  59. package/dist/chunks/{data-grid-template.nXn1dLCw.js → data-grid-template.CKdZb6EN.js} +2 -2
  60. package/dist/chunks/{data-grid-template.nXn1dLCw.js.map → data-grid-template.CKdZb6EN.js.map} +1 -1
  61. package/dist/chunks/{data-grid.CXWaoqzi.js → data-grid.DvMe72LK.js} +411 -406
  62. package/dist/chunks/{data-grid.CXWaoqzi.js.map → data-grid.DvMe72LK.js.map} +1 -1
  63. package/dist/chunks/date-picker.CidHad1p.js +269 -0
  64. package/dist/chunks/date-picker.CidHad1p.js.map +1 -0
  65. package/dist/chunks/date-range-picker.c5OwESTS.js +1027 -0
  66. package/dist/chunks/date-range-picker.c5OwESTS.js.map +1 -0
  67. package/dist/chunks/{directive.Dpivxq_t.js → directive.C8kY-ZW-.js} +2 -2
  68. package/dist/chunks/{directive.Dpivxq_t.js.map → directive.C8kY-ZW-.js.map} +1 -1
  69. package/dist/{draggable-handle.js → chunks/draggable-handle.CySRx1tb.js} +56 -47
  70. package/dist/chunks/draggable-handle.CySRx1tb.js.map +1 -0
  71. package/dist/chunks/{dropdown-tag.B7OA_Yv9.js → dropdown-tag.wcJ6Mgqe.js} +2 -2
  72. package/dist/chunks/{dropdown-tag.B7OA_Yv9.js.map → dropdown-tag.wcJ6Mgqe.js.map} +1 -1
  73. package/dist/chunks/dropdown.DHoL50gV.js +1214 -0
  74. package/dist/chunks/dropdown.DHoL50gV.js.map +1 -0
  75. package/dist/chunks/error-message.Dyvrw6ZB.js +55 -0
  76. package/dist/chunks/error-message.Dyvrw6ZB.js.map +1 -0
  77. package/dist/chunks/field-label.DZYFjFgr.js +111 -0
  78. package/dist/chunks/field-label.DZYFjFgr.js.map +1 -0
  79. package/dist/chunks/{file-uploader.BUvDU_cn.js → file-uploader.Dbg3vfZ_.js} +5 -4
  80. package/dist/chunks/{file-uploader.BUvDU_cn.js.map → file-uploader.Dbg3vfZ_.js.map} +1 -1
  81. package/dist/chunks/{filter-bar.fowl40RS.js → filter-bar.Dt-cU3zy.js} +1473 -1455
  82. package/dist/chunks/filter-bar.Dt-cU3zy.js.map +1 -0
  83. package/dist/chunks/{footer-actions.uoNbOGAQ.js → footer-actions.CYBdKDPo.js} +2 -2
  84. package/dist/chunks/{footer-actions.uoNbOGAQ.js.map → footer-actions.CYBdKDPo.js.map} +1 -1
  85. package/dist/chunks/{form-layout-title.Cr3wdpK_.js → form-layout-title.B3ePK3yi.js} +78 -64
  86. package/dist/chunks/form-layout-title.B3ePK3yi.js.map +1 -0
  87. package/dist/chunks/{header-meta.CmH6SnjE.js → header-meta.COak4D8-.js} +2 -2
  88. package/dist/chunks/{header-meta.CmH6SnjE.js.map → header-meta.COak4D8-.js.map} +1 -1
  89. package/dist/chunks/{header-with-views.B2pPBcTf.js → header-with-views.DqioajcO.js} +10 -10
  90. package/dist/chunks/{header-with-views.B2pPBcTf.js.map → header-with-views.DqioajcO.js.map} +1 -1
  91. package/dist/chunks/{header.BVM8Usdi.js → header.C21yzWrk.js} +3 -3
  92. package/dist/chunks/{header.BVM8Usdi.js.map → header.C21yzWrk.js.map} +1 -1
  93. package/dist/chunks/{input-field-password.CHb2Ros_.js → input-field-password.DyUphhxB.js} +4 -4
  94. package/dist/chunks/{input-field-password.CHb2Ros_.js.map → input-field-password.DyUphhxB.js.map} +1 -1
  95. package/dist/chunks/{input-field-phone-number.DM2rmZkQ.js → input-field-phone-number.BXVaC5ra.js} +3 -3
  96. package/dist/chunks/{input-field-phone-number.DM2rmZkQ.js.map → input-field-phone-number.BXVaC5ra.js.map} +1 -1
  97. package/dist/chunks/{input-field.DnYjM6yy.js → input-field.DkUFvIWt.js} +113 -109
  98. package/dist/chunks/input-field.DkUFvIWt.js.map +1 -0
  99. package/dist/chunks/input-time.WI_qdwJc.js +122 -0
  100. package/dist/chunks/input-time.WI_qdwJc.js.map +1 -0
  101. package/dist/chunks/{modal-fullscreen.9CSTqFQc.js → modal-fullscreen.c6QphYQo.js} +2 -2
  102. package/dist/chunks/{modal-fullscreen.9CSTqFQc.js.map → modal-fullscreen.c6QphYQo.js.map} +1 -1
  103. package/dist/chunks/{modal.vue_vue_type_script_setup_true_lang.BAxTkaQM.js → modal.vue_vue_type_script_setup_true_lang.ImqHKH-g.js} +4 -4
  104. package/dist/chunks/{modal.vue_vue_type_script_setup_true_lang.BAxTkaQM.js.map → modal.vue_vue_type_script_setup_true_lang.ImqHKH-g.js.map} +1 -1
  105. package/dist/chunks/on-click-outside.BgIzQ2G1.js +108 -0
  106. package/dist/chunks/on-click-outside.BgIzQ2G1.js.map +1 -0
  107. package/dist/chunks/{pagination.DL-h8OLF.js → pagination.Cu85Lqms.js} +100 -100
  108. package/dist/chunks/{pagination.DL-h8OLF.js.map → pagination.Cu85Lqms.js.map} +1 -1
  109. package/dist/chunks/{radio-group.DzhQgXv9.js → radio-group.CfMr1fmW.js} +3 -3
  110. package/dist/chunks/{radio-group.DzhQgXv9.js.map → radio-group.CfMr1fmW.js.map} +1 -1
  111. package/dist/chunks/{rich-text-editor.Ij2t4pyI.js → rich-text-editor.Bf9EWzNk.js} +6 -5
  112. package/dist/chunks/{rich-text-editor.Ij2t4pyI.js.map → rich-text-editor.Bf9EWzNk.js.map} +1 -1
  113. package/dist/chunks/{search-bar.DfNwnjes.js → search-bar.p6kHCCvT.js} +4 -4
  114. package/dist/chunks/{search-bar.DfNwnjes.js.map → search-bar.p6kHCCvT.js.map} +1 -1
  115. package/dist/chunks/{secondary-nav.CvipTDRh.js → secondary-nav.CaxiyVaO.js} +2 -2
  116. package/dist/chunks/{secondary-nav.CvipTDRh.js.map → secondary-nav.CaxiyVaO.js.map} +1 -1
  117. package/dist/chunks/{selection-card-group.CcOWQAUC.js → selection-card-group.58XZj_SJ.js} +11 -11
  118. package/dist/chunks/{selection-card-group.CcOWQAUC.js.map → selection-card-group.58XZj_SJ.js.map} +1 -1
  119. package/dist/chunks/{sidepanel.BObSv8UU.js → sidepanel.CAVhSs-O.js} +4 -4
  120. package/dist/chunks/{sidepanel.BObSv8UU.js.map → sidepanel.CAVhSs-O.js.map} +1 -1
  121. package/dist/chunks/{summary-grid.types.DKPhtHw3.js → summary-grid.types.CDithi8M.js} +2 -2
  122. package/dist/chunks/{summary-grid.types.DKPhtHw3.js.map → summary-grid.types.CDithi8M.js.map} +1 -1
  123. package/dist/chunks/{textarea.C-sBemuo.js → textarea.JGXAlpx9.js} +19 -18
  124. package/dist/chunks/{textarea.C-sBemuo.js.map → textarea.JGXAlpx9.js.map} +1 -1
  125. package/dist/chunks/{timeline-item.CHk8wXeT.js → timeline-item.BNFPpQz1.js} +4 -4
  126. package/dist/chunks/{timeline-item.CHk8wXeT.js.map → timeline-item.BNFPpQz1.js.map} +1 -1
  127. package/dist/chunks/{tutorial.vue_vue_type_script_setup_true_lang.CUDeriBU.js → tutorial.vue_vue_type_script_setup_true_lang.C1cF-adv.js} +2 -2
  128. package/dist/chunks/{tutorial.vue_vue_type_script_setup_true_lang.CUDeriBU.js.map → tutorial.vue_vue_type_script_setup_true_lang.C1cF-adv.js.map} +1 -1
  129. package/dist/chunks/{use-cached-selected-values.DIbfa5F1.js → use-cached-selected-values.Bx8uuky9.js} +170 -165
  130. package/dist/chunks/use-cached-selected-values.Bx8uuky9.js.map +1 -0
  131. package/dist/chunks/{use-date-input-formatter.BiIraXZZ.js → use-date-input-formatter.BOuXpRb-.js} +2 -2
  132. package/dist/chunks/{use-date-input-formatter.BiIraXZZ.js.map → use-date-input-formatter.BOuXpRb-.js.map} +1 -1
  133. package/dist/chunks/use-touch-device.DTqFAbXh.js +11 -0
  134. package/dist/chunks/use-touch-device.DTqFAbXh.js.map +1 -0
  135. package/dist/click-outside.js +1 -1
  136. package/dist/code-snippet.js +1 -1
  137. package/dist/dashboard-template.js +1 -1
  138. package/dist/dashed-underline.js +1 -1
  139. package/dist/data-grid-template.js +1 -1
  140. package/dist/data-grid.js +1 -1
  141. package/dist/date-picker.js +2 -2
  142. package/dist/date-range-picker.js +2 -2
  143. package/dist/draggable.js +1383 -0
  144. package/dist/draggable.js.map +1 -0
  145. package/dist/dropdown.js +10 -11
  146. package/dist/dropdown.js.map +1 -1
  147. package/dist/file-uploader.js +1 -1
  148. package/dist/filter-bar.js +1 -1
  149. package/dist/form-layout.js +1 -1
  150. package/dist/header-with-views.js +1 -1
  151. package/dist/header.js +1 -1
  152. package/dist/index.js +277 -274
  153. package/dist/index.js.map +1 -1
  154. package/dist/input-field-password.js +1 -1
  155. package/dist/input-field-phone-number.js +1 -1
  156. package/dist/input-field.js +1 -1
  157. package/dist/input-time.js +1 -1
  158. package/dist/internal.js +24 -23
  159. package/dist/internal.js.map +1 -1
  160. package/dist/menu.js +1 -1
  161. package/dist/modal-fullscreen.js +1 -1
  162. package/dist/modal.js +2 -2
  163. package/dist/pagination.js +1 -1
  164. package/dist/popover.js +1 -1
  165. package/dist/radio-group.js +1 -1
  166. package/dist/rich-text-editor.js +1 -1
  167. package/dist/search-bar.js +2 -2
  168. package/dist/secondary-nav.js +1 -1
  169. package/dist/selection-card.js +1 -1
  170. package/dist/sidepanel.js +1 -1
  171. package/dist/summary-grid.js +1 -1
  172. package/dist/textarea.js +1 -1
  173. package/dist/timeline.js +1 -1
  174. package/dist/tutorial.js +1 -1
  175. package/dist/web-types.json +1 -1
  176. package/package.json +7 -10
  177. package/dist/assets/dropdown-default-textbox.css +0 -1
  178. package/dist/chunks/calendar.CH-1Vgeb.js.map +0 -1
  179. package/dist/chunks/date-picker.DPjCROIP.js +0 -238
  180. package/dist/chunks/date-picker.DPjCROIP.js.map +0 -1
  181. package/dist/chunks/date-range-picker.fyrfFd04.js +0 -998
  182. package/dist/chunks/date-range-picker.fyrfFd04.js.map +0 -1
  183. package/dist/chunks/debounce.DUTu11PS.js +0 -10
  184. package/dist/chunks/debounce.DUTu11PS.js.map +0 -1
  185. package/dist/chunks/dropdown-default-textbox.aYsTZDZ7.js +0 -415
  186. package/dist/chunks/dropdown-default-textbox.aYsTZDZ7.js.map +0 -1
  187. package/dist/chunks/dropdown.Do-mZiI6.js +0 -813
  188. package/dist/chunks/dropdown.Do-mZiI6.js.map +0 -1
  189. package/dist/chunks/error-message.849uzpkq.js +0 -157
  190. package/dist/chunks/error-message.849uzpkq.js.map +0 -1
  191. package/dist/chunks/filter-bar.fowl40RS.js.map +0 -1
  192. package/dist/chunks/form-layout-title.Cr3wdpK_.js.map +0 -1
  193. package/dist/chunks/input-field.DnYjM6yy.js.map +0 -1
  194. package/dist/chunks/input-time.DeJ8lDio.js +0 -103
  195. package/dist/chunks/input-time.DeJ8lDio.js.map +0 -1
  196. package/dist/chunks/on-click-outside.ZUMLlxE_.js +0 -90
  197. package/dist/chunks/on-click-outside.ZUMLlxE_.js.map +0 -1
  198. package/dist/chunks/use-cached-selected-values.DIbfa5F1.js.map +0 -1
  199. package/dist/draggable-handle.js.map +0 -1
@@ -1,998 +0,0 @@
1
- import { reactive as Me, defineComponent as Xe, useSlots as ga, ref as C, computed as f, onMounted as Ze, openBlock as I, createElementBlock as fe, createElementVNode as Q, normalizeClass as ve, unref as u, renderSlot as Be, createCommentVNode as w, createBlock as x, createVNode as U, withCtx as K, createTextVNode as ne, toDisplayString as Se, toRaw as we, watch as ye, useAttrs as Ta, toRef as Re, withDirectives as ha, withKeys as Ce, createSlots as Ya } from "vue";
2
- import { j as Aa } from "./index.DDwcHPb6.js";
3
- import { B as ba } from "./divider.BIY84UH7.js";
4
- import { h as Ra, B as ka } from "./button-actions.Bh_PZ_fV.js";
5
- import { B as Fe, d as Ne } from "./typography.B3J6_tYk.js";
6
- import { D as Ia } from "./dropdown-default-textbox.aYsTZDZ7.js";
7
- import { g as te } from "./generate-uid.DBWe4g6T.js";
8
- import { u as Ee } from "./index.B875RXHM.js";
9
- import { e as ea, f as re, i as q, h, j as Sa, k as Pe, l as wa, s as xe, m as Fa, n as Ue, b as P, u as Ea, o as F, g as Oa } from "./calendar.CH-1Vgeb.js";
10
- import { u as Oe, a as _a } from "./use-date-input-formatter.BiIraXZZ.js";
11
- import { t as G, n as qa, c as Ba } from "./en-US.CCazFVNP.js";
12
- import { u as Ca } from "./use-form-layout-loading.CWbjZiwP.js";
13
- import { B as Na } from "./directive.Dpivxq_t.js";
14
- import { u as Pa } from "./form-field.D_2g7vaP.js";
15
- import { B as Ge } from "./input-field.DnYjM6yy.js";
16
- import { B as Le, i as Ve } from "./input-time.DeJ8lDio.js";
17
- import { B as xa } from "./dropdown.Do-mZiI6.js";
18
- import { B as Ua } from "./segmented-control.CQWOO1-J.js";
19
- import { d as Je } from "./debounce.DUTu11PS.js";
20
- import { u as Ga } from "./use-has-slot.CyMiImRQ.js";
21
- import { e as N, a as Qe } from "./differenceInMonths.s_znQQpw.js";
22
- import { s as je } from "./startOfWeek.Cvmo-f5J.js";
23
- import { c as La } from "./constructNow.D9uRk678.js";
24
- import { _ as aa } from "./_plugin-vue_export-helper.CHgC5LLL.js";
25
- import { F as Va, E as ze } from "./error-message.849uzpkq.js";
26
- import { B as Ja } from "./button-actions.types.BptAXjD8.js";
27
- import "../assets/date-range-picker.css";
28
- function ta(t, m, c) {
29
- return ea(t, m * 3, c);
30
- }
31
- function We(t, m) {
32
- const c = G(t, m?.in);
33
- return Math.trunc(c.getMonth() / 3) + 1;
34
- }
35
- function $e(t, m) {
36
- return G(t, m?.in).getFullYear();
37
- }
38
- function ke(t, m) {
39
- return +G(t) == +G(m);
40
- }
41
- function Qa(t, m, c) {
42
- const [s, a] = qa(
43
- c?.in,
44
- t,
45
- m
46
- );
47
- return +re(s) == +re(a);
48
- }
49
- function He(t, m) {
50
- const c = G(t, m?.in);
51
- return c.setMilliseconds(0), c;
52
- }
53
- function Ie(t, m) {
54
- return +He(t) == +He(m);
55
- }
56
- function ja(t, m) {
57
- return q(
58
- Ba(t, t),
59
- La(t)
60
- );
61
- }
62
- function za(t, m, c) {
63
- const s = G(t, c?.in);
64
- return s.setHours(m), s;
65
- }
66
- function Ke(t, m, c) {
67
- const s = G(t, c?.in);
68
- return s.setMilliseconds(m), s;
69
- }
70
- function Wa(t, m, c) {
71
- const s = G(t, c?.in);
72
- return s.setMinutes(m), s;
73
- }
74
- function $a(t, m, c) {
75
- const s = G(t, c?.in);
76
- return s.setSeconds(m), s;
77
- }
78
- function Ha(t, m, c) {
79
- return ta(t, -1, c);
80
- }
81
- const Ka = ({
82
- firstDayOfWeek: t,
83
- min: m,
84
- max: c
85
- }) => ({ getGranularCalendarLimits: (a) => {
86
- if (!m && !c)
87
- return { min: null, max: null };
88
- let i = m ? h(m) : null, D = c ? N(c) : null;
89
- if (a?.type === "weekly") {
90
- if (a.earliest)
91
- i = h(a.earliest);
92
- else if (i) {
93
- const v = je(i, { weekStartsOn: t });
94
- q(i, v) || (i = h(Sa(Pe(i, { weekStartsOn: t }), 1)));
95
- }
96
- if (a.latest)
97
- D = N(a.latest);
98
- else if (D) {
99
- const v = Pe(D, { weekStartsOn: t });
100
- q(D, v) || (D = N(wa(je(D, { weekStartsOn: t }), 1)));
101
- }
102
- }
103
- if (a?.type === "monthly") {
104
- if (a.earliest)
105
- i = h(a.earliest);
106
- else if (i) {
107
- const v = xe(i);
108
- q(i, v) || (i = xe(ea(i, 1)));
109
- }
110
- if (a.latest)
111
- D = N(a.latest);
112
- else if (D) {
113
- const v = Qe(D);
114
- q(D, v) || (D = Qe(Fa(D, 1)));
115
- }
116
- }
117
- if (a?.type === "quarterly") {
118
- if (a.earliest)
119
- i = re(a.earliest);
120
- else if (i) {
121
- const v = re(i);
122
- q(i, v) || (i = re(ta(i, 1)));
123
- }
124
- if (a.latest)
125
- D = N(a.latest);
126
- else if (D) {
127
- const v = Ue(D);
128
- q(D, v) || (D = Ue(Ha(D)));
129
- }
130
- }
131
- return { min: i, max: D };
132
- } }), Xa = () => {
133
- const t = Me({
134
- daily: null,
135
- weekly: null,
136
- monthly: null,
137
- quarterly: null
138
- });
139
- return {
140
- savedRanges: t,
141
- saveRange: (s, a) => {
142
- t[s] = a;
143
- },
144
- resetSavedRanges: () => {
145
- t.daily = null, t.weekly = null, t.monthly = null, t.quarterly = null;
146
- }
147
- };
148
- };
149
- var p = /* @__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))(p || {});
150
- const na = {
151
- "de-DE": { "DD-MM-YYYY": "TT-MM-JJJJ", "MM-DD-YYYY": "JJJJ-MM-TT", "YYYY-MM-DD": "JJJJ-MM-TT", customRange: "Benutzerdefinierter Bereich", daily: "Täglich", dateFrom: "Datum von", dateTo: "Datum bis", lastMonth: "Letzter Monat", lastSevenDays: "Letzte 7 Tage", lastThreeMonths: "Letzte drei Monate", monthly: "Monatlich", quarterly: "Vierteljährlich", timeFrom: "Zeit von", timeTo: "Zeit bis", weekly: "Wöchentlich" },
152
- "en-GB": { "DD-MM-YYYY": "DD-MM-YYYY", "MM-DD-YYYY": "MM-DD-YYYY", "YYYY-MM-DD": "YYYY-MM-DD", customRange: "Custom range", daily: "Daily", dateFrom: "Date from", dateTo: "Date to", lastMonth: "Last month", lastSevenDays: "Last 7 days", lastThreeMonths: "The last three months", monthly: "Monthly", quarterly: "Quarterly", timeFrom: "Time from", timeTo: "Time to", weekly: "Weekly" },
153
- "en-US": { "DD-MM-YYYY": "DD-MM-YYYY", "MM-DD-YYYY": "MM-DD-YYYY", "YYYY-MM-DD": "YYYY-MM-DD", customRange: "Custom range", daily: "Daily", dateFrom: "Date from", dateTo: "Date to", lastMonth: "Last month", lastSevenDays: "Last 7 days", lastThreeMonths: "Last three months", monthly: "Monthly", quarterly: "Quarterly", timeFrom: "Time from", timeTo: "Time to", weekly: "Weekly" },
154
- "es-ES": { "DD-MM-YYYY": "DD-MM-AAAA", "MM-DD-YYYY": "MM-DD-AAAA", "YYYY-MM-DD": "AAAA-MM-DD", customRange: "Rango personalizado", daily: "Diario", dateFrom: "Fecha desde", dateTo: "Fecha hasta", lastMonth: "El mes pasado", lastSevenDays: "Últimos 7 días", lastThreeMonths: "Últimos tres meses", monthly: "Mensualmente", quarterly: "Trimestral", timeFrom: "Hora desde", timeTo: "Hora hasta", weekly: "Semanal" },
155
- "es-MX": { "DD-MM-YYYY": "DD-MM-AAAA", "MM-DD-YYYY": "MM-DD-AAAA", "YYYY-MM-DD": "AAAA-MM-DD", customRange: "Rango personalizado", daily: "Diario", dateFrom: "Fecha de", dateTo: "Fecha hasta", lastMonth: "El mes pasado", lastSevenDays: "Últimos 7 días", lastThreeMonths: "Últimos tres meses", monthly: "Mensual", quarterly: "Trimestral", timeFrom: "Tiempo desde", timeTo: "Es hora de", weekly: "Semanal" },
156
- "fr-FR": { "DD-MM-YYYY": "JJ-MM-AAAA", "MM-DD-YYYY": "MM-JJ-AAAA", "YYYY-MM-DD": "AAAA-MM-JJ", customRange: "Plage personnalisée", daily: "Quotidien", dateFrom: "Date de début", dateTo: "Date de fin", lastMonth: "Le mois dernier", lastSevenDays: "7 derniers jours", lastThreeMonths: "Trois derniers mois", monthly: "Mensuel", quarterly: "Trimestriel", timeFrom: "Heure de début", timeTo: "Heure de fin", weekly: "Hebdomadaire" },
157
- "it-IT": { "DD-MM-YYYY": "GG-MM-AAAA", "MM-DD-YYYY": "MM-GG-AAAA", "YYYY-MM-DD": "AAAA-MM-GG", customRange: "Intervallo personalizzato", daily: "Giornaliero", dateFrom: "Data da", dateTo: "Da", lastMonth: "Il mese scorso", lastSevenDays: "Ultimi 7 giorni", lastThreeMonths: "Gli ultimi tre mesi", monthly: "Mensile", quarterly: "Trimestrale", timeFrom: "Tempo dal", timeTo: "Tempo fino al", weekly: "Settimanale" },
158
- "ja-JP": { "DD-MM-YYYY": "DD-MM-YYYY", "MM-DD-YYYY": "MM-DD-YYYY", "YYYY-MM-DD": "YYYY-MM-DD", customRange: "カスタム範囲", daily: "毎日", dateFrom: "開始日", dateTo: "終了日", lastMonth: "先月", lastSevenDays: "過去 7 日間", lastThreeMonths: "過去3か月", monthly: "毎月", quarterly: "四半期ごと", timeFrom: "開始時刻", timeTo: "終了時刻", weekly: "毎週" },
159
- "pt-BR": { "DD-MM-YYYY": "DD-MM-AAAA", "MM-DD-YYYY": "MM-DD-AAAA", "YYYY-MM-DD": "AAAA-MM-DD", customRange: "Intervalo personalizado", daily: "Diário", dateFrom: "Data a partir de", dateTo: "Data até", lastMonth: "Último mês", lastSevenDays: "Últimos 7 dias", lastThreeMonths: "Últimos 3 meses", monthly: "Mensal", quarterly: "Trimestral", timeFrom: "Horário a partir de", timeTo: "Horário até", weekly: "Semanal" },
160
- "zh-CN": { "DD-MM-YYYY": "日-月-年", "MM-DD-YYYY": "YYYY-MM-DD", "YYYY-MM-DD": "年-月-日", customRange: "自定义范围", daily: "每日", dateFrom: "日期自", dateTo: "日期至", lastMonth: "上个月", lastSevenDays: "最近 7 天", lastThreeMonths: "过去三个月", monthly: "每月", quarterly: "每季度", timeFrom: "时间自", timeTo: "是时候", weekly: "每周" }
161
- }, Za = { class: "b-date-range-picker-calendar" }, et = { class: "b-date-range-picker-calendar__form" }, at = { key: 0 }, tt = {
162
- key: 0,
163
- class: "b-date-range-picker-calendar__calendars-container",
164
- "data-testid": "date-range-picker-calendar-calendar-container"
165
- }, nt = {
166
- name: "date-range-picker-calendar",
167
- i18n: { messages: na }
168
- }, rt = /* @__PURE__ */ Xe({
169
- ...nt,
170
- props: {
171
- /**
172
- * Allows user to enter time values in the form
173
- */
174
- allowTimeInput: { type: Boolean, default: !1 },
175
- /**
176
- * Ranges form persistance data
177
- */
178
- dateFormData: {
179
- type: Object,
180
- default: () => ({ startDate: void 0, endDate: void 0, startTime: void 0, endTime: void 0 })
181
- },
182
- /**
183
- * Allows you to set the first day of the week. 0 is sunday, 1 is monday, 6 is saturday
184
- */
185
- firstDayOfWeek: P.props.firstDayOfWeek,
186
- /**
187
- * A list of available granularities.
188
- * If present, the date picker will display a segmented control to change granularity.
189
- */
190
- granularities: {
191
- type: Array,
192
- default: null
193
- },
194
- /**
195
- * Indicate if a date should be disabled or not
196
- */
197
- isDateDisabled: P.props.isDateDisabled,
198
- /**
199
- * Set a maximum number of dates to be selectable by the range.
200
- */
201
- maxRange: P.props.maxRange,
202
- /**
203
- * Sets a minimum limit for selectable dates - dates before `min` will not be selectable
204
- */
205
- min: P.props.min,
206
- /**
207
- * Sets a maximum limit for selectable dates - dates after `max` will not be selectable
208
- */
209
- max: P.props.max,
210
- /**
211
- * Number of months rendered on pane
212
- */
213
- numberOfMonths: {
214
- type: P.props.numberOfMonths.type,
215
- default: P.props.numberOfMonths.default,
216
- validator: (t) => t >= 0
217
- },
218
- /**
219
- * Displays the end date's month when the calendar is opened. Defaults to false i.e. the start date's month is displayed.
220
- */
221
- showEndDateOnOpen: { type: Boolean, default: !1 },
222
- /**
223
- * Enables the custom range selector.
224
- * If provided, must be an array that sets the custom range dropdown items. Items are of the structure:
225
- * `label` - label of custom range item.
226
- * `value` - a unique key of the custom range item.
227
- * `data` - an object `{ startDate: Date; endDate: Date }` to set the date picker range to upon selecting.
228
- */
229
- quickSelectRanges: {
230
- type: Array,
231
- default: void 0
232
- },
233
- /**
234
- * Selected date
235
- */
236
- value: { type: Object, default: void 0 },
237
- /**
238
- * The type of calendar to display. Defaults to showing days.
239
- */
240
- variant: P.props.variant
241
- },
242
- emits: [
243
- p.CUSTOM_RANGE,
244
- p.INPUT,
245
- p.ERROR,
246
- p.FORM_DATE,
247
- p.START_DATE_SELECTED
248
- ],
249
- setup(t, { emit: m }) {
250
- const s = "customRange", a = t, i = m, D = ga(), v = Ga(D), { t: Y } = Ee({ messages: na }), {
251
- dateFormat: L,
252
- isFormatValid: A,
253
- parseDate: S,
254
- onKeyDown: le,
255
- autoFormat: T,
256
- formatDate: B
257
- } = Oe(), E = C({}), V = f(() => a.variant === "month" ? "monthly" : "daily"), X = f(() => a.numberOfMonths === 0), n = Me({
258
- startDate: a.value?.startDate,
259
- endDate: a.value?.endDate,
260
- range: a.value?.range,
261
- ...a.granularities ? {
262
- granularity: a.value?.granularity || V.value
263
- } : {}
264
- }), O = f(() => (
265
- // eslint-disable-next-line consistent-return
266
- a?.quickSelectRanges?.find(({ value: e, data: l }) => {
267
- if (!l.endDate) {
268
- if (l.isRelativeToNow) {
269
- const d = E.value?.[e];
270
- return d ? ke(d.startDate, n.startDate) && ke(d.endDate, n.endDate) : (
271
- // If not stored calculated dates, fall back to comparing the quick select item's value
272
- // with the internal range's stored range identifier.
273
- e === n.range
274
- );
275
- }
276
- return ke(l.startDate, n.startDate) && ja(n.endDate) && (!a.allowTimeInput || Ie(n.endDate, N(n.endDate))) && (a.granularities ? l.granularity === n.granularity : !0);
277
- }
278
- if (a.allowTimeInput)
279
- return Ie(l.startDate, n.startDate) && Ie(l.endDate, n.endDate) && (a.granularities ? l.granularity === n.granularity : !0);
280
- if (l.endDate)
281
- return q(l.startDate, n.startDate) && q(l.endDate, n.endDate) && (a.granularities ? l.granularity === n.granularity : !0);
282
- })?.value ?? s
283
- )), R = f(() => ({
284
- "b-date-range-picker-calendar__form-input-wrapper": a.allowTimeInput
285
- })), ge = f(() => [
286
- { label: Y("customRange"), value: s },
287
- ...a.quickSelectRanges ? a.quickSelectRanges : []
288
- ]), j = f(
289
- () => a.granularities?.find(({ type: e }) => e === n.granularity) || null
290
- ), se = f(
291
- () => a.granularities?.map(({ type: e, disabled: l }) => ({
292
- label: Y(e),
293
- value: e,
294
- disabled: l
295
- })) ?? []
296
- ), { getGranularCalendarLimits: ee } = Ka(a), M = f(
297
- () => a.granularities ? ee(j.value) : { min: a.min ? h(a.min) : null, max: a.max ? N(a.max) : null }
298
- ), {
299
- adjustDateForQuarterly: Te,
300
- adjustDateForMonthly: oe,
301
- adjustDateForWeekly: ae,
302
- adjustStartDateInputForWeekly: g,
303
- adjustEndDateInputForWeekly: he,
304
- adjustStartDateInputForMonthly: z,
305
- adjustEndDateInputForMonthly: Ye,
306
- adjustStartDateInputForQuarterly: ie,
307
- adjustEndDateInputForQuarterly: de
308
- } = Ea(a.firstDayOfWeek), { savedRanges: k, saveRange: Z, resetSavedRanges: ue } = Xa(), b = (e) => e ? B(e) : "", W = C(!1), $ = C(!1), o = Me({
309
- startDate: a.dateFormData.startDate,
310
- endDate: a.dateFormData.endDate,
311
- startTime: a.dateFormData.startTime,
312
- endTime: a.dateFormData.endTime
313
- }), me = (e, l) => {
314
- let d = new Date(e);
315
- const [y, J, Ma] = l.split(":");
316
- return d = za(d, parseInt(y, 10)), d = Wa(d, parseInt(J, 10)), d = $a(d, parseInt(Ma, 10)), d;
317
- }, ce = (e, l) => {
318
- const d = () => {
319
- if (l && r(l)) {
320
- const y = me(S(l), e);
321
- if (a.min && y < Ke(a.min, 0) || a.max && y > Ke(a.max, 0))
322
- return !1;
323
- }
324
- return !0;
325
- };
326
- return Ve(e) && d();
327
- }, _ = (e, l) => !l || !Ve(l) || a.variant === "month" ? e : me(new Date(e), l), Ae = (e) => {
328
- o.startTime = F(
329
- a.min && a.allowTimeInput && q(a.min, e.startDate) ? a.min : h(e.startDate)
330
- ), o.endTime = F(
331
- a.max && a.allowTimeInput && q(a.max, e.endDate) ? a.max : N(e.endDate)
332
- ), n.startDate = _(e.startDate, o.startTime), n.endDate = _(e.endDate, o.endTime), n.range = null, a.granularities && ue(), i(p.INPUT, {
333
- ...n,
334
- range: O.value
335
- });
336
- }, r = (e) => {
337
- if (!e)
338
- return !1;
339
- const l = (d) => a.min && h(d) < h(a.min) || a.max && h(d) > h(a.max) ? !1 : a.isDateDisabled ? !a.isDateDisabled(h(d)) : !0;
340
- return A(e) && l(S(e));
341
- };
342
- Ze(() => {
343
- W.value = !!(a.dateFormData.startDate && !r(a.dateFormData.startDate)), $.value = !!(a.dateFormData.endDate && !r(a.dateFormData.endDate));
344
- });
345
- const H = (e) => {
346
- o.startDate = b(e), o.startTime || (o.startTime = F(e)), W.value = !1, i(p.START_DATE_SELECTED, e);
347
- }, De = (e) => {
348
- o.endDate = b(e), o.endTime || (o.endTime = F(N(e))), $.value = !1;
349
- }, be = (e) => {
350
- const l = a.value[e];
351
- if (l)
352
- return l;
353
- if (a.dateFormData[e] && r(a.dateFormData[e]))
354
- return S(a.dateFormData[e]);
355
- }, ra = Je((e) => {
356
- if (r(e)) {
357
- let l = e;
358
- switch (W.value = !1, j.value?.type) {
359
- case "weekly":
360
- l = g(
361
- e,
362
- b,
363
- M.value.min,
364
- M.value.max
365
- ), o.startDate = l;
366
- break;
367
- case "monthly":
368
- l = z(
369
- e,
370
- b,
371
- M.value.min,
372
- M.value.max
373
- ), o.startDate = l;
374
- break;
375
- case "quarterly":
376
- l = ie(
377
- e,
378
- b,
379
- M.value.min,
380
- M.value.max
381
- ), o.startDate = l;
382
- break;
383
- }
384
- const d = h(S(l));
385
- n.startDate = _(d, o.startTime), n.endDate = _(
386
- h(S(o.endDate)),
387
- o.endTime
388
- ), r(o.endDate) && (n.endDate = _(
389
- h(S(o.endDate)),
390
- o.endTime
391
- ));
392
- const y = be("endDate");
393
- n.range = null, i(p.FORM_DATE, {
394
- startDate: d,
395
- endDate: y
396
- }), i(p.INPUT, {
397
- ...n,
398
- range: O.value
399
- });
400
- } else
401
- W.value = !0, i(p.ERROR, { ...o });
402
- }, 300), la = (e) => {
403
- o.startDate = T(e), ra(o.startDate);
404
- }, sa = Je((e) => {
405
- if (r(e)) {
406
- let l = e;
407
- switch ($.value = !1, j.value?.type) {
408
- case "weekly":
409
- l = he(
410
- e,
411
- b,
412
- M.value.min,
413
- M.value.max
414
- ), o.endDate = l;
415
- break;
416
- case "monthly":
417
- l = Ye(
418
- e,
419
- b,
420
- M.value.min,
421
- M.value.max
422
- ), o.endDate = l;
423
- break;
424
- case "quarterly":
425
- l = de(
426
- e,
427
- b,
428
- M.value.min,
429
- M.value.max
430
- ), o.endDate = l;
431
- break;
432
- }
433
- const d = h(S(l));
434
- n.endDate = _(d, o.endTime), r(o.startDate) && (n.startDate = _(
435
- h(S(o.startDate)),
436
- o.startTime
437
- ));
438
- const y = be("startDate");
439
- n.range = null, i(p.FORM_DATE, {
440
- startDate: y,
441
- endDate: d
442
- }), i(p.INPUT, {
443
- ...n,
444
- range: O.value
445
- });
446
- } else
447
- $.value = !0, i(p.ERROR, { ...o });
448
- }, 300), oa = (e) => {
449
- o.endDate = T(e), sa(o.endDate);
450
- }, qe = (e) => {
451
- le(e);
452
- }, ia = () => {
453
- i(p.ERROR, { ...o });
454
- }, da = () => {
455
- const e = o.startTime;
456
- if (!ce(e, o.startDate)) {
457
- i(p.ERROR, { ...o });
458
- return;
459
- }
460
- n.startDate = _(n.startDate, e);
461
- const l = be("endDate");
462
- i(p.FORM_DATE, {
463
- startDate: n.startDate,
464
- endDate: l,
465
- startTime: e,
466
- endTime: o.endTime ?? a.dateFormData.endTime
467
- }), i(p.INPUT, {
468
- ...n,
469
- range: O.value
470
- });
471
- }, ua = () => {
472
- i(p.ERROR, { ...o });
473
- }, ma = () => {
474
- const e = o.endTime;
475
- if (!ce(e, o.endDate)) {
476
- i(p.ERROR, { ...o });
477
- return;
478
- }
479
- n.endDate = _(n.endDate, e), i(p.FORM_DATE, {
480
- startDate: n.startDate,
481
- endDate: n.endDate,
482
- startTime: o.startTime ?? a.dateFormData.startTime,
483
- endTime: e
484
- }), i(p.INPUT, {
485
- ...n,
486
- range: O.value
487
- });
488
- }, ca = (e) => {
489
- o.startTime = e;
490
- }, Da = (e) => {
491
- o.endTime = e;
492
- }, pe = (e, l, d, y) => {
493
- n.startDate = e, n.endDate = l, d && (n.granularity = d), y && (n.range = y);
494
- }, pa = (e) => {
495
- const l = a.quickSelectRanges?.find(({ value: d }) => d === e);
496
- if (l) {
497
- ue();
498
- const d = l.data, y = d.endDate || (d.isRelativeToNow ? new Date(Date.now()) : N(new Date(Date.now()))), J = d.isRelativeToNow && d.timeDifference ? new Date(y.getTime() - d.timeDifference) : d.startDate;
499
- o.endDate = b(y), o.startDate = b(J), pe(J, y, null, e), a.granularities && (n.granularity = d.granularity || V.value), o.startTime = F(J), o.endTime = F(y), n.startDate = J, n.endDate = y, d.isRelativeToNow && (E.value = {
500
- ...E.value,
501
- [e]: {
502
- startDate: J,
503
- endDate: y
504
- }
505
- }), i(p.CUSTOM_RANGE, {
506
- ...l.data,
507
- startDate: J,
508
- endDate: y,
509
- range: l.value
510
- });
511
- }
512
- }, fa = {
513
- weekly: ae,
514
- monthly: oe,
515
- quarterly: Te
516
- }, va = (e) => {
517
- const l = n.granularity;
518
- if (n.granularity = e, l && Z(l, structuredClone(we(n))), n.startDate && n.endDate) {
519
- switch (e) {
520
- case "quarterly":
521
- case "monthly":
522
- case "weekly": {
523
- if (k[e]) {
524
- pe(k[e].startDate, k[e].endDate, e);
525
- break;
526
- }
527
- const { startDate: d, endDate: y } = fa[e](
528
- n.startDate,
529
- n.endDate,
530
- M.value.min,
531
- M.value.max
532
- );
533
- pe(d, y, e);
534
- break;
535
- }
536
- case "daily":
537
- k.daily && pe(k.daily.startDate, k.daily.endDate, e);
538
- break;
539
- }
540
- o.startDate = b(n.startDate), o.endDate = b(n.endDate), i(p.INPUT, {
541
- ...n,
542
- range: O.value
543
- });
544
- }
545
- }, ya = f(() => ({
546
- "b-date-range-picker-calendar__form-container--no-calendars": X.value
547
- }));
548
- return (e, l) => (I(), fe("div", Za, [
549
- Q("div", {
550
- class: ve(["b-date-range-picker-calendar__form-container", ya.value]),
551
- "data-testid": "date-range-picker-calendar-form-container"
552
- }, [
553
- Q("div", et, [
554
- u(v)("title") ? Be(e.$slots, "title", { key: 0 }, void 0, !0) : w("", !0),
555
- t.quickSelectRanges ? (I(), x(xa, {
556
- key: 1,
557
- "aria-label": u(Y)("customRange"),
558
- items: ge.value,
559
- "model-value": O.value,
560
- "onUpdate:modelValue": pa
561
- }, null, 8, ["aria-label", "items", "model-value"])) : w("", !0),
562
- t.granularities ? (I(), x(u(Ua), {
563
- key: 2,
564
- items: se.value,
565
- "model-value": n.granularity,
566
- "full-width": "",
567
- "onUpdate:modelValue": va
568
- }, null, 8, ["items", "model-value"])) : w("", !0),
569
- Q("div", null, [
570
- U(u(Fe), {
571
- stronger: "",
572
- el: "span",
573
- class: "b-date-range-picker-calendar__label"
574
- }, {
575
- default: K(() => l[0] || (l[0] = [
576
- ne(" From ")
577
- ])),
578
- _: 1
579
- }),
580
- Q("div", {
581
- class: ve(R.value)
582
- }, [
583
- U(u(Ge), {
584
- "aria-label": u(Y)("dateFrom"),
585
- "model-value": o.startDate,
586
- error: W.value,
587
- class: "b-date-range-picker-calendar__form-input",
588
- "onUpdate:modelValue": la,
589
- onKeydown: qe
590
- }, {
591
- description: K(() => [
592
- ne(Se(u(Y)(u(L))), 1)
593
- ]),
594
- _: 1
595
- }, 8, ["aria-label", "model-value", "error"]),
596
- t.allowTimeInput ? (I(), x(u(Le), {
597
- key: 0,
598
- "aria-label": u(Y)("timeFrom"),
599
- "model-value": o.startTime,
600
- class: "b-date-range-picker-calendar__form-input",
601
- "onUpdate:modelValue": ca,
602
- "onInput:error": ia,
603
- "onInput:valid": da
604
- }, null, 8, ["aria-label", "model-value"])) : w("", !0)
605
- ], 2)
606
- ]),
607
- Q("div", null, [
608
- U(u(Fe), {
609
- stronger: "",
610
- el: "span",
611
- class: "b-date-range-picker-calendar__label"
612
- }, {
613
- default: K(() => l[1] || (l[1] = [
614
- ne(" To ")
615
- ])),
616
- _: 1
617
- }),
618
- Q("div", {
619
- class: ve(R.value)
620
- }, [
621
- U(u(Ge), {
622
- class: "b-date-range-picker-calendar__form-input",
623
- "aria-label": u(Y)("dateTo"),
624
- "model-value": o.endDate,
625
- error: $.value,
626
- "onUpdate:modelValue": oa,
627
- onKeydown: qe
628
- }, {
629
- description: K(() => [
630
- ne(Se(u(Y)(u(L))), 1)
631
- ]),
632
- _: 1
633
- }, 8, ["aria-label", "model-value", "error"]),
634
- t.allowTimeInput ? (I(), x(u(Le), {
635
- key: 0,
636
- "aria-label": u(Y)("timeTo"),
637
- "model-value": o.endTime,
638
- class: "b-date-range-picker-calendar__form-input",
639
- "onUpdate:modelValue": Da,
640
- "onInput:error": ua,
641
- "onInput:valid": ma
642
- }, null, 8, ["aria-label", "model-value"])) : w("", !0)
643
- ], 2)
644
- ])
645
- ]),
646
- u(v)("actions") ? (I(), fe("div", at, [
647
- Be(e.$slots, "actions", {}, void 0, !0)
648
- ])) : w("", !0)
649
- ], 2),
650
- X.value ? w("", !0) : (I(), fe("div", tt, [
651
- U(u(P), {
652
- value: n,
653
- "first-day-of-week": t.firstDayOfWeek,
654
- "is-date-disabled": t.isDateDisabled,
655
- "max-range": t.maxRange,
656
- min: M.value.min,
657
- max: M.value.max,
658
- "number-of-months": t.numberOfMonths,
659
- "show-end-date-on-open": t.showEndDateOnOpen,
660
- granularity: j.value,
661
- variant: t.variant,
662
- "is-range": "",
663
- onInput: Ae,
664
- onStartDateSelected: H,
665
- onEndDateSelected: De
666
- }, null, 8, ["value", "first-day-of-week", "is-date-disabled", "max-range", "min", "max", "number-of-months", "show-end-date-on-open", "granularity", "variant"])
667
- ]))
668
- ]));
669
- }
670
- }), lt = /* @__PURE__ */ aa(rt, [["__scopeId", "data-v-65a88054"]]), _e = {
671
- "de-DE": { apply: "Anwenden", cancel: "Abbrechen", dateRangePicker: "Datumsbereichauswahl {name}", provideDateInAFormat: "Geben Sie das Datum im Format YYYY-MM-DD an", quarter: "Q{quarter} {year}", selectDate: "Wählen Sie ein Datum", selectDateRange: "Wählen Sie einen Datumsbereich aus", selectedDateIsNotAvailable: "Ausgewähltes Datum ist nicht verfügbar" },
672
- "en-GB": { apply: "Apply", cancel: "Cancel", dateRangePicker: "Date range picker {name}", provideDateInAFormat: "Enter date in YYYY-MM-DD format", quarter: "Q{quarter} {year}", selectDate: "Select a date", selectDateRange: "Select a date range", selectedDateIsNotAvailable: "Selected date is not available" },
673
- "en-US": { apply: "Apply", cancel: "Cancel", dateRangePicker: "Date range picker {name}", provideDateInAFormat: "Provide date in a YYYY-MM-DD format", quarter: "Q{quarter} {year}", selectDate: "Select a date", selectDateRange: "Select a date range", selectedDateIsNotAvailable: "Selected date is not available" },
674
- "es-ES": { apply: "Aplicar", cancel: "Cancelar", dateRangePicker: "Selector de intervalos de fechas {name}", provideDateInAFormat: "Proporciona la fecha en formato AAAAA-MM-DD", quarter: "T{quarter} {year}", selectDate: "Selecciona una fecha", selectDateRange: "Selecciona un rango de fechas", selectedDateIsNotAvailable: "La fecha seleccionada no está disponible" },
675
- "es-MX": { apply: "Aplicar", cancel: "Cancelar", dateRangePicker: "Selector de intervalos de fechas {name}", provideDateInAFormat: "Proporciona la fecha en formato AAAA-MM-DD", quarter: "T{quarter} {year}", selectDate: "Selecciona una fecha", selectDateRange: "Selecciona un rango de fechas", selectedDateIsNotAvailable: "La fecha seleccionada no está disponible" },
676
- "fr-FR": { apply: "Appliquer", cancel: "Annuler", dateRangePicker: "Sélecteur de plages de dates {name}", provideDateInAFormat: "Fournissez la date au format AAAA-MM-JJ", quarter: "T{quarter} {year}", selectDate: "Sélectionnez une date", selectDateRange: "Sélectionnez une plage de dates", selectedDateIsNotAvailable: "La date sélectionnée n’est pas disponible" },
677
- "it-IT": { apply: "Applica", cancel: "Annulla", dateRangePicker: "Selettore intervallo di date {name}", provideDateInAFormat: "Inserisci la data nel formato AAAA-MM-GG", quarter: "Q{quarter} {year}", selectDate: "Seleziona una data", selectDateRange: "Seleziona un intervallo di date", selectedDateIsNotAvailable: "La data selezionata non è disponibile" },
678
- "ja-JP": { apply: "適用", cancel: "キャンセル", dateRangePicker: "日付範囲ピッカー {name}", provideDateInAFormat: "YYYY-MM-DD形式で日付を入力してください", quarter: "{year}年第{quarter}四半期", selectDate: "日付を選択", selectDateRange: "日付範囲を選択", selectedDateIsNotAvailable: "選択した日付は利用できません" },
679
- "pt-BR": { apply: "Aplicar", cancel: "Cancelar", dateRangePicker: "Seletor de intervalo de datas {name}", provideDateInAFormat: "Inclua a data no formato AAAA-MM-DD", quarter: "{quarter}º trimestre de {year}", selectDate: "Selecione uma data", selectDateRange: "Selecione um intervalo de datas", selectedDateIsNotAvailable: "A data selecionada não está disponível" },
680
- "zh-CN": { apply: "应用", cancel: "取消", dateRangePicker: "日期范围选择器 {name}", provideDateInAFormat: "提供 YYYY-MM-DD 格式的日期", quarter: "{year} {quarter} 季度", selectDate: "选择日期", selectDateRange: "选择日期范围", selectedDateIsNotAvailable: "所选日期不可用" }
681
- }, st = ({
682
- datePickerValue: t,
683
- isDateIncorrect: m,
684
- quickSelectRanges: c,
685
- isMonthVariant: s,
686
- withTimeInput: a,
687
- placeholder: i
688
- }) => {
689
- const { locale: D, t: v } = Ee({ messages: _e }), { dateToInputDateString: Y } = Oe(), L = (T) => !!T && !isNaN(T.getTime()), A = Me({
690
- startDate: null,
691
- endDate: null,
692
- startTime: null,
693
- endTime: null
694
- });
695
- return ye(
696
- t,
697
- (T) => {
698
- A.startDate = Y(T?.startDate), A.endDate = Y(T?.endDate), A.startTime = F(T?.startDate), A.endTime = F(T?.endDate);
699
- },
700
- { immediate: !0 }
701
- ), {
702
- // Values
703
- dateDisplayValue: f(() => {
704
- if (m.value)
705
- return `${A.startDate || ""} - ${A.endDate || ""}`;
706
- if (!t.value || !t.value.startDate && !t.value.endDate)
707
- return i?.value || v("selectDateRange");
708
- if (c.value?.length) {
709
- const B = c.value.find(({ value: E }) => E === t.value?.range);
710
- if (B)
711
- return B.label;
712
- }
713
- if (t.value.granularity === "quarterly") {
714
- const { startDate: B, endDate: E } = t.value, V = v("quarter", { quarter: We(B), year: $e(B) });
715
- if (Qa(B, E))
716
- return V;
717
- const X = v("quarter", { quarter: We(E), year: $e(E) });
718
- return `${V} - ${X}`;
719
- }
720
- if (!L(t.value.startDate) || !L(t.value.endDate))
721
- return `${A.startDate || ""} - ${A.endDate || ""}`;
722
- let T = s?.value ? { month: "long", year: "numeric" } : { month: "short", day: "2-digit", year: "numeric" };
723
- return a.value && (T = {
724
- ...T,
725
- hour: "numeric",
726
- minute: "numeric",
727
- second: "numeric",
728
- hour12: !1
729
- }), Oa(D.value, T).formatRange(
730
- t.value.startDate,
731
- t.value.endDate
732
- );
733
- }),
734
- textInputDisplayValue: A,
735
- // Methods
736
- formatTextInputDisplayValue: () => ""
737
- };
738
- }, ot = { class: "b-date-range-picker" }, it = { class: "b-date-range-picker__footer" }, dt = {
739
- i18n: { messages: _e },
740
- name: "bento-date-range-picker",
741
- model: { prop: "modelValue" }
742
- }, ut = /* @__PURE__ */ Xe({
743
- ...dt,
744
- props: {
745
- allowTimeInput: { type: Boolean },
746
- firstDayOfWeek: { default: void 0 },
747
- granularities: {},
748
- isDateDisabled: { type: Function, default: void 0 },
749
- showEndDateOnOpen: { type: Boolean, default: !1 },
750
- quickSelectRanges: { default: void 0 },
751
- maxRange: { default: null },
752
- min: { default: null },
753
- max: { default: null },
754
- numberOfMonths: { default: void 0 },
755
- modelValue: { default: null },
756
- value: { default: null },
757
- variant: { default: void 0 },
758
- hasActions: { type: Boolean, default: !1 },
759
- description: { default: void 0 },
760
- disabled: { type: Boolean, default: !1 },
761
- errorMessage: { default: null },
762
- label: { default: void 0 },
763
- optional: { type: Boolean, default: !1 },
764
- placeholder: { default: null },
765
- readonly: { type: Boolean, default: !1 },
766
- required: { type: Boolean, default: !1 },
767
- tooltipText: { default: null }
768
- },
769
- emits: ["update:model-value", "input"],
770
- setup(t, { emit: m }) {
771
- const c = m, s = t, a = Ta(), { t: i } = Ee({ messages: _e }), { dateToInputDateString: D } = Oe(), v = te("bento-date-range-picker-container"), Y = te("bento-date-range-picker-label"), L = te("bento-date-range-picker-description"), A = te("bento-date-range-picker-error"), S = te("bento-date-range-picker-date-error"), le = f(() => s.label || i("dateRangePicker", { name: v })), { resolvedFirstDayOfWeek: T } = _a(Re(s, "firstDayOfWeek")), B = Aa({
772
- none: 0,
773
- one: 710,
774
- // width of date range picker with one panes
775
- two: 1030,
776
- // width of date range picker with two panes
777
- three: 1290
778
- // width of date range picker with three panes
779
- }), E = f(() => {
780
- const r = B.active().value, H = {
781
- none: 0,
782
- one: 1,
783
- two: 2
784
- };
785
- if (r in H) {
786
- const De = H[r];
787
- return s.numberOfMonths === void 0 ? De : Math.min(s.numberOfMonths, De);
788
- }
789
- return s.numberOfMonths;
790
- }), V = f(() => s?.quickSelectRanges && s.quickSelectRanges.map((r) => {
791
- const H = r.data.endDate ? void 0 : new Date(Date.now()).getTime() - r.data.startDate.getTime();
792
- return {
793
- ...r,
794
- data: {
795
- ...r.data,
796
- // Adding timeDifference to calculate an up-to-date endDate on range selection
797
- timeDifference: H
798
- }
799
- };
800
- })), X = f(() => s.label ? Y : a?.["aria-labelledby"] ?? null), n = C(!1), O = C(null), R = C(!1), { isReadOnly: ge } = Ca(Re(s, "readonly")), { emitValue: j } = Pa(c);
801
- ye(
802
- () => s.disabled,
803
- () => {
804
- s.disabled && R.value && (R.value = !1);
805
- }
806
- );
807
- const se = f(() => s.modelValue || s.value), ee = f(() => s.hasActions ? !Z.value && n.value : n.value), M = f(() => ({
808
- "b-date-range-picker__description--error": !!s.errorMessage || ee.value
809
- })), Te = f(() => s.variant === "month"), oe = f(() => s.allowTimeInput && s.variant !== "month"), { dateDisplayValue: ae, textInputDisplayValue: g } = st({
810
- datePickerValue: se,
811
- isDateIncorrect: n,
812
- quickSelectRanges: V,
813
- isMonthVariant: Te,
814
- withTimeInput: oe,
815
- placeholder: Re(s, "placeholder")
816
- }), he = f(
817
- () => `${s.description ? L : ""} ${s.errorMessage ? A : ""} ${n.value ? S : ""}`.trim() || null
818
- ), z = () => {
819
- R.value = !1;
820
- }, Ye = () => {
821
- R.value = !0;
822
- }, ie = C(ae.value), de = C(
823
- // textInputDisplayValue is a reactive object
824
- structuredClone(we(g))
825
- ), k = C(s.modelValue ?? s.value), Z = C(!0), ue = f(
826
- () => s.hasActions ? de.value : g
827
- ), b = f(
828
- () => s.hasActions ? ie.value : ae.value
829
- );
830
- Ze(() => {
831
- if (s.hasActions || Ne(
832
- 'BentoDateRangePicker "hasActions" property',
833
- `Set the BentoDateRangePicker "hasActions" property true which will display the "Apply" and "Cancel" buttons.
834
- This will be the default behavior in the v2 and "hasActions" will be removed.`,
835
- "2.0.0"
836
- ), s.value && Ne(
837
- 'BentoDateRangePicker "value" property',
838
- 'The use of "value" prop in "BentoDateRangePicker" is no longer supported. Use the "v-model" or "model-value" property instead.',
839
- "2.0.0"
840
- ), s.granularities && s.variant !== "month" && s.granularities.find(({ type: r }) => r === "quarterly"))
841
- throw new Error('Quarterly granularity is only supported by BentoDateRangePicker with variant: "month"');
842
- }), ye([() => s.value, () => s.modelValue], () => {
843
- ie.value = ae.value, de.value = structuredClone(we(g));
844
- });
845
- const W = f(() => [
846
- {
847
- title: i("apply"),
848
- event: () => {
849
- j(k.value), z(), Z.value = !0;
850
- },
851
- disabled: Z.value
852
- },
853
- {
854
- title: i("cancel"),
855
- event: z
856
- }
857
- ]);
858
- ye(k, (r) => {
859
- if (s.hasActions) {
860
- Z.value = n.value;
861
- return;
862
- }
863
- j(r);
864
- });
865
- const $ = (r) => {
866
- n.value = !1, g.startDate = D(r.startDate), g.endDate = D(r.endDate), g.startTime = F(r.startDate), g.endTime = F(r.endDate), k.value = r;
867
- }, o = async () => {
868
- n.value && (n.value = !1), k.value = null;
869
- }, me = () => {
870
- if (!R.value) {
871
- R.value = !0;
872
- return;
873
- }
874
- n.value || (R.value = !1);
875
- }, ce = (r) => {
876
- n.value = !1, r.startTime && (g.startTime = r.startTime), r.endTime && (g.endTime = r.endTime);
877
- }, _ = (r) => {
878
- n.value = !0, g.startDate = r.startDate, g.endDate = r.endDate, k.value = { startDate: null, endDate: null };
879
- }, Ae = (r) => {
880
- r && (g.startDate = D(r.startDate), g.endDate = D(r.endDate), g.startTime = F(r.startDate), g.endTime = F(r.endDate), k.value = r);
881
- };
882
- return (r, H) => ha((I(), fe("div", ot, [
883
- r.label ? (I(), x(u(Va), {
884
- key: 0,
885
- id: u(Y),
886
- label: r.label,
887
- "tooltip-text": r.tooltipText,
888
- optional: r.optional,
889
- required: r.required
890
- }, null, 8, ["id", "label", "tooltip-text", "optional", "required"])) : w("", !0),
891
- Q("div", {
892
- onKeydown: Ce(me, ["enter"])
893
- }, [
894
- U(u(Ia), {
895
- ref_key: "inputContainerRef",
896
- ref: O,
897
- "always-combobox-is-input": "",
898
- ariaControls: u(v),
899
- ariaExpanded: R.value,
900
- "aria-labelledby": X.value,
901
- "aria-describedby": he.value,
902
- "aria-required": r.required,
903
- disabled: r.disabled,
904
- "is-invalid": !!r.errorMessage || ee.value,
905
- open: R.value,
906
- "display-value": b.value,
907
- readonly: u(ge),
908
- onOpen: Ye,
909
- onClear: o,
910
- onClose: z
911
- }, null, 8, ["ariaControls", "ariaExpanded", "aria-labelledby", "aria-describedby", "aria-required", "disabled", "is-invalid", "open", "display-value", "readonly"])
912
- ], 32),
913
- ee.value ? (I(), x(u(ze), {
914
- key: 1,
915
- id: u(S),
916
- "error-message": u(i)("provideDateInAFormat"),
917
- class: "b-date-range-picker__error-message"
918
- }, null, 8, ["id", "error-message"])) : w("", !0),
919
- r.errorMessage ? (I(), x(u(ze), {
920
- key: 2,
921
- id: u(A),
922
- "error-message": r.errorMessage,
923
- class: "b-date-range-picker__error-message"
924
- }, null, 8, ["id", "error-message"])) : w("", !0),
925
- r.description ? (I(), x(u(Fe), {
926
- key: 3,
927
- id: u(L),
928
- class: ve(["b-date-range-picker__description", M.value]),
929
- el: "span"
930
- }, {
931
- default: K(() => [
932
- ne(Se(r.description), 1)
933
- ]),
934
- _: 1
935
- }, 8, ["id", "class"])) : w("", !0),
936
- O.value ? (I(), x(u(Ra), {
937
- key: 4,
938
- id: u(v),
939
- class: "b-date-range-picker__container",
940
- open: R.value,
941
- "target-element": O.value,
942
- "aria-label": le.value,
943
- position: "bottom-start",
944
- "without-space": "",
945
- "fit-content": "",
946
- "trap-all": "",
947
- "overflow-visible": "",
948
- onKeydown: Ce(z, ["esc", "native"])
949
- }, {
950
- default: K(() => [
951
- U(u(lt), {
952
- "allow-time-input": oe.value,
953
- "quick-select-ranges": V.value,
954
- value: se.value,
955
- "first-day-of-week": u(T),
956
- granularities: r.granularities,
957
- "is-date-disabled": r.isDateDisabled,
958
- "max-range": r.maxRange,
959
- min: r.min,
960
- max: r.max,
961
- "number-of-months": E.value,
962
- "show-end-date-on-open": r.showEndDateOnOpen,
963
- "date-form-data": ue.value,
964
- variant: r.variant,
965
- onCustomRange: Ae,
966
- onInput: $,
967
- onError: _,
968
- onFormDate: ce
969
- }, Ya({ _: 2 }, [
970
- r.hasActions ? {
971
- name: "actions",
972
- fn: K(() => [
973
- U(u(ba)),
974
- Q("div", it, [
975
- U(u(ka), {
976
- actions: W.value,
977
- layout: u(Ja).SPACE_BETWEEN
978
- }, null, 8, ["actions", "layout"])
979
- ])
980
- ]),
981
- key: "0"
982
- } : void 0
983
- ]), 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"])
984
- ]),
985
- _: 1
986
- }, 8, ["id", "open", "target-element", "aria-label"])) : w("", !0)
987
- ])), [
988
- [u(Na), z]
989
- ]);
990
- }
991
- }), Nt = /* @__PURE__ */ aa(ut, [["__scopeId", "data-v-e00826fe"]]);
992
- export {
993
- Nt as B,
994
- lt as D,
995
- ja as a,
996
- ke as i
997
- };
998
- //# sourceMappingURL=date-range-picker.fyrfFd04.js.map