@dialpad/dialtone 9.84.1 → 9.85.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/css/dialtone-default-theme.css +4299 -4053
- package/dist/css/dialtone-default-theme.min.css +1 -1
- package/dist/css/dialtone.css +2290 -2044
- package/dist/css/dialtone.min.css +1 -1
- package/dist/css/tokens/tokens-dp-dark.css +7 -7
- package/dist/css/tokens/tokens-expressive-dark.css +7 -7
- package/dist/css/tokens/tokens-expressive-sm-dark.css +7 -7
- package/dist/css/tokens/tokens-tmo-dark.css +7 -7
- package/dist/tokens/css/tokens-dp-dark.css +7 -7
- package/dist/tokens/css/tokens-expressive-dark.css +7 -7
- package/dist/tokens/css/tokens-expressive-sm-dark.css +7 -7
- package/dist/tokens/css/tokens-tmo-dark.css +7 -7
- package/dist/tokens/doc.json +12182 -12182
- package/dist/tokens/less/tokens-dp-dark.less +1 -1
- package/dist/tokens/less/tokens-expressive-dark.less +1 -1
- package/dist/tokens/less/tokens-expressive-sm-dark.less +1 -1
- package/dist/tokens/less/tokens-tmo-dark.less +1 -1
- package/dist/tokens/themes/dp-dark.cjs +1 -1
- package/dist/tokens/themes/dp-dark.js +1 -1
- package/dist/tokens/themes/expressive-dark.cjs +1 -1
- package/dist/tokens/themes/expressive-dark.js +1 -1
- package/dist/tokens/themes/expressive-sm-dark.cjs +1 -1
- package/dist/tokens/themes/expressive-sm-dark.js +1 -1
- package/dist/tokens/themes/tmo-dark.cjs +1 -1
- package/dist/tokens/themes/tmo-dark.js +1 -1
- package/dist/tokens/tokens-dp-dark.json +1 -1
- package/dist/tokens/tokens-expressive-dark.json +1 -1
- package/dist/tokens/tokens-expressive-sm-dark.json +1 -1
- package/dist/tokens/tokens-tmo-dark.json +1 -1
- package/dist/vue2/component-documentation.json +1 -1
- package/dist/vue2/components/avatar/avatar.vue.cjs +0 -1
- package/dist/vue2/components/avatar/avatar.vue.cjs.map +1 -1
- package/dist/vue2/components/avatar/avatar.vue.js +0 -1
- package/dist/vue2/components/avatar/avatar.vue.js.map +1 -1
- package/dist/vue2/components/collapsible/collapsible_lazy_show.vue.cjs +1 -2
- package/dist/vue2/components/collapsible/collapsible_lazy_show.vue.cjs.map +1 -1
- package/dist/vue2/components/collapsible/collapsible_lazy_show.vue.js +1 -2
- package/dist/vue2/components/collapsible/collapsible_lazy_show.vue.js.map +1 -1
- package/dist/vue2/components/combobox/combobox_empty-list.vue.cjs +1 -2
- package/dist/vue2/components/combobox/combobox_empty-list.vue.cjs.map +1 -1
- package/dist/vue2/components/combobox/combobox_empty-list.vue.js +1 -2
- package/dist/vue2/components/combobox/combobox_empty-list.vue.js.map +1 -1
- package/dist/vue2/components/description_list/description_list.vue.cjs +5 -6
- package/dist/vue2/components/description_list/description_list.vue.cjs.map +1 -1
- package/dist/vue2/components/description_list/description_list.vue.js +5 -6
- package/dist/vue2/components/description_list/description_list.vue.js.map +1 -1
- package/dist/vue2/components/dropdown/dropdown.vue.cjs +0 -1
- package/dist/vue2/components/dropdown/dropdown.vue.cjs.map +1 -1
- package/dist/vue2/components/dropdown/dropdown.vue.js +0 -1
- package/dist/vue2/components/dropdown/dropdown.vue.js.map +1 -1
- package/dist/vue2/components/dropdown/dropdown_separator.vue.cjs +1 -2
- package/dist/vue2/components/dropdown/dropdown_separator.vue.cjs.map +1 -1
- package/dist/vue2/components/dropdown/dropdown_separator.vue.js +1 -2
- package/dist/vue2/components/dropdown/dropdown_separator.vue.js.map +1 -1
- package/dist/vue2/components/item_layout/item_layout.vue.cjs +1 -1
- package/dist/vue2/components/item_layout/item_layout.vue.cjs.map +1 -1
- package/dist/vue2/components/item_layout/item_layout.vue.js +1 -1
- package/dist/vue2/components/item_layout/item_layout.vue.js.map +1 -1
- package/dist/vue2/components/list_item/list_item.vue.cjs +5 -6
- package/dist/vue2/components/list_item/list_item.vue.cjs.map +1 -1
- package/dist/vue2/components/list_item/list_item.vue.js +5 -6
- package/dist/vue2/components/list_item/list_item.vue.js.map +1 -1
- package/dist/vue2/components/rich_text_editor/extensions/mentions/MentionSuggestion.vue.cjs +2 -3
- package/dist/vue2/components/rich_text_editor/extensions/mentions/MentionSuggestion.vue.cjs.map +1 -1
- package/dist/vue2/components/rich_text_editor/extensions/mentions/MentionSuggestion.vue.js +2 -3
- package/dist/vue2/components/rich_text_editor/extensions/mentions/MentionSuggestion.vue.js.map +1 -1
- package/dist/vue2/components/rich_text_editor/extensions/suggestion/SuggestionList.vue.cjs +4 -5
- package/dist/vue2/components/rich_text_editor/extensions/suggestion/SuggestionList.vue.cjs.map +1 -1
- package/dist/vue2/components/rich_text_editor/extensions/suggestion/SuggestionList.vue.js +4 -5
- package/dist/vue2/components/rich_text_editor/extensions/suggestion/SuggestionList.vue.js.map +1 -1
- package/dist/vue2/components/rich_text_editor/rich_text_editor.vue.cjs +13 -48
- package/dist/vue2/components/rich_text_editor/rich_text_editor.vue.cjs.map +1 -1
- package/dist/vue2/components/rich_text_editor/rich_text_editor.vue.js +13 -48
- package/dist/vue2/components/rich_text_editor/rich_text_editor.vue.js.map +1 -1
- package/dist/vue2/components/skeleton/skeleton-shape.vue.cjs +2 -2
- package/dist/vue2/components/skeleton/skeleton-shape.vue.cjs.map +1 -1
- package/dist/vue2/components/skeleton/skeleton-shape.vue.js +2 -2
- package/dist/vue2/components/skeleton/skeleton-shape.vue.js.map +1 -1
- package/dist/vue2/components/skeleton/skeleton-text.vue.cjs +4 -4
- package/dist/vue2/components/skeleton/skeleton-text.vue.cjs.map +1 -1
- package/dist/vue2/components/skeleton/skeleton-text.vue.js +4 -4
- package/dist/vue2/components/skeleton/skeleton-text.vue.js.map +1 -1
- package/dist/vue2/components/skeleton/skeleton.vue.cjs +0 -1
- package/dist/vue2/components/skeleton/skeleton.vue.cjs.map +1 -1
- package/dist/vue2/components/skeleton/skeleton.vue.js +0 -1
- package/dist/vue2/components/skeleton/skeleton.vue.js.map +1 -1
- package/dist/vue2/components/tooltip/tooltip.vue.cjs +0 -1
- package/dist/vue2/components/tooltip/tooltip.vue.cjs.map +1 -1
- package/dist/vue2/components/tooltip/tooltip.vue.js +0 -1
- package/dist/vue2/components/tooltip/tooltip.vue.js.map +1 -1
- package/dist/vue2/recipes/comboboxes/combobox_multi_select/combobox_multi_select.vue.cjs +2 -1
- package/dist/vue2/recipes/comboboxes/combobox_multi_select/combobox_multi_select.vue.cjs.map +1 -1
- package/dist/vue2/recipes/comboboxes/combobox_multi_select/combobox_multi_select.vue.js +2 -1
- package/dist/vue2/recipes/comboboxes/combobox_multi_select/combobox_multi_select.vue.js.map +1 -1
- package/dist/vue2/recipes/conversation_view/editor/editor.vue.cjs +1 -8
- package/dist/vue2/recipes/conversation_view/editor/editor.vue.cjs.map +1 -1
- package/dist/vue2/recipes/conversation_view/editor/editor.vue.js +1 -8
- package/dist/vue2/recipes/conversation_view/editor/editor.vue.js.map +1 -1
- package/dist/vue2/recipes/conversation_view/feed_item_pill/feed_item_pill.vue.cjs +1 -1
- package/dist/vue2/recipes/conversation_view/feed_item_pill/feed_item_pill.vue.cjs.map +1 -1
- package/dist/vue2/recipes/conversation_view/feed_item_pill/feed_item_pill.vue.js +1 -1
- package/dist/vue2/recipes/conversation_view/feed_item_pill/feed_item_pill.vue.js.map +1 -1
- package/dist/vue2/recipes/conversation_view/feed_item_row/feed_item_row.vue.cjs +1 -1
- package/dist/vue2/recipes/conversation_view/feed_item_row/feed_item_row.vue.cjs.map +1 -1
- package/dist/vue2/recipes/conversation_view/feed_item_row/feed_item_row.vue.js +1 -1
- package/dist/vue2/recipes/conversation_view/feed_item_row/feed_item_row.vue.js.map +1 -1
- package/dist/vue2/recipes/item_layout/contact_info/contact_info.vue.cjs +1 -1
- package/dist/vue2/recipes/item_layout/contact_info/contact_info.vue.cjs.map +1 -1
- package/dist/vue2/recipes/item_layout/contact_info/contact_info.vue.js +1 -1
- package/dist/vue2/recipes/item_layout/contact_info/contact_info.vue.js.map +1 -1
- package/dist/vue2/style.css +53 -286
- package/dist/vue2/types/components/collapsible/collapsible_lazy_show.vue.d.ts.map +1 -1
- package/dist/vue2/types/components/rich_text_editor/rich_text_editor.vue.d.ts +0 -10
- package/dist/vue2/types/components/rich_text_editor/rich_text_editor.vue.d.ts.map +1 -1
- package/dist/vue2/types/recipes/conversation_view/editor/editor.vue.d.ts +0 -9
- package/dist/vue2/types/recipes/conversation_view/editor/editor.vue.d.ts.map +1 -1
- package/dist/vue3/component-documentation.json +1 -1
- package/dist/vue3/components/avatar/avatar.vue.cjs +0 -1
- package/dist/vue3/components/avatar/avatar.vue.cjs.map +1 -1
- package/dist/vue3/components/avatar/avatar.vue.js +0 -1
- package/dist/vue3/components/avatar/avatar.vue.js.map +1 -1
- package/dist/vue3/components/collapsible/collapsible_lazy_show.vue.cjs +2 -3
- package/dist/vue3/components/collapsible/collapsible_lazy_show.vue.cjs.map +1 -1
- package/dist/vue3/components/collapsible/collapsible_lazy_show.vue.js +2 -3
- package/dist/vue3/components/collapsible/collapsible_lazy_show.vue.js.map +1 -1
- package/dist/vue3/components/combobox/combobox_empty-list.vue.cjs +1 -2
- package/dist/vue3/components/combobox/combobox_empty-list.vue.cjs.map +1 -1
- package/dist/vue3/components/combobox/combobox_empty-list.vue.js +1 -2
- package/dist/vue3/components/combobox/combobox_empty-list.vue.js.map +1 -1
- package/dist/vue3/components/description_list/description_list.vue.cjs +5 -6
- package/dist/vue3/components/description_list/description_list.vue.cjs.map +1 -1
- package/dist/vue3/components/description_list/description_list.vue.js +5 -6
- package/dist/vue3/components/description_list/description_list.vue.js.map +1 -1
- package/dist/vue3/components/dropdown/dropdown.vue.cjs +0 -1
- package/dist/vue3/components/dropdown/dropdown.vue.cjs.map +1 -1
- package/dist/vue3/components/dropdown/dropdown.vue.js +0 -1
- package/dist/vue3/components/dropdown/dropdown.vue.js.map +1 -1
- package/dist/vue3/components/dropdown/dropdown_separator.vue.cjs +1 -2
- package/dist/vue3/components/dropdown/dropdown_separator.vue.cjs.map +1 -1
- package/dist/vue3/components/dropdown/dropdown_separator.vue.js +1 -2
- package/dist/vue3/components/dropdown/dropdown_separator.vue.js.map +1 -1
- package/dist/vue3/components/item_layout/item_layout.vue.cjs +16 -16
- package/dist/vue3/components/item_layout/item_layout.vue.cjs.map +1 -1
- package/dist/vue3/components/item_layout/item_layout.vue.js +16 -16
- package/dist/vue3/components/item_layout/item_layout.vue.js.map +1 -1
- package/dist/vue3/components/list_item/list_item.vue.cjs +5 -6
- package/dist/vue3/components/list_item/list_item.vue.cjs.map +1 -1
- package/dist/vue3/components/list_item/list_item.vue.js +5 -6
- package/dist/vue3/components/list_item/list_item.vue.js.map +1 -1
- package/dist/vue3/components/rich_text_editor/extensions/mentions/MentionSuggestion.vue.cjs +2 -3
- package/dist/vue3/components/rich_text_editor/extensions/mentions/MentionSuggestion.vue.cjs.map +1 -1
- package/dist/vue3/components/rich_text_editor/extensions/mentions/MentionSuggestion.vue.js +2 -3
- package/dist/vue3/components/rich_text_editor/extensions/mentions/MentionSuggestion.vue.js.map +1 -1
- package/dist/vue3/components/rich_text_editor/extensions/suggestion/SuggestionList.vue.cjs +5 -6
- package/dist/vue3/components/rich_text_editor/extensions/suggestion/SuggestionList.vue.cjs.map +1 -1
- package/dist/vue3/components/rich_text_editor/extensions/suggestion/SuggestionList.vue.js +5 -6
- package/dist/vue3/components/rich_text_editor/extensions/suggestion/SuggestionList.vue.js.map +1 -1
- package/dist/vue3/components/rich_text_editor/rich_text_editor.vue.cjs +14 -49
- package/dist/vue3/components/rich_text_editor/rich_text_editor.vue.cjs.map +1 -1
- package/dist/vue3/components/rich_text_editor/rich_text_editor.vue.js +14 -49
- package/dist/vue3/components/rich_text_editor/rich_text_editor.vue.js.map +1 -1
- package/dist/vue3/components/scroller/modules/core_scroller.vue.cjs +0 -1
- package/dist/vue3/components/scroller/modules/core_scroller.vue.cjs.map +1 -1
- package/dist/vue3/components/scroller/modules/core_scroller.vue.js +0 -1
- package/dist/vue3/components/scroller/modules/core_scroller.vue.js.map +1 -1
- package/dist/vue3/components/skeleton/skeleton-shape.vue.cjs +2 -2
- package/dist/vue3/components/skeleton/skeleton-shape.vue.cjs.map +1 -1
- package/dist/vue3/components/skeleton/skeleton-shape.vue.js +2 -2
- package/dist/vue3/components/skeleton/skeleton-shape.vue.js.map +1 -1
- package/dist/vue3/components/skeleton/skeleton-text.vue.cjs +4 -4
- package/dist/vue3/components/skeleton/skeleton-text.vue.cjs.map +1 -1
- package/dist/vue3/components/skeleton/skeleton-text.vue.js +4 -4
- package/dist/vue3/components/skeleton/skeleton-text.vue.js.map +1 -1
- package/dist/vue3/components/skeleton/skeleton.vue.cjs +0 -1
- package/dist/vue3/components/skeleton/skeleton.vue.cjs.map +1 -1
- package/dist/vue3/components/skeleton/skeleton.vue.js +0 -1
- package/dist/vue3/components/skeleton/skeleton.vue.js.map +1 -1
- package/dist/vue3/components/tooltip/tooltip.vue.cjs +0 -1
- package/dist/vue3/components/tooltip/tooltip.vue.cjs.map +1 -1
- package/dist/vue3/components/tooltip/tooltip.vue.js +0 -1
- package/dist/vue3/components/tooltip/tooltip.vue.js.map +1 -1
- package/dist/vue3/recipes/comboboxes/combobox_multi_select/combobox_multi_select.vue.cjs +2 -1
- package/dist/vue3/recipes/comboboxes/combobox_multi_select/combobox_multi_select.vue.cjs.map +1 -1
- package/dist/vue3/recipes/comboboxes/combobox_multi_select/combobox_multi_select.vue.js +2 -1
- package/dist/vue3/recipes/comboboxes/combobox_multi_select/combobox_multi_select.vue.js.map +1 -1
- package/dist/vue3/recipes/conversation_view/editor/editor.vue.cjs +1 -9
- package/dist/vue3/recipes/conversation_view/editor/editor.vue.cjs.map +1 -1
- package/dist/vue3/recipes/conversation_view/editor/editor.vue.js +1 -9
- package/dist/vue3/recipes/conversation_view/editor/editor.vue.js.map +1 -1
- package/dist/vue3/recipes/conversation_view/feed_item_pill/feed_item_pill.vue.cjs +1 -1
- package/dist/vue3/recipes/conversation_view/feed_item_pill/feed_item_pill.vue.cjs.map +1 -1
- package/dist/vue3/recipes/conversation_view/feed_item_pill/feed_item_pill.vue.js +1 -1
- package/dist/vue3/recipes/conversation_view/feed_item_pill/feed_item_pill.vue.js.map +1 -1
- package/dist/vue3/recipes/conversation_view/feed_item_row/feed_item_row.vue.cjs +1 -1
- package/dist/vue3/recipes/conversation_view/feed_item_row/feed_item_row.vue.cjs.map +1 -1
- package/dist/vue3/recipes/conversation_view/feed_item_row/feed_item_row.vue.js +1 -1
- package/dist/vue3/recipes/conversation_view/feed_item_row/feed_item_row.vue.js.map +1 -1
- package/dist/vue3/recipes/item_layout/contact_info/contact_info.vue.cjs +1 -1
- package/dist/vue3/recipes/item_layout/contact_info/contact_info.vue.cjs.map +1 -1
- package/dist/vue3/recipes/item_layout/contact_info/contact_info.vue.js +1 -1
- package/dist/vue3/recipes/item_layout/contact_info/contact_info.vue.js.map +1 -1
- package/dist/vue3/style.css +54 -327
- package/dist/vue3/types/components/avatar/avatar.vue.d.ts.map +1 -1
- package/dist/vue3/types/components/collapsible/collapsible_lazy_show.vue.d.ts.map +1 -1
- package/dist/vue3/types/components/rich_text_editor/rich_text_editor.vue.d.ts +0 -10
- package/dist/vue3/types/components/rich_text_editor/rich_text_editor.vue.d.ts.map +1 -1
- package/dist/vue3/types/components/scroller/modules/core_scroller.vue.d.ts.map +1 -1
- package/dist/vue3/types/components/tooltip/tooltip.vue.d.ts.map +1 -1
- package/dist/vue3/types/recipes/conversation_view/editor/editor.vue.d.ts +0 -9
- package/dist/vue3/types/recipes/conversation_view/editor/editor.vue.d.ts.map +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dropdown.vue.js","sources":["../../../components/dropdown/dropdown.vue"],"sourcesContent":["<!-- eslint-disable max-lines -->\n<template>\n <dt-popover\n ref=\"popover\"\n :content-width=\"contentWidth\"\n :open=\"open\"\n :placement=\"placement\"\n :initial-focus-element=\"openedWithKeyboard ? 'first' : 'dialog'\"\n :fallback-placements=\"fallbackPlacements\"\n padding=\"none\"\n role=\"menu\"\n :append-to=\"appendTo\"\n :modal=\"modal\"\n :max-height=\"maxHeight\"\n :max-width=\"maxWidth\"\n :open-with-arrow-keys=\"shouldOpenWithArrowKeys\"\n :open-on-context=\"openOnContext\"\n :tether=\"tether\"\n :transition=\"transition\"\n v-on=\"dropdownListeners\"\n >\n <template #anchor=\"{ attrs }\">\n <!-- @slot Anchor element that activates the dropdown -->\n <slot\n ref=\"anchor\"\n name=\"anchor\"\n v-bind=\"attrs\"\n />\n </template>\n <template #content=\"{ close }\">\n <!-- eslint-disable-next-line max-len -->\n <!-- eslint-disable-next-line vuejs-accessibility/mouse-events-have-key-events, vuejs-accessibility/no-static-element-interactions -->\n <ul\n :id=\"listId\"\n ref=\"listWrapper\"\n :class=\"listClasses\"\n data-qa=\"dt-dropdown-list-wrapper\"\n @mouseleave=\"clearHighlightIndex\"\n @mousemove.capture=\"onMouseHighlight\"\n >\n <!-- @slot Slot for the list component -->\n <slot\n name=\"list\"\n :close=\"close\"\n />\n <sr-only-close-button\n v-if=\"showVisuallyHiddenClose\"\n :visually-hidden-close-label=\"visuallyHiddenCloseLabel\"\n :tabindex=\"isArrowKeyNav ? -1 : 0\"\n @close=\"close\"\n />\n </ul>\n </template>\n </dt-popover>\n</template>\n\n<script>\nimport KeyboardNavigation from '@/common/mixins/keyboard_list_navigation';\nimport { DtPopover, POPOVER_APPEND_TO_VALUES } from '@/components/popover';\nimport { LIST_ITEM_NAVIGATION_TYPES } from '@/components/list_item';\nimport { DROPDOWN_PADDING_CLASSES } from './dropdown_constants';\nimport { getUniqueString } from '@/common/utils';\nimport { EVENT_KEYNAMES } from '@/common/constants';\nimport SrOnlyCloseButtonMixin from '@/common/mixins/sr_only_close_button';\nimport SrOnlyCloseButton from '@/common/sr_only_close_button.vue';\n\nexport default {\n name: 'DtDropdown',\n\n components: {\n DtPopover,\n SrOnlyCloseButton,\n },\n\n mixins: [\n KeyboardNavigation({\n indexKey: 'highlightIndex',\n idKey: 'highlightId',\n listElementKey: 'getListElement',\n listItemRole: 'menuitem',\n afterHighlightMethod: 'afterHighlight',\n beginningOfListMethod: 'beginningOfListMethod',\n endOfListMethod: 'endOfListMethod',\n activeItemKey: 'activeItemEl',\n focusOnKeyboardNavigation: true,\n }),\n SrOnlyCloseButtonMixin,\n ],\n\n props: {\n /**\n * Controls whether the dropdown is shown. Leaving this null will have the dropdown 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 */\n open: {\n type: Boolean,\n default: null,\n },\n\n /**\n * Opens the dropdown on right click (context menu). If you set this value to `true`,\n * the default trigger behavior will be disabled.\n */\n openOnContext: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Vertical padding size around the list element.\n * @values none, small, large\n */\n padding: {\n type: String,\n default: 'small',\n validator: (padding) => {\n return Object.keys(DROPDOWN_PADDING_CLASSES).some((item) => item === padding);\n },\n },\n\n /**\n * Determines modal state, dropdown has a modal overlay preventing interaction with elements\n * below it, but it is invisible.\n */\n modal: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Width configuration for the popover content. When its value is 'anchor',\n * the popover content will have the same width as the anchor.\n * @values null, anchor\n */\n contentWidth: {\n type: String,\n default: null,\n },\n\n /**\n * Determines maximum height for the popover before overflow.\n * Possible units rem|px|em\n */\n maxHeight: {\n type: String,\n default: '',\n },\n\n /**\n * Determines maximum width for the popover before overflow.\n * Possible units rem|px|%|em\n */\n maxWidth: {\n type: String,\n default: '',\n },\n\n /**\n * Sets an ID on the list element of the component. Used by several aria attributes\n * as well as when deriving the IDs for each item.\n */\n listId: {\n type: String,\n default () { return getUniqueString(); },\n },\n\n /**\n * The type of navigation that this component should support.\n * - \"arrow-keys\" for items that are navigated with UP/DOWN keys.\n * - \"tab\" for items that are navigated using the TAB key.\n * - \"none\" for static items that are not interactive.\n * @values arrow-keys, tab, none\n */\n navigationType: {\n type: String,\n default: LIST_ITEM_NAVIGATION_TYPES.ARROW_KEYS,\n validator: (t) => Object.values(LIST_ITEM_NAVIGATION_TYPES).includes(t),\n },\n\n /**\n * If the dropdown does not fit in the direction described by \"placement\",\n * it will attempt to change it's direction to the \"fallbackPlacements\".\n *\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 fallbackPlacements: {\n type: Array,\n default: () => {\n return ['auto'];\n },\n },\n\n /**\n * The direction the dropdown displays relative to the anchor.\n */\n placement: {\n type: String,\n default: 'bottom',\n },\n\n /**\n * A method that will be called when the selection goes past the beginning of the list.\n */\n onBeginningOfList: {\n type: Function,\n default: null,\n },\n\n /**\n * A method that will be called when the selection goes past the end of the list.\n */\n onEndOfList: {\n type: Function,\n default: null,\n },\n\n /**\n * Additional class for the wrapper list element.\n */\n listClass: {\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 /**\n * If set to false the dialog will display over top of the anchor when there is insufficient space.\n * If set to true it will never move from its position relative to the anchor and will clip instead.\n * <a\n * class=\"d-link\"\n * href=\"https://popper.js.org/docs/v2/modifiers/prevent-overflow/#tether\"\n * target=\"_blank\"\n * >\n * Popper.js docs\n * </a>\n * @values true, false\n */\n tether: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Named transition when the content display is toggled.\n * @see DtLazyShow\n */\n transition: {\n type: String,\n default: 'fade',\n },\n },\n\n emits: [\n /**\n * Event fired when the highlight changes\n *\n * @event highlight\n * @type {Number}\n */\n 'highlight',\n\n /**\n * Event fired when dropdown is shown or hidden\n *\n * @event opened\n * @type {Boolean | Array}\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 LIST_ITEM_NAVIGATION_TYPES,\n DROPDOWN_PADDING_CLASSES,\n EVENT_KEYNAMES,\n openedWithKeyboard: false,\n isOpen: null,\n };\n },\n\n computed: {\n dropdownListeners () {\n return {\n ...this.$listeners,\n\n opened: isPopoverOpen => {\n this.updateInitialHighlightIndex(isPopoverOpen);\n },\n\n keydown: event => {\n const eventCode = event.code;\n\n switch (eventCode) {\n case EVENT_KEYNAMES.up:\n case EVENT_KEYNAMES.arrowup:\n this.onUpKeyPress(event);\n event.stopPropagation();\n event.preventDefault();\n break;\n case EVENT_KEYNAMES.down:\n case EVENT_KEYNAMES.arrowdown:\n this.onDownKeyPress(event);\n event.stopPropagation();\n event.preventDefault();\n break;\n case EVENT_KEYNAMES.space:\n case EVENT_KEYNAMES.spacebar:\n this.onSpaceKey();\n break;\n case EVENT_KEYNAMES.enter:\n this.onEnterKey();\n break;\n case EVENT_KEYNAMES.home:\n this.onHomeKeyPress(event);\n event.stopPropagation();\n event.preventDefault();\n break;\n case EVENT_KEYNAMES.end:\n this.onEndKeyPress(event);\n event.stopPropagation();\n event.preventDefault();\n break;\n default:\n this.onKeyPress(event);\n break;\n }\n\n this.$emit('keydown', event);\n },\n };\n },\n\n beginningOfListMethod () {\n return this.onBeginningOfList || this.jumpToEnd;\n },\n\n endOfListMethod () {\n return this.onEndOfList || this.jumpToBeginning;\n },\n\n activeItemEl () {\n return this.getListElement().querySelector('#' + this.highlightId);\n },\n\n isArrowKeyNav () {\n return this.navigationType === this.LIST_ITEM_NAVIGATION_TYPES.ARROW_KEYS;\n },\n\n listClasses () {\n return [\n 'd-dropdown-list',\n DROPDOWN_PADDING_CLASSES[this.padding],\n this.listClass,\n { 'd-context-menu-list': this.openOnContext },\n ];\n },\n\n shouldOpenWithArrowKeys () {\n return !this.openOnContext;\n },\n },\n\n methods: {\n onMouseHighlight (e) {\n const liElement = e.target.closest('li');\n\n if (liElement && liElement.role && this.highlightId !== liElement.id) {\n this.setHighlightId(liElement.id);\n liElement.focus();\n }\n },\n\n getListElement () {\n return this.$refs.listWrapper;\n },\n\n clearHighlightIndex () {\n this.setHighlightIndex(-1);\n },\n\n afterHighlight () {\n if (this.visuallyHiddenClose && this.highlightIndex === this._itemsLength() - 1) {\n return;\n }\n\n this.$emit('highlight', this.highlightIndex);\n },\n\n updateInitialHighlightIndex (isPopoverOpen) {\n this.isOpen = isPopoverOpen;\n\n if (isPopoverOpen) {\n if (this.openedWithKeyboard && this.isArrowKeyNav) {\n this.setHighlightIndex(0);\n }\n this.$emit('opened', true);\n } else {\n this.clearHighlightIndex();\n this.openedWithKeyboard = false;\n this.$emit('opened', false);\n }\n },\n\n onSpaceKey () {\n if (!this.open) {\n this.openedWithKeyboard = true;\n }\n },\n\n onEnterKey () {\n if (!this.open) {\n this.openedWithKeyboard = true;\n }\n },\n\n onUpKeyPress () {\n if (!this.isOpen) {\n this.openedWithKeyboard = true;\n return;\n }\n if (this.isArrowKeyNav) {\n return this.onUpKey();\n }\n },\n\n onDownKeyPress () {\n if (!this.isOpen) {\n this.openedWithKeyboard = true;\n return;\n }\n if (this.isArrowKeyNav) {\n return this.onDownKey();\n }\n },\n\n onHomeKeyPress () {\n if (!this.isOpen || !this.isArrowKeyNav) {\n return;\n }\n\n return this.onHomeKey();\n },\n\n onEndKeyPress () {\n if (!this.isOpen || !this.isArrowKeyNav) {\n return;\n }\n\n return this.onEndKey();\n },\n\n onKeyPress (e) {\n if (!this.isOpen || !this.isArrowKeyNav || !this.isValidLetter(e.key)) {\n return;\n }\n\n e.stopPropagation();\n e.preventDefault();\n\n return this.onNavigationKey(e.key);\n },\n },\n};\n</script>\n\n<style lang=\"less\">\n.d-context-menu-list {\n width: var(--dt-size-850);\n}\n.d-dropdown-list {\n position: relative;\n margin: var(--dt-space-300);\n padding-left: var(--dt-space-0);\n padding-right: var(--dt-space-0);\n >.dt-list-item {\n margin-top: var(--dt-space-200);\n }\n}\n</style>\n"],"names":[],"mappings":";;;;;;;;;;;AAkEA,MAAA,YAAA;AAAA,EACA,MAAA;AAA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AA,MACA;AACA,UAAA,KAAA,eAAA;AACA,eAAA,KAAA;MACA;AAAA,IACA;AAAA,IAEA,iBAAA;AACA,UAAA,CAAA,KAAA,UAAA,CAAA,KAAA,eAAA;AACA;AAAA,MACA;AAEA,aAAA,KAAA;IACA;AAAA,IAEA,gBAAA;AACA,UAAA,CAAA,KAAA,UAAA,CAAA,KAAA,eAAA;AACA;AAAA,MACA;AAEA,aAAA,KAAA;IACA;AAAA,IAEA,WAAA,GAAA;AACA,UAAA,CAAA,KAAA,UAAA,CAAA,KAAA,iBAAA,CAAA,KAAA,cAAA,EAAA,GAAA,GAAA;AACA;AAAA,MACA;AAEA,QAAA,gBAAA;AACA,QAAA,eAAA;AAEA,aAAA,KAAA,gBAAA,EAAA,GAAA;AAAA,IACA;AAAA,EACA;AACA;;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"dropdown.vue.js","sources":["../../../components/dropdown/dropdown.vue"],"sourcesContent":["<!-- eslint-disable max-lines -->\n<template>\n <dt-popover\n ref=\"popover\"\n :content-width=\"contentWidth\"\n :open=\"open\"\n :placement=\"placement\"\n :initial-focus-element=\"openedWithKeyboard ? 'first' : 'dialog'\"\n :fallback-placements=\"fallbackPlacements\"\n padding=\"none\"\n role=\"menu\"\n :append-to=\"appendTo\"\n :modal=\"modal\"\n :max-height=\"maxHeight\"\n :max-width=\"maxWidth\"\n :open-with-arrow-keys=\"shouldOpenWithArrowKeys\"\n :open-on-context=\"openOnContext\"\n :tether=\"tether\"\n :transition=\"transition\"\n v-on=\"dropdownListeners\"\n >\n <template #anchor=\"{ attrs }\">\n <!-- @slot Anchor element that activates the dropdown -->\n <slot\n ref=\"anchor\"\n name=\"anchor\"\n v-bind=\"attrs\"\n />\n </template>\n <template #content=\"{ close }\">\n <!-- eslint-disable-next-line max-len -->\n <!-- eslint-disable-next-line vuejs-accessibility/mouse-events-have-key-events, vuejs-accessibility/no-static-element-interactions -->\n <ul\n :id=\"listId\"\n ref=\"listWrapper\"\n :class=\"listClasses\"\n data-qa=\"dt-dropdown-list-wrapper\"\n @mouseleave=\"clearHighlightIndex\"\n @mousemove.capture=\"onMouseHighlight\"\n >\n <!-- @slot Slot for the list component -->\n <slot\n name=\"list\"\n :close=\"close\"\n />\n <sr-only-close-button\n v-if=\"showVisuallyHiddenClose\"\n :visually-hidden-close-label=\"visuallyHiddenCloseLabel\"\n :tabindex=\"isArrowKeyNav ? -1 : 0\"\n @close=\"close\"\n />\n </ul>\n </template>\n </dt-popover>\n</template>\n\n<script>\nimport KeyboardNavigation from '@/common/mixins/keyboard_list_navigation';\nimport { DtPopover, POPOVER_APPEND_TO_VALUES } from '@/components/popover';\nimport { LIST_ITEM_NAVIGATION_TYPES } from '@/components/list_item';\nimport { DROPDOWN_PADDING_CLASSES } from './dropdown_constants';\nimport { getUniqueString } from '@/common/utils';\nimport { EVENT_KEYNAMES } from '@/common/constants';\nimport SrOnlyCloseButtonMixin from '@/common/mixins/sr_only_close_button';\nimport SrOnlyCloseButton from '@/common/sr_only_close_button.vue';\n\nexport default {\n name: 'DtDropdown',\n\n components: {\n DtPopover,\n SrOnlyCloseButton,\n },\n\n mixins: [\n KeyboardNavigation({\n indexKey: 'highlightIndex',\n idKey: 'highlightId',\n listElementKey: 'getListElement',\n listItemRole: 'menuitem',\n afterHighlightMethod: 'afterHighlight',\n beginningOfListMethod: 'beginningOfListMethod',\n endOfListMethod: 'endOfListMethod',\n activeItemKey: 'activeItemEl',\n focusOnKeyboardNavigation: true,\n }),\n SrOnlyCloseButtonMixin,\n ],\n\n props: {\n /**\n * Controls whether the dropdown is shown. Leaving this null will have the dropdown 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 */\n open: {\n type: Boolean,\n default: null,\n },\n\n /**\n * Opens the dropdown on right click (context menu). If you set this value to `true`,\n * the default trigger behavior will be disabled.\n */\n openOnContext: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Vertical padding size around the list element.\n * @values none, small, large\n */\n padding: {\n type: String,\n default: 'small',\n validator: (padding) => {\n return Object.keys(DROPDOWN_PADDING_CLASSES).some((item) => item === padding);\n },\n },\n\n /**\n * Determines modal state, dropdown has a modal overlay preventing interaction with elements\n * below it, but it is invisible.\n */\n modal: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Width configuration for the popover content. When its value is 'anchor',\n * the popover content will have the same width as the anchor.\n * @values null, anchor\n */\n contentWidth: {\n type: String,\n default: null,\n },\n\n /**\n * Determines maximum height for the popover before overflow.\n * Possible units rem|px|em\n */\n maxHeight: {\n type: String,\n default: '',\n },\n\n /**\n * Determines maximum width for the popover before overflow.\n * Possible units rem|px|%|em\n */\n maxWidth: {\n type: String,\n default: '',\n },\n\n /**\n * Sets an ID on the list element of the component. Used by several aria attributes\n * as well as when deriving the IDs for each item.\n */\n listId: {\n type: String,\n default () { return getUniqueString(); },\n },\n\n /**\n * The type of navigation that this component should support.\n * - \"arrow-keys\" for items that are navigated with UP/DOWN keys.\n * - \"tab\" for items that are navigated using the TAB key.\n * - \"none\" for static items that are not interactive.\n * @values arrow-keys, tab, none\n */\n navigationType: {\n type: String,\n default: LIST_ITEM_NAVIGATION_TYPES.ARROW_KEYS,\n validator: (t) => Object.values(LIST_ITEM_NAVIGATION_TYPES).includes(t),\n },\n\n /**\n * If the dropdown does not fit in the direction described by \"placement\",\n * it will attempt to change it's direction to the \"fallbackPlacements\".\n *\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 fallbackPlacements: {\n type: Array,\n default: () => {\n return ['auto'];\n },\n },\n\n /**\n * The direction the dropdown displays relative to the anchor.\n */\n placement: {\n type: String,\n default: 'bottom',\n },\n\n /**\n * A method that will be called when the selection goes past the beginning of the list.\n */\n onBeginningOfList: {\n type: Function,\n default: null,\n },\n\n /**\n * A method that will be called when the selection goes past the end of the list.\n */\n onEndOfList: {\n type: Function,\n default: null,\n },\n\n /**\n * Additional class for the wrapper list element.\n */\n listClass: {\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 /**\n * If set to false the dialog will display over top of the anchor when there is insufficient space.\n * If set to true it will never move from its position relative to the anchor and will clip instead.\n * <a\n * class=\"d-link\"\n * href=\"https://popper.js.org/docs/v2/modifiers/prevent-overflow/#tether\"\n * target=\"_blank\"\n * >\n * Popper.js docs\n * </a>\n * @values true, false\n */\n tether: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Named transition when the content display is toggled.\n * @see DtLazyShow\n */\n transition: {\n type: String,\n default: 'fade',\n },\n },\n\n emits: [\n /**\n * Event fired when the highlight changes\n *\n * @event highlight\n * @type {Number}\n */\n 'highlight',\n\n /**\n * Event fired when dropdown is shown or hidden\n *\n * @event opened\n * @type {Boolean | Array}\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 LIST_ITEM_NAVIGATION_TYPES,\n DROPDOWN_PADDING_CLASSES,\n EVENT_KEYNAMES,\n openedWithKeyboard: false,\n isOpen: null,\n };\n },\n\n computed: {\n dropdownListeners () {\n return {\n ...this.$listeners,\n\n opened: isPopoverOpen => {\n this.updateInitialHighlightIndex(isPopoverOpen);\n },\n\n keydown: event => {\n const eventCode = event.code;\n\n switch (eventCode) {\n case EVENT_KEYNAMES.up:\n case EVENT_KEYNAMES.arrowup:\n this.onUpKeyPress(event);\n event.stopPropagation();\n event.preventDefault();\n break;\n case EVENT_KEYNAMES.down:\n case EVENT_KEYNAMES.arrowdown:\n this.onDownKeyPress(event);\n event.stopPropagation();\n event.preventDefault();\n break;\n case EVENT_KEYNAMES.space:\n case EVENT_KEYNAMES.spacebar:\n this.onSpaceKey();\n break;\n case EVENT_KEYNAMES.enter:\n this.onEnterKey();\n break;\n case EVENT_KEYNAMES.home:\n this.onHomeKeyPress(event);\n event.stopPropagation();\n event.preventDefault();\n break;\n case EVENT_KEYNAMES.end:\n this.onEndKeyPress(event);\n event.stopPropagation();\n event.preventDefault();\n break;\n default:\n this.onKeyPress(event);\n break;\n }\n\n this.$emit('keydown', event);\n },\n };\n },\n\n beginningOfListMethod () {\n return this.onBeginningOfList || this.jumpToEnd;\n },\n\n endOfListMethod () {\n return this.onEndOfList || this.jumpToBeginning;\n },\n\n activeItemEl () {\n return this.getListElement().querySelector('#' + this.highlightId);\n },\n\n isArrowKeyNav () {\n return this.navigationType === this.LIST_ITEM_NAVIGATION_TYPES.ARROW_KEYS;\n },\n\n listClasses () {\n return [\n 'd-dropdown-list',\n DROPDOWN_PADDING_CLASSES[this.padding],\n this.listClass,\n { 'd-context-menu-list': this.openOnContext },\n ];\n },\n\n shouldOpenWithArrowKeys () {\n return !this.openOnContext;\n },\n },\n\n methods: {\n onMouseHighlight (e) {\n const liElement = e.target.closest('li');\n\n if (liElement && liElement.role && this.highlightId !== liElement.id) {\n this.setHighlightId(liElement.id);\n liElement.focus();\n }\n },\n\n getListElement () {\n return this.$refs.listWrapper;\n },\n\n clearHighlightIndex () {\n this.setHighlightIndex(-1);\n },\n\n afterHighlight () {\n if (this.visuallyHiddenClose && this.highlightIndex === this._itemsLength() - 1) {\n return;\n }\n\n this.$emit('highlight', this.highlightIndex);\n },\n\n updateInitialHighlightIndex (isPopoverOpen) {\n this.isOpen = isPopoverOpen;\n\n if (isPopoverOpen) {\n if (this.openedWithKeyboard && this.isArrowKeyNav) {\n this.setHighlightIndex(0);\n }\n this.$emit('opened', true);\n } else {\n this.clearHighlightIndex();\n this.openedWithKeyboard = false;\n this.$emit('opened', false);\n }\n },\n\n onSpaceKey () {\n if (!this.open) {\n this.openedWithKeyboard = true;\n }\n },\n\n onEnterKey () {\n if (!this.open) {\n this.openedWithKeyboard = true;\n }\n },\n\n onUpKeyPress () {\n if (!this.isOpen) {\n this.openedWithKeyboard = true;\n return;\n }\n if (this.isArrowKeyNav) {\n return this.onUpKey();\n }\n },\n\n onDownKeyPress () {\n if (!this.isOpen) {\n this.openedWithKeyboard = true;\n return;\n }\n if (this.isArrowKeyNav) {\n return this.onDownKey();\n }\n },\n\n onHomeKeyPress () {\n if (!this.isOpen || !this.isArrowKeyNav) {\n return;\n }\n\n return this.onHomeKey();\n },\n\n onEndKeyPress () {\n if (!this.isOpen || !this.isArrowKeyNav) {\n return;\n }\n\n return this.onEndKey();\n },\n\n onKeyPress (e) {\n if (!this.isOpen || !this.isArrowKeyNav || !this.isValidLetter(e.key)) {\n return;\n }\n\n e.stopPropagation();\n e.preventDefault();\n\n return this.onNavigationKey(e.key);\n },\n },\n};\n</script>\n"],"names":[],"mappings":";;;;;;;;;;AAkEA,MAAA,YAAA;AAAA,EACA,MAAA;AAAA,EAEA,YAAA;AAAA,IACA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,QAAA;AAAA,IACA,mBAAA;AAAA,MACA,UAAA;AAAA,MACA,OAAA;AAAA,MACA,gBAAA;AAAA,MACA,cAAA;AAAA,MACA,sBAAA;AAAA,MACA,uBAAA;AAAA,MACA,iBAAA;AAAA,MACA,eAAA;AAAA,MACA,2BAAA;AAAA,IACA,CAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,OAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,MAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,eAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,SAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,MACA,WAAA,CAAA,YAAA;AACA,eAAA,OAAA,KAAA,wBAAA,EAAA,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.toStringTag]: { value: "Module" } });
|
|
3
|
-
;/* empty css */
|
|
4
3
|
const _pluginVue2_normalizer = require("../../_virtual/_plugin-vue2_normalizer.cjs");
|
|
5
4
|
const _sfc_main = {
|
|
6
5
|
name: "DtDropdownSeparator"
|
|
7
6
|
};
|
|
8
7
|
var _sfc_render = function render() {
|
|
9
8
|
var _vm = this, _c = _vm._self._c;
|
|
10
|
-
return _c("li", { staticClass: "
|
|
9
|
+
return _c("li", { staticClass: "d-list-item-separator", attrs: { "aria-hidden": "true" } });
|
|
11
10
|
};
|
|
12
11
|
var _sfc_staticRenderFns = [];
|
|
13
12
|
var __component__ = /* @__PURE__ */ _pluginVue2_normalizer.default(
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dropdown_separator.vue.cjs","sources":["../../../components/dropdown/dropdown_separator.vue"],"sourcesContent":["<template>\n <li\n aria-hidden=\"true\"\n class=\"
|
|
1
|
+
{"version":3,"file":"dropdown_separator.vue.cjs","sources":["../../../components/dropdown/dropdown_separator.vue"],"sourcesContent":["<template>\n <li\n aria-hidden=\"true\"\n class=\"d-list-item-separator\"\n />\n</template>\n\n<script>\nexport default {\n name: 'DtDropdownSeparator',\n};\n</script>\n"],"names":[],"mappings":";;;AAQA,MAAA,YAAA;AAAA,EACA,MAAA;AACA;;;;;;;;;;;;;;;;"}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
/* empty css */
|
|
2
1
|
import normalizeComponent from "../../_virtual/_plugin-vue2_normalizer.js";
|
|
3
2
|
const _sfc_main = {
|
|
4
3
|
name: "DtDropdownSeparator"
|
|
5
4
|
};
|
|
6
5
|
var _sfc_render = function render() {
|
|
7
6
|
var _vm = this, _c = _vm._self._c;
|
|
8
|
-
return _c("li", { staticClass: "
|
|
7
|
+
return _c("li", { staticClass: "d-list-item-separator", attrs: { "aria-hidden": "true" } });
|
|
9
8
|
};
|
|
10
9
|
var _sfc_staticRenderFns = [];
|
|
11
10
|
var __component__ = /* @__PURE__ */ normalizeComponent(
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dropdown_separator.vue.js","sources":["../../../components/dropdown/dropdown_separator.vue"],"sourcesContent":["<template>\n <li\n aria-hidden=\"true\"\n class=\"
|
|
1
|
+
{"version":3,"file":"dropdown_separator.vue.js","sources":["../../../components/dropdown/dropdown_separator.vue"],"sourcesContent":["<template>\n <li\n aria-hidden=\"true\"\n class=\"d-list-item-separator\"\n />\n</template>\n\n<script>\nexport default {\n name: 'DtDropdownSeparator',\n};\n</script>\n"],"names":[],"mappings":";AAQA,MAAA,YAAA;AAAA,EACA,MAAA;AACA;;;;;;;;;;;;;;;"}
|
|
@@ -23,7 +23,7 @@ const _sfc_main = {
|
|
|
23
23
|
};
|
|
24
24
|
var _sfc_render = function render() {
|
|
25
25
|
var _vm = this, _c = _vm._self._c;
|
|
26
|
-
return _c(_vm.as, { tag: "component", class: _vm.unstyled ? "
|
|
26
|
+
return _c(_vm.as, { tag: "component", class: _vm.unstyled ? "d-item-layout--custom" : "d-item-layout" }, [_vm.$slots.left ? _c("section", { staticClass: "d-item-layout--left", attrs: { "data-qa": "d-item-layout-left-wrapper" } }, [_vm._t("left")], 2) : _vm._e(), _c("section", { staticClass: "d-item-layout--content", attrs: { "data-qa": "d-item-layout-content-wrapper" } }, [_vm.$slots.default ? _c("div", { staticClass: "d-item-layout--title", attrs: { "data-qa": "d-item-layout-title-wrapper" } }, [_vm._t("default")], 2) : _vm._e(), _vm.$slots.subtitle ? _c("div", { class: ["d-item-layout--subtitle", { "d-item-layout--subtitle--with-title": _vm.$slots.default }], attrs: { "data-qa": "d-item-layout-subtitle-wrapper" } }, [_vm._t("subtitle")], 2) : _vm._e(), _vm.$slots.bottom ? _c("div", { staticClass: "d-item-layout--bottom", attrs: { "data-qa": "d-item-layout-bottom-wrapper" } }, [_vm._t("bottom")], 2) : _vm._e()]), _vm.$slots.right ? _c("section", { staticClass: "d-item-layout--right", attrs: { "data-qa": "d-item-layout-right-wrapper" } }, [_vm._t("right")], 2) : _vm._e(), _vm.$slots.selected ? _c("section", { staticClass: "d-item-layout--selected", attrs: { "data-qa": "d-item-layout-selected-wrapper" } }, [_vm._t("selected")], 2) : _vm._e()]);
|
|
27
27
|
};
|
|
28
28
|
var _sfc_staticRenderFns = [];
|
|
29
29
|
var __component__ = /* @__PURE__ */ _pluginVue2_normalizer.default(
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"item_layout.vue.cjs","sources":["../../../components/item_layout/item_layout.vue"],"sourcesContent":["<template>\n <component\n :is=\"as\"\n :class=\"unstyled ? '
|
|
1
|
+
{"version":3,"file":"item_layout.vue.cjs","sources":["../../../components/item_layout/item_layout.vue"],"sourcesContent":["<template>\n <component\n :is=\"as\"\n :class=\"unstyled ? 'd-item-layout--custom' : 'd-item-layout'\"\n >\n <section\n v-if=\"$slots.left\"\n data-qa=\"d-item-layout-left-wrapper\"\n class=\"d-item-layout--left\"\n >\n <!-- @slot Slot for left content -->\n <slot name=\"left\" />\n </section>\n <section\n data-qa=\"d-item-layout-content-wrapper\"\n class=\"d-item-layout--content\"\n >\n <div\n v-if=\"$slots.default\"\n data-qa=\"d-item-layout-title-wrapper\"\n class=\"d-item-layout--title\"\n >\n <!-- @slot Slot for main content -->\n <slot />\n </div>\n <div\n v-if=\"$slots.subtitle\"\n data-qa=\"d-item-layout-subtitle-wrapper\"\n :class=\"['d-item-layout--subtitle', { 'd-item-layout--subtitle--with-title': $slots.default }]\"\n >\n <!-- @slot Slot for content below main content -->\n <slot name=\"subtitle\" />\n </div>\n <div\n v-if=\"$slots.bottom\"\n data-qa=\"d-item-layout-bottom-wrapper\"\n class=\"d-item-layout--bottom\"\n >\n <!-- @slot Slot for content below subtitle -->\n <slot name=\"bottom\" />\n </div>\n </section>\n <section\n v-if=\"$slots.right\"\n data-qa=\"d-item-layout-right-wrapper\"\n class=\"d-item-layout--right\"\n >\n <!-- @slot Slot for right content -->\n <slot name=\"right\" />\n </section>\n <section\n v-if=\"$slots.selected\"\n data-qa=\"d-item-layout-selected-wrapper\"\n class=\"d-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>\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</script>\n"],"names":[],"mappings":";;;AAmEA,MAAA,YAAA;AAAA,EACA,MAAA;AAAA,EACA,OAAA;AAAA;AAAA;AAAA;AAAA,IAIA,IAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,UAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA,EACA;AACA;;;;;;;;;;;;;;;;"}
|
|
@@ -21,7 +21,7 @@ const _sfc_main = {
|
|
|
21
21
|
};
|
|
22
22
|
var _sfc_render = function render() {
|
|
23
23
|
var _vm = this, _c = _vm._self._c;
|
|
24
|
-
return _c(_vm.as, { tag: "component", class: _vm.unstyled ? "
|
|
24
|
+
return _c(_vm.as, { tag: "component", class: _vm.unstyled ? "d-item-layout--custom" : "d-item-layout" }, [_vm.$slots.left ? _c("section", { staticClass: "d-item-layout--left", attrs: { "data-qa": "d-item-layout-left-wrapper" } }, [_vm._t("left")], 2) : _vm._e(), _c("section", { staticClass: "d-item-layout--content", attrs: { "data-qa": "d-item-layout-content-wrapper" } }, [_vm.$slots.default ? _c("div", { staticClass: "d-item-layout--title", attrs: { "data-qa": "d-item-layout-title-wrapper" } }, [_vm._t("default")], 2) : _vm._e(), _vm.$slots.subtitle ? _c("div", { class: ["d-item-layout--subtitle", { "d-item-layout--subtitle--with-title": _vm.$slots.default }], attrs: { "data-qa": "d-item-layout-subtitle-wrapper" } }, [_vm._t("subtitle")], 2) : _vm._e(), _vm.$slots.bottom ? _c("div", { staticClass: "d-item-layout--bottom", attrs: { "data-qa": "d-item-layout-bottom-wrapper" } }, [_vm._t("bottom")], 2) : _vm._e()]), _vm.$slots.right ? _c("section", { staticClass: "d-item-layout--right", attrs: { "data-qa": "d-item-layout-right-wrapper" } }, [_vm._t("right")], 2) : _vm._e(), _vm.$slots.selected ? _c("section", { staticClass: "d-item-layout--selected", attrs: { "data-qa": "d-item-layout-selected-wrapper" } }, [_vm._t("selected")], 2) : _vm._e()]);
|
|
25
25
|
};
|
|
26
26
|
var _sfc_staticRenderFns = [];
|
|
27
27
|
var __component__ = /* @__PURE__ */ normalizeComponent(
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"item_layout.vue.js","sources":["../../../components/item_layout/item_layout.vue"],"sourcesContent":["<template>\n <component\n :is=\"as\"\n :class=\"unstyled ? '
|
|
1
|
+
{"version":3,"file":"item_layout.vue.js","sources":["../../../components/item_layout/item_layout.vue"],"sourcesContent":["<template>\n <component\n :is=\"as\"\n :class=\"unstyled ? 'd-item-layout--custom' : 'd-item-layout'\"\n >\n <section\n v-if=\"$slots.left\"\n data-qa=\"d-item-layout-left-wrapper\"\n class=\"d-item-layout--left\"\n >\n <!-- @slot Slot for left content -->\n <slot name=\"left\" />\n </section>\n <section\n data-qa=\"d-item-layout-content-wrapper\"\n class=\"d-item-layout--content\"\n >\n <div\n v-if=\"$slots.default\"\n data-qa=\"d-item-layout-title-wrapper\"\n class=\"d-item-layout--title\"\n >\n <!-- @slot Slot for main content -->\n <slot />\n </div>\n <div\n v-if=\"$slots.subtitle\"\n data-qa=\"d-item-layout-subtitle-wrapper\"\n :class=\"['d-item-layout--subtitle', { 'd-item-layout--subtitle--with-title': $slots.default }]\"\n >\n <!-- @slot Slot for content below main content -->\n <slot name=\"subtitle\" />\n </div>\n <div\n v-if=\"$slots.bottom\"\n data-qa=\"d-item-layout-bottom-wrapper\"\n class=\"d-item-layout--bottom\"\n >\n <!-- @slot Slot for content below subtitle -->\n <slot name=\"bottom\" />\n </div>\n </section>\n <section\n v-if=\"$slots.right\"\n data-qa=\"d-item-layout-right-wrapper\"\n class=\"d-item-layout--right\"\n >\n <!-- @slot Slot for right content -->\n <slot name=\"right\" />\n </section>\n <section\n v-if=\"$slots.selected\"\n data-qa=\"d-item-layout-selected-wrapper\"\n class=\"d-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>\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</script>\n"],"names":[],"mappings":";AAmEA,MAAA,YAAA;AAAA,EACA,MAAA;AAAA,EACA,OAAA;AAAA;AAAA;AAAA;AAAA,IAIA,IAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,UAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA,EACA;AACA;;;;;;;;;;;;;;;"}
|
|
@@ -3,7 +3,6 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
3
3
|
const list_item_constants = require("./list_item_constants.cjs");
|
|
4
4
|
const common_utils = require("../../common/utils.cjs");
|
|
5
5
|
const vue2 = require("@dialpad/dialtone-icons/vue2");
|
|
6
|
-
;/* empty css */
|
|
7
6
|
const _pluginVue2_normalizer = require("../../_virtual/_plugin-vue2_normalizer.cjs");
|
|
8
7
|
const item_layout = require("../item_layout/item_layout.vue.cjs");
|
|
9
8
|
const ROLES = ["listitem", "menuitem", "option"];
|
|
@@ -171,16 +170,16 @@ const _sfc_main = {
|
|
|
171
170
|
};
|
|
172
171
|
var _sfc_render = function render() {
|
|
173
172
|
var _vm = this, _c = _vm._self._c;
|
|
174
|
-
return _c(_vm.elementType, _vm._g({ tag: "component", class: ["
|
|
175
|
-
"
|
|
176
|
-
"
|
|
177
|
-
"
|
|
173
|
+
return _c(_vm.elementType, _vm._g({ tag: "component", class: ["d-list-item", {
|
|
174
|
+
"d-list-item--focusable": _vm.isFocusable,
|
|
175
|
+
"d-list-item--highlighted": _vm.isHighlighted,
|
|
176
|
+
"d-list-item--static": !_vm.isHoverable
|
|
178
177
|
}], attrs: { "id": _vm.id, "tabindex": _vm.isFocusable ? 0 : -1, "role": _vm.role, "aria-selected": _vm.role === "listitem" ? void 0 : _vm.isHighlighted } }, _vm.listItemListeners), [_vm.listItemType ? _c(_vm.listItemType, { tag: "component", scopedSlots: _vm._u([_vm._l(_vm.$slots, function(_, slotName) {
|
|
179
178
|
return { key: slotName, fn: function() {
|
|
180
179
|
return [_vm._t(slotName)];
|
|
181
180
|
}, proxy: true };
|
|
182
181
|
}), _vm.selected ? { key: "selected", fn: function() {
|
|
183
|
-
return [_c("dt-icon-check", { staticClass: "
|
|
182
|
+
return [_c("dt-icon-check", { staticClass: "d-list-item--selected-icon", attrs: { "size": "400" } })];
|
|
184
183
|
}, proxy: true } : null], null, true) }) : _vm._t("default")], 2);
|
|
185
184
|
};
|
|
186
185
|
var _sfc_staticRenderFns = [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list_item.vue.cjs","sources":["../../../components/list_item/list_item.vue"],"sourcesContent":["<template>\n <component\n :is=\"elementType\"\n :id=\"id\"\n :class=\"['
|
|
1
|
+
{"version":3,"file":"list_item.vue.cjs","sources":["../../../components/list_item/list_item.vue"],"sourcesContent":["<template>\n <component\n :is=\"elementType\"\n :id=\"id\"\n :class=\"['d-list-item', {\n 'd-list-item--focusable': isFocusable,\n 'd-list-item--highlighted': isHighlighted,\n 'd-list-item--static': !isHoverable,\n }]\"\n :tabindex=\"isFocusable ? 0 : -1\"\n :role=\"role\"\n :aria-selected=\"role === 'listitem' ? undefined : isHighlighted\"\n v-on=\"listItemListeners\"\n >\n <component\n :is=\"listItemType\"\n v-if=\"listItemType\"\n >\n <template\n v-for=\"(_, slotName) in $slots\"\n #[slotName]\n >\n <!-- @slot named slots for custom list items -->\n <slot :name=\"slotName\" />\n </template>\n <template\n v-if=\"selected\"\n #selected\n >\n <dt-icon-check\n size=\"400\"\n class=\"d-list-item--selected-icon\"\n />\n </template>\n </component>\n <!-- @slot slot for the main content -->\n <slot v-else />\n </component>\n</template>\n\n<script>\nimport {\n LIST_ITEM_TYPES,\n LIST_ITEM_NAVIGATION_TYPES,\n} from './list_item_constants';\nimport utils from '@/common/utils';\nimport { DtIconCheck } from '@dialpad/dialtone-icons/vue2';\nimport { DtItemLayout } from '@/components/item_layout';\n\nconst ROLES = ['listitem', 'menuitem', 'option'];\n\n/**\n * A list item is an element that can be used to represent individual items in a list.\n * @see https://dialtone.dialpad.com/components/list_item.html\n */\nexport default {\n name: 'DtListItem',\n\n components: {\n DtItemLayout,\n DtIconCheck,\n },\n\n /**\n * Value provided from keyboard_list_navigation.js using id prop.\n */\n inject: {\n highlightId: { default: null },\n },\n\n props: {\n /**\n * Id for the item.\n */\n id: {\n type: String,\n default () { return utils.getUniqueString(); },\n },\n\n /**\n * String to use for the item's role.\n */\n role: {\n type: String,\n default: 'listitem',\n validator: (role) => (ROLES).includes(role),\n },\n\n /**\n * HTML element type (tag name) of the content wrapper element.\n */\n elementType: {\n type: String,\n default: 'li',\n },\n\n /**\n * The type of child list item to use.\n * @values default, custom\n */\n type: {\n type: String,\n default: LIST_ITEM_TYPES.DEFAULT,\n validator: (t) => Object.values(LIST_ITEM_TYPES).includes(t),\n },\n\n /**\n * The type of navigation that this component should support.\n * - \"arrow-keys\" for items that are navigated with UP/DOWN keys.\n * - \"tab\" for items that are navigated using the TAB key.\n * - \"none\" for static items that are not interactive.\n * @values arrow-keys, tab, none\n */\n navigationType: {\n type: String,\n default: LIST_ITEM_NAVIGATION_TYPES.NONE,\n validator: (t) => Object.values(LIST_ITEM_NAVIGATION_TYPES).includes(t),\n },\n\n /**\n * Applies selected styles to the list item\n */\n selected: {\n type: Boolean,\n default: false,\n },\n },\n\n emits: [\n /**\n * Native click event\n *\n * @event click\n * @type {PointerEvent | KeyboardEvent}\n */\n 'click',\n\n /**\n * Key down event\n *\n * @event keydown\n * @type {KeyboardEvent}\n */\n 'keydown',\n\n /**\n * Native mouse move event\n *\n * @event mousemove\n * @type {MouseEvent}\n */\n 'mousemove',\n\n /**\n * Native mouse leave event\n *\n * @event mouseleave\n * @type {MouseEvent}\n */\n 'mouseleave',\n ],\n\n data () {\n return {\n injected: false,\n mouseHighlighted: false,\n };\n },\n\n computed: {\n listItemType () {\n switch (this.type) {\n case LIST_ITEM_TYPES.DEFAULT:\n return DtItemLayout;\n default:\n return null;\n }\n },\n\n listItemListeners () {\n return {\n ...this.$listeners,\n keydown: event => {\n if (['enter', 'space'].includes(event.code.toLowerCase())) {\n this.onClick(event);\n }\n this.$emit('keydown', event);\n },\n\n mousemove: event => {\n this.onMouseHover(event);\n this.$emit('mousemove', event);\n },\n\n mouseleave: event => {\n this.onMouseLeave(event);\n this.$emit('mouseleave', event);\n },\n };\n },\n\n /**\n * For keyboard navigation, whether this item is currently highlighted.\n * An injected highlightId will override the default mouseover highlight.\n */\n isHighlighted () {\n if (this.isHoverable) {\n return this.highlightId && this.highlightId() ? this.id === this.highlightId() : this.mouseHighlighted;\n }\n return false;\n },\n\n isFocusable () {\n // Navigation type has to be set to \"tab\".\n return this.navigationType === LIST_ITEM_NAVIGATION_TYPES.TAB;\n },\n\n /**\n * Whether to apply hover styles.\n */\n isHoverable () {\n return this.navigationType !== LIST_ITEM_NAVIGATION_TYPES.NONE;\n },\n },\n\n methods: {\n onClick (e) {\n this.$emit('click', e);\n },\n\n onMouseHover () {\n this.mouseHighlighted = true;\n },\n\n onMouseLeave () {\n this.mouseHighlighted = false;\n },\n },\n};\n</script>\n"],"names":["DtItemLayout","DtIconCheck","utils","LIST_ITEM_TYPES","LIST_ITEM_NAVIGATION_TYPES"],"mappings":";;;;;;;AAiDA,MAAA,QAAA,CAAA,YAAA,YAAA,QAAA;AAMA,MAAA,YAAA;AAAA,EACA,MAAA;AAAA,EAEA,YAAA;AAAA,IACA,cAAAA,YAAA;AAAA,IACA,aAAAC,KAAA;AAAA,EACA;AAAA;AAAA;AAAA;AAAA,EAKA,QAAA;AAAA,IACA,aAAA,EAAA,SAAA,KAAA;AAAA,EACA;AAAA,EAEA,OAAA;AAAA;AAAA;AAAA;AAAA,IAIA,IAAA;AAAA,MACA,MAAA;AAAA,MACA,UAAA;AAAA,eAAAC,qBAAA,gBAAA;AAAA,MAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,MAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,MACA,WAAA,CAAA,SAAA,MAAA,SAAA,IAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,aAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,MAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAAC,oBAAA,gBAAA;AAAA,MACA,WAAA,CAAA,MAAA,OAAA,OAAAA,mCAAA,EAAA,SAAA,CAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IASA,gBAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAAC,oBAAA,2BAAA;AAAA,MACA,WAAA,CAAA,MAAA,OAAA,OAAAA,8CAAA,EAAA,SAAA,CAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,UAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA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;AACA,WAAA,MAAA,SAAA,CAAA;AAAA,IACA;AAAA,IAEA,eAAA;AACA,WAAA,mBAAA;AAAA,IACA;AAAA,IAEA,eAAA;AACA,WAAA,mBAAA;AAAA,IACA;AAAA,EACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { LIST_ITEM_TYPES, LIST_ITEM_NAVIGATION_TYPES } from "./list_item_constants.js";
|
|
2
2
|
import utils from "../../common/utils.js";
|
|
3
3
|
import { DtIconCheck } from "@dialpad/dialtone-icons/vue2";
|
|
4
|
-
/* empty css */
|
|
5
4
|
import normalizeComponent from "../../_virtual/_plugin-vue2_normalizer.js";
|
|
6
5
|
import DtItemLayout from "../item_layout/item_layout.vue.js";
|
|
7
6
|
const ROLES = ["listitem", "menuitem", "option"];
|
|
@@ -169,16 +168,16 @@ const _sfc_main = {
|
|
|
169
168
|
};
|
|
170
169
|
var _sfc_render = function render() {
|
|
171
170
|
var _vm = this, _c = _vm._self._c;
|
|
172
|
-
return _c(_vm.elementType, _vm._g({ tag: "component", class: ["
|
|
173
|
-
"
|
|
174
|
-
"
|
|
175
|
-
"
|
|
171
|
+
return _c(_vm.elementType, _vm._g({ tag: "component", class: ["d-list-item", {
|
|
172
|
+
"d-list-item--focusable": _vm.isFocusable,
|
|
173
|
+
"d-list-item--highlighted": _vm.isHighlighted,
|
|
174
|
+
"d-list-item--static": !_vm.isHoverable
|
|
176
175
|
}], attrs: { "id": _vm.id, "tabindex": _vm.isFocusable ? 0 : -1, "role": _vm.role, "aria-selected": _vm.role === "listitem" ? void 0 : _vm.isHighlighted } }, _vm.listItemListeners), [_vm.listItemType ? _c(_vm.listItemType, { tag: "component", scopedSlots: _vm._u([_vm._l(_vm.$slots, function(_, slotName) {
|
|
177
176
|
return { key: slotName, fn: function() {
|
|
178
177
|
return [_vm._t(slotName)];
|
|
179
178
|
}, proxy: true };
|
|
180
179
|
}), _vm.selected ? { key: "selected", fn: function() {
|
|
181
|
-
return [_c("dt-icon-check", { staticClass: "
|
|
180
|
+
return [_c("dt-icon-check", { staticClass: "d-list-item--selected-icon", attrs: { "size": "400" } })];
|
|
182
181
|
}, proxy: true } : null], null, true) }) : _vm._t("default")], 2);
|
|
183
182
|
};
|
|
184
183
|
var _sfc_staticRenderFns = [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list_item.vue.js","sources":["../../../components/list_item/list_item.vue"],"sourcesContent":["<template>\n <component\n :is=\"elementType\"\n :id=\"id\"\n :class=\"['
|
|
1
|
+
{"version":3,"file":"list_item.vue.js","sources":["../../../components/list_item/list_item.vue"],"sourcesContent":["<template>\n <component\n :is=\"elementType\"\n :id=\"id\"\n :class=\"['d-list-item', {\n 'd-list-item--focusable': isFocusable,\n 'd-list-item--highlighted': isHighlighted,\n 'd-list-item--static': !isHoverable,\n }]\"\n :tabindex=\"isFocusable ? 0 : -1\"\n :role=\"role\"\n :aria-selected=\"role === 'listitem' ? undefined : isHighlighted\"\n v-on=\"listItemListeners\"\n >\n <component\n :is=\"listItemType\"\n v-if=\"listItemType\"\n >\n <template\n v-for=\"(_, slotName) in $slots\"\n #[slotName]\n >\n <!-- @slot named slots for custom list items -->\n <slot :name=\"slotName\" />\n </template>\n <template\n v-if=\"selected\"\n #selected\n >\n <dt-icon-check\n size=\"400\"\n class=\"d-list-item--selected-icon\"\n />\n </template>\n </component>\n <!-- @slot slot for the main content -->\n <slot v-else />\n </component>\n</template>\n\n<script>\nimport {\n LIST_ITEM_TYPES,\n LIST_ITEM_NAVIGATION_TYPES,\n} from './list_item_constants';\nimport utils from '@/common/utils';\nimport { DtIconCheck } from '@dialpad/dialtone-icons/vue2';\nimport { DtItemLayout } from '@/components/item_layout';\n\nconst ROLES = ['listitem', 'menuitem', 'option'];\n\n/**\n * A list item is an element that can be used to represent individual items in a list.\n * @see https://dialtone.dialpad.com/components/list_item.html\n */\nexport default {\n name: 'DtListItem',\n\n components: {\n DtItemLayout,\n DtIconCheck,\n },\n\n /**\n * Value provided from keyboard_list_navigation.js using id prop.\n */\n inject: {\n highlightId: { default: null },\n },\n\n props: {\n /**\n * Id for the item.\n */\n id: {\n type: String,\n default () { return utils.getUniqueString(); },\n },\n\n /**\n * String to use for the item's role.\n */\n role: {\n type: String,\n default: 'listitem',\n validator: (role) => (ROLES).includes(role),\n },\n\n /**\n * HTML element type (tag name) of the content wrapper element.\n */\n elementType: {\n type: String,\n default: 'li',\n },\n\n /**\n * The type of child list item to use.\n * @values default, custom\n */\n type: {\n type: String,\n default: LIST_ITEM_TYPES.DEFAULT,\n validator: (t) => Object.values(LIST_ITEM_TYPES).includes(t),\n },\n\n /**\n * The type of navigation that this component should support.\n * - \"arrow-keys\" for items that are navigated with UP/DOWN keys.\n * - \"tab\" for items that are navigated using the TAB key.\n * - \"none\" for static items that are not interactive.\n * @values arrow-keys, tab, none\n */\n navigationType: {\n type: String,\n default: LIST_ITEM_NAVIGATION_TYPES.NONE,\n validator: (t) => Object.values(LIST_ITEM_NAVIGATION_TYPES).includes(t),\n },\n\n /**\n * Applies selected styles to the list item\n */\n selected: {\n type: Boolean,\n default: false,\n },\n },\n\n emits: [\n /**\n * Native click event\n *\n * @event click\n * @type {PointerEvent | KeyboardEvent}\n */\n 'click',\n\n /**\n * Key down event\n *\n * @event keydown\n * @type {KeyboardEvent}\n */\n 'keydown',\n\n /**\n * Native mouse move event\n *\n * @event mousemove\n * @type {MouseEvent}\n */\n 'mousemove',\n\n /**\n * Native mouse leave event\n *\n * @event mouseleave\n * @type {MouseEvent}\n */\n 'mouseleave',\n ],\n\n data () {\n return {\n injected: false,\n mouseHighlighted: false,\n };\n },\n\n computed: {\n listItemType () {\n switch (this.type) {\n case LIST_ITEM_TYPES.DEFAULT:\n return DtItemLayout;\n default:\n return null;\n }\n },\n\n listItemListeners () {\n return {\n ...this.$listeners,\n keydown: event => {\n if (['enter', 'space'].includes(event.code.toLowerCase())) {\n this.onClick(event);\n }\n this.$emit('keydown', event);\n },\n\n mousemove: event => {\n this.onMouseHover(event);\n this.$emit('mousemove', event);\n },\n\n mouseleave: event => {\n this.onMouseLeave(event);\n this.$emit('mouseleave', event);\n },\n };\n },\n\n /**\n * For keyboard navigation, whether this item is currently highlighted.\n * An injected highlightId will override the default mouseover highlight.\n */\n isHighlighted () {\n if (this.isHoverable) {\n return this.highlightId && this.highlightId() ? this.id === this.highlightId() : this.mouseHighlighted;\n }\n return false;\n },\n\n isFocusable () {\n // Navigation type has to be set to \"tab\".\n return this.navigationType === LIST_ITEM_NAVIGATION_TYPES.TAB;\n },\n\n /**\n * Whether to apply hover styles.\n */\n isHoverable () {\n return this.navigationType !== LIST_ITEM_NAVIGATION_TYPES.NONE;\n },\n },\n\n methods: {\n onClick (e) {\n this.$emit('click', e);\n },\n\n onMouseHover () {\n this.mouseHighlighted = true;\n },\n\n onMouseLeave () {\n this.mouseHighlighted = false;\n },\n },\n};\n</script>\n"],"names":[],"mappings":";;;;;AAiDA,MAAA,QAAA,CAAA,YAAA,YAAA,QAAA;AAMA,MAAA,YAAA;AAAA,EACA,MAAA;AAAA,EAEA,YAAA;AAAA,IACA;AAAA,IACA;AAAA,EACA;AAAA;AAAA;AAAA;AAAA,EAKA,QAAA;AAAA,IACA,aAAA,EAAA,SAAA,KAAA;AAAA,EACA;AAAA,EAEA,OAAA;AAAA;AAAA;AAAA;AAAA,IAIA,IAAA;AAAA,MACA,MAAA;AAAA,MACA,UAAA;AAAA,eAAA,MAAA,gBAAA;AAAA,MAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,MAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,MACA,WAAA,CAAA,SAAA,MAAA,SAAA,IAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,aAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,MAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA,gBAAA;A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AA,IAMA,gBAAA;AACA,UAAA,KAAA,aAAA;AACA,eAAA,KAAA,eAAA,KAAA,YAAA,IAAA,KAAA,OAAA,KAAA,gBAAA,KAAA;AAAA,MACA;AACA,aAAA;AAAA,IACA;AAAA,IAEA,cAAA;AAEA,aAAA,KAAA,mBAAA,2BAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,cAAA;AACA,aAAA,KAAA,mBAAA,2BAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,SAAA;AAAA,IACA,QAAA,GAAA;AACA,WAAA,MAAA,SAAA,CAAA;AAAA,IACA;AAAA,IAEA,eAAA;AACA,WAAA,mBAAA;AAAA,IACA;AAAA,IAEA,eAAA;AACA,WAAA,mBAAA;AAAA,IACA;AAAA,EACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
3
|
-
;/* empty css */
|
|
4
3
|
const _pluginVue2_normalizer = require("../../../../_virtual/_plugin-vue2_normalizer.cjs");
|
|
5
4
|
const avatar = require("../../../avatar/avatar.vue.cjs");
|
|
6
5
|
const stack = require("../../../stack/stack.vue.cjs");
|
|
@@ -27,7 +26,7 @@ const _sfc_main = {
|
|
|
27
26
|
};
|
|
28
27
|
var _sfc_render = function render() {
|
|
29
28
|
var _vm = this, _c = _vm._self._c;
|
|
30
|
-
return _c("dt-stack", { attrs: { "direction": "row", "gap": "400" } }, [_c("dt-avatar", { attrs: { "full-name": _vm.name, "image-src": _vm.avatarSrc, "image-alt": _vm.name, "size": "xs" } }), _c("span", { staticClass: "mention-
|
|
29
|
+
return _c("dt-stack", { attrs: { "direction": "row", "gap": "400" } }, [_c("dt-avatar", { attrs: { "full-name": _vm.name, "image-src": _vm.avatarSrc, "image-alt": _vm.name, "size": "xs" } }), _c("span", { staticClass: "d-mention-suggestion__name" }, [_vm._v(" " + _vm._s(_vm.name) + " ")])], 1);
|
|
31
30
|
};
|
|
32
31
|
var _sfc_staticRenderFns = [];
|
|
33
32
|
var __component__ = /* @__PURE__ */ _pluginVue2_normalizer.default(
|
|
@@ -36,7 +35,7 @@ var __component__ = /* @__PURE__ */ _pluginVue2_normalizer.default(
|
|
|
36
35
|
_sfc_staticRenderFns,
|
|
37
36
|
false,
|
|
38
37
|
null,
|
|
39
|
-
|
|
38
|
+
null
|
|
40
39
|
);
|
|
41
40
|
const MentionSuggestion = __component__.exports;
|
|
42
41
|
exports.default = MentionSuggestion;
|
package/dist/vue2/components/rich_text_editor/extensions/mentions/MentionSuggestion.vue.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MentionSuggestion.vue.cjs","sources":["../../../../../components/rich_text_editor/extensions/mentions/MentionSuggestion.vue"],"sourcesContent":["<template>\n <dt-stack\n direction=\"row\"\n gap=\"400\"\n >\n <dt-avatar\n :full-name=\"name\"\n :image-src=\"avatarSrc\"\n :image-alt=\"name\"\n size=\"xs\"\n />\n <span class=\"mention-
|
|
1
|
+
{"version":3,"file":"MentionSuggestion.vue.cjs","sources":["../../../../../components/rich_text_editor/extensions/mentions/MentionSuggestion.vue"],"sourcesContent":["<template>\n <dt-stack\n direction=\"row\"\n gap=\"400\"\n >\n <dt-avatar\n :full-name=\"name\"\n :image-src=\"avatarSrc\"\n :image-alt=\"name\"\n size=\"xs\"\n />\n <span class=\"d-mention-suggestion__name\">\n {{ name }}\n </span>\n </dt-stack>\n</template>\n\n<script>\nimport { DtAvatar } from '@/components/avatar';\nimport { DtStack } from '@/components/stack';\n\nexport default {\n name: 'MentionSuggestion',\n components: {\n DtAvatar,\n DtStack,\n },\n\n props: {\n item: {\n type: Object,\n required: true,\n },\n },\n\n computed: {\n name () {\n return this.item.name;\n },\n\n avatarSrc () {\n return this.item.avatarSrc;\n },\n },\n};\n</script>\n"],"names":["DtAvatar","DtStack"],"mappings":";;;;;AAqBA,MAAA,YAAA;AAAA,EACA,MAAA;AAAA,EACA,YAAA;AAAA,IACA,UAAAA,OAAA;AAAA,IACA,SAAAC,MAAA;AAAA,EACA;AAAA,EAEA,OAAA;AAAA,IACA,MAAA;AAAA,MACA,MAAA;AAAA,MACA,UAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,UAAA;AAAA,IACA,OAAA;AACA,aAAA,KAAA,KAAA;AAAA,IACA;AAAA,IAEA,YAAA;AACA,aAAA,KAAA,KAAA;AAAA,IACA;AAAA,EACA;AACA;;;;;;;;;;;;;;;;"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/* empty css */
|
|
2
1
|
import normalizeComponent from "../../../../_virtual/_plugin-vue2_normalizer.js";
|
|
3
2
|
import DtAvatar from "../../../avatar/avatar.vue.js";
|
|
4
3
|
import DtStack from "../../../stack/stack.vue.js";
|
|
@@ -25,7 +24,7 @@ const _sfc_main = {
|
|
|
25
24
|
};
|
|
26
25
|
var _sfc_render = function render() {
|
|
27
26
|
var _vm = this, _c = _vm._self._c;
|
|
28
|
-
return _c("dt-stack", { attrs: { "direction": "row", "gap": "400" } }, [_c("dt-avatar", { attrs: { "full-name": _vm.name, "image-src": _vm.avatarSrc, "image-alt": _vm.name, "size": "xs" } }), _c("span", { staticClass: "mention-
|
|
27
|
+
return _c("dt-stack", { attrs: { "direction": "row", "gap": "400" } }, [_c("dt-avatar", { attrs: { "full-name": _vm.name, "image-src": _vm.avatarSrc, "image-alt": _vm.name, "size": "xs" } }), _c("span", { staticClass: "d-mention-suggestion__name" }, [_vm._v(" " + _vm._s(_vm.name) + " ")])], 1);
|
|
29
28
|
};
|
|
30
29
|
var _sfc_staticRenderFns = [];
|
|
31
30
|
var __component__ = /* @__PURE__ */ normalizeComponent(
|
|
@@ -34,7 +33,7 @@ var __component__ = /* @__PURE__ */ normalizeComponent(
|
|
|
34
33
|
_sfc_staticRenderFns,
|
|
35
34
|
false,
|
|
36
35
|
null,
|
|
37
|
-
|
|
36
|
+
null
|
|
38
37
|
);
|
|
39
38
|
const MentionSuggestion = __component__.exports;
|
|
40
39
|
export {
|
package/dist/vue2/components/rich_text_editor/extensions/mentions/MentionSuggestion.vue.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MentionSuggestion.vue.js","sources":["../../../../../components/rich_text_editor/extensions/mentions/MentionSuggestion.vue"],"sourcesContent":["<template>\n <dt-stack\n direction=\"row\"\n gap=\"400\"\n >\n <dt-avatar\n :full-name=\"name\"\n :image-src=\"avatarSrc\"\n :image-alt=\"name\"\n size=\"xs\"\n />\n <span class=\"mention-
|
|
1
|
+
{"version":3,"file":"MentionSuggestion.vue.js","sources":["../../../../../components/rich_text_editor/extensions/mentions/MentionSuggestion.vue"],"sourcesContent":["<template>\n <dt-stack\n direction=\"row\"\n gap=\"400\"\n >\n <dt-avatar\n :full-name=\"name\"\n :image-src=\"avatarSrc\"\n :image-alt=\"name\"\n size=\"xs\"\n />\n <span class=\"d-mention-suggestion__name\">\n {{ name }}\n </span>\n </dt-stack>\n</template>\n\n<script>\nimport { DtAvatar } from '@/components/avatar';\nimport { DtStack } from '@/components/stack';\n\nexport default {\n name: 'MentionSuggestion',\n components: {\n DtAvatar,\n DtStack,\n },\n\n props: {\n item: {\n type: Object,\n required: true,\n },\n },\n\n computed: {\n name () {\n return this.item.name;\n },\n\n avatarSrc () {\n return this.item.avatarSrc;\n },\n },\n};\n</script>\n"],"names":[],"mappings":";;;AAqBA,MAAA,YAAA;AAAA,EACA,MAAA;AAAA,EACA,YAAA;AAAA,IACA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,OAAA;AAAA,IACA,MAAA;AAAA,MACA,MAAA;AAAA,MACA,UAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,UAAA;AAAA,IACA,OAAA;AACA,aAAA,KAAA,KAAA;AAAA,IACA;AAAA,IAEA,YAAA;AACA,aAAA,KAAA,KAAA;AAAA,IACA;AAAA,EACA;AACA;;;;;;;;;;;;;;;"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
3
|
-
;/* empty css */
|
|
4
3
|
const _pluginVue2_normalizer = require("../../../../_virtual/_plugin-vue2_normalizer.cjs");
|
|
5
4
|
const list_item = require("../../../list_item/list_item.vue.cjs");
|
|
6
5
|
const _sfc_main = {
|
|
@@ -62,7 +61,7 @@ const _sfc_main = {
|
|
|
62
61
|
},
|
|
63
62
|
async scrollActiveElementIntoView() {
|
|
64
63
|
await this.$nextTick();
|
|
65
|
-
const activeElement = this.$refs.suggestionList.querySelector(".
|
|
64
|
+
const activeElement = this.$refs.suggestionList.querySelector(".d-list-item--highlighted");
|
|
66
65
|
if (activeElement) {
|
|
67
66
|
activeElement.scrollIntoView({
|
|
68
67
|
behaviour: "smooth",
|
|
@@ -94,10 +93,10 @@ const _sfc_main = {
|
|
|
94
93
|
};
|
|
95
94
|
var _sfc_render = function render() {
|
|
96
95
|
var _vm = this, _c = _vm._self._c;
|
|
97
|
-
return _c("div", { staticClass: "d-popover__dialog
|
|
96
|
+
return _c("div", { staticClass: "d-popover__dialog d-suggestion-list__container" }, [_c("ul", { directives: [{ name: "show", rawName: "v-show", value: _vm.items.length, expression: "items.length" }], ref: "suggestionList", staticClass: "d-suggestion-list" }, _vm._l(_vm.items, function(item, index) {
|
|
98
97
|
return _c("dt-list-item", { key: item.id, class: [
|
|
99
|
-
"
|
|
100
|
-
{ "
|
|
98
|
+
"d-suggestion-list__item",
|
|
99
|
+
{ "d-list-item--highlighted": index === _vm.selectedIndex }
|
|
101
100
|
], attrs: { "navigation-type": "arrow-keys" }, on: { "click": function($event) {
|
|
102
101
|
return _vm.selectItem(index);
|
|
103
102
|
}, "keydown": function($event) {
|
package/dist/vue2/components/rich_text_editor/extensions/suggestion/SuggestionList.vue.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SuggestionList.vue.cjs","sources":["../../../../../components/rich_text_editor/extensions/suggestion/SuggestionList.vue"],"sourcesContent":["<template>\n <div class=\"d-popover__dialog
|
|
1
|
+
{"version":3,"file":"SuggestionList.vue.cjs","sources":["../../../../../components/rich_text_editor/extensions/suggestion/SuggestionList.vue"],"sourcesContent":["<template>\n <div class=\"d-popover__dialog d-suggestion-list__container\">\n <ul\n v-show=\"items.length\"\n ref=\"suggestionList\"\n class=\"d-suggestion-list\"\n >\n <dt-list-item\n v-for=\"(item, index) in items\"\n :key=\"item.id\"\n :class=\"[\n 'd-suggestion-list__item',\n { 'd-list-item--highlighted': index === selectedIndex },\n ]\"\n navigation-type=\"arrow-keys\"\n @click=\"selectItem(index)\"\n @keydown.prevent=\"onKeyDown\"\n >\n <component\n :is=\"itemComponent\"\n :item=\"item\"\n />\n </dt-list-item>\n </ul>\n </div>\n</template>\n\n<script>\nimport { DtListItem } from '@/components/list_item';\n\nexport default {\n name: 'SuggestionList',\n components: {\n DtListItem,\n },\n\n props: {\n items: {\n type: Array,\n required: true,\n },\n\n command: {\n type: Function,\n required: true,\n },\n\n itemComponent: {\n type: Object,\n required: true,\n },\n\n itemType: {\n type: String,\n required: true,\n },\n },\n\n data () {\n return {\n selectedIndex: 0,\n };\n },\n\n watch: {\n items () {\n this.selectedIndex = 0;\n },\n },\n\n methods: {\n onKeyDown ({ event }) {\n if (event.key === 'ArrowUp') {\n this.upHandler();\n return true;\n }\n\n if (event.key === 'ArrowDown') {\n this.downHandler();\n return true;\n }\n\n if (event.key === 'Enter' || event.key === 'Tab') {\n this.selectHandler();\n return true;\n }\n\n return false;\n },\n\n upHandler () {\n this.selectedIndex = ((this.selectedIndex + this.items.length) - 1) % this.items.length;\n\n this.scrollActiveElementIntoView();\n },\n\n downHandler () {\n this.selectedIndex = (this.selectedIndex + 1) % this.items.length;\n\n this.scrollActiveElementIntoView();\n },\n\n async scrollActiveElementIntoView () {\n await this.$nextTick();\n const activeElement = this.$refs.suggestionList.querySelector('.d-list-item--highlighted');\n if (activeElement) {\n activeElement.scrollIntoView({\n behaviour: 'smooth',\n block: 'center',\n });\n }\n },\n\n selectHandler () {\n this.selectItem(this.selectedIndex);\n },\n\n selectItem (index) {\n const item = this.items[index];\n\n switch (this.itemType) {\n case 'emoji':\n this.command(item);\n return;\n case 'mention':\n this.command({ name: item.name, id: item.id, avatarSrc: item.avatarSrc });\n break;\n case 'channel':\n this.command({ name: item.name, id: item.id });\n break;\n case 'slash-command':\n this.command({ command: item.command });\n break;\n }\n },\n },\n};\n</script>\n"],"names":["DtListItem"],"mappings":";;;;AA8BA,MAAA,YAAA;AAAA,EACA,MAAA;AAAA,EACA,YAAA;AAAA,IACA,YAAAA,UAAA;AAAA,EACA;AAAA,EAEA,OAAA;AAAA,IACA,OAAA;AAAA,MACA,MAAA;AAAA,MACA,UAAA;AAAA,IACA;AAAA,IAEA,SAAA;AAAA,MACA,MAAA;AAAA,MACA,UAAA;AAAA,IACA;AAAA,IAEA,eAAA;AAAA,MACA,MAAA;AAAA,MACA,UAAA;AAAA,IACA;AAAA,IAEA,UAAA;AAAA,MACA,MAAA;AAAA,MACA,UAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,OAAA;AACA,WAAA;AAAA,MACA,eAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,OAAA;AAAA,IACA,QAAA;AACA,WAAA,gBAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,SAAA;AAAA,IACA,UAAA,EAAA,SAAA;AACA,UAAA,MAAA,QAAA,WAAA;AACA,aAAA,UAAA;AACA,eAAA;AAAA,MACA;AAEA,UAAA,MAAA,QAAA,aAAA;AACA,aAAA,YAAA;AACA,eAAA;AAAA,MACA;AAEA,UAAA,MAAA,QAAA,WAAA,MAAA,QAAA,OAAA;AACA,aAAA,cAAA;AACA,eAAA;AAAA,MACA;AAEA,aAAA;AAAA,IACA;AAAA,IAEA,YAAA;AACA,WAAA,iBAAA,KAAA,gBAAA,KAAA,MAAA,SAAA,KAAA,KAAA,MAAA;AAEA,WAAA,4BAAA;AAAA,IACA;AAAA,IAEA,cAAA;AACA,WAAA,iBAAA,KAAA,gBAAA,KAAA,KAAA,MAAA;AAEA,WAAA,4BAAA;AAAA,IACA;AAAA,IAEA,MAAA,8BAAA;AACA,YAAA,KAAA;AACA,YAAA,gBAAA,KAAA,MAAA,eAAA,cAAA,2BAAA;AACA,UAAA,eAAA;AACA,sBAAA,eAAA;AAAA,UACA,WAAA;AAAA,UACA,OAAA;AAAA,QACA,CAAA;AAAA,MACA;AAAA,IACA;AAAA,IAEA,gBAAA;AACA,WAAA,WAAA,KAAA,aAAA;AAAA,IACA;AAAA,IAEA,WAAA,OAAA;AACA,YAAA,OAAA,KAAA,MAAA,KAAA;AAEA,cAAA,KAAA,UAAA;AAAA,QACA,KAAA;AACA,eAAA,QAAA,IAAA;AACA;AAAA,QACA,KAAA;AACA,eAAA,QAAA,EAAA,MAAA,KAAA,MAAA,IAAA,KAAA,IAAA,WAAA,KAAA,UAAA,CAAA;AACA;AAAA,QACA,KAAA;AACA,eAAA,QAAA,EAAA,MAAA,KAAA,MAAA,IAAA,KAAA,GAAA,CAAA;AACA;AAAA,QACA,KAAA;AACA,eAAA,QAAA,EAAA,SAAA,KAAA,QAAA,CAAA;AACA;AAAA,MACA;AAAA,IACA;AAAA,EACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/* empty css */
|
|
2
1
|
import normalizeComponent from "../../../../_virtual/_plugin-vue2_normalizer.js";
|
|
3
2
|
import DtListItem from "../../../list_item/list_item.vue.js";
|
|
4
3
|
const _sfc_main = {
|
|
@@ -60,7 +59,7 @@ const _sfc_main = {
|
|
|
60
59
|
},
|
|
61
60
|
async scrollActiveElementIntoView() {
|
|
62
61
|
await this.$nextTick();
|
|
63
|
-
const activeElement = this.$refs.suggestionList.querySelector(".
|
|
62
|
+
const activeElement = this.$refs.suggestionList.querySelector(".d-list-item--highlighted");
|
|
64
63
|
if (activeElement) {
|
|
65
64
|
activeElement.scrollIntoView({
|
|
66
65
|
behaviour: "smooth",
|
|
@@ -92,10 +91,10 @@ const _sfc_main = {
|
|
|
92
91
|
};
|
|
93
92
|
var _sfc_render = function render() {
|
|
94
93
|
var _vm = this, _c = _vm._self._c;
|
|
95
|
-
return _c("div", { staticClass: "d-popover__dialog
|
|
94
|
+
return _c("div", { staticClass: "d-popover__dialog d-suggestion-list__container" }, [_c("ul", { directives: [{ name: "show", rawName: "v-show", value: _vm.items.length, expression: "items.length" }], ref: "suggestionList", staticClass: "d-suggestion-list" }, _vm._l(_vm.items, function(item, index) {
|
|
96
95
|
return _c("dt-list-item", { key: item.id, class: [
|
|
97
|
-
"
|
|
98
|
-
{ "
|
|
96
|
+
"d-suggestion-list__item",
|
|
97
|
+
{ "d-list-item--highlighted": index === _vm.selectedIndex }
|
|
99
98
|
], attrs: { "navigation-type": "arrow-keys" }, on: { "click": function($event) {
|
|
100
99
|
return _vm.selectItem(index);
|
|
101
100
|
}, "keydown": function($event) {
|
package/dist/vue2/components/rich_text_editor/extensions/suggestion/SuggestionList.vue.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SuggestionList.vue.js","sources":["../../../../../components/rich_text_editor/extensions/suggestion/SuggestionList.vue"],"sourcesContent":["<template>\n <div class=\"d-popover__dialog
|
|
1
|
+
{"version":3,"file":"SuggestionList.vue.js","sources":["../../../../../components/rich_text_editor/extensions/suggestion/SuggestionList.vue"],"sourcesContent":["<template>\n <div class=\"d-popover__dialog d-suggestion-list__container\">\n <ul\n v-show=\"items.length\"\n ref=\"suggestionList\"\n class=\"d-suggestion-list\"\n >\n <dt-list-item\n v-for=\"(item, index) in items\"\n :key=\"item.id\"\n :class=\"[\n 'd-suggestion-list__item',\n { 'd-list-item--highlighted': index === selectedIndex },\n ]\"\n navigation-type=\"arrow-keys\"\n @click=\"selectItem(index)\"\n @keydown.prevent=\"onKeyDown\"\n >\n <component\n :is=\"itemComponent\"\n :item=\"item\"\n />\n </dt-list-item>\n </ul>\n </div>\n</template>\n\n<script>\nimport { DtListItem } from '@/components/list_item';\n\nexport default {\n name: 'SuggestionList',\n components: {\n DtListItem,\n },\n\n props: {\n items: {\n type: Array,\n required: true,\n },\n\n command: {\n type: Function,\n required: true,\n },\n\n itemComponent: {\n type: Object,\n required: true,\n },\n\n itemType: {\n type: String,\n required: true,\n },\n },\n\n data () {\n return {\n selectedIndex: 0,\n };\n },\n\n watch: {\n items () {\n this.selectedIndex = 0;\n },\n },\n\n methods: {\n onKeyDown ({ event }) {\n if (event.key === 'ArrowUp') {\n this.upHandler();\n return true;\n }\n\n if (event.key === 'ArrowDown') {\n this.downHandler();\n return true;\n }\n\n if (event.key === 'Enter' || event.key === 'Tab') {\n this.selectHandler();\n return true;\n }\n\n return false;\n },\n\n upHandler () {\n this.selectedIndex = ((this.selectedIndex + this.items.length) - 1) % this.items.length;\n\n this.scrollActiveElementIntoView();\n },\n\n downHandler () {\n this.selectedIndex = (this.selectedIndex + 1) % this.items.length;\n\n this.scrollActiveElementIntoView();\n },\n\n async scrollActiveElementIntoView () {\n await this.$nextTick();\n const activeElement = this.$refs.suggestionList.querySelector('.d-list-item--highlighted');\n if (activeElement) {\n activeElement.scrollIntoView({\n behaviour: 'smooth',\n block: 'center',\n });\n }\n },\n\n selectHandler () {\n this.selectItem(this.selectedIndex);\n },\n\n selectItem (index) {\n const item = this.items[index];\n\n switch (this.itemType) {\n case 'emoji':\n this.command(item);\n return;\n case 'mention':\n this.command({ name: item.name, id: item.id, avatarSrc: item.avatarSrc });\n break;\n case 'channel':\n this.command({ name: item.name, id: item.id });\n break;\n case 'slash-command':\n this.command({ command: item.command });\n break;\n }\n },\n },\n};\n</script>\n"],"names":[],"mappings":";;AA8BA,MAAA,YAAA;AAAA,EACA,MAAA;AAAA,EACA,YAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,OAAA;AAAA,IACA,OAAA;A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