@adyen/bento-vue2 1.79.1 → 1.80.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 (180) hide show
  1. package/dist/@types/index.d.ts +399 -920
  2. package/dist/action-bar.js +1 -1
  3. package/dist/assets/accordion-item.css +1 -1
  4. package/dist/assets/action-bar.css +1 -1
  5. package/dist/assets/base-modal.css +1 -1
  6. package/dist/assets/button-actions.css +1 -1
  7. package/dist/assets/card.css +1 -1
  8. package/dist/assets/data-grid.css +1 -1
  9. package/dist/assets/date-picker.css +1 -1
  10. package/dist/assets/dialog-page.css +1 -1
  11. package/dist/assets/file-uploader.css +1 -1
  12. package/dist/assets/filter-bar.css +1 -1
  13. package/dist/assets/focus-trap.css +1 -1
  14. package/dist/assets/inspector.css +1 -1
  15. package/dist/assets/modal-fullscreen.css +1 -1
  16. package/dist/assets/sidepanel.css +1 -1
  17. package/dist/assets/timeline-item.css +1 -1
  18. package/dist/button.js +1 -1
  19. package/dist/card.js +1 -1
  20. package/dist/checkbox.js +3 -3
  21. package/dist/chunks/{action-bar.DOaFj-A2.js → action-bar.DYH79CCh.js} +3 -3
  22. package/dist/chunks/{action-bar.DOaFj-A2.js.map → action-bar.DYH79CCh.js.map} +1 -1
  23. package/dist/chunks/{base-modal.BJ6315kP.js → base-modal.MpaQpAHB.js} +3 -3
  24. package/dist/chunks/{base-modal.BJ6315kP.js.map → base-modal.MpaQpAHB.js.map} +1 -1
  25. package/dist/chunks/{button-actions-with-menu.DPKvfKJY.js → button-actions-with-menu.ouuwtS1H.js} +2 -2
  26. package/dist/chunks/{button-actions-with-menu.DPKvfKJY.js.map → button-actions-with-menu.ouuwtS1H.js.map} +1 -1
  27. package/dist/chunks/{button-actions.C3cP-anb.js → button-actions.BoZOEVZi.js} +2 -2
  28. package/dist/chunks/{button-actions.C3cP-anb.js.map → button-actions.BoZOEVZi.js.map} +1 -1
  29. package/dist/chunks/{card.XfRuWGfC.js → card.BEM0inJ6.js} +2 -2
  30. package/dist/chunks/{card.XfRuWGfC.js.map → card.BEM0inJ6.js.map} +1 -1
  31. package/dist/chunks/{checkbox-group.h4OYdn9w.js → checkbox-group.CIIa-cYP.js} +25 -25
  32. package/dist/chunks/{checkbox-group.h4OYdn9w.js.map → checkbox-group.CIIa-cYP.js.map} +1 -1
  33. package/dist/chunks/{checkbox.CwOK7ss2.js → checkbox.CiWvdg8S.js} +3 -3
  34. package/dist/chunks/{checkbox.CwOK7ss2.js.map → checkbox.CiWvdg8S.js.map} +1 -1
  35. package/dist/chunks/{code-snippet.bzFOFUj4.js → code-snippet.CL3-Y8Az.js} +4 -4
  36. package/dist/chunks/{code-snippet.bzFOFUj4.js.map → code-snippet.CL3-Y8Az.js.map} +1 -1
  37. package/dist/chunks/{controls-group.D62vSDSk.js → controls-group.GchVWe7h.js} +2 -2
  38. package/dist/chunks/{controls-group.D62vSDSk.js.map → controls-group.GchVWe7h.js.map} +1 -1
  39. package/dist/chunks/{copy.Hu3DFJwv.js → copy.DauzzgJV.js} +3 -3
  40. package/dist/chunks/{copy.Hu3DFJwv.js.map → copy.DauzzgJV.js.map} +1 -1
  41. package/dist/chunks/{dashboard-section.BvGMr9Vl.js → dashboard-section.DiCeWZh1.js} +2 -2
  42. package/dist/chunks/{dashboard-section.BvGMr9Vl.js.map → dashboard-section.DiCeWZh1.js.map} +1 -1
  43. package/dist/chunks/{dashed-underline.D107w00E.js → dashed-underline.BfQuyT28.js} +3 -3
  44. package/dist/chunks/{dashed-underline.D107w00E.js.map → dashed-underline.BfQuyT28.js.map} +1 -1
  45. package/dist/chunks/{data-grid-template.DShJunDa.js → data-grid-template.Co0jg7Gj.js} +3 -3
  46. package/dist/chunks/{data-grid-template.DShJunDa.js.map → data-grid-template.Co0jg7Gj.js.map} +1 -1
  47. package/dist/chunks/{data-grid.C8gSMQ0A.js → data-grid.CcddqHWZ.js} +238 -226
  48. package/dist/chunks/data-grid.CcddqHWZ.js.map +1 -0
  49. package/dist/chunks/{date-picker.Dvx50znw.js → date-picker.D-7m8ONP.js} +71 -70
  50. package/dist/chunks/date-picker.D-7m8ONP.js.map +1 -0
  51. package/dist/chunks/{date-range-picker.DYYyE_e2.js → date-range-picker.CvxP8n0I.js} +6 -6
  52. package/dist/chunks/{date-range-picker.DYYyE_e2.js.map → date-range-picker.CvxP8n0I.js.map} +1 -1
  53. package/dist/chunks/{dropdown-tag.Ctn5KMFU.js → dropdown-tag.B2Ot75dU.js} +3 -3
  54. package/dist/chunks/{dropdown-tag.Ctn5KMFU.js.map → dropdown-tag.B2Ot75dU.js.map} +1 -1
  55. package/dist/chunks/{dropdown.BpT6ct8O.js → dropdown.BLgcbjv8.js} +5 -5
  56. package/dist/chunks/{dropdown.BpT6ct8O.js.map → dropdown.BLgcbjv8.js.map} +1 -1
  57. package/dist/chunks/es6.MoTTyETW.js.map +1 -1
  58. package/dist/chunks/{field-label.C3h8Q8Xd.js → field-label.DHGAa4cq.js} +2 -2
  59. package/dist/chunks/{field-label.C3h8Q8Xd.js.map → field-label.DHGAa4cq.js.map} +1 -1
  60. package/dist/chunks/{file-uploader.CK6dhx8T.js → file-uploader.QLtB254W.js} +3 -3
  61. package/dist/chunks/{file-uploader.CK6dhx8T.js.map → file-uploader.QLtB254W.js.map} +1 -1
  62. package/dist/chunks/filter-bar.DLAT3ops.js +2461 -0
  63. package/dist/chunks/filter-bar.DLAT3ops.js.map +1 -0
  64. package/dist/chunks/{focus-trap.BJfpIboH.js → focus-trap.CNIU5jOz.js} +53 -50
  65. package/dist/chunks/focus-trap.CNIU5jOz.js.map +1 -0
  66. package/dist/chunks/{footer-actions.DPjWGWhJ.js → footer-actions.BA1gX7_s.js} +2 -2
  67. package/dist/chunks/{footer-actions.DPjWGWhJ.js.map → footer-actions.BA1gX7_s.js.map} +1 -1
  68. package/dist/chunks/{header-meta.qT3_T35I.js → header-meta.B0KYY5s_.js} +3 -3
  69. package/dist/chunks/{header-meta.qT3_T35I.js.map → header-meta.B0KYY5s_.js.map} +1 -1
  70. package/dist/chunks/{header-with-views.DnGWHrWw.js → header-with-views.D0zXZ9Jh.js} +8 -8
  71. package/dist/chunks/{header-with-views.DnGWHrWw.js.map → header-with-views.D0zXZ9Jh.js.map} +1 -1
  72. package/dist/chunks/{header.CLDtv3Ir.js → header.BwS-1scb.js} +3 -3
  73. package/dist/chunks/{header.CLDtv3Ir.js.map → header.BwS-1scb.js.map} +1 -1
  74. package/dist/chunks/{info-icon.DGrrXpIY.js → info-icon.iKLaNff6.js} +3 -3
  75. package/dist/chunks/{info-icon.DGrrXpIY.js.map → info-icon.iKLaNff6.js.map} +1 -1
  76. package/dist/chunks/{input-field-password.uhQuUzyj.js → input-field-password.DVC_KSqj.js} +5 -5
  77. package/dist/chunks/{input-field-password.uhQuUzyj.js.map → input-field-password.DVC_KSqj.js.map} +1 -1
  78. package/dist/chunks/{input-field-phone-number.BdbaTJwH.js → input-field-phone-number.DcY0wFJH.js} +3 -3
  79. package/dist/chunks/{input-field-phone-number.BdbaTJwH.js.map → input-field-phone-number.DcY0wFJH.js.map} +1 -1
  80. package/dist/chunks/{input-field.C4XJ53Cn.js → input-field.MpAZisFn.js} +3 -3
  81. package/dist/chunks/{input-field.C4XJ53Cn.js.map → input-field.MpAZisFn.js.map} +1 -1
  82. package/dist/chunks/{inspector.pmpheRch.js → inspector.C6bbjQC0.js} +2 -2
  83. package/dist/chunks/{inspector.pmpheRch.js.map → inspector.C6bbjQC0.js.map} +1 -1
  84. package/dist/chunks/{listbox-option-tag.B94BtpSU.js → listbox-option-tag.CK628fjn.js} +2 -2
  85. package/dist/chunks/{listbox-option-tag.B94BtpSU.js.map → listbox-option-tag.CK628fjn.js.map} +1 -1
  86. package/dist/chunks/{modal-fullscreen.B3Xx-Hoc.js → modal-fullscreen.B9onBrN-.js} +3 -3
  87. package/dist/chunks/{modal-fullscreen.B3Xx-Hoc.js.map → modal-fullscreen.B9onBrN-.js.map} +1 -1
  88. package/dist/chunks/{modal.D3OSxMF6.js → modal.BgimE0kj.js} +4 -4
  89. package/dist/chunks/{modal.D3OSxMF6.js.map → modal.BgimE0kj.js.map} +1 -1
  90. package/dist/chunks/{pagination.Bvhpu21H.js → pagination.DcTUYJsK.js} +2 -2
  91. package/dist/chunks/{pagination.Bvhpu21H.js.map → pagination.DcTUYJsK.js.map} +1 -1
  92. package/dist/chunks/popover.types.WDh5ggr3.js +6 -0
  93. package/dist/chunks/{popover.types.DK6opPkz.js.map → popover.types.WDh5ggr3.js.map} +1 -1
  94. package/dist/chunks/{popper-container.agLYtGwv.js → popper-container.Cdokz_NE.js} +2 -2
  95. package/dist/chunks/{popper-container.agLYtGwv.js.map → popper-container.Cdokz_NE.js.map} +1 -1
  96. package/dist/chunks/{radio-group.BTu23ZgN.js → radio-group.Cr7UcYij.js} +4 -4
  97. package/dist/chunks/{radio-group.BTu23ZgN.js.map → radio-group.Cr7UcYij.js.map} +1 -1
  98. package/dist/chunks/{rich-text-editor.xXfZRlsV.js → rich-text-editor.Bu4pffp2.js} +4 -4
  99. package/dist/chunks/{rich-text-editor.xXfZRlsV.js.map → rich-text-editor.Bu4pffp2.js.map} +1 -1
  100. package/dist/chunks/{search-bar.BcHoTrjP.js → search-bar.C41ZmlHr.js} +3 -3
  101. package/dist/chunks/{search-bar.BcHoTrjP.js.map → search-bar.C41ZmlHr.js.map} +1 -1
  102. package/dist/chunks/{secondary-nav.DEThy9WH.js → secondary-nav.R6nXAdRN.js} +2 -2
  103. package/dist/chunks/{secondary-nav.DEThy9WH.js.map → secondary-nav.R6nXAdRN.js.map} +1 -1
  104. package/dist/chunks/{segmented-control.Dj_ZKhmU.js → segmented-control._CuB62pG.js} +2 -2
  105. package/dist/chunks/{segmented-control.Dj_ZKhmU.js.map → segmented-control._CuB62pG.js.map} +1 -1
  106. package/dist/chunks/{selection-card-group.cD72SQlR.js → selection-card-group.jykyd9iE.js} +3 -3
  107. package/dist/chunks/{selection-card-group.cD72SQlR.js.map → selection-card-group.jykyd9iE.js.map} +1 -1
  108. package/dist/chunks/{sidepanel.ClG3dhHf.js → sidepanel.ztFrPPdy.js} +3 -3
  109. package/dist/chunks/{sidepanel.ClG3dhHf.js.map → sidepanel.ztFrPPdy.js.map} +1 -1
  110. package/dist/chunks/{structured-list-item.zoY-ATTu.js → structured-list-item.BLJabJwA.js} +4 -4
  111. package/dist/chunks/{structured-list-item.zoY-ATTu.js.map → structured-list-item.BLJabJwA.js.map} +1 -1
  112. package/dist/chunks/{summary-grid.types.BA0XCVKK.js → summary-grid.types.C2LMzLj-.js} +5 -5
  113. package/dist/chunks/{summary-grid.types.BA0XCVKK.js.map → summary-grid.types.C2LMzLj-.js.map} +1 -1
  114. package/dist/chunks/{tag.BdCP2CN_.js → tag.7fp_M9Au.js} +2 -2
  115. package/dist/chunks/{tag.BdCP2CN_.js.map → tag.7fp_M9Au.js.map} +1 -1
  116. package/dist/chunks/{textarea.DaNiOOJ7.js → textarea.Ci9sKDFy.js} +2 -2
  117. package/dist/chunks/{textarea.DaNiOOJ7.js.map → textarea.Ci9sKDFy.js.map} +1 -1
  118. package/dist/chunks/timeline-item.DRA5mfHH.js +255 -0
  119. package/dist/chunks/timeline-item.DRA5mfHH.js.map +1 -0
  120. package/dist/chunks/{tooltip.Dt87KVh2.js → tooltip.BcQ24pKP.js} +2 -2
  121. package/dist/chunks/{tooltip.Dt87KVh2.js.map → tooltip.BcQ24pKP.js.map} +1 -1
  122. package/dist/chunks/{tutorial.C-q4mxUb.js → tutorial.DVGxYGkx.js} +4 -4
  123. package/dist/chunks/{tutorial.C-q4mxUb.js.map → tutorial.DVGxYGkx.js.map} +1 -1
  124. package/dist/chunks/{use-cached-selected-values.FoXcm49J.js → use-cached-selected-values.nu4EL9kL.js} +2 -2
  125. package/dist/chunks/{use-cached-selected-values.FoXcm49J.js.map → use-cached-selected-values.nu4EL9kL.js.map} +1 -1
  126. package/dist/code-snippet.js +1 -1
  127. package/dist/dashboard-template.js +1 -1
  128. package/dist/dashed-underline.js +1 -1
  129. package/dist/data-grid-template.js +1 -1
  130. package/dist/data-grid.js +1 -1
  131. package/dist/date-picker.js +1 -1
  132. package/dist/date-range-picker.js +1 -1
  133. package/dist/dropdown.js +3 -3
  134. package/dist/file-uploader.js +1 -1
  135. package/dist/filter-bar.js +1 -1
  136. package/dist/focus-trap.js +1 -1
  137. package/dist/header-with-views.js +1 -1
  138. package/dist/header.js +1 -1
  139. package/dist/index.js +359 -396
  140. package/dist/index.js.map +1 -1
  141. package/dist/info-icon.js +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/inspector.js +1 -1
  146. package/dist/internal.js +9 -9
  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 +2 -2
  152. package/dist/popper-container.js +1 -1
  153. package/dist/radio-group.js +1 -1
  154. package/dist/rich-text-editor.js +1 -1
  155. package/dist/search-bar.js +2 -2
  156. package/dist/secondary-nav.js +1 -1
  157. package/dist/segmented-control.js +1 -1
  158. package/dist/selection-card.js +1 -1
  159. package/dist/sidepanel.js +1 -1
  160. package/dist/structured-list.js +1 -1
  161. package/dist/styles/bento-dark.css +4 -0
  162. package/dist/styles/bento-light.css +4 -0
  163. package/dist/styles/bento.css +4 -0
  164. package/dist/styles/legacy.css +4 -0
  165. package/dist/styles/styleguide.css +4 -0
  166. package/dist/summary-grid.js +1 -1
  167. package/dist/tag.js +1 -1
  168. package/dist/textarea.js +1 -1
  169. package/dist/timeline.js +1 -1
  170. package/dist/tutorial.js +1 -1
  171. package/dist/web-types.json +362 -145
  172. package/package.json +3 -3
  173. package/dist/chunks/data-grid.C8gSMQ0A.js.map +0 -1
  174. package/dist/chunks/date-picker.Dvx50znw.js.map +0 -1
  175. package/dist/chunks/filter-bar.DpjD5bZe.js +0 -2277
  176. package/dist/chunks/filter-bar.DpjD5bZe.js.map +0 -1
  177. package/dist/chunks/focus-trap.BJfpIboH.js.map +0 -1
  178. package/dist/chunks/popover.types.DK6opPkz.js +0 -6
  179. package/dist/chunks/timeline-item.D2HsuNh-.js +0 -375
  180. package/dist/chunks/timeline-item.D2HsuNh-.js.map +0 -1
