@adyen/bento-vue3 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 +23 -2455
- 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 +21 -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 +15 -5
- package/dist/@types/packages/vue2/src/components/divider/divider.keys.d.ts +1 -0
- 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 +16 -6
- 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/composables/useDisplayValue.types.d.ts +1 -0
- package/dist/@types/packages/vue2/src/components/dropdown/dropdown.vue.d.ts +2355 -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/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 +51 -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 +11 -2
- 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 +316 -3
- package/dist/@types/packages/vue2/src/components/popover/popover.vue.d.ts +1 -1
- 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 +21 -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 +22 -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 +15 -2
- 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 +23 -23
- 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/index.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/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/index23.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 -1
- package/dist/assets/index47.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/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/badge.js +1 -1
- package/dist/button.js +57 -46
- package/dist/button.js.map +1 -1
- package/dist/card.js +2 -2
- package/dist/checkbox.js +73 -54
- package/dist/checkbox.js.map +1 -1
- package/dist/chunks/{base-button.aa085dfa.js → base-button.39fae75f.js} +2 -2
- package/dist/chunks/{base-button.aa085dfa.js.map → base-button.39fae75f.js.map} +1 -1
- package/dist/chunks/{base-modal.a629cb32.js → base-modal.161ce8f0.js} +86 -86
- package/dist/chunks/base-modal.161ce8f0.js.map +1 -0
- package/dist/chunks/{button-actions-with-menu.f6dfb14d.js → button-actions-with-menu.2ff339f6.js} +3 -3
- package/dist/chunks/{button-actions-with-menu.f6dfb14d.js.map → button-actions-with-menu.2ff339f6.js.map} +1 -1
- package/dist/chunks/button.623a46d2.js +118 -0
- package/dist/chunks/button.623a46d2.js.map +1 -0
- package/dist/chunks/{calendar.fa7712e8.js → calendar.b1d05580.js} +4 -4
- package/dist/chunks/{calendar.fa7712e8.js.map → calendar.b1d05580.js.map} +1 -1
- package/dist/chunks/checkbox.d65694f2.js +278 -0
- package/dist/chunks/checkbox.d65694f2.js.map +1 -0
- package/dist/chunks/{controls-group.d6543674.js → controls-group.30352ce4.js} +21 -17
- package/dist/chunks/controls-group.30352ce4.js.map +1 -0
- package/dist/chunks/copy.2a9cddc1.js +145 -0
- package/dist/chunks/copy.2a9cddc1.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/{dropdown-default-textbox.4108b289.js → dropdown-default-textbox.a731b5fb.js} +25 -25
- package/dist/chunks/dropdown-default-textbox.a731b5fb.js.map +1 -0
- package/dist/chunks/{dropdown.63de9aac.js → dropdown.96431c25.js} +399 -359
- package/dist/chunks/dropdown.96431c25.js.map +1 -0
- package/dist/chunks/{field-label.3c19a29a.js → field-label.b681234d.js} +5 -5
- package/dist/chunks/{field-label.3c19a29a.js.map → field-label.b681234d.js.map} +1 -1
- package/dist/chunks/{fixed-scroller.bced60dd.js → fixed-scroller.ebfb2f80.js} +2 -2
- package/dist/chunks/{fixed-scroller.bced60dd.js.map → fixed-scroller.ebfb2f80.js.map} +1 -1
- package/dist/chunks/{footer-actions.cefaf1e2.js → footer-actions.03015ba1.js} +3 -3
- package/dist/chunks/{footer-actions.cefaf1e2.js.map → footer-actions.03015ba1.js.map} +1 -1
- package/dist/chunks/{index.98174339.js → index.03605cb0.js} +5 -5
- package/dist/chunks/{index.98174339.js.map → index.03605cb0.js.map} +1 -1
- package/dist/chunks/index.09f7f1b5.js +124 -0
- package/dist/chunks/index.09f7f1b5.js.map +1 -0
- package/dist/chunks/index.0a8ddfaa.js +168 -0
- package/dist/chunks/index.0a8ddfaa.js.map +1 -0
- package/dist/chunks/index.113137fb.js +21 -0
- package/dist/chunks/index.113137fb.js.map +1 -0
- package/dist/chunks/{index.89dfe209.js → index.1dac266a.js} +3 -3
- package/dist/chunks/{index.89dfe209.js.map → index.1dac266a.js.map} +1 -1
- package/dist/chunks/{index.0ee895e0.js → index.45d00aad.js} +2 -2
- package/dist/chunks/{index.0ee895e0.js.map → index.45d00aad.js.map} +1 -1
- package/dist/chunks/{index.4d2a13e1.js → index.80078bf9.js} +2 -2
- package/dist/chunks/{index.4d2a13e1.js.map → index.80078bf9.js.map} +1 -1
- package/dist/chunks/{index.85832db5.js → index.a4a6e52f.js} +3 -3
- package/dist/chunks/{index.85832db5.js.map → index.a4a6e52f.js.map} +1 -1
- package/dist/chunks/index.cf561336.js +622 -0
- package/dist/chunks/index.cf561336.js.map +1 -0
- package/dist/chunks/{index.c6fecf1c.js → index.ef1c4d59.js} +33 -33
- package/dist/chunks/{index.c6fecf1c.js.map → index.ef1c4d59.js.map} +1 -1
- package/dist/chunks/{listbox-option-tag.b1eb32bd.js → listbox-option-tag.ff6d6f32.js} +3 -3
- package/dist/chunks/{listbox-option-tag.b1eb32bd.js.map → listbox-option-tag.ff6d6f32.js.map} +1 -1
- package/dist/chunks/listbox.dd9883c5.js +1419 -0
- package/dist/chunks/listbox.dd9883c5.js.map +1 -0
- package/dist/chunks/{loading-button.4b88e24d.js → loading-button.30c5fede.js} +19 -19
- package/dist/chunks/{loading-button.4b88e24d.js.map → loading-button.30c5fede.js.map} +1 -1
- package/dist/chunks/{tooltip.27c32d36.js → tooltip.785993dd.js} +15 -15
- package/dist/chunks/tooltip.785993dd.js.map +1 -0
- package/dist/chunks/use-has-slot.4d98bf29.js.map +1 -1
- package/dist/chunks/useCountryItems.d2a1f224.js +29 -0
- package/dist/chunks/{useCountryItems.e83ef8f0.js.map → useCountryItems.d2a1f224.js.map} +1 -1
- package/dist/code-snippet.js +136 -138
- package/dist/code-snippet.js.map +1 -1
- package/dist/country.js +51 -5912
- package/dist/country.js.map +1 -1
- package/dist/currency.js +1 -1
- package/dist/data-grid.js +1325 -1021
- package/dist/data-grid.js.map +1 -1
- package/dist/date-picker.js +20 -20
- package/dist/date-picker.js.map +1 -1
- package/dist/date-range-picker.js +2 -2
- package/dist/date.js +1 -1
- package/dist/divider.js +2 -10
- package/dist/divider.js.map +1 -1
- package/dist/dropdown.js +51 -50
- package/dist/dropdown.js.map +1 -1
- package/dist/empty-state.js +23 -23
- package/dist/empty-state.js.map +1 -1
- package/dist/filter-bar.js +759 -747
- 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 +194 -185
- 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 +67 -64
- package/dist/modal.js.map +1 -1
- package/dist/pagination.js +15 -13
- 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 +69 -67
- package/dist/radio-group.js.map +1 -1
- package/dist/search-bar.js +8 -8
- package/dist/secondary-nav.js +110 -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 +173 -161
- package/dist/textarea.js.map +1 -1
- package/dist/timeline.js +244 -237
- package/dist/timeline.js.map +1 -1
- package/dist/toast.js +3 -3
- package/dist/toggle.js +2 -2
- package/dist/tutorial.js +5 -5
- package/dist/typography.js +1 -1
- package/dist/web-types.json +1 -1
- package/package.json +2 -2
- 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.a629cb32.js.map +0 -1
- package/dist/chunks/button.82ed953e.js +0 -148
- package/dist/chunks/button.82ed953e.js.map +0 -1
- package/dist/chunks/checkbox.731dc0ab.js +0 -264
- package/dist/chunks/checkbox.731dc0ab.js.map +0 -1
- package/dist/chunks/controls-group.d6543674.js.map +0 -1
- package/dist/chunks/copy.330d594e.js +0 -126
- package/dist/chunks/copy.330d594e.js.map +0 -1
- package/dist/chunks/dropdown-default-textbox.4108b289.js.map +0 -1
- package/dist/chunks/dropdown.63de9aac.js.map +0 -1
- package/dist/chunks/index.73ed22a7.js +0 -594
- package/dist/chunks/index.73ed22a7.js.map +0 -1
- package/dist/chunks/index.75f3672e.js +0 -124
- package/dist/chunks/index.75f3672e.js.map +0 -1
- package/dist/chunks/index.edcaf766.js +0 -150
- package/dist/chunks/index.edcaf766.js.map +0 -1
- package/dist/chunks/listbox.ac43f8ab.js +0 -1309
- package/dist/chunks/listbox.ac43f8ab.js.map +0 -1
- package/dist/chunks/tooltip.27c32d36.js.map +0 -1
- package/dist/chunks/useCountryItems.e83ef8f0.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
|
@@ -1,148 +0,0 @@
|
|
|
1
|
-
import { defineComponent as S, computed as o, resolveComponent as C, openBlock as a, createBlock as y, resolveDynamicComponent as E, mergeProps as g, withCtx as m, createElementBlock as _, renderSlot as d, createCommentVNode as u } from "vue";
|
|
2
|
-
import { B as h } from "./index.75f3672e.js";
|
|
3
|
-
import { u as D } from "./use-has-slot.4d98bf29.js";
|
|
4
|
-
import { BentoLink as $, BentoLinkVariant as R } from "../link.js";
|
|
5
|
-
import { _ as I } from "./_plugin-vue_export-helper.dad06003.js";
|
|
6
|
-
import "../assets/button.css";
|
|
7
|
-
var b = /* @__PURE__ */ ((t) => (t.PRIMARY = "primary", t.SECONDARY = "secondary", t.TERTIARY = "tertiary", t))(b || {}), n = /* @__PURE__ */ ((t) => (t.CONDENSED = "condensed", t.DESTRUCTIVE = "critical", t.DISABLED = "disabled", t.ICON_ONLY = "icon-only", t.INVERSE = "inverse", t))(n || {});
|
|
8
|
-
const N = S({
|
|
9
|
-
name: "bento-button",
|
|
10
|
-
components: { BentoTypography: h },
|
|
11
|
-
props: {
|
|
12
|
-
/**
|
|
13
|
-
* Reduces sizing of button
|
|
14
|
-
*/
|
|
15
|
-
condensed: {
|
|
16
|
-
type: Boolean,
|
|
17
|
-
default: !1
|
|
18
|
-
},
|
|
19
|
-
/**
|
|
20
|
-
* Displays button as critical
|
|
21
|
-
*/
|
|
22
|
-
critical: {
|
|
23
|
-
type: Boolean,
|
|
24
|
-
default: !1
|
|
25
|
-
},
|
|
26
|
-
/**
|
|
27
|
-
* Disables button functionality
|
|
28
|
-
*/
|
|
29
|
-
disabled: {
|
|
30
|
-
type: Boolean,
|
|
31
|
-
default: !1
|
|
32
|
-
},
|
|
33
|
-
/**
|
|
34
|
-
* Sets color set to inverse
|
|
35
|
-
*/
|
|
36
|
-
inverse: {
|
|
37
|
-
type: Boolean,
|
|
38
|
-
default: !1
|
|
39
|
-
},
|
|
40
|
-
/**
|
|
41
|
-
* Object containing props passed on to the BentoLink component. @see BentoLink documentation for which properties you can pass.
|
|
42
|
-
*/
|
|
43
|
-
link: {
|
|
44
|
-
type: Object,
|
|
45
|
-
default: void 0
|
|
46
|
-
},
|
|
47
|
-
/**
|
|
48
|
-
* The default behavior of the button.
|
|
49
|
-
* Possible values are: 'button', 'reset', 'submit'
|
|
50
|
-
*/
|
|
51
|
-
type: {
|
|
52
|
-
type: String,
|
|
53
|
-
default: "button"
|
|
54
|
-
},
|
|
55
|
-
/**
|
|
56
|
-
* Types of flavour of Button
|
|
57
|
-
* @values primary, secondary, tertiary
|
|
58
|
-
*/
|
|
59
|
-
variant: {
|
|
60
|
-
type: String,
|
|
61
|
-
default: b.PRIMARY,
|
|
62
|
-
validator: (t) => Object.values(b).includes(t)
|
|
63
|
-
}
|
|
64
|
-
},
|
|
65
|
-
emits: ["click", "focus", "blur", "keydown.esc"],
|
|
66
|
-
setup(t, { slots: i, emit: f, attrs: s }) {
|
|
67
|
-
const l = o(() => (t == null ? void 0 : t.link) !== void 0 ? $ : "button"), r = o(() => {
|
|
68
|
-
var e, p;
|
|
69
|
-
return {
|
|
70
|
-
"aria-controls": (e = s["aria-controls"]) == null ? void 0 : e.toString(),
|
|
71
|
-
"aria-expanded": (p = s["aria-expanded"]) == null ? void 0 : p.toString()
|
|
72
|
-
};
|
|
73
|
-
}), c = o(
|
|
74
|
-
() => l.value === "button" ? {
|
|
75
|
-
...r.value,
|
|
76
|
-
disabled: t.disabled,
|
|
77
|
-
type: t.type
|
|
78
|
-
} : { ...t.link, disableTypography: !0, variant: R.DEFAULT }
|
|
79
|
-
), v = o(() => ({
|
|
80
|
-
[`b-button--${t.variant}${t.critical ? `-${n.DESTRUCTIVE}` : ""}`]: !0
|
|
81
|
-
})), k = o(
|
|
82
|
-
() => ({
|
|
83
|
-
...v.value,
|
|
84
|
-
[`b-button--${n.CONDENSED}`]: t.condensed,
|
|
85
|
-
[`b-button--${n.DISABLED}`]: t.disabled,
|
|
86
|
-
[`b-button--${n.ICON_ONLY}`]: !i.default,
|
|
87
|
-
[`b-button--${n.INVERSE}`]: t.inverse
|
|
88
|
-
})
|
|
89
|
-
);
|
|
90
|
-
return {
|
|
91
|
-
// Values
|
|
92
|
-
ariaAttributes: r,
|
|
93
|
-
conditionalClasses: k,
|
|
94
|
-
componentType: l,
|
|
95
|
-
componentProps: c,
|
|
96
|
-
// Methods
|
|
97
|
-
onClickButton: (e) => {
|
|
98
|
-
t.disabled ? (e.preventDefault(), e.stopPropagation()) : f("click", e);
|
|
99
|
-
},
|
|
100
|
-
hasSlot: D(i)
|
|
101
|
-
};
|
|
102
|
-
}
|
|
103
|
-
});
|
|
104
|
-
const T = {
|
|
105
|
-
key: 0,
|
|
106
|
-
class: "b-button__icon-left",
|
|
107
|
-
"data-testid": "icon-button-left"
|
|
108
|
-
}, L = {
|
|
109
|
-
key: 2,
|
|
110
|
-
class: "b-button__icon-right",
|
|
111
|
-
"data-testid": "icon-button-right"
|
|
112
|
-
};
|
|
113
|
-
function O(t, i, f, s, l, r) {
|
|
114
|
-
const c = C("bento-typography");
|
|
115
|
-
return a(), y(E(t.componentType), g(t.componentProps, {
|
|
116
|
-
class: ["b-button", t.conditionalClasses],
|
|
117
|
-
onClickCapture: t.onClickButton
|
|
118
|
-
}), {
|
|
119
|
-
default: m(() => [
|
|
120
|
-
t.hasSlot("iconLeft") ? (a(), _("span", T, [
|
|
121
|
-
d(t.$slots, "iconLeft", {}, void 0, !0)
|
|
122
|
-
])) : u("", !0),
|
|
123
|
-
t.hasSlot("default") ? (a(), y(c, {
|
|
124
|
-
key: 1,
|
|
125
|
-
el: "span",
|
|
126
|
-
variant: "body",
|
|
127
|
-
stronger: "",
|
|
128
|
-
class: "b-button__label"
|
|
129
|
-
}, {
|
|
130
|
-
default: m(() => [
|
|
131
|
-
d(t.$slots, "default", {}, void 0, !0)
|
|
132
|
-
]),
|
|
133
|
-
_: 3
|
|
134
|
-
})) : u("", !0),
|
|
135
|
-
t.hasSlot("iconRight") ? (a(), _("span", L, [
|
|
136
|
-
d(t.$slots, "iconRight", {}, void 0, !0)
|
|
137
|
-
])) : u("", !0)
|
|
138
|
-
]),
|
|
139
|
-
_: 3
|
|
140
|
-
}, 16, ["class", "onClickCapture"]);
|
|
141
|
-
}
|
|
142
|
-
const w = /* @__PURE__ */ I(N, [["render", O], ["__scopeId", "data-v-95b2985a"]]);
|
|
143
|
-
export {
|
|
144
|
-
b as B,
|
|
145
|
-
w as a,
|
|
146
|
-
n as b
|
|
147
|
-
};
|
|
148
|
-
//# sourceMappingURL=button.82ed953e.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"button.82ed953e.js","sources":["../../../core/src/components/button/button.types.ts","../../../vue2/src/components/button/button.vue"],"sourcesContent":["/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoButtonVariant {\n PRIMARY = 'primary',\n SECONDARY = 'secondary',\n TERTIARY = 'tertiary',\n}\n\nexport enum BentoButtonPropClass {\n CONDENSED = 'condensed',\n DESTRUCTIVE = 'critical',\n DISABLED = 'disabled',\n ICON_ONLY = 'icon-only',\n INVERSE = 'inverse',\n}\n\nexport interface BentoButtonProps {\n condensed?: boolean;\n critical?: boolean;\n disabled?: boolean;\n inverse?: boolean;\n variant?: BentoButtonVariant | `${BentoButtonVariant}`;\n type?: string;\n link?: object;\n}\n","<template>\n <component\n :is=\"componentType\"\n v-bind=\"componentProps\"\n class=\"b-button\"\n :class=\"conditionalClasses\"\n @click.capture=\"onClickButton\"\n >\n <span v-if=\"hasSlot('iconLeft')\" class=\"b-button__icon-left\" data-testid=\"icon-button-left\">\n <slot name=\"iconLeft\" />\n </span>\n <bento-typography v-if=\"hasSlot('default')\" el=\"span\" variant=\"body\" stronger class=\"b-button__label\">\n <slot />\n </bento-typography>\n <span v-if=\"hasSlot('iconRight')\" class=\"b-button__icon-right\" data-testid=\"icon-button-right\">\n <slot name=\"iconRight\" />\n </span>\n </component>\n</template>\n\n<script lang=\"ts\">\n import { computed, defineComponent, PropType } from 'vue';\n import { BentoButtonPropClass, BentoButtonVariant } from '@/core/components/button/button.types';\n import { BentoTypography } from '@/components/typography';\n import { useHasSlot } from '@/composables/use-has-slot/use-has-slot';\n import { Booleanish } from '@/types/prop-types';\n import type { RouterLinkProps } from 'vue-router/types/router';\n import type { AnchorHTMLAttributes, ButtonHTMLAttributes } from 'vue/types/jsx';\n import { BentoLink, BentoLinkVariant } from '@/components/link';\n\n // TODO: replace all this code when migrated to Vue 3 is complete as this is the only\n // current way to extend the `router-link` component in Vue 2 and Vue Router 3\n export interface LinkProps extends RouterLinkProps, AnchorHTMLAttributes {\n // eslint-disable-next-line vue/require-default-prop\n args?: { props: RouterLinkProps };\n\n /**\n * Set the rendered link to a regular external anchor link.\n */\n external: boolean;\n }\n\n /**\n * Button component for all the various types of bento buttons.\n *\n * @usage\n * import { BentoButton, AdlIconPosition } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoButton },\n * template: `\n * <bento-button\n * disabled\n * :icon-position=\"AdlIconPosition.AFTER\"\n * >\n * Button text\n * </bento-button>\n * `,\n * }\n */\n export default defineComponent({\n name: 'bento-button',\n components: { BentoTypography },\n props: {\n /**\n * Reduces sizing of button\n */\n condensed: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Displays button as critical\n */\n critical: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Disables button functionality\n */\n disabled: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Sets color set to inverse\n */\n inverse: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Object containing props passed on to the BentoLink component. @see BentoLink documentation for which properties you can pass.\n */\n link: {\n type: Object,\n default: undefined,\n },\n\n /**\n * The default behavior of the button.\n * Possible values are: 'button', 'reset', 'submit'\n */\n type: {\n type: String as PropType<ButtonHTMLAttributes['type']>,\n default: 'button',\n },\n\n /**\n * Types of flavour of Button\n * @values primary, secondary, tertiary\n */\n variant: {\n type: String as PropType<BentoButtonVariant | `${BentoButtonVariant}`>,\n default: BentoButtonVariant.PRIMARY,\n validator: (value: BentoButtonVariant) => Object.values(BentoButtonVariant).includes(value),\n },\n },\n emits: ['click', 'focus', 'blur', 'keydown.esc'],\n setup(props, { slots, emit, attrs }) {\n const componentType = computed(() => {\n if (props?.link !== undefined) {\n return BentoLink;\n }\n return 'button';\n });\n const ariaAttributes = computed(() => ({\n 'aria-controls': attrs['aria-controls']?.toString() as string,\n 'aria-expanded': attrs['aria-expanded']?.toString() as Booleanish,\n }));\n\n const componentProps = computed(() =>\n componentType.value === 'button'\n ? {\n ...ariaAttributes.value,\n disabled: props.disabled,\n type: props.type,\n }\n : { ...props.link, disableTypography: true, variant: BentoLinkVariant.DEFAULT }\n );\n\n const variantClass = computed((): { [x: string]: boolean } => ({\n [`b-button--${props.variant}${props.critical ? `-${BentoButtonPropClass.DESTRUCTIVE}` : ''}`]: true,\n }));\n\n const conditionalClasses = computed(\n (): {\n [x: string]: boolean;\n } => ({\n ...variantClass.value,\n [`b-button--${BentoButtonPropClass.CONDENSED}`]: props.condensed,\n [`b-button--${BentoButtonPropClass.DISABLED}`]: props.disabled,\n [`b-button--${BentoButtonPropClass.ICON_ONLY}`]: !slots.default,\n [`b-button--${BentoButtonPropClass.INVERSE}`]: props.inverse,\n })\n );\n\n const onClickButton = (e: MouseEvent) => {\n if (!props.disabled) {\n emit('click', e);\n } else {\n e.preventDefault();\n e.stopPropagation();\n }\n };\n\n return {\n // Values\n ariaAttributes,\n conditionalClasses,\n componentType,\n componentProps,\n\n // Methods\n onClickButton,\n hasSlot: useHasSlot(slots),\n };\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"@/core/components/button/button.scss\" />\n"],"names":["BentoButtonVariant","BentoButtonVariant2","BentoButtonPropClass","BentoButtonPropClass2","_sfc_main","defineComponent","BentoTypography","value","props","slots","emit","attrs","componentType","computed","BentoLink","ariaAttributes","_a","_b","componentProps","BentoLinkVariant","variantClass","conditionalClasses","useHasSlot","_ctx","withCtx","openBlock","createElementBlock","_hoisted_1","createCommentVNode","createBlock","_component_bento_typography","_hoisted_2"],"mappings":";;;;;;AAGY,IAAAA,IAAA,kBAAAC,OACRA,EAAA,UAAA,WACAA,EAAA,YAAA,aACAA,EAAA,WAAA,YAHQA,IAAAD,KAAA,CAAA,CAAA,GAMAE,IAAA,kBAAAC,OACRA,EAAA,YAAA,aACAA,EAAA,cAAA,YACAA,EAAA,WAAA,YACAA,EAAA,YAAA,aACAA,EAAA,UAAA,WALQA,IAAAD,KAAA,CAAA,CAAA;ACmDR,MAAAE,IAAAC,EAAA;AAAA,EAA+B,MAAA;AAAA,EACrB,YAAA,EAAA,iBAAAC,EAAA;A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AAA;;;;;;;MAGpFP,EAAA,QAAA,WAAA,KAAAE,EAAA,GAAAC,EAAA,QAAAK,GAAA;AAAA;;;;;;;"}
|
|
@@ -1,264 +0,0 @@
|
|
|
1
|
-
import { openBlock as a, createElementBlock as g, mergeProps as F, toDisplayString as A, createCommentVNode as t, createElementVNode as L, defineComponent as X, toRefs as M, computed as o, ref as x, resolveComponent as y, normalizeClass as ee, createBlock as i, withCtx as _, renderSlot as R, createTextVNode as P } from "vue";
|
|
2
|
-
import { B as ae } from "./index.75f3672e.js";
|
|
3
|
-
import { C as oe } from "./checkmark-small.c79220d9.js";
|
|
4
|
-
import { _ as Y } from "./_plugin-vue_export-helper.dad06003.js";
|
|
5
|
-
import { u as le } from "./use-default-slot-validator.1169c221.js";
|
|
6
|
-
import { u as re } from "./use-has-slot.4d98bf29.js";
|
|
7
|
-
import { g as O } from "./unique-id.a2a2b458.js";
|
|
8
|
-
import { g as D } from "./get-slot-text.bead058f.js";
|
|
9
|
-
import { u as te } from "./i18n.6c402773.js";
|
|
10
|
-
import { u as se } from "./aria-label.ac9651a5.js";
|
|
11
|
-
import { E as ne } from "./field-label.3c19a29a.js";
|
|
12
|
-
import "../assets/checkbox.css";
|
|
13
|
-
var u = /* @__PURE__ */ ((e) => (e.UNCHECKED = "unchecked", e.DISABLED = "disabled", e.ERROR = "error", e.READONLY = "readonly", e))(u || {}), d = /* @__PURE__ */ ((e) => (e.UPDATE = "update:model-value", e.INPUT = "input", e))(d || {});
|
|
14
|
-
let q = 0;
|
|
15
|
-
const ie = {
|
|
16
|
-
beforeCreate() {
|
|
17
|
-
this.uuid = q.toString(), q += 1;
|
|
18
|
-
}
|
|
19
|
-
}, de = { key: 0 }, ce = /* @__PURE__ */ L("path", {
|
|
20
|
-
fill: "#00112C",
|
|
21
|
-
d: "M4.25 7.25H11.75V8.75H4.25V7.25Z"
|
|
22
|
-
}, null, -1);
|
|
23
|
-
function ue(e, s, c, l, p, h) {
|
|
24
|
-
return a(), g("svg", F({ role: "img" }, e.$attrs, {
|
|
25
|
-
class: "ui-assets-icons-16",
|
|
26
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
27
|
-
width: "16",
|
|
28
|
-
height: "16",
|
|
29
|
-
fill: "none"
|
|
30
|
-
}), [
|
|
31
|
-
e.$attrs["svg-title"] ? (a(), g("title", de, A(e.$attrs["svg-title"]), 1)) : t("", !0),
|
|
32
|
-
ce
|
|
33
|
-
], 16);
|
|
34
|
-
}
|
|
35
|
-
const be = /* @__PURE__ */ Y(ie, [["render", ue]]), H = {
|
|
36
|
-
"en-US": {
|
|
37
|
-
ariaLabelFallback: "Checkbox",
|
|
38
|
-
optional: "optional",
|
|
39
|
-
required: "required"
|
|
40
|
-
}
|
|
41
|
-
}, me = X({
|
|
42
|
-
name: "bento-checkbox",
|
|
43
|
-
i18n: { messages: H },
|
|
44
|
-
components: {
|
|
45
|
-
BentoTypography: ae,
|
|
46
|
-
ErrorMessage: ne,
|
|
47
|
-
CheckmarkSmallIcon: oe,
|
|
48
|
-
MinusSmallIcon: be
|
|
49
|
-
},
|
|
50
|
-
model: { prop: "modelValue" },
|
|
51
|
-
props: {
|
|
52
|
-
/**
|
|
53
|
-
* The value of the component. The DOM API casts this to a string.
|
|
54
|
-
* The browser uses "on" as the default value.
|
|
55
|
-
*
|
|
56
|
-
* In the case of multiple checkboxes this value is used as a unique key.
|
|
57
|
-
*/
|
|
58
|
-
value: { type: [String, Number], default: null },
|
|
59
|
-
/**
|
|
60
|
-
* When handling a single checkbox with a singular state, use a boolean.
|
|
61
|
-
*
|
|
62
|
-
* When handling multiple checkboxes, use an array of keys.
|
|
63
|
-
* These keys exist as a set "value" prop for each checkbox.
|
|
64
|
-
*/
|
|
65
|
-
modelValue: {
|
|
66
|
-
type: [Boolean, Array],
|
|
67
|
-
default: !1
|
|
68
|
-
},
|
|
69
|
-
/**
|
|
70
|
-
* Setting this property to true will disable the checkbox in your form.
|
|
71
|
-
*/
|
|
72
|
-
disabled: { type: Boolean, default: !1 },
|
|
73
|
-
/**
|
|
74
|
-
* Highlights the checkbox is required.
|
|
75
|
-
*/
|
|
76
|
-
required: { type: Boolean, default: !1 },
|
|
77
|
-
/**
|
|
78
|
-
* Setting this property to true will set the checkbox to read only state.
|
|
79
|
-
*/
|
|
80
|
-
readonly: { type: Boolean, default: !1 },
|
|
81
|
-
/**
|
|
82
|
-
* Setting this property to true will show the checkbox in error state.
|
|
83
|
-
*/
|
|
84
|
-
hasError: { type: Boolean, default: !1 },
|
|
85
|
-
/**
|
|
86
|
-
* Renders the checkbox in an error state with an error message.
|
|
87
|
-
*/
|
|
88
|
-
errorMessage: { type: String, default: null },
|
|
89
|
-
/**
|
|
90
|
-
* The :indeterminate CSS pseudo-class represents any form element
|
|
91
|
-
* whose state is indeterminate, such as checkboxes which have their HTML indeterminate attribute
|
|
92
|
-
* set to true, radio buttons which are members of a group in which all radio buttons are unchecked,
|
|
93
|
-
* and indeterminate <progress> elements. https://developer.mozilla.org/en-US/docs/Web/CSS/:indeterminate
|
|
94
|
-
* This property lets you control the input.indeterminate native property.
|
|
95
|
-
*/
|
|
96
|
-
indeterminate: { type: Boolean, default: !1 },
|
|
97
|
-
/**
|
|
98
|
-
* @deprecated from version 2.0.0. Use the aria-label attribute instead.
|
|
99
|
-
*/
|
|
100
|
-
/**
|
|
101
|
-
* Accessible name for the radio button component. It is strongly recommended to pas this value in case this component is used without a label.
|
|
102
|
-
*/
|
|
103
|
-
ariaLabel: { type: String, default: null },
|
|
104
|
-
/**
|
|
105
|
-
* Highlights the checkbox is optional.
|
|
106
|
-
*/
|
|
107
|
-
optional: { type: Boolean, default: !1 }
|
|
108
|
-
},
|
|
109
|
-
emits: [d.UPDATE, d.INPUT],
|
|
110
|
-
setup(e, { attrs: s, emit: c, slots: l }) {
|
|
111
|
-
const { t: p } = te({ messages: H }), h = O("description"), f = O("error"), k = re(l), { disabled: n, indeterminate: C, modelValue: r, readonly: $, value: E } = M(e), B = D(l)("default"), N = D(l)("description");
|
|
112
|
-
le("bento-checkbox", l.default, l.description);
|
|
113
|
-
const S = o(() => Array.isArray(r.value)), v = o(() => S.value ? r.value.some((b) => b === E.value) : r.value), I = o(() => !v.value && C.value), w = o(
|
|
114
|
-
() => !e.disabled && !e.readonly && (e.hasError || !!e.errorMessage)
|
|
115
|
-
), U = o(() => !e.disabled && !e.readonly && !!e.errorMessage), K = o(
|
|
116
|
-
() => I.value ? "mixed" : `${!!v.value}`
|
|
117
|
-
), z = o(
|
|
118
|
-
() => `${U.value ? f : ""} ${B && N ? h : ""}`.trim() || null
|
|
119
|
-
), G = x(s["aria-label"]), { ariaLabel: Z } = M(e), j = se({
|
|
120
|
-
ariaLabel: G.value,
|
|
121
|
-
// TODO: take this line away when the aria-label props is removed
|
|
122
|
-
label: Z,
|
|
123
|
-
defaultFallback: k("default") ? D(l)("default") : p("ariaLabelFallback")
|
|
124
|
-
}), J = o(() => w.value), Q = o(() => ({
|
|
125
|
-
[`b-checkbox--${u.DISABLED}`]: n.value,
|
|
126
|
-
[`b-checkbox--${u.READONLY}`]: $.value
|
|
127
|
-
})), W = o(() => ({
|
|
128
|
-
[`b-checkbox__outline--${u.UNCHECKED}`]: !v.value && !I.value,
|
|
129
|
-
[`b-checkbox__outline--${u.ERROR}`]: w.value,
|
|
130
|
-
[`b-checkbox__outline--${u.READONLY}`]: $.value
|
|
131
|
-
}));
|
|
132
|
-
return {
|
|
133
|
-
// Values
|
|
134
|
-
descriptionId: h,
|
|
135
|
-
errorId: f,
|
|
136
|
-
ariaChecked: K,
|
|
137
|
-
ariaDescribedBy: z,
|
|
138
|
-
ariaInvalid: J,
|
|
139
|
-
computedAriaLabel: j,
|
|
140
|
-
conditionalClass: Q,
|
|
141
|
-
conditionalClassOutline: W,
|
|
142
|
-
defaultSlotValue: B,
|
|
143
|
-
descriptionSlotValue: N,
|
|
144
|
-
isCheckboxGroup: S,
|
|
145
|
-
isChecked: v,
|
|
146
|
-
isIndeterminate: I,
|
|
147
|
-
shouldShowErrorMessage: U,
|
|
148
|
-
// Methods
|
|
149
|
-
hasSlot: k,
|
|
150
|
-
onChange: (b) => {
|
|
151
|
-
if (n.value)
|
|
152
|
-
return;
|
|
153
|
-
const V = b.target.checked;
|
|
154
|
-
if (S.value) {
|
|
155
|
-
const m = [...r.value], T = m.indexOf(E.value);
|
|
156
|
-
T === -1 ? m.push(E.value) : m.splice(T, 1), c(d.UPDATE, m), c(d.INPUT, m);
|
|
157
|
-
} else
|
|
158
|
-
c(d.UPDATE, V), c(d.INPUT, V);
|
|
159
|
-
},
|
|
160
|
-
onClick: (b) => {
|
|
161
|
-
$.value && b.preventDefault();
|
|
162
|
-
},
|
|
163
|
-
t: p
|
|
164
|
-
};
|
|
165
|
-
}
|
|
166
|
-
});
|
|
167
|
-
const pe = { class: "b-checkbox__input-container" }, he = ["aria-label", "aria-checked", "aria-describedby", "aria-invalid", "checked", "disabled", ".indeterminate", "value", "aria-readonly"], fe = {
|
|
168
|
-
key: 0,
|
|
169
|
-
class: "b-checkbox__text"
|
|
170
|
-
};
|
|
171
|
-
function ke(e, s, c, l, p, h) {
|
|
172
|
-
const f = y("checkmark-small-icon"), k = y("minus-small-icon"), n = y("bento-typography"), C = y("error-message");
|
|
173
|
-
return a(), g("label", {
|
|
174
|
-
class: ee(["b-checkbox", e.conditionalClass])
|
|
175
|
-
}, [
|
|
176
|
-
L("div", pe, [
|
|
177
|
-
e.isChecked ? (a(), i(f, {
|
|
178
|
-
key: 0,
|
|
179
|
-
class: "b-checkbox__icon",
|
|
180
|
-
"svg-title": "checked"
|
|
181
|
-
})) : t("", !0),
|
|
182
|
-
e.isIndeterminate ? (a(), i(k, {
|
|
183
|
-
key: 1,
|
|
184
|
-
class: "b-checkbox__icon",
|
|
185
|
-
"svg-title": "intermediate"
|
|
186
|
-
})) : t("", !0),
|
|
187
|
-
L("input", F({
|
|
188
|
-
ref: "input",
|
|
189
|
-
role: "checkbox",
|
|
190
|
-
class: "b-checkbox__outline",
|
|
191
|
-
type: "checkbox"
|
|
192
|
-
}, e.$attrs, {
|
|
193
|
-
"aria-label": e.computedAriaLabel,
|
|
194
|
-
"aria-checked": e.ariaChecked,
|
|
195
|
-
"aria-describedby": e.ariaDescribedBy,
|
|
196
|
-
"aria-invalid": e.ariaInvalid,
|
|
197
|
-
checked: e.isChecked,
|
|
198
|
-
disabled: e.disabled,
|
|
199
|
-
".indeterminate": e.isIndeterminate,
|
|
200
|
-
value: e.value,
|
|
201
|
-
class: e.conditionalClassOutline,
|
|
202
|
-
"aria-readonly": e.readonly,
|
|
203
|
-
onChange: s[0] || (s[0] = (...r) => e.onChange && e.onChange(...r)),
|
|
204
|
-
onClick: s[1] || (s[1] = (...r) => e.onClick && e.onClick(...r))
|
|
205
|
-
}), null, 16, he)
|
|
206
|
-
]),
|
|
207
|
-
e.hasSlot("default") || e.shouldShowErrorMessage ? (a(), g("span", fe, [
|
|
208
|
-
e.hasSlot("default") ? (a(), i(n, {
|
|
209
|
-
key: 0,
|
|
210
|
-
class: "b-checkbox__label",
|
|
211
|
-
el: "span",
|
|
212
|
-
variant: "body"
|
|
213
|
-
}, {
|
|
214
|
-
default: _(() => [
|
|
215
|
-
R(e.$slots, "default", {}, void 0, !0),
|
|
216
|
-
e.optional ? (a(), i(n, {
|
|
217
|
-
key: 0,
|
|
218
|
-
class: "b-checkbox__text-requirement",
|
|
219
|
-
el: "span"
|
|
220
|
-
}, {
|
|
221
|
-
default: _(() => [
|
|
222
|
-
P(" (" + A(e.t("optional")) + ") ", 1)
|
|
223
|
-
]),
|
|
224
|
-
_: 1
|
|
225
|
-
})) : e.required ? (a(), i(n, {
|
|
226
|
-
key: 1,
|
|
227
|
-
class: "b-checkbox__text-requirement",
|
|
228
|
-
el: "span"
|
|
229
|
-
}, {
|
|
230
|
-
default: _(() => [
|
|
231
|
-
P(" (" + A(e.t("required")) + ") ", 1)
|
|
232
|
-
]),
|
|
233
|
-
_: 1
|
|
234
|
-
})) : t("", !0)
|
|
235
|
-
]),
|
|
236
|
-
_: 3
|
|
237
|
-
})) : t("", !0),
|
|
238
|
-
e.hasSlot("default") && e.hasSlot("description") ? (a(), i(n, {
|
|
239
|
-
key: 1,
|
|
240
|
-
id: e.descriptionId,
|
|
241
|
-
class: "b-checkbox__description",
|
|
242
|
-
el: "span",
|
|
243
|
-
variant: "body"
|
|
244
|
-
}, {
|
|
245
|
-
default: _(() => [
|
|
246
|
-
R(e.$slots, "description", {}, void 0, !0)
|
|
247
|
-
]),
|
|
248
|
-
_: 3
|
|
249
|
-
}, 8, ["id"])) : t("", !0),
|
|
250
|
-
e.shouldShowErrorMessage ? (a(), i(C, {
|
|
251
|
-
key: 2,
|
|
252
|
-
id: e.errorId,
|
|
253
|
-
"error-message": e.errorMessage
|
|
254
|
-
}, null, 8, ["id", "error-message"])) : t("", !0)
|
|
255
|
-
])) : t("", !0)
|
|
256
|
-
], 2);
|
|
257
|
-
}
|
|
258
|
-
const Ne = /* @__PURE__ */ Y(me, [["render", ke], ["__scopeId", "data-v-f70246b6"]]);
|
|
259
|
-
export {
|
|
260
|
-
Ne as B,
|
|
261
|
-
u as a,
|
|
262
|
-
d as b
|
|
263
|
-
};
|
|
264
|
-
//# sourceMappingURL=checkbox.731dc0ab.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"checkbox.731dc0ab.js","sources":["../../../vue2/src/components/checkbox/checkbox.types.ts","../../../vue2/node_modules/@adyen/ui-assets-icons-16/dist/vue/minus-small.vue","../../../vue2/src/components/checkbox/checkbox.vue"],"sourcesContent":["export type BentoMultiCheckboxType = Array<string | number>;\nexport type BentoCheckboxType = boolean | BentoMultiCheckboxType;\n\nexport enum BentoCheckboxState {\n UNCHECKED = 'unchecked',\n DISABLED = 'disabled',\n ERROR = 'error',\n READONLY = 'readonly',\n}\n\nexport enum BentoCheckboxEvent {\n UPDATE = 'update:model-value',\n INPUT = 'input',\n}\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=\"#00112C\" d=\"M4.25 7.25H11.75V8.75H4.25V7.25Z\"/></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","<template>\n <label class=\"b-checkbox\" :class=\"conditionalClass\">\n <div class=\"b-checkbox__input-container\">\n <!-- Don't change order because it matters for CSS. Icons first -->\n <checkmark-small-icon v-if=\"isChecked\" class=\"b-checkbox__icon\" svg-title=\"checked\" />\n <minus-small-icon v-if=\"isIndeterminate\" class=\"b-checkbox__icon\" svg-title=\"intermediate\" />\n <input\n ref=\"input\"\n role=\"checkbox\"\n class=\"b-checkbox__outline\"\n type=\"checkbox\"\n v-bind=\"$attrs\"\n :aria-label=\"computedAriaLabel\"\n :aria-checked=\"ariaChecked\"\n :aria-describedby=\"ariaDescribedBy\"\n :aria-invalid=\"ariaInvalid\"\n :checked=\"isChecked\"\n :disabled=\"disabled\"\n :indeterminate.prop=\"isIndeterminate\"\n :value=\"value\"\n :class=\"conditionalClassOutline\"\n :aria-readonly=\"readonly\"\n @change=\"onChange\"\n @click=\"onClick\"\n />\n </div>\n <span v-if=\"hasSlot('default') || shouldShowErrorMessage\" class=\"b-checkbox__text\">\n <bento-typography v-if=\"hasSlot('default')\" class=\"b-checkbox__label\" el=\"span\" variant=\"body\">\n <slot></slot>\n <bento-typography v-if=\"optional\" class=\"b-checkbox__text-requirement\" el=\"span\">\n ({{ t('optional') }})\n </bento-typography>\n <bento-typography v-else-if=\"required\" class=\"b-checkbox__text-requirement\" el=\"span\">\n ({{ t('required') }})\n </bento-typography>\n </bento-typography>\n <bento-typography\n v-if=\"hasSlot('default') && hasSlot('description')\"\n :id=\"descriptionId\"\n class=\"b-checkbox__description\"\n el=\"span\"\n variant=\"body\"\n >\n <slot name=\"description\"></slot>\n </bento-typography>\n <error-message v-if=\"shouldShowErrorMessage\" :id=\"errorId\" :error-message=\"errorMessage\" />\n </span>\n </label>\n</template>\n\n<script lang=\"ts\">\n import { computed, defineComponent, PropType, ref, toRefs } from 'vue';\n import {\n BentoCheckboxEvent,\n BentoCheckboxState,\n BentoCheckboxType,\n BentoMultiCheckboxType,\n } from './checkbox.types';\n import { BentoTypography } from '@/components/typography';\n import { ErrorMessage } from '@/components/internal/error-message';\n import type { HTMLAttributes } from 'vue/types/jsx';\n import CheckmarkSmallIcon from '@adyen/ui-assets-icons-16/vue/checkmark-small';\n import MinusSmallIcon from '@adyen/ui-assets-icons-16/vue/minus-small';\n import { useDefaultSlotValidator, useHasSlot } from '@/composables';\n import { generateUid } from '@/utils/ts/unique-id';\n import { getSlotText } from '@/utils/ts/get-slot-text';\n import { useI18n } from '@/utils/ts/i18n';\n import { useAriaLabel } from '@/utils/ts/aria-label';\n import { BentoCheckboxGroupItems } from './components/checkbox-group/checkbox-group.types';\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n /**\n * Checkboxes are used to make a binary choice about an option.\n * The label tag area is also clickable.\n *\n * @usage\n * import { BentoCheckbox } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoCheckbox },\n * template: `\n * <bento-checkbox>\n * Label text\n * <template #description>Sub label text</template>\n * </bento-checkbox>\n * `,\n * }\n */\n export default defineComponent({\n name: 'bento-checkbox',\n i18n: { messages },\n components: {\n BentoTypography,\n ErrorMessage,\n CheckmarkSmallIcon,\n MinusSmallIcon,\n },\n model: { prop: 'modelValue' },\n props: {\n /**\n * The value of the component. The DOM API casts this to a string.\n * The browser uses \"on\" as the default value.\n *\n * In the case of multiple checkboxes this value is used as a unique key.\n */\n value: { type: [String, Number], default: null },\n\n /**\n * When handling a single checkbox with a singular state, use a boolean.\n *\n * When handling multiple checkboxes, use an array of keys.\n * These keys exist as a set \"value\" prop for each checkbox.\n */\n modelValue: {\n type: [Boolean, Array] as PropType<BentoCheckboxType | BentoCheckboxGroupItems>,\n default: false,\n },\n\n /**\n * Setting this property to true will disable the checkbox in your form.\n */\n disabled: { type: Boolean, default: false },\n\n /**\n * Highlights the checkbox is required.\n */\n required: { type: Boolean, default: false },\n\n /**\n * Setting this property to true will set the checkbox to read only state.\n */\n readonly: { type: Boolean, default: false },\n\n /**\n * Setting this property to true will show the checkbox in error state.\n */\n hasError: { type: Boolean, default: false },\n\n /**\n * Renders the checkbox in an error state with an error message.\n */\n errorMessage: { type: String, default: null },\n\n /**\n * The :indeterminate CSS pseudo-class represents any form element\n * whose state is indeterminate, such as checkboxes which have their HTML indeterminate attribute\n * set to true, radio buttons which are members of a group in which all radio buttons are unchecked,\n * and indeterminate <progress> elements. https://developer.mozilla.org/en-US/docs/Web/CSS/:indeterminate\n * This property lets you control the input.indeterminate native property.\n */\n indeterminate: { type: Boolean, default: false },\n\n /**\n * @deprecated from version 2.0.0. Use the aria-label attribute instead.\n */\n /**\n * Accessible name for the radio button component. It is strongly recommended to pas this value in case this component is used without a label.\n */\n ariaLabel: { type: String, default: null },\n\n /**\n * Highlights the checkbox is optional.\n */\n optional: { type: Boolean, default: false },\n },\n emits: [BentoCheckboxEvent.UPDATE, BentoCheckboxEvent.INPUT],\n setup(props, { attrs, emit, slots }) {\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n const descriptionId = generateUid('description');\n const errorId = generateUid('error');\n const hasSlot = useHasSlot(slots);\n\n const { disabled, indeterminate, modelValue, readonly, value } = toRefs(props);\n\n const defaultSlotValue = getSlotText(slots)('default');\n const descriptionSlotValue = getSlotText(slots)('description');\n\n useDefaultSlotValidator('bento-checkbox', slots.default, slots.description);\n\n const isCheckboxGroup = computed(() => Array.isArray(modelValue.value));\n const isChecked = computed(() => {\n if (!isCheckboxGroup.value) {\n return modelValue.value as boolean;\n }\n\n return (modelValue.value as BentoMultiCheckboxType).some(item => item === value.value);\n });\n const isIndeterminate = computed(() => !isChecked.value && indeterminate.value);\n\n const shouldShowError = computed(\n () => !props.disabled && !props.readonly && (props.hasError || !!props.errorMessage)\n );\n const shouldShowErrorMessage = computed(() => !props.disabled && !props.readonly && !!props.errorMessage);\n\n // ARIA fields\n const ariaChecked = computed<HTMLAttributes['aria-checked']>(() =>\n isIndeterminate.value ? 'mixed' : `${!!isChecked.value}`\n );\n\n const ariaDescribedBy = computed<HTMLAttributes['aria-describedby']>(\n () =>\n `${shouldShowErrorMessage.value ? errorId : ''} ${\n defaultSlotValue && descriptionSlotValue ? descriptionId : ''\n }`.trim() || null\n );\n\n const ariaLabelAttribute = ref(attrs['aria-label']);\n const { ariaLabel } = toRefs(props);\n const computedAriaLabel = useAriaLabel({\n ariaLabel: ariaLabelAttribute.value as string,\n // TODO: take this line away when the aria-label props is removed\n label: ariaLabel,\n defaultFallback: hasSlot('default')\n ? (getSlotText(slots)('default') as string)\n : t('ariaLabelFallback'),\n });\n\n const ariaInvalid = computed<HTMLAttributes['aria-invalid']>(() => shouldShowError.value);\n\n const conditionalClass = computed(() => ({\n [`b-checkbox--${BentoCheckboxState.DISABLED}`]: disabled.value,\n [`b-checkbox--${BentoCheckboxState.READONLY}`]: readonly.value,\n }));\n const conditionalClassOutline = computed(() => ({\n [`b-checkbox__outline--${BentoCheckboxState.UNCHECKED}`]: !isChecked.value && !isIndeterminate.value,\n [`b-checkbox__outline--${BentoCheckboxState.ERROR}`]: shouldShowError.value,\n [`b-checkbox__outline--${BentoCheckboxState.READONLY}`]: readonly.value,\n }));\n\n // readonly attr doesn't work with checkbox, so we need to manually ignore the click instead\n const onClick = (event: Event) => {\n if (readonly.value) {\n event.preventDefault();\n }\n };\n\n const onChange = (event: Event) => {\n if (disabled.value) {\n return;\n }\n\n const newValue: boolean = (event.target as HTMLInputElement).checked;\n\n if (isCheckboxGroup.value) {\n const newCheckedList = [...(modelValue.value as BentoMultiCheckboxType)];\n const index = newCheckedList.indexOf(value.value);\n\n if (index === -1) {\n newCheckedList.push(value.value);\n } else {\n newCheckedList.splice(index, 1);\n }\n emit(BentoCheckboxEvent.UPDATE, newCheckedList);\n emit(BentoCheckboxEvent.INPUT, newCheckedList);\n } else {\n emit(BentoCheckboxEvent.UPDATE, newValue);\n emit(BentoCheckboxEvent.INPUT, newValue);\n }\n };\n\n return {\n // Values\n descriptionId,\n errorId,\n ariaChecked,\n ariaDescribedBy,\n ariaInvalid,\n computedAriaLabel,\n conditionalClass,\n conditionalClassOutline,\n defaultSlotValue,\n descriptionSlotValue,\n isCheckboxGroup,\n isChecked,\n isIndeterminate,\n shouldShowErrorMessage,\n\n // Methods\n hasSlot,\n onChange,\n onClick,\n\n t,\n };\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./checkbox.scss\" />\n"],"names":["BentoCheckboxState","BentoCheckboxState2","BentoCheckboxEvent","BentoCheckboxEvent2","uuid","openBlock","createElementBlock","mergeProps","_ctx","_hoisted_1$1","toDisplayString","_sfc_main","defineComponent","messages","BentoTypography","ErrorMessage","CheckmarkSmallIcon","MinusSmallIcon","props","attrs","emit","slots","t","useI18n","descriptionId","generateUid","errorId","hasSlot","useHasSlot","disabled","indeterminate","modelValue","readonly","value","toRefs","defaultSlotValue","getSlotText","descriptionSlotValue","useDefaultSlotValidator","isCheckboxGroup","computed","isChecked","item","isIndeterminate","shouldShowError","shouldShowErrorMessage","ariaChecked","ariaDescribedBy","ariaLabelAttribute","ref","ariaLabel","computedAriaLabel","useAriaLabel","ariaInvalid","conditionalClass","conditionalClassOutline","event","newValue","newCheckedList","index","createBlock","_component_checkmark_small_icon","createCommentVNode","_component_minus_small_icon","createElementVNode","_cache","args","_hoisted_3","_component_bento_typography","renderSlot","_component_error_message"],"mappings":";;;;;;;;;;;;AAGY,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,SAAA,sBACAA,EAAA,QAAA,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AAA,QACD,UAAAyD,EAAA,CAAA,MAAAA,EAAA,CAAA,IAAA,IAAAC,MAAA1D,EAAA,YAAAA,EAAA,SAAA,GAAA0D,CAAA;AAAA;;IAGK,CAAA;AAAA,IACS1D,EAAA,QAAA,SAAA,KAAAA,EAAA,0BAAAH,EAAA,GAAAC,EAAA,QAAA6D,IAAA;AAAA,MAQL3D,EAAA,QAAA,SAAA,KAAAH,EAAA,GAAAuD,EAAAQ,GAAA;AAAA,QARkD,KAAA;AAAA,QAAI,OAAA;AAAA,QAAc,IAAA;AAAA;;;UAEnDC,EAAA7D,EAAA,QAAA,WAAA,CAAA,GAAA,QAAA,EAAA;AAAA,UAEbA,EAAA,YAAAH,EAAA,GAAAuD,EAAAQ,GAAA;AAAA,YAFmD,KAAA;AAAA,YAAI,OAAA;AAAA;;;;;YAG7C,GAAA;AAAA,UAAA,CAAA,KAAA5D,EAAA,YAAAH,EAAA,GAAAuD,EAAAQ,GAAA;AAAA,YAA8C,KAAA;AAAA,YAAI,OAAA;AAAA;;;;;;;;;MAKzE,CAAA,KAAAN,EAAA,IAAA,EAAA;AAAA,MAOStD,EAAA,QAAA,SAAA,KAAAA,EAAA,QAAA,aAAA,KAAAH,EAAA,GAAAuD,EAAAQ,GAAA;AAAA,QANG,KAAA;AAAA,QACb,IAAA5D,EAAA;AAAA,QACF,OAAA;AAAA,QACI,IAAA;AAAA;;;;;;MAIU,GAAA,GAAA,CAAA,IAAA,CAAA,KAAAsD,EAAA,IAAA,EAAA;AAAA,MAAsEtD,EAAA,0BAAAH,EAAA,GAAAuD,EAAAU,GAAA;AAAA,QAAlC,KAAA;AAAA,QAAG,IAAA9D,EAAA;AAAA;;;;;;","x_google_ignoreList":[1]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"controls-group.d6543674.js","sources":["../../../vue2/src/components/internal/controls-group/controls-group.vue"],"sourcesContent":["<template>\n <fieldset\n class=\"b-controls-group\"\n :class=\"conditionalClasses\"\n :form=\"form\"\n :disabled=\"disabled\"\n :aria-describedby=\"ariaAttributes['aria-describedby']\"\n >\n <legend class=\"b-controls-group__label-container\" :class=\"legendConditionalClasses\">\n <field-label\n v-if=\"label\"\n class=\"b-controls-group__label\"\n :label=\"label\"\n :tooltip-text=\"tooltipText\"\n :optional=\"optional\"\n :required=\"required\"\n />\n <bento-typography v-if=\"description\" class=\"b-controls-group__description\" el=\"span\">\n {{ description }}\n </bento-typography>\n </legend>\n <slot />\n </fieldset>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, useAttrs } from 'vue';\n import { BentoTypography } from '@/components/typography';\n import { FieldLabel } from '@/components/internal/field-label';\n import { deprecate } from '@/utils/ts/deprecate';\n\n const attrs = useAttrs();\n\n const props = defineProps({\n /**\n * Descriptive supporting text visbile underneath the label.\n */\n description: { type: String, default: null },\n\n /**\n * Sets all child controls of the <fieldset> as disabled.\n */\n disabled: { type: Boolean, default: false },\n\n /**\n * The value of the id attribute of a <form> element the <fieldset> is to part of, even if it is not inside the form itself.\n */\n form: { type: String, default: null },\n\n /**\n * Shows/hides the group label.\n */\n hideLabel: { type: Boolean, default: null },\n\n /**\n * The name associated with the group. Required for accessibility purposes.\n * The label is shown when `hideLabel` is set to `true` or if `description` is passed\n */\n label: { type: String, required: true },\n\n /**\n * Indicates the field is optional.\n */\n optional: { type: Boolean, default: false },\n\n /**\n * Indicates the field is required.\n */\n required: { type: Boolean, default: false },\n\n /**\n * Tooltip message.\n */\n tooltipText: { type: String, default: null },\n });\n\n const ariaAttributes = computed(() => ({\n 'aria-describedby': attrs['aria-describedby']?.toString() as string,\n }));\n\n const conditionalClasses = computed(() => ({\n 'b-controls-group--disabled': props.disabled,\n }));\n\n const legendConditionalClasses = computed(() => {\n const isLabelAndDescriptionPresent = props.label && props.description;\n const shouldShowLabel = isLabelAndDescriptionPresent || props.hideLabel === false;\n\n return {\n 'b-controls-group__label-container--hidden': !shouldShowLabel,\n };\n });\n\n // eslint-disable-next-line eqeqeq -- Needs to show deprecate message when hideLabel is not set and no description available\n const hasNoPropsDefined = !props.description && props.hideLabel == undefined;\n if (hasNoPropsDefined) {\n deprecate(\n `The property \\`label\\` will always be rendered by default.`,\n `After version 2.0.0, the label will be shown by default.\n To continue hiding the label set \\`:hide-label=\"true\"\\`. Up until version 2.0.0, to display the label set \\`hide-label=\"false\"\\`.\n \\`label\\` will always be rendered when \\`description\\` is passed alongside with \\`label\\``,\n `2.0.0`\n );\n }\n</script>\n\n<script lang=\"ts\">\n /**\n * A controls group components should be used whenever it is necessary to group a set of controls (i.e. radio buttons or checkboxes)\n * This component conforms to the official WAI-ARIA guidelines for grouping controls: https://www.w3.org/WAI/tutorials/forms/grouping/\n *\n * NOTE: This component should not be used by itself but more implemented by other exported components\n * @example\n * import { ControlsGroup, BentoCheckbox } from '@adyen/bento-vue2/';\n *\n * export default {\n * components: { ControlsGroup, RadioButton },\n * template: `\n * <controls-group\n * label=\"Your group label\"\n * description=\"Description\"\n * >\n * <radio-button\n * disabled\n * value=\"inputRadio\"\n * >\n * Label text\n * </radio-button>\n * <radio-button\n * value=\"inputRadio\"\n * >\n * Another label text\n * </radio-button>\n * </controls-group>\n * `\n * };\n */\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"./controls-group.scss\" />\n"],"names":["__default__","attrs","useAttrs","ariaAttributes","computed","_a","conditionalClasses","props","legendConditionalClasses","deprecate"],"mappings":";;;;;oDAyIIA,IAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA1GAC,IAAAC,EAAA,GA6CAC,IAAAC,EAAA,MAAA;;AAAA;AAAA,QAAuC,qBAAAC,IAAAJ,EAAA,kBAAA,MAAA,gBAAAI,EAAA;AAAA,MACqB;AAAA,KAAA,GAG5DC,IAAAF,EAAA,OAAA;AAAA,MAA2C,8BAAAG,EAAA;AAAA,IACH,EAAA,GAGxCC,IAAAJ,EAAA,OAII;AAAA,MAAO,6CAAA,EAHPG,EAAA,SAAAA,EAAA,eACAA,EAAA,cAAA;AAAA,IAGkD,EAClD;AAKJ,WADA,CAAAA,EAAA,eAAAA,EAAA,aAAA,QAEIE;AAAA,MAAA;AAAA,MACI;AAAA,MACA;AAAA,IAGA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
import { openBlock as r, createElementBlock as c, mergeProps as T, toDisplayString as _, createCommentVNode as g, createElementVNode as k, defineComponent as w, ref as y, computed as V, resolveComponent as C, resolveDirective as b, withDirectives as v, renderSlot as h, createBlock as R, withCtx as P, createVNode as E } from "vue";
|
|
2
|
-
import { a as H } from "./button.82ed953e.js";
|
|
3
|
-
import { c as D } from "./index.85832db5.js";
|
|
4
|
-
import { b as F } from "./tooltip.27c32d36.js";
|
|
5
|
-
import { u as O } from "./i18n.6c402773.js";
|
|
6
|
-
import { _ as $ } from "./_plugin-vue_export-helper.dad06003.js";
|
|
7
|
-
import "../assets/copy.css";
|
|
8
|
-
let m = 0;
|
|
9
|
-
const S = {
|
|
10
|
-
beforeCreate() {
|
|
11
|
-
this.uuid = m.toString(), m += 1;
|
|
12
|
-
}
|
|
13
|
-
}, A = { key: 0 }, B = /* @__PURE__ */ k("path", {
|
|
14
|
-
fill: "#00112C",
|
|
15
|
-
d: "M3.5 1.25C2.25736 1.25 1.25 2.25736 1.25 3.5V8.5C1.25 9.74264 2.25736 10.75 3.5 10.75H5.25V12.5C5.25 13.7426 6.25736 14.75 7.5 14.75H12.5C13.7426 14.75 14.75 13.7426 14.75 12.5V7.5C14.75 6.25736 13.7426 5.25 12.5 5.25H10.75V3.5C10.75 2.25736 9.74264 1.25 8.5 1.25H3.5ZM9.25 5.25H7.5C6.25736 5.25 5.25 6.25736 5.25 7.5V9.25H3.5C3.08579 9.25 2.75 8.91421 2.75 8.5V3.5C2.75 3.08579 3.08579 2.75 3.5 2.75H8.5C8.91421 2.75 9.25 3.08579 9.25 3.5V5.25ZM6.75 12.5V7.5C6.75 7.08579 7.08579 6.75 7.5 6.75H12.5C12.9142 6.75 13.25 7.08579 13.25 7.5V12.5C13.25 12.9142 12.9142 13.25 12.5 13.25H7.5C7.08579 13.25 6.75 12.9142 6.75 12.5Z"
|
|
16
|
-
}, null, -1);
|
|
17
|
-
function I(e, t, n, s, p, l) {
|
|
18
|
-
return r(), c("svg", T({ role: "img" }, e.$attrs, {
|
|
19
|
-
class: "ui-assets-icons-16",
|
|
20
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
21
|
-
width: "16",
|
|
22
|
-
height: "16",
|
|
23
|
-
fill: "none"
|
|
24
|
-
}), [
|
|
25
|
-
e.$attrs["svg-title"] ? (r(), c("title", A, _(e.$attrs["svg-title"]), 1)) : g("", !0),
|
|
26
|
-
B
|
|
27
|
-
], 16);
|
|
28
|
-
}
|
|
29
|
-
const N = /* @__PURE__ */ $(S, [["render", I]]), f = {
|
|
30
|
-
"en-US": {
|
|
31
|
-
copy: "Copy",
|
|
32
|
-
copied: "Copied!",
|
|
33
|
-
copyFailed: "Copy failed. Try manually."
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
var o = /* @__PURE__ */ ((e) => (e.DEFAULT = "default", e.COPYING = "copying", e.ERROR = "error", e))(o || {});
|
|
37
|
-
const L = w({
|
|
38
|
-
i18n: { messages: f },
|
|
39
|
-
name: "copy",
|
|
40
|
-
components: { BentoButton: H, CopyIcon: N },
|
|
41
|
-
directives: { BentoTooltipDirective: F },
|
|
42
|
-
props: {
|
|
43
|
-
/**
|
|
44
|
-
* Defines the string that will get copied to the clipboard
|
|
45
|
-
*/
|
|
46
|
-
text: {
|
|
47
|
-
type: String,
|
|
48
|
-
required: !0
|
|
49
|
-
},
|
|
50
|
-
/**
|
|
51
|
-
* Position the tooltip should take if space is available. Defaults to 'top'
|
|
52
|
-
*/
|
|
53
|
-
tooltipPosition: {
|
|
54
|
-
type: String,
|
|
55
|
-
default: D.TOP
|
|
56
|
-
}
|
|
57
|
-
},
|
|
58
|
-
setup(e) {
|
|
59
|
-
const { t } = O({ messages: f }), n = y(o.DEFAULT), s = y(!1), p = async () => {
|
|
60
|
-
try {
|
|
61
|
-
await navigator.clipboard.writeText(e.text), n.value = o.COPYING, s.value = !0;
|
|
62
|
-
} catch {
|
|
63
|
-
n.value = o.ERROR;
|
|
64
|
-
}
|
|
65
|
-
}, l = () => {
|
|
66
|
-
n.value = o.DEFAULT, s.value = !1;
|
|
67
|
-
};
|
|
68
|
-
return {
|
|
69
|
-
copyText: V(() => {
|
|
70
|
-
switch (n.value) {
|
|
71
|
-
case o.COPYING:
|
|
72
|
-
return t("copied");
|
|
73
|
-
case o.ERROR:
|
|
74
|
-
return t("copyFailed");
|
|
75
|
-
case o.DEFAULT:
|
|
76
|
-
default:
|
|
77
|
-
return t("copy");
|
|
78
|
-
}
|
|
79
|
-
}),
|
|
80
|
-
onClickCopy: p,
|
|
81
|
-
resetText: l,
|
|
82
|
-
showScreenReaderAlert: s
|
|
83
|
-
};
|
|
84
|
-
}
|
|
85
|
-
});
|
|
86
|
-
const U = {
|
|
87
|
-
key: 2,
|
|
88
|
-
role: "alert",
|
|
89
|
-
class: "b-copy__screen-reader-alert"
|
|
90
|
-
};
|
|
91
|
-
function M(e, t, n, s, p, l) {
|
|
92
|
-
const a = C("copy-icon"), d = C("bento-button"), u = b("bento-tooltip-directive");
|
|
93
|
-
return r(), c("div", {
|
|
94
|
-
class: "b-copy",
|
|
95
|
-
onMouseleave: t[1] || (t[1] = (...i) => e.resetText && e.resetText(...i)),
|
|
96
|
-
onFocusout: t[2] || (t[2] = (...i) => e.resetText && e.resetText(...i))
|
|
97
|
-
}, [
|
|
98
|
-
e.$slots.default ? v((r(), c("span", {
|
|
99
|
-
key: 0,
|
|
100
|
-
onClick: t[0] || (t[0] = (...i) => e.onClickCopy && e.onClickCopy(...i))
|
|
101
|
-
}, [
|
|
102
|
-
h(e.$slots, "default", {}, void 0, !0)
|
|
103
|
-
])), [
|
|
104
|
-
[u, e.copyText, e.tooltipPosition]
|
|
105
|
-
]) : v((r(), R(d, {
|
|
106
|
-
key: 1,
|
|
107
|
-
variant: "tertiary",
|
|
108
|
-
onClick: e.onClickCopy
|
|
109
|
-
}, {
|
|
110
|
-
iconLeft: P(() => [
|
|
111
|
-
E(a, {
|
|
112
|
-
"svg-title": e.$t("copy")
|
|
113
|
-
}, null, 8, ["svg-title"])
|
|
114
|
-
]),
|
|
115
|
-
_: 1
|
|
116
|
-
}, 8, ["onClick"])), [
|
|
117
|
-
[u, e.copyText, e.tooltipPosition]
|
|
118
|
-
]),
|
|
119
|
-
e.showScreenReaderAlert ? (r(), c("div", U, _(e.$t("copied")), 1)) : g("", !0)
|
|
120
|
-
], 32);
|
|
121
|
-
}
|
|
122
|
-
const z = /* @__PURE__ */ $(L, [["render", M], ["__scopeId", "data-v-65c935fd"]]);
|
|
123
|
-
export {
|
|
124
|
-
z as C
|
|
125
|
-
};
|
|
126
|
-
//# sourceMappingURL=copy.330d594e.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"copy.330d594e.js","sources":["../../../vue2/node_modules/@adyen/ui-assets-icons-16/dist/vue/copy.vue","../../../vue2/src/components/internal/copy/copy.types.ts","../../../vue2/src/components/internal/copy/copy.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=\"M3.5 1.25C2.25736 1.25 1.25 2.25736 1.25 3.5V8.5C1.25 9.74264 2.25736 10.75 3.5 10.75H5.25V12.5C5.25 13.7426 6.25736 14.75 7.5 14.75H12.5C13.7426 14.75 14.75 13.7426 14.75 12.5V7.5C14.75 6.25736 13.7426 5.25 12.5 5.25H10.75V3.5C10.75 2.25736 9.74264 1.25 8.5 1.25H3.5ZM9.25 5.25H7.5C6.25736 5.25 5.25 6.25736 5.25 7.5V9.25H3.5C3.08579 9.25 2.75 8.91421 2.75 8.5V3.5C2.75 3.08579 3.08579 2.75 3.5 2.75H8.5C8.91421 2.75 9.25 3.08579 9.25 3.5V5.25ZM6.75 12.5V7.5C6.75 7.08579 7.08579 6.75 7.5 6.75H12.5C12.9142 6.75 13.25 7.08579 13.25 7.5V12.5C13.25 12.9142 12.9142 13.25 12.5 13.25H7.5C7.08579 13.25 6.75 12.9142 6.75 12.5Z\"/></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","export enum CopyTooltipState {\n DEFAULT = 'default',\n COPYING = 'copying',\n ERROR = 'error',\n}\n","<template>\n <div class=\"b-copy\" @mouseleave=\"resetText\" @focusout=\"resetText\">\n <span v-if=\"$slots.default\" v-bento-tooltip-directive:[tooltipPosition]=\"copyText\" @click=\"onClickCopy\">\n <slot />\n </span>\n <bento-button\n v-else\n v-bento-tooltip-directive:[tooltipPosition]=\"copyText\"\n variant=\"tertiary\"\n @click=\"onClickCopy\"\n >\n <template #iconLeft>\n <copy-icon :svg-title=\"$t('copy')\" />\n </template>\n </bento-button>\n <div v-if=\"showScreenReaderAlert\" role=\"alert\" class=\"b-copy__screen-reader-alert\">{{ $t('copied') }}</div>\n </div>\n</template>\n\n<script lang=\"ts\">\n import { computed, defineComponent, PropType, ref } from 'vue';\n import { BentoButton } from '@/components/button';\n import { PopperContainerPosition } from '@/components/popper-container';\n import { BentoTooltipDirective } from '@/directives';\n import { useI18n } from '@/utils/ts/i18n';\n import CopyIcon from '@adyen/ui-assets-icons-16/vue/copy';\n import messages from './messages.json';\n import { CopyTooltipState } from './copy.types';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n /**\n * An internal button component that copies text to the user's clipboard.\n *\n * @example\n * import { Copy } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { Copy },\n * template: `\n * <copy :text=\"textToCopy\" />\n * `\n * }\n */\n export default defineComponent({\n i18n: { messages },\n name: 'copy',\n components: { BentoButton, CopyIcon },\n directives: { BentoTooltipDirective },\n props: {\n /**\n * Defines the string that will get copied to the clipboard\n */\n text: {\n type: String,\n required: true,\n },\n\n /**\n * Position the tooltip should take if space is available. Defaults to 'top'\n */\n tooltipPosition: {\n type: String as PropType<PopperContainerPosition>,\n default: PopperContainerPosition.TOP,\n },\n },\n setup(props) {\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n const copyState = ref<CopyTooltipState>(CopyTooltipState.DEFAULT);\n\n const showScreenReaderAlert = ref(false);\n const onClickCopy = async () => {\n try {\n await navigator.clipboard.writeText(props.text);\n copyState.value = CopyTooltipState.COPYING;\n showScreenReaderAlert.value = true;\n } catch (e) {\n copyState.value = CopyTooltipState.ERROR;\n }\n };\n\n const resetText = () => {\n copyState.value = CopyTooltipState.DEFAULT;\n showScreenReaderAlert.value = false;\n };\n\n const copyText = computed(() => {\n switch (copyState.value) {\n case CopyTooltipState.COPYING:\n return t('copied');\n case CopyTooltipState.ERROR:\n return t('copyFailed');\n case CopyTooltipState.DEFAULT:\n default:\n return t('copy');\n }\n });\n\n return {\n copyText,\n onClickCopy,\n resetText,\n showScreenReaderAlert,\n };\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./copy.scss\" />\n"],"names":["uuid","openBlock","createElementBlock","mergeProps","_ctx","_hoisted_1$1","toDisplayString","CopyTooltipState","CopyTooltipState2","_sfc_main","defineComponent","messages","BentoButton","CopyIcon","BentoTooltipDirective","PopperContainerPosition","props","useI18n","copyState","ref","showScreenReaderAlert","onClickCopy","resetText","computed","_directive_bento_tooltip_directive","resolveDirective","_cache","args","renderSlot","withDirectives","createBlock","_component_bento_button","withCtx","createVNode","_component_copy_icon"],"mappings":";;;;;;;AAKI,IAAAA,IAAA;;EAGI,eAAA;8BAEIA,KAAA;AAAA;;EARkM,MAAA;AAAA,EAAe,GAAA;;;AAAzN,SAAAC,EAAA,GAAAC,EAAA,OAAAC,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