@adyen/bento-vue3 1.90.0 → 1.91.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (199) hide show
  1. package/dist/@types/components.d.ts +2 -0
  2. package/dist/@types/index.d.ts +559 -419
  3. package/dist/action-bar.js +1 -1
  4. package/dist/ai-tag.js +1 -1
  5. package/dist/assets/accordion-item.css +1 -1
  6. package/dist/assets/action-bar.css +1 -1
  7. package/dist/assets/base-modal.css +1 -1
  8. package/dist/assets/button-actions.css +1 -1
  9. package/dist/assets/card.css +1 -1
  10. package/dist/assets/data-grid.css +1 -1
  11. package/dist/assets/date-picker.css +1 -1
  12. package/dist/assets/date-range-picker.css +1 -1
  13. package/dist/assets/dialog-page.css +1 -1
  14. package/dist/assets/draggable-handle.css +1 -1
  15. package/dist/assets/dropdown.css +1 -1
  16. package/dist/assets/error-message.css +1 -1
  17. package/dist/assets/field-label.css +1 -0
  18. package/dist/assets/file-uploader.css +1 -1
  19. package/dist/assets/filter-bar.css +1 -1
  20. package/dist/assets/form-layout-title.css +1 -1
  21. package/dist/assets/input-field.css +1 -1
  22. package/dist/assets/input-time.css +1 -1
  23. package/dist/assets/inspector.css +1 -1
  24. package/dist/assets/modal-fullscreen.css +1 -1
  25. package/dist/assets/secondary-nav.css +1 -1
  26. package/dist/assets/sidepanel.css +1 -1
  27. package/dist/assets/use-cached-selected-values.css +1 -1
  28. package/dist/button.js +1 -1
  29. package/dist/card.js +1 -1
  30. package/dist/checkbox.js +2 -2
  31. package/dist/chunks/{action-bar.Pe_hvtja.js → action-bar.BPS3wPde.js} +3 -3
  32. package/dist/chunks/{action-bar.Pe_hvtja.js.map → action-bar.BPS3wPde.js.map} +1 -1
  33. package/dist/chunks/{ai-tag.BSlc78DU.js → ai-tag.D7shWB_x.js} +2 -2
  34. package/dist/chunks/{ai-tag.BSlc78DU.js.map → ai-tag.D7shWB_x.js.map} +1 -1
  35. package/dist/chunks/{base-modal.BjjDrx0z.js → base-modal.BxcS7Pao.js} +4 -4
  36. package/dist/chunks/{base-modal.BjjDrx0z.js.map → base-modal.BxcS7Pao.js.map} +1 -1
  37. package/dist/chunks/{button-actions-with-menu.DvkS16ur.js → button-actions-with-menu.BKdNXYgU.js} +2 -2
  38. package/dist/chunks/{button-actions-with-menu.DvkS16ur.js.map → button-actions-with-menu.BKdNXYgU.js.map} +1 -1
  39. package/dist/chunks/{button-actions.Bh_PZ_fV.js → button-actions.DLiM8KZL.js} +2 -2
  40. package/dist/chunks/{button-actions.Bh_PZ_fV.js.map → button-actions.DLiM8KZL.js.map} +1 -1
  41. package/dist/chunks/{calendar.CH-1Vgeb.js → calendar.qm-kFNQv.js} +275 -257
  42. package/dist/chunks/calendar.qm-kFNQv.js.map +1 -0
  43. package/dist/chunks/{card.BzCGCCzH.js → card.BEChcEqg.js} +2 -2
  44. package/dist/chunks/{card.BzCGCCzH.js.map → card.BEChcEqg.js.map} +1 -1
  45. package/dist/chunks/{checkbox-group.D_fN6Glu.js → checkbox-group.i3W8WO-7.js} +4 -4
  46. package/dist/chunks/{checkbox-group.D_fN6Glu.js.map → checkbox-group.i3W8WO-7.js.map} +1 -1
  47. package/dist/chunks/{checkbox.BlAhQl9N.js → checkbox.BPrymcRl.js} +18 -18
  48. package/dist/chunks/{checkbox.BlAhQl9N.js.map → checkbox.BPrymcRl.js.map} +1 -1
  49. package/dist/chunks/{click-outside.BPylIosK.js → click-outside.B0whuTUU.js} +2 -2
  50. package/dist/chunks/{click-outside.BPylIosK.js.map → click-outside.B0whuTUU.js.map} +1 -1
  51. package/dist/chunks/{code-snippet.BePxxR3q.js → code-snippet.BG5ZmCrb.js} +3 -3
  52. package/dist/chunks/{code-snippet.BePxxR3q.js.map → code-snippet.BG5ZmCrb.js.map} +1 -1
  53. package/dist/chunks/{controls-group.Cxk-0fCy.js → controls-group.DqRpF9bh.js} +2 -2
  54. package/dist/chunks/{controls-group.Cxk-0fCy.js.map → controls-group.DqRpF9bh.js.map} +1 -1
  55. package/dist/chunks/{dashboard-section.CiNDItU2.js → dashboard-section.C7mfUXOl.js} +2 -2
  56. package/dist/chunks/{dashboard-section.CiNDItU2.js.map → dashboard-section.C7mfUXOl.js.map} +1 -1
  57. package/dist/chunks/{dashed-underline.CwdpUz76.js → dashed-underline.B50DIXjK.js} +2 -2
  58. package/dist/chunks/{dashed-underline.CwdpUz76.js.map → dashed-underline.B50DIXjK.js.map} +1 -1
  59. package/dist/chunks/{data-grid-template.nXn1dLCw.js → data-grid-template.CKdZb6EN.js} +2 -2
  60. package/dist/chunks/{data-grid-template.nXn1dLCw.js.map → data-grid-template.CKdZb6EN.js.map} +1 -1
  61. package/dist/chunks/{data-grid.CXWaoqzi.js → data-grid.DvMe72LK.js} +411 -406
  62. package/dist/chunks/{data-grid.CXWaoqzi.js.map → data-grid.DvMe72LK.js.map} +1 -1
  63. package/dist/chunks/date-picker.CidHad1p.js +269 -0
  64. package/dist/chunks/date-picker.CidHad1p.js.map +1 -0
  65. package/dist/chunks/date-range-picker.c5OwESTS.js +1027 -0
  66. package/dist/chunks/date-range-picker.c5OwESTS.js.map +1 -0
  67. package/dist/chunks/{directive.Dpivxq_t.js → directive.C8kY-ZW-.js} +2 -2
  68. package/dist/chunks/{directive.Dpivxq_t.js.map → directive.C8kY-ZW-.js.map} +1 -1
  69. package/dist/{draggable-handle.js → chunks/draggable-handle.CySRx1tb.js} +56 -47
  70. package/dist/chunks/draggable-handle.CySRx1tb.js.map +1 -0
  71. package/dist/chunks/{dropdown-tag.B7OA_Yv9.js → dropdown-tag.wcJ6Mgqe.js} +2 -2
  72. package/dist/chunks/{dropdown-tag.B7OA_Yv9.js.map → dropdown-tag.wcJ6Mgqe.js.map} +1 -1
  73. package/dist/chunks/dropdown.DHoL50gV.js +1214 -0
  74. package/dist/chunks/dropdown.DHoL50gV.js.map +1 -0
  75. package/dist/chunks/error-message.Dyvrw6ZB.js +55 -0
  76. package/dist/chunks/error-message.Dyvrw6ZB.js.map +1 -0
  77. package/dist/chunks/field-label.DZYFjFgr.js +111 -0
  78. package/dist/chunks/field-label.DZYFjFgr.js.map +1 -0
  79. package/dist/chunks/{file-uploader.BUvDU_cn.js → file-uploader.Dbg3vfZ_.js} +5 -4
  80. package/dist/chunks/{file-uploader.BUvDU_cn.js.map → file-uploader.Dbg3vfZ_.js.map} +1 -1
  81. package/dist/chunks/{filter-bar.fowl40RS.js → filter-bar.Dt-cU3zy.js} +1473 -1455
  82. package/dist/chunks/filter-bar.Dt-cU3zy.js.map +1 -0
  83. package/dist/chunks/{footer-actions.uoNbOGAQ.js → footer-actions.CYBdKDPo.js} +2 -2
  84. package/dist/chunks/{footer-actions.uoNbOGAQ.js.map → footer-actions.CYBdKDPo.js.map} +1 -1
  85. package/dist/chunks/{form-layout-title.Cr3wdpK_.js → form-layout-title.B3ePK3yi.js} +78 -64
  86. package/dist/chunks/form-layout-title.B3ePK3yi.js.map +1 -0
  87. package/dist/chunks/{header-meta.CmH6SnjE.js → header-meta.COak4D8-.js} +2 -2
  88. package/dist/chunks/{header-meta.CmH6SnjE.js.map → header-meta.COak4D8-.js.map} +1 -1
  89. package/dist/chunks/{header-with-views.B2pPBcTf.js → header-with-views.DqioajcO.js} +10 -10
  90. package/dist/chunks/{header-with-views.B2pPBcTf.js.map → header-with-views.DqioajcO.js.map} +1 -1
  91. package/dist/chunks/{header.BVM8Usdi.js → header.C21yzWrk.js} +3 -3
  92. package/dist/chunks/{header.BVM8Usdi.js.map → header.C21yzWrk.js.map} +1 -1
  93. package/dist/chunks/{input-field-password.CHb2Ros_.js → input-field-password.DyUphhxB.js} +4 -4
  94. package/dist/chunks/{input-field-password.CHb2Ros_.js.map → input-field-password.DyUphhxB.js.map} +1 -1
  95. package/dist/chunks/{input-field-phone-number.DM2rmZkQ.js → input-field-phone-number.BXVaC5ra.js} +3 -3
  96. package/dist/chunks/{input-field-phone-number.DM2rmZkQ.js.map → input-field-phone-number.BXVaC5ra.js.map} +1 -1
  97. package/dist/chunks/{input-field.DnYjM6yy.js → input-field.DkUFvIWt.js} +113 -109
  98. package/dist/chunks/input-field.DkUFvIWt.js.map +1 -0
  99. package/dist/chunks/input-time.WI_qdwJc.js +122 -0
  100. package/dist/chunks/input-time.WI_qdwJc.js.map +1 -0
  101. package/dist/chunks/{modal-fullscreen.9CSTqFQc.js → modal-fullscreen.c6QphYQo.js} +2 -2
  102. package/dist/chunks/{modal-fullscreen.9CSTqFQc.js.map → modal-fullscreen.c6QphYQo.js.map} +1 -1
  103. package/dist/chunks/{modal.vue_vue_type_script_setup_true_lang.BAxTkaQM.js → modal.vue_vue_type_script_setup_true_lang.ImqHKH-g.js} +4 -4
  104. package/dist/chunks/{modal.vue_vue_type_script_setup_true_lang.BAxTkaQM.js.map → modal.vue_vue_type_script_setup_true_lang.ImqHKH-g.js.map} +1 -1
  105. package/dist/chunks/on-click-outside.BgIzQ2G1.js +108 -0
  106. package/dist/chunks/on-click-outside.BgIzQ2G1.js.map +1 -0
  107. package/dist/chunks/{pagination.DL-h8OLF.js → pagination.Cu85Lqms.js} +100 -100
  108. package/dist/chunks/{pagination.DL-h8OLF.js.map → pagination.Cu85Lqms.js.map} +1 -1
  109. package/dist/chunks/{radio-group.DzhQgXv9.js → radio-group.CfMr1fmW.js} +3 -3
  110. package/dist/chunks/{radio-group.DzhQgXv9.js.map → radio-group.CfMr1fmW.js.map} +1 -1
  111. package/dist/chunks/{rich-text-editor.Ij2t4pyI.js → rich-text-editor.Bf9EWzNk.js} +6 -5
  112. package/dist/chunks/{rich-text-editor.Ij2t4pyI.js.map → rich-text-editor.Bf9EWzNk.js.map} +1 -1
  113. package/dist/chunks/{search-bar.DfNwnjes.js → search-bar.p6kHCCvT.js} +4 -4
  114. package/dist/chunks/{search-bar.DfNwnjes.js.map → search-bar.p6kHCCvT.js.map} +1 -1
  115. package/dist/chunks/{secondary-nav.CvipTDRh.js → secondary-nav.CaxiyVaO.js} +2 -2
  116. package/dist/chunks/{secondary-nav.CvipTDRh.js.map → secondary-nav.CaxiyVaO.js.map} +1 -1
  117. package/dist/chunks/{selection-card-group.CcOWQAUC.js → selection-card-group.58XZj_SJ.js} +11 -11
  118. package/dist/chunks/{selection-card-group.CcOWQAUC.js.map → selection-card-group.58XZj_SJ.js.map} +1 -1
  119. package/dist/chunks/{sidepanel.BObSv8UU.js → sidepanel.CAVhSs-O.js} +4 -4
  120. package/dist/chunks/{sidepanel.BObSv8UU.js.map → sidepanel.CAVhSs-O.js.map} +1 -1
  121. package/dist/chunks/{summary-grid.types.DKPhtHw3.js → summary-grid.types.CDithi8M.js} +2 -2
  122. package/dist/chunks/{summary-grid.types.DKPhtHw3.js.map → summary-grid.types.CDithi8M.js.map} +1 -1
  123. package/dist/chunks/{textarea.C-sBemuo.js → textarea.JGXAlpx9.js} +19 -18
  124. package/dist/chunks/{textarea.C-sBemuo.js.map → textarea.JGXAlpx9.js.map} +1 -1
  125. package/dist/chunks/{timeline-item.CHk8wXeT.js → timeline-item.BNFPpQz1.js} +4 -4
  126. package/dist/chunks/{timeline-item.CHk8wXeT.js.map → timeline-item.BNFPpQz1.js.map} +1 -1
  127. package/dist/chunks/{tutorial.vue_vue_type_script_setup_true_lang.CUDeriBU.js → tutorial.vue_vue_type_script_setup_true_lang.C1cF-adv.js} +2 -2
  128. package/dist/chunks/{tutorial.vue_vue_type_script_setup_true_lang.CUDeriBU.js.map → tutorial.vue_vue_type_script_setup_true_lang.C1cF-adv.js.map} +1 -1
  129. package/dist/chunks/{use-cached-selected-values.DIbfa5F1.js → use-cached-selected-values.Bx8uuky9.js} +170 -165
  130. package/dist/chunks/use-cached-selected-values.Bx8uuky9.js.map +1 -0
  131. package/dist/chunks/{use-date-input-formatter.BiIraXZZ.js → use-date-input-formatter.BOuXpRb-.js} +2 -2
  132. package/dist/chunks/{use-date-input-formatter.BiIraXZZ.js.map → use-date-input-formatter.BOuXpRb-.js.map} +1 -1
  133. package/dist/chunks/use-touch-device.DTqFAbXh.js +11 -0
  134. package/dist/chunks/use-touch-device.DTqFAbXh.js.map +1 -0
  135. package/dist/click-outside.js +1 -1
  136. package/dist/code-snippet.js +1 -1
  137. package/dist/dashboard-template.js +1 -1
  138. package/dist/dashed-underline.js +1 -1
  139. package/dist/data-grid-template.js +1 -1
  140. package/dist/data-grid.js +1 -1
  141. package/dist/date-picker.js +2 -2
  142. package/dist/date-range-picker.js +2 -2
  143. package/dist/draggable.js +1383 -0
  144. package/dist/draggable.js.map +1 -0
  145. package/dist/dropdown.js +10 -11
  146. package/dist/dropdown.js.map +1 -1
  147. package/dist/file-uploader.js +1 -1
  148. package/dist/filter-bar.js +1 -1
  149. package/dist/form-layout.js +1 -1
  150. package/dist/header-with-views.js +1 -1
  151. package/dist/header.js +1 -1
  152. package/dist/index.js +277 -274
  153. package/dist/index.js.map +1 -1
  154. package/dist/input-field-password.js +1 -1
  155. package/dist/input-field-phone-number.js +1 -1
  156. package/dist/input-field.js +1 -1
  157. package/dist/input-time.js +1 -1
  158. package/dist/internal.js +24 -23
  159. package/dist/internal.js.map +1 -1
  160. package/dist/menu.js +1 -1
  161. package/dist/modal-fullscreen.js +1 -1
  162. package/dist/modal.js +2 -2
  163. package/dist/pagination.js +1 -1
  164. package/dist/popover.js +1 -1
  165. package/dist/radio-group.js +1 -1
  166. package/dist/rich-text-editor.js +1 -1
  167. package/dist/search-bar.js +2 -2
  168. package/dist/secondary-nav.js +1 -1
  169. package/dist/selection-card.js +1 -1
  170. package/dist/sidepanel.js +1 -1
  171. package/dist/summary-grid.js +1 -1
  172. package/dist/textarea.js +1 -1
  173. package/dist/timeline.js +1 -1
  174. package/dist/tutorial.js +1 -1
  175. package/dist/web-types.json +1 -1
  176. package/package.json +7 -10
  177. package/dist/assets/dropdown-default-textbox.css +0 -1
  178. package/dist/chunks/calendar.CH-1Vgeb.js.map +0 -1
  179. package/dist/chunks/date-picker.DPjCROIP.js +0 -238
  180. package/dist/chunks/date-picker.DPjCROIP.js.map +0 -1
  181. package/dist/chunks/date-range-picker.fyrfFd04.js +0 -998
  182. package/dist/chunks/date-range-picker.fyrfFd04.js.map +0 -1
  183. package/dist/chunks/debounce.DUTu11PS.js +0 -10
  184. package/dist/chunks/debounce.DUTu11PS.js.map +0 -1
  185. package/dist/chunks/dropdown-default-textbox.aYsTZDZ7.js +0 -415
  186. package/dist/chunks/dropdown-default-textbox.aYsTZDZ7.js.map +0 -1
  187. package/dist/chunks/dropdown.Do-mZiI6.js +0 -813
  188. package/dist/chunks/dropdown.Do-mZiI6.js.map +0 -1
  189. package/dist/chunks/error-message.849uzpkq.js +0 -157
  190. package/dist/chunks/error-message.849uzpkq.js.map +0 -1
  191. package/dist/chunks/filter-bar.fowl40RS.js.map +0 -1
  192. package/dist/chunks/form-layout-title.Cr3wdpK_.js.map +0 -1
  193. package/dist/chunks/input-field.DnYjM6yy.js.map +0 -1
  194. package/dist/chunks/input-time.DeJ8lDio.js +0 -103
  195. package/dist/chunks/input-time.DeJ8lDio.js.map +0 -1
  196. package/dist/chunks/on-click-outside.ZUMLlxE_.js +0 -90
  197. package/dist/chunks/on-click-outside.ZUMLlxE_.js.map +0 -1
  198. package/dist/chunks/use-cached-selected-values.DIbfa5F1.js.map +0 -1
  199. package/dist/draggable-handle.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"summary-grid.types.DKPhtHw3.js","sources":["../../../vue2/src/components/summary-grid/summary-grid.vue","../../../vue2/src/components/summary-grid/components/summary-grid-item/summary-grid-item.vue","../../../vue2/src/components/summary-grid/components/summary-grid-item-amount/summary-grid-item-amount.vue","../../../vue2/src/components/summary-grid/components/summary-grid-item-numeric/summary-grid-item-numeric.vue","../../../vue2/src/components/summary-grid/components/summary-grid-item-percentage/summary-grid-item-percentage.vue","../../../vue2/src/components/summary-grid/components/summary-grid-item-text/summary-grid-item-text.vue","../../../vue2/src/components/summary-grid/components/summary-grid-item-custom/summary-grid-item-custom.vue","../../../vue2/src/components/summary-grid/summary-grid.types.ts"],"sourcesContent":["<template>\n <div class=\"b-summary-grid\">\n <grid-layout\n v-for=\"index in numberOfRows\"\n :key=\"`summary-grid-row-${index}`\"\n :data-testid=\"`summary-grid-row-${index}`\"\n :column-width=\"columnWidth?.[`row${index}`]\"\n >\n <template v-if=\"hasSlot(`cell-${index}-1`)\" #col-1>\n <slot :name=\"`cell-${index}-1`\" />\n </template>\n <template v-if=\"hasSlot(`cell-${index}-2`)\" #col-2>\n <slot :name=\"`cell-${index}-2`\" />\n </template>\n <template v-if=\"hasSlot(`cell-${index}-3`)\" #col-3>\n <slot :name=\"`cell-${index}-3`\" />\n </template>\n <template v-if=\"hasSlot(`cell-${index}-4`)\" #col-4>\n <slot :name=\"`cell-${index}-4`\" />\n </template>\n <template v-if=\"hasSlot(`cell-${index}-5`)\" #col-5>\n <slot :name=\"`cell-${index}-5`\" />\n </template>\n <template v-if=\"hasSlot(`cell-${index}-6`)\" #col-6>\n <slot :name=\"`cell-${index}-6`\" />\n </template>\n </grid-layout>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { onMounted, provide, toRef, useSlots } from 'vue';\n import type { BentoSummaryGridLayout, BentoSummaryGridProps } from './summary-grid.types';\n import { GridLayout } from '@/components/internal';\n import { useHasSlot } from '@/composables';\n import {\n SUMMARY_GRID_LAYOUT_INJECTION_KEY,\n SUMMARY_GRID_SLASHED_ZERO,\n } from '@/components/summary-grid/summary-grid.keys';\n\n const props = withDefaults(defineProps<BentoSummaryGridProps>(), {\n columnWidth: null,\n slashedZero: false,\n });\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n\n let numberOfRows = 1;\n if (slots) {\n const slotRows = Object.keys(slots)\n ?.filter(slotName => slotName.includes('cell-'))\n ?.map(slotName => parseInt(slotName.split('-')?.[1], 10));\n numberOfRows = Math.max(...slotRows);\n }\n\n onMounted(() => {\n if (numberOfRows > 3) {\n throw new Error(\n 'BentoSummaryGrid must only have a maximum of 3 rows. Read the documentation for more information.'\n );\n }\n });\n\n const registerComponentsInSummaryGrid: BentoSummaryGridLayout = () => {\n const isSummaryGridLayout = true;\n return { isSummaryGridLayout };\n };\n\n provide(SUMMARY_GRID_LAYOUT_INJECTION_KEY, registerComponentsInSummaryGrid);\n provide(SUMMARY_GRID_SLASHED_ZERO, toRef(props, 'slashedZero'));\n</script>\n\n<script lang=\"ts\">\n /**\n * A summary grid component that displays a collection items.\n *\n * @example\n * import { BentoSummaryGrid, BentoSummaryGridItemAmount } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoSummaryGrid, BentoSummaryGridItemAmount },\n * template: `\n * <bento-summary-grid>\n * <template #cell-2-2>\n * <bento-summary-grid-item-amount\n * title=\"Text Item\"\n * label=\"14\"\n * info-icon-tooltip-text=\"text for icon\"\n * copy=\"copy this to clipboard\"\n * />\n * </template>\n * </bento-summary-grid>\n * `\n * }\n */\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"./summary-grid.scss\" />\n","<template>\n <div class=\"b-summary-grid-item\" :class=\"conditionalClasses\" :style=\"computedStyles\">\n <div class=\"b-summary-grid-item__header\">\n <bento-typography class=\"b-summary-grid-item__title\" el=\"span\" variant=\"body\">\n <bento-dashed-underline\n v-if=\"withUnderline\"\n :tooltip-text=\"underlineTooltipText\"\n :popover-size=\"underlinePopoverSize\"\n >\n {{ title }}\n <template v-if=\"hasSlot('dashed-underline')\" #popover-content>\n <slot name=\"dashed-underline\"></slot>\n </template>\n </bento-dashed-underline>\n <template v-else>\n {{ title }}\n </template>\n </bento-typography>\n <div class=\"b-summary-grid-item__title-icons\">\n <copy v-if=\"copy\" class=\"b-structured-list__icon\" :text=\"copy\" @click=\"$emit('copy-click', $event)\" />\n\n <bento-info-icon\n v-if=\"infoIconTooltipText\"\n :tooltip-text=\"infoIconTooltipText\"\n tooltip-position=\"top\"\n class=\"b-summary-grid-item__title-tooltip\"\n @mouseenter=\"$emit('info-icon-mouseenter', $event)\"\n />\n </div>\n </div>\n <bento-typography\n data-testid=\"summary-grid-item-content-typography\"\n class=\"b-summary-grid-item__title\"\n v-bind=\"typographyProps\"\n el=\"span\"\n >\n <slot />\n <bento-tag\n v-if=\"trend && itemType !== 'text'\"\n :variant=\"trendVariant\"\n :label=\"trend\"\n class=\"b-summary-grid-item__content-trend\"\n />\n </bento-typography>\n <bento-typography\n v-if=\"hasSlot('secondary')\"\n class=\"b-summary-grid-item__title\"\n data-testid=\"summary-grid-item-secondary-metric-typography\"\n el=\"span\"\n variant=\"caption\"\n stronger\n >\n <slot name=\"secondary\" />\n <bento-tag\n v-if=\"secondaryTrend\"\n :variant=\"secondaryTrendVariant\"\n :label=\"secondaryTrend\"\n class=\"b-summary-grid-item__content-trend\"\n />\n </bento-typography>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, inject, ref, toRefs, useSlots } from 'vue';\n\n // Components\n import { BentoDashedUnderline } from '@/components/dashed-underline';\n import { BentoInfoIcon } from '@/components/info-icon';\n import { BentoTypography, type BentoTypographyVariant } from '@/components/typography';\n import { BentoTag, type BentoTagVariant } from '@/components/tag';\n import { Copy } from '@/internal';\n\n // Utils\n import { useHasSlot } from '@/composables';\n\n // Types\n import { SUMMARY_GRID_SLASHED_ZERO } from '@/components/summary-grid/summary-grid.keys';\n import type { BentoSummaryGridItemTrendDirection } from '@/components/summary-grid/summary-grid.types';\n import type { BentoSummaryGridItemProps } from './summary-grid-item.types';\n\n defineEmits<{\n /**\n * Emitted when the copy button is clicked.\n */\n (e: 'copy-click', event: MouseEvent): void;\n\n /**\n * Emitted when the mouse pointer enters the info icon component.\n */\n (e: 'info-icon-mouseenter', event: MouseEvent): void;\n }>();\n\n const props = withDefaults(defineProps<BentoSummaryGridItemProps>(), {\n copy: undefined,\n fitContent: false,\n infoIconTooltipText: null,\n itemType: 'custom',\n secondaryTrend: null,\n secondaryTrendDirection: 'positive',\n size: 'small',\n trend: null,\n trendDirection: 'positive',\n underlinePopoverSize: 'fit-content',\n underlineTooltipText: null,\n });\n\n const { trendDirection, secondaryTrendDirection, itemType, size } = toRefs(props);\n const hasSlashedZero = inject(SUMMARY_GRID_SLASHED_ZERO, ref(false));\n\n const tagVariantColor = (direction: `${BentoSummaryGridItemTrendDirection}`): `${BentoTagVariant}` => {\n switch (direction) {\n case 'positive':\n return 'green';\n case 'negative':\n return 'red';\n default:\n return 'blue';\n }\n };\n\n // TODO implement plus or minus symbol logic\n const trendVariant = computed(() => tagVariantColor(trendDirection.value));\n const secondaryTrendVariant = computed(() => tagVariantColor(secondaryTrendDirection.value));\n\n const typographyContentElement = computed<`${BentoTypographyVariant}`>(() => {\n if (size.value === 'small') {\n return 'body';\n }\n if (itemType.value !== 'text') {\n return 'title';\n }\n\n return null;\n });\n\n const typographyProps = computed(() => ({\n medium: size.value === 'large',\n strongest: size.value === 'small',\n wide: size.value === 'small',\n variant: typographyContentElement.value,\n }));\n\n const computedStyles = computed(() => (props.fitContent ? { width: 'fit-content' } : {}));\n\n const conditionalClasses = computed(() => ({ 'b-summary-grid-item--slashed-zero': hasSlashedZero.value }));\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n const withUnderline = computed(() => props.underlineTooltipText || hasSlot('dashed-underline'));\n</script>\n\n<script lang=\"ts\">\n /**\n * A summary bar item is a piece of information to be displayed in `bento-summary-bar` component\n *\n * @example\n * import { SummaryBarItem } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { SummaryBarItem },\n * template: `\n * <summary-grid-item :title=\"textVariable\">\n * Content of the item\n * </summary-grid-item>\n * `\n * }\n */\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"./summary-grid-item.scss\" />\n","<template>\n <summary-grid-item\n item-type=\"amount\"\n :info-icon-tooltip-text=\"infoIconTooltipText\"\n :title=\"title\"\n :copy=\"copy\"\n :fit-content=\"fitContent\"\n :size=\"size\"\n :trend=\"trend\"\n :trend-direction=\"trendDirection\"\n :secondary-trend=\"secondaryTrend\"\n :secondary-trend-direction=\"secondaryTrendDirection\"\n :underline-popover-size=\"underlinePopoverSize\"\n :underline-tooltip-text=\"underlineTooltipText\"\n class=\"b-summary-grid-item-amount\"\n @copy-click=\"$emit('copy-click', $event)\"\n @info-icon-mouseenter=\"$emit('info-icon-mouseenter', $event)\"\n >\n <template v-if=\"hasSlot('dashed-underline')\" #dashed-underline>\n <slot name=\"dashed-underline\" />\n </template>\n <div class=\"b-summary-grid-item-amount__content\">\n <div>{{ label }}</div>\n <bento-typography\n v-if=\"secondaryLabel\"\n variant=\"caption\"\n class=\"b-summary-grid-item-amount__secondary-label\"\n >{{ secondaryLabel }}</bento-typography\n >\n </div>\n <template v-if=\"secondaryMetric\" #secondary>\n {{ secondaryMetric }}\n </template>\n </summary-grid-item>\n</template>\n\n<script setup lang=\"ts\">\n import { useSlots } from 'vue';\n import { BentoTypography } from '@/components/typography';\n import { SummaryGridItem } from '../summary-grid-item';\n import { useHasSlot } from '@/composables';\n import type { BentoSummaryGridItemAmountProps } from './summary-grid-item-amount.types';\n\n defineEmits<{\n /**\n * Emitted when the copy button is clicked.\n */\n (e: 'copy-click', event: MouseEvent): void;\n\n /**\n * Emitted when the mouse pointer enters the info icon component.\n */\n (e: 'info-icon-mouseenter', event: MouseEvent): void;\n }>();\n\n withDefaults(defineProps<BentoSummaryGridItemAmountProps>(), {\n copy: undefined,\n fitContent: false,\n infoIconTooltipText: null,\n secondaryLabel: null,\n secondaryMetric: null,\n secondaryTrend: null,\n secondaryTrendDirection: 'positive',\n size: 'small',\n trend: null,\n trendDirection: 'positive',\n underlinePopoverSize: 'fit-content',\n underlineTooltipText: null,\n });\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n</script>\n\n<script lang=\"ts\">\n /**\n * Summary grid item component used to display financial data, such as currency values and monetary amounts\n *\n * @example\n * import { BentoSummaryGridItemAmount } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoSummaryGridItemAmount },\n * template: `\n * <bento-summary-grid-item-amount\n * title=\"Your title\"\n * label=\"200.00 EUR\"\n * secondary-label=\"/ day\"\n * info-icon-tooltip-text=\"Your tooltip text here will be toggled by the info icon\"\n * trend=\"+12%\"\n * trend-direction=\"neutral\"\n * size=\"medium\"\n * />\n * `\n * }\n */\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"./summary-grid-item-amount.scss\" />\n","<template>\n <summary-grid-item\n item-type=\"numeric\"\n :info-icon-tooltip-text=\"infoIconTooltipText\"\n :title=\"title\"\n :copy=\"copy\"\n :fit-content=\"fitContent\"\n :size=\"size\"\n :trend=\"trend\"\n :trend-direction=\"trendDirection\"\n :secondary-trend=\"secondaryTrend\"\n :secondary-trend-direction=\"secondaryTrendDirection\"\n :underline-popover-size=\"underlinePopoverSize\"\n :underline-tooltip-text=\"underlineTooltipText\"\n class=\"b-summary-grid-item-numeric\"\n @copy-click=\"$emit('copy-click', $event)\"\n @info-icon-mouseenter=\"$emit('info-icon-mouseenter', $event)\"\n >\n <template v-if=\"hasSlot('dashed-underline')\" #dashed-underline>\n <slot name=\"dashed-underline\" />\n </template>\n {{ label }}\n <template v-if=\"secondaryMetric\" #secondary>\n {{ secondaryMetric }}\n </template>\n </summary-grid-item>\n</template>\n\n<script setup lang=\"ts\">\n import { useSlots } from 'vue';\n import { SummaryGridItem } from '../summary-grid-item';\n import { useHasSlot } from '@/composables';\n import type { BentoSummaryGridItemNumericProps } from './summary-grid-item-numeric.types';\n\n defineEmits<{\n /**\n * Emitted when the copy button is clicked.\n */\n (e: 'copy-click', event: MouseEvent): void;\n\n /**\n * Emitted when the mouse pointer enters the info icon component.\n */\n (e: 'info-icon-mouseenter', event: MouseEvent): void;\n }>();\n\n withDefaults(defineProps<BentoSummaryGridItemNumericProps>(), {\n copy: undefined,\n fitContent: false,\n infoIconTooltipText: null,\n secondaryMetric: null,\n secondaryTrend: null,\n secondaryTrendDirection: 'positive',\n size: 'small',\n trend: null,\n trendDirection: 'positive',\n underlinePopoverSize: 'fit-content',\n underlineTooltipText: null,\n });\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n</script>\n\n<script lang=\"ts\">\n /**\n * Summary grid item component used to display any numeric information\n *\n * @example\n * import { BentoSummaryGridItemNumeric } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoSummaryGridItemNumeric },\n * template: `\n * <bento-summary-grid-item-numeric\n * title=\"Your title\"\n * label=\"123\"\n * info-icon-tooltip-text=\"Your tooltip text here will be toggled by the info icon\"\n * trend=\"+12%\"\n * trend-direction=\"neutral\"\n * size=\"medium\"\n * />\n * `\n * }\n */\n export default {};\n</script>\n","<template>\n <summary-grid-item\n item-type=\"percentage\"\n :info-icon-tooltip-text=\"infoIconTooltipText\"\n :title=\"title\"\n :copy=\"copy\"\n :fit-content=\"fitContent\"\n :size=\"size\"\n :trend=\"trend\"\n :trend-direction=\"trendDirection\"\n :secondary-trend=\"secondaryTrend\"\n :secondary-trend-direction=\"secondaryTrendDirection\"\n :underline-popover-size=\"underlinePopoverSize\"\n :underline-tooltip-text=\"underlineTooltipText\"\n class=\"b-summary-grid-item-percentage\"\n @copy-click=\"$emit('copy-click', $event)\"\n @info-icon-mouseenter=\"$emit('info-icon-mouseenter', $event)\"\n >\n <template v-if=\"hasSlot('dashed-underline')\" #dashed-underline>\n <slot name=\"dashed-underline\" />\n </template>\n {{ computedLabelPercentage }}\n <template v-if=\"secondaryMetric\" #secondary> {{ computedSecondaryMetricPercentage }} </template>\n </summary-grid-item>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, useSlots } from 'vue';\n import { SummaryGridItem } from '../summary-grid-item';\n import { useHasSlot } from '@/composables';\n import { useI18n } from '@/utils/ts/i18n';\n import type { BentoSummaryGridItemPercentageProps } from './summary-grid-item-percentage.types';\n import type { NumberFormatOptions } from 'vue-i18n';\n\n const { locale } = useI18n();\n\n defineEmits<{\n /**\n * Emitted when the copy button is clicked.\n */\n (e: 'copy-click', event: MouseEvent): void;\n\n /**\n * Emitted when the mouse pointer enters the info icon component.\n */\n (e: 'info-icon-mouseenter', event: MouseEvent): void;\n }>();\n\n const props = withDefaults(defineProps<BentoSummaryGridItemPercentageProps>(), {\n copy: undefined,\n fitContent: false,\n infoIconTooltipText: null,\n secondaryMetric: null,\n secondaryTrend: null,\n secondaryTrendDirection: 'positive',\n size: 'small',\n trend: null,\n trendDirection: 'positive',\n underlinePopoverSize: 'fit-content',\n underlineTooltipText: null,\n });\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n\n const percentageArgs: NumberFormatOptions = {\n style: 'percent',\n maximumFractionDigits: 2,\n };\n\n const isNumeric = (value: string | number) => value != null && value !== '' && !isNaN(Number(value));\n const convertToPercentIfNumber = (value: string | number) => {\n if (value && isNumeric(value)) {\n return new Intl.NumberFormat(locale.value, percentageArgs).format(Number(value) / 100);\n }\n return value;\n };\n\n const computedLabelPercentage = computed(() => convertToPercentIfNumber(props.label));\n const computedSecondaryMetricPercentage = computed(() => convertToPercentIfNumber(props.secondaryMetric));\n</script>\n\n<script lang=\"ts\">\n /**\n * Summary grid item component used to display any percentage information\n *\n * @example\n * import { BentoSummaryGridItemPercentage } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoSummaryGridItemPercentage },\n * template: `\n * <bento-summary-grid-item-percentage\n * title=\"Your title\"\n * label=\"123\"\n * info-icon-tooltip-text=\"Your tooltip text here will be toggled by the info icon\"\n * trend=\"+12%\"\n * trend-direction=\"neutral\"\n * size=\"medium\"\n * />\n * `\n * }\n */\n export default {\n i18n: {},\n };\n</script>\n","<template>\n <summary-grid-item\n item-type=\"text\"\n :info-icon-tooltip-text=\"infoIconTooltipText\"\n :title=\"title\"\n :copy=\"copy\"\n :fit-content=\"fitContent\"\n :underline-popover-size=\"underlinePopoverSize\"\n :underline-tooltip-text=\"underlineTooltipText\"\n class=\"b-summary-grid-item-text\"\n @copy-click=\"$emit('copy-click', $event)\"\n @info-icon-mouseenter=\"$emit('info-icon-mouseenter', $event)\"\n >\n <template v-if=\"hasSlot('dashed-underline')\" #dashed-underline>\n <slot name=\"dashed-underline\" />\n </template>\n {{ label }}\n </summary-grid-item>\n</template>\n\n<script setup lang=\"ts\">\n import { useSlots } from 'vue';\n import { SummaryGridItem } from '../summary-grid-item';\n import { useHasSlot } from '@/composables';\n\n import type { BentoSummaryGridItemTextProps } from './summary-grid-item-text.types';\n\n defineEmits<{\n /**\n * Emitted when the copy button is clicked.\n */\n (e: 'copy-click', event: MouseEvent): void;\n\n /**\n * Emitted when the mouse pointer enters the info icon component.\n */\n (e: 'info-icon-mouseenter', event: MouseEvent): void;\n }>();\n\n withDefaults(defineProps<BentoSummaryGridItemTextProps>(), {\n copy: undefined,\n fitContent: false,\n infoIconTooltipText: null,\n underlinePopoverSize: 'fit-content',\n underlineTooltipText: null,\n });\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n</script>\n\n<script lang=\"ts\">\n /**\n * Summary grid item component used to display text only. Can be used for references, IDs or any other text data.\n *\n * @example\n * import { BentoSummaryGridItemText } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoSummaryGridItemText },\n * template: `\n * <bento-summary-grid-item-text\n * title=\"Your title\"\n * label=\"Your text here\"\n * info-icon-tooltip-text=\"Your tooltip text here will be toggled by the info icon\"\n * />\n * `\n * }\n */\n export default {};\n</script>\n","<template>\n <summary-grid-item\n :title=\"title\"\n :info-icon-tooltip-text=\"infoIconTooltipText\"\n :copy=\"copy\"\n :fit-content=\"fitContent\"\n :underline-popover-size=\"underlinePopoverSize\"\n :underline-tooltip-text=\"underlineTooltipText\"\n @copy-click=\"$emit('copy-click', $event)\"\n @info-icon-mouseenter=\"$emit('info-icon-mouseenter', $event)\"\n >\n <template v-if=\"hasSlot('dashed-underline')\" #dashed-underline>\n <slot name=\"dashed-underline\" />\n </template>\n <slot />\n </summary-grid-item>\n</template>\n\n<script setup lang=\"ts\">\n import { useSlots } from 'vue';\n import { SummaryGridItem } from '../summary-grid-item';\n import { useHasSlot } from '@/composables';\n import type { BentoSummaryGridItemCustomProps } from './summary-grid-item-custom.types';\n\n defineEmits<{\n /**\n * Emitted when the copy button is clicked.\n */\n (e: 'copy-click', event: MouseEvent): void;\n\n /**\n * Emitted when the mouse pointer enters the info icon component.\n */\n (e: 'info-icon-mouseenter', event: MouseEvent): void;\n }>();\n\n withDefaults(defineProps<BentoSummaryGridItemCustomProps>(), {\n copy: undefined,\n infoIconTooltipText: null,\n fitContent: false,\n underlinePopoverSize: 'fit-content',\n underlineTooltipText: null,\n });\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n</script>\n\n<script lang=\"ts\">\n /**\n * A summary bar item is a piece of information to be displayed in `bento-summary-bar` component\n *\n * @example\n * import { SummaryBarItem } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { SummaryBarItem },\n * template: `\n * <summary-grid-item :title=\"textVariable\">\n * Content of the item\n * </summary-grid-item>\n * `\n * }\n */\n export default {};\n</script>\n","import { type GridLayoutColumnWidths } from '@/components/internal/grid-layout/grid-layout.types';\n\n/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoSummaryGridItemSize {\n SMALL = 'small',\n MEDIUM = 'medium',\n LARGE = 'large',\n}\n\n/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoSummaryGridItemTrendDirection {\n POSITIVE = 'positive',\n NEGATIVE = 'negative',\n NEUTRAL = 'neutral',\n}\n\nexport interface BentoSummaryGridColumnWidth {\n row1: GridLayoutColumnWidths;\n row2?: GridLayoutColumnWidths;\n row3?: GridLayoutColumnWidths;\n}\n\nexport type BentoSummaryGridLayout = () => {\n isSummaryGridLayout: boolean;\n};\n\nexport interface BentoSummaryGridProps {\n /**\n * Sets the responsive columns widths values for 1 of the 3 rows.\n */\n columnWidth?: BentoSummaryGridColumnWidth;\n\n /**\n * Renders a font numeric style with slashed zeros instead of normal ones.\n */\n slashedZero?: boolean;\n}\n"],"names":["__default__$6","props","__props","slots","useSlots","hasSlot","useHasSlot","numberOfRows","slotRows","slotName","onMounted","provide","SUMMARY_GRID_LAYOUT_INJECTION_KEY","SUMMARY_GRID_SLASHED_ZERO","toRef","__default__$5","trendDirection","secondaryTrendDirection","itemType","size","toRefs","hasSlashedZero","inject","ref","tagVariantColor","direction","trendVariant","computed","secondaryTrendVariant","typographyContentElement","typographyProps","computedStyles","conditionalClasses","withUnderline","__default__$4","__default__$3","__default__$2","locale","useI18n","percentageArgs","isNumeric","value","convertToPercentIfNumber","computedLabelPercentage","computedSecondaryMetricPercentage","__default__$1","__default__","BentoSummaryGridItemSize","BentoSummaryGridItemSize2","BentoSummaryGridItemTrendDirection","BentoSummaryGridItemTrendDirection2"],"mappings":";;;;;;;;;;;;wCAgGIA,KAAA,CAAA;;;;;;;;AAxDA,UAAAC,IAAAC,GAKAC,IAAAC,EAAA,GACAC,IAAAC,EAAAH,CAAA;AAEA,QAAAI,IAAA;AACA,QAAAJ,GAAA;AACI,YAAAK,IAAA,OAAA,KAAAL,CAAA,GAAA,OAAA,CAAAM,MAAAA,EAAA,SAAA,OAAA,CAAA,GAAA,IAAA,CAAAA,MAAA,SAAAA,EAAA,MAAA,GAAA,IAAA,CAAA,GAAA,EAAA,CAAA;AAGA,MAAAF,IAAA,KAAA,IAAA,GAAAC,CAAA;AAAA,IAAmC;AAGvC,WAAAE,EAAA,MAAA;AACI,UAAAH,IAAA;AACI,cAAA,IAAA;AAAA,UAAU;AAAA,QACN;AAAA,IAER,CAAA,GAQJI,EAAAC,GALA,OAEI,EAAA,wBAAA,EAGJ,GACAD,EAAAE,GAAAC,EAAAb,GAAA,aAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uKCkGAc,KAAA,CAAA;;;;;;;;;;;;;;;;;;;AA3EA,UAAAd,IAAAC,GAcA,EAAA,gBAAAc,GAAA,yBAAAC,GAAA,UAAAC,GAAA,MAAAC,EAAA,IAAAC,EAAAnB,CAAA,GACAoB,IAAAC,EAAAT,GAAAU,EAAA,EAAA,CAAA,GAEAC,IAAA,CAAAC,MAAA;AACI,cAAAA,GAAA;AAAA,QAAmB,KAAA;AAEX,iBAAA;AAAA,QAAO,KAAA;AAEP,iBAAA;AAAA,QAAO;AA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AA,MAA4C,OAAA;AAAA,MACjC,uBAAA;AAAA,IACgB,GAG3BC,IAAA,CAAAC,MAAAA,KAAA,QAAAA,MAAA,MAAA,CAAA,MAAA,OAAAA,CAAA,CAAA,GACAC,IAAA,CAAAD,MACIA,KAAAD,EAAAC,CAAA,IACI,IAAA,KAAA,aAAAJ,EAAA,OAAAE,CAAA,EAAA,OAAA,OAAAE,CAAA,IAAA,GAAA,IAEJA,GAGJE,IAAAhB,EAAA,MAAAe,EAAAzC,EAAA,KAAA,CAAA,GACA2C,IAAAjB,EAAA,MAAAe,EAAAzC,EAAA,eAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ICVA4C,KAAA,CAAA;;;;;;;;;;;;;;AAtBA,UAAA1C,IAAAC,EAAA,GACAC,IAAAC,EAAAH,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;ICgBA2C,KAAA,CAAA;;;;;;;;;;;;;AApBA,UAAA3C,IAAAC,EAAA,GACAC,IAAAC,EAAAH,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;ACxCG,IAAA4C,KAAA,kBAAAC,OACHA,EAAA,QAAA,SACAA,EAAA,SAAA,UACAA,EAAA,QAAA,SAHQA,IAAAD,MAAA,CAAA,CAAA,GASLE,KAAA,kBAAAC,OACHA,EAAA,WAAA,YACAA,EAAA,WAAA,YACAA,EAAA,UAAA,WAHQA,IAAAD,MAAA,CAAA,CAAA;"}