@@ -1,21 +1,21 @@
1
- import { ref as d, computed as D, defineComponent as j, toRef as F, watch as M, nextTick as z } from "vue";
2
- import { f as V, s as A, b as G } from "./calendar.Bhj58zR3.js";
3
- import { g as H } from "./button-actions.C3cP-anb.js";
4
- import { d as J, B as Q } from "./typography.hlOAxsEn.js";
5
- import { d as X } from "./debounce.DUTu11PS.js";
6
- import { D as E, v as Z, f as $ } from "./date-format.B8RU7D42.js";
1
+ import { ref as d, computed as c, defineComponent as z, toRef as F, watch as A, nextTick as G } from "vue";
2
+ import { f as M, s as V, b as H } from "./calendar.Bhj58zR3.js";
3
+ import { g as J } from "./button-actions.BoZOEVZi.js";
4
+ import { d as Q, B as X } from "./typography.hlOAxsEn.js";
5
+ import { d as Z } from "./debounce.DUTu11PS.js";
6
+ import { D as O, v as $, f as ee } from "./date-format.B8RU7D42.js";
7
7
  import { g as b } from "./generate-uid.NJ8tVoha.js";
8
8
  import { u as L } from "./index.B6WW_F-J.js";
9
- import { u as ee } from "./form-field.D_2g7vaP.js";
10
- import { g as ae } from "./differenceInMonths.Cab3nOsb.js";
11
- import { u as te } from "./use-form-layout-loading.CWbjZiwP.js";
9
+ import { u as ae } from "./form-field.D_2g7vaP.js";
10
+ import { g as te } from "./differenceInMonths.Cab3nOsb.js";
11
+ import { u as re } from "./use-form-layout-loading.CWbjZiwP.js";
12
12
  import "./index.Cl4_42j5.js";
