@dialpad/dialtone 9.142.2 → 9.144.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +21 -0
- package/dist/css/dialtone-default-theme.css +141 -13
- package/dist/css/dialtone-default-theme.min.css +1 -1
- package/dist/css/dialtone-docs.json +1 -1
- package/dist/css/dialtone.css +141 -13
- package/dist/css/dialtone.min.css +1 -1
- package/dist/css/tokens-docs.json +1 -1
- package/dist/tokens/doc.json +57950 -57950
- package/dist/vue2/lib/avatar/avatar.cjs +1 -1
- package/dist/vue2/lib/avatar/avatar.cjs.map +1 -1
- package/dist/vue2/lib/avatar/avatar.js +13 -10
- package/dist/vue2/lib/avatar/avatar.js.map +1 -1
- package/dist/vue2/lib/popover/popover.cjs +1 -1
- package/dist/vue2/lib/popover/popover.cjs.map +1 -1
- package/dist/vue2/lib/popover/popover.js +12 -10
- package/dist/vue2/lib/popover/popover.js.map +1 -1
- package/dist/vue2/lib/popover/tippy-utils.cjs +1 -1
- package/dist/vue2/lib/popover/tippy-utils.cjs.map +1 -1
- package/dist/vue2/lib/popover/tippy-utils.js +39 -35
- package/dist/vue2/lib/popover/tippy-utils.js.map +1 -1
- package/dist/vue2/lib/tooltip/tooltip.cjs +2 -2
- package/dist/vue2/lib/tooltip/tooltip.cjs.map +1 -1
- package/dist/vue2/lib/tooltip/tooltip.js +7 -7
- package/dist/vue2/lib/tooltip/tooltip.js.map +1 -1
- package/dist/vue2/types/components/popover/tippy_utils.d.ts.map +1 -1
- package/dist/vue3/lib/avatar/avatar.cjs +1 -1
- package/dist/vue3/lib/avatar/avatar.cjs.map +1 -1
- package/dist/vue3/lib/avatar/avatar.js +29 -26
- package/dist/vue3/lib/avatar/avatar.js.map +1 -1
- package/dist/vue3/lib/popover/popover.cjs +1 -1
- package/dist/vue3/lib/popover/popover.cjs.map +1 -1
- package/dist/vue3/lib/popover/popover.js +12 -10
- package/dist/vue3/lib/popover/popover.js.map +1 -1
- package/dist/vue3/lib/popover/tippy-utils.cjs +1 -1
- package/dist/vue3/lib/popover/tippy-utils.cjs.map +1 -1
- package/dist/vue3/lib/popover/tippy-utils.js +39 -35
- package/dist/vue3/lib/popover/tippy-utils.js.map +1 -1
- package/dist/vue3/lib/tooltip/tooltip.cjs +2 -2
- package/dist/vue3/lib/tooltip/tooltip.cjs.map +1 -1
- package/dist/vue3/lib/tooltip/tooltip.js +5 -5
- package/dist/vue3/lib/tooltip/tooltip.js.map +1 -1
- package/dist/vue3/types/components/avatar/avatar.vue.d.ts.map +1 -1
- package/dist/vue3/types/components/popover/tippy_utils.d.ts.map +1 -1
- package/dist/vue3/types/components/tooltip/tooltip.vue.d.ts.map +1 -1
- package/package.json +9 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"popover.cjs","sources":["../../../components/popover/popover.vue"],"sourcesContent":["<!-- eslint-disable vuejs-accessibility/mouse-events-have-key-events -->\n<template>\n <div>\n <Teleport\n v-if=\"modal && isOpen\"\n to=\"body\"\n >\n <div\n class=\"d-modal--transparent\"\n aria-hidden=\"false\"\n @click.prevent.stop\n />\n </Teleport>\n <component\n :is=\"elementType\"\n ref=\"popover\"\n :class=\"['d-popover', { 'd-popover__anchor--opened': isOpen }]\"\n data-qa=\"dt-popover-container\"\n >\n <!-- eslint-disable-next-line vuejs-accessibility/no-static-element-interactions -->\n <div\n :id=\"!ariaLabelledby && labelledBy\"\n ref=\"anchor\"\n :data-qa=\"$attrs['data-qa'] ? `${$attrs['data-qa']}-anchor` : 'dt-popover-anchor'\"\n :tabindex=\"openOnContext ? 0 : undefined\"\n @click.capture=\"defaultToggleOpen\"\n @contextmenu=\"onContext\"\n @keydown.up.prevent=\"onArrowKeyPress\"\n @keydown.down.prevent=\"onArrowKeyPress\"\n @keydown.escape.capture=\"closePopover\"\n @keydown.enter=\"$emit('keydown', $event)\"\n @keydown.space=\"$emit('keydown', $event)\"\n @mouseenter=\"onMouseEnter\"\n @mouseleave=\"onMouseLeave\"\n >\n <!-- @slot Anchor element that activates the popover. Usually a button. -->\n <slot\n name=\"anchor\"\n :attrs=\"{\n 'aria-expanded': isOpen.toString(),\n 'aria-controls': id,\n 'aria-haspopup': role,\n }\"\n />\n </div>\n <dt-lazy-show\n :id=\"id\"\n ref=\"content\"\n :role=\"role\"\n :data-qa=\"$attrs['data-qa'] ? `${$attrs['data-qa']}__dialog` : 'dt-popover'\"\n :aria-hidden=\"`${!isOpen}`\"\n :aria-labelledby=\"labelledBy\"\n :aria-label=\"ariaLabel\"\n :aria-modal=\"`${!modal}`\"\n :transition=\"transition\"\n :show=\"isOpen\"\n :appear=\"toAppear\"\n :class=\"['d-popover__dialog', { 'd-popover__dialog--modal': modal }, dialogClass]\"\n :style=\"{\n 'max-height': calculatedMaxHeight,\n 'max-width': maxWidth,\n }\"\n :css=\"$attrs.css\"\n :tabindex=\"contentTabindex\"\n v-on=\"popoverListeners\"\n @mouseenter=\"onMouseEnterAnchor\"\n @mouseleave=\"onMouseLeaveAnchor\"\n >\n <popover-header-footer\n v-if=\"hasSlotContent($slots.headerContent) || showCloseButton\"\n ref=\"popover__header\"\n :class=\"POPOVER_HEADER_FOOTER_PADDING_CLASSES[padding]\"\n :content-class=\"headerClass\"\n type=\"header\"\n :show-close-button=\"showCloseButton\"\n @close=\"closePopover\"\n >\n <template #content>\n <!-- @slot Slot for popover header content -->\n <slot\n name=\"headerContent\"\n :close=\"closePopover\"\n />\n </template>\n </popover-header-footer>\n <div\n ref=\"popover__content\"\n :data-qa=\"$attrs['data-qa'] ? `${$attrs['data-qa']}-content` : 'dt-popover-content'\"\n :class=\"[\n 'd-popover__content',\n POPOVER_PADDING_CLASSES[padding],\n contentClass,\n ]\"\n >\n <!-- @slot Slot for the content that is displayed in the popover when it is open. -->\n <slot\n name=\"content\"\n :close=\"closePopover\"\n />\n </div>\n <popover-header-footer\n v-if=\"hasSlotContent($slots.footerContent)\"\n ref=\"popover__footer\"\n type=\"footer\"\n :class=\"POPOVER_HEADER_FOOTER_PADDING_CLASSES[padding]\"\n :content-class=\"footerClass\"\n >\n <template #content>\n <!-- @slot Slot for the footer content. -->\n <slot\n name=\"footerContent\"\n :close=\"closePopover\"\n />\n </template>\n </popover-header-footer>\n <sr-only-close-button\n v-if=\"!showCloseButton\"\n @close=\"closePopover\"\n />\n </dt-lazy-show>\n </component>\n </div>\n</template>\n\n<script>\n/* eslint-disable max-lines */\nimport {\n POPOVER_APPEND_TO_VALUES,\n POPOVER_CONTENT_WIDTHS,\n POPOVER_HEADER_FOOTER_PADDING_CLASSES,\n POPOVER_INITIAL_FOCUS_STRINGS,\n POPOVER_PADDING_CLASSES,\n POPOVER_ROLES,\n POPOVER_STICKY_VALUES,\n} from './popover_constants';\nimport { getUniqueString, hasSlotContent, isOutOfViewPort, warnIfUnmounted, disableRootScrolling, enableRootScrolling, returnFirstEl } from '@/common/utils';\nimport { DtLazyShow } from '@/components/lazy_show';\nimport ModalMixin from '@/common/mixins/modal';\nimport { createTippyPopover, getPopperOptions } from './tippy_utils';\nimport PopoverHeaderFooter from './popover_header_footer.vue';\nimport SrOnlyCloseButton from '@/common/sr_only_close_button.vue';\n\n/**\n * A Popover displays a content overlay when its anchor element is activated.\n * @see https://dialtone.dialpad.com/components/popover.html\n */\nexport default {\n compatConfig: { MODE: 3 },\n name: 'DtPopover',\n\n /********************\n * CHILD COMPONENTS *\n ********************/\n components: {\n SrOnlyCloseButton,\n DtLazyShow,\n PopoverHeaderFooter,\n },\n\n mixins: [ModalMixin],\n\n props: {\n /**\n * Controls whether the popover is shown. Leaving this null will have the popover trigger on click by default.\n * If you set this value, the default trigger behavior will be disabled, and you can control it as you need.\n * Supports v-model\n * @values null, true, false\n */\n open: {\n type: Boolean,\n default: null,\n },\n\n /**\n * Opens the popover on right click (context menu). If you set this value to `true`,\n * the default trigger behavior will be disabled.\n * @values true, false\n */\n openOnContext: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Element type (tag name) of the root element of the component.\n */\n elementType: {\n type: String,\n default: 'div',\n },\n\n /**\n * Named transition when the content display is toggled.\n * @see DtLazyShow\n */\n transition: {\n type: String,\n default: 'fade',\n },\n\n /**\n * ARIA role for the content of the popover. Defaults to \"dialog\".\n * <a class=\"d-link\" href=\"https://www.w3.org/TR/wai-aria/#aria-haspopup\" target=\"_blank\">aria-haspopup</a>\n */\n role: {\n type: String,\n default: 'dialog',\n validator: (role) => {\n return POPOVER_ROLES.includes(role);\n },\n },\n\n /**\n * ID of the element that serves as the label for the popover content.\n * Defaults to the \"anchor\" element; this exists to provide a different\n * ID of the label element if, for example, the anchor slot contains\n * other items that do not serve as a label. You should provide this\n * or ariaLabel, but not both.\n */\n ariaLabelledby: {\n type: String,\n default: null,\n },\n\n /**\n * Descriptive label for the popover content. You should provide this\n * or ariaLabelledby, but not both.\n */\n ariaLabel: {\n type: String,\n default: null,\n },\n\n /**\n * Padding size class for the popover content.\n * @values none, small, medium, large\n */\n padding: {\n type: String,\n default: 'large',\n validator: (padding) => {\n return Object.keys(POPOVER_PADDING_CLASSES).some((item) => item === padding);\n },\n },\n\n /**\n * Additional class name for the content wrapper element.\n */\n contentClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Width configuration for the popover content. When its value is 'anchor',\n * the popover content will have the same width as the anchor.\n * @values null, anchor\n */\n contentWidth: {\n type: String,\n default: '',\n validator: contentWidth => POPOVER_CONTENT_WIDTHS.includes(contentWidth),\n },\n\n /**\n * Whether to apply transition on initial render in the content lazy show component.\n */\n contentAppear: {\n type: Boolean,\n default: null,\n },\n\n /**\n * Tabindex value for the content. Passing null, no tabindex attribute will be set.\n */\n contentTabindex: {\n type: Number || null,\n default: -1,\n },\n\n /**\n * External anchor id to use in those cases the anchor can't be provided via the slot.\n * For instance, using the combobox's input as the anchor for the popover.\n */\n externalAnchor: {\n type: String,\n default: '',\n },\n\n /**\n * The id of the tooltip\n */\n id: {\n type: String,\n default () { return getUniqueString(); },\n },\n\n /**\n * Displaces the content box from its anchor element\n * by the specified number of pixels.\n * <a\n * class=\"d-link\"\n * href=\"https://atomiks.github.io/tippyjs/v6/all-props/#offset\"\n * target=\"_blank\"\n * >\n * Tippy.js docs\n * </a>\n */\n offset: {\n type: Array,\n default: () => [0, 4],\n },\n\n /**\n * Determines if the popover hides upon clicking the\n * anchor or outside the content box.\n * @values true, false\n */\n hideOnClick: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Determines modal state. If enabled popover has a modal overlay\n * preventing interaction with elements below it, but it is invisible.\n * @values true, false\n */\n modal: {\n type: Boolean,\n default: true,\n },\n\n /**\n * If the popover does not fit in the direction described by \"placement\",\n * it will attempt to change its direction to the \"fallbackPlacements\".\n * <a\n * class=\"d-link\"\n * href=\"https://popper.js.org/docs/v2/modifiers/flip/#fallbackplacements\"\n * target=\"_blank\"\n * >\n * Popper.js docs\n * </a>\n * */\n fallbackPlacements: {\n type: Array,\n default: () => {\n return ['auto'];\n },\n },\n\n /**\n * The direction the popover displays relative to the anchor.\n * <a\n * class=\"d-link\"\n * href=\"https://atomiks.github.io/tippyjs/v6/all-props/#placement\"\n * target=\"_blank\"\n * >\n * Tippy.js docs\n * </a>\n * @values top, top-start, top-end,\n * right, right-start, right-end,\n * left, left-start, left-end,\n * bottom, bottom-start, bottom-end,\n * auto, auto-start, auto-end\n */\n placement: {\n type: String,\n default: 'bottom-end',\n },\n\n /**\n * If set to false the dialog will display over top of the anchor when there is insufficient space.\n * If set to true it will never move from its position relative to the anchor and will clip instead.\n * <a\n * class=\"d-link\"\n * href=\"https://popper.js.org/docs/v2/modifiers/prevent-overflow/#tether\"\n * target=\"_blank\"\n * >\n * Popper.js docs\n * </a>\n * @values true, false\n */\n tether: {\n type: Boolean,\n default: true,\n },\n\n /**\n * If the popover sticks to the anchor. This is usually not needed, but can be needed\n * if the reference element's position is animating, or to automatically update the popover\n * position in those cases the DOM layout changes the reference element's position.\n * `true` enables it, `reference` only checks the \"reference\" rect for changes and `popper` only\n * checks the \"popper\" rect for changes.\n * <a\n * class=\"d-link\"\n * href=\"https://atomiks.github.io/tippyjs/v6/all-props/#sticky\"\n * target=\"_blank\"\n * >\n * Tippy.js docs\n * </a>\n * @values true, false, reference, popper\n */\n sticky: {\n type: [Boolean, String],\n default: false,\n validator: (sticky) => {\n return POPOVER_STICKY_VALUES.includes(sticky);\n },\n },\n\n /**\n * Determines maximum height for the popover before overflow.\n * Possible units rem|px|em\n */\n maxHeight: {\n type: String,\n default: '',\n },\n\n /**\n * Determines maximum width for the popover before overflow.\n * Possible units rem|px|%|em\n */\n maxWidth: {\n type: String,\n default: '',\n },\n\n /**\n * Determines visibility for close button\n * @values true, false\n */\n showCloseButton: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Additional class name for the header content wrapper element.\n */\n headerClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Additional class name for the footer content wrapper element.\n */\n footerClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Additional class name for the dialog element.\n */\n dialogClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * The element that is focused when the popover is opened. This can be an\n * HTMLElement within the popover, a string starting with '#' which will\n * find the element by ID. 'first' which will automatically focus\n * the first element, or 'dialog' which will focus the dialog window itself.\n * If the dialog is modal this prop cannot be 'none'.\n * @values none, dialog, first\n */\n initialFocusElement: {\n type: [String, HTMLElement],\n default: 'first',\n validator: initialFocusElement => {\n return POPOVER_INITIAL_FOCUS_STRINGS.includes(initialFocusElement) ||\n (initialFocusElement instanceof HTMLElement) ||\n initialFocusElement.startsWith('#');\n },\n },\n\n /**\n * If the popover should open pressing up or down arrow key on the anchor element.\n * This can be set when not passing open prop.\n * @values true, false\n */\n openWithArrowKeys: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Sets the element to which the popover is going to append to.\n * 'body' will append to the nearest body (supports shadow DOM).\n * 'root' will try append to the iFrame's parent body if it is contained in an iFrame\n * and has permissions to access it, else, it'd default to 'parent'.\n * @values 'body', 'parent', 'root', HTMLElement\n */\n appendTo: {\n type: [HTMLElement, String],\n default: 'body',\n validator: appendTo => {\n return POPOVER_APPEND_TO_VALUES.includes(appendTo) ||\n (appendTo instanceof HTMLElement);\n },\n },\n },\n\n emits: [\n /**\n * Native keydown event\n *\n * @event keydown\n * @type {KeyboardEvent}\n */\n 'keydown',\n\n /**\n * Event fired to sync the open prop with the parent component\n * @event update:open\n */\n 'update:open',\n\n /**\n * Emitted when popover is shown or hidden\n *\n * @event opened\n * @type {Boolean | Array}\n */\n 'opened',\n\n /**\n * Emitted when the mouse enters the popover\n *\n * @event mouseenter-popover\n */\n 'mouseenter-popover',\n\n /**\n * Emitted when the mouse leaves the popover\n *\n * @event mouseleave-popover\n */\n 'mouseleave-popover',\n\n /**\n * Emitted when the mouse enters the popover anchor\n *\n * @event mouseenter-popover-anchor\n */\n 'mouseenter-popover-anchor',\n\n /**\n * Emitted when the mouse leaves the popover anchor\n *\n * @event mouseleave-popover-anchor\n */\n 'mouseleave-popover-anchor',\n ],\n\n data () {\n return {\n POPOVER_PADDING_CLASSES,\n POPOVER_HEADER_FOOTER_PADDING_CLASSES,\n intersectionObserver: null,\n isOutsideViewport: false,\n isOpen: false,\n toAppear: false,\n anchorEl: null,\n popoverContentEl: null,\n hasSlotContent,\n };\n },\n\n computed: {\n popoverListeners () {\n return {\n keydown: event => {\n this.onKeydown(event);\n },\n\n 'after-leave': () => {\n this.onLeaveTransitionComplete();\n },\n\n 'after-enter': () => {\n this.onEnterTransitionComplete();\n },\n };\n },\n\n calculatedMaxHeight () {\n if (this.isOutsideViewport && this.modal) {\n return `calc(100vh - var(--dt-space-300))`;\n }\n return this.maxHeight;\n },\n\n labelledBy () {\n // aria-labelledby should be set only if aria-labelledby is passed as a prop, or if\n // there is no aria-label and the labelledby should point to the anchor.\n return this.ariaLabelledby || (!this.ariaLabel && getUniqueString('DtPopover__anchor'));\n },\n },\n\n watch: {\n $props: {\n immediate: true,\n deep: true,\n handler () {\n this.validateProps();\n },\n },\n\n modal (modal) {\n this.tip?.setProps({\n zIndex: modal ? 650 : this.calculateAnchorZindex(),\n });\n },\n\n offset (offset) {\n this.tip?.setProps({\n offset,\n });\n },\n\n sticky (sticky) {\n this.tip?.setProps({\n sticky,\n });\n },\n\n fallbackPlacements () {\n this.tip?.setProps({\n popperOptions: this.popperOptions(),\n });\n },\n\n tether () {\n this.tip?.setProps({\n popperOptions: this.popperOptions(),\n });\n },\n\n placement (placement) {\n this.tip?.setProps({\n placement,\n });\n },\n\n open: {\n handler: function (open) {\n if (open !== null) {\n this.isOpen = open;\n }\n if (open === true) {\n this.toAppear = true;\n }\n },\n\n immediate: true,\n },\n\n contentAppear: {\n handler: function (contentAppear) {\n if (contentAppear !== null) {\n this.toAppear = contentAppear;\n }\n },\n },\n\n isOpen (isOpen, isPrev) {\n if (isOpen) {\n this.initTippyInstance();\n this.tip.show();\n } else if (!isOpen && isPrev !== isOpen) {\n this.removeEventListeners();\n this.tip.hide();\n }\n },\n },\n\n mounted () {\n warnIfUnmounted(returnFirstEl(this.$el), this.$options.name);\n\n const externalAnchorEl = this.externalAnchor\n ? this.$refs.anchor.getRootNode().querySelector(`#${this.externalAnchor}`)\n : null;\n this.anchorEl = externalAnchorEl ?? this.$refs.anchor.children[0];\n this.popoverContentEl = returnFirstEl(this.$refs.content?.$el);\n\n if (this.isOpen) {\n this.initTippyInstance();\n this.tip.show();\n }\n\n // rootMargin here must be greater than the margin of the height we are setting in calculatedMaxHeight which\n // currently is var(--dt-space-300) (4px). If not the intersectionObserver will continually trigger in an infinite\n // loop.\n // threshold 1.0 makes this trigger every time the dialog \"touches\" the edge of the viewport.\n this.intersectionObserver = new IntersectionObserver(this.hasIntersectedViewport);\n this.intersectionObserver.observe(this.popoverContentEl);\n },\n\n beforeUnmount () {\n this.tip?.destroy();\n this.intersectionObserver?.disconnect();\n this.removeReferences();\n this.removeEventListeners();\n },\n\n /******************\n * METHODS *\n ******************/\n methods: {\n\n hasIntersectedViewport (entries) {\n const dialog = entries?.[0]?.target;\n if (!dialog) return;\n const isOut = isOutOfViewPort(dialog);\n this.isOutsideViewport = isOut.bottom || isOut.top;\n },\n\n popperOptions () {\n return getPopperOptions({\n fallbackPlacements: this.fallbackPlacements,\n tether: this.tether,\n hasHideModifierEnabled: true,\n });\n },\n\n validateProps () {\n if (this.modal && this.initialFocusElement === 'none') {\n console.error('If the popover is modal you must set the ' +\n 'initialFocusElement prop. Possible values: \"dialog\", \"first\", HTMLElement');\n }\n },\n\n calculateAnchorZindex () {\n // if a modal is currently active render at modal-element z-index, otherwise at popover z-index\n if (returnFirstEl(this.$el).getRootNode()\n .querySelector('.d-modal[aria-hidden=\"false\"], .d-modal--transparent[aria-hidden=\"false\"]') ||\n // Special case because we don't have any dialtone drawer component yet. Render at 650 when\n // anchor of popover is within a drawer.\n this.anchorEl?.closest('.d-zi-drawer')) {\n return 650;\n } else {\n return 300;\n }\n },\n\n defaultToggleOpen (e) {\n if (this.openOnContext) { return; }\n\n // Only use default toggle behaviour if the user has not set the open prop.\n // Check that the anchor element specifically was clicked.\n if (this.open === null || this.open === undefined) {\n if ((!this.anchorEl?.contains(e.target) && !this.anchorEl?.isEqualNode(e.target)) || this.anchorEl?.disabled) {\n return;\n }\n\n this.toggleOpen();\n }\n },\n\n async onContext (event) {\n if (!this.openOnContext) { return; }\n\n event.preventDefault();\n\n this.isOpen = true;\n await this.$nextTick();\n this.tip.setProps({\n placement: 'right-start',\n getReferenceClientRect: () => ({\n width: 0,\n height: 0,\n top: event.clientY,\n bottom: event.clientY,\n left: event.clientX,\n right: event.clientX,\n }),\n });\n },\n\n toggleOpen () {\n this.isOpen = !this.isOpen;\n },\n\n onArrowKeyPress (e) {\n if (this.open !== null) { return; }\n if (this.openWithArrowKeys && this.anchorEl?.contains(e.target)) {\n if (!this.isOpen) {\n this.isOpen = true;\n }\n }\n\n this.$emit('keydown', e);\n },\n\n addEventListeners () {\n window.addEventListener('dt-popover-close', this.closePopover);\n // align popover content width when contentWidth is 'anchor'\n if (this.contentWidth === 'anchor') {\n window.addEventListener('resize', this.onResize);\n }\n },\n\n removeEventListeners () {\n window.removeEventListener('dt-popover-close', this.closePopover);\n if (this.contentWidth === 'anchor') {\n window.removeEventListener('resize', this.onResize);\n }\n },\n\n closePopover () {\n this.isOpen = false;\n },\n\n /*\n * Prevents scrolling outside of the currently opened modal popover by:\n * - when anchor is not within another popover: setting the body to overflow: hidden\n * - when anchor is within another popover: set the popover dialog container to it's non-modal z-index\n * since it is no longer the active modal. This puts it underneath the overlay and prevents scrolling.\n **/\n preventScrolling () {\n if (this.modal) {\n const element = this.anchorEl?.closest('body, .tippy-box');\n if (!element) return;\n if (element.tagName?.toLowerCase() === 'body') {\n disableRootScrolling(this.anchorEl.getRootNode().host);\n this.tip.setProps({ offset: this.offset });\n } else {\n element.classList.add('d-zi-popover');\n }\n }\n },\n\n /*\n * Resets the prevent scrolling properties set in preventScrolling() back to normal.\n **/\n enableScrolling () {\n const element = this.anchorEl?.closest('body, .tippy-box');\n if (!element) return;\n if (element.tagName?.toLowerCase() === 'body') {\n enableRootScrolling(this.anchorEl.getRootNode().host);\n this.tip.setProps({ offset: this.offset });\n } else {\n element.classList.remove('d-zi-popover');\n }\n },\n\n removeReferences () {\n this.anchorEl = null;\n this.popoverContentEl = null;\n this.tip = null;\n },\n\n async onShow () {\n if (this.contentWidth === 'anchor') {\n await this.setPopoverContentAnchorWidth();\n }\n\n if (this.contentWidth === null) {\n this.popoverContentEl.style.width = 'auto';\n }\n\n this.addEventListeners();\n },\n\n async onLeaveTransitionComplete () {\n if (this.modal) {\n await this.focusFirstElement(this.$refs.anchor);\n // await next tick in case the user wants to change focus themselves.\n await this.$nextTick();\n this.enableScrolling();\n }\n this.tip?.unmount();\n this.$emit('opened', false);\n if (this.open !== null) {\n this.$emit('update:open', false);\n }\n },\n\n async onEnterTransitionComplete () {\n this.focusInitialElement();\n // await next tick in case the user wants to change focus themselves.\n await this.$nextTick();\n this.preventScrolling();\n this.$emit('opened', true, this.$refs.popover__content);\n if (this.open !== null) {\n this.$emit('update:open', true);\n }\n },\n\n focusInitialElement () {\n if (this.initialFocusElement === 'dialog') {\n returnFirstEl(this.$refs.content?.$el)?.focus();\n }\n // find by ID\n if (this.initialFocusElement.startsWith('#')) {\n this.focusInitialElementById();\n }\n if (this.initialFocusElement === 'first') {\n this.focusFirstElementIfNeeded(this.$refs.popover__content);\n }\n if (this.initialFocusElement instanceof HTMLElement) {\n this.initialFocusElement.focus();\n }\n },\n\n focusInitialElementById () {\n const result = returnFirstEl(this.$refs.content?.$el)?.querySelector(this.initialFocusElement);\n if (result) {\n result.focus();\n } else {\n console.warn('Could not find the element specified in dt-popover prop \"initialFocusElement\". ' +\n 'Defaulting to focusing the dialog.');\n }\n result ? result.focus() : returnFirstEl(this.$refs.content?.$el).focus();\n },\n\n onResize () {\n this.closePopover();\n },\n\n onClickOutside () {\n if (!this.hideOnClick) return;\n // If a popover is opened inside of this one, do not hide on click out\n const innerModals = this.popoverContentEl?.querySelector('.d-popover__anchor--opened');\n if (!innerModals) {\n this.closePopover();\n }\n },\n\n onKeydown (e) {\n if (e.key === 'Tab') {\n if (this.modal) {\n this.focusTrappedTabPress(e, this.popoverContentEl);\n }\n }\n if (e.key === 'Escape') {\n this.closePopover();\n }\n\n this.$emit('keydown', e);\n },\n\n async setPopoverContentAnchorWidth () {\n await this.$nextTick();\n this.popoverContentEl.style.width = `${this.anchorEl?.clientWidth}px`;\n },\n\n focusFirstElementIfNeeded (domEl) {\n const focusableElements = this._getFocusableElements(domEl, true);\n if (focusableElements.length !== 0) {\n this.focusFirstElement(domEl);\n } else if (this.showCloseButton) {\n this.$refs.popover__header?.focusCloseButton();\n } else {\n // if there are no focusable elements at all focus the dialog itself\n returnFirstEl(this.$refs.content?.$el).focus();\n }\n },\n\n /**\n * Return's the anchor ClientRect object relative to the window.\n * Refer to: https://atomiks.github.io/tippyjs/v6/all-props/#getreferenceclientrect for more information\n * @param error\n */\n getReferenceClientRect (error) {\n const anchorReferenceRect = this.anchorEl?.getBoundingClientRect();\n\n if (this.appendTo !== 'root' || error) return anchorReferenceRect;\n\n const anchorOwnerDocument = this.anchorEl?.ownerDocument;\n const anchorParentWindow = anchorOwnerDocument?.defaultView || anchorOwnerDocument?.parentWindow;\n const anchorIframe = anchorParentWindow?.frameElement;\n\n if (!anchorIframe) return anchorReferenceRect;\n\n const iframeReferenceRect = anchorIframe.getBoundingClientRect();\n\n return {\n width: anchorReferenceRect?.width,\n height: anchorReferenceRect?.height,\n top: iframeReferenceRect?.top + anchorReferenceRect?.top,\n left: iframeReferenceRect?.left + anchorReferenceRect?.left,\n right: iframeReferenceRect?.right + anchorReferenceRect?.right,\n bottom: iframeReferenceRect?.bottom + anchorReferenceRect?.bottom,\n };\n },\n\n initTippyInstance () {\n let internalAppendTo = null;\n let iFrameError = false;\n\n switch (this.appendTo) {\n case 'body':\n internalAppendTo = this.anchorEl?.getRootNode()?.querySelector('body');\n break;\n\n case 'root':\n // Try to attach the popover to root document, fallback to parent is fail\n try {\n internalAppendTo = window.parent.document.body;\n } catch (err) {\n console.error('Could not attach the popover to iframe parent window: ', err);\n internalAppendTo = 'parent';\n iFrameError = true;\n }\n break;\n\n default:\n internalAppendTo = this.appendTo;\n break;\n }\n\n this.tip = createTippyPopover(this.anchorEl, {\n popperOptions: this.popperOptions(),\n contentElement: this.popoverContentEl,\n placement: this.placement,\n offset: this.offset,\n sticky: this.sticky,\n appendTo: internalAppendTo,\n interactive: true,\n trigger: 'manual',\n getReferenceClientRect: () => this.getReferenceClientRect(iFrameError),\n // We have to manage hideOnClick functionality manually to handle\n // popover within popover situations.\n hideOnClick: false,\n zIndex: this.modal ? 650 : this.calculateAnchorZindex(),\n onClickOutside: this.onClickOutside,\n onShow: this.onShow,\n });\n },\n\n onMouseEnter () {\n this.$emit('mouseenter-popover');\n },\n\n onMouseLeave () {\n this.$emit('mouseleave-popover');\n },\n\n onMouseEnterAnchor () {\n this.$emit('mouseenter-popover-anchor');\n },\n\n onMouseLeaveAnchor () {\n this.$emit('mouseleave-popover-anchor');\n },\n },\n};\n</script>\n"],"names":["_sfc_main","SrOnlyCloseButton","DtLazyShow","PopoverHeaderFooter","ModalMixin","role","POPOVER_ROLES","padding","POPOVER_PADDING_CLASSES","item","contentWidth","POPOVER_CONTENT_WIDTHS","getUniqueString","sticky","POPOVER_STICKY_VALUES","initialFocusElement","POPOVER_INITIAL_FOCUS_STRINGS","appendTo","POPOVER_APPEND_TO_VALUES","POPOVER_HEADER_FOOTER_PADDING_CLASSES","hasSlotContent","event","modal","_a","offset","placement","open","contentAppear","isOpen","isPrev","warnIfUnmounted","returnFirstEl","externalAnchorEl","_b","entries","dialog","isOut","isOutOfViewPort","getPopperOptions","_c","element","disableRootScrolling","enableRootScrolling","result","domEl","error","anchorReferenceRect","anchorOwnerDocument","anchorParentWindow","anchorIframe","iframeReferenceRect","internalAppendTo","iFrameError","err","createTippyPopover","_hoisted_1","_hoisted_2","_createElementBlock","$props","$data","_createBlock","_Teleport","_createElementVNode","_cache","_withModifiers","_createCommentVNode","_resolveDynamicComponent","_normalizeClass","_withCtx","$options","_ctx","args","_withKeys","$event","_renderSlot","_createVNode","_component_dt_lazy_show","_mergeProps","_toHandlers","_component_popover_header_footer","_component_sr_only_close_button"],"mappings":"0dAkJKA,EAAU,CACb,aAAc,CAAE,KAAM,GACtB,KAAM,YAKN,WAAY,CACV,kBAAAC,EAAAA,mBACAC,EAAAA,QACA,oBAAAC,EAAAA,SAGF,OAAQ,CAACC,EAAAA,OAAU,EAEnB,MAAO,CAOL,KAAM,CACJ,KAAM,QACN,QAAS,MAQX,cAAe,CACb,KAAM,QACN,QAAS,IAMX,YAAa,CACX,KAAM,OACN,QAAS,OAOX,WAAY,CACV,KAAM,OACN,QAAS,QAOX,KAAM,CACJ,KAAM,OACN,QAAS,SACT,UAAYC,GACHC,EAAAA,cAAc,SAASD,CAAI,GAWtC,eAAgB,CACd,KAAM,OACN,QAAS,MAOX,UAAW,CACT,KAAM,OACN,QAAS,MAOX,QAAS,CACP,KAAM,OACN,QAAS,QACT,UAA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eAAeW,EAAA,OAAO,aAAa,iBAD3CV,EAAAA,YAcwBmB,EAAA,CAlHhC,IAAA,EAsGU,IAAI,kBACJ,KAAK,SACJ,MAxGXZ,EAAAA,eAwGkBR,EAAA,sCAAsCD,EAAA,OAAO,CAAA,EACpD,gBAAeA,EAAA,cAEL,kBAET,IAGE,CAHFgB,EAAAA,WAGEJ,EAAA,OAAA,gBAAA,CADC,MAAOD,EAAA,YAAY,CAAA,IA/GlC,EAAA,iCAAAJ,EAAAA,mBAAA,GAAA,EAAA,EAoHiBP,EAAA,gBApHjBO,EAAAA,mBAAA,GAAA,EAAA,iBAmHQL,EAAAA,YAGEoB,EAAA,CAtHV,IAAA,EAqHW,QAAOX,EAAA,qCArHlB,EAAA,uLAAA,EAAA"}
|
|
1
|
+
{"version":3,"file":"popover.cjs","sources":["../../../components/popover/popover.vue"],"sourcesContent":["<!-- eslint-disable vuejs-accessibility/mouse-events-have-key-events -->\n<template>\n <div>\n <Teleport\n v-if=\"modal && isOpen\"\n to=\"body\"\n >\n <div\n class=\"d-modal--transparent\"\n aria-hidden=\"false\"\n @click.prevent.stop\n />\n </Teleport>\n <component\n :is=\"elementType\"\n ref=\"popover\"\n :class=\"['d-popover', { 'd-popover__anchor--opened': isOpen }]\"\n data-qa=\"dt-popover-container\"\n >\n <!-- eslint-disable-next-line vuejs-accessibility/no-static-element-interactions -->\n <div\n :id=\"!ariaLabelledby && labelledBy\"\n ref=\"anchor\"\n :data-qa=\"$attrs['data-qa'] ? `${$attrs['data-qa']}-anchor` : 'dt-popover-anchor'\"\n :tabindex=\"openOnContext ? 0 : undefined\"\n @click.capture=\"defaultToggleOpen\"\n @contextmenu=\"onContext\"\n @keydown.up.prevent=\"onArrowKeyPress\"\n @keydown.down.prevent=\"onArrowKeyPress\"\n @keydown.escape.capture=\"closePopover\"\n @keydown.enter=\"$emit('keydown', $event)\"\n @keydown.space=\"$emit('keydown', $event)\"\n @mouseenter=\"onMouseEnter\"\n @mouseleave=\"onMouseLeave\"\n >\n <!-- @slot Anchor element that activates the popover. Usually a button. -->\n <slot\n name=\"anchor\"\n :attrs=\"{\n 'aria-expanded': isOpen.toString(),\n 'aria-controls': id,\n 'aria-haspopup': role,\n }\"\n />\n </div>\n <dt-lazy-show\n :id=\"id\"\n ref=\"content\"\n :role=\"role\"\n :data-qa=\"$attrs['data-qa'] ? `${$attrs['data-qa']}__dialog` : 'dt-popover'\"\n :aria-hidden=\"`${!isOpen}`\"\n :aria-labelledby=\"labelledBy\"\n :aria-label=\"ariaLabel\"\n :aria-modal=\"`${!modal}`\"\n :transition=\"transition\"\n :show=\"isOpen\"\n :appear=\"toAppear\"\n :class=\"['d-popover__dialog', { 'd-popover__dialog--modal': modal }, dialogClass]\"\n :style=\"{\n 'max-height': calculatedMaxHeight,\n 'max-width': maxWidth,\n }\"\n :css=\"$attrs.css\"\n :tabindex=\"contentTabindex\"\n v-on=\"popoverListeners\"\n @mouseenter=\"onMouseEnterAnchor\"\n @mouseleave=\"onMouseLeaveAnchor\"\n >\n <popover-header-footer\n v-if=\"hasSlotContent($slots.headerContent) || showCloseButton\"\n ref=\"popover__header\"\n :class=\"POPOVER_HEADER_FOOTER_PADDING_CLASSES[padding]\"\n :content-class=\"headerClass\"\n type=\"header\"\n :show-close-button=\"showCloseButton\"\n @close=\"closePopover\"\n >\n <template #content>\n <!-- @slot Slot for popover header content -->\n <slot\n name=\"headerContent\"\n :close=\"closePopover\"\n />\n </template>\n </popover-header-footer>\n <div\n ref=\"popover__content\"\n :data-qa=\"$attrs['data-qa'] ? `${$attrs['data-qa']}-content` : 'dt-popover-content'\"\n :class=\"[\n 'd-popover__content',\n POPOVER_PADDING_CLASSES[padding],\n contentClass,\n ]\"\n >\n <!-- @slot Slot for the content that is displayed in the popover when it is open. -->\n <slot\n name=\"content\"\n :close=\"closePopover\"\n />\n </div>\n <popover-header-footer\n v-if=\"hasSlotContent($slots.footerContent)\"\n ref=\"popover__footer\"\n type=\"footer\"\n :class=\"POPOVER_HEADER_FOOTER_PADDING_CLASSES[padding]\"\n :content-class=\"footerClass\"\n >\n <template #content>\n <!-- @slot Slot for the footer content. -->\n <slot\n name=\"footerContent\"\n :close=\"closePopover\"\n />\n </template>\n </popover-header-footer>\n <sr-only-close-button\n v-if=\"!showCloseButton\"\n @close=\"closePopover\"\n />\n </dt-lazy-show>\n </component>\n </div>\n</template>\n\n<script>\n/* eslint-disable max-lines */\nimport {\n POPOVER_APPEND_TO_VALUES,\n POPOVER_CONTENT_WIDTHS,\n POPOVER_HEADER_FOOTER_PADDING_CLASSES,\n POPOVER_INITIAL_FOCUS_STRINGS,\n POPOVER_PADDING_CLASSES,\n POPOVER_ROLES,\n POPOVER_STICKY_VALUES,\n} from './popover_constants';\nimport { getUniqueString, hasSlotContent, isOutOfViewPort, warnIfUnmounted, disableRootScrolling, enableRootScrolling, returnFirstEl } from '@/common/utils';\nimport { DtLazyShow } from '@/components/lazy_show';\nimport ModalMixin from '@/common/mixins/modal';\nimport { createTippyPopover, getPopperOptions } from './tippy_utils';\nimport PopoverHeaderFooter from './popover_header_footer.vue';\nimport SrOnlyCloseButton from '@/common/sr_only_close_button.vue';\n\n/**\n * A Popover displays a content overlay when its anchor element is activated.\n * @see https://dialtone.dialpad.com/components/popover.html\n */\nexport default {\n compatConfig: { MODE: 3 },\n name: 'DtPopover',\n\n /********************\n * CHILD COMPONENTS *\n ********************/\n components: {\n SrOnlyCloseButton,\n DtLazyShow,\n PopoverHeaderFooter,\n },\n\n mixins: [ModalMixin],\n\n props: {\n /**\n * Controls whether the popover is shown. Leaving this null will have the popover trigger on click by default.\n * If you set this value, the default trigger behavior will be disabled, and you can control it as you need.\n * Supports v-model\n * @values null, true, false\n */\n open: {\n type: Boolean,\n default: null,\n },\n\n /**\n * Opens the popover on right click (context menu). If you set this value to `true`,\n * the default trigger behavior will be disabled.\n * @values true, false\n */\n openOnContext: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Element type (tag name) of the root element of the component.\n */\n elementType: {\n type: String,\n default: 'div',\n },\n\n /**\n * Named transition when the content display is toggled.\n * @see DtLazyShow\n */\n transition: {\n type: String,\n default: 'fade',\n },\n\n /**\n * ARIA role for the content of the popover. Defaults to \"dialog\".\n * <a class=\"d-link\" href=\"https://www.w3.org/TR/wai-aria/#aria-haspopup\" target=\"_blank\">aria-haspopup</a>\n */\n role: {\n type: String,\n default: 'dialog',\n validator: (role) => {\n return POPOVER_ROLES.includes(role);\n },\n },\n\n /**\n * ID of the element that serves as the label for the popover content.\n * Defaults to the \"anchor\" element; this exists to provide a different\n * ID of the label element if, for example, the anchor slot contains\n * other items that do not serve as a label. You should provide this\n * or ariaLabel, but not both.\n */\n ariaLabelledby: {\n type: String,\n default: null,\n },\n\n /**\n * Descriptive label for the popover content. You should provide this\n * or ariaLabelledby, but not both.\n */\n ariaLabel: {\n type: String,\n default: null,\n },\n\n /**\n * Padding size class for the popover content.\n * @values none, small, medium, large\n */\n padding: {\n type: String,\n default: 'large',\n validator: (padding) => {\n return Object.keys(POPOVER_PADDING_CLASSES).some((item) => item === padding);\n },\n },\n\n /**\n * Additional class name for the content wrapper element.\n */\n contentClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Width configuration for the popover content. When its value is 'anchor',\n * the popover content will have the same width as the anchor.\n * @values null, anchor\n */\n contentWidth: {\n type: String,\n default: '',\n validator: contentWidth => POPOVER_CONTENT_WIDTHS.includes(contentWidth),\n },\n\n /**\n * Whether to apply transition on initial render in the content lazy show component.\n */\n contentAppear: {\n type: Boolean,\n default: null,\n },\n\n /**\n * Tabindex value for the content. Passing null, no tabindex attribute will be set.\n */\n contentTabindex: {\n type: Number || null,\n default: -1,\n },\n\n /**\n * External anchor id to use in those cases the anchor can't be provided via the slot.\n * For instance, using the combobox's input as the anchor for the popover.\n */\n externalAnchor: {\n type: String,\n default: '',\n },\n\n /**\n * The id of the tooltip\n */\n id: {\n type: String,\n default () { return getUniqueString(); },\n },\n\n /**\n * Displaces the content box from its anchor element\n * by the specified number of pixels.\n * <a\n * class=\"d-link\"\n * href=\"https://atomiks.github.io/tippyjs/v6/all-props/#offset\"\n * target=\"_blank\"\n * >\n * Tippy.js docs\n * </a>\n */\n offset: {\n type: Array,\n default: () => [0, 4],\n },\n\n /**\n * Determines if the popover hides upon clicking the\n * anchor or outside the content box.\n * @values true, false\n */\n hideOnClick: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Determines modal state. If enabled popover has a modal overlay\n * preventing interaction with elements below it, but it is invisible.\n * @values true, false\n */\n modal: {\n type: Boolean,\n default: true,\n },\n\n /**\n * If the popover does not fit in the direction described by \"placement\",\n * it will attempt to change its direction to the \"fallbackPlacements\".\n * <a\n * class=\"d-link\"\n * href=\"https://popper.js.org/docs/v2/modifiers/flip/#fallbackplacements\"\n * target=\"_blank\"\n * >\n * Popper.js docs\n * </a>\n * */\n fallbackPlacements: {\n type: Array,\n default: () => {\n return ['auto'];\n },\n },\n\n /**\n * The direction the popover displays relative to the anchor.\n * <a\n * class=\"d-link\"\n * href=\"https://atomiks.github.io/tippyjs/v6/all-props/#placement\"\n * target=\"_blank\"\n * >\n * Tippy.js docs\n * </a>\n * @values top, top-start, top-end,\n * right, right-start, right-end,\n * left, left-start, left-end,\n * bottom, bottom-start, bottom-end,\n * auto, auto-start, auto-end\n */\n placement: {\n type: String,\n default: 'bottom-end',\n },\n\n /**\n * If set to false the dialog will display over top of the anchor when there is insufficient space.\n * If set to true it will never move from its position relative to the anchor and will clip instead.\n * <a\n * class=\"d-link\"\n * href=\"https://popper.js.org/docs/v2/modifiers/prevent-overflow/#tether\"\n * target=\"_blank\"\n * >\n * Popper.js docs\n * </a>\n * @values true, false\n */\n tether: {\n type: Boolean,\n default: true,\n },\n\n /**\n * If the popover sticks to the anchor. This is usually not needed, but can be needed\n * if the reference element's position is animating, or to automatically update the popover\n * position in those cases the DOM layout changes the reference element's position.\n * `true` enables it, `reference` only checks the \"reference\" rect for changes and `popper` only\n * checks the \"popper\" rect for changes.\n * <a\n * class=\"d-link\"\n * href=\"https://atomiks.github.io/tippyjs/v6/all-props/#sticky\"\n * target=\"_blank\"\n * >\n * Tippy.js docs\n * </a>\n * @values true, false, reference, popper\n */\n sticky: {\n type: [Boolean, String],\n default: false,\n validator: (sticky) => {\n return POPOVER_STICKY_VALUES.includes(sticky);\n },\n },\n\n /**\n * Determines maximum height for the popover before overflow.\n * Possible units rem|px|em\n */\n maxHeight: {\n type: String,\n default: '',\n },\n\n /**\n * Determines maximum width for the popover before overflow.\n * Possible units rem|px|%|em\n */\n maxWidth: {\n type: String,\n default: '',\n },\n\n /**\n * Determines visibility for close button\n * @values true, false\n */\n showCloseButton: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Additional class name for the header content wrapper element.\n */\n headerClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Additional class name for the footer content wrapper element.\n */\n footerClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Additional class name for the dialog element.\n */\n dialogClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * The element that is focused when the popover is opened. This can be an\n * HTMLElement within the popover, a string starting with '#' which will\n * find the element by ID. 'first' which will automatically focus\n * the first element, or 'dialog' which will focus the dialog window itself.\n * If the dialog is modal this prop cannot be 'none'.\n * @values none, dialog, first\n */\n initialFocusElement: {\n type: [String, HTMLElement],\n default: 'first',\n validator: initialFocusElement => {\n return POPOVER_INITIAL_FOCUS_STRINGS.includes(initialFocusElement) ||\n (initialFocusElement instanceof HTMLElement) ||\n initialFocusElement.startsWith('#');\n },\n },\n\n /**\n * If the popover should open pressing up or down arrow key on the anchor element.\n * This can be set when not passing open prop.\n * @values true, false\n */\n openWithArrowKeys: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Sets the element to which the popover is going to append to.\n * 'body' will append to the nearest body (supports shadow DOM).\n * 'root' will try append to the iFrame's parent body if it is contained in an iFrame\n * and has permissions to access it, else, it'd default to 'parent'.\n * @values 'body', 'parent', 'root', HTMLElement\n */\n appendTo: {\n type: [HTMLElement, String],\n default: 'body',\n validator: appendTo => {\n return POPOVER_APPEND_TO_VALUES.includes(appendTo) ||\n (appendTo instanceof HTMLElement);\n },\n },\n },\n\n emits: [\n /**\n * Native keydown event\n *\n * @event keydown\n * @type {KeyboardEvent}\n */\n 'keydown',\n\n /**\n * Event fired to sync the open prop with the parent component\n * @event update:open\n */\n 'update:open',\n\n /**\n * Emitted when popover is shown or hidden\n *\n * @event opened\n * @type {Boolean | Array}\n */\n 'opened',\n\n /**\n * Emitted when the mouse enters the popover\n *\n * @event mouseenter-popover\n */\n 'mouseenter-popover',\n\n /**\n * Emitted when the mouse leaves the popover\n *\n * @event mouseleave-popover\n */\n 'mouseleave-popover',\n\n /**\n * Emitted when the mouse enters the popover anchor\n *\n * @event mouseenter-popover-anchor\n */\n 'mouseenter-popover-anchor',\n\n /**\n * Emitted when the mouse leaves the popover anchor\n *\n * @event mouseleave-popover-anchor\n */\n 'mouseleave-popover-anchor',\n ],\n\n data () {\n return {\n POPOVER_PADDING_CLASSES,\n POPOVER_HEADER_FOOTER_PADDING_CLASSES,\n intersectionObserver: null,\n isOutsideViewport: false,\n isOpen: false,\n toAppear: false,\n anchorEl: null,\n popoverContentEl: null,\n hasSlotContent,\n };\n },\n\n computed: {\n popoverListeners () {\n return {\n keydown: event => {\n this.onKeydown(event);\n },\n\n 'after-leave': () => {\n this.onLeaveTransitionComplete();\n },\n\n 'after-enter': () => {\n this.onEnterTransitionComplete();\n },\n };\n },\n\n calculatedMaxHeight () {\n if (this.isOutsideViewport && this.modal) {\n return `calc(100vh - var(--dt-space-300))`;\n }\n return this.maxHeight;\n },\n\n labelledBy () {\n // aria-labelledby should be set only if aria-labelledby is passed as a prop, or if\n // there is no aria-label and the labelledby should point to the anchor.\n return this.ariaLabelledby || (!this.ariaLabel && getUniqueString('DtPopover__anchor'));\n },\n },\n\n watch: {\n $props: {\n immediate: true,\n deep: true,\n handler () {\n this.validateProps();\n },\n },\n\n modal (modal) {\n this.tip?.setProps({\n zIndex: modal ? 650 : this.calculateAnchorZindex(),\n });\n },\n\n offset (offset) {\n this.tip?.setProps({\n offset,\n });\n },\n\n sticky (sticky) {\n this.tip?.setProps({\n sticky,\n });\n },\n\n fallbackPlacements () {\n this.tip?.setProps({\n popperOptions: this.popperOptions(),\n });\n },\n\n tether () {\n this.tip?.setProps({\n popperOptions: this.popperOptions(),\n });\n },\n\n placement (placement) {\n this.tip?.setProps({\n placement,\n });\n },\n\n open: {\n handler: function (open) {\n if (open !== null) {\n this.isOpen = open;\n }\n if (open === true) {\n this.toAppear = true;\n }\n },\n\n immediate: true,\n },\n\n contentAppear: {\n handler: function (contentAppear) {\n if (contentAppear !== null) {\n this.toAppear = contentAppear;\n }\n },\n },\n\n isOpen (isOpen, isPrev) {\n if (isOpen) {\n this.initTippyInstance();\n this.tip?.show();\n } else if (!isOpen && isPrev !== isOpen) {\n this.removeEventListeners();\n this.tip?.hide();\n }\n },\n },\n\n mounted () {\n warnIfUnmounted(returnFirstEl(this.$el), this.$options.name);\n\n const externalAnchorEl = this.externalAnchor\n ? this.$refs.anchor.getRootNode().querySelector(`#${this.externalAnchor}`)\n : null;\n this.anchorEl = externalAnchorEl ?? this.$refs.anchor.children[0];\n this.popoverContentEl = returnFirstEl(this.$refs.content?.$el);\n\n if (this.isOpen) {\n this.initTippyInstance();\n this.tip?.show();\n }\n\n // rootMargin here must be greater than the margin of the height we are setting in calculatedMaxHeight which\n // currently is var(--dt-space-300) (4px). If not the intersectionObserver will continually trigger in an infinite\n // loop.\n // threshold 1.0 makes this trigger every time the dialog \"touches\" the edge of the viewport.\n this.intersectionObserver = new IntersectionObserver(this.hasIntersectedViewport);\n this.intersectionObserver.observe(this.popoverContentEl);\n },\n\n beforeUnmount () {\n this.tip?.destroy();\n this.intersectionObserver?.disconnect();\n this.removeReferences();\n this.removeEventListeners();\n },\n\n /******************\n * METHODS *\n ******************/\n methods: {\n\n hasIntersectedViewport (entries) {\n const dialog = entries?.[0]?.target;\n if (!dialog) return;\n const isOut = isOutOfViewPort(dialog);\n this.isOutsideViewport = isOut.bottom || isOut.top;\n },\n\n popperOptions () {\n return getPopperOptions({\n fallbackPlacements: this.fallbackPlacements,\n tether: this.tether,\n hasHideModifierEnabled: true,\n });\n },\n\n validateProps () {\n if (this.modal && this.initialFocusElement === 'none') {\n console.error('If the popover is modal you must set the ' +\n 'initialFocusElement prop. Possible values: \"dialog\", \"first\", HTMLElement');\n }\n },\n\n calculateAnchorZindex () {\n // if a modal is currently active render at modal-element z-index, otherwise at popover z-index\n if (returnFirstEl(this.$el).getRootNode()\n .querySelector('.d-modal[aria-hidden=\"false\"], .d-modal--transparent[aria-hidden=\"false\"]') ||\n // Special case because we don't have any dialtone drawer component yet. Render at 650 when\n // anchor of popover is within a drawer.\n this.anchorEl?.closest('.d-zi-drawer')) {\n return 650;\n } else {\n return 300;\n }\n },\n\n defaultToggleOpen (e) {\n if (this.openOnContext) { return; }\n\n // Only use default toggle behaviour if the user has not set the open prop.\n // Check that the anchor element specifically was clicked.\n if (this.open === null || this.open === undefined) {\n if ((!this.anchorEl?.contains(e.target) && !this.anchorEl?.isEqualNode(e.target)) || this.anchorEl?.disabled) {\n return;\n }\n\n this.toggleOpen();\n }\n },\n\n async onContext (event) {\n if (!this.openOnContext) { return; }\n\n event.preventDefault();\n\n this.isOpen = true;\n await this.$nextTick();\n this.tip?.setProps({\n placement: 'right-start',\n getReferenceClientRect: () => ({\n width: 0,\n height: 0,\n top: event.clientY,\n bottom: event.clientY,\n left: event.clientX,\n right: event.clientX,\n }),\n });\n },\n\n toggleOpen () {\n this.isOpen = !this.isOpen;\n },\n\n onArrowKeyPress (e) {\n if (this.open !== null) { return; }\n if (this.openWithArrowKeys && this.anchorEl?.contains(e.target)) {\n if (!this.isOpen) {\n this.isOpen = true;\n }\n }\n\n this.$emit('keydown', e);\n },\n\n addEventListeners () {\n window.addEventListener('dt-popover-close', this.closePopover);\n // align popover content width when contentWidth is 'anchor'\n if (this.contentWidth === 'anchor') {\n window.addEventListener('resize', this.onResize);\n }\n },\n\n removeEventListeners () {\n window.removeEventListener('dt-popover-close', this.closePopover);\n if (this.contentWidth === 'anchor') {\n window.removeEventListener('resize', this.onResize);\n }\n },\n\n closePopover () {\n this.isOpen = false;\n },\n\n /*\n * Prevents scrolling outside of the currently opened modal popover by:\n * - when anchor is not within another popover: setting the body to overflow: hidden\n * - when anchor is within another popover: set the popover dialog container to it's non-modal z-index\n * since it is no longer the active modal. This puts it underneath the overlay and prevents scrolling.\n **/\n preventScrolling () {\n if (this.modal) {\n const element = this.anchorEl?.closest('body, .tippy-box');\n if (!element) return;\n if (element.tagName?.toLowerCase() === 'body') {\n disableRootScrolling(this.anchorEl.getRootNode().host);\n this.tip?.setProps({ offset: this.offset });\n } else {\n element.classList.add('d-zi-popover');\n }\n }\n },\n\n /*\n * Resets the prevent scrolling properties set in preventScrolling() back to normal.\n **/\n enableScrolling () {\n const element = this.anchorEl?.closest('body, .tippy-box');\n if (!element) return;\n if (element.tagName?.toLowerCase() === 'body') {\n enableRootScrolling(this.anchorEl.getRootNode().host);\n this.tip?.setProps({ offset: this.offset });\n } else {\n element.classList.remove('d-zi-popover');\n }\n },\n\n removeReferences () {\n this.anchorEl = null;\n this.popoverContentEl = null;\n this.tip = null;\n },\n\n async onShow () {\n if (this.contentWidth === 'anchor') {\n await this.setPopoverContentAnchorWidth();\n }\n\n if (this.contentWidth === null) {\n this.popoverContentEl.style.width = 'auto';\n }\n\n this.addEventListeners();\n },\n\n async onLeaveTransitionComplete () {\n if (this.modal) {\n await this.focusFirstElement(this.$refs.anchor);\n // await next tick in case the user wants to change focus themselves.\n await this.$nextTick();\n this.enableScrolling();\n }\n this.tip?.unmount();\n this.$emit('opened', false);\n if (this.open !== null) {\n this.$emit('update:open', false);\n }\n },\n\n async onEnterTransitionComplete () {\n this.focusInitialElement();\n // await next tick in case the user wants to change focus themselves.\n await this.$nextTick();\n this.preventScrolling();\n this.$emit('opened', true, this.$refs.popover__content);\n if (this.open !== null) {\n this.$emit('update:open', true);\n }\n },\n\n focusInitialElement () {\n if (this.initialFocusElement === 'dialog') {\n returnFirstEl(this.$refs.content?.$el)?.focus();\n }\n // find by ID\n if (this.initialFocusElement.startsWith('#')) {\n this.focusInitialElementById();\n }\n if (this.initialFocusElement === 'first') {\n this.focusFirstElementIfNeeded(this.$refs.popover__content);\n }\n if (this.initialFocusElement instanceof HTMLElement) {\n this.initialFocusElement.focus();\n }\n },\n\n focusInitialElementById () {\n const result = returnFirstEl(this.$refs.content?.$el)?.querySelector(this.initialFocusElement);\n if (result) {\n result.focus();\n } else {\n console.warn('Could not find the element specified in dt-popover prop \"initialFocusElement\". ' +\n 'Defaulting to focusing the dialog.');\n }\n result ? result.focus() : returnFirstEl(this.$refs.content?.$el).focus();\n },\n\n onResize () {\n this.closePopover();\n },\n\n onClickOutside () {\n if (!this.hideOnClick) return;\n // If a popover is opened inside of this one, do not hide on click out\n const innerModals = this.popoverContentEl?.querySelector('.d-popover__anchor--opened');\n if (!innerModals) {\n this.closePopover();\n }\n },\n\n onKeydown (e) {\n if (e.key === 'Tab') {\n if (this.modal) {\n this.focusTrappedTabPress(e, this.popoverContentEl);\n }\n }\n if (e.key === 'Escape') {\n this.closePopover();\n }\n\n this.$emit('keydown', e);\n },\n\n async setPopoverContentAnchorWidth () {\n await this.$nextTick();\n this.popoverContentEl.style.width = `${this.anchorEl?.clientWidth}px`;\n },\n\n focusFirstElementIfNeeded (domEl) {\n const focusableElements = this._getFocusableElements(domEl, true);\n if (focusableElements.length !== 0) {\n this.focusFirstElement(domEl);\n } else if (this.showCloseButton) {\n this.$refs.popover__header?.focusCloseButton();\n } else {\n // if there are no focusable elements at all focus the dialog itself\n returnFirstEl(this.$refs.content?.$el).focus();\n }\n },\n\n /**\n * Return's the anchor ClientRect object relative to the window.\n * Refer to: https://atomiks.github.io/tippyjs/v6/all-props/#getreferenceclientrect for more information\n * @param error\n */\n getReferenceClientRect (error) {\n const anchorReferenceRect = this.anchorEl?.getBoundingClientRect();\n\n if (this.appendTo !== 'root' || error) return anchorReferenceRect;\n\n const anchorOwnerDocument = this.anchorEl?.ownerDocument;\n const anchorParentWindow = anchorOwnerDocument?.defaultView || anchorOwnerDocument?.parentWindow;\n const anchorIframe = anchorParentWindow?.frameElement;\n\n if (!anchorIframe) return anchorReferenceRect;\n\n const iframeReferenceRect = anchorIframe.getBoundingClientRect();\n\n return {\n width: anchorReferenceRect?.width,\n height: anchorReferenceRect?.height,\n top: iframeReferenceRect?.top + anchorReferenceRect?.top,\n left: iframeReferenceRect?.left + anchorReferenceRect?.left,\n right: iframeReferenceRect?.right + anchorReferenceRect?.right,\n bottom: iframeReferenceRect?.bottom + anchorReferenceRect?.bottom,\n };\n },\n\n initTippyInstance () {\n let internalAppendTo = null;\n let iFrameError = false;\n\n switch (this.appendTo) {\n case 'body':\n internalAppendTo = this.anchorEl?.getRootNode()?.querySelector('body');\n break;\n\n case 'root':\n // Try to attach the popover to root document, fallback to parent is fail\n try {\n internalAppendTo = window.parent.document.body;\n } catch (err) {\n console.error('Could not attach the popover to iframe parent window: ', err);\n internalAppendTo = 'parent';\n iFrameError = true;\n }\n break;\n\n default:\n internalAppendTo = this.appendTo;\n break;\n }\n\n this.tip = createTippyPopover(this.anchorEl, {\n popperOptions: this.popperOptions(),\n contentElement: this.popoverContentEl,\n placement: this.placement,\n offset: this.offset,\n sticky: this.sticky,\n appendTo: internalAppendTo,\n interactive: true,\n trigger: 'manual',\n getReferenceClientRect: () => this.getReferenceClientRect(iFrameError),\n // We have to manage hideOnClick functionality manually to handle\n // popover within popover situations.\n hideOnClick: false,\n zIndex: this.modal ? 650 : this.calculateAnchorZindex(),\n onClickOutside: this.onClickOutside,\n onShow: this.onShow,\n });\n },\n\n onMouseEnter () {\n this.$emit('mouseenter-popover');\n },\n\n onMouseLeave () {\n this.$emit('mouseleave-popover');\n },\n\n onMouseEnterAnchor () {\n this.$emit('mouseenter-popover-anchor');\n },\n\n onMouseLeaveAnchor () {\n this.$emit('mouseleave-popover-anchor');\n },\n },\n};\n</script>\n"],"names":["_sfc_main","SrOnlyCloseButton","DtLazyShow","PopoverHeaderFooter","ModalMixin","role","POPOVER_ROLES","padding","POPOVER_PADDING_CLASSES","item","contentWidth","POPOVER_CONTENT_WIDTHS","getUniqueString","sticky","POPOVER_STICKY_VALUES","initialFocusElement","POPOVER_INITIAL_FOCUS_STRINGS","appendTo","POPOVER_APPEND_TO_VALUES","POPOVER_HEADER_FOOTER_PADDING_CLASSES","hasSlotContent","event","modal","_a","offset","placement","open","contentAppear","isOpen","isPrev","_b","warnIfUnmounted","returnFirstEl","externalAnchorEl","entries","dialog","isOut","isOutOfViewPort","getPopperOptions","_c","element","disableRootScrolling","enableRootScrolling","result","domEl","error","anchorReferenceRect","anchorOwnerDocument","anchorParentWindow","anchorIframe","iframeReferenceRect","internalAppendTo","iFrameError","err","createTippyPopover","_hoisted_1","_hoisted_2","_createElementBlock","$props","$data","_createBlock","_Teleport","_createElementVNode","_cache","_withModifiers","_createCommentVNode","_resolveDynamicComponent","_normalizeClass","_withCtx","$options","_ctx","args","_withKeys","$event","_renderSlot","_createVNode","_component_dt_lazy_show","_mergeProps","_toHandlers","_component_popover_header_footer","_component_sr_only_close_button"],"mappings":"0dAkJKA,EAAU,CACb,aAAc,CAAE,KAAM,GACtB,KAAM,YAKN,WAAY,CACV,kBAAAC,EAAAA,mBACAC,EAAAA,QACA,oBAAAC,EAAAA,SAGF,OAAQ,CAACC,EAAAA,OAAU,EAEnB,MAAO,CAOL,KAAM,CACJ,KAAM,QACN,QAAS,MAQX,cAAe,CACb,KAAM,QACN,QAAS,IAMX,YAAa,CACX,KAAM,OACN,QAAS,OAOX,WAAY,CACV,KAAM,OACN,QAAS,QAOX,KAAM,CACJ,KAAM,OACN,QAAS,SACT,UAAYC,GACHC,EAAAA,cAAc,SAASD,CAAI,GAWtC,eAAgB,CACd,KAAM,OACN,QAAS,MAOX,UAAW,CACT,KAAM,OACN,QAAS,MAOX,QAAS,CACP,KAAM,OACN,QAAS,QAC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UAAA,CADC,MAAOD,EAAA,YAAY,CAAA,CAjGhC,EAAA,GAAAb,CAAA,EAqGgBG,EAAA,eAAeW,EAAA,OAAO,aAAa,iBAD3CV,EAAAA,YAcwBmB,EAAA,CAlHhC,IAAA,EAsGU,IAAI,kBACJ,KAAK,SACJ,MAxGXZ,EAAAA,eAwGkBR,EAAA,sCAAsCD,EAAA,OAAO,CAAA,EACpD,gBAAeA,EAAA,cAEL,kBAET,IAGE,CAHFgB,EAAAA,WAGEJ,EAAA,OAAA,gBAAA,CADC,MAAOD,EAAA,YAAY,CAAA,IA/GlC,EAAA,iCAAAJ,EAAAA,mBAAA,GAAA,EAAA,EAoHiBP,EAAA,gBApHjBO,EAAAA,mBAAA,GAAA,EAAA,iBAmHQL,EAAAA,YAGEoB,EAAA,CAtHV,IAAA,EAqHW,QAAOX,EAAA,qCArHlB,EAAA,uLAAA,EAAA"}
|
|
@@ -457,14 +457,15 @@ const R = {
|
|
|
457
457
|
}
|
|
458
458
|
},
|
|
459
459
|
isOpen(e, t) {
|
|
460
|
-
|
|
460
|
+
var o, s;
|
|
461
|
+
e ? (this.initTippyInstance(), (o = this.tip) == null || o.show()) : !e && t !== e && (this.removeEventListeners(), (s = this.tip) == null || s.hide());
|
|
461
462
|
}
|
|
462
463
|
},
|
|
463
464
|
mounted() {
|
|
464
|
-
var t;
|
|
465
|
+
var t, o;
|
|
465
466
|
M(l(this.$el), this.$options.name);
|
|
466
467
|
const e = this.externalAnchor ? this.$refs.anchor.getRootNode().querySelector(`#${this.externalAnchor}`) : null;
|
|
467
|
-
this.anchorEl = e ?? this.$refs.anchor.children[0], this.popoverContentEl = l((t = this.$refs.content) == null ? void 0 : t.$el), this.isOpen && (this.initTippyInstance(), this.tip.show()), this.intersectionObserver = new IntersectionObserver(this.hasIntersectedViewport), this.intersectionObserver.observe(this.popoverContentEl);
|
|
468
|
+
this.anchorEl = e ?? this.$refs.anchor.children[0], this.popoverContentEl = l((t = this.$refs.content) == null ? void 0 : t.$el), this.isOpen && (this.initTippyInstance(), (o = this.tip) == null || o.show()), this.intersectionObserver = new IntersectionObserver(this.hasIntersectedViewport), this.intersectionObserver.observe(this.popoverContentEl);
|
|
468
469
|
},
|
|
469
470
|
beforeUnmount() {
|
|
470
471
|
var e, t;
|
|
@@ -506,7 +507,8 @@ const R = {
|
|
|
506
507
|
}
|
|
507
508
|
},
|
|
508
509
|
async onContext(e) {
|
|
509
|
-
|
|
510
|
+
var t;
|
|
511
|
+
this.openOnContext && (e.preventDefault(), this.isOpen = !0, await this.$nextTick(), (t = this.tip) == null || t.setProps({
|
|
510
512
|
placement: "right-start",
|
|
511
513
|
getReferenceClientRect: () => ({
|
|
512
514
|
width: 0,
|
|
@@ -541,20 +543,20 @@ const R = {
|
|
|
541
543
|
* since it is no longer the active modal. This puts it underneath the overlay and prevents scrolling.
|
|
542
544
|
**/
|
|
543
545
|
preventScrolling() {
|
|
544
|
-
var e, t;
|
|
546
|
+
var e, t, o;
|
|
545
547
|
if (this.modal) {
|
|
546
|
-
const
|
|
547
|
-
if (!
|
|
548
|
-
((t =
|
|
548
|
+
const s = (e = this.anchorEl) == null ? void 0 : e.closest("body, .tippy-box");
|
|
549
|
+
if (!s) return;
|
|
550
|
+
((t = s.tagName) == null ? void 0 : t.toLowerCase()) === "body" ? (k(this.anchorEl.getRootNode().host), (o = this.tip) == null || o.setProps({ offset: this.offset })) : s.classList.add("d-zi-popover");
|
|
549
551
|
}
|
|
550
552
|
},
|
|
551
553
|
/*
|
|
552
554
|
* Resets the prevent scrolling properties set in preventScrolling() back to normal.
|
|
553
555
|
**/
|
|
554
556
|
enableScrolling() {
|
|
555
|
-
var t, o;
|
|
557
|
+
var t, o, s;
|
|
556
558
|
const e = (t = this.anchorEl) == null ? void 0 : t.closest("body, .tippy-box");
|
|
557
|
-
e && (((o = e.tagName) == null ? void 0 : o.toLowerCase()) === "body" ? (T(this.anchorEl.getRootNode().host), this.tip.setProps({ offset: this.offset })) : e.classList.remove("d-zi-popover"));
|
|
559
|
+
e && (((o = e.tagName) == null ? void 0 : o.toLowerCase()) === "body" ? (T(this.anchorEl.getRootNode().host), (s = this.tip) == null || s.setProps({ offset: this.offset })) : e.classList.remove("d-zi-popover"));
|
|
558
560
|
},
|
|
559
561
|
removeReferences() {
|
|
560
562
|
this.anchorEl = null, this.popoverContentEl = null, this.tip = null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"popover.js","sources":["../../../components/popover/popover.vue"],"sourcesContent":["<!-- eslint-disable vuejs-accessibility/mouse-events-have-key-events -->\n<template>\n <div>\n <Teleport\n v-if=\"modal && isOpen\"\n to=\"body\"\n >\n <div\n class=\"d-modal--transparent\"\n aria-hidden=\"false\"\n @click.prevent.stop\n />\n </Teleport>\n <component\n :is=\"elementType\"\n ref=\"popover\"\n :class=\"['d-popover', { 'd-popover__anchor--opened': isOpen }]\"\n data-qa=\"dt-popover-container\"\n >\n <!-- eslint-disable-next-line vuejs-accessibility/no-static-element-interactions -->\n <div\n :id=\"!ariaLabelledby && labelledBy\"\n ref=\"anchor\"\n :data-qa=\"$attrs['data-qa'] ? `${$attrs['data-qa']}-anchor` : 'dt-popover-anchor'\"\n :tabindex=\"openOnContext ? 0 : undefined\"\n @click.capture=\"defaultToggleOpen\"\n @contextmenu=\"onContext\"\n @keydown.up.prevent=\"onArrowKeyPress\"\n @keydown.down.prevent=\"onArrowKeyPress\"\n @keydown.escape.capture=\"closePopover\"\n @keydown.enter=\"$emit('keydown', $event)\"\n @keydown.space=\"$emit('keydown', $event)\"\n @mouseenter=\"onMouseEnter\"\n @mouseleave=\"onMouseLeave\"\n >\n <!-- @slot Anchor element that activates the popover. Usually a button. -->\n <slot\n name=\"anchor\"\n :attrs=\"{\n 'aria-expanded': isOpen.toString(),\n 'aria-controls': id,\n 'aria-haspopup': role,\n }\"\n />\n </div>\n <dt-lazy-show\n :id=\"id\"\n ref=\"content\"\n :role=\"role\"\n :data-qa=\"$attrs['data-qa'] ? `${$attrs['data-qa']}__dialog` : 'dt-popover'\"\n :aria-hidden=\"`${!isOpen}`\"\n :aria-labelledby=\"labelledBy\"\n :aria-label=\"ariaLabel\"\n :aria-modal=\"`${!modal}`\"\n :transition=\"transition\"\n :show=\"isOpen\"\n :appear=\"toAppear\"\n :class=\"['d-popover__dialog', { 'd-popover__dialog--modal': modal }, dialogClass]\"\n :style=\"{\n 'max-height': calculatedMaxHeight,\n 'max-width': maxWidth,\n }\"\n :css=\"$attrs.css\"\n :tabindex=\"contentTabindex\"\n v-on=\"popoverListeners\"\n @mouseenter=\"onMouseEnterAnchor\"\n @mouseleave=\"onMouseLeaveAnchor\"\n >\n <popover-header-footer\n v-if=\"hasSlotContent($slots.headerContent) || showCloseButton\"\n ref=\"popover__header\"\n :class=\"POPOVER_HEADER_FOOTER_PADDING_CLASSES[padding]\"\n :content-class=\"headerClass\"\n type=\"header\"\n :show-close-button=\"showCloseButton\"\n @close=\"closePopover\"\n >\n <template #content>\n <!-- @slot Slot for popover header content -->\n <slot\n name=\"headerContent\"\n :close=\"closePopover\"\n />\n </template>\n </popover-header-footer>\n <div\n ref=\"popover__content\"\n :data-qa=\"$attrs['data-qa'] ? `${$attrs['data-qa']}-content` : 'dt-popover-content'\"\n :class=\"[\n 'd-popover__content',\n POPOVER_PADDING_CLASSES[padding],\n contentClass,\n ]\"\n >\n <!-- @slot Slot for the content that is displayed in the popover when it is open. -->\n <slot\n name=\"content\"\n :close=\"closePopover\"\n />\n </div>\n <popover-header-footer\n v-if=\"hasSlotContent($slots.footerContent)\"\n ref=\"popover__footer\"\n type=\"footer\"\n :class=\"POPOVER_HEADER_FOOTER_PADDING_CLASSES[padding]\"\n :content-class=\"footerClass\"\n >\n <template #content>\n <!-- @slot Slot for the footer content. -->\n <slot\n name=\"footerContent\"\n :close=\"closePopover\"\n />\n </template>\n </popover-header-footer>\n <sr-only-close-button\n v-if=\"!showCloseButton\"\n @close=\"closePopover\"\n />\n </dt-lazy-show>\n </component>\n </div>\n</template>\n\n<script>\n/* eslint-disable max-lines */\nimport {\n POPOVER_APPEND_TO_VALUES,\n POPOVER_CONTENT_WIDTHS,\n POPOVER_HEADER_FOOTER_PADDING_CLASSES,\n POPOVER_INITIAL_FOCUS_STRINGS,\n POPOVER_PADDING_CLASSES,\n POPOVER_ROLES,\n POPOVER_STICKY_VALUES,\n} from './popover_constants';\nimport { getUniqueString, hasSlotContent, isOutOfViewPort, warnIfUnmounted, disableRootScrolling, enableRootScrolling, returnFirstEl } from '@/common/utils';\nimport { DtLazyShow } from '@/components/lazy_show';\nimport ModalMixin from '@/common/mixins/modal';\nimport { createTippyPopover, getPopperOptions } from './tippy_utils';\nimport PopoverHeaderFooter from './popover_header_footer.vue';\nimport SrOnlyCloseButton from '@/common/sr_only_close_button.vue';\n\n/**\n * A Popover displays a content overlay when its anchor element is activated.\n * @see https://dialtone.dialpad.com/components/popover.html\n */\nexport default {\n compatConfig: { MODE: 3 },\n name: 'DtPopover',\n\n /********************\n * CHILD COMPONENTS *\n ********************/\n components: {\n SrOnlyCloseButton,\n DtLazyShow,\n PopoverHeaderFooter,\n },\n\n mixins: [ModalMixin],\n\n props: {\n /**\n * Controls whether the popover is shown. Leaving this null will have the popover trigger on click by default.\n * If you set this value, the default trigger behavior will be disabled, and you can control it as you need.\n * Supports v-model\n * @values null, true, false\n */\n open: {\n type: Boolean,\n default: null,\n },\n\n /**\n * Opens the popover on right click (context menu). If you set this value to `true`,\n * the default trigger behavior will be disabled.\n * @values true, false\n */\n openOnContext: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Element type (tag name) of the root element of the component.\n */\n elementType: {\n type: String,\n default: 'div',\n },\n\n /**\n * Named transition when the content display is toggled.\n * @see DtLazyShow\n */\n transition: {\n type: String,\n default: 'fade',\n },\n\n /**\n * ARIA role for the content of the popover. Defaults to \"dialog\".\n * <a class=\"d-link\" href=\"https://www.w3.org/TR/wai-aria/#aria-haspopup\" target=\"_blank\">aria-haspopup</a>\n */\n role: {\n type: String,\n default: 'dialog',\n validator: (role) => {\n return POPOVER_ROLES.includes(role);\n },\n },\n\n /**\n * ID of the element that serves as the label for the popover content.\n * Defaults to the \"anchor\" element; this exists to provide a different\n * ID of the label element if, for example, the anchor slot contains\n * other items that do not serve as a label. You should provide this\n * or ariaLabel, but not both.\n */\n ariaLabelledby: {\n type: String,\n default: null,\n },\n\n /**\n * Descriptive label for the popover content. You should provide this\n * or ariaLabelledby, but not both.\n */\n ariaLabel: {\n type: String,\n default: null,\n },\n\n /**\n * Padding size class for the popover content.\n * @values none, small, medium, large\n */\n padding: {\n type: String,\n default: 'large',\n validator: (padding) => {\n return Object.keys(POPOVER_PADDING_CLASSES).some((item) => item === padding);\n },\n },\n\n /**\n * Additional class name for the content wrapper element.\n */\n contentClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Width configuration for the popover content. When its value is 'anchor',\n * the popover content will have the same width as the anchor.\n * @values null, anchor\n */\n contentWidth: {\n type: String,\n default: '',\n validator: contentWidth => POPOVER_CONTENT_WIDTHS.includes(contentWidth),\n },\n\n /**\n * Whether to apply transition on initial render in the content lazy show component.\n */\n contentAppear: {\n type: Boolean,\n default: null,\n },\n\n /**\n * Tabindex value for the content. Passing null, no tabindex attribute will be set.\n */\n contentTabindex: {\n type: Number || null,\n default: -1,\n },\n\n /**\n * External anchor id to use in those cases the anchor can't be provided via the slot.\n * For instance, using the combobox's input as the anchor for the popover.\n */\n externalAnchor: {\n type: String,\n default: '',\n },\n\n /**\n * The id of the tooltip\n */\n id: {\n type: String,\n default () { return getUniqueString(); },\n },\n\n /**\n * Displaces the content box from its anchor element\n * by the specified number of pixels.\n * <a\n * class=\"d-link\"\n * href=\"https://atomiks.github.io/tippyjs/v6/all-props/#offset\"\n * target=\"_blank\"\n * >\n * Tippy.js docs\n * </a>\n */\n offset: {\n type: Array,\n default: () => [0, 4],\n },\n\n /**\n * Determines if the popover hides upon clicking the\n * anchor or outside the content box.\n * @values true, false\n */\n hideOnClick: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Determines modal state. If enabled popover has a modal overlay\n * preventing interaction with elements below it, but it is invisible.\n * @values true, false\n */\n modal: {\n type: Boolean,\n default: true,\n },\n\n /**\n * If the popover does not fit in the direction described by \"placement\",\n * it will attempt to change its direction to the \"fallbackPlacements\".\n * <a\n * class=\"d-link\"\n * href=\"https://popper.js.org/docs/v2/modifiers/flip/#fallbackplacements\"\n * target=\"_blank\"\n * >\n * Popper.js docs\n * </a>\n * */\n fallbackPlacements: {\n type: Array,\n default: () => {\n return ['auto'];\n },\n },\n\n /**\n * The direction the popover displays relative to the anchor.\n * <a\n * class=\"d-link\"\n * href=\"https://atomiks.github.io/tippyjs/v6/all-props/#placement\"\n * target=\"_blank\"\n * >\n * Tippy.js docs\n * </a>\n * @values top, top-start, top-end,\n * right, right-start, right-end,\n * left, left-start, left-end,\n * bottom, bottom-start, bottom-end,\n * auto, auto-start, auto-end\n */\n placement: {\n type: String,\n default: 'bottom-end',\n },\n\n /**\n * If set to false the dialog will display over top of the anchor when there is insufficient space.\n * If set to true it will never move from its position relative to the anchor and will clip instead.\n * <a\n * class=\"d-link\"\n * href=\"https://popper.js.org/docs/v2/modifiers/prevent-overflow/#tether\"\n * target=\"_blank\"\n * >\n * Popper.js docs\n * </a>\n * @values true, false\n */\n tether: {\n type: Boolean,\n default: true,\n },\n\n /**\n * If the popover sticks to the anchor. This is usually not needed, but can be needed\n * if the reference element's position is animating, or to automatically update the popover\n * position in those cases the DOM layout changes the reference element's position.\n * `true` enables it, `reference` only checks the \"reference\" rect for changes and `popper` only\n * checks the \"popper\" rect for changes.\n * <a\n * class=\"d-link\"\n * href=\"https://atomiks.github.io/tippyjs/v6/all-props/#sticky\"\n * target=\"_blank\"\n * >\n * Tippy.js docs\n * </a>\n * @values true, false, reference, popper\n */\n sticky: {\n type: [Boolean, String],\n default: false,\n validator: (sticky) => {\n return POPOVER_STICKY_VALUES.includes(sticky);\n },\n },\n\n /**\n * Determines maximum height for the popover before overflow.\n * Possible units rem|px|em\n */\n maxHeight: {\n type: String,\n default: '',\n },\n\n /**\n * Determines maximum width for the popover before overflow.\n * Possible units rem|px|%|em\n */\n maxWidth: {\n type: String,\n default: '',\n },\n\n /**\n * Determines visibility for close button\n * @values true, false\n */\n showCloseButton: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Additional class name for the header content wrapper element.\n */\n headerClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Additional class name for the footer content wrapper element.\n */\n footerClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Additional class name for the dialog element.\n */\n dialogClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * The element that is focused when the popover is opened. This can be an\n * HTMLElement within the popover, a string starting with '#' which will\n * find the element by ID. 'first' which will automatically focus\n * the first element, or 'dialog' which will focus the dialog window itself.\n * If the dialog is modal this prop cannot be 'none'.\n * @values none, dialog, first\n */\n initialFocusElement: {\n type: [String, HTMLElement],\n default: 'first',\n validator: initialFocusElement => {\n return POPOVER_INITIAL_FOCUS_STRINGS.includes(initialFocusElement) ||\n (initialFocusElement instanceof HTMLElement) ||\n initialFocusElement.startsWith('#');\n },\n },\n\n /**\n * If the popover should open pressing up or down arrow key on the anchor element.\n * This can be set when not passing open prop.\n * @values true, false\n */\n openWithArrowKeys: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Sets the element to which the popover is going to append to.\n * 'body' will append to the nearest body (supports shadow DOM).\n * 'root' will try append to the iFrame's parent body if it is contained in an iFrame\n * and has permissions to access it, else, it'd default to 'parent'.\n * @values 'body', 'parent', 'root', HTMLElement\n */\n appendTo: {\n type: [HTMLElement, String],\n default: 'body',\n validator: appendTo => {\n return POPOVER_APPEND_TO_VALUES.includes(appendTo) ||\n (appendTo instanceof HTMLElement);\n },\n },\n },\n\n emits: [\n /**\n * Native keydown event\n *\n * @event keydown\n * @type {KeyboardEvent}\n */\n 'keydown',\n\n /**\n * Event fired to sync the open prop with the parent component\n * @event update:open\n */\n 'update:open',\n\n /**\n * Emitted when popover is shown or hidden\n *\n * @event opened\n * @type {Boolean | Array}\n */\n 'opened',\n\n /**\n * Emitted when the mouse enters the popover\n *\n * @event mouseenter-popover\n */\n 'mouseenter-popover',\n\n /**\n * Emitted when the mouse leaves the popover\n *\n * @event mouseleave-popover\n */\n 'mouseleave-popover',\n\n /**\n * Emitted when the mouse enters the popover anchor\n *\n * @event mouseenter-popover-anchor\n */\n 'mouseenter-popover-anchor',\n\n /**\n * Emitted when the mouse leaves the popover anchor\n *\n * @event mouseleave-popover-anchor\n */\n 'mouseleave-popover-anchor',\n ],\n\n data () {\n return {\n POPOVER_PADDING_CLASSES,\n POPOVER_HEADER_FOOTER_PADDING_CLASSES,\n intersectionObserver: null,\n isOutsideViewport: false,\n isOpen: false,\n toAppear: false,\n anchorEl: null,\n popoverContentEl: null,\n hasSlotContent,\n };\n },\n\n computed: {\n popoverListeners () {\n return {\n keydown: event => {\n this.onKeydown(event);\n },\n\n 'after-leave': () => {\n this.onLeaveTransitionComplete();\n },\n\n 'after-enter': () => {\n this.onEnterTransitionComplete();\n },\n };\n },\n\n calculatedMaxHeight () {\n if (this.isOutsideViewport && this.modal) {\n return `calc(100vh - var(--dt-space-300))`;\n }\n return this.maxHeight;\n },\n\n labelledBy () {\n // aria-labelledby should be set only if aria-labelledby is passed as a prop, or if\n // there is no aria-label and the labelledby should point to the anchor.\n return this.ariaLabelledby || (!this.ariaLabel && getUniqueString('DtPopover__anchor'));\n },\n },\n\n watch: {\n $props: {\n immediate: true,\n deep: true,\n handler () {\n this.validateProps();\n },\n },\n\n modal (modal) {\n this.tip?.setProps({\n zIndex: modal ? 650 : this.calculateAnchorZindex(),\n });\n },\n\n offset (offset) {\n this.tip?.setProps({\n offset,\n });\n },\n\n sticky (sticky) {\n this.tip?.setProps({\n sticky,\n });\n },\n\n fallbackPlacements () {\n this.tip?.setProps({\n popperOptions: this.popperOptions(),\n });\n },\n\n tether () {\n this.tip?.setProps({\n popperOptions: this.popperOptions(),\n });\n },\n\n placement (placement) {\n this.tip?.setProps({\n placement,\n });\n },\n\n open: {\n handler: function (open) {\n if (open !== null) {\n this.isOpen = open;\n }\n if (open === true) {\n this.toAppear = true;\n }\n },\n\n immediate: true,\n },\n\n contentAppear: {\n handler: function (contentAppear) {\n if (contentAppear !== null) {\n this.toAppear = contentAppear;\n }\n },\n },\n\n isOpen (isOpen, isPrev) {\n if (isOpen) {\n this.initTippyInstance();\n this.tip.show();\n } else if (!isOpen && isPrev !== isOpen) {\n this.removeEventListeners();\n this.tip.hide();\n }\n },\n },\n\n mounted () {\n warnIfUnmounted(returnFirstEl(this.$el), this.$options.name);\n\n const externalAnchorEl = this.externalAnchor\n ? this.$refs.anchor.getRootNode().querySelector(`#${this.externalAnchor}`)\n : null;\n this.anchorEl = externalAnchorEl ?? this.$refs.anchor.children[0];\n this.popoverContentEl = returnFirstEl(this.$refs.content?.$el);\n\n if (this.isOpen) {\n this.initTippyInstance();\n this.tip.show();\n }\n\n // rootMargin here must be greater than the margin of the height we are setting in calculatedMaxHeight which\n // currently is var(--dt-space-300) (4px). If not the intersectionObserver will continually trigger in an infinite\n // loop.\n // threshold 1.0 makes this trigger every time the dialog \"touches\" the edge of the viewport.\n this.intersectionObserver = new IntersectionObserver(this.hasIntersectedViewport);\n this.intersectionObserver.observe(this.popoverContentEl);\n },\n\n beforeUnmount () {\n this.tip?.destroy();\n this.intersectionObserver?.disconnect();\n this.removeReferences();\n this.removeEventListeners();\n },\n\n /******************\n * METHODS *\n ******************/\n methods: {\n\n hasIntersectedViewport (entries) {\n const dialog = entries?.[0]?.target;\n if (!dialog) return;\n const isOut = isOutOfViewPort(dialog);\n this.isOutsideViewport = isOut.bottom || isOut.top;\n },\n\n popperOptions () {\n return getPopperOptions({\n fallbackPlacements: this.fallbackPlacements,\n tether: this.tether,\n hasHideModifierEnabled: true,\n });\n },\n\n validateProps () {\n if (this.modal && this.initialFocusElement === 'none') {\n console.error('If the popover is modal you must set the ' +\n 'initialFocusElement prop. Possible values: \"dialog\", \"first\", HTMLElement');\n }\n },\n\n calculateAnchorZindex () {\n // if a modal is currently active render at modal-element z-index, otherwise at popover z-index\n if (returnFirstEl(this.$el).getRootNode()\n .querySelector('.d-modal[aria-hidden=\"false\"], .d-modal--transparent[aria-hidden=\"false\"]') ||\n // Special case because we don't have any dialtone drawer component yet. Render at 650 when\n // anchor of popover is within a drawer.\n this.anchorEl?.closest('.d-zi-drawer')) {\n return 650;\n } else {\n return 300;\n }\n },\n\n defaultToggleOpen (e) {\n if (this.openOnContext) { return; }\n\n // Only use default toggle behaviour if the user has not set the open prop.\n // Check that the anchor element specifically was clicked.\n if (this.open === null || this.open === undefined) {\n if ((!this.anchorEl?.contains(e.target) && !this.anchorEl?.isEqualNode(e.target)) || this.anchorEl?.disabled) {\n return;\n }\n\n this.toggleOpen();\n }\n },\n\n async onContext (event) {\n if (!this.openOnContext) { return; }\n\n event.preventDefault();\n\n this.isOpen = true;\n await this.$nextTick();\n this.tip.setProps({\n placement: 'right-start',\n getReferenceClientRect: () => ({\n width: 0,\n height: 0,\n top: event.clientY,\n bottom: event.clientY,\n left: event.clientX,\n right: event.clientX,\n }),\n });\n },\n\n toggleOpen () {\n this.isOpen = !this.isOpen;\n },\n\n onArrowKeyPress (e) {\n if (this.open !== null) { return; }\n if (this.openWithArrowKeys && this.anchorEl?.contains(e.target)) {\n if (!this.isOpen) {\n this.isOpen = true;\n }\n }\n\n this.$emit('keydown', e);\n },\n\n addEventListeners () {\n window.addEventListener('dt-popover-close', this.closePopover);\n // align popover content width when contentWidth is 'anchor'\n if (this.contentWidth === 'anchor') {\n window.addEventListener('resize', this.onResize);\n }\n },\n\n removeEventListeners () {\n window.removeEventListener('dt-popover-close', this.closePopover);\n if (this.contentWidth === 'anchor') {\n window.removeEventListener('resize', this.onResize);\n }\n },\n\n closePopover () {\n this.isOpen = false;\n },\n\n /*\n * Prevents scrolling outside of the currently opened modal popover by:\n * - when anchor is not within another popover: setting the body to overflow: hidden\n * - when anchor is within another popover: set the popover dialog container to it's non-modal z-index\n * since it is no longer the active modal. This puts it underneath the overlay and prevents scrolling.\n **/\n preventScrolling () {\n if (this.modal) {\n const element = this.anchorEl?.closest('body, .tippy-box');\n if (!element) return;\n if (element.tagName?.toLowerCase() === 'body') {\n disableRootScrolling(this.anchorEl.getRootNode().host);\n this.tip.setProps({ offset: this.offset });\n } else {\n element.classList.add('d-zi-popover');\n }\n }\n },\n\n /*\n * Resets the prevent scrolling properties set in preventScrolling() back to normal.\n **/\n enableScrolling () {\n const element = this.anchorEl?.closest('body, .tippy-box');\n if (!element) return;\n if (element.tagName?.toLowerCase() === 'body') {\n enableRootScrolling(this.anchorEl.getRootNode().host);\n this.tip.setProps({ offset: this.offset });\n } else {\n element.classList.remove('d-zi-popover');\n }\n },\n\n removeReferences () {\n this.anchorEl = null;\n this.popoverContentEl = null;\n this.tip = null;\n },\n\n async onShow () {\n if (this.contentWidth === 'anchor') {\n await this.setPopoverContentAnchorWidth();\n }\n\n if (this.contentWidth === null) {\n this.popoverContentEl.style.width = 'auto';\n }\n\n this.addEventListeners();\n },\n\n async onLeaveTransitionComplete () {\n if (this.modal) {\n await this.focusFirstElement(this.$refs.anchor);\n // await next tick in case the user wants to change focus themselves.\n await this.$nextTick();\n this.enableScrolling();\n }\n this.tip?.unmount();\n this.$emit('opened', false);\n if (this.open !== null) {\n this.$emit('update:open', false);\n }\n },\n\n async onEnterTransitionComplete () {\n this.focusInitialElement();\n // await next tick in case the user wants to change focus themselves.\n await this.$nextTick();\n this.preventScrolling();\n this.$emit('opened', true, this.$refs.popover__content);\n if (this.open !== null) {\n this.$emit('update:open', true);\n }\n },\n\n focusInitialElement () {\n if (this.initialFocusElement === 'dialog') {\n returnFirstEl(this.$refs.content?.$el)?.focus();\n }\n // find by ID\n if (this.initialFocusElement.startsWith('#')) {\n this.focusInitialElementById();\n }\n if (this.initialFocusElement === 'first') {\n this.focusFirstElementIfNeeded(this.$refs.popover__content);\n }\n if (this.initialFocusElement instanceof HTMLElement) {\n this.initialFocusElement.focus();\n }\n },\n\n focusInitialElementById () {\n const result = returnFirstEl(this.$refs.content?.$el)?.querySelector(this.initialFocusElement);\n if (result) {\n result.focus();\n } else {\n console.warn('Could not find the element specified in dt-popover prop \"initialFocusElement\". ' +\n 'Defaulting to focusing the dialog.');\n }\n result ? result.focus() : returnFirstEl(this.$refs.content?.$el).focus();\n },\n\n onResize () {\n this.closePopover();\n },\n\n onClickOutside () {\n if (!this.hideOnClick) return;\n // If a popover is opened inside of this one, do not hide on click out\n const innerModals = this.popoverContentEl?.querySelector('.d-popover__anchor--opened');\n if (!innerModals) {\n this.closePopover();\n }\n },\n\n onKeydown (e) {\n if (e.key === 'Tab') {\n if (this.modal) {\n this.focusTrappedTabPress(e, this.popoverContentEl);\n }\n }\n if (e.key === 'Escape') {\n this.closePopover();\n }\n\n this.$emit('keydown', e);\n },\n\n async setPopoverContentAnchorWidth () {\n await this.$nextTick();\n this.popoverContentEl.style.width = `${this.anchorEl?.clientWidth}px`;\n },\n\n focusFirstElementIfNeeded (domEl) {\n const focusableElements = this._getFocusableElements(domEl, true);\n if (focusableElements.length !== 0) {\n this.focusFirstElement(domEl);\n } else if (this.showCloseButton) {\n this.$refs.popover__header?.focusCloseButton();\n } else {\n // if there are no focusable elements at all focus the dialog itself\n returnFirstEl(this.$refs.content?.$el).focus();\n }\n },\n\n /**\n * Return's the anchor ClientRect object relative to the window.\n * Refer to: https://atomiks.github.io/tippyjs/v6/all-props/#getreferenceclientrect for more information\n * @param error\n */\n getReferenceClientRect (error) {\n const anchorReferenceRect = this.anchorEl?.getBoundingClientRect();\n\n if (this.appendTo !== 'root' || error) return anchorReferenceRect;\n\n const anchorOwnerDocument = this.anchorEl?.ownerDocument;\n const anchorParentWindow = anchorOwnerDocument?.defaultView || anchorOwnerDocument?.parentWindow;\n const anchorIframe = anchorParentWindow?.frameElement;\n\n if (!anchorIframe) return anchorReferenceRect;\n\n const iframeReferenceRect = anchorIframe.getBoundingClientRect();\n\n return {\n width: anchorReferenceRect?.width,\n height: anchorReferenceRect?.height,\n top: iframeReferenceRect?.top + anchorReferenceRect?.top,\n left: iframeReferenceRect?.left + anchorReferenceRect?.left,\n right: iframeReferenceRect?.right + anchorReferenceRect?.right,\n bottom: iframeReferenceRect?.bottom + anchorReferenceRect?.bottom,\n };\n },\n\n initTippyInstance () {\n let internalAppendTo = null;\n let iFrameError = false;\n\n switch (this.appendTo) {\n case 'body':\n internalAppendTo = this.anchorEl?.getRootNode()?.querySelector('body');\n break;\n\n case 'root':\n // Try to attach the popover to root document, fallback to parent is fail\n try {\n internalAppendTo = window.parent.document.body;\n } catch (err) {\n console.error('Could not attach the popover to iframe parent window: ', err);\n internalAppendTo = 'parent';\n iFrameError = true;\n }\n break;\n\n default:\n internalAppendTo = this.appendTo;\n break;\n }\n\n this.tip = createTippyPopover(this.anchorEl, {\n popperOptions: this.popperOptions(),\n contentElement: this.popoverContentEl,\n placement: this.placement,\n offset: this.offset,\n sticky: this.sticky,\n appendTo: internalAppendTo,\n interactive: true,\n trigger: 'manual',\n getReferenceClientRect: () => this.getReferenceClientRect(iFrameError),\n // We have to manage hideOnClick functionality manually to handle\n // popover within popover situations.\n hideOnClick: false,\n zIndex: this.modal ? 650 : this.calculateAnchorZindex(),\n onClickOutside: this.onClickOutside,\n onShow: this.onShow,\n });\n },\n\n onMouseEnter () {\n this.$emit('mouseenter-popover');\n },\n\n onMouseLeave () {\n this.$emit('mouseleave-popover');\n },\n\n onMouseEnterAnchor () {\n this.$emit('mouseenter-popover-anchor');\n },\n\n onMouseLeaveAnchor () {\n this.$emit('mouseleave-popover-anchor');\n },\n },\n};\n</script>\n"],"names":["_sfc_main","SrOnlyCloseButton","DtLazyShow","PopoverHeaderFooter","ModalMixin","role","POPOVER_ROLES","padding","POPOVER_PADDING_CLASSES","item","contentWidth","POPOVER_CONTENT_WIDTHS","getUniqueString","sticky","POPOVER_STICKY_VALUES","initialFocusElement","POPOVER_INITIAL_FOCUS_STRINGS","appendTo","POPOVER_APPEND_TO_VALUES","POPOVER_HEADER_FOOTER_PADDING_CLASSES","hasSlotContent","event","modal","_a","offset","placement","open","contentAppear","isOpen","isPrev","warnIfUnmounted","returnFirstEl","externalAnchorEl","_b","entries","dialog","isOut","isOutOfViewPort","getPopperOptions","_c","element","disableRootScrolling","enableRootScrolling","result","domEl","error","anchorReferenceRect","anchorOwnerDocument","anchorParentWindow","anchorIframe","iframeReferenceRect","internalAppendTo","iFrameError","err","createTippyPopover","_hoisted_1","_hoisted_2","_createElementBlock","$props","$data","_createBlock","_Teleport","_createElementVNode","_cache","_withModifiers","_createCommentVNode","_resolveDynamicComponent","_normalizeClass","_withCtx","$options","_ctx","args","_withKeys","$event","_renderSlot","_createVNode","_component_dt_lazy_show","_mergeProps","_toHandlers","_component_popover_header_footer","_component_sr_only_close_button"],"mappings":";;;;;;;;;AAkJA,MAAKA,IAAU;AAAA,EACb,cAAc,EAAE,MAAM;EACtB,MAAM;AAAA;AAAA;AAAA;AAAA,EAKN,YAAY;AAAA,IACV,mBAAAC;AAAA,IACA,YAAAC;AAAA,IACA,qBAAAC;AAAA;EAGF,QAAQ,CAACC,CAAU;AAAA,EAEnB,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOL,MAAM;AAAA,MACJ,MAAM;AAAA,MACN,SAAS;AAAA;;;;;;IAQX,eAAe;AAAA,MACb,MAAM;AAAA,MACN,SAAS;AAAA;;;;IAMX,aAAa;AAAA,MACX,MAAM;AAAA,MACN,SAAS;AAAA;;;;;IAOX,YAAY;AAAA,MACV,MAAM;AAAA,MACN,SAAS;AAAA;;;;;IAOX,MAAM;AAAA,MACJ,MAAM;AAAA,MACN,SAAS;AAAA,MACT,WAAW,CAACC,MACHC,EAAc,SAASD,CAAI;AAAA;;;;;;;;IAWtC,gBAAgB;AAAA,MACd,MAAM;AAAA,MACN,SAAS;AAAA;;;;;IAOX,WAAW;AAAA,MACT,MAAM;AAAA,MACN,SAAS;AAAA;;;;;IAOX,SAAS;AAAA,MAC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eW,EAAA,OAAO,aAAa,UAD3CV,EAcwBmB,GAAA;AAAA,cAlHhC,KAAA;AAAA,cAsGU,KAAI;AAAA,cACJ,MAAK;AAAA,cACJ,OAxGXZ,EAwGkBR,EAAA,sCAAsCD,EAAA,OAAO,CAAA;AAAA,cACpD,iBAAeA,EAAA;AAAA;cAEL,WAET,MAGE;AAAA,gBAHFgB,EAGEJ,EAAA,QAAA,iBAAA,EADC,OAAOD,EAAA,aAAY,CAAA;AAAA;cA/GlC,GAAA;AAAA,iDAAAJ,EAAA,IAAA,EAAA;AAAA,YAoHiBP,EAAA,kBApHjBO,EAAA,IAAA,EAAA,UAmHQL,EAGEoB,GAAA;AAAA,cAtHV,KAAA;AAAA,cAqHW,SAAOX,EAAA;AAAA;;UArHlB,GAAA;AAAA;;MAAA,GAAA;AAAA;;;;"}
|
|
1
|
+
{"version":3,"file":"popover.js","sources":["../../../components/popover/popover.vue"],"sourcesContent":["<!-- eslint-disable vuejs-accessibility/mouse-events-have-key-events -->\n<template>\n <div>\n <Teleport\n v-if=\"modal && isOpen\"\n to=\"body\"\n >\n <div\n class=\"d-modal--transparent\"\n aria-hidden=\"false\"\n @click.prevent.stop\n />\n </Teleport>\n <component\n :is=\"elementType\"\n ref=\"popover\"\n :class=\"['d-popover', { 'd-popover__anchor--opened': isOpen }]\"\n data-qa=\"dt-popover-container\"\n >\n <!-- eslint-disable-next-line vuejs-accessibility/no-static-element-interactions -->\n <div\n :id=\"!ariaLabelledby && labelledBy\"\n ref=\"anchor\"\n :data-qa=\"$attrs['data-qa'] ? `${$attrs['data-qa']}-anchor` : 'dt-popover-anchor'\"\n :tabindex=\"openOnContext ? 0 : undefined\"\n @click.capture=\"defaultToggleOpen\"\n @contextmenu=\"onContext\"\n @keydown.up.prevent=\"onArrowKeyPress\"\n @keydown.down.prevent=\"onArrowKeyPress\"\n @keydown.escape.capture=\"closePopover\"\n @keydown.enter=\"$emit('keydown', $event)\"\n @keydown.space=\"$emit('keydown', $event)\"\n @mouseenter=\"onMouseEnter\"\n @mouseleave=\"onMouseLeave\"\n >\n <!-- @slot Anchor element that activates the popover. Usually a button. -->\n <slot\n name=\"anchor\"\n :attrs=\"{\n 'aria-expanded': isOpen.toString(),\n 'aria-controls': id,\n 'aria-haspopup': role,\n }\"\n />\n </div>\n <dt-lazy-show\n :id=\"id\"\n ref=\"content\"\n :role=\"role\"\n :data-qa=\"$attrs['data-qa'] ? `${$attrs['data-qa']}__dialog` : 'dt-popover'\"\n :aria-hidden=\"`${!isOpen}`\"\n :aria-labelledby=\"labelledBy\"\n :aria-label=\"ariaLabel\"\n :aria-modal=\"`${!modal}`\"\n :transition=\"transition\"\n :show=\"isOpen\"\n :appear=\"toAppear\"\n :class=\"['d-popover__dialog', { 'd-popover__dialog--modal': modal }, dialogClass]\"\n :style=\"{\n 'max-height': calculatedMaxHeight,\n 'max-width': maxWidth,\n }\"\n :css=\"$attrs.css\"\n :tabindex=\"contentTabindex\"\n v-on=\"popoverListeners\"\n @mouseenter=\"onMouseEnterAnchor\"\n @mouseleave=\"onMouseLeaveAnchor\"\n >\n <popover-header-footer\n v-if=\"hasSlotContent($slots.headerContent) || showCloseButton\"\n ref=\"popover__header\"\n :class=\"POPOVER_HEADER_FOOTER_PADDING_CLASSES[padding]\"\n :content-class=\"headerClass\"\n type=\"header\"\n :show-close-button=\"showCloseButton\"\n @close=\"closePopover\"\n >\n <template #content>\n <!-- @slot Slot for popover header content -->\n <slot\n name=\"headerContent\"\n :close=\"closePopover\"\n />\n </template>\n </popover-header-footer>\n <div\n ref=\"popover__content\"\n :data-qa=\"$attrs['data-qa'] ? `${$attrs['data-qa']}-content` : 'dt-popover-content'\"\n :class=\"[\n 'd-popover__content',\n POPOVER_PADDING_CLASSES[padding],\n contentClass,\n ]\"\n >\n <!-- @slot Slot for the content that is displayed in the popover when it is open. -->\n <slot\n name=\"content\"\n :close=\"closePopover\"\n />\n </div>\n <popover-header-footer\n v-if=\"hasSlotContent($slots.footerContent)\"\n ref=\"popover__footer\"\n type=\"footer\"\n :class=\"POPOVER_HEADER_FOOTER_PADDING_CLASSES[padding]\"\n :content-class=\"footerClass\"\n >\n <template #content>\n <!-- @slot Slot for the footer content. -->\n <slot\n name=\"footerContent\"\n :close=\"closePopover\"\n />\n </template>\n </popover-header-footer>\n <sr-only-close-button\n v-if=\"!showCloseButton\"\n @close=\"closePopover\"\n />\n </dt-lazy-show>\n </component>\n </div>\n</template>\n\n<script>\n/* eslint-disable max-lines */\nimport {\n POPOVER_APPEND_TO_VALUES,\n POPOVER_CONTENT_WIDTHS,\n POPOVER_HEADER_FOOTER_PADDING_CLASSES,\n POPOVER_INITIAL_FOCUS_STRINGS,\n POPOVER_PADDING_CLASSES,\n POPOVER_ROLES,\n POPOVER_STICKY_VALUES,\n} from './popover_constants';\nimport { getUniqueString, hasSlotContent, isOutOfViewPort, warnIfUnmounted, disableRootScrolling, enableRootScrolling, returnFirstEl } from '@/common/utils';\nimport { DtLazyShow } from '@/components/lazy_show';\nimport ModalMixin from '@/common/mixins/modal';\nimport { createTippyPopover, getPopperOptions } from './tippy_utils';\nimport PopoverHeaderFooter from './popover_header_footer.vue';\nimport SrOnlyCloseButton from '@/common/sr_only_close_button.vue';\n\n/**\n * A Popover displays a content overlay when its anchor element is activated.\n * @see https://dialtone.dialpad.com/components/popover.html\n */\nexport default {\n compatConfig: { MODE: 3 },\n name: 'DtPopover',\n\n /********************\n * CHILD COMPONENTS *\n ********************/\n components: {\n SrOnlyCloseButton,\n DtLazyShow,\n PopoverHeaderFooter,\n },\n\n mixins: [ModalMixin],\n\n props: {\n /**\n * Controls whether the popover is shown. Leaving this null will have the popover trigger on click by default.\n * If you set this value, the default trigger behavior will be disabled, and you can control it as you need.\n * Supports v-model\n * @values null, true, false\n */\n open: {\n type: Boolean,\n default: null,\n },\n\n /**\n * Opens the popover on right click (context menu). If you set this value to `true`,\n * the default trigger behavior will be disabled.\n * @values true, false\n */\n openOnContext: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Element type (tag name) of the root element of the component.\n */\n elementType: {\n type: String,\n default: 'div',\n },\n\n /**\n * Named transition when the content display is toggled.\n * @see DtLazyShow\n */\n transition: {\n type: String,\n default: 'fade',\n },\n\n /**\n * ARIA role for the content of the popover. Defaults to \"dialog\".\n * <a class=\"d-link\" href=\"https://www.w3.org/TR/wai-aria/#aria-haspopup\" target=\"_blank\">aria-haspopup</a>\n */\n role: {\n type: String,\n default: 'dialog',\n validator: (role) => {\n return POPOVER_ROLES.includes(role);\n },\n },\n\n /**\n * ID of the element that serves as the label for the popover content.\n * Defaults to the \"anchor\" element; this exists to provide a different\n * ID of the label element if, for example, the anchor slot contains\n * other items that do not serve as a label. You should provide this\n * or ariaLabel, but not both.\n */\n ariaLabelledby: {\n type: String,\n default: null,\n },\n\n /**\n * Descriptive label for the popover content. You should provide this\n * or ariaLabelledby, but not both.\n */\n ariaLabel: {\n type: String,\n default: null,\n },\n\n /**\n * Padding size class for the popover content.\n * @values none, small, medium, large\n */\n padding: {\n type: String,\n default: 'large',\n validator: (padding) => {\n return Object.keys(POPOVER_PADDING_CLASSES).some((item) => item === padding);\n },\n },\n\n /**\n * Additional class name for the content wrapper element.\n */\n contentClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Width configuration for the popover content. When its value is 'anchor',\n * the popover content will have the same width as the anchor.\n * @values null, anchor\n */\n contentWidth: {\n type: String,\n default: '',\n validator: contentWidth => POPOVER_CONTENT_WIDTHS.includes(contentWidth),\n },\n\n /**\n * Whether to apply transition on initial render in the content lazy show component.\n */\n contentAppear: {\n type: Boolean,\n default: null,\n },\n\n /**\n * Tabindex value for the content. Passing null, no tabindex attribute will be set.\n */\n contentTabindex: {\n type: Number || null,\n default: -1,\n },\n\n /**\n * External anchor id to use in those cases the anchor can't be provided via the slot.\n * For instance, using the combobox's input as the anchor for the popover.\n */\n externalAnchor: {\n type: String,\n default: '',\n },\n\n /**\n * The id of the tooltip\n */\n id: {\n type: String,\n default () { return getUniqueString(); },\n },\n\n /**\n * Displaces the content box from its anchor element\n * by the specified number of pixels.\n * <a\n * class=\"d-link\"\n * href=\"https://atomiks.github.io/tippyjs/v6/all-props/#offset\"\n * target=\"_blank\"\n * >\n * Tippy.js docs\n * </a>\n */\n offset: {\n type: Array,\n default: () => [0, 4],\n },\n\n /**\n * Determines if the popover hides upon clicking the\n * anchor or outside the content box.\n * @values true, false\n */\n hideOnClick: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Determines modal state. If enabled popover has a modal overlay\n * preventing interaction with elements below it, but it is invisible.\n * @values true, false\n */\n modal: {\n type: Boolean,\n default: true,\n },\n\n /**\n * If the popover does not fit in the direction described by \"placement\",\n * it will attempt to change its direction to the \"fallbackPlacements\".\n * <a\n * class=\"d-link\"\n * href=\"https://popper.js.org/docs/v2/modifiers/flip/#fallbackplacements\"\n * target=\"_blank\"\n * >\n * Popper.js docs\n * </a>\n * */\n fallbackPlacements: {\n type: Array,\n default: () => {\n return ['auto'];\n },\n },\n\n /**\n * The direction the popover displays relative to the anchor.\n * <a\n * class=\"d-link\"\n * href=\"https://atomiks.github.io/tippyjs/v6/all-props/#placement\"\n * target=\"_blank\"\n * >\n * Tippy.js docs\n * </a>\n * @values top, top-start, top-end,\n * right, right-start, right-end,\n * left, left-start, left-end,\n * bottom, bottom-start, bottom-end,\n * auto, auto-start, auto-end\n */\n placement: {\n type: String,\n default: 'bottom-end',\n },\n\n /**\n * If set to false the dialog will display over top of the anchor when there is insufficient space.\n * If set to true it will never move from its position relative to the anchor and will clip instead.\n * <a\n * class=\"d-link\"\n * href=\"https://popper.js.org/docs/v2/modifiers/prevent-overflow/#tether\"\n * target=\"_blank\"\n * >\n * Popper.js docs\n * </a>\n * @values true, false\n */\n tether: {\n type: Boolean,\n default: true,\n },\n\n /**\n * If the popover sticks to the anchor. This is usually not needed, but can be needed\n * if the reference element's position is animating, or to automatically update the popover\n * position in those cases the DOM layout changes the reference element's position.\n * `true` enables it, `reference` only checks the \"reference\" rect for changes and `popper` only\n * checks the \"popper\" rect for changes.\n * <a\n * class=\"d-link\"\n * href=\"https://atomiks.github.io/tippyjs/v6/all-props/#sticky\"\n * target=\"_blank\"\n * >\n * Tippy.js docs\n * </a>\n * @values true, false, reference, popper\n */\n sticky: {\n type: [Boolean, String],\n default: false,\n validator: (sticky) => {\n return POPOVER_STICKY_VALUES.includes(sticky);\n },\n },\n\n /**\n * Determines maximum height for the popover before overflow.\n * Possible units rem|px|em\n */\n maxHeight: {\n type: String,\n default: '',\n },\n\n /**\n * Determines maximum width for the popover before overflow.\n * Possible units rem|px|%|em\n */\n maxWidth: {\n type: String,\n default: '',\n },\n\n /**\n * Determines visibility for close button\n * @values true, false\n */\n showCloseButton: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Additional class name for the header content wrapper element.\n */\n headerClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Additional class name for the footer content wrapper element.\n */\n footerClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Additional class name for the dialog element.\n */\n dialogClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * The element that is focused when the popover is opened. This can be an\n * HTMLElement within the popover, a string starting with '#' which will\n * find the element by ID. 'first' which will automatically focus\n * the first element, or 'dialog' which will focus the dialog window itself.\n * If the dialog is modal this prop cannot be 'none'.\n * @values none, dialog, first\n */\n initialFocusElement: {\n type: [String, HTMLElement],\n default: 'first',\n validator: initialFocusElement => {\n return POPOVER_INITIAL_FOCUS_STRINGS.includes(initialFocusElement) ||\n (initialFocusElement instanceof HTMLElement) ||\n initialFocusElement.startsWith('#');\n },\n },\n\n /**\n * If the popover should open pressing up or down arrow key on the anchor element.\n * This can be set when not passing open prop.\n * @values true, false\n */\n openWithArrowKeys: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Sets the element to which the popover is going to append to.\n * 'body' will append to the nearest body (supports shadow DOM).\n * 'root' will try append to the iFrame's parent body if it is contained in an iFrame\n * and has permissions to access it, else, it'd default to 'parent'.\n * @values 'body', 'parent', 'root', HTMLElement\n */\n appendTo: {\n type: [HTMLElement, String],\n default: 'body',\n validator: appendTo => {\n return POPOVER_APPEND_TO_VALUES.includes(appendTo) ||\n (appendTo instanceof HTMLElement);\n },\n },\n },\n\n emits: [\n /**\n * Native keydown event\n *\n * @event keydown\n * @type {KeyboardEvent}\n */\n 'keydown',\n\n /**\n * Event fired to sync the open prop with the parent component\n * @event update:open\n */\n 'update:open',\n\n /**\n * Emitted when popover is shown or hidden\n *\n * @event opened\n * @type {Boolean | Array}\n */\n 'opened',\n\n /**\n * Emitted when the mouse enters the popover\n *\n * @event mouseenter-popover\n */\n 'mouseenter-popover',\n\n /**\n * Emitted when the mouse leaves the popover\n *\n * @event mouseleave-popover\n */\n 'mouseleave-popover',\n\n /**\n * Emitted when the mouse enters the popover anchor\n *\n * @event mouseenter-popover-anchor\n */\n 'mouseenter-popover-anchor',\n\n /**\n * Emitted when the mouse leaves the popover anchor\n *\n * @event mouseleave-popover-anchor\n */\n 'mouseleave-popover-anchor',\n ],\n\n data () {\n return {\n POPOVER_PADDING_CLASSES,\n POPOVER_HEADER_FOOTER_PADDING_CLASSES,\n intersectionObserver: null,\n isOutsideViewport: false,\n isOpen: false,\n toAppear: false,\n anchorEl: null,\n popoverContentEl: null,\n hasSlotContent,\n };\n },\n\n computed: {\n popoverListeners () {\n return {\n keydown: event => {\n this.onKeydown(event);\n },\n\n 'after-leave': () => {\n this.onLeaveTransitionComplete();\n },\n\n 'after-enter': () => {\n this.onEnterTransitionComplete();\n },\n };\n },\n\n calculatedMaxHeight () {\n if (this.isOutsideViewport && this.modal) {\n return `calc(100vh - var(--dt-space-300))`;\n }\n return this.maxHeight;\n },\n\n labelledBy () {\n // aria-labelledby should be set only if aria-labelledby is passed as a prop, or if\n // there is no aria-label and the labelledby should point to the anchor.\n return this.ariaLabelledby || (!this.ariaLabel && getUniqueString('DtPopover__anchor'));\n },\n },\n\n watch: {\n $props: {\n immediate: true,\n deep: true,\n handler () {\n this.validateProps();\n },\n },\n\n modal (modal) {\n this.tip?.setProps({\n zIndex: modal ? 650 : this.calculateAnchorZindex(),\n });\n },\n\n offset (offset) {\n this.tip?.setProps({\n offset,\n });\n },\n\n sticky (sticky) {\n this.tip?.setProps({\n sticky,\n });\n },\n\n fallbackPlacements () {\n this.tip?.setProps({\n popperOptions: this.popperOptions(),\n });\n },\n\n tether () {\n this.tip?.setProps({\n popperOptions: this.popperOptions(),\n });\n },\n\n placement (placement) {\n this.tip?.setProps({\n placement,\n });\n },\n\n open: {\n handler: function (open) {\n if (open !== null) {\n this.isOpen = open;\n }\n if (open === true) {\n this.toAppear = true;\n }\n },\n\n immediate: true,\n },\n\n contentAppear: {\n handler: function (contentAppear) {\n if (contentAppear !== null) {\n this.toAppear = contentAppear;\n }\n },\n },\n\n isOpen (isOpen, isPrev) {\n if (isOpen) {\n this.initTippyInstance();\n this.tip?.show();\n } else if (!isOpen && isPrev !== isOpen) {\n this.removeEventListeners();\n this.tip?.hide();\n }\n },\n },\n\n mounted () {\n warnIfUnmounted(returnFirstEl(this.$el), this.$options.name);\n\n const externalAnchorEl = this.externalAnchor\n ? this.$refs.anchor.getRootNode().querySelector(`#${this.externalAnchor}`)\n : null;\n this.anchorEl = externalAnchorEl ?? this.$refs.anchor.children[0];\n this.popoverContentEl = returnFirstEl(this.$refs.content?.$el);\n\n if (this.isOpen) {\n this.initTippyInstance();\n this.tip?.show();\n }\n\n // rootMargin here must be greater than the margin of the height we are setting in calculatedMaxHeight which\n // currently is var(--dt-space-300) (4px). If not the intersectionObserver will continually trigger in an infinite\n // loop.\n // threshold 1.0 makes this trigger every time the dialog \"touches\" the edge of the viewport.\n this.intersectionObserver = new IntersectionObserver(this.hasIntersectedViewport);\n this.intersectionObserver.observe(this.popoverContentEl);\n },\n\n beforeUnmount () {\n this.tip?.destroy();\n this.intersectionObserver?.disconnect();\n this.removeReferences();\n this.removeEventListeners();\n },\n\n /******************\n * METHODS *\n ******************/\n methods: {\n\n hasIntersectedViewport (entries) {\n const dialog = entries?.[0]?.target;\n if (!dialog) return;\n const isOut = isOutOfViewPort(dialog);\n this.isOutsideViewport = isOut.bottom || isOut.top;\n },\n\n popperOptions () {\n return getPopperOptions({\n fallbackPlacements: this.fallbackPlacements,\n tether: this.tether,\n hasHideModifierEnabled: true,\n });\n },\n\n validateProps () {\n if (this.modal && this.initialFocusElement === 'none') {\n console.error('If the popover is modal you must set the ' +\n 'initialFocusElement prop. Possible values: \"dialog\", \"first\", HTMLElement');\n }\n },\n\n calculateAnchorZindex () {\n // if a modal is currently active render at modal-element z-index, otherwise at popover z-index\n if (returnFirstEl(this.$el).getRootNode()\n .querySelector('.d-modal[aria-hidden=\"false\"], .d-modal--transparent[aria-hidden=\"false\"]') ||\n // Special case because we don't have any dialtone drawer component yet. Render at 650 when\n // anchor of popover is within a drawer.\n this.anchorEl?.closest('.d-zi-drawer')) {\n return 650;\n } else {\n return 300;\n }\n },\n\n defaultToggleOpen (e) {\n if (this.openOnContext) { return; }\n\n // Only use default toggle behaviour if the user has not set the open prop.\n // Check that the anchor element specifically was clicked.\n if (this.open === null || this.open === undefined) {\n if ((!this.anchorEl?.contains(e.target) && !this.anchorEl?.isEqualNode(e.target)) || this.anchorEl?.disabled) {\n return;\n }\n\n this.toggleOpen();\n }\n },\n\n async onContext (event) {\n if (!this.openOnContext) { return; }\n\n event.preventDefault();\n\n this.isOpen = true;\n await this.$nextTick();\n this.tip?.setProps({\n placement: 'right-start',\n getReferenceClientRect: () => ({\n width: 0,\n height: 0,\n top: event.clientY,\n bottom: event.clientY,\n left: event.clientX,\n right: event.clientX,\n }),\n });\n },\n\n toggleOpen () {\n this.isOpen = !this.isOpen;\n },\n\n onArrowKeyPress (e) {\n if (this.open !== null) { return; }\n if (this.openWithArrowKeys && this.anchorEl?.contains(e.target)) {\n if (!this.isOpen) {\n this.isOpen = true;\n }\n }\n\n this.$emit('keydown', e);\n },\n\n addEventListeners () {\n window.addEventListener('dt-popover-close', this.closePopover);\n // align popover content width when contentWidth is 'anchor'\n if (this.contentWidth === 'anchor') {\n window.addEventListener('resize', this.onResize);\n }\n },\n\n removeEventListeners () {\n window.removeEventListener('dt-popover-close', this.closePopover);\n if (this.contentWidth === 'anchor') {\n window.removeEventListener('resize', this.onResize);\n }\n },\n\n closePopover () {\n this.isOpen = false;\n },\n\n /*\n * Prevents scrolling outside of the currently opened modal popover by:\n * - when anchor is not within another popover: setting the body to overflow: hidden\n * - when anchor is within another popover: set the popover dialog container to it's non-modal z-index\n * since it is no longer the active modal. This puts it underneath the overlay and prevents scrolling.\n **/\n preventScrolling () {\n if (this.modal) {\n const element = this.anchorEl?.closest('body, .tippy-box');\n if (!element) return;\n if (element.tagName?.toLowerCase() === 'body') {\n disableRootScrolling(this.anchorEl.getRootNode().host);\n this.tip?.setProps({ offset: this.offset });\n } else {\n element.classList.add('d-zi-popover');\n }\n }\n },\n\n /*\n * Resets the prevent scrolling properties set in preventScrolling() back to normal.\n **/\n enableScrolling () {\n const element = this.anchorEl?.closest('body, .tippy-box');\n if (!element) return;\n if (element.tagName?.toLowerCase() === 'body') {\n enableRootScrolling(this.anchorEl.getRootNode().host);\n this.tip?.setProps({ offset: this.offset });\n } else {\n element.classList.remove('d-zi-popover');\n }\n },\n\n removeReferences () {\n this.anchorEl = null;\n this.popoverContentEl = null;\n this.tip = null;\n },\n\n async onShow () {\n if (this.contentWidth === 'anchor') {\n await this.setPopoverContentAnchorWidth();\n }\n\n if (this.contentWidth === null) {\n this.popoverContentEl.style.width = 'auto';\n }\n\n this.addEventListeners();\n },\n\n async onLeaveTransitionComplete () {\n if (this.modal) {\n await this.focusFirstElement(this.$refs.anchor);\n // await next tick in case the user wants to change focus themselves.\n await this.$nextTick();\n this.enableScrolling();\n }\n this.tip?.unmount();\n this.$emit('opened', false);\n if (this.open !== null) {\n this.$emit('update:open', false);\n }\n },\n\n async onEnterTransitionComplete () {\n this.focusInitialElement();\n // await next tick in case the user wants to change focus themselves.\n await this.$nextTick();\n this.preventScrolling();\n this.$emit('opened', true, this.$refs.popover__content);\n if (this.open !== null) {\n this.$emit('update:open', true);\n }\n },\n\n focusInitialElement () {\n if (this.initialFocusElement === 'dialog') {\n returnFirstEl(this.$refs.content?.$el)?.focus();\n }\n // find by ID\n if (this.initialFocusElement.startsWith('#')) {\n this.focusInitialElementById();\n }\n if (this.initialFocusElement === 'first') {\n this.focusFirstElementIfNeeded(this.$refs.popover__content);\n }\n if (this.initialFocusElement instanceof HTMLElement) {\n this.initialFocusElement.focus();\n }\n },\n\n focusInitialElementById () {\n const result = returnFirstEl(this.$refs.content?.$el)?.querySelector(this.initialFocusElement);\n if (result) {\n result.focus();\n } else {\n console.warn('Could not find the element specified in dt-popover prop \"initialFocusElement\". ' +\n 'Defaulting to focusing the dialog.');\n }\n result ? result.focus() : returnFirstEl(this.$refs.content?.$el).focus();\n },\n\n onResize () {\n this.closePopover();\n },\n\n onClickOutside () {\n if (!this.hideOnClick) return;\n // If a popover is opened inside of this one, do not hide on click out\n const innerModals = this.popoverContentEl?.querySelector('.d-popover__anchor--opened');\n if (!innerModals) {\n this.closePopover();\n }\n },\n\n onKeydown (e) {\n if (e.key === 'Tab') {\n if (this.modal) {\n this.focusTrappedTabPress(e, this.popoverContentEl);\n }\n }\n if (e.key === 'Escape') {\n this.closePopover();\n }\n\n this.$emit('keydown', e);\n },\n\n async setPopoverContentAnchorWidth () {\n await this.$nextTick();\n this.popoverContentEl.style.width = `${this.anchorEl?.clientWidth}px`;\n },\n\n focusFirstElementIfNeeded (domEl) {\n const focusableElements = this._getFocusableElements(domEl, true);\n if (focusableElements.length !== 0) {\n this.focusFirstElement(domEl);\n } else if (this.showCloseButton) {\n this.$refs.popover__header?.focusCloseButton();\n } else {\n // if there are no focusable elements at all focus the dialog itself\n returnFirstEl(this.$refs.content?.$el).focus();\n }\n },\n\n /**\n * Return's the anchor ClientRect object relative to the window.\n * Refer to: https://atomiks.github.io/tippyjs/v6/all-props/#getreferenceclientrect for more information\n * @param error\n */\n getReferenceClientRect (error) {\n const anchorReferenceRect = this.anchorEl?.getBoundingClientRect();\n\n if (this.appendTo !== 'root' || error) return anchorReferenceRect;\n\n const anchorOwnerDocument = this.anchorEl?.ownerDocument;\n const anchorParentWindow = anchorOwnerDocument?.defaultView || anchorOwnerDocument?.parentWindow;\n const anchorIframe = anchorParentWindow?.frameElement;\n\n if (!anchorIframe) return anchorReferenceRect;\n\n const iframeReferenceRect = anchorIframe.getBoundingClientRect();\n\n return {\n width: anchorReferenceRect?.width,\n height: anchorReferenceRect?.height,\n top: iframeReferenceRect?.top + anchorReferenceRect?.top,\n left: iframeReferenceRect?.left + anchorReferenceRect?.left,\n right: iframeReferenceRect?.right + anchorReferenceRect?.right,\n bottom: iframeReferenceRect?.bottom + anchorReferenceRect?.bottom,\n };\n },\n\n initTippyInstance () {\n let internalAppendTo = null;\n let iFrameError = false;\n\n switch (this.appendTo) {\n case 'body':\n internalAppendTo = this.anchorEl?.getRootNode()?.querySelector('body');\n break;\n\n case 'root':\n // Try to attach the popover to root document, fallback to parent is fail\n try {\n internalAppendTo = window.parent.document.body;\n } catch (err) {\n console.error('Could not attach the popover to iframe parent window: ', err);\n internalAppendTo = 'parent';\n iFrameError = true;\n }\n break;\n\n default:\n internalAppendTo = this.appendTo;\n break;\n }\n\n this.tip = createTippyPopover(this.anchorEl, {\n popperOptions: this.popperOptions(),\n contentElement: this.popoverContentEl,\n placement: this.placement,\n offset: this.offset,\n sticky: this.sticky,\n appendTo: internalAppendTo,\n interactive: true,\n trigger: 'manual',\n getReferenceClientRect: () => this.getReferenceClientRect(iFrameError),\n // We have to manage hideOnClick functionality manually to handle\n // popover within popover situations.\n hideOnClick: false,\n zIndex: this.modal ? 650 : this.calculateAnchorZindex(),\n onClickOutside: this.onClickOutside,\n onShow: this.onShow,\n });\n },\n\n onMouseEnter () {\n this.$emit('mouseenter-popover');\n },\n\n onMouseLeave () {\n this.$emit('mouseleave-popover');\n },\n\n onMouseEnterAnchor () {\n this.$emit('mouseenter-popover-anchor');\n },\n\n onMouseLeaveAnchor () {\n this.$emit('mouseleave-popover-anchor');\n },\n },\n};\n</script>\n"],"names":["_sfc_main","SrOnlyCloseButton","DtLazyShow","PopoverHeaderFooter","ModalMixin","role","POPOVER_ROLES","padding","POPOVER_PADDING_CLASSES","item","contentWidth","POPOVER_CONTENT_WIDTHS","getUniqueString","sticky","POPOVER_STICKY_VALUES","initialFocusElement","POPOVER_INITIAL_FOCUS_STRINGS","appendTo","POPOVER_APPEND_TO_VALUES","POPOVER_HEADER_FOOTER_PADDING_CLASSES","hasSlotContent","event","modal","_a","offset","placement","open","contentAppear","isOpen","isPrev","_b","warnIfUnmounted","returnFirstEl","externalAnchorEl","entries","dialog","isOut","isOutOfViewPort","getPopperOptions","_c","element","disableRootScrolling","enableRootScrolling","result","domEl","error","anchorReferenceRect","anchorOwnerDocument","anchorParentWindow","anchorIframe","iframeReferenceRect","internalAppendTo","iFrameError","err","createTippyPopover","_hoisted_1","_hoisted_2","_createElementBlock","$props","$data","_createBlock","_Teleport","_createElementVNode","_cache","_withModifiers","_createCommentVNode","_resolveDynamicComponent","_normalizeClass","_withCtx","$options","_ctx","args","_withKeys","$event","_renderSlot","_createVNode","_component_dt_lazy_show","_mergeProps","_toHandlers","_component_popover_header_footer","_component_sr_only_close_button"],"mappings":";;;;;;;;;AAkJA,MAAKA,IAAU;AAAA,EACb,cAAc,EAAE,MAAM;EACtB,MAAM;AAAA;AAAA;AAAA;AAAA,EAKN,YAAY;AAAA,IACV,mBAAAC;AAAA,IACA,YAAAC;AAAA,IACA,qBAAAC;AAAA;EAGF,QAAQ,CAACC,CAAU;AAAA,EAEnB,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOL,MAAM;AAAA,MACJ,MAAM;AAAA,MACN,SAAS;AAAA;;;;;;IAQX,eAAe;AAAA,MACb,MAAM;AAAA,MACN,SAAS;AAAA;;;;IAMX,aAAa;AAAA,MACX,MAAM;AAAA,MACN,SAAS;AAAA;;;;;IAOX,YAAY;AAAA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AAA,IAAA,EAAA;AAAA,YAqFQH,EAcM,OAAA;AAAA,cAbJ,KAAI;AAAA,cACH,WAASQ,EAAA,OAAM,SAAA,IAAA,GAAiBA,EAAA,OAAM,SAAA,CAAA,aAAA;AAAA,cACtC,OAxFXH,EAAA;AAAA;gBAwFkER,EAAA,wBAAwBD,EAAA,OAAO;AAAA,gBAAeA,EAAA;AAAA;;cAOtGgB,EAGEJ,EAAA,QAAA,WAAA,EADC,OAAOD,EAAA,aAAY,CAAA;AAAA,YAjGhC,GAAA,IAAAb,CAAA;AAAA,YAqGgBG,EAAA,eAAeW,EAAA,OAAO,aAAa,UAD3CV,EAcwBmB,GAAA;AAAA,cAlHhC,KAAA;AAAA,cAsGU,KAAI;AAAA,cACJ,MAAK;AAAA,cACJ,OAxGXZ,EAwGkBR,EAAA,sCAAsCD,EAAA,OAAO,CAAA;AAAA,cACpD,iBAAeA,EAAA;AAAA;cAEL,WAET,MAGE;AAAA,gBAHFgB,EAGEJ,EAAA,QAAA,iBAAA,EADC,OAAOD,EAAA,aAAY,CAAA;AAAA;cA/GlC,GAAA;AAAA,iDAAAJ,EAAA,IAAA,EAAA;AAAA,YAoHiBP,EAAA,kBApHjBO,EAAA,IAAA,EAAA,UAmHQL,EAGEoB,GAAA;AAAA,cAtHV,KAAA;AAAA,cAqHW,SAAOX,EAAA;AAAA;;UArHlB,GAAA;AAAA;;MAAA,GAAA;AAAA;;;;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("tippy.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("tippy.js"),s=["bottom","bottom-start","bottom-end","right","right-start","right-end","left","left-start","left-end","top","top-start","top-end"],i=[!0,!1,"reference","popper"],c=(t,e)=>{const{contentElement:r}={...e};return delete e.contentElement,n(t,{...e,plugins:[n.sticky],render:()=>p(r)})},a=(t,e)=>n(t,{...e,plugins:[n.sticky]}),l=({boundary:t="clippingParents",fallbackPlacements:e=[],hasHideModifierEnabled:r=!1,tether:o=!0}={})=>({modifiers:[{name:"flip",options:{fallbackPlacements:e,boundary:t}},{name:"hide",enabled:r},{name:"preventOverflow",options:{altAxis:!o,tether:o}}]}),d=t=>{const e=document.createElement("span");return e.innerText=t.innerText||"",t.innerText="",t.appendChild(e),e},u=t=>{if(!t){console.warn("No anchor wrapper provided. This may cause issues with the popover.");return}const e=t.children[0];return e||d(t)},p=t=>{const e=document.createElement("div");return e.className="tippy-box d-ps-absolute",e.appendChild(t),{popper:e}};exports.BASE_TIPPY_DIRECTIONS=s;exports.TIPPY_STICKY_VALUES=i;exports.createTippy=a;exports.createTippyPopover=c;exports.getAnchor=u;exports.getContentWrapper=p;exports.getPopperOptions=l;
|
|
2
2
|
//# sourceMappingURL=tippy-utils.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tippy-utils.cjs","sources":["../../../components/popover/tippy_utils.js"],"sourcesContent":["import tippy, { sticky } from 'tippy.js';\n\nexport const BASE_TIPPY_DIRECTIONS = [\n 'bottom', 'bottom-start', 'bottom-end',\n 'right', 'right-start', 'right-end',\n 'left', 'left-start', 'left-end',\n 'top', 'top-start', 'top-end',\n];\n\nexport const TIPPY_STICKY_VALUES = [true, false, 'reference', 'popper'];\nexport const createTippyPopover = (anchorElement, options) => {\n const { contentElement } = { ...options };\n delete options.contentElement;\n return tippy(anchorElement, {\n ...options,\n plugins: [sticky],\n render: () => getContentWrapper(contentElement),\n });\n};\n\nexport const createTippy = (anchorElement, options) => {\n return tippy(anchorElement, {\n ...options,\n plugins: [sticky],\n });\n};\n\nexport const getPopperOptions = ({\n boundary = 'clippingParents',\n fallbackPlacements = [],\n hasHideModifierEnabled = false,\n // If set to false the dialog will display over top of the anchor when there is insufficient space.\n // if set to true it will never move from its position relative to the anchor and will clip instead.\n tether = true,\n} = {}) => {\n return {\n modifiers: [\n {\n name: 'flip',\n options: {\n fallbackPlacements,\n boundary,\n },\n },\n {\n name: 'hide',\n enabled: hasHideModifierEnabled,\n },\n {\n name: 'preventOverflow',\n options: {\n altAxis: !tether,\n tether,\n },\n },\n ],\n };\n};\n\nconst createAnchor = (anchorWrapper) => {\n const span = document.createElement('span');\n span.innerText = anchorWrapper.innerText || '';\n anchorWrapper.innerText = '';\n anchorWrapper.appendChild(span);\n return span;\n};\n\nexport const getAnchor = (anchorWrapper) => {\n const anchor = anchorWrapper
|
|
1
|
+
{"version":3,"file":"tippy-utils.cjs","sources":["../../../components/popover/tippy_utils.js"],"sourcesContent":["import tippy, { sticky } from 'tippy.js';\n\nexport const BASE_TIPPY_DIRECTIONS = [\n 'bottom', 'bottom-start', 'bottom-end',\n 'right', 'right-start', 'right-end',\n 'left', 'left-start', 'left-end',\n 'top', 'top-start', 'top-end',\n];\n\nexport const TIPPY_STICKY_VALUES = [true, false, 'reference', 'popper'];\nexport const createTippyPopover = (anchorElement, options) => {\n const { contentElement } = { ...options };\n delete options.contentElement;\n return tippy(anchorElement, {\n ...options,\n plugins: [sticky],\n render: () => getContentWrapper(contentElement),\n });\n};\n\nexport const createTippy = (anchorElement, options) => {\n return tippy(anchorElement, {\n ...options,\n plugins: [sticky],\n });\n};\n\nexport const getPopperOptions = ({\n boundary = 'clippingParents',\n fallbackPlacements = [],\n hasHideModifierEnabled = false,\n // If set to false the dialog will display over top of the anchor when there is insufficient space.\n // if set to true it will never move from its position relative to the anchor and will clip instead.\n tether = true,\n} = {}) => {\n return {\n modifiers: [\n {\n name: 'flip',\n options: {\n fallbackPlacements,\n boundary,\n },\n },\n {\n name: 'hide',\n enabled: hasHideModifierEnabled,\n },\n {\n name: 'preventOverflow',\n options: {\n altAxis: !tether,\n tether,\n },\n },\n ],\n };\n};\n\nconst createAnchor = (anchorWrapper) => {\n const span = document.createElement('span');\n span.innerText = anchorWrapper.innerText || '';\n anchorWrapper.innerText = '';\n anchorWrapper.appendChild(span);\n return span;\n};\n\nexport const getAnchor = (anchorWrapper) => {\n if (!anchorWrapper) {\n console.warn('No anchor wrapper provided. This may cause issues with the popover.');\n return;\n }\n const anchor = anchorWrapper.children[0];\n if (!anchor) return createAnchor(anchorWrapper);\n return anchor;\n};\n\nexport const getContentWrapper = content => {\n // The recommended structure is to use the popper as an outer wrapper\n const popper = document.createElement('div');\n popper.className = 'tippy-box d-ps-absolute';\n popper.appendChild(content);\n return {\n popper,\n };\n};\n"],"names":["BASE_TIPPY_DIRECTIONS","TIPPY_STICKY_VALUES","createTippyPopover","anchorElement","options","contentElement","tippy","sticky","getContentWrapper","createTippy","getPopperOptions","boundary","fallbackPlacements","hasHideModifierEnabled","tether","createAnchor","anchorWrapper","span","getAnchor","anchor","content","popper"],"mappings":"4GAEaA,EAAwB,CACnC,SAAU,eAAgB,aAC1B,QAAS,cAAe,YACxB,OAAQ,aAAc,WACtB,MAAO,YAAa,SACtB,EAEaC,EAAsB,CAAC,GAAM,GAAO,YAAa,QAAQ,EACzDC,EAAqB,CAACC,EAAeC,IAAY,CAC5D,KAAM,CAAE,eAAAC,CAAc,EAAK,CAAE,GAAGD,CAAO,EACvC,cAAOA,EAAQ,eACRE,EAAMH,EAAe,CAC1B,GAAGC,EACH,QAAS,CAACG,EAAAA,MAAM,EAChB,OAAQ,IAAMC,EAAkBH,CAAc,CAClD,CAAG,CACH,EAEaI,EAAc,CAACN,EAAeC,IAClCE,EAAMH,EAAe,CAC1B,GAAGC,EACH,QAAS,CAACG,EAAAA,MAAM,CACpB,CAAG,EAGUG,EAAmB,CAAC,CAC/B,SAAAC,EAAW,kBACX,mBAAAC,EAAqB,CAAA,EACrB,uBAAAC,EAAyB,GAGzB,OAAAC,EAAS,EACX,EAAI,MACK,CACL,UAAW,CACT,CACE,KAAM,OACN,QAAS,CACP,mBAAAF,EACA,SAAAD,CACV,CACA,EACM,CACE,KAAM,OACN,QAASE,CACjB,EACM,CACE,KAAM,kBACN,QAAS,CACP,QAAS,CAACC,EACV,OAAAA,CACV,CACA,CACA,CACA,GA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