@adyen/bento-vue3 1.12.0 → 1.13.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/@types/components.d.ts +2 -0
- package/dist/@types/packages/vue2/src/components/button/components/button-actions/button-actions.vue.d.ts +10 -22
- package/dist/@types/packages/vue2/src/components/data-grid/components/data-grid-columns/data-grid-columns.vue.d.ts +23 -0
- package/dist/@types/packages/vue2/src/components/data-grid/composables/use-scroller/use-scroller.d.ts +2 -1
- package/dist/@types/packages/vue2/src/components/data-grid/data-grid.types.d.ts +3 -1
- package/dist/@types/packages/vue2/src/components/data-grid/data-grid.vue.d.ts +9 -0
- package/dist/@types/packages/vue2/src/components/filter-bar/components/all-filters-modal/all-filters-modal.vue.d.ts +520 -0
- package/dist/@types/packages/vue2/src/components/filter-bar/components/base-filter/base-filter.vue.d.ts +1 -0
- package/dist/@types/packages/vue2/src/components/filter-bar/filter-bar.types.d.ts +4 -1
- package/dist/@types/packages/vue2/src/components/internal/listbox/components/listbox-multi-select/components/listbox-multi-select-chips/index.d.ts +1 -0
- package/dist/@types/packages/vue2/src/components/internal/listbox/components/listbox-multi-select/components/listbox-multi-select-chips/listbox-multi-select-chips.vue.d.ts +31 -0
- package/dist/@types/packages/vue2/src/components/internal/listbox/components/listbox-multi-select/listbox-multi-select.vue.d.ts +3 -4
- package/dist/@types/packages/vue2/src/components/internal/listbox/components/listbox-single-select/listbox-single-select.vue.d.ts +2 -2
- package/dist/@types/packages/vue2/src/components/internal/listbox/composables/useListboxKeyboardNavigation.d.ts +2 -2
- package/dist/@types/packages/vue2/src/components/link/link.vue.d.ts +3 -2
- package/dist/@types/packages/vue2/src/components/modal/components/base-modal/base-modal.keys.d.ts +1 -0
- package/dist/@types/packages/vue2/src/components/radio-group/components/radio-button/index.d.ts +2 -0
- package/dist/@types/packages/vue2/src/components/radio-group/components/radio-button/radio-button.types.d.ts +1 -0
- package/dist/@types/packages/vue2/src/components/radio-group/components/radio-button/radio-button.vue.d.ts +24 -27
- package/dist/@types/packages/vue2/src/components/radio-group/index.d.ts +2 -1
- package/dist/@types/packages/vue2/src/components/sidepanel/sidepanel.keys.d.ts +1 -0
- package/dist/accordion.js +2 -2
- package/dist/action-bar.js +5 -5
- package/dist/alert.js +26 -25
- 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/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/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/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 -1
- 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/avatar-image.js +1 -1
- package/dist/badge.js +1 -1
- package/dist/button.js +99 -111
- package/dist/button.js.map +1 -1
- package/dist/card.js +2 -2
- package/dist/checkbox.js +6 -6
- package/dist/chunks/arrow-left.81a91b8f.js.map +1 -1
- package/dist/chunks/{base-button.9f2acdeb.js → base-button.35d84224.js} +2 -2
- package/dist/chunks/{base-button.9f2acdeb.js.map → base-button.35d84224.js.map} +1 -1
- package/dist/chunks/{base-modal.56a671c3.js → base-modal.c4045ec6.js} +101 -98
- package/dist/chunks/base-modal.c4045ec6.js.map +1 -0
- package/dist/chunks/{button-actions-with-menu.080ccaf8.js → button-actions-with-menu.b3130fc5.js} +3 -3
- package/dist/chunks/{button-actions-with-menu.080ccaf8.js.map → button-actions-with-menu.b3130fc5.js.map} +1 -1
- package/dist/chunks/{button.7ce49c43.js → button.9a51e27a.js} +24 -24
- package/dist/chunks/{button.7ce49c43.js.map → button.9a51e27a.js.map} +1 -1
- package/dist/chunks/{calendar.f0f7b405.js → calendar.ac3ea3d9.js} +66 -66
- package/dist/chunks/{calendar.f0f7b405.js.map → calendar.ac3ea3d9.js.map} +1 -1
- package/dist/chunks/{checkbox.c63cd1d8.js → checkbox.093e5288.js} +3 -3
- package/dist/chunks/checkbox.093e5288.js.map +1 -0
- package/dist/chunks/checkmark-circle-fill.c45a999d.js.map +1 -1
- package/dist/chunks/checkmark-small.c79220d9.js.map +1 -1
- package/dist/chunks/checkmark.eb3c7a06.js.map +1 -1
- package/dist/chunks/chevron-left.4ee92950.js.map +1 -1
- package/dist/chunks/chevron-up.46afb34c.js.map +1 -1
- package/dist/chunks/{controls-group.1660076e.js → controls-group.f24676ab.js} +4 -4
- package/dist/chunks/{controls-group.1660076e.js.map → controls-group.f24676ab.js.map} +1 -1
- package/dist/chunks/{copy.91983fad.js → copy.d5ee2f1a.js} +4 -4
- package/dist/chunks/copy.d5ee2f1a.js.map +1 -0
- package/dist/chunks/cross-circle-fill.1abec1a2.js.map +1 -1
- package/dist/chunks/cross-small.b85406fe.js +29 -0
- package/dist/chunks/cross-small.b85406fe.js.map +1 -0
- package/dist/chunks/cross.26509efc.js.map +1 -1
- package/dist/chunks/{dropdown-default-textbox.157f95f0.js → dropdown-default-textbox.3350778f.js} +2 -2
- package/dist/chunks/{dropdown-default-textbox.157f95f0.js.map → dropdown-default-textbox.3350778f.js.map} +1 -1
- package/dist/chunks/{dropdown.b0e80aaa.js → dropdown.01c80ffd.js} +22 -22
- package/dist/chunks/dropdown.01c80ffd.js.map +1 -0
- package/dist/chunks/{field-label.894140ec.js → field-label.a23f17b5.js} +2 -2
- package/dist/chunks/{field-label.894140ec.js.map → field-label.a23f17b5.js.map} +1 -1
- package/dist/chunks/{fixed-scroller.708a4c4e.js → fixed-scroller.f6bc3063.js} +2 -2
- package/dist/chunks/{fixed-scroller.708a4c4e.js.map → fixed-scroller.f6bc3063.js.map} +1 -1
- package/dist/chunks/{footer-actions.21ba3026.js → footer-actions.2340bf71.js} +3 -3
- package/dist/chunks/{footer-actions.21ba3026.js.map → footer-actions.2340bf71.js.map} +1 -1
- package/dist/chunks/{index.3ec651d0.js → index.01e085bf.js} +2 -2
- package/dist/chunks/{index.3ec651d0.js.map → index.01e085bf.js.map} +1 -1
- package/dist/chunks/{index.9ae856b3.js → index.2f746572.js} +3 -3
- package/dist/chunks/{index.9ae856b3.js.map → index.2f746572.js.map} +1 -1
- package/dist/chunks/{index.46b7b1d3.js → index.59f8058f.js} +6 -6
- package/dist/chunks/{index.46b7b1d3.js.map → index.59f8058f.js.map} +1 -1
- package/dist/chunks/{index.762f7ec9.js → index.5c07d389.js} +7 -7
- package/dist/chunks/index.5c07d389.js.map +1 -0
- package/dist/chunks/{index.d57976cb.js → index.83ca2d5c.js} +28 -28
- package/dist/chunks/{index.d57976cb.js.map → index.83ca2d5c.js.map} +1 -1
- package/dist/chunks/{index.113137fb.js → index.8a92a332.js} +2 -2
- package/dist/chunks/{index.113137fb.js.map → index.8a92a332.js.map} +1 -1
- package/dist/chunks/{index.266dd8ff.js → index.8be283d5.js} +2 -2
- package/dist/chunks/{index.266dd8ff.js.map → index.8be283d5.js.map} +1 -1
- package/dist/chunks/{index.fcfca776.js → index.a56038f2.js} +2 -2
- package/dist/chunks/{index.fcfca776.js.map → index.a56038f2.js.map} +1 -1
- package/dist/chunks/{index.a25e53b8.js → index.cb2167c3.js} +5 -5
- package/dist/chunks/{index.a25e53b8.js.map → index.cb2167c3.js.map} +1 -1
- package/dist/chunks/{index.62c5d91f.js → index.e3dba813.js} +3 -3
- package/dist/chunks/{index.62c5d91f.js.map → index.e3dba813.js.map} +1 -1
- package/dist/chunks/index.eba55960.js +112 -0
- package/dist/chunks/index.eba55960.js.map +1 -0
- package/dist/chunks/{info-filled.e591599f.js → info-filled.a6f9d7d0.js} +19 -42
- package/dist/chunks/info-filled.a6f9d7d0.js.map +1 -0
- package/dist/chunks/{listbox-option-tag.1f42ad7f.js → listbox-option-tag.8e75f1a7.js} +3 -3
- package/dist/chunks/{listbox-option-tag.1f42ad7f.js.map → listbox-option-tag.8e75f1a7.js.map} +1 -1
- package/dist/chunks/listbox.e4f1d305.js +1466 -0
- package/dist/chunks/listbox.e4f1d305.js.map +1 -0
- package/dist/chunks/{loading-button.52696f0f.js → loading-button.7167caaf.js} +2 -2
- package/dist/chunks/{loading-button.52696f0f.js.map → loading-button.7167caaf.js.map} +1 -1
- package/dist/chunks/refresh.bd60f6a8.js.map +1 -1
- package/dist/chunks/search.ade93bda.js.map +1 -1
- package/dist/chunks/sidepanel.keys.3f8d69c1.js +7 -0
- package/dist/chunks/sidepanel.keys.3f8d69c1.js.map +1 -0
- package/dist/chunks/{tooltip.d366f95d.js → tooltip.1ee20c7d.js} +3 -3
- package/dist/chunks/{tooltip.d366f95d.js.map → tooltip.1ee20c7d.js.map} +1 -1
- package/dist/code-snippet.js +7 -7
- package/dist/code-snippet.js.map +1 -1
- package/dist/country.js +2 -2
- package/dist/currency.js +1 -1
- package/dist/data-grid.js +999 -990
- 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 +1 -1
- package/dist/dropdown.js +6 -6
- package/dist/empty-state.js +3 -3
- package/dist/filter-bar.js +640 -625
- package/dist/filter-bar.js.map +1 -1
- package/dist/focus-trap.js +1 -1
- package/dist/form-layout.js +2 -2
- package/dist/header.js +3 -3
- package/dist/index.js +262 -256
- package/dist/index.js.map +1 -1
- package/dist/info-icon.js +3 -3
- package/dist/info-icon.js.map +1 -1
- package/dist/input-field.js +4 -4
- package/dist/internal.js +7 -7
- package/dist/link.js +3 -80
- package/dist/link.js.map +1 -1
- package/dist/loading-indicator.js +1 -1
- package/dist/menu.js +1 -1
- package/dist/modal.js +4 -4
- package/dist/pagination.js +4 -4
- 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 +155 -177
- package/dist/radio-group.js.map +1 -1
- package/dist/search-bar.js +2 -2
- package/dist/secondary-nav.js +2 -2
- package/dist/segmented-control.js +3 -3
- package/dist/sidepanel.js +98 -95
- package/dist/sidepanel.js.map +1 -1
- package/dist/status.js +2 -2
- package/dist/stepper.js +3 -3
- package/dist/stepper.js.map +1 -1
- 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 +116 -112
- package/dist/textarea.js.map +1 -1
- package/dist/timeline.js +6 -6
- package/dist/timeline.js.map +1 -1
- package/dist/toast.js +8 -7
- package/dist/toast.js.map +1 -1
- package/dist/toggle.js +2 -2
- package/dist/tutorial.js +5 -5
- package/dist/tutorial.js.map +1 -1
- package/dist/typography.js +1 -1
- package/dist/web-types.json +1 -1
- package/package.json +2 -2
- package/dist/chunks/base-modal.56a671c3.js.map +0 -1
- package/dist/chunks/checkbox.c63cd1d8.js.map +0 -1
- package/dist/chunks/copy.91983fad.js.map +0 -1
- package/dist/chunks/dropdown.b0e80aaa.js.map +0 -1
- package/dist/chunks/index.762f7ec9.js.map +0 -1
- package/dist/chunks/info-filled.e591599f.js.map +0 -1
- package/dist/chunks/listbox.2c0a69a6.js +0 -1419
- package/dist/chunks/listbox.2c0a69a6.js.map +0 -1
package/dist/stepper.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { defineComponent as K, ref as i, computed as a, watch as $, provide as Z, readonly as se, openBlock as d, createElementBlock as S, withDirectives as M, mergeProps as U, unref as s, toHandlers as ne, renderSlot as V, createVNode as A, withCtx as x, createTextVNode as j, toDisplayString as P, createCommentVNode as ae, createElementVNode as G, useSlots as oe, inject as le, onMounted as ue, normalizeClass as re, createBlock as z, Fragment as ie, vShow as pe } from "vue";
|
|
2
|
-
import { B as w } from "./chunks/index.
|
|
2
|
+
import { B as w } from "./chunks/index.a56038f2.js";
|
|
3
3
|
import { B as N, a as ce } from "./chunks/keyboard-navigation.ca47dfa8.js";
|
|
4
4
|
import { u as de } from "./chunks/i18n.6c402773.js";
|
|
5
5
|
import { _ as H } from "./chunks/_plugin-vue_export-helper.dad06003.js";
|
|
6
|
-
import { B as ve } from "./chunks/base-button.
|
|
6
|
+
import { B as ve } from "./chunks/base-button.35d84224.js";
|
|
7
7
|
import { C as _e } from "./chunks/checkmark-small.c79220d9.js";
|
|
8
|
-
import "./assets/
|
|
8
|
+
import "./assets/index38.css";
|
|
9
9
|
const be = (o) => {
|
|
10
10
|
function v(r) {
|
|
11
11
|
return ({ detail: u }) => {
|
package/dist/stepper.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stepper.js","sources":["../../vue2/src/components/stepper/composables/useKeyboardNavigation/useKeyboardNavigation.ts","../../vue2/src/components/stepper/stepper.keys.ts","../../vue2/src/components/stepper/stepper.types.ts","../../vue2/src/components/stepper/stepper.vue","../../vue2/node_modules/@adyen/ui-assets-icons-16/dist/vue/dot.vue","../../vue2/src/components/stepper/components/step/step.vue"],"sourcesContent":["import { Ref } from 'vue';\n\nimport { BentoKeyboardNavigationKeyDownEvent } from '@/types';\n\n/**\n * Returns keyboard navigation's event handlers to navigate through the steps\n *\n * @param steps the list of bento-steps DOM elements to focus on the navigation\n * @returns\n */\nexport const useKeyboardNavigation = (steps: Ref<HTMLButtonElement[]>) => {\n // Returns the event handler that moves the focus on a given step offset\n function focusOnStep(indexOffset: number) {\n return ({ detail: event }) => {\n event.preventDefault();\n\n const currentIndex = steps.value.indexOf(document.activeElement as HTMLButtonElement);\n if (currentIndex < 0) {\n return;\n }\n\n steps.value[currentIndex + indexOffset]?.focus();\n };\n }\n\n const focusOnPreviousStep = focusOnStep(-1);\n const focusOnNextStep = focusOnStep(1);\n\n return {\n [BentoKeyboardNavigationKeyDownEvent.ARROW_DOWN]: focusOnNextStep,\n [BentoKeyboardNavigationKeyDownEvent.ARROW_RIGHT]: focusOnNextStep,\n [BentoKeyboardNavigationKeyDownEvent.ARROW_UP]: focusOnPreviousStep,\n [BentoKeyboardNavigationKeyDownEvent.ARROW_LEFT]: focusOnPreviousStep,\n };\n};\n","import type { InjectionKey } from 'vue';\n\nimport type { BentoStepperState } from './stepper.types';\n\nexport const STEPPER_STATE = Symbol('stepper state') as InjectionKey<BentoStepperState>;\n","import type { ComputedRef, Ref } from 'vue';\n\nexport enum BentoStepperTypeOption {\n LINEAR = 'linear',\n NON_LINEAR = 'non-linear',\n}\n\nexport enum BentoStepperVariantOption {\n HORIZONTAL = 'horizontal',\n VERTICAL = 'vertical',\n}\n\nexport interface BentoStepperStepExposeState {\n buttonElement: HTMLButtonElement | Ref<HTMLButtonElement>;\n substeps: BentoStepperStepExposeState[] | Ref<BentoStepperStepExposeState[]>;\n stepContent: string | ComputedRef<string>;\n}\n\nexport type BentoStepperState = Ref<{\n activeStepIndex: number;\n latestActiveStep: number;\n type: `${BentoStepperTypeOption}`;\n variant: `${BentoStepperVariantOption}`;\n steps: HTMLElement[];\n isParentStep?: boolean;\n navigateToStep: (index: number) => void;\n registerStep: (stepState: BentoStepperStepExposeState) => void;\n}>;\n","<template>\n <nav class=\"b-stepper\">\n <ol\n v-bento-keyboard-navigation-directive\n class=\"b-stepper__list\"\n :class=\"conditionalClasses\"\n v-on=\"keyboardNavigationListeners\"\n >\n <slot></slot>\n </ol>\n\n <bento-typography el=\"span\" variant=\"body\" stronger class=\"b-stepper__text-stepper\"\n >{{\n t('step', { currentIndex: activeStepIndex + 1, totalSteps: stepsAmount, content: currentStepContent })\n }}\n </bento-typography>\n </nav>\n</template>\n\n<script setup lang=\"ts\">\n import { BentoTypography } from '@/components/typography';\n\n import { computed, PropType, provide, readonly, ref, watch } from 'vue';\n import { BentoKeyboardNavigationDirective as vBentoKeyboardNavigationDirective } from '@/directives';\n\n import { useKeyboardNavigation } from './composables/useKeyboardNavigation/useKeyboardNavigation';\n import { useI18n } from '@/utils/ts/i18n';\n\n import { STEPPER_STATE } from './stepper.keys';\n import {\n BentoStepperState,\n BentoStepperStepExposeState,\n BentoStepperTypeOption,\n BentoStepperVariantOption,\n } from './stepper.types';\n\n import messages from './messages.json';\n\n const props = defineProps({\n /**\n * Type of stepper; defines how the stepper should behave. Default: linear\n * @values linear, non-linear\n */\n type: {\n type: String as PropType<`${BentoStepperTypeOption}`>,\n default: 'linear',\n },\n /**\n * Stepper variant; defines how the stepper should be displayed. Default: vertical\n * @values vertical, horizontal\n */\n variant: {\n type: String as PropType<`${BentoStepperVariantOption}`>,\n default: 'vertical',\n },\n /**\n * Active step index\n */\n index: {\n type: Number,\n default: 0,\n },\n });\n\n const emit = defineEmits<{\n /**\n * Event triggered when step is updated by the stepper\n */\n (e: 'update:index', index: number): void;\n }>();\n\n type MessageSchema = (typeof messages)['en-US'];\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n\n const childrenSteps = ref<BentoStepperStepExposeState[]>([]);\n const activeStepIndex = ref(props.index);\n const latestActiveStep = ref(activeStepIndex.value);\n\n const navigateToStep = (index: number) => {\n // Stores latest active step index so users can navigate backwards and forwards on linear stepper\n if (index > latestActiveStep.value) {\n latestActiveStep.value = index;\n }\n activeStepIndex.value = index;\n };\n\n const currentStepContent = computed(() => childrenSteps.value[activeStepIndex.value]?.stepContent);\n const stepsAmount = computed(() => childrenSteps.value.length);\n const childrenStepsElements = computed(() => childrenSteps.value.map(({ buttonElement }) => buttonElement));\n const isHorizontalVariant = computed(() => props.variant === BentoStepperVariantOption.HORIZONTAL);\n\n // List of all visible steps nested on the stepper, including the substeps of the children steps\n // Flattening the steps on a single list makes the keyboard navigation easier to be handled\n const allVisibleStepsElements = computed(() =>\n childrenSteps.value\n .map(({ buttonElement, substeps }, index) => {\n const isStepActive = activeStepIndex.value === index;\n const isSubstepsVisible = !isHorizontalVariant.value && isStepActive;\n\n if (!isSubstepsVisible) {\n return [buttonElement];\n }\n\n return [buttonElement].concat(substeps.map(step => step.buttonElement));\n })\n .flat()\n );\n\n // Maps BentoStep children components whenever the DOM is updated to keep track of steps indexes\n const registerStep = (stepState: BentoStepperStepExposeState) => {\n childrenSteps.value.push({\n stepContent: stepState.stepContent as string,\n buttonElement: stepState.buttonElement as HTMLButtonElement,\n substeps: stepState.substeps as BentoStepperStepExposeState[],\n });\n };\n\n const stepperState: BentoStepperState = ref({\n activeStepIndex,\n latestActiveStep,\n steps: childrenStepsElements,\n type: props.type,\n variant: props.variant,\n navigateToStep,\n registerStep,\n });\n\n const conditionalClasses = computed(() => ({\n 'b-stepper__list--horizontal': isHorizontalVariant.value,\n }));\n\n watch(() => props.index, navigateToStep);\n watch(activeStepIndex, index => {\n emit('update:index', index);\n });\n\n const keyboardNavigationListeners = useKeyboardNavigation(allVisibleStepsElements);\n\n // Provides stepper state to BentoStep children components\n provide(STEPPER_STATE, readonly(stepperState));\n</script>\n\n<script lang=\"ts\">\n /**\n * Steppers break down complex processes into manageable steps to guide users through a sequential or multi-step process.\n *\n * @example\n * import { BentoStep, BentoStepper } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoStep, BentoStepper },\n * template: `\n * <bento-stepper :index=\"1\">\n * <bento-step>Step 1</bento-step>\n * <bento-step>Step 2</bento-step>\n * <bento-step>Step 3</bento-step>\n * </bento-stepper>\n * `\n * }\n */\n\n export default {\n i18n: { messages },\n name: 'stepper',\n };\n</script>\n\n<style scoped src=\"./stepper.scss\" />\n","\n<template>\n <svg role=\"img\" v-bind=\"$attrs\" class=\"ui-assets-icons-16\" xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" fill=\"none\"><title v-if=\"$attrs['svg-title']\">{{ $attrs['svg-title'] }}</title><path fill=\"#00112C\" d=\"M8 5.25C6.48122 5.25 5.25 6.48122 5.25 8C5.25 9.51878 6.48122 10.75 8 10.75C9.51878 10.75 10.75 9.51878 10.75 8C10.75 6.48122 9.51878 5.25 8 5.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 <li :class=\"conditionalClasses\" class=\"b-step\">\n <base-button\n ref=\"buttonComponent\"\n :aria-current=\"ariaCurrentValue\"\n :aria-disabled=\"ariaDisabledValue\"\n class=\"b-step__button\"\n type=\"button\"\n :tabindex=\"tabIndexValue\"\n :disabled=\"isDisabled\"\n @click=\"navigateToStep\"\n @focus=\"isFocused = true\"\n @blur=\"isFocused = false\"\n >\n <template #iconLeft>\n <bento-typography el=\"span\" variant=\"body\" stronger class=\"b-step__index\" aria-hidden=\"true\">\n <checkmark-small-icon v-if=\"isCompleted\" />\n <template v-else-if=\"!isSubstep\">{{ index + 1 }}</template>\n <dot-icon v-else />\n </bento-typography>\n </template>\n\n <bento-typography ref=\"stepContent\" el=\"span\" variant=\"body\" :stronger=\"isActive\" class=\"b-step__content\">\n <slot></slot>\n </bento-typography>\n </base-button>\n\n <ul v-show=\"isSubstepsVisible\" ref=\"substepList\" class=\"b-step__substep-list\">\n <slot name=\"substeps\"></slot>\n </ul>\n </li>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, inject, onMounted, provide, ref, useSlots, watch } from 'vue';\n import { BaseButton } from '@/components/internal/base-button';\n import { BentoTypography } from '@/components/typography';\n import CheckmarkSmallIcon from '@adyen/ui-assets-icons-16/vue/checkmark-small';\n import DotIcon from '@adyen/ui-assets-icons-16/vue/dot';\n\n import { STEPPER_STATE } from '../../stepper.keys';\n import {\n BentoStepperState,\n BentoStepperStepExposeState,\n BentoStepperTypeOption,\n BentoStepperVariantOption,\n } from '../../stepper.types';\n import { Booleanish } from '@/types';\n\n const slots = useSlots();\n\n const props = defineProps({\n /**\n * Completed status. Used on non-linear steppers to indicate if the step is completed.\n */\n completed: {\n type: Boolean,\n default: false,\n },\n /**\n * Active substep index\n */\n substepIndex: {\n type: Number,\n default: 0,\n },\n });\n\n const emit = defineEmits<{\n /**\n * Event triggered when substep is updated by the parent step\n */\n (e: 'update:substep-index', index: number): void;\n }>();\n\n // Element refs\n const buttonComponent = ref<InstanceType<typeof BaseButton> | null>(null);\n const stepContent = ref<InstanceType<typeof BentoTypography> | null>(null);\n const substeps = ref<BentoStepperStepExposeState[]>([]);\n\n // Injects parent BentoStepper state data\n const stepper = inject(STEPPER_STATE);\n\n const buttonElement = computed(() => buttonComponent.value?.$el as HTMLButtonElement);\n const index = computed(() => stepper?.value.steps.indexOf(buttonElement.value));\n\n const stepContentValue = computed(() => stepContent.value?.$el.textContent);\n\n // Substep logic\n const substepsButtonElements = computed(() => substeps.value.map(({ buttonElement }) => buttonElement));\n\n const activeSubStepIndex = ref(props.substepIndex);\n const latestActiveSubStepIndex = ref(activeSubStepIndex.value);\n\n const navigateToSubstep = (value: number) => {\n if (value > latestActiveSubStepIndex.value) {\n latestActiveSubStepIndex.value = value;\n }\n\n activeSubStepIndex.value = value;\n };\n\n const registerSubstep = (stepState: BentoStepperStepExposeState) => {\n substeps.value.push({\n stepContent: stepState.stepContent as string,\n buttonElement: stepState.buttonElement as HTMLButtonElement,\n substeps: stepState.substeps as BentoStepperStepExposeState[],\n });\n };\n\n const stepState: BentoStepperState = ref({\n activeStepIndex: activeSubStepIndex,\n latestActiveStep: latestActiveSubStepIndex,\n type: stepper.value.type,\n variant: stepper.value.variant,\n steps: substepsButtonElements,\n isParentStep: true,\n navigateToStep: navigateToSubstep,\n registerStep: registerSubstep,\n });\n\n provide(STEPPER_STATE, stepState);\n\n watch(() => props.substepIndex, navigateToSubstep);\n watch(activeSubStepIndex, value => {\n emit('update:substep-index', value);\n });\n\n onMounted(() => {\n if (!stepper) {\n throw new Error(\n 'BentoStep components should only be used inside BentoStepper or other BentoStep components.'\n );\n }\n\n stepper.value.registerStep({\n buttonElement,\n stepContent: stepContentValue,\n substeps,\n });\n });\n\n // Step states\n const isSubstep = computed(() => stepper.value.isParentStep);\n const isFocused = ref(false);\n const isActive = computed(() => stepper?.value.activeStepIndex === index.value);\n const isSubstepsVisible = computed(\n () =>\n isActive.value &&\n stepper.value.variant !== BentoStepperVariantOption.HORIZONTAL &&\n !isSubstep.value &&\n slots.substeps\n );\n const isCompleted = computed(() => {\n if (stepper?.value.type === BentoStepperTypeOption.NON_LINEAR) {\n return props.completed;\n }\n\n return stepper?.value.latestActiveStep > index.value;\n });\n const isDisabled = computed(\n () => stepper?.value.type === BentoStepperTypeOption.LINEAR && index.value > stepper?.value.latestActiveStep\n );\n\n const navigateToStep = () => {\n if (isDisabled.value) {\n return;\n }\n\n stepper.value.navigateToStep(index.value);\n };\n\n // Styling and a11y\n const ariaCurrentValue = computed(() => (isActive.value ? 'step' : ('false' as Booleanish)));\n const ariaDisabledValue = computed(() => isDisabled.value.toString() as Booleanish);\n const tabIndexValue = computed(() => (isFocused.value || (index.value === 0 && !isSubstep.value) ? '0' : '-1'));\n\n const conditionalClasses = computed(() => ({\n 'b-step--active': isActive.value,\n 'b-step--completed': isCompleted.value,\n 'b-step--substep': isSubstep.value,\n }));\n</script>\n\n<script lang=\"ts\">\n /**\n * Steps are components placed inside BentoSteppers to break down complex processes\n *\n * @example\n * import { BentoStep } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoStep },\n * template: `\n * <bento-stepper>\n * <bento-step>Step 1</bento-step>\n * <bento-step>\n * Step 2\n * <template #substeps>\n * <bento-step>Substep 1</bento-step>\n * <bento-step>Substep 2</bento-step>\n * </template>\n * </bento-step>\n * </bento-stepper>\n * `\n * }\n */\n\n export default {\n name: 'step',\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./step.scss\" />\n"],"names":["useKeyboardNavigation","steps","focusOnStep","indexOffset","event","currentIndex","_a","focusOnPreviousStep","focusOnNextStep","BentoKeyboardNavigationKeyDownEvent","STEPPER_STATE","BentoStepperTypeOption","BentoStepperTypeOption2","BentoStepperVariantOption","BentoStepperVariantOption2","__default__$1","messages","t","useI18n","childrenSteps","ref","activeStepIndex","props","latestActiveStep","navigateToStep","index","currentStepContent","computed","stepsAmount","childrenStepsElements","buttonElement","isHorizontalVariant","allVisibleStepsElements","substeps","isStepActive","step","registerStep","stepState","stepperState","conditionalClasses","watch","emit","keyboardNavigationListeners","provide","readonly","uuid","openBlock","createElementBlock","mergeProps","_ctx","_hoisted_1$1","toDisplayString","__default__","slots","useSlots","buttonComponent","stepContent","stepper","inject","stepContentValue","substepsButtonElements","buttonElement2","activeSubStepIndex","latestActiveSubStepIndex","navigateToSubstep","value","registerSubstep","stepState2","onMounted","isSubstep","isFocused","isActive","isSubstepsVisible","isCompleted","isDisabled","ariaCurrentValue","ariaDisabledValue","tabIndexValue"],"mappings":";;;;;;;;AAUa,MAAAA,KAAA,CAAAC,MAAA;AAET,WAAAC,EAAAC,GAAA;AACI,WAAA,CAAA,EAAA,QAAAC,EAAA,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AAA,CAAA,GACAG,IAAAlD,EAAA,MAAA2C,EAAA,SAAA7C,EAAA,UAAA,KAAA,CAAA4C,EAAA,QAAA,MAAA,IAAA,GAEA9B,KAAAZ,EAAA,OAAA;AAAA,MAA2C,kBAAA4C,EAAA;AAAA,MACZ,qBAAAE,EAAA;AAAA,MACM,mBAAAJ,EAAA;AAAA,IACJ,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","x_google_ignoreList":[4]}
|
|
1
|
+
{"version":3,"file":"stepper.js","sources":["../../vue2/src/components/stepper/composables/useKeyboardNavigation/useKeyboardNavigation.ts","../../vue2/src/components/stepper/stepper.keys.ts","../../vue2/src/components/stepper/stepper.types.ts","../../vue2/src/components/stepper/stepper.vue","../../../node_modules/@adyen/ui-assets-icons-16/dist/vue/dot.vue","../../vue2/src/components/stepper/components/step/step.vue"],"sourcesContent":["import { Ref } from 'vue';\n\nimport { BentoKeyboardNavigationKeyDownEvent } from '@/types';\n\n/**\n * Returns keyboard navigation's event handlers to navigate through the steps\n *\n * @param steps the list of bento-steps DOM elements to focus on the navigation\n * @returns\n */\nexport const useKeyboardNavigation = (steps: Ref<HTMLButtonElement[]>) => {\n // Returns the event handler that moves the focus on a given step offset\n function focusOnStep(indexOffset: number) {\n return ({ detail: event }) => {\n event.preventDefault();\n\n const currentIndex = steps.value.indexOf(document.activeElement as HTMLButtonElement);\n if (currentIndex < 0) {\n return;\n }\n\n steps.value[currentIndex + indexOffset]?.focus();\n };\n }\n\n const focusOnPreviousStep = focusOnStep(-1);\n const focusOnNextStep = focusOnStep(1);\n\n return {\n [BentoKeyboardNavigationKeyDownEvent.ARROW_DOWN]: focusOnNextStep,\n [BentoKeyboardNavigationKeyDownEvent.ARROW_RIGHT]: focusOnNextStep,\n [BentoKeyboardNavigationKeyDownEvent.ARROW_UP]: focusOnPreviousStep,\n [BentoKeyboardNavigationKeyDownEvent.ARROW_LEFT]: focusOnPreviousStep,\n };\n};\n","import type { InjectionKey } from 'vue';\n\nimport type { BentoStepperState } from './stepper.types';\n\nexport const STEPPER_STATE = Symbol('stepper state') as InjectionKey<BentoStepperState>;\n","import type { ComputedRef, Ref } from 'vue';\n\nexport enum BentoStepperTypeOption {\n LINEAR = 'linear',\n NON_LINEAR = 'non-linear',\n}\n\nexport enum BentoStepperVariantOption {\n HORIZONTAL = 'horizontal',\n VERTICAL = 'vertical',\n}\n\nexport interface BentoStepperStepExposeState {\n buttonElement: HTMLButtonElement | Ref<HTMLButtonElement>;\n substeps: BentoStepperStepExposeState[] | Ref<BentoStepperStepExposeState[]>;\n stepContent: string | ComputedRef<string>;\n}\n\nexport type BentoStepperState = Ref<{\n activeStepIndex: number;\n latestActiveStep: number;\n type: `${BentoStepperTypeOption}`;\n variant: `${BentoStepperVariantOption}`;\n steps: HTMLElement[];\n isParentStep?: boolean;\n navigateToStep: (index: number) => void;\n registerStep: (stepState: BentoStepperStepExposeState) => void;\n}>;\n","<template>\n <nav class=\"b-stepper\">\n <ol\n v-bento-keyboard-navigation-directive\n class=\"b-stepper__list\"\n :class=\"conditionalClasses\"\n v-on=\"keyboardNavigationListeners\"\n >\n <slot></slot>\n </ol>\n\n <bento-typography el=\"span\" variant=\"body\" stronger class=\"b-stepper__text-stepper\"\n >{{\n t('step', { currentIndex: activeStepIndex + 1, totalSteps: stepsAmount, content: currentStepContent })\n }}\n </bento-typography>\n </nav>\n</template>\n\n<script setup lang=\"ts\">\n import { BentoTypography } from '@/components/typography';\n\n import { computed, PropType, provide, readonly, ref, watch } from 'vue';\n import { BentoKeyboardNavigationDirective as vBentoKeyboardNavigationDirective } from '@/directives';\n\n import { useKeyboardNavigation } from './composables/useKeyboardNavigation/useKeyboardNavigation';\n import { useI18n } from '@/utils/ts/i18n';\n\n import { STEPPER_STATE } from './stepper.keys';\n import {\n BentoStepperState,\n BentoStepperStepExposeState,\n BentoStepperTypeOption,\n BentoStepperVariantOption,\n } from './stepper.types';\n\n import messages from './messages.json';\n\n const props = defineProps({\n /**\n * Type of stepper; defines how the stepper should behave. Default: linear\n * @values linear, non-linear\n */\n type: {\n type: String as PropType<`${BentoStepperTypeOption}`>,\n default: 'linear',\n },\n /**\n * Stepper variant; defines how the stepper should be displayed. Default: vertical\n * @values vertical, horizontal\n */\n variant: {\n type: String as PropType<`${BentoStepperVariantOption}`>,\n default: 'vertical',\n },\n /**\n * Active step index\n */\n index: {\n type: Number,\n default: 0,\n },\n });\n\n const emit = defineEmits<{\n /**\n * Event triggered when step is updated by the stepper\n */\n (e: 'update:index', index: number): void;\n }>();\n\n type MessageSchema = (typeof messages)['en-US'];\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n\n const childrenSteps = ref<BentoStepperStepExposeState[]>([]);\n const activeStepIndex = ref(props.index);\n const latestActiveStep = ref(activeStepIndex.value);\n\n const navigateToStep = (index: number) => {\n // Stores latest active step index so users can navigate backwards and forwards on linear stepper\n if (index > latestActiveStep.value) {\n latestActiveStep.value = index;\n }\n activeStepIndex.value = index;\n };\n\n const currentStepContent = computed(() => childrenSteps.value[activeStepIndex.value]?.stepContent);\n const stepsAmount = computed(() => childrenSteps.value.length);\n const childrenStepsElements = computed(() => childrenSteps.value.map(({ buttonElement }) => buttonElement));\n const isHorizontalVariant = computed(() => props.variant === BentoStepperVariantOption.HORIZONTAL);\n\n // List of all visible steps nested on the stepper, including the substeps of the children steps\n // Flattening the steps on a single list makes the keyboard navigation easier to be handled\n const allVisibleStepsElements = computed(() =>\n childrenSteps.value\n .map(({ buttonElement, substeps }, index) => {\n const isStepActive = activeStepIndex.value === index;\n const isSubstepsVisible = !isHorizontalVariant.value && isStepActive;\n\n if (!isSubstepsVisible) {\n return [buttonElement];\n }\n\n return [buttonElement].concat(substeps.map(step => step.buttonElement));\n })\n .flat()\n );\n\n // Maps BentoStep children components whenever the DOM is updated to keep track of steps indexes\n const registerStep = (stepState: BentoStepperStepExposeState) => {\n childrenSteps.value.push({\n stepContent: stepState.stepContent as string,\n buttonElement: stepState.buttonElement as HTMLButtonElement,\n substeps: stepState.substeps as BentoStepperStepExposeState[],\n });\n };\n\n const stepperState: BentoStepperState = ref({\n activeStepIndex,\n latestActiveStep,\n steps: childrenStepsElements,\n type: props.type,\n variant: props.variant,\n navigateToStep,\n registerStep,\n });\n\n const conditionalClasses = computed(() => ({\n 'b-stepper__list--horizontal': isHorizontalVariant.value,\n }));\n\n watch(() => props.index, navigateToStep);\n watch(activeStepIndex, index => {\n emit('update:index', index);\n });\n\n const keyboardNavigationListeners = useKeyboardNavigation(allVisibleStepsElements);\n\n // Provides stepper state to BentoStep children components\n provide(STEPPER_STATE, readonly(stepperState));\n</script>\n\n<script lang=\"ts\">\n /**\n * Steppers break down complex processes into manageable steps to guide users through a sequential or multi-step process.\n *\n * @example\n * import { BentoStep, BentoStepper } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoStep, BentoStepper },\n * template: `\n * <bento-stepper :index=\"1\">\n * <bento-step>Step 1</bento-step>\n * <bento-step>Step 2</bento-step>\n * <bento-step>Step 3</bento-step>\n * </bento-stepper>\n * `\n * }\n */\n\n export default {\n i18n: { messages },\n name: 'stepper',\n };\n</script>\n\n<style scoped src=\"./stepper.scss\" />\n","\n<template>\n <svg role=\"img\" v-bind=\"$attrs\" class=\"ui-assets-icons-16\" xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" fill=\"none\"><title v-if=\"$attrs['svg-title']\">{{ $attrs['svg-title'] }}</title><path fill=\"#00112C\" d=\"M8 5.25C6.48122 5.25 5.25 6.48122 5.25 8C5.25 9.51878 6.48122 10.75 8 10.75C9.51878 10.75 10.75 9.51878 10.75 8C10.75 6.48122 9.51878 5.25 8 5.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 <li :class=\"conditionalClasses\" class=\"b-step\">\n <base-button\n ref=\"buttonComponent\"\n :aria-current=\"ariaCurrentValue\"\n :aria-disabled=\"ariaDisabledValue\"\n class=\"b-step__button\"\n type=\"button\"\n :tabindex=\"tabIndexValue\"\n :disabled=\"isDisabled\"\n @click=\"navigateToStep\"\n @focus=\"isFocused = true\"\n @blur=\"isFocused = false\"\n >\n <template #iconLeft>\n <bento-typography el=\"span\" variant=\"body\" stronger class=\"b-step__index\" aria-hidden=\"true\">\n <checkmark-small-icon v-if=\"isCompleted\" />\n <template v-else-if=\"!isSubstep\">{{ index + 1 }}</template>\n <dot-icon v-else />\n </bento-typography>\n </template>\n\n <bento-typography ref=\"stepContent\" el=\"span\" variant=\"body\" :stronger=\"isActive\" class=\"b-step__content\">\n <slot></slot>\n </bento-typography>\n </base-button>\n\n <ul v-show=\"isSubstepsVisible\" ref=\"substepList\" class=\"b-step__substep-list\">\n <slot name=\"substeps\"></slot>\n </ul>\n </li>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, inject, onMounted, provide, ref, useSlots, watch } from 'vue';\n import { BaseButton } from '@/components/internal/base-button';\n import { BentoTypography } from '@/components/typography';\n import CheckmarkSmallIcon from '@adyen/ui-assets-icons-16/vue/checkmark-small';\n import DotIcon from '@adyen/ui-assets-icons-16/vue/dot';\n\n import { STEPPER_STATE } from '../../stepper.keys';\n import {\n BentoStepperState,\n BentoStepperStepExposeState,\n BentoStepperTypeOption,\n BentoStepperVariantOption,\n } from '../../stepper.types';\n import { Booleanish } from '@/types';\n\n const slots = useSlots();\n\n const props = defineProps({\n /**\n * Completed status. Used on non-linear steppers to indicate if the step is completed.\n */\n completed: {\n type: Boolean,\n default: false,\n },\n /**\n * Active substep index\n */\n substepIndex: {\n type: Number,\n default: 0,\n },\n });\n\n const emit = defineEmits<{\n /**\n * Event triggered when substep is updated by the parent step\n */\n (e: 'update:substep-index', index: number): void;\n }>();\n\n // Element refs\n const buttonComponent = ref<InstanceType<typeof BaseButton> | null>(null);\n const stepContent = ref<InstanceType<typeof BentoTypography> | null>(null);\n const substeps = ref<BentoStepperStepExposeState[]>([]);\n\n // Injects parent BentoStepper state data\n const stepper = inject(STEPPER_STATE);\n\n const buttonElement = computed(() => buttonComponent.value?.$el as HTMLButtonElement);\n const index = computed(() => stepper?.value.steps.indexOf(buttonElement.value));\n\n const stepContentValue = computed(() => stepContent.value?.$el.textContent);\n\n // Substep logic\n const substepsButtonElements = computed(() => substeps.value.map(({ buttonElement }) => buttonElement));\n\n const activeSubStepIndex = ref(props.substepIndex);\n const latestActiveSubStepIndex = ref(activeSubStepIndex.value);\n\n const navigateToSubstep = (value: number) => {\n if (value > latestActiveSubStepIndex.value) {\n latestActiveSubStepIndex.value = value;\n }\n\n activeSubStepIndex.value = value;\n };\n\n const registerSubstep = (stepState: BentoStepperStepExposeState) => {\n substeps.value.push({\n stepContent: stepState.stepContent as string,\n buttonElement: stepState.buttonElement as HTMLButtonElement,\n substeps: stepState.substeps as BentoStepperStepExposeState[],\n });\n };\n\n const stepState: BentoStepperState = ref({\n activeStepIndex: activeSubStepIndex,\n latestActiveStep: latestActiveSubStepIndex,\n type: stepper.value.type,\n variant: stepper.value.variant,\n steps: substepsButtonElements,\n isParentStep: true,\n navigateToStep: navigateToSubstep,\n registerStep: registerSubstep,\n });\n\n provide(STEPPER_STATE, stepState);\n\n watch(() => props.substepIndex, navigateToSubstep);\n watch(activeSubStepIndex, value => {\n emit('update:substep-index', value);\n });\n\n onMounted(() => {\n if (!stepper) {\n throw new Error(\n 'BentoStep components should only be used inside BentoStepper or other BentoStep components.'\n );\n }\n\n stepper.value.registerStep({\n buttonElement,\n stepContent: stepContentValue,\n substeps,\n });\n });\n\n // Step states\n const isSubstep = computed(() => stepper.value.isParentStep);\n const isFocused = ref(false);\n const isActive = computed(() => stepper?.value.activeStepIndex === index.value);\n const isSubstepsVisible = computed(\n () =>\n isActive.value &&\n stepper.value.variant !== BentoStepperVariantOption.HORIZONTAL &&\n !isSubstep.value &&\n slots.substeps\n );\n const isCompleted = computed(() => {\n if (stepper?.value.type === BentoStepperTypeOption.NON_LINEAR) {\n return props.completed;\n }\n\n return stepper?.value.latestActiveStep > index.value;\n });\n const isDisabled = computed(\n () => stepper?.value.type === BentoStepperTypeOption.LINEAR && index.value > stepper?.value.latestActiveStep\n );\n\n const navigateToStep = () => {\n if (isDisabled.value) {\n return;\n }\n\n stepper.value.navigateToStep(index.value);\n };\n\n // Styling and a11y\n const ariaCurrentValue = computed(() => (isActive.value ? 'step' : ('false' as Booleanish)));\n const ariaDisabledValue = computed(() => isDisabled.value.toString() as Booleanish);\n const tabIndexValue = computed(() => (isFocused.value || (index.value === 0 && !isSubstep.value) ? '0' : '-1'));\n\n const conditionalClasses = computed(() => ({\n 'b-step--active': isActive.value,\n 'b-step--completed': isCompleted.value,\n 'b-step--substep': isSubstep.value,\n }));\n</script>\n\n<script lang=\"ts\">\n /**\n * Steps are components placed inside BentoSteppers to break down complex processes\n *\n * @example\n * import { BentoStep } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoStep },\n * template: `\n * <bento-stepper>\n * <bento-step>Step 1</bento-step>\n * <bento-step>\n * Step 2\n * <template #substeps>\n * <bento-step>Substep 1</bento-step>\n * <bento-step>Substep 2</bento-step>\n * </template>\n * </bento-step>\n * </bento-stepper>\n * `\n * }\n */\n\n export default {\n name: 'step',\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./step.scss\" />\n"],"names":["useKeyboardNavigation","steps","focusOnStep","indexOffset","event","currentIndex","_a","focusOnPreviousStep","focusOnNextStep","BentoKeyboardNavigationKeyDownEvent","STEPPER_STATE","BentoStepperTypeOption","BentoStepperTypeOption2","BentoStepperVariantOption","BentoStepperVariantOption2","__default__$1","messages","t","useI18n","childrenSteps","ref","activeStepIndex","props","latestActiveStep","navigateToStep","index","currentStepContent","computed","stepsAmount","childrenStepsElements","buttonElement","isHorizontalVariant","allVisibleStepsElements","substeps","isStepActive","step","registerStep","stepState","stepperState","conditionalClasses","watch","emit","keyboardNavigationListeners","provide","readonly","uuid","openBlock","createElementBlock","mergeProps","_ctx","_hoisted_1$1","toDisplayString","__default__","slots","useSlots","buttonComponent","stepContent","stepper","inject","stepContentValue","substepsButtonElements","buttonElement2","activeSubStepIndex","latestActiveSubStepIndex","navigateToSubstep","value","registerSubstep","stepState2","onMounted","isSubstep","isFocused","isActive","isSubstepsVisible","isCompleted","isDisabled","ariaCurrentValue","ariaDisabledValue","tabIndexValue"],"mappings":";;;;;;;;AAUa,MAAAA,KAAA,CAAAC,MAAA;AAET,WAAAC,EAAAC,GAAA;AACI,WAAA,CAAA,EAAA,QAAAC,EAAA,MAAA;;AACI,MAAAA,EAAA,eAAA;AAEA,YAAAC,IAAAJ,EAAA,MAAA,QAAA,SAAA,aAAA;AACA,MAAAI,IAAA,MAIAC,IAAAL,EAAA,MAAAI,IAAAF,CAAA,MAAA,QAAAG,EAAA;AAAA,IAA+C;AAAA,EACnD;AAGJ,QAAAC,IAAAL,EAAA,EAAA,GACAM,IAAAN,EAAA,CAAA;AAEA,SAAA;AAAA,IAAO,CAAAO,EAAA,UAAA,GAAAD;AAAA,IAC+C,CAAAC,EAAA,WAAA,GAAAD;AAAA,IACC,CAAAC,EAAA,QAAA,GAAAF;AAAA,IACH,CAAAE,EAAA,UAAA,GAAAF;AAAA,EACE;AAE1D,GC9BaG,IAAA,OAAA,eAAA;ACFD,IAAAC,IAAA,kBAAAC,OACRA,EAAA,SAAA,UACAA,EAAA,aAAA,cAFQA,IAAAD,KAAA,CAAA,CAAA,GAKAE,IAAA,kBAAAC,OACRA,EAAA,aAAA,cACAA,EAAA,WAAA,YAFQA,IAAAD,KAAA,CAAA,CAAA;;;;;gCC0JRE,KAAA;AAAA,EAAe,MAAA,EAAA,UAAAC,EAAA;AAAA,EACM,MAAA;AAErB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA5FA,EAAA,GAAAC,EAAA,IAAAC,GAAA,EAAA,UAAAF,EAAA,CAAA,GAEAG,IAAAC,EAAA,CAAA,CAAA,GACAC,IAAAD,EAAAE,EAAA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hC,EAAA,KAA+C,GAEnDiD,IAAA/C;AAAA,MAAmB,OAAA8B,KAAA,gBAAAA,EAAA,MAAA,UAAA9C,EAAA,UAAAc,EAAA,SAAAgC,KAAA,gBAAAA,EAAA,MAAA;AAAA,IAC6E,GAGhGjC,IAAA,MAAA;AACI,MAAAkD,EAAA,SAIAjB,EAAA,MAAA,eAAAhC,EAAA,KAAA;AAAA,IAAwC,GAI5CkD,IAAAhD,EAAA,MAAA4C,EAAA,QAAA,SAAA,OAAA,GACAK,IAAAjD,EAAA,MAAA+C,EAAA,MAAA,SAAA,CAAA,GACAG,IAAAlD,EAAA,MAAA2C,EAAA,SAAA7C,EAAA,UAAA,KAAA,CAAA4C,EAAA,QAAA,MAAA,IAAA,GAEA9B,KAAAZ,EAAA,OAAA;AAAA,MAA2C,kBAAA4C,EAAA;AAAA,MACZ,qBAAAE,EAAA;AAAA,MACM,mBAAAJ,EAAA;AAAA,IACJ,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","x_google_ignoreList":[4]}
|
package/dist/structured-list.js
CHANGED
package/dist/summary-grid.js
CHANGED
|
@@ -4,10 +4,10 @@ import { S as q } from "./chunks/summary-grid.keys.1d1028c2.js";
|
|
|
4
4
|
import { G as U } from "./chunks/grid-layout.c2fe3057.js";
|
|
5
5
|
import { _ } from "./chunks/_plugin-vue_export-helper.dad06003.js";
|
|
6
6
|
import { BentoInfoIcon as Y } from "./info-icon.js";
|
|
7
|
-
import { B as W, a as V } from "./chunks/index.
|
|
7
|
+
import { B as W, a as V } from "./chunks/index.a56038f2.js";
|
|
8
8
|
import { BentoTag as X, BentoTagVariant as L } from "./tag.js";
|
|
9
|
-
import { C as F } from "./chunks/copy.
|
|
10
|
-
import "./assets/
|
|
9
|
+
import { C as F } from "./chunks/copy.d5ee2f1a.js";
|
|
10
|
+
import "./assets/index43.css";
|
|
11
11
|
const H = S({
|
|
12
12
|
name: "bento-summary-grid",
|
|
13
13
|
components: { GridLayout: U },
|
package/dist/tabs.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { defineComponent as w, toRefs as x, ref as v, provide as m, computed as L, inject as h, onUnmounted as V, withDirectives as N, openBlock as _, createElementBlock as p, renderSlot as A, createCommentVNode as C, vShow as $, watch as X, nextTick as Y, resolveComponent as g, createVNode as y, withCtx as E, createElementVNode as f, Fragment as F, renderList as O, normalizeClass as G, withKeys as J, createTextVNode as U, toDisplayString as j } from "vue";
|
|
2
2
|
import { E as q, T as B, a as K } from "./chunks/tabs.keys.358742f2.js";
|
|
3
3
|
import { _ as D } from "./chunks/_plugin-vue_export-helper.dad06003.js";
|
|
4
|
-
import { B as z } from "./chunks/index.
|
|
4
|
+
import { B as z } from "./chunks/index.a56038f2.js";
|
|
5
5
|
import { g as P } from "./chunks/unique-id.a2a2b458.js";
|
|
6
|
-
import { F as H } from "./chunks/fixed-scroller.
|
|
7
|
-
import "./assets/
|
|
6
|
+
import { F as H } from "./chunks/fixed-scroller.f6bc3063.js";
|
|
7
|
+
import "./assets/index45.css";
|
|
8
8
|
const M = w({
|
|
9
9
|
props: {
|
|
10
10
|
/**
|
package/dist/tag.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { defineComponent as d, computed as o, resolveComponent as p, resolveDirective as m, withDirectives as _, openBlock as b, createElementBlock as v, normalizeClass as f, createVNode as g, withCtx as h, createTextVNode as y, toDisplayString as E } from "vue";
|
|
2
|
-
import { B as C } from "./chunks/index.
|
|
3
|
-
import { b as S } from "./chunks/tooltip.
|
|
2
|
+
import { B as C } from "./chunks/index.a56038f2.js";
|
|
3
|
+
import { b as S } from "./chunks/tooltip.1ee20c7d.js";
|
|
4
4
|
import { u as x } from "./chunks/aria-label.ac9651a5.js";
|
|
5
5
|
import { g as c } from "./chunks/get-slot-text.bead058f.js";
|
|
6
6
|
import { _ as $ } from "./chunks/_plugin-vue_export-helper.dad06003.js";
|
|
7
|
-
import "./assets/
|
|
7
|
+
import "./assets/index41.css";
|
|
8
8
|
var n = /* @__PURE__ */ ((e) => (e.GREY = "grey", e.BLUE = "blue", e.GREEN = "green", e.ORANGE = "orange", e.RED = "red", e.WHITE = "white", e))(n || {});
|
|
9
9
|
const w = d({
|
|
10
10
|
name: "bento-tag",
|
package/dist/textarea.js
CHANGED
|
@@ -1,51 +1,51 @@
|
|
|
1
|
-
import { openBlock as o, createElementBlock as
|
|
2
|
-
import { a as
|
|
3
|
-
import { B as
|
|
4
|
-
import { _ as
|
|
5
|
-
import { g as
|
|
6
|
-
import { o as
|
|
7
|
-
import { u as
|
|
8
|
-
import { u as
|
|
9
|
-
import { u as
|
|
10
|
-
import { F as
|
|
11
|
-
import "./assets/
|
|
12
|
-
let
|
|
13
|
-
const
|
|
1
|
+
import { openBlock as o, createElementBlock as E, mergeProps as fe, toDisplayString as H, createCommentVNode as c, createElementVNode as C, defineComponent as pe, useAttrs as ve, toRefs as K, ref as b, toRef as me, computed as r, watch as N, nextTick as he, onMounted as ye, onUnmounted as ge, normalizeClass as L, unref as t, normalizeStyle as V, createBlock as m, withCtx as x, createTextVNode as z, createVNode as w, withKeys as O } from "vue";
|
|
2
|
+
import { a as _e } from "./chunks/button.9a51e27a.js";
|
|
3
|
+
import { B as F } from "./chunks/index.a56038f2.js";
|
|
4
|
+
import { _ as G } from "./chunks/_plugin-vue_export-helper.dad06003.js";
|
|
5
|
+
import { g as Le } from "./chunks/unique-id.a2a2b458.js";
|
|
6
|
+
import { o as q } from "./chunks/resize.a041304d.js";
|
|
7
|
+
import { u as xe } from "./chunks/aria-label.ac9651a5.js";
|
|
8
|
+
import { u as Ce } from "./chunks/i18n.6c402773.js";
|
|
9
|
+
import { u as Ee } from "./chunks/use-form-layout-loading.d03e5d48.js";
|
|
10
|
+
import { F as Se, E as Y } from "./chunks/field-label.a23f17b5.js";
|
|
11
|
+
import "./assets/index44.css";
|
|
12
|
+
let Z = 0;
|
|
13
|
+
const Ae = {
|
|
14
14
|
beforeCreate() {
|
|
15
|
-
this.uuid =
|
|
15
|
+
this.uuid = Z.toString(), Z += 1;
|
|
16
16
|
}
|
|
17
|
-
},
|
|
17
|
+
}, Re = { key: 0 }, $e = /* @__PURE__ */ C("path", {
|
|
18
18
|
fill: "#00112C",
|
|
19
19
|
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"
|
|
20
20
|
}, null, -1);
|
|
21
|
-
function
|
|
22
|
-
return o(),
|
|
21
|
+
function Ie(e, s, a, P, u, S) {
|
|
22
|
+
return o(), E("svg", fe({ role: "img" }, e.$attrs, {
|
|
23
23
|
class: "ui-assets-icons-16",
|
|
24
24
|
xmlns: "http://www.w3.org/2000/svg",
|
|
25
25
|
width: "16",
|
|
26
26
|
height: "16",
|
|
27
27
|
fill: "none"
|
|
28
28
|
}), [
|
|
29
|
-
e.$attrs["svg-title"] ? (o(),
|
|
30
|
-
|
|
29
|
+
e.$attrs["svg-title"] ? (o(), E("title", Re, H(e.$attrs["svg-title"]), 1)) : c("", !0),
|
|
30
|
+
$e
|
|
31
31
|
], 16);
|
|
32
32
|
}
|
|
33
|
-
const
|
|
34
|
-
var
|
|
35
|
-
const
|
|
33
|
+
const ke = /* @__PURE__ */ G(Ae, [["render", Ie]]);
|
|
34
|
+
var M = /* @__PURE__ */ ((e) => (e.HORIZONTAL = "horizontal", e.VERTICAL = "vertical", e.BOTH = "both", e.NONE = "none", e))(M || {}), f = /* @__PURE__ */ ((e) => (e.CLEARABLE = "clearable", e.DISABLED = "disabled", e.ERROR = "error", e.READONLY = "readonly", e))(f || {}), n = /* @__PURE__ */ ((e) => (e.BLUR = "blur", e.CHANGE = "change", e.CLEAR = "clear", e.ESCAPE_PRESSED = "escape-pressed", e.FOCUS = "focus", e.INPUT = "input", e))(n || {});
|
|
35
|
+
const j = {
|
|
36
36
|
"en-US": {
|
|
37
37
|
clearText: "Clear text",
|
|
38
38
|
textarea: "textarea",
|
|
39
39
|
yourTextCanBenAtMost: "Your text can be at most {characterLimit} characters"
|
|
40
40
|
}
|
|
41
|
-
},
|
|
41
|
+
}, Be = ["id", "value", "aria-label", "aria-invalid", "readonly", "disabled", "placeholder", "onKeydown"], Ne = {
|
|
42
42
|
key: 0,
|
|
43
43
|
class: "b-textarea__clear-button"
|
|
44
|
-
},
|
|
45
|
-
i18n: { messages:
|
|
44
|
+
}, we = {
|
|
45
|
+
i18n: { messages: j },
|
|
46
46
|
name: "bento-textarea"
|
|
47
|
-
},
|
|
48
|
-
...
|
|
47
|
+
}, Oe = /* @__PURE__ */ pe({
|
|
48
|
+
...we,
|
|
49
49
|
props: {
|
|
50
50
|
/**
|
|
51
51
|
* Text that labels an the input element
|
|
@@ -96,8 +96,8 @@ const Z = {
|
|
|
96
96
|
*/
|
|
97
97
|
resizable: {
|
|
98
98
|
type: String,
|
|
99
|
-
default:
|
|
100
|
-
validator: (e) => Object.values(
|
|
99
|
+
default: M.BOTH,
|
|
100
|
+
validator: (e) => Object.values(M).includes(e)
|
|
101
101
|
},
|
|
102
102
|
/**
|
|
103
103
|
* Highlights the textarea is required.
|
|
@@ -113,140 +113,144 @@ const Z = {
|
|
|
113
113
|
value: { type: String, default: "" }
|
|
114
114
|
},
|
|
115
115
|
setup(e, { emit: s }) {
|
|
116
|
-
const a = e,
|
|
116
|
+
const a = e, P = ve(), { height: u } = K(a), S = Le("textarea"), i = b(null), p = b(null), l = b(a.value), A = 44, h = b(a.height || `${A}px`), R = b("100%");
|
|
117
|
+
let y = null, g = null;
|
|
118
|
+
const { t: T } = Ce({ messages: j }), { isReadOnly: _ } = Ee(me(a, "readonly")), J = r(() => `${l.value.length} / ${a.characterLimit}`), $ = r(
|
|
117
119
|
() => a.characterLimit && l.value.length > a.characterLimit
|
|
118
|
-
),
|
|
119
|
-
i.value && i.value.scrollHeight >
|
|
120
|
+
), I = () => {
|
|
121
|
+
i.value && i.value.scrollHeight > A && (h.value = `${i.value.scrollHeight + 3}px`);
|
|
120
122
|
};
|
|
121
|
-
|
|
122
|
-
u.value ? h.value = u.value :
|
|
123
|
-
}),
|
|
123
|
+
N(u, () => {
|
|
124
|
+
u.value ? h.value = u.value : I();
|
|
125
|
+
}), N(
|
|
124
126
|
() => a.value,
|
|
125
127
|
() => {
|
|
126
128
|
l.value = a.value;
|
|
127
129
|
},
|
|
128
130
|
{ immediate: !0 }
|
|
129
|
-
),
|
|
131
|
+
), N(
|
|
130
132
|
() => l.value,
|
|
131
133
|
async () => {
|
|
132
134
|
if (!u.value) {
|
|
133
|
-
if (h.value = `${
|
|
135
|
+
if (h.value = `${A}px`, !l.value)
|
|
134
136
|
return;
|
|
135
|
-
await
|
|
137
|
+
await he(), I();
|
|
136
138
|
}
|
|
137
139
|
},
|
|
138
140
|
{ immediate: !0 }
|
|
139
141
|
);
|
|
140
|
-
const
|
|
142
|
+
const U = r(() => !!a.errorMessage || $.value), Q = r(() => ({
|
|
141
143
|
[`b-textarea--${f.DISABLED}`]: a.disabled
|
|
142
|
-
})),
|
|
144
|
+
})), X = r(() => ({
|
|
143
145
|
[`b-textarea__input--${f.CLEARABLE}`]: a.clearable,
|
|
144
|
-
[`b-textarea__input--${f.READONLY}`]:
|
|
145
|
-
[`b-textarea__input--${f.ERROR}`]:
|
|
146
|
+
[`b-textarea__input--${f.READONLY}`]: _.value,
|
|
147
|
+
[`b-textarea__input--${f.ERROR}`]: U.value,
|
|
146
148
|
["b-textarea__input--dynamic-height"]: !u.value
|
|
147
|
-
})),
|
|
149
|
+
})), ee = r(() => ({
|
|
148
150
|
["b-textarea__label-box--no-label"]: !a.label
|
|
149
|
-
})),
|
|
150
|
-
[`b-textarea__label-item--${f.ERROR}`]:
|
|
151
|
-
})),
|
|
152
|
-
ariaLabel:
|
|
151
|
+
})), te = r(() => ({
|
|
152
|
+
[`b-textarea__label-item--${f.ERROR}`]: $.value
|
|
153
|
+
})), ae = r(() => T("yourTextCanBenAtMost", { characterLimit: a.characterLimit })), le = b(P["aria-label"]), { ariaLabel: re, label: k } = K(a), oe = xe({
|
|
154
|
+
ariaLabel: le.value,
|
|
153
155
|
// TODO: take this line away when the aria-label props is removed
|
|
154
|
-
label:
|
|
155
|
-
defaultFallback:
|
|
156
|
-
}),
|
|
157
|
-
() => a.clearable && l.value && !a.disabled && !
|
|
158
|
-
),
|
|
156
|
+
label: re,
|
|
157
|
+
defaultFallback: k
|
|
158
|
+
}), se = r(
|
|
159
|
+
() => a.clearable && l.value && !a.disabled && !_.value
|
|
160
|
+
), B = () => {
|
|
159
161
|
l.value = "", s(n.CLEAR), s(n.INPUT, "");
|
|
160
|
-
},
|
|
161
|
-
d.stopImmediatePropagation(), !a.disabled && !
|
|
162
|
-
},
|
|
162
|
+
}, ie = (d) => {
|
|
163
|
+
d.stopImmediatePropagation(), !a.disabled && !_.value && (l.value = d.target.value, s(n.INPUT, l.value));
|
|
164
|
+
}, ne = () => {
|
|
163
165
|
i.value.scrollTop = 0, s(n.BLUR);
|
|
164
|
-
},
|
|
166
|
+
}, ue = () => {
|
|
165
167
|
i.value.focus(), s(n.FOCUS);
|
|
166
|
-
},
|
|
168
|
+
}, ce = () => {
|
|
167
169
|
s(n.CHANGE);
|
|
168
|
-
},
|
|
170
|
+
}, de = () => {
|
|
169
171
|
s(n.ESCAPE_PRESSED);
|
|
170
|
-
},
|
|
171
|
-
var
|
|
172
|
+
}, D = (d = !1) => {
|
|
173
|
+
var W;
|
|
172
174
|
const v = i.value.style.width;
|
|
173
175
|
if (d && !v)
|
|
174
176
|
return;
|
|
175
|
-
const
|
|
176
|
-
!v || parseInt(v, 10) >
|
|
177
|
+
const be = (W = p == null ? void 0 : p.value) == null ? void 0 : W.offsetWidth;
|
|
178
|
+
!v || parseInt(v, 10) > be ? R.value = "100%" : R.value = v;
|
|
177
179
|
};
|
|
178
|
-
return
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
}),
|
|
182
|
-
|
|
183
|
-
}), u.value ||
|
|
184
|
-
}), (
|
|
180
|
+
return ye(() => {
|
|
181
|
+
y = q(i.value, () => {
|
|
182
|
+
D(!0);
|
|
183
|
+
}), g = q(p.value, () => {
|
|
184
|
+
D();
|
|
185
|
+
}), u.value || I();
|
|
186
|
+
}), ge(() => {
|
|
187
|
+
y == null || y.disconnect(), g == null || g.disconnect();
|
|
188
|
+
}), (d, v) => (o(), E("div", {
|
|
185
189
|
ref_key: "textareaComponent",
|
|
186
190
|
ref: p,
|
|
187
|
-
class:
|
|
191
|
+
class: L(["b-textarea", t(Q)])
|
|
188
192
|
}, [
|
|
189
|
-
|
|
190
|
-
style:
|
|
193
|
+
C("div", {
|
|
194
|
+
style: V({ width: R.value })
|
|
191
195
|
}, [
|
|
192
|
-
|
|
193
|
-
class:
|
|
196
|
+
C("div", {
|
|
197
|
+
class: L(["b-textarea__label-box", t(ee)])
|
|
194
198
|
}, [
|
|
195
|
-
t(
|
|
199
|
+
t(k) ? (o(), m(t(Se), {
|
|
196
200
|
key: 0,
|
|
197
|
-
for: t(
|
|
198
|
-
label: t(
|
|
201
|
+
for: t(S),
|
|
202
|
+
label: t(k),
|
|
199
203
|
"tooltip-text": e.tooltipText,
|
|
200
204
|
optional: e.optional,
|
|
201
205
|
required: e.required
|
|
202
206
|
}, null, 8, ["for", "label", "tooltip-text", "optional", "required"])) : c("", !0),
|
|
203
|
-
e.characterLimit ? (o(), m(t(
|
|
207
|
+
e.characterLimit ? (o(), m(t(F), {
|
|
204
208
|
key: 1,
|
|
205
209
|
el: "span",
|
|
206
|
-
class:
|
|
210
|
+
class: L(["b-textarea__label-item", t(te)])
|
|
207
211
|
}, {
|
|
208
|
-
default:
|
|
209
|
-
|
|
212
|
+
default: x(() => [
|
|
213
|
+
z(H(t(J)), 1)
|
|
210
214
|
]),
|
|
211
215
|
_: 1
|
|
212
216
|
}, 8, ["class"])) : c("", !0)
|
|
213
217
|
], 2),
|
|
214
|
-
|
|
218
|
+
w(t(F), {
|
|
215
219
|
el: "div",
|
|
216
220
|
class: "b-textarea__input-box",
|
|
217
221
|
"aria-disabled": e.disabled
|
|
218
222
|
}, {
|
|
219
|
-
default:
|
|
220
|
-
|
|
221
|
-
id: t(
|
|
223
|
+
default: x(() => [
|
|
224
|
+
C("textarea", {
|
|
225
|
+
id: t(S),
|
|
222
226
|
ref_key: "textareaElement",
|
|
223
227
|
ref: i,
|
|
224
228
|
value: l.value,
|
|
225
|
-
class:
|
|
226
|
-
"aria-label": t(
|
|
227
|
-
"aria-invalid": t(
|
|
228
|
-
readonly: t(
|
|
229
|
+
class: L(["b-textarea__input", t(X)]),
|
|
230
|
+
"aria-label": t(oe),
|
|
231
|
+
"aria-invalid": t(U),
|
|
232
|
+
readonly: t(_),
|
|
229
233
|
disabled: e.disabled,
|
|
230
234
|
placeholder: e.placeholder,
|
|
231
|
-
style:
|
|
232
|
-
onBlur:
|
|
233
|
-
onChange:
|
|
234
|
-
onFocus:
|
|
235
|
-
onInput:
|
|
236
|
-
onKeydown:
|
|
235
|
+
style: V({ resize: e.resizable, height: h.value }),
|
|
236
|
+
onBlur: ne,
|
|
237
|
+
onChange: ce,
|
|
238
|
+
onFocus: ue,
|
|
239
|
+
onInput: ie,
|
|
240
|
+
onKeydown: O(de, ["esc"])
|
|
237
241
|
}, `
|
|
238
|
-
`, 46,
|
|
239
|
-
t(
|
|
240
|
-
|
|
242
|
+
`, 46, Be),
|
|
243
|
+
t(se) ? (o(), E("div", Ne, [
|
|
244
|
+
w(t(_e), {
|
|
241
245
|
variant: "tertiary",
|
|
242
246
|
disabled: e.disabled,
|
|
243
|
-
onClick:
|
|
244
|
-
onKeypress:
|
|
245
|
-
onKeyup:
|
|
247
|
+
onClick: B,
|
|
248
|
+
onKeypress: O(B, ["enter"]),
|
|
249
|
+
onKeyup: O(B, ["space"])
|
|
246
250
|
}, {
|
|
247
|
-
iconLeft:
|
|
248
|
-
|
|
249
|
-
"svg-title": t(
|
|
251
|
+
iconLeft: x(() => [
|
|
252
|
+
w(t(ke), {
|
|
253
|
+
"svg-title": t(T)("clearText")
|
|
250
254
|
}, null, 8, ["svg-title"])
|
|
251
255
|
]),
|
|
252
256
|
_: 1
|
|
@@ -255,21 +259,21 @@ const Z = {
|
|
|
255
259
|
]),
|
|
256
260
|
_: 1
|
|
257
261
|
}, 8, ["aria-disabled"]),
|
|
258
|
-
t(
|
|
262
|
+
t($) ? (o(), m(t(Y), {
|
|
259
263
|
key: 0,
|
|
260
|
-
"error-message": t(
|
|
264
|
+
"error-message": t(ae)
|
|
261
265
|
}, null, 8, ["error-message"])) : c("", !0),
|
|
262
|
-
e.errorMessage ? (o(), m(t(
|
|
266
|
+
e.errorMessage ? (o(), m(t(Y), {
|
|
263
267
|
key: 1,
|
|
264
268
|
"error-message": e.errorMessage
|
|
265
269
|
}, null, 8, ["error-message"])) : c("", !0),
|
|
266
|
-
e.description ? (o(), m(t(
|
|
270
|
+
e.description ? (o(), m(t(F), {
|
|
267
271
|
key: 2,
|
|
268
272
|
class: "b-textarea__description",
|
|
269
273
|
el: "span"
|
|
270
274
|
}, {
|
|
271
|
-
default:
|
|
272
|
-
|
|
275
|
+
default: x(() => [
|
|
276
|
+
z(H(e.description), 1)
|
|
273
277
|
]),
|
|
274
278
|
_: 1
|
|
275
279
|
})) : c("", !0)
|
|
@@ -277,8 +281,8 @@ const Z = {
|
|
|
277
281
|
], 2));
|
|
278
282
|
}
|
|
279
283
|
});
|
|
280
|
-
const
|
|
284
|
+
const ze = /* @__PURE__ */ G(Oe, [["__scopeId", "data-v-d2305d4b"]]);
|
|
281
285
|
export {
|
|
282
|
-
|
|
286
|
+
ze as BentoTextarea
|
|
283
287
|
};
|
|
284
288
|
//# sourceMappingURL=textarea.js.map
|