13
- import { D as re } from "./dropdown-default-textbox.uWZMxeI7.js";
14
- import { B as le } from "./directive.Cbdox5VL.js";
15
- import { F as ne, E as oe } from "./field-label.C3h8Q8Xd.js";
16
- import { n as ie } from "./_plugin-vue2_normalizer.CeySl7Fu.js";
13
+ import { D as le } from "./dropdown-default-textbox.uWZMxeI7.js";
14
+ import { B as oe } from "./directive.Cbdox5VL.js";
15
+ import { F as ne, E as ie } from "./field-label.DHGAa4cq.js";
16
+ import { n as se } from "./_plugin-vue2_normalizer.CeySl7Fu.js";
17
17
  import "../assets/date-picker.css";
18
- const se = {
18
+ const ue = {
19
19
  "en-US": {
20
20
  datePicker: "Date picker",
21
21
  provideDateInAFormat: "Provide date in a YYYY-MM-DD format",
@@ -31,44 +31,44 @@ const se = {
31
31
  datePicker: "Seletor de datas",
32
32
  selectDate: "Selecione uma data"
33
33
  }
34
- }, ue = ({
34
+ }, de = ({
35
35
  datePickerValue: s,
36
36
  isDateIncorrect: t,
37
37
  isMonthVariant: a,
38
38
  placeholder: e
39
39
  }) => {
40
40
  var y;
41
- const { locale: l, t: k } = L(), c = ae(), p = d((y = s.value) == null ? void 0 : y.toDateString());
41
+ const { locale: l, t: k } = L(), p = te(), f = d((y = s.value) == null ? void 0 : y.toDateString());
42
42
  return {
43
43
  // Values
44
- dateDisplayValue: D(() => {
45
- var o;
46
- return t.value ? p.value : s.value ? V(
44
+ dateDisplayValue: c(() => {
45
+ var n;
46
+ return t.value ? f.value : s.value ? M(
47
47
  s.value,
48
- a != null && a.value ? E.LONG_MONTH_YEAR : E.FULL_DATE,
48
+ a != null && a.value ? O.LONG_MONTH_YEAR : O.FULL_DATE,
49
49
  {
50
- locale: c[(o = l.value) == null ? void 0 : o.substring(0, 2)] || c.enUS
50
+ locale: p[(n = l.value) == null ? void 0 : n.substring(0, 2)] || p.enUS
51
51
  }
52
52
  ) : (e == null ? void 0 : e.value) || k("selectDate");
53
53
  }),
54
- textInputValue: p,
54
+ textInputValue: f,
55
55
  // Methods
56
- formatTextInputDisplayValue: (o = s.value) => {
57
- var n;
56
+ formatTextInputDisplayValue: (n = s.value) => {
57
+ var o;
58
58
  if (t.value)
59
59
  return;
60
- const C = a != null && a.value ? A(o) : o;
61
- p.value = o ? V(C, E.NUMERIC_DATE_YEAR_FIRST, {
62
- locale: c[(n = l.value) == null ? void 0 : n.substring(0, 2)] || c.enUS
60
+ const _ = a != null && a.value ? V(n) : n;
61
+ f.value = n ? M(_, O.NUMERIC_DATE_YEAR_FIRST, {
62
+ locale: p[(o = l.value) == null ? void 0 : o.substring(0, 2)] || p.enUS
63
63
  }) : null;
64
64
  }
65
65
  };
66
- }, de = {
67
- i18n: { messages: se },
66
+ }, ce = {
67
+ i18n: { messages: ue },
68
68
  name: "bento-date-picker",
69
69
  model: { prop: "modelValue" }
70
- }, ce = /* @__PURE__ */ j({
71
- ...de,
70
+ }, pe = /* @__PURE__ */ z({
71
+ ...ce,
72
72
  props: {
73
73
  description: { default: void 0 },
74
74
  disabled: { type: Boolean, default: !1 },
@@ -90,79 +90,80 @@ const se = {
90
90
  },
91
91
  emits: ["update:model-value", "input"],
92
92
  setup(s, { emit: t }) {
93
- const a = s, e = 1e3, { t: l } = L(), k = b("bento-date-picker-container"), c = b("bento-date-picker-label"), p = b("bento-date-picker-description"), _ = b("bento-date-picker-error"), g = b("bento-date-picker-date-error"), y = D(() => a.label || l("datePicker", { name: k })), o = d(null), C = d(null), n = d(!1), i = d(!1), O = d(void 0), f = d(a.modelValue), { isReadOnly: h } = te(F(a, "readonly")), { emitValue: m } = ee(t);
94
- M(
93
+ const a = s, e = 1e3, { t: l } = L(), k = b("bento-date-picker-container"), p = b("bento-date-picker-label"), f = b("bento-date-picker-description"), g = b("bento-date-picker-error"), C = b("bento-date-picker-date-error"), y = c(() => a.label || l("datePicker", { name: k })), n = d(null), _ = d(null), o = d(!1), i = d(!1), I = d(void 0), m = d(a.modelValue), { isReadOnly: h } = re(F(a, "readonly")), { emitValue: v } = ae(t), U = c(() => ({
94
+ initialFocus: I.value,
95
+ additionalContainers: [_.value.$el]
96
+ }));
97
+ A(
95
98
  () => a.disabled,
96
99
  (r) => {
97
100
  r && i.value && (i.value = !1);
98
101
  }
99
- ), M(
102
+ ), A(
100
103
  [() => a.value, () => a.modelValue],
101
- ([r, v]) => {
102
- r && J(
104
+ ([r, D]) => {
105
+ r && Q(
103
106
  'BentoDatePicker "value" property',
104
107
  'The use of "value" prop in "BentoDatePicker" is no longer supported. Use the "v-model" or "model-value" property instead.',
105
108
  "2.0.0"
106
- ), f.value = v ?? r;
109
+ ), m.value = D ?? r;
107
110
  },
108
111
  { immediate: !0 }
109
112
  );
110
- const B = D(() => a.variant === "month"), { dateDisplayValue: U, textInputValue: u, formatTextInputDisplayValue: I } = ue({
111
- datePickerValue: f,
112
- isDateIncorrect: n,
113
+ const B = c(() => a.variant === "month"), { dateDisplayValue: N, textInputValue: u, formatTextInputDisplayValue: x } = de({
114
+ datePickerValue: m,
115
+ isDateIncorrect: o,
113
116
  isMonthVariant: B,
114
117
  placeholder: F(a, "placeholder")
115
- }), x = D(() => a.isDateDisabled && u.value && a.isDateDisabled(new Date(u.value)) && !i.value ? l("selectedDateIsNotAvailable") : n.value ? l("provideDateInAFormat") : null), N = D(() => ({
116
- "b-date-picker__description--error": a.errorMessage || x.value
117
- })), Y = D(
118
- () => `${a.description ? p : ""} ${a.errorMessage ? _ : ""} ${x.value ? g : ""}`.trim() || null
119
- ), R = (r) => a.min && r <= a.min || a.max && r >= a.max ? !1 : a.isDateDisabled ? !a.isDateDisabled(r) : !0, S = () => {
118
+ }), E = c(() => a.isDateDisabled && u.value && a.isDateDisabled(new Date(u.value)) && !i.value ? l("selectedDateIsNotAvailable") : o.value ? l("provideDateInAFormat") : null), Y = c(() => ({
119
+ "b-date-picker__description--error": a.errorMessage || E.value
120
+ })), q = c(
121
+ () => `${a.description ? f : ""} ${a.errorMessage ? g : ""} ${E.value ? C : ""}`.trim() || null
122
+ ), R = (r) => a.min && r <= a.min || a.max && r >= a.max ? !1 : a.isDateDisabled ? !a.isDateDisabled(r) : !0, T = () => {
120
123
  i.value = !1;
121
- }, T = () => {
122
- i.value = !0, I();
123
- }, q = (r) => {
124
- n.value = !1, S(), m(r);
125
- }, K = async () => {
126
- n.value && (n.value = !1, u.value = null), m(null);
127
- }, W = (r) => {
128
- Z(r);
124
+ }, S = () => {
125
+ i.value = !0, x();
126
+ }, K = (r) => {
127
+ o.value = !1, T(), v(r);
128
+ }, W = async () => {
129
+ o.value && (o.value = !1, u.value = null), v(null);
130
+ }, j = (r) => {
131
+ $(r);
129
132
  }, P = (r) => {
130
133
  if (r.length < 10)
131
134
  return;
132
- /^\d{4}-(0?[1-9]|1[012])-(0?[1-9]|[12][0-9]|3[01])$/.test(r) && R(new Date(r)) ? (n.value = !1, m(new Date(r))) : r && (n.value = !0, m(null));
133
- }, w = X(P, e);
134
- return { __sfc: !0, DEBOUNCE_TIME: e, props: a, emit: t, t: l, datePickerContainerId: k, labelId: c, descriptionId: p, errorId: _, dateErrorId: g, popoverAriaLabel: y, calendarContainerRef: o, inputContainerRef: C, isDateIncorrect: n, isDatePickerOpen: i, initialFocusOnDatePickerOpen: O, internalModelValue: f, isReadOnly: h, emitValue: m, isMonthVariant: B, dateDisplayValue: U, textInputValue: u, formatTextInputDisplayValue: I, dateErrorText: x, descriptionConditionalClasses: N, ariaDescribedBy: Y, isDateEnabled: R, closeDatePicker: S, openDatePicker: T, onDateSelected: q, clearDatePickerValue: K, onDateKeyDown: W, validateDate: P, validateDateDebounced: w, onDateInputChange: (r) => {
135
- u.value = $(r), i.value ? w(u.value) : P(u.value);
135
+ /^\d{4}-(0?[1-9]|1[012])-(0?[1-9]|[12][0-9]|3[01])$/.test(r) && R(new Date(r)) ? (o.value = !1, v(new Date(r))) : r && (o.value = !0, v(null));
136
+ }, w = Z(P, e);
137
+ return { __sfc: !0, DEBOUNCE_TIME: e, props: a, emit: t, t: l, datePickerContainerId: k, labelId: p, descriptionId: f, errorId: g, dateErrorId: C, popoverAriaLabel: y, calendarContainerRef: n, inputContainerRef: _, isDateIncorrect: o, isDatePickerOpen: i, initialFocusOnDatePickerOpen: I, internalModelValue: m, isReadOnly: h, emitValue: v, computedTrapAllOptions: U, isMonthVariant: B, dateDisplayValue: N, textInputValue: u, formatTextInputDisplayValue: x, dateErrorText: E, descriptionConditionalClasses: Y, ariaDescribedBy: q, isDateEnabled: R, closeDatePicker: T, openDatePicker: S, onDateSelected: K, clearDatePickerValue: W, onDateKeyDown: j, validateDate: P, validateDateDebounced: w, onDateInputChange: (r) => {
138
+ u.value = ee(r), i.value ? w(u.value) : P(u.value);
136
139
  }, onSpaceBarOrEnter: async (r) => {
137
- var v;
138
- i.value || (r.preventDefault(), T(), await z(), f.value || (I(/* @__PURE__ */ new Date()), m(/* @__PURE__ */ new Date())), O.value = ((v = o.value) == null ? void 0 : v.$refs.calendarRef[0].focusOnDate(
139
- a.variant === "month" ? A(f.value) : f.value,
140
+ var D;
141
+ i.value || (r.preventDefault(), S(), await G(), m.value || (x(/* @__PURE__ */ new Date()), v(/* @__PURE__ */ new Date())), I.value = ((D = n.value) == null ? void 0 : D.$refs.calendarRef[0].focusOnDate(
142
+ a.variant === "month" ? V(m.value) : m.value,
140
143
  !0
141
144
  )) ?? void 0);
142
- }, BentoPopover: H, BentoTypography: Q, Calendar: G, ErrorMessage: oe, FieldLabel: ne, DropdownInputDefault: re, vBentoClickOutsideDirective: le };
145
+ }, BentoPopover: J, BentoTypography: X, Calendar: H, ErrorMessage: ie, FieldLabel: ne, DropdownInputDefault: le, vBentoClickOutsideDirective: oe };
143
146
  }
144
147
  });
145
- var pe = function() {
148
+ var fe = function() {
146
149
  var t = this, a = t._self._c, e = t._self._setupProxy;
147
150
  return a("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) {
148
151
  return !l.type.indexOf("key") && t._k(l.keyCode, "space", 32, l.key, [" ", "Spacebar"]) ? null : e.onSpaceBarOrEnter.apply(null, arguments);
149
152
  }, function(l) {
150
153
  return !l.type.indexOf("key") && t._k(l.keyCode, "enter", 13, l.key, "Enter") ? null : e.onSpaceBarOrEnter.apply(null, arguments);
151
- }] } }, [t.label ? a(e.FieldLabel, { attrs: { id: e.labelId, label: t.label, "tooltip-text": t.tooltipText, optional: t.optional, required: t.required } }) : t._e(), a("div", [a(e.DropdownInputDefault, { ref: "inputContainerRef", attrs: { "always-combobox-is-input": "", ariaControls: e.datePickerContainerId, ariaExpanded: e.isDatePickerOpen, "aria-labelledby": t.label ? e.labelId : null, "aria-describedby": e.ariaDescribedBy, disabled: t.disabled, "dynamic-filtering": "", "is-invalid": !!t.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 ? a(e.ErrorMessage, { staticClass: "b-date-picker__error-message", attrs: { id: e.dateErrorId, "error-message": e.dateErrorText } }) : t._e(), t.errorMessage ? a(e.ErrorMessage, { staticClass: "b-date-picker__error-message", attrs: { id: e.errorId, "error-message": t.errorMessage } }) : t._e(), t.description ? a(e.BentoTypography, { staticClass: "b-date-picker__description", class: e.descriptionConditionalClasses, attrs: { el: "span" } }, [t._v(" " + t._s(t.description) + " ")]) : t._e(), e.inputContainerRef ? a(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": {
152
- initialFocus: e.initialFocusOnDatePickerOpen
153
- } }, nativeOn: { keydown: function(l) {
154
+ }] } }, [t.label ? a(e.FieldLabel, { attrs: { id: e.labelId, label: t.label, "tooltip-text": t.tooltipText, optional: t.optional, required: t.required } }) : t._e(), a("div", [a(e.DropdownInputDefault, { ref: "inputContainerRef", attrs: { "always-combobox-is-input": "", ariaControls: e.datePickerContainerId, ariaExpanded: e.isDatePickerOpen, "aria-labelledby": t.label ? e.labelId : null, "aria-describedby": e.ariaDescribedBy, disabled: t.disabled, "dynamic-filtering": "", "is-invalid": !!t.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 ? a(e.ErrorMessage, { staticClass: "b-date-picker__error-message", attrs: { id: e.dateErrorId, "error-message": e.dateErrorText } }) : t._e(), t.errorMessage ? a(e.ErrorMessage, { staticClass: "b-date-picker__error-message", attrs: { id: e.errorId, "error-message": t.errorMessage } }) : t._e(), t.description ? a(e.BentoTypography, { staticClass: "b-date-picker__description", class: e.descriptionConditionalClasses, attrs: { el: "span" } }, [t._v(" " + t._s(t.description) + " ")]) : t._e(), e.inputContainerRef ? a(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) {
154
155
  return !l.type.indexOf("key") && t._k(l.keyCode, "esc", 27, l.key, ["Esc", "Escape"]) ? null : e.closeDatePicker.apply(null, arguments);
155
156
  } } }, [a(e.Calendar, { ref: "calendarContainerRef", attrs: { "default-display-month": t.defaultDisplayMonth, "first-day-of-week": t.firstDayOfWeek, "is-date-disabled": t.isDateDisabled, "number-of-months": 1, value: e.internalModelValue, min: t.min, max: t.max, variant: t.variant }, on: { input: e.onDateSelected } })], 1) : t._e()], 1);
156
- }, fe = [], me = /* @__PURE__ */ ie(
157
- ce,
157
+ }, me = [], ve = /* @__PURE__ */ se(
158
158
  pe,
159
159
  fe,
160
+ me,
160
161
  !1,
161
162
  null,
162
- "16147d43"
163
+ "01f20425"
163
164
  );
164
- const Me = me.exports;
165
+ const Me = ve.exports;
165
166
  export {
166
167
  Me as B
167
168
  };
168
- //# sourceMappingURL=date-picker.Dvx50znw.js.map
169
+ //# sourceMappingURL=date-picker.D-7m8ONP.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"date-picker.D-7m8ONP.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 { DateFormat } from '@/types/date-format';\nimport { getDateLocale } from '@/utils/ts/get-date-locale/get-date-locale';\nimport { format } from 'date-fns/format';\nimport { startOfMonth } from 'date-fns/startOfMonth';\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 {Ref<Date>} option.datePickerValue Ref to the datePickerValue set in the DatePicker component\n * @param {Ref<boolean>} option.isDateIncorrect Indicates if the date is correct or not\n * @param {?Ref<boolean>} option.isMonthVariant Indicates if the date picker has variant \"month\"\n */\nexport const useDatePickerSingleCalendarText: UseDateDisplayText<Date> = ({\n datePickerValue,\n isDateIncorrect,\n isMonthVariant,\n placeholder,\n}) => {\n const { locale, t } = useI18n<{ message: MessageSchema }>({ messages });\n const locales = getDateLocale();\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 (isDateIncorrect.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 return format(\n datePickerValue.value,\n isMonthVariant?.value ? DateFormat.LONG_MONTH_YEAR : DateFormat.FULL_DATE,\n {\n locale: locales[locale.value?.substring(0, 2)] || locales.enUS,\n }\n );\n });\n\n /**\n * Formats the \"dateToFormat\" date value with the yyyy-MM-dd format and sets it as \"formatTextInputDisplayValue\" value\n * @param {Date} 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 (isDateIncorrect.value) {\n return;\n }\n\n const date = isMonthVariant?.value ? startOfMonth(dateToFormat) : dateToFormat;\n textInputValue.value = dateToFormat\n ? format(date, DateFormat.NUMERIC_DATE_YEAR_FIRST, {\n locale: locales[locale.value?.substring(0, 2)] || locales.enUS,\n })\n : null;\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 <dropdown-input-default\n ref=\"inputContainerRef\"\n always-combobox-is-input\n :ariaControls=\"datePickerContainerId\"\n :ariaExpanded=\"isDatePickerOpen\"\n :aria-labelledby=\"label ? labelId : null\"\n :aria-describedby=\"ariaDescribedBy\"\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\"\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=\"firstDayOfWeek\"\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\n // Utils\n import { debounce } from '@/utils/ts/debounce';\n import { formatDateInputValue, validateDateInput } from '@/utils/ts/date-input';\n import { generateUid } from '@/core/utils/ts';\n import { useI18n } from '@/utils/ts/i18n';\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 { useFormLayoutFieldLoading } 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: 1 },\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 isDateIncorrect = ref(false);\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\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 isDateIncorrect,\n isMonthVariant,\n placeholder: toRef(props, 'placeholder'),\n });\n\n const dateErrorText = computed(() => {\n if (\n props.isDateDisabled &&\n textInputValue.value &&\n props.isDateDisabled(new Date(textInputValue.value)) &&\n !isDatePickerOpen.value\n ) {\n return t('selectedDateIsNotAvailable');\n }\n\n return isDateIncorrect.value ? t('provideDateInAFormat') : null;\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 isDateEnabled = (date: Date) => {\n // Check if date is between min/max bounds, if there are any\n if ((props.min && date <= props.min) || (props.max && date >= props.max)) {\n return false;\n }\n\n // Check if function is set, otherwise all dates are enabled\n if (props.isDateDisabled) {\n return !props.isDateDisabled(date);\n }\n\n return true;\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 isDateIncorrect.value = false;\n\n closeDatePicker();\n emitValue(selectedDate);\n };\n\n const clearDatePickerValue = async () => {\n if (isDateIncorrect.value) {\n isDateIncorrect.value = false;\n textInputValue.value = null;\n }\n emitValue(null);\n };\n\n const onDateKeyDown = (event: KeyboardEvent) => {\n validateDateInput(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 // Checks for YYYY-MM-DD format\n const dateRegex = /^\\d{4}-(0?[1-9]|1[012])-(0?[1-9]|[12][0-9]|3[01])$/;\n const isValidDate = dateRegex.test(stringDate) && isDateEnabled(new Date(stringDate));\n if (isValidDate) {\n isDateIncorrect.value = false;\n emitValue(new Date(stringDate));\n } else if (stringDate) {\n // Only set to true if the value exists (not null/undefined)\n isDateIncorrect.value = true;\n emitValue(null);\n }\n };\n\n const validateDateDebounced = debounce(validateDate, DEBOUNCE_TIME);\n\n const onDateInputChange = (stringDate: string) => {\n textInputValue.value = formatDateInputValue(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 if (isDatePickerOpen.value) {\n validateDateDebounced(textInputValue.value);\n } else {\n validateDate(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","isDateIncorrect","isMonthVariant","placeholder","locale","t","useI18n","locales","getDateLocale","textInputValue","ref","_a","computed","format","DateFormat","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","computedTrapAllOptions","watch","disabled","newValue","newModelValue","deprecate","dateDisplayValue","formatTextInputDisplayValue","dateErrorText","descriptionConditionalClasses","ariaDescribedBy","isDateEnabled","closeDatePicker","openDatePicker","onDateSelected","selectedDate","clearDatePickerValue","onDateKeyDown","event","validateDateInput","validateDate","stringDate","validateDateDebounced","debounce","formatDateInputValue","nextTick"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiBOA,KAAA,CAAA;AAAA,EAAmE,iBAAAC;AAAA,EACtE,iBAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,aAAAC;AAEJ,MAAA;;AACI,QAAA,EAAA,QAAAC,GAAA,GAAAC,EAAA,IAAAC,EAAA,GACAC,IAAAC,GAAA,GAEAC,IAAAC,GAAAC,IAAAX,EAAA,UAAA,gBAAAW,EAAA,cAAA;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AA,UAGA2B,EAAA,eAAA,GAEAL,EAAA,GAGA,MAAAY,EAAA,GAGAhC,EAAA,UAEIc,EAAA,oBAAA,KAAA,CAAA,GACAV,EAAA,oBAAA,KAAA,CAAA,IAIJL,EAAA,UAAArB,IAAAkB,EAAA,UAAA,gBAAAlB,EAAA,MAAA,YAAA,GAAA;AAAA,QACqDiB,EAAA,YAAA,UAAAX,EAAAgB,EAAA,KAAA,IAAAA,EAAA;AAAA,QAC2C;AAAA,YACxF;AAAA,IACC;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,11 +1,11 @@
1
1
  import { reactive as Te, defineComponent as He, useSlots as lt, ref as F, computed as y, onMounted as We, toRaw as _e, watch as ye, toRef as Fe } from "vue";
2
2
  import { g as it } from "./index.BDK4hwK_.js";
3
3
  import { B as ut } from "./divider.DX5gwN7p.js";
4
- import { g as dt, B as ct } from "./button-actions.C3cP-anb.js";
4
+ import { g as dt, B as ct } from "./button-actions.BoZOEVZi.js";
5
5
  import { B as Ke, d as xe } from "./typography.hlOAxsEn.js";
6
- import { B as mt } from "./input-field.C4XJ53Cn.js";
7
- import { B as Dt } from "./dropdown.BpT6ct8O.js";
8
- import { B as pt } from "./segmented-control.Dj_ZKhmU.js";
6
+ import { B as mt } from "./input-field.MpAZisFn.js";
7
+ import { B as Dt } from "./dropdown.BLgcbjv8.js";
8
+ import { B as pt } from "./segmented-control._CuB62pG.js";
9
9
  import { e as P, a as Be, g as Re } from "./differenceInMonths.Cab3nOsb.js";
10
10
  import { u as Ie } from "./index.B6WW_F-J.js";
11
11
  import { e as x, g as Ve, h as Ae, i as U, j as ft, k as Ue, l as vt, s as Ne, m as gt, n as ce, o as Pe, b as $, u as yt, f as ie } from "./calendar.Bhj58zR3.js";
@@ -21,7 +21,7 @@ import "./index.Cl4_42j5.js";
21
21
  import { u as Et } from "./form-field.D_2g7vaP.js";
22
22
  import { D as kt } from "./dropdown-default-textbox.uWZMxeI7.js";
23
23
  import { B as ht } from "./directive.Cbdox5VL.js";
24
- import { F as Mt, E as Ot } from "./field-label.C3h8Q8Xd.js";
24
+ import { F as Mt, E as Ot } from "./field-label.DHGAa4cq.js";
25
25
  import { B as Ct } from "./button-actions.types.BptAXjD8.js";
26
26
  import "../assets/date-range-picker.css";
27
27
  function te(r) {
@@ -903,4 +903,4 @@ export {
903
903
  Yt as a,
904
904
  ge as i
905
905
  };
906
- //# sourceMappingURL=date-range-picker.DYYyE_e2.js.map
906
+ //# sourceMappingURL=date-range-picker.CvxP8n0I.js.map