@dialpad/dialtone 9.123.1 → 9.123.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/css/dialtone-default-theme.css +50 -28
- package/dist/css/dialtone-default-theme.min.css +1 -1
- package/dist/css/dialtone-docs.json +1 -1
- package/dist/css/dialtone.css +50 -28
- package/dist/css/dialtone.min.css +1 -1
- package/dist/tokens/doc.json +17362 -17362
- package/dist/vue2/_plugin-vue2_normalizer-DSLOjnn3.js +11 -0
- package/dist/vue2/_plugin-vue2_normalizer-DSLOjnn3.js.map +1 -0
- package/dist/vue2/_plugin-vue2_normalizer-e_CkxkSV.cjs +2 -0
- package/dist/vue2/_plugin-vue2_normalizer-e_CkxkSV.cjs.map +1 -0
- package/dist/vue2/lib/attachment-carousel/attachment-carousel.cjs +1 -1
- package/dist/vue2/lib/attachment-carousel/attachment-carousel.cjs.map +1 -1
- package/dist/vue2/lib/attachment-carousel/attachment-carousel.js +8 -17
- package/dist/vue2/lib/attachment-carousel/attachment-carousel.js.map +1 -1
- package/dist/vue2/lib/avatar/avatar.cjs +1 -1
- package/dist/vue2/lib/avatar/avatar.js +2 -5
- package/dist/vue2/lib/avatar/avatar.js.map +1 -1
- package/dist/vue2/lib/badge/badge.cjs +1 -1
- package/dist/vue2/lib/badge/badge.js +4 -7
- package/dist/vue2/lib/badge/badge.js.map +1 -1
- package/dist/vue2/lib/banner/banner.cjs +2 -2
- package/dist/vue2/lib/banner/banner.js +6 -9
- package/dist/vue2/lib/banner/banner.js.map +1 -1
- package/dist/vue2/lib/breadcrumbs/breadcrumb-item.cjs +1 -1
- package/dist/vue2/lib/breadcrumbs/breadcrumb-item.js +4 -7
- package/dist/vue2/lib/breadcrumbs/breadcrumb-item.js.map +1 -1
- package/dist/vue2/lib/breadcrumbs/breadcrumbs.cjs +1 -1
- package/dist/vue2/lib/breadcrumbs/breadcrumbs.js +2 -5
- package/dist/vue2/lib/breadcrumbs/breadcrumbs.js.map +1 -1
- package/dist/vue2/lib/button/button.cjs +1 -1
- package/dist/vue2/lib/button/button.js +2 -5
- package/dist/vue2/lib/button/button.js.map +1 -1
- package/dist/vue2/lib/button-group/button-group.cjs +1 -1
- package/dist/vue2/lib/button-group/button-group.js +8 -11
- package/dist/vue2/lib/button-group/button-group.js.map +1 -1
- package/dist/vue2/lib/button-group/buttons-decorator.cjs +1 -1
- package/dist/vue2/lib/button-group/buttons-decorator.js +4 -7
- package/dist/vue2/lib/button-group/buttons-decorator.js.map +1 -1
- package/dist/vue2/lib/callbar-button/callbar-button.cjs +1 -1
- package/dist/vue2/lib/callbar-button/callbar-button.js +7 -10
- package/dist/vue2/lib/callbar-button/callbar-button.js.map +1 -1
- package/dist/vue2/lib/callbar-button-with-dropdown/callbar-button-with-dropdown.cjs +1 -1
- package/dist/vue2/lib/callbar-button-with-dropdown/callbar-button-with-dropdown.js +2 -5
- package/dist/vue2/lib/callbar-button-with-dropdown/callbar-button-with-dropdown.js.map +1 -1
- package/dist/vue2/lib/callbar-button-with-popover/callbar-button-with-popover.cjs +1 -1
- package/dist/vue2/lib/callbar-button-with-popover/callbar-button-with-popover.js +9 -12
- package/dist/vue2/lib/callbar-button-with-popover/callbar-button-with-popover.js.map +1 -1
- package/dist/vue2/lib/callbox/callbox.cjs +1 -1
- package/dist/vue2/lib/callbox/callbox.js +2 -5
- package/dist/vue2/lib/callbox/callbox.js.map +1 -1
- package/dist/vue2/lib/card/card.cjs +1 -1
- package/dist/vue2/lib/card/card.js +4 -7
- package/dist/vue2/lib/card/card.js.map +1 -1
- package/dist/vue2/lib/checkbox/checkbox.cjs +1 -1
- package/dist/vue2/lib/checkbox/checkbox.js +2 -5
- package/dist/vue2/lib/checkbox/checkbox.js.map +1 -1
- package/dist/vue2/lib/checkbox-group/checkbox-group.cjs +1 -1
- package/dist/vue2/lib/checkbox-group/checkbox-group.js +5 -8
- package/dist/vue2/lib/checkbox-group/checkbox-group.js.map +1 -1
- package/dist/vue2/lib/checkbox-group/checkboxes-decorator.cjs +1 -1
- package/dist/vue2/lib/checkbox-group/checkboxes-decorator.js +9 -12
- package/dist/vue2/lib/checkbox-group/checkboxes-decorator.js.map +1 -1
- package/dist/vue2/lib/chip/chip.cjs +1 -1
- package/dist/vue2/lib/chip/chip.js +8 -11
- package/dist/vue2/lib/chip/chip.js.map +1 -1
- package/dist/vue2/lib/codeblock/codeblock.cjs +2 -2
- package/dist/vue2/lib/codeblock/codeblock.js +8 -11
- package/dist/vue2/lib/codeblock/codeblock.js.map +1 -1
- package/dist/vue2/lib/collapsible/collapsible-lazy-show.cjs +1 -1
- package/dist/vue2/lib/collapsible/collapsible-lazy-show.js +2 -5
- package/dist/vue2/lib/collapsible/collapsible-lazy-show.js.map +1 -1
- package/dist/vue2/lib/collapsible/collapsible.cjs +1 -1
- package/dist/vue2/lib/collapsible/collapsible.js +4 -7
- package/dist/vue2/lib/collapsible/collapsible.js.map +1 -1
- package/dist/vue2/lib/combobox/combobox-empty-list.cjs +1 -1
- package/dist/vue2/lib/combobox/combobox-empty-list.js +7 -10
- package/dist/vue2/lib/combobox/combobox-empty-list.js.map +1 -1
- package/dist/vue2/lib/combobox/combobox-loading-list.cjs +1 -1
- package/dist/vue2/lib/combobox/combobox-loading-list.js +7 -10
- package/dist/vue2/lib/combobox/combobox-loading-list.js.map +1 -1
- package/dist/vue2/lib/combobox/combobox.cjs +2 -2
- package/dist/vue2/lib/combobox/combobox.js +2 -5
- package/dist/vue2/lib/combobox/combobox.js.map +1 -1
- package/dist/vue2/lib/combobox-multi-select/combobox-multi-select.cjs +1 -1
- package/dist/vue2/lib/combobox-multi-select/combobox-multi-select.js +6 -9
- package/dist/vue2/lib/combobox-multi-select/combobox-multi-select.js.map +1 -1
- package/dist/vue2/lib/combobox-with-popover/combobox-with-popover.cjs +1 -1
- package/dist/vue2/lib/combobox-with-popover/combobox-with-popover.js +2 -5
- package/dist/vue2/lib/combobox-with-popover/combobox-with-popover.js.map +1 -1
- package/dist/vue2/lib/contact-centers-row/contact-centers-row.cjs +1 -1
- package/dist/vue2/lib/contact-centers-row/contact-centers-row.js +6 -9
- package/dist/vue2/lib/contact-centers-row/contact-centers-row.js.map +1 -1
- package/dist/vue2/lib/contact-info/contact-info.cjs +1 -1
- package/dist/vue2/lib/contact-info/contact-info.js +5 -8
- package/dist/vue2/lib/contact-info/contact-info.js.map +1 -1
- package/dist/vue2/lib/contact-row/contact-row.cjs +1 -1
- package/dist/vue2/lib/contact-row/contact-row.js +2 -5
- package/dist/vue2/lib/contact-row/contact-row.js.map +1 -1
- package/dist/vue2/lib/datepicker/datepicker.cjs +1 -1
- package/dist/vue2/lib/datepicker/datepicker.cjs.map +1 -1
- package/dist/vue2/lib/datepicker/datepicker.js +4 -13
- package/dist/vue2/lib/datepicker/datepicker.js.map +1 -1
- package/dist/vue2/lib/description-list/description-list.cjs +1 -1
- package/dist/vue2/lib/description-list/description-list.js +10 -13
- package/dist/vue2/lib/description-list/description-list.js.map +1 -1
- package/dist/vue2/lib/dropdown/dropdown-list.cjs +1 -1
- package/dist/vue2/lib/dropdown/dropdown-list.js +5 -8
- package/dist/vue2/lib/dropdown/dropdown-list.js.map +1 -1
- package/dist/vue2/lib/dropdown/dropdown-separator.cjs +1 -1
- package/dist/vue2/lib/dropdown/dropdown-separator.js +4 -7
- package/dist/vue2/lib/dropdown/dropdown-separator.js.map +1 -1
- package/dist/vue2/lib/dropdown/dropdown.cjs +1 -1
- package/dist/vue2/lib/dropdown/dropdown.js +2 -5
- package/dist/vue2/lib/dropdown/dropdown.js.map +1 -1
- package/dist/vue2/lib/editor/editor.cjs +1 -1
- package/dist/vue2/lib/editor/editor.js +46 -49
- package/dist/vue2/lib/editor/editor.js.map +1 -1
- package/dist/vue2/lib/emoji/emoji.cjs +1 -1
- package/dist/vue2/lib/emoji/emoji.js +7 -10
- package/dist/vue2/lib/emoji/emoji.js.map +1 -1
- package/dist/vue2/lib/emoji-picker/emoji-picker.cjs +1 -1
- package/dist/vue2/lib/emoji-picker/emoji-picker.cjs.map +1 -1
- package/dist/vue2/lib/emoji-picker/emoji-picker.js +7 -25
- package/dist/vue2/lib/emoji-picker/emoji-picker.js.map +1 -1
- package/dist/vue2/lib/emoji-row/emoji-row.cjs +1 -1
- package/dist/vue2/lib/emoji-row/emoji-row.js +3 -6
- package/dist/vue2/lib/emoji-row/emoji-row.js.map +1 -1
- package/dist/vue2/lib/emoji-text-wrapper/emoji-text-wrapper.cjs +1 -1
- package/dist/vue2/lib/emoji-text-wrapper/emoji-text-wrapper.js +6 -9
- package/dist/vue2/lib/emoji-text-wrapper/emoji-text-wrapper.js.map +1 -1
- package/dist/vue2/lib/empty-state/empty-state.cjs +1 -1
- package/dist/vue2/lib/empty-state/empty-state.js +6 -9
- package/dist/vue2/lib/empty-state/empty-state.js.map +1 -1
- package/dist/vue2/lib/feed-item-pill/feed-item-pill.cjs +1 -1
- package/dist/vue2/lib/feed-item-pill/feed-item-pill.js +11 -14
- package/dist/vue2/lib/feed-item-pill/feed-item-pill.js.map +1 -1
- package/dist/vue2/lib/feed-item-row/feed-item-row.cjs +1 -1
- package/dist/vue2/lib/feed-item-row/feed-item-row.js +6 -9
- package/dist/vue2/lib/feed-item-row/feed-item-row.js.map +1 -1
- package/dist/vue2/lib/general-row/general-row.cjs +1 -1
- package/dist/vue2/lib/general-row/general-row.js +2 -5
- package/dist/vue2/lib/general-row/general-row.js.map +1 -1
- package/dist/vue2/lib/general-row/leftbar-general-row-icon.cjs +1 -1
- package/dist/vue2/lib/general-row/leftbar-general-row-icon.js +7 -10
- package/dist/vue2/lib/general-row/leftbar-general-row-icon.js.map +1 -1
- package/dist/vue2/lib/group-row/group-row.cjs +1 -1
- package/dist/vue2/lib/group-row/group-row.js +4 -7
- package/dist/vue2/lib/group-row/group-row.js.map +1 -1
- package/dist/vue2/lib/grouped-chip/grouped-chip.cjs +1 -1
- package/dist/vue2/lib/grouped-chip/grouped-chip.js +4 -7
- package/dist/vue2/lib/grouped-chip/grouped-chip.js.map +1 -1
- package/dist/vue2/lib/hovercard/hovercard.cjs +1 -1
- package/dist/vue2/lib/hovercard/hovercard.js +6 -9
- package/dist/vue2/lib/hovercard/hovercard.js.map +1 -1
- package/dist/vue2/lib/icon/icon.cjs +1 -1
- package/dist/vue2/lib/icon/icon.js +9 -12
- package/dist/vue2/lib/icon/icon.js.map +1 -1
- package/dist/vue2/lib/illustration/illustration.cjs +1 -1
- package/dist/vue2/lib/illustration/illustration.js +10 -13
- package/dist/vue2/lib/illustration/illustration.js.map +1 -1
- package/dist/vue2/lib/image-viewer/image-viewer.cjs +1 -1
- package/dist/vue2/lib/image-viewer/image-viewer.js +6 -9
- package/dist/vue2/lib/image-viewer/image-viewer.js.map +1 -1
- package/dist/vue2/lib/input/input.cjs +1 -1
- package/dist/vue2/lib/input/input.js +2 -5
- package/dist/vue2/lib/input/input.js.map +1 -1
- package/dist/vue2/lib/input-group/input-group.cjs +1 -1
- package/dist/vue2/lib/input-group/input-group.js +6 -9
- package/dist/vue2/lib/input-group/input-group.js.map +1 -1
- package/dist/vue2/lib/item-layout/item-layout.cjs +2 -2
- package/dist/vue2/lib/item-layout/item-layout.js +4 -7
- package/dist/vue2/lib/item-layout/item-layout.js.map +1 -1
- package/dist/vue2/lib/ivr-node/ivr-node.cjs +1 -1
- package/dist/vue2/lib/ivr-node/ivr-node.js +11 -14
- package/dist/vue2/lib/ivr-node/ivr-node.js.map +1 -1
- package/dist/vue2/lib/keyboard-shortcut/keyboard-shortcut.cjs +1 -1
- package/dist/vue2/lib/keyboard-shortcut/keyboard-shortcut.js +10 -13
- package/dist/vue2/lib/keyboard-shortcut/keyboard-shortcut.js.map +1 -1
- package/dist/vue2/lib/lazy-show/lazy-show.cjs +1 -1
- package/dist/vue2/lib/lazy-show/lazy-show.js +2 -5
- package/dist/vue2/lib/lazy-show/lazy-show.js.map +1 -1
- package/dist/vue2/lib/link/link.cjs +1 -1
- package/dist/vue2/lib/link/link.js +6 -9
- package/dist/vue2/lib/link/link.js.map +1 -1
- package/dist/vue2/lib/list-item/list-item.cjs +1 -1
- package/dist/vue2/lib/list-item/list-item.js +22 -25
- package/dist/vue2/lib/list-item/list-item.js.map +1 -1
- package/dist/vue2/lib/list-item-group/list-item-group.cjs +1 -1
- package/dist/vue2/lib/list-item-group/list-item-group.js +8 -11
- package/dist/vue2/lib/list-item-group/list-item-group.js.map +1 -1
- package/dist/vue2/lib/message-input/message-input-button.cjs +1 -1
- package/dist/vue2/lib/message-input/message-input-button.js +4 -7
- package/dist/vue2/lib/message-input/message-input-button.js.map +1 -1
- package/dist/vue2/lib/message-input/message-input-link.cjs +1 -1
- package/dist/vue2/lib/message-input/message-input-link.js +2 -5
- package/dist/vue2/lib/message-input/message-input-link.js.map +1 -1
- package/dist/vue2/lib/message-input/message-input-topbar.cjs +1 -1
- package/dist/vue2/lib/message-input/message-input-topbar.js +2 -5
- package/dist/vue2/lib/message-input/message-input-topbar.js.map +1 -1
- package/dist/vue2/lib/message-input/message-input.cjs +1 -1
- package/dist/vue2/lib/message-input/message-input.cjs.map +1 -1
- package/dist/vue2/lib/message-input/message-input.js +3 -9
- package/dist/vue2/lib/message-input/message-input.js.map +1 -1
- package/dist/vue2/lib/modal/modal.cjs +2 -2
- package/dist/vue2/lib/modal/modal.js +2 -5
- package/dist/vue2/lib/modal/modal.js.map +1 -1
- package/dist/vue2/lib/notice/notice-action.cjs +1 -1
- package/dist/vue2/lib/notice/notice-action.js +4 -7
- package/dist/vue2/lib/notice/notice-action.js.map +1 -1
- package/dist/vue2/lib/notice/notice-content.cjs +1 -1
- package/dist/vue2/lib/notice/notice-content.js +2 -5
- package/dist/vue2/lib/notice/notice-content.js.map +1 -1
- package/dist/vue2/lib/notice/notice-icon.cjs +1 -1
- package/dist/vue2/lib/notice/notice-icon.js +13 -16
- package/dist/vue2/lib/notice/notice-icon.js.map +1 -1
- package/dist/vue2/lib/notice/notice.cjs +1 -1
- package/dist/vue2/lib/notice/notice.js +7 -10
- package/dist/vue2/lib/notice/notice.js.map +1 -1
- package/dist/vue2/lib/pagination/pagination.cjs +1 -1
- package/dist/vue2/lib/pagination/pagination.js +6 -9
- package/dist/vue2/lib/pagination/pagination.js.map +1 -1
- package/dist/vue2/lib/popover/popover-header-footer.cjs +1 -1
- package/dist/vue2/lib/popover/popover-header-footer.js +5 -8
- package/dist/vue2/lib/popover/popover-header-footer.js.map +1 -1
- package/dist/vue2/lib/popover/popover.cjs +1 -1
- package/dist/vue2/lib/popover/popover.cjs.map +1 -1
- package/dist/vue2/lib/popover/popover.js +3 -6
- package/dist/vue2/lib/popover/popover.js.map +1 -1
- package/dist/vue2/lib/presence/presence.cjs +1 -1
- package/dist/vue2/lib/presence/presence.js +4 -7
- package/dist/vue2/lib/presence/presence.js.map +1 -1
- package/dist/vue2/lib/radio/radio.cjs +1 -1
- package/dist/vue2/lib/radio/radio.js +5 -8
- package/dist/vue2/lib/radio/radio.js.map +1 -1
- package/dist/vue2/lib/radio-group/radio-group.cjs +1 -1
- package/dist/vue2/lib/radio-group/radio-group.js +2 -5
- package/dist/vue2/lib/radio-group/radio-group.js.map +1 -1
- package/dist/vue2/lib/radio-group/radios-decorator.cjs +1 -1
- package/dist/vue2/lib/radio-group/radios-decorator.js +6 -9
- package/dist/vue2/lib/radio-group/radios-decorator.js.map +1 -1
- package/dist/vue2/lib/rich-text-editor/rich-text-editor.cjs +3 -3
- package/dist/vue2/lib/rich-text-editor/rich-text-editor.cjs.map +1 -1
- package/dist/vue2/lib/rich-text-editor/rich-text-editor.js +11 -41
- package/dist/vue2/lib/rich-text-editor/rich-text-editor.js.map +1 -1
- package/dist/vue2/lib/root-layout/root-layout.cjs +1 -1
- package/dist/vue2/lib/root-layout/root-layout.js +5 -8
- package/dist/vue2/lib/root-layout/root-layout.js.map +1 -1
- package/dist/vue2/lib/select-menu/select-menu.cjs +1 -1
- package/dist/vue2/lib/select-menu/select-menu.js +2 -5
- package/dist/vue2/lib/select-menu/select-menu.js.map +1 -1
- package/dist/vue2/lib/settings-menu-button/settings-menu-button.cjs +1 -1
- package/dist/vue2/lib/settings-menu-button/settings-menu-button.js +4 -7
- package/dist/vue2/lib/settings-menu-button/settings-menu-button.js.map +1 -1
- package/dist/vue2/lib/skeleton/skeleton-list-item.cjs +1 -1
- package/dist/vue2/lib/skeleton/skeleton-list-item.js +2 -5
- package/dist/vue2/lib/skeleton/skeleton-list-item.js.map +1 -1
- package/dist/vue2/lib/skeleton/skeleton-paragraph.cjs +1 -1
- package/dist/vue2/lib/skeleton/skeleton-paragraph.js +5 -8
- package/dist/vue2/lib/skeleton/skeleton-paragraph.js.map +1 -1
- package/dist/vue2/lib/skeleton/skeleton-shape.cjs +1 -1
- package/dist/vue2/lib/skeleton/skeleton-shape.js +4 -7
- package/dist/vue2/lib/skeleton/skeleton-shape.js.map +1 -1
- package/dist/vue2/lib/skeleton/skeleton-text.cjs +1 -1
- package/dist/vue2/lib/skeleton/skeleton-text.js +11 -14
- package/dist/vue2/lib/skeleton/skeleton-text.js.map +1 -1
- package/dist/vue2/lib/skeleton/skeleton.cjs +1 -1
- package/dist/vue2/lib/skeleton/skeleton.js +6 -9
- package/dist/vue2/lib/skeleton/skeleton.js.map +1 -1
- package/dist/vue2/lib/split-button/split-button-alpha.cjs +1 -1
- package/dist/vue2/lib/split-button/split-button-alpha.js +9 -12
- package/dist/vue2/lib/split-button/split-button-alpha.js.map +1 -1
- package/dist/vue2/lib/split-button/split-button-omega.cjs +1 -1
- package/dist/vue2/lib/split-button/split-button-omega.js +6 -9
- package/dist/vue2/lib/split-button/split-button-omega.js.map +1 -1
- package/dist/vue2/lib/split-button/split-button.cjs +1 -1
- package/dist/vue2/lib/split-button/split-button.js +6 -9
- package/dist/vue2/lib/split-button/split-button.js.map +1 -1
- package/dist/vue2/lib/stack/stack.cjs +1 -1
- package/dist/vue2/lib/stack/stack.js +12 -15
- package/dist/vue2/lib/stack/stack.js.map +1 -1
- package/dist/vue2/lib/tab/tab-group.cjs +1 -1
- package/dist/vue2/lib/tab/tab-group.js +2 -5
- package/dist/vue2/lib/tab/tab-group.js.map +1 -1
- package/dist/vue2/lib/tab/tab-panel.cjs +1 -1
- package/dist/vue2/lib/tab/tab-panel.js +8 -11
- package/dist/vue2/lib/tab/tab-panel.js.map +1 -1
- package/dist/vue2/lib/tab/tab.cjs +1 -1
- package/dist/vue2/lib/tab/tab.js +7 -10
- package/dist/vue2/lib/tab/tab.js.map +1 -1
- package/dist/vue2/lib/time-pill/time-pill.cjs +1 -1
- package/dist/vue2/lib/time-pill/time-pill.js +5 -8
- package/dist/vue2/lib/time-pill/time-pill.js.map +1 -1
- package/dist/vue2/lib/toast/toast.cjs +1 -1
- package/dist/vue2/lib/toast/toast.cjs.map +1 -1
- package/dist/vue2/lib/toast/toast.js +5 -17
- package/dist/vue2/lib/toast/toast.js.map +1 -1
- package/dist/vue2/lib/toggle/toggle.cjs +1 -1
- package/dist/vue2/lib/toggle/toggle.js +2 -5
- package/dist/vue2/lib/toggle/toggle.js.map +1 -1
- package/dist/vue2/lib/tooltip/tooltip.cjs +1 -1
- package/dist/vue2/lib/tooltip/tooltip.js +6 -9
- package/dist/vue2/lib/tooltip/tooltip.js.map +1 -1
- package/dist/vue2/lib/top-banner-info/top-banner-info.cjs +1 -1
- package/dist/vue2/lib/top-banner-info/top-banner-info.js +2 -5
- package/dist/vue2/lib/top-banner-info/top-banner-info.js.map +1 -1
- package/dist/vue2/lib/unread-pill/unread-pill.cjs +1 -1
- package/dist/vue2/lib/unread-pill/unread-pill.js +5 -8
- package/dist/vue2/lib/unread-pill/unread-pill.js.map +1 -1
- package/dist/vue2/lib/validation-messages/validation-messages.cjs +1 -1
- package/dist/vue2/lib/validation-messages/validation-messages.js +7 -10
- package/dist/vue2/lib/validation-messages/validation-messages.js.map +1 -1
- package/dist/vue2/shared/sr_only_close_button.cjs +1 -1
- package/dist/vue2/shared/sr_only_close_button.js +9 -12
- package/dist/vue2/shared/sr_only_close_button.js.map +1 -1
- package/dist/vue2/types/components/popover/popover.vue.d.ts.map +1 -1
- package/dist/vue3/lib/popover/popover.cjs +1 -1
- package/dist/vue3/lib/popover/popover.cjs.map +1 -1
- package/dist/vue3/lib/popover/popover.js +37 -38
- package/dist/vue3/lib/popover/popover.js.map +1 -1
- package/dist/vue3/lib/rich-text-editor/rich-text-editor.cjs +1 -1
- package/dist/vue3/lib/rich-text-editor/rich-text-editor.cjs.map +1 -1
- package/dist/vue3/lib/rich-text-editor/rich-text-editor.js +1 -1
- package/dist/vue3/lib/rich-text-editor/rich-text-editor.js.map +1 -1
- package/dist/vue3/types/components/popover/popover.vue.d.ts.map +1 -1
- package/package.json +3 -3
- package/dist/vue2/_plugin-vue2_normalizer-CeySl7Fu.js +0 -11
- package/dist/vue2/_plugin-vue2_normalizer-CeySl7Fu.js.map +0 -1
- package/dist/vue2/_plugin-vue2_normalizer-yXi3ZRRD.cjs +0 -2
- package/dist/vue2/_plugin-vue2_normalizer-yXi3ZRRD.cjs.map +0 -1
- package/dist/vue2/style.css +0 -1
- package/dist/vue3/style.css +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"popover.js","sources":["../../../components/popover/popover.vue"],"sourcesContent":["<!-- eslint-disable vuejs-accessibility/mouse-events-have-key-events -->\n<template>\n <div>\n <portal v-if=\"modal && isOpen\">\n <div\n class=\"d-modal--transparent\"\n :aria-hidden=\"modal && isOpen ? 'false' : 'true'\"\n @click.prevent.stop\n />\n </portal>\n <component\n :is=\"elementType\"\n ref=\"popover\"\n :class=\"['d-popover', { 'd-popover__anchor--opened': isOpen }]\"\n data-qa=\"dt-popover-container\"\n v-on=\"$listeners\"\n >\n <!-- eslint-disable-next-line vuejs-accessibility/no-static-element-interactions -->\n <div\n :id=\"!ariaLabelledby && labelledBy\"\n ref=\"anchor\"\n :data-qa=\"$attrs['data-qa'] ? `${$attrs['data-qa']}-anchor` : 'dt-popover-anchor'\"\n :tabindex=\"openOnContext ? 0 : undefined\"\n @click.capture=\"defaultToggleOpen\"\n @contextmenu=\"onContext\"\n @keydown.up.prevent=\"onArrowKeyPress\"\n @keydown.down.prevent=\"onArrowKeyPress\"\n @keydown.escape.capture=\"closePopover\"\n @mouseenter=\"onMouseEnter\"\n @mouseleave=\"onMouseLeave\"\n >\n <!-- @slot Anchor element that activates the popover. Usually a button. -->\n <slot\n name=\"anchor\"\n :attrs=\"{\n 'aria-expanded': isOpen.toString(),\n 'aria-controls': id,\n 'aria-haspopup': role,\n }\"\n />\n </div>\n <dt-lazy-show\n :id=\"id\"\n ref=\"content\"\n :role=\"role\"\n :data-qa=\"$attrs['data-qa'] ? `${$attrs['data-qa']}__dialog` : 'dt-popover'\"\n :aria-hidden=\"`${!isOpen}`\"\n :aria-labelledby=\"labelledBy\"\n :aria-label=\"ariaLabel\"\n :aria-modal=\"`${!modal}`\"\n :transition=\"transition\"\n :show=\"isOpen\"\n :class=\"['d-popover__dialog', { 'd-popover__dialog--modal': modal }, dialogClass]\"\n :style=\"{\n 'max-height': calculatedMaxHeight,\n 'max-width': maxWidth,\n }\"\n :tabindex=\"contentTabindex\"\n appear\n v-on=\"popoverListeners\"\n @mouseenter=\"onMouseEnterAnchor\"\n @mouseleave=\"onMouseLeaveAnchor\"\n >\n <popover-header-footer\n v-if=\"$slots.headerContent || showCloseButton\"\n ref=\"popover__header\"\n :class=\"POPOVER_HEADER_FOOTER_PADDING_CLASSES[padding]\"\n :content-class=\"headerClass\"\n type=\"header\"\n :show-close-button=\"showCloseButton\"\n :close-button-props=\"closeButtonProps\"\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=\"hasFooter()\"\n ref=\"popover__footer\"\n type=\"footer\"\n :class=\"POPOVER_HEADER_FOOTER_PADDING_CLASSES[padding]\"\n :content-class=\"footerClass\"\n >\n <template #content>\n <!-- @slot Slot for the footer content. -->\n <slot\n name=\"footerContent\"\n :close=\"closePopover\"\n />\n </template>\n </popover-header-footer>\n <sr-only-close-button\n v-if=\"showVisuallyHiddenClose\"\n :visually-hidden-close-label=\"visuallyHiddenCloseLabel\"\n @close=\"closePopover\"\n />\n </dt-lazy-show>\n </component>\n </div>\n</template>\n\n<script>\n/* eslint-disable max-lines */\nimport {\n POPOVER_APPEND_TO_VALUES,\n POPOVER_CONTENT_WIDTHS,\n POPOVER_HEADER_FOOTER_PADDING_CLASSES,\n POPOVER_INITIAL_FOCUS_STRINGS,\n POPOVER_PADDING_CLASSES,\n POPOVER_ROLES,\n POPOVER_STICKY_VALUES,\n} from './popover_constants';\nimport { getUniqueString, isOutOfViewPort, warnIfUnmounted, disableRootScrolling, enableRootScrolling } from '@/common/utils';\nimport { DtLazyShow } from '@/components/lazy_show';\nimport { Portal } from '@linusborg/vue-simple-portal';\nimport ModalMixin from '@/common/mixins/modal';\nimport { createTippyPopover, getPopperOptions } from './tippy_utils';\nimport PopoverHeaderFooter from './popover_header_footer.vue';\nimport SrOnlyCloseButtonMixin from '@/common/mixins/sr_only_close_button';\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 Portal,\n },\n\n mixins: [ModalMixin, SrOnlyCloseButtonMixin],\n\n props: {\n /**\n * Controls whether the popover is shown. Leaving this null will have the popover trigger on click by default.\n * If you set this value, the default trigger behavior will be disabled, and you can control it as you need.\n * Supports .sync modifier\n * @values null, true, false\n */\n open: {\n type: Boolean,\n default: null,\n },\n\n /**\n * Opens the popover on right click (context menu). If you set this value to `true`,\n * the default trigger behavior will be disabled.\n * @values true, false\n */\n openOnContext: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Element type (tag name) of the root element of the component.\n */\n elementType: {\n type: String,\n default: 'div',\n },\n\n /**\n * Named transition when the content display is toggled.\n * @see DtLazyShow\n */\n transition: {\n type: String,\n default: 'fade',\n },\n\n /**\n * ARIA role for the content of the popover. Defaults to \"dialog\".\n * <a class=\"d-link\" href=\"https://www.w3.org/TR/wai-aria/#aria-haspopup\" target=\"_blank\">aria-haspopup</a>\n */\n role: {\n type: String,\n default: 'dialog',\n validator: (role) => {\n return POPOVER_ROLES.includes(role);\n },\n },\n\n /**\n * ID of the element that serves as the label for the popover content.\n * Defaults to the \"anchor\" element; this exists to provide a different\n * ID of the label element if, for example, the anchor slot contains\n * other items that do not serve as a label. You should provide this\n * or ariaLabel, but not both.\n */\n ariaLabelledby: {\n type: String,\n default: null,\n },\n\n /**\n * Descriptive label for the popover content. You should provide this\n * or ariaLabelledby, but not both.\n */\n ariaLabel: {\n type: String,\n default: null,\n },\n\n /**\n * A set of props to be passed into the popover's header close button.\n * Requires an 'ariaLabel' property, when the header popover is visible\n */\n closeButtonProps: {\n type: Object,\n default: () => ({}),\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 * Tabindex value for the content. Passing null, no tabindex attribute will be set.\n */\n contentTabindex: {\n type: Number || null,\n default: -1,\n },\n\n /**\n * External anchor id to use in those cases the anchor can't be provided via the slot.\n * For instance, using the combobox's input as the anchor for the popover.\n */\n externalAnchor: {\n type: String,\n default: '',\n },\n\n /**\n * The id of the tooltip\n */\n id: {\n type: String,\n default () { return getUniqueString(); },\n },\n\n /**\n * Displaces the content box from its anchor element\n * by the specified number of pixels.\n * <a\n * class=\"d-link\"\n * href=\"https://atomiks.github.io/tippyjs/v6/all-props/#offset\"\n * target=\"_blank\"\n * >\n * Tippy.js docs\n * </a>\n */\n offset: {\n type: Array,\n default: () => [0, 4],\n },\n\n /**\n * Determines if the popover hides upon clicking the\n * anchor or outside the content box.\n * @values true, false\n */\n hideOnClick: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Determines modal state. If enabled popover has a modal overlay\n * preventing interaction with elements below it, but it is invisible.\n * @values true, false\n */\n modal: {\n type: Boolean,\n default: true,\n },\n\n /**\n * If the popover does not fit in the direction described by \"placement\",\n * it will attempt to change its direction to the \"fallbackPlacements\".\n * <a\n * class=\"d-link\"\n * href=\"https://popper.js.org/docs/v2/modifiers/flip/#fallbackplacements\"\n * target=\"_blank\"\n * >\n * Popper.js docs\n * </a>\n * */\n fallbackPlacements: {\n type: Array,\n default: () => {\n return ['auto'];\n },\n },\n\n /**\n * The direction the popover displays relative to the anchor.\n * <a\n * class=\"d-link\"\n * href=\"https://atomiks.github.io/tippyjs/v6/all-props/#placement\"\n * target=\"_blank\"\n * >\n * Tippy.js docs\n * </a>\n * @values top, top-start, top-end,\n * right, right-start, right-end,\n * left, left-start, left-end,\n * bottom, bottom-start, bottom-end,\n * auto, auto-start, auto-end\n */\n placement: {\n type: String,\n default: 'bottom-end',\n },\n\n /**\n * If set to false the dialog will display over top of the anchor when there is insufficient space.\n * If set to true it will never move from its position relative to the anchor and will clip instead.\n * <a\n * class=\"d-link\"\n * href=\"https://popper.js.org/docs/v2/modifiers/prevent-overflow/#tether\"\n * target=\"_blank\"\n * >\n * Popper.js docs\n * </a>\n * @values true, false\n */\n tether: {\n type: Boolean,\n default: true,\n },\n\n /**\n * If the popover sticks to the anchor. This is usually not needed, but can be needed\n * if the reference element's position is animating, or to automatically update the popover\n * position in those cases the DOM layout changes the reference element's position.\n * `true` enables it, `reference` only checks the \"reference\" rect for changes and `popper` only\n * checks the \"popper\" rect for changes.\n * <a\n * class=\"d-link\"\n * href=\"https://atomiks.github.io/tippyjs/v6/all-props/#sticky\"\n * target=\"_blank\"\n * >\n * Tippy.js docs\n * </a>\n * @values true, false, reference, popper\n */\n sticky: {\n type: [Boolean, String],\n default: false,\n validator: (sticky) => {\n return POPOVER_STICKY_VALUES.includes(sticky);\n },\n },\n\n /**\n * Determines maximum height for the popover before overflow.\n * Possible units rem|px|em\n */\n maxHeight: {\n type: String,\n default: '',\n },\n\n /**\n * Determines maximum width for the popover before overflow.\n * Possible units rem|px|%|em\n */\n maxWidth: {\n type: String,\n default: '',\n },\n\n /**\n * Determines visibility for close button\n * @values true, false\n */\n showCloseButton: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Additional class name for the header content wrapper element.\n */\n headerClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Additional class name for the footer content wrapper element.\n */\n footerClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Additional class name for the dialog element.\n */\n dialogClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * The element that is focused when the popover is opened. This can be an\n * HTMLElement within the popover, a string starting with '#' which will\n * find the element by ID. 'first' which will automatically focus\n * the first element, or 'dialog' which will focus the dialog window itself.\n * If the dialog is modal this prop cannot be 'none'.\n * @values none, dialog, first\n */\n initialFocusElement: {\n type: [String, HTMLElement],\n default: 'first',\n validator: initialFocusElement => {\n return POPOVER_INITIAL_FOCUS_STRINGS.includes(initialFocusElement) ||\n (initialFocusElement instanceof HTMLElement) ||\n initialFocusElement.startsWith('#');\n },\n },\n\n /**\n * If the popover should open pressing up or down arrow key on the anchor element.\n * This can be set when not passing open prop.\n * @values true, false\n */\n openWithArrowKeys: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Sets the element to which the popover is going to append to.\n * 'body' will append to the nearest body (supports shadow DOM).\n * 'root' will try append to the iFrame's parent body if it is contained in an iFrame\n * and has permissions to access it, else, it'd default to 'parent'.\n * @values 'body', 'parent', 'root', HTMLElement\n */\n appendTo: {\n type: [HTMLElement, String],\n default: 'body',\n validator: appendTo => {\n return POPOVER_APPEND_TO_VALUES.includes(appendTo) ||\n (appendTo instanceof HTMLElement);\n },\n },\n },\n\n emits: [\n /**\n * Emitted when popover is shown or hidden\n *\n * @event opened\n * @type {Boolean | Array}\n */\n 'opened',\n\n /**\n * Emitted to sync value with parent\n *\n * @event update:opened\n * @type {Boolean | Array}\n */\n 'update:open',\n\n /**\n * Emitted when the mouse enters the popover\n *\n * @event mouseenter-popover\n */\n 'mouseenter-popover',\n\n /**\n * Emitted when the mouse leaves the popover\n *\n * @event mouseleave-popover\n */\n 'mouseleave-popover',\n\n /**\n * Emitted when the mouse enters the popover anchor\n *\n * @event mouseenter-popover-anchor\n */\n 'mouseenter-popover-anchor',\n\n /**\n * Emitted when the mouse leaves the popover anchor\n *\n * @event mouseleave-popover-anchor\n */\n 'mouseleave-popover-anchor',\n ],\n\n data () {\n return {\n POPOVER_PADDING_CLASSES,\n POPOVER_HEADER_FOOTER_PADDING_CLASSES,\n intersectionObserver: null,\n isOutsideViewport: false,\n isOpen: false,\n anchorEl: null,\n popoverContentEl: null,\n };\n },\n\n computed: {\n popoverListeners () {\n return {\n ...this.$listeners,\n\n keydown: event => {\n this.onKeydown(event);\n this.$emit('keydown', event);\n },\n\n 'after-leave': event => {\n this.onLeaveTransitionComplete();\n },\n\n 'after-enter': event => {\n this.onEnterTransitionComplete();\n },\n };\n },\n\n calculatedMaxHeight () {\n if (this.isOutsideViewport && this.modal) {\n return `calc(100vh - var(--dt-space-300))`;\n }\n return this.maxHeight;\n },\n\n labelledBy () {\n // aria-labelledby should be set only if aria-labelledby is passed as a prop, or if\n // there is no aria-label and the labelledby should point to the anchor.\n return this.ariaLabelledby || (!this.ariaLabel && getUniqueString('DtPopover__anchor'));\n },\n },\n\n watch: {\n $props: {\n immediate: true,\n deep: true,\n handler () {\n this.validateProps();\n },\n },\n\n modal (modal) {\n this.tip?.setProps({\n zIndex: modal ? 650 : this.calculateAnchorZindex(),\n });\n },\n\n offset (offset) {\n this.tip?.setProps({\n offset,\n });\n },\n\n sticky (sticky) {\n this.tip?.setProps({\n sticky,\n });\n },\n\n fallbackPlacements () {\n this.tip?.setProps({\n popperOptions: this.popperOptions(),\n });\n },\n\n tether () {\n this.tip?.setProps({\n popperOptions: this.popperOptions(),\n });\n },\n\n placement (placement) {\n this.tip?.setProps({\n placement,\n });\n },\n\n open: {\n handler: function (open) {\n if (open !== null) {\n this.isOpen = open;\n }\n },\n\n immediate: true,\n },\n\n isOpen (isOpen, isPrev) {\n if (isOpen) {\n this.initTippyInstance();\n this.tip.show();\n } else if (!isOpen && isPrev !== isOpen) {\n this.removeEventListeners();\n this.tip.hide();\n }\n },\n },\n\n mounted () {\n warnIfUnmounted(this.$el, this.$options.name);\n\n const externalAnchorEl = this.externalAnchor\n ? this.$refs.anchor.getRootNode().querySelector(`#${this.externalAnchor}`)\n : null;\n this.anchorEl = externalAnchorEl ?? this.$refs.anchor.children[0];\n this.popoverContentEl = this.$refs.content?.$el;\n\n if (this.isOpen) {\n this.initTippyInstance();\n this.tip.show();\n }\n\n // rootMargin here must be greater than the margin of the height we are setting in calculatedMaxHeight which\n // currently is var(--dt-space-300) (4px). If not the intersectionObserver will continually trigger in an infinite\n // loop.\n // threshold 1.0 makes this trigger every time the dialog \"touches\" the edge of the viewport.\n this.intersectionObserver = new IntersectionObserver(this.hasIntersectedViewport);\n this.intersectionObserver.observe(this.popoverContentEl);\n },\n\n beforeDestroy () {\n this.tip?.destroy();\n this.intersectionObserver?.disconnect();\n this.removeReferences();\n this.removeEventListeners();\n },\n\n /******************\n * METHODS *\n ******************/\n methods: {\n hasIntersectedViewport (entries) {\n const dialog = entries?.[0]?.target;\n if (!dialog) return;\n const isOut = isOutOfViewPort(dialog);\n this.isOutsideViewport = isOut.bottom || isOut.top;\n },\n\n popperOptions () {\n return getPopperOptions({\n fallbackPlacements: this.fallbackPlacements,\n tether: this.tether,\n hasHideModifierEnabled: true,\n });\n },\n\n validateProps () {\n if (this.modal && this.initialFocusElement === 'none') {\n console.error('If the popover is modal you must set the ' +\n 'initialFocusElement prop. Possible values: \"dialog\", \"first\", HTMLElement');\n }\n },\n\n calculateAnchorZindex () {\n // if a modal is currently active render at modal-element z-index, otherwise at popover z-index\n if (this.$el.getRootNode()\n .querySelector('.d-modal[aria-hidden=\"false\"], .d-modal--transparent[aria-hidden=\"false\"]') ||\n // Special case because we don't have any dialtone drawer component yet. Render at 650 when\n // anchor of popover is within a drawer.\n this.anchorEl?.closest('.d-zi-drawer')) {\n return 650;\n } else {\n return 300;\n }\n },\n\n defaultToggleOpen (e) {\n if (this.openOnContext) { return; }\n\n // Only use default toggle behaviour if the user has not set the open prop.\n // Check that the anchor element specifically was clicked.\n this.open ?? (this.anchorEl?.contains(e.target) && !this.anchorEl?.disabled && this.toggleOpen());\n },\n\n async onContext (event) {\n if (!this.openOnContext) { return; }\n\n event.preventDefault();\n\n this.isOpen = true;\n await this.$nextTick();\n this.tip.setProps({\n placement: 'right-start',\n getReferenceClientRect: () => ({\n width: 0,\n height: 0,\n top: event.clientY,\n bottom: event.clientY,\n left: event.clientX,\n right: event.clientX,\n }),\n });\n },\n\n toggleOpen () {\n this.isOpen = !this.isOpen;\n },\n\n onArrowKeyPress (e) {\n if (this.open !== null) { return; }\n\n if (this.openWithArrowKeys && this.anchorEl?.contains(e.target)) {\n if (!this.isOpen) {\n this.isOpen = true;\n }\n }\n },\n\n addEventListeners () {\n window.addEventListener('dt-popover-close', this.closePopover);\n // align popover content width when contentWidth is 'anchor'\n if (this.contentWidth === 'anchor') {\n window.addEventListener('resize', this.onResize);\n }\n },\n\n removeEventListeners () {\n window.removeEventListener('dt-popover-close', this.closePopover);\n if (this.contentWidth === 'anchor') {\n window.removeEventListener('resize', this.onResize);\n }\n },\n\n closePopover () {\n this.isOpen = false;\n },\n\n /**\n * Prevents scrolling outside of the currently opened modal popover by:\n * - when anchor is not within another popover: setting the body to overflow: hidden\n * - when anchor is within another popover: set the popover dialog container to it's non-modal z-index\n * since it is no longer the active modal. This puts it underneath the overlay and prevents scrolling.\n */\n preventScrolling () {\n if (this.modal) {\n const element = this.anchorEl?.closest('body, .tippy-box');\n if (!element) return;\n if (element.tagName?.toLowerCase() === 'body') {\n disableRootScrolling(this.anchorEl.getRootNode().host);\n this.tip.setProps({ offset: this.offset });\n } else {\n element.classList.add('d-zi-popover');\n }\n }\n },\n\n /**\n * Resets the prevent scrolling properties set in preventScrolling() back to normal.\n */\n enableScrolling () {\n const element = this.anchorEl?.closest('body, .tippy-box');\n if (!element) return;\n if (element.tagName?.toLowerCase() === 'body') {\n enableRootScrolling(this.anchorEl.getRootNode().host);\n this.tip.setProps({ offset: this.offset });\n } else {\n element.classList.remove('d-zi-popover');\n }\n },\n\n removeReferences () {\n this.anchorEl = null;\n this.popoverContentEl = null;\n this.tip = null;\n },\n\n async onShow () {\n if (this.contentWidth === 'anchor') {\n await this.setPopoverContentAnchorWidth();\n }\n\n if (this.contentWidth === null) {\n this.popoverContentEl.style.width = 'auto';\n }\n\n this.addEventListeners();\n },\n\n async onLeaveTransitionComplete () {\n if (this.modal) {\n await this.focusFirstElement(this.$refs.anchor);\n // await next tick in case the user wants to change focus themselves.\n await this.$nextTick();\n this.enableScrolling();\n }\n this.tip?.unmount();\n this.$emit('opened', false);\n if (this.open !== null) {\n this.$emit('update:open', false);\n }\n },\n\n async onEnterTransitionComplete () {\n this.focusInitialElement();\n // await next tick in case the user wants to change focus themselves.\n await this.$nextTick();\n this.preventScrolling();\n this.$emit('opened', true, this.$refs.popover__content);\n if (this.open !== null) {\n this.$emit('update:open', true);\n }\n },\n\n focusInitialElement () {\n if (this.initialFocusElement === 'dialog') {\n this.$refs.content?.$el?.focus();\n }\n // find by ID\n if (this.initialFocusElement.startsWith('#')) {\n this.focusInitialElementById();\n }\n if (this.initialFocusElement === 'first') {\n this.focusFirstElementIfNeeded(this.$refs.popover__content);\n }\n if (this.initialFocusElement instanceof HTMLElement) {\n this.initialFocusElement.focus();\n }\n },\n\n focusInitialElementById () {\n const result = this.$refs.content?.$el?.querySelector(this.initialFocusElement);\n if (result) {\n result.focus();\n } else {\n console.warn('Could not find the element specified in dt-popover prop \"initialFocusElement\". ' +\n 'Defaulting to focusing the dialog.');\n }\n result ? result.focus() : this.$refs.content?.$el.focus();\n },\n\n onResize () {\n this.closePopover();\n },\n\n onClickOutside () {\n if (!this.hideOnClick) return;\n // If a popover is opened inside of this one, do not hide on click out\n const innerModals = this.popoverContentEl?.querySelector('.d-popover__anchor--opened');\n if (!innerModals) {\n this.closePopover();\n }\n },\n\n onKeydown (e) {\n if (e.key === 'Tab') {\n if (this.modal) {\n this.focusTrappedTabPress(e, this.popoverContentEl);\n }\n }\n if (e.key === 'Escape') {\n this.closePopover();\n }\n },\n\n async setPopoverContentAnchorWidth () {\n await this.$nextTick();\n this.popoverContentEl.style.width = `${this.anchorEl?.clientWidth}px`;\n },\n\n focusFirstElementIfNeeded (domEl) {\n const focusableElements = this._getFocusableElements(domEl, true);\n if (focusableElements.length !== 0) {\n this.focusFirstElement(domEl);\n } else if (this.showCloseButton) {\n this.$refs.popover__header?.focusCloseButton();\n } else {\n // if there are no focusable elements at all focus the dialog itself\n this.$refs.content?.$el.focus();\n }\n },\n\n /**\n * Return's the anchor ClientRect object relative to the window.\n * Refer to: https://atomiks.github.io/tippyjs/v6/all-props/#getreferenceclientrect for more information\n * @param error\n */\n getReferenceClientRect (error) {\n const anchorReferenceRect = this.anchorEl?.getBoundingClientRect();\n\n if (this.appendTo !== 'root' || error) return anchorReferenceRect;\n\n const anchorOwnerDocument = this.anchorEl?.ownerDocument;\n const anchorParentWindow = anchorOwnerDocument?.defaultView || anchorOwnerDocument?.parentWindow;\n const anchorIframe = anchorParentWindow?.frameElement;\n\n if (!anchorIframe) return anchorReferenceRect;\n\n const iframeReferenceRect = anchorIframe.getBoundingClientRect();\n\n return {\n width: anchorReferenceRect?.width,\n height: anchorReferenceRect?.height,\n top: iframeReferenceRect?.top + anchorReferenceRect?.top,\n left: iframeReferenceRect?.left + anchorReferenceRect?.left,\n right: iframeReferenceRect?.right + anchorReferenceRect?.right,\n bottom: iframeReferenceRect?.bottom + anchorReferenceRect?.bottom,\n };\n },\n\n initTippyInstance () {\n let internalAppendTo = null;\n let iFrameError = false;\n\n switch (this.appendTo) {\n case 'body':\n internalAppendTo = this.anchorEl?.getRootNode()?.querySelector('body');\n break;\n\n case 'root':\n // Try to attach the popover to root document, fallback to parent is fail\n try {\n internalAppendTo = window.parent.document.body;\n } catch (err) {\n console.error('Could not attach the popover to iframe parent window: ', err);\n internalAppendTo = 'parent';\n iFrameError = true;\n }\n break;\n\n default:\n internalAppendTo = this.appendTo;\n break;\n }\n\n this.tip = createTippyPopover(this.anchorEl, {\n popperOptions: this.popperOptions(),\n contentElement: this.popoverContentEl,\n placement: this.placement,\n offset: this.offset,\n sticky: this.sticky,\n appendTo: internalAppendTo,\n interactive: true,\n trigger: 'manual',\n getReferenceClientRect: () => this.getReferenceClientRect(iFrameError),\n // We have to manage hideOnClick functionality manually to handle\n // popover within popover situations.\n hideOnClick: false,\n zIndex: this.modal ? 650 : this.calculateAnchorZindex(),\n onClickOutside: this.onClickOutside,\n onShow: this.onShow,\n });\n },\n\n onMouseEnter () {\n this.$emit('mouseenter-popover');\n },\n\n onMouseLeave () {\n this.$emit('mouseleave-popover');\n },\n\n onMouseEnterAnchor () {\n this.$emit('mouseenter-popover-anchor');\n },\n\n onMouseLeaveAnchor () {\n this.$emit('mouseleave-popover-anchor');\n },\n\n hasFooter () {\n return this.$slots.footerContent || this.$scopedSlots.footerContent?.();\n },\n },\n};\n</script>\n"],"names":["_sfc_main","SrOnlyCloseButton","DtLazyShow","PopoverHeaderFooter","Portal","ModalMixin","SrOnlyCloseButtonMixin","role","POPOVER_ROLES","padding","POPOVER_PADDING_CLASSES","item","contentWidth","POPOVER_CONTENT_WIDTHS","getUniqueString","sticky","POPOVER_STICKY_VALUES","initialFocusElement","POPOVER_INITIAL_FOCUS_STRINGS","appendTo","POPOVER_APPEND_TO_VALUES","POPOVER_HEADER_FOOTER_PADDING_CLASSES","event","modal","_a","offset","placement","open","isOpen","isPrev","warnIfUnmounted","externalAnchorEl","_b","entries","dialog","isOut","isOutOfViewPort","getPopperOptions","element","disableRootScrolling","enableRootScrolling","result","_c","domEl","error","anchorReferenceRect","anchorOwnerDocument","anchorParentWindow","anchorIframe","iframeReferenceRect","internalAppendTo","iFrameError","err","createTippyPopover"],"mappings":";;;;;;;;;;AAiJA,MAAAA,IAAA;AAAA,EACA,MAAA;AAAA;AAAA;AAAA;AAAA,EAKA,YAAA;AAAA,IACA,mBAAAC;AAAA,IACA,YAAAC;AAAA,IACA,qBAAAC;AAAA,IACA,QAAAC;AAAA,EACA;AAAA,EAEA,QAAA,CAAAC,GAAAC,CAAA;AAAA,EAEA,OAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOA,MAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOA,eAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,aAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,YAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,MAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,MACA,WAAA,CAAAC,MACAC,EAAA,SAAAD,CAAA;AAAA,IAEA;AAAA;A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,gBAAA,KAAA;AAAA,QACA,WAAA,KAAA;AAAA,QACA,QAAA,KAAA;AAAA,QACA,QAAA,KAAA;AAAA,QACA,UAAAH;AAAA,QACA,aAAA;AAAA,QACA,SAAA;AAAA,QACA,wBAAA,MAAA,KAAA,uBAAAC,CAAA;AAAA;AAAA;AAAA,QAGA,aAAA;AAAA,QACA,QAAA,KAAA,QAAA,MAAA,KAAA,sBAAA;AAAA,QACA,gBAAA,KAAA;AAAA,QACA,QAAA,KAAA;AAAA,MACA,CAAA;AAAA,IACA;AAAA,IAEA,eAAA;AACA,WAAA,MAAA,oBAAA;AAAA,IACA;AAAA,IAEA,eAAA;AACA,WAAA,MAAA,oBAAA;AAAA,IACA;AAAA,IAEA,qBAAA;AACA,WAAA,MAAA,2BAAA;AAAA,IACA;AAAA,IAEA,qBAAA;AACA,WAAA,MAAA,2BAAA;AAAA,IACA;AAAA,IAEA,YAAA;;AACA,aAAA,KAAA,OAAA,mBAAAnB,KAAAR,IAAA,KAAA,cAAA,kBAAA,gBAAAQ,EAAA,KAAAR;AAAA,IACA;AAAA,EACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"popover.js","sources":["../../../components/popover/popover.vue"],"sourcesContent":["<!-- eslint-disable vuejs-accessibility/mouse-events-have-key-events -->\n<template>\n <div>\n <portal v-if=\"modal && isOpen\">\n <div\n class=\"d-modal--transparent\"\n @click.prevent.stop\n />\n </portal>\n <component\n :is=\"elementType\"\n ref=\"popover\"\n :class=\"['d-popover', { 'd-popover__anchor--opened': isOpen }]\"\n data-qa=\"dt-popover-container\"\n v-on=\"$listeners\"\n >\n <!-- eslint-disable-next-line vuejs-accessibility/no-static-element-interactions -->\n <div\n :id=\"!ariaLabelledby && labelledBy\"\n ref=\"anchor\"\n :data-qa=\"$attrs['data-qa'] ? `${$attrs['data-qa']}-anchor` : 'dt-popover-anchor'\"\n :tabindex=\"openOnContext ? 0 : undefined\"\n @click.capture=\"defaultToggleOpen\"\n @contextmenu=\"onContext\"\n @keydown.up.prevent=\"onArrowKeyPress\"\n @keydown.down.prevent=\"onArrowKeyPress\"\n @keydown.escape.capture=\"closePopover\"\n @mouseenter=\"onMouseEnter\"\n @mouseleave=\"onMouseLeave\"\n >\n <!-- @slot Anchor element that activates the popover. Usually a button. -->\n <slot\n name=\"anchor\"\n :attrs=\"{\n 'aria-expanded': isOpen.toString(),\n 'aria-controls': id,\n 'aria-haspopup': role,\n }\"\n />\n </div>\n <dt-lazy-show\n :id=\"id\"\n ref=\"content\"\n :role=\"role\"\n :data-qa=\"$attrs['data-qa'] ? `${$attrs['data-qa']}__dialog` : 'dt-popover'\"\n :aria-hidden=\"`${!isOpen}`\"\n :aria-labelledby=\"labelledBy\"\n :aria-label=\"ariaLabel\"\n :aria-modal=\"`${!modal}`\"\n :transition=\"transition\"\n :show=\"isOpen\"\n :class=\"['d-popover__dialog', { 'd-popover__dialog--modal': modal }, dialogClass]\"\n :style=\"{\n 'max-height': calculatedMaxHeight,\n 'max-width': maxWidth,\n }\"\n :tabindex=\"contentTabindex\"\n appear\n v-on=\"popoverListeners\"\n @mouseenter=\"onMouseEnterAnchor\"\n @mouseleave=\"onMouseLeaveAnchor\"\n >\n <popover-header-footer\n v-if=\"$slots.headerContent || showCloseButton\"\n ref=\"popover__header\"\n :class=\"POPOVER_HEADER_FOOTER_PADDING_CLASSES[padding]\"\n :content-class=\"headerClass\"\n type=\"header\"\n :show-close-button=\"showCloseButton\"\n :close-button-props=\"closeButtonProps\"\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=\"hasFooter()\"\n ref=\"popover__footer\"\n type=\"footer\"\n :class=\"POPOVER_HEADER_FOOTER_PADDING_CLASSES[padding]\"\n :content-class=\"footerClass\"\n >\n <template #content>\n <!-- @slot Slot for the footer content. -->\n <slot\n name=\"footerContent\"\n :close=\"closePopover\"\n />\n </template>\n </popover-header-footer>\n <sr-only-close-button\n v-if=\"showVisuallyHiddenClose\"\n :visually-hidden-close-label=\"visuallyHiddenCloseLabel\"\n @close=\"closePopover\"\n />\n </dt-lazy-show>\n </component>\n </div>\n</template>\n\n<script>\n/* eslint-disable max-lines */\nimport {\n POPOVER_APPEND_TO_VALUES,\n POPOVER_CONTENT_WIDTHS,\n POPOVER_HEADER_FOOTER_PADDING_CLASSES,\n POPOVER_INITIAL_FOCUS_STRINGS,\n POPOVER_PADDING_CLASSES,\n POPOVER_ROLES,\n POPOVER_STICKY_VALUES,\n} from './popover_constants';\nimport { getUniqueString, isOutOfViewPort, warnIfUnmounted, disableRootScrolling, enableRootScrolling } from '@/common/utils';\nimport { DtLazyShow } from '@/components/lazy_show';\nimport { Portal } from '@linusborg/vue-simple-portal';\nimport ModalMixin from '@/common/mixins/modal';\nimport { createTippyPopover, getPopperOptions } from './tippy_utils';\nimport PopoverHeaderFooter from './popover_header_footer.vue';\nimport SrOnlyCloseButtonMixin from '@/common/mixins/sr_only_close_button';\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 Portal,\n },\n\n mixins: [ModalMixin, SrOnlyCloseButtonMixin],\n\n props: {\n /**\n * Controls whether the popover is shown. Leaving this null will have the popover trigger on click by default.\n * If you set this value, the default trigger behavior will be disabled, and you can control it as you need.\n * Supports .sync modifier\n * @values null, true, false\n */\n open: {\n type: Boolean,\n default: null,\n },\n\n /**\n * Opens the popover on right click (context menu). If you set this value to `true`,\n * the default trigger behavior will be disabled.\n * @values true, false\n */\n openOnContext: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Element type (tag name) of the root element of the component.\n */\n elementType: {\n type: String,\n default: 'div',\n },\n\n /**\n * Named transition when the content display is toggled.\n * @see DtLazyShow\n */\n transition: {\n type: String,\n default: 'fade',\n },\n\n /**\n * ARIA role for the content of the popover. Defaults to \"dialog\".\n * <a class=\"d-link\" href=\"https://www.w3.org/TR/wai-aria/#aria-haspopup\" target=\"_blank\">aria-haspopup</a>\n */\n role: {\n type: String,\n default: 'dialog',\n validator: (role) => {\n return POPOVER_ROLES.includes(role);\n },\n },\n\n /**\n * ID of the element that serves as the label for the popover content.\n * Defaults to the \"anchor\" element; this exists to provide a different\n * ID of the label element if, for example, the anchor slot contains\n * other items that do not serve as a label. You should provide this\n * or ariaLabel, but not both.\n */\n ariaLabelledby: {\n type: String,\n default: null,\n },\n\n /**\n * Descriptive label for the popover content. You should provide this\n * or ariaLabelledby, but not both.\n */\n ariaLabel: {\n type: String,\n default: null,\n },\n\n /**\n * A set of props to be passed into the popover's header close button.\n * Requires an 'ariaLabel' property, when the header popover is visible\n */\n closeButtonProps: {\n type: Object,\n default: () => ({}),\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 * Tabindex value for the content. Passing null, no tabindex attribute will be set.\n */\n contentTabindex: {\n type: Number || null,\n default: -1,\n },\n\n /**\n * External anchor id to use in those cases the anchor can't be provided via the slot.\n * For instance, using the combobox's input as the anchor for the popover.\n */\n externalAnchor: {\n type: String,\n default: '',\n },\n\n /**\n * The id of the tooltip\n */\n id: {\n type: String,\n default () { return getUniqueString(); },\n },\n\n /**\n * Displaces the content box from its anchor element\n * by the specified number of pixels.\n * <a\n * class=\"d-link\"\n * href=\"https://atomiks.github.io/tippyjs/v6/all-props/#offset\"\n * target=\"_blank\"\n * >\n * Tippy.js docs\n * </a>\n */\n offset: {\n type: Array,\n default: () => [0, 4],\n },\n\n /**\n * Determines if the popover hides upon clicking the\n * anchor or outside the content box.\n * @values true, false\n */\n hideOnClick: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Determines modal state. If enabled popover has a modal overlay\n * preventing interaction with elements below it, but it is invisible.\n * @values true, false\n */\n modal: {\n type: Boolean,\n default: true,\n },\n\n /**\n * If the popover does not fit in the direction described by \"placement\",\n * it will attempt to change its direction to the \"fallbackPlacements\".\n * <a\n * class=\"d-link\"\n * href=\"https://popper.js.org/docs/v2/modifiers/flip/#fallbackplacements\"\n * target=\"_blank\"\n * >\n * Popper.js docs\n * </a>\n * */\n fallbackPlacements: {\n type: Array,\n default: () => {\n return ['auto'];\n },\n },\n\n /**\n * The direction the popover displays relative to the anchor.\n * <a\n * class=\"d-link\"\n * href=\"https://atomiks.github.io/tippyjs/v6/all-props/#placement\"\n * target=\"_blank\"\n * >\n * Tippy.js docs\n * </a>\n * @values top, top-start, top-end,\n * right, right-start, right-end,\n * left, left-start, left-end,\n * bottom, bottom-start, bottom-end,\n * auto, auto-start, auto-end\n */\n placement: {\n type: String,\n default: 'bottom-end',\n },\n\n /**\n * If set to false the dialog will display over top of the anchor when there is insufficient space.\n * If set to true it will never move from its position relative to the anchor and will clip instead.\n * <a\n * class=\"d-link\"\n * href=\"https://popper.js.org/docs/v2/modifiers/prevent-overflow/#tether\"\n * target=\"_blank\"\n * >\n * Popper.js docs\n * </a>\n * @values true, false\n */\n tether: {\n type: Boolean,\n default: true,\n },\n\n /**\n * If the popover sticks to the anchor. This is usually not needed, but can be needed\n * if the reference element's position is animating, or to automatically update the popover\n * position in those cases the DOM layout changes the reference element's position.\n * `true` enables it, `reference` only checks the \"reference\" rect for changes and `popper` only\n * checks the \"popper\" rect for changes.\n * <a\n * class=\"d-link\"\n * href=\"https://atomiks.github.io/tippyjs/v6/all-props/#sticky\"\n * target=\"_blank\"\n * >\n * Tippy.js docs\n * </a>\n * @values true, false, reference, popper\n */\n sticky: {\n type: [Boolean, String],\n default: false,\n validator: (sticky) => {\n return POPOVER_STICKY_VALUES.includes(sticky);\n },\n },\n\n /**\n * Determines maximum height for the popover before overflow.\n * Possible units rem|px|em\n */\n maxHeight: {\n type: String,\n default: '',\n },\n\n /**\n * Determines maximum width for the popover before overflow.\n * Possible units rem|px|%|em\n */\n maxWidth: {\n type: String,\n default: '',\n },\n\n /**\n * Determines visibility for close button\n * @values true, false\n */\n showCloseButton: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Additional class name for the header content wrapper element.\n */\n headerClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Additional class name for the footer content wrapper element.\n */\n footerClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Additional class name for the dialog element.\n */\n dialogClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * The element that is focused when the popover is opened. This can be an\n * HTMLElement within the popover, a string starting with '#' which will\n * find the element by ID. 'first' which will automatically focus\n * the first element, or 'dialog' which will focus the dialog window itself.\n * If the dialog is modal this prop cannot be 'none'.\n * @values none, dialog, first\n */\n initialFocusElement: {\n type: [String, HTMLElement],\n default: 'first',\n validator: initialFocusElement => {\n return POPOVER_INITIAL_FOCUS_STRINGS.includes(initialFocusElement) ||\n (initialFocusElement instanceof HTMLElement) ||\n initialFocusElement.startsWith('#');\n },\n },\n\n /**\n * If the popover should open pressing up or down arrow key on the anchor element.\n * This can be set when not passing open prop.\n * @values true, false\n */\n openWithArrowKeys: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Sets the element to which the popover is going to append to.\n * 'body' will append to the nearest body (supports shadow DOM).\n * 'root' will try append to the iFrame's parent body if it is contained in an iFrame\n * and has permissions to access it, else, it'd default to 'parent'.\n * @values 'body', 'parent', 'root', HTMLElement\n */\n appendTo: {\n type: [HTMLElement, String],\n default: 'body',\n validator: appendTo => {\n return POPOVER_APPEND_TO_VALUES.includes(appendTo) ||\n (appendTo instanceof HTMLElement);\n },\n },\n },\n\n emits: [\n /**\n * Emitted when popover is shown or hidden\n *\n * @event opened\n * @type {Boolean | Array}\n */\n 'opened',\n\n /**\n * Emitted to sync value with parent\n *\n * @event update:opened\n * @type {Boolean | Array}\n */\n 'update:open',\n\n /**\n * Emitted when the mouse enters the popover\n *\n * @event mouseenter-popover\n */\n 'mouseenter-popover',\n\n /**\n * Emitted when the mouse leaves the popover\n *\n * @event mouseleave-popover\n */\n 'mouseleave-popover',\n\n /**\n * Emitted when the mouse enters the popover anchor\n *\n * @event mouseenter-popover-anchor\n */\n 'mouseenter-popover-anchor',\n\n /**\n * Emitted when the mouse leaves the popover anchor\n *\n * @event mouseleave-popover-anchor\n */\n 'mouseleave-popover-anchor',\n ],\n\n data () {\n return {\n POPOVER_PADDING_CLASSES,\n POPOVER_HEADER_FOOTER_PADDING_CLASSES,\n intersectionObserver: null,\n isOutsideViewport: false,\n isOpen: false,\n anchorEl: null,\n popoverContentEl: null,\n };\n },\n\n computed: {\n popoverListeners () {\n return {\n ...this.$listeners,\n\n keydown: event => {\n this.onKeydown(event);\n this.$emit('keydown', event);\n },\n\n 'after-leave': event => {\n this.onLeaveTransitionComplete();\n },\n\n 'after-enter': event => {\n this.onEnterTransitionComplete();\n },\n };\n },\n\n calculatedMaxHeight () {\n if (this.isOutsideViewport && this.modal) {\n return `calc(100vh - var(--dt-space-300))`;\n }\n return this.maxHeight;\n },\n\n labelledBy () {\n // aria-labelledby should be set only if aria-labelledby is passed as a prop, or if\n // there is no aria-label and the labelledby should point to the anchor.\n return this.ariaLabelledby || (!this.ariaLabel && getUniqueString('DtPopover__anchor'));\n },\n },\n\n watch: {\n $props: {\n immediate: true,\n deep: true,\n handler () {\n this.validateProps();\n },\n },\n\n modal (modal) {\n this.tip?.setProps({\n zIndex: modal ? 650 : this.calculateAnchorZindex(),\n });\n },\n\n offset (offset) {\n this.tip?.setProps({\n offset,\n });\n },\n\n sticky (sticky) {\n this.tip?.setProps({\n sticky,\n });\n },\n\n fallbackPlacements () {\n this.tip?.setProps({\n popperOptions: this.popperOptions(),\n });\n },\n\n tether () {\n this.tip?.setProps({\n popperOptions: this.popperOptions(),\n });\n },\n\n placement (placement) {\n this.tip?.setProps({\n placement,\n });\n },\n\n open: {\n handler: function (open) {\n if (open !== null) {\n this.isOpen = open;\n }\n },\n\n immediate: true,\n },\n\n isOpen (isOpen, isPrev) {\n if (isOpen) {\n this.initTippyInstance();\n this.tip.show();\n } else if (!isOpen && isPrev !== isOpen) {\n this.removeEventListeners();\n this.tip.hide();\n }\n },\n },\n\n mounted () {\n warnIfUnmounted(this.$el, this.$options.name);\n\n const externalAnchorEl = this.externalAnchor\n ? this.$refs.anchor.getRootNode().querySelector(`#${this.externalAnchor}`)\n : null;\n this.anchorEl = externalAnchorEl ?? this.$refs.anchor.children[0];\n this.popoverContentEl = this.$refs.content?.$el;\n\n if (this.isOpen) {\n this.initTippyInstance();\n this.tip.show();\n }\n\n // rootMargin here must be greater than the margin of the height we are setting in calculatedMaxHeight which\n // currently is var(--dt-space-300) (4px). If not the intersectionObserver will continually trigger in an infinite\n // loop.\n // threshold 1.0 makes this trigger every time the dialog \"touches\" the edge of the viewport.\n this.intersectionObserver = new IntersectionObserver(this.hasIntersectedViewport);\n this.intersectionObserver.observe(this.popoverContentEl);\n },\n\n beforeDestroy () {\n this.tip?.destroy();\n this.intersectionObserver?.disconnect();\n this.removeReferences();\n this.removeEventListeners();\n },\n\n /******************\n * METHODS *\n ******************/\n methods: {\n hasIntersectedViewport (entries) {\n const dialog = entries?.[0]?.target;\n if (!dialog) return;\n const isOut = isOutOfViewPort(dialog);\n this.isOutsideViewport = isOut.bottom || isOut.top;\n },\n\n popperOptions () {\n return getPopperOptions({\n fallbackPlacements: this.fallbackPlacements,\n tether: this.tether,\n hasHideModifierEnabled: true,\n });\n },\n\n validateProps () {\n if (this.modal && this.initialFocusElement === 'none') {\n console.error('If the popover is modal you must set the ' +\n 'initialFocusElement prop. Possible values: \"dialog\", \"first\", HTMLElement');\n }\n },\n\n calculateAnchorZindex () {\n // if a modal is currently active render at modal-element z-index, otherwise at popover z-index\n if (this.$el.getRootNode()\n .querySelector('.d-modal[aria-hidden=\"false\"], .d-modal--transparent[aria-hidden=\"false\"]') ||\n // Special case because we don't have any dialtone drawer component yet. Render at 650 when\n // anchor of popover is within a drawer.\n this.anchorEl?.closest('.d-zi-drawer')) {\n return 650;\n } else {\n return 300;\n }\n },\n\n defaultToggleOpen (e) {\n if (this.openOnContext) { return; }\n\n // Only use default toggle behaviour if the user has not set the open prop.\n // Check that the anchor element specifically was clicked.\n this.open ?? (this.anchorEl?.contains(e.target) && !this.anchorEl?.disabled && this.toggleOpen());\n },\n\n async onContext (event) {\n if (!this.openOnContext) { return; }\n\n event.preventDefault();\n\n this.isOpen = true;\n await this.$nextTick();\n this.tip.setProps({\n placement: 'right-start',\n getReferenceClientRect: () => ({\n width: 0,\n height: 0,\n top: event.clientY,\n bottom: event.clientY,\n left: event.clientX,\n right: event.clientX,\n }),\n });\n },\n\n toggleOpen () {\n this.isOpen = !this.isOpen;\n },\n\n onArrowKeyPress (e) {\n if (this.open !== null) { return; }\n\n if (this.openWithArrowKeys && this.anchorEl?.contains(e.target)) {\n if (!this.isOpen) {\n this.isOpen = true;\n }\n }\n },\n\n addEventListeners () {\n window.addEventListener('dt-popover-close', this.closePopover);\n // align popover content width when contentWidth is 'anchor'\n if (this.contentWidth === 'anchor') {\n window.addEventListener('resize', this.onResize);\n }\n },\n\n removeEventListeners () {\n window.removeEventListener('dt-popover-close', this.closePopover);\n if (this.contentWidth === 'anchor') {\n window.removeEventListener('resize', this.onResize);\n }\n },\n\n closePopover () {\n this.isOpen = false;\n },\n\n /**\n * Prevents scrolling outside of the currently opened modal popover by:\n * - when anchor is not within another popover: setting the body to overflow: hidden\n * - when anchor is within another popover: set the popover dialog container to it's non-modal z-index\n * since it is no longer the active modal. This puts it underneath the overlay and prevents scrolling.\n */\n preventScrolling () {\n if (this.modal) {\n const element = this.anchorEl?.closest('body, .tippy-box');\n if (!element) return;\n if (element.tagName?.toLowerCase() === 'body') {\n disableRootScrolling(this.anchorEl.getRootNode().host);\n this.tip.setProps({ offset: this.offset });\n } else {\n element.classList.add('d-zi-popover');\n }\n }\n },\n\n /**\n * Resets the prevent scrolling properties set in preventScrolling() back to normal.\n */\n enableScrolling () {\n const element = this.anchorEl?.closest('body, .tippy-box');\n if (!element) return;\n if (element.tagName?.toLowerCase() === 'body') {\n enableRootScrolling(this.anchorEl.getRootNode().host);\n this.tip.setProps({ offset: this.offset });\n } else {\n element.classList.remove('d-zi-popover');\n }\n },\n\n removeReferences () {\n this.anchorEl = null;\n this.popoverContentEl = null;\n this.tip = null;\n },\n\n async onShow () {\n if (this.contentWidth === 'anchor') {\n await this.setPopoverContentAnchorWidth();\n }\n\n if (this.contentWidth === null) {\n this.popoverContentEl.style.width = 'auto';\n }\n\n this.addEventListeners();\n },\n\n async onLeaveTransitionComplete () {\n if (this.modal) {\n await this.focusFirstElement(this.$refs.anchor);\n // await next tick in case the user wants to change focus themselves.\n await this.$nextTick();\n this.enableScrolling();\n }\n this.tip?.unmount();\n this.$emit('opened', false);\n if (this.open !== null) {\n this.$emit('update:open', false);\n }\n },\n\n async onEnterTransitionComplete () {\n this.focusInitialElement();\n // await next tick in case the user wants to change focus themselves.\n await this.$nextTick();\n this.preventScrolling();\n this.$emit('opened', true, this.$refs.popover__content);\n if (this.open !== null) {\n this.$emit('update:open', true);\n }\n },\n\n focusInitialElement () {\n if (this.initialFocusElement === 'dialog') {\n this.$refs.content?.$el?.focus();\n }\n // find by ID\n if (this.initialFocusElement.startsWith('#')) {\n this.focusInitialElementById();\n }\n if (this.initialFocusElement === 'first') {\n this.focusFirstElementIfNeeded(this.$refs.popover__content);\n }\n if (this.initialFocusElement instanceof HTMLElement) {\n this.initialFocusElement.focus();\n }\n },\n\n focusInitialElementById () {\n const result = this.$refs.content?.$el?.querySelector(this.initialFocusElement);\n if (result) {\n result.focus();\n } else {\n console.warn('Could not find the element specified in dt-popover prop \"initialFocusElement\". ' +\n 'Defaulting to focusing the dialog.');\n }\n result ? result.focus() : this.$refs.content?.$el.focus();\n },\n\n onResize () {\n this.closePopover();\n },\n\n onClickOutside () {\n if (!this.hideOnClick) return;\n // If a popover is opened inside of this one, do not hide on click out\n const innerModals = this.popoverContentEl?.querySelector('.d-popover__anchor--opened');\n if (!innerModals) {\n this.closePopover();\n }\n },\n\n onKeydown (e) {\n if (e.key === 'Tab') {\n if (this.modal) {\n this.focusTrappedTabPress(e, this.popoverContentEl);\n }\n }\n if (e.key === 'Escape') {\n this.closePopover();\n }\n },\n\n async setPopoverContentAnchorWidth () {\n await this.$nextTick();\n this.popoverContentEl.style.width = `${this.anchorEl?.clientWidth}px`;\n },\n\n focusFirstElementIfNeeded (domEl) {\n const focusableElements = this._getFocusableElements(domEl, true);\n if (focusableElements.length !== 0) {\n this.focusFirstElement(domEl);\n } else if (this.showCloseButton) {\n this.$refs.popover__header?.focusCloseButton();\n } else {\n // if there are no focusable elements at all focus the dialog itself\n this.$refs.content?.$el.focus();\n }\n },\n\n /**\n * Return's the anchor ClientRect object relative to the window.\n * Refer to: https://atomiks.github.io/tippyjs/v6/all-props/#getreferenceclientrect for more information\n * @param error\n */\n getReferenceClientRect (error) {\n const anchorReferenceRect = this.anchorEl?.getBoundingClientRect();\n\n if (this.appendTo !== 'root' || error) return anchorReferenceRect;\n\n const anchorOwnerDocument = this.anchorEl?.ownerDocument;\n const anchorParentWindow = anchorOwnerDocument?.defaultView || anchorOwnerDocument?.parentWindow;\n const anchorIframe = anchorParentWindow?.frameElement;\n\n if (!anchorIframe) return anchorReferenceRect;\n\n const iframeReferenceRect = anchorIframe.getBoundingClientRect();\n\n return {\n width: anchorReferenceRect?.width,\n height: anchorReferenceRect?.height,\n top: iframeReferenceRect?.top + anchorReferenceRect?.top,\n left: iframeReferenceRect?.left + anchorReferenceRect?.left,\n right: iframeReferenceRect?.right + anchorReferenceRect?.right,\n bottom: iframeReferenceRect?.bottom + anchorReferenceRect?.bottom,\n };\n },\n\n initTippyInstance () {\n let internalAppendTo = null;\n let iFrameError = false;\n\n switch (this.appendTo) {\n case 'body':\n internalAppendTo = this.anchorEl?.getRootNode()?.querySelector('body');\n break;\n\n case 'root':\n // Try to attach the popover to root document, fallback to parent is fail\n try {\n internalAppendTo = window.parent.document.body;\n } catch (err) {\n console.error('Could not attach the popover to iframe parent window: ', err);\n internalAppendTo = 'parent';\n iFrameError = true;\n }\n break;\n\n default:\n internalAppendTo = this.appendTo;\n break;\n }\n\n this.tip = createTippyPopover(this.anchorEl, {\n popperOptions: this.popperOptions(),\n contentElement: this.popoverContentEl,\n placement: this.placement,\n offset: this.offset,\n sticky: this.sticky,\n appendTo: internalAppendTo,\n interactive: true,\n trigger: 'manual',\n getReferenceClientRect: () => this.getReferenceClientRect(iFrameError),\n // We have to manage hideOnClick functionality manually to handle\n // popover within popover situations.\n hideOnClick: false,\n zIndex: this.modal ? 650 : this.calculateAnchorZindex(),\n onClickOutside: this.onClickOutside,\n onShow: this.onShow,\n });\n },\n\n onMouseEnter () {\n this.$emit('mouseenter-popover');\n },\n\n onMouseLeave () {\n this.$emit('mouseleave-popover');\n },\n\n onMouseEnterAnchor () {\n this.$emit('mouseenter-popover-anchor');\n },\n\n onMouseLeaveAnchor () {\n this.$emit('mouseleave-popover-anchor');\n },\n\n hasFooter () {\n return this.$slots.footerContent || this.$scopedSlots.footerContent?.();\n },\n },\n};\n</script>\n"],"names":["_sfc_main","SrOnlyCloseButton","DtLazyShow","PopoverHeaderFooter","Portal","ModalMixin","SrOnlyCloseButtonMixin","role","POPOVER_ROLES","padding","POPOVER_PADDING_CLASSES","item","contentWidth","POPOVER_CONTENT_WIDTHS","getUniqueString","sticky","POPOVER_STICKY_VALUES","initialFocusElement","POPOVER_INITIAL_FOCUS_STRINGS","appendTo","POPOVER_APPEND_TO_VALUES","POPOVER_HEADER_FOOTER_PADDING_CLASSES","event","modal","_a","offset","placement","open","isOpen","isPrev","warnIfUnmounted","externalAnchorEl","_b","entries","dialog","isOut","isOutOfViewPort","getPopperOptions","element","disableRootScrolling","enableRootScrolling","result","_c","domEl","error","anchorReferenceRect","anchorOwnerDocument","anchorParentWindow","anchorIframe","iframeReferenceRect","internalAppendTo","iFrameError","err","createTippyPopover"],"mappings":";;;;;;;;;;AAgJA,MAAAA,IAAA;AAAA,EACA,MAAA;AAAA;AAAA;AAAA;AAAA,EAKA,YAAA;AAAA,IACA,mBAAAC;AAAA,IACA,YAAAC;AAAA,IACA,qBAAAC;AAAA,IACA,QAAAC;AAAA,EACA;AAAA,EAEA,QAAA,CAAAC,GAAAC,CAAA;AAAA,EAEA,OAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOA,MAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOA,eAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,aAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,YAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,MAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,MACA,WAAA,CAA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AA,UAAA;AAAA,QACA,eAAA,KAAA,cAAA;AAAA,QACA,gBAAA,KAAA;AAAA,QACA,WAAA,KAAA;AAAA,QACA,QAAA,KAAA;AAAA,QACA,QAAA,KAAA;AAAA,QACA,UAAAH;AAAA,QACA,aAAA;AAAA,QACA,SAAA;AAAA,QACA,wBAAA,MAAA,KAAA,uBAAAC,CAAA;AAAA;AAAA;AAAA,QAGA,aAAA;AAAA,QACA,QAAA,KAAA,QAAA,MAAA,KAAA,sBAAA;AAAA,QACA,gBAAA,KAAA;AAAA,QACA,QAAA,KAAA;AAAA,MACA,CAAA;AAAA,IACA;AAAA,IAEA,eAAA;AACA,WAAA,MAAA,oBAAA;AAAA,IACA;AAAA,IAEA,eAAA;AACA,WAAA,MAAA,oBAAA;AAAA,IACA;AAAA,IAEA,qBAAA;AACA,WAAA,MAAA,2BAAA;AAAA,IACA;AAAA,IAEA,qBAAA;AACA,WAAA,MAAA,2BAAA;AAAA,IACA;AAAA,IAEA,YAAA;;AACA,aAAA,KAAA,OAAA,mBAAAnB,KAAAR,IAAA,KAAA,cAAA,kBAAA,gBAAAQ,EAAA,KAAAR;AAAA,IACA;AAAA,EACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("./presence-constants.cjs"),t=require("../../_plugin-vue2_normalizer-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("./presence-constants.cjs"),t=require("../../_plugin-vue2_normalizer-e_CkxkSV.cjs"),a={name:"DtPresence",props:{presence:{type:String,default:n.PRESENCE_STATES.ACTIVE,validator:s=>n.PRESENCE_STATES_LIST.includes(s)},srText:{type:String,default:null}}};var c=function(){var e=this,r=e._self._c;return r("div",{staticClass:"d-presence",attrs:{"data-qa":"dt-presence",role:"status","aria-live":e.$attrs.ariaLive||"off"}},[e.srText?r("span",{staticClass:"sr-only",attrs:{"data-qa":"dt-presence-sr-text"}},[e._v(e._s(e.srText)+" ")]):e._e(),r("div",{staticClass:"d-presence__inner",class:{"d-presence__inner--active":e.presence==="active","d-presence__inner--away":e.presence==="away","d-presence__inner--busy":e.presence==="busy","d-presence__inner--offline":e.presence==="offline"}})])},_=[],i=t.n(a,c,_);const l=i.exports;exports.default=l;
|
|
2
2
|
//# sourceMappingURL=presence.cjs.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PRESENCE_STATES as n, PRESENCE_STATES_LIST as t } from "./presence-constants.js";
|
|
2
|
-
import { n as a } from "../../_plugin-vue2_normalizer-
|
|
2
|
+
import { n as a } from "../../_plugin-vue2_normalizer-DSLOjnn3.js";
|
|
3
3
|
const c = {
|
|
4
4
|
name: "DtPresence",
|
|
5
5
|
props: {
|
|
@@ -35,13 +35,10 @@ var _ = function() {
|
|
|
35
35
|
}, i = [], p = /* @__PURE__ */ a(
|
|
36
36
|
c,
|
|
37
37
|
_,
|
|
38
|
-
i
|
|
39
|
-
!1,
|
|
40
|
-
null,
|
|
41
|
-
null
|
|
38
|
+
i
|
|
42
39
|
);
|
|
43
|
-
const
|
|
40
|
+
const l = p.exports;
|
|
44
41
|
export {
|
|
45
|
-
|
|
42
|
+
l as default
|
|
46
43
|
};
|
|
47
44
|
//# sourceMappingURL=presence.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"presence.js","sources":["../../../components/presence/presence.vue"],"sourcesContent":["<template>\n <div\n class=\"d-presence\"\n data-qa=\"dt-presence\"\n role=\"status\"\n :aria-live=\"$attrs.ariaLive || 'off'\"\n >\n <span\n v-if=\"srText\"\n data-qa=\"dt-presence-sr-text\"\n class=\"sr-only\"\n >{{ srText }} </span>\n <div\n class=\"d-presence__inner\"\n :class=\"{\n 'd-presence__inner--active': presence === 'active',\n 'd-presence__inner--away': presence === 'away',\n 'd-presence__inner--busy': presence === 'busy',\n 'd-presence__inner--offline': presence === 'offline',\n }\"\n />\n </div>\n</template>\n\n<script>\nimport { PRESENCE_STATES, PRESENCE_STATES_LIST } from './presence_constants';\n/**\n * Presence is a user status visual indicator element.\n * @see https://dialtone.dialpad.com/components/presence.html\n */\nexport default {\n name: 'DtPresence',\n props: {\n\n /**\n * Determines the color of the inner presence circle, indicating status.\n * Accepts one of 4 values: 'busy', 'away', 'active', 'offline'\n * @values busy, away, active, offline\n */\n presence: {\n type: String,\n default: PRESENCE_STATES.ACTIVE,\n validator: (role) => {\n return PRESENCE_STATES_LIST.includes(role);\n },\n },\n\n /**\n * Since Presence is a visual element, we need SRs to read out any state changes\n * that occur.\n * Text entered here will be read by assistive technology. If null this component will be ignored by AT.\n */\n srText: {\n type: String,\n default: null,\n },\n },\n};\n</script>\n"],"names":["_sfc_main","PRESENCE_STATES","role","PRESENCE_STATES_LIST"],"mappings":";;AA8BA,MAAAA,IAAA;AAAA,EACA,MAAA;AAAA,EACA,OAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOA,UAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAAC,EAAA;AAAA,MACA,WAAA,CAAAC,MACAC,EAAA,SAAAD,CAAA;AAAA,IAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOA,QAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA,EACA;AACA
|
|
1
|
+
{"version":3,"file":"presence.js","sources":["../../../components/presence/presence.vue"],"sourcesContent":["<template>\n <div\n class=\"d-presence\"\n data-qa=\"dt-presence\"\n role=\"status\"\n :aria-live=\"$attrs.ariaLive || 'off'\"\n >\n <span\n v-if=\"srText\"\n data-qa=\"dt-presence-sr-text\"\n class=\"sr-only\"\n >{{ srText }} </span>\n <div\n class=\"d-presence__inner\"\n :class=\"{\n 'd-presence__inner--active': presence === 'active',\n 'd-presence__inner--away': presence === 'away',\n 'd-presence__inner--busy': presence === 'busy',\n 'd-presence__inner--offline': presence === 'offline',\n }\"\n />\n </div>\n</template>\n\n<script>\nimport { PRESENCE_STATES, PRESENCE_STATES_LIST } from './presence_constants';\n/**\n * Presence is a user status visual indicator element.\n * @see https://dialtone.dialpad.com/components/presence.html\n */\nexport default {\n name: 'DtPresence',\n props: {\n\n /**\n * Determines the color of the inner presence circle, indicating status.\n * Accepts one of 4 values: 'busy', 'away', 'active', 'offline'\n * @values busy, away, active, offline\n */\n presence: {\n type: String,\n default: PRESENCE_STATES.ACTIVE,\n validator: (role) => {\n return PRESENCE_STATES_LIST.includes(role);\n },\n },\n\n /**\n * Since Presence is a visual element, we need SRs to read out any state changes\n * that occur.\n * Text entered here will be read by assistive technology. If null this component will be ignored by AT.\n */\n srText: {\n type: String,\n default: null,\n },\n },\n};\n</script>\n"],"names":["_sfc_main","PRESENCE_STATES","role","PRESENCE_STATES_LIST"],"mappings":";;AA8BA,MAAAA,IAAA;AAAA,EACA,MAAA;AAAA,EACA,OAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOA,UAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAAC,EAAA;AAAA,MACA,WAAA,CAAAC,MACAC,EAAA,SAAAD,CAAA;AAAA,IAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOA,QAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA,EACA;AACA;;;;;;;;;;;;;;;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const i=require("../../common/mixins/input.cjs"),t=require("./radio-constants.cjs"),r=require("../../_plugin-vue2_normalizer-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const i=require("../../common/mixins/input.cjs"),t=require("./radio-constants.cjs"),r=require("../../_plugin-vue2_normalizer-e_CkxkSV.cjs"),n=require("../validation-messages/validation-messages.cjs"),d={name:"DtRadio",components:{DtValidationMessages:n.default},mixins:[i.InputMixin,i.CheckableMixin,i.GroupableMixin,i.MessagesMixin],inheritAttrs:!1,props:{value:{type:[String,Number],default:""}},emits:["input","focusin","focusout"],computed:{inputValidationClass(){return t.RADIO_INPUT_VALIDATION_CLASSES[this.internalValidationState]},radioGroupValue(){var e;return(e=this.groupContext)==null?void 0:e.selectedValue},inputListeners(){return{...this.$listeners,input:()=>{},change:e=>this.emitValue(e.target.value)}},hasMessages(){return this.formattedMessages.length&&this.showMessages}},watch:{radioGroupValue:{immediate:!0,handler(e){this.hasGroup&&(this.internalChecked=e===this.value)}}},methods:{emitValue(e){e!==this.radioGroupValue&&(this.setGroupValue(e),this.$emit("input",e))}}};var o=function(){var s=this,a=s._self._c;return a("div",[a("label",{class:["d-radio-group",{"d-radio-group--disabled":s.internalDisabled}]},[a("div",{staticClass:"d-radio__input"},[a("input",s._g(s._b({class:["d-radio",s.inputValidationClass,s.inputClass],attrs:{name:s.internalName,disabled:s.internalDisabled,type:"radio"},domProps:{checked:s.internalChecked,value:s.value}},"input",s.$attrs,!1),s.inputListeners))]),a("div",s._b({class:[s.labelClass,"d-radio__copy d-radio__label"],attrs:{"data-qa":"radio-label"}},"div",s.labelChildProps,!1),[s._t("default",function(){return[s._v(s._s(s.label))]})],2)]),s.$slots.description||s.description||s.hasMessages?a("div",{staticClass:"d-radio__messages",attrs:{"data-qa":"radio-description-messages"}},[s.$slots.description||s.description?a("div",s._b({class:["d-description",s.descriptionClass],attrs:{"data-qa":"radio-description"}},"div",s.descriptionChildProps,!1),[s._t("description",function(){return[s._v(" "+s._s(s.description)+" ")]})],2):s._e(),a("dt-validation-messages",s._b({class:s.messagesClass,attrs:{"validation-messages":s.formattedMessages,"show-messages":s.showMessages,"data-qa":"dt-radio-validation-messages"}},"dt-validation-messages",s.messagesChildProps,!1))],1):s._e()])},l=[],u=r.n(d,o,l);const c=u.exports;exports.default=c;
|
|
2
2
|
//# sourceMappingURL=radio.cjs.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { InputMixin as t, CheckableMixin as i, GroupableMixin as r, MessagesMixin as n } from "../../common/mixins/input.js";
|
|
2
2
|
import { RADIO_INPUT_VALIDATION_CLASSES as o } from "./radio-constants.js";
|
|
3
|
-
import { n as d } from "../../_plugin-vue2_normalizer-
|
|
3
|
+
import { n as d } from "../../_plugin-vue2_normalizer-DSLOjnn3.js";
|
|
4
4
|
import l from "../validation-messages/validation-messages.js";
|
|
5
|
-
const
|
|
5
|
+
const p = {
|
|
6
6
|
name: "DtRadio",
|
|
7
7
|
components: { DtValidationMessages: l },
|
|
8
8
|
mixins: [t, i, r, n],
|
|
@@ -82,7 +82,7 @@ const u = {
|
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
84
|
};
|
|
85
|
-
var
|
|
85
|
+
var u = function() {
|
|
86
86
|
var s = this, a = s._self._c;
|
|
87
87
|
return a("div", [a("label", { class: ["d-radio-group", { "d-radio-group--disabled": s.internalDisabled }] }, [a("div", { staticClass: "d-radio__input" }, [a("input", s._g(s._b({ class: ["d-radio", s.inputValidationClass, s.inputClass], attrs: { name: s.internalName, disabled: s.internalDisabled, type: "radio" }, domProps: { checked: s.internalChecked, value: s.value } }, "input", s.$attrs, !1), s.inputListeners))]), a("div", s._b({ class: [s.labelClass, "d-radio__copy d-radio__label"], attrs: { "data-qa": "radio-label" } }, "div", s.labelChildProps, !1), [s._t("default", function() {
|
|
88
88
|
return [s._v(s._s(s.label))];
|
|
@@ -90,12 +90,9 @@ var p = function() {
|
|
|
90
90
|
return [s._v(" " + s._s(s.description) + " ")];
|
|
91
91
|
})], 2) : s._e(), a("dt-validation-messages", s._b({ class: s.messagesClass, attrs: { "validation-messages": s.formattedMessages, "show-messages": s.showMessages, "data-qa": "dt-radio-validation-messages" } }, "dt-validation-messages", s.messagesChildProps, !1))], 1) : s._e()]);
|
|
92
92
|
}, c = [], m = /* @__PURE__ */ d(
|
|
93
|
-
u,
|
|
94
93
|
p,
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
null,
|
|
98
|
-
null
|
|
94
|
+
u,
|
|
95
|
+
c
|
|
99
96
|
);
|
|
100
97
|
const v = m.exports;
|
|
101
98
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radio.js","sources":["../../../components/radio/radio.vue"],"sourcesContent":["<template>\n <div>\n <label :class=\"['d-radio-group', { 'd-radio-group--disabled': internalDisabled }]\">\n <div class=\"d-radio__input\">\n <input\n :checked=\"internalChecked\"\n :name=\"internalName\"\n :value=\"value\"\n :disabled=\"internalDisabled\"\n type=\"radio\"\n :class=\"['d-radio', inputValidationClass, inputClass]\"\n v-bind=\"$attrs\"\n v-on=\"inputListeners\"\n >\n </div>\n <div\n :class=\"[labelClass, 'd-radio__copy d-radio__label']\"\n v-bind=\"labelChildProps\"\n data-qa=\"radio-label\"\n >\n <!-- @slot slot for Radio Label -->\n <slot>{{ label }}</slot>\n </div>\n </label>\n <div\n v-if=\"$slots.description || description || hasMessages\"\n class=\"d-radio__messages\"\n data-qa=\"radio-description-messages\"\n >\n <div\n v-if=\"$slots.description || description\"\n :class=\"['d-description', descriptionClass]\"\n v-bind=\"descriptionChildProps\"\n data-qa=\"radio-description\"\n >\n <!-- @slot slot for Radio Description -->\n <slot name=\"description\">\n {{ description }}\n </slot>\n </div>\n <dt-validation-messages\n :validation-messages=\"formattedMessages\"\n :show-messages=\"showMessages\"\n :class=\"messagesClass\"\n v-bind=\"messagesChildProps\"\n data-qa=\"dt-radio-validation-messages\"\n />\n </div>\n </div>\n</template>\n\n<script>\nimport {\n InputMixin,\n CheckableMixin,\n GroupableMixin,\n MessagesMixin,\n} from '@/common/mixins/input';\nimport { RADIO_INPUT_VALIDATION_CLASSES } from './radio_constants';\nimport { DtValidationMessages } from '../validation_messages';\n\n/**\n * Radios are control elements that allow the user to make a single selection.\n * They are typically used in a Radio Group which allows the user to make a selection from a list of options.\n * @see https://dialtone.dialpad.com/components/radio.html\n */\nexport default {\n name: 'DtRadio',\n\n components: { DtValidationMessages },\n\n mixins: [InputMixin, CheckableMixin, GroupableMixin, MessagesMixin],\n\n inheritAttrs: false,\n\n props: {\n /**\n * A provided value for the radio\n */\n value: {\n type: [String, Number],\n default: '',\n },\n },\n\n emits: [\n /**\n * Native input event\n *\n * @event input\n * @type {String | Number}\n */\n 'input',\n\n /**\n * Native input focusin event\n *\n * @event focusin\n * @property {FocusEvent}\n */\n 'focusin',\n\n /**\n * Native input focusout event\n *\n * @event focusout\n * @property {FocusEvent}\n */\n 'focusout',\n ],\n\n computed: {\n inputValidationClass () {\n return RADIO_INPUT_VALIDATION_CLASSES[this.internalValidationState];\n },\n\n radioGroupValue () {\n return this.groupContext?.selectedValue;\n },\n\n inputListeners () {\n return {\n /* TODO\n Check if any usages of this component leverage $listeners and either remove if unused or scope the removal\n and migration prior to upgrading to Vue 3.x\n */\n ...this.$listeners,\n /*\n * Override input listener to as no-op. Prevents parent input listeners from being passed through onto the input\n * element which will result in the hander being called twice (once on the input element and once by the emitted\n * input event by the change listener).\n */\n input: () => {},\n change: event => this.emitValue(event.target.value),\n };\n },\n\n hasMessages () {\n return this.formattedMessages.length && this.showMessages;\n },\n },\n\n watch: {\n radioGroupValue: {\n immediate: true,\n handler (newRadioGroupValue) {\n if (this.hasGroup) {\n // update internal value when the radio group value changes\n this.internalChecked = newRadioGroupValue === this.value;\n }\n },\n },\n },\n\n methods: {\n emitValue (value) {\n if (value !== this.radioGroupValue) {\n // update provided value if injected\n this.setGroupValue(value);\n\n this.$emit('input', value);\n }\n },\n },\n};\n</script>\n"],"names":["_sfc_main","DtValidationMessages","InputMixin","CheckableMixin","GroupableMixin","MessagesMixin","RADIO_INPUT_VALIDATION_CLASSES","_a","event","newRadioGroupValue","value"],"mappings":";;;;AAkEA,MAAAA,IAAA;AAAA,EACA,MAAA;AAAA,EAEA,YAAA,EAAA,sBAAAC,EAAA;AAAA,EAEA,QAAA,CAAAC,GAAAC,GAAAC,GAAAC,CAAA;AAAA,EAEA,cAAA;AAAA,EAEA,OAAA;AAAA;AAAA;AAAA;AAAA,IAIA,OAAA;AAAA,MACA,MAAA,CAAA,QAAA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,OAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAQA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAQA;AAAA,EACA;AAAA,EAEA,UAAA;AAAA,IACA,uBAAA;AACA,aAAAC,EAAA,KAAA,uBAAA;AAAA,IACA;AAAA,IAEA,kBAAA;;AACA,cAAAC,IAAA,KAAA,iBAAA,gBAAAA,EAAA;AAAA,IACA;AAAA,IAEA,iBAAA;AACA,aAAA;AAAA;AAAA;AAAA;AAAA;AAAA,QAKA,GAAA,KAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,QAMA,OAAA,MAAA;AAAA,QAAA;AAAA,QACA,QAAA,CAAAC,MAAA,KAAA,UAAAA,EAAA,OAAA,KAAA;AAAA,MACA;AAAA,IACA;AAAA,IAEA,cAAA;AACA,aAAA,KAAA,kBAAA,UAAA,KAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,OAAA;AAAA,IACA,iBAAA;AAAA,MACA,WAAA;AAAA,MACA,QAAAC,GAAA;AACA,QAAA,KAAA,aAEA,KAAA,kBAAAA,MAAA,KAAA;AAAA,MAEA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,SAAA;AAAA,IACA,UAAAC,GAAA;AACA,MAAAA,MAAA,KAAA,oBAEA,KAAA,cAAAA,CAAA,GAEA,KAAA,MAAA,SAAAA,CAAA;AAAA,IAEA;AAAA,EACA;AACA
|
|
1
|
+
{"version":3,"file":"radio.js","sources":["../../../components/radio/radio.vue"],"sourcesContent":["<template>\n <div>\n <label :class=\"['d-radio-group', { 'd-radio-group--disabled': internalDisabled }]\">\n <div class=\"d-radio__input\">\n <input\n :checked=\"internalChecked\"\n :name=\"internalName\"\n :value=\"value\"\n :disabled=\"internalDisabled\"\n type=\"radio\"\n :class=\"['d-radio', inputValidationClass, inputClass]\"\n v-bind=\"$attrs\"\n v-on=\"inputListeners\"\n >\n </div>\n <div\n :class=\"[labelClass, 'd-radio__copy d-radio__label']\"\n v-bind=\"labelChildProps\"\n data-qa=\"radio-label\"\n >\n <!-- @slot slot for Radio Label -->\n <slot>{{ label }}</slot>\n </div>\n </label>\n <div\n v-if=\"$slots.description || description || hasMessages\"\n class=\"d-radio__messages\"\n data-qa=\"radio-description-messages\"\n >\n <div\n v-if=\"$slots.description || description\"\n :class=\"['d-description', descriptionClass]\"\n v-bind=\"descriptionChildProps\"\n data-qa=\"radio-description\"\n >\n <!-- @slot slot for Radio Description -->\n <slot name=\"description\">\n {{ description }}\n </slot>\n </div>\n <dt-validation-messages\n :validation-messages=\"formattedMessages\"\n :show-messages=\"showMessages\"\n :class=\"messagesClass\"\n v-bind=\"messagesChildProps\"\n data-qa=\"dt-radio-validation-messages\"\n />\n </div>\n </div>\n</template>\n\n<script>\nimport {\n InputMixin,\n CheckableMixin,\n GroupableMixin,\n MessagesMixin,\n} from '@/common/mixins/input';\nimport { RADIO_INPUT_VALIDATION_CLASSES } from './radio_constants';\nimport { DtValidationMessages } from '../validation_messages';\n\n/**\n * Radios are control elements that allow the user to make a single selection.\n * They are typically used in a Radio Group which allows the user to make a selection from a list of options.\n * @see https://dialtone.dialpad.com/components/radio.html\n */\nexport default {\n name: 'DtRadio',\n\n components: { DtValidationMessages },\n\n mixins: [InputMixin, CheckableMixin, GroupableMixin, MessagesMixin],\n\n inheritAttrs: false,\n\n props: {\n /**\n * A provided value for the radio\n */\n value: {\n type: [String, Number],\n default: '',\n },\n },\n\n emits: [\n /**\n * Native input event\n *\n * @event input\n * @type {String | Number}\n */\n 'input',\n\n /**\n * Native input focusin event\n *\n * @event focusin\n * @property {FocusEvent}\n */\n 'focusin',\n\n /**\n * Native input focusout event\n *\n * @event focusout\n * @property {FocusEvent}\n */\n 'focusout',\n ],\n\n computed: {\n inputValidationClass () {\n return RADIO_INPUT_VALIDATION_CLASSES[this.internalValidationState];\n },\n\n radioGroupValue () {\n return this.groupContext?.selectedValue;\n },\n\n inputListeners () {\n return {\n /* TODO\n Check if any usages of this component leverage $listeners and either remove if unused or scope the removal\n and migration prior to upgrading to Vue 3.x\n */\n ...this.$listeners,\n /*\n * Override input listener to as no-op. Prevents parent input listeners from being passed through onto the input\n * element which will result in the hander being called twice (once on the input element and once by the emitted\n * input event by the change listener).\n */\n input: () => {},\n change: event => this.emitValue(event.target.value),\n };\n },\n\n hasMessages () {\n return this.formattedMessages.length && this.showMessages;\n },\n },\n\n watch: {\n radioGroupValue: {\n immediate: true,\n handler (newRadioGroupValue) {\n if (this.hasGroup) {\n // update internal value when the radio group value changes\n this.internalChecked = newRadioGroupValue === this.value;\n }\n },\n },\n },\n\n methods: {\n emitValue (value) {\n if (value !== this.radioGroupValue) {\n // update provided value if injected\n this.setGroupValue(value);\n\n this.$emit('input', value);\n }\n },\n },\n};\n</script>\n"],"names":["_sfc_main","DtValidationMessages","InputMixin","CheckableMixin","GroupableMixin","MessagesMixin","RADIO_INPUT_VALIDATION_CLASSES","_a","event","newRadioGroupValue","value"],"mappings":";;;;AAkEA,MAAAA,IAAA;AAAA,EACA,MAAA;AAAA,EAEA,YAAA,EAAA,sBAAAC,EAAA;AAAA,EAEA,QAAA,CAAAC,GAAAC,GAAAC,GAAAC,CAAA;AAAA,EAEA,cAAA;AAAA,EAEA,OAAA;AAAA;AAAA;AAAA;AAAA,IAIA,OAAA;AAAA,MACA,MAAA,CAAA,QAAA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,OAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAQA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAQA;AAAA,EACA;AAAA,EAEA,UAAA;AAAA,IACA,uBAAA;AACA,aAAAC,EAAA,KAAA,uBAAA;AAAA,IACA;AAAA,IAEA,kBAAA;;AACA,cAAAC,IAAA,KAAA,iBAAA,gBAAAA,EAAA;AAAA,IACA;AAAA,IAEA,iBAAA;AACA,aAAA;AAAA;AAAA;AAAA;AAAA;AAAA,QAKA,GAAA,KAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,QAMA,OAAA,MAAA;AAAA,QAAA;AAAA,QACA,QAAA,CAAAC,MAAA,KAAA,UAAAA,EAAA,OAAA,KAAA;AAAA,MACA;AAAA,IACA;AAAA,IAEA,cAAA;AACA,aAAA,KAAA,kBAAA,UAAA,KAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,OAAA;AAAA,IACA,iBAAA;AAAA,MACA,WAAA;AAAA,MACA,QAAAC,GAAA;AACA,QAAA,KAAA,aAEA,KAAA,kBAAAA,MAAA,KAAA;AAAA,MAEA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,SAAA;AAAA,IACA,UAAAC,GAAA;AACA,MAAAA,MAAA,KAAA,oBAEA,KAAA,cAAAA,CAAA,GAEA,KAAA,MAAA,SAAAA,CAAA;AAAA,IAEA;AAAA,EACA;AACA;;;;;;;;;;;;;;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("../../_plugin-vue2_normalizer-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("../../_plugin-vue2_normalizer-e_CkxkSV.cjs"),u=require("../input-group/input-group.cjs"),a={name:"DtRadioGroup",extends:u.default,props:{value:{type:[String,Number],default:""},dataQaGroup:{type:String,default:"radio-group"},dataQaGroupLegend:{type:String,default:"radio-group-legend"},dataQaGroupMessages:{type:String,default:"radio-group-messages"}},emits:["input"],data(){return{provideObj:{selectedValue:this.value}}},watch:{value(e){this.provideObj.selectedValue=e}},methods:{setGroupValue(e){this.$emit("input",e)},getMessageKey(e,t){return`radio-group-message-${e}-${t}-${this.id}`}}},o=null,s=null;var i=r.n(a,o,s);const n=i.exports;exports.default=n;
|
|
2
2
|
//# sourceMappingURL=radio-group.cjs.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as a } from "../../_plugin-vue2_normalizer-
|
|
1
|
+
import { n as a } from "../../_plugin-vue2_normalizer-DSLOjnn3.js";
|
|
2
2
|
import r from "../input-group/input-group.js";
|
|
3
3
|
const o = {
|
|
4
4
|
name: "DtRadioGroup",
|
|
@@ -77,10 +77,7 @@ const o = {
|
|
|
77
77
|
var n = /* @__PURE__ */ a(
|
|
78
78
|
o,
|
|
79
79
|
s,
|
|
80
|
-
u
|
|
81
|
-
!1,
|
|
82
|
-
null,
|
|
83
|
-
null
|
|
80
|
+
u
|
|
84
81
|
);
|
|
85
82
|
const i = n.exports;
|
|
86
83
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radio-group.js","sources":["../../../components/radio_group/radio_group.vue"],"sourcesContent":["<script>\nimport { DtInputGroup } from '../input_group';\n\n/**\n * Radio Groups are control elements that allow the user to make a single selection from a list of options.\n * @see https://dialtone.dialpad.com/components/radio_group.html\n */\nexport default {\n name: 'DtRadioGroup',\n\n extends: DtInputGroup,\n\n props: {\n /**\n * A provided value for the radio group\n * @model value\n */\n value: {\n type: [String, Number],\n default: '',\n },\n\n /**\n * A data qa tag for the radio group\n */\n dataQaGroup: {\n type: String,\n default: 'radio-group',\n },\n\n /**\n * A data qa tag for the radio group legend\n */\n dataQaGroupLegend: {\n type: String,\n default: 'radio-group-legend',\n },\n\n /**\n * A data qa tag for the radio group messages\n */\n dataQaGroupMessages: {\n type: String,\n default: 'radio-group-messages',\n },\n },\n\n emits: [\n /**\n * Native input event\n *\n * @event input\n * @type {String | Number}\n */\n 'input',\n ],\n\n data () {\n return {\n // wrap values in object to make reactive\n provideObj: {\n selectedValue: this.value,\n },\n };\n },\n\n watch: {\n /*\n * watching value to support 2 way binding for slotted radios.\n * need this to pass value to slotted radios if modified outside\n * radio group.\n */\n value (newValue) {\n this.provideObj.selectedValue = newValue;\n },\n },\n\n methods: {\n /*\n * provided value to support 2 way binding for slotted radios.\n * slotted radios will change this value and need to emit new value up.\n */\n setGroupValue (newValue) {\n this.$emit('input', newValue);\n },\n\n getMessageKey (type, index) {\n return `radio-group-message-${type}-${index}-${this.id}`;\n },\n },\n};\n</script>\n"],"names":["_sfc_main","DtInputGroup","newValue","type","index"],"mappings":";;AAOA,MAAAA,IAAA;AAAA,EACA,MAAA;AAAA,EAEA,SAAAC;AAAA,EAEA,OAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAKA,OAAA;AAAA,MACA,MAAA,CAAA,QAAA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,aAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,mBAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,qBAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,OAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOA;AAAA,EACA;AAAA,EAEA,OAAA;AACA,WAAA;AAAA;AAAA,MAEA,YAAA;AAAA,QACA,eAAA,KAAA;AAAA,MACA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,OAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,MAAAC,GAAA;AACA,WAAA,WAAA,gBAAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,SAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAKA,cAAAA,GAAA;AACA,WAAA,MAAA,SAAAA,CAAA;AAAA,IACA;AAAA,IAEA,cAAAC,GAAAC,GAAA;AACA,aAAA,uBAAAD,CAAA,IAAAC,CAAA,IAAA,KAAA,EAAA;AAAA,IACA;AAAA,EACA;AACA
|
|
1
|
+
{"version":3,"file":"radio-group.js","sources":["../../../components/radio_group/radio_group.vue"],"sourcesContent":["<script>\nimport { DtInputGroup } from '../input_group';\n\n/**\n * Radio Groups are control elements that allow the user to make a single selection from a list of options.\n * @see https://dialtone.dialpad.com/components/radio_group.html\n */\nexport default {\n name: 'DtRadioGroup',\n\n extends: DtInputGroup,\n\n props: {\n /**\n * A provided value for the radio group\n * @model value\n */\n value: {\n type: [String, Number],\n default: '',\n },\n\n /**\n * A data qa tag for the radio group\n */\n dataQaGroup: {\n type: String,\n default: 'radio-group',\n },\n\n /**\n * A data qa tag for the radio group legend\n */\n dataQaGroupLegend: {\n type: String,\n default: 'radio-group-legend',\n },\n\n /**\n * A data qa tag for the radio group messages\n */\n dataQaGroupMessages: {\n type: String,\n default: 'radio-group-messages',\n },\n },\n\n emits: [\n /**\n * Native input event\n *\n * @event input\n * @type {String | Number}\n */\n 'input',\n ],\n\n data () {\n return {\n // wrap values in object to make reactive\n provideObj: {\n selectedValue: this.value,\n },\n };\n },\n\n watch: {\n /*\n * watching value to support 2 way binding for slotted radios.\n * need this to pass value to slotted radios if modified outside\n * radio group.\n */\n value (newValue) {\n this.provideObj.selectedValue = newValue;\n },\n },\n\n methods: {\n /*\n * provided value to support 2 way binding for slotted radios.\n * slotted radios will change this value and need to emit new value up.\n */\n setGroupValue (newValue) {\n this.$emit('input', newValue);\n },\n\n getMessageKey (type, index) {\n return `radio-group-message-${type}-${index}-${this.id}`;\n },\n },\n};\n</script>\n"],"names":["_sfc_main","DtInputGroup","newValue","type","index"],"mappings":";;AAOA,MAAAA,IAAA;AAAA,EACA,MAAA;AAAA,EAEA,SAAAC;AAAA,EAEA,OAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAKA,OAAA;AAAA,MACA,MAAA,CAAA,QAAA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,aAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,mBAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,qBAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,OAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOA;AAAA,EACA;AAAA,EAEA,OAAA;AACA,WAAA;AAAA;AAAA,MAEA,YAAA;AAAA,QACA,eAAA,KAAA;AAAA,MACA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,OAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,MAAAC,GAAA;AACA,WAAA,WAAA,gBAAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,SAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAKA,cAAAA,GAAA;AACA,WAAA,MAAA,SAAAA,CAAA;AAAA,IACA;AAAA,IAEA,cAAAC,GAAAC,GAAA;AACA,aAAA,uBAAAD,CAAA,IAAAC,CAAA,IAAA,KAAA,EAAA;AAAA,IACA;AAAA,EACA;AACA;;;;;;;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("../../_plugin-vue2_normalizer-e_CkxkSV.cjs"),n=require("../radio/radio.cjs"),l={name:"RadiosDecorator",components:{DtRadio:n.default},created(){this.options=[{label:"Apple",value:"apple"},{label:"Banana",value:"banana"},{label:"Other",value:"other"}]}};var o=function(){var e=this,a=e._self._c;return a("div",e._l(e.options,function(r){return a("dt-radio",{key:r.value,attrs:{value:r.value}},[a("span",[e._v(e._s(r.label))])])}),1)},s=[],_=t.n(l,o,s);const i=_.exports;exports.default=i;
|
|
2
2
|
//# sourceMappingURL=radios-decorator.cjs.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n } from "../../_plugin-vue2_normalizer-
|
|
1
|
+
import { n } from "../../_plugin-vue2_normalizer-DSLOjnn3.js";
|
|
2
2
|
import t from "../radio/radio.js";
|
|
3
3
|
const o = {
|
|
4
4
|
name: "RadiosDecorator",
|
|
@@ -11,21 +11,18 @@ const o = {
|
|
|
11
11
|
];
|
|
12
12
|
}
|
|
13
13
|
};
|
|
14
|
-
var
|
|
14
|
+
var s = function() {
|
|
15
15
|
var a = this, e = a._self._c;
|
|
16
16
|
return e("div", a._l(a.options, function(r) {
|
|
17
17
|
return e("dt-radio", { key: r.value, attrs: { value: r.value } }, [e("span", [a._v(a._s(r.label))])]);
|
|
18
18
|
}), 1);
|
|
19
|
-
},
|
|
19
|
+
}, l = [], _ = /* @__PURE__ */ n(
|
|
20
20
|
o,
|
|
21
|
-
l,
|
|
22
21
|
s,
|
|
23
|
-
|
|
24
|
-
null,
|
|
25
|
-
null
|
|
22
|
+
l
|
|
26
23
|
);
|
|
27
|
-
const
|
|
24
|
+
const d = _.exports;
|
|
28
25
|
export {
|
|
29
|
-
|
|
26
|
+
d as default
|
|
30
27
|
};
|
|
31
28
|
//# sourceMappingURL=radios-decorator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radios-decorator.js","sources":["../../../components/radio_group/radios_decorator.vue"],"sourcesContent":["<template>\n <div>\n <dt-radio\n v-for=\"option in options\"\n :key=\"option.value\"\n :value=\"option.value\"\n >\n <span>{{ option.label }}</span>\n </dt-radio>\n </div>\n</template>\n\n<script>\nimport { DtRadio } from '../radio';\n\nexport default {\n name: 'RadiosDecorator',\n components: { DtRadio },\n created () {\n this.options = [\n { label: 'Apple', value: 'apple' },\n { label: 'Banana', value: 'banana' },\n { label: 'Other', value: 'other' },\n ];\n },\n};\n</script>\n"],"names":["_sfc_main","DtRadio"],"mappings":";;AAeA,MAAAA,IAAA;AAAA,EACA,MAAA;AAAA,EACA,YAAA,EAAA,SAAAC,EAAA;AAAA,EACA,UAAA;AACA,SAAA,UAAA;AAAA,MACA,EAAA,OAAA,SAAA,OAAA,QAAA;AAAA,MACA,EAAA,OAAA,UAAA,OAAA,SAAA;AAAA,MACA,EAAA,OAAA,SAAA,OAAA,QAAA;AAAA,IACA;AAAA,EACA;AACA
|
|
1
|
+
{"version":3,"file":"radios-decorator.js","sources":["../../../components/radio_group/radios_decorator.vue"],"sourcesContent":["<template>\n <div>\n <dt-radio\n v-for=\"option in options\"\n :key=\"option.value\"\n :value=\"option.value\"\n >\n <span>{{ option.label }}</span>\n </dt-radio>\n </div>\n</template>\n\n<script>\nimport { DtRadio } from '../radio';\n\nexport default {\n name: 'RadiosDecorator',\n components: { DtRadio },\n created () {\n this.options = [\n { label: 'Apple', value: 'apple' },\n { label: 'Banana', value: 'banana' },\n { label: 'Other', value: 'other' },\n ];\n },\n};\n</script>\n"],"names":["_sfc_main","DtRadio"],"mappings":";;AAeA,MAAAA,IAAA;AAAA,EACA,MAAA;AAAA,EACA,YAAA,EAAA,SAAAC,EAAA;AAAA,EACA,UAAA;AACA,SAAA,UAAA;AAAA,MACA,EAAA,OAAA,SAAA,OAAA,QAAA;AAAA,MACA,EAAA,OAAA,UAAA,OAAA,SAAA;AAAA,MACA,EAAA,OAAA,SAAA,OAAA,QAAA;AAAA,IACA;AAAA,EACA;AACA;;;;;;;;;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const l=require("../../node_modules/@tiptap/vue-2.cjs"),c=require("@tiptap/core"),O=require("@tiptap/extension-blockquote"),P=require("@tiptap/extension-code-block"),D=require("@tiptap/extension-code"),M=require("@tiptap/extension-document"),$=require("@tiptap/extension-paragraph"),B=require("@tiptap/extension-placeholder"),H=require("@tiptap/extension-hard-break"),V=require("@tiptap/extension-bold"),F=require("@tiptap/extension-bullet-list"),N=require("@tiptap/extension-italic"),K=require("@tiptap/extension-link"),U=require("@tiptap/extension-list-item"),W=require("@tiptap/extension-ordered-list"),z=require("@tiptap/extension-strike"),X=require("@tiptap/extension-underline"),J=require("@tiptap/extension-text"),Y=require("@tiptap/extension-text-align"),G=require("@tiptap/extension-history"),Q=require("@tiptap/extension-text-style"),Z=require("@tiptap/extension-color"),ee=require("@tiptap/extension-font-family"),g=require("@tiptap/pm/state"),te=require("@tiptap/suggestion"),I=require("regex-combined-emojis"),u=require("../../_plugin-vue2_normalizer-yXi3ZRRD.cjs"),q=require("../emoji/emoji.cjs"),f=require("../../common/emoji/index.cjs"),ne=require("@dialpad/dialtone-emojis"),re=require("../list-item/list-item.cjs"),y=require("../stack/stack.cjs"),v=require("tippy.js"),R=require("../../common/utils/index.cjs"),ie=require("@tiptap/extension-image"),S=require("@tiptap/extension-mention"),j=require("../link/link.cjs"),b=require("./rich-text-editor-constants.cjs"),se=require("../avatar/avatar.cjs"),oe=require("@dialpad/dialtone-icons/vue2/hash"),ae=require("@dialpad/dialtone-icons/vue2/lock"),le=require("deep-equal"),ce=require("../button/button.cjs"),de={name:"EmojiComponent",components:{NodeViewWrapper:l.NodeViewWrapper,DtEmoji:q.default},props:l.nodeViewProps};var ue=function(){var e=this,r=e._self._c;return r("node-view-wrapper",{staticClass:"d-d-inline-block d-va-bottom d-lh0"},[r("dt-emoji",{attrs:{size:"500",code:e.node.attrs.code}})],1)},me=[],he=u.n(de,ue,me,!1,null,null);const fe=he.exports,ge={name:"SuggestionList",components:{DtListItem:re.default},props:{items:{type:Array,required:!0},command:{type:Function,required:!0},itemComponent:{type:Object,required:!0},itemType:{type:String,required:!0}},data(){return{selectedIndex:0}},watch:{items(){this.selectedIndex=0}},methods:{onKeyDown({event:t}){return t.key==="ArrowUp"?(this.upHandler(),!0):t.key==="ArrowDown"?(this.downHandler(),!0):t.key==="Enter"||t.key==="Tab"?(this.selectHandler(),!0):!1},upHandler(){this.selectedIndex=(this.selectedIndex+this.items.length-1)%this.items.length,this.scrollActiveElementIntoView()},downHandler(){this.selectedIndex=(this.selectedIndex+1)%this.items.length,this.scrollActiveElementIntoView()},async scrollActiveElementIntoView(){await this.$nextTick();const t=this.$refs.suggestionList.querySelector(".d-list-item--highlighted");t&&t.scrollIntoView({behaviour:"smooth",block:"center"})},selectHandler(){this.selectItem(this.selectedIndex)},selectItem(t){const e=this.items[t];switch(this.itemType){case"emoji":this.command(e);return;case"mention":this.command({name:e.name,id:e.id,avatarSrc:e.avatarSrc});break;case"channel":this.command({name:e.name,id:e.id});break;case"slash-command":this.command({command:e.command});break}}}};var pe=function(){var e=this,r=e._self._c;return r("div",{staticClass:"d-popover__dialog d-suggestion-list__container"},[r("ul",{directives:[{name:"show",rawName:"v-show",value:e.items.length,expression:"items.length"}],ref:"suggestionList",staticClass:"d-suggestion-list"},e._l(e.items,function(n,i){return r("dt-list-item",{key:n.id,class:["d-suggestion-list__item",{"d-list-item--highlighted":i===e.selectedIndex}],attrs:{"navigation-type":"arrow-keys"},on:{click:function(o){return e.selectItem(i)},keydown:function(o){return o.preventDefault(),e.onKeyDown.apply(null,arguments)}}},[r(e.itemComponent,{tag:"component",attrs:{item:n}})],1)}),1)])},_e=[],we=u.n(ge,pe,_e,!1,null,null);const x=we.exports,be={name:"EmojiSuggestion",components:{DtEmoji:q.default,DtStack:y.default},props:{item:{type:Object,required:!0}}};var ye=function(){var e=this,r=e._self._c;return r("dt-stack",{attrs:{direction:"row",gap:"400"}},[r("dt-emoji",{attrs:{size:"200",code:e.item.code}}),e._v(" "+e._s(e.item.code)+" ")],1)},ve=[],xe=u.n(be,ye,ve,!1,null,null);const ke=xe.exports,k={name:"hideOnEsc",defaultValue:!0,fn({hide:t}){function e(r){r.keyCode===27&&t()}return{onShow(){document.addEventListener("keydown",e)},onHide(){document.removeEventListener("keydown",e)}}}},Ce=20,Te={items:({query:t})=>{if(t.length<2)return[];const e=Object.values(ne.emojisIndexed);return t=t.toLowerCase(),e.filter(n=>[n.name,n.shortname.replaceAll(":",""),...n.keywords].some(i=>i.startsWith(t))).splice(0,Ce).map(n=>({code:n.shortname}))},command:({editor:t,range:e,props:r})=>{var o,s;const n=t.view.state.selection.$to.nodeAfter;((o=n==null?void 0:n.text)==null?void 0:o.startsWith(" "))&&(e.to+=1),t.chain().focus().insertContentAt(e,[{type:"emoji",attrs:r}]).run(),(s=window.getSelection())==null||s.collapseToEnd()},render:()=>{let t,e,r=!1;return{onStart:n=>{t=new l.VueRenderer(x,{parent:void 0,propsData:{itemComponent:ke,itemType:"emoji",...n},editor:n.editor}),n.clientRect&&(e=v("body",{getReferenceClientRect:n.clientRect,appendTo:()=>document.body,content:t.element,showOnCreate:!1,onShow:()=>{r=!0},onHidden:()=>{r=!1},interactive:!0,trigger:"manual",placement:"top-start",zIndex:650,plugins:[k]}),n.items.length>0&&(e==null||e[0].show()))},onUpdate(n){t==null||t.updateProps(n),n.items.length>0?e==null||e[0].show():e==null||e[0].hide(),e==null||e[0].setProps({getReferenceClientRect:n.clientRect})},onKeyDown(n){var i;if(r)return(i=t==null?void 0:t.ref)==null?void 0:i.onKeyDown(n)},onExit(){e==null||e[0].destroy(),e=null,t==null||t.destroy(),t=null}}}},Re=/(:\w+:)$/,Se=new RegExp(I.emojiPattern+"$"),Ee=t=>{if(t&&f.codeToEmojiData(t[0]))return{text:t[2]||t[0]}},Le=t=>[...t.matchAll(f.emojiShortCodeRegex)].filter(r=>f.codeToEmojiData(r[0])).map(r=>({index:r.index,text:r[0],match:r})),$e=c.Node.create({name:"emoji",addOptions(){return{HTMLAttributes:{}}},group:"inline",inline:!0,selectable:!1,atom:!0,addNodeView(){return l.VueNodeViewRenderer(fe)},addAttributes(){return{code:{default:null}}},parseHTML(){return[{tag:"emoji-component"}]},renderText({node:t}){return f.stringToUnicode(f.codeToEmojiData(t.attrs.code).unicode_output)},renderHTML({HTMLAttributes:t}){return["emoji-component",c.mergeAttributes(this.options.HTMLAttributes,t)]},addInputRules(){return[new c.InputRule({find:t=>{const e=t.match(Re)||t.match(Se);if(e)return Ee(e)},handler:({state:t,range:e,match:r,commands:n,chain:i,can:o})=>{const{tr:s}=t,a=e.from,d=e.to;s.replaceWith(a,d,this.type.create({code:r[0]}))}})]},addPasteRules(){return[c.nodePasteRule({find:Le,type:this.type,getAttributes(t){return{code:t[0]}}}),c.nodePasteRule({find:f.emojiRegex,type:this.type,getAttributes(t){return{code:t[0]}}})]},addProseMirrorPlugins(){return[te({char:":",pluginKey:new g.PluginKey("emoji"),editor:this.editor,...this.options.suggestion,...Te})]},addKeyboardShortcuts(){return{Backspace:()=>this.editor.commands.command(({tr:t,state:e})=>{let r=!1;const{selection:n}=e,{empty:i,anchor:o}=n;return i?(e.doc.nodesBetween(o-1,o,(s,a)=>{if(s.type.name===this.name)return r=!0,t.insertText("",a,a+s.nodeSize),!1}),r):!1})}}});function Ie(t,e,r=()=>!0){const n=[];e.lastIndex=0;let i;for(;i=e.exec(t);)r(t,i)&&n.push(i);return n}function qe(t,e){return!["#","@"].includes(t.charAt(e.index))&&!["#","@"].includes(t.charAt(e.index-1))}function je(t){const e=new RegExp("(?:"+[`[!?.,:;'"]`,"(?:&|&)(?:lt|gt|quot|apos|raquo|laquo|rsaquo|lsaquo);)+$"].join("|"),"g");return t.replace(e,"")}function Ae(t,e){const r=t.slice(0,e+1).search(/\S+\s*$/),n=t.slice(e).search(/\s/);if(n<0){const i=t.slice(r);return{text:i,from:r,to:r+i.length}}return{text:t.slice(r,n+e),from:r,to:n+e}}function T(t,e,r,n){const i=Ae(t,e);if(n.lastIndex=0,!n.test(i.text))return i;const o=r==="left"?i.from-1:i.to+1;return o<=0||o>=t.length||o===e?i:T(t,o,r,n)}function Oe(t,e,r,n){const i=Math.max(t.from-1,0),o=Math.min(t.to+1,e.content.size),s=c.getMarksBetween(i,o,e);for(const a of s)a.mark.type===n&&r.removeMark(a.from,a.to,n)}const E=R.getPhoneNumberRegex(1,15);function L(t,e,r,n,i,o){if(!t)return;let s=r-e-1;s=s<0?0:s;const a=n-e,d=T(t,s,"left",E),m=T(t,a,"right",E),h=t.slice(d.from,m.to);Ie(h,R.linkRegex,qe).forEach(C=>{const p=je(C[0]),w=e+d.from+C.index+1,A=w+p.length;i.addMark(w,A,o.create())})}function Pe(t){let e=!1;return new g.Plugin({key:new g.PluginKey("autolink"),appendTransaction:(r,n,i)=>{const o=r.some(h=>h.docChanged)&&!n.doc.eq(i.doc);if(e&&!o)return;const{tr:s}=i,{textContent:a}=i.doc;e||L(a,0,0,a.length,s,t.type),e=!0;const d=c.combineTransactionSteps(n.doc,[...r]);return c.getChangedRanges(d).forEach(({oldRange:h,newRange:_})=>{Oe(_,i.doc,s,t.type),c.findChildrenInRange(i.doc,_,p=>p.isTextblock).forEach(({node:p,pos:w})=>{L(p.textContent,w,h.from,_.to,s,t.type)})}),s}})}const De={class:"d-link d-c-text d-d-inline-block d-wb-break-all",rel:"noopener noreferrer nofollow"},Me=c.Mark.create({name:"CustomLink",renderHTML({HTMLAttributes:t}){return["a",c.mergeAttributes(this.options.HTMLAttributes,t,De)]},renderText({node:t}){return t.attrs.text},addProseMirrorPlugins(){return[Pe({type:this.type})]}}),Be=ie.extend({name:"ConfigurableImage",addAttributes(){return{src:{default:""},alt:{default:void 0},title:{default:void 0},width:{default:void 0},height:{default:void 0},style:{default:void 0}}}}).configure({inline:!0,allowBase64:!0}),He=$.extend({parseHTML(){return[{tag:"div"}]},renderHTML({HTMLAttributes:t}){return["div",c.mergeAttributes(this.options.HTMLAttributes,t),0]}}),Ve={name:"MentionComponent",components:{NodeViewWrapper:l.NodeViewWrapper,DtLink:j.default},props:l.nodeViewProps,computed:{text(){return"@"+this.$props.node.attrs.name}}};var Fe=function(){var e=this,r=e._self._c;return r("node-view-wrapper",{staticClass:"d-d-inline-block"},[r("dt-link",{attrs:{kind:"mention"}},[e._v(" "+e._s(e.text)+" ")])],1)},Ne=[],Ke=u.n(Ve,Fe,Ne,!1,null,null);const Ue=Ke.exports,We=S.extend({addNodeView(){return l.VueNodeViewRenderer(Ue)},parseHTML(){return[{tag:"mention-component"}]},addAttributes(){return{name:{default:""},avatarSrc:{default:""},id:{default:""}}},renderText({node:t}){return`@${t.attrs.id}`},renderHTML({HTMLAttributes:t}){return["mention-component",c.mergeAttributes(this.options.HTMLAttributes,t)]}}).configure({suggestion:{char:"@",pluginKey:new g.PluginKey("mentionSuggestion")}}),ze={name:"ChannelComponent",components:{NodeViewWrapper:l.NodeViewWrapper,DtLink:j.default},props:l.nodeViewProps,computed:{text(){return"#"+this.$props.node.attrs.name}}};var Xe=function(){var e=this,r=e._self._c;return r("node-view-wrapper",{staticClass:"d-d-inline-block"},[r("dt-link",{attrs:{kind:"mention"}},[e._v(" "+e._s(e.text)+" ")])],1)},Je=[],Ye=u.n(ze,Xe,Je,!1,null,null);const Ge=Ye.exports,Qe=S.extend({name:"channel",addNodeView(){return l.VueNodeViewRenderer(Ge)},parseHTML(){return[{tag:"channel-component"}]},addAttributes(){return{name:{default:""},id:{default:""},locked:{default:!1}}},renderText({node:t}){return`#${t.attrs.id}`},renderHTML({HTMLAttributes:t}){return["channel-component",c.mergeAttributes(this.options.HTMLAttributes,t)]}}).configure({suggestion:{char:"#",pluginKey:new g.PluginKey("channelSuggestion")}}),Ze={name:"SlashCommandsComponent",components:{NodeViewWrapper:l.NodeViewWrapper},props:l.nodeViewProps,emits:["selected-command"],computed:{text(){return"/"+this.$props.node.attrs.command}},created(){this.$parent.$emit("selected-command",this.$props.node.attrs.command)}};var et=function(){var e=this,r=e._self._c;return r("node-view-wrapper",{staticClass:"d-d-inline-block"},[e._v(" "+e._s(e.text)+" ")])},tt=[],nt=u.n(Ze,et,tt,!1,null,null);const rt=nt.exports,it=(t,e)=>[...t.matchAll(e)].map(n=>{let i=n[2];return i.endsWith(" ")||(i+=" "),{index:n.index,text:i,match:n}}),st=S.extend({name:"slash-commands",group:"inline",inline:!0,addNodeView(){return l.VueNodeViewRenderer(rt)},parseHTML(){return[{tag:"command-component"}]},addAttributes(){return{command:{default:""},parametersExample:{default:""},description:{default:""}}},renderText({node:t}){return`/${t.attrs.command}`},renderHTML({HTMLAttributes:t}){return["command-component",c.mergeAttributes(this.options.HTMLAttributes,t)]},addInputRules(){var r;const t=(r=this.options.suggestion)==null?void 0:r.items({query:""}).map(n=>n.command),e=new RegExp(`^((?:\\/)(${t.join("|")})) $`);return[c.nodeInputRule({find:e,type:this.type,getAttributes(n){return{command:n[2]}}})]},addPasteRules(){var r;const t=(r=this.options.suggestion)==null?void 0:r.items({query:""}).map(n=>n.command),e=new RegExp(`^((?:\\/)(${t.join("|")})) ?$`,"g");return[c.nodePasteRule({find:n=>it(n,e),type:this.type,getAttributes(n){return{command:n[0].trim()}}})]}}).configure({suggestion:{char:"/",pluginKey:new g.PluginKey("slashCommandSuggestion")}}),ot={name:"MentionSuggestion",components:{DtAvatar:se.default,DtStack:y.default},props:{item:{type:Object,required:!0}},computed:{name(){return this.item.name},avatarSrc(){return this.item.avatarSrc},presence(){return this.item.presence},status(){return this.item.status},presenceText(){return this.item.presenceText},presenceFontColorClass(){return{active:"d-recipe-contact-row--active",busy:"d-recipe-contact-row--busy",away:"d-recipe-contact-row--away",offline:"d-recipe-contact-row--busy"}[this.presence]},showDetails(){return this.item.showDetails}}};var at=function(){var e=this,r=e._self._c;return r("dt-stack",{staticClass:"d-mention-suggestion__container",attrs:{direction:"row",gap:"400"}},[r("dt-avatar",{attrs:{"full-name":e.name,"image-src":e.avatarSrc,"image-alt":e.name,"show-presence":e.showDetails,presence:e.presence,size:"sm"}}),r("dt-stack",{staticClass:"d-mention-suggestion__details-container",attrs:{gap:"100"}},[r("span",{staticClass:"d-mention-suggestion__name"},[e._v(" "+e._s(e.name)+" ")]),e.showDetails?r("dt-stack",{staticClass:"d-label--sm-plain",attrs:{direction:"row",gap:"300"}},[e.presenceText?r("span",{staticClass:"d-mention-suggestion__presence",class:[e.presenceFontColorClass]},[e._v(" "+e._s(e.presenceText)+" ")]):e._e(),e.status&&e.presenceText?r("div",{staticClass:"d-mention-suggestion__divider"},[e._v(" • ")]):e._e(),e.status?r("div",{staticClass:"d-mention-suggestion__status"},[e._v(" "+e._s(e.status)+" ")]):e._e()]):e._e()],1)],1)},lt=[],ct=u.n(ot,at,lt,!1,null,"b080cd76");const dt=ct.exports,ut={allowSpaces:!0,render:()=>{let t,e,r=!1;return{onStart:n=>{t=new l.VueRenderer(x,{parent:void 0,propsData:{itemComponent:dt,itemType:"mention",...n},editor:n.editor}),n.clientRect&&(e=v("body",{getReferenceClientRect:n.clientRect,appendTo:()=>document.body,content:t.element,showOnCreate:!1,onShow:()=>{r=!0},onHidden:()=>{r=!1},interactive:!0,trigger:"manual",placement:"top-start",zIndex:650,plugins:[k]}),n.items.length>0&&(e==null||e[0].show()))},onUpdate(n){t==null||t.updateProps(n),n.items.length>0?e==null||e[0].show():e==null||e[0].hide(),n.clientRect&&(e==null||e[0].setProps({getReferenceClientRect:n.clientRect}))},onKeyDown(n){var i;if(r)return(i=t==null?void 0:t.ref)==null?void 0:i.onKeyDown(n)},onExit(){e==null||e[0].destroy(),e=null,t==null||t.destroy(),t=null}}}},mt={name:"ChannelSuggestion",components:{DtStack:y.default,DtIconHash:oe,DtIconLock:ae},props:{item:{type:Object,required:!0}},computed:{name(){return this.item.name}}};var ht=function(){var e=this,r=e._self._c;return r("dt-stack",{attrs:{direction:"row",gap:"400"}},[e.item.locked?r("dt-icon-lock",{attrs:{size:"300"}}):r("dt-icon-hash",{attrs:{size:"300"}}),r("span",[e._v(e._s(e.name))])],1)},ft=[],gt=u.n(mt,ht,ft,!1,null,null);const pt=gt.exports,_t={allowSpaces:!0,render:()=>{let t,e,r=!1;return{onStart:n=>{t=new l.VueRenderer(x,{parent:void 0,propsData:{itemComponent:pt,itemType:"channel",...n},editor:n.editor}),n.clientRect&&(e=v("body",{getReferenceClientRect:n.clientRect,appendTo:()=>document.body,content:t.element,showOnCreate:!1,onShow:()=>{r=!0},onHidden:()=>{r=!1},interactive:!0,trigger:"manual",placement:"top-start",zIndex:650,plugins:[k]}),n.items.length>0&&(e==null||e[0].show()))},onUpdate(n){t==null||t.updateProps(n),n.items.length>0?e==null||e[0].show():e==null||e[0].hide(),n.clientRect&&(e==null||e[0].setProps({getReferenceClientRect:n.clientRect}))},onKeyDown(n){var i;if(r)return(i=t==null?void 0:t.ref)==null?void 0:i.onKeyDown(n)},onExit(){e==null||e[0].destroy(),e=null,t==null||t.destroy(),t=null}}}},wt={name:"SlashCommandSuggestion",props:{item:{type:Object,required:!0}},computed:{command(){return this.item.command},description(){return this.item.description},parametersExample(){return this.item.parametersExample}}};var bt=function(){var e=this,r=e._self._c;return r("div",[r("div",{staticClass:"d-body--md-compact"},[r("span",[e._v("/"+e._s(e.command))]),e.parametersExample?r("span",[e._v(" "+e._s(e.parametersExample))]):e._e()]),r("div",{staticClass:"d-body--sm d-fc-tertiary"},[e._v(" "+e._s(e.description)+" ")])])},yt=[],vt=u.n(wt,bt,yt,!1,null,null);const xt=vt.exports,kt={allowSpaces:!0,startOfLine:!0,render:()=>{let t,e,r=!1;return{onStart:n=>{t=new l.VueRenderer(x,{parent:void 0,propsData:{itemComponent:xt,itemType:"slash-command",...n},editor:n.editor}),n.clientRect&&(e=v("body",{getReferenceClientRect:n.clientRect,appendTo:()=>document.body,content:t.element,showOnCreate:!1,onShow:()=>{r=!0},onHidden:()=>{r=!1},interactive:!0,trigger:"manual",placement:"top-start",zIndex:650,plugins:[k]}),n.items.length>0&&(e==null||e[0].show()))},onUpdate(n){t==null||t.updateProps(n),n.items.length>0?e==null||e[0].show():e==null||e[0].hide(),n.clientRect&&(e==null||e[0].setProps({getReferenceClientRect:n.clientRect}))},onKeyDown(n){var i;if(r)return(i=t==null?void 0:t.ref)==null?void 0:i.onKeyDown(n)},onExit(){e==null||e[0].destroy(),e=null,t==null||t.destroy(),t=null}}}},Ct={name:"DtRichTextEditor",components:{EditorContent:l.EditorContent,BubbleMenu:l.BubbleMenu,DtButton:ce.default,DtStack:y.default},props:{value:{type:[Object,String],default:""},editable:{type:Boolean,default:!0},preventTyping:{type:Boolean,default:!1},allowLineBreaks:{type:Boolean,default:!1},inputAriaLabel:{type:String,required:!0},inputClass:{type:String,default:""},autoFocus:{type:[Boolean,String,Number],default:!1,validator(t){return typeof t=="string"?b.RICH_TEXT_EDITOR_AUTOFOCUS_TYPES.includes(t):!0}},outputFormat:{type:String,default:"html",validator(t){return b.RICH_TEXT_EDITOR_OUTPUT_FORMATS.includes(t)}},placeholder:{type:String,default:""},link:{type:[Boolean,Object],default:!1},customLink:{type:[Boolean,Object],default:!1},mentionSuggestion:{type:Object,default:null},channelSuggestion:{type:Object,default:null},slashCommandSuggestion:{type:Object,default:null},allowBlockquote:{type:Boolean,default:!0},allowBold:{type:Boolean,default:!0},allowBulletList:{type:Boolean,default:!0},allowItalic:{type:Boolean,default:!0},allowStrike:{type:Boolean,default:!0},allowUnderline:{type:Boolean,default:!0},allowCode:{type:Boolean,default:!0},allowCodeblock:{type:Boolean,default:!0},allowInlineImages:{type:Boolean,default:!1},allowFontColor:{type:Boolean,default:!1},allowFontFamily:{type:Boolean,default:!1},additionalExtensions:{type:Array,default:()=>[]},hideLinkBubbleMenu:{type:Boolean,default:!1},useDivTags:{type:Boolean,default:!1}},emits:["input","json-input","html-input","text-input","update:value","blur","focus","enter","edit-link","selected"],data(){return{editor:null,tippyOptions:{appendTo:()=>{var t;return(t=this.$refs.editor.$el.getRootNode())==null?void 0:t.querySelector("body")},placement:"top-start"}}},computed:{editorListeners(){return{...this.$listeners,input:()=>{},focus:()=>{},blur:()=>{}}},extensions(){const t=[M,J,G,H];t.push(this.useDivTags?He:$),this.allowBlockquote&&t.push(O),this.allowBold&&t.push(V),this.allowBulletList&&(t.push(F),t.push(U.extend({renderText({node:n}){return n.textContent}})),t.push(W)),this.allowItalic&&t.push(N),this.allowStrike&&t.push(z),this.allowUnderline&&t.push(X),this.placeholder&&t.push(B.configure({placeholder:this.placeholder}));const e=this,r=c.Extension.create({addKeyboardShortcuts(){return{"Shift-Enter":({editor:n})=>e.allowLineBreaks?!1:(n.commands.first(({commands:i})=>[()=>i.newlineInCode(),()=>e.allowBulletList&&i.splitListItem("listItem"),()=>i.createParagraphNear(),()=>i.liftEmptyBlock(),()=>i.splitBlock()]),!0),Enter:()=>e.allowLineBreaks?!1:(e.$emit("enter"),!0)}}});if(t.push(r),this.link&&t.push(K.extend({inclusive:!1}).configure({HTMLAttributes:{class:"d-link d-wb-break-all"},openOnClick:!1,autolink:!0,protocols:b.RICH_TEXT_EDITOR_SUPPORTED_LINK_PROTOCOLS})),this.customLink&&t.push(this.getExtension(Me,this.customLink)),this.mentionSuggestion){const n={...this.mentionSuggestion,...ut};t.push(We.configure({suggestion:n}))}if(this.channelSuggestion){const n={...this.channelSuggestion,..._t};t.push(Qe.configure({suggestion:n}))}if(this.slashCommandSuggestion){const n={...this.slashCommandSuggestion,...kt};t.push(st.configure({suggestion:n}))}return t.push($e),t.push(Y.configure({types:["paragraph"]})),this.allowCode&&t.push(D),this.allowCodeblock&&t.push(P.extend({renderText({node:n}){return`\`\`\`
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const c=require("../../node_modules/@tiptap/vue-2.cjs"),l=require("@tiptap/core"),O=require("@tiptap/extension-blockquote"),P=require("@tiptap/extension-code-block"),D=require("@tiptap/extension-code"),M=require("@tiptap/extension-document"),$=require("@tiptap/extension-paragraph"),B=require("@tiptap/extension-placeholder"),H=require("@tiptap/extension-hard-break"),V=require("@tiptap/extension-bold"),F=require("@tiptap/extension-bullet-list"),N=require("@tiptap/extension-italic"),K=require("@tiptap/extension-link"),U=require("@tiptap/extension-list-item"),W=require("@tiptap/extension-ordered-list"),z=require("@tiptap/extension-strike"),X=require("@tiptap/extension-underline"),J=require("@tiptap/extension-text"),Y=require("@tiptap/extension-text-align"),G=require("@tiptap/extension-history"),Q=require("@tiptap/extension-text-style"),Z=require("@tiptap/extension-color"),ee=require("@tiptap/extension-font-family"),g=require("@tiptap/pm/state"),te=require("@tiptap/suggestion"),I=require("regex-combined-emojis"),u=require("../../_plugin-vue2_normalizer-e_CkxkSV.cjs"),q=require("../emoji/emoji.cjs"),f=require("../../common/emoji/index.cjs"),ne=require("@dialpad/dialtone-emojis"),re=require("../list-item/list-item.cjs"),y=require("../stack/stack.cjs"),v=require("tippy.js"),R=require("../../common/utils/index.cjs"),ie=require("@tiptap/extension-image"),S=require("@tiptap/extension-mention"),j=require("../link/link.cjs"),b=require("./rich-text-editor-constants.cjs"),se=require("../avatar/avatar.cjs"),oe=require("@dialpad/dialtone-icons/vue2/hash"),ae=require("@dialpad/dialtone-icons/vue2/lock"),ce=require("deep-equal"),le=require("../button/button.cjs"),de={name:"EmojiComponent",components:{NodeViewWrapper:c.NodeViewWrapper,DtEmoji:q.default},props:c.nodeViewProps};var ue=function(){var e=this,r=e._self._c;return r("node-view-wrapper",{staticClass:"d-d-inline-block d-va-bottom d-lh0"},[r("dt-emoji",{attrs:{size:"500",code:e.node.attrs.code}})],1)},me=[],he=u.n(de,ue,me);const fe=he.exports,ge={name:"SuggestionList",components:{DtListItem:re.default},props:{items:{type:Array,required:!0},command:{type:Function,required:!0},itemComponent:{type:Object,required:!0},itemType:{type:String,required:!0}},data(){return{selectedIndex:0}},watch:{items(){this.selectedIndex=0}},methods:{onKeyDown({event:t}){return t.key==="ArrowUp"?(this.upHandler(),!0):t.key==="ArrowDown"?(this.downHandler(),!0):t.key==="Enter"||t.key==="Tab"?(this.selectHandler(),!0):!1},upHandler(){this.selectedIndex=(this.selectedIndex+this.items.length-1)%this.items.length,this.scrollActiveElementIntoView()},downHandler(){this.selectedIndex=(this.selectedIndex+1)%this.items.length,this.scrollActiveElementIntoView()},async scrollActiveElementIntoView(){await this.$nextTick();const t=this.$refs.suggestionList.querySelector(".d-list-item--highlighted");t&&t.scrollIntoView({behaviour:"smooth",block:"center"})},selectHandler(){this.selectItem(this.selectedIndex)},selectItem(t){const e=this.items[t];switch(this.itemType){case"emoji":this.command(e);return;case"mention":this.command({name:e.name,id:e.id,avatarSrc:e.avatarSrc});break;case"channel":this.command({name:e.name,id:e.id});break;case"slash-command":this.command({command:e.command});break}}}};var pe=function(){var e=this,r=e._self._c;return r("div",{staticClass:"d-popover__dialog d-suggestion-list__container"},[r("ul",{directives:[{name:"show",rawName:"v-show",value:e.items.length,expression:"items.length"}],ref:"suggestionList",staticClass:"d-suggestion-list"},e._l(e.items,function(n,i){return r("dt-list-item",{key:n.id,class:["d-suggestion-list__item",{"d-list-item--highlighted":i===e.selectedIndex}],attrs:{"navigation-type":"arrow-keys"},on:{click:function(o){return e.selectItem(i)},keydown:function(o){return o.preventDefault(),e.onKeyDown.apply(null,arguments)}}},[r(e.itemComponent,{tag:"component",attrs:{item:n}})],1)}),1)])},_e=[],we=u.n(ge,pe,_e);const x=we.exports,be={name:"EmojiSuggestion",components:{DtEmoji:q.default,DtStack:y.default},props:{item:{type:Object,required:!0}}};var ye=function(){var e=this,r=e._self._c;return r("dt-stack",{attrs:{direction:"row",gap:"400"}},[r("dt-emoji",{attrs:{size:"200",code:e.item.code}}),e._v(" "+e._s(e.item.code)+" ")],1)},ve=[],xe=u.n(be,ye,ve);const ke=xe.exports,k={name:"hideOnEsc",defaultValue:!0,fn({hide:t}){function e(r){r.keyCode===27&&t()}return{onShow(){document.addEventListener("keydown",e)},onHide(){document.removeEventListener("keydown",e)}}}},Ce=20,Te={items:({query:t})=>{if(t.length<2)return[];const e=Object.values(ne.emojisIndexed);return t=t.toLowerCase(),e.filter(n=>[n.name,n.shortname.replaceAll(":",""),...n.keywords].some(i=>i.startsWith(t))).splice(0,Ce).map(n=>({code:n.shortname}))},command:({editor:t,range:e,props:r})=>{var o,s;const n=t.view.state.selection.$to.nodeAfter;((o=n==null?void 0:n.text)==null?void 0:o.startsWith(" "))&&(e.to+=1),t.chain().focus().insertContentAt(e,[{type:"emoji",attrs:r}]).run(),(s=window.getSelection())==null||s.collapseToEnd()},render:()=>{let t,e,r=!1;return{onStart:n=>{t=new c.VueRenderer(x,{parent:void 0,propsData:{itemComponent:ke,itemType:"emoji",...n},editor:n.editor}),n.clientRect&&(e=v("body",{getReferenceClientRect:n.clientRect,appendTo:()=>document.body,content:t.element,showOnCreate:!1,onShow:()=>{r=!0},onHidden:()=>{r=!1},interactive:!0,trigger:"manual",placement:"top-start",zIndex:650,plugins:[k]}),n.items.length>0&&(e==null||e[0].show()))},onUpdate(n){t==null||t.updateProps(n),n.items.length>0?e==null||e[0].show():e==null||e[0].hide(),e==null||e[0].setProps({getReferenceClientRect:n.clientRect})},onKeyDown(n){var i;if(r)return(i=t==null?void 0:t.ref)==null?void 0:i.onKeyDown(n)},onExit(){e==null||e[0].destroy(),e=null,t==null||t.destroy(),t=null}}}},Re=/(:\w+:)$/,Se=new RegExp(I.emojiPattern+"$"),Ee=t=>{if(t&&f.codeToEmojiData(t[0]))return{text:t[2]||t[0]}},Le=t=>[...t.matchAll(f.emojiShortCodeRegex)].filter(r=>f.codeToEmojiData(r[0])).map(r=>({index:r.index,text:r[0],match:r})),$e=l.Node.create({name:"emoji",addOptions(){return{HTMLAttributes:{}}},group:"inline",inline:!0,selectable:!1,atom:!0,addNodeView(){return c.VueNodeViewRenderer(fe)},addAttributes(){return{code:{default:null}}},parseHTML(){return[{tag:"emoji-component"}]},renderText({node:t}){return f.stringToUnicode(f.codeToEmojiData(t.attrs.code).unicode_output)},renderHTML({HTMLAttributes:t}){return["emoji-component",l.mergeAttributes(this.options.HTMLAttributes,t)]},addInputRules(){return[new l.InputRule({find:t=>{const e=t.match(Re)||t.match(Se);if(e)return Ee(e)},handler:({state:t,range:e,match:r,commands:n,chain:i,can:o})=>{const{tr:s}=t,a=e.from,d=e.to;s.replaceWith(a,d,this.type.create({code:r[0]}))}})]},addPasteRules(){return[l.nodePasteRule({find:Le,type:this.type,getAttributes(t){return{code:t[0]}}}),l.nodePasteRule({find:f.emojiRegex,type:this.type,getAttributes(t){return{code:t[0]}}})]},addProseMirrorPlugins(){return[te({char:":",pluginKey:new g.PluginKey("emoji"),editor:this.editor,...this.options.suggestion,...Te})]},addKeyboardShortcuts(){return{Backspace:()=>this.editor.commands.command(({tr:t,state:e})=>{let r=!1;const{selection:n}=e,{empty:i,anchor:o}=n;return i?(e.doc.nodesBetween(o-1,o,(s,a)=>{if(s.type.name===this.name)return r=!0,t.insertText("",a,a+s.nodeSize),!1}),r):!1})}}});function Ie(t,e,r=()=>!0){const n=[];e.lastIndex=0;let i;for(;i=e.exec(t);)r(t,i)&&n.push(i);return n}function qe(t,e){return!["#","@"].includes(t.charAt(e.index))&&!["#","@"].includes(t.charAt(e.index-1))}function je(t){const e=new RegExp("(?:"+[`[!?.,:;'"]`,"(?:&|&)(?:lt|gt|quot|apos|raquo|laquo|rsaquo|lsaquo);)+$"].join("|"),"g");return t.replace(e,"")}function Ae(t,e){const r=t.slice(0,e+1).search(/\S+\s*$/),n=t.slice(e).search(/\s/);if(n<0){const i=t.slice(r);return{text:i,from:r,to:r+i.length}}return{text:t.slice(r,n+e),from:r,to:n+e}}function T(t,e,r,n){const i=Ae(t,e);if(n.lastIndex=0,!n.test(i.text))return i;const o=r==="left"?i.from-1:i.to+1;return o<=0||o>=t.length||o===e?i:T(t,o,r,n)}function Oe(t,e,r,n){const i=Math.max(t.from-1,0),o=Math.min(t.to+1,e.content.size),s=l.getMarksBetween(i,o,e);for(const a of s)a.mark.type===n&&r.removeMark(a.from,a.to,n)}const E=R.getPhoneNumberRegex(1,15);function L(t,e,r,n,i,o){if(!t)return;let s=r-e-1;s=s<0?0:s;const a=n-e,d=T(t,s,"left",E),m=T(t,a,"right",E),h=t.slice(d.from,m.to);Ie(h,R.linkRegex,qe).forEach(C=>{const p=je(C[0]),w=e+d.from+C.index+1,A=w+p.length;i.addMark(w,A,o.create())})}function Pe(t){let e=!1;return new g.Plugin({key:new g.PluginKey("autolink"),appendTransaction:(r,n,i)=>{const o=r.some(h=>h.docChanged)&&!n.doc.eq(i.doc);if(e&&!o)return;const{tr:s}=i,{textContent:a}=i.doc;e||L(a,0,0,a.length,s,t.type),e=!0;const d=l.combineTransactionSteps(n.doc,[...r]);return l.getChangedRanges(d).forEach(({oldRange:h,newRange:_})=>{Oe(_,i.doc,s,t.type),l.findChildrenInRange(i.doc,_,p=>p.isTextblock).forEach(({node:p,pos:w})=>{L(p.textContent,w,h.from,_.to,s,t.type)})}),s}})}const De={class:"d-link d-c-text d-d-inline-block d-wb-break-all",rel:"noopener noreferrer nofollow"},Me=l.Mark.create({name:"CustomLink",renderHTML({HTMLAttributes:t}){return["a",l.mergeAttributes(this.options.HTMLAttributes,t,De)]},renderText({node:t}){return t.attrs.text},addProseMirrorPlugins(){return[Pe({type:this.type})]}}),Be=ie.extend({name:"ConfigurableImage",addAttributes(){return{src:{default:""},alt:{default:void 0},title:{default:void 0},width:{default:void 0},height:{default:void 0},style:{default:void 0}}}}).configure({inline:!0,allowBase64:!0}),He=$.extend({parseHTML(){return[{tag:"div"}]},renderHTML({HTMLAttributes:t}){return["div",l.mergeAttributes(this.options.HTMLAttributes,t),0]}}),Ve={name:"MentionComponent",components:{NodeViewWrapper:c.NodeViewWrapper,DtLink:j.default},props:c.nodeViewProps,computed:{text(){return"@"+this.$props.node.attrs.name}}};var Fe=function(){var e=this,r=e._self._c;return r("node-view-wrapper",{staticClass:"d-d-inline-block"},[r("dt-link",{attrs:{kind:"mention"}},[e._v(" "+e._s(e.text)+" ")])],1)},Ne=[],Ke=u.n(Ve,Fe,Ne);const Ue=Ke.exports,We=S.extend({addNodeView(){return c.VueNodeViewRenderer(Ue)},parseHTML(){return[{tag:"mention-component"}]},addAttributes(){return{name:{default:""},avatarSrc:{default:""},id:{default:""}}},renderText({node:t}){return`@${t.attrs.id}`},renderHTML({HTMLAttributes:t}){return["mention-component",l.mergeAttributes(this.options.HTMLAttributes,t)]}}).configure({suggestion:{char:"@",pluginKey:new g.PluginKey("mentionSuggestion")}}),ze={name:"ChannelComponent",components:{NodeViewWrapper:c.NodeViewWrapper,DtLink:j.default},props:c.nodeViewProps,computed:{text(){return"#"+this.$props.node.attrs.name}}};var Xe=function(){var e=this,r=e._self._c;return r("node-view-wrapper",{staticClass:"d-d-inline-block"},[r("dt-link",{attrs:{kind:"mention"}},[e._v(" "+e._s(e.text)+" ")])],1)},Je=[],Ye=u.n(ze,Xe,Je);const Ge=Ye.exports,Qe=S.extend({name:"channel",addNodeView(){return c.VueNodeViewRenderer(Ge)},parseHTML(){return[{tag:"channel-component"}]},addAttributes(){return{name:{default:""},id:{default:""},locked:{default:!1}}},renderText({node:t}){return`#${t.attrs.id}`},renderHTML({HTMLAttributes:t}){return["channel-component",l.mergeAttributes(this.options.HTMLAttributes,t)]}}).configure({suggestion:{char:"#",pluginKey:new g.PluginKey("channelSuggestion")}}),Ze={name:"SlashCommandsComponent",components:{NodeViewWrapper:c.NodeViewWrapper},props:c.nodeViewProps,emits:["selected-command"],computed:{text(){return"/"+this.$props.node.attrs.command}},created(){this.$parent.$emit("selected-command",this.$props.node.attrs.command)}};var et=function(){var e=this,r=e._self._c;return r("node-view-wrapper",{staticClass:"d-d-inline-block"},[e._v(" "+e._s(e.text)+" ")])},tt=[],nt=u.n(Ze,et,tt);const rt=nt.exports,it=(t,e)=>[...t.matchAll(e)].map(n=>{let i=n[2];return i.endsWith(" ")||(i+=" "),{index:n.index,text:i,match:n}}),st=S.extend({name:"slash-commands",group:"inline",inline:!0,addNodeView(){return c.VueNodeViewRenderer(rt)},parseHTML(){return[{tag:"command-component"}]},addAttributes(){return{command:{default:""},parametersExample:{default:""},description:{default:""}}},renderText({node:t}){return`/${t.attrs.command}`},renderHTML({HTMLAttributes:t}){return["command-component",l.mergeAttributes(this.options.HTMLAttributes,t)]},addInputRules(){var r;const t=(r=this.options.suggestion)==null?void 0:r.items({query:""}).map(n=>n.command),e=new RegExp(`^((?:\\/)(${t.join("|")})) $`);return[l.nodeInputRule({find:e,type:this.type,getAttributes(n){return{command:n[2]}}})]},addPasteRules(){var r;const t=(r=this.options.suggestion)==null?void 0:r.items({query:""}).map(n=>n.command),e=new RegExp(`^((?:\\/)(${t.join("|")})) ?$`,"g");return[l.nodePasteRule({find:n=>it(n,e),type:this.type,getAttributes(n){return{command:n[0].trim()}}})]}}).configure({suggestion:{char:"/",pluginKey:new g.PluginKey("slashCommandSuggestion")}}),ot={name:"MentionSuggestion",components:{DtAvatar:se.default,DtStack:y.default},props:{item:{type:Object,required:!0}},computed:{name(){return this.item.name},avatarSrc(){return this.item.avatarSrc},presence(){return this.item.presence},status(){return this.item.status},presenceText(){return this.item.presenceText},presenceFontColorClass(){return{active:"d-recipe-contact-row--active",busy:"d-recipe-contact-row--busy",away:"d-recipe-contact-row--away",offline:"d-recipe-contact-row--busy"}[this.presence]},showDetails(){return this.item.showDetails}}};var at=function(){var e=this,r=e._self._c;return r("dt-stack",{staticClass:"d-mention-suggestion__container",attrs:{direction:"row",gap:"400"}},[r("dt-avatar",{attrs:{"full-name":e.name,"image-src":e.avatarSrc,"image-alt":e.name,"show-presence":e.showDetails,presence:e.presence,size:"sm"}}),r("dt-stack",{staticClass:"d-mention-suggestion__details-container",attrs:{gap:"100"}},[r("span",{staticClass:"d-mention-suggestion__name"},[e._v(" "+e._s(e.name)+" ")]),e.showDetails?r("dt-stack",{staticClass:"d-label--sm-plain",attrs:{direction:"row",gap:"300"}},[e.presenceText?r("span",{staticClass:"d-mention-suggestion__presence",class:[e.presenceFontColorClass]},[e._v(" "+e._s(e.presenceText)+" ")]):e._e(),e.status&&e.presenceText?r("div",{staticClass:"d-mention-suggestion__divider"},[e._v(" • ")]):e._e(),e.status?r("div",{staticClass:"d-mention-suggestion__status"},[e._v(" "+e._s(e.status)+" ")]):e._e()]):e._e()],1)],1)},ct=[],lt=u.n(ot,at,ct);const dt=lt.exports,ut={allowSpaces:!0,render:()=>{let t,e,r=!1;return{onStart:n=>{t=new c.VueRenderer(x,{parent:void 0,propsData:{itemComponent:dt,itemType:"mention",...n},editor:n.editor}),n.clientRect&&(e=v("body",{getReferenceClientRect:n.clientRect,appendTo:()=>document.body,content:t.element,showOnCreate:!1,onShow:()=>{r=!0},onHidden:()=>{r=!1},interactive:!0,trigger:"manual",placement:"top-start",zIndex:650,plugins:[k]}),n.items.length>0&&(e==null||e[0].show()))},onUpdate(n){t==null||t.updateProps(n),n.items.length>0?e==null||e[0].show():e==null||e[0].hide(),n.clientRect&&(e==null||e[0].setProps({getReferenceClientRect:n.clientRect}))},onKeyDown(n){var i;if(r)return(i=t==null?void 0:t.ref)==null?void 0:i.onKeyDown(n)},onExit(){e==null||e[0].destroy(),e=null,t==null||t.destroy(),t=null}}}},mt={name:"ChannelSuggestion",components:{DtStack:y.default,DtIconHash:oe,DtIconLock:ae},props:{item:{type:Object,required:!0}},computed:{name(){return this.item.name}}};var ht=function(){var e=this,r=e._self._c;return r("dt-stack",{attrs:{direction:"row",gap:"400"}},[e.item.locked?r("dt-icon-lock",{attrs:{size:"300"}}):r("dt-icon-hash",{attrs:{size:"300"}}),r("span",[e._v(e._s(e.name))])],1)},ft=[],gt=u.n(mt,ht,ft);const pt=gt.exports,_t={allowSpaces:!0,render:()=>{let t,e,r=!1;return{onStart:n=>{t=new c.VueRenderer(x,{parent:void 0,propsData:{itemComponent:pt,itemType:"channel",...n},editor:n.editor}),n.clientRect&&(e=v("body",{getReferenceClientRect:n.clientRect,appendTo:()=>document.body,content:t.element,showOnCreate:!1,onShow:()=>{r=!0},onHidden:()=>{r=!1},interactive:!0,trigger:"manual",placement:"top-start",zIndex:650,plugins:[k]}),n.items.length>0&&(e==null||e[0].show()))},onUpdate(n){t==null||t.updateProps(n),n.items.length>0?e==null||e[0].show():e==null||e[0].hide(),n.clientRect&&(e==null||e[0].setProps({getReferenceClientRect:n.clientRect}))},onKeyDown(n){var i;if(r)return(i=t==null?void 0:t.ref)==null?void 0:i.onKeyDown(n)},onExit(){e==null||e[0].destroy(),e=null,t==null||t.destroy(),t=null}}}},wt={name:"SlashCommandSuggestion",props:{item:{type:Object,required:!0}},computed:{command(){return this.item.command},description(){return this.item.description},parametersExample(){return this.item.parametersExample}}};var bt=function(){var e=this,r=e._self._c;return r("div",[r("div",{staticClass:"d-body--md-compact"},[r("span",[e._v("/"+e._s(e.command))]),e.parametersExample?r("span",[e._v(" "+e._s(e.parametersExample))]):e._e()]),r("div",{staticClass:"d-body--sm d-fc-tertiary"},[e._v(" "+e._s(e.description)+" ")])])},yt=[],vt=u.n(wt,bt,yt);const xt=vt.exports,kt={allowSpaces:!0,startOfLine:!0,render:()=>{let t,e,r=!1;return{onStart:n=>{t=new c.VueRenderer(x,{parent:void 0,propsData:{itemComponent:xt,itemType:"slash-command",...n},editor:n.editor}),n.clientRect&&(e=v("body",{getReferenceClientRect:n.clientRect,appendTo:()=>document.body,content:t.element,showOnCreate:!1,onShow:()=>{r=!0},onHidden:()=>{r=!1},interactive:!0,trigger:"manual",placement:"top-start",zIndex:650,plugins:[k]}),n.items.length>0&&(e==null||e[0].show()))},onUpdate(n){t==null||t.updateProps(n),n.items.length>0?e==null||e[0].show():e==null||e[0].hide(),n.clientRect&&(e==null||e[0].setProps({getReferenceClientRect:n.clientRect}))},onKeyDown(n){var i;if(r)return(i=t==null?void 0:t.ref)==null?void 0:i.onKeyDown(n)},onExit(){e==null||e[0].destroy(),e=null,t==null||t.destroy(),t=null}}}},Ct={name:"DtRichTextEditor",components:{EditorContent:c.EditorContent,BubbleMenu:c.BubbleMenu,DtButton:le.default,DtStack:y.default},props:{value:{type:[Object,String],default:""},editable:{type:Boolean,default:!0},preventTyping:{type:Boolean,default:!1},allowLineBreaks:{type:Boolean,default:!1},inputAriaLabel:{type:String,required:!0},inputClass:{type:String,default:""},autoFocus:{type:[Boolean,String,Number],default:!1,validator(t){return typeof t=="string"?b.RICH_TEXT_EDITOR_AUTOFOCUS_TYPES.includes(t):!0}},outputFormat:{type:String,default:"html",validator(t){return b.RICH_TEXT_EDITOR_OUTPUT_FORMATS.includes(t)}},placeholder:{type:String,default:""},link:{type:[Boolean,Object],default:!1},customLink:{type:[Boolean,Object],default:!1},mentionSuggestion:{type:Object,default:null},channelSuggestion:{type:Object,default:null},slashCommandSuggestion:{type:Object,default:null},allowBlockquote:{type:Boolean,default:!0},allowBold:{type:Boolean,default:!0},allowBulletList:{type:Boolean,default:!0},allowItalic:{type:Boolean,default:!0},allowStrike:{type:Boolean,default:!0},allowUnderline:{type:Boolean,default:!0},allowCode:{type:Boolean,default:!0},allowCodeblock:{type:Boolean,default:!0},allowInlineImages:{type:Boolean,default:!1},allowFontColor:{type:Boolean,default:!1},allowFontFamily:{type:Boolean,default:!1},additionalExtensions:{type:Array,default:()=>[]},hideLinkBubbleMenu:{type:Boolean,default:!1},useDivTags:{type:Boolean,default:!1}},emits:["input","json-input","html-input","text-input","update:value","blur","focus","enter","edit-link","selected"],data(){return{editor:null,tippyOptions:{appendTo:()=>{var t;return(t=this.$refs.editor.$el.getRootNode())==null?void 0:t.querySelector("body")},placement:"top-start"}}},computed:{editorListeners(){return{...this.$listeners,input:()=>{},focus:()=>{},blur:()=>{}}},extensions(){const t=[M,J,G,H];t.push(this.useDivTags?He:$),this.allowBlockquote&&t.push(O),this.allowBold&&t.push(V),this.allowBulletList&&(t.push(F),t.push(U.extend({renderText({node:n}){return n.textContent}})),t.push(W)),this.allowItalic&&t.push(N),this.allowStrike&&t.push(z),this.allowUnderline&&t.push(X),this.placeholder&&t.push(B.configure({placeholder:this.placeholder}));const e=this,r=l.Extension.create({addKeyboardShortcuts(){return{"Shift-Enter":({editor:n})=>e.allowLineBreaks?!1:(n.commands.first(({commands:i})=>[()=>i.newlineInCode(),()=>e.allowBulletList&&i.splitListItem("listItem"),()=>i.createParagraphNear(),()=>i.liftEmptyBlock(),()=>i.splitBlock()]),!0),Enter:()=>e.allowLineBreaks?!1:(e.$emit("enter"),!0)}}});if(t.push(r),this.link&&t.push(K.extend({inclusive:!1}).configure({HTMLAttributes:{class:"d-link d-wb-break-all"},openOnClick:!1,autolink:!0,protocols:b.RICH_TEXT_EDITOR_SUPPORTED_LINK_PROTOCOLS})),this.customLink&&t.push(this.getExtension(Me,this.customLink)),this.mentionSuggestion){const n={...this.mentionSuggestion,...ut};t.push(We.configure({suggestion:n}))}if(this.channelSuggestion){const n={...this.channelSuggestion,..._t};t.push(Qe.configure({suggestion:n}))}if(this.slashCommandSuggestion){const n={...this.slashCommandSuggestion,...kt};t.push(st.configure({suggestion:n}))}return t.push($e),t.push(Y.configure({types:["paragraph"]})),this.allowCode&&t.push(D),this.allowCodeblock&&t.push(P.extend({renderText({node:n}){return`\`\`\`
|
|
2
2
|
${n.textContent}
|
|
3
|
-
\`\`\``}}).configure({HTMLAttributes:{class:"d-rich-text-editor__code-block"}})),this.allowInlineImages&&t.push(Be),(this.allowFontFamily||this.allowFontColor)&&(t.push(Q),this.allowFontColor&&t.push(Z),this.allowFontFamily&&t.push(ee)),this.additionalExtensions.length&&t.push(...this.additionalExtensions),t},inputAttrs(){const t={"aria-label":this.inputAriaLabel,"aria-multiline":!0,role:"textbox"};return this.editable||(t["aria-readonly"]=!0),t}},watch:{editable(t){this.editor.setEditable(t),this.updateEditorAttributes({"aria-readonly":!t})},inputClass(t){this.updateEditorAttributes({class:t})},inputAriaLabel(t){this.updateEditorAttributes({"aria-label":t})},extensions(){this.destroyEditor(),this.createEditor()},value(t){this.processValue(t)}},created(){this.createEditor()},beforeDestroy(){this.destroyEditor()},mounted(){R.warnIfUnmounted(this.$el,this.$options.name),this.processValue(this.value,!1)},methods:{createEditor(){this.editor=new
|
|
3
|
+
\`\`\``}}).configure({HTMLAttributes:{class:"d-rich-text-editor__code-block"}})),this.allowInlineImages&&t.push(Be),(this.allowFontFamily||this.allowFontColor)&&(t.push(Q),this.allowFontColor&&t.push(Z),this.allowFontFamily&&t.push(ee)),this.additionalExtensions.length&&t.push(...this.additionalExtensions),t},inputAttrs(){const t={"aria-label":this.inputAriaLabel,"aria-multiline":!0,role:"textbox"};return this.editable||(t["aria-readonly"]=!0),t}},watch:{editable(t){this.editor.setEditable(t),this.updateEditorAttributes({"aria-readonly":!t})},inputClass(t){this.updateEditorAttributes({class:t})},inputAriaLabel(t){this.updateEditorAttributes({"aria-label":t})},extensions(){this.destroyEditor(),this.createEditor()},value(t){this.processValue(t)}},created(){this.createEditor()},beforeDestroy(){this.destroyEditor()},mounted(){R.warnIfUnmounted(this.$el,this.$options.name),this.processValue(this.value,!1)},methods:{createEditor(){this.editor=new c.Editor({autofocus:this.autoFocus,content:this.value,editable:this.editable,extensions:this.extensions,editorProps:{attributes:{...this.inputAttrs,class:this.inputClass},handlePaste:(t,e)=>{if(!this.link&&!this.customLink){const r=/^https?:\/\//;if(!(e!=null&&e.clipboardData))return!1;const n=e.clipboardData.getData("text");if(!r.test(n)||!e.clipboardData.getData("text/html"))return!1;const i=n.replace(/\n/g,"<br>").replace(/ {2}/g," ");return this.editor.chain().focus().insertContent(i).run(),!0}return!1},transformPastedHTML(t){return t.replace(/(<\/\w+>)((<br \/>)+)/g,"$2$3$1")}}}),this.addEditorListeners()},bubbleMenuShouldShow({editor:t,view:e,state:r,oldState:n,from:i,to:o}){return t.isActive("link")},getSelectedLinkText(t){var a,d,m;const{view:e,state:r}=t,{from:n,to:i}=e.state.selection,o=r.doc.textBetween(n,i,""),s=this.editor.state.doc.nodeAt(n);return s&&((m=(d=(a=s.marks)==null?void 0:a.at(0))==null?void 0:d.type)==null?void 0:m.name)==="link"?s.textContent:o},editLink(){const t=this.getSelectedLinkText(this.editor),e={href:this.editor.getAttributes("link").href,text:t};this.$emit("edit-link",e)},removeLink(){var t,e,r,n;(n=(r=(e=(t=this.editor)==null?void 0:t.chain())==null?void 0:e.focus())==null?void 0:r.unsetLink())==null||n.run()},openLink(){var e,r;(r=(e=this.editor)==null?void 0:e.chain())==null||r.focus();const t=this.editor.getAttributes("link").href;window.open(t,"_blank")},setLink(t,e,r,n=b.RICH_TEXT_EDITOR_SUPPORTED_LINK_PROTOCOLS,i){var a,d,m;if(!t){this.removeLink();return}n.find(h=>h.test(t))||(t=`${i}${t}`),this.editor.chain().focus().extendMarkRange("link").run();const s=(m=(d=(a=this.editor)==null?void 0:a.view)==null?void 0:d.state)==null?void 0:m.selection;this.editor.chain().focus().insertContent(e).setTextSelection({from:s.from,to:s.from+e.length}).setLink({href:t,class:r.class}).run()},processValue(t,e=!0){const r=this.getOutput();if(!(e&&ce(t,r))){if(typeof t=="string"&&this.outputFormat==="text"){const n=new RegExp(`(${I.emojiPattern})`,"g");t=t==null?void 0:t.replace(n,'<emoji-component code="$1"></emoji-component>')}this.editor.commands.setContent(t,!1)}},destroyEditor(){this.editor.destroy()},triggerInputChangeEvents(){const t=this.getOutput();this.$emit("input",t),this.$emit("update:value",t);const e=this.editor.getJSON();this.$emit("json-input",e);const r=this.editor.getHTML();this.$emit("html-input",r);const n=this.editor.getText({blockSeparator:`
|
|
4
4
|
`});this.$emit("text-input",n)},addEditorListeners(){this.editor.on("create",()=>{this.triggerInputChangeEvents()}),this.editor.on("update",()=>{var t,e;if(this.preventTyping&&((e=(t=this.editor.view)==null?void 0:t.input)==null?void 0:e.lastKeyCode)!==8){this.editor.commands.setContent(this.value,!1);return}this.triggerInputChangeEvents()}),this.editor.on("selectionUpdate",({editor:t})=>{this.$emit("selected",this.getSelectedLinkText(t))}),this.editor.on("focus",({event:t})=>{this.$emit("focus",t)}),this.editor.on("blur",({event:t})=>{this.$emit("blur",t)})},getOutput(){switch(this.outputFormat){case"json":return this.editor.getJSON();case"html":return this.editor.getHTML();case"text":default:return this.editor.getText({blockSeparator:`
|
|
5
|
-
`})}},getExtension(t,e){var r;return typeof e=="boolean"?t:(r=t.configure)==null?void 0:r.call(t,e)},updateEditorAttributes(t){this.editor.setOptions({editorProps:{attributes:{...this.inputAttrs,class:this.inputClass,...t}}})},focusEditor(){this.editor.commands.focus()}}};var Tt=function(){var e=this,r=e._self._c;return r("div",[e.editor&&e.link&&!e.hideLinkBubbleMenu?r("bubble-menu",{staticStyle:{visibility:"visible"},attrs:{editor:e.editor,"should-show":e.bubbleMenuShouldShow,"tippy-options":e.tippyOptions}},[r("div",{staticClass:"d-popover__dialog"},[r("dt-stack",{staticClass:"d-rich-text-editor-bubble-menu__button-stack",attrs:{direction:"row",gap:"0"}},[r("dt-button",{attrs:{kind:"muted",importance:"clear"},on:{click:e.editLink}},[e._v(" Edit ")]),r("dt-button",{attrs:{kind:"muted",importance:"clear"},on:{click:e.openLink}},[e._v(" Open link ")]),r("dt-button",{attrs:{kind:"danger",importance:"clear"},on:{click:e.removeLink}},[e._v(" Remove ")])],1)],1)]):e._e(),r("editor-content",e._g({ref:"editor",staticClass:"d-rich-text-editor",attrs:{editor:e.editor,"data-qa":"dt-rich-text-editor"}},e.editorListeners))],1)},Rt=[],St=u.n(Ct,Tt,Rt
|
|
5
|
+
`})}},getExtension(t,e){var r;return typeof e=="boolean"?t:(r=t.configure)==null?void 0:r.call(t,e)},updateEditorAttributes(t){this.editor.setOptions({editorProps:{attributes:{...this.inputAttrs,class:this.inputClass,...t}}})},focusEditor(){this.editor.commands.focus()}}};var Tt=function(){var e=this,r=e._self._c;return r("div",[e.editor&&e.link&&!e.hideLinkBubbleMenu?r("bubble-menu",{staticStyle:{visibility:"visible"},attrs:{editor:e.editor,"should-show":e.bubbleMenuShouldShow,"tippy-options":e.tippyOptions}},[r("div",{staticClass:"d-popover__dialog"},[r("dt-stack",{staticClass:"d-rich-text-editor-bubble-menu__button-stack",attrs:{direction:"row",gap:"0"}},[r("dt-button",{attrs:{kind:"muted",importance:"clear"},on:{click:e.editLink}},[e._v(" Edit ")]),r("dt-button",{attrs:{kind:"muted",importance:"clear"},on:{click:e.openLink}},[e._v(" Open link ")]),r("dt-button",{attrs:{kind:"danger",importance:"clear"},on:{click:e.removeLink}},[e._v(" Remove ")])],1)],1)]):e._e(),r("editor-content",e._g({ref:"editor",staticClass:"d-rich-text-editor",attrs:{editor:e.editor,"data-qa":"dt-rich-text-editor"}},e.editorListeners))],1)},Rt=[],St=u.n(Ct,Tt,Rt);const Et=St.exports;exports.default=Et;
|
|
6
6
|
//# sourceMappingURL=rich-text-editor.cjs.map
|