@dialpad/dialtone-vue 4.9.0 → 4.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{Combobox-WsLvegw6.js → Combobox-DP8tbe6x.js} +1 -1
- package/dist/{Combobox-WsLvegw6.js.map → Combobox-DP8tbe6x.js.map} +1 -1
- package/dist/{Combobox-96zAPv6d.cjs → Combobox-DdBIRmeH.cjs} +1 -1
- package/dist/{Combobox-96zAPv6d.cjs.map → Combobox-DdBIRmeH.cjs.map} +1 -1
- package/dist/{Datepicker-D-Lgvthq.js → Datepicker-CNFVUyyK.js} +1 -1
- package/dist/{Datepicker-D-Lgvthq.js.map → Datepicker-CNFVUyyK.js.map} +1 -1
- package/dist/{Datepicker-DmKOuf5y.cjs → Datepicker-Df6uR0r_.cjs} +1 -1
- package/dist/{Datepicker-DmKOuf5y.cjs.map → Datepicker-Df6uR0r_.cjs.map} +1 -1
- package/dist/{EmojiPicker-D46lLRMp.js → EmojiPicker-B7AKJlAM.js} +1 -1
- package/dist/{EmojiPicker-D46lLRMp.js.map → EmojiPicker-B7AKJlAM.js.map} +1 -1
- package/dist/{EmojiPicker-CXFd-iVj.cjs → EmojiPicker-KbIfc-GH.cjs} +1 -1
- package/dist/{EmojiPicker-CXFd-iVj.cjs.map → EmojiPicker-KbIfc-GH.cjs.map} +1 -1
- package/dist/{FilterPill-IBlswKiK.js → FilterPill-BR7FAmMG.js} +2 -2
- package/dist/{FilterPill-IBlswKiK.js.map → FilterPill-BR7FAmMG.js.map} +1 -1
- package/dist/FilterPill-DwapR9JK.cjs +2 -0
- package/dist/{FilterPill-DY9T19XB.cjs.map → FilterPill-DwapR9JK.cjs.map} +1 -1
- package/dist/{ForceLinkify-DhmBEXhe.cjs → ForceLinkify-D4FBhBxD.cjs} +1 -1
- package/dist/{ForceLinkify-DhmBEXhe.cjs.map → ForceLinkify-D4FBhBxD.cjs.map} +1 -1
- package/dist/{ForceLinkify-53Zegx7z.js → ForceLinkify-wTXS_wJS.js} +1 -1
- package/dist/{ForceLinkify-53Zegx7z.js.map → ForceLinkify-wTXS_wJS.js.map} +1 -1
- package/dist/{MarkdownRenderer-Cnbn7gje.js → MarkdownRenderer-3CVbodrq.js} +1 -1
- package/dist/{MarkdownRenderer-Cnbn7gje.js.map → MarkdownRenderer-3CVbodrq.js.map} +1 -1
- package/dist/{MarkdownRenderer-a12waV7r.cjs → MarkdownRenderer-CaBjENW6.cjs} +1 -1
- package/dist/{MarkdownRenderer-a12waV7r.cjs.map → MarkdownRenderer-CaBjENW6.cjs.map} +1 -1
- package/dist/{Resizable-DdP6uPio.cjs → Resizable-BQsHIvDC.cjs} +2 -2
- package/dist/{Resizable-DdP6uPio.cjs.map → Resizable-BQsHIvDC.cjs.map} +1 -1
- package/dist/{Resizable-Ddsm-H14.js → Resizable-F6PU5oKB.js} +3 -3
- package/dist/{Resizable-Ddsm-H14.js.map → Resizable-F6PU5oKB.js.map} +1 -1
- package/dist/{ResizableHandle-DQduVxrG.js → ResizableHandle-CqIIQvza.js} +3 -3
- package/dist/{ResizableHandle-DQduVxrG.js.map → ResizableHandle-CqIIQvza.js.map} +1 -1
- package/dist/{ResizableHandle-_ldmhyEw.cjs → ResizableHandle-VBoudEYy.cjs} +2 -2
- package/dist/{ResizableHandle-_ldmhyEw.cjs.map → ResizableHandle-VBoudEYy.cjs.map} +1 -1
- package/dist/{ResizableUtils-BptSHmLg.cjs → ResizableUtils-CZdVSd6q.cjs} +1 -1
- package/dist/{ResizableUtils-BptSHmLg.cjs.map → ResizableUtils-CZdVSd6q.cjs.map} +1 -1
- package/dist/{ResizableUtils-BIRNCdKB.js → ResizableUtils-CrBOa8js.js} +1 -1
- package/dist/{ResizableUtils-BIRNCdKB.js.map → ResizableUtils-CrBOa8js.js.map} +1 -1
- package/dist/{RichTextEditor-DhNhx5AH.js → RichTextEditor-DLiJCPI6.js} +5 -5
- package/dist/{RichTextEditor-DhNhx5AH.js.map → RichTextEditor-DLiJCPI6.js.map} +1 -1
- package/dist/{RichTextEditor-CjyvDYID.cjs → RichTextEditor-ECmStZDK.cjs} +2 -2
- package/dist/{RichTextEditor-CjyvDYID.cjs.map → RichTextEditor-ECmStZDK.cjs.map} +1 -1
- package/dist/{Scroller-D7MjyXun.js → Scroller-D6f0HvIT.js} +1 -1
- package/dist/{Scroller-D7MjyXun.js.map → Scroller-D6f0HvIT.js.map} +1 -1
- package/dist/{Scroller-Bt8TUghI.cjs → Scroller-EIHN3a26.cjs} +1 -1
- package/dist/{Scroller-Bt8TUghI.cjs.map → Scroller-EIHN3a26.cjs.map} +1 -1
- package/dist/{Slider-CfvbLBv5.cjs → Slider-BDgY7gNR.cjs} +2 -2
- package/dist/{Slider-CfvbLBv5.cjs.map → Slider-BDgY7gNR.cjs.map} +1 -1
- package/dist/{Slider-Xd5Aj9nS.js → Slider-Bg9KspmL.js} +3 -3
- package/dist/{Slider-Xd5Aj9nS.js.map → Slider-Bg9KspmL.js.map} +1 -1
- package/dist/Text-5MobHF6z.js +404 -0
- package/dist/Text-5MobHF6z.js.map +1 -0
- package/dist/Text-DNVNZree.cjs +2 -0
- package/dist/Text-DNVNZree.cjs.map +1 -0
- package/dist/{TextList-DUL3NwQp.cjs → TextList-1_ZM5zE3.cjs} +1 -1
- package/dist/{TextList-DUL3NwQp.cjs.map → TextList-1_ZM5zE3.cjs.map} +1 -1
- package/dist/{TextList-CkY7OAl2.js → TextList-DIj84CPZ.js} +1 -1
- package/dist/{TextList-CkY7OAl2.js.map → TextList-DIj84CPZ.js.map} +1 -1
- package/dist/{TextListItem-D96feMQf.js → TextListItem-BhmijfFO.js} +1 -1
- package/dist/{TextListItem-D96feMQf.js.map → TextListItem-BhmijfFO.js.map} +1 -1
- package/dist/{TextListItem-BI9M_J8Y.cjs → TextListItem-CVjrHr2_.cjs} +1 -1
- package/dist/{TextListItem-BI9M_J8Y.cjs.map → TextListItem-CVjrHr2_.cjs.map} +1 -1
- package/dist/{Toast-BXvUrvd_.cjs → Toast--W8p7jzA.cjs} +1 -1
- package/dist/{Toast-BXvUrvd_.cjs.map → Toast--W8p7jzA.cjs.map} +1 -1
- package/dist/{Toast-DmzQrYtG.js → Toast-4nsu1oxP.js} +1 -1
- package/dist/{Toast-DmzQrYtG.js.map → Toast-4nsu1oxP.js.map} +1 -1
- package/dist/{UseResizableCalculations-k6TSRlpa.js → UseResizableCalculations-B-yTU9ZI.js} +2 -2
- package/dist/{UseResizableCalculations-k6TSRlpa.js.map → UseResizableCalculations-B-yTU9ZI.js.map} +1 -1
- package/dist/{UseResizableCalculations-BNcxJfef.cjs → UseResizableCalculations-CahDXDOn.cjs} +2 -2
- package/dist/{UseResizableCalculations-BNcxJfef.cjs.map → UseResizableCalculations-CahDXDOn.cjs.map} +1 -1
- package/dist/component-documentation.json +1 -1
- package/dist/components/Banner/Banner.vue.d.ts +53 -1
- package/dist/components/Banner/Banner.vue.d.ts.map +1 -1
- package/dist/components/Checkbox/Checkbox.vue.d.ts +53 -1
- package/dist/components/Checkbox/Checkbox.vue.d.ts.map +1 -1
- package/dist/components/CheckboxGroup/CheckboxGroup.vue.d.ts +53 -1
- package/dist/components/Dropdown/Dropdown.vue.d.ts +0 -3
- package/dist/components/Dropdown/Dropdown.vue.d.ts.map +1 -1
- package/dist/components/EmojiPicker/EmojiPicker.vue.d.ts +53 -1
- package/dist/components/EmojiPicker/Modules/EmojiSearch.vue.d.ts +53 -1
- package/dist/components/EmojiPicker/Modules/EmojiSearch.vue.d.ts.map +1 -1
- package/dist/components/FilterPill/FilterPill.vue.d.ts +159 -6
- package/dist/components/FilterPill/FilterPill.vue.d.ts.map +1 -1
- package/dist/components/Input/Input.vue.d.ts +53 -1
- package/dist/components/Input/Input.vue.d.ts.map +1 -1
- package/dist/components/InputGroup/InputGroup.vue.d.ts +53 -1
- package/dist/components/InputGroup/InputGroup.vue.d.ts.map +1 -1
- package/dist/components/KeyboardShortcut/KeyboardShortcut.vue.d.ts +53 -1
- package/dist/components/Modal/Modal.vue.d.ts +53 -1
- package/dist/components/Modal/Modal.vue.d.ts.map +1 -1
- package/dist/components/Notice/Notice.vue.d.ts +53 -1
- package/dist/components/Notice/Notice.vue.d.ts.map +1 -1
- package/dist/components/Notice/NoticeContent.vue.d.ts +53 -1
- package/dist/components/Notice/NoticeContent.vue.d.ts.map +1 -1
- package/dist/components/Popover/Popover.vue.d.ts.map +1 -1
- package/dist/components/Radio/Radio.vue.d.ts +53 -1
- package/dist/components/Radio/Radio.vue.d.ts.map +1 -1
- package/dist/components/RadioGroup/RadioGroup.vue.d.ts +53 -1
- package/dist/components/RichTextEditor/Extensions/Mentions/MentionSuggestion.vue.d.ts +53 -1
- package/dist/components/RichTextEditor/Extensions/SlashCommand/SlashCommandSuggestion.vue.d.ts +53 -1
- package/dist/components/RichTextEditor/Extensions/Variable/VariableComponent.vue.d.ts +53 -1
- package/dist/components/SelectMenu/SelectMenu.vue.d.ts +53 -1
- package/dist/components/SelectMenu/SelectMenu.vue.d.ts.map +1 -1
- package/dist/components/SplitButton/SplitButton.vue.d.ts +0 -3
- package/dist/components/SplitButton/SplitButton.vue.d.ts.map +1 -1
- package/dist/components/Text/Text.vue.d.ts +53 -1
- package/dist/components/Text/Text.vue.d.ts.map +1 -1
- package/dist/components/Text/TextConstants.d.ts +2 -0
- package/dist/components/Text/TextConstants.d.ts.map +1 -1
- package/dist/components/Text/index.d.ts +1 -1
- package/dist/components/Text/modules/SlideViewport.vue.d.ts +38 -0
- package/dist/components/Text/modules/SlideViewport.vue.d.ts.map +1 -0
- package/dist/components/Text/modules/slide.d.ts +19 -0
- package/dist/components/Text/modules/slide.d.ts.map +1 -0
- package/dist/components/Toast/Layouts/ToastLayoutAlternate.vue.d.ts +53 -1
- package/dist/components/Toast/Layouts/ToastLayoutAlternate.vue.d.ts.map +1 -1
- package/dist/components/Toast/Layouts/ToastLayoutDefault.vue.d.ts +53 -1
- package/dist/components/Toast/Layouts/ToastLayoutDefault.vue.d.ts.map +1 -1
- package/dist/components/Toast/Toast.vue.d.ts +212 -4
- package/dist/components/Toast/Toast.vue.d.ts.map +1 -1
- package/dist/dialtone-vue.cjs +1 -1
- package/dist/dialtone-vue.js +27 -28
- package/dist/{floating-ui.dom-BUeA6pp4.js → floating-ui.dom-Cqf6X2Wc.js} +1 -1
- package/dist/{floating-ui.dom-BUeA6pp4.js.map → floating-ui.dom-Cqf6X2Wc.js.map} +1 -1
- package/dist/{floating-ui.dom-DF2uE3n8.cjs → floating-ui.dom-n1CheoWj.cjs} +1 -1
- package/dist/{floating-ui.dom-DF2uE3n8.cjs.map → floating-ui.dom-n1CheoWj.cjs.map} +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/lib/checkbox/checkbox.cjs +1 -1
- package/dist/lib/checkbox/checkbox.cjs.map +1 -1
- package/dist/lib/checkbox/checkbox.js +1 -1
- package/dist/lib/combobox/combobox.cjs +1 -1
- package/dist/lib/combobox/combobox.js +1 -1
- package/dist/lib/combobox/index.cjs +1 -1
- package/dist/lib/combobox/index.js +1 -1
- package/dist/lib/combobox-with-popover/combobox-with-popover.cjs +1 -1
- package/dist/lib/combobox-with-popover/combobox-with-popover.js +1 -1
- package/dist/lib/datepicker/datepicker.cjs +1 -1
- package/dist/lib/datepicker/datepicker.js +1 -1
- package/dist/lib/datepicker/index.cjs +1 -1
- package/dist/lib/datepicker/index.js +1 -1
- package/dist/lib/dropdown/dropdown-list.cjs +1 -1
- package/dist/lib/dropdown/dropdown-list.cjs.map +1 -1
- package/dist/lib/dropdown/dropdown-list.js +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 +5 -15
- package/dist/lib/dropdown/dropdown.js.map +1 -1
- package/dist/lib/emoji-picker/emoji-picker.cjs +1 -1
- package/dist/lib/emoji-picker/emoji-picker.js +1 -1
- package/dist/lib/emoji-picker/index.cjs +1 -1
- package/dist/lib/emoji-picker/index.js +1 -1
- package/dist/lib/empty-state/empty-state.cjs +1 -1
- package/dist/lib/empty-state/empty-state.cjs.map +1 -1
- package/dist/lib/empty-state/empty-state.js +1 -1
- package/dist/lib/filter-pill/filter-pill.cjs +1 -1
- package/dist/lib/filter-pill/filter-pill.js +1 -1
- package/dist/lib/filter-pill/index.cjs +1 -1
- package/dist/lib/filter-pill/index.js +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 +1 -1
- package/dist/lib/input-group/input-group.cjs +1 -1
- package/dist/lib/input-group/input-group.cjs.map +1 -1
- package/dist/lib/input-group/input-group.js +1 -1
- package/dist/lib/keyboard-shortcut/keyboard-shortcut.cjs +1 -1
- package/dist/lib/keyboard-shortcut/keyboard-shortcut.cjs.map +1 -1
- package/dist/lib/keyboard-shortcut/keyboard-shortcut.js +1 -1
- package/dist/lib/kitchen-sink/kitchen-sink-view.cjs +1 -1
- package/dist/lib/kitchen-sink/kitchen-sink-view.cjs.map +1 -1
- package/dist/lib/kitchen-sink/kitchen-sink-view.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 +1 -1
- package/dist/lib/notice/notice-content.cjs +1 -1
- package/dist/lib/notice/notice-content.cjs.map +1 -1
- package/dist/lib/notice/notice-content.js +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 +6 -1
- package/dist/lib/popover/popover.js.map +1 -1
- package/dist/lib/radio/radio.cjs +1 -1
- package/dist/lib/radio/radio.cjs.map +1 -1
- package/dist/lib/radio/radio.js +1 -1
- package/dist/lib/resizable/index.cjs +1 -1
- package/dist/lib/resizable/index.js +3 -3
- package/dist/lib/resizable/resizable-handle.cjs +1 -1
- package/dist/lib/resizable/resizable-handle.js +1 -1
- package/dist/lib/resizable/resizable-panel.cjs +1 -1
- package/dist/lib/resizable/resizable-panel.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/force-linkify.cjs +1 -1
- package/dist/lib/rich-text-editor/force-linkify.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/markdown-renderer.cjs +1 -1
- package/dist/lib/rich-text-editor/markdown-renderer.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/scroller/index.cjs +1 -1
- package/dist/lib/scroller/index.js +1 -1
- package/dist/lib/scroller/scroller.cjs +1 -1
- package/dist/lib/scroller/scroller.js +1 -1
- package/dist/lib/select-menu/select-menu.cjs +1 -1
- package/dist/lib/select-menu/select-menu.cjs.map +1 -1
- package/dist/lib/select-menu/select-menu.js +1 -1
- package/dist/lib/slider/index.cjs +1 -1
- package/dist/lib/slider/index.js +1 -1
- package/dist/lib/slider/slider.cjs +1 -1
- package/dist/lib/slider/slider.js +1 -1
- package/dist/lib/text/index.cjs +1 -1
- package/dist/lib/text/index.js +3 -3
- package/dist/lib/text/text-constants.cjs +1 -1
- package/dist/lib/text/text-constants.cjs.map +1 -1
- package/dist/lib/text/text-constants.js +5 -4
- package/dist/lib/text/text-constants.js.map +1 -1
- package/dist/lib/text/text.cjs +1 -2
- package/dist/lib/text/text.js +2 -184
- package/dist/lib/text-list/index.cjs +1 -1
- package/dist/lib/text-list/index.js +2 -2
- package/dist/lib/text-list/text-list-item.cjs +1 -1
- package/dist/lib/text-list/text-list-item.js +1 -1
- package/dist/lib/text-list/text-list.cjs +1 -1
- package/dist/lib/text-list/text-list.js +1 -1
- package/dist/lib/toast/index.cjs +1 -1
- package/dist/lib/toast/index.js +1 -1
- package/dist/lib/toast/toast.cjs +1 -1
- package/dist/lib/toast/toast.js +1 -1
- package/package.json +9 -4
- package/dist/FilterPill-DY9T19XB.cjs +0 -2
- package/dist/lib/text/text.cjs.map +0 -1
- package/dist/lib/text/text.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modal.cjs","names":[],"sources":["../../../components/Modal/Modal.vue"],"sourcesContent":["<template>\n <teleport\n :disabled=\"!appendTo && !autoTeleportTarget\"\n :to=\"appendTo || autoTeleportTarget\"\n >\n <!-- eslint-disable-next-line vuejs-accessibility/no-static-element-interactions -->\n <dialog\n ref=\"dialogEl\"\n v-dt-focustrap=\"{ active: open, initialFocus: false, restoreFocus: false }\"\n :class=\"[\n 'd-modal',\n MODAL_KIND_MODIFIERS[kind],\n { 'd-modal--full': fullscreen },\n { 'd-modal--transparent-backdrop': transparentBackdrop },\n modalClass,\n ]\"\n data-qa=\"dt-modal\"\n :aria-modal=\"modal ? 'true' : undefined\"\n :aria-describedby=\"describedById || undefined\"\n :aria-labelledby=\"labelledById\"\n v-bind=\"modeAttrs\"\n @cancel.prevent=\"close\"\n @mousedown=\"onBackdropMousedown\"\n @mouseup=\"onBackdropMouseup\"\n @click=\"onBackdropClick\"\n @keydown=\"onKeydown\"\n >\n <div\n v-if=\"open && (hasSlotContent($slots.banner) || bannerHeaderText)\"\n data-qa=\"dt-modal-banner\"\n :class=\"[\n 'd-modal__banner',\n bannerClass,\n bannerKindClass,\n ]\"\n >\n <!-- @slot Slot for the banner, defaults to bannerHeaderText prop -->\n <slot name=\"banner\">\n {{ bannerHeaderText }}\n </slot>\n </div>\n <transition\n :appear=\"open\"\n name=\"d-modal__dialog\"\n @after-enter=\"onAfterEnter\"\n @after-leave=\"onAfterLeave\"\n >\n <div\n v-show=\"open\"\n :class=\"[\n 'd-modal__dialog',\n { 'd-modal__dialog--scrollable': fixedHeaderFooter },\n dialogClass,\n ]\"\n >\n <div\n v-if=\"hasSlotContent($slots.header)\"\n :id=\"labelledById\"\n :class=\"['d-modal__header', headerClass]\"\n data-qa=\"dt-modal-title\"\n >\n <!-- @slot Slot for dialog header section, taking the place of any \"headerText\" text prop -->\n <slot name=\"header\" />\n </div>\n <dt-text\n v-else\n :id=\"labelledById\"\n kind=\"headline\"\n :size=\"600\"\n strength=\"medium\"\n density=\"100\"\n text-box-trim=\"start\"\n as=\"h2\"\n :class=\"['d-modal__header', headerClass]\"\n data-qa=\"dt-modal-title\"\n >\n {{ headerText }}\n </dt-text>\n <div\n v-if=\"hasSlotContent($slots.default)\"\n :class=\"[\n 'd-modal__content',\n contentClass,\n ]\"\n data-qa=\"dt-modal-copy\"\n >\n <!-- @slot Default slot for dialog body section, taking the place of any \"copy\" text prop -->\n <slot />\n </div>\n <p\n v-else\n :class=\"[\n 'd-modal__content',\n contentClass,\n ]\"\n data-qa=\"dt-modal-copy\"\n >\n {{ copy }}\n </p>\n <footer\n v-if=\"hasFooterSlot()\"\n :class=\"['d-modal__footer', footerClass]\"\n data-qa=\"dt-modal-footer\"\n >\n <!-- @slot Slot for dialog footer content, often containing cancel and confirm buttons. -->\n <slot name=\"footer\" />\n </footer>\n <sr-only-close-button\n v-if=\"!showClose\"\n @close=\"close\"\n />\n <dt-button\n v-else\n class=\"d-modal__close\"\n data-qa=\"dt-modal-close-button\"\n :size=\"300\"\n kind=\"muted\"\n importance=\"clear\"\n :aria-label=\"closeButtonTitle\"\n :title=\"closeButtonTitle\"\n @click=\"close\"\n >\n <template #icon=\"{ iconSize }\">\n <dt-icon-close\n :size=\"iconSize\"\n />\n </template>\n </dt-button>\n </div>\n </transition>\n </dialog>\n </teleport>\n</template>\n\n<script>\n/* eslint-disable max-lines */\nimport { DtButton } from '@/components/Button';\nimport { DtText } from '@/components/Text';\nimport { DtIconClose } from '@dialpad/dialtone-icons/vue';\nimport ModeMixin from '@/common/mixins/mode';\nimport {\n MODAL_BANNER_KINDS,\n MODAL_KIND_MODIFIERS,\n} from './ModalConstants';\nimport { getUniqueString, hasSlotContent, returnFirstEl, disableRootScrolling, enableRootScrolling } from '@/common/utils';\nimport { HTML_ELEMENT_TYPE } from '@/common/constants';\nimport SrOnlyCloseButton from '@/common/sr_only_close_button.vue';\nimport { NOTICE_KINDS } from '@/components/Notice';\nimport { DialtoneLocalization } from '@/localization';\n\nconst focusableSelector = 'button:not(:disabled),[href],input:not(:disabled),select:not(:disabled),' +\n 'textarea:not(:disabled),details,[tabindex]:not([tabindex=\"-1\"]):not(:disabled):not([aria-disabled=\"true\"])';\n\n/**\n * Modals focus the user's attention exclusively on one task or piece of information\n * via a window that sits on top of the page content.\n * @see https://dialtone.dialpad.com/components/modal.html\n */\nexport default {\n name: 'DtModal',\n\n components: {\n DtButton,\n DtText,\n DtIconClose,\n SrOnlyCloseButton,\n },\n\n mixins: [ModeMixin],\n\n props: {\n /**\n * Body text to display as the modal's main content.\n */\n copy: {\n type: String,\n default: '',\n },\n\n /**\n * Id to use for the dialog's aria-describedby.\n * Recommended only if the dialog content itself isn't enough to give full context,\n * as screen readers should recite the dialog contents by default before any aria-description.\n */\n describedById: {\n type: String,\n default: '',\n },\n\n /**\n * Id to use for the dialog's aria-labelledby.\n */\n labelledById: {\n type: String,\n default: function () { return getUniqueString(); },\n },\n\n /**\n * Whether the modal should be shown.\n * Parent component can sync on this value to control the modal's visibility.\n * @values true, false\n */\n open: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Header text to display in the modal header.\n */\n headerText: {\n type: String,\n default: undefined,\n },\n\n /**\n * Header text to display in the modal banner.\n */\n bannerHeaderText: {\n type: String,\n default: undefined,\n },\n\n /**\n * The theme of the modal.\n * @values default, critical\n */\n kind: {\n type: String,\n default: 'default',\n validator: (k) => Object.keys(MODAL_KIND_MODIFIERS).includes(k),\n },\n\n /**\n * Whether the modal fills the viewport instead of rendering at its default size.\n * @values true, false\n */\n fullscreen: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Additional class name for the root modal element.\n * Can accept String, Object, and Array, i.e. has the\n * same API as Vue's built-in handling of the class attribute.\n */\n modalClass: {\n type: [String, Object, Array],\n default: '',\n },\n\n /**\n * Additional class name for the dialog element within the modal.\n * Can accept String, Object, and Array, i.e. has the\n * same API as Vue's built-in handling of the class attribute.\n */\n dialogClass: {\n type: [String, Object, Array],\n default: '',\n },\n\n /**\n * Additional class name for the content element within the modal.\n * Can accept String, Object, and Array, i.e. has the\n * same API as Vue's built-in handling of the class attribute.\n */\n contentClass: {\n type: [String, Object, Array],\n default: '',\n },\n\n /**\n * Sets the color of the banner.\n * @values base, critical, info, positive, warning\n */\n bannerKind: {\n type: String,\n default: 'warning',\n validator (kind) {\n return NOTICE_KINDS.includes(kind);\n },\n },\n\n /**\n * Additional class name for the banner element within the modal.\n * Can accept String, Object, and Array, i.e. has the\n * same API as Vue's built-in handling of the class attribute.\n */\n bannerClass: {\n type: [String, Object, Array],\n default: '',\n },\n\n /**\n * Additional class name for the header element within the modal.\n * Can accept String, Object, and Array, i.e. has the\n * same API as Vue's built-in handling of the class attribute.\n */\n headerClass: {\n type: [String, Object, Array],\n default: '',\n },\n\n /**\n * Additional class name for the footer element within the modal.\n * Can accept String, Object, and Array, i.e. has the\n * same API as Vue's built-in handling of the class attribute.\n */\n footerClass: {\n type: [String, Object, Array],\n default: '',\n },\n\n /**\n * Shows the close button on the modal\n * @values true, false\n */\n showClose: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Whether the modal will close when you click outside of the dialog on the overlay.\n * @values true, false\n */\n closeOnClick: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Scrollable modal that allows scroll the modal content keeping the header and footer fixed\n * @values true, false\n */\n fixedHeaderFooter: {\n type: Boolean,\n default: true,\n },\n\n /**\n * The element that is focused when the modal is opened. This can be an\n * HTMLElement within the modal, 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 */\n initialFocusElement: {\n type: [String, HTML_ELEMENT_TYPE],\n default: 'first',\n validator: initialFocusElement => {\n return initialFocusElement === 'first' ||\n (initialFocusElement instanceof HTMLElement) ||\n initialFocusElement.startsWith('#');\n },\n },\n\n /**\n * A CSS selector string for the element to portal the modal to. If not provided, the modal will be rendered in its default location.\n */\n appendTo: {\n type: String,\n default: undefined,\n },\n\n /**\n * When true, the surrounding backdrop is rendered fully transparent\n * instead of the default dimming overlay. The dialog box itself\n * remains opaque. Useful when the underlying UI should remain visible.\n * @values true, false\n */\n transparentBackdrop: {\n type: Boolean,\n default: false,\n },\n\n /**\n * When true, the dialog opens with showModal(), which promotes it to the browser\n * top layer. Nothing outside the top layer can paint above it regardless of\n * z-index, so application surfaces such as toasts and call notifications end up\n * behind it. When false, it opens with show() and stays in the normal stacking\n * order, where the Dialtone z-index scale applies and --zi-notification (700)\n * outranks --zi-modal (600) as documented.\n *\n * Focus trapping, scroll locking and Esc-to-close behave identically in both\n * modes. Background inertness does not: only the top layer provides it, so with\n * modal unset the page outside the dialog stays reachable. That is deliberate —\n * it is what lets an application's own overlays remain usable above a modal —\n * and keyboard containment still comes from the focus trap.\n * @values true, false\n */\n modal: {\n type: Boolean,\n default: false,\n },\n },\n\n emits: [\n /**\n * Native button click event\n *\n * @event click\n * @type {PointerEvent | KeyboardEvent}\n */\n 'click',\n\n /**\n * Native keydown event\n *\n * @event keydown\n * @type {KeyboardEvent}\n */\n 'keydown',\n\n /**\n * The modal will emit a \"false\" boolean value for this event when the user performs a modal-closing action.\n * Parent components can sync on this value to create a 2-way binding to control modal visibility.\n *\n * @event update:open\n * @type {Boolean}\n */\n 'update:open',\n ],\n\n data () {\n return {\n MODAL_KIND_MODIFIERS,\n MODAL_BANNER_KINDS,\n hasSlotContent,\n i18n: new DialtoneLocalization(),\n autoTeleportTarget: null,\n mousedownOnBackdrop: false,\n mouseupOnBackdrop: false,\n };\n },\n\n computed: {\n bannerKindClass () {\n return MODAL_BANNER_KINDS[this.bannerKind];\n },\n\n closeButtonTitle () {\n return this.i18n.$t('DIALTONE_CLOSE_BUTTON');\n },\n },\n\n watch: {\n open (isShowing) {\n this.syncDialogState(isShowing);\n },\n },\n\n mounted () {\n if (!this.appendTo) {\n const root = this.$el?.getRootNode();\n if (root instanceof ShadowRoot) {\n this.autoTeleportTarget = root;\n // Defer syncDialogState so the teleport renders inside the shadow root first.\n if (this.open) this.$nextTick(() => { if (this.open) this.syncDialogState(true); });\n return;\n }\n }\n if (this.open) {\n this.syncDialogState(true);\n }\n },\n\n beforeUnmount () {\n const dialogEl = this.$refs.dialogEl;\n if (dialogEl?.open) {\n dialogEl.close();\n enableRootScrolling(this.getScrollRoot());\n }\n this.previousActiveElement = null;\n },\n\n methods: {\n // Reads $slots, which is not reactive, so it must not be cached as a computed.\n hasFooterSlot () {\n return !!this.$slots.footer;\n },\n\n getScrollRoot () {\n return returnFirstEl(this.$refs.dialogEl)?.getRootNode()?.host;\n },\n\n syncDialogState (isShowing) {\n const dialogEl = this.$refs.dialogEl;\n if (!dialogEl) return;\n\n if (isShowing) {\n this.previousActiveElement = document.activeElement;\n if (!dialogEl.open) {\n // show() leaves the dialog in the normal stacking order instead of the\n // top layer, where the z-index scale still applies.\n if (this.modal) dialogEl.showModal(); else dialogEl.show();\n }\n disableRootScrolling(this.getScrollRoot());\n } else if (dialogEl.open) {\n // Leave transition plays via v-show on inner content.\n // close() is called in onAfterLeave when transition completes.\n enableRootScrolling(this.getScrollRoot());\n }\n },\n\n\n\n close () {\n this.$emit('update:open', false);\n },\n\n onBackdropMousedown (event) {\n this.mousedownOnBackdrop = event.target === event.currentTarget;\n },\n\n onBackdropMouseup (event) {\n this.mouseupOnBackdrop = event.target === event.currentTarget;\n },\n\n onBackdropClick (event) {\n const pressedAndReleasedOnBackdrop = this.mousedownOnBackdrop && this.mouseupOnBackdrop;\n if (this.closeOnClick && event.target === event.currentTarget && pressedAndReleasedOnBackdrop) {\n this.close();\n }\n this.$emit('click', event);\n },\n\n onKeydown (event) {\n // The native cancel event only fires for dialogs opened with showModal(), so\n // Esc has to be handled explicitly to keep dismissal identical in both modes.\n // defaultPrevented means a nested widget (dropdown, combobox) already consumed\n // it to close itself, and the modal must not close out from under it.\n if (!this.modal && event.key === 'Escape' && !event.defaultPrevented) {\n event.preventDefault();\n this.close();\n }\n this.$emit('keydown', event);\n },\n\n async onAfterEnter () {\n this.$emit('update:open', true);\n await this.setFocusAfterTransition();\n },\n\n onAfterLeave () {\n const dialogEl = this.$refs.dialogEl;\n if (dialogEl?.open) {\n dialogEl.close();\n }\n this.previousActiveElement?.focus();\n this.previousActiveElement = null;\n },\n\n focusFirstTabbable (container) {\n const focusable = [...container.querySelectorAll(focusableSelector)];\n if (!focusable.length) return;\n let target = focusable[0];\n // If first focusable is an unchecked radio, prefer the checked radio in the same group.\n if (target.matches('[type=\"radio\"]:not(:checked)')) {\n target = focusable.find(el => el.checked && el.name === target.name) || target;\n }\n target.focus({ preventScroll: true });\n },\n\n async setFocusAfterTransition () {\n const dialogEl = this.$refs.dialogEl;\n if (!dialogEl) return;\n\n await this.$nextTick();\n\n if (this.initialFocusElement === 'first') {\n this.focusFirstTabbable(dialogEl);\n } else if (typeof this.initialFocusElement === 'string' && this.initialFocusElement.startsWith('#')) {\n const el = dialogEl.querySelector(this.initialFocusElement);\n if (el) {\n el.focus();\n } else {\n // eslint-disable-next-line no-console\n console.warn('Could not find the element specified in dt-modal prop \"initialFocusElement\". ' +\n 'Defaulting to focusing the first element.');\n this.focusFirstTabbable(dialogEl);\n }\n } else if (this.initialFocusElement instanceof HTMLElement) {\n this.initialFocusElement.focus();\n }\n },\n },\n};\n</script>\n"],"mappings":"+mBAsJA,IAAM,EAAoB,qLAQrB,EAAU,CACb,KAAM,UAEN,WAAY,CACV,SAAA,EAAA,QACA,OAAA,EAAA,QACA,YAAA,EAAA,YACA,kBAAA,EAAA,QACD,CAED,OAAQ,CAAC,EAAA,QAAU,CAEnB,MAAO,CAIL,KAAM,CACJ,KAAM,OACN,QAAS,GACV,CAOD,cAAe,CACb,KAAM,OACN,QAAS,GACV,CAKD,aAAc,CACZ,KAAM,OACN,QAAS,UAAY,CAAE,OAAO,EAAA,iBAAiB,EAChD,CAOD,KAAM,CACJ,KAAM,QACN,QAAS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A,+CAmBG,EAAA,OAdV,MAAM,iBACN,UAAQ,wBACP,KAAM,IACP,KAAK,QACL,WAAW,QACV,aAAY,EAAA,iBACZ,MAAO,EAAA,iBACP,QAAO,EAAA,QAEG,MAAA,EAAA,EAAA,UAGP,CAHe,cAAQ,EAAA,EAAA,EAAA,aAGvB,EAAA,CADC,KAAM,EAAQ,CAAA,KAAA,EAAA,CAAA,OAAA,CAAA,CAAA,CAAA,6CAhBZ,EAAA,EAAA,YAAA,EAAA,EAAA,EAAA,aAEP,EAAA,OADC,QAAO,EAAA,0CA7DF,EAAA,KAAI,CAAA,CAAA,CAAA,CAAA,sEAxCU,EAAA,KAAI,aAAA,GAAA,aAAA,GAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,WAAA,KAAA,CAAA"}
|
|
1
|
+
{"version":3,"file":"modal.cjs","names":[],"sources":["../../../components/Modal/Modal.vue"],"sourcesContent":["<template>\n <teleport\n :disabled=\"!appendTo && !autoTeleportTarget\"\n :to=\"appendTo || autoTeleportTarget\"\n >\n <!-- eslint-disable-next-line vuejs-accessibility/no-static-element-interactions -->\n <dialog\n ref=\"dialogEl\"\n v-dt-focustrap=\"{ active: open, initialFocus: false, restoreFocus: false }\"\n :class=\"[\n 'd-modal',\n MODAL_KIND_MODIFIERS[kind],\n { 'd-modal--full': fullscreen },\n { 'd-modal--transparent-backdrop': transparentBackdrop },\n modalClass,\n ]\"\n data-qa=\"dt-modal\"\n :aria-modal=\"modal ? 'true' : undefined\"\n :aria-describedby=\"describedById || undefined\"\n :aria-labelledby=\"labelledById\"\n v-bind=\"modeAttrs\"\n @cancel.prevent=\"close\"\n @mousedown=\"onBackdropMousedown\"\n @mouseup=\"onBackdropMouseup\"\n @click=\"onBackdropClick\"\n @keydown=\"onKeydown\"\n >\n <div\n v-if=\"open && (hasSlotContent($slots.banner) || bannerHeaderText)\"\n data-qa=\"dt-modal-banner\"\n :class=\"[\n 'd-modal__banner',\n bannerClass,\n bannerKindClass,\n ]\"\n >\n <!-- @slot Slot for the banner, defaults to bannerHeaderText prop -->\n <slot name=\"banner\">\n {{ bannerHeaderText }}\n </slot>\n </div>\n <transition\n :appear=\"open\"\n name=\"d-modal__dialog\"\n @after-enter=\"onAfterEnter\"\n @after-leave=\"onAfterLeave\"\n >\n <div\n v-show=\"open\"\n :class=\"[\n 'd-modal__dialog',\n { 'd-modal__dialog--scrollable': fixedHeaderFooter },\n dialogClass,\n ]\"\n >\n <div\n v-if=\"hasSlotContent($slots.header)\"\n :id=\"labelledById\"\n :class=\"['d-modal__header', headerClass]\"\n data-qa=\"dt-modal-title\"\n >\n <!-- @slot Slot for dialog header section, taking the place of any \"headerText\" text prop -->\n <slot name=\"header\" />\n </div>\n <dt-text\n v-else\n :id=\"labelledById\"\n kind=\"headline\"\n :size=\"600\"\n strength=\"medium\"\n density=\"100\"\n text-box-trim=\"start\"\n as=\"h2\"\n :class=\"['d-modal__header', headerClass]\"\n data-qa=\"dt-modal-title\"\n >\n {{ headerText }}\n </dt-text>\n <div\n v-if=\"hasSlotContent($slots.default)\"\n :class=\"[\n 'd-modal__content',\n contentClass,\n ]\"\n data-qa=\"dt-modal-copy\"\n >\n <!-- @slot Default slot for dialog body section, taking the place of any \"copy\" text prop -->\n <slot />\n </div>\n <p\n v-else\n :class=\"[\n 'd-modal__content',\n contentClass,\n ]\"\n data-qa=\"dt-modal-copy\"\n >\n {{ copy }}\n </p>\n <footer\n v-if=\"hasFooterSlot()\"\n :class=\"['d-modal__footer', footerClass]\"\n data-qa=\"dt-modal-footer\"\n >\n <!-- @slot Slot for dialog footer content, often containing cancel and confirm buttons. -->\n <slot name=\"footer\" />\n </footer>\n <sr-only-close-button\n v-if=\"!showClose\"\n @close=\"close\"\n />\n <dt-button\n v-else\n class=\"d-modal__close\"\n data-qa=\"dt-modal-close-button\"\n :size=\"300\"\n kind=\"muted\"\n importance=\"clear\"\n :aria-label=\"closeButtonTitle\"\n :title=\"closeButtonTitle\"\n @click=\"close\"\n >\n <template #icon=\"{ iconSize }\">\n <dt-icon-close\n :size=\"iconSize\"\n />\n </template>\n </dt-button>\n </div>\n </transition>\n </dialog>\n </teleport>\n</template>\n\n<script>\n/* eslint-disable max-lines */\nimport { DtButton } from '@/components/Button';\nimport { DtText } from '@/components/Text';\nimport { DtIconClose } from '@dialpad/dialtone-icons/vue';\nimport ModeMixin from '@/common/mixins/mode';\nimport {\n MODAL_BANNER_KINDS,\n MODAL_KIND_MODIFIERS,\n} from './ModalConstants';\nimport { getUniqueString, hasSlotContent, returnFirstEl, disableRootScrolling, enableRootScrolling } from '@/common/utils';\nimport { HTML_ELEMENT_TYPE } from '@/common/constants';\nimport SrOnlyCloseButton from '@/common/sr_only_close_button.vue';\nimport { NOTICE_KINDS } from '@/components/Notice';\nimport { DialtoneLocalization } from '@/localization';\n\nconst focusableSelector = 'button:not(:disabled),[href],input:not(:disabled),select:not(:disabled),' +\n 'textarea:not(:disabled),details,[tabindex]:not([tabindex=\"-1\"]):not(:disabled):not([aria-disabled=\"true\"])';\n\n/**\n * Modals focus the user's attention exclusively on one task or piece of information\n * via a window that sits on top of the page content.\n * @see https://dialtone.dialpad.com/components/modal.html\n */\nexport default {\n name: 'DtModal',\n\n components: {\n DtButton,\n DtText,\n DtIconClose,\n SrOnlyCloseButton,\n },\n\n mixins: [ModeMixin],\n\n props: {\n /**\n * Body text to display as the modal's main content.\n */\n copy: {\n type: String,\n default: '',\n },\n\n /**\n * Id to use for the dialog's aria-describedby.\n * Recommended only if the dialog content itself isn't enough to give full context,\n * as screen readers should recite the dialog contents by default before any aria-description.\n */\n describedById: {\n type: String,\n default: '',\n },\n\n /**\n * Id to use for the dialog's aria-labelledby.\n */\n labelledById: {\n type: String,\n default: function () { return getUniqueString(); },\n },\n\n /**\n * Whether the modal should be shown.\n * Parent component can sync on this value to control the modal's visibility.\n * @values true, false\n */\n open: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Header text to display in the modal header.\n */\n headerText: {\n type: String,\n default: undefined,\n },\n\n /**\n * Header text to display in the modal banner.\n */\n bannerHeaderText: {\n type: String,\n default: undefined,\n },\n\n /**\n * The theme of the modal.\n * @values default, critical\n */\n kind: {\n type: String,\n default: 'default',\n validator: (k) => Object.keys(MODAL_KIND_MODIFIERS).includes(k),\n },\n\n /**\n * Whether the modal fills the viewport instead of rendering at its default size.\n * @values true, false\n */\n fullscreen: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Additional class name for the root modal element.\n * Can accept String, Object, and Array, i.e. has the\n * same API as Vue's built-in handling of the class attribute.\n */\n modalClass: {\n type: [String, Object, Array],\n default: '',\n },\n\n /**\n * Additional class name for the dialog element within the modal.\n * Can accept String, Object, and Array, i.e. has the\n * same API as Vue's built-in handling of the class attribute.\n */\n dialogClass: {\n type: [String, Object, Array],\n default: '',\n },\n\n /**\n * Additional class name for the content element within the modal.\n * Can accept String, Object, and Array, i.e. has the\n * same API as Vue's built-in handling of the class attribute.\n */\n contentClass: {\n type: [String, Object, Array],\n default: '',\n },\n\n /**\n * Sets the color of the banner.\n * @values base, critical, info, positive, warning\n */\n bannerKind: {\n type: String,\n default: 'warning',\n validator (kind) {\n return NOTICE_KINDS.includes(kind);\n },\n },\n\n /**\n * Additional class name for the banner element within the modal.\n * Can accept String, Object, and Array, i.e. has the\n * same API as Vue's built-in handling of the class attribute.\n */\n bannerClass: {\n type: [String, Object, Array],\n default: '',\n },\n\n /**\n * Additional class name for the header element within the modal.\n * Can accept String, Object, and Array, i.e. has the\n * same API as Vue's built-in handling of the class attribute.\n */\n headerClass: {\n type: [String, Object, Array],\n default: '',\n },\n\n /**\n * Additional class name for the footer element within the modal.\n * Can accept String, Object, and Array, i.e. has the\n * same API as Vue's built-in handling of the class attribute.\n */\n footerClass: {\n type: [String, Object, Array],\n default: '',\n },\n\n /**\n * Shows the close button on the modal\n * @values true, false\n */\n showClose: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Whether the modal will close when you click outside of the dialog on the overlay.\n * @values true, false\n */\n closeOnClick: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Scrollable modal that allows scroll the modal content keeping the header and footer fixed\n * @values true, false\n */\n fixedHeaderFooter: {\n type: Boolean,\n default: true,\n },\n\n /**\n * The element that is focused when the modal is opened. This can be an\n * HTMLElement within the modal, 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 */\n initialFocusElement: {\n type: [String, HTML_ELEMENT_TYPE],\n default: 'first',\n validator: initialFocusElement => {\n return initialFocusElement === 'first' ||\n (initialFocusElement instanceof HTMLElement) ||\n initialFocusElement.startsWith('#');\n },\n },\n\n /**\n * A CSS selector string for the element to portal the modal to. If not provided, the modal will be rendered in its default location.\n */\n appendTo: {\n type: String,\n default: undefined,\n },\n\n /**\n * When true, the surrounding backdrop is rendered fully transparent\n * instead of the default dimming overlay. The dialog box itself\n * remains opaque. Useful when the underlying UI should remain visible.\n * @values true, false\n */\n transparentBackdrop: {\n type: Boolean,\n default: false,\n },\n\n /**\n * When true, the dialog opens with showModal(), which promotes it to the browser\n * top layer. Nothing outside the top layer can paint above it regardless of\n * z-index, so application surfaces such as toasts and call notifications end up\n * behind it. When false, it opens with show() and stays in the normal stacking\n * order, where the Dialtone z-index scale applies and --zi-notification (700)\n * outranks --zi-modal (600) as documented.\n *\n * Focus trapping, scroll locking and Esc-to-close behave identically in both\n * modes. Background inertness does not: only the top layer provides it, so with\n * modal unset the page outside the dialog stays reachable. That is deliberate —\n * it is what lets an application's own overlays remain usable above a modal —\n * and keyboard containment still comes from the focus trap.\n * @values true, false\n */\n modal: {\n type: Boolean,\n default: false,\n },\n },\n\n emits: [\n /**\n * Native button click event\n *\n * @event click\n * @type {PointerEvent | KeyboardEvent}\n */\n 'click',\n\n /**\n * Native keydown event\n *\n * @event keydown\n * @type {KeyboardEvent}\n */\n 'keydown',\n\n /**\n * The modal will emit a \"false\" boolean value for this event when the user performs a modal-closing action.\n * Parent components can sync on this value to create a 2-way binding to control modal visibility.\n *\n * @event update:open\n * @type {Boolean}\n */\n 'update:open',\n ],\n\n data () {\n return {\n MODAL_KIND_MODIFIERS,\n MODAL_BANNER_KINDS,\n hasSlotContent,\n i18n: new DialtoneLocalization(),\n autoTeleportTarget: null,\n mousedownOnBackdrop: false,\n mouseupOnBackdrop: false,\n };\n },\n\n computed: {\n bannerKindClass () {\n return MODAL_BANNER_KINDS[this.bannerKind];\n },\n\n closeButtonTitle () {\n return this.i18n.$t('DIALTONE_CLOSE_BUTTON');\n },\n },\n\n watch: {\n open (isShowing) {\n this.syncDialogState(isShowing);\n },\n },\n\n mounted () {\n if (!this.appendTo) {\n const root = this.$el?.getRootNode();\n if (root instanceof ShadowRoot) {\n this.autoTeleportTarget = root;\n // Defer syncDialogState so the teleport renders inside the shadow root first.\n if (this.open) this.$nextTick(() => { if (this.open) this.syncDialogState(true); });\n return;\n }\n }\n if (this.open) {\n this.syncDialogState(true);\n }\n },\n\n beforeUnmount () {\n const dialogEl = this.$refs.dialogEl;\n if (dialogEl?.open) {\n dialogEl.close();\n enableRootScrolling(this.getScrollRoot());\n }\n this.previousActiveElement = null;\n },\n\n methods: {\n // Reads $slots, which is not reactive, so it must not be cached as a computed.\n hasFooterSlot () {\n return !!this.$slots.footer;\n },\n\n getScrollRoot () {\n return returnFirstEl(this.$refs.dialogEl)?.getRootNode()?.host;\n },\n\n syncDialogState (isShowing) {\n const dialogEl = this.$refs.dialogEl;\n if (!dialogEl) return;\n\n if (isShowing) {\n this.previousActiveElement = document.activeElement;\n if (!dialogEl.open) {\n // show() leaves the dialog in the normal stacking order instead of the\n // top layer, where the z-index scale still applies.\n if (this.modal) dialogEl.showModal(); else dialogEl.show();\n }\n disableRootScrolling(this.getScrollRoot());\n } else if (dialogEl.open) {\n // Leave transition plays via v-show on inner content.\n // close() is called in onAfterLeave when transition completes.\n enableRootScrolling(this.getScrollRoot());\n }\n },\n\n\n\n close () {\n this.$emit('update:open', false);\n },\n\n onBackdropMousedown (event) {\n this.mousedownOnBackdrop = event.target === event.currentTarget;\n },\n\n onBackdropMouseup (event) {\n this.mouseupOnBackdrop = event.target === event.currentTarget;\n },\n\n onBackdropClick (event) {\n const pressedAndReleasedOnBackdrop = this.mousedownOnBackdrop && this.mouseupOnBackdrop;\n if (this.closeOnClick && event.target === event.currentTarget && pressedAndReleasedOnBackdrop) {\n this.close();\n }\n this.$emit('click', event);\n },\n\n onKeydown (event) {\n // The native cancel event only fires for dialogs opened with showModal(), so\n // Esc has to be handled explicitly to keep dismissal identical in both modes.\n // defaultPrevented means a nested widget (dropdown, combobox) already consumed\n // it to close itself, and the modal must not close out from under it.\n if (!this.modal && event.key === 'Escape' && !event.defaultPrevented) {\n event.preventDefault();\n this.close();\n }\n this.$emit('keydown', event);\n },\n\n async onAfterEnter () {\n this.$emit('update:open', true);\n await this.setFocusAfterTransition();\n },\n\n onAfterLeave () {\n const dialogEl = this.$refs.dialogEl;\n if (dialogEl?.open) {\n dialogEl.close();\n }\n this.previousActiveElement?.focus();\n this.previousActiveElement = null;\n },\n\n focusFirstTabbable (container) {\n const focusable = [...container.querySelectorAll(focusableSelector)];\n if (!focusable.length) return;\n let target = focusable[0];\n // If first focusable is an unchecked radio, prefer the checked radio in the same group.\n if (target.matches('[type=\"radio\"]:not(:checked)')) {\n target = focusable.find(el => el.checked && el.name === target.name) || target;\n }\n target.focus({ preventScroll: true });\n },\n\n async setFocusAfterTransition () {\n const dialogEl = this.$refs.dialogEl;\n if (!dialogEl) return;\n\n await this.$nextTick();\n\n if (this.initialFocusElement === 'first') {\n this.focusFirstTabbable(dialogEl);\n } else if (typeof this.initialFocusElement === 'string' && this.initialFocusElement.startsWith('#')) {\n const el = dialogEl.querySelector(this.initialFocusElement);\n if (el) {\n el.focus();\n } else {\n // eslint-disable-next-line no-console\n console.warn('Could not find the element specified in dt-modal prop \"initialFocusElement\". ' +\n 'Defaulting to focusing the first element.');\n this.focusFirstTabbable(dialogEl);\n }\n } else if (this.initialFocusElement instanceof HTM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CAAA,EAAA,IAAA,EAAA,EAAA,YAAA,EAAA,EAAA,EAAA,oBAWN,IAAA,OAPD,OAAA,EAAA,EAAA,gBAAK,CAAA,mBAAoD,EAAA,aAAA,CAAA,CAI1D,UAAQ,uCAEL,EAAA,KAAI,CAAA,EAAA,EAGD,EAAA,eAAa,GAAA,EAAA,EAAA,YAAA,EAAA,EAAA,EAAA,oBAMZ,SAAA,OALN,OAAA,EAAA,EAAA,gBAAK,CAAA,kBAAsB,EAAA,YAAW,CAAA,CACvC,UAAQ,qCAGc,EAAA,OAAA,SAAA,CAAA,CAAA,EAAA,GAAA,EAAA,EAAA,oBAAA,GAAA,GAAA,CAGf,EAAA,+CAmBG,EAAA,OAdV,MAAM,iBACN,UAAQ,wBACP,KAAM,IACP,KAAK,QACL,WAAW,QACV,aAAY,EAAA,iBACZ,MAAO,EAAA,iBACP,QAAO,EAAA,QAEG,MAAA,EAAA,EAAA,UAGP,CAHe,cAAQ,EAAA,EAAA,EAAA,aAGvB,EAAA,CADC,KAAM,EAAQ,CAAA,KAAA,EAAA,CAAA,OAAA,CAAA,CAAA,CAAA,6CAhBZ,EAAA,EAAA,YAAA,EAAA,EAAA,EAAA,aAEP,EAAA,OADC,QAAO,EAAA,0CA7DF,EAAA,KAAI,CAAA,CAAA,CAAA,CAAA,sEAxCU,EAAA,KAAI,aAAA,GAAA,aAAA,GAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,WAAA,KAAA,CAAA"}
|
package/dist/lib/modal/modal.js
CHANGED
|
@@ -3,7 +3,7 @@ import { disableRootScrolling as t, enableRootScrolling as n, getUniqueString as
|
|
|
3
3
|
import { t as o } from "../../_plugin-vue_export-helper-BTgDAbhb.js";
|
|
4
4
|
import s from "../../common/mixins/mode.js";
|
|
5
5
|
import { NOTICE_KINDS as c } from "../notice/notice-constants.js";
|
|
6
|
-
import l from "
|
|
6
|
+
import { t as l } from "../../Text-5MobHF6z.js";
|
|
7
7
|
import { DialtoneLocalization as u } from "../../localization/index.js";
|
|
8
8
|
import d from "../button/button.js";
|
|
9
9
|
import f from "../../shared/sr_only_close_button.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}}),require(`../../chunk-Bmb41Sf3.cjs`);const e=require(`../../common/utils/index.cjs`),t=require(`../../_plugin-vue_export-helper-D8jCH6HB.cjs`),n=require(
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}}),require(`../../chunk-Bmb41Sf3.cjs`);const e=require(`../../common/utils/index.cjs`),t=require(`../../_plugin-vue_export-helper-D8jCH6HB.cjs`),n=require(`../../Text-DNVNZree.cjs`);let r=require(`vue`);var i={name:`DtNoticeContent`,components:{DtText:n.t},props:{headerText:{type:String,default:void 0},message:{type:String,default:void 0},headerId:{type:String,default:void 0},contentId:{type:String,default:void 0},headerClass:{type:[String,Array,Object],default:``},contentClass:{type:[String,Array,Object],default:``}},data(){return{hasSlotContent:e.hasSlotContent}}};function a(e,t,n,i,a,o){let s=(0,r.resolveComponent)(`dt-text`);return(0,r.openBlock)(),(0,r.createElementBlock)(`div`,{class:(0,r.normalizeClass)([`d-notice__content`,n.contentClass]),"data-qa":`notice-content`},[n.headerText||a.hasSlotContent(e.$slots.header)?((0,r.openBlock)(),(0,r.createBlock)(s,{key:0,id:n.headerId,kind:`headline`,size:300,density:`200`,wrap:`pretty`,as:`p`,class:(0,r.normalizeClass)([`d-notice__title`,n.headerClass]),"data-qa":`notice-content-title`},{default:(0,r.withCtx)(()=>[(0,r.renderSlot)(e.$slots,`header`,{},()=>[(0,r.createTextVNode)((0,r.toDisplayString)(n.headerText),1)])]),_:3},8,[`id`,`class`])):(0,r.createCommentVNode)(``,!0),n.message||a.hasSlotContent(e.$slots.default)?((0,r.openBlock)(),(0,r.createBlock)(s,{key:1,id:n.contentId,kind:`body`,size:200,wrap:`pretty`,as:`p`,class:`d-notice__message`,"data-qa":`notice-content-message`},{default:(0,r.withCtx)(()=>[(0,r.renderSlot)(e.$slots,`default`,{},()=>[(0,r.createTextVNode)((0,r.toDisplayString)(n.message),1)])]),_:3},8,[`id`])):(0,r.createCommentVNode)(``,!0)],2)}var o=t.t(i,[[`render`,a]]);exports.default=o;
|
|
2
2
|
//# sourceMappingURL=notice-content.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notice-content.cjs","names":[],"sources":["../../../components/Notice/NoticeContent.vue"],"sourcesContent":["<template>\n <div\n :class=\"['d-notice__content', contentClass]\"\n data-qa=\"notice-content\"\n >\n <dt-text\n v-if=\"headerText || hasSlotContent($slots.header)\"\n :id=\"headerId\"\n kind=\"headline\"\n :size=\"300\"\n density=\"200\"\n wrap=\"pretty\"\n as=\"p\"\n :class=\"['d-notice__title', headerClass]\"\n data-qa=\"notice-content-title\"\n >\n <!-- @slot Slot for the header -->\n <slot name=\"header\">\n {{ headerText }}\n </slot>\n </dt-text>\n <dt-text\n v-if=\"message || hasSlotContent($slots.default)\"\n :id=\"contentId\"\n kind=\"body\"\n :size=\"200\"\n wrap=\"pretty\"\n as=\"p\"\n class=\"d-notice__message\"\n data-qa=\"notice-content-message\"\n >\n <!-- @slot Slot for main content -->\n <slot>\n {{ message }}\n </slot>\n </dt-text>\n </div>\n</template>\n\n<script>\nimport { hasSlotContent } from '@/common/utils';\nimport { DtText } from '@/components/Text';\n\nexport default {\n name: 'DtNoticeContent',\n\n components: { DtText },\n\n props: {\n /**\n * Header text of the notice. This can be left blank to remove the header from the notice entirely.\n * Can also be overridden with the header slot.\n */\n headerText: {\n type: String,\n default: undefined,\n },\n\n /**\n * The main textual content of the notice. Rendered as the fallback of the default slot so\n * that, like headerText, an absent or empty value leaves the slot empty and the message\n * paragraph is not rendered at all.\n */\n message: {\n type: String,\n default: undefined,\n },\n\n /**\n * ID for the header element of the component. Useful for aria-describedby\n * or aria-labelledby or any other reason you may need an id to refer to the header.\n */\n headerId: {\n type: String,\n default: undefined,\n },\n\n /**\n * ID for the content element of the component. Useful for aria-describedby\n * or aria-labelledby or any other reason you may need an id to refer to the content.\n */\n contentId: {\n type: String,\n default: undefined,\n },\n\n /**\n * Additional class name for the header wrapper element.\n */\n headerClass: {\n type: [String, Array, Object],\n default: '',\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 data () {\n return {\n hasSlotContent,\n };\n },\n};\n</script>\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"notice-content.cjs","names":[],"sources":["../../../components/Notice/NoticeContent.vue"],"sourcesContent":["<template>\n <div\n :class=\"['d-notice__content', contentClass]\"\n data-qa=\"notice-content\"\n >\n <dt-text\n v-if=\"headerText || hasSlotContent($slots.header)\"\n :id=\"headerId\"\n kind=\"headline\"\n :size=\"300\"\n density=\"200\"\n wrap=\"pretty\"\n as=\"p\"\n :class=\"['d-notice__title', headerClass]\"\n data-qa=\"notice-content-title\"\n >\n <!-- @slot Slot for the header -->\n <slot name=\"header\">\n {{ headerText }}\n </slot>\n </dt-text>\n <dt-text\n v-if=\"message || hasSlotContent($slots.default)\"\n :id=\"contentId\"\n kind=\"body\"\n :size=\"200\"\n wrap=\"pretty\"\n as=\"p\"\n class=\"d-notice__message\"\n data-qa=\"notice-content-message\"\n >\n <!-- @slot Slot for main content -->\n <slot>\n {{ message }}\n </slot>\n </dt-text>\n </div>\n</template>\n\n<script>\nimport { hasSlotContent } from '@/common/utils';\nimport { DtText } from '@/components/Text';\n\nexport default {\n name: 'DtNoticeContent',\n\n components: { DtText },\n\n props: {\n /**\n * Header text of the notice. This can be left blank to remove the header from the notice entirely.\n * Can also be overridden with the header slot.\n */\n headerText: {\n type: String,\n default: undefined,\n },\n\n /**\n * The main textual content of the notice. Rendered as the fallback of the default slot so\n * that, like headerText, an absent or empty value leaves the slot empty and the message\n * paragraph is not rendered at all.\n */\n message: {\n type: String,\n default: undefined,\n },\n\n /**\n * ID for the header element of the component. Useful for aria-describedby\n * or aria-labelledby or any other reason you may need an id to refer to the header.\n */\n headerId: {\n type: String,\n default: undefined,\n },\n\n /**\n * ID for the content element of the component. Useful for aria-describedby\n * or aria-labelledby or any other reason you may need an id to refer to the content.\n */\n contentId: {\n type: String,\n default: undefined,\n },\n\n /**\n * Additional class name for the header wrapper element.\n */\n headerClass: {\n type: [String, Array, Object],\n default: '',\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 data () {\n return {\n hasSlotContent,\n };\n },\n};\n</script>\n"],"mappings":"uSA2CA,IAAK,EAAU,CACb,KAAM,kBAEN,WAAY,CAAE,OAAA,EAAA,EAAQ,CAEtB,MAAO,CAKL,WAAY,CACV,KAAM,OACN,QAAS,IAAA,GACV,CAOD,QAAS,CACP,KAAM,OACN,QAAS,IAAA,GACV,CAMD,SAAU,CACR,KAAM,OACN,QAAS,IAAA,GACV,CAMD,UAAW,CACT,KAAM,OACN,QAAS,IAAA,GACV,CAKD,YAAa,CACX,KAAM,CAAC,OAAQ,MAAO,OAAO,CAC7B,QAAS,GACV,CAKD,aAAc,CACZ,KAAM,CAAC,OAAQ,MAAO,OAAO,CAC7B,QAAS,GACV,CACF,CAED,MAAQ,CACN,MAAO,CACL,eAAA,EAAA,eACD,EAEJ,kHAxEO,MAAA,CAlCH,OAAA,EAAA,EAAA,gBAAK,CAAA,oBAAwB,EAAA,aAAY,CAAA,CAC1C,UAAQ,mBAGA,EAAA,YAAc,EAAA,eAAe,EAAA,OAAO,OAAM,GAAA,EAAA,EAAA,YAAA,EAAA,EAAA,EAAA,aAcxC,EAAA,OAbP,GAAI,EAAA,SACL,KAAK,WACJ,KAAM,IACP,QAAQ,MACR,KAAK,SACL,GAAG,IACF,OAAA,EAAA,EAAA,gBAAK,CAAA,kBAAsB,EAAA,YAAW,CAAA,CACvC,UAAQ,mDAKD,EAAA,EAAA,EAAA,YAAA,EAAA,OAAA,SAAA,EAAA,KAAA,EAAA,EAAA,EAAA,kBAAA,EAAA,EAAA,iBADF,EAAA,WAAU,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,yDAIT,EAAA,SAAW,EAAA,eAAe,EAAA,OAAO,QAAO,GAAA,EAAA,EAAA,YAAA,EAAA,EAAA,EAAA,aAatC,EAAA,OAZP,GAAI,EAAA,UACL,KAAK,OACJ,KAAM,IACP,KAAK,SACL,GAAG,IACH,MAAM,oBACN,UAAQ,qDAKD,EAAA,EAAA,EAAA,YAAA,EAAA,OAAA,UAAA,EAAA,KAAA,EAAA,EAAA,EAAA,kBAAA,EAAA,EAAA,iBADF,EAAA,QAAO,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { hasSlotContent as e } from "../../common/utils/index.js";
|
|
2
2
|
import { t } from "../../_plugin-vue_export-helper-BTgDAbhb.js";
|
|
3
|
-
import n from "
|
|
3
|
+
import { t as n } from "../../Text-5MobHF6z.js";
|
|
4
4
|
import { createBlock as r, createCommentVNode as i, createElementBlock as a, createTextVNode as o, normalizeClass as s, openBlock as c, renderSlot as l, resolveComponent as u, toDisplayString as d, withCtx as f } from "vue";
|
|
5
5
|
//#region components/Notice/NoticeContent.vue
|
|
6
6
|
var p = {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}}),require(`../../chunk-Bmb41Sf3.cjs`);const e=require(`../../common/constants/index.cjs`),t=require(`../../common/utils/index.cjs`),n=require(`../../_plugin-vue_export-helper-D8jCH6HB.cjs`),r=require(`../../common/mixins/modal.cjs`),i=require(`../../common/mixins/mode.cjs`),a=require(`../../shared/sr_only_close_button.cjs`),o=require(`./tippy-utils.cjs`),s=require(`./popover-constants.cjs`),c=require(`../lazy-show/lazy-show.cjs`),l=require(`./popover-header-footer.cjs`);let u=require(`vue`);var d={name:`DtPopover`,components:{SrOnlyCloseButton:a.default,DtLazyShow:c.default,PopoverHeaderFooter:l.default},mixins:[r.default,i.default],props:{open:{type:[Boolean,null],default:null},visibilityChangeCallback:{type:Function,default:null},forwardAnchorArrowKeys:{type:Boolean,default:!1},openOnContext:{type:Boolean,default:!1},elementType:{type:String,default:`div`},transition:{type:String,default:`fade`},role:{type:String,default:`dialog`,validator:e=>s.POPOVER_ROLES.includes(e)},ariaLabelledby:{type:String,default:null},ariaLabel:{type:String,default:null},padding:{type:String,default:`large`,validator:e=>Object.keys(s.POPOVER_PADDING_CLASSES).some(t=>t===e)},contentClass:{type:[String,Array,Object],default:``},contentWidth:{type:String,default:``,validator:e=>s.POPOVER_CONTENT_WIDTHS.includes(e)},contentAppear:{type:Boolean,default:null},contentTabindex:{type:Number||null,default:-1},externalAnchor:{type:String,default:``},externalAnchorElement:{type:e.HTML_ELEMENT_TYPE,default:null},id:{type:String,default(){return t.getUniqueString()}},offset:{type:Array,default:()=>[0,4]},closeOnClick:{type:Boolean,default:!0},modal:{type:Boolean,default:!0},focustrap:{type:Boolean,default:!1},fallbackPlacements:{type:Array,default:()=>[`auto`]},boundary:{type:[String,e.HTML_ELEMENT_TYPE],default:`clippingParents`,validator:e=>s.POPOVER_BOUNDARY_VALUES.includes(e)||e instanceof HTMLElement},placement:{type:String,default:`bottom-end`},tether:{type:Boolean,default:!0},sticky:{type:[Boolean,String],default:!1,validator:e=>s.POPOVER_STICKY_VALUES.includes(e)},maxHeight:{type:String,default:``},maxWidth:{type:String,default:``},showCloseButton:{type:Boolean,default:!1},anchorClass:{type:[String,Array,Object],default:``},headerWrapperClass:{type:[String,Array,Object],default:``},headerClass:{type:[String,Array,Object],default:``},footerWrapperClass:{type:[String,Array,Object],default:``},footerClass:{type:[String,Array,Object],default:``},dialogClass:{type:[String,Array,Object],default:``},initialFocusElement:{type:[String,e.HTML_ELEMENT_TYPE],default:`first`,validator:e=>s.POPOVER_INITIAL_FOCUS_STRINGS.includes(e)||e instanceof HTMLElement||e.startsWith(`#`)},openWithArrowKeys:{type:Boolean,default:!1},appendTo:{type:[e.HTML_ELEMENT_TYPE,String],default:`body`,validator:e=>s.POPOVER_APPEND_TO_VALUES.includes(e)||e instanceof HTMLElement}},emits:[`keydown`,`update:open`,`opened`,`mouseenter-popover`,`mouseleave-popover`,`mouseenter-popover-anchor`,`mouseleave-popover-anchor`],data(){return{POPOVER_PADDING_CLASSES:s.POPOVER_PADDING_CLASSES,POPOVER_HEADER_FOOTER_PADDING_CLASSES:s.POPOVER_HEADER_FOOTER_PADDING_CLASSES,intersectionObserver:null,mutationObserver:null,isOutsideViewport:!1,isOpen:!1,visibilityGeneration:0,isDialogAriaHidden:!0,toAppear:!1,anchorEl:null,popoverContentEl:null,hasSlotContent:t.hasSlotContent,scrimTarget:`body`}},computed:{popoverListeners(){return{keydown:e=>{this.onKeydown(e)},"after-leave":()=>{this.onLeaveTransitionComplete()},"after-enter":()=>{this.onEnterTransitionComplete()}}},calculatedMaxHeight(){return this.isOutsideViewport&&this.modal?`calc(100vh - var(--dt-spacing-50))`:this.maxHeight},labelledBy(){return this.ariaLabelledby||!this.ariaLabel&&t.getUniqueString(`DtPopover__anchor`)||void 0},modalValidationState(){return[this.modal,this.initialFocusElement]}},watch:{modalValidationState:{handler:`validateProps`,immediate:!0},modal:{immediate:!0,handler(e){this.tip?.setProps({zIndex:e?650:this.calculateAnchorZindex()})}},offset:{deep:!0,handler(e){this.tip?.setProps({offset:e})}},sticky(e){this.tip?.setProps({sticky:e})},fallbackPlacements:{deep:!0,handler(){this.tip?.setProps({popperOptions:this.popperOptions()})}},tether(){this.tip?.setProps({popperOptions:this.popperOptions()})},boundary(){this.tip?.setProps({popperOptions:this.popperOptions()})},externalAnchorElement(){this.updateAnchorEl()},placement(e){this.tip?.setProps({placement:e})},isOpen:[{flush:`sync`,handler(e){this.visibilityGeneration++,this._isUnmounting||this.visibilityChangeCallback?.(e)}},{handler(e){if(e){if(this.isDialogAriaHidden=!1,!this.anchorEl)return;this.initTippyInstance(),this.tip?.show()}else this.removeEventListeners(),this.tip?.hide()}}],open:{handler:function(e){e!==null&&(this.isOpen=e),e===!0&&(this.toAppear=!0)},immediate:!0},contentAppear:{handler:function(e){e!==null&&(this.toAppear=e)}}},mounted(){t.warnIfUnmounted(t.returnFirstEl(this.$el),this.$options.name),this.popoverContentEl=t.returnFirstEl(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)},beforeUnmount(){this._isUnmounting=!0,this.popoverContentEl&&(this.popoverContentEl.style.transition=`none`),this.tip?.destroy(),this.intersectionObserver?.disconnect(),this.mutationObserver?.disconnect(),this.removeReferences(),this.removeEventListeners()},methods:{getCloseButtonElement(){return t.returnFirstEl((this.showCloseButton?this.$refs.popover__header?.$refs[`popover__close-button`]:this.$refs[`popover__close-button`])?.$el)},getModeReferenceEl(){return this.$refs.anchor},hasIntersectedViewport(e){let n=e?.[0]?.target;if(!n)return;let r=t.isOutOfViewPort(n);this.isOutsideViewport=r.bottom||r.top},updateAnchorEl(){let e=(this.externalAnchorElement||(this.externalAnchor?this.$refs.anchor.getRootNode().querySelector(`#${this.externalAnchor}`):null))??this.$refs.anchor.children[0];if(e!==this.anchorEl){if(this.anchorEl=e,this.tip?.destroy(),delete this.tip,!this.anchorEl){console.warn(`No anchor found for popover`);return}this.isOpen&&(this.initTippyInstance(),this.tip?.show())}},popperOptions(){return o.getPopperOptions({fallbackPlacements:this.fallbackPlacements,tether:this.tether,hasHideModifierEnabled:!0,boundary:this.boundary})},validateProps(){this.modal&&this.initialFocusElement===`none`&&console.error(`If the popover is modal you must set the initialFocusElement prop. Possible values: "dialog", "first", HTMLElement`)},calculateAnchorZindex(){return t.returnFirstEl(this.$el).getRootNode().querySelector(`.d-modal[aria-hidden="false"], .d-modal--transparent[aria-hidden="false"], .d-modal[open], .d-modal--transparent[open]`)||this.anchorEl?.closest(`.d-zi-drawer`)?650:300},defaultToggleOpen(e){if(!this.openOnContext&&(this.open===null||this.open===void 0)){if(!this.anchorEl?.contains(e.target)&&!this.anchorEl?.isEqualNode(e.target)||this.anchorEl?.disabled)return;this.toggleOpen()}},async onContext(e){this.openOnContext&&(e.preventDefault(),this.isOpen=!0,await this.$nextTick(),this.tip?.setProps({placement:`right-start`,getReferenceClientRect:()=>({width:0,height:0,top:e.clientY,bottom:e.clientY,left:e.clientX,right:e.clientX})}))},toggleOpen(){this.isOpen=!this.isOpen},onArrowKeyPress(e){let t=this.open!==null;if(t&&this.forwardAnchorArrowKeys){this.$emit(`keydown`,e);return}e.preventDefault(),!t&&(this.openWithArrowKeys&&this.anchorEl?.contains(e.target)&&(this.isOpen||(this.isOpen=!0)),this.$emit(`keydown`,e))},addEventListeners(){window.addEventListener(`dt-popover-close`,this.closePopover),this.contentWidth===`anchor`&&window.addEventListener(`resize`,this.onResize)},removeEventListeners(){window.removeEventListener(`dt-popover-close`,this.closePopover),this.contentWidth===`anchor`&&window.removeEventListener(`resize`,this.onResize)},closePopover(){this.isOpen=!1},preventScrolling(){if(this.modal){let e=this.anchorEl?.closest(`body, .tippy-box`);if(!e)return;e.tagName?.toLowerCase()===`body`?(t.disableRootScrolling(this.anchorEl.getRootNode().host),this.tip?.setProps({offset:this.offset})):e.classList.add(`d-zi-popover`)}},enableScrolling(){let e=this.anchorEl?.closest(`body, .tippy-box`);e&&(e.tagName?.toLowerCase()===`body`?(t.enableRootScrolling(this.anchorEl.getRootNode().host),this.tip?.setProps({offset:this.offset})):e.classList.remove(`d-zi-popover`))},removeReferences(){this.anchorEl=null,this.popoverContentEl=null,this.tip=null},async onShow(){this.contentWidth===`anchor`&&(await this.setPopoverContentAnchorWidth(),this._isUnmounting)||(this.contentWidth===null&&(this.popoverContentEl.style.width=`auto`),this.addEventListeners())},isCurrentVisibility(e,t){return!this._isUnmounting&&this.visibilityGeneration===e&&this.isOpen===t},async onLeaveTransitionComplete(){let e=this.visibilityGeneration;if(this.isCurrentVisibility(e,!1)){if(this.modal){let t=await this.getFirstFocusableElement(this.$refs.anchor);if(!this.isCurrentVisibility(e,!1)||(t?.focus({preventScroll:!0}),await this.$nextTick(),!this.isCurrentVisibility(e,!1)))return;this.enableScrolling()}this.isDialogAriaHidden=!0,this.tip?.unmount(),this.$emit(`opened`,!1),this.isCurrentVisibility(e,!1)&&this.open!==null&&this.$emit(`update:open`,!1)}},async onEnterTransitionComplete(){let e=this.visibilityGeneration;this.isCurrentVisibility(e,!0)&&(await this.focusInitialElement(e),await this.$nextTick(),this.isCurrentVisibility(e,!0)&&(this.preventScrolling(),this.$emit(`opened`,!0,this.$refs.popover__content),this.isCurrentVisibility(e,!0)&&this.open!==null&&this.$emit(`update:open`,!0)))},async focusInitialElement(e){this.initialFocusElement===`dialog`&&t.returnFirstEl(this.$refs.content?.$el)?.focus(),typeof this.initialFocusElement==`string`&&this.initialFocusElement.startsWith(`#`)&&this.focusInitialElementById(),this.initialFocusElement===`first`&&await this.focusFirstElementIfNeeded(this.$refs.popover__content,e),this.isCurrentVisibility(e,!0)&&this.initialFocusElement instanceof HTMLElement&&this.initialFocusElement.focus()},focusInitialElementById(){let e=t.returnFirstEl(this.$refs.content?.$el)?.querySelector(this.initialFocusElement);e?e.focus():(console.warn(`Could not find the element specified in dt-popover prop "initialFocusElement". Defaulting to focusing the dialog.`),t.returnFirstEl(this.$refs.content?.$el)?.focus())},onResize(){this.closePopover()},onClickOutside(){this.closeOnClick&&(this.popoverContentEl?.querySelector(`.d-popover__anchor--opened`)||this.closePopover())},onKeydown(e){e.key===`Escape`&&this.closePopover(),this.$emit(`keydown`,e)},async setPopoverContentAnchorWidth(){await this.$nextTick(),this.popoverContentEl.style.width=`${this.anchorEl?.clientWidth}px`},async focusFirstElementIfNeeded(e,n=this.visibilityGeneration){if(this._getFocusableElements(e,!0).length!==0){let t=await this.getFirstFocusableElement(e);if(!this.isCurrentVisibility(n,!0))return;t?.focus({preventScroll:!0})}else this.showCloseButton?this.$refs.popover__header?.focusCloseButton():t.returnFirstEl(this.$refs.content?.$el)?.focus()},resolveParentScrimTarget(){return this.anchorEl?.parentElement??document.body},resolveRootScrimTarget(){try{return window.parent.document.body}catch{return this.resolveParentScrimTarget()}},resolveBodyScrimTarget(){return this.anchorEl?.closest(`dialog`)??this.anchorEl?.getRootNode()?.querySelector(`body`)??document.body},resolveScrimTarget(){if(this.appendTo instanceof HTMLElement)return this.appendTo;switch(this.appendTo){case`parent`:return this.resolveParentScrimTarget();case`root`:return this.resolveRootScrimTarget();default:return this.resolveBodyScrimTarget()}},getReferenceClientRect(e){let t=this.anchorEl?.getBoundingClientRect()??{width:0,height:0,top:0,left:0,right:0,bottom:0,x:0,y:0};if(this.appendTo!==`root`||e)return t;let n=this.anchorEl?.ownerDocument,r=(n?.defaultView||n?.parentWindow)?.frameElement;if(!r)return t;let i=r.getBoundingClientRect();return{width:t?.width,height:t?.height,top:i?.top+t?.top,left:i?.left+t?.left,right:i?.right+t?.right,bottom:i?.bottom+t?.bottom}},initTippyInstance(){this.scrimTarget=this.resolveScrimTarget();let e=null,t=!1;switch(this.appendTo){case`body`:e=this.anchorEl?.closest(`dialog`)??this.anchorEl?.getRootNode()?.querySelector(`body`);break;case`root`:try{e=window.parent.document.body}catch(n){console.error(`Could not attach the popover to iframe parent window: `,n),e=`parent`,t=!0}break;default:e=this.appendTo;break}this.tip?.destroy(),this.tip=o.createTippyPopover(this.anchorEl,{popperOptions:this.popperOptions(),contentElement:this.popoverContentEl,placement:this.placement,offset:this.offset,sticky:this.sticky,appendTo:e,interactive:!0,trigger:`manual`,getReferenceClientRect:()=>this.getReferenceClientRect(t),hideOnClick:!1,zIndex:this.modal?650:this.calculateAnchorZindex(),onClickOutside:this.onClickOutside,onShow:this.onShow})},onMouseEnter(){this.$emit(`mouseenter-popover`)},onMouseLeave(){this.$emit(`mouseleave-popover`)},onMouseEnterAnchor(){this.$emit(`mouseenter-popover-anchor`)},onMouseLeaveAnchor(){this.$emit(`mouseleave-popover-anchor`)}}},f=[`id`,`data-qa`,`tabindex`],p=[`data-qa`];function m(e,t,n,r,i,a){let o=(0,u.resolveComponent)(`popover-header-footer`),s=(0,u.resolveComponent)(`sr-only-close-button`),c=(0,u.resolveComponent)(`dt-lazy-show`),l=(0,u.resolveDirective)(`dt-focustrap`);return(0,u.openBlock)(),(0,u.createElementBlock)(`div`,null,[n.modal&&i.isOpen?((0,u.openBlock)(),(0,u.createBlock)(u.Teleport,{key:0,to:i.scrimTarget},[(0,u.createElementVNode)(`div`,{class:`d-modal--transparent`,"data-qa":`dt-popover-scrim`,"aria-hidden":`false`,onClick:t[0]||(t[0]=(0,u.withModifiers)(()=>{},[`prevent`,`stop`]))})],8,[`to`])):(0,u.createCommentVNode)(``,!0),((0,u.openBlock)(),(0,u.createBlock)((0,u.resolveDynamicComponent)(n.elementType),{ref:`popover`,class:(0,u.normalizeClass)([`d-popover`,{"d-popover__anchor--opened":i.isOpen}]),"data-qa":`dt-popover-container`},{default:(0,u.withCtx)(()=>[(0,u.createElementVNode)(`div`,{id:!n.ariaLabelledby&&a.labelledBy,ref:`anchor`,class:(0,u.normalizeClass)(n.anchorClass),"data-qa":e.$attrs[`data-qa`]?`${e.$attrs[`data-qa`]}-anchor`:`dt-popover-anchor`,tabindex:n.openOnContext?0:void 0,onClickCapture:t[1]||(t[1]=(...e)=>a.defaultToggleOpen&&a.defaultToggleOpen(...e)),onContextmenu:t[2]||(t[2]=(...e)=>a.onContext&&a.onContext(...e)),onKeydown:[t[3]||(t[3]=(0,u.withKeys)((...e)=>a.onArrowKeyPress&&a.onArrowKeyPress(...e),[`up`])),t[4]||(t[4]=(0,u.withKeys)((...e)=>a.onArrowKeyPress&&a.onArrowKeyPress(...e),[`down`])),t[6]||(t[6]=(0,u.withKeys)(t=>e.$emit(`keydown`,t),[`enter`])),t[7]||(t[7]=(0,u.withKeys)(t=>e.$emit(`keydown`,t),[`space`]))],onKeydownCapture:t[5]||(t[5]=(0,u.withKeys)((...e)=>a.closePopover&&a.closePopover(...e),[`escape`])),onMouseenter:t[8]||(t[8]=(...e)=>a.onMouseEnter&&a.onMouseEnter(...e)),onMouseleave:t[9]||(t[9]=(...e)=>a.onMouseLeave&&a.onMouseLeave(...e))},[(0,u.renderSlot)(e.$slots,`anchor`,{attrs:{"aria-expanded":i.isOpen.toString(),"aria-controls":n.id,"aria-haspopup":n.role}})],42,f),(0,u.withDirectives)(((0,u.openBlock)(),(0,u.createBlock)(c,(0,u.mergeProps)({id:n.id,ref:`content`,role:n.role,"data-qa":e.$attrs[`data-qa`]?`${e.$attrs[`data-qa`]}__dialog`:`dt-popover`,"aria-hidden":`${i.isDialogAriaHidden}`,"aria-labelledby":a.labelledBy,"aria-label":n.ariaLabel,"aria-modal":n.role===`menu`?void 0:`${!n.modal}`,transition:n.transition,show:i.isOpen,appear:i.toAppear,class:[`d-popover__dialog`,{"d-popover__dialog--modal":n.modal},n.dialogClass],style:{"max-height":a.calculatedMaxHeight,"max-width":n.maxWidth},css:e.$attrs.css,tabindex:n.contentTabindex},e.modeAttrs,(0,u.toHandlers)(a.popoverListeners),{onMouseenter:a.onMouseEnterAnchor,onMouseleave:a.onMouseLeaveAnchor}),{default:(0,u.withCtx)(()=>[i.hasSlotContent(e.$slots.headerContent)||n.showCloseButton?((0,u.openBlock)(),(0,u.createBlock)(o,{key:0,ref:`popover__header`,class:(0,u.normalizeClass)([i.POPOVER_HEADER_FOOTER_PADDING_CLASSES[n.padding],n.headerWrapperClass]),"content-class":n.headerClass,type:`header`,"show-close-button":n.showCloseButton,"close-role":n.role===`menu`?`menuitem`:void 0,onClose:a.closePopover},{content:(0,u.withCtx)(()=>[(0,u.renderSlot)(e.$slots,`headerContent`,{close:a.closePopover})]),_:3},8,[`class`,`content-class`,`show-close-button`,`close-role`,`onClose`])):(0,u.createCommentVNode)(``,!0),(0,u.createElementVNode)(`div`,{ref:`popover__content`,"data-qa":e.$attrs[`data-qa`]?`${e.$attrs[`data-qa`]}-content`:`dt-popover-content`,class:(0,u.normalizeClass)([`d-popover__content`,i.POPOVER_PADDING_CLASSES[n.padding],n.contentClass])},[(0,u.renderSlot)(e.$slots,`content`,{close:a.closePopover})],10,p),i.hasSlotContent(e.$slots.footerContent)?((0,u.openBlock)(),(0,u.createBlock)(o,{key:1,ref:`popover__footer`,type:`footer`,class:(0,u.normalizeClass)([i.POPOVER_HEADER_FOOTER_PADDING_CLASSES[n.padding],n.footerWrapperClass]),"content-class":n.footerClass},{content:(0,u.withCtx)(()=>[(0,u.renderSlot)(e.$slots,`footerContent`,{close:a.closePopover})]),_:3},8,[`class`,`content-class`])):(0,u.createCommentVNode)(``,!0),n.showCloseButton?(0,u.createCommentVNode)(``,!0):((0,u.openBlock)(),(0,u.createBlock)(s,{key:2,ref:`popover__close-button`,role:n.role===`menu`?`menuitem`:void 0,onClose:a.closePopover},null,8,[`role`,`onClose`]))]),_:3},16,[`id`,`role`,`data-qa`,`aria-hidden`,`aria-labelledby`,`aria-label`,`aria-modal`,`transition`,`show`,`appear`,`class`,`style`,`css`,`tabindex`,`onMouseenter`,`onMouseleave`])),[[l,{active:(n.modal||n.focustrap)&&i.isOpen,initialFocus:!1,restoreFocus:!n.modal&&n.focustrap}]])]),_:3},8,[`class`]))])}var h=n.t(d,[[`render`,m]]);exports.default=h;
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}}),require(`../../chunk-Bmb41Sf3.cjs`);const e=require(`../../common/constants/index.cjs`),t=require(`../../common/utils/index.cjs`),n=require(`../../_plugin-vue_export-helper-D8jCH6HB.cjs`),r=require(`../../common/mixins/modal.cjs`),i=require(`../../common/mixins/mode.cjs`),a=require(`../../shared/sr_only_close_button.cjs`),o=require(`./tippy-utils.cjs`),s=require(`./popover-constants.cjs`),c=require(`../lazy-show/lazy-show.cjs`),l=require(`./popover-header-footer.cjs`);let u=require(`vue`);var d={name:`DtPopover`,components:{SrOnlyCloseButton:a.default,DtLazyShow:c.default,PopoverHeaderFooter:l.default},mixins:[r.default,i.default],props:{open:{type:[Boolean,null],default:null},visibilityChangeCallback:{type:Function,default:null},forwardAnchorArrowKeys:{type:Boolean,default:!1},openOnContext:{type:Boolean,default:!1},elementType:{type:String,default:`div`},transition:{type:String,default:`fade`},role:{type:String,default:`dialog`,validator:e=>s.POPOVER_ROLES.includes(e)},ariaLabelledby:{type:String,default:null},ariaLabel:{type:String,default:null},padding:{type:String,default:`large`,validator:e=>Object.keys(s.POPOVER_PADDING_CLASSES).some(t=>t===e)},contentClass:{type:[String,Array,Object],default:``},contentWidth:{type:String,default:``,validator:e=>s.POPOVER_CONTENT_WIDTHS.includes(e)},contentAppear:{type:Boolean,default:null},contentTabindex:{type:Number||null,default:-1},externalAnchor:{type:String,default:``},externalAnchorElement:{type:e.HTML_ELEMENT_TYPE,default:null},id:{type:String,default(){return t.getUniqueString()}},offset:{type:Array,default:()=>[0,4]},closeOnClick:{type:Boolean,default:!0},modal:{type:Boolean,default:!0},focustrap:{type:Boolean,default:!1},fallbackPlacements:{type:Array,default:()=>[`auto`]},boundary:{type:[String,e.HTML_ELEMENT_TYPE],default:`clippingParents`,validator:e=>s.POPOVER_BOUNDARY_VALUES.includes(e)||e instanceof HTMLElement},placement:{type:String,default:`bottom-end`},tether:{type:Boolean,default:!0},sticky:{type:[Boolean,String],default:!1,validator:e=>s.POPOVER_STICKY_VALUES.includes(e)},maxHeight:{type:String,default:``},maxWidth:{type:String,default:``},showCloseButton:{type:Boolean,default:!1},anchorClass:{type:[String,Array,Object],default:``},headerWrapperClass:{type:[String,Array,Object],default:``},headerClass:{type:[String,Array,Object],default:``},footerWrapperClass:{type:[String,Array,Object],default:``},footerClass:{type:[String,Array,Object],default:``},dialogClass:{type:[String,Array,Object],default:``},initialFocusElement:{type:[String,e.HTML_ELEMENT_TYPE],default:`first`,validator:e=>s.POPOVER_INITIAL_FOCUS_STRINGS.includes(e)||e instanceof HTMLElement||e.startsWith(`#`)},openWithArrowKeys:{type:Boolean,default:!1},appendTo:{type:[e.HTML_ELEMENT_TYPE,String],default:`body`,validator:e=>s.POPOVER_APPEND_TO_VALUES.includes(e)||e instanceof HTMLElement}},emits:[`keydown`,`update:open`,`opened`,`mouseenter-popover`,`mouseleave-popover`,`mouseenter-popover-anchor`,`mouseleave-popover-anchor`],data(){return{POPOVER_PADDING_CLASSES:s.POPOVER_PADDING_CLASSES,POPOVER_HEADER_FOOTER_PADDING_CLASSES:s.POPOVER_HEADER_FOOTER_PADDING_CLASSES,intersectionObserver:null,mutationObserver:null,isOutsideViewport:!1,isOpen:!1,visibilityGeneration:0,isDialogAriaHidden:!0,toAppear:!1,anchorEl:null,popoverContentEl:null,hasSlotContent:t.hasSlotContent,scrimTarget:`body`}},computed:{popoverListeners(){return{keydown:e=>{this.onKeydown(e)},"after-leave":()=>{this.onLeaveTransitionComplete()},"after-enter":()=>{this.onEnterTransitionComplete()}}},calculatedMaxHeight(){return this.isOutsideViewport&&this.modal?`calc(100vh - var(--dt-spacing-50))`:this.maxHeight},labelledBy(){return this.ariaLabelledby||!this.ariaLabel&&t.getUniqueString(`DtPopover__anchor`)||void 0},modalValidationState(){return[this.modal,this.initialFocusElement]}},watch:{modalValidationState:{handler:`validateProps`,immediate:!0},modal:{immediate:!0,handler(e){this.tip?.setProps({zIndex:e?650:this.calculateAnchorZindex()})}},offset:{deep:!0,handler(e){this.tip?.setProps({offset:e})}},sticky(e){this.tip?.setProps({sticky:e})},fallbackPlacements:{deep:!0,handler(){this.tip?.setProps({popperOptions:this.popperOptions()})}},tether(){this.tip?.setProps({popperOptions:this.popperOptions()})},boundary(){this.tip?.setProps({popperOptions:this.popperOptions()})},externalAnchorElement(){this.updateAnchorEl()},placement(e){this.tip?.setProps({placement:e})},isOpen:[{flush:`sync`,handler(e){this.visibilityGeneration++,this._isUnmounting||this.visibilityChangeCallback?.(e)}},{handler(e){if(e){if(this.isDialogAriaHidden=!1,!this.anchorEl)return;this.initTippyInstance(),this.tip?.show()}else this.removeEventListeners(),this.tip?.hide()}}],open:{handler:function(e){e!==null&&(this.isOpen=e),e===!0&&(this.toAppear=!0)},immediate:!0},contentAppear:{handler:function(e){e!==null&&(this.toAppear=e)}}},mounted(){t.warnIfUnmounted(t.returnFirstEl(this.$el),this.$options.name),this.popoverContentEl=t.returnFirstEl(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)},beforeUnmount(){this._isUnmounting=!0,this.popoverContentEl&&(this.popoverContentEl.style.transition=`none`),this.tip?.destroy(),this.intersectionObserver?.disconnect(),this.mutationObserver?.disconnect(),this.removeReferences(),this.removeEventListeners()},methods:{getCloseButtonElement(){return t.returnFirstEl((this.showCloseButton?this.$refs.popover__header?.$refs[`popover__close-button`]:this.$refs[`popover__close-button`])?.$el)},getModeReferenceEl(){return this.$refs.anchor},hasIntersectedViewport(e){let n=e?.[0]?.target;if(!n)return;let r=t.isOutOfViewPort(n);this.isOutsideViewport=r.bottom||r.top},updateAnchorEl(){let e=(this.externalAnchorElement||(this.externalAnchor?this.$refs.anchor.getRootNode().querySelector(`#${this.externalAnchor}`):null))??this.$refs.anchor.children[0];if(e!==this.anchorEl){if(this.anchorEl=e,this.tip?.destroy(),delete this.tip,!this.anchorEl){console.warn(`No anchor found for popover`);return}this.isOpen&&(this.initTippyInstance(),this.tip?.show())}},popperOptions(){return o.getPopperOptions({fallbackPlacements:this.fallbackPlacements,tether:this.tether,hasHideModifierEnabled:!0,boundary:this.boundary})},validateProps(){this.modal&&this.initialFocusElement===`none`&&console.error(`If the popover is modal you must set the initialFocusElement prop. Possible values: "dialog", "first", HTMLElement`)},calculateAnchorZindex(){return t.returnFirstEl(this.$el).getRootNode().querySelector(`.d-modal[aria-hidden="false"], .d-modal--transparent[aria-hidden="false"], .d-modal[open], .d-modal--transparent[open]`)||this.anchorEl?.closest(`.d-zi-drawer`)?650:300},defaultToggleOpen(e){if(!this.openOnContext&&(this.open===null||this.open===void 0)){if(!this.anchorEl?.contains(e.target)&&!this.anchorEl?.isEqualNode(e.target)||this.anchorEl?.disabled)return;this.toggleOpen()}},async onContext(e){this.openOnContext&&(e.preventDefault(),this.isOpen=!0,await this.$nextTick(),this.tip?.setProps({placement:`right-start`,getReferenceClientRect:()=>({width:0,height:0,top:e.clientY,bottom:e.clientY,left:e.clientX,right:e.clientX})}))},toggleOpen(){this.isOpen=!this.isOpen},onArrowKeyPress(e){let t=this.open!==null;if(t&&this.forwardAnchorArrowKeys){this.$emit(`keydown`,e);return}e.preventDefault(),!t&&(this.openWithArrowKeys&&this.anchorEl?.contains(e.target)&&(this.isOpen||(this.isOpen=!0)),this.$emit(`keydown`,e))},addEventListeners(){window.addEventListener(`dt-popover-close`,this.closePopover),this.contentWidth===`anchor`&&window.addEventListener(`resize`,this.onResize)},removeEventListeners(){window.removeEventListener(`dt-popover-close`,this.closePopover),this.contentWidth===`anchor`&&window.removeEventListener(`resize`,this.onResize)},closePopover(){this.isOpen=!1},preventScrolling(){if(this.modal){let e=this.anchorEl?.closest(`body, .tippy-box`);if(!e)return;e.tagName?.toLowerCase()===`body`?(t.disableRootScrolling(this.anchorEl.getRootNode().host),this.tip?.setProps({offset:this.offset})):e.classList.add(`d-zi-popover`)}},enableScrolling(){let e=this.anchorEl?.closest(`body, .tippy-box`);e&&(e.tagName?.toLowerCase()===`body`?(t.enableRootScrolling(this.anchorEl.getRootNode().host),this.tip?.setProps({offset:this.offset})):e.classList.remove(`d-zi-popover`))},removeReferences(){this.anchorEl=null,this.popoverContentEl=null,this.tip=null},async onShow(){this.contentWidth===`anchor`&&(await this.setPopoverContentAnchorWidth(),this._isUnmounting)||(this.contentWidth===null&&(this.popoverContentEl.style.width=`auto`),this.addEventListeners())},isCurrentVisibility(e,t){return!this._isUnmounting&&this.visibilityGeneration===e&&this.isOpen===t},async onLeaveTransitionComplete(){let e=this.visibilityGeneration;if(this.isCurrentVisibility(e,!1)){if(this.modal){let t=await this.getFirstFocusableElement(this.$refs.anchor);if(!this.isCurrentVisibility(e,!1)||(t?.focus({preventScroll:!0}),await this.$nextTick(),!this.isCurrentVisibility(e,!1)))return;this.enableScrolling()}this.isDialogAriaHidden=!0,this.tip?.unmount(),this.$emit(`opened`,!1),this.isCurrentVisibility(e,!1)&&this.open!==null&&this.$emit(`update:open`,!1)}},async onEnterTransitionComplete(){let e=this.visibilityGeneration;this.isCurrentVisibility(e,!0)&&(await this.focusInitialElement(e),await this.$nextTick(),this.isCurrentVisibility(e,!0)&&(this.preventScrolling(),this.$emit(`opened`,!0,this.$refs.popover__content),this.isCurrentVisibility(e,!0)&&this.open!==null&&this.$emit(`update:open`,!0)))},async focusInitialElement(e){this.initialFocusElement===`dialog`&&t.returnFirstEl(this.$refs.content?.$el)?.focus(),typeof this.initialFocusElement==`string`&&this.initialFocusElement.startsWith(`#`)&&this.focusInitialElementById(),this.initialFocusElement===`first`&&await this.focusFirstElementIfNeeded(this.$refs.popover__content,e),this.isCurrentVisibility(e,!0)&&this.initialFocusElement instanceof HTMLElement&&this.initialFocusElement.focus()},focusInitialElementById(){let e=t.returnFirstEl(this.$refs.content?.$el)?.querySelector(this.initialFocusElement);e?e.focus():(console.warn(`Could not find the element specified in dt-popover prop "initialFocusElement". Defaulting to focusing the dialog.`),t.returnFirstEl(this.$refs.content?.$el)?.focus())},onResize(){this.closePopover()},onClickOutside(){this.closeOnClick&&(this.popoverContentEl?.querySelector(`.d-popover__anchor--opened`)||this.closePopover())},onKeydown(e){e.key===`Escape`&&this.closePopover(),this.$emit(`keydown`,e)},async setPopoverContentAnchorWidth(){await this.$nextTick(),this.popoverContentEl.style.width=`${this.anchorEl?.clientWidth}px`},async focusFirstElementIfNeeded(e,n=this.visibilityGeneration){if(this._getFocusableElements(e,!0).length!==0){let t=await this.getFirstFocusableElement(e);if(!this.isCurrentVisibility(n,!0))return;t?.focus({preventScroll:!0})}else this.showCloseButton?this.$refs.popover__header?.focusCloseButton():t.returnFirstEl(this.$refs.content?.$el)?.focus()},resolveParentScrimTarget(){return this.anchorEl?.parentElement??document.body},resolveRootScrimTarget(){try{return window.parent.document.body}catch{return this.resolveParentScrimTarget()}},resolveBodyScrimTarget(){return this.anchorEl?.closest(`dialog`)??this.anchorEl?.getRootNode()?.querySelector(`body`)??document.body},resolveScrimTarget(){if(this.appendTo instanceof HTMLElement)return this.appendTo;switch(this.appendTo){case`parent`:return this.resolveParentScrimTarget();case`root`:return this.resolveRootScrimTarget();default:return this.resolveBodyScrimTarget()}},getReferenceClientRect(e){let t=this.anchorEl?.getBoundingClientRect()??{width:0,height:0,top:0,left:0,right:0,bottom:0,x:0,y:0};if(this.appendTo!==`root`||e)return t;let n=this.anchorEl?.ownerDocument,r=(n?.defaultView||n?.parentWindow)?.frameElement;if(!r)return t;let i=r.getBoundingClientRect();return{width:t?.width,height:t?.height,top:i?.top+t?.top,left:i?.left+t?.left,right:i?.right+t?.right,bottom:i?.bottom+t?.bottom}},initTippyInstance(){this.scrimTarget=this.resolveScrimTarget();let e=null,t=!1;switch(this.appendTo){case`body`:e=this.anchorEl?.closest(`dialog`)??this.anchorEl?.getRootNode()?.querySelector(`body`);break;case`root`:try{e=window.parent.document.body}catch(n){console.error(`Could not attach the popover to iframe parent window: `,n),e=`parent`,t=!0}break;default:e=this.appendTo;break}this.tip?.destroy(),this.tip=o.createTippyPopover(this.anchorEl,{popperOptions:this.popperOptions(),contentElement:this.popoverContentEl,placement:this.placement,offset:this.offset,sticky:this.sticky,appendTo:e,interactive:!0,trigger:`manual`,getReferenceClientRect:()=>this.getReferenceClientRect(t),hideOnClick:!1,zIndex:this.modal?650:this.calculateAnchorZindex(),onClickOutside:this.onClickOutside,onShow:this.onShow})},onMouseEnter(){this.$emit(`mouseenter-popover`)},onMouseLeave(){this.$emit(`mouseleave-popover`)},onMouseEnterAnchor(){this.$emit(`mouseenter-popover-anchor`)},onMouseLeaveAnchor(){this.$emit(`mouseleave-popover-anchor`)}}},f=[`id`,`data-qa`,`tabindex`],p=[`data-qa`];function m(e,t,n,r,i,a){let o=(0,u.resolveComponent)(`popover-header-footer`),s=(0,u.resolveComponent)(`sr-only-close-button`),c=(0,u.resolveComponent)(`dt-lazy-show`),l=(0,u.resolveDirective)(`dt-focustrap`);return(0,u.openBlock)(),(0,u.createElementBlock)(`div`,null,[n.modal&&i.isOpen?((0,u.openBlock)(),(0,u.createBlock)(u.Teleport,{key:0,to:i.scrimTarget},[(0,u.createElementVNode)(`div`,{class:`d-modal--transparent`,"data-qa":`dt-popover-scrim`,"aria-hidden":`false`,onClick:t[0]||(t[0]=(0,u.withModifiers)(()=>{},[`prevent`,`stop`]))})],8,[`to`])):(0,u.createCommentVNode)(``,!0),((0,u.openBlock)(),(0,u.createBlock)((0,u.resolveDynamicComponent)(n.elementType),{ref:`popover`,class:(0,u.normalizeClass)([`d-popover`,{"d-popover__anchor--opened":i.isOpen}]),"data-qa":`dt-popover-container`},{default:(0,u.withCtx)(()=>[(0,u.createElementVNode)(`div`,{id:!n.ariaLabelledby&&a.labelledBy,ref:`anchor`,class:(0,u.normalizeClass)(n.anchorClass),"data-qa":e.$attrs[`data-qa`]?`${e.$attrs[`data-qa`]}-anchor`:`dt-popover-anchor`,tabindex:n.openOnContext?0:void 0,onClickCapture:t[1]||(t[1]=(...e)=>a.defaultToggleOpen&&a.defaultToggleOpen(...e)),onContextmenu:t[2]||(t[2]=(...e)=>a.onContext&&a.onContext(...e)),onKeydown:[t[3]||(t[3]=(0,u.withKeys)((...e)=>a.onArrowKeyPress&&a.onArrowKeyPress(...e),[`up`])),t[4]||(t[4]=(0,u.withKeys)((...e)=>a.onArrowKeyPress&&a.onArrowKeyPress(...e),[`down`])),t[6]||(t[6]=(0,u.withKeys)(t=>e.$emit(`keydown`,t),[`enter`])),t[7]||(t[7]=(0,u.withKeys)(t=>e.$emit(`keydown`,t),[`space`]))],onKeydownCapture:t[5]||(t[5]=(0,u.withKeys)((...e)=>a.closePopover&&a.closePopover(...e),[`escape`])),onMouseenter:t[8]||(t[8]=(...e)=>a.onMouseEnter&&a.onMouseEnter(...e)),onMouseleave:t[9]||(t[9]=(...e)=>a.onMouseLeave&&a.onMouseLeave(...e))},[(0,u.renderSlot)(e.$slots,`anchor`,{attrs:{"aria-expanded":i.isOpen.toString(),"aria-controls":n.id,"aria-haspopup":n.role}})],42,f),(0,u.withDirectives)(((0,u.openBlock)(),(0,u.createBlock)(c,(0,u.mergeProps)({id:n.id,ref:`content`,role:n.role,"data-qa":e.$attrs[`data-qa`]?`${e.$attrs[`data-qa`]}__dialog`:`dt-popover`,"aria-hidden":`${i.isDialogAriaHidden}`,"aria-labelledby":a.labelledBy,"aria-label":n.ariaLabel,"aria-modal":n.role===`menu`?void 0:`${!n.modal}`,transition:n.transition,show:i.isOpen,appear:i.toAppear,class:[`d-popover__dialog`,{"d-popover__dialog--modal":n.modal},n.dialogClass],style:{"max-height":a.calculatedMaxHeight,"max-width":n.maxWidth},css:e.$attrs.css,tabindex:n.contentTabindex},e.modeAttrs,(0,u.toHandlers)(a.popoverListeners),{onMouseenter:a.onMouseEnterAnchor,onMouseleave:a.onMouseLeaveAnchor}),{default:(0,u.withCtx)(()=>[i.hasSlotContent(e.$slots.headerContent)||n.showCloseButton?((0,u.openBlock)(),(0,u.createBlock)(o,{key:0,ref:`popover__header`,class:(0,u.normalizeClass)([i.POPOVER_HEADER_FOOTER_PADDING_CLASSES[n.padding],n.headerWrapperClass]),"content-class":n.headerClass,type:`header`,"show-close-button":n.showCloseButton,"close-role":n.role===`menu`?`menuitem`:void 0,onClose:a.closePopover},{content:(0,u.withCtx)(()=>[(0,u.renderSlot)(e.$slots,`headerContent`,{close:a.closePopover})]),_:3},8,[`class`,`content-class`,`show-close-button`,`close-role`,`onClose`])):(0,u.createCommentVNode)(``,!0),(0,u.createElementVNode)(`div`,{ref:`popover__content`,"data-qa":e.$attrs[`data-qa`]?`${e.$attrs[`data-qa`]}-content`:`dt-popover-content`,class:(0,u.normalizeClass)([`d-popover__content`,i.POPOVER_PADDING_CLASSES[n.padding],n.contentClass])},[(0,u.renderSlot)(e.$slots,`content`,{close:a.closePopover})],10,p),i.hasSlotContent(e.$slots.footerContent)?((0,u.openBlock)(),(0,u.createBlock)(o,{key:1,ref:`popover__footer`,type:`footer`,class:(0,u.normalizeClass)([i.POPOVER_HEADER_FOOTER_PADDING_CLASSES[n.padding],n.footerWrapperClass]),"content-class":n.footerClass},{content:(0,u.withCtx)(()=>[(0,u.renderSlot)(e.$slots,`footerContent`,{close:a.closePopover})]),_:3},8,[`class`,`content-class`])):(0,u.createCommentVNode)(``,!0),n.showCloseButton?(0,u.createCommentVNode)(``,!0):((0,u.openBlock)(),(0,u.createBlock)(s,{key:2,ref:`popover__close-button`,role:n.role===`menu`?`menuitem`:void 0,tabindex:n.role===`menu`?-1:void 0,onClose:a.closePopover},null,8,[`role`,`tabindex`,`onClose`]))]),_:3},16,[`id`,`role`,`data-qa`,`aria-hidden`,`aria-labelledby`,`aria-label`,`aria-modal`,`transition`,`show`,`appear`,`class`,`style`,`css`,`tabindex`,`onMouseenter`,`onMouseleave`])),[[l,{active:(n.modal||n.focustrap)&&i.isOpen,initialFocus:!1,restoreFocus:!n.modal&&n.focustrap}]])]),_:3},8,[`class`]))])}var h=n.t(d,[[`render`,m]]);exports.default=h;
|
|
2
2
|
//# sourceMappingURL=popover.cjs.map
|
|
@@ -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=\"scrimTarget\"\n >\n <div\n class=\"d-modal--transparent\"\n data-qa=\"dt-popover-scrim\"\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 :class=\"anchorClass\"\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=\"onArrowKeyPress\"\n @keydown.down=\"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 v-dt-focustrap=\"{\n active: (modal || focustrap) && isOpen,\n initialFocus: false,\n restoreFocus: !modal && focustrap,\n }\"\n :role=\"role\"\n :data-qa=\"$attrs['data-qa'] ? `${$attrs['data-qa']}__dialog` : 'dt-popover'\"\n :aria-hidden=\"`${isDialogAriaHidden}`\"\n :aria-labelledby=\"labelledBy\"\n :aria-label=\"ariaLabel\"\n :aria-modal=\"role === 'menu' ? undefined : `${!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-bind=\"modeAttrs\"\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], headerWrapperClass]\"\n :content-class=\"headerClass\"\n type=\"header\"\n :show-close-button=\"showCloseButton\"\n :close-role=\"role === 'menu' ? 'menuitem' : undefined\"\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], footerWrapperClass]\"\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 ref=\"popover__close-button\"\n :role=\"role === 'menu' ? 'menuitem' : undefined\"\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_BOUNDARY_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 './PopoverConstants';\nimport { getUniqueString, hasSlotContent, isOutOfViewPort, warnIfUnmounted, disableRootScrolling, enableRootScrolling, returnFirstEl } from '@/common/utils';\nimport { HTML_ELEMENT_TYPE } from '@/common/constants';\nimport { DtLazyShow } from '@/components/LazyShow';\nimport ModalMixin from '@/common/mixins/modal';\nimport ModeMixin from '@/common/mixins/mode';\nimport { createTippyPopover, getPopperOptions } from './TippyUtils';\nimport PopoverHeaderFooter from './PopoverHeaderFooter.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 name: 'DtPopover',\n\n /********************\n * CHILD COMPONENTS *\n ********************/\n components: {\n SrOnlyCloseButton,\n DtLazyShow,\n PopoverHeaderFooter,\n },\n\n mixins: [ModalMixin, ModeMixin],\n\n props: {\n /**\n * Controls whether the popover is shown. When null (default), the popover\n * toggles on click. When set to true or false, the default trigger is\n * disabled and the parent controls visibility via v-model:open.\n * @values null, true, false\n */\n open: {\n type: [Boolean, null],\n default: null,\n },\n\n /**\n * Optional callback receiving the open boolean synchronously on logical visibility changes.\n * Includes initial true during creation, before mount, when open=true.\n * Does not declare or emit an open-change event.\n * For modal removal, keep modal=true, its anchor and scroll container unchanged until opened(false).\n * Changing modal or the anchor's scroll context after opening can retain the original lock.\n * opened(false) reports transition completion, not global scroll-lock ownership.\n * A closed modal with no pending transition or retained scroll lock can be removed immediately.\n * Defer direct app.unmount() until Vue's next tick.\n */\n visibilityChangeCallback: {\n type: Function,\n default: null,\n },\n\n /**\n * Forwards anchor ArrowUp/ArrowDown with a boolean open prop without toggling.\n * Default false preserves controlled anchor keyboard behavior.\n * @values true, false\n */\n forwardAnchorArrowKeys: {\n type: Boolean,\n default: false,\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 * Closes the popover when clicking the anchor or outside the content box.\n * @values true, false\n */\n closeOnClick: {\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 * When true, traps Tab/Shift+Tab focus within the popover dialog.\n * Use this to enable focus trapping independently of modal state —\n * e.g. a non-modal popover whose content still requires keyboard containment.\n * When `modal` is true, the trap is already active; this prop has no additional effect.\n * @values true, false\n */\n focustrap: {\n type: Boolean,\n default: false,\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 element used to determine overflow boundaries for the popover.\n * <a\n * class=\"d-link\"\n * href=\"https://popper.js.org/docs/v2/utils/detect-overflow/#boundary\"\n * target=\"_blank\"\n * >\n * Popper.js docs\n * </a>\n * @values clippingParents, viewport, document, HTMLElement\n */\n boundary: {\n type: [String, HTML_ELEMENT_TYPE],\n default: 'clippingParents',\n validator: boundary => {\n return POPOVER_BOUNDARY_VALUES.includes(boundary) ||\n (boundary instanceof HTMLElement);\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 */\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 anchor wrapper element.\n */\n anchorClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Additional class name for the header element (d-popover__header).\n */\n headerWrapperClass: {\n type: [String, Array, Object],\n default: '',\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 element (d-popover__footer).\n */\n footerWrapperClass: {\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 ancestor <dialog> element when inside one\n * (keeping the popover in the browser's top layer), or to the nearest body otherwise.\n * To always append to body regardless of dialog context, pass document.body as an HTMLElement.\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 after the current transition and initial focus work complete\n *\n * @event opened\n * @type {Boolean | Array}\n */\n 'opened',\n\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 visibilityGeneration: 0,\n // Only true once the leave transition (and any focus restoration in onLeaveTransitionComplete) has\n // finished, so aria-hidden is never applied while the dialog still holds focus or is still visible.\n isDialogAriaHidden: true,\n toAppear: false,\n anchorEl: null,\n popoverContentEl: null,\n hasSlotContent,\n // Resolved in initTippyInstance(), the same moment the content's own target is resolved,\n // rather than left as a live computed — otherwise the scrim could drift from the content\n // if appendTo changes while already open, since content resolution isn't reactive to that.\n // Starts as the string 'body' (a valid Teleport target, matching the original hardcoded\n // default) rather than null or document.body -- Teleport needs a valid target from the\n // first render, and document.body would break SSR where document doesn't exist.\n scrimTarget: 'body',\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-spacing-50))`;\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')) || undefined;\n },\n\n modalValidationState () {\n return [this.modal, this.initialFocusElement];\n },\n\n },\n\n watch: {\n modalValidationState: { handler: 'validateProps', immediate: true },\n\n modal: {\n immediate: true,\n handler (modal) {\n this.tip?.setProps({\n zIndex: modal ? 650 : this.calculateAnchorZindex(),\n });\n },\n },\n\n offset: {\n deep: true,\n handler (offset) {\n this.tip?.setProps({\n offset,\n });\n },\n },\n\n sticky (sticky) {\n this.tip?.setProps({\n sticky,\n });\n },\n\n fallbackPlacements: {\n deep: true,\n handler () {\n this.tip?.setProps({\n popperOptions: this.popperOptions(),\n });\n },\n },\n\n tether () {\n this.tip?.setProps({\n popperOptions: this.popperOptions(),\n });\n },\n\n boundary () {\n this.tip?.setProps({ popperOptions: this.popperOptions() });\n },\n\n externalAnchorElement () {\n this.updateAnchorEl();\n },\n\n placement (placement) {\n this.tip?.setProps({\n placement,\n });\n },\n\n // Register before the immediate open watcher so initial open=true notifies and exposes the dialog.\n isOpen: [\n {\n flush: 'sync',\n handler (isOpen) {\n this.visibilityGeneration++;\n if (!this._isUnmounting) this.visibilityChangeCallback?.(isOpen);\n },\n },\n {\n handler (isOpen) {\n if (isOpen) {\n this.isDialogAriaHidden = false;\n // Initial open=true runs before mounted() resolves anchorEl; tippy needs an anchor.\n if (!this.anchorEl) return;\n this.initTippyInstance();\n this.tip?.show();\n } else {\n this.removeEventListeners();\n this.tip?.hide();\n }\n },\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\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-spacing-50) (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 getCloseButtonElement () {\n const closeButton = this.showCloseButton\n ? this.$refs.popover__header?.$refs['popover__close-button']\n : this.$refs['popover__close-button'];\n return returnFirstEl(closeButton?.$el);\n },\n\n getModeReferenceEl () {\n return this.$refs.anchor;\n },\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 boundary: this.boundary,\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\"], .d-modal[open], .d-modal--transparent[open]') ||\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 const isControlled = this.open !== null;\n if (isControlled && this.forwardAnchorArrowKeys) {\n this.$emit('keydown', e);\n return;\n }\n e.preventDefault();\n if (isControlled) 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 isCurrentVisibility (generation, isOpen) {\n return !this._isUnmounting && this.visibilityGeneration === generation && this.isOpen === isOpen;\n },\n\n async onLeaveTransitionComplete () {\n const generation = this.visibilityGeneration;\n if (!this.isCurrentVisibility(generation, false)) return;\n if (this.modal) {\n const anchor = await this.getFirstFocusableElement(this.$refs.anchor);\n if (!this.isCurrentVisibility(generation, false)) return;\n anchor?.focus({ preventScroll: true });\n // Allow consumers to choose their own focus destination.\n await this.$nextTick();\n if (!this.isCurrentVisibility(generation, false)) return;\n this.enableScrolling();\n }\n this.isDialogAriaHidden = true;\n this.tip?.unmount();\n this.$emit('opened', false);\n if (this.isCurrentVisibility(generation, false) && this.open !== null) {\n this.$emit('update:open', false);\n }\n },\n\n async onEnterTransitionComplete () {\n const generation = this.visibilityGeneration;\n if (!this.isCurrentVisibility(generation, true)) return;\n await this.focusInitialElement(generation);\n // Allow consumers to choose their own focus destination.\n await this.$nextTick();\n if (!this.isCurrentVisibility(generation, true)) return;\n this.preventScrolling();\n this.$emit('opened', true, this.$refs.popover__content);\n if (this.isCurrentVisibility(generation, true) && this.open !== null) {\n this.$emit('update:open', true);\n }\n },\n\n async focusInitialElement (generation) {\n if (this.initialFocusElement === 'dialog') {\n returnFirstEl(this.$refs.content?.$el)?.focus();\n }\n if (typeof this.initialFocusElement === 'string' && this.initialFocusElement.startsWith('#')) {\n this.focusInitialElementById();\n }\n if (this.initialFocusElement === 'first') {\n await this.focusFirstElementIfNeeded(this.$refs.popover__content, generation);\n }\n if (!this.isCurrentVisibility(generation, true)) return;\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.closeOnClick) 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 // Tab focus trapping (when modal or focustrap) is handled by the v-dt-focustrap directive on the content.\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 async focusFirstElementIfNeeded (domEl, generation = this.visibilityGeneration) {\n const focusableElements = this._getFocusableElements(domEl, true);\n if (focusableElements.length !== 0) {\n const element = await this.getFirstFocusableElement(domEl);\n if (!this.isCurrentVisibility(generation, true)) return;\n element?.focus({ preventScroll: true });\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 resolveParentScrimTarget () {\n return this.anchorEl?.parentElement ?? document.body;\n },\n\n resolveRootScrimTarget () {\n try {\n return window.parent.document.body;\n } catch {\n // Matches the content's own fallback: when the parent frame is cross-origin,\n // initTippyInstance falls back to Tippy's 'parent' sentinel (the anchor's own\n // parentElement) rather than document.body.\n return this.resolveParentScrimTarget();\n }\n },\n\n resolveBodyScrimTarget () {\n return this.anchorEl?.closest('dialog') ?? this.anchorEl?.getRootNode()?.querySelector('body') ?? document.body;\n },\n\n // The scrim must land in the same top-layer context as the popover's own content\n // (the nearest ancestor <dialog> when nested in one). Otherwise, inside a native\n // <dialog>-based DtModal, a plain document.body scrim can't block clicks on the\n // rest of the dialog since top-layer content always paints above it regardless\n // of z-index — the \"modal\" behavior silently does nothing when nested.\n resolveScrimTarget () {\n if (this.appendTo instanceof HTMLElement) {\n return this.appendTo;\n }\n\n switch (this.appendTo) {\n case 'parent':\n return this.resolveParentScrimTarget();\n case 'root':\n return this.resolveRootScrimTarget();\n default:\n return this.resolveBodyScrimTarget();\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 // Popper's own debounced forceUpdate() can invoke this callback for the lifetime of the\n // tippy instance, including after anchorEl has gone null (e.g. isOpen flips true before\n // mounted() resolves an anchor). Returning undefined here throws inside that debounced\n // call, so fall back to a zero rect instead.\n const anchorReferenceRect = this.anchorEl?.getBoundingClientRect() ?? {\n width: 0, height: 0, top: 0, left: 0, right: 0, bottom: 0, x: 0, y: 0,\n };\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 this.scrimTarget = this.resolveScrimTarget();\n\n let internalAppendTo = null;\n let iFrameError = false;\n\n switch (this.appendTo) {\n case 'body':\n // When inside a native <dialog> (e.g. DtModal in Dialtone Next), append to the\n // dialog so the popover stays in the browser's top layer. Otherwise fall back to body.\n internalAppendTo = this.anchorEl?.closest('dialog') ??\n 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":"6kBAgKA,IAAK,EAAU,CACb,KAAM,YAKN,WAAY,CACV,kBAAA,EAAA,QACA,WAAA,EAAA,QACA,oBAAA,EAAA,QACD,CAED,OAAQ,CAAC,EAAA,QAAY,EAAA,QAAU,CAE/B,MAAO,CAOL,KAAM,CACJ,KAAM,CAAC,QAAS,KAAK,CACrB,QAAS,KACV,CAYD,yBAA0B,CACxB,KAAM,SACN,QAAS,KACV,CAOD,uBAAwB,CACtB,KAAM,QACN,QAAS,GACV,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,UAAY,GACH,EAAA,cAAc,SAAS,EAAK,CAEtC,CASD,eAAgB,CACd,KAAM,OACN,QAAS,KACV,CAMD,UAAW,CACT,KAAM,OACN,QAAS,KACV,CAMD,QAAS,CACP,KAAM,OACN,QAAS,QACT,UAAY,GACH,OAAO,KAAK,EAAA,wBAAwB,CAAC,KAAM,GAAS,IAAS,EAAQ,CAE/E,CAKD,aAAc,CACZ,KAAM,CAAC,OAAQ,MAAO,OAAO,CAC7B,QAAS,GACV,CAOD,aAAc,CACZ,KAAM,OACN,QAAS,GACT,UAAW,GAAgB,EAAA,uBAAuB,SAAS,EAAa,CACzE,CAKD,cAAe,CACb,KAAM,QACN,QAAS,KACV,CAKD,gBAAiB,CACf,KAAM,QAAU,KAChB,QAAS,GACV,CAOD,eAAgB,CACd,KAAM,OACN,QAAS,GACV,CAMD,sBAAuB,CACrB,KAAM,EAAA,kBACN,QAAS,KACV,CAKD,GAAI,CACF,KAAM,OACN,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A,EAAA,YAAA,EAAA,EAAA,EAAA,aAIP,EAAA,OAHA,IAAI,wBACH,KAAM,EAAA,OAAI,OAAA,WAA2B,IAAA,GACrC,QAAO,EAAA,iPA9E2B,EAAA,OAAS,EAAA,YAAc,EAAA,qCAAgE,EAAA,OAAS,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=\"scrimTarget\"\n >\n <div\n class=\"d-modal--transparent\"\n data-qa=\"dt-popover-scrim\"\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 :class=\"anchorClass\"\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=\"onArrowKeyPress\"\n @keydown.down=\"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 v-dt-focustrap=\"{\n active: (modal || focustrap) && isOpen,\n initialFocus: false,\n restoreFocus: !modal && focustrap,\n }\"\n :role=\"role\"\n :data-qa=\"$attrs['data-qa'] ? `${$attrs['data-qa']}__dialog` : 'dt-popover'\"\n :aria-hidden=\"`${isDialogAriaHidden}`\"\n :aria-labelledby=\"labelledBy\"\n :aria-label=\"ariaLabel\"\n :aria-modal=\"role === 'menu' ? undefined : `${!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-bind=\"modeAttrs\"\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], headerWrapperClass]\"\n :content-class=\"headerClass\"\n type=\"header\"\n :show-close-button=\"showCloseButton\"\n :close-role=\"role === 'menu' ? 'menuitem' : undefined\"\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], footerWrapperClass]\"\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 ref=\"popover__close-button\"\n :role=\"role === 'menu' ? 'menuitem' : undefined\"\n :tabindex=\"role === 'menu' ? -1 : undefined\"\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_BOUNDARY_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 './PopoverConstants';\nimport { getUniqueString, hasSlotContent, isOutOfViewPort, warnIfUnmounted, disableRootScrolling, enableRootScrolling, returnFirstEl } from '@/common/utils';\nimport { HTML_ELEMENT_TYPE } from '@/common/constants';\nimport { DtLazyShow } from '@/components/LazyShow';\nimport ModalMixin from '@/common/mixins/modal';\nimport ModeMixin from '@/common/mixins/mode';\nimport { createTippyPopover, getPopperOptions } from './TippyUtils';\nimport PopoverHeaderFooter from './PopoverHeaderFooter.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 name: 'DtPopover',\n\n /********************\n * CHILD COMPONENTS *\n ********************/\n components: {\n SrOnlyCloseButton,\n DtLazyShow,\n PopoverHeaderFooter,\n },\n\n mixins: [ModalMixin, ModeMixin],\n\n props: {\n /**\n * Controls whether the popover is shown. When null (default), the popover\n * toggles on click. When set to true or false, the default trigger is\n * disabled and the parent controls visibility via v-model:open.\n * @values null, true, false\n */\n open: {\n type: [Boolean, null],\n default: null,\n },\n\n /**\n * Optional callback receiving the open boolean synchronously on logical visibility changes.\n * Includes initial true during creation, before mount, when open=true.\n * Does not declare or emit an open-change event.\n * For modal removal, keep modal=true, its anchor and scroll container unchanged until opened(false).\n * Changing modal or the anchor's scroll context after opening can retain the original lock.\n * opened(false) reports transition completion, not global scroll-lock ownership.\n * A closed modal with no pending transition or retained scroll lock can be removed immediately.\n * Defer direct app.unmount() until Vue's next tick.\n */\n visibilityChangeCallback: {\n type: Function,\n default: null,\n },\n\n /**\n * Forwards anchor ArrowUp/ArrowDown with a boolean open prop without toggling.\n * Default false preserves controlled anchor keyboard behavior.\n * @values true, false\n */\n forwardAnchorArrowKeys: {\n type: Boolean,\n default: false,\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 * Closes the popover when clicking the anchor or outside the content box.\n * @values true, false\n */\n closeOnClick: {\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 * When true, traps Tab/Shift+Tab focus within the popover dialog.\n * Use this to enable focus trapping independently of modal state —\n * e.g. a non-modal popover whose content still requires keyboard containment.\n * When `modal` is true, the trap is already active; this prop has no additional effect.\n * @values true, false\n */\n focustrap: {\n type: Boolean,\n default: false,\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 element used to determine overflow boundaries for the popover.\n * <a\n * class=\"d-link\"\n * href=\"https://popper.js.org/docs/v2/utils/detect-overflow/#boundary\"\n * target=\"_blank\"\n * >\n * Popper.js docs\n * </a>\n * @values clippingParents, viewport, document, HTMLElement\n */\n boundary: {\n type: [String, HTML_ELEMENT_TYPE],\n default: 'clippingParents',\n validator: boundary => {\n return POPOVER_BOUNDARY_VALUES.includes(boundary) ||\n (boundary instanceof HTMLElement);\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 */\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 anchor wrapper element.\n */\n anchorClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Additional class name for the header element (d-popover__header).\n */\n headerWrapperClass: {\n type: [String, Array, Object],\n default: '',\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 element (d-popover__footer).\n */\n footerWrapperClass: {\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 ancestor <dialog> element when inside one\n * (keeping the popover in the browser's top layer), or to the nearest body otherwise.\n * To always append to body regardless of dialog context, pass document.body as an HTMLElement.\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 after the current transition and initial focus work complete\n *\n * @event opened\n * @type {Boolean | Array}\n */\n 'opened',\n\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 visibilityGeneration: 0,\n // Only true once the leave transition (and any focus restoration in onLeaveTransitionComplete) has\n // finished, so aria-hidden is never applied while the dialog still holds focus or is still visible.\n isDialogAriaHidden: true,\n toAppear: false,\n anchorEl: null,\n popoverContentEl: null,\n hasSlotContent,\n // Resolved in initTippyInstance(), the same moment the content's own target is resolved,\n // rather than left as a live computed — otherwise the scrim could drift from the content\n // if appendTo changes while already open, since content resolution isn't reactive to that.\n // Starts as the string 'body' (a valid Teleport target, matching the original hardcoded\n // default) rather than null or document.body -- Teleport needs a valid target from the\n // first render, and document.body would break SSR where document doesn't exist.\n scrimTarget: 'body',\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-spacing-50))`;\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')) || undefined;\n },\n\n modalValidationState () {\n return [this.modal, this.initialFocusElement];\n },\n\n },\n\n watch: {\n modalValidationState: { handler: 'validateProps', immediate: true },\n\n modal: {\n immediate: true,\n handler (modal) {\n this.tip?.setProps({\n zIndex: modal ? 650 : this.calculateAnchorZindex(),\n });\n },\n },\n\n offset: {\n deep: true,\n handler (offset) {\n this.tip?.setProps({\n offset,\n });\n },\n },\n\n sticky (sticky) {\n this.tip?.setProps({\n sticky,\n });\n },\n\n fallbackPlacements: {\n deep: true,\n handler () {\n this.tip?.setProps({\n popperOptions: this.popperOptions(),\n });\n },\n },\n\n tether () {\n this.tip?.setProps({\n popperOptions: this.popperOptions(),\n });\n },\n\n boundary () {\n this.tip?.setProps({ popperOptions: this.popperOptions() });\n },\n\n externalAnchorElement () {\n this.updateAnchorEl();\n },\n\n placement (placement) {\n this.tip?.setProps({\n placement,\n });\n },\n\n // Register before the immediate open watcher so initial open=true notifies and exposes the dialog.\n isOpen: [\n {\n flush: 'sync',\n handler (isOpen) {\n this.visibilityGeneration++;\n if (!this._isUnmounting) this.visibilityChangeCallback?.(isOpen);\n },\n },\n {\n handler (isOpen) {\n if (isOpen) {\n this.isDialogAriaHidden = false;\n // Initial open=true runs before mounted() resolves anchorEl; tippy needs an anchor.\n if (!this.anchorEl) return;\n this.initTippyInstance();\n this.tip?.show();\n } else {\n this.removeEventListeners();\n this.tip?.hide();\n }\n },\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\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-spacing-50) (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 getCloseButtonElement () {\n const closeButton = this.showCloseButton\n ? this.$refs.popover__header?.$refs['popover__close-button']\n : this.$refs['popover__close-button'];\n return returnFirstEl(closeButton?.$el);\n },\n\n getModeReferenceEl () {\n return this.$refs.anchor;\n },\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 boundary: this.boundary,\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\"], .d-modal[open], .d-modal--transparent[open]') ||\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 const isControlled = this.open !== null;\n if (isControlled && this.forwardAnchorArrowKeys) {\n this.$emit('keydown', e);\n return;\n }\n e.preventDefault();\n if (isControlled) 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 isCurrentVisibility (generation, isOpen) {\n return !this._isUnmounting && this.visibilityGeneration === generation && this.isOpen === isOpen;\n },\n\n async onLeaveTransitionComplete () {\n const generation = this.visibilityGeneration;\n if (!this.isCurrentVisibility(generation, false)) return;\n if (this.modal) {\n const anchor = await this.getFirstFocusableElement(this.$refs.anchor);\n if (!this.isCurrentVisibility(generation, false)) return;\n anchor?.focus({ preventScroll: true });\n // Allow consumers to choose their own focus destination.\n await this.$nextTick();\n if (!this.isCurrentVisibility(generation, false)) return;\n this.enableScrolling();\n }\n this.isDialogAriaHidden = true;\n this.tip?.unmount();\n this.$emit('opened', false);\n if (this.isCurrentVisibility(generation, false) && this.open !== null) {\n this.$emit('update:open', false);\n }\n },\n\n async onEnterTransitionComplete () {\n const generation = this.visibilityGeneration;\n if (!this.isCurrentVisibility(generation, true)) return;\n await this.focusInitialElement(generation);\n // Allow consumers to choose their own focus destination.\n await this.$nextTick();\n if (!this.isCurrentVisibility(generation, true)) return;\n this.preventScrolling();\n this.$emit('opened', true, this.$refs.popover__content);\n if (this.isCurrentVisibility(generation, true) && this.open !== null) {\n this.$emit('update:open', true);\n }\n },\n\n async focusInitialElement (generation) {\n if (this.initialFocusElement === 'dialog') {\n returnFirstEl(this.$refs.content?.$el)?.focus();\n }\n if (typeof this.initialFocusElement === 'string' && this.initialFocusElement.startsWith('#')) {\n this.focusInitialElementById();\n }\n if (this.initialFocusElement === 'first') {\n await this.focusFirstElementIfNeeded(this.$refs.popover__content, generation);\n }\n if (!this.isCurrentVisibility(generation, true)) return;\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.closeOnClick) 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 // Tab focus trapping (when modal or focustrap) is handled by the v-dt-focustrap directive on the content.\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 async focusFirstElementIfNeeded (domEl, generation = this.visibilityGeneration) {\n const focusableElements = this._getFocusableElements(domEl, true);\n if (focusableElements.length !== 0) {\n const element = await this.getFirstFocusableElement(domEl);\n if (!this.isCurrentVisibility(generation, true)) return;\n element?.focus({ preventScroll: true });\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 resolveParentScrimTarget () {\n return this.anchorEl?.parentElement ?? document.body;\n },\n\n resolveRootScrimTarget () {\n try {\n return window.parent.document.body;\n } catch {\n // Matches the content's own fallback: when the parent frame is cross-origin,\n // initTippyInstance falls back to Tippy's 'parent' sentinel (the anchor's own\n // parentElement) rather than document.body.\n return this.resolveParentScrimTarget();\n }\n },\n\n resolveBodyScrimTarget () {\n return this.anchorEl?.closest('dialog') ?? this.anchorEl?.getRootNode()?.querySelector('body') ?? document.body;\n },\n\n // The scrim must land in the same top-layer context as the popover's own content\n // (the nearest ancestor <dialog> when nested in one). Otherwise, inside a native\n // <dialog>-based DtModal, a plain document.body scrim can't block clicks on the\n // rest of the dialog since top-layer content always paints above it regardless\n // of z-index — the \"modal\" behavior silently does nothing when nested.\n resolveScrimTarget () {\n if (this.appendTo instanceof HTMLElement) {\n return this.appendTo;\n }\n\n switch (this.appendTo) {\n case 'parent':\n return this.resolveParentScrimTarget();\n case 'root':\n return this.resolveRootScrimTarget();\n default:\n return this.resolveBodyScrimTarget();\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 // Popper's own debounced forceUpdate() can invoke this callback for the lifetime of the\n // tippy instance, including after anchorEl has gone null (e.g. isOpen flips true before\n // mounted() resolves an anchor). Returning undefined here throws inside that debounced\n // call, so fall back to a zero rect instead.\n const anchorReferenceRect = this.anchorEl?.getBoundingClientRect() ?? {\n width: 0, height: 0, top: 0, left: 0, right: 0, bottom: 0, x: 0, y: 0,\n };\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 this.scrimTarget = this.resolveScrimTarget();\n\n let internalAppendTo = null;\n let iFrameError = false;\n\n switch (this.appendTo) {\n case 'body':\n // When inside a native <dialog> (e.g. DtModal in Dialtone Next), append to the\n // dialog so the popover stays in the browser's top layer. Otherwise fall back to body.\n internalAppendTo = this.anchorEl?.closest('dialog') ??\n 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":"6kBAiKA,IAAK,EAAU,CACb,KAAM,YAKN,WAAY,CACV,kBAAA,EAAA,QACA,WAAA,EAAA,QACA,oBAAA,EAAA,QACD,CAED,OAAQ,CAAC,EAAA,QAAY,EAAA,QAAU,CAE/B,MAAO,CAOL,KAAM,CACJ,KAAM,CAAC,QAAS,KAAK,CACrB,QAAS,KACV,CAYD,yBAA0B,CACxB,KAAM,SACN,QAAS,KACV,CAOD,uBAAwB,CACtB,KAAM,QACN,QAAS,GACV,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,UAAY,GACH,EAAA,cAAc,SAAS,EAAK,CAEtC,CASD,eAAgB,CACd,KA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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,gBAAK,CAAG,EAAA,sCAAsC,EAAA,SAAU,EAAA,mBAAkB,CAAA,CAC1E,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,aAKP,EAAA,OAJA,IAAI,wBACH,KAAM,EAAA,OAAI,OAAA,WAA2B,IAAA,GACrC,SAAU,EAAA,OAAI,OAAA,GAAmB,IAAA,GACjC,QAAO,EAAA,4PA/E2B,EAAA,OAAS,EAAA,YAAc,EAAA,qCAAgE,EAAA,OAAS,EAAA"}
|
|
@@ -664,8 +664,13 @@ function W(e, t, n, r, i, a) {
|
|
|
664
664
|
key: 2,
|
|
665
665
|
ref: "popover__close-button",
|
|
666
666
|
role: n.role === "menu" ? "menuitem" : void 0,
|
|
667
|
+
tabindex: n.role === "menu" ? -1 : void 0,
|
|
667
668
|
onClose: a.closePopover
|
|
668
|
-
}, null, 8, [
|
|
669
|
+
}, null, 8, [
|
|
670
|
+
"role",
|
|
671
|
+
"tabindex",
|
|
672
|
+
"onClose"
|
|
673
|
+
]))
|
|
669
674
|
]),
|
|
670
675
|
_: 3
|
|
671
676
|
}, 16, [
|