@adyen/bento-vue3 1.96.1 → 1.97.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 (176) hide show
  1. package/dist/@types/index.d.ts +159 -125
  2. package/dist/action-bar.js +1 -1
  3. package/dist/ai-tag.js +1 -1
  4. package/dist/alert.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/alert.css +1 -1
  8. package/dist/assets/base-modal.css +1 -1
  9. package/dist/assets/button-actions.css +1 -1
  10. package/dist/assets/calendar.css +1 -1
  11. package/dist/assets/card.css +1 -1
  12. package/dist/assets/country.css +1 -1
  13. package/dist/assets/data-grid.css +1 -1
  14. package/dist/assets/date-picker.css +1 -1
  15. package/dist/assets/date-range-picker.css +1 -1
  16. package/dist/assets/date-time-picker.css +1 -1
  17. package/dist/assets/dialog-page.css +1 -1
  18. package/dist/assets/dropdown.css +1 -1
  19. package/dist/assets/file-uploader.css +1 -1
  20. package/dist/assets/filter-bar.css +1 -1
  21. package/dist/assets/inspector.css +1 -1
  22. package/dist/assets/modal-fullscreen.css +1 -1
  23. package/dist/assets/navigation-menu-group.css +1 -1
  24. package/dist/assets/secondary-nav.css +1 -1
  25. package/dist/assets/sidepanel.css +1 -1
  26. package/dist/assets/summary-grid.css +1 -1
  27. package/dist/assets/textarea.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.CIVprT2U.js → action-bar.BEV9uXHS.js} +3 -3
  32. package/dist/chunks/{action-bar.CIVprT2U.js.map → action-bar.BEV9uXHS.js.map} +1 -1
  33. package/dist/chunks/{ai-tag.DkTlRY__.js → ai-tag.BSzY3-0w.js} +2 -2
  34. package/dist/chunks/{ai-tag.DkTlRY__.js.map → ai-tag.BSzY3-0w.js.map} +1 -1
  35. package/dist/chunks/{alert.RD0qOLhx.js → alert.V1imvtyI.js} +3 -3
  36. package/dist/chunks/alert.V1imvtyI.js.map +1 -0
  37. package/dist/chunks/{base-modal.BKtpH-qh.js → base-modal.B7SiRo7c.js} +3 -3
  38. package/dist/chunks/{base-modal.BKtpH-qh.js.map → base-modal.B7SiRo7c.js.map} +1 -1
  39. package/dist/chunks/{button-actions-with-menu.cMAAF47d.js → button-actions-with-menu.DoUcLg-M.js} +2 -2
  40. package/dist/chunks/{button-actions-with-menu.cMAAF47d.js.map → button-actions-with-menu.DoUcLg-M.js.map} +1 -1
  41. package/dist/chunks/{button-actions.CxTxPprd.js → button-actions.CWmTl4cF.js} +170 -161
  42. package/dist/chunks/{button-actions.CxTxPprd.js.map → button-actions.CWmTl4cF.js.map} +1 -1
  43. package/dist/chunks/calendar.6NKd6IMo.js +1272 -0
  44. package/dist/chunks/calendar.6NKd6IMo.js.map +1 -0
  45. package/dist/chunks/{card.CQlyqa5-.js → card.Ca7FkYxy.js} +2 -2
  46. package/dist/chunks/{card.CQlyqa5-.js.map → card.Ca7FkYxy.js.map} +1 -1
  47. package/dist/chunks/{checkbox-group.BcDIXL27.js → checkbox-group.BWx4wn0F.js} +2 -2
  48. package/dist/chunks/{checkbox-group.BcDIXL27.js.map → checkbox-group.BWx4wn0F.js.map} +1 -1
  49. package/dist/chunks/{checkbox.LTRqb-pE.js → checkbox.DwfrmbwI.js} +18 -18
  50. package/dist/chunks/{checkbox.LTRqb-pE.js.map → checkbox.DwfrmbwI.js.map} +1 -1
  51. package/dist/chunks/{code-snippet.DHzB-8JJ.js → code-snippet.Cp61a0Ud.js} +3 -3
  52. package/dist/chunks/{code-snippet.DHzB-8JJ.js.map → code-snippet.Cp61a0Ud.js.map} +1 -1
  53. package/dist/chunks/{country.15m_ATbO.js → country.a-fpQGLP.js} +2 -2
  54. package/dist/chunks/country.a-fpQGLP.js.map +1 -0
  55. package/dist/chunks/{dashboard-section.Da6ZFGtm.js → dashboard-section.BR0xU-b-.js} +2 -2
  56. package/dist/chunks/{dashboard-section.Da6ZFGtm.js.map → dashboard-section.BR0xU-b-.js.map} +1 -1
  57. package/dist/chunks/{dashed-underline.DJmMXcdt.js → dashed-underline.CxpIRlCx.js} +2 -2
  58. package/dist/chunks/{dashed-underline.DJmMXcdt.js.map → dashed-underline.CxpIRlCx.js.map} +1 -1
  59. package/dist/chunks/{data-grid-template.-MuGcJp1.js → data-grid-template.LTILymaF.js} +2 -2
  60. package/dist/chunks/{data-grid-template.-MuGcJp1.js.map → data-grid-template.LTILymaF.js.map} +1 -1
  61. package/dist/chunks/{data-grid.kZgqWqQx.js → data-grid.xcmkjuyg.js} +26 -27
  62. package/dist/chunks/{data-grid.kZgqWqQx.js.map → data-grid.xcmkjuyg.js.map} +1 -1
  63. package/dist/chunks/date-picker.CCETX031.js +279 -0
  64. package/dist/chunks/date-picker.CCETX031.js.map +1 -0
  65. package/dist/chunks/date-picker.types.Ckt7zxGy.js.map +1 -1
  66. package/dist/chunks/date-range-picker.CtGaxtYh.js +1095 -0
  67. package/dist/chunks/date-range-picker.CtGaxtYh.js.map +1 -0
  68. package/dist/chunks/date-range-picker.types.Ckt7zxGy.js.map +1 -1
  69. package/dist/chunks/{draggable-handle.C1dudqKz.js → draggable-handle.CUecl-HB.js} +2 -2
  70. package/dist/chunks/{draggable-handle.C1dudqKz.js.map → draggable-handle.CUecl-HB.js.map} +1 -1
  71. package/dist/chunks/{dropdown-tag.C1ei1SyR.js → dropdown-tag.BgZYYc_D.js} +2 -2
  72. package/dist/chunks/{dropdown-tag.C1ei1SyR.js.map → dropdown-tag.BgZYYc_D.js.map} +1 -1
  73. package/dist/chunks/dropdown.C97ShfXZ.js +2958 -0
  74. package/dist/chunks/dropdown.C97ShfXZ.js.map +1 -0
  75. package/dist/chunks/{file-uploader.C9YOBRQg.js → file-uploader.CXgAfp0m.js} +2 -2
  76. package/dist/chunks/{file-uploader.C9YOBRQg.js.map → file-uploader.CXgAfp0m.js.map} +1 -1
  77. package/dist/chunks/{filter-bar.CzFtzztU.js → filter-bar.D8BVPHLT.js} +44 -41
  78. package/dist/chunks/filter-bar.D8BVPHLT.js.map +1 -0
  79. package/dist/chunks/{footer-actions.zlKq74F1.js → footer-actions.C_HlJeXP.js} +2 -2
  80. package/dist/chunks/{footer-actions.zlKq74F1.js.map → footer-actions.C_HlJeXP.js.map} +1 -1
  81. package/dist/chunks/{form-layout-title.Kwve4xv2.js → form-layout-title.CWw0poO8.js} +2 -2
  82. package/dist/chunks/{form-layout-title.Kwve4xv2.js.map → form-layout-title.CWw0poO8.js.map} +1 -1
  83. package/dist/chunks/{header-meta.NFZo1ACP.js → header-meta.yBxBW12f.js} +2 -2
  84. package/dist/chunks/{header-meta.NFZo1ACP.js.map → header-meta.yBxBW12f.js.map} +1 -1
  85. package/dist/chunks/{header-with-views.ubPTyW9A.js → header-with-views.qCyKEZW1.js} +8 -8
  86. package/dist/chunks/{header-with-views.ubPTyW9A.js.map → header-with-views.qCyKEZW1.js.map} +1 -1
  87. package/dist/chunks/{header.Ds0sFKBB.js → header.aJLkRe1D.js} +3 -3
  88. package/dist/chunks/{header.Ds0sFKBB.js.map → header.aJLkRe1D.js.map} +1 -1
  89. package/dist/chunks/{input-field-password.CZ-NTpZF.js → input-field-password.DUSoJYKT.js} +3 -3
  90. package/dist/chunks/{input-field-password.CZ-NTpZF.js.map → input-field-password.DUSoJYKT.js.map} +1 -1
  91. package/dist/chunks/{input-field-phone-number.DOHk6gSp.js → input-field-phone-number.Q-bQJL4g.js} +2 -2
  92. package/dist/chunks/{input-field-phone-number.DOHk6gSp.js.map → input-field-phone-number.Q-bQJL4g.js.map} +1 -1
  93. package/dist/chunks/{input-field.DBlTGgAD.js → input-field.CvnmfrzQ.js} +2 -2
  94. package/dist/chunks/{input-field.DBlTGgAD.js.map → input-field.CvnmfrzQ.js.map} +1 -1
  95. package/dist/chunks/{input-time.CHIjCO74.js → input-time.CGPUOOQ9.js} +45 -45
  96. package/dist/chunks/{input-time.CHIjCO74.js.map → input-time.CGPUOOQ9.js.map} +1 -1
  97. package/dist/chunks/{modal-fullscreen.DmruiE3n.js → modal-fullscreen.CBxh_3gU.js} +2 -2
  98. package/dist/chunks/{modal-fullscreen.DmruiE3n.js.map → modal-fullscreen.CBxh_3gU.js.map} +1 -1
  99. package/dist/chunks/{modal.vue_vue_type_script_setup_true_lang.CrJQWuzb.js → modal.vue_vue_type_script_setup_true_lang.C3xuswtY.js} +4 -4
  100. package/dist/chunks/{modal.vue_vue_type_script_setup_true_lang.CrJQWuzb.js.map → modal.vue_vue_type_script_setup_true_lang.C3xuswtY.js.map} +1 -1
  101. package/dist/chunks/{pagination.DbpHH_53.js → pagination.cNByWBP1.js} +2 -2
  102. package/dist/chunks/{pagination.DbpHH_53.js.map → pagination.cNByWBP1.js.map} +1 -1
  103. package/dist/chunks/{rich-text-editor.u-V4fNWK.js → rich-text-editor.CJA_d518.js} +3 -3
  104. package/dist/chunks/{rich-text-editor.u-V4fNWK.js.map → rich-text-editor.CJA_d518.js.map} +1 -1
  105. package/dist/chunks/{search-bar.TKgi1KLs.js → search-bar.CLjqWNaI.js} +6 -6
  106. package/dist/chunks/{search-bar.TKgi1KLs.js.map → search-bar.CLjqWNaI.js.map} +1 -1
  107. package/dist/chunks/{secondary-nav.0OsJiAWI.js → secondary-nav.BU47gyEO.js} +2 -2
  108. package/dist/chunks/{secondary-nav.0OsJiAWI.js.map → secondary-nav.BU47gyEO.js.map} +1 -1
  109. package/dist/chunks/{selection-card-group.C59ZIrVm.js → selection-card-group.C2Av3uyz.js} +9 -9
  110. package/dist/chunks/{selection-card-group.C59ZIrVm.js.map → selection-card-group.C2Av3uyz.js.map} +1 -1
  111. package/dist/chunks/{sidepanel.BVQt6Tac.js → sidepanel.Dw2If3qM.js} +3 -3
  112. package/dist/chunks/{sidepanel.BVQt6Tac.js.map → sidepanel.Dw2If3qM.js.map} +1 -1
  113. package/dist/chunks/{summary-grid.types.9sUs0LS0.js → summary-grid.types.Cnrc4ThJ.js} +3 -3
  114. package/dist/chunks/summary-grid.types.Cnrc4ThJ.js.map +1 -0
  115. package/dist/chunks/{timeline-item.DfwOm5do.js → timeline-item.BWhCoOf1.js} +3 -3
  116. package/dist/chunks/{timeline-item.DfwOm5do.js.map → timeline-item.BWhCoOf1.js.map} +1 -1
  117. package/dist/chunks/{tutorial.vue_vue_type_script_setup_true_lang.B5-sWGlz.js → tutorial.vue_vue_type_script_setup_true_lang.QWcInKo7.js} +2 -2
  118. package/dist/chunks/{tutorial.vue_vue_type_script_setup_true_lang.B5-sWGlz.js.map → tutorial.vue_vue_type_script_setup_true_lang.QWcInKo7.js.map} +1 -1
  119. package/dist/chunks/use-bento-delayed-hover.Csc3nIWt.js.map +1 -1
  120. package/dist/chunks/{use-date-input-formatter.x285YiSd.js → use-date-input-formatter.QXaVIBS0.js} +2 -2
  121. package/dist/chunks/{use-date-input-formatter.x285YiSd.js.map → use-date-input-formatter.QXaVIBS0.js.map} +1 -1
  122. package/dist/code-snippet.js +1 -1
  123. package/dist/country.js +1 -1
  124. package/dist/dashboard-template.js +1 -1
  125. package/dist/dashed-underline.js +1 -1
  126. package/dist/data-grid-template.js +1 -1
  127. package/dist/data-grid.js +1 -1
  128. package/dist/date-picker.js +2 -2
  129. package/dist/date-range-picker.js +2 -2
  130. package/dist/date-time-picker.js +87 -79
  131. package/dist/date-time-picker.js.map +1 -1
  132. package/dist/draggable.js +1 -1
  133. package/dist/dropdown.js +11 -12
  134. package/dist/dropdown.js.map +1 -1
  135. package/dist/file-uploader.js +1 -1
  136. package/dist/filter-bar.js +1 -1
  137. package/dist/form-layout.js +1 -1
  138. package/dist/header-with-views.js +1 -1
  139. package/dist/header.js +1 -1
  140. package/dist/index.js +255 -256
  141. package/dist/index.js.map +1 -1
  142. package/dist/input-field-password.js +1 -1
  143. package/dist/input-field-phone-number.js +1 -1
  144. package/dist/input-field.js +1 -1
  145. package/dist/input-time.js +1 -1
  146. package/dist/internal.js +13 -13
  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/rich-text-editor.js +1 -1
  153. package/dist/search-bar.js +2 -2
  154. package/dist/secondary-nav.js +1 -1
  155. package/dist/selection-card.js +1 -1
  156. package/dist/sidepanel.js +1 -1
  157. package/dist/summary-grid.js +1 -1
  158. package/dist/timeline.js +1 -1
  159. package/dist/tutorial.js +1 -1
  160. package/dist/web-types.json +1 -1
  161. package/package.json +4 -4
  162. package/dist/assets/use-cached-selected-values.css +0 -1
  163. package/dist/chunks/alert.RD0qOLhx.js.map +0 -1
  164. package/dist/chunks/calendar.iQyNwQBL.js +0 -1207
  165. package/dist/chunks/calendar.iQyNwQBL.js.map +0 -1
  166. package/dist/chunks/country.15m_ATbO.js.map +0 -1
  167. package/dist/chunks/date-picker.DyImOUH4.js +0 -277
  168. package/dist/chunks/date-picker.DyImOUH4.js.map +0 -1
  169. package/dist/chunks/date-range-picker.BigC6wm2.js +0 -1019
  170. package/dist/chunks/date-range-picker.BigC6wm2.js.map +0 -1
  171. package/dist/chunks/dropdown.C5um1anU.js +0 -1233
  172. package/dist/chunks/dropdown.C5um1anU.js.map +0 -1
  173. package/dist/chunks/filter-bar.CzFtzztU.js.map +0 -1
  174. package/dist/chunks/summary-grid.types.9sUs0LS0.js.map +0 -1
  175. package/dist/chunks/use-cached-selected-values.DOw5IKdU.js +0 -1740
  176. package/dist/chunks/use-cached-selected-values.DOw5IKdU.js.map +0 -1
