@dialpad/dialtone-vue 4.6.0 → 4.7.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/{RichTextEditor-DaOHmXD_.js → RichTextEditor-D8DfONFm.js} +7 -7
- package/dist/{RichTextEditor-DaOHmXD_.js.map → RichTextEditor-D8DfONFm.js.map} +1 -1
- package/dist/{RichTextEditor-7eY8gy9u.cjs → RichTextEditor-DMUDJKVn.cjs} +2 -2
- package/dist/{RichTextEditor-7eY8gy9u.cjs.map → RichTextEditor-DMUDJKVn.cjs.map} +1 -1
- package/dist/common/mixins/keyboard-list-navigation.cjs +1 -1
- package/dist/common/mixins/keyboard-list-navigation.cjs.map +1 -1
- package/dist/common/mixins/keyboard-list-navigation.js +10 -7
- package/dist/common/mixins/keyboard-list-navigation.js.map +1 -1
- package/dist/common/mixins/keyboard_list_navigation.d.ts +1 -1
- package/dist/common/mixins/keyboard_list_navigation.d.ts.map +1 -1
- package/dist/common/sr_only_close_button.vue.d.ts +4 -1
- package/dist/component-documentation.json +1 -1
- package/dist/components/Avatar/Avatar.vue.d.ts +12 -8
- package/dist/components/Avatar/Avatar.vue.d.ts.map +1 -1
- package/dist/components/Badge/Badge.vue.d.ts +1 -2
- package/dist/components/Banner/Banner.vue.d.ts +8 -2
- package/dist/components/Banner/Banner.vue.d.ts.map +1 -1
- package/dist/components/Button/Button.vue.d.ts +4 -1
- package/dist/components/Button/Button.vue.d.ts.map +1 -1
- package/dist/components/Chip/Chip.vue.d.ts +4 -1
- package/dist/components/Chip/Chip.vue.d.ts.map +1 -1
- package/dist/components/Collapsible/Collapsible.vue.d.ts +4 -1
- package/dist/components/Collapsible/Collapsible.vue.d.ts.map +1 -1
- package/dist/components/Combobox/Combobox.vue.d.ts +5 -1
- package/dist/components/Combobox/Combobox.vue.d.ts.map +1 -1
- package/dist/components/Combobox/ComboboxEmptyList.vue.d.ts +2 -0
- package/dist/components/Combobox/ComboboxEmptyList.vue.d.ts.map +1 -1
- package/dist/components/Combobox/ComboboxLoadingList.vue.d.ts +2 -0
- package/dist/components/Combobox/ComboboxLoadingList.vue.d.ts.map +1 -1
- package/dist/components/ComboboxWithPopover/ComboboxWithPopover.vue.d.ts +51 -7
- package/dist/components/ComboboxWithPopover/ComboboxWithPopover.vue.d.ts.map +1 -1
- package/dist/components/Dropdown/Dropdown.vue.d.ts +74 -7
- package/dist/components/Dropdown/Dropdown.vue.d.ts.map +1 -1
- package/dist/components/FilterPill/FilterPill.vue.d.ts +530 -31
- package/dist/components/FilterPill/FilterPill.vue.d.ts.map +1 -1
- package/dist/components/FilterPill/FilterPillConstants.d.ts +2 -0
- package/dist/components/FilterPill/FilterPillConstants.d.ts.map +1 -0
- package/dist/components/FilterPill/FilterPillControlled.d.ts +92 -0
- package/dist/components/FilterPill/FilterPillControlled.d.ts.map +1 -0
- package/dist/components/FilterPill/FilterPillSelection.d.ts +13 -0
- package/dist/components/FilterPill/FilterPillSelection.d.ts.map +1 -0
- package/dist/components/Hovercard/Hovercard.vue.d.ts +102 -20
- package/dist/components/Hovercard/Hovercard.vue.d.ts.map +1 -1
- package/dist/components/ImageViewer/ImageViewer.vue.d.ts +8 -2
- package/dist/components/ImageViewer/ImageViewer.vue.d.ts.map +1 -1
- package/dist/components/ListItem/ListItem.vue.d.ts +2 -0
- package/dist/components/ListItem/ListItem.vue.d.ts.map +1 -1
- package/dist/components/ListItem/ListItemConstants.d.ts +2 -0
- package/dist/components/ListItem/ListItemConstants.d.ts.map +1 -1
- package/dist/components/ListItem/index.d.ts +1 -1
- package/dist/components/Loader/Loader.vue.d.ts +4 -1
- package/dist/components/Loader/Loader.vue.d.ts.map +1 -1
- package/dist/components/Modal/Modal.vue.d.ts +9 -3
- package/dist/components/Modal/Modal.vue.d.ts.map +1 -1
- package/dist/components/Notice/Notice.vue.d.ts +9 -3
- package/dist/components/Notice/Notice.vue.d.ts.map +1 -1
- package/dist/components/Notice/NoticeAction.vue.d.ts +8 -2
- package/dist/components/Notice/NoticeAction.vue.d.ts.map +1 -1
- package/dist/components/Pagination/Pagination.vue.d.ts +4 -1
- package/dist/components/Pagination/Pagination.vue.d.ts.map +1 -1
- package/dist/components/Popover/Popover.vue.d.ts +42 -6
- package/dist/components/Popover/Popover.vue.d.ts.map +1 -1
- package/dist/components/Popover/PopoverHeaderFooter.vue.d.ts +13 -1
- package/dist/components/Popover/PopoverHeaderFooter.vue.d.ts.map +1 -1
- package/dist/components/RichTextEditor/Extensions/Mentions/MentionSuggestion.vue.d.ts +12 -8
- package/dist/components/RichTextEditor/Extensions/Suggestion/SuggestionList.vue.d.ts +2 -0
- package/dist/components/RichTextEditor/Extensions/Suggestion/SuggestionList.vue.d.ts.map +1 -1
- package/dist/components/RichTextEditor/Extensions/Variable/VariableComponent.vue.d.ts +47 -9
- package/dist/components/RichTextEditor/Extensions/Variable/VariableComponent.vue.d.ts.map +1 -1
- package/dist/components/SegmentedControl/SegmentedControlItem.vue.d.ts.map +1 -1
- package/dist/components/SplitButton/SplitButton.vue.d.ts +82 -9
- package/dist/components/SplitButton/SplitButton.vue.d.ts.map +1 -1
- package/dist/components/SplitButton/SplitButtonEnd.vue.d.ts +4 -1
- package/dist/components/SplitButton/SplitButtonEnd.vue.d.ts.map +1 -1
- package/dist/components/SplitButton/SplitButtonStart.vue.d.ts +4 -1
- package/dist/components/Tab/Tab.vue.d.ts +4 -1
- package/dist/components/Toast/Layouts/ToastLayoutAlternate.vue.d.ts +9 -3
- package/dist/components/Toast/Layouts/ToastLayoutAlternate.vue.d.ts.map +1 -1
- package/dist/components/Toast/Layouts/ToastLayoutDefault.vue.d.ts +9 -3
- package/dist/components/Toast/Layouts/ToastLayoutDefault.vue.d.ts.map +1 -1
- package/dist/components/Toast/Toast.vue.d.ts +37 -13
- package/dist/components/Toast/Toast.vue.d.ts.map +1 -1
- package/dist/dialtone-vue.cjs +1 -1
- package/dist/dialtone-vue.js +96 -96
- package/dist/lib/avatar/avatar.cjs +1 -1
- package/dist/lib/avatar/avatar.cjs.map +1 -1
- package/dist/lib/avatar/avatar.js +50 -47
- package/dist/lib/avatar/avatar.js.map +1 -1
- package/dist/lib/badge/badge.cjs +1 -1
- package/dist/lib/badge/badge.cjs.map +1 -1
- package/dist/lib/badge/badge.js +12 -14
- package/dist/lib/badge/badge.js.map +1 -1
- package/dist/lib/button/button.cjs +1 -1
- package/dist/lib/button/button.js +21 -21
- package/dist/lib/dropdown/dropdown.cjs +1 -1
- package/dist/lib/dropdown/dropdown.cjs.map +1 -1
- package/dist/lib/dropdown/dropdown.js +73 -13
- package/dist/lib/dropdown/dropdown.js.map +1 -1
- package/dist/lib/filter-pill/filter-pill-constants.cjs +2 -0
- package/dist/lib/filter-pill/filter-pill-constants.cjs.map +1 -0
- package/dist/lib/filter-pill/filter-pill-constants.js +7 -0
- package/dist/lib/filter-pill/filter-pill-constants.js.map +1 -0
- package/dist/lib/filter-pill/filter-pill-controlled.cjs +2 -0
- package/dist/lib/filter-pill/filter-pill-controlled.cjs.map +1 -0
- package/dist/lib/filter-pill/filter-pill-controlled.js +308 -0
- package/dist/lib/filter-pill/filter-pill-controlled.js.map +1 -0
- package/dist/lib/filter-pill/filter-pill-selection.cjs +2 -0
- package/dist/lib/filter-pill/filter-pill-selection.cjs.map +1 -0
- package/dist/lib/filter-pill/filter-pill-selection.js +32 -0
- package/dist/lib/filter-pill/filter-pill-selection.js.map +1 -0
- package/dist/lib/filter-pill/filter-pill.cjs +1 -1
- package/dist/lib/filter-pill/filter-pill.cjs.map +1 -1
- package/dist/lib/filter-pill/filter-pill.js +360 -94
- package/dist/lib/filter-pill/filter-pill.js.map +1 -1
- package/dist/lib/list-item/index.cjs +1 -1
- package/dist/lib/list-item/index.js +3 -3
- package/dist/lib/list-item/list-item-constants.cjs +1 -1
- package/dist/lib/list-item/list-item-constants.cjs.map +1 -1
- package/dist/lib/list-item/list-item-constants.js +12 -6
- package/dist/lib/list-item/list-item-constants.js.map +1 -1
- package/dist/lib/list-item/list-item.cjs +1 -1
- package/dist/lib/list-item/list-item.cjs.map +1 -1
- package/dist/lib/list-item/list-item.js +36 -32
- package/dist/lib/list-item/list-item.js.map +1 -1
- package/dist/lib/loader/loader.cjs +3 -3
- package/dist/lib/loader/loader.cjs.map +1 -1
- package/dist/lib/loader/loader.js +28 -20
- package/dist/lib/loader/loader.js.map +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 +6 -5
- package/dist/lib/modal/modal.js.map +1 -1
- package/dist/lib/popover/popover-header-footer.cjs +1 -1
- package/dist/lib/popover/popover-header-footer.cjs.map +1 -1
- package/dist/lib/popover/popover-header-footer.js +7 -1
- package/dist/lib/popover/popover-header-footer.js.map +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 +57 -21
- package/dist/lib/popover/popover.js.map +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/rich-text-editor.cjs +1 -1
- package/dist/lib/rich-text-editor/rich-text-editor.js +1 -1
- package/dist/lib/segmented-control/segmented-control-item.cjs.map +1 -1
- package/dist/lib/segmented-control/segmented-control-item.js.map +1 -1
- package/dist/lib/text/text.cjs.map +1 -1
- package/dist/lib/text/text.js.map +1 -1
- package/dist/localization/en-US.cjs +9 -0
- package/dist/localization/en-US.cjs.map +1 -1
- package/dist/localization/en-US.js +1 -1
- package/dist/localization/en-US.js.map +1 -1
- package/dist/localization/index.cjs +1 -1
- package/dist/localization/index.cjs.map +1 -1
- package/dist/localization/index.js +50 -33
- package/dist/localization/index.js.map +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filter-pill.js","names":[],"sources":["../../../components/FilterPill/FilterPill.vue"],"sourcesContent":["<template>\n <div\n :class=\"[\n 'd-filter-pill',\n { 'd-filter-pill--read-only': readOnly },\n ]\"\n data-qa=\"dt-filter-pill\"\n >\n <component\n :is=\"overlayComponent\"\n v-model:open=\"isOpen\"\n v-bind=\"overlayProps\"\n :content-mode=\"contentMode\"\n >\n <template #anchor=\"slotData\">\n <dt-button\n v-dt-tooltip=\"resolvedStartTooltipText\"\n v-bind=\"useDropdown ? slotData : slotData.attrs\"\n :active=\"isActive\"\n :aria-disabled=\"readOnly || undefined\"\n :class=\"[\n 'd-filter-pill__primary',\n {\n 'd-filter-pill--selected': isActive,\n },\n ]\"\n :disabled=\"disabled\"\n :kind=\"buttonKind\"\n :size=\"size\"\n data-qa=\"dt-filter-pill__button\"\n importance=\"outlined\"\n @click=\"openPopover\"\n @keydown.up.down.prevent=\"openPopover\"\n >\n <template\n v-if=\"$slots.startIcon\"\n #startIcon=\"{ iconSize }\"\n >\n <!-- @slot Icon displayed before the label -->\n <slot\n name=\"startIcon\"\n :icon-size=\"iconSize\"\n />\n </template>\n <span :class=\"['d-filter-pill__label', labelClass]\">\n <!-- @slot Allows you to customize the label slot -->\n <slot\n :label=\"label\"\n :filters=\"filters\"\n :active-filters=\"activeFilters\"\n :active-filter-list=\"activeFilterList\"\n :active-filter-overflow=\"activeFilterOverflow\"\n >\n <span\n class=\"d-filter-pill__label-start\"\n :title=\"label\"\n v-text=\"label\"\n />\n <span\n v-if=\"activeFilterList\"\n class=\"d-filter-pill__label-end\"\n :title=\"activeFilterList\"\n v-text=\"activeFilterList\"\n />\n <span\n v-if=\"activeFilterOverflow\"\n class=\"d-filter-pill__label-end-overflow\"\n :title=\"`plus ${activeFilters.length - 1} others`\"\n v-text=\"activeFilterOverflow\"\n />\n </slot>\n </span>\n <template\n v-if=\"!readOnly\"\n #endIcon=\"{ iconSize }\"\n >\n <dt-icon-chevron-down\n :size=\"iconSize\"\n class=\"d-filter-pill__icon\"\n data-qa=\"dt-filter-pill__icon\"\n />\n </template>\n </dt-button>\n </template>\n <template\n v-if=\"!useDropdown\"\n #content=\"{ close }\"\n >\n <!-- @slot Allows you to override the popover content, only use this if you need custom behavior -->\n <slot\n :close=\"close\"\n :apply=\"applySelection\"\n :cancel=\"cancelSelection\"\n :pending-filters=\"pendingFilters\"\n name=\"content\"\n >\n <dt-checkbox-group\n v-if=\"modelValue?.length\"\n :model-value=\"deferSelection ? pendingActiveFilters : activeFilters\"\n :aria-label=\"label\"\n :name=\"label || 'filter-pill'\"\n >\n <dt-checkbox\n v-for=\"filter in displayFilters\"\n :key=\"filter.name\"\n :label=\"filter.name\"\n :value=\"filter.name\"\n @update:model-value=\"($event) => filter.active = $event\"\n />\n </dt-checkbox-group>\n </slot>\n </template>\n <template\n v-if=\"!useDropdown && $slots.headerContent\"\n #headerContent=\"{ close }\"\n >\n <!-- @slot Allows you to customize the popover header -->\n <slot\n name=\"headerContent\"\n :close=\"close\"\n />\n </template>\n <template\n v-if=\"!useDropdown && (deferSelection || $slots.footerContent)\"\n #footerContent=\"{ close }\"\n >\n <!-- @slot Allows you to customize the popover footer. Receives { close, apply, cancel } bindings. -->\n <slot\n name=\"footerContent\"\n :close=\"close\"\n :apply=\"applySelection\"\n :cancel=\"cancelSelection\"\n >\n <dt-stack\n v-if=\"deferSelection\"\n direction=\"row\"\n gap=\"400\"\n justify=\"end\"\n data-qa=\"dt-filter-pill__deferred-footer\"\n >\n <dt-button\n importance=\"clear\"\n kind=\"muted\"\n :size=\"200\"\n data-qa=\"dt-filter-pill__cancel-button\"\n @click=\"cancelSelection\"\n >\n {{ cancelButtonLabel }}\n </dt-button>\n <dt-button\n importance=\"primary\"\n :size=\"200\"\n data-qa=\"dt-filter-pill__apply-button\"\n @click=\"applySelection\"\n >\n {{ applyButtonLabel }}\n </dt-button>\n </dt-stack>\n </slot>\n </template>\n <template\n v-if=\"useDropdown\"\n #list=\"{ close }\"\n >\n <!-- @slot Allows you to override the dropdown content -->\n <slot\n :close=\"close\"\n name=\"content\"\n >\n <dt-list-item\n v-for=\"filter in filters\"\n :key=\"filter.name\"\n role=\"menuitem\"\n navigation-type=\"arrow-keys\"\n :selected=\"filter.active\"\n @click=\"selectFilter(filter, close)\"\n >\n {{ filter.name }}\n </dt-list-item>\n </slot>\n </template>\n </component>\n <dt-button\n v-if=\"hasClear\"\n v-dt-tooltip=\"endTooltipText\"\n :active=\"isActive\"\n :aria-label=\"clearButtonAriaLabel\"\n :class=\"[\n 'd-filter-pill__clear',\n { 'd-filter-pill__clear--selected': isActive },\n ]\"\n :disabled=\"disabled\"\n :kind=\"buttonKind\"\n :size=\"size\"\n :title=\"clearButtonTitle\"\n data-qa=\"dt-filter-pill__clear-button\"\n importance=\"outlined\"\n @click=\"clearFilter\"\n >\n <template #icon>\n <dt-icon-close :size=\"clearIconSize\" />\n </template>\n </dt-button>\n </div>\n</template>\n\n<script>\nimport { DtPopover, POPOVER_APPEND_TO_VALUES, POPOVER_PADDING_CLASSES } from '@/components/Popover';\nimport { HTML_ELEMENT_TYPE } from '@/common/constants';\nimport { CONTENT_MODE_PROP } from '@/common/mode_constants';\nimport { ordinalSizeValidator } from '@/common/validators';\nimport { BUTTON_SIZE_MODIFIERS, BUTTON_ICON_SIZES, DtButton } from '@/components/Button';\nimport { DtIconChevronDown, DtIconClose } from '@dialpad/dialtone-icons/vue';\nimport { DialtoneLocalization } from '@/localization';\nimport { DtCheckbox } from '@/components/Checkbox';\nimport { DtCheckboxGroup } from '@/components/CheckboxGroup';\nimport { DtDropdown } from '@/components/Dropdown';\nimport { DtListItem } from '@/components/ListItem';\nimport { DtStack } from '@/components/Stack';\n\nexport default {\n name: 'DtFilterPill',\n\n components: {\n DtCheckboxGroup,\n DtCheckbox,\n DtPopover,\n DtButton,\n DtIconClose,\n DtIconChevronDown,\n DtDropdown,\n DtListItem,\n DtStack,\n },\n\n props: {\n /**\n * When true, uses DtDropdown instead of DtPopover as the overlay.\n * Provides keyboard navigation (arrow keys) for list items.\n * Default content renders DtListItem elements (single-select)\n * instead of checkboxes (multi-select).\n */\n useDropdown: {\n type: Boolean,\n default: false,\n },\n\n /**\n * When true, checkbox changes are held in a pending state until the user\n * clicks Apply. Cancel or closing the popover discards pending changes.\n * Only applies to popover mode (not useDropdown).\n */\n deferSelection: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Array of filters to display in the popover,\n * should be an array of objects with `name` and `active` properties\n */\n modelValue: {\n type: Array,\n default: () => [],\n },\n\n /**\n * Text shown in tooltip when you hover the start button,\n * required if no content is passed to default slot\n */\n startTooltipText: {\n type: String,\n default: '',\n },\n\n /**\n * HTML disabled attribute\n */\n disabled: {\n type: Boolean,\n default: false,\n },\n\n /**\n * When true, the pill cannot be interacted with but does not\n * receive disabled visual styling. Adds `d-filter-pill--read-only`\n * class and hides the chevron icon. The clear button is suppressed\n * and the tooltip falls back to a read-only message when\n * startTooltipText is not provided.\n */\n readOnly: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Shows the clear button when a filter is active\n * @values true, false\n */\n showClear: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Label of the button\n */\n label: {\n type: String,\n default: undefined,\n },\n\n /**\n * Text shown in tooltip when you hover the end button,\n * required as it is an icon only button\n */\n endTooltipText: {\n type: String,\n default: '',\n },\n\n /**\n * Sets the element to which the\n * <a class=\"d-link\" href=\"https://dialtone.dialpad.com/components/popover.html#vue-api\" target=\"_blank\">popover component</a>\n * is going to append to\n * @values body, parent, root, HTMLElement\n */\n popoverAppendTo: {\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 the dropdown does not fit in the direction described by \"popoverPlacement\",\n * it will attempt to change it's direction to the \"popoverFallbackPlacements\".\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 popoverFallbackPlacements: {\n type: Array,\n default: () => {\n return ['auto'];\n },\n },\n\n /**\n * Determines maximum height for the popover before overflow.\n * Possible units rem|px|em\n */\n popoverMaxHeight: {\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 popoverMaxWidth: {\n type: String,\n default: '',\n },\n\n /**\n * Padding size class for the popover content.\n * @values none, small, medium, large\n */\n popoverPadding: {\n type: String,\n default: 'large',\n validator: (padding) => {\n return Object.keys(POPOVER_PADDING_CLASSES).some((item) => item === padding);\n },\n },\n\n /**\n * The direction the popover displays relative to the anchor.\n * <a class=\"d-link\" href=\"https://atomiks.github.io/tippyjs/v6/all-props/#placement\" target=\"_blank\">Tippy.js docs</a>\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 popoverPlacement: {\n type: String,\n default: 'bottom-start',\n },\n\n /**\n * Additional CSS class(es) applied to the label wrapper element.\n */\n labelClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Additional CSS class(es) applied to the popover content area.\n * Only applies when useDropdown is false.\n */\n popoverContentClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Additional CSS class(es) applied to the outer popover header element (`d-popover__header`).\n * Only applies when useDropdown is false.\n */\n popoverHeaderClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Additional CSS class(es) applied to the outer popover footer element (`d-popover__footer`).\n * Only applies when useDropdown is false.\n */\n popoverFooterClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Additional CSS class(es) applied to the popover dialog element.\n * Only applies when useDropdown is false.\n */\n popoverDialogClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Additional CSS class(es) applied to the dropdown list wrapper.\n * Only applies when useDropdown is true.\n */\n dropdownListClass: {\n type: [String, Array, Object],\n default: '',\n },\n\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 * The size of the button.\n * @values 100, 200, 300, 400, 500\n */\n size: {\n type: [String, Number],\n default: 200,\n validator: ordinalSizeValidator(BUTTON_SIZE_MODIFIERS),\n },\n },\n\n emits: [\n /**\n * Emitted when clicking the clear button\n *\n * @event clear\n * @type {Boolean | Array}\n */\n 'clear',\n\n /**\n * Emitted when popover is shown or hidden\n *\n * @event opened\n * @type {Boolean | Array}\n */\n 'open',\n\n /**\n * Emitted when the active filters change\n * @type {Array}\n */\n 'update:modelValue',\n\n /**\n * Emitted when deferred selection is applied\n *\n * @event apply\n */\n 'apply',\n ],\n\n data () {\n return {\n isOpen: false,\n i18n: new DialtoneLocalization(),\n filters: this.modelValue,\n pendingFilters: null,\n };\n },\n\n computed: {\n overlayComponent () {\n return this.useDropdown ? 'dt-dropdown' : 'dt-popover';\n },\n\n overlayProps () {\n const props = {\n 'append-to': this.popoverAppendTo,\n 'fallback-placements': this.popoverFallbackPlacements,\n 'max-height': this.popoverMaxHeight,\n 'max-width': this.popoverMaxWidth,\n modal: true,\n placement: this.popoverPlacement,\n };\n if (this.useDropdown) {\n props['list-class'] = this.dropdownListClass;\n } else {\n props.padding = this.popoverPadding;\n props['content-class'] = this.popoverContentClass;\n props['header-wrapper-class'] = this.popoverHeaderClass;\n props['footer-wrapper-class'] = this.popoverFooterClass;\n props['dialog-class'] = this.popoverDialogClass;\n }\n return props;\n },\n\n buttonKind () {\n return (this.isActive && !this.disabled) ? 'default' : 'muted';\n },\n\n resolvedStartTooltipText () {\n if (this.readOnly) return this.startTooltipText || this.i18n.$t('DIALTONE_FILTER_PILL_READ_ONLY_TOOLTIP');\n return this.startTooltipText;\n },\n\n clearButtonAriaLabel () {\n return this.endTooltipText || this.i18n.$t('DIALTONE_FILTER_PILL_CLEAR_BUTTON_LABEL');\n },\n\n clearButtonTitle () {\n if (this.endTooltipText) return;\n\n return this.clearButtonAriaLabel\n },\n\n activeFilters () {\n return this.filters.filter(filter => filter.active).map(filter => filter.name);\n },\n\n activeFilterList () {\n if (this.activeFilters.length === this.filters.length && this.filters.length > 1) {\n return 'All';\n }\n\n return this.activeFilters[0] ?? '';\n },\n\n activeFilterOverflow () {\n if (this.activeFilters.length <= 1) return '';\n if (this.activeFilters.length === this.filters.length && this.filters.length > 1) return '';\n\n return '+' + (this.activeFilters.length - 1);\n },\n\n isActive () {\n return this.activeFilterList.length > 0;\n },\n\n hasClear () {\n return !this.readOnly && this.showClear && this.activeFilterList.length > 0;\n },\n\n displayFilters () {\n return (this.deferSelection && this.pendingFilters) ? this.pendingFilters : this.filters;\n },\n\n pendingActiveFilters () {\n if (!this.pendingFilters) return [];\n return this.pendingFilters.filter(f => f.active).map(f => f.name);\n },\n\n cancelButtonLabel () {\n return this.i18n.$t('DIALTONE_FILTER_PILL_CANCEL_BUTTON_LABEL');\n },\n\n applyButtonLabel () {\n return this.i18n.$t('DIALTONE_FILTER_PILL_APPLY_BUTTON_LABEL');\n },\n\n clearIconSize () {\n if (String(this.size) === '100') return '100';\n return BUTTON_ICON_SIZES[String(this.size)];\n },\n },\n\n watch: {\n isOpen (isOpen) {\n this.$emit('open', isOpen);\n if (this.deferSelection) {\n if (isOpen) {\n this.pendingFilters = JSON.parse(JSON.stringify(this.filters));\n } else {\n this.pendingFilters = null;\n }\n }\n },\n\n filters: {\n deep: true,\n handler (filters) {\n this.$emit('update:modelValue', filters);\n },\n },\n },\n\n mounted () {\n if (!(this.modelValue?.length || (this.$slots.content && this.$slots.content()))) {\n console.warn('Please provide content through the v-model or the \"content\" slot.');\n }\n if (this.deferSelection && this.useDropdown) {\n console.warn('deferSelection has no effect when useDropdown is true.');\n }\n },\n\n methods: {\n clearFilter ($event) {\n this.filters.forEach(filter => delete filter.active);\n this.$emit('clear', $event)\n },\n\n openPopover () {\n if (this.readOnly) return;\n this.isOpen = true;\n },\n\n selectFilter (selectedFilter, close) {\n this.filters.forEach(filter => {\n filter.active = filter === selectedFilter;\n });\n close();\n },\n\n applySelection () {\n if (!this.pendingFilters) return;\n this.filters.forEach((filter, i) => {\n if (this.pendingFilters[i]) {\n filter.active = this.pendingFilters[i].active;\n } else {\n delete filter.active;\n }\n });\n this.$emit('apply');\n this.isOpen = false;\n },\n\n cancelSelection () {\n this.isOpen = false;\n },\n },\n};\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;AA4NA,IAAK,IAAU;CACb,MAAM;CAEN,YAAY;EACV,iBAAA;EACA,YAAA;EACA,WAAA;EACA,UAAA;EACA;EACA;EACA,YAAA;EACA,YAAA;EACA,SAAA;EACD;CAED,OAAO;EAOL,aAAa;GACX,MAAM;GACN,SAAS;GACV;EAOD,gBAAgB;GACd,MAAM;GACN,SAAS;GACV;EAMD,YAAY;GACV,MAAM;GACN,eAAe,EAAE;GAClB;EAMD,kBAAkB;GAChB,MAAM;GACN,SAAS;GACV;EAKD,UAAU;GACR,MAAM;GACN,SAAS;GACV;EASD,UAAU;GACR,MAAM;GACN,SAAS;GACV;EAMD,WAAW;GACT,MAAM;GACN,SAAS;GACV;EAKD,OAAO;GACL,MAAM;GACN,SAAS,KAAA;GACV;EAMD,gBAAgB;GACd,MAAM;GACN,SAAS;GACV;EAQD,iBAAiB;GACf,MAAM,CAAC,GAAmB,OAAO;GACjC,SAAS;GACT,YAAW,MACF,EAAyB,SAAS,EAAQ,IAC9C,aAAoB;GAE1B;EAYD,2BAA2B;GACzB,MAAM;GACN,eACS,CAAC,OAAO;GAElB;EAMD,kBAAkB;GAChB,MAAM;GACN,SAAS;GACV;EAMD,iBAAiB;GACf,MAAM;GACN,SAAS;GACV;EAMD,gBAAgB;GACd,MAAM;GACN,SAAS;GACT,YAAY,MACH,OAAO,KAAK,EAAwB,CAAC,MAAM,MAAS,MAAS,EAAQ;GAE/E;EAOD,kBAAkB;GAChB,MAAM;GACN,SAAS;GACV;EAKD,YAAY;GACV,MAAM;IAAC;IAAQ;IAAO;IAAO;GAC7B,SAAS;GACV;EAMD,qBAAqB;GACnB,MAAM;IAAC;IAAQ;IAAO;IAAO;GAC7B,SAAS;GACV;EAMD,oBAAoB;GAClB,MAAM;IAAC;IAAQ;IAAO;IAAO;GAC7B,SA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AAA;;EAEG,MAAI,QAC0B,CAAvC,EAAuC,GAAA,EAAvB,MAAM,EAAA,eAAa,EAAA,MAAA,GAAA,CAAA,OAAA,CAAA,CAAA,CAAA;;;;;;;;;;;WAhBvB,EAAA,eAAc,CAAA,CAAA,GAAA,EAAA,IAAA,GAAA,CAAA,EAAA,EAAA"}
|
|
1
|
+
{"version":3,"file":"filter-pill.js","names":[],"sources":["../../../components/FilterPill/FilterPill.vue"],"sourcesContent":["<template>\n <div\n :class=\"[\n 'd-filter-pill',\n { 'd-filter-pill--read-only': readOnly },\n ]\"\n v-bind=\"legacyRootAttrs()\"\n data-qa=\"dt-filter-pill\"\n >\n <component\n :is=\"overlayComponent\"\n ref=\"overlay\"\n :open=\"isOpen\"\n v-bind=\"overlayProps\"\n :aria-label=\"controlledAtBirth && !$slots.content ? label : undefined\"\n :content-mode=\"contentMode\"\n @update:open=\"onOverlayTerminalOpen\"\n @opened=\"onOverlayOpened\"\n @keydown=\"onOverlayKeydown\"\n >\n <template #anchor=\"slotData\">\n <dt-button\n ref=\"primaryButton\"\n v-dt-tooltip=\"resolvedStartTooltipText\"\n v-bind=\"anchorAttributes(slotData)\"\n :active=\"isActive\"\n :aria-disabled=\"readOnly || undefined\"\n :class=\"[\n 'd-filter-pill__primary',\n {\n 'd-filter-pill--selected': isActive,\n },\n ]\"\n :disabled=\"disabled\"\n :kind=\"buttonKind\"\n :size=\"size\"\n data-qa=\"dt-filter-pill__button\"\n importance=\"outlined\"\n @click=\"openPopover\"\n @keydown.up.down.prevent=\"onAnchorArrow\"\n >\n <template\n v-if=\"$slots.startIcon\"\n #startIcon=\"{ iconSize }\"\n >\n <!-- @slot Icon displayed before the label -->\n <slot\n name=\"startIcon\"\n :icon-size=\"iconSize\"\n />\n </template>\n <span\n :class=\"['d-filter-pill__label', labelClass]\"\n data-qa=\"dt-filter-pill__label\"\n >\n <!--\n @slot Customize the anchor label. Legacy and controlled bindings are conditional on options.\n @binding {string} label Dimension label.\n @binding {Array} filters Legacy filter records only.\n @binding {Array} activeFilters Legacy selected names only.\n @binding {string} activeFilterList Legacy first selection or All only.\n @binding {string} activeFilterOverflow Legacy overflow only.\n @binding {string | null | Array} selected Controlled committed snapshot only.\n @binding {Array} selectedOptions Controlled resolved option records only.\n @binding {string} displayLabel Controlled display summary only.\n @binding {boolean} isActive Controlled active state only.\n -->\n <slot\n v-if=\"controlledAtBirth\"\n v-bind=\"controlledAnchorBindings\"\n >\n <span\n class=\"sr-only\"\n data-qa=\"dt-filter-pill__accessible-label\"\n >{{ controlledAccessibleLabel }}</span>\n <span\n v-if=\"controlledDropdown || !isActive || label\"\n class=\"d-filter-pill__label-start\"\n data-qa=\"dt-filter-pill__label-start\"\n aria-hidden=\"true\"\n >{{ controlledDropdown || !isActive ? controlledDisplayLabel : label }}</span>\n <span\n v-if=\"!controlledDropdown && isActive\"\n :class=\"[\n 'd-filter-pill__label-end',\n { 'd-filter-pill__label-end--standalone': !label },\n ]\"\n data-qa=\"dt-filter-pill__label-end\"\n aria-hidden=\"true\"\n >{{ controlledDisplayLabel }}</span>\n <span\n v-if=\"controlledOverflow\"\n class=\"d-filter-pill__label-end-overflow\"\n data-qa=\"dt-filter-pill__overflow\"\n :title=\"activeFilterOverflowTitle\"\n >{{ controlledOverflow }}</span>\n <span\n v-if=\"hasSlotContent($slots.anchorEnd, controlledAnchorBindings)\"\n :class=\"['d-filter-pill__anchor-end', anchorEndClass]\"\n data-qa=\"dt-filter-pill__anchor-end\"\n >\n <!--\n @slot Noninteractive controlled trailing anchor content, retaining the built-in label.\n @binding {string} label Dimension label.\n @binding {string} displayLabel Committed display summary.\n @binding {string | null | Array} selected Committed selection snapshot.\n @binding {Array} selectedOptions Resolved committed option records.\n @binding {boolean} isActive Whether committed selection filters results.\n -->\n <slot\n name=\"anchorEnd\"\n v-bind=\"controlledAnchorBindings\"\n />\n </span>\n </slot>\n <!--\n @slot Customize the anchor label. Legacy and controlled bindings are conditional on options.\n @binding {string} label Dimension label.\n @binding {Array} filters Legacy filter records only.\n @binding {Array} activeFilters Legacy selected names only.\n @binding {string} activeFilterList Legacy first selection or All only.\n @binding {string} activeFilterOverflow Legacy overflow only.\n @binding {string | null | Array} selected Controlled committed snapshot only.\n @binding {Array} selectedOptions Controlled resolved option records only.\n @binding {string} displayLabel Controlled display summary only.\n @binding {boolean} isActive Controlled active state only.\n -->\n <slot\n v-else\n :label=\"label\"\n :filters=\"filters\"\n :active-filters=\"activeFilters\"\n :active-filter-list=\"activeFilterList\"\n :active-filter-overflow=\"activeFilterOverflow\"\n >\n <span\n class=\"d-filter-pill__label-start\"\n :title=\"label\"\n v-text=\"label\"\n />\n <span\n v-if=\"activeFilterList\"\n class=\"d-filter-pill__label-end\"\n :title=\"activeFilterLabel\"\n v-text=\"activeFilterLabel\"\n />\n <span\n v-if=\"activeFilterOverflow\"\n class=\"d-filter-pill__label-end-overflow\"\n :title=\"activeFilterOverflowTitle\"\n v-text=\"activeFilterOverflow\"\n />\n </slot>\n </span>\n <template\n v-if=\"!readOnly\"\n #endIcon=\"{ iconSize }\"\n >\n <dt-icon-chevron-down\n :size=\"iconSize\"\n class=\"d-filter-pill__icon\"\n data-qa=\"dt-filter-pill__icon\"\n />\n </template>\n </dt-button>\n </template>\n <template\n v-if=\"!overlayUseDropdown\"\n #content=\"{ close }\"\n >\n <!--\n @slot Override overlay content. Bindings are conditional on the selection contract.\n @binding {Function} close Dismiss without applying.\n @binding {Function} apply Legacy popovers; controlled Promise callback (no-op outside open deferred popovers).\n @binding {Function} cancel Discard pending state and dismiss; legacy popovers or either controlled pattern.\n @binding {Array | null} pendingFilters Legacy popover draft records only.\n @binding {string | null | Array} selected Controlled committed snapshot only.\n @binding {Array | null} pendingSelected Controlled open deferred draft snapshot only.\n @binding {Function} setSelected Controlled explicit selection action only.\n -->\n <slot\n v-if=\"controlledAtBirth\"\n name=\"content\"\n v-bind=\"controlledContentBindings\"\n >\n <dt-checkbox-group\n :model-value=\"checkboxRenderValues\"\n :aria-label=\"label\"\n :name=\"label || 'filter-pill'\"\n :disabled=\"!controlledCanSelect\"\n >\n <dt-checkbox\n v-for=\"option in controlledState.options\"\n :id=\"controlledOptionId(option.value)\"\n :key=\"option.value\"\n :label=\"option.label\"\n :value=\"option.value\"\n data-qa=\"dt-filter-pill__checkbox\"\n @update:model-value=\"toggleControlledOption(option.value, $event)\"\n >\n {{ option.label }}\n <span\n v-if=\"$slots.optionEnd\"\n :class=\"['d-filter-pill__option-end', optionEndClass]\"\n >\n <!--\n @slot Noninteractive trailing choice content, retaining its label and handler.\n @binding {Object} option Read-only option record.\n @binding {boolean} selected Whether this row is selected, using a deferred draft when open.\n -->\n <slot\n name=\"optionEnd\"\n :option=\"option\"\n :selected=\"controlledRowSelected(option.value)\"\n />\n </span>\n </dt-checkbox>\n </dt-checkbox-group>\n </slot>\n <!--\n @slot Override overlay content. Bindings are conditional on the selection contract.\n @binding {Function} close Dismiss without applying.\n @binding {Function} apply Legacy popovers; controlled Promise callback (no-op outside open deferred popovers).\n @binding {Function} cancel Discard pending state and dismiss; legacy popovers or either controlled pattern.\n @binding {Array | null} pendingFilters Legacy popover draft records only.\n @binding {string | null | Array} selected Controlled committed snapshot only.\n @binding {Array | null} pendingSelected Controlled open deferred draft snapshot only.\n @binding {Function} setSelected Controlled explicit selection action only.\n -->\n <slot\n v-else\n :close=\"close\"\n :apply=\"applySelection\"\n :cancel=\"cancelSelection\"\n :pending-filters=\"pendingFilters\"\n name=\"content\"\n >\n <dt-checkbox-group\n v-if=\"modelValue?.length\"\n :model-value=\"deferSelection ? pendingActiveFilters : activeFilters\"\n :aria-label=\"label\"\n :name=\"label || 'filter-pill'\"\n >\n <dt-checkbox\n v-for=\"filter in displayFilters\"\n :key=\"filter.name\"\n :label=\"filter.name\"\n :value=\"filter.name\"\n @update:model-value=\"($event) => filter.active = $event\"\n />\n </dt-checkbox-group>\n </slot>\n </template>\n <template\n v-if=\"!overlayUseDropdown && $slots.headerContent\"\n #headerContent=\"{ close }\"\n >\n <!-- @slot Popover header or noninteractive built-in controlled dropdown heading.\n Absent in legacy dropdowns and full custom dropdown content.\n @binding {Function} close Dismiss without applying; popovers only.\n -->\n <slot\n name=\"headerContent\"\n :close=\"controlledAtBirth ? closeControlled : close\"\n />\n </template>\n <template\n v-if=\"!overlayUseDropdown && (deferSelection || $slots.footerContent)\"\n #footerContent=\"{ close }\"\n >\n <!-- @slot Allows you to customize the popover footer. Receives { close, apply, cancel } bindings. -->\n <slot\n name=\"footerContent\"\n :close=\"controlledAtBirth ? closeControlled : close\"\n :apply=\"applySelection\"\n :cancel=\"cancelSelection\"\n >\n <dt-stack\n v-if=\"deferSelection\"\n direction=\"row\"\n gap=\"400\"\n justify=\"end\"\n data-qa=\"dt-filter-pill__deferred-footer\"\n >\n <dt-button\n importance=\"clear\"\n kind=\"muted\"\n :size=\"200\"\n data-qa=\"dt-filter-pill__cancel-button\"\n @click=\"cancelSelection\"\n >\n {{ cancelButtonLabel }}\n </dt-button>\n <dt-button\n importance=\"primary\"\n :size=\"200\"\n data-qa=\"dt-filter-pill__apply-button\"\n @click=\"applySelection\"\n >\n {{ applyButtonLabel }}\n </dt-button>\n </dt-stack>\n </slot>\n </template>\n <template\n v-if=\"overlayUseDropdown\"\n #list=\"{ close }\"\n >\n <!--\n @slot Override overlay content. Bindings are conditional on the selection contract.\n @binding {Function} close Dismiss without applying.\n @binding {Function} apply Legacy popovers; controlled Promise callback (no-op outside open deferred popovers).\n @binding {Function} cancel Discard pending state and dismiss; legacy popovers or either controlled pattern.\n @binding {Array | null} pendingFilters Legacy popover draft records only.\n @binding {string | null | Array} selected Controlled committed snapshot only.\n @binding {Array | null} pendingSelected Controlled open deferred draft snapshot only.\n @binding {Function} setSelected Controlled explicit selection action only.\n -->\n <slot\n v-if=\"controlledAtBirth\"\n name=\"content\"\n v-bind=\"controlledContentBindings\"\n >\n <li\n v-if=\"$slots.headerContent\"\n role=\"presentation\"\n :class=\"['d-filter-pill__menu-heading', headerContentClass]\"\n >\n <dt-text\n variant=\"label-xs\"\n :size=\"100\"\n strength=\"medium\"\n tone=\"tertiary\"\n :density=\"500\"\n >\n <!-- @slot Popover header or noninteractive built-in controlled dropdown heading.\n Absent in legacy dropdowns and full custom dropdown content. -->\n <slot name=\"headerContent\" />\n </dt-text>\n </li>\n <dt-list-item\n v-for=\"option in controlledState.options\"\n :id=\"controlledOptionId(option.value)\"\n :key=\"option.value\"\n role=\"menuitemradio\"\n data-qa=\"dt-filter-pill__option\"\n navigation-type=\"arrow-keys\"\n :selected=\"controlledRowSelected(option.value)\"\n :aria-disabled=\"!controlledCanSelect || undefined\"\n @click=\"selectControlledOption(option.value)\"\n >\n {{ option.label }}\n <template #selected>\n <dt-icon-check\n size=\"200\"\n :class=\"{ 'd-filter-pill__selection-indicator--hidden': !controlledRowSelected(option.value) }\"\n aria-hidden=\"true\"\n data-qa=\"dt-filter-pill__selection-indicator\"\n />\n </template>\n <template\n v-if=\"$slots.optionEnd\"\n #end\n >\n <span :class=\"['d-filter-pill__option-end', optionEndClass]\">\n <!--\n @slot Noninteractive trailing choice content, retaining its label and handler.\n @binding {Object} option Read-only option record.\n @binding {boolean} selected Whether this row is selected, using a deferred draft when open.\n -->\n <slot\n name=\"optionEnd\"\n :option=\"option\"\n :selected=\"controlledRowSelected(option.value)\"\n />\n </span>\n </template>\n </dt-list-item>\n </slot>\n <!--\n @slot Override overlay content. Bindings are conditional on the selection contract.\n @binding {Function} close Dismiss without applying.\n @binding {Function} apply Legacy popovers; controlled Promise callback (no-op outside open deferred popovers).\n @binding {Function} cancel Discard pending state and dismiss; legacy popovers or either controlled pattern.\n @binding {Array | null} pendingFilters Legacy popover draft records only.\n @binding {string | null | Array} selected Controlled committed snapshot only.\n @binding {Array | null} pendingSelected Controlled open deferred draft snapshot only.\n @binding {Function} setSelected Controlled explicit selection action only.\n -->\n <slot\n v-else\n :close=\"close\"\n name=\"content\"\n >\n <dt-list-item\n v-for=\"filter in filters\"\n :key=\"filter.name\"\n role=\"menuitem\"\n navigation-type=\"arrow-keys\"\n :selected=\"filter.active\"\n @click=\"selectFilter(filter, close)\"\n >\n {{ filter.name }}\n <template #selected>\n <dt-icon-check\n size=\"200\"\n :class=\"{ 'd-filter-pill__selection-indicator--hidden': !filter.active }\"\n aria-hidden=\"true\"\n data-qa=\"dt-filter-pill__selection-indicator\"\n />\n </template>\n </dt-list-item>\n </slot>\n </template>\n </component>\n <dt-button\n v-if=\"hasClear\"\n ref=\"clearButton\"\n v-dt-tooltip=\"endTooltipText\"\n :active=\"isActive\"\n :aria-label=\"clearButtonAriaLabel\"\n :class=\"[\n 'd-filter-pill__clear',\n { 'd-filter-pill__clear--selected': isActive },\n ]\"\n :disabled=\"disabled\"\n :kind=\"buttonKind\"\n :size=\"size\"\n :title=\"clearButtonTitle\"\n data-qa=\"dt-filter-pill__clear-button\"\n importance=\"outlined\"\n @click=\"clearFilter\"\n >\n <template #icon>\n <dt-icon-close :size=\"clearIconSize\" />\n </template>\n </dt-button>\n </div>\n</template>\n\n<script>\nimport {\n DtPopover,\n POPOVER_APPEND_TO_VALUES,\n POPOVER_HEADER_FOOTER_PADDING_CLASSES,\n POPOVER_PADDING_CLASSES,\n} from '@/components/Popover';\nimport { HTML_ELEMENT_TYPE } from '@/common/constants';\nimport { CONTENT_MODE_PROP } from '@/common/mode_constants';\nimport { ordinalSizeValidator } from '@/common/validators';\nimport { FILTER_PILL_OVERLAY_MIN_INLINE_SIZE_VALUES } from './FilterPillConstants';\nimport { hasSlotContent } from '@/common/utils';\nimport { BUTTON_SIZE_MODIFIERS, BUTTON_ICON_SIZES, DtButton } from '@/components/Button';\nimport { DtIconChevronDown, DtIconClose, DtIconCheck } from '@dialpad/dialtone-icons/vue';\nimport { DialtoneLocalization } from '@/localization';\nimport { DtCheckbox } from '@/components/Checkbox';\nimport { DtCheckboxGroup } from '@/components/CheckboxGroup';\nimport { DtDropdown } from '@/components/Dropdown';\nimport { DtListItem } from '@/components/ListItem';\nimport { DtStack } from '@/components/Stack';\nimport { DtText } from '@/components/Text';\nimport ControlledSelection from './FilterPillControlled';\n\n/**\n * @typedef {object} FilterPillOption\n * @property {string} value Stable choice identity.\n * @property {string} label Required choice label.\n * @property {string | null} [shortLabel] Optional anchor summary; null uses label.\n */\n\nexport default {\n name: 'DtFilterPill',\n\n components: {\n DtCheckboxGroup,\n DtCheckbox,\n DtPopover,\n DtButton,\n DtIconClose,\n DtIconCheck,\n DtIconChevronDown,\n DtDropdown,\n DtListItem,\n DtStack,\n DtText,\n },\n\n mixins: [ControlledSelection],\n\n props: {\n /**\n * An array at creation (including []) opts into authoritative selection. Remount to change contract or controlled pattern.\n * Records require string value and label. Optional shortLabel accepts string or null; null is absent and empty string is meaningful.\n */\n options: {\n type: /** @type {import('vue').PropType<readonly FilterPillOption[] | null>} */ (Array),\n default: undefined,\n },\n\n /** Controlled selection: string|null in dropdowns, readonly string[] in popovers. */\n selected: {\n type: /** @type {import('vue').PropType<string | null | readonly string[]>} */ ([String, Array]),\n default: undefined,\n },\n\n /**\n * Single-selection baseline. Null or omitted means absent; empty string is meaningful. Ignored in multiple selection.\n */\n neutralValue: {\n type: /** @type {import('vue').PropType<string | null>} */ (String),\n default: undefined,\n },\n\n /** Logical visibility synchronization for controlled selection. Null uses internal ownership. */\n open: {\n type: [Boolean, null],\n default: null,\n },\n\n /** Classes on the immediate noninteractive anchorEnd wrapper. */\n anchorEndClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /** Classes on each immediate noninteractive optionEnd wrapper. */\n optionEndClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /** Classes on the immediate headerContent wrapper. */\n headerContentClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * When true, uses DtDropdown instead of DtPopover as the overlay.\n * Provides keyboard navigation (arrow keys) for list items.\n * Default content renders DtListItem elements (single-select)\n * instead of checkboxes (multi-select).\n */\n useDropdown: {\n type: Boolean,\n default: false,\n },\n\n /**\n * When true, checkbox changes are held in a pending state until the user\n * clicks Apply. Cancel or closing the popover discards pending changes.\n * Applies to popover mode.\n */\n deferSelection: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Array of filters to display in the popover,\n * should be an array of objects with `name` and `active` properties\n */\n modelValue: {\n type: Array,\n default: () => [],\n },\n\n /**\n * Text shown in tooltip when you hover the start button,\n * required if no content is passed to default slot\n */\n startTooltipText: {\n type: String,\n default: '',\n },\n\n /**\n * HTML disabled attribute\n */\n disabled: {\n type: Boolean,\n default: false,\n },\n\n /**\n * When true, the pill cannot be interacted with but does not\n * receive disabled visual styling. Adds `d-filter-pill--read-only`\n * class and hides the chevron icon. The clear button is suppressed\n * and the tooltip falls back to a read-only message when\n * startTooltipText is not provided.\n */\n readOnly: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Shows the clear button when a filter is active\n * @values true, false\n */\n showClear: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Label of the button\n */\n label: {\n type: String,\n default: undefined,\n },\n\n /**\n * Text shown in tooltip when you hover the end button,\n * required as it is an icon only button\n */\n endTooltipText: {\n type: String,\n default: '',\n },\n\n /**\n * Sets the element to which the\n * <a class=\"d-link\" href=\"https://dialtone.dialpad.com/components/popover.html#vue-api\" target=\"_blank\">popover component</a>\n * is going to append to\n * @values body, parent, root, HTMLElement\n */\n popoverAppendTo: {\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 the dropdown does not fit in the direction described by \"popoverPlacement\",\n * it will attempt to change it's direction to the \"popoverFallbackPlacements\".\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 popoverFallbackPlacements: {\n type: Array,\n default: () => {\n return ['auto'];\n },\n },\n\n /**\n * Determines maximum height for the popover before overflow.\n * Possible units rem|px|em\n */\n popoverMaxHeight: {\n type: String,\n default: '',\n },\n\n /**\n * Minimum overlay inline size (aka left/right extent). Anchor uses the entire pill, including Clear.\n * Fixed layout values follow DtBox: 300 maps to --dt-layout-300; 0 uses natural sizing. Percentages are not supported.\n * The popoverMaxWidth cap still applies.\n * @values anchor, 0, 1px, 2px, 8px, 25, 20px, 24px, 50, 75, 100, 125, 150, 175, 200, 250, 300, 350, 400, 450, 500, 550, 600, 650, 700, 750, 800, 850, 900, 950, 1000, 1050, 1100, 1150, 1200, 1250, 1300, 1350, 1400, 1450, 1500, 1550, 1600\n */\n overlayMinInlineSize: {\n type: String,\n default: 'anchor',\n validator: ordinalSizeValidator(FILTER_PILL_OVERLAY_MIN_INLINE_SIZE_VALUES),\n },\n\n /**\n * Determines maximum width for the popover before overflow.\n * Possible units rem|px|%|em\n */\n popoverMaxWidth: {\n type: String,\n default: '',\n },\n\n /**\n * Padding preset for the popover content. Omit for compact block 100 / inline 150 spacing.\n * Set large to restore the previous content padding.\n * @values none, small, medium, large\n */\n popoverPadding: {\n type: String,\n default: undefined,\n validator: (padding) => {\n return Object.keys(POPOVER_PADDING_CLASSES).some((item) => item === padding);\n },\n },\n\n /**\n * The direction the popover displays relative to the anchor.\n * <a class=\"d-link\" href=\"https://atomiks.github.io/tippyjs/v6/all-props/#placement\" target=\"_blank\">Tippy.js docs</a>\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 popoverPlacement: {\n type: String,\n default: 'bottom-start',\n },\n\n /**\n * Additional CSS class(es) applied to the label wrapper element.\n */\n labelClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Additional CSS class(es) applied to the popover content area.\n * Applies to popover mode.\n */\n popoverContentClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Additional CSS class(es) applied to the outer popover header element (`d-popover__header`).\n * Applies to popover mode.\n */\n popoverHeaderClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Additional CSS class(es) applied to the outer popover footer element (`d-popover__footer`).\n * Applies to popover mode.\n */\n popoverFooterClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Additional CSS class(es) applied to the popover dialog element.\n * Applies to popover mode.\n */\n popoverDialogClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Additional CSS class(es) applied to the dropdown list wrapper.\n * Only applies when useDropdown is true.\n */\n dropdownListClass: {\n type: [String, Array, Object],\n default: '',\n },\n\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 * The size of the button.\n * @values 100, 200, 300, 400, 500\n */\n size: {\n type: [String, Number],\n default: 200,\n validator: ordinalSizeValidator(BUTTON_SIZE_MODIFIERS),\n },\n },\n\n emits: [\n /** Proposed controlled value. The parent remains authoritative. @type {string | null | Array} */\n 'update:selected',\n\n /** User action snapshot: value, previousValue, reason and changed. @type {Object} */\n 'selection-change',\n\n /** Logical visibility synchronization when controlled open is boolean. @type {boolean} */\n 'update:open',\n\n /**\n * Controlled-only completed overlay visibility, after focus and scroll cleanup.\n * For removal, keep the modal, anchor and scroll container unchanged until opened(false).\n * Completion does not establish global scroll-lock ownership.\n * @type {boolean}\n */\n 'opened',\n\n /**\n * Emitted when clicking the clear button\n *\n * @event clear\n * @type {Boolean | Array}\n */\n 'clear',\n\n /**\n * Logical visibility notification when the overlay is shown or dismissed\n *\n * @event open\n * @type {Boolean | Array}\n */\n 'open',\n\n /**\n * Emitted when the active filters change\n * @type {Array}\n */\n 'update:modelValue',\n\n /**\n * Emitted when deferred selection is applied\n *\n * @event apply\n */\n 'apply',\n ],\n\n data () {\n return {\n isOpen: false,\n i18n: new DialtoneLocalization(),\n filters: Array.isArray(this.options) ? [] : this.modelValue,\n pendingFilters: null,\n overlayResizeObserver: /** @type {ResizeObserver | null} */ (null),\n };\n },\n\n computed: {\n overlayUseDropdown () {\n return this.controlledAtBirth ? this.controlledDropdown : this.useDropdown;\n },\n\n overlayComponent () {\n return this.overlayUseDropdown ? 'dt-dropdown' : 'dt-popover';\n },\n\n overlayProps () {\n const props = {\n 'append-to': this.popoverAppendTo,\n 'fallback-placements': this.popoverFallbackPlacements,\n 'max-height': this.popoverMaxHeight,\n 'max-width': this.popoverMaxWidth,\n modal: true,\n placement: this.popoverPlacement,\n };\n if (this.controlledAtBirth) {\n props.visibilityChangeCallback = this.onControlledVisibility;\n props.forwardAnchorArrowKeys = true;\n }\n if (this.overlayUseDropdown) {\n props['list-class'] = this.dropdownListClass;\n } else {\n const defaultPadding = this.popoverPadding === undefined;\n props.padding = defaultPadding ? 'none' : this.popoverPadding;\n props['content-class'] = defaultPadding\n ? ['d-filter-pill__popover-content', this.popoverContentClass]\n : this.popoverContentClass;\n props['header-wrapper-class'] = defaultPadding\n ? [POPOVER_HEADER_FOOTER_PADDING_CLASSES.large, this.popoverHeaderClass]\n : this.popoverHeaderClass;\n props['header-class'] = this.headerContentClass;\n props['footer-wrapper-class'] = defaultPadding\n ? [POPOVER_HEADER_FOOTER_PADDING_CLASSES.large, this.popoverFooterClass]\n : this.popoverFooterClass;\n props['dialog-class'] = this.popoverDialogClass;\n }\n return props;\n },\n\n buttonKind () {\n return (this.isActive && !this.disabled) ? 'default' : 'muted';\n },\n\n resolvedStartTooltipText () {\n if (this.readOnly) return this.startTooltipText || this.i18n.$t('DIALTONE_FILTER_PILL_READ_ONLY_TOOLTIP');\n return this.startTooltipText;\n },\n\n clearButtonAriaLabel () {\n return this.endTooltipText || this.i18n.$t('DIALTONE_FILTER_PILL_CLEAR_BUTTON_LABEL');\n },\n\n clearButtonTitle () {\n if (this.endTooltipText) return;\n\n return this.clearButtonAriaLabel;\n },\n\n activeFilters () {\n return this.filters.filter(filter => filter.active).map(filter => filter.name);\n },\n\n allFiltersActive () {\n return this.filters.length > 1 && this.activeFilters.length === this.filters.length;\n },\n\n activeFilterList () {\n if (this.allFiltersActive) {\n return 'All';\n }\n\n return this.activeFilters[0] ?? '';\n },\n\n activeFilterLabel () {\n if (this.allFiltersActive) {\n return this.i18n.$t('DIALTONE_FILTER_PILL_ALL_LABEL');\n }\n\n return this.activeFilterList;\n },\n\n activeFilterOverflowTitle () {\n const count = this.controlledAtBirth ? this.controlledState.values.length - 1 : this.activeFilters.length - 1;\n return this.i18n.$t('DIALTONE_FILTER_PILL_OVERFLOW_TITLE', { count });\n },\n\n activeFilterOverflow () {\n if (this.activeFilters.length <= 1 || this.allFiltersActive) return '';\n\n return '+' + (this.activeFilters.length - 1);\n },\n\n isActive () {\n if (this.controlledAtBirth) return this.controlledState.valid && this.controlledState.isActive;\n return this.activeFilterList.length > 0;\n },\n\n hasClear () {\n if (this.controlledAtBirth) {\n return !this.readOnly && this.showClear && this.controlledContractValid &&\n this.controlledState.valid && this.isActive;\n }\n return !this.readOnly && this.showClear && this.activeFilterList.length > 0;\n },\n\n displayFilters () {\n return (this.deferSelection && this.pendingFilters) ? this.pendingFilters : this.filters;\n },\n\n pendingActiveFilters () {\n if (!this.pendingFilters) return [];\n return this.pendingFilters.filter(f => f.active).map(f => f.name);\n },\n\n cancelButtonLabel () {\n return this.i18n.$t('DIALTONE_FILTER_PILL_CANCEL_BUTTON_LABEL');\n },\n\n applyButtonLabel () {\n return this.i18n.$t('DIALTONE_FILTER_PILL_APPLY_BUTTON_LABEL');\n },\n\n clearIconSize () {\n if (String(this.size) === '100') return '100';\n return BUTTON_ICON_SIZES[String(this.size)];\n },\n },\n\n watch: {\n overlayMinInlineSize: { handler: 'observeOverlayAnchor', flush: 'post' },\n overlayUseDropdown: { handler: 'observeOverlayAnchor', flush: 'post' },\n hasClear: { handler: 'observeOverlayAnchor', flush: 'post' },\n popoverMaxWidth: { handler: 'syncOverlayMinInlineSize', flush: 'post' },\n\n isOpen: [\n { handler: 'syncOverlayMinInlineSize', flush: 'post' },\n function (isOpen) {\n if (this.controlledAtBirth) return;\n this.$emit('open', isOpen);\n if (this.deferSelection) {\n if (isOpen) {\n this.pendingFilters = JSON.parse(JSON.stringify(this.filters));\n } else {\n this.pendingFilters = null;\n }\n }\n },\n ],\n\n filters: {\n deep: true,\n handler (filters) {\n if (!this.controlledAtBirth) this.$emit('update:modelValue', filters);\n },\n },\n },\n\n mounted () {\n this.observeOverlayAnchor();\n if (!this.controlledAtBirth && !(this.modelValue?.length || this.$slots.content)) {\n console.warn('Please provide content through the v-model or the \"content\" slot.');\n }\n if (this.deferSelection && this.useDropdown) {\n console.warn('deferSelection has no effect when useDropdown is true.');\n }\n },\n\n beforeUnmount () {\n this.overlayResizeObserver?.disconnect();\n },\n\n methods: {\n hasSlotContent,\n\n observeOverlayAnchor () {\n this.overlayResizeObserver?.disconnect();\n this.overlayResizeObserver = null;\n if (this.overlayMinInlineSize === 'anchor' && typeof ResizeObserver !== 'undefined') {\n this.overlayResizeObserver = new ResizeObserver(() => this.syncOverlayMinInlineSize());\n [this.$el, ...this.getAnchorControls()]\n .forEach(element => this.overlayResizeObserver.observe(element));\n }\n this.syncOverlayMinInlineSize();\n },\n\n getAnchorControls () {\n // Legacy Dropdown slot bindings replace the primary button's ref.\n const primary = this.$el.querySelector('[data-qa=\"dt-filter-pill__button\"]');\n return [primary, this.$refs.clearButton?.$el].filter(Boolean);\n },\n\n measureAnchorInlineSize () {\n // The flex wrapper may stretch beyond the visible pill controls.\n const controls = this.getAnchorControls();\n if (!controls.length) return 0;\n const vertical = /^(vertical|sideways)/.test(getComputedStyle(this.$el).writingMode);\n const [start, end] = vertical ? ['top', 'bottom'] : ['left', 'right'];\n const bounds = controls.map(element => element.getBoundingClientRect());\n return Math.max(...bounds.map(rect => rect[end])) - Math.min(...bounds.map(rect => rect[start]));\n },\n\n resolveOverlayMinInlineSize () {\n let minimum = String(this.overlayMinInlineSize ?? '0');\n if (minimum === 'anchor') {\n minimum = `${this.measureAnchorInlineSize()}px`;\n } else {\n minimum = minimum === '0' ? '0px' : `var(--dt-layout-${minimum})`;\n }\n if (minimum && this.popoverMaxWidth && this.popoverMaxWidth !== 'none') {\n return `min(${minimum}, ${this.popoverMaxWidth})`;\n }\n return minimum;\n },\n\n syncOverlayMinInlineSize () {\n const overlay = this.$refs.overlay;\n if (!overlay) return;\n const popover = this.overlayUseDropdown ? overlay.$refs.popover : overlay;\n const dialog = popover?.popoverContentEl;\n if (!dialog) return;\n const minimum = this.resolveOverlayMinInlineSize();\n if (dialog.style.minInlineSize === minimum) return;\n dialog.style.minInlineSize = minimum;\n popover.tip?.popperInstance?.update();\n },\n\n clearFilter ($event) {\n if (this.controlledAtBirth) {\n const baseline = this.controlledDropdown ? (this.neutralValue ?? null) : [];\n this.controlledDraft = null;\n this.commitControlled(baseline, 'clear', true, $event);\n this.reconcileCheckboxes();\n return;\n }\n this.filters.forEach(filter => delete filter.active);\n this.$emit('clear', $event);\n },\n\n openPopover () {\n if (this.controlledAtBirth) { this.requestControlledOpen(true); return; }\n if (this.readOnly) return;\n this.isOpen = true;\n },\n\n selectFilter (selectedFilter, close) {\n this.filters.forEach(filter => {\n filter.active = filter === selectedFilter;\n });\n close();\n },\n\n /** Controlled Apply closes on success; custom footers should call apply() alone or await it. */\n applySelection () {\n if (this.controlledAtBirth) return this.applyControlledSelection();\n if (!this.pendingFilters) return;\n this.filters.forEach((filter, i) => {\n if (this.pendingFilters[i]) {\n filter.active = this.pendingFilters[i].active;\n } else {\n delete filter.active;\n }\n });\n this.$emit('apply');\n this.isOpen = false;\n },\n\n cancelSelection () {\n if (this.controlledAtBirth) { this.closeControlled(); return; }\n this.isOpen = false;\n },\n },\n};\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAsdA,IAAK,IAAU;CACb,MAAM;CAEN,YAAY;EACV,iBAAA;EACA,YAAA;EACA,WAAA;EACA,UAAA;EACA;EACA;EACA;EACA,YAAA;EACA,YAAA;EACA,SAAA;EACA,QAAA;EACD;CAED,QAAQ,CAAC,EAAoB;CAE7B,OAAO;EAKL,SAAS;GACP,MAAiF;GACjF,SAAS,KAAA;GACV;EAGD,UAAU;GACR,MAAgF,CAAC,QAAQ,MAAM;GAC/F,SAAS,KAAA;GACV;EAKD,cAA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EACN,OAAO,EAAA;EACR,WAAQ;EACR,YAAW;EACV,SAAO,EAAA;;EAEG,MAAI,QAC0B,CAAvC,EAAuC,GAAA,EAAvB,MAAM,EAAA,eAAa,EAAA,MAAA,GAAA,CAAA,OAAA,CAAA,CAAA,CAAA;;;;;;;;;;;WAhBvB,EAAA,eAAc,CAAA,CAAA,GAAA,EAAA,IAAA,GAAA,CAAA,EAAA,GAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./list-item-constants.cjs`),t=require(`./list-item.cjs`);exports.DtListItem=t.default,exports.LIST_ITEM_NAVIGATION_TYPES=e.LIST_ITEM_NAVIGATION_TYPES,exports.LIST_ITEM_TYPES=e.LIST_ITEM_TYPES;
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./list-item-constants.cjs`),t=require(`./list-item.cjs`);exports.DtListItem=t.default,exports.LIST_ITEM_NAVIGATION_TYPES=e.LIST_ITEM_NAVIGATION_TYPES,exports.LIST_ITEM_ROLES=e.LIST_ITEM_ROLES,exports.LIST_ITEM_TYPES=e.LIST_ITEM_TYPES;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { LIST_ITEM_NAVIGATION_TYPES as e,
|
|
2
|
-
import
|
|
3
|
-
export {
|
|
1
|
+
import { LIST_ITEM_NAVIGATION_TYPES as e, LIST_ITEM_ROLES as t, LIST_ITEM_TYPES as n } from "./list-item-constants.js";
|
|
2
|
+
import r from "./list-item.js";
|
|
3
|
+
export { r as DtListItem, e as LIST_ITEM_NAVIGATION_TYPES, t as LIST_ITEM_ROLES, n as LIST_ITEM_TYPES };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});var e={DEFAULT:`default`,CUSTOM:`custom`},
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});var e=[`listitem`,`menuitem`,`option`,`menuitemradio`],t={DEFAULT:`default`,CUSTOM:`custom`},n={ARROW_KEYS:`arrow-keys`,TAB:`tab`,NONE:`none`},r={LIST_ITEM_ROLES:e,LIST_ITEM_TYPES:t,LIST_ITEM_NAVIGATION_TYPES:n};exports.LIST_ITEM_NAVIGATION_TYPES=n,exports.LIST_ITEM_ROLES=e,exports.LIST_ITEM_TYPES=t,exports.default=r;
|
|
2
2
|
//# sourceMappingURL=list-item-constants.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list-item-constants.cjs","names":[],"sources":["../../../components/ListItem/ListItemConstants.js"],"sourcesContent":["export const LIST_ITEM_TYPES = {\n DEFAULT: 'default',\n CUSTOM: 'custom',\n};\n\nexport const LIST_ITEM_NAVIGATION_TYPES = {\n ARROW_KEYS: 'arrow-keys',\n TAB: 'tab',\n NONE: 'none',\n};\n\nexport default {\n LIST_ITEM_TYPES,\n LIST_ITEM_NAVIGATION_TYPES,\n};\n"],"mappings":"+FAAA,IAAa,EAAkB,CAC7B,QAAS,UACT,OAAQ,SACT,CAEY,EAA6B,CACxC,WAAY,aACZ,IAAK,MACL,KAAM,OACP,CAED,EAAe,CACb,kBACA,6BACD"}
|
|
1
|
+
{"version":3,"file":"list-item-constants.cjs","names":[],"sources":["../../../components/ListItem/ListItemConstants.js"],"sourcesContent":["export const LIST_ITEM_ROLES = ['listitem', 'menuitem', 'option', 'menuitemradio'];\n\nexport const LIST_ITEM_TYPES = {\n DEFAULT: 'default',\n CUSTOM: 'custom',\n};\n\nexport const LIST_ITEM_NAVIGATION_TYPES = {\n ARROW_KEYS: 'arrow-keys',\n TAB: 'tab',\n NONE: 'none',\n};\n\nexport default {\n LIST_ITEM_ROLES,\n LIST_ITEM_TYPES,\n LIST_ITEM_NAVIGATION_TYPES,\n};\n"],"mappings":"+FAAA,IAAa,EAAkB,CAAC,WAAY,WAAY,SAAU,gBAAgB,CAErE,EAAkB,CAC7B,QAAS,UACT,OAAQ,SACT,CAEY,EAA6B,CACxC,WAAY,aACZ,IAAK,MACL,KAAM,OACP,CAED,EAAe,CACb,kBACA,kBACA,6BACD"}
|
|
@@ -1,16 +1,22 @@
|
|
|
1
1
|
//#region components/ListItem/ListItemConstants.js
|
|
2
|
-
var e =
|
|
2
|
+
var e = [
|
|
3
|
+
"listitem",
|
|
4
|
+
"menuitem",
|
|
5
|
+
"option",
|
|
6
|
+
"menuitemradio"
|
|
7
|
+
], t = {
|
|
3
8
|
DEFAULT: "default",
|
|
4
9
|
CUSTOM: "custom"
|
|
5
|
-
},
|
|
10
|
+
}, n = {
|
|
6
11
|
ARROW_KEYS: "arrow-keys",
|
|
7
12
|
TAB: "tab",
|
|
8
13
|
NONE: "none"
|
|
9
|
-
},
|
|
10
|
-
|
|
11
|
-
|
|
14
|
+
}, r = {
|
|
15
|
+
LIST_ITEM_ROLES: e,
|
|
16
|
+
LIST_ITEM_TYPES: t,
|
|
17
|
+
LIST_ITEM_NAVIGATION_TYPES: n
|
|
12
18
|
};
|
|
13
19
|
//#endregion
|
|
14
|
-
export {
|
|
20
|
+
export { n as LIST_ITEM_NAVIGATION_TYPES, e as LIST_ITEM_ROLES, t as LIST_ITEM_TYPES, r as default };
|
|
15
21
|
|
|
16
22
|
//# sourceMappingURL=list-item-constants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list-item-constants.js","names":[],"sources":["../../../components/ListItem/ListItemConstants.js"],"sourcesContent":["export const LIST_ITEM_TYPES = {\n DEFAULT: 'default',\n CUSTOM: 'custom',\n};\n\nexport const LIST_ITEM_NAVIGATION_TYPES = {\n ARROW_KEYS: 'arrow-keys',\n TAB: 'tab',\n NONE: 'none',\n};\n\nexport default {\n LIST_ITEM_TYPES,\n LIST_ITEM_NAVIGATION_TYPES,\n};\n"],"mappings":";AAAA,IAAa,IAAkB;CAC7B,SAAS;CACT,QAAQ;CACT,EAEY,IAA6B;CACxC,YAAY;CACZ,KAAK;CACL,MAAM;CACP,EAED,IAAe;CACb;CACA;CACD"}
|
|
1
|
+
{"version":3,"file":"list-item-constants.js","names":[],"sources":["../../../components/ListItem/ListItemConstants.js"],"sourcesContent":["export const LIST_ITEM_ROLES = ['listitem', 'menuitem', 'option', 'menuitemradio'];\n\nexport const LIST_ITEM_TYPES = {\n DEFAULT: 'default',\n CUSTOM: 'custom',\n};\n\nexport const LIST_ITEM_NAVIGATION_TYPES = {\n ARROW_KEYS: 'arrow-keys',\n TAB: 'tab',\n NONE: 'none',\n};\n\nexport default {\n LIST_ITEM_ROLES,\n LIST_ITEM_TYPES,\n LIST_ITEM_NAVIGATION_TYPES,\n};\n"],"mappings":";AAAA,IAAa,IAAkB;CAAC;CAAY;CAAY;CAAU;CAAgB,EAErE,IAAkB;CAC7B,SAAS;CACT,QAAQ;CACT,EAEY,IAA6B;CACxC,YAAY;CACZ,KAAK;CACL,MAAM;CACP,EAED,IAAe;CACb;CACA;CACA;CACD"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}}),require(`../../chunk-Bmb41Sf3.cjs`);const e=require(`../../common/utils/index.cjs`),t=require(`../../_plugin-vue_export-helper-D8jCH6HB.cjs`),n=require(`./list-item-constants.cjs`),r=require(`../item-layout/item-layout.cjs`);let i=require(`vue`),a=require(`@dialpad/dialtone-icons/vue`);var o=
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}}),require(`../../chunk-Bmb41Sf3.cjs`);const e=require(`../../common/utils/index.cjs`),t=require(`../../_plugin-vue_export-helper-D8jCH6HB.cjs`),n=require(`./list-item-constants.cjs`),r=require(`../item-layout/item-layout.cjs`);let i=require(`vue`),a=require(`@dialpad/dialtone-icons/vue`);var o={name:`DtListItem`,components:{DtItemLayout:r.default,DtIconCheck:a.DtIconCheck},inject:{highlightId:{default:null}},props:{id:{type:String,default(){return e.default.getUniqueString()}},role:{type:String,default:`listitem`,validator:e=>n.LIST_ITEM_ROLES.includes(e)},elementType:{type:String,default:`li`},type:{type:String,default:n.LIST_ITEM_TYPES.DEFAULT,validator:e=>Object.values(n.LIST_ITEM_TYPES).includes(e)},navigationType:{type:String,default:n.LIST_ITEM_NAVIGATION_TYPES.NONE,validator:e=>Object.values(n.LIST_ITEM_NAVIGATION_TYPES).includes(e)},selected:{type:Boolean,default:!1},wrapperClass:{type:[String,Object,Array],default:``}},emits:[`click`,`keydown`,`mousemove`,`mouseleave`],data(){return{injected:!1,mouseHighlighted:!1}},computed:{isMenuItemRadio(){return this.role===`menuitemradio`},ariaSelected(){return this.role===`listitem`||this.isMenuItemRadio?void 0:this.isHighlighted},isDefaultType(){return this.type===n.LIST_ITEM_TYPES.DEFAULT},listItemListeners(){return{click:e=>{this.onClick(e)},keydown:e=>{[`enter`,`space`].includes(e.code.toLowerCase())&&(this.isMenuItemRadio&&e.preventDefault(),this.onClick(e)),this.$emit(`keydown`,e)},mousemove:e=>{this.onMouseHover(e),this.$emit(`mousemove`,e)},mouseleave:e=>{this.onMouseLeave(e),this.$emit(`mouseleave`,e)}}},isHighlighted(){return this.isHoverable?this.highlightId&&this.highlightId()?this.id===this.highlightId():this.mouseHighlighted:!1},isFocusable(){return this.navigationType===n.LIST_ITEM_NAVIGATION_TYPES.TAB},isHoverable(){return this.navigationType!==n.LIST_ITEM_NAVIGATION_TYPES.NONE}},methods:{onClick(e){this.$emit(`click`,e)},onMouseHover(){this.mouseHighlighted=!0},onMouseLeave(){this.mouseHighlighted=!1}}};function s(e,t,n,r,a,o){let s=(0,i.resolveComponent)(`dt-icon-check`),c=(0,i.resolveComponent)(`dt-item-layout`);return(0,i.openBlock)(),(0,i.createBlock)((0,i.resolveDynamicComponent)(n.elementType),(0,i.mergeProps)({id:n.id,class:[`d-list-item`,{"d-list-item--focusable":o.isFocusable,"d-list-item--highlighted":o.isHighlighted,"d-list-item--static":!o.isHoverable}],tabindex:o.isFocusable?0:-1,role:n.role,"aria-selected":o.ariaSelected,"aria-checked":o.isMenuItemRadio?n.selected:void 0},(0,i.toHandlers)(o.listItemListeners)),{default:(0,i.withCtx)(()=>[o.isDefaultType?((0,i.openBlock)(),(0,i.createBlock)(c,{key:0,unstyled:``,class:(0,i.normalizeClass)([`d-list-item__wrapper`,n.wrapperClass]),"start-class":`d-list-item__left`,"content-class":`d-list-item__content`,"title-class":`d-list-item__title`,"subtitle-class":`d-list-item__subtitle`,"block-end-class":`d-list-item__bottom`,"end-class":`d-list-item__right`,"selected-class":`d-list-item__selected`,"data-qa":`dt-list-item-wrapper`},(0,i.createSlots)({_:2},[(0,i.renderList)(e.$slots,(t,n)=>({name:n,fn:(0,i.withCtx)(()=>[(0,i.renderSlot)(e.$slots,n)])})),n.selected?{name:`selected`,fn:(0,i.withCtx)(()=>[(0,i.createVNode)(s,{size:`200`})]),key:`0`}:void 0]),1032,[`class`])):(0,i.renderSlot)(e.$slots,`default`,{key:1})]),_:3},16,[`id`,`class`,`tabindex`,`role`,`aria-selected`,`aria-checked`])}var c=t.t(o,[[`render`,s]]);exports.default=c;
|
|
2
2
|
//# sourceMappingURL=list-item.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list-item.cjs","names":[],"sources":["../../../components/ListItem/ListItem.vue"],"sourcesContent":["<template>\n <component\n :is=\"elementType\"\n :id=\"id\"\n :class=\"[\n 'd-list-item',\n {\n 'd-list-item--focusable': isFocusable,\n 'd-list-item--highlighted': isHighlighted,\n 'd-list-item--static': !isHoverable,\n }]\"\n :tabindex=\"isFocusable ? 0 : -1\"\n :role=\"role\"\n :aria-selected=\"
|
|
1
|
+
{"version":3,"file":"list-item.cjs","names":[],"sources":["../../../components/ListItem/ListItem.vue"],"sourcesContent":["<template>\n <component\n :is=\"elementType\"\n :id=\"id\"\n :class=\"[\n 'd-list-item',\n {\n 'd-list-item--focusable': isFocusable,\n 'd-list-item--highlighted': isHighlighted,\n 'd-list-item--static': !isHoverable,\n }]\"\n :tabindex=\"isFocusable ? 0 : -1\"\n :role=\"role\"\n :aria-selected=\"ariaSelected\"\n :aria-checked=\"isMenuItemRadio ? selected : undefined\"\n v-on=\"listItemListeners\"\n >\n <dt-item-layout\n v-if=\"isDefaultType\"\n unstyled\n :class=\"['d-list-item__wrapper', wrapperClass]\"\n start-class=\"d-list-item__left\"\n content-class=\"d-list-item__content\"\n title-class=\"d-list-item__title\"\n subtitle-class=\"d-list-item__subtitle\"\n block-end-class=\"d-list-item__bottom\"\n end-class=\"d-list-item__right\"\n selected-class=\"d-list-item__selected\"\n data-qa=\"dt-list-item-wrapper\"\n >\n <template\n v-for=\"(_, slotName) in $slots\"\n #[slotName]\n >\n <!-- @slot named slots for custom list items -->\n <slot :name=\"slotName\" />\n </template>\n <template\n v-if=\"selected\"\n #selected\n >\n <dt-icon-check size=\"200\" />\n </template>\n </dt-item-layout>\n <!-- @slot slot for the main content -->\n <slot v-else />\n </component>\n</template>\n\n<script>\nimport {\n LIST_ITEM_ROLES,\n LIST_ITEM_TYPES,\n LIST_ITEM_NAVIGATION_TYPES,\n} from './ListItemConstants';\nimport utils from '@/common/utils';\nimport { DtIconCheck } from '@dialpad/dialtone-icons/vue';\nimport { DtItemLayout } from '@/components/ItemLayout';\n\n/**\n * A list item is an element that can be used to represent individual items in a list.\n * @see https://dialtone.dialpad.com/components/list_item.html\n */\nexport default {\n name: 'DtListItem',\n\n components: {\n DtItemLayout,\n DtIconCheck,\n },\n\n /**\n * Value provided from keyboard_list_navigation.js using id prop.\n */\n inject: {\n highlightId: { default: null },\n },\n\n props: {\n /**\n * Id for the item.\n */\n id: {\n type: String,\n default () { return utils.getUniqueString(); },\n },\n\n /**\n * Contextual role: listitem for ordinary lists, menuitem for menu actions,\n * menuitemradio for persistent mutually exclusive menu choices, option for listboxes.\n * selected never changes the role automatically.\n * @values listitem, menuitem, option, menuitemradio\n */\n role: {\n type: String,\n default: 'listitem',\n validator: (role) => LIST_ITEM_ROLES.includes(role),\n },\n\n /**\n * HTML element type (tag name) of the content wrapper element.\n */\n elementType: {\n type: String,\n default: 'li',\n },\n\n /**\n * The type of child list item to use.\n * @values default, custom\n */\n type: {\n type: String,\n default: LIST_ITEM_TYPES.DEFAULT,\n validator: (t) => Object.values(LIST_ITEM_TYPES).includes(t),\n },\n\n /**\n * The type of navigation that this component should support.\n * - \"arrow-keys\" for items that are navigated with UP/DOWN keys.\n * - \"tab\" for items that are navigated using the TAB key.\n * - \"none\" for static items that are not interactive.\n * @values arrow-keys, tab, none\n */\n navigationType: {\n type: String,\n default: LIST_ITEM_NAVIGATION_TYPES.NONE,\n validator: (t) => Object.values(LIST_ITEM_NAVIGATION_TYPES).includes(t),\n },\n\n /**\n * Shows a selected checkmark. For menuitemradio, also sets aria-checked independently of highlight.\n */\n selected: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Additional Classes to apply to the wrapper element,\n * note: it only applies on \"default\" type\n * Can accept all of: String, Object, and Array, i.e. has the\n * same api as Vue's built-in handling of the class attribute.\n */\n wrapperClass: {\n type: [String, Object, Array],\n default: '',\n },\n },\n\n emits: [\n /**\n * Native click event\n *\n * @event click\n * @type {PointerEvent | KeyboardEvent}\n */\n 'click',\n\n /**\n * Key down event\n *\n * @event keydown\n * @type {KeyboardEvent}\n */\n 'keydown',\n\n /**\n * Native mouse move event\n *\n * @event mousemove\n * @type {MouseEvent}\n */\n 'mousemove',\n\n /**\n * Native mouse leave event\n *\n * @event mouseleave\n * @type {MouseEvent}\n */\n 'mouseleave',\n ],\n\n data () {\n return {\n injected: false,\n mouseHighlighted: false,\n };\n },\n\n computed: {\n isMenuItemRadio () {\n return this.role === 'menuitemradio';\n },\n\n ariaSelected () {\n return this.role === 'listitem' || this.isMenuItemRadio ? undefined : this.isHighlighted;\n },\n\n isDefaultType () {\n return this.type === LIST_ITEM_TYPES.DEFAULT;\n },\n\n listItemListeners () {\n return {\n click: event => {\n this.onClick(event);\n },\n\n keydown: event => {\n if (['enter', 'space'].includes(event.code.toLowerCase())) {\n if (this.isMenuItemRadio) event.preventDefault();\n this.onClick(event);\n }\n this.$emit('keydown', event);\n },\n\n mousemove: event => {\n this.onMouseHover(event);\n this.$emit('mousemove', event);\n },\n\n mouseleave: event => {\n this.onMouseLeave(event);\n this.$emit('mouseleave', event);\n },\n };\n },\n\n /**\n * For keyboard navigation, whether this item is currently highlighted.\n * An injected highlightId will override the default mouseover highlight.\n */\n isHighlighted () {\n if (this.isHoverable) {\n return this.highlightId && this.highlightId() ? this.id === this.highlightId() : this.mouseHighlighted;\n }\n return false;\n },\n\n isFocusable () {\n // Navigation type has to be set to \"tab\".\n return this.navigationType === LIST_ITEM_NAVIGATION_TYPES.TAB;\n },\n\n /**\n * Whether to apply hover styles.\n */\n isHoverable () {\n return this.navigationType !== LIST_ITEM_NAVIGATION_TYPES.NONE;\n },\n },\n\n methods: {\n onClick (e) {\n // disabled as we do not want to override native click\n this.$emit('click', e);\n },\n\n onMouseHover () {\n this.mouseHighlighted = true;\n },\n\n onMouseLeave () {\n this.mouseHighlighted = false;\n },\n },\n};\n</script>\n"],"mappings":"8XA+DA,IAAK,EAAU,CACb,KAAM,aAEN,WAAY,CACV,aAAA,EAAA,QACA,YAAA,EAAA,YACD,CAKD,OAAQ,CACN,YAAa,CAAE,QAAS,KAAM,CAC/B,CAED,MAAO,CAIL,GAAI,CACF,KAAM,OACN,SAAW,CAAE,OAAO,EAAA,QAAM,iBAAiB,EAC5C,CAQD,KAAM,CACJ,KAAM,OACN,QAAS,WACT,UAAY,GAAS,EAAA,gBAAgB,SAAS,EAAK,CACpD,CAKD,YAAa,CACX,KAAM,OACN,QAAS,KACV,CAMD,KAAM,CACJ,KAAM,OACN,QAAS,EAAA,gBAAgB,QACzB,UAAY,GAAM,OAAO,OAAO,EAAA,gBAAgB,CAAC,SAAS,EAAE,CAC7D,CASD,eAAgB,CACd,KAAM,OACN,QAAS,EAAA,2BAA2B,KACpC,UAAY,GAAM,OAAO,OAAO,EAAA,2BAA2B,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MAAK,CAAA,cAAA,0BAAmE,EAAA,uCAAiD,EAAA,qCAA+C,EAAA,cAOxK,SAAU,EAAA,YAAW,EAAA,GACrB,KAAM,EAAA,KACN,gBAAe,EAAA,aACf,eAAc,EAAA,gBAAkB,EAAA,SAAW,IAAA,qBACpB,EAAlB,kBAAiB,CAAA,CAAA,2BA4BN,CAzBT,EAAA,gBAAA,EAAA,EAAA,YAAA,EAAA,EAAA,EAAA,aAyBS,EAAA,OAxBf,SAAA,GACC,OAAA,EAAA,EAAA,gBAAK,CAAA,uBAA2B,EAAA,aAAY,CAAA,CAC7C,cAAY,oBACZ,gBAAc,uBACd,cAAY,qBACZ,iBAAe,wBACf,kBAAgB,sBAChB,YAAU,qBACV,iBAAe,wBACf,UAAQ,kEAGkB,EAAA,QAAhB,EAAG,WACV,uBAGwB,EAAA,EAAA,EAAA,YAAA,EAAA,OAAZ,EAAQ,CAAA,CAAA,IAGf,EAAA,SAAA,MACL,gCAE2B,EAAA,EAAA,EAAA,aAAA,EAAA,CAAb,KAAK,MAAK,CAAA,CAAA,CAAA,qDAId,EAAA,OAAA,UAAA,CAAA,IAAA,EAAA,CAAA,CAAA,CAAA"}
|
|
@@ -1,19 +1,15 @@
|
|
|
1
1
|
import e from "../../common/utils/index.js";
|
|
2
2
|
import { t } from "../../_plugin-vue_export-helper-BTgDAbhb.js";
|
|
3
|
-
import { LIST_ITEM_NAVIGATION_TYPES as n,
|
|
4
|
-
import
|
|
5
|
-
import { createBlock as
|
|
6
|
-
import { DtIconCheck as
|
|
3
|
+
import { LIST_ITEM_NAVIGATION_TYPES as n, LIST_ITEM_ROLES as r, LIST_ITEM_TYPES as i } from "./list-item-constants.js";
|
|
4
|
+
import a from "../item-layout/item-layout.js";
|
|
5
|
+
import { createBlock as o, createSlots as s, createVNode as c, mergeProps as l, normalizeClass as u, openBlock as d, renderList as f, renderSlot as p, resolveComponent as m, resolveDynamicComponent as h, toHandlers as g, withCtx as _ } from "vue";
|
|
6
|
+
import { DtIconCheck as v } from "@dialpad/dialtone-icons/vue";
|
|
7
7
|
//#region components/ListItem/ListItem.vue
|
|
8
|
-
var
|
|
9
|
-
"listitem",
|
|
10
|
-
"menuitem",
|
|
11
|
-
"option"
|
|
12
|
-
], y = {
|
|
8
|
+
var y = {
|
|
13
9
|
name: "DtListItem",
|
|
14
10
|
components: {
|
|
15
|
-
DtItemLayout:
|
|
16
|
-
DtIconCheck:
|
|
11
|
+
DtItemLayout: a,
|
|
12
|
+
DtIconCheck: v
|
|
17
13
|
},
|
|
18
14
|
inject: { highlightId: { default: null } },
|
|
19
15
|
props: {
|
|
@@ -26,7 +22,7 @@ var v = [
|
|
|
26
22
|
role: {
|
|
27
23
|
type: String,
|
|
28
24
|
default: "listitem",
|
|
29
|
-
validator: (e) =>
|
|
25
|
+
validator: (e) => r.includes(e)
|
|
30
26
|
},
|
|
31
27
|
elementType: {
|
|
32
28
|
type: String,
|
|
@@ -34,8 +30,8 @@ var v = [
|
|
|
34
30
|
},
|
|
35
31
|
type: {
|
|
36
32
|
type: String,
|
|
37
|
-
default:
|
|
38
|
-
validator: (e) => Object.values(
|
|
33
|
+
default: i.DEFAULT,
|
|
34
|
+
validator: (e) => Object.values(i).includes(e)
|
|
39
35
|
},
|
|
40
36
|
navigationType: {
|
|
41
37
|
type: String,
|
|
@@ -68,8 +64,14 @@ var v = [
|
|
|
68
64
|
};
|
|
69
65
|
},
|
|
70
66
|
computed: {
|
|
67
|
+
isMenuItemRadio() {
|
|
68
|
+
return this.role === "menuitemradio";
|
|
69
|
+
},
|
|
70
|
+
ariaSelected() {
|
|
71
|
+
return this.role === "listitem" || this.isMenuItemRadio ? void 0 : this.isHighlighted;
|
|
72
|
+
},
|
|
71
73
|
isDefaultType() {
|
|
72
|
-
return this.type ===
|
|
74
|
+
return this.type === i.DEFAULT;
|
|
73
75
|
},
|
|
74
76
|
listItemListeners() {
|
|
75
77
|
return {
|
|
@@ -77,7 +79,7 @@ var v = [
|
|
|
77
79
|
this.onClick(e);
|
|
78
80
|
},
|
|
79
81
|
keydown: (e) => {
|
|
80
|
-
["enter", "space"].includes(e.code.toLowerCase()) && this.onClick(e), this.$emit("keydown", e);
|
|
82
|
+
["enter", "space"].includes(e.code.toLowerCase()) && (this.isMenuItemRadio && e.preventDefault(), this.onClick(e)), this.$emit("keydown", e);
|
|
81
83
|
},
|
|
82
84
|
mousemove: (e) => {
|
|
83
85
|
this.onMouseHover(e), this.$emit("mousemove", e);
|
|
@@ -109,23 +111,24 @@ var v = [
|
|
|
109
111
|
}
|
|
110
112
|
}
|
|
111
113
|
};
|
|
112
|
-
function b(e, t, n, r, i,
|
|
113
|
-
let v =
|
|
114
|
-
return
|
|
114
|
+
function b(e, t, n, r, i, a) {
|
|
115
|
+
let v = m("dt-icon-check"), y = m("dt-item-layout");
|
|
116
|
+
return d(), o(h(n.elementType), l({
|
|
115
117
|
id: n.id,
|
|
116
118
|
class: ["d-list-item", {
|
|
117
|
-
"d-list-item--focusable":
|
|
118
|
-
"d-list-item--highlighted":
|
|
119
|
-
"d-list-item--static": !
|
|
119
|
+
"d-list-item--focusable": a.isFocusable,
|
|
120
|
+
"d-list-item--highlighted": a.isHighlighted,
|
|
121
|
+
"d-list-item--static": !a.isHoverable
|
|
120
122
|
}],
|
|
121
|
-
tabindex:
|
|
123
|
+
tabindex: a.isFocusable ? 0 : -1,
|
|
122
124
|
role: n.role,
|
|
123
|
-
"aria-selected":
|
|
124
|
-
|
|
125
|
-
|
|
125
|
+
"aria-selected": a.ariaSelected,
|
|
126
|
+
"aria-checked": a.isMenuItemRadio ? n.selected : void 0
|
|
127
|
+
}, g(a.listItemListeners)), {
|
|
128
|
+
default: _(() => [a.isDefaultType ? (d(), o(y, {
|
|
126
129
|
key: 0,
|
|
127
130
|
unstyled: "",
|
|
128
|
-
class:
|
|
131
|
+
class: u(["d-list-item__wrapper", n.wrapperClass]),
|
|
129
132
|
"start-class": "d-list-item__left",
|
|
130
133
|
"content-class": "d-list-item__content",
|
|
131
134
|
"title-class": "d-list-item__title",
|
|
@@ -134,21 +137,22 @@ function b(e, t, n, r, i, _) {
|
|
|
134
137
|
"end-class": "d-list-item__right",
|
|
135
138
|
"selected-class": "d-list-item__selected",
|
|
136
139
|
"data-qa": "dt-list-item-wrapper"
|
|
137
|
-
},
|
|
140
|
+
}, s({ _: 2 }, [f(e.$slots, (t, n) => ({
|
|
138
141
|
name: n,
|
|
139
|
-
fn:
|
|
142
|
+
fn: _(() => [p(e.$slots, n)])
|
|
140
143
|
})), n.selected ? {
|
|
141
144
|
name: "selected",
|
|
142
|
-
fn:
|
|
145
|
+
fn: _(() => [c(v, { size: "200" })]),
|
|
143
146
|
key: "0"
|
|
144
|
-
} : void 0]), 1032, ["class"])) :
|
|
147
|
+
} : void 0]), 1032, ["class"])) : p(e.$slots, "default", { key: 1 })]),
|
|
145
148
|
_: 3
|
|
146
149
|
}, 16, [
|
|
147
150
|
"id",
|
|
148
151
|
"class",
|
|
149
152
|
"tabindex",
|
|
150
153
|
"role",
|
|
151
|
-
"aria-selected"
|
|
154
|
+
"aria-selected",
|
|
155
|
+
"aria-checked"
|
|
152
156
|
]);
|
|
153
157
|
}
|
|
154
158
|
var x = /* @__PURE__ */ t(y, [["render", b]]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list-item.js","names":[],"sources":["../../../components/ListItem/ListItem.vue"],"sourcesContent":["<template>\n <component\n :is=\"elementType\"\n :id=\"id\"\n :class=\"[\n 'd-list-item',\n {\n 'd-list-item--focusable': isFocusable,\n 'd-list-item--highlighted': isHighlighted,\n 'd-list-item--static': !isHoverable,\n }]\"\n :tabindex=\"isFocusable ? 0 : -1\"\n :role=\"role\"\n :aria-selected=\"
|
|
1
|
+
{"version":3,"file":"list-item.js","names":[],"sources":["../../../components/ListItem/ListItem.vue"],"sourcesContent":["<template>\n <component\n :is=\"elementType\"\n :id=\"id\"\n :class=\"[\n 'd-list-item',\n {\n 'd-list-item--focusable': isFocusable,\n 'd-list-item--highlighted': isHighlighted,\n 'd-list-item--static': !isHoverable,\n }]\"\n :tabindex=\"isFocusable ? 0 : -1\"\n :role=\"role\"\n :aria-selected=\"ariaSelected\"\n :aria-checked=\"isMenuItemRadio ? selected : undefined\"\n v-on=\"listItemListeners\"\n >\n <dt-item-layout\n v-if=\"isDefaultType\"\n unstyled\n :class=\"['d-list-item__wrapper', wrapperClass]\"\n start-class=\"d-list-item__left\"\n content-class=\"d-list-item__content\"\n title-class=\"d-list-item__title\"\n subtitle-class=\"d-list-item__subtitle\"\n block-end-class=\"d-list-item__bottom\"\n end-class=\"d-list-item__right\"\n selected-class=\"d-list-item__selected\"\n data-qa=\"dt-list-item-wrapper\"\n >\n <template\n v-for=\"(_, slotName) in $slots\"\n #[slotName]\n >\n <!-- @slot named slots for custom list items -->\n <slot :name=\"slotName\" />\n </template>\n <template\n v-if=\"selected\"\n #selected\n >\n <dt-icon-check size=\"200\" />\n </template>\n </dt-item-layout>\n <!-- @slot slot for the main content -->\n <slot v-else />\n </component>\n</template>\n\n<script>\nimport {\n LIST_ITEM_ROLES,\n LIST_ITEM_TYPES,\n LIST_ITEM_NAVIGATION_TYPES,\n} from './ListItemConstants';\nimport utils from '@/common/utils';\nimport { DtIconCheck } from '@dialpad/dialtone-icons/vue';\nimport { DtItemLayout } from '@/components/ItemLayout';\n\n/**\n * A list item is an element that can be used to represent individual items in a list.\n * @see https://dialtone.dialpad.com/components/list_item.html\n */\nexport default {\n name: 'DtListItem',\n\n components: {\n DtItemLayout,\n DtIconCheck,\n },\n\n /**\n * Value provided from keyboard_list_navigation.js using id prop.\n */\n inject: {\n highlightId: { default: null },\n },\n\n props: {\n /**\n * Id for the item.\n */\n id: {\n type: String,\n default () { return utils.getUniqueString(); },\n },\n\n /**\n * Contextual role: listitem for ordinary lists, menuitem for menu actions,\n * menuitemradio for persistent mutually exclusive menu choices, option for listboxes.\n * selected never changes the role automatically.\n * @values listitem, menuitem, option, menuitemradio\n */\n role: {\n type: String,\n default: 'listitem',\n validator: (role) => LIST_ITEM_ROLES.includes(role),\n },\n\n /**\n * HTML element type (tag name) of the content wrapper element.\n */\n elementType: {\n type: String,\n default: 'li',\n },\n\n /**\n * The type of child list item to use.\n * @values default, custom\n */\n type: {\n type: String,\n default: LIST_ITEM_TYPES.DEFAULT,\n validator: (t) => Object.values(LIST_ITEM_TYPES).includes(t),\n },\n\n /**\n * The type of navigation that this component should support.\n * - \"arrow-keys\" for items that are navigated with UP/DOWN keys.\n * - \"tab\" for items that are navigated using the TAB key.\n * - \"none\" for static items that are not interactive.\n * @values arrow-keys, tab, none\n */\n navigationType: {\n type: String,\n default: LIST_ITEM_NAVIGATION_TYPES.NONE,\n validator: (t) => Object.values(LIST_ITEM_NAVIGATION_TYPES).includes(t),\n },\n\n /**\n * Shows a selected checkmark. For menuitemradio, also sets aria-checked independently of highlight.\n */\n selected: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Additional Classes to apply to the wrapper element,\n * note: it only applies on \"default\" type\n * Can accept all of: String, Object, and Array, i.e. has the\n * same api as Vue's built-in handling of the class attribute.\n */\n wrapperClass: {\n type: [String, Object, Array],\n default: '',\n },\n },\n\n emits: [\n /**\n * Native click event\n *\n * @event click\n * @type {PointerEvent | KeyboardEvent}\n */\n 'click',\n\n /**\n * Key down event\n *\n * @event keydown\n * @type {KeyboardEvent}\n */\n 'keydown',\n\n /**\n * Native mouse move event\n *\n * @event mousemove\n * @type {MouseEvent}\n */\n 'mousemove',\n\n /**\n * Native mouse leave event\n *\n * @event mouseleave\n * @type {MouseEvent}\n */\n 'mouseleave',\n ],\n\n data () {\n return {\n injected: false,\n mouseHighlighted: false,\n };\n },\n\n computed: {\n isMenuItemRadio () {\n return this.role === 'menuitemradio';\n },\n\n ariaSelected () {\n return this.role === 'listitem' || this.isMenuItemRadio ? undefined : this.isHighlighted;\n },\n\n isDefaultType () {\n return this.type === LIST_ITEM_TYPES.DEFAULT;\n },\n\n listItemListeners () {\n return {\n click: event => {\n this.onClick(event);\n },\n\n keydown: event => {\n if (['enter', 'space'].includes(event.code.toLowerCase())) {\n if (this.isMenuItemRadio) event.preventDefault();\n this.onClick(event);\n }\n this.$emit('keydown', event);\n },\n\n mousemove: event => {\n this.onMouseHover(event);\n this.$emit('mousemove', event);\n },\n\n mouseleave: event => {\n this.onMouseLeave(event);\n this.$emit('mouseleave', event);\n },\n };\n },\n\n /**\n * For keyboard navigation, whether this item is currently highlighted.\n * An injected highlightId will override the default mouseover highlight.\n */\n isHighlighted () {\n if (this.isHoverable) {\n return this.highlightId && this.highlightId() ? this.id === this.highlightId() : this.mouseHighlighted;\n }\n return false;\n },\n\n isFocusable () {\n // Navigation type has to be set to \"tab\".\n return this.navigationType === LIST_ITEM_NAVIGATION_TYPES.TAB;\n },\n\n /**\n * Whether to apply hover styles.\n */\n isHoverable () {\n return this.navigationType !== LIST_ITEM_NAVIGATION_TYPES.NONE;\n },\n },\n\n methods: {\n onClick (e) {\n // disabled as we do not want to override native click\n this.$emit('click', e);\n },\n\n onMouseHover () {\n this.mouseHighlighted = true;\n },\n\n onMouseLeave () {\n this.mouseHighlighted = false;\n },\n },\n};\n</script>\n"],"mappings":";;;;;;;AA+DA,IAAK,IAAU;CACb,MAAM;CAEN,YAAY;EACV,cAAA;EACA;EACD;CAKD,QAAQ,EACN,aAAa,EAAE,SAAS,MAAM,EAC/B;CAED,OAAO;EAIL,IAAI;GACF,MAAM;GACN,UAAW;AAAE,WAAO,EAAM,iBAAiB;;GAC5C;EAQD,MAAM;GACJ,MAAM;GACN,SAAS;GACT,YAAY,MAAS,EAAgB,SAAS,EAAK;GACpD;EAKD,aAAa;GACX,MAAM;GACN,SAAS;GACV;EAMD,MAAM;GACJ,MAAM;GACN,SAAS,EAAgB;GACzB,YAAY,MAAM,OAAO,OAAO,EAAgB,CAAC,SAAS,EAAE;GAC7D;EASD,gBAAgB;GACd,MAAM;GACN,SAAS,EAA2B;GACpC,YAAY,MAAM,OAAO,OAAO,EAA2B,CAAC,SAAS,EAAE;GACxE;EAKD,UAAU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;6BAAmE,EAAA;+BAAiD,EAAA;2BAA+C,EAAA;;EAOxK,UAAU,EAAA,cAAW,IAAA;EACrB,MAAM,EAAA;EACN,iBAAe,EAAA;EACf,gBAAc,EAAA,kBAAkB,EAAA,WAAW,KAAA;IAC5C,EAAwB,EAAlB,kBAAiB,CAAA,EAAA;mBA4BN,CAzBT,EAAA,iBAAA,GAAA,EADR,EA0BiB,GAAA;;GAxBf,UAAA;GACC,OAAK,EAAA,CAAA,wBAA2B,EAAA,aAAY,CAAA;GAC7C,eAAY;GACZ,iBAAc;GACd,eAAY;GACZ,kBAAe;GACf,mBAAgB;GAChB,aAAU;GACV,kBAAe;GACf,WAAQ;oBAGkB,EAAA,SAAhB,GAAG;SACV;eAGwB,CAAzB,EAAyB,EAAA,QAAZ,EAAQ,CAAA,CAAA;OAGf,EAAA,WAAA;SACL;eAE2B,CAA5B,EAA4B,GAAA,EAAb,MAAK,OAAK,CAAA,CAAA,CAAA;;oCAI7B,EAAe,EAAA,QAAA,WAAA,EAAA,KAAA,GAAA,CAAA,CAAA,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}}),require(`../../chunk-Bmb41Sf3.cjs`);const e=require(`../../common/validators/index.cjs`),t=require(`../../_plugin-vue_export-helper-D8jCH6HB.cjs`),n=require(`../icon/icon-constants.cjs`),r=require(`./loader-constants.cjs`);let
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}}),require(`../../chunk-Bmb41Sf3.cjs`);const e=require(`../../common/validators/index.cjs`),t=require(`../../_plugin-vue_export-helper-D8jCH6HB.cjs`),n=require(`../icon/icon-constants.cjs`),r=require(`./loader-constants.cjs`),i=require(`../../localization/index.cjs`);let a=require(`vue`);var o={name:`DtLoader`,inheritAttrs:!1,props:{ariaLabel:{type:String,default:``},kind:{type:String,default:`dots`,validator:e=>Object.keys(r.LOADER_KIND_MODIFIERS).includes(e)},size:{type:[String,Number],default:500,validator:e.ordinalSizeValidator(n.ICON_SIZE_MODIFIERS)}},data(){return{i18n:new i.DialtoneLocalization}},computed:{accessibleLabel(){if(![`none`,`presentation`].includes(this.$attrs.role))return this.ariaLabel||this.i18n.$t(`DIALTONE_LOADING`)},isSpinner(){return this.kind===`spinner`},loaderKindClass(){return this.isSpinner?r.LOADER_KIND_MODIFIERS.spinner:r.LOADER_KIND_MODIFIERS.dots}}},s=[`aria-label`,`role`];function c(e,t,n,r,i,o){return(0,a.openBlock)(),(0,a.createElementBlock)(`div`,(0,a.mergeProps)({class:[`d-loader`,o.loaderKindClass],"aria-label":o.accessibleLabel,"data-qa":`dt-loader`},e.$attrs,{role:e.$attrs.role??`img`}),[o.isSpinner?((0,a.openBlock)(),(0,a.createElementBlock)(a.Fragment,{key:0},[((0,a.openBlock)(),(0,a.createElementBlock)(`svg`,{class:(0,a.normalizeClass)([`d-icon`,`d-icon--size-${n.size}`,`d-loader__icon-track`]),"data-qa":`dt-loader-icon-track`,viewBox:`0 0 24 24`,fill:`currentColor`,xmlns:`http://www.w3.org/2000/svg`,"aria-hidden":`true`},[...t[0]||(t[0]=[(0,a.createElementVNode)(`path`,{d:`
|
|
2
2
|
M12 0.0180664C18.6175 0.0180664 23.9819 5.38305 23.9819
|
|
3
3
|
12.0005C23.9819 18.6177 18.6175 23.9819 12 23.9819C5.38281
|
|
4
4
|
23.9819 0.0180664 18.6177 0.0180664 12.0005C0.0180664
|
|
@@ -6,7 +6,7 @@ Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{val
|
|
|
6
6
|
3.26807 3.26807 7.17797 3.26807 12.0005C3.26807 16.8228
|
|
7
7
|
7.17773 20.7319 12 20.7319C16.8223 20.7319 20.7319 16.8228
|
|
8
8
|
20.7319 12.0005C20.7319 7.17797 16.8223 3.26807 12 3.26807Z
|
|
9
|
-
`},null,-1)])],2)),((0,
|
|
9
|
+
`},null,-1)])],2)),((0,a.openBlock)(),(0,a.createElementBlock)(`svg`,{class:(0,a.normalizeClass)([`d-icon`,`d-icon--size-${n.size}`,`d-loader__icon`]),"data-qa":`dt-loader-icon`,viewBox:`0 0 24 24`,fill:`currentColor`,xmlns:`http://www.w3.org/2000/svg`,"aria-hidden":`true`},[...t[1]||(t[1]=[(0,a.createElementVNode)(`path`,{d:`
|
|
10
10
|
M0.0180664 12.0005
|
|
11
11
|
C0.0180664 5.38305 5.38305 0.0180664 12.0005 0.0180664
|
|
12
12
|
C12.8977 0.0183302 13.6255 0.745766 13.6255 1.64307
|
|
@@ -18,5 +18,5 @@ Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{val
|
|
|
18
18
|
C23.2544 10.3755 23.9819 11.103 23.9819 12.0005
|
|
19
19
|
C23.9817 18.6175 18.6175 23.9817 12.0005 23.9819
|
|
20
20
|
C5.38321 23.9819 0.0183303 18.6177 0.0180664 12.0005Z
|
|
21
|
-
`},null,-1)])],2))],64)):((0,
|
|
21
|
+
`},null,-1)])],2))],64)):((0,a.openBlock)(),(0,a.createElementBlock)(`svg`,{key:1,class:(0,a.normalizeClass)([`d-icon`,`d-icon--size-${n.size}`,`d-loader__icon`]),"data-qa":`dt-loader-icon`,viewBox:`0 0 24 24`,xmlns:`http://www.w3.org/2000/svg`,"aria-hidden":`true`},[...t[2]||(t[2]=[(0,a.createElementVNode)(`circle`,{class:`d-loader__dot d-loader__dot--1`,"data-qa":`dt-loader-dot`,cx:`14.843`,cy:`9.471`,r:`2.410`},null,-1),(0,a.createElementVNode)(`circle`,{class:`d-loader__dot d-loader__dot--2`,"data-qa":`dt-loader-dot`,cx:`9.156`,cy:`15.199`,r:`2.410`},null,-1),(0,a.createElementVNode)(`circle`,{class:`d-loader__dot d-loader__dot--3`,"data-qa":`dt-loader-dot`,cx:`15.469`,cy:`15.743`,r:`3.647`},null,-1),(0,a.createElementVNode)(`circle`,{class:`d-loader__dot d-loader__dot--4`,"data-qa":`dt-loader-dot`,cx:`8.539`,cy:`8.915`,r:`3.647`},null,-1)])],2))],16,s)}var l=t.t(o,[[`render`,c]]);exports.default=l;
|
|
22
22
|
//# sourceMappingURL=loader.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loader.cjs","names":[],"sources":["../../../components/Loader/Loader.vue"],"sourcesContent":["<template>\n <div\n :class=\"['d-loader', loaderKindClass]\"\n :aria-label=\"
|
|
1
|
+
{"version":3,"file":"loader.cjs","names":[],"sources":["../../../components/Loader/Loader.vue"],"sourcesContent":["<template>\n <div\n :class=\"['d-loader', loaderKindClass]\"\n :aria-label=\"accessibleLabel\"\n data-qa=\"dt-loader\"\n v-bind=\"$attrs\"\n :role=\"$attrs.role ?? 'img'\"\n >\n <template v-if=\"isSpinner\">\n <svg\n :class=\"['d-icon', `d-icon--size-${size}`, 'd-loader__icon-track']\"\n data-qa=\"dt-loader-icon-track\"\n viewBox=\"0 0 24 24\"\n fill=\"currentColor\"\n xmlns=\"http://www.w3.org/2000/svg\"\n aria-hidden=\"true\"\n >\n <path\n d=\"\n M12 0.0180664C18.6175 0.0180664 23.9819 5.38305 23.9819\n 12.0005C23.9819 18.6177 18.6175 23.9819 12 23.9819C5.38281\n 23.9819 0.0180664 18.6177 0.0180664 12.0005C0.0180664\n 5.38305 5.38281 0.0180664 12 0.0180664ZM12 3.26807C7.17773\n 3.26807 3.26807 7.17797 3.26807 12.0005C3.26807 16.8228\n 7.17773 20.7319 12 20.7319C16.8223 20.7319 20.7319 16.8228\n 20.7319 12.0005C20.7319 7.17797 16.8223 3.26807 12 3.26807Z\n \"\n />\n </svg>\n <svg\n :class=\"['d-icon', `d-icon--size-${size}`, 'd-loader__icon']\"\n data-qa=\"dt-loader-icon\"\n viewBox=\"0 0 24 24\"\n fill=\"currentColor\"\n xmlns=\"http://www.w3.org/2000/svg\"\n aria-hidden=\"true\"\n >\n <path\n d=\"\n M0.0180664 12.0005\n C0.0180664 5.38305 5.38305 0.0180664 12.0005 0.0180664\n C12.8977 0.0183302 13.6255 0.745766 13.6255 1.64307\n C13.6255 2.54037 12.8977 3.2678 12.0005 3.26807\n C7.17797 3.26807 3.26807 7.17797 3.26807 12.0005\n C3.26833 16.8228 7.17814 20.7319 12.0005 20.7319\n C16.8226 20.7317 20.7317 16.8226 20.7319 12.0005\n C20.7319 11.103 21.4595 10.3755 22.3569 10.3755\n C23.2544 10.3755 23.9819 11.103 23.9819 12.0005\n C23.9817 18.6175 18.6175 23.9817 12.0005 23.9819\n C5.38321 23.9819 0.0183303 18.6177 0.0180664 12.0005Z\n \"\n />\n </svg>\n </template>\n <svg\n v-else\n :class=\"['d-icon', `d-icon--size-${size}`, 'd-loader__icon']\"\n data-qa=\"dt-loader-icon\"\n viewBox=\"0 0 24 24\"\n xmlns=\"http://www.w3.org/2000/svg\"\n aria-hidden=\"true\"\n >\n <!--\n Rest positions and radii in the 24-unit viewBox. They must stay in sync\n with the keyframes in loader.less, which include a 5% outward spread and\n a 0.9655 scale on top of the Figma spec.\n -->\n <circle\n class=\"d-loader__dot d-loader__dot--1\"\n data-qa=\"dt-loader-dot\"\n cx=\"14.843\"\n cy=\"9.471\"\n r=\"2.410\"\n />\n <circle\n class=\"d-loader__dot d-loader__dot--2\"\n data-qa=\"dt-loader-dot\"\n cx=\"9.156\"\n cy=\"15.199\"\n r=\"2.410\"\n />\n <circle\n class=\"d-loader__dot d-loader__dot--3\"\n data-qa=\"dt-loader-dot\"\n cx=\"15.469\"\n cy=\"15.743\"\n r=\"3.647\"\n />\n <circle\n class=\"d-loader__dot d-loader__dot--4\"\n data-qa=\"dt-loader-dot\"\n cx=\"8.539\"\n cy=\"8.915\"\n r=\"3.647\"\n />\n </svg>\n </div>\n</template>\n\n<script>\nimport { ICON_SIZE_MODIFIERS } from '@/components/Icon';\nimport { ordinalSizeValidator } from '@/common/validators';\nimport { LOADER_KIND_MODIFIERS } from './LoaderConstants';\nimport { DialtoneLocalization } from '@/localization';\n\nexport default {\n name: 'DtLoader',\n\n inheritAttrs: false,\n\n props: {\n /**\n * The label of the loader as read out by a screen reader.\n * Defaults to the localized loading message.\n */\n ariaLabel: {\n type: String,\n default: '',\n },\n\n /**\n * The visual style of the loader: the four-dot loader, or the circular spinner.\n * @values dots, spinner\n */\n kind: {\n type: String,\n default: 'dots',\n validator: (kind) => Object.keys(LOADER_KIND_MODIFIERS).includes(kind),\n },\n\n /**\n * The size of the icon.\n * @values 100, 200, 300, 400, 500, 600, 700, 800\n */\n size: {\n type: [String, Number],\n default: 500,\n validator: ordinalSizeValidator(ICON_SIZE_MODIFIERS),\n },\n },\n\n data () {\n return {\n i18n: new DialtoneLocalization(),\n };\n },\n\n computed: {\n accessibleLabel () {\n if (['none', 'presentation'].includes(this.$attrs.role)) return undefined;\n return this.ariaLabel || this.i18n.$t('DIALTONE_LOADING');\n },\n\n isSpinner () {\n return this.kind === 'spinner';\n },\n\n loaderKindClass () {\n return this.isSpinner ? LOADER_KIND_MODIFIERS.spinner : LOADER_KIND_MODIFIERS.dots;\n },\n },\n};\n</script>\n"],"mappings":"6XAyGA,IAAK,EAAU,CACb,KAAM,WAEN,aAAc,GAEd,MAAO,CAKL,UAAW,CACT,KAAM,OACN,QAAS,GACV,CAMD,KAAM,CACJ,KAAM,OACN,QAAS,OACT,UAAY,GAAS,OAAO,KAAK,EAAA,sBAAsB,CAAC,SAAS,EAAK,CACvE,CAMD,KAAM,CACJ,KAAM,CAAC,OAAQ,OAAO,CACtB,QAAS,IACT,UAAW,EAAA,qBAAqB,EAAA,oBAAoB,CACrD,CACF,CAED,MAAQ,CACN,MAAO,CACL,KAAM,IAAI,EAAA,qBACX,EAGH,SAAU,CACR,iBAAmB,CACb,KAAC,OAAQ,eAAe,CAAC,SAAS,KAAK,OAAO,KAAK,CACvD,OAAO,KAAK,WAAa,KAAK,KAAK,GAAG,mBAAmB,EAG3D,WAAa,CACX,OAAO,KAAK,OAAS,WAGvB,iBAAmB,CACjB,OAAO,KAAK,UAAY,EAAA,sBAAsB,QAAU,EAA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