@adyen/bento-vue2 1.9.0 → 1.11.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.
- package/dist/@types/components.d.ts +2 -0
- package/dist/@types/packages/vue2/src/components/button/button.vue.d.ts +19 -3580
- package/dist/@types/packages/vue2/src/components/button/components/button-actions/button-actions.types.d.ts +2 -0
- package/dist/@types/packages/vue2/src/components/button/components/loading-button/loading-button.vue.d.ts +3 -3
- package/dist/@types/packages/vue2/src/components/checkbox/checkbox.vue.d.ts +2 -0
- package/dist/@types/packages/vue2/src/components/checkbox/components/checkbox-group/checkbox-group.vue.d.ts +2 -0
- package/dist/@types/packages/vue2/src/components/code-snippet/{composables/useLanguage.d.ts → utils/get-lang-loader.d.ts} +1 -3
- package/dist/@types/packages/vue2/src/components/country/composables/index.d.ts +3 -3
- package/dist/@types/packages/vue2/src/components/country/composables/{useCountryCapital/useCountryCapital.d.ts → use-country-capital/use-country-capital.d.ts} +1 -1
- package/dist/@types/packages/vue2/src/components/country/composables/{useCountryName/useCountryName.d.ts → use-country-name/use-country-name.d.ts} +1 -1
- package/dist/@types/packages/vue2/src/components/country/composables/{useCountryPhoneCode/useCountryPhoneCode.d.ts → use-country-phone-code/use-country-phon-code.d.ts} +1 -1
- package/dist/@types/packages/vue2/src/components/country/country.vue.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/data-grid/components/data-grid-cell-actions/data-grid-cell-actions.types.d.ts +14 -0
- package/dist/@types/packages/vue2/src/components/data-grid/components/data-grid-cell-actions/data-grid-cell-actions.vue.d.ts +33 -0
- package/dist/@types/packages/vue2/src/components/data-grid/components/data-grid-columns/data-grid-columns-types.d.ts +1 -0
- package/dist/@types/packages/vue2/src/components/data-grid/components/data-grid-columns/data-grid-columns.vue.d.ts +20 -4
- package/dist/@types/packages/vue2/src/components/data-grid/components/index.d.ts +1 -0
- package/dist/@types/packages/vue2/src/components/data-grid/composables/index.d.ts +10 -8
- package/dist/@types/packages/vue2/src/components/data-grid/composables/use-calculate-column-width/index.d.ts +2 -0
- package/dist/@types/packages/vue2/src/components/data-grid/composables/{useCalculateColumnWidth/useCalculateColumnWidth.d.ts → use-calculate-column-width/use-calculate-column-width.d.ts} +2 -2
- package/dist/@types/packages/vue2/src/components/data-grid/composables/use-column-reorderer/use-column-reorderer.d.ts +121 -0
- package/dist/@types/packages/vue2/src/components/data-grid/composables/use-config-settings/use-config-settings.d.ts +154 -0
- package/dist/@types/packages/vue2/src/components/data-grid/composables/{useKeyboardNavigator/useKeyboardNavigator.d.ts → use-keyboard-navigator/use-keyboard-navigator.d.ts} +1 -1
- package/dist/@types/packages/vue2/src/components/data-grid/composables/{useResizer.d.ts → use-resizer.d.ts} +0 -1
- package/dist/@types/packages/vue2/src/components/data-grid/composables/{useScroller/useScroller.d.ts → use-scroller/use-scroller.d.ts} +1 -1
- package/dist/@types/packages/vue2/src/components/data-grid/composables/{useSelector.d.ts → use-selector.d.ts} +1 -1
- package/dist/@types/packages/vue2/src/components/data-grid/data-grid.types.d.ts +5 -2
- package/dist/@types/packages/vue2/src/components/data-grid/data-grid.vue.d.ts +16 -7
- package/dist/@types/packages/vue2/src/components/divider/divider.keys.d.ts +1 -0
- package/dist/@types/packages/vue2/src/components/divider/divider.vue.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/dropdown/components/dropdown-base-textbox/dropdown-base-textbox.types.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/dropdown/components/dropdown-base-textbox/dropdown-base-textbox.vue.d.ts +3 -3
- package/dist/@types/packages/vue2/src/components/dropdown/components/dropdown-default-textbox/dropdown-default-textbox.vue.d.ts +3 -3
- package/dist/@types/packages/vue2/src/components/dropdown/components/dropdown-options-container/composables/useDropdownOptionsListbox.d.ts +2 -1
- package/dist/@types/packages/vue2/src/components/dropdown/components/dropdown-options-container/dropdown-options-container.vue.d.ts +10 -0
- package/dist/@types/packages/vue2/src/components/dropdown/components/dropdown-small-textbox/dropdown-small-textbox.vue.d.ts +3 -3
- package/dist/@types/packages/vue2/src/components/dropdown/components/variants/dropdown-avatar/dropdown-avatar.vue.d.ts +9 -0
- package/dist/@types/packages/vue2/src/components/dropdown/components/variants/dropdown-country/dropdown-country.vue.d.ts +9 -0
- package/dist/@types/packages/vue2/src/components/dropdown/components/variants/dropdown-currency/dropdown-currency.vue.d.ts +9 -0
- package/dist/@types/packages/vue2/src/components/dropdown/components/variants/dropdown-payment-method/dropdown-payment-method.vue.d.ts +9 -0
- package/dist/@types/packages/vue2/src/components/dropdown/components/variants/dropdown-tag/dropdown-tag.vue.d.ts +9 -0
- package/dist/@types/packages/vue2/src/components/dropdown/composables/useDisplayValue.types.d.ts +1 -0
- package/dist/@types/packages/vue2/src/components/dropdown/dropdown.vue.d.ts +1598 -6
- package/dist/@types/packages/vue2/src/components/empty-state/empty-state.types.d.ts +1 -0
- package/dist/@types/packages/vue2/src/components/empty-state/empty-state.vue.d.ts +3 -3
- package/dist/@types/packages/vue2/src/components/filter-bar/components/all-filters-modal/all-filters-modal.vue.d.ts +84 -12
- package/dist/@types/packages/vue2/src/components/filter-bar/components/select-filter/variants/select-country-filter/select-country-filter.vue.d.ts +2 -0
- package/dist/@types/packages/vue2/src/components/filter-bar/components/select-filter/variants/select-tag-filter/select-tag-filter.vue.d.ts +2 -0
- package/dist/@types/packages/vue2/src/components/filter-bar/filter-bar.types.d.ts +3 -1
- package/dist/@types/packages/vue2/src/components/internal/controls-group/controls-group.vue.d.ts +8 -0
- package/dist/@types/packages/vue2/src/components/internal/copy/copy.types.d.ts +8 -0
- package/dist/@types/packages/vue2/src/components/internal/copy/copy.vue.d.ts +20 -0
- package/dist/@types/packages/vue2/src/components/internal/copy/index.d.ts +1 -0
- package/dist/@types/packages/vue2/src/components/internal/listbox/components/listbox-multi-select/components/listbox-multi-select-options/components/listbox-multi-select-category/listbox-multi-select-category.types.d.ts +2 -1
- package/dist/@types/packages/vue2/src/components/internal/listbox/components/listbox-multi-select/components/listbox-multi-select-options/components/listbox-multi-select-category/listbox-multi-select-category.vue.d.ts +82 -0
- package/dist/@types/packages/vue2/src/components/internal/listbox/components/listbox-multi-select/components/listbox-multi-select-options/listbox-multi-select-options.vue.d.ts +10 -0
- package/dist/@types/packages/vue2/src/components/internal/listbox/components/listbox-multi-select/listbox-multi-select.vue.d.ts +9 -0
- package/dist/@types/packages/vue2/src/components/internal/listbox/components/listbox-single-select/components/listbox-single-select-category/index.d.ts +1 -0
- package/dist/@types/packages/vue2/src/components/internal/listbox/components/listbox-single-select/components/listbox-single-select-category/listbox-single-select-category.vue.d.ts +12 -0
- package/dist/@types/packages/vue2/src/components/internal/listbox/components/listbox-single-select/listbox-single-select.vue.d.ts +10 -0
- package/dist/@types/packages/vue2/src/components/internal/listbox/composables/use-multi-level-items/use-multi-level-items.d.ts +6 -0
- package/dist/@types/packages/vue2/src/components/internal/listbox/index.d.ts +1 -0
- package/dist/@types/packages/vue2/src/components/internal/listbox/listbox.vue.d.ts +12 -3
- package/dist/@types/packages/vue2/src/components/menu/components/menu-item/menu-item.types.d.ts +1 -0
- package/dist/@types/packages/vue2/src/components/menu/components/menu-item/menu-item.vue.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/menu/components/sub-menu-item-list/sub-menu-item-list.vue.d.ts +2 -0
- package/dist/@types/packages/vue2/src/components/menu/menu.vue.d.ts +1 -0
- package/dist/@types/packages/vue2/src/components/modal/components/base-modal/base-modal.vue.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/modal/components/modal-dialog/modal-dialog.vue.d.ts +251 -3
- package/dist/@types/packages/vue2/src/components/radio-group/radio-group.vue.d.ts +1 -0
- package/dist/@types/packages/vue2/src/components/secondary-nav/components/secondary-nav-category/index.d.ts +1 -0
- package/dist/@types/packages/vue2/src/components/secondary-nav/components/secondary-nav-category/secondary-nav-category.vue.d.ts +18 -0
- package/dist/@types/packages/vue2/src/components/secondary-nav/components/secondary-nav-item/index.d.ts +1 -0
- package/dist/@types/packages/vue2/src/components/secondary-nav/components/secondary-nav-item/secondary-nav-item.vue.d.ts +19 -0
- package/dist/@types/packages/vue2/src/components/secondary-nav/index.d.ts +2 -0
- package/dist/@types/packages/vue2/src/components/secondary-nav/secondary-nav.keys.d.ts +3 -0
- package/dist/@types/packages/vue2/src/components/secondary-nav/secondary-nav.types.d.ts +14 -0
- package/dist/@types/packages/vue2/src/components/secondary-nav/secondary-nav.vue.d.ts +20 -0
- package/dist/@types/packages/vue2/src/components/structured-list/components/structered-list-item/structured-list-item.vue.d.ts +3 -4
- package/dist/@types/packages/vue2/src/components/structured-list/structured-list.types.d.ts +2 -0
- package/dist/@types/packages/vue2/src/components/structured-list/structured-list.vue.d.ts +16 -3
- package/dist/@types/packages/vue2/src/components/timeline/components/timeline-item/timeline-item.vue.d.ts +15 -10
- package/dist/@types/packages/vue2/src/components/timeline/timeline.types.d.ts +9 -0
- package/dist/@types/packages/vue2/src/index.d.ts +1 -0
- package/dist/@types/packages/vue2/src/types/elements.d.ts +2 -1
- package/dist/@types/packages/vue2/src/utils/ts/deprecate.d.ts +1 -0
- package/dist/accordion.js +2 -2
- package/dist/action-bar.js +5 -5
- package/dist/alert.js +8 -8
- package/dist/alert.js.map +1 -1
- package/dist/assets/base-modal.css +1 -1
- package/dist/assets/button.css +1 -1
- package/dist/assets/checkbox.css +1 -1
- package/dist/assets/controls-group.css +1 -1
- package/dist/assets/copy.css +1 -1
- package/dist/assets/dropdown-default-textbox.css +1 -1
- package/dist/assets/dropdown.css +1 -1
- package/dist/assets/fixed-scroller.css +1 -1
- package/dist/assets/index10.css +1 -1
- package/dist/assets/index11.css +1 -1
- package/dist/assets/index12.css +1 -1
- package/dist/assets/index13.css +1 -1
- package/dist/assets/index14.css +1 -1
- package/dist/assets/index15.css +1 -1
- package/dist/assets/index16.css +1 -1
- package/dist/assets/index17.css +1 -1
- package/dist/assets/index18.css +1 -1
- package/dist/assets/index19.css +1 -1
- package/dist/assets/index2.css +1 -1
- package/dist/assets/index20.css +1 -1
- package/dist/assets/index21.css +1 -1
- package/dist/assets/index22.css +1 -1
- package/dist/assets/index24.css +1 -1
- package/dist/assets/index25.css +1 -1
- package/dist/assets/index26.css +1 -1
- package/dist/assets/index27.css +1 -1
- package/dist/assets/index28.css +1 -1
- package/dist/assets/index29.css +1 -1
- package/dist/assets/index3.css +1 -1
- package/dist/assets/index30.css +1 -1
- package/dist/assets/index31.css +1 -1
- package/dist/assets/index32.css +1 -1
- package/dist/assets/index33.css +1 -1
- package/dist/assets/index34.css +1 -1
- package/dist/assets/index35.css +1 -1
- package/dist/assets/index36.css +1 -1
- package/dist/assets/index37.css +1 -1
- package/dist/assets/index38.css +1 -1
- package/dist/assets/index39.css +1 -1
- package/dist/assets/index4.css +1 -1
- package/dist/assets/index40.css +1 -1
- package/dist/assets/index41.css +1 -1
- package/dist/assets/index42.css +1 -1
- package/dist/assets/index43.css +1 -1
- package/dist/assets/index44.css +1 -1
- package/dist/assets/index45.css +1 -1
- package/dist/assets/index46.css +1 -0
- package/dist/assets/index5.css +1 -1
- package/dist/assets/index6.css +1 -1
- package/dist/assets/index7.css +1 -1
- package/dist/assets/index8.css +1 -1
- package/dist/assets/index9.css +1 -1
- package/dist/assets/listbox.css +1 -1
- package/dist/assets/loading-button.css +1 -1
- package/dist/avatar-image.js +1 -1
- package/dist/button.js +19 -17
- package/dist/button.js.map +1 -1
- package/dist/card.js +2 -2
- package/dist/checkbox.js +61 -48
- package/dist/checkbox.js.map +1 -1
- package/dist/chunks/{base-button.df9a9bea.js → base-button.bd61ab14.js} +2 -2
- package/dist/chunks/{base-button.df9a9bea.js.map → base-button.bd61ab14.js.map} +1 -1
- package/dist/chunks/{base-modal.75319f4e.js → base-modal.5640a66a.js} +33 -33
- package/dist/chunks/base-modal.5640a66a.js.map +1 -0
- package/dist/chunks/{button-actions-with-menu.32770485.js → button-actions-with-menu.767344df.js} +3 -3
- package/dist/chunks/{button-actions-with-menu.32770485.js.map → button-actions-with-menu.767344df.js.map} +1 -1
- package/dist/chunks/button.bb5b4909.js +100 -0
- package/dist/chunks/button.bb5b4909.js.map +1 -0
- package/dist/chunks/{calendar.a885d8fc.js → calendar.4ab3c2dc.js} +4 -4
- package/dist/chunks/{calendar.a885d8fc.js.map → calendar.4ab3c2dc.js.map} +1 -1
- package/dist/chunks/checkbox.c684c20a.js +188 -0
- package/dist/chunks/checkbox.c684c20a.js.map +1 -0
- package/dist/chunks/{controls-group.dd967ccf.js → controls-group.d25f5044.js} +15 -11
- package/dist/chunks/controls-group.d25f5044.js.map +1 -0
- package/dist/chunks/copy.36c058e9.js +122 -0
- package/dist/chunks/copy.36c058e9.js.map +1 -0
- package/dist/chunks/country.types.002caff2.js +5871 -0
- package/dist/chunks/country.types.002caff2.js.map +1 -0
- package/dist/chunks/{cross-circle-fill.7c07d16a.js → cross-circle-fill.27580c4b.js} +5 -5
- package/dist/chunks/{cross-circle-fill.7c07d16a.js.map → cross-circle-fill.27580c4b.js.map} +1 -1
- package/dist/chunks/{dropdown-default-textbox.465db4d4.js → dropdown-default-textbox.1cba89ea.js} +11 -11
- package/dist/chunks/dropdown-default-textbox.1cba89ea.js.map +1 -0
- package/dist/chunks/{dropdown.6461dbe3.js → dropdown.4152cc00.js} +351 -313
- package/dist/chunks/dropdown.4152cc00.js.map +1 -0
- package/dist/chunks/{field-label.01df3cba.js → field-label.a0c54b7d.js} +5 -5
- package/dist/chunks/{field-label.01df3cba.js.map → field-label.a0c54b7d.js.map} +1 -1
- package/dist/chunks/{fixed-scroller.42354ccc.js → fixed-scroller.5c90f692.js} +2 -2
- package/dist/chunks/{fixed-scroller.42354ccc.js.map → fixed-scroller.5c90f692.js.map} +1 -1
- package/dist/chunks/{footer-actions.2cd9079e.js → footer-actions.b14cfca8.js} +3 -3
- package/dist/chunks/{footer-actions.2cd9079e.js.map → footer-actions.b14cfca8.js.map} +1 -1
- package/dist/chunks/{index.16914bb1.js → index.179d485c.js} +29 -29
- package/dist/chunks/{index.16914bb1.js.map → index.179d485c.js.map} +1 -1
- package/dist/chunks/index.1e8c900a.js +32 -0
- package/dist/chunks/index.1e8c900a.js.map +1 -0
- package/dist/chunks/{index.152b2b16.js → index.58282364.js} +3 -3
- package/dist/chunks/{index.152b2b16.js.map → index.58282364.js.map} +1 -1
- package/dist/chunks/{index.322692c8.js → index.720f0cbf.js} +2 -2
- package/dist/chunks/{index.322692c8.js.map → index.720f0cbf.js.map} +1 -1
- package/dist/chunks/index.75f0e99f.js +147 -0
- package/dist/chunks/index.75f0e99f.js.map +1 -0
- package/dist/chunks/{index.6cef7328.js → index.7d2ea1de.js} +2 -2
- package/dist/chunks/{index.6cef7328.js.map → index.7d2ea1de.js.map} +1 -1
- package/dist/chunks/{index.02da8d63.js → index.aaedd8f9.js} +3 -3
- package/dist/chunks/{index.02da8d63.js.map → index.aaedd8f9.js.map} +1 -1
- package/dist/chunks/{index.b201e81d.js → index.b0a89960.js} +22 -22
- package/dist/chunks/index.b0a89960.js.map +1 -0
- package/dist/chunks/{index.d1beb704.js → index.f18f79eb.js} +5 -5
- package/dist/chunks/{index.d1beb704.js.map → index.f18f79eb.js.map} +1 -1
- package/dist/chunks/{index.f358c4bd.js → index.f2223abb.js} +163 -155
- package/dist/chunks/index.f2223abb.js.map +1 -0
- package/dist/chunks/{listbox-option-tag.55cd9c16.js → listbox-option-tag.9103c011.js} +3 -3
- package/dist/chunks/{listbox-option-tag.55cd9c16.js.map → listbox-option-tag.9103c011.js.map} +1 -1
- package/dist/chunks/{listbox.a117e6d4.js → listbox.7cf6d6b4.js} +475 -392
- package/dist/chunks/listbox.7cf6d6b4.js.map +1 -0
- package/dist/chunks/{loading-button.459b9ab4.js → loading-button.fb025a2e.js} +20 -20
- package/dist/chunks/{loading-button.459b9ab4.js.map → loading-button.fb025a2e.js.map} +1 -1
- package/dist/chunks/{tooltip.b8929659.js → tooltip.f48beb54.js} +22 -22
- package/dist/chunks/tooltip.f48beb54.js.map +1 -0
- package/dist/chunks/use-has-slot.fbeb19ec.js.map +1 -1
- package/dist/chunks/useCountryItems.6b7985bf.js +29 -0
- package/dist/chunks/{useCountryItems.34ac8740.js.map → useCountryItems.6b7985bf.js.map} +1 -1
- package/dist/code-snippet.js +10 -12
- package/dist/code-snippet.js.map +1 -1
- package/dist/country.js +41 -5902
- package/dist/country.js.map +1 -1
- package/dist/currency.js +1 -1
- package/dist/data-grid.js +901 -711
- package/dist/data-grid.js.map +1 -1
- package/dist/date-picker.js +18 -18
- package/dist/date-range-picker.js +2 -2
- package/dist/date.js +1 -1
- package/dist/divider.js +2 -18
- package/dist/divider.js.map +1 -1
- package/dist/dropdown.js +41 -41
- package/dist/dropdown.js.map +1 -1
- package/dist/empty-state.js +18 -18
- package/dist/empty-state.js.map +1 -1
- package/dist/filter-bar.js +512 -504
- package/dist/filter-bar.js.map +1 -1
- package/dist/focus-trap.js +1 -1
- package/dist/form-layout.js +2 -2
- package/dist/form-layout.js.map +1 -1
- package/dist/header.js +3 -3
- package/dist/index.js +178 -174
- package/dist/index.js.map +1 -1
- package/dist/info-icon.js +3 -3
- package/dist/input-field.js +4 -4
- package/dist/internal.js +17 -15
- package/dist/link.js +2 -2
- package/dist/loading-indicator.js +1 -1
- package/dist/menu.js +1 -1
- package/dist/modal.js +62 -60
- package/dist/modal.js.map +1 -1
- package/dist/pagination.js +22 -22
- package/dist/pagination.js.map +1 -1
- package/dist/payment-method.js +2 -2
- package/dist/popover.js +1 -1
- package/dist/popper-container.js +1 -1
- package/dist/radio-group.js +46 -45
- package/dist/radio-group.js.map +1 -1
- package/dist/search-bar.js +10 -10
- package/dist/secondary-nav.js +98 -0
- package/dist/secondary-nav.js.map +1 -0
- package/dist/segmented-control.js +3 -3
- package/dist/sidepanel.js +5 -5
- package/dist/status.js +2 -2
- package/dist/stepper.js +3 -3
- package/dist/structured-list.js +1 -1
- package/dist/summary-grid.js +3 -3
- package/dist/tabs.js +3 -3
- package/dist/tag.js +3 -3
- package/dist/textarea.js +95 -88
- package/dist/textarea.js.map +1 -1
- package/dist/timeline.js +198 -191
- package/dist/timeline.js.map +1 -1
- package/dist/toast.js +3 -3
- package/dist/toggle.js +1 -1
- package/dist/tutorial.js +5 -5
- package/dist/typography.js +1 -1
- package/dist/web-types.json +822 -409
- package/package.json +6 -3
- package/dist/@types/packages/vue2/src/components/data-grid/composables/useColumnReorderer/useColumnReorderer.d.ts +0 -67
- package/dist/@types/packages/vue2/src/components/data-grid/composables/useConfigSettings/useConfigSettings.d.ts +0 -73
- package/dist/chunks/base-modal.75319f4e.js.map +0 -1
- package/dist/chunks/button.7dd8d4de.js +0 -125
- package/dist/chunks/button.7dd8d4de.js.map +0 -1
- package/dist/chunks/checkbox.65743b08.js +0 -184
- package/dist/chunks/checkbox.65743b08.js.map +0 -1
- package/dist/chunks/controls-group.dd967ccf.js.map +0 -1
- package/dist/chunks/copy.e12b418e.js +0 -103
- package/dist/chunks/copy.e12b418e.js.map +0 -1
- package/dist/chunks/dropdown-default-textbox.465db4d4.js.map +0 -1
- package/dist/chunks/dropdown.6461dbe3.js.map +0 -1
- package/dist/chunks/index.0890dc99.js +0 -130
- package/dist/chunks/index.0890dc99.js.map +0 -1
- package/dist/chunks/index.b201e81d.js.map +0 -1
- package/dist/chunks/index.f358c4bd.js.map +0 -1
- package/dist/chunks/listbox.a117e6d4.js.map +0 -1
- package/dist/chunks/tooltip.b8929659.js.map +0 -1
- package/dist/chunks/useCountryItems.34ac8740.js +0 -29
- /package/dist/@types/packages/vue2/src/components/data-grid/composables/{useCalculateColumnWidth/useCalculateColumnWidth.types.d.ts → use-calculate-column-width/use-calculate-column-width.types.d.ts} +0 -0
- /package/dist/@types/packages/vue2/src/components/data-grid/composables/{useCalculateStickyElementHeight/useCalculateStickyElementHeight.d.ts → use-calculate-sticky-element-height/use-calculate-sticky-element-height.d.ts} +0 -0
- /package/dist/@types/packages/vue2/src/components/data-grid/composables/{useKeyboardNavigator/useKeyboardNavigator.types.d.ts → use-keyboard-navigator/use-keyboard-navigator.types.d.ts} +0 -0
- /package/dist/@types/packages/vue2/src/components/data-grid/composables/{useLazyLoading/useLazyLoading.d.ts → use-lazy-loading/use-lazy-loading.d.ts} +0 -0
- /package/dist/@types/packages/vue2/src/components/data-grid/composables/{useSorter.d.ts → use-sorter.d.ts} +0 -0
package/dist/textarea.js
CHANGED
|
@@ -1,46 +1,46 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { a as
|
|
3
|
-
import { B as
|
|
4
|
-
import { n as
|
|
5
|
-
import { g as
|
|
6
|
-
import { o as
|
|
7
|
-
import { u as
|
|
8
|
-
import { u as
|
|
9
|
-
import { u as
|
|
10
|
-
import { E as
|
|
11
|
-
import "./assets/
|
|
12
|
-
let
|
|
13
|
-
const
|
|
1
|
+
import { defineComponent as j, useAttrs as J, toRefs as B, ref as u, toRef as K, computed as o, watch as x, nextTick as Q, onMounted as X } from "vue";
|
|
2
|
+
import { a as ee } from "./chunks/button.bb5b4909.js";
|
|
3
|
+
import { B as te } from "./chunks/index.b0a89960.js";
|
|
4
|
+
import { n as F } from "./chunks/_plugin-vue2_normalizer.71e2aa87.js";
|
|
5
|
+
import { g as ae } from "./chunks/unique-id.a2a2b458.js";
|
|
6
|
+
import { o as k } from "./chunks/resize.a041304d.js";
|
|
7
|
+
import { u as re } from "./chunks/aria-label.ac9651a5.js";
|
|
8
|
+
import { u as le } from "./chunks/i18n.eb5b985b.js";
|
|
9
|
+
import { u as se } from "./chunks/use-form-layout-loading.d03e5d48.js";
|
|
10
|
+
import { E as oe, F as ne } from "./chunks/field-label.a0c54b7d.js";
|
|
11
|
+
import "./assets/index19.css";
|
|
12
|
+
let O = 0;
|
|
13
|
+
const ie = {
|
|
14
14
|
beforeCreate() {
|
|
15
|
-
this.uuid =
|
|
15
|
+
this.uuid = O.toString(), O += 1;
|
|
16
16
|
}
|
|
17
17
|
};
|
|
18
|
-
var
|
|
18
|
+
var ue = function() {
|
|
19
19
|
var e = this, a = e._self._c;
|
|
20
20
|
return a("svg", e._b({ staticClass: "ui-assets-icons-16", attrs: { role: "img", xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", fill: "none" } }, "svg", e.$attrs, !1), [e.$attrs["svg-title"] ? a("title", [e._v(e._s(e.$attrs["svg-title"]))]) : e._e(), a("path", { attrs: { fill: "#00112C", d: "M2.25 8C2.25 4.82436 4.82436 2.25 8 2.25C11.1756 2.25 13.75 4.82436 13.75 8C13.75 11.1756 11.1756 13.75 8 13.75C4.82436 13.75 2.25 11.1756 2.25 8ZM7.00011 5.93945L5.93945 7.00011L6.93945 8.00011L5.93945 9.00011L7.00011 10.0608L8.00011 9.06077L9.00011 10.0608L10.0608 9.00011L9.06077 8.00011L10.0608 7.00011L9.00011 5.93945L8.00011 6.93945L7.00011 5.93945Z" } })]);
|
|
21
|
-
},
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
}, ce = [], de = /* @__PURE__ */ F(
|
|
22
|
+
ie,
|
|
23
|
+
ue,
|
|
24
|
+
ce,
|
|
25
25
|
!1,
|
|
26
26
|
null,
|
|
27
27
|
null,
|
|
28
28
|
null,
|
|
29
29
|
null
|
|
30
30
|
);
|
|
31
|
-
const
|
|
32
|
-
var
|
|
33
|
-
const
|
|
31
|
+
const pe = de.exports;
|
|
32
|
+
var C = /* @__PURE__ */ ((r) => (r.HORIZONTAL = "horizontal", r.VERTICAL = "vertical", r.BOTH = "both", r.NONE = "none", r))(C || {}), c = /* @__PURE__ */ ((r) => (r.CLEARABLE = "clearable", r.DISABLED = "disabled", r.ERROR = "error", r.READONLY = "readonly", r))(c || {}), i = /* @__PURE__ */ ((r) => (r.BLUR = "blur", r.CHANGE = "change", r.CLEAR = "clear", r.ESCAPE_PRESSED = "escape-pressed", r.FOCUS = "focus", r.INPUT = "input", r))(i || {});
|
|
33
|
+
const _e = {
|
|
34
34
|
"en-US": {
|
|
35
35
|
clearText: "Clear text",
|
|
36
36
|
textarea: "textarea",
|
|
37
37
|
yourTextCanBenAtMost: "Your text can be at most {characterLimit} characters"
|
|
38
38
|
}
|
|
39
|
-
},
|
|
40
|
-
i18n: { messages:
|
|
39
|
+
}, fe = {
|
|
40
|
+
i18n: { messages: _e },
|
|
41
41
|
name: "bento-textarea"
|
|
42
|
-
},
|
|
43
|
-
...
|
|
42
|
+
}, be = /* @__PURE__ */ j({
|
|
43
|
+
...fe,
|
|
44
44
|
props: {
|
|
45
45
|
/**
|
|
46
46
|
* Text that labels an the input element
|
|
@@ -91,8 +91,8 @@ const ue = {
|
|
|
91
91
|
*/
|
|
92
92
|
resizable: {
|
|
93
93
|
type: String,
|
|
94
|
-
default:
|
|
95
|
-
validator: (
|
|
94
|
+
default: C.BOTH,
|
|
95
|
+
validator: (r) => Object.values(C).includes(r)
|
|
96
96
|
},
|
|
97
97
|
/**
|
|
98
98
|
* Highlights the textarea is required.
|
|
@@ -107,94 +107,101 @@ const ue = {
|
|
|
107
107
|
*/
|
|
108
108
|
value: { type: String, default: "" }
|
|
109
109
|
},
|
|
110
|
-
setup(
|
|
111
|
-
const a =
|
|
112
|
-
() => a.characterLimit &&
|
|
113
|
-
),
|
|
114
|
-
|
|
110
|
+
setup(r, { emit: e }) {
|
|
111
|
+
const a = r, t = J(), { height: l } = B(a), T = ae("textarea"), n = u(null), d = u(null), s = u(a.value), _ = 44, f = u(a.height || `${_}px`), y = u("100%"), { t: L } = le(), { isReadOnly: b } = se(K(a, "readonly")), w = o(() => `${s.value.length} / ${a.characterLimit}`), h = o(
|
|
112
|
+
() => a.characterLimit && s.value.length > a.characterLimit
|
|
113
|
+
), v = () => {
|
|
114
|
+
n.value && n.value.scrollHeight > _ && (f.value = `${n.value.scrollHeight + 3}px`);
|
|
115
115
|
};
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
}),
|
|
116
|
+
x(l, () => {
|
|
117
|
+
l.value ? f.value = l.value : v();
|
|
118
|
+
}), x(
|
|
119
119
|
() => a.value,
|
|
120
120
|
() => {
|
|
121
|
-
|
|
121
|
+
s.value = a.value;
|
|
122
122
|
},
|
|
123
123
|
{ immediate: !0 }
|
|
124
|
-
),
|
|
125
|
-
() =>
|
|
124
|
+
), x(
|
|
125
|
+
() => s.value,
|
|
126
126
|
async () => {
|
|
127
|
-
if (!
|
|
128
|
-
if (
|
|
127
|
+
if (!l.value) {
|
|
128
|
+
if (f.value = `${_}px`, !s.value)
|
|
129
129
|
return;
|
|
130
|
-
await
|
|
130
|
+
await Q(), v();
|
|
131
131
|
}
|
|
132
132
|
},
|
|
133
133
|
{ immediate: !0 }
|
|
134
134
|
);
|
|
135
|
-
const
|
|
135
|
+
const E = o(() => !!a.errorMessage || h.value), M = o(() => ({
|
|
136
136
|
[`b-textarea--${c.DISABLED}`]: a.disabled
|
|
137
|
-
})),
|
|
137
|
+
})), P = o(() => ({
|
|
138
138
|
[`b-textarea__input--${c.CLEARABLE}`]: a.clearable,
|
|
139
|
-
[`b-textarea__input--${c.READONLY}`]:
|
|
140
|
-
[`b-textarea__input--${c.ERROR}`]:
|
|
141
|
-
["b-textarea__input--dynamic-height"]: !
|
|
142
|
-
})),
|
|
139
|
+
[`b-textarea__input--${c.READONLY}`]: b.value,
|
|
140
|
+
[`b-textarea__input--${c.ERROR}`]: E.value,
|
|
141
|
+
["b-textarea__input--dynamic-height"]: !l.value
|
|
142
|
+
})), H = o(() => ({
|
|
143
143
|
["b-textarea__label-box--no-label"]: !a.label
|
|
144
|
-
})),
|
|
145
|
-
[`b-textarea__label-item--${c.ERROR}`]:
|
|
146
|
-
})),
|
|
147
|
-
ariaLabel:
|
|
144
|
+
})), N = o(() => ({
|
|
145
|
+
[`b-textarea__label-item--${c.ERROR}`]: h.value
|
|
146
|
+
})), $ = o(() => L("yourTextCanBenAtMost", { characterLimit: a.characterLimit })), S = u(t["aria-label"]), { ariaLabel: R, label: A } = B(a), W = re({
|
|
147
|
+
ariaLabel: S.value,
|
|
148
148
|
// TODO: take this line away when the aria-label props is removed
|
|
149
|
-
label:
|
|
150
|
-
defaultFallback:
|
|
151
|
-
}),
|
|
152
|
-
() => a.clearable &&
|
|
153
|
-
),
|
|
154
|
-
|
|
155
|
-
},
|
|
156
|
-
|
|
157
|
-
}, U = () => {
|
|
158
|
-
s.value.scrollTop = 0, e(i.BLUR);
|
|
159
|
-
}, D = () => {
|
|
160
|
-
s.value.focus(), e(i.FOCUS);
|
|
161
|
-
}, W = () => {
|
|
162
|
-
e(i.CHANGE);
|
|
149
|
+
label: R,
|
|
150
|
+
defaultFallback: A
|
|
151
|
+
}), U = o(
|
|
152
|
+
() => a.clearable && s.value && !a.disabled && !b.value
|
|
153
|
+
), D = () => {
|
|
154
|
+
s.value = "", e(i.CLEAR), e(i.INPUT, "");
|
|
155
|
+
}, z = (p) => {
|
|
156
|
+
p.stopImmediatePropagation(), !a.disabled && !b.value && (s.value = p.target.value, e(i.INPUT, s.value));
|
|
163
157
|
}, q = () => {
|
|
158
|
+
n.value.scrollTop = 0, e(i.BLUR);
|
|
159
|
+
}, V = () => {
|
|
160
|
+
n.value.focus(), e(i.FOCUS);
|
|
161
|
+
}, Y = () => {
|
|
162
|
+
e(i.CHANGE);
|
|
163
|
+
}, Z = () => {
|
|
164
164
|
e(i.ESCAPE_PRESSED);
|
|
165
|
+
}, g = (p = !1) => {
|
|
166
|
+
var I;
|
|
167
|
+
const m = n.value.style.width;
|
|
168
|
+
if (p && !m)
|
|
169
|
+
return;
|
|
170
|
+
const G = (I = d == null ? void 0 : d.value) == null ? void 0 : I.offsetWidth;
|
|
171
|
+
!m || parseInt(m, 10) > G ? y.value = "100%" : y.value = m;
|
|
165
172
|
};
|
|
166
|
-
return
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
g
|
|
171
|
-
}),
|
|
172
|
-
}), { __sfc: !0, attrs: t, props: a, emit: e, height:
|
|
173
|
+
return X(() => {
|
|
174
|
+
k(n.value, () => {
|
|
175
|
+
g(!0);
|
|
176
|
+
}), k(d.value, () => {
|
|
177
|
+
g();
|
|
178
|
+
}), l.value || v();
|
|
179
|
+
}), { __sfc: !0, attrs: t, props: a, emit: e, height: l, textareaId: T, textareaElement: n, textareaComponent: d, textareaValue: s, defaultTextareaHeight: _, textareaHeight: f, textareaWrapperWidth: y, t: L, isReadOnly: b, counter: w, isOverCharacterLimit: h, calculateHeight: v, invalidInput: E, conditionalClasses: M, conditionalClassesInput: P, conditionalClassesLabelBox: H, conditionalClassesLabelItem: N, counterErrorText: $, ariaLabelAttribute: S, ariaLabel: R, label: A, computedAriaLabel: W, showClearButton: U, onClear: D, onInput: z, onBlur: q, onFocus: V, onChange: Y, onPressEscape: Z, resizeTextareaWrapper: g, BentoButton: ee, BentoTypography: te, ErrorMessage: oe, FieldLabel: ne, CrossCircleFillSmallIcon: pe };
|
|
173
180
|
}
|
|
174
181
|
});
|
|
175
|
-
var
|
|
182
|
+
var ve = function() {
|
|
176
183
|
var e = this, a = e._self._c, t = e._self._setupProxy;
|
|
177
|
-
return a("div", { staticClass: "b-textarea", class: t.conditionalClasses, style: { width: t.
|
|
178
|
-
return !
|
|
179
|
-
} } }), t.showClearButton ? a("div", { staticClass: "b-textarea__clear-button" }, [a(t.BentoButton, { attrs: { variant: "tertiary", disabled: e.disabled }, on: { click: t.onClear, keypress: function(
|
|
180
|
-
return !
|
|
181
|
-
}, keyup: function(
|
|
182
|
-
return !
|
|
184
|
+
return a("div", { ref: "textareaComponent", staticClass: "b-textarea", class: t.conditionalClasses }, [a("div", { style: { width: t.textareaWrapperWidth } }, [a("div", { staticClass: "b-textarea__label-box", class: t.conditionalClassesLabelBox }, [t.label ? a(t.FieldLabel, { attrs: { for: t.textareaId, label: t.label, "tooltip-text": e.tooltipText, optional: e.optional, required: e.required } }) : e._e(), e.characterLimit ? a(t.BentoTypography, { staticClass: "b-textarea__label-item", class: t.conditionalClassesLabelItem, attrs: { el: "span" } }, [e._v(" " + e._s(t.counter) + " ")]) : e._e()], 1), a(t.BentoTypography, { staticClass: "b-textarea__input-box", attrs: { el: "div", "aria-disabled": e.disabled } }, [a("textarea", { ref: "textareaElement", staticClass: "b-textarea__input", class: t.conditionalClassesInput, style: { resize: e.resizable, height: t.textareaHeight }, attrs: { id: t.textareaId, "aria-label": t.computedAriaLabel, "aria-invalid": t.invalidInput, readonly: t.isReadOnly, disabled: e.disabled, placeholder: e.placeholder }, domProps: { value: t.textareaValue }, on: { blur: t.onBlur, change: t.onChange, focus: t.onFocus, input: t.onInput, keydown: function(l) {
|
|
185
|
+
return !l.type.indexOf("key") && e._k(l.keyCode, "esc", 27, l.key, ["Esc", "Escape"]) ? null : t.onPressEscape.apply(null, arguments);
|
|
186
|
+
} } }), t.showClearButton ? a("div", { staticClass: "b-textarea__clear-button" }, [a(t.BentoButton, { attrs: { variant: "tertiary", disabled: e.disabled }, on: { click: t.onClear, keypress: function(l) {
|
|
187
|
+
return !l.type.indexOf("key") && e._k(l.keyCode, "enter", 13, l.key, "Enter") ? null : t.onClear.apply(null, arguments);
|
|
188
|
+
}, keyup: function(l) {
|
|
189
|
+
return !l.type.indexOf("key") && e._k(l.keyCode, "space", 32, l.key, [" ", "Spacebar"]) ? null : t.onClear.apply(null, arguments);
|
|
183
190
|
} }, scopedSlots: e._u([{ key: "iconLeft", fn: function() {
|
|
184
191
|
return [a(t.CrossCircleFillSmallIcon, { attrs: { "svg-title": t.t("clearText") } })];
|
|
185
|
-
}, proxy: !0 }], null, !1, 3119266621) })], 1) : e._e()]), t.isOverCharacterLimit ? a(t.ErrorMessage, { attrs: { "error-message": t.counterErrorText } }) : e._e(), e.errorMessage ? a(t.ErrorMessage, { attrs: { "error-message": e.errorMessage } }) : e._e(), e.description ? a(t.BentoTypography, { staticClass: "b-textarea__description", attrs: { el: "span" } }, [e._v(" " + e._s(e.description) + " ")]) : e._e()], 1);
|
|
186
|
-
},
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
192
|
+
}, proxy: !0 }], null, !1, 3119266621) })], 1) : e._e()]), t.isOverCharacterLimit ? a(t.ErrorMessage, { attrs: { "error-message": t.counterErrorText } }) : e._e(), e.errorMessage ? a(t.ErrorMessage, { attrs: { "error-message": e.errorMessage } }) : e._e(), e.description ? a(t.BentoTypography, { staticClass: "b-textarea__description", attrs: { el: "span" } }, [e._v(" " + e._s(e.description) + " ")]) : e._e()], 1)]);
|
|
193
|
+
}, me = [], ye = /* @__PURE__ */ F(
|
|
194
|
+
be,
|
|
195
|
+
ve,
|
|
196
|
+
me,
|
|
190
197
|
!1,
|
|
191
198
|
null,
|
|
192
|
-
"
|
|
199
|
+
"0ef638a8",
|
|
193
200
|
null,
|
|
194
201
|
null
|
|
195
202
|
);
|
|
196
|
-
const
|
|
203
|
+
const Be = ye.exports;
|
|
197
204
|
export {
|
|
198
|
-
|
|
205
|
+
Be as BentoTextarea
|
|
199
206
|
};
|
|
200
207
|
//# sourceMappingURL=textarea.js.map
|
package/dist/textarea.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"textarea.js","sources":["../node_modules/@adyen/ui-assets-icons-16/dist/vue/cross-circle-fill-small.vue","../src/components/textarea/textarea.types.ts","../src/components/textarea/textarea.vue"],"sourcesContent":["\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=\"#00112C\" d=\"M2.25 8C2.25 4.82436 4.82436 2.25 8 2.25C11.1756 2.25 13.75 4.82436 13.75 8C13.75 11.1756 11.1756 13.75 8 13.75C4.82436 13.75 2.25 11.1756 2.25 8ZM7.00011 5.93945L5.93945 7.00011L6.93945 8.00011L5.93945 9.00011L7.00011 10.0608L8.00011 9.06077L9.00011 10.0608L10.0608 9.00011L9.06077 8.00011L10.0608 7.00011L9.00011 5.93945L8.00011 6.93945L7.00011 5.93945Z\"/></svg>\n</template>\n<script>\n let uuid = 0;\n\n export default {\n beforeCreate() {\n this.uuid = uuid.toString();\n uuid += 1;\n },\n };\n</script>\n<style>\n @import '../css/main.css';\n</style>\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}\n","<template>\n <div class=\"b-textarea\" :class=\"conditionalClasses\" :style=\"{ width: textareaWidth }\">\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 :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 >\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</template>\n\n<script setup lang=\"ts\">\n import { computed, nextTick, onMounted, PropType, 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 '@/utils/ts/unique-id';\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 // Types\n import { BentoTextareaEvent, BentoTextareaResizeOption, 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 = defineProps({\n /**\n * Text that labels an the input element\n */\n ariaLabel: { type: String, default: undefined },\n\n /**\n * Text that shows number of characters in textarea\n */\n characterLimit: { type: Number, default: undefined },\n\n /**\n * Text displayed as the help text of the textarea\n */\n description: { type: String, default: '' },\n\n /**\n * Disables the possibility of changing value in the textarea\n */\n disabled: { type: Boolean, default: false },\n\n /**\n * If set to true, shows a button to clear all the text\n */\n clearable: { type: Boolean, default: false },\n\n /**\n * Adds error text\n */\n errorMessage: { type: String, default: '' },\n\n /**\n * Sets the height of the textarea, e.g 200px OR 20vh\n */\n height: { type: String, default: null },\n\n /**\n * Text displayed as the label of the textarea\n */\n label: { type: String, default: '' },\n\n /**\n * Highlights the textarea is optional.\n */\n optional: { type: Boolean, default: false },\n\n /**\n * Text displayed as the placeholder of the textarea\n */\n placeholder: { type: String, default: '' },\n\n /**\n * Set the textarea to read only state.\n */\n readonly: { type: Boolean, default: false },\n\n /**\n * Indicates the possibility of resize the textarea\n */\n resizable: {\n type: String as PropType<BentoTextareaResizeOption | `${BentoTextareaResizeOption}`>,\n default: BentoTextareaResizeOption.BOTH,\n validator: (value: BentoTextareaResizeOption) => Object.values(BentoTextareaResizeOption).includes(value),\n },\n\n /**\n * Highlights the textarea is required.\n */\n required: { type: Boolean, default: false },\n\n /**\n * Adds a info icon next to the label to display the passed tooltip message.\n */\n tooltipText: { type: String, default: null },\n\n /**\n * Text displayed as the value of the textarea\n */\n value: { type: String, default: '' },\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 const { height } = toRefs(props);\n\n const textareaId = generateUid('textarea');\n const textareaElement = ref<HTMLTextAreaElement>(null);\n const textareaValue = ref(props.value);\n const defaultTextareaHeight = 44;\n const textareaHeight = ref(props.height || `${defaultTextareaHeight}px`);\n const textareaWidth = ref('100%');\n\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n\n const { isReadOnly } = useFormLayoutFieldLoading(toRef(props, 'readonly'));\n\n const counter = computed(() => `${textareaValue.value.length} / ${props.characterLimit}`);\n const isOverCharacterLimit = computed(\n () => props.characterLimit && textareaValue.value.length > props.characterLimit\n );\n\n const calculateHeight = () => {\n const borderWidth = 3;\n if (textareaElement.value && textareaElement.value.scrollHeight > defaultTextareaHeight) {\n textareaHeight.value = `${textareaElement.value.scrollHeight + borderWidth}px`;\n }\n };\n\n watch(height, () => {\n if (!height.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 (!height.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`]: !height.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 onMounted(() => {\n observeSizeOfElement(textareaElement.value, () => {\n const offsetWidth = textareaElement?.value?.offsetWidth;\n textareaWidth.value = offsetWidth ? `${offsetWidth}px` : '100%';\n });\n\n if (!height.value) {\n calculateHeight();\n }\n });\n</script>\n\n<script lang=\"ts\">\n export default {\n i18n: { messages },\n name: 'bento-textarea',\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./textarea.scss\" />\n"],"names":["uuid","_sfc_main$1","BentoTextareaResizeOption","BentoTextareaResizeOption2","BentoTextareaStateClass","BentoTextareaStateClass2","BentoTextareaEvent","BentoTextareaEvent2","__default__","messages","attrs","useAttrs","height","toRefs","props","textareaId","generateUid","textareaElement","ref","textareaValue","defaultTextareaHeight","textareaHeight","textareaWidth","t","useI18n","isReadOnly","useFormLayoutFieldLoading","toRef","counter","computed","isOverCharacterLimit","calculateHeight","watch","nextTick","invalidInput","conditionalClasses","conditionalClassesInput","conditionalClassesLabelBox","conditionalClassesLabelItem","counterErrorText","ariaLabelAttribute","ariaLabel","label","computedAriaLabel","useAriaLabel","showClearButton","onClear","emit","onInput","event","onBlur","onFocus","onChange","onPressEscape","onMounted","observeSiz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D,CAAA,GAG7D5C,EAAA,SACImB,EAAA;AAAA,IACJ,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"textarea.js","sources":["../node_modules/@adyen/ui-assets-icons-16/dist/vue/cross-circle-fill-small.vue","../src/components/textarea/textarea.types.ts","../src/components/textarea/textarea.vue"],"sourcesContent":["\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=\"#00112C\" d=\"M2.25 8C2.25 4.82436 4.82436 2.25 8 2.25C11.1756 2.25 13.75 4.82436 13.75 8C13.75 11.1756 11.1756 13.75 8 13.75C4.82436 13.75 2.25 11.1756 2.25 8ZM7.00011 5.93945L5.93945 7.00011L6.93945 8.00011L5.93945 9.00011L7.00011 10.0608L8.00011 9.06077L9.00011 10.0608L10.0608 9.00011L9.06077 8.00011L10.0608 7.00011L9.00011 5.93945L8.00011 6.93945L7.00011 5.93945Z\"/></svg>\n</template>\n<script>\n let uuid = 0;\n\n export default {\n beforeCreate() {\n this.uuid = uuid.toString();\n uuid += 1;\n },\n };\n</script>\n<style>\n @import '../css/main.css';\n</style>\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}\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 :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 >\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, PropType, 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 '@/utils/ts/unique-id';\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 // Types\n import { BentoTextareaEvent, BentoTextareaResizeOption, 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 = defineProps({\n /**\n * Text that labels an the input element\n */\n ariaLabel: { type: String, default: undefined },\n\n /**\n * Text that shows number of characters in textarea\n */\n characterLimit: { type: Number, default: undefined },\n\n /**\n * Text displayed as the help text of the textarea\n */\n description: { type: String, default: '' },\n\n /**\n * Disables the possibility of changing value in the textarea\n */\n disabled: { type: Boolean, default: false },\n\n /**\n * If set to true, shows a button to clear all the text\n */\n clearable: { type: Boolean, default: false },\n\n /**\n * Adds error text\n */\n errorMessage: { type: String, default: '' },\n\n /**\n * Sets the height of the textarea, e.g 200px OR 20vh\n */\n height: { type: String, default: null },\n\n /**\n * Text displayed as the label of the textarea\n */\n label: { type: String, default: '' },\n\n /**\n * Highlights the textarea is optional.\n */\n optional: { type: Boolean, default: false },\n\n /**\n * Text displayed as the placeholder of the textarea\n */\n placeholder: { type: String, default: '' },\n\n /**\n * Set the textarea to read only state.\n */\n readonly: { type: Boolean, default: false },\n\n /**\n * Indicates the possibility of resize the textarea\n */\n resizable: {\n type: String as PropType<BentoTextareaResizeOption | `${BentoTextareaResizeOption}`>,\n default: BentoTextareaResizeOption.BOTH,\n validator: (value: BentoTextareaResizeOption) => Object.values(BentoTextareaResizeOption).includes(value),\n },\n\n /**\n * Highlights the textarea is required.\n */\n required: { type: Boolean, default: false },\n\n /**\n * Adds a info icon next to the label to display the passed tooltip message.\n */\n tooltipText: { type: String, default: null },\n\n /**\n * Text displayed as the value of the textarea\n */\n value: { type: String, default: '' },\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 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 textareaWrapperWidth = ref('100%'); // The width set to the wrapper of the label, textarea and description\n\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n\n const { isReadOnly } = useFormLayoutFieldLoading(toRef(props, 'readonly'));\n\n const counter = computed(() => `${textareaValue.value.length} / ${props.characterLimit}`);\n const isOverCharacterLimit = computed(\n () => props.characterLimit && textareaValue.value.length > props.characterLimit\n );\n\n const calculateHeight = () => {\n const borderWidth = 3;\n if (textareaElement.value && textareaElement.value.scrollHeight > defaultTextareaHeight) {\n textareaHeight.value = `${textareaElement.value.scrollHeight + borderWidth}px`;\n }\n };\n\n watch(height, () => {\n if (!height.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 (!height.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`]: !height.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 /**\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 // 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 onMounted(() => {\n observeSizeOfElement(textareaElement.value, () => {\n resizeTextareaWrapper(true);\n });\n\n observeSizeOfElement(textareaComponent.value, () => {\n resizeTextareaWrapper();\n });\n\n if (!height.value) {\n calculateHeight();\n }\n });\n</script>\n\n<script lang=\"ts\">\n export default {\n i18n: { messages },\n name: 'bento-textarea',\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./textarea.scss\" />\n"],"names":["uuid","_sfc_main$1","BentoTextareaResizeOption","BentoTextareaResizeOption2","BentoTextareaStateClass","BentoTextareaStateClass2","BentoTextareaEvent","BentoTextareaEvent2","__default__","messages","attrs","useAttrs","height","toRefs","props","textareaId","generateUid","textareaElement","ref","textareaComponent","textareaValue","defaultTextareaHeight","textareaHeight","textareaWrapperWidth","t","useI18n","isReadOnly","useFormLayoutFieldLoading","toRef","counter","computed","isOverCharacterLimit","calculateHeight","watch","nextTick","invalidInput","conditionalClasses","conditionalClassesInput","conditionalClassesLabelBox","conditionalClassesLabelItem","counterErrorText","ariaLabelAttribute","ariaLabel","label","computedAriaLabel","useAriaLabel","showClearButton","onClear","emit","onInput","event","onBlur","onFocus","onChange","onPressEscape","resizeTextareaWrapper","isTextareaElement","textareaStyleWidth","textareaComponentWidth","_a","onMounted","observeSizeOfElement"],"mappings":";;;;;;;;;;;AAKA,IAAAA,IAAA;AAEA,MAAAC,KAAA;AAAA,EACA,eAAA;AACA,SAAA,OAAAD,EAAA,SAAA,GACAA,KAAA;AAAA,EACA;AACA;;;;;;;;;;;;;;;ACTY,IAAAE,IAAA,kBAAAC,OACRA,EAAA,aAAA,cACAA,EAAA,WAAA,YACAA,EAAA,OAAA,QACAA,EAAA,OAAA,QAJQA,IAAAD,KAAA,CAAA,CAAA,GAOAE,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,SANQA,IAAAD,KAAA,CAAA,CAAA;;;;;;;GCgXRE,KAAA;AAAA,EAAe,MAAA,EAAA,UAAAC,GAAA;AAAA,EACM,MAAA;AAErB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAvSAC,IAAAC,EAAA,GAmHA,EAAA,QAAAC,EAAA,IAAAC,EAAAC,CAAA,GAEAC,IAAAC,GAAA,UAAA,GACAC,IAAAC,EAAA,IAAA,GACAC,IAAAD,EAAA,IA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