@adyen/bento-vue3 1.34.0 → 1.35.1

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 (203) hide show
  1. package/dist/@types/packages/vue2/src/components/checkbox/checkbox.vue.d.ts +1 -1
  2. package/dist/@types/packages/vue2/src/components/checkbox/components/checkbox-group/checkbox-group.vue.d.ts +1 -1
  3. package/dist/@types/packages/vue2/src/components/code-snippet/code-snippet.vue.d.ts +1 -1
  4. package/dist/@types/packages/vue2/src/components/data-grid/components/data-grid-config-settings/data-grid-config-settings.vue.d.ts +1 -1
  5. package/dist/@types/packages/vue2/src/components/dropdown/composables/use-display-value.d.ts +1 -1
  6. package/dist/@types/packages/vue2/src/components/dropdown/composables/use-display-value.types.d.ts +1 -0
  7. package/dist/@types/packages/vue2/src/components/filter-bar/components/select-filter/variants/select-avatar-filter/select-avatar-filter.vue.d.ts +7 -7
  8. package/dist/@types/packages/vue2/src/components/filter-bar/components/select-filter/variants/select-country-filter/select-country-filter.vue.d.ts +1 -1
  9. package/dist/@types/packages/vue2/src/components/filter-bar/components/select-filter/variants/select-currency-filter/select-currency-filter.vue.d.ts +7 -7
  10. package/dist/@types/packages/vue2/src/components/filter-bar/components/select-filter/variants/select-payment-method-filter/select-payment-method-filter.vue.d.ts +7 -7
  11. package/dist/@types/packages/vue2/src/components/filter-bar/components/select-filter/variants/select-tag-filter/select-tag-filter.vue.d.ts +7 -7
  12. package/dist/@types/packages/vue2/src/components/internal/listbox/components/listbox-multi-select/components/listbox-multi-select-options/components/listbox-multi-select-category/listbox-multi-select-category.vue.d.ts +1 -1
  13. package/dist/@types/packages/vue2/src/components/internal/listbox/components/listbox-multi-select/components/listbox-multi-select-options/listbox-multi-select-options.vue.d.ts +2 -2
  14. package/dist/@types/packages/vue2/src/components/internal/listbox/components/listbox-multi-select/listbox-multi-select.vue.d.ts +3 -3
  15. package/dist/@types/packages/vue2/src/components/internal/listbox/listbox.vue.d.ts +3 -3
  16. package/dist/@types/packages/vue2/src/utils/ts/get-date-locale/get-date-locale.d.ts +11 -0
  17. package/dist/accordion.js +1 -1
  18. package/dist/action-bar.js +1 -1
  19. package/dist/alert.js +1 -1
  20. package/dist/assets/accordion-item.css +1 -1
  21. package/dist/assets/action-bar.css +1 -1
  22. package/dist/assets/avatar.css +1 -1
  23. package/dist/assets/base-modal.css +1 -1
  24. package/dist/assets/calendar.css +1 -1
  25. package/dist/assets/card.css +1 -1
  26. package/dist/assets/checkbox.css +1 -1
  27. package/dist/assets/code-snippet.css +1 -1
  28. package/dist/assets/currency.css +1 -0
  29. package/dist/assets/data-grid.css +1 -1
  30. package/dist/assets/date-range-picker.css +1 -1
  31. package/dist/assets/dialog-page.css +1 -1
  32. package/dist/assets/dropdown.css +1 -1
  33. package/dist/assets/error-message.css +1 -1
  34. package/dist/assets/filter-bar.css +1 -1
  35. package/dist/assets/header.css +1 -1
  36. package/dist/assets/inspector.css +1 -1
  37. package/dist/assets/loading-button.css +1 -1
  38. package/dist/assets/menu.css +1 -1
  39. package/dist/assets/modal-fullscreen.css +1 -1
  40. package/dist/assets/popover.css +1 -1
  41. package/dist/assets/sidepanel.css +1 -1
  42. package/dist/assets/structured-list-item.css +1 -1
  43. package/dist/assets/tutorial.css +1 -1
  44. package/dist/avatar.js +1 -1
  45. package/dist/button.js +2 -2
  46. package/dist/card.js +1 -1
  47. package/dist/checkbox.js +2 -2
  48. package/dist/chunks/accordion-item.C30QFxol.js +142 -0
  49. package/dist/chunks/accordion-item.C30QFxol.js.map +1 -0
  50. package/dist/chunks/{action-bar.DGQYYi8b.js → action-bar.5XBrXwYv.js} +58 -44
  51. package/dist/chunks/{action-bar.DGQYYi8b.js.map → action-bar.5XBrXwYv.js.map} +1 -1
  52. package/dist/chunks/{alert.Bz4tNKDH.js → alert.BvSx_Bi7.js} +26 -20
  53. package/dist/chunks/{alert.Bz4tNKDH.js.map → alert.BvSx_Bi7.js.map} +1 -1
  54. package/dist/chunks/{avatar.mNlMngHQ.js → avatar.8erKxh8t.js} +13 -13
  55. package/dist/chunks/avatar.8erKxh8t.js.map +1 -0
  56. package/dist/chunks/{base-modal.Bl7DBkt0.js → base-modal.BenvK-Np.js} +35 -29
  57. package/dist/chunks/{base-modal.Bl7DBkt0.js.map → base-modal.BenvK-Np.js.map} +1 -1
  58. package/dist/chunks/{button-actions-with-menu.BLmcwr2f.js → button-actions-with-menu.CHOjMHpd.js} +4 -4
  59. package/dist/chunks/{button-actions-with-menu.BLmcwr2f.js.map → button-actions-with-menu.CHOjMHpd.js.map} +1 -1
  60. package/dist/chunks/{button-actions.hdK5IgrZ.js → button-actions.DyI_dSvx.js} +2 -2
  61. package/dist/chunks/{button-actions.hdK5IgrZ.js.map → button-actions.DyI_dSvx.js.map} +1 -1
  62. package/dist/chunks/{calendar.D--sOCBT.js → calendar.DzYaxc0M.js} +148 -148
  63. package/dist/chunks/calendar.DzYaxc0M.js.map +1 -0
  64. package/dist/chunks/{card.BvSoujBc.js → card.Bt8jcp9I.js} +45 -37
  65. package/dist/chunks/card.Bt8jcp9I.js.map +1 -0
  66. package/dist/chunks/{checkbox-group.CuLP3hPd.js → checkbox-group.B0wngKi6.js} +4 -4
  67. package/dist/chunks/{checkbox-group.CuLP3hPd.js.map → checkbox-group.B0wngKi6.js.map} +1 -1
  68. package/dist/chunks/{checkbox.DMMXn-h8.js → checkbox.Bk_jmkGe.js} +50 -40
  69. package/dist/chunks/{checkbox.DMMXn-h8.js.map → checkbox.Bk_jmkGe.js.map} +1 -1
  70. package/dist/chunks/{code-snippet.BWM5w4CP.js → code-snippet.1SigVnjS.js} +97 -88
  71. package/dist/chunks/code-snippet.1SigVnjS.js.map +1 -0
  72. package/dist/chunks/{controls-group.BnZVHgQK.js → controls-group.COc0kArc.js} +2 -2
  73. package/dist/chunks/{controls-group.BnZVHgQK.js.map → controls-group.COc0kArc.js.map} +1 -1
  74. package/dist/chunks/{copy.h-wVGvID.js → copy.1-HH1fz5.js} +28 -20
  75. package/dist/chunks/{copy.h-wVGvID.js.map → copy.1-HH1fz5.js.map} +1 -1
  76. package/dist/chunks/{currency.CFJy6QYU.js → currency.BdtY-UIM.js} +3 -2
  77. package/dist/chunks/{currency.CFJy6QYU.js.map → currency.BdtY-UIM.js.map} +1 -1
  78. package/dist/chunks/{dashboard-section.BIH2wzgk.js → dashboard-section.BOrGKdY9.js} +2 -2
  79. package/dist/chunks/{dashboard-section.BIH2wzgk.js.map → dashboard-section.BOrGKdY9.js.map} +1 -1
  80. package/dist/chunks/{dashed-underline.CFJdLuJp.js → dashed-underline.BO4BuqUM.js} +2 -2
  81. package/dist/chunks/{dashed-underline.CFJdLuJp.js.map → dashed-underline.BO4BuqUM.js.map} +1 -1
  82. package/dist/chunks/{data-grid-template.21gqdYrs.js → data-grid-template.O946JKTa.js} +2 -2
  83. package/dist/chunks/{data-grid-template.21gqdYrs.js.map → data-grid-template.O946JKTa.js.map} +1 -1
  84. package/dist/chunks/{data-grid.DUwLxtW_.js → data-grid.Bv5TA_zR.js} +578 -532
  85. package/dist/chunks/{data-grid.DUwLxtW_.js.map → data-grid.Bv5TA_zR.js.map} +1 -1
  86. package/dist/chunks/{date-picker.21z_Sw4V.js → date-picker.DvEPEMIM.js} +99 -91
  87. package/dist/chunks/date-picker.DvEPEMIM.js.map +1 -0
  88. package/dist/chunks/{date-range-picker.K2TeW8aX.js → date-range-picker.BLVlkkG_.js} +338 -316
  89. package/dist/chunks/date-range-picker.BLVlkkG_.js.map +1 -0
  90. package/dist/chunks/{date.D8rQMzMG.js → date.CYUV4seY.js} +92 -92
  91. package/dist/chunks/{date.D8rQMzMG.js.map → date.CYUV4seY.js.map} +1 -1
  92. package/dist/chunks/{dropdown-tag.BNJnscD2.js → dropdown-tag.bpKWbC_O.js} +3 -3
  93. package/dist/chunks/{dropdown-tag.BNJnscD2.js.map → dropdown-tag.bpKWbC_O.js.map} +1 -1
  94. package/dist/chunks/{dropdown.ex87AZ7s.js → dropdown.rFZp3hMb.js} +212 -193
  95. package/dist/chunks/dropdown.rFZp3hMb.js.map +1 -0
  96. package/dist/chunks/{error-message.D2Y99KjT.js → error-message.DblYEZ7E.js} +43 -29
  97. package/dist/chunks/{error-message.D2Y99KjT.js.map → error-message.DblYEZ7E.js.map} +1 -1
  98. package/dist/chunks/es6.BvpG4Oi6.js.map +1 -1
  99. package/dist/chunks/{filter-bar.BAmG-yML.js → filter-bar.IN7gqxsc.js} +727 -712
  100. package/dist/chunks/filter-bar.IN7gqxsc.js.map +1 -0
  101. package/dist/chunks/{footer-actions.gtxofUAa.js → footer-actions.CyoMN_ca.js} +2 -2
  102. package/dist/chunks/{footer-actions.gtxofUAa.js.map → footer-actions.CyoMN_ca.js.map} +1 -1
  103. package/dist/chunks/{form-layout-title.Boi0QQZL.js → form-layout-title.Bi_3du_6.js} +2 -2
  104. package/dist/chunks/{form-layout-title.Boi0QQZL.js.map → form-layout-title.Bi_3du_6.js.map} +1 -1
  105. package/dist/chunks/{index.B_UZQ6qF.js → get-date-locale.BN8xEjY0.js} +855 -204
  106. package/dist/chunks/get-date-locale.BN8xEjY0.js.map +1 -0
  107. package/dist/chunks/{header.BMYhkrGT.js → header.Byd6jXl6.js} +104 -98
  108. package/dist/chunks/{header.BMYhkrGT.js.map → header.Byd6jXl6.js.map} +1 -1
  109. package/dist/chunks/{index.Z84QE0E2.js → index.CrhTVr5J.js} +2 -2
  110. package/dist/chunks/{index.Z84QE0E2.js.map → index.CrhTVr5J.js.map} +1 -1
  111. package/dist/chunks/{index.xqFSZOAb.js → index.DDnf1O9p.js} +2 -2
  112. package/dist/chunks/{index.xqFSZOAb.js.map → index.DDnf1O9p.js.map} +1 -1
  113. package/dist/chunks/{index.B_EJflcs.js → index.DPafeRJa.js} +2 -2
  114. package/dist/chunks/{index.B_EJflcs.js.map → index.DPafeRJa.js.map} +1 -1
  115. package/dist/chunks/{input-field.Dely7A8G.js → input-field.CgS1AEGu.js} +3 -3
  116. package/dist/chunks/{input-field.Dely7A8G.js.map → input-field.CgS1AEGu.js.map} +1 -1
  117. package/dist/chunks/{inspector.types.t2SPyhw3.js → inspector.types.xpv2J9pJ.js} +44 -36
  118. package/dist/chunks/{inspector.types.t2SPyhw3.js.map → inspector.types.xpv2J9pJ.js.map} +1 -1
  119. package/dist/chunks/loading-button.Bntgn6Lk.js +137 -0
  120. package/dist/chunks/loading-button.Bntgn6Lk.js.map +1 -0
  121. package/dist/chunks/{menu.CLicp_2I.js → menu.BN5WGXw3.js} +2 -2
  122. package/dist/chunks/{menu.CLicp_2I.js.map → menu.BN5WGXw3.js.map} +1 -1
  123. package/dist/chunks/{modal-fullscreen.Caqa7dDp.js → modal-fullscreen.zljoH4pr.js} +35 -29
  124. package/dist/chunks/{modal-fullscreen.Caqa7dDp.js.map → modal-fullscreen.zljoH4pr.js.map} +1 -1
  125. package/dist/chunks/{modal.vue_vue_type_script_setup_true_lang.Dzmth-oW.js → modal.vue_vue_type_script_setup_true_lang.tT8umwqG.js} +31 -25
  126. package/dist/chunks/modal.vue_vue_type_script_setup_true_lang.tT8umwqG.js.map +1 -0
  127. package/dist/chunks/{pagination.I5w8bpUS.js → pagination.BMn5ryDD.js} +2 -2
  128. package/dist/chunks/{pagination.I5w8bpUS.js.map → pagination.BMn5ryDD.js.map} +1 -1
  129. package/dist/chunks/{popover.DQP3ce2x.js → popover.pDk6zsak.js} +2 -2
  130. package/dist/chunks/{popover.DQP3ce2x.js.map → popover.pDk6zsak.js.map} +1 -1
  131. package/dist/chunks/{radio-group.lOSBHghv.js → radio-group.DUtoFXmr.js} +3 -3
  132. package/dist/chunks/{radio-group.lOSBHghv.js.map → radio-group.DUtoFXmr.js.map} +1 -1
  133. package/dist/chunks/{search-bar.GCRTgBUA.js → search-bar.poJCoGD-.js} +49 -41
  134. package/dist/chunks/{search-bar.GCRTgBUA.js.map → search-bar.poJCoGD-.js.map} +1 -1
  135. package/dist/chunks/{secondary-nav.CGH_6m7u.js → secondary-nav.Dyvd-YBg.js} +2 -2
  136. package/dist/chunks/{secondary-nav.CGH_6m7u.js.map → secondary-nav.Dyvd-YBg.js.map} +1 -1
  137. package/dist/chunks/{selection-card-group.BdTuPhEm.js → selection-card-group.CHBS81j6.js} +3 -3
  138. package/dist/chunks/{selection-card-group.BdTuPhEm.js.map → selection-card-group.CHBS81j6.js.map} +1 -1
  139. package/dist/chunks/{sidepanel.DA8nQepj.js → sidepanel.CuQCXV1E.js} +36 -30
  140. package/dist/chunks/{sidepanel.DA8nQepj.js.map → sidepanel.CuQCXV1E.js.map} +1 -1
  141. package/dist/chunks/{structured-list-item.Z-1ivOFu.js → structured-list-item.1A2sjhP4.js} +35 -29
  142. package/dist/chunks/{structured-list-item.Z-1ivOFu.js.map → structured-list-item.1A2sjhP4.js.map} +1 -1
  143. package/dist/chunks/{summary-grid-item-custom.Dq3IIEvH.js → summary-grid-item-custom.CuvUVoQ8.js} +2 -2
  144. package/dist/chunks/{summary-grid-item-custom.Dq3IIEvH.js.map → summary-grid-item-custom.CuvUVoQ8.js.map} +1 -1
  145. package/dist/chunks/{textarea.kYFGQFwd.js → textarea.CHnvON8G.js} +2 -2
  146. package/dist/chunks/{textarea.kYFGQFwd.js.map → textarea.CHnvON8G.js.map} +1 -1
  147. package/dist/chunks/{timeline-item.D-Yy2qQr.js → timeline-item.Dc_l5Xyy.js} +81 -75
  148. package/dist/chunks/{timeline-item.D-Yy2qQr.js.map → timeline-item.Dc_l5Xyy.js.map} +1 -1
  149. package/dist/chunks/{tutorial.vue_vue_type_script_setup_true_lang.D-ZFDn95.js → tutorial.vue_vue_type_script_setup_true_lang.DdLmYCOe.js} +82 -70
  150. package/dist/chunks/{tutorial.vue_vue_type_script_setup_true_lang.D-ZFDn95.js.map → tutorial.vue_vue_type_script_setup_true_lang.DdLmYCOe.js.map} +1 -1
  151. package/dist/chunks/{use-cached-selected-values.ClVxNmUf.js → use-cached-selected-values.CS3gHOyI.js} +86 -72
  152. package/dist/chunks/{use-cached-selected-values.ClVxNmUf.js.map → use-cached-selected-values.CS3gHOyI.js.map} +1 -1
  153. package/dist/code-snippet.js +1 -1
  154. package/dist/currency.js +1 -1
  155. package/dist/dashboard-template.js +1 -1
  156. package/dist/dashed-underline.js +1 -1
  157. package/dist/data-grid-template.js +1 -1
  158. package/dist/data-grid.js +1 -1
  159. package/dist/date-picker.js +2 -2
  160. package/dist/date-range-picker.js +2 -2
  161. package/dist/date.js +1 -1
  162. package/dist/dropdown.js +3 -3
  163. package/dist/filter-bar.js +1 -1
  164. package/dist/form-layout.js +1 -1
  165. package/dist/header.js +1 -1
  166. package/dist/index.js +43 -43
  167. package/dist/input-field.js +1 -1
  168. package/dist/inspector.js +1 -1
  169. package/dist/internal.js +5 -5
  170. package/dist/menu.js +1 -1
  171. package/dist/modal-fullscreen.js +1 -1
  172. package/dist/modal.js +2 -2
  173. package/dist/pagination.js +1 -1
  174. package/dist/popover.js +1 -1
  175. package/dist/radio-group.js +1 -1
  176. package/dist/search-bar.js +2 -2
  177. package/dist/secondary-nav.js +1 -1
  178. package/dist/selection-card.js +1 -1
  179. package/dist/sidepanel.js +1 -1
  180. package/dist/structured-list.js +1 -1
  181. package/dist/styles/bento.css +3 -0
  182. package/dist/styles/legacy.css +3 -0
  183. package/dist/styles/styleguide.css +3 -0
  184. package/dist/summary-grid.js +1 -1
  185. package/dist/textarea.js +1 -1
  186. package/dist/timeline.js +1 -1
  187. package/dist/tutorial.js +1 -1
  188. package/dist/web-types.json +1 -1
  189. package/package.json +2 -2
  190. package/dist/chunks/accordion-item.CQ8DLt9l.js +0 -126
  191. package/dist/chunks/accordion-item.CQ8DLt9l.js.map +0 -1
  192. package/dist/chunks/avatar.mNlMngHQ.js.map +0 -1
  193. package/dist/chunks/calendar.D--sOCBT.js.map +0 -1
  194. package/dist/chunks/card.BvSoujBc.js.map +0 -1
  195. package/dist/chunks/code-snippet.BWM5w4CP.js.map +0 -1
  196. package/dist/chunks/date-picker.21z_Sw4V.js.map +0 -1
  197. package/dist/chunks/date-range-picker.K2TeW8aX.js.map +0 -1
  198. package/dist/chunks/dropdown.ex87AZ7s.js.map +0 -1
  199. package/dist/chunks/filter-bar.BAmG-yML.js.map +0 -1
  200. package/dist/chunks/index.B_UZQ6qF.js.map +0 -1
  201. package/dist/chunks/loading-button.Mx-oDIGy.js +0 -123
  202. package/dist/chunks/loading-button.Mx-oDIGy.js.map +0 -1
  203. package/dist/chunks/modal.vue_vue_type_script_setup_true_lang.Dzmth-oW.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index.Z84QE0E2.js","sources":["../../../../node_modules/.pnpm/date-fns@2.28.0/node_modules/date-fns/esm/endOfMonth/index.js"],"sourcesContent":["import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name endOfMonth\n * @category Month Helpers\n * @summary Return the end of a month for the given date.\n *\n * @description\n * Return the end of a month for the given date.\n * The result will be in the local timezone.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the original date\n * @returns {Date} the end of a month\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // The end of a month for 2 September 2014 11:55:00:\n * const result = endOfMonth(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Tue Sep 30 2014 23:59:59.999\n */\n\nexport default function endOfMonth(dirtyDate) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate);\n var month = date.getMonth();\n date.setFullYear(date.getFullYear(), month + 1, 0);\n date.setHours(23, 59, 59, 999);\n return date;\n}"],"names":["endOfMonth","dirtyDate","requiredArgs","date","toDate","month"],"mappings":";AAyBe,SAASA,EAAWC,GAAW;AAC5C,EAAAC,EAAa,GAAG,SAAS;AACzB,MAAIC,IAAOC,EAAOH,CAAS,GACvBI,IAAQF,EAAK,SAAU;AAC3B,SAAAA,EAAK,YAAYA,EAAK,YAAa,GAAEE,IAAQ,GAAG,CAAC,GACjDF,EAAK,SAAS,IAAI,IAAI,IAAI,GAAG,GACtBA;AACT;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index.CrhTVr5J.js","sources":["../../../../node_modules/.pnpm/date-fns@2.28.0/node_modules/date-fns/esm/endOfMonth/index.js"],"sourcesContent":["import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name endOfMonth\n * @category Month Helpers\n * @summary Return the end of a month for the given date.\n *\n * @description\n * Return the end of a month for the given date.\n * The result will be in the local timezone.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the original date\n * @returns {Date} the end of a month\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // The end of a month for 2 September 2014 11:55:00:\n * const result = endOfMonth(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Tue Sep 30 2014 23:59:59.999\n */\n\nexport default function endOfMonth(dirtyDate) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate);\n var month = date.getMonth();\n date.setFullYear(date.getFullYear(), month + 1, 0);\n date.setHours(23, 59, 59, 999);\n return date;\n}"],"names":["endOfMonth","dirtyDate","requiredArgs","date","toDate","month"],"mappings":";AAyBe,SAASA,EAAWC,GAAW;AAC5C,EAAAC,EAAa,GAAG,SAAS;AACzB,MAAIC,IAAOC,EAAOH,CAAS,GACvBI,IAAQF,EAAK,SAAU;AAC3B,SAAAA,EAAK,YAAYA,EAAK,YAAa,GAAEE,IAAQ,GAAG,CAAC,GACjDF,EAAK,SAAS,IAAI,IAAI,IAAI,GAAG,GACtBA;AACT;","x_google_ignoreList":[0]}