1
+ {"version":3,"file":"summary-grid.types.CDithi8M.js","sources":["../../../vue2/src/components/summary-grid/summary-grid.vue","../../../vue2/src/components/summary-grid/components/summary-grid-item/summary-grid-item.vue","../../../vue2/src/components/summary-grid/components/summary-grid-item-amount/summary-grid-item-amount.vue","../../../vue2/src/components/summary-grid/components/summary-grid-item-numeric/summary-grid-item-numeric.vue","../../../vue2/src/components/summary-grid/components/summary-grid-item-percentage/summary-grid-item-percentage.vue","../../../vue2/src/components/summary-grid/components/summary-grid-item-text/summary-grid-item-text.vue","../../../vue2/src/components/summary-grid/components/summary-grid-item-custom/summary-grid-item-custom.vue","../../../vue2/src/components/summary-grid/summary-grid.types.ts"],"sourcesContent":["<template>\n <div class=\"b-summary-grid\">\n <grid-layout\n v-for=\"index in numberOfRows\"\n :key=\"`summary-grid-row-${index}`\"\n :data-testid=\"`summary-grid-row-${index}`\"\n :column-width=\"columnWidth?.[`row${index}`]\"\n >\n <template v-if=\"hasSlot(`cell-${index}-1`)\" #col-1>\n <slot :name=\"`cell-${index}-1`\" />\n </template>\n <template v-if=\"hasSlot(`cell-${index}-2`)\" #col-2>\n <slot :name=\"`cell-${index}-2`\" />\n </template>\n <template v-if=\"hasSlot(`cell-${index}-3`)\" #col-3>\n <slot :name=\"`cell-${index}-3`\" />\n </template>\n <template v-if=\"hasSlot(`cell-${index}-4`)\" #col-4>\n <slot :name=\"`cell-${index}-4`\" />\n </template>\n <template v-if=\"hasSlot(`cell-${index}-5`)\" #col-5>\n <slot :name=\"`cell-${index}-5`\" />\n </template>\n <template v-if=\"hasSlot(`cell-${index}-6`)\" #col-6>\n <slot :name=\"`cell-${index}-6`\" />\n </template>\n </grid-layout>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { onMounted, provide, toRef, useSlots } from 'vue';\n import type { BentoSummaryGridLayout, BentoSummaryGridProps } from './summary-grid.types';\n import { GridLayout } from '@/components/internal';\n import { useHasSlot } from '@/composables';\n import {\n SUMMARY_GRID_LAYOUT_INJECTION_KEY,\n SUMMARY_GRID_SLASHED_ZERO,\n } from '@/components/summary-grid/summary-grid.keys';\n\n const props = withDefaults(defineProps<BentoSummaryGridProps>(), {\n columnWidth: null,\n slashedZero: false,\n });\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n\n let numberOfRows = 1;\n if (slots) {\n const slotRows = Object.keys(slots)\n ?.filter(slotName => slotName.includes('cell-'))\n ?.map(slotName => parseInt(slotName.split('-')?.[1], 10));\n numberOfRows = Math.max(...slotRows);\n }\n\n onMounted(() => {\n if (numberOfRows > 3) {\n throw new Error(\n 'BentoSummaryGrid must only have a maximum of 3 rows. Read the documentation for more information.'\n );\n }\n });\n\n const registerComponentsInSummaryGrid: BentoSummaryGridLayout = () => {\n const isSummaryGridLayout = true;\n return { isSummaryGridLayout };\n };\n\n provide(SUMMARY_GRID_LAYOUT_INJECTION_KEY, registerComponentsInSummaryGrid);\n provide(SUMMARY_GRID_SLASHED_ZERO, toRef(props, 'slashedZero'));\n</script>\n\n<script lang=\"ts\">\n /**\n * A summary grid component that displays a collection items.\n *\n * @example\n * import { BentoSummaryGrid, BentoSummaryGridItemAmount } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoSummaryGrid, BentoSummaryGridItemAmount },\n * template: `\n * <bento-summary-grid>\n * <template #cell-2-2>\n * <bento-summary-grid-item-amount\n * title=\"Text Item\"\n * label=\"14\"\n * info-icon-tooltip-text=\"text for icon\"\n * copy=\"copy this to clipboard\"\n * />\n * </template>\n * </bento-summary-grid>\n * `\n * }\n */\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"./summary-grid.scss\" />\n","<template>\n <div class=\"b-summary-grid-item\" :class=\"conditionalClasses\" :style=\"computedStyles\">\n <div class=\"b-summary-grid-item__header\">\n <bento-typography class=\"b-summary-grid-item__title\" el=\"span\" variant=\"body\">\n <bento-dashed-underline\n v-if=\"withUnderline\"\n :tooltip-text=\"underlineTooltipText\"\n :popover-size=\"underlinePopoverSize\"\n >\n {{ title }}\n <template v-if=\"hasSlot('dashed-underline')\" #popover-content>\n <slot name=\"dashed-underline\"></slot>\n </template>\n </bento-dashed-underline>\n <template v-else>\n {{ title }}\n </template>\n </bento-typography>\n <div class=\"b-summary-grid-item__title-icons\">\n <copy v-if=\"copy\" class=\"b-structured-list__icon\" :text=\"copy\" @click=\"$emit('copy-click', $event)\" />\n\n <bento-info-icon\n v-if=\"infoIconTooltipText\"\n :tooltip-text=\"infoIconTooltipText\"\n tooltip-position=\"top\"\n class=\"b-summary-grid-item__title-tooltip\"\n @mouseenter=\"$emit('info-icon-mouseenter', $event)\"\n />\n </div>\n </div>\n <bento-typography\n data-testid=\"summary-grid-item-content-typography\"\n class=\"b-summary-grid-item__title\"\n v-bind=\"typographyProps\"\n el=\"span\"\n >\n <slot />\n <bento-tag\n v-if=\"trend && itemType !== 'text'\"\n :variant=\"trendVariant\"\n :label=\"trend\"\n class=\"b-summary-grid-item__content-trend\"\n />\n </bento-typography>\n <bento-typography\n v-if=\"hasSlot('secondary')\"\n class=\"b-summary-grid-item__title\"\n data-testid=\"summary-grid-item-secondary-metric-typography\"\n el=\"span\"\n variant=\"caption\"\n stronger\n >\n <slot name=\"secondary\" />\n <bento-tag\n v-if=\"secondaryTrend\"\n :variant=\"secondaryTrendVariant\"\n :label=\"secondaryTrend\"\n class=\"b-summary-grid-item__content-trend\"\n />\n </bento-typography>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, inject, ref, toRefs, useSlots } from 'vue';\n\n // Components\n import { BentoDashedUnderline } from '@/components/dashed-underline';\n import { BentoInfoIcon } from '@/components/info-icon';\n import { BentoTypography, type BentoTypographyVariant } from '@/components/typography';\n import { BentoTag, type BentoTagVariant } from '@/components/tag';\n import { Copy } from '@/internal';\n\n // Utils\n import { useHasSlot } from '@/composables';\n\n // Types\n import { SUMMARY_GRID_SLASHED_ZERO } from '@/components/summary-grid/summary-grid.keys';\n import type { BentoSummaryGridItemTrendDirection } from '@/components/summary-grid/summary-grid.types';\n import type { BentoSummaryGridItemProps } from './summary-grid-item.types';\n\n defineEmits<{\n /**\n * Emitted when the copy button is clicked.\n */\n (e: 'copy-click', event: MouseEvent): void;\n\n /**\n * Emitted when the mouse pointer enters the info icon component.\n */\n (e: 'info-icon-mouseenter', event: MouseEvent): void;\n }>();\n\n const props = withDefaults(defineProps<BentoSummaryGridItemProps>(), {\n copy: undefined,\n fitContent: false,\n infoIconTooltipText: null,\n itemType: 'custom',\n secondaryTrend: null,\n secondaryTrendDirection: 'positive',\n size: 'small',\n trend: null,\n trendDirection: 'positive',\n underlinePopoverSize: 'fit-content',\n underlineTooltipText: null,\n });\n\n const { trendDirection, secondaryTrendDirection, itemType, size } = toRefs(props);\n const hasSlashedZero = inject(SUMMARY_GRID_SLASHED_ZERO, ref(false));\n\n const tagVariantColor = (direction: `${BentoSummaryGridItemTrendDirection}`): `${BentoTagVariant}` => {\n switch (direction) {\n case 'positive':\n return 'green';\n case 'negative':\n return 'red';\n default:\n return 'blue';\n }\n };\n\n // TODO implement plus or minus symbol logic\n const trendVariant = computed(() => tagVariantColor(trendDirection.value));\n const secondaryTrendVariant = computed(() => tagVariantColor(secondaryTrendDirection.value));\n\n const typographyContentElement = computed<`${BentoTypographyVariant}`>(() => {\n if (size.value === 'small') {\n return 'body';\n }\n if (itemType.value !== 'text') {\n return 'title';\n }\n\n return null;\n });\n\n const typographyProps = computed(() => ({\n medium: size.value === 'large',\n strongest: size.value === 'small',\n wide: size.value === 'small',\n variant: typographyContentElement.value,\n }));\n\n const computedStyles = computed(() => (props.fitContent ? { width: 'fit-content' } : {}));\n\n const conditionalClasses = computed(() => ({ 'b-summary-grid-item--slashed-zero': hasSlashedZero.value }));\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n const withUnderline = computed(() => props.underlineTooltipText || hasSlot('dashed-underline'));\n</script>\n\n<script lang=\"ts\">\n /**\n * A summary bar item is a piece of information to be displayed in `bento-summary-bar` component\n *\n * @example\n * import { SummaryBarItem } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { SummaryBarItem },\n * template: `\n * <summary-grid-item :title=\"textVariable\">\n * Content of the item\n * </summary-grid-item>\n * `\n * }\n */\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"./summary-grid-item.scss\" />\n","<template>\n <summary-grid-item\n item-type=\"amount\"\n :info-icon-tooltip-text=\"infoIconTooltipText\"\n :title=\"title\"\n :copy=\"copy\"\n :fit-content=\"fitContent\"\n :size=\"size\"\n :trend=\"trend\"\n :trend-direction=\"trendDirection\"\n :secondary-trend=\"secondaryTrend\"\n :secondary-trend-direction=\"secondaryTrendDirection\"\n :underline-popover-size=\"underlinePopoverSize\"\n :underline-tooltip-text=\"underlineTooltipText\"\n class=\"b-summary-grid-item-amount\"\n @copy-click=\"$emit('copy-click', $event)\"\n @info-icon-mouseenter=\"$emit('info-icon-mouseenter', $event)\"\n >\n <template v-if=\"hasSlot('dashed-underline')\" #dashed-underline>\n <slot name=\"dashed-underline\" />\n </template>\n <div class=\"b-summary-grid-item-amount__content\">\n <div>{{ label }}</div>\n <bento-typography\n v-if=\"secondaryLabel\"\n variant=\"caption\"\n class=\"b-summary-grid-item-amount__secondary-label\"\n >{{ secondaryLabel }}</bento-typography\n >\n </div>\n <template v-if=\"secondaryMetric\" #secondary>\n {{ secondaryMetric }}\n </template>\n </summary-grid-item>\n</template>\n\n<script setup lang=\"ts\">\n import { useSlots } from 'vue';\n import { BentoTypography } from '@/components/typography';\n import { SummaryGridItem } from '../summary-grid-item';\n import { useHasSlot } from '@/composables';\n import type { BentoSummaryGridItemAmountProps } from './summary-grid-item-amount.types';\n\n defineEmits<{\n /**\n * Emitted when the copy button is clicked.\n */\n (e: 'copy-click', event: MouseEvent): void;\n\n /**\n * Emitted when the mouse pointer enters the info icon component.\n */\n (e: 'info-icon-mouseenter', event: MouseEvent): void;\n }>();\n\n withDefaults(defineProps<BentoSummaryGridItemAmountProps>(), {\n copy: undefined,\n fitContent: false,\n infoIconTooltipText: null,\n secondaryLabel: null,\n secondaryMetric: null,\n secondaryTrend: null,\n secondaryTrendDirection: 'positive',\n size: 'small',\n trend: null,\n trendDirection: 'positive',\n underlinePopoverSize: 'fit-content',\n underlineTooltipText: null,\n });\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n</script>\n\n<script lang=\"ts\">\n /**\n * Summary grid item component used to display financial data, such as currency values and monetary amounts\n *\n * @example\n * import { BentoSummaryGridItemAmount } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoSummaryGridItemAmount },\n * template: `\n * <bento-summary-grid-item-amount\n * title=\"Your title\"\n * label=\"200.00 EUR\"\n * secondary-label=\"/ day\"\n * info-icon-tooltip-text=\"Your tooltip text here will be toggled by the info icon\"\n * trend=\"+12%\"\n * trend-direction=\"neutral\"\n * size=\"medium\"\n * />\n * `\n * }\n */\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"./summary-grid-item-amount.scss\" />\n","<template>\n <summary-grid-item\n item-type=\"numeric\"\n :info-icon-tooltip-text=\"infoIconTooltipText\"\n :title=\"title\"\n :copy=\"copy\"\n :fit-content=\"fitContent\"\n :size=\"size\"\n :trend=\"trend\"\n :trend-direction=\"trendDirection\"\n :secondary-trend=\"secondaryTrend\"\n :secondary-trend-direction=\"secondaryTrendDirection\"\n :underline-popover-size=\"underlinePopoverSize\"\n :underline-tooltip-text=\"underlineTooltipText\"\n class=\"b-summary-grid-item-numeric\"\n @copy-click=\"$emit('copy-click', $event)\"\n @info-icon-mouseenter=\"$emit('info-icon-mouseenter', $event)\"\n >\n <template v-if=\"hasSlot('dashed-underline')\" #dashed-underline>\n <slot name=\"dashed-underline\" />\n </template>\n {{ label }}\n <template v-if=\"secondaryMetric\" #secondary>\n {{ secondaryMetric }}\n </template>\n </summary-grid-item>\n</template>\n\n<script setup lang=\"ts\">\n import { useSlots } from 'vue';\n import { SummaryGridItem } from '../summary-grid-item';\n import { useHasSlot } from '@/composables';\n import type { BentoSummaryGridItemNumericProps } from './summary-grid-item-numeric.types';\n\n defineEmits<{\n /**\n * Emitted when the copy button is clicked.\n */\n (e: 'copy-click', event: MouseEvent): void;\n\n /**\n * Emitted when the mouse pointer enters the info icon component.\n */\n (e: 'info-icon-mouseenter', event: MouseEvent): void;\n }>();\n\n withDefaults(defineProps<BentoSummaryGridItemNumericProps>(), {\n copy: undefined,\n fitContent: false,\n infoIconTooltipText: null,\n secondaryMetric: null,\n secondaryTrend: null,\n secondaryTrendDirection: 'positive',\n size: 'small',\n trend: null,\n trendDirection: 'positive',\n underlinePopoverSize: 'fit-content',\n underlineTooltipText: null,\n });\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n</script>\n\n<script lang=\"ts\">\n /**\n * Summary grid item component used to display any numeric information\n *\n * @example\n * import { BentoSummaryGridItemNumeric } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoSummaryGridItemNumeric },\n * template: `\n * <bento-summary-grid-item-numeric\n * title=\"Your title\"\n * label=\"123\"\n * info-icon-tooltip-text=\"Your tooltip text here will be toggled by the info icon\"\n * trend=\"+12%\"\n * trend-direction=\"neutral\"\n * size=\"medium\"\n * />\n * `\n * }\n */\n export default {};\n</script>\n","<template>\n <summary-grid-item\n item-type=\"percentage\"\n :info-icon-tooltip-text=\"infoIconTooltipText\"\n :title=\"title\"\n :copy=\"copy\"\n :fit-content=\"fitContent\"\n :size=\"size\"\n :trend=\"trend\"\n :trend-direction=\"trendDirection\"\n :secondary-trend=\"secondaryTrend\"\n :secondary-trend-direction=\"secondaryTrendDirection\"\n :underline-popover-size=\"underlinePopoverSize\"\n :underline-tooltip-text=\"underlineTooltipText\"\n class=\"b-summary-grid-item-percentage\"\n @copy-click=\"$emit('copy-click', $event)\"\n @info-icon-mouseenter=\"$emit('info-icon-mouseenter', $event)\"\n >\n <template v-if=\"hasSlot('dashed-underline')\" #dashed-underline>\n <slot name=\"dashed-underline\" />\n </template>\n {{ computedLabelPercentage }}\n <template v-if=\"secondaryMetric\" #secondary> {{ computedSecondaryMetricPercentage }} </template>\n </summary-grid-item>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, useSlots } from 'vue';\n import { SummaryGridItem } from '../summary-grid-item';\n import { useHasSlot } from '@/composables';\n import { useI18n } from '@/utils/ts/i18n';\n import type { BentoSummaryGridItemPercentageProps } from './summary-grid-item-percentage.types';\n import type { NumberFormatOptions } from 'vue-i18n';\n\n const { locale } = useI18n();\n\n defineEmits<{\n /**\n * Emitted when the copy button is clicked.\n */\n (e: 'copy-click', event: MouseEvent): void;\n\n /**\n * Emitted when the mouse pointer enters the info icon component.\n */\n (e: 'info-icon-mouseenter', event: MouseEvent): void;\n }>();\n\n const props = withDefaults(defineProps<BentoSummaryGridItemPercentageProps>(), {\n copy: undefined,\n fitContent: false,\n infoIconTooltipText: null,\n secondaryMetric: null,\n secondaryTrend: null,\n secondaryTrendDirection: 'positive',\n size: 'small',\n trend: null,\n trendDirection: 'positive',\n underlinePopoverSize: 'fit-content',\n underlineTooltipText: null,\n });\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n\n const percentageArgs: NumberFormatOptions = {\n style: 'percent',\n maximumFractionDigits: 2,\n };\n\n const isNumeric = (value: string | number) => value != null && value !== '' && !isNaN(Number(value));\n const convertToPercentIfNumber = (value: string | number) => {\n if (value && isNumeric(value)) {\n return new Intl.NumberFormat(locale.value, percentageArgs).format(Number(value) / 100);\n }\n return value;\n };\n\n const computedLabelPercentage = computed(() => convertToPercentIfNumber(props.label));\n const computedSecondaryMetricPercentage = computed(() => convertToPercentIfNumber(props.secondaryMetric));\n</script>\n\n<script lang=\"ts\">\n /**\n * Summary grid item component used to display any percentage information\n *\n * @example\n * import { BentoSummaryGridItemPercentage } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoSummaryGridItemPercentage },\n * template: `\n * <bento-summary-grid-item-percentage\n * title=\"Your title\"\n * label=\"123\"\n * info-icon-tooltip-text=\"Your tooltip text here will be toggled by the info icon\"\n * trend=\"+12%\"\n * trend-direction=\"neutral\"\n * size=\"medium\"\n * />\n * `\n * }\n */\n export default {\n i18n: {},\n };\n</script>\n","<template>\n <summary-grid-item\n item-type=\"text\"\n :info-icon-tooltip-text=\"infoIconTooltipText\"\n :title=\"title\"\n :copy=\"copy\"\n :fit-content=\"fitContent\"\n :underline-popover-size=\"underlinePopoverSize\"\n :underline-tooltip-text=\"underlineTooltipText\"\n class=\"b-summary-grid-item-text\"\n @copy-click=\"$emit('copy-click', $event)\"\n @info-icon-mouseenter=\"$emit('info-icon-mouseenter', $event)\"\n >\n <template v-if=\"hasSlot('dashed-underline')\" #dashed-underline>\n <slot name=\"dashed-underline\" />\n </template>\n {{ label }}\n </summary-grid-item>\n</template>\n\n<script setup lang=\"ts\">\n import { useSlots } from 'vue';\n import { SummaryGridItem } from '../summary-grid-item';\n import { useHasSlot } from '@/composables';\n\n import type { BentoSummaryGridItemTextProps } from './summary-grid-item-text.types';\n\n defineEmits<{\n /**\n * Emitted when the copy button is clicked.\n */\n (e: 'copy-click', event: MouseEvent): void;\n\n /**\n * Emitted when the mouse pointer enters the info icon component.\n */\n (e: 'info-icon-mouseenter', event: MouseEvent): void;\n }>();\n\n withDefaults(defineProps<BentoSummaryGridItemTextProps>(), {\n copy: undefined,\n fitContent: false,\n infoIconTooltipText: null,\n underlinePopoverSize: 'fit-content',\n underlineTooltipText: null,\n });\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n</script>\n\n<script lang=\"ts\">\n /**\n * Summary grid item component used to display text only. Can be used for references, IDs or any other text data.\n *\n * @example\n * import { BentoSummaryGridItemText } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoSummaryGridItemText },\n * template: `\n * <bento-summary-grid-item-text\n * title=\"Your title\"\n * label=\"Your text here\"\n * info-icon-tooltip-text=\"Your tooltip text here will be toggled by the info icon\"\n * />\n * `\n * }\n */\n export default {};\n</script>\n","<template>\n <summary-grid-item\n :title=\"title\"\n :info-icon-tooltip-text=\"infoIconTooltipText\"\n :copy=\"copy\"\n :fit-content=\"fitContent\"\n :underline-popover-size=\"underlinePopoverSize\"\n :underline-tooltip-text=\"underlineTooltipText\"\n @copy-click=\"$emit('copy-click', $event)\"\n @info-icon-mouseenter=\"$emit('info-icon-mouseenter', $event)\"\n >\n <template v-if=\"hasSlot('dashed-underline')\" #dashed-underline>\n <slot name=\"dashed-underline\" />\n </template>\n <slot />\n </summary-grid-item>\n</template>\n\n<script setup lang=\"ts\">\n import { useSlots } from 'vue';\n import { SummaryGridItem } from '../summary-grid-item';\n import { useHasSlot } from '@/composables';\n import type { BentoSummaryGridItemCustomProps } from './summary-grid-item-custom.types';\n\n defineEmits<{\n /**\n * Emitted when the copy button is clicked.\n */\n (e: 'copy-click', event: MouseEvent): void;\n\n /**\n * Emitted when the mouse pointer enters the info icon component.\n */\n (e: 'info-icon-mouseenter', event: MouseEvent): void;\n }>();\n\n withDefaults(defineProps<BentoSummaryGridItemCustomProps>(), {\n copy: undefined,\n infoIconTooltipText: null,\n fitContent: false,\n underlinePopoverSize: 'fit-content',\n underlineTooltipText: null,\n });\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n</script>\n\n<script lang=\"ts\">\n /**\n * A summary bar item is a piece of information to be displayed in `bento-summary-bar` component\n *\n * @example\n * import { SummaryBarItem } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { SummaryBarItem },\n * template: `\n * <summary-grid-item :title=\"textVariable\">\n * Content of the item\n * </summary-grid-item>\n * `\n * }\n */\n export default {};\n</script>\n","import { type GridLayoutColumnWidths } from '@/components/internal/grid-layout/grid-layout.types';\n\n/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoSummaryGridItemSize {\n SMALL = 'small',\n MEDIUM = 'medium',\n LARGE = 'large',\n}\n\n/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoSummaryGridItemTrendDirection {\n POSITIVE = 'positive',\n NEGATIVE = 'negative',\n NEUTRAL = 'neutral',\n}\n\nexport interface BentoSummaryGridColumnWidth {\n row1: GridLayoutColumnWidths;\n row2?: GridLayoutColumnWidths;\n row3?: GridLayoutColumnWidths;\n}\n\nexport type BentoSummaryGridLayout = () => {\n isSummaryGridLayout: boolean;\n};\n\nexport interface BentoSummaryGridProps {\n /**\n * Sets the responsive columns widths values for 1 of the 3 rows.\n */\n columnWidth?: BentoSummaryGridColumnWidth;\n\n /**\n * Renders a font numeric style with slashed zeros instead of normal ones.\n */\n slashedZero?: boolean;\n}\n"],"names":["__default__$6","props","__props","slots","useSlots","hasSlot","useHasSlot","numberOfRows","slotRows","slotName","onMounted","provide","SUMMARY_GRID_LAYOUT_INJECTION_KEY","SUMMARY_GRID_SLASHED_ZERO","toRef","__default__$5","trendDirection","secondaryTrendDirection","itemType","size","toRefs","hasSlashedZero","inject","ref","tagVariantColor","direction","trendVariant","computed","secondaryTrendVariant","typographyContentElement","typographyProps","computedStyles","conditionalClasses","withUnderline","__default__$4","__default__$3","__default__$2","locale","useI18n","percentageArgs","isNumeric","value","convertToPercentIfNumber","computedLabelPercentage","computedSecondaryMetricPercentage","__default__$1","__default__","BentoSummaryGridItemSize","BentoSummaryGridItemSize2","BentoSummaryGridItemTrendDirection","BentoSummaryGridItemTrendDirection2"],"mappings":";;;;;;;;;;;;wCAgGIA,KAAA,CAAA;;;;;;;;AAxDA,UAAAC,IAAAC,GAKAC,IAAAC,EAAA,GACAC,IAAAC,EAAAH,CAAA;AAEA,QAAAI,IAAA;AACA,QAAAJ,GAAA;AACI,YAAAK,IAAA,OAAA,KAAAL,CAAA,GAAA,OAAA,CAAAM,MAAAA,EAAA,SAAA,OAAA,CAAA,GAAA,IAAA,CAAAA,MAAA,SAAAA,EAAA,MAAA,GAAA,IAAA,CAAA,GAAA,EAAA,CAAA;AAGA,MAAAF,IAAA,KAAA,IAAA,GAAAC,CAAA;AAAA,IAAmC;AAGvC,WAAAE,EAAA,MAAA;AACI,UAAAH,IAAA;AACI,cAAA,IAAA;AAAA,UAAU;AAAA,QACN;AAAA,IAER,CAAA,GAQJI,EAAAC,GALA,OAEI,EAAA,wBAAA,EAGJ,GACAD,EAAAE,GAAAC,EAAAb,GAAA,aAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uKCkGAc,KAAA,CAAA;;;;;;;;;;;;;;;;;;;AA3EA,UAAAd,IAAAC,GAcA,EAAA,gBAAAc,GAAA,yBAAAC,GAAA,UAAAC,GAAA,MAAAC,EAAA,IAAAC,EAAAnB,CAAA,GACAoB,IAAAC,EAAAT,GAAAU,EAA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;;;;;;;;;;;AAvEA,UAAA,EAAA,QAAAC,EAAA,IAAAC,GAAA,GAcArC,IAAAC,GAcAC,IAAAC,EAAA,GACAC,IAAAC,EAAAH,CAAA,GAEAoC,IAAA;AAAA,MAA4C,OAAA;AAAA,MACjC,uBAAA;AAAA,IACgB,GAG3BC,IAAA,CAAAC,MAAAA,KAAA,QAAAA,MAAA,MAAA,CAAA,MAAA,OAAAA,CAAA,CAAA,GACAC,IAAA,CAAAD,MACIA,KAAAD,EAAAC,CAAA,IACI,IAAA,KAAA,aAAAJ,EAAA,OAAAE,CAAA,EAAA,OAAA,OAAAE,CAAA,IAAA,GAAA,IAEJA,GAGJE,IAAAhB,EAAA,MAAAe,EAAAzC,EAAA,KAAA,CAAA,GACA2C,IAAAjB,EAAA,MAAAe,EAAAzC,EAAA,eAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ICVA4C,KAAA,CAAA;;;;;;;;;;;;;;AAtBA,UAAA1C,IAAAC,EAAA,GACAC,IAAAC,EAAAH,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;ICgBA2C,KAAA,CAAA;;;;;;;;;;;;;AApBA,UAAA3C,IAAAC,EAAA,GACAC,IAAAC,EAAAH,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;ACxCG,IAAA4C,KAAA,kBAAAC,OACHA,EAAA,QAAA,SACAA,EAAA,SAAA,UACAA,EAAA,QAAA,SAHQA,IAAAD,MAAA,CAAA,CAAA,GASLE,KAAA,kBAAAC,OACHA,EAAA,WAAA,YACAA,EAAA,WAAA,YACAA,EAAA,UAAA,WAHQA,IAAAD,MAAA,CAAA,CAAA;"}
@@ -9,10 +9,11 @@ import { u as Ie } from "./index.B875RXHM.js";
9
9
  import { u as ke } from "./form-field.D_2g7vaP.js";
