@dialpad/dialtone-vue 3.224.0-next.2 → 3.224.0-next.3
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/components/Chip/Chip.vue.d.ts.map +1 -1
- package/dist/components/Collapsible/Collapsible.vue.d.ts.map +1 -1
- package/dist/components/ComboboxMultiSelect/ComboboxMultiSelectConstants.d.ts.map +1 -1
- package/dist/lib/chip/chip.cjs +1 -1
- package/dist/lib/chip/chip.cjs.map +1 -1
- package/dist/lib/chip/chip.js +1 -1
- package/dist/lib/chip/chip.js.map +1 -1
- package/dist/lib/collapsible/collapsible.cjs +1 -1
- package/dist/lib/collapsible/collapsible.cjs.map +1 -1
- package/dist/lib/collapsible/collapsible.js +3 -2
- package/dist/lib/collapsible/collapsible.js.map +1 -1
- package/dist/lib/combobox-multi-select/combobox-multi-select-constants.cjs.map +1 -1
- package/dist/lib/combobox-multi-select/combobox-multi-select-constants.js.map +1 -1
- package/dist/lib/combobox-multi-select/combobox-multi-select.cjs +1 -1
- package/dist/lib/combobox-multi-select/combobox-multi-select.cjs.map +1 -1
- package/dist/lib/combobox-multi-select/combobox-multi-select.js +56 -45
- package/dist/lib/combobox-multi-select/combobox-multi-select.js.map +1 -1
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Chip.vue.d.ts","sourceRoot":"","sources":["../../../components/Chip/Chip.vue"],"names":[],"mappings":"AA0DA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAiRA,
|
|
1
|
+
{"version":3,"file":"Chip.vue.d.ts","sourceRoot":"","sources":["../../../components/Chip/Chip.vue"],"names":[],"mappings":"AA0DA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAiRA,GApOyB;;;;;;;+BA2OuB,gBAAgB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Collapsible.vue.d.ts","sourceRoot":"","sources":["../../../components/Collapsible/Collapsible.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Collapsible.vue.d.ts","sourceRoot":"","sources":["../../../components/Collapsible/Collapsible.vue"],"names":[],"mappings":"AA+EA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAkSA,GA9OG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBA8OH,GA9OG;;;;;;;+BA8OkE,gBAAgB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ComboboxMultiSelectConstants.d.ts","sourceRoot":"","sources":["../../../components/ComboboxMultiSelect/ComboboxMultiSelectConstants.js"],"names":[],"mappings":";;;;;AAOA;;;;;;;EASE;
|
|
1
|
+
{"version":3,"file":"ComboboxMultiSelectConstants.d.ts","sourceRoot":"","sources":["../../../components/ComboboxMultiSelect/ComboboxMultiSelectConstants.js"],"names":[],"mappings":";;;;;AAOA;;;;;;;EASE;AAOF;;;;;;;EASE"}
|
package/dist/lib/chip/chip.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}}),require(`../../chunk-Bmb41Sf3.cjs`);const e=require(`../../common/validators/index.cjs`),t=require(`../../common/utils/index.cjs`),n=require(`../../_plugin-vue_export-helper-D8jCH6HB.cjs`),r=require(`../../localization/index.cjs`),i=require(`../button/button.cjs`),a=require(`./chip-constants.cjs`);let o=require(`vue`),s=require(`@dialpad/dialtone-icons/vue`);var c={name:`DtChip`,components:{DtButton:i.default,DtIconClose:s.DtIconClose},props:{disabled:{type:Boolean,default:!1},showClose:{type:Boolean,default:!0},size:{type:[String,Number],default:300,validator:e.ordinalSizeValidator(a.CHIP_SIZE_MODIFIERS)},interactive:{type:Boolean,default:!1},id:{type:String,default:function(){return t.getUniqueString()}},ariaLabel:{type:String,default:``},contentClass:{type:[String,Array,Object],default:``},labelClass:{type:[String,Array,Object],default:``},iconClass:{type:[String,Array,Object],default:``},avatarClass:{type:[String,Array,Object],default:``}},emits:[`click`,`close`,`keyup`,`keydown`],data(){return{isActive:!1,hasSlotContent:t.hasSlotContent,i18n:new r.DialtoneLocalization}},computed:{chipListeners(){return{click:e=>{this.interactive&&this.$emit(`click`,e)},keydown:e=>{e.code?.toLowerCase()===`delete`?this.onClose():this.$emit(`keydown`,e)},keyup:e=>{this.$emit(`keyup`,e)}}},closeButtonIconSize(){return a.CHIP_ICON_SIZES[String(this.size)]},closeButtonTitle(){return this.i18n.$t(`DIALTONE_CLOSE_BUTTON`)}},methods:{chipClasses(){return[this.$attrs[`grouped-chip`]?`d-chip`:`d-chip__label`,a.CHIP_SIZE_MODIFIERS[String(this.size)],this.labelClass,this.disabled&&`d-chip--disabled`]},chipCloseButtonClasses(){return[`d-chip__close`,a.CHIP_CLOSE_BUTTON_SIZE_MODIFIERS[String(this.size)],this.disabled&&`d-chip__close--disabled`]},onClose(){this.showClose&&this.$emit(`close`)}}},l={class:`d-chip`},u=[`id`];function d(e,t,n,r,i,a){let s=(0,o.resolveComponent)(`dt-icon-close`),c=(0,o.resolveComponent)(`dt-button`);return(0,o.openBlock)(),(0,o.createElementBlock)(`span`,l,[((0,o.openBlock)(),(0,o.createBlock)((0,o.resolveDynamicComponent)(n.interactive?`button`:`span`),(0,o.mergeProps)({id:n.id,"aria-label":n.ariaLabel,"aria-labelledby":n.ariaLabel?void 0:`${n.id}-content`,"aria-disabled":n.disabled,class:a.chipClasses(),type:n.interactive&&`button`,"data-qa":`dt-chip`,tabindex:n.disabled?-1:null},(0,o.toHandlers)(a.chipListeners)),{default:(0,o.withCtx)(()=>[i.hasSlotContent(e.$slots.icon)?((0,o.openBlock)(),(0,o.createElementBlock)(`span`,{key:0,class:(0,o.normalizeClass)([`d-chip__icon`,n.iconClass]),"data-qa":`dt-chip-icon`},[(0,o.renderSlot)(e.$slots,`icon`)],2)):i.hasSlotContent(e.$slots.avatar)?((0,o.openBlock)(),(0,o.createElementBlock)(`span`,{key:1,class:(0,o.normalizeClass)(n.avatarClass),"data-qa":`dt-chip-avatar`},[(0,o.renderSlot)(e.$slots,`avatar`)],2)):(0,o.createCommentVNode)(``,!0),i.hasSlotContent(e.$slots.default)?((0,o.openBlock)(),(0,o.createElementBlock)(`span`,{key:2,id:`${n.id}-content`,class:(0,o.normalizeClass)([`d-chip__text`,n.contentClass]),"data-qa":`dt-chip-label`},[(0,o.renderSlot)(e.$slots,`default`)],10,u)):(0,o.createCommentVNode)(``,!0)]),_:3},16,[`id`,`aria-label`,`aria-labelledby`,`aria-disabled`,`class`,`type`,`tabindex`])),n.showClose?((0,o.openBlock)(),(0,o.createBlock)(c,{key:0,class:(0,o.normalizeClass)(a.chipCloseButtonClasses()),"data-qa":`dt-chip-close`,"aria-label":a.closeButtonTitle,"aria-disabled":n.disabled,title:a.closeButtonTitle,tabindex:n.disabled?-1:null,onClick:t[0]||(t[0]=t=>e.$emit(`close`))},{startIcon:(0,o.withCtx)(()=>[(0,o.createVNode)(s,{size:a.closeButtonIconSize},null,8,[`size`])]),_:1},8,[`class`,`aria-label`,`aria-disabled`,`title`,`tabindex`])):(0,o.createCommentVNode)(``,!0)])}var f=n.t(c,[[`render`,d]]);exports.default=f;
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}}),require(`../../chunk-Bmb41Sf3.cjs`);const e=require(`../../common/validators/index.cjs`),t=require(`../../common/utils/index.cjs`),n=require(`../../_plugin-vue_export-helper-D8jCH6HB.cjs`),r=require(`../../localization/index.cjs`),i=require(`../button/button.cjs`),a=require(`./chip-constants.cjs`);let o=require(`vue`),s=require(`@dialpad/dialtone-icons/vue`);var c={name:`DtChip`,components:{DtButton:i.default,DtIconClose:s.DtIconClose},props:{disabled:{type:Boolean,default:!1},showClose:{type:Boolean,default:!0},size:{type:[String,Number],default:300,validator:e.ordinalSizeValidator(a.CHIP_SIZE_MODIFIERS)},interactive:{type:Boolean,default:!1},id:{type:String,default:function(){return t.getUniqueString()}},ariaLabel:{type:String,default:``},contentClass:{type:[String,Array,Object],default:``},labelClass:{type:[String,Array,Object],default:``},iconClass:{type:[String,Array,Object],default:``},avatarClass:{type:[String,Array,Object],default:``}},emits:[`click`,`close`,`keyup`,`keydown`],data(){return{isActive:!1,hasSlotContent:t.hasSlotContent,i18n:new r.DialtoneLocalization}},computed:{chipListeners(){return{click:e=>{this.interactive&&this.$emit(`click`,e)},keydown:e=>{e.code?.toLowerCase()===`delete`?this.onClose():this.$emit(`keydown`,e)},keyup:e=>{this.$emit(`keyup`,e)}}},closeButtonIconSize(){return a.CHIP_ICON_SIZES[String(this.size)]},closeButtonTitle(){return this.i18n.$t(`DIALTONE_CLOSE_BUTTON`)}},methods:{chipClasses(){return[this.$attrs[`grouped-chip`]?`d-chip`:`d-chip__label`,a.CHIP_SIZE_MODIFIERS[String(this.size)],this.labelClass,this.disabled&&`d-chip--disabled`]},chipCloseButtonClasses(){return[`d-chip__close`,a.CHIP_CLOSE_BUTTON_SIZE_MODIFIERS[String(this.size)],this.disabled&&`d-chip__close--disabled`]},onClose(){this.showClose&&this.$emit(`close`)}}},l={class:`d-chip`},u=[`id`];function d(e,t,n,r,i,a){let s=(0,o.resolveComponent)(`dt-icon-close`),c=(0,o.resolveComponent)(`dt-button`);return(0,o.openBlock)(),(0,o.createElementBlock)(`span`,l,[((0,o.openBlock)(),(0,o.createBlock)((0,o.resolveDynamicComponent)(n.interactive?`button`:`span`),(0,o.mergeProps)({id:n.id,"aria-label":n.ariaLabel,"aria-labelledby":n.ariaLabel?void 0:`${n.id}-content`,"aria-disabled":n.disabled,class:a.chipClasses(),type:n.interactive&&`button`,"data-qa":`dt-chip`,tabindex:n.disabled?-1:null},(0,o.toHandlers)(a.chipListeners)),{default:(0,o.withCtx)(()=>[i.hasSlotContent(e.$slots.icon)?((0,o.openBlock)(),(0,o.createElementBlock)(`span`,{key:0,class:(0,o.normalizeClass)([`d-chip__icon`,n.iconClass]),"data-qa":`dt-chip-icon`},[(0,o.renderSlot)(e.$slots,`icon`)],2)):i.hasSlotContent(e.$slots.avatar)?((0,o.openBlock)(),(0,o.createElementBlock)(`span`,{key:1,class:(0,o.normalizeClass)([`d-chip__avatar`,n.avatarClass]),"data-qa":`dt-chip-avatar`},[(0,o.renderSlot)(e.$slots,`avatar`)],2)):(0,o.createCommentVNode)(``,!0),i.hasSlotContent(e.$slots.default)?((0,o.openBlock)(),(0,o.createElementBlock)(`span`,{key:2,id:`${n.id}-content`,class:(0,o.normalizeClass)([`d-chip__text`,n.contentClass]),"data-qa":`dt-chip-label`},[(0,o.renderSlot)(e.$slots,`default`)],10,u)):(0,o.createCommentVNode)(``,!0)]),_:3},16,[`id`,`aria-label`,`aria-labelledby`,`aria-disabled`,`class`,`type`,`tabindex`])),n.showClose?((0,o.openBlock)(),(0,o.createBlock)(c,{key:0,class:(0,o.normalizeClass)(a.chipCloseButtonClasses()),"data-qa":`dt-chip-close`,"aria-label":a.closeButtonTitle,"aria-disabled":n.disabled,title:a.closeButtonTitle,tabindex:n.disabled?-1:null,onClick:t[0]||(t[0]=t=>e.$emit(`close`))},{startIcon:(0,o.withCtx)(()=>[(0,o.createVNode)(s,{size:a.closeButtonIconSize},null,8,[`size`])]),_:1},8,[`class`,`aria-label`,`aria-disabled`,`title`,`tabindex`])):(0,o.createCommentVNode)(``,!0)])}var f=n.t(c,[[`render`,d]]);exports.default=f;
|
|
2
2
|
//# sourceMappingURL=chip.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chip.cjs","names":[],"sources":["../../../components/Chip/Chip.vue"],"sourcesContent":["<template>\n <span class=\"d-chip\">\n <component\n :is=\"interactive ? 'button' : 'span'\"\n :id=\"id\"\n :aria-label=\"ariaLabel\"\n :aria-labelledby=\"ariaLabel ? undefined : `${id}-content`\"\n :aria-disabled=\"disabled\"\n :class=\"chipClasses()\"\n :type=\"interactive && 'button'\"\n data-qa=\"dt-chip\"\n :tabindex=\"disabled ? -1 : null\"\n v-on=\"chipListeners\"\n >\n <span\n v-if=\"hasSlotContent($slots.icon)\"\n :class=\"['d-chip__icon', iconClass]\"\n data-qa=\"dt-chip-icon\"\n >\n <!-- @slot slot for Chip icon -->\n <slot name=\"icon\" />\n </span>\n <span\n v-else-if=\"hasSlotContent($slots.avatar)\"\n :class=\"avatarClass\"\n data-qa=\"dt-chip-avatar\"\n >\n <!-- @slot slot for Chip avatar -->\n <slot name=\"avatar\" />\n </span>\n <span\n v-if=\"hasSlotContent($slots.default)\"\n :id=\"`${id}-content`\"\n :class=\"['d-chip__text', contentClass]\"\n data-qa=\"dt-chip-label\"\n >\n <!-- @slot slot for Content within chip -->\n <slot />\n </span>\n </component>\n <dt-button\n v-if=\"showClose\"\n :class=\"chipCloseButtonClasses()\"\n data-qa=\"dt-chip-close\"\n :aria-label=\"closeButtonTitle\"\n :aria-disabled=\"disabled\"\n :title=\"closeButtonTitle\"\n :tabindex=\"disabled ? -1 : null\"\n @click=\"$emit('close')\"\n >\n <template #startIcon>\n <dt-icon-close\n :size=\"closeButtonIconSize\"\n />\n </template>\n </dt-button>\n </span>\n</template>\n\n<script>\nimport { DtButton } from '@/components/Button';\nimport { DtIconClose } from '@dialpad/dialtone-icons/vue';\nimport {\n CHIP_CLOSE_BUTTON_SIZE_MODIFIERS,\n CHIP_SIZE_MODIFIERS,\n CHIP_ICON_SIZES,\n} from './ChipConstants';\nimport { getUniqueString, hasSlotContent } from '@/common/utils';\nimport { ordinalSizeValidator } from '@/common/validators';\nimport { DialtoneLocalization } from '@/localization';\n\n/**\n * A chip is a compact UI element that provides brief, descriptive information about an element.\n * It is terse, ideally one word. It is important a button is identifiable, consistent, and\n * communicates its actions clearly, and is appropriately sized to its action.\n * @see https://dialtone.dialpad.com/components/chip.html\n */\nexport default {\n name: 'DtChip',\n\n components: {\n DtButton,\n DtIconClose,\n },\n\n props: {\n /**\n * Whether the chip is disabled\n * @values true, false\n */\n disabled: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Shows the close button on the chip\n * @values true, false\n */\n showClose: {\n type: Boolean,\n default: true,\n },\n\n /**\n * The size of the chip.\n * @values 100, 200, 300\n */\n size: {\n type: [String, Number],\n default: 300,\n validator: ordinalSizeValidator(CHIP_SIZE_MODIFIERS),\n },\n\n /**\n * The interactivity of the chip.\n * Makes chip clickable, apply hover/focus/active style, emit keyboard events etc.\n * @values true, false\n */\n interactive: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Id to use for the dialog's aria-labelledby.\n */\n id: {\n type: String,\n default: function () { return getUniqueString(); },\n },\n\n /**\n * Descriptive label for the chip content.\n * If this prop is unset the content in the default slot will be used as an aria-label.\n */\n ariaLabel: {\n type: String,\n default: '',\n },\n\n /**\n * Additional class name for the chip element.\n */\n contentClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Additional class name for the span element.\n */\n labelClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Additional class name for the icon wrapper element.\n */\n iconClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Additional class name for the avatar wrapper element.\n */\n avatarClass: {\n type: [String, Array, Object],\n default: '',\n },\n },\n\n emits: [\n /**\n * Native chip click event\n *\n * @event click\n * @type {PointerEvent | KeyboardEvent}\n */\n 'click',\n\n /**\n * Close button click event\n *\n * @event close\n */\n 'close',\n\n /**\n * Native chip key up event\n *\n * @event keyup\n * @type {KeyboardEvent}\n */\n 'keyup',\n\n /**\n * Native chip key down event\n *\n * @event keydown\n * @type {KeyboardEvent}\n */\n 'keydown',\n ],\n\n data () {\n return {\n isActive: false,\n hasSlotContent,\n i18n: new DialtoneLocalization(),\n };\n },\n\n computed: {\n chipListeners () {\n return {\n click: event => {\n if (this.interactive) this.$emit('click', event);\n },\n\n keydown: event => {\n if (event.code?.toLowerCase() === 'delete') {\n this.onClose();\n } else {\n this.$emit('keydown', event);\n }\n },\n\n keyup: event => {\n this.$emit('keyup', event);\n },\n };\n },\n\n closeButtonIconSize () {\n return CHIP_ICON_SIZES[String(this.size)];\n },\n\n closeButtonTitle () {\n return this.i18n.$t('DIALTONE_CLOSE_BUTTON');\n },\n },\n\n methods: {\n chipClasses () {\n return [\n this.$attrs['grouped-chip'] ? 'd-chip' : 'd-chip__label',\n CHIP_SIZE_MODIFIERS[String(this.size)],\n this.labelClass,\n this.disabled && 'd-chip--disabled',\n ];\n },\n\n chipCloseButtonClasses () {\n return [\n 'd-chip__close',\n CHIP_CLOSE_BUTTON_SIZE_MODIFIERS[String(this.size)],\n this.disabled && 'd-chip__close--disabled',\n ];\n },\n\n onClose () {\n if (this.showClose) {\n this.$emit('close');\n }\n },\n },\n};\n</script>\n"],"mappings":"wcA6EA,IAAK,EAAU,CACb,KAAM,SAEN,WAAY,CACV,SAAA,EAAA,QACA,YAAA,EAAA,YACD,CAED,MAAO,CAKL,SAAU,CACR,KAAM,QACN,QAAS,GACV,CAMD,UAAW,CACT,KAAM,QACN,QAAS,GACV,CAMD,KAAM,CACJ,KAAM,CAAC,OAAQ,OAAO,CACtB,QAAS,IACT,UAAW,EAAA,qBAAqB,EAAA,oBAAoB,CACrD,CAOD,YAAa,CACX,KAAM,QACN,QAAS,GACV,CAKD,GAAI,CACF,KAAM,O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,EAAA,yBArDE,EAAA,YAAW,SAAA,OAAA,EAAA,EAAA,EAAA,YAoCN,CAnCT,GAAI,EAAA,GACJ,aAAY,EAAA,UACZ,kBAAiB,EAAA,UAAY,IAAA,GAAS,GAAM,EAAA,GAAE,UAC9C,gBAAe,EAAA,SACf,MAAO,EAAA,aAAW,CAClB,KAAM,EAAA,aAAW,SAClB,UAAQ,UACP,SAAU,EAAA,SAAQ,GAAA,uBACC,EAAd,cAAa,CAAA,CAAA,2BASZ,CANC,EAAA,eAAe,EAAA,OAAO,KAAI,GAAA,EAAA,EAAA,YAAA,EAAA,EAAA,EAAA,oBAM3B,OAAA,OALJ,OAAA,EAAA,EAAA,gBAAK,CAAA,eAAmB,EAAA,UAAS,CAAA,CAClC,UAAQ,kCAGY,EAAA,OAAA,OAAA,CAAA,CAAA,EAAA,EAGT,EAAA,eAAe,EAAA,OAAO,OAAM,GAAA,EAAA,EAAA,YAAA,EAAA,EAAA,EAAA,oBAMlC,OAAA,OALJ,OAAA,EAAA,EAAA,
|
|
1
|
+
{"version":3,"file":"chip.cjs","names":[],"sources":["../../../components/Chip/Chip.vue"],"sourcesContent":["<template>\n <span class=\"d-chip\">\n <component\n :is=\"interactive ? 'button' : 'span'\"\n :id=\"id\"\n :aria-label=\"ariaLabel\"\n :aria-labelledby=\"ariaLabel ? undefined : `${id}-content`\"\n :aria-disabled=\"disabled\"\n :class=\"chipClasses()\"\n :type=\"interactive && 'button'\"\n data-qa=\"dt-chip\"\n :tabindex=\"disabled ? -1 : null\"\n v-on=\"chipListeners\"\n >\n <span\n v-if=\"hasSlotContent($slots.icon)\"\n :class=\"['d-chip__icon', iconClass]\"\n data-qa=\"dt-chip-icon\"\n >\n <!-- @slot slot for Chip icon -->\n <slot name=\"icon\" />\n </span>\n <span\n v-else-if=\"hasSlotContent($slots.avatar)\"\n :class=\"['d-chip__avatar', avatarClass]\"\n data-qa=\"dt-chip-avatar\"\n >\n <!-- @slot slot for Chip avatar -->\n <slot name=\"avatar\" />\n </span>\n <span\n v-if=\"hasSlotContent($slots.default)\"\n :id=\"`${id}-content`\"\n :class=\"['d-chip__text', contentClass]\"\n data-qa=\"dt-chip-label\"\n >\n <!-- @slot slot for Content within chip -->\n <slot />\n </span>\n </component>\n <dt-button\n v-if=\"showClose\"\n :class=\"chipCloseButtonClasses()\"\n data-qa=\"dt-chip-close\"\n :aria-label=\"closeButtonTitle\"\n :aria-disabled=\"disabled\"\n :title=\"closeButtonTitle\"\n :tabindex=\"disabled ? -1 : null\"\n @click=\"$emit('close')\"\n >\n <template #startIcon>\n <dt-icon-close\n :size=\"closeButtonIconSize\"\n />\n </template>\n </dt-button>\n </span>\n</template>\n\n<script>\nimport { DtButton } from '@/components/Button';\nimport { DtIconClose } from '@dialpad/dialtone-icons/vue';\nimport {\n CHIP_CLOSE_BUTTON_SIZE_MODIFIERS,\n CHIP_SIZE_MODIFIERS,\n CHIP_ICON_SIZES,\n} from './ChipConstants';\nimport { getUniqueString, hasSlotContent } from '@/common/utils';\nimport { ordinalSizeValidator } from '@/common/validators';\nimport { DialtoneLocalization } from '@/localization';\n\n/**\n * A chip is a compact UI element that provides brief, descriptive information about an element.\n * It is terse, ideally one word. It is important a button is identifiable, consistent, and\n * communicates its actions clearly, and is appropriately sized to its action.\n * @see https://dialtone.dialpad.com/components/chip.html\n */\nexport default {\n name: 'DtChip',\n\n components: {\n DtButton,\n DtIconClose,\n },\n\n props: {\n /**\n * Whether the chip is disabled\n * @values true, false\n */\n disabled: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Shows the close button on the chip\n * @values true, false\n */\n showClose: {\n type: Boolean,\n default: true,\n },\n\n /**\n * The size of the chip.\n * @values 100, 200, 300\n */\n size: {\n type: [String, Number],\n default: 300,\n validator: ordinalSizeValidator(CHIP_SIZE_MODIFIERS),\n },\n\n /**\n * The interactivity of the chip.\n * Makes chip clickable, apply hover/focus/active style, emit keyboard events etc.\n * @values true, false\n */\n interactive: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Id to use for the dialog's aria-labelledby.\n */\n id: {\n type: String,\n default: function () { return getUniqueString(); },\n },\n\n /**\n * Descriptive label for the chip content.\n * If this prop is unset the content in the default slot will be used as an aria-label.\n */\n ariaLabel: {\n type: String,\n default: '',\n },\n\n /**\n * Additional class name for the chip element.\n */\n contentClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Additional class name for the span element.\n */\n labelClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Additional class name for the icon wrapper element.\n */\n iconClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Additional class name for the avatar wrapper element.\n */\n avatarClass: {\n type: [String, Array, Object],\n default: '',\n },\n },\n\n emits: [\n /**\n * Native chip click event\n *\n * @event click\n * @type {PointerEvent | KeyboardEvent}\n */\n 'click',\n\n /**\n * Close button click event\n *\n * @event close\n */\n 'close',\n\n /**\n * Native chip key up event\n *\n * @event keyup\n * @type {KeyboardEvent}\n */\n 'keyup',\n\n /**\n * Native chip key down event\n *\n * @event keydown\n * @type {KeyboardEvent}\n */\n 'keydown',\n ],\n\n data () {\n return {\n isActive: false,\n hasSlotContent,\n i18n: new DialtoneLocalization(),\n };\n },\n\n computed: {\n chipListeners () {\n return {\n click: event => {\n if (this.interactive) this.$emit('click', event);\n },\n\n keydown: event => {\n if (event.code?.toLowerCase() === 'delete') {\n this.onClose();\n } else {\n this.$emit('keydown', event);\n }\n },\n\n keyup: event => {\n this.$emit('keyup', event);\n },\n };\n },\n\n closeButtonIconSize () {\n return CHIP_ICON_SIZES[String(this.size)];\n },\n\n closeButtonTitle () {\n return this.i18n.$t('DIALTONE_CLOSE_BUTTON');\n },\n },\n\n methods: {\n chipClasses () {\n return [\n this.$attrs['grouped-chip'] ? 'd-chip' : 'd-chip__label',\n CHIP_SIZE_MODIFIERS[String(this.size)],\n this.labelClass,\n this.disabled && 'd-chip--disabled',\n ];\n },\n\n chipCloseButtonClasses () {\n return [\n 'd-chip__close',\n CHIP_CLOSE_BUTTON_SIZE_MODIFIERS[String(this.size)],\n this.disabled && 'd-chip__close--disabled',\n ];\n },\n\n onClose () {\n if (this.showClose) {\n this.$emit('close');\n }\n },\n },\n};\n</script>\n"],"mappings":"wcA6EA,IAAK,EAAU,CACb,KAAM,SAEN,WAAY,CACV,SAAA,EAAA,QACA,YAAA,EAAA,YACD,CAED,MAAO,CAKL,SAAU,CACR,KAAM,QACN,QAAS,GACV,CAMD,UAAW,CACT,KAAM,QACN,QAAS,GACV,CAMD,KAAM,CACJ,KAAM,CAAC,OAAQ,OAAO,CACtB,QAAS,IACT,UAAW,EAAA,qBAAqB,EAAA,oBAAoB,CACrD,CAOD,YAAa,CACX,KAAM,QACN,QAAS,GACV,CAKD,GAAI,CACF,KAAM,OACN,QAAS,UAAY,CAAE,OAAO,EAAA,iBAAiB,EAChD,CAMD,UAAW,CACT,KAAM,OACN,QAAS,GACV,CAKD,aAAc,CACZ,KAAM,CAAC,OAAQ,MAAO,OAAO,CAC7B,QAAS,GACV,CAKD,WAAY,CACV,KAAM,CAAC,OAAQ,MAAO,OAAO,CAC7B,QAAS,GACV,CAKD,UAAW,CACT,KAAM,CAAC,OAAQ,MAAO,OAAO,CAC7B,QAAS,GACV,CAKD,YAAa,CACX,KAAM,CAAC,OAAQ,MAAO,OAAO,CAC7B,QAAS,GACV,CACF,CAED,MAAO,CAOL,QAOA,QAQA,QAQA,UACD,CAED,MAAQ,CACN,MAAO,CACL,SAAU,GACV,eAAA,EAAA,eACA,KAAM,IAAI,EAAA,qBACX,EAGH,SAAU,CACR,eAAiB,CACf,MAAO,CACL,MAAO,GAAS,CACV,KAAK,aAAa,KAAK,MAAM,QAAS,EAAM,EAGlD,QAAS,GAAS,CACZ,EAAM,MAAM,aAAY,GAAM,SAChC,KAAK,SAAS,CAEd,KAAK,MAAM,UAAW,EAAM,EAIhC,MAAO,GAAS,CACd,KAAK,MAAM,QAAS,EAAM,EAE7B,EAGH,qBAAuB,CACrB,OAAO,EAAA,gBAAgB,OAAO,KAA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,EAAA,eAAe,EAAA,OAAO,QAAO,GAAA,EAAA,EAAA,YAAA,EAAA,EAAA,EAAA,oBAO9B,OAAA,OANJ,GAAE,GAAK,EAAA,GAAE,UACT,OAAA,EAAA,EAAA,gBAAK,CAAA,eAAmB,EAAA,aAAY,CAAA,CACrC,UAAQ,mCAGA,EAAA,OAAA,UAAA,CAAA,CAAA,GAAA,EAAA,GAAA,EAAA,EAAA,oBAAA,GAAA,GAAA,CAAA,CAAA,2FAIJ,EAAA,YAAA,EAAA,EAAA,YAAA,EAAA,EAAA,EAAA,aAcI,EAAA,OAbT,OAAA,EAAA,EAAA,gBAAO,EAAA,wBAAsB,CAAA,CAC9B,UAAQ,gBACP,aAAY,EAAA,iBACZ,gBAAe,EAAA,SACf,MAAO,EAAA,iBACP,SAAU,EAAA,SAAQ,GAAA,KAClB,QAAK,EAAA,KAAA,EAAA,GAAA,GAAE,EAAA,MAAK,QAAA,IAEF,WAAA,EAAA,EAAA,aAGP,EAAA,EAAA,EAAA,aAAA,EAAA,CADC,KAAM,EAAA,oBAAmB,CAAA,KAAA,EAAA,CAAA,OAAA,CAAA,CAAA,CAAA"}
|
package/dist/lib/chip/chip.js
CHANGED
|
@@ -147,7 +147,7 @@ function T(e, t, n, r, i, a) {
|
|
|
147
147
|
"data-qa": "dt-chip-icon"
|
|
148
148
|
}, [g(e.$slots, "icon")], 2)) : i.hasSlotContent(e.$slots.avatar) ? (h(), d("span", {
|
|
149
149
|
key: 1,
|
|
150
|
-
class: m(n.avatarClass),
|
|
150
|
+
class: m(["d-chip__avatar", n.avatarClass]),
|
|
151
151
|
"data-qa": "dt-chip-avatar"
|
|
152
152
|
}, [g(e.$slots, "avatar")], 2)) : u("", !0), i.hasSlotContent(e.$slots.default) ? (h(), d("span", {
|
|
153
153
|
key: 2,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chip.js","names":[],"sources":["../../../components/Chip/Chip.vue"],"sourcesContent":["<template>\n <span class=\"d-chip\">\n <component\n :is=\"interactive ? 'button' : 'span'\"\n :id=\"id\"\n :aria-label=\"ariaLabel\"\n :aria-labelledby=\"ariaLabel ? undefined : `${id}-content`\"\n :aria-disabled=\"disabled\"\n :class=\"chipClasses()\"\n :type=\"interactive && 'button'\"\n data-qa=\"dt-chip\"\n :tabindex=\"disabled ? -1 : null\"\n v-on=\"chipListeners\"\n >\n <span\n v-if=\"hasSlotContent($slots.icon)\"\n :class=\"['d-chip__icon', iconClass]\"\n data-qa=\"dt-chip-icon\"\n >\n <!-- @slot slot for Chip icon -->\n <slot name=\"icon\" />\n </span>\n <span\n v-else-if=\"hasSlotContent($slots.avatar)\"\n :class=\"avatarClass\"\n data-qa=\"dt-chip-avatar\"\n >\n <!-- @slot slot for Chip avatar -->\n <slot name=\"avatar\" />\n </span>\n <span\n v-if=\"hasSlotContent($slots.default)\"\n :id=\"`${id}-content`\"\n :class=\"['d-chip__text', contentClass]\"\n data-qa=\"dt-chip-label\"\n >\n <!-- @slot slot for Content within chip -->\n <slot />\n </span>\n </component>\n <dt-button\n v-if=\"showClose\"\n :class=\"chipCloseButtonClasses()\"\n data-qa=\"dt-chip-close\"\n :aria-label=\"closeButtonTitle\"\n :aria-disabled=\"disabled\"\n :title=\"closeButtonTitle\"\n :tabindex=\"disabled ? -1 : null\"\n @click=\"$emit('close')\"\n >\n <template #startIcon>\n <dt-icon-close\n :size=\"closeButtonIconSize\"\n />\n </template>\n </dt-button>\n </span>\n</template>\n\n<script>\nimport { DtButton } from '@/components/Button';\nimport { DtIconClose } from '@dialpad/dialtone-icons/vue';\nimport {\n CHIP_CLOSE_BUTTON_SIZE_MODIFIERS,\n CHIP_SIZE_MODIFIERS,\n CHIP_ICON_SIZES,\n} from './ChipConstants';\nimport { getUniqueString, hasSlotContent } from '@/common/utils';\nimport { ordinalSizeValidator } from '@/common/validators';\nimport { DialtoneLocalization } from '@/localization';\n\n/**\n * A chip is a compact UI element that provides brief, descriptive information about an element.\n * It is terse, ideally one word. It is important a button is identifiable, consistent, and\n * communicates its actions clearly, and is appropriately sized to its action.\n * @see https://dialtone.dialpad.com/components/chip.html\n */\nexport default {\n name: 'DtChip',\n\n components: {\n DtButton,\n DtIconClose,\n },\n\n props: {\n /**\n * Whether the chip is disabled\n * @values true, false\n */\n disabled: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Shows the close button on the chip\n * @values true, false\n */\n showClose: {\n type: Boolean,\n default: true,\n },\n\n /**\n * The size of the chip.\n * @values 100, 200, 300\n */\n size: {\n type: [String, Number],\n default: 300,\n validator: ordinalSizeValidator(CHIP_SIZE_MODIFIERS),\n },\n\n /**\n * The interactivity of the chip.\n * Makes chip clickable, apply hover/focus/active style, emit keyboard events etc.\n * @values true, false\n */\n interactive: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Id to use for the dialog's aria-labelledby.\n */\n id: {\n type: String,\n default: function () { return getUniqueString(); },\n },\n\n /**\n * Descriptive label for the chip content.\n * If this prop is unset the content in the default slot will be used as an aria-label.\n */\n ariaLabel: {\n type: String,\n default: '',\n },\n\n /**\n * Additional class name for the chip element.\n */\n contentClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Additional class name for the span element.\n */\n labelClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Additional class name for the icon wrapper element.\n */\n iconClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Additional class name for the avatar wrapper element.\n */\n avatarClass: {\n type: [String, Array, Object],\n default: '',\n },\n },\n\n emits: [\n /**\n * Native chip click event\n *\n * @event click\n * @type {PointerEvent | KeyboardEvent}\n */\n 'click',\n\n /**\n * Close button click event\n *\n * @event close\n */\n 'close',\n\n /**\n * Native chip key up event\n *\n * @event keyup\n * @type {KeyboardEvent}\n */\n 'keyup',\n\n /**\n * Native chip key down event\n *\n * @event keydown\n * @type {KeyboardEvent}\n */\n 'keydown',\n ],\n\n data () {\n return {\n isActive: false,\n hasSlotContent,\n i18n: new DialtoneLocalization(),\n };\n },\n\n computed: {\n chipListeners () {\n return {\n click: event => {\n if (this.interactive) this.$emit('click', event);\n },\n\n keydown: event => {\n if (event.code?.toLowerCase() === 'delete') {\n this.onClose();\n } else {\n this.$emit('keydown', event);\n }\n },\n\n keyup: event => {\n this.$emit('keyup', event);\n },\n };\n },\n\n closeButtonIconSize () {\n return CHIP_ICON_SIZES[String(this.size)];\n },\n\n closeButtonTitle () {\n return this.i18n.$t('DIALTONE_CLOSE_BUTTON');\n },\n },\n\n methods: {\n chipClasses () {\n return [\n this.$attrs['grouped-chip'] ? 'd-chip' : 'd-chip__label',\n CHIP_SIZE_MODIFIERS[String(this.size)],\n this.labelClass,\n this.disabled && 'd-chip--disabled',\n ];\n },\n\n chipCloseButtonClasses () {\n return [\n 'd-chip__close',\n CHIP_CLOSE_BUTTON_SIZE_MODIFIERS[String(this.size)],\n this.disabled && 'd-chip__close--disabled',\n ];\n },\n\n onClose () {\n if (this.showClose) {\n this.$emit('close');\n }\n },\n },\n};\n</script>\n"],"mappings":";;;;;;;;;AA6EA,IAAK,IAAU;CACb,MAAM;CAEN,YAAY;EACV,UAAA;EACA;EACD;CAED,OAAO;EAKL,UAAU;GACR,MAAM;GACN,SAAS;GACV;EAMD,WAAW;GACT,MAAM;GACN,SAAS;GACV;EAMD,MAAM;GACJ,MAAM,CAAC,QAAQ,OAAO;GACtB,SAAS;GACT,WAAW,EAAqB,EAAoB;GACrD;EAOD,aAAa;GACX,MAAM;GACN,SAAS;GACV;EAKD,IAAI;GACF,MAAM;GACN,SAAS,WAAY;AAAE,WAAO,GAAiB;;GAChD;EAMD,WAAW;GACT,MAAM;GACN,SAAS;GACV;EAKD,cAAc;GACZ,MAAM;IAAC;IAAQ;IAAO;IAAO;GAC7B,SAAS;GACV;EAKD,YAAY;GACV,MAAM;IAAC;IAAQ;IAAO;IAAO;GAC7B,SAAS;GACV;EAKD,WAAW;GACT,MAAM;IAAC;IAAQ;IAAO;IAAO;GAC7B,SAAS;GACV;EAKD,aAAa;GACX,MAAM;IAAC;IA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C,EAOO,QAAA;;GALJ,OAAK,EAAA,CAAA,gBAAmB,EAAA,UAAS,CAAA;GAClC,WAAQ;MAGR,EAAoB,EAAA,QAAA,OAAA,CAAA,EAAA,EAAA,IAGT,EAAA,eAAe,EAAA,OAAO,OAAM,IAAA,GAAA,EADzC,EAOO,QAAA;;GALJ,OAAK,
|
|
1
|
+
{"version":3,"file":"chip.js","names":[],"sources":["../../../components/Chip/Chip.vue"],"sourcesContent":["<template>\n <span class=\"d-chip\">\n <component\n :is=\"interactive ? 'button' : 'span'\"\n :id=\"id\"\n :aria-label=\"ariaLabel\"\n :aria-labelledby=\"ariaLabel ? undefined : `${id}-content`\"\n :aria-disabled=\"disabled\"\n :class=\"chipClasses()\"\n :type=\"interactive && 'button'\"\n data-qa=\"dt-chip\"\n :tabindex=\"disabled ? -1 : null\"\n v-on=\"chipListeners\"\n >\n <span\n v-if=\"hasSlotContent($slots.icon)\"\n :class=\"['d-chip__icon', iconClass]\"\n data-qa=\"dt-chip-icon\"\n >\n <!-- @slot slot for Chip icon -->\n <slot name=\"icon\" />\n </span>\n <span\n v-else-if=\"hasSlotContent($slots.avatar)\"\n :class=\"['d-chip__avatar', avatarClass]\"\n data-qa=\"dt-chip-avatar\"\n >\n <!-- @slot slot for Chip avatar -->\n <slot name=\"avatar\" />\n </span>\n <span\n v-if=\"hasSlotContent($slots.default)\"\n :id=\"`${id}-content`\"\n :class=\"['d-chip__text', contentClass]\"\n data-qa=\"dt-chip-label\"\n >\n <!-- @slot slot for Content within chip -->\n <slot />\n </span>\n </component>\n <dt-button\n v-if=\"showClose\"\n :class=\"chipCloseButtonClasses()\"\n data-qa=\"dt-chip-close\"\n :aria-label=\"closeButtonTitle\"\n :aria-disabled=\"disabled\"\n :title=\"closeButtonTitle\"\n :tabindex=\"disabled ? -1 : null\"\n @click=\"$emit('close')\"\n >\n <template #startIcon>\n <dt-icon-close\n :size=\"closeButtonIconSize\"\n />\n </template>\n </dt-button>\n </span>\n</template>\n\n<script>\nimport { DtButton } from '@/components/Button';\nimport { DtIconClose } from '@dialpad/dialtone-icons/vue';\nimport {\n CHIP_CLOSE_BUTTON_SIZE_MODIFIERS,\n CHIP_SIZE_MODIFIERS,\n CHIP_ICON_SIZES,\n} from './ChipConstants';\nimport { getUniqueString, hasSlotContent } from '@/common/utils';\nimport { ordinalSizeValidator } from '@/common/validators';\nimport { DialtoneLocalization } from '@/localization';\n\n/**\n * A chip is a compact UI element that provides brief, descriptive information about an element.\n * It is terse, ideally one word. It is important a button is identifiable, consistent, and\n * communicates its actions clearly, and is appropriately sized to its action.\n * @see https://dialtone.dialpad.com/components/chip.html\n */\nexport default {\n name: 'DtChip',\n\n components: {\n DtButton,\n DtIconClose,\n },\n\n props: {\n /**\n * Whether the chip is disabled\n * @values true, false\n */\n disabled: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Shows the close button on the chip\n * @values true, false\n */\n showClose: {\n type: Boolean,\n default: true,\n },\n\n /**\n * The size of the chip.\n * @values 100, 200, 300\n */\n size: {\n type: [String, Number],\n default: 300,\n validator: ordinalSizeValidator(CHIP_SIZE_MODIFIERS),\n },\n\n /**\n * The interactivity of the chip.\n * Makes chip clickable, apply hover/focus/active style, emit keyboard events etc.\n * @values true, false\n */\n interactive: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Id to use for the dialog's aria-labelledby.\n */\n id: {\n type: String,\n default: function () { return getUniqueString(); },\n },\n\n /**\n * Descriptive label for the chip content.\n * If this prop is unset the content in the default slot will be used as an aria-label.\n */\n ariaLabel: {\n type: String,\n default: '',\n },\n\n /**\n * Additional class name for the chip element.\n */\n contentClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Additional class name for the span element.\n */\n labelClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Additional class name for the icon wrapper element.\n */\n iconClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Additional class name for the avatar wrapper element.\n */\n avatarClass: {\n type: [String, Array, Object],\n default: '',\n },\n },\n\n emits: [\n /**\n * Native chip click event\n *\n * @event click\n * @type {PointerEvent | KeyboardEvent}\n */\n 'click',\n\n /**\n * Close button click event\n *\n * @event close\n */\n 'close',\n\n /**\n * Native chip key up event\n *\n * @event keyup\n * @type {KeyboardEvent}\n */\n 'keyup',\n\n /**\n * Native chip key down event\n *\n * @event keydown\n * @type {KeyboardEvent}\n */\n 'keydown',\n ],\n\n data () {\n return {\n isActive: false,\n hasSlotContent,\n i18n: new DialtoneLocalization(),\n };\n },\n\n computed: {\n chipListeners () {\n return {\n click: event => {\n if (this.interactive) this.$emit('click', event);\n },\n\n keydown: event => {\n if (event.code?.toLowerCase() === 'delete') {\n this.onClose();\n } else {\n this.$emit('keydown', event);\n }\n },\n\n keyup: event => {\n this.$emit('keyup', event);\n },\n };\n },\n\n closeButtonIconSize () {\n return CHIP_ICON_SIZES[String(this.size)];\n },\n\n closeButtonTitle () {\n return this.i18n.$t('DIALTONE_CLOSE_BUTTON');\n },\n },\n\n methods: {\n chipClasses () {\n return [\n this.$attrs['grouped-chip'] ? 'd-chip' : 'd-chip__label',\n CHIP_SIZE_MODIFIERS[String(this.size)],\n this.labelClass,\n this.disabled && 'd-chip--disabled',\n ];\n },\n\n chipCloseButtonClasses () {\n return [\n 'd-chip__close',\n CHIP_CLOSE_BUTTON_SIZE_MODIFIERS[String(this.size)],\n this.disabled && 'd-chip__close--disabled',\n ];\n },\n\n onClose () {\n if (this.showClose) {\n this.$emit('close');\n }\n },\n },\n};\n</script>\n"],"mappings":";;;;;;;;;AA6EA,IAAK,IAAU;CACb,MAAM;CAEN,YAAY;EACV,UAAA;EACA;EACD;CAED,OAAO;EAKL,UAAU;GACR,MAAM;GACN,SAAS;GACV;EAMD,WAAW;GACT,MAAM;GACN,SAAS;GACV;EAMD,MAAM;GACJ,MAAM,CAAC,QAAQ,OAAO;GACtB,SAAS;GACT,WAAW,EAAqB,EAAoB;GACrD;EAOD,aAAa;GACX,MAAM;GACN,SAAS;GACV;EAKD,IAAI;GACF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GAAA,CAAA,OAAA,CAAA,CAAA,CAAA"}
|
|
@@ -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(`../button/button.cjs`),r=require(`./collapsible-lazy-show.cjs`);let i=require(`vue`),a=require(`@dialpad/dialtone-icons/vue`);var o={name:`DtCollapsible`,components:{DtButton:n.default,DtCollapsibleLazyShow:r.default,DtIconChevronDown:a.DtIconChevronDown,DtIconChevronRight:a.DtIconChevronRight},props:{anchorText:{type:String,default:null},open:{type:[Boolean,null],default:null},id:{type:String,default(){return e.getUniqueString()}},elementType:{type:String,default:`div`},contentElementType:{type:String,default:`div`},anchorClass:{type:[String,Array,Object],default:null},contentClass:{type:[String,Array,Object],default:null},maxWidth:{type:String,default:null},maxHeight:{type:String,default:null},ariaLabel:{type:String,default:null},ariaLabelledBy:{type:String,default:null}},emits:[`update:open`,`opened`],data(){return{isOpen:!0}},computed:{labelledBy(){return this.ariaLabelledBy||!this.ariaLabel&&e.getUniqueString(`DtCollapsible__anchor`)},collapsibleListeners(){return e.extractVueListeners(this.$attrs)}},watch:{open:{handler:function(e){e!==null&&(this.isOpen=e)},immediate:!0}},created(){this.validateProperAnchor()},beforeUnmount(){this._isUnmounting=!0},methods:{onLeaveTransitionComplete(){this._isUnmounting||(this.$emit(`opened`,!1),this.open!==null&&this.$emit(`update:open`,!1))},onEnterTransitionComplete(){this._isUnmounting||(this.$emit(`opened`,!0,this.$refs.content),this.open!==null&&this.$emit(`update:open`,!0))},defaultToggleOpen(){this.open===null&&this.toggleOpen()},toggleOpen(){this.isOpen=!this.isOpen},validateProperAnchor(){!this.anchorText&&!e.hasSlotContent(this.$slots.anchor)&&console.error(`anchor text and anchor slot content cannot both be falsy`)}}},s=[`id`],c=[`title`];function l(e,t,n,r,a,o){let l=(0,i.resolveComponent)(`dt-icon-chevron-down`),u=(0,i.resolveComponent)(`dt-icon-chevron-right`),d=(0,i.resolveComponent)(`dt-button`),f=(0,i.resolveComponent)(`dt-collapsible-lazy-show`);return(0,i.openBlock)(),(0,i.createBlock)((0,i.resolveDynamicComponent)(n.elementType),(0,i.mergeProps)({ref:`collapsible`},(0,i.toHandlers)(o.collapsibleListeners)),{default:(0,i.withCtx)(()=>[(0,i.createElementVNode)(`div`,{id:!n.ariaLabelledBy&&o.labelledBy,ref:`anchor`,class:(0,i.normalizeClass)(n.anchorClass)},[(0,i.renderSlot)(e.$slots,`anchor`,{attrs:{"aria-controls":n.id,"aria-expanded":a.isOpen.toString(),role:`button`}},()=>[(0,i.createVNode)(d,{importance:`clear`,kind:`muted`,"aria-controls":n.id,"aria-expanded":`${a.isOpen}`,style:(0,i.normalizeStyle)({width:n.maxWidth}),onClick:o.defaultToggleOpen},{
|
|
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(`../button/button.cjs`),r=require(`./collapsible-lazy-show.cjs`);let i=require(`vue`),a=require(`@dialpad/dialtone-icons/vue`);var o={name:`DtCollapsible`,components:{DtButton:n.default,DtCollapsibleLazyShow:r.default,DtIconChevronDown:a.DtIconChevronDown,DtIconChevronRight:a.DtIconChevronRight},props:{anchorText:{type:String,default:null},open:{type:[Boolean,null],default:null},id:{type:String,default(){return e.getUniqueString()}},elementType:{type:String,default:`div`},contentElementType:{type:String,default:`div`},anchorClass:{type:[String,Array,Object],default:null},contentClass:{type:[String,Array,Object],default:null},maxWidth:{type:String,default:null},maxHeight:{type:String,default:null},ariaLabel:{type:String,default:null},ariaLabelledBy:{type:String,default:null}},emits:[`update:open`,`opened`],data(){return{isOpen:!0}},computed:{labelledBy(){return this.ariaLabelledBy||!this.ariaLabel&&e.getUniqueString(`DtCollapsible__anchor`)},collapsibleListeners(){return e.extractVueListeners(this.$attrs)}},watch:{open:{handler:function(e){e!==null&&(this.isOpen=e)},immediate:!0}},created(){this.validateProperAnchor()},beforeUnmount(){this._isUnmounting=!0},methods:{onLeaveTransitionComplete(){this._isUnmounting||(this.$emit(`opened`,!1),this.open!==null&&this.$emit(`update:open`,!1))},onEnterTransitionComplete(){this._isUnmounting||(this.$emit(`opened`,!0,this.$refs.content),this.open!==null&&this.$emit(`update:open`,!0))},defaultToggleOpen(){this.open===null&&this.toggleOpen()},toggleOpen(){this.isOpen=!this.isOpen},validateProperAnchor(){!this.anchorText&&!e.hasSlotContent(this.$slots.anchor)&&console.error(`anchor text and anchor slot content cannot both be falsy`)}}},s=[`id`],c=[`title`];function l(e,t,n,r,a,o){let l=(0,i.resolveComponent)(`dt-icon-chevron-down`),u=(0,i.resolveComponent)(`dt-icon-chevron-right`),d=(0,i.resolveComponent)(`dt-button`),f=(0,i.resolveComponent)(`dt-collapsible-lazy-show`);return(0,i.openBlock)(),(0,i.createBlock)((0,i.resolveDynamicComponent)(n.elementType),(0,i.mergeProps)({ref:`collapsible`},(0,i.toHandlers)(o.collapsibleListeners)),{default:(0,i.withCtx)(()=>[(0,i.createElementVNode)(`div`,{id:!n.ariaLabelledBy&&o.labelledBy,ref:`anchor`,class:(0,i.normalizeClass)(n.anchorClass)},[(0,i.renderSlot)(e.$slots,`anchor`,{attrs:{"aria-controls":n.id,"aria-expanded":a.isOpen.toString(),role:`button`}},()=>[(0,i.createVNode)(d,{importance:`clear`,kind:`muted`,"aria-controls":n.id,"aria-expanded":`${a.isOpen}`,style:(0,i.normalizeStyle)({width:n.maxWidth}),onClick:o.defaultToggleOpen},{startIcon:(0,i.withCtx)(()=>[a.isOpen?((0,i.openBlock)(),(0,i.createBlock)(l,{key:0,class:`d-collapsible__icon`,size:`300`})):((0,i.openBlock)(),(0,i.createBlock)(u,{key:1,class:`d-collapsible__icon`,size:`300`}))]),default:(0,i.withCtx)(()=>[(0,i.createElementVNode)(`span`,{class:`d-collapsible__anchor-text`,title:n.anchorText},(0,i.toDisplayString)(n.anchorText),9,c)]),_:1},8,[`aria-controls`,`aria-expanded`,`style`,`onClick`])])],10,s),(0,i.createVNode)(f,(0,i.mergeProps)({id:n.id,ref:`contentWrapper`,"aria-hidden":`${!a.isOpen}`,"aria-labelledby":o.labelledBy,"aria-label":n.ariaLabel,show:a.isOpen,"element-type":n.contentElementType,class:n.contentClass,style:{"max-height":n.maxHeight,"max-width":n.maxWidth},"data-qa":`dt-collapsible--content`,tabindex:`-1`,appear:``},(0,i.toHandlers)(o.collapsibleListeners),{onAfterLeave:o.onLeaveTransitionComplete,onAfterEnter:o.onEnterTransitionComplete}),{default:(0,i.withCtx)(()=>[(0,i.renderSlot)(e.$slots,`content`)]),_:3},16,[`id`,`aria-hidden`,`aria-labelledby`,`aria-label`,`show`,`element-type`,`class`,`style`,`onAfterLeave`,`onAfterEnter`])]),_:3},16)}var u=t.t(o,[[`render`,l]]);exports.default=u;
|
|
2
2
|
//# sourceMappingURL=collapsible.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collapsible.cjs","names":[],"sources":["../../../components/Collapsible/Collapsible.vue"],"sourcesContent":["<template>\n <component\n :is=\"elementType\"\n ref=\"collapsible\"\n v-on=\"collapsibleListeners\"\n >\n <!-- Element for capturing keypress events -->\n <div\n :id=\"!ariaLabelledBy && labelledBy\"\n ref=\"anchor\"\n :class=\"anchorClass\"\n >\n <!-- @slot Slot for the anchor element that toggles the collapsible content -->\n <slot\n name=\"anchor\"\n :attrs=\"{\n 'aria-controls': id,\n 'aria-expanded': isOpen.toString(),\n 'role': 'button',\n }\"\n >\n <dt-button\n importance=\"clear\"\n kind=\"muted\"\n :aria-controls=\"id\"\n :aria-expanded=\"`${isOpen}`\"\n :style=\"{\n 'width': maxWidth,\n }\"\n @click=\"defaultToggleOpen\"\n >\n <dt-icon-chevron-down\n
|
|
1
|
+
{"version":3,"file":"collapsible.cjs","names":[],"sources":["../../../components/Collapsible/Collapsible.vue"],"sourcesContent":["<template>\n <component\n :is=\"elementType\"\n ref=\"collapsible\"\n v-on=\"collapsibleListeners\"\n >\n <!-- Element for capturing keypress events -->\n <div\n :id=\"!ariaLabelledBy && labelledBy\"\n ref=\"anchor\"\n :class=\"anchorClass\"\n >\n <!-- @slot Slot for the anchor element that toggles the collapsible content -->\n <slot\n name=\"anchor\"\n :attrs=\"{\n 'aria-controls': id,\n 'aria-expanded': isOpen.toString(),\n 'role': 'button',\n }\"\n >\n <dt-button\n importance=\"clear\"\n kind=\"muted\"\n :aria-controls=\"id\"\n :aria-expanded=\"`${isOpen}`\"\n :style=\"{\n 'width': maxWidth,\n }\"\n @click=\"defaultToggleOpen\"\n >\n <template #startIcon>\n <dt-icon-chevron-down\n v-if=\"isOpen\"\n class=\"d-collapsible__icon\"\n size=\"300\"\n />\n <dt-icon-chevron-right\n v-else\n class=\"d-collapsible__icon\"\n size=\"300\"\n />\n </template>\n <span\n class=\"d-collapsible__anchor-text\"\n :title=\"anchorText\"\n >\n {{ anchorText }}\n </span>\n </dt-button>\n </slot>\n </div>\n <dt-collapsible-lazy-show\n :id=\"id\"\n ref=\"contentWrapper\"\n :aria-hidden=\"`${!isOpen}`\"\n :aria-labelledby=\"labelledBy\"\n :aria-label=\"ariaLabel\"\n :show=\"isOpen\"\n :element-type=\"contentElementType\"\n :class=\"contentClass\"\n :style=\"{\n 'max-height': maxHeight,\n 'max-width': maxWidth,\n }\"\n data-qa=\"dt-collapsible--content\"\n tabindex=\"-1\"\n appear\n v-on=\"collapsibleListeners\"\n @after-leave=\"onLeaveTransitionComplete\"\n @after-enter=\"onEnterTransitionComplete\"\n >\n <!-- @slot Slot for the collapsible element that is expanded by the anchor -->\n <slot\n name=\"content\"\n />\n </dt-collapsible-lazy-show>\n </component>\n</template>\n\n<script>\nimport { extractVueListeners, getUniqueString, hasSlotContent } from '@/common/utils';\nimport DtCollapsibleLazyShow from './CollapsibleLazyShow.vue';\nimport { DtButton } from '@/components/Button';\nimport { DtIconChevronDown, DtIconChevronRight } from '@dialpad/dialtone-icons/vue';\n\n/**\n * A collapsible is a component consisting of an interactive anchor that toggled the expandable/collapsible element.\n * @see https://dialtone.dialpad.com/components/collapsible.html\n */\nexport default {\n name: 'DtCollapsible',\n\n components: {\n DtButton,\n DtCollapsibleLazyShow,\n DtIconChevronDown,\n DtIconChevronRight,\n },\n\n props: {\n /**\n * Text that is displayed on the anchor if nothing is passed in the slot.\n * Ignored if the anchor slot is used.\n */\n anchorText: {\n type: String,\n default: null,\n },\n\n /**\n * Controls whether the collapsible is shown. When null (default), the collapsible\n * starts expanded and toggles on click. When set to true or false, the default\n * trigger is disabled and the parent controls visibility via v-model:open.\n * @values null, true, false\n */\n open: {\n type: [Boolean, null],\n default: null,\n },\n\n /**\n * The id of the content wrapper.\n */\n id: {\n type: String,\n default () { return getUniqueString(); },\n },\n\n /**\n * HTML element type (tag name) of the root element of the component.\n */\n elementType: {\n type: String,\n default: 'div',\n },\n\n /**\n * HTML element type (tag name) of the content wrapper element.\n */\n contentElementType: {\n type: String,\n default: 'div',\n },\n\n /**\n * Additional class name for the anchor wrapper element.\n */\n anchorClass: {\n type: [String, Array, Object],\n default: null,\n },\n\n /**\n * Additional class name for the content wrapper element.\n */\n contentClass: {\n type: [String, Array, Object],\n default: null,\n },\n\n /**\n * The maximum width of the anchor and collapsible element.\n * Possible units rem|px|%|em\n */\n maxWidth: {\n type: String,\n default: null,\n },\n\n /**\n * The maximum height of the collapsible element.\n * Possible units rem|px|%|em\n */\n maxHeight: {\n type: String,\n default: null,\n },\n\n /**\n * Label on the collapsible content. Should provide this or ariaLabelledBy but not both.\n */\n ariaLabel: {\n type: String,\n default: null,\n },\n\n /**\n * Id of the element that labels the collapsible content. Defaults to the anchor element.\n * Should provide this or ariaLabel but not both.\n */\n ariaLabelledBy: {\n type: String,\n default: null,\n },\n },\n\n emits: [\n /**\n * Event fired to sync the open prop with the parent component\n * @event update:open\n */\n 'update:open',\n\n /**\n * Event fired when the content is shown or hidden\n *\n * @event opened\n * @type {Boolean}\n */\n 'opened',\n ],\n\n data () {\n return {\n isOpen: true,\n };\n },\n\n computed: {\n labelledBy () {\n // aria-labelledby should be set only if aria-labelledby is passed as a prop, or if\n // there is no aria-label and the labelledby should point to the anchor\n return this.ariaLabelledBy || (!this.ariaLabel && getUniqueString('DtCollapsible__anchor'));\n },\n\n collapsibleListeners () {\n return extractVueListeners(this.$attrs);\n },\n },\n\n watch: {\n open: {\n handler: function (open) {\n if (open !== null) {\n this.isOpen = open;\n }\n },\n\n immediate: true,\n },\n },\n\n created () {\n this.validateProperAnchor();\n },\n\n beforeUnmount () {\n this._isUnmounting = true;\n // Prevent transition callbacks from calling into dead lifecycle methods\n // after this component is torn down (DP-185811).\n },\n\n methods: {\n onLeaveTransitionComplete () {\n if (this._isUnmounting) return;\n this.$emit('opened', false);\n if (this.open !== null) {\n this.$emit('update:open', false);\n }\n },\n\n onEnterTransitionComplete () {\n if (this._isUnmounting) return;\n this.$emit('opened', true, this.$refs.content);\n if (this.open !== null) {\n this.$emit('update:open', true);\n }\n },\n\n defaultToggleOpen () {\n if (this.open === null) {\n this.toggleOpen();\n }\n },\n\n toggleOpen () {\n this.isOpen = !this.isOpen;\n },\n\n validateProperAnchor () {\n if (!this.anchorText && !hasSlotContent(this.$slots.anchor)) {\n console.error('anchor text and anchor slot content cannot both be falsy');\n }\n },\n },\n};\n</script>\n"],"mappings":"sXA0FA,IAAK,EAAU,CACb,KAAM,gBAEN,WAAY,CACV,SAAA,EAAA,QACA,sBAAA,EAAA,QACA,kBAAA,EAAA,kBACA,mBAAA,EAAA,mBACD,CAED,MAAO,CAKL,WAAY,CACV,KAAM,OACN,QAAS,KACV,CAQD,KAAM,CACJ,KAAM,CAAC,QAAS,KAAK,CACrB,QAAS,KACV,CAKD,GAAI,CACF,KAAM,OACN,SAAW,CAAE,OAAO,EAAA,iBAAiB,EACtC,C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maxWidth }),
|
|
131
131
|
onClick: a.defaultToggleOpen
|
|
132
132
|
}, {
|
|
133
|
-
|
|
133
|
+
startIcon: v(() => [i.isOpen ? (f(), o(y, {
|
|
134
134
|
key: 0,
|
|
135
135
|
class: "d-collapsible__icon",
|
|
136
136
|
size: "300"
|
|
@@ -138,7 +138,8 @@ function w(e, t, n, r, i, a) {
|
|
|
138
138
|
key: 1,
|
|
139
139
|
class: "d-collapsible__icon",
|
|
140
140
|
size: "300"
|
|
141
|
-
})),
|
|
141
|
+
}))]),
|
|
142
|
+
default: v(() => [s("span", {
|
|
142
143
|
class: "d-collapsible__anchor-text",
|
|
143
144
|
title: n.anchorText
|
|
144
145
|
}, g(n.anchorText), 9, C)]),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collapsible.js","names":[],"sources":["../../../components/Collapsible/Collapsible.vue"],"sourcesContent":["<template>\n <component\n :is=\"elementType\"\n ref=\"collapsible\"\n v-on=\"collapsibleListeners\"\n >\n <!-- Element for capturing keypress events -->\n <div\n :id=\"!ariaLabelledBy && labelledBy\"\n ref=\"anchor\"\n :class=\"anchorClass\"\n >\n <!-- @slot Slot for the anchor element that toggles the collapsible content -->\n <slot\n name=\"anchor\"\n :attrs=\"{\n 'aria-controls': id,\n 'aria-expanded': isOpen.toString(),\n 'role': 'button',\n }\"\n >\n <dt-button\n importance=\"clear\"\n kind=\"muted\"\n :aria-controls=\"id\"\n :aria-expanded=\"`${isOpen}`\"\n :style=\"{\n 'width': maxWidth,\n }\"\n @click=\"defaultToggleOpen\"\n >\n <dt-icon-chevron-down\n
|
|
1
|
+
{"version":3,"file":"collapsible.js","names":[],"sources":["../../../components/Collapsible/Collapsible.vue"],"sourcesContent":["<template>\n <component\n :is=\"elementType\"\n ref=\"collapsible\"\n v-on=\"collapsibleListeners\"\n >\n <!-- Element for capturing keypress events -->\n <div\n :id=\"!ariaLabelledBy && labelledBy\"\n ref=\"anchor\"\n :class=\"anchorClass\"\n >\n <!-- @slot Slot for the anchor element that toggles the collapsible content -->\n <slot\n name=\"anchor\"\n :attrs=\"{\n 'aria-controls': id,\n 'aria-expanded': isOpen.toString(),\n 'role': 'button',\n }\"\n >\n <dt-button\n importance=\"clear\"\n kind=\"muted\"\n :aria-controls=\"id\"\n :aria-expanded=\"`${isOpen}`\"\n :style=\"{\n 'width': maxWidth,\n }\"\n @click=\"defaultToggleOpen\"\n >\n <template #startIcon>\n <dt-icon-chevron-down\n v-if=\"isOpen\"\n class=\"d-collapsible__icon\"\n size=\"300\"\n />\n <dt-icon-chevron-right\n v-else\n class=\"d-collapsible__icon\"\n size=\"300\"\n />\n </template>\n <span\n class=\"d-collapsible__anchor-text\"\n :title=\"anchorText\"\n >\n {{ anchorText }}\n </span>\n </dt-button>\n </slot>\n </div>\n <dt-collapsible-lazy-show\n :id=\"id\"\n ref=\"contentWrapper\"\n :aria-hidden=\"`${!isOpen}`\"\n :aria-labelledby=\"labelledBy\"\n :aria-label=\"ariaLabel\"\n :show=\"isOpen\"\n :element-type=\"contentElementType\"\n :class=\"contentClass\"\n :style=\"{\n 'max-height': maxHeight,\n 'max-width': maxWidth,\n }\"\n data-qa=\"dt-collapsible--content\"\n tabindex=\"-1\"\n appear\n v-on=\"collapsibleListeners\"\n @after-leave=\"onLeaveTransitionComplete\"\n @after-enter=\"onEnterTransitionComplete\"\n >\n <!-- @slot Slot for the collapsible element that is expanded by the anchor -->\n <slot\n name=\"content\"\n />\n </dt-collapsible-lazy-show>\n </component>\n</template>\n\n<script>\nimport { extractVueListeners, getUniqueString, hasSlotContent } from '@/common/utils';\nimport DtCollapsibleLazyShow from './CollapsibleLazyShow.vue';\nimport { DtButton } from '@/components/Button';\nimport { DtIconChevronDown, DtIconChevronRight } from '@dialpad/dialtone-icons/vue';\n\n/**\n * A collapsible is a component consisting of an interactive anchor that toggled the expandable/collapsible element.\n * @see https://dialtone.dialpad.com/components/collapsible.html\n */\nexport default {\n name: 'DtCollapsible',\n\n components: {\n DtButton,\n DtCollapsibleLazyShow,\n DtIconChevronDown,\n DtIconChevronRight,\n },\n\n props: {\n /**\n * Text that is displayed on the anchor if nothing is passed in the slot.\n * Ignored if the anchor slot is used.\n */\n anchorText: {\n type: String,\n default: null,\n },\n\n /**\n * Controls whether the collapsible is shown. When null (default), the collapsible\n * starts expanded and toggles on click. When set to true or false, the default\n * trigger is disabled and the parent controls visibility via v-model:open.\n * @values null, true, false\n */\n open: {\n type: [Boolean, null],\n default: null,\n },\n\n /**\n * The id of the content wrapper.\n */\n id: {\n type: String,\n default () { return getUniqueString(); },\n },\n\n /**\n * HTML element type (tag name) of the root element of the component.\n */\n elementType: {\n type: String,\n default: 'div',\n },\n\n /**\n * HTML element type (tag name) of the content wrapper element.\n */\n contentElementType: {\n type: String,\n default: 'div',\n },\n\n /**\n * Additional class name for the anchor wrapper element.\n */\n anchorClass: {\n type: [String, Array, Object],\n default: null,\n },\n\n /**\n * Additional class name for the content wrapper element.\n */\n contentClass: {\n type: [String, Array, Object],\n default: null,\n },\n\n /**\n * The maximum width of the anchor and collapsible element.\n * Possible units rem|px|%|em\n */\n maxWidth: {\n type: String,\n default: null,\n },\n\n /**\n * The maximum height of the collapsible element.\n * Possible units rem|px|%|em\n */\n maxHeight: {\n type: String,\n default: null,\n },\n\n /**\n * Label on the collapsible content. Should provide this or ariaLabelledBy but not both.\n */\n ariaLabel: {\n type: String,\n default: null,\n },\n\n /**\n * Id of the element that labels the collapsible content. Defaults to the anchor element.\n * Should provide this or ariaLabel but not both.\n */\n ariaLabelledBy: {\n type: String,\n default: null,\n },\n },\n\n emits: [\n /**\n * Event fired to sync the open prop with the parent component\n * @event update:open\n */\n 'update:open',\n\n /**\n * Event fired when the content is shown or hidden\n *\n * @event opened\n * @type {Boolean}\n */\n 'opened',\n ],\n\n data () {\n return {\n isOpen: true,\n };\n },\n\n computed: {\n labelledBy () {\n // aria-labelledby should be set only if aria-labelledby is passed as a prop, or if\n // there is no aria-label and the labelledby should point to the anchor\n return this.ariaLabelledBy || (!this.ariaLabel && getUniqueString('DtCollapsible__anchor'));\n },\n\n collapsibleListeners () {\n return extractVueListeners(this.$attrs);\n },\n },\n\n watch: {\n open: {\n handler: function (open) {\n if (open !== null) {\n this.isOpen = open;\n }\n },\n\n immediate: true,\n },\n },\n\n created () {\n this.validateProperAnchor();\n },\n\n beforeUnmount () {\n this._isUnmounting = true;\n // Prevent transition callbacks from calling into dead lifecycle methods\n // after this component is torn down (DP-185811).\n },\n\n methods: {\n onLeaveTransitionComplete () {\n if (this._isUnmounting) return;\n this.$emit('opened', false);\n if (this.open !== null) {\n this.$emit('update:open', false);\n }\n },\n\n onEnterTransitionComplete () {\n if (this._isUnmounting) return;\n this.$emit('opened', true, this.$refs.content);\n if (this.open !== null) {\n this.$emit('update:open', true);\n }\n },\n\n defaultToggleOpen () {\n if (this.open === null) {\n this.toggleOpen();\n }\n },\n\n toggleOpen () {\n this.isOpen = !this.isOpen;\n },\n\n validateProperAnchor () {\n if (!this.anchorText && !hasSlotContent(this.$slots.anchor)) {\n console.error('anchor text and anchor slot content cannot both be falsy');\n }\n },\n },\n};\n</script>\n"],"mappings":";;;;;;;AA0FA,IAAK,IAAU;CACb,MAAM;CAEN,YAAY;EACV,UAAA;EACA,uBAAA;EACA;EACA;EACD;CAED,OAAO;EAKL,YAAY;GACV,MAAM;GACN,SAAS;GACV;EAQD,MAAM;GACJ,MAAM,CAAC,SAAS,KAAK;GACrB,SAAS;GACV;EAKD,IAAI;GACF,MAAM;GACN,UAAW;AAAE,WAAO,GAAiB;;GACtC;EAKD,aAAa;GACX,MAAM;GACN,SAAS;GACV;EAKD,oBAAoB;GAClB,MAAM;GACN,SAAS;GACV;EAKD,aAAa;GACX,MAAM;IAAC;IAAQ;IAAO;IAAO;GAC7B,SAAS;GACV;EAKD,cAAc;GACZ,MAAM;IAAC;IAAQ;IAAO;IAAO;GAC7B,SAAS;GACV;EAMD,UAAU;GACR,MAAM;GACN,SAAS;GACV;EAMD,WAAW;GACT,MAAM;GACN,SAAS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OAAO,UAAQ;;aAmC9E,CA7BL,EA4BY,GAAA;GA3BV,YAAW;GACX,MAAK;GACJ,iBAAe,EAAA;GACf,iBAAa,GAAK,EAAA;GAClB,OAAK,EAAA,EAAA,OAAyB,EAAA,UAAA,CAAA;GAG9B,SAAO,EAAA;;GAEG,WAAS,QAKhB,CAHM,EAAA,UAAA,GAAA,EADR,EAIE,GAAA;;IAFA,OAAM;IACN,MAAK;eAEP,EAIE,GAAA;;IAFA,OAAM;IACN,MAAK;;oBAQF,CALP,EAKO,QAAA;IAJL,OAAM;IACL,OAAO,EAAA;QAEL,EAAA,WAAU,EAAA,GAAA,EAAA,CAAA,CAAA;;;;;;;iBAKrB,EAwB2B,GAxB3B,EAwB2B;GAvBxB,IAAI,EAAA;GACL,KAAI;GACH,eAAW,GAAA,CAAM,EAAA;GACjB,mBAAiB,EAAA;GACjB,cAAY,EAAA;GACZ,MAAM,EAAA;GACN,gBAAc,EAAA;GACd,OAAO,EAAA;GACP,OAAK;kBAA0B,EAAA;iBAAgC,EAAA;;GAIhE,WAAQ;GACR,UAAS;GACT,QAAA;KACA,EAA2B,EAArB,qBAAoB,EAAA;GACzB,cAAa,EAAA;GACb,cAAa,EAAA;;oBAKZ,CAFF,EAEE,EAAA,QAAA,UAAA,CAAA,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"combobox-multi-select-constants.cjs","names":[],"sources":["../../../components/ComboboxMultiSelect/ComboboxMultiSelectConstants.js"],"sourcesContent":["export const MULTI_SELECT_SIZES = {\n // Chip has no 'lg' and 'xl' size. So we don't support that in multi-select.\n EXTRA_SMALL: 'xs',\n SMALL: 'sm',\n DEFAULT: 'md',\n};\n\nexport const CHIP_SIZES = {\n // Numeric (preferred)\n 100: 'xs',\n 200: 'xs',\n 300: 'sm',\n // T-shirt aliases (deprecated)\n xs: 'xs',\n sm: 'xs',\n md: 'sm',\n};\n\n
|
|
1
|
+
{"version":3,"file":"combobox-multi-select-constants.cjs","names":[],"sources":["../../../components/ComboboxMultiSelect/ComboboxMultiSelectConstants.js"],"sourcesContent":["export const MULTI_SELECT_SIZES = {\n // Chip has no 'lg' and 'xl' size. So we don't support that in multi-select.\n EXTRA_SMALL: 'xs',\n SMALL: 'sm',\n DEFAULT: 'md',\n};\n\nexport const CHIP_SIZES = {\n // Numeric (preferred)\n 100: 'xs',\n 200: 'xs',\n 300: 'sm',\n // T-shirt aliases (deprecated)\n xs: 'xs',\n sm: 'xs',\n md: 'sm',\n};\n\n/**\n * @deprecated No longer used. Chip vertical alignment is computed geometrically\n * in DtComboboxMultiSelect rather than read from this table. Kept only so the\n * public export does not disappear; it will be removed in the next major.\n */\nexport const CHIP_TOP_POSITION = {\n // Numeric (preferred)\n 100: 1.4,\n 200: 0.4,\n 300: 0.2,\n // T-shirt aliases (deprecated)\n xs: 1.4,\n sm: -0.1,\n md: -0.3,\n};\n\nexport default {\n MULTI_SELECT_SIZES,\n CHIP_SIZES,\n CHIP_TOP_POSITION,\n};\n"],"mappings":"+FAAA,IAAa,EAAqB,CAEhC,YAAa,KACb,MAAO,KACP,QAAS,KACV,CAEY,EAAa,CAExB,IAAK,KACL,IAAK,KACL,IAAK,KAEL,GAAI,KACJ,GAAI,KACJ,GAAI,KACL,CAOY,EAAoB,CAE/B,IAAK,IACL,IAAK,GACL,IAAK,GAEL,GAAI,IACJ,GAAI,IACJ,GAAI,IACL,CAED,EAAe,CACb,qBACA,aACA,oBACD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"combobox-multi-select-constants.js","names":[],"sources":["../../../components/ComboboxMultiSelect/ComboboxMultiSelectConstants.js"],"sourcesContent":["export const MULTI_SELECT_SIZES = {\n // Chip has no 'lg' and 'xl' size. So we don't support that in multi-select.\n EXTRA_SMALL: 'xs',\n SMALL: 'sm',\n DEFAULT: 'md',\n};\n\nexport const CHIP_SIZES = {\n // Numeric (preferred)\n 100: 'xs',\n 200: 'xs',\n 300: 'sm',\n // T-shirt aliases (deprecated)\n xs: 'xs',\n sm: 'xs',\n md: 'sm',\n};\n\n
|
|
1
|
+
{"version":3,"file":"combobox-multi-select-constants.js","names":[],"sources":["../../../components/ComboboxMultiSelect/ComboboxMultiSelectConstants.js"],"sourcesContent":["export const MULTI_SELECT_SIZES = {\n // Chip has no 'lg' and 'xl' size. So we don't support that in multi-select.\n EXTRA_SMALL: 'xs',\n SMALL: 'sm',\n DEFAULT: 'md',\n};\n\nexport const CHIP_SIZES = {\n // Numeric (preferred)\n 100: 'xs',\n 200: 'xs',\n 300: 'sm',\n // T-shirt aliases (deprecated)\n xs: 'xs',\n sm: 'xs',\n md: 'sm',\n};\n\n/**\n * @deprecated No longer used. Chip vertical alignment is computed geometrically\n * in DtComboboxMultiSelect rather than read from this table. Kept only so the\n * public export does not disappear; it will be removed in the next major.\n */\nexport const CHIP_TOP_POSITION = {\n // Numeric (preferred)\n 100: 1.4,\n 200: 0.4,\n 300: 0.2,\n // T-shirt aliases (deprecated)\n xs: 1.4,\n sm: -0.1,\n md: -0.3,\n};\n\nexport default {\n MULTI_SELECT_SIZES,\n CHIP_SIZES,\n CHIP_TOP_POSITION,\n};\n"],"mappings":";AAAA,IAAa,IAAqB;CAEhC,aAAa;CACb,OAAO;CACP,SAAS;CACV,EAEY,IAAa;CAExB,KAAK;CACL,KAAK;CACL,KAAK;CAEL,IAAI;CACJ,IAAI;CACJ,IAAI;CACL,EAOY,IAAoB;CAE/B,KAAK;CACL,KAAK;CACL,KAAK;CAEL,IAAI;CACJ,IAAI;CACJ,IAAI;CACL,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/constants/sizes.cjs`),t=require(`../../common/constants/index.cjs`),n=require(`../../common/validators/index.cjs`),r=require(`../../common/utils/index.cjs`),i=require(`../../_plugin-vue_export-helper-D8jCH6HB.cjs`),a=require(`../validation-messages/validation-messages.cjs`),o=require(`../chip/chip.cjs`),s=require(`../popover/popover-constants.cjs`),c=require(`../input/input.cjs`),l=require(`../combobox-with-popover/combobox-with-popover.cjs`),u=require(`./combobox-multi-select-constants.cjs`);let d=require(`vue`);var f={name:`DtComboboxMultiSelect`,components:{DtComboboxWithPopover:l.default,DtInput:c.default,DtChip:o.default,DtValidationMessages:a.default},inheritAttrs:!1,props:{label:{type:String,required:!0},showLabel:{type:Boolean,default:!0},description:{type:String,default:``},placeholder:{type:String,default:`Select one or start typing`},inputMessages:{type:Array,default:()=>[],validator:e=>n.validationMessageValidator(e)},showInputMessages:{type:Boolean,default:!0},loading:{type:Boolean,default:!1},loadingMessage:{type:String,default:`loading...`},showList:{type:Boolean,default:null},listMaxHeight:{type:String,default:`300px`},selectedItems:{type:Array,default:function(){return[]}},maxSelected:{type:Number,default:0},maxSelectedMessage:{type:Array,default:function(){return[]}},hasSuggestionList:{type:Boolean,default:!0},size:{type:[String,Number],default:300,validator:n.ordinalSizeValidator(u.CHIP_SIZES)},appendTo:{type:[t.HTML_ELEMENT_TYPE,String],default:`body`,validator:e=>s.POPOVER_APPEND_TO_VALUES.includes(e)||e instanceof HTMLElement},transition:{type:String,default:`fade`},collapseOnFocusOut:{type:Boolean,default:!1},listMaxWidth:{type:String,default:``},reservedRightSpace:{type:Number,default:64},chipMaxWidth:{type:String,default:``},inputClass:{type:[String,Object,Array],default:``},inputWrapperClass:{type:[String,Object,Array],default:``},disabled:{type:Boolean,default:!1},headerClass:{type:[String,Array,Object],default:``},footerClass:{type:[String,Array,Object],default:``},listClass:{type:[String,Array,Object],default:``},dialogClass:{type:[String,Object,Array],default:``}},emits:[`update:modelValue`,`select`,`remove`,`max-selected`,`keydown`,`chip-keydown`,`escape`,`enter`,`combobox-highlight`],data(){return{value:``,popoverOffset:[0,4],showValidationMessages:!1,resizeWindowObserver:null,initialInputHeight:null,CHIP_SIZES:u.CHIP_SIZES,hasSlotContent:r.hasSlotContent,inputFocused:!1,hideInputText:!1,messagesId:r.getUniqueString()}},computed:{inputPlaceHolder(){return this.selectedItems?.length>0?``:this.placeholder},chipListeners(){return{keydown:e=>{this.disabled||(this.onChipKeyDown(e),this.$emit(`chip-keydown`,e))}}},inputListeners(){return{...r.extractVueListeners(this.$attrs),onInput:e=>{this.$emit(`update:modelValue`,e),this.hasSuggestionList&&this.showComboboxList()},onKeydown:e=>{if(this.disabled)return;this.onInputKeyDown(e),this.$emit(`keydown`,e);let t=e.key?.toLowerCase();t===`escape`?this.$emit(`escape`,e):t===`enter`&&this.$emit(`enter`,e)},onClick:()=>{this.hasSuggestionList&&this.showComboboxList()}}},ariaInvalid(){return r.getValidationState(this.maxSelectedMessage)===t.VALIDATION_MESSAGE_TYPES.CRITICAL?`true`:void 0},ariaDescribedBy(){return this.showValidationMessages&&this.maxSelectedMessage.length>0?this.messagesId:void 0},chipWrapperClass(){return{[`d-combobox-multi-select__chip-wrapper-${e.COMPONENT_SIZES[String(this.size)]||this.size}--collapsed`]:!this.inputFocused&&this.collapseOnFocusOut}}},watch:{selectedItems:{deep:!0,handler:async function(){await this.initSelectedItems()}},chipMaxWidth:{async handler(){await this.initSelectedItems()}},async label(){await this.$nextTick(),this.setChipsTopPosition()},async description(){await this.$nextTick(),this.setChipsTopPosition()},size:{async handler(){await this.$nextTick();let e=this.getInput();this.revertInputPadding(e),this.setInitialInputHeight(),this.setInputPadding(),this.setChipsTopPosition()}}},async mounted(){this.setInitialInputHeight(),this.resizeWindowObserver=new ResizeObserver(async()=>{this.setChipsTopPosition(),this.setInputPadding()}),this.resizeWindowObserver.observe(document.body),await this.initSelectedItems()},beforeUnmount(){this.resizeWindowObserver?.unobserve(document.body)},methods:{extractNonListeners:r.extractNonListeners,comboboxHighlight(e){this.$emit(`combobox-highlight`,e)},async initSelectedItems(){await this.$nextTick(),this.setInputPadding(),this.setChipsTopPosition(),this.setInputMinWidth(),this.checkMaxSelected()},onChipRemove(e){this.$emit(`remove`,e),this.$refs.input?.focus()},onComboboxSelect(e){this.loading||(this.value=``,this.$emit(`select`,e))},showComboboxList(){this.showList??this.$refs.comboboxWithPopover?.showComboboxList()},closeComboboxList(){this.showList??this.$refs.comboboxWithPopover?.closeComboboxList()},getChips(){if(!this.selectedItems.length||!this.$refs.chips)return null;let e=new Set;return this.selectedItems.map(t=>this.$refs.chips.find((n,i)=>e.has(i)?!1:r.returnFirstEl(n.$el)?.querySelector(`.d-chip__label`)?.textContent?.trim()===t?(e.add(i),!0):!1)).filter(Boolean).map(e=>r.returnFirstEl(e.$el))},getChipButtons(){let e=this.getChips();return e&&e.map(e=>r.returnFirstEl(e).querySelector(`button`))},getLastChipButton(){let e=this.getChipButtons();return e&&e[e.length-1]},getLastChip(){let e=this.getChips();return e&&e[e.length-1]},getFirstChip(){let e=this.getChips();return e&&e[0]},getInput(){return this.$refs.input?.$refs.input},onChipKeyDown(e){let t=e.code?.toLowerCase();t===`arrowleft`?this.navigateBetweenChips(e.target,!0):t===`arrowright`&&(e.target.id===this.getLastChipButton().id?this.moveFromChipToInput():this.navigateBetweenChips(e.target,!1))},onInputKeyDown(e){let t=e.key?.toLowerCase();if(this.selectedItems.length>0&&e.target.selectionStart===0){if(e.target.selectionEnd!==e.target.selectionStart)return;(t===`backspace`||t===`arrowleft`)&&this.moveFromInputToChip()}},moveFromInputToChip(){this.getLastChipButton().focus(),this.$refs.input?.blur(),this.closeComboboxList()},moveFromChipToInput(){this.getLastChipButton().blur(),this.$refs.input?.focus(),this.showComboboxList()},navigateBetweenChips(e,t){let n=this.getChipButtons().indexOf(e),r=t?n-1:n+1;r<0||r>=this.$refs.chips?.length||(this.getChipButtons()[n].blur(),this.getChipButtons()[r].focus(),this.closeComboboxList())},setChipsTopPosition(){let e=this.getInput();if(!e)return;let t=this.$refs.inputSlotWrapper,n=e.getBoundingClientRect().top-t.getBoundingClientRect().top,r=this.$refs.chipsWrapper;r.style.top=n-u.CHIP_TOP_POSITION[String(this.size)]+`px`},setInputPadding(){let e=this.getLastChip(),t=this.getInput();if(!t||(this.revertInputPadding(t),this.popoverOffset=[0,4],!e)||this.collapseOnFocusOut&&!this.inputFocused)return;let n=e.offsetLeft+this.getFullWidth(e),r=t.getBoundingClientRect().width-n,i=this.getFirstChip(),a=i&&e.offsetTop>i.offsetTop;r>this.reservedRightSpace?t.style.paddingInlineStart=n+`px`:t.style.paddingInlineStart=`4px`;let o=this.getInputPaddingTop(e,r>this.reservedRightSpace,a);o!=null&&(t.style.paddingTop=`${o}px`)},getInputPaddingTop(e,t,n){if(t&&!n)return null;if(t)return e.offsetTop+2;let r=parseFloat(getComputedStyle(e).marginTop)||0,i=e.getBoundingClientRect().height;return e.offsetTop+i+r+2},revertInputPadding(e){e.style.paddingInlineStart=``,e.style.paddingBlockStart=``,e.style.paddingBlockEnd=``},getFullWidth(e){let t=window.getComputedStyle(e);return e.offsetWidth+parseInt(t.marginLeft)+parseInt(t.marginRight)},setInputMinWidth(){let e=this.getFirstChip(),t=this.getInput();t&&(e?t.style.minWidth=this.getFullWidth(e)+4+`px`:t.style.minWidth=``)},checkMaxSelected(){this.maxSelected!==0&&(this.selectedItems.length>this.maxSelected?(this.showValidationMessages=!0,this.$emit(`max-selected`)):this.showValidationMessages=!1)},setInitialInputHeight(){let e=this.getInput();e&&(e.style.minHeight=``,e.style.height=``,this.initialInputHeight=e.getBoundingClientRect().height,this.size!==`xs`&&(e.style.minHeight=`${this.initialInputHeight}px`,e.style.height=`auto`))},async handleInputFocusIn(){this.inputFocused=!0,this.collapseOnFocusOut&&(this.hideInputText=!1,await this.$nextTick(),this.setInputPadding())},async handleInputFocusOut(){if(this.inputFocused=!1,this.collapseOnFocusOut){this.hideInputText=!0;let e=this.getInput();if(!e||!e.style.paddingTop)return;this.revertInputPadding(e)}}}},p={key:1,class:`d-combobox-multi-select__list--loading`};function m(e,t,n,r,i,a){let o=(0,d.resolveComponent)(`dt-chip`),s=(0,d.resolveComponent)(`dt-input`),c=(0,d.resolveComponent)(`dt-validation-messages`),l=(0,d.resolveComponent)(`dt-combobox-with-popover`);return(0,d.openBlock)(),(0,d.createBlock)(l,(0,d.mergeProps)({ref:`comboboxWithPopover`,label:n.label,"show-list":n.showList,"max-height":n.listMaxHeight,"max-width":n.listMaxWidth,"popover-offset":i.popoverOffset,"has-suggestion-list":n.hasSuggestionList,"content-width":`anchor`,"append-to":n.appendTo,"dialog-class":n.dialogClass,transition:n.transition},a.extractNonListeners(e.$attrs),{onSelect:a.onComboboxSelect,onHighlight:a.comboboxHighlight}),(0,d.createSlots)({input:(0,d.withCtx)(({onInput:e})=>[(0,d.createElementVNode)(`span`,{ref:`inputSlotWrapper`,class:`d-combobox-multi-select__input-wrapper`,onFocusin:t[1]||(t[1]=(...e)=>a.handleInputFocusIn&&a.handleInputFocusIn(...e)),onFocusout:t[2]||(t[2]=(...e)=>a.handleInputFocusOut&&a.handleInputFocusOut(...e))},[(0,d.createElementVNode)(`span`,{ref:`chipsWrapper`,class:(0,d.normalizeClass)([`d-combobox-multi-select__chip-wrapper`,a.chipWrapperClass])},[((0,d.openBlock)(!0),(0,d.createElementBlock)(d.Fragment,null,(0,d.renderList)(n.selectedItems,(e,t)=>((0,d.openBlock)(),(0,d.createBlock)(o,(0,d.mergeProps)({ref_for:!0,ref:`chips`,key:`${t}-${e}`,interactive:!0,"label-class":[`d-chip__label`],class:[`d-combobox-multi-select__chip`,{"d-combobox-multi-select__chip--truncate":!!n.chipMaxWidth}],style:{maxWidth:n.chipMaxWidth},size:i.CHIP_SIZES[String(n.size)],disabled:n.disabled},(0,d.toHandlers)(a.chipListeners),{onKeydown:(0,d.withKeys)(t=>a.onChipRemove(e),[`backspace`]),onClose:t=>a.onChipRemove(e)}),{default:(0,d.withCtx)(()=>[(0,d.createTextVNode)((0,d.toDisplayString)(e),1)]),_:2},1040,[`class`,`style`,`size`,`disabled`,`onKeydown`,`onClose`]))),128))],2),(0,d.createVNode)(s,(0,d.mergeProps)({ref:`input`,modelValue:i.value,"onUpdate:modelValue":t[0]||(t[0]=e=>i.value=e),class:`d-combobox-multi-select__input`,"input-class":[n.inputClass,{"d-combobox-multi-select__input--hidden":i.hideInputText}],"input-wrapper-class":n.inputWrapperClass,disabled:n.disabled,"aria-label":n.label,"aria-invalid":a.ariaInvalid,"aria-describedby":a.ariaDescribedBy,label:n.showLabel?n.label:``,description:n.description,placeholder:a.inputPlaceHolder,"show-messages":n.showInputMessages,messages:n.inputMessages,size:n.size},a.inputListeners,{"onUpdate:modelValue":e}),null,16,[`modelValue`,`input-class`,`input-wrapper-class`,`disabled`,`aria-label`,`aria-invalid`,`aria-describedby`,`label`,`description`,`placeholder`,`show-messages`,`messages`,`size`,`onUpdate:modelValue`]),(0,d.createVNode)(c,{id:i.messagesId,"validation-messages":n.maxSelectedMessage,"show-messages":i.showValidationMessages},null,8,[`id`,`validation-messages`,`show-messages`])],544)]),list:(0,d.withCtx)(()=>[(0,d.createElementVNode)(`div`,{ref:`list`,class:(0,d.normalizeClass)([`d-combobox-multi-select__list`,n.listClass]),onMousedown:t[3]||(t[3]=(0,d.withModifiers)(()=>{},[`prevent`]))},[n.loading?((0,d.openBlock)(),(0,d.createElementBlock)(`div`,p,(0,d.toDisplayString)(n.loadingMessage),1)):(0,d.renderSlot)(e.$slots,`list`,{key:0})],34)]),_:2},[i.hasSlotContent(e.$slots.header)?{name:`header`,fn:(0,d.withCtx)(()=>[(0,d.createElementVNode)(`div`,{ref:`header`,class:(0,d.normalizeClass)(n.headerClass)},[(0,d.renderSlot)(e.$slots,`header`)],2)]),key:`0`}:void 0,i.hasSlotContent(e.$slots.footer)?{name:`footer`,fn:(0,d.withCtx)(()=>[(0,d.createElementVNode)(`div`,{ref:`footer`,class:(0,d.normalizeClass)(n.footerClass)},[(0,d.renderSlot)(e.$slots,`footer`)],2)]),key:`1`}:void 0]),1040,[`label`,`show-list`,`max-height`,`max-width`,`popover-offset`,`has-suggestion-list`,`append-to`,`dialog-class`,`transition`,`onSelect`,`onHighlight`])}var h=i.t(f,[[`render`,m]]);exports.default=h;
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}}),require(`../../chunk-Bmb41Sf3.cjs`);const e=require(`../../common/constants/sizes.cjs`),t=require(`../../common/constants/index.cjs`),n=require(`../../common/validators/index.cjs`),r=require(`../../common/utils/index.cjs`),i=require(`../../_plugin-vue_export-helper-D8jCH6HB.cjs`),a=require(`../validation-messages/validation-messages.cjs`),o=require(`../chip/chip.cjs`),s=require(`../popover/popover-constants.cjs`),c=require(`../input/input.cjs`),l=require(`../combobox-with-popover/combobox-with-popover.cjs`),u=require(`./combobox-multi-select-constants.cjs`);let d=require(`vue`);var f={name:`DtComboboxMultiSelect`,components:{DtComboboxWithPopover:l.default,DtInput:c.default,DtChip:o.default,DtValidationMessages:a.default},inheritAttrs:!1,props:{label:{type:String,required:!0},showLabel:{type:Boolean,default:!0},description:{type:String,default:``},placeholder:{type:String,default:`Select one or start typing`},inputMessages:{type:Array,default:()=>[],validator:e=>n.validationMessageValidator(e)},showInputMessages:{type:Boolean,default:!0},loading:{type:Boolean,default:!1},loadingMessage:{type:String,default:`loading...`},showList:{type:Boolean,default:null},listMaxHeight:{type:String,default:`300px`},selectedItems:{type:Array,default:function(){return[]}},maxSelected:{type:Number,default:0},maxSelectedMessage:{type:Array,default:function(){return[]}},hasSuggestionList:{type:Boolean,default:!0},size:{type:[String,Number],default:300,validator:n.ordinalSizeValidator(u.CHIP_SIZES)},appendTo:{type:[t.HTML_ELEMENT_TYPE,String],default:`body`,validator:e=>s.POPOVER_APPEND_TO_VALUES.includes(e)||e instanceof HTMLElement},transition:{type:String,default:`fade`},collapseOnFocusOut:{type:Boolean,default:!1},listMaxWidth:{type:String,default:``},reservedRightSpace:{type:Number,default:64},chipMaxWidth:{type:String,default:``},inputClass:{type:[String,Object,Array],default:``},inputWrapperClass:{type:[String,Object,Array],default:``},disabled:{type:Boolean,default:!1},headerClass:{type:[String,Array,Object],default:``},footerClass:{type:[String,Array,Object],default:``},listClass:{type:[String,Array,Object],default:``},dialogClass:{type:[String,Object,Array],default:``}},emits:[`update:modelValue`,`select`,`remove`,`max-selected`,`keydown`,`chip-keydown`,`escape`,`enter`,`combobox-highlight`],data(){return{value:``,popoverOffset:[0,4],showValidationMessages:!1,resizeWindowObserver:null,initialInputHeight:null,CHIP_SIZES:u.CHIP_SIZES,hasSlotContent:r.hasSlotContent,inputFocused:!1,hideInputText:!1,messagesId:r.getUniqueString()}},computed:{inputPlaceHolder(){return this.selectedItems?.length>0?``:this.placeholder},chipListeners(){return{keydown:e=>{this.disabled||(this.onChipKeyDown(e),this.$emit(`chip-keydown`,e))}}},inputListeners(){return{...r.extractVueListeners(this.$attrs),onInput:e=>{this.$emit(`update:modelValue`,e),this.hasSuggestionList&&this.showComboboxList()},onKeydown:e=>{if(this.disabled)return;this.onInputKeyDown(e),this.$emit(`keydown`,e);let t=e.key?.toLowerCase();t===`escape`?this.$emit(`escape`,e):t===`enter`&&this.$emit(`enter`,e)},onClick:()=>{this.hasSuggestionList&&this.showComboboxList()}}},ariaInvalid(){return r.getValidationState(this.maxSelectedMessage)===t.VALIDATION_MESSAGE_TYPES.CRITICAL?`true`:void 0},ariaDescribedBy(){return this.showValidationMessages&&this.maxSelectedMessage.length>0?this.messagesId:void 0},inputHeightFloor(){return this.initialInputHeight&&this.size!==`xs`?`${this.initialInputHeight}px`:``},chipWrapperClass(){let t=e.COMPONENT_SIZES[String(this.size)]||this.size;return[`d-combobox-multi-select__chip-wrapper--${t}`,{[`d-combobox-multi-select__chip-wrapper-${t}--collapsed`]:!this.inputFocused&&this.collapseOnFocusOut}]}},watch:{selectedItems:{deep:!0,handler:async function(){await this.initSelectedItems()}},chipMaxWidth:{async handler(){await this.initSelectedItems()}},async label(){await this.$nextTick(),this.setChipsTopPosition()},async description(){await this.$nextTick(),this.setChipsTopPosition()},size:{async handler(){await this.$nextTick();let e=this.getInput();this.revertInputPadding(e),this.setInitialInputHeight(),this.setInputPadding(),this.setChipsTopPosition()}}},async mounted(){this.setInitialInputHeight(),this.resizeWindowObserver=new ResizeObserver(async()=>{this.setChipsTopPosition(),this.setInputPadding()}),this.resizeWindowObserver.observe(document.body),await this.initSelectedItems()},beforeUnmount(){this.resizeWindowObserver?.unobserve(document.body)},methods:{extractNonListeners:r.extractNonListeners,comboboxHighlight(e){this.$emit(`combobox-highlight`,e)},async initSelectedItems(){await this.$nextTick(),this.setInputPadding(),this.setChipsTopPosition(),this.setInputMinWidth(),this.checkMaxSelected()},onChipRemove(e){this.$emit(`remove`,e),this.$refs.input?.focus()},onComboboxSelect(e){this.loading||(this.value=``,this.$emit(`select`,e))},showComboboxList(){this.showList??this.$refs.comboboxWithPopover?.showComboboxList()},closeComboboxList(){this.showList??this.$refs.comboboxWithPopover?.closeComboboxList()},getChips(){if(!this.selectedItems.length||!this.$refs.chips)return null;let e=new Set;return this.selectedItems.map(t=>this.$refs.chips.find((n,i)=>e.has(i)?!1:r.returnFirstEl(n.$el)?.querySelector(`.d-chip__label`)?.textContent?.trim()===t?(e.add(i),!0):!1)).filter(Boolean).map(e=>r.returnFirstEl(e.$el))},getChipButtons(){let e=this.getChips();return e&&e.map(e=>r.returnFirstEl(e).querySelector(`button`))},getLastChipButton(){let e=this.getChipButtons();return e&&e[e.length-1]},getLastChip(){let e=this.getChips();return e&&e[e.length-1]},getFirstChip(){let e=this.getChips();return e&&e[0]},getInput(){return this.$refs.input?.$refs.input},onChipKeyDown(e){let t=e.code?.toLowerCase();t===`arrowleft`?this.navigateBetweenChips(e.target,!0):t===`arrowright`&&(e.target.id===this.getLastChipButton().id?this.moveFromChipToInput():this.navigateBetweenChips(e.target,!1))},onInputKeyDown(e){let t=e.key?.toLowerCase();if(this.selectedItems.length>0&&e.target.selectionStart===0){if(e.target.selectionEnd!==e.target.selectionStart)return;(t===`backspace`||t===`arrowleft`)&&this.moveFromInputToChip()}},moveFromInputToChip(){this.getLastChipButton().focus(),this.$refs.input?.blur(),this.closeComboboxList()},moveFromChipToInput(){this.getLastChipButton().blur(),this.$refs.input?.focus(),this.showComboboxList()},navigateBetweenChips(e,t){let n=this.getChipButtons().indexOf(e),r=t?n-1:n+1;r<0||r>=this.$refs.chips?.length||(this.getChipButtons()[n].blur(),this.getChipButtons()[r].focus(),this.closeComboboxList())},setChipsTopPosition(){let e=this.getInput(),t=this.$refs.chipsWrapper,n=this.getFirstChip();if(!e||!t||!n)return;let r=e.getBoundingClientRect().top-this.$refs.inputSlotWrapper.getBoundingClientRect().top,i=this.initialInputHeight||e.getBoundingClientRect().height,a=n.getBoundingClientRect(),o=a.top-t.getBoundingClientRect().top,s=r+(i-a.height)/2-o;t.style.top=s+`px`},setInputPadding(){let e=this.getLastChip(),t=this.getInput();if(!t||(this.revertInputPadding(t),this.popoverOffset=[0,4],!e)||this.collapseOnFocusOut&&!this.inputFocused)return;let n=this.getComputedPx(t,`paddingTop`),r=e.offsetLeft+this.getFullWidth(e),i=t.getBoundingClientRect().width-r,a=this.getFirstChip(),o=a&&e.offsetTop>a.offsetTop;i>this.reservedRightSpace?t.style.paddingInlineStart=r+`px`:t.style.paddingInlineStart=`4px`;let s=this.getCaretRowTop(e,a,i>this.reservedRightSpace,o);s!=null&&(t.style.paddingTop=`${s+n}px`,this.growInputForWrappedRows(t,s))},growInputForWrappedRows(e,t){this.initialInputHeight&&(e.style.minHeight=`${t+this.initialInputHeight}px`)},getComputedPx(e,t){return parseFloat(getComputedStyle(e)[t])||0},getCaretRowTop(e,t,n,r){if(n&&!r)return null;let i=e.getBoundingClientRect().top-t.getBoundingClientRect().top;if(n)return i;let a=this.getComputedPx(this.$refs.chipsWrapper,`rowGap`);return i+e.getBoundingClientRect().height+a},revertInputPadding(e){e.style.paddingInlineStart=``,e.style.paddingTop=``,e.style.minHeight=this.inputHeightFloor},getFullWidth(e){let t=window.getComputedStyle(e);return e.offsetWidth+parseInt(t.marginLeft)+parseInt(t.marginRight)},setInputMinWidth(){let e=this.getFirstChip(),t=this.getInput();t&&(e?t.style.minWidth=this.getFullWidth(e)+4+`px`:t.style.minWidth=``)},checkMaxSelected(){this.maxSelected!==0&&(this.selectedItems.length>this.maxSelected?(this.showValidationMessages=!0,this.$emit(`max-selected`)):this.showValidationMessages=!1)},setInitialInputHeight(){let e=this.getInput();e&&(e.style.minHeight=``,e.style.height=``,this.initialInputHeight=e.getBoundingClientRect().height,this.size!==`xs`&&(e.style.minHeight=`${this.initialInputHeight}px`,e.style.height=`auto`))},async handleInputFocusIn(){this.inputFocused=!0,this.collapseOnFocusOut&&(this.hideInputText=!1,await this.$nextTick(),this.setInputPadding())},async handleInputFocusOut(){if(this.inputFocused=!1,this.collapseOnFocusOut){this.hideInputText=!0;let e=this.getInput();if(!e||!e.style.paddingTop)return;this.revertInputPadding(e)}}}},p={key:1,class:`d-combobox-multi-select__list--loading`};function m(e,t,n,r,i,a){let o=(0,d.resolveComponent)(`dt-chip`),s=(0,d.resolveComponent)(`dt-input`),c=(0,d.resolveComponent)(`dt-validation-messages`),l=(0,d.resolveComponent)(`dt-combobox-with-popover`);return(0,d.openBlock)(),(0,d.createBlock)(l,(0,d.mergeProps)({ref:`comboboxWithPopover`,label:n.label,"show-list":n.showList,"max-height":n.listMaxHeight,"max-width":n.listMaxWidth,"popover-offset":i.popoverOffset,"has-suggestion-list":n.hasSuggestionList,"content-width":`anchor`,"append-to":n.appendTo,"dialog-class":n.dialogClass,transition:n.transition},a.extractNonListeners(e.$attrs),{onSelect:a.onComboboxSelect,onHighlight:a.comboboxHighlight}),(0,d.createSlots)({input:(0,d.withCtx)(({onInput:e})=>[(0,d.createElementVNode)(`span`,{ref:`inputSlotWrapper`,class:`d-combobox-multi-select__input-wrapper`,onFocusin:t[1]||(t[1]=(...e)=>a.handleInputFocusIn&&a.handleInputFocusIn(...e)),onFocusout:t[2]||(t[2]=(...e)=>a.handleInputFocusOut&&a.handleInputFocusOut(...e))},[(0,d.createElementVNode)(`span`,{ref:`chipsWrapper`,class:(0,d.normalizeClass)([`d-combobox-multi-select__chip-wrapper`,a.chipWrapperClass])},[((0,d.openBlock)(!0),(0,d.createElementBlock)(d.Fragment,null,(0,d.renderList)(n.selectedItems,(e,t)=>((0,d.openBlock)(),(0,d.createBlock)(o,(0,d.mergeProps)({ref_for:!0,ref:`chips`,key:`${t}-${e}`,interactive:!0,"label-class":[`d-chip__label--focus-always`],class:[`d-combobox-multi-select__chip`,{"d-combobox-multi-select__chip--truncate":!!n.chipMaxWidth}],style:{maxWidth:n.chipMaxWidth},size:i.CHIP_SIZES[String(n.size)],disabled:n.disabled},(0,d.toHandlers)(a.chipListeners),{onKeydown:(0,d.withKeys)(t=>a.onChipRemove(e),[`backspace`]),onClose:t=>a.onChipRemove(e)}),{default:(0,d.withCtx)(()=>[(0,d.createTextVNode)((0,d.toDisplayString)(e),1)]),_:2},1040,[`class`,`style`,`size`,`disabled`,`onKeydown`,`onClose`]))),128))],2),(0,d.createVNode)(s,(0,d.mergeProps)({ref:`input`,modelValue:i.value,"onUpdate:modelValue":t[0]||(t[0]=e=>i.value=e),class:`d-combobox-multi-select__input`,"input-class":[n.inputClass,{"d-combobox-multi-select__input--hidden":i.hideInputText}],"input-wrapper-class":n.inputWrapperClass,disabled:n.disabled,"aria-label":n.label,"aria-invalid":a.ariaInvalid,"aria-describedby":a.ariaDescribedBy,label:n.showLabel?n.label:``,description:n.description,placeholder:a.inputPlaceHolder,"show-messages":n.showInputMessages,messages:n.inputMessages,size:n.size},a.inputListeners,{"onUpdate:modelValue":e}),null,16,[`modelValue`,`input-class`,`input-wrapper-class`,`disabled`,`aria-label`,`aria-invalid`,`aria-describedby`,`label`,`description`,`placeholder`,`show-messages`,`messages`,`size`,`onUpdate:modelValue`]),(0,d.createVNode)(c,{id:i.messagesId,"validation-messages":n.maxSelectedMessage,"show-messages":i.showValidationMessages},null,8,[`id`,`validation-messages`,`show-messages`])],544)]),list:(0,d.withCtx)(()=>[(0,d.createElementVNode)(`div`,{ref:`list`,class:(0,d.normalizeClass)([`d-combobox-multi-select__list`,n.listClass]),onMousedown:t[3]||(t[3]=(0,d.withModifiers)(()=>{},[`prevent`]))},[n.loading?((0,d.openBlock)(),(0,d.createElementBlock)(`div`,p,(0,d.toDisplayString)(n.loadingMessage),1)):(0,d.renderSlot)(e.$slots,`list`,{key:0})],34)]),_:2},[i.hasSlotContent(e.$slots.header)?{name:`header`,fn:(0,d.withCtx)(()=>[(0,d.createElementVNode)(`div`,{ref:`header`,class:(0,d.normalizeClass)(n.headerClass)},[(0,d.renderSlot)(e.$slots,`header`)],2)]),key:`0`}:void 0,i.hasSlotContent(e.$slots.footer)?{name:`footer`,fn:(0,d.withCtx)(()=>[(0,d.createElementVNode)(`div`,{ref:`footer`,class:(0,d.normalizeClass)(n.footerClass)},[(0,d.renderSlot)(e.$slots,`footer`)],2)]),key:`1`}:void 0]),1040,[`label`,`show-list`,`max-height`,`max-width`,`popover-offset`,`has-suggestion-list`,`append-to`,`dialog-class`,`transition`,`onSelect`,`onHighlight`])}var h=i.t(f,[[`render`,m]]);exports.default=h;
|
|
2
2
|
//# sourceMappingURL=combobox-multi-select.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"combobox-multi-select.cjs","names":[],"sources":["../../../components/ComboboxMultiSelect/ComboboxMultiSelect.vue"],"sourcesContent":["<!-- eslint-disable vue/no-static-inline-styles -->\n<template>\n <dt-combobox-with-popover\n ref=\"comboboxWithPopover\"\n :label=\"label\"\n :show-list=\"showList\"\n :max-height=\"listMaxHeight\"\n :max-width=\"listMaxWidth\"\n :popover-offset=\"popoverOffset\"\n :has-suggestion-list=\"hasSuggestionList\"\n content-width=\"anchor\"\n :append-to=\"appendTo\"\n :dialog-class=\"dialogClass\"\n :transition=\"transition\"\n v-bind=\"extractNonListeners($attrs)\"\n @select=\"onComboboxSelect\"\n @highlight=\"comboboxHighlight\"\n >\n <template #input=\"{ onInput }\">\n <span\n ref=\"inputSlotWrapper\"\n class=\"d-combobox-multi-select__input-wrapper\"\n @focusin=\"handleInputFocusIn\"\n @focusout=\"handleInputFocusOut\"\n >\n <span\n ref=\"chipsWrapper\"\n :class=\"['d-combobox-multi-select__chip-wrapper', chipWrapperClass]\"\n >\n <dt-chip\n v-for=\"(item, index) in selectedItems\"\n ref=\"chips\"\n :key=\"`${index}-${item}`\"\n :interactive=\"true\"\n :label-class=\"['d-chip__label']\"\n :class=\"[\n 'd-combobox-multi-select__chip',\n { 'd-combobox-multi-select__chip--truncate': !!chipMaxWidth },\n ]\"\n :style=\"{ maxWidth: chipMaxWidth }\"\n :size=\"CHIP_SIZES[String(size)]\"\n :disabled=\"disabled\"\n v-on=\"chipListeners\"\n @keydown.backspace=\"onChipRemove(item)\"\n @close=\"onChipRemove(item)\"\n >\n {{ item }}\n </dt-chip>\n </span>\n\n <dt-input\n ref=\"input\"\n v-model=\"value\"\n class=\"d-combobox-multi-select__input\"\n :input-class=\"[\n inputClass, {\n 'd-combobox-multi-select__input--hidden': hideInputText,\n }]\"\n :input-wrapper-class=\"inputWrapperClass\"\n :disabled=\"disabled\"\n :aria-label=\"label\"\n :aria-invalid=\"ariaInvalid\"\n :aria-describedby=\"ariaDescribedBy\"\n :label=\"showLabel ? label : ''\"\n :description=\"description\"\n :placeholder=\"inputPlaceHolder\"\n :show-messages=\"showInputMessages\"\n :messages=\"inputMessages\"\n :size=\"size\"\n v-bind=\"inputListeners\"\n @update:model-value=\"onInput\"\n />\n\n <dt-validation-messages\n :id=\"messagesId\"\n :validation-messages=\"maxSelectedMessage\"\n :show-messages=\"showValidationMessages\"\n />\n </span>\n </template>\n\n <!-- @slot slot for popover header -->\n <template\n v-if=\"hasSlotContent($slots.header)\"\n #header\n >\n <div\n ref=\"header\"\n :class=\"headerClass\"\n >\n <slot name=\"header\" />\n </div>\n </template>\n\n <!-- @slot slot for popover list -->\n <template #list>\n <div\n ref=\"list\"\n :class=\"['d-combobox-multi-select__list', listClass]\"\n @mousedown.prevent\n >\n <slot\n v-if=\"!loading\"\n name=\"list\"\n />\n <div\n v-else\n class=\"d-combobox-multi-select__list--loading\"\n >\n {{ loadingMessage }}\n </div>\n </div>\n </template>\n\n <!-- @slot slot for popover footer -->\n <template\n v-if=\"hasSlotContent($slots.footer)\"\n #footer\n >\n <div\n ref=\"footer\"\n :class=\"footerClass\"\n >\n <slot name=\"footer\" />\n </div>\n </template>\n </dt-combobox-with-popover>\n</template>\n\n<script>\n/* eslint-disable max-lines */\nimport DtComboboxWithPopover from '@/components/ComboboxWithPopover/ComboboxWithPopover.vue';\nimport DtInput from '@/components/Input/Input.vue';\nimport DtChip from '@/components/Chip/Chip.vue';\nimport DtValidationMessages from '@/components/ValidationMessages/ValidationMessages.vue';\nimport { validationMessageValidator, ordinalSizeValidator } from '@/common/validators';\nimport { extractVueListeners, extractNonListeners, hasSlotContent, returnFirstEl, getUniqueString, getValidationState } from '@/common/utils';\nimport { HTML_ELEMENT_TYPE } from '@/common/constants';\nimport {\n POPOVER_APPEND_TO_VALUES,\n} from '@/components/Popover/PopoverConstants';\nimport {\n CHIP_SIZES,\n CHIP_TOP_POSITION,\n} from './ComboboxMultiSelectConstants';\nimport { COMPONENT_SIZES, VALIDATION_MESSAGE_TYPES } from '@/common/constants';\n\nexport default {\n name: 'DtComboboxMultiSelect',\n\n components: {\n DtComboboxWithPopover,\n DtInput,\n DtChip,\n DtValidationMessages,\n },\n\n inheritAttrs: false,\n\n props: {\n /**\n * String to use for the input label.\n */\n label: {\n type: String,\n required: true,\n },\n\n /**\n * Determines visibility of input label.\n * @values true, false\n */\n showLabel: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Description for the input\n */\n description: {\n type: String,\n default: '',\n },\n\n /**\n * Input placeholder\n */\n placeholder: {\n type: String,\n default: 'Select one or start typing',\n },\n\n /**\n * Input validation messages\n */\n inputMessages: {\n type: Array,\n default: () => [],\n validator: inputMessages => {\n return validationMessageValidator(inputMessages);\n },\n },\n\n /**\n * Show input validation message\n */\n showInputMessages: {\n type: Boolean,\n default: true,\n },\n\n // @TODO: https://dialpad.atlassian.net/browse/DP-52324\n // type: {\n // type: String,\n // values: ['input', 'select'],\n // default: 'select',\n // },\n\n /**\n * Determines if the list is loading\n */\n loading: {\n type: Boolean,\n default: false,\n },\n\n /**\n * The message when the list is loading\n */\n loadingMessage: {\n type: String,\n default: 'loading...',\n },\n\n /**\n * Determines when to show the list element and also controls the aria-expanded attribute.\n * Leaving this null will have the combobox trigger on input focus by default.\n * If you set this value, the default trigger behavior will be disabled and you can\n * control it as you need.\n */\n showList: {\n type: Boolean,\n default: null,\n },\n\n /**\n * Determines maximum height for the popover before overflow.\n * Possible units rem|px|em\n */\n listMaxHeight: {\n type: String,\n default: '300px',\n },\n\n /**\n * The selected items\n */\n selectedItems: {\n type: Array,\n default: function () { return []; },\n },\n\n /**\n * Would be the maximum number of selections you can make. 0 is unlimited\n */\n maxSelected: {\n type: Number,\n default: 0,\n },\n\n /**\n * Max select message when the max selections is exceeded with the structure:\n * `[{\"message\": string, \"type\": VALIDATION_MESSAGE_TYPES }]`\n */\n maxSelectedMessage: {\n type: Array,\n default: function () { return []; },\n },\n\n /**\n * Displays the list when the combobox is focused, before the user has typed anything.\n * When this is enabled the list will not close after selection.\n */\n hasSuggestionList: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Size of the chip.\n * @values 100, 200, 300\n */\n size: {\n type: [String, Number],\n default: 300,\n validator: ordinalSizeValidator(CHIP_SIZES),\n },\n\n /**\n * Sets the element to which the popover is going to append to.\n * 'body' will append to the nearest body (supports shadow DOM).\n * @values 'body', 'parent', HTMLElement,\n */\n appendTo: {\n type: [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 * Named transition when the content display is toggled.\n * @see DtLazyShow\n */\n transition: {\n type: String,\n default: 'fade',\n },\n\n /**\n * Determines whether the combobox should collapse to a single when losing focus.\n * @type {boolean}\n */\n collapseOnFocusOut: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Determines maximum width for the popover before overflow.\n * Possible units rem|px|em\n */\n listMaxWidth: {\n type: String,\n default: '',\n },\n\n /**\n * Amount of reserved space (in px) on the right side of the input\n * before the chips and the input caret jump to the next line.\n * default is 64\n */\n reservedRightSpace: {\n type: Number,\n default: 64,\n },\n\n /**\n * Determines the maximum width of a single chip. If the text within this chip exceeds the value\n * it will be truncated with ellipses.\n * Possible units rem|px|em\n */\n chipMaxWidth: {\n type: String,\n default: '',\n },\n\n /**\n * Additional class name for the input element.\n * Can accept String, Object, and Array, i.e. has the\n * same API as Vue's built-in handling of the class attribute.\n */\n inputClass: {\n type: [String, Object, Array],\n default: '',\n },\n\n /**\n * Additional class name for the input wrapper element.\n * Can accept all of String, Object, and Array, i.e. has the\n * same api as Vue's built-in handling of the class attribute.\n */\n inputWrapperClass: {\n type: [String, Object, Array],\n default: '',\n },\n\n /**\n * When true, disables the underlying input.\n */\n disabled: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Additional class name for the header wrapper element.\n */\n headerClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Additional class name for the footer wrapper element.\n */\n footerClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Additional class name for the list wrapper element.\n */\n listClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Additional class for the popover dialog element.\n */\n dialogClass: {\n type: [String, Object, Array],\n default: '',\n },\n },\n\n emits: [\n /**\n * Event fired to sync the modelValue prop with the parent component\n *\n * @event update:modelValue\n * @type {String}\n */\n 'update:modelValue',\n\n /**\n * Event fired when item selected\n *\n * @event select\n * @type {Number}\n */\n 'select',\n\n /**\n * Event fired when item removed\n *\n * @event remove\n * @type {String}\n */\n 'remove',\n\n /**\n * Event fired when max selected items limit is reached\n *\n * @event max-selected\n * @type {Object}\n */\n 'max-selected',\n\n /**\n * Native keydown event fired when a key is pressed in the text input.\n * For the common Escape and Enter cases, listen to `escape` / `enter` instead.\n *\n * @event keydown\n * @type {KeyboardEvent}\n */\n 'keydown',\n\n /**\n * Native keydown event fired when a key is pressed while a chip is focused.\n *\n * @event chip-keydown\n * @type {KeyboardEvent}\n */\n 'chip-keydown',\n\n /**\n * Fired when Escape is pressed in the text input.\n * Not fired when a chip is focused.\n *\n * @event escape\n * @type {KeyboardEvent}\n */\n 'escape',\n\n /**\n * Fired when Enter is pressed in the text input.\n * Not fired when a chip is focused.\n *\n * @event enter\n * @type {KeyboardEvent}\n */\n 'enter',\n\n /**\n * Event fired when combobox item is highlighted\n *\n * @event combobox-highlight\n * @type {Object}\n */\n 'combobox-highlight',\n ],\n\n data () {\n return {\n value: '',\n popoverOffset: [0, 4],\n showValidationMessages: false,\n resizeWindowObserver: null,\n initialInputHeight: null,\n CHIP_SIZES,\n hasSlotContent,\n inputFocused: false,\n hideInputText: false,\n messagesId: getUniqueString(),\n };\n },\n\n computed: {\n inputPlaceHolder () {\n return this.selectedItems?.length > 0 ? '' : this.placeholder;\n },\n\n chipListeners () {\n return {\n keydown: event => {\n if (this.disabled) return;\n this.onChipKeyDown(event);\n this.$emit('chip-keydown', event);\n },\n };\n },\n\n inputListeners () {\n return {\n ...extractVueListeners(this.$attrs),\n onInput: event => {\n this.$emit('update:modelValue', event);\n if (this.hasSuggestionList) {\n this.showComboboxList();\n }\n },\n\n onKeydown: event => {\n if (this.disabled) return;\n this.onInputKeyDown(event);\n this.$emit('keydown', event);\n // Use event.key (not event.code) so NumpadEnter normalizes to 'Enter'\n // and consumers don't have to special-case the numpad.\n const key = event.key?.toLowerCase();\n if (key === 'escape') {\n this.$emit('escape', event);\n } else if (key === 'enter') {\n this.$emit('enter', event);\n }\n },\n\n onClick: () => {\n if (this.hasSuggestionList) {\n this.showComboboxList();\n }\n },\n };\n },\n\n ariaInvalid () {\n return getValidationState(this.maxSelectedMessage) === VALIDATION_MESSAGE_TYPES.CRITICAL ? 'true' : undefined;\n },\n\n ariaDescribedBy () {\n return this.showValidationMessages && this.maxSelectedMessage.length > 0 ? this.messagesId : undefined;\n },\n\n chipWrapperClass () {\n return {\n [`d-combobox-multi-select__chip-wrapper-${COMPONENT_SIZES[String(this.size)] || this.size}--collapsed`]: !this.inputFocused && this.collapseOnFocusOut,\n };\n },\n },\n\n watch: {\n selectedItems: {\n deep: true,\n handler: async function () {\n await this.initSelectedItems();\n },\n },\n\n chipMaxWidth: {\n async handler () {\n await this.initSelectedItems();\n },\n },\n\n async label () {\n await this.$nextTick();\n // Adjust the chips position if label changed\n this.setChipsTopPosition();\n },\n\n async description () {\n await this.$nextTick();\n // Adjust the chips position if description changed\n this.setChipsTopPosition();\n },\n\n size: {\n async handler () {\n await this.$nextTick();\n const input = this.getInput();\n this.revertInputPadding(input);\n this.setInitialInputHeight();\n this.setInputPadding();\n this.setChipsTopPosition();\n },\n },\n },\n\n async mounted () {\n this.setInitialInputHeight();\n // Recalculate chip position and input padding when resizing window\n this.resizeWindowObserver = new ResizeObserver(async () => {\n this.setChipsTopPosition();\n this.setInputPadding();\n });\n this.resizeWindowObserver.observe(document.body);\n\n await this.initSelectedItems();\n },\n\n beforeUnmount () {\n this.resizeWindowObserver?.unobserve(document.body);\n },\n\n methods: {\n extractNonListeners,\n comboboxHighlight (highlightIndex) {\n this.$emit('combobox-highlight', highlightIndex);\n },\n\n async initSelectedItems () {\n await this.$nextTick();\n this.setInputPadding();\n this.setChipsTopPosition();\n this.setInputMinWidth();\n this.checkMaxSelected();\n },\n\n onChipRemove (item) {\n this.$emit('remove', item);\n this.$refs.input?.focus();\n },\n\n onComboboxSelect (i) {\n if (this.loading) return;\n this.value = '';\n this.$emit('select', i);\n },\n\n showComboboxList () {\n if (this.showList != null) { return; }\n this.$refs.comboboxWithPopover?.showComboboxList();\n },\n\n closeComboboxList () {\n if (this.showList != null) { return; }\n this.$refs.comboboxWithPopover?.closeComboboxList();\n },\n\n getChips () {\n if (!this.selectedItems.length || !this.$refs.chips) return null;\n\n // Use the order from selectedItems to not rely on DOM order which may be stale.\n // Track matched indices to handle duplicate item names correctly.\n const matched = new Set();\n const chips = this.selectedItems.map(item => {\n return this.$refs.chips.find((chip, index) => {\n if (matched.has(index)) return false;\n const chipLabel = returnFirstEl(chip.$el)?.querySelector('.d-chip__label')?.textContent?.trim();\n if (chipLabel === item) {\n matched.add(index);\n return true;\n }\n return false;\n });\n });\n return chips.filter(Boolean).map(chip => returnFirstEl(chip.$el));\n },\n\n getChipButtons () {\n const chips = this.getChips();\n return chips && chips.map(chip => returnFirstEl(chip).querySelector('button'));\n },\n\n getLastChipButton () {\n const chipButtons = this.getChipButtons();\n return chipButtons && chipButtons[chipButtons.length - 1];\n },\n\n getLastChip () {\n const chips = this.getChips();\n return chips && chips[chips.length - 1];\n },\n\n getFirstChip () {\n const chips = this.getChips();\n return chips && chips[0];\n },\n\n getInput () {\n return this.$refs.input?.$refs.input;\n },\n\n onChipKeyDown (event) {\n const key = event.code?.toLowerCase();\n if (key === 'arrowleft') {\n // Move to the previous chip\n this.navigateBetweenChips(event.target, true);\n } else if (key === 'arrowright') {\n if (event.target.id === this.getLastChipButton().id) {\n // Move to the input if it's the last chip\n this.moveFromChipToInput();\n } else {\n // Move to the next chip\n this.navigateBetweenChips(event.target, false);\n }\n }\n },\n\n onInputKeyDown (event) {\n const key = event.key?.toLowerCase();\n // If the cursor is at the start of the text,\n // press 'backspace' or 'left' focuses the last chip\n if (this.selectedItems.length > 0 && event.target.selectionStart === 0) {\n // if there is selected text, do not focus the last chip\n if (event.target.selectionEnd !== event.target.selectionStart) {\n return;\n }\n if (key === 'backspace' || key === 'arrowleft') {\n this.moveFromInputToChip();\n }\n }\n },\n\n moveFromInputToChip () {\n this.getLastChipButton().focus();\n this.$refs.input?.blur();\n this.closeComboboxList();\n },\n\n moveFromChipToInput () {\n this.getLastChipButton().blur();\n this.$refs.input?.focus();\n this.showComboboxList();\n },\n\n navigateBetweenChips (target, toLeft) {\n const from = this.getChipButtons().indexOf(target);\n const to = toLeft ? from - 1 : from + 1;\n if (to < 0 || to >= this.$refs.chips?.length) {\n return;\n }\n this.getChipButtons()[from].blur();\n this.getChipButtons()[to].focus();\n this.closeComboboxList();\n },\n\n setChipsTopPosition () {\n // To place the chips in the input box\n // The chip \"top\" position should be the same line as the input box\n const input = this.getInput();\n if (!input) return;\n const inputSlotWrapper = this.$refs.inputSlotWrapper;\n const top = input.getBoundingClientRect().top -\n inputSlotWrapper.getBoundingClientRect().top;\n const chipsWrapper = this.$refs.chipsWrapper;\n chipsWrapper.style.top = (top - CHIP_TOP_POSITION[String(this.size)]) + 'px';\n },\n\n setInputPadding () {\n const lastChip = this.getLastChip();\n const input = this.getInput();\n if (!input) return;\n this.revertInputPadding(input);\n this.popoverOffset = [0, 4];\n if (!lastChip) return;\n // Avoid adding extra padding when the input is not focused if collapseOnFocusOut is true\n // This ensures the input returns to its original state when resizing\n if (this.collapseOnFocusOut && !this.inputFocused) return;\n\n // Get the position of the last chip\n // The input cursor should be the same \"top\" as that chip and next besides it\n const left = lastChip.offsetLeft + this.getFullWidth(lastChip);\n const spaceLeft = input.getBoundingClientRect().width - left;\n const firstChip = this.getFirstChip();\n const isWrapped = firstChip && lastChip.offsetTop > firstChip.offsetTop;\n\n if (spaceLeft > this.reservedRightSpace) {\n input.style.paddingInlineStart = left + 'px';\n } else {\n input.style.paddingInlineStart = '4px';\n }\n\n const paddingTop = this.getInputPaddingTop(lastChip, spaceLeft > this.reservedRightSpace, isWrapped);\n if (paddingTop != null) input.style.paddingTop = `${paddingTop}px`;\n },\n\n getInputPaddingTop (lastChip, hasSpace, isWrapped) {\n // Chip fits beside the cursor on its row; CSS handles vertical centering.\n if (hasSpace && !isWrapped) return null;\n // Chip wrapped onto a new row with space remaining; align cursor to it.\n if (hasSpace) return lastChip.offsetTop + 2;\n // No space on the chip's row — predict next-row offsetTop so paddingTop\n // stays stable when a chip lands there.\n const chipMarginTop = parseFloat(getComputedStyle(lastChip).marginTop) || 0;\n const lastChipHeight = lastChip.getBoundingClientRect().height;\n return lastChip.offsetTop + lastChipHeight + chipMarginTop + 2;\n },\n\n revertInputPadding (input) {\n input.style.paddingInlineStart = '';\n input.style.paddingBlockStart = '';\n input.style.paddingBlockEnd = '';\n },\n\n getFullWidth (el) {\n const styles = window.getComputedStyle(el);\n return el.offsetWidth + parseInt(styles.marginLeft) + parseInt(styles.marginRight);\n },\n\n setInputMinWidth () {\n // Ensure the width of the input is \"slightly bigger\" than the width of a single chip\n const firstChip = this.getFirstChip();\n const input = this.getInput();\n if (!input) return;\n if (firstChip) {\n // Add 4px buffer for typing room\n input.style.minWidth = (this.getFullWidth(firstChip) + 4) + 'px';\n } else {\n input.style.minWidth = '';\n }\n },\n\n checkMaxSelected () {\n if (this.maxSelected === 0) return;\n if (this.selectedItems.length > this.maxSelected) {\n this.showValidationMessages = true;\n this.$emit('max-selected');\n } else {\n this.showValidationMessages = false;\n }\n },\n\n setInitialInputHeight () {\n const input = this.getInput();\n if (!input) return;\n input.style.minHeight = '';\n input.style.height = '';\n this.initialInputHeight = input.getBoundingClientRect().height;\n // xs renders correctly without a min-height floor; other sizes need it to grow when chips wrap.\n if (this.size !== 'xs') {\n input.style.minHeight = `${this.initialInputHeight}px`;\n input.style.height = 'auto';\n }\n },\n\n async handleInputFocusIn () {\n this.inputFocused = true;\n if (this.collapseOnFocusOut) {\n this.hideInputText = false;\n await this.$nextTick();\n this.setInputPadding();\n }\n },\n\n async handleInputFocusOut () {\n this.inputFocused = false;\n if (this.collapseOnFocusOut) {\n this.hideInputText = true;\n const input = this.getInput();\n if (!input) return;\n // Hide the input text when is not on first line\n if (!input.style.paddingTop) {\n return;\n }\n this.revertInputPadding(input);\n }\n },\n },\n};\n</script>\n"],"mappings":"wqBAmJA,IAAK,EAAU,CACb,KAAM,wBAEN,WAAY,CACV,sBAAA,EAAA,QACA,QAAA,EAAA,QACA,OAAA,EAAA,QACA,qBAAA,EAAA,QACD,CAED,aAAc,GAEd,MAAO,CAIL,MAAO,CACL,KAAM,OACN,SAAU,GACX,CAMD,UAAW,CACT,KAAM,QACN,QAAS,GACV,CAKD,YAAa,CACX,KA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A,YAEP,EAAA,OAAA,OAAA,CAAA,IAAA,EAAA,CAAA,CAKiB,CAAA,GAAA,CAAA,CAAA,OA1Bf,EAAA,eAAe,EAAA,OAAO,OAAM,CAAA,MACjC,8BAOK,EAAA,EAAA,EAAA,oBAAA,MAAA,CAJJ,IAAI,SACH,OAAA,EAAA,EAAA,gBAAO,EAAA,YAAW,oBAEG,EAAA,OAAA,SAAA,CAAA,CAAA,EAAA,CAAA,CAAA,iBA0BlB,EAAA,eAAe,EAAA,OAAO,OAAM,CAAA,MACjC,8BAOK,EAAA,EAAA,EAAA,oBAAA,MAAA,CAJJ,IAAI,SACH,OAAA,EAAA,EAAA,gBAAO,EAAA,YAAW,oBAEG,EAAA,OAAA,SAAA,CAAA,CAAA,EAAA,CAAA,CAAA"}
|
|
1
|
+
{"version":3,"file":"combobox-multi-select.cjs","names":[],"sources":["../../../components/ComboboxMultiSelect/ComboboxMultiSelect.vue"],"sourcesContent":["<!-- eslint-disable vue/no-static-inline-styles -->\n<template>\n <dt-combobox-with-popover\n ref=\"comboboxWithPopover\"\n :label=\"label\"\n :show-list=\"showList\"\n :max-height=\"listMaxHeight\"\n :max-width=\"listMaxWidth\"\n :popover-offset=\"popoverOffset\"\n :has-suggestion-list=\"hasSuggestionList\"\n content-width=\"anchor\"\n :append-to=\"appendTo\"\n :dialog-class=\"dialogClass\"\n :transition=\"transition\"\n v-bind=\"extractNonListeners($attrs)\"\n @select=\"onComboboxSelect\"\n @highlight=\"comboboxHighlight\"\n >\n <template #input=\"{ onInput }\">\n <span\n ref=\"inputSlotWrapper\"\n class=\"d-combobox-multi-select__input-wrapper\"\n @focusin=\"handleInputFocusIn\"\n @focusout=\"handleInputFocusOut\"\n >\n <span\n ref=\"chipsWrapper\"\n :class=\"['d-combobox-multi-select__chip-wrapper', chipWrapperClass]\"\n >\n <dt-chip\n v-for=\"(item, index) in selectedItems\"\n ref=\"chips\"\n :key=\"`${index}-${item}`\"\n :interactive=\"true\"\n :label-class=\"['d-chip__label--focus-always']\"\n :class=\"[\n 'd-combobox-multi-select__chip',\n { 'd-combobox-multi-select__chip--truncate': !!chipMaxWidth },\n ]\"\n :style=\"{ maxWidth: chipMaxWidth }\"\n :size=\"CHIP_SIZES[String(size)]\"\n :disabled=\"disabled\"\n v-on=\"chipListeners\"\n @keydown.backspace=\"onChipRemove(item)\"\n @close=\"onChipRemove(item)\"\n >\n {{ item }}\n </dt-chip>\n </span>\n\n <dt-input\n ref=\"input\"\n v-model=\"value\"\n class=\"d-combobox-multi-select__input\"\n :input-class=\"[\n inputClass, {\n 'd-combobox-multi-select__input--hidden': hideInputText,\n }]\"\n :input-wrapper-class=\"inputWrapperClass\"\n :disabled=\"disabled\"\n :aria-label=\"label\"\n :aria-invalid=\"ariaInvalid\"\n :aria-describedby=\"ariaDescribedBy\"\n :label=\"showLabel ? label : ''\"\n :description=\"description\"\n :placeholder=\"inputPlaceHolder\"\n :show-messages=\"showInputMessages\"\n :messages=\"inputMessages\"\n :size=\"size\"\n v-bind=\"inputListeners\"\n @update:model-value=\"onInput\"\n />\n\n <dt-validation-messages\n :id=\"messagesId\"\n :validation-messages=\"maxSelectedMessage\"\n :show-messages=\"showValidationMessages\"\n />\n </span>\n </template>\n\n <!-- @slot slot for popover header -->\n <template\n v-if=\"hasSlotContent($slots.header)\"\n #header\n >\n <div\n ref=\"header\"\n :class=\"headerClass\"\n >\n <slot name=\"header\" />\n </div>\n </template>\n\n <!-- @slot slot for popover list -->\n <template #list>\n <div\n ref=\"list\"\n :class=\"['d-combobox-multi-select__list', listClass]\"\n @mousedown.prevent\n >\n <slot\n v-if=\"!loading\"\n name=\"list\"\n />\n <div\n v-else\n class=\"d-combobox-multi-select__list--loading\"\n >\n {{ loadingMessage }}\n </div>\n </div>\n </template>\n\n <!-- @slot slot for popover footer -->\n <template\n v-if=\"hasSlotContent($slots.footer)\"\n #footer\n >\n <div\n ref=\"footer\"\n :class=\"footerClass\"\n >\n <slot name=\"footer\" />\n </div>\n </template>\n </dt-combobox-with-popover>\n</template>\n\n<script>\n/* eslint-disable max-lines */\nimport DtComboboxWithPopover from '@/components/ComboboxWithPopover/ComboboxWithPopover.vue';\nimport DtInput from '@/components/Input/Input.vue';\nimport DtChip from '@/components/Chip/Chip.vue';\nimport DtValidationMessages from '@/components/ValidationMessages/ValidationMessages.vue';\nimport { validationMessageValidator, ordinalSizeValidator } from '@/common/validators';\nimport { extractVueListeners, extractNonListeners, hasSlotContent, returnFirstEl, getUniqueString, getValidationState } from '@/common/utils';\nimport { HTML_ELEMENT_TYPE } from '@/common/constants';\nimport {\n POPOVER_APPEND_TO_VALUES,\n} from '@/components/Popover/PopoverConstants';\nimport {\n CHIP_SIZES,\n} from './ComboboxMultiSelectConstants';\nimport { COMPONENT_SIZES, VALIDATION_MESSAGE_TYPES } from '@/common/constants';\n\nexport default {\n name: 'DtComboboxMultiSelect',\n\n components: {\n DtComboboxWithPopover,\n DtInput,\n DtChip,\n DtValidationMessages,\n },\n\n inheritAttrs: false,\n\n props: {\n /**\n * String to use for the input label.\n */\n label: {\n type: String,\n required: true,\n },\n\n /**\n * Determines visibility of input label.\n * @values true, false\n */\n showLabel: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Description for the input\n */\n description: {\n type: String,\n default: '',\n },\n\n /**\n * Input placeholder\n */\n placeholder: {\n type: String,\n default: 'Select one or start typing',\n },\n\n /**\n * Input validation messages\n */\n inputMessages: {\n type: Array,\n default: () => [],\n validator: inputMessages => {\n return validationMessageValidator(inputMessages);\n },\n },\n\n /**\n * Show input validation message\n */\n showInputMessages: {\n type: Boolean,\n default: true,\n },\n\n // @TODO: https://dialpad.atlassian.net/browse/DP-52324\n // type: {\n // type: String,\n // values: ['input', 'select'],\n // default: 'select',\n // },\n\n /**\n * Determines if the list is loading\n */\n loading: {\n type: Boolean,\n default: false,\n },\n\n /**\n * The message when the list is loading\n */\n loadingMessage: {\n type: String,\n default: 'loading...',\n },\n\n /**\n * Determines when to show the list element and also controls the aria-expanded attribute.\n * Leaving this null will have the combobox trigger on input focus by default.\n * If you set this value, the default trigger behavior will be disabled and you can\n * control it as you need.\n */\n showList: {\n type: Boolean,\n default: null,\n },\n\n /**\n * Determines maximum height for the popover before overflow.\n * Possible units rem|px|em\n */\n listMaxHeight: {\n type: String,\n default: '300px',\n },\n\n /**\n * The selected items\n */\n selectedItems: {\n type: Array,\n default: function () { return []; },\n },\n\n /**\n * Would be the maximum number of selections you can make. 0 is unlimited\n */\n maxSelected: {\n type: Number,\n default: 0,\n },\n\n /**\n * Max select message when the max selections is exceeded with the structure:\n * `[{\"message\": string, \"type\": VALIDATION_MESSAGE_TYPES }]`\n */\n maxSelectedMessage: {\n type: Array,\n default: function () { return []; },\n },\n\n /**\n * Displays the list when the combobox is focused, before the user has typed anything.\n * When this is enabled the list will not close after selection.\n */\n hasSuggestionList: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Size of the chip.\n * @values 100, 200, 300\n */\n size: {\n type: [String, Number],\n default: 300,\n validator: ordinalSizeValidator(CHIP_SIZES),\n },\n\n /**\n * Sets the element to which the popover is going to append to.\n * 'body' will append to the nearest body (supports shadow DOM).\n * @values 'body', 'parent', HTMLElement,\n */\n appendTo: {\n type: [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 * Named transition when the content display is toggled.\n * @see DtLazyShow\n */\n transition: {\n type: String,\n default: 'fade',\n },\n\n /**\n * Determines whether the combobox should collapse to a single when losing focus.\n * @type {boolean}\n */\n collapseOnFocusOut: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Determines maximum width for the popover before overflow.\n * Possible units rem|px|em\n */\n listMaxWidth: {\n type: String,\n default: '',\n },\n\n /**\n * Amount of reserved space (in px) on the right side of the input\n * before the chips and the input caret jump to the next line.\n * default is 64\n */\n reservedRightSpace: {\n type: Number,\n default: 64,\n },\n\n /**\n * Determines the maximum width of a single chip. If the text within this chip exceeds the value\n * it will be truncated with ellipses.\n * Possible units rem|px|em\n */\n chipMaxWidth: {\n type: String,\n default: '',\n },\n\n /**\n * Additional class name for the input element.\n * Can accept String, Object, and Array, i.e. has the\n * same API as Vue's built-in handling of the class attribute.\n */\n inputClass: {\n type: [String, Object, Array],\n default: '',\n },\n\n /**\n * Additional class name for the input wrapper element.\n * Can accept all of String, Object, and Array, i.e. has the\n * same api as Vue's built-in handling of the class attribute.\n */\n inputWrapperClass: {\n type: [String, Object, Array],\n default: '',\n },\n\n /**\n * When true, disables the underlying input.\n */\n disabled: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Additional class name for the header wrapper element.\n */\n headerClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Additional class name for the footer wrapper element.\n */\n footerClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Additional class name for the list wrapper element.\n */\n listClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Additional class for the popover dialog element.\n */\n dialogClass: {\n type: [String, Object, Array],\n default: '',\n },\n },\n\n emits: [\n /**\n * Event fired to sync the modelValue prop with the parent component\n *\n * @event update:modelValue\n * @type {String}\n */\n 'update:modelValue',\n\n /**\n * Event fired when item selected\n *\n * @event select\n * @type {Number}\n */\n 'select',\n\n /**\n * Event fired when item removed\n *\n * @event remove\n * @type {String}\n */\n 'remove',\n\n /**\n * Event fired when max selected items limit is reached\n *\n * @event max-selected\n * @type {Object}\n */\n 'max-selected',\n\n /**\n * Native keydown event fired when a key is pressed in the text input.\n * For the common Escape and Enter cases, listen to `escape` / `enter` instead.\n *\n * @event keydown\n * @type {KeyboardEvent}\n */\n 'keydown',\n\n /**\n * Native keydown event fired when a key is pressed while a chip is focused.\n *\n * @event chip-keydown\n * @type {KeyboardEvent}\n */\n 'chip-keydown',\n\n /**\n * Fired when Escape is pressed in the text input.\n * Not fired when a chip is focused.\n *\n * @event escape\n * @type {KeyboardEvent}\n */\n 'escape',\n\n /**\n * Fired when Enter is pressed in the text input.\n * Not fired when a chip is focused.\n *\n * @event enter\n * @type {KeyboardEvent}\n */\n 'enter',\n\n /**\n * Event fired when combobox item is highlighted\n *\n * @event combobox-highlight\n * @type {Object}\n */\n 'combobox-highlight',\n ],\n\n data () {\n return {\n value: '',\n popoverOffset: [0, 4],\n showValidationMessages: false,\n resizeWindowObserver: null,\n initialInputHeight: null,\n CHIP_SIZES,\n hasSlotContent,\n inputFocused: false,\n hideInputText: false,\n messagesId: getUniqueString(),\n };\n },\n\n computed: {\n inputPlaceHolder () {\n return this.selectedItems?.length > 0 ? '' : this.placeholder;\n },\n\n chipListeners () {\n return {\n keydown: event => {\n if (this.disabled) return;\n this.onChipKeyDown(event);\n this.$emit('chip-keydown', event);\n },\n };\n },\n\n inputListeners () {\n return {\n ...extractVueListeners(this.$attrs),\n onInput: event => {\n this.$emit('update:modelValue', event);\n if (this.hasSuggestionList) {\n this.showComboboxList();\n }\n },\n\n onKeydown: event => {\n if (this.disabled) return;\n this.onInputKeyDown(event);\n this.$emit('keydown', event);\n // Use event.key (not event.code) so NumpadEnter normalizes to 'Enter'\n // and consumers don't have to special-case the numpad.\n const key = event.key?.toLowerCase();\n if (key === 'escape') {\n this.$emit('escape', event);\n } else if (key === 'enter') {\n this.$emit('enter', event);\n }\n },\n\n onClick: () => {\n if (this.hasSuggestionList) {\n this.showComboboxList();\n }\n },\n };\n },\n\n ariaInvalid () {\n return getValidationState(this.maxSelectedMessage) === VALIDATION_MESSAGE_TYPES.CRITICAL ? 'true' : undefined;\n },\n\n ariaDescribedBy () {\n return this.showValidationMessages && this.maxSelectedMessage.length > 0 ? this.messagesId : undefined;\n },\n\n // Sizes other than xs need a height floor so the box can grow for wrapped\n // chip rows without collapsing back; xs renders correctly without one.\n inputHeightFloor () {\n return (this.initialInputHeight && this.size !== 'xs')\n ? `${this.initialInputHeight}px`\n : '';\n },\n\n chipWrapperClass () {\n const size = COMPONENT_SIZES[String(this.size)] || this.size;\n return [\n // Always emitted so the CSS can size the row rhythm without reaching\n // sideways into DtInput's markup to discover the size.\n `d-combobox-multi-select__chip-wrapper--${size}`,\n {\n [`d-combobox-multi-select__chip-wrapper-${size}--collapsed`]: !this.inputFocused && this.collapseOnFocusOut,\n },\n ];\n },\n },\n\n watch: {\n selectedItems: {\n deep: true,\n handler: async function () {\n await this.initSelectedItems();\n },\n },\n\n chipMaxWidth: {\n async handler () {\n await this.initSelectedItems();\n },\n },\n\n async label () {\n await this.$nextTick();\n // Adjust the chips position if label changed\n this.setChipsTopPosition();\n },\n\n async description () {\n await this.$nextTick();\n // Adjust the chips position if description changed\n this.setChipsTopPosition();\n },\n\n size: {\n async handler () {\n await this.$nextTick();\n const input = this.getInput();\n this.revertInputPadding(input);\n this.setInitialInputHeight();\n this.setInputPadding();\n this.setChipsTopPosition();\n },\n },\n },\n\n async mounted () {\n this.setInitialInputHeight();\n // Recalculate chip position and input padding when resizing window\n this.resizeWindowObserver = new ResizeObserver(async () => {\n this.setChipsTopPosition();\n this.setInputPadding();\n });\n this.resizeWindowObserver.observe(document.body);\n\n await this.initSelectedItems();\n },\n\n beforeUnmount () {\n this.resizeWindowObserver?.unobserve(document.body);\n },\n\n methods: {\n extractNonListeners,\n comboboxHighlight (highlightIndex) {\n this.$emit('combobox-highlight', highlightIndex);\n },\n\n async initSelectedItems () {\n await this.$nextTick();\n this.setInputPadding();\n this.setChipsTopPosition();\n this.setInputMinWidth();\n this.checkMaxSelected();\n },\n\n onChipRemove (item) {\n this.$emit('remove', item);\n this.$refs.input?.focus();\n },\n\n onComboboxSelect (i) {\n if (this.loading) return;\n this.value = '';\n this.$emit('select', i);\n },\n\n showComboboxList () {\n if (this.showList != null) { return; }\n this.$refs.comboboxWithPopover?.showComboboxList();\n },\n\n closeComboboxList () {\n if (this.showList != null) { return; }\n this.$refs.comboboxWithPopover?.closeComboboxList();\n },\n\n getChips () {\n if (!this.selectedItems.length || !this.$refs.chips) return null;\n\n // Use the order from selectedItems to not rely on DOM order which may be stale.\n // Track matched indices to handle duplicate item names correctly.\n const matched = new Set();\n const chips = this.selectedItems.map(item => {\n return this.$refs.chips.find((chip, index) => {\n if (matched.has(index)) return false;\n const chipLabel = returnFirstEl(chip.$el)?.querySelector('.d-chip__label')?.textContent?.trim();\n if (chipLabel === item) {\n matched.add(index);\n return true;\n }\n return false;\n });\n });\n return chips.filter(Boolean).map(chip => returnFirstEl(chip.$el));\n },\n\n getChipButtons () {\n const chips = this.getChips();\n return chips && chips.map(chip => returnFirstEl(chip).querySelector('button'));\n },\n\n getLastChipButton () {\n const chipButtons = this.getChipButtons();\n return chipButtons && chipButtons[chipButtons.length - 1];\n },\n\n getLastChip () {\n const chips = this.getChips();\n return chips && chips[chips.length - 1];\n },\n\n getFirstChip () {\n const chips = this.getChips();\n return chips && chips[0];\n },\n\n getInput () {\n return this.$refs.input?.$refs.input;\n },\n\n onChipKeyDown (event) {\n const key = event.code?.toLowerCase();\n if (key === 'arrowleft') {\n // Move to the previous chip\n this.navigateBetweenChips(event.target, true);\n } else if (key === 'arrowright') {\n if (event.target.id === this.getLastChipButton().id) {\n // Move to the input if it's the last chip\n this.moveFromChipToInput();\n } else {\n // Move to the next chip\n this.navigateBetweenChips(event.target, false);\n }\n }\n },\n\n onInputKeyDown (event) {\n const key = event.key?.toLowerCase();\n // If the cursor is at the start of the text,\n // press 'backspace' or 'left' focuses the last chip\n if (this.selectedItems.length > 0 && event.target.selectionStart === 0) {\n // if there is selected text, do not focus the last chip\n if (event.target.selectionEnd !== event.target.selectionStart) {\n return;\n }\n if (key === 'backspace' || key === 'arrowleft') {\n this.moveFromInputToChip();\n }\n }\n },\n\n moveFromInputToChip () {\n this.getLastChipButton().focus();\n this.$refs.input?.blur();\n this.closeComboboxList();\n },\n\n moveFromChipToInput () {\n this.getLastChipButton().blur();\n this.$refs.input?.focus();\n this.showComboboxList();\n },\n\n navigateBetweenChips (target, toLeft) {\n const from = this.getChipButtons().indexOf(target);\n const to = toLeft ? from - 1 : from + 1;\n if (to < 0 || to >= this.$refs.chips?.length) {\n return;\n }\n this.getChipButtons()[from].blur();\n this.getChipButtons()[to].focus();\n this.closeComboboxList();\n },\n\n setChipsTopPosition () {\n // Centers the first row of chips on the input box's first line.\n // Two offsets have to be measured rather than derived: the input's\n // position within the slot wrapper (label and description heights vary),\n // and the chip's position within its own wrapper (the chips are atomic\n // inline boxes, so line-box metrics — not just the chip margin — decide\n // where the row starts).\n const input = this.getInput();\n const chipsWrapper = this.$refs.chipsWrapper;\n const firstChip = this.getFirstChip();\n if (!input || !chipsWrapper || !firstChip) return;\n\n const inputTop = input.getBoundingClientRect().top -\n this.$refs.inputSlotWrapper.getBoundingClientRect().top;\n // The empty-input height, so chips stay on the first line rather than\n // recentering on the whole box once it grows to fit wrapped rows.\n const inputRowHeight = this.initialInputHeight || input.getBoundingClientRect().height;\n const chipRect = firstChip.getBoundingClientRect();\n const chipOffsetInWrapper = chipRect.top - chipsWrapper.getBoundingClientRect().top;\n\n const top = inputTop + (inputRowHeight - chipRect.height) / 2 - chipOffsetInWrapper;\n chipsWrapper.style.top = top + 'px';\n },\n\n setInputPadding () {\n const lastChip = this.getLastChip();\n const input = this.getInput();\n if (!input) return;\n this.revertInputPadding(input);\n this.popoverOffset = [0, 4];\n if (!lastChip) return;\n // Avoid adding extra padding when the input is not focused if collapseOnFocusOut is true\n // This ensures the input returns to its original state when resizing\n if (this.collapseOnFocusOut && !this.inputFocused) return;\n\n // Read while revertInputPadding() above has the inline override cleared,\n // so this is the input's own padding rather than a previous run's value.\n const inputPaddingTop = this.getComputedPx(input, 'paddingTop');\n\n // Get the position of the last chip\n // The input cursor should be the same \"top\" as that chip and next besides it\n const left = lastChip.offsetLeft + this.getFullWidth(lastChip);\n const spaceLeft = input.getBoundingClientRect().width - left;\n const firstChip = this.getFirstChip();\n const isWrapped = firstChip && lastChip.offsetTop > firstChip.offsetTop;\n\n if (spaceLeft > this.reservedRightSpace) {\n input.style.paddingInlineStart = left + 'px';\n } else {\n input.style.paddingInlineStart = '4px';\n }\n\n const caretRowTop = this.getCaretRowTop(lastChip, firstChip, spaceLeft > this.reservedRightSpace, isWrapped);\n if (caretRowTop != null) {\n // Adding the input's own padding reproduces the single-row layout on\n // the caret's row, so the typed text keeps the same baseline relative\n // to the chips beside it no matter how many rows have accumulated.\n input.style.paddingTop = `${caretRowTop + inputPaddingTop}px`;\n this.growInputForWrappedRows(input, caretRowTop);\n }\n },\n\n growInputForWrappedRows (input, caretRowTop) {\n // The grown box would otherwise end at the caret line, leaving the last\n // chip row flush against the block-end border. Extend the height floor\n // so the last row keeps the same breathing room the first row gets from\n // centering: its row top plus the single-row envelope.\n if (!this.initialInputHeight) return;\n input.style.minHeight = `${caretRowTop + this.initialInputHeight}px`;\n },\n\n getComputedPx (el, property) {\n return parseFloat(getComputedStyle(el)[property]) || 0;\n },\n\n // Distance from the first chip row to the row the caret belongs on.\n getCaretRowTop (lastChip, firstChip, hasSpace, isWrapped) {\n // Chip fits beside the cursor on the first row; CSS centers it already.\n if (hasSpace && !isWrapped) return null;\n // Measured rather than offsetTop, which rounds to whole pixels and drifts\n // further out of alignment with every row added.\n const rowTop = lastChip.getBoundingClientRect().top - firstChip.getBoundingClientRect().top;\n // Chip wrapped onto a new row with space remaining; share that row.\n if (hasSpace) return rowTop;\n // No space left on that row — predict the next one. Row spacing belongs\n // to the wrapper's row-gap, not to the chip.\n const rowGap = this.getComputedPx(this.$refs.chipsWrapper, 'rowGap');\n return rowTop + lastChip.getBoundingClientRect().height + rowGap;\n },\n\n revertInputPadding (input) {\n input.style.paddingInlineStart = '';\n // setInputPadding writes the physical paddingTop slot, so that is the\n // slot to clear — the logical one is a different CSSOM property.\n input.style.paddingTop = '';\n // Restore the single-row height floor that setInitialInputHeight\n // applies (setInputPadding grows it while rows are wrapped).\n input.style.minHeight = this.inputHeightFloor;\n },\n\n getFullWidth (el) {\n const styles = window.getComputedStyle(el);\n return el.offsetWidth + parseInt(styles.marginLeft) + parseInt(styles.marginRight);\n },\n\n setInputMinWidth () {\n // Ensure the width of the input is \"slightly bigger\" than the width of a single chip\n const firstChip = this.getFirstChip();\n const input = this.getInput();\n if (!input) return;\n if (firstChip) {\n // Add 4px buffer for typing room\n input.style.minWidth = (this.getFullWidth(firstChip) + 4) + 'px';\n } else {\n input.style.minWidth = '';\n }\n },\n\n checkMaxSelected () {\n if (this.maxSelected === 0) return;\n if (this.selectedItems.length > this.maxSelected) {\n this.showValidationMessages = true;\n this.$emit('max-selected');\n } else {\n this.showValidationMessages = false;\n }\n },\n\n setInitialInputHeight () {\n const input = this.getInput();\n if (!input) return;\n input.style.minHeight = '';\n input.style.height = '';\n this.initialInputHeight = input.getBoundingClientRect().height;\n // xs renders correctly without a min-height floor; other sizes need it to grow when chips wrap.\n if (this.size !== 'xs') {\n input.style.minHeight = `${this.initialInputHeight}px`;\n input.style.height = 'auto';\n }\n },\n\n async handleInputFocusIn () {\n this.inputFocused = true;\n if (this.collapseOnFocusOut) {\n this.hideInputText = false;\n await this.$nextTick();\n this.setInputPadding();\n }\n },\n\n async handleInputFocusOut () {\n this.inputFocused = false;\n if (this.collapseOnFocusOut) {\n this.hideInputText = true;\n const input = this.getInput();\n if (!input) return;\n // Hide the input text when is not on first line\n if (!input.style.paddingTop) {\n return;\n }\n this.revertInputPadding(input);\n }\n },\n },\n};\n</script>\n"],"mappings":"wqBAkJA,IAAK,EAAU,CACb,KAAM,wBAEN,WAAY,CACV,sBAAA,EAAA,QACA,QAAA,EAAA,QACA,OAAA,EAAA,QACA,qBAAA,EAAA,QACD,CAED,aAAc,GAEd,MAAO,CAIL,MAAO,CACL,KAAM,OACN,SAAU,GACX,CAMD,UAAW,CACT,KAAM,QACN,QAAS,GACV,CAKD,YAAa,CACX,KAAM,OACN,QAAS,GACV,CAKD,YAAa,CACX,KAAM,OACN,QAAS,6BACV,CAKD,cAAe,CACb,KAAM,MACN,YAAe,EAAE,CACjB,UAAW,GACF,EAAA,2BAA2B,EAAc,CAEnD,CAKD,kBAAmB,CACjB,KAAM,QACN,QAAS,GACV,C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,WACJ,sBAAqB,EAAA,mBACrB,gBAAe,EAAA,qFAmBX,MAAA,EAAA,EAAA,aAgBH,EAAA,EAAA,EAAA,oBAAA,MAAA,CAdJ,IAAI,OACH,OAAA,EAAA,EAAA,gBAAK,CAAA,gCAAoC,EAAA,UAAS,CAAA,CAClD,YAAS,EAAA,KAAA,EAAA,IAAA,EAAA,EAAA,mBAAV,GAAkB,CAAA,UAAA,CAAA,IAGT,EAAA,UAEP,EAAA,EAAA,YAAA,EAAA,EAAA,EAAA,oBAMI,MALN,GAAA,EAAA,EAAA,iBAIK,EAAA,eAAc,CAAA,EAAA,GAPV,EAAA,EAAA,YAEP,EAAA,OAAA,OAAA,CAAA,IAAA,EAAA,CAAA,CAKiB,CAAA,GAAA,CAAA,CAAA,OA1Bf,EAAA,eAAe,EAAA,OAAO,OAAM,CAAA,MACjC,8BAOK,EAAA,EAAA,EAAA,oBAAA,MAAA,CAJJ,IAAI,SACH,OAAA,EAAA,EAAA,gBAAO,EAAA,YAAW,oBAEG,EAAA,OAAA,SAAA,CAAA,CAAA,EAAA,CAAA,CAAA,iBA0BlB,EAAA,eAAe,EAAA,OAAO,OAAM,CAAA,MACjC,8BAOK,EAAA,EAAA,EAAA,oBAAA,MAAA,CAJJ,IAAI,SACH,OAAA,EAAA,EAAA,gBAAO,EAAA,YAAW,oBAEG,EAAA,OAAA,SAAA,CAAA,CAAA,EAAA,CAAA,CAAA"}
|
|
@@ -8,10 +8,10 @@ import p from "../chip/chip.js";
|
|
|
8
8
|
import { POPOVER_APPEND_TO_VALUES as m } from "../popover/popover-constants.js";
|
|
9
9
|
import h from "../input/input.js";
|
|
10
10
|
import g from "../combobox-with-popover/combobox-with-popover.js";
|
|
11
|
-
import { CHIP_SIZES as _
|
|
12
|
-
import { Fragment as
|
|
11
|
+
import { CHIP_SIZES as _ } from "./combobox-multi-select-constants.js";
|
|
12
|
+
import { Fragment as v, createBlock as y, createElementBlock as b, createElementVNode as x, createSlots as S, createTextVNode as C, createVNode as w, mergeProps as T, normalizeClass as E, openBlock as D, renderList as O, renderSlot as k, resolveComponent as A, toDisplayString as j, toHandlers as M, withCtx as N, withKeys as P, withModifiers as F } from "vue";
|
|
13
13
|
//#region components/ComboboxMultiSelect/ComboboxMultiSelect.vue
|
|
14
|
-
var
|
|
14
|
+
var I = {
|
|
15
15
|
name: "DtComboboxMultiSelect",
|
|
16
16
|
components: {
|
|
17
17
|
DtComboboxWithPopover: g,
|
|
@@ -222,8 +222,12 @@ var L = {
|
|
|
222
222
|
ariaDescribedBy() {
|
|
223
223
|
return this.showValidationMessages && this.maxSelectedMessage.length > 0 ? this.messagesId : void 0;
|
|
224
224
|
},
|
|
225
|
+
inputHeightFloor() {
|
|
226
|
+
return this.initialInputHeight && this.size !== "xs" ? `${this.initialInputHeight}px` : "";
|
|
227
|
+
},
|
|
225
228
|
chipWrapperClass() {
|
|
226
|
-
|
|
229
|
+
let t = e[String(this.size)] || this.size;
|
|
230
|
+
return [`d-combobox-multi-select__chip-wrapper--${t}`, { [`d-combobox-multi-select__chip-wrapper-${t}--collapsed`]: !this.inputFocused && this.collapseOnFocusOut }];
|
|
227
231
|
}
|
|
228
232
|
},
|
|
229
233
|
watch: {
|
|
@@ -322,27 +326,34 @@ var L = {
|
|
|
322
326
|
r < 0 || r >= this.$refs.chips?.length || (this.getChipButtons()[n].blur(), this.getChipButtons()[r].focus(), this.closeComboboxList());
|
|
323
327
|
},
|
|
324
328
|
setChipsTopPosition() {
|
|
325
|
-
let e = this.getInput();
|
|
326
|
-
if (!e) return;
|
|
327
|
-
let
|
|
328
|
-
|
|
329
|
+
let e = this.getInput(), t = this.$refs.chipsWrapper, n = this.getFirstChip();
|
|
330
|
+
if (!e || !t || !n) return;
|
|
331
|
+
let r = e.getBoundingClientRect().top - this.$refs.inputSlotWrapper.getBoundingClientRect().top, i = this.initialInputHeight || e.getBoundingClientRect().height, a = n.getBoundingClientRect(), o = a.top - t.getBoundingClientRect().top, s = r + (i - a.height) / 2 - o;
|
|
332
|
+
t.style.top = s + "px";
|
|
329
333
|
},
|
|
330
334
|
setInputPadding() {
|
|
331
335
|
let e = this.getLastChip(), t = this.getInput();
|
|
332
336
|
if (!t || (this.revertInputPadding(t), this.popoverOffset = [0, 4], !e) || this.collapseOnFocusOut && !this.inputFocused) return;
|
|
333
|
-
let n = e.offsetLeft + this.getFullWidth(e),
|
|
334
|
-
|
|
335
|
-
let
|
|
336
|
-
|
|
337
|
+
let n = this.getComputedPx(t, "paddingTop"), r = e.offsetLeft + this.getFullWidth(e), i = t.getBoundingClientRect().width - r, a = this.getFirstChip(), o = a && e.offsetTop > a.offsetTop;
|
|
338
|
+
i > this.reservedRightSpace ? t.style.paddingInlineStart = r + "px" : t.style.paddingInlineStart = "4px";
|
|
339
|
+
let s = this.getCaretRowTop(e, a, i > this.reservedRightSpace, o);
|
|
340
|
+
s != null && (t.style.paddingTop = `${s + n}px`, this.growInputForWrappedRows(t, s));
|
|
341
|
+
},
|
|
342
|
+
growInputForWrappedRows(e, t) {
|
|
343
|
+
this.initialInputHeight && (e.style.minHeight = `${t + this.initialInputHeight}px`);
|
|
344
|
+
},
|
|
345
|
+
getComputedPx(e, t) {
|
|
346
|
+
return parseFloat(getComputedStyle(e)[t]) || 0;
|
|
337
347
|
},
|
|
338
|
-
|
|
339
|
-
if (
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
348
|
+
getCaretRowTop(e, t, n, r) {
|
|
349
|
+
if (n && !r) return null;
|
|
350
|
+
let i = e.getBoundingClientRect().top - t.getBoundingClientRect().top;
|
|
351
|
+
if (n) return i;
|
|
352
|
+
let a = this.getComputedPx(this.$refs.chipsWrapper, "rowGap");
|
|
353
|
+
return i + e.getBoundingClientRect().height + a;
|
|
343
354
|
},
|
|
344
355
|
revertInputPadding(e) {
|
|
345
|
-
e.style.paddingInlineStart = "", e.style.
|
|
356
|
+
e.style.paddingInlineStart = "", e.style.paddingTop = "", e.style.minHeight = this.inputHeightFloor;
|
|
346
357
|
},
|
|
347
358
|
getFullWidth(e) {
|
|
348
359
|
let t = window.getComputedStyle(e);
|
|
@@ -371,13 +382,13 @@ var L = {
|
|
|
371
382
|
}
|
|
372
383
|
}
|
|
373
384
|
}
|
|
374
|
-
},
|
|
385
|
+
}, L = {
|
|
375
386
|
key: 1,
|
|
376
387
|
class: "d-combobox-multi-select__list--loading"
|
|
377
388
|
};
|
|
378
|
-
function
|
|
379
|
-
let o =
|
|
380
|
-
return
|
|
389
|
+
function R(e, t, n, r, i, a) {
|
|
390
|
+
let o = A("dt-chip"), s = A("dt-input"), c = A("dt-validation-messages"), l = A("dt-combobox-with-popover");
|
|
391
|
+
return D(), y(l, T({
|
|
381
392
|
ref: "comboboxWithPopover",
|
|
382
393
|
label: n.label,
|
|
383
394
|
"show-list": n.showList,
|
|
@@ -392,31 +403,31 @@ function z(e, t, n, r, i, a) {
|
|
|
392
403
|
}, a.extractNonListeners(e.$attrs), {
|
|
393
404
|
onSelect: a.onComboboxSelect,
|
|
394
405
|
onHighlight: a.comboboxHighlight
|
|
395
|
-
}),
|
|
396
|
-
input:
|
|
406
|
+
}), S({
|
|
407
|
+
input: N(({ onInput: e }) => [x("span", {
|
|
397
408
|
ref: "inputSlotWrapper",
|
|
398
409
|
class: "d-combobox-multi-select__input-wrapper",
|
|
399
410
|
onFocusin: t[1] || (t[1] = (...e) => a.handleInputFocusIn && a.handleInputFocusIn(...e)),
|
|
400
411
|
onFocusout: t[2] || (t[2] = (...e) => a.handleInputFocusOut && a.handleInputFocusOut(...e))
|
|
401
412
|
}, [
|
|
402
|
-
|
|
413
|
+
x("span", {
|
|
403
414
|
ref: "chipsWrapper",
|
|
404
|
-
class:
|
|
405
|
-
}, [(
|
|
415
|
+
class: E(["d-combobox-multi-select__chip-wrapper", a.chipWrapperClass])
|
|
416
|
+
}, [(D(!0), b(v, null, O(n.selectedItems, (e, t) => (D(), y(o, T({
|
|
406
417
|
ref_for: !0,
|
|
407
418
|
ref: "chips",
|
|
408
419
|
key: `${t}-${e}`,
|
|
409
420
|
interactive: !0,
|
|
410
|
-
"label-class": ["d-chip__label"],
|
|
421
|
+
"label-class": ["d-chip__label--focus-always"],
|
|
411
422
|
class: ["d-combobox-multi-select__chip", { "d-combobox-multi-select__chip--truncate": !!n.chipMaxWidth }],
|
|
412
423
|
style: { maxWidth: n.chipMaxWidth },
|
|
413
424
|
size: i.CHIP_SIZES[String(n.size)],
|
|
414
425
|
disabled: n.disabled
|
|
415
|
-
},
|
|
416
|
-
onKeydown:
|
|
426
|
+
}, M(a.chipListeners), {
|
|
427
|
+
onKeydown: P((t) => a.onChipRemove(e), ["backspace"]),
|
|
417
428
|
onClose: (t) => a.onChipRemove(e)
|
|
418
429
|
}), {
|
|
419
|
-
default:
|
|
430
|
+
default: N(() => [C(j(e), 1)]),
|
|
420
431
|
_: 2
|
|
421
432
|
}, 1040, [
|
|
422
433
|
"class",
|
|
@@ -426,7 +437,7 @@ function z(e, t, n, r, i, a) {
|
|
|
426
437
|
"onKeydown",
|
|
427
438
|
"onClose"
|
|
428
439
|
]))), 128))], 2),
|
|
429
|
-
|
|
440
|
+
w(s, T({
|
|
430
441
|
ref: "input",
|
|
431
442
|
modelValue: i.value,
|
|
432
443
|
"onUpdate:modelValue": t[0] || (t[0] = (e) => i.value = e),
|
|
@@ -459,7 +470,7 @@ function z(e, t, n, r, i, a) {
|
|
|
459
470
|
"size",
|
|
460
471
|
"onUpdate:modelValue"
|
|
461
472
|
]),
|
|
462
|
-
|
|
473
|
+
w(c, {
|
|
463
474
|
id: i.messagesId,
|
|
464
475
|
"validation-messages": n.maxSelectedMessage,
|
|
465
476
|
"show-messages": i.showValidationMessages
|
|
@@ -469,25 +480,25 @@ function z(e, t, n, r, i, a) {
|
|
|
469
480
|
"show-messages"
|
|
470
481
|
])
|
|
471
482
|
], 544)]),
|
|
472
|
-
list:
|
|
483
|
+
list: N(() => [x("div", {
|
|
473
484
|
ref: "list",
|
|
474
|
-
class:
|
|
475
|
-
onMousedown: t[3] || (t[3] =
|
|
476
|
-
}, [n.loading ? (
|
|
485
|
+
class: E(["d-combobox-multi-select__list", n.listClass]),
|
|
486
|
+
onMousedown: t[3] || (t[3] = F(() => {}, ["prevent"]))
|
|
487
|
+
}, [n.loading ? (D(), b("div", L, j(n.loadingMessage), 1)) : k(e.$slots, "list", { key: 0 })], 34)]),
|
|
477
488
|
_: 2
|
|
478
489
|
}, [i.hasSlotContent(e.$slots.header) ? {
|
|
479
490
|
name: "header",
|
|
480
|
-
fn:
|
|
491
|
+
fn: N(() => [x("div", {
|
|
481
492
|
ref: "header",
|
|
482
|
-
class:
|
|
483
|
-
}, [
|
|
493
|
+
class: E(n.headerClass)
|
|
494
|
+
}, [k(e.$slots, "header")], 2)]),
|
|
484
495
|
key: "0"
|
|
485
496
|
} : void 0, i.hasSlotContent(e.$slots.footer) ? {
|
|
486
497
|
name: "footer",
|
|
487
|
-
fn:
|
|
498
|
+
fn: N(() => [x("div", {
|
|
488
499
|
ref: "footer",
|
|
489
|
-
class:
|
|
490
|
-
}, [
|
|
500
|
+
class: E(n.footerClass)
|
|
501
|
+
}, [k(e.$slots, "footer")], 2)]),
|
|
491
502
|
key: "1"
|
|
492
503
|
} : void 0]), 1040, [
|
|
493
504
|
"label",
|
|
@@ -503,8 +514,8 @@ function z(e, t, n, r, i, a) {
|
|
|
503
514
|
"onHighlight"
|
|
504
515
|
]);
|
|
505
516
|
}
|
|
506
|
-
var
|
|
517
|
+
var z = /* @__PURE__ */ d(I, [["render", R]]);
|
|
507
518
|
//#endregion
|
|
508
|
-
export {
|
|
519
|
+
export { z as default };
|
|
509
520
|
|
|
510
521
|
//# sourceMappingURL=combobox-multi-select.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"combobox-multi-select.js","names":[],"sources":["../../../components/ComboboxMultiSelect/ComboboxMultiSelect.vue"],"sourcesContent":["<!-- eslint-disable vue/no-static-inline-styles -->\n<template>\n <dt-combobox-with-popover\n ref=\"comboboxWithPopover\"\n :label=\"label\"\n :show-list=\"showList\"\n :max-height=\"listMaxHeight\"\n :max-width=\"listMaxWidth\"\n :popover-offset=\"popoverOffset\"\n :has-suggestion-list=\"hasSuggestionList\"\n content-width=\"anchor\"\n :append-to=\"appendTo\"\n :dialog-class=\"dialogClass\"\n :transition=\"transition\"\n v-bind=\"extractNonListeners($attrs)\"\n @select=\"onComboboxSelect\"\n @highlight=\"comboboxHighlight\"\n >\n <template #input=\"{ onInput }\">\n <span\n ref=\"inputSlotWrapper\"\n class=\"d-combobox-multi-select__input-wrapper\"\n @focusin=\"handleInputFocusIn\"\n @focusout=\"handleInputFocusOut\"\n >\n <span\n ref=\"chipsWrapper\"\n :class=\"['d-combobox-multi-select__chip-wrapper', chipWrapperClass]\"\n >\n <dt-chip\n v-for=\"(item, index) in selectedItems\"\n ref=\"chips\"\n :key=\"`${index}-${item}`\"\n :interactive=\"true\"\n :label-class=\"['d-chip__label']\"\n :class=\"[\n 'd-combobox-multi-select__chip',\n { 'd-combobox-multi-select__chip--truncate': !!chipMaxWidth },\n ]\"\n :style=\"{ maxWidth: chipMaxWidth }\"\n :size=\"CHIP_SIZES[String(size)]\"\n :disabled=\"disabled\"\n v-on=\"chipListeners\"\n @keydown.backspace=\"onChipRemove(item)\"\n @close=\"onChipRemove(item)\"\n >\n {{ item }}\n </dt-chip>\n </span>\n\n <dt-input\n ref=\"input\"\n v-model=\"value\"\n class=\"d-combobox-multi-select__input\"\n :input-class=\"[\n inputClass, {\n 'd-combobox-multi-select__input--hidden': hideInputText,\n }]\"\n :input-wrapper-class=\"inputWrapperClass\"\n :disabled=\"disabled\"\n :aria-label=\"label\"\n :aria-invalid=\"ariaInvalid\"\n :aria-describedby=\"ariaDescribedBy\"\n :label=\"showLabel ? label : ''\"\n :description=\"description\"\n :placeholder=\"inputPlaceHolder\"\n :show-messages=\"showInputMessages\"\n :messages=\"inputMessages\"\n :size=\"size\"\n v-bind=\"inputListeners\"\n @update:model-value=\"onInput\"\n />\n\n <dt-validation-messages\n :id=\"messagesId\"\n :validation-messages=\"maxSelectedMessage\"\n :show-messages=\"showValidationMessages\"\n />\n </span>\n </template>\n\n <!-- @slot slot for popover header -->\n <template\n v-if=\"hasSlotContent($slots.header)\"\n #header\n >\n <div\n ref=\"header\"\n :class=\"headerClass\"\n >\n <slot name=\"header\" />\n </div>\n </template>\n\n <!-- @slot slot for popover list -->\n <template #list>\n <div\n ref=\"list\"\n :class=\"['d-combobox-multi-select__list', listClass]\"\n @mousedown.prevent\n >\n <slot\n v-if=\"!loading\"\n name=\"list\"\n />\n <div\n v-else\n class=\"d-combobox-multi-select__list--loading\"\n >\n {{ loadingMessage }}\n </div>\n </div>\n </template>\n\n <!-- @slot slot for popover footer -->\n <template\n v-if=\"hasSlotContent($slots.footer)\"\n #footer\n >\n <div\n ref=\"footer\"\n :class=\"footerClass\"\n >\n <slot name=\"footer\" />\n </div>\n </template>\n </dt-combobox-with-popover>\n</template>\n\n<script>\n/* eslint-disable max-lines */\nimport DtComboboxWithPopover from '@/components/ComboboxWithPopover/ComboboxWithPopover.vue';\nimport DtInput from '@/components/Input/Input.vue';\nimport DtChip from '@/components/Chip/Chip.vue';\nimport DtValidationMessages from '@/components/ValidationMessages/ValidationMessages.vue';\nimport { validationMessageValidator, ordinalSizeValidator } from '@/common/validators';\nimport { extractVueListeners, extractNonListeners, hasSlotContent, returnFirstEl, getUniqueString, getValidationState } from '@/common/utils';\nimport { HTML_ELEMENT_TYPE } from '@/common/constants';\nimport {\n POPOVER_APPEND_TO_VALUES,\n} from '@/components/Popover/PopoverConstants';\nimport {\n CHIP_SIZES,\n CHIP_TOP_POSITION,\n} from './ComboboxMultiSelectConstants';\nimport { COMPONENT_SIZES, VALIDATION_MESSAGE_TYPES } from '@/common/constants';\n\nexport default {\n name: 'DtComboboxMultiSelect',\n\n components: {\n DtComboboxWithPopover,\n DtInput,\n DtChip,\n DtValidationMessages,\n },\n\n inheritAttrs: false,\n\n props: {\n /**\n * String to use for the input label.\n */\n label: {\n type: String,\n required: true,\n },\n\n /**\n * Determines visibility of input label.\n * @values true, false\n */\n showLabel: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Description for the input\n */\n description: {\n type: String,\n default: '',\n },\n\n /**\n * Input placeholder\n */\n placeholder: {\n type: String,\n default: 'Select one or start typing',\n },\n\n /**\n * Input validation messages\n */\n inputMessages: {\n type: Array,\n default: () => [],\n validator: inputMessages => {\n return validationMessageValidator(inputMessages);\n },\n },\n\n /**\n * Show input validation message\n */\n showInputMessages: {\n type: Boolean,\n default: true,\n },\n\n // @TODO: https://dialpad.atlassian.net/browse/DP-52324\n // type: {\n // type: String,\n // values: ['input', 'select'],\n // default: 'select',\n // },\n\n /**\n * Determines if the list is loading\n */\n loading: {\n type: Boolean,\n default: false,\n },\n\n /**\n * The message when the list is loading\n */\n loadingMessage: {\n type: String,\n default: 'loading...',\n },\n\n /**\n * Determines when to show the list element and also controls the aria-expanded attribute.\n * Leaving this null will have the combobox trigger on input focus by default.\n * If you set this value, the default trigger behavior will be disabled and you can\n * control it as you need.\n */\n showList: {\n type: Boolean,\n default: null,\n },\n\n /**\n * Determines maximum height for the popover before overflow.\n * Possible units rem|px|em\n */\n listMaxHeight: {\n type: String,\n default: '300px',\n },\n\n /**\n * The selected items\n */\n selectedItems: {\n type: Array,\n default: function () { return []; },\n },\n\n /**\n * Would be the maximum number of selections you can make. 0 is unlimited\n */\n maxSelected: {\n type: Number,\n default: 0,\n },\n\n /**\n * Max select message when the max selections is exceeded with the structure:\n * `[{\"message\": string, \"type\": VALIDATION_MESSAGE_TYPES }]`\n */\n maxSelectedMessage: {\n type: Array,\n default: function () { return []; },\n },\n\n /**\n * Displays the list when the combobox is focused, before the user has typed anything.\n * When this is enabled the list will not close after selection.\n */\n hasSuggestionList: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Size of the chip.\n * @values 100, 200, 300\n */\n size: {\n type: [String, Number],\n default: 300,\n validator: ordinalSizeValidator(CHIP_SIZES),\n },\n\n /**\n * Sets the element to which the popover is going to append to.\n * 'body' will append to the nearest body (supports shadow DOM).\n * @values 'body', 'parent', HTMLElement,\n */\n appendTo: {\n type: [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 * Named transition when the content display is toggled.\n * @see DtLazyShow\n */\n transition: {\n type: String,\n default: 'fade',\n },\n\n /**\n * Determines whether the combobox should collapse to a single when losing focus.\n * @type {boolean}\n */\n collapseOnFocusOut: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Determines maximum width for the popover before overflow.\n * Possible units rem|px|em\n */\n listMaxWidth: {\n type: String,\n default: '',\n },\n\n /**\n * Amount of reserved space (in px) on the right side of the input\n * before the chips and the input caret jump to the next line.\n * default is 64\n */\n reservedRightSpace: {\n type: Number,\n default: 64,\n },\n\n /**\n * Determines the maximum width of a single chip. If the text within this chip exceeds the value\n * it will be truncated with ellipses.\n * Possible units rem|px|em\n */\n chipMaxWidth: {\n type: String,\n default: '',\n },\n\n /**\n * Additional class name for the input element.\n * Can accept String, Object, and Array, i.e. has the\n * same API as Vue's built-in handling of the class attribute.\n */\n inputClass: {\n type: [String, Object, Array],\n default: '',\n },\n\n /**\n * Additional class name for the input wrapper element.\n * Can accept all of String, Object, and Array, i.e. has the\n * same api as Vue's built-in handling of the class attribute.\n */\n inputWrapperClass: {\n type: [String, Object, Array],\n default: '',\n },\n\n /**\n * When true, disables the underlying input.\n */\n disabled: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Additional class name for the header wrapper element.\n */\n headerClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Additional class name for the footer wrapper element.\n */\n footerClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Additional class name for the list wrapper element.\n */\n listClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Additional class for the popover dialog element.\n */\n dialogClass: {\n type: [String, Object, Array],\n default: '',\n },\n },\n\n emits: [\n /**\n * Event fired to sync the modelValue prop with the parent component\n *\n * @event update:modelValue\n * @type {String}\n */\n 'update:modelValue',\n\n /**\n * Event fired when item selected\n *\n * @event select\n * @type {Number}\n */\n 'select',\n\n /**\n * Event fired when item removed\n *\n * @event remove\n * @type {String}\n */\n 'remove',\n\n /**\n * Event fired when max selected items limit is reached\n *\n * @event max-selected\n * @type {Object}\n */\n 'max-selected',\n\n /**\n * Native keydown event fired when a key is pressed in the text input.\n * For the common Escape and Enter cases, listen to `escape` / `enter` instead.\n *\n * @event keydown\n * @type {KeyboardEvent}\n */\n 'keydown',\n\n /**\n * Native keydown event fired when a key is pressed while a chip is focused.\n *\n * @event chip-keydown\n * @type {KeyboardEvent}\n */\n 'chip-keydown',\n\n /**\n * Fired when Escape is pressed in the text input.\n * Not fired when a chip is focused.\n *\n * @event escape\n * @type {KeyboardEvent}\n */\n 'escape',\n\n /**\n * Fired when Enter is pressed in the text input.\n * Not fired when a chip is focused.\n *\n * @event enter\n * @type {KeyboardEvent}\n */\n 'enter',\n\n /**\n * Event fired when combobox item is highlighted\n *\n * @event combobox-highlight\n * @type {Object}\n */\n 'combobox-highlight',\n ],\n\n data () {\n return {\n value: '',\n popoverOffset: [0, 4],\n showValidationMessages: false,\n resizeWindowObserver: null,\n initialInputHeight: null,\n CHIP_SIZES,\n hasSlotContent,\n inputFocused: false,\n hideInputText: false,\n messagesId: getUniqueString(),\n };\n },\n\n computed: {\n inputPlaceHolder () {\n return this.selectedItems?.length > 0 ? '' : this.placeholder;\n },\n\n chipListeners () {\n return {\n keydown: event => {\n if (this.disabled) return;\n this.onChipKeyDown(event);\n this.$emit('chip-keydown', event);\n },\n };\n },\n\n inputListeners () {\n return {\n ...extractVueListeners(this.$attrs),\n onInput: event => {\n this.$emit('update:modelValue', event);\n if (this.hasSuggestionList) {\n this.showComboboxList();\n }\n },\n\n onKeydown: event => {\n if (this.disabled) return;\n this.onInputKeyDown(event);\n this.$emit('keydown', event);\n // Use event.key (not event.code) so NumpadEnter normalizes to 'Enter'\n // and consumers don't have to special-case the numpad.\n const key = event.key?.toLowerCase();\n if (key === 'escape') {\n this.$emit('escape', event);\n } else if (key === 'enter') {\n this.$emit('enter', event);\n }\n },\n\n onClick: () => {\n if (this.hasSuggestionList) {\n this.showComboboxList();\n }\n },\n };\n },\n\n ariaInvalid () {\n return getValidationState(this.maxSelectedMessage) === VALIDATION_MESSAGE_TYPES.CRITICAL ? 'true' : undefined;\n },\n\n ariaDescribedBy () {\n return this.showValidationMessages && this.maxSelectedMessage.length > 0 ? this.messagesId : undefined;\n },\n\n chipWrapperClass () {\n return {\n [`d-combobox-multi-select__chip-wrapper-${COMPONENT_SIZES[String(this.size)] || this.size}--collapsed`]: !this.inputFocused && this.collapseOnFocusOut,\n };\n },\n },\n\n watch: {\n selectedItems: {\n deep: true,\n handler: async function () {\n await this.initSelectedItems();\n },\n },\n\n chipMaxWidth: {\n async handler () {\n await this.initSelectedItems();\n },\n },\n\n async label () {\n await this.$nextTick();\n // Adjust the chips position if label changed\n this.setChipsTopPosition();\n },\n\n async description () {\n await this.$nextTick();\n // Adjust the chips position if description changed\n this.setChipsTopPosition();\n },\n\n size: {\n async handler () {\n await this.$nextTick();\n const input = this.getInput();\n this.revertInputPadding(input);\n this.setInitialInputHeight();\n this.setInputPadding();\n this.setChipsTopPosition();\n },\n },\n },\n\n async mounted () {\n this.setInitialInputHeight();\n // Recalculate chip position and input padding when resizing window\n this.resizeWindowObserver = new ResizeObserver(async () => {\n this.setChipsTopPosition();\n this.setInputPadding();\n });\n this.resizeWindowObserver.observe(document.body);\n\n await this.initSelectedItems();\n },\n\n beforeUnmount () {\n this.resizeWindowObserver?.unobserve(document.body);\n },\n\n methods: {\n extractNonListeners,\n comboboxHighlight (highlightIndex) {\n this.$emit('combobox-highlight', highlightIndex);\n },\n\n async initSelectedItems () {\n await this.$nextTick();\n this.setInputPadding();\n this.setChipsTopPosition();\n this.setInputMinWidth();\n this.checkMaxSelected();\n },\n\n onChipRemove (item) {\n this.$emit('remove', item);\n this.$refs.input?.focus();\n },\n\n onComboboxSelect (i) {\n if (this.loading) return;\n this.value = '';\n this.$emit('select', i);\n },\n\n showComboboxList () {\n if (this.showList != null) { return; }\n this.$refs.comboboxWithPopover?.showComboboxList();\n },\n\n closeComboboxList () {\n if (this.showList != null) { return; }\n this.$refs.comboboxWithPopover?.closeComboboxList();\n },\n\n getChips () {\n if (!this.selectedItems.length || !this.$refs.chips) return null;\n\n // Use the order from selectedItems to not rely on DOM order which may be stale.\n // Track matched indices to handle duplicate item names correctly.\n const matched = new Set();\n const chips = this.selectedItems.map(item => {\n return this.$refs.chips.find((chip, index) => {\n if (matched.has(index)) return false;\n const chipLabel = returnFirstEl(chip.$el)?.querySelector('.d-chip__label')?.textContent?.trim();\n if (chipLabel === item) {\n matched.add(index);\n return true;\n }\n return false;\n });\n });\n return chips.filter(Boolean).map(chip => returnFirstEl(chip.$el));\n },\n\n getChipButtons () {\n const chips = this.getChips();\n return chips && chips.map(chip => returnFirstEl(chip).querySelector('button'));\n },\n\n getLastChipButton () {\n const chipButtons = this.getChipButtons();\n return chipButtons && chipButtons[chipButtons.length - 1];\n },\n\n getLastChip () {\n const chips = this.getChips();\n return chips && chips[chips.length - 1];\n },\n\n getFirstChip () {\n const chips = this.getChips();\n return chips && chips[0];\n },\n\n getInput () {\n return this.$refs.input?.$refs.input;\n },\n\n onChipKeyDown (event) {\n const key = event.code?.toLowerCase();\n if (key === 'arrowleft') {\n // Move to the previous chip\n this.navigateBetweenChips(event.target, true);\n } else if (key === 'arrowright') {\n if (event.target.id === this.getLastChipButton().id) {\n // Move to the input if it's the last chip\n this.moveFromChipToInput();\n } else {\n // Move to the next chip\n this.navigateBetweenChips(event.target, false);\n }\n }\n },\n\n onInputKeyDown (event) {\n const key = event.key?.toLowerCase();\n // If the cursor is at the start of the text,\n // press 'backspace' or 'left' focuses the last chip\n if (this.selectedItems.length > 0 && event.target.selectionStart === 0) {\n // if there is selected text, do not focus the last chip\n if (event.target.selectionEnd !== event.target.selectionStart) {\n return;\n }\n if (key === 'backspace' || key === 'arrowleft') {\n this.moveFromInputToChip();\n }\n }\n },\n\n moveFromInputToChip () {\n this.getLastChipButton().focus();\n this.$refs.input?.blur();\n this.closeComboboxList();\n },\n\n moveFromChipToInput () {\n this.getLastChipButton().blur();\n this.$refs.input?.focus();\n this.showComboboxList();\n },\n\n navigateBetweenChips (target, toLeft) {\n const from = this.getChipButtons().indexOf(target);\n const to = toLeft ? from - 1 : from + 1;\n if (to < 0 || to >= this.$refs.chips?.length) {\n return;\n }\n this.getChipButtons()[from].blur();\n this.getChipButtons()[to].focus();\n this.closeComboboxList();\n },\n\n setChipsTopPosition () {\n // To place the chips in the input box\n // The chip \"top\" position should be the same line as the input box\n const input = this.getInput();\n if (!input) return;\n const inputSlotWrapper = this.$refs.inputSlotWrapper;\n const top = input.getBoundingClientRect().top -\n inputSlotWrapper.getBoundingClientRect().top;\n const chipsWrapper = this.$refs.chipsWrapper;\n chipsWrapper.style.top = (top - CHIP_TOP_POSITION[String(this.size)]) + 'px';\n },\n\n setInputPadding () {\n const lastChip = this.getLastChip();\n const input = this.getInput();\n if (!input) return;\n this.revertInputPadding(input);\n this.popoverOffset = [0, 4];\n if (!lastChip) return;\n // Avoid adding extra padding when the input is not focused if collapseOnFocusOut is true\n // This ensures the input returns to its original state when resizing\n if (this.collapseOnFocusOut && !this.inputFocused) return;\n\n // Get the position of the last chip\n // The input cursor should be the same \"top\" as that chip and next besides it\n const left = lastChip.offsetLeft + this.getFullWidth(lastChip);\n const spaceLeft = input.getBoundingClientRect().width - left;\n const firstChip = this.getFirstChip();\n const isWrapped = firstChip && lastChip.offsetTop > firstChip.offsetTop;\n\n if (spaceLeft > this.reservedRightSpace) {\n input.style.paddingInlineStart = left + 'px';\n } else {\n input.style.paddingInlineStart = '4px';\n }\n\n const paddingTop = this.getInputPaddingTop(lastChip, spaceLeft > this.reservedRightSpace, isWrapped);\n if (paddingTop != null) input.style.paddingTop = `${paddingTop}px`;\n },\n\n getInputPaddingTop (lastChip, hasSpace, isWrapped) {\n // Chip fits beside the cursor on its row; CSS handles vertical centering.\n if (hasSpace && !isWrapped) return null;\n // Chip wrapped onto a new row with space remaining; align cursor to it.\n if (hasSpace) return lastChip.offsetTop + 2;\n // No space on the chip's row — predict next-row offsetTop so paddingTop\n // stays stable when a chip lands there.\n const chipMarginTop = parseFloat(getComputedStyle(lastChip).marginTop) || 0;\n const lastChipHeight = lastChip.getBoundingClientRect().height;\n return lastChip.offsetTop + lastChipHeight + chipMarginTop + 2;\n },\n\n revertInputPadding (input) {\n input.style.paddingInlineStart = '';\n input.style.paddingBlockStart = '';\n input.style.paddingBlockEnd = '';\n },\n\n getFullWidth (el) {\n const styles = window.getComputedStyle(el);\n return el.offsetWidth + parseInt(styles.marginLeft) + parseInt(styles.marginRight);\n },\n\n setInputMinWidth () {\n // Ensure the width of the input is \"slightly bigger\" than the width of a single chip\n const firstChip = this.getFirstChip();\n const input = this.getInput();\n if (!input) return;\n if (firstChip) {\n // Add 4px buffer for typing room\n input.style.minWidth = (this.getFullWidth(firstChip) + 4) + 'px';\n } else {\n input.style.minWidth = '';\n }\n },\n\n checkMaxSelected () {\n if (this.maxSelected === 0) return;\n if (this.selectedItems.length > this.maxSelected) {\n this.showValidationMessages = true;\n this.$emit('max-selected');\n } else {\n this.showValidationMessages = false;\n }\n },\n\n setInitialInputHeight () {\n const input = this.getInput();\n if (!input) return;\n input.style.minHeight = '';\n input.style.height = '';\n this.initialInputHeight = input.getBoundingClientRect().height;\n // xs renders correctly without a min-height floor; other sizes need it to grow when chips wrap.\n if (this.size !== 'xs') {\n input.style.minHeight = `${this.initialInputHeight}px`;\n input.style.height = 'auto';\n }\n },\n\n async handleInputFocusIn () {\n this.inputFocused = true;\n if (this.collapseOnFocusOut) {\n this.hideInputText = false;\n await this.$nextTick();\n this.setInputPadding();\n }\n },\n\n async handleInputFocusOut () {\n this.inputFocused = false;\n if (this.collapseOnFocusOut) {\n this.hideInputText = true;\n const input = this.getInput();\n if (!input) return;\n // Hide the input text when is not on first line\n if (!input.style.paddingTop) {\n return;\n }\n this.revertInputPadding(input);\n }\n },\n },\n};\n</script>\n"],"mappings":";;;;;;;;;;;;;AAmJA,IAAK,IAAU;CACb,MAAM;CAEN,YAAY;EACV,uBAAA;EACA,SAAA;EACA,QAAA;EACA,sBAAA;EACD;CAED,cAAc;CAEd,OAAO;EAIL,OAAO;GACL,MAAM;GACN,UAAU;GACX;EAMD,WAAW;GACT,MAAM;GACN,SAAS;GACV;EAKD,aAAa;GACX,MAAM;GACN,SAAS;GACV;EAKD,aAAa;GACX,MAAM;GACN,SAAS;GACV;EAKD,eAAe;GACb,MAAM;GACN,eAAe,EAAE;GACjB,YAAW,MACF,EAA2B,EAAc;GAEnD;EAKD,mBAAmB;GACjB,MAAM;GACN,SAAS;GACV;EAYD,SAAS;GACP,MAAM;GACN,SAAS;GACV;EAKD,gBAAgB;GACd,MAAM;GACN,SAAS;GACV;EAQD,UAAU;GACR,MAAM;GACN,SAAS;GACV;EAMD,eAAe;GACb,MAAM;GACN,SAAS;GACV;EAKD,eAAe;GACb,MAAM;GACN,SAAS,WAAY;AAAE,WAAO,EAAE;;GACjC;EAKD,aAAa;GACX,MAAM;GACN,SAAS;GACV;EAMD,oBAAoB;GAClB,MAAM;GACN,SAAS,WAAY;AAAE,WAAO,EAAE;;GACjC;EAMD,mBAAmB;GACjB,MAAM;GACN,SAAS;GACV;EAMD,MAAM;GACJ,MAAM,CAAC,QAAQ,OAAO;GACtB,SAAS;GACT,WAAW,EAAqB,EAAW;GAC5C;EAOD,UAAU;GACR,MAAM,CAAC,GAAmB,OAAO;GACjC,SAAS;GACT,YAAW,MACF,EAAyB,SAAS,EAAQ,IAC5C,aAAoB;GAE5B;EAMD,YAAY;GACV,MAAM;GACN,SAAS;GACV;EAMD,oBAAoB;GAClB,MAAM;GACN,SAAS;GACV;EAMD,cAAc;GACZ,MAAM;GACN,SAAS;GACV;EAOD,oBAAoB;GA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CAfN,EAeM,OAAA;GAdJ,KAAI;GACH,OAAK,EAAA,CAAA,iCAAoC,EAAA,UAAS,CAAA;GAClD,aAAS,EAAA,OAAA,EAAA,KAAA,QAAV,IAAkB,CAAA,UAAA,CAAA;MAGT,EAAA,WAEP,GAAA,EACF,EAKM,OALN,GAKM,EADD,EAAA,eAAc,EAAA,EAAA,IARnB,EAGE,EAAA,QAAA,QAAA,EAAA,KAAA,GAAA,CAAA,CAKiB,EAAA,GAAA,CAAA,CAAA;;KA1Bf,EAAA,eAAe,EAAA,OAAO,OAAM,GAAA;QACjC;cAOK,CALN,EAKM,OAAA;GAJJ,KAAI;GACH,OAAK,EAAE,EAAA,YAAW;MAEnB,EAAsB,EAAA,QAAA,SAAA,CAAA,EAAA,EAAA,CAAA,CAAA;;aA0BlB,EAAA,eAAe,EAAA,OAAO,OAAM,GAAA;QACjC;cAOK,CALN,EAKM,OAAA;GAJJ,KAAI;GACH,OAAK,EAAE,EAAA,YAAW;MAEnB,EAAsB,EAAA,QAAA,SAAA,CAAA,EAAA,EAAA,CAAA,CAAA"}
|
|
1
|
+
{"version":3,"file":"combobox-multi-select.js","names":[],"sources":["../../../components/ComboboxMultiSelect/ComboboxMultiSelect.vue"],"sourcesContent":["<!-- eslint-disable vue/no-static-inline-styles -->\n<template>\n <dt-combobox-with-popover\n ref=\"comboboxWithPopover\"\n :label=\"label\"\n :show-list=\"showList\"\n :max-height=\"listMaxHeight\"\n :max-width=\"listMaxWidth\"\n :popover-offset=\"popoverOffset\"\n :has-suggestion-list=\"hasSuggestionList\"\n content-width=\"anchor\"\n :append-to=\"appendTo\"\n :dialog-class=\"dialogClass\"\n :transition=\"transition\"\n v-bind=\"extractNonListeners($attrs)\"\n @select=\"onComboboxSelect\"\n @highlight=\"comboboxHighlight\"\n >\n <template #input=\"{ onInput }\">\n <span\n ref=\"inputSlotWrapper\"\n class=\"d-combobox-multi-select__input-wrapper\"\n @focusin=\"handleInputFocusIn\"\n @focusout=\"handleInputFocusOut\"\n >\n <span\n ref=\"chipsWrapper\"\n :class=\"['d-combobox-multi-select__chip-wrapper', chipWrapperClass]\"\n >\n <dt-chip\n v-for=\"(item, index) in selectedItems\"\n ref=\"chips\"\n :key=\"`${index}-${item}`\"\n :interactive=\"true\"\n :label-class=\"['d-chip__label--focus-always']\"\n :class=\"[\n 'd-combobox-multi-select__chip',\n { 'd-combobox-multi-select__chip--truncate': !!chipMaxWidth },\n ]\"\n :style=\"{ maxWidth: chipMaxWidth }\"\n :size=\"CHIP_SIZES[String(size)]\"\n :disabled=\"disabled\"\n v-on=\"chipListeners\"\n @keydown.backspace=\"onChipRemove(item)\"\n @close=\"onChipRemove(item)\"\n >\n {{ item }}\n </dt-chip>\n </span>\n\n <dt-input\n ref=\"input\"\n v-model=\"value\"\n class=\"d-combobox-multi-select__input\"\n :input-class=\"[\n inputClass, {\n 'd-combobox-multi-select__input--hidden': hideInputText,\n }]\"\n :input-wrapper-class=\"inputWrapperClass\"\n :disabled=\"disabled\"\n :aria-label=\"label\"\n :aria-invalid=\"ariaInvalid\"\n :aria-describedby=\"ariaDescribedBy\"\n :label=\"showLabel ? label : ''\"\n :description=\"description\"\n :placeholder=\"inputPlaceHolder\"\n :show-messages=\"showInputMessages\"\n :messages=\"inputMessages\"\n :size=\"size\"\n v-bind=\"inputListeners\"\n @update:model-value=\"onInput\"\n />\n\n <dt-validation-messages\n :id=\"messagesId\"\n :validation-messages=\"maxSelectedMessage\"\n :show-messages=\"showValidationMessages\"\n />\n </span>\n </template>\n\n <!-- @slot slot for popover header -->\n <template\n v-if=\"hasSlotContent($slots.header)\"\n #header\n >\n <div\n ref=\"header\"\n :class=\"headerClass\"\n >\n <slot name=\"header\" />\n </div>\n </template>\n\n <!-- @slot slot for popover list -->\n <template #list>\n <div\n ref=\"list\"\n :class=\"['d-combobox-multi-select__list', listClass]\"\n @mousedown.prevent\n >\n <slot\n v-if=\"!loading\"\n name=\"list\"\n />\n <div\n v-else\n class=\"d-combobox-multi-select__list--loading\"\n >\n {{ loadingMessage }}\n </div>\n </div>\n </template>\n\n <!-- @slot slot for popover footer -->\n <template\n v-if=\"hasSlotContent($slots.footer)\"\n #footer\n >\n <div\n ref=\"footer\"\n :class=\"footerClass\"\n >\n <slot name=\"footer\" />\n </div>\n </template>\n </dt-combobox-with-popover>\n</template>\n\n<script>\n/* eslint-disable max-lines */\nimport DtComboboxWithPopover from '@/components/ComboboxWithPopover/ComboboxWithPopover.vue';\nimport DtInput from '@/components/Input/Input.vue';\nimport DtChip from '@/components/Chip/Chip.vue';\nimport DtValidationMessages from '@/components/ValidationMessages/ValidationMessages.vue';\nimport { validationMessageValidator, ordinalSizeValidator } from '@/common/validators';\nimport { extractVueListeners, extractNonListeners, hasSlotContent, returnFirstEl, getUniqueString, getValidationState } from '@/common/utils';\nimport { HTML_ELEMENT_TYPE } from '@/common/constants';\nimport {\n POPOVER_APPEND_TO_VALUES,\n} from '@/components/Popover/PopoverConstants';\nimport {\n CHIP_SIZES,\n} from './ComboboxMultiSelectConstants';\nimport { COMPONENT_SIZES, VALIDATION_MESSAGE_TYPES } from '@/common/constants';\n\nexport default {\n name: 'DtComboboxMultiSelect',\n\n components: {\n DtComboboxWithPopover,\n DtInput,\n DtChip,\n DtValidationMessages,\n },\n\n inheritAttrs: false,\n\n props: {\n /**\n * String to use for the input label.\n */\n label: {\n type: String,\n required: true,\n },\n\n /**\n * Determines visibility of input label.\n * @values true, false\n */\n showLabel: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Description for the input\n */\n description: {\n type: String,\n default: '',\n },\n\n /**\n * Input placeholder\n */\n placeholder: {\n type: String,\n default: 'Select one or start typing',\n },\n\n /**\n * Input validation messages\n */\n inputMessages: {\n type: Array,\n default: () => [],\n validator: inputMessages => {\n return validationMessageValidator(inputMessages);\n },\n },\n\n /**\n * Show input validation message\n */\n showInputMessages: {\n type: Boolean,\n default: true,\n },\n\n // @TODO: https://dialpad.atlassian.net/browse/DP-52324\n // type: {\n // type: String,\n // values: ['input', 'select'],\n // default: 'select',\n // },\n\n /**\n * Determines if the list is loading\n */\n loading: {\n type: Boolean,\n default: false,\n },\n\n /**\n * The message when the list is loading\n */\n loadingMessage: {\n type: String,\n default: 'loading...',\n },\n\n /**\n * Determines when to show the list element and also controls the aria-expanded attribute.\n * Leaving this null will have the combobox trigger on input focus by default.\n * If you set this value, the default trigger behavior will be disabled and you can\n * control it as you need.\n */\n showList: {\n type: Boolean,\n default: null,\n },\n\n /**\n * Determines maximum height for the popover before overflow.\n * Possible units rem|px|em\n */\n listMaxHeight: {\n type: String,\n default: '300px',\n },\n\n /**\n * The selected items\n */\n selectedItems: {\n type: Array,\n default: function () { return []; },\n },\n\n /**\n * Would be the maximum number of selections you can make. 0 is unlimited\n */\n maxSelected: {\n type: Number,\n default: 0,\n },\n\n /**\n * Max select message when the max selections is exceeded with the structure:\n * `[{\"message\": string, \"type\": VALIDATION_MESSAGE_TYPES }]`\n */\n maxSelectedMessage: {\n type: Array,\n default: function () { return []; },\n },\n\n /**\n * Displays the list when the combobox is focused, before the user has typed anything.\n * When this is enabled the list will not close after selection.\n */\n hasSuggestionList: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Size of the chip.\n * @values 100, 200, 300\n */\n size: {\n type: [String, Number],\n default: 300,\n validator: ordinalSizeValidator(CHIP_SIZES),\n },\n\n /**\n * Sets the element to which the popover is going to append to.\n * 'body' will append to the nearest body (supports shadow DOM).\n * @values 'body', 'parent', HTMLElement,\n */\n appendTo: {\n type: [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 * Named transition when the content display is toggled.\n * @see DtLazyShow\n */\n transition: {\n type: String,\n default: 'fade',\n },\n\n /**\n * Determines whether the combobox should collapse to a single when losing focus.\n * @type {boolean}\n */\n collapseOnFocusOut: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Determines maximum width for the popover before overflow.\n * Possible units rem|px|em\n */\n listMaxWidth: {\n type: String,\n default: '',\n },\n\n /**\n * Amount of reserved space (in px) on the right side of the input\n * before the chips and the input caret jump to the next line.\n * default is 64\n */\n reservedRightSpace: {\n type: Number,\n default: 64,\n },\n\n /**\n * Determines the maximum width of a single chip. If the text within this chip exceeds the value\n * it will be truncated with ellipses.\n * Possible units rem|px|em\n */\n chipMaxWidth: {\n type: String,\n default: '',\n },\n\n /**\n * Additional class name for the input element.\n * Can accept String, Object, and Array, i.e. has the\n * same API as Vue's built-in handling of the class attribute.\n */\n inputClass: {\n type: [String, Object, Array],\n default: '',\n },\n\n /**\n * Additional class name for the input wrapper element.\n * Can accept all of String, Object, and Array, i.e. has the\n * same api as Vue's built-in handling of the class attribute.\n */\n inputWrapperClass: {\n type: [String, Object, Array],\n default: '',\n },\n\n /**\n * When true, disables the underlying input.\n */\n disabled: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Additional class name for the header wrapper element.\n */\n headerClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Additional class name for the footer wrapper element.\n */\n footerClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Additional class name for the list wrapper element.\n */\n listClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Additional class for the popover dialog element.\n */\n dialogClass: {\n type: [String, Object, Array],\n default: '',\n },\n },\n\n emits: [\n /**\n * Event fired to sync the modelValue prop with the parent component\n *\n * @event update:modelValue\n * @type {String}\n */\n 'update:modelValue',\n\n /**\n * Event fired when item selected\n *\n * @event select\n * @type {Number}\n */\n 'select',\n\n /**\n * Event fired when item removed\n *\n * @event remove\n * @type {String}\n */\n 'remove',\n\n /**\n * Event fired when max selected items limit is reached\n *\n * @event max-selected\n * @type {Object}\n */\n 'max-selected',\n\n /**\n * Native keydown event fired when a key is pressed in the text input.\n * For the common Escape and Enter cases, listen to `escape` / `enter` instead.\n *\n * @event keydown\n * @type {KeyboardEvent}\n */\n 'keydown',\n\n /**\n * Native keydown event fired when a key is pressed while a chip is focused.\n *\n * @event chip-keydown\n * @type {KeyboardEvent}\n */\n 'chip-keydown',\n\n /**\n * Fired when Escape is pressed in the text input.\n * Not fired when a chip is focused.\n *\n * @event escape\n * @type {KeyboardEvent}\n */\n 'escape',\n\n /**\n * Fired when Enter is pressed in the text input.\n * Not fired when a chip is focused.\n *\n * @event enter\n * @type {KeyboardEvent}\n */\n 'enter',\n\n /**\n * Event fired when combobox item is highlighted\n *\n * @event combobox-highlight\n * @type {Object}\n */\n 'combobox-highlight',\n ],\n\n data () {\n return {\n value: '',\n popoverOffset: [0, 4],\n showValidationMessages: false,\n resizeWindowObserver: null,\n initialInputHeight: null,\n CHIP_SIZES,\n hasSlotContent,\n inputFocused: false,\n hideInputText: false,\n messagesId: getUniqueString(),\n };\n },\n\n computed: {\n inputPlaceHolder () {\n return this.selectedItems?.length > 0 ? '' : this.placeholder;\n },\n\n chipListeners () {\n return {\n keydown: event => {\n if (this.disabled) return;\n this.onChipKeyDown(event);\n this.$emit('chip-keydown', event);\n },\n };\n },\n\n inputListeners () {\n return {\n ...extractVueListeners(this.$attrs),\n onInput: event => {\n this.$emit('update:modelValue', event);\n if (this.hasSuggestionList) {\n this.showComboboxList();\n }\n },\n\n onKeydown: event => {\n if (this.disabled) return;\n this.onInputKeyDown(event);\n this.$emit('keydown', event);\n // Use event.key (not event.code) so NumpadEnter normalizes to 'Enter'\n // and consumers don't have to special-case the numpad.\n const key = event.key?.toLowerCase();\n if (key === 'escape') {\n this.$emit('escape', event);\n } else if (key === 'enter') {\n this.$emit('enter', event);\n }\n },\n\n onClick: () => {\n if (this.hasSuggestionList) {\n this.showComboboxList();\n }\n },\n };\n },\n\n ariaInvalid () {\n return getValidationState(this.maxSelectedMessage) === VALIDATION_MESSAGE_TYPES.CRITICAL ? 'true' : undefined;\n },\n\n ariaDescribedBy () {\n return this.showValidationMessages && this.maxSelectedMessage.length > 0 ? this.messagesId : undefined;\n },\n\n // Sizes other than xs need a height floor so the box can grow for wrapped\n // chip rows without collapsing back; xs renders correctly without one.\n inputHeightFloor () {\n return (this.initialInputHeight && this.size !== 'xs')\n ? `${this.initialInputHeight}px`\n : '';\n },\n\n chipWrapperClass () {\n const size = COMPONENT_SIZES[String(this.size)] || this.size;\n return [\n // Always emitted so the CSS can size the row rhythm without reaching\n // sideways into DtInput's markup to discover the size.\n `d-combobox-multi-select__chip-wrapper--${size}`,\n {\n [`d-combobox-multi-select__chip-wrapper-${size}--collapsed`]: !this.inputFocused && this.collapseOnFocusOut,\n },\n ];\n },\n },\n\n watch: {\n selectedItems: {\n deep: true,\n handler: async function () {\n await this.initSelectedItems();\n },\n },\n\n chipMaxWidth: {\n async handler () {\n await this.initSelectedItems();\n },\n },\n\n async label () {\n await this.$nextTick();\n // Adjust the chips position if label changed\n this.setChipsTopPosition();\n },\n\n async description () {\n await this.$nextTick();\n // Adjust the chips position if description changed\n this.setChipsTopPosition();\n },\n\n size: {\n async handler () {\n await this.$nextTick();\n const input = this.getInput();\n this.revertInputPadding(input);\n this.setInitialInputHeight();\n this.setInputPadding();\n this.setChipsTopPosition();\n },\n },\n },\n\n async mounted () {\n this.setInitialInputHeight();\n // Recalculate chip position and input padding when resizing window\n this.resizeWindowObserver = new ResizeObserver(async () => {\n this.setChipsTopPosition();\n this.setInputPadding();\n });\n this.resizeWindowObserver.observe(document.body);\n\n await this.initSelectedItems();\n },\n\n beforeUnmount () {\n this.resizeWindowObserver?.unobserve(document.body);\n },\n\n methods: {\n extractNonListeners,\n comboboxHighlight (highlightIndex) {\n this.$emit('combobox-highlight', highlightIndex);\n },\n\n async initSelectedItems () {\n await this.$nextTick();\n this.setInputPadding();\n this.setChipsTopPosition();\n this.setInputMinWidth();\n this.checkMaxSelected();\n },\n\n onChipRemove (item) {\n this.$emit('remove', item);\n this.$refs.input?.focus();\n },\n\n onComboboxSelect (i) {\n if (this.loading) return;\n this.value = '';\n this.$emit('select', i);\n },\n\n showComboboxList () {\n if (this.showList != null) { return; }\n this.$refs.comboboxWithPopover?.showComboboxList();\n },\n\n closeComboboxList () {\n if (this.showList != null) { return; }\n this.$refs.comboboxWithPopover?.closeComboboxList();\n },\n\n getChips () {\n if (!this.selectedItems.length || !this.$refs.chips) return null;\n\n // Use the order from selectedItems to not rely on DOM order which may be stale.\n // Track matched indices to handle duplicate item names correctly.\n const matched = new Set();\n const chips = this.selectedItems.map(item => {\n return this.$refs.chips.find((chip, index) => {\n if (matched.has(index)) return false;\n const chipLabel = returnFirstEl(chip.$el)?.querySelector('.d-chip__label')?.textContent?.trim();\n if (chipLabel === item) {\n matched.add(index);\n return true;\n }\n return false;\n });\n });\n return chips.filter(Boolean).map(chip => returnFirstEl(chip.$el));\n },\n\n getChipButtons () {\n const chips = this.getChips();\n return chips && chips.map(chip => returnFirstEl(chip).querySelector('button'));\n },\n\n getLastChipButton () {\n const chipButtons = this.getChipButtons();\n return chipButtons && chipButtons[chipButtons.length - 1];\n },\n\n getLastChip () {\n const chips = this.getChips();\n return chips && chips[chips.length - 1];\n },\n\n getFirstChip () {\n const chips = this.getChips();\n return chips && chips[0];\n },\n\n getInput () {\n return this.$refs.input?.$refs.input;\n },\n\n onChipKeyDown (event) {\n const key = event.code?.toLowerCase();\n if (key === 'arrowleft') {\n // Move to the previous chip\n this.navigateBetweenChips(event.target, true);\n } else if (key === 'arrowright') {\n if (event.target.id === this.getLastChipButton().id) {\n // Move to the input if it's the last chip\n this.moveFromChipToInput();\n } else {\n // Move to the next chip\n this.navigateBetweenChips(event.target, false);\n }\n }\n },\n\n onInputKeyDown (event) {\n const key = event.key?.toLowerCase();\n // If the cursor is at the start of the text,\n // press 'backspace' or 'left' focuses the last chip\n if (this.selectedItems.length > 0 && event.target.selectionStart === 0) {\n // if there is selected text, do not focus the last chip\n if (event.target.selectionEnd !== event.target.selectionStart) {\n return;\n }\n if (key === 'backspace' || key === 'arrowleft') {\n this.moveFromInputToChip();\n }\n }\n },\n\n moveFromInputToChip () {\n this.getLastChipButton().focus();\n this.$refs.input?.blur();\n this.closeComboboxList();\n },\n\n moveFromChipToInput () {\n this.getLastChipButton().blur();\n this.$refs.input?.focus();\n this.showComboboxList();\n },\n\n navigateBetweenChips (target, toLeft) {\n const from = this.getChipButtons().indexOf(target);\n const to = toLeft ? from - 1 : from + 1;\n if (to < 0 || to >= this.$refs.chips?.length) {\n return;\n }\n this.getChipButtons()[from].blur();\n this.getChipButtons()[to].focus();\n this.closeComboboxList();\n },\n\n setChipsTopPosition () {\n // Centers the first row of chips on the input box's first line.\n // Two offsets have to be measured rather than derived: the input's\n // position within the slot wrapper (label and description heights vary),\n // and the chip's position within its own wrapper (the chips are atomic\n // inline boxes, so line-box metrics — not just the chip margin — decide\n // where the row starts).\n const input = this.getInput();\n const chipsWrapper = this.$refs.chipsWrapper;\n const firstChip = this.getFirstChip();\n if (!input || !chipsWrapper || !firstChip) return;\n\n const inputTop = input.getBoundingClientRect().top -\n this.$refs.inputSlotWrapper.getBoundingClientRect().top;\n // The empty-input height, so chips stay on the first line rather than\n // recentering on the whole box once it grows to fit wrapped rows.\n const inputRowHeight = this.initialInputHeight || input.getBoundingClientRect().height;\n const chipRect = firstChip.getBoundingClientRect();\n const chipOffsetInWrapper = chipRect.top - chipsWrapper.getBoundingClientRect().top;\n\n const top = inputTop + (inputRowHeight - chipRect.height) / 2 - chipOffsetInWrapper;\n chipsWrapper.style.top = top + 'px';\n },\n\n setInputPadding () {\n const lastChip = this.getLastChip();\n const input = this.getInput();\n if (!input) return;\n this.revertInputPadding(input);\n this.popoverOffset = [0, 4];\n if (!lastChip) return;\n // Avoid adding extra padding when the input is not focused if collapseOnFocusOut is true\n // This ensures the input returns to its original state when resizing\n if (this.collapseOnFocusOut && !this.inputFocused) return;\n\n // Read while revertInputPadding() above has the inline override cleared,\n // so this is the input's own padding rather than a previous run's value.\n const inputPaddingTop = this.getComputedPx(input, 'paddingTop');\n\n // Get the position of the last chip\n // The input cursor should be the same \"top\" as that chip and next besides it\n const left = lastChip.offsetLeft + this.getFullWidth(lastChip);\n const spaceLeft = input.getBoundingClientRect().width - left;\n const firstChip = this.getFirstChip();\n const isWrapped = firstChip && lastChip.offsetTop > firstChip.offsetTop;\n\n if (spaceLeft > this.reservedRightSpace) {\n input.style.paddingInlineStart = left + 'px';\n } else {\n input.style.paddingInlineStart = '4px';\n }\n\n const caretRowTop = this.getCaretRowTop(lastChip, firstChip, spaceLeft > this.reservedRightSpace, isWrapped);\n if (caretRowTop != null) {\n // Adding the input's own padding reproduces the single-row layout on\n // the caret's row, so the typed text keeps the same baseline relative\n // to the chips beside it no matter how many rows have accumulated.\n input.style.paddingTop = `${caretRowTop + inputPaddingTop}px`;\n this.growInputForWrappedRows(input, caretRowTop);\n }\n },\n\n growInputForWrappedRows (input, caretRowTop) {\n // The grown box would otherwise end at the caret line, leaving the last\n // chip row flush against the block-end border. Extend the height floor\n // so the last row keeps the same breathing room the first row gets from\n // centering: its row top plus the single-row envelope.\n if (!this.initialInputHeight) return;\n input.style.minHeight = `${caretRowTop + this.initialInputHeight}px`;\n },\n\n getComputedPx (el, property) {\n return parseFloat(getComputedStyle(el)[property]) || 0;\n },\n\n // Distance from the first chip row to the row the caret belongs on.\n getCaretRowTop (lastChip, firstChip, hasSpace, isWrapped) {\n // Chip fits beside the cursor on the first row; CSS centers it already.\n if (hasSpace && !isWrapped) return null;\n // Measured rather than offsetTop, which rounds to whole pixels and drifts\n // further out of alignment with every row added.\n const rowTop = lastChip.getBoundingClientRect().top - firstChip.getBoundingClientRect().top;\n // Chip wrapped onto a new row with space remaining; share that row.\n if (hasSpace) return rowTop;\n // No space left on that row — predict the next one. Row spacing belongs\n // to the wrapper's row-gap, not to the chip.\n const rowGap = this.getComputedPx(this.$refs.chipsWrapper, 'rowGap');\n return rowTop + lastChip.getBoundingClientRect().height + rowGap;\n },\n\n revertInputPadding (input) {\n input.style.paddingInlineStart = '';\n // setInputPadding writes the physical paddingTop slot, so that is the\n // slot to clear — the logical one is a different CSSOM property.\n input.style.paddingTop = '';\n // Restore the single-row height floor that setInitialInputHeight\n // applies (setInputPadding grows it while rows are wrapped).\n input.style.minHeight = this.inputHeightFloor;\n },\n\n getFullWidth (el) {\n const styles = window.getComputedStyle(el);\n return el.offsetWidth + parseInt(styles.marginLeft) + parseInt(styles.marginRight);\n },\n\n setInputMinWidth () {\n // Ensure the width of the input is \"slightly bigger\" than the width of a single chip\n const firstChip = this.getFirstChip();\n const input = this.getInput();\n if (!input) return;\n if (firstChip) {\n // Add 4px buffer for typing room\n input.style.minWidth = (this.getFullWidth(firstChip) + 4) + 'px';\n } else {\n input.style.minWidth = '';\n }\n },\n\n checkMaxSelected () {\n if (this.maxSelected === 0) return;\n if (this.selectedItems.length > this.maxSelected) {\n this.showValidationMessages = true;\n this.$emit('max-selected');\n } else {\n this.showValidationMessages = false;\n }\n },\n\n setInitialInputHeight () {\n const input = this.getInput();\n if (!input) return;\n input.style.minHeight = '';\n input.style.height = '';\n this.initialInputHeight = input.getBoundingClientRect().height;\n // xs renders correctly without a min-height floor; other sizes need it to grow when chips wrap.\n if (this.size !== 'xs') {\n input.style.minHeight = `${this.initialInputHeight}px`;\n input.style.height = 'auto';\n }\n },\n\n async handleInputFocusIn () {\n this.inputFocused = true;\n if (this.collapseOnFocusOut) {\n this.hideInputText = false;\n await this.$nextTick();\n this.setInputPadding();\n }\n },\n\n async handleInputFocusOut () {\n this.inputFocused = false;\n if (this.collapseOnFocusOut) {\n this.hideInputText = true;\n const input = this.getInput();\n if (!input) return;\n // Hide the input text when is not on first line\n if (!input.style.paddingTop) {\n return;\n }\n this.revertInputPadding(input);\n }\n },\n },\n};\n</script>\n"],"mappings":";;;;;;;;;;;;;AAkJA,IAAK,IAAU;CACb,MAAM;CAEN,YAAY;EACV,uBAAA;EACA,SAAA;EACA,QAAA;EACA,sBAAA;EACD;CAED,cAAc;CAEd,OAAO;EAIL,OAAO;GACL,MAAM;GACN,UAAU;GACX;EAMD,WAAW;GACT,MAAM;GACN,SAAS;GACV;EAKD,aAAa;GACX,MAAM;GACN,SAAS;GACV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AAA,EAAA,MAAA,IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA,CAAA;GAG9B,EAIE,GAAA;IAHC,IAAI,EAAA;IACJ,uBAAqB,EAAA;IACrB,iBAAe,EAAA;;;;;;;EAmBX,MAAI,QAgBP,CAfN,EAeM,OAAA;GAdJ,KAAI;GACH,OAAK,EAAA,CAAA,iCAAoC,EAAA,UAAS,CAAA;GAClD,aAAS,EAAA,OAAA,EAAA,KAAA,QAAV,IAAkB,CAAA,UAAA,CAAA;MAGT,EAAA,WAEP,GAAA,EACF,EAKM,OALN,GAKM,EADD,EAAA,eAAc,EAAA,EAAA,IARnB,EAGE,EAAA,QAAA,QAAA,EAAA,KAAA,GAAA,CAAA,CAKiB,EAAA,GAAA,CAAA,CAAA;;KA1Bf,EAAA,eAAe,EAAA,OAAO,OAAM,GAAA;QACjC;cAOK,CALN,EAKM,OAAA;GAJJ,KAAI;GACH,OAAK,EAAE,EAAA,YAAW;MAEnB,EAAsB,EAAA,QAAA,SAAA,CAAA,EAAA,EAAA,CAAA,CAAA;;aA0BlB,EAAA,eAAe,EAAA,OAAO,OAAM,GAAA;QACjC;cAOK,CALN,EAKM,OAAA;GAJJ,KAAI;GACH,OAAK,EAAE,EAAA,YAAW;MAEnB,EAAsB,EAAA,QAAA,SAAA,CAAA,EAAA,EAAA,CAAA,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dialpad/dialtone-vue",
|
|
3
|
-
"version": "3.224.0-next.
|
|
3
|
+
"version": "3.224.0-next.3",
|
|
4
4
|
"description": "Vue component library for Dialpad's design system Dialtone",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist"
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"regex-combined-emojis": "1.6.0",
|
|
48
48
|
"tippy.js": "6.3.7",
|
|
49
49
|
"@dialpad/dialtone-emojis": "1.2.6-next.1",
|
|
50
|
-
"@dialpad/dialtone-icons": "4.56.0-next.
|
|
50
|
+
"@dialpad/dialtone-icons": "4.56.0-next.2"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"@storybook/addon-a11y": "10.3.0",
|
|
@@ -61,12 +61,12 @@
|
|
|
61
61
|
"react": "19.2.4",
|
|
62
62
|
"storybook": "10.3.0",
|
|
63
63
|
"vue": "^3.3.4",
|
|
64
|
-
"@dialpad/dialtone-css": "8.81.0-next.
|
|
64
|
+
"@dialpad/dialtone-css": "8.81.0-next.9",
|
|
65
65
|
"@dialpad/generator-dialtone": "0.1.0"
|
|
66
66
|
},
|
|
67
67
|
"peerDependencies": {
|
|
68
68
|
"vue": ">=3.2",
|
|
69
|
-
"@dialpad/dialtone-css": "^8.81.0-next.
|
|
69
|
+
"@dialpad/dialtone-css": "^8.81.0-next.9"
|
|
70
70
|
},
|
|
71
71
|
"bugs": {
|
|
72
72
|
"email": "dialtone@dialpad.com"
|