@dialpad/dialtone-vue 3.222.0 → 3.222.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/common/constants/index.cjs +1 -1
- package/dist/common/constants/index.cjs.map +1 -1
- package/dist/common/constants/index.d.ts +4 -0
- package/dist/common/constants/index.d.ts.map +1 -1
- package/dist/common/constants/index.js +10 -10
- package/dist/common/constants/index.js.map +1 -1
- package/dist/component-documentation.json +1 -1
- package/dist/components/combobox_with_popover/combobox_with_popover.vue.d.ts +18 -18
- package/dist/components/combobox_with_popover/combobox_with_popover.vue.d.ts.map +1 -1
- package/dist/components/dropdown/dropdown.vue.d.ts +18 -18
- package/dist/components/dropdown/dropdown.vue.d.ts.map +1 -1
- package/dist/components/emoji_picker/emoji_picker.vue.d.ts +22 -0
- package/dist/components/emoji_picker/modules/emoji_search.vue.d.ts +22 -0
- package/dist/components/emoji_picker/modules/emoji_search.vue.d.ts.map +1 -1
- package/dist/components/hovercard/hovercard.vue.d.ts +32 -32
- package/dist/components/hovercard/hovercard.vue.d.ts.map +1 -1
- package/dist/components/input/input.vue.d.ts +11 -0
- package/dist/components/input/input.vue.d.ts.map +1 -1
- package/dist/components/modal/modal.vue.d.ts +6 -5
- package/dist/components/modal/modal.vue.d.ts.map +1 -1
- package/dist/components/popover/popover.vue.d.ts +13 -13
- package/dist/components/popover/popover.vue.d.ts.map +1 -1
- package/dist/components/resizable/composables/useResizableGroup.d.ts.map +1 -1
- package/dist/components/rich_text_editor/extensions/variable/VariableComponent.vue.d.ts +24 -13
- package/dist/components/split_button/split_button.vue.d.ts +18 -18
- package/dist/components/tooltip/tooltip.vue.d.ts +8 -8
- package/dist/components/tooltip/tooltip.vue.d.ts.map +1 -1
- package/dist/dialtone-vue.cjs +1 -1
- package/dist/dialtone-vue.js +149 -149
- package/dist/lib/combobox-multi-select/combobox-multi-select.cjs +1 -1
- package/dist/lib/combobox-multi-select/combobox-multi-select.cjs.map +1 -1
- package/dist/lib/combobox-multi-select/combobox-multi-select.js +49 -48
- package/dist/lib/combobox-multi-select/combobox-multi-select.js.map +1 -1
- package/dist/lib/combobox-with-popover/combobox-with-popover.cjs +1 -1
- package/dist/lib/combobox-with-popover/combobox-with-popover.cjs.map +1 -1
- package/dist/lib/combobox-with-popover/combobox-with-popover.js +43 -42
- package/dist/lib/combobox-with-popover/combobox-with-popover.js.map +1 -1
- package/dist/lib/dropdown/dropdown.cjs +1 -1
- package/dist/lib/dropdown/dropdown.cjs.map +1 -1
- package/dist/lib/dropdown/dropdown.js +33 -33
- package/dist/lib/dropdown/dropdown.js.map +1 -1
- package/dist/lib/editor/editor.cjs +1 -1
- package/dist/lib/editor/editor.js +1 -1
- package/dist/lib/hovercard/hovercard.cjs +1 -1
- package/dist/lib/hovercard/hovercard.cjs.map +1 -1
- package/dist/lib/hovercard/hovercard.js +28 -27
- package/dist/lib/hovercard/hovercard.js.map +1 -1
- package/dist/lib/input/input.cjs +1 -1
- package/dist/lib/input/input.cjs.map +1 -1
- package/dist/lib/input/input.js +6 -6
- package/dist/lib/input/input.js.map +1 -1
- package/dist/lib/message-input/index.cjs +1 -1
- package/dist/lib/message-input/index.js +1 -1
- package/dist/lib/message-input/message-input.cjs +1 -1
- package/dist/lib/message-input/message-input.js +1 -1
- package/dist/lib/modal/modal.cjs +1 -1
- package/dist/lib/modal/modal.cjs.map +1 -1
- package/dist/lib/modal/modal.js +61 -58
- package/dist/lib/modal/modal.js.map +1 -1
- package/dist/lib/popover/popover.cjs +1 -1
- package/dist/lib/popover/popover.cjs.map +1 -1
- package/dist/lib/popover/popover.js +76 -75
- package/dist/lib/popover/popover.js.map +1 -1
- package/dist/lib/resizable/index.cjs +1 -1
- package/dist/lib/resizable/index.js +1 -1
- package/dist/lib/resizable/resizable.cjs +1 -1
- package/dist/lib/resizable/resizable.js +1 -1
- package/dist/lib/rich-text-editor/index.cjs +1 -1
- package/dist/lib/rich-text-editor/index.js +1 -1
- package/dist/lib/rich-text-editor/rich-text-editor.cjs +1 -1
- package/dist/lib/rich-text-editor/rich-text-editor.js +1 -1
- package/dist/lib/tooltip/tooltip.cjs +2 -2
- package/dist/lib/tooltip/tooltip.cjs.map +1 -1
- package/dist/lib/tooltip/tooltip.js +30 -29
- package/dist/lib/tooltip/tooltip.js.map +1 -1
- package/dist/{message_input-B47LB7C8.js → message_input-B2fppje7.js} +2 -2
- package/dist/{message_input-B47LB7C8.js.map → message_input-B2fppje7.js.map} +1 -1
- package/dist/{message_input-BCIq_1AD.cjs → message_input-DmLi63dh.cjs} +2 -2
- package/dist/{message_input-BCIq_1AD.cjs.map → message_input-DmLi63dh.cjs.map} +1 -1
- package/dist/recipes/buttons/callbar_button/callbar_button.vue.d.ts +8 -8
- package/dist/recipes/buttons/callbar_button_with_dropdown/callbar_button_with_dropdown.vue.d.ts +26 -26
- package/dist/recipes/buttons/callbar_button_with_popover/callbar_button_with_popover.vue.d.ts +21 -21
- package/dist/recipes/cards/ivr_node/ivr_node.vue.d.ts +18 -18
- package/dist/recipes/conversation_view/editor/EditorToolbarDropdownButton.vue.d.ts +18 -18
- package/dist/recipes/conversation_view/editor/EditorToolbarPopoverButton.vue.d.ts +13 -13
- package/dist/recipes/conversation_view/editor/editor.vue.d.ts +63 -52
- package/dist/recipes/conversation_view/editor/editor.vue.d.ts.map +1 -1
- package/dist/recipes/conversation_view/emoji_row/emoji_row.vue.d.ts +8 -8
- package/dist/recipes/conversation_view/message_input/message_input.vue.d.ts +94 -50
- package/dist/recipes/conversation_view/message_input/message_input.vue.d.ts.map +1 -1
- package/dist/recipes/conversation_view/message_input/message_input_button.vue.d.ts +8 -8
- package/dist/recipes/conversation_view/message_input/message_input_link.vue.d.ts +32 -21
- package/dist/recipes/conversation_view/message_input/message_input_link.vue.d.ts.map +1 -1
- package/dist/recipes/conversation_view/message_input/message_input_topbar.vue.d.ts +8 -8
- package/dist/recipes/leftbar/contact_row/contact_row.vue.d.ts +8 -8
- package/dist/recipes/leftbar/general_row/general_row.vue.d.ts +8 -8
- package/dist/recipes/leftbar/group_row/group_row.vue.d.ts +8 -8
- package/dist/{resizable-aOVGO_Os.cjs → resizable-BOCf9EIc.cjs} +2 -2
- package/dist/{resizable-aOVGO_Os.cjs.map → resizable-BOCf9EIc.cjs.map} +1 -1
- package/dist/{resizable-D4-peBOl.js → resizable-CPaF9dgG.js} +7 -3
- package/dist/{resizable-D4-peBOl.js.map → resizable-CPaF9dgG.js.map} +1 -1
- package/dist/{rich_text_editor-CNFb6tIx.js → rich_text_editor-BhUKyR0E.js} +2 -2
- package/dist/{rich_text_editor-CNFb6tIx.js.map → rich_text_editor-BhUKyR0E.js.map} +1 -1
- package/dist/{rich_text_editor-DRytK1_9.cjs → rich_text_editor-wvONcbYd.cjs} +2 -2
- package/dist/{rich_text_editor-DRytK1_9.cjs.map → rich_text_editor-wvONcbYd.cjs.map} +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"popover.cjs","names":[],"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 * @deprecated Use externalAnchorElement instead for Shadow DOM compatibility.\n */\n externalAnchor: {\n type: String,\n default: '',\n },\n\n /**\n * External anchor element reference. Use this instead of externalAnchor when\n * the anchor may be inside a Shadow DOM, as querySelector cannot pierce shadow boundaries.\n */\n externalAnchorElement: {\n type: HTMLElement,\n default: null,\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 mutationObserver: 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 externalAnchorElement () {\n this.updateAnchorEl();\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 this.popoverContentEl = returnFirstEl(this.$refs.content?.$el);\n this.updateAnchorEl();\n\n this.mutationObserver = new MutationObserver(this.updateAnchorEl);\n this.mutationObserver.observe(this.$refs.anchor, {childList: true});\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._isUnmounting = true;\n // Cancel any in-progress CSS transitions so transitionend cannot fire\n // after this component is torn down and call into dead lifecycle methods.\n if (this.popoverContentEl) {\n this.popoverContentEl.style.transition = 'none';\n }\n this.tip?.destroy();\n this.intersectionObserver?.disconnect();\n this.mutationObserver?.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 updateAnchorEl () {\n const externalAnchorEl = this.externalAnchorElement ||\n (this.externalAnchor\n ? this.$refs.anchor.getRootNode().querySelector(`#${this.externalAnchor}`)\n : null);\n const anchorEl = externalAnchorEl ?? this.$refs.anchor.children[0];\n if (anchorEl === this.anchorEl) {\n return;\n }\n this.anchorEl = anchorEl;\n\n this.tip?.destroy();\n delete this.tip;\n\n if (!this.anchorEl) {\n console.warn('No anchor found for popover');\n return;\n }\n\n if (this.isOpen) {\n this.initTippyInstance();\n this.tip?.show();\n }\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._isUnmounting) return;\n if (this.modal) {\n await this.focusFirstElement(this.$refs.anchor);\n if (this._isUnmounting) return;\n // await next tick in case the user wants to change focus themselves.\n await this.$nextTick();\n if (this._isUnmounting) return;\n this.enableScrolling();\n }\n if (this._isUnmounting) return;\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 if (this._isUnmounting) return;\n this.focusInitialElement();\n // await next tick in case the user wants to change focus themselves.\n await this.$nextTick();\n if (this._isUnmounting) return;\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 returnFirstEl(this.$refs.content?.$el)?.focus();\n }\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?.destroy();\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"],"mappings":"qfAkJA,IAAK,EAAU,CACb,aAAc,CAAE,KAAM,EAAG,CACzB,KAAM,YAKN,WAAY,CACV,kBAAA,EAAA,QACA,WAAA,EAAA,QACA,oBAAA,EAAA,QACD,CAED,OAAQ,CAAC,EAAA,QAAW,CAEpB,MAAO,CAOL,KAAM,CACJ,KAAM,QACN,QAAS,KACV,CAOD,cAAe,CACb,KAAM,QACN,QAAS,GACV,CAKD,YAAa,CACX,KAAM,OACN,QAAS,MACV,CAMD,WAAY,CACV,KAAM,OACN,QAAS,OACV,CAMD,KAAM,CACJ,KAAM,OACN,QAAS,SACT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ADC,MAAO,EAAA,aAAY,CAAA,CAAA,CAAA,2HAkBpB,MAAA,CAbJ,IAAI,mBACH,UAAS,EAAA,OAAM,WAAA,GAAiB,EAAA,OAAM,WAAA,UAAA,qBACtC,OAAA,EAAA,EAAA,gBAAK,sBAAkD,EAAA,wBAAwB,EAAA,SAAsB,EAAA,kCAUpG,EAAA,OAAA,UAAA,CADC,MAAO,EAAA,aAAY,CAAA,CAAA,CAAA,GAAA,EAAA,CAIhB,EAAA,eAAe,EAAA,OAAO,cAAa,GAAA,EAAA,EAAA,YAAA,EAAA,EAAA,EAAA,aAanB,EAAA,OAZtB,IAAI,kBACJ,KAAK,SACJ,OAAA,EAAA,EAAA,gBAAO,EAAA,sCAAsC,EAAA,SAAO,CACpD,gBAAe,EAAA,cAEL,SAAA,EAAA,EAAA,aAKP,EAAA,EAAA,EAAA,YAAA,EAAA,OAAA,gBAAA,CADC,MAAO,EAAA,aAAY,CAAA,CAAA,CAAA,oEAKjB,EAAA,kDAAA,EAAA,EAAA,YAAA,EAAA,EAAA,EAAA,aAEP,EAAA,OADC,QAAO,EAAA"}
|
|
1
|
+
{"version":3,"file":"popover.cjs","names":[],"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 { HTML_ELEMENT_TYPE } from '@/common/constants';\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 * @deprecated Use externalAnchorElement instead for Shadow DOM compatibility.\n */\n externalAnchor: {\n type: String,\n default: '',\n },\n\n /**\n * External anchor element reference. Use this instead of externalAnchor when\n * the anchor may be inside a Shadow DOM, as querySelector cannot pierce shadow boundaries.\n */\n externalAnchorElement: {\n type: HTML_ELEMENT_TYPE,\n default: null,\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, HTML_ELEMENT_TYPE],\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: [HTML_ELEMENT_TYPE, 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 mutationObserver: 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 externalAnchorElement () {\n this.updateAnchorEl();\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 this.popoverContentEl = returnFirstEl(this.$refs.content?.$el);\n this.updateAnchorEl();\n\n this.mutationObserver = new MutationObserver(this.updateAnchorEl);\n this.mutationObserver.observe(this.$refs.anchor, {childList: true});\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._isUnmounting = true;\n // Cancel any in-progress CSS transitions so transitionend cannot fire\n // after this component is torn down and call into dead lifecycle methods.\n if (this.popoverContentEl) {\n this.popoverContentEl.style.transition = 'none';\n }\n this.tip?.destroy();\n this.intersectionObserver?.disconnect();\n this.mutationObserver?.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 updateAnchorEl () {\n const externalAnchorEl = this.externalAnchorElement ||\n (this.externalAnchor\n ? this.$refs.anchor.getRootNode().querySelector(`#${this.externalAnchor}`)\n : null);\n const anchorEl = externalAnchorEl ?? this.$refs.anchor.children[0];\n if (anchorEl === this.anchorEl) {\n return;\n }\n this.anchorEl = anchorEl;\n\n this.tip?.destroy();\n delete this.tip;\n\n if (!this.anchorEl) {\n console.warn('No anchor found for popover');\n return;\n }\n\n if (this.isOpen) {\n this.initTippyInstance();\n this.tip?.show();\n }\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 if (this._isUnmounting) return;\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._isUnmounting) return;\n if (this.modal) {\n await this.focusFirstElement(this.$refs.anchor);\n if (this._isUnmounting) return;\n // await next tick in case the user wants to change focus themselves.\n await this.$nextTick();\n if (this._isUnmounting) return;\n this.enableScrolling();\n }\n if (this._isUnmounting) return;\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 if (this._isUnmounting) return;\n this.focusInitialElement();\n // await next tick in case the user wants to change focus themselves.\n await this.$nextTick();\n if (this._isUnmounting) return;\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 returnFirstEl(this.$refs.content?.$el)?.focus();\n }\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?.destroy();\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"],"mappings":"miBAmJA,IAAK,EAAU,CACb,aAAc,CAAE,KAAM,EAAG,CACzB,KAAM,YAKN,WAAY,CACV,kBAAA,EAAA,QACA,WAAA,EAAA,QACA,oBAAA,EAAA,QACD,CAED,OAAQ,CAAC,EAAA,QAAW,CAEpB,MAAO,CA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B,EAAA,OAdtB,IAAI,kBACH,OAAA,EAAA,EAAA,gBAAO,EAAA,sCAAsC,EAAA,SAAO,CACpD,gBAAe,EAAA,YAChB,KAAK,SACJ,oBAAmB,EAAA,gBACnB,QAAO,EAAA,eAEG,SAAA,EAAA,EAAA,aAKP,EAAA,EAAA,EAAA,YAAA,EAAA,OAAA,gBAAA,CADC,MAAO,EAAA,aAAY,CAAA,CAAA,CAAA,2HAkBpB,MAAA,CAbJ,IAAI,mBACH,UAAS,EAAA,OAAM,WAAA,GAAiB,EAAA,OAAM,WAAA,UAAA,qBACtC,OAAA,EAAA,EAAA,gBAAK,sBAAkD,EAAA,wBAAwB,EAAA,SAAsB,EAAA,kCAUpG,EAAA,OAAA,UAAA,CADC,MAAO,EAAA,aAAY,CAAA,CAAA,CAAA,GAAA,EAAA,CAIhB,EAAA,eAAe,EAAA,OAAO,cAAa,GAAA,EAAA,EAAA,YAAA,EAAA,EAAA,EAAA,aAanB,EAAA,OAZtB,IAAI,kBACJ,KAAK,SACJ,OAAA,EAAA,EAAA,gBAAO,EAAA,sCAAsC,EAAA,SAAO,CACpD,gBAAe,EAAA,cAEL,SAAA,EAAA,EAAA,aAKP,EAAA,EAAA,EAAA,YAAA,EAAA,OAAA,gBAAA,CADC,MAAO,EAAA,aAAY,CAAA,CAAA,CAAA,oEAKjB,EAAA,kDAAA,EAAA,EAAA,YAAA,EAAA,EAAA,EAAA,aAEP,EAAA,OADC,QAAO,EAAA"}
|
|
@@ -1,22 +1,23 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as s } from "../../
|
|
3
|
-
import c from "../../
|
|
4
|
-
import l from "../../
|
|
5
|
-
import u from "
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import b from "./popover-
|
|
9
|
-
import
|
|
1
|
+
import { HTML_ELEMENT_TYPE as e } from "../../common/constants/index.js";
|
|
2
|
+
import { disableRootScrolling as t, enableRootScrolling as n, getUniqueString as r, hasSlotContent as i, isOutOfViewPort as a, returnFirstEl as o, warnIfUnmounted as s } from "../../common/utils/index.js";
|
|
3
|
+
import { t as c } from "../../_plugin-vue_export-helper-BTgDAbhb.js";
|
|
4
|
+
import l from "../../common/mixins/modal.js";
|
|
5
|
+
import u from "../../shared/sr_only_close_button.js";
|
|
6
|
+
import d from "../lazy-show/lazy-show.js";
|
|
7
|
+
import { createTippyPopover as f, getPopperOptions as p } from "./tippy-utils.js";
|
|
8
|
+
import { POPOVER_APPEND_TO_VALUES as m, POPOVER_CONTENT_WIDTHS as h, POPOVER_HEADER_FOOTER_PADDING_CLASSES as g, POPOVER_INITIAL_FOCUS_STRINGS as _, POPOVER_PADDING_CLASSES as v, POPOVER_ROLES as y, POPOVER_STICKY_VALUES as b } from "./popover-constants.js";
|
|
9
|
+
import x from "./popover-header-footer.js";
|
|
10
|
+
import { Teleport as S, createBlock as C, createCommentVNode as w, createElementBlock as T, createElementVNode as E, createVNode as D, mergeProps as O, normalizeClass as k, openBlock as A, renderSlot as j, resolveComponent as M, resolveDynamicComponent as N, toHandlers as P, withCtx as F, withKeys as I, withModifiers as L } from "vue";
|
|
10
11
|
//#region components/popover/popover.vue
|
|
11
|
-
var
|
|
12
|
+
var R = {
|
|
12
13
|
compatConfig: { MODE: 3 },
|
|
13
14
|
name: "DtPopover",
|
|
14
15
|
components: {
|
|
15
|
-
SrOnlyCloseButton:
|
|
16
|
-
DtLazyShow:
|
|
17
|
-
PopoverHeaderFooter:
|
|
16
|
+
SrOnlyCloseButton: u,
|
|
17
|
+
DtLazyShow: d,
|
|
18
|
+
PopoverHeaderFooter: x
|
|
18
19
|
},
|
|
19
|
-
mixins: [
|
|
20
|
+
mixins: [l],
|
|
20
21
|
props: {
|
|
21
22
|
open: {
|
|
22
23
|
type: Boolean,
|
|
@@ -37,7 +38,7 @@ var L = {
|
|
|
37
38
|
role: {
|
|
38
39
|
type: String,
|
|
39
40
|
default: "dialog",
|
|
40
|
-
validator: (e) =>
|
|
41
|
+
validator: (e) => y.includes(e)
|
|
41
42
|
},
|
|
42
43
|
ariaLabelledby: {
|
|
43
44
|
type: String,
|
|
@@ -50,7 +51,7 @@ var L = {
|
|
|
50
51
|
padding: {
|
|
51
52
|
type: String,
|
|
52
53
|
default: "large",
|
|
53
|
-
validator: (e) => Object.keys(
|
|
54
|
+
validator: (e) => Object.keys(v).some((t) => t === e)
|
|
54
55
|
},
|
|
55
56
|
contentClass: {
|
|
56
57
|
type: [
|
|
@@ -63,7 +64,7 @@ var L = {
|
|
|
63
64
|
contentWidth: {
|
|
64
65
|
type: String,
|
|
65
66
|
default: "",
|
|
66
|
-
validator: (e) =>
|
|
67
|
+
validator: (e) => h.includes(e)
|
|
67
68
|
},
|
|
68
69
|
contentAppear: {
|
|
69
70
|
type: Boolean,
|
|
@@ -78,13 +79,13 @@ var L = {
|
|
|
78
79
|
default: ""
|
|
79
80
|
},
|
|
80
81
|
externalAnchorElement: {
|
|
81
|
-
type:
|
|
82
|
+
type: e,
|
|
82
83
|
default: null
|
|
83
84
|
},
|
|
84
85
|
id: {
|
|
85
86
|
type: String,
|
|
86
87
|
default() {
|
|
87
|
-
return
|
|
88
|
+
return r();
|
|
88
89
|
}
|
|
89
90
|
},
|
|
90
91
|
offset: {
|
|
@@ -114,7 +115,7 @@ var L = {
|
|
|
114
115
|
sticky: {
|
|
115
116
|
type: [Boolean, String],
|
|
116
117
|
default: !1,
|
|
117
|
-
validator: (e) =>
|
|
118
|
+
validator: (e) => b.includes(e)
|
|
118
119
|
},
|
|
119
120
|
maxHeight: {
|
|
120
121
|
type: String,
|
|
@@ -153,18 +154,18 @@ var L = {
|
|
|
153
154
|
default: ""
|
|
154
155
|
},
|
|
155
156
|
initialFocusElement: {
|
|
156
|
-
type: [String,
|
|
157
|
+
type: [String, e],
|
|
157
158
|
default: "first",
|
|
158
|
-
validator: (e) =>
|
|
159
|
+
validator: (e) => _.includes(e) || e instanceof HTMLElement || e.startsWith("#")
|
|
159
160
|
},
|
|
160
161
|
openWithArrowKeys: {
|
|
161
162
|
type: Boolean,
|
|
162
163
|
default: !1
|
|
163
164
|
},
|
|
164
165
|
appendTo: {
|
|
165
|
-
type: [
|
|
166
|
+
type: [e, String],
|
|
166
167
|
default: "body",
|
|
167
|
-
validator: (e) =>
|
|
168
|
+
validator: (e) => m.includes(e) || e instanceof HTMLElement
|
|
168
169
|
}
|
|
169
170
|
},
|
|
170
171
|
emits: [
|
|
@@ -178,8 +179,8 @@ var L = {
|
|
|
178
179
|
],
|
|
179
180
|
data() {
|
|
180
181
|
return {
|
|
181
|
-
POPOVER_PADDING_CLASSES:
|
|
182
|
-
POPOVER_HEADER_FOOTER_PADDING_CLASSES:
|
|
182
|
+
POPOVER_PADDING_CLASSES: v,
|
|
183
|
+
POPOVER_HEADER_FOOTER_PADDING_CLASSES: g,
|
|
183
184
|
intersectionObserver: null,
|
|
184
185
|
mutationObserver: null,
|
|
185
186
|
isOutsideViewport: !1,
|
|
@@ -187,7 +188,7 @@ var L = {
|
|
|
187
188
|
toAppear: !1,
|
|
188
189
|
anchorEl: null,
|
|
189
190
|
popoverContentEl: null,
|
|
190
|
-
hasSlotContent:
|
|
191
|
+
hasSlotContent: i
|
|
191
192
|
};
|
|
192
193
|
},
|
|
193
194
|
computed: {
|
|
@@ -208,7 +209,7 @@ var L = {
|
|
|
208
209
|
return this.isOutsideViewport && this.modal ? "calc(100vh - var(--dt-space-300))" : this.maxHeight;
|
|
209
210
|
},
|
|
210
211
|
labelledBy() {
|
|
211
|
-
return this.ariaLabelledby || !this.ariaLabel &&
|
|
212
|
+
return this.ariaLabelledby || !this.ariaLabel && r("DtPopover__anchor");
|
|
212
213
|
}
|
|
213
214
|
},
|
|
214
215
|
watch: {
|
|
@@ -254,7 +255,7 @@ var L = {
|
|
|
254
255
|
}
|
|
255
256
|
},
|
|
256
257
|
mounted() {
|
|
257
|
-
o(
|
|
258
|
+
s(o(this.$el), this.$options.name), this.popoverContentEl = o(this.$refs.content?.$el), this.updateAnchorEl(), this.mutationObserver = new MutationObserver(this.updateAnchorEl), this.mutationObserver.observe(this.$refs.anchor, { childList: !0 }), this.intersectionObserver = new IntersectionObserver(this.hasIntersectedViewport), this.intersectionObserver.observe(this.popoverContentEl);
|
|
258
259
|
},
|
|
259
260
|
beforeUnmount() {
|
|
260
261
|
this._isUnmounting = !0, this.popoverContentEl && (this.popoverContentEl.style.transition = "none"), this.tip?.destroy(), this.intersectionObserver?.disconnect(), this.mutationObserver?.disconnect(), this.removeReferences(), this.removeEventListeners();
|
|
@@ -263,7 +264,7 @@ var L = {
|
|
|
263
264
|
hasIntersectedViewport(e) {
|
|
264
265
|
let t = e?.[0]?.target;
|
|
265
266
|
if (!t) return;
|
|
266
|
-
let n =
|
|
267
|
+
let n = a(t);
|
|
267
268
|
this.isOutsideViewport = n.bottom || n.top;
|
|
268
269
|
},
|
|
269
270
|
updateAnchorEl() {
|
|
@@ -277,7 +278,7 @@ var L = {
|
|
|
277
278
|
}
|
|
278
279
|
},
|
|
279
280
|
popperOptions() {
|
|
280
|
-
return
|
|
281
|
+
return p({
|
|
281
282
|
fallbackPlacements: this.fallbackPlacements,
|
|
282
283
|
tether: this.tether,
|
|
283
284
|
hasHideModifierEnabled: !0
|
|
@@ -287,7 +288,7 @@ var L = {
|
|
|
287
288
|
this.modal && this.initialFocusElement === "none" && console.error("If the popover is modal you must set the initialFocusElement prop. Possible values: \"dialog\", \"first\", HTMLElement");
|
|
288
289
|
},
|
|
289
290
|
calculateAnchorZindex() {
|
|
290
|
-
return
|
|
291
|
+
return o(this.$el).getRootNode().querySelector(".d-modal[aria-hidden=\"false\"], .d-modal--transparent[aria-hidden=\"false\"]") || this.anchorEl?.closest(".d-zi-drawer") ? 650 : 300;
|
|
291
292
|
},
|
|
292
293
|
defaultToggleOpen(e) {
|
|
293
294
|
if (!this.openOnContext && (this.open === null || this.open === void 0)) {
|
|
@@ -325,20 +326,20 @@ var L = {
|
|
|
325
326
|
},
|
|
326
327
|
preventScrolling() {
|
|
327
328
|
if (this.modal) {
|
|
328
|
-
let
|
|
329
|
-
if (!
|
|
330
|
-
|
|
329
|
+
let e = this.anchorEl?.closest("body, .tippy-box");
|
|
330
|
+
if (!e) return;
|
|
331
|
+
e.tagName?.toLowerCase() === "body" ? (t(this.anchorEl.getRootNode().host), this.tip?.setProps({ offset: this.offset })) : e.classList.add("d-zi-popover");
|
|
331
332
|
}
|
|
332
333
|
},
|
|
333
334
|
enableScrolling() {
|
|
334
335
|
let e = this.anchorEl?.closest("body, .tippy-box");
|
|
335
|
-
e && (e.tagName?.toLowerCase() === "body" ? (
|
|
336
|
+
e && (e.tagName?.toLowerCase() === "body" ? (n(this.anchorEl.getRootNode().host), this.tip?.setProps({ offset: this.offset })) : e.classList.remove("d-zi-popover"));
|
|
336
337
|
},
|
|
337
338
|
removeReferences() {
|
|
338
339
|
this.anchorEl = null, this.popoverContentEl = null, this.tip = null;
|
|
339
340
|
},
|
|
340
341
|
async onShow() {
|
|
341
|
-
this.contentWidth === "anchor" && await this.setPopoverContentAnchorWidth(), this.contentWidth === null && (this.popoverContentEl.style.width = "auto"), this.addEventListeners();
|
|
342
|
+
this.contentWidth === "anchor" && (await this.setPopoverContentAnchorWidth(), this._isUnmounting) || (this.contentWidth === null && (this.popoverContentEl.style.width = "auto"), this.addEventListeners());
|
|
342
343
|
},
|
|
343
344
|
async onLeaveTransitionComplete() {
|
|
344
345
|
if (!this._isUnmounting) {
|
|
@@ -353,11 +354,11 @@ var L = {
|
|
|
353
354
|
this._isUnmounting || (this.focusInitialElement(), await this.$nextTick(), !this._isUnmounting && (this.preventScrolling(), this.$emit("opened", !0, this.$refs.popover__content), this.open !== null && this.$emit("update:open", !0)));
|
|
354
355
|
},
|
|
355
356
|
focusInitialElement() {
|
|
356
|
-
this.initialFocusElement === "dialog" &&
|
|
357
|
+
this.initialFocusElement === "dialog" && o(this.$refs.content?.$el)?.focus(), this.initialFocusElement.startsWith("#") && this.focusInitialElementById(), this.initialFocusElement === "first" && this.focusFirstElementIfNeeded(this.$refs.popover__content), this.initialFocusElement instanceof HTMLElement && this.initialFocusElement.focus();
|
|
357
358
|
},
|
|
358
359
|
focusInitialElementById() {
|
|
359
|
-
let e =
|
|
360
|
-
e ? e.focus() : (console.warn("Could not find the element specified in dt-popover prop \"initialFocusElement\". Defaulting to focusing the dialog."),
|
|
360
|
+
let e = o(this.$refs.content?.$el)?.querySelector(this.initialFocusElement);
|
|
361
|
+
e ? e.focus() : (console.warn("Could not find the element specified in dt-popover prop \"initialFocusElement\". Defaulting to focusing the dialog."), o(this.$refs.content?.$el)?.focus());
|
|
361
362
|
},
|
|
362
363
|
onResize() {
|
|
363
364
|
this.closePopover();
|
|
@@ -372,7 +373,7 @@ var L = {
|
|
|
372
373
|
await this.$nextTick(), this.popoverContentEl.style.width = `${this.anchorEl?.clientWidth}px`;
|
|
373
374
|
},
|
|
374
375
|
focusFirstElementIfNeeded(e) {
|
|
375
|
-
this._getFocusableElements(e, !0).length === 0 ? this.showCloseButton ? this.$refs.popover__header?.focusCloseButton() :
|
|
376
|
+
this._getFocusableElements(e, !0).length === 0 ? this.showCloseButton ? this.$refs.popover__header?.focusCloseButton() : o(this.$refs.content?.$el).focus() : this.focusFirstElement(e);
|
|
376
377
|
},
|
|
377
378
|
getReferenceClientRect(e) {
|
|
378
379
|
let t = this.anchorEl?.getBoundingClientRect();
|
|
@@ -406,7 +407,7 @@ var L = {
|
|
|
406
407
|
e = this.appendTo;
|
|
407
408
|
break;
|
|
408
409
|
}
|
|
409
|
-
this.tip?.destroy(), this.tip =
|
|
410
|
+
this.tip?.destroy(), this.tip = f(this.anchorEl, {
|
|
410
411
|
popperOptions: this.popperOptions(),
|
|
411
412
|
contentElement: this.popoverContentEl,
|
|
412
413
|
placement: this.placement,
|
|
@@ -435,26 +436,26 @@ var L = {
|
|
|
435
436
|
this.$emit("mouseleave-popover-anchor");
|
|
436
437
|
}
|
|
437
438
|
}
|
|
438
|
-
},
|
|
439
|
+
}, z = [
|
|
439
440
|
"id",
|
|
440
441
|
"data-qa",
|
|
441
442
|
"tabindex"
|
|
442
|
-
],
|
|
443
|
-
function
|
|
444
|
-
let o =
|
|
445
|
-
return
|
|
443
|
+
], B = ["data-qa"];
|
|
444
|
+
function V(e, t, n, r, i, a) {
|
|
445
|
+
let o = M("popover-header-footer"), s = M("sr-only-close-button"), c = M("dt-lazy-show");
|
|
446
|
+
return A(), T("div", null, [n.modal && i.isOpen ? (A(), C(S, {
|
|
446
447
|
key: 0,
|
|
447
448
|
to: "body"
|
|
448
|
-
}, [
|
|
449
|
+
}, [E("div", {
|
|
449
450
|
class: "d-modal--transparent",
|
|
450
451
|
"aria-hidden": "false",
|
|
451
|
-
onClick: t[0] || (t[0] =
|
|
452
|
-
})])) :
|
|
452
|
+
onClick: t[0] || (t[0] = L(() => {}, ["prevent", "stop"]))
|
|
453
|
+
})])) : w("", !0), (A(), C(N(n.elementType), {
|
|
453
454
|
ref: "popover",
|
|
454
|
-
class:
|
|
455
|
+
class: k(["d-popover", { "d-popover__anchor--opened": i.isOpen }]),
|
|
455
456
|
"data-qa": "dt-popover-container"
|
|
456
457
|
}, {
|
|
457
|
-
default:
|
|
458
|
+
default: F(() => [E("div", {
|
|
458
459
|
id: !n.ariaLabelledby && a.labelledBy,
|
|
459
460
|
ref: "anchor",
|
|
460
461
|
"data-qa": e.$attrs["data-qa"] ? `${e.$attrs["data-qa"]}-anchor` : "dt-popover-anchor",
|
|
@@ -462,19 +463,19 @@ function B(e, t, n, r, i, a) {
|
|
|
462
463
|
onClickCapture: t[1] || (t[1] = (...e) => a.defaultToggleOpen && a.defaultToggleOpen(...e)),
|
|
463
464
|
onContextmenu: t[2] || (t[2] = (...e) => a.onContext && a.onContext(...e)),
|
|
464
465
|
onKeydown: [
|
|
465
|
-
t[3] || (t[3] =
|
|
466
|
-
t[4] || (t[4] =
|
|
467
|
-
t[6] || (t[6] =
|
|
468
|
-
t[7] || (t[7] =
|
|
466
|
+
t[3] || (t[3] = I(L((...e) => a.onArrowKeyPress && a.onArrowKeyPress(...e), ["prevent"]), ["up"])),
|
|
467
|
+
t[4] || (t[4] = I(L((...e) => a.onArrowKeyPress && a.onArrowKeyPress(...e), ["prevent"]), ["down"])),
|
|
468
|
+
t[6] || (t[6] = I((t) => e.$emit("keydown", t), ["enter"])),
|
|
469
|
+
t[7] || (t[7] = I((t) => e.$emit("keydown", t), ["space"]))
|
|
469
470
|
],
|
|
470
|
-
onKeydownCapture: t[5] || (t[5] =
|
|
471
|
+
onKeydownCapture: t[5] || (t[5] = I((...e) => a.closePopover && a.closePopover(...e), ["escape"])),
|
|
471
472
|
onMouseenter: t[8] || (t[8] = (...e) => a.onMouseEnter && a.onMouseEnter(...e)),
|
|
472
473
|
onMouseleave: t[9] || (t[9] = (...e) => a.onMouseLeave && a.onMouseLeave(...e))
|
|
473
|
-
}, [
|
|
474
|
+
}, [j(e.$slots, "anchor", { attrs: {
|
|
474
475
|
"aria-expanded": i.isOpen.toString(),
|
|
475
476
|
"aria-controls": n.id,
|
|
476
477
|
"aria-haspopup": n.role
|
|
477
|
-
} })], 40,
|
|
478
|
+
} })], 40, z), D(c, O({
|
|
478
479
|
id: n.id,
|
|
479
480
|
ref: "content",
|
|
480
481
|
role: n.role,
|
|
@@ -497,48 +498,48 @@ function B(e, t, n, r, i, a) {
|
|
|
497
498
|
},
|
|
498
499
|
css: e.$attrs.css,
|
|
499
500
|
tabindex: n.contentTabindex
|
|
500
|
-
},
|
|
501
|
+
}, P(a.popoverListeners), {
|
|
501
502
|
onMouseenter: a.onMouseEnterAnchor,
|
|
502
503
|
onMouseleave: a.onMouseLeaveAnchor
|
|
503
504
|
}), {
|
|
504
|
-
default:
|
|
505
|
-
i.hasSlotContent(e.$slots.headerContent) || n.showCloseButton ? (
|
|
505
|
+
default: F(() => [
|
|
506
|
+
i.hasSlotContent(e.$slots.headerContent) || n.showCloseButton ? (A(), C(o, {
|
|
506
507
|
key: 0,
|
|
507
508
|
ref: "popover__header",
|
|
508
|
-
class:
|
|
509
|
+
class: k(i.POPOVER_HEADER_FOOTER_PADDING_CLASSES[n.padding]),
|
|
509
510
|
"content-class": n.headerClass,
|
|
510
511
|
type: "header",
|
|
511
512
|
"show-close-button": n.showCloseButton,
|
|
512
513
|
onClose: a.closePopover
|
|
513
514
|
}, {
|
|
514
|
-
content:
|
|
515
|
+
content: F(() => [j(e.$slots, "headerContent", { close: a.closePopover })]),
|
|
515
516
|
_: 3
|
|
516
517
|
}, 8, [
|
|
517
518
|
"class",
|
|
518
519
|
"content-class",
|
|
519
520
|
"show-close-button",
|
|
520
521
|
"onClose"
|
|
521
|
-
])) :
|
|
522
|
-
|
|
522
|
+
])) : w("", !0),
|
|
523
|
+
E("div", {
|
|
523
524
|
ref: "popover__content",
|
|
524
525
|
"data-qa": e.$attrs["data-qa"] ? `${e.$attrs["data-qa"]}-content` : "dt-popover-content",
|
|
525
|
-
class:
|
|
526
|
+
class: k([
|
|
526
527
|
"d-popover__content",
|
|
527
528
|
i.POPOVER_PADDING_CLASSES[n.padding],
|
|
528
529
|
n.contentClass
|
|
529
530
|
])
|
|
530
|
-
}, [
|
|
531
|
-
i.hasSlotContent(e.$slots.footerContent) ? (
|
|
531
|
+
}, [j(e.$slots, "content", { close: a.closePopover })], 10, B),
|
|
532
|
+
i.hasSlotContent(e.$slots.footerContent) ? (A(), C(o, {
|
|
532
533
|
key: 1,
|
|
533
534
|
ref: "popover__footer",
|
|
534
535
|
type: "footer",
|
|
535
|
-
class:
|
|
536
|
+
class: k(i.POPOVER_HEADER_FOOTER_PADDING_CLASSES[n.padding]),
|
|
536
537
|
"content-class": n.footerClass
|
|
537
538
|
}, {
|
|
538
|
-
content:
|
|
539
|
+
content: F(() => [j(e.$slots, "footerContent", { close: a.closePopover })]),
|
|
539
540
|
_: 3
|
|
540
|
-
}, 8, ["class", "content-class"])) :
|
|
541
|
-
n.showCloseButton ?
|
|
541
|
+
}, 8, ["class", "content-class"])) : w("", !0),
|
|
542
|
+
n.showCloseButton ? w("", !0) : (A(), C(s, {
|
|
542
543
|
key: 2,
|
|
543
544
|
onClose: a.closePopover
|
|
544
545
|
}, null, 8, ["onClose"]))
|
|
@@ -565,8 +566,8 @@ function B(e, t, n, r, i, a) {
|
|
|
565
566
|
_: 3
|
|
566
567
|
}, 8, ["class"]))]);
|
|
567
568
|
}
|
|
568
|
-
var
|
|
569
|
+
var H = /* @__PURE__ */ c(R, [["render", V]]);
|
|
569
570
|
//#endregion
|
|
570
|
-
export {
|
|
571
|
+
export { H as default };
|
|
571
572
|
|
|
572
573
|
//# sourceMappingURL=popover.js.map
|