@@ -0,0 +1,1095 @@
1
+ import { defineComponent as qe, computed as m, openBlock as P, createBlock as _, unref as u, withCtx as K, createVNode as L, mergeProps as Ge, createCommentVNode as x, reactive as Te, useSlots as Ba, ref as z, onMounted as ca, createElementBlock as ye, createElementVNode as te, normalizeClass as ma, renderSlot as $e, createTextVNode as Me, toDisplayString as Da, toRaw as Pe, watch as he, useAttrs as Va, toRef as we, withDirectives as Ca, withKeys as Je, createSlots as za } from "vue";
2
+ import { b as _a } from "./index.oOAkh64h.js";
3
+ import { B as La } from "./divider.BIY84UH7.js";
4
+ import { h as Ua, B as Qa } from "./button-actions.CWmTl4cF.js";
5
+ import { B as Oe, d as He } from "./typography.B3J6_tYk.js";
6
+ import { g as oe } from "./generate-uid.DBWe4g6T.js";
7
+ import { u as xe } from "./index.B875RXHM.js";
8
+ import { j as le, k as B, s as F, l as ja, m as Ke, n as Wa, f as Xe, o as Ga, q as $a, r as Ja, t as Ze, u as Ha, b as C, v as Ka, h as Xa, i as Za, e as N, w as ea, x as aa, g as et } from "./calendar.6NKd6IMo.js";
9
+ import { u as Ne, a as at } from "./use-date-input-formatter.QXaVIBS0.js";
10
+ import { t as Re, n as tt, c as nt } from "./en-US.BR6y7foR.js";
11
+ import { u as rt } from "./use-form-layout-loading.CWbjZiwP.js";
12
+ import { B as st } from "./directive.D1-d-C2K.js";
13
+ import { u as ot } from "./form-field.D_2g7vaP.js";
14
+ import { B as lt, g as ta, D as it } from "./dropdown.C97ShfXZ.js";
15
+ import { B as ut } from "./alert.V1imvtyI.js";
16
+ import { B as dt } from "./segmented-control.D6Yvxxpc.js";
17
+ import { u as ct } from "./use-has-slot.CyMiImRQ.js";
18
+ import { u as mt } from "./use-touch-device.DTqFAbXh.js";
19
+ import { e as U, a as na } from "./differenceInMonths.yz4Dfe-b.js";
20
+ import { s as ra } from "./startOfWeek.muMEhS7U.js";
21
+ import { c as Dt } from "./constructNow.DyOJDyZZ.js";
22
+ import { a as ge, s as sa } from "./set-time-in-date.9-8WOiMT.js";
23
+ import { B as vt, i as oa } from "./input-time.CGPUOOQ9.js";
24
+ import { B as pt } from "./input-field.CvnmfrzQ.js";
25
+ import { B as ft } from "./form-layout-group.08QuvVmC.js";
26
+ import { _ as va } from "./_plugin-vue_export-helper.CHgC5LLL.js";
27
+ import { F as gt } from "./field-label.CLV3nSzz.js";
28
+ import { E as la } from "./error-message.Dyvrw6ZB.js";
29
+ import { B as yt } from "./button-actions.types.BptAXjD8.js";
30
+ import "../assets/date-range-picker.css";
31
+ function ia(s, v) {
32
+ return Re(s, v?.in).getFullYear();
33
+ }
34
+ function Ee(s, v) {
35
+ return +Re(s) == +Re(v);
36
+ }
37
+ function Mt(s, v, h) {
38
+ const [i, d] = tt(
39
+ h?.in,
40
+ s,
41
+ v
42
+ );
43
+ return +le(i) == +le(d);
44
+ }
45
+ function ua(s, v) {
46
+ const h = Re(s, v?.in);
47
+ return h.setMilliseconds(0), h;
48
+ }
49
+ function Fe(s, v) {
50
+ return +ua(s) == +ua(v);
51
+ }
52
+ function ht(s, v) {
53
+ return B(
54
+ nt(s, s),
55
+ Dt(s)
56
+ );
57
+ }
58
+ const Tt = {
59
+ name: "date-time-input"
60
+ }, da = /* @__PURE__ */ qe({
61
+ ...Tt,
62
+ props: {
63
+ dateModelValue: { default: "" },
64
+ dateProps: { default: () => ({}) },
65
+ errorMessage: { default: null },
66
+ showTimeInput: { type: Boolean, default: !1 },
67
+ timeModelValue: { default: "" },
68
+ timeProps: { default: () => ({}) }
69
+ },
70
+ emits: ["update:date-model-value", "date:keydown", "update:time-model-value", "time:error", "time:valid"],
71
+ setup(s) {
72
+ const v = s, h = m(() => ({
73
+ errorMessage: v.errorMessage,
74
+ ...v.dateProps
75
+ })), i = m(() => ({
76
+ errorMessage: v.errorMessage,
77
+ ...v.timeProps
78
+ }));
79
+ return (d, a) => (P(), _(u(ft), {
80
+ layout: d.showTimeInput ? "50-50" : "100",
81
+ "error-message": d.errorMessage
82
+ }, {
83
+ default: K(() => [
84
+ L(u(pt), Ge(h.value, {
85
+ "model-value": d.dateModelValue,
86
+ "onUpdate:modelValue": a[0] || (a[0] = (o) => d.$emit("update:date-model-value", o)),
87
+ onKeydown: a[1] || (a[1] = (o) => d.$emit("date:keydown", o))
88
+ }), null, 16, ["model-value"]),
89
+ d.showTimeInput ? (P(), _(u(vt), Ge({ key: 0 }, i.value, {
90
+ "model-value": d.timeModelValue,
91
+ "onUpdate:modelValue": a[2] || (a[2] = (o) => d.$emit("update:time-model-value", o)),
92
+ "onInput:error": a[3] || (a[3] = (o) => d.$emit("time:error")),
93
+ "onInput:valid": a[4] || (a[4] = (o) => d.$emit("time:valid"))
94
+ }), null, 16, ["model-value"])) : x("", !0)
95
+ ]),
96
+ _: 1
97
+ }, 8, ["layout", "error-message"]));
98
+ }
99
+ }), Rt = ({
100
+ firstDayOfWeek: s,
101
+ min: v,
102
+ max: h
103
+ }) => ({ getGranularCalendarLimits: (d) => {
104
+ if (!v && !h)
105
+ return { min: null, max: null };
106
+ let a = v ? F(v) : null, o = h ? U(h) : null;
107
+ if (d?.type === "weekly") {
108
+ if (d.earliest)
109
+ a = F(d.earliest);
110
+ else if (a) {
111
+ const f = ra(a, { weekStartsOn: s });
112
+ B(a, f) || (a = F(ja(Ke(a, { weekStartsOn: s }), 1)));
113
+ }
114
+ if (d.latest)
115
+ o = U(d.latest);
116
+ else if (o) {
117
+ const f = Ke(o, { weekStartsOn: s });
118
+ B(o, f) || (o = U(Wa(ra(o, { weekStartsOn: s }), 1)));
119
+ }
120
+ }
121
+ if (d?.type === "monthly") {
122
+ if (d.earliest)
123
+ a = F(d.earliest);
124
+ else if (a) {
125
+ const f = Xe(a);
126
+ B(a, f) || (a = Xe(Ga(a, 1)));
127
+ }
128
+ if (d.latest)
129
+ o = U(d.latest);
130
+ else if (o) {
131
+ const f = na(o);
132
+ B(o, f) || (o = na($a(o, 1)));
133
+ }
134
+ }
135
+ if (d?.type === "quarterly") {
136
+ if (d.earliest)
137
+ a = le(d.earliest);
138
+ else if (a) {
139
+ const f = le(a);
140
+ B(a, f) || (a = le(Ja(a, 1)));
141
+ }
142
+ if (d.latest)
143
+ o = U(d.latest);
144
+ else if (o) {
145
+ const f = Ze(o);
146
+ B(o, f) || (o = Ze(Ha(o, 1)));
147
+ }
148
+ }
149
+ return { min: a, max: o };
150
+ } }), bt = () => {
151
+ const s = Te({
152
+ daily: null,
153
+ weekly: null,
154
+ monthly: null,
155
+ quarterly: null
156
+ });
157
+ return {
158
+ savedRanges: s,
159
+ saveRange: (i, d) => {
160
+ s[i] = d;
161
+ },
162
+ resetSavedRanges: () => {
163
+ s.daily = null, s.weekly = null, s.monthly = null, s.quarterly = null;
164
+ }
165
+ };
166
+ };
167
+ var D = /* @__PURE__ */ ((s) => (s.CUSTOM_RANGE = "custom-range", s.INPUT = "input", s.ERROR = "error", s.FORM_DATE = "form-date", s.START_DATE_SELECTED = "start-date-selected", s))(D || {});
168
+ const pa = {
169
+ "de-DE": { "DD-MM-YYYY": "TT-MM-JJJJ", "MM-DD-YYYY": "MM-TT-JJJJ", "YYYY-MM-DD": "JJJJ-MM-TT", customRange: "Benutzerdefinierter Bereich", daily: "Täglich", dateFrom: "Datum von", dateTo: "Datum bis", invalidDateFormat: "Ungültiges Datumsformat", lastMonth: "Letzter Monat", lastSevenDays: "Letzte 7 Tage", lastThreeMonths: "Letzte drei Monate", maxRangeDays: "Sie können bis zu {count} Tag auswählen | Sie können bis zu {count} Tage auswählen", maxRangeMonths: "Sie können bis zu {count} Monat auswählen | Sie können bis zu {count} Monate auswählen", maxRangeQuarters: "Sie können bis zu {count} Quartal auswählen | Sie können bis zu {count} Quartale auswählen", maxRangeWeeks: "Sie können bis zu {count} Woche auswählen | Sie können bis zu {count} Wochen auswählen", monthly: "Monatlich", quarterly: "Vierteljährlich", selectedDateIsNotAvailable: "Ausgewähltes Datum ist nicht verfügbar", startDateMustPrecedeEndDate: "Das Anfangsdatum muss vor dem Enddatum liegen", timeFrom: "Zeit von", timeTo: "Zeit bis", weekly: "Wöchentlich" },
170
+ "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", invalidDateFormat: "Invalid date format", lastMonth: "Last month", lastSevenDays: "Last 7 days", lastThreeMonths: "The last three months", maxRangeDays: "You can select up to {count} day | You can select up to {count} days", maxRangeMonths: "You can select up to {count} month | You can select up to {count} months", maxRangeQuarters: "You can select up to {count} quarter | You can select up to {count} quarters", maxRangeWeeks: "You can select up to {count} week | You can select up to {count} weeks", monthly: "Monthly", quarterly: "Quarterly", selectedDateIsNotAvailable: "Selected date is not available", startDateMustPrecedeEndDate: "Start date must precede end date", timeFrom: "Time from", timeTo: "Time to", weekly: "Weekly" },
171
+ "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", invalidDateFormat: "Invalid date format", lastMonth: "Last month", lastSevenDays: "Last 7 days", lastThreeMonths: "Last three months", maxRangeDays: "You can select up to {count} day | You can select up to {count} days", maxRangeMonths: "You can select up to {count} month | You can select up to {count} months", maxRangeQuarters: "You can select up to {count} quarter | You can select up to {count} quarters", maxRangeWeeks: "You can select up to {count} week | You can select up to {count} weeks", monthly: "Monthly", quarterly: "Quarterly", selectedDateIsNotAvailable: "Selected date is not available", startDateMustPrecedeEndDate: "Start date must precede end date", timeFrom: "Time from", timeTo: "Time to", weekly: "Weekly" },
172
+ "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", invalidDateFormat: "Formato de fecha no válido", lastMonth: "El mes pasado", lastSevenDays: "Últimos 7 días", lastThreeMonths: "Últimos tres meses", maxRangeDays: "Puedes seleccionar hasta {count} día | Puedes seleccionar hasta {count} días", maxRangeMonths: "Puedes seleccionar hasta {count} mes | Puedes seleccionar hasta {count} meses", maxRangeQuarters: "Puedes seleccionar hasta {count} trimestre | Puedes seleccionar hasta {count} trimestres", maxRangeWeeks: "Puedes seleccionar hasta {count} semana | Puedes seleccionar hasta {count} semanas", monthly: "Mensualmente", quarterly: "Trimestral", selectedDateIsNotAvailable: "La fecha seleccionada no está disponible", startDateMustPrecedeEndDate: "La fecha de inicio debe ser anterior a la fecha de finalización", timeFrom: "Hora desde", timeTo: "Hora hasta", weekly: "Semanal" },
173
+ "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", invalidDateFormat: "Formato de fecha no válido", lastMonth: "El mes pasado", lastSevenDays: "Últimos 7 días", lastThreeMonths: "Últimos tres meses", maxRangeDays: "Puedes seleccionar hasta {count} día | Puedes seleccionar hasta {count} días", maxRangeMonths: "Puedes seleccionar hasta {count} mes | Puedes seleccionar hasta {count} meses", maxRangeQuarters: "Puedes seleccionar hasta {count} trimestre | Puedes seleccionar hasta {count} trimestres", maxRangeWeeks: "Puedes seleccionar hasta {count} semana | Puedes seleccionar hasta {count} semanas", monthly: "Mensual", quarterly: "Trimestral", selectedDateIsNotAvailable: "La fecha seleccionada no está disponible", startDateMustPrecedeEndDate: "La fecha de inicio debe ser anterior a la fecha de finalización", timeFrom: "Tiempo desde", timeTo: "Es hora de", weekly: "Semanal" },
174
+ "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", invalidDateFormat: "Format de date non valide", lastMonth: "Le mois dernier", lastSevenDays: "7 derniers jours", lastThreeMonths: "Trois derniers mois", maxRangeDays: "Vous pouvez sélectionner jusqu'à {count} jour| Vous pouvez sélectionner jusqu'à {count} jours", maxRangeMonths: "Vous pouvez sélectionner jusqu'à {count} mois | Vous pouvez sélectionner jusqu'à {count} mois", maxRangeQuarters: "Vous pouvez sélectionner jusqu'à {count} trimestre | Vous pouvez sélectionner jusqu'à {count} trimestres", maxRangeWeeks: "Vous pouvez sélectionner jusqu'à {count} semaine | Vous pouvez sélectionner jusqu'à {count} semaines", monthly: "Mensuel", quarterly: "Trimestriel", selectedDateIsNotAvailable: "La date sélectionnée n’est pas disponible", startDateMustPrecedeEndDate: "La date de début doit précéder la date de fin", timeFrom: "Heure de début", timeTo: "Heure de fin", weekly: "Hebdomadaire" },
175
+ "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", invalidDateFormat: "Formato data non valido", lastMonth: "Il mese scorso", lastSevenDays: "Ultimi 7 giorni", lastThreeMonths: "Gli ultimi tre mesi", maxRangeDays: "Puoi selezionare fino a {count} giorno | Puoi selezionare fino a {count} giorni", maxRangeMonths: "Puoi selezionare fino a {count} mese | Puoi selezionare fino a {count} mesi", maxRangeQuarters: "Puoi selezionare fino a {count} trimestre | Puoi selezionare fino a {count} trimestri", maxRangeWeeks: "Puoi selezionare fino a {count} settimana | Puoi selezionare fino a {count} settimane", monthly: "Mensile", quarterly: "Trimestrale", selectedDateIsNotAvailable: "La data selezionata non è disponibile", startDateMustPrecedeEndDate: "La data di inizio deve precedere la data di fine", timeFrom: "Tempo dal", timeTo: "Tempo fino al", weekly: "Settimanale" },
176
+ "ja-JP": { "DD-MM-YYYY": "DD-MM-YYYY", "MM-DD-YYYY": "MM-DD-YYYY", "YYYY-MM-DD": "YYYY-MM-DD", customRange: "カスタム範囲", daily: "毎日", dateFrom: "開始日", dateTo: "終了日", invalidDateFormat: "無効な日付形式", lastMonth: "先月", lastSevenDays: "過去 7 日間", lastThreeMonths: "過去3か月", maxRangeDays: "{count}日間まで選択できます | {count}日間まで選択できます", maxRangeMonths: "{count}か月まで選択できます | {count}か月まで選択できます", maxRangeQuarters: "{count}四半期まで選択できます | {count}四半期まで選択できます", maxRangeWeeks: "{count}週間まで選択できます | {count}週間まで選択できます", monthly: "毎月", quarterly: "四半期ごと", selectedDateIsNotAvailable: "選択した日付は利用できません", startDateMustPrecedeEndDate: "開始日は終了日より前にする必要があります", timeFrom: "開始時刻", timeTo: "終了時刻", weekly: "毎週" },
177
+ "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é", invalidDateFormat: "Formato de data inválido", lastMonth: "Último mês", lastSevenDays: "Últimos 7 dias", lastThreeMonths: "Últimos 3 meses", maxRangeDays: "Você pode selecionar até {count} dia | Você pode selecionar até {count} dias", maxRangeMonths: "Você pode selecionar até {count} mês | Você pode selecionar até {count} meses", maxRangeQuarters: "Você pode selecionar até {count} trimestre | Você pode selecionar até {count} trimestres", maxRangeWeeks: "Você pode selecionar até {count} semana | Você pode selecionar até {count} semanas", monthly: "Mensal", quarterly: "Trimestral", selectedDateIsNotAvailable: "A data selecionada não está disponível", startDateMustPrecedeEndDate: "A data de início deve preceder a data de término", timeFrom: "Horário a partir de", timeTo: "Horário até", weekly: "Semanal" },
178
+ "zh-CN": { "DD-MM-YYYY": "日-月-年", "MM-DD-YYYY": "月-日-年", "YYYY-MM-DD": "年-月-日", customRange: "自定义范围", daily: "每日", dateFrom: "日期自", dateTo: "日期至", invalidDateFormat: "日期格式无效", lastMonth: "上个月", lastSevenDays: "最近 7 天", lastThreeMonths: "过去三个月", maxRangeDays: "您可以选择最多 {count} 天 | 您可以选择最多 {count} 天", maxRangeMonths: "您可以选择最多 {count} 个月 | 您可以选择最多 {count} 个月", maxRangeQuarters: "您最多可以选择 {count} 个季度 | 您最多可以选择 {count} 个季度", maxRangeWeeks: "您最多可以选择 {count} 周 | 您最多可以选择 {count} 周", monthly: "每月", quarterly: "每季度", selectedDateIsNotAvailable: "所选日期不可用", startDateMustPrecedeEndDate: "开始日期必须早于结束日期", timeFrom: "时间自", timeTo: "是时候", weekly: "每周" }
179
+ }, Yt = { class: "b-date-range-picker-calendar" }, kt = { class: "b-date-range-picker-calendar__form" }, At = { key: 0 }, It = {
180
+ key: 0,
181
+ class: "b-date-range-picker-calendar__calendars-container",
182
+ "data-testid": "date-range-picker-calendar-calendar-container"
183
+ }, St = {
184
+ name: "date-range-picker-calendar",
185
+ i18n: { messages: pa }
186
+ }, wt = /* @__PURE__ */ qe({
187
+ ...St,
188
+ props: {
189
+ /**
190
+ * Allows user to enter time values in the form
191
+ */
192
+ allowTimeInput: { type: Boolean, default: !1 },
193
+ /**
194
+ * Ranges form persistance data
195
+ */
196
+ dateFormData: {
197
+ type: Object,
198
+ default: () => ({ startDate: void 0, endDate: void 0, startTime: void 0, endTime: void 0 })
199
+ },
200
+ /**
201
+ * Allows you to set the first day of the week. 0 is sunday, 1 is monday, 6 is saturday
202
+ */
203
+ firstDayOfWeek: C.props.firstDayOfWeek,
204
+ /**
205
+ * A list of available granularities.
206
+ * If present, the date picker will display a segmented control to change granularity.
207
+ */
208
+ granularities: {
209
+ type: Array,
210
+ default: null
211
+ },
212
+ /**
213
+ * Indicate if a date should be disabled or not
214
+ */
215
+ isDateDisabled: C.props.isDateDisabled,
216
+ /**
217
+ * Set a maximum number of dates to be selectable by the range.
218
+ */
219
+ maxRange: C.props.maxRange,
220
+ /**
221
+ * Sets a minimum limit for selectable dates - dates before `min` will not be selectable
222
+ */
223
+ min: C.props.min,
224
+ /**
225
+ * Sets a maximum limit for selectable dates - dates after `max` will not be selectable
226
+ */
227
+ max: C.props.max,
228
+ /**
229
+ * Number of months rendered on pane
230
+ */
231
+ numberOfMonths: {
232
+ type: C.props.numberOfMonths.type,
233
+ default: C.props.numberOfMonths.default,
234
+ validator: (s) => s >= 0
235
+ },
236
+ /**
237
+ * Displays the end date's month when the calendar is opened. Defaults to false i.e. the start date's month is displayed.
238
+ */
239
+ showEndDateOnOpen: { type: Boolean, default: !1 },
240
+ /**
241
+ * Enables the custom range selector.
242
+ * If provided, must be an array that sets the custom range dropdown items. Items are of the structure:
243
+ * `label` - label of custom range item.
244
+ * `value` - a unique key of the custom range item.
245
+ * `data` - an object `{ startDate: Date; endDate: Date }` to set the date picker range to upon selecting.
246
+ */
247
+ quickSelectRanges: {
248
+ type: Array,
249
+ default: void 0
250
+ },
251
+ /**
252
+ * Selected date
253
+ */
254
+ value: { type: Object, default: void 0 },
255
+ /**
256
+ * The type of calendar to display. Defaults to showing days.
257
+ */
258
+ variant: C.props.variant,
259
+ /**
260
+ * Range of years to be selectable from the year dropdown
261
+ */
262
+ yearRange: C.props.yearRange
263
+ },
264
+ emits: [
265
+ D.CUSTOM_RANGE,
266
+ D.INPUT,
267
+ D.ERROR,
268
+ D.FORM_DATE,
269
+ D.START_DATE_SELECTED
270
+ ],
271
+ setup(s, { emit: v }) {
272
+ const i = "customRange", d = {
273
+ daily: "maxRangeDays",
274
+ weekly: "maxRangeWeeks",
275
+ monthly: "maxRangeMonths",
276
+ quarterly: "maxRangeQuarters"
277
+ }, a = s, o = v, f = Ba(), W = ct(f), { t: T, tc: I } = xe({ messages: pa }), { isTouchDevice: S } = mt(), {
278
+ dateFormat: ne,
279
+ isFormatValid: Y,
280
+ parseDate: b,
281
+ onKeyDown: Q,
282
+ autoFormat: G,
283
+ formatDate: re
284
+ } = Ne(), k = z({}), X = m(() => a.variant === "month" ? "monthly" : "daily"), O = m(() => a.numberOfMonths === 0), t = Te({
285
+ startDate: a.value?.startDate,
286
+ endDate: a.value?.endDate,
287
+ range: a.value?.range,
288
+ ...a.granularities ? {
289
+ granularity: a.value?.granularity || X.value
290
+ } : {}
291
+ }), q = m(() => (
292
+ // eslint-disable-next-line consistent-return
293
+ a?.quickSelectRanges?.find(({ value: e, data: n }) => {
294
+ if (!n.endDate) {
295
+ if (n.isRelativeToNow) {
296
+ const c = k.value?.[e];
297
+ return c ? Ee(c.startDate, t.startDate) && Ee(c.endDate, t.endDate) : (
298
+ // If not stored calculated dates, fall back to comparing the quick select item's value
299
+ // with the internal range's stored range identifier.
300
+ e === t.range
301
+ );
302
+ }
303
+ return Ee(n.startDate, t.startDate) && ht(t.endDate) && (!a.allowTimeInput || Fe(t.endDate, U(t.endDate))) && (a.granularities ? n.granularity === t.granularity : !0);
304
+ }
305
+ if (a.allowTimeInput)
306
+ return Fe(n.startDate, t.startDate) && Fe(n.endDate, t.endDate) && (a.granularities ? n.granularity === t.granularity : !0);
307
+ if (n.endDate)
308
+ return B(n.startDate, t.startDate) && B(n.endDate, t.endDate) && (a.granularities ? n.granularity === t.granularity : !0);
309
+ })?.value ?? i
310
+ )), ie = m(() => [
311
+ { label: T("customRange"), value: i },
312
+ ...a.quickSelectRanges ? a.quickSelectRanges : []
313
+ ]), j = m(
314
+ () => a.granularities?.find(({ type: e }) => e === t.granularity) || null
315
+ ), be = m(
316
+ () => a.granularities?.map(({ type: e, disabled: n }) => ({
317
+ label: T(e),
318
+ value: e,
319
+ disabled: n
320
+ })) ?? []
321
+ ), { getGranularCalendarLimits: Ye } = Rt(a), g = m(
322
+ () => a.granularities ? Ye(j.value) : { min: a.min ? F(a.min) : null, max: a.max ? U(a.max) : null }
323
+ ), {
324
+ adjustDateForQuarterly: se,
325
+ adjustDateForMonthly: R,
326
+ adjustDateForWeekly: ke,
327
+ adjustStartDateInputForWeekly: H,
328
+ adjustEndDateInputForWeekly: Ae,
329
+ adjustStartDateInputForMonthly: ue,
330
+ adjustEndDateInputForMonthly: de,
331
+ adjustStartDateInputForQuarterly: $,
332
+ adjustEndDateInputForQuarterly: Z
333
+ } = Ka(a.firstDayOfWeek), { savedRanges: J, saveRange: Ie, resetSavedRanges: ce } = bt(), w = (e) => e ? re(e) : "", y = z(null), M = z(null), me = m(() => y.value ? T(y.value) : null), De = m(() => M.value ? T(M.value) : null), ve = m(
334
+ () => y.value === "invalidDateFormat" ? null : me.value
335
+ ), l = m(() => M.value === "invalidDateFormat" ? null : De.value), A = (e, n, c, p) => {
336
+ if (!e || !Y(e))
337
+ return "invalidDateFormat";
338
+ const E = b(e), fe = F(E);
339
+ if (a.min && fe < F(a.min) || a.max && fe > F(a.max) || a.isDateDisabled && a.isDateDisabled(fe))
340
+ return "selectedDateIsNotAvailable";
341
+ if (n) {
342
+ const je = p ? ge(p, 0).getTime() : fe.getTime(), We = p ? ge(n, 0).getTime() : F(n).getTime();
343
+ if (c === "start" ? je >= We : je <= We)
344
+ return "startDateMustPrecedeEndDate";
345
+ }
346
+ return null;
347
+ }, r = Te({
348
+ startDate: a.dateFormData.startDate,
349
+ endDate: a.dateFormData.endDate,
350
+ startTime: a.dateFormData.startTime,
351
+ endTime: a.dateFormData.endTime
352
+ }), Ve = (e, n) => {
353
+ const c = () => {
354
+ if (n && ae(n)) {
355
+ const p = sa(b(n), e);
356
+ if (a.min && p < ge(a.min, 0) || a.max && p > ge(a.max, 0))
357
+ return !1;
358
+ }
359
+ return !0;
360
+ };
361
+ return oa(e) && c();
362
+ }, ee = m(() => a.variant === "month"), Ce = (e) => e ? ee.value ? Xa(e) : Za(e) : "", fa = m(() => Ce(t.startDate)), ga = m(() => Ce(t.endDate)), ze = m(() => S.value ? ee.value ? "month" : "date" : "text"), ya = m(() => S.value ? fa.value : r.startDate), Ma = m(() => S.value ? ga.value : r.endDate), V = (e, n) => !n || !oa(n) || a.variant === "month" ? e : sa(new Date(e), n), ha = (e) => {
363
+ r.startTime = N(
364
+ a.min && a.allowTimeInput && B(a.min, e.startDate) ? a.min : F(e.startDate)
365
+ ), r.endTime = N(
366
+ a.max && a.allowTimeInput && B(a.max, e.endDate) ? a.max : U(e.endDate)
367
+ ), t.startDate = V(e.startDate, r.startTime), t.endDate = V(e.endDate, r.endTime), t.range = null, a.granularities && ce(), o(D.INPUT, {
368
+ ...t,
369
+ range: q.value
370
+ });
371
+ }, ae = (e) => !!e && !A(e);
372
+ ca(() => {
373
+ y.value = a.dateFormData.startDate ? A(a.dateFormData.startDate) : null, M.value = a.dateFormData.endDate ? A(a.dateFormData.endDate) : null;
374
+ });
375
+ const Ta = (e) => {
376
+ r.startDate = w(e), r.startTime || (r.startTime = N(e)), y.value = null, M.value === "startDateMustPrecedeEndDate" && (M.value = null), o(D.START_DATE_SELECTED, e);
377
+ }, Ra = (e) => {
378
+ r.endDate = w(e), r.endTime || (r.endTime = N(U(e))), M.value = null, y.value === "startDateMustPrecedeEndDate" && (y.value = null);
379
+ }, Se = (e) => {
380
+ const n = a.value[e];
381
+ if (n)
382
+ return n;
383
+ if (a.dateFormData[e] && ae(a.dateFormData[e]))
384
+ return b(a.dateFormData[e]);
385
+ }, _e = (e) => {
386
+ if (ae(e)) {
387
+ let n = e;
388
+ switch (y.value = null, j.value?.type) {
389
+ case "weekly":
390
+ n = H(
391
+ e,
392
+ w,
393
+ g.value.min,
394
+ g.value.max
395
+ ), r.startDate = n;
396
+ break;
397
+ case "monthly":
398
+ n = ue(
399
+ e,
400
+ w,
401
+ g.value.min,
402
+ g.value.max
403
+ ), r.startDate = n;
404
+ break;
405
+ case "quarterly":
406
+ n = $(
407
+ e,
408
+ w,
409
+ g.value.min,
410
+ g.value.max
411
+ ), r.startDate = n;
412
+ break;
413
+ }
414
+ const c = F(b(n));
415
+ t.startDate = V(c, r.startTime), ae(r.endDate) && (t.endDate = V(
416
+ F(b(r.endDate)),
417
+ r.endTime
418
+ ));
419
+ const p = Se("endDate"), E = A(
420
+ n,
421
+ a.allowTimeInput ? t.endDate : p,
422
+ "start",
423
+ a.allowTimeInput ? t.startDate : void 0
424
+ );
425
+ if (E) {
426
+ y.value = E, o(D.ERROR, { ...r });
427
+ return;
428
+ }
429
+ M.value === "startDateMustPrecedeEndDate" && (M.value = null), t.range = null, o(D.FORM_DATE, {
430
+ startDate: c,
431
+ endDate: p
432
+ }), o(D.INPUT, {
433
+ ...t,
434
+ range: q.value
435
+ });
436
+ } else
437
+ y.value = A(e), o(D.ERROR, { ...r });
438
+ }, ba = ta(_e, 300), Ya = (e) => {
439
+ if (r.startDate = S.value && ee.value ? e : G(e), S.value)
440
+ if (ee.value && e) {
441
+ const n = ea(e);
442
+ t.startDate = V(n, r.startTime), t.range = null, o(D.INPUT, {
443
+ ...t,
444
+ range: q.value
445
+ });
446
+ } else r.startDate ? _e(r.startDate) : y.value = null;
447
+ else
448
+ ba(r.startDate);
449
+ }, Le = (e) => {
450
+ if (ae(e)) {
451
+ let n = e;
452
+ switch (M.value = null, j.value?.type) {
453
+ case "weekly":
454
+ n = Ae(
455
+ e,
456
+ w,
457
+ g.value.min,
458
+ g.value.max
459
+ ), r.endDate = n;
460
+ break;
461
+ case "monthly":
462
+ n = de(
463
+ e,
464
+ w,
465
+ g.value.min,
466
+ g.value.max
467
+ ), r.endDate = n;
468
+ break;
469
+ case "quarterly":
470
+ n = Z(
471
+ e,
472
+ w,
473
+ g.value.min,
474
+ g.value.max
475
+ ), r.endDate = n;
476
+ break;
477
+ }
478
+ const c = F(b(n));
479
+ t.endDate = V(c, r.endTime), ae(r.startDate) && (t.startDate = V(
480
+ F(b(r.startDate)),
481
+ r.startTime
482
+ ));
483
+ const p = Se("startDate"), E = A(
484
+ n,
485
+ a.allowTimeInput ? t.startDate : p,
486
+ "end",
487
+ a.allowTimeInput ? t.endDate : void 0
488
+ );
489
+ if (E) {
490
+ M.value = E, o(D.ERROR, { ...r });
491
+ return;
492
+ }
493
+ y.value === "startDateMustPrecedeEndDate" && (y.value = null), t.range = null, o(D.FORM_DATE, {
494
+ startDate: p,
495
+ endDate: c
496
+ }), o(D.INPUT, {
497
+ ...t,
498
+ range: q.value
499
+ });
500
+ } else
501
+ M.value = A(e), o(D.ERROR, { ...r });
502
+ }, ka = ta(Le, 300), Aa = (e) => {
503
+ if (r.endDate = S.value && ee.value ? e : G(e), S.value)
504
+ if (ee.value && e) {
505
+ const n = ea(e);
506
+ t.endDate = V(n, r.endTime), t.range = null, o(D.INPUT, {
507
+ ...t,
508
+ range: q.value
509
+ });
510
+ } else r.endDate ? Le(r.endDate) : M.value = null;
511
+ else
512
+ ka(r.endDate);
513
+ }, Ue = (e) => {
514
+ Q(e);
515
+ }, Ia = () => {
516
+ o(D.ERROR, { ...r });
517
+ }, Sa = () => {
518
+ const e = r.startTime;
519
+ if (!Ve(e, r.startDate)) {
520
+ o(D.ERROR, { ...r });
521
+ return;
522
+ }
523
+ if (t.startDate = V(t.startDate, e), r.startDate && t.endDate) {
524
+ const c = A(
525
+ r.startDate,
526
+ t.endDate,
527
+ "start",
528
+ t.startDate
529
+ );
530
+ if (c) {
531
+ y.value = c, o(D.ERROR, { ...r });
532
+ return;
533
+ }
534
+ }
535
+ y.value = null, M.value === "startDateMustPrecedeEndDate" && (M.value = null);
536
+ const n = Se("endDate");
537
+ o(D.FORM_DATE, {
538
+ startDate: t.startDate,
539
+ endDate: n,
540
+ startTime: e,
541
+ endTime: r.endTime ?? a.dateFormData.endTime
542
+ }), o(D.INPUT, {
543
+ ...t,
544
+ range: q.value
545
+ });
546
+ }, wa = () => {
547
+ o(D.ERROR, { ...r });
548
+ }, Ea = () => {
549
+ const e = r.endTime;
550
+ if (!Ve(e, r.endDate)) {
551
+ o(D.ERROR, { ...r });
552
+ return;
553
+ }
554
+ if (t.endDate = V(t.endDate, e), r.endDate && t.startDate) {
555
+ const n = A(
556
+ r.endDate,
557
+ t.startDate,
558
+ "end",
559
+ t.endDate
560
+ );
561
+ if (n) {
562
+ M.value = n, o(D.ERROR, { ...r });
563
+ return;
564
+ }
565
+ }
566
+ M.value = null, y.value === "startDateMustPrecedeEndDate" && (y.value = null), o(D.FORM_DATE, {
567
+ startDate: t.startDate,
568
+ endDate: t.endDate,
569
+ startTime: r.startTime ?? a.dateFormData.startTime,
570
+ endTime: e
571
+ }), o(D.INPUT, {
572
+ ...t,
573
+ range: q.value
574
+ });
575
+ }, Fa = (e) => {
576
+ r.startTime = e;
577
+ }, Pa = (e) => {
578
+ r.endTime = e;
579
+ }, pe = (e, n, c, p) => {
580
+ t.startDate = e, t.endDate = n, c && (t.granularity = c), p && (t.range = p);
581
+ }, Oa = (e) => {
582
+ const n = a.quickSelectRanges?.find(({ value: c }) => c === e);
583
+ if (n) {
584
+ ce();
585
+ const c = n.data, p = c.endDate || (c.isRelativeToNow ? new Date(Date.now()) : U(new Date(Date.now()))), E = c.isRelativeToNow && c.timeDifference ? new Date(p.getTime() - c.timeDifference) : c.startDate;
586
+ r.endDate = w(p), r.startDate = w(E), pe(E, p, null, e), a.granularities && (t.granularity = c.granularity || X.value), r.startTime = N(E), r.endTime = N(p), t.startDate = E, t.endDate = p, c.isRelativeToNow && (k.value = {
587
+ ...k.value,
588
+ [e]: {
589
+ startDate: E,
590
+ endDate: p
591
+ }
592
+ }), o(D.CUSTOM_RANGE, {
593
+ ...n.data,
594
+ startDate: E,
595
+ endDate: p,
596
+ range: n.value
597
+ });
598
+ }
599
+ }, qa = {
600
+ weekly: ke,
601
+ monthly: R,
602
+ quarterly: se
603
+ }, xa = (e) => {
604
+ const n = t.granularity;
605
+ if (t.granularity = e, n && Ie(n, structuredClone(Pe(t))), t.startDate && t.endDate) {
606
+ switch (e) {
607
+ case "quarterly":
608
+ case "monthly":
609
+ case "weekly": {
610
+ if (J[e]) {
611
+ pe(J[e].startDate, J[e].endDate, e);
612
+ break;
613
+ }
614
+ const { startDate: c, endDate: p } = qa[e](
615
+ t.startDate,
616
+ t.endDate,
617
+ g.value.min,
618
+ g.value.max
619
+ );
620
+ pe(c, p, e);
621
+ break;
622
+ }
623
+ case "daily":
624
+ J.daily && pe(J.daily.startDate, J.daily.endDate, e);
625
+ break;
626
+ }
627
+ r.startDate = w(t.startDate), r.endDate = w(t.endDate), o(D.INPUT, {
628
+ ...t,
629
+ range: q.value
630
+ });
631
+ }
632
+ }, Na = m(() => ({
633
+ "b-date-range-picker-calendar__form-container--no-calendars": O.value
634
+ })), Qe = m(() => {
635
+ const e = j.value, n = e?.maxRange || a.maxRange;
636
+ if (!n)
637
+ return null;
638
+ const c = d[e?.type ?? "daily"];
639
+ return I(c, n, { count: n });
640
+ });
641
+ return (e, n) => (P(), ye("div", Yt, [
642
+ te("div", {
643
+ class: ma(["b-date-range-picker-calendar__form-container", Na.value]),
644
+ "data-testid": "date-range-picker-calendar-form-container"
645
+ }, [
646
+ te("div", kt, [
647
+ u(W)("title") ? $e(e.$slots, "title", { key: 0 }, void 0, !0) : x("", !0),
648
+ s.quickSelectRanges ? (P(), _(lt, {
649
+ key: 1,
650
+ "aria-label": u(T)("customRange"),
651
+ items: ie.value,
652
+ "model-value": q.value,
653
+ "onUpdate:modelValue": Oa
654
+ }, null, 8, ["aria-label", "items", "model-value"])) : x("", !0),
655
+ s.granularities ? (P(), _(u(dt), {
656
+ key: 2,
657
+ items: be.value,
658
+ "model-value": t.granularity,
659
+ "full-width": "",
660
+ "onUpdate:modelValue": xa
661
+ }, null, 8, ["items", "model-value"])) : x("", !0),
662
+ Qe.value ? (P(), _(u(ut), {
663
+ key: 3,
664
+ variant: "tip"
665
+ }, {
666
+ description: K(() => [
667
+ Me(Da(Qe.value), 1)
668
+ ]),
669
+ _: 1
670
+ })) : x("", !0),
671
+ te("div", null, [
672
+ L(u(Oe), {
673
+ stronger: "",
674
+ el: "span",
675
+ class: "b-date-range-picker-calendar__label"
676
+ }, {
677
+ default: K(() => n[0] || (n[0] = [
678
+ Me(" From ")
679
+ ])),
680
+ _: 1
681
+ }),
682
+ L(u(da), {
683
+ "date-model-value": ya.value,
684
+ "date-props": {
685
+ ariaLabel: u(T)("dateFrom"),
686
+ type: ze.value,
687
+ description: u(S) ? void 0 : u(T)(u(ne)),
688
+ errorMessage: me.value
689
+ },
690
+ "error-message": ve.value,
691
+ "show-time-input": s.allowTimeInput,
692
+ "time-model-value": r.startTime,
693
+ "time-props": {
694
+ ariaLabel: u(T)("timeFrom"),
695
+ errorMessage: ve.value
696
+ },
697
+ class: "b-date-range-picker-calendar__form-input",
698
+ "onUpdate:dateModelValue": Ya,
699
+ "onDate:keydown": Ue,
700
+ "onUpdate:timeModelValue": Fa,
701
+ "onTime:error": Ia,
702
+ "onTime:valid": Sa
703
+ }, null, 8, ["date-model-value", "date-props", "error-message", "show-time-input", "time-model-value", "time-props"])
704
+ ]),
705
+ te("div", null, [
706
+ L(u(Oe), {
707
+ stronger: "",
708
+ el: "span",
709
+ class: "b-date-range-picker-calendar__label"
710
+ }, {
711
+ default: K(() => n[1] || (n[1] = [
712
+ Me(" To ")
713
+ ])),
714
+ _: 1
715
+ }),
716
+ L(u(da), {
717
+ "date-model-value": Ma.value,
718
+ "date-props": {
719
+ ariaLabel: u(T)("dateTo"),
720
+ type: ze.value,
721
+ description: u(S) ? void 0 : u(T)(u(ne)),
722
+ errorMessage: De.value
723
+ },
724
+ "error-message": l.value,
725
+ "show-time-input": s.allowTimeInput,
726
+ "time-model-value": r.endTime,
727
+ "time-props": {
728
+ ariaLabel: u(T)("timeTo"),
729
+ errorMessage: l.value
730
+ },
731
+ class: "b-date-range-picker-calendar__form-input",
732
+ "onUpdate:dateModelValue": Aa,
733
+ "onDate:keydown": Ue,
734
+ "onUpdate:timeModelValue": Pa,
735
+ "onTime:error": wa,
736
+ "onTime:valid": Ea
737
+ }, null, 8, ["date-model-value", "date-props", "error-message", "show-time-input", "time-model-value", "time-props"])
738
+ ])
739
+ ]),
740
+ u(W)("actions") ? (P(), ye("div", At, [
741
+ $e(e.$slots, "actions", {}, void 0, !0)
742
+ ])) : x("", !0)
743
+ ], 2),
744
+ !O.value && !u(S) ? (P(), ye("div", It, [
745
+ L(u(C), {
746
+ value: t,
747
+ "first-day-of-week": s.firstDayOfWeek,
748
+ "is-date-disabled": s.isDateDisabled,
749
+ "max-range": s.maxRange,
750
+ min: g.value.min,
751
+ max: g.value.max,
752
+ "number-of-months": s.numberOfMonths,
753
+ "show-end-date-on-open": s.showEndDateOnOpen,
754
+ granularity: j.value,
755
+ variant: s.variant,
756
+ "year-range": s.yearRange,
757
+ "is-range": "",
758
+ onInput: ha,
759
+ onStartDateSelected: Ta,
760
+ onEndDateSelected: Ra
761
+ }, null, 8, ["value", "first-day-of-week", "is-date-disabled", "max-range", "min", "max", "number-of-months", "show-end-date-on-open", "granularity", "variant", "year-range"])
762
+ ])) : x("", !0)
763
+ ]));
764
+ }
765
+ }), Et = /* @__PURE__ */ va(wt, [["__scopeId", "data-v-2d48538b"]]), Be = {
766
+ "de-DE": { apply: "Anwenden", cancel: "Abbrechen", dateRangePicker: "Datumsbereichauswahl {name}", invalidDateFormat: "Ungültiges Datumsformat", 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" },
767
+ "en-GB": { apply: "Apply", cancel: "Cancel", dateRangePicker: "Date range picker {name}", invalidDateFormat: "Invalid date format", quarter: "Q{quarter} {year}", selectDate: "Select a date", selectDateRange: "Select a date range", selectedDateIsNotAvailable: "Selected date is not available" },
768
+ "en-US": { apply: "Apply", cancel: "Cancel", dateRangePicker: "Date range picker {name}", invalidDateFormat: "Invalid date format", quarter: "Q{quarter} {year}", selectDate: "Select a date", selectDateRange: "Select a date range", selectedDateIsNotAvailable: "Selected date is not available" },
769
+ "es-ES": { apply: "Aplicar", cancel: "Cancelar", dateRangePicker: "Selector de intervalos de fechas {name}", invalidDateFormat: "Formato de fecha no válido", quarter: "T{quarter} {year}", selectDate: "Selecciona una fecha", selectDateRange: "Selecciona un rango de fechas", selectedDateIsNotAvailable: "La fecha seleccionada no está disponible" },
770
+ "es-MX": { apply: "Aplicar", cancel: "Cancelar", dateRangePicker: "Selector de intervalos de fechas {name}", invalidDateFormat: "Formato de fecha no válido", quarter: "T{quarter} {year}", selectDate: "Selecciona una fecha", selectDateRange: "Selecciona un rango de fechas", selectedDateIsNotAvailable: "La fecha seleccionada no está disponible" },
771
+ "fr-FR": { apply: "Appliquer", cancel: "Annuler", dateRangePicker: "Sélecteur de plages de dates {name}", invalidDateFormat: "Format de date non valide", 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" },
772
+ "it-IT": { apply: "Applica", cancel: "Annulla", dateRangePicker: "Selettore intervallo di date {name}", invalidDateFormat: "Formato data non valido", quarter: "Q{quarter} {year}", selectDate: "Seleziona una data", selectDateRange: "Seleziona un intervallo di date", selectedDateIsNotAvailable: "La data selezionata non è disponibile" },
773
+ "ja-JP": { apply: "適用", cancel: "キャンセル", dateRangePicker: "日付範囲ピッカー {name}", invalidDateFormat: "無効な日付形式", quarter: "{year}年第{quarter}四半期", selectDate: "日付を選択", selectDateRange: "日付範囲を選択", selectedDateIsNotAvailable: "選択した日付は利用できません" },
774
+ "pt-BR": { apply: "Aplicar", cancel: "Cancelar", dateRangePicker: "Seletor de intervalo de datas {name}", invalidDateFormat: "Formato de data inválido", quarter: "{quarter}º trimestre de {year}", selectDate: "Selecione uma data", selectDateRange: "Selecione um intervalo de datas", selectedDateIsNotAvailable: "A data selecionada não está disponível" },
775
+ "zh-CN": { apply: "应用", cancel: "取消", dateRangePicker: "日期范围选择器 {name}", invalidDateFormat: "日期格式无效", quarter: "{year} {quarter} 季度", selectDate: "选择日期", selectDateRange: "选择日期范围", selectedDateIsNotAvailable: "所选日期不可用" }
776
+ }, Ft = ({
777
+ datePickerValue: s,
778
+ isDateIncorrect: v,
779
+ quickSelectRanges: h,
780
+ isMonthVariant: i,
781
+ withTimeInput: d,
782
+ placeholder: a
783
+ }) => {
784
+ const { locale: o, t: f } = xe({ messages: Be }), { dateToInputDateString: W } = Ne(), T = (Y) => !!Y && !isNaN(Y.getTime()), I = Te({
785
+ startDate: null,
786
+ endDate: null,
787
+ startTime: null,
788
+ endTime: null
789
+ });
790
+ return he(
791
+ s,
792
+ (Y) => {
793
+ I.startDate = W(Y?.startDate), I.endDate = W(Y?.endDate), I.startTime = N(Y?.startDate), I.endTime = N(Y?.endDate);
794
+ },
795
+ { immediate: !0 }
796
+ ), {
797
+ // Values
798
+ dateDisplayValue: m(() => {
799
+ if (v.value)
800
+ return `${I.startDate || ""} - ${I.endDate || ""}`;
801
+ if (!s.value || !s.value.startDate && !s.value.endDate)
802
+ return a?.value || f("selectDateRange");
803
+ if (h.value?.length) {
804
+ const b = h.value.find(({ value: Q }) => Q === s.value?.range);
805
+ if (b)
806
+ return b.label;
807
+ }
808
+ if (s.value.granularity === "quarterly") {
809
+ const { startDate: b, endDate: Q } = s.value, G = f("quarter", { quarter: aa(b), year: ia(b) });
810
+ if (Mt(b, Q))
811
+ return G;
812
+ const re = f("quarter", { quarter: aa(Q), year: ia(Q) });
813
+ return `${G} - ${re}`;
814
+ }
815
+ if (!T(s.value.startDate) || !T(s.value.endDate))
816
+ return `${I.startDate || ""} - ${I.endDate || ""}`;
817
+ let Y = i?.value ? { month: "long", year: "numeric" } : { month: "short", day: "2-digit", year: "numeric" };
818
+ return d.value && (Y = {
819
+ ...Y,
820
+ hour: "numeric",
821
+ minute: "numeric",
822
+ second: "numeric",
823
+ hour12: !1
824
+ }), et(o.value, Y).formatRange(
825
+ s.value.startDate,
826
+ s.value.endDate
827
+ );
828
+ }),
829
+ textInputDisplayValue: I,
830
+ // Methods
831
+ formatTextInputDisplayValue: () => ""
832
+ };
833
+ }, Pt = { class: "b-date-range-picker" }, Ot = { class: "b-date-range-picker__footer" }, qt = {
834
+ i18n: { messages: Be },
835
+ name: "bento-date-range-picker",
836
+ model: { prop: "modelValue" }
837
+ }, xt = /* @__PURE__ */ qe({
838
+ ...qt,
839
+ props: {
840
+ allowTimeInput: { type: Boolean },
841
+ firstDayOfWeek: { default: void 0 },
842
+ granularities: {},
843
+ isDateDisabled: { type: Function, default: void 0 },
844
+ showEndDateOnOpen: { type: Boolean, default: !1 },
845
+ quickSelectRanges: { default: void 0 },
846
+ maxRange: { default: null },
847
+ min: { default: null },
848
+ max: { default: null },
849
+ numberOfMonths: { default: void 0 },
850
+ modelValue: { default: null },
851
+ value: { default: null },
852
+ variant: { default: void 0 },
853
+ yearRange: { default: void 0 },
854
+ hasActions: { type: Boolean, default: !1 },
855
+ description: { default: void 0 },
856
+ disabled: { type: Boolean, default: !1 },
857
+ errorMessage: { default: null },
858
+ label: { default: void 0 },
859
+ optional: { type: Boolean, default: !1 },
860
+ placeholder: { default: null },
861
+ readonly: { type: Boolean, default: !1 },
862
+ required: { type: Boolean, default: !1 },
863
+ tooltipText: { default: null }
864
+ },
865
+ emits: ["update:model-value", "input"],
866
+ setup(s, { emit: v }) {
867
+ const h = v, i = s, d = Va(), { t: a } = xe({ messages: Be }), { dateToInputDateString: o } = Ne(), f = oe("bento-date-range-picker-container"), W = oe("bento-date-range-picker-label"), T = oe("bento-date-range-picker-description"), I = oe("bento-date-range-picker-error"), S = oe("bento-date-range-picker-date-error"), ne = m(() => i.label || a("dateRangePicker", { name: f })), { resolvedFirstDayOfWeek: Y } = at(we(i, "firstDayOfWeek")), b = _a({
868
+ none: 0,
869
+ one: 710,
870
+ // width of date range picker with one panes
871
+ two: 1030,
872
+ // width of date range picker with two panes
873
+ three: 1290
874
+ // width of date range picker with three panes
875
+ }), Q = m(() => {
876
+ const l = b.active().value, A = {
877
+ none: 0,
878
+ one: 1,
879
+ two: 2
880
+ };
881
+ if (l in A) {
882
+ const r = A[l];
883
+ return i.numberOfMonths === void 0 ? r : Math.min(i.numberOfMonths, r);
884
+ }
885
+ return i.numberOfMonths;
886
+ }), G = m(() => i?.quickSelectRanges && i.quickSelectRanges.map((l) => {
887
+ const A = l.data.endDate ? void 0 : new Date(Date.now()).getTime() - l.data.startDate.getTime();
888
+ return {
889
+ ...l,
890
+ data: {
891
+ ...l.data,
892
+ // Adding timeDifference to calculate an up-to-date endDate on range selection
893
+ timeDifference: A
894
+ }
895
+ };
896
+ })), re = m(() => i.label ? W : d?.["aria-labelledby"] ?? null), k = z(!1), X = z(null), O = z(!1), { isReadOnly: t } = rt(we(i, "readonly")), { emitValue: q } = ot(h);
897
+ he(
898
+ () => i.disabled,
899
+ () => {
900
+ i.disabled && O.value && (O.value = !1);
901
+ }
902
+ );
903
+ const ie = m(() => i.modelValue || i.value), j = m(() => i.hasActions ? !Z.value && k.value : k.value), be = m(() => ({
904
+ "b-date-range-picker__description--error": !!i.errorMessage || j.value
905
+ })), Ye = m(() => i.variant === "month"), g = m(() => i.allowTimeInput && i.variant !== "month"), { dateDisplayValue: se, textInputDisplayValue: R } = Ft({
906
+ datePickerValue: ie,
907
+ isDateIncorrect: k,
908
+ quickSelectRanges: G,
909
+ isMonthVariant: Ye,
910
+ withTimeInput: g,
911
+ placeholder: we(i, "placeholder")
912
+ }), ke = m(
913
+ () => `${i.description ? T : ""} ${i.errorMessage ? I : ""} ${k.value ? S : ""}`.trim() || null
914
+ ), H = () => {
915
+ O.value = !1;
916
+ }, Ae = () => {
917
+ O.value = !0;
918
+ }, ue = z(se.value), de = z(
919
+ // textInputDisplayValue is a reactive object
920
+ structuredClone(Pe(R))
921
+ ), $ = z(i.modelValue ?? i.value), Z = z(!0), J = m(
922
+ () => i.hasActions ? de.value : R
923
+ ), Ie = m(
924
+ () => i.hasActions ? ue.value : se.value
925
+ );
926
+ ca(() => {
927
+ if (i.hasActions || He(
928
+ 'BentoDateRangePicker "hasActions" property',
929
+ `Set the BentoDateRangePicker "hasActions" property true which will display the "Apply" and "Cancel" buttons.
930
+ This will be the default behavior in the v2 and "hasActions" will be removed.`,
931
+ "2.0.0"
932
+ ), i.value && He(
933
+ 'BentoDateRangePicker "value" property',
934
+ 'The use of "value" prop in "BentoDateRangePicker" is no longer supported. Use the "v-model" or "model-value" property instead.',
935
+ "2.0.0"
936
+ ), i.granularities && i.variant !== "month" && i.granularities.find(({ type: l }) => l === "quarterly"))
937
+ throw new Error('Quarterly granularity is only supported by BentoDateRangePicker with variant: "month"');
938
+ }), he([() => i.value, () => i.modelValue], () => {
939
+ ue.value = se.value, de.value = structuredClone(Pe(R));
940
+ });
941
+ const ce = m(() => [
942
+ {
943
+ title: a("apply"),
944
+ event: () => {
945
+ q($.value), H(), Z.value = !0;
946
+ },
947
+ disabled: Z.value
948
+ },
949
+ {
950
+ title: a("cancel"),
951
+ event: H
952
+ }
953
+ ]);
954
+ he($, (l) => {
955
+ if (i.hasActions) {
956
+ Z.value = k.value;
957
+ return;
958
+ }
959
+ q(l);
960
+ });
961
+ const w = (l) => {
962
+ k.value = !1, R.startDate = o(l.startDate), R.endDate = o(l.endDate), R.startTime = N(l.startDate), R.endTime = N(l.endDate), $.value = l;
963
+ }, y = async () => {
964
+ k.value && (k.value = !1), $.value = null;
965
+ }, M = () => {
966
+ if (!O.value) {
967
+ O.value = !0;
968
+ return;
969
+ }
970
+ k.value || (O.value = !1);
971
+ }, me = (l) => {
972
+ k.value = !1, l.startTime && (R.startTime = l.startTime), l.endTime && (R.endTime = l.endTime);
973
+ }, De = (l) => {
974
+ k.value = !0, R.startDate = l.startDate, R.endDate = l.endDate, $.value = { startDate: null, endDate: null };
975
+ }, ve = (l) => {
976
+ l && (R.startDate = o(l.startDate), R.endDate = o(l.endDate), R.startTime = N(l.startDate), R.endTime = N(l.endDate), $.value = l);
977
+ };
978
+ return (l, A) => Ca((P(), ye("div", Pt, [
979
+ l.label ? (P(), _(u(gt), {
980
+ key: 0,
981
+ id: u(W),
982
+ label: l.label,
983
+ "tooltip-text": l.tooltipText,
984
+ optional: l.optional,
985
+ required: l.required
986
+ }, null, 8, ["id", "label", "tooltip-text", "optional", "required"])) : x("", !0),
987
+ te("div", {
988
+ onKeydown: Je(M, ["enter"])
989
+ }, [
990
+ L(u(it), {
991
+ ref_key: "inputContainerRef",
992
+ ref: X,
993
+ "always-combobox-is-input": "",
994
+ ariaControls: u(f),
995
+ ariaExpanded: O.value,
996
+ "aria-labelledby": re.value,
997
+ "aria-describedby": ke.value,
998
+ "aria-required": l.required,
999
+ disabled: l.disabled,
1000
+ "is-invalid": !!l.errorMessage || j.value,
1001
+ open: O.value,
1002
+ "display-value": Ie.value,
1003
+ readonly: u(t),
1004
+ onOpen: Ae,
1005
+ onClear: y,
1006
+ onClose: H
1007
+ }, null, 8, ["ariaControls", "ariaExpanded", "aria-labelledby", "aria-describedby", "aria-required", "disabled", "is-invalid", "open", "display-value", "readonly"])
1008
+ ], 32),
1009
+ j.value ? (P(), _(u(la), {
1010
+ key: 1,
1011
+ id: u(S),
1012
+ "error-message": u(a)("invalidDateFormat"),
1013
+ class: "b-date-range-picker__error-message"
1014
+ }, null, 8, ["id", "error-message"])) : x("", !0),
1015
+ l.errorMessage ? (P(), _(u(la), {
1016
+ key: 2,
1017
+ id: u(I),
1018
+ "error-message": l.errorMessage,
1019
+ class: "b-date-range-picker__error-message"
1020
+ }, null, 8, ["id", "error-message"])) : x("", !0),
1021
+ l.description ? (P(), _(u(Oe), {
1022
+ key: 3,
1023
+ id: u(T),
1024
+ class: ma(["b-date-range-picker__description", be.value]),
1025
+ el: "span"
1026
+ }, {
1027
+ default: K(() => [
1028
+ Me(Da(l.description), 1)
1029
+ ]),
1030
+ _: 1
1031
+ }, 8, ["id", "class"])) : x("", !0),
1032
+ X.value ? (P(), _(u(Ua), {
1033
+ key: 4,
1034
+ id: u(f),
1035
+ class: "b-date-range-picker__container",
1036
+ open: O.value,
1037
+ "target-element": X.value,
1038
+ "aria-label": ne.value,
1039
+ position: "bottom-start",
1040
+ "without-space": "",
1041
+ "fit-content": "",
1042
+ "trap-all": "",
1043
+ "overflow-visible": "",
1044
+ onKeydown: Je(H, ["esc", "native"])
1045
+ }, {
1046
+ default: K(() => [
1047
+ L(u(Et), {
1048
+ "allow-time-input": g.value,
1049
+ "quick-select-ranges": G.value,
1050
+ value: ie.value,
1051
+ "first-day-of-week": u(Y),
1052
+ granularities: l.granularities,
1053
+ "is-date-disabled": l.isDateDisabled,
1054
+ "max-range": l.maxRange,
1055
+ min: l.min,
1056
+ max: l.max,
1057
+ "number-of-months": Q.value,
1058
+ "show-end-date-on-open": l.showEndDateOnOpen,
1059
+ "date-form-data": J.value,
1060
+ variant: l.variant,
1061
+ "year-range": l.yearRange,
1062
+ onCustomRange: ve,
1063
+ onInput: w,
1064
+ onError: De,
1065
+ onFormDate: me
1066
+ }, za({ _: 2 }, [
1067
+ l.hasActions ? {
1068
+ name: "actions",
1069
+ fn: K(() => [
1070
+ L(u(La)),
1071
+ te("div", Ot, [
1072
+ L(u(Qa), {
1073
+ actions: ce.value,
1074
+ layout: u(yt).SPACE_BETWEEN
1075
+ }, null, 8, ["actions", "layout"])
1076
+ ])
1077
+ ]),
1078
+ key: "0"
1079
+ } : void 0
1080
+ ]), 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", "year-range"])
1081
+ ]),
1082
+ _: 1
1083
+ }, 8, ["id", "open", "target-element", "aria-label"])) : x("", !0)
1084
+ ])), [
1085
+ [u(st), H]
1086
+ ]);
1087
+ }
1088
+ }), Dn = /* @__PURE__ */ va(xt, [["__scopeId", "data-v-e9cefb1f"]]);
1089
+ export {
1090
+ Dn as B,
1091
+ Et as D,
1092
+ ht as a,
1093
+ Ee as i
1094
+ };
1095
+ //# sourceMappingURL=date-range-picker.CtGaxtYh.js.map