@dialpad/dialtone 9.91.1 → 9.93.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/css/dialtone-default-theme.css +204 -22
- package/dist/css/dialtone-default-theme.min.css +1 -1
- package/dist/css/dialtone.css +204 -22
- package/dist/css/dialtone.min.css +1 -1
- package/dist/tokens/doc.json +23187 -23187
- package/dist/vue2/component-documentation.json +1 -1
- package/dist/vue2/components/hovercard/hovercard.vue.cjs +32 -12
- package/dist/vue2/components/hovercard/hovercard.vue.cjs.map +1 -1
- package/dist/vue2/components/hovercard/hovercard.vue.js +33 -13
- package/dist/vue2/components/hovercard/hovercard.vue.js.map +1 -1
- package/dist/vue2/components/popover/popover.vue.cjs +21 -43
- package/dist/vue2/components/popover/popover.vue.cjs.map +1 -1
- package/dist/vue2/components/popover/popover.vue.js +21 -43
- package/dist/vue2/components/popover/popover.vue.js.map +1 -1
- package/dist/vue2/components/rich_text_editor/extensions/image/image.cjs +30 -0
- package/dist/vue2/components/rich_text_editor/extensions/image/image.cjs.map +1 -0
- package/dist/vue2/components/rich_text_editor/extensions/image/image.js +30 -0
- package/dist/vue2/components/rich_text_editor/extensions/image/image.js.map +1 -0
- package/dist/vue2/components/rich_text_editor/extensions/image/index.cjs +5 -0
- package/dist/vue2/components/rich_text_editor/extensions/image/index.cjs.map +1 -0
- package/dist/vue2/components/rich_text_editor/extensions/image/index.js +5 -0
- package/dist/vue2/components/rich_text_editor/extensions/image/index.js.map +1 -0
- package/dist/vue2/components/rich_text_editor/rich_text_editor.vue.cjs +2 -2
- package/dist/vue2/components/rich_text_editor/rich_text_editor.vue.cjs.map +1 -1
- package/dist/vue2/components/rich_text_editor/rich_text_editor.vue.js +2 -2
- package/dist/vue2/components/rich_text_editor/rich_text_editor.vue.js.map +1 -1
- package/dist/vue2/recipes/buttons/callbar_button/callbar_button.vue.cjs +2 -4
- package/dist/vue2/recipes/buttons/callbar_button/callbar_button.vue.cjs.map +1 -1
- package/dist/vue2/recipes/buttons/callbar_button/callbar_button.vue.js +2 -4
- package/dist/vue2/recipes/buttons/callbar_button/callbar_button.vue.js.map +1 -1
- package/dist/vue2/recipes/buttons/callbar_button_with_popover/callbar_button_with_popover.vue.cjs +1 -1
- package/dist/vue2/recipes/buttons/callbar_button_with_popover/callbar_button_with_popover.vue.cjs.map +1 -1
- package/dist/vue2/recipes/buttons/callbar_button_with_popover/callbar_button_with_popover.vue.js +1 -1
- package/dist/vue2/recipes/buttons/callbar_button_with_popover/callbar_button_with_popover.vue.js.map +1 -1
- package/dist/vue2/recipes/cards/ivr_node/ivr_node.vue.cjs +6 -14
- package/dist/vue2/recipes/cards/ivr_node/ivr_node.vue.cjs.map +1 -1
- package/dist/vue2/recipes/cards/ivr_node/ivr_node.vue.js +7 -15
- package/dist/vue2/recipes/cards/ivr_node/ivr_node.vue.js.map +1 -1
- package/dist/vue2/recipes/cards/ivr_node/ivr_node_constants.cjs +18 -18
- package/dist/vue2/recipes/cards/ivr_node/ivr_node_constants.cjs.map +1 -1
- package/dist/vue2/recipes/cards/ivr_node/ivr_node_constants.js +18 -18
- package/dist/vue2/recipes/cards/ivr_node/ivr_node_constants.js.map +1 -1
- package/dist/vue2/recipes/chips/grouped_chip/grouped_chip.vue.cjs +2 -2
- package/dist/vue2/recipes/chips/grouped_chip/grouped_chip.vue.cjs.map +1 -1
- package/dist/vue2/recipes/chips/grouped_chip/grouped_chip.vue.js +2 -2
- package/dist/vue2/recipes/chips/grouped_chip/grouped_chip.vue.js.map +1 -1
- package/dist/vue2/recipes/comboboxes/combobox_multi_select/combobox_multi_select.vue.cjs +6 -1
- package/dist/vue2/recipes/comboboxes/combobox_multi_select/combobox_multi_select.vue.cjs.map +1 -1
- package/dist/vue2/recipes/comboboxes/combobox_multi_select/combobox_multi_select.vue.js +6 -1
- package/dist/vue2/recipes/comboboxes/combobox_multi_select/combobox_multi_select.vue.js.map +1 -1
- package/dist/vue2/recipes/conversation_view/editor/editor.vue.cjs +127 -28
- package/dist/vue2/recipes/conversation_view/editor/editor.vue.cjs.map +1 -1
- package/dist/vue2/recipes/conversation_view/editor/editor.vue.js +127 -28
- package/dist/vue2/recipes/conversation_view/editor/editor.vue.js.map +1 -1
- package/dist/vue2/recipes/conversation_view/emoji_row/emoji_row.vue.cjs +1 -1
- package/dist/vue2/recipes/conversation_view/emoji_row/emoji_row.vue.cjs.map +1 -1
- package/dist/vue2/recipes/conversation_view/emoji_row/emoji_row.vue.js +1 -1
- package/dist/vue2/recipes/conversation_view/emoji_row/emoji_row.vue.js.map +1 -1
- package/dist/vue2/recipes/conversation_view/feed_item_pill/feed_item_pill.vue.cjs +1 -1
- package/dist/vue2/recipes/conversation_view/feed_item_pill/feed_item_pill.vue.cjs.map +1 -1
- package/dist/vue2/recipes/conversation_view/feed_item_pill/feed_item_pill.vue.js +1 -1
- package/dist/vue2/recipes/conversation_view/feed_item_pill/feed_item_pill.vue.js.map +1 -1
- package/dist/vue2/recipes/conversation_view/message_input/message_input.vue.cjs +1 -1
- package/dist/vue2/recipes/conversation_view/message_input/message_input.vue.cjs.map +1 -1
- package/dist/vue2/recipes/conversation_view/message_input/message_input.vue.js +1 -1
- package/dist/vue2/recipes/conversation_view/message_input/message_input.vue.js.map +1 -1
- package/dist/vue2/recipes/item_layout/contact_info/contact_info.vue.cjs +6 -1
- package/dist/vue2/recipes/item_layout/contact_info/contact_info.vue.cjs.map +1 -1
- package/dist/vue2/recipes/item_layout/contact_info/contact_info.vue.js +6 -1
- package/dist/vue2/recipes/item_layout/contact_info/contact_info.vue.js.map +1 -1
- package/dist/vue2/recipes/leftbar/contact_row/contact_row.vue.cjs +8 -12
- package/dist/vue2/recipes/leftbar/contact_row/contact_row.vue.cjs.map +1 -1
- package/dist/vue2/recipes/leftbar/contact_row/contact_row.vue.js +8 -12
- package/dist/vue2/recipes/leftbar/contact_row/contact_row.vue.js.map +1 -1
- package/dist/vue2/recipes/leftbar/general_row/general_row_constants.cjs +11 -11
- package/dist/vue2/recipes/leftbar/general_row/general_row_constants.cjs.map +1 -1
- package/dist/vue2/recipes/leftbar/general_row/general_row_constants.js +11 -11
- package/dist/vue2/recipes/leftbar/general_row/general_row_constants.js.map +1 -1
- package/dist/vue2/recipes/leftbar/general_row/leftbar_general_row_icon.vue.cjs +1 -8
- package/dist/vue2/recipes/leftbar/general_row/leftbar_general_row_icon.vue.cjs.map +1 -1
- package/dist/vue2/recipes/leftbar/general_row/leftbar_general_row_icon.vue.js +1 -8
- package/dist/vue2/recipes/leftbar/general_row/leftbar_general_row_icon.vue.js.map +1 -1
- package/dist/vue2/recipes/notices/top_banner_info/top_banner_info.vue.cjs +8 -8
- package/dist/vue2/recipes/notices/top_banner_info/top_banner_info.vue.cjs.map +1 -1
- package/dist/vue2/recipes/notices/top_banner_info/top_banner_info.vue.js +8 -8
- package/dist/vue2/recipes/notices/top_banner_info/top_banner_info.vue.js.map +1 -1
- package/dist/vue2/types/components/hovercard/hovercard.vue.d.ts.map +1 -1
- package/dist/vue2/types/components/rich_text_editor/extensions/image/image.d.ts +2 -0
- package/dist/vue2/types/components/rich_text_editor/extensions/image/image.d.ts.map +1 -0
- package/dist/vue2/types/components/rich_text_editor/extensions/image/index.d.ts +3 -0
- package/dist/vue2/types/components/rich_text_editor/extensions/image/index.d.ts.map +1 -0
- package/dist/vue2/types/recipes/buttons/callbar_button_with_popover/callbar_button_with_popover.vue.d.ts.map +1 -1
- package/dist/vue2/types/recipes/cards/ivr_node/ivr_node.vue.d.ts +1 -1
- package/dist/vue2/types/recipes/cards/ivr_node/ivr_node.vue.d.ts.map +1 -1
- package/dist/vue2/types/recipes/cards/ivr_node/ivr_node_constants.d.ts +11 -11
- package/dist/vue2/types/recipes/chips/grouped_chip/grouped_chip.vue.d.ts.map +1 -1
- package/dist/vue2/types/recipes/comboboxes/combobox_multi_select/combobox_multi_select.vue.d.ts.map +1 -1
- package/dist/vue2/types/recipes/conversation_view/editor/editor.vue.d.ts.map +1 -1
- package/dist/vue2/types/recipes/conversation_view/feed_item_pill/feed_item_pill.vue.d.ts +1 -1
- package/dist/vue2/types/recipes/conversation_view/message_input/message_input.vue.d.ts.map +1 -1
- package/dist/vue2/types/recipes/item_layout/contact_info/contact_info.vue.d.ts.map +1 -1
- package/dist/vue2/types/recipes/leftbar/contact_row/contact_row.vue.d.ts +1 -1
- package/dist/vue2/types/recipes/leftbar/general_row/general_row_constants.d.ts +6 -6
- package/dist/vue2/types/recipes/leftbar/general_row/leftbar_general_row_icon.vue.d.ts +0 -1
- package/dist/vue3/component-documentation.json +1 -1
- package/dist/vue3/components/hovercard/hovercard.vue.cjs +30 -4
- package/dist/vue3/components/hovercard/hovercard.vue.cjs.map +1 -1
- package/dist/vue3/components/hovercard/hovercard.vue.js +32 -6
- package/dist/vue3/components/hovercard/hovercard.vue.js.map +1 -1
- package/dist/vue3/components/popover/popover.vue.cjs +23 -45
- package/dist/vue3/components/popover/popover.vue.cjs.map +1 -1
- package/dist/vue3/components/popover/popover.vue.js +23 -45
- package/dist/vue3/components/popover/popover.vue.js.map +1 -1
- package/dist/vue3/components/rich_text_editor/extensions/image/image.cjs +30 -0
- package/dist/vue3/components/rich_text_editor/extensions/image/image.cjs.map +1 -0
- package/dist/vue3/components/rich_text_editor/extensions/image/image.js +30 -0
- package/dist/vue3/components/rich_text_editor/extensions/image/image.js.map +1 -0
- package/dist/vue3/components/rich_text_editor/extensions/image/index.cjs +5 -0
- package/dist/vue3/components/rich_text_editor/extensions/image/index.cjs.map +1 -0
- package/dist/vue3/components/rich_text_editor/extensions/image/index.js +5 -0
- package/dist/vue3/components/rich_text_editor/extensions/image/index.js.map +1 -0
- package/dist/vue3/components/rich_text_editor/rich_text_editor.vue.cjs +2 -2
- package/dist/vue3/components/rich_text_editor/rich_text_editor.vue.cjs.map +1 -1
- package/dist/vue3/components/rich_text_editor/rich_text_editor.vue.js +2 -2
- package/dist/vue3/components/rich_text_editor/rich_text_editor.vue.js.map +1 -1
- package/dist/vue3/recipes/buttons/callbar_button/callbar_button.vue.cjs +2 -4
- package/dist/vue3/recipes/buttons/callbar_button/callbar_button.vue.cjs.map +1 -1
- package/dist/vue3/recipes/buttons/callbar_button/callbar_button.vue.js +2 -4
- package/dist/vue3/recipes/buttons/callbar_button/callbar_button.vue.js.map +1 -1
- package/dist/vue3/recipes/buttons/callbar_button_with_popover/callbar_button_with_popover.vue.cjs +1 -2
- package/dist/vue3/recipes/buttons/callbar_button_with_popover/callbar_button_with_popover.vue.cjs.map +1 -1
- package/dist/vue3/recipes/buttons/callbar_button_with_popover/callbar_button_with_popover.vue.js +1 -2
- package/dist/vue3/recipes/buttons/callbar_button_with_popover/callbar_button_with_popover.vue.js.map +1 -1
- package/dist/vue3/recipes/cards/ivr_node/ivr_node.vue.cjs +10 -20
- package/dist/vue3/recipes/cards/ivr_node/ivr_node.vue.cjs.map +1 -1
- package/dist/vue3/recipes/cards/ivr_node/ivr_node.vue.js +11 -21
- package/dist/vue3/recipes/cards/ivr_node/ivr_node.vue.js.map +1 -1
- package/dist/vue3/recipes/cards/ivr_node/ivr_node_constants.cjs +18 -18
- package/dist/vue3/recipes/cards/ivr_node/ivr_node_constants.cjs.map +1 -1
- package/dist/vue3/recipes/cards/ivr_node/ivr_node_constants.js +18 -18
- package/dist/vue3/recipes/cards/ivr_node/ivr_node_constants.js.map +1 -1
- package/dist/vue3/recipes/chips/grouped_chip/grouped_chip.vue.cjs +1 -3
- package/dist/vue3/recipes/chips/grouped_chip/grouped_chip.vue.cjs.map +1 -1
- package/dist/vue3/recipes/chips/grouped_chip/grouped_chip.vue.js +1 -3
- package/dist/vue3/recipes/chips/grouped_chip/grouped_chip.vue.js.map +1 -1
- package/dist/vue3/recipes/comboboxes/combobox_multi_select/combobox_multi_select.vue.cjs +6 -1
- package/dist/vue3/recipes/comboboxes/combobox_multi_select/combobox_multi_select.vue.cjs.map +1 -1
- package/dist/vue3/recipes/comboboxes/combobox_multi_select/combobox_multi_select.vue.js +6 -1
- package/dist/vue3/recipes/comboboxes/combobox_multi_select/combobox_multi_select.vue.js.map +1 -1
- package/dist/vue3/recipes/conversation_view/editor/editor.vue.cjs +94 -96
- package/dist/vue3/recipes/conversation_view/editor/editor.vue.cjs.map +1 -1
- package/dist/vue3/recipes/conversation_view/editor/editor.vue.js +95 -97
- package/dist/vue3/recipes/conversation_view/editor/editor.vue.js.map +1 -1
- package/dist/vue3/recipes/conversation_view/emoji_row/emoji_row.vue.cjs +1 -1
- package/dist/vue3/recipes/conversation_view/emoji_row/emoji_row.vue.cjs.map +1 -1
- package/dist/vue3/recipes/conversation_view/emoji_row/emoji_row.vue.js +1 -1
- package/dist/vue3/recipes/conversation_view/emoji_row/emoji_row.vue.js.map +1 -1
- package/dist/vue3/recipes/conversation_view/feed_item_pill/feed_item_pill.vue.cjs +1 -1
- package/dist/vue3/recipes/conversation_view/feed_item_pill/feed_item_pill.vue.cjs.map +1 -1
- package/dist/vue3/recipes/conversation_view/feed_item_pill/feed_item_pill.vue.js +1 -1
- package/dist/vue3/recipes/conversation_view/feed_item_pill/feed_item_pill.vue.js.map +1 -1
- package/dist/vue3/recipes/conversation_view/message_input/message_input.vue.cjs +1 -1
- package/dist/vue3/recipes/conversation_view/message_input/message_input.vue.cjs.map +1 -1
- package/dist/vue3/recipes/conversation_view/message_input/message_input.vue.js +1 -1
- package/dist/vue3/recipes/conversation_view/message_input/message_input.vue.js.map +1 -1
- package/dist/vue3/recipes/item_layout/contact_info/contact_info.vue.cjs +6 -1
- package/dist/vue3/recipes/item_layout/contact_info/contact_info.vue.cjs.map +1 -1
- package/dist/vue3/recipes/item_layout/contact_info/contact_info.vue.js +6 -1
- package/dist/vue3/recipes/item_layout/contact_info/contact_info.vue.js.map +1 -1
- package/dist/vue3/recipes/leftbar/contact_row/contact_row.vue.cjs +8 -12
- package/dist/vue3/recipes/leftbar/contact_row/contact_row.vue.cjs.map +1 -1
- package/dist/vue3/recipes/leftbar/contact_row/contact_row.vue.js +8 -12
- package/dist/vue3/recipes/leftbar/contact_row/contact_row.vue.js.map +1 -1
- package/dist/vue3/recipes/leftbar/general_row/general_row_constants.cjs +11 -11
- package/dist/vue3/recipes/leftbar/general_row/general_row_constants.cjs.map +1 -1
- package/dist/vue3/recipes/leftbar/general_row/general_row_constants.js +11 -11
- package/dist/vue3/recipes/leftbar/general_row/general_row_constants.js.map +1 -1
- package/dist/vue3/recipes/leftbar/general_row/leftbar_general_row_icon.vue.cjs +7 -13
- package/dist/vue3/recipes/leftbar/general_row/leftbar_general_row_icon.vue.cjs.map +1 -1
- package/dist/vue3/recipes/leftbar/general_row/leftbar_general_row_icon.vue.js +7 -13
- package/dist/vue3/recipes/leftbar/general_row/leftbar_general_row_icon.vue.js.map +1 -1
- package/dist/vue3/recipes/notices/top_banner_info/top_banner_info.vue.cjs +8 -8
- package/dist/vue3/recipes/notices/top_banner_info/top_banner_info.vue.cjs.map +1 -1
- package/dist/vue3/recipes/notices/top_banner_info/top_banner_info.vue.js +8 -8
- package/dist/vue3/recipes/notices/top_banner_info/top_banner_info.vue.js.map +1 -1
- package/dist/vue3/types/components/hovercard/hovercard.vue.d.ts.map +1 -1
- package/dist/vue3/types/components/rich_text_editor/extensions/image/image.d.ts +2 -0
- package/dist/vue3/types/components/rich_text_editor/extensions/image/image.d.ts.map +1 -0
- package/dist/vue3/types/components/rich_text_editor/extensions/image/index.d.ts +3 -0
- package/dist/vue3/types/components/rich_text_editor/extensions/image/index.d.ts.map +1 -0
- package/dist/vue3/types/recipes/buttons/callbar_button_with_popover/callbar_button_with_popover.vue.d.ts.map +1 -1
- package/dist/vue3/types/recipes/cards/ivr_node/ivr_node.vue.d.ts +1 -1
- package/dist/vue3/types/recipes/cards/ivr_node/ivr_node.vue.d.ts.map +1 -1
- package/dist/vue3/types/recipes/cards/ivr_node/ivr_node_constants.d.ts +11 -11
- package/dist/vue3/types/recipes/chips/grouped_chip/grouped_chip.vue.d.ts.map +1 -1
- package/dist/vue3/types/recipes/comboboxes/combobox_multi_select/combobox_multi_select.vue.d.ts.map +1 -1
- package/dist/vue3/types/recipes/conversation_view/editor/editor.vue.d.ts.map +1 -1
- package/dist/vue3/types/recipes/conversation_view/feed_item_pill/feed_item_pill.vue.d.ts +1 -1
- package/dist/vue3/types/recipes/conversation_view/message_input/message_input.vue.d.ts.map +1 -1
- package/dist/vue3/types/recipes/item_layout/contact_info/contact_info.vue.d.ts.map +1 -1
- package/dist/vue3/types/recipes/leftbar/contact_row/contact_row.vue.d.ts +1 -1
- package/dist/vue3/types/recipes/leftbar/general_row/general_row_constants.d.ts +6 -6
- package/dist/vue3/types/recipes/leftbar/general_row/leftbar_general_row_icon.vue.d.ts +0 -1
- package/package.json +3 -3
- package/dist/vue2/components/hovercard/timer.cjs +0 -59
- package/dist/vue2/components/hovercard/timer.cjs.map +0 -1
- package/dist/vue2/components/hovercard/timer.js +0 -59
- package/dist/vue2/components/hovercard/timer.js.map +0 -1
- package/dist/vue2/types/components/hovercard/timer.d.ts +0 -3
- package/dist/vue2/types/components/hovercard/timer.d.ts.map +0 -1
- package/dist/vue2/types/recipes/conversation_view/attachment_carousel/attachment_carousel_constants.d.ts +0 -6
- package/dist/vue2/types/recipes/conversation_view/attachment_carousel/attachment_carousel_constants.d.ts.map +0 -1
- package/dist/vue3/components/hovercard/timer.cjs +0 -60
- package/dist/vue3/components/hovercard/timer.cjs.map +0 -1
- package/dist/vue3/components/hovercard/timer.js +0 -60
- package/dist/vue3/components/hovercard/timer.js.map +0 -1
- package/dist/vue3/types/components/hovercard/timer.d.ts +0 -3
- package/dist/vue3/types/components/hovercard/timer.d.ts.map +0 -1
- package/dist/vue3/types/recipes/conversation_view/attachment_carousel/attachment_carousel_constants.d.ts +0 -6
- package/dist/vue3/types/recipes/conversation_view/attachment_carousel/attachment_carousel_constants.d.ts.map +0 -1
|
@@ -8,7 +8,6 @@ import Placeholder from "@tiptap/extension-placeholder";
|
|
|
8
8
|
import HardBreak from "@tiptap/extension-hard-break";
|
|
9
9
|
import Bold from "@tiptap/extension-bold";
|
|
10
10
|
import BulletList from "@tiptap/extension-bullet-list";
|
|
11
|
-
import Image from "@tiptap/extension-image";
|
|
12
11
|
import Italic from "@tiptap/extension-italic";
|
|
13
12
|
import TipTapLink from "@tiptap/extension-link";
|
|
14
13
|
import ListItem from "@tiptap/extension-list-item";
|
|
@@ -20,6 +19,7 @@ import TextAlign from "@tiptap/extension-text-align";
|
|
|
20
19
|
import History from "@tiptap/extension-history";
|
|
21
20
|
import { Emoji } from "./extensions/emoji/emoji.js";
|
|
22
21
|
import { CustomLink } from "./extensions/custom_link/custom_link.js";
|
|
22
|
+
import { ConfigurableImage } from "./extensions/image/image.js";
|
|
23
23
|
import { MentionPlugin } from "./extensions/mentions/mention.js";
|
|
24
24
|
import { ChannelPlugin } from "./extensions/channels/channel.js";
|
|
25
25
|
import { SlashCommandPlugin } from "./extensions/slash_command/slash_command.js";
|
|
@@ -401,7 +401,7 @@ const _sfc_main = {
|
|
|
401
401
|
}));
|
|
402
402
|
}
|
|
403
403
|
if (this.allowInlineImages) {
|
|
404
|
-
extensions.push(
|
|
404
|
+
extensions.push(ConfigurableImage);
|
|
405
405
|
}
|
|
406
406
|
if (this.additionalExtensions.length) {
|
|
407
407
|
extensions.push(...this.additionalExtensions);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rich_text_editor.vue.js","sources":["../../../components/rich_text_editor/rich_text_editor.vue"],"sourcesContent":["<!-- eslint-disable vue/no-restricted-class -->\n<template>\n <editor-content\n :editor=\"editor\"\n class=\"d-rich-text-editor\"\n data-qa=\"dt-rich-text-editor\"\n v-on=\"editorListeners\"\n />\n</template>\n\n<script>\n/* eslint-disable max-lines */\nimport { Editor, EditorContent } from '@tiptap/vue-2';\nimport { Extension } from '@tiptap/core';\nimport Blockquote from '@tiptap/extension-blockquote';\nimport CodeBlock from '@tiptap/extension-code-block';\nimport Document from '@tiptap/extension-document';\nimport Paragraph from '@tiptap/extension-paragraph';\nimport Placeholder from '@tiptap/extension-placeholder';\nimport HardBreak from '@tiptap/extension-hard-break';\nimport Bold from '@tiptap/extension-bold';\nimport BulletList from '@tiptap/extension-bullet-list';\nimport Image from '@tiptap/extension-image';\nimport Italic from '@tiptap/extension-italic';\nimport TipTapLink from '@tiptap/extension-link';\nimport ListItem from '@tiptap/extension-list-item';\nimport OrderedList from '@tiptap/extension-ordered-list';\nimport Strike from '@tiptap/extension-strike';\nimport Underline from '@tiptap/extension-underline';\nimport Text from '@tiptap/extension-text';\nimport TextAlign from '@tiptap/extension-text-align';\nimport History from '@tiptap/extension-history';\nimport Emoji from './extensions/emoji';\nimport CustomLink from './extensions/custom_link';\nimport { MentionPlugin } from './extensions/mentions/mention';\nimport { ChannelPlugin } from './extensions/channels/channel';\nimport { SlashCommandPlugin } from './extensions/slash_command/slash_command';\nimport {\n RICH_TEXT_EDITOR_OUTPUT_FORMATS,\n RICH_TEXT_EDITOR_AUTOFOCUS_TYPES,\n RICH_TEXT_EDITOR_SUPPORTED_LINK_PROTOCOLS,\n} from './rich_text_editor_constants';\nimport { emojiPattern } from 'regex-combined-emojis';\n\nimport mentionSuggestion from './extensions/mentions/suggestion';\nimport channelSuggestion from './extensions/channels/suggestion';\nimport slashCommandSuggestion from './extensions/slash_command/suggestion';\nimport { warnIfUnmounted } from '@/common/utils';\n\nexport default {\n name: 'DtRichTextEditor',\n\n components: {\n EditorContent,\n },\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 value: {\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 * 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 * Whether the input allows for line breaks to be introduced in the text by pressing enter. If this is disabled,\n * line breaks can still be entered by pressing shift+enter.\n */\n allowLineBreaks: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Descriptive label for the input element\n */\n inputAriaLabel: {\n type: String,\n required: true,\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: 'html',\n validator (outputFormat) {\n return RICH_TEXT_EDITOR_OUTPUT_FORMATS.includes(outputFormat);\n },\n },\n\n /**\n * Placeholder text\n */\n placeholder: {\n type: String,\n default: '',\n },\n\n /**\n * Enables the TipTap Link extension and optionally passes configurations to it\n *\n * It is not recommended to use this and the custom link extension at the same time.\n */\n link: {\n type: [Boolean, Object],\n default: false,\n },\n\n /**\n * Enables the Custom Link extension and optionally passes configurations to it\n *\n * It is not recommended to use this and the built in TipTap link extension at the same time.\n *\n * The custom link does some additional things on top of the built in TipTap link\n * extension such as styling phone numbers and IP adresses as links, and allows you\n * to linkify text without having to type a space after the link. Currently it is missing some\n * functionality such as editing links and will likely require more work to be fully usable,\n * so it is recommended to use the built in TipTap link for now.\n */\n customLink: {\n type: [Boolean, Object],\n default: false,\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 * Note that slash commands only work when they are the first word in the input.\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 * Whether the input allows inline images to be rendered.\n */\n allowInlineImages: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Additional TipTap extensions to be added to the editor.\n */\n additionalExtensions: {\n type: Array,\n default: () => [],\n },\n },\n\n emits: [\n /**\n * Editor input event\n * @event input\n * @type {String|JSON}\n */\n 'input',\n\n /**\n * Event to sync the value with the parent\n * @event update:value\n * @type {String|JSON}\n */\n 'update:value',\n\n /**\n * Editor blur event\n * @event blur\n * @type {FocusEvent}\n */\n 'blur',\n\n /**\n * Editor focus event\n * @event focus\n * @type {FocusEvent}\n */\n 'focus',\n\n /**\n * Enter was pressed. Note that shift enter must be pressed to line break the input.\n * @event enter\n * @type {String}\n */\n 'enter',\n ],\n\n data () {\n return {\n editor: null,\n };\n },\n\n computed: {\n editorListeners () {\n return {\n ...this.$listeners,\n input: () => {},\n focus: () => {},\n blur: () => {},\n };\n },\n\n // eslint-disable-next-line complexity\n extensions () {\n // These are the default extensions needed just for plain text.\n const extensions = [Document, Paragraph, Text, History, HardBreak];\n\n if (this.allowBlockquote) {\n extensions.push(Blockquote);\n }\n if (this.allowBold) {\n extensions.push(Bold);\n }\n if (this.allowBulletList) {\n extensions.push(BulletList);\n extensions.push(ListItem);\n extensions.push(OrderedList);\n }\n if (this.allowItalic) {\n extensions.push(Italic);\n }\n if (this.allowStrike) {\n extensions.push(Strike);\n }\n if (this.allowUnderline) {\n extensions.push(Underline);\n }\n\n // Enable placeholderText\n if (this.placeholder) {\n extensions.push(\n Placeholder.configure({ placeholder: this.placeholder }),\n );\n }\n\n const self = this;\n const ShiftEnter = Extension.create({\n addKeyboardShortcuts () {\n return {\n 'Shift-Enter': ({ editor }) => {\n if (self.allowLineBreaks) {\n return false;\n }\n editor.commands.first(({ commands }) => [\n () => commands.newlineInCode(),\n () => self.allowBulletList && commands.splitListItem('listItem'),\n () => commands.createParagraphNear(),\n () => commands.liftEmptyBlock(),\n () => commands.splitBlock(),\n ]);\n return true;\n },\n Enter: () => {\n if (self.allowLineBreaks) {\n return false;\n }\n self.$emit('enter');\n return true;\n },\n };\n },\n });\n extensions.push(ShiftEnter);\n\n if (this.link) {\n extensions.push(TipTapLink.extend({ inclusive: false }).configure({\n HTMLAttributes: {\n class: 'd-link d-wb-break-all',\n },\n autolink: true,\n protocols: RICH_TEXT_EDITOR_SUPPORTED_LINK_PROTOCOLS,\n }));\n }\n if (this.customLink) {\n extensions.push(this.getExtension(CustomLink, this.customLink));\n }\n\n if (this.mentionSuggestion) {\n // Add both the suggestion plugin as well as means for user to add suggestion items to the plugin\n const suggestionObject = { ...this.mentionSuggestion, ...mentionSuggestion };\n extensions.push(MentionPlugin.configure({ suggestion: suggestionObject }));\n }\n\n if (this.channelSuggestion) {\n // Add both the suggestion plugin as well as means for user to add suggestion items to the plugin\n const suggestionObject = { ...this.channelSuggestion, ...channelSuggestion };\n extensions.push(ChannelPlugin.configure({ suggestion: suggestionObject }));\n }\n\n if (this.slashCommandSuggestion) {\n // Add both the suggestion plugin as well as means for user to add suggestion items to the plugin\n const suggestionObject = { ...this.slashCommandSuggestion, ...slashCommandSuggestion };\n extensions.push(SlashCommandPlugin.configure({ suggestion: suggestionObject }));\n }\n\n // Emoji has some interactions with Enter key\n // hence this should be done last otherwise the enter wont add a emoji.\n extensions.push(Emoji);\n\n extensions.push(TextAlign.configure({\n types: ['paragraph'],\n defaultAlignment: 'left',\n }));\n\n if (this.allowCodeblock) {\n extensions.push(CodeBlock.configure({\n HTMLAttributes: {\n class: 'd-rich-text-editor__code-block',\n },\n }));\n }\n\n if (this.allowInlineImages) {\n extensions.push(Image.configure({ inline: true }));\n }\n\n if (this.additionalExtensions.length) {\n extensions.push(...this.additionalExtensions);\n }\n\n return extensions;\n },\n\n inputAttrs () {\n const attrs = {\n 'aria-label': this.inputAriaLabel,\n 'aria-multiline': true,\n role: 'textbox',\n };\n if (!this.editable) {\n attrs['aria-readonly'] = true;\n }\n return attrs;\n },\n },\n\n /**\n * Because the Editor instance is initialized when mounted it does not get\n * updated props automatically, so the ones that can change after mount have\n * to be hooked up to the Editor's own API.\n */\n watch: {\n editable (isEditable) {\n this.editor.setEditable(isEditable);\n this.updateEditorAttributes({ 'aria-readonly': !isEditable });\n },\n\n inputClass (newClass) {\n this.updateEditorAttributes({ class: newClass });\n },\n\n inputAriaLabel (newLabel) {\n this.updateEditorAttributes({ 'aria-label': newLabel });\n },\n\n extensions () {\n // Extensions can't be registered on the fly, so just recreate the editor.\n // https://github.com/ueberdosis/tiptap/issues/1044\n this.destroyEditor();\n this.createEditor();\n },\n\n value (newValue) {\n this.processValue(newValue);\n },\n },\n\n created () {\n this.createEditor();\n },\n\n beforeUnmount () {\n this.destroyEditor();\n },\n\n mounted () {\n warnIfUnmounted(this.$el, this.$options.name);\n this.processValue(this.value, false);\n },\n\n methods: {\n\n createEditor () {\n // For all available options, see https://tiptap.dev/api/editor#settings\n this.editor = new Editor({\n autofocus: this.autoFocus,\n content: this.value,\n editable: this.editable,\n extensions: this.extensions,\n editorProps: {\n attributes: {\n ...this.inputAttrs,\n class: this.inputClass,\n },\n\n // Moves the <br /> tags inside the previous closing tag to avoid\n // Prosemirror wrapping them within another </p> tag.\n transformPastedHTML (html) {\n return html.replace(/(<\\/\\w+>)((<br \\/>)+)/g, '$2$3$1');\n },\n },\n });\n this.addEditorListeners();\n },\n\n processValue (newValue, returnIfEqual = true) {\n let currentValue = this.getOutput();\n if (this.outputFormat === 'json') {\n newValue = JSON.stringify(newValue);\n currentValue = JSON.stringify(currentValue);\n }\n\n if (returnIfEqual && newValue === currentValue) {\n // The new value came from this component and was passed back down\n // through the parent, so don't do anything here.\n return;\n }\n\n const inputUnicodeRegex = new RegExp(`(${emojiPattern})`, 'g');\n\n // If the text contains emoji characters convert them to emoji component tags\n newValue = newValue.replace(inputUnicodeRegex, '<emoji-component code=\"$1\"></emoji-component>');\n\n // Otherwise replace the content (resets the cursor position).\n this.editor.commands.setContent(newValue, false);\n },\n\n destroyEditor () {\n this.editor.destroy();\n },\n\n /**\n * The Editor exposes event hooks that we have to map our emits into. See\n * https://tiptap.dev/api/events for all events.\n */\n addEditorListeners () {\n // The content has changed.\n this.editor.on('update', () => {\n const value = this.getOutput();\n // When preventTyping is true and user wants to type, we revert to last value\n // If Backspace (keyCode = 8) is pressed, we allow updating the text\n if (this.preventTyping && this.editor.view?.input?.lastKeyCode !== 8) {\n this.editor.commands.setContent(this.value, false);\n return;\n }\n this.$emit('input', value);\n this.$emit('update:value', value);\n });\n\n // The editor is focused.\n this.editor.on('focus', ({ event }) => {\n this.$emit('focus', event);\n });\n\n // The editor isn’t focused anymore.\n this.editor.on('blur', ({ event }) => {\n this.$emit('blur', event);\n });\n },\n\n getOutput () {\n switch (this.outputFormat) {\n case 'json':\n return this.editor.getJSON();\n case 'html':\n return this.editor.getHTML();\n case 'text':\n default:\n return this.editor.getText({ blockSeparator: '\\n' });\n }\n },\n\n getExtension (extension, options) {\n if (typeof options === 'boolean') {\n return extension;\n }\n return extension.configure?.(options);\n },\n\n updateEditorAttributes (attributes) {\n this.editor.setOptions({\n editorProps: {\n attributes: {\n ...this.inputAttrs,\n class: this.inputClass,\n ...attributes,\n },\n },\n });\n },\n\n focusEditor () {\n this.editor.commands.focus();\n },\n },\n};\n</script>\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiDA,MAAA,YAAA;AAAA,EACA,MAAA;AAAA,EAEA,YAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,OAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAKA,OAAA;AAAA,MACA,MAAA,CAAA,QAAA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,UAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,eAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,iBAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,gBAAA;AAAA,MACA,MAAA;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,WAAA;AACA,eAAA;AAAA,MACA;AACA,cAAA,eAAA,cAAA,mCAAA;AAAA,IACA;AAAA,IAEA,uBAAA,YAAA;AACA,WAAA,OAAA,WAAA;AAAA,QACA,aAAA;AAAA,UACA,YAAA;AAAA,YACA,GAAA,KAAA;AAAA,YACA,OAAA,KAAA;AAAA,YACA,GAAA;AAAA,UACA;AAAA,QACA;AAAA,MACA,CAAA;AAAA,IACA;AAAA,IAEA,cAAA;AACA,WAAA,OAAA,SAAA;IACA;AAAA,EACA;AACA;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"rich_text_editor.vue.js","sources":["../../../components/rich_text_editor/rich_text_editor.vue"],"sourcesContent":["<!-- eslint-disable vue/no-restricted-class -->\n<template>\n <editor-content\n :editor=\"editor\"\n class=\"d-rich-text-editor\"\n data-qa=\"dt-rich-text-editor\"\n v-on=\"editorListeners\"\n />\n</template>\n\n<script>\n/* eslint-disable max-lines */\nimport { Editor, EditorContent } from '@tiptap/vue-2';\nimport { Extension } from '@tiptap/core';\nimport Blockquote from '@tiptap/extension-blockquote';\nimport CodeBlock from '@tiptap/extension-code-block';\nimport Document from '@tiptap/extension-document';\nimport Paragraph from '@tiptap/extension-paragraph';\nimport Placeholder from '@tiptap/extension-placeholder';\nimport HardBreak from '@tiptap/extension-hard-break';\nimport Bold from '@tiptap/extension-bold';\nimport BulletList from '@tiptap/extension-bullet-list';\nimport Italic from '@tiptap/extension-italic';\nimport TipTapLink from '@tiptap/extension-link';\nimport ListItem from '@tiptap/extension-list-item';\nimport OrderedList from '@tiptap/extension-ordered-list';\nimport Strike from '@tiptap/extension-strike';\nimport Underline from '@tiptap/extension-underline';\nimport Text from '@tiptap/extension-text';\nimport TextAlign from '@tiptap/extension-text-align';\nimport History from '@tiptap/extension-history';\nimport Emoji from './extensions/emoji';\nimport CustomLink from './extensions/custom_link';\nimport ConfigurableImage from './extensions/image';\nimport { MentionPlugin } from './extensions/mentions/mention';\nimport { ChannelPlugin } from './extensions/channels/channel';\nimport { SlashCommandPlugin } from './extensions/slash_command/slash_command';\nimport {\n RICH_TEXT_EDITOR_OUTPUT_FORMATS,\n RICH_TEXT_EDITOR_AUTOFOCUS_TYPES,\n RICH_TEXT_EDITOR_SUPPORTED_LINK_PROTOCOLS,\n} from './rich_text_editor_constants';\nimport { emojiPattern } from 'regex-combined-emojis';\n\nimport mentionSuggestion from './extensions/mentions/suggestion';\nimport channelSuggestion from './extensions/channels/suggestion';\nimport slashCommandSuggestion from './extensions/slash_command/suggestion';\nimport { warnIfUnmounted } from '@/common/utils';\n\nexport default {\n name: 'DtRichTextEditor',\n\n components: {\n EditorContent,\n },\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 value: {\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 * 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 * Whether the input allows for line breaks to be introduced in the text by pressing enter. If this is disabled,\n * line breaks can still be entered by pressing shift+enter.\n */\n allowLineBreaks: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Descriptive label for the input element\n */\n inputAriaLabel: {\n type: String,\n required: true,\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: 'html',\n validator (outputFormat) {\n return RICH_TEXT_EDITOR_OUTPUT_FORMATS.includes(outputFormat);\n },\n },\n\n /**\n * Placeholder text\n */\n placeholder: {\n type: String,\n default: '',\n },\n\n /**\n * Enables the TipTap Link extension and optionally passes configurations to it\n *\n * It is not recommended to use this and the custom link extension at the same time.\n */\n link: {\n type: [Boolean, Object],\n default: false,\n },\n\n /**\n * Enables the Custom Link extension and optionally passes configurations to it\n *\n * It is not recommended to use this and the built in TipTap link extension at the same time.\n *\n * The custom link does some additional things on top of the built in TipTap link\n * extension such as styling phone numbers and IP adresses as links, and allows you\n * to linkify text without having to type a space after the link. Currently it is missing some\n * functionality such as editing links and will likely require more work to be fully usable,\n * so it is recommended to use the built in TipTap link for now.\n */\n customLink: {\n type: [Boolean, Object],\n default: false,\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 * Note that slash commands only work when they are the first word in the input.\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 * Whether the input allows inline images to be rendered.\n */\n allowInlineImages: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Additional TipTap extensions to be added to the editor.\n */\n additionalExtensions: {\n type: Array,\n default: () => [],\n },\n },\n\n emits: [\n /**\n * Editor input event\n * @event input\n * @type {String|JSON}\n */\n 'input',\n\n /**\n * Event to sync the value with the parent\n * @event update:value\n * @type {String|JSON}\n */\n 'update:value',\n\n /**\n * Editor blur event\n * @event blur\n * @type {FocusEvent}\n */\n 'blur',\n\n /**\n * Editor focus event\n * @event focus\n * @type {FocusEvent}\n */\n 'focus',\n\n /**\n * Enter was pressed. Note that shift enter must be pressed to line break the input.\n * @event enter\n * @type {String}\n */\n 'enter',\n ],\n\n data () {\n return {\n editor: null,\n };\n },\n\n computed: {\n editorListeners () {\n return {\n ...this.$listeners,\n input: () => {},\n focus: () => {},\n blur: () => {},\n };\n },\n\n // eslint-disable-next-line complexity\n extensions () {\n // These are the default extensions needed just for plain text.\n const extensions = [Document, Paragraph, Text, History, HardBreak];\n\n if (this.allowBlockquote) {\n extensions.push(Blockquote);\n }\n if (this.allowBold) {\n extensions.push(Bold);\n }\n if (this.allowBulletList) {\n extensions.push(BulletList);\n extensions.push(ListItem);\n extensions.push(OrderedList);\n }\n if (this.allowItalic) {\n extensions.push(Italic);\n }\n if (this.allowStrike) {\n extensions.push(Strike);\n }\n if (this.allowUnderline) {\n extensions.push(Underline);\n }\n\n // Enable placeholderText\n if (this.placeholder) {\n extensions.push(\n Placeholder.configure({ placeholder: this.placeholder }),\n );\n }\n\n const self = this;\n const ShiftEnter = Extension.create({\n addKeyboardShortcuts () {\n return {\n 'Shift-Enter': ({ editor }) => {\n if (self.allowLineBreaks) {\n return false;\n }\n editor.commands.first(({ commands }) => [\n () => commands.newlineInCode(),\n () => self.allowBulletList && commands.splitListItem('listItem'),\n () => commands.createParagraphNear(),\n () => commands.liftEmptyBlock(),\n () => commands.splitBlock(),\n ]);\n return true;\n },\n Enter: () => {\n if (self.allowLineBreaks) {\n return false;\n }\n self.$emit('enter');\n return true;\n },\n };\n },\n });\n extensions.push(ShiftEnter);\n\n if (this.link) {\n extensions.push(TipTapLink.extend({ inclusive: false }).configure({\n HTMLAttributes: {\n class: 'd-link d-wb-break-all',\n },\n autolink: true,\n protocols: RICH_TEXT_EDITOR_SUPPORTED_LINK_PROTOCOLS,\n }));\n }\n if (this.customLink) {\n extensions.push(this.getExtension(CustomLink, this.customLink));\n }\n\n if (this.mentionSuggestion) {\n // Add both the suggestion plugin as well as means for user to add suggestion items to the plugin\n const suggestionObject = { ...this.mentionSuggestion, ...mentionSuggestion };\n extensions.push(MentionPlugin.configure({ suggestion: suggestionObject }));\n }\n\n if (this.channelSuggestion) {\n // Add both the suggestion plugin as well as means for user to add suggestion items to the plugin\n const suggestionObject = { ...this.channelSuggestion, ...channelSuggestion };\n extensions.push(ChannelPlugin.configure({ suggestion: suggestionObject }));\n }\n\n if (this.slashCommandSuggestion) {\n // Add both the suggestion plugin as well as means for user to add suggestion items to the plugin\n const suggestionObject = { ...this.slashCommandSuggestion, ...slashCommandSuggestion };\n extensions.push(SlashCommandPlugin.configure({ suggestion: suggestionObject }));\n }\n\n // Emoji has some interactions with Enter key\n // hence this should be done last otherwise the enter wont add a emoji.\n extensions.push(Emoji);\n\n extensions.push(TextAlign.configure({\n types: ['paragraph'],\n defaultAlignment: 'left',\n }));\n\n if (this.allowCodeblock) {\n extensions.push(CodeBlock.configure({\n HTMLAttributes: {\n class: 'd-rich-text-editor__code-block',\n },\n }));\n }\n\n if (this.allowInlineImages) {\n extensions.push(ConfigurableImage);\n }\n\n if (this.additionalExtensions.length) {\n extensions.push(...this.additionalExtensions);\n }\n\n return extensions;\n },\n\n inputAttrs () {\n const attrs = {\n 'aria-label': this.inputAriaLabel,\n 'aria-multiline': true,\n role: 'textbox',\n };\n if (!this.editable) {\n attrs['aria-readonly'] = true;\n }\n return attrs;\n },\n },\n\n /**\n * Because the Editor instance is initialized when mounted it does not get\n * updated props automatically, so the ones that can change after mount have\n * to be hooked up to the Editor's own API.\n */\n watch: {\n editable (isEditable) {\n this.editor.setEditable(isEditable);\n this.updateEditorAttributes({ 'aria-readonly': !isEditable });\n },\n\n inputClass (newClass) {\n this.updateEditorAttributes({ class: newClass });\n },\n\n inputAriaLabel (newLabel) {\n this.updateEditorAttributes({ 'aria-label': newLabel });\n },\n\n extensions () {\n // Extensions can't be registered on the fly, so just recreate the editor.\n // https://github.com/ueberdosis/tiptap/issues/1044\n this.destroyEditor();\n this.createEditor();\n },\n\n value (newValue) {\n this.processValue(newValue);\n },\n },\n\n created () {\n this.createEditor();\n },\n\n beforeUnmount () {\n this.destroyEditor();\n },\n\n mounted () {\n warnIfUnmounted(this.$el, this.$options.name);\n this.processValue(this.value, false);\n },\n\n methods: {\n\n createEditor () {\n // For all available options, see https://tiptap.dev/api/editor#settings\n this.editor = new Editor({\n autofocus: this.autoFocus,\n content: this.value,\n editable: this.editable,\n extensions: this.extensions,\n editorProps: {\n attributes: {\n ...this.inputAttrs,\n class: this.inputClass,\n },\n\n // Moves the <br /> tags inside the previous closing tag to avoid\n // Prosemirror wrapping them within another </p> tag.\n transformPastedHTML (html) {\n return html.replace(/(<\\/\\w+>)((<br \\/>)+)/g, '$2$3$1');\n },\n },\n });\n this.addEditorListeners();\n },\n\n processValue (newValue, returnIfEqual = true) {\n let currentValue = this.getOutput();\n if (this.outputFormat === 'json') {\n newValue = JSON.stringify(newValue);\n currentValue = JSON.stringify(currentValue);\n }\n\n if (returnIfEqual && newValue === currentValue) {\n // The new value came from this component and was passed back down\n // through the parent, so don't do anything here.\n return;\n }\n\n const inputUnicodeRegex = new RegExp(`(${emojiPattern})`, 'g');\n\n // If the text contains emoji characters convert them to emoji component tags\n newValue = newValue.replace(inputUnicodeRegex, '<emoji-component code=\"$1\"></emoji-component>');\n\n // Otherwise replace the content (resets the cursor position).\n this.editor.commands.setContent(newValue, false);\n },\n\n destroyEditor () {\n this.editor.destroy();\n },\n\n /**\n * The Editor exposes event hooks that we have to map our emits into. See\n * https://tiptap.dev/api/events for all events.\n */\n addEditorListeners () {\n // The content has changed.\n this.editor.on('update', () => {\n const value = this.getOutput();\n // When preventTyping is true and user wants to type, we revert to last value\n // If Backspace (keyCode = 8) is pressed, we allow updating the text\n if (this.preventTyping && this.editor.view?.input?.lastKeyCode !== 8) {\n this.editor.commands.setContent(this.value, false);\n return;\n }\n this.$emit('input', value);\n this.$emit('update:value', value);\n });\n\n // The editor is focused.\n this.editor.on('focus', ({ event }) => {\n this.$emit('focus', event);\n });\n\n // The editor isn’t focused anymore.\n this.editor.on('blur', ({ event }) => {\n this.$emit('blur', event);\n });\n },\n\n getOutput () {\n switch (this.outputFormat) {\n case 'json':\n return this.editor.getJSON();\n case 'html':\n return this.editor.getHTML();\n case 'text':\n default:\n return this.editor.getText({ blockSeparator: '\\n' });\n }\n },\n\n getExtension (extension, options) {\n if (typeof options === 'boolean') {\n return extension;\n }\n return extension.configure?.(options);\n },\n\n updateEditorAttributes (attributes) {\n this.editor.setOptions({\n editorProps: {\n attributes: {\n ...this.inputAttrs,\n class: this.inputClass,\n ...attributes,\n },\n },\n });\n },\n\n focusEditor () {\n this.editor.commands.focus();\n },\n },\n};\n</script>\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiDA,MAAA,YAAA;AAAA,EACA,MAAA;AAAA,EAEA,YAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,OAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAKA,OAAA;AAAA,MACA,MAAA,CAAA,QAAA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,UAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,eAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,iBAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,gBAAA;AAAA,MACA,MAAA;AAAA,MACA,UAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOA,YAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAaA,WAAA;AAAA,MACA,MAAA,CAAA,SAAA,QAAA,MAAA;AAAA,MACA,SAAA;AAAA,MACA,UAAA,WAAA;AACA,YAAA,OAAA,cAAA,UAAA;AACA,iBAAA,iCAAA,SAAA,SAAA;AAAA,QACA;AACA,eAAA;AAAA,MACA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAQA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|
140
139
|
{
|
|
141
140
|
"d-recipe-callbar-button--circle": this.circle,
|
|
142
141
|
"d-recipe-callbar-button--active": this.active,
|
|
143
142
|
"d-recipe-callbar-button--danger": this.danger,
|
|
144
|
-
"d-btn--disabled
|
|
145
|
-
"d-fc-primary": !this.disabled
|
|
143
|
+
"d-btn--disabled": this.disabled
|
|
146
144
|
}
|
|
147
145
|
];
|
|
148
146
|
},
|
|
149
147
|
callbarButtonTextClass() {
|
|
150
148
|
return [
|
|
151
|
-
"d-
|
|
149
|
+
"d-recipe-callbar-button__text",
|
|
152
150
|
this.textClass
|
|
153
151
|
];
|
|
154
152
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"callbar_button.vue.cjs","sources":["../../../../recipes/buttons/callbar_button/callbar_button.vue"],"sourcesContent":["<template>\n <dt-tooltip\n :id=\"id\"\n :inverted=\"invertedTooltip\"\n :show=\"showTooltip\"\n :offset=\"[0, 24]\"\n >\n <template #anchor>\n <span\n :class=\"{ 'd-recipe-callbar-button--disabled': disabled }\"\n >\n <dt-button\n :importance=\"buttonImportance\"\n kind=\"muted\"\n icon-position=\"top\"\n :aria-disabled=\"disabled\"\n :aria-label=\"ariaLabel\"\n :label-class=\"callbarButtonTextClass\"\n :width=\"buttonWidth\"\n :class=\"callbarButtonClass\"\n v-bind=\"$attrs\"\n v-on=\"callbarButtonListeners\"\n >\n <slot />\n <template #icon>\n <slot name=\"icon\" />\n </template>\n </dt-button>\n </span>\n </template>\n <slot name=\"tooltip\">\n {{ tooltipText }}\n </slot>\n </dt-tooltip>\n</template>\n\n<script>\nimport { CALLBAR_BUTTON_VALID_WIDTH_SIZE } from './callbar_button_constants';\nimport { DtButton } from '@/components/button';\nimport { DtTooltip } from '@/components/tooltip';\nimport utils from '@/common/utils';\n\nexport default {\n name: 'DtRecipeCallbarButton',\n\n components: { DtButton, DtTooltip },\n\n inheritAttrs: false,\n\n props: {\n /**\n * Id for the item.\n */\n id: {\n type: String,\n default () {\n return utils.getUniqueString();\n },\n },\n\n /**\n * Determines whether the button should have active styling\n * default is false.\n * @values true, false\n * @see https://dialtone.dialpad.com/components/button/\n */\n active: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Determines whether the button should have danger styling\n * default is false.\n * @values true, false\n * @see https://dialtone.dialpad.com/components/button/\n */\n danger: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Determines whether the button should be disabled\n * default is false.\n * @values true, false\n */\n disabled: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Whether the button is a circle or not.\n * @values true, false\n * @see https://dialtone.dialpad.com/components/button/\n */\n circle: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Aria label for the button. If empty, it takes its value from the default slot.\n */\n ariaLabel: {\n type: String,\n default: null,\n validator: (label) => {\n return label || this.$slots.default;\n },\n },\n\n /**\n * Additional class name for the button wrapper element.\n */\n buttonClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Additional class name for the button text.\n */\n textClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /*\n * Width size. Valid values are: 'xl', 'lg', 'md' and 'sm'.\n */\n buttonWidthSize: {\n type: String,\n default: 'xl',\n validator: size => CALLBAR_BUTTON_VALID_WIDTH_SIZE.includes(size),\n },\n\n /**\n * The fill and outline of the button associated with its visual importance.\n * @values clear, outlined, primary\n */\n importance: {\n type: String,\n default: '',\n },\n\n /**\n * Whether the tooltip has an inverted background color.\n * @values true, false\n */\n invertedTooltip: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Use this if you would like to manually override the logic for when the tooltip shows.\n * Otherwise it will just show on hover/focus.\n * @values null, true, false\n */\n showTooltip: {\n type: Boolean,\n default: null,\n },\n\n /**\n * The message that displays in the tooltip. This will be overridden by the tooltip slot.\n */\n tooltipText: {\n type: String,\n default: undefined,\n },\n\n },\n\n emits: [\n /**\n * Native click event\n *\n * @event click\n * @type {PointerEvent | KeyboardEvent}\n */\n 'click',\n ],\n\n computed: {\n callbarButtonClass () {\n return [\n this.buttonClass,\n 'd-recipe-callbar-button',\n
|
|
1
|
+
{"version":3,"file":"callbar_button.vue.cjs","sources":["../../../../recipes/buttons/callbar_button/callbar_button.vue"],"sourcesContent":["<template>\n <dt-tooltip\n :id=\"id\"\n :inverted=\"invertedTooltip\"\n :show=\"showTooltip\"\n :offset=\"[0, 24]\"\n >\n <template #anchor>\n <span\n :class=\"{ 'd-recipe-callbar-button--disabled': disabled }\"\n >\n <dt-button\n :importance=\"buttonImportance\"\n kind=\"muted\"\n icon-position=\"top\"\n :aria-disabled=\"disabled\"\n :aria-label=\"ariaLabel\"\n :label-class=\"callbarButtonTextClass\"\n :width=\"buttonWidth\"\n :class=\"callbarButtonClass\"\n v-bind=\"$attrs\"\n v-on=\"callbarButtonListeners\"\n >\n <slot />\n <template #icon>\n <slot name=\"icon\" />\n </template>\n </dt-button>\n </span>\n </template>\n <slot name=\"tooltip\">\n {{ tooltipText }}\n </slot>\n </dt-tooltip>\n</template>\n\n<script>\nimport { CALLBAR_BUTTON_VALID_WIDTH_SIZE } from './callbar_button_constants';\nimport { DtButton } from '@/components/button';\nimport { DtTooltip } from '@/components/tooltip';\nimport utils from '@/common/utils';\n\nexport default {\n name: 'DtRecipeCallbarButton',\n\n components: { DtButton, DtTooltip },\n\n inheritAttrs: false,\n\n props: {\n /**\n * Id for the item.\n */\n id: {\n type: String,\n default () {\n return utils.getUniqueString();\n },\n },\n\n /**\n * Determines whether the button should have active styling\n * default is false.\n * @values true, false\n * @see https://dialtone.dialpad.com/components/button/\n */\n active: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Determines whether the button should have danger styling\n * default is false.\n * @values true, false\n * @see https://dialtone.dialpad.com/components/button/\n */\n danger: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Determines whether the button should be disabled\n * default is false.\n * @values true, false\n */\n disabled: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Whether the button is a circle or not.\n * @values true, false\n * @see https://dialtone.dialpad.com/components/button/\n */\n circle: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Aria label for the button. If empty, it takes its value from the default slot.\n */\n ariaLabel: {\n type: String,\n default: null,\n validator: (label) => {\n return label || this.$slots.default;\n },\n },\n\n /**\n * Additional class name for the button wrapper element.\n */\n buttonClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Additional class name for the button text.\n */\n textClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /*\n * Width size. Valid values are: 'xl', 'lg', 'md' and 'sm'.\n */\n buttonWidthSize: {\n type: String,\n default: 'xl',\n validator: size => CALLBAR_BUTTON_VALID_WIDTH_SIZE.includes(size),\n },\n\n /**\n * The fill and outline of the button associated with its visual importance.\n * @values clear, outlined, primary\n */\n importance: {\n type: String,\n default: '',\n },\n\n /**\n * Whether the tooltip has an inverted background color.\n * @values true, false\n */\n invertedTooltip: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Use this if you would like to manually override the logic for when the tooltip shows.\n * Otherwise it will just show on hover/focus.\n * @values null, true, false\n */\n showTooltip: {\n type: Boolean,\n default: null,\n },\n\n /**\n * The message that displays in the tooltip. This will be overridden by the tooltip slot.\n */\n tooltipText: {\n type: String,\n default: undefined,\n },\n\n },\n\n emits: [\n /**\n * Native click event\n *\n * @event click\n * @type {PointerEvent | KeyboardEvent}\n */\n 'click',\n ],\n\n computed: {\n callbarButtonClass () {\n return [\n this.buttonClass,\n 'd-recipe-callbar-button',\n {\n 'd-recipe-callbar-button--circle': this.circle,\n 'd-recipe-callbar-button--active': this.active,\n 'd-recipe-callbar-button--danger': this.danger,\n 'd-btn--disabled': this.disabled,\n }];\n },\n\n callbarButtonTextClass () {\n return [\n 'd-recipe-callbar-button__text',\n this.textClass,\n ];\n },\n\n buttonWidth () {\n switch (this.buttonWidthSize) {\n case 'sm':\n return '4.5rem';\n case 'md':\n return '6rem';\n default:\n return '8.4rem';\n }\n },\n\n buttonImportance () {\n if (this.importance) {\n return this.importance;\n }\n return this.circle ? 'outlined' : 'clear';\n },\n\n callbarButtonListeners () {\n return {\n ...this.$listeners,\n click: (event) => this.$emit('click', event),\n };\n },\n },\n};\n</script>\n"],"names":["DtButton","DtTooltip","utils","this","CALLBAR_BUTTON_VALID_WIDTH_SIZE"],"mappings":";;;;;;;AA0CA,MAAA,YAAA;AAAA,EACA,MAAA;AAAA,EAEA,YAAA,EAAA,UAAAA,OAAA,SAAA,WAAAC,gBAAA;AAAA,EAEA,cAAA;AAAA,EAEA,OAAA;AAAA;AAAA;AAAA;AAAA,IAIA,IAAA;AAAA,MACA,MAAA;AAAA,MACA,UAAA;AACA,eAAAC,aAAAA,QAAA;MACA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAQA,QAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAQA,QAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOA,UAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOA,QAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,WAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,MACA,WAAA,CAAA,UAAA;AACA,eAAA,SAAAC,SAAA,OAAA;AAAA,MACA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,aAAA;AAAA,MACA,MAAA,CAAA,QAAA,OAAA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,WAAA;AAAA,MACA,MAAA,CAAA,QAAA,OAAA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,iBAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,MACA,WAAA,UAAAC,yDAAA,SAAA,IA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|
this.buttonClass,
|
|
136
136
|
"d-recipe-callbar-button",
|
|
137
|
-
"d-px0",
|
|
138
137
|
{
|
|
139
138
|
"d-recipe-callbar-button--circle": this.circle,
|
|
140
139
|
"d-recipe-callbar-button--active": this.active,
|
|
141
140
|
"d-recipe-callbar-button--danger": this.danger,
|
|
142
|
-
"d-btn--disabled
|
|
143
|
-
"d-fc-primary": !this.disabled
|
|
141
|
+
"d-btn--disabled": this.disabled
|
|
144
142
|
}
|
|
145
143
|
];
|
|
146
144
|
},
|
|
147
145
|
callbarButtonTextClass() {
|
|
148
146
|
return [
|
|
149
|
-
"d-
|
|
147
|
+
"d-recipe-callbar-button__text",
|
|
150
148
|
this.textClass
|
|
151
149
|
];
|
|
152
150
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"callbar_button.vue.js","sources":["../../../../recipes/buttons/callbar_button/callbar_button.vue"],"sourcesContent":["<template>\n <dt-tooltip\n :id=\"id\"\n :inverted=\"invertedTooltip\"\n :show=\"showTooltip\"\n :offset=\"[0, 24]\"\n >\n <template #anchor>\n <span\n :class=\"{ 'd-recipe-callbar-button--disabled': disabled }\"\n >\n <dt-button\n :importance=\"buttonImportance\"\n kind=\"muted\"\n icon-position=\"top\"\n :aria-disabled=\"disabled\"\n :aria-label=\"ariaLabel\"\n :label-class=\"callbarButtonTextClass\"\n :width=\"buttonWidth\"\n :class=\"callbarButtonClass\"\n v-bind=\"$attrs\"\n v-on=\"callbarButtonListeners\"\n >\n <slot />\n <template #icon>\n <slot name=\"icon\" />\n </template>\n </dt-button>\n </span>\n </template>\n <slot name=\"tooltip\">\n {{ tooltipText }}\n </slot>\n </dt-tooltip>\n</template>\n\n<script>\nimport { CALLBAR_BUTTON_VALID_WIDTH_SIZE } from './callbar_button_constants';\nimport { DtButton } from '@/components/button';\nimport { DtTooltip } from '@/components/tooltip';\nimport utils from '@/common/utils';\n\nexport default {\n name: 'DtRecipeCallbarButton',\n\n components: { DtButton, DtTooltip },\n\n inheritAttrs: false,\n\n props: {\n /**\n * Id for the item.\n */\n id: {\n type: String,\n default () {\n return utils.getUniqueString();\n },\n },\n\n /**\n * Determines whether the button should have active styling\n * default is false.\n * @values true, false\n * @see https://dialtone.dialpad.com/components/button/\n */\n active: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Determines whether the button should have danger styling\n * default is false.\n * @values true, false\n * @see https://dialtone.dialpad.com/components/button/\n */\n danger: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Determines whether the button should be disabled\n * default is false.\n * @values true, false\n */\n disabled: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Whether the button is a circle or not.\n * @values true, false\n * @see https://dialtone.dialpad.com/components/button/\n */\n circle: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Aria label for the button. If empty, it takes its value from the default slot.\n */\n ariaLabel: {\n type: String,\n default: null,\n validator: (label) => {\n return label || this.$slots.default;\n },\n },\n\n /**\n * Additional class name for the button wrapper element.\n */\n buttonClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Additional class name for the button text.\n */\n textClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /*\n * Width size. Valid values are: 'xl', 'lg', 'md' and 'sm'.\n */\n buttonWidthSize: {\n type: String,\n default: 'xl',\n validator: size => CALLBAR_BUTTON_VALID_WIDTH_SIZE.includes(size),\n },\n\n /**\n * The fill and outline of the button associated with its visual importance.\n * @values clear, outlined, primary\n */\n importance: {\n type: String,\n default: '',\n },\n\n /**\n * Whether the tooltip has an inverted background color.\n * @values true, false\n */\n invertedTooltip: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Use this if you would like to manually override the logic for when the tooltip shows.\n * Otherwise it will just show on hover/focus.\n * @values null, true, false\n */\n showTooltip: {\n type: Boolean,\n default: null,\n },\n\n /**\n * The message that displays in the tooltip. This will be overridden by the tooltip slot.\n */\n tooltipText: {\n type: String,\n default: undefined,\n },\n\n },\n\n emits: [\n /**\n * Native click event\n *\n * @event click\n * @type {PointerEvent | KeyboardEvent}\n */\n 'click',\n ],\n\n computed: {\n callbarButtonClass () {\n return [\n this.buttonClass,\n 'd-recipe-callbar-button',\n
|
|
1
|
+
{"version":3,"file":"callbar_button.vue.js","sources":["../../../../recipes/buttons/callbar_button/callbar_button.vue"],"sourcesContent":["<template>\n <dt-tooltip\n :id=\"id\"\n :inverted=\"invertedTooltip\"\n :show=\"showTooltip\"\n :offset=\"[0, 24]\"\n >\n <template #anchor>\n <span\n :class=\"{ 'd-recipe-callbar-button--disabled': disabled }\"\n >\n <dt-button\n :importance=\"buttonImportance\"\n kind=\"muted\"\n icon-position=\"top\"\n :aria-disabled=\"disabled\"\n :aria-label=\"ariaLabel\"\n :label-class=\"callbarButtonTextClass\"\n :width=\"buttonWidth\"\n :class=\"callbarButtonClass\"\n v-bind=\"$attrs\"\n v-on=\"callbarButtonListeners\"\n >\n <slot />\n <template #icon>\n <slot name=\"icon\" />\n </template>\n </dt-button>\n </span>\n </template>\n <slot name=\"tooltip\">\n {{ tooltipText }}\n </slot>\n </dt-tooltip>\n</template>\n\n<script>\nimport { CALLBAR_BUTTON_VALID_WIDTH_SIZE } from './callbar_button_constants';\nimport { DtButton } from '@/components/button';\nimport { DtTooltip } from '@/components/tooltip';\nimport utils from '@/common/utils';\n\nexport default {\n name: 'DtRecipeCallbarButton',\n\n components: { DtButton, DtTooltip },\n\n inheritAttrs: false,\n\n props: {\n /**\n * Id for the item.\n */\n id: {\n type: String,\n default () {\n return utils.getUniqueString();\n },\n },\n\n /**\n * Determines whether the button should have active styling\n * default is false.\n * @values true, false\n * @see https://dialtone.dialpad.com/components/button/\n */\n active: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Determines whether the button should have danger styling\n * default is false.\n * @values true, false\n * @see https://dialtone.dialpad.com/components/button/\n */\n danger: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Determines whether the button should be disabled\n * default is false.\n * @values true, false\n */\n disabled: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Whether the button is a circle or not.\n * @values true, false\n * @see https://dialtone.dialpad.com/components/button/\n */\n circle: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Aria label for the button. If empty, it takes its value from the default slot.\n */\n ariaLabel: {\n type: String,\n default: null,\n validator: (label) => {\n return label || this.$slots.default;\n },\n },\n\n /**\n * Additional class name for the button wrapper element.\n */\n buttonClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Additional class name for the button text.\n */\n textClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /*\n * Width size. Valid values are: 'xl', 'lg', 'md' and 'sm'.\n */\n buttonWidthSize: {\n type: String,\n default: 'xl',\n validator: size => CALLBAR_BUTTON_VALID_WIDTH_SIZE.includes(size),\n },\n\n /**\n * The fill and outline of the button associated with its visual importance.\n * @values clear, outlined, primary\n */\n importance: {\n type: String,\n default: '',\n },\n\n /**\n * Whether the tooltip has an inverted background color.\n * @values true, false\n */\n invertedTooltip: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Use this if you would like to manually override the logic for when the tooltip shows.\n * Otherwise it will just show on hover/focus.\n * @values null, true, false\n */\n showTooltip: {\n type: Boolean,\n default: null,\n },\n\n /**\n * The message that displays in the tooltip. This will be overridden by the tooltip slot.\n */\n tooltipText: {\n type: String,\n default: undefined,\n },\n\n },\n\n emits: [\n /**\n * Native click event\n *\n * @event click\n * @type {PointerEvent | KeyboardEvent}\n */\n 'click',\n ],\n\n computed: {\n callbarButtonClass () {\n return [\n this.buttonClass,\n 'd-recipe-callbar-button',\n {\n 'd-recipe-callbar-button--circle': this.circle,\n 'd-recipe-callbar-button--active': this.active,\n 'd-recipe-callbar-button--danger': this.danger,\n 'd-btn--disabled': this.disabled,\n }];\n },\n\n callbarButtonTextClass () {\n return [\n 'd-recipe-callbar-button__text',\n this.textClass,\n ];\n },\n\n buttonWidth () {\n switch (this.buttonWidthSize) {\n case 'sm':\n return '4.5rem';\n case 'md':\n return '6rem';\n default:\n return '8.4rem';\n }\n },\n\n buttonImportance () {\n if (this.importance) {\n return this.importance;\n }\n return this.circle ? 'outlined' : 'clear';\n },\n\n callbarButtonListeners () {\n return {\n ...this.$listeners,\n click: (event) => this.$emit('click', event),\n };\n },\n },\n};\n</script>\n"],"names":["this"],"mappings":";;;;;AA0CA,MAAA,YAAA;AAAA,EACA,MAAA;AAAA,EAEA,YAAA,EAAA,UAAA,UAAA;AAAA,EAEA,cAAA;AAAA,EAEA,OAAA;AAAA;AAAA;AAAA;AAAA,IAIA,IAAA;AAAA,MACA,MAAA;AAAA,MACA,UAAA;AACA,eAAA,MAAA;MACA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAQA,QAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAQA,QAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOA,UAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOA,QAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,WAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,MACA,WAAA,CAAA,UAAA;AACA,eAAA,SAAAA,SAAA,OAAA;AAAA,MACA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,aAAA;AAAA,MACA,MAAA,CAAA,QAAA,OAAA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,WAAA;AAAA,MACA,MAAA,CAAA,QAAA,OAAA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,iBAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,MACA,WAAA,UAAA,gCAAA,SAAA,IAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,YAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,iBAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOA,aAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,aAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA,EAEA;AAAA,EAEA,OAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOA;AAAA,EACA;AAAA,EAEA,UAAA;AAAA,IACA,qBAAA;AACA,aAAA;AAAA,QACA,KAAA;AAAA,QACA;AAAA,QACA;AAAA,UACA,mCAAA,KAAA;AAAA,UACA,mCAAA,KAAA;AAAA,UACA,mCAAA,KAAA;AAAA,UACA,mBAAA,KAAA;AAAA,QACA;AAAA,MAAA;AAAA,IACA;AAAA,IAEA,yBAAA;AACA,aAAA;AAAA,QACA;AAAA,QACA,KAAA;AAAA,MACA;AAAA,IACA;AAAA,IAEA,cAAA;AACA,cAAA,KAAA,iBAAA;AAAA,QACA,KAAA;AACA,iBAAA;AAAA,QACA,KAAA;AACA,iBAAA;AAAA,QACA;AACA,iBAAA;AAAA,MACA;AAAA,IACA;AAAA,IAEA,mBAAA;AACA,UAAA,KAAA,YAAA;AACA,eAAA,KAAA;AAAA,MACA;AACA,aAAA,KAAA,SAAA,aAAA;AAAA,IACA;AAAA,IAEA,yBAAA;AACA,aAAA;AAAA,QACA,GAAA,KAAA;AAAA,QACA,OAAA,CAAA,UAAA,KAAA,MAAA,SAAA,KAAA;AAAA,MACA;AAAA,IACA;AAAA,EACA;AACA;;;;;;;;;;;;;;;;;;"}
|
package/dist/vue2/recipes/buttons/callbar_button_with_popover/callbar_button_with_popover.vue.cjs
CHANGED
|
@@ -255,7 +255,7 @@ const _sfc_main = {
|
|
|
255
255
|
};
|
|
256
256
|
var _sfc_render = function render() {
|
|
257
257
|
var _vm = this, _c = _vm._self._c;
|
|
258
|
-
return _c("div", { staticClass: "d-recipe-callbar-button-with-popover" }, [_c("dt-recipe-callbar-button", { staticClass: "d-recipe-callbar-button-with-popover--main-button", attrs: { "aria-label": _vm.ariaLabel, "disabled": _vm.disabled, "active": _vm.active, "danger": _vm.danger, "button-class": _vm.buttonClass, "button-width-size": _vm.buttonWidthSize, "text-class": _vm.textClass, "inverted-tooltip": _vm.invertedTooltip, "show-tooltip": _vm.showTooltip, "tooltip-text": _vm.tooltipText }, on: { "click": _vm.buttonClick } }, [_vm._t("icon", null, { "slot": "icon" }), _vm._t("tooltip", null, { "slot": "tooltip" }), _vm._t("default")], 2), _vm.showArrowButton ? _c("dt-popover", _vm._b({ staticClass: "d-recipe-callbar-button-with-popover__popover-wrapper", attrs: { "id": _vm.id, "modal": false, "open": _vm.open, "placement": _vm.placement, "initial-focus-element": _vm.initialFocusElement, "show-close-button": _vm.showCloseButton, "offset": _vm.offset, "padding": "none", "dialog-class": ["d-recipe-callbar-button-with-popover__popover", _vm.contentClass], "
|
|
258
|
+
return _c("div", { staticClass: "d-recipe-callbar-button-with-popover" }, [_c("dt-recipe-callbar-button", { staticClass: "d-recipe-callbar-button-with-popover--main-button", attrs: { "aria-label": _vm.ariaLabel, "disabled": _vm.disabled, "active": _vm.active, "danger": _vm.danger, "button-class": _vm.buttonClass, "button-width-size": _vm.buttonWidthSize, "text-class": _vm.textClass, "inverted-tooltip": _vm.invertedTooltip, "show-tooltip": _vm.showTooltip, "tooltip-text": _vm.tooltipText }, on: { "click": _vm.buttonClick } }, [_vm._t("icon", null, { "slot": "icon" }), _vm._t("tooltip", null, { "slot": "tooltip" }), _vm._t("default")], 2), _vm.showArrowButton ? _c("dt-popover", _vm._b({ staticClass: "d-recipe-callbar-button-with-popover__popover-wrapper", attrs: { "id": _vm.id, "modal": false, "open": _vm.open, "placement": _vm.placement, "initial-focus-element": _vm.initialFocusElement, "show-close-button": _vm.showCloseButton, "offset": _vm.offset, "padding": "none", "dialog-class": ["d-recipe-callbar-button-with-popover__popover", _vm.contentClass], "open-popover": _vm.showPopover }, on: { "opened": _vm.onModalIsOpened }, scopedSlots: _vm._u([{ key: "anchor", fn: function() {
|
|
259
259
|
return [_c("dt-button", { class: [
|
|
260
260
|
"d-recipe-callbar-button-with-popover__arrow",
|
|
261
261
|
{ "d-recipe-callbar-button-with-popover__arrow--large": !_vm.isCompactMode }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"callbar_button_with_popover.vue.cjs","sources":["../../../../recipes/buttons/callbar_button_with_popover/callbar_button_with_popover.vue"],"sourcesContent":["<template>\n <div\n class=\"d-recipe-callbar-button-with-popover\"\n >\n <dt-recipe-callbar-button\n :aria-label=\"ariaLabel\"\n :disabled=\"disabled\"\n :active=\"active\"\n :danger=\"danger\"\n :button-class=\"buttonClass\"\n :button-width-size=\"buttonWidthSize\"\n :text-class=\"textClass\"\n :inverted-tooltip=\"invertedTooltip\"\n :show-tooltip=\"showTooltip\"\n :tooltip-text=\"tooltipText\"\n class=\"d-recipe-callbar-button-with-popover--main-button\"\n @click=\"buttonClick\"\n >\n <slot\n slot=\"icon\"\n name=\"icon\"\n />\n <slot\n slot=\"tooltip\"\n name=\"tooltip\"\n />\n <slot />\n </dt-recipe-callbar-button>\n <dt-popover\n v-if=\"showArrowButton\"\n :id=\"id\"\n :modal=\"false\"\n :open=\"open\"\n :placement=\"placement\"\n :initial-focus-element=\"initialFocusElement\"\n :show-close-button=\"showCloseButton\"\n :offset=\"offset\"\n padding=\"none\"\n class=\"d-recipe-callbar-button-with-popover__popover-wrapper\"\n :dialog-class=\"['d-recipe-callbar-button-with-popover__popover', contentClass]\"\n header-class=\"d-d-flex d-ai-center d-fw-normal d-px12\"\n v-bind=\"$attrs\"\n :open-popover=\"showPopover\"\n @opened=\"onModalIsOpened\"\n >\n <template #anchor>\n <dt-button\n circle\n importance=\"clear\"\n size=\"lg\"\n :class=\"['d-recipe-callbar-button-with-popover__arrow',\n { 'd-recipe-callbar-button-with-popover__arrow--large': !isCompactMode }]\"\n width=\"2rem\"\n :aria-label=\"arrowButtonLabel\"\n :active=\"open\"\n @click=\"arrowClick\"\n >\n <template #icon>\n <dt-icon-chevron-up\n class=\"d-recipe-callbar-button-with-popover__arrow-icon\"\n size=\"200\"\n />\n </template>\n </dt-button>\n </template>\n <slot\n slot=\"content\"\n name=\"content\"\n />\n <slot\n slot=\"headerContent\"\n name=\"headerContent\"\n />\n <slot\n slot=\"footerContent\"\n name=\"footerContent\"\n />\n </dt-popover>\n </div>\n</template>\n\n<script>\nimport { DtButton } from '@/components/button';\nimport { DtPopover } from '@/components/popover';\nimport { DtIconChevronUp } from '@dialpad/dialtone-icons/vue2';\nimport { DtRecipeCallbarButton, CALLBAR_BUTTON_VALID_WIDTH_SIZE } from '../callbar_button';\nimport utils, { warnIfUnmounted } from '@/common/utils';\n\nexport default {\n name: 'DtRecipeCallbarButtonWithPopover',\n\n components: { DtRecipeCallbarButton, DtPopover, DtButton, DtIconChevronUp },\n\n /* inheritAttrs: false is generally an option we want to set on library\n components. This allows any attributes passed in that are not recognized\n as props to be passed down to another element or component using v-bind:$attrs\n more info: https://vuejs.org/v2/api/#inheritAttrs */\n inheritAttrs: false,\n\n props: {\n /**\n * Id for the item.\n */\n id: {\n type: String,\n default () {\n return utils.getUniqueString();\n },\n },\n\n /**\n * Aria label for the button. If empty, it takes its value from the default slot.\n */\n ariaLabel: {\n type: String,\n default: null,\n validator: (label) => {\n return label || this.$slots.default;\n },\n },\n\n /**\n * Aria label for the arrow. Cannot be empty.\n */\n arrowButtonLabel: {\n type: String,\n required: true,\n validator: (label) => {\n return !!label;\n },\n },\n\n /**\n * The direction the popover displays relative to the anchor.\n * @values 'bottom', 'bottom-start', 'bottom-end',\n * 'right', 'right-start', 'right-end',\n * 'left', 'left-start', 'left-end',\n * 'top', 'top-start', 'top-end'\n * @default 'top'\n */\n placement: {\n type: String,\n default: 'top',\n },\n\n /**\n * Displaces the content box from its anchor element\n * by the specified number of pixels.\n * <a\n * class=\"d-link\"\n * href=\"https://atomiks.github.io/tippyjs/v6/all-props/#offset\"\n * target=\"_blank\"\n * >\n * Tippy.js docs\n * </a>\n */\n offset: {\n type: Array,\n default: () => [0, 16],\n },\n\n /**\n * The element that is focused when the popover is opened. This can be an\n * HTMLElement within the popover, a string starting with '#' which will\n * find the element by ID. 'first' which will automatically focus\n * the first element, or 'dialog' which will focus the dialog window itself.\n * If the dialog is modal this prop cannot be 'none'.\n */\n initialFocusElement: {\n type: String,\n default: 'first',\n },\n\n /**\n * Determines visibility for close button\n */\n showCloseButton: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Determines whether the button should be disabled\n * default is false.\n * @values true, false\n */\n disabled: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Forces showing the arrow, even if the button is disabled.\n * default is false\n * @values true, false\n */\n forceShowArrow: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Determines whether the button should have active styling\n * default is false.\n * @values true, false\n * @see https://dialtone.dialpad.com/components/button/\n */\n active: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Determines whether the button should have danger styling\n * default is false.\n * @values true, false\n * @see https://dialtone.dialpad.com/components/button/\n */\n danger: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Additional class name for the button wrapper element.\n */\n buttonClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Additional class name for the button text.\n */\n textClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /*\n * Width size. Valid values are: 'xl', 'lg', 'md' and 'sm'.\n */\n buttonWidthSize: {\n type: String,\n default: 'xl',\n validator: size => CALLBAR_BUTTON_VALID_WIDTH_SIZE.includes(size),\n },\n\n /**\n * Additional class name for the popover content wrapper element.\n */\n contentClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * To auto open the modal popover.\n */\n openPopover: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Whether the tooltip has an inverted background color.\n * @values true, false\n */\n invertedTooltip: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Use this if you would like to manually override the logic for when the tooltip shows.\n * Otherwise it will just show on hover/focus.\n * @values null, true, false\n */\n showTooltip: {\n type: Boolean,\n default: null,\n },\n\n /**\n * The message that displays in the tooltip. This will be overridden by the tooltip slot.\n */\n tooltipText: {\n type: String,\n default: undefined,\n },\n },\n\n emits: [\n /**\n * Emitted when the arrow is clicked\n */\n 'arrow-click',\n\n /**\n * Native click event\n *\n * @event click\n * @type {PointerEvent | KeyboardEvent}\n */\n 'click',\n\n /**\n * Emitted when modal popover is opened or closed.\n */\n 'opened',\n ],\n\n data () {\n return {\n open: false,\n };\n },\n\n computed: {\n showArrowButton () {\n return this.forceShowArrow || !this.disabled;\n },\n\n isCompactMode () {\n return this.buttonWidthSize === 'sm' || this.buttonWidthSize === 'md';\n },\n\n showPopover () {\n if (!this.openPopover || this.open) {\n this.syncOpenState();\n return false;\n }\n\n return this.toggleOpen();\n },\n },\n\n mounted () {\n warnIfUnmounted(this.$el, this.$options.name);\n },\n\n methods: {\n arrowClick (ev) {\n this.$emit('arrow-click', ev);\n return this.toggleOpen();\n },\n\n toggleOpen () {\n return (this.open = !this.open);\n },\n\n syncOpenState () {\n this.open = this.openPopover;\n },\n\n buttonClick (ev) {\n // If no listener for the click event, the button click opens the popover\n // the same as if the arrow was clicked.\n if (!this.$listeners.click) {\n this.arrowClick(ev);\n } else {\n this.$emit('click', ev);\n }\n },\n\n onModalIsOpened (isOpened) {\n this.open = isOpened;\n this.$emit('opened', isOpened);\n },\n },\n\n};\n</script>\n"],"names":["DtRecipeCallbarButton","DtPopover","DtButton","DtIconChevronUp","utils","this","CALLBAR_BUTTON_VALID_WIDTH_SIZE","warnIfUnmounted"],"mappings":";;;;;;;;;AAwFA,MAAA,YAAA;AAAA,EACA,MAAA;AAAA,EAEA,YAAA,EAAA,uBAAAA,eAAA,SAAA,WAAAC,iBAAAC,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A,QAAA,KAAA,oBAAA;AAAA,IACA;AAAA,IAEA,cAAA;AACA,UAAA,CAAA,KAAA,eAAA,KAAA,MAAA;AACA,aAAA,cAAA;AACA,eAAA;AAAA,MACA;AAEA,aAAA,KAAA;IACA;AAAA,EACA;AAAA,EAEA,UAAA;AACAC,iBAAA,gBAAA,KAAA,KAAA,KAAA,SAAA,IAAA;AAAA,EACA;AAAA,EAEA,SAAA;AAAA,IACA,WAAA,IAAA;AACA,WAAA,MAAA,eAAA,EAAA;AACA,aAAA,KAAA;IACA;AAAA,IAEA,aAAA;AACA,aAAA,KAAA,OAAA,CAAA,KAAA;AAAA,IACA;AAAA,IAEA,gBAAA;AACA,WAAA,OAAA,KAAA;AAAA,IACA;AAAA,IAEA,YAAA,IAAA;AAGA,UAAA,CAAA,KAAA,WAAA,OAAA;AACA,aAAA,WAAA,EAAA;AAAA,MACA,OAAA;AACA,aAAA,MAAA,SAAA,EAAA;AAAA,MACA;AAAA,IACA;AAAA,IAEA,gBAAA,UAAA;AACA,WAAA,OAAA;AACA,WAAA,MAAA,UAAA,QAAA;AAAA,IACA;AAAA,EACA;AAEA;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"callbar_button_with_popover.vue.cjs","sources":["../../../../recipes/buttons/callbar_button_with_popover/callbar_button_with_popover.vue"],"sourcesContent":["<template>\n <div\n class=\"d-recipe-callbar-button-with-popover\"\n >\n <dt-recipe-callbar-button\n :aria-label=\"ariaLabel\"\n :disabled=\"disabled\"\n :active=\"active\"\n :danger=\"danger\"\n :button-class=\"buttonClass\"\n :button-width-size=\"buttonWidthSize\"\n :text-class=\"textClass\"\n :inverted-tooltip=\"invertedTooltip\"\n :show-tooltip=\"showTooltip\"\n :tooltip-text=\"tooltipText\"\n class=\"d-recipe-callbar-button-with-popover--main-button\"\n @click=\"buttonClick\"\n >\n <slot\n slot=\"icon\"\n name=\"icon\"\n />\n <slot\n slot=\"tooltip\"\n name=\"tooltip\"\n />\n <slot />\n </dt-recipe-callbar-button>\n <dt-popover\n v-if=\"showArrowButton\"\n :id=\"id\"\n :modal=\"false\"\n :open=\"open\"\n :placement=\"placement\"\n :initial-focus-element=\"initialFocusElement\"\n :show-close-button=\"showCloseButton\"\n :offset=\"offset\"\n padding=\"none\"\n class=\"d-recipe-callbar-button-with-popover__popover-wrapper\"\n :dialog-class=\"['d-recipe-callbar-button-with-popover__popover', contentClass]\"\n v-bind=\"$attrs\"\n :open-popover=\"showPopover\"\n @opened=\"onModalIsOpened\"\n >\n <template #anchor>\n <dt-button\n circle\n importance=\"clear\"\n size=\"lg\"\n :class=\"['d-recipe-callbar-button-with-popover__arrow',\n { 'd-recipe-callbar-button-with-popover__arrow--large': !isCompactMode }]\"\n width=\"2rem\"\n :aria-label=\"arrowButtonLabel\"\n :active=\"open\"\n @click=\"arrowClick\"\n >\n <template #icon>\n <dt-icon-chevron-up\n class=\"d-recipe-callbar-button-with-popover__arrow-icon\"\n size=\"200\"\n />\n </template>\n </dt-button>\n </template>\n <slot\n slot=\"content\"\n name=\"content\"\n />\n <slot\n slot=\"headerContent\"\n name=\"headerContent\"\n />\n <slot\n slot=\"footerContent\"\n name=\"footerContent\"\n />\n </dt-popover>\n </div>\n</template>\n\n<script>\nimport { DtButton } from '@/components/button';\nimport { DtPopover } from '@/components/popover';\nimport { DtIconChevronUp } from '@dialpad/dialtone-icons/vue2';\nimport { DtRecipeCallbarButton, CALLBAR_BUTTON_VALID_WIDTH_SIZE } from '../callbar_button';\nimport utils, { warnIfUnmounted } from '@/common/utils';\n\nexport default {\n name: 'DtRecipeCallbarButtonWithPopover',\n\n components: { DtRecipeCallbarButton, DtPopover, DtButton, DtIconChevronUp },\n\n /* inheritAttrs: false is generally an option we want to set on library\n components. This allows any attributes passed in that are not recognized\n as props to be passed down to another element or component using v-bind:$attrs\n more info: https://vuejs.org/v2/api/#inheritAttrs */\n inheritAttrs: false,\n\n props: {\n /**\n * Id for the item.\n */\n id: {\n type: String,\n default () {\n return utils.getUniqueString();\n },\n },\n\n /**\n * Aria label for the button. If empty, it takes its value from the default slot.\n */\n ariaLabel: {\n type: String,\n default: null,\n validator: (label) => {\n return label || this.$slots.default;\n },\n },\n\n /**\n * Aria label for the arrow. Cannot be empty.\n */\n arrowButtonLabel: {\n type: String,\n required: true,\n validator: (label) => {\n return !!label;\n },\n },\n\n /**\n * The direction the popover displays relative to the anchor.\n * @values 'bottom', 'bottom-start', 'bottom-end',\n * 'right', 'right-start', 'right-end',\n * 'left', 'left-start', 'left-end',\n * 'top', 'top-start', 'top-end'\n * @default 'top'\n */\n placement: {\n type: String,\n default: 'top',\n },\n\n /**\n * Displaces the content box from its anchor element\n * by the specified number of pixels.\n * <a\n * class=\"d-link\"\n * href=\"https://atomiks.github.io/tippyjs/v6/all-props/#offset\"\n * target=\"_blank\"\n * >\n * Tippy.js docs\n * </a>\n */\n offset: {\n type: Array,\n default: () => [0, 16],\n },\n\n /**\n * The element that is focused when the popover is opened. This can be an\n * HTMLElement within the popover, a string starting with '#' which will\n * find the element by ID. 'first' which will automatically focus\n * the first element, or 'dialog' which will focus the dialog window itself.\n * If the dialog is modal this prop cannot be 'none'.\n */\n initialFocusElement: {\n type: String,\n default: 'first',\n },\n\n /**\n * Determines visibility for close button\n */\n showCloseButton: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Determines whether the button should be disabled\n * default is false.\n * @values true, false\n */\n disabled: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Forces showing the arrow, even if the button is disabled.\n * default is false\n * @values true, false\n */\n forceShowArrow: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Determines whether the button should have active styling\n * default is false.\n * @values true, false\n * @see https://dialtone.dialpad.com/components/button/\n */\n active: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Determines whether the button should have danger styling\n * default is false.\n * @values true, false\n * @see https://dialtone.dialpad.com/components/button/\n */\n danger: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Additional class name for the button wrapper element.\n */\n buttonClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Additional class name for the button text.\n */\n textClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /*\n * Width size. Valid values are: 'xl', 'lg', 'md' and 'sm'.\n */\n buttonWidthSize: {\n type: String,\n default: 'xl',\n validator: size => CALLBAR_BUTTON_VALID_WIDTH_SIZE.includes(size),\n },\n\n /**\n * Additional class name for the popover content wrapper element.\n */\n contentClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * To auto open the modal popover.\n */\n openPopover: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Whether the tooltip has an inverted background color.\n * @values true, false\n */\n invertedTooltip: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Use this if you would like to manually override the logic for when the tooltip shows.\n * Otherwise it will just show on hover/focus.\n * @values null, true, false\n */\n showTooltip: {\n type: Boolean,\n default: null,\n },\n\n /**\n * The message that displays in the tooltip. This will be overridden by the tooltip slot.\n */\n tooltipText: {\n type: String,\n default: undefined,\n },\n },\n\n emits: [\n /**\n * Emitted when the arrow is clicked\n */\n 'arrow-click',\n\n /**\n * Native click event\n *\n * @event click\n * @type {PointerEvent | KeyboardEvent}\n */\n 'click',\n\n /**\n * Emitted when modal popover is opened or closed.\n */\n 'opened',\n ],\n\n data () {\n return {\n open: false,\n };\n },\n\n computed: {\n showArrowButton () {\n return this.forceShowArrow || !this.disabled;\n },\n\n isCompactMode () {\n return this.buttonWidthSize === 'sm' || this.buttonWidthSize === 'md';\n },\n\n showPopover () {\n if (!this.openPopover || this.open) {\n this.syncOpenState();\n return false;\n }\n\n return this.toggleOpen();\n },\n },\n\n mounted () {\n warnIfUnmounted(this.$el, this.$options.name);\n },\n\n methods: {\n arrowClick (ev) {\n this.$emit('arrow-click', ev);\n return this.toggleOpen();\n },\n\n toggleOpen () {\n return (this.open = !this.open);\n },\n\n syncOpenState () {\n this.open = this.openPopover;\n },\n\n buttonClick (ev) {\n // If no listener for the click event, the button click opens the popover\n // the same as if the arrow was clicked.\n if (!this.$listeners.click) {\n this.arrowClick(ev);\n } else {\n this.$emit('click', ev);\n }\n },\n\n onModalIsOpened (isOpened) {\n this.open = isOpened;\n this.$emit('opened', isOpened);\n },\n },\n\n};\n</script>\n"],"names":["DtRecipeCallbarButton","DtPopover","DtButton","DtIconChevronUp","utils","this","CALLBAR_BUTTON_VALID_WIDTH_SIZE","warnIfUnmounted"],"mappings":";;;;;;;;;AAuFA,MAAA,YAAA;AAAA,EACA,MAAA;AAAA,EAEA,YAAA,EAAA,uBAAAA,eAAA,SAAA,WAAAC,iBAAAC,UAAAA,OAAAA,SAAAC,iBAAAA,KAAAA,gBAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,cAAA;AAAA,EAEA,OAAA;AAAA;AAAA;AAAA;AAAA,IAIA,IAAA;AAAA,MACA,MAAA;AAAA,MACA,UAAA;AACA,eAAAC,aAAAA,QAAA;MACA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,WAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,MACA,WAAA,CAAA,UAAA;AACA,eAAA,SAAAC,SAAA,OAAA;AAAA,MACA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,kBAAA;AAAA,MACA,MAAA;AAAA,MACA,UAAA;AAAA,MACA,WAAA,CAAA,UAAA;AACA,eAAA,CAAA,CAAA;AAAA,MACA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAUA,WAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAaA,QAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA,MAAA,CAAA,GAAA,EAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IASA,qBAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA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ACA;AAAA,EACA;AAAA,EAEA,OAAA;AAAA;AAAA;AAAA;AAAA,IAIA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAQA;AAAA;AAAA;AAAA;AAAA,IAKA;AAAA,EACA;AAAA,EAEA,OAAA;AACA,WAAA;AAAA,MACA,MAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,UAAA;AAAA,IACA,kBAAA;AACA,aAAA,KAAA,kBAAA,CAAA,KAAA;AAAA,IACA;AAAA,IAEA,gBAAA;AACA,aAAA,KAAA,oBAAA,QAAA,KAAA,oBAAA;AAAA,IACA;AAAA,IAEA,cAAA;AACA,UAAA,CAAA,KAAA,eAAA,KAAA,MAAA;AACA,aAAA,cAAA;AACA,eAAA;AAAA,MACA;AAEA,aAAA,KAAA;IACA;AAAA,EACA;AAAA,EAEA,UAAA;AACAC,iBAAA,gBAAA,KAAA,KAAA,KAAA,SAAA,IAAA;AAAA,EACA;AAAA,EAEA,SAAA;AAAA,IACA,WAAA,IAAA;AACA,WAAA,MAAA,eAAA,EAAA;AACA,aAAA,KAAA;IACA;AAAA,IAEA,aAAA;AACA,aAAA,KAAA,OAAA,CAAA,KAAA;AAAA,IACA;AAAA,IAEA,gBAAA;AACA,WAAA,OAAA,KAAA;AAAA,IACA;AAAA,IAEA,YAAA,IAAA;AAGA,UAAA,CAAA,KAAA,WAAA,OAAA;AACA,aAAA,WAAA,EAAA;AAAA,MACA,OAAA;AACA,aAAA,MAAA,SAAA,EAAA;AAAA,MACA;AAAA,IACA;AAAA,IAEA,gBAAA,UAAA;AACA,WAAA,OAAA;AACA,WAAA,MAAA,UAAA,QAAA;AAAA,IACA;AAAA,EACA;AAEA;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/vue2/recipes/buttons/callbar_button_with_popover/callbar_button_with_popover.vue.js
CHANGED
|
@@ -253,7 +253,7 @@ const _sfc_main = {
|
|
|
253
253
|
};
|
|
254
254
|
var _sfc_render = function render() {
|
|
255
255
|
var _vm = this, _c = _vm._self._c;
|
|
256
|
-
return _c("div", { staticClass: "d-recipe-callbar-button-with-popover" }, [_c("dt-recipe-callbar-button", { staticClass: "d-recipe-callbar-button-with-popover--main-button", attrs: { "aria-label": _vm.ariaLabel, "disabled": _vm.disabled, "active": _vm.active, "danger": _vm.danger, "button-class": _vm.buttonClass, "button-width-size": _vm.buttonWidthSize, "text-class": _vm.textClass, "inverted-tooltip": _vm.invertedTooltip, "show-tooltip": _vm.showTooltip, "tooltip-text": _vm.tooltipText }, on: { "click": _vm.buttonClick } }, [_vm._t("icon", null, { "slot": "icon" }), _vm._t("tooltip", null, { "slot": "tooltip" }), _vm._t("default")], 2), _vm.showArrowButton ? _c("dt-popover", _vm._b({ staticClass: "d-recipe-callbar-button-with-popover__popover-wrapper", attrs: { "id": _vm.id, "modal": false, "open": _vm.open, "placement": _vm.placement, "initial-focus-element": _vm.initialFocusElement, "show-close-button": _vm.showCloseButton, "offset": _vm.offset, "padding": "none", "dialog-class": ["d-recipe-callbar-button-with-popover__popover", _vm.contentClass], "
|
|
256
|
+
return _c("div", { staticClass: "d-recipe-callbar-button-with-popover" }, [_c("dt-recipe-callbar-button", { staticClass: "d-recipe-callbar-button-with-popover--main-button", attrs: { "aria-label": _vm.ariaLabel, "disabled": _vm.disabled, "active": _vm.active, "danger": _vm.danger, "button-class": _vm.buttonClass, "button-width-size": _vm.buttonWidthSize, "text-class": _vm.textClass, "inverted-tooltip": _vm.invertedTooltip, "show-tooltip": _vm.showTooltip, "tooltip-text": _vm.tooltipText }, on: { "click": _vm.buttonClick } }, [_vm._t("icon", null, { "slot": "icon" }), _vm._t("tooltip", null, { "slot": "tooltip" }), _vm._t("default")], 2), _vm.showArrowButton ? _c("dt-popover", _vm._b({ staticClass: "d-recipe-callbar-button-with-popover__popover-wrapper", attrs: { "id": _vm.id, "modal": false, "open": _vm.open, "placement": _vm.placement, "initial-focus-element": _vm.initialFocusElement, "show-close-button": _vm.showCloseButton, "offset": _vm.offset, "padding": "none", "dialog-class": ["d-recipe-callbar-button-with-popover__popover", _vm.contentClass], "open-popover": _vm.showPopover }, on: { "opened": _vm.onModalIsOpened }, scopedSlots: _vm._u([{ key: "anchor", fn: function() {
|
|
257
257
|
return [_c("dt-button", { class: [
|
|
258
258
|
"d-recipe-callbar-button-with-popover__arrow",
|
|
259
259
|
{ "d-recipe-callbar-button-with-popover__arrow--large": !_vm.isCompactMode }
|
package/dist/vue2/recipes/buttons/callbar_button_with_popover/callbar_button_with_popover.vue.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"callbar_button_with_popover.vue.js","sources":["../../../../recipes/buttons/callbar_button_with_popover/callbar_button_with_popover.vue"],"sourcesContent":["<template>\n <div\n class=\"d-recipe-callbar-button-with-popover\"\n >\n <dt-recipe-callbar-button\n :aria-label=\"ariaLabel\"\n :disabled=\"disabled\"\n :active=\"active\"\n :danger=\"danger\"\n :button-class=\"buttonClass\"\n :button-width-size=\"buttonWidthSize\"\n :text-class=\"textClass\"\n :inverted-tooltip=\"invertedTooltip\"\n :show-tooltip=\"showTooltip\"\n :tooltip-text=\"tooltipText\"\n class=\"d-recipe-callbar-button-with-popover--main-button\"\n @click=\"buttonClick\"\n >\n <slot\n slot=\"icon\"\n name=\"icon\"\n />\n <slot\n slot=\"tooltip\"\n name=\"tooltip\"\n />\n <slot />\n </dt-recipe-callbar-button>\n <dt-popover\n v-if=\"showArrowButton\"\n :id=\"id\"\n :modal=\"false\"\n :open=\"open\"\n :placement=\"placement\"\n :initial-focus-element=\"initialFocusElement\"\n :show-close-button=\"showCloseButton\"\n :offset=\"offset\"\n padding=\"none\"\n class=\"d-recipe-callbar-button-with-popover__popover-wrapper\"\n :dialog-class=\"['d-recipe-callbar-button-with-popover__popover', contentClass]\"\n header-class=\"d-d-flex d-ai-center d-fw-normal d-px12\"\n v-bind=\"$attrs\"\n :open-popover=\"showPopover\"\n @opened=\"onModalIsOpened\"\n >\n <template #anchor>\n <dt-button\n circle\n importance=\"clear\"\n size=\"lg\"\n :class=\"['d-recipe-callbar-button-with-popover__arrow',\n { 'd-recipe-callbar-button-with-popover__arrow--large': !isCompactMode }]\"\n width=\"2rem\"\n :aria-label=\"arrowButtonLabel\"\n :active=\"open\"\n @click=\"arrowClick\"\n >\n <template #icon>\n <dt-icon-chevron-up\n class=\"d-recipe-callbar-button-with-popover__arrow-icon\"\n size=\"200\"\n />\n </template>\n </dt-button>\n </template>\n <slot\n slot=\"content\"\n name=\"content\"\n />\n <slot\n slot=\"headerContent\"\n name=\"headerContent\"\n />\n <slot\n slot=\"footerContent\"\n name=\"footerContent\"\n />\n </dt-popover>\n </div>\n</template>\n\n<script>\nimport { DtButton } from '@/components/button';\nimport { DtPopover } from '@/components/popover';\nimport { DtIconChevronUp } from '@dialpad/dialtone-icons/vue2';\nimport { DtRecipeCallbarButton, CALLBAR_BUTTON_VALID_WIDTH_SIZE } from '../callbar_button';\nimport utils, { warnIfUnmounted } from '@/common/utils';\n\nexport default {\n name: 'DtRecipeCallbarButtonWithPopover',\n\n components: { DtRecipeCallbarButton, DtPopover, DtButton, DtIconChevronUp },\n\n /* inheritAttrs: false is generally an option we want to set on library\n components. This allows any attributes passed in that are not recognized\n as props to be passed down to another element or component using v-bind:$attrs\n more info: https://vuejs.org/v2/api/#inheritAttrs */\n inheritAttrs: false,\n\n props: {\n /**\n * Id for the item.\n */\n id: {\n type: String,\n default () {\n return utils.getUniqueString();\n },\n },\n\n /**\n * Aria label for the button. If empty, it takes its value from the default slot.\n */\n ariaLabel: {\n type: String,\n default: null,\n validator: (label) => {\n return label || this.$slots.default;\n },\n },\n\n /**\n * Aria label for the arrow. Cannot be empty.\n */\n arrowButtonLabel: {\n type: String,\n required: true,\n validator: (label) => {\n return !!label;\n },\n },\n\n /**\n * The direction the popover displays relative to the anchor.\n * @values 'bottom', 'bottom-start', 'bottom-end',\n * 'right', 'right-start', 'right-end',\n * 'left', 'left-start', 'left-end',\n * 'top', 'top-start', 'top-end'\n * @default 'top'\n */\n placement: {\n type: String,\n default: 'top',\n },\n\n /**\n * Displaces the content box from its anchor element\n * by the specified number of pixels.\n * <a\n * class=\"d-link\"\n * href=\"https://atomiks.github.io/tippyjs/v6/all-props/#offset\"\n * target=\"_blank\"\n * >\n * Tippy.js docs\n * </a>\n */\n offset: {\n type: Array,\n default: () => [0, 16],\n },\n\n /**\n * The element that is focused when the popover is opened. This can be an\n * HTMLElement within the popover, a string starting with '#' which will\n * find the element by ID. 'first' which will automatically focus\n * the first element, or 'dialog' which will focus the dialog window itself.\n * If the dialog is modal this prop cannot be 'none'.\n */\n initialFocusElement: {\n type: String,\n default: 'first',\n },\n\n /**\n * Determines visibility for close button\n */\n showCloseButton: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Determines whether the button should be disabled\n * default is false.\n * @values true, false\n */\n disabled: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Forces showing the arrow, even if the button is disabled.\n * default is false\n * @values true, false\n */\n forceShowArrow: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Determines whether the button should have active styling\n * default is false.\n * @values true, false\n * @see https://dialtone.dialpad.com/components/button/\n */\n active: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Determines whether the button should have danger styling\n * default is false.\n * @values true, false\n * @see https://dialtone.dialpad.com/components/button/\n */\n danger: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Additional class name for the button wrapper element.\n */\n buttonClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Additional class name for the button text.\n */\n textClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /*\n * Width size. Valid values are: 'xl', 'lg', 'md' and 'sm'.\n */\n buttonWidthSize: {\n type: String,\n default: 'xl',\n validator: size => CALLBAR_BUTTON_VALID_WIDTH_SIZE.includes(size),\n },\n\n /**\n * Additional class name for the popover content wrapper element.\n */\n contentClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * To auto open the modal popover.\n */\n openPopover: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Whether the tooltip has an inverted background color.\n * @values true, false\n */\n invertedTooltip: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Use this if you would like to manually override the logic for when the tooltip shows.\n * Otherwise it will just show on hover/focus.\n * @values null, true, false\n */\n showTooltip: {\n type: Boolean,\n default: null,\n },\n\n /**\n * The message that displays in the tooltip. This will be overridden by the tooltip slot.\n */\n tooltipText: {\n type: String,\n default: undefined,\n },\n },\n\n emits: [\n /**\n * Emitted when the arrow is clicked\n */\n 'arrow-click',\n\n /**\n * Native click event\n *\n * @event click\n * @type {PointerEvent | KeyboardEvent}\n */\n 'click',\n\n /**\n * Emitted when modal popover is opened or closed.\n */\n 'opened',\n ],\n\n data () {\n return {\n open: false,\n };\n },\n\n computed: {\n showArrowButton () {\n return this.forceShowArrow || !this.disabled;\n },\n\n isCompactMode () {\n return this.buttonWidthSize === 'sm' || this.buttonWidthSize === 'md';\n },\n\n showPopover () {\n if (!this.openPopover || this.open) {\n this.syncOpenState();\n return false;\n }\n\n return this.toggleOpen();\n },\n },\n\n mounted () {\n warnIfUnmounted(this.$el, this.$options.name);\n },\n\n methods: {\n arrowClick (ev) {\n this.$emit('arrow-click', ev);\n return this.toggleOpen();\n },\n\n toggleOpen () {\n return (this.open = !this.open);\n },\n\n syncOpenState () {\n this.open = this.openPopover;\n },\n\n buttonClick (ev) {\n // If no listener for the click event, the button click opens the popover\n // the same as if the arrow was clicked.\n if (!this.$listeners.click) {\n this.arrowClick(ev);\n } else {\n this.$emit('click', ev);\n }\n },\n\n onModalIsOpened (isOpened) {\n this.open = isOpened;\n this.$emit('opened', isOpened);\n },\n },\n\n};\n</script>\n"],"names":["this"],"mappings":";;;;;;;AAwFA,MAAA,YAAA;AAAA,EACA,MAAA;AAAA,EAEA,YAAA,EAAA,uBAAA,WAAA,UAAA,gBAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,cAAA;AAAA,EAEA,OAAA;AAAA;AAAA;AAAA;AAAA,IAIA,IAAA;AAAA,MACA,MAAA;AAA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AEA,UAAA;AACA,oBAAA,KAAA,KAAA,KAAA,SAAA,IAAA;AAAA,EACA;AAAA,EAEA,SAAA;AAAA,IACA,WAAA,IAAA;AACA,WAAA,MAAA,eAAA,EAAA;AACA,aAAA,KAAA;IACA;AAAA,IAEA,aAAA;AACA,aAAA,KAAA,OAAA,CAAA,KAAA;AAAA,IACA;AAAA,IAEA,gBAAA;AACA,WAAA,OAAA,KAAA;AAAA,IACA;AAAA,IAEA,YAAA,IAAA;AAGA,UAAA,CAAA,KAAA,WAAA,OAAA;AACA,aAAA,WAAA,EAAA;AAAA,MACA,OAAA;AACA,aAAA,MAAA,SAAA,EAAA;AAAA,MACA;AAAA,IACA;AAAA,IAEA,gBAAA,UAAA;AACA,WAAA,OAAA;AACA,WAAA,MAAA,UAAA,QAAA;AAAA,IACA;AAAA,EACA;AAEA;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"callbar_button_with_popover.vue.js","sources":["../../../../recipes/buttons/callbar_button_with_popover/callbar_button_with_popover.vue"],"sourcesContent":["<template>\n <div\n class=\"d-recipe-callbar-button-with-popover\"\n >\n <dt-recipe-callbar-button\n :aria-label=\"ariaLabel\"\n :disabled=\"disabled\"\n :active=\"active\"\n :danger=\"danger\"\n :button-class=\"buttonClass\"\n :button-width-size=\"buttonWidthSize\"\n :text-class=\"textClass\"\n :inverted-tooltip=\"invertedTooltip\"\n :show-tooltip=\"showTooltip\"\n :tooltip-text=\"tooltipText\"\n class=\"d-recipe-callbar-button-with-popover--main-button\"\n @click=\"buttonClick\"\n >\n <slot\n slot=\"icon\"\n name=\"icon\"\n />\n <slot\n slot=\"tooltip\"\n name=\"tooltip\"\n />\n <slot />\n </dt-recipe-callbar-button>\n <dt-popover\n v-if=\"showArrowButton\"\n :id=\"id\"\n :modal=\"false\"\n :open=\"open\"\n :placement=\"placement\"\n :initial-focus-element=\"initialFocusElement\"\n :show-close-button=\"showCloseButton\"\n :offset=\"offset\"\n padding=\"none\"\n class=\"d-recipe-callbar-button-with-popover__popover-wrapper\"\n :dialog-class=\"['d-recipe-callbar-button-with-popover__popover', contentClass]\"\n v-bind=\"$attrs\"\n :open-popover=\"showPopover\"\n @opened=\"onModalIsOpened\"\n >\n <template #anchor>\n <dt-button\n circle\n importance=\"clear\"\n size=\"lg\"\n :class=\"['d-recipe-callbar-button-with-popover__arrow',\n { 'd-recipe-callbar-button-with-popover__arrow--large': !isCompactMode }]\"\n width=\"2rem\"\n :aria-label=\"arrowButtonLabel\"\n :active=\"open\"\n @click=\"arrowClick\"\n >\n <template #icon>\n <dt-icon-chevron-up\n class=\"d-recipe-callbar-button-with-popover__arrow-icon\"\n size=\"200\"\n />\n </template>\n </dt-button>\n </template>\n <slot\n slot=\"content\"\n name=\"content\"\n />\n <slot\n slot=\"headerContent\"\n name=\"headerContent\"\n />\n <slot\n slot=\"footerContent\"\n name=\"footerContent\"\n />\n </dt-popover>\n </div>\n</template>\n\n<script>\nimport { DtButton } from '@/components/button';\nimport { DtPopover } from '@/components/popover';\nimport { DtIconChevronUp } from '@dialpad/dialtone-icons/vue2';\nimport { DtRecipeCallbarButton, CALLBAR_BUTTON_VALID_WIDTH_SIZE } from '../callbar_button';\nimport utils, { warnIfUnmounted } from '@/common/utils';\n\nexport default {\n name: 'DtRecipeCallbarButtonWithPopover',\n\n components: { DtRecipeCallbarButton, DtPopover, DtButton, DtIconChevronUp },\n\n /* inheritAttrs: false is generally an option we want to set on library\n components. This allows any attributes passed in that are not recognized\n as props to be passed down to another element or component using v-bind:$attrs\n more info: https://vuejs.org/v2/api/#inheritAttrs */\n inheritAttrs: false,\n\n props: {\n /**\n * Id for the item.\n */\n id: {\n type: String,\n default () {\n return utils.getUniqueString();\n },\n },\n\n /**\n * Aria label for the button. If empty, it takes its value from the default slot.\n */\n ariaLabel: {\n type: String,\n default: null,\n validator: (label) => {\n return label || this.$slots.default;\n },\n },\n\n /**\n * Aria label for the arrow. Cannot be empty.\n */\n arrowButtonLabel: {\n type: String,\n required: true,\n validator: (label) => {\n return !!label;\n },\n },\n\n /**\n * The direction the popover displays relative to the anchor.\n * @values 'bottom', 'bottom-start', 'bottom-end',\n * 'right', 'right-start', 'right-end',\n * 'left', 'left-start', 'left-end',\n * 'top', 'top-start', 'top-end'\n * @default 'top'\n */\n placement: {\n type: String,\n default: 'top',\n },\n\n /**\n * Displaces the content box from its anchor element\n * by the specified number of pixels.\n * <a\n * class=\"d-link\"\n * href=\"https://atomiks.github.io/tippyjs/v6/all-props/#offset\"\n * target=\"_blank\"\n * >\n * Tippy.js docs\n * </a>\n */\n offset: {\n type: Array,\n default: () => [0, 16],\n },\n\n /**\n * The element that is focused when the popover is opened. This can be an\n * HTMLElement within the popover, a string starting with '#' which will\n * find the element by ID. 'first' which will automatically focus\n * the first element, or 'dialog' which will focus the dialog window itself.\n * If the dialog is modal this prop cannot be 'none'.\n */\n initialFocusElement: {\n type: String,\n default: 'first',\n },\n\n /**\n * Determines visibility for close button\n */\n showCloseButton: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Determines whether the button should be disabled\n * default is false.\n * @values true, false\n */\n disabled: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Forces showing the arrow, even if the button is disabled.\n * default is false\n * @values true, false\n */\n forceShowArrow: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Determines whether the button should have active styling\n * default is false.\n * @values true, false\n * @see https://dialtone.dialpad.com/components/button/\n */\n active: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Determines whether the button should have danger styling\n * default is false.\n * @values true, false\n * @see https://dialtone.dialpad.com/components/button/\n */\n danger: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Additional class name for the button wrapper element.\n */\n buttonClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Additional class name for the button text.\n */\n textClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /*\n * Width size. Valid values are: 'xl', 'lg', 'md' and 'sm'.\n */\n buttonWidthSize: {\n type: String,\n default: 'xl',\n validator: size => CALLBAR_BUTTON_VALID_WIDTH_SIZE.includes(size),\n },\n\n /**\n * Additional class name for the popover content wrapper element.\n */\n contentClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * To auto open the modal popover.\n */\n openPopover: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Whether the tooltip has an inverted background color.\n * @values true, false\n */\n invertedTooltip: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Use this if you would like to manually override the logic for when the tooltip shows.\n * Otherwise it will just show on hover/focus.\n * @values null, true, false\n */\n showTooltip: {\n type: Boolean,\n default: null,\n },\n\n /**\n * The message that displays in the tooltip. This will be overridden by the tooltip slot.\n */\n tooltipText: {\n type: String,\n default: undefined,\n },\n },\n\n emits: [\n /**\n * Emitted when the arrow is clicked\n */\n 'arrow-click',\n\n /**\n * Native click event\n *\n * @event click\n * @type {PointerEvent | KeyboardEvent}\n */\n 'click',\n\n /**\n * Emitted when modal popover is opened or closed.\n */\n 'opened',\n ],\n\n data () {\n return {\n open: false,\n };\n },\n\n computed: {\n showArrowButton () {\n return this.forceShowArrow || !this.disabled;\n },\n\n isCompactMode () {\n return this.buttonWidthSize === 'sm' || this.buttonWidthSize === 'md';\n },\n\n showPopover () {\n if (!this.openPopover || this.open) {\n this.syncOpenState();\n return false;\n }\n\n return this.toggleOpen();\n },\n },\n\n mounted () {\n warnIfUnmounted(this.$el, this.$options.name);\n },\n\n methods: {\n arrowClick (ev) {\n this.$emit('arrow-click', ev);\n return this.toggleOpen();\n },\n\n toggleOpen () {\n return (this.open = !this.open);\n },\n\n syncOpenState () {\n this.open = this.openPopover;\n },\n\n buttonClick (ev) {\n // If no listener for the click event, the button click opens the popover\n // the same as if the arrow was clicked.\n if (!this.$listeners.click) {\n this.arrowClick(ev);\n } else {\n this.$emit('click', ev);\n }\n },\n\n onModalIsOpened (isOpened) {\n this.open = isOpened;\n this.$emit('opened', isOpened);\n },\n },\n\n};\n</script>\n"],"names":["this"],"mappings":";;;;;;;AAuFA,MAAA,YAAA;AAAA,EACA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BAAA,QAAA,KAAA,oBAAA;AAAA,IACA;AAAA,IAEA,cAAA;AACA,UAAA,CAAA,KAAA,eAAA,KAAA,MAAA;AACA,aAAA,cAAA;AACA,eAAA;AAAA,MACA;AAEA,aAAA,KAAA;IACA;AAAA,EACA;AAAA,EAEA,UAAA;AACA,oBAAA,KAAA,KAAA,KAAA,SAAA,IAAA;AAAA,EACA;AAAA,EAEA,SAAA;AAAA,IACA,WAAA,IAAA;AACA,WAAA,MAAA,eAAA,EAAA;AACA,aAAA,KAAA;IACA;AAAA,IAEA,aAAA;AACA,aAAA,KAAA,OAAA,CAAA,KAAA;AAAA,IACA;AAAA,IAEA,gBAAA;AACA,WAAA,OAAA,KAAA;AAAA,IACA;AAAA,IAEA,YAAA,IAAA;AAGA,UAAA,CAAA,KAAA,WAAA,OAAA;AACA,aAAA,WAAA,EAAA;AAAA,MACA,OAAA;AACA,aAAA,MAAA,SAAA,EAAA;AAAA,MACA;AAAA,IACA;AAAA,IAEA,gBAAA,UAAA;AACA,WAAA,OAAA;AACA,WAAA,MAAA,UAAA,QAAA;AAAA,IACA;AAAA,EACA;AAEA;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -89,8 +89,8 @@ const _sfc_main = {
|
|
|
89
89
|
nodeIcon() {
|
|
90
90
|
return typeToIcon.get(this.nodeType);
|
|
91
91
|
},
|
|
92
|
-
|
|
93
|
-
const { normal, selected } = ivr_node_constants.
|
|
92
|
+
nodeClass() {
|
|
93
|
+
const { normal, selected } = ivr_node_constants.IVR_NODE_CLASS_MAPPING[this.nodeType];
|
|
94
94
|
return this.isSelected ? selected : normal;
|
|
95
95
|
},
|
|
96
96
|
isGotoNode() {
|
|
@@ -105,18 +105,10 @@ const _sfc_main = {
|
|
|
105
105
|
};
|
|
106
106
|
var _sfc_render = function render() {
|
|
107
107
|
var _vm = this, _c = _vm._self._c;
|
|
108
|
-
return _c("div", _vm._g({
|
|
109
|
-
"d-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
], "header-class": [
|
|
113
|
-
"d-mtn1",
|
|
114
|
-
"d-bt",
|
|
115
|
-
"d-btw4",
|
|
116
|
-
"d-p0",
|
|
117
|
-
_vm.headerColor,
|
|
118
|
-
{ "d-btr4": !_vm.isSelected }
|
|
119
|
-
] }, scopedSlots: _vm._u([{ key: "header", fn: function() {
|
|
108
|
+
return _c("div", _vm._g({ class: [
|
|
109
|
+
"d-recipe-ivr-node",
|
|
110
|
+
_vm.nodeClass
|
|
111
|
+
] }, _vm.$listeners), [_vm.dtmfKey ? _c("div", { staticClass: "d-recipe-ivr-node__connector d-recipe-ivr-node__connector-dtmf", class: { "d-recipe-ivr-node__connector-dtmf--selected": _vm.isSelected }, attrs: { "data-qa": "dt-top-connector-dtmf" } }, [_vm._v(" " + _vm._s(_vm.dtmfKey) + " ")]) : _vm._e(), _vm.$slots.connector ? _vm._t("connector") : _vm._e(), !_vm.dtmfKey && !_vm.$slots.connector ? _c("div", { staticClass: "d-recipe-ivr-node__connector", class: { "d-recipe-ivr-node__connector--selected": _vm.isSelected }, attrs: { "data-qa": "dt-top-connector" } }) : _vm._e(), _c("dt-card", { scopedSlots: _vm._u([{ key: "header", fn: function() {
|
|
120
112
|
return [_c("div", { staticClass: "d-recipe-ivr-node__header-left" }, [_c("dt-button", { attrs: { "aria-label": _vm.nodeType, "importance": "clear", "kind": "muted", "data-qa": "dt-ivr-node-icon" }, scopedSlots: _vm._u([{ key: "icon", fn: function() {
|
|
121
113
|
return [_c(_vm.nodeIcon, { tag: "component", class: ["", { "d-recipe-ivr-node__goto-icon": _vm.isGotoNode }], attrs: { "size": "200" } })];
|
|
122
114
|
}, proxy: true }]) }), _c("p", { staticClass: "d-recipe-ivr-node__label", attrs: { "data-qa": "ivr-node-label" } }, [_vm._v(" " + _vm._s(_vm.nodeLabel) + " ")])], 1), _c("dt-dropdown", { attrs: { "placement": "bottom", "open": _vm.isOpen }, on: { "update:open": function($event) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ivr_node.vue.cjs","sources":["../../../../recipes/cards/ivr_node/ivr_node.vue"],"sourcesContent":["<template>\n <div\n class=\"d-recipe-ivr-node\"\n v-on=\"$listeners\"\n >\n <div\n v-if=\"dtmfKey\"\n data-qa=\"dt-top-connector-dtmf\"\n class=\"d-recipe-ivr-node__connector d-recipe-ivr-node__connector-dtmf\"\n :class=\"{ 'd-recipe-ivr-node__connector-dtmf--selected': isSelected }\"\n >\n {{ dtmfKey }}\n </div>\n <slot\n v-if=\"$slots.connector\"\n name=\"connector\"\n />\n <div\n v-if=\"!dtmfKey && !$slots.connector\"\n data-qa=\"dt-top-connector\"\n class=\"d-recipe-ivr-node__connector\"\n :class=\"{ 'd-recipe-ivr-node__connector--selected': isSelected }\"\n />\n <dt-card
|
|
1
|
+
{"version":3,"file":"ivr_node.vue.cjs","sources":["../../../../recipes/cards/ivr_node/ivr_node.vue"],"sourcesContent":["<template>\n <div\n :class=\"[\n 'd-recipe-ivr-node',\n nodeClass,\n ]\"\n v-on=\"$listeners\"\n >\n <div\n v-if=\"dtmfKey\"\n data-qa=\"dt-top-connector-dtmf\"\n class=\"d-recipe-ivr-node__connector d-recipe-ivr-node__connector-dtmf\"\n :class=\"{ 'd-recipe-ivr-node__connector-dtmf--selected': isSelected }\"\n >\n {{ dtmfKey }}\n </div>\n <slot\n v-if=\"$slots.connector\"\n name=\"connector\"\n />\n <div\n v-if=\"!dtmfKey && !$slots.connector\"\n data-qa=\"dt-top-connector\"\n class=\"d-recipe-ivr-node__connector\"\n :class=\"{ 'd-recipe-ivr-node__connector--selected': isSelected }\"\n />\n <dt-card>\n <template #header>\n <!-- node label and icon section on left of the header -->\n <div class=\"d-recipe-ivr-node__header-left\">\n <dt-button\n :aria-label=\"nodeType\"\n importance=\"clear\"\n kind=\"muted\"\n data-qa=\"dt-ivr-node-icon\"\n >\n <template #icon>\n <component\n :is=\"nodeIcon\"\n size=\"200\"\n :class=\"['', { 'd-recipe-ivr-node__goto-icon': isGotoNode }]\"\n />\n </template>\n </dt-button>\n <p\n class=\"d-recipe-ivr-node__label\"\n data-qa=\"ivr-node-label\"\n >\n {{ nodeLabel }}\n </p>\n </div>\n <!-- node menu for actions like edit, copy, delete -->\n <dt-dropdown\n placement=\"bottom\"\n :open.sync=\"isOpen\"\n >\n <template #anchor>\n <dt-button\n importance=\"clear\"\n kind=\"muted\"\n :aria-label=\"menuButtonAriaLabel\"\n @click.stop.prevent=\"openMenu\"\n >\n <template #icon>\n <dt-icon-more-vertical size=\"200\" />\n </template>\n </dt-button>\n </template>\n <template #list=\"{ close }\">\n <div class=\"d-recipe-ivr-node__dropdown-list\">\n <slot\n name=\"menuItems\"\n :close=\"close\"\n />\n </div>\n </template>\n </dt-dropdown>\n </template>\n <template #content>\n <slot name=\"content\" />\n </template>\n </dt-card>\n </div>\n</template>\n\n<script>\nimport { DtCard } from '@/components/card';\nimport { DtButton } from '@/components/button';\nimport { DtDropdown } from '@/components/dropdown';\nimport {\n DtIconKeypad,\n DtIconDialer,\n DtIconVolume2,\n DtIconExpertNode,\n DtIconBranch,\n DtIconCallMerge,\n DtIconChevronsRight,\n DtIconTransfer,\n DtIconPhoneHangUp,\n DtIconMoreVertical,\n} from '@dialpad/dialtone-icons/vue2';\nimport {\n IVR_NODE_CLASS_MAPPING,\n IVR_NODE_PROMPT_MENU,\n IVR_NODE_PROMPT_COLLECT,\n IVR_NODE_PROMPT_PLAY,\n IVR_NODE_EXPERT,\n IVR_NODE_BRANCH,\n IVR_NODE_GO_TO,\n IVR_NODE_ASSIGN,\n IVR_NODE_TRANSFER,\n IVR_NODE_HANGUP,\n} from './ivr_node_constants';\n\nconst typeToIcon = new Map([\n [IVR_NODE_PROMPT_MENU, DtIconKeypad],\n [IVR_NODE_PROMPT_COLLECT, DtIconDialer],\n [IVR_NODE_PROMPT_PLAY, DtIconVolume2],\n [IVR_NODE_EXPERT, DtIconExpertNode],\n [IVR_NODE_BRANCH, DtIconBranch],\n [IVR_NODE_GO_TO, DtIconCallMerge],\n [IVR_NODE_ASSIGN, DtIconChevronsRight],\n [IVR_NODE_TRANSFER, DtIconTransfer],\n [IVR_NODE_HANGUP, DtIconPhoneHangUp],\n]);\n\nexport default {\n name: 'DtRecipeIvrNode',\n\n components: {\n DtCard,\n DtButton,\n DtDropdown,\n DtIconKeypad,\n DtIconDialer,\n DtIconVolume2,\n DtIconExpertNode,\n DtIconBranch,\n DtIconCallMerge,\n DtIconChevronsRight,\n DtIconTransfer,\n DtIconPhoneHangUp,\n DtIconMoreVertical,\n },\n\n props: {\n\n /**\n * type of IVR Node.\n */\n nodeType: {\n type: String,\n required: true,\n },\n\n /**\n * Descriptive label for the node name.\n */\n\n nodeLabel: {\n type: String,\n required: true,\n },\n\n /**\n * Selected state of the node\n */\n isSelected: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Translated aria-label for header menu button\n */\n menuButtonAriaLabel: {\n type: String,\n required: true,\n },\n\n /**\n * DTMF input\n */\n dtmfKey: {\n type: String,\n default: null,\n },\n },\n\n emits: [\n /**\n * Add node click event\n *\n * @event click\n * @type {PointerEvent | KeyboardEvent}\n */\n 'click',\n ],\n\n data () {\n return {\n isOpen: false,\n };\n },\n\n computed: {\n nodeIcon () {\n return typeToIcon.get(this.nodeType);\n },\n\n nodeClass () {\n const { normal, selected } = IVR_NODE_CLASS_MAPPING[this.nodeType];\n return this.isSelected ? selected : normal;\n },\n\n isGotoNode () {\n return this.nodeType === IVR_NODE_GO_TO;\n },\n },\n\n methods: {\n openMenu () {\n this.isOpen = true;\n },\n },\n};\n</script>\n"],"names":["IVR_NODE_PROMPT_MENU","DtIconKeypad","IVR_NODE_PROMPT_COLLECT","DtIconDialer","IVR_NODE_PROMPT_PLAY","DtIconVolume2","IVR_NODE_EXPERT","DtIconExpertNode","IVR_NODE_BRANCH","DtIconBranch","IVR_NODE_GO_TO","DtIconCallMerge","IVR_NODE_ASSIGN","DtIconChevronsRight","IVR_NODE_TRANSFER","DtIconTransfer","IVR_NODE_HANGUP","DtIconPhoneHang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qBAAA;AAAA,MACA,MAAA;AAAA,MACA,UAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,SAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,OAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOA;AAAA,EACA;AAAA,EAEA,OAAA;AACA,WAAA;AAAA,MACA,QAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,UAAA;AAAA,IACA,WAAA;AACA,aAAA,WAAA,IAAA,KAAA,QAAA;AAAA,IACA;AAAA,IAEA,YAAA;AACA,YAAA,EAAA,QAAA,SAAA,IAAAC,mBAAAA,uBAAA,KAAA,QAAA;AACA,aAAA,KAAA,aAAA,WAAA;AAAA,IACA;AAAA,IAEA,aAAA;AACA,aAAA,KAAA,aAAAZ;IACA;AAAA,EACA;AAAA,EAEA,SAAA;AAAA,IACA,WAAA;AACA,WAAA,SAAA;AAAA,IACA;AAAA,EACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DtIconKeypad, DtIconDialer, DtIconVolume2, DtIconExpertNode, DtIconBranch, DtIconCallMerge, DtIconChevronsRight, DtIconTransfer, DtIconPhoneHangUp, DtIconMoreVertical } from "@dialpad/dialtone-icons/vue2";
|
|
2
|
-
import { IVR_NODE_GO_TO, IVR_NODE_PROMPT_MENU, IVR_NODE_PROMPT_COLLECT, IVR_NODE_PROMPT_PLAY, IVR_NODE_EXPERT, IVR_NODE_BRANCH, IVR_NODE_ASSIGN, IVR_NODE_TRANSFER, IVR_NODE_HANGUP,
|
|
2
|
+
import { IVR_NODE_GO_TO, IVR_NODE_PROMPT_MENU, IVR_NODE_PROMPT_COLLECT, IVR_NODE_PROMPT_PLAY, IVR_NODE_EXPERT, IVR_NODE_BRANCH, IVR_NODE_ASSIGN, IVR_NODE_TRANSFER, IVR_NODE_HANGUP, IVR_NODE_CLASS_MAPPING } from "./ivr_node_constants.js";
|
|
3
3
|
import normalizeComponent from "../../../_virtual/_plugin-vue2_normalizer.js";
|
|
4
4
|
import DtCard from "../../../components/card/card.vue.js";
|
|
5
5
|
import DtButton from "../../../components/button/button.vue.js";
|
|
@@ -87,8 +87,8 @@ const _sfc_main = {
|
|
|
87
87
|
nodeIcon() {
|
|
88
88
|
return typeToIcon.get(this.nodeType);
|
|
89
89
|
},
|
|
90
|
-
|
|
91
|
-
const { normal, selected } =
|
|
90
|
+
nodeClass() {
|
|
91
|
+
const { normal, selected } = IVR_NODE_CLASS_MAPPING[this.nodeType];
|
|
92
92
|
return this.isSelected ? selected : normal;
|
|
93
93
|
},
|
|
94
94
|
isGotoNode() {
|
|
@@ -103,18 +103,10 @@ const _sfc_main = {
|
|
|
103
103
|
};
|
|
104
104
|
var _sfc_render = function render() {
|
|
105
105
|
var _vm = this, _c = _vm._self._c;
|
|
106
|
-
return _c("div", _vm._g({
|
|
107
|
-
"d-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
], "header-class": [
|
|
111
|
-
"d-mtn1",
|
|
112
|
-
"d-bt",
|
|
113
|
-
"d-btw4",
|
|
114
|
-
"d-p0",
|
|
115
|
-
_vm.headerColor,
|
|
116
|
-
{ "d-btr4": !_vm.isSelected }
|
|
117
|
-
] }, scopedSlots: _vm._u([{ key: "header", fn: function() {
|
|
106
|
+
return _c("div", _vm._g({ class: [
|
|
107
|
+
"d-recipe-ivr-node",
|
|
108
|
+
_vm.nodeClass
|
|
109
|
+
] }, _vm.$listeners), [_vm.dtmfKey ? _c("div", { staticClass: "d-recipe-ivr-node__connector d-recipe-ivr-node__connector-dtmf", class: { "d-recipe-ivr-node__connector-dtmf--selected": _vm.isSelected }, attrs: { "data-qa": "dt-top-connector-dtmf" } }, [_vm._v(" " + _vm._s(_vm.dtmfKey) + " ")]) : _vm._e(), _vm.$slots.connector ? _vm._t("connector") : _vm._e(), !_vm.dtmfKey && !_vm.$slots.connector ? _c("div", { staticClass: "d-recipe-ivr-node__connector", class: { "d-recipe-ivr-node__connector--selected": _vm.isSelected }, attrs: { "data-qa": "dt-top-connector" } }) : _vm._e(), _c("dt-card", { scopedSlots: _vm._u([{ key: "header", fn: function() {
|
|
118
110
|
return [_c("div", { staticClass: "d-recipe-ivr-node__header-left" }, [_c("dt-button", { attrs: { "aria-label": _vm.nodeType, "importance": "clear", "kind": "muted", "data-qa": "dt-ivr-node-icon" }, scopedSlots: _vm._u([{ key: "icon", fn: function() {
|
|
119
111
|
return [_c(_vm.nodeIcon, { tag: "component", class: ["", { "d-recipe-ivr-node__goto-icon": _vm.isGotoNode }], attrs: { "size": "200" } })];
|
|
120
112
|
}, proxy: true }]) }), _c("p", { staticClass: "d-recipe-ivr-node__label", attrs: { "data-qa": "ivr-node-label" } }, [_vm._v(" " + _vm._s(_vm.nodeLabel) + " ")])], 1), _c("dt-dropdown", { attrs: { "placement": "bottom", "open": _vm.isOpen }, on: { "update:open": function($event) {
|