@adyen/bento-vue3 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/index46.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 +2 -2
- package/dist/checkbox.js +6 -6
- package/dist/chunks/{base-button.7897a95e.js → base-button.833c2c5d.js} +2 -2
- package/dist/chunks/{base-button.7897a95e.js.map → base-button.833c2c5d.js.map} +1 -1
- package/dist/chunks/{base-modal.0c85e7cb.js → base-modal.a113c504.js} +4 -4
- package/dist/chunks/{base-modal.0c85e7cb.js.map → base-modal.a113c504.js.map} +1 -1
- package/dist/chunks/{button-actions-with-menu.fa35390c.js → button-actions-with-menu.e89f1375.js} +2 -2
- package/dist/chunks/{button-actions-with-menu.fa35390c.js.map → button-actions-with-menu.e89f1375.js.map} +1 -1
- package/dist/chunks/{button.e5177388.js → button.c77b7a17.js} +2 -2
- package/dist/chunks/{button.e5177388.js.map → button.c77b7a17.js.map} +1 -1
- package/dist/chunks/{calendar.c83d4e99.js → calendar.c87d4445.js} +4 -4
- package/dist/chunks/{calendar.c83d4e99.js.map → calendar.c87d4445.js.map} +1 -1
- package/dist/chunks/{checkbox.3cdbdd52.js → checkbox.5d2e26b9.js} +3 -3
- package/dist/chunks/{checkbox.3cdbdd52.js.map → checkbox.5d2e26b9.js.map} +1 -1
- package/dist/chunks/{controls-group.38b436f6.js → controls-group.e9341830.js} +2 -2
- package/dist/chunks/{controls-group.38b436f6.js.map → controls-group.e9341830.js.map} +1 -1
- package/dist/chunks/{copy.86236c8d.js → copy.9ad2bf43.js} +4 -4
- package/dist/chunks/{copy.86236c8d.js.map → copy.9ad2bf43.js.map} +1 -1
- package/dist/chunks/{dropdown-default-textbox.0b38fac3.js → dropdown-default-textbox.6eb46615.js} +2 -2
- package/dist/chunks/{dropdown-default-textbox.0b38fac3.js.map → dropdown-default-textbox.6eb46615.js.map} +1 -1
- package/dist/chunks/{dropdown.afff433b.js → dropdown.2c65ead9.js} +6 -6
- package/dist/chunks/{dropdown.afff433b.js.map → dropdown.2c65ead9.js.map} +1 -1
- package/dist/chunks/{error-message.64e1964b.js → error-message.d66968dd.js} +2 -2
- package/dist/chunks/{error-message.64e1964b.js.map → error-message.d66968dd.js.map} +1 -1
- package/dist/chunks/{fixed-scroller.e5aa7b00.js → fixed-scroller.a046719e.js} +2 -2
- package/dist/chunks/{fixed-scroller.e5aa7b00.js.map → fixed-scroller.a046719e.js.map} +1 -1
- package/dist/chunks/{footer-actions.1ce44374.js → footer-actions.a4a92a80.js} +3 -3
- package/dist/chunks/{footer-actions.1ce44374.js.map → footer-actions.a4a92a80.js.map} +1 -1
- package/dist/chunks/{index.bcc58fdd.js → index.126b4d7a.js} +3 -3
- package/dist/chunks/{index.bcc58fdd.js.map → index.126b4d7a.js.map} +1 -1
- package/dist/chunks/{index.369b0e66.js → index.1f97d7e1.js} +8 -8
- package/dist/chunks/{index.369b0e66.js.map → index.1f97d7e1.js.map} +1 -1
- package/dist/chunks/{index.2bd3812b.js → index.32ef1db1.js} +2 -2
- package/dist/chunks/{index.2bd3812b.js.map → index.32ef1db1.js.map} +1 -1
- package/dist/chunks/{index.c207e9ab.js → index.4c081dd4.js} +5 -5
- package/dist/chunks/{index.c207e9ab.js.map → index.4c081dd4.js.map} +1 -1
- package/dist/chunks/{index.e579bc02.js → index.70b710b4.js} +2 -2
- package/dist/chunks/{index.e579bc02.js.map → index.70b710b4.js.map} +1 -1
- package/dist/chunks/{index.fa7b44f1.js → index.70ec4e97.js} +2 -2
- package/dist/chunks/{index.fa7b44f1.js.map → index.70ec4e97.js.map} +1 -1
- package/dist/chunks/{index.6a665ade.js → index.c60cc197.js} +3 -3
- package/dist/chunks/{index.6a665ade.js.map → index.c60cc197.js.map} +1 -1
- package/dist/chunks/{index.77f35162.js → index.f9c4b579.js} +6 -6
- package/dist/chunks/{index.77f35162.js.map → index.f9c4b579.js.map} +1 -1
- package/dist/chunks/{listbox-option-tag.809ec40e.js → listbox-option-tag.67ee5da8.js} +3 -3
- package/dist/chunks/{listbox-option-tag.809ec40e.js.map → listbox-option-tag.67ee5da8.js.map} +1 -1
- package/dist/chunks/{listbox.f6e5a11d.js → listbox.70dc835e.js} +4 -4
- package/dist/chunks/{listbox.f6e5a11d.js.map → listbox.70dc835e.js.map} +1 -1
- package/dist/chunks/{loading-button.746b7fa1.js → loading-button.bc08f016.js} +2 -2
- package/dist/chunks/{loading-button.746b7fa1.js.map → loading-button.bc08f016.js.map} +1 -1
- package/dist/chunks/{tooltip.f769eb14.js → tooltip.f37cc883.js} +3 -3
- package/dist/chunks/{tooltip.f769eb14.js.map → tooltip.f37cc883.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 +15 -15
- 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 +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loading-button.
|
|
1
|
+
{"version":3,"file":"loading-button.bc08f016.js","sources":["../../../vue2/src/components/button/components/loading-button/loading-button.types.ts","../../../vue2/src/components/button/components/loading-button/loading-button.vue"],"sourcesContent":["export enum BentoLoadingButtonState {\n START = 'start',\n LOADING = 'loading',\n SUCCESS = 'success',\n FAIL = 'fail',\n}\n\nexport type BentoLoadingButtonIconState = Partial<{ [key in BentoLoadingButtonState]: string }>;\n","<template>\n <bento-button\n :critical=\"state === BentoLoadingButtonState.FAIL\"\n :variant=\"variant\"\n :condensed=\"condensed\"\n :disabled=\"disabled\"\n class=\"b-loading-button\"\n :class=\"conditionalClasses\"\n @click.capture.stop=\"onClick\"\n >\n <slot></slot>\n <template v-if=\"state !== BentoLoadingButtonState.START\" #iconLeft>\n <span class=\"b-loading-button__icon\" data-testid=\"loading-button-rotating-icon\">\n <cross v-if=\"state === BentoLoadingButtonState.FAIL\" svg-title=\"failed\" />\n <checkmark v-else-if=\"state === BentoLoadingButtonState.SUCCESS\" svg-title=\"succeded\" />\n <!-- TODO: Replace with new loading-indicator component -->\n <bento-loading-indicator\n v-else-if=\"state === BentoLoadingButtonState.LOADING\"\n small\n :inverse=\"isInverseLoadingIndicator\"\n />\n </span>\n </template>\n </bento-button>\n</template>\n\n<script lang=\"ts\">\n import { computed, defineComponent, PropType } from 'vue';\n import { BentoButtonVariant } from '@/core/components/button/button.types';\n import { BentoLoadingButtonState } from './loading-button.types';\n import { BentoLoadingIndicator } from '@/components/loading-indicator';\n import BentoButton from '@/components/button/button.vue';\n import Cross from '@adyen/ui-assets-icons-16/vue/cross-circle-fill';\n import Checkmark from '@adyen/ui-assets-icons-16/vue/checkmark-circle-fill';\n\n export default defineComponent({\n name: 'bento-loading-button',\n components: { BentoButton, Cross, Checkmark, BentoLoadingIndicator },\n props: {\n /**\n * Reduces sizing of button\n */\n condensed: {\n type: BentoButton.props.condensed.type,\n default: false,\n },\n\n /**\n * Disables button functonality\n */\n disabled: {\n type: BentoButton.props.disabled.type,\n default: false,\n },\n\n /**\n * State of the button.\n * @values start, loading, success, fail\n */\n state: {\n type: String as PropType<BentoLoadingButtonState | `${BentoLoadingButtonState}`>,\n default: BentoLoadingButtonState.START,\n validator: (value: BentoLoadingButtonState) => Object.values(BentoLoadingButtonState).includes(value),\n },\n\n /**\n * Types of flavour of Button\n * @values primary, secondary, tertiary\n */\n variant: {\n type: BentoButton.props.variant.type,\n default: BentoButtonVariant.PRIMARY,\n validator: BentoButton.props.variant.validator,\n },\n },\n setup(props, { emit }) {\n const conditionalClasses = computed(() => ({\n [`b-loading-button--${props.variant}-${BentoLoadingButtonState.LOADING}`]:\n props.state === BentoLoadingButtonState.LOADING && !props.disabled,\n [`b-loading-button--${props.variant}-${BentoLoadingButtonState.SUCCESS}`]:\n props.state === BentoLoadingButtonState.SUCCESS,\n }));\n\n const isInverseLoadingIndicator = computed(() => props.variant === BentoButtonVariant.PRIMARY);\n\n const onClick = (e: MouseEvent) => {\n if (props.state !== BentoLoadingButtonState.LOADING) {\n emit('click', e);\n }\n };\n\n return {\n // Enums\n BentoLoadingButtonState,\n\n // Functions\n onClick,\n\n // Values\n conditionalClasses,\n isInverseLoadingIndicator,\n };\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./loading-button.scss\" />\n"],"names":["BentoLoadingButtonState","BentoLoadingButtonState2","_sfc_main","defineComponent","BentoButton","CrossCircleIcon","CheckedCircleIcon","BentoLoadingIndicator","value","BentoButtonVariant","props","emit","conditionalClasses","computed","isInverseLoadingIndicator","e","openBlock","createBlock","_component_bento_button","_ctx","withModifiers","createSlots","withCtx","createElementVNode","_hoisted_1","_component_cross","_component_checkmark","_component_bento_loading_indicator"],"mappings":";;;;;;;AAAY,IAAAA,IAAA,kBAAAC,OACRA,EAAA,QAAA,SACAA,EAAA,UAAA,WACAA,EAAA,UAAA,WACAA,EAAA,OAAA,QAJQ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GA,2BAAAE;AAAA,IACA;AAAA,EACJ;AAER,CAAA;;EA3FyD,OAAA;AAAA;;;;AATpD,SAAAE,EAAA,GAAAC,EAAAC,GAAA;AAAA,IAAgB,UAAAC,EAAA,UAAAA,EAAA,wBAAA;AAAA,IACI,SAAAA,EAAA;AAAA,IACV,WAAAA,EAAA;AAAA,IACN,UAAAA,EAAA;AAAA;IAIQ,gBAAAC,EAAAD,EAAA,SAAA,CAAA,MAAA,CAAA;AAAA,EAAA,GAAAE,EAAA;AAAA,IAAA,SAAAC,EAAA,MAAA;AAAA;;IACG,GAAA;AAAA,EAAA,GAAA;AAAA;MACZ,MAAA;AAAA,MAAA,IAAAA,EAAA,MAAA;AAAA,QACsBC,EAAA,QAAAC,GAAA;AAAA,UAAwDL,EAAA,UAAAA,EAAA,wBAAA,QAAAH,EAAA,GAAAC,EAAAQ,GAAA;AAAA,YAAH,KAAA;AAAA;UAC5C,CAAA,KAAAN,EAAA,UAAAA,EAAA,wBAAA,WAAAH,EAAA,GAAAC,EAAAS,GAAA;AAAA,YAA0D,KAAA;AAAA;UAGjE,CAAA,KAAAP,EAAA,UAAAA,EAAA,wBAAA,WAAAH,EAAA,GAAAC,EAAAU,GAAA;AAAA,YACX,KAAA;AAAA,YACJ,OAAA;AAAA;;;;;;;;;"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { computed as A, defineComponent as D, resolveComponent as R, openBlock as W, createBlock as B, normalizeClass as I, withCtx as O, createVNode as U, createTextVNode as G, toDisplayString as H, reactive as k, createApp as $, h as L, nextTick as q } from "vue";
|
|
2
2
|
import { l as u } from "./events.58c00e6d.js";
|
|
3
3
|
import { g as M } from "./unique-id.a2a2b458.js";
|
|
4
|
-
import { P as x, a as F, b as j } from "./index.
|
|
5
|
-
import { B as V } from "./index.
|
|
4
|
+
import { P as x, a as F, b as j } from "./index.126b4d7a.js";
|
|
5
|
+
import { B as V } from "./index.32ef1db1.js";
|
|
6
6
|
import { _ as z } from "./_plugin-vue_export-helper.dad06003.js";
|
|
7
7
|
import "../assets/tooltip.css";
|
|
8
8
|
const d = { ...x };
|
|
@@ -187,4 +187,4 @@ export {
|
|
|
187
187
|
g as a,
|
|
188
188
|
st as b
|
|
189
189
|
};
|
|
190
|
-
//# sourceMappingURL=tooltip.
|
|
190
|
+
//# sourceMappingURL=tooltip.f37cc883.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tooltip.f769eb14.js","sources":["../../../vue2/src/directives/tooltip/tooltip.types.ts","../../../vue2/src/types/utils-events.ts","../../../vue2/src/components/tooltip/tooltip.vue","../../../vue2/src/directives/tooltip/tooltip.ts"],"sourcesContent":["import { PopperContainerPositionBasic } from '@/components/popper-container';\nimport type { DirectiveBinding } from 'vue/types/options';\n\nexport const BentoTooltipPosition = { ...PopperContainerPositionBasic };\nexport type BentoTooltipPosition = PopperContainerPositionBasic;\n\nexport enum BentoTooltipState {\n HIDDEN = 'hidden',\n}\n\nexport interface BentoTooltipDirectiveBinding extends Readonly<DirectiveBinding> {\n readonly value: string;\n}\n","import type { Vue } from 'vue-demi';\n\nexport interface ListenOptions {\n capture?: boolean;\n passive?: boolean;\n once?: boolean;\n self?: boolean;\n vm?: Vue;\n onCleanup?: () => void;\n}\n\nexport enum EventKey {\n ESCAPE = 'Escape',\n ENTER = 'Enter',\n ARROW_LEFT = 'ArrowLeft',\n ARROW_UP = 'ArrowUp',\n ARROW_RIGHT = 'ArrowRight',\n ARROW_DOWN = 'ArrowDown',\n PAGE_UP = 'PageUp',\n PAGE_DOWN = 'PageDown',\n END = 'End',\n HOME = 'Home',\n}\n\n/**\n * @deprecated `Event.keyCode` is deprecated. Use `EventKey` instead\n */\nexport enum KeyCode {\n ESCAPE = 27,\n ENTER = 13,\n ARROW_LEFT = 37,\n ARROW_UP = 38,\n ARROW_RIGHT = 39,\n ARROW_DOWN = 40,\n PAGE_UP = 33,\n PAGE_DOWN = 34,\n END = 35,\n HOME = 36,\n}\n","<template>\n <popper-container\n :id=\"id\"\n :aria-role=\"PopperContainerAriaRole.TOOLTIP\"\n :aria-hidden=\"!isShown\"\n :arrow=\"{ classes: ['b-tooltip__arrow'] }\"\n :class=\"conditionalClasses\"\n :fallback-position=\"['top', 'bottom', 'right', 'left']\"\n :is-hidden=\"!isShown\"\n :offset=\"[0, 4]\"\n :position=\"position\"\n :tabindex=\"tabIndex\"\n :target-element=\"targetElement\"\n class=\"b-tooltip\"\n >\n <bento-typography el=\"span\" variant=\"caption\">\n {{ content }}\n </bento-typography>\n </popper-container>\n</template>\n\n<script lang=\"ts\">\n import { computed, defineComponent, PropType } from 'vue';\n import { BentoTooltipPosition, BentoTooltipState } from '@/directives/tooltip/tooltip.types';\n import { PopperContainer, PopperContainerAriaRole } from '@/components/popper-container';\n import { BentoTypography } from '@/components/typography';\n import { VueNodeElement } from '@/types';\n\n /**\n * Tooltip container, to be used internally to render the tooltip container where the text is shown.\n */\n export const Tooltip = {\n name: 'tooltip',\n components: { BentoTypography, PopperContainer },\n props: {\n /**\n * The tooltip's id. Necessary for accessibility purposes.\n */\n id: { type: String, default: null },\n /**\n * Tooltip's target reference to the DOM element or Vue component.\n * The tooltip will position itself relatively to target element, in the specified position.\n */\n targetElement: { type: [Element, Object] as PropType<VueNodeElement>, required: true },\n /**\n * Tooltip's position relative to the target element.\n * Possible values are: 'top', 'bottom', 'left' and 'right'.\n */\n position: {\n type: String as PropType<BentoTooltipPosition>,\n default: BentoTooltipPosition.TOP,\n validator: value => Object.values(BentoTooltipPosition).includes(value as BentoTooltipPosition),\n },\n /**\n * Tooltip's offset.\n * If specified, the tooltip will have an offset in pixels between it and the target element\n * in specified position.\n */\n offset: { type: Number, default: 0 },\n /**\n * Tooltip's text content.\n */\n content: { type: String, required: true },\n /**\n * Shows / Hides the Tooltip component\n */\n isShown: { type: Boolean, default: false },\n },\n setup(props) {\n const conditionalClasses = computed(() => ({\n [`b-tooltip--${BentoTooltipState.HIDDEN}`]: !props.isShown,\n }));\n\n const tabIndex = computed((): number => (props.isShown ? 1 : -1));\n\n return {\n // Enums\n PopperContainerAriaRole,\n\n // Values\n conditionalClasses,\n tabIndex,\n };\n },\n };\n\n export default defineComponent(Tooltip);\n</script>\n\n<style lang=\"scss\" scoped src=\"./tooltip.scss\" />\n","import { nextTick, reactive } from 'vue';\nimport { listen } from '@/utils/ts/events';\nimport { generateUid } from '@/utils/ts/unique-id';\nimport { EventKey } from '@/types/utils-events';\nimport { BentoTooltipDirectiveBinding, BentoTooltipPosition } from './tooltip.types';\nimport { createApp, h, isVue2, Vue2 } from 'vue-demi';\nimport BentoTooltip from '@/components/tooltip/tooltip.vue';\n\ninterface TooltipInstance {\n target: HTMLElement;\n content: string;\n position: BentoTooltipPosition;\n removeListeners: Array<() => void>;\n}\n\n/**\n * Tooltip directive to render a tooltip on a given HTML element or component.\n *\n * @usage\n * import { BentoTooltipDirective, BentoTooltipPosition } from '@adyen/bento-vue2';\n *\n * export default {\n * directives: { BentoTooltipDirective },\n * template: `\n * <bento-button\n * v-bento-tooltip-directive:BentoTooltipPosition.BOTTOM=\"refToTextContent\"\n * >\n * Button text\n * </bento-button>\n * `,\n * }\n */\nconst tooltipInstances: Array<TooltipInstance> = [];\nconst ariaDescribedByAttr = 'aria-describedby';\nconst tooltipId = generateUid('tooltip');\n\nlet tooltipVNode;\n\n// Reusable Tooltip component instance.\nlet tooltip;\n// Global visibility state to prevent tooltips from showing after it being instructed to hide\nlet open = false;\n\nconst tooltipProps = reactive({\n targetElement: null,\n content: 'START_MESSAGE',\n id: tooltipId,\n position: undefined,\n isShown: false,\n});\n\n/**\n * Creates a new Tooltip component instance and inserts it into DOM.\n * @param {HTMLElement} el the target element for the Tooltip\n * @internal\n */\nconst createTooltip = (el: HTMLElement) => {\n // Sets the target's tabindex so as to make the tooltip interactive via keyboard navigation\n el.setAttribute('tabindex', '0');\n\n if (isVue2) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore: Type error for Vue method in Vue 3 but this code only executes in vue 2 so ignoring.\n const TooltipComponent = Vue2.extend(BentoTooltip);\n tooltip = new TooltipComponent({ propsData: { targetElement: el, content: '', id: tooltipId } }).$mount();\n document.body.appendChild(tooltip.$el);\n } else {\n tooltipProps.targetElement = el;\n tooltip = createApp({\n components: { BentoTooltip },\n setup() {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore: Type error for h method in Vue 2 but this code only executes in vue 3 so ignoring.\n return () => h(BentoTooltip, { ...tooltipProps }, '');\n },\n });\n tooltipVNode = document.createElement('div');\n tooltipVNode.id = 'tooltip-parent';\n document.body.appendChild(tooltipVNode);\n tooltip.mount('#tooltip-parent');\n }\n};\n\n/**\n * Removes Tooltip component instance from the DOM and destroys it.\n * @internal\n */\nconst destroyTooltip = () => {\n if (isVue2) {\n document.body.removeChild(tooltip.$el);\n tooltip.$destroy();\n } else {\n tooltip.unmount();\n document.body.removeChild(tooltipVNode);\n }\n\n tooltip = undefined;\n};\n\n/**\n * Returns tooltip position based on the specified argument.\n * By default returns 'top' if no argument is specified.\n * @param {BentoTooltipDirectiveBinding} binding Directive binding object.\n * @returns {string} Tooltip position.\n * @internal\n */\nconst getTooltipPosition = (binding: BentoTooltipDirectiveBinding): BentoTooltipPosition =>\n Object.values(BentoTooltipPosition).includes(binding.arg as BentoTooltipPosition)\n ? (binding.arg as BentoTooltipPosition)\n : BentoTooltipPosition.TOP;\n\n/**\n * Get the correct Tooltip instance for the given target element\n * @param {HTMLElement} el the target element for the Tooltip\n * @returns\n */\nconst getTooltipInstanceForTarget = (el: HTMLElement): TooltipInstance =>\n tooltipInstances.find(\n ctx =>\n // isEqualNode doesn't work correct for svg element, hence the second check here\n ctx.target.isEqualNode(el) && ctx.target === el\n );\n\n/**\n * On mouse enter event updates tooltip with correct content and position, and shows tooltip.\n * @param {?HTMLElement} el - Target element\n * @internal\n */\nconst showTooltip = (el?: HTMLElement) => {\n const tooltipInstance = getTooltipInstanceForTarget(el);\n\n // If tooltip content is empty – do not show the tooltip\n if (!tooltipInstance.content || !el) {\n return;\n }\n\n if (el) {\n el.setAttribute(ariaDescribedByAttr, tooltipId);\n }\n\n // If the Tooltip is inside a dialog, move tooltip element inside of it\n // It gets restored to <body> when it gets hidden\n let isDialogOpen = false;\n document.querySelectorAll('dialog').forEach(node => {\n isDialogOpen = node?.open || isDialogOpen;\n });\n\n if (isDialogOpen) {\n if (isVue2) {\n el.after(tooltip.$el);\n // eslint-disable-next-line no-underscore-dangle\n } else if (tooltip?._instance?.vnode?.el) {\n // eslint-disable-next-line no-underscore-dangle\n el.after(tooltip?._instance?.vnode?.el);\n }\n isDialogOpen = false;\n }\n\n open = true;\n\n tooltip.content = tooltipInstance.content;\n tooltip.position = tooltipInstance.position;\n\n tooltipProps.content = tooltipInstance.content;\n tooltipProps.position = tooltipInstance.position;\n\n // Do calculations on a next tick, otherwise tooltip position calculations will be wrong\n nextTick(() => {\n // Do not open tooltip if it has been instructed to hide in process\n if (!open) {\n return;\n }\n tooltip.targetElement = el;\n tooltip.isShown = true;\n\n tooltipProps.targetElement = el;\n tooltipProps.isShown = true;\n });\n};\n\n/**\n * On mouse leave event hides the tooltip.\n * @internal\n */\nconst hideTooltip = (el?: HTMLElement) => {\n // Restore the tooltip element to body if it got move out of <body>\n if (tooltip.$el?.parentElement?.tagName && tooltip.$el?.parentElement?.tagName !== 'BODY') {\n document.body.appendChild(tooltip.$el);\n }\n\n open = false;\n tooltip.isShown = false;\n tooltipProps.isShown = false;\n if (el) {\n el.removeAttribute(ariaDescribedByAttr);\n }\n};\n\nconst tooltipBind = (el: HTMLElement, binding: BentoTooltipDirectiveBinding) => {\n // eslint-disable-next-line no-prototype-builtins\n if (!binding.hasOwnProperty('value') || binding.value) {\n // Create Tooltip component singleton instance\n if (tooltipInstances.length === 0) {\n createTooltip(el);\n }\n\n const show = () => showTooltip(el);\n const hide = () => hideTooltip(el);\n\n // Create and store context object, which has directive related handlers and content.\n const tooltipInstance: TooltipInstance = {\n target: el,\n content: binding.value,\n position: getTooltipPosition(binding),\n removeListeners: [\n listen(el, 'mouseenter', show),\n listen(el, 'mouseleave', hide),\n listen(el, 'focus', show),\n listen(el, 'blur', hide),\n listen(el, 'keydown', evt => {\n const keyboardEvent = <KeyboardEvent>evt;\n if (keyboardEvent.key === EventKey.ESCAPE) {\n hide();\n }\n }),\n ],\n };\n\n tooltipInstances.push(tooltipInstance);\n }\n};\n\nconst tooltipUpdate = (el: HTMLElement, binding: BentoTooltipDirectiveBinding) => {\n const tooltipInstance = getTooltipInstanceForTarget(el);\n if (tooltipInstance) {\n // Update tooltip content value if it is changed\n if (tooltipInstance?.content !== binding.value) {\n tooltipInstance.content = binding.value;\n // If tooltip is currently shown for current element – update tooltip's content value\n if (tooltip.isShown && tooltip.targetElement.isEqualNode(el)) {\n if (!tooltipInstance.content) {\n tooltip.isShown = false;\n } else {\n tooltip.content = binding.value;\n }\n }\n }\n // Update tooltip position if it is changed\n if (tooltipInstance.position !== binding.arg) {\n const position = getTooltipPosition(binding);\n tooltipInstance.position = position;\n tooltip.position = position;\n }\n } else if (!tooltipInstance && binding.value) {\n // If I don't have a tooltip instance yet but the value passed was updated\n tooltipBind(el, binding);\n }\n};\n\nconst tooltipUnbind = (el: HTMLElement) => {\n const context = getTooltipInstanceForTarget(el);\n\n // Prevent unbinding/removing when there's nothing to unbind, leads to stack overflow errors\n if (!context) {\n return;\n }\n\n context.removeListeners.forEach(removeListener => {\n removeListener();\n });\n\n // If el is removed while tooltip is displayed, the tooltip doesnt hide as\n // there is no el to trigger mouseleave/blur.\n hideTooltip();\n\n tooltipInstances.splice(tooltipInstances.indexOf(context), 1);\n\n // If all the elements using the directive are removed, then no point having\n // the component on the page.\n if (tooltipInstances.length === 0) {\n destroyTooltip();\n }\n};\n\n/**\n * This directive allows you to bind a tooltip to an element.\n * Tooltip can be configured to be shown in one of four positions: 'top', 'left', 'right' and 'bottom'.\n *\n * @example\n * import { BentoTooltipDirective as BentoTooltip, BentoTooltipPosition } from '@adyen/bento-vue2';\n *\n * export default {\n * directives: { BentoTooltip },\n * methods: {\n * contentExpression() {\n * return 'tooltip content';\n * },\n * },\n * template: `<div>\n * <div v-bento-tooltip:left=\"refToTooltipContent\"></div>\n * <div v-bento-tooltip:[TooltipPosition.BOTTOM]=\"refToTooltipContent\"></div>\n *\n * <!-- If you don't specify the position then by default it's `TooltipPosition.TOP` -->\n * <div v-bento-tooltip=\"refToTooltipContent\"></div>\n *\n * <!-- Tooltip content can also be a data property or a method or a computed property as well -->\n * <div v-bento-tooltip=\"contentExpression()\"></div>\n * </div>`,\n * };\n */\nexport const BentoTooltipDirective = {\n // Vue 2 Directive hooks\n bind(el, binding) {\n tooltipBind(el, binding);\n },\n update(el, binding) {\n tooltipUpdate(el, binding);\n },\n unbind(el) {\n tooltipUnbind(el);\n },\n // Vue 3 Directive hooks\n beforeMount(el, binding) {\n tooltipBind(el, binding);\n },\n mounted(el, binding) {\n tooltipUpdate(el, binding);\n },\n updated(el, binding) {\n tooltipUpdate(el, binding);\n },\n unmounted(el) {\n tooltipUnbind(el);\n },\n};\n"],"names":["BentoTooltipPosition","PopperContainerPositionBasic","BentoTooltipState","BentoTooltipState2","EventKey","EventKey2","KeyCode","KeyCode2","Tooltip","BentoTypography","PopperContainer","value","props","conditionalClasses","computed","tabIndex","PopperContainerAriaRole","_sfc_main","defineComponent","_component_popper_container","resolveComponent","openBlock","createBlock","_ctx","normalizeClass","createVNode","_component_bento_typography","tooltipInstances","ariaDescribedByAttr","tooltipId","generateUid","tooltipVNode","tooltip","open","tooltipProps","reactive","createTooltip","el","createApp","BentoTooltip","h","destroyTooltip","getTooltipPosition","binding","getTooltipInstanceForTarget","ctx","showTooltip","tooltipInstance","isDialogOpen","node","_b","_a","_d","_c","nextTick","hideTooltip","tooltipBind","show","hide","listen","evt","tooltipUpdate","position","tooltipUnbind","context","removeListener","BentoTooltipDirective"],"mappings":";;;;;;;AAGa,MAAAA,IAAA,EAAA,GAAAC,EAAA;AAGD,IAAAC,IAAA,kBAAAC,OACRA,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"version":3,"file":"tooltip.f37cc883.js","sources":["../../../vue2/src/directives/tooltip/tooltip.types.ts","../../../vue2/src/types/utils-events.ts","../../../vue2/src/components/tooltip/tooltip.vue","../../../vue2/src/directives/tooltip/tooltip.ts"],"sourcesContent":["import { PopperContainerPositionBasic } from '@/components/popper-container';\nimport type { DirectiveBinding } from 'vue/types/options';\n\nexport const BentoTooltipPosition = { ...PopperContainerPositionBasic };\nexport type BentoTooltipPosition = PopperContainerPositionBasic;\n\nexport enum BentoTooltipState {\n HIDDEN = 'hidden',\n}\n\nexport interface BentoTooltipDirectiveBinding extends Readonly<DirectiveBinding> {\n readonly value: string;\n}\n","import type { Vue } from 'vue-demi';\n\nexport interface ListenOptions {\n capture?: boolean;\n passive?: boolean;\n once?: boolean;\n self?: boolean;\n vm?: Vue;\n onCleanup?: () => void;\n}\n\nexport enum EventKey {\n ESCAPE = 'Escape',\n ENTER = 'Enter',\n ARROW_LEFT = 'ArrowLeft',\n ARROW_UP = 'ArrowUp',\n ARROW_RIGHT = 'ArrowRight',\n ARROW_DOWN = 'ArrowDown',\n PAGE_UP = 'PageUp',\n PAGE_DOWN = 'PageDown',\n END = 'End',\n HOME = 'Home',\n}\n\n/**\n * @deprecated `Event.keyCode` is deprecated. Use `EventKey` instead\n */\nexport enum KeyCode {\n ESCAPE = 27,\n ENTER = 13,\n ARROW_LEFT = 37,\n ARROW_UP = 38,\n ARROW_RIGHT = 39,\n ARROW_DOWN = 40,\n PAGE_UP = 33,\n PAGE_DOWN = 34,\n END = 35,\n HOME = 36,\n}\n","<template>\n <popper-container\n :id=\"id\"\n :aria-role=\"PopperContainerAriaRole.TOOLTIP\"\n :aria-hidden=\"!isShown\"\n :arrow=\"{ classes: ['b-tooltip__arrow'] }\"\n :class=\"conditionalClasses\"\n :fallback-position=\"['top', 'bottom', 'right', 'left']\"\n :is-hidden=\"!isShown\"\n :offset=\"[0, 4]\"\n :position=\"position\"\n :tabindex=\"tabIndex\"\n :target-element=\"targetElement\"\n class=\"b-tooltip\"\n >\n <bento-typography el=\"span\" variant=\"caption\">\n {{ content }}\n </bento-typography>\n </popper-container>\n</template>\n\n<script lang=\"ts\">\n import { computed, defineComponent, PropType } from 'vue';\n import { BentoTooltipPosition, BentoTooltipState } from '@/directives/tooltip/tooltip.types';\n import { PopperContainer, PopperContainerAriaRole } from '@/components/popper-container';\n import { BentoTypography } from '@/components/typography';\n import { VueNodeElement } from '@/types';\n\n /**\n * Tooltip container, to be used internally to render the tooltip container where the text is shown.\n */\n export const Tooltip = {\n name: 'tooltip',\n components: { BentoTypography, PopperContainer },\n props: {\n /**\n * The tooltip's id. Necessary for accessibility purposes.\n */\n id: { type: String, default: null },\n /**\n * Tooltip's target reference to the DOM element or Vue component.\n * The tooltip will position itself relatively to target element, in the specified position.\n */\n targetElement: { type: [Element, Object] as PropType<VueNodeElement>, required: true },\n /**\n * Tooltip's position relative to the target element.\n * Possible values are: 'top', 'bottom', 'left' and 'right'.\n */\n position: {\n type: String as PropType<BentoTooltipPosition>,\n default: BentoTooltipPosition.TOP,\n validator: value => Object.values(BentoTooltipPosition).includes(value as BentoTooltipPosition),\n },\n /**\n * Tooltip's offset.\n * If specified, the tooltip will have an offset in pixels between it and the target element\n * in specified position.\n */\n offset: { type: Number, default: 0 },\n /**\n * Tooltip's text content.\n */\n content: { type: String, required: true },\n /**\n * Shows / Hides the Tooltip component\n */\n isShown: { type: Boolean, default: false },\n },\n setup(props) {\n const conditionalClasses = computed(() => ({\n [`b-tooltip--${BentoTooltipState.HIDDEN}`]: !props.isShown,\n }));\n\n const tabIndex = computed((): number => (props.isShown ? 1 : -1));\n\n return {\n // Enums\n PopperContainerAriaRole,\n\n // Values\n conditionalClasses,\n tabIndex,\n };\n },\n };\n\n export default defineComponent(Tooltip);\n</script>\n\n<style lang=\"scss\" scoped src=\"./tooltip.scss\" />\n","import { nextTick, reactive } from 'vue';\nimport { listen } from '@/utils/ts/events';\nimport { generateUid } from '@/utils/ts/unique-id';\nimport { EventKey } from '@/types/utils-events';\nimport { BentoTooltipDirectiveBinding, BentoTooltipPosition } from './tooltip.types';\nimport { createApp, h, isVue2, Vue2 } from 'vue-demi';\nimport BentoTooltip from '@/components/tooltip/tooltip.vue';\n\ninterface TooltipInstance {\n target: HTMLElement;\n content: string;\n position: BentoTooltipPosition;\n removeListeners: Array<() => void>;\n}\n\n/**\n * Tooltip directive to render a tooltip on a given HTML element or component.\n *\n * @usage\n * import { BentoTooltipDirective, BentoTooltipPosition } from '@adyen/bento-vue2';\n *\n * export default {\n * directives: { BentoTooltipDirective },\n * template: `\n * <bento-button\n * v-bento-tooltip-directive:BentoTooltipPosition.BOTTOM=\"refToTextContent\"\n * >\n * Button text\n * </bento-button>\n * `,\n * }\n */\nconst tooltipInstances: Array<TooltipInstance> = [];\nconst ariaDescribedByAttr = 'aria-describedby';\nconst tooltipId = generateUid('tooltip');\n\nlet tooltipVNode;\n\n// Reusable Tooltip component instance.\nlet tooltip;\n// Global visibility state to prevent tooltips from showing after it being instructed to hide\nlet open = false;\n\nconst tooltipProps = reactive({\n targetElement: null,\n content: 'START_MESSAGE',\n id: tooltipId,\n position: undefined,\n isShown: false,\n});\n\n/**\n * Creates a new Tooltip component instance and inserts it into DOM.\n * @param {HTMLElement} el the target element for the Tooltip\n * @internal\n */\nconst createTooltip = (el: HTMLElement) => {\n // Sets the target's tabindex so as to make the tooltip interactive via keyboard navigation\n el.setAttribute('tabindex', '0');\n\n if (isVue2) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore: Type error for Vue method in Vue 3 but this code only executes in vue 2 so ignoring.\n const TooltipComponent = Vue2.extend(BentoTooltip);\n tooltip = new TooltipComponent({ propsData: { targetElement: el, content: '', id: tooltipId } }).$mount();\n document.body.appendChild(tooltip.$el);\n } else {\n tooltipProps.targetElement = el;\n tooltip = createApp({\n components: { BentoTooltip },\n setup() {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore: Type error for h method in Vue 2 but this code only executes in vue 3 so ignoring.\n return () => h(BentoTooltip, { ...tooltipProps }, '');\n },\n });\n tooltipVNode = document.createElement('div');\n tooltipVNode.id = 'tooltip-parent';\n document.body.appendChild(tooltipVNode);\n tooltip.mount('#tooltip-parent');\n }\n};\n\n/**\n * Removes Tooltip component instance from the DOM and destroys it.\n * @internal\n */\nconst destroyTooltip = () => {\n if (isVue2) {\n document.body.removeChild(tooltip.$el);\n tooltip.$destroy();\n } else {\n tooltip.unmount();\n document.body.removeChild(tooltipVNode);\n }\n\n tooltip = undefined;\n};\n\n/**\n * Returns tooltip position based on the specified argument.\n * By default returns 'top' if no argument is specified.\n * @param {BentoTooltipDirectiveBinding} binding Directive binding object.\n * @returns {string} Tooltip position.\n * @internal\n */\nconst getTooltipPosition = (binding: BentoTooltipDirectiveBinding): BentoTooltipPosition =>\n Object.values(BentoTooltipPosition).includes(binding.arg as BentoTooltipPosition)\n ? (binding.arg as BentoTooltipPosition)\n : BentoTooltipPosition.TOP;\n\n/**\n * Get the correct Tooltip instance for the given target element\n * @param {HTMLElement} el the target element for the Tooltip\n * @returns\n */\nconst getTooltipInstanceForTarget = (el: HTMLElement): TooltipInstance =>\n tooltipInstances.find(\n ctx =>\n // isEqualNode doesn't work correct for svg element, hence the second check here\n ctx.target.isEqualNode(el) && ctx.target === el\n );\n\n/**\n * On mouse enter event updates tooltip with correct content and position, and shows tooltip.\n * @param {?HTMLElement} el - Target element\n * @internal\n */\nconst showTooltip = (el?: HTMLElement) => {\n const tooltipInstance = getTooltipInstanceForTarget(el);\n\n // If tooltip content is empty – do not show the tooltip\n if (!tooltipInstance.content || !el) {\n return;\n }\n\n if (el) {\n el.setAttribute(ariaDescribedByAttr, tooltipId);\n }\n\n // If the Tooltip is inside a dialog, move tooltip element inside of it\n // It gets restored to <body> when it gets hidden\n let isDialogOpen = false;\n document.querySelectorAll('dialog').forEach(node => {\n isDialogOpen = node?.open || isDialogOpen;\n });\n\n if (isDialogOpen) {\n if (isVue2) {\n el.after(tooltip.$el);\n // eslint-disable-next-line no-underscore-dangle\n } else if (tooltip?._instance?.vnode?.el) {\n // eslint-disable-next-line no-underscore-dangle\n el.after(tooltip?._instance?.vnode?.el);\n }\n isDialogOpen = false;\n }\n\n open = true;\n\n tooltip.content = tooltipInstance.content;\n tooltip.position = tooltipInstance.position;\n\n tooltipProps.content = tooltipInstance.content;\n tooltipProps.position = tooltipInstance.position;\n\n // Do calculations on a next tick, otherwise tooltip position calculations will be wrong\n nextTick(() => {\n // Do not open tooltip if it has been instructed to hide in process\n if (!open) {\n return;\n }\n tooltip.targetElement = el;\n tooltip.isShown = true;\n\n tooltipProps.targetElement = el;\n tooltipProps.isShown = true;\n });\n};\n\n/**\n * On mouse leave event hides the tooltip.\n * @internal\n */\nconst hideTooltip = (el?: HTMLElement) => {\n // Restore the tooltip element to body if it got move out of <body>\n if (tooltip.$el?.parentElement?.tagName && tooltip.$el?.parentElement?.tagName !== 'BODY') {\n document.body.appendChild(tooltip.$el);\n }\n\n open = false;\n tooltip.isShown = false;\n tooltipProps.isShown = false;\n if (el) {\n el.removeAttribute(ariaDescribedByAttr);\n }\n};\n\nconst tooltipBind = (el: HTMLElement, binding: BentoTooltipDirectiveBinding) => {\n // eslint-disable-next-line no-prototype-builtins\n if (!binding.hasOwnProperty('value') || binding.value) {\n // Create Tooltip component singleton instance\n if (tooltipInstances.length === 0) {\n createTooltip(el);\n }\n\n const show = () => showTooltip(el);\n const hide = () => hideTooltip(el);\n\n // Create and store context object, which has directive related handlers and content.\n const tooltipInstance: TooltipInstance = {\n target: el,\n content: binding.value,\n position: getTooltipPosition(binding),\n removeListeners: [\n listen(el, 'mouseenter', show),\n listen(el, 'mouseleave', hide),\n listen(el, 'focus', show),\n listen(el, 'blur', hide),\n listen(el, 'keydown', evt => {\n const keyboardEvent = <KeyboardEvent>evt;\n if (keyboardEvent.key === EventKey.ESCAPE) {\n hide();\n }\n }),\n ],\n };\n\n tooltipInstances.push(tooltipInstance);\n }\n};\n\nconst tooltipUpdate = (el: HTMLElement, binding: BentoTooltipDirectiveBinding) => {\n const tooltipInstance = getTooltipInstanceForTarget(el);\n if (tooltipInstance) {\n // Update tooltip content value if it is changed\n if (tooltipInstance?.content !== binding.value) {\n tooltipInstance.content = binding.value;\n // If tooltip is currently shown for current element – update tooltip's content value\n if (tooltip.isShown && tooltip.targetElement.isEqualNode(el)) {\n if (!tooltipInstance.content) {\n tooltip.isShown = false;\n } else {\n tooltip.content = binding.value;\n }\n }\n }\n // Update tooltip position if it is changed\n if (tooltipInstance.position !== binding.arg) {\n const position = getTooltipPosition(binding);\n tooltipInstance.position = position;\n tooltip.position = position;\n }\n } else if (!tooltipInstance && binding.value) {\n // If I don't have a tooltip instance yet but the value passed was updated\n tooltipBind(el, binding);\n }\n};\n\nconst tooltipUnbind = (el: HTMLElement) => {\n const context = getTooltipInstanceForTarget(el);\n\n // Prevent unbinding/removing when there's nothing to unbind, leads to stack overflow errors\n if (!context) {\n return;\n }\n\n context.removeListeners.forEach(removeListener => {\n removeListener();\n });\n\n // If el is removed while tooltip is displayed, the tooltip doesnt hide as\n // there is no el to trigger mouseleave/blur.\n hideTooltip();\n\n tooltipInstances.splice(tooltipInstances.indexOf(context), 1);\n\n // If all the elements using the directive are removed, then no point having\n // the component on the page.\n if (tooltipInstances.length === 0) {\n destroyTooltip();\n }\n};\n\n/**\n * This directive allows you to bind a tooltip to an element.\n * Tooltip can be configured to be shown in one of four positions: 'top', 'left', 'right' and 'bottom'.\n *\n * @example\n * import { BentoTooltipDirective as BentoTooltip, BentoTooltipPosition } from '@adyen/bento-vue2';\n *\n * export default {\n * directives: { BentoTooltip },\n * methods: {\n * contentExpression() {\n * return 'tooltip content';\n * },\n * },\n * template: `<div>\n * <div v-bento-tooltip:left=\"refToTooltipContent\"></div>\n * <div v-bento-tooltip:[TooltipPosition.BOTTOM]=\"refToTooltipContent\"></div>\n *\n * <!-- If you don't specify the position then by default it's `TooltipPosition.TOP` -->\n * <div v-bento-tooltip=\"refToTooltipContent\"></div>\n *\n * <!-- Tooltip content can also be a data property or a method or a computed property as well -->\n * <div v-bento-tooltip=\"contentExpression()\"></div>\n * </div>`,\n * };\n */\nexport const BentoTooltipDirective = {\n // Vue 2 Directive hooks\n bind(el, binding) {\n tooltipBind(el, binding);\n },\n update(el, binding) {\n tooltipUpdate(el, binding);\n },\n unbind(el) {\n tooltipUnbind(el);\n },\n // Vue 3 Directive hooks\n beforeMount(el, binding) {\n tooltipBind(el, binding);\n },\n mounted(el, binding) {\n tooltipUpdate(el, binding);\n },\n updated(el, binding) {\n tooltipUpdate(el, binding);\n },\n unmounted(el) {\n tooltipUnbind(el);\n },\n};\n"],"names":["BentoTooltipPosition","PopperContainerPositionBasic","BentoTooltipState","BentoTooltipState2","EventKey","EventKey2","KeyCode","KeyCode2","Tooltip","BentoTypography","PopperContainer","value","props","conditionalClasses","computed","tabIndex","PopperContainerAriaRole","_sfc_main","defineComponent","_component_popper_container","resolveComponent","openBlock","createBlock","_ctx","normalizeClass","createVNode","_component_bento_typography","tooltipInstances","ariaDescribedByAttr","tooltipId","generateUid","tooltipVNode","tooltip","open","tooltipProps","reactive","createTooltip","el","createApp","BentoTooltip","h","destroyTooltip","getTooltipPosition","binding","getTooltipInstanceForTarget","ctx","showTooltip","tooltipInstance","isDialogOpen","node","_b","_a","_d","_c","nextTick","hideTooltip","tooltipBind","show","hide","listen","evt","tooltipUpdate","position","tooltipUnbind","context","removeListener","BentoTooltipDirective"],"mappings":";;;;;;;AAGa,MAAAA,IAAA,EAAA,GAAAC,EAAA;AAGD,IAAAC,IAAA,kBAAAC,OACRA,EAAA,SAAA,UADQA,IAAAD,KAAA,CAAA,CAAA,GCKAE,IAAA,kBAAAC,OACRA,EAAA,SAAA,UACAA,EAAA,QAAA,SACAA,EAAA,aAAA,aACAA,EAAA,WAAA,WACAA,EAAA,cAAA,cACAA,EAAA,aAAA,aACAA,EAAA,UAAA,UACAA,EAAA,YAAA,YACAA,EAAA,MAAA,OACAA,EAAA,OAAA,QAVQA,IAA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I,EAAA,WAAAe,GACA9B,EAAA,WAAA8B;AAAA;AAAA;AACJ,IAAA,CAAAf,KAAAJ,EAAA,SAGAa,EAAAnB,GAAAM,CAAA;AAER,GAEAoB,IAAA,CAAA1B,MAAA;AACI,QAAA2B,IAAApB,EAAAP,CAAA;AAGA,EAAA2B,MAIAA,EAAA,gBAAA,QAAA,CAAAC,MAAA;AACI,IAAAA,EAAA;AAAA,EAAe,CAAA,GAKnBV,EAAA,GAEA5B,EAAA,OAAAA,EAAA,QAAAqC,CAAA,GAAA,CAAA,GAIArC,EAAA,WAAA,KACIc,EAAA;AAER,GA4BOyB,KAAA;AAAA;AAAA,EAA8B,KAAA7B,GAAAM,GAAA;AAG7B,IAAAa,EAAAnB,GAAAM,CAAA;AAAA,EAAuB;AAAA,EAC3B,OAAAN,GAAAM,GAAA;AAEI,IAAAkB,EAAAxB,GAAAM,CAAA;AAAA,EAAyB;AAAA,EAC7B,OAAAN,GAAA;AAEI,IAAA0B,EAAA1B,CAAA;AAAA,EAAgB;AAAA;AAAA,EACpB,YAAAA,GAAAM,GAAA;AAGI,IAAAa,EAAAnB,GAAAM,CAAA;AAAA,EAAuB;AAAA,EAC3B,QAAAN,GAAAM,GAAA;AAEI,IAAAkB,EAAAxB,GAAAM,CAAA;AAAA,EAAyB;AAAA,EAC7B,QAAAN,GAAAM,GAAA;AAEI,IAAAkB,EAAAxB,GAAAM,CAAA;AAAA,EAAyB;AAAA,EAC7B,UAAAN,GAAA;AAEI,IAAA0B,EAAA1B,CAAA;AAAA,EAAgB;AAExB;"}
|
package/dist/code-snippet.js
CHANGED
|
@@ -7,16 +7,16 @@ import { json as mt } from "@codemirror/lang-json";
|
|
|
7
7
|
import { xml as bt } from "@codemirror/lang-xml";
|
|
8
8
|
import { javascript as yt } from "@codemirror/lang-javascript";
|
|
9
9
|
import { java as xt } from "@codemirror/lang-java";
|
|
10
|
-
import { B as kt } from "./chunks/dropdown.
|
|
11
|
-
import { f as Ct } from "./chunks/base-modal.
|
|
12
|
-
import { a as vt } from "./chunks/button.
|
|
13
|
-
import { B as _t } from "./chunks/index.
|
|
14
|
-
import { b as wt } from "./chunks/tooltip.
|
|
10
|
+
import { B as kt } from "./chunks/dropdown.2c65ead9.js";
|
|
11
|
+
import { f as Ct } from "./chunks/base-modal.a113c504.js";
|
|
12
|
+
import { a as vt } from "./chunks/button.c77b7a17.js";
|
|
13
|
+
import { B as _t } from "./chunks/index.32ef1db1.js";
|
|
14
|
+
import { b as wt } from "./chunks/tooltip.f37cc883.js";
|
|
15
15
|
import { BentoLoadingIndicator as Nt } from "./loading-indicator.js";
|
|
16
16
|
import { u as St } from "./chunks/i18n.6c402773.js";
|
|
17
17
|
import { _ as Ze } from "./chunks/_plugin-vue_export-helper.dad06003.js";
|
|
18
|
-
import { C as At } from "./chunks/copy.
|
|
19
|
-
import "./assets/
|
|
18
|
+
import { C as At } from "./chunks/copy.9ad2bf43.js";
|
|
19
|
+
import "./assets/index17.css";
|
|
20
20
|
const It = 1024;
|
|
21
21
|
let Bt = 0;
|
|
22
22
|
class v {
|
package/dist/country.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { ref as M, computed as d, defineComponent as B, toRefs as I, watch as P, inject as k, resolveComponent as L, openBlock as G, createElementBlock as T, createElementVNode as E, toDisplayString as N, createBlock as b, withCtx as R, createTextVNode as F } from "vue";
|
|
2
|
-
import { B as v, d as D } from "./chunks/index.
|
|
2
|
+
import { B as v, d as D } from "./chunks/index.32ef1db1.js";
|
|
3
3
|
import { u as H } from "./chunks/i18n.6c402773.js";
|
|
4
4
|
import { S as h } from "./chunks/summary-grid.keys.1d1028c2.js";
|
|
5
5
|
import { _ as U } from "./chunks/_plugin-vue_export-helper.dad06003.js";
|
|
6
|
-
import "./assets/
|
|
6
|
+
import "./assets/index16.css";
|
|
7
7
|
const m = {
|
|
8
8
|
"en-US": {
|
|
9
9
|
BD: "Dhaka",
|
package/dist/currency.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as i, computed as U, resolveComponent as f, openBlock as T, createElementBlock as s, createBlock as p, withCtx as H, createTextVNode as l, toDisplayString as N, Fragment as Y } from "vue";
|
|
2
|
-
import { B as Z } from "./chunks/index.
|
|
2
|
+
import { B as Z } from "./chunks/index.32ef1db1.js";
|
|
3
3
|
import { g as W } from "./chunks/get-slot-text.bead058f.js";
|
|
4
4
|
import { _ as V } from "./chunks/_plugin-vue_export-helper.dad06003.js";
|
|
5
5
|
const g = [
|
package/dist/data-grid.js
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
1
|
import { ref as R, onMounted as Ye, nextTick as x, watch as se, onUnmounted as Xe, reactive as Le, toRefs as Ee, computed as O, watchEffect as Xt, onBeforeUpdate as qt, openBlock as c, createElementBlock as h, mergeProps as Y, toDisplayString as z, createCommentVNode as U, pushScopeId as te, popScopeId as ne, createElementVNode as w, defineComponent as ge, resolveComponent as D, normalizeClass as K, Fragment as J, renderList as oe, toHandlers as Se, createVNode as M, withCtx as F, renderSlot as ce, createBlock as G, withModifiers as Jt, createTextVNode as H, withDirectives as qe, vShow as Kt, toRef as Je, resolveDirective as Qt, unref as le, inject as Ae, normalizeStyle as ue, createSlots as xt, normalizeProps as we, guardReactiveProps as Ne } from "vue";
|
|
2
2
|
import { o as Ke } from "./chunks/resize.a041304d.js";
|
|
3
3
|
import { u as en } from "./chunks/aria-label.ac9651a5.js";
|
|
4
|
-
import { B as Qe } from "./chunks/checkbox.
|
|
4
|
+
import { B as Qe } from "./chunks/checkbox.5d2e26b9.js";
|
|
5
5
|
import { BentoPagination as tn } from "./pagination.js";
|
|
6
6
|
import { BentoLoadingIndicator as xe } from "./loading-indicator.js";
|
|
7
|
-
import { B as Ie, p as nn } from "./chunks/index.
|
|
7
|
+
import { B as Ie, p as nn } from "./chunks/index.32ef1db1.js";
|
|
8
8
|
import { g as on } from "./chunks/get-slot-text.bead058f.js";
|
|
9
9
|
import { u as et } from "./chunks/i18n.6c402773.js";
|
|
10
10
|
import { BentoEmptyState as ln } from "./empty-state.js";
|
|
11
11
|
import { BentoFilterBar as me } from "./filter-bar.js";
|
|
12
12
|
import { E as sn } from "./chunks/tabs.keys.358742f2.js";
|
|
13
13
|
import { BentoPopoverPositions as Ue, BentoPopover as an } from "./popover.js";
|
|
14
|
-
import { a as rn } from "./chunks/button.
|
|
14
|
+
import { a as rn } from "./chunks/button.c77b7a17.js";
|
|
15
15
|
import { BentoToggle as tt } from "./toggle.js";
|
|
16
16
|
import { BentoSearchBar as dn } from "./search-bar.js";
|
|
17
|
-
import { u as un } from "./chunks/dropdown.
|
|
17
|
+
import { u as un } from "./chunks/dropdown.2c65ead9.js";
|
|
18
18
|
import { B as cn } from "./chunks/directive.0408e565.js";
|
|
19
19
|
import { _ as Z } from "./chunks/_plugin-vue_export-helper.dad06003.js";
|
|
20
20
|
import { C as gn } from "./chunks/cross.5c36a670.js";
|
|
21
21
|
import { S as fn } from "./chunks/search.d18f9657.js";
|
|
22
22
|
import { g as Cn } from "./chunks/unique-id.a2a2b458.js";
|
|
23
23
|
import { BentoInfoIcon as _n } from "./info-icon.js";
|
|
24
|
-
import { B as mn } from "./chunks/index.
|
|
25
|
-
import { K as q } from "./chunks/tooltip.
|
|
24
|
+
import { B as mn } from "./chunks/index.4c081dd4.js";
|
|
25
|
+
import { K as q } from "./chunks/tooltip.f37cc883.js";
|
|
26
26
|
import { A as vn } from "./chunks/arrow-left.cdbcc128.js";
|
|
27
27
|
import { l as Pe } from "./chunks/events.58c00e6d.js";
|
|
28
|
-
import { B as De, a as Me } from "./chunks/loading-button.
|
|
29
|
-
import "./assets/
|
|
28
|
+
import { B as De, a as Me } from "./chunks/loading-button.bc08f016.js";
|
|
29
|
+
import "./assets/index12.css";
|
|
30
30
|
const ze = (e, t) => {
|
|
31
31
|
const d = R(0);
|
|
32
32
|
let s = null;
|
package/dist/date-picker.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { ref as C, computed as P, defineComponent as Z, toRef as M, watch as x, nextTick as $, resolveComponent as y, resolveDirective as ee, withDirectives as ae, openBlock as l, createElementBlock as h, withKeys as A, createVNode as S, withCtx as k, createTextVNode as E, toDisplayString as B, createBlock as m, createCommentVNode as p, createElementVNode as te, normalizeClass as re } from "vue";
|
|
2
2
|
import { B as ne } from "./chunks/directive.0408e565.js";
|
|
3
|
-
import { c as oe } from "./chunks/dropdown-default-textbox.
|
|
3
|
+
import { c as oe } from "./chunks/dropdown-default-textbox.6eb46615.js";
|
|
4
4
|
import { BentoPopover as le } from "./popover.js";
|
|
5
5
|
import { g as I } from "./chunks/unique-id.a2a2b458.js";
|
|
6
|
-
import { B as ie } from "./chunks/index.
|
|
6
|
+
import { B as ie } from "./chunks/index.32ef1db1.js";
|
|
7
7
|
import { u as L } from "./chunks/i18n.6c402773.js";
|
|
8
8
|
import { D as q, v as se, f as de } from "./chunks/date-input.9186a0bf.js";
|
|
9
|
-
import { f as F } from "./chunks/index.
|
|
9
|
+
import { f as F } from "./chunks/index.70ec4e97.js";
|
|
10
10
|
import { e as V, d as ue, f as pe } from "./chunks/index.f55fdc32.js";
|
|
11
11
|
import { d as ce } from "./chunks/debounce.b5ef6acf.js";
|
|
12
12
|
import { u as fe } from "./chunks/use-form-layout-loading.d03e5d48.js";
|
|
13
|
-
import { C as g } from "./chunks/calendar.
|
|
14
|
-
import { b as Ye } from "./chunks/calendar.
|
|
15
|
-
import { E as me } from "./chunks/error-message.
|
|
13
|
+
import { C as g } from "./chunks/calendar.c87d4445.js";
|
|
14
|
+
import { b as Ye } from "./chunks/calendar.c87d4445.js";
|
|
15
|
+
import { E as me } from "./chunks/error-message.d66968dd.js";
|
|
16
16
|
import { _ as De } from "./chunks/_plugin-vue_export-helper.dad06003.js";
|
|
17
|
-
import "./assets/
|
|
17
|
+
import "./assets/index24.css";
|
|
18
18
|
var c = /* @__PURE__ */ ((e) => (e.INPUT = "input", e))(c || {});
|
|
19
19
|
const be = ({ datePickerValue: e, isDateIncorrect: t }) => {
|
|
20
20
|
var d;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { B as t, a as r } from "./chunks/index.
|
|
2
|
-
import { b as o } from "./chunks/calendar.
|
|
1
|
+
import { B as t, a as r } from "./chunks/index.1f97d7e1.js";
|
|
2
|
+
import { b as o } from "./chunks/calendar.c87d4445.js";
|
|
3
3
|
export {
|
|
4
4
|
t as BentoDateRangePicker,
|
|
5
5
|
r as BentoDateRangePickerEvent,
|
package/dist/date.js
CHANGED
package/dist/divider.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent as i, computed as o, openBlock as s, createElementBlock as n } from "vue";
|
|
2
2
|
import { _ } from "./chunks/_plugin-vue_export-helper.dad06003.js";
|
|
3
|
-
import "./assets/
|
|
3
|
+
import "./assets/index14.css";
|
|
4
4
|
const d = i({
|
|
5
5
|
name: "bento-divider",
|
|
6
6
|
setup(t, { attrs: r }) {
|
package/dist/dropdown.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { B as d } from "./chunks/dropdown.
|
|
1
|
+
import { B as d } from "./chunks/dropdown.2c65ead9.js";
|
|
2
2
|
import { defineComponent as _, computed as I, resolveComponent as u, openBlock as l, createElementBlock as b, createVNode as m, mergeProps as f, withCtx as y, toRefs as g, provide as h, createBlock as v } from "vue";
|
|
3
|
-
import { B as C, L as B } from "./chunks/listbox-option-tag.
|
|
3
|
+
import { B as C, L as B } from "./chunks/listbox-option-tag.67ee5da8.js";
|
|
4
4
|
import { _ as w } from "./chunks/_plugin-vue_export-helper.dad06003.js";
|
|
5
5
|
import { BentoCountry as D, BentoCountryVariant as $ } from "./country.js";
|
|
6
6
|
import { u as A } from "./chunks/useCountryItems.e83ef8f0.js";
|
|
7
|
-
import { d as k } from "./chunks/index.
|
|
7
|
+
import { d as k } from "./chunks/index.32ef1db1.js";
|
|
8
8
|
import { BentoPaymentMethod as M } from "./payment-method.js";
|
|
9
|
-
import "./assets/
|
|
9
|
+
import "./assets/index15.css";
|
|
10
10
|
const T = _({
|
|
11
11
|
name: "bento-dropdown-avatar",
|
|
12
12
|
components: {
|