@@ -1,4 +1,4 @@
1
- import { r as o, t } from "./index.B_UZQ6qF.js";
1
+ import { r as o, t } from "./get-date-locale.BN8xEjY0.js";
2
2
  function f(e, r) {
3
3
  o(2, arguments);
4
4
  var n = t(e), i = t(r), a = n.getTime() - i.getTime();
@@ -19,4 +19,4 @@ export {
19
19
  l as a,
20
20
  f as c
21
21
  };
22
- //# sourceMappingURL=index.xqFSZOAb.js.map
22
+ //# sourceMappingURL=index.DDnf1O9p.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.xqFSZOAb.js","sources":["../../../../node_modules/.pnpm/date-fns@2.28.0/node_modules/date-fns/esm/compareAsc/index.js","../../../../node_modules/.pnpm/date-fns@2.28.0/node_modules/date-fns/esm/_lib/assign/index.js","../../../../node_modules/.pnpm/date-fns@2.28.0/node_modules/date-fns/esm/_lib/cloneObject/index.js"],"sourcesContent":["import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name compareAsc\n * @category Common Helpers\n * @summary Compare the two dates and return -1, 0 or 1.\n *\n * @description\n * Compare the two dates and return 1 if the first date is after the second,\n * -1 if the first date is before the second or 0 if dates are equal.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} dateLeft - the first date to compare\n * @param {Date|Number} dateRight - the second date to compare\n * @returns {Number} the result of the comparison\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Compare 11 February 1987 and 10 July 1989:\n * const result = compareAsc(new Date(1987, 1, 11), new Date(1989, 6, 10))\n * //=> -1\n *\n * @example\n * // Sort the array of dates:\n * const result = [\n * new Date(1995, 6, 2),\n * new Date(1987, 1, 11),\n * new Date(1989, 6, 10)\n * ].sort(compareAsc)\n * //=> [\n * // Wed Feb 11 1987 00:00:00,\n * // Mon Jul 10 1989 00:00:00,\n * // Sun Jul 02 1995 00:00:00\n * // ]\n */\n\nexport default function compareAsc(dirtyDateLeft, dirtyDateRight) {\n requiredArgs(2, arguments);\n var dateLeft = toDate(dirtyDateLeft);\n var dateRight = toDate(dirtyDateRight);\n var diff = dateLeft.getTime() - dateRight.getTime();\n\n if (diff < 0) {\n return -1;\n } else if (diff > 0) {\n return 1; // Return 0 if diff is 0; return NaN if diff is NaN\n } else {\n return diff;\n }\n}","export default function assign(target, dirtyObject) {\n if (target == null) {\n throw new TypeError('assign requires that input parameter not be null or undefined');\n }\n\n dirtyObject = dirtyObject || {};\n\n for (var property in dirtyObject) {\n if (Object.prototype.hasOwnProperty.call(dirtyObject, property)) {\n target[property] = dirtyObject[property];\n }\n }\n\n return target;\n}","import assign from \"../assign/index.js\";\nexport default function cloneObject(dirtyObject) {\n return assign({}, dirtyObject);\n}"],"names":["compareAsc","dirtyDateLeft","dirtyDateRight","requiredArgs","dateLeft","toDate","dateRight","diff","assign","target","dirtyObject","property","cloneObject"],"mappings":";AAuCe,SAASA,EAAWC,GAAeC,GAAgB;AAChE,EAAAC,EAAa,GAAG,SAAS;AACzB,MAAIC,IAAWC,EAAOJ,CAAa,GAC/BK,IAAYD,EAAOH,CAAc,GACjCK,IAAOH,EAAS,QAAO,IAAKE,EAAU,QAAS;AAEnD,SAAIC,IAAO,IACF,KACEA,IAAO,IACT,IAEAA;AAEX;ACpDe,SAASC,EAAOC,GAAQC,GAAa;AAClD,MAAID,KAAU;AACZ,UAAM,IAAI,UAAU,+DAA+D;AAGrF,EAAAC,IAAcA,KAAe,CAAE;AAE/B,WAASC,KAAYD;AACnB,IAAI,OAAO,UAAU,eAAe,KAAKA,GAAaC,CAAQ,MAC5DF,EAAOE,CAAQ,IAAID,EAAYC,CAAQ;AAI3C,SAAOF;AACT;ACbe,SAASG,EAAYF,GAAa;AAC/C,SAAOF,EAAO,CAAE,GAAEE,CAAW;AAC/B;","x_google_ignoreList":[0,1,2]}
1
+ {"version":3,"file":"index.DDnf1O9p.js","sources":["../../../../node_modules/.pnpm/date-fns@2.28.0/node_modules/date-fns/esm/compareAsc/index.js","../../../../node_modules/.pnpm/date-fns@2.28.0/node_modules/date-fns/esm/_lib/assign/index.js","../../../../node_modules/.pnpm/date-fns@2.28.0/node_modules/date-fns/esm/_lib/cloneObject/index.js"],"sourcesContent":["import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name compareAsc\n * @category Common Helpers\n * @summary Compare the two dates and return -1, 0 or 1.\n *\n * @description\n * Compare the two dates and return 1 if the first date is after the second,\n * -1 if the first date is before the second or 0 if dates are equal.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} dateLeft - the first date to compare\n * @param {Date|Number} dateRight - the second date to compare\n * @returns {Number} the result of the comparison\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Compare 11 February 1987 and 10 July 1989:\n * const result = compareAsc(new Date(1987, 1, 11), new Date(1989, 6, 10))\n * //=> -1\n *\n * @example\n * // Sort the array of dates:\n * const result = [\n * new Date(1995, 6, 2),\n * new Date(1987, 1, 11),\n * new Date(1989, 6, 10)\n * ].sort(compareAsc)\n * //=> [\n * // Wed Feb 11 1987 00:00:00,\n * // Mon Jul 10 1989 00:00:00,\n * // Sun Jul 02 1995 00:00:00\n * // ]\n */\n\nexport default function compareAsc(dirtyDateLeft, dirtyDateRight) {\n requiredArgs(2, arguments);\n var dateLeft = toDate(dirtyDateLeft);\n var dateRight = toDate(dirtyDateRight);\n var diff = dateLeft.getTime() - dateRight.getTime();\n\n if (diff < 0) {\n return -1;\n } else if (diff > 0) {\n return 1; // Return 0 if diff is 0; return NaN if diff is NaN\n } else {\n return diff;\n }\n}","export default function assign(target, dirtyObject) {\n if (target == null) {\n throw new TypeError('assign requires that input parameter not be null or undefined');\n }\n\n dirtyObject = dirtyObject || {};\n\n for (var property in dirtyObject) {\n if (Object.prototype.hasOwnProperty.call(dirtyObject, property)) {\n target[property] = dirtyObject[property];\n }\n }\n\n return target;\n}","import assign from \"../assign/index.js\";\nexport default function cloneObject(dirtyObject) {\n return assign({}, dirtyObject);\n}"],"names":["compareAsc","dirtyDateLeft","dirtyDateRight","requiredArgs","dateLeft","toDate","dateRight","diff","assign","target","dirtyObject","property","cloneObject"],"mappings":";AAuCe,SAASA,EAAWC,GAAeC,GAAgB;AAChE,EAAAC,EAAa,GAAG,SAAS;AACzB,MAAIC,IAAWC,EAAOJ,CAAa,GAC/BK,IAAYD,EAAOH,CAAc,GACjCK,IAAOH,EAAS,QAAO,IAAKE,EAAU,QAAS;AAEnD,SAAIC,IAAO,IACF,KACEA,IAAO,IACT,IAEAA;AAEX;ACpDe,SAASC,EAAOC,GAAQC,GAAa;AAClD,MAAID,KAAU;AACZ,UAAM,IAAI,UAAU,+DAA+D;AAGrF,EAAAC,IAAcA,KAAe,CAAE;AAE/B,WAASC,KAAYD;AACnB,IAAI,OAAO,UAAU,eAAe,KAAKA,GAAaC,CAAQ,MAC5DF,EAAOE,CAAQ,IAAID,EAAYC,CAAQ;AAI3C,SAAOF;AACT;ACbe,SAASG,EAAYF,GAAa;AAC/C,SAAOF,EAAO,CAAE,GAAEE,CAAW;AAC/B;","x_google_ignoreList":[0,1,2]}
@@ -1,4 +1,4 @@
1
- import { r as t, t as a } from "./index.B_UZQ6qF.js";
1
+ import { r as t, t as a } from "./get-date-locale.BN8xEjY0.js";
2
2
  function o(e) {
3
3
  t(1, arguments);
4
4
  var r = a(e);
@@ -7,4 +7,4 @@ function o(e) {
7
7
  export {
8
8
  o as e
9
9
  };
10
- //# sourceMappingURL=index.B_EJflcs.js.map
10
+ //# sourceMappingURL=index.DPafeRJa.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.B_EJflcs.js","sources":["../../../../node_modules/.pnpm/date-fns@2.28.0/node_modules/date-fns/esm/endOfDay/index.js"],"sourcesContent":["import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name endOfDay\n * @category Day Helpers\n * @summary Return the end of a day for the given date.\n *\n * @description\n * Return the end of a day for the given date.\n * The result will be in the local timezone.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the original date\n * @returns {Date} the end of a day\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // The end of a day for 2 September 2014 11:55:00:\n * const result = endOfDay(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Tue Sep 02 2014 23:59:59.999\n */\n\nexport default function endOfDay(dirtyDate) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate);\n date.setHours(23, 59, 59, 999);\n return date;\n}"],"names":["endOfDay","dirtyDate","requiredArgs","date","toDate"],"mappings":";AAyBe,SAASA,EAASC,GAAW;AAC1C,EAAAC,EAAa,GAAG,SAAS;AACzB,MAAIC,IAAOC,EAAOH,CAAS;AAC3B,SAAAE,EAAK,SAAS,IAAI,IAAI,IAAI,GAAG,GACtBA;AACT;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index.DPafeRJa.js","sources":["../../../../node_modules/.pnpm/date-fns@2.28.0/node_modules/date-fns/esm/endOfDay/index.js"],"sourcesContent":["import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name endOfDay\n * @category Day Helpers\n * @summary Return the end of a day for the given date.\n *\n * @description\n * Return the end of a day for the given date.\n * The result will be in the local timezone.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the original date\n * @returns {Date} the end of a day\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // The end of a day for 2 September 2014 11:55:00:\n * const result = endOfDay(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Tue Sep 02 2014 23:59:59.999\n */\n\nexport default function endOfDay(dirtyDate) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate);\n date.setHours(23, 59, 59, 999);\n return date;\n}"],"names":["endOfDay","dirtyDate","requiredArgs","date","toDate"],"mappings":";AAyBe,SAASA,EAASC,GAAW;AAC1C,EAAAC,EAAa,GAAG,SAAS;AACzB,MAAIC,IAAOC,EAAOH,CAAS;AAC3B,SAAAE,EAAK,SAAS,IAAI,IAAI,IAAI,GAAG,GACtBA;AACT;","x_google_ignoreList":[0]}
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as ne, useAttrs as le, useSlots as se, ref as V, provide as ue, toRef as pe, computed as o, toRefs as ce, openBlock as n, createBlock as c, unref as t, normalizeClass as fe, withCtx as w, renderSlot as p, createCommentVNode as d, createElementVNode as F, createElementBlock as v, withModifiers as H, mergeProps as L, withKeys as be, createVNode as ve } from "vue";
2
- import { I as ye, B as x } from "./dropdown.ex87AZ7s.js";
2
+ import { I as ye, B as x } from "./dropdown.rFZp3hMb.js";
3
3
  import { p as me, d as W, B as T } from "./typography.z9P0Ec3Q.js";
4
4
  import { g as D } from "./unique-id.XFfoKuc2.js";
5
5
  import { g as we } from "./get-slot-text.D5WBGjic.js";
@@ -7,7 +7,7 @@ import { u as De } from "./aria-label.CaUURpnB.js";
7
7
  import { u as he } from "./i18n.DL9GT2-k.js";
8
8
  import { u as ge } from "./use-form-layout-loading.D3lALhtC.js";
9
9
  import { u as Ee } from "./use-has-slot.B7eQSabc.js";
10
- import { F as Se, E as Ae } from "./error-message.D2Y99KjT.js";
10
+ import { F as Se, E as Ae } from "./error-message.DblYEZ7E.js";
11
11
  import { _ as ke } from "./_plugin-vue_export-helper.CHgC5LLL.js";
12
12
  import "../assets/input-field.css";
13
13
  var f = /* @__PURE__ */ ((e) => (e.DEFAULT = "default", e.PAYMENT_METHOD = "payment-method", e.STATIC_VALUE = "static-value", e.DROPDOWN = "dropdown", e))(f || {}), s = /* @__PURE__ */ ((e) => (e.START = "start", e.END = "end", e))(s || {}), h = /* @__PURE__ */ ((e) => (e.CONDENSED = "condensed", e.DISABLED = "disabled", e.READONLY = "readonly", e.ERROR = "error", e))(h || {}), O = /* @__PURE__ */ ((e) => (e.SEARCH = "search", e.TEXT = "text", e.NUMBER = "number", e))(O || {}), Te = /* @__PURE__ */ ((e) => (e.INPUT = "input", e.ESCAPE_PRESSED = "escape-pressed", e.UPDATE_DROPDOWN = "update:dropdown", e.DROPDOWN_INPUT = "dropdown-input", e.FOCUS = "focus", e.CHANGE = "change", e.BLUR = "blur", e.KEYDOWN = "keydown", e))(Te || {});
@@ -347,4 +347,4 @@ export {
347
347
  O as d,
348
348
  Te as e
349
349
  };
350
- //# sourceMappingURL=input-field.Dely7A8G.js.map
350
+ //# sourceMappingURL=input-field.CgS1AEGu.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"input-field.Dely7A8G.js","sources":["../../../vue2/src/components/input-field/input-field.types.ts","../../../vue2/src/components/input-field/input-field.vue"],"sourcesContent":["import { BentoDropdown } from '@/components/dropdown/';\nimport type { HTMLAttributes } from 'vue/types/jsx';\n\n/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoInputFieldVariant {\n DEFAULT = 'default',\n PAYMENT_METHOD = 'payment-method',\n STATIC_VALUE = 'static-value',\n DROPDOWN = 'dropdown',\n}\n\n/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoInputFieldElementPosition {\n START = 'start',\n END = 'end',\n}\n\nexport enum BentoInputFieldStateClass {\n CONDENSED = 'condensed',\n DISABLED = 'disabled',\n READONLY = 'readonly',\n ERROR = 'error',\n}\n\n/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoInputFieldType {\n SEARCH = 'search',\n TEXT = 'text',\n NUMBER = 'number',\n}\n\nexport type BentoInputFieldValue = string | number;\n\ntype DropdownProps = InstanceType<typeof BentoDropdown>['$props'];\nexport type BentoInputDropdownProps = {\n items: DropdownProps['items'];\n value: DropdownProps['value'];\n dynamicFiltering?: DropdownProps['dynamicFiltering'];\n 'aria-label'?: HTMLAttributes['aria-label'];\n};\n\n/**\n * @deprecated The use of these enums is no longer supported.\n * Use `v-on:` or `@` to listen to the events being emitted.\n * This enum will be removed in 2.0.\n */\nexport enum BentoInputFieldEvent {\n INPUT = 'input',\n ESCAPE_PRESSED = 'escape-pressed',\n UPDATE_DROPDOWN = 'update:dropdown',\n DROPDOWN_INPUT = 'dropdown-input',\n FOCUS = 'focus',\n CHANGE = 'change',\n BLUR = 'blur',\n KEYDOWN = 'keydown',\n}\n","<template>\n <bento-typography\n class=\"b-input-field\"\n data-testid=\"input-text-container\"\n :class=\"inputFieldConditionalClasses\"\n el=\"div\"\n variant=\"body\"\n >\n <field-label\n v-if=\"hasSlot('default')\"\n :for=\"inputFieldId\"\n data-testid=\"input-field-label\"\n :tooltip-text=\"tooltipText\"\n :optional=\"optional\"\n :required=\"required\"\n @click=\"focusInput\"\n >\n <slot></slot>\n </field-label>\n\n <div class=\"b-input-field__input-box\" data-testid=\"input-box\" :aria-disabled=\"disabled\" @click=\"focusInput\">\n <!-- Optional Icon for Default text variant -->\n <span\n v-if=\"isDefaultVariant && (hasSlot('defaultIconBefore') || hasSlot('iconBefore'))\"\n :aria-hidden=\"ariaHidden ? 'true' : undefined\"\n class=\"b-input-field__icon-before\"\n >\n <slot v-if=\"hasSlot('iconBefore')\" name=\"iconBefore\" />\n <slot v-if=\"hasSlot('defaultIconBefore') && !hasSlot('iconBefore')\" name=\"defaultIconBefore\" />\n </span>\n\n <!-- Mandatory Icon for Payment Method variant -->\n <span\n v-if=\"isPaymentMethodVariant && hasSlot('paymentMethod')\"\n :aria-hidden=\"ariaHidden ? 'true' : undefined\"\n class=\"b-input-field__payment-method\"\n >\n <slot name=\"paymentMethod\" />\n </span>\n\n <!-- Dropdown at start -->\n <div\n v-if=\"shouldDisplayDropdownAtStart\"\n :id=\"dropdownId\"\n class=\"b-input-field__dropdown b-input-field__dropdown--start\"\n @click.stop\n >\n <bento-dropdown\n v-if=\"dropdown\"\n v-bind=\"inputFieldDropdownProps\"\n :disabled=\"disabled\"\n :readonly=\"isReadOnly\"\n @input=\"onDropdownInput\"\n />\n </div>\n\n <!-- Static Value at start -->\n <bento-typography\n v-if=\"shouldDisplayStaticValueAtStart\"\n :id=\"staticValueId\"\n class=\"b-input-field__static-value b-input-field__static-value--start\"\n el=\"span\"\n variant=\"body\"\n >\n <slot name=\"staticValue\" />\n </bento-typography>\n\n <input\n :id=\"inputFieldId\"\n v-bind=\"attrs\"\n ref=\"inputFieldElement\"\n class=\"b-input-field__input\"\n :aria-label=\"computedAriaLabel\"\n :aria-describedby=\"computedAriaDescribedBy\"\n :aria-owns=\"computedAriaOwns\"\n :aria-invalid=\"shouldShowError\"\n :placeholder=\"placeholder\"\n :type=\"type\"\n :value=\"value\"\n :disabled=\"disabled\"\n :readonly=\"isReadOnly\"\n @input=\"onInput\"\n @change=\"emit('change')\"\n @focus=\"emit('focus')\"\n @blur=\"emit('blur')\"\n @keydown=\"emit('keydown', $event)\"\n @keydown.esc=\"emit('escape-pressed')\"\n />\n <span\n v-if=\"hasSlot('iconAfter')\"\n :aria-hidden=\"ariaHidden ? 'true' : undefined\"\n class=\"b-input-field__icon-after\"\n data-testid=\"input-text__icon-after\"\n >\n <slot name=\"iconAfter\" />\n </span>\n\n <!-- Static Value at the end -->\n <bento-typography\n v-if=\"shouldDisplayStaticValueAtEnd\"\n :id=\"staticValueId\"\n class=\"b-input-field__static-value b-input-field__static-value--end\"\n el=\"span\"\n variant=\"body\"\n >\n <slot name=\"staticValue\" />\n </bento-typography>\n\n <!-- Dropdown at end -->\n <div\n v-if=\"shouldDisplayDropdownAtEnd\"\n :id=\"dropdownId\"\n data-testid=\"input-field-dropdown-container-end\"\n class=\"b-input-field__dropdown b-input-field__dropdown--end\"\n @click.stop\n >\n <bento-dropdown\n v-if=\"dropdown\"\n :id=\"dropdownId\"\n v-bind=\"inputFieldDropdownProps\"\n :disabled=\"disabled\"\n :readonly=\"isReadOnly\"\n @input=\"onDropdownInput\"\n />\n </div>\n </div>\n\n <error-message\n v-if=\"shouldShowError && !!errorMessage\"\n :id=\"errorId\"\n :error-message=\"errorMessage\"\n class=\"b-input-field__error-message\"\n />\n\n <span v-if=\"hasSlot('description')\" :id=\"descriptionId\" class=\"b-input-field__description\" @click=\"focusInput\">\n <bento-typography el=\"span\" variant=\"body\">\n <slot id=\"description\" name=\"description\" />\n </bento-typography>\n </span>\n </bento-typography>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, PropType, provide, ref, toRef, toRefs, useAttrs, useSlots } from 'vue';\n\n // Components\n import { BentoDropdown } from '@/components/dropdown';\n import { BentoTypography } from '@/components/typography';\n import { ErrorMessage, FieldLabel } from '@/internal';\n\n // Utils\n import { deprecate } from '@/utils/ts/deprecate';\n import { generateUid } from '@/utils/ts/unique-id';\n import { getSlotText } from '@/utils/ts/get-slot-text';\n import { useAriaLabel } from '@/utils/ts/aria-label';\n import { useI18n } from '@/utils/ts/i18n';\n import { printDevelopmentWarning } from '@/utils/ts/print-development-warning';\n import { INPUT_FIELD_COMPONENT_INJECTION_KEY } from '@/components/input-field/input-field.keys';\n\n // Composables\n import { useFormLayoutFieldLoading, useHasSlot } from '@/composables';\n\n // Types\n import {\n BentoInputDropdownProps,\n BentoInputFieldElementPosition,\n BentoInputFieldStateClass,\n BentoInputFieldType,\n BentoInputFieldValue,\n BentoInputFieldVariant,\n } from './input-field.types';\n import { BentoListboxSelectedValue } from '@/types';\n\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const attrs = useAttrs();\n const slots = useSlots();\n\n const props = defineProps({\n /**\n * Indicates whether the element is exposed to an accessibility API.\n */\n ariaHidden: { type: Boolean, default: true },\n\n /**\n * @deprecated from version 2.0.0. Use the aria-label attribute instead.\n */\n /**\n * Text that labels an the input element\n */\n ariaLabel: { type: String, default: undefined },\n\n /**\n * Reduces height of the input\n */\n condensed: { type: Boolean, default: false },\n\n /**\n * Disables the possibility of changing value in the input-field\n */\n disabled: { type: Boolean, default: false },\n\n /**\n * Dropdown props for the small selectable dropdown menu.\n * Properties supported:\n *\n * - `value`: Selected value of the dropdown\n * - `items`: List of available items\n * - `aria-label`: Text that labels the dropdown element\n *\n */\n dropdown: {\n type: Object as PropType<BentoInputDropdownProps>,\n default: undefined,\n },\n\n /**\n * Position of the dropdown before or after input value\n */\n dropdownPosition: {\n type: String as PropType<BentoInputFieldElementPosition | `${BentoInputFieldElementPosition}`>,\n default: BentoInputFieldElementPosition.START,\n validator: (value: BentoInputFieldElementPosition) =>\n Object.values(BentoInputFieldElementPosition).includes(value),\n },\n\n /**\n * Adds error validation class for outlining input-field.\n *\n * @deprecated Use \"errorMessage\" prop instead\n */\n error: { type: Boolean, default: false },\n\n /**\n * Renders input-field with an error state and the error message beneath the input box\n */\n errorMessage: { type: String, default: null },\n\n /**\n * Highlights the dropdown is optional.\n */\n optional: { type: Boolean, default: false },\n\n /**\n * Text displayed as the placeholder of the input-field\n */\n placeholder: { type: String, default: '' },\n\n /**\n * Highlights the dropdown is required.\n */\n required: { type: Boolean, default: false },\n\n /**\n * Setting this property to true will set the input field to read only state.\n */\n readonly: { type: Boolean, default: false },\n\n /**\n * Static text that displayed before or after input value\n * Applicable to the Static Value variant\n */\n staticValue: { type: String, default: '' },\n\n /**\n * Position of Static Value before or after input value\n */\n staticValuePosition: {\n type: String as PropType<BentoInputFieldElementPosition | `${BentoInputFieldElementPosition}`>,\n default: BentoInputFieldElementPosition.START,\n validator: (value: BentoInputFieldElementPosition) =>\n Object.values(BentoInputFieldElementPosition).includes(value),\n },\n\n /**\n * Adds a info icon next to the label to display the passed tooltip message.\n */\n tooltipText: { type: String, default: null },\n\n /**\n * A string specifying the type of control to render.\n * All `input` types are available but only `search`, `text` and `number` are fully supported.\n *\n * If `type` is `search`, use `bento-search-bar` instead.\n */\n type: {\n type: String as PropType<BentoInputFieldType | `${BentoInputFieldType}` | HTMLInputElement['type']>,\n default: BentoInputFieldType.TEXT,\n },\n\n /**\n * Text displayed as the value of the input-field\n */\n value: { type: [String, Number] as PropType<BentoInputFieldValue>, default: undefined },\n\n /**\n * Describes the different variants for the input element\n */\n variant: {\n type: String as PropType<BentoInputFieldVariant | `${BentoInputFieldVariant}`>,\n default: BentoInputFieldVariant.DEFAULT,\n validator: (value: BentoInputFieldVariant) => Object.values(BentoInputFieldVariant).includes(value),\n },\n });\n\n const emit = defineEmits<{\n /**\n * Emitted when the Input Field's internal dropdown changes it's value. Contains every dropdown prop passed with the updated selected value as 'value'\n */\n (e: 'update:dropdown', updatedDropdownProps: BentoInputDropdownProps): void;\n\n /**\n * Emitted when the element has lost focus\n */\n (e: 'blur'): void;\n\n /**\n * Emitted when the user modifies the element's value. Unlike the 'input' event, the change event is not necessarily fired for each alteration to an element's value\n */\n (e: 'change'): void;\n\n /**\n * Emitted when the Input Field's internal dropdown changes it's value\n */\n (e: 'dropdown-input', selectedValue: BentoListboxSelectedValue): void;\n\n /**\n * Emitted when the \"ESC\" key is pressed\n */\n (e: 'escape-pressed'): void;\n\n /**\n * Emitted when the element has received focus\n */\n (e: 'focus'): void;\n\n /**\n * Emitted when a key is pressed\n */\n (e: 'keydown', event: KeyboardEvent): void;\n\n /**\n * Emitted when the component's model changes\n */\n (e: 'input', inputValue: string): void;\n }>();\n\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n const hasSlot = useHasSlot(slots);\n const inputFieldElement = ref(null);\n const inputFieldId = generateUid('input');\n const dropdownId = generateUid('input-dropdown');\n const staticValueId = generateUid('input-static-value');\n const descriptionId = generateUid('input-description');\n const errorId = generateUid('input-error');\n\n // Provide INPUT_FIELD_COMPONENT_INJECTION_KEY as true, to set the input only dropdown size variant in the BentoDropdown comp\n provide(INPUT_FIELD_COMPONENT_INJECTION_KEY, true);\n\n const { isReadOnly } = useFormLayoutFieldLoading(toRef(props, 'readonly'));\n\n const shouldShowStaticValue = computed(\n () => props.variant === BentoInputFieldVariant.STATIC_VALUE && !!slots.staticValue\n );\n\n const isDefaultVariant = computed(() => props.variant === BentoInputFieldVariant.DEFAULT);\n\n const isPaymentMethodVariant = computed(() => props.variant === BentoInputFieldVariant.PAYMENT_METHOD);\n\n const shouldDisplayStaticValueAtStart = computed(\n () => shouldShowStaticValue.value && props.staticValuePosition === BentoInputFieldElementPosition.START\n );\n const shouldDisplayStaticValueAtEnd = computed(\n () => shouldShowStaticValue.value && props.staticValuePosition === BentoInputFieldElementPosition.END\n );\n\n const shouldShowDropdown = computed(() => props.variant === BentoInputFieldVariant.DROPDOWN && !!props.dropdown);\n const shouldDisplayDropdownAtStart = computed(\n () => shouldShowDropdown.value && props.dropdownPosition === BentoInputFieldElementPosition.START\n );\n const shouldDisplayDropdownAtEnd = computed(\n () => shouldShowDropdown.value && props.dropdownPosition === BentoInputFieldElementPosition.END\n );\n\n const shouldShowError = computed(\n () => !props.disabled && !isReadOnly.value && (!!props.errorMessage || props.error)\n );\n\n const computedAriaOwns = computed(() => {\n if (shouldShowDropdown.value === true && shouldShowStaticValue.value === true) {\n return `${staticValueId} ${dropdownId}`;\n }\n if (shouldShowDropdown.value === true) {\n return `${dropdownId}`;\n }\n if (shouldShowStaticValue.value === true) {\n return `${staticValueId}`;\n }\n return null;\n });\n\n // vue-i18n issue with t() used in script - direct usage in template works\n // requires either createI18n({ legacy: false }) or to be wrapped in computed()\n const computedAriaLabelFallbackMessage = computed(() => t('ariaLabelFallback'));\n const computedAriaLabelDropdowFallback = computed(() =>\n t('ariaLabelDropdownFallback', { inputLabel: computedAriaLabel.value })\n );\n\n const ariaLabelAttribute = ref(attrs['aria-label']);\n const { ariaLabel } = toRefs(props);\n const computedAriaLabel = useAriaLabel({\n ariaLabel: ariaLabelAttribute.value as string,\n // TODO: take this line away when the aria-label props is removed\n label: ariaLabel,\n defaultFallback: hasSlot('default')\n ? (getSlotText(slots)('default') as string)\n : computedAriaLabelFallbackMessage,\n });\n\n const computedAriaDescribedBy = computed(\n () =>\n `${hasSlot('description') ? descriptionId : ''} ${\n shouldShowError.value && !!props.errorMessage ? errorId : ''\n }`\n );\n\n const inputFieldConditionalClasses = computed(() => ({\n [`b-input-field--${BentoInputFieldStateClass.CONDENSED}`]: props.condensed,\n [`b-input-field--${BentoInputFieldStateClass.DISABLED}`]: props.disabled,\n [`b-input-field--${BentoInputFieldStateClass.READONLY}`]: isReadOnly.value,\n [`b-input-field--${BentoInputFieldStateClass.ERROR}`]: shouldShowError.value,\n }));\n\n const inputFieldDropdownProps = computed(() => ({\n 'aria-label': computedAriaLabelDropdowFallback.value,\n ...props.dropdown,\n }));\n\n const onInput = (event: Event) => {\n if (!props.disabled && !isReadOnly.value) {\n emit('input', (event.target as HTMLInputElement).value);\n }\n };\n\n const onDropdownInput = (selectedValue: BentoListboxSelectedValue) => {\n emit('dropdown-input', selectedValue);\n emit('update:dropdown', { ...props?.dropdown, value: selectedValue });\n };\n\n const focusInput = () => {\n inputFieldElement.value.focus();\n };\n\n // Expose method so that other components can focus on it in Vue3\n defineExpose({\n focusInput,\n });\n\n if (!Object.values(BentoInputFieldType).includes(props.type as BentoInputFieldType)) {\n printDevelopmentWarning(`\"bento-input-field\" dropdown does not support the type ${props.type}`);\n }\n\n /**\n * Deprecations\n */\n if (props.error) {\n deprecate(\n 'BentoInputField \"error\" property',\n `Use the BentoInputField \"errorMessage\" property instead to indicate that there is a modifier error.\n Having the field as \"undefined\" will hide/remove the error.\n <bento-dropdown errorMessage=\"Error message text\" />`,\n '2.0.0'\n );\n }\n\n if (hasSlot('defaultIconBefore')) {\n deprecate(\n 'BentoInputField \"defaultIconBefore\" slot',\n `Use the BentoInputField \"iconBefore\" slot instead to add an icon at the left side of the input field\n <bento-input-field>\n \\t<template #iconBefore>\n \\t\\t<my-icon-goes-here />\n \\t</template>\n </bento-input-field>`,\n '2.0.0'\n );\n }\n</script>\n\n<script lang=\"ts\">\n /**\n * Input field component is used to create interactive controls for web-based\n * forms in order to accept data from the user.\n *\n * @example\n * import { BentoInputField } from '@adyen/bento-vue2'\n *\n * const inputValue = ref('');\n *\n * export default {\n * components: { BentoInputField },\n * tempate: `\n * <bento-input-field\n * :value=\"inputValue\"\n * :input=\"newValue => inputValue.value = newValue\"\n * >\n * }\n */\n export default {\n i18n: { messages },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./input-field.scss\" />\n"],"names":["BentoInputFieldVariant","BentoInputFieldVariant2","BentoInputFieldElementPosition","BentoInputFieldElementPosition2","BentoInputFieldStateClass","BentoInputFieldStateClass2","BentoInputFieldType","BentoInputFieldType2","BentoInputFieldEvent","BentoInputFieldEvent2","__default__","messages","attrs","useAttrs","slots","useSlots","props","__props","emit","__emit","t","useI18n","hasSlot","useHasSlot","inputFieldElement","ref","inputFieldId","generateUid","dropdownId","staticValueId","descriptionId","errorId","provide","INPUT_FIELD_COMPONENT_INJECTION_KEY","isReadOnly","useFormLayoutFieldLoading","toRef","shouldShowStaticValue","computed","isDefaultVariant","isPaymentMethodVariant","shouldDisplayStaticValueAtStart","shouldDisplayStaticValueAtEnd","shouldShowDropdown","shouldDisplayDropdownAtStart","shouldDisplayDropdownAtEnd","shouldShowError","computedAriaOwns","computedAriaLabelFallbackMessage","computedAriaLabelDropdowFallback","computedAriaLabel","ariaLabelAttribute","ariaLabel","toRefs","useAriaLabel","getSlotText","computedAriaDescribedBy","inputFieldConditionalClasses","inputFieldDropdownProps","onInput","event","onDropdownInput","selectedValue","focusInput","__expose","printDevelopmentWarning","deprecate"],"mappings":"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"}
1
+ {"version":3,"file":"input-field.CgS1AEGu.js","sources":["../../../vue2/src/components/input-field/input-field.types.ts","../../../vue2/src/components/input-field/input-field.vue"],"sourcesContent":["import { BentoDropdown } from '@/components/dropdown/';\nimport type { HTMLAttributes } from 'vue/types/jsx';\n\n/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoInputFieldVariant {\n DEFAULT = 'default',\n PAYMENT_METHOD = 'payment-method',\n STATIC_VALUE = 'static-value',\n DROPDOWN = 'dropdown',\n}\n\n/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoInputFieldElementPosition {\n START = 'start',\n END = 'end',\n}\n\nexport enum BentoInputFieldStateClass {\n CONDENSED = 'condensed',\n DISABLED = 'disabled',\n READONLY = 'readonly',\n ERROR = 'error',\n}\n\n/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoInputFieldType {\n SEARCH = 'search',\n TEXT = 'text',\n NUMBER = 'number',\n}\n\nexport type BentoInputFieldValue = string | number;\n\ntype DropdownProps = InstanceType<typeof BentoDropdown>['$props'];\nexport type BentoInputDropdownProps = {\n items: DropdownProps['items'];\n value: DropdownProps['value'];\n dynamicFiltering?: DropdownProps['dynamicFiltering'];\n 'aria-label'?: HTMLAttributes['aria-label'];\n};\n\n/**\n * @deprecated The use of these enums is no longer supported.\n * Use `v-on:` or `@` to listen to the events being emitted.\n * This enum will be removed in 2.0.\n */\nexport enum BentoInputFieldEvent {\n INPUT = 'input',\n ESCAPE_PRESSED = 'escape-pressed',\n UPDATE_DROPDOWN = 'update:dropdown',\n DROPDOWN_INPUT = 'dropdown-input',\n FOCUS = 'focus',\n CHANGE = 'change',\n BLUR = 'blur',\n KEYDOWN = 'keydown',\n}\n","<template>\n <bento-typography\n class=\"b-input-field\"\n data-testid=\"input-text-container\"\n :class=\"inputFieldConditionalClasses\"\n el=\"div\"\n variant=\"body\"\n >\n <field-label\n v-if=\"hasSlot('default')\"\n :for=\"inputFieldId\"\n data-testid=\"input-field-label\"\n :tooltip-text=\"tooltipText\"\n :optional=\"optional\"\n :required=\"required\"\n @click=\"focusInput\"\n >\n <slot></slot>\n </field-label>\n\n <div class=\"b-input-field__input-box\" data-testid=\"input-box\" :aria-disabled=\"disabled\" @click=\"focusInput\">\n <!-- Optional Icon for Default text variant -->\n <span\n v-if=\"isDefaultVariant && (hasSlot('defaultIconBefore') || hasSlot('iconBefore'))\"\n :aria-hidden=\"ariaHidden ? 'true' : undefined\"\n class=\"b-input-field__icon-before\"\n >\n <slot v-if=\"hasSlot('iconBefore')\" name=\"iconBefore\" />\n <slot v-if=\"hasSlot('defaultIconBefore') && !hasSlot('iconBefore')\" name=\"defaultIconBefore\" />\n </span>\n\n <!-- Mandatory Icon for Payment Method variant -->\n <span\n v-if=\"isPaymentMethodVariant && hasSlot('paymentMethod')\"\n :aria-hidden=\"ariaHidden ? 'true' : undefined\"\n class=\"b-input-field__payment-method\"\n >\n <slot name=\"paymentMethod\" />\n </span>\n\n <!-- Dropdown at start -->\n <div\n v-if=\"shouldDisplayDropdownAtStart\"\n :id=\"dropdownId\"\n class=\"b-input-field__dropdown b-input-field__dropdown--start\"\n @click.stop\n >\n <bento-dropdown\n v-if=\"dropdown\"\n v-bind=\"inputFieldDropdownProps\"\n :disabled=\"disabled\"\n :readonly=\"isReadOnly\"\n @input=\"onDropdownInput\"\n />\n </div>\n\n <!-- Static Value at start -->\n <bento-typography\n v-if=\"shouldDisplayStaticValueAtStart\"\n :id=\"staticValueId\"\n class=\"b-input-field__static-value b-input-field__static-value--start\"\n el=\"span\"\n variant=\"body\"\n >\n <slot name=\"staticValue\" />\n </bento-typography>\n\n <input\n :id=\"inputFieldId\"\n v-bind=\"attrs\"\n ref=\"inputFieldElement\"\n class=\"b-input-field__input\"\n :aria-label=\"computedAriaLabel\"\n :aria-describedby=\"computedAriaDescribedBy\"\n :aria-owns=\"computedAriaOwns\"\n :aria-invalid=\"shouldShowError\"\n :placeholder=\"placeholder\"\n :type=\"type\"\n :value=\"value\"\n :disabled=\"disabled\"\n :readonly=\"isReadOnly\"\n @input=\"onInput\"\n @change=\"emit('change')\"\n @focus=\"emit('focus')\"\n @blur=\"emit('blur')\"\n @keydown=\"emit('keydown', $event)\"\n @keydown.esc=\"emit('escape-pressed')\"\n />\n <span\n v-if=\"hasSlot('iconAfter')\"\n :aria-hidden=\"ariaHidden ? 'true' : undefined\"\n class=\"b-input-field__icon-after\"\n data-testid=\"input-text__icon-after\"\n >\n <slot name=\"iconAfter\" />\n </span>\n\n <!-- Static Value at the end -->\n <bento-typography\n v-if=\"shouldDisplayStaticValueAtEnd\"\n :id=\"staticValueId\"\n class=\"b-input-field__static-value b-input-field__static-value--end\"\n el=\"span\"\n variant=\"body\"\n >\n <slot name=\"staticValue\" />\n </bento-typography>\n\n <!-- Dropdown at end -->\n <div\n v-if=\"shouldDisplayDropdownAtEnd\"\n :id=\"dropdownId\"\n data-testid=\"input-field-dropdown-container-end\"\n class=\"b-input-field__dropdown b-input-field__dropdown--end\"\n @click.stop\n >\n <bento-dropdown\n v-if=\"dropdown\"\n :id=\"dropdownId\"\n v-bind=\"inputFieldDropdownProps\"\n :disabled=\"disabled\"\n :readonly=\"isReadOnly\"\n @input=\"onDropdownInput\"\n />\n </div>\n </div>\n\n <error-message\n v-if=\"shouldShowError && !!errorMessage\"\n :id=\"errorId\"\n :error-message=\"errorMessage\"\n class=\"b-input-field__error-message\"\n />\n\n <span v-if=\"hasSlot('description')\" :id=\"descriptionId\" class=\"b-input-field__description\" @click=\"focusInput\">\n <bento-typography el=\"span\" variant=\"body\">\n <slot id=\"description\" name=\"description\" />\n </bento-typography>\n </span>\n </bento-typography>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, PropType, provide, ref, toRef, toRefs, useAttrs, useSlots } from 'vue';\n\n // Components\n import { BentoDropdown } from '@/components/dropdown';\n import { BentoTypography } from '@/components/typography';\n import { ErrorMessage, FieldLabel } from '@/internal';\n\n // Utils\n import { deprecate } from '@/utils/ts/deprecate';\n import { generateUid } from '@/utils/ts/unique-id';\n import { getSlotText } from '@/utils/ts/get-slot-text';\n import { useAriaLabel } from '@/utils/ts/aria-label';\n import { useI18n } from '@/utils/ts/i18n';\n import { printDevelopmentWarning } from '@/utils/ts/print-development-warning';\n import { INPUT_FIELD_COMPONENT_INJECTION_KEY } from '@/components/input-field/input-field.keys';\n\n // Composables\n import { useFormLayoutFieldLoading, useHasSlot } from '@/composables';\n\n // Types\n import {\n BentoInputDropdownProps,\n BentoInputFieldElementPosition,\n BentoInputFieldStateClass,\n BentoInputFieldType,\n BentoInputFieldValue,\n BentoInputFieldVariant,\n } from './input-field.types';\n import { BentoListboxSelectedValue } from '@/types';\n\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const attrs = useAttrs();\n const slots = useSlots();\n\n const props = defineProps({\n /**\n * Indicates whether the element is exposed to an accessibility API.\n */\n ariaHidden: { type: Boolean, default: true },\n\n /**\n * @deprecated from version 2.0.0. Use the aria-label attribute instead.\n */\n /**\n * Text that labels an the input element\n */\n ariaLabel: { type: String, default: undefined },\n\n /**\n * Reduces height of the input\n */\n condensed: { type: Boolean, default: false },\n\n /**\n * Disables the possibility of changing value in the input-field\n */\n disabled: { type: Boolean, default: false },\n\n /**\n * Dropdown props for the small selectable dropdown menu.\n * Properties supported:\n *\n * - `value`: Selected value of the dropdown\n * - `items`: List of available items\n * - `aria-label`: Text that labels the dropdown element\n *\n */\n dropdown: {\n type: Object as PropType<BentoInputDropdownProps>,\n default: undefined,\n },\n\n /**\n * Position of the dropdown before or after input value\n */\n dropdownPosition: {\n type: String as PropType<BentoInputFieldElementPosition | `${BentoInputFieldElementPosition}`>,\n default: BentoInputFieldElementPosition.START,\n validator: (value: BentoInputFieldElementPosition) =>\n Object.values(BentoInputFieldElementPosition).includes(value),\n },\n\n /**\n * Adds error validation class for outlining input-field.\n *\n * @deprecated Use \"errorMessage\" prop instead\n */\n error: { type: Boolean, default: false },\n\n /**\n * Renders input-field with an error state and the error message beneath the input box\n */\n errorMessage: { type: String, default: null },\n\n /**\n * Highlights the dropdown is optional.\n */\n optional: { type: Boolean, default: false },\n\n /**\n * Text displayed as the placeholder of the input-field\n */\n placeholder: { type: String, default: '' },\n\n /**\n * Highlights the dropdown is required.\n */\n required: { type: Boolean, default: false },\n\n /**\n * Setting this property to true will set the input field to read only state.\n */\n readonly: { type: Boolean, default: false },\n\n /**\n * Static text that displayed before or after input value\n * Applicable to the Static Value variant\n */\n staticValue: { type: String, default: '' },\n\n /**\n * Position of Static Value before or after input value\n */\n staticValuePosition: {\n type: String as PropType<BentoInputFieldElementPosition | `${BentoInputFieldElementPosition}`>,\n default: BentoInputFieldElementPosition.START,\n validator: (value: BentoInputFieldElementPosition) =>\n Object.values(BentoInputFieldElementPosition).includes(value),\n },\n\n /**\n * Adds a info icon next to the label to display the passed tooltip message.\n */\n tooltipText: { type: String, default: null },\n\n /**\n * A string specifying the type of control to render.\n * All `input` types are available but only `search`, `text` and `number` are fully supported.\n *\n * If `type` is `search`, use `bento-search-bar` instead.\n */\n type: {\n type: String as PropType<BentoInputFieldType | `${BentoInputFieldType}` | HTMLInputElement['type']>,\n default: BentoInputFieldType.TEXT,\n },\n\n /**\n * Text displayed as the value of the input-field\n */\n value: { type: [String, Number] as PropType<BentoInputFieldValue>, default: undefined },\n\n /**\n * Describes the different variants for the input element\n */\n variant: {\n type: String as PropType<BentoInputFieldVariant | `${BentoInputFieldVariant}`>,\n default: BentoInputFieldVariant.DEFAULT,\n validator: (value: BentoInputFieldVariant) => Object.values(BentoInputFieldVariant).includes(value),\n },\n });\n\n const emit = defineEmits<{\n /**\n * Emitted when the Input Field's internal dropdown changes it's value. Contains every dropdown prop passed with the updated selected value as 'value'\n */\n (e: 'update:dropdown', updatedDropdownProps: BentoInputDropdownProps): void;\n\n /**\n * Emitted when the element has lost focus\n */\n (e: 'blur'): void;\n\n /**\n * Emitted when the user modifies the element's value. Unlike the 'input' event, the change event is not necessarily fired for each alteration to an element's value\n */\n (e: 'change'): void;\n\n /**\n * Emitted when the Input Field's internal dropdown changes it's value\n */\n (e: 'dropdown-input', selectedValue: BentoListboxSelectedValue): void;\n\n /**\n * Emitted when the \"ESC\" key is pressed\n */\n (e: 'escape-pressed'): void;\n\n /**\n * Emitted when the element has received focus\n */\n (e: 'focus'): void;\n\n /**\n * Emitted when a key is pressed\n */\n (e: 'keydown', event: KeyboardEvent): void;\n\n /**\n * Emitted when the component's model changes\n */\n (e: 'input', inputValue: string): void;\n }>();\n\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n const hasSlot = useHasSlot(slots);\n const inputFieldElement = ref(null);\n const inputFieldId = generateUid('input');\n const dropdownId = generateUid('input-dropdown');\n const staticValueId = generateUid('input-static-value');\n const descriptionId = generateUid('input-description');\n const errorId = generateUid('input-error');\n\n // Provide INPUT_FIELD_COMPONENT_INJECTION_KEY as true, to set the input only dropdown size variant in the BentoDropdown comp\n provide(INPUT_FIELD_COMPONENT_INJECTION_KEY, true);\n\n const { isReadOnly } = useFormLayoutFieldLoading(toRef(props, 'readonly'));\n\n const shouldShowStaticValue = computed(\n () => props.variant === BentoInputFieldVariant.STATIC_VALUE && !!slots.staticValue\n );\n\n const isDefaultVariant = computed(() => props.variant === BentoInputFieldVariant.DEFAULT);\n\n const isPaymentMethodVariant = computed(() => props.variant === BentoInputFieldVariant.PAYMENT_METHOD);\n\n const shouldDisplayStaticValueAtStart = computed(\n () => shouldShowStaticValue.value && props.staticValuePosition === BentoInputFieldElementPosition.START\n );\n const shouldDisplayStaticValueAtEnd = computed(\n () => shouldShowStaticValue.value && props.staticValuePosition === BentoInputFieldElementPosition.END\n );\n\n const shouldShowDropdown = computed(() => props.variant === BentoInputFieldVariant.DROPDOWN && !!props.dropdown);\n const shouldDisplayDropdownAtStart = computed(\n () => shouldShowDropdown.value && props.dropdownPosition === BentoInputFieldElementPosition.START\n );\n const shouldDisplayDropdownAtEnd = computed(\n () => shouldShowDropdown.value && props.dropdownPosition === BentoInputFieldElementPosition.END\n );\n\n const shouldShowError = computed(\n () => !props.disabled && !isReadOnly.value && (!!props.errorMessage || props.error)\n );\n\n const computedAriaOwns = computed(() => {\n if (shouldShowDropdown.value === true && shouldShowStaticValue.value === true) {\n return `${staticValueId} ${dropdownId}`;\n }\n if (shouldShowDropdown.value === true) {\n return `${dropdownId}`;\n }\n if (shouldShowStaticValue.value === true) {\n return `${staticValueId}`;\n }\n return null;\n });\n\n // vue-i18n issue with t() used in script - direct usage in template works\n // requires either createI18n({ legacy: false }) or to be wrapped in computed()\n const computedAriaLabelFallbackMessage = computed(() => t('ariaLabelFallback'));\n const computedAriaLabelDropdowFallback = computed(() =>\n t('ariaLabelDropdownFallback', { inputLabel: computedAriaLabel.value })\n );\n\n const ariaLabelAttribute = ref(attrs['aria-label']);\n const { ariaLabel } = toRefs(props);\n const computedAriaLabel = useAriaLabel({\n ariaLabel: ariaLabelAttribute.value as string,\n // TODO: take this line away when the aria-label props is removed\n label: ariaLabel,\n defaultFallback: hasSlot('default')\n ? (getSlotText(slots)('default') as string)\n : computedAriaLabelFallbackMessage,\n });\n\n const computedAriaDescribedBy = computed(\n () =>\n `${hasSlot('description') ? descriptionId : ''} ${\n shouldShowError.value && !!props.errorMessage ? errorId : ''\n }`\n );\n\n const inputFieldConditionalClasses = computed(() => ({\n [`b-input-field--${BentoInputFieldStateClass.CONDENSED}`]: props.condensed,\n [`b-input-field--${BentoInputFieldStateClass.DISABLED}`]: props.disabled,\n [`b-input-field--${BentoInputFieldStateClass.READONLY}`]: isReadOnly.value,\n [`b-input-field--${BentoInputFieldStateClass.ERROR}`]: shouldShowError.value,\n }));\n\n const inputFieldDropdownProps = computed(() => ({\n 'aria-label': computedAriaLabelDropdowFallback.value,\n ...props.dropdown,\n }));\n\n const onInput = (event: Event) => {\n if (!props.disabled && !isReadOnly.value) {\n emit('input', (event.target as HTMLInputElement).value);\n }\n };\n\n const onDropdownInput = (selectedValue: BentoListboxSelectedValue) => {\n emit('dropdown-input', selectedValue);\n emit('update:dropdown', { ...props?.dropdown, value: selectedValue });\n };\n\n const focusInput = () => {\n inputFieldElement.value.focus();\n };\n\n // Expose method so that other components can focus on it in Vue3\n defineExpose({\n focusInput,\n });\n\n if (!Object.values(BentoInputFieldType).includes(props.type as BentoInputFieldType)) {\n printDevelopmentWarning(`\"bento-input-field\" dropdown does not support the type ${props.type}`);\n }\n\n /**\n * Deprecations\n */\n if (props.error) {\n deprecate(\n 'BentoInputField \"error\" property',\n `Use the BentoInputField \"errorMessage\" property instead to indicate that there is a modifier error.\n Having the field as \"undefined\" will hide/remove the error.\n <bento-dropdown errorMessage=\"Error message text\" />`,\n '2.0.0'\n );\n }\n\n if (hasSlot('defaultIconBefore')) {\n deprecate(\n 'BentoInputField \"defaultIconBefore\" slot',\n `Use the BentoInputField \"iconBefore\" slot instead to add an icon at the left side of the input field\n <bento-input-field>\n \\t<template #iconBefore>\n \\t\\t<my-icon-goes-here />\n \\t</template>\n </bento-input-field>`,\n '2.0.0'\n );\n }\n</script>\n\n<script lang=\"ts\">\n /**\n * Input field component is used to create interactive controls for web-based\n * forms in order to accept data from the user.\n *\n * @example\n * import { BentoInputField } from '@adyen/bento-vue2'\n *\n * const inputValue = ref('');\n *\n * export default {\n * components: { BentoInputField },\n * tempate: `\n * <bento-input-field\n * :value=\"inputValue\"\n * :input=\"newValue => inputValue.value = newValue\"\n * >\n * }\n */\n export default {\n i18n: { messages },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./input-field.scss\" />\n"],"names":["BentoInputFieldVariant","BentoInputFieldVariant2","BentoInputFieldElementPosition","BentoInputFieldElementPosition2","BentoInputFieldStateClass","BentoInputFieldStateClass2","BentoInputFieldType","BentoInputFieldType2","BentoInputFieldEvent","BentoInputFieldEvent2","__default__","messages","attrs","useAttrs","slots","useSlots","props","__props","emit","__emit","t","useI18n","hasSlot","useHasSlot","inputFieldElement","ref","inputFieldId","generateUid","dropdownId","staticValueId","descriptionId","errorId","provide","INPUT_FIELD_COMPONENT_INJECTION_KEY","isReadOnly","useFormLayoutFieldLoading","toRef","shouldShowStaticValue","computed","isDefaultVariant","isPaymentMethodVariant","shouldDisplayStaticValueAtStart","shouldDisplayStaticValueAtEnd","shouldShowDropdown","shouldDisplayDropdownAtStart","shouldDisplayDropdownAtEnd","shouldShowError","computedAriaOwns","computedAriaLabelFallbackMessage","computedAriaLabelDropdowFallback","computedAriaLabel","ariaLabelAttribute","ariaLabel","toRefs","useAriaLabel","getSlotText","computedAriaDescribedBy","inputFieldConditionalClasses","inputFieldDropdownProps","onInput","event","onDropdownInput","selectedValue","focusInput","__expose","printDevelopmentWarning","deprecate"],"mappings":"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"}
@@ -1,21 +1,29 @@
1
- import { defineComponent as E, ref as h, computed as x, openBlock as i, createElementBlock as _, normalizeClass as I, createElementVNode as s, renderSlot as u, createVNode as o, Transition as T, withCtx as n, unref as e, createTextVNode as $, toDisplayString as z, createBlock as f, createCommentVNode as v } from "vue";
2
- import { B as L } from "./typography.z9P0Ec3Q.js";
3
- import { B as b } from "./button.Br6CyG40.js";
4
- import { B as N } from "./focus-trap.CwkbHfT8.js";
5
- import { B as O } from "./loading-indicator.BFMEf39U.js";
6
- import { E as S } from "./expand.CgwNEbbz.js";
7
- import { C as V } from "./cross.OvPfvoqX.js";
8
- import { g as w } from "./unique-id.XFfoKuc2.js";
9
- import { u as F } from "./i18n.DL9GT2-k.js";
1
+ import { defineComponent as k, ref as E, computed as h, openBlock as i, createElementBlock as _, normalizeClass as I, createElementVNode as s, renderSlot as u, createVNode as o, Transition as T, withCtx as n, unref as e, createTextVNode as $, toDisplayString as z, createBlock as f, createCommentVNode as v } from "vue";
2
+ import { B as F } from "./typography.z9P0Ec3Q.js";
3
+ import { B } from "./button.Br6CyG40.js";
4
+ import { B as L } from "./focus-trap.CwkbHfT8.js";
5
+ import { B as N } from "./loading-indicator.BFMEf39U.js";
6
+ import { E as O } from "./expand.CgwNEbbz.js";
7
+ import { C as S } from "./cross.OvPfvoqX.js";
8
+ import { g as V } from "./unique-id.XFfoKuc2.js";
9
+ import { u as w } from "./i18n.DL9GT2-k.js";
10
10
  import { _ as U } from "./_plugin-vue_export-helper.CHgC5LLL.js";
11
11
  import "../assets/inspector.css";
12
- const g = {
12
+ const b = {
13
13
  "en-US": {
14
14
  close: "Close",
15
15
  expand: "Expand"
16
+ },
17
+ "pt-BR": {
18
+ close: "Fechar",
19
+ expand: "Expandir"
20
+ },
21
+ "ja-JP": {
22
+ close: "閉じる",
23
+ expand: "展開"
16
24
  }
17
- }, A = { class: "b-inspector__page-wrapper" }, D = { class: "b-inspector__page" }, j = ["aria-labelledby"], q = { class: "b-inspector__header" }, G = { class: "b-inspector__icons" }, H = { class: "b-inspector__content" }, J = { i18n: { messages: g } }, K = /* @__PURE__ */ E({
18
- ...J,
25
+ }, j = { class: "b-inspector__page-wrapper" }, A = { class: "b-inspector__page" }, D = ["aria-labelledby"], J = { class: "b-inspector__header" }, P = { class: "b-inspector__icons" }, R = { class: "b-inspector__content" }, q = { i18n: { messages: b } }, G = /* @__PURE__ */ k({
26
+ ...q,
19
27
  __name: "inspector",
20
28
  props: {
21
29
  expandable: { type: Boolean, default: !1 },
@@ -25,18 +33,18 @@ const g = {
25
33
  title: {}
26
34
  },
27
35
  emits: ["update:is-open", "expand"],
28
- setup(B, { emit: y }) {
29
- const r = B, l = y, { t: c } = F({ messages: g }), p = w("inspectorTitle"), d = h(null), C = x(() => ({
36
+ setup(g, { emit: y }) {
37
+ const r = g, l = y, { t: p } = w({ messages: b }), c = V("inspectorTitle"), d = E(null), x = h(() => ({
30
38
  [`b-inspector--${r.size}`]: !0
31
39
  })), m = () => {
32
40
  var t;
33
41
  r.isOpen ? d.value = document.activeElement : (t = d.value) == null || t.focus();
34
42
  };
35
43
  return (t, a) => (i(), _("div", {
36
- class: I(["b-inspector", C.value])
44
+ class: I(["b-inspector", x.value])
37
45
  }, [
38
- s("div", A, [
39
- s("div", D, [
46
+ s("div", j, [
47
+ s("div", A, [
40
48
  u(t.$slots, "page", {}, void 0, !0)
41
49
  ])
42
50
  ]),
@@ -50,13 +58,13 @@ const g = {
50
58
  t.isOpen ? (i(), _("aside", {
51
59
  key: 0,
52
60
  class: "b-inspector__container-wrapper",
53
- "aria-labelledby": e(p)
61
+ "aria-labelledby": e(c)
54
62
  }, [
55
- o(e(N), { class: "b-inspector__container" }, {
63
+ o(e(L), { class: "b-inspector__container" }, {
56
64
  default: n(() => [
57
- s("div", q, [
58
- o(e(L), {
59
- id: e(p),
65
+ s("div", J, [
66
+ o(e(F), {
67
+ id: e(c),
60
68
  el: "h2",
61
69
  variant: "title",
62
70
  class: "b-inspector__title"
@@ -66,34 +74,34 @@ const g = {
66
74
  ]),
67
75
  _: 1
68
76
  }, 8, ["id"]),
69
- s("div", G, [
70
- t.expandable ? (i(), f(e(b), {
77
+ s("div", P, [
78
+ t.expandable ? (i(), f(e(B), {
71
79
  key: 0,
72
80
  variant: "tertiary",
73
- onClick: a[0] || (a[0] = (k) => l("expand"))
81
+ onClick: a[0] || (a[0] = (C) => l("expand"))
74
82
  }, {
75
83
  iconLeft: n(() => [
76
- o(e(S), {
77
- "svg-title": e(c)("expand")
84
+ o(e(O), {
85
+ "svg-title": e(p)("expand")
78
86
  }, null, 8, ["svg-title"])
79
87
  ]),
80
88
  _: 1
81
89
  })) : v("", !0),
82
- o(e(b), {
90
+ o(e(B), {
83
91
  variant: "tertiary",
84
- onClick: a[1] || (a[1] = (k) => l("update:is-open", !1))
92
+ onClick: a[1] || (a[1] = (C) => l("update:is-open", !1))
85
93
  }, {
86
94
  iconLeft: n(() => [
87
- o(e(V), {
88
- "svg-title": e(c)("close")
95
+ o(e(S), {
96
+ "svg-title": e(p)("close")
89
97
  }, null, 8, ["svg-title"])
90
98
  ]),
91
99
  _: 1
92
100
  })
93
101
  ])
94
102
  ]),
95
- s("div", H, [
96
- t.loading ? (i(), f(e(O), {
103
+ s("div", R, [
104
+ t.loading ? (i(), f(e(N), {
97
105
  key: 0,
98
106
  large: "",
99
107
  class: "b-inspector__loading-indicator"
@@ -102,15 +110,15 @@ const g = {
102
110
  ]),
103
111
  _: 3
104
112
  })
105
- ], 8, j)) : v("", !0)
113
+ ], 8, D)) : v("", !0)
106
114
  ]),
107
115
  _: 3
108
116
  })
109
117
  ], 2));
110
118
  }
111
- }), oe = /* @__PURE__ */ U(K, [["__scopeId", "data-v-d920598e"]]), se = ["small", "large"];
119
+ }), oe = /* @__PURE__ */ U(G, [["__scopeId", "data-v-d920598e"]]), se = ["small", "large"];
112
120
  export {
113
121
  se as B,
114
122
  oe as i
115
123
  };
116
- //# sourceMappingURL=inspector.types.t2SPyhw3.js.map
124
+ //# sourceMappingURL=inspector.types.xpv2J9pJ.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"inspector.types.t2SPyhw3.js","sources":["../../../vue2/src/components/inspector/inspector.vue","../../../vue2/src/components/inspector/inspector.types.ts"],"sourcesContent":["<template>\n <div class=\"b-inspector\" :class=\"conditionalClass\">\n <div class=\"b-inspector__page-wrapper\">\n <div class=\"b-inspector__page\">\n <slot name=\"page\" />\n </div>\n </div>\n <Transition name=\"b-inspector__animation\" mode=\"out-in\" @before-enter=\"setFocus\" @after-leave=\"setFocus\">\n <aside v-if=\"isOpen\" class=\"b-inspector__container-wrapper\" :aria-labelledby=\"titleId\">\n <bento-focus-trap class=\"b-inspector__container\">\n <div class=\"b-inspector__header\">\n <bento-typography :id=\"titleId\" el=\"h2\" variant=\"title\" class=\"b-inspector__title\">\n {{ title }}\n </bento-typography>\n <div class=\"b-inspector__icons\">\n <bento-button v-if=\"expandable\" variant=\"tertiary\" @click=\"emit('expand')\">\n <template #iconLeft><expand-icon :svg-title=\"t('expand')\"></expand-icon></template>\n </bento-button>\n <bento-button variant=\"tertiary\" @click=\"emit('update:is-open', false)\">\n <template #iconLeft><cross-icon :svg-title=\"t('close')\"></cross-icon></template>\n </bento-button>\n </div>\n </div>\n <div class=\"b-inspector__content\">\n <bento-loading-indicator v-if=\"loading\" large class=\"b-inspector__loading-indicator\" />\n <slot v-else name=\"content\" />\n </div>\n </bento-focus-trap>\n </aside>\n </Transition>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, ref } from 'vue';\n import { BentoTypography } from '@/components/typography';\n import { BentoButton } from '@/components/button';\n import { BentoFocusTrap } from '@/components/focus-trap';\n import { BentoLoadingIndicator } from '@/components/loading-indicator';\n import ExpandIcon from '@adyen/ui-assets-icons-16/vue/expand';\n import CrossIcon from '@adyen/ui-assets-icons-16/vue/cross';\n import { generateUid } from '@/utils/ts/unique-id';\n import { useI18n } from '@/utils/ts/i18n';\n import { BentoInspectorSize } from './inspector.types';\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const props = withDefaults(\n defineProps<{\n /**\n * Shows the Expand icon in the inspector\n */\n expandable?: boolean;\n /**\n * Opens and closes the inspector\n */\n isOpen?: boolean;\n\n /**\n * Shows loading indicator for the content\n */\n loading?: boolean;\n\n /**\n * Determines the size of the inspector\n */\n size?: BentoInspectorSize;\n\n /**\n * The title of the component\n */\n title: string;\n }>(),\n {\n expandable: false,\n isOpen: false,\n loading: false,\n size: 'small',\n }\n );\n\n const emit = defineEmits<{\n /**\n * Emits update to keep isOpen prop in sync\n */\n (e: 'update:is-open', value: boolean): void;\n /**\n * Emits event when user click expand button\n */\n (e: 'expand'): void;\n }>();\n\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n const titleId = generateUid('inspectorTitle');\n const lastFocusedElement = ref<HTMLElement>(null);\n\n const conditionalClass = computed(() => ({\n [`b-inspector--${props.size}`]: true,\n }));\n\n const setFocus = () => {\n if (props.isOpen) {\n lastFocusedElement.value = document.activeElement as HTMLElement;\n } else {\n // This doesn't work with data grid cell actions, as the button gets destroyed once is not being hovered.\n // To be reviewed after LevelAccess revision\n lastFocusedElement.value?.focus();\n }\n };\n</script>\n\n<script lang=\"ts\">\n /**\n * Inspector allows users to access additional information or details of an object/item. The inspector opens adjacent to the main content, pushing it aside to maintain visibility and accessibility to both the main content and inspector.\n *\n * @example\n * import { BentoInspector } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoInspector },\n * template: `\n * <bento-inspector\n * title=\"Inspector\"\n * size=\"large\"\n * :is-open=\"isOpen\"\n * @update:is-open=\"isOpen = $event\"\n * >\n * <template #page>Content of the page</template>\n * <template #content>Content of the inspector</template>\n * </bento-inspector>\n * `\n * }\n */\n export default { i18n: { messages } };\n</script>\n\n<style lang=\"scss\" scoped src=\"./inspector.scss\" />\n","export const BentoInspectorSizeOptions = ['small', 'large'] as const;\n\nexport type BentoInspectorSize = (typeof BentoInspectorSizeOptions)[number];\n"],"names":["__default__","messages","props","__props","emit","__emit","t","useI18n","titleId","generateUid","lastFocusedElement","ref","conditionalClass","computed","setFocus","_a","BentoInspectorSizeOptions"],"mappings":";;;;;;;;;;;;;;;;8NAsIIA,IAAA,EAAA,MAAA,EAAA,UAAAC,EAAA,EAAA;;;;;;;;;;;;AAtFA,UAAAC,IAAAC,GAkCAC,IAAAC,GAWA,EAAA,GAAAC,EAAA,IAAAC,EAAA,EAAA,UAAAN,EAAA,CAAA,GACAO,IAAAC,EAAA,gBAAA,GACAC,IAAAC,EAAA,IAAA,GAEAC,IAAAC,EAAA,OAAA;AAAA,MAAyC,CAAA,gBAAAX,EAAA,IAAA,EAAA,GAAA;AAAA,IACL,EAAA,GAGpCY,IAAA,MAAA;;AACI,MAAAZ,EAAA,SACIQ,EAAA,QAAA,SAAA,iBAIAK,IAAAL,EAAA,UAAA,QAAAK,EAAA;AAAA,IACJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mEC5GKC,KAAA,CAAA,SAAA,OAAA;"}
1
+ {"version":3,"file":"inspector.types.xpv2J9pJ.js","sources":["../../../vue2/src/components/inspector/inspector.vue","../../../vue2/src/components/inspector/inspector.types.ts"],"sourcesContent":["<template>\n <div class=\"b-inspector\" :class=\"conditionalClass\">\n <div class=\"b-inspector__page-wrapper\">\n <div class=\"b-inspector__page\">\n <slot name=\"page\" />\n </div>\n </div>\n <Transition name=\"b-inspector__animation\" mode=\"out-in\" @before-enter=\"setFocus\" @after-leave=\"setFocus\">\n <aside v-if=\"isOpen\" class=\"b-inspector__container-wrapper\" :aria-labelledby=\"titleId\">\n <bento-focus-trap class=\"b-inspector__container\">\n <div class=\"b-inspector__header\">\n <bento-typography :id=\"titleId\" el=\"h2\" variant=\"title\" class=\"b-inspector__title\">\n {{ title }}\n </bento-typography>\n <div class=\"b-inspector__icons\">\n <bento-button v-if=\"expandable\" variant=\"tertiary\" @click=\"emit('expand')\">\n <template #iconLeft><expand-icon :svg-title=\"t('expand')\"></expand-icon></template>\n </bento-button>\n <bento-button variant=\"tertiary\" @click=\"emit('update:is-open', false)\">\n <template #iconLeft><cross-icon :svg-title=\"t('close')\"></cross-icon></template>\n </bento-button>\n </div>\n </div>\n <div class=\"b-inspector__content\">\n <bento-loading-indicator v-if=\"loading\" large class=\"b-inspector__loading-indicator\" />\n <slot v-else name=\"content\" />\n </div>\n </bento-focus-trap>\n </aside>\n </Transition>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, ref } from 'vue';\n import { BentoTypography } from '@/components/typography';\n import { BentoButton } from '@/components/button';\n import { BentoFocusTrap } from '@/components/focus-trap';\n import { BentoLoadingIndicator } from '@/components/loading-indicator';\n import ExpandIcon from '@adyen/ui-assets-icons-16/vue/expand';\n import CrossIcon from '@adyen/ui-assets-icons-16/vue/cross';\n import { generateUid } from '@/utils/ts/unique-id';\n import { useI18n } from '@/utils/ts/i18n';\n import { BentoInspectorSize } from './inspector.types';\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const props = withDefaults(\n defineProps<{\n /**\n * Shows the Expand icon in the inspector\n */\n expandable?: boolean;\n /**\n * Opens and closes the inspector\n */\n isOpen?: boolean;\n\n /**\n * Shows loading indicator for the content\n */\n loading?: boolean;\n\n /**\n * Determines the size of the inspector\n */\n size?: BentoInspectorSize;\n\n /**\n * The title of the component\n */\n title: string;\n }>(),\n {\n expandable: false,\n isOpen: false,\n loading: false,\n size: 'small',\n }\n );\n\n const emit = defineEmits<{\n /**\n * Emits update to keep isOpen prop in sync\n */\n (e: 'update:is-open', value: boolean): void;\n /**\n * Emits event when user click expand button\n */\n (e: 'expand'): void;\n }>();\n\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n const titleId = generateUid('inspectorTitle');\n const lastFocusedElement = ref<HTMLElement>(null);\n\n const conditionalClass = computed(() => ({\n [`b-inspector--${props.size}`]: true,\n }));\n\n const setFocus = () => {\n if (props.isOpen) {\n lastFocusedElement.value = document.activeElement as HTMLElement;\n } else {\n // This doesn't work with data grid cell actions, as the button gets destroyed once is not being hovered.\n // To be reviewed after LevelAccess revision\n lastFocusedElement.value?.focus();\n }\n };\n</script>\n\n<script lang=\"ts\">\n /**\n * Inspector allows users to access additional information or details of an object/item. The inspector opens adjacent to the main content, pushing it aside to maintain visibility and accessibility to both the main content and inspector.\n *\n * @example\n * import { BentoInspector } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoInspector },\n * template: `\n * <bento-inspector\n * title=\"Inspector\"\n * size=\"large\"\n * :is-open=\"isOpen\"\n * @update:is-open=\"isOpen = $event\"\n * >\n * <template #page>Content of the page</template>\n * <template #content>Content of the inspector</template>\n * </bento-inspector>\n * `\n * }\n */\n export default { i18n: { messages } };\n</script>\n\n<style lang=\"scss\" scoped src=\"./inspector.scss\" />\n","export const BentoInspectorSizeOptions = ['small', 'large'] as const;\n\nexport type BentoInspectorSize = (typeof BentoInspectorSizeOptions)[number];\n"],"names":["__default__","messages","props","__props","emit","__emit","t","useI18n","titleId","generateUid","lastFocusedElement","ref","conditionalClass","computed","setFocus","_a","BentoInspectorSizeOptions"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;8NAsIIA,IAAA,EAAA,MAAA,EAAA,UAAAC,EAAA,EAAA;;;;;;;;;;;;AAtFA,UAAAC,IAAAC,GAkCAC,IAAAC,GAWA,EAAA,GAAAC,EAAA,IAAAC,EAAA,EAAA,UAAAN,EAAA,CAAA,GACAO,IAAAC,EAAA,gBAAA,GACAC,IAAAC,EAAA,IAAA,GAEAC,IAAAC,EAAA,OAAA;AAAA,MAAyC,CAAA,gBAAAX,EAAA,IAAA,EAAA,GAAA;AAAA,IACL,EAAA,GAGpCY,IAAA,MAAA;;AACI,MAAAZ,EAAA,SACIQ,EAAA,QAAA,SAAA,iBAIAK,IAAAL,EAAA,UAAA,QAAAK,EAAA;AAAA,IACJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mEC5GKC,KAAA,CAAA,SAAA,OAAA;"}
@@ -0,0 +1,137 @@
1
+ import { defineComponent as I, useSlots as k, computed as r, openBlock as o, createBlock as l, normalizeClass as L, withModifiers as A, createSlots as h, withCtx as c, renderSlot as u, unref as s, createElementVNode as N, createCommentVNode as B } from "vue";
2
+ import { B as O } from "./loading-indicator.BFMEf39U.js";
3
+ import { B as i } from "./button.Br6CyG40.js";
4
+ import { C as T } from "./cross-circle-fill.DN5b3_eL.js";
5
+ import { C as $ } from "./checkmark-circle-fill.ChV7Jy6r.js";
6
+ import { u as D } from "./use-has-slot.B7eQSabc.js";
7
+ import { u as F } from "./i18n.DL9GT2-k.js";
8
+ import { _ as G } from "./_plugin-vue_export-helper.CHgC5LLL.js";
9
+ import "../assets/loading-button.css";
10
+ var a = /* @__PURE__ */ ((t) => (t.START = "start", t.LOADING = "loading", t.SUCCESS = "success", t.FAIL = "fail", t))(a || {});
11
+ const f = {
12
+ "en-US": {
13
+ failed: "Failed",
14
+ succeded: "Succeded"
15
+ },
16
+ "pt-BR": {
17
+ failed: "Falha"
18
+ },
19
+ "ja-JP": {
20
+ failed: "失敗しました"
21
+ }
22
+ }, E = {
23
+ class: "b-loading-button__icon",
24
+ "data-testid": "loading-button-rotating-icon"
25
+ }, R = {
26
+ i18n: { messages: f }
27
+ }, U = /* @__PURE__ */ I({
28
+ ...R,
29
+ __name: "loading-button",
30
+ props: {
31
+ /**
32
+ * Reduces sizing of button
33
+ */
34
+ condensed: {
35
+ type: i.props.condensed.type,
36
+ default: !1
37
+ },
38
+ /**
39
+ * Displays loading-button as critical
40
+ */
41
+ critical: {
42
+ type: i.props.critical.type,
43
+ default: !1
44
+ },
45
+ /**
46
+ * Disables button functonality
47
+ */
48
+ disabled: {
49
+ type: i.props.disabled.type,
50
+ default: !1
51
+ },
52
+ /**
53
+ * Sets color set to inverse
54
+ */
55
+ inverse: {
56
+ type: Boolean,
57
+ default: !1
58
+ },
59
+ /**
60
+ * State of the button.
61
+ * @values start, loading, success, fail
62
+ */
63
+ state: {
64
+ type: String,
65
+ default: a.START,
66
+ validator: (t) => Object.values(a).includes(t)
67
+ },
68
+ /**
69
+ * Types of flavour of Button
70
+ */
71
+ variant: {
72
+ type: i.props.variant.type,
73
+ default: "primary",
74
+ validator: i.props.variant.validator
75
+ }
76
+ },
77
+ emits: ["click"],
78
+ setup(t, { emit: v }) {
79
+ const e = t, m = v, p = k(), b = D(p), { t: d } = F({ messages: f }), C = r(() => ({
80
+ [`b-loading-button--${e.variant}-${a.LOADING}`]: e.state === a.LOADING && !e.disabled,
81
+ "b-loading-button--loading": e.state === a.LOADING && !e.disabled,
82
+ [`b-loading-button--${e.variant}-${a.SUCCESS}`]: e.state === a.SUCCESS,
83
+ "b-loading-button--inverse": e.inverse
84
+ })), g = r(
85
+ () => e.variant === "primary" && !e.inverse || e.variant !== "primary" && e.inverse
86
+ ), y = r(
87
+ () => e.critical && e.state === a.START || e.state === a.FAIL
88
+ ), S = (n) => {
89
+ n.stopPropagation(), e.state !== a.LOADING && m("click", n);
90
+ };
91
+ return (n, j) => (o(), l(i, {
92
+ critical: y.value,
93
+ variant: t.variant,
94
+ condensed: t.condensed,
95
+ disabled: t.disabled,
96
+ inverse: t.inverse,
97
+ class: L(["b-loading-button", C.value]),
98
+ onClickCapture: A(S, ["stop"])
99
+ }, h({
100
+ default: c(() => [
101
+ u(n.$slots, "default", {}, void 0, !0)
102
+ ]),
103
+ _: 2
104
+ }, [
105
+ t.state === "start" && s(b)("iconLeft") ? {
106
+ name: "iconLeft",
107
+ fn: c(() => [
108
+ u(n.$slots, "iconLeft", {}, void 0, !0)
109
+ ]),
110
+ key: "0"
111
+ } : t.state !== "start" ? {
112
+ name: "iconLeft",
113
+ fn: c(() => [
114
+ N("span", E, [
115
+ t.state === "fail" ? (o(), l(s(T), {
116
+ key: 0,
117
+ "svg-title": s(d)("failed")
118
+ }, null, 8, ["svg-title"])) : t.state === "success" ? (o(), l(s($), {
119
+ key: 1,
120
+ "svg-title": s(d)("succeded")
121
+ }, null, 8, ["svg-title"])) : t.state === "loading" ? (o(), l(s(O), {
122
+ key: 2,
123
+ small: "",
124
+ inverse: g.value
125
+ }, null, 8, ["inverse"])) : B("", !0)
126
+ ])
127
+ ]),
128
+ key: "1"
129
+ } : void 0
130
+ ]), 1032, ["critical", "variant", "condensed", "disabled", "inverse", "class"]));
131
+ }
132
+ }), q = /* @__PURE__ */ G(U, [["__scopeId", "data-v-07b9c537"]]);
133
+ export {
134
+ q as B,
135
+ a
136
+ };
137
+ //# sourceMappingURL=loading-button.Bntgn6Lk.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"loading-button.Bntgn6Lk.js","sources":["../../../core/src/components/loading-button/loading-button.types.ts","../../../vue2/src/components/button/components/loading-button/loading-button.vue"],"sourcesContent":["export enum BentoLoadingButtonState {\n START = 'start',\n LOADING = 'loading',\n SUCCESS = 'success',\n FAIL = 'fail',\n}\n\nexport type BentoLoadingButtonIconState = Partial<{ [key in BentoLoadingButtonState]: string }>;\n","<template>\n <bento-button\n :critical=\"isCritical\"\n :variant=\"variant\"\n :condensed=\"condensed\"\n :disabled=\"disabled\"\n :inverse=\"inverse\"\n class=\"b-loading-button\"\n :class=\"conditionalClasses\"\n @click.capture.stop=\"onClick\"\n >\n <slot></slot>\n\n <template v-if=\"state === 'start' && hasSlot('iconLeft')\" #iconLeft>\n <slot name=\"iconLeft\"></slot>\n </template>\n <template v-else-if=\"state !== 'start'\" #iconLeft>\n <span class=\"b-loading-button__icon\" data-testid=\"loading-button-rotating-icon\">\n <cross v-if=\"state === 'fail'\" :svg-title=\"t('failed')\" />\n <checkmark v-else-if=\"state === 'success'\" :svg-title=\"t('succeded')\" />\n <!-- TODO: Replace with new loading-indicator component -->\n <bento-loading-indicator v-else-if=\"state === 'loading'\" small :inverse=\"isInverseLoadingIndicator\" />\n </span>\n </template>\n </bento-button>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, PropType, useSlots } from 'vue';\n import { BentoLoadingButtonState } from '@/core/components/loading-button/loading-button.types';\n import { BentoLoadingIndicator } from '@/components/loading-indicator';\n import BentoButton from '@/components/button/button.vue';\n import Cross from '@adyen/ui-assets-icons-16/vue/cross-circle-fill';\n import Checkmark from '@adyen/ui-assets-icons-16/vue/checkmark-circle-fill';\n import { useHasSlot } from '@/composables/use-has-slot/use-has-slot';\n\n import { useI18n } from '@/utils/ts/i18n';\n\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const props = defineProps({\n /**\n * Reduces sizing of button\n */\n condensed: {\n type: BentoButton.props.condensed.type,\n default: false,\n },\n\n /**\n * Displays loading-button as critical\n */\n critical: {\n type: BentoButton.props.critical.type,\n default: false,\n },\n\n /**\n * Disables button functonality\n */\n disabled: {\n type: BentoButton.props.disabled.type,\n default: false,\n },\n\n /**\n * Sets color set to inverse\n */\n inverse: {\n type: Boolean,\n default: false,\n },\n\n /**\n * State of the button.\n * @values start, loading, success, fail\n */\n state: {\n type: String as PropType<BentoLoadingButtonState | `${BentoLoadingButtonState}`>,\n default: BentoLoadingButtonState.START,\n validator: (value: BentoLoadingButtonState) => Object.values(BentoLoadingButtonState).includes(value),\n },\n\n /**\n * Types of flavour of Button\n */\n variant: {\n type: BentoButton.props.variant.type,\n default: 'primary',\n validator: BentoButton.props.variant.validator,\n },\n });\n\n const emit = defineEmits<{\n /**\n * Click event handler\n */\n (e: 'click', event: MouseEvent): void;\n }>();\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n\n const conditionalClasses = computed(() => ({\n [`b-loading-button--${props.variant}-${BentoLoadingButtonState.LOADING}`]:\n props.state === BentoLoadingButtonState.LOADING && !props.disabled,\n 'b-loading-button--loading': props.state === BentoLoadingButtonState.LOADING && !props.disabled,\n [`b-loading-button--${props.variant}-${BentoLoadingButtonState.SUCCESS}`]:\n props.state === BentoLoadingButtonState.SUCCESS,\n [`b-loading-button--inverse`]: props.inverse,\n }));\n\n const isInverseLoadingIndicator = computed(\n () => (props.variant === 'primary' && !props.inverse) || (props.variant !== 'primary' && props.inverse)\n );\n const isCritical = computed(\n () =>\n (props.critical && props.state === BentoLoadingButtonState.START) ||\n props.state === BentoLoadingButtonState.FAIL\n );\n\n const onClick = (e: MouseEvent) => {\n // Prevent Vue3 from triggering event twice\n e.stopPropagation();\n\n if (props.state !== BentoLoadingButtonState.LOADING) {\n emit('click', e);\n }\n };\n</script>\n\n<script lang=\"ts\">\n /**\n * Loading Button component is used for cases where pressing a button starts an event that requires a loading state, e.g. when you have any sort of asynchronous action and are waiting for a response\n *\n * @example\n * import { BentoLoadingButton } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoLoadingButton },\n * template: `\n * <bento-loading-button state=\"loading\" variant=\"secondary\">\n * Loading\n * </bento-loading button>\n * `\n * }\n */\n export default {\n i18n: { messages },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"@/core/components/loading-button/loading-button.scss\" />\n"],"names":["BentoLoadingButtonState","BentoLoadingButtonState2","__default__","messages","props","__props","emit","__emit","slots","useSlots","hasSlot","useHasSlot","t","useI18n","conditionalClasses","computed","isInverseLoadingIndicator","isCritical","onClick","e"],"mappings":";;;;;;;;;AAAY,IAAAA,IAAA,kBAAAC,OACRA,EAAA,QAAA,SACAA,EAAA,UAAA,WACAA,EAAA,UAAA,WACAA,EAAA,OAAA,QAJQA,IAAAD,KAAA,CAAA,CAAA;;;;;;;;;;;;;;;GCsJRE,IAAA;AAAA,EAAe,MAAA,EAAA,UAAAC,EAAA;AAEf;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA9GA,UAAAC,IAAAC,GAqDAC,IAAAC,GAOAC,IAAAC,EAAA,GACAC,IAAAC,EAAAH,CAAA,GACA,EAAA,GAAAI,EAAA,IAAAC,EAAA,EAAA,UAAAV,EAAA,CAAA,GAEAW,IAAAC,EAAA,OAAA;AAAA,MAA2C,CAAA,qBAAAX,EAAA,OAAA,IAAAJ,EAAA,OAAA,EAAA,GAAAI,EAAA,UAAAJ,EAAA,WAAA,CAAAI,EAAA;AAAA,MAEuB,6BAAAA,EAAA,UAAAJ,EAAA,WAAA,CAAAI,EAAA;AAAA,MACyB,CAAA,qBAAAA,EAAA,OAAA,IAAAJ,EAAA,OAAA,EAAA,GAAAI,EAAA,UAAAJ,EAAA;AAAA,MAE3C,6BAAAI,EAAA;AAAA,IACP,EAAA,GAGzCY,IAAAD;AAAA,MAAkC,MAAAX,EAAA,YAAA,aAAA,CAAAA,EAAA,WAAAA,EAAA,YAAA,aAAAA,EAAA;AAAA,IACiE,GAEnGa,IAAAF;AAAA,MAAmB,MAAAX,EAAA,YAAAA,EAAA,UAAAJ,EAAA,SAAAI,EAAA,UAAAJ,EAAA;AAAA,IAG6B,GAGhDkB,IAAA,CAAAC,MAAA;AAEI,MAAAA,EAAA,gBAAA,GAEAf,EAAA,UAAAJ,EAAA,WACIM,EAAA,SAAAa,CAAA;AAAA,IACJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,6 +1,6 @@
1
1
  import { defineComponent as N, computed as _, resolveComponent as v, openBlock as c, createBlock as M, normalizeClass as Z, createSlots as z, withCtx as g, createVNode as L, createTextVNode as U, toDisplayString as H, createCommentVNode as R, resolveDynamicComponent as ie, ref as d, inject as Q, createElementBlock as S, mergeProps as V, toHandlers as ue, renderSlot as O, onMounted as le, Transition as ae, createElementVNode as T, withKeys as I, withModifiers as W, Fragment as X, renderList as x, normalizeStyle as ee, provide as re } from "vue";
2
2
  import { g as j } from "./unique-id.XFfoKuc2.js";
3
- import { B as de, a as q } from "./popover.DQP3ce2x.js";
3
+ import { B as de, a as q } from "./popover.pDk6zsak.js";
4
4
  import { B as te, D as ce } from "./divider.ugNXYI-T.js";
5
5
  import { u as me } from "./use-click-outside.D6aIgS15.js";
6
6
  import { u as fe } from "./use-has-slot.B7eQSabc.js";
@@ -667,4 +667,4 @@ export {
667
667
  Ke as O,
668
668
  k as a
669
669
  };
670
- //# sourceMappingURL=menu.CLicp_2I.js.map
670
+ //# sourceMappingURL=menu.BN5WGXw3.js.map