@adyen/bento-vue3 1.76.2 → 1.77.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 (145) hide show
  1. package/dist/@types/index.d.ts +216 -33
  2. package/dist/assets/accordion-item.css +1 -1
  3. package/dist/assets/action-bar.css +1 -1
  4. package/dist/assets/base-modal.css +1 -1
  5. package/dist/assets/button-actions.css +1 -1
  6. package/dist/assets/card.css +1 -1
  7. package/dist/assets/data-grid.css +1 -1
  8. package/dist/assets/date-picker.css +1 -1
  9. package/dist/assets/date-range-picker.css +1 -1
  10. package/dist/assets/dialog-page.css +1 -1
  11. package/dist/assets/dropdown-default-textbox.css +1 -1
  12. package/dist/assets/dropdown-tag.css +1 -1
  13. package/dist/assets/dropdown.css +1 -1
  14. package/dist/assets/file-uploader.css +1 -1
  15. package/dist/assets/filter-bar.css +1 -1
  16. package/dist/assets/input-field-phone-number.css +1 -1
  17. package/dist/assets/input-field.css +1 -1
  18. package/dist/assets/inspector.css +1 -1
  19. package/dist/assets/modal-fullscreen.css +1 -1
  20. package/dist/assets/pagination.css +1 -1
  21. package/dist/assets/payment-method.css +1 -1
  22. package/dist/assets/secondary-nav.css +1 -1
  23. package/dist/assets/sidepanel.css +1 -1
  24. package/dist/assets/tag.css +1 -1
  25. package/dist/assets/textarea.css +1 -1
  26. package/dist/assets/timeline-item.css +1 -1
  27. package/dist/checkbox.js +2 -2
  28. package/dist/chunks/{checkbox-group.8ebmaHsA.js → checkbox-group.COUx8Ne8.js} +2 -2
  29. package/dist/chunks/{checkbox-group.8ebmaHsA.js.map → checkbox-group.COUx8Ne8.js.map} +1 -1
  30. package/dist/chunks/{checkbox.BI0dqARY.js → checkbox.SffuKyNj.js} +3 -3
  31. package/dist/chunks/{checkbox.BI0dqARY.js.map → checkbox.SffuKyNj.js.map} +1 -1
  32. package/dist/chunks/{code-snippet.Bjf1ma1L.js → code-snippet.ByoBEM00.js} +2 -2
  33. package/dist/chunks/{code-snippet.Bjf1ma1L.js.map → code-snippet.ByoBEM00.js.map} +1 -1
  34. package/dist/chunks/{currency.CBZMwm21.js → currency.WmvQjX7l.js} +2 -2
  35. package/dist/chunks/{currency.CBZMwm21.js.map → currency.WmvQjX7l.js.map} +1 -1
  36. package/dist/chunks/{data-grid.VBEJO94f.js → data-grid.CMIG82Xt.js} +7 -7
  37. package/dist/chunks/{data-grid.VBEJO94f.js.map → data-grid.CMIG82Xt.js.map} +1 -1
  38. package/dist/chunks/date-picker.CsGq3iSK.js +244 -0
  39. package/dist/chunks/date-picker.CsGq3iSK.js.map +1 -0
  40. package/dist/chunks/date-picker.types.Ckt7zxGy.js +5 -0
  41. package/dist/chunks/date-picker.types.Ckt7zxGy.js.map +1 -0
  42. package/dist/chunks/date-range-picker.C19CWG27.js +1149 -0
  43. package/dist/chunks/date-range-picker.C19CWG27.js.map +1 -0
  44. package/dist/chunks/{dropdown-default-textbox.MkU0tMf1.js → dropdown-default-textbox._KEBXjKT.js} +88 -86
  45. package/dist/chunks/dropdown-default-textbox._KEBXjKT.js.map +1 -0
  46. package/dist/chunks/dropdown-tag.B90dpg8J.js +301 -0
  47. package/dist/chunks/dropdown-tag.B90dpg8J.js.map +1 -0
  48. package/dist/chunks/dropdown.DYDHM__3.js +833 -0
  49. package/dist/chunks/{dropdown.KStrJVoP.js.map → dropdown.DYDHM__3.js.map} +1 -1
  50. package/dist/chunks/es6.MoTTyETW.js.map +1 -1
  51. package/dist/chunks/{file-uploader.By0MTfKk.js → file-uploader.BDXQ7Ccv.js} +416 -415
  52. package/dist/chunks/{file-uploader.By0MTfKk.js.map → file-uploader.BDXQ7Ccv.js.map} +1 -1
  53. package/dist/chunks/{filter-bar.JXmlFnHV.js → filter-bar.CmF92iAr.js} +303 -303
  54. package/dist/chunks/filter-bar.CmF92iAr.js.map +1 -0
  55. package/dist/chunks/form-field.BBqLu-vs.js +10 -0
  56. package/dist/chunks/form-field.BBqLu-vs.js.map +1 -0
  57. package/dist/chunks/get-slot-text.CQRAP2_q.js +12 -0
  58. package/dist/chunks/get-slot-text.CQRAP2_q.js.map +1 -0
  59. package/dist/chunks/{header-with-views.Dg2usaMY.js → header-with-views.xPfeOz0Y.js} +3 -3
  60. package/dist/chunks/{header-with-views.Dg2usaMY.js.map → header-with-views.xPfeOz0Y.js.map} +1 -1
  61. package/dist/chunks/{input-field-password.B6nJ7ygZ.js → input-field-password.BZBYVyAb.js} +3 -3
  62. package/dist/chunks/{input-field-password.B6nJ7ygZ.js.map → input-field-password.BZBYVyAb.js.map} +1 -1
  63. package/dist/chunks/{input-field-phone-number.D_UBAN2s.js → input-field-phone-number.a8Mw5PAW.js} +5 -5
  64. package/dist/chunks/{input-field-phone-number.D_UBAN2s.js.map → input-field-phone-number.a8Mw5PAW.js.map} +1 -1
  65. package/dist/chunks/{input-field.C29FCI4j.js → input-field.CYGGIK48.js} +48 -48
  66. package/dist/chunks/input-field.CYGGIK48.js.map +1 -0
  67. package/dist/chunks/{listbox-option-tag.uHSB7MO6.js → listbox-option-tag.Cwe9Bn-R.js} +2 -2
  68. package/dist/chunks/{listbox-option-tag.uHSB7MO6.js.map → listbox-option-tag.Cwe9Bn-R.js.map} +1 -1
  69. package/dist/chunks/{pagination.BaBWNlIF.js → pagination.CYdGcyMA.js} +49 -49
  70. package/dist/chunks/pagination.CYdGcyMA.js.map +1 -0
  71. package/dist/chunks/{payment-method.CDnn1bjo.js → payment-method.D6PeTYWq.js} +45 -42
  72. package/dist/chunks/payment-method.D6PeTYWq.js.map +1 -0
  73. package/dist/chunks/payment-method.types.BqtH7RM2.js.map +1 -1
  74. package/dist/chunks/{radio-group.DWNqrkZ3.js → radio-group.B_8R6vGx.js} +3 -3
  75. package/dist/chunks/{radio-group.DWNqrkZ3.js.map → radio-group.B_8R6vGx.js.map} +1 -1
  76. package/dist/chunks/{rich-text-editor.Bh7KS617.js → rich-text-editor.B6Ftqv55.js} +2 -2
  77. package/dist/chunks/{rich-text-editor.Bh7KS617.js.map → rich-text-editor.B6Ftqv55.js.map} +1 -1
  78. package/dist/chunks/{search-bar.RS02IcLc.js → search-bar.D3Ri_RUK.js} +3 -3
  79. package/dist/chunks/{search-bar.RS02IcLc.js.map → search-bar.D3Ri_RUK.js.map} +1 -1
  80. package/dist/chunks/{secondary-nav.DXsgUTqk.js → secondary-nav.CAb20jWW.js} +24 -24
  81. package/dist/chunks/secondary-nav.CAb20jWW.js.map +1 -0
  82. package/dist/chunks/{summary-grid.types.ByQ4u19J.js → summary-grid.types.cE1fyLvC.js} +2 -2
  83. package/dist/chunks/{summary-grid.types.ByQ4u19J.js.map → summary-grid.types.cE1fyLvC.js.map} +1 -1
  84. package/dist/chunks/tag.CjaB9DxL.js +57 -0
  85. package/dist/chunks/tag.CjaB9DxL.js.map +1 -0
  86. package/dist/chunks/textarea.C_gnXj6b.js +254 -0
  87. package/dist/chunks/textarea.C_gnXj6b.js.map +1 -0
  88. package/dist/chunks/{timeline-item.DNjubXL2.js → timeline-item.rSY0Xce3.js} +48 -48
  89. package/dist/chunks/timeline-item.rSY0Xce3.js.map +1 -0
  90. package/dist/chunks/{toggle.Dd_NA8eH.js → toggle.BHCUjMpp.js} +2 -2
  91. package/dist/chunks/{toggle.Dd_NA8eH.js.map → toggle.BHCUjMpp.js.map} +1 -1
  92. package/dist/code-snippet.js +1 -1
  93. package/dist/currency.js +1 -1
  94. package/dist/data-grid.js +1 -1
  95. package/dist/date-picker.js +7 -6
  96. package/dist/date-picker.js.map +1 -1
  97. package/dist/date-range-picker.js +1 -1
  98. package/dist/dropdown.js +3 -3
  99. package/dist/file-uploader.js +1 -1
  100. package/dist/filter-bar.js +1 -1
  101. package/dist/header-with-views.js +1 -1
  102. package/dist/index.js +246 -245
  103. package/dist/index.js.map +1 -1
  104. package/dist/input-field-password.js +1 -1
  105. package/dist/input-field-phone-number.js +1 -1
  106. package/dist/input-field.js +1 -1
  107. package/dist/internal.js +1 -1
  108. package/dist/pagination.js +1 -1
  109. package/dist/payment-method.js +1 -1
  110. package/dist/radio-group.js +1 -1
  111. package/dist/rich-text-editor.js +1 -1
  112. package/dist/search-bar.js +2 -2
  113. package/dist/secondary-nav.js +1 -1
  114. package/dist/styles/bento-dark.css +4 -0
  115. package/dist/styles/bento-light.css +4 -0
  116. package/dist/styles/bento.css +4 -0
  117. package/dist/styles/legacy.css +4 -0
  118. package/dist/styles/styleguide.css +4 -0
  119. package/dist/summary-grid.js +1 -1
  120. package/dist/tag.js +1 -1
  121. package/dist/textarea.js +1 -1
  122. package/dist/timeline.js +1 -1
  123. package/dist/toggle.js +1 -1
  124. package/dist/web-types.json +1 -1
  125. package/package.json +5 -5
  126. package/dist/chunks/date-picker.OI-sQ232.js +0 -234
  127. package/dist/chunks/date-picker.OI-sQ232.js.map +0 -1
  128. package/dist/chunks/date-range-picker.D7IwIR5V.js +0 -1114
  129. package/dist/chunks/date-range-picker.D7IwIR5V.js.map +0 -1
  130. package/dist/chunks/dropdown-default-textbox.MkU0tMf1.js.map +0 -1
  131. package/dist/chunks/dropdown-tag.DFeoXIgH.js +0 -242
  132. package/dist/chunks/dropdown-tag.DFeoXIgH.js.map +0 -1
  133. package/dist/chunks/dropdown.KStrJVoP.js +0 -825
  134. package/dist/chunks/filter-bar.JXmlFnHV.js.map +0 -1
  135. package/dist/chunks/get-slot-text.DQlZEsId.js +0 -12
  136. package/dist/chunks/get-slot-text.DQlZEsId.js.map +0 -1
  137. package/dist/chunks/input-field.C29FCI4j.js.map +0 -1
  138. package/dist/chunks/pagination.BaBWNlIF.js.map +0 -1
  139. package/dist/chunks/payment-method.CDnn1bjo.js.map +0 -1
  140. package/dist/chunks/secondary-nav.DXsgUTqk.js.map +0 -1
  141. package/dist/chunks/tag.CEmpyuYX.js +0 -50
  142. package/dist/chunks/tag.CEmpyuYX.js.map +0 -1
  143. package/dist/chunks/textarea.C1jkfowf.js +0 -246
  144. package/dist/chunks/textarea.C1jkfowf.js.map +0 -1
  145. package/dist/chunks/timeline-item.DNjubXL2.js.map +0 -1
