@dialpad/dialtone-vue 4.9.0 → 4.10.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/{Combobox-WsLvegw6.js → Combobox-DP8tbe6x.js} +1 -1
- package/dist/{Combobox-WsLvegw6.js.map → Combobox-DP8tbe6x.js.map} +1 -1
- package/dist/{Combobox-96zAPv6d.cjs → Combobox-DdBIRmeH.cjs} +1 -1
- package/dist/{Combobox-96zAPv6d.cjs.map → Combobox-DdBIRmeH.cjs.map} +1 -1
- package/dist/{Datepicker-D-Lgvthq.js → Datepicker-CNFVUyyK.js} +1 -1
- package/dist/{Datepicker-D-Lgvthq.js.map → Datepicker-CNFVUyyK.js.map} +1 -1
- package/dist/{Datepicker-DmKOuf5y.cjs → Datepicker-Df6uR0r_.cjs} +1 -1
- package/dist/{Datepicker-DmKOuf5y.cjs.map → Datepicker-Df6uR0r_.cjs.map} +1 -1
- package/dist/{EmojiPicker-D46lLRMp.js → EmojiPicker-B7AKJlAM.js} +1 -1
- package/dist/{EmojiPicker-D46lLRMp.js.map → EmojiPicker-B7AKJlAM.js.map} +1 -1
- package/dist/{EmojiPicker-CXFd-iVj.cjs → EmojiPicker-KbIfc-GH.cjs} +1 -1
- package/dist/{EmojiPicker-CXFd-iVj.cjs.map → EmojiPicker-KbIfc-GH.cjs.map} +1 -1
- package/dist/{FilterPill-IBlswKiK.js → FilterPill-BR7FAmMG.js} +2 -2
- package/dist/{FilterPill-IBlswKiK.js.map → FilterPill-BR7FAmMG.js.map} +1 -1
- package/dist/FilterPill-DwapR9JK.cjs +2 -0
- package/dist/{FilterPill-DY9T19XB.cjs.map → FilterPill-DwapR9JK.cjs.map} +1 -1
- package/dist/{ForceLinkify-DhmBEXhe.cjs → ForceLinkify-D4FBhBxD.cjs} +1 -1
- package/dist/{ForceLinkify-DhmBEXhe.cjs.map → ForceLinkify-D4FBhBxD.cjs.map} +1 -1
- package/dist/{ForceLinkify-53Zegx7z.js → ForceLinkify-wTXS_wJS.js} +1 -1
- package/dist/{ForceLinkify-53Zegx7z.js.map → ForceLinkify-wTXS_wJS.js.map} +1 -1
- package/dist/{MarkdownRenderer-Cnbn7gje.js → MarkdownRenderer-3CVbodrq.js} +1 -1
- package/dist/{MarkdownRenderer-Cnbn7gje.js.map → MarkdownRenderer-3CVbodrq.js.map} +1 -1
- package/dist/{MarkdownRenderer-a12waV7r.cjs → MarkdownRenderer-CaBjENW6.cjs} +1 -1
- package/dist/{MarkdownRenderer-a12waV7r.cjs.map → MarkdownRenderer-CaBjENW6.cjs.map} +1 -1
- package/dist/{Resizable-DdP6uPio.cjs → Resizable-BQsHIvDC.cjs} +2 -2
- package/dist/{Resizable-DdP6uPio.cjs.map → Resizable-BQsHIvDC.cjs.map} +1 -1
- package/dist/{Resizable-Ddsm-H14.js → Resizable-F6PU5oKB.js} +3 -3
- package/dist/{Resizable-Ddsm-H14.js.map → Resizable-F6PU5oKB.js.map} +1 -1
- package/dist/{ResizableHandle-DQduVxrG.js → ResizableHandle-CqIIQvza.js} +3 -3
- package/dist/{ResizableHandle-DQduVxrG.js.map → ResizableHandle-CqIIQvza.js.map} +1 -1
- package/dist/{ResizableHandle-_ldmhyEw.cjs → ResizableHandle-VBoudEYy.cjs} +2 -2
- package/dist/{ResizableHandle-_ldmhyEw.cjs.map → ResizableHandle-VBoudEYy.cjs.map} +1 -1
- package/dist/{ResizableUtils-BptSHmLg.cjs → ResizableUtils-CZdVSd6q.cjs} +1 -1
- package/dist/{ResizableUtils-BptSHmLg.cjs.map → ResizableUtils-CZdVSd6q.cjs.map} +1 -1
- package/dist/{ResizableUtils-BIRNCdKB.js → ResizableUtils-CrBOa8js.js} +1 -1
- package/dist/{ResizableUtils-BIRNCdKB.js.map → ResizableUtils-CrBOa8js.js.map} +1 -1
- package/dist/{RichTextEditor-DhNhx5AH.js → RichTextEditor-DLiJCPI6.js} +5 -5
- package/dist/{RichTextEditor-DhNhx5AH.js.map → RichTextEditor-DLiJCPI6.js.map} +1 -1
- package/dist/{RichTextEditor-CjyvDYID.cjs → RichTextEditor-ECmStZDK.cjs} +2 -2
- package/dist/{RichTextEditor-CjyvDYID.cjs.map → RichTextEditor-ECmStZDK.cjs.map} +1 -1
- package/dist/{Scroller-D7MjyXun.js → Scroller-D6f0HvIT.js} +1 -1
- package/dist/{Scroller-D7MjyXun.js.map → Scroller-D6f0HvIT.js.map} +1 -1
- package/dist/{Scroller-Bt8TUghI.cjs → Scroller-EIHN3a26.cjs} +1 -1
- package/dist/{Scroller-Bt8TUghI.cjs.map → Scroller-EIHN3a26.cjs.map} +1 -1
- package/dist/{Slider-CfvbLBv5.cjs → Slider-BDgY7gNR.cjs} +2 -2
- package/dist/{Slider-CfvbLBv5.cjs.map → Slider-BDgY7gNR.cjs.map} +1 -1
- package/dist/{Slider-Xd5Aj9nS.js → Slider-Bg9KspmL.js} +3 -3
- package/dist/{Slider-Xd5Aj9nS.js.map → Slider-Bg9KspmL.js.map} +1 -1
- package/dist/Text-5MobHF6z.js +404 -0
- package/dist/Text-5MobHF6z.js.map +1 -0
- package/dist/Text-DNVNZree.cjs +2 -0
- package/dist/Text-DNVNZree.cjs.map +1 -0
- package/dist/{TextList-DUL3NwQp.cjs → TextList-1_ZM5zE3.cjs} +1 -1
- package/dist/{TextList-DUL3NwQp.cjs.map → TextList-1_ZM5zE3.cjs.map} +1 -1
- package/dist/{TextList-CkY7OAl2.js → TextList-DIj84CPZ.js} +1 -1
- package/dist/{TextList-CkY7OAl2.js.map → TextList-DIj84CPZ.js.map} +1 -1
- package/dist/{TextListItem-D96feMQf.js → TextListItem-BhmijfFO.js} +1 -1
- package/dist/{TextListItem-D96feMQf.js.map → TextListItem-BhmijfFO.js.map} +1 -1
- package/dist/{TextListItem-BI9M_J8Y.cjs → TextListItem-CVjrHr2_.cjs} +1 -1
- package/dist/{TextListItem-BI9M_J8Y.cjs.map → TextListItem-CVjrHr2_.cjs.map} +1 -1
- package/dist/{Toast-BXvUrvd_.cjs → Toast--W8p7jzA.cjs} +1 -1
- package/dist/{Toast-BXvUrvd_.cjs.map → Toast--W8p7jzA.cjs.map} +1 -1
- package/dist/{Toast-DmzQrYtG.js → Toast-4nsu1oxP.js} +1 -1
- package/dist/{Toast-DmzQrYtG.js.map → Toast-4nsu1oxP.js.map} +1 -1
- package/dist/{UseResizableCalculations-k6TSRlpa.js → UseResizableCalculations-B-yTU9ZI.js} +2 -2
- package/dist/{UseResizableCalculations-k6TSRlpa.js.map → UseResizableCalculations-B-yTU9ZI.js.map} +1 -1
- package/dist/{UseResizableCalculations-BNcxJfef.cjs → UseResizableCalculations-CahDXDOn.cjs} +2 -2
- package/dist/{UseResizableCalculations-BNcxJfef.cjs.map → UseResizableCalculations-CahDXDOn.cjs.map} +1 -1
- package/dist/component-documentation.json +1 -1
- package/dist/components/Banner/Banner.vue.d.ts +53 -1
- package/dist/components/Banner/Banner.vue.d.ts.map +1 -1
- package/dist/components/Checkbox/Checkbox.vue.d.ts +53 -1
- package/dist/components/Checkbox/Checkbox.vue.d.ts.map +1 -1
- package/dist/components/CheckboxGroup/CheckboxGroup.vue.d.ts +53 -1
- package/dist/components/Dropdown/Dropdown.vue.d.ts +0 -3
- package/dist/components/Dropdown/Dropdown.vue.d.ts.map +1 -1
- package/dist/components/EmojiPicker/EmojiPicker.vue.d.ts +53 -1
- package/dist/components/EmojiPicker/Modules/EmojiSearch.vue.d.ts +53 -1
- package/dist/components/EmojiPicker/Modules/EmojiSearch.vue.d.ts.map +1 -1
- package/dist/components/FilterPill/FilterPill.vue.d.ts +159 -6
- package/dist/components/FilterPill/FilterPill.vue.d.ts.map +1 -1
- package/dist/components/Input/Input.vue.d.ts +53 -1
- package/dist/components/Input/Input.vue.d.ts.map +1 -1
- package/dist/components/InputGroup/InputGroup.vue.d.ts +53 -1
- package/dist/components/InputGroup/InputGroup.vue.d.ts.map +1 -1
- package/dist/components/KeyboardShortcut/KeyboardShortcut.vue.d.ts +53 -1
- package/dist/components/Modal/Modal.vue.d.ts +53 -1
- package/dist/components/Modal/Modal.vue.d.ts.map +1 -1
- package/dist/components/Notice/Notice.vue.d.ts +53 -1
- package/dist/components/Notice/Notice.vue.d.ts.map +1 -1
- package/dist/components/Notice/NoticeContent.vue.d.ts +53 -1
- package/dist/components/Notice/NoticeContent.vue.d.ts.map +1 -1
- package/dist/components/Popover/Popover.vue.d.ts.map +1 -1
- package/dist/components/Radio/Radio.vue.d.ts +53 -1
- package/dist/components/Radio/Radio.vue.d.ts.map +1 -1
- package/dist/components/RadioGroup/RadioGroup.vue.d.ts +53 -1
- package/dist/components/RichTextEditor/Extensions/Mentions/MentionSuggestion.vue.d.ts +53 -1
- package/dist/components/RichTextEditor/Extensions/SlashCommand/SlashCommandSuggestion.vue.d.ts +53 -1
- package/dist/components/RichTextEditor/Extensions/Variable/VariableComponent.vue.d.ts +53 -1
- package/dist/components/SelectMenu/SelectMenu.vue.d.ts +53 -1
- package/dist/components/SelectMenu/SelectMenu.vue.d.ts.map +1 -1
- package/dist/components/SplitButton/SplitButton.vue.d.ts +0 -3
- package/dist/components/SplitButton/SplitButton.vue.d.ts.map +1 -1
- package/dist/components/Text/Text.vue.d.ts +53 -1
- package/dist/components/Text/Text.vue.d.ts.map +1 -1
- package/dist/components/Text/TextConstants.d.ts +2 -0
- package/dist/components/Text/TextConstants.d.ts.map +1 -1
- package/dist/components/Text/index.d.ts +1 -1
- package/dist/components/Text/modules/SlideViewport.vue.d.ts +38 -0
- package/dist/components/Text/modules/SlideViewport.vue.d.ts.map +1 -0
- package/dist/components/Text/modules/slide.d.ts +19 -0
- package/dist/components/Text/modules/slide.d.ts.map +1 -0
- package/dist/components/Toast/Layouts/ToastLayoutAlternate.vue.d.ts +53 -1
- package/dist/components/Toast/Layouts/ToastLayoutAlternate.vue.d.ts.map +1 -1
- package/dist/components/Toast/Layouts/ToastLayoutDefault.vue.d.ts +53 -1
- package/dist/components/Toast/Layouts/ToastLayoutDefault.vue.d.ts.map +1 -1
- package/dist/components/Toast/Toast.vue.d.ts +212 -4
- package/dist/components/Toast/Toast.vue.d.ts.map +1 -1
- package/dist/dialtone-vue.cjs +1 -1
- package/dist/dialtone-vue.js +27 -28
- package/dist/{floating-ui.dom-BUeA6pp4.js → floating-ui.dom-Cqf6X2Wc.js} +1 -1
- package/dist/{floating-ui.dom-BUeA6pp4.js.map → floating-ui.dom-Cqf6X2Wc.js.map} +1 -1
- package/dist/{floating-ui.dom-DF2uE3n8.cjs → floating-ui.dom-n1CheoWj.cjs} +1 -1
- package/dist/{floating-ui.dom-DF2uE3n8.cjs.map → floating-ui.dom-n1CheoWj.cjs.map} +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/lib/checkbox/checkbox.cjs +1 -1
- package/dist/lib/checkbox/checkbox.cjs.map +1 -1
- package/dist/lib/checkbox/checkbox.js +1 -1
- package/dist/lib/combobox/combobox.cjs +1 -1
- package/dist/lib/combobox/combobox.js +1 -1
- package/dist/lib/combobox/index.cjs +1 -1
- package/dist/lib/combobox/index.js +1 -1
- package/dist/lib/combobox-with-popover/combobox-with-popover.cjs +1 -1
- package/dist/lib/combobox-with-popover/combobox-with-popover.js +1 -1
- package/dist/lib/datepicker/datepicker.cjs +1 -1
- package/dist/lib/datepicker/datepicker.js +1 -1
- package/dist/lib/datepicker/index.cjs +1 -1
- package/dist/lib/datepicker/index.js +1 -1
- package/dist/lib/dropdown/dropdown-list.cjs +1 -1
- package/dist/lib/dropdown/dropdown-list.cjs.map +1 -1
- package/dist/lib/dropdown/dropdown-list.js +1 -1
- package/dist/lib/dropdown/dropdown.cjs +1 -1
- package/dist/lib/dropdown/dropdown.cjs.map +1 -1
- package/dist/lib/dropdown/dropdown.js +5 -15
- package/dist/lib/dropdown/dropdown.js.map +1 -1
- package/dist/lib/emoji-picker/emoji-picker.cjs +1 -1
- package/dist/lib/emoji-picker/emoji-picker.js +1 -1
- package/dist/lib/emoji-picker/index.cjs +1 -1
- package/dist/lib/emoji-picker/index.js +1 -1
- package/dist/lib/empty-state/empty-state.cjs +1 -1
- package/dist/lib/empty-state/empty-state.cjs.map +1 -1
- package/dist/lib/empty-state/empty-state.js +1 -1
- package/dist/lib/filter-pill/filter-pill.cjs +1 -1
- package/dist/lib/filter-pill/filter-pill.js +1 -1
- package/dist/lib/filter-pill/index.cjs +1 -1
- package/dist/lib/filter-pill/index.js +1 -1
- package/dist/lib/input/input.cjs +1 -1
- package/dist/lib/input/input.cjs.map +1 -1
- package/dist/lib/input/input.js +1 -1
- package/dist/lib/input-group/input-group.cjs +1 -1
- package/dist/lib/input-group/input-group.cjs.map +1 -1
- package/dist/lib/input-group/input-group.js +1 -1
- package/dist/lib/keyboard-shortcut/keyboard-shortcut.cjs +1 -1
- package/dist/lib/keyboard-shortcut/keyboard-shortcut.cjs.map +1 -1
- package/dist/lib/keyboard-shortcut/keyboard-shortcut.js +1 -1
- package/dist/lib/kitchen-sink/kitchen-sink-view.cjs +1 -1
- package/dist/lib/kitchen-sink/kitchen-sink-view.cjs.map +1 -1
- package/dist/lib/kitchen-sink/kitchen-sink-view.js +1 -1
- package/dist/lib/modal/modal.cjs +1 -1
- package/dist/lib/modal/modal.cjs.map +1 -1
- package/dist/lib/modal/modal.js +1 -1
- package/dist/lib/notice/notice-content.cjs +1 -1
- package/dist/lib/notice/notice-content.cjs.map +1 -1
- package/dist/lib/notice/notice-content.js +1 -1
- package/dist/lib/popover/popover.cjs +1 -1
- package/dist/lib/popover/popover.cjs.map +1 -1
- package/dist/lib/popover/popover.js +6 -1
- package/dist/lib/popover/popover.js.map +1 -1
- package/dist/lib/radio/radio.cjs +1 -1
- package/dist/lib/radio/radio.cjs.map +1 -1
- package/dist/lib/radio/radio.js +1 -1
- package/dist/lib/resizable/index.cjs +1 -1
- package/dist/lib/resizable/index.js +3 -3
- package/dist/lib/resizable/resizable-handle.cjs +1 -1
- package/dist/lib/resizable/resizable-handle.js +1 -1
- package/dist/lib/resizable/resizable-panel.cjs +1 -1
- package/dist/lib/resizable/resizable-panel.js +1 -1
- package/dist/lib/resizable/resizable.cjs +1 -1
- package/dist/lib/resizable/resizable.js +1 -1
- package/dist/lib/rich-text-editor/force-linkify.cjs +1 -1
- package/dist/lib/rich-text-editor/force-linkify.js +1 -1
- package/dist/lib/rich-text-editor/index.cjs +1 -1
- package/dist/lib/rich-text-editor/index.js +1 -1
- package/dist/lib/rich-text-editor/markdown-renderer.cjs +1 -1
- package/dist/lib/rich-text-editor/markdown-renderer.js +1 -1
- package/dist/lib/rich-text-editor/rich-text-editor.cjs +1 -1
- package/dist/lib/rich-text-editor/rich-text-editor.js +1 -1
- package/dist/lib/scroller/index.cjs +1 -1
- package/dist/lib/scroller/index.js +1 -1
- package/dist/lib/scroller/scroller.cjs +1 -1
- package/dist/lib/scroller/scroller.js +1 -1
- package/dist/lib/select-menu/select-menu.cjs +1 -1
- package/dist/lib/select-menu/select-menu.cjs.map +1 -1
- package/dist/lib/select-menu/select-menu.js +1 -1
- package/dist/lib/slider/index.cjs +1 -1
- package/dist/lib/slider/index.js +1 -1
- package/dist/lib/slider/slider.cjs +1 -1
- package/dist/lib/slider/slider.js +1 -1
- package/dist/lib/text/index.cjs +1 -1
- package/dist/lib/text/index.js +3 -3
- package/dist/lib/text/text-constants.cjs +1 -1
- package/dist/lib/text/text-constants.cjs.map +1 -1
- package/dist/lib/text/text-constants.js +5 -4
- package/dist/lib/text/text-constants.js.map +1 -1
- package/dist/lib/text/text.cjs +1 -2
- package/dist/lib/text/text.js +2 -184
- package/dist/lib/text-list/index.cjs +1 -1
- package/dist/lib/text-list/index.js +2 -2
- package/dist/lib/text-list/text-list-item.cjs +1 -1
- package/dist/lib/text-list/text-list-item.js +1 -1
- package/dist/lib/text-list/text-list.cjs +1 -1
- package/dist/lib/text-list/text-list.js +1 -1
- package/dist/lib/toast/index.cjs +1 -1
- package/dist/lib/toast/index.js +1 -1
- package/dist/lib/toast/toast.cjs +1 -1
- package/dist/lib/toast/toast.js +1 -1
- package/package.json +9 -4
- package/dist/FilterPill-DY9T19XB.cjs +0 -2
- package/dist/lib/text/text.cjs.map +0 -1
- package/dist/lib/text/text.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkbox.cjs","names":[],"sources":["../../../components/Checkbox/Checkbox.vue"],"sourcesContent":["<template>\n <div\n :class=\"$attrs.class\"\n :style=\"$attrs.style\"\n >\n <label :class=\"['d-checkbox-group', { 'd-checkbox-group--disabled': internalDisabled }]\">\n <div class=\"d-checkbox__input\">\n <input\n type=\"checkbox\"\n :checked=\"internalChecked\"\n :name=\"internalName\"\n :value=\"value\"\n :disabled=\"internalDisabled\"\n :class=\"['d-checkbox', inputValidationClass, inputClass]\"\n :aria-label=\"!showLabel && label ? label : undefined\"\n :aria-invalid=\"ariaInvalid\"\n :aria-describedby=\"ariaDescribedBy\"\n v-bind=\"removeClassStyleAttrs($attrs)\"\n :indeterminate.prop=\"internalIndeterminate\"\n v-on=\"inputListeners\"\n >\n </div>\n <dt-text\n v-if=\"hasLabel\"\n as=\"div\"\n kind=\"label\"\n :size=\"resolvedLabelSize\"\n :strength=\"labelStrength ?? 'normal'\"\n :tone=\"internalDisabled ? 'disabled' : 'primary'\"\n :class=\"[labelClass, 'd-checkbox__copy d-checkbox__label']\"\n v-bind=\"labelChildProps\"\n data-qa=\"checkbox-label\"\n >\n <!-- @slot slot for Checkbox Label -->\n <slot>{{ label }}</slot>\n </dt-text>\n </label>\n <div\n class=\"d-checkbox__messages\"\n data-qa=\"checkbox-description-messages\"\n >\n <dt-text\n v-if=\"$slots.description || description\"\n kind=\"body\"\n :size=\"200\"\n tone=\"tertiary\"\n as=\"div\"\n :class=\"['d-description', descriptionClass]\"\n v-bind=\"descriptionChildProps\"\n data-qa=\"checkbox-description\"\n >\n <!-- @slot slot for Checkbox Description -->\n <slot name=\"description\">\n {{ description }}\n </slot>\n </dt-text>\n <dt-validation-messages\n v-bind=\"messagesChildProps\"\n :id=\"messagesId\"\n :validation-messages=\"formattedMessages\"\n :show-messages=\"showMessages\"\n :class=\"messagesClass\"\n data-qa=\"dt-checkbox-validation-messages\"\n />\n </div>\n </div>\n</template>\n\n<script>\n// Imports\nimport {\n InputMixin,\n CheckableMixin,\n GroupableMixin,\n MessagesMixin,\n} from '@/common/mixins/input';\nimport { removeClassStyleAttrs, getUniqueString, getValidationState } from '@/common/utils';\nimport { VALIDATION_MESSAGE_TYPES } from '@/common/constants';\nimport { CHECKBOX_INPUT_VALIDATION_CLASSES } from './CheckboxConstants';\nimport { DtValidationMessages } from '../ValidationMessages';\nimport { DtText, TEXT_SIZE_MODIFIERS, TEXT_STRENGTH_MODIFIERS } from '@/components/Text';\n\n/**\n * Checkboxes are control elements that allow the user to make a selection.They are typically used in a\n * Checkbox Group which allows the user to make one or more selections from a list of options.\n * @see https://dialtone.dialpad.com/components/checkbox.html\n */\nexport default {\n name: 'DtCheckbox',\n\n components: { DtValidationMessages, DtText },\n\n mixins: [InputMixin, CheckableMixin, GroupableMixin, MessagesMixin],\n\n inheritAttrs: false,\n\n props: {\n /**\n * Determines visibility of checkbox label.\n * @values true, false\n */\n showLabel: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Overrides the label text size.\n * @values 100, 200, 300, 400\n */\n labelSize: {\n type: [String, Number],\n default: null,\n validator: (s) => TEXT_SIZE_MODIFIERS.label.includes(String(s)),\n },\n\n /**\n * Overrides the label font weight.\n * @values bold, semibold, medium, normal\n */\n labelStrength: {\n type: String,\n default: null,\n validator: (s) => Object.keys(TEXT_STRENGTH_MODIFIERS).includes(s),\n },\n },\n\n emits: [\n /**\n * Event fired to sync the modelValue prop with the parent component\n *\n * @event update:modelValue\n * @type {Boolean}\n */\n 'update:modelValue',\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 data () {\n return {\n messagesId: getUniqueString(),\n };\n },\n\n computed: {\n resolvedLabelSize () {\n return this.labelSize ?? 300;\n },\n\n inputValidationClass () {\n return CHECKBOX_INPUT_VALIDATION_CLASSES[this.internalValidationState];\n },\n\n checkboxGroupValueChecked () {\n return this.groupContext?.selectedValues?.includes(this.value) ?? false;\n },\n\n hasLabelContent () {\n return !!(this.$slots.default || this.label);\n },\n\n hasLabel () {\n return this.showLabel && this.hasLabelContent;\n },\n\n hasMessages () {\n return this.formattedMessages.length && this.showMessages;\n },\n\n ariaInvalid () {\n return getValidationState(this.formattedMessages) === VALIDATION_MESSAGE_TYPES.CRITICAL ? 'true' : undefined;\n },\n\n ariaDescribedBy () {\n return this.showMessages && this.formattedMessages.length > 0 ? this.messagesId : undefined;\n },\n\n inputListeners () {\n return {\n /*\n * Override input listener to as no-op. Prevents parent input listeners from being passed through\n * onto the input element which will result in the handler being called twice\n * (once on the input element and once by the emitted input event by the change listener).\n */\n input: () => {},\n focusin: event => this.$emit('focusin', event),\n focusout: event => this.$emit('focusout', event),\n change: event => this.emitValue(event.target),\n };\n },\n },\n\n watch: {\n checkboxGroupValueChecked: {\n immediate: true,\n handler (newCheckboxGroupValueChecked) {\n if (this.hasGroup) {\n // update internal value when the checkbox group value changes\n this.internalChecked = newCheckboxGroupValueChecked;\n }\n },\n },\n },\n\n mounted () {\n this.runValidations();\n },\n\n methods: {\n removeClassStyleAttrs,\n\n emitValue (target) {\n let { value, checked } = target;\n // Expected: Indeterminate -> unchecked. We need to manually set DOM property `checked` to false\n // and update this.internalIndeterminate.\n if (this.internalIndeterminate) {\n checked = false;\n this.internalIndeterminate = false;\n target.checked = false;\n }\n // update provided value if injected\n this.setGroupValue(value, checked);\n\n // emit the state of the checkbox\n this.$emit('update:modelValue', checked);\n },\n\n runValidations () {\n if (!this.hasLabelContent && !this.$attrs['aria-label']) {\n console.warn(\n '[Dialtone] A label is required for accessibility. Provide a label prop and use show-label=\"false\" to hide it visually.',\n );\n }\n },\n },\n};\n</script>\n"],"mappings":"mgBAuFA,IAAK,EAAU,CACb,KAAM,aAEN,WAAY,CAAE,qBAAA,E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AK,QACJ,KAAM,EAAA,kBACN,SAAU,EAAA,eAAa,SACvB,KAAM,EAAA,iBAAgB,WAAA,UACtB,MAAK,CAAG,EAAA,WAAU,qCAAA,EACX,EAAA,gBAAe,CACvB,UAAQ,iBAAgB,CAAA,CAAA,2BAGA,EAAA,EAAA,EAAA,YAAA,EAAA,OAAA,UAAA,EAAA,KAAA,EAAA,EAAA,EAAA,kBAAA,EAAA,EAAA,iBAAf,EAAA,MAAK,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,2GA8BZ,MA3BN,EA2BM,CAtBI,EAAA,OAAO,aAAe,EAAA,cAAA,EAAA,EAAA,YAAA,EAAA,EAAA,EAAA,aAapB,GAAA,EAAA,EAAA,YAAA,OAZR,KAAK,OACJ,KAAM,IACP,KAAK,WACL,GAAG,MACF,MAAK,CAAA,gBAAoB,EAAA,iBAAgB,EAClC,EAAA,sBAAqB,CAC7B,UAAQ,uBAAsB,CAAA,CAAA,2BAKvB,EAAA,EAAA,EAAA,YAAA,EAAA,OAAA,cAAA,EAAA,KAAA,EAAA,EAAA,EAAA,kBAAA,EAAA,EAAA,iBADF,EAAA,YAAW,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,uEAUhB,GAAA,EAAA,EAAA,YAAA,EANQ,mBAAkB,CACzB,GAAI,EAAA,WACJ,sBAAqB,EAAA,kBACrB,gBAAe,EAAA,aACf,MAAO,EAAA,cACR,UAAQ"}
|
|
1
|
+
{"version":3,"file":"checkbox.cjs","names":[],"sources":["../../../components/Checkbox/Checkbox.vue"],"sourcesContent":["<template>\n <div\n :class=\"$attrs.class\"\n :style=\"$attrs.style\"\n >\n <label :class=\"['d-checkbox-group', { 'd-checkbox-group--disabled': internalDisabled }]\">\n <div class=\"d-checkbox__input\">\n <input\n type=\"checkbox\"\n :checked=\"internalChecked\"\n :name=\"internalName\"\n :value=\"value\"\n :disabled=\"internalDisabled\"\n :class=\"['d-checkbox', inputValidationClass, inputClass]\"\n :aria-label=\"!showLabel && label ? label : undefined\"\n :aria-invalid=\"ariaInvalid\"\n :aria-describedby=\"ariaDescribedBy\"\n v-bind=\"removeClassStyleAttrs($attrs)\"\n :indeterminate.prop=\"internalIndeterminate\"\n v-on=\"inputListeners\"\n >\n </div>\n <dt-text\n v-if=\"hasLabel\"\n as=\"div\"\n kind=\"label\"\n :size=\"resolvedLabelSize\"\n :strength=\"labelStrength ?? 'normal'\"\n :tone=\"internalDisabled ? 'disabled' : 'primary'\"\n :class=\"[labelClass, 'd-checkbox__copy d-checkbox__label']\"\n v-bind=\"labelChildProps\"\n data-qa=\"checkbox-label\"\n >\n <!-- @slot slot for Checkbox Label -->\n <slot>{{ label }}</slot>\n </dt-text>\n </label>\n <div\n class=\"d-checkbox__messages\"\n data-qa=\"checkbox-description-messages\"\n >\n <dt-text\n v-if=\"$slots.description || description\"\n kind=\"body\"\n :size=\"200\"\n tone=\"tertiary\"\n as=\"div\"\n :class=\"['d-description', descriptionClass]\"\n v-bind=\"descriptionChildProps\"\n data-qa=\"checkbox-description\"\n >\n <!-- @slot slot for Checkbox Description -->\n <slot name=\"description\">\n {{ description }}\n </slot>\n </dt-text>\n <dt-validation-messages\n v-bind=\"messagesChildProps\"\n :id=\"messagesId\"\n :validation-messages=\"formattedMessages\"\n :show-messages=\"showMessages\"\n :class=\"messagesClass\"\n data-qa=\"dt-checkbox-validation-messages\"\n />\n </div>\n </div>\n</template>\n\n<script>\n// Imports\nimport {\n InputMixin,\n CheckableMixin,\n GroupableMixin,\n MessagesMixin,\n} from '@/common/mixins/input';\nimport { removeClassStyleAttrs, getUniqueString, getValidationState } from '@/common/utils';\nimport { VALIDATION_MESSAGE_TYPES } from '@/common/constants';\nimport { CHECKBOX_INPUT_VALIDATION_CLASSES } from './CheckboxConstants';\nimport { DtValidationMessages } from '../ValidationMessages';\nimport { DtText, TEXT_SIZE_MODIFIERS, TEXT_STRENGTH_MODIFIERS } from '@/components/Text';\n\n/**\n * Checkboxes are control elements that allow the user to make a selection.They are typically used in a\n * Checkbox Group which allows the user to make one or more selections from a list of options.\n * @see https://dialtone.dialpad.com/components/checkbox.html\n */\nexport default {\n name: 'DtCheckbox',\n\n components: { DtValidationMessages, DtText },\n\n mixins: [InputMixin, CheckableMixin, GroupableMixin, MessagesMixin],\n\n inheritAttrs: false,\n\n props: {\n /**\n * Determines visibility of checkbox label.\n * @values true, false\n */\n showLabel: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Overrides the label text size.\n * @values 100, 200, 300, 400\n */\n labelSize: {\n type: [String, Number],\n default: null,\n validator: (s) => TEXT_SIZE_MODIFIERS.label.includes(String(s)),\n },\n\n /**\n * Overrides the label font weight.\n * @values bold, semibold, medium, normal\n */\n labelStrength: {\n type: String,\n default: null,\n validator: (s) => Object.keys(TEXT_STRENGTH_MODIFIERS).includes(s),\n },\n },\n\n emits: [\n /**\n * Event fired to sync the modelValue prop with the parent component\n *\n * @event update:modelValue\n * @type {Boolean}\n */\n 'update:modelValue',\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 data () {\n return {\n messagesId: getUniqueString(),\n };\n },\n\n computed: {\n resolvedLabelSize () {\n return this.labelSize ?? 300;\n },\n\n inputValidationClass () {\n return CHECKBOX_INPUT_VALIDATION_CLASSES[this.internalValidationState];\n },\n\n checkboxGroupValueChecked () {\n return this.groupContext?.selectedValues?.includes(this.value) ?? false;\n },\n\n hasLabelContent () {\n return !!(this.$slots.default || this.label);\n },\n\n hasLabel () {\n return this.showLabel && this.hasLabelContent;\n },\n\n hasMessages () {\n return this.formattedMessages.length && this.showMessages;\n },\n\n ariaInvalid () {\n return getValidationState(this.formattedMessages) === VALIDATION_MESSAGE_TYPES.CRITICAL ? 'true' : undefined;\n },\n\n ariaDescribedBy () {\n return this.showMessages && this.formattedMessages.length > 0 ? this.messagesId : undefined;\n },\n\n inputListeners () {\n return {\n /*\n * Override input listener to as no-op. Prevents parent input listeners from being passed through\n * onto the input element which will result in the handler being called twice\n * (once on the input element and once by the emitted input event by the change listener).\n */\n input: () => {},\n focusin: event => this.$emit('focusin', event),\n focusout: event => this.$emit('focusout', event),\n change: event => this.emitValue(event.target),\n };\n },\n },\n\n watch: {\n checkboxGroupValueChecked: {\n immediate: true,\n handler (newCheckboxGroupValueChecked) {\n if (this.hasGroup) {\n // update internal value when the checkbox group value changes\n this.internalChecked = newCheckboxGroupValueChecked;\n }\n },\n },\n },\n\n mounted () {\n this.runValidations();\n },\n\n methods: {\n removeClassStyleAttrs,\n\n emitValue (target) {\n let { value, checked } = target;\n // Expected: Indeterminate -> unchecked. We need to manually set DOM property `checked` to false\n // and update this.internalIndeterminate.\n if (this.internalIndeterminate) {\n checked = false;\n this.internalIndeterminate = false;\n target.checked = false;\n }\n // update provided value if injected\n this.setGroupValue(value, checked);\n\n // emit the state of the checkbox\n this.$emit('update:modelValue', checked);\n },\n\n runValidations () {\n if (!this.hasLabelContent && !this.$attrs['aria-label']) {\n console.warn(\n '[Dialtone] A label is required for accessibility. Provide a label prop and use show-label=\"false\" to hide it visually.',\n );\n }\n },\n },\n};\n</script>\n"],"mappings":"0gBAuFA,IAAK,EAAU,CACb,KAAM,aAEN,WAAY,CAAE,qBAAA,EAAA,QAAsB,OAAA,EAAA,EAAQ,CAE5C,OAAQ,CAAC,EAAA,WAAY,EAAA,eAAgB,EAAA,eAAgB,EAAA,cAAc,CAEnE,aAAc,GAEd,MAAO,CAKL,UAAW,CACT,KAAM,QACN,QAAS,GACV,CAMD,UAAW,CACT,KAAM,CAAC,OAAQ,OAAO,CACtB,QAAS,KACT,UAAY,GAAM,EAAA,oBAAoB,MAAM,SAAS,OAAO,EAAE,CAAC,CAChE,CAMD,cAAe,CACb,KAAM,OACN,QAAS,KACT,UAAY,GAAM,OAAO,KAAK,EAAA,wBAAwB,CAAC,SAAS,EAAE,CACnE,CACF,CAED,MAAO,CAOL,oBAQA,UAQA,WACD,C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,EAAA,EAAA,YAAA,OAZR,KAAK,OACJ,KAAM,IACP,KAAK,WACL,GAAG,MACF,MAAK,CAAA,gBAAoB,EAAA,iBAAgB,EAClC,EAAA,sBAAqB,CAC7B,UAAQ,uBAAsB,CAAA,CAAA,2BAKvB,EAAA,EAAA,EAAA,YAAA,EAAA,OAAA,cAAA,EAAA,KAAA,EAAA,EAAA,EAAA,kBAAA,EAAA,EAAA,iBADF,EAAA,YAAW,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,uEAUhB,GAAA,EAAA,EAAA,YAAA,EANQ,mBAAkB,CACzB,GAAI,EAAA,WACJ,sBAAqB,EAAA,kBACrB,gBAAe,EAAA,aACf,MAAO,EAAA,cACR,UAAQ"}
|
|
@@ -4,7 +4,7 @@ import { CheckableMixin as i, GroupableMixin as a, InputMixin as o, MessagesMixi
|
|
|
4
4
|
import { t as c } from "../../_plugin-vue_export-helper-BTgDAbhb.js";
|
|
5
5
|
import l from "../validation-messages/validation-messages.js";
|
|
6
6
|
import { TEXT_SIZE_MODIFIERS as u, TEXT_STRENGTH_MODIFIERS as d } from "../text/text-constants.js";
|
|
7
|
-
import f from "
|
|
7
|
+
import { t as f } from "../../Text-5MobHF6z.js";
|
|
8
8
|
import { CHECKBOX_INPUT_VALIDATION_CLASSES as p } from "./checkbox-constants.js";
|
|
9
9
|
import { createBlock as m, createCommentVNode as h, createElementBlock as g, createElementVNode as _, createTextVNode as v, createVNode as y, mergeProps as b, normalizeClass as x, normalizeStyle as S, openBlock as C, renderSlot as w, resolveComponent as T, toDisplayString as E, toHandlers as D, withCtx as O } from "vue";
|
|
10
10
|
//#region components/Checkbox/Checkbox.vue
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require(`../../Combobox-
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require(`../../Combobox-DdBIRmeH.cjs`);exports.default=e.t;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as e } from "../../Combobox-
|
|
1
|
+
import { t as e } from "../../Combobox-DP8tbe6x.js";
|
|
2
2
|
export { e as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../../Combobox-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../../Combobox-DdBIRmeH.cjs`),t=require(`./combobox-constants.cjs`);exports.COMBOBOX_LABEL_SIZES=t.COMBOBOX_LABEL_SIZES,exports.DtCombobox=e.t;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}}),require(`../../chunk-Bmb41Sf3.cjs`);const e=require(`../../common/constants/sizes.cjs`),t=require(`../../common/constants/index.cjs`),n=require(`../../common/validators/index.cjs`),r=require(`../../common/utils/index.cjs`),i=require(`../../_plugin-vue_export-helper-D8jCH6HB.cjs`),a=require(`../../mode_constants-CzYJW9ua.cjs`),o=require(`../combobox/combobox-loading-list.cjs`),s=require(`../combobox/combobox-empty-list.cjs`),c=require(`../../Combobox-
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}}),require(`../../chunk-Bmb41Sf3.cjs`);const e=require(`../../common/constants/sizes.cjs`),t=require(`../../common/constants/index.cjs`),n=require(`../../common/validators/index.cjs`),r=require(`../../common/utils/index.cjs`),i=require(`../../_plugin-vue_export-helper-D8jCH6HB.cjs`),a=require(`../../mode_constants-CzYJW9ua.cjs`),o=require(`../combobox/combobox-loading-list.cjs`),s=require(`../combobox/combobox-empty-list.cjs`),c=require(`../../Combobox-DdBIRmeH.cjs`),l=require(`../combobox/combobox-constants.cjs`),u=require(`../popover/popover-constants.cjs`),d=require(`../popover/popover.cjs`),f=require(`../dropdown/dropdown-constants.cjs`);let p=require(`vue`);var m={name:`DtComboboxWithPopover`,components:{DtCombobox:c.t,DtPopover:d.default,ComboboxLoadingList:o.default,ComboboxEmptyList:s.default},props:{contentMode:a.t,label:{type:String,required:!0},showLabel:{type:Boolean,default:!0},size:{type:[String,Number],default:null,validator:t=>t===null||Object.values(l.COMBOBOX_LABEL_SIZES).includes(t)||n.ordinalSizeValidator(e.COMPONENT_SIZES)(t)},description:{type:String,default:``},showList:{type:Boolean,default:null},listId:{type:String,default(){return r.getUniqueString()}},listClass:{type:[String,Array,Object],default:``},headerClass:{type:[String,Array,Object],default:``},footerClass:{type:[String,Array,Object],default:``},dialogClass:{type:[String,Array,Object],default:``},onBeginningOfList:{type:Function,default:null},onEndOfList:{type:Function,default:null},maxHeight:{type:String,default:``},maxWidth:{type:String,default:``},padding:{type:String,default:`small`,validator:e=>Object.keys(f.DROPDOWN_PADDING_CLASSES).some(t=>t===e)},contentWidth:{type:String,default:null,validator:e=>u.POPOVER_CONTENT_WIDTHS.includes(e)},openWithArrowKeys:{type:Boolean,default:!1},popoverOffset:{type:Array,default:()=>[0,4]},popoverSticky:{type:[Boolean,String],default:!1},hasSuggestionList:{type:Boolean,default:!0},loading:{type:Boolean,default:!1},emptyList:{type:Boolean,default:!1},emptyStateMessage:{type:String,default:``},appendTo:{type:[t.HTML_ELEMENT_TYPE,String],default:`body`,validator:e=>u.POPOVER_APPEND_TO_VALUES.includes(e)||e instanceof HTMLElement},transition:{type:String,default:`fade`}},emits:[`select`,`escape`,`highlight`,`opened`],data(){return{DROPDOWN_PADDING_CLASSES:f.DROPDOWN_PADDING_CLASSES,isListShown:!1,isInputFocused:!1,isListFocused:!1,externalAnchor:r.getUniqueString(),hasSlotContent:r.hasSlotContent}},computed:{comboboxListeners(){return{...this.$attrs,onSelect:this.onSelect,onEscape:this.onEscape,onHighlight:this.onHighlight}}},watch:{showList:{handler:function(e){e!==null&&(this.isListShown=e)},immediate:!0},isListShown(e){e?window.addEventListener(`mousedown`,this.onFocusOut):window.removeEventListener(`mousedown`,this.onFocusOut),this.onOpened(e)}},methods:{handleDisplayList(e){!this.hasSuggestionList&&e&&this.showComboboxList(),!this.hasSuggestionList&&!e&&this.closeComboboxList()},showComboboxList(){this.showList??(this.isListShown=!0)},closeComboboxList(){this.showList??(this.isListShown=!1)},onSelect(e){this.loading||(this.$emit(`select`,e),this.hasSuggestionList||this.closeComboboxList())},onEscape(){this.$emit(`escape`),this.closeComboboxList()},onHighlight(e){this.loading||this.$emit(`highlight`,e)},onOpened(e){this.$emit(`opened`,e)},onFocusIn(e){this.hasSuggestionList&&e&&this.$refs.input?.querySelector(`input`)===e.target&&this.showComboboxList()},onFocusOut(e){let t=this.$refs.popover?.tip?.popper,n=this.$refs.input;e.composedPath()?.some(e=>[t,n].includes(e))||this.closeComboboxList()},openOnArrowKeyPress(){this.showList!==null||this.isListShown||!this.openWithArrowKeys||this.showComboboxList()}}},h=[`id`],g=[`onMouseleave`,`onFocusout`];function _(e,t,n,r,i,a){let o=(0,p.resolveComponent)(`combobox-loading-list`),s=(0,p.resolveComponent)(`combobox-empty-list`),c=(0,p.resolveComponent)(`dt-popover`),l=(0,p.resolveComponent)(`dt-combobox`);return(0,p.openBlock)(),(0,p.createBlock)(l,(0,p.mergeProps)({ref:`combobox`,loading:n.loading,label:n.label,"show-label":n.showLabel,size:n.size,description:n.description,"empty-list":n.emptyList,"empty-state-message":n.emptyStateMessage,"show-list":i.isListShown,"on-beginning-of-list":n.onBeginningOfList,"on-end-of-list":n.onEndOfList,"list-rendered-outside":!0,"list-id":n.listId,"data-qa":`dt-combobox`},a.comboboxListeners),{input:(0,p.withCtx)(({inputProps:n})=>[(0,p.createElementVNode)(`div`,{id:i.externalAnchor,ref:`input`,onFocusin:t[0]||(t[0]=(...e)=>a.onFocusIn&&a.onFocusIn(...e)),onKeydown:[t[1]||(t[1]=(0,p.withKeys)(e=>a.openOnArrowKeyPress(e),[`up`])),t[2]||(t[2]=(0,p.withKeys)(e=>a.openOnArrowKeyPress(e),[`down`]))]},[(0,p.renderSlot)(e.$slots,`input`,{inputProps:n,onInput:a.handleDisplayList})],40,h)]),list:(0,p.withCtx)(({opened:r,listProps:a,clearHighlightIndex:l})=>[(0,p.createVNode)(c,{ref:`popover`,open:i.isListShown,"onUpdate:open":t[3]||(t[3]=e=>i.isListShown=e),"close-on-click":!1,"max-height":n.maxHeight,"max-width":n.maxWidth,offset:n.popoverOffset,sticky:n.popoverSticky,"content-mode":n.contentMode,placement:`bottom-start`,"initial-focus-element":`none`,padding:`none`,role:`listbox`,"external-anchor":i.externalAnchor,"content-width":n.contentWidth,"content-appear":!0,"content-tabindex":null,modal:!1,"auto-focus":!1,"append-to":n.appendTo,"dialog-class":n.dialogClass,transition:n.transition,onOpened:r},(0,p.createSlots)({content:(0,p.withCtx)(()=>[(0,p.createElementVNode)(`div`,{ref:`listWrapper`,class:(0,p.normalizeClass)([`d-combobox-with-popover__list`,i.DROPDOWN_PADDING_CLASSES[n.padding],n.listClass]),onMouseleave:l,onFocusout:l},[n.loading?((0,p.openBlock)(),(0,p.createBlock)(o,(0,p.normalizeProps)((0,p.mergeProps)({key:0},a)),null,16)):n.emptyList&&n.emptyStateMessage?((0,p.openBlock)(),(0,p.createBlock)(s,(0,p.mergeProps)({key:1},a,{message:n.emptyStateMessage}),null,16,[`message`])):(0,p.renderSlot)(e.$slots,`list`,{key:2,listProps:a})],42,g)]),_:2},[i.hasSlotContent(e.$slots.header)?{name:`headerContent`,fn:(0,p.withCtx)(()=>[(0,p.createElementVNode)(`div`,{ref:`header`,class:(0,p.normalizeClass)(n.headerClass)},[(0,p.renderSlot)(e.$slots,`header`)],2)]),key:`0`}:void 0,i.hasSlotContent(e.$slots.footer)?{name:`footerContent`,fn:(0,p.withCtx)(()=>[(0,p.createElementVNode)(`div`,{ref:`footer`,class:(0,p.normalizeClass)(n.footerClass)},[(0,p.renderSlot)(e.$slots,`footer`)],2)]),key:`1`}:void 0]),1032,[`open`,`max-height`,`max-width`,`offset`,`sticky`,`content-mode`,`external-anchor`,`content-width`,`append-to`,`dialog-class`,`transition`,`onOpened`])]),_:3},16,[`loading`,`label`,`show-label`,`size`,`description`,`empty-list`,`empty-state-message`,`show-list`,`on-beginning-of-list`,`on-end-of-list`,`list-id`])}var v=i.t(m,[[`render`,_]]);exports.default=v;
|
|
2
2
|
//# sourceMappingURL=combobox-with-popover.cjs.map
|
|
@@ -6,7 +6,7 @@ import { t as a } from "../../_plugin-vue_export-helper-BTgDAbhb.js";
|
|
|
6
6
|
import { t as o } from "../../mode_constants-tb7TL85q.js";
|
|
7
7
|
import s from "../combobox/combobox-loading-list.js";
|
|
8
8
|
import c from "../combobox/combobox-empty-list.js";
|
|
9
|
-
import { t as l } from "../../Combobox-
|
|
9
|
+
import { t as l } from "../../Combobox-DP8tbe6x.js";
|
|
10
10
|
import { COMBOBOX_LABEL_SIZES as u } from "../combobox/combobox-constants.js";
|
|
11
11
|
import { POPOVER_APPEND_TO_VALUES as d, POPOVER_CONTENT_WIDTHS as f } from "../popover/popover-constants.js";
|
|
12
12
|
import p from "../popover/popover.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require(`../../Datepicker-
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require(`../../Datepicker-Df6uR0r_.cjs`);exports.default=e.t;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as e } from "../../Datepicker-
|
|
1
|
+
import { t as e } from "../../Datepicker-CNFVUyyK.js";
|
|
2
2
|
export { e as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../../Datepicker-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../../Datepicker-Df6uR0r_.cjs`),t=require(`./format-utils.cjs`);exports.DtDatepicker=e.t,exports.formatLong=t.formatLong,exports.formatMedium=t.formatMedium,exports.formatNoYear=t.formatNoYear,exports.formatNumerical=t.formatNumerical,exports.formatShort=t.formatShort;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { t as e } from "../../Datepicker-
|
|
1
|
+
import { t as e } from "../../Datepicker-CNFVUyyK.js";
|
|
2
2
|
import { formatLong as t, formatMedium as n, formatNoYear as r, formatNumerical as i, formatShort as a } from "./format-utils.js";
|
|
3
3
|
export { e as DtDatepicker, t as formatLong, n as formatMedium, r as formatNoYear, i as formatNumerical, a as formatShort };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}}),require(`../../chunk-Bmb41Sf3.cjs`);const e=require(`../../_plugin-vue_export-helper-D8jCH6HB.cjs`),t=require(
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}}),require(`../../chunk-Bmb41Sf3.cjs`);const e=require(`../../_plugin-vue_export-helper-D8jCH6HB.cjs`),t=require(`../../Text-DNVNZree.cjs`),n=require(`../stack/stack.cjs`);let r=require(`vue`);var i={name:`DtDropdownList`,components:{DtStack:n.default,DtText:t.t},props:{heading:{type:String,default:``},listClass:{type:[String,Array,Object],default:``}}};function a(e,t,n,i,a,o){let s=(0,r.resolveComponent)(`dt-text`),c=(0,r.resolveComponent)(`dt-stack`);return(0,r.openBlock)(),(0,r.createElementBlock)(`li`,null,[n.heading?((0,r.openBlock)(),(0,r.createBlock)(c,{key:0,direction:`row`,align:`center`,class:`dt-dropdown-list--header d-py-50 d-px-150`},{default:(0,r.withCtx)(()=>[(0,r.createVNode)(s,{kind:`label`,size:100,strength:`bold`,tone:`muted`},{default:(0,r.withCtx)(()=>[(0,r.createTextVNode)((0,r.toDisplayString)(n.heading),1)]),_:1})]),_:1})):(0,r.createCommentVNode)(``,!0),(0,r.createElementVNode)(`ul`,{class:(0,r.normalizeClass)([`d-ps-relative`,`d-stack2`,`d-px-0`,n.listClass]),"data-qa":`dt-dropdown-list-wrapper`},[(0,r.renderSlot)(e.$slots,`default`)],2)])}var o=e.t(i,[[`render`,a]]);exports.default=o;
|
|
2
2
|
//# sourceMappingURL=dropdown-list.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dropdown-list.cjs","names":[],"sources":["../../../components/Dropdown/DropdownList.vue"],"sourcesContent":["<!-- eslint-disable vue/no-restricted-class -->\n<template>\n <li>\n <dt-stack\n v-if=\"heading\"\n direction=\"row\"\n align=\"center\"\n class=\"dt-dropdown-list--header d-py-50 d-px-150\"\n >\n <dt-text\n kind=\"label\"\n :size=\"100\"\n strength=\"bold\"\n tone=\"muted\"\n >\n {{ heading }}\n </dt-text>\n </dt-stack>\n <!-- eslint-disable vuejs-accessibility/mouse-events-have-key-events, dialtone/deprecated-stack-flow-classes -->\n <ul\n :class=\"['d-ps-relative', 'd-stack2', 'd-px-0', listClass]\"\n data-qa=\"dt-dropdown-list-wrapper\"\n >\n <!-- @slot Slot for the list component -->\n <slot />\n </ul>\n </li>\n</template>\n\n<script>\nimport { DtStack } from '@/components/Stack';\nimport { DtText } from '@/components/Text';\n\nexport default {\n name: 'DtDropdownList',\n components: { DtStack, DtText },\n props: {\n /**\n * List's heading.\n */\n heading: {\n type: String,\n default: '',\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</script>\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"dropdown-list.cjs","names":[],"sources":["../../../components/Dropdown/DropdownList.vue"],"sourcesContent":["<!-- eslint-disable vue/no-restricted-class -->\n<template>\n <li>\n <dt-stack\n v-if=\"heading\"\n direction=\"row\"\n align=\"center\"\n class=\"dt-dropdown-list--header d-py-50 d-px-150\"\n >\n <dt-text\n kind=\"label\"\n :size=\"100\"\n strength=\"bold\"\n tone=\"muted\"\n >\n {{ heading }}\n </dt-text>\n </dt-stack>\n <!-- eslint-disable vuejs-accessibility/mouse-events-have-key-events, dialtone/deprecated-stack-flow-classes -->\n <ul\n :class=\"['d-ps-relative', 'd-stack2', 'd-px-0', listClass]\"\n data-qa=\"dt-dropdown-list-wrapper\"\n >\n <!-- @slot Slot for the list component -->\n <slot />\n </ul>\n </li>\n</template>\n\n<script>\nimport { DtStack } from '@/components/Stack';\nimport { DtText } from '@/components/Text';\n\nexport default {\n name: 'DtDropdownList',\n components: { DtStack, DtText },\n props: {\n /**\n * List's heading.\n */\n heading: {\n type: String,\n default: '',\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</script>\n"],"mappings":"6RAiCA,IAAK,EAAU,CACb,KAAM,iBACN,WAAY,CAAE,QAAA,EAAA,QAAS,OAAA,EAAA,EAAQ,CAC/B,MAAO,CAIL,QAAS,CACP,KAAM,OACN,QAAS,GACV,CAKD,UAAW,CACT,KAAM,CAAC,OAAQ,MAAO,OAAO,CAC7B,QAAS,GACV,CACF,CACF,uJA3BM,KAAA,KAAA,CAtBK,EAAA,UAAA,EAAA,EAAA,YAAA,EAAA,EAAA,EAAA,aAaG,EAAA,OAZT,UAAU,MACV,MAAM,SACN,MAAM,wEASI,EAAA,EAAA,EAAA,aAAA,EAAA,CANR,KAAK,QACJ,KAAM,IACP,SAAS,OACT,KAAK,oCAEQ,EAAA,EAAA,EAAA,kBAAA,EAAA,EAAA,iBAAV,EAAA,QAAO,CAAA,EAAA,CAAA,CAAA,yEAUT,KAAA,CALF,OAAA,EAAA,EAAA,gBAAK,CAAA,gBAAA,WAAA,SAA0C,EAAA,UAAS,CAAA,CACzD,UAAQ,8CAGA,EAAA,OAAA,UAAA,CAAA,CAAA,EAAA,CAAA,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as e } from "../../_plugin-vue_export-helper-BTgDAbhb.js";
|
|
2
|
-
import t from "
|
|
2
|
+
import { t } from "../../Text-5MobHF6z.js";
|
|
3
3
|
import n from "../stack/stack.js";
|
|
4
4
|
import { createBlock as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, createTextVNode as s, createVNode as c, normalizeClass as l, openBlock as u, renderSlot as d, resolveComponent as f, toDisplayString as p, withCtx as m } from "vue";
|
|
5
5
|
//#region components/Dropdown/DropdownList.vue
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}}),require(`../../chunk-Bmb41Sf3.cjs`);const e=require(`../../common/constants/index.cjs`),t=require(`../../common/utils/index.cjs`),n=require(`../../_plugin-vue_export-helper-D8jCH6HB.cjs`),r=require(`../../common/mixins/keyboard-list-navigation.cjs`),i=require(`../../mode_constants-CzYJW9ua.cjs`),a=require(`../list-item/list-item-constants.cjs`),o=require(`../popover/popover-constants.cjs`),s=require(`../popover/popover.cjs`),c=require(`./dropdown-constants.cjs`);let l=require(`vue`);var u=e=>!!e?.classList.contains(`d-list-item--disabled`),d={name:`DtDropdown`,components:{DtPopover:s.default},mixins:[r.default({indexKey:`highlightIndex`,idKey:`highlightId`,listElementKey:`getListElement`,listItemRole:[`menuitem`,`menuitemradio`],afterHighlightMethod:`afterHighlight`,beginningOfListMethod:`beginningOfListMethod`,endOfListMethod:`endOfListMethod`,activeItemKey:`activeItemEl`,focusOnKeyboardNavigation:!0})],inheritAttrs:!1,props:{contentMode:i.t,open:{type:[Boolean,null],default:null},visibilityChangeCallback:{type:Function,default:null},forwardAnchorArrowKeys:{type:Boolean,default:!1},openOnContext:{type:Boolean,default:!1},padding:{type:String,default:`small`,validator:e=>Object.keys(c.DROPDOWN_PADDING_CLASSES).some(t=>t===e)},modal:{type:Boolean,default:!0},contentWidth:{type:String,default:null},maxHeight:{type:String,default:``},maxWidth:{type:String,default:``},listId:{type:String,default(){return t.getUniqueString()}},navigationType:{type:String,default:a.LIST_ITEM_NAVIGATION_TYPES.ARROW_KEYS,validator:e=>Object.values(a.LIST_ITEM_NAVIGATION_TYPES).includes(e)},fallbackPlacements:{type:Array,default:()=>[`auto`]},placement:{type:String,default:`bottom`},onBeginningOfList:{type:Function,default:null},onEndOfList:{type:Function,default:null},listClass:{type:[String,Array,Object],default:``},footerClass:{type:[String,Array,Object],default:``},appendTo:{type:[e.HTML_ELEMENT_TYPE,String],default:`body`,validator:e=>o.POPOVER_APPEND_TO_VALUES.includes(e)||e instanceof HTMLElement},tether:{type:Boolean,default:!0},transition:{type:String,default:`fade`}},emits:[`keydown`,`highlight`,`update:open`,`opened`],data(){return{LIST_ITEM_NAVIGATION_TYPES:a.LIST_ITEM_NAVIGATION_TYPES,DROPDOWN_PADDING_CLASSES:c.DROPDOWN_PADDING_CLASSES,EVENT_KEYNAMES:e.EVENT_KEYNAMES,openedWithKeyboard:!1,pendingArrowOpening:null,isOpen:null,isLogicallyOpen:!1}},computed:{popoverAttrs(){let{dialogClass:e,"dialog-class":t,...n}=this.$attrs;return{...n,dialogClass:[e,t,{"d-dropdown__menu--arrow-keys":this.isArrowKeyNav&&(!(`role`in n)||n.role===`menu`)}]}},dropdownListeners(){return{"update:open":e=>{this.$emit(`update:open`,e)},opened:e=>{this.updateInitialHighlightIndex(e)},keydown:t=>{let n=t.code,r=[e.EVENT_KEYNAMES.up,e.EVENT_KEYNAMES.arrowup,e.EVENT_KEYNAMES.down,e.EVENT_KEYNAMES.arrowdown].includes(n);if(this.forwardAnchorArrowKeys&&this.open!==null&&!this.isLogicallyOpen&&r&&this.$refs.popover?.$refs.anchor?.contains(t.target)){let e=Symbol(`arrow-opening`);this.pendingArrowOpening=e,this.openedWithKeyboard=!0,this.$emit(`keydown`,t),this.$nextTick(()=>{this.pendingArrowOpening===e&&!this.isLogicallyOpen&&(this.openedWithKeyboard=!1)});return}switch(n){case e.EVENT_KEYNAMES.up:case e.EVENT_KEYNAMES.arrowup:this.onUpKeyPress(t),t.stopPropagation(),t.preventDefault();break;case e.EVENT_KEYNAMES.down:case e.EVENT_KEYNAMES.arrowdown:this.onDownKeyPress(t),t.stopPropagation(),t.preventDefault();break;case e.EVENT_KEYNAMES.space:case e.EVENT_KEYNAMES.spacebar:this.onSpaceKey(t);break;case e.EVENT_KEYNAMES.enter:this.onEnterKey();break;case e.EVENT_KEYNAMES.home:this.onHomeKeyPress(t),t.stopPropagation(),t.preventDefault();break;case e.EVENT_KEYNAMES.end:this.onEndKeyPress(t),t.stopPropagation(),t.preventDefault();break;default:this.onKeyPress(t);break}this.$emit(`keydown`,t)}}},beginningOfListMethod(){return this.onBeginningOfList||this.
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}}),require(`../../chunk-Bmb41Sf3.cjs`);const e=require(`../../common/constants/index.cjs`),t=require(`../../common/utils/index.cjs`),n=require(`../../_plugin-vue_export-helper-D8jCH6HB.cjs`),r=require(`../../common/mixins/keyboard-list-navigation.cjs`),i=require(`../../mode_constants-CzYJW9ua.cjs`),a=require(`../list-item/list-item-constants.cjs`),o=require(`../popover/popover-constants.cjs`),s=require(`../popover/popover.cjs`),c=require(`./dropdown-constants.cjs`);let l=require(`vue`);var u=e=>!!e?.classList.contains(`d-list-item--disabled`),d={name:`DtDropdown`,components:{DtPopover:s.default},mixins:[r.default({indexKey:`highlightIndex`,idKey:`highlightId`,listElementKey:`getListElement`,listItemRole:[`menuitem`,`menuitemradio`],afterHighlightMethod:`afterHighlight`,beginningOfListMethod:`beginningOfListMethod`,endOfListMethod:`endOfListMethod`,activeItemKey:`activeItemEl`,focusOnKeyboardNavigation:!0})],inheritAttrs:!1,props:{contentMode:i.t,open:{type:[Boolean,null],default:null},visibilityChangeCallback:{type:Function,default:null},forwardAnchorArrowKeys:{type:Boolean,default:!1},openOnContext:{type:Boolean,default:!1},padding:{type:String,default:`small`,validator:e=>Object.keys(c.DROPDOWN_PADDING_CLASSES).some(t=>t===e)},modal:{type:Boolean,default:!0},contentWidth:{type:String,default:null},maxHeight:{type:String,default:``},maxWidth:{type:String,default:``},listId:{type:String,default(){return t.getUniqueString()}},navigationType:{type:String,default:a.LIST_ITEM_NAVIGATION_TYPES.ARROW_KEYS,validator:e=>Object.values(a.LIST_ITEM_NAVIGATION_TYPES).includes(e)},fallbackPlacements:{type:Array,default:()=>[`auto`]},placement:{type:String,default:`bottom`},onBeginningOfList:{type:Function,default:null},onEndOfList:{type:Function,default:null},listClass:{type:[String,Array,Object],default:``},footerClass:{type:[String,Array,Object],default:``},appendTo:{type:[e.HTML_ELEMENT_TYPE,String],default:`body`,validator:e=>o.POPOVER_APPEND_TO_VALUES.includes(e)||e instanceof HTMLElement},tether:{type:Boolean,default:!0},transition:{type:String,default:`fade`}},emits:[`keydown`,`highlight`,`update:open`,`opened`],data(){return{LIST_ITEM_NAVIGATION_TYPES:a.LIST_ITEM_NAVIGATION_TYPES,DROPDOWN_PADDING_CLASSES:c.DROPDOWN_PADDING_CLASSES,EVENT_KEYNAMES:e.EVENT_KEYNAMES,openedWithKeyboard:!1,pendingArrowOpening:null,isOpen:null,isLogicallyOpen:!1}},computed:{popoverAttrs(){let{dialogClass:e,"dialog-class":t,...n}=this.$attrs;return{...n,dialogClass:[e,t,{"d-dropdown__menu--arrow-keys":this.isArrowKeyNav&&(!(`role`in n)||n.role===`menu`)}]}},dropdownListeners(){return{"update:open":e=>{this.$emit(`update:open`,e)},opened:e=>{this.updateInitialHighlightIndex(e)},keydown:t=>{let n=t.code,r=[e.EVENT_KEYNAMES.up,e.EVENT_KEYNAMES.arrowup,e.EVENT_KEYNAMES.down,e.EVENT_KEYNAMES.arrowdown].includes(n);if(this.forwardAnchorArrowKeys&&this.open!==null&&!this.isLogicallyOpen&&r&&this.$refs.popover?.$refs.anchor?.contains(t.target)){let e=Symbol(`arrow-opening`);this.pendingArrowOpening=e,this.openedWithKeyboard=!0,this.$emit(`keydown`,t),this.$nextTick(()=>{this.pendingArrowOpening===e&&!this.isLogicallyOpen&&(this.openedWithKeyboard=!1)});return}switch(n){case e.EVENT_KEYNAMES.up:case e.EVENT_KEYNAMES.arrowup:this.onUpKeyPress(t),t.stopPropagation(),t.preventDefault();break;case e.EVENT_KEYNAMES.down:case e.EVENT_KEYNAMES.arrowdown:this.onDownKeyPress(t),t.stopPropagation(),t.preventDefault();break;case e.EVENT_KEYNAMES.space:case e.EVENT_KEYNAMES.spacebar:this.onSpaceKey(t);break;case e.EVENT_KEYNAMES.enter:this.onEnterKey();break;case e.EVENT_KEYNAMES.home:this.onHomeKeyPress(t),t.stopPropagation(),t.preventDefault();break;case e.EVENT_KEYNAMES.end:this.onEndKeyPress(t),t.stopPropagation(),t.preventDefault();break;default:this.onKeyPress(t);break}this.$emit(`keydown`,t)}}},beginningOfListMethod(){return this.onBeginningOfList||this.jumpToEnd},endOfListMethod(){return this.onEndOfList||this.jumpToBeginning},activeItemEl(){return this.highlightId&&this._getListItemNodes()?.find(e=>e.id===this.highlightId)||null},isArrowKeyNav(){return this.navigationType===this.LIST_ITEM_NAVIGATION_TYPES.ARROW_KEYS},listClasses(){return[`d-dropdown-list`,c.DROPDOWN_PADDING_CLASSES[this.padding],this.listClass,{"d-context-menu-list":this.openOnContext}]},shouldOpenWithArrowKeys(){return!this.openOnContext}},methods:{onVisibilityChange(e){this.isLogicallyOpen=e,this.visibilityChangeCallback?.(e)},onMouseHighlight(e){let t=e.target.closest(`li`);t?.role&&t.id&&this.highlightId!==t.id&&(this.setHighlightId(t.id),this._getListItemNodes()?.includes(t)&&this.focusHoveredRow(t))},focusHoveredRow(e){u(e)&&this.focusMenuContent()||e.focus()},focusMenuContent(){let e=this.$refs.popover?.popoverContentEl;return e?.focus(),!!e&&e.getRootNode().activeElement===e},getListElement(){return this.$refs.listWrapper},getMenuCloseButton(){let e=this.$refs.popover;return e?.role===`menu`?e.getCloseButtonElement():null},isMenuCloseFocused(){let e=this.getMenuCloseButton();return e&&e.getRootNode().activeElement===e},clearHighlightIndex(){this.setHighlightIndex(-1)},afterHighlight(){this.highlightIndex!==this._itemsLength()-1&&this.$emit(`highlight`,this.highlightIndex)},updateInitialHighlightIndex(e){this.isOpen=e,e?(this.openedWithKeyboard&&this.isArrowKeyNav&&(this.setHighlightIndex(0),!Object.entries(this.$attrs).some(([e,t])=>e.replace(/-/g,``).toLowerCase()===`initialfocuselement`&&t!==void 0)&&u(this.activeItemEl)&&this.activeItemEl.focus()),this.$emit(`opened`,!0)):(this.clearHighlightIndex(),this.openedWithKeyboard=!1,this.$emit(`opened`,!1))},onSpaceKey(e){this.open||(this.openedWithKeyboard=!0),u(this.activeItemEl)&&e.target===this.$refs.popover?.popoverContentEl&&e.preventDefault()},onEnterKey(){this.open||(this.openedWithKeyboard=!0)},onUpKeyPress(){if(!this.isOpen){this.openedWithKeyboard=!0;return}if(this.isArrowKeyNav)return this.isMenuCloseFocused()?this.onEndKey():this.onUpKey()},onDownKeyPress(){if(!this.isOpen){this.openedWithKeyboard=!0;return}if(this.isArrowKeyNav)return this.isMenuCloseFocused()?this.onHomeKey():this.onDownKey()},onHomeKeyPress(){if(!(!this.isOpen||!this.isArrowKeyNav))return this.onHomeKey()},onEndKeyPress(){if(!(!this.isOpen||!this.isArrowKeyNav))return this.onEndKey()},onKeyPress(e){if(!(!this.isOpen||!this.isArrowKeyNav||!this.isValidLetter(e.key)))return e.stopPropagation(),e.preventDefault(),this.onNavigationKey(e.key)}}},f=[`id`];function p(e,t,n,r,i,a){let o=(0,l.resolveComponent)(`dt-popover`);return(0,l.openBlock)(),(0,l.createBlock)(o,(0,l.mergeProps)({ref:`popover`,"content-width":n.contentWidth,"content-mode":n.contentMode,open:n.open,"forward-anchor-arrow-keys":n.forwardAnchorArrowKeys,"visibility-change-callback":a.onVisibilityChange,placement:n.placement,"initial-focus-element":i.openedWithKeyboard?`first`:`dialog`,"fallback-placements":n.fallbackPlacements,padding:`none`,role:`menu`,"append-to":n.appendTo,modal:n.modal,"max-height":n.maxHeight,"max-width":n.maxWidth,"open-with-arrow-keys":a.shouldOpenWithArrowKeys,"open-on-context":n.openOnContext},a.popoverAttrs,{tether:n.tether,transition:n.transition,"footer-class":n.footerClass},(0,l.toHandlers)(a.dropdownListeners)),{anchor:(0,l.withCtx)(({attrs:t})=>[(0,l.renderSlot)(e.$slots,`anchor`,(0,l.mergeProps)({ref:`anchor`},t))]),content:(0,l.withCtx)(({close:r})=>[(0,l.createElementVNode)(`ul`,{id:n.listId,ref:`listWrapper`,role:`none`,class:(0,l.normalizeClass)(a.listClasses),"data-qa":`dt-dropdown-list-wrapper`,onMouseleave:t[0]||(t[0]=(...e)=>a.clearHighlightIndex&&a.clearHighlightIndex(...e)),onMousemoveCapture:t[1]||(t[1]=(...e)=>a.onMouseHighlight&&a.onMouseHighlight(...e))},[(0,l.renderSlot)(e.$slots,`list`,{close:r})],42,f)]),footerContent:(0,l.withCtx)(({close:t})=>[(0,l.renderSlot)(e.$slots,`footer`,{close:t})]),_:3},16,[`content-width`,`content-mode`,`open`,`forward-anchor-arrow-keys`,`visibility-change-callback`,`placement`,`initial-focus-element`,`fallback-placements`,`append-to`,`modal`,`max-height`,`max-width`,`open-with-arrow-keys`,`open-on-context`,`tether`,`transition`,`footer-class`])}var m=n.t(d,[[`render`,p]]);exports.default=m;
|
|
2
2
|
//# sourceMappingURL=dropdown.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dropdown.cjs","names":[],"sources":["../../../components/Dropdown/Dropdown.vue"],"sourcesContent":["<!-- eslint-disable max-lines -->\n<template>\n <dt-popover\n ref=\"popover\"\n :content-width=\"contentWidth\"\n :content-mode=\"contentMode\"\n :open=\"open\"\n :forward-anchor-arrow-keys=\"forwardAnchorArrowKeys\"\n :visibility-change-callback=\"onVisibilityChange\"\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 v-bind=\"popoverAttrs\"\n :tether=\"tether\"\n :transition=\"transition\"\n :footer-class=\"footerClass\"\n v-on=\"dropdownListeners\"\n >\n <template #anchor=\"{ attrs }\">\n <!--\n @slot Dropdown trigger. Bind the three ARIA slot props individually to the trigger to preserve consumer refs.\n @binding {string} ref Internal ref key. Do not forward it to the trigger.\n @binding {string} aria-expanded Whether the dropdown is open, as \"true\" or \"false\".\n @binding {string} aria-controls ID of the popup element with role=\"menu\".\n @binding {string} aria-haspopup Popup role, \"menu\".\n -->\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 role=\"none\"\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 </ul>\n </template>\n <template #footerContent=\"{ close }\">\n <!-- @slot Slot for the footer content -->\n <slot\n name=\"footer\"\n :close=\"close\"\n />\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/ListItem';\nimport { DROPDOWN_PADDING_CLASSES } from './DropdownConstants';\nimport { getUniqueString } from '@/common/utils';\nimport { EVENT_KEYNAMES, HTML_ELEMENT_TYPE } from '@/common/constants';\nimport { CONTENT_MODE_PROP } from '@/common/mode_constants';\n\n// DtListItem's `disabled` modifier. Hand-rolled aria-disabled rows don't carry it and keep the legacy behavior.\nconst isDisabledRow = el => Boolean(el?.classList.contains('d-list-item--disabled'));\n\nexport default {\n name: 'DtDropdown',\n\n components: {\n DtPopover,\n },\n\n mixins: [\n KeyboardNavigation({\n indexKey: 'highlightIndex',\n idKey: 'highlightId',\n listElementKey: 'getListElement',\n listItemRole: ['menuitem', 'menuitemradio'],\n afterHighlightMethod: 'afterHighlight',\n beginningOfListMethod: 'beginningOfListMethod',\n endOfListMethod: 'endOfListMethod',\n activeItemKey: 'activeItemEl',\n focusOnKeyboardNavigation: true,\n }),\n ],\n\n inheritAttrs: false,\n\n props: {\n /**\n * Applies a color mode to the positioned content element.\n * @values light, dark, invert\n */\n contentMode: CONTENT_MODE_PROP,\n\n /**\n * Controls whether the dropdown is shown. When null (default), the dropdown\n * toggles on click. When set to true or false, the default trigger is\n * disabled and the parent controls visibility via v-model:open.\n * @values null, true, false\n */\n open: {\n type: [Boolean, null],\n default: null,\n },\n\n /**\n * Optional callback receiving the open boolean synchronously on logical visibility changes.\n * Includes initial true during creation, before mount, when open=true.\n * Does not declare or emit an open-change event.\n * For modal removal, keep modal=true, its anchor and scroll container unchanged until opened(false).\n * Changing modal or the anchor's scroll context after opening can retain the original lock.\n * opened(false) reports transition completion, not global scroll-lock ownership.\n * A closed modal with no pending transition or retained scroll lock can be removed immediately.\n * Defer direct app.unmount() until Vue's next tick.\n */\n visibilityChangeCallback: {\n type: Function,\n default: null,\n },\n\n /**\n * Forwards anchor ArrowUp/ArrowDown with a boolean open prop without toggling.\n * Closed anchor arrows retain their default action and propagation for consumer handling.\n * Accept opening synchronously in the emitted keydown callback for first-row focus.\n * @values true, false\n */\n forwardAnchorArrowKeys: {\n type: Boolean,\n default: false,\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 * @values top, top-start, top-end, right, right-start, right-end, left, left-start, left-end, bottom, bottom-start, bottom-end, auto, auto-start, auto-end\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 * Additional class for the footer wrapper element.\n */\n footerClass: {\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', 'root', HTMLElement,\n */\n appendTo: {\n type: [HTML_ELEMENT_TYPE, 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 * Native keydown event\n *\n * @event keydown\n * @type {KeyboardEvent}\n */\n 'keydown',\n\n /**\n * Event fired when the highlight changes\n *\n * @event highlight\n * @type {Number}\n */\n 'highlight',\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 * Event fired after the current transition and initial focus work complete\n *\n * @event opened\n * @type {Boolean | Array}\n */\n 'opened',\n\n ],\n\n data () {\n return {\n LIST_ITEM_NAVIGATION_TYPES,\n DROPDOWN_PADDING_CLASSES,\n EVENT_KEYNAMES,\n openedWithKeyboard: false,\n pendingArrowOpening: null,\n isOpen: null,\n isLogicallyOpen: false,\n };\n },\n\n computed: {\n popoverAttrs () {\n const { dialogClass, 'dialog-class': kebabDialogClass, ...attrs } = this.$attrs;\n return {\n ...attrs,\n dialogClass: [dialogClass, kebabDialogClass, {\n 'd-dropdown__menu--arrow-keys': this.isArrowKeyNav && (!('role' in attrs) || attrs.role === 'menu'),\n }],\n };\n },\n\n dropdownListeners () {\n return {\n\n 'update:open': value => {\n this.$emit('update:open', value);\n },\n\n opened: isPopoverOpen => {\n this.updateInitialHighlightIndex(isPopoverOpen);\n },\n\n keydown: event => {\n const eventCode = event.code;\n const isArrow = [EVENT_KEYNAMES.up, EVENT_KEYNAMES.arrowup,\n EVENT_KEYNAMES.down, EVENT_KEYNAMES.arrowdown].includes(eventCode);\n\n if (this.forwardAnchorArrowKeys && this.open !== null && !this.isLogicallyOpen && isArrow &&\n this.$refs.popover?.$refs.anchor?.contains(event.target)) {\n const pending = Symbol('arrow-opening');\n this.pendingArrowOpening = pending;\n this.openedWithKeyboard = true;\n this.$emit('keydown', event);\n // Let synchronous acceptance in the emitted handler flush before discarding ignored modality.\n this.$nextTick(() => {\n if (this.pendingArrowOpening === pending && !this.isLogicallyOpen) {\n this.openedWithKeyboard = false;\n }\n });\n return;\n }\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(event);\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.onBeginningOfMenu;\n },\n\n endOfListMethod () {\n return this.onEndOfList || this.onEndOfMenu;\n },\n\n activeItemEl () {\n if (!this.highlightId) return null;\n return this._getListItemNodes()?.find(item => item.id === this.highlightId) || null;\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 onVisibilityChange (isOpen) {\n this.isLogicallyOpen = isOpen;\n this.visibilityChangeCallback?.(isOpen);\n },\n\n onMouseHighlight (e) {\n const liElement = e.target.closest('li');\n\n if (liElement?.role && liElement.id && this.highlightId !== liElement.id) {\n this.setHighlightId(liElement.id);\n if (this._getListItemNodes()?.includes(liElement)) this.focusHoveredRow(liElement);\n }\n },\n\n // A DtListItem disabled row takes the highlight but not focus, which would draw the keyboard\n // focus ring under the pointer. The menu holds focus so Enter can't activate another row.\n focusHoveredRow (row) {\n if (isDisabledRow(row) && this.focusMenuContent()) return;\n row.focus();\n },\n\n /** Focuses the menu container; false when it can't take focus (contentTabindex null). */\n focusMenuContent () {\n const content = this.$refs.popover?.popoverContentEl;\n content?.focus();\n return Boolean(content) && content.getRootNode().activeElement === content;\n },\n\n getListElement () {\n return this.$refs.listWrapper;\n },\n\n getMenuCloseButton () {\n const popover = this.$refs.popover;\n return popover?.role === 'menu' ? popover.getCloseButtonElement() : null;\n },\n\n isMenuCloseFocused () {\n const closeButton = this.getMenuCloseButton();\n return closeButton && closeButton.getRootNode().activeElement === closeButton;\n },\n\n focusMenuClose () {\n const closeButton = this.getMenuCloseButton();\n if (!closeButton) return false;\n // Close has no application row index and must not emit a choice highlight.\n this.highlightIndex = -1;\n this.highlightId = '';\n closeButton.focus();\n return true;\n },\n\n onBeginningOfMenu () {\n if (!this.focusMenuClose()) this.jumpToEnd();\n },\n\n onEndOfMenu () {\n if (!this.focusMenuClose()) this.jumpToBeginning();\n },\n\n clearHighlightIndex () {\n this.setHighlightIndex(-1);\n },\n\n afterHighlight () {\n if (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 if (this._itemsLength() || !this.focusMenuClose()) this.setHighlightIndex(0);\n // Popover's default first-element focus skips aria-disabled rows, but a DtListItem disabled row\n // stays reachable: focus it so focus and keyboard position agree. A consumer focus target wins.\n const consumerFocus = Object.entries(this.$attrs).some(([key, value]) =>\n key.replace(/-/g, '').toLowerCase() === 'initialfocuselement' && value !== undefined);\n if (!consumerFocus && isDisabledRow(this.activeItemEl)) this.activeItemEl.focus();\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 (event) {\n if (!this.open) {\n this.openedWithKeyboard = true;\n }\n // The menu holds focus while the pointer rests on a disabled row; keep Space from scrolling it.\n if (isDisabledRow(this.activeItemEl) && event.target === this.$refs.popover?.popoverContentEl) {\n event.preventDefault();\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 if (this.isMenuCloseFocused()) return this.onEndKey();\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 if (this.isMenuCloseFocused()) return this.onHomeKey();\n return this.onDownKey();\n }\n },\n\n onHomeKeyPress () {\n if (!this.isOpen || !this.isArrowKeyNav) {\n return;\n }\n\n if (!this._itemsLength() && this.focusMenuClose()) return;\n return this.onHomeKey();\n },\n\n onEndKeyPress () {\n if (!this.isOpen || !this.isArrowKeyNav) {\n return;\n }\n\n if (this.focusMenuClose()) return;\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"],"mappings":"ukBA+EA,IAAM,EAAgB,GAAM,EAAQ,GAAI,UAAU,SAAS,wBAAwB,CAE9E,EAAU,CACb,KAAM,aAEN,WAAY,CACV,UAAA,EAAA,QACD,CAED,OAAQ,CACN,EAAA,QAAmB,CACjB,SAAU,iBACV,MAAO,cACP,eAAgB,iBAChB,aAAc,CAAC,WAAY,gBAAgB,CAC3C,qBAAsB,iBACtB,sBAAuB,wBACvB,gBAAiB,kBACjB,cAAe,eACf,0BAA2B,GAC5B,CAAC,CACH,CAED,aAAc,GAEd,MAAO,CAKL,YAAa,EAAA,EAQb,KAAM,CACJ,KAAM,CAAC,QAAS,KAAK,CACrB,QAAS,KACV,CAYD,yBAA0B,CACxB,KAAM,SACN,QAAS,KACV,CAQD,uBAAwB,CACtB,KAAM,QACN,QAAS,GACV,CAMD,cAAe,CACb,KAAM,QACN,QAAS,GACV,CAMD,QAAS,CACP,KAAM,OACN,QAAS,QACT,UAAY,GACH,OAAO,KAAK,EAAA,yBAAyB,CAAC,KAAM,GAAS,IAAS,EAAQ,CAEhF,CAMD,MAAO,CACL,KAAM,QACN,QAAS,GACV,CAOD,aAAc,CACZ,KAAM,OACN,QAAS,KACV,CAMD,UAAW,CACT,KAAM,OACN,QAAS,GACV,CAMD,SAAU,CACR,KAAM,OACN,QAAS,GACV,CAMD,OAAQ,CACN,KAAM,OACN,SAAW,CAAE,OAAO,EAAA,iBAAiB,EACtC,CASD,eAAgB,CACd,KAAM,OACN,QAAS,EAAA,2BAA2B,WACpC,UAAY,GAAM,OAAO,OAAO,EAAA,2BAA2B,CAAC,SAAS,EAAE,CACxE,CAYD,mBAAoB,CAClB,KAAM,MACN,YACS,CAAC,OAAO,CAElB,CAMD,UAAW,CACT,KAAM,OACN,QAAS,SACV,CAK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,EAAA,aACf,eAAc,EAAA,YACd,KAAM,EAAA,KACN,4BAA2B,EAAA,uBAC3B,6BAA4B,EAAA,mBAC5B,UAAW,EAAA,UACX,wBAAuB,EAAA,mBAAkB,QAAA,SACzC,sBAAqB,EAAA,mBACtB,QAAQ,OACR,KAAK,OACJ,YAAW,EAAA,SACX,MAAO,EAAA,MACP,aAAY,EAAA,UACZ,YAAW,EAAA,SACX,uBAAsB,EAAA,wBACtB,kBAAiB,EAAA,eACV,EAAA,aAAY,CACnB,OAAQ,EAAA,OACR,WAAY,EAAA,WACZ,eAAc,EAAA,8BACS,EAAlB,kBAAiB,CAAA,CAAA,CAEZ,QAAA,EAAA,EAAA,UAYP,CAZiB,WAAK,EAAA,EAAA,EAAA,YAYtB,EAAA,OAAA,UAAA,EAAA,EAAA,YAAA,CAHA,IAAI,SAAQ,CAEJ,EAAK,CAAA,CAAA,CAAA,CAGN,SAAA,EAAA,EAAA,UAiBJ,CAjBe,WAAK,EAAA,EAAA,EAAA,oBAiBpB,KAAA,CAbF,GAAI,EAAA,OACL,IAAI,cACJ,KAAK,OACJ,OAAA,EAAA,EAAA,gBAAO,EAAA,YAAW,CACnB,UAAQ,2BACP,aAAU,EAAA,KAAA,EAAA,IAAA,GAAA,IAAE,EAAA,qBAAA,EAAA,oBAAA,GAAA,EAAmB,yCACZ,EAAA,kBAAA,EAAA,iBAAA,GAAA,EAAgB,qBAMlC,EAAA,OAAA,OAAA,CADQ,QAAK,CAAA,CAAA,CAAA,GAAA,EAAA,CAAA,CAAA,CAIR,eAAA,EAAA,EAAA,UAKP,CALwB,WAAK,EAAA,EAAA,EAAA,YAK7B,EAAA,OAAA,SAAA,CADQ,QAAK,CAAA,CAAA,CAAA"}
|
|
1
|
+
{"version":3,"file":"dropdown.cjs","names":[],"sources":["../../../components/Dropdown/Dropdown.vue"],"sourcesContent":["<!-- eslint-disable max-lines -->\n<template>\n <dt-popover\n ref=\"popover\"\n :content-width=\"contentWidth\"\n :content-mode=\"contentMode\"\n :open=\"open\"\n :forward-anchor-arrow-keys=\"forwardAnchorArrowKeys\"\n :visibility-change-callback=\"onVisibilityChange\"\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 v-bind=\"popoverAttrs\"\n :tether=\"tether\"\n :transition=\"transition\"\n :footer-class=\"footerClass\"\n v-on=\"dropdownListeners\"\n >\n <template #anchor=\"{ attrs }\">\n <!--\n @slot Dropdown trigger. Bind the three ARIA slot props individually to the trigger to preserve consumer refs.\n @binding {string} ref Internal ref key. Do not forward it to the trigger.\n @binding {string} aria-expanded Whether the dropdown is open, as \"true\" or \"false\".\n @binding {string} aria-controls ID of the popup element with role=\"menu\".\n @binding {string} aria-haspopup Popup role, \"menu\".\n -->\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 role=\"none\"\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 </ul>\n </template>\n <template #footerContent=\"{ close }\">\n <!-- @slot Slot for the footer content -->\n <slot\n name=\"footer\"\n :close=\"close\"\n />\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/ListItem';\nimport { DROPDOWN_PADDING_CLASSES } from './DropdownConstants';\nimport { getUniqueString } from '@/common/utils';\nimport { EVENT_KEYNAMES, HTML_ELEMENT_TYPE } from '@/common/constants';\nimport { CONTENT_MODE_PROP } from '@/common/mode_constants';\n\n// DtListItem's `disabled` modifier. Hand-rolled aria-disabled rows don't carry it and keep the legacy behavior.\nconst isDisabledRow = el => Boolean(el?.classList.contains('d-list-item--disabled'));\n\nexport default {\n name: 'DtDropdown',\n\n components: {\n DtPopover,\n },\n\n mixins: [\n KeyboardNavigation({\n indexKey: 'highlightIndex',\n idKey: 'highlightId',\n listElementKey: 'getListElement',\n listItemRole: ['menuitem', 'menuitemradio'],\n afterHighlightMethod: 'afterHighlight',\n beginningOfListMethod: 'beginningOfListMethod',\n endOfListMethod: 'endOfListMethod',\n activeItemKey: 'activeItemEl',\n focusOnKeyboardNavigation: true,\n }),\n ],\n\n inheritAttrs: false,\n\n props: {\n /**\n * Applies a color mode to the positioned content element.\n * @values light, dark, invert\n */\n contentMode: CONTENT_MODE_PROP,\n\n /**\n * Controls whether the dropdown is shown. When null (default), the dropdown\n * toggles on click. When set to true or false, the default trigger is\n * disabled and the parent controls visibility via v-model:open.\n * @values null, true, false\n */\n open: {\n type: [Boolean, null],\n default: null,\n },\n\n /**\n * Optional callback receiving the open boolean synchronously on logical visibility changes.\n * Includes initial true during creation, before mount, when open=true.\n * Does not declare or emit an open-change event.\n * For modal removal, keep modal=true, its anchor and scroll container unchanged until opened(false).\n * Changing modal or the anchor's scroll context after opening can retain the original lock.\n * opened(false) reports transition completion, not global scroll-lock ownership.\n * A closed modal with no pending transition or retained scroll lock can be removed immediately.\n * Defer direct app.unmount() until Vue's next tick.\n */\n visibilityChangeCallback: {\n type: Function,\n default: null,\n },\n\n /**\n * Forwards anchor ArrowUp/ArrowDown with a boolean open prop without toggling.\n * Closed anchor arrows retain their default action and propagation for consumer handling.\n * Accept opening synchronously in the emitted keydown callback for first-row focus.\n * @values true, false\n */\n forwardAnchorArrowKeys: {\n type: Boolean,\n default: false,\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 * @values top, top-start, top-end, right, right-start, right-end, left, left-start, left-end, bottom, bottom-start, bottom-end, auto, auto-start, auto-end\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 * Additional class for the footer wrapper element.\n */\n footerClass: {\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', 'root', HTMLElement,\n */\n appendTo: {\n type: [HTML_ELEMENT_TYPE, 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 * Native keydown event\n *\n * @event keydown\n * @type {KeyboardEvent}\n */\n 'keydown',\n\n /**\n * Event fired when the highlight changes\n *\n * @event highlight\n * @type {Number}\n */\n 'highlight',\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 * Event fired after the current transition and initial focus work complete\n *\n * @event opened\n * @type {Boolean | Array}\n */\n 'opened',\n\n ],\n\n data () {\n return {\n LIST_ITEM_NAVIGATION_TYPES,\n DROPDOWN_PADDING_CLASSES,\n EVENT_KEYNAMES,\n openedWithKeyboard: false,\n pendingArrowOpening: null,\n isOpen: null,\n isLogicallyOpen: false,\n };\n },\n\n computed: {\n popoverAttrs () {\n const { dialogClass, 'dialog-class': kebabDialogClass, ...attrs } = this.$attrs;\n return {\n ...attrs,\n dialogClass: [dialogClass, kebabDialogClass, {\n 'd-dropdown__menu--arrow-keys': this.isArrowKeyNav && (!('role' in attrs) || attrs.role === 'menu'),\n }],\n };\n },\n\n dropdownListeners () {\n return {\n\n 'update:open': value => {\n this.$emit('update:open', value);\n },\n\n opened: isPopoverOpen => {\n this.updateInitialHighlightIndex(isPopoverOpen);\n },\n\n keydown: event => {\n const eventCode = event.code;\n const isArrow = [EVENT_KEYNAMES.up, EVENT_KEYNAMES.arrowup,\n EVENT_KEYNAMES.down, EVENT_KEYNAMES.arrowdown].includes(eventCode);\n\n if (this.forwardAnchorArrowKeys && this.open !== null && !this.isLogicallyOpen && isArrow &&\n this.$refs.popover?.$refs.anchor?.contains(event.target)) {\n const pending = Symbol('arrow-opening');\n this.pendingArrowOpening = pending;\n this.openedWithKeyboard = true;\n this.$emit('keydown', event);\n // Let synchronous acceptance in the emitted handler flush before discarding ignored modality.\n this.$nextTick(() => {\n if (this.pendingArrowOpening === pending && !this.isLogicallyOpen) {\n this.openedWithKeyboard = false;\n }\n });\n return;\n }\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(event);\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 if (!this.highlightId) return null;\n return this._getListItemNodes()?.find(item => item.id === this.highlightId) || null;\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 onVisibilityChange (isOpen) {\n this.isLogicallyOpen = isOpen;\n this.visibilityChangeCallback?.(isOpen);\n },\n\n onMouseHighlight (e) {\n const liElement = e.target.closest('li');\n\n if (liElement?.role && liElement.id && this.highlightId !== liElement.id) {\n this.setHighlightId(liElement.id);\n if (this._getListItemNodes()?.includes(liElement)) this.focusHoveredRow(liElement);\n }\n },\n\n // A DtListItem disabled row takes the highlight but not focus, which would draw the keyboard\n // focus ring under the pointer. The menu holds focus so Enter can't activate another row.\n focusHoveredRow (row) {\n if (isDisabledRow(row) && this.focusMenuContent()) return;\n row.focus();\n },\n\n /** Focuses the menu container; false when it can't take focus (contentTabindex null). */\n focusMenuContent () {\n const content = this.$refs.popover?.popoverContentEl;\n content?.focus();\n return Boolean(content) && content.getRootNode().activeElement === content;\n },\n\n getListElement () {\n return this.$refs.listWrapper;\n },\n\n getMenuCloseButton () {\n const popover = this.$refs.popover;\n return popover?.role === 'menu' ? popover.getCloseButtonElement() : null;\n },\n\n isMenuCloseFocused () {\n const closeButton = this.getMenuCloseButton();\n return closeButton && closeButton.getRootNode().activeElement === closeButton;\n },\n\n clearHighlightIndex () {\n this.setHighlightIndex(-1);\n },\n\n afterHighlight () {\n if (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 // Popover's default first-element focus skips aria-disabled rows, but a DtListItem disabled row\n // stays reachable: focus it so focus and keyboard position agree. A consumer focus target wins.\n const consumerFocus = Object.entries(this.$attrs).some(([key, value]) =>\n key.replace(/-/g, '').toLowerCase() === 'initialfocuselement' && value !== undefined);\n if (!consumerFocus && isDisabledRow(this.activeItemEl)) this.activeItemEl.focus();\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 (event) {\n if (!this.open) {\n this.openedWithKeyboard = true;\n }\n // The menu holds focus while the pointer rests on a disabled row; keep Space from scrolling it.\n if (isDisabledRow(this.activeItemEl) && event.target === this.$refs.popover?.popoverContentEl) {\n event.preventDefault();\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 if (this.isMenuCloseFocused()) return this.onEndKey();\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 if (this.isMenuCloseFocused()) return this.onHomeKey();\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"],"mappings":"ukBA+EA,IAAM,EAAgB,GAAM,EAAQ,GAAI,UAAU,SAAS,wBAAwB,CAE9E,EAAU,CACb,KAAM,aAEN,WAAY,CACV,UAAA,EAAA,QACD,CAED,OAAQ,CACN,EAAA,QAAmB,CACjB,SAAU,iBACV,MAAO,cACP,eAAgB,iBAChB,aAAc,CAAC,WAAY,gBAAgB,CAC3C,qBAAsB,iBACtB,sBAAuB,wBACvB,gBAAiB,kBACjB,cAAe,eACf,0BAA2B,GAC5B,CAAC,CACH,CAED,aAAc,GAEd,MAAO,CAKL,YAAa,EAAA,EAQb,KAAM,CACJ,KAAM,CAAC,QAAS,KAAK,CACrB,QAAS,KACV,CAYD,yBAA0B,CACxB,KAAM,SACN,QAAS,KACV,CAQD,uBAAwB,CACtB,KAAM,QACN,QAAS,GACV,CAMD,cAAe,CACb,KAAM,QACN,QAAS,GACV,CAMD,QAAS,CACP,KAAM,OACN,QAAS,QACT,UAAY,GACH,OAAO,KAAK,EAAA,yBAAyB,CAAC,KAAM,GAAS,IAAS,EAAQ,CAEhF,CAMD,MAAO,CACL,KAAM,QACN,QAAS,GACV,CAOD,aAAc,CACZ,KAAM,OACN,QAAS,KACV,CAMD,UAAW,CACT,KAAM,OACN,QAAS,GACV,CAMD,SAAU,CACR,KAAM,OACN,QAAS,GACV,CAMD,OAAQ,CACN,KAAM,OACN,SAAW,CAAE,OAAO,EAAA,iBAAiB,EACtC,CASD,eAAgB,CACd,KAAM,OACN,QAAS,EAAA,2BAA2B,WACpC,UAAY,GAAM,OAAO,OAAO,EAAA,2BAA2B,CAAC,SAAS,EAAE,CACxE,CAYD,mBAAoB,CAClB,KAAM,MACN,YACS,CAAC,OAAO,CAElB,CAMD,UAAW,CACT,KAAM,OACN,QAAS,SACV,CAKD,kBA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,eAAc,EAAA,8BACS,EAAlB,kBAAiB,CAAA,CAAA,CAEZ,QAAA,EAAA,EAAA,UAYP,CAZiB,WAAK,EAAA,EAAA,EAAA,YAYtB,EAAA,OAAA,UAAA,EAAA,EAAA,YAAA,CAHA,IAAI,SAAQ,CAEJ,EAAK,CAAA,CAAA,CAAA,CAGN,SAAA,EAAA,EAAA,UAiBJ,CAjBe,WAAK,EAAA,EAAA,EAAA,oBAiBpB,KAAA,CAbF,GAAI,EAAA,OACL,IAAI,cACJ,KAAK,OACJ,OAAA,EAAA,EAAA,gBAAO,EAAA,YAAW,CACnB,UAAQ,2BACP,aAAU,EAAA,KAAA,EAAA,IAAA,GAAA,IAAE,EAAA,qBAAA,EAAA,oBAAA,GAAA,EAAmB,yCACZ,EAAA,kBAAA,EAAA,iBAAA,GAAA,EAAgB,qBAMlC,EAAA,OAAA,OAAA,CADQ,QAAK,CAAA,CAAA,CAAA,GAAA,EAAA,CAAA,CAAA,CAIR,eAAA,EAAA,EAAA,UAKP,CALwB,WAAK,EAAA,EAAA,EAAA,YAK7B,EAAA,OAAA,SAAA,CADQ,QAAK,CAAA,CAAA,CAAA"}
|
|
@@ -202,10 +202,10 @@ var y = (e) => !!e?.classList.contains("d-list-item--disabled"), b = {
|
|
|
202
202
|
};
|
|
203
203
|
},
|
|
204
204
|
beginningOfListMethod() {
|
|
205
|
-
return this.onBeginningOfList || this.
|
|
205
|
+
return this.onBeginningOfList || this.jumpToEnd;
|
|
206
206
|
},
|
|
207
207
|
endOfListMethod() {
|
|
208
|
-
return this.onEndOfList || this.
|
|
208
|
+
return this.onEndOfList || this.jumpToBeginning;
|
|
209
209
|
},
|
|
210
210
|
activeItemEl() {
|
|
211
211
|
return this.highlightId && this._getListItemNodes()?.find((e) => e.id === this.highlightId) || null;
|
|
@@ -251,16 +251,6 @@ var y = (e) => !!e?.classList.contains("d-list-item--disabled"), b = {
|
|
|
251
251
|
let e = this.getMenuCloseButton();
|
|
252
252
|
return e && e.getRootNode().activeElement === e;
|
|
253
253
|
},
|
|
254
|
-
focusMenuClose() {
|
|
255
|
-
let e = this.getMenuCloseButton();
|
|
256
|
-
return e ? (this.highlightIndex = -1, this.highlightId = "", e.focus(), !0) : !1;
|
|
257
|
-
},
|
|
258
|
-
onBeginningOfMenu() {
|
|
259
|
-
this.focusMenuClose() || this.jumpToEnd();
|
|
260
|
-
},
|
|
261
|
-
onEndOfMenu() {
|
|
262
|
-
this.focusMenuClose() || this.jumpToBeginning();
|
|
263
|
-
},
|
|
264
254
|
clearHighlightIndex() {
|
|
265
255
|
this.setHighlightIndex(-1);
|
|
266
256
|
},
|
|
@@ -268,7 +258,7 @@ var y = (e) => !!e?.classList.contains("d-list-item--disabled"), b = {
|
|
|
268
258
|
this.highlightIndex !== this._itemsLength() - 1 && this.$emit("highlight", this.highlightIndex);
|
|
269
259
|
},
|
|
270
260
|
updateInitialHighlightIndex(e) {
|
|
271
|
-
this.isOpen = e, e ? (this.openedWithKeyboard && this.isArrowKeyNav && (
|
|
261
|
+
this.isOpen = e, e ? (this.openedWithKeyboard && this.isArrowKeyNav && (this.setHighlightIndex(0), !Object.entries(this.$attrs).some(([e, t]) => e.replace(/-/g, "").toLowerCase() === "initialfocuselement" && t !== void 0) && y(this.activeItemEl) && this.activeItemEl.focus()), this.$emit("opened", !0)) : (this.clearHighlightIndex(), this.openedWithKeyboard = !1, this.$emit("opened", !1));
|
|
272
262
|
},
|
|
273
263
|
onSpaceKey(e) {
|
|
274
264
|
this.open || (this.openedWithKeyboard = !0), y(this.activeItemEl) && e.target === this.$refs.popover?.popoverContentEl && e.preventDefault();
|
|
@@ -291,10 +281,10 @@ var y = (e) => !!e?.classList.contains("d-list-item--disabled"), b = {
|
|
|
291
281
|
if (this.isArrowKeyNav) return this.isMenuCloseFocused() ? this.onHomeKey() : this.onDownKey();
|
|
292
282
|
},
|
|
293
283
|
onHomeKeyPress() {
|
|
294
|
-
if (!(!this.isOpen || !this.isArrowKeyNav)
|
|
284
|
+
if (!(!this.isOpen || !this.isArrowKeyNav)) return this.onHomeKey();
|
|
295
285
|
},
|
|
296
286
|
onEndKeyPress() {
|
|
297
|
-
if (!(!this.isOpen || !this.isArrowKeyNav)
|
|
287
|
+
if (!(!this.isOpen || !this.isArrowKeyNav)) return this.onEndKey();
|
|
298
288
|
},
|
|
299
289
|
onKeyPress(e) {
|
|
300
290
|
if (!(!this.isOpen || !this.isArrowKeyNav || !this.isValidLetter(e.key))) return e.stopPropagation(), e.preventDefault(), this.onNavigationKey(e.key);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dropdown.js","names":[],"sources":["../../../components/Dropdown/Dropdown.vue"],"sourcesContent":["<!-- eslint-disable max-lines -->\n<template>\n <dt-popover\n ref=\"popover\"\n :content-width=\"contentWidth\"\n :content-mode=\"contentMode\"\n :open=\"open\"\n :forward-anchor-arrow-keys=\"forwardAnchorArrowKeys\"\n :visibility-change-callback=\"onVisibilityChange\"\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 v-bind=\"popoverAttrs\"\n :tether=\"tether\"\n :transition=\"transition\"\n :footer-class=\"footerClass\"\n v-on=\"dropdownListeners\"\n >\n <template #anchor=\"{ attrs }\">\n <!--\n @slot Dropdown trigger. Bind the three ARIA slot props individually to the trigger to preserve consumer refs.\n @binding {string} ref Internal ref key. Do not forward it to the trigger.\n @binding {string} aria-expanded Whether the dropdown is open, as \"true\" or \"false\".\n @binding {string} aria-controls ID of the popup element with role=\"menu\".\n @binding {string} aria-haspopup Popup role, \"menu\".\n -->\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 role=\"none\"\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 </ul>\n </template>\n <template #footerContent=\"{ close }\">\n <!-- @slot Slot for the footer content -->\n <slot\n name=\"footer\"\n :close=\"close\"\n />\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/ListItem';\nimport { DROPDOWN_PADDING_CLASSES } from './DropdownConstants';\nimport { getUniqueString } from '@/common/utils';\nimport { EVENT_KEYNAMES, HTML_ELEMENT_TYPE } from '@/common/constants';\nimport { CONTENT_MODE_PROP } from '@/common/mode_constants';\n\n// DtListItem's `disabled` modifier. Hand-rolled aria-disabled rows don't carry it and keep the legacy behavior.\nconst isDisabledRow = el => Boolean(el?.classList.contains('d-list-item--disabled'));\n\nexport default {\n name: 'DtDropdown',\n\n components: {\n DtPopover,\n },\n\n mixins: [\n KeyboardNavigation({\n indexKey: 'highlightIndex',\n idKey: 'highlightId',\n listElementKey: 'getListElement',\n listItemRole: ['menuitem', 'menuitemradio'],\n afterHighlightMethod: 'afterHighlight',\n beginningOfListMethod: 'beginningOfListMethod',\n endOfListMethod: 'endOfListMethod',\n activeItemKey: 'activeItemEl',\n focusOnKeyboardNavigation: true,\n }),\n ],\n\n inheritAttrs: false,\n\n props: {\n /**\n * Applies a color mode to the positioned content element.\n * @values light, dark, invert\n */\n contentMode: CONTENT_MODE_PROP,\n\n /**\n * Controls whether the dropdown is shown. When null (default), the dropdown\n * toggles on click. When set to true or false, the default trigger is\n * disabled and the parent controls visibility via v-model:open.\n * @values null, true, false\n */\n open: {\n type: [Boolean, null],\n default: null,\n },\n\n /**\n * Optional callback receiving the open boolean synchronously on logical visibility changes.\n * Includes initial true during creation, before mount, when open=true.\n * Does not declare or emit an open-change event.\n * For modal removal, keep modal=true, its anchor and scroll container unchanged until opened(false).\n * Changing modal or the anchor's scroll context after opening can retain the original lock.\n * opened(false) reports transition completion, not global scroll-lock ownership.\n * A closed modal with no pending transition or retained scroll lock can be removed immediately.\n * Defer direct app.unmount() until Vue's next tick.\n */\n visibilityChangeCallback: {\n type: Function,\n default: null,\n },\n\n /**\n * Forwards anchor ArrowUp/ArrowDown with a boolean open prop without toggling.\n * Closed anchor arrows retain their default action and propagation for consumer handling.\n * Accept opening synchronously in the emitted keydown callback for first-row focus.\n * @values true, false\n */\n forwardAnchorArrowKeys: {\n type: Boolean,\n default: false,\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 * @values top, top-start, top-end, right, right-start, right-end, left, left-start, left-end, bottom, bottom-start, bottom-end, auto, auto-start, auto-end\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 * Additional class for the footer wrapper element.\n */\n footerClass: {\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', 'root', HTMLElement,\n */\n appendTo: {\n type: [HTML_ELEMENT_TYPE, 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 * Native keydown event\n *\n * @event keydown\n * @type {KeyboardEvent}\n */\n 'keydown',\n\n /**\n * Event fired when the highlight changes\n *\n * @event highlight\n * @type {Number}\n */\n 'highlight',\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 * Event fired after the current transition and initial focus work complete\n *\n * @event opened\n * @type {Boolean | Array}\n */\n 'opened',\n\n ],\n\n data () {\n return {\n LIST_ITEM_NAVIGATION_TYPES,\n DROPDOWN_PADDING_CLASSES,\n EVENT_KEYNAMES,\n openedWithKeyboard: false,\n pendingArrowOpening: null,\n isOpen: null,\n isLogicallyOpen: false,\n };\n },\n\n computed: {\n popoverAttrs () {\n const { dialogClass, 'dialog-class': kebabDialogClass, ...attrs } = this.$attrs;\n return {\n ...attrs,\n dialogClass: [dialogClass, kebabDialogClass, {\n 'd-dropdown__menu--arrow-keys': this.isArrowKeyNav && (!('role' in attrs) || attrs.role === 'menu'),\n }],\n };\n },\n\n dropdownListeners () {\n return {\n\n 'update:open': value => {\n this.$emit('update:open', value);\n },\n\n opened: isPopoverOpen => {\n this.updateInitialHighlightIndex(isPopoverOpen);\n },\n\n keydown: event => {\n const eventCode = event.code;\n const isArrow = [EVENT_KEYNAMES.up, EVENT_KEYNAMES.arrowup,\n EVENT_KEYNAMES.down, EVENT_KEYNAMES.arrowdown].includes(eventCode);\n\n if (this.forwardAnchorArrowKeys && this.open !== null && !this.isLogicallyOpen && isArrow &&\n this.$refs.popover?.$refs.anchor?.contains(event.target)) {\n const pending = Symbol('arrow-opening');\n this.pendingArrowOpening = pending;\n this.openedWithKeyboard = true;\n this.$emit('keydown', event);\n // Let synchronous acceptance in the emitted handler flush before discarding ignored modality.\n this.$nextTick(() => {\n if (this.pendingArrowOpening === pending && !this.isLogicallyOpen) {\n this.openedWithKeyboard = false;\n }\n });\n return;\n }\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(event);\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.onBeginningOfMenu;\n },\n\n endOfListMethod () {\n return this.onEndOfList || this.onEndOfMenu;\n },\n\n activeItemEl () {\n if (!this.highlightId) return null;\n return this._getListItemNodes()?.find(item => item.id === this.highlightId) || null;\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 onVisibilityChange (isOpen) {\n this.isLogicallyOpen = isOpen;\n this.visibilityChangeCallback?.(isOpen);\n },\n\n onMouseHighlight (e) {\n const liElement = e.target.closest('li');\n\n if (liElement?.role && liElement.id && this.highlightId !== liElement.id) {\n this.setHighlightId(liElement.id);\n if (this._getListItemNodes()?.includes(liElement)) this.focusHoveredRow(liElement);\n }\n },\n\n // A DtListItem disabled row takes the highlight but not focus, which would draw the keyboard\n // focus ring under the pointer. The menu holds focus so Enter can't activate another row.\n focusHoveredRow (row) {\n if (isDisabledRow(row) && this.focusMenuContent()) return;\n row.focus();\n },\n\n /** Focuses the menu container; false when it can't take focus (contentTabindex null). */\n focusMenuContent () {\n const content = this.$refs.popover?.popoverContentEl;\n content?.focus();\n return Boolean(content) && content.getRootNode().activeElement === content;\n },\n\n getListElement () {\n return this.$refs.listWrapper;\n },\n\n getMenuCloseButton () {\n const popover = this.$refs.popover;\n return popover?.role === 'menu' ? popover.getCloseButtonElement() : null;\n },\n\n isMenuCloseFocused () {\n const closeButton = this.getMenuCloseButton();\n return closeButton && closeButton.getRootNode().activeElement === closeButton;\n },\n\n focusMenuClose () {\n const closeButton = this.getMenuCloseButton();\n if (!closeButton) return false;\n // Close has no application row index and must not emit a choice highlight.\n this.highlightIndex = -1;\n this.highlightId = '';\n closeButton.focus();\n return true;\n },\n\n onBeginningOfMenu () {\n if (!this.focusMenuClose()) this.jumpToEnd();\n },\n\n onEndOfMenu () {\n if (!this.focusMenuClose()) this.jumpToBeginning();\n },\n\n clearHighlightIndex () {\n this.setHighlightIndex(-1);\n },\n\n afterHighlight () {\n if (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 if (this._itemsLength() || !this.focusMenuClose()) this.setHighlightIndex(0);\n // Popover's default first-element focus skips aria-disabled rows, but a DtListItem disabled row\n // stays reachable: focus it so focus and keyboard position agree. A consumer focus target wins.\n const consumerFocus = Object.entries(this.$attrs).some(([key, value]) =>\n key.replace(/-/g, '').toLowerCase() === 'initialfocuselement' && value !== undefined);\n if (!consumerFocus && isDisabledRow(this.activeItemEl)) this.activeItemEl.focus();\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 (event) {\n if (!this.open) {\n this.openedWithKeyboard = true;\n }\n // The menu holds focus while the pointer rests on a disabled row; keep Space from scrolling it.\n if (isDisabledRow(this.activeItemEl) && event.target === this.$refs.popover?.popoverContentEl) {\n event.preventDefault();\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 if (this.isMenuCloseFocused()) return this.onEndKey();\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 if (this.isMenuCloseFocused()) return this.onHomeKey();\n return this.onDownKey();\n }\n },\n\n onHomeKeyPress () {\n if (!this.isOpen || !this.isArrowKeyNav) {\n return;\n }\n\n if (!this._itemsLength() && this.focusMenuClose()) return;\n return this.onHomeKey();\n },\n\n onEndKeyPress () {\n if (!this.isOpen || !this.isArrowKeyNav) {\n return;\n }\n\n if (this.focusMenuClose()) return;\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"],"mappings":";;;;;;;;;;;AA+EA,IAAM,KAAgB,MAAM,EAAQ,GAAI,UAAU,SAAS,wBAAwB,EAE9E,IAAU;CACb,MAAM;CAEN,YAAY,EACV,WAAA,GACD;CAED,QAAQ,CACN,EAAmB;EACjB,UAAU;EACV,OAAO;EACP,gBAAgB;EAChB,cAAc,CAAC,YAAY,gBAAgB;EAC3C,sBAAsB;EACtB,uBAAuB;EACvB,iBAAiB;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QAAA,UAJF,EAIE,EAHA,KAAI,UAAQ,EAEJ,EAAK,CAAA,CAAA,CAAA;EAGN,SAAO,GAiBX,EAjBe,eAAK,CAGzB,EAcK,MAAA;GAbF,IAAI,EAAA;GACL,KAAI;GACJ,MAAK;GACJ,OAAK,EAAE,EAAA,YAAW;GACnB,WAAQ;GACP,cAAU,EAAA,OAAA,EAAA,MAAA,GAAA,MAAE,EAAA,uBAAA,EAAA,oBAAA,GAAA,EAAmB;iDACZ,EAAA,oBAAA,EAAA,iBAAA,GAAA,EAAgB;MAGpC,EAGE,EAAA,QAAA,QAAA,EADQ,UAAK,CAAA,CAAA,EAAA,IAAA,EAAA,CAAA,CAAA;EAIR,eAAa,GAKpB,EALwB,eAAK,CAE/B,EAGE,EAAA,QAAA,UAAA,EADQ,UAAK,CAAA,CAAA,CAAA"}
|
|
1
|
+
{"version":3,"file":"dropdown.js","names":[],"sources":["../../../components/Dropdown/Dropdown.vue"],"sourcesContent":["<!-- eslint-disable max-lines -->\n<template>\n <dt-popover\n ref=\"popover\"\n :content-width=\"contentWidth\"\n :content-mode=\"contentMode\"\n :open=\"open\"\n :forward-anchor-arrow-keys=\"forwardAnchorArrowKeys\"\n :visibility-change-callback=\"onVisibilityChange\"\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 v-bind=\"popoverAttrs\"\n :tether=\"tether\"\n :transition=\"transition\"\n :footer-class=\"footerClass\"\n v-on=\"dropdownListeners\"\n >\n <template #anchor=\"{ attrs }\">\n <!--\n @slot Dropdown trigger. Bind the three ARIA slot props individually to the trigger to preserve consumer refs.\n @binding {string} ref Internal ref key. Do not forward it to the trigger.\n @binding {string} aria-expanded Whether the dropdown is open, as \"true\" or \"false\".\n @binding {string} aria-controls ID of the popup element with role=\"menu\".\n @binding {string} aria-haspopup Popup role, \"menu\".\n -->\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 role=\"none\"\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 </ul>\n </template>\n <template #footerContent=\"{ close }\">\n <!-- @slot Slot for the footer content -->\n <slot\n name=\"footer\"\n :close=\"close\"\n />\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/ListItem';\nimport { DROPDOWN_PADDING_CLASSES } from './DropdownConstants';\nimport { getUniqueString } from '@/common/utils';\nimport { EVENT_KEYNAMES, HTML_ELEMENT_TYPE } from '@/common/constants';\nimport { CONTENT_MODE_PROP } from '@/common/mode_constants';\n\n// DtListItem's `disabled` modifier. Hand-rolled aria-disabled rows don't carry it and keep the legacy behavior.\nconst isDisabledRow = el => Boolean(el?.classList.contains('d-list-item--disabled'));\n\nexport default {\n name: 'DtDropdown',\n\n components: {\n DtPopover,\n },\n\n mixins: [\n KeyboardNavigation({\n indexKey: 'highlightIndex',\n idKey: 'highlightId',\n listElementKey: 'getListElement',\n listItemRole: ['menuitem', 'menuitemradio'],\n afterHighlightMethod: 'afterHighlight',\n beginningOfListMethod: 'beginningOfListMethod',\n endOfListMethod: 'endOfListMethod',\n activeItemKey: 'activeItemEl',\n focusOnKeyboardNavigation: true,\n }),\n ],\n\n inheritAttrs: false,\n\n props: {\n /**\n * Applies a color mode to the positioned content element.\n * @values light, dark, invert\n */\n contentMode: CONTENT_MODE_PROP,\n\n /**\n * Controls whether the dropdown is shown. When null (default), the dropdown\n * toggles on click. When set to true or false, the default trigger is\n * disabled and the parent controls visibility via v-model:open.\n * @values null, true, false\n */\n open: {\n type: [Boolean, null],\n default: null,\n },\n\n /**\n * Optional callback receiving the open boolean synchronously on logical visibility changes.\n * Includes initial true during creation, before mount, when open=true.\n * Does not declare or emit an open-change event.\n * For modal removal, keep modal=true, its anchor and scroll container unchanged until opened(false).\n * Changing modal or the anchor's scroll context after opening can retain the original lock.\n * opened(false) reports transition completion, not global scroll-lock ownership.\n * A closed modal with no pending transition or retained scroll lock can be removed immediately.\n * Defer direct app.unmount() until Vue's next tick.\n */\n visibilityChangeCallback: {\n type: Function,\n default: null,\n },\n\n /**\n * Forwards anchor ArrowUp/ArrowDown with a boolean open prop without toggling.\n * Closed anchor arrows retain their default action and propagation for consumer handling.\n * Accept opening synchronously in the emitted keydown callback for first-row focus.\n * @values true, false\n */\n forwardAnchorArrowKeys: {\n type: Boolean,\n default: false,\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 * @values top, top-start, top-end, right, right-start, right-end, left, left-start, left-end, bottom, bottom-start, bottom-end, auto, auto-start, auto-end\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 * Additional class for the footer wrapper element.\n */\n footerClass: {\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', 'root', HTMLElement,\n */\n appendTo: {\n type: [HTML_ELEMENT_TYPE, 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 * Native keydown event\n *\n * @event keydown\n * @type {KeyboardEvent}\n */\n 'keydown',\n\n /**\n * Event fired when the highlight changes\n *\n * @event highlight\n * @type {Number}\n */\n 'highlight',\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 * Event fired after the current transition and initial focus work complete\n *\n * @event opened\n * @type {Boolean | Array}\n */\n 'opened',\n\n ],\n\n data () {\n return {\n LIST_ITEM_NAVIGATION_TYPES,\n DROPDOWN_PADDING_CLASSES,\n EVENT_KEYNAMES,\n openedWithKeyboard: false,\n pendingArrowOpening: null,\n isOpen: null,\n isLogicallyOpen: false,\n };\n },\n\n computed: {\n popoverAttrs () {\n const { dialogClass, 'dialog-class': kebabDialogClass, ...attrs } = this.$attrs;\n return {\n ...attrs,\n dialogClass: [dialogClass, kebabDialogClass, {\n 'd-dropdown__menu--arrow-keys': this.isArrowKeyNav && (!('role' in attrs) || attrs.role === 'menu'),\n }],\n };\n },\n\n dropdownListeners () {\n return {\n\n 'update:open': value => {\n this.$emit('update:open', value);\n },\n\n opened: isPopoverOpen => {\n this.updateInitialHighlightIndex(isPopoverOpen);\n },\n\n keydown: event => {\n const eventCode = event.code;\n const isArrow = [EVENT_KEYNAMES.up, EVENT_KEYNAMES.arrowup,\n EVENT_KEYNAMES.down, EVENT_KEYNAMES.arrowdown].includes(eventCode);\n\n if (this.forwardAnchorArrowKeys && this.open !== null && !this.isLogicallyOpen && isArrow &&\n this.$refs.popover?.$refs.anchor?.contains(event.target)) {\n const pending = Symbol('arrow-opening');\n this.pendingArrowOpening = pending;\n this.openedWithKeyboard = true;\n this.$emit('keydown', event);\n // Let synchronous acceptance in the emitted handler flush before discarding ignored modality.\n this.$nextTick(() => {\n if (this.pendingArrowOpening === pending && !this.isLogicallyOpen) {\n this.openedWithKeyboard = false;\n }\n });\n return;\n }\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(event);\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 if (!this.highlightId) return null;\n return this._getListItemNodes()?.find(item => item.id === this.highlightId) || null;\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 onVisibilityChange (isOpen) {\n this.isLogicallyOpen = isOpen;\n this.visibilityChangeCallback?.(isOpen);\n },\n\n onMouseHighlight (e) {\n const liElement = e.target.closest('li');\n\n if (liElement?.role && liElement.id && this.highlightId !== liElement.id) {\n this.setHighlightId(liElement.id);\n if (this._getListItemNodes()?.includes(liElement)) this.focusHoveredRow(liElement);\n }\n },\n\n // A DtListItem disabled row takes the highlight but not focus, which would draw the keyboard\n // focus ring under the pointer. The menu holds focus so Enter can't activate another row.\n focusHoveredRow (row) {\n if (isDisabledRow(row) && this.focusMenuContent()) return;\n row.focus();\n },\n\n /** Focuses the menu container; false when it can't take focus (contentTabindex null). */\n focusMenuContent () {\n const content = this.$refs.popover?.popoverContentEl;\n content?.focus();\n return Boolean(content) && content.getRootNode().activeElement === content;\n },\n\n getListElement () {\n return this.$refs.listWrapper;\n },\n\n getMenuCloseButton () {\n const popover = this.$refs.popover;\n return popover?.role === 'menu' ? popover.getCloseButtonElement() : null;\n },\n\n isMenuCloseFocused () {\n const closeButton = this.getMenuCloseButton();\n return closeButton && closeButton.getRootNode().activeElement === closeButton;\n },\n\n clearHighlightIndex () {\n this.setHighlightIndex(-1);\n },\n\n afterHighlight () {\n if (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 // Popover's default first-element focus skips aria-disabled rows, but a DtListItem disabled row\n // stays reachable: focus it so focus and keyboard position agree. A consumer focus target wins.\n const consumerFocus = Object.entries(this.$attrs).some(([key, value]) =>\n key.replace(/-/g, '').toLowerCase() === 'initialfocuselement' && value !== undefined);\n if (!consumerFocus && isDisabledRow(this.activeItemEl)) this.activeItemEl.focus();\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 (event) {\n if (!this.open) {\n this.openedWithKeyboard = true;\n }\n // The menu holds focus while the pointer rests on a disabled row; keep Space from scrolling it.\n if (isDisabledRow(this.activeItemEl) && event.target === this.$refs.popover?.popoverContentEl) {\n event.preventDefault();\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 if (this.isMenuCloseFocused()) return this.onEndKey();\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 if (this.isMenuCloseFocused()) return this.onHomeKey();\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"],"mappings":";;;;;;;;;;;AA+EA,IAAM,KAAgB,MAAM,EAAQ,GAAI,UAAU,SAAS,wBAAwB,EAE9E,IAAU;CACb,MAAM;CAEN,YAAY,EACV,WAAA,GACD;CAED,QAAQ,CACN,EAAmB;EACjB,UAAU;EACV,OAAO;EACP,gBAAgB;EAChB,cAAc,CAAC,YAAY,gBAAgB;EAC3C,sBAAsB;EACtB,uBAAuB;EACvB,iBAAiB;EACjB,eAAe;EACf,2BAA2B;EAC5B,CAAC,CACH;CAED,cAAc;CAEd,OAAO;EAKL,aAAa;EAQb,MAAM;GACJ,MAAM,CAAC,SAAS,KAAK;GACrB,SAAS;GACV;EAYD,0B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,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require(`../../EmojiPicker-
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require(`../../EmojiPicker-KbIfc-GH.cjs`);exports.default=e.t;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as e } from "../../EmojiPicker-
|
|
1
|
+
import { t as e } from "../../EmojiPicker-B7AKJlAM.js";
|
|
2
2
|
export { e as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../../EmojiPicker-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../../EmojiPicker-KbIfc-GH.cjs`),t=require(`./emoji-picker-constants.cjs`);exports.ARROW_KEYS=t.ARROW_KEYS,exports.CDN_URL=t.CDN_URL,exports.DtEmojiPicker=e.t,exports.EMOJIS_PER_ROW=t.EMOJIS_PER_ROW,exports.EMOJI_PICKER_SKIN_TONE_MODIFIERS=t.EMOJI_PICKER_SKIN_TONE_MODIFIERS;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { t as e } from "../../EmojiPicker-
|
|
1
|
+
import { t as e } from "../../EmojiPicker-B7AKJlAM.js";
|
|
2
2
|
import { ARROW_KEYS as t, CDN_URL as n, EMOJIS_PER_ROW as r, EMOJI_PICKER_SKIN_TONE_MODIFIERS as i } from "./emoji-picker-constants.js";
|
|
3
3
|
export { t as ARROW_KEYS, n as CDN_URL, e as DtEmojiPicker, r as EMOJIS_PER_ROW, i as EMOJI_PICKER_SKIN_TONE_MODIFIERS };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}}),require(`../../chunk-Bmb41Sf3.cjs`);const e=require(`../../common/validators/index.cjs`),t=require(`../../common/utils/index.cjs`),n=require(
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}}),require(`../../chunk-Bmb41Sf3.cjs`);const e=require(`../../common/validators/index.cjs`),t=require(`../../common/utils/index.cjs`),n=require(`../../Text-DNVNZree.cjs`),r=require(`../stack/stack.cjs`),i=require(`./empty-state-constants.cjs`);let a=require(`vue`);var o=Object.assign({name:`DtEmptyState`},{__name:`EmptyState`,props:{size:{type:[String,Number],default:400,validator:e.ordinalSizeValidator(i.EMPTY_STATE_SIZE_MODIFIERS)},headerText:{type:String,required:!0},bodyText:{type:String,default:null},illustrationClass:{type:[String,Array,Object],default:``},iconClass:{type:[String,Array,Object],default:``},bodyClass:{type:[String,Array,Object],default:``}},setup(e){let o=(0,a.useSlots)(),s=e,c=(0,a.computed)(()=>t.hasSlotContent(o.icon)),l=(0,a.computed)(()=>t.hasSlotContent(o.illustration)),u=(0,a.computed)(()=>c.value&&(!l.value||p.value)),d=(0,a.computed)(()=>l.value&&!p.value),f=(0,a.computed)(()=>String(s.size)),p=(0,a.computed)(()=>f.value===`sm`||f.value===`200`),m=(0,a.computed)(()=>i.EMPTY_STATE_SIZE_MODIFIERS[f.value]),h=(0,a.computed)(()=>[`d-empty-state`,m.value]),g=(0,a.computed)(()=>i.EMPTY_STATE_CONTENT_SIZE_MODIFIERS[f.value]),_=(0,a.computed)(()=>i.EMPTY_STATE_HEADLINE_SIZES[f.value]),v=(0,a.computed)(()=>i.EMPTY_STATE_HEADLINE_DENSITIES[f.value]),y=(0,a.computed)(()=>i.EMPTY_STATE_BODY_SIZES[f.value]),b=(0,a.computed)(()=>i.EMPTY_STATE_BODY_DENSITIES[f.value]);return(0,a.onMounted)(()=>{!s.bodyText&&!t.hasSlotContent(o.body)&&console.error(`DtEmptyState: You should provide either bodyText or content on body slot.`)}),(i,s)=>((0,a.openBlock)(),(0,a.createBlock)((0,a.unref)(r.default),{class:(0,a.normalizeClass)(h.value)},{default:(0,a.withCtx)(()=>[d.value?((0,a.openBlock)(),(0,a.createElementBlock)(`span`,{key:0,class:(0,a.normalizeClass)([`d-empty-state__illustration`,e.illustrationClass]),"data-qa":`dt-empty-state-illustration`},[(0,a.renderSlot)(i.$slots,`illustration`)],2)):(0,a.createCommentVNode)(``,!0),u.value?((0,a.openBlock)(),(0,a.createElementBlock)(`span`,{key:1,class:(0,a.normalizeClass)([`d-empty-state__icon`,e.iconClass]),"data-qa":`dt-empty-state-icon`},[(0,a.renderSlot)(i.$slots,`icon`,{iconSize:`800`})],2)):(0,a.createCommentVNode)(``,!0),(0,a.createVNode)((0,a.unref)(r.default),{gap:`150`,class:(0,a.normalizeClass)([`d-empty-state__content`,g.value])},{default:(0,a.withCtx)(()=>[(0,a.createVNode)((0,a.unref)(n.t),{kind:`headline`,size:_.value,density:v.value,wrap:`balance`,as:`div`,class:`d-empty-state__header-text`},{default:(0,a.withCtx)(()=>[(0,a.createTextVNode)((0,a.toDisplayString)(e.headerText),1)]),_:1},8,[`size`,`density`]),e.bodyText?((0,a.openBlock)(),(0,a.createBlock)((0,a.unref)(n.t),{key:0,kind:`body`,size:y.value,density:b.value,tone:`secondary`,wrap:`balance`,as:`p`,class:`d-empty-state__body-text`},{default:(0,a.withCtx)(()=>[(0,a.createTextVNode)((0,a.toDisplayString)(e.bodyText),1)]),_:1},8,[`size`,`density`])):(0,a.createCommentVNode)(``,!0)]),_:1},8,[`class`]),(0,a.unref)(t.hasSlotContent)((0,a.unref)(o).body)?((0,a.openBlock)(),(0,a.createElementBlock)(`div`,{key:2,class:(0,a.normalizeClass)(e.bodyClass),"data-qa":`dt-empty-state-body-slot`},[(0,a.renderSlot)(i.$slots,`body`)],2)):(0,a.createCommentVNode)(``,!0)]),_:3},8,[`class`]))}});exports.default=o;
|
|
2
2
|
//# sourceMappingURL=empty-state.cjs.map
|