@dialpad/dialtone 9.70.0 → 9.71.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/css/dialtone-default-theme.css +4 -4
- package/dist/css/dialtone-default-theme.min.css +1 -1
- package/dist/css/tokens/tokens-dp-dark.css +3 -3
- package/dist/css/tokens/tokens-dp-light.css +4 -4
- package/dist/css/tokens/tokens-expressive-dark.css +3 -3
- package/dist/css/tokens/tokens-expressive-light.css +4 -4
- package/dist/css/tokens/tokens-expressive-sm-dark.css +3 -3
- package/dist/css/tokens/tokens-expressive-sm-light.css +4 -4
- package/dist/css/tokens/tokens-tmo-dark.css +3 -3
- package/dist/css/tokens/tokens-tmo-light.css +4 -4
- package/dist/tokens/css/tokens-dp-dark.css +3 -3
- package/dist/tokens/css/tokens-dp-light.css +4 -4
- package/dist/tokens/css/tokens-expressive-dark.css +3 -3
- package/dist/tokens/css/tokens-expressive-light.css +4 -4
- package/dist/tokens/css/tokens-expressive-sm-dark.css +3 -3
- package/dist/tokens/css/tokens-expressive-sm-light.css +4 -4
- package/dist/tokens/css/tokens-tmo-dark.css +3 -3
- package/dist/tokens/css/tokens-tmo-light.css +4 -4
- package/dist/tokens/doc.json +11658 -11658
- package/dist/tokens/less/tokens-dp-dark.less +2 -2
- package/dist/tokens/less/tokens-dp-light.less +2 -2
- package/dist/tokens/less/tokens-expressive-dark.less +2 -2
- package/dist/tokens/less/tokens-expressive-light.less +2 -2
- package/dist/tokens/less/tokens-expressive-sm-dark.less +2 -2
- package/dist/tokens/less/tokens-expressive-sm-light.less +2 -2
- package/dist/tokens/less/tokens-tmo-dark.less +2 -2
- package/dist/tokens/less/tokens-tmo-light.less +2 -2
- package/dist/tokens/themes/dp-dark.cjs +1 -1
- package/dist/tokens/themes/dp-dark.js +1 -1
- package/dist/tokens/themes/dp-light.cjs +1 -1
- package/dist/tokens/themes/dp-light.js +1 -1
- package/dist/tokens/themes/expressive-dark.cjs +1 -1
- package/dist/tokens/themes/expressive-dark.js +1 -1
- package/dist/tokens/themes/expressive-light.cjs +1 -1
- package/dist/tokens/themes/expressive-light.js +1 -1
- package/dist/tokens/themes/expressive-sm-dark.cjs +1 -1
- package/dist/tokens/themes/expressive-sm-dark.js +1 -1
- package/dist/tokens/themes/expressive-sm-light.cjs +1 -1
- package/dist/tokens/themes/expressive-sm-light.js +1 -1
- package/dist/tokens/themes/tmo-dark.cjs +1 -1
- package/dist/tokens/themes/tmo-dark.js +1 -1
- package/dist/tokens/themes/tmo-light.cjs +1 -1
- package/dist/tokens/themes/tmo-light.js +1 -1
- package/dist/tokens/tokens-dp-dark.json +1 -1
- package/dist/tokens/tokens-dp-light.json +2 -2
- package/dist/tokens/tokens-expressive-dark.json +1 -1
- package/dist/tokens/tokens-expressive-light.json +2 -2
- package/dist/tokens/tokens-expressive-sm-dark.json +1 -1
- package/dist/tokens/tokens-expressive-sm-light.json +2 -2
- package/dist/tokens/tokens-tmo-dark.json +1 -1
- package/dist/tokens/tokens-tmo-light.json +2 -2
- package/dist/vue3/chunks/{dropdown-oA-_Gotg.js → dropdown-h2VaPT4B.js} +2 -2
- package/dist/vue3/chunks/{dropdown-oA-_Gotg.js.map → dropdown-h2VaPT4B.js.map} +1 -1
- package/dist/vue3/chunks/{dropdown-p-Azgwov.js → dropdown-yF5Kg42u.js} +2 -2
- package/dist/vue3/chunks/{dropdown-p-Azgwov.js.map → dropdown-yF5Kg42u.js.map} +1 -1
- package/dist/vue3/chunks/{notice_action-p-ePanW_.js → notice_action-5nPX2mSu.js} +6 -8
- package/dist/vue3/chunks/notice_action-5nPX2mSu.js.map +1 -0
- package/dist/vue3/chunks/{notice_action-WTucGhvr.js → notice_action-i55KZMfG.js} +6 -8
- package/dist/vue3/chunks/notice_action-i55KZMfG.js.map +1 -0
- package/dist/vue3/chunks/{sr_only_close_button-xGrHFjwA.js → sr_only_close_button-Gl43uI6m.js} +5 -5
- package/dist/vue3/chunks/sr_only_close_button-Gl43uI6m.js.map +1 -0
- package/dist/vue3/chunks/{sr_only_close_button-3EdsV-dH.js → sr_only_close_button-q23hJuAf.js} +5 -5
- package/dist/vue3/chunks/sr_only_close_button-q23hJuAf.js.map +1 -0
- package/dist/vue3/component-documentation.json +1 -1
- package/dist/vue3/dialtone-vue.cjs +4 -4
- package/dist/vue3/dialtone-vue.js +4 -4
- package/dist/vue3/lib/attachment-carousel.cjs +10 -20
- package/dist/vue3/lib/attachment-carousel.cjs.map +1 -1
- package/dist/vue3/lib/attachment-carousel.js +10 -20
- package/dist/vue3/lib/attachment-carousel.js.map +1 -1
- package/dist/vue3/lib/avatar.cjs +31 -45
- package/dist/vue3/lib/avatar.cjs.map +1 -1
- package/dist/vue3/lib/avatar.js +33 -47
- package/dist/vue3/lib/avatar.js.map +1 -1
- package/dist/vue3/lib/banner.cjs +5 -5
- package/dist/vue3/lib/banner.js +5 -5
- package/dist/vue3/lib/callbar-button-with-popover.cjs +5 -9
- package/dist/vue3/lib/callbar-button-with-popover.cjs.map +1 -1
- package/dist/vue3/lib/callbar-button-with-popover.js +5 -9
- package/dist/vue3/lib/callbar-button-with-popover.js.map +1 -1
- package/dist/vue3/lib/callbox.cjs +14 -6
- package/dist/vue3/lib/callbox.cjs.map +1 -1
- package/dist/vue3/lib/callbox.js +15 -7
- package/dist/vue3/lib/callbox.js.map +1 -1
- package/dist/vue3/lib/chip.cjs +4 -10
- package/dist/vue3/lib/chip.cjs.map +1 -1
- package/dist/vue3/lib/chip.js +4 -10
- package/dist/vue3/lib/chip.js.map +1 -1
- package/dist/vue3/lib/collapsible.cjs +12 -9
- package/dist/vue3/lib/collapsible.cjs.map +1 -1
- package/dist/vue3/lib/collapsible.js +12 -9
- package/dist/vue3/lib/collapsible.js.map +1 -1
- package/dist/vue3/lib/combobox-multi-select.cjs +2 -5
- package/dist/vue3/lib/combobox-multi-select.cjs.map +1 -1
- package/dist/vue3/lib/combobox-multi-select.js +2 -5
- package/dist/vue3/lib/combobox-multi-select.js.map +1 -1
- package/dist/vue3/lib/combobox-with-popover.cjs +2 -5
- package/dist/vue3/lib/combobox-with-popover.cjs.map +1 -1
- package/dist/vue3/lib/combobox-with-popover.js +2 -5
- package/dist/vue3/lib/combobox-with-popover.js.map +1 -1
- package/dist/vue3/lib/combobox.cjs +1 -4
- package/dist/vue3/lib/combobox.cjs.map +1 -1
- package/dist/vue3/lib/combobox.js +1 -4
- package/dist/vue3/lib/combobox.js.map +1 -1
- package/dist/vue3/lib/contact-info.cjs +28 -10
- package/dist/vue3/lib/contact-info.cjs.map +1 -1
- package/dist/vue3/lib/contact-info.js +29 -11
- package/dist/vue3/lib/contact-info.js.map +1 -1
- package/dist/vue3/lib/contact-row.cjs +14 -9
- package/dist/vue3/lib/contact-row.cjs.map +1 -1
- package/dist/vue3/lib/contact-row.js +15 -10
- package/dist/vue3/lib/contact-row.js.map +1 -1
- package/dist/vue3/lib/datepicker.cjs +5 -20
- package/dist/vue3/lib/datepicker.cjs.map +1 -1
- package/dist/vue3/lib/datepicker.js +5 -20
- package/dist/vue3/lib/datepicker.js.map +1 -1
- package/dist/vue3/lib/dropdown.cjs +2 -5
- package/dist/vue3/lib/dropdown.cjs.map +1 -1
- package/dist/vue3/lib/dropdown.js +2 -5
- package/dist/vue3/lib/dropdown.js.map +1 -1
- package/dist/vue3/lib/editor.cjs +2 -2
- package/dist/vue3/lib/editor.js +2 -2
- package/dist/vue3/lib/emoji-picker.cjs +5 -11
- package/dist/vue3/lib/emoji-picker.cjs.map +1 -1
- package/dist/vue3/lib/emoji-picker.js +5 -11
- package/dist/vue3/lib/emoji-picker.js.map +1 -1
- package/dist/vue3/lib/feed-item-row.cjs +16 -10
- package/dist/vue3/lib/feed-item-row.cjs.map +1 -1
- package/dist/vue3/lib/feed-item-row.js +17 -11
- package/dist/vue3/lib/feed-item-row.js.map +1 -1
- package/dist/vue3/lib/general-row.cjs +12 -18
- package/dist/vue3/lib/general-row.cjs.map +1 -1
- package/dist/vue3/lib/general-row.js +12 -18
- package/dist/vue3/lib/general-row.js.map +1 -1
- package/dist/vue3/lib/group-row.cjs +7 -10
- package/dist/vue3/lib/group-row.cjs.map +1 -1
- package/dist/vue3/lib/group-row.js +7 -10
- package/dist/vue3/lib/group-row.js.map +1 -1
- package/dist/vue3/lib/grouped-chip.cjs +1 -4
- package/dist/vue3/lib/grouped-chip.cjs.map +1 -1
- package/dist/vue3/lib/grouped-chip.js +1 -4
- package/dist/vue3/lib/grouped-chip.js.map +1 -1
- package/dist/vue3/lib/hovercard.cjs +2 -5
- package/dist/vue3/lib/hovercard.cjs.map +1 -1
- package/dist/vue3/lib/hovercard.js +2 -5
- package/dist/vue3/lib/hovercard.js.map +1 -1
- package/dist/vue3/lib/image-viewer.cjs +4 -8
- package/dist/vue3/lib/image-viewer.cjs.map +1 -1
- package/dist/vue3/lib/image-viewer.js +4 -8
- package/dist/vue3/lib/image-viewer.js.map +1 -1
- package/dist/vue3/lib/ivr-node.cjs +4 -4
- package/dist/vue3/lib/ivr-node.js +4 -4
- package/dist/vue3/lib/list-item.cjs +4 -8
- package/dist/vue3/lib/list-item.cjs.map +1 -1
- package/dist/vue3/lib/list-item.js +4 -8
- package/dist/vue3/lib/list-item.js.map +1 -1
- package/dist/vue3/lib/message-input.cjs +8 -10
- package/dist/vue3/lib/message-input.cjs.map +1 -1
- package/dist/vue3/lib/message-input.js +8 -10
- package/dist/vue3/lib/message-input.js.map +1 -1
- package/dist/vue3/lib/modal.cjs +5 -11
- package/dist/vue3/lib/modal.cjs.map +1 -1
- package/dist/vue3/lib/modal.js +5 -11
- package/dist/vue3/lib/modal.js.map +1 -1
- package/dist/vue3/lib/notice.cjs +2 -2
- package/dist/vue3/lib/notice.js +2 -2
- package/dist/vue3/lib/pagination.cjs +10 -18
- package/dist/vue3/lib/pagination.cjs.map +1 -1
- package/dist/vue3/lib/pagination.js +10 -18
- package/dist/vue3/lib/pagination.js.map +1 -1
- package/dist/vue3/lib/popover.cjs +5 -11
- package/dist/vue3/lib/popover.cjs.map +1 -1
- package/dist/vue3/lib/popover.js +5 -11
- package/dist/vue3/lib/popover.js.map +1 -1
- package/dist/vue3/lib/rich-text-editor.cjs +1 -2
- package/dist/vue3/lib/rich-text-editor.cjs.map +1 -1
- package/dist/vue3/lib/rich-text-editor.js +1 -2
- package/dist/vue3/lib/rich-text-editor.js.map +1 -1
- package/dist/vue3/lib/settings-menu-button.cjs +6 -15
- package/dist/vue3/lib/settings-menu-button.cjs.map +1 -1
- package/dist/vue3/lib/settings-menu-button.js +6 -15
- package/dist/vue3/lib/settings-menu-button.js.map +1 -1
- package/dist/vue3/lib/split-button.cjs +2 -5
- package/dist/vue3/lib/split-button.cjs.map +1 -1
- package/dist/vue3/lib/split-button.js +2 -5
- package/dist/vue3/lib/split-button.js.map +1 -1
- package/dist/vue3/lib/toast.cjs +5 -5
- package/dist/vue3/lib/toast.js +5 -5
- package/dist/vue3/style.css +111 -111
- package/dist/vue3/types/components/avatar/avatar.vue.d.ts +6 -34
- package/dist/vue3/types/components/avatar/avatar.vue.d.ts.map +1 -1
- package/dist/vue3/types/components/chip/chip.vue.d.ts +1 -1
- package/dist/vue3/types/components/collapsible/collapsible.vue.d.ts +1 -1
- package/dist/vue3/types/components/collapsible/collapsible.vue.d.ts.map +1 -1
- package/dist/vue3/types/components/image_viewer/image_viewer.vue.d.ts.map +1 -1
- package/dist/vue3/types/components/list_item/list_item.vue.d.ts +2 -8
- package/dist/vue3/types/components/list_item/list_item.vue.d.ts.map +1 -1
- package/dist/vue3/types/components/notice/notice_action.vue.d.ts +5 -4
- package/dist/vue3/types/components/notice/notice_action.vue.d.ts.map +1 -1
- package/dist/vue3/types/components/pagination/pagination.vue.d.ts.map +1 -1
- package/dist/vue3/types/components/split_button/split_button-omega.vue.d.ts +1 -1
- package/dist/vue3/types/recipes/buttons/callbar_button/callbar_button.vue.d.ts +1 -1
- package/dist/vue3/types/recipes/buttons/callbar_button_with_popover/callbar_button_with_popover.vue.d.ts +1 -1
- package/dist/vue3/types/recipes/conversation_view/attachment_carousel/attachment_carousel.vue.d.ts.map +1 -1
- package/dist/vue3/types/recipes/conversation_view/feed_item_row/feed_item_row.vue.d.ts +0 -1
- package/dist/vue3/types/recipes/conversation_view/feed_item_row/feed_item_row.vue.d.ts.map +1 -1
- package/dist/vue3/types/recipes/item_layout/contact_info/contact_info.vue.d.ts +3 -3
- package/dist/vue3/types/recipes/leftbar/callbox/callbox.vue.d.ts.map +1 -1
- package/dist/vue3/types/recipes/leftbar/contact_row/contact_row.vue.d.ts +0 -1
- package/dist/vue3/types/recipes/leftbar/contact_row/contact_row.vue.d.ts.map +1 -1
- package/dist/vue3/types/recipes/leftbar/general_row/general_row.vue.d.ts +1 -1
- package/dist/vue3/types/recipes/leftbar/general_row/general_row.vue.d.ts.map +1 -1
- package/package.json +3 -3
- package/dist/vue3/chunks/notice_action-WTucGhvr.js.map +0 -1
- package/dist/vue3/chunks/notice_action-p-ePanW_.js.map +0 -1
- package/dist/vue3/chunks/sr_only_close_button-3EdsV-dH.js.map +0 -1
- package/dist/vue3/chunks/sr_only_close_button-xGrHFjwA.js.map +0 -1
- package/dist/vue3/types/common/storybook_utils.d.ts +0 -25
- package/dist/vue3/types/common/storybook_utils.d.ts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"message-input.js","sources":["../../recipes/conversation_view/message_input/meeting_pill/MeetingPill.vue","../../recipes/conversation_view/message_input/meeting_pill/meeting_pill.js","../../recipes/conversation_view/message_input/message_input.vue"],"sourcesContent":["<template>\n <node-view-wrapper class=\"dt-message-input-meeting-pill\">\n <dt-item-layout\n class=\"dt-message-input-meeting-pill__layout\"\n unstyled\n >\n <template #left>\n <div class=\"dt-message-input-meeting-pill__icon\">\n <dt-icon\n name=\"video\"\n size=\"400\"\n />\n </div>\n </template>\n {{ node.attrs.text }}\n <template #right>\n <div class=\"dt-message-input-meeting-pill__close\">\n <dt-button\n circle\n :aria-label=\"node.attrs['close-button-aria-label']\"\n size=\"xs\"\n importance=\"clear\"\n @click=\"close\"\n >\n <template #icon>\n <dt-icon\n name=\"close\"\n size=\"300\"\n />\n </template>\n </dt-button>\n </div>\n </template>\n </dt-item-layout>\n </node-view-wrapper>\n</template>\n\n<script>\nimport { NodeViewWrapper, nodeViewProps } from '@tiptap/vue-3';\nimport { DtItemLayout } from '@/components/item_layout';\nimport { DtIcon } from '@/components/icon';\nimport { DtButton } from '@/components/button';\n\nexport default {\n name: 'MeetingPill',\n\n components: {\n NodeViewWrapper,\n DtItemLayout,\n DtIcon,\n DtButton,\n },\n\n props: nodeViewProps,\n\n emits: ['meeting-pill-close'],\n\n methods: {\n close (e) {\n this.$parent.$emit('meeting-pill-close', e);\n },\n },\n};\n</script>\n\n<style lang=\"less\">\n.dt-message-input-meeting-pill {\n display: inline-block;\n\n &__layout {\n gap: var(--dt-space-400);\n grid-template-areas: 'left content right';\n grid-template-columns: minmax(0, max-content) 1fr minmax(0, max-content);\n align-items: center;\n max-width: var(--dt-size-905);\n padding-left: var(--dt-space-400);\n padding-right: var(--dt-space-400);\n padding-top: var(--dt-space-200);\n padding-bottom: var(--dt-space-200);\n border: var(--dt-size-border-100) solid var(--dt-color-border-default);\n border-radius: var(--dt-size-radius-300);\n font: var(--dt-typography-headline-md);\n }\n\n &__icon {\n display: flex;\n align-items: center;\n padding: var(--dt-space-350);\n }\n\n &__close {\n display: flex;\n justify-content: flex-end;\n }\n}\n</style>\n","import { mergeAttributes, Node } from '@tiptap/core';\nimport { VueNodeViewRenderer } from '@tiptap/vue-3';\nimport MeetingPill from './MeetingPill.vue';\n\nexport default Node.create({\n\n atom: true,\n group: 'inline',\n inline: true,\n\n addNodeView () {\n return VueNodeViewRenderer(MeetingPill);\n },\n\n addAttributes () {\n return {\n text: {\n default: 'Please pass in \"text\" attribute',\n },\n 'close-button-aria-label': {},\n };\n },\n\n parseHTML () {\n return [\n {\n tag: 'meeting-pill',\n },\n ];\n },\n\n renderText ({ node }) {\n return '/dpm';\n },\n\n renderHTML ({ HTMLAttributes }) {\n return ['meeting-pill', mergeAttributes(HTMLAttributes)];\n },\n});\n","<!-- eslint-disable vue/no-restricted-class -->\n<template>\n <div\n data-qa=\"dt-message-input\"\n role=\"presentation\"\n :class=\"['dt-message-input']\"\n @dragover.prevent\n @drop.prevent=\"onDrop\"\n @paste=\"onPaste\"\n @mousedown=\"onMousedown\"\n >\n <!-- @slot Renders above the input, but still within the borders. -->\n <slot name=\"top\" />\n <!-- Some wrapper to restrict the height and show the scrollbar -->\n <div\n v-dt-scrollbar\n class=\"dt-message-input__editor-wrapper\"\n :style=\"{ 'max-height': maxHeight }\"\n >\n <dt-rich-text-editor\n ref=\"richTextEditor\"\n v-model=\"internalInputValue\"\n :allow-blockquote=\"allowBlockquote\"\n :allow-bold=\"allowBold\"\n :allow-bullet-list=\"allowBulletList\"\n :allow-codeblock=\"allowCodeblock\"\n :allow-italic=\"allowItalic\"\n :allow-strike=\"allowStrike\"\n :allow-underline=\"allowUnderline\"\n :editable=\"editable\"\n :input-aria-label=\"inputAriaLabel\"\n :input-class=\"inputClass\"\n :output-format=\"outputFormat\"\n :auto-focus=\"autoFocus\"\n :link=\"link\"\n :placeholder=\"placeholder\"\n :prevent-typing=\"preventTyping\"\n :mention-suggestion=\"mentionSuggestion\"\n :channel-suggestion=\"channelSuggestion\"\n :slash-command-suggestion=\"slashCommandSuggestion\"\n :additional-extensions=\"additionalExtensions\"\n v-bind=\"$attrs\"\n @input=\"onInput\"\n />\n </div>\n <!-- @slot Slot for attachment carousel -->\n <slot name=\"middle\" />\n <!-- Section for the bottom UI -->\n <section class=\"dt-message-input__bottom-section\">\n <!-- Left content -->\n <div class=\"dt-message-input__bottom-section-left\">\n <dt-button\n v-if=\"showImagePicker\"\n v-dt-tooltip:top-start=\"showImagePicker?.tooltipLabel\"\n data-qa=\"dt-message-input-image-btn\"\n size=\"sm\"\n circle\n :kind=\"imagePickerFocus ? 'default' : 'muted'\"\n importance=\"clear\"\n :aria-label=\"showImagePicker.ariaLabel\"\n @click=\"onSelectImage\"\n @mouseenter=\"imagePickerFocus = true\"\n @mouseleave=\"imagePickerFocus = false\"\n @focus=\"imagePickerFocus = true\"\n @blur=\"imagePickerFocus = false\"\n >\n <template #icon>\n <dt-icon\n name=\"image\"\n size=\"300\"\n />\n </template>\n </dt-button>\n <dt-input\n ref=\"messageInputImageUpload\"\n data-qa=\"dt-message-input-image-input\"\n accept=\"image/*, video/*\"\n type=\"file\"\n class=\"dt-message-input__image-input\"\n multiple\n hidden\n @input=\"onImageUpload\"\n />\n <dt-popover\n v-if=\"showEmojiPicker\"\n v-model:open=\"emojiPickerOpened\"\n data-qa=\"dt-message-input-emoji-picker-popover\"\n initial-focus-element=\"#searchInput\"\n padding=\"none\"\n >\n <template #anchor=\"{ attrs }\">\n <dt-button\n v-dt-tooltip=\"emojiTooltipMessage\"\n v-bind=\"attrs\"\n data-qa=\"dt-message-input-emoji-picker-btn\"\n size=\"sm\"\n circle\n :kind=\"emojiPickerHovered ? 'default' : 'muted'\"\n importance=\"clear\"\n :aria-label=\"emojiButtonAriaLabel\"\n @click=\"toggleEmojiPicker\"\n @mouseenter=\"emojiPickerFocus = true\"\n @mouseleave=\"emojiPickerFocus = false\"\n @focus=\"emojiPickerFocus = true\"\n @blur=\"emojiPickerFocus = false\"\n >\n <template #icon>\n <dt-icon\n :name=\"!emojiPickerHovered ? 'satisfied' : 'very-satisfied'\"\n size=\"300\"\n />\n </template>\n </dt-button>\n </template>\n <template\n #content=\"{ close }\"\n >\n <dt-emoji-picker\n v-bind=\"emojiPickerProps\"\n @skin-tone=\"onSkinTone\"\n @selected-emoji=\"(emoji) => { close(); onSelectEmoji(emoji); }\"\n />\n </template>\n </dt-popover>\n <!-- @slot Slot for emojiGiphy picker -->\n <slot name=\"emojiGiphyPicker\" />\n </div>\n <!-- Right content -->\n <div class=\"dt-message-input__bottom-section-right\">\n <!-- @slot Slot for sms count -->\n <div class=\"d-d-flex d-ai-center\">\n <slot name=\"smsCount\" />\n </div>\n\n <!-- Optionally displayed remaining character counter -->\n <dt-tooltip\n v-if=\"Boolean(showCharacterLimit)\"\n class=\"dt-message-input__remaining-char-tooltip\"\n placement=\"top-end\"\n :enabled=\"characterLimitTooltipEnabled\"\n :message=\"showCharacterLimit.message\"\n :offset=\"[10, 8]\"\n >\n <template #anchor>\n <p\n v-show=\"displayCharacterLimitWarning\"\n class=\"dt-message-input__remaining-char\"\n data-qa=\"dt-message-input-character-limit\"\n >\n {{ showCharacterLimit.count - inputLength }}\n </p>\n </template>\n </dt-tooltip>\n\n <!-- Cancel button for edit mode -->\n <dt-button\n v-if=\"showCancel\"\n data-qa=\"dt-message-input-cancel-button\"\n class=\"dt-message-input__cancel-button\"\n size=\"sm\"\n kind=\"muted\"\n importance=\"clear\"\n :aria-label=\"showCancel.ariaLabel\"\n @click=\"onCancel\"\n >\n <p>{{ showCancel.text }}</p>\n </dt-button>\n\n <!-- @slot Slot for sendButton picker -->\n <slot name=\"sendButton\">\n <!-- Send button -->\n <!-- Right positioned UI - send button -->\n <dt-button\n v-if=\"showSend\"\n v-dt-tooltip:top-end=\"showSend?.tooltipLabel\"\n data-qa=\"dt-message-input-send-btn\"\n size=\"sm\"\n kind=\"default\"\n importance=\"primary\"\n :class=\"[\n {\n 'dt-message-input__send-button--disabled': isSendDisabled,\n 'd-btn--circle': showSend.icon,\n },\n ]\"\n :aria-label=\"showSend.ariaLabel\"\n :aria-disabled=\"isSendDisabled\"\n @click=\"onSend\"\n >\n <template\n v-if=\"showSend.icon\"\n #icon\n >\n <dt-icon\n :name=\"showSend.icon\"\n size=\"300\"\n />\n </template>\n <template\n v-if=\"showSend.text\"\n >\n <p>{{ showSend.text }}</p>\n </template>\n </dt-button>\n </slot>\n </div>\n </section>\n </div>\n</template>\n\n<script>\n/* eslint-disable max-lines */\nimport {\n DtRichTextEditor,\n RICH_TEXT_EDITOR_OUTPUT_FORMATS,\n RICH_TEXT_EDITOR_AUTOFOCUS_TYPES,\n} from '@/components/rich_text_editor';\nimport meetingPill from './meeting_pill/meeting_pill';\nimport { DtButton } from '@/components/button';\nimport { DtIcon } from '@/components/icon';\nimport { DtEmojiPicker } from '@/components/emoji_picker';\nimport { DtPopover } from '@/components/popover';\nimport { DtInput } from '@/components/input';\nimport { DtTooltip } from '@/components/tooltip';\n\nexport default {\n name: 'DtRecipeMessageInput',\n\n components: {\n DtButton,\n DtEmojiPicker,\n DtIcon,\n DtInput,\n DtPopover,\n DtRichTextEditor,\n DtTooltip,\n },\n\n mixins: [],\n\n inheritAttrs: false,\n\n props: {\n /**\n * Value of the input. The object format should match TipTap's JSON\n * document structure: https://tiptap.dev/guide/output#option-1-json\n */\n modelValue: {\n type: [Object, String],\n default: '',\n },\n\n /**\n * Whether the input is editable\n */\n editable: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Descriptive label for the input element\n */\n inputAriaLabel: {\n type: String,\n required: true,\n default: '',\n },\n\n /**\n * Prevents the user from typing any further. Deleting text will still work.\n */\n preventTyping: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Additional class name for the input element. Only accepts a String value\n * because this is passed to the editor via options. For multiple classes,\n * join them into one string, e.g. \"d-p8 d-hmx96\"\n */\n inputClass: {\n type: String,\n default: '',\n },\n\n /**\n * Whether the input should receive focus after the component has been\n * mounted. Either one of `start`, `end`, `all` or a Boolean or a Number.\n * - `start` Sets the focus to the beginning of the input\n * - `end` Sets the focus to the end of the input\n * - `all` Selects the whole contents of the input\n * - `Number` Sets the focus to a specific position in the input\n * - `true` Defaults to `start`\n * - `false` Disables autofocus\n * @values true, false, start, end, all, number\n */\n autoFocus: {\n type: [Boolean, String, Number],\n default: false,\n validator (autoFocus) {\n if (typeof autoFocus === 'string') {\n return RICH_TEXT_EDITOR_AUTOFOCUS_TYPES.includes(autoFocus);\n }\n return true;\n },\n },\n\n /**\n * The output format that the editor uses when emitting the \"@input\" event.\n * One of `text`, `json`, `html`. See https://tiptap.dev/guide/output for\n * examples.\n * @values text, json, html\n */\n outputFormat: {\n type: String,\n default: 'text',\n validator (outputFormat) {\n return RICH_TEXT_EDITOR_OUTPUT_FORMATS.includes(outputFormat);\n },\n },\n\n /**\n * Enables the Link extension and optionally passes configurations to it\n */\n link: {\n type: [Boolean, Object],\n default: true,\n },\n\n /**\n * Placeholder text\n */\n placeholder: {\n type: String,\n default: '',\n },\n\n /**\n * Disable Send Button\n */\n disableSend: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Content area needs to dynamically adjust height based on the conversation area height.\n * can be vh|px|rem|em|%\n */\n maxHeight: {\n type: String,\n default: 'unset',\n },\n\n // Emoji picker props\n showEmojiPicker: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Props to pass into the emoji picker.\n */\n emojiPickerProps: {\n type: Object,\n default: () => ({}),\n validate (emojiPickerProps) {\n return [\n 'searchNoResultsLabel',\n 'searchResultsLabel',\n 'searchPlaceholderLabel',\n 'skinSelectorButtonTooltipLabel',\n 'tabSetLabels',\n ].every(prop => emojiPickerProps[prop] != null);\n },\n },\n\n /**\n * Emoji button tooltip label\n */\n emojiTooltipMessage: {\n type: String,\n default: 'Emoji',\n },\n\n // Aria label for buttons\n /**\n * Emoji button aria label\n */\n emojiButtonAriaLabel: {\n type: String,\n default: 'emoji button',\n },\n\n /**\n * Enable character Limit warning\n */\n showCharacterLimit: {\n type: [Boolean, Object],\n default: () => ({ count: 1500, warning: 500, message: '' }),\n },\n\n showImagePicker: {\n type: [Boolean, Object],\n default: () => ({ tooltipLabel: 'Attach Image', ariaLabel: 'image button' }),\n },\n\n /**\n * Send button defaults.\n */\n showSend: {\n type: [Boolean, Object],\n default: () => ({ icon: 'send' }),\n },\n\n /**\n * Cancel button defaults.\n */\n showCancel: {\n type: [Boolean, Object],\n default: () => ({ text: 'Cancel' }),\n },\n\n /**\n * suggestion object containing the items query function.\n * The valid keys passed into this object can be found here: https://tiptap.dev/api/utilities/suggestion\n *\n * The only required key is the items function which is used to query the contacts for suggestion.\n * items({ query }) => { return [ContactObject]; }\n * ContactObject format:\n * { name: string, avatarSrc: string, id: string }\n *\n * When null, it does not add the plugin.\n */\n mentionSuggestion: {\n type: Object,\n default: null,\n },\n\n /**\n * suggestion object containing the items query function.\n * The valid keys passed into this object can be found here: https://tiptap.dev/api/utilities/suggestion\n *\n * The only required key is the items function which is used to query the channels for suggestion.\n * items({ query }) => { return [ChannelObject]; }\n * ChannelObject format:\n * { name: string, id: string, locked: boolean }\n *\n * When null, it does not add the plugin. Setting locked to true will display a lock rather than hash.\n */\n channelSuggestion: {\n type: Object,\n default: null,\n },\n\n /**\n * suggestion object containing the items query function.\n * The valid keys passed into this object can be found here: https://tiptap.dev/api/utilities/suggestion\n *\n * The only required key is the items function which is used to query the slash commands for suggestion.\n * items({ query }) => { return [SlashCommandObject]; }\n * SlashCommandObject format:\n * { command: string, description: string, parametersExample?: string }\n * The \"parametersExample\" parameter is optional, and describes an example\n * of the parameters that command can take.\n *\n * When null, it does not add the plugin.\n */\n slashCommandSuggestion: {\n type: Object,\n default: null,\n },\n\n /**\n * Whether the input allows for block quote.\n */\n allowBlockquote: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Whether the input allows for bold to be introduced in the text.\n */\n allowBold: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Whether the input allows for bullet list to be introduced in the text.\n */\n allowBulletList: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Whether the input allows for italic to be introduced in the text.\n */\n allowItalic: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Whether the input allows for strike to be introduced in the text.\n */\n allowStrike: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Whether the input allows for underline to be introduced in the text.\n */\n allowUnderline: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Whether the input allows codeblock to be introduced in the text.\n */\n allowCodeblock: {\n type: Boolean,\n default: true,\n },\n },\n\n emits: [\n /**\n * Fires when send button is clicked\n *\n * @event submit\n * @type {String}\n */\n 'submit',\n\n /**\n * Fires when media is selected from image button\n *\n * @event select-media\n * @type {Array}\n */\n 'select-media',\n\n /**\n * Fires when media is dropped into the message input\n *\n * @event add-media\n * @type {Array}\n */\n 'add-media',\n\n /**\n * Fires when media is pasted into the message input\n *\n * @event paste-media\n * @type {Array}\n */\n 'paste-media',\n\n /**\n * Fires when cancel button is pressed (only on edit mode)\n *\n * @event cancel\n * @type {Boolean}\n */\n 'cancel',\n\n /**\n * Fires when skin tone is selected from the emoji picker\n *\n * @event skin-tone\n * @type {String}\n */\n 'skin-tone',\n\n /**\n * Fires when emoji is selected from the emoji picker\n *\n * @event selected-emoji\n * @type {String}\n */\n 'selected-emoji',\n\n /**\n * Fires when a slash command is selected\n *\n * @event selected-command\n * @type {String}\n */\n 'selected-command',\n\n /**\n * Fires when meeting pill is closed\n *\n * @event meeting-pill-close\n * @type {String}\n */\n 'meeting-pill-close',\n\n /**\n * Event to sync the value with the parent\n * @event update:modelValue\n * @type {String|JSON}\n */\n 'update:modelValue',\n ],\n\n data () {\n return {\n additionalExtensions: [meetingPill],\n internalInputValue: this.modelValue, // internal input content\n imagePickerFocus: false,\n emojiPickerFocus: false,\n emojiPickerOpened: false,\n };\n },\n\n computed: {\n inputLength () {\n return this.internalInputValue.length;\n },\n\n displayCharacterLimitWarning () {\n return Boolean(this.showCharacterLimit) &&\n ((this.showCharacterLimit.count - this.inputLength) <= this.showCharacterLimit.warning);\n },\n\n characterLimitTooltipEnabled () {\n return this.showCharacterLimit.message && (this.showCharacterLimit.count - this.inputLength < 0);\n },\n\n isSendDisabled () {\n return this.disableSend ||\n (this.showCharacterLimit && this.inputLength > this.showCharacterLimit.count);\n },\n\n computedCloseButtonProps () {\n return {\n ariaLabel: 'Close',\n };\n },\n\n emojiPickerHovered () {\n return this.emojiPickerFocus || this.emojiPickerOpened;\n },\n },\n\n watch: {\n modelValue (newValue) {\n this.internalInputValue = newValue;\n },\n\n emojiPickerOpened (newValue) {\n if (!newValue) {\n this.$refs.richTextEditor?.focusEditor();\n }\n },\n },\n\n created () {\n if (this.modelValue && this.outputFormat === 'text') {\n this.internalInputValue = this.modelValue.replace(/\\n/g, '<br>');\n }\n },\n\n methods: {\n // Mousedown instead of click because it fires before the blur event.\n onMousedown (e) {\n const isWithinInput = this.$refs.richTextEditor.$el.querySelector('.tiptap').contains(e.target);\n\n // If the click is not within the tiptap rich text editor input itself, but still within the wrapping div,\n // focus the editor.\n if (!isWithinInput) {\n // Prevent default prevents blurring the rich text editor input when it is already focused.\n e.preventDefault();\n this.$refs.richTextEditor.focusEditor();\n }\n },\n\n onDrop (e) {\n const dt = e.dataTransfer;\n const files = Array.from(dt.files);\n this.$emit('add-media', files);\n },\n\n onPaste (e) {\n if (e.clipboardData.files.length) {\n e.stopPropagation();\n e.preventDefault();\n const files = [...e.clipboardData.files];\n this.$emit('paste-media', files);\n }\n },\n\n onSkinTone (skinTone) {\n this.$emit('skin-tone', skinTone);\n },\n\n onSelectEmoji (emoji) {\n if (!emoji) {\n return;\n }\n\n // Insert emoji into the editor\n this.$refs.richTextEditor.editor.commands.insertContent({\n type: 'emoji',\n attrs: {\n code: emoji.shortname,\n },\n });\n this.$emit('selected-emoji', emoji);\n },\n\n onSelectImage () {\n this.$refs.messageInputImageUpload.$refs.input.click();\n },\n\n onImageUpload () {\n this.$emit('select-media', this.$refs.messageInputImageUpload.$refs.input.files);\n },\n\n toggleEmojiPicker () {\n this.emojiPickerOpened = !this.emojiPickerOpened;\n },\n\n onSend () {\n if (this.isSendDisabled) {\n return;\n }\n this.$emit('submit', this.internalInputValue);\n },\n\n onCancel () {\n this.$emit('cancel');\n },\n\n onInput (event) {\n this.$emit('update:modelValue', event);\n },\n },\n};\n</script>\n\n<style lang=\"less\">\n.dt-message-input {\n display: flex;\n flex-direction: column;\n border-radius: var(--dt-size-radius-400);\n border: var(--dt-size-border-100) solid;\n border-color: var(--dt-color-border-default);\n cursor: text;\n\n &:focus-within {\n border-color: var(--dt-color-border-bold);\n box-shadow: var(--dt-shadow-small);\n }\n\n &__editor-wrapper {\n padding: var(--dt-space-400) var(--dt-space-500) var(--dt-space-300);\n }\n\n &__remaining-char-tooltip {\n margin-top: auto;\n margin-bottom: auto;\n }\n\n &__remaining-char {\n color: var(--dt-color-foreground-critical);\n font-size: var(--dt-font-size-100);\n margin-right: var(--dt-space-500);\n }\n\n &__send-button--disabled {\n background-color: unset;\n color: var(--dt-color-foreground-muted);\n cursor: default;\n }\n\n &__cancel-button {\n margin-right: var(--dt-space-300);\n }\n\n &__bottom-section {\n display: flex;\n justify-content: space-between;\n padding: var(--dt-space-300) var(--dt-space-400);\n }\n\n &__bottom-section-left {\n display: flex;\n }\n\n &__bottom-section-right {\n display: flex;\n }\n\n &__image-input {\n position: absolute;\n }\n}\n</style>\n"],"names":["_sfc_main","_hoisted_1","_hoisted_2","_createBlock","_createVNode","_createElementVNode","_createTextVNode","DtEmojiPicker","_createElementBlock","_renderSlot","_mergeProps","_withCtx","_toDisplayString","_normalizeClass","_a"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2CA,MAAKA,cAAU;AAAA,EACb,MAAM;AAAA,EAEN,YAAY;AAAA,IACV;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD;AAAA,EAED,OAAO;AAAA,EAEP,OAAO,CAAC,oBAAoB;AAAA,EAE5B,SAAS;AAAA,IACP,MAAO,GAAG;AACR,WAAK,QAAQ,MAAM,sBAAsB,CAAC;AAAA,IAC3C;AAAA,EACF;AACH;AAvDa,MAAAC,eAAA,EAAA,OAAM,sCAAqC;AAS3C,MAAAC,eAAA,EAAA,OAAM,uCAAsC;;;;;;sBAfvDC,YAiCoB,8BAAA,EAjCD,OAAM,mCAA+B;AAAA,qBACtD,MA+BiB;AAAA,MA/BjBC,YA+BiB,2BAAA;AAAA,QA9Bf,OAAM;AAAA,QACN,UAAA;AAAA;QAEW,cACT,MAKM;AAAA,UALNC,mBAKM,OALNJ,cAKM;AAAA,YAJJG,YAGE,oBAAA;AAAA,cAFA,MAAK;AAAA,cACL,MAAK;AAAA;;;QAKA,eACT,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,WAAC,IAAI,GAAA,CAAA;AAAA;;;QAIvBH,WAmCO,+BAnCP,MAmCO;;AAAA;AAAA,YA/BG,OAAQ,wCADhBN,YA+BY,sBAAA;AAAA;cA5BV,WAAQ;AAAA,cACR,MAAK;AAAA,cACL,MAAK;AAAA,cACL,YAAW;AAAA,cACV,OAAKU,eAAA;AAAA;6DAA+E,SAAc;AAAA,kBAAmC,iBAAA,OAAA,SAAS;AAAA;;cAM9I,cAAY,OAAQ,SAAC;AAAA,cACrB,iBAAe,SAAc;AAAA,cAC7B,SAAO,SAAM;AAAA;+BAWd,MAIW;AAAA,gBAHH,OAAA,SAAS,qBAEfL,mBAA0B,KAAA,YAAAI,gBAApB,OAAQ,SAAC,IAAI,GAAA,CAAA;;;;cAXb,OAAA,SAAS;sBACd;AAAA,4BAED,MAGE;AAAA,kBAHFR,YAGE,oBAAA;AAAA,oBAFC,MAAM,OAAQ,SAAC;AAAA,oBAChB,MAAK;AAAA;;;;;uCArBaU,MAAA,OAAQ,aAAR,gBAAAA,IAAU,cAAnB,SAAO;AAAA;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"message-input.js","sources":["../../recipes/conversation_view/message_input/meeting_pill/MeetingPill.vue","../../recipes/conversation_view/message_input/meeting_pill/meeting_pill.js","../../recipes/conversation_view/message_input/message_input.vue"],"sourcesContent":["<template>\n <node-view-wrapper class=\"dt-message-input-meeting-pill\">\n <dt-item-layout\n class=\"dt-message-input-meeting-pill__layout\"\n unstyled\n >\n <template #left>\n <div class=\"dt-message-input-meeting-pill__icon\">\n <dt-icon\n name=\"video\"\n size=\"400\"\n />\n </div>\n </template>\n {{ node.attrs.text }}\n <template #right>\n <div class=\"dt-message-input-meeting-pill__close\">\n <dt-button\n circle\n :aria-label=\"node.attrs['close-button-aria-label']\"\n size=\"xs\"\n importance=\"clear\"\n @click=\"close\"\n >\n <template #icon>\n <dt-icon-close\n size=\"300\"\n />\n </template>\n </dt-button>\n </div>\n </template>\n </dt-item-layout>\n </node-view-wrapper>\n</template>\n\n<script>\nimport { NodeViewWrapper, nodeViewProps } from '@tiptap/vue-3';\nimport { DtItemLayout } from '@/components/item_layout';\nimport { DtIconClose } from '@dialpad/dialtone-icons/vue3';\nimport { DtButton } from '@/components/button';\n\nexport default {\n name: 'MeetingPill',\n\n components: {\n NodeViewWrapper,\n DtItemLayout,\n DtIconClose,\n DtButton,\n },\n\n props: nodeViewProps,\n\n emits: ['meeting-pill-close'],\n\n methods: {\n close (e) {\n this.$parent.$emit('meeting-pill-close', e);\n },\n },\n};\n</script>\n\n<style lang=\"less\">\n.dt-message-input-meeting-pill {\n display: inline-block;\n\n &__layout {\n gap: var(--dt-space-400);\n grid-template-areas: 'left content right';\n grid-template-columns: minmax(0, max-content) 1fr minmax(0, max-content);\n align-items: center;\n max-width: var(--dt-size-905);\n padding-left: var(--dt-space-400);\n padding-right: var(--dt-space-400);\n padding-top: var(--dt-space-200);\n padding-bottom: var(--dt-space-200);\n border: var(--dt-size-border-100) solid var(--dt-color-border-default);\n border-radius: var(--dt-size-radius-300);\n font: var(--dt-typography-headline-md);\n }\n\n &__icon {\n display: flex;\n align-items: center;\n padding: var(--dt-space-350);\n }\n\n &__close {\n display: flex;\n justify-content: flex-end;\n }\n}\n</style>\n","import { mergeAttributes, Node } from '@tiptap/core';\nimport { VueNodeViewRenderer } from '@tiptap/vue-3';\nimport MeetingPill from './MeetingPill.vue';\n\nexport default Node.create({\n\n atom: true,\n group: 'inline',\n inline: true,\n\n addNodeView () {\n return VueNodeViewRenderer(MeetingPill);\n },\n\n addAttributes () {\n return {\n text: {\n default: 'Please pass in \"text\" attribute',\n },\n 'close-button-aria-label': {},\n };\n },\n\n parseHTML () {\n return [\n {\n tag: 'meeting-pill',\n },\n ];\n },\n\n renderText ({ node }) {\n return '/dpm';\n },\n\n renderHTML ({ HTMLAttributes }) {\n return ['meeting-pill', mergeAttributes(HTMLAttributes)];\n },\n});\n","<!-- eslint-disable vue/no-restricted-class -->\n<template>\n <div\n data-qa=\"dt-message-input\"\n role=\"presentation\"\n :class=\"['dt-message-input']\"\n @dragover.prevent\n @drop.prevent=\"onDrop\"\n @paste=\"onPaste\"\n @mousedown=\"onMousedown\"\n >\n <!-- @slot Renders above the input, but still within the borders. -->\n <slot name=\"top\" />\n <!-- Some wrapper to restrict the height and show the scrollbar -->\n <div\n v-dt-scrollbar\n class=\"dt-message-input__editor-wrapper\"\n :style=\"{ 'max-height': maxHeight }\"\n >\n <dt-rich-text-editor\n ref=\"richTextEditor\"\n v-model=\"internalInputValue\"\n :allow-blockquote=\"allowBlockquote\"\n :allow-bold=\"allowBold\"\n :allow-bullet-list=\"allowBulletList\"\n :allow-codeblock=\"allowCodeblock\"\n :allow-italic=\"allowItalic\"\n :allow-strike=\"allowStrike\"\n :allow-underline=\"allowUnderline\"\n :editable=\"editable\"\n :input-aria-label=\"inputAriaLabel\"\n :input-class=\"inputClass\"\n :output-format=\"outputFormat\"\n :auto-focus=\"autoFocus\"\n :link=\"link\"\n :placeholder=\"placeholder\"\n :prevent-typing=\"preventTyping\"\n :mention-suggestion=\"mentionSuggestion\"\n :channel-suggestion=\"channelSuggestion\"\n :slash-command-suggestion=\"slashCommandSuggestion\"\n :additional-extensions=\"additionalExtensions\"\n v-bind=\"$attrs\"\n @input=\"onInput\"\n />\n </div>\n <!-- @slot Slot for attachment carousel -->\n <slot name=\"middle\" />\n <!-- Section for the bottom UI -->\n <section class=\"dt-message-input__bottom-section\">\n <!-- Left content -->\n <div class=\"dt-message-input__bottom-section-left\">\n <dt-button\n v-if=\"showImagePicker\"\n v-dt-tooltip:top-start=\"showImagePicker?.tooltipLabel\"\n data-qa=\"dt-message-input-image-btn\"\n size=\"sm\"\n circle\n :kind=\"imagePickerFocus ? 'default' : 'muted'\"\n importance=\"clear\"\n :aria-label=\"showImagePicker.ariaLabel\"\n @click=\"onSelectImage\"\n @mouseenter=\"imagePickerFocus = true\"\n @mouseleave=\"imagePickerFocus = false\"\n @focus=\"imagePickerFocus = true\"\n @blur=\"imagePickerFocus = false\"\n >\n <template #icon>\n <dt-icon\n name=\"image\"\n size=\"300\"\n />\n </template>\n </dt-button>\n <dt-input\n ref=\"messageInputImageUpload\"\n data-qa=\"dt-message-input-image-input\"\n accept=\"image/*, video/*\"\n type=\"file\"\n class=\"dt-message-input__image-input\"\n multiple\n hidden\n @input=\"onImageUpload\"\n />\n <dt-popover\n v-if=\"showEmojiPicker\"\n v-model:open=\"emojiPickerOpened\"\n data-qa=\"dt-message-input-emoji-picker-popover\"\n initial-focus-element=\"#searchInput\"\n padding=\"none\"\n >\n <template #anchor=\"{ attrs }\">\n <dt-button\n v-dt-tooltip=\"emojiTooltipMessage\"\n v-bind=\"attrs\"\n data-qa=\"dt-message-input-emoji-picker-btn\"\n size=\"sm\"\n circle\n :kind=\"emojiPickerHovered ? 'default' : 'muted'\"\n importance=\"clear\"\n :aria-label=\"emojiButtonAriaLabel\"\n @click=\"toggleEmojiPicker\"\n @mouseenter=\"emojiPickerFocus = true\"\n @mouseleave=\"emojiPickerFocus = false\"\n @focus=\"emojiPickerFocus = true\"\n @blur=\"emojiPickerFocus = false\"\n >\n <template #icon>\n <dt-icon\n :name=\"!emojiPickerHovered ? 'satisfied' : 'very-satisfied'\"\n size=\"300\"\n />\n </template>\n </dt-button>\n </template>\n <template\n #content=\"{ close }\"\n >\n <dt-emoji-picker\n v-bind=\"emojiPickerProps\"\n @skin-tone=\"onSkinTone\"\n @selected-emoji=\"(emoji) => { close(); onSelectEmoji(emoji); }\"\n />\n </template>\n </dt-popover>\n <!-- @slot Slot for emojiGiphy picker -->\n <slot name=\"emojiGiphyPicker\" />\n </div>\n <!-- Right content -->\n <div class=\"dt-message-input__bottom-section-right\">\n <!-- @slot Slot for sms count -->\n <div class=\"d-d-flex d-ai-center\">\n <slot name=\"smsCount\" />\n </div>\n\n <!-- Optionally displayed remaining character counter -->\n <dt-tooltip\n v-if=\"Boolean(showCharacterLimit)\"\n class=\"dt-message-input__remaining-char-tooltip\"\n placement=\"top-end\"\n :enabled=\"characterLimitTooltipEnabled\"\n :message=\"showCharacterLimit.message\"\n :offset=\"[10, 8]\"\n >\n <template #anchor>\n <p\n v-show=\"displayCharacterLimitWarning\"\n class=\"dt-message-input__remaining-char\"\n data-qa=\"dt-message-input-character-limit\"\n >\n {{ showCharacterLimit.count - inputLength }}\n </p>\n </template>\n </dt-tooltip>\n\n <!-- Cancel button for edit mode -->\n <dt-button\n v-if=\"showCancel\"\n data-qa=\"dt-message-input-cancel-button\"\n class=\"dt-message-input__cancel-button\"\n size=\"sm\"\n kind=\"muted\"\n importance=\"clear\"\n :aria-label=\"showCancel.ariaLabel\"\n @click=\"onCancel\"\n >\n <p>{{ showCancel.text }}</p>\n </dt-button>\n\n <!-- @slot Slot for sendButton picker -->\n <slot name=\"sendButton\">\n <!-- Send button -->\n <!-- Right positioned UI - send button -->\n <dt-button\n v-if=\"showSend\"\n v-dt-tooltip:top-end=\"showSend?.tooltipLabel\"\n data-qa=\"dt-message-input-send-btn\"\n size=\"sm\"\n kind=\"default\"\n importance=\"primary\"\n :class=\"[\n {\n 'dt-message-input__send-button--disabled': isSendDisabled,\n 'd-btn--circle': showSend.icon,\n },\n ]\"\n :aria-label=\"showSend.ariaLabel\"\n :aria-disabled=\"isSendDisabled\"\n @click=\"onSend\"\n >\n <template\n v-if=\"showSend.icon\"\n #icon\n >\n <dt-icon\n :name=\"showSend.icon\"\n size=\"300\"\n />\n </template>\n <template\n v-if=\"showSend.text\"\n >\n <p>{{ showSend.text }}</p>\n </template>\n </dt-button>\n </slot>\n </div>\n </section>\n </div>\n</template>\n\n<script>\n/* eslint-disable max-lines */\nimport {\n DtRichTextEditor,\n RICH_TEXT_EDITOR_OUTPUT_FORMATS,\n RICH_TEXT_EDITOR_AUTOFOCUS_TYPES,\n} from '@/components/rich_text_editor';\nimport meetingPill from './meeting_pill/meeting_pill';\nimport { DtButton } from '@/components/button';\nimport { DtIcon } from '@/components/icon';\nimport { DtEmojiPicker } from '@/components/emoji_picker';\nimport { DtPopover } from '@/components/popover';\nimport { DtInput } from '@/components/input';\nimport { DtTooltip } from '@/components/tooltip';\n\nexport default {\n name: 'DtRecipeMessageInput',\n\n components: {\n DtButton,\n DtEmojiPicker,\n DtIcon,\n DtInput,\n DtPopover,\n DtRichTextEditor,\n DtTooltip,\n },\n\n mixins: [],\n\n inheritAttrs: false,\n\n props: {\n /**\n * Value of the input. The object format should match TipTap's JSON\n * document structure: https://tiptap.dev/guide/output#option-1-json\n */\n modelValue: {\n type: [Object, String],\n default: '',\n },\n\n /**\n * Whether the input is editable\n */\n editable: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Descriptive label for the input element\n */\n inputAriaLabel: {\n type: String,\n required: true,\n default: '',\n },\n\n /**\n * Prevents the user from typing any further. Deleting text will still work.\n */\n preventTyping: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Additional class name for the input element. Only accepts a String value\n * because this is passed to the editor via options. For multiple classes,\n * join them into one string, e.g. \"d-p8 d-hmx96\"\n */\n inputClass: {\n type: String,\n default: '',\n },\n\n /**\n * Whether the input should receive focus after the component has been\n * mounted. Either one of `start`, `end`, `all` or a Boolean or a Number.\n * - `start` Sets the focus to the beginning of the input\n * - `end` Sets the focus to the end of the input\n * - `all` Selects the whole contents of the input\n * - `Number` Sets the focus to a specific position in the input\n * - `true` Defaults to `start`\n * - `false` Disables autofocus\n * @values true, false, start, end, all, number\n */\n autoFocus: {\n type: [Boolean, String, Number],\n default: false,\n validator (autoFocus) {\n if (typeof autoFocus === 'string') {\n return RICH_TEXT_EDITOR_AUTOFOCUS_TYPES.includes(autoFocus);\n }\n return true;\n },\n },\n\n /**\n * The output format that the editor uses when emitting the \"@input\" event.\n * One of `text`, `json`, `html`. See https://tiptap.dev/guide/output for\n * examples.\n * @values text, json, html\n */\n outputFormat: {\n type: String,\n default: 'text',\n validator (outputFormat) {\n return RICH_TEXT_EDITOR_OUTPUT_FORMATS.includes(outputFormat);\n },\n },\n\n /**\n * Enables the Link extension and optionally passes configurations to it\n */\n link: {\n type: [Boolean, Object],\n default: true,\n },\n\n /**\n * Placeholder text\n */\n placeholder: {\n type: String,\n default: '',\n },\n\n /**\n * Disable Send Button\n */\n disableSend: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Content area needs to dynamically adjust height based on the conversation area height.\n * can be vh|px|rem|em|%\n */\n maxHeight: {\n type: String,\n default: 'unset',\n },\n\n // Emoji picker props\n showEmojiPicker: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Props to pass into the emoji picker.\n */\n emojiPickerProps: {\n type: Object,\n default: () => ({}),\n validate (emojiPickerProps) {\n return [\n 'searchNoResultsLabel',\n 'searchResultsLabel',\n 'searchPlaceholderLabel',\n 'skinSelectorButtonTooltipLabel',\n 'tabSetLabels',\n ].every(prop => emojiPickerProps[prop] != null);\n },\n },\n\n /**\n * Emoji button tooltip label\n */\n emojiTooltipMessage: {\n type: String,\n default: 'Emoji',\n },\n\n // Aria label for buttons\n /**\n * Emoji button aria label\n */\n emojiButtonAriaLabel: {\n type: String,\n default: 'emoji button',\n },\n\n /**\n * Enable character Limit warning\n */\n showCharacterLimit: {\n type: [Boolean, Object],\n default: () => ({ count: 1500, warning: 500, message: '' }),\n },\n\n showImagePicker: {\n type: [Boolean, Object],\n default: () => ({ tooltipLabel: 'Attach Image', ariaLabel: 'image button' }),\n },\n\n /**\n * Send button defaults.\n */\n showSend: {\n type: [Boolean, Object],\n default: () => ({ icon: 'send' }),\n },\n\n /**\n * Cancel button defaults.\n */\n showCancel: {\n type: [Boolean, Object],\n default: () => ({ text: 'Cancel' }),\n },\n\n /**\n * suggestion object containing the items query function.\n * The valid keys passed into this object can be found here: https://tiptap.dev/api/utilities/suggestion\n *\n * The only required key is the items function which is used to query the contacts for suggestion.\n * items({ query }) => { return [ContactObject]; }\n * ContactObject format:\n * { name: string, avatarSrc: string, id: string }\n *\n * When null, it does not add the plugin.\n */\n mentionSuggestion: {\n type: Object,\n default: null,\n },\n\n /**\n * suggestion object containing the items query function.\n * The valid keys passed into this object can be found here: https://tiptap.dev/api/utilities/suggestion\n *\n * The only required key is the items function which is used to query the channels for suggestion.\n * items({ query }) => { return [ChannelObject]; }\n * ChannelObject format:\n * { name: string, id: string, locked: boolean }\n *\n * When null, it does not add the plugin. Setting locked to true will display a lock rather than hash.\n */\n channelSuggestion: {\n type: Object,\n default: null,\n },\n\n /**\n * suggestion object containing the items query function.\n * The valid keys passed into this object can be found here: https://tiptap.dev/api/utilities/suggestion\n *\n * The only required key is the items function which is used to query the slash commands for suggestion.\n * items({ query }) => { return [SlashCommandObject]; }\n * SlashCommandObject format:\n * { command: string, description: string, parametersExample?: string }\n * The \"parametersExample\" parameter is optional, and describes an example\n * of the parameters that command can take.\n *\n * When null, it does not add the plugin.\n */\n slashCommandSuggestion: {\n type: Object,\n default: null,\n },\n\n /**\n * Whether the input allows for block quote.\n */\n allowBlockquote: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Whether the input allows for bold to be introduced in the text.\n */\n allowBold: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Whether the input allows for bullet list to be introduced in the text.\n */\n allowBulletList: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Whether the input allows for italic to be introduced in the text.\n */\n allowItalic: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Whether the input allows for strike to be introduced in the text.\n */\n allowStrike: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Whether the input allows for underline to be introduced in the text.\n */\n allowUnderline: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Whether the input allows codeblock to be introduced in the text.\n */\n allowCodeblock: {\n type: Boolean,\n default: true,\n },\n },\n\n emits: [\n /**\n * Fires when send button is clicked\n *\n * @event submit\n * @type {String}\n */\n 'submit',\n\n /**\n * Fires when media is selected from image button\n *\n * @event select-media\n * @type {Array}\n */\n 'select-media',\n\n /**\n * Fires when media is dropped into the message input\n *\n * @event add-media\n * @type {Array}\n */\n 'add-media',\n\n /**\n * Fires when media is pasted into the message input\n *\n * @event paste-media\n * @type {Array}\n */\n 'paste-media',\n\n /**\n * Fires when cancel button is pressed (only on edit mode)\n *\n * @event cancel\n * @type {Boolean}\n */\n 'cancel',\n\n /**\n * Fires when skin tone is selected from the emoji picker\n *\n * @event skin-tone\n * @type {String}\n */\n 'skin-tone',\n\n /**\n * Fires when emoji is selected from the emoji picker\n *\n * @event selected-emoji\n * @type {String}\n */\n 'selected-emoji',\n\n /**\n * Fires when a slash command is selected\n *\n * @event selected-command\n * @type {String}\n */\n 'selected-command',\n\n /**\n * Fires when meeting pill is closed\n *\n * @event meeting-pill-close\n * @type {String}\n */\n 'meeting-pill-close',\n\n /**\n * Event to sync the value with the parent\n * @event update:modelValue\n * @type {String|JSON}\n */\n 'update:modelValue',\n ],\n\n data () {\n return {\n additionalExtensions: [meetingPill],\n internalInputValue: this.modelValue, // internal input content\n imagePickerFocus: false,\n emojiPickerFocus: false,\n emojiPickerOpened: false,\n };\n },\n\n computed: {\n inputLength () {\n return this.internalInputValue.length;\n },\n\n displayCharacterLimitWarning () {\n return Boolean(this.showCharacterLimit) &&\n ((this.showCharacterLimit.count - this.inputLength) <= this.showCharacterLimit.warning);\n },\n\n characterLimitTooltipEnabled () {\n return this.showCharacterLimit.message && (this.showCharacterLimit.count - this.inputLength < 0);\n },\n\n isSendDisabled () {\n return this.disableSend ||\n (this.showCharacterLimit && this.inputLength > this.showCharacterLimit.count);\n },\n\n computedCloseButtonProps () {\n return {\n ariaLabel: 'Close',\n };\n },\n\n emojiPickerHovered () {\n return this.emojiPickerFocus || this.emojiPickerOpened;\n },\n },\n\n watch: {\n modelValue (newValue) {\n this.internalInputValue = newValue;\n },\n\n emojiPickerOpened (newValue) {\n if (!newValue) {\n this.$refs.richTextEditor?.focusEditor();\n }\n },\n },\n\n created () {\n if (this.modelValue && this.outputFormat === 'text') {\n this.internalInputValue = this.modelValue.replace(/\\n/g, '<br>');\n }\n },\n\n methods: {\n // Mousedown instead of click because it fires before the blur event.\n onMousedown (e) {\n const isWithinInput = this.$refs.richTextEditor.$el.querySelector('.tiptap').contains(e.target);\n\n // If the click is not within the tiptap rich text editor input itself, but still within the wrapping div,\n // focus the editor.\n if (!isWithinInput) {\n // Prevent default prevents blurring the rich text editor input when it is already focused.\n e.preventDefault();\n this.$refs.richTextEditor.focusEditor();\n }\n },\n\n onDrop (e) {\n const dt = e.dataTransfer;\n const files = Array.from(dt.files);\n this.$emit('add-media', files);\n },\n\n onPaste (e) {\n if (e.clipboardData.files.length) {\n e.stopPropagation();\n e.preventDefault();\n const files = [...e.clipboardData.files];\n this.$emit('paste-media', files);\n }\n },\n\n onSkinTone (skinTone) {\n this.$emit('skin-tone', skinTone);\n },\n\n onSelectEmoji (emoji) {\n if (!emoji) {\n return;\n }\n\n // Insert emoji into the editor\n this.$refs.richTextEditor.editor.commands.insertContent({\n type: 'emoji',\n attrs: {\n code: emoji.shortname,\n },\n });\n this.$emit('selected-emoji', emoji);\n },\n\n onSelectImage () {\n this.$refs.messageInputImageUpload.$refs.input.click();\n },\n\n onImageUpload () {\n this.$emit('select-media', this.$refs.messageInputImageUpload.$refs.input.files);\n },\n\n toggleEmojiPicker () {\n this.emojiPickerOpened = !this.emojiPickerOpened;\n },\n\n onSend () {\n if (this.isSendDisabled) {\n return;\n }\n this.$emit('submit', this.internalInputValue);\n },\n\n onCancel () {\n this.$emit('cancel');\n },\n\n onInput (event) {\n this.$emit('update:modelValue', event);\n },\n },\n};\n</script>\n\n<style lang=\"less\">\n.dt-message-input {\n display: flex;\n flex-direction: column;\n border-radius: var(--dt-size-radius-400);\n border: var(--dt-size-border-100) solid;\n border-color: var(--dt-color-border-default);\n cursor: text;\n\n &:focus-within {\n border-color: var(--dt-color-border-bold);\n box-shadow: var(--dt-shadow-small);\n }\n\n &__editor-wrapper {\n padding: var(--dt-space-400) var(--dt-space-500) var(--dt-space-300);\n }\n\n &__remaining-char-tooltip {\n margin-top: auto;\n margin-bottom: auto;\n }\n\n &__remaining-char {\n color: var(--dt-color-foreground-critical);\n font-size: var(--dt-font-size-100);\n margin-right: var(--dt-space-500);\n }\n\n &__send-button--disabled {\n background-color: unset;\n color: var(--dt-color-foreground-muted);\n cursor: default;\n }\n\n &__cancel-button {\n margin-right: var(--dt-space-300);\n }\n\n &__bottom-section {\n display: flex;\n justify-content: space-between;\n padding: var(--dt-space-300) var(--dt-space-400);\n }\n\n &__bottom-section-left {\n display: flex;\n }\n\n &__bottom-section-right {\n display: flex;\n }\n\n &__image-input {\n position: absolute;\n }\n}\n</style>\n"],"names":["_sfc_main","_hoisted_1","_hoisted_2","_createBlock","_createVNode","_createElementVNode","_createTextVNode","DtEmojiPicker","_createElementBlock","_renderSlot","_mergeProps","_withCtx","_toDisplayString","_normalizeClass","_a"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0CA,MAAKA,cAAU;AAAA,EACb,MAAM;AAAA,EAEN,YAAY;AAAA,IACV;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD;AAAA,EAED,OAAO;AAAA,EAEP,OAAO,CAAC,oBAAoB;AAAA,EAE5B,SAAS;AAAA,IACP,MAAO,GAAG;AACR,WAAK,QAAQ,MAAM,sBAAsB,CAAC;AAAA,IAC3C;AAAA,EACF;AACH;AAtDa,MAAAC,eAAA,EAAA,OAAM,sCAAqC;AAS3C,MAAAC,eAAA,EAAA,OAAM,uCAAsC;;;;;;;sBAfvDC,YAgCoB,8BAAA,EAhCD,OAAM,mCAA+B;AAAA,qBACtD,MA8BiB;AAAA,MA9BjBC,YA8BiB,2BAAA;AAAA,QA7Bf,OAAM;AAAA,QACN,UAAA;AAAA;QAEW,cACT,MAKM;AAAA,UALNC,mBAKM,OALNJ,cAKM;AAAA,YAJJG,YAGE,oBAAA;AAAA,cAFA,MAAK;AAAA,cACL,MAAK;AAAA;;;QAKA,eACT,MAcM;AAAA,UAdNC,mBAcM,OAdNH,cAcM;AAAA,YAbJE,YAYY,sBAAA;AAAA,cAXV,QAAA;AAAA,cACC,c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A;AAAA;cA5BV,WAAQ;AAAA,cACR,MAAK;AAAA,cACL,MAAK;AAAA,cACL,YAAW;AAAA,cACV,OAAKU,eAAA;AAAA;6DAA+E,SAAc;AAAA,kBAAmC,iBAAA,OAAA,SAAS;AAAA;;cAM9I,cAAY,OAAQ,SAAC;AAAA,cACrB,iBAAe,SAAc;AAAA,cAC7B,SAAO,SAAM;AAAA;+BAWd,MAIW;AAAA,gBAHH,OAAA,SAAS,qBAEfL,mBAA0B,KAAA,YAAAI,gBAApB,OAAQ,SAAC,IAAI,GAAA,CAAA;;;;cAXb,OAAA,SAAS;sBACd;AAAA,4BAED,MAGE;AAAA,kBAHFR,YAGE,oBAAA;AAAA,oBAFC,MAAM,OAAQ,SAAC;AAAA,oBAChB,MAAK;AAAA;;;;;uCArBaU,MAAA,OAAQ,aAAR,gBAAAA,IAAU,cAAnB,SAAO;AAAA;;;;;;;;"}
|
package/dist/vue3/lib/modal.cjs
CHANGED
|
@@ -1,19 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const vue3 = require("@dialpad/dialtone-icons/vue3");
|
|
3
4
|
const modal$1 = require("../chunks/modal-VgxXAQFP.js");
|
|
4
5
|
const common_utils = require("../common/utils.cjs");
|
|
5
6
|
const common_constants = require("../common/constants.cjs");
|
|
6
|
-
const sr_only_close_button = require("../chunks/sr_only_close_button-
|
|
7
|
+
const sr_only_close_button = require("../chunks/sr_only_close_button-Gl43uI6m.js");
|
|
7
8
|
const vue = require("vue");
|
|
8
9
|
const _pluginVue_exportHelper = require("../chunks/_plugin-vue_export-helper-fhnQq0tA.js");
|
|
9
10
|
const lib_lazyShow = require("./lazy-show.cjs");
|
|
10
11
|
const lib_button = require("./button.cjs");
|
|
11
|
-
const lib_icon = require("./icon.cjs");
|
|
12
12
|
const notice_constants = require("../chunks/notice_constants-UXo9e3bS.js");
|
|
13
13
|
require("../chunks/link_constants-x8NwdqmA.js");
|
|
14
|
-
require("@dialpad/dialtone-icons/vue3");
|
|
15
|
-
require("../chunks/icon_constants-da57m7BZ.js");
|
|
16
|
-
require("@dialpad/dialtone-icons/icons.js");
|
|
17
14
|
const MODAL_KIND_MODIFIERS = {
|
|
18
15
|
default: "",
|
|
19
16
|
danger: "d-modal--danger"
|
|
@@ -34,7 +31,7 @@ const _sfc_main = {
|
|
|
34
31
|
components: {
|
|
35
32
|
DtLazyShow: lib_lazyShow.DtLazyShow,
|
|
36
33
|
DtButton: lib_button.DtButton,
|
|
37
|
-
|
|
34
|
+
DtIconClose: vue3.DtIconClose,
|
|
38
35
|
SrOnlyCloseButton: sr_only_close_button.SrOnlyCloseButton
|
|
39
36
|
},
|
|
40
37
|
mixins: [modal$1.Modal, sr_only_close_button.SrOnlyCloseButtonMixin],
|
|
@@ -327,7 +324,7 @@ const _hoisted_4 = {
|
|
|
327
324
|
class: "d-modal__footer"
|
|
328
325
|
};
|
|
329
326
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
330
|
-
const
|
|
327
|
+
const _component_dt_icon_close = vue.resolveComponent("dt-icon-close");
|
|
331
328
|
const _component_dt_button = vue.resolveComponent("dt-button");
|
|
332
329
|
const _component_sr_only_close_button = vue.resolveComponent("sr-only-close-button");
|
|
333
330
|
const _component_dt_lazy_show = vue.resolveComponent("dt-lazy-show");
|
|
@@ -415,10 +412,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
415
412
|
"aria-label": $props.closeButtonProps.ariaLabel
|
|
416
413
|
}, $props.closeButtonProps, { onClick: $options.close }), {
|
|
417
414
|
icon: vue.withCtx(() => [
|
|
418
|
-
vue.createVNode(
|
|
419
|
-
name: "close",
|
|
420
|
-
size: "400"
|
|
421
|
-
})
|
|
415
|
+
vue.createVNode(_component_dt_icon_close, { size: "400" })
|
|
422
416
|
]),
|
|
423
417
|
_: 1
|
|
424
418
|
}, 16, ["aria-label", "onClick"])) : vue.createCommentVNode("", true),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modal.cjs","sources":["../../components/modal/modal_constants.js","../../components/modal/modal.vue"],"sourcesContent":["// Modal style modifiers\nexport const MODAL_KIND_MODIFIERS = {\n default: '',\n danger: 'd-modal--danger',\n};\n\n// Modal size modifiers\nexport const MODAL_SIZE_MODIFIERS = {\n default: '',\n full: 'd-modal--full',\n};\n\nexport const MODAL_BANNER_KINDS = {\n error: 'd-modal__banner--critical',\n info: 'd-modal__banner--info',\n success: 'd-modal__banner--success',\n warning: 'd-modal__banner--warning',\n base: 'd-modal__banner--general',\n};\n","<template>\n <dt-lazy-show\n transition=\"d-zoom\"\n :show=\"show\"\n :class=\"[\n 'd-modal',\n MODAL_KIND_MODIFIERS[kind],\n MODAL_SIZE_MODIFIERS[size],\n modalClass,\n ]\"\n data-qa=\"dt-modal\"\n :aria-hidden=\"open\"\n v-on=\"modalListeners\"\n >\n <div\n v-if=\"show && (hasSlotContent($slots.banner) || bannerTitle)\"\n data-qa=\"dt-modal-banner\"\n :class=\"[\n 'd-modal__banner',\n bannerClass,\n bannerKindClass,\n ]\"\n >\n <!-- @slot Slot for the banner, defaults to bannerTitle prop -->\n <slot name=\"banner\">\n {{ bannerTitle }}\n </slot>\n </div>\n <transition\n appear\n name=\"d-modal__dialog\"\n >\n <div\n v-show=\"show\"\n :class=\"[\n 'd-modal__dialog',\n { 'd-modal__dialog--scrollable': fixedHeaderFooter },\n dialogClass,\n ]\"\n role=\"dialog\"\n aria-modal=\"true\"\n :aria-describedby=\"describedById\"\n :aria-labelledby=\"labelledById\"\n >\n <div\n v-if=\"hasSlotContent($slots.header)\"\n :id=\"labelledById\"\n class=\"d-modal__header\"\n data-qa=\"dt-modal-title\"\n >\n <!-- @slot Slot for dialog header section, taking the place of any \"title\" text prop -->\n <slot name=\"header\" />\n </div>\n <h2\n v-else\n :id=\"labelledById\"\n class=\"d-modal__header\"\n data-qa=\"dt-modal-title\"\n >\n {{ title }}\n </h2>\n <div\n v-if=\"hasSlotContent($slots.default)\"\n :class=\"[\n 'd-modal__content',\n contentClass,\n ]\"\n data-qa=\"dt-modal-copy\"\n >\n <!-- @slot Default slot for dialog body section, taking the place of any \"copy\" text prop -->\n <slot />\n </div>\n <p\n v-else\n :class=\"[\n 'd-modal__content',\n contentClass,\n ]\"\n data-qa=\"dt-modal-copy\"\n >\n {{ copy }}\n </p>\n <footer\n v-if=\"hasFooterSlot\"\n class=\"d-modal__footer\"\n >\n <!-- @slot Slot for dialog footer content, often containing cancel and confirm buttons. -->\n <slot name=\"footer\" />\n </footer>\n <dt-button\n v-if=\"!hideClose\"\n class=\"d-modal__close\"\n circle\n size=\"lg\"\n importance=\"clear\"\n :aria-label=\"closeButtonProps.ariaLabel\"\n v-bind=\"closeButtonProps\"\n @click=\"close\"\n >\n <template #icon>\n <dt-icon\n name=\"close\"\n size=\"400\"\n />\n </template>\n </dt-button>\n <sr-only-close-button\n v-if=\"showVisuallyHiddenClose\"\n :visually-hidden-close-label=\"visuallyHiddenCloseLabel\"\n @close=\"close\"\n />\n </div>\n </transition>\n </dt-lazy-show>\n</template>\n\n<script>\n/* eslint-disable max-lines */\nimport { DtButton } from '@/components/button';\nimport { DtIcon } from '@/components/icon';\nimport Modal from '@/common/mixins/modal';\nimport {\n MODAL_BANNER_KINDS,\n MODAL_KIND_MODIFIERS,\n MODAL_SIZE_MODIFIERS,\n} from './modal_constants';\nimport { getUniqueString, hasSlotContent } from '@/common/utils';\nimport { DtLazyShow } from '@/components/lazy_show';\nimport { EVENT_KEYNAMES } from '@/common/constants';\nimport SrOnlyCloseButtonMixin from '@/common/mixins/sr_only_close_button';\nimport SrOnlyCloseButton from '@/common/sr_only_close_button.vue';\nimport { NOTICE_KINDS } from '@/components/notice';\n\n/**\n * Modals focus the user’s attention exclusively on one task or piece of information\n * via a window that sits on top of the page content.\n * @see https://dialtone.dialpad.com/components/modal.html\n */\nexport default {\n name: 'DtModal',\n\n components: {\n DtLazyShow,\n DtButton,\n DtIcon,\n SrOnlyCloseButton,\n },\n\n mixins: [Modal, SrOnlyCloseButtonMixin],\n\n props: {\n /**\n * A set of props to be passed into the modal's close button.\n * Requires an 'ariaLabel' property.\n */\n closeButtonProps: {\n type: Object,\n required: true,\n validator: (props) => {\n return !!props.ariaLabel;\n },\n },\n\n /**\n * Body text to display as the modal's main content.\n */\n copy: {\n type: String,\n default: '',\n },\n\n /**\n * Id to use for the dialog's aria-describedby.\n * Recommended only if the dialog content itself isn't enough to give full context,\n * as screen readers should recite the dialog contents by default before any aria-description.\n */\n describedById: {\n type: String,\n default: '',\n },\n\n /**\n * Id to use for the dialog's aria-labelledby.\n */\n labelledById: {\n type: String,\n default: function () { return getUniqueString(); },\n },\n\n /**\n * Whether the modal should be shown.\n * Parent component can sync on this value to control the modal's visibility.\n * @values true, false\n */\n show: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Title text to display in the modal header.\n */\n title: {\n type: String,\n default: '',\n },\n\n /**\n * Title text to display in the modal banner.\n */\n bannerTitle: {\n type: String,\n default: '',\n },\n\n /**\n * The theme of the modal. kind - default or danger,\n * @values default, danger\n */\n kind: {\n type: String,\n default: 'default',\n validator: (k) => Object.keys(MODAL_KIND_MODIFIERS).includes(k),\n },\n\n /**\n * The size of the modal. size - default or full,\n * @values default, full\n */\n size: {\n type: String,\n default: 'default',\n validator: (s) => Object.keys(MODAL_SIZE_MODIFIERS).includes(s),\n },\n\n /**\n * Additional class name for the root modal element.\n * Can accept String, Object, and Array, i.e. has the\n * same API as Vue's built-in handling of the class attribute.\n */\n modalClass: {\n type: [String, Object, Array],\n default: '',\n },\n\n /**\n * Additional class name for the dialog element within the modal.\n * Can accept String, Object, and Array, i.e. has the\n * same API as Vue's built-in handling of the class attribute.\n */\n dialogClass: {\n type: [String, Object, Array],\n default: '',\n },\n\n /**\n * Additional class name for the content element within the modal.\n * Can accept String, Object, and Array, i.e. has the\n * same API as Vue's built-in handling of the class attribute.\n */\n contentClass: {\n type: [String, Object, Array],\n default: '',\n },\n\n /**\n * Sets the color of the banner.\n * @values base, error, info, success, warning\n */\n bannerKind: {\n type: String,\n default: 'warning',\n validate (kind) {\n return NOTICE_KINDS.includes(kind);\n },\n },\n\n /**\n * Additional class name for the banner element within the modal.\n * Can accept String, Object, and Array, i.e. has the\n * same API as Vue's built-in handling of the class attribute.\n */\n bannerClass: {\n type: [String, Object, Array],\n default: '',\n },\n\n /**\n * Hides the close button on the modal\n * @values true, false\n */\n hideClose: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Whether the modal will close when you click outside of the dialog on the overlay.\n * @values true, false\n */\n closeOnClick: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Scrollable modal that allows scroll the modal content keeping the header and footer fixed\n * @values true, false\n */\n fixedHeaderFooter: {\n type: Boolean,\n default: true,\n },\n\n /**\n * The element that is focused when the modal is opened. This can be an\n * HTMLElement within the modal, a string starting with '#' which will\n * find the element by ID. 'first' which will automatically focus\n * the first element, or 'dialog' which will focus the dialog window itself.\n * If the dialog is modal this prop cannot be 'none'.\n */\n initialFocusElement: {\n type: [String, HTMLElement],\n default: 'first',\n validator: initialFocusElement => {\n return initialFocusElement === 'first' ||\n (initialFocusElement instanceof HTMLElement) ||\n initialFocusElement.startsWith('#');\n },\n },\n },\n\n emits: [\n /**\n * Native button click event\n *\n * @event click\n * @type {PointerEvent | KeyboardEvent}\n */\n 'click',\n\n /**\n * Native keydown event\n *\n * @event keydown\n * @type {KeyboardEvent}\n */\n 'keydown',\n\n /**\n * The modal will emit a \"false\" boolean value for this event when the user performs a modal-closing action.\n * Parent components can sync on this value to create a 2-way binding to control modal visibility.\n *\n * @event update:show\n * @type {Boolean}\n */\n 'update:show',\n ],\n\n data () {\n return {\n MODAL_KIND_MODIFIERS,\n MODAL_SIZE_MODIFIERS,\n MODAL_BANNER_KINDS,\n EVENT_KEYNAMES,\n hasSlotContent,\n };\n },\n\n computed: {\n modalListeners () {\n return {\n click: event => {\n if (!this.closeOnClick) return;\n (event.target === event.currentTarget) && this.close();\n this.$emit('click', event);\n },\n\n keydown: event => {\n switch (event.code) {\n case EVENT_KEYNAMES.esc:\n case EVENT_KEYNAMES.escape:\n this.close();\n break;\n case EVENT_KEYNAMES.tab:\n this.trapFocus(event);\n break;\n }\n this.$emit('keydown', event);\n },\n\n 'after-enter': event => {\n this.$emit('update:show', true);\n (event.target === event.currentTarget) && this.setFocusAfterTransition();\n },\n };\n },\n\n open () {\n return `${!this.show}`;\n },\n\n hasFooterSlot () {\n return !!this.$slots.footer;\n },\n\n bannerKindClass () {\n return MODAL_BANNER_KINDS[this.bannerKind];\n },\n },\n\n watch: {\n show: {\n immediate: true,\n handler (isShowing) {\n if (isShowing) {\n // Set a reference to the previously-active element, to which we'll return focus on modal close.\n this.previousActiveElement = document.activeElement;\n } else {\n // Modal is being hidden, so return focus to the previously active element before clearing the reference.\n this.previousActiveElement?.focus();\n this.previousActiveElement = null;\n }\n },\n },\n\n $props: {\n immediate: true,\n deep: true,\n handler () {\n this.validateProps();\n },\n },\n },\n\n methods: {\n close () {\n this.$emit('update:show', false);\n },\n\n setFocusAfterTransition () {\n if (this.initialFocusElement === 'first') {\n this.focusFirstElement();\n } else if (this.initialFocusElement.startsWith('#')) {\n this.focusElementById(this.initialFocusElement);\n } else if (this.initialFocusElement instanceof HTMLElement) {\n this.initialFocusElement.focus();\n }\n },\n\n trapFocus (e) {\n if (this.show) {\n this.focusTrappedTabPress(e);\n }\n },\n\n validateProps () {\n if (this.hideClose && !this.visuallyHiddenClose) {\n console.error(`If hideClose prop is true, visuallyHiddenClose and visuallyHiddenCloseLabel props\n need to be set so the component always includes a close button`);\n }\n },\n },\n};\n</script>\n"],"names":["DtLazyShow","DtButton","DtIcon","SrOnlyCloseButton","Modal","SrOnlyCloseButtonMixin","getUniqueString","NOTICE_KINDS","EVENT_KEYNAMES","hasSlotContent","_openBlock","_createBlock","_mergeProps","_toHandlers","_createElementBlock","_normalizeClass","_renderSlot","_createVNode","_Transition","_createElementVNode"],"mappings":";;;;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AGD,SAAa,iBADrBL,IAAAA,aAAAI,IAAAA,mBAMS,UANT,YAMS;AAAA,cADPE,eAAsB,KAAA,QAAA,QAAA;AAAA;aAGf,OAAS,aADlBN,IAAAA,aAAAC,IAAAA,YAgBY,sBAhBZC,eAgBY;AAAA;cAdV,OAAM;AAAA,cACN,QAAA;AAAA,cACA,MAAK;AAAA,cACL,YAAW;AAAA,cACV,cAAY,OAAgB,iBAAC;AAAA,eACtB,OAAgB,kBAAA,EACvB,SAAO,SAAK,MAAA,CAAA,GAAA;AAAA,cAEF,kBACT,MAGE;AAAA,gBAHFK,IAAAA,YAGE,oBAAA;AAAA,kBAFA,MAAK;AAAA,kBACL,MAAK;AAAA;;;;YAKH,KAAuB,4CAD/BN,IAIE,YAAA,iCAAA;AAAA;cAFC,+BAA6B,KAAwB;AAAA,cACrD,SAAO,SAAK;AAAA;;wBA5EP,OAAI,IAAA;AAAA;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"modal.cjs","sources":["../../components/modal/modal_constants.js","../../components/modal/modal.vue"],"sourcesContent":["// Modal style modifiers\nexport const MODAL_KIND_MODIFIERS = {\n default: '',\n danger: 'd-modal--danger',\n};\n\n// Modal size modifiers\nexport const MODAL_SIZE_MODIFIERS = {\n default: '',\n full: 'd-modal--full',\n};\n\nexport const MODAL_BANNER_KINDS = {\n error: 'd-modal__banner--critical',\n info: 'd-modal__banner--info',\n success: 'd-modal__banner--success',\n warning: 'd-modal__banner--warning',\n base: 'd-modal__banner--general',\n};\n","<template>\n <dt-lazy-show\n transition=\"d-zoom\"\n :show=\"show\"\n :class=\"[\n 'd-modal',\n MODAL_KIND_MODIFIERS[kind],\n MODAL_SIZE_MODIFIERS[size],\n modalClass,\n ]\"\n data-qa=\"dt-modal\"\n :aria-hidden=\"open\"\n v-on=\"modalListeners\"\n >\n <div\n v-if=\"show && (hasSlotContent($slots.banner) || bannerTitle)\"\n data-qa=\"dt-modal-banner\"\n :class=\"[\n 'd-modal__banner',\n bannerClass,\n bannerKindClass,\n ]\"\n >\n <!-- @slot Slot for the banner, defaults to bannerTitle prop -->\n <slot name=\"banner\">\n {{ bannerTitle }}\n </slot>\n </div>\n <transition\n appear\n name=\"d-modal__dialog\"\n >\n <div\n v-show=\"show\"\n :class=\"[\n 'd-modal__dialog',\n { 'd-modal__dialog--scrollable': fixedHeaderFooter },\n dialogClass,\n ]\"\n role=\"dialog\"\n aria-modal=\"true\"\n :aria-describedby=\"describedById\"\n :aria-labelledby=\"labelledById\"\n >\n <div\n v-if=\"hasSlotContent($slots.header)\"\n :id=\"labelledById\"\n class=\"d-modal__header\"\n data-qa=\"dt-modal-title\"\n >\n <!-- @slot Slot for dialog header section, taking the place of any \"title\" text prop -->\n <slot name=\"header\" />\n </div>\n <h2\n v-else\n :id=\"labelledById\"\n class=\"d-modal__header\"\n data-qa=\"dt-modal-title\"\n >\n {{ title }}\n </h2>\n <div\n v-if=\"hasSlotContent($slots.default)\"\n :class=\"[\n 'd-modal__content',\n contentClass,\n ]\"\n data-qa=\"dt-modal-copy\"\n >\n <!-- @slot Default slot for dialog body section, taking the place of any \"copy\" text prop -->\n <slot />\n </div>\n <p\n v-else\n :class=\"[\n 'd-modal__content',\n contentClass,\n ]\"\n data-qa=\"dt-modal-copy\"\n >\n {{ copy }}\n </p>\n <footer\n v-if=\"hasFooterSlot\"\n class=\"d-modal__footer\"\n >\n <!-- @slot Slot for dialog footer content, often containing cancel and confirm buttons. -->\n <slot name=\"footer\" />\n </footer>\n <dt-button\n v-if=\"!hideClose\"\n class=\"d-modal__close\"\n circle\n size=\"lg\"\n importance=\"clear\"\n :aria-label=\"closeButtonProps.ariaLabel\"\n v-bind=\"closeButtonProps\"\n @click=\"close\"\n >\n <template #icon>\n <dt-icon-close\n size=\"400\"\n />\n </template>\n </dt-button>\n <sr-only-close-button\n v-if=\"showVisuallyHiddenClose\"\n :visually-hidden-close-label=\"visuallyHiddenCloseLabel\"\n @close=\"close\"\n />\n </div>\n </transition>\n </dt-lazy-show>\n</template>\n\n<script>\n/* eslint-disable max-lines */\nimport { DtButton } from '@/components/button';\nimport { DtIconClose } from '@dialpad/dialtone-icons/vue3';\nimport Modal from '@/common/mixins/modal';\nimport {\n MODAL_BANNER_KINDS,\n MODAL_KIND_MODIFIERS,\n MODAL_SIZE_MODIFIERS,\n} from './modal_constants';\nimport { getUniqueString, hasSlotContent } from '@/common/utils';\nimport { DtLazyShow } from '@/components/lazy_show';\nimport { EVENT_KEYNAMES } from '@/common/constants';\nimport SrOnlyCloseButtonMixin from '@/common/mixins/sr_only_close_button';\nimport SrOnlyCloseButton from '@/common/sr_only_close_button.vue';\nimport { NOTICE_KINDS } from '@/components/notice';\n\n/**\n * Modals focus the user’s attention exclusively on one task or piece of information\n * via a window that sits on top of the page content.\n * @see https://dialtone.dialpad.com/components/modal.html\n */\nexport default {\n name: 'DtModal',\n\n components: {\n DtLazyShow,\n DtButton,\n DtIconClose,\n SrOnlyCloseButton,\n },\n\n mixins: [Modal, SrOnlyCloseButtonMixin],\n\n props: {\n /**\n * A set of props to be passed into the modal's close button.\n * Requires an 'ariaLabel' property.\n */\n closeButtonProps: {\n type: Object,\n required: true,\n validator: (props) => {\n return !!props.ariaLabel;\n },\n },\n\n /**\n * Body text to display as the modal's main content.\n */\n copy: {\n type: String,\n default: '',\n },\n\n /**\n * Id to use for the dialog's aria-describedby.\n * Recommended only if the dialog content itself isn't enough to give full context,\n * as screen readers should recite the dialog contents by default before any aria-description.\n */\n describedById: {\n type: String,\n default: '',\n },\n\n /**\n * Id to use for the dialog's aria-labelledby.\n */\n labelledById: {\n type: String,\n default: function () { return getUniqueString(); },\n },\n\n /**\n * Whether the modal should be shown.\n * Parent component can sync on this value to control the modal's visibility.\n * @values true, false\n */\n show: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Title text to display in the modal header.\n */\n title: {\n type: String,\n default: '',\n },\n\n /**\n * Title text to display in the modal banner.\n */\n bannerTitle: {\n type: String,\n default: '',\n },\n\n /**\n * The theme of the modal. kind - default or danger,\n * @values default, danger\n */\n kind: {\n type: String,\n default: 'default',\n validator: (k) => Object.keys(MODAL_KIND_MODIFIERS).includes(k),\n },\n\n /**\n * The size of the modal. size - default or full,\n * @values default, full\n */\n size: {\n type: String,\n default: 'default',\n validator: (s) => Object.keys(MODAL_SIZE_MODIFIERS).includes(s),\n },\n\n /**\n * Additional class name for the root modal element.\n * Can accept String, Object, and Array, i.e. has the\n * same API as Vue's built-in handling of the class attribute.\n */\n modalClass: {\n type: [String, Object, Array],\n default: '',\n },\n\n /**\n * Additional class name for the dialog element within the modal.\n * Can accept String, Object, and Array, i.e. has the\n * same API as Vue's built-in handling of the class attribute.\n */\n dialogClass: {\n type: [String, Object, Array],\n default: '',\n },\n\n /**\n * Additional class name for the content element within the modal.\n * Can accept String, Object, and Array, i.e. has the\n * same API as Vue's built-in handling of the class attribute.\n */\n contentClass: {\n type: [String, Object, Array],\n default: '',\n },\n\n /**\n * Sets the color of the banner.\n * @values base, error, info, success, warning\n */\n bannerKind: {\n type: String,\n default: 'warning',\n validate (kind) {\n return NOTICE_KINDS.includes(kind);\n },\n },\n\n /**\n * Additional class name for the banner element within the modal.\n * Can accept String, Object, and Array, i.e. has the\n * same API as Vue's built-in handling of the class attribute.\n */\n bannerClass: {\n type: [String, Object, Array],\n default: '',\n },\n\n /**\n * Hides the close button on the modal\n * @values true, false\n */\n hideClose: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Whether the modal will close when you click outside of the dialog on the overlay.\n * @values true, false\n */\n closeOnClick: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Scrollable modal that allows scroll the modal content keeping the header and footer fixed\n * @values true, false\n */\n fixedHeaderFooter: {\n type: Boolean,\n default: true,\n },\n\n /**\n * The element that is focused when the modal is opened. This can be an\n * HTMLElement within the modal, a string starting with '#' which will\n * find the element by ID. 'first' which will automatically focus\n * the first element, or 'dialog' which will focus the dialog window itself.\n * If the dialog is modal this prop cannot be 'none'.\n */\n initialFocusElement: {\n type: [String, HTMLElement],\n default: 'first',\n validator: initialFocusElement => {\n return initialFocusElement === 'first' ||\n (initialFocusElement instanceof HTMLElement) ||\n initialFocusElement.startsWith('#');\n },\n },\n },\n\n emits: [\n /**\n * Native button click event\n *\n * @event click\n * @type {PointerEvent | KeyboardEvent}\n */\n 'click',\n\n /**\n * Native keydown event\n *\n * @event keydown\n * @type {KeyboardEvent}\n */\n 'keydown',\n\n /**\n * The modal will emit a \"false\" boolean value for this event when the user performs a modal-closing action.\n * Parent components can sync on this value to create a 2-way binding to control modal visibility.\n *\n * @event update:show\n * @type {Boolean}\n */\n 'update:show',\n ],\n\n data () {\n return {\n MODAL_KIND_MODIFIERS,\n MODAL_SIZE_MODIFIERS,\n MODAL_BANNER_KINDS,\n EVENT_KEYNAMES,\n hasSlotContent,\n };\n },\n\n computed: {\n modalListeners () {\n return {\n click: event => {\n if (!this.closeOnClick) return;\n (event.target === event.currentTarget) && this.close();\n this.$emit('click', event);\n },\n\n keydown: event => {\n switch (event.code) {\n case EVENT_KEYNAMES.esc:\n case EVENT_KEYNAMES.escape:\n this.close();\n break;\n case EVENT_KEYNAMES.tab:\n this.trapFocus(event);\n break;\n }\n this.$emit('keydown', event);\n },\n\n 'after-enter': event => {\n this.$emit('update:show', true);\n (event.target === event.currentTarget) && this.setFocusAfterTransition();\n },\n };\n },\n\n open () {\n return `${!this.show}`;\n },\n\n hasFooterSlot () {\n return !!this.$slots.footer;\n },\n\n bannerKindClass () {\n return MODAL_BANNER_KINDS[this.bannerKind];\n },\n },\n\n watch: {\n show: {\n immediate: true,\n handler (isShowing) {\n if (isShowing) {\n // Set a reference to the previously-active element, to which we'll return focus on modal close.\n this.previousActiveElement = document.activeElement;\n } else {\n // Modal is being hidden, so return focus to the previously active element before clearing the reference.\n this.previousActiveElement?.focus();\n this.previousActiveElement = null;\n }\n },\n },\n\n $props: {\n immediate: true,\n deep: true,\n handler () {\n this.validateProps();\n },\n },\n },\n\n methods: {\n close () {\n this.$emit('update:show', false);\n },\n\n setFocusAfterTransition () {\n if (this.initialFocusElement === 'first') {\n this.focusFirstElement();\n } else if (this.initialFocusElement.startsWith('#')) {\n this.focusElementById(this.initialFocusElement);\n } else if (this.initialFocusElement instanceof HTMLElement) {\n this.initialFocusElement.focus();\n }\n },\n\n trapFocus (e) {\n if (this.show) {\n this.focusTrappedTabPress(e);\n }\n },\n\n validateProps () {\n if (this.hideClose && !this.visuallyHiddenClose) {\n console.error(`If hideClose prop is true, visuallyHiddenClose and visuallyHiddenCloseLabel props\n need to be set so the component always includes a close button`);\n }\n },\n },\n};\n</script>\n"],"names":["DtLazyShow","DtButton","DtIconClose","SrOnlyCloseButton","Modal","SrOnlyCloseButtonMixin","getUniqueString","NOTICE_KINDS","EVENT_KEYNAMES","hasSlotContent","_openBlock","_createBlock","_mergeProps","_toHandlers","_createElementBlock","_normalizeClass","_renderSlot","_createVNode","_Transition","_createElementVNode"],"mappings":";;;;;;;;;;;;;AACY,MAAC,uBAAuB;AAAA,EAClC,SAAS;AAAA,EACT,QAAQ;AACV;AAGY,MAAC,uBAAuB;AAAA,EAClC,SAAS;AAAA,EACT,MAAM;AACR;AAEY,MAAC,qBAAqB;AAAA,EAChC,OAAO;AAAA,EACP,MAAM;AAAA,EACN,SAAS;AAAA,EACT,SAAS;AAAA,EACT,MAAM;AACR;ACuHA,MAAK,YAAU;AAAA,EACb,MAAM;AAAA,EAEN,YAAY;AAAA,gBACVA,aAAU;AAAA,IACV,UAAAC,WAAQ;AAAA,iBACRC,KAAW;AAAA,IACX,mBAAAC,qBAAiB;AAAA,EAClB;AAAA,EAED,QAAQ,CAACC,QAAK,OAAEC,2CAAsB;AAAA,EAEtC,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA,IAKL,kBAAkB;AAAA,MAChB,MAAM;AAAA,MACN,UAAU;AAAA,MACV,WAAW,CAAC,UAAU;AACpB,eAAO,CAAC,CAAC,MAAM;AAAA,MAChB;AAAA,IACF;AAAA;AAAA;AAAA;AAAA,IAKD,MAAM;AAAA,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|
import { Modal } from "../chunks/modal-XOr4kiNZ.js";
|
|
2
3
|
import { getUniqueString, hasSlotContent } from "../common/utils.js";
|
|
3
4
|
import { EVENT_KEYNAMES } from "../common/constants.js";
|
|
4
|
-
import { SrOnlyCloseButton, SrOnlyCloseButtonMixin } from "../chunks/sr_only_close_button-
|
|
5
|
+
import { SrOnlyCloseButton, SrOnlyCloseButtonMixin } from "../chunks/sr_only_close_button-q23hJuAf.js";
|
|
5
6
|
import { resolveComponent, openBlock, createBlock, mergeProps, toHandlers, withCtx, createElementBlock, normalizeClass, renderSlot, createTextVNode, toDisplayString, createCommentVNode, createVNode, Transition, withDirectives, createElementVNode, vShow } from "vue";
|
|
6
7
|
import { _export_sfc } from "../chunks/_plugin-vue_export-helper-caHeSgYY.js";
|
|
7
8
|
import { DtLazyShow } from "./lazy-show.js";
|
|
8
9
|
import { DtButton } from "./button.js";
|
|
9
|
-
import { DtIcon } from "./icon.js";
|
|
10
10
|
import { NOTICE_KINDS } from "../chunks/notice_constants-7Qt2CQEY.js";
|
|
11
11
|
import "../chunks/link_constants-AfTWrr-n.js";
|
|
12
|
-
import "@dialpad/dialtone-icons/vue3";
|
|
13
|
-
import "../chunks/icon_constants-H9ahUVCG.js";
|
|
14
|
-
import "@dialpad/dialtone-icons/icons.js";
|
|
15
12
|
const MODAL_KIND_MODIFIERS = {
|
|
16
13
|
default: "",
|
|
17
14
|
danger: "d-modal--danger"
|
|
@@ -32,7 +29,7 @@ const _sfc_main = {
|
|
|
32
29
|
components: {
|
|
33
30
|
DtLazyShow,
|
|
34
31
|
DtButton,
|
|
35
|
-
|
|
32
|
+
DtIconClose,
|
|
36
33
|
SrOnlyCloseButton
|
|
37
34
|
},
|
|
38
35
|
mixins: [Modal, SrOnlyCloseButtonMixin],
|
|
@@ -325,7 +322,7 @@ const _hoisted_4 = {
|
|
|
325
322
|
class: "d-modal__footer"
|
|
326
323
|
};
|
|
327
324
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
328
|
-
const
|
|
325
|
+
const _component_dt_icon_close = resolveComponent("dt-icon-close");
|
|
329
326
|
const _component_dt_button = resolveComponent("dt-button");
|
|
330
327
|
const _component_sr_only_close_button = resolveComponent("sr-only-close-button");
|
|
331
328
|
const _component_dt_lazy_show = resolveComponent("dt-lazy-show");
|
|
@@ -413,10 +410,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
413
410
|
"aria-label": $props.closeButtonProps.ariaLabel
|
|
414
411
|
}, $props.closeButtonProps, { onClick: $options.close }), {
|
|
415
412
|
icon: withCtx(() => [
|
|
416
|
-
createVNode(
|
|
417
|
-
name: "close",
|
|
418
|
-
size: "400"
|
|
419
|
-
})
|
|
413
|
+
createVNode(_component_dt_icon_close, { size: "400" })
|
|
420
414
|
]),
|
|
421
415
|
_: 1
|
|
422
416
|
}, 16, ["aria-label", "onClick"])) : createCommentVNode("", true),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modal.js","sources":["../../components/modal/modal_constants.js","../../components/modal/modal.vue"],"sourcesContent":["// Modal style modifiers\nexport const MODAL_KIND_MODIFIERS = {\n default: '',\n danger: 'd-modal--danger',\n};\n\n// Modal size modifiers\nexport const MODAL_SIZE_MODIFIERS = {\n default: '',\n full: 'd-modal--full',\n};\n\nexport const MODAL_BANNER_KINDS = {\n error: 'd-modal__banner--critical',\n info: 'd-modal__banner--info',\n success: 'd-modal__banner--success',\n warning: 'd-modal__banner--warning',\n base: 'd-modal__banner--general',\n};\n","<template>\n <dt-lazy-show\n transition=\"d-zoom\"\n :show=\"show\"\n :class=\"[\n 'd-modal',\n MODAL_KIND_MODIFIERS[kind],\n MODAL_SIZE_MODIFIERS[size],\n modalClass,\n ]\"\n data-qa=\"dt-modal\"\n :aria-hidden=\"open\"\n v-on=\"modalListeners\"\n >\n <div\n v-if=\"show && (hasSlotContent($slots.banner) || bannerTitle)\"\n data-qa=\"dt-modal-banner\"\n :class=\"[\n 'd-modal__banner',\n bannerClass,\n bannerKindClass,\n ]\"\n >\n <!-- @slot Slot for the banner, defaults to bannerTitle prop -->\n <slot name=\"banner\">\n {{ bannerTitle }}\n </slot>\n </div>\n <transition\n appear\n name=\"d-modal__dialog\"\n >\n <div\n v-show=\"show\"\n :class=\"[\n 'd-modal__dialog',\n { 'd-modal__dialog--scrollable': fixedHeaderFooter },\n dialogClass,\n ]\"\n role=\"dialog\"\n aria-modal=\"true\"\n :aria-describedby=\"describedById\"\n :aria-labelledby=\"labelledById\"\n >\n <div\n v-if=\"hasSlotContent($slots.header)\"\n :id=\"labelledById\"\n class=\"d-modal__header\"\n data-qa=\"dt-modal-title\"\n >\n <!-- @slot Slot for dialog header section, taking the place of any \"title\" text prop -->\n <slot name=\"header\" />\n </div>\n <h2\n v-else\n :id=\"labelledById\"\n class=\"d-modal__header\"\n data-qa=\"dt-modal-title\"\n >\n {{ title }}\n </h2>\n <div\n v-if=\"hasSlotContent($slots.default)\"\n :class=\"[\n 'd-modal__content',\n contentClass,\n ]\"\n data-qa=\"dt-modal-copy\"\n >\n <!-- @slot Default slot for dialog body section, taking the place of any \"copy\" text prop -->\n <slot />\n </div>\n <p\n v-else\n :class=\"[\n 'd-modal__content',\n contentClass,\n ]\"\n data-qa=\"dt-modal-copy\"\n >\n {{ copy }}\n </p>\n <footer\n v-if=\"hasFooterSlot\"\n class=\"d-modal__footer\"\n >\n <!-- @slot Slot for dialog footer content, often containing cancel and confirm buttons. -->\n <slot name=\"footer\" />\n </footer>\n <dt-button\n v-if=\"!hideClose\"\n class=\"d-modal__close\"\n circle\n size=\"lg\"\n importance=\"clear\"\n :aria-label=\"closeButtonProps.ariaLabel\"\n v-bind=\"closeButtonProps\"\n @click=\"close\"\n >\n <template #icon>\n <dt-icon\n name=\"close\"\n size=\"400\"\n />\n </template>\n </dt-button>\n <sr-only-close-button\n v-if=\"showVisuallyHiddenClose\"\n :visually-hidden-close-label=\"visuallyHiddenCloseLabel\"\n @close=\"close\"\n />\n </div>\n </transition>\n </dt-lazy-show>\n</template>\n\n<script>\n/* eslint-disable max-lines */\nimport { DtButton } from '@/components/button';\nimport { DtIcon } from '@/components/icon';\nimport Modal from '@/common/mixins/modal';\nimport {\n MODAL_BANNER_KINDS,\n MODAL_KIND_MODIFIERS,\n MODAL_SIZE_MODIFIERS,\n} from './modal_constants';\nimport { getUniqueString, hasSlotContent } from '@/common/utils';\nimport { DtLazyShow } from '@/components/lazy_show';\nimport { EVENT_KEYNAMES } from '@/common/constants';\nimport SrOnlyCloseButtonMixin from '@/common/mixins/sr_only_close_button';\nimport SrOnlyCloseButton from '@/common/sr_only_close_button.vue';\nimport { NOTICE_KINDS } from '@/components/notice';\n\n/**\n * Modals focus the user’s attention exclusively on one task or piece of information\n * via a window that sits on top of the page content.\n * @see https://dialtone.dialpad.com/components/modal.html\n */\nexport default {\n name: 'DtModal',\n\n components: {\n DtLazyShow,\n DtButton,\n DtIcon,\n SrOnlyCloseButton,\n },\n\n mixins: [Modal, SrOnlyCloseButtonMixin],\n\n props: {\n /**\n * A set of props to be passed into the modal's close button.\n * Requires an 'ariaLabel' property.\n */\n closeButtonProps: {\n type: Object,\n required: true,\n validator: (props) => {\n return !!props.ariaLabel;\n },\n },\n\n /**\n * Body text to display as the modal's main content.\n */\n copy: {\n type: String,\n default: '',\n },\n\n /**\n * Id to use for the dialog's aria-describedby.\n * Recommended only if the dialog content itself isn't enough to give full context,\n * as screen readers should recite the dialog contents by default before any aria-description.\n */\n describedById: {\n type: String,\n default: '',\n },\n\n /**\n * Id to use for the dialog's aria-labelledby.\n */\n labelledById: {\n type: String,\n default: function () { return getUniqueString(); },\n },\n\n /**\n * Whether the modal should be shown.\n * Parent component can sync on this value to control the modal's visibility.\n * @values true, false\n */\n show: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Title text to display in the modal header.\n */\n title: {\n type: String,\n default: '',\n },\n\n /**\n * Title text to display in the modal banner.\n */\n bannerTitle: {\n type: String,\n default: '',\n },\n\n /**\n * The theme of the modal. kind - default or danger,\n * @values default, danger\n */\n kind: {\n type: String,\n default: 'default',\n validator: (k) => Object.keys(MODAL_KIND_MODIFIERS).includes(k),\n },\n\n /**\n * The size of the modal. size - default or full,\n * @values default, full\n */\n size: {\n type: String,\n default: 'default',\n validator: (s) => Object.keys(MODAL_SIZE_MODIFIERS).includes(s),\n },\n\n /**\n * Additional class name for the root modal element.\n * Can accept String, Object, and Array, i.e. has the\n * same API as Vue's built-in handling of the class attribute.\n */\n modalClass: {\n type: [String, Object, Array],\n default: '',\n },\n\n /**\n * Additional class name for the dialog element within the modal.\n * Can accept String, Object, and Array, i.e. has the\n * same API as Vue's built-in handling of the class attribute.\n */\n dialogClass: {\n type: [String, Object, Array],\n default: '',\n },\n\n /**\n * Additional class name for the content element within the modal.\n * Can accept String, Object, and Array, i.e. has the\n * same API as Vue's built-in handling of the class attribute.\n */\n contentClass: {\n type: [String, Object, Array],\n default: '',\n },\n\n /**\n * Sets the color of the banner.\n * @values base, error, info, success, warning\n */\n bannerKind: {\n type: String,\n default: 'warning',\n validate (kind) {\n return NOTICE_KINDS.includes(kind);\n },\n },\n\n /**\n * Additional class name for the banner element within the modal.\n * Can accept String, Object, and Array, i.e. has the\n * same API as Vue's built-in handling of the class attribute.\n */\n bannerClass: {\n type: [String, Object, Array],\n default: '',\n },\n\n /**\n * Hides the close button on the modal\n * @values true, false\n */\n hideClose: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Whether the modal will close when you click outside of the dialog on the overlay.\n * @values true, false\n */\n closeOnClick: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Scrollable modal that allows scroll the modal content keeping the header and footer fixed\n * @values true, false\n */\n fixedHeaderFooter: {\n type: Boolean,\n default: true,\n },\n\n /**\n * The element that is focused when the modal is opened. This can be an\n * HTMLElement within the modal, a string starting with '#' which will\n * find the element by ID. 'first' which will automatically focus\n * the first element, or 'dialog' which will focus the dialog window itself.\n * If the dialog is modal this prop cannot be 'none'.\n */\n initialFocusElement: {\n type: [String, HTMLElement],\n default: 'first',\n validator: initialFocusElement => {\n return initialFocusElement === 'first' ||\n (initialFocusElement instanceof HTMLElement) ||\n initialFocusElement.startsWith('#');\n },\n },\n },\n\n emits: [\n /**\n * Native button click event\n *\n * @event click\n * @type {PointerEvent | KeyboardEvent}\n */\n 'click',\n\n /**\n * Native keydown event\n *\n * @event keydown\n * @type {KeyboardEvent}\n */\n 'keydown',\n\n /**\n * The modal will emit a \"false\" boolean value for this event when the user performs a modal-closing action.\n * Parent components can sync on this value to create a 2-way binding to control modal visibility.\n *\n * @event update:show\n * @type {Boolean}\n */\n 'update:show',\n ],\n\n data () {\n return {\n MODAL_KIND_MODIFIERS,\n MODAL_SIZE_MODIFIERS,\n MODAL_BANNER_KINDS,\n EVENT_KEYNAMES,\n hasSlotContent,\n };\n },\n\n computed: {\n modalListeners () {\n return {\n click: event => {\n if (!this.closeOnClick) return;\n (event.target === event.currentTarget) && this.close();\n this.$emit('click', event);\n },\n\n keydown: event => {\n switch (event.code) {\n case EVENT_KEYNAMES.esc:\n case EVENT_KEYNAMES.escape:\n this.close();\n break;\n case EVENT_KEYNAMES.tab:\n this.trapFocus(event);\n break;\n }\n this.$emit('keydown', event);\n },\n\n 'after-enter': event => {\n this.$emit('update:show', true);\n (event.target === event.currentTarget) && this.setFocusAfterTransition();\n },\n };\n },\n\n open () {\n return `${!this.show}`;\n },\n\n hasFooterSlot () {\n return !!this.$slots.footer;\n },\n\n bannerKindClass () {\n return MODAL_BANNER_KINDS[this.bannerKind];\n },\n },\n\n watch: {\n show: {\n immediate: true,\n handler (isShowing) {\n if (isShowing) {\n // Set a reference to the previously-active element, to which we'll return focus on modal close.\n this.previousActiveElement = document.activeElement;\n } else {\n // Modal is being hidden, so return focus to the previously active element before clearing the reference.\n this.previousActiveElement?.focus();\n this.previousActiveElement = null;\n }\n },\n },\n\n $props: {\n immediate: true,\n deep: true,\n handler () {\n this.validateProps();\n },\n },\n },\n\n methods: {\n close () {\n this.$emit('update:show', false);\n },\n\n setFocusAfterTransition () {\n if (this.initialFocusElement === 'first') {\n this.focusFirstElement();\n } else if (this.initialFocusElement.startsWith('#')) {\n this.focusElementById(this.initialFocusElement);\n } else if (this.initialFocusElement instanceof HTMLElement) {\n this.initialFocusElement.focus();\n }\n },\n\n trapFocus (e) {\n if (this.show) {\n this.focusTrappedTabPress(e);\n }\n },\n\n validateProps () {\n if (this.hideClose && !this.visuallyHiddenClose) {\n console.error(`If hideClose prop is true, visuallyHiddenClose and visuallyHiddenCloseLabel props\n need to be set so the component always includes a close button`);\n }\n },\n },\n};\n</script>\n"],"names":["_openBlock","_createBlock","_mergeProps","_toHandlers","_createElementBlock","_normalizeClass","_renderSlot","_createVNode","_Transition","_createElementVNode"],"mappings":";;;;;;;;;;;;;;AACY,MAAC,uBAAuB;AAAA,EAClC,SAAS;AAAA,EACT,QAAQ;AACV;AAGY,MAAC,uBAAuB;AAAA,EAClC,SAAS;AAAA,EACT,MAAM;AACR;AAEY,MAAC,qBAAqB;AAAA,EAChC,OAAO;AAAA,EACP,MAAM;AAAA,EACN,SAAS;AAAA,EACT,SAAS;AAAA,EACT,MAAM;AACR;ACwHA,MAAK,YAAU;AAAA,EACb,MAAM;AAAA,EAEN,YAAY;AAAA,IACV;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD;AAAA,EAED,QAAQ,CAAC,OAAO,sBAAsB;AAAA,EAEtC,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA,IAKL,kBAAkB;AAAA,MAChB,MAAM;AAAA,MACN,UAAU;AAAA,MACV,WAAW,CAAC,UAAU;AACpB,eAAO,CAAC,CAAC,MAAM;AAAA,MAChB;AAAA,IACF;AAAA;AAAA;AAAA;AAAA,IAKD,MAAM;AAAA,MACJ,MAAM;AAAA,MACN,SAAS;AAAA,IACV;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOD,eAAe;AAAA,MACb,MAAM;AAAA,MACN,SAAS;AAAA,IACV;AAAA;AAAA;AAAA;AAAA,IAKD,cAAc;A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;AAAA;gBAAgD,OAAY;AAAA;cAIlE,WAAQ;AAAA;cAGRC,WAAQ,KAAA,QAAA,SAAA;AAAA,mCAEVF,mBASI,KAAA;AAAA;cAPD,OAAKC,eAAA;AAAA;gBAAgD,OAAY;AAAA;cAIlE,WAAQ;AAAA,+BAEL,OAAI,IAAA,GAAA,CAAA;AAAA,YAGD,SAAa,iBADrBL,aAAAI,mBAMS,UANT,YAMS;AAAA,cADPE,WAAsB,KAAA,QAAA,QAAA;AAAA;aAGf,OAAS,aADlBN,aAAAC,YAgBY,sBAhBZC,WAgBY;AAAA;cAdV,OAAM;AAAA,cACN,QAAA;AAAA,cACA,MAAK;AAAA,cACL,YAAW;AAAA,cACV,cAAY,OAAgB,iBAAC;AAAA,eACtB,OAAgB,kBAAA,EACvB,SAAO,SAAK,MAAA,CAAA,GAAA;AAAA,cAEF,cACT,MAGE;AAAA,gBAHFK,YAGE,oBAAA;AAAA,kBAFA,MAAK;AAAA,kBACL,MAAK;AAAA;;;;YAKH,KAAuB,wCAD/BN,YAIE,iCAAA;AAAA;cAFC,+BAA6B,KAAwB;AAAA,cACrD,SAAO,SAAK;AAAA;;oBA5EP,OAAI,IAAA;AAAA;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"modal.js","sources":["../../components/modal/modal_constants.js","../../components/modal/modal.vue"],"sourcesContent":["// Modal style modifiers\nexport const MODAL_KIND_MODIFIERS = {\n default: '',\n danger: 'd-modal--danger',\n};\n\n// Modal size modifiers\nexport const MODAL_SIZE_MODIFIERS = {\n default: '',\n full: 'd-modal--full',\n};\n\nexport const MODAL_BANNER_KINDS = {\n error: 'd-modal__banner--critical',\n info: 'd-modal__banner--info',\n success: 'd-modal__banner--success',\n warning: 'd-modal__banner--warning',\n base: 'd-modal__banner--general',\n};\n","<template>\n <dt-lazy-show\n transition=\"d-zoom\"\n :show=\"show\"\n :class=\"[\n 'd-modal',\n MODAL_KIND_MODIFIERS[kind],\n MODAL_SIZE_MODIFIERS[size],\n modalClass,\n ]\"\n data-qa=\"dt-modal\"\n :aria-hidden=\"open\"\n v-on=\"modalListeners\"\n >\n <div\n v-if=\"show && (hasSlotContent($slots.banner) || bannerTitle)\"\n data-qa=\"dt-modal-banner\"\n :class=\"[\n 'd-modal__banner',\n bannerClass,\n bannerKindClass,\n ]\"\n >\n <!-- @slot Slot for the banner, defaults to bannerTitle prop -->\n <slot name=\"banner\">\n {{ bannerTitle }}\n </slot>\n </div>\n <transition\n appear\n name=\"d-modal__dialog\"\n >\n <div\n v-show=\"show\"\n :class=\"[\n 'd-modal__dialog',\n { 'd-modal__dialog--scrollable': fixedHeaderFooter },\n dialogClass,\n ]\"\n role=\"dialog\"\n aria-modal=\"true\"\n :aria-describedby=\"describedById\"\n :aria-labelledby=\"labelledById\"\n >\n <div\n v-if=\"hasSlotContent($slots.header)\"\n :id=\"labelledById\"\n class=\"d-modal__header\"\n data-qa=\"dt-modal-title\"\n >\n <!-- @slot Slot for dialog header section, taking the place of any \"title\" text prop -->\n <slot name=\"header\" />\n </div>\n <h2\n v-else\n :id=\"labelledById\"\n class=\"d-modal__header\"\n data-qa=\"dt-modal-title\"\n >\n {{ title }}\n </h2>\n <div\n v-if=\"hasSlotContent($slots.default)\"\n :class=\"[\n 'd-modal__content',\n contentClass,\n ]\"\n data-qa=\"dt-modal-copy\"\n >\n <!-- @slot Default slot for dialog body section, taking the place of any \"copy\" text prop -->\n <slot />\n </div>\n <p\n v-else\n :class=\"[\n 'd-modal__content',\n contentClass,\n ]\"\n data-qa=\"dt-modal-copy\"\n >\n {{ copy }}\n </p>\n <footer\n v-if=\"hasFooterSlot\"\n class=\"d-modal__footer\"\n >\n <!-- @slot Slot for dialog footer content, often containing cancel and confirm buttons. -->\n <slot name=\"footer\" />\n </footer>\n <dt-button\n v-if=\"!hideClose\"\n class=\"d-modal__close\"\n circle\n size=\"lg\"\n importance=\"clear\"\n :aria-label=\"closeButtonProps.ariaLabel\"\n v-bind=\"closeButtonProps\"\n @click=\"close\"\n >\n <template #icon>\n <dt-icon-close\n size=\"400\"\n />\n </template>\n </dt-button>\n <sr-only-close-button\n v-if=\"showVisuallyHiddenClose\"\n :visually-hidden-close-label=\"visuallyHiddenCloseLabel\"\n @close=\"close\"\n />\n </div>\n </transition>\n </dt-lazy-show>\n</template>\n\n<script>\n/* eslint-disable max-lines */\nimport { DtButton } from '@/components/button';\nimport { DtIconClose } from '@dialpad/dialtone-icons/vue3';\nimport Modal from '@/common/mixins/modal';\nimport {\n MODAL_BANNER_KINDS,\n MODAL_KIND_MODIFIERS,\n MODAL_SIZE_MODIFIERS,\n} from './modal_constants';\nimport { getUniqueString, hasSlotContent } from '@/common/utils';\nimport { DtLazyShow } from '@/components/lazy_show';\nimport { EVENT_KEYNAMES } from '@/common/constants';\nimport SrOnlyCloseButtonMixin from '@/common/mixins/sr_only_close_button';\nimport SrOnlyCloseButton from '@/common/sr_only_close_button.vue';\nimport { NOTICE_KINDS } from '@/components/notice';\n\n/**\n * Modals focus the user’s attention exclusively on one task or piece of information\n * via a window that sits on top of the page content.\n * @see https://dialtone.dialpad.com/components/modal.html\n */\nexport default {\n name: 'DtModal',\n\n components: {\n DtLazyShow,\n DtButton,\n DtIconClose,\n SrOnlyCloseButton,\n },\n\n mixins: [Modal, SrOnlyCloseButtonMixin],\n\n props: {\n /**\n * A set of props to be passed into the modal's close button.\n * Requires an 'ariaLabel' property.\n */\n closeButtonProps: {\n type: Object,\n required: true,\n validator: (props) => {\n return !!props.ariaLabel;\n },\n },\n\n /**\n * Body text to display as the modal's main content.\n */\n copy: {\n type: String,\n default: '',\n },\n\n /**\n * Id to use for the dialog's aria-describedby.\n * Recommended only if the dialog content itself isn't enough to give full context,\n * as screen readers should recite the dialog contents by default before any aria-description.\n */\n describedById: {\n type: String,\n default: '',\n },\n\n /**\n * Id to use for the dialog's aria-labelledby.\n */\n labelledById: {\n type: String,\n default: function () { return getUniqueString(); },\n },\n\n /**\n * Whether the modal should be shown.\n * Parent component can sync on this value to control the modal's visibility.\n * @values true, false\n */\n show: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Title text to display in the modal header.\n */\n title: {\n type: String,\n default: '',\n },\n\n /**\n * Title text to display in the modal banner.\n */\n bannerTitle: {\n type: String,\n default: '',\n },\n\n /**\n * The theme of the modal. kind - default or danger,\n * @values default, danger\n */\n kind: {\n type: String,\n default: 'default',\n validator: (k) => Object.keys(MODAL_KIND_MODIFIERS).includes(k),\n },\n\n /**\n * The size of the modal. size - default or full,\n * @values default, full\n */\n size: {\n type: String,\n default: 'default',\n validator: (s) => Object.keys(MODAL_SIZE_MODIFIERS).includes(s),\n },\n\n /**\n * Additional class name for the root modal element.\n * Can accept String, Object, and Array, i.e. has the\n * same API as Vue's built-in handling of the class attribute.\n */\n modalClass: {\n type: [String, Object, Array],\n default: '',\n },\n\n /**\n * Additional class name for the dialog element within the modal.\n * Can accept String, Object, and Array, i.e. has the\n * same API as Vue's built-in handling of the class attribute.\n */\n dialogClass: {\n type: [String, Object, Array],\n default: '',\n },\n\n /**\n * Additional class name for the content element within the modal.\n * Can accept String, Object, and Array, i.e. has the\n * same API as Vue's built-in handling of the class attribute.\n */\n contentClass: {\n type: [String, Object, Array],\n default: '',\n },\n\n /**\n * Sets the color of the banner.\n * @values base, error, info, success, warning\n */\n bannerKind: {\n type: String,\n default: 'warning',\n validate (kind) {\n return NOTICE_KINDS.includes(kind);\n },\n },\n\n /**\n * Additional class name for the banner element within the modal.\n * Can accept String, Object, and Array, i.e. has the\n * same API as Vue's built-in handling of the class attribute.\n */\n bannerClass: {\n type: [String, Object, Array],\n default: '',\n },\n\n /**\n * Hides the close button on the modal\n * @values true, false\n */\n hideClose: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Whether the modal will close when you click outside of the dialog on the overlay.\n * @values true, false\n */\n closeOnClick: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Scrollable modal that allows scroll the modal content keeping the header and footer fixed\n * @values true, false\n */\n fixedHeaderFooter: {\n type: Boolean,\n default: true,\n },\n\n /**\n * The element that is focused when the modal is opened. This can be an\n * HTMLElement within the modal, a string starting with '#' which will\n * find the element by ID. 'first' which will automatically focus\n * the first element, or 'dialog' which will focus the dialog window itself.\n * If the dialog is modal this prop cannot be 'none'.\n */\n initialFocusElement: {\n type: [String, HTMLElement],\n default: 'first',\n validator: initialFocusElement => {\n return initialFocusElement === 'first' ||\n (initialFocusElement instanceof HTMLElement) ||\n initialFocusElement.startsWith('#');\n },\n },\n },\n\n emits: [\n /**\n * Native button click event\n *\n * @event click\n * @type {PointerEvent | KeyboardEvent}\n */\n 'click',\n\n /**\n * Native keydown event\n *\n * @event keydown\n * @type {KeyboardEvent}\n */\n 'keydown',\n\n /**\n * The modal will emit a \"false\" boolean value for this event when the user performs a modal-closing action.\n * Parent components can sync on this value to create a 2-way binding to control modal visibility.\n *\n * @event update:show\n * @type {Boolean}\n */\n 'update:show',\n ],\n\n data () {\n return {\n MODAL_KIND_MODIFIERS,\n MODAL_SIZE_MODIFIERS,\n MODAL_BANNER_KINDS,\n EVENT_KEYNAMES,\n hasSlotContent,\n };\n },\n\n computed: {\n modalListeners () {\n return {\n click: event => {\n if (!this.closeOnClick) return;\n (event.target === event.currentTarget) && this.close();\n this.$emit('click', event);\n },\n\n keydown: event => {\n switch (event.code) {\n case EVENT_KEYNAMES.esc:\n case EVENT_KEYNAMES.escape:\n this.close();\n break;\n case EVENT_KEYNAMES.tab:\n this.trapFocus(event);\n break;\n }\n this.$emit('keydown', event);\n },\n\n 'after-enter': event => {\n this.$emit('update:show', true);\n (event.target === event.currentTarget) && this.setFocusAfterTransition();\n },\n };\n },\n\n open () {\n return `${!this.show}`;\n },\n\n hasFooterSlot () {\n return !!this.$slots.footer;\n },\n\n bannerKindClass () {\n return MODAL_BANNER_KINDS[this.bannerKind];\n },\n },\n\n watch: {\n show: {\n immediate: true,\n handler (isShowing) {\n if (isShowing) {\n // Set a reference to the previously-active element, to which we'll return focus on modal close.\n this.previousActiveElement = document.activeElement;\n } else {\n // Modal is being hidden, so return focus to the previously active element before clearing the reference.\n this.previousActiveElement?.focus();\n this.previousActiveElement = null;\n }\n },\n },\n\n $props: {\n immediate: true,\n deep: true,\n handler () {\n this.validateProps();\n },\n },\n },\n\n methods: {\n close () {\n this.$emit('update:show', false);\n },\n\n setFocusAfterTransition () {\n if (this.initialFocusElement === 'first') {\n this.focusFirstElement();\n } else if (this.initialFocusElement.startsWith('#')) {\n this.focusElementById(this.initialFocusElement);\n } else if (this.initialFocusElement instanceof HTMLElement) {\n this.initialFocusElement.focus();\n }\n },\n\n trapFocus (e) {\n if (this.show) {\n this.focusTrappedTabPress(e);\n }\n },\n\n validateProps () {\n if (this.hideClose && !this.visuallyHiddenClose) {\n console.error(`If hideClose prop is true, visuallyHiddenClose and visuallyHiddenCloseLabel props\n need to be set so the component always includes a close button`);\n }\n },\n },\n};\n</script>\n"],"names":["_openBlock","_createBlock","_mergeProps","_toHandlers","_createElementBlock","_normalizeClass","_renderSlot","_createVNode","_Transition","_createElementVNode"],"mappings":";;;;;;;;;;;AACY,MAAC,uBAAuB;AAAA,EAClC,SAAS;AAAA,EACT,QAAQ;AACV;AAGY,MAAC,uBAAuB;AAAA,EAClC,SAAS;AAAA,EACT,MAAM;AACR;AAEY,MAAC,qBAAqB;AAAA,EAChC,OAAO;AAAA,EACP,MAAM;AAAA,EACN,SAAS;AAAA,EACT,SAAS;AAAA,EACT,MAAM;AACR;ACuHA,MAAK,YAAU;AAAA,EACb,MAAM;AAAA,EAEN,YAAY;AAAA,IACV;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD;AAAA,EAED,QAAQ,CAAC,OAAO,sBAAsB;AAAA,EAEtC,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA,IAKL,kBAAkB;AAAA,MAChB,MAAM;AAAA,MACN,UAAU;AAAA,MACV,WAAW,CAAC,UAAU;AACpB,eAAO,CAAC,CAAC,MAAM;AAAA,MAChB;AAAA,IACF;AAAA;AAAA;AAAA;AAAA,IAKD,MAAM;AAAA,M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AAY;AAAA,cACjB,OAAM;AAAA,cACN,WAAQ;AAAA,+BAEL,OAAK,KAAA,GAAA,GAAA,UAAA;AAAA,YAGF,MAAc,eAAC,KAAM,OAAC,OAAO,kBADrCA,mBAUM,OAAA;AAAA;cARH,OAAKC,eAAA;AAAA;gBAAgD,OAAY;AAAA;cAIlE,WAAQ;AAAA;cAGRC,WAAQ,KAAA,QAAA,SAAA;AAAA,mCAEVF,mBASI,KAAA;AAAA;cAPD,OAAKC,eAAA;AAAA;gBAAgD,OAAY;AAAA;cAIlE,WAAQ;AAAA,+BAEL,OAAI,IAAA,GAAA,CAAA;AAAA,YAGD,SAAa,iBADrBL,aAAAI,mBAMS,UANT,YAMS;AAAA,cADPE,WAAsB,KAAA,QAAA,QAAA;AAAA;aAGf,OAAS,aADlBN,aAAAC,YAeY,sBAfZC,WAeY;AAAA;cAbV,OAAM;AAAA,cACN,QAAA;AAAA,cACA,MAAK;AAAA,cACL,YAAW;AAAA,cACV,cAAY,OAAgB,iBAAC;AAAA,eACtB,OAAgB,kBAAA,EACvB,SAAO,SAAK,MAAA,CAAA,GAAA;AAAA,cAEF,cACT,MAEE;AAAA,gBAFFK,YAEE,0BAAA,EADA,MAAK,MAAK,CAAA;AAAA;;;YAKR,KAAuB,wCAD/BN,YAIE,iCAAA;AAAA;cAFC,+BAA6B,KAAwB;AAAA,cACrD,SAAO,SAAK;AAAA;;oBA3EP,OAAI,IAAA;AAAA;;;;;;;;;"}
|
package/dist/vue3/lib/notice.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const notice_action = require("../chunks/notice_action-
|
|
3
|
+
const notice_action = require("../chunks/notice_action-i55KZMfG.js");
|
|
4
4
|
const notice_constants = require("../chunks/notice_constants-UXo9e3bS.js");
|
|
5
|
-
const sr_only_close_button = require("../chunks/sr_only_close_button-
|
|
5
|
+
const sr_only_close_button = require("../chunks/sr_only_close_button-Gl43uI6m.js");
|
|
6
6
|
const vue = require("vue");
|
|
7
7
|
const _pluginVue_exportHelper = require("../chunks/_plugin-vue_export-helper-fhnQq0tA.js");
|
|
8
8
|
require("../common/utils.cjs");
|
package/dist/vue3/lib/notice.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { DtNoticeIcon, DtNoticeContent, DtNoticeAction } from "../chunks/notice_action-
|
|
1
|
+
import { DtNoticeIcon, DtNoticeContent, DtNoticeAction } from "../chunks/notice_action-5nPX2mSu.js";
|
|
2
2
|
import { NOTICE_ROLES, NOTICE_KINDS } from "../chunks/notice_constants-7Qt2CQEY.js";
|
|
3
|
-
import { SrOnlyCloseButtonMixin } from "../chunks/sr_only_close_button-
|
|
3
|
+
import { SrOnlyCloseButtonMixin } from "../chunks/sr_only_close_button-q23hJuAf.js";
|
|
4
4
|
import { resolveComponent, openBlock, createElementBlock, normalizeClass, createBlock, withCtx, renderSlot, createCommentVNode, createVNode } from "vue";
|
|
5
5
|
import { _export_sfc } from "../chunks/_plugin-vue_export-helper-caHeSgYY.js";
|
|
6
6
|
import "../common/utils.js";
|
|
@@ -1,20 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const vue3 = require("@dialpad/dialtone-icons/vue3");
|
|
3
4
|
const vue = require("vue");
|
|
4
5
|
const _pluginVue_exportHelper = require("../chunks/_plugin-vue_export-helper-fhnQq0tA.js");
|
|
5
6
|
const lib_button = require("./button.cjs");
|
|
6
|
-
const lib_icon = require("./icon.cjs");
|
|
7
7
|
require("../common/utils.cjs");
|
|
8
8
|
require("../common/constants.cjs");
|
|
9
9
|
require("../chunks/link_constants-x8NwdqmA.js");
|
|
10
|
-
require("@dialpad/dialtone-icons/vue3");
|
|
11
|
-
require("../chunks/icon_constants-da57m7BZ.js");
|
|
12
|
-
require("@dialpad/dialtone-icons/icons.js");
|
|
13
10
|
const _sfc_main = {
|
|
14
11
|
name: "DtPagination",
|
|
15
12
|
components: {
|
|
16
13
|
DtButton: lib_button.DtButton,
|
|
17
|
-
|
|
14
|
+
DtIconChevronLeft: vue3.DtIconChevronLeft,
|
|
15
|
+
DtIconChevronRight: vue3.DtIconChevronRight,
|
|
16
|
+
DtIconMoreHorizontal: vue3.DtIconMoreHorizontal
|
|
18
17
|
},
|
|
19
18
|
props: {
|
|
20
19
|
/**
|
|
@@ -134,8 +133,10 @@ const _hoisted_2 = {
|
|
|
134
133
|
"data-qa": "dt-pagination-separator"
|
|
135
134
|
};
|
|
136
135
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
137
|
-
const
|
|
136
|
+
const _component_dt_icon_chevron_left = vue.resolveComponent("dt-icon-chevron-left");
|
|
138
137
|
const _component_dt_button = vue.resolveComponent("dt-button");
|
|
138
|
+
const _component_dt_icon_more_horizontal = vue.resolveComponent("dt-icon-more-horizontal");
|
|
139
|
+
const _component_dt_icon_chevron_right = vue.resolveComponent("dt-icon-chevron-right");
|
|
139
140
|
return vue.openBlock(), vue.createElementBlock("nav", {
|
|
140
141
|
"aria-label": $props.ariaLabel,
|
|
141
142
|
class: "d-pagination"
|
|
@@ -150,10 +151,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
150
151
|
onClick: _cache[0] || (_cache[0] = ($event) => $options.changePage($data.currentPage - 1))
|
|
151
152
|
}, {
|
|
152
153
|
icon: vue.withCtx(() => [
|
|
153
|
-
vue.createVNode(
|
|
154
|
-
name: "chevron-left",
|
|
155
|
-
size: "300"
|
|
156
|
-
})
|
|
154
|
+
vue.createVNode(_component_dt_icon_chevron_left, { size: "300" })
|
|
157
155
|
]),
|
|
158
156
|
_: 1
|
|
159
157
|
}, 8, ["aria-label", "kind", "importance", "disabled", "class"]),
|
|
@@ -163,10 +161,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
163
161
|
class: vue.normalizeClass({ "d-pagination__separator": isNaN(Number(page)) })
|
|
164
162
|
}, [
|
|
165
163
|
isNaN(Number(page)) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2, [
|
|
166
|
-
vue.createVNode(
|
|
167
|
-
name: "more-horizontal",
|
|
168
|
-
size: "300"
|
|
169
|
-
})
|
|
164
|
+
vue.createVNode(_component_dt_icon_more_horizontal, { size: "300" })
|
|
170
165
|
])) : (vue.openBlock(), vue.createBlock(_component_dt_button, {
|
|
171
166
|
key: 1,
|
|
172
167
|
"aria-label": $props.pageNumberAriaLabel(page),
|
|
@@ -192,10 +187,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
192
187
|
onClick: _cache[1] || (_cache[1] = ($event) => $options.changePage($data.currentPage + 1))
|
|
193
188
|
}, {
|
|
194
189
|
icon: vue.withCtx(() => [
|
|
195
|
-
vue.createVNode(
|
|
196
|
-
name: "chevron-right",
|
|
197
|
-
size: "300"
|
|
198
|
-
})
|
|
190
|
+
vue.createVNode(_component_dt_icon_chevron_right, { size: "300" })
|
|
199
191
|
]),
|
|
200
192
|
_: 1
|
|
201
193
|
}, 8, ["aria-label", "disabled", "importance", "class"])
|