@@ -1,12 +0,0 @@
1
- import "vue";
2
- const n = (r, i) => {
3
- var t;
4
- return i > 5 ? "" : Array.isArray(r) ? n((t = r == null ? void 0 : r[0]) == null ? void 0 : t.children, i + 1) : r == null ? void 0 : r.toString();
5
- }, a = (r) => (i) => {
6
- var t;
7
- return n((t = r[i]) == null ? void 0 : t.call(r), 1);
8
- };
9
- export {
10
- a as g
11
- };
12
- //# sourceMappingURL=get-slot-text.DQlZEsId.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-slot-text.DQlZEsId.js","sources":["../../../vue2/src/utils/ts/get-slot-text/get-slot-text.ts"],"sourcesContent":["import { isVue2 } from 'vue-demi';\nimport type { Slots } from 'vue/types/v3-setup-context';\n\n// TODO: remove these types when vue 2 support has been removed\ntype vue2VNode = { text?: string; children?: vue2VNode };\n\nconst getTextFromChildren = (vNode: Array<vue2VNode> | vue2VNode, nestedLevel: number): string => {\n // We should not be checking for slot text more than 5 layers. If we are end the recursion.\n if (nestedLevel > 5) {\n return '';\n }\n if (Array.isArray(vNode)) {\n if (isVue2 && (vNode as Array<vue2VNode>)?.[0].text) {\n return vNode?.[0].text;\n }\n return getTextFromChildren(vNode?.[0]?.children, nestedLevel + 1);\n }\n return isVue2 ? (vNode as vue2VNode)?.text : vNode?.toString();\n};\n\n/**\n * Get text recursively from slot by giving slot name.\n * This recursion will only occur 5 times before the method gives up and returns an empty string.\n * @param slots - the slots provided the the component's setup function\n * @returns A function who's first parameter is the name of the slot.\n */\nexport const getSlotText = (slots: Slots) => (name: string) =>\n getTextFromChildren(slots[name]?.() as Array<vue2VNode> | vue2VNode, 1);\n\nexport default getSlotText;\n"],"names":["getTextFromChildren","vNode","nestedLevel","_a","getSlotText","slots","name"],"mappings":";AAMA,MAAMA,IAAsB,CAACC,GAAqCC,MAAgC;;AAE9F,SAAIA,IAAc,IACP,KAEP,MAAM,QAAQD,CAAK,IAIZD,GAAoBG,IAAAF,KAAA,gBAAAA,EAAQ,OAAR,gBAAAE,EAAY,UAAUD,IAAc,CAAC,IAEvBD,KAAA,gBAAAA,EAAO;AACxD,GAQaG,IAAc,CAACC,MAAiB,CAACC,MAAA;;AAC1C,SAAAN,GAAoBG,IAAAE,EAAMC,OAAN,gBAAAH,EAAA,KAAAE,IAAiD,CAAC;AAAA;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"input-field.C29FCI4j.js","sources":["../../../vue2/src/components/input-field/input-field.types.ts","../../../vue2/src/components/input-field/input-field.vue"],"sourcesContent":["import { type BentoDropdownProps } from '../dropdown/dropdown.types';\nimport { 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 BentoInputFieldVariant {\n DEFAULT = 'default',\n PAYMENT_METHOD = 'payment-method',\n STATIC_VALUE = 'static-value',\n DROPDOWN = 'dropdown',\n}\n\n/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoInputFieldElementPosition {\n START = 'start',\n END = 'end',\n}\n\nexport enum BentoInputFieldStateClass {\n CONDENSED = 'condensed',\n DISABLED = 'disabled',\n READONLY = 'readonly',\n ERROR = 'error',\n}\n\n/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoInputFieldType {\n SEARCH = 'search',\n TEXT = 'text',\n NUMBER = 'number',\n}\n\nexport type BentoInputFieldValue = string | number;\n\ntype DropdownProps = BentoDropdownProps;\nexport type BentoInputDropdownProps = {\n /**\n * Text that labels the dropdown element\n */\n 'aria-label'?: string;\n /**\n * Enables dynamic filtering\n */\n dynamicFiltering?: DropdownProps['dynamicFiltering'];\n /**\n * List of available items\n */\n items: DropdownProps['items'];\n /**\n * Sets the dropdown in read-only mode\n */\n readonly?: DropdownProps['readonly'];\n /**\n * Selected value of the dropdown\n */\n value?: DropdownProps['value'];\n};\n\n/**\n * @deprecated The use of these enums is no longer supported.\n * Use `v-on:` or `@` to listen to the events being emitted.\n * This enum will be removed in 2.0.\n */\nexport enum BentoInputFieldEvent {\n INPUT = 'input',\n ESCAPE_PRESSED = 'escape-pressed',\n UPDATE_DROPDOWN = 'update:dropdown',\n DROPDOWN_INPUT = 'dropdown-input',\n FOCUS = 'focus',\n CHANGE = 'change',\n BLUR = 'blur',\n KEYDOWN = 'keydown',\n}\n\nexport interface BentoInputFieldProps extends FormField {\n /**\n * Indicates whether the element is exposed to an accessibility API.\n */\n ariaHidden?: boolean;\n\n /**\n * Text that labels an the input element\n *\n * @deprecated from version 2.0.0. Use the aria-label attribute instead.\n */\n ariaLabel?: string;\n\n /**\n * Reduces height of the input\n */\n condensed?: boolean;\n\n /**\n * Dropdown props for the small selectable dropdown menu.\n * Properties supported:\n *\n * - `aria-label`: Text that labels the dropdown element\n * - `dynamicFiltering`: Enables dynamic filtering\n * - `items`: List of available items\n * - `readonly`: Sets the dropdown in read-only mode\n * - `value`: Selected value of the dropdown\n */\n dropdown?: BentoInputDropdownProps;\n\n /**\n * Position of the dropdown before or after input value\n */\n dropdownPosition?: BentoInputFieldElementPosition | `${BentoInputFieldElementPosition}`;\n\n /**\n * Adds error validation class for outlining input-field.\n *\n * @deprecated Use \"errorMessage\" prop instead\n */\n error?: boolean;\n\n /**\n * Renders a font numeric style with slashed zeros instead of normal ones.\n */\n slashedZero?: boolean;\n\n /**\n * Static text that displayed before or after input value\n * Applicable to the Static Value variant\n */\n staticValue?: string;\n\n /**\n * Position of Static Value before or after input value\n */\n staticValuePosition?: BentoInputFieldElementPosition | `${BentoInputFieldElementPosition}`;\n\n /**\n * A string specifying the type of control to render.\n * All `input` types are available but only `search`, `text` and `number` are fully supported.\n *\n * If `type` is `search`, use `bento-search-bar` instead.\n */\n type?: BentoInputFieldType | `${BentoInputFieldType}` | HTMLInputElement['type'];\n\n /**\n * Text displayed as the value of the input-field\n */\n value?: BentoInputFieldValue;\n\n /**\n * Describes the different variants for the input element\n */\n variant?: BentoInputFieldVariant | `${BentoInputFieldVariant}`;\n}\n","<template>\n <bento-typography\n class=\"b-input-field\"\n data-testid=\"input-text-container\"\n :class=\"inputFieldConditionalClasses\"\n el=\"div\"\n variant=\"body\"\n >\n <field-label\n v-if=\"hasSlot('default') || label\"\n :for=\"inputFieldId\"\n data-testid=\"input-field-label\"\n :tooltip-text=\"tooltipText\"\n :optional=\"optional\"\n :required=\"required\"\n :label=\"label\"\n @click=\"focusInput\"\n >\n <slot></slot>\n </field-label>\n\n <div class=\"b-input-field__input-box\" data-testid=\"input-box\" :aria-disabled=\"disabled\" @click=\"focusInput\">\n <!-- Optional Icon for Default text variant -->\n <span\n v-if=\"isDefaultVariant && (hasSlot('defaultIconBefore') || hasSlot('iconBefore'))\"\n :aria-hidden=\"ariaHidden ? 'true' : undefined\"\n class=\"b-input-field__icon-before\"\n >\n <slot v-if=\"hasSlot('iconBefore')\" name=\"iconBefore\" />\n <slot v-if=\"hasSlot('defaultIconBefore') && !hasSlot('iconBefore')\" name=\"defaultIconBefore\" />\n </span>\n\n <!-- Mandatory Icon for Payment Method variant -->\n <span\n v-if=\"isPaymentMethodVariant && hasSlot('paymentMethod')\"\n :aria-hidden=\"ariaHidden ? 'true' : undefined\"\n class=\"b-input-field__payment-method\"\n >\n <slot name=\"paymentMethod\" />\n </span>\n\n <!-- Dropdown at start -->\n <div\n v-if=\"shouldDisplayDropdownAtStart\"\n :id=\"dropdownId\"\n class=\"b-input-field__dropdown b-input-field__dropdown--start\"\n @click.stop\n >\n <bento-dropdown\n v-if=\"dropdown\"\n ref=\"inputDropdownElement\"\n v-bind=\"inputFieldDropdownProps\"\n :disabled=\"disabled\"\n :readonly=\"isDropdownReadOnly\"\n @input=\"onDropdownInput\"\n />\n </div>\n\n <!-- Static Value at start -->\n <bento-typography\n v-if=\"shouldDisplayStaticValueAtStart\"\n :id=\"staticValueId\"\n class=\"b-input-field__static-value b-input-field__static-value--start\"\n el=\"span\"\n variant=\"body\"\n >\n <slot name=\"staticValue\" />\n </bento-typography>\n <div class=\"b-input-field__input-container\">\n <input\n :id=\"inputFieldId\"\n v-bind=\"attrs\"\n ref=\"inputFieldElement\"\n class=\"b-input-field__input\"\n :aria-label=\"computedAriaLabel\"\n :aria-describedby=\"computedAriaDescribedBy\"\n :aria-owns=\"computedAriaOwns\"\n :aria-invalid=\"shouldShowError\"\n :placeholder=\"placeholder\"\n :required=\"required\"\n :type=\"type\"\n :value=\"value\"\n :disabled=\"disabled\"\n :readonly=\"isReadOnly\"\n @input=\"onInput\"\n @change=\"emit('change')\"\n @focus=\"onFocus\"\n @blur=\"onBlur\"\n @keydown=\"emit('keydown', $event)\"\n @keyup=\"emit('keyup', $event)\"\n @keydown.esc=\"emit('escape-pressed')\"\n />\n\n <!-- Hint at the end -->\n <bento-typography v-if=\"hint && isFocused && value\" el=\"span\" class=\"b-input-field__hint\">\n {{ hint }}\n </bento-typography>\n </div>\n\n <span\n v-if=\"hasSlot('iconAfter')\"\n :aria-hidden=\"ariaHidden ? 'true' : undefined\"\n class=\"b-input-field__icon-after\"\n data-testid=\"input-text__icon-after\"\n >\n <slot name=\"iconAfter\" />\n </span>\n\n <!-- Static Value at the end -->\n <bento-typography\n v-if=\"shouldDisplayStaticValueAtEnd\"\n :id=\"staticValueId\"\n class=\"b-input-field__static-value b-input-field__static-value--end\"\n el=\"span\"\n variant=\"body\"\n >\n <slot name=\"staticValue\" />\n </bento-typography>\n\n <!-- Dropdown at end -->\n <div\n v-if=\"shouldDisplayDropdownAtEnd\"\n :id=\"dropdownId\"\n data-testid=\"input-field-dropdown-container-end\"\n class=\"b-input-field__dropdown b-input-field__dropdown--end\"\n @click.stop\n >\n <bento-dropdown\n v-if=\"dropdown\"\n :id=\"dropdownId\"\n ref=\"inputDropdownElement\"\n v-bind=\"inputFieldDropdownProps\"\n :disabled=\"disabled\"\n :readonly=\"isDropdownReadOnly\"\n @input=\"onDropdownInput\"\n />\n </div>\n </div>\n\n <error-message\n v-if=\"shouldShowError && !!errorMessage\"\n :id=\"errorId\"\n :error-message=\"errorMessage\"\n class=\"b-input-field__error-message\"\n />\n\n <span\n v-if=\"hasSlot('description') || description\"\n :id=\"descriptionId\"\n class=\"b-input-field__description\"\n @click=\"focusInput\"\n >\n <bento-typography el=\"span\" variant=\"body\">\n <slot id=\"description\" name=\"description\">\n {{ description }}\n </slot>\n </bento-typography>\n </span>\n </bento-typography>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, inject, provide, type Ref, ref, toRef, toRefs, useAttrs, useSlots } from 'vue';\n\n // Components\n import { BentoDropdown } from '@/components/dropdown';\n import { BentoTypography } from '@/components/typography';\n import { ErrorMessage, FieldLabel } from '@/internal';\n\n // Utils\n import { deprecate } from '@/utils/ts/deprecate';\n import { generateUid } from '@/core/utils/ts';\n import { getSlotText } from '@/utils/ts/get-slot-text';\n import { useAriaLabel } from '@/utils/ts/aria-label';\n import { useI18n } from '@/utils/ts/i18n';\n import { printDevelopmentWarning } from '@/utils/ts/print-development-warning';\n import {\n INPUT_FIELD_COMPONENT_INJECTION_KEY,\n INPUT_FIELD_HINT_INJECTION_KEY,\n INPUT_FIELD_PARENT_COMPONENT_INJECTION_KEY,\n } from '@/components/input-field/input-field.keys';\n\n // Composables\n import { useFormLayoutFieldLoading, useHasSlot } from '@/composables';\n\n // Types\n import {\n type BentoInputDropdownProps,\n BentoInputFieldElementPosition,\n type BentoInputFieldProps,\n BentoInputFieldStateClass,\n BentoInputFieldType,\n BentoInputFieldVariant,\n } from './input-field.types';\n import { type BentoListboxSelectedValue } from '@/types/listbox';\n\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const attrs = useAttrs();\n const slots = useSlots();\n\n const props = withDefaults(defineProps<BentoInputFieldProps>(), {\n ariaHidden: true,\n ariaLabel: undefined,\n condensed: false,\n description: '',\n disabled: false,\n dropdown: undefined,\n dropdownPosition: BentoInputFieldElementPosition.START,\n error: false,\n errorMessage: null,\n label: '',\n optional: false,\n placeholder: '',\n required: false,\n readonly: false,\n slashedZero: false,\n staticValue: '',\n staticValuePosition: BentoInputFieldElementPosition.START,\n tooltipText: null,\n type: BentoInputFieldType.TEXT,\n value: undefined,\n variant: BentoInputFieldVariant.DEFAULT,\n });\n\n const emit = defineEmits<{\n /**\n * Emitted when the Input Field's internal dropdown changes it's value. Contains every dropdown prop passed with the updated selected value as 'value'\n */\n (e: 'update:dropdown', updatedDropdownProps: BentoInputDropdownProps): void;\n\n /**\n * Emitted when the element has lost focus\n */\n (e: 'blur'): void;\n\n /**\n * Emitted when the user modifies the element's value. Unlike the 'input' event, the change event is not necessarily fired for each alteration to an element's value\n */\n (e: 'change'): void;\n\n /**\n * Emitted when the Input Field's internal dropdown changes it's value\n */\n (e: 'dropdown-input', selectedValue: BentoListboxSelectedValue): void;\n\n /**\n * Emitted when the \"ESC\" key is pressed\n */\n (e: 'escape-pressed'): void;\n\n /**\n * Emitted when the element has received focus\n */\n (e: 'focus'): void;\n\n /**\n * Emitted when a key is pressed down\n */\n (e: 'keydown', event: KeyboardEvent): void;\n\n /**\n * Emitted when a key is pressed and lifted up\n */\n (e: 'keyup', event: KeyboardEvent): void;\n\n /**\n * Emitted when the component's model changes\n */\n (e: 'input', inputValue: string): void;\n }>();\n\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n const hasSlot = useHasSlot(slots);\n const inputFieldElement = ref(null);\n const inputDropdownElement = ref(null);\n const inputFieldId = generateUid('input');\n const dropdownId = generateUid('input-dropdown');\n const staticValueId = generateUid('input-static-value');\n const descriptionId = generateUid('input-description');\n const errorId = generateUid('input-error');\n const isFocused = ref(false);\n\n // Provide INPUT_FIELD_COMPONENT_INJECTION_KEY as true, to set the input only dropdown size variant in the BentoDropdown comp\n provide(INPUT_FIELD_COMPONENT_INJECTION_KEY, true);\n // Renders the input with a hint if a string is provided\n const hint = inject<Ref<string | undefined>>(INPUT_FIELD_HINT_INJECTION_KEY, ref(undefined));\n\n const onFocus = () => {\n isFocused.value = true;\n emit('focus');\n };\n\n const onBlur = () => {\n isFocused.value = false;\n emit('blur');\n };\n\n const { isReadOnly } = useFormLayoutFieldLoading(toRef(props, 'readonly'));\n const isDropdownReadOnly = computed<BentoInputDropdownProps['readonly']>(\n () => isReadOnly.value || props.dropdown?.readonly\n );\n\n const shouldShowStaticValue = computed(\n () => props.variant === BentoInputFieldVariant.STATIC_VALUE && !!slots.staticValue\n );\n\n const isDefaultVariant = computed(() => props.variant === BentoInputFieldVariant.DEFAULT);\n\n const isPaymentMethodVariant = computed(() => props.variant === BentoInputFieldVariant.PAYMENT_METHOD);\n\n const shouldDisplayStaticValueAtStart = computed(\n () => shouldShowStaticValue.value && props.staticValuePosition === BentoInputFieldElementPosition.START\n );\n const shouldDisplayStaticValueAtEnd = computed(\n () => shouldShowStaticValue.value && props.staticValuePosition === BentoInputFieldElementPosition.END\n );\n\n const shouldShowDropdown = computed(() => props.variant === BentoInputFieldVariant.DROPDOWN && !!props.dropdown);\n const shouldDisplayDropdownAtStart = computed(\n () => shouldShowDropdown.value && props.dropdownPosition === BentoInputFieldElementPosition.START\n );\n const shouldDisplayDropdownAtEnd = computed(\n () => shouldShowDropdown.value && props.dropdownPosition === BentoInputFieldElementPosition.END\n );\n\n const shouldShowError = computed(\n () => !props.disabled && !isReadOnly.value && (!!props.errorMessage || props.error)\n );\n\n const computedLabel = computed(() => (getSlotText(slots)('default') as string) || props.label);\n const computedDescription = computed(() => (getSlotText(slots)('description') as string) || props.description);\n\n const computedAriaOwns = computed(() => {\n if (shouldShowDropdown.value === true && shouldShowStaticValue.value === true) {\n return `${staticValueId} ${dropdownId}`;\n }\n if (shouldShowDropdown.value === true) {\n return `${dropdownId}`;\n }\n if (shouldShowStaticValue.value === true) {\n return `${staticValueId}`;\n }\n return null;\n });\n\n // vue-i18n issue with t() used in script - direct usage in template works\n // requires either createI18n({ legacy: false }) or to be wrapped in computed()\n const computedAriaLabelFallbackMessage = computed(() => t('ariaLabelFallback'));\n const computedAriaLabelDropdowFallback = computed(() =>\n t('ariaLabelDropdownFallback', { inputLabel: computedAriaLabel.value })\n );\n\n const ariaLabelAttribute = ref(attrs['aria-label']);\n const { ariaLabel } = toRefs(props);\n const computedAriaLabel = useAriaLabel({\n ariaLabel: ariaLabelAttribute.value as string,\n // TODO: take this line away when the aria-label props is removed\n label: ariaLabel,\n defaultFallback: computedLabel.value || computedAriaLabelFallbackMessage,\n });\n\n const computedAriaDescribedBy = computed(\n () =>\n `${computedDescription.value ? descriptionId : ''} ${\n shouldShowError.value && !!props.errorMessage ? errorId : ''\n }`\n );\n\n const inputFieldConditionalClasses = computed(() => ({\n [`b-input-field--${BentoInputFieldStateClass.CONDENSED}`]: props.condensed,\n [`b-input-field--${BentoInputFieldStateClass.DISABLED}`]: props.disabled,\n [`b-input-field--${BentoInputFieldStateClass.READONLY}`]: isReadOnly.value,\n [`b-input-field--${BentoInputFieldStateClass.ERROR}`]: shouldShowError.value,\n [`b-input-field--slashed-zero`]: props.slashedZero,\n }));\n\n const inputFieldDropdownProps = computed(() => ({\n 'aria-label': computedAriaLabelDropdowFallback.value,\n ...props.dropdown,\n }));\n\n const onInput = (event: Event) => {\n const inputValue = (event.target as HTMLInputElement).value;\n if (!props.disabled && !isReadOnly.value) {\n emit('input', inputValue);\n }\n };\n\n const onDropdownInput = (selectedValue: BentoListboxSelectedValue) => {\n emit('dropdown-input', selectedValue);\n emit('update:dropdown', { ...props?.dropdown, value: selectedValue });\n };\n\n const focusInput = () => {\n inputFieldElement.value.focus();\n };\n\n const focus = () => {\n if (props.variant === 'dropdown') {\n inputDropdownElement.value.focus();\n } else {\n focusInput();\n }\n };\n\n // Expose method so that other components can focus on it in Vue3\n defineExpose({\n focusInput,\n focus,\n });\n\n const inputFieldParentComponent = inject(INPUT_FIELD_PARENT_COMPONENT_INJECTION_KEY, '');\n\n if (!Object.values(BentoInputFieldType).includes(props.type as BentoInputFieldType) && !inputFieldParentComponent) {\n if (props.type === 'tel') {\n printDevelopmentWarning(\n `\"bento-input-field\" dropdown does not support the type '${props.type}', use \"bento-input-field-phone-number\" instead.`\n );\n } else if (props.type === 'password') {\n printDevelopmentWarning(\n `\"bento-input-field\" dropdown does not support the type '${props.type}', use \"bento-input-field-password\" instead.`\n );\n } else {\n printDevelopmentWarning(`\"bento-input-field\" dropdown does not support the type '${props.type}'`);\n }\n }\n\n /**\n * Deprecations\n */\n if (props.error) {\n deprecate(\n 'BentoInputField \"error\" property',\n `Use the BentoInputField \"errorMessage\" property instead to indicate that there is a modifier error.\n Having the field as \"undefined\" will hide/remove the error.\n <bento-dropdown errorMessage=\"Error message text\" />`,\n '2.0.0'\n );\n }\n\n if (hasSlot('defaultIconBefore')) {\n deprecate(\n 'BentoInputField \"defaultIconBefore\" slot',\n `Use the BentoInputField \"iconBefore\" slot instead to add an icon at the left side of the input field\n <bento-input-field>\n \\t<template #iconBefore>\n \\t\\t<my-icon-goes-here />\n \\t</template>\n </bento-input-field>`,\n '2.0.0'\n );\n }\n</script>\n\n<script lang=\"ts\">\n /**\n * Input field component is used to create interactive controls for web-based\n * forms in order to accept data from the user.\n *\n * @example\n * import { BentoInputField } from '@adyen/bento-vue2'\n *\n * const inputValue = ref('');\n *\n * export default {\n * components: { BentoInputField },\n * tempate: `\n * <bento-input-field\n * :value=\"inputValue\"\n * :input=\"newValue => inputValue.value = newValue\"\n * >\n * }\n */\n export default {\n i18n: { messages },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./input-field.scss\" />\n"],"names":["BentoInputFieldVariant","BentoInputFieldVariant2","BentoInputFieldElementPosition","BentoInputFieldElementPosition2","BentoInputFieldStateClass","BentoInputFieldStateClass2","BentoInputFieldType","BentoInputFieldType2","BentoInputFieldEvent","BentoInputFieldEvent2","__default__","messages","attrs","useAttrs","slots","useSlots","props","__props","emit","__emit","t","useI18n","hasSlot","useHasSlot","inputFieldElement","ref","inputDropdownElement","inputFieldId","generateUid","dropdownId","staticValueId","descriptionId","errorId","isFocused","provide","INPUT_FIELD_COMPONENT_INJECTION_KEY","hint","inject","INPUT_FIELD_HINT_INJECTION_KEY","onFocus","onBlur","isReadOnly","useFormLayoutFieldLoading","toRef","isDropdownReadOnly","computed","_a","shouldShowStaticValue","isDefaultVariant","isPaymentMethodVariant","shouldDisplayStaticValueAtStart","shouldDisplayStaticValueAtEnd","shouldShowDropdown","shouldDisplayDropdownAtStart","shouldDisplayDropdownAtEnd","shouldShowError","computedLabel","getSlotText","computedDescription","computedAriaOwns","computedAriaLabelFallbackMessage","computedAriaLabelDropdowFallback","computedAriaLabel","ariaLabelAttribute","ariaLabel","toRefs","useAriaLabel","computedAriaDescribedBy","inputFieldConditionalClasses","inputFieldDropdownProps","onInput","event","inputValue","onDropdownInput","selectedValue","focusInput","__expose","inputFieldParentComponent","INPUT_FIELD_PARENT_COMPONENT_INJECTION_KEY","printDevelopmentWarning","deprecate"],"mappings":";;;;;;;;;;;;AAMY,IAAAA,IAAA,kBAAAC,OACRA,EAAA,UAAA,WACAA,EAAA,iBAAA,kBACAA,EAAA,eAAA,gBACAA,EAAA,WAAA,YAJQA,IAAAD,KAAA,CAAA,CAAA,GAUAE,IAAA,kBAAAC,OACRA,EAAA,QAAA,SACAA,EAAA,MAAA,OAFQA,IAAAD,KAAA,CAAA,CAAA,GAKAE,IAAA,kBAAAC,OACRA,EAAA,YAAA,aACAA,EAAA,WAAA,YACAA,EAAA,WAAA,YACAA,EAAA,QAAA,SAJQA,IAAAD,KAAA,CAAA,CAAA,GAUAE,IAAA,kBAAAC,OACRA,EAAA,SAAA,UACAA,EAAA,OAAA,QACAA,EAAA,SAAA,UAHQA,IAAAD,KAAA,CAAA,CAAA,GAqCAE,KAAA,kBAAAC,OACRA,EAAA,QAAA,SACAA,EAAA,iBAAA,kBACAA,EAAA,kBAAA,mBACAA,EAAA,iBAAA,kBACAA,EAAA,QAAA,SACAA,EAAA,SAAA,UACAA,EAAA,OAAA,QACAA,EAAA,UAAA,WARQA,IAAAD,MAAA,CAAA,CAAA;;;;;;sUCwZRE,KAAA;AAAA,EAAe,MAAA,EAAA,UAAAC,EAAA;AAEf;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAtRA,UAAAC,IAAAC,GAAA,GACAC,IA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A;AAAA,MACI;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MACA;AAAA,IAMA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"pagination.BaBWNlIF.js","sources":["../../../vue2/src/components/pagination/components/pagination-results-per-page/pagination-results-per-page.vue","../../../vue2/src/components/pagination/components/pagination-context/pagination-context.vue","../../../ui-assets/icons-16/dist/vue/skip-left.vue","../../../ui-assets/icons-16/dist/vue/skip-right.vue","../../../ui-assets/icons-16/dist/vue/chevron-left-small.vue","../../../ui-assets/icons-16/dist/vue/chevron-right-small.vue","../../../vue2/src/components/pagination/components/pagination-controls/pagination-controls.vue","../../../vue2/src/components/pagination/pagination.vue"],"sourcesContent":["<template>\n <div class=\"b-pagination-results-per-page\">\n <bento-typography el=\"div\">\n <component\n :is=\"i18nComponent\"\n v-bind=\"getI18nProps(translationPathKey)\"\n class=\"b-pagination-results-per-page__dropdown-container\"\n tag=\"div\"\n :plural=\"totalCount\"\n >\n <template #itemCount>\n <bento-dropdown\n :id=\"dropdownId\"\n :aria-label=\"t(translationPathKey, { itemCount: itemsPerPage, totalCount })\"\n class=\"b-pagination-results-per-page__dropdown\"\n condensed\n :items=\"predefinedDropdownOptions\"\n :value=\"itemsPerPage\"\n @input=\"onSelectChange\"\n />\n </template>\n <template v-if=\"!!totalCount\" #totalCount>{{ totalCount }}</template>\n </component>\n </bento-typography>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed } from 'vue';\n import { BentoTypography } from '@/components/typography';\n import { BentoDropdown } from '@/components/dropdown';\n import { generateUid } from '@/core/utils/ts';\n import { getI18nComponent, getI18nProps, useI18n } from '@/utils/ts/i18n';\n\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const { t, n } = useI18n<{ message: MessageSchema }>({ messages });\n\n const props = withDefaults(\n defineProps<{\n /**\n * The amount of items the pager is paging through.\n */\n itemsPerPage?: number;\n /**\n * The total number of items the pager is paging through.\n */\n totalCount?: number;\n }>(),\n {\n itemsPerPage: 50,\n totalCount: null,\n }\n );\n\n const emit = defineEmits<{\n (e: 'select', value: number);\n }>();\n\n const dropdownId = generateUid('b-pagination-context-number-elements');\n const predefinedDropdownOptions = computed(() => [\n { label: n(10), value: 10 },\n { label: n(20), value: 20 },\n { label: n(50), value: 50 },\n { label: n(75), value: 75 },\n { label: n(100), value: 100 },\n ]);\n const i18nComponent = getI18nComponent();\n\n const onSelectChange = (selectedNumberOfResults: number) => {\n emit('select', selectedNumberOfResults);\n };\n\n const translationPathKey = computed(() => (props.totalCount ? 'showingItemsWithTotal' : 'showingItems'));\n</script>\n\n<script lang=\"ts\">\n export default {\n i18n: { messages },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./pagination-results-per-page.scss\" />\n","<template>\n <div class=\"b-pagination-context\">\n <bento-typography v-if=\"totalPages > 1\" el=\"div\">\n <component :is=\"i18nComponent\" v-bind=\"getI18nProps('pageNumber')\" tag=\"div\">\n <template #page>\n <bento-dropdown\n :id=\"dropdownId\"\n :aria-label=\"t('pageNumber', { page: n(page) })\"\n class=\"b-pagination-context__dropdown\"\n condensed\n :items=\"listOfAvailablePages\"\n :value=\"page\"\n :virtual-scroll=\"virtualScroll\"\n @input=\"onPageSelectChange\"\n />\n </template>\n </component>\n </bento-typography>\n <bento-typography v-else-if=\"totalPages === 1\" el=\"span\">\n {{ t('pageOneOfOne') }}\n </bento-typography>\n <bento-typography v-else el=\"span\">\n {{ t('pageNumber', { page: n(page) }) }}\n </bento-typography>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed } from 'vue';\n import { BentoTypography } from '@/components/typography';\n import { BentoDropdown } from '@/components/dropdown';\n import { type BentoListboxOptionItem } from '@/types/listbox';\n import { generateUid } from '@/core/utils/ts';\n import messages from './messages.json';\n import { getI18nComponent, getI18nProps, useI18n } from '@/utils/ts/i18n';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const props = withDefaults(\n defineProps<{\n /**\n * The current page number of the pager.\n */\n page?: number;\n\n /**\n * The total number of items the pager is paging through.\n */\n totalPages?: number;\n\n /**\n * Enables virtual scrolling on all dropdowns if set to true.\n */\n virtualScroll?: boolean;\n }>(),\n {\n page: 1,\n totalPages: null,\n virtualScroll: false,\n }\n );\n const emit = defineEmits<{\n (e: 'page-selected', value: string | number);\n }>();\n\n const { t, n } = useI18n<{ message: MessageSchema }>({ messages });\n const dropdownId = generateUid('bento-pagination-context-current-page');\n const onPageSelectChange = (selectedPage: string | number) => emit('page-selected', selectedPage);\n const i18nComponent = getI18nComponent();\n\n // Generate a list of pages from 1 to \"totalPages\"\n const transformIntoOption = (value: number): BentoListboxOptionItem => ({\n label: n(value),\n value,\n });\n const transformToPageNumber = (_, index) => index + 1;\n const listOfAvailablePages = computed(() =>\n Array.from(new Array(props.totalPages), transformToPageNumber).map(transformIntoOption)\n );\n</script>\n\n<script lang=\"ts\">\n export default {\n i18n: { messages },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./pagination-context.scss\" />\n","\n<template>\n <svg role=\"img\" v-bind=\"$attrs\" class=\"ui-assets-icons-16\" xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" fill=\"none\"><title v-if=\"$attrs['svg-title']\">{{ $attrs['svg-title'] }}</title><path fill=\"#001222\" d=\"M9.06055 8.00011L12.0605 5.00011L10.9999 3.93945L6.93923 8.00011L10.9999 12.0608L12.0605 11.0001L9.06055 8.00011Z\"/><path fill=\"#001222\" d=\"M4.25 4.25L4.25 11.75H5.75L5.75 4.25L4.25 4.25Z\"/></svg>\n</template>\n<script>\n import '../css/main.css';\n\n let uuid = 0;\n\n export default {\n beforeCreate() {\n this.uuid = uuid.toString();\n uuid += 1;\n },\n };\n</script>\n","\n<template>\n <svg role=\"img\" v-bind=\"$attrs\" class=\"ui-assets-icons-16\" xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" fill=\"none\"><title v-if=\"$attrs['svg-title']\">{{ $attrs['svg-title'] }}</title><path fill=\"#001222\" d=\"M6.93945 7.99962L3.93945 10.9996L5.00011 12.0603L9.06077 7.99963L5.00011 3.93896L3.93945 4.99963L6.93945 7.99962Z\"/><path fill=\"#001222\" d=\"M11.75 11.7497V4.24974L10.25 4.24974V11.7497H11.75Z\"/></svg>\n</template>\n<script>\n import '../css/main.css';\n\n let uuid = 0;\n\n export default {\n beforeCreate() {\n this.uuid = uuid.toString();\n uuid += 1;\n },\n };\n</script>\n","\n<template>\n <svg role=\"img\" v-bind=\"$attrs\" class=\"ui-assets-icons-16\" xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" fill=\"none\"><title v-if=\"$attrs['svg-title']\">{{ $attrs['svg-title'] }}</title><path fill=\"#001222\" d=\"M10.5608 5.00011L7.56077 8.00011L10.5608 11.0001L9.50011 12.0608L5.43945 8.00011L9.50011 3.93945L10.5608 5.00011Z\"/></svg>\n</template>\n<script>\n import '../css/main.css';\n\n let uuid = 0;\n\n export default {\n beforeCreate() {\n this.uuid = uuid.toString();\n uuid += 1;\n },\n };\n</script>\n","\n<template>\n <svg role=\"img\" v-bind=\"$attrs\" class=\"ui-assets-icons-16\" xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" fill=\"none\"><title v-if=\"$attrs['svg-title']\">{{ $attrs['svg-title'] }}</title><path fill=\"#001222\" d=\"M5.43924 10.9999L8.43924 7.99989L5.43924 4.99989L6.4999 3.93923L10.5606 7.99989L6.4999 12.0605L5.43924 10.9999Z\"/></svg>\n</template>\n<script>\n import '../css/main.css';\n\n let uuid = 0;\n\n export default {\n beforeCreate() {\n this.uuid = uuid.toString();\n uuid += 1;\n },\n };\n</script>\n","<template>\n <ul class=\"b-pagination-controls\">\n <li class=\"b-pagination-controls__item\">\n <!-- Navigate to the first page -->\n <bento-button :disabled=\"isCurrentPageFirst\" variant=\"tertiary\" condensed @click=\"navigate(1)\">\n <template #iconLeft>\n <skip-left :svg-title=\"t('navigateToTheFirstPage')\" />\n </template>\n </bento-button>\n </li>\n <li class=\"b-pagination-controls__item\">\n <!-- Navigate to the previous page -->\n <bento-button :disabled=\"isCurrentPageFirst\" variant=\"tertiary\" condensed @click=\"navigate(page - 1)\">\n <template #iconLeft>\n <chevron-left :svg-title=\"t('navigateToThePreviousPage')\" />\n </template>\n </bento-button>\n </li>\n <li class=\"b-pagination-controls__item\">\n <!-- Navigate to the next page -->\n <bento-button :disabled=\"isNextButtonDisabled\" variant=\"tertiary\" condensed @click=\"navigate(page + 1)\">\n <template #iconLeft>\n <chevron-right :svg-title=\"t('navigateToTheNextPage')\" />\n </template>\n </bento-button>\n </li>\n <li class=\"b-pagination-controls__item\">\n <!-- Navigate to the last page -->\n <bento-button\n :disabled=\"isLastPageButtonDisabled\"\n variant=\"tertiary\"\n condensed\n @click=\"navigate(totalPages)\"\n >\n <template #iconLeft>\n <skip-right :svg-title=\"t('navigateToTheLastPage')\" />\n </template>\n </bento-button>\n </li>\n </ul>\n</template>\n\n<script setup lang=\"ts\">\n import { computed } from 'vue';\n import { BentoButton } from '@/components/button';\n import { useI18n } from '@/utils/ts/i18n';\n import SkipLeft from '@adyen/ui-assets-icons-16/vue/skip-left';\n import SkipRight from '@adyen/ui-assets-icons-16/vue/skip-right';\n import ChevronLeft from '@adyen/ui-assets-icons-16/vue/chevron-left-small';\n import ChevronRight from '@adyen/ui-assets-icons-16/vue/chevron-right-small';\n\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const props = withDefaults(\n defineProps<{\n /**\n * Use to determine if the pager has a \"next page\".\n */\n hasNext?: boolean;\n\n /**\n * The current page number of the pager.\n */\n page: number;\n\n /**\n * The current page number of the pager.\n */\n totalPages?: number;\n }>(),\n {\n hasNext: null,\n totalPages: null,\n }\n );\n\n const emit = defineEmits<{\n (e: 'navigate', value: number);\n }>();\n\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n\n const isCurrentPageFirst = computed(() => props.page === 1);\n const isCurrentPageLast = computed(() => props.page === props.totalPages);\n const isNextButtonDisabled = computed(() => {\n const hasNoNextPage = !props.hasNext;\n return hasNoNextPage || isCurrentPageLast.value;\n });\n const isLastPageButtonDisabled = computed(() => {\n const hasNoNextPage = !props.hasNext;\n const hasNoTotalPagesNumber = !props.totalPages;\n\n return hasNoNextPage || isCurrentPageLast.value || hasNoTotalPagesNumber;\n });\n\n const navigate = (pageArg: number) => {\n emit('navigate', pageArg);\n };\n</script>\n\n<script lang=\"ts\">\n export default {\n i18n: { messages },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./pagination-controls.scss\" />\n","<template>\n <div class=\"b-pagination\">\n <nav :aria-label=\"computedAriaLabel\" class=\"b-pagination__navigation\" :class=\"navigationConditionalClasses()\">\n <bento-pagination-results-per-page\n v-if=\"!hidePageSize\"\n class=\"b-pagination__results-per-page\"\n :items-per-page=\"size\"\n :total-count=\"totalCount\"\n @select=\"onItemsPerPageChange\"\n />\n <bento-typography v-else-if=\"hasSlot('default')\"><slot /></bento-typography>\n\n <div class=\"b-pagination__page-navigator\">\n <bento-pagination-context\n class=\"b-pagination__context\"\n :total-pages=\"totalPages\"\n :page=\"page\"\n :total-count=\"totalCount\"\n :virtual-scroll=\"virtualScroll\"\n @page-selected=\"onPageSelected\"\n />\n\n <div class=\"b-pagination__divider\"></div>\n\n <bento-pagination-controls\n class=\"b-pagination__controls\"\n :has-next=\"hasNext\"\n :page=\"page\"\n :total-pages=\"totalPages\"\n @navigate=\"navigate\"\n />\n </div>\n </nav>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, ref, toRefs, useAttrs, useSlots } from 'vue';\n import { BentoTypography } from '@/components/typography';\n import BentoPaginationResultsPerPage from './components/pagination-results-per-page/pagination-results-per-page.vue';\n import BentoPaginationContext from './components/pagination-context/pagination-context.vue';\n import BentoPaginationControls from './components/pagination-controls/pagination-controls.vue';\n import { useAriaLabel } from '@/utils/ts/aria-label';\n import { useHasSlot } from '@/composables';\n import type { BentoPaginationProps } from './pagination.types';\n\n const props = withDefaults(defineProps<BentoPaginationProps>(), {\n ariaLabel: null,\n hasNext: null,\n hidePageSize: false,\n page: 1,\n size: 20,\n totalCount: null,\n virtualScroll: false,\n });\n\n const emit = defineEmits<{\n /**\n * Triggered when the navigation controls are clicked or the items per page is changed (i.e. when the arrow buttons to the\n * rightmost of the screen or either dropdown is updated). It indicates to which page it should go next and also the page size.\n */\n (e: 'navigate', page: number, items?: number): void;\n\n /**\n * Triggered when the number of items per page is changed from the left hand dropdown.\n * It indicates the new number of items that will be displayed.\n */\n (e: 'items-page', size: number): void;\n\n /**\n * Triggered when the navigation controls are clicked, whether the arrow buttons to the\n * right most of the screen or the dropdown on the right hand is updated.\n * It indicates to which page it should go next\n * (easily achieved using the [sync modifier](https://v2.vuejs.org/v2/guide/components-custom-events.html#sync-Modifier))\n * e.g. `:page.sync=\"currentPage\"`\n */\n (e: 'update:page', page: number): void;\n\n /**\n * Triggered when the number of items per page is changed from the left hand dropdown.\n * It indicates the new number of items that will be displayed.\n * (easily achieved using the [sync modifier](https://v2.vuejs.org/v2/guide/components-custom-events.html#sync-Modifier))\n * e.g. `:size.sync=\"itemsPerPage\"`\n */\n (e: 'update:size', size: number): void;\n }>();\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n\n const attrs = useAttrs();\n const ariaLabelAttribute = ref(attrs['aria-label']);\n const { ariaLabel } = toRefs(props);\n const computedAriaLabel = useAriaLabel({\n ariaLabel: ariaLabelAttribute.value as string,\n // TODO: take this line away when the aria-label props is removed\n label: ariaLabel,\n });\n\n const totalPages = computed(() =>\n !props.totalCount || !props.size ? null : Math.ceil(props.totalCount / props.size)\n );\n\n const navigate = (pageArg: number, itemsPerPage?: number) => {\n if (props.hidePageSize) {\n emit('navigate', pageArg);\n } else {\n emit('navigate', pageArg, itemsPerPage ?? props?.size);\n }\n emit('update:page', pageArg);\n };\n\n const onPageSelected = (pageNumber: number) => {\n navigate(pageNumber);\n };\n\n const onItemsPerPageChange = (elements: number) => {\n emit('items-page', elements);\n emit('update:size', elements);\n\n // Always go to first page when the\n // number of items page changes\n navigate(1, elements);\n };\n\n const navigationConditionalClasses = () => ({\n 'b-pagination__navigation--only-page-navigator': !hasSlot('default') && props.hidePageSize,\n });\n</script>\n\n<script lang=\"ts\">\n /**\n * Paginiation component to help users page through data sets.\n *\n * There are two ways of doing navigation in this component:\n * 1. (Basic) You tell the component if there is a next page (hasNext)\n * 2. (Enhanced) You tell the component:\n * - How many total items exist (totalCount)\n * - The max number of items that you show/fetch per page (size)\n * - In this case you should not set the hasNext props\n *\n * If you have the data available and opt to use the Enhanced way you get extra controls:\n * - Page dropdown selector\n * - Last page button\n * - \"Showing 10 of 200 items\" text\n *\n * @usage\n * import { BentoPagination } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoPagination },\n * template: `\n * <bento-pagination :has-next=\"isNextPage\" />\n * `,\n * }\n */\n\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"./pagination.scss\" />\n"],"names":["__default__$3","messages$2","n","useI18n","props","__props","emit","__emit","dropdownId","generateUid","predefinedDropdownOptions","computed","i18nComponent","getI18nComponent","onSelectChange","selectedNumberOfResults","translationPathKey","__default__$2","messages$1","t","onPageSelectChange","selectedPage","transformIntoOption","value","transformToPageNumber","_","index","listOfAvailablePages","uuid$3","openBlock","createElementBlock","mergeProps","_ctx","createCommentVNode","uuid$2","uuid$1","uuid","__default__$1","messages","isCurrentPageFirst","isCurrentPageLast","isNextButtonDisabled","isLastPageButtonDisabled","hasNoNextPage","hasNoTotalPagesNumber","navigate","pageArg","__default__","slots","useSlots","hasSlot","useHasSlot","attrs","useAttrs","ariaLabelAttribute","ref","ariaLabel","toRefs","computedAriaLabel","useAria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,MAAuC,WAAAL,EAAA;AAAA;AAAA,MACL,OAAAE;AAAA,IAEvB,CAAA,GAGXI,IAAAjD;AAAA,MAAmB,MAAA,CAAAP,EAAA,cAAA,CAAAA,EAAA,OAAA,OAAA,KAAA,KAAAA,EAAA,aAAAA,EAAA,IAAA;AAAA,IACkE,GAGrFyC,IAAA,CAAAC,GAAAe,MAAA;AACI,MAAAzD,EAAA,eACIE,EAAA,YAAAwC,CAAA,IAEAxC,EAAA,YAAAwC,GAAAe,MAAAzD,KAAA,gBAAAA,EAAA,KAAA,GAEJE,EAAA,eAAAwC,CAAA;AAAA,IAA2B,GAG/BgB,IAAA,CAAAC,MAAA;AACI,MAAAlB,EAAAkB,CAAA;AAAA,IAAmB,GAGvBC,IAAA,CAAAC,MAAA;AACI,MAAA3D,EAAA,cAAA2D,CAAA,GACA3D,EAAA,eAAA2D,CAAA,GAIApB,EAAA,GAAAoB,CAAA;AAAA,IAAoB,GAGxBC,IAAA,OAAA;AAAA,MAA4C,iDAAA,CAAAhB,EAAA,SAAA,KAAA9C,EAAA;AAAA,IACsC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"payment-method.CDnn1bjo.js","sources":["../../../vue2/src/components/payment-method/composables/use-payment-icon/use-payment-icon.ts","../../../ui-assets/icons-pm/dist/vue/unknowncard.vue","../../../vue2/src/components/payment-method/payment-method.vue"],"sourcesContent":["import { ref, type Ref, watch } from 'vue';\n\n/**\n * Generates the payment icon URl from a payment icons string.\n * @param paymentType - the payment icon you wish to generate a URL for.\n * @returns the payment icon URL to the SVG for a specific payment icon.\n */\nexport const paymentMethodToCdnUrl = (paymentType: string) =>\n `https://checkoutshopper-live.cdn.adyen.com/checkoutshopper/images/logos/${paymentType}.svg`;\n/**\n * Dynamically retrieves the payment method icon SVG from the @adyen/ui-assets-payment-method-icons package.\n *\n * @param type the type of payment method\n * @param useFallback if fallback icon should be used in case of error\n * @returns\n */\nexport const usePaymentIcon = (type: Ref<string>) => {\n const paymentType = ref(type);\n const paymentIconSrc = ref<string>();\n\n watch(\n paymentType,\n newPaymentType => {\n if (newPaymentType == null || newPaymentType === 'Unknowncard') {\n return;\n }\n // TODO: what about when to use checkoutshopper-test? Should we add this to the config of Bento?\n paymentIconSrc.value = paymentMethodToCdnUrl(newPaymentType);\n },\n { immediate: true }\n );\n\n return paymentIconSrc;\n};\n","\n<template>\n <svg role=\"img\" v-bind=\"$attrs\" class=\"ui-assets-icons-pm\" xmlns=\"http://www.w3.org/2000/svg\" width=\"40\" height=\"26\" fill=\"none\"><title v-if=\"$attrs['svg-title']\">{{ $attrs['svg-title'] }}</title><g :clip-path=\"'url(#uia-ui-assets/icons-pm-unknowncard__a' + uuid + ')'\"><path fill=\"#fff\" d=\"M0 0H40V26H0V0Z\"/><path fill=\"#00112C\" d=\"M32 9V8C32 7.20435 31.6839 6.44129 31.1213 5.87868C30.5587 5.31607 29.7956 5 29 5H11C10.2044 5 9.44129 5.31607 8.87868 5.87868C8.31607 6.44129 8 7.20435 8 8V9H32Z\"/><path fill=\"#00112C\" d=\"M8 12V18C8 18.7956 8.31607 19.5587 8.87868 20.1213C9.44129 20.6839 10.2044 21 11 21H29C29.7956 21 30.5587 20.6839 31.1213 20.1213C31.6839 19.5587 32 18.7956 32 18V12H8Z\"/><rect width=\"5\" height=\"2\" x=\"24\" y=\"16\" fill=\"#fff\" rx=\".5\"/></g><defs><clipPath :id=\"'uia-ui-assets/icons-pm-unknowncard__a' + uuid\"><rect width=\"40\" height=\"26\" fill=\"#fff\"/></clipPath></defs></svg>\n</template>\n<script>\n import '../css/main.css';\n\n let uuid = 0;\n\n export default {\n beforeCreate() {\n this.uuid = uuid.toString();\n uuid += 1;\n },\n };\n</script>\n","<template>\n <div class=\"b-payment-method\">\n <div class=\"b-payment-method__icon-container\">\n <img\n v-if=\"type !== 'Unknowncard' && !hasErroredOnImage\"\n aria-hidden=\"true\"\n class=\"b-payment-method__icon\"\n :class=\"conditionalIconClasses\"\n :alt=\"label\"\n :src=\"paymentMethodIconSrc\"\n @error=\"onSrcError\"\n />\n <unknown-card-icon v-else :svg-title=\"label\" aria-hidden=\"true\" />\n </div>\n <div class=\"b-payment-method__label\">\n <span v-if=\"isSummaryGridLayout\">{{ label }}</span>\n <bento-typography v-else el=\"span\">{{ label }}</bento-typography>\n </div>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, defineComponent, inject, ref, toRef, watch } from 'vue';\n import { BentoTypography } from '@/components/typography';\n import { SUMMARY_GRID_LAYOUT_INJECTION_KEY } from '@/components/summary-grid/summary-grid.keys';\n import { type BentoSummaryGridLayout } from '@/components/summary-grid';\n import { usePaymentIcon } from './composables/use-payment-icon/use-payment-icon';\n import type { BentoPaymentMethodProps } from './payment-method.types';\n import UnknownCardIcon from '@adyen/ui-assets-payment-method-icons/vue/unknowncard';\n\n const props = withDefaults(defineProps<BentoPaymentMethodProps>(), {\n type: 'Unknowncard',\n small: false,\n });\n const type = toRef(props, 'type');\n const hasErroredOnImage = ref(false);\n const paymentMethodIconSrc = usePaymentIcon(type);\n const conditionalIconClasses = computed(() => ({\n 'b-payment-method__icon--small': props.small,\n }));\n\n /* == Summary-grid styles == */\n const registerPaymentMethodInSummaryGrid: BentoSummaryGridLayout = inject(\n SUMMARY_GRID_LAYOUT_INJECTION_KEY,\n () => ({\n isSummaryGridLayout: false,\n })\n );\n\n const { isSummaryGridLayout } = registerPaymentMethodInSummaryGrid();\n\n /**\n * This funciton is fired if the payment image source is not valid and has thrown an error.\n */\n const onSrcError = () => {\n hasErroredOnImage.value = true;\n };\n\n // Reset the image error to be able to load the new payment type\n watch(\n () => type.value,\n (newType, oldType) => {\n if (newType !== oldType) {\n hasErroredOnImage.value = false;\n }\n }\n );\n</script>\n\n<script lang=\"ts\">\n /**\n * A payment method type component to display the type's icon and label.\n *\n * @example\n * import { BentoPaymentMethod} from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoPaymentMethod },\n * template: `\n * <bento-payment-method type=\"ideal\" />\n * `\n * }\n */\n export default defineComponent({\n name: 'bento-payment-method',\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./payment-method.scss\" />\n"],"names":["paymentMethodToCdnUrl","paymentType","usePaymentIcon","type","ref","paymentIconSrc","watch","newPaymentType","uuid","_hoisted_2$1","_hoisted_3$1","openBlock","createElementBlock","mergeProps","_ctx","createCommentVNode","__default__","defineComponent","props","__props","toRef","hasErroredOnImage","paymentMethodIconSrc","conditionalIconClasses","computed","registerPaymentMethodInSummaryGrid","inject","SUMMARY_GRID_LAYOUT_INJECTION_KEY","isSummaryGridLayout","onSrcError","newType","oldType"],"mappings":";;;;;AAOO,MAAAA,IAAA,CAAAC,MAAA,2EAAAA,CAAA,QASMC,IAAA,CAAAC,MAAA;AACT,QAAAF,IAAAG,EAAAD,CAAA,GACAE,IAAAD,EAAA;AAEA,SAAAE;AAAA,IAAAL;AAAA,IACI,CAAAM,MAAA;AAEI,MAAAA,KAAA,QAAAA,MAAA,kBAIAF,EAAA,QAAAL,EAAAO,CAAA;AAAA,IAA2D;AAAA,IAC/D,EAAA,WAAA,GAAA;AAAA,EACkB,GAGtBF;AACJ;AC1BI,IAAAG,IAAA;;EAGI,eAAA;8BAEIA,KAAA;AAAA;mBAZZC,IAAA,CAAA,WAAA,GAAAC,IAAA,CAAA,IAAA;;AAEI,SAAAC,EAAA,GAAAC,EAAA,OAAAC,EAAA,EAAA,MAAA,MAAA,GAAAC,EAAA,QAAA;AAAA,IAAgC,OAAA;AAAA,IAA2B,OAAA;AAAA,IAAmC,OAAA;AAAA,IAAW,QAAA;AAAA,IAAY,MAAA;AAAA;gFAFzHC,EAAA,IAAA,EAAA;AAAA;MAE4M,aAAA,+CAAAD,EAAA,OAAA;AAAA;;QAA4E,MAAA;AAAA,QAAY,GAAA;AAAA;;QAA2B,MAAA;AAAA,QAAe,GAAA;AAAA;;QAA8K,MAAA;AAAA,QAAe,GAAA;AAAA;;QAAoL,OAAA;AAAA,QAAU,QAAA;AAAA,QAAW,GAAA;AAAA,QAAO,GAAA;AAAA,QAAO,MAAA;AAAA,QAAY,IAAA;AAAA;IAF9uB,IAAA,GAAAL,CAAA;AAAA;;QAE4wB,IAAA,0CAAAK,EAAA;AAAA;;UAA0D,OAAA;AAAA,UAAW,QAAA;AAAA,UAAY,MAAA;AAAA;MAF71B,IAAA,GAAAJ,CAAA;AAAA;;;qNCmFIM,IAAAC,EAAA;AAAA,EAA+B,MAAA;AAE/B,CAAA;;;;;;;;AAvDA,UAAAC,IAAAC,GAIAhB,IAAAiB,EAAAF,GAAA,MAAA,GACAG,IAAAjB,EAAA,EAAA,GACAkB,IAAApB,EAAAC,CAAA,GACAoB,IAAAC,EAAA,OAAA;AAAA,MAA+C,iCAAAN,EAAA;AAAA,IACJ,EAAA,GAI3CO,IAAAC;AAAA,MAAmEC;AAAA,MAC/D,OAAA;AAAA,QACO,qBAAA;AAAA,MACkB;AAAA,IACzB,GAGJ,EAAA,qBAAAC,EAAA,IAAAH,EAAA,GAKAI,IAAA,MAAA;AACI,MAAAR,EAAA,QAAA;AAAA,IAA0B;AAI9B,WAAAf;AAAA,MAAA,MAAAH,EAAA;AAAA,MACe,CAAA2B,GAAAC,MAAA;AAEP,QAAAD,MAAAC,MACIV,EAAA,QAAA;AAAA,MACJ;AAAA,IACJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"secondary-nav.DXsgUTqk.js","sources":["../../../vue2/src/components/secondary-nav/secondary-nav.keys.ts","../../../vue2/src/components/secondary-nav/components/secondary-nav-item/secondary-nav-item.vue","../../../vue2/src/components/secondary-nav/components/secondary-nav-category/secondary-nav-category.vue","../../../vue2/src/components/secondary-nav/secondary-nav.vue"],"sourcesContent":["import { type InjectionKey } from 'vue';\nimport { type BentoSecondaryNavState } from './secondary-nav.types';\n\nexport const SECONDARY_NAV_STATE = Symbol('secondary nav state') as InjectionKey<BentoSecondaryNavState>;\n","<template>\n <button class=\"b-secondary-nav-item\" :class=\"conditionalClasses\" :aria-selected=\"isItemSelected\" @click=\"onClick\">\n <bento-typography class=\"b-secondary-nav-item__title\" variant=\"body\" stronger>\n {{ label }}\n </bento-typography>\n </button>\n</template>\n\n<script lang=\"ts\" setup>\n import { SECONDARY_NAV_STATE } from '../../secondary-nav.keys';\n import { BentoTypography } from '@/components/typography';\n import { computed, inject } from 'vue';\n\n const { activeItemValue, updateActiveItemValue } = inject(SECONDARY_NAV_STATE);\n\n const props = defineProps<{\n /**\n * The display name of the navigation item\n */\n label: string;\n /**\n * The value of this item.\n */\n value: string;\n }>();\n\n const isItemSelected = computed(() => activeItemValue.value === props.value);\n\n const conditionalClasses = computed(() => ({\n 'b-secondary-nav-item--active': isItemSelected.value,\n }));\n\n const emit = defineEmits<{\n /**\n * Event emitted when this element is clicked\n */\n (e: 'click', clickEvent: MouseEvent): void;\n }>();\n\n const onClick = (e: MouseEvent) => {\n emit('click', e);\n updateActiveItemValue(props.value);\n };\n</script>\n\n<script lang=\"ts\">\n /**\n * This component shouldn't be used directly. It is internally used by {@see BentoSecondaryNav}\n */\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"./secondary-nav-item.scss\" />\n","<template>\n <section class=\"b-secondary-nav-category\" :aria-label=\"label\">\n <bento-typography el=\"h1\" class=\"b-secondary-nav-category__label\" variant=\"caption\" stronger>{{\n label\n }}</bento-typography>\n <ul class=\"b-secondary-nav__list\">\n <li v-for=\"item in items\" :key=\"item.value\">\n <secondary-nav-item :label=\"item.label\" :value=\"item.value\" />\n </li>\n </ul>\n </section>\n</template>\n\n<script lang=\"ts\" setup>\n import { BentoTypography } from '@/components/typography';\n import { SecondaryNavItem } from '../secondary-nav-item';\n import { type BentoSecondaryNavItemsItem } from '../../secondary-nav.types';\n\n defineProps<{\n /**\n * The display name of the category\n */\n label: string;\n /**\n * A list of {@see BentoSecondaryNavItemsItem} that belongs to this category\n */\n items: Array<BentoSecondaryNavItemsItem>;\n }>();\n</script>\n\n<script lang=\"ts\">\n /**\n * This component shouldn't be used directly. It is internally used by {@see BentoSecondaryNav}\n */\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"./secondary-nav-category.scss\" />\n","<template>\n <nav class=\"b-secondary-nav\">\n <bento-dropdown\n v-if=\"isMobile\"\n :aria-label=\"t('mobileDropdownAriaLabel')\"\n :items=\"dropdownItems\"\n :static-categories=\"hasCategories\"\n :value=\"activeItemValue\"\n @input=\"updateActiveItemValue\"\n />\n <ul v-else class=\"b-secondary-nav__list\">\n <li v-for=\"item in items\" :key=\"item.label\">\n <secondary-nav-category v-if=\"'items' in item\" :label=\"item.label\" :items=\"item.items\" />\n <secondary-nav-item v-else :label=\"item.label\" :value=\"item.value\" />\n </li>\n </ul>\n </nav>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, provide, readonly, ref, watch } from 'vue';\n import { SecondaryNavItem } from './components/secondary-nav-item';\n import { SecondaryNavCategory } from './components/secondary-nav-category';\n import { SECONDARY_NAV_STATE } from './secondary-nav.keys';\n import { type BentoSecondaryNavItems, type BentoSecondaryNavState } from './secondary-nav.types';\n import { BentoDropdown } from '@/components/dropdown';\n import { useBreakpoints } from '@vueuse/core';\n import { useI18n } from '@/utils/ts/i18n';\n import { type BentoListboxOptions } from '@/types/listbox';\n import { BMediaQuerySMax } from '@adyen/bento-design-tokens/dist/js/bento/es6';\n\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n\n const breakpoints = useBreakpoints({\n s: BMediaQuerySMax,\n });\n\n const isMobile = breakpoints.smallerOrEqual('s');\n const props = defineProps<{\n /**\n * An array containing all the items on the nav. The array can have either {@see BentoSecondaryNavItemsCategory },\n * which is used to group different items or {@see BentoSecondaryNavItemsItem } if you don't need to group them.\n */\n items: BentoSecondaryNavItems;\n /**\n * The value of the selected item.\n * If nothing is passed, it defaults to the first item value in items.\n */\n value?: string;\n }>();\n\n const emit = defineEmits<{\n /**\n * Emmited when the current selected item changes\n */\n (e: 'change', category: string): void;\n }>();\n\n const hasCategories = computed(() => props.items.some(item => Object.hasOwn(item, 'items')));\n const dropdownItems = computed(() => props.items as BentoListboxOptions);\n\n const activeItemValueFallback = computed(() => {\n const firstDropdownItem = (dropdownItems.value as BentoSecondaryNavItems)[0];\n\n if ('items' in firstDropdownItem) {\n return firstDropdownItem.items[0].value;\n } else {\n return firstDropdownItem.value;\n }\n });\n const activeItemValue = ref(props.value ?? activeItemValueFallback.value);\n const updateActiveItemValue = (value: string) => {\n activeItemValue.value = value;\n emit('change', value);\n };\n\n // The component's state is inject on `secondary-nav-item` to determine the\n // current active item and to change its value\n const state: BentoSecondaryNavState = {\n activeItemValue: readonly(activeItemValue),\n updateActiveItemValue,\n };\n\n watch(\n () => props.value,\n value => {\n activeItemValue.value = value;\n }\n );\n\n provide(SECONDARY_NAV_STATE, state);\n</script>\n\n<script lang=\"ts\">\n /**\n * Secondary Nav offers users a structured way to access information.\n * It also provides a clear hierarchy for users to understand and navigate through various information.\n *\n * @example\n * import { BentoSecondaryNav } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoSecondaryNav },\n * template: `\n * <bento-secondary-nav :value=\"value\" :items=\"items\" />\n * `,\n * setup() {\n * const value = ref(2) // Active item value\n * const items: BentoSecondaryNavItemInfo[] = [\n * { label: 'Option 1', value: 1 },\n * { label: 'Option 2', value: 2 },\n * ];\n * return { items, value };\n * }\n * }\n */\n export default {\n i18n: { messages },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./secondary-nav.scss\" />\n"],"names":["SECONDARY_NAV_STATE","__default__$2","activeItemValue","updateActiveItemValue","inject","props","__props","isItemSelected","computed","conditionalClasses","emit","__emit","onClick","e","__default__$1","__default__","messages","t","useI18n","isMobile","useBreakpoints","BMediaQuerySMax","hasCategories","item","dropdownItems","activeItemValueFallback","firstDropdownItem","ref","value","state","readonly","watch","provide"],"mappings":";;;;;;;;AAGa,MAAAA,IAAA,O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AAA,MAAA,MAAA1B,EAAA;AAAA,MACgB,CAAAuB,MAAA;AAER,QAAA1B,EAAA,QAAA0B;AAAA,MAAwB;AAAA,IAC5B,GAGJI,EAAAhC,GAAA6B,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,50 +0,0 @@
1
- import { defineComponent as d, useSlots as m, computed as l, withDirectives as f, createElementBlock as b, openBlock as _, unref as o, normalizeClass as v, createVNode as g, withCtx as h, createTextVNode as E, toDisplayString as x } from "vue";
2
- import { B as C } from "./typography.yBEME_Gu.js";
3
- import { b as R } from "./tooltip.Dp9_ESm_.js";
4
- import { u as S } from "./aria-label.CaUURpnB.js";
5
- import { g as n } from "./get-slot-text.DQlZEsId.js";
6
- import { _ as w } from "./_plugin-vue_export-helper.CHgC5LLL.js";
7
- import "../assets/tag.css";
8
- var u = /* @__PURE__ */ ((t) => (t.GREY = "grey", t.BLUE = "blue", t.GREEN = "green", t.ORANGE = "orange", t.RED = "red", t.WHITE = "white", t))(u || {});
9
- const y = ["aria-label"], D = {
10
- name: "bento-tag"
11
- }, G = /* @__PURE__ */ d({
12
- ...D,
13
- props: {
14
- label: { default: null },
15
- truncate: { default: null },
16
- variant: { default: u.GREY }
17
- },
18
- setup(t) {
19
- const e = t, r = m(), c = S({
20
- label: e.label || n(r)("default"),
21
- defaultFallback: "tag"
22
- }), i = l(() => ({
23
- [`b-tag--${e.variant}`]: e.variant
24
- })), a = l(() => e.label ?? n(r)("default") ?? "tag"), s = l(() => e.truncate && a.value.length > e.truncate), p = l(() => e.truncate && s.value ? `${a.value.slice(0, e.truncate)}...` : a.value);
25
- return (N, k) => f((_(), b("span", {
26
- "data-testid": "tag",
27
- class: v(["b-tag", i.value]),
28
- "aria-label": o(c)
29
- }, [
30
- g(o(C), {
31
- class: "b-tag__label",
32
- el: "span",
33
- variant: "caption",
34
- stronger: ""
35
- }, {
36
- default: h(() => [
37
- E(x(p.value), 1)
38
- ]),
39
- _: 1
40
- })
41
- ], 10, y)), [
42
- [o(R), s.value ? a.value : null]
43
- ]);
44
- }
45
- }), Y = /* @__PURE__ */ w(G, [["__scopeId", "data-v-7f6d5beb"]]);
46
- export {
47
- Y as B,
48
- u as a
49
- };
50
- //# sourceMappingURL=tag.CEmpyuYX.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tag.CEmpyuYX.js","sources":["../../../vue2/src/components/tag/tag.types.ts","../../../vue2/src/components/tag/tag.vue"],"sourcesContent":["export interface BentoTagProps {\n /**\n * The label text content of the Tag.\n */\n label?: string;\n\n /**\n * The number of characters to limit the number of displayed characters for the tag text, truncating it with an ellipsis of three dots \"...\".\n */\n truncate?: number;\n\n /**\n * The variant variant of tag\n */\n variant?: BentoTagVariant | `${BentoTagVariant}`;\n}\n\n/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoTagVariant {\n GREY = 'grey',\n BLUE = 'blue',\n GREEN = 'green',\n ORANGE = 'orange',\n RED = 'red',\n WHITE = 'white',\n}\n","<template>\n <span\n v-bento-tooltip-directive=\"shouldShowTooltip ? textFromSlot : null\"\n data-testid=\"tag\"\n class=\"b-tag\"\n :class=\"tagConditionalClasses\"\n :aria-label=\"computedAriaLabel\"\n >\n <bento-typography class=\"b-tag__label\" el=\"span\" variant=\"caption\" stronger>\n {{ formattedText }}\n </bento-typography>\n </span>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, useSlots } from 'vue';\n // Use relative paths otherwise the interface won't be correctly detected\n // TODO: Use alias once the support is added to work with the betterDefine macro\n import { type BentoTagProps, BentoTagVariant } from './tag.types';\n import { BentoTypography } from '@/components/typography';\n import { BentoTooltipDirective as vBentoTooltipDirective } from '@/directives';\n import { useAriaLabel } from '@/utils/ts/aria-label';\n import { getSlotText } from '@/utils/ts/get-slot-text';\n\n const props = withDefaults(defineProps<BentoTagProps>(), {\n label: null,\n truncate: null,\n variant: BentoTagVariant.GREY,\n });\n\n const slots = useSlots();\n\n const computedAriaLabel = useAriaLabel({\n label: props.label || getSlotText(slots)('default'),\n defaultFallback: 'tag',\n });\n\n const tagConditionalClasses = computed(() => ({\n [`b-tag--${props.variant}`]: props.variant,\n }));\n\n const textFromSlot = computed(() => props.label ?? getSlotText(slots)('default') ?? 'tag');\n const shouldShowTooltip = computed(() => props.truncate && textFromSlot.value.length > props.truncate);\n\n const formattedText = computed(() => {\n if (!props.truncate) {\n return textFromSlot.value;\n }\n\n return shouldShowTooltip.value ? `${textFromSlot.value.slice(0, props.truncate)}...` : textFromSlot.value;\n });\n</script>\n\n<script lang=\"ts\">\n export default {\n name: 'bento-tag',\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./tag.scss\" />\n"],"names":["BentoTagVariant","BentoTagVariant2","__default__","props","__props","slots","useSlots","computedAriaLabel","useAriaLabel","getSlotText","tagConditionalClasses","computed","textFromSlot","shouldShowTooltip","formattedText"],"mappings":";;;;;;;AAoBY,IAAAA,IAAA,kBAAAC,OACRA,EAAA,OAAA,QACAA,EAAA,OAAA,QACAA,EAAA,QAAA,SACAA,EAAA,SAAA,UACAA,EAAA,MAAA,OACAA,EAAA,QAAA,SANQA,IAAAD,KAAA,CAAA,CAAA;0BCkCRE,IAAA;AAAA,EAAe,MAAA;AAEf;;;;;;;;AAhCA,UAAAC,IAAAC,GAMAC,IAAAC,EAAA,GAEAC,IAAAC,EAAA;AAAA,MAAuC,OAAAL,EAAA,SAAAM,EAAAJ,CAAA,EAAA,SAAA;AAAA,MACe,iBAAA;AAAA,IACjC,CAAA,GAGrBK,IAAAC,EAAA,OAAA;AAAA,MAA8C,CAAA,UAAAR,EAAA,OAAA,EAAA,GAAAA,EAAA;AAAA,IACP,EAAA,GAGvCS,IAAAD,EAAA,MAAAR,EAAA,SAAAM,EAAAJ,CAAA,EAAA,SAAA,KAAA,KAAA,GACAQ,IAAAF,EAAA,MAAAR,EAAA,YAAAS,EAAA,MAAA,SAAAT,EAAA,QAAA,GAEAW,IAAAH,EAAA,MACIR,EAAA,YAIAU,EAAA,QAAA,GAAAD,EAAA,MAAA,MAAA,GAAAT,EAAA,QAAA,CAAA,QAHIS,EAAA,KAGgG;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,246 +0,0 @@
1
- import { defineComponent as _e, useAttrs as Le, toRefs as $, ref as u, toRef as Ee, computed as s, watch as U, nextTick as xe, onMounted as Ce, onUnmounted as Re, createElementBlock as z, openBlock as c, normalizeClass as E, createElementVNode as S, normalizeStyle as q, createVNode as w, createBlock as h, createCommentVNode as d, unref as l, withCtx as x, createTextVNode as Y, toDisplayString as V, withKeys as M } from "vue";
2
- import { B as Ae } from "./button.DhcxX2GJ.js";
3
- import { B as N } from "./typography.yBEME_Gu.js";
4
- import { C as Be } from "./cross-circle-fill-small.Dv5-PxwF.js";
5
- import { g as Ie } from "./generate-uid.NJ8tVoha.js";
6
- import { o as G } from "./resize.Bqks3WUm.js";
7
- import { u as ke } from "./aria-label.CaUURpnB.js";
8
- import { u as De } from "./index.pdBj0KQU.js";
9
- import { u as Ue } from "./use-form-layout-loading.D3lALhtC.js";
10
- import { B as Se } from "./es6.MoTTyETW.js";
11
- import { F as we, E as X } from "./field-label.C97CrBI_.js";
12
- import { _ as Me } from "./_plugin-vue_export-helper.CHgC5LLL.js";
13
- import "../assets/textarea.css";
14
- var p = /* @__PURE__ */ ((t) => (t.CLEARABLE = "clearable", t.DISABLED = "disabled", t.ERROR = "error", t.READONLY = "readonly", t))(p || {}), i = /* @__PURE__ */ ((t) => (t.BLUR = "blur", t.CHANGE = "change", t.CLEAR = "clear", t.ESCAPE_PRESSED = "escape-pressed", t.FOCUS = "focus", t.INPUT = "input", t.KEYDOWN = "keydown", t.KEYUP = "keyup", t))(i || {});
15
- const j = {
16
- "en-US": {
17
- clearText: "Clear text",
18
- textarea: "textarea",
19
- yourTextCanBenAtMost: "Your text can be at most {characterLimit} characters"
20
- }
21
- }, Ne = ["id", "value", "aria-label", "aria-invalid", "readonly", "required", "disabled", "placeholder"], Pe = {
22
- key: 0,
23
- class: "b-textarea__clear-button"
24
- }, Fe = parseFloat(Se), He = {
25
- i18n: { messages: j },
26
- name: "bento-textarea"
27
- }, Ke = /* @__PURE__ */ _e({
28
- ...He,
29
- props: {
30
- ariaLabel: { default: void 0 },
31
- characterLimit: { default: void 0 },
32
- clearable: { type: Boolean, default: !1 },
33
- height: { default: null },
34
- resizable: { default: "both" },
35
- value: { default: "" },
36
- description: { default: "" },
37
- disabled: { type: Boolean, default: !1 },
38
- errorMessage: { default: "" },
39
- label: { default: "" },
40
- optional: { type: Boolean, default: !1 },
41
- placeholder: { default: "" },
42
- readonly: { type: Boolean, default: !1 },
43
- required: { type: Boolean, default: !1 },
44
- tooltipText: { default: null }
45
- },
46
- setup(t, { expose: J, emit: Q }) {
47
- const Z = Le(), a = t, n = Q, { height: C } = $(a), P = Ie("textarea"), o = u(null), f = u(null), r = u(a.value), v = 44, m = u(a.height || `${v}px`), F = u(0), R = u("100%"), A = u(!1);
48
- let y = null, g = null;
49
- const { t: H, n: K } = De({ messages: j }), { isReadOnly: _ } = Ue(Ee(a, "readonly")), ee = s(() => {
50
- var e;
51
- return `${K(((e = r == null ? void 0 : r.value) == null ? void 0 : e.length) ?? 0)} / ${K(a.characterLimit)}`;
52
- }), L = s(() => !C.value), B = s(
53
- () => a.characterLimit && r.value.length > a.characterLimit
54
- ), I = () => {
55
- if (o.value) {
56
- const e = Math.max(
57
- o.value.scrollHeight <= v ? v : o.value.scrollHeight + Fe * 2,
58
- F.value,
59
- v
60
- );
61
- m.value = `${e}px`;
62
- }
63
- };
64
- U(C, () => {
65
- L.value ? I() : m.value = C.value;
66
- }), U(
67
- () => a.value,
68
- () => {
69
- r.value = a.value;
70
- },
71
- { immediate: !0 }
72
- ), U(
73
- () => r.value,
74
- async () => {
75
- if (L.value) {
76
- if (m.value = `${v}px`, !r.value)
77
- return;
78
- await xe(), I();
79
- }
80
- },
81
- { immediate: !0 }
82
- );
83
- const O = s(() => !!a.errorMessage || B.value), ae = s(() => ({
84
- [`b-textarea--${p.DISABLED}`]: a.disabled
85
- })), te = s(() => ({
86
- [`b-textarea__input--${p.CLEARABLE}`]: a.clearable,
87
- [`b-textarea__input--${p.READONLY}`]: _.value,
88
- [`b-textarea__input--${p.ERROR}`]: O.value,
89
- "b-textarea__input--dynamic-height": L.value
90
- })), le = s(() => ({
91
- "b-textarea__label-box--no-label": !a.label
92
- })), oe = s(() => ({
93
- [`b-textarea__label-item--${p.ERROR}`]: B.value
94
- })), re = s(() => H("yourTextCanBenAtMost", { characterLimit: a.characterLimit })), se = u(Z["aria-label"]), { ariaLabel: ie, label: k } = $(a), ne = ke({
95
- ariaLabel: se.value,
96
- // TODO: take this line away when the aria-label props is removed
97
- label: ie,
98
- defaultFallback: k
99
- }), ue = s(
100
- () => a.clearable && r.value && !a.disabled && !_.value
101
- ), D = () => {
102
- r.value = "", n(i.CLEAR), n(i.INPUT, "");
103
- }, ce = (e) => {
104
- e.stopImmediatePropagation(), !a.disabled && !_.value && (r.value = e.target.value, n(i.INPUT, r.value));
105
- }, de = () => {
106
- o.value.scrollTop = 0, n(i.BLUR);
107
- }, pe = () => {
108
- o.value.focus(), n(i.FOCUS);
109
- }, fe = () => {
110
- n(i.CHANGE);
111
- }, ve = () => {
112
- n(i.ESCAPE_PRESSED);
113
- }, me = (e) => {
114
- e.stopPropagation(), n(i.KEYDOWN, e);
115
- }, be = (e) => {
116
- e.stopPropagation(), n(i.KEYUP, e);
117
- }, he = () => {
118
- A.value = !0;
119
- }, ye = () => {
120
- A.value = !1;
121
- }, T = (e = !1) => {
122
- var W;
123
- const b = o.value.style.width;
124
- if (o.value.style.height && (A.value && (F.value = parseInt(o.value.style.height, 10)), m.value = o.value.style.height), e && !b)
125
- return;
126
- const ge = (W = f == null ? void 0 : f.value) == null ? void 0 : W.offsetWidth;
127
- !b || parseInt(b, 10) > ge ? R.value = "100%" : R.value = b;
128
- };
129
- return J({
130
- focus: () => {
131
- o.value.focus();
132
- }
133
- }), Ce(() => {
134
- y = G(o.value, () => {
135
- T(!0);
136
- }), g = G(f.value, () => {
137
- T();
138
- }), L.value && I();
139
- }), Re(() => {
140
- y == null || y.disconnect(), g == null || g.disconnect();
141
- }), (e, b) => (c(), z("div", {
142
- ref_key: "textareaComponent",
143
- ref: f,
144
- class: E(["b-textarea", ae.value])
145
- }, [
146
- S("div", {
147
- style: q({ width: R.value })
148
- }, [
149
- S("div", {
150
- class: E(["b-textarea__label-box", le.value])
151
- }, [
152
- l(k) ? (c(), h(l(we), {
153
- key: 0,
154
- for: l(P),
155
- label: l(k),
156
- "tooltip-text": e.tooltipText,
157
- optional: e.optional,
158
- required: e.required
159
- }, null, 8, ["for", "label", "tooltip-text", "optional", "required"])) : d("", !0),
160
- e.characterLimit ? (c(), h(l(N), {
161
- key: 1,
162
- el: "span",
163
- class: E(["b-textarea__label-item", oe.value])
164
- }, {
165
- default: x(() => [
166
- Y(V(ee.value), 1)
167
- ]),
168
- _: 1
169
- }, 8, ["class"])) : d("", !0)
170
- ], 2),
171
- w(l(N), {
172
- el: "div",
173
- class: "b-textarea__input-box",
174
- "aria-disabled": e.disabled
175
- }, {
176
- default: x(() => [
177
- S("textarea", {
178
- id: l(P),
179
- ref_key: "textareaElement",
180
- ref: o,
181
- value: r.value,
182
- class: E(["b-textarea__input", te.value]),
183
- "aria-label": l(ne),
184
- "aria-invalid": O.value,
185
- readonly: l(_),
186
- required: e.required,
187
- disabled: e.disabled,
188
- placeholder: e.placeholder,
189
- style: q({ resize: e.resizable, height: m.value }),
190
- onBlur: de,
191
- onChange: fe,
192
- onFocus: pe,
193
- onInput: ce,
194
- onKeydown: [
195
- M(ve, ["esc"]),
196
- me
197
- ],
198
- onKeyup: be,
199
- onMousedown: he,
200
- onMouseup: ye
201
- }, " ", 46, Ne),
202
- ue.value ? (c(), z("div", Pe, [
203
- w(l(Ae), {
204
- variant: "tertiary",
205
- disabled: e.disabled,
206
- onClick: D,
207
- onKeypress: M(D, ["enter"]),
208
- onKeyup: M(D, ["space"])
209
- }, {
210
- iconLeft: x(() => [
211
- w(l(Be), {
212
- "svg-title": l(H)("clearText")
213
- }, null, 8, ["svg-title"])
214
- ]),
215
- _: 1
216
- }, 8, ["disabled"])
217
- ])) : d("", !0)
218
- ]),
219
- _: 1
220
- }, 8, ["aria-disabled"]),
221
- B.value ? (c(), h(l(X), {
222
- key: 0,
223
- "error-message": re.value
224
- }, null, 8, ["error-message"])) : d("", !0),
225
- e.errorMessage ? (c(), h(l(X), {
226
- key: 1,
227
- "error-message": e.errorMessage
228
- }, null, 8, ["error-message"])) : d("", !0),
229
- e.description ? (c(), h(l(N), {
230
- key: 2,
231
- class: "b-textarea__description",
232
- el: "span"
233
- }, {
234
- default: x(() => [
235
- Y(V(e.description), 1)
236
- ]),
237
- _: 1
238
- })) : d("", !0)
239
- ], 4)
240
- ], 2));
241
- }
242
- }), Ze = /* @__PURE__ */ Me(Ke, [["__scopeId", "data-v-37b20a73"]]);
243
- export {
244
- Ze as B
245
- };
246
- //# sourceMappingURL=textarea.C1jkfowf.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"textarea.C1jkfowf.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 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 */\n value?: 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 :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\n // Composables\n import { useFormLayoutFieldLoading } from '@/composables/use-form-layout-loading/use-form-layout-loading';\n\n // Constants\n import { BTextareaInputFocusBorderWidth } 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 });\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 (e: BentoTextareaEvent.INPUT, 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.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 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,\n () => {\n textareaValue.value = 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 emit(BentoTextareaEvent.INPUT, '');\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 emit(BentoTextareaEvent.INPUT, 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\n onUnmounted(() => {\n textareaElementObserver?.disconnect();\n textareaComponentObserver?.disconnect();\n });\n</script>\n\n<script lang=\"ts\">\n const TEXTAREA_BORDER_WIDTH = parseFloat(BTextareaInputFocusBorderWidth);\n\n export default {\n i18n: { messages },\n name: 'bento-textarea',\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./textarea.scss\" />\n"],"names":["BentoTextareaStateClass","BentoTextareaStateClass2","BentoTextareaEvent","BentoTextareaEvent2","TEXTAREA_BORDER_WIDTH","BTextareaInputFocusBorderWidth","__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","counter","computed","_a","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","onUnmounted"],"mappings":";;;;;;;;;;;;;AAYY,IAAAA,IAAA,kBAAAC,OACRA,EAAA,YAAA,aACAA,EAAA,WAAA,YACAA,EAAA,QAAA,SACAA,EAAA,WAAA,YAJQA,IAAAD,KAAA,CAAA,CAAA,GAOAE,IAAA,kBAAAC,OACRA,EAAA,OAAA,QACAA,EAAA,SAAA,UACAA,EAAA,QAAA,SACAA,EAAA,iBAAA,kBACAA,EAAA,QAAA,SACAA,EAAA,QAAA,SACAA,EAAA,UAAA,WACAA,EAAA,QAAA,SARQA,IAAAD,KAAA,CAAA,CAAA;;;;;;;;;;GC8XRE,KAAA,WAAAC,EAAA,GAEAC,KAAA;AAAA,EAAe,MAAA,EAAA,UAAAC,EAAA;AAAA,EACM,MAAA;AAErB;;;;;;;;;;;;;;;;;;;;AAjTA,UAAAC,IAAAC,GAAA,GAEAC,IAAAC,GAkBAC,IAAAC,GA0CA,EAAA,QAAAC,EAAA,IAAAC,EAAAL,CAAA,GAEAM,IAAAC,GAAA,UAAA,GACAC,IAAAC,EAAA,IAAA,GACAC,IAAAD,EAAA,IAAA,GACAE,IAAAF,EAAAT,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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