@dialpad/dialtone-vue 3.119.0 → 3.120.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/chunks/_plugin-vue_export-helper-6_y-gaV6.js +2 -0
- package/dist/chunks/_plugin-vue_export-helper-6_y-gaV6.js.map +1 -0
- package/dist/chunks/dropdown-UO3UJalk.js +2 -0
- package/dist/chunks/dropdown-UO3UJalk.js.map +1 -0
- package/dist/chunks/dropdown_constants-KHFvVI2L.js +2 -0
- package/dist/chunks/dropdown_constants-KHFvVI2L.js.map +1 -0
- package/dist/chunks/icon_constants-2S_OSQ1t.js +2 -0
- package/dist/chunks/icon_constants-2S_OSQ1t.js.map +1 -0
- package/dist/chunks/index-6tYeqbgP.js +3 -0
- package/dist/chunks/index-6tYeqbgP.js.map +1 -0
- package/dist/chunks/index-IBtQ5jRJ.js +2 -0
- package/dist/chunks/index-IBtQ5jRJ.js.map +1 -0
- package/dist/chunks/input-0Uksk4DP.js +2 -0
- package/dist/chunks/input-0Uksk4DP.js.map +1 -0
- package/dist/chunks/input_group-AS760Cp7.js +2 -0
- package/dist/chunks/input_group-AS760Cp7.js.map +1 -0
- package/dist/chunks/keyboard_list_navigation-N74Bpdq7.js +2 -0
- package/dist/chunks/keyboard_list_navigation-N74Bpdq7.js.map +1 -0
- package/dist/chunks/link_constants-Kn6kP4i1.js +2 -0
- package/dist/chunks/link_constants-Kn6kP4i1.js.map +1 -0
- package/dist/chunks/list_item_constants-Tsz5CO1m.js +2 -0
- package/dist/chunks/list_item_constants-Tsz5CO1m.js.map +1 -0
- package/dist/chunks/modal-qEzlo0Sj.js +2 -0
- package/dist/chunks/modal-qEzlo0Sj.js.map +1 -0
- package/dist/chunks/notice_action-jO199emq.js +2 -0
- package/dist/chunks/notice_action-jO199emq.js.map +1 -0
- package/dist/chunks/notice_constants-mC6al2Dm.js +2 -0
- package/dist/chunks/notice_constants-mC6al2Dm.js.map +1 -0
- package/dist/chunks/popover_constants-hOEhklvr.js +2 -0
- package/dist/chunks/popover_constants-hOEhklvr.js.map +1 -0
- package/dist/chunks/sr_only_close_button-iD7s1Pbj.js +3 -0
- package/dist/chunks/sr_only_close_button-iD7s1Pbj.js.map +1 -0
- package/dist/chunks/stack_constants-m9Ickqw0.js +2 -0
- package/dist/chunks/stack_constants-m9Ickqw0.js.map +1 -0
- package/dist/chunks/tab-at7WWglk.js +2 -0
- package/dist/chunks/tab-at7WWglk.js.map +1 -0
- package/dist/component-documentation.json +1 -1
- package/dist/dialtone-vue.cjs +2 -0
- package/dist/dialtone-vue.cjs.map +1 -0
- package/dist/lib/attachment-carousel.cjs +2 -0
- package/dist/lib/attachment-carousel.cjs.map +1 -0
- package/dist/lib/attachment-carousel.js +2 -3
- package/dist/lib/attachment-carousel.js.map +1 -1
- package/dist/lib/avatar.cjs +2 -0
- package/dist/lib/avatar.cjs.map +1 -0
- package/dist/lib/avatar.js +2 -3
- package/dist/lib/avatar.js.map +1 -1
- package/dist/lib/badge.cjs +2 -0
- package/dist/lib/badge.cjs.map +1 -0
- package/dist/lib/badge.js +2 -3
- package/dist/lib/badge.js.map +1 -1
- package/dist/lib/banner.cjs +3 -0
- package/dist/lib/banner.cjs.map +1 -0
- package/dist/lib/banner.js +6 -7
- package/dist/lib/banner.js.map +1 -1
- package/dist/lib/breadcrumbs.cjs +2 -0
- package/dist/lib/breadcrumbs.cjs.map +1 -0
- package/dist/lib/button-group.cjs +2 -0
- package/dist/lib/button-group.cjs.map +1 -0
- package/dist/lib/button.cjs +2 -0
- package/dist/lib/button.cjs.map +1 -0
- package/dist/lib/callbar-button-with-popover.cjs +2 -0
- package/dist/lib/callbar-button-with-popover.cjs.map +1 -0
- package/dist/lib/callbar-button-with-popover.js +9 -10
- package/dist/lib/callbar-button-with-popover.js.map +1 -1
- package/dist/lib/callbar-button.cjs +2 -0
- package/dist/lib/callbar-button.cjs.map +1 -0
- package/dist/lib/callbox.cjs +2 -0
- package/dist/lib/callbox.cjs.map +1 -0
- package/dist/lib/callbox.js +2 -3
- package/dist/lib/callbox.js.map +1 -1
- package/dist/lib/card.cjs +2 -0
- package/dist/lib/card.cjs.map +1 -0
- package/dist/lib/checkbox-group.cjs +2 -0
- package/dist/lib/checkbox-group.cjs.map +1 -0
- package/dist/lib/checkbox.cjs +2 -0
- package/dist/lib/checkbox.cjs.map +1 -0
- package/dist/lib/chip.cjs +2 -0
- package/dist/lib/chip.cjs.map +1 -0
- package/dist/lib/chip.js +10 -11
- package/dist/lib/chip.js.map +1 -1
- package/dist/lib/codeblock.cjs +3 -0
- package/dist/lib/codeblock.cjs.map +1 -0
- package/dist/lib/collapsible.cjs +2 -0
- package/dist/lib/collapsible.cjs.map +1 -0
- package/dist/lib/collapsible.js +7 -8
- package/dist/lib/collapsible.js.map +1 -1
- package/dist/lib/combobox-multi-select.cjs +2 -0
- package/dist/lib/combobox-multi-select.cjs.map +1 -0
- package/dist/lib/combobox-with-popover.cjs +2 -0
- package/dist/lib/combobox-with-popover.cjs.map +1 -0
- package/dist/lib/combobox.cjs +2 -0
- package/dist/lib/combobox.cjs.map +1 -0
- package/dist/lib/constants.cjs +2 -0
- package/dist/lib/constants.cjs.map +1 -0
- package/dist/lib/contact-info.cjs +2 -0
- package/dist/lib/contact-info.cjs.map +1 -0
- package/dist/lib/contact-info.js +2 -3
- package/dist/lib/contact-info.js.map +1 -1
- package/dist/lib/contact-row.cjs +2 -0
- package/dist/lib/contact-row.cjs.map +1 -0
- package/dist/lib/datepicker.cjs +2 -0
- package/dist/lib/datepicker.cjs.map +1 -0
- package/dist/lib/datepicker.js +12 -13
- package/dist/lib/datepicker.js.map +1 -1
- package/dist/lib/dates.cjs +2 -0
- package/dist/lib/dates.cjs.map +1 -0
- package/dist/lib/description-list.cjs +2 -0
- package/dist/lib/description-list.cjs.map +1 -0
- package/dist/lib/dropdown.cjs +2 -0
- package/dist/lib/dropdown.cjs.map +1 -0
- package/dist/lib/dropdown.js +6 -7
- package/dist/lib/dropdown.js.map +1 -1
- package/dist/lib/editor.cjs +2 -0
- package/dist/lib/editor.cjs.map +1 -0
- package/dist/lib/emoji-picker.cjs +2 -0
- package/dist/lib/emoji-picker.cjs.map +1 -0
- package/dist/lib/emoji-picker.js +2 -3
- package/dist/lib/emoji-picker.js.map +1 -1
- package/dist/lib/emoji-row.cjs +2 -0
- package/dist/lib/emoji-row.cjs.map +1 -0
- package/dist/lib/emoji-text-wrapper.cjs +2 -0
- package/dist/lib/emoji-text-wrapper.cjs.map +1 -0
- package/dist/lib/emoji.cjs +2 -0
- package/dist/lib/emoji.cjs.map +1 -0
- package/dist/lib/feed-item-row.cjs +2 -0
- package/dist/lib/feed-item-row.cjs.map +1 -0
- package/dist/lib/feed-item-row.js +11 -12
- package/dist/lib/feed-item-row.js.map +1 -1
- package/dist/lib/feed-pill.cjs +2 -0
- package/dist/lib/feed-pill.cjs.map +1 -0
- package/dist/lib/feed-pill.js +2 -3
- package/dist/lib/feed-pill.js.map +1 -1
- package/dist/lib/general-row.cjs +2 -0
- package/dist/lib/general-row.cjs.map +1 -0
- package/dist/lib/group-row.cjs +2 -0
- package/dist/lib/group-row.cjs.map +1 -0
- package/dist/lib/group-row.js +1 -1
- package/dist/lib/grouped-chip.cjs +2 -0
- package/dist/lib/grouped-chip.cjs.map +1 -0
- package/dist/lib/grouped-chip.js +5 -6
- package/dist/lib/grouped-chip.js.map +1 -1
- package/dist/lib/hovercard.cjs +2 -0
- package/dist/lib/hovercard.cjs.map +1 -0
- package/dist/lib/hovercard.js +7 -8
- package/dist/lib/hovercard.js.map +1 -1
- package/dist/lib/icon.cjs +2 -0
- package/dist/lib/icon.cjs.map +1 -0
- package/dist/lib/icon.js +20 -51
- package/dist/lib/icon.js.map +1 -1
- package/dist/lib/image-viewer.cjs +2 -0
- package/dist/lib/image-viewer.cjs.map +1 -0
- package/dist/lib/image-viewer.js +9 -10
- package/dist/lib/image-viewer.js.map +1 -1
- package/dist/lib/input-group.cjs +2 -0
- package/dist/lib/input-group.cjs.map +1 -0
- package/dist/lib/input.cjs +2 -0
- package/dist/lib/input.cjs.map +1 -0
- package/dist/lib/item-layout.cjs +2 -0
- package/dist/lib/item-layout.cjs.map +1 -0
- package/dist/lib/ivr-node.cjs +2 -0
- package/dist/lib/ivr-node.cjs.map +1 -0
- package/dist/lib/ivr-node.js +4 -5
- package/dist/lib/ivr-node.js.map +1 -1
- package/dist/lib/keyboard-shortcut.cjs +2 -0
- package/dist/lib/keyboard-shortcut.cjs.map +1 -0
- package/dist/lib/keyboard-shortcut.js +4 -5
- package/dist/lib/keyboard-shortcut.js.map +1 -1
- package/dist/lib/lazy-show.cjs +2 -0
- package/dist/lib/lazy-show.cjs.map +1 -0
- package/dist/lib/link.cjs +2 -0
- package/dist/lib/link.cjs.map +1 -0
- package/dist/lib/list-item-group.cjs +2 -0
- package/dist/lib/list-item-group.cjs.map +1 -0
- package/dist/lib/list-item.cjs +2 -0
- package/dist/lib/list-item.cjs.map +1 -0
- package/dist/lib/list-item.js +2 -3
- package/dist/lib/list-item.js.map +1 -1
- package/dist/lib/message-input.cjs +2 -0
- package/dist/lib/message-input.cjs.map +1 -0
- package/dist/lib/message-input.js +148 -100
- package/dist/lib/message-input.js.map +1 -1
- package/dist/lib/mixins.cjs +2 -0
- package/dist/lib/mixins.cjs.map +1 -0
- package/dist/lib/modal.cjs +3 -0
- package/dist/lib/modal.cjs.map +1 -0
- package/dist/lib/modal.js +11 -12
- package/dist/lib/modal.js.map +1 -1
- package/dist/lib/notice.cjs +2 -0
- package/dist/lib/notice.cjs.map +1 -0
- package/dist/lib/notice.js +2 -3
- package/dist/lib/notice.js.map +1 -1
- package/dist/lib/pagination.cjs +2 -0
- package/dist/lib/pagination.cjs.map +1 -0
- package/dist/lib/pagination.js +2 -3
- package/dist/lib/pagination.js.map +1 -1
- package/dist/lib/popover.cjs +2 -0
- package/dist/lib/popover.cjs.map +1 -0
- package/dist/lib/popover.js +4 -5
- package/dist/lib/popover.js.map +1 -1
- package/dist/lib/presence.cjs +2 -0
- package/dist/lib/presence.cjs.map +1 -0
- package/dist/lib/radio-group.cjs +2 -0
- package/dist/lib/radio-group.cjs.map +1 -0
- package/dist/lib/radio.cjs +2 -0
- package/dist/lib/radio.cjs.map +1 -0
- package/dist/lib/rich-text-editor.cjs +2 -0
- package/dist/lib/rich-text-editor.cjs.map +1 -0
- package/dist/lib/rich-text-editor.js +174 -142
- package/dist/lib/rich-text-editor.js.map +1 -1
- package/dist/lib/root-layout.cjs +2 -0
- package/dist/lib/root-layout.cjs.map +1 -0
- package/dist/lib/scroller.cjs +2 -0
- package/dist/lib/scroller.cjs.map +1 -0
- package/dist/lib/select-menu.cjs +2 -0
- package/dist/lib/select-menu.cjs.map +1 -0
- package/dist/lib/settings-menu-button.cjs +2 -0
- package/dist/lib/settings-menu-button.cjs.map +1 -0
- package/dist/lib/settings-menu-button.js +2 -3
- package/dist/lib/settings-menu-button.js.map +1 -1
- package/dist/lib/skeleton.cjs +2 -0
- package/dist/lib/skeleton.cjs.map +1 -0
- package/dist/lib/stack.cjs +2 -0
- package/dist/lib/stack.cjs.map +1 -0
- package/dist/lib/tabs.cjs +2 -0
- package/dist/lib/tabs.cjs.map +1 -0
- package/dist/lib/time-pill.cjs +2 -0
- package/dist/lib/time-pill.cjs.map +1 -0
- package/dist/lib/toast.cjs +2 -0
- package/dist/lib/toast.cjs.map +1 -0
- package/dist/lib/toast.js +2 -3
- package/dist/lib/toast.js.map +1 -1
- package/dist/lib/toggle.cjs +2 -0
- package/dist/lib/toggle.cjs.map +1 -0
- package/dist/lib/tooltip-directive.cjs +2 -0
- package/dist/lib/tooltip-directive.cjs.map +1 -0
- package/dist/lib/tooltip.cjs +2 -0
- package/dist/lib/tooltip.cjs.map +1 -0
- package/dist/lib/top-banner-info.cjs +2 -0
- package/dist/lib/top-banner-info.cjs.map +1 -0
- package/dist/lib/unread-pill.cjs +2 -0
- package/dist/lib/unread-pill.cjs.map +1 -0
- package/dist/lib/unread-pill.js +2 -3
- package/dist/lib/unread-pill.js.map +1 -1
- package/dist/lib/utils.cjs +2 -0
- package/dist/lib/utils.cjs.map +1 -0
- package/dist/lib/validation-messages.cjs +2 -0
- package/dist/lib/validation-messages.cjs.map +1 -0
- package/dist/lib/validators.cjs +2 -0
- package/dist/lib/validators.cjs.map +1 -0
- package/dist/style.css +1 -1
- package/dist/types/components/avatar/avatar.vue.d.ts +1 -1
- package/dist/types/components/button/button.vue.d.ts +2 -2
- package/dist/types/components/card/card.vue.d.ts +1 -1
- package/dist/types/components/chip/chip.vue.d.ts +1 -1
- package/dist/types/components/collapsible/collapsible.vue.d.ts +2 -2
- package/dist/types/components/combobox/combobox.vue.d.ts +1 -1
- package/dist/types/components/dropdown/dropdown.vue.d.ts +1 -1
- package/dist/types/components/emoji/emoji.vue.d.ts +1 -1
- package/dist/types/components/icon/icon.vue.d.ts +1 -19
- package/dist/types/components/icon/icon.vue.d.ts.map +1 -1
- package/dist/types/components/list_item_group/list_item_group.vue.d.ts +1 -1
- package/dist/types/components/modal/modal.vue.d.ts +2 -2
- package/dist/types/components/popover/popover_header_footer.vue.d.ts +1 -1
- package/dist/types/components/rich_text_editor/rich_text_editor.vue.d.ts +91 -1
- package/dist/types/components/rich_text_editor/rich_text_editor.vue.d.ts.map +1 -1
- package/dist/types/components/root_layout/root_layout.vue.d.ts +1 -1
- package/dist/types/components/skeleton/skeleton-list-item.vue.d.ts +1 -1
- package/dist/types/components/skeleton/skeleton-paragraph.vue.d.ts +3 -3
- package/dist/types/components/skeleton/skeleton-shape.vue.d.ts +2 -2
- package/dist/types/components/skeleton/skeleton-text.vue.d.ts +2 -2
- package/dist/types/components/skeleton/skeleton.vue.d.ts +1 -1
- package/dist/types/components/tooltip/tooltip.vue.d.ts +2 -2
- package/dist/types/recipes/buttons/callbar_button_with_popover/callbar_button_with_popover.vue.d.ts +1 -1
- package/dist/types/recipes/comboboxes/combobox_multi_select/combobox_multi_select.vue.d.ts +1 -1
- package/dist/types/recipes/comboboxes/combobox_with_popover/combobox_with_popover.vue.d.ts +2 -2
- package/dist/types/recipes/conversation_view/message_input/message_input.vue.d.ts +90 -0
- package/dist/types/recipes/conversation_view/message_input/message_input.vue.d.ts.map +1 -1
- package/dist/types/recipes/leftbar/general_row/general_row.vue.d.ts +1 -1
- package/dist/types/recipes/leftbar/general_row/leftbar_general_row_icon.vue.d.ts +1 -1
- package/package.json +9 -8
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hovercard.js","sources":["../../components/hovercard/timer.js","../../components/hovercard/hovercard.vue"],"sourcesContent":["import { ref } from 'vue';\nimport { TOOLTIP_DELAY_MS } from '@/components/tooltip/index.js';\n\nexport default (function () {\n const current = ref(null);\n let timerLeave, timerEnter;\n let start = null;\n let prevCard = null;\n\n // Handles the timer for when the event that opens the hovercard\n // is triggered.\n // If no hovercard is active, it sets a delay of TOOLTIP_DELAY_MS.\n // If there was an active hovercard, the delay depends on the time it takes\n // to move from one anchor to the other.\n function enter (id) {\n if (prevCard) {\n const time = Date.now() - start + 100;\n if (timerLeave) clearTimeout(timerLeave);\n if (prevCard !== id) {\n timerLeave = setTimeout(\n () => {\n if (current.value !== null) {\n start = Date.now();\n }\n current.value = null;\n },\n time,\n );\n if (timerEnter) clearTimeout(timerEnter);\n timerEnter = setTimeout(\n () => {\n current.value = id;\n prevCard = id;\n },\n time,\n );\n }\n } else {\n timerEnter = setTimeout(() => {\n current.value = id;\n prevCard = id;\n }, TOOLTIP_DELAY_MS);\n }\n }\n\n // Handles the timer for when the event that closes the hovercard\n // is triggered.\n function leave () {\n if (timerEnter) {\n clearTimeout(timerEnter);\n timerEnter = null;\n }\n start = Date.now();\n timerLeave = setTimeout(() => {\n current.value = null;\n prevCard = null;\n }, TOOLTIP_DELAY_MS);\n }\n\n let instance = null;\n\n return () => {\n if (instance === null) {\n instance = { current, enter, leave };\n }\n return instance;\n };\n})();\n","<!-- eslint-disable vue/multi-word-component-names -->\n<template>\n <dt-popover\n :id=\"id\"\n :placement=\"placement\"\n :content-class=\"contentClass\"\n :fallback-placements=\"fallbackPlacements\"\n :padding=\"padding\"\n :transition=\"transition ? 'fade' : null\"\n :offset=\"offset\"\n :modal=\"false\"\n initial-focus-element=\"none\"\n :header-class=\"headerClass\"\n :footer-class=\"footerClass\"\n :append-to=\"appendTo\"\n :hovercard=\"true\"\n :timer=\"timer\"\n data-qa=\"dt-hovercard\"\n @opened=\"(e) => ($emit('opened', e))\"\n >\n <template #anchor=\"{ attrs }\">\n <slot\n name=\"anchor\"\n v-bind=\"attrs\"\n />\n </template>\n <template #content>\n <slot name=\"content\" />\n </template>\n <template #headerContent>\n <slot name=\"headerContent\" />\n </template>\n\n <template #footerContent>\n <slot name=\"footerContent\" />\n </template>\n </dt-popover>\n</template>\n\n<script setup>\nimport { reactive } from 'vue';\nimport { POPOVER_APPEND_TO_VALUES, POPOVER_PADDING_CLASSES, DtPopover } from '@/components/popover/index.js';\nimport { TOOLTIP_DIRECTIONS } from '@/components/tooltip/index.js';\nimport { getUniqueString } from '@/common/utils';\nimport useTimer from './timer';\n\nconst timer = reactive(useTimer());\n\ndefineProps({\n /**\n * Fade transition when the content display is toggled.\n * @type boolean\n * @values true, false\n */\n transition: {\n type: Boolean,\n default: false,\n },\n\n /**\n * If the popover does not fit in the direction described by \"placement\",\n * it will attempt to change its direction to the \"fallbackPlacements\".\n * @see https://popper.js.org/docs/v2/modifiers/flip/#fallbackplacements\"\n */\n fallbackPlacements: {\n type: Array,\n default: () => {\n return ['auto'];\n },\n },\n\n /**\n * The direction the popover displays relative to the anchor.\n * @see https://atomiks.github.io/tippyjs/v6/all-props/#placement\"\n * @values top, top-start, top-end,\n * right, right-start, right-end,\n * left, left-start, left-end,\n * bottom, bottom-start, bottom-end,\n * auto, auto-start, auto-end\n */\n placement: {\n type: String,\n default: 'top-start',\n validator (placement) {\n return TOOLTIP_DIRECTIONS.includes(placement);\n },\n },\n\n /**\n * Padding size class for the popover content.\n * @values none, small, medium, large\n */\n padding: {\n type: String,\n default: 'large',\n validator: (padding) => {\n return Object.keys(POPOVER_PADDING_CLASSES).some((item) => item === padding);\n },\n },\n\n /**\n * Displaces the content box from its anchor element\n * by the specified number of pixels.\n * @see https://atomiks.github.io/tippyjs/v6/all-props/#offset\"\n */\n offset: {\n type: Array,\n default: () => [0, 16],\n },\n\n /**\n * The id of the tooltip\n */\n id: {\n type: String,\n default () { return getUniqueString(); },\n },\n\n /**\n * Additional class name for the header content wrapper element.\n */\n headerClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Additional class name for the footer content wrapper element.\n */\n footerClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Additional class name for the dialog element.\n */\n dialogClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Additional class name for the content wrapper element.\n */\n contentClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Sets the element to which the popover is going to append to.\n * 'body' will append to the nearest body (supports shadow DOM).\n * @values 'body', 'parent', HTMLElement,\n */\n appendTo: {\n type: [HTMLElement, String],\n default: 'body',\n validator: appendTo => {\n return POPOVER_APPEND_TO_VALUES.includes(appendTo) ||\n (appendTo instanceof HTMLElement);\n },\n },\n});\n\ndefineEmits(['opened']);\n</script>\n"],"names":["useTimer","current","ref","timerLeave","timerEnter","start","prevCard","enter","id","time","TOOLTIP_DELAY_MS","leave","instance","timer","reactive"],"mappings":"
|
|
1
|
+
{"version":3,"file":"hovercard.js","sources":["../../components/hovercard/timer.js","../../components/hovercard/hovercard.vue"],"sourcesContent":["import { ref } from 'vue';\nimport { TOOLTIP_DELAY_MS } from '@/components/tooltip/index.js';\n\nexport default (function () {\n const current = ref(null);\n let timerLeave, timerEnter;\n let start = null;\n let prevCard = null;\n\n // Handles the timer for when the event that opens the hovercard\n // is triggered.\n // If no hovercard is active, it sets a delay of TOOLTIP_DELAY_MS.\n // If there was an active hovercard, the delay depends on the time it takes\n // to move from one anchor to the other.\n function enter (id) {\n if (prevCard) {\n const time = Date.now() - start + 100;\n if (timerLeave) clearTimeout(timerLeave);\n if (prevCard !== id) {\n timerLeave = setTimeout(\n () => {\n if (current.value !== null) {\n start = Date.now();\n }\n current.value = null;\n },\n time,\n );\n if (timerEnter) clearTimeout(timerEnter);\n timerEnter = setTimeout(\n () => {\n current.value = id;\n prevCard = id;\n },\n time,\n );\n }\n } else {\n timerEnter = setTimeout(() => {\n current.value = id;\n prevCard = id;\n }, TOOLTIP_DELAY_MS);\n }\n }\n\n // Handles the timer for when the event that closes the hovercard\n // is triggered.\n function leave () {\n if (timerEnter) {\n clearTimeout(timerEnter);\n timerEnter = null;\n }\n start = Date.now();\n timerLeave = setTimeout(() => {\n current.value = null;\n prevCard = null;\n }, TOOLTIP_DELAY_MS);\n }\n\n let instance = null;\n\n return () => {\n if (instance === null) {\n instance = { current, enter, leave };\n }\n return instance;\n };\n})();\n","<!-- eslint-disable vue/multi-word-component-names -->\n<template>\n <dt-popover\n :id=\"id\"\n :placement=\"placement\"\n :content-class=\"contentClass\"\n :fallback-placements=\"fallbackPlacements\"\n :padding=\"padding\"\n :transition=\"transition ? 'fade' : null\"\n :offset=\"offset\"\n :modal=\"false\"\n initial-focus-element=\"none\"\n :header-class=\"headerClass\"\n :footer-class=\"footerClass\"\n :append-to=\"appendTo\"\n :hovercard=\"true\"\n :timer=\"timer\"\n data-qa=\"dt-hovercard\"\n @opened=\"(e) => ($emit('opened', e))\"\n >\n <template #anchor=\"{ attrs }\">\n <slot\n name=\"anchor\"\n v-bind=\"attrs\"\n />\n </template>\n <template #content>\n <slot name=\"content\" />\n </template>\n <template #headerContent>\n <slot name=\"headerContent\" />\n </template>\n\n <template #footerContent>\n <slot name=\"footerContent\" />\n </template>\n </dt-popover>\n</template>\n\n<script setup>\nimport { reactive } from 'vue';\nimport { POPOVER_APPEND_TO_VALUES, POPOVER_PADDING_CLASSES, DtPopover } from '@/components/popover/index.js';\nimport { TOOLTIP_DIRECTIONS } from '@/components/tooltip/index.js';\nimport { getUniqueString } from '@/common/utils';\nimport useTimer from './timer';\n\nconst timer = reactive(useTimer());\n\ndefineProps({\n /**\n * Fade transition when the content display is toggled.\n * @type boolean\n * @values true, false\n */\n transition: {\n type: Boolean,\n default: false,\n },\n\n /**\n * If the popover does not fit in the direction described by \"placement\",\n * it will attempt to change its direction to the \"fallbackPlacements\".\n * @see https://popper.js.org/docs/v2/modifiers/flip/#fallbackplacements\"\n */\n fallbackPlacements: {\n type: Array,\n default: () => {\n return ['auto'];\n },\n },\n\n /**\n * The direction the popover displays relative to the anchor.\n * @see https://atomiks.github.io/tippyjs/v6/all-props/#placement\"\n * @values top, top-start, top-end,\n * right, right-start, right-end,\n * left, left-start, left-end,\n * bottom, bottom-start, bottom-end,\n * auto, auto-start, auto-end\n */\n placement: {\n type: String,\n default: 'top-start',\n validator (placement) {\n return TOOLTIP_DIRECTIONS.includes(placement);\n },\n },\n\n /**\n * Padding size class for the popover content.\n * @values none, small, medium, large\n */\n padding: {\n type: String,\n default: 'large',\n validator: (padding) => {\n return Object.keys(POPOVER_PADDING_CLASSES).some((item) => item === padding);\n },\n },\n\n /**\n * Displaces the content box from its anchor element\n * by the specified number of pixels.\n * @see https://atomiks.github.io/tippyjs/v6/all-props/#offset\"\n */\n offset: {\n type: Array,\n default: () => [0, 16],\n },\n\n /**\n * The id of the tooltip\n */\n id: {\n type: String,\n default () { return getUniqueString(); },\n },\n\n /**\n * Additional class name for the header content wrapper element.\n */\n headerClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Additional class name for the footer content wrapper element.\n */\n footerClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Additional class name for the dialog element.\n */\n dialogClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Additional class name for the content wrapper element.\n */\n contentClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Sets the element to which the popover is going to append to.\n * 'body' will append to the nearest body (supports shadow DOM).\n * @values 'body', 'parent', HTMLElement,\n */\n appendTo: {\n type: [HTMLElement, String],\n default: 'body',\n validator: appendTo => {\n return POPOVER_APPEND_TO_VALUES.includes(appendTo) ||\n (appendTo instanceof HTMLElement);\n },\n },\n});\n\ndefineEmits(['opened']);\n</script>\n"],"names":["useTimer","current","ref","timerLeave","timerEnter","start","prevCard","enter","id","time","TOOLTIP_DELAY_MS","leave","instance","timer","reactive"],"mappings":";;;;;;;;;;;;;;;;AAGA,MAAAA,IAAgB,WAAY;AAC1B,QAAMC,IAAUC,EAAI,IAAI;AACxB,MAAIC,GAAYC,GACZC,IAAQ,MACRC,IAAW;AAOf,WAASC,EAAOC,GAAI;AAClB,QAAIF,GAAU;AACZ,YAAMG,IAAO,KAAK,IAAG,IAAKJ,IAAQ;AAClC,MAAIF,KAAY,aAAaA,CAAU,GACnCG,MAAaE,MACfL,IAAa;AAAA,QACX,MAAM;AACJ,UAAIF,EAAQ,UAAU,SACpBI,IAAQ,KAAK,QAEfJ,EAAQ,QAAQ;AAAA,QACjB;AAAA,QACDQ;AAAA,MACV,GACYL,KAAY,aAAaA,CAAU,GACvCA,IAAa;AAAA,QACX,MAAM;AACJ,UAAAH,EAAQ,QAAQO,GAChBF,IAAWE;AAAA,QACZ;AAAA,QACDC;AAAA,MACV;AAAA,IAEA;AACM,MAAAL,IAAa,WAAW,MAAM;AAC5B,QAAAH,EAAQ,QAAQO,GAChBF,IAAWE;AAAA,MACZ,GAAEE,CAAgB;AAAA,EAEtB;AAID,WAASC,IAAS;AAChB,IAAIP,MACF,aAAaA,CAAU,GACvBA,IAAa,OAEfC,IAAQ,KAAK,OACbF,IAAa,WAAW,MAAM;AAC5B,MAAAF,EAAQ,QAAQ,MAChBK,IAAW;AAAA,IACZ,GAAEI,CAAgB;AAAA,EACpB;AAED,MAAIE,IAAW;AAEf,SAAO,OACDA,MAAa,SACfA,IAAW,EAAE,SAAAX,GAAS,OAAAM,GAAO,OAAAI,EAAK,IAE7BC;AAEX,EAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACrBJ,UAAMC,IAAQC,EAASd,EAAQ,CAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("@dialpad/dialtone-icons/vue3"),a=require("../chunks/icon_constants-2S_OSQ1t.js"),t=require("vue"),c=require("../chunks/_plugin-vue_export-helper-6_y-gaV6.js");require("@dialpad/dialtone-icons/icons.json");const o={name:"DtIcon",props:{size:{type:String,default:"500",validator:e=>Object.keys(a.I).includes(e)},name:{type:String,required:!0,validator:e=>a.a.includes(e)},ariaLabel:{type:String,default:void 0}},data(){return{iconLoaded:!1}},computed:{icon(){return i.icons[`./src/icons/${this.name}.vue`]}}};function u(e,d,n,l,_,r){return r.icon?(t.openBlock(),t.createBlock(t.resolveDynamicComponent(r.icon),{key:0,size:n.size,"aria-label":n.ariaLabel,"data-qa":e.$attrs["data-qa"]??"dt-icon"},null,8,["size","aria-label","data-qa"])):t.createCommentVNode("",!0)}const s=c._(o,[["render",u]]);exports.ICON_NAMES=a.a;exports.ICON_SIZE_MODIFIERS=a.I;exports.DtIcon=s;
|
|
2
|
+
//# sourceMappingURL=icon.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icon.cjs","sources":["../../components/icon/icon.vue"],"sourcesContent":["<template>\n <component\n :is=\"icon\"\n v-if=\"icon\"\n :size=\"size\"\n :aria-label=\"ariaLabel\"\n :data-qa=\"$attrs['data-qa'] ?? 'dt-icon'\"\n />\n</template>\n\n<script>\nimport { icons } from '@dialpad/dialtone-icons/vue3';\nimport { ICON_SIZE_MODIFIERS, ICON_NAMES } from './icon_constants';\n\n/**\n * The Icon component provides a set of glyphs and sizes to provide context your application.\n * @see https://dialtone.dialpad.com/components/icon.html\n */\nexport default {\n name: 'DtIcon',\n\n props: {\n /**\n * The size of the icon.\n * @values 100, 200, 300, 400, 500, 600, 700, 800\n */\n size: {\n type: String,\n default: '500',\n validator: (s) => Object.keys(ICON_SIZE_MODIFIERS).includes(s),\n },\n\n /**\n * The icon name in kebab-case\n */\n name: {\n type: String,\n required: true,\n validator: (name) => ICON_NAMES.includes(name),\n },\n\n /**\n * The label of the icon as read out by a screenreader. Leave this unset if your icon is purely presentational\n */\n ariaLabel: {\n type: String,\n default: undefined,\n },\n },\n\n data () {\n return {\n iconLoaded: false,\n };\n },\n\n computed: {\n icon () {\n return icons[`./src/icons/${this.name}.vue`];\n },\n },\n};\n</script>\n"],"names":["_sfc_main","s","ICON_SIZE_MODIFIERS","name","ICON_NAMES","icons","$options","_openBlock","_createBlock","_resolveDynamicComponent","$props","_ctx"],"mappings":"8SAkBA,MAAKA,EAAU,CACb,KAAM,SAEN,MAAO,CAKL,KAAM,CACJ,KAAM,OACN,QAAS,MACT,UAAYC,GAAM,OAAO,KAAKC,GAAmB,EAAE,SAASD,CAAC,CAC9D,EAKD,KAAM,CACJ,KAAM,OACN,SAAU,GACV,UAAYE,GAASC,IAAW,SAASD,CAAI,CAC9C,EAKD,UAAW,CACT,KAAM,OACN,QAAS,MACV,CACF,EAED,MAAQ,CACN,MAAO,CACL,WAAY,GAEf,EAED,SAAU,CACR,MAAQ,CACN,OAAOE,EAAAA,MAAM,eAAe,KAAK,IAAI,MAAM,CAC5C,CACF,CACH,iCA1DUC,EAAI,MAFZC,EAAAA,UAAA,EAAAC,EAAA,YAMEC,0BALKH,EAAI,IAAA,EAAA,OAER,KAAMI,EAAI,KACV,aAAYA,EAAS,UACrB,UAASC,EAAM,OAAA,SAAA,GAAA"}
|
package/dist/lib/icon.js
CHANGED
|
@@ -1,16 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { I as
|
|
3
|
-
import {
|
|
4
|
-
import { _ as
|
|
5
|
-
import { DtSkeleton as y } from "./skeleton.js";
|
|
1
|
+
import { icons as r } from "@dialpad/dialtone-icons/vue3";
|
|
2
|
+
import { I as n, a as o } from "../chunks/icon_constants-OpYAAKwF.js";
|
|
3
|
+
import { openBlock as i, createBlock as c, resolveDynamicComponent as s, createCommentVNode as d } from "vue";
|
|
4
|
+
import { _ as l } from "../chunks/_plugin-vue_export-helper-hUChTQA_.js";
|
|
6
5
|
import "@dialpad/dialtone-icons/icons.json";
|
|
7
|
-
const
|
|
6
|
+
const m = {
|
|
8
7
|
name: "DtIcon",
|
|
9
|
-
components: {
|
|
10
|
-
DtSkeleton: y,
|
|
11
|
-
...Object.keys(r).reduce((e, t) => (e[t] = p(r[t]), e), {})
|
|
12
|
-
},
|
|
13
|
-
inheritAttrs: !1,
|
|
14
8
|
props: {
|
|
15
9
|
/**
|
|
16
10
|
* The size of the icon.
|
|
@@ -19,7 +13,7 @@ const I = {
|
|
|
19
13
|
size: {
|
|
20
14
|
type: String,
|
|
21
15
|
default: "500",
|
|
22
|
-
validator: (e) => Object.keys(
|
|
16
|
+
validator: (e) => Object.keys(n).includes(e)
|
|
23
17
|
},
|
|
24
18
|
/**
|
|
25
19
|
* The icon name in kebab-case
|
|
@@ -27,7 +21,7 @@ const I = {
|
|
|
27
21
|
name: {
|
|
28
22
|
type: String,
|
|
29
23
|
required: !0,
|
|
30
|
-
validator: (e) =>
|
|
24
|
+
validator: (e) => o.includes(e)
|
|
31
25
|
},
|
|
32
26
|
/**
|
|
33
27
|
* The label of the icon as read out by a screenreader. Leave this unset if your icon is purely presentational
|
|
@@ -35,14 +29,6 @@ const I = {
|
|
|
35
29
|
ariaLabel: {
|
|
36
30
|
type: String,
|
|
37
31
|
default: void 0
|
|
38
|
-
},
|
|
39
|
-
/**
|
|
40
|
-
* Shows a skeleton loader while the emoji asset is loading.
|
|
41
|
-
* @values true, false
|
|
42
|
-
*/
|
|
43
|
-
showSkeleton: {
|
|
44
|
-
type: Boolean,
|
|
45
|
-
default: !0
|
|
46
32
|
}
|
|
47
33
|
},
|
|
48
34
|
data() {
|
|
@@ -51,40 +37,23 @@ const I = {
|
|
|
51
37
|
};
|
|
52
38
|
},
|
|
53
39
|
computed: {
|
|
54
|
-
iconSize() {
|
|
55
|
-
return i[this.size];
|
|
56
|
-
},
|
|
57
40
|
icon() {
|
|
58
|
-
return
|
|
41
|
+
return r[`./src/icons/${this.name}.vue`];
|
|
59
42
|
}
|
|
60
43
|
}
|
|
61
|
-
}
|
|
62
|
-
function
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
class: S(["d-icon", a.iconSize])
|
|
70
|
-
}, null, 8, ["aria-label", "class"]), [
|
|
71
|
-
[c, !n.iconLoaded && o.showSkeleton]
|
|
72
|
-
]),
|
|
73
|
-
l((s(), k(b(a.icon), h({
|
|
74
|
-
size: o.size,
|
|
75
|
-
"aria-label": o.ariaLabel,
|
|
76
|
-
"data-qa": e.$attrs["data-qa"] ?? "dt-icon"
|
|
77
|
-
}, e.$attrs, {
|
|
78
|
-
onLoaded: t[0] || (t[0] = (D) => n.iconLoaded = !0)
|
|
79
|
-
}), null, 16, ["size", "aria-label", "data-qa"])), [
|
|
80
|
-
[c, n.iconLoaded]
|
|
81
|
-
])
|
|
82
|
-
]);
|
|
44
|
+
};
|
|
45
|
+
function u(e, p, a, f, _, t) {
|
|
46
|
+
return t.icon ? (i(), c(s(t.icon), {
|
|
47
|
+
key: 0,
|
|
48
|
+
size: a.size,
|
|
49
|
+
"aria-label": a.ariaLabel,
|
|
50
|
+
"data-qa": e.$attrs["data-qa"] ?? "dt-icon"
|
|
51
|
+
}, null, 8, ["size", "aria-label", "data-qa"])) : d("", !0);
|
|
83
52
|
}
|
|
84
|
-
const
|
|
53
|
+
const q = /* @__PURE__ */ l(m, [["render", u]]);
|
|
85
54
|
export {
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
55
|
+
q as DtIcon,
|
|
56
|
+
o as ICON_NAMES,
|
|
57
|
+
n as ICON_SIZE_MODIFIERS
|
|
89
58
|
};
|
|
90
59
|
//# sourceMappingURL=icon.js.map
|
package/dist/lib/icon.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icon.js","sources":["../../components/icon/icon.vue"],"sourcesContent":["<template>\n <
|
|
1
|
+
{"version":3,"file":"icon.js","sources":["../../components/icon/icon.vue"],"sourcesContent":["<template>\n <component\n :is=\"icon\"\n v-if=\"icon\"\n :size=\"size\"\n :aria-label=\"ariaLabel\"\n :data-qa=\"$attrs['data-qa'] ?? 'dt-icon'\"\n />\n</template>\n\n<script>\nimport { icons } from '@dialpad/dialtone-icons/vue3';\nimport { ICON_SIZE_MODIFIERS, ICON_NAMES } from './icon_constants';\n\n/**\n * The Icon component provides a set of glyphs and sizes to provide context your application.\n * @see https://dialtone.dialpad.com/components/icon.html\n */\nexport default {\n name: 'DtIcon',\n\n props: {\n /**\n * The size of the icon.\n * @values 100, 200, 300, 400, 500, 600, 700, 800\n */\n size: {\n type: String,\n default: '500',\n validator: (s) => Object.keys(ICON_SIZE_MODIFIERS).includes(s),\n },\n\n /**\n * The icon name in kebab-case\n */\n name: {\n type: String,\n required: true,\n validator: (name) => ICON_NAMES.includes(name),\n },\n\n /**\n * The label of the icon as read out by a screenreader. Leave this unset if your icon is purely presentational\n */\n ariaLabel: {\n type: String,\n default: undefined,\n },\n },\n\n data () {\n return {\n iconLoaded: false,\n };\n },\n\n computed: {\n icon () {\n return icons[`./src/icons/${this.name}.vue`];\n },\n },\n};\n</script>\n"],"names":["_sfc_main","s","ICON_SIZE_MODIFIERS","name","ICON_NAMES","icons","$options","_openBlock","_createBlock","_resolveDynamicComponent","$props","_ctx"],"mappings":";;;;;AAkBA,MAAKA,IAAU;AAAA,EACb,MAAM;AAAA,EAEN,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA,IAKL,MAAM;AAAA,MACJ,MAAM;AAAA,MACN,SAAS;AAAA,MACT,WAAW,CAACC,MAAM,OAAO,KAAKC,CAAmB,EAAE,SAASD,CAAC;AAAA,IAC9D;AAAA;AAAA;AAAA;AAAA,IAKD,MAAM;AAAA,MACJ,MAAM;AAAA,MACN,UAAU;AAAA,MACV,WAAW,CAACE,MAASC,EAAW,SAASD,CAAI;AAAA,IAC9C;AAAA;AAAA;AAAA;AAAA,IAKD,WAAW;AAAA,MACT,MAAM;AAAA,MACN,SAAS;AAAA,IACV;AAAA,EACF;AAAA,EAED,OAAQ;AACN,WAAO;AAAA,MACL,YAAY;AAAA;EAEf;AAAA,EAED,UAAU;AAAA,IACR,OAAQ;AACN,aAAOE,EAAM,eAAe,KAAK,IAAI,MAAM;AAAA,IAC5C;AAAA,EACF;AACH;;SA1DUC,EAAI,QAFZC,EAAA,GAAAC,EAMEC,EALKH,EAAI,IAAA,GAAA;AAAA;IAER,MAAMI,EAAI;AAAA,IACV,cAAYA,EAAS;AAAA,IACrB,WAASC,EAAM,OAAA,SAAA,KAAA;AAAA;;;"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("../chunks/modal-qEzlo0Sj.js"),l=require("./constants.cjs"),e=require("vue"),d=require("../chunks/_plugin-vue_export-helper-6_y-gaV6.js"),m=require("./button.cjs"),p=require("./icon.cjs");require("./utils.cjs");require("../chunks/link_constants-Kn6kP4i1.js");require("@dialpad/dialtone-icons/vue3");require("../chunks/icon_constants-2S_OSQ1t.js");require("@dialpad/dialtone-icons/icons.json");const g={name:"DtImageViewer",components:{DtButton:m.DtButton,DtIcon:p.DtIcon},mixins:[c.M],props:{open:{type:Boolean,default:null},imageSrc:{type:String,required:!0},imageAlt:{type:String,required:!0},imageButtonClass:{type:String,required:!1,default:""},ariaLabel:{type:String,required:!0},closeAriaLabel:{type:String,required:!0}},emits:["opened","update:open"],data(){return{showCloseButton:!0,isOpen:!1}},computed:{modalListeners(){return{click:t=>{t.target===t.currentTarget&&this.close()},keydown:t=>{switch(t.code){case l.EVENT_KEYNAMES.esc:case l.EVENT_KEYNAMES.escape:this.close();break;case l.EVENT_KEYNAMES.tab:this.trapFocus(t);break}}}}},watch:{isOpen:{immediate:!0,handler(t){var o;t?this.previousActiveElement=document.activeElement:((o=this.previousActiveElement)==null||o.focus(),this.previousActiveElement=null)}},open:{handler:function(t){t!==null&&(this.isOpen=t)},immediate:!0}},methods:{openModal(){this.open===null&&(this.isOpen=!0,this.showCloseButton=!0,this.$emit("opened",!0),setTimeout(()=>{this.focusAfterOpen()}))},close(){this.isOpen=!1,this.$emit("opened",!1),this.open!==null&&this.$emit("update:open",!1)},focusAfterOpen(){var t;(t=this.$refs.closeImage)==null||t.$el.focus()},trapFocus(t){this.isOpen&&this.focusTrappedTabPress(t)}}},_=["src","alt"],f=["aria-hidden"],h={"data-qa":"dt-image-viewer-full",class:"d-image-viewer__full",role:"dialog","aria-modal":"true"},v=["src","alt"];function w(t,o,i,C,r,s){const a=e.resolveComponent("dt-button"),u=e.resolveComponent("dt-icon");return e.openBlock(),e.createElementBlock("div",null,[e.createVNode(a,{"data-qa":"dt-image-viewer-preview",class:"d-image-viewer__preview-button","aria-label":i.ariaLabel,importance:"clear",onClick:s.openModal},{default:e.withCtx(()=>[e.createElementVNode("img",{class:e.normalizeClass(i.imageButtonClass),src:i.imageSrc,alt:i.imageAlt},null,10,_)]),_:1},8,["aria-label","onClick"]),r.isOpen?(e.openBlock(),e.createBlock(e.Teleport,{key:0,to:"body"},[e.createElementVNode("div",e.mergeProps({"aria-hidden":r.isOpen?"false":"true",class:"d-modal","data-qa":"dt-modal"},e.toHandlers(s.modalListeners,!0),{onMouseover:o[0]||(o[0]=n=>r.showCloseButton=!0),onMouseleave:o[1]||(o[1]=n=>r.showCloseButton=!1),onFocusin:o[2]||(o[2]=n=>r.showCloseButton=!0),onFocusout:o[3]||(o[3]=n=>r.showCloseButton=!1)}),[e.createElementVNode("div",h,[e.createElementVNode("img",{class:"d-image-viewer__full__image",src:i.imageSrc,alt:i.imageAlt},null,8,v)]),e.createVNode(e.Transition,{name:"fade"},{default:e.withCtx(()=>[r.showCloseButton?(e.openBlock(),e.createBlock(a,{key:0,ref:"closeImage","data-qa":"dt-image-viewer-close-btn",class:"d-modal__close",circle:"",size:"lg",importance:"clear",kind:"inverted","aria-label":i.closeAriaLabel,onClick:s.close},{icon:e.withCtx(()=>[e.createVNode(u,{class:"d-image-viewer__close-button",name:"close",size:"400"})]),_:1},8,["aria-label","onClick"])):e.createCommentVNode("",!0)]),_:1})],16,f)])):e.createCommentVNode("",!0)])}const b=d._(g,[["render",w]]);exports.DtImageViewer=b;
|
|
2
|
+
//# sourceMappingURL=image-viewer.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"image-viewer.cjs","sources":["../../components/image_viewer/image_viewer.vue"],"sourcesContent":["<template>\n <div>\n <dt-button\n data-qa=\"dt-image-viewer-preview\"\n class=\"d-image-viewer__preview-button\"\n :aria-label=\"ariaLabel\"\n importance=\"clear\"\n @click=\"openModal\"\n >\n <img\n :class=\"imageButtonClass\"\n :src=\"imageSrc\"\n :alt=\"imageAlt\"\n >\n </dt-button>\n <Teleport\n v-if=\"isOpen\"\n to=\"body\"\n >\n <div\n :aria-hidden=\"!isOpen ? 'true' : 'false'\"\n class=\"d-modal\"\n data-qa=\"dt-modal\"\n v-on=\"modalListeners\"\n @mouseover=\"showCloseButton = true\"\n @mouseleave=\"showCloseButton = false\"\n @focusin=\" showCloseButton = true\"\n @focusout=\" showCloseButton = false\"\n >\n <div\n data-qa=\"dt-image-viewer-full\"\n class=\"d-image-viewer__full\"\n role=\"dialog\"\n aria-modal=\"true\"\n >\n <img\n class=\"d-image-viewer__full__image\"\n :src=\"imageSrc\"\n :alt=\"imageAlt\"\n >\n </div>\n <transition name=\"fade\">\n <dt-button\n v-if=\"showCloseButton\"\n ref=\"closeImage\"\n data-qa=\"dt-image-viewer-close-btn\"\n class=\"d-modal__close\"\n circle\n size=\"lg\"\n importance=\"clear\"\n kind=\"inverted\"\n :aria-label=\"closeAriaLabel\"\n @click=\"close\"\n >\n <template #icon>\n <dt-icon\n class=\"d-image-viewer__close-button\"\n name=\"close\"\n size=\"400\"\n />\n </template>\n </dt-button>\n </transition>\n </div>\n </Teleport>\n </div>\n</template>\n\n<script>\nimport Modal from '@/common/mixins/modal';\nimport { EVENT_KEYNAMES } from '@/common/constants';\nimport { DtIcon } from '@/components/icon';\nimport { DtButton } from '@/components/button';\n\nexport default {\n name: 'DtImageViewer',\n\n components: {\n DtButton,\n DtIcon,\n },\n\n mixins: [Modal],\n\n props: {\n /**\n * Controls whether the image modal is shown. Leaving this null will have the image modal\n * trigger on click by default.\n * If you set this value, the default trigger behavior will be disabled and you can control it as you need.\n * Supports .sync modifier\n * @values null, true, false\n */\n open: {\n type: Boolean,\n default: null,\n },\n\n /**\n * URL of the image to be shown\n */\n imageSrc: {\n type: String,\n required: true,\n },\n\n /**\n * Alt text of image\n */\n imageAlt: {\n type: String,\n required: true,\n },\n\n /**\n * Image Class\n */\n imageButtonClass: {\n type: String,\n required: false,\n default: '',\n },\n\n /**\n * Aria label\n */\n ariaLabel: {\n type: String,\n required: true,\n },\n\n /**\n * Aria label for close button\n */\n closeAriaLabel: {\n type: String,\n required: true,\n },\n },\n\n emits: [\n /**\n * Emitted when popover is shown or hidden\n *\n * @event opened\n * @type {Boolean}\n */\n 'opened',\n\n /**\n * Event fired to sync the open prop with the parent component\n * @event update:open\n */\n 'update:open',\n ],\n\n data () {\n return {\n showCloseButton: true,\n isOpen: false,\n };\n },\n\n computed: {\n modalListeners () {\n return {\n click: event => {\n (event.target === event.currentTarget) && this.close();\n },\n\n keydown: event => {\n switch (event.code) {\n case EVENT_KEYNAMES.esc:\n case EVENT_KEYNAMES.escape:\n this.close();\n break;\n case EVENT_KEYNAMES.tab:\n this.trapFocus(event);\n break;\n }\n },\n };\n },\n },\n\n watch: {\n isOpen: {\n immediate: true,\n handler (isShowing) {\n if (isShowing) {\n // Set a reference to the previously-active element, to which we'll return focus on modal close.\n this.previousActiveElement = document.activeElement;\n } else {\n // Modal is being hidden, so return focus to the previously active element before clearing the reference.\n this.previousActiveElement?.focus();\n this.previousActiveElement = null;\n }\n },\n },\n\n open: {\n handler: function (open) {\n if (open !== null) {\n this.isOpen = open;\n }\n },\n\n immediate: true,\n },\n },\n\n methods: {\n openModal () {\n // Has custom control passed in\n if (this.open !== null) {\n return;\n }\n this.isOpen = true;\n this.showCloseButton = true;\n this.$emit('opened', true);\n\n setTimeout(() => {\n this.focusAfterOpen();\n });\n },\n\n close () {\n this.isOpen = false;\n this.$emit('opened', false);\n\n if (this.open !== null) {\n this.$emit('update:open', false);\n }\n },\n\n focusAfterOpen () {\n this.$refs.closeImage?.$el.focus();\n },\n\n trapFocus (e) {\n if (this.isOpen) {\n this.focusTrappedTabPress(e);\n }\n },\n },\n};\n</script>\n"],"names":["_sfc_main","DtButton","DtIcon","Modal","event","EVENT_KEYNAMES","isShowing","_a","open","e","_createElementBlock","_createVNode","_component_dt_button","$props","$options","_createElementVNode","$data","_createBlock","_Teleport","_mergeProps","_toHandlers","_hoisted_3","_Transition","_component_dt_icon"],"mappings":"yeA0EA,MAAKA,EAAU,CACb,KAAM,gBAEN,WAAY,CACV,SAAAC,EAAQ,SACR,OAAAC,EAAM,MACP,EAED,OAAQ,CAACC,EAAAA,CAAK,EAEd,MAAO,CAQL,KAAM,CACJ,KAAM,QACN,QAAS,IACV,EAKD,SAAU,CACR,KAAM,OACN,SAAU,EACX,EAKD,SAAU,CACR,KAAM,OACN,SAAU,EACX,EAKD,iBAAkB,CAChB,KAAM,OACN,SAAU,GACV,QAAS,EACV,EAKD,UAAW,CACT,KAAM,OACN,SAAU,EACX,EAKD,eAAgB,CACd,KAAM,OACN,SAAU,EACX,CACF,EAED,MAAO,CAOL,SAMA,aACD,EAED,MAAQ,CACN,MAAO,CACL,gBAAiB,GACjB,OAAQ,GAEX,EAED,SAAU,CACR,gBAAkB,CAChB,MAAO,CACL,MAAOC,GAAS,CACbA,EAAM,SAAWA,EAAM,eAAkB,KAAK,OA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AA,mBA4CM,MA5CNI,aA4CM,CA3CH,cAAcH,EAAM,OAAA,QAAA,OACrB,MAAM,UACN,UAAQ,UACR,EAAAI,aAAMN,EAAc,eAAA,EAAA,EAAA,CACnB,2BAAWE,EAAe,gBAAA,IAC1B,4BAAYA,EAAe,gBAAA,IAC3B,yBAAUA,EAAe,gBAAA,IACzB,0BAAWA,EAAe,gBAAA,OAE3BD,EAAA,mBAWM,MAXNM,EAWM,CALJN,EAAAA,mBAIC,MAAA,CAHC,MAAM,8BACL,IAAKF,EAAQ,SACb,IAAKA,EAAQ,sBAGlBF,EAAAA,YAqBaW,EAAA,WAAA,CArBD,KAAK,MAAM,EAAA,mBACrB,IAmBY,CAlBJN,EAAe,+BADvBC,EAmBY,YAAAL,EAAA,OAjBV,IAAI,aACJ,UAAQ,4BACR,MAAM,iBACN,OAAA,GACA,KAAK,KACL,WAAW,QACX,KAAK,WACJ,aAAYC,EAAc,eAC1B,QAAOC,EAAK,QAEF,eACT,IAIE,CAJFH,EAAAA,YAIEY,EAAA,CAHA,MAAM,+BACN,KAAK,QACL,KAAK"}
|
package/dist/lib/image-viewer.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { M as h } from "../chunks/modal-VuMFkZFH.js";
|
|
2
2
|
import { EVENT_KEYNAMES as l } from "./constants.js";
|
|
3
|
-
import { resolveComponent as d, openBlock as n, createElementBlock as _, createVNode as
|
|
3
|
+
import { resolveComponent as d, openBlock as n, createElementBlock as _, createVNode as u, withCtx as m, createElementVNode as s, normalizeClass as v, createBlock as p, Teleport as w, mergeProps as b, toHandlers as C, Transition as k, createCommentVNode as f } from "vue";
|
|
4
4
|
import { _ as B } from "../chunks/_plugin-vue_export-helper-hUChTQA_.js";
|
|
5
5
|
import { DtButton as A } from "./button.js";
|
|
6
6
|
import { DtIcon as y } from "./icon.js";
|
|
@@ -9,7 +9,6 @@ import "../chunks/link_constants-vIUB92L4.js";
|
|
|
9
9
|
import "@dialpad/dialtone-icons/vue3";
|
|
10
10
|
import "../chunks/icon_constants-OpYAAKwF.js";
|
|
11
11
|
import "@dialpad/dialtone-icons/icons.json";
|
|
12
|
-
import "./skeleton.js";
|
|
13
12
|
const E = {
|
|
14
13
|
name: "DtImageViewer",
|
|
15
14
|
components: {
|
|
@@ -147,14 +146,14 @@ const E = {
|
|
|
147
146
|
function T(e, t, o, L, i, r) {
|
|
148
147
|
const c = d("dt-button"), g = d("dt-icon");
|
|
149
148
|
return n(), _("div", null, [
|
|
150
|
-
|
|
149
|
+
u(c, {
|
|
151
150
|
"data-qa": "dt-image-viewer-preview",
|
|
152
151
|
class: "d-image-viewer__preview-button",
|
|
153
152
|
"aria-label": o.ariaLabel,
|
|
154
153
|
importance: "clear",
|
|
155
154
|
onClick: r.openModal
|
|
156
155
|
}, {
|
|
157
|
-
default:
|
|
156
|
+
default: m(() => [
|
|
158
157
|
s("img", {
|
|
159
158
|
class: v(o.imageButtonClass),
|
|
160
159
|
src: o.imageSrc,
|
|
@@ -184,8 +183,8 @@ function T(e, t, o, L, i, r) {
|
|
|
184
183
|
alt: o.imageAlt
|
|
185
184
|
}, null, 8, M)
|
|
186
185
|
]),
|
|
187
|
-
|
|
188
|
-
default:
|
|
186
|
+
u(k, { name: "fade" }, {
|
|
187
|
+
default: m(() => [
|
|
189
188
|
i.showCloseButton ? (n(), p(c, {
|
|
190
189
|
key: 0,
|
|
191
190
|
ref: "closeImage",
|
|
@@ -198,8 +197,8 @@ function T(e, t, o, L, i, r) {
|
|
|
198
197
|
"aria-label": o.closeAriaLabel,
|
|
199
198
|
onClick: r.close
|
|
200
199
|
}, {
|
|
201
|
-
icon:
|
|
202
|
-
|
|
200
|
+
icon: m(() => [
|
|
201
|
+
u(g, {
|
|
203
202
|
class: "d-image-viewer__close-button",
|
|
204
203
|
name: "close",
|
|
205
204
|
size: "400"
|
|
@@ -214,8 +213,8 @@ function T(e, t, o, L, i, r) {
|
|
|
214
213
|
])) : f("", !0)
|
|
215
214
|
]);
|
|
216
215
|
}
|
|
217
|
-
const
|
|
216
|
+
const j = /* @__PURE__ */ B(E, [["render", T]]);
|
|
218
217
|
export {
|
|
219
|
-
|
|
218
|
+
j as DtImageViewer
|
|
220
219
|
};
|
|
221
220
|
//# sourceMappingURL=image-viewer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"image-viewer.js","sources":["../../components/image_viewer/image_viewer.vue"],"sourcesContent":["<template>\n <div>\n <dt-button\n data-qa=\"dt-image-viewer-preview\"\n class=\"d-image-viewer__preview-button\"\n :aria-label=\"ariaLabel\"\n importance=\"clear\"\n @click=\"openModal\"\n >\n <img\n :class=\"imageButtonClass\"\n :src=\"imageSrc\"\n :alt=\"imageAlt\"\n >\n </dt-button>\n <Teleport\n v-if=\"isOpen\"\n to=\"body\"\n >\n <div\n :aria-hidden=\"!isOpen ? 'true' : 'false'\"\n class=\"d-modal\"\n data-qa=\"dt-modal\"\n v-on=\"modalListeners\"\n @mouseover=\"showCloseButton = true\"\n @mouseleave=\"showCloseButton = false\"\n @focusin=\" showCloseButton = true\"\n @focusout=\" showCloseButton = false\"\n >\n <div\n data-qa=\"dt-image-viewer-full\"\n class=\"d-image-viewer__full\"\n role=\"dialog\"\n aria-modal=\"true\"\n >\n <img\n class=\"d-image-viewer__full__image\"\n :src=\"imageSrc\"\n :alt=\"imageAlt\"\n >\n </div>\n <transition name=\"fade\">\n <dt-button\n v-if=\"showCloseButton\"\n ref=\"closeImage\"\n data-qa=\"dt-image-viewer-close-btn\"\n class=\"d-modal__close\"\n circle\n size=\"lg\"\n importance=\"clear\"\n kind=\"inverted\"\n :aria-label=\"closeAriaLabel\"\n @click=\"close\"\n >\n <template #icon>\n <dt-icon\n class=\"d-image-viewer__close-button\"\n name=\"close\"\n size=\"400\"\n />\n </template>\n </dt-button>\n </transition>\n </div>\n </Teleport>\n </div>\n</template>\n\n<script>\nimport Modal from '@/common/mixins/modal';\nimport { EVENT_KEYNAMES } from '@/common/constants';\nimport { DtIcon } from '@/components/icon';\nimport { DtButton } from '@/components/button';\n\nexport default {\n name: 'DtImageViewer',\n\n components: {\n DtButton,\n DtIcon,\n },\n\n mixins: [Modal],\n\n props: {\n /**\n * Controls whether the image modal is shown. Leaving this null will have the image modal\n * trigger on click by default.\n * If you set this value, the default trigger behavior will be disabled and you can control it as you need.\n * Supports .sync modifier\n * @values null, true, false\n */\n open: {\n type: Boolean,\n default: null,\n },\n\n /**\n * URL of the image to be shown\n */\n imageSrc: {\n type: String,\n required: true,\n },\n\n /**\n * Alt text of image\n */\n imageAlt: {\n type: String,\n required: true,\n },\n\n /**\n * Image Class\n */\n imageButtonClass: {\n type: String,\n required: false,\n default: '',\n },\n\n /**\n * Aria label\n */\n ariaLabel: {\n type: String,\n required: true,\n },\n\n /**\n * Aria label for close button\n */\n closeAriaLabel: {\n type: String,\n required: true,\n },\n },\n\n emits: [\n /**\n * Emitted when popover is shown or hidden\n *\n * @event opened\n * @type {Boolean}\n */\n 'opened',\n\n /**\n * Event fired to sync the open prop with the parent component\n * @event update:open\n */\n 'update:open',\n ],\n\n data () {\n return {\n showCloseButton: true,\n isOpen: false,\n };\n },\n\n computed: {\n modalListeners () {\n return {\n click: event => {\n (event.target === event.currentTarget) && this.close();\n },\n\n keydown: event => {\n switch (event.code) {\n case EVENT_KEYNAMES.esc:\n case EVENT_KEYNAMES.escape:\n this.close();\n break;\n case EVENT_KEYNAMES.tab:\n this.trapFocus(event);\n break;\n }\n },\n };\n },\n },\n\n watch: {\n isOpen: {\n immediate: true,\n handler (isShowing) {\n if (isShowing) {\n // Set a reference to the previously-active element, to which we'll return focus on modal close.\n this.previousActiveElement = document.activeElement;\n } else {\n // Modal is being hidden, so return focus to the previously active element before clearing the reference.\n this.previousActiveElement?.focus();\n this.previousActiveElement = null;\n }\n },\n },\n\n open: {\n handler: function (open) {\n if (open !== null) {\n this.isOpen = open;\n }\n },\n\n immediate: true,\n },\n },\n\n methods: {\n openModal () {\n // Has custom control passed in\n if (this.open !== null) {\n return;\n }\n this.isOpen = true;\n this.showCloseButton = true;\n this.$emit('opened', true);\n\n setTimeout(() => {\n this.focusAfterOpen();\n });\n },\n\n close () {\n this.isOpen = false;\n this.$emit('opened', false);\n\n if (this.open !== null) {\n this.$emit('update:open', false);\n }\n },\n\n focusAfterOpen () {\n this.$refs.closeImage?.$el.focus();\n },\n\n trapFocus (e) {\n if (this.isOpen) {\n this.focusTrappedTabPress(e);\n }\n },\n },\n};\n</script>\n"],"names":["_sfc_main","DtButton","DtIcon","Modal","event","EVENT_KEYNAMES","isShowing","_a","open","_createElementBlock","_createVNode","_component_dt_button","$props","$options","_createElementVNode","$data","_createBlock","_Teleport","_mergeProps","_toHandlers","_hoisted_3","_Transition","_component_dt_icon"],"mappings":"
|
|
1
|
+
{"version":3,"file":"image-viewer.js","sources":["../../components/image_viewer/image_viewer.vue"],"sourcesContent":["<template>\n <div>\n <dt-button\n data-qa=\"dt-image-viewer-preview\"\n class=\"d-image-viewer__preview-button\"\n :aria-label=\"ariaLabel\"\n importance=\"clear\"\n @click=\"openModal\"\n >\n <img\n :class=\"imageButtonClass\"\n :src=\"imageSrc\"\n :alt=\"imageAlt\"\n >\n </dt-button>\n <Teleport\n v-if=\"isOpen\"\n to=\"body\"\n >\n <div\n :aria-hidden=\"!isOpen ? 'true' : 'false'\"\n class=\"d-modal\"\n data-qa=\"dt-modal\"\n v-on=\"modalListeners\"\n @mouseover=\"showCloseButton = true\"\n @mouseleave=\"showCloseButton = false\"\n @focusin=\" showCloseButton = true\"\n @focusout=\" showCloseButton = false\"\n >\n <div\n data-qa=\"dt-image-viewer-full\"\n class=\"d-image-viewer__full\"\n role=\"dialog\"\n aria-modal=\"true\"\n >\n <img\n class=\"d-image-viewer__full__image\"\n :src=\"imageSrc\"\n :alt=\"imageAlt\"\n >\n </div>\n <transition name=\"fade\">\n <dt-button\n v-if=\"showCloseButton\"\n ref=\"closeImage\"\n data-qa=\"dt-image-viewer-close-btn\"\n class=\"d-modal__close\"\n circle\n size=\"lg\"\n importance=\"clear\"\n kind=\"inverted\"\n :aria-label=\"closeAriaLabel\"\n @click=\"close\"\n >\n <template #icon>\n <dt-icon\n class=\"d-image-viewer__close-button\"\n name=\"close\"\n size=\"400\"\n />\n </template>\n </dt-button>\n </transition>\n </div>\n </Teleport>\n </div>\n</template>\n\n<script>\nimport Modal from '@/common/mixins/modal';\nimport { EVENT_KEYNAMES } from '@/common/constants';\nimport { DtIcon } from '@/components/icon';\nimport { DtButton } from '@/components/button';\n\nexport default {\n name: 'DtImageViewer',\n\n components: {\n DtButton,\n DtIcon,\n },\n\n mixins: [Modal],\n\n props: {\n /**\n * Controls whether the image modal is shown. Leaving this null will have the image modal\n * trigger on click by default.\n * If you set this value, the default trigger behavior will be disabled and you can control it as you need.\n * Supports .sync modifier\n * @values null, true, false\n */\n open: {\n type: Boolean,\n default: null,\n },\n\n /**\n * URL of the image to be shown\n */\n imageSrc: {\n type: String,\n required: true,\n },\n\n /**\n * Alt text of image\n */\n imageAlt: {\n type: String,\n required: true,\n },\n\n /**\n * Image Class\n */\n imageButtonClass: {\n type: String,\n required: false,\n default: '',\n },\n\n /**\n * Aria label\n */\n ariaLabel: {\n type: String,\n required: true,\n },\n\n /**\n * Aria label for close button\n */\n closeAriaLabel: {\n type: String,\n required: true,\n },\n },\n\n emits: [\n /**\n * Emitted when popover is shown or hidden\n *\n * @event opened\n * @type {Boolean}\n */\n 'opened',\n\n /**\n * Event fired to sync the open prop with the parent component\n * @event update:open\n */\n 'update:open',\n ],\n\n data () {\n return {\n showCloseButton: true,\n isOpen: false,\n };\n },\n\n computed: {\n modalListeners () {\n return {\n click: event => {\n (event.target === event.currentTarget) && this.close();\n },\n\n keydown: event => {\n switch (event.code) {\n case EVENT_KEYNAMES.esc:\n case EVENT_KEYNAMES.escape:\n this.close();\n break;\n case EVENT_KEYNAMES.tab:\n this.trapFocus(event);\n break;\n }\n },\n };\n },\n },\n\n watch: {\n isOpen: {\n immediate: true,\n handler (isShowing) {\n if (isShowing) {\n // Set a reference to the previously-active element, to which we'll return focus on modal close.\n this.previousActiveElement = document.activeElement;\n } else {\n // Modal is being hidden, so return focus to the previously active element before clearing the reference.\n this.previousActiveElement?.focus();\n this.previousActiveElement = null;\n }\n },\n },\n\n open: {\n handler: function (open) {\n if (open !== null) {\n this.isOpen = open;\n }\n },\n\n immediate: true,\n },\n },\n\n methods: {\n openModal () {\n // Has custom control passed in\n if (this.open !== null) {\n return;\n }\n this.isOpen = true;\n this.showCloseButton = true;\n this.$emit('opened', true);\n\n setTimeout(() => {\n this.focusAfterOpen();\n });\n },\n\n close () {\n this.isOpen = false;\n this.$emit('opened', false);\n\n if (this.open !== null) {\n this.$emit('update:open', false);\n }\n },\n\n focusAfterOpen () {\n this.$refs.closeImage?.$el.focus();\n },\n\n trapFocus (e) {\n if (this.isOpen) {\n this.focusTrappedTabPress(e);\n }\n },\n },\n};\n</script>\n"],"names":["_sfc_main","DtButton","DtIcon","Modal","event","EVENT_KEYNAMES","isShowing","_a","open","_createElementBlock","_createVNode","_component_dt_button","$props","$options","_createElementVNode","$data","_createBlock","_Teleport","_mergeProps","_toHandlers","_hoisted_3","_Transition","_component_dt_icon"],"mappings":";;;;;;;;;;;AA0EA,MAAKA,IAAU;AAAA,EACb,MAAM;AAAA,EAEN,YAAY;AAAA,IACV,UAAAC;AAAA,IACA,QAAAC;AAAA,EACD;AAAA,EAED,QAAQ,CAACC,CAAK;AAAA,EAEd,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAQL,MAAM;AAAA,MACJ,MAAM;AAAA,MACN,SAAS;AAAA,IACV;AAAA;AAAA;AAAA;AAAA,IAKD,UAAU;AAAA,MACR,MAAM;AAAA,MACN,UAAU;AAAA,IACX;AAAA;AAAA;AAAA;AAAA,IAKD,UAAU;AAAA,MACR,MAAM;AAAA,MACN,UAAU;AAAA,IACX;AAAA;AAAA;AAAA;AAAA,IAKD,kBAAkB;AAAA,MAChB,MAAM;AAAA,MACN,UAAU;AAAA,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GAAA,EArBD,MAAK,OAAM,GAAA;AAAA,qBACrB,MAmBY;AAAA,YAlBJN,EAAe,wBADvBC,EAmBYL,GAAA;AAAA;cAjBV,KAAI;AAAA,cACJ,WAAQ;AAAA,cACR,OAAM;AAAA,cACN,QAAA;AAAA,cACA,MAAK;AAAA,cACL,YAAW;AAAA,cACX,MAAK;AAAA,cACJ,cAAYC,EAAc;AAAA,cAC1B,SAAOC,EAAK;AAAA;cAEF,QACT,MAIE;AAAA,gBAJFH,EAIEY,GAAA;AAAA,kBAHA,OAAM;AAAA,kBACN,MAAK;AAAA,kBACL,MAAK;AAAA;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../chunks/input_group-AS760Cp7.js"),l=require("./utils.cjs"),s=require("vue"),i=require("../chunks/_plugin-vue_export-helper-6_y-gaV6.js"),d=require("./validation-messages.cjs");require("./validators.cjs");require("./constants.cjs");const u={name:"DtInputGroup",components:{DtValidationMessages:d.DtValidationMessages},mixins:[r.I],props:{dataQaGroup:{type:String,default:"input-group"},dataQaGroupLegend:{type:String,default:"input-group-legend"},dataQaGroupMessages:{type:String,default:"input-group-messages"}},data(){return{internalValue:this.value,hasSlotContent:l.hasSlotContent}},watch:{value(e){this.internalValue=e},internalValue:{immediate:!0,handler(e){this.provideObj.value=e}}},methods:{getMessageKey(e,t){return`input-group-message-${e}-${t}-${this.id}`}}},g=["data-qa"],p=["data-qa"];function m(e,t,a,h,n,q){const o=s.resolveComponent("dt-validation-messages");return s.openBlock(),s.createElementBlock("fieldset",{class:"d-input-group__fieldset","data-qa":a.dataQaGroup},[n.hasSlotContent(e.$slots.legend)||e.legend?(s.openBlock(),s.createElementBlock("legend",s.mergeProps({key:0,class:["d-label",e.legendClass]},e.legendChildProps,{"data-qa":a.dataQaGroupLegend}),[s.renderSlot(e.$slots,"legend",{},()=>[s.createTextVNode(s.toDisplayString(e.legend),1)])],16,p)):s.createCommentVNode("",!0),s.renderSlot(e.$slots,"default"),s.createVNode(o,s.mergeProps({"validation-messages":e.formattedMessages,"show-messages":e.showMessages,class:e.messagesClass,"data-qa":a.dataQaGroupMessages},e.messagesChildProps),null,16,["validation-messages","show-messages","class","data-qa"])],8,g)}const c=i._(u,[["render",m]]);exports.DtInputGroup=c;
|
|
2
|
+
//# sourceMappingURL=input-group.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"input-group.cjs","sources":["../../components/input_group/input_group.vue"],"sourcesContent":["<template>\n <fieldset\n class=\"d-input-group__fieldset\"\n :data-qa=\"dataQaGroup\"\n >\n <legend\n v-if=\"hasSlotContent($slots.legend) || legend\"\n :class=\"['d-label', legendClass]\"\n v-bind=\"legendChildProps\"\n :data-qa=\"dataQaGroupLegend\"\n >\n <!-- @slot slot for Input Group Legend -->\n <slot name=\"legend\">\n {{ legend }}\n </slot>\n </legend>\n <!-- @slot slot for Input Group Components -->\n <slot />\n <dt-validation-messages\n :validation-messages=\"formattedMessages\"\n :show-messages=\"showMessages\"\n :class=\"messagesClass\"\n :data-qa=\"dataQaGroupMessages\"\n v-bind=\"messagesChildProps\"\n />\n </fieldset>\n</template>\n\n<script>\nimport { InputGroupMixin } from '@/common/mixins/input_group';\nimport { DtValidationMessages } from '../validation_messages';\nimport { hasSlotContent } from '@/common/utils';\n\n/**\n * Input Groups are convenience components for a grouping of related inputs.\n * While each input within the group could be independent, the `v-model` on the group\n * provides a convenient interface for determining the current state of the group.\n * @see https://dialtone.dialpad.com/components/input_group.html\n */\nexport default {\n name: 'DtInputGroup',\n\n components: { DtValidationMessages },\n\n mixins: [InputGroupMixin],\n\n props: {\n /**\n * A data qa tag for the input group\n */\n dataQaGroup: {\n type: String,\n default: 'input-group',\n },\n\n /**\n * A data qa tag for the input group legend\n */\n dataQaGroupLegend: {\n type: String,\n default: 'input-group-legend',\n },\n\n /**\n * A data qa tag for the input group messages\n */\n dataQaGroupMessages: {\n type: String,\n default: 'input-group-messages',\n },\n },\n\n data () {\n return {\n internalValue: this.value,\n hasSlotContent,\n };\n },\n\n watch: {\n value (newValue) {\n this.internalValue = newValue;\n },\n\n /*\n * watching value to support 2 way binding for slotted inputs.\n * need this to pass value to slotted inputs if modified outside\n * input group.\n */\n internalValue: {\n immediate: true,\n handler (newInternalValue) {\n this.provideObj.value = newInternalValue;\n },\n },\n },\n\n methods: {\n getMessageKey (type, index) {\n return `input-group-message-${type}-${index}-${this.id}`;\n },\n },\n};\n</script>\n"],"names":["_sfc_main","DtValidationMessages","InputGroupMixin","hasSlotContent","newValue","newInternalValue","type","index","_createElementBlock","$props","$data","_ctx","_openBlock","_mergeProps","_renderSlot","_createVNode","_component_dt_validation_messages"],"mappings":"0UAuCA,MAAKA,EAAU,CACb,KAAM,eAEN,WAAY,CAAEC,qBAAAA,EAAAA,oBAAsB,EAEpC,OAAQ,CAACC,EAAAA,CAAe,EAExB,MAAO,CAIL,YAAa,CACX,KAAM,OACN,QAAS,aACV,EAKD,kBAAmB,CACjB,KAAM,OACN,QAAS,oBACV,EAKD,oBAAqB,CACnB,KAAM,OACN,QAAS,sBACV,CACF,EAED,MAAQ,CACN,MAAO,CACL,cAAe,KAAK,MACpB,eAAAC,EAAc,eAEjB,EAED,MAAO,CACL,MAAOC,EAAU,CACf,KAAK,cAAgBA,CACtB,EAOD,cAAe,CACb,UAAW,GACX,QAASC,EAAkB,CACzB,KAAK,WAAW,MAAQA,CACzB,CACF,CACF,EAED,QAAS,CACP,cAAeC,EAAMC,EAAO,CAC1B,MAAO,uBAAuBD,CAAI,IAAIC,CAAK,IAAI,KAAK,EAAE,EACvD,CACF,CACH,gIArGEC,EAwBW,mBAAA,WAAA,CAvBT,MAAM,0BACL,UAASC,EAAW,cAGbC,EAAA,eAAeC,EAAA,OAAO,MAAM,GAAKA,EAAM,QAD/CC,EAAAA,YAAAJ,EAAAA,mBAUS,SAVTK,aAUS,OARN,iBAAmBF,EAAW,WAAA,GACvBA,EAAgB,iBAAA,CACvB,UAASF,EAAiB,iBAAA,CAAA,EAAA,CAG3BK,EAAAA,WAEOH,qBAFP,IAEO,qCADFA,EAAM,MAAA,EAAA,CAAA,wCAIbG,aAAQH,EAAA,OAAA,SAAA,EACRI,EAAA,YAMEC,EANFH,aAME,CALC,sBAAqBF,EAAiB,kBACtC,gBAAeA,EAAY,aAC3B,MAAOA,EAAa,cACpB,UAASF,EAAmB,qBACrBE,EAAkB,kBAAA,EAAA,KAAA,GAAA,CAAA,sBAAA,gBAAA,QAAA,SAAA,CAAA"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("./constants.cjs"),c=require("./utils.cjs"),m=require("../chunks/input-0Uksk4DP.js"),t=require("vue"),f=require("../chunks/_plugin-vue_export-helper-6_y-gaV6.js"),S=require("./validation-messages.cjs");require("./validators.cjs");const o={TEXT:"text",TEXTAREA:"textarea",PASSWORD:"password",EMAIL:"email",NUMBER:"number",DATE:"date",TIME:"time",FILE:"file"},r={EXTRA_SMALL:"xs",SMALL:"sm",DEFAULT:"md",LARGE:"lg",EXTRA_LARGE:"xl"},b={name:"DtInput",components:{DtValidationMessages:S.DtValidationMessages},mixins:[m.M],inheritAttrs:!1,props:{name:{type:String,default:""},type:{type:String,default:o.TEXT,validator:e=>Object.values(o).includes(e)},modelValue:{type:[String,Number],default:""},disabled:{type:Boolean,default:!1},label:{type:String,default:""},labelVisible:{type:Boolean,default:!0},description:{type:String,default:""},size:{type:String,default:null,validator:e=>Object.values(r).includes(e)},iconSize:{type:String,default:null,validator:e=>Object.values(r).includes(e)},inputClass:{type:[String,Object,Array],default:""},inputWrapperClass:{type:[String,Object,Array],default:""},currentLength:{type:Number,default:null},retainWarning:{type:Boolean,default:!1},validate:{type:Object,default:null},hidden:{type:Boolean,default:!1}},emits:["input","blur","clear","focus","focusin","focusout","update:modelValue","update:length","update:invalid"],data(){return{descriptionSizeClasses:{lg:"d-description--lg",xl:"d-description--xl"},labelSizeClasses:{xs:"d-label--xs",sm:"d-label--sm",md:"d-label--md",lg:"d-label--lg",xl:"d-label--xl"},isInputFocused:!1,isInvalid:!1,defaultLength:0,hasSlotContent:c.hasSlotContent}},computed:{isTextarea(){return this.type===o.TEXTAREA},isDefaultSize(){return this.size===r.DEFAULT},isDefaultIconSize(){return this.iconSizeComputed===r.DEFAULT},iconSizeComputed(){return this.iconSize?this.iconSize:this.size},isValidSize(){return Object.values(r).includes(this.size)},isValidDescriptionSize(){return Object.values(h.DESCRIPTION_SIZE_TYPES).includes(this.size)},inputComponent(){return this.isTextarea?"textarea":"input"},inputListeners(){return{input:async e=>{let n=e.target.value;this.type===o.FILE&&(n=Array.from(e.target.files).map(u=>u.name)),this.$emit("input",n),this.$emit("update:modelValue",n)},blur:e=>{this.isInputFocused=!1,this.onBlur(e)},focus:e=>{this.isInputFocused=!0,this.$emit("focus",e)},focusin:e=>this.$emit("focusin",e),focusout:e=>this.$emit("focusout",e)}},descriptionKey(){return`input-description-${c.getUniqueString()}`},inputState(){return c.getValidationState(this.validationMessages)},defaultLengthCalculation(){return this.calculateLength(this.modelValue)},validationProps(){var e,n,s,u,a,i,d,l,p,g;return{length:{description:(n=(e=this==null?void 0:this.validate)==null?void 0:e.length)==null?void 0:n.description,max:(u=(s=this==null?void 0:this.validate)==null?void 0:s.length)==null?void 0:u.max,warn:(i=(a=this==null?void 0:this.validate)==null?void 0:a.length)==null?void 0:i.warn,message:(l=(d=this==null?void 0:this.validate)==null?void 0:d.length)==null?void 0:l.message,limitMaxLength:(g=(p=this==null?void 0:this.validate)==null?void 0:p.length)!=null&&g.limitMaxLength?this.validate.length.limitMaxLength:!1}}},validationMessages(){return this.showLengthLimitValidation?this.formattedMessages.concat([this.inputLengthErrorMessage()]):this.formattedMessages},showInputState(){return this.showMessages&&this.inputState},inputLength(){return this.currentLength?this.currentLength:this.defaultLengthCalculation},inputLengthState(){return this.inputLength<this.validationProps.length.warn?null:this.inputLength<=this.validationProps.length.max?this.validationProps.length.warn?h.VALIDATION_MESSAGE_TYPES.WARNING:null:h.VALIDATION_MESSAGE_TYPES.ERROR},shouldValidateLength(){return!!(this.validationProps.length.description&&this.validationProps.length.max)},shouldLimitMaxLength(){return this.shouldValidateLength&&this.validationProps.length.limitMaxLength},showLengthLimitValidation(){return this.shouldValidateLength&&this.inputLengthState!==null&&this.validationProps.length.message&&(this.retainWarning||this.isInputFocused||this.isInvalid)},sizeModifierClass(){return this.isDefaultSize||!this.isValidSize?"":{input:{xs:"d-input--xs",sm:"d-input--sm",lg:"d-input--lg",xl:"d-input--xl"},textarea:{xs:"d-textarea--xs",sm:"d-textarea--sm",lg:"d-textarea--lg",xl:"d-textarea--xl"}}[this.inputComponent][this.size]},stateClass(){return[{input:{error:"d-input--error base-input__input--error",warning:"d-input--warning base-input__input--warning",success:"d-input--success base-input__input--success"},textarea:{error:"d-textarea--error base-input__input--error",warning:"d-textarea--warning base-input__input--warning",success:"d-textarea--success base-input__input--success"}}[this.inputComponent][this.inputState]]}},watch:{isInvalid(e){this.$emit("update:invalid",e)},modelValue:{immediate:!0,handler(e){this.shouldValidateLength&&this.validateLength(this.inputLength),this.currentLength==null&&this.$emit("update:length",this.calculateLength(e))}}},methods:{inputClasses(){return["base-input__input",this.inputComponent==="input"?"d-input":"d-textarea",{[this.stateClass]:this.showInputState,"d-input-icon--left":this.$slots.leftIcon,"d-input-icon--right":this.$slots.rightIcon},this.sizeModifierClass,this.inputClass]},inputWrapperClasses(){return this.hidden?[]:["d-input__wrapper",{[this.stateClass]:this.showInputState},this.inputWrapperClass]},calculateLength(e){return typeof e!="string"?0:[...e].length},inputLengthErrorMessage(){return{message:this.validationProps.length.message,type:this.inputLengthState}},inputIconClasses(e){const n={xs:"d-input-icon--xs",sm:"d-input-icon--sm",lg:"d-input-icon--lg",xl:"d-input-icon--xl"};return[{left:"base-input__icon--left d-input-icon--left",right:"base-input__icon--right d-input-icon--right"}[e],"d-input-icon",{[n[this.iconSizeComputed]]:!this.isDefaultIconSize},this.sizeModifierClass]},onBlur(e){var n;(n=this.$refs.container)!=null&&n.contains(e.relatedTarget)||this.$emit("blur",e)},clear(){this.$emit("input",""),this.$emit("clear")},blur(){this.$refs.input.blur()},focus(){this.$refs.input.focus()},select(){this.$refs.input.select()},getMessageKey(e,n){return`message-${e}-${n}`},validateLength(e){this.isInvalid=e>this.validationProps.length.max}}},C=["aria-details"],v=["id"],L={key:0},_={key:1,"data-qa":"dt-input-length-description",class:"d-input__length-description"},x=["read-only"],y=["value","name","disabled","maxlength"],E=["value","name","type","disabled","maxlength"];function I(e,n,s,u,a,i){const d=t.resolveComponent("dt-validation-messages");return t.openBlock(),t.createElementBlock("div",{ref:"container",class:t.normalizeClass(["base-input",{"d-vi-hidden":s.hidden}]),"data-qa":"dt-input"},[t.createElementVNode("label",{class:"base-input__label","aria-details":e.$slots.description||s.description?i.descriptionKey:void 0,"data-qa":"dt-input-label-wrapper"},[t.renderSlot(e.$slots,"labelSlot",{},()=>[s.labelVisible&&s.label?(t.openBlock(),t.createElementBlock("div",{key:0,ref:"label","data-qa":"dt-input-label",class:t.normalizeClass(["base-input__label-text","d-label",a.labelSizeClasses[s.size]])},t.toDisplayString(s.label),3)):t.createCommentVNode("",!0)]),a.hasSlotContent(e.$slots.description)||s.description||i.shouldValidateLength?(t.openBlock(),t.createElementBlock("div",{key:0,id:i.descriptionKey,ref:"description",class:t.normalizeClass(["base-input__description","d-description",a.descriptionSizeClasses[s.size]]),"data-qa":"dt-input-description"},[a.hasSlotContent(e.$slots.description)||s.description?(t.openBlock(),t.createElementBlock("div",L,[t.renderSlot(e.$slots,"description",{},()=>[t.createTextVNode(t.toDisplayString(s.description),1)])])):t.createCommentVNode("",!0),i.shouldValidateLength?(t.openBlock(),t.createElementBlock("div",_,t.toDisplayString(i.validationProps.length.description),1)):t.createCommentVNode("",!0)],10,v)):t.createCommentVNode("",!0),t.createElementVNode("div",{class:t.normalizeClass(i.inputWrapperClasses()),"read-only":s.disabled===!0?!0:void 0},[a.hasSlotContent(e.$slots.leftIcon)?(t.openBlock(),t.createElementBlock("span",{key:0,class:t.normalizeClass(i.inputIconClasses("left")),"data-qa":"dt-input-left-icon-wrapper",onFocusout:n[0]||(n[0]=(...l)=>i.onBlur&&i.onBlur(...l))},[t.renderSlot(e.$slots,"leftIcon")],34)):t.createCommentVNode("",!0),i.isTextarea?(t.openBlock(),t.createElementBlock("textarea",t.mergeProps({key:1,ref:"input",value:s.modelValue,name:s.name,disabled:s.disabled,class:i.inputClasses(),maxlength:i.shouldLimitMaxLength?i.validationProps.length.max:null,"data-qa":"dt-input-input"},e.$attrs,t.toHandlers(i.inputListeners,!0)),null,16,y)):(t.openBlock(),t.createElementBlock("input",t.mergeProps({key:2,ref:"input",value:s.modelValue,name:s.name,type:s.type,disabled:s.disabled,class:i.inputClasses(),maxlength:i.shouldLimitMaxLength?i.validationProps.length.max:null,"data-qa":"dt-input-input"},e.$attrs,t.toHandlers(i.inputListeners,!0)),null,16,E)),a.hasSlotContent(e.$slots.rightIcon)?(t.openBlock(),t.createElementBlock("span",{key:3,class:t.normalizeClass(i.inputIconClasses("right")),"data-qa":"dt-input-right-icon-wrapper",onFocusout:n[1]||(n[1]=(...l)=>i.onBlur&&i.onBlur(...l))},[t.renderSlot(e.$slots,"rightIcon")],34)):t.createCommentVNode("",!0)],10,x)],8,C),t.createVNode(d,t.mergeProps({"validation-messages":i.validationMessages,"show-messages":e.showMessages,class:e.messagesClass},e.messagesChildProps,{"data-qa":"dt-input-messages"}),null,16,["validation-messages","show-messages","class"])],2)}const z=f._(b,[["render",I]]);exports.DtInput=z;exports.INPUT_SIZES=r;exports.INPUT_TYPES=o;
|
|
2
|
+
//# sourceMappingURL=input.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"input.cjs","sources":["../../components/input/input_constants.js","../../components/input/input.vue"],"sourcesContent":["// Valid input types, any other input types (for example: 'radio' or 'checkbox') should\n// use the respective base vue components (radio.vue and checkout.vue).\nexport const INPUT_TYPES = {\n TEXT: 'text',\n TEXTAREA: 'textarea',\n PASSWORD: 'password',\n EMAIL: 'email',\n NUMBER: 'number',\n DATE: 'date',\n TIME: 'time',\n FILE: 'file',\n};\n\nexport const INPUT_SIZES = {\n EXTRA_SMALL: 'xs',\n SMALL: 'sm',\n DEFAULT: 'md',\n LARGE: 'lg',\n EXTRA_LARGE: 'xl',\n};\n\nexport default {\n INPUT_TYPES,\n INPUT_SIZES,\n};\n","<!-- eslint-disable vue/no-restricted-class -->\n<template>\n <div\n ref=\"container\"\n :class=\"['base-input', { 'd-vi-hidden': hidden }]\"\n data-qa=\"dt-input\"\n >\n <label\n class=\"base-input__label\"\n :aria-details=\"$slots.description || description ? descriptionKey : undefined\"\n data-qa=\"dt-input-label-wrapper\"\n >\n <!-- @slot slot for label, defaults to label prop -->\n <slot name=\"labelSlot\">\n <div\n v-if=\"labelVisible && label\"\n ref=\"label\"\n data-qa=\"dt-input-label\"\n :class=\"[\n 'base-input__label-text',\n 'd-label',\n labelSizeClasses[size],\n ]\"\n >\n {{ label }}\n </div>\n </slot>\n <div\n v-if=\"hasSlotContent($slots.description) || description || shouldValidateLength\"\n :id=\"descriptionKey\"\n ref=\"description\"\n :class=\"[\n 'base-input__description',\n 'd-description',\n descriptionSizeClasses[size],\n ]\"\n data-qa=\"dt-input-description\"\n >\n <div\n v-if=\"hasSlotContent($slots.description) || description\"\n >\n <!-- @slot slot for description, defaults to description prop -->\n <slot name=\"description\">{{ description }}</slot>\n </div>\n <div\n v-if=\"shouldValidateLength\"\n data-qa=\"dt-input-length-description\"\n class=\"d-input__length-description\"\n >\n {{ validationProps.length.description }}\n </div>\n </div>\n <div\n :class=\"inputWrapperClasses()\"\n :read-only=\"disabled === true ? true : undefined\"\n >\n <span\n v-if=\"hasSlotContent($slots.leftIcon)\"\n :class=\"inputIconClasses('left')\"\n data-qa=\"dt-input-left-icon-wrapper\"\n @focusout=\"onBlur\"\n >\n <!-- @slot Slot for left icon -->\n <slot name=\"leftIcon\" />\n </span>\n <textarea\n v-if=\"isTextarea\"\n ref=\"input\"\n :value=\"modelValue\"\n :name=\"name\"\n :disabled=\"disabled\"\n :class=\"inputClasses()\"\n :maxlength=\"shouldLimitMaxLength ? validationProps.length.max : null\"\n data-qa=\"dt-input-input\"\n v-bind=\"$attrs\"\n v-on=\"inputListeners\"\n />\n <input\n v-else\n ref=\"input\"\n :value=\"modelValue\"\n :name=\"name\"\n :type=\"type\"\n :disabled=\"disabled\"\n :class=\"inputClasses()\"\n :maxlength=\"shouldLimitMaxLength ? validationProps.length.max : null\"\n data-qa=\"dt-input-input\"\n v-bind=\"$attrs\"\n v-on=\"inputListeners\"\n >\n <span\n v-if=\"hasSlotContent($slots.rightIcon)\"\n :class=\"inputIconClasses('right')\"\n data-qa=\"dt-input-right-icon-wrapper\"\n @focusout=\"onBlur\"\n >\n <!-- @slot Slot for right icon -->\n <slot name=\"rightIcon\" />\n </span>\n </div>\n </label>\n <dt-validation-messages\n :validation-messages=\"validationMessages\"\n :show-messages=\"showMessages\"\n :class=\"messagesClass\"\n v-bind=\"messagesChildProps\"\n data-qa=\"dt-input-messages\"\n />\n </div>\n</template>\n\n<script>\nimport { DESCRIPTION_SIZE_TYPES, VALIDATION_MESSAGE_TYPES } from '@/common/constants';\nimport { INPUT_TYPES, INPUT_SIZES } from './input_constants';\nimport {\n getUniqueString,\n getValidationState,\n hasSlotContent,\n} from '@/common/utils';\nimport { DtValidationMessages } from '@/components/validation_messages';\nimport { MessagesMixin } from '@/common/mixins/input';\n\n/**\n * An input field is an input control that allows users to enter alphanumeric information.\n * It can have a range of options and supports single line and multi-line lengths,\n * as well as varying formats, including numbers, masked passwords, etc.\n * @property {Boolean} placeholder attribute\n * @see https://dialtone.dialpad.com/components/input.html\n */\nexport default {\n name: 'DtInput',\n\n components: { DtValidationMessages },\n\n mixins: [MessagesMixin],\n\n inheritAttrs: false,\n\n props: {\n /**\n * Name property of the input element\n */\n name: {\n type: String,\n default: '',\n },\n\n /**\n * Type of the input, one of: `text`, `password`, `email`, `number`, `textarea`, 'date', 'time'.\n * When `textarea` a `<textarea>` element will be rendered instead of an `<input>` element.\n * @values text, password, email, number, textarea, date, time\n */\n type: {\n type: String,\n default: INPUT_TYPES.TEXT,\n validator: (t) => Object.values(INPUT_TYPES).includes(t),\n },\n\n /**\n * Value of the input\n */\n modelValue: {\n type: [String, Number],\n default: '',\n },\n\n /**\n * Disables the input\n * @values true, false\n */\n disabled: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Label for the input\n */\n label: {\n type: String,\n default: '',\n },\n\n /**\n * Determines visibility of input label.\n * @values true, false\n */\n labelVisible: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Description for the input\n */\n description: {\n type: String,\n default: '',\n },\n\n /**\n * Size of the input, one of `xs`, `sm`, `md`, `lg`, `xl`\n * @values null, xs, sm, md, lg, xl\n */\n size: {\n type: String,\n default: null,\n validator: (t) => Object.values(INPUT_SIZES).includes(t),\n },\n\n /**\n * Size of the icon. One of `xs`, `sm`, `md`, `lg`, `xl`. If you do not set this the icon will size relative\n * to the input size\n * @values null, xs, sm, md, lg, xl\n */\n iconSize: {\n type: String,\n default: null,\n validator: (t) => Object.values(INPUT_SIZES).includes(t),\n },\n\n /**\n * Additional class name for the input element.\n * Can accept String, Object, and Array, i.e. has the\n * same API as Vue's built-in handling of the class attribute.\n */\n inputClass: {\n type: [String, Object, Array],\n default: '',\n },\n\n /**\n * Additional class name for the input wrapper element.\n * Can accept all of String, Object, and Array, i.e. has the\n * same api as Vue's built-in handling of the class attribute.\n */\n inputWrapperClass: {\n type: [String, Object, Array],\n default: '',\n },\n\n /**\n * The current character length that the user has entered into the input.\n * This will only need to be used if you are using `validate.length` and\n * the string contains abnormal characters.\n * For example, an emoji could take up many characters in the input, but should only count as 1 character.\n * If no number is provided, a built-in length calculation will be used for the length validation.\n */\n currentLength: {\n type: Number,\n default: null,\n },\n\n /**\n * Whether the input will continue to display a warning validation message even if the input has lost focus.\n */\n retainWarning: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Validation for the input. Supports maximum length validation with the structure:\n * `{ \"length\": {\"description\": string, \"max\": number, \"warn\": number, \"message\": string,\n * \"limitMaxLength\": boolean }}`\n */\n validate: {\n type: Object,\n default: null,\n },\n\n /**\n * hidden allows to use input without the element visually present in DOM\n */\n hidden: {\n type: Boolean,\n default: false,\n },\n },\n\n emits: [\n /**\n * Native input event\n *\n * @event input\n * @type {String}\n */\n 'input',\n\n /**\n * Native input blur event\n *\n * @event blur\n * @type {FocusEvent}\n */\n 'blur',\n\n /**\n * Input clear event\n *\n * @event clear\n */\n 'clear',\n\n /**\n * Native input focus event\n *\n * @event focus\n * @type {FocusEvent}\n */\n 'focus',\n\n /**\n * Native input focusin event\n *\n * @event focusin\n * @type {FocusEvent}\n */\n 'focusin',\n\n /**\n * Native input focusout event\n *\n * @event focusout\n * @type {FocusEvent}\n */\n 'focusout',\n\n /**\n * Event fired to sync the modelValue prop with the parent component\n * @event update:modelValue\n */\n 'update:modelValue',\n\n /**\n * Length of the input when currentLength prop is not passed\n *\n * @event update:length\n * @type {Number}\n */\n 'update:length',\n\n /**\n * Result of the input validation\n *\n * @event update:invalid\n * @type {Boolean}\n */\n 'update:invalid',\n ],\n\n data () {\n return {\n descriptionSizeClasses: {\n lg: 'd-description--lg',\n xl: 'd-description--xl',\n },\n\n labelSizeClasses: {\n xs: 'd-label--xs',\n sm: 'd-label--sm',\n md: 'd-label--md',\n lg: 'd-label--lg',\n xl: 'd-label--xl',\n },\n\n isInputFocused: false,\n isInvalid: false,\n defaultLength: 0,\n hasSlotContent,\n };\n },\n\n computed: {\n\n isTextarea () {\n return this.type === INPUT_TYPES.TEXTAREA;\n },\n\n isDefaultSize () {\n return this.size === INPUT_SIZES.DEFAULT;\n },\n\n isDefaultIconSize () {\n return this.iconSizeComputed === INPUT_SIZES.DEFAULT;\n },\n\n iconSizeComputed () {\n return this.iconSize ? this.iconSize : this.size;\n },\n\n isValidSize () {\n return Object.values(INPUT_SIZES).includes(this.size);\n },\n\n isValidDescriptionSize () {\n return Object.values(DESCRIPTION_SIZE_TYPES).includes(this.size);\n },\n\n inputComponent () {\n if (this.isTextarea) {\n return 'textarea';\n }\n\n return 'input';\n },\n\n inputListeners () {\n return {\n input: async event => {\n let val = event.target.value;\n if (this.type === INPUT_TYPES.FILE) {\n const files = Array.from(event.target.files);\n val = files.map(file => file.name);\n }\n this.$emit('input', val);\n this.$emit('update:modelValue', val);\n },\n\n blur: event => {\n this.isInputFocused = false;\n this.onBlur(event);\n },\n\n focus: event => {\n this.isInputFocused = true;\n this.$emit('focus', event);\n },\n\n focusin: event => this.$emit('focusin', event),\n focusout: event => this.$emit('focusout', event),\n };\n },\n\n descriptionKey () {\n return `input-description-${getUniqueString()}`;\n },\n\n inputState () {\n return getValidationState(this.validationMessages);\n },\n\n defaultLengthCalculation () {\n return this.calculateLength(this.modelValue);\n },\n\n validationProps () {\n return {\n length: {\n description: this?.validate?.length?.description,\n max: this?.validate?.length?.max,\n warn: this?.validate?.length?.warn,\n message: this?.validate?.length?.message,\n limitMaxLength: this?.validate?.length?.limitMaxLength ? this.validate.length.limitMaxLength : false,\n },\n };\n },\n\n validationMessages () {\n // Add length validation message if exists\n if (this.showLengthLimitValidation) {\n return this.formattedMessages.concat([this.inputLengthErrorMessage()]);\n }\n\n return this.formattedMessages;\n },\n\n showInputState () {\n return this.showMessages && this.inputState;\n },\n\n inputLength () {\n return this.currentLength ? this.currentLength : this.defaultLengthCalculation;\n },\n\n inputLengthState () {\n if (this.inputLength < this.validationProps.length.warn) {\n return null;\n } else if (this.inputLength <= this.validationProps.length.max) {\n return this.validationProps.length.warn ? VALIDATION_MESSAGE_TYPES.WARNING : null;\n } else {\n return VALIDATION_MESSAGE_TYPES.ERROR;\n }\n },\n\n shouldValidateLength () {\n return !!(\n this.validationProps.length.description &&\n this.validationProps.length.max\n );\n },\n\n shouldLimitMaxLength () {\n return this.shouldValidateLength && this.validationProps.length.limitMaxLength;\n },\n\n // eslint-disable-next-line complexity\n showLengthLimitValidation () {\n return (\n this.shouldValidateLength &&\n this.inputLengthState !== null &&\n this.validationProps.length.message &&\n (this.retainWarning || this.isInputFocused || this.isInvalid)\n );\n },\n\n sizeModifierClass () {\n if (this.isDefaultSize || !this.isValidSize) {\n return '';\n }\n\n const sizeClasses = {\n input: {\n xs: 'd-input--xs',\n sm: 'd-input--sm',\n lg: 'd-input--lg',\n xl: 'd-input--xl',\n },\n\n textarea: {\n xs: 'd-textarea--xs',\n sm: 'd-textarea--sm',\n lg: 'd-textarea--lg',\n xl: 'd-textarea--xl',\n },\n };\n\n return sizeClasses[this.inputComponent][this.size];\n },\n\n stateClass () {\n const inputStateClasses = {\n input: {\n error: 'd-input--error base-input__input--error',\n warning: 'd-input--warning base-input__input--warning',\n success: 'd-input--success base-input__input--success',\n },\n\n textarea: {\n error: 'd-textarea--error base-input__input--error',\n warning: 'd-textarea--warning base-input__input--warning',\n success: 'd-textarea--success base-input__input--success',\n },\n };\n return [inputStateClasses[this.inputComponent][this.inputState]];\n },\n },\n\n watch: {\n isInvalid (val) {\n this.$emit('update:invalid', val);\n },\n\n modelValue: {\n immediate: true,\n handler (newValue) {\n if (this.shouldValidateLength) {\n this.validateLength(this.inputLength);\n }\n\n if (this.currentLength == null) {\n this.$emit('update:length', this.calculateLength(newValue));\n }\n },\n },\n },\n\n methods: {\n inputClasses () {\n return [\n 'base-input__input',\n this.inputComponent === 'input' ? 'd-input' : 'd-textarea',\n {\n [this.stateClass]: this.showInputState,\n 'd-input-icon--left': this.$slots.leftIcon,\n 'd-input-icon--right': this.$slots.rightIcon,\n },\n this.sizeModifierClass,\n this.inputClass,\n ];\n },\n\n inputWrapperClasses () {\n if (this.hidden) {\n return [];\n }\n return [\n 'd-input__wrapper',\n { [this.stateClass]: this.showInputState },\n this.inputWrapperClass,\n ];\n },\n\n calculateLength (value) {\n if (typeof value !== 'string') {\n return 0;\n }\n\n return [...value].length;\n },\n\n inputLengthErrorMessage () {\n return {\n message: this.validationProps.length.message,\n type: this.inputLengthState,\n };\n },\n\n inputIconClasses (side) {\n const iconSizeClasses = {\n xs: 'd-input-icon--xs',\n sm: 'd-input-icon--sm',\n lg: 'd-input-icon--lg',\n xl: 'd-input-icon--xl',\n };\n const iconOrientationClasses = {\n left: 'base-input__icon--left d-input-icon--left',\n right: 'base-input__icon--right d-input-icon--right',\n };\n\n return [\n iconOrientationClasses[side],\n 'd-input-icon',\n { [iconSizeClasses[this.iconSizeComputed]]: !this.isDefaultIconSize },\n this.sizeModifierClass,\n ];\n },\n\n onBlur (e) {\n // Do not emit a blur event if the target element is a child of this component\n if (!this.$refs.container?.contains(e.relatedTarget)) {\n this.$emit('blur', e);\n }\n },\n\n clear () {\n this.$emit('input', '');\n this.$emit('clear');\n },\n\n blur () {\n this.$refs.input.blur();\n },\n\n focus () {\n this.$refs.input.focus();\n },\n\n select () {\n this.$refs.input.select();\n },\n\n getMessageKey (type, index) {\n return `message-${type}-${index}`;\n },\n\n validateLength (length) {\n this.isInvalid = (length > this.validationProps.length.max);\n },\n },\n};\n</script>\n"],"names":["INPUT_TYPES","INPUT_SIZES","_sfc_main","DtValidationMessages","MessagesMixin","t","hasSlotContent","DESCRIPTION_SIZE_TYPES","event","val","file","getUniqueString","getValidationState","_b","_a","_d","_c","_f","_e","_h","_g","_j","_i","VALIDATION_MESSAGE_TYPES","newValue","value","side","iconSizeClasses","type","index","length","_createElementBlock","$props","_createElementVNode","_ctx","$options","_renderSlot","_normalizeClass","$data","_hoisted_3","_openBlock","_hoisted_4","_toDisplayString","args","_mergeProps","_toHandlers","_hoisted_6","_hoisted_7","_createVNode","_component_dt_validation_messages"],"mappings":"sUAEY,MAACA,EAAc,CACzB,KAAM,OACN,SAAU,WACV,SAAU,WACV,MAAO,QACP,OAAQ,SACR,KAAM,OACN,KAAM,OACN,KAAM,MACR,EAEaC,EAAc,CACzB,YAAa,KACb,MAAO,KACP,QAAS,KACT,MAAO,KACP,YAAa,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Q,CAAA,KAGjBP,aAAyBF,EAAA,OAAA,WAAA,iDAI/Bc,EAAA,YAMEC,EANFL,aAME,CALC,sBAAqBT,EAAkB,mBACvC,gBAAeD,EAAY,aAC3B,MAAOA,EAAa,eACbA,EAAkB,mBAAA,CAC1B,UAAQ,mBAAmB,CAAA,EAAA,KAAA,GAAA,CAAA,sBAAA,gBAAA,OAAA,CAAA"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./utils.cjs"),t=require("vue"),s=require("../chunks/_plugin-vue_export-helper-6_y-gaV6.js");require("./constants.cjs");const n={name:"DtItemLayout",props:{as:{type:String,default:"div"},unstyled:{type:Boolean,default:!1}},methods:{hasSlotContent:a.hasSlotContent}},r={key:0,"data-qa":"dt-item-layout-left-wrapper",class:"dt-item-layout--left"},d={"data-qa":"dt-item-layout-content-wrapper",class:"dt-item-layout--content"},c={key:0,"data-qa":"dt-item-layout-title-wrapper",class:"dt-item-layout--title"},i={key:2,"data-qa":"dt-item-layout-bottom-wrapper",class:"dt-item-layout--bottom"},u={key:1,"data-qa":"dt-item-layout-right-wrapper",class:"dt-item-layout--right"},m={key:2,"data-qa":"dt-item-layout-selected-wrapper",class:"dt-item-layout--selected"};function y(e,p,l,k,C,o){return t.openBlock(),t.createBlock(t.resolveDynamicComponent(l.as),{class:t.normalizeClass(l.unstyled?"dt-item-layout--custom":"dt-item-layout")},{default:t.withCtx(()=>[o.hasSlotContent(e.$slots.left)?(t.openBlock(),t.createElementBlock("section",r,[t.renderSlot(e.$slots,"left")])):t.createCommentVNode("",!0),t.createElementVNode("section",d,[o.hasSlotContent(e.$slots.default)?(t.openBlock(),t.createElementBlock("div",c,[t.renderSlot(e.$slots,"default")])):t.createCommentVNode("",!0),o.hasSlotContent(e.$slots.subtitle)?(t.openBlock(),t.createElementBlock("div",{key:1,"data-qa":"dt-item-layout-subtitle-wrapper",class:t.normalizeClass(["dt-item-layout--subtitle",{"dt-item-layout--subtitle--with-title":o.hasSlotContent(e.$slots.default)}])},[t.renderSlot(e.$slots,"subtitle")],2)):t.createCommentVNode("",!0),o.hasSlotContent(e.$slots.bottom)?(t.openBlock(),t.createElementBlock("div",i,[t.renderSlot(e.$slots,"bottom")])):t.createCommentVNode("",!0)]),o.hasSlotContent(e.$slots.right)?(t.openBlock(),t.createElementBlock("section",u,[t.renderSlot(e.$slots,"right")])):t.createCommentVNode("",!0),o.hasSlotContent(e.$slots.selected)?(t.openBlock(),t.createElementBlock("section",m,[t.renderSlot(e.$slots,"selected")])):t.createCommentVNode("",!0)]),_:3},8,["class"])}const h=s._(n,[["render",y]]);exports.DtItemLayout=h;
|
|
2
|
+
//# sourceMappingURL=item-layout.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"item-layout.cjs","sources":["../../components/item_layout/item_layout.vue"],"sourcesContent":["<template>\n <component\n :is=\"as\"\n :class=\"unstyled ? 'dt-item-layout--custom' : 'dt-item-layout'\"\n >\n <section\n v-if=\"hasSlotContent($slots.left)\"\n data-qa=\"dt-item-layout-left-wrapper\"\n class=\"dt-item-layout--left\"\n >\n <!-- @slot Slot for left content -->\n <slot name=\"left\" />\n </section>\n <section\n data-qa=\"dt-item-layout-content-wrapper\"\n class=\"dt-item-layout--content\"\n >\n <div\n v-if=\"hasSlotContent($slots.default)\"\n data-qa=\"dt-item-layout-title-wrapper\"\n class=\"dt-item-layout--title\"\n >\n <!-- @slot Slot for main content -->\n <slot />\n </div>\n <div\n v-if=\"hasSlotContent($slots.subtitle)\"\n data-qa=\"dt-item-layout-subtitle-wrapper\"\n :class=\"['dt-item-layout--subtitle', { 'dt-item-layout--subtitle--with-title': hasSlotContent($slots.default) }]\"\n >\n <!-- @slot Slot for content below main content -->\n <slot name=\"subtitle\" />\n </div>\n <div\n v-if=\"hasSlotContent($slots.bottom)\"\n data-qa=\"dt-item-layout-bottom-wrapper\"\n class=\"dt-item-layout--bottom\"\n >\n <!-- @slot Slot for content below subtitle -->\n <slot name=\"bottom\" />\n </div>\n </section>\n <section\n v-if=\"hasSlotContent($slots.right)\"\n data-qa=\"dt-item-layout-right-wrapper\"\n class=\"dt-item-layout--right\"\n >\n <!-- @slot Slot for right content -->\n <slot name=\"right\" />\n </section>\n <section\n v-if=\"hasSlotContent($slots.selected)\"\n data-qa=\"dt-item-layout-selected-wrapper\"\n class=\"dt-item-layout--selected\"\n >\n <!-- @slot Slot for selected icon -->\n <slot name=\"selected\" />\n </section>\n </component>\n</template>\n\n/**\n * Custom layout to enable developer to use list-item like stack.\n * It is used as base for `dt-list-item` component\n * @see https://dialtone.dialpad.com/components/item_layout.html\n */\n<script>\nimport { hasSlotContent } from '@/common/utils';\n\nexport default {\n name: 'DtItemLayout',\n props: {\n /**\n * Set this prop to render layout as a specific HTML element.\n */\n as: {\n type: String,\n default: 'div',\n },\n\n /**\n * Set this prop to remove the default styling.\n * @values true, false\n */\n unstyled: {\n type: Boolean,\n default: false,\n },\n },\n\n methods: { hasSlotContent },\n};\n</script>\n"],"names":["_sfc_main","hasSlotContent","_openBlock","_createBlock","_resolveDynamicComponent","$props","$options","_ctx","_createElementBlock","_hoisted_1","_renderSlot","_createElementVNode","_hoisted_2","_hoisted_3","_normalizeClass","_hoisted_4","_hoisted_5","_hoisted_6"],"mappings":"wNAqEA,MAAKA,EAAU,CACb,KAAM,eACN,MAAO,CAIL,GAAI,CACF,KAAM,OACN,QAAS,KACV,EAMD,SAAU,CACR,KAAM,QACN,QAAS,EACV,CACF,EAED,QAAS,CAAEC,eAAAA,EAAAA,cAAgB,CAC7B,WApFM,UAAQ,8BACR,MAAM,2BAMN,UAAQ,iCACR,MAAM,oCAIJ,UAAQ,+BACR,MAAM,kCAeN,UAAQ,gCACR,MAAM,mCAQR,UAAQ,+BACR,MAAM,kCAON,UAAQ,kCACR,MAAM,oDApDV,OAAAC,EAAAA,UAAA,EAAAC,EAAA,YAyDYC,0BAxDLC,EAAE,EAAA,EAAA,CACN,uBAAOA,EAAQ,SAAA,yBAAA,gBAAA,sBAEhB,IAOU,CANFC,EAAc,eAACC,EAAM,OAAC,IAAI,GADlCL,EAAAA,YAAAM,EAAAA,mBAOU,UAPVC,EAOU,CADRC,aAAoBH,EAAA,OAAA,MAAA,iCAEtBI,EAAA,mBA4BU,UA5BVC,EA4BU,CAvBAN,EAAc,eAACC,EAAM,OAAC,OAAO,GADrCL,EAAAA,YAAAM,EAAAA,mBAOM,MAPNK,EAOM,CADJH,aAAQH,EAAA,OAAA,SAAA,iCAGFD,EAAc,eAACC,EAAM,OAAC,QAAQ,iBADtCC,EAOM,mBAAA,MAAA,OALJ,UAAQ,kCACP,MAA8EM,EAAA,eAAA,CAAA,2BAAA,CAAA,uCAAAR,EAAA,eAAeC,EAAA,OAAO,OAAO,CAAA,CAAA,CAAA,IAG5GG,aAAwBH,EAAA,OAAA,UAAA,mCAGlBD,EAAc,eAACC,EAAM,OAAC,MAAM,GADpCL,EAAAA,YAAAM,EAAAA,mBAOM,MAPNO,EAOM,CADJL,aAAsBH,EAAA,OAAA,QAAA,mCAIlBD,EAAc,eAACC,EAAM,OAAC,KAAK,GADnCL,EAAAA,YAAAM,EAAAA,mBAOU,UAPVQ,EAOU,CADRN,aAAqBH,EAAA,OAAA,OAAA,iCAGfD,EAAc,eAACC,EAAM,OAAC,QAAQ,GADtCL,EAAAA,YAAAM,EAAAA,mBAOU,UAPVS,EAOU,CADRP,aAAwBH,EAAA,OAAA,UAAA"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),C=require("../chunks/_plugin-vue_export-helper-6_y-gaV6.js"),D=require("./card.cjs"),V=require("./button.cjs"),P=require("../chunks/dropdown-UO3UJalk.js"),h=require("./icon.cjs");require("./utils.cjs");require("./constants.cjs");require("../chunks/link_constants-Kn6kP4i1.js");require("../chunks/keyboard_list_navigation-N74Bpdq7.js");require("../chunks/dropdown_constants-KHFvVI2L.js");require("../chunks/sr_only_close_button-iD7s1Pbj.js");require("./popover.cjs");require("../chunks/popover_constants-hOEhklvr.js");require("tippy.js");require("../chunks/modal-qEzlo0Sj.js");require("./lazy-show.cjs");require("@dialpad/dialtone-icons/vue3");require("../chunks/icon_constants-2S_OSQ1t.js");require("@dialpad/dialtone-icons/icons.json");require("../chunks/list_item_constants-Tsz5CO1m.js");const l="promptmenu",a="promptcollect",i="promptplay",s="gotoexpert",c="goto",_="branch",u="transfer",m="hangup",E={[l]:"keypad",[a]:"dialer",[i]:"volume-2",[s]:"expert-node",[_]:"branch",[c]:"call-merge",[u]:"transfer",[m]:"phone-hang-up"},T={[l]:"Menu",[a]:"Collect",[i]:"Play",[s]:"Expert",[_]:"Branch",[c]:"Go-to",[u]:"Transfer",[m]:"Hangup"},n={PROMPT:{normal:"d-bc-blue-200",selected:"d-bc-blue-300"},LOGIC:{normal:"d-bc-purple-200",selected:"d-bc-purple-400"},TERMINAL:{normal:"d-bc-red-100",selected:"d-bc-red-200"}},v={[l]:n.PROMPT,[a]:n.PROMPT,[i]:n.PROMPT,[s]:n.LOGIC,[_]:n.LOGIC,[c]:n.LOGIC,[u]:n.TERMINAL,[m]:n.TERMINAL},q={name:"DtRecipeIvrNode",components:{DtCard:D.DtCard,DtButton:V.DtButton,DtDropdown:P.D,DtIcon:h.DtIcon},props:{nodeType:{type:String,required:!0},nodeLabel:{type:String,required:!0},isSelected:{type:Boolean,default:!1},menuButtonAriaLabel:{type:String,required:!0},dtmfKey:{type:String,default:null}},emits:["click"],data(){return{isOpen:!1}},computed:{nodeListeners(){return{click:o=>this.$emit("click",o)}},nodeIcon(){return E[this.nodeType]},headerColor(){const{normal:o,selected:d}=v[this.nodeType];return this.isSelected?d:o},isGotoNode(){return this.nodeType===c}},methods:{openMenu(){this.isOpen=!0}}},L={class:"ivr_node__header-left"},y={class:"ivr_node__label","data-qa":"ivr-node-label"},S={class:"ivr_node__dropdown-list"};function M(o,d,t,k,O,r){const N=e.resolveComponent("dt-icon"),R=e.resolveComponent("dt-button"),b=e.resolveComponent("dt-dropdown"),I=e.resolveComponent("dt-card");return e.openBlock(),e.createElementBlock("div",e.mergeProps({class:"ivr_node"},e.toHandlers(r.nodeListeners,!0)),[t.dtmfKey?(e.openBlock(),e.createElementBlock("div",{key:0,"data-qa":"dt-top-connector-dtmf",class:e.normalizeClass(["ivr-connector ivr-connector--dtmf",{"ivr-connector--dtmf--selected":t.isSelected}])},e.toDisplayString(t.dtmfKey),3)):e.createCommentVNode("",!0),o.$slots.connector?e.renderSlot(o.$slots,"connector",{key:1}):e.createCommentVNode("",!0),!t.dtmfKey&&!o.$slots.connector?(e.openBlock(),e.createElementBlock("div",{key:2,"data-qa":"dt-top-connector",class:e.normalizeClass(["ivr-connector",{"ivr-connector--selected":t.isSelected}])},null,2)):e.createCommentVNode("",!0),e.createVNode(I,{"content-class":"d-bt d-bc-black-300 d-px12 d-pt8 d-pb12","container-class":["d-w100p",{"d-ba d-bar8 d-baw4":t.isSelected},r.headerColor],"header-class":["d-mtn1","d-bt","d-btw4","d-p0",r.headerColor,{"d-btr4":!t.isSelected}]},{header:e.withCtx(()=>[e.createElementVNode("div",L,[e.createVNode(R,{"aria-label":t.nodeType,importance:"clear",kind:"muted","data-qa":"dt-ivr-node-icon"},{icon:e.withCtx(()=>[e.createVNode(N,{name:r.nodeIcon,size:"200",class:e.normalizeClass(["",{ivr_node__goto_icon:r.isGotoNode}])},null,8,["name","class"])]),_:1},8,["aria-label"]),e.createElementVNode("p",y,e.toDisplayString(t.nodeLabel),1)]),e.createVNode(b,{open:O.isOpen,"onUpdate:open":d[0]||(d[0]=p=>O.isOpen=p),placement:"bottom"},{anchor:e.withCtx(()=>[e.createVNode(R,{importance:"clear",kind:"muted","aria-label":t.menuButtonAriaLabel,onClick:e.withModifiers(r.openMenu,["stop","prevent"])},{icon:e.withCtx(()=>[e.createVNode(N,{name:"more-vertical",size:"200"})]),_:1},8,["aria-label","onClick"])]),list:e.withCtx(({close:p})=>[e.createElementVNode("div",S,[e.renderSlot(o.$slots,"menuItems",{close:p})])]),_:3},8,["open"])]),content:e.withCtx(()=>[e.renderSlot(o.$slots,"content")]),_:3},8,["container-class","header-class"])],16)}const f=C._(q,[["render",M]]);exports.DtRecipeIvrNode=f;exports.IVR_NODE_BRANCH=_;exports.IVR_NODE_EXPERT=s;exports.IVR_NODE_GO_TO=c;exports.IVR_NODE_HANGUP=m;exports.IVR_NODE_ICON_TYPES=E;exports.IVR_NODE_LABELS=T;exports.IVR_NODE_PROMPT_COLLECT=a;exports.IVR_NODE_PROMPT_MENU=l;exports.IVR_NODE_PROMPT_PLAY=i;exports.IVR_NODE_TRANSFER=u;
|
|
2
|
+
//# sourceMappingURL=ivr-node.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ivr-node.cjs","sources":["../../recipes/cards/ivr_node/ivr_node_constants.js","../../recipes/cards/ivr_node/ivr_node.vue"],"sourcesContent":["export const IVR_NODE_PROMPT_MENU = 'promptmenu';\nexport const IVR_NODE_PROMPT_COLLECT = 'promptcollect';\nexport const IVR_NODE_PROMPT_PLAY = 'promptplay';\nexport const IVR_NODE_EXPERT = 'gotoexpert';\nexport const IVR_NODE_GO_TO = 'goto';\nexport const IVR_NODE_BRANCH = 'branch';\nexport const IVR_NODE_TRANSFER = 'transfer';\nexport const IVR_NODE_HANGUP = 'hangup';\n\nexport const IVR_NODE_ICON_TYPES = {\n [IVR_NODE_PROMPT_MENU]: 'keypad',\n [IVR_NODE_PROMPT_COLLECT]: 'dialer',\n [IVR_NODE_PROMPT_PLAY]: 'volume-2',\n [IVR_NODE_EXPERT]: 'expert-node',\n [IVR_NODE_BRANCH]: 'branch',\n [IVR_NODE_GO_TO]: 'call-merge',\n [IVR_NODE_TRANSFER]: 'transfer',\n [IVR_NODE_HANGUP]: 'phone-hang-up',\n};\n\nexport const IVR_NODE_LABELS = {\n [IVR_NODE_PROMPT_MENU]: 'Menu',\n [IVR_NODE_PROMPT_COLLECT]: 'Collect',\n [IVR_NODE_PROMPT_PLAY]: 'Play',\n [IVR_NODE_EXPERT]: 'Expert',\n [IVR_NODE_BRANCH]: 'Branch',\n [IVR_NODE_GO_TO]: 'Go-to',\n [IVR_NODE_TRANSFER]: 'Transfer',\n [IVR_NODE_HANGUP]: 'Hangup',\n};\n\nconst IVR_NODE_COLORS = {\n PROMPT: {\n normal: 'd-bc-blue-200',\n selected: 'd-bc-blue-300',\n },\n LOGIC: {\n normal: 'd-bc-purple-200',\n selected: 'd-bc-purple-400',\n },\n TERMINAL: {\n normal: 'd-bc-red-100',\n selected: 'd-bc-red-200',\n },\n};\n\nexport const IVR_NODE_COLOR_MAPPING = {\n [IVR_NODE_PROMPT_MENU]: IVR_NODE_COLORS.PROMPT,\n [IVR_NODE_PROMPT_COLLECT]: IVR_NODE_COLORS.PROMPT,\n [IVR_NODE_PROMPT_PLAY]: IVR_NODE_COLORS.PROMPT,\n [IVR_NODE_EXPERT]: IVR_NODE_COLORS.LOGIC,\n [IVR_NODE_BRANCH]: IVR_NODE_COLORS.LOGIC,\n [IVR_NODE_GO_TO]: IVR_NODE_COLORS.LOGIC,\n [IVR_NODE_TRANSFER]: IVR_NODE_COLORS.TERMINAL,\n [IVR_NODE_HANGUP]: IVR_NODE_COLORS.TERMINAL,\n};\n","<template>\n <div\n class=\"ivr_node\"\n v-on=\"nodeListeners\"\n >\n <div\n v-if=\"dtmfKey\"\n data-qa=\"dt-top-connector-dtmf\"\n class=\"ivr-connector ivr-connector--dtmf\"\n :class=\"{ 'ivr-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=\"ivr-connector\"\n :class=\"{ 'ivr-connector--selected': isSelected }\"\n />\n <dt-card\n content-class=\"d-bt d-bc-black-300 d-px12 d-pt8 d-pb12\"\n :container-class=\"[\n 'd-w100p',\n { 'd-ba d-bar8 d-baw4': isSelected },\n headerColor,\n ]\"\n :header-class=\"[\n 'd-mtn1',\n 'd-bt',\n 'd-btw4',\n 'd-p0',\n headerColor,\n { 'd-btr4': !isSelected },\n ]\"\n >\n <template #header>\n <!-- node label and icon section on left of the header -->\n <div class=\"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 <dt-icon\n :name=\"nodeIcon\"\n size=\"200\"\n :class=\"['', { 'ivr_node__goto_icon': isGotoNode }]\"\n />\n </template>\n </dt-button>\n <p\n class=\"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 v-model:open=\"isOpen\"\n placement=\"bottom\"\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\n name=\"more-vertical\"\n size=\"200\"\n />\n </template>\n </dt-button>\n </template>\n <template #list=\"{ close }\">\n <div class=\"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 { DtIcon } from '@/components/icon';\nimport {\n IVR_NODE_ICON_TYPES, IVR_NODE_COLOR_MAPPING, IVR_NODE_GO_TO,\n} from './ivr_node_constants';\n\nexport default {\n name: 'DtRecipeIvrNode',\n\n components: {\n DtCard,\n DtButton,\n DtDropdown,\n DtIcon,\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 nodeListeners () {\n return {\n click: (e) => this.$emit('click', e),\n };\n },\n\n nodeIcon () {\n return IVR_NODE_ICON_TYPES[this.nodeType];\n },\n\n headerColor () {\n const { normal, selected } = IVR_NODE_COLOR_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\n<style lang=\"less\">\n.ivr_node {\n width: 280px;\n display: flex;\n flex-direction: column;\n align-items: center;\n cursor: pointer;\n\n &__header-left {\n display: flex;\n align-items: center;\n }\n\n &__label {\n font-size: var(--dt-font-size-200);\n font-weight: var(--dt-font-weight-bold);\n }\n\n &__dropdown-list {\n width: var(--dt-size-825);\n }\n}\n\n.ivr_node__goto_icon {\n transform: rotate(90deg);\n}\n\n.ivr-connector {\n z-index: var(--zi-base);\n display: flex;\n justify-content: center;\n align-items: center;\n border-color: var(--dt-color-purple-600);\n background-color: var(--dt-color-purple-600);\n width: var(--dt-size-400);\n height: var(--dt-size-400);\n border-radius: var(--dt-size-radius-circle);\n margin-bottom: var(--dt-space-300-negative);\n\n &--selected {\n margin-bottom: var(--dt-space-400-negative);\n }\n\n &.ivr-connector--dtmf {\n width: var(--dt-size-550);\n height: var(--dt-size-550);\n margin-bottom: var(--dt-space-450-negative);\n color: var(--dt-color-neutral-white);\n font-size: var(--dt-font-size-200);\n\n &--selected {\n margin-bottom: var(--dt-space-500-negative);\n }\n }\n}\n</style>\n"],"names":["IVR_NODE_PROMPT_MENU","IVR_NODE_PROMPT_COLLECT","IVR_NODE_PROMPT_PLAY","IVR_NODE_EXPERT","IVR_NODE_GO_TO","IVR_NODE_BRANCH","IVR_NODE_TRANSFER","IVR_NODE_HANGUP","IVR_NODE_ICON_TYPES","IVR_NODE_LABELS","IVR_NODE_COLORS","IVR_NODE_COLOR_MAPPING","_sfc_main","DtCard","DtButton","DtDropdown","DtIcon","e","normal","selected","_hoisted_1","_hoisted_3","_createElementBlock","_mergeProps","_toHandlers","$options","$props","_normalizeClass","_ctx","_renderSlot","_createVNode","_component_dt_card","_createElementVNode","_component_dt_button","_component_dt_icon","_hoisted_2","_toDisplayString","_component_dt_dropdown","$data","$event","_withCtx","close"],"mappings":"63BAAY,MAACA,EAAuB,aACvBC,EAA0B,gBAC1BC,EAAuB,aACvBC,EAAkB,aAClBC,EAAiB,OACjBC,EAAkB,SAClBC,EAAoB,WACpBC,EAAkB,SAElBC,EAAsB,CACjC,CAACR,CAAoB,EAAG,SACxB,CAACC,CAAuB,EAAG,SAC3B,CAACC,CAAoB,EAAG,WACxB,CAACC,CAAe,EAAG,cACnB,CAACE,CAAe,EAAG,SACnB,CAACD,CAAc,EAAG,aAClB,CAACE,CAAiB,EAAG,WACrB,CAACC,CAAe,EAAG,eACrB,EAEaE,EAAkB,CAC7B,CAACT,CAAoB,EAAG,OACxB,CAACC,CAAuB,EAAG,UAC3B,CAACC,CAAoB,EAAG,OACxB,CAACC,CAAe,EAAG,SACnB,CAACE,CAAe,EAAG,SACnB,CAACD,CAAc,EAAG,QAClB,CAACE,CAAiB,EAAG,WACrB,CAACC,CAAe,EAAG,QACrB,EAEMG,EAAkB,CACtB,OAAQ,CACN,OAAQ,gBACR,SAAU,eACX,EACD,MAAO,CACL,OAAQ,kBACR,SAAU,iBACX,EACD,SAAU,CACR,OAAQ,eACR,SAAU,cACX,CACH,EAEaC,EAAyB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KM,MALNX,EAKM,CAJJQ,EAGE,WAAAD,EAAA,OAAA,YAAA,CADC,MAAOa,EAAK,yBAMZ,kBACT,IAAuB,CAAvBZ,aAAuBD,EAAA,OAAA,SAAA"}
|
package/dist/lib/ivr-node.js
CHANGED
|
@@ -18,7 +18,6 @@ import "./lazy-show.js";
|
|
|
18
18
|
import "@dialpad/dialtone-icons/vue3";
|
|
19
19
|
import "../chunks/icon_constants-OpYAAKwF.js";
|
|
20
20
|
import "@dialpad/dialtone-icons/icons.json";
|
|
21
|
-
import "./skeleton.js";
|
|
22
21
|
import "../chunks/list_item_constants-LTUc74pD.js";
|
|
23
22
|
const b = "promptmenu", R = "promptcollect", N = "promptplay", I = "gotoexpert", i = "goto", f = "branch", h = "transfer", E = "hangup", w = {
|
|
24
23
|
[b]: "keypad",
|
|
@@ -29,7 +28,7 @@ const b = "promptmenu", R = "promptcollect", N = "promptplay", I = "gotoexpert",
|
|
|
29
28
|
[i]: "call-merge",
|
|
30
29
|
[h]: "transfer",
|
|
31
30
|
[E]: "phone-hang-up"
|
|
32
|
-
},
|
|
31
|
+
}, pe = {
|
|
33
32
|
[b]: "Menu",
|
|
34
33
|
[R]: "Collect",
|
|
35
34
|
[N]: "Play",
|
|
@@ -230,15 +229,15 @@ function z(t, c, e, U, v, n) {
|
|
|
230
229
|
}, 8, ["container-class", "header-class"])
|
|
231
230
|
], 16);
|
|
232
231
|
}
|
|
233
|
-
const
|
|
232
|
+
const _e = /* @__PURE__ */ V(q, [["render", z]]);
|
|
234
233
|
export {
|
|
235
|
-
|
|
234
|
+
_e as DtRecipeIvrNode,
|
|
236
235
|
f as IVR_NODE_BRANCH,
|
|
237
236
|
I as IVR_NODE_EXPERT,
|
|
238
237
|
i as IVR_NODE_GO_TO,
|
|
239
238
|
E as IVR_NODE_HANGUP,
|
|
240
239
|
w as IVR_NODE_ICON_TYPES,
|
|
241
|
-
|
|
240
|
+
pe as IVR_NODE_LABELS,
|
|
242
241
|
R as IVR_NODE_PROMPT_COLLECT,
|
|
243
242
|
b as IVR_NODE_PROMPT_MENU,
|
|
244
243
|
N as IVR_NODE_PROMPT_PLAY,
|