@adyen/bento-vue2 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 (178) hide show
  1. package/dist/@types/index.d.ts +162 -127
  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.Chu-0oVy.js → action-bar.B890LCTe.js} +3 -3
  32. package/dist/chunks/{action-bar.Chu-0oVy.js.map → action-bar.B890LCTe.js.map} +1 -1
  33. package/dist/chunks/{ai-tag.DVmvni7U.js → ai-tag.C8RxACNj.js} +2 -2
  34. package/dist/chunks/{ai-tag.DVmvni7U.js.map → ai-tag.C8RxACNj.js.map} +1 -1
  35. package/dist/chunks/{alert.B4bHCE8V.js → alert.BDkEbdf4.js} +10 -10
  36. package/dist/chunks/{alert.B4bHCE8V.js.map → alert.BDkEbdf4.js.map} +1 -1
  37. package/dist/chunks/{base-modal.CC7gm9fc.js → base-modal.CDMoF3b_.js} +3 -3
  38. package/dist/chunks/{base-modal.CC7gm9fc.js.map → base-modal.CDMoF3b_.js.map} +1 -1
  39. package/dist/chunks/{button-actions-with-menu.BlOBDvdL.js → button-actions-with-menu.DqDQ_gVX.js} +2 -2
  40. package/dist/chunks/{button-actions-with-menu.BlOBDvdL.js.map → button-actions-with-menu.DqDQ_gVX.js.map} +1 -1
  41. package/dist/chunks/{button-actions.D1jRC1fs.js → button-actions.DKc63aCb.js} +122 -110
  42. package/dist/chunks/{button-actions.D1jRC1fs.js.map → button-actions.DKc63aCb.js.map} +1 -1
  43. package/dist/chunks/calendar.BckAv9N_.js +1235 -0
  44. package/dist/chunks/calendar.BckAv9N_.js.map +1 -0
  45. package/dist/chunks/{card.ErZLKN0q.js → card.ChBURa5R.js} +2 -2
  46. package/dist/chunks/{card.ErZLKN0q.js.map → card.ChBURa5R.js.map} +1 -1
  47. package/dist/chunks/{checkbox-group.CNTMMwQr.js → checkbox-group.BAjvgXlc.js} +2 -2
  48. package/dist/chunks/{checkbox-group.CNTMMwQr.js.map → checkbox-group.BAjvgXlc.js.map} +1 -1
  49. package/dist/chunks/{checkbox.BIzqX_eH.js → checkbox.BAQDBNL6.js} +18 -18
  50. package/dist/chunks/{checkbox.BIzqX_eH.js.map → checkbox.BAQDBNL6.js.map} +1 -1
  51. package/dist/chunks/{code-snippet.lcQRsLdZ.js → code-snippet.nUo9bjhC.js} +3 -3
  52. package/dist/chunks/{code-snippet.lcQRsLdZ.js.map → code-snippet.nUo9bjhC.js.map} +1 -1
  53. package/dist/chunks/{country.BEwW8TQo.js → country.nGZJwp_A.js} +2 -2
  54. package/dist/chunks/country.nGZJwp_A.js.map +1 -0
  55. package/dist/chunks/{dashboard-section.DiGQXS9L.js → dashboard-section.BDDVJpxY.js} +2 -2
  56. package/dist/chunks/{dashboard-section.DiGQXS9L.js.map → dashboard-section.BDDVJpxY.js.map} +1 -1
  57. package/dist/chunks/{dashed-underline.Cl07OQID.js → dashed-underline.CfEmbgOv.js} +2 -2
  58. package/dist/chunks/{dashed-underline.Cl07OQID.js.map → dashed-underline.CfEmbgOv.js.map} +1 -1
  59. package/dist/chunks/{data-grid-template.BVppx9kZ.js → data-grid-template.BUlLHTYe.js} +2 -2
  60. package/dist/chunks/{data-grid-template.BVppx9kZ.js.map → data-grid-template.BUlLHTYe.js.map} +1 -1
  61. package/dist/chunks/{data-grid.DQwAkw4U.js → data-grid.0OiCQjFc.js} +28 -29
  62. package/dist/chunks/{data-grid.DQwAkw4U.js.map → data-grid.0OiCQjFc.js.map} +1 -1
  63. package/dist/chunks/date-picker.CsFSskqf.js +245 -0
  64. package/dist/chunks/date-picker.CsFSskqf.js.map +1 -0
  65. package/dist/chunks/date-picker.types.Ckt7zxGy.js.map +1 -1
  66. package/dist/chunks/date-range-picker.Bczgdu5X.js +1250 -0
  67. package/dist/chunks/date-range-picker.Bczgdu5X.js.map +1 -0
  68. package/dist/chunks/date-range-picker.types.Ckt7zxGy.js.map +1 -1
  69. package/dist/chunks/date-time-picker.DT54TiG4.js +177 -0
  70. package/dist/chunks/date-time-picker.DT54TiG4.js.map +1 -0
  71. package/dist/chunks/{draggable-handle.DIhHtHG9.js → draggable-handle.DwJBaf5y.js} +2 -2
  72. package/dist/chunks/{draggable-handle.DIhHtHG9.js.map → draggable-handle.DwJBaf5y.js.map} +1 -1
  73. package/dist/chunks/{dropdown-tag.CuDxdSfb.js → dropdown-tag.BqSrkuwj.js} +2 -2
  74. package/dist/chunks/{dropdown-tag.CuDxdSfb.js.map → dropdown-tag.BqSrkuwj.js.map} +1 -1
  75. package/dist/chunks/dropdown.CIEm6MBB.js +2660 -0
  76. package/dist/chunks/dropdown.CIEm6MBB.js.map +1 -0
  77. package/dist/chunks/{file-uploader.CO2MeHwl.js → file-uploader.DOvQMUHC.js} +2 -2
  78. package/dist/chunks/{file-uploader.CO2MeHwl.js.map → file-uploader.DOvQMUHC.js.map} +1 -1
  79. package/dist/chunks/{filter-bar.DQ9fJXq1.js → filter-bar.DVRPM9tf.js} +318 -319
  80. package/dist/chunks/filter-bar.DVRPM9tf.js.map +1 -0
  81. package/dist/chunks/{footer-actions.CZE9dcmA.js → footer-actions.C1sXd7ti.js} +2 -2
  82. package/dist/chunks/{footer-actions.CZE9dcmA.js.map → footer-actions.C1sXd7ti.js.map} +1 -1
  83. package/dist/chunks/{form-layout-title.CXXdsiK5.js → form-layout-title.xrix5vY3.js} +2 -2
  84. package/dist/chunks/{form-layout-title.CXXdsiK5.js.map → form-layout-title.xrix5vY3.js.map} +1 -1
  85. package/dist/chunks/{header-meta.6rZdOgXD.js → header-meta.D1eb37QJ.js} +2 -2
  86. package/dist/chunks/{header-meta.6rZdOgXD.js.map → header-meta.D1eb37QJ.js.map} +1 -1
  87. package/dist/chunks/{header-with-views.4VNHbNk0.js → header-with-views.Bk6ly102.js} +8 -8
  88. package/dist/chunks/{header-with-views.4VNHbNk0.js.map → header-with-views.Bk6ly102.js.map} +1 -1
  89. package/dist/chunks/{header.BsroOD5b.js → header.CszOmM16.js} +3 -3
  90. package/dist/chunks/{header.BsroOD5b.js.map → header.CszOmM16.js.map} +1 -1
  91. package/dist/chunks/{input-field-password.CRqYWZGS.js → input-field-password.C4Wxsl16.js} +3 -3
  92. package/dist/chunks/{input-field-password.CRqYWZGS.js.map → input-field-password.C4Wxsl16.js.map} +1 -1
  93. package/dist/chunks/{input-field-phone-number.DHiuL0cF.js → input-field-phone-number.BhYTU628.js} +2 -2
  94. package/dist/chunks/{input-field-phone-number.DHiuL0cF.js.map → input-field-phone-number.BhYTU628.js.map} +1 -1
  95. package/dist/chunks/{input-field.BkQZ6Qzl.js → input-field.3tzX7t2y.js} +2 -2
  96. package/dist/chunks/{input-field.BkQZ6Qzl.js.map → input-field.3tzX7t2y.js.map} +1 -1
  97. package/dist/chunks/{input-time.BiOHvUEA.js → input-time.Bf-ZrCPX.js} +34 -34
  98. package/dist/chunks/{input-time.BiOHvUEA.js.map → input-time.Bf-ZrCPX.js.map} +1 -1
  99. package/dist/chunks/{modal-fullscreen.OS6KhVdg.js → modal-fullscreen.Dg1Hi3jB.js} +2 -2
  100. package/dist/chunks/{modal-fullscreen.OS6KhVdg.js.map → modal-fullscreen.Dg1Hi3jB.js.map} +1 -1
  101. package/dist/chunks/{modal.DHL3TGHv.js → modal.DZTEFM_E.js} +4 -4
  102. package/dist/chunks/{modal.DHL3TGHv.js.map → modal.DZTEFM_E.js.map} +1 -1
  103. package/dist/chunks/{pagination.DItyAwy1.js → pagination.C6HIPq58.js} +2 -2
  104. package/dist/chunks/{pagination.DItyAwy1.js.map → pagination.C6HIPq58.js.map} +1 -1
  105. package/dist/chunks/{rich-text-editor.D5URbwnM.js → rich-text-editor.-B96ibAd.js} +3 -3
  106. package/dist/chunks/{rich-text-editor.D5URbwnM.js.map → rich-text-editor.-B96ibAd.js.map} +1 -1
  107. package/dist/chunks/{search-bar.D-WK8eMQ.js → search-bar.DunTxVmZ.js} +5 -5
  108. package/dist/chunks/{search-bar.D-WK8eMQ.js.map → search-bar.DunTxVmZ.js.map} +1 -1
  109. package/dist/chunks/{secondary-nav.C7lEDaoj.js → secondary-nav.CGGPkYpc.js} +2 -2
  110. package/dist/chunks/{secondary-nav.C7lEDaoj.js.map → secondary-nav.CGGPkYpc.js.map} +1 -1
  111. package/dist/chunks/{selection-card-group.CiFW4AZR.js → selection-card-group.ZZ_qF1L1.js} +8 -8
  112. package/dist/chunks/{selection-card-group.CiFW4AZR.js.map → selection-card-group.ZZ_qF1L1.js.map} +1 -1
  113. package/dist/chunks/{sidepanel.B8zQp_MJ.js → sidepanel.ChuW63J7.js} +3 -3
  114. package/dist/chunks/{sidepanel.B8zQp_MJ.js.map → sidepanel.ChuW63J7.js.map} +1 -1
  115. package/dist/chunks/{summary-grid.types.CkqRXOKv.js → summary-grid.types.BnEhhDQz.js} +3 -3
  116. package/dist/chunks/summary-grid.types.BnEhhDQz.js.map +1 -0
  117. package/dist/chunks/{timeline-item.sdxvTjmS.js → timeline-item.DzMh520x.js} +3 -3
  118. package/dist/chunks/{timeline-item.sdxvTjmS.js.map → timeline-item.DzMh520x.js.map} +1 -1
  119. package/dist/chunks/{tutorial.Ba9dqb2j.js → tutorial.CkeL_7Je.js} +2 -2
  120. package/dist/chunks/{tutorial.Ba9dqb2j.js.map → tutorial.CkeL_7Je.js.map} +1 -1
  121. package/dist/chunks/use-bento-delayed-hover.D4rfUUOr.js.map +1 -1
  122. package/dist/chunks/{use-date-input-formatter.B5GQd3s2.js → use-date-input-formatter.Dq9C0nc9.js} +2 -2
  123. package/dist/chunks/{use-date-input-formatter.B5GQd3s2.js.map → use-date-input-formatter.Dq9C0nc9.js.map} +1 -1
  124. package/dist/code-snippet.js +1 -1
  125. package/dist/country.js +1 -1
  126. package/dist/dashboard-template.js +1 -1
  127. package/dist/dashed-underline.js +1 -1
  128. package/dist/data-grid-template.js +1 -1
  129. package/dist/data-grid.js +1 -1
  130. package/dist/date-picker.js +2 -2
  131. package/dist/date-range-picker.js +2 -2
  132. package/dist/date-time-picker.js +1 -1
  133. package/dist/draggable.js +1 -1
  134. package/dist/dropdown.js +10 -11
  135. package/dist/dropdown.js.map +1 -1
  136. package/dist/file-uploader.js +1 -1
  137. package/dist/filter-bar.js +1 -1
  138. package/dist/form-layout.js +1 -1
  139. package/dist/header-with-views.js +1 -1
  140. package/dist/header.js +1 -1
  141. package/dist/index.js +269 -270
  142. package/dist/index.js.map +1 -1
  143. package/dist/input-field-password.js +1 -1
  144. package/dist/input-field-phone-number.js +1 -1
  145. package/dist/input-field.js +1 -1
  146. package/dist/input-time.js +1 -1
  147. package/dist/internal.js +13 -13
  148. package/dist/menu.js +1 -1
  149. package/dist/modal-fullscreen.js +1 -1
  150. package/dist/modal.js +2 -2
  151. package/dist/pagination.js +1 -1
  152. package/dist/popover.js +1 -1
  153. package/dist/rich-text-editor.js +1 -1
  154. package/dist/search-bar.js +2 -2
  155. package/dist/secondary-nav.js +1 -1
  156. package/dist/selection-card.js +1 -1
  157. package/dist/sidepanel.js +1 -1
  158. package/dist/summary-grid.js +1 -1
  159. package/dist/timeline.js +1 -1
  160. package/dist/tutorial.js +1 -1
  161. package/dist/web-types.json +205 -2
  162. package/package.json +3 -3
  163. package/dist/assets/use-cached-selected-values.css +0 -1
  164. package/dist/chunks/calendar.D0JIbmoS.js +0 -1151
  165. package/dist/chunks/calendar.D0JIbmoS.js.map +0 -1
  166. package/dist/chunks/country.BEwW8TQo.js.map +0 -1
  167. package/dist/chunks/date-picker.BWxvyK5J.js +0 -245
  168. package/dist/chunks/date-picker.BWxvyK5J.js.map +0 -1
  169. package/dist/chunks/date-range-picker.gfRJmzXn.js +0 -1114
  170. package/dist/chunks/date-range-picker.gfRJmzXn.js.map +0 -1
  171. package/dist/chunks/date-time-picker.BIl9kFLh.js +0 -129
  172. package/dist/chunks/date-time-picker.BIl9kFLh.js.map +0 -1
  173. package/dist/chunks/dropdown.C70AlvOT.js +0 -1155
  174. package/dist/chunks/dropdown.C70AlvOT.js.map +0 -1
  175. package/dist/chunks/filter-bar.DQ9fJXq1.js.map +0 -1
  176. package/dist/chunks/summary-grid.types.CkqRXOKv.js.map +0 -1
  177. package/dist/chunks/use-cached-selected-values.D0s14AxT.js +0 -1520
  178. package/dist/chunks/use-cached-selected-values.D0s14AxT.js.map +0 -1
