@adyen/bento-vue2 1.7.0 → 1.7.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/accordion.js +2 -2
- package/dist/action-bar.js +4 -4
- package/dist/alert.js +3 -3
- package/dist/assets/base-modal.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/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/avatar-image.js +1 -1
- package/dist/badge.js +1 -1
- package/dist/button.js +5 -5
- package/dist/card.js +1 -1
- package/dist/checkbox.js +6 -6
- package/dist/chunks/{base-button.7886a7e6.js → base-button.9ec79f68.js} +2 -2
- package/dist/chunks/{base-button.7886a7e6.js.map → base-button.9ec79f68.js.map} +1 -1
- package/dist/chunks/{base-modal.88e7b9d4.js → base-modal.ab0f82b2.js} +4 -4
- package/dist/chunks/{base-modal.88e7b9d4.js.map → base-modal.ab0f82b2.js.map} +1 -1
- package/dist/chunks/{button-actions-with-menu.a5413243.js → button-actions-with-menu.9d1365e9.js} +2 -2
- package/dist/chunks/{button-actions-with-menu.a5413243.js.map → button-actions-with-menu.9d1365e9.js.map} +1 -1
- package/dist/chunks/{button.e09d5980.js → button.1dfed6fa.js} +2 -2
- package/dist/chunks/{button.e09d5980.js.map → button.1dfed6fa.js.map} +1 -1
- package/dist/chunks/{calendar.24d0ac04.js → calendar.10c1c697.js} +4 -4
- package/dist/chunks/{calendar.24d0ac04.js.map → calendar.10c1c697.js.map} +1 -1
- package/dist/chunks/{checkbox.5343e28e.js → checkbox.65480106.js} +3 -3
- package/dist/chunks/{checkbox.5343e28e.js.map → checkbox.65480106.js.map} +1 -1
- package/dist/chunks/{controls-group.2a21bd83.js → controls-group.066adff1.js} +2 -2
- package/dist/chunks/{controls-group.2a21bd83.js.map → controls-group.066adff1.js.map} +1 -1
- package/dist/chunks/{copy.346eadb1.js → copy.c41143ac.js} +4 -4
- package/dist/chunks/{copy.346eadb1.js.map → copy.c41143ac.js.map} +1 -1
- package/dist/chunks/{dropdown-default-textbox.25134789.js → dropdown-default-textbox.62feef5c.js} +2 -2
- package/dist/chunks/{dropdown-default-textbox.25134789.js.map → dropdown-default-textbox.62feef5c.js.map} +1 -1
- package/dist/chunks/{dropdown.f1253a54.js → dropdown.805b5c7d.js} +6 -6
- package/dist/chunks/{dropdown.f1253a54.js.map → dropdown.805b5c7d.js.map} +1 -1
- package/dist/chunks/{error-message.8302a46c.js → error-message.a7c6edb2.js} +2 -2
- package/dist/chunks/{error-message.8302a46c.js.map → error-message.a7c6edb2.js.map} +1 -1
- package/dist/chunks/{fixed-scroller.8994e30a.js → fixed-scroller.92574ff8.js} +2 -2
- package/dist/chunks/{fixed-scroller.8994e30a.js.map → fixed-scroller.92574ff8.js.map} +1 -1
- package/dist/chunks/{footer-actions.c9b2cb74.js → footer-actions.55ce06ef.js} +3 -3
- package/dist/chunks/{footer-actions.c9b2cb74.js.map → footer-actions.55ce06ef.js.map} +1 -1
- package/dist/chunks/{index.965ac1af.js → index.4de86bd4.js} +2 -2
- package/dist/chunks/{index.965ac1af.js.map → index.4de86bd4.js.map} +1 -1
- package/dist/chunks/{index.2625175a.js → index.77d9d16d.js} +2 -2
- package/dist/chunks/{index.2625175a.js.map → index.77d9d16d.js.map} +1 -1
- package/dist/chunks/{index.37283390.js → index.9da73645.js} +5 -5
- package/dist/chunks/{index.37283390.js.map → index.9da73645.js.map} +1 -1
- package/dist/chunks/{index.b83f8b7e.js → index.c2dde601.js} +2 -2
- package/dist/chunks/{index.b83f8b7e.js.map → index.c2dde601.js.map} +1 -1
- package/dist/chunks/{index.a201f750.js → index.e1602f79.js} +3 -3
- package/dist/chunks/{index.a201f750.js.map → index.e1602f79.js.map} +1 -1
- package/dist/chunks/{index.e566354f.js → index.e350b173.js} +8 -8
- package/dist/chunks/{index.e566354f.js.map → index.e350b173.js.map} +1 -1
- package/dist/chunks/{index.8ac70774.js → index.eec7f750.js} +3 -3
- package/dist/chunks/{index.8ac70774.js.map → index.eec7f750.js.map} +1 -1
- package/dist/chunks/{index.d6b5f5e1.js → index.f649c9af.js} +6 -6
- package/dist/chunks/{index.d6b5f5e1.js.map → index.f649c9af.js.map} +1 -1
- package/dist/chunks/{listbox-option-tag.6a09e8e2.js → listbox-option-tag.9ddbbdad.js} +3 -3
- package/dist/chunks/{listbox-option-tag.6a09e8e2.js.map → listbox-option-tag.9ddbbdad.js.map} +1 -1
- package/dist/chunks/{listbox.73c38f38.js → listbox.a144a5c8.js} +4 -4
- package/dist/chunks/{listbox.73c38f38.js.map → listbox.a144a5c8.js.map} +1 -1
- package/dist/chunks/{loading-button.c65682d6.js → loading-button.70de254a.js} +2 -2
- package/dist/chunks/{loading-button.c65682d6.js.map → loading-button.70de254a.js.map} +1 -1
- package/dist/chunks/{tooltip.104e5fac.js → tooltip.57d6cc22.js} +3 -3
- package/dist/chunks/{tooltip.104e5fac.js.map → tooltip.57d6cc22.js.map} +1 -1
- package/dist/code-snippet.js +7 -7
- package/dist/country.js +2 -2
- package/dist/currency.js +1 -1
- package/dist/data-grid.js +8 -8
- package/dist/date-picker.js +7 -7
- package/dist/date-range-picker.js +2 -2
- package/dist/date.js +1 -1
- package/dist/divider.js +1 -1
- package/dist/dropdown.js +4 -4
- package/dist/empty-state.js +3 -3
- package/dist/filter-bar.js +13 -13
- package/dist/focus-trap.js +1 -1
- package/dist/form-layout.js +2 -2
- package/dist/header.js +3 -3
- package/dist/index.js +13 -13
- package/dist/info-icon.js +3 -3
- package/dist/input-field.js +4 -4
- package/dist/internal.js +7 -7
- package/dist/link.js +2 -2
- package/dist/loading-indicator.js +1 -1
- package/dist/menu.js +1 -1
- package/dist/modal.js +3 -3
- package/dist/pagination.js +4 -4
- package/dist/payment-method.js +2 -2
- package/dist/popover.js +4 -4
- package/dist/popper-container.js +1 -1
- package/dist/radio-group.js +4 -4
- package/dist/search-bar.js +2 -2
- package/dist/segmented-control.js +3 -3
- package/dist/sidepanel.js +5 -5
- package/dist/status.js +2 -2
- package/dist/stepper.js +3 -3
- package/dist/structured-list.js +1 -1
- package/dist/summary-grid.js +3 -3
- package/dist/tabs.js +3 -3
- package/dist/tag.js +3 -3
- package/dist/textarea.js +4 -4
- package/dist/timeline.js +5 -5
- package/dist/toast.js +3 -3
- package/dist/toggle.js +2 -2
- package/dist/tutorial.js +4 -4
- package/dist/typography.js +1 -1
- package/dist/web-types.json +7 -7
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.965ac1af.js","sources":["../../src/components/typography/typography.types.ts","../../src/utils/ts/dev-environment.ts","../../src/utils/ts/print-development-warning.ts","../../src/utils/ts/deprecate.ts","../../src/components/typography/typography.vue"],"sourcesContent":["/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoTypographyVariant {\n CAPTION = 'caption',\n BODY = 'body',\n /** @deprecated Use \"TITLE\" instead. */\n SUBTITLE = 'subtitle',\n TITLE = 'title',\n}\n\nexport enum BentoTypographyModifier {\n WIDE = 'wide',\n STRONGER = 'stronger',\n STRONGER_WIDE = 'stronger-wide',\n STRONGEST = 'strongest',\n STRONGEST_WIDE = 'strongest-wide',\n MEDIUM = 'm',\n LARGE = 'l',\n MOBILE = 'mobile',\n}\n\n/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoTypographyElement {\n H1 = 'h1',\n H2 = 'h2',\n H3 = 'h3',\n H4 = 'h4',\n H5 = 'h5',\n H6 = 'h6',\n DIV = 'div',\n PARAGRAPH = 'p',\n SPAN = 'span',\n}\n","const DEV_ENVIROMENT_NAMES = ['development', 'DEVELOPMENT', 'dev', 'DEV'];\n\nexport const isDevelopmentEnviroment = () => DEV_ENVIROMENT_NAMES.includes(process.env.NODE_ENV);\n","import { isDevelopmentEnviroment } from '@/utils/ts/dev-environment';\n\n/**\n * Prints console.warn messages in development mode only.\n *\n * @see console.warn for what parameters you can use\n */\n\nexport function printDevelopmentWarning(...args: Parameters<typeof console.warn>) {\n if (isDevelopmentEnviroment()) {\n // eslint-disable-next-line no-console\n console.warn(...args);\n }\n}\n","import { printDevelopmentWarning } from './print-development-warning';\n\nconst DEPRECATION_STYLES = ['color: red', 'background: yellow'].join(';');\n\n/**\n * Informs users about the deprecations in development mode only.\n *\n * @param title Indicates what is being deprecated.\n * @param deprecationMessage How to avoid the deprecation by giving an example of the alternatives. Backticks can be used to multi-line the message.\n * @param toBeRemovedInVersion The version it will be removed. Must be in X.Y.Z format.\n */\nexport function deprecate(title: string, deprecationMessage: string, toBeRemovedInVersion: string) {\n printDevelopmentWarning(`%cDEPRECATED:\\x1b[0m ${title}`, DEPRECATION_STYLES);\n // Format multi-line descriptions with the backtick\n printDevelopmentWarning(`${deprecationMessage.replaceAll('\\t', '').replaceAll(' ', '').trim()}`);\n printDevelopmentWarning(`To be removed in: %c${toBeRemovedInVersion}`, DEPRECATION_STYLES);\n}\n","<template>\n <component :is=\"el\" class=\"b-typography\" :class=\"conditionalClasses\" data-testid=\"typography\">\n <slot />\n </component>\n</template>\n\n<script lang=\"ts\">\n import { computed, defineComponent, PropType } from 'vue';\n import { BentoTypographyElement, BentoTypographyModifier, BentoTypographyVariant } from './typography.types';\n import { deprecate } from '@/utils/ts/deprecate';\n\n /**\n * The Typography component makes it easy to apply a default set of font weights, sizes and other text styles\n * easily to text. The variants and properties match with those found in Figma.\n *\n * For example, seeing text with the typography styling of\n *\n * @example\n * import { BentoTypography } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoTypography },\n * template: `\n * <bento-typography>\n * ... text content\n * </bento-typography>\n * `\n * }\n */\n export default defineComponent({\n name: 'bento-typography',\n inheritAttrs: true,\n props: {\n /**\n * Sets the HTML DOM element.\n * @values h1, h2, h3, h4, h5, h6, div, p, span\n */\n el: {\n type: String as PropType<BentoTypographyElement | `${BentoTypographyElement}`>,\n default: BentoTypographyElement.PARAGRAPH,\n validator: (value: BentoTypographyElement) => Object.values(BentoTypographyElement).includes(value),\n },\n\n /**\n * Adds the stronger class modifier.\n * Applicable to Caption, Body and Subtitle variants.\n */\n stronger: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Adds the strongest class modifier.\n * Applicable to Caption, Body and Subtitle variants.\n */\n strongest: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Sets the type of typography variant.\n * @values caption, body, title.\n */\n variant: {\n type: String as PropType<BentoTypographyVariant | `${BentoTypographyVariant}`>,\n default: BentoTypographyVariant.BODY,\n validator: (value: BentoTypographyVariant) => Object.values(BentoTypographyVariant).includes(value),\n },\n\n /**\n * Adds the medium class modifier.\n * Applicable to the Title variant.\n */\n medium: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Adds the large class modifier.\n * Applicable to the Title variant.\n */\n large: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Adds the medium class modifier.\n * Applicable to tje Body variant.\n */\n wide: {\n type: Boolean,\n default: false,\n },\n },\n setup(props) {\n if (props.variant === BentoTypographyVariant.SUBTITLE) {\n deprecate(\n 'BentoTypography \"subtitle\" variant (BentoTypographyVariant.SUBTITLE)',\n `Use the \"title\" or \"BentoTypographyVariant.TITLE\" variant and (optionally) combine it with a size property. e.g. medium / large.\n <bento-typography :variant=\"BentoTypographyVariant.TITLE\" medium>`,\n '2.0.0'\n );\n }\n\n const conditionalClasses = computed(() => ({\n // Caption\n [`b-typography--${BentoTypographyVariant.CAPTION}`]: props.variant === BentoTypographyVariant.CAPTION,\n [`b-typography--${BentoTypographyVariant.CAPTION}-${BentoTypographyModifier.WIDE}`]:\n props.variant === BentoTypographyVariant.CAPTION && props.wide,\n [`b-typography--${BentoTypographyVariant.CAPTION}-${BentoTypographyModifier.STRONGER}`]:\n props.variant === BentoTypographyVariant.CAPTION && props.stronger,\n\n // Body\n [`b-typography--${BentoTypographyVariant.BODY}`]: props.variant === BentoTypographyVariant.BODY,\n [`b-typography--${BentoTypographyVariant.BODY}-${BentoTypographyModifier.WIDE}`]:\n props.variant === BentoTypographyVariant.BODY && props.wide,\n [`b-typography--${BentoTypographyVariant.BODY}-${BentoTypographyModifier.STRONGER}`]:\n props.variant === BentoTypographyVariant.BODY && props.stronger,\n [`b-typography--${BentoTypographyVariant.BODY}-${BentoTypographyModifier.STRONGEST}`]:\n props.variant === BentoTypographyVariant.BODY && props.strongest,\n\n // Subtitle\n [`b-typography--${BentoTypographyVariant.SUBTITLE}`]: props.variant === BentoTypographyVariant.SUBTITLE,\n [`b-typography--${BentoTypographyVariant.SUBTITLE}-${BentoTypographyModifier.STRONGER}`]:\n props.variant === BentoTypographyVariant.SUBTITLE && props.stronger,\n\n // Title\n [`b-typography--${BentoTypographyVariant.TITLE}`]:\n props.variant === BentoTypographyVariant.TITLE && !props.medium && !props.large,\n [`b-typography--${BentoTypographyVariant.TITLE}-${BentoTypographyModifier.MEDIUM}`]:\n props.variant === BentoTypographyVariant.TITLE && props.medium,\n [`b-typography--${BentoTypographyVariant.TITLE}-${BentoTypographyModifier.LARGE}`]:\n props.variant === BentoTypographyVariant.TITLE && props.large,\n }));\n\n return {\n conditionalClasses,\n };\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./typography.scss\" />\n"],"names":["BentoTypographyVariant","BentoTypographyVariant2","BentoTypographyModifier","BentoTypographyModifier2","BentoTypographyElement","BentoTypographyElement2","DEV_ENVIROMENT_NAMES","isDevelopmentEnviroment","printDevelopmentWarning","args","DEPRECATION_STYLES","deprecate","title","deprecationMessage","toBeRemovedInVersion","_sfc_main","defineComponent","value","props","computed"],"mappings":";;;AAGY,IAAAA,IAAA,kBAAAC,OACRA,EAAA,UAAA,WACAA,EAAA,OAAA,QAEAA,EAAA,WAAA,YACAA,EAAA,QAAA,SALQA,IAAAD,KAAA,CAAA,CAAA,GAQAE,IAAA,kBAAAC,OACRA,EAAA,OAAA,QACAA,EAAA,WAAA,YACAA,EAAA,gBAAA,iBACAA,EAAA,YAAA,aACAA,EAAA,iBAAA,kBACAA,EAAA,SAAA,KACAA,EAAA,QAAA,KACAA,EAAA,SAAA,UARQA,IAAAD,KAAA,CAAA,CAAA,GAcAE,IAAA,kBAAAC,OACRA,EAAA,KAAA,MACAA,EAAA,KAAA,MACAA,EAAA,KAAA,MACAA,EAAA,KAAA,MACAA,EAAA,KAAA,MACAA,EAAA,KAAA,MACAA,EAAA,MAAA,OACAA,EAAA,YAAA,KACAA,EAAA,OAAA,QATQA,IAAAD,KAAA,CAAA,CAAA;ACzBZ,MAAAE,IAAA,CAAA,eAAA,eAAA,OAAA,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AAA,OAAA,GAAAgB,EAAA,YAAAlB,EAAA,SAAAkB,EAAA;AAAA,MAEA,EAAA;AAAA,IAIA;AAAA,EACA;AAEA,CAAA;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"index.4de86bd4.js","sources":["../../src/components/typography/typography.types.ts","../../src/utils/ts/dev-environment.ts","../../src/utils/ts/print-development-warning.ts","../../src/utils/ts/deprecate.ts","../../src/components/typography/typography.vue"],"sourcesContent":["/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoTypographyVariant {\n CAPTION = 'caption',\n BODY = 'body',\n /** @deprecated Use \"TITLE\" instead. */\n SUBTITLE = 'subtitle',\n TITLE = 'title',\n}\n\nexport enum BentoTypographyModifier {\n WIDE = 'wide',\n STRONGER = 'stronger',\n STRONGER_WIDE = 'stronger-wide',\n STRONGEST = 'strongest',\n STRONGEST_WIDE = 'strongest-wide',\n MEDIUM = 'm',\n LARGE = 'l',\n MOBILE = 'mobile',\n}\n\n/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoTypographyElement {\n H1 = 'h1',\n H2 = 'h2',\n H3 = 'h3',\n H4 = 'h4',\n H5 = 'h5',\n H6 = 'h6',\n DIV = 'div',\n PARAGRAPH = 'p',\n SPAN = 'span',\n}\n","const DEV_ENVIROMENT_NAMES = ['development', 'DEVELOPMENT', 'dev', 'DEV'];\n\nexport const isDevelopmentEnviroment = () => DEV_ENVIROMENT_NAMES.includes(process.env.NODE_ENV);\n","import { isDevelopmentEnviroment } from '@/utils/ts/dev-environment';\n\n/**\n * Prints console.warn messages in development mode only.\n *\n * @see console.warn for what parameters you can use\n */\n\nexport function printDevelopmentWarning(...args: Parameters<typeof console.warn>) {\n if (isDevelopmentEnviroment()) {\n // eslint-disable-next-line no-console\n console.warn(...args);\n }\n}\n","import { printDevelopmentWarning } from './print-development-warning';\n\nconst DEPRECATION_STYLES = ['color: red', 'background: yellow'].join(';');\n\n/**\n * Informs users about the deprecations in development mode only.\n *\n * @param title Indicates what is being deprecated.\n * @param deprecationMessage How to avoid the deprecation by giving an example of the alternatives. Backticks can be used to multi-line the message.\n * @param toBeRemovedInVersion The version it will be removed. Must be in X.Y.Z format.\n */\nexport function deprecate(title: string, deprecationMessage: string, toBeRemovedInVersion: string) {\n printDevelopmentWarning(`%cDEPRECATED:\\x1b[0m ${title}`, DEPRECATION_STYLES);\n // Format multi-line descriptions with the backtick\n printDevelopmentWarning(`${deprecationMessage.replaceAll('\\t', '').replaceAll(' ', '').trim()}`);\n printDevelopmentWarning(`To be removed in: %c${toBeRemovedInVersion}`, DEPRECATION_STYLES);\n}\n","<template>\n <component :is=\"el\" class=\"b-typography\" :class=\"conditionalClasses\" data-testid=\"typography\">\n <slot />\n </component>\n</template>\n\n<script lang=\"ts\">\n import { computed, defineComponent, PropType } from 'vue';\n import { BentoTypographyElement, BentoTypographyModifier, BentoTypographyVariant } from './typography.types';\n import { deprecate } from '@/utils/ts/deprecate';\n\n /**\n * The Typography component makes it easy to apply a default set of font weights, sizes and other text styles\n * easily to text. The variants and properties match with those found in Figma.\n *\n * For example, seeing text with the typography styling of\n *\n * @example\n * import { BentoTypography } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoTypography },\n * template: `\n * <bento-typography>\n * ... text content\n * </bento-typography>\n * `\n * }\n */\n export default defineComponent({\n name: 'bento-typography',\n inheritAttrs: true,\n props: {\n /**\n * Sets the HTML DOM element.\n * @values h1, h2, h3, h4, h5, h6, div, p, span\n */\n el: {\n type: String as PropType<BentoTypographyElement | `${BentoTypographyElement}`>,\n default: BentoTypographyElement.PARAGRAPH,\n validator: (value: BentoTypographyElement) => Object.values(BentoTypographyElement).includes(value),\n },\n\n /**\n * Adds the stronger class modifier.\n * Applicable to Caption, Body and Subtitle variants.\n */\n stronger: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Adds the strongest class modifier.\n * Applicable to Caption, Body and Subtitle variants.\n */\n strongest: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Sets the type of typography variant.\n * @values caption, body, title.\n */\n variant: {\n type: String as PropType<BentoTypographyVariant | `${BentoTypographyVariant}`>,\n default: BentoTypographyVariant.BODY,\n validator: (value: BentoTypographyVariant) => Object.values(BentoTypographyVariant).includes(value),\n },\n\n /**\n * Adds the medium class modifier.\n * Applicable to the Title variant.\n */\n medium: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Adds the large class modifier.\n * Applicable to the Title variant.\n */\n large: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Adds the medium class modifier.\n * Applicable to tje Body variant.\n */\n wide: {\n type: Boolean,\n default: false,\n },\n },\n setup(props) {\n if (props.variant === BentoTypographyVariant.SUBTITLE) {\n deprecate(\n 'BentoTypography \"subtitle\" variant (BentoTypographyVariant.SUBTITLE)',\n `Use the \"title\" or \"BentoTypographyVariant.TITLE\" variant and (optionally) combine it with a size property. e.g. medium / large.\n <bento-typography :variant=\"BentoTypographyVariant.TITLE\" medium>`,\n '2.0.0'\n );\n }\n\n const conditionalClasses = computed(() => ({\n // Caption\n [`b-typography--${BentoTypographyVariant.CAPTION}`]: props.variant === BentoTypographyVariant.CAPTION,\n [`b-typography--${BentoTypographyVariant.CAPTION}-${BentoTypographyModifier.WIDE}`]:\n props.variant === BentoTypographyVariant.CAPTION && props.wide,\n [`b-typography--${BentoTypographyVariant.CAPTION}-${BentoTypographyModifier.STRONGER}`]:\n props.variant === BentoTypographyVariant.CAPTION && props.stronger,\n\n // Body\n [`b-typography--${BentoTypographyVariant.BODY}`]: props.variant === BentoTypographyVariant.BODY,\n [`b-typography--${BentoTypographyVariant.BODY}-${BentoTypographyModifier.WIDE}`]:\n props.variant === BentoTypographyVariant.BODY && props.wide,\n [`b-typography--${BentoTypographyVariant.BODY}-${BentoTypographyModifier.STRONGER}`]:\n props.variant === BentoTypographyVariant.BODY && props.stronger,\n [`b-typography--${BentoTypographyVariant.BODY}-${BentoTypographyModifier.STRONGEST}`]:\n props.variant === BentoTypographyVariant.BODY && props.strongest,\n\n // Subtitle\n [`b-typography--${BentoTypographyVariant.SUBTITLE}`]: props.variant === BentoTypographyVariant.SUBTITLE,\n [`b-typography--${BentoTypographyVariant.SUBTITLE}-${BentoTypographyModifier.STRONGER}`]:\n props.variant === BentoTypographyVariant.SUBTITLE && props.stronger,\n\n // Title\n [`b-typography--${BentoTypographyVariant.TITLE}`]:\n props.variant === BentoTypographyVariant.TITLE && !props.medium && !props.large,\n [`b-typography--${BentoTypographyVariant.TITLE}-${BentoTypographyModifier.MEDIUM}`]:\n props.variant === BentoTypographyVariant.TITLE && props.medium,\n [`b-typography--${BentoTypographyVariant.TITLE}-${BentoTypographyModifier.LARGE}`]:\n props.variant === BentoTypographyVariant.TITLE && props.large,\n }));\n\n return {\n conditionalClasses,\n };\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./typography.scss\" />\n"],"names":["BentoTypographyVariant","BentoTypographyVariant2","BentoTypographyModifier","BentoTypographyModifier2","BentoTypographyElement","BentoTypographyElement2","DEV_ENVIROMENT_NAMES","isDevelopmentEnviroment","printDevelopmentWarning","args","DEPRECATION_STYLES","deprecate","title","deprecationMessage","toBeRemovedInVersion","_sfc_main","defineComponent","value","props","computed"],"mappings":";;;AAGY,IAAAA,IAAA,kBAAAC,OACRA,EAAA,UAAA,WACAA,EAAA,OAAA,QAEAA,EAAA,WAAA,YACAA,EAAA,QAAA,SALQA,IAAAD,KAAA,CAAA,CAAA,GAQAE,IAAA,kBAAAC,OACRA,EAAA,OAAA,QACAA,EAAA,WAAA,YACAA,EAAA,gBAAA,iBACAA,EAAA,YAAA,aACAA,EAAA,iBAAA,kBACAA,EAAA,SAAA,KACAA,EAAA,QAAA,KACAA,EAAA,SAAA,UARQA,IAAAD,KAAA,CAAA,CAAA,GAcAE,IAAA,kBAAAC,OACRA,EAAA,KAAA,MACAA,EAAA,KAAA,MACAA,EAAA,KAAA,MACAA,EAAA,KAAA,MACAA,EAAA,KAAA,MACAA,EAAA,KAAA,MACAA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CAAA,iBAAAlB,EAAA,SAAAE,EAAA,QAAA,GAAAgB,EAAA,YAAAlB,EAAA,SAAAkB,EAAA;AAAA,QAEA,CAAA,iBAAAlB,EAAA,SAAAE,EAAA,OAAA,GAAAgB,EAAA,YAAAlB,EAAA,SAAAkB,EAAA;AAAA,MAEA,EAAA;AAAA,IAIA;AAAA,EACA;AAEA,CAAA;;;;;;;;;;;;;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineComponent as re } from "vue";
|
|
2
2
|
import { u as ne } from "./use-has-slot.6052d56a.js";
|
|
3
3
|
import { n as ae } from "./_plugin-vue2_normalizer.71e2aa87.js";
|
|
4
|
-
import "../assets/
|
|
4
|
+
import "../assets/index43.css";
|
|
5
5
|
var R = "data-focus-lock", oe = "data-focus-lock-disabled", ue = "data-no-focus-lock", ie = "data-autofocus-inside", ce = "data-no-autofocus", m = function(e) {
|
|
6
6
|
for (var t = Array(e.length), r = 0; r < e.length; ++r)
|
|
7
7
|
t[r] = e[r];
|
|
@@ -440,4 +440,4 @@ export {
|
|
|
440
440
|
Ze as B,
|
|
441
441
|
ke as g
|
|
442
442
|
};
|
|
443
|
-
//# sourceMappingURL=index.
|
|
443
|
+
//# sourceMappingURL=index.77d9d16d.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.2625175a.js","sources":["../../../../node_modules/focus-lock/dist/es2015/constants.js","../../../../node_modules/focus-lock/dist/es2015/utils/array.js","../../../../node_modules/focus-lock/dist/es2015/utils/is.js","../../../../node_modules/focus-lock/dist/es2015/utils/tabOrder.js","../../../../node_modules/focus-lock/dist/es2015/utils/tabbables.js","../../../../node_modules/focus-lock/dist/es2015/utils/tabUtils.js","../../../../node_modules/focus-lock/dist/es2015/utils/DOMutils.js","../../../../node_modules/focus-lock/dist/es2015/utils/all-affected.js","../../../../node_modules/focus-lock/dist/es2015/utils/getActiveElement.js","../../../../node_modules/focus-lock/dist/es2015/focusInside.js","../../../../node_modules/focus-lock/dist/es2015/focusIsHidden.js","../../../../node_modules/focus-lock/dist/es2015/utils/correctFocus.js","../../../../node_modules/focus-lock/dist/es2015/utils/firstFocus.js","../../../../node_modules/focus-lock/dist/es2015/solver.js","../../../../node_modules/focus-lock/dist/es2015/utils/parenting.js","../../../../node_modules/focus-lock/dist/es2015/focusMerge.js","../../../../node_modules/focus-lock/dist/es2015/focusables.js","../../../../node_modules/focus-lock/dist/es2015/setFocus.js","../../src/components/focus-trap/focus-trap.types.ts","../../src/utils/ts/focus-trap.utils.ts","../../src/components/focus-trap/focus-trap.vue"],"sourcesContent":["/**\n * defines a focus group\n */\nexport var FOCUS_GROUP = 'data-focus-lock';\n/**\n * disables element discovery inside a group marked by key\n */\nexport var FOCUS_DISABLED = 'data-focus-lock-disabled';\n/**\n * allows uncontrolled focus within the marked area, effectively disabling focus lock for it's content\n */\nexport var FOCUS_ALLOW = 'data-no-focus-lock';\n/**\n * instructs autofocus engine to pick default autofocus inside a given node\n * can be set on the element or container\n */\nexport var FOCUS_AUTO = 'data-autofocus-inside';\n/**\n * instructs autofocus to ignore elements within a given node\n * can be set on the element or container\n */\nexport var FOCUS_NO_AUTOFOCUS = 'data-no-autofocus';\n","/*\nIE11 support\n */\nexport var toArray = function (a) {\n var ret = Array(a.length);\n for (var i = 0; i < a.length; ++i) {\n ret[i] = a[i];\n }\n return ret;\n};\nexport var asArray = function (a) { return (Array.isArray(a) ? a : [a]); };\n","import { FOCUS_NO_AUTOFOCUS } from '../constants';\nvar isElementHidden = function (node) {\n // we can measure only \"elements\"\n // consider others as \"visible\"\n if (node.nodeType !== Node.ELEMENT_NODE) {\n return false;\n }\n var computedStyle = window.getComputedStyle(node, null);\n if (!computedStyle || !computedStyle.getPropertyValue) {\n return false;\n }\n return (computedStyle.getPropertyValue('display') === 'none' || computedStyle.getPropertyValue('visibility') === 'hidden');\n};\nvar getParentNode = function (node) {\n // DOCUMENT_FRAGMENT_NODE can also point on ShadowRoot. In this case .host will point on the next node\n return node.parentNode && node.parentNode.nodeType === Node.DOCUMENT_FRAGMENT_NODE\n ? // eslint-disable-next-line @typescript-eslint/no-explicit-any\n node.parentNode.host\n : node.parentNode;\n};\nvar isTopNode = function (node) {\n // @ts-ignore\n return node === document || (node && node.nodeType === Node.DOCUMENT_NODE);\n};\nvar isVisibleUncached = function (node, checkParent) {\n return !node || isTopNode(node) || (!isElementHidden(node) && checkParent(getParentNode(node)));\n};\nexport var isVisibleCached = function (visibilityCache, node) {\n var cached = visibilityCache.get(node);\n if (cached !== undefined) {\n return cached;\n }\n var result = isVisibleUncached(node, isVisibleCached.bind(undefined, visibilityCache));\n visibilityCache.set(node, result);\n return result;\n};\nvar isAutoFocusAllowedUncached = function (node, checkParent) {\n return node && !isTopNode(node) ? (isAutoFocusAllowed(node) ? checkParent(getParentNode(node)) : false) : true;\n};\nexport var isAutoFocusAllowedCached = function (cache, node) {\n var cached = cache.get(node);\n if (cached !== undefined) {\n return cached;\n }\n var result = isAutoFocusAllowedUncached(node, isAutoFocusAllowedCached.bind(undefined, cache));\n cache.set(node, result);\n return result;\n};\nexport var getDataset = function (node) {\n // @ts-ignore\n return node.dataset;\n};\nexport var isHTMLButtonElement = function (node) { return node.tagName === 'BUTTON'; };\nexport var isHTMLInputElement = function (node) { return node.tagName === 'INPUT'; };\nexport var isRadioElement = function (node) {\n return isHTMLInputElement(node) && node.type === 'radio';\n};\nexport var notHiddenInput = function (node) {\n return !((isHTMLInputElement(node) || isHTMLButtonElement(node)) && (node.type === 'hidden' || node.disabled));\n};\nexport var isAutoFocusAllowed = function (node) {\n var attribute = node.getAttribute(FOCUS_NO_AUTOFOCUS);\n return ![true, 'true', ''].includes(attribute);\n};\nexport var isGuard = function (node) { var _a; return Boolean(node && ((_a = getDataset(node)) === null || _a === void 0 ? void 0 : _a.focusGuard)); };\nexport var isNotAGuard = function (node) { return !isGuard(node); };\nexport var isDefined = function (x) { return Boolean(x); };\n","import { toArray } from './array';\nexport var tabSort = function (a, b) {\n var tabDiff = a.tabIndex - b.tabIndex;\n var indexDiff = a.index - b.index;\n if (tabDiff) {\n if (!a.tabIndex) {\n return 1;\n }\n if (!b.tabIndex) {\n return -1;\n }\n }\n return tabDiff || indexDiff;\n};\nexport var orderByTabIndex = function (nodes, filterNegative, keepGuards) {\n return toArray(nodes)\n .map(function (node, index) { return ({\n node: node,\n index: index,\n tabIndex: keepGuards && node.tabIndex === -1 ? ((node.dataset || {}).focusGuard ? 0 : -1) : node.tabIndex,\n }); })\n .filter(function (data) { return !filterNegative || data.tabIndex >= 0; })\n .sort(tabSort);\n};\n","/**\n * list of the object to be considered as focusable\n */\nexport var tabbables = [\n 'button:enabled',\n 'select:enabled',\n 'textarea:enabled',\n 'input:enabled',\n // elements with explicit roles will also use explicit tabindex\n // '[role=\"button\"]',\n 'a[href]',\n 'area[href]',\n 'summary',\n 'iframe',\n 'object',\n 'embed',\n 'audio[controls]',\n 'video[controls]',\n '[tabindex]',\n '[contenteditable]',\n '[autofocus]',\n];\n","import { FOCUS_AUTO } from '../constants';\nimport { toArray } from './array';\nimport { tabbables } from './tabbables';\nvar queryTabbables = tabbables.join(',');\nvar queryGuardTabbables = \"\".concat(queryTabbables, \", [data-focus-guard]\");\nvar getFocusablesWithShadowDom = function (parent, withGuards) {\n var _a;\n return toArray(((_a = parent.shadowRoot) === null || _a === void 0 ? void 0 : _a.children) || parent.children).reduce(function (acc, child) {\n return acc.concat(child.matches(withGuards ? queryGuardTabbables : queryTabbables) ? [child] : [], getFocusablesWithShadowDom(child));\n }, []);\n};\nexport var getFocusables = function (parents, withGuards) {\n return parents.reduce(function (acc, parent) {\n return acc.concat(\n // add all tabbables inside and within shadow DOMs in DOM order\n getFocusablesWithShadowDom(parent, withGuards), \n // add if node is tabbable itself\n parent.parentNode\n ? toArray(parent.parentNode.querySelectorAll(queryTabbables)).filter(function (node) { return node === parent; })\n : []);\n }, []);\n};\n/**\n * return a list of focusable nodes within an area marked as \"auto-focusable\"\n * @param parent\n */\nexport var getParentAutofocusables = function (parent) {\n var parentFocus = parent.querySelectorAll(\"[\".concat(FOCUS_AUTO, \"]\"));\n return toArray(parentFocus)\n .map(function (node) { return getFocusables([node]); })\n .reduce(function (acc, nodes) { return acc.concat(nodes); }, []);\n};\n","import { toArray } from './array';\nimport { isAutoFocusAllowedCached, isVisibleCached, notHiddenInput } from './is';\nimport { orderByTabIndex } from './tabOrder';\nimport { getFocusables, getParentAutofocusables } from './tabUtils';\n/**\n * given list of focusable elements keeps the ones user can interact with\n * @param nodes\n * @param visibilityCache\n */\nexport var filterFocusable = function (nodes, visibilityCache) {\n return toArray(nodes)\n .filter(function (node) { return isVisibleCached(visibilityCache, node); })\n .filter(function (node) { return notHiddenInput(node); });\n};\nexport var filterAutoFocusable = function (nodes, cache) {\n if (cache === void 0) { cache = new Map(); }\n return toArray(nodes).filter(function (node) { return isAutoFocusAllowedCached(cache, node); });\n};\n/**\n * only tabbable ones\n * (but with guards which would be ignored)\n */\nexport var getTabbableNodes = function (topNodes, visibilityCache, withGuards) {\n return orderByTabIndex(filterFocusable(getFocusables(topNodes, withGuards), visibilityCache), true, withGuards);\n};\n/**\n * actually anything \"focusable\", not only tabbable\n * (without guards, as long as they are not expected to be focused)\n */\nexport var getAllTabbableNodes = function (topNodes, visibilityCache) {\n return orderByTabIndex(filterFocusable(getFocusables(topNodes), visibilityCache), false);\n};\n/**\n * return list of nodes which are expected to be auto-focused\n * @param topNode\n * @param visibilityCache\n */\nexport var parentAutofocusables = function (topNode, visibilityCache) {\n return filterFocusable(getParentAutofocusables(topNode), visibilityCache);\n};\n/*\n * Determines if element is contained in scope, including nested shadow DOMs\n */\nexport var contains = function (scope, element) {\n return ((scope.shadowRoot\n ? contains(scope.shadowRoot, element)\n : scope.contains(element)) || Array.from(scope.children).some(function (child) { return contains(child, element); }));\n};\n","import { FOCUS_DISABLED, FOCUS_GROUP } from '../constants';\nimport { asArray, toArray } from './array';\n/**\n * in case of multiple nodes nested inside each other\n * keeps only top ones\n * this is O(nlogn)\n * @param nodes\n * @returns {*}\n */\nvar filterNested = function (nodes) {\n var contained = new Set();\n var l = nodes.length;\n for (var i = 0; i < l; i += 1) {\n for (var j = i + 1; j < l; j += 1) {\n var position = nodes[i].compareDocumentPosition(nodes[j]);\n /* eslint-disable no-bitwise */\n if ((position & Node.DOCUMENT_POSITION_CONTAINED_BY) > 0) {\n contained.add(j);\n }\n if ((position & Node.DOCUMENT_POSITION_CONTAINS) > 0) {\n contained.add(i);\n }\n /* eslint-enable */\n }\n }\n return nodes.filter(function (_, index) { return !contained.has(index); });\n};\n/**\n * finds top most parent for a node\n * @param node\n * @returns {*}\n */\nvar getTopParent = function (node) {\n return node.parentNode ? getTopParent(node.parentNode) : node;\n};\n/**\n * returns all \"focus containers\" inside a given node\n * @param node\n * @returns {T}\n */\nexport var getAllAffectedNodes = function (node) {\n var nodes = asArray(node);\n return nodes.filter(Boolean).reduce(function (acc, currentNode) {\n var group = currentNode.getAttribute(FOCUS_GROUP);\n acc.push.apply(acc, (group\n ? filterNested(toArray(getTopParent(currentNode).querySelectorAll(\"[\".concat(FOCUS_GROUP, \"=\\\"\").concat(group, \"\\\"]:not([\").concat(FOCUS_DISABLED, \"=\\\"disabled\\\"])\"))))\n : [currentNode]));\n return acc;\n }, []);\n};\n","var getNestedShadowActiveElement = function (shadowRoot) {\n return shadowRoot.activeElement\n ? shadowRoot.activeElement.shadowRoot\n ? getNestedShadowActiveElement(shadowRoot.activeElement.shadowRoot)\n : shadowRoot.activeElement\n : undefined;\n};\n/**\n * returns active element from document or from nested shadowdoms\n */\nexport var getActiveElement = function () {\n return (document.activeElement\n ? document.activeElement.shadowRoot\n ? getNestedShadowActiveElement(document.activeElement.shadowRoot)\n : document.activeElement\n : undefined); // eslint-disable-next-line @typescript-eslint/no-explicit-any\n};\n","import { contains } from './utils/DOMutils';\nimport { getAllAffectedNodes } from './utils/all-affected';\nimport { toArray } from './utils/array';\nimport { getActiveElement } from './utils/getActiveElement';\nvar focusInFrame = function (frame) { return frame === document.activeElement; };\nvar focusInsideIframe = function (topNode) {\n return Boolean(toArray(topNode.querySelectorAll('iframe')).some(function (node) { return focusInFrame(node); }));\n};\n/**\n * @returns {Boolean} true, if the current focus is inside given node or nodes\n */\nexport var focusInside = function (topNode) {\n var activeElement = document && getActiveElement();\n if (!activeElement || (activeElement.dataset && activeElement.dataset.focusGuard)) {\n return false;\n }\n return getAllAffectedNodes(topNode).some(function (node) { return contains(node, activeElement) || focusInsideIframe(node); });\n};\n","import { FOCUS_ALLOW } from './constants';\nimport { contains } from './utils/DOMutils';\nimport { toArray } from './utils/array';\nimport { getActiveElement } from './utils/getActiveElement';\n/**\n * focus is hidden FROM the focus-lock\n * ie contained inside a node focus-lock shall ignore\n * @returns {boolean} focus is currently is in \"allow\" area\n */\nexport var focusIsHidden = function () {\n var activeElement = document && getActiveElement();\n if (!activeElement) {\n return false;\n }\n // this does not support setting FOCUS_ALLOW within shadow dom\n return toArray(document.querySelectorAll(\"[\".concat(FOCUS_ALLOW, \"]\"))).some(function (node) { return contains(node, activeElement); });\n};\n","import { isRadioElement } from './is';\nvar findSelectedRadio = function (node, nodes) {\n return nodes\n .filter(isRadioElement)\n .filter(function (el) { return el.name === node.name; })\n .filter(function (el) { return el.checked; })[0] || node;\n};\nexport var correctNode = function (node, nodes) {\n if (isRadioElement(node) && node.name) {\n return findSelectedRadio(node, nodes);\n }\n return node;\n};\n/**\n * giving a set of radio inputs keeps only selected (tabbable) ones\n * @param nodes\n */\nexport var correctNodes = function (nodes) {\n // IE11 has no Set(array) constructor\n var resultSet = new Set();\n nodes.forEach(function (node) { return resultSet.add(correctNode(node, nodes)); });\n // using filter to support IE11\n return nodes.filter(function (node) { return resultSet.has(node); });\n};\n","import { correctNode } from './correctFocus';\nexport var pickFirstFocus = function (nodes) {\n if (nodes[0] && nodes.length > 1) {\n return correctNode(nodes[0], nodes);\n }\n return nodes[0];\n};\nexport var pickFocusable = function (nodes, index) {\n if (nodes.length > 1) {\n return nodes.indexOf(correctNode(nodes[index], nodes));\n }\n return index;\n};\n","import { correctNodes } from './utils/correctFocus';\nimport { pickFocusable } from './utils/firstFocus';\nimport { isGuard } from './utils/is';\nexport var NEW_FOCUS = 'NEW_FOCUS';\n/**\n * Main solver for the \"find next focus\" question\n * @param innerNodes\n * @param outerNodes\n * @param activeElement\n * @param lastNode\n * @returns {number|string|undefined|*}\n */\nexport var newFocus = function (innerNodes, outerNodes, activeElement, lastNode) {\n var cnt = innerNodes.length;\n var firstFocus = innerNodes[0];\n var lastFocus = innerNodes[cnt - 1];\n var isOnGuard = isGuard(activeElement);\n // focus is inside\n if (activeElement && innerNodes.indexOf(activeElement) >= 0) {\n return undefined;\n }\n var activeIndex = activeElement !== undefined ? outerNodes.indexOf(activeElement) : -1;\n var lastIndex = lastNode ? outerNodes.indexOf(lastNode) : activeIndex;\n var lastNodeInside = lastNode ? innerNodes.indexOf(lastNode) : -1;\n var indexDiff = activeIndex - lastIndex;\n var firstNodeIndex = outerNodes.indexOf(firstFocus);\n var lastNodeIndex = outerNodes.indexOf(lastFocus);\n var correctedNodes = correctNodes(outerNodes);\n var correctedIndex = activeElement !== undefined ? correctedNodes.indexOf(activeElement) : -1;\n var correctedIndexDiff = correctedIndex - (lastNode ? correctedNodes.indexOf(lastNode) : activeIndex);\n var returnFirstNode = pickFocusable(innerNodes, 0);\n var returnLastNode = pickFocusable(innerNodes, cnt - 1);\n // new focus\n if (activeIndex === -1 || lastNodeInside === -1) {\n return NEW_FOCUS;\n }\n // old focus\n if (!indexDiff && lastNodeInside >= 0) {\n return lastNodeInside;\n }\n // first element\n if (activeIndex <= firstNodeIndex && isOnGuard && Math.abs(indexDiff) > 1) {\n return returnLastNode;\n }\n // last element\n if (activeIndex >= lastNodeIndex && isOnGuard && Math.abs(indexDiff) > 1) {\n return returnFirstNode;\n }\n // jump out, but not on the guard\n if (indexDiff && Math.abs(correctedIndexDiff) > 1) {\n return lastNodeInside;\n }\n // focus above lock\n if (activeIndex <= firstNodeIndex) {\n return returnLastNode;\n }\n // focus below lock\n if (activeIndex > lastNodeIndex) {\n return returnFirstNode;\n }\n // index is inside tab order, but outside Lock\n if (indexDiff) {\n if (Math.abs(indexDiff) > 1) {\n return lastNodeInside;\n }\n return (cnt + lastNodeInside + indexDiff) % cnt;\n }\n // do nothing\n return undefined;\n};\n","import { parentAutofocusables } from './DOMutils';\nimport { contains } from './DOMutils';\nimport { asArray } from './array';\nvar getParents = function (node, parents) {\n if (parents === void 0) { parents = []; }\n parents.push(node);\n if (node.parentNode) {\n getParents(node.parentNode.host || node.parentNode, parents);\n }\n return parents;\n};\n/**\n * finds a parent for both nodeA and nodeB\n * @param nodeA\n * @param nodeB\n * @returns {boolean|*}\n */\nexport var getCommonParent = function (nodeA, nodeB) {\n var parentsA = getParents(nodeA);\n var parentsB = getParents(nodeB);\n // tslint:disable-next-line:prefer-for-of\n for (var i = 0; i < parentsA.length; i += 1) {\n var currentParent = parentsA[i];\n if (parentsB.indexOf(currentParent) >= 0) {\n return currentParent;\n }\n }\n return false;\n};\nexport var getTopCommonParent = function (baseActiveElement, leftEntry, rightEntries) {\n var activeElements = asArray(baseActiveElement);\n var leftEntries = asArray(leftEntry);\n var activeElement = activeElements[0];\n var topCommon = false;\n leftEntries.filter(Boolean).forEach(function (entry) {\n topCommon = getCommonParent(topCommon || entry, entry) || topCommon;\n rightEntries.filter(Boolean).forEach(function (subEntry) {\n var common = getCommonParent(activeElement, subEntry);\n if (common) {\n if (!topCommon || contains(common, topCommon)) {\n topCommon = common;\n }\n else {\n topCommon = getCommonParent(common, topCommon);\n }\n }\n });\n });\n // TODO: add assert here?\n return topCommon;\n};\n/**\n * return list of nodes which are expected to be autofocused inside a given top nodes\n * @param entries\n * @param visibilityCache\n */\nexport var allParentAutofocusables = function (entries, visibilityCache) {\n return entries.reduce(function (acc, node) { return acc.concat(parentAutofocusables(node, visibilityCache)); }, []);\n};\n","import { NEW_FOCUS, newFocus } from './solver';\nimport { filterAutoFocusable, getAllTabbableNodes, getTabbableNodes } from './utils/DOMutils';\nimport { getAllAffectedNodes } from './utils/all-affected';\nimport { pickFirstFocus } from './utils/firstFocus';\nimport { getActiveElement } from './utils/getActiveElement';\nimport { getDataset, isDefined, isNotAGuard } from './utils/is';\nimport { allParentAutofocusables, getTopCommonParent } from './utils/parenting';\nvar findAutoFocused = function (autoFocusables) {\n return function (node) { var _a; \n // @ts-expect-error\n return node.autofocus || !!((_a = getDataset(node)) === null || _a === void 0 ? void 0 : _a.autofocus) || autoFocusables.indexOf(node) >= 0; };\n};\nvar reorderNodes = function (srcNodes, dstNodes) {\n var remap = new Map();\n // no Set(dstNodes) for IE11 :(\n dstNodes.forEach(function (entity) { return remap.set(entity.node, entity); });\n // remap to dstNodes\n return srcNodes.map(function (node) { return remap.get(node); }).filter(isDefined);\n};\n/**\n * given top node(s) and the last active element return the element to be focused next\n * @param topNode\n * @param lastNode\n */\nexport var getFocusMerge = function (topNode, lastNode) {\n var activeElement = document && getActiveElement();\n var entries = getAllAffectedNodes(topNode).filter(isNotAGuard);\n var commonParent = getTopCommonParent(activeElement || topNode, topNode, entries);\n var visibilityCache = new Map();\n var anyFocusable = getAllTabbableNodes(entries, visibilityCache);\n var innerElements = getTabbableNodes(entries, visibilityCache).filter(function (_a) {\n var node = _a.node;\n return isNotAGuard(node);\n });\n if (!innerElements[0]) {\n innerElements = anyFocusable;\n if (!innerElements[0]) {\n return undefined;\n }\n }\n var outerNodes = getAllTabbableNodes([commonParent], visibilityCache).map(function (_a) {\n var node = _a.node;\n return node;\n });\n var orderedInnerElements = reorderNodes(outerNodes, innerElements);\n var innerNodes = orderedInnerElements.map(function (_a) {\n var node = _a.node;\n return node;\n });\n var newId = newFocus(innerNodes, outerNodes, activeElement, lastNode);\n if (newId === NEW_FOCUS) {\n var autoFocusable = filterAutoFocusable(anyFocusable.map(function (_a) {\n var node = _a.node;\n return node;\n })).filter(findAutoFocused(allParentAutofocusables(entries, visibilityCache)));\n return {\n node: autoFocusable && autoFocusable.length\n ? pickFirstFocus(autoFocusable)\n : pickFirstFocus(filterAutoFocusable(innerNodes)),\n };\n }\n if (newId === undefined) {\n return newId;\n }\n return orderedInnerElements[newId];\n};\n","import { getTabbableNodes } from './utils/DOMutils';\nimport { getAllAffectedNodes } from './utils/all-affected';\nimport { isGuard, isNotAGuard } from './utils/is';\nimport { getTopCommonParent } from './utils/parenting';\n/**\n * return list of focusable elements inside a given top node\n * @deprecated use {@link getFocusableIn}. Yep, there is typo in the function name\n */\nexport var getFocusabledIn = function (topNode) {\n var entries = getAllAffectedNodes(topNode).filter(isNotAGuard);\n var commonParent = getTopCommonParent(topNode, topNode, entries);\n var visibilityCache = new Map();\n var outerNodes = getTabbableNodes([commonParent], visibilityCache, true);\n var innerElements = getTabbableNodes(entries, visibilityCache)\n .filter(function (_a) {\n var node = _a.node;\n return isNotAGuard(node);\n })\n .map(function (_a) {\n var node = _a.node;\n return node;\n });\n return outerNodes.map(function (_a) {\n var node = _a.node, index = _a.index;\n return ({\n node: node,\n index: index,\n lockItem: innerElements.indexOf(node) >= 0,\n guard: isGuard(node),\n });\n });\n};\n/**\n * return list of focusable elements inside a given top node\n */\nexport var getFocusableIn = getFocusabledIn;\n","import { getFocusMerge } from './focusMerge';\nexport var focusOn = function (target, focusOptions) {\n if ('focus' in target) {\n target.focus(focusOptions);\n }\n if ('contentWindow' in target && target.contentWindow) {\n target.contentWindow.focus();\n }\n};\nvar guardCount = 0;\nvar lockDisabled = false;\n/**\n * Sets focus at a given node. The last focused element will help to determine which element(first or last) should be focused.\n * HTML markers (see {@link import('./constants').FOCUS_AUTO} constants) can control autofocus\n * @param topNode\n * @param lastNode\n * @param options\n */\nexport var setFocus = function (topNode, lastNode, options) {\n if (options === void 0) { options = {}; }\n var focusable = getFocusMerge(topNode, lastNode);\n if (lockDisabled) {\n return;\n }\n if (focusable) {\n if (guardCount > 2) {\n // tslint:disable-next-line:no-console\n console.error('FocusLock: focus-fighting detected. Only one focus management system could be active. ' +\n 'See https://github.com/theKashey/focus-lock/#focus-fighting');\n lockDisabled = true;\n setTimeout(function () {\n lockDisabled = false;\n }, 1);\n return;\n }\n guardCount++;\n focusOn(focusable.node, options.focusOptions);\n guardCount--;\n }\n};\n","export enum BentoFocusTrapArrowNavigationDirection {\n VERTICAL = 'vertical',\n HORIZONTAL = 'horizontal',\n}\n\nexport enum BentoFocusTrapVerticalNavigationEvent {\n ARROW_UP = 'arrowup',\n ARROW_DOWN = 'arrowdown',\n}\n\nexport enum BentoFocusTrapHorizontalNavigationEvent {\n ARROW_LEFT = 'arrowleft',\n ARROW_RIGHT = 'arrowright',\n}\n\nexport interface BentoFocusTrapFocusableIn {\n node: HTMLElement;\n /**\n * tab index\n */\n index: number;\n /**\n * true, if this node belongs to a Lock\n */\n lockItem: boolean;\n /**\n * true, if this node is a focus-guard (system node)\n */\n guard: boolean;\n}\n","import { getFocusableIn } from 'focus-lock';\nimport {\n BentoFocusTrapFocusableIn,\n BentoFocusTrapHorizontalNavigationEvent,\n BentoFocusTrapVerticalNavigationEvent,\n} from '@/components/focus-trap/focus-trap.types';\n\n/**\n * Perform callback before next re-paint frame of browser.\n *\n * @param action\n * @returns\n */\nexport const deferAction = (callback: FrameRequestCallback) => requestAnimationFrame(callback);\n\n/**\n * Get's the index number of the current node inside an array of focusable elements.\n *\n * @param node an HTMLElement node\n * @param nodes an array of focusable elements\n * @returns\n */\nconst getNodeIndex = (node: Element, nodes: BentoFocusTrapFocusableIn[]) => {\n const index = nodes.findIndex(item => item.node === node);\n return index === -1 ? 0 : index;\n};\n\n/**\n * Retrieves the next focusable element using a factor to either choose\n * the next or previous focusable element.\n *\n * @param factor a number +1 or -1\n * @param element the element to checks for focusable elements inside of\n * @returns\n */\nexport const getNextFocusableElement = (factor, element): HTMLElement => {\n const currentFocusedEl = document.activeElement;\n const focusableElements = getFocusableIn(element);\n const nextIndex = getNodeIndex(currentFocusedEl, focusableElements) + factor;\n return focusableElements[nextIndex]?.node || (currentFocusedEl as HTMLElement);\n};\n\n/**\n * Returns an object is if keyboard event key is an arrow previous or next key.\n * this changes depending on if the arrow navigation is horizontal or vertical.\n *\n * @param event\n * @param arrowOrder\n * @returns { isArrowNext: boolean, isArrowPrev: boolean }\n */\nexport const getArrowType = (\n event: KeyboardEvent,\n arrowOrder: BentoFocusTrapVerticalNavigationEvent[] | BentoFocusTrapHorizontalNavigationEvent[]\n) => {\n const eventKey = event.key.toLowerCase();\n return {\n isArrowNext: eventKey === arrowOrder[0],\n isArrowPrev: eventKey === arrowOrder[1],\n };\n};\n\n/**\n * Default scrolling into view options\n */\nexport const SCROLL_INTO_VIEW_OPTIONS: ScrollIntoViewOptions = {\n behavior: 'smooth',\n block: 'center',\n inline: 'center',\n};\n","<template>\n <div\n v-if=\"useHasSlot($slots)('default')\"\n ref=\"root\"\n class=\"b-focus-trap\"\n data-testid=\"focus-trap\"\n tabindex=\"-1\"\n v-on=\"arrowNavigation ? { keydown: onKeyDown } : {}\"\n @focusout=\"onBlur\"\n >\n <slot></slot>\n </div>\n</template>\n\n<script lang=\"ts\">\n import { defineComponent, PropType } from 'vue';\n import moveFocusInside, { focusInside, focusIsHidden } from 'focus-lock';\n import {\n BentoFocusTrapArrowNavigationDirection,\n BentoFocusTrapHorizontalNavigationEvent,\n BentoFocusTrapVerticalNavigationEvent,\n } from './focus-trap.types';\n import {\n deferAction,\n getArrowType,\n getNextFocusableElement,\n SCROLL_INTO_VIEW_OPTIONS,\n } from '@/utils/ts/focus-trap.utils';\n import { useHasSlot } from '@/composables';\n\n /**\n * Locks the focus inside an element for a11y navigation.\n * Useful for things like modals, popovers, etc...\n *\n * @example\n * import { BentoFocusTrap, BentoButton } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoFocusTrap, BentoButton },\n * template: `\n * <div id=\"import-choice\">\n * <bento-focus-trap>\n * Make a choice to proceed further!\n * <bento-button>Yes</bento-button>\n * <bento-button>No</bento-button>\n * </bento-focus-trap>\n * </div>\n * `\n * };\n */\n export default defineComponent({\n name: 'bento-focus-trap',\n props: {\n /**\n * Enables / Disables arrow navigation as well can determine the type of arrow navigation.\n * The types of arrow navigation are horizontal and vertical.\n */\n arrowNavigation: {\n type: String as PropType<BentoFocusTrapArrowNavigationDirection>,\n default: undefined,\n validator: value =>\n Object.values(BentoFocusTrapArrowNavigationDirection).includes(\n value as BentoFocusTrapArrowNavigationDirection\n ),\n },\n /**\n * Enables / disables the focus trap.\n */\n disabled: {\n type: Boolean,\n default: false,\n },\n },\n data: () => ({\n lastFocusedElement: null,\n }),\n computed: {\n isHorizontalArrowNavigation(): boolean {\n return this.arrowNavigation === BentoFocusTrapArrowNavigationDirection.HORIZONTAL;\n },\n isVerticalArrowNavigation(): boolean {\n return this.arrowNavigation === BentoFocusTrapArrowNavigationDirection.VERTICAL;\n },\n arrowOrder() {\n return this.isVerticalArrowNavigation\n ? Object.values(BentoFocusTrapVerticalNavigationEvent)\n : Object.values(BentoFocusTrapHorizontalNavigationEvent);\n },\n },\n watch: {\n /**\n * If the disabled prop changes, then enable / disable the focus trap.\n */\n disabled() {\n if (this.disabled) {\n this.disable();\n } else {\n this.setFocusInside();\n }\n },\n },\n mounted() {\n if (this.disabled) {\n return;\n }\n this.setFocusInside();\n },\n beforeUnmount() {\n if (this.disabled) {\n return;\n }\n this.disable();\n },\n methods: {\n /**\n * Set focus back inside the element area, giving the last focus element\n * `focus-lock` can determine the next interable element to focus on.\n */\n async setFocusInside() {\n const isFocusOnBody = document.activeElement === document.body;\n if (isFocusOnBody || focusIsHidden() || !this.lastFocusedElement) {\n if (!focusInside(this.$refs.root as HTMLElement)) {\n moveFocusInside(this.$refs.root as HTMLElement, this.lastFocusedElement);\n }\n this.lastFocusedElement = document.activeElement;\n }\n },\n /**\n * On blur, trap the focus inside!\n */\n onBlur() {\n if (this.disabled) {\n return;\n }\n deferAction(this.setFocusInside);\n },\n /**\n * If the no arrow navigation is enabled\n * or if the currently focus element is a textarea or an input then prevent navigation.\n */\n shouldPreventNavigation() {\n if (!this.isVerticalArrowNavigation && !this.isHorizontalArrowNavigation) {\n return false;\n }\n\n const currentTag = document.activeElement.tagName.toLowerCase();\n const possibleFormControls = this.isVerticalArrowNavigation\n ? ['textarea', 'select']\n : ['input', 'textarea'];\n return possibleFormControls.includes(currentTag);\n },\n /**\n * When an arrow key is pressed then navigate to the next focusable element.\n * If trap is disabled or is content editable then prevent arrow navigation.\n *\n * @param event on keyboard press event\n */\n onKeyDown(event: KeyboardEvent) {\n if (\n this.disabled ||\n (document.activeElement as HTMLElement).isContentEditable ||\n this.shouldPreventNavigation()\n ) {\n return;\n }\n\n const { isArrowNext, isArrowPrev } = getArrowType(event, this.arrowOrder);\n if (isArrowPrev || isArrowNext) {\n event.preventDefault();\n event.stopPropagation();\n const focusableEl = getNextFocusableElement(isArrowPrev ? 1 : -1, this.$el);\n focusableEl.focus();\n if ('scrollIntoView' in focusableEl) {\n const options =\n 'scrollBehavior' in document.documentElement.style ? SCROLL_INTO_VIEW_OPTIONS : false;\n focusableEl.scrollIntoView(options);\n }\n }\n },\n /**\n * If focus trap is disabled then return focus to last focus element, parent node or simply the document body.\n */\n disable() {\n const focusOnDestroyEl = this.lastFocusedElement || this.$el.parentNode || document.body;\n if (focusOnDestroyEl) {\n focusOnDestroyEl.focus();\n }\n },\n useHasSlot,\n },\n });\n</script>\n\n<style lang=\"scss\" scoped>\n .b-focus-trap {\n outline: none;\n }\n</style>\n"],"names":["FOCUS_GROUP","FOCUS_DISABLED","FOCUS_ALLOW","FOCUS_AUTO","FOCUS_NO_AUTOFOCUS","toArray","a","ret","i","asArray","isElementHidden","node","computedStyle","getParentNode","isTopNode","isVisibleUncached","checkParent","isVisibleCached","visibilityCache","cached","result","isAutoFocusAllowedUncached","isAutoFocusAllowed","isAutoFocusAllowedCached","cache","getDataset","isHTMLButtonElement","isHTMLInputElement","isRadioElement","notHiddenInput","attribute","isGuard","_a","isNotAGuard","isDefined","x","tabSort","b","tabDiff","indexDiff","orderByTabIndex","nodes","filterNegative","keepGuards","index","data","tabbables","queryTabbables","queryGuardTabbables","getFocusablesWithShadowDom","parent","withGuards","acc","child","getFocusables","parents","getParentAutofocusables","parentFocus","filterFocusable","filterAutoFocusable","getTabbableNodes","topNodes","getAllTabbableNodes","parentAutofocusables","topNode","contains","scope","element","filterNested","contained","l","j","position","_","getTopParent","getAllAffectedNodes","currentNode","group","getNestedShadowActiveElement","shadowRoot","getActiveElement","focusInFrame","frame","focusInsideIframe","focusInside","activeElement","focusIsHidden","findSelectedRadio","el","correctNode","correctNodes","resultSet","pickFirstFocus","pickFocusable","NEW_FOCUS","newFocus","innerNodes","outerNodes","lastNode","cnt","firstFocus","lastFocus","isOnGuard","activeIndex","lastIndex","lastNodeInside","firstNodeIndex","lastNodeIndex","correctedNodes","correctedIndex","correctedIndexDiff","returnFirstNode","returnLastNode","getParents","getCommonParent","nodeA","nodeB","parentsA","parentsB","currentParent","getTopCommonParent","baseActiveElement","leftEntry","rightEntries","activeElements","leftEntries","topCommon","entry","subEntry","common","allParentAutofocusables","entries","findAutoFocused","autoFocusables","reorderNodes","srcNodes","dstNodes","remap","entity","getFocusMerge","commonParent","anyFocusable","innerElements","orderedInnerElements","newId","autoFocusable","getFocusabledIn","getFocusableIn","focusOn","target","focusOptions","guardCount","lockDisabled","setFocus","options","focusable","BentoFocusTrapArrowNavigationDirection","BentoFocusTrapArrowNavigationDirection2","BentoFocusTrapVerticalNavigationEvent","BentoFocusTrapVerticalNavigationEvent2","BentoFocusTrapHorizontalNavigationEvent","BentoFocusTrapHorizontalNavigationEvent2","deferAction","callback","getNodeIndex","item","getNextFocusableElement","factor","currentFocusedEl","focusableElements","nextIndex","getArrowType","event","arrowOrder","eventKey","SCROLL_INTO_VIEW_OPTIONS","_sfc_main","defineComponent","value","currentTag","isArrowNext","isArrowPrev","focusableEl","focusOnDestroyEl","useHasSlot"],"mappings":";;;;AAGO,IAAAA,IAAA,mBAIAC,KAAA,4BAIAC,KAAA,sBAKAC,KAAA,yBAKAC,KAAA,qBClBAC,IAAA,SAAAC,GAAA;AAEP,WADAC,IAA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,GAAA,KAAA,MAAA,MAAA,KAAA,kBAAA,GAEA,KAAA,qBAAA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IACA,SAAA;AAKA,MAAA,KAAA,YAGAS,GAAA,KAAA,cAAA;AAAA,IAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IACA,0BAAA;AAMA,UAAA,CAAA,KAAA,6BAAA,CAAA,KAAA;AACA,eAAA;AAGA,YAAAiB,IAAA,SAAA,cAAA,QAAA,YAAA;AAIA,cAHA,KAAA,4BAAA,CAAA,YAAA,QAAA,IAAA,CAAA,SAAA,UAAA,GAGA,SAAAA,CAAA;AAAA,IAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IACA,UAAAP,GAAA;AAQA,UAAA,KAAA,YAAA,SAAA,cAAA,qBAAA,KAAA,wBAAA;AAKA;AAGA,YAAA,EAAA,aAAAQ,GAAA,aAAAC,EAAA,IAAAV,GAAAC,GAAA,KAAA,UAAA;AACA,UAAAS,KAAAD,GAAA;AACA,QAAAR,EAAA,eAAA,GACAA,EAAA,gBAAA;AACA,cAAAU,IAAAhB,GAAAe,IAAA,IAAA,IAAA,KAAA,GAAA;AAEA,YADAC,EAAA,MAAA,GACA,oBAAAA,GAAA;AACA,gBAAA5B,IAAA,oBAAA,SAAA,gBAAA,QAAAqB,KAAA;AAEA,UAAAO,EAAA,eAAA5B,CAAA;AAAA;AAAA;AAAA,IAEA;AAAA;AAAA;AAAA;AAAA,IACA,UAAA;AAKA,YAAA6B,IAAA,KAAA,sBAAA,KAAA,IAAA,cAAA,SAAA;AACA,MAAAA,KACAA,EAAA,MAAA;AAAA,IACA;AAAA,IACA,YAAAC;AAAA,EACA;AAEA,CAAA;;;;;;;;;;;;;;;","x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]}
|
|
1
|
+
{"version":3,"file":"index.77d9d16d.js","sources":["../../../../node_modules/focus-lock/dist/es2015/constants.js","../../../../node_modules/focus-lock/dist/es2015/utils/array.js","../../../../node_modules/focus-lock/dist/es2015/utils/is.js","../../../../node_modules/focus-lock/dist/es2015/utils/tabOrder.js","../../../../node_modules/focus-lock/dist/es2015/utils/tabbables.js","../../../../node_modules/focus-lock/dist/es2015/utils/tabUtils.js","../../../../node_modules/focus-lock/dist/es2015/utils/DOMutils.js","../../../../node_modules/focus-lock/dist/es2015/utils/all-affected.js","../../../../node_modules/focus-lock/dist/es2015/utils/getActiveElement.js","../../../../node_modules/focus-lock/dist/es2015/focusInside.js","../../../../node_modules/focus-lock/dist/es2015/focusIsHidden.js","../../../../node_modules/focus-lock/dist/es2015/utils/correctFocus.js","../../../../node_modules/focus-lock/dist/es2015/utils/firstFocus.js","../../../../node_modules/focus-lock/dist/es2015/solver.js","../../../../node_modules/focus-lock/dist/es2015/utils/parenting.js","../../../../node_modules/focus-lock/dist/es2015/focusMerge.js","../../../../node_modules/focus-lock/dist/es2015/focusables.js","../../../../node_modules/focus-lock/dist/es2015/setFocus.js","../../src/components/focus-trap/focus-trap.types.ts","../../src/utils/ts/focus-trap.utils.ts","../../src/components/focus-trap/focus-trap.vue"],"sourcesContent":["/**\n * defines a focus group\n */\nexport var FOCUS_GROUP = 'data-focus-lock';\n/**\n * disables element discovery inside a group marked by key\n */\nexport var FOCUS_DISABLED = 'data-focus-lock-disabled';\n/**\n * allows uncontrolled focus within the marked area, effectively disabling focus lock for it's content\n */\nexport var FOCUS_ALLOW = 'data-no-focus-lock';\n/**\n * instructs autofocus engine to pick default autofocus inside a given node\n * can be set on the element or container\n */\nexport var FOCUS_AUTO = 'data-autofocus-inside';\n/**\n * instructs autofocus to ignore elements within a given node\n * can be set on the element or container\n */\nexport var FOCUS_NO_AUTOFOCUS = 'data-no-autofocus';\n","/*\nIE11 support\n */\nexport var toArray = function (a) {\n var ret = Array(a.length);\n for (var i = 0; i < a.length; ++i) {\n ret[i] = a[i];\n }\n return ret;\n};\nexport var asArray = function (a) { return (Array.isArray(a) ? a : [a]); };\n","import { FOCUS_NO_AUTOFOCUS } from '../constants';\nvar isElementHidden = function (node) {\n // we can measure only \"elements\"\n // consider others as \"visible\"\n if (node.nodeType !== Node.ELEMENT_NODE) {\n return false;\n }\n var computedStyle = window.getComputedStyle(node, null);\n if (!computedStyle || !computedStyle.getPropertyValue) {\n return false;\n }\n return (computedStyle.getPropertyValue('display') === 'none' || computedStyle.getPropertyValue('visibility') === 'hidden');\n};\nvar getParentNode = function (node) {\n // DOCUMENT_FRAGMENT_NODE can also point on ShadowRoot. In this case .host will point on the next node\n return node.parentNode && node.parentNode.nodeType === Node.DOCUMENT_FRAGMENT_NODE\n ? // eslint-disable-next-line @typescript-eslint/no-explicit-any\n node.parentNode.host\n : node.parentNode;\n};\nvar isTopNode = function (node) {\n // @ts-ignore\n return node === document || (node && node.nodeType === Node.DOCUMENT_NODE);\n};\nvar isVisibleUncached = function (node, checkParent) {\n return !node || isTopNode(node) || (!isElementHidden(node) && checkParent(getParentNode(node)));\n};\nexport var isVisibleCached = function (visibilityCache, node) {\n var cached = visibilityCache.get(node);\n if (cached !== undefined) {\n return cached;\n }\n var result = isVisibleUncached(node, isVisibleCached.bind(undefined, visibilityCache));\n visibilityCache.set(node, result);\n return result;\n};\nvar isAutoFocusAllowedUncached = function (node, checkParent) {\n return node && !isTopNode(node) ? (isAutoFocusAllowed(node) ? checkParent(getParentNode(node)) : false) : true;\n};\nexport var isAutoFocusAllowedCached = function (cache, node) {\n var cached = cache.get(node);\n if (cached !== undefined) {\n return cached;\n }\n var result = isAutoFocusAllowedUncached(node, isAutoFocusAllowedCached.bind(undefined, cache));\n cache.set(node, result);\n return result;\n};\nexport var getDataset = function (node) {\n // @ts-ignore\n return node.dataset;\n};\nexport var isHTMLButtonElement = function (node) { return node.tagName === 'BUTTON'; };\nexport var isHTMLInputElement = function (node) { return node.tagName === 'INPUT'; };\nexport var isRadioElement = function (node) {\n return isHTMLInputElement(node) && node.type === 'radio';\n};\nexport var notHiddenInput = function (node) {\n return !((isHTMLInputElement(node) || isHTMLButtonElement(node)) && (node.type === 'hidden' || node.disabled));\n};\nexport var isAutoFocusAllowed = function (node) {\n var attribute = node.getAttribute(FOCUS_NO_AUTOFOCUS);\n return ![true, 'true', ''].includes(attribute);\n};\nexport var isGuard = function (node) { var _a; return Boolean(node && ((_a = getDataset(node)) === null || _a === void 0 ? void 0 : _a.focusGuard)); };\nexport var isNotAGuard = function (node) { return !isGuard(node); };\nexport var isDefined = function (x) { return Boolean(x); };\n","import { toArray } from './array';\nexport var tabSort = function (a, b) {\n var tabDiff = a.tabIndex - b.tabIndex;\n var indexDiff = a.index - b.index;\n if (tabDiff) {\n if (!a.tabIndex) {\n return 1;\n }\n if (!b.tabIndex) {\n return -1;\n }\n }\n return tabDiff || indexDiff;\n};\nexport var orderByTabIndex = function (nodes, filterNegative, keepGuards) {\n return toArray(nodes)\n .map(function (node, index) { return ({\n node: node,\n index: index,\n tabIndex: keepGuards && node.tabIndex === -1 ? ((node.dataset || {}).focusGuard ? 0 : -1) : node.tabIndex,\n }); })\n .filter(function (data) { return !filterNegative || data.tabIndex >= 0; })\n .sort(tabSort);\n};\n","/**\n * list of the object to be considered as focusable\n */\nexport var tabbables = [\n 'button:enabled',\n 'select:enabled',\n 'textarea:enabled',\n 'input:enabled',\n // elements with explicit roles will also use explicit tabindex\n // '[role=\"button\"]',\n 'a[href]',\n 'area[href]',\n 'summary',\n 'iframe',\n 'object',\n 'embed',\n 'audio[controls]',\n 'video[controls]',\n '[tabindex]',\n '[contenteditable]',\n '[autofocus]',\n];\n","import { FOCUS_AUTO } from '../constants';\nimport { toArray } from './array';\nimport { tabbables } from './tabbables';\nvar queryTabbables = tabbables.join(',');\nvar queryGuardTabbables = \"\".concat(queryTabbables, \", [data-focus-guard]\");\nvar getFocusablesWithShadowDom = function (parent, withGuards) {\n var _a;\n return toArray(((_a = parent.shadowRoot) === null || _a === void 0 ? void 0 : _a.children) || parent.children).reduce(function (acc, child) {\n return acc.concat(child.matches(withGuards ? queryGuardTabbables : queryTabbables) ? [child] : [], getFocusablesWithShadowDom(child));\n }, []);\n};\nexport var getFocusables = function (parents, withGuards) {\n return parents.reduce(function (acc, parent) {\n return acc.concat(\n // add all tabbables inside and within shadow DOMs in DOM order\n getFocusablesWithShadowDom(parent, withGuards), \n // add if node is tabbable itself\n parent.parentNode\n ? toArray(parent.parentNode.querySelectorAll(queryTabbables)).filter(function (node) { return node === parent; })\n : []);\n }, []);\n};\n/**\n * return a list of focusable nodes within an area marked as \"auto-focusable\"\n * @param parent\n */\nexport var getParentAutofocusables = function (parent) {\n var parentFocus = parent.querySelectorAll(\"[\".concat(FOCUS_AUTO, \"]\"));\n return toArray(parentFocus)\n .map(function (node) { return getFocusables([node]); })\n .reduce(function (acc, nodes) { return acc.concat(nodes); }, []);\n};\n","import { toArray } from './array';\nimport { isAutoFocusAllowedCached, isVisibleCached, notHiddenInput } from './is';\nimport { orderByTabIndex } from './tabOrder';\nimport { getFocusables, getParentAutofocusables } from './tabUtils';\n/**\n * given list of focusable elements keeps the ones user can interact with\n * @param nodes\n * @param visibilityCache\n */\nexport var filterFocusable = function (nodes, visibilityCache) {\n return toArray(nodes)\n .filter(function (node) { return isVisibleCached(visibilityCache, node); })\n .filter(function (node) { return notHiddenInput(node); });\n};\nexport var filterAutoFocusable = function (nodes, cache) {\n if (cache === void 0) { cache = new Map(); }\n return toArray(nodes).filter(function (node) { return isAutoFocusAllowedCached(cache, node); });\n};\n/**\n * only tabbable ones\n * (but with guards which would be ignored)\n */\nexport var getTabbableNodes = function (topNodes, visibilityCache, withGuards) {\n return orderByTabIndex(filterFocusable(getFocusables(topNodes, withGuards), visibilityCache), true, withGuards);\n};\n/**\n * actually anything \"focusable\", not only tabbable\n * (without guards, as long as they are not expected to be focused)\n */\nexport var getAllTabbableNodes = function (topNodes, visibilityCache) {\n return orderByTabIndex(filterFocusable(getFocusables(topNodes), visibilityCache), false);\n};\n/**\n * return list of nodes which are expected to be auto-focused\n * @param topNode\n * @param visibilityCache\n */\nexport var parentAutofocusables = function (topNode, visibilityCache) {\n return filterFocusable(getParentAutofocusables(topNode), visibilityCache);\n};\n/*\n * Determines if element is contained in scope, including nested shadow DOMs\n */\nexport var contains = function (scope, element) {\n return ((scope.shadowRoot\n ? contains(scope.shadowRoot, element)\n : scope.contains(element)) || Array.from(scope.children).some(function (child) { return contains(child, element); }));\n};\n","import { FOCUS_DISABLED, FOCUS_GROUP } from '../constants';\nimport { asArray, toArray } from './array';\n/**\n * in case of multiple nodes nested inside each other\n * keeps only top ones\n * this is O(nlogn)\n * @param nodes\n * @returns {*}\n */\nvar filterNested = function (nodes) {\n var contained = new Set();\n var l = nodes.length;\n for (var i = 0; i < l; i += 1) {\n for (var j = i + 1; j < l; j += 1) {\n var position = nodes[i].compareDocumentPosition(nodes[j]);\n /* eslint-disable no-bitwise */\n if ((position & Node.DOCUMENT_POSITION_CONTAINED_BY) > 0) {\n contained.add(j);\n }\n if ((position & Node.DOCUMENT_POSITION_CONTAINS) > 0) {\n contained.add(i);\n }\n /* eslint-enable */\n }\n }\n return nodes.filter(function (_, index) { return !contained.has(index); });\n};\n/**\n * finds top most parent for a node\n * @param node\n * @returns {*}\n */\nvar getTopParent = function (node) {\n return node.parentNode ? getTopParent(node.parentNode) : node;\n};\n/**\n * returns all \"focus containers\" inside a given node\n * @param node\n * @returns {T}\n */\nexport var getAllAffectedNodes = function (node) {\n var nodes = asArray(node);\n return nodes.filter(Boolean).reduce(function (acc, currentNode) {\n var group = currentNode.getAttribute(FOCUS_GROUP);\n acc.push.apply(acc, (group\n ? filterNested(toArray(getTopParent(currentNode).querySelectorAll(\"[\".concat(FOCUS_GROUP, \"=\\\"\").concat(group, \"\\\"]:not([\").concat(FOCUS_DISABLED, \"=\\\"disabled\\\"])\"))))\n : [currentNode]));\n return acc;\n }, []);\n};\n","var getNestedShadowActiveElement = function (shadowRoot) {\n return shadowRoot.activeElement\n ? shadowRoot.activeElement.shadowRoot\n ? getNestedShadowActiveElement(shadowRoot.activeElement.shadowRoot)\n : shadowRoot.activeElement\n : undefined;\n};\n/**\n * returns active element from document or from nested shadowdoms\n */\nexport var getActiveElement = function () {\n return (document.activeElement\n ? document.activeElement.shadowRoot\n ? getNestedShadowActiveElement(document.activeElement.shadowRoot)\n : document.activeElement\n : undefined); // eslint-disable-next-line @typescript-eslint/no-explicit-any\n};\n","import { contains } from './utils/DOMutils';\nimport { getAllAffectedNodes } from './utils/all-affected';\nimport { toArray } from './utils/array';\nimport { getActiveElement } from './utils/getActiveElement';\nvar focusInFrame = function (frame) { return frame === document.activeElement; };\nvar focusInsideIframe = function (topNode) {\n return Boolean(toArray(topNode.querySelectorAll('iframe')).some(function (node) { return focusInFrame(node); }));\n};\n/**\n * @returns {Boolean} true, if the current focus is inside given node or nodes\n */\nexport var focusInside = function (topNode) {\n var activeElement = document && getActiveElement();\n if (!activeElement || (activeElement.dataset && activeElement.dataset.focusGuard)) {\n return false;\n }\n return getAllAffectedNodes(topNode).some(function (node) { return contains(node, activeElement) || focusInsideIframe(node); });\n};\n","import { FOCUS_ALLOW } from './constants';\nimport { contains } from './utils/DOMutils';\nimport { toArray } from './utils/array';\nimport { getActiveElement } from './utils/getActiveElement';\n/**\n * focus is hidden FROM the focus-lock\n * ie contained inside a node focus-lock shall ignore\n * @returns {boolean} focus is currently is in \"allow\" area\n */\nexport var focusIsHidden = function () {\n var activeElement = document && getActiveElement();\n if (!activeElement) {\n return false;\n }\n // this does not support setting FOCUS_ALLOW within shadow dom\n return toArray(document.querySelectorAll(\"[\".concat(FOCUS_ALLOW, \"]\"))).some(function (node) { return contains(node, activeElement); });\n};\n","import { isRadioElement } from './is';\nvar findSelectedRadio = function (node, nodes) {\n return nodes\n .filter(isRadioElement)\n .filter(function (el) { return el.name === node.name; })\n .filter(function (el) { return el.checked; })[0] || node;\n};\nexport var correctNode = function (node, nodes) {\n if (isRadioElement(node) && node.name) {\n return findSelectedRadio(node, nodes);\n }\n return node;\n};\n/**\n * giving a set of radio inputs keeps only selected (tabbable) ones\n * @param nodes\n */\nexport var correctNodes = function (nodes) {\n // IE11 has no Set(array) constructor\n var resultSet = new Set();\n nodes.forEach(function (node) { return resultSet.add(correctNode(node, nodes)); });\n // using filter to support IE11\n return nodes.filter(function (node) { return resultSet.has(node); });\n};\n","import { correctNode } from './correctFocus';\nexport var pickFirstFocus = function (nodes) {\n if (nodes[0] && nodes.length > 1) {\n return correctNode(nodes[0], nodes);\n }\n return nodes[0];\n};\nexport var pickFocusable = function (nodes, index) {\n if (nodes.length > 1) {\n return nodes.indexOf(correctNode(nodes[index], nodes));\n }\n return index;\n};\n","import { correctNodes } from './utils/correctFocus';\nimport { pickFocusable } from './utils/firstFocus';\nimport { isGuard } from './utils/is';\nexport var NEW_FOCUS = 'NEW_FOCUS';\n/**\n * Main solver for the \"find next focus\" question\n * @param innerNodes\n * @param outerNodes\n * @param activeElement\n * @param lastNode\n * @returns {number|string|undefined|*}\n */\nexport var newFocus = function (innerNodes, outerNodes, activeElement, lastNode) {\n var cnt = innerNodes.length;\n var firstFocus = innerNodes[0];\n var lastFocus = innerNodes[cnt - 1];\n var isOnGuard = isGuard(activeElement);\n // focus is inside\n if (activeElement && innerNodes.indexOf(activeElement) >= 0) {\n return undefined;\n }\n var activeIndex = activeElement !== undefined ? outerNodes.indexOf(activeElement) : -1;\n var lastIndex = lastNode ? outerNodes.indexOf(lastNode) : activeIndex;\n var lastNodeInside = lastNode ? innerNodes.indexOf(lastNode) : -1;\n var indexDiff = activeIndex - lastIndex;\n var firstNodeIndex = outerNodes.indexOf(firstFocus);\n var lastNodeIndex = outerNodes.indexOf(lastFocus);\n var correctedNodes = correctNodes(outerNodes);\n var correctedIndex = activeElement !== undefined ? correctedNodes.indexOf(activeElement) : -1;\n var correctedIndexDiff = correctedIndex - (lastNode ? correctedNodes.indexOf(lastNode) : activeIndex);\n var returnFirstNode = pickFocusable(innerNodes, 0);\n var returnLastNode = pickFocusable(innerNodes, cnt - 1);\n // new focus\n if (activeIndex === -1 || lastNodeInside === -1) {\n return NEW_FOCUS;\n }\n // old focus\n if (!indexDiff && lastNodeInside >= 0) {\n return lastNodeInside;\n }\n // first element\n if (activeIndex <= firstNodeIndex && isOnGuard && Math.abs(indexDiff) > 1) {\n return returnLastNode;\n }\n // last element\n if (activeIndex >= lastNodeIndex && isOnGuard && Math.abs(indexDiff) > 1) {\n return returnFirstNode;\n }\n // jump out, but not on the guard\n if (indexDiff && Math.abs(correctedIndexDiff) > 1) {\n return lastNodeInside;\n }\n // focus above lock\n if (activeIndex <= firstNodeIndex) {\n return returnLastNode;\n }\n // focus below lock\n if (activeIndex > lastNodeIndex) {\n return returnFirstNode;\n }\n // index is inside tab order, but outside Lock\n if (indexDiff) {\n if (Math.abs(indexDiff) > 1) {\n return lastNodeInside;\n }\n return (cnt + lastNodeInside + indexDiff) % cnt;\n }\n // do nothing\n return undefined;\n};\n","import { parentAutofocusables } from './DOMutils';\nimport { contains } from './DOMutils';\nimport { asArray } from './array';\nvar getParents = function (node, parents) {\n if (parents === void 0) { parents = []; }\n parents.push(node);\n if (node.parentNode) {\n getParents(node.parentNode.host || node.parentNode, parents);\n }\n return parents;\n};\n/**\n * finds a parent for both nodeA and nodeB\n * @param nodeA\n * @param nodeB\n * @returns {boolean|*}\n */\nexport var getCommonParent = function (nodeA, nodeB) {\n var parentsA = getParents(nodeA);\n var parentsB = getParents(nodeB);\n // tslint:disable-next-line:prefer-for-of\n for (var i = 0; i < parentsA.length; i += 1) {\n var currentParent = parentsA[i];\n if (parentsB.indexOf(currentParent) >= 0) {\n return currentParent;\n }\n }\n return false;\n};\nexport var getTopCommonParent = function (baseActiveElement, leftEntry, rightEntries) {\n var activeElements = asArray(baseActiveElement);\n var leftEntries = asArray(leftEntry);\n var activeElement = activeElements[0];\n var topCommon = false;\n leftEntries.filter(Boolean).forEach(function (entry) {\n topCommon = getCommonParent(topCommon || entry, entry) || topCommon;\n rightEntries.filter(Boolean).forEach(function (subEntry) {\n var common = getCommonParent(activeElement, subEntry);\n if (common) {\n if (!topCommon || contains(common, topCommon)) {\n topCommon = common;\n }\n else {\n topCommon = getCommonParent(common, topCommon);\n }\n }\n });\n });\n // TODO: add assert here?\n return topCommon;\n};\n/**\n * return list of nodes which are expected to be autofocused inside a given top nodes\n * @param entries\n * @param visibilityCache\n */\nexport var allParentAutofocusables = function (entries, visibilityCache) {\n return entries.reduce(function (acc, node) { return acc.concat(parentAutofocusables(node, visibilityCache)); }, []);\n};\n","import { NEW_FOCUS, newFocus } from './solver';\nimport { filterAutoFocusable, getAllTabbableNodes, getTabbableNodes } from './utils/DOMutils';\nimport { getAllAffectedNodes } from './utils/all-affected';\nimport { pickFirstFocus } from './utils/firstFocus';\nimport { getActiveElement } from './utils/getActiveElement';\nimport { getDataset, isDefined, isNotAGuard } from './utils/is';\nimport { allParentAutofocusables, getTopCommonParent } from './utils/parenting';\nvar findAutoFocused = function (autoFocusables) {\n return function (node) { var _a; \n // @ts-expect-error\n return node.autofocus || !!((_a = getDataset(node)) === null || _a === void 0 ? void 0 : _a.autofocus) || autoFocusables.indexOf(node) >= 0; };\n};\nvar reorderNodes = function (srcNodes, dstNodes) {\n var remap = new Map();\n // no Set(dstNodes) for IE11 :(\n dstNodes.forEach(function (entity) { return remap.set(entity.node, entity); });\n // remap to dstNodes\n return srcNodes.map(function (node) { return remap.get(node); }).filter(isDefined);\n};\n/**\n * given top node(s) and the last active element return the element to be focused next\n * @param topNode\n * @param lastNode\n */\nexport var getFocusMerge = function (topNode, lastNode) {\n var activeElement = document && getActiveElement();\n var entries = getAllAffectedNodes(topNode).filter(isNotAGuard);\n var commonParent = getTopCommonParent(activeElement || topNode, topNode, entries);\n var visibilityCache = new Map();\n var anyFocusable = getAllTabbableNodes(entries, visibilityCache);\n var innerElements = getTabbableNodes(entries, visibilityCache).filter(function (_a) {\n var node = _a.node;\n return isNotAGuard(node);\n });\n if (!innerElements[0]) {\n innerElements = anyFocusable;\n if (!innerElements[0]) {\n return undefined;\n }\n }\n var outerNodes = getAllTabbableNodes([commonParent], visibilityCache).map(function (_a) {\n var node = _a.node;\n return node;\n });\n var orderedInnerElements = reorderNodes(outerNodes, innerElements);\n var innerNodes = orderedInnerElements.map(function (_a) {\n var node = _a.node;\n return node;\n });\n var newId = newFocus(innerNodes, outerNodes, activeElement, lastNode);\n if (newId === NEW_FOCUS) {\n var autoFocusable = filterAutoFocusable(anyFocusable.map(function (_a) {\n var node = _a.node;\n return node;\n })).filter(findAutoFocused(allParentAutofocusables(entries, visibilityCache)));\n return {\n node: autoFocusable && autoFocusable.length\n ? pickFirstFocus(autoFocusable)\n : pickFirstFocus(filterAutoFocusable(innerNodes)),\n };\n }\n if (newId === undefined) {\n return newId;\n }\n return orderedInnerElements[newId];\n};\n","import { getTabbableNodes } from './utils/DOMutils';\nimport { getAllAffectedNodes } from './utils/all-affected';\nimport { isGuard, isNotAGuard } from './utils/is';\nimport { getTopCommonParent } from './utils/parenting';\n/**\n * return list of focusable elements inside a given top node\n * @deprecated use {@link getFocusableIn}. Yep, there is typo in the function name\n */\nexport var getFocusabledIn = function (topNode) {\n var entries = getAllAffectedNodes(topNode).filter(isNotAGuard);\n var commonParent = getTopCommonParent(topNode, topNode, entries);\n var visibilityCache = new Map();\n var outerNodes = getTabbableNodes([commonParent], visibilityCache, true);\n var innerElements = getTabbableNodes(entries, visibilityCache)\n .filter(function (_a) {\n var node = _a.node;\n return isNotAGuard(node);\n })\n .map(function (_a) {\n var node = _a.node;\n return node;\n });\n return outerNodes.map(function (_a) {\n var node = _a.node, index = _a.index;\n return ({\n node: node,\n index: index,\n lockItem: innerElements.indexOf(node) >= 0,\n guard: isGuard(node),\n });\n });\n};\n/**\n * return list of focusable elements inside a given top node\n */\nexport var getFocusableIn = getFocusabledIn;\n","import { getFocusMerge } from './focusMerge';\nexport var focusOn = function (target, focusOptions) {\n if ('focus' in target) {\n target.focus(focusOptions);\n }\n if ('contentWindow' in target && target.contentWindow) {\n target.contentWindow.focus();\n }\n};\nvar guardCount = 0;\nvar lockDisabled = false;\n/**\n * Sets focus at a given node. The last focused element will help to determine which element(first or last) should be focused.\n * HTML markers (see {@link import('./constants').FOCUS_AUTO} constants) can control autofocus\n * @param topNode\n * @param lastNode\n * @param options\n */\nexport var setFocus = function (topNode, lastNode, options) {\n if (options === void 0) { options = {}; }\n var focusable = getFocusMerge(topNode, lastNode);\n if (lockDisabled) {\n return;\n }\n if (focusable) {\n if (guardCount > 2) {\n // tslint:disable-next-line:no-console\n console.error('FocusLock: focus-fighting detected. Only one focus management system could be active. ' +\n 'See https://github.com/theKashey/focus-lock/#focus-fighting');\n lockDisabled = true;\n setTimeout(function () {\n lockDisabled = false;\n }, 1);\n return;\n }\n guardCount++;\n focusOn(focusable.node, options.focusOptions);\n guardCount--;\n }\n};\n","export enum BentoFocusTrapArrowNavigationDirection {\n VERTICAL = 'vertical',\n HORIZONTAL = 'horizontal',\n}\n\nexport enum BentoFocusTrapVerticalNavigationEvent {\n ARROW_UP = 'arrowup',\n ARROW_DOWN = 'arrowdown',\n}\n\nexport enum BentoFocusTrapHorizontalNavigationEvent {\n ARROW_LEFT = 'arrowleft',\n ARROW_RIGHT = 'arrowright',\n}\n\nexport interface BentoFocusTrapFocusableIn {\n node: HTMLElement;\n /**\n * tab index\n */\n index: number;\n /**\n * true, if this node belongs to a Lock\n */\n lockItem: boolean;\n /**\n * true, if this node is a focus-guard (system node)\n */\n guard: boolean;\n}\n","import { getFocusableIn } from 'focus-lock';\nimport {\n BentoFocusTrapFocusableIn,\n BentoFocusTrapHorizontalNavigationEvent,\n BentoFocusTrapVerticalNavigationEvent,\n} from '@/components/focus-trap/focus-trap.types';\n\n/**\n * Perform callback before next re-paint frame of browser.\n *\n * @param action\n * @returns\n */\nexport const deferAction = (callback: FrameRequestCallback) => requestAnimationFrame(callback);\n\n/**\n * Get's the index number of the current node inside an array of focusable elements.\n *\n * @param node an HTMLElement node\n * @param nodes an array of focusable elements\n * @returns\n */\nconst getNodeIndex = (node: Element, nodes: BentoFocusTrapFocusableIn[]) => {\n const index = nodes.findIndex(item => item.node === node);\n return index === -1 ? 0 : index;\n};\n\n/**\n * Retrieves the next focusable element using a factor to either choose\n * the next or previous focusable element.\n *\n * @param factor a number +1 or -1\n * @param element the element to checks for focusable elements inside of\n * @returns\n */\nexport const getNextFocusableElement = (factor, element): HTMLElement => {\n const currentFocusedEl = document.activeElement;\n const focusableElements = getFocusableIn(element);\n const nextIndex = getNodeIndex(currentFocusedEl, focusableElements) + factor;\n return focusableElements[nextIndex]?.node || (currentFocusedEl as HTMLElement);\n};\n\n/**\n * Returns an object is if keyboard event key is an arrow previous or next key.\n * this changes depending on if the arrow navigation is horizontal or vertical.\n *\n * @param event\n * @param arrowOrder\n * @returns { isArrowNext: boolean, isArrowPrev: boolean }\n */\nexport const getArrowType = (\n event: KeyboardEvent,\n arrowOrder: BentoFocusTrapVerticalNavigationEvent[] | BentoFocusTrapHorizontalNavigationEvent[]\n) => {\n const eventKey = event.key.toLowerCase();\n return {\n isArrowNext: eventKey === arrowOrder[0],\n isArrowPrev: eventKey === arrowOrder[1],\n };\n};\n\n/**\n * Default scrolling into view options\n */\nexport const SCROLL_INTO_VIEW_OPTIONS: ScrollIntoViewOptions = {\n behavior: 'smooth',\n block: 'center',\n inline: 'center',\n};\n","<template>\n <div\n v-if=\"useHasSlot($slots)('default')\"\n ref=\"root\"\n class=\"b-focus-trap\"\n data-testid=\"focus-trap\"\n tabindex=\"-1\"\n v-on=\"arrowNavigation ? { keydown: onKeyDown } : {}\"\n @focusout=\"onBlur\"\n >\n <slot></slot>\n </div>\n</template>\n\n<script lang=\"ts\">\n import { defineComponent, PropType } from 'vue';\n import moveFocusInside, { focusInside, focusIsHidden } from 'focus-lock';\n import {\n BentoFocusTrapArrowNavigationDirection,\n BentoFocusTrapHorizontalNavigationEvent,\n BentoFocusTrapVerticalNavigationEvent,\n } from './focus-trap.types';\n import {\n deferAction,\n getArrowType,\n getNextFocusableElement,\n SCROLL_INTO_VIEW_OPTIONS,\n } from '@/utils/ts/focus-trap.utils';\n import { useHasSlot } from '@/composables';\n\n /**\n * Locks the focus inside an element for a11y navigation.\n * Useful for things like modals, popovers, etc...\n *\n * @example\n * import { BentoFocusTrap, BentoButton } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoFocusTrap, BentoButton },\n * template: `\n * <div id=\"import-choice\">\n * <bento-focus-trap>\n * Make a choice to proceed further!\n * <bento-button>Yes</bento-button>\n * <bento-button>No</bento-button>\n * </bento-focus-trap>\n * </div>\n * `\n * };\n */\n export default defineComponent({\n name: 'bento-focus-trap',\n props: {\n /**\n * Enables / Disables arrow navigation as well can determine the type of arrow navigation.\n * The types of arrow navigation are horizontal and vertical.\n */\n arrowNavigation: {\n type: String as PropType<BentoFocusTrapArrowNavigationDirection>,\n default: undefined,\n validator: value =>\n Object.values(BentoFocusTrapArrowNavigationDirection).includes(\n value as BentoFocusTrapArrowNavigationDirection\n ),\n },\n /**\n * Enables / disables the focus trap.\n */\n disabled: {\n type: Boolean,\n default: false,\n },\n },\n data: () => ({\n lastFocusedElement: null,\n }),\n computed: {\n isHorizontalArrowNavigation(): boolean {\n return this.arrowNavigation === BentoFocusTrapArrowNavigationDirection.HORIZONTAL;\n },\n isVerticalArrowNavigation(): boolean {\n return this.arrowNavigation === BentoFocusTrapArrowNavigationDirection.VERTICAL;\n },\n arrowOrder() {\n return this.isVerticalArrowNavigation\n ? Object.values(BentoFocusTrapVerticalNavigationEvent)\n : Object.values(BentoFocusTrapHorizontalNavigationEvent);\n },\n },\n watch: {\n /**\n * If the disabled prop changes, then enable / disable the focus trap.\n */\n disabled() {\n if (this.disabled) {\n this.disable();\n } else {\n this.setFocusInside();\n }\n },\n },\n mounted() {\n if (this.disabled) {\n return;\n }\n this.setFocusInside();\n },\n beforeUnmount() {\n if (this.disabled) {\n return;\n }\n this.disable();\n },\n methods: {\n /**\n * Set focus back inside the element area, giving the last focus element\n * `focus-lock` can determine the next interable element to focus on.\n */\n async setFocusInside() {\n const isFocusOnBody = document.activeElement === document.body;\n if (isFocusOnBody || focusIsHidden() || !this.lastFocusedElement) {\n if (!focusInside(this.$refs.root as HTMLElement)) {\n moveFocusInside(this.$refs.root as HTMLElement, this.lastFocusedElement);\n }\n this.lastFocusedElement = document.activeElement;\n }\n },\n /**\n * On blur, trap the focus inside!\n */\n onBlur() {\n if (this.disabled) {\n return;\n }\n deferAction(this.setFocusInside);\n },\n /**\n * If the no arrow navigation is enabled\n * or if the currently focus element is a textarea or an input then prevent navigation.\n */\n shouldPreventNavigation() {\n if (!this.isVerticalArrowNavigation && !this.isHorizontalArrowNavigation) {\n return false;\n }\n\n const currentTag = document.activeElement.tagName.toLowerCase();\n const possibleFormControls = this.isVerticalArrowNavigation\n ? ['textarea', 'select']\n : ['input', 'textarea'];\n return possibleFormControls.includes(currentTag);\n },\n /**\n * When an arrow key is pressed then navigate to the next focusable element.\n * If trap is disabled or is content editable then prevent arrow navigation.\n *\n * @param event on keyboard press event\n */\n onKeyDown(event: KeyboardEvent) {\n if (\n this.disabled ||\n (document.activeElement as HTMLElement).isContentEditable ||\n this.shouldPreventNavigation()\n ) {\n return;\n }\n\n const { isArrowNext, isArrowPrev } = getArrowType(event, this.arrowOrder);\n if (isArrowPrev || isArrowNext) {\n event.preventDefault();\n event.stopPropagation();\n const focusableEl = getNextFocusableElement(isArrowPrev ? 1 : -1, this.$el);\n focusableEl.focus();\n if ('scrollIntoView' in focusableEl) {\n const options =\n 'scrollBehavior' in document.documentElement.style ? SCROLL_INTO_VIEW_OPTIONS : false;\n focusableEl.scrollIntoView(options);\n }\n }\n },\n /**\n * If focus trap is disabled then return focus to last focus element, parent node or simply the document body.\n */\n disable() {\n const focusOnDestroyEl = this.lastFocusedElement || this.$el.parentNode || document.body;\n if (focusOnDestroyEl) {\n focusOnDestroyEl.focus();\n }\n },\n useHasSlot,\n },\n });\n</script>\n\n<style lang=\"scss\" scoped>\n .b-focus-trap {\n outline: none;\n }\n</style>\n"],"names":["FOCUS_GROUP","FOCUS_DISABLED","FOCUS_ALLOW","FOCUS_AUTO","FOCUS_NO_AUTOFOCUS","toArray","a","ret","i","asArray","isElementHidden","node","computedStyle","getParentNode","isTopNode","isVisibleUncached","checkParent","isVisibleCached","visibilityCache","cached","result","isAutoFocusAllowedUncached","isAutoFocusAllowed","isAutoFocusAllowedCached","cache","getDataset","isHTMLButtonElement","isHTMLInputElement","isRadioElement","notHiddenInput","attribute","isGuard","_a","isNotAGuard","isDefined","x","tabSort","b","tabDiff","indexDiff","orderByTabIndex","nodes","filterNegative","keepGuards","index","data","tabbables","queryTabbables","queryGuardTabbables","getFocusablesWithShadowDom","parent","withGuards","acc","child","getFocusables","parents","getParentAutofocusables","parentFocus","filterFocusable","filterAutoFocusable","getTabbableNodes","topNodes","getAllTabbableNodes","parentAutofocusables","topNode","contains","scope","element","filterNested","contained","l","j","position","_","getTopParent","getAllAffectedNodes","currentNode","group","getNestedShadowActiveElement","shadowRoot","getActiveElement","focusInFrame","frame","focusInsideIframe","focusInside","activeElement","focusIsHidden","findSelectedRadio","el","correctNode","correctNodes","resultSet","pickFirstFocus","pickFocusable","NEW_FOCUS","newFocus","innerNodes","outerNodes","lastNode","cnt","firstFocus","lastFocus","isOnGuard","activeIndex","lastIndex","lastNodeInside","firstNodeIndex","lastNodeIndex","correctedNodes","correctedIndex","correctedIndexDiff","returnFirstNode","returnLastNode","getParents","getCommonParent","nodeA","nodeB","parentsA","parentsB","currentParent","getTopCommonParent","baseActiveElement","leftEntry","rightEntries","activeElements","leftEntries","topCommon","entry","subEntry","common","allParentAutofocusables","entries","findAutoFocused","autoFocusables","reorderNodes","srcNodes","dstNodes","remap","entity","getFocusMerge","commonParent","anyFocusable","innerElements","orderedInnerElements","newId","autoFocusable","getFocusabledIn","getFocusableIn","focusOn","target","focusOptions","guardCount","lockDisabled","setFocus","options","focusable","BentoFocusTrapArrowNavigationDirection","BentoFocusTrapArrowNavigationDirection2","BentoFocusTrapVerticalNavigationEvent","BentoFocusTrapVerticalNavigationEvent2","BentoFocusTrapHorizontalNavigationEvent","BentoFocusTrapHorizontalNavigationEvent2","deferAction","callback","getNodeIndex","item","getNextFocusableElement","factor","currentFocusedEl","focusableElements","nextIndex","getArrowType","event","arrowOrder","eventKey","SCROLL_INTO_VIEW_OPTIONS","_sfc_main","defineComponent","value","currentTag","isArrowNext","isArrowPrev","focusableEl","focusOnDestroyEl","useHasSlot"],"mappings":";;;;AAGO,IAAAA,IAAA,mBAIAC,KAAA,4BAIAC,KAAA,sBAKAC,KAAA,yBAKAC,KAAA,qBClBAC,IAAA,SAAAC,GAAA;AAEP,WADAC,IAAA,MAAAD,EAAA,MAAA,GACAE,IAAA,GAAAA,IAAAF,EAAA,QAAA,EAAAE;AACA,IAAAD,EAAAC,CAAA,IAAAF,EAAAE,CAAA;AAEA,SAAAD;AACA,GACOE,IAAA,SAAAH,GAAA;AAAA,SAAA,MAAA,QAAAA,CAAA,IAAAA,IAAA,CAAAA,CAAA;AAAA,GCTPI,KAAA,SAAAC,GAAA;AAGA,MAAAA,EAAA,aAAA,KAAA;AACA,WAAA;AAEA,MAAAC,IAAA,OAAA,iBAAAD,GAAA,IAAA;AACA,SAAA,CAAAC,KAAA,CAAAA,EAAA,mBACA,KAEAA,EAAA,iBAAA,SAAA,MAAA,UAAAA,EAAA,iBAAA,YAAA,MAAA;AACA,GACAC,IAAA,SAAAF,GAAA;AAEA,SAAAA,EAAA,cAAAA,EAAA,WAAA,aAAA,KAAA;AAAA;AAAA,IAEAA,EAAA,WAAA;AAAA,MACAA,EAAA;AACA,GACAG,IAAA,SAAAH,GAAA;AAEA,SAAAA,MAAA,YAAAA,KAAAA,EAAA,aAAA,KAAA;AACA,GACAI,KAAA,SAAAJ,GAAAK,GAAA;AACA,SAAA,CAAAL,KAAAG,EAAAH,CAAA,KAAA,CAAAD,GAAAC,CAAA,KAAAK,EAAAH,EAAAF,CAAA,CAAA;AACA,GACOM,IAAA,SAAAC,GAAAP,GAAA;AACP,MAAAQ,IAAAD,EAAA,IAAAP,CAAA;AACA,MAAAQ,MAAA;AACA,W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AAAA;AAAA;AAAA,IACA,UAAA;AAKA,YAAA6B,IAAA,KAAA,sBAAA,KAAA,IAAA,cAAA,SAAA;AACA,MAAAA,KACAA,EAAA,MAAA;AAAA,IACA;AAAA,IACA,YAAAC;AAAA,EACA;AAEA,CAAA;;;;;;;;;;;;;;;","x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { defineComponent as x, computed as v, ref as c, onMounted as K, inject as U } from "vue";
|
|
2
2
|
import { n as k } from "./_plugin-vue2_normalizer.71e2aa87.js";
|
|
3
3
|
import { g as I } from "./unique-id.a2a2b458.js";
|
|
4
|
-
import { a as H } from "./button.
|
|
4
|
+
import { a as H } from "./button.1dfed6fa.js";
|
|
5
5
|
import { BentoPopover as q, BentoPopoverPositions as w } from "../popover.js";
|
|
6
6
|
import { a as W, C as B } from "./chevron-left.c10778d3.js";
|
|
7
|
-
import { B as j, a as O } from "./base-button.
|
|
8
|
-
import { B as V } from "./index.
|
|
7
|
+
import { B as j, a as O } from "./base-button.9ec79f68.js";
|
|
8
|
+
import { B as V } from "./index.4de86bd4.js";
|
|
9
9
|
import { B as Z } from "./directive.0408e565.js";
|
|
10
|
-
import "../assets/
|
|
10
|
+
import "../assets/index16.css";
|
|
11
11
|
let L = 0;
|
|
12
12
|
const $ = {
|
|
13
13
|
beforeCreate() {
|
|
@@ -472,4 +472,4 @@ export {
|
|
|
472
472
|
ye as M,
|
|
473
473
|
f as a
|
|
474
474
|
};
|
|
475
|
-
//# sourceMappingURL=index.
|
|
475
|
+
//# sourceMappingURL=index.9da73645.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.37283390.js","sources":["../../../../node_modules/@adyen/ui-assets-icons-16/dist/vue/options-vertical.vue","../../src/components/menu/components/menu-item/menu-item.vue","../../src/components/menu/menu.types.ts","../../src/components/menu/components/menu-list-container/menu-list-container.vue","../../src/components/menu/components/sub-menu-item-list/sub-menu-item-list.vue","../../src/components/menu/components/menu-item-list/menu-item-list.vue","../../src/components/menu/menu.keys.ts","../../src/components/menu/menu.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=\"M8 4C8.29667 4 8.58668 3.91203 8.83335 3.74721C9.08003 3.58238 9.27229 3.34811 9.38582 3.07403C9.49935 2.79994 9.52906 2.49834 9.47118 2.20737C9.4133 1.91639 9.27044 1.64912 9.06066 1.43934C8.85088 1.22956 8.58361 1.0867 8.29264 1.02882C8.00166 0.970945 7.70006 1.00065 7.42597 1.11418C7.15189 1.22771 6.91762 1.41997 6.7528 1.66665C6.58797 1.91332 6.5 2.20333 6.5 2.5C6.5 2.89783 6.65804 3.27936 6.93934 3.56066C7.22064 3.84197 7.60218 4 8 4Z\" clip-rule=\"evenodd\"/><path fill=\"#00112C\" fill-rule=\"evenodd\" d=\"M8 15C8.29667 15 8.58668 14.912 8.83335 14.7472C9.08003 14.5824 9.27229 14.3481 9.38582 14.074C9.49935 13.7999 9.52906 13.4983 9.47118 13.2074C9.4133 12.9164 9.27044 12.6491 9.06066 12.4393C8.85088 12.2296 8.58361 12.0867 8.29264 12.0288C8.00166 11.9709 7.70006 12.0007 7.42597 12.1142C7.15189 12.2277 6.91762 12.42 6.7528 12.6666C6.58797 12.9133 6.5 13.2033 6.5 13.5C6.5 13.8978 6.65804 14.2794 6.93934 14.5607C7.22064 14.842 7.60218 15 8 15Z\" clip-rule=\"evenodd\"/><path fill=\"#00112C\" fill-rule=\"evenodd\" d=\"M8.83335 9.24721C8.58668 9.41203 8.29667 9.5 8 9.5C7.60218 9.5 7.22064 9.34197 6.93934 9.06066C6.65804 8.77936 6.5 8.39783 6.5 8C6.5 7.70333 6.58797 7.41332 6.7528 7.16665C6.91762 6.91997 7.15189 6.72771 7.42597 6.61418C7.70006 6.50065 8.00166 6.47094 8.29264 6.52882C8.58361 6.5867 8.85088 6.72956 9.06066 6.93934C9.27044 7.14912 9.4133 7.41639 9.47118 7.70737C9.52906 7.99834 9.49935 8.29994 9.38582 8.57403C9.27229 8.84811 9.08003 9.08238 8.83335 9.24721Z\" 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 <base-button\n class=\"b-menu-item\"\n role=\"menuitem\"\n :class=\"conditionalClasses\"\n :disabled=\"disabled\"\n tabindex=\"-1\"\n @click=\"onClick\"\n >\n <template v-if=\"icon\" #iconLeft>\n <component :is=\"icon\" class=\"b-menu-item__icon-left\" aria-hidden=\"true\" />\n </template>\n <template #default>\n <bento-typography el=\"span\" variant=\"body\" :stronger=\"isTitle\" class=\"b-menu-item__primary-text\">\n {{ text }}\n </bento-typography>\n <bento-typography v-if=\"secondaryText\" el=\"span\" variant=\"body\" class=\"b-menu-item__secondary-text\">\n {{ secondaryText }}\n </bento-typography>\n </template>\n <template v-if=\"chevron\" #iconRight><chevron-right-icon aria-hidden=\"true\" /></template>\n </base-button>\n</template>\n\n<script lang=\"ts\">\n import { computed, defineComponent, PropType } from 'vue';\n import ChevronRightIcon from '@adyen/ui-assets-icons-16/vue/chevron-right';\n import { BaseButton, BentoBaseButtonEvent } from '@/components/internal/base-button';\n import { BentoTypography } from '@/components/typography';\n import { BentoMenuItem } from './menu-item.types';\n\n /**\n * Menu item component to render items in a menu. For internal use only.\n */\n export default defineComponent({\n name: 'menu-item',\n components: { BaseButton, BentoTypography, ChevronRightIcon },\n props: {\n /**\n * menu-item text that gets displayed as the main label\n */\n text: {\n type: String,\n required: true,\n },\n /**\n * menu-item action that gets executed when the MeniItem is clicked\n */\n handler: {\n type: Function as PropType<BentoMenuItem['handler']>,\n required: true,\n },\n /**\n * menu-item text that gets displayed as the secondary label\n */\n secondaryText: {\n type: String,\n default: null,\n },\n /**\n * Optional chevron icon displayed to the right of the menu-item\n */\n chevron: {\n type: Boolean,\n default: false,\n },\n /**\n * Optional icon displayed to the left of the menu-item\n */\n icon: {\n // Types for Vue2 (Object) and Vue3 (Function)\n // TODO: Remove Object when fully migrated to Vue3\n type: [Object, Function] as PropType<BentoMenuItem['icon']>,\n default: null,\n },\n /**\n * Disables menu-item button functionality\n */\n disabled: {\n type: Boolean,\n default: false,\n },\n /**\n * Displays an indent variant od the menu-item\n */\n indent: {\n type: Boolean,\n default: false,\n },\n /**\n * Displays menu-item button as critical\n */\n critical: {\n type: Boolean,\n default: false,\n },\n /**\n * Renders the text in a bold variant\n */\n isTitle: {\n type: Boolean,\n default: false,\n },\n },\n emits: [BentoBaseButtonEvent.CLICK],\n setup(props, { emit }) {\n const conditionalClasses = computed(() => ({\n 'b-menu-item--critical': props.critical,\n 'b-menu-item--indent': props.indent,\n }));\n\n const onClick = (e: MouseEvent) => {\n e.stopPropagation();\n props.handler();\n emit(BentoBaseButtonEvent.CLICK);\n };\n\n return {\n // Values\n conditionalClasses,\n\n // Methods\n onClick,\n };\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./menu-item.scss\" />\n","import { BentoButton } from '../button';\n\nexport enum BentoMenuEvent {\n BACK = 'back',\n CLOSE = 'close',\n OPEN = 'open',\n}\n\ntype ButtonProps = InstanceType<typeof BentoButton>['$props'];\n\nexport type BentoMenuButtonProps = {\n variant?: ButtonProps['variant'];\n condensed?: ButtonProps['condensed'];\n disabled?: ButtonProps['disabled'];\n};\n","<template>\n <div class=\"b-menu-list-container\"><slot></slot></div>\n</template>\n\n<script lang=\"ts\">\n import { defineComponent } from 'vue';\n\n /**\n * Menu list container component to set the correct styling in a menu list. For internal use only.\n */\n export default defineComponent({\n name: 'bento-menu-list-container',\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./menu-list-container.scss\" />\n","<template>\n <transition name=\"b-sub-menu-item-list__transition\" appear>\n <menu-list-container class=\"b-sub-menu-item-list\">\n <ul\n ref=\"subMenuItemListRefLocal\"\n role=\"menu\"\n class=\"b-sub-menu-item-list__list\"\n @keydown.down.stop=\"focusNext\"\n @keydown.up.stop=\"focusPrevious\"\n @keydown.esc.stop=\"onBackButton\"\n >\n <li\n v-for=\"(item, index) in computedItems\"\n :key=\"`sub-menu-item-list-item-${index}`\"\n :class=\"[\n { 'b-sub-menu-item-list__back-button': index === 0 },\n { 'b-sub-menu-item-list__first-item': index == 1 },\n ]\"\n role=\"none\"\n >\n <menu-item\n :text=\"item.text\"\n :handler=\"item.handler\"\n :secondary-text=\"item.secondaryText\"\n :icon=\"item.icon\"\n :is-title=\"item.isTitle\"\n :disabled=\"item.disabled\"\n :critical=\"item.critical\"\n :indent=\"item.indent\"\n :tabindex=\"index === subMenuFocusedIndex ? '0' : '-1'\"\n @click=\"item.clickHandler\"\n />\n </li>\n </ul>\n </menu-list-container>\n </transition>\n</template>\n\n<script lang=\"ts\">\n import { computed, defineComponent, onMounted, PropType, ref } from 'vue';\n import ChevronLeftIcon from '@adyen/ui-assets-icons-16/vue/chevron-left';\n import { BentoMenuItem, MenuItem } from '../menu-item';\n import { BentoMenuEvent } from '../../menu.types';\n import messages from '../../messages.json';\n import MenuListContainer from '../menu-list-container/menu-list-container.vue';\n\n /**\n * SubMenuItemList component to render a submenu with the sliding transition. For internal use only.\n */\n export default defineComponent({\n i18n: { messages },\n name: 'sub-menu-item-list',\n components: { MenuItem, MenuListContainer },\n props: {\n items: {\n type: Array as PropType<BentoMenuItem[]>,\n required: true,\n },\n title: {\n type: String,\n required: true,\n },\n },\n emits: [BentoMenuEvent.CLOSE, BentoMenuEvent.BACK],\n setup(props, { emit }) {\n const subMenuItemListRefLocal = ref(null);\n const subMenuFocusedIndex = ref(0);\n const numberOfItems = ref(props.items.length);\n\n const closeMenu = () => emit(BentoMenuEvent.CLOSE);\n\n const onBackButton = () => emit(BentoMenuEvent.BACK);\n\n const computedItems = computed(() => {\n const items = props.items?.map(el => ({\n ...el,\n indent: !el.icon,\n isTitle: false,\n clickHandler: closeMenu,\n }));\n return [\n {\n text: props.title,\n secondaryText: null,\n critical: false,\n icon: ChevronLeftIcon,\n isTitle: true,\n disabled: false,\n indent: false,\n handler: onBackButton,\n clickHandler: onBackButton,\n },\n ...items,\n ];\n });\n\n const focusItem = async () => {\n subMenuItemListRefLocal.value?.children?.[subMenuFocusedIndex.value]?.children?.[0]?.focus();\n };\n\n onMounted(async () => {\n // Using setTimeout otherwise the sliding animation doesn't work anymore. The timeout imer is the same as the transition time (0.15s)\n setTimeout(() => focusItem(), 150);\n });\n\n const focusPrevious = () => {\n if (subMenuFocusedIndex.value > 0) {\n subMenuFocusedIndex.value -= 1;\n if (computedItems.value[subMenuFocusedIndex.value].disabled) {\n focusPrevious();\n }\n } else {\n subMenuFocusedIndex.value = numberOfItems.value;\n }\n focusItem();\n };\n\n const focusNext = () => {\n if (subMenuFocusedIndex.value < numberOfItems.value) {\n subMenuFocusedIndex.value += 1;\n if (computedItems.value[subMenuFocusedIndex.value].disabled) {\n focusNext();\n }\n } else {\n subMenuFocusedIndex.value = 0;\n }\n focusItem();\n };\n\n return {\n // Enums\n BentoMenuEvent,\n\n // Values\n subMenuItemListRefLocal,\n subMenuFocusedIndex,\n ChevronLeftIcon,\n computedItems,\n\n // Methods\n closeMenu,\n onBackButton,\n focusPrevious,\n focusNext,\n };\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./sub-menu-item-list.scss\" />\n","<template>\n <menu-list-container ref=\"menuItemListWrapperRef\" :style=\"{ height: computedHeight }\">\n <ul\n ref=\"menuItemListRef\"\n class=\"b-menu-item-list\"\n role=\"menu\"\n @keydown.down=\"focusNext\"\n @keydown.up=\"focusPrevious\"\n @keydown.esc=\"closeMenu\"\n @keydown.tab=\"closeMenu\"\n >\n <li\n v-for=\"(item, index) in computedData\"\n :key=\"`menu-item-${index}`\"\n class=\"b-menu-item-list__item\"\n role=\"none\"\n @keydown.right=\"focusRight(item, index)\"\n @keydown.left=\"focusLeft()\"\n >\n <menu-item\n :text=\"item.text\"\n :handler=\"!item.items?.length ? item.handler : () => null\"\n :secondary-text=\"item.secondaryText\"\n :icon=\"item.icon\"\n :chevron=\"!!item.items?.length\"\n :disabled=\"item.disabled\"\n :critical=\"item.critical\"\n :indent=\"item.indent\"\n :tabindex=\"index === subMenuFocusedIndex ? '0' : '-1'\"\n :aria-haspopup=\"!!item.items?.length\"\n :aria-expanded=\"showSubMenu && visibleSubMenuIndex === index\"\n @click=\"toggleMenu(item, index)\"\n />\n <sub-menu-item-list\n v-if=\"item.items?.length && showSubMenu && visibleSubMenuIndex === index\"\n ref=\"subMenuItemListRef\"\n :items=\"item.items\"\n :title=\"item.text\"\n @back=\"onBackButton\"\n @close=\"closeMenu\"\n />\n </li>\n </ul>\n </menu-list-container>\n</template>\n\n<script lang=\"ts\">\n import { computed, defineComponent, PropType, ref } from 'vue';\n import { BentoMenuItem, MenuItem } from '../menu-item';\n import { BentoMenuEvent } from '../../menu.types';\n import MenuListContainer from '../menu-list-container/menu-list-container.vue';\n import SubMenuItemList from '../sub-menu-item-list/sub-menu-item-list.vue';\n\n /**\n * MenuItem list to be used in the Menu component. For internal use only.\n */\n export default defineComponent({\n name: 'menu-item-list',\n components: { MenuItem, MenuListContainer, SubMenuItemList },\n props: {\n /**\n * The data to be displayed in the list\n */\n data: {\n type: Array as PropType<BentoMenuItem[]>,\n required: true,\n },\n /**\n * Displays the menu-items of the list in the indent variant. Only applies to elements that don't have an icon to their left.\n */\n indentItems: {\n type: Boolean,\n default: false,\n },\n /**\n * If set to true, focuses the last item on the list instead of the first. Used for accessibility purposes when the menu is opened with the 'up' arrow key.\n */\n focusLastElement: {\n type: Boolean,\n default: false,\n },\n },\n emits: [BentoMenuEvent.CLOSE],\n setup(props, { emit }) {\n const menuItemListRef = ref(null);\n const menuItemListWrapperRef = ref(null);\n const subMenuItemListRef = ref(null);\n const showSubMenu = ref(false);\n const visibleSubMenuIndex = ref(null);\n const focusedIndex = ref(props.focusLastElement ? props.data.length - 1 : 0);\n const subMenuFocusedIndex = ref(0);\n const numberOfItems = ref(props.data.length - 1);\n const hasMenuItemsWithIcon = computed(() => props.data.some(el => el.icon));\n\n const computedData = computed(() => {\n if (props.indentItems || hasMenuItemsWithIcon.value) {\n return props.data.map(el => {\n let indent = false;\n if (!el.icon) {\n indent = true;\n }\n return {\n ...el,\n // eslint-disable-next-line no-param-reassign\n indent,\n };\n });\n }\n return props.data;\n });\n\n const focusItem = () => menuItemListRef.value?.children[focusedIndex.value]?.children[0]?.focus();\n\n const closeMenu = () => emit(BentoMenuEvent.CLOSE);\n\n const toggleMenu = async (item: BentoMenuItem, index: number) => {\n if (item.items) {\n visibleSubMenuIndex.value = index;\n showSubMenu.value = true;\n } else {\n visibleSubMenuIndex.value = index;\n showSubMenu.value = false;\n closeMenu();\n }\n };\n\n const focusPrevious = () => {\n if (focusedIndex.value > 0) {\n focusedIndex.value -= 1;\n if (computedData.value[focusedIndex.value].disabled) {\n focusPrevious();\n }\n } else {\n focusedIndex.value = numberOfItems.value;\n }\n focusItem();\n };\n\n const focusNext = () => {\n if (focusedIndex.value < numberOfItems.value) {\n focusedIndex.value += 1;\n if (computedData.value[focusedIndex.value].disabled) {\n focusNext();\n }\n } else {\n focusedIndex.value = 0;\n }\n focusItem();\n };\n\n const focusRight = (item, index) => {\n if (item?.items?.length) {\n visibleSubMenuIndex.value = index;\n showSubMenu.value = true;\n }\n };\n\n const focusLeft = () => {\n if (visibleSubMenuIndex.value && showSubMenu.value) {\n visibleSubMenuIndex.value = null;\n showSubMenu.value = false;\n }\n };\n\n const onBackButton = () => {\n showSubMenu.value = false;\n visibleSubMenuIndex.value = null;\n // Focus the right element\n focusItem();\n };\n\n const menuHeight = computed(() => menuItemListWrapperRef?.value?.offsetHeight);\n\n const subMenuHeight = computed(() => subMenuItemListRef?.value?.[0]?.$el?.offsetHeight);\n\n const computedHeight = computed(() => {\n if (showSubMenu.value) {\n return `${subMenuHeight.value}px`;\n }\n return `${menuHeight.value}px`;\n });\n\n return {\n // Values\n menuItemListRef,\n menuItemListWrapperRef,\n subMenuItemListRef,\n\n computedData,\n computedHeight,\n\n focusedIndex,\n subMenuFocusedIndex,\n\n showSubMenu,\n visibleSubMenuIndex,\n\n // Methods\n toggleMenu,\n closeMenu,\n focusPrevious,\n focusNext,\n focusRight,\n focusLeft,\n onBackButton,\n };\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./menu-item-list.scss\" />\n","export const MENU_INVERSE_INJECTION_KEY = Symbol('menu inverse style injection key');\n","<template>\n <div\n v-bento-click-outside-directive=\"closeMenu\"\n :class=\"computedClasses\"\n class=\"b-menu\"\n @keydown.down=\"onKeyDown\"\n @keydown.up=\"onKeyUp\"\n @keydown.esc=\"closeMenu\"\n >\n <bento-button\n ref=\"menuButtonRef\"\n aria-haspopup=\"true\"\n v-bind=\"button\"\n :aria-expanded=\"`${showMenu}`\"\n :aria-controls=\"showMenu ? menuId : null\"\n :inverse=\"isInverseColorSet\"\n @click=\"toggleShowMenu\"\n >\n <template #iconLeft>\n <slot>\n <options-vertical-icon :title=\"$t('menuButton')\" />\n </slot>\n </template>\n </bento-button>\n <bento-popover\n v-if=\"menuButtonRef\"\n :id=\"menuId\"\n :open=\"showMenu\"\n class=\"b-menu__popover\"\n :style=\"computedMenuWidth\"\n :target-element=\"menuButtonRef\"\n :position=\"menuPosition\"\n :fixed-positioning=\"menuFixedPositioning\"\n :fallback-position=\"[\n 'bottom-start',\n 'bottom-end',\n 'top-start',\n 'top-end',\n 'right-start',\n 'right-end',\n 'left-start',\n 'left-end',\n ]\"\n without-space\n >\n <menu-item-list :data=\"data\" :focus-last-element=\"isLastElementFocused\" @close=\"closeMenu\" />\n </bento-popover>\n </div>\n</template>\n\n<script lang=\"ts\">\n import { computed, defineComponent, inject, PropType, ref } from 'vue';\n import OptionsVerticalIcon from '@adyen/ui-assets-icons-16/vue/options-vertical';\n import { generateUid } from '@/utils/ts/unique-id';\n import { BentoClickOutsideDirective } from '@/directives';\n import { BentoButton } from '@/components/button';\n import { BentoPopover, BentoPopoverPositions } from '@/components/popover';\n import { BentoMenuItem, MenuItemList } from './components';\n import { BentoMenuButtonProps, BentoMenuEvent } from './menu.types';\n import { MENU_INVERSE_INJECTION_KEY } from './menu.keys';\n import messages from './messages.json';\n\n /**\n * Menu component to render a series of buttons. Csan render nested submenus.\n *\n * @example\n * import { BentoMenu } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoMenu },\n * template: `\n * <bento-menu\n * :data=[\n * { text: 'Menu item text', handler: () => { some code here } },\n * { text: 'Another menu item text', handler: () => { some other code here }, critical: true }\n * ]\n * />\n * }\n */\n export default defineComponent({\n i18n: { messages },\n name: 'bento-menu',\n components: { BentoButton, BentoPopover, MenuItemList, OptionsVerticalIcon },\n directives: { BentoClickOutsideDirective },\n props: {\n /**\n * Object containing props to change the menu button appearance. Accepts the same props present in BentoButton.\n */\n button: {\n type: Object as PropType<BentoMenuButtonProps>,\n default: () =>\n ({\n variant: 'secondary',\n } as BentoMenuButtonProps),\n },\n /**\n * The data to be displayed in the list\n */\n data: {\n type: Array as PropType<BentoMenuItem[]>,\n required: true,\n },\n\n /**\n * The position of where the menu should open.\n */\n menuPosition: {\n type: String as PropType<BentoPopoverPositions | `${BentoPopoverPositions}`>,\n default: BentoPopoverPositions.BOTTOM_START,\n validator: (value: BentoPopoverPositions) => Object.values(BentoPopoverPositions).includes(value),\n },\n\n /**\n * Instructs the menu popover to be visible outside of the containing container.\n * @see {@link https://floating-ui.com/docs/usefloating#strategy}\n */\n menuFixedPositioning: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Sets a custom width for the menu popover.\n */\n menuWidth: {\n type: Number,\n default: null,\n },\n },\n emits: [BentoMenuEvent.CLOSE, BentoMenuEvent.OPEN],\n setup(props, { emit }) {\n const menuButtonRef = ref(null);\n const showMenu = ref(false);\n const isLastElementFocused = ref(false);\n const menuId = generateUid('menu');\n const popoverId = generateUid('menu-popover');\n\n const isInverseColorSet = inject(MENU_INVERSE_INJECTION_KEY, ref(false));\n\n const computedClasses = computed(() => ({\n 'b-menu--inverse': isInverseColorSet.value,\n }));\n\n const computedMenuWidth = computed(() => (props.menuWidth ? { width: `${props.menuWidth}px` } : null));\n\n const openMenu = () => {\n showMenu.value = true;\n emit(BentoMenuEvent.OPEN);\n };\n\n const closeMenu = () => {\n if (showMenu.value) {\n showMenu.value = false;\n menuButtonRef.value.$el.focus();\n emit(BentoMenuEvent.CLOSE);\n }\n };\n\n const toggleShowMenu = (e: MouseEvent) => {\n e.stopPropagation();\n if (!showMenu.value) {\n openMenu();\n } else {\n closeMenu();\n }\n };\n\n const onKeyDown = () => {\n isLastElementFocused.value = false;\n openMenu();\n };\n\n const onKeyUp = () => {\n isLastElementFocused.value = true;\n openMenu();\n };\n\n return {\n // Values\n menuButtonRef,\n menuId,\n popoverId,\n showMenu,\n computedMenuWidth,\n isLastElementFocused,\n\n // Classes\n computedClasses,\n isInverseColorSet,\n\n // Methods\n onKeyDown,\n onKeyUp,\n closeMenu,\n toggleShowMenu,\n };\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./menu.scss\" />\n"],"names":["uuid","_sfc_main$5","_sfc_main$4","defineComponent","BaseButton","BentoTypography","ChevronRightIcon","BentoBaseButtonEvent","props","emit","computed","e","BentoMenuEvent","BentoMenuEvent2","_sfc_main$3","_sfc_main$2","messages","MenuItem","MenuListContainer","subMenuItemListRefLocal","ref","subMenuFocusedIndex","numberOfItems","closeMenu","onBackButton","computedItems","items","_a","el","ChevronLeftIcon","focusItem","_e","_d","_c","_b","onMounted","focusPrevious","focusNext","_sfc_main$1","SubMenuItemList","menuItemListRef","menuItemListWrapperRef","subMenuItemListRef","showSubMenu","visibleSubMenuIndex","focusedIndex","hasMenuItemsWithIcon","computedData","indent","toggleMenu","item","index","focusRight","focusLeft","menuHeight","subMenuHeight","computedHeight","MENU_INVERSE_INJECTION_KEY","_sfc_main","BentoButton","BentoPopover","MenuItemList","OptionsVerticalIcon","BentoClickOutsideDirective","BentoPopoverPositions","value","menuButtonRef","showMenu","isLastElementFocused","menuId","generateUid","popoverId","isInverseColorSet","inject","computedClasses","computedMenuWidth","openMenu"],"mappings":";;;;;;;;;;AAKA,IAAAA,IAAA;AAEA,MAAAC,IAAA;AAAA,EACA,eAAA;AACA,SAAA,OAAAD,EAAA,SAAA,GACAA,KAAA;AAAA,EACA;AACA;;;;;;;;;;;;;;qBCsBAE,IAAAC,EAAA;AAAA,EAAA,MAAA;AAAA,EACA,YAAA,EAAA,YAAAC,GAAA,iBAAAC,GAAA,kBAAAC,EAAA;AAAA,EACA,OAAA;AAAA;AAAA;AAAA;AAAA,IACA,MAAA;AAAA,MAIA,MAAA;AAAA,MACA,UAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IACA,SAAA;AAAA,MAIA,MAAA;AAAA,MACA,UAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IACA,eAAA;AAAA,MAIA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IACA,SAAA;AAAA,MAIA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IACA,MAAA;AAAA;AAAA;AAAA,MAIA,MAAA,CAAA,QAAA,QAAA;AAAA,MAGA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IACA,UAAA;AAAA,MAIA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IACA,QAAA;AAAA,MAIA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IACA,UAAA;AAAA,MAIA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IACA,SA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-icons-16/dist/vue/options-vertical.vue","../../src/components/menu/components/menu-item/menu-item.vue","../../src/components/menu/menu.types.ts","../../src/components/menu/components/menu-list-container/menu-list-container.vue","../../src/components/menu/components/sub-menu-item-list/sub-menu-item-list.vue","../../src/components/menu/components/menu-item-list/menu-item-list.vue","../../src/components/menu/menu.keys.ts","../../src/components/menu/menu.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=\"M8 4C8.29667 4 8.58668 3.91203 8.83335 3.74721C9.08003 3.58238 9.27229 3.34811 9.38582 3.07403C9.49935 2.79994 9.52906 2.49834 9.47118 2.20737C9.4133 1.91639 9.27044 1.64912 9.06066 1.43934C8.85088 1.22956 8.58361 1.0867 8.29264 1.02882C8.00166 0.970945 7.70006 1.00065 7.42597 1.11418C7.15189 1.22771 6.91762 1.41997 6.7528 1.66665C6.58797 1.91332 6.5 2.20333 6.5 2.5C6.5 2.89783 6.65804 3.27936 6.93934 3.56066C7.22064 3.84197 7.60218 4 8 4Z\" clip-rule=\"evenodd\"/><path fill=\"#00112C\" fill-rule=\"evenodd\" d=\"M8 15C8.29667 15 8.58668 14.912 8.83335 14.7472C9.08003 14.5824 9.27229 14.3481 9.38582 14.074C9.49935 13.7999 9.52906 13.4983 9.47118 13.2074C9.4133 12.9164 9.27044 12.6491 9.06066 12.4393C8.85088 12.2296 8.58361 12.0867 8.29264 12.0288C8.00166 11.9709 7.70006 12.0007 7.42597 12.1142C7.15189 12.2277 6.91762 12.42 6.7528 12.6666C6.58797 12.9133 6.5 13.2033 6.5 13.5C6.5 13.8978 6.65804 14.2794 6.93934 14.5607C7.22064 14.842 7.60218 15 8 15Z\" clip-rule=\"evenodd\"/><path fill=\"#00112C\" fill-rule=\"evenodd\" d=\"M8.83335 9.24721C8.58668 9.41203 8.29667 9.5 8 9.5C7.60218 9.5 7.22064 9.34197 6.93934 9.06066C6.65804 8.77936 6.5 8.39783 6.5 8C6.5 7.70333 6.58797 7.41332 6.7528 7.16665C6.91762 6.91997 7.15189 6.72771 7.42597 6.61418C7.70006 6.50065 8.00166 6.47094 8.29264 6.52882C8.58361 6.5867 8.85088 6.72956 9.06066 6.93934C9.27044 7.14912 9.4133 7.41639 9.47118 7.70737C9.52906 7.99834 9.49935 8.29994 9.38582 8.57403C9.27229 8.84811 9.08003 9.08238 8.83335 9.24721Z\" 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 <base-button\n class=\"b-menu-item\"\n role=\"menuitem\"\n :class=\"conditionalClasses\"\n :disabled=\"disabled\"\n tabindex=\"-1\"\n @click=\"onClick\"\n >\n <template v-if=\"icon\" #iconLeft>\n <component :is=\"icon\" class=\"b-menu-item__icon-left\" aria-hidden=\"true\" />\n </template>\n <template #default>\n <bento-typography el=\"span\" variant=\"body\" :stronger=\"isTitle\" class=\"b-menu-item__primary-text\">\n {{ text }}\n </bento-typography>\n <bento-typography v-if=\"secondaryText\" el=\"span\" variant=\"body\" class=\"b-menu-item__secondary-text\">\n {{ secondaryText }}\n </bento-typography>\n </template>\n <template v-if=\"chevron\" #iconRight><chevron-right-icon aria-hidden=\"true\" /></template>\n </base-button>\n</template>\n\n<script lang=\"ts\">\n import { computed, defineComponent, PropType } from 'vue';\n import ChevronRightIcon from '@adyen/ui-assets-icons-16/vue/chevron-right';\n import { BaseButton, BentoBaseButtonEvent } from '@/components/internal/base-button';\n import { BentoTypography } from '@/components/typography';\n import { BentoMenuItem } from './menu-item.types';\n\n /**\n * Menu item component to render items in a menu. For internal use only.\n */\n export default defineComponent({\n name: 'menu-item',\n components: { BaseButton, BentoTypography, ChevronRightIcon },\n props: {\n /**\n * menu-item text that gets displayed as the main label\n */\n text: {\n type: String,\n required: true,\n },\n /**\n * menu-item action that gets executed when the MeniItem is clicked\n */\n handler: {\n type: Function as PropType<BentoMenuItem['handler']>,\n required: true,\n },\n /**\n * menu-item text that gets displayed as the secondary label\n */\n secondaryText: {\n type: String,\n default: null,\n },\n /**\n * Optional chevron icon displayed to the right of the menu-item\n */\n chevron: {\n type: Boolean,\n default: false,\n },\n /**\n * Optional icon displayed to the left of the menu-item\n */\n icon: {\n // Types for Vue2 (Object) and Vue3 (Function)\n // TODO: Remove Object when fully migrated to Vue3\n type: [Object, Function] as PropType<BentoMenuItem['icon']>,\n default: null,\n },\n /**\n * Disables menu-item button functionality\n */\n disabled: {\n type: Boolean,\n default: false,\n },\n /**\n * Displays an indent variant od the menu-item\n */\n indent: {\n type: Boolean,\n default: false,\n },\n /**\n * Displays menu-item button as critical\n */\n critical: {\n type: Boolean,\n default: false,\n },\n /**\n * Renders the text in a bold variant\n */\n isTitle: {\n type: Boolean,\n default: false,\n },\n },\n emits: [BentoBaseButtonEvent.CLICK],\n setup(props, { emit }) {\n const conditionalClasses = computed(() => ({\n 'b-menu-item--critical': props.critical,\n 'b-menu-item--indent': props.indent,\n }));\n\n const onClick = (e: MouseEvent) => {\n e.stopPropagation();\n props.handler();\n emit(BentoBaseButtonEvent.CLICK);\n };\n\n return {\n // Values\n conditionalClasses,\n\n // Methods\n onClick,\n };\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./menu-item.scss\" />\n","import { BentoButton } from '../button';\n\nexport enum BentoMenuEvent {\n BACK = 'back',\n CLOSE = 'close',\n OPEN = 'open',\n}\n\ntype ButtonProps = InstanceType<typeof BentoButton>['$props'];\n\nexport type BentoMenuButtonProps = {\n variant?: ButtonProps['variant'];\n condensed?: ButtonProps['condensed'];\n disabled?: ButtonProps['disabled'];\n};\n","<template>\n <div class=\"b-menu-list-container\"><slot></slot></div>\n</template>\n\n<script lang=\"ts\">\n import { defineComponent } from 'vue';\n\n /**\n * Menu list container component to set the correct styling in a menu list. For internal use only.\n */\n export default defineComponent({\n name: 'bento-menu-list-container',\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./menu-list-container.scss\" />\n","<template>\n <transition name=\"b-sub-menu-item-list__transition\" appear>\n <menu-list-container class=\"b-sub-menu-item-list\">\n <ul\n ref=\"subMenuItemListRefLocal\"\n role=\"menu\"\n class=\"b-sub-menu-item-list__list\"\n @keydown.down.stop=\"focusNext\"\n @keydown.up.stop=\"focusPrevious\"\n @keydown.esc.stop=\"onBackButton\"\n >\n <li\n v-for=\"(item, index) in computedItems\"\n :key=\"`sub-menu-item-list-item-${index}`\"\n :class=\"[\n { 'b-sub-menu-item-list__back-button': index === 0 },\n { 'b-sub-menu-item-list__first-item': index == 1 },\n ]\"\n role=\"none\"\n >\n <menu-item\n :text=\"item.text\"\n :handler=\"item.handler\"\n :secondary-text=\"item.secondaryText\"\n :icon=\"item.icon\"\n :is-title=\"item.isTitle\"\n :disabled=\"item.disabled\"\n :critical=\"item.critical\"\n :indent=\"item.indent\"\n :tabindex=\"index === subMenuFocusedIndex ? '0' : '-1'\"\n @click=\"item.clickHandler\"\n />\n </li>\n </ul>\n </menu-list-container>\n </transition>\n</template>\n\n<script lang=\"ts\">\n import { computed, defineComponent, onMounted, PropType, ref } from 'vue';\n import ChevronLeftIcon from '@adyen/ui-assets-icons-16/vue/chevron-left';\n import { BentoMenuItem, MenuItem } from '../menu-item';\n import { BentoMenuEvent } from '../../menu.types';\n import messages from '../../messages.json';\n import MenuListContainer from '../menu-list-container/menu-list-container.vue';\n\n /**\n * SubMenuItemList component to render a submenu with the sliding transition. For internal use only.\n */\n export default defineComponent({\n i18n: { messages },\n name: 'sub-menu-item-list',\n components: { MenuItem, MenuListContainer },\n props: {\n items: {\n type: Array as PropType<BentoMenuItem[]>,\n required: true,\n },\n title: {\n type: String,\n required: true,\n },\n },\n emits: [BentoMenuEvent.CLOSE, BentoMenuEvent.BACK],\n setup(props, { emit }) {\n const subMenuItemListRefLocal = ref(null);\n const subMenuFocusedIndex = ref(0);\n const numberOfItems = ref(props.items.length);\n\n const closeMenu = () => emit(BentoMenuEvent.CLOSE);\n\n const onBackButton = () => emit(BentoMenuEvent.BACK);\n\n const computedItems = computed(() => {\n const items = props.items?.map(el => ({\n ...el,\n indent: !el.icon,\n isTitle: false,\n clickHandler: closeMenu,\n }));\n return [\n {\n text: props.title,\n secondaryText: null,\n critical: false,\n icon: ChevronLeftIcon,\n isTitle: true,\n disabled: false,\n indent: false,\n handler: onBackButton,\n clickHandler: onBackButton,\n },\n ...items,\n ];\n });\n\n const focusItem = async () => {\n subMenuItemListRefLocal.value?.children?.[subMenuFocusedIndex.value]?.children?.[0]?.focus();\n };\n\n onMounted(async () => {\n // Using setTimeout otherwise the sliding animation doesn't work anymore. The timeout imer is the same as the transition time (0.15s)\n setTimeout(() => focusItem(), 150);\n });\n\n const focusPrevious = () => {\n if (subMenuFocusedIndex.value > 0) {\n subMenuFocusedIndex.value -= 1;\n if (computedItems.value[subMenuFocusedIndex.value].disabled) {\n focusPrevious();\n }\n } else {\n subMenuFocusedIndex.value = numberOfItems.value;\n }\n focusItem();\n };\n\n const focusNext = () => {\n if (subMenuFocusedIndex.value < numberOfItems.value) {\n subMenuFocusedIndex.value += 1;\n if (computedItems.value[subMenuFocusedIndex.value].disabled) {\n focusNext();\n }\n } else {\n subMenuFocusedIndex.value = 0;\n }\n focusItem();\n };\n\n return {\n // Enums\n BentoMenuEvent,\n\n // Values\n subMenuItemListRefLocal,\n subMenuFocusedIndex,\n ChevronLeftIcon,\n computedItems,\n\n // Methods\n closeMenu,\n onBackButton,\n focusPrevious,\n focusNext,\n };\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./sub-menu-item-list.scss\" />\n","<template>\n <menu-list-container ref=\"menuItemListWrapperRef\" :style=\"{ height: computedHeight }\">\n <ul\n ref=\"menuItemListRef\"\n class=\"b-menu-item-list\"\n role=\"menu\"\n @keydown.down=\"focusNext\"\n @keydown.up=\"focusPrevious\"\n @keydown.esc=\"closeMenu\"\n @keydown.tab=\"closeMenu\"\n >\n <li\n v-for=\"(item, index) in computedData\"\n :key=\"`menu-item-${index}`\"\n class=\"b-menu-item-list__item\"\n role=\"none\"\n @keydown.right=\"focusRight(item, index)\"\n @keydown.left=\"focusLeft()\"\n >\n <menu-item\n :text=\"item.text\"\n :handler=\"!item.items?.length ? item.handler : () => null\"\n :secondary-text=\"item.secondaryText\"\n :icon=\"item.icon\"\n :chevron=\"!!item.items?.length\"\n :disabled=\"item.disabled\"\n :critical=\"item.critical\"\n :indent=\"item.indent\"\n :tabindex=\"index === subMenuFocusedIndex ? '0' : '-1'\"\n :aria-haspopup=\"!!item.items?.length\"\n :aria-expanded=\"showSubMenu && visibleSubMenuIndex === index\"\n @click=\"toggleMenu(item, index)\"\n />\n <sub-menu-item-list\n v-if=\"item.items?.length && showSubMenu && visibleSubMenuIndex === index\"\n ref=\"subMenuItemListRef\"\n :items=\"item.items\"\n :title=\"item.text\"\n @back=\"onBackButton\"\n @close=\"closeMenu\"\n />\n </li>\n </ul>\n </menu-list-container>\n</template>\n\n<script lang=\"ts\">\n import { computed, defineComponent, PropType, ref } from 'vue';\n import { BentoMenuItem, MenuItem } from '../menu-item';\n import { BentoMenuEvent } from '../../menu.types';\n import MenuListContainer from '../menu-list-container/menu-list-container.vue';\n import SubMenuItemList from '../sub-menu-item-list/sub-menu-item-list.vue';\n\n /**\n * MenuItem list to be used in the Menu component. For internal use only.\n */\n export default defineComponent({\n name: 'menu-item-list',\n components: { MenuItem, MenuListContainer, SubMenuItemList },\n props: {\n /**\n * The data to be displayed in the list\n */\n data: {\n type: Array as PropType<BentoMenuItem[]>,\n required: true,\n },\n /**\n * Displays the menu-items of the list in the indent variant. Only applies to elements that don't have an icon to their left.\n */\n indentItems: {\n type: Boolean,\n default: false,\n },\n /**\n * If set to true, focuses the last item on the list instead of the first. Used for accessibility purposes when the menu is opened with the 'up' arrow key.\n */\n focusLastElement: {\n type: Boolean,\n default: false,\n },\n },\n emits: [BentoMenuEvent.CLOSE],\n setup(props, { emit }) {\n const menuItemListRef = ref(null);\n const menuItemListWrapperRef = ref(null);\n const subMenuItemListRef = ref(null);\n const showSubMenu = ref(false);\n const visibleSubMenuIndex = ref(null);\n const focusedIndex = ref(props.focusLastElement ? props.data.length - 1 : 0);\n const subMenuFocusedIndex = ref(0);\n const numberOfItems = ref(props.data.length - 1);\n const hasMenuItemsWithIcon = computed(() => props.data.some(el => el.icon));\n\n const computedData = computed(() => {\n if (props.indentItems || hasMenuItemsWithIcon.value) {\n return props.data.map(el => {\n let indent = false;\n if (!el.icon) {\n indent = true;\n }\n return {\n ...el,\n // eslint-disable-next-line no-param-reassign\n indent,\n };\n });\n }\n return props.data;\n });\n\n const focusItem = () => menuItemListRef.value?.children[focusedIndex.value]?.children[0]?.focus();\n\n const closeMenu = () => emit(BentoMenuEvent.CLOSE);\n\n const toggleMenu = async (item: BentoMenuItem, index: number) => {\n if (item.items) {\n visibleSubMenuIndex.value = index;\n showSubMenu.value = true;\n } else {\n visibleSubMenuIndex.value = index;\n showSubMenu.value = false;\n closeMenu();\n }\n };\n\n const focusPrevious = () => {\n if (focusedIndex.value > 0) {\n focusedIndex.value -= 1;\n if (computedData.value[focusedIndex.value].disabled) {\n focusPrevious();\n }\n } else {\n focusedIndex.value = numberOfItems.value;\n }\n focusItem();\n };\n\n const focusNext = () => {\n if (focusedIndex.value < numberOfItems.value) {\n focusedIndex.value += 1;\n if (computedData.value[focusedIndex.value].disabled) {\n focusNext();\n }\n } else {\n focusedIndex.value = 0;\n }\n focusItem();\n };\n\n const focusRight = (item, index) => {\n if (item?.items?.length) {\n visibleSubMenuIndex.value = index;\n showSubMenu.value = true;\n }\n };\n\n const focusLeft = () => {\n if (visibleSubMenuIndex.value && showSubMenu.value) {\n visibleSubMenuIndex.value = null;\n showSubMenu.value = false;\n }\n };\n\n const onBackButton = () => {\n showSubMenu.value = false;\n visibleSubMenuIndex.value = null;\n // Focus the right element\n focusItem();\n };\n\n const menuHeight = computed(() => menuItemListWrapperRef?.value?.offsetHeight);\n\n const subMenuHeight = computed(() => subMenuItemListRef?.value?.[0]?.$el?.offsetHeight);\n\n const computedHeight = computed(() => {\n if (showSubMenu.value) {\n return `${subMenuHeight.value}px`;\n }\n return `${menuHeight.value}px`;\n });\n\n return {\n // Values\n menuItemListRef,\n menuItemListWrapperRef,\n subMenuItemListRef,\n\n computedData,\n computedHeight,\n\n focusedIndex,\n subMenuFocusedIndex,\n\n showSubMenu,\n visibleSubMenuIndex,\n\n // Methods\n toggleMenu,\n closeMenu,\n focusPrevious,\n focusNext,\n focusRight,\n focusLeft,\n onBackButton,\n };\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./menu-item-list.scss\" />\n","export const MENU_INVERSE_INJECTION_KEY = Symbol('menu inverse style injection key');\n","<template>\n <div\n v-bento-click-outside-directive=\"closeMenu\"\n :class=\"computedClasses\"\n class=\"b-menu\"\n @keydown.down=\"onKeyDown\"\n @keydown.up=\"onKeyUp\"\n @keydown.esc=\"closeMenu\"\n >\n <bento-button\n ref=\"menuButtonRef\"\n aria-haspopup=\"true\"\n v-bind=\"button\"\n :aria-expanded=\"`${showMenu}`\"\n :aria-controls=\"showMenu ? menuId : null\"\n :inverse=\"isInverseColorSet\"\n @click=\"toggleShowMenu\"\n >\n <template #iconLeft>\n <slot>\n <options-vertical-icon :title=\"$t('menuButton')\" />\n </slot>\n </template>\n </bento-button>\n <bento-popover\n v-if=\"menuButtonRef\"\n :id=\"menuId\"\n :open=\"showMenu\"\n class=\"b-menu__popover\"\n :style=\"computedMenuWidth\"\n :target-element=\"menuButtonRef\"\n :position=\"menuPosition\"\n :fixed-positioning=\"menuFixedPositioning\"\n :fallback-position=\"[\n 'bottom-start',\n 'bottom-end',\n 'top-start',\n 'top-end',\n 'right-start',\n 'right-end',\n 'left-start',\n 'left-end',\n ]\"\n without-space\n >\n <menu-item-list :data=\"data\" :focus-last-element=\"isLastElementFocused\" @close=\"closeMenu\" />\n </bento-popover>\n </div>\n</template>\n\n<script lang=\"ts\">\n import { computed, defineComponent, inject, PropType, ref } from 'vue';\n import OptionsVerticalIcon from '@adyen/ui-assets-icons-16/vue/options-vertical';\n import { generateUid } from '@/utils/ts/unique-id';\n import { BentoClickOutsideDirective } from '@/directives';\n import { BentoButton } from '@/components/button';\n import { BentoPopover, BentoPopoverPositions } from '@/components/popover';\n import { BentoMenuItem, MenuItemList } from './components';\n import { BentoMenuButtonProps, BentoMenuEvent } from './menu.types';\n import { MENU_INVERSE_INJECTION_KEY } from './menu.keys';\n import messages from './messages.json';\n\n /**\n * Menu component to render a series of buttons. Csan render nested submenus.\n *\n * @example\n * import { BentoMenu } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoMenu },\n * template: `\n * <bento-menu\n * :data=[\n * { text: 'Menu item text', handler: () => { some code here } },\n * { text: 'Another menu item text', handler: () => { some other code here }, critical: true }\n * ]\n * />\n * }\n */\n export default defineComponent({\n i18n: { messages },\n name: 'bento-menu',\n components: { BentoButton, BentoPopover, MenuItemList, OptionsVerticalIcon },\n directives: { BentoClickOutsideDirective },\n props: {\n /**\n * Object containing props to change the menu button appearance. Accepts the same props present in BentoButton.\n */\n button: {\n type: Object as PropType<BentoMenuButtonProps>,\n default: () =>\n ({\n variant: 'secondary',\n } as BentoMenuButtonProps),\n },\n /**\n * The data to be displayed in the list\n */\n data: {\n type: Array as PropType<BentoMenuItem[]>,\n required: true,\n },\n\n /**\n * The position of where the menu should open.\n */\n menuPosition: {\n type: String as PropType<BentoPopoverPositions | `${BentoPopoverPositions}`>,\n default: BentoPopoverPositions.BOTTOM_START,\n validator: (value: BentoPopoverPositions) => Object.values(BentoPopoverPositions).includes(value),\n },\n\n /**\n * Instructs the menu popover to be visible outside of the containing container.\n * @see {@link https://floating-ui.com/docs/usefloating#strategy}\n */\n menuFixedPositioning: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Sets a custom width for the menu popover.\n */\n menuWidth: {\n type: Number,\n default: null,\n },\n },\n emits: [BentoMenuEvent.CLOSE, BentoMenuEvent.OPEN],\n setup(props, { emit }) {\n const menuButtonRef = ref(null);\n const showMenu = ref(false);\n const isLastElementFocused = ref(false);\n const menuId = generateUid('menu');\n const popoverId = generateUid('menu-popover');\n\n const isInverseColorSet = inject(MENU_INVERSE_INJECTION_KEY, ref(false));\n\n const computedClasses = computed(() => ({\n 'b-menu--inverse': isInverseColorSet.value,\n }));\n\n const computedMenuWidth = computed(() => (props.menuWidth ? { width: `${props.menuWidth}px` } : null));\n\n const openMenu = () => {\n showMenu.value = true;\n emit(BentoMenuEvent.OPEN);\n };\n\n const closeMenu = () => {\n if (showMenu.value) {\n showMenu.value = false;\n menuButtonRef.value.$el.focus();\n emit(BentoMenuEvent.CLOSE);\n }\n };\n\n const toggleShowMenu = (e: MouseEvent) => {\n e.stopPropagation();\n if (!showMenu.value) {\n openMenu();\n } else {\n closeMenu();\n }\n };\n\n const onKeyDown = () => {\n isLastElementFocused.value = false;\n openMenu();\n };\n\n const onKeyUp = () => {\n isLastElementFocused.value = true;\n openMenu();\n };\n\n return {\n // Values\n menuButtonRef,\n menuId,\n popoverId,\n showMenu,\n computedMenuWidth,\n isLastElementFocused,\n\n // Classes\n computedClasses,\n isInverseColorSet,\n\n // Methods\n onKeyDown,\n onKeyUp,\n closeMenu,\n toggleShowMenu,\n };\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./menu.scss\" />\n"],"names":["uuid","_sfc_main$5","_sfc_main$4","defineComponent","BaseButton","BentoTypography","ChevronRightIcon","BentoBaseButtonEvent","props","emit","computed","e","BentoMenuEvent","BentoMenuEvent2","_sfc_main$3","_sfc_main$2","messages","MenuItem","MenuListContainer","subMenuItemListRefLocal","ref","subMenuFocusedIndex","numberOfItems","closeMenu","onBackButton","computedItems","items","_a","el","ChevronLeftIcon","focusItem","_e","_d","_c","_b","onMounted","focusPrevious","focusNext","_sfc_main$1","SubMenuItemList","menuItemListRef","menuItemListWrapperRef","subMenuItemListRef","showSubMenu","visibleSubMenuIndex","focusedIndex","hasMenuItemsWithIcon","computedData","indent","toggleMenu","item","index","focusRight","focusLeft","menuHeight","subMenuHeight","computedHeight","MENU_INVERSE_INJECTION_KEY","_sfc_main","BentoButton","BentoPopover","MenuItemList","OptionsVerticalIcon","BentoClickOutsideDirective","BentoPopoverPositions","value","menuButtonRef","showMenu","isLastElementFocused","menuId","generateUid","popoverId","isInverseColorSet","inject","computedClasses","computedMenuWidth","openMenu"],"mappings":";;;;;;;;;;AAKA,IAAAA,IAAA;AAEA,MAAAC,IAAA;AAAA,EACA,eAAA;AACA,SAAA,OAAAD,EAAA,SAAA,GACAA,KAAA;AAAA,EACA;AACA;;;;;;;;;;;;;;qBCsBAE,IAAAC,EAAA;AAAA,EAAA,MAAA;AAAA,EACA,YAAA,EAAA,YAAAC,GAAA,iBAAAC,GAAA,kBAAAC,EAAA;AAAA,EACA,OAAA;AAAA;AAAA;AAAA;AAAA,IACA,MAAA;AAAA,MAIA,MAAA;AAAA,MACA,UAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IACA,SAAA;AAAA,MAIA,MAAA;AAAA,MACA,UAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IACA,eAAA;AAAA,MAIA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IACA,SAAA;AAAA,MAIA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IACA,MAAA;AAAA;AAAA;AAAA,MAIA,MAAA,CAAA,QAAA,QAAA;AAAA,MAGA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IACA,UAAA;AAAA,MAIA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IACA,QAAA;AAAA,MAIA,MAAA;AAAA,MACA,S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CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","x_google_ignoreList":[0]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent as N, computed as R } from "vue";
|
|
2
2
|
import { r as c, t as h, e as p, g as A, d as q, f as X } from "./index.f55fdc32.js";
|
|
3
|
-
import { B as G } from "./index.
|
|
3
|
+
import { B as G } from "./index.4de86bd4.js";
|
|
4
4
|
import { u as F } from "./i18n.155748d6.js";
|
|
5
5
|
import { n as Q } from "./_plugin-vue2_normalizer.71e2aa87.js";
|
|
6
6
|
function $(t) {
|
|
@@ -923,4 +923,4 @@ export {
|
|
|
923
923
|
ye as f,
|
|
924
924
|
d as t
|
|
925
925
|
};
|
|
926
|
-
//# sourceMappingURL=index.
|
|
926
|
+
//# sourceMappingURL=index.c2dde601.js.map
|