@adyen/bento-vue3 1.2.0 → 1.3.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 +12 -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/components/checkbox-group/checkbox-group.vue.d.ts +76 -30
- package/dist/@types/packages/vue2/src/components/country/composables/index.d.ts +0 -1
- package/dist/@types/packages/vue2/src/components/country/country.vue.d.ts +1 -2
- package/dist/@types/packages/vue2/src/components/date-picker/date-picker.vue.d.ts +11 -1
- package/dist/@types/packages/vue2/src/components/date-range-picker/date-range-picker.vue.d.ts +11 -1
- package/dist/@types/packages/vue2/src/components/dropdown/dropdown.vue.d.ts +2 -1
- package/dist/@types/packages/vue2/src/components/filter-bar/components/date-range-filter/date-range-filter.vue.d.ts +0 -2
- package/dist/@types/packages/vue2/src/components/form-layout/components/form-layout-field-tip/form-layout-field-tip.vue.d.ts +10 -0
- package/dist/@types/packages/vue2/src/components/form-layout/components/form-layout-field-tip/index.d.ts +1 -0
- package/dist/@types/packages/vue2/src/components/form-layout/components/form-layout-group/composable/use-form-layout-group-percentage.d.ts +3 -0
- package/dist/@types/packages/vue2/src/components/form-layout/components/form-layout-group/form-layout-group.types.d.ts +1 -0
- package/dist/@types/packages/vue2/src/components/form-layout/components/form-layout-group/form-layout-group.vue.d.ts +23 -0
- package/dist/@types/packages/vue2/src/components/form-layout/components/form-layout-group/index.d.ts +1 -0
- package/dist/@types/packages/vue2/src/components/form-layout/components/form-layout-title/form-layout-title.vue.d.ts +33 -0
- package/dist/@types/packages/vue2/src/components/form-layout/components/form-layout-title/index.d.ts +1 -0
- package/dist/@types/packages/vue2/src/components/form-layout/components/index.d.ts +3 -0
- package/dist/@types/packages/vue2/src/components/form-layout/form-layout.types.d.ts +1 -0
- package/dist/@types/packages/vue2/src/components/form-layout/form-layout.vue.d.ts +33 -0
- package/dist/@types/packages/vue2/src/components/form-layout/index.d.ts +2 -0
- package/dist/@types/packages/vue2/src/components/input-field/input-field.vue.d.ts +2 -1
- package/dist/@types/packages/vue2/src/components/internal/controls-group/controls-group.vue.d.ts +53 -22
- package/dist/@types/packages/vue2/src/components/modal/components/base-modal/__mocks__/base-modal.vue.d.ts +3 -3
- package/dist/@types/packages/vue2/src/components/modal/components/base-modal/base-modal.vue.d.ts +51 -44
- package/dist/@types/packages/vue2/src/components/modal/components/modal-default/modal-default.vue.d.ts +3 -3
- package/dist/@types/packages/vue2/src/components/modal/modal.vue.d.ts +4 -12
- package/dist/@types/packages/vue2/src/components/radio-group/radio-group.vue.d.ts +50 -4
- package/dist/@types/packages/vue2/src/components/search-bar/search-bar.vue.d.ts +5 -3
- package/dist/@types/packages/vue2/src/components/sidepanel/components/sidepanel-page.vue.d.ts +68 -0
- package/dist/@types/packages/vue2/src/components/sidepanel/index.d.ts +3 -0
- package/dist/@types/packages/vue2/src/components/sidepanel/sidepanel.keys.d.ts +2 -0
- package/dist/@types/packages/vue2/src/components/sidepanel/sidepanel.types.d.ts +21 -0
- package/dist/@types/packages/vue2/src/components/sidepanel/sidepanel.vue.d.ts +46 -0
- package/dist/@types/packages/vue2/src/components/tabs/tabs.types.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/textarea/textarea.vue.d.ts +2 -1
- package/dist/@types/packages/vue2/src/components/timeline/timeline.types.d.ts +1 -1
- package/dist/@types/packages/vue2/src/composables/index.d.ts +1 -0
- package/dist/@types/packages/vue2/src/composables/use-form-layout-loading/use-form-layout-loading.d.ts +4 -0
- package/dist/@types/packages/vue2/src/index.d.ts +2 -0
- package/dist/@types/packages/vue2/src/utils/ts/dev-environment.d.ts +1 -0
- package/dist/accordion.js +1 -1
- package/dist/alert.js +3 -3
- package/dist/assets/arrow-left.css +1 -0
- package/dist/assets/base-button.css +1 -1
- package/dist/assets/button.css +1 -1
- package/dist/assets/calendar.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/error-message.css +1 -1
- package/dist/assets/footer-actions.css +1 -0
- package/dist/assets/grid-layout.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 -0
- package/dist/assets/index42.css +1 -0
- package/dist/assets/index5.css +1 -1
- package/dist/assets/index6.css +1 -1
- package/dist/assets/index7.css +1 -1
- package/dist/assets/index8.css +1 -1
- package/dist/assets/index9.css +1 -1
- package/dist/assets/listbox-option-tag.css +1 -1
- package/dist/assets/listbox.css +1 -1
- package/dist/assets/loading-button.css +1 -1
- package/dist/assets/tooltip.css +1 -1
- package/dist/avatar-image.js +1 -1
- package/dist/badge.js +1 -1
- package/dist/button.js +3 -3
- package/dist/card.js +3 -3
- package/dist/checkbox.js +111 -97
- package/dist/checkbox.js.map +1 -1
- package/dist/chunks/arrow-left.cdbcc128.js +30 -0
- package/dist/chunks/arrow-left.cdbcc128.js.map +1 -0
- package/dist/chunks/{base-button.4a56c2fb.js → base-button.20be08da.js} +2 -2
- package/dist/chunks/{base-button.4a56c2fb.js.map → base-button.20be08da.js.map} +1 -1
- package/dist/chunks/{button-actions.a6e541ad.js → button-actions.54e28e75.js} +2 -2
- package/dist/chunks/{button-actions.a6e541ad.js.map → button-actions.54e28e75.js.map} +1 -1
- package/dist/chunks/{button.1f630b6e.js → button.e1c39f66.js} +2 -2
- package/dist/chunks/{button.1f630b6e.js.map → button.e1c39f66.js.map} +1 -1
- package/dist/chunks/{calendar.08885a56.js → calendar.09b683b3.js} +6 -6
- package/dist/chunks/calendar.09b683b3.js.map +1 -0
- package/dist/chunks/{checkbox.cfb8b8df.js → checkbox.a404069b.js} +3 -3
- package/dist/chunks/{checkbox.cfb8b8df.js.map → checkbox.a404069b.js.map} +1 -1
- package/dist/chunks/controls-group.60fb2a86.js +136 -0
- package/dist/chunks/controls-group.60fb2a86.js.map +1 -0
- package/dist/chunks/{copy.1ce0203e.js → copy.2cf5e6c3.js} +3 -3
- package/dist/chunks/{copy.1ce0203e.js.map → copy.2cf5e6c3.js.map} +1 -1
- package/dist/chunks/{dropdown-default-textbox.dd77bb42.js → dropdown-default-textbox.203e747f.js} +54 -51
- package/dist/chunks/dropdown-default-textbox.203e747f.js.map +1 -0
- package/dist/chunks/{dropdown.f9997464.js → dropdown.8b415aac.js} +188 -185
- package/dist/chunks/dropdown.8b415aac.js.map +1 -0
- package/dist/chunks/{error-message.b88bb75a.js → error-message.ddfe8ea5.js} +2 -2
- package/dist/chunks/{error-message.b88bb75a.js.map → error-message.ddfe8ea5.js.map} +1 -1
- package/dist/chunks/footer-actions.0f640f87.js +106 -0
- package/dist/chunks/footer-actions.0f640f87.js.map +1 -0
- package/dist/chunks/form-layout.types.a7a1438d.js +5 -0
- package/dist/chunks/form-layout.types.a7a1438d.js.map +1 -0
- package/dist/chunks/{index.361c61d3.js → index.13949709.js} +2 -2
- package/dist/chunks/{index.361c61d3.js.map → index.13949709.js.map} +1 -1
- package/dist/chunks/index.222d29b0.js +120 -0
- package/dist/chunks/index.222d29b0.js.map +1 -0
- package/dist/chunks/{index.64b7b3cc.js → index.3da90517.js} +6 -6
- package/dist/chunks/{index.64b7b3cc.js.map → index.3da90517.js.map} +1 -1
- package/dist/chunks/{index.96001b1d.js → index.aa34e363.js} +3 -3
- package/dist/chunks/{index.96001b1d.js.map → index.aa34e363.js.map} +1 -1
- package/dist/chunks/{index.b46a5047.js → index.c9225c3b.js} +260 -253
- package/dist/chunks/{index.b46a5047.js.map → index.c9225c3b.js.map} +1 -1
- package/dist/chunks/{index.7dd953ea.js → index.d27367cd.js} +2 -2
- package/dist/chunks/{index.7dd953ea.js.map → index.d27367cd.js.map} +1 -1
- package/dist/chunks/{listbox-option-tag.73661a5d.js → listbox-option-tag.5ae8b79b.js} +3 -3
- package/dist/chunks/{listbox-option-tag.73661a5d.js.map → listbox-option-tag.5ae8b79b.js.map} +1 -1
- package/dist/chunks/{listbox.7b5e0eee.js → listbox.0c7c4e5e.js} +339 -339
- package/dist/chunks/listbox.0c7c4e5e.js.map +1 -0
- package/dist/chunks/loading-button.61d8ebe5.js +109 -0
- package/dist/chunks/loading-button.61d8ebe5.js.map +1 -0
- package/dist/chunks/{tooltip.53290a34.js → tooltip.835d9b52.js} +2 -2
- package/dist/chunks/tooltip.835d9b52.js.map +1 -0
- package/dist/chunks/use-form-layout-loading.d03e5d48.js +12 -0
- package/dist/chunks/use-form-layout-loading.d03e5d48.js.map +1 -0
- package/dist/code-snippet.js +6 -6
- package/dist/code-snippet.js.map +1 -1
- package/dist/country.js +559 -595
- package/dist/country.js.map +1 -1
- package/dist/currency.js +1 -1
- package/dist/data-grid.js +682 -702
- package/dist/data-grid.js.map +1 -1
- package/dist/date-picker.js +82 -75
- 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 +67 -62
- package/dist/dropdown.js.map +1 -1
- package/dist/filter-bar.js +446 -442
- package/dist/filter-bar.js.map +1 -1
- package/dist/focus-trap.js +1 -1
- package/dist/form-layout.js +188 -0
- package/dist/form-layout.js.map +1 -0
- package/dist/header.js +3 -3
- package/dist/index.js +191 -187
- package/dist/index.js.map +1 -1
- package/dist/info-icon.js +2 -2
- package/dist/input-field.js +123 -121
- package/dist/input-field.js.map +1 -1
- package/dist/internal.js +6 -6
- package/dist/link.js +2 -2
- package/dist/loading-indicator.js +1 -1
- package/dist/menu.js +4 -4
- package/dist/modal.js +266 -397
- package/dist/modal.js.map +1 -1
- package/dist/pagination.js +4 -4
- package/dist/payment-method.js +2 -2
- package/dist/popover.js +4 -4
- package/dist/popper-container.js +2 -2
- package/dist/radio-group.js +127 -124
- package/dist/radio-group.js.map +1 -1
- package/dist/search-bar.js +2 -2
- package/dist/segmented-control.js +4 -4
- package/dist/sidepanel.js +279 -0
- package/dist/sidepanel.js.map +1 -0
- package/dist/status.js +2 -2
- package/dist/structured-list.js +1 -1
- package/dist/summary-grid.js +3 -3
- package/dist/tabs.js +7 -7
- package/dist/tabs.js.map +1 -1
- package/dist/tag.js +3 -3
- package/dist/textarea.js +97 -95
- package/dist/textarea.js.map +1 -1
- package/dist/timeline.js +8 -8
- package/dist/timeline.js.map +1 -1
- package/dist/toast.js +3 -3
- package/dist/toggle.js +2 -2
- package/dist/typography.js +1 -1
- package/dist/web-types.json +1 -1
- package/package.json +14 -7
- package/dist/@types/packages/vue2/src/components/country/composables/useCountryFlag.d.ts +0 -2
- package/dist/chunks/calendar.08885a56.js.map +0 -1
- package/dist/chunks/controls-group.806da9bd.js +0 -75
- package/dist/chunks/controls-group.806da9bd.js.map +0 -1
- package/dist/chunks/dropdown-default-textbox.dd77bb42.js.map +0 -1
- package/dist/chunks/dropdown.f9997464.js.map +0 -1
- package/dist/chunks/index.ebf5f6cf.js +0 -119
- package/dist/chunks/index.ebf5f6cf.js.map +0 -1
- package/dist/chunks/listbox.7b5e0eee.js.map +0 -1
- package/dist/chunks/loading-button.426d89b9.js +0 -113
- package/dist/chunks/loading-button.426d89b9.js.map +0 -1
- package/dist/chunks/tooltip.53290a34.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkbox.cfb8b8df.js","sources":["../../../vue2/src/components/checkbox/checkbox.types.ts","../../../../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}\n","\n<template>\n <svg role=\"img\" v-bind=\"$attrs\" 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\" fill-rule=\"evenodd\" d=\"M4.25 8C4.25 7.58579 4.58579 7.25 5 7.25H11C11.4142 7.25 11.75 7.58579 11.75 8C11.75 8.41421 11.4142 8.75 11 8.75H5C4.58579 8.75 4.25 8.41421 4.25 8Z\" clip-rule=\"evenodd\"/></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 scoped lang=\"scss\">\n svg {\n display: inline-flex;\n flex-shrink: 0;\n }\n \n svg,\n svg * {\n fill: currentcolor;\n }\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=\"defaultSlotValue || shouldShowErrorMessage\" class=\"b-checkbox__text\">\n <bento-typography\n v-if=\"defaultSlotValue\"\n class=\"b-checkbox__label\"\n :el=\"BentoTypographyElement.SPAN\"\n :variant=\"BentoTypographyVariant.BODY\"\n >\n <slot></slot>\n </bento-typography>\n <bento-typography\n v-if=\"defaultSlotValue && descriptionSlotValue\"\n :id=\"descriptionId\"\n class=\"b-checkbox__description\"\n :el=\"BentoTypographyElement.SPAN\"\n :variant=\"BentoTypographyVariant.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, toRefs } from 'vue';\n import {\n BentoCheckboxEvent,\n BentoCheckboxState,\n BentoCheckboxType,\n BentoMultiCheckboxType,\n } from './checkbox.types';\n import { BentoTypography, BentoTypographyElement, BentoTypographyVariant } 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 { useAriaLabel } from '@/utils/ts/aria-label';\n import { useDefaultSlotValidator, useHasSlot } from '@/composables';\n import { BentoCheckboxGroupItems } from './components/checkbox-group/checkbox-group.types';\n import { getSlotText } from '@/utils/ts/get-slot-text';\n import { generateUid } from '@/utils/ts/unique-id';\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 components: {\n BentoTypography,\n ErrorMessage,\n CheckmarkSmallIcon,\n MinusSmallIcon,\n },\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 * 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 * 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 emits: [BentoCheckboxEvent.UPDATE],\n setup(props, { emit, slots }) {\n const descriptionId = generateUid('description');\n const errorId = generateUid('error');\n const hasSlot = useHasSlot(slots);\n\n const { ariaLabel, disabled, indeterminate, modelValue, readonly, value } = toRefs(props);\n\n const defaultSlotValue = hasSlot('default');\n const descriptionSlotValue = hasSlot('description');\n\n useDefaultSlotValidator('bento-checkbox', defaultSlotValue, descriptionSlotValue);\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 computedAriaLabel = useAriaLabel({\n ariaLabel,\n label: getSlotText(slots)('default'),\n defaultFallback: 'checkbox',\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 } else {\n emit(BentoCheckboxEvent.UPDATE, 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 // Enums\n BentoTypographyElement,\n BentoTypographyVariant,\n\n // Events\n onChange,\n onClick,\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","BentoTypography","ErrorMessage","CheckmarkSmall","MinusSmallIcon","props","emit","slots","descriptionId","generateUid","errorId","hasSlot","useHasSlot","ariaLabel","disabled","indeterminate","modelValue","readonly","value","toRefs","defaultSlotValue","descriptionSlotValue","useDefaultSlotValidator","isCheckboxGroup","computed","isChecked","item","isIndeterminate","shouldShowError","shouldShowErrorMessage","ariaChecked","ariaDescribedBy","computedAriaLabel","useAriaLabel","getSlotText","ariaInvalid","conditionalClass","conditionalClassOutline","BentoTypographyElement","BentoTypographyVariant","event","newValue","newCheckedList","index","createBlock","_component_checkmark_small_icon","createCommentVNode","_component_minus_small_icon","createElementVNode","_cache","args","_hoisted_3","_component_bento_typography","_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,sBADQA,IAAAD,KAAA,CAAA,CAAA;ACLR,IAAAE,IAAA;;EAGI,eAAA;8BAEIA,KAAA;AAAA;;EARuK,MAAA;AAAA,EAAe,aAAA;AAAA,EAAoB,GAAA;AAAA,EAA0J,aAAA;;;AAA5W,SAAAC,EAAA,GAAAC,EAAA,OAAAC,EAAA,EAAA,MAAA,MAAA,GAAAC,EAAA,QAAA;AAAA,IAAgC,OAAA;AAAA,IAAmC,OAAA;AAAA,IAAW,QAAA;AAAA,IAAY,MAAA;AAAA;6BAAYH,EAAA,GAAAC,EAAA,SAAAG,IAAAC,EAAAF,EAAA,OAAA,WAAA,CAAA,GAAA,CAAA;;;;sFCmFtGG,KAAAC,EAAA;AAAA,EAA+B,MAAA;AAAA,EACrB,YAAA;AAAA,IACM,iBAAAC;AAAA,IACR,cAAAC;AAAA,IACA,oBAAAC;AAAA,IACA,gBAAAC;AAAA,EACA;AAAA,EACJ,OAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IACO,OAAA,EAAA,MAAA,CAAA,QAAA,MAAA,GAAA,SAAA,KAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAO4C,YAAA;AAAA,MAQnC,MAAA,CAAA,SAAA,KAAA;AAAA,MACa,SAAA;AAAA,IACZ;AAAA;AAAA;AAAA;AAAA,IACb,UAAA,EAAA,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A,EAAA,0BAAAH,EAAA,GAAAC,EAAA,QAAAyD,IAAA;AAAA,MAMSvD,EAAA,oBAAAH,EAAA,GAAAmD,EAAAQ,GAAA;AAAA,QALU,KAAA;AAAA,QACpB,OAAA;AAAA,QACG,IAAAxD,EAAA,uBAAA;AAAA,QAEK,SAAAA,EAAA,uBAAA;AAAA,MAAA,GAAA;AAAA;;;;MAGP,GAAA,GAAA,CAAA,MAAA,SAAA,CAAA,KAAAkD,EAAA,IAAA,EAAA;AAAA,MAOSlD,EAAA,oBAAAA,EAAA,wBAAAH,EAAA,GAAAmD,EAAAQ,GAAA;AAAA,QANG,KAAA;AAAA,QACb,IAAAxD,EAAA;AAAA,QACA,OAAA;AAAA,QACG,IAAAA,EAAA,uBAAA;AAAA,QAEwB,SAAAA,EAAA,uBAAA;AAAA,MAAA,GAAA;AAAA;;;;MAEf,GAAA,GAAA,CAAA,MAAA,MAAA,SAAA,CAAA,KAAAkD,EAAA,IAAA,EAAA;AAAA,MAAsElD,EAAA,0BAAAH,EAAA,GAAAmD,EAAAS,GAAA;AAAA,QAAlC,KAAA;AAAA,QAAG,IAAAzD,EAAA;AAAA;;;;;;","x_google_ignoreList":[1]}
|
|
1
|
+
{"version":3,"file":"checkbox.a404069b.js","sources":["../../../vue2/src/components/checkbox/checkbox.types.ts","../../../../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}\n","\n<template>\n <svg role=\"img\" v-bind=\"$attrs\" 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\" fill-rule=\"evenodd\" d=\"M4.25 8C4.25 7.58579 4.58579 7.25 5 7.25H11C11.4142 7.25 11.75 7.58579 11.75 8C11.75 8.41421 11.4142 8.75 11 8.75H5C4.58579 8.75 4.25 8.41421 4.25 8Z\" clip-rule=\"evenodd\"/></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 scoped lang=\"scss\">\n svg {\n display: inline-flex;\n flex-shrink: 0;\n }\n \n svg,\n svg * {\n fill: currentcolor;\n }\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=\"defaultSlotValue || shouldShowErrorMessage\" class=\"b-checkbox__text\">\n <bento-typography\n v-if=\"defaultSlotValue\"\n class=\"b-checkbox__label\"\n :el=\"BentoTypographyElement.SPAN\"\n :variant=\"BentoTypographyVariant.BODY\"\n >\n <slot></slot>\n </bento-typography>\n <bento-typography\n v-if=\"defaultSlotValue && descriptionSlotValue\"\n :id=\"descriptionId\"\n class=\"b-checkbox__description\"\n :el=\"BentoTypographyElement.SPAN\"\n :variant=\"BentoTypographyVariant.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, toRefs } from 'vue';\n import {\n BentoCheckboxEvent,\n BentoCheckboxState,\n BentoCheckboxType,\n BentoMultiCheckboxType,\n } from './checkbox.types';\n import { BentoTypography, BentoTypographyElement, BentoTypographyVariant } 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 { useAriaLabel } from '@/utils/ts/aria-label';\n import { useDefaultSlotValidator, useHasSlot } from '@/composables';\n import { BentoCheckboxGroupItems } from './components/checkbox-group/checkbox-group.types';\n import { getSlotText } from '@/utils/ts/get-slot-text';\n import { generateUid } from '@/utils/ts/unique-id';\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 components: {\n BentoTypography,\n ErrorMessage,\n CheckmarkSmallIcon,\n MinusSmallIcon,\n },\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 * 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 * 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 emits: [BentoCheckboxEvent.UPDATE],\n setup(props, { emit, slots }) {\n const descriptionId = generateUid('description');\n const errorId = generateUid('error');\n const hasSlot = useHasSlot(slots);\n\n const { ariaLabel, disabled, indeterminate, modelValue, readonly, value } = toRefs(props);\n\n const defaultSlotValue = hasSlot('default');\n const descriptionSlotValue = hasSlot('description');\n\n useDefaultSlotValidator('bento-checkbox', defaultSlotValue, descriptionSlotValue);\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 computedAriaLabel = useAriaLabel({\n ariaLabel,\n label: getSlotText(slots)('default'),\n defaultFallback: 'checkbox',\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 } else {\n emit(BentoCheckboxEvent.UPDATE, 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 // Enums\n BentoTypographyElement,\n BentoTypographyVariant,\n\n // Events\n onChange,\n onClick,\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","BentoTypography","ErrorMessage","CheckmarkSmall","MinusSmallIcon","props","emit","slots","descriptionId","generateUid","errorId","hasSlot","useHasSlot","ariaLabel","disabled","indeterminate","modelValue","readonly","value","toRefs","defaultSlotValue","descriptionSlotValue","useDefaultSlotValidator","isCheckboxGroup","computed","isChecked","item","isIndeterminate","shouldShowError","shouldShowErrorMessage","ariaChecked","ariaDescribedBy","computedAriaLabel","useAriaLabel","getSlotText","ariaInvalid","conditionalClass","conditionalClassOutline","BentoTypographyElement","BentoTypographyVariant","event","newValue","newCheckedList","index","createBlock","_component_checkmark_small_icon","createCommentVNode","_component_minus_small_icon","createElementVNode","_cache","args","_hoisted_3","_component_bento_typography","_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,sBADQA,IAAAD,KAAA,CAAA,CAAA;ACLR,IAAAE,IAAA;;EAGI,eAAA;8BAEIA,KAAA;AAAA;;EARuK,MAAA;AAAA,EAAe,aAAA;AAAA,EAAoB,GAAA;AAAA,EAA0J,aAAA;;;AAA5W,SAAAC,EAAA,GAAAC,EAAA,OAAAC,EAAA,EAAA,MAAA,MAAA,GAAAC,EAAA,QAAA;AAAA,IAAgC,OAAA;AAAA,IAAmC,OAAA;AAAA,IAAW,QAAA;AAAA,IAAY,MAAA;AAAA;6BAAYH,EAAA,GAAAC,EAAA,SAAAG,IAAAC,EAAAF,EAAA,OAAA,WAAA,CAAA,GAAA,CAAA;;;;sFCmFtGG,KAAAC,EAAA;AAAA,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QACY,cAAAA,EAAA;AAAA,QACI,gBAAAA,EAAA;AAAA,QACF,oBAAAA,EAAA;AAAA,QACI,gBAAAA,EAAA;AAAA,QACR,SAAAA,EAAA;AAAA,QACV,UAAAA,EAAA;AAAA,QACO,kBAAAA,EAAA;AAAA,QACA,OAAAA,EAAA;AAAA,QACP,OAAAA,EAAA;AAAA,QACM,iBAAAA,EAAA;AAAA,QACD,UAAAqD,EAAA,CAAA,MAAAA,EAAA,CAAA,IAAA,IAAAC,MAAAtD,EAAA,YAAAA,EAAA,SAAA,GAAAsD,CAAA;AAAA;;IAGkB,CAAA;AAAA,IAElBtD,EAAA,oBAAAA,EAAA,0BAAAH,EAAA,GAAAC,EAAA,QAAAyD,IAAA;AAAA,MAMSvD,EAAA,oBAAAH,EAAA,GAAAmD,EAAAQ,GAAA;AAAA,QALU,KAAA;AAAA,QACpB,OAAA;AAAA,QACG,IAAAxD,EAAA,uBAAA;AAAA,QAEK,SAAAA,EAAA,uBAAA;AAAA,MAAA,GAAA;AAAA;;;;MAGP,GAAA,GAAA,CAAA,MAAA,SAAA,CAAA,KAAAkD,EAAA,IAAA,EAAA;AAAA,MAOSlD,EAAA,oBAAAA,EAAA,wBAAAH,EAAA,GAAAmD,EAAAQ,GAAA;AAAA,QANG,KAAA;AAAA,QACb,IAAAxD,EAAA;AAAA,QACA,OAAA;AAAA,QACG,IAAAA,EAAA,uBAAA;AAAA,QAEwB,SAAAA,EAAA,uBAAA;AAAA,MAAA,GAAA;AAAA;;;;MAEf,GAAA,GAAA,CAAA,MAAA,MAAA,SAAA,CAAA,KAAAkD,EAAA,IAAA,EAAA;AAAA,MAAsElD,EAAA,0BAAAH,EAAA,GAAAmD,EAAAS,GAAA;AAAA,QAAlC,KAAA;AAAA,QAAG,IAAAzD,EAAA;AAAA;;;;;;","x_google_ignoreList":[1]}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { defineComponent as x, useAttrs as N, computed as b, openBlock as o, createElementBlock as f, normalizeClass as y, unref as e, createElementVNode as m, createVNode as A, withCtx as s, createTextVNode as n, toDisplayString as i, createBlock as d, createCommentVNode as a, renderSlot as C } from "vue";
|
|
2
|
+
import { d as k, B as c, a as u } from "./index.222d29b0.js";
|
|
3
|
+
import { BentoInfoIcon as q } from "../info-icon.js";
|
|
4
|
+
import { u as v } from "./i18n.6c402773.js";
|
|
5
|
+
import { _ as P } from "./_plugin-vue_export-helper.dad06003.js";
|
|
6
|
+
import "../assets/controls-group.css";
|
|
7
|
+
const _ = {
|
|
8
|
+
"en-US": {
|
|
9
|
+
optional: "optional",
|
|
10
|
+
required: "required"
|
|
11
|
+
}
|
|
12
|
+
}, T = ["form", "disabled", "aria-describedby"], L = {
|
|
13
|
+
key: 0,
|
|
14
|
+
class: "b-controls-group__label"
|
|
15
|
+
}, D = {
|
|
16
|
+
i18n: { messages: _ }
|
|
17
|
+
}, I = /* @__PURE__ */ x({
|
|
18
|
+
...D,
|
|
19
|
+
__name: "controls-group",
|
|
20
|
+
props: {
|
|
21
|
+
/**
|
|
22
|
+
* Descriptive supporting text visbile underneath the label.
|
|
23
|
+
*/
|
|
24
|
+
description: { type: String, default: null },
|
|
25
|
+
/**
|
|
26
|
+
* Sets all child controls of the <fieldset> as disabled.
|
|
27
|
+
*/
|
|
28
|
+
disabled: { type: Boolean, default: !1 },
|
|
29
|
+
/**
|
|
30
|
+
* 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.
|
|
31
|
+
*/
|
|
32
|
+
form: { type: String, default: null },
|
|
33
|
+
/**
|
|
34
|
+
* Shows/hides the group label.
|
|
35
|
+
*/
|
|
36
|
+
hideLabel: { type: Boolean, default: null },
|
|
37
|
+
/**
|
|
38
|
+
* The name associated with the group. Required for accessibility purposes.
|
|
39
|
+
* The label is shown when `hideLabel` is set to `true` or if `description` is passed
|
|
40
|
+
*/
|
|
41
|
+
label: { type: String, required: !0 },
|
|
42
|
+
/**
|
|
43
|
+
* Indicates the field is optional.
|
|
44
|
+
*/
|
|
45
|
+
optional: { type: Boolean, default: !1 },
|
|
46
|
+
/**
|
|
47
|
+
* Indicates the field is required.
|
|
48
|
+
*/
|
|
49
|
+
required: { type: Boolean, default: !1 },
|
|
50
|
+
/**
|
|
51
|
+
* Tooltip message.
|
|
52
|
+
*/
|
|
53
|
+
tooltipText: { type: String, default: null }
|
|
54
|
+
},
|
|
55
|
+
setup(t) {
|
|
56
|
+
const l = t, { t: p } = v({ messages: _ }), h = N(), g = b(() => {
|
|
57
|
+
var r;
|
|
58
|
+
return {
|
|
59
|
+
"aria-describedby": (r = h["aria-describedby"]) == null ? void 0 : r.toString()
|
|
60
|
+
};
|
|
61
|
+
}), S = b(() => ({
|
|
62
|
+
"b-controls-group--disabled": l.disabled
|
|
63
|
+
})), w = b(() => ({
|
|
64
|
+
"b-controls-group__label-container--hidden": !(l.label && l.description || l.hideLabel === !1)
|
|
65
|
+
}));
|
|
66
|
+
return !l.description && l.hideLabel == null && k(
|
|
67
|
+
"The property `label` will always be rendered by default.",
|
|
68
|
+
'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`',
|
|
69
|
+
"2.0.0"
|
|
70
|
+
), (r, B) => (o(), f("fieldset", {
|
|
71
|
+
class: y(["b-controls-group", e(S)]),
|
|
72
|
+
form: t.form,
|
|
73
|
+
disabled: t.disabled,
|
|
74
|
+
"aria-describedby": e(g)["aria-describedby"]
|
|
75
|
+
}, [
|
|
76
|
+
m("legend", {
|
|
77
|
+
class: y(["b-controls-group__label-container", e(w)])
|
|
78
|
+
}, [
|
|
79
|
+
t.label ? (o(), f("div", L, [
|
|
80
|
+
A(e(c), {
|
|
81
|
+
el: e(u).SPAN,
|
|
82
|
+
stronger: ""
|
|
83
|
+
}, {
|
|
84
|
+
default: s(() => [
|
|
85
|
+
n(i(t.label), 1)
|
|
86
|
+
]),
|
|
87
|
+
_: 1
|
|
88
|
+
}, 8, ["el"]),
|
|
89
|
+
m("div", null, [
|
|
90
|
+
t.tooltipText ? (o(), d(e(q), {
|
|
91
|
+
key: 0,
|
|
92
|
+
class: "b-controls-group__tooltip",
|
|
93
|
+
"tooltip-text": t.tooltipText
|
|
94
|
+
}, null, 8, ["tooltip-text"])) : a("", !0)
|
|
95
|
+
]),
|
|
96
|
+
t.optional ? (o(), d(e(c), {
|
|
97
|
+
key: 0,
|
|
98
|
+
class: "b-controls-group__label-requirement",
|
|
99
|
+
el: e(u).SPAN
|
|
100
|
+
}, {
|
|
101
|
+
default: s(() => [
|
|
102
|
+
n(" (" + i(e(p)("optional")) + ") ", 1)
|
|
103
|
+
]),
|
|
104
|
+
_: 1
|
|
105
|
+
}, 8, ["el"])) : a("", !0),
|
|
106
|
+
t.required ? (o(), d(e(c), {
|
|
107
|
+
key: 1,
|
|
108
|
+
class: "b-controls-group__label-requirement",
|
|
109
|
+
el: e(u).SPAN
|
|
110
|
+
}, {
|
|
111
|
+
default: s(() => [
|
|
112
|
+
n(" (" + i(e(p)("required")) + ") ", 1)
|
|
113
|
+
]),
|
|
114
|
+
_: 1
|
|
115
|
+
}, 8, ["el"])) : a("", !0)
|
|
116
|
+
])) : a("", !0),
|
|
117
|
+
t.description ? (o(), d(e(c), {
|
|
118
|
+
key: 1,
|
|
119
|
+
class: "b-controls-group__description",
|
|
120
|
+
el: e(u).SPAN
|
|
121
|
+
}, {
|
|
122
|
+
default: s(() => [
|
|
123
|
+
n(i(t.description), 1)
|
|
124
|
+
]),
|
|
125
|
+
_: 1
|
|
126
|
+
}, 8, ["el"])) : a("", !0)
|
|
127
|
+
], 2),
|
|
128
|
+
C(r.$slots, "default", {}, void 0, !0)
|
|
129
|
+
], 10, T));
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
const j = /* @__PURE__ */ P(I, [["__scopeId", "data-v-49dd9539"]]);
|
|
133
|
+
export {
|
|
134
|
+
j as C
|
|
135
|
+
};
|
|
136
|
+
//# sourceMappingURL=controls-group.60fb2a86.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"controls-group.60fb2a86.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 <div v-if=\"label\" class=\"b-controls-group__label\">\n <bento-typography :el=\"BentoTypographyElement.SPAN\" stronger>\n {{ label }}\n </bento-typography>\n\n <div>\n <bento-info-icon\n v-if=\"!!tooltipText\"\n class=\"b-controls-group__tooltip\"\n :tooltip-text=\"tooltipText\"\n />\n </div>\n <bento-typography\n v-if=\"optional\"\n class=\"b-controls-group__label-requirement\"\n :el=\"BentoTypographyElement.SPAN\"\n >\n ({{ t('optional') }})\n </bento-typography>\n <bento-typography\n v-if=\"required\"\n class=\"b-controls-group__label-requirement\"\n :el=\"BentoTypographyElement.SPAN\"\n >\n ({{ t('required') }})\n </bento-typography>\n </div>\n <bento-typography\n v-if=\"description\"\n class=\"b-controls-group__description\"\n :el=\"BentoTypographyElement.SPAN\"\n >\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, BentoTypographyElement } from '@/components/typography';\n import { BentoInfoIcon } from '@/components/info-icon';\n import { useI18n } from '@/utils/ts/i18n';\n import { deprecate } from '@/utils/ts/deprecate';\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\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 i18n: { messages },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./controls-group.scss\" />\n"],"names":["__default__","messages","t","useI18n","attrs","useAttrs","ariaAttributes","computed","_a","conditionalClasses","props","legendConditionalClasses","deprecate"],"mappings":";;;;;;;;;;;;;;GAqKIA,IAAA;AAAA,EAAe,MAAA,EAAA,UAAAC,EAAA;AAEf;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA9GA,EAAA,GAAAC,EAAA,IAAAC,EAAA,EAAA,UAAAF,EAAA,CAAA,GAEAG,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,7 +1,7 @@
|
|
|
1
1
|
import { openBlock as r, createElementBlock as p, mergeProps as $, toDisplayString as m, createCommentVNode as b, pushScopeId as T, popScopeId as k, createElementVNode as V, defineComponent as h, ref as C, computed as w, resolveComponent as y, resolveDirective as R, withDirectives as v, renderSlot as B, createBlock as I, withCtx as E, createVNode as P } from "vue";
|
|
2
|
-
import { B as S, a as H } from "./button.
|
|
2
|
+
import { B as S, a as H } from "./button.e1c39f66.js";
|
|
3
3
|
import { PopperContainerPosition as D } from "../popper-container.js";
|
|
4
|
-
import { b as A } from "./tooltip.
|
|
4
|
+
import { b as A } from "./tooltip.835d9b52.js";
|
|
5
5
|
import { u as F } from "./i18n.6c402773.js";
|
|
6
6
|
import { _ as g } from "./_plugin-vue_export-helper.dad06003.js";
|
|
7
7
|
import "../assets/copy.css";
|
|
@@ -125,4 +125,4 @@ const X = /* @__PURE__ */ g(G, [["render", q], ["__scopeId", "data-v-b31298fb"]]
|
|
|
125
125
|
export {
|
|
126
126
|
X as C
|
|
127
127
|
};
|
|
128
|
-
//# sourceMappingURL=copy.
|
|
128
|
+
//# sourceMappingURL=copy.2cf5e6c3.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"copy.
|
|
1
|
+
{"version":3,"file":"copy.2cf5e6c3.js","sources":["../../../../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\" 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\" fill-rule=\"evenodd\" 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.25V3.5C9.25 3.08579 8.91421 2.75 8.5 2.75H3.5C3.08579 2.75 2.75 3.08579 2.75 3.5V8.5C2.75 8.91421 3.08579 9.25 3.5 9.25H5.25V7.5C5.25 6.25736 6.25736 5.25 7.5 5.25H9.25ZM6.75 12.5C6.75 12.9142 7.08579 13.25 7.5 13.25H12.5C12.9142 13.25 13.25 12.9142 13.25 12.5V7.5C13.25 7.08579 12.9142 6.75 12.5 6.75H7.5C7.08579 6.75 6.75 7.08579 6.75 7.5V12.5Z\" clip-rule=\"evenodd\"/></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 scoped lang=\"scss\">\n svg {\n display: inline-flex;\n flex-shrink: 0;\n }\n \n svg,\n svg * {\n fill: currentcolor;\n }\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=\"BentoButtonVariant.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, BentoButtonVariant } 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 BentoButtonVariant,\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","copyText","computed","BentoButtonVariant","_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;;EARuK,MAAA;AAAA,EA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AGlCG,IAAAC,EAAA,MAAA;AACI,cAAAN,EAAA,OAAA;AAAA,QAAyB,KAAAX,EAAA;AAEjB,iBAAA,EAAA,QAAA;AAAA,QAAiB,KAAAA,EAAA;AAEjB,iBAAA,EAAA,YAAA;AAAA,QAAqB,KAAAA,EAAA;AAAA,QACH;AAElB,iBAAA,EAAA,MAAA;AAAA,MAAe;AAAA,IACvB,CAAA;AAGJ,WAAA;AAAA,MAAO,oBAAAkB;AAAA,MACH,UAAAF;AAAA,MACA,aAAAF;AAAA,MACA,WAAAC;AAAA,MACA,uBAAAF;AAAA,IACA;AAAA,EACJ;AAER,CAAA;;EA3FkD,KAAA;AAAA,EAAM,MAAA;AAAA;;;mDAClDM,IAAAC,EAAA,yBAAA;;IAfyB,OAAA;AAAA,IAAc,cAAAC,EAAA,CAAA,MAAAA,EAAA,CAAA,IAAA,IAAAC,MAAAzB,EAAA,aAAAA,EAAA,UAAA,GAAAyB,CAAA;AAAA,IACvB,YAAAD,EAAA,CAAA,MAAAA,EAAA,CAAA,IAAA,IAAAC,MAAAzB,EAAA,aAAAA,EAAA,UAAA,GAAAyB,CAAA;AAAA,EAAQ,GAAA;AAAA;MAAiE,KAAA;AAAA;IAC/E,GAAA;AAAA,MAD6DC,EAAA1B,EAAA,QAAA,WAAA,CAAA,GAAA,QAAA,EAAA;AAAA,IAAnB,CAAA,IAAA;AAAA;IAYvC,CAAA,IAAA2B,GAAA9B,EAAA,GAAA+B,EAAAC,GAAA;AAAA,MAN0B,KAAA;AAAA,MACpC,SAAA7B,EAAA,mBAAA;AAAA;IAEkB,GAAA;AAAA,MACH,UAAA8B,EAAA,MAAA;AAAA,QAAaC,EAAAC,GAAA;AAAA;;;;;;IAGD,CAAA;AAAA;;;;","x_google_ignoreList":[0]}
|
package/dist/chunks/{dropdown-default-textbox.dd77bb42.js → dropdown-default-textbox.203e747f.js}
RENAMED
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
import { defineComponent as V, ref as Y, computed as c, resolveComponent as v, openBlock as l, createElementBlock as d,
|
|
1
|
+
import { defineComponent as V, ref as Y, computed as c, resolveComponent as v, openBlock as l, createElementBlock as d, normalizeClass as O, withKeys as I, createVNode as g, withCtx as _, mergeProps as E, renderSlot as S, normalizeProps as L, createTextVNode as D, toDisplayString as C, Fragment as $, renderList as P, createElementVNode as T, guardReactiveProps as k, createCommentVNode as N, withModifiers as B, toHandlers as M, createSlots as W, withDirectives as x, vShow as A } from "vue";
|
|
2
2
|
import { g as q } from "./unique-id.a2a2b458.js";
|
|
3
3
|
import { u as H } from "./use-has-slot.068222e6.js";
|
|
4
|
-
import { B as j, a as z, b as G } from "./index.
|
|
4
|
+
import { B as j, a as z, b as G } from "./index.222d29b0.js";
|
|
5
5
|
import { d as J, B as Q } from "./debounce.f8d92e44.js";
|
|
6
6
|
import { C as X } from "./cross-circle-fill.0feb37b3.js";
|
|
7
7
|
import { _ as R } from "./_plugin-vue_export-helper.dad06003.js";
|
|
8
|
-
import { s as
|
|
8
|
+
import { s as h } from "./events.58c00e6d.js";
|
|
9
9
|
import { C as Z, a as ee } from "./chevron-down.69bedf14.js";
|
|
10
10
|
import "../assets/dropdown-default-textbox.css";
|
|
11
11
|
var i = /* @__PURE__ */ ((e) => (e.DISABLED = "disabled", e.READONLY = "readonly", e.HAS_ITEMS = "has-items", e.OPENED = "opened", e.ERROR = "error", e))(i || {}), o = /* @__PURE__ */ ((e) => (e.OPEN = "open", e.KEYDOWN = "keydown", e.CLOSE = "close", e.INPUT = "input", e.CLEAR = "clear", e))(o || {});
|
|
12
12
|
const oe = V({
|
|
13
13
|
name: "dropdown-base-textbox",
|
|
14
14
|
components: { BentoTypography: j, CrossCircleFillIcon: X },
|
|
15
|
+
inheritAttrs: !1,
|
|
15
16
|
props: {
|
|
16
17
|
/**
|
|
17
18
|
* The number of additional items that have been selected in the dropdown.
|
|
@@ -109,7 +110,7 @@ const oe = V({
|
|
|
109
110
|
[`b-dropdown-base-textbox--${i.DISABLED}`]: e.disabled,
|
|
110
111
|
[`b-dropdown-base-textbox--${i.READONLY}`]: e.readonly,
|
|
111
112
|
[`b-dropdown-base-textbox--${i.HAS_ITEMS}`]: !!e.additionalItemsSelected
|
|
112
|
-
})), p = c(() => e.dynamicFiltering && !!e.value),
|
|
113
|
+
})), p = c(() => e.dynamicFiltering && !!e.value), a = c(
|
|
113
114
|
() => {
|
|
114
115
|
var y;
|
|
115
116
|
return {
|
|
@@ -127,7 +128,7 @@ const oe = V({
|
|
|
127
128
|
!e.disabled && !e.readonly && (r.value.focus(), t(o.OPEN));
|
|
128
129
|
}, b = () => {
|
|
129
130
|
e.open && (r.value.focus(), t(o.CLOSE));
|
|
130
|
-
},
|
|
131
|
+
}, n = (y) => e.open && y.target.tagName === "INPUT" ? null : e.open ? b() : w(), K = () => {
|
|
131
132
|
t(o.CLEAR), t(o.INPUT, ""), r.value.focus();
|
|
132
133
|
}, F = J((y) => {
|
|
133
134
|
t(o.INPUT, y.target.value);
|
|
@@ -145,11 +146,11 @@ const oe = V({
|
|
|
145
146
|
textboxId: m,
|
|
146
147
|
textbox: r,
|
|
147
148
|
isFiltering: p,
|
|
148
|
-
ariaAttributes:
|
|
149
|
+
ariaAttributes: a,
|
|
149
150
|
selectedValueItems: U,
|
|
150
151
|
// Events
|
|
151
152
|
onCloseDropdown: b,
|
|
152
|
-
onToggleDropdown:
|
|
153
|
+
onToggleDropdown: n,
|
|
153
154
|
onClearSearch: K,
|
|
154
155
|
onInputEvent: F,
|
|
155
156
|
// Methods
|
|
@@ -157,7 +158,7 @@ const oe = V({
|
|
|
157
158
|
};
|
|
158
159
|
}
|
|
159
160
|
});
|
|
160
|
-
const te = ["id", "value", "disabled", "readonly"],
|
|
161
|
+
const te = ["id", "value", "disabled", "readonly"], ae = ["id"], ne = {
|
|
161
162
|
key: 1,
|
|
162
163
|
class: "b-dropdown-base-textbox__input-multiple-selected"
|
|
163
164
|
}, le = { class: "b-dropdown-base-textbox__input-selected-element" }, de = {
|
|
@@ -171,16 +172,17 @@ const te = ["id", "value", "disabled", "readonly"], ne = ["id"], ae = {
|
|
|
171
172
|
function re(e, t, s, f, r, m) {
|
|
172
173
|
const u = v("cross-circle-fill-icon"), p = v("bento-typography");
|
|
173
174
|
return l(), d("div", {
|
|
175
|
+
class: O(e.$attrs.class),
|
|
174
176
|
"data-testid": "textbox-wrapper",
|
|
175
|
-
onClick: t[6] || (t[6] = (...
|
|
176
|
-
onKeydown: t[7] || (t[7] = I((...
|
|
177
|
+
onClick: t[6] || (t[6] = (...a) => e.onToggleDropdown && e.onToggleDropdown(...a)),
|
|
178
|
+
onKeydown: t[7] || (t[7] = I((...a) => e.onCloseDropdown && e.onCloseDropdown(...a), ["escape"]))
|
|
177
179
|
}, [
|
|
178
180
|
g(p, {
|
|
179
|
-
class:
|
|
181
|
+
class: O(["b-dropdown-base-textbox", e.conditionalClasses]),
|
|
180
182
|
el: e.BentoTypographyElement.DIV,
|
|
181
183
|
"data-testid": "base-textbox"
|
|
182
184
|
}, {
|
|
183
|
-
default:
|
|
185
|
+
default: _(() => [
|
|
184
186
|
e.dynamicFiltering ? (l(), d("input", E({ key: 0 }, e.ariaAttributes, {
|
|
185
187
|
id: e.textboxId,
|
|
186
188
|
ref: "textbox",
|
|
@@ -192,10 +194,10 @@ function re(e, t, s, f, r, m) {
|
|
|
192
194
|
disabled: e.disabled ? !0 : null,
|
|
193
195
|
readonly: e.readonly,
|
|
194
196
|
onKeydown: [
|
|
195
|
-
t[0] || (t[0] = (
|
|
196
|
-
t[1] || (t[1] = I((...
|
|
197
|
+
t[0] || (t[0] = (a) => e.$emit(e.DropdownBaseTextboxEvent.KEYDOWN, a)),
|
|
198
|
+
t[1] || (t[1] = I((...a) => e.onToggleDropdown && e.onToggleDropdown(...a), ["enter"]))
|
|
197
199
|
],
|
|
198
|
-
onInput: t[2] || (t[2] = (...
|
|
200
|
+
onInput: t[2] || (t[2] = (...a) => e.onInputEvent && e.onInputEvent(...a))
|
|
199
201
|
}), null, 16, te)) : (l(), d("div", E({
|
|
200
202
|
key: 1,
|
|
201
203
|
id: e.textboxId
|
|
@@ -205,22 +207,22 @@ function re(e, t, s, f, r, m) {
|
|
|
205
207
|
role: "combobox",
|
|
206
208
|
tabindex: 0
|
|
207
209
|
}), [
|
|
208
|
-
e.selectedValueItem && !e.multiple ? S(e.$slots, "default",
|
|
210
|
+
e.selectedValueItem && !e.multiple ? S(e.$slots, "default", L(E({ key: 0 }, e.selectedValueItem)), () => [
|
|
209
211
|
D(C(e.displayValue), 1)
|
|
210
|
-
], !0) : e.selectedValueItem && e.showSlotContentInMultiple ? (l(), d("div",
|
|
211
|
-
(l(!0), d(
|
|
212
|
-
key:
|
|
212
|
+
], !0) : e.selectedValueItem && e.showSlotContentInMultiple ? (l(), d("div", ne, [
|
|
213
|
+
(l(!0), d($, null, P(e.selectedValueItems, (a) => (l(), d("div", {
|
|
214
|
+
key: a.value
|
|
213
215
|
}, [
|
|
214
216
|
T("div", le, [
|
|
215
|
-
S(e.$slots, "default",
|
|
217
|
+
S(e.$slots, "default", L(k(a)), () => [
|
|
216
218
|
D(C(e.displayValue), 1)
|
|
217
219
|
], !0)
|
|
218
220
|
])
|
|
219
221
|
]))), 128))
|
|
220
|
-
])) : (l(), d(
|
|
222
|
+
])) : (l(), d($, { key: 2 }, [
|
|
221
223
|
D(C(e.displayValue), 1)
|
|
222
224
|
], 64))
|
|
223
|
-
], 16,
|
|
225
|
+
], 16, ae)),
|
|
224
226
|
e.additionalItemsSelected ? (l(), d("span", de, C(e.additionalItemsSelected), 1)) : N("", !0),
|
|
225
227
|
e.hasSlot("icon") && !e.isFiltering ? (l(), d("span", se, [
|
|
226
228
|
S(e.$slots, "icon", {}, void 0, !0)
|
|
@@ -230,20 +232,21 @@ function re(e, t, s, f, r, m) {
|
|
|
230
232
|
class: "b-dropdown-base-textbox__clear-search",
|
|
231
233
|
tabindex: "0",
|
|
232
234
|
"data-testid": "clear-search-button",
|
|
233
|
-
onClick: t[3] || (t[3] =
|
|
234
|
-
onKeydown: t[4] || (t[4] = I(
|
|
235
|
-
onKeyup: t[5] || (t[5] = I((...
|
|
235
|
+
onClick: t[3] || (t[3] = B((...a) => e.onClearSearch && e.onClearSearch(...a), ["stop"])),
|
|
236
|
+
onKeydown: t[4] || (t[4] = I(B((...a) => e.onClearSearch && e.onClearSearch(...a), ["stop"]), ["enter"])),
|
|
237
|
+
onKeyup: t[5] || (t[5] = I((...a) => e.onClearSearch && e.onClearSearch(...a), ["space"]))
|
|
236
238
|
}, [
|
|
237
239
|
g(u, { "svg-title": "clearSearch" })
|
|
238
240
|
], 32)) : N("", !0)
|
|
239
241
|
]),
|
|
240
242
|
_: 3
|
|
241
243
|
}, 8, ["class", "el"])
|
|
242
|
-
],
|
|
244
|
+
], 34);
|
|
243
245
|
}
|
|
244
|
-
const ie = /* @__PURE__ */ R(oe, [["render", re], ["__scopeId", "data-v-
|
|
246
|
+
const ie = /* @__PURE__ */ R(oe, [["render", re], ["__scopeId", "data-v-7cd102f9"]]), ue = V({
|
|
245
247
|
name: "dropdown-default-textbox",
|
|
246
248
|
components: { ChevronDownIcon: Z, ChevronUpIcon: ee, DropdownBaseTextbox: ie },
|
|
249
|
+
inheritAttrs: !1,
|
|
247
250
|
emits: [
|
|
248
251
|
o.OPEN,
|
|
249
252
|
o.CLOSE,
|
|
@@ -342,20 +345,20 @@ const ie = /* @__PURE__ */ R(oe, [["render", re], ["__scopeId", "data-v-46ca987d
|
|
|
342
345
|
[`b-dropdown-default-textbox--${i.DISABLED}`]: e.disabled,
|
|
343
346
|
[`b-dropdown-default-textbox--${i.READONLY}`]: e.readonly,
|
|
344
347
|
[`b-dropdown-default-textbox--${i.OPENED}`]: e.open
|
|
345
|
-
})), r = c(() => e.open && !e.disabled && !e.readonly), m = (
|
|
346
|
-
s(o.INPUT,
|
|
347
|
-
}, u = (
|
|
348
|
-
s(o.KEYDOWN,
|
|
349
|
-
}, p = (
|
|
350
|
-
|
|
351
|
-
},
|
|
352
|
-
|
|
353
|
-
}, w = (
|
|
354
|
-
|
|
348
|
+
})), r = c(() => e.open && !e.disabled && !e.readonly), m = (n) => {
|
|
349
|
+
s(o.INPUT, n);
|
|
350
|
+
}, u = (n) => {
|
|
351
|
+
s(o.KEYDOWN, n);
|
|
352
|
+
}, p = (n) => {
|
|
353
|
+
h(n), s(o.OPEN);
|
|
354
|
+
}, a = (n) => {
|
|
355
|
+
h(n), s(o.CLOSE);
|
|
356
|
+
}, w = (n) => {
|
|
357
|
+
h(n), s(o.CLEAR);
|
|
355
358
|
}, b = {
|
|
356
359
|
[o.INPUT]: m,
|
|
357
360
|
[o.OPEN]: p,
|
|
358
|
-
[o.CLOSE]:
|
|
361
|
+
[o.CLOSE]: a,
|
|
359
362
|
[o.CLEAR]: w,
|
|
360
363
|
[o.KEYDOWN]: u
|
|
361
364
|
};
|
|
@@ -373,41 +376,41 @@ const ie = /* @__PURE__ */ R(oe, [["render", re], ["__scopeId", "data-v-46ca987d
|
|
|
373
376
|
});
|
|
374
377
|
const pe = { class: "b-dropdown-default-textbox__chevron" };
|
|
375
378
|
function be(e, t, s, f, r, m) {
|
|
376
|
-
const u = v("chevron-up-icon"), p = v("chevron-down-icon"),
|
|
379
|
+
const u = v("chevron-up-icon"), p = v("chevron-down-icon"), a = v("dropdown-base-textbox");
|
|
377
380
|
return l(), d("div", {
|
|
378
|
-
class:
|
|
381
|
+
class: O(["b-dropdown-default-textbox", e.conditionalClasses]),
|
|
379
382
|
"data-testid": "default-textbox"
|
|
380
383
|
}, [
|
|
381
|
-
g(
|
|
384
|
+
g(a, E({ ...e.$attrs, ...e.$props }, {
|
|
382
385
|
class: "b-dropdown-default-textbox__textbox",
|
|
383
386
|
value: e.value
|
|
384
387
|
}, M(e.listeners)), W({
|
|
385
|
-
icon:
|
|
388
|
+
icon: _(() => [
|
|
386
389
|
T("div", pe, [
|
|
387
|
-
|
|
388
|
-
[
|
|
390
|
+
x(g(u, { "svg-title": "opened" }, null, 512), [
|
|
391
|
+
[A, e.isDropdownOpen]
|
|
389
392
|
]),
|
|
390
|
-
|
|
391
|
-
[
|
|
393
|
+
x(g(p, { "svg-title": "closed" }, null, 512), [
|
|
394
|
+
[A, !e.isDropdownOpen]
|
|
392
395
|
])
|
|
393
396
|
])
|
|
394
397
|
]),
|
|
395
398
|
_: 2
|
|
396
399
|
}, [
|
|
397
|
-
|
|
400
|
+
P(e.slots, (w, b) => ({
|
|
398
401
|
name: b,
|
|
399
|
-
fn:
|
|
400
|
-
S(e.$slots, b,
|
|
402
|
+
fn: _((n) => [
|
|
403
|
+
S(e.$slots, b, L(k(n)), void 0, !0)
|
|
401
404
|
])
|
|
402
405
|
}))
|
|
403
406
|
]), 1040, ["value"])
|
|
404
407
|
], 2);
|
|
405
408
|
}
|
|
406
|
-
const Se = /* @__PURE__ */ R(ue, [["render", be], ["__scopeId", "data-v-
|
|
409
|
+
const Se = /* @__PURE__ */ R(ue, [["render", be], ["__scopeId", "data-v-d7ba386d"]]);
|
|
407
410
|
export {
|
|
408
411
|
ie as D,
|
|
409
412
|
o as a,
|
|
410
413
|
i as b,
|
|
411
414
|
Se as c
|
|
412
415
|
};
|
|
413
|
-
//# sourceMappingURL=dropdown-default-textbox.
|
|
416
|
+
//# sourceMappingURL=dropdown-default-textbox.203e747f.js.map
|