@@ -1,245 +0,0 @@
1
- import { ref as f, computed as i, defineComponent as re, toRef as B, watch as E, nextTick as le } from "vue";
2
- import { g as oe, f as z, b as ne, h as ie, i as se, p as de } from "./calendar.D0JIbmoS.js";
3
- import { h as ce } from "./button-actions.D1jRC1fs.js";
4
- import { d as ue, B as pe } from "./typography.C8lPlsbD.js";
5
- import { D as me } from "./dropdown.C70AlvOT.js";
6
- import { B as De } from "./input-field.BkQZ6Qzl.js";
7
- import { d as fe } from "./use-cached-selected-values.D0s14AxT.js";
8
- import { g as y } from "./generate-uid.NJ8tVoha.js";
9
- import { u as q } from "./index.B6WW_F-J.js";
10
- import { u as ve } from "./form-field.D_2g7vaP.js";
11
- import { u as W, a as be } from "./use-date-input-formatter.B5GQd3s2.js";
12
- import { u as ye } from "./use-form-layout-loading.CWbjZiwP.js";
13
- import "./index.Cl4_42j5.js";
14
- import { u as ke } from "./use-touch-device.DTqFAbXh.js";
15
- import { B as Ie } from "./directive.BBWhsNtO.js";
16
- import { F as ge } from "./field-label.CdVbAfK-.js";
17
- import { E as Ae } from "./error-message.CyERcfdt.js";
18
- import { n as _e } from "./_plugin-vue2_normalizer.CeySl7Fu.js";
19
- import "../assets/date-picker.css";
20
- const he = {
21
- "de-DE": {
22
- datePicker: "Datumsauswahl",
23
- provideDateInAFormat: "Geben Sie das Datum im Format YYYY-MM-DD an",
24
- selectDate: "Wählen Sie ein Datum",
25
- selectDateRange: "Wählen Sie einen Datumsbereich aus",
26
- selectedDateIsNotAvailable: "Ausgewähltes Datum ist nicht verfügbar"
27
- },
28
- "en-GB": {
29
- datePicker: "Date picker",
30
- provideDateInAFormat: "Enter date in YYYY-MM-DD format",
31
- selectDate: "Select a date",
32
- selectDateRange: "Select a date range",
33
- selectedDateIsNotAvailable: "Selected date is not available"
34
- },
35
- "en-US": {
36
- datePicker: "Date picker",
37
- provideDateInAFormat: "Provide date in a YYYY-MM-DD format",
38
- selectDate: "Select a date",
39
- selectDateRange: "Select a date range",
40
- selectedDateIsNotAvailable: "Selected date is not available"
41
- },
42
- "es-ES": {
43
- datePicker: "Selector de fecha",
44
- provideDateInAFormat: "Proporciona la fecha en formato AAAA-MM-DD",
45
- selectDate: "Selecciona una fecha",
46
- selectDateRange: "Selecciona un rango de fechas",
47
- selectedDateIsNotAvailable: "La fecha seleccionada no está disponible"
48
- },
49
- "es-MX": {
50
- datePicker: "Selector de fecha",
51
- provideDateInAFormat: "Proporciona la fecha en formato AAAA-MM-DD",
52
- selectDate: "Selecciona una fecha",
53
- selectDateRange: "Selecciona un rango de fechas",
54
- selectedDateIsNotAvailable: "La fecha seleccionada no está disponible"
55
- },
56
- "fr-FR": {
57
- datePicker: "Sélecteur de date",
58
- provideDateInAFormat: "Fournissez la date au format AAAA-MM-JJ",
59
- selectDate: "Sélectionnez une date",
60
- selectDateRange: "Sélectionnez une plage de dates",
61
- selectedDateIsNotAvailable: "La date sélectionnée n’est pas disponible"
62
- },
63
- "it-IT": {
64
- datePicker: "Selezionatore di date",
65
- provideDateInAFormat: "Inserisci la data nel formato AAAA-MM-GG",
66
- selectDate: "Seleziona una data",
67
- selectDateRange: "Seleziona un intervallo di date",
68
- selectedDateIsNotAvailable: "La data selezionata non è disponibile"
69
- },
70
- "ja-JP": {
71
- datePicker: "日付ピッカー",
72
- provideDateInAFormat: "YYYY-MM-DD形式で日付を入力してください",
73
- selectDate: "日付を選択",
74
- selectDateRange: "日付範囲を選択",
75
- selectedDateIsNotAvailable: "選択した日付は利用できません"
76
- },
77
- "pt-BR": {
78
- datePicker: "Seletor de data",
79
- provideDateInAFormat: "Inclua a data no formato AAAA-MM-DD",
80
- selectDate: "Selecione uma data",
81
- selectDateRange: "Selecione um intervalo de datas",
82
- selectedDateIsNotAvailable: "A data selecionada não está disponível"
83
- },
84
- "zh-CN": {
85
- datePicker: "日期选择器",
86
- provideDateInAFormat: "提供年-月-日格式的日期",
87
- selectDate: "选择日期",
88
- selectDateRange: "选择日期范围",
89
- selectedDateIsNotAvailable: "所选日期不可用"
90
- }
91
- }, Se = ({
92
- datePickerValue: p,
93
- dateError: a,
94
- isMonthVariant: t,
95
- placeholder: e
96
- }) => {
97
- var k;
98
- const { locale: d, t: m } = q(), { formatDate: v } = W(), l = f((k = p.value) == null ? void 0 : k.toDateString());
99
- return {
100
- // Values
101
- dateDisplayValue: i(() => {
102
- if (a.value)
103
- return l.value;
104
- if (!p.value)
105
- return (e == null ? void 0 : e.value) || m("selectDate");
106
- const c = t != null && t.value ? { month: "long", year: "numeric" } : { day: "numeric", month: "short", year: "numeric" };
107
- return oe(d.value, c).format(p.value);
108
- }),
109
- textInputValue: l,
110
- // Methods
111
- formatTextInputDisplayValue: (c = p.value) => {
112
- if (a.value)
113
- return;
114
- if (!c) {
115
- l.value = "";
116
- return;
117
- }
118
- const I = t != null && t.value ? z(c) : c;
119
- l.value = v(I);
120
- }
121
- };
122
- }, Pe = {
123
- i18n: { messages: he },
124
- name: "bento-date-picker",
125
- model: { prop: "modelValue" }
126
- }, Ce = /* @__PURE__ */ re({
127
- ...Pe,
128
- props: {
129
- description: { default: void 0 },
130
- disabled: { type: Boolean, default: !1 },
131
- errorMessage: { default: null },
132
- label: { default: void 0 },
133
- optional: { type: Boolean, default: !1 },
134
- placeholder: { default: null },
135
- readonly: { type: Boolean, default: !1 },
136
- required: { type: Boolean, default: !1 },
137
- tooltipText: { default: null },
138
- defaultDisplayMonth: { default: null },
139
- firstDayOfWeek: { default: void 0 },
140
- isDateDisabled: { default: void 0 },
141
- min: { default: null },
142
- max: { default: null },
143
- modelValue: { default: null },
144
- value: { default: null },
145
- variant: { default: void 0 }
146
- },
147
- emits: ["update:model-value", "input"],
148
- setup(p, { emit: a }) {
149
- const t = p, e = 1e3, { t: d } = q(), m = y("bento-date-picker-container"), v = y("bento-date-picker-label"), l = y("bento-date-picker-description"), h = y("bento-date-picker-error"), S = y("bento-date-picker-date-error"), k = i(() => t.label || d("datePicker", { name: m })), c = f(null), I = f(null), n = f(null), u = f(!1), P = f(void 0), D = f(t.modelValue), { isReadOnly: G } = ye(B(t, "readonly")), { emitValue: s } = ve(a), { resolvedFirstDayOfWeek: K } = be(B(t, "firstDayOfWeek")), { isFormatValid: C, parseDate: F, onKeyDown: R, autoFormat: T } = W(), { isTouchDevice: N } = ke(), U = i(() => ({
150
- initialFocus: P.value,
151
- additionalContainers: [I.value.$el]
152
- }));
153
- E(
154
- () => t.disabled,
155
- (r) => {
156
- r && u.value && (u.value = !1);
157
- }
158
- ), E(
159
- [() => t.value, () => t.modelValue],
160
- ([r, o]) => {
161
- r && ue(
162
- 'BentoDatePicker "value" property',
163
- 'The use of "value" prop in "BentoDatePicker" is no longer supported. Use the "v-model" or "model-value" property instead.',
164
- "2.0.0"
165
- ), D.value = o ?? r;
166
- },
167
- { immediate: !0 }
168
- );
169
- const g = i(() => t.variant === "month"), { dateDisplayValue: J, textInputValue: b, formatTextInputDisplayValue: x } = Se({
170
- datePickerValue: D,
171
- dateError: n,
172
- isMonthVariant: g,
173
- placeholder: B(t, "placeholder")
174
- }), A = (r) => r ? g.value ? ie(r) : se(r) : "", $ = i(() => A(D.value)), j = (r) => {
175
- if (!r) {
176
- n.value = null, s(null);
177
- return;
178
- }
179
- const o = de(r, g.value ? "month" : "date");
180
- if (n.value = _(o), n.value) {
181
- s(null);
182
- return;
183
- }
184
- s(o);
185
- }, X = i(() => A(t.min)), H = i(() => A(t.max)), _ = (r) => !r || isNaN(r.getTime()) || t.min && r < t.min || t.max && r > t.max ? "provideDateInAFormat" : t.isDateDisabled && t.isDateDisabled(r) ? "selectedDateIsNotAvailable" : null, M = i(() => n.value ? d(n.value) : null);
186
- E(
187
- [u, b, () => t.isDateDisabled, () => t.min, () => t.max],
188
- ([r, o]) => {
189
- !r && o && C(o) && (n.value = _(F(o)));
190
- }
191
- );
192
- const Q = i(() => ({
193
- "b-date-picker__description--error": t.errorMessage || M.value
194
- })), Z = i(
195
- () => `${t.description ? l : ""} ${t.errorMessage ? h : ""} ${M.value ? S : ""}`.trim() || null
196
- ), w = () => {
197
- u.value = !1;
198
- }, Y = () => {
199
- u.value = !0, x();
200
- }, ee = (r) => {
201
- n.value = null, w(), s(r);
202
- }, ae = async () => {
203
- n.value && (n.value = null, b.value = null), s(null);
204
- }, te = (r) => {
205
- R(r);
206
- }, O = (r) => {
207
- if (r.length < 10)
208
- return;
209
- const o = C(r) ? F(r) : null, V = _(o);
210
- !V && o ? (n.value = null, s(o)) : r && (n.value = V || "provideDateInAFormat", s(null));
211
- }, L = fe(O, e);
212
- return { __sfc: !0, DEBOUNCE_TIME: e, props: t, emit: a, t: d, datePickerContainerId: m, labelId: v, descriptionId: l, errorId: h, dateErrorId: S, popoverAriaLabel: k, calendarContainerRef: c, inputContainerRef: I, dateError: n, isDatePickerOpen: u, initialFocusOnDatePickerOpen: P, internalModelValue: D, isReadOnly: G, emitValue: s, resolvedFirstDayOfWeek: K, isFormatValid: C, parseDate: F, onKeyDown: R, autoFormat: T, isTouchDevice: N, computedTrapAllOptions: U, isMonthVariant: g, dateDisplayValue: J, textInputValue: b, formatTextInputDisplayValue: x, formatNativeDate: A, nativeValue: $, onNativeDateInput: j, formattedMin: X, formattedMax: H, getDateErrorReason: _, dateErrorText: M, descriptionConditionalClasses: Q, ariaDescribedBy: Z, closeDatePicker: w, openDatePicker: Y, onDateSelected: ee, clearDatePickerValue: ae, onDateKeyDown: te, validateDate: O, validateDateDebounced: L, onDateInputChange: (r) => {
213
- b.value = T(r), u.value || N.value ? O(b.value) : L(b.value);
214
- }, onSpaceBarOrEnter: async (r) => {
215
- var o;
216
- u.value || (r.preventDefault(), Y(), await le(), D.value || (x(/* @__PURE__ */ new Date()), s(/* @__PURE__ */ new Date())), P.value = ((o = c.value) == null ? void 0 : o.$refs.calendarRef[0].focusOnDate(
217
- t.variant === "month" ? z(D.value) : D.value,
218
- !0
219
- )) ?? void 0);
220
- }, BentoPopover: ce, BentoTypography: pe, Calendar: ne, ErrorMessage: Ae, FieldLabel: ge, DropdownInputDefault: me, BentoInputField: De, vBentoClickOutsideDirective: Ie };
221
- }
222
- });
223
- var Fe = function() {
224
- var d, m, v;
225
- var a = this, t = a._self._c, e = a._self._setupProxy;
226
- return t("div", { directives: [{ name: "bento-click-outside-directive", rawName: "v-bento-click-outside-directive", value: e.closeDatePicker, expression: "closeDatePicker" }], staticClass: "b-date-picker", on: { "!keydown": [function(l) {
227
- return !l.type.indexOf("key") && a._k(l.keyCode, "space", 32, l.key, [" ", "Spacebar"]) ? null : e.onSpaceBarOrEnter.apply(null, arguments);
228
- }, function(l) {
229
- return !l.type.indexOf("key") && a._k(l.keyCode, "enter", 13, l.key, "Enter") ? null : e.onSpaceBarOrEnter.apply(null, arguments);
230
- }] } }, [a.label ? t(e.FieldLabel, { attrs: { id: e.labelId, label: a.label, "tooltip-text": a.tooltipText, optional: a.optional, required: a.required } }) : a._e(), t("div", [e.isTouchDevice ? t(e.BentoInputField, { ref: "inputContainerRef", attrs: { type: e.isMonthVariant ? "month" : "date", "aria-labelledby": a.label ? e.labelId : (d = a.$attrs) == null ? void 0 : d["aria-labelledby"], "aria-label": a.label || (m = a.$attrs) != null && m["aria-labelledby"] ? null : e.popoverAriaLabel, "aria-describedby": e.ariaDescribedBy, "aria-required": a.required, disabled: a.disabled, error: !!a.errorMessage || !!e.dateErrorText, "model-value": e.nativeValue, readonly: e.isReadOnly, min: e.formattedMin, max: e.formattedMax }, on: { "update:model-value": e.onNativeDateInput } }) : t(e.DropdownInputDefault, { ref: "inputContainerRef", attrs: { "always-combobox-is-input": "", ariaControls: e.datePickerContainerId, ariaExpanded: e.isDatePickerOpen, "aria-labelledby": a.label ? e.labelId : (v = a.$attrs) == null ? void 0 : v["aria-labelledby"], "aria-label": a.label ? null : e.popoverAriaLabel, "aria-describedby": e.ariaDescribedBy, "aria-required": a.required, disabled: a.disabled, "dynamic-filtering": "", "is-invalid": !!a.errorMessage || !!e.dateErrorText, open: e.isDatePickerOpen, value: e.textInputValue, "display-value": e.dateDisplayValue, "debounce-time": 0, readonly: e.isReadOnly }, on: { input: e.onDateInputChange, open: e.openDatePicker, keydown: e.onDateKeyDown, clear: e.clearDatePickerValue, close: e.closeDatePicker } })], 1), e.dateErrorText ? t(e.ErrorMessage, { staticClass: "b-date-picker__error-message", attrs: { id: e.dateErrorId, "error-message": e.dateErrorText } }) : a._e(), a.errorMessage ? t(e.ErrorMessage, { staticClass: "b-date-picker__error-message", attrs: { id: e.errorId, "error-message": a.errorMessage } }) : a._e(), a.description ? t(e.BentoTypography, { staticClass: "b-date-picker__description", class: e.descriptionConditionalClasses, attrs: { el: "span" } }, [a._v(" " + a._s(a.description) + " ")]) : a._e(), e.inputContainerRef && !e.isTouchDevice ? t(e.BentoPopover, { staticClass: "b-date-picker__container", attrs: { id: e.datePickerContainerId, role: "dialog", open: e.isDatePickerOpen, "target-element": e.inputContainerRef, "aria-label": e.popoverAriaLabel, "aria-modal": !0, position: "bottom-start", "fit-content": "", "trap-all": "", "trap-all-options": e.computedTrapAllOptions }, nativeOn: { keydown: function(l) {
231
- return !l.type.indexOf("key") && a._k(l.keyCode, "esc", 27, l.key, ["Esc", "Escape"]) ? null : e.closeDatePicker.apply(null, arguments);
232
- } } }, [t(e.Calendar, { ref: "calendarContainerRef", attrs: { "default-display-month": a.defaultDisplayMonth, "first-day-of-week": e.resolvedFirstDayOfWeek, "is-date-disabled": a.isDateDisabled, "number-of-months": 1, value: e.internalModelValue, min: a.min, max: a.max, variant: a.variant }, on: { input: e.onDateSelected } })], 1) : a._e()], 1);
233
- }, xe = [], Me = /* @__PURE__ */ _e(
234
- Ce,
235
- Fe,
236
- xe,
237
- !1,
238
- null,
239
- "008cec8d"
240
- );
241
- const He = Me.exports;
242
- export {
243
- He as B
244
- };
245
- //# sourceMappingURL=date-picker.BWxvyK5J.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"date-picker.BWxvyK5J.js","sources":["../../src/components/date-picker/composables/use-date-picker-single-calendar-text.ts","../../src/components/date-picker/date-picker.vue"],"sourcesContent":["import { computed, ref } from 'vue';\nimport { useI18n } from '@/utils/ts/i18n';\nimport { type UseDateDisplayText } from './use-date-picker-single-calendar-text.types';\nimport { startOfMonth } from 'date-fns/startOfMonth';\nimport { getDateTimeFormatter } from '@/utils/ts/format-date/format-date';\nimport { useDateInputFormatter } from '@/composables/use-date-input-formatter/use-date-input-formatter';\nimport messages from '../messages.json';\n\ntype MessageSchema = (typeof messages)['en-US'];\n\n/**\n * Composable that sets and formats the date to be displayed in the input box of a Single Date Picker\n * @param option.datePickerValue Ref to the datePickerValue set in the DatePicker component\n * @param option.dateError The i18n message key for the current error, or null if valid\n * @param option.isMonthVariant Indicates if the date picker has variant \"month\"\n */\nexport const useDatePickerSingleCalendarText: UseDateDisplayText<Date> = ({\n datePickerValue,\n dateError,\n isMonthVariant,\n placeholder,\n}) => {\n const { locale, t } = useI18n<{ message: MessageSchema }>({ messages });\n const { formatDate } = useDateInputFormatter();\n\n const textInputValue = ref(datePickerValue.value?.toDateString());\n\n const dateDisplayValue = computed(() => {\n // Display incorrect date when there's an error with the input\n if (dateError.value) {\n return textInputValue.value;\n }\n\n // Display \"Select a date\" when there's no date selected or input\n if (!datePickerValue.value) {\n return placeholder?.value || (t('selectDate') as string);\n }\n\n // Display the date in format \"dd MMM, yyyy (25 Jun, 2023)\" or \"MMMM yyyy (June 2023)\"\n // if there's a valid date selected\n const dateFormatOptions: Intl.DateTimeFormatOptions = isMonthVariant?.value\n ? { month: 'long', year: 'numeric' }\n : { day: 'numeric', month: 'short', year: 'numeric' };\n\n return getDateTimeFormatter(locale.value, dateFormatOptions).format(datePickerValue.value);\n });\n\n /**\n * Formats the \"dateToFormat\" date value with the current format and sets it as \"formatTextInputDisplayValue\" value\n * @param dateToFormat - Date to be assigned and formatted\n */\n const formatTextInputDisplayValue = (dateToFormat: Date = datePickerValue.value) => {\n // If date is incorrect, leave the textInputValue intact\n if (dateError.value) {\n return;\n }\n\n if (!dateToFormat) {\n textInputValue.value = '';\n return;\n }\n\n const date = isMonthVariant?.value ? startOfMonth(dateToFormat) : dateToFormat;\n textInputValue.value = formatDate(date);\n };\n\n return {\n // Values\n dateDisplayValue,\n textInputValue,\n\n // Methods\n formatTextInputDisplayValue,\n };\n};\n","<!-- TODO: Remove aria props as these are part of JSX elements /vue/types/jsx.d.ts -->\n<!-- eslint-disable vue/attribute-hyphenation -->\n<template>\n <div\n v-bento-click-outside-directive=\"closeDatePicker\"\n class=\"b-date-picker\"\n @keydown.space.capture=\"onSpaceBarOrEnter\"\n @keydown.enter.capture=\"onSpaceBarOrEnter\"\n >\n <!-- Label -->\n <field-label\n v-if=\"label\"\n :id=\"labelId\"\n :label=\"label\"\n :tooltip-text=\"tooltipText\"\n :optional=\"optional\"\n :required=\"required\"\n />\n\n <!-- Input -->\n <div>\n <bento-input-field\n v-if=\"isTouchDevice\"\n ref=\"inputContainerRef\"\n :type=\"isMonthVariant ? 'month' : 'date'\"\n :aria-labelledby=\"label ? labelId : $attrs?.['aria-labelledby']\"\n :aria-label=\"label || $attrs?.['aria-labelledby'] ? null : popoverAriaLabel\"\n :aria-describedby=\"ariaDescribedBy\"\n :aria-required=\"required\"\n :disabled=\"disabled\"\n :error=\"!!errorMessage || !!dateErrorText\"\n :model-value=\"nativeValue\"\n :readonly=\"isReadOnly\"\n :min=\"formattedMin\"\n :max=\"formattedMax\"\n @update:model-value=\"onNativeDateInput\"\n />\n <dropdown-input-default\n v-else\n ref=\"inputContainerRef\"\n always-combobox-is-input\n :ariaControls=\"datePickerContainerId\"\n :ariaExpanded=\"isDatePickerOpen\"\n :aria-labelledby=\"label ? labelId : $attrs?.['aria-labelledby']\"\n :aria-label=\"label ? null : popoverAriaLabel\"\n :aria-describedby=\"ariaDescribedBy\"\n :aria-required=\"required\"\n :disabled=\"disabled\"\n dynamic-filtering\n :is-invalid=\"!!errorMessage || !!dateErrorText\"\n :open=\"isDatePickerOpen\"\n :value=\"textInputValue\"\n :display-value=\"dateDisplayValue\"\n :debounce-time=\"0\"\n :readonly=\"isReadOnly\"\n @input=\"onDateInputChange\"\n @open=\"openDatePicker\"\n @keydown=\"onDateKeyDown\"\n @clear=\"clearDatePickerValue\"\n @close=\"closeDatePicker\"\n />\n </div>\n\n <!-- Error Messages -->\n <error-message\n v-if=\"dateErrorText\"\n :id=\"dateErrorId\"\n :error-message=\"dateErrorText\"\n class=\"b-date-picker__error-message\"\n />\n <error-message\n v-if=\"errorMessage\"\n :id=\"errorId\"\n :error-message=\"errorMessage\"\n class=\"b-date-picker__error-message\"\n />\n\n <!-- Description -->\n <bento-typography\n v-if=\"description\"\n class=\"b-date-picker__description\"\n :class=\"descriptionConditionalClasses\"\n el=\"span\"\n >\n {{ description }}\n </bento-typography>\n\n <!-- Calendar container -->\n <bento-popover\n v-if=\"inputContainerRef && !isTouchDevice\"\n :id=\"datePickerContainerId\"\n class=\"b-date-picker__container\"\n role=\"dialog\"\n :open=\"isDatePickerOpen\"\n :target-element=\"inputContainerRef\"\n :aria-label=\"popoverAriaLabel\"\n :aria-modal=\"true\"\n position=\"bottom-start\"\n fit-content\n trap-all\n :trap-all-options=\"computedTrapAllOptions\"\n @keydown.esc.native=\"closeDatePicker\"\n >\n <calendar\n ref=\"calendarContainerRef\"\n :default-display-month=\"defaultDisplayMonth\"\n :first-day-of-week=\"resolvedFirstDayOfWeek\"\n :is-date-disabled=\"isDateDisabled\"\n :number-of-months=\"1\"\n :value=\"internalModelValue\"\n :min=\"min\"\n :max=\"max\"\n :variant=\"variant\"\n @input=\"onDateSelected\"\n />\n </bento-popover>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, nextTick, ref, toRef, watch } from 'vue';\n import { startOfMonth } from 'date-fns/startOfMonth';\n\n // Components\n import { BentoPopover } from '@/components/popover';\n import { BentoTypography } from '../typography';\n import { Calendar, type CalendarSingleDateValue, ErrorMessage, FieldLabel } from '@/internal';\n import { DropdownInputDefault } from '@/components/dropdown/components';\n import { BentoInputField } from '@/components/input-field';\n\n // Utils\n import { debounce } from '@/utils/ts/debounce';\n import { generateUid } from '@/core/utils/ts';\n import { useI18n } from '@/utils/ts/i18n';\n import { dateToNativeDateString, dateToNativeMonthString, parseNativeDateString } from '@/utils/ts/format-date';\n import { useFormFieldEmits } from '@/utils/ts/form-field/form-field';\n import { deprecate } from '@/utils/ts/deprecate';\n\n // Composables\n import { useDatePickerSingleCalendarText } from './composables/use-date-picker-single-calendar-text';\n import { useDateInputFormatter, useFirstDayOfWeek, useFormLayoutFieldLoading, useTouchDevice } from '@/composables';\n\n // Directive\n import { BentoClickOutsideDirective as vBentoClickOutsideDirective } from '@/directives';\n\n // Types\n import { type BentoDatePickerEmits, type BentoDatePickerProps } from './date-picker.types';\n\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n const DEBOUNCE_TIME = 1000;\n\n const props = defineProps({\n description: { default: undefined },\n disabled: { type: Boolean, default: false },\n errorMessage: { default: null },\n label: { default: undefined },\n optional: { type: Boolean, default: false },\n placeholder: { default: null },\n readonly: { type: Boolean, default: false },\n required: { type: Boolean, default: false },\n tooltipText: { default: null },\n defaultDisplayMonth: { default: null },\n firstDayOfWeek: { default: undefined },\n isDateDisabled: { default: undefined },\n min: { default: null },\n max: { default: null },\n modelValue: { default: null },\n value: { default: null },\n variant: { default: undefined }\n});\n\n const emit = defineEmits([\"update:model-value\", \"input\"]);\n\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n const datePickerContainerId = generateUid('bento-date-picker-container');\n const labelId = generateUid('bento-date-picker-label');\n const descriptionId = generateUid('bento-date-picker-description');\n const errorId = generateUid('bento-date-picker-error');\n const dateErrorId = generateUid('bento-date-picker-date-error');\n const popoverAriaLabel = computed(() => props.label || t('datePicker', { name: datePickerContainerId }));\n\n // Refs\n const calendarContainerRef = ref(null);\n const inputContainerRef = ref(null);\n\n // Values\n const dateError = ref<keyof MessageSchema | null>(null);\n const isDatePickerOpen = ref(false);\n const initialFocusOnDatePickerOpen = ref(undefined);\n const internalModelValue = ref<CalendarSingleDateValue | null>(props.modelValue); // to be removed when `props.value` is removed\n const { isReadOnly } = useFormLayoutFieldLoading(toRef(props, 'readonly'));\n const { emitValue } = useFormFieldEmits<CalendarSingleDateValue>(emit);\n const { resolvedFirstDayOfWeek } = useFirstDayOfWeek(toRef(props, 'firstDayOfWeek'));\n const { isFormatValid, parseDate, onKeyDown, autoFormat } = useDateInputFormatter();\n const { isTouchDevice } = useTouchDevice();\n\n const computedTrapAllOptions = computed(() => ({\n initialFocus: initialFocusOnDatePickerOpen.value,\n additionalContainers: [inputContainerRef.value.$el],\n }));\n\n watch(\n () => props.disabled,\n disabled => {\n // Close date picker popover if it's opened when it's disabled\n if (disabled && isDatePickerOpen.value) {\n isDatePickerOpen.value = false;\n }\n }\n );\n\n watch(\n [() => props.value, () => props.modelValue],\n ([newValue, newModelValue]) => {\n if (newValue) {\n deprecate(\n 'BentoDatePicker \"value\" property',\n `The use of \"value\" prop in \"BentoDatePicker\" is no longer supported. Use the \"v-model\" or \"model-value\" property instead.`,\n '2.0.0'\n );\n }\n\n internalModelValue.value = newModelValue ?? newValue;\n },\n { immediate: true }\n );\n\n const isMonthVariant = computed(() => props.variant === 'month');\n\n const { dateDisplayValue, textInputValue, formatTextInputDisplayValue } = useDatePickerSingleCalendarText({\n datePickerValue: internalModelValue,\n dateError,\n isMonthVariant,\n placeholder: toRef(props, 'placeholder'),\n });\n\n const formatNativeDate = (date: Date): string => {\n if (!date) {\n return '';\n }\n return isMonthVariant.value ? dateToNativeMonthString(date) : dateToNativeDateString(date);\n };\n\n const nativeValue = computed(() => formatNativeDate(internalModelValue.value));\n\n const onNativeDateInput = (value: string) => {\n if (!value) {\n dateError.value = null;\n emitValue(null);\n return;\n }\n\n const date = parseNativeDateString(value, isMonthVariant.value ? 'month' : 'date');\n dateError.value = getDateErrorReason(date);\n\n if (dateError.value) {\n // Emit null to match the non-touch validation behavior.\n // Note: on repeated invalid selections, the native input may still display\n // the selected date because Vue skips re-rendering when the model stays null.\n emitValue(null);\n return;\n }\n\n emitValue(date);\n };\n\n const formattedMin = computed(() => formatNativeDate(props.min));\n const formattedMax = computed(() => formatNativeDate(props.max));\n\n const getDateErrorReason = (date: Date | null): keyof MessageSchema | null => {\n if (!date || isNaN(date.getTime())) {\n return 'provideDateInAFormat';\n }\n\n // Check if date is between min/max bounds, if there are any (inclusive)\n if ((props.min && date < props.min) || (props.max && date > props.max)) {\n return 'provideDateInAFormat';\n }\n\n // Check if function is set, otherwise all dates are enabled\n if (props.isDateDisabled && props.isDateDisabled(date)) {\n return 'selectedDateIsNotAvailable';\n }\n\n return null;\n };\n\n const dateErrorText = computed(() => (dateError.value ? t(dateError.value) : null));\n\n watch(\n [isDatePickerOpen, textInputValue, () => props.isDateDisabled, () => props.min, () => props.max],\n ([isOpen, textValue]) => {\n // Re-validate the current input when the picker closes, validation props change or text input change\n if (!isOpen && textValue && isFormatValid(textValue)) {\n dateError.value = getDateErrorReason(parseDate(textValue));\n }\n }\n );\n\n const descriptionConditionalClasses = computed(() => ({\n 'b-date-picker__description--error': props.errorMessage || dateErrorText.value,\n }));\n\n const ariaDescribedBy = computed(\n () =>\n `${props.description ? descriptionId : ''} ${props.errorMessage ? errorId : ''} ${\n dateErrorText.value ? dateErrorId : ''\n }`.trim() || null\n );\n\n const closeDatePicker = () => {\n isDatePickerOpen.value = false;\n };\n\n const openDatePicker = () => {\n isDatePickerOpen.value = true;\n\n formatTextInputDisplayValue();\n };\n\n const onDateSelected = (selectedDate: Date) => {\n // Reset the error state when a valid date is selected\n dateError.value = null;\n\n closeDatePicker();\n emitValue(selectedDate);\n };\n\n const clearDatePickerValue = async () => {\n if (dateError.value) {\n dateError.value = null;\n textInputValue.value = null;\n }\n emitValue(null);\n };\n\n const onDateKeyDown = (event: KeyboardEvent) => {\n onKeyDown(event);\n };\n\n const validateDate = (stringDate: string) => {\n // Validate only if the date is complete\n if (stringDate.length < 10) {\n return;\n }\n\n const parsedDate = isFormatValid(stringDate) ? parseDate(stringDate) : null;\n const errorKey = getDateErrorReason(parsedDate);\n\n if (!errorKey && parsedDate) {\n dateError.value = null;\n emitValue(parsedDate);\n } else if (stringDate) {\n dateError.value = errorKey || 'provideDateInAFormat';\n emitValue(null);\n }\n };\n\n const validateDateDebounced = debounce(validateDate, DEBOUNCE_TIME);\n\n const onDateInputChange = (stringDate: string) => {\n textInputValue.value = autoFormat(stringDate);\n // If we are closing the date picker, we should validate (and emit date inputs) immediately so the user doesn't have to wait for the debounce time.\n // On touch devices with native input, we also want immediate feedback.\n if (isDatePickerOpen.value || isTouchDevice.value) {\n validateDate(textInputValue.value);\n } else {\n validateDateDebounced(textInputValue.value);\n }\n };\n\n /**\n * Space bar and Enter keyDown event handler.\n *\n * * Opens the date picker dialog on the first keydown.\n * * Move focus to selected date, i.e., the date displayed in the date input text field. If no date has been selected, places focus on the current date.\n * @param {KeyboardEvent} event Event being triggered\n */\n const onSpaceBarOrEnter = async (event: KeyboardEvent) => {\n if (isDatePickerOpen.value) {\n return;\n }\n event.preventDefault();\n\n openDatePicker();\n\n // Wait for the date picker dialog to open\n await nextTick();\n\n // Set current date (today) if no date is selected\n if (!internalModelValue.value) {\n // Format the opened date picker date to YYYY-MM-DD\n formatTextInputDisplayValue(new Date());\n emitValue(new Date());\n }\n\n // Set initial focus\n initialFocusOnDatePickerOpen.value =\n calendarContainerRef.value?.$refs.calendarRef[0].focusOnDate(\n props.variant === 'month' ? startOfMonth(internalModelValue.value) : internalModelValue.value,\n true\n ) ?? undefined;\n };\n</script>\n\n<script lang=\"ts\">\n /**\n * Date picker selector.\n *\n * @example\n * import { BentoDatePicker } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoDatePicker },\n * template: `\n * <bento-date-picker\n * label=\"Label\"\n * description=\"Supporting text\"\n * required\n * optional\n * disabled\n * @input=\"onDateChanged\"\n * v-model=\"selectedDate\"\n * />\n * `,\n * setup() {\n * const selectedDate = ref(new Date()); // reactive({ startDate: new Date(), endDate: new Date() })\n * return {\n * selectedDate,\n * }\n * }\n * }\n */\n export default {\n i18n: { messages },\n name: 'bento-date-picker',\n model: { prop: 'modelValue' },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./date-picker.scss\" />\n"],"names":["useDatePickerSingleCalendarText","datePickerValue","dateError","isMonthVariant","placeholder","locale","t","useI18n","formatDate","useDateInputFormatter","textInputValue","ref","_a","computed","dateFormatOptions","getDateTimeFormatter","dateToFormat","date","startOfMonth","__default__","messages","DEBOUNCE_TIME","datePickerContainerId","generateUid","labelId","descriptionId","errorId","dateErrorId","popoverAriaLabel","props","calendarContainerRef","inputContainerRef","isDatePickerOpen","initialFocusOnDatePickerOpen","internalModelValue","isReadOnly","useFormLayoutFieldLoading","toRef","emitValue","useFormFieldEmits","emit","resolvedFirstDayOfWeek","useFirstDayOfWeek","isFormatValid","parseDate","onKeyDown","autoFormat","isTouchDevice","useTouchDevice","computedTrapAllOptions","watch","disabled","newValue","newModelValue","deprecate","dateDisplayValue","formatTextInputDisplayValue","formatNativeDate","dateToNativeMonthString","dateToNativeDateString","nativeValue","onNativeDateInput","value","parseNativeDateString","getDateErrorReason","formattedMin","formattedMax","dateErrorText","isOpen","textValue","descriptionConditionalClasses","ariaDescribedBy","closeDatePicker","openDatePicker","onDateSelected","selectedDate","clearDatePickerValue","onDateKeyDown","event","validateDate","stringDate","parsedDate","errorKey","validateDateDebounced","debounce","nextTick"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgBOA,KAAA,CAAA;AAAA,EAAmE,iBAAAC;AAAA,EACtE,WAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,aAAAC;AAEJ,MAAA;;AACI,QAAA,EAAA,QAAAC,GAAA,GAAAC,EAAA,IAAAC,EAAA,GACA,EAAA,YAAAC,EAAA,IAAAC,EAAA,GAEAC,IAAAC,GAAAC,IAAAX,EAAA,UAAA,gBAAAW,EAAA,cAAA;AAyCA,SAAA;AAAA;AAAA,IAAO,kBAvCPC,EAAA,MAAA;AAEI,UAAAX,EAAA;AACI,eAAAQ,EAAA;AAIJ,UAAA,CAAAT,EAAA;AACI,gBAAAG,KAAA,gBAAAA,EAAA,UAAAE,EAAA,YAAA;AAKJ,YAAAQ,IAAAX,KAAA,QAAAA,EAAA,QAAA,EAAA,OAAA,QAAA,MAAA,UAAA,IAAA,EAAA,KAAA,WAAA,OAAA,SAAA,MAAA,UAAA;AAIA,aAAAY,GAAAV,EAAA,OAAAS,CAAA,EAAA,OAAAb,EAAA,KAAA;AAAA,IAAyF,CAA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