10
10
  import { u as Oe } from "./use-form-layout-loading.CWbjZiwP.js";
11
11
  import { B as Ue } from "./es6.C1DXQV6f.js";
12
- import { F as Se, E as X } from "./error-message.849uzpkq.js";
12
+ import { F as Se } from "./field-label.DZYFjFgr.js";
13
+ import { E as X } from "./error-message.Dyvrw6ZB.js";
13
14
  import { _ as we } from "./_plugin-vue_export-helper.CHgC5LLL.js";
14
15
  import "../assets/textarea.css";
15
- var p = /* @__PURE__ */ ((t) => (t.CLEARABLE = "clearable", t.DISABLED = "disabled", t.ERROR = "error", t.READONLY = "readonly", t))(p || {}), u = /* @__PURE__ */ ((t) => (t.BLUR = "blur", t.CHANGE = "change", t.CLEAR = "clear", t.ESCAPE_PRESSED = "escape-pressed", t.FOCUS = "focus", t.INPUT = "input", t.UPDATE_MODEL_VALUE = "update:model-value", t.KEYDOWN = "keydown", t.KEYUP = "keyup", t))(u || {});
16
+ var m = /* @__PURE__ */ ((t) => (t.CLEARABLE = "clearable", t.DISABLED = "disabled", t.ERROR = "error", t.READONLY = "readonly", t))(m || {}), u = /* @__PURE__ */ ((t) => (t.BLUR = "blur", t.CHANGE = "change", t.CLEAR = "clear", t.ESCAPE_PRESSED = "escape-pressed", t.FOCUS = "focus", t.INPUT = "input", t.UPDATE_MODEL_VALUE = "update:model-value", t.KEYDOWN = "keydown", t.KEYUP = "keyup", t))(u || {});
16
17
  const j = {
17
18
  "de-DE": { clearText: "Text löschen", textarea: "textarea", yourTextCanBenAtMost: "Ihr Text darf maximal {characterLimit} Zeichen lang sein." },
18
19
  "en-GB": { clearText: "Clear text", textarea: "textarea", yourTextCanBenAtMost: "Your text can be at most {characterLimit} characters" },
@@ -52,16 +53,16 @@ const j = {
52
53
  tooltipText: { default: null }
53
54
  },
54
55
  setup(t, { expose: J, emit: Z }) {
55
- const Q = Ce(), a = t, i = Z, { height: C } = q(a), U = Me("textarea"), l = n(null), L = n(null), o = n(a.modelValue || a.value), m = 44, x = n(a.height || `${m}px`), S = n(0), E = n("100%"), _ = n(!1);
56
+ const Q = Ce(), a = t, i = Z, { height: C } = q(a), U = Me("textarea"), l = n(null), L = n(null), o = n(a.modelValue || a.value), p = 44, x = n(a.height || `${p}px`), S = n(0), E = n("100%"), _ = n(!1);
56
57
  let w = null, F = null;
57
58
  const { t: P, n: V } = Ie({ messages: j }), { isReadOnly: h } = Oe(Le(a, "readonly")), { emitValue: N } = ke(i), ee = s(() => `${V(o?.value?.length ?? 0)} / ${V(a.characterLimit)}`), b = s(() => !C.value), A = s(
58
59
  () => a.characterLimit && o.value.length > a.characterLimit
59
60
  ), T = () => {
60
61
  if (l.value) {
61
62
  const e = Math.max(
62
- l.value.scrollHeight <= m ? m : l.value.scrollHeight + Ve * 2,
63
+ l.value.scrollHeight <= p ? p : l.value.scrollHeight + Ve * 2,
63
64
  S.value,
64
- m
65
+ p
65
66
  );
66
67
  x.value = `${e}px`;
67
68
  }
@@ -78,7 +79,7 @@ const j = {
78
79
  () => o.value,
79
80
  async () => {
80
81
  if (b.value) {
81
- if (x.value = `${m}px`, !o.value)
82
+ if (x.value = `${p}px`, !o.value)
82
83
  return;
83
84
  await Ee(), T();
84
85
  }
@@ -86,16 +87,16 @@ const j = {
86
87
  { immediate: !0 }
87
88
  );
88
89
  const H = s(() => !!a.errorMessage || A.value), ae = s(() => ({
89
- [`b-textarea--${p.DISABLED}`]: a.disabled
90
+ [`b-textarea--${m.DISABLED}`]: a.disabled
90
91
  })), te = s(() => ({
91
- [`b-textarea__input--${p.CLEARABLE}`]: a.clearable,
92
- [`b-textarea__input--${p.READONLY}`]: h.value,
93
- [`b-textarea__input--${p.ERROR}`]: H.value,
92
+ [`b-textarea__input--${m.CLEARABLE}`]: a.clearable,
93
+ [`b-textarea__input--${m.READONLY}`]: h.value,
94
+ [`b-textarea__input--${m.ERROR}`]: H.value,
94
95
  "b-textarea__input--dynamic-height": b.value
95
96
  })), re = s(() => ({
96
97
  "b-textarea__label-box--no-label": !a.label
97
98
  })), le = s(() => ({
98
- [`b-textarea__label-item--${p.ERROR}`]: A.value
99
+ [`b-textarea__label-item--${m.ERROR}`]: A.value
99
100
  })), oe = s(() => P("yourTextCanBenAtMost", { characterLimit: a.characterLimit })), se = n(Q["aria-label"]), { ariaLabel: ie, label: B } = q(a), ne = De({
100
101
  ariaLabel: se.value,
101
102
  // TODO: take this line away when the aria-label props is removed
@@ -109,9 +110,9 @@ const j = {
109
110
  e.stopImmediatePropagation(), !a.disabled && !h.value && (o.value = e.target.value, N(o.value));
110
111
  }, de = () => {
111
112
  l.value.scrollTop = 0, i(u.BLUR);
112
- }, pe = () => {
113
- l.value.focus(), i(u.FOCUS);
114
113
  }, me = () => {
114
+ l.value.focus(), i(u.FOCUS);
115
+ }, pe = () => {
115
116
  i(u.CHANGE);
116
117
  }, xe = () => {
117
118
  i(u.ESCAPE_PRESSED);
@@ -198,8 +199,8 @@ const j = {
198
199
  placeholder: e.placeholder,
199
200
  style: W({ resize: e.resizable, height: x.value }),
200
201
  onBlur: de,
201
- onChange: me,
202
- onFocus: pe,
202
+ onChange: pe,
203
+ onFocus: me,
203
204
  onInput: ce,
204
205
  onKeydown: [
205
206
  k(xe, ["esc"]),
@@ -249,8 +250,8 @@ const j = {
249
250
  ], 4)
250
251
  ], 2));
251
252
  }
252
- }), ta = /* @__PURE__ */ we(He, [["__scopeId", "data-v-36a2792c"]]);
253
+ }), ra = /* @__PURE__ */ we(He, [["__scopeId", "data-v-36a2792c"]]);
253
254
  export {
254
- ta as B
255
+ ra as B
255
256
  };
256
- //# sourceMappingURL=textarea.C-sBemuo.js.map
257
+ //# sourceMappingURL=textarea.JGXAlpx9.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"textarea.C-sBemuo.js","sources":["../../../vue2/src/components/textarea/textarea.types.ts","../../../vue2/src/components/textarea/textarea.vue"],"sourcesContent":["import type { FormField } from '../../types/form-field';\n\n/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoTextareaResizeOption {\n HORIZONTAL = 'horizontal',\n VERTICAL = 'vertical',\n BOTH = 'both',\n NONE = 'none',\n}\n\nexport enum BentoTextareaStateClass {\n CLEARABLE = 'clearable',\n DISABLED = 'disabled',\n ERROR = 'error',\n READONLY = 'readonly',\n}\n\nexport enum BentoTextareaEvent {\n BLUR = 'blur',\n CHANGE = 'change',\n CLEAR = 'clear',\n ESCAPE_PRESSED = 'escape-pressed',\n FOCUS = 'focus',\n INPUT = 'input',\n UPDATE_MODEL_VALUE = 'update:model-value',\n KEYDOWN = 'keydown',\n KEYUP = 'keyup',\n}\n\nexport interface BentoTextareaProps extends FormField {\n /**\n * Text that labels the input element\n * @default undefined\n */\n ariaLabel?: string;\n\n /**\n * Text that shows number of characters in textarea\n * @default undefined\n */\n characterLimit?: number;\n\n /**\n * If set to true, shows a button to clear all the text\n * @default false\n */\n clearable?: boolean;\n\n /**\n * Sets the height of the textarea, e.g 200px OR 20vh\n * @default null\n */\n height?: string | null;\n\n /**\n * Indicates the possibility of resize the textarea.\n * Accepts the Enum or the string literal version.\n * @default BentoTextareaResizeOption.BOTH\n */\n resizable?: BentoTextareaResizeOption | `${BentoTextareaResizeOption}`;\n\n /**\n * Text displayed as the value of the textarea\n * @deprecated for usage with properties since version 2.0. Use `v-model` or `model-value` instead.\n */\n value?: string;\n\n /**\n * Text displayed as the value of the textarea\n */\n modelValue?: string;\n}\n","<template>\n <div ref=\"textareaComponent\" class=\"b-textarea\" :class=\"conditionalClasses\">\n <div :style=\"{ width: textareaWrapperWidth }\">\n <div class=\"b-textarea__label-box\" :class=\"conditionalClassesLabelBox\">\n <field-label\n v-if=\"label\"\n :for=\"textareaId\"\n :label=\"label\"\n :tooltip-text=\"tooltipText\"\n :optional=\"optional\"\n :required=\"required\"\n />\n <bento-typography\n v-if=\"characterLimit\"\n el=\"span\"\n class=\"b-textarea__label-item\"\n :class=\"conditionalClassesLabelItem\"\n >\n {{ counter }}\n </bento-typography>\n </div>\n <bento-typography el=\"div\" class=\"b-textarea__input-box\" :aria-disabled=\"disabled\">\n <textarea\n :id=\"textareaId\"\n ref=\"textareaElement\"\n :value=\"textareaValue\"\n class=\"b-textarea__input\"\n :class=\"conditionalClassesInput\"\n :aria-label=\"computedAriaLabel\"\n :aria-invalid=\"invalidInput\"\n :readonly=\"isReadOnly\"\n :required=\"required\"\n :aria-required=\"required\"\n :disabled=\"disabled\"\n :placeholder=\"placeholder\"\n :style=\"{ resize: resizable, height: textareaHeight }\"\n @blur=\"onBlur\"\n @change=\"onChange\"\n @focus=\"onFocus\"\n @input=\"onInput\"\n @keydown.esc=\"onPressEscape\"\n @keydown=\"onKeyDown\"\n @keyup=\"onKeyUp\"\n @mousedown=\"onMouseDown\"\n @mouseup=\"onMouseUp\"\n >\n </textarea>\n\n <div v-if=\"showClearButton\" class=\"b-textarea__clear-button\">\n <bento-button\n variant=\"tertiary\"\n :disabled=\"disabled\"\n @click=\"onClear\"\n @keypress.enter=\"onClear\"\n @keyup.space=\"onClear\"\n >\n <template #iconLeft>\n <cross-circle-fill-small-icon :svg-title=\"t('clearText')\" />\n </template>\n </bento-button>\n </div>\n </bento-typography>\n\n <error-message v-if=\"isOverCharacterLimit\" :error-message=\"counterErrorText\" />\n\n <error-message v-if=\"errorMessage\" :error-message=\"errorMessage\" />\n\n <bento-typography v-if=\"description\" class=\"b-textarea__description\" el=\"span\">\n {{ description }}\n </bento-typography>\n </div>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, nextTick, onMounted, onUnmounted, ref, toRef, toRefs, useAttrs, watch } from 'vue';\n\n // Components\n import { BentoButton } from '@/components/button';\n import { BentoTypography } from '@/components/typography';\n import { ErrorMessage, FieldLabel } from '@/internal';\n import CrossCircleFillSmallIcon from '@adyen/ui-assets-icons-16/vue/cross-circle-fill-small';\n\n // Utils\n import { generateUid } from '@/core/utils/ts';\n import { observeSizeOfElement } from '@/utils/ts/resize';\n import { useAriaLabel } from '@/utils/ts/aria-label';\n import { useI18n } from '@/utils/ts/i18n';\n import { deprecate } from '@/utils/ts/deprecate';\n import { useFormFieldEmits } from '@/utils/ts/form-field/form-field';\n\n // Composables\n import { useFormLayoutFieldLoading } from '@/composables/use-form-layout-loading/use-form-layout-loading';\n\n // Constants\n import { BBorderWidthAttention } from '@adyen/bento-design-tokens/dist/js/bento/es6';\n\n // Types\n import { BentoTextareaEvent, type BentoTextareaProps, BentoTextareaStateClass } from './textarea.types';\n\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const attrs = useAttrs();\n\n const props = withDefaults(defineProps<BentoTextareaProps>(), {\n ariaLabel: undefined,\n characterLimit: undefined,\n description: '',\n disabled: false,\n clearable: false,\n errorMessage: '',\n height: null,\n label: '',\n optional: false,\n placeholder: '',\n readonly: false,\n resizable: 'both',\n required: false,\n tooltipText: null,\n value: '',\n modelValue: '',\n });\n\n const emit = defineEmits<{\n /**\n * Emitted when the element has lost focus\n */\n (e: BentoTextareaEvent.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: BentoTextareaEvent.CHANGE): void;\n\n /**\n * Emitted when the \"Clear\" button was clicked\n */\n (e: BentoTextareaEvent.CLEAR): void;\n\n /**\n * Emitted when the \"ESC\" key is pressed\n */\n (e: BentoTextareaEvent.ESCAPE_PRESSED): void;\n\n /**\n * Emitted when the element has received focus\n */\n (e: BentoTextareaEvent.FOCUS): void;\n\n /**\n * Emitted when the component's model changes\n *\n * @deprecated since version 2.0. Use `v-model` or `update:model-value` instead.\n *\n */\n (e: BentoTextareaEvent.INPUT, value: string): void;\n\n /**\n * Emitted when the component's model changes\n */\n (e: BentoTextareaEvent.UPDATE_MODEL_VALUE, value: string): void;\n\n /**\n * Emitted when the text area keydown event is fired\n */\n (e: BentoTextareaEvent.KEYDOWN, event: KeyboardEvent): void;\n\n /**\n * Emitted when the text area keyup event is fired\n */\n (e: BentoTextareaEvent.KEYUP, event: KeyboardEvent): void;\n }>();\n\n const { height } = toRefs(props);\n\n const textareaId = generateUid('textarea');\n const textareaElement = ref<HTMLTextAreaElement>(null);\n const textareaComponent = ref<HTMLDivElement>(null);\n const textareaValue = ref(props.modelValue || props.value);\n const defaultTextareaHeight = 44;\n const textareaHeight = ref(props.height || `${defaultTextareaHeight}px`);\n const userSetHeight = ref<number>(0);\n const textareaWrapperWidth = ref('100%'); // The width set to the wrapper of the label, textarea and description\n const isUserResizing = ref(false);\n let textareaElementObserver: ResizeObserver | null = null;\n let textareaComponentObserver: ResizeObserver | null = null;\n\n const { t, n } = useI18n<{ message: MessageSchema }>({ messages });\n\n const { isReadOnly } = useFormLayoutFieldLoading(toRef(props, 'readonly'));\n\n const { emitValue } = useFormFieldEmits<string>(emit);\n\n const counter = computed(() => `${n(textareaValue?.value?.length ?? 0)} / ${n(props.characterLimit)}`);\n const isDynamicHeight = computed(() => !height.value);\n const isOverCharacterLimit = computed(\n () => props.characterLimit && textareaValue.value.length > props.characterLimit\n );\n\n /**\n * Calculates and sets the height of the textarea.\n * The height is determined by the maximum of the following values:\n *\n * 1. The content's scroll height (with a minimum of `defaultTextareaHeight`) + the border width.\n * 2. The height set by the user manually resizing the textarea (`userSetHeight`).\n * 3. The default minimum height (`defaultTextareaHeight`).\n *\n * This ensures the textarea grows with content, shrinks when content is removed,\n * but never goes below the manually set height or the default height.\n */\n const calculateHeight = () => {\n if (textareaElement.value) {\n const newHeight = Math.max(\n textareaElement.value.scrollHeight <= defaultTextareaHeight\n ? defaultTextareaHeight\n : textareaElement.value.scrollHeight + TEXTAREA_BORDER_WIDTH * 2,\n userSetHeight.value,\n defaultTextareaHeight\n );\n textareaHeight.value = `${newHeight}px`;\n }\n };\n\n watch(height, () => {\n if (isDynamicHeight.value) {\n calculateHeight();\n } else {\n textareaHeight.value = height.value;\n }\n });\n\n watch(\n () => [props.value, props.modelValue],\n () => {\n textareaValue.value = props.modelValue || props.value;\n },\n { immediate: true }\n );\n\n watch(\n () => textareaValue.value,\n async () => {\n if (isDynamicHeight.value) {\n // Hack to make the textarea calculate its height properly\n // Set the textarea back to the original value before calculating the height\n textareaHeight.value = `${defaultTextareaHeight}px`;\n if (!textareaValue.value) {\n return;\n }\n\n await nextTick();\n calculateHeight();\n }\n },\n { immediate: true }\n );\n\n const invalidInput = computed(() => !!props.errorMessage || isOverCharacterLimit.value);\n\n const conditionalClasses = computed(() => ({\n [`b-textarea--${BentoTextareaStateClass.DISABLED}`]: props.disabled,\n }));\n\n const conditionalClassesInput = computed(() => ({\n [`b-textarea__input--${BentoTextareaStateClass.CLEARABLE}`]: props.clearable,\n [`b-textarea__input--${BentoTextareaStateClass.READONLY}`]: isReadOnly.value,\n [`b-textarea__input--${BentoTextareaStateClass.ERROR}`]: invalidInput.value,\n [`b-textarea__input--dynamic-height`]: isDynamicHeight.value,\n }));\n\n const conditionalClassesLabelBox = computed(() => ({\n [`b-textarea__label-box--no-label`]: !props.label,\n }));\n\n const conditionalClassesLabelItem = computed(() => ({\n [`b-textarea__label-item--${BentoTextareaStateClass.ERROR}`]: isOverCharacterLimit.value,\n }));\n\n const counterErrorText = computed(() => t('yourTextCanBenAtMost', { characterLimit: props.characterLimit }));\n\n const ariaLabelAttribute = ref(attrs['aria-label']);\n const { ariaLabel, label } = 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: label,\n });\n\n const showClearButton = computed(\n () => props.clearable && textareaValue.value && !props.disabled && !isReadOnly.value\n );\n\n const onClear = () => {\n textareaValue.value = '';\n emit(BentoTextareaEvent.CLEAR);\n emitValue('');\n };\n\n const onInput = (event: InputEvent) => {\n event.stopImmediatePropagation();\n\n if (!props.disabled && !isReadOnly.value) {\n textareaValue.value = (event.target as HTMLInputElement).value;\n /**\n * Triggered when input value is changed\n *\n * @event input\n * @property {String} inputValue - the updated textarea value\n */\n emitValue(textareaValue.value);\n }\n };\n\n const onBlur = () => {\n textareaElement.value.scrollTop = 0;\n emit(BentoTextareaEvent.BLUR);\n };\n\n const onFocus = () => {\n textareaElement.value.focus();\n emit(BentoTextareaEvent.FOCUS);\n };\n\n const onChange = () => {\n emit(BentoTextareaEvent.CHANGE);\n };\n\n const onPressEscape = () => {\n emit(BentoTextareaEvent.ESCAPE_PRESSED);\n };\n\n const onKeyDown = (event: KeyboardEvent) => {\n event.stopPropagation();\n emit(BentoTextareaEvent.KEYDOWN, event);\n };\n\n const onKeyUp = (event: KeyboardEvent) => {\n event.stopPropagation();\n emit(BentoTextareaEvent.KEYUP, event);\n };\n\n const onMouseDown = () => {\n isUserResizing.value = true;\n };\n\n const onMouseUp = () => {\n isUserResizing.value = false;\n };\n\n /**\n * Updates the textarea width depending if the container or the user update its size.\n * @param isTextareaElement - sets to true if the element being observed is the textarea HTML element.\n */\n const resizeTextareaWrapper = (isTextareaElement = false) => {\n // Width assigned by the browser whenever the textarea is manually resized. String of the format `<value>px`.\n const textareaStyleWidth = textareaElement.value.style.width;\n\n // Make sure the tracked textareaHeight is always in sync with the height size in case we manually resize the textarea\n if (textareaElement.value.style.height) {\n if (isUserResizing.value) {\n userSetHeight.value = parseInt(textareaElement.value.style.height, 10);\n }\n textareaHeight.value = textareaElement.value.style.height;\n }\n\n // If the textarea element observer is being triggered, but there's no textareaStyleWidth, we want to ignore it, as no manual resize as happened yet\n // The component wrapper will handle the resizing logic instead\n if (isTextareaElement && !textareaStyleWidth) {\n return;\n }\n\n // Width of the whole bento-textarea component\n const textareaComponentWidth = textareaComponent?.value?.offsetWidth;\n\n // If there is no textareaStyleWidth or the textareaStyleWidth is larger than the component container, the wrapper should be 100% of the container\n if (!textareaStyleWidth || parseInt(textareaStyleWidth, 10) > textareaComponentWidth) {\n textareaWrapperWidth.value = '100%';\n } else {\n // Else the wrapper should always be as wide as the textarea element itself\n textareaWrapperWidth.value = textareaStyleWidth;\n }\n };\n\n const focus = () => {\n textareaElement.value.focus();\n };\n\n defineExpose({\n focus,\n });\n\n onMounted(() => {\n textareaElementObserver = observeSizeOfElement(textareaElement.value, () => {\n resizeTextareaWrapper(true);\n });\n\n textareaComponentObserver = observeSizeOfElement(textareaComponent.value, () => {\n resizeTextareaWrapper();\n });\n\n if (isDynamicHeight.value) {\n calculateHeight();\n }\n\n if (props.value) {\n deprecate(\n 'BentoTextarea \"value\" property',\n `The use of \"value\" prop in \"BentoTextarea\" is no longer supported.\n Use the \"v-model\" or \"model-value\" property instead.`,\n '2.0.0'\n );\n }\n });\n\n onUnmounted(() => {\n textareaElementObserver?.disconnect();\n textareaComponentObserver?.disconnect();\n });\n</script>\n\n<script lang=\"ts\">\n const TEXTAREA_BORDER_WIDTH = parseFloat(BBorderWidthAttention);\n\n export default {\n i18n: { messages },\n name: 'bento-textarea',\n model: { prop: 'modelValue' },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./textarea.scss\" />\n"],"names":["BentoTextareaStateClass","BentoTextareaStateClass2","BentoTextareaEvent","BentoTextareaEvent2","TEXTAREA_BORDER_WIDTH","BBorderWidthAttention","__default__","messages","attrs","useAttrs","props","__props","emit","__emit","height","toRefs","textareaId","generateUid","textareaElement","ref","textareaComponent","textareaValue","defaultTextareaHeight","textareaHeight","userSetHeight","textareaWrapperWidth","isUserResizing","textareaElementObserver","textareaComponentObserver","t","n","useI18n","isReadOnly","useFormLayoutFieldLoading","toRef","emitValue","useFormFieldEmits","counter","computed","isDynamicHeight","isOverCharacterLimit","calculateHeight","newHeight","watch","nextTick","invalidInput","conditionalClasses","conditionalClassesInput","conditionalClassesLabelBox","conditionalClassesLabelItem","counterErrorText","ariaLabelAttribute","ariaLabel","label","computedAriaLabel","useAriaLabel","showClearButton","onClear","onInput","event","onBlur","onFocus","onChange","onPressEscape","onKeyDown","onKeyUp","onMouseDown","onMouseUp","resizeTextareaWrapper","isTextareaElement","textareaStyleWidth","textareaComponentWidth","__expose","onMounted","observeSizeOfElement","deprecate","onUnmounted"],"mappings":";;;;;;;;;;;;;;AAYO,IAAAA,IAAA,kBAAAC,OACHA,EAAA,YAAA,aACAA,EAAA,WAAA,YACAA,EAAA,QAAA,SACAA,EAAA,WAAA,YAJQA,IAAAD,KAAA,CAAA,CAAA,GAOLE,IAAA,kBAAAC,OACHA,EAAA,OA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;;;;;;;;;;;"}
1
+ {"version":3,"file":"textarea.JGXAlpx9.js","sources":["../../../vue2/src/components/textarea/textarea.types.ts","../../../vue2/src/components/textarea/textarea.vue"],"sourcesContent":["import type { FormField } from '../../types/form-field';\n\n/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoTextareaResizeOption {\n HORIZONTAL = 'horizontal',\n VERTICAL = 'vertical',\n BOTH = 'both',\n NONE = 'none',\n}\n\nexport enum BentoTextareaStateClass {\n CLEARABLE = 'clearable',\n DISABLED = 'disabled',\n ERROR = 'error',\n READONLY = 'readonly',\n}\n\nexport enum BentoTextareaEvent {\n BLUR = 'blur',\n CHANGE = 'change',\n CLEAR = 'clear',\n ESCAPE_PRESSED = 'escape-pressed',\n FOCUS = 'focus',\n INPUT = 'input',\n UPDATE_MODEL_VALUE = 'update:model-value',\n KEYDOWN = 'keydown',\n KEYUP = 'keyup',\n}\n\nexport interface BentoTextareaProps extends FormField {\n /**\n * Text that labels the input element\n * @default undefined\n */\n ariaLabel?: string;\n\n /**\n * Text that shows number of characters in textarea\n * @default undefined\n */\n characterLimit?: number;\n\n /**\n * If set to true, shows a button to clear all the text\n * @default false\n */\n clearable?: boolean;\n\n /**\n * Sets the height of the textarea, e.g 200px OR 20vh\n * @default null\n */\n height?: string | null;\n\n /**\n * Indicates the possibility of resize the textarea.\n * Accepts the Enum or the string literal version.\n * @default BentoTextareaResizeOption.BOTH\n */\n resizable?: BentoTextareaResizeOption | `${BentoTextareaResizeOption}`;\n\n /**\n * Text displayed as the value of the textarea\n * @deprecated for usage with properties since version 2.0. Use `v-model` or `model-value` instead.\n */\n value?: string;\n\n /**\n * Text displayed as the value of the textarea\n */\n modelValue?: string;\n}\n","<template>\n <div ref=\"textareaComponent\" class=\"b-textarea\" :class=\"conditionalClasses\">\n <div :style=\"{ width: textareaWrapperWidth }\">\n <div class=\"b-textarea__label-box\" :class=\"conditionalClassesLabelBox\">\n <field-label\n v-if=\"label\"\n :for=\"textareaId\"\n :label=\"label\"\n :tooltip-text=\"tooltipText\"\n :optional=\"optional\"\n :required=\"required\"\n />\n <bento-typography\n v-if=\"characterLimit\"\n el=\"span\"\n class=\"b-textarea__label-item\"\n :class=\"conditionalClassesLabelItem\"\n >\n {{ counter }}\n </bento-typography>\n </div>\n <bento-typography el=\"div\" class=\"b-textarea__input-box\" :aria-disabled=\"disabled\">\n <textarea\n :id=\"textareaId\"\n ref=\"textareaElement\"\n :value=\"textareaValue\"\n class=\"b-textarea__input\"\n :class=\"conditionalClassesInput\"\n :aria-label=\"computedAriaLabel\"\n :aria-invalid=\"invalidInput\"\n :readonly=\"isReadOnly\"\n :required=\"required\"\n :aria-required=\"required\"\n :disabled=\"disabled\"\n :placeholder=\"placeholder\"\n :style=\"{ resize: resizable, height: textareaHeight }\"\n @blur=\"onBlur\"\n @change=\"onChange\"\n @focus=\"onFocus\"\n @input=\"onInput\"\n @keydown.esc=\"onPressEscape\"\n @keydown=\"onKeyDown\"\n @keyup=\"onKeyUp\"\n @mousedown=\"onMouseDown\"\n @mouseup=\"onMouseUp\"\n >\n </textarea>\n\n <div v-if=\"showClearButton\" class=\"b-textarea__clear-button\">\n <bento-button\n variant=\"tertiary\"\n :disabled=\"disabled\"\n @click=\"onClear\"\n @keypress.enter=\"onClear\"\n @keyup.space=\"onClear\"\n >\n <template #iconLeft>\n <cross-circle-fill-small-icon :svg-title=\"t('clearText')\" />\n </template>\n </bento-button>\n </div>\n </bento-typography>\n\n <error-message v-if=\"isOverCharacterLimit\" :error-message=\"counterErrorText\" />\n\n <error-message v-if=\"errorMessage\" :error-message=\"errorMessage\" />\n\n <bento-typography v-if=\"description\" class=\"b-textarea__description\" el=\"span\">\n {{ description }}\n </bento-typography>\n </div>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, nextTick, onMounted, onUnmounted, ref, toRef, toRefs, useAttrs, watch } from 'vue';\n\n // Components\n import { BentoButton } from '@/components/button';\n import { BentoTypography } from '@/components/typography';\n import { ErrorMessage, FieldLabel } from '@/internal';\n import CrossCircleFillSmallIcon from '@adyen/ui-assets-icons-16/vue/cross-circle-fill-small';\n\n // Utils\n import { generateUid } from '@/core/utils/ts';\n import { observeSizeOfElement } from '@/utils/ts/resize';\n import { useAriaLabel } from '@/utils/ts/aria-label';\n import { useI18n } from '@/utils/ts/i18n';\n import { deprecate } from '@/utils/ts/deprecate';\n import { useFormFieldEmits } from '@/utils/ts/form-field/form-field';\n\n // Composables\n import { useFormLayoutFieldLoading } from '@/composables/use-form-layout-loading/use-form-layout-loading';\n\n // Constants\n import { BBorderWidthAttention } from '@adyen/bento-design-tokens/dist/js/bento/es6';\n\n // Types\n import { BentoTextareaEvent, type BentoTextareaProps, BentoTextareaStateClass } from './textarea.types';\n\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const attrs = useAttrs();\n\n const props = withDefaults(defineProps<BentoTextareaProps>(), {\n ariaLabel: undefined,\n characterLimit: undefined,\n description: '',\n disabled: false,\n clearable: false,\n errorMessage: '',\n height: null,\n label: '',\n optional: false,\n placeholder: '',\n readonly: false,\n resizable: 'both',\n required: false,\n tooltipText: null,\n value: '',\n modelValue: '',\n });\n\n const emit = defineEmits<{\n /**\n * Emitted when the element has lost focus\n */\n (e: BentoTextareaEvent.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: BentoTextareaEvent.CHANGE): void;\n\n /**\n * Emitted when the \"Clear\" button was clicked\n */\n (e: BentoTextareaEvent.CLEAR): void;\n\n /**\n * Emitted when the \"ESC\" key is pressed\n */\n (e: BentoTextareaEvent.ESCAPE_PRESSED): void;\n\n /**\n * Emitted when the element has received focus\n */\n (e: BentoTextareaEvent.FOCUS): void;\n\n /**\n * Emitted when the component's model changes\n *\n * @deprecated since version 2.0. Use `v-model` or `update:model-value` instead.\n *\n */\n (e: BentoTextareaEvent.INPUT, value: string): void;\n\n /**\n * Emitted when the component's model changes\n */\n (e: BentoTextareaEvent.UPDATE_MODEL_VALUE, value: string): void;\n\n /**\n * Emitted when the text area keydown event is fired\n */\n (e: BentoTextareaEvent.KEYDOWN, event: KeyboardEvent): void;\n\n /**\n * Emitted when the text area keyup event is fired\n */\n (e: BentoTextareaEvent.KEYUP, event: KeyboardEvent): void;\n }>();\n\n const { height } = toRefs(props);\n\n const textareaId = generateUid('textarea');\n const textareaElement = ref<HTMLTextAreaElement>(null);\n const textareaComponent = ref<HTMLDivElement>(null);\n const textareaValue = ref(props.modelValue || props.value);\n const defaultTextareaHeight = 44;\n const textareaHeight = ref(props.height || `${defaultTextareaHeight}px`);\n const userSetHeight = ref<number>(0);\n const textareaWrapperWidth = ref('100%'); // The width set to the wrapper of the label, textarea and description\n const isUserResizing = ref(false);\n let textareaElementObserver: ResizeObserver | null = null;\n let textareaComponentObserver: ResizeObserver | null = null;\n\n const { t, n } = useI18n<{ message: MessageSchema }>({ messages });\n\n const { isReadOnly } = useFormLayoutFieldLoading(toRef(props, 'readonly'));\n\n const { emitValue } = useFormFieldEmits<string>(emit);\n\n const counter = computed(() => `${n(textareaValue?.value?.length ?? 0)} / ${n(props.characterLimit)}`);\n const isDynamicHeight = computed(() => !height.value);\n const isOverCharacterLimit = computed(\n () => props.characterLimit && textareaValue.value.length > props.characterLimit\n );\n\n /**\n * Calculates and sets the height of the textarea.\n * The height is determined by the maximum of the following values:\n *\n * 1. The content's scroll height (with a minimum of `defaultTextareaHeight`) + the border width.\n * 2. The height set by the user manually resizing the textarea (`userSetHeight`).\n * 3. The default minimum height (`defaultTextareaHeight`).\n *\n * This ensures the textarea grows with content, shrinks when content is removed,\n * but never goes below the manually set height or the default height.\n */\n const calculateHeight = () => {\n if (textareaElement.value) {\n const newHeight = Math.max(\n textareaElement.value.scrollHeight <= defaultTextareaHeight\n ? defaultTextareaHeight\n : textareaElement.value.scrollHeight + TEXTAREA_BORDER_WIDTH * 2,\n userSetHeight.value,\n defaultTextareaHeight\n );\n textareaHeight.value = `${newHeight}px`;\n }\n };\n\n watch(height, () => {\n if (isDynamicHeight.value) {\n calculateHeight();\n } else {\n textareaHeight.value = height.value;\n }\n });\n\n watch(\n () => [props.value, props.modelValue],\n () => {\n textareaValue.value = props.modelValue || props.value;\n },\n { immediate: true }\n );\n\n watch(\n () => textareaValue.value,\n async () => {\n if (isDynamicHeight.value) {\n // Hack to make the textarea calculate its height properly\n // Set the textarea back to the original value before calculating the height\n textareaHeight.value = `${defaultTextareaHeight}px`;\n if (!textareaValue.value) {\n return;\n }\n\n await nextTick();\n calculateHeight();\n }\n },\n { immediate: true }\n );\n\n const invalidInput = computed(() => !!props.errorMessage || isOverCharacterLimit.value);\n\n const conditionalClasses = computed(() => ({\n [`b-textarea--${BentoTextareaStateClass.DISABLED}`]: props.disabled,\n }));\n\n const conditionalClassesInput = computed(() => ({\n [`b-textarea__input--${BentoTextareaStateClass.CLEARABLE}`]: props.clearable,\n [`b-textarea__input--${BentoTextareaStateClass.READONLY}`]: isReadOnly.value,\n [`b-textarea__input--${BentoTextareaStateClass.ERROR}`]: invalidInput.value,\n [`b-textarea__input--dynamic-height`]: isDynamicHeight.value,\n }));\n\n const conditionalClassesLabelBox = computed(() => ({\n [`b-textarea__label-box--no-label`]: !props.label,\n }));\n\n const conditionalClassesLabelItem = computed(() => ({\n [`b-textarea__label-item--${BentoTextareaStateClass.ERROR}`]: isOverCharacterLimit.value,\n }));\n\n const counterErrorText = computed(() => t('yourTextCanBenAtMost', { characterLimit: props.characterLimit }));\n\n const ariaLabelAttribute = ref(attrs['aria-label']);\n const { ariaLabel, label } = 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: label,\n });\n\n const showClearButton = computed(\n () => props.clearable && textareaValue.value && !props.disabled && !isReadOnly.value\n );\n\n const onClear = () => {\n textareaValue.value = '';\n emit(BentoTextareaEvent.CLEAR);\n emitValue('');\n };\n\n const onInput = (event: InputEvent) => {\n event.stopImmediatePropagation();\n\n if (!props.disabled && !isReadOnly.value) {\n textareaValue.value = (event.target as HTMLInputElement).value;\n /**\n * Triggered when input value is changed\n *\n * @event input\n * @property {String} inputValue - the updated textarea value\n */\n emitValue(textareaValue.value);\n }\n };\n\n const onBlur = () => {\n textareaElement.value.scrollTop = 0;\n emit(BentoTextareaEvent.BLUR);\n };\n\n const onFocus = () => {\n textareaElement.value.focus();\n emit(BentoTextareaEvent.FOCUS);\n };\n\n const onChange = () => {\n emit(BentoTextareaEvent.CHANGE);\n };\n\n const onPressEscape = () => {\n emit(BentoTextareaEvent.ESCAPE_PRESSED);\n };\n\n const onKeyDown = (event: KeyboardEvent) => {\n event.stopPropagation();\n emit(BentoTextareaEvent.KEYDOWN, event);\n };\n\n const onKeyUp = (event: KeyboardEvent) => {\n event.stopPropagation();\n emit(BentoTextareaEvent.KEYUP, event);\n };\n\n const onMouseDown = () => {\n isUserResizing.value = true;\n };\n\n const onMouseUp = () => {\n isUserResizing.value = false;\n };\n\n /**\n * Updates the textarea width depending if the container or the user update its size.\n * @param isTextareaElement - sets to true if the element being observed is the textarea HTML element.\n */\n const resizeTextareaWrapper = (isTextareaElement = false) => {\n // Width assigned by the browser whenever the textarea is manually resized. String of the format `<value>px`.\n const textareaStyleWidth = textareaElement.value.style.width;\n\n // Make sure the tracked textareaHeight is always in sync with the height size in case we manually resize the textarea\n if (textareaElement.value.style.height) {\n if (isUserResizing.value) {\n userSetHeight.value = parseInt(textareaElement.value.style.height, 10);\n }\n textareaHeight.value = textareaElement.value.style.height;\n }\n\n // If the textarea element observer is being triggered, but there's no textareaStyleWidth, we want to ignore it, as no manual resize as happened yet\n // The component wrapper will handle the resizing logic instead\n if (isTextareaElement && !textareaStyleWidth) {\n return;\n }\n\n // Width of the whole bento-textarea component\n const textareaComponentWidth = textareaComponent?.value?.offsetWidth;\n\n // If there is no textareaStyleWidth or the textareaStyleWidth is larger than the component container, the wrapper should be 100% of the container\n if (!textareaStyleWidth || parseInt(textareaStyleWidth, 10) > textareaComponentWidth) {\n textareaWrapperWidth.value = '100%';\n } else {\n // Else the wrapper should always be as wide as the textarea element itself\n textareaWrapperWidth.value = textareaStyleWidth;\n }\n };\n\n const focus = () => {\n textareaElement.value.focus();\n };\n\n defineExpose({\n focus,\n });\n\n onMounted(() => {\n textareaElementObserver = observeSizeOfElement(textareaElement.value, () => {\n resizeTextareaWrapper(true);\n });\n\n textareaComponentObserver = observeSizeOfElement(textareaComponent.value, () => {\n resizeTextareaWrapper();\n });\n\n if (isDynamicHeight.value) {\n calculateHeight();\n }\n\n if (props.value) {\n deprecate(\n 'BentoTextarea \"value\" property',\n `The use of \"value\" prop in \"BentoTextarea\" is no longer supported.\n Use the \"v-model\" or \"model-value\" property instead.`,\n '2.0.0'\n );\n }\n });\n\n onUnmounted(() => {\n textareaElementObserver?.disconnect();\n textareaComponentObserver?.disconnect();\n });\n</script>\n\n<script lang=\"ts\">\n const TEXTAREA_BORDER_WIDTH = parseFloat(BBorderWidthAttention);\n\n export default {\n i18n: { messages },\n name: 'bento-textarea',\n model: { prop: 'modelValue' },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./textarea.scss\" />\n"],"names":["BentoTextareaStateClass","BentoTextareaStateClass2","BentoTextareaEvent","BentoTextareaEvent2","TEXTAREA_BORDER_WIDTH","BBorderWidthAttention","__default__","messages","attrs","useAttrs","props","__props","emit","__emit","height","toRefs","textareaId","generateUid","textareaElement","ref","textareaComponent","textareaValue","defaultTextareaHeight","textareaHeight","userSetHeight","textareaWrapperWidth","isUserResizing","textareaElementObserver","textareaComponentObserver","t","n","useI18n","isReadOnly","useFormLayoutFieldLoading","toRef","emitValue","useFormFieldEmits","counter","computed","isDynamicHeight","isOverCharacterLimit","calculateHeight","newHeight","watch","nextTick","invalidInput","conditionalClasses","conditionalClassesInput","conditionalClassesLabelBox","conditionalClassesLabelItem","counterErrorText","ariaLabelAttribute","ariaLabel","label","computedAriaLabel","useAriaLabel","showClearButton","onClear","onInput","event","onBlur","onFocus","onChange","onPressEscape","onKeyDown","onKeyUp","onMouseDown","onMouseUp","resizeTextareaWrapper","isTextareaElement","textareaStyleWidth","textareaComponentWidth","__expose","onMounted","observeSizeOfElement","deprecate","onUnmounted"],"mappings":";;;;;;;;;;;;;;;AAYO,IAAAA,IAAA,kBAAAC,OACHA,EAAA,YAAA,aACAA,EAAA,WAAA,YACAA,EAAA,QAAA,SACAA,EAAA,WAAA,YAJQA,IAAAD,KAAA,CAAA,CAAA,GAOLE,IAAA,kBAAAC,OACHA,EAAA,OAAA,QACAA,EAAA,SAAA,UACAA,EAAA,QAAA,SACAA,EAAA,iBAAA,kBACAA,EAAA,QAAA,SACAA,EAAA,QAAA,SACAA,EAAA,qBAAA,sBACAA,EAAA,UAAA,WACAA,EAAA,QAAA,SATQA,IAAAD,KAAA,CAAA,CAAA;;;;;;;;;;;;;;;GCqZRE,KAAA,WAAAC,EAAA,GAEAC,KAAA;AAAA,EAAe,MAAA,EAAA,UAAAC,EAAA;AAAA,EACM,MAAA;AAAA,EACX,OAAA,EAAA,MAAA,aAAA;AAEV;;;;;;;;;;;;;;;;;;;;;AAtUA,UAAAC,IAAAC,GAAA,GAEAC,IAAAC,GAmBAC,IAAAC,GAkDA,EAAA,QAAAC,EAAA,IAAAC,EAAAL,CAAA,GAEAM,IAAAC,GAAA,UAAA,GACAC,IAAAC,EAAA,IAAA,GACAC,IAAAD,EAAA,IAAA,GACAE,IAAAF,EAAAT,EAAA,cAAAA,EAAA,KAAA,GACAY,IAAA,IACAC,IAAAJ,EAAAT,EAAA,UAAA,GAAAY,CAAA,IAAA,GACAE,IAAAL,EAAA,CAAA,GACAM,IAAAN,EAAA,MAAA,GACAO,IAAAP,EAAA,EAAA;AACA,QAAAQ,IAAA,MACAC,IAAA;AAEA,UAAA,EAAA,GAAAC,GAAA,GAAAC,EAAA,IAAAC,GAAA,EAAA,UAAAxB,EAAA,CAAA,GAEA,EAAA,YAAAyB,EAAA,IAA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A,MAAA;AACI,QAAAgD,EAAA;AAAA,MAAsB,CAAA,GAG1B7B,EAAA,SACIE,EAAA,GAGJ/B,EAAA,SACIiE;AAAA,QAAA;AAAA,QACI;AAAA;AAAA,QACA;AAAA,MAEA;AAAA,IAER,CAAA,GAGJC,GAAA,MAAA;AACI,MAAAjD,GAAA,WAAA,GACAC,GAAA,WAAA;AAAA,IAAsC,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,10 +1,10 @@
1
1
  import { defineComponent as V, computed as n, ref as $, toRefs as he, watch as _e, provide as q, openBlock as a, createElementBlock as c, createBlock as E, unref as s, withCtx as h, createTextVNode as N, toDisplayString as _, createCommentVNode as p, createVNode as I, createElementVNode as M, renderSlot as x, nextTick as ge, mergeProps as U, useSlots as be, inject as X, onUnmounted as we, normalizeClass as Z, normalizeProps as Q, Fragment as P, renderList as ye } from "vue";
2
2
  import { B as me } from "./button.DWF7FSIw.js";
3
- import { B as Me } from "./textarea.C-sBemuo.js";
3
+ import { B as Me } from "./textarea.JGXAlpx9.js";
4
4
  import { u as de } from "./index.B875RXHM.js";
5
- import { B as Ee } from "./button-actions.Bh_PZ_fV.js";
5
+ import { B as Ee } from "./button-actions.DLiM8KZL.js";
6
6
  import { _ as W } from "./_plugin-vue_export-helper.CHgC5LLL.js";
7
- import { B as ee } from "./dashed-underline.CwdpUz76.js";
7
+ import { B as ee } from "./dashed-underline.B50DIXjK.js";
8
8
  import { B as te } from "./date.R2Wz6o7J.js";
9
9
  import { B as Ne } from "./link.D6D6YGsN.js";
10
10
  import { B as Ie } from "./tag.YN2r-Pp3.js";
@@ -430,4 +430,4 @@ export {
430
430
  Fe as d,
431
431
  Tt as t
432
432
  };
433
- //# sourceMappingURL=timeline-item.CHk8wXeT.js.map
433
+ //# sourceMappingURL=timeline-item.BNFPpQz1.js.map