@dialpad/dialtone 9.174.0 → 9.175.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/tokens/doc.json +91782 -91782
- package/dist/vue3/lib/combobox-multi-select/combobox-multi-select.cjs +1 -1
- package/dist/vue3/lib/combobox-multi-select/combobox-multi-select.cjs.map +1 -1
- package/dist/vue3/lib/combobox-multi-select/combobox-multi-select.js +119 -117
- package/dist/vue3/lib/combobox-multi-select/combobox-multi-select.js.map +1 -1
- package/dist/vue3/lib/rich-text-editor/rich-text-editor.cjs +4 -4
- package/dist/vue3/lib/rich-text-editor/rich-text-editor.cjs.map +1 -1
- package/dist/vue3/lib/rich-text-editor/rich-text-editor.js +148 -141
- package/dist/vue3/lib/rich-text-editor/rich-text-editor.js.map +1 -1
- package/dist/vue3/types/components/rich_text_editor/extensions/table/table.d.ts.map +1 -1
- package/package.json +3 -3
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const f=require("../combobox-with-popover/combobox-with-popover.cjs"),b=require("../input/input.cjs"),C=require("../chip/chip.cjs"),x=require("../validation-messages/validation-messages.cjs"),y=require("../../common/validators/index.cjs"),h=require("../../common/utils/index.cjs"),I=require("../popover/popover-constants.cjs"),p=require("./combobox-multi-select-constants.cjs"),s=require("vue"),w=require("../../_plugin-vue_export-helper-BRilXfQE.cjs"),_={compatConfig:{MODE:3},name:"DtComboboxMultiSelect",components:{DtComboboxWithPopover:f.default,DtInput:b.default,DtChip:C.default,DtValidationMessages:x.default},inheritAttrs:!1,props:{label:{type:String,required:!0},labelVisible:{type:Boolean,default:!0},description:{type:String,default:""},placeholder:{type:String,default:"Select one or start typing"},inputMessages:{type:Array,default:()=>[],validator:e=>y.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,default:"md",validator:e=>Object.values(p.MULTI_SELECT_SIZES).includes(e)},appendTo:{type:[HTMLElement,String],default:"body",validator:e=>I.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}},emits:["input","select","remove","max-selected","keyup","keydown","combobox-highlight"],data(){return{value:"",popoverOffset:[0,4],showValidationMessages:!1,resizeWindowObserver:null,initialInputHeight:null,CHIP_SIZES:p.CHIP_SIZES,hasSlotContent:h.hasSlotContent,inputFocused:!1,hideInputText:!1}},computed:{inputPlaceHolder(){var e;return((e=this.selectedItems)==null?void 0:e.length)>0?"":this.placeholder},chipListeners(){return{keydown:e=>{this.onChipKeyDown(e),this.$emit("keydown",e)}}},inputListeners(){return{...h.extractVueListeners(this.$attrs),onInput:e=>{this.$emit("input",e),this.hasSuggestionList&&this.showComboboxList()},onKeydown:e=>{this.onInputKeyDown(e)},onKeyup:e=>{this.$emit("keyup",e)},onClick:()=>{this.hasSuggestionList&&this.showComboboxList()}}},chipWrapperClass(){return{[`d-recipe-combobox-multi-select__chip-wrapper-${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();const e=this.getInput();this.revertInputPadding(e),this.initialInputHeight=e.getBoundingClientRect().height,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(){var e;(e=this.resizeWindowObserver)==null||e.unobserve(document.body)},methods:{extractNonListeners:h.extractNonListeners,comboboxHighlight(e){this.$emit("combobox-highlight",e)},async initSelectedItems(){await this.$nextTick(),this.setInputPadding(),this.setChipsTopPosition(),this.setInputMinWidth(),this.checkMaxSelected()},onChipRemove(e){var t;this.$emit("remove",e),(t=this.$refs.input)==null||t.focus()},onComboboxSelect(e){this.loading||(this.value="",this.$emit("select",e))},showComboboxList(){var e;this.showList==null&&((e=this.$refs.comboboxWithPopover)==null||e.showComboboxList())},closeComboboxList(){var e;this.showList==null&&((e=this.$refs.comboboxWithPopover)==null||e.closeComboboxList())},getChips(){return!this.selectedItems.length||!this.$refs.chips?null:this.selectedItems.map(t=>this.$refs.chips.find(i=>{var n,o,r;return((r=(o=(n=h.returnFirstEl(i.$el))==null?void 0:n.querySelector(".d-chip__label"))==null?void 0:o.textContent)==null?void 0:r.trim())===t})).filter(Boolean).map(t=>h.returnFirstEl(t.$el))},getChipButtons(){const e=this.getChips();return e&&e.map(t=>h.returnFirstEl(t).querySelector("button"))},getLastChipButton(){const e=this.getChipButtons();return e&&e[e.length-1]},getLastChip(){const e=this.getChips();return e&&e[e.length-1]},getFirstChip(){const e=this.getChips();return e&&e[0]},getInput(){var e;return(e=this.$refs.input)==null?void 0:e.$refs.input},onChipKeyDown(e){var i;const t=(i=e.code)==null?void 0:i.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){var i;const t=(i=e.code)==null?void 0:i.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(){var e;this.getLastChipButton().focus(),(e=this.$refs.input)==null||e.blur(),this.closeComboboxList()},moveFromChipToInput(){var e;this.getLastChipButton().blur(),(e=this.$refs.input)==null||e.focus(),this.showComboboxList()},navigateBetweenChips(e,t){var n;const i=this.getChipButtons().indexOf(e),l=t?i-1:i+1;l<0||l>=((n=this.$refs.chips)==null?void 0:n.length)||(this.getChipButtons()[i].blur(),this.getChipButtons()[l].focus(),this.closeComboboxList())},setChipsTopPosition(){const e=this.getInput();if(!e)return;const t=this.$refs.inputSlotWrapper,i=e.getBoundingClientRect().top-t.getBoundingClientRect().top,l=this.$refs.chipsWrapper;l.style.top=i-p.CHIP_TOP_POSITION[this.size]+"px"},setInputPadding(){const e=this.getLastChip(),t=this.getInput(),i=this.$refs.chipsWrapper;if(!t||(this.revertInputPadding(t),this.popoverOffset=[0,4],!e)||this.collapseOnFocusOut&&!this.inputFocused)return;const l=e.offsetLeft+this.getFullWidth(e),n=t.getBoundingClientRect().width-l;n>this.reservedRightSpace?t.style.paddingLeft=l+"px":t.style.paddingLeft="4px";const o=i.getBoundingClientRect().height-4,r=e.getBoundingClientRect().height-4,u=n>this.reservedRightSpace?e.offsetTop+2:o+r-9;t.style.paddingTop=`${u}px`},revertInputPadding(e){e.style.paddingLeft="",e.style.paddingTop="",e.style.paddingBottom=""},getFullWidth(e){const t=window.getComputedStyle(e);return e.offsetWidth+parseInt(t.marginLeft)+parseInt(t.marginRight)},setInputMinWidth(){const 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(){const e=this.getInput();e&&(this.initialInputHeight=e.getBoundingClientRect().height)},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;const e=this.getInput();if(!e||!e.style.paddingTop)return;this.revertInputPadding(e)}}}},S={ref:"header"},v={key:1,class:"d-recipe-combobox-multi-select__list--loading"},L={ref:"footer"};function M(e,t,i,l,n,o){const r=s.resolveComponent("dt-chip"),u=s.resolveComponent("dt-input"),c=s.resolveComponent("dt-validation-messages"),d=s.resolveComponent("dt-combobox-with-popover");return s.openBlock(),s.createBlock(d,s.mergeProps({ref:"comboboxWithPopover",label:i.label,"show-list":i.showList,"max-height":i.listMaxHeight,"max-width":i.listMaxWidth,"popover-offset":n.popoverOffset,"has-suggestion-list":i.hasSuggestionList,"content-width":"anchor","append-to":i.appendTo,transition:i.transition},o.extractNonListeners(e.$attrs),{onSelect:o.onComboboxSelect,onHighlight:o.comboboxHighlight}),s.createSlots({input:s.withCtx(({onInput:g})=>[s.createElementVNode("span",{ref:"inputSlotWrapper",class:"d-recipe-combobox-multi-select__input-wrapper",onFocusin:t[1]||(t[1]=(...a)=>o.handleInputFocusIn&&o.handleInputFocusIn(...a)),onFocusout:t[2]||(t[2]=(...a)=>o.handleInputFocusOut&&o.handleInputFocusOut(...a))},[s.createElementVNode("span",{ref:"chipsWrapper",class:s.normalizeClass(["d-recipe-combobox-multi-select__chip-wrapper",o.chipWrapperClass])},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(i.selectedItems,a=>(s.openBlock(),s.createBlock(r,s.mergeProps({ref_for:!0,ref:"chips",key:a,"label-class":["d-chip__label"],class:["d-recipe-combobox-multi-select__chip",{"d-recipe-combobox-multi-select__chip--truncate":!!i.chipMaxWidth}],style:{maxWidth:i.chipMaxWidth},size:n.CHIP_SIZES[i.size],disabled:i.disabled},s.toHandlers(o.chipListeners),{onKeydown:s.withKeys(m=>o.onChipRemove(a),["backspace"]),onClose:m=>o.onChipRemove(a)}),{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(a),1)]),_:2},1040,["class","style","size","disabled","onKeydown","onClose"]))),128))],2),s.createVNode(u,s.mergeProps({ref:"input",modelValue:n.value,"onUpdate:modelValue":t[0]||(t[0]=a=>n.value=a),class:"d-recipe-combobox-multi-select__input","input-class":[i.inputClass,{"d-recipe-combobox-multi-select__input--hidden":n.hideInputText}],"input-wrapper-class":i.inputWrapperClass,disabled:i.disabled,"aria-label":i.label,label:i.labelVisible?i.label:"",description:i.description,placeholder:o.inputPlaceHolder,"show-messages":i.showInputMessages,messages:i.inputMessages,size:i.size},o.inputListeners,{onInput:g}),null,16,["modelValue","input-class","input-wrapper-class","disabled","aria-label","label","description","placeholder","show-messages","messages","size","onInput"]),s.createVNode(c,{"validation-messages":i.maxSelectedMessage,"show-messages":n.showValidationMessages},null,8,["validation-messages","show-messages"])],544)]),list:s.withCtx(()=>[s.createElementVNode("div",{ref:"list",class:"d-recipe-combobox-multi-select__list",onMousedown:t[3]||(t[3]=s.withModifiers(()=>{},["prevent"]))},[i.loading?(s.openBlock(),s.createElementBlock("div",v,s.toDisplayString(i.loadingMessage),1)):s.renderSlot(e.$slots,"list",{key:0})],544)]),_:2},[n.hasSlotContent(e.$slots.header)?{name:"header",fn:s.withCtx(()=>[s.createElementVNode("div",S,[s.renderSlot(e.$slots,"header")],512)]),key:"0"}:void 0,n.hasSlotContent(e.$slots.footer)?{name:"footer",fn:s.withCtx(()=>[s.createElementVNode("div",L,[s.renderSlot(e.$slots,"footer")],512)]),key:"1"}:void 0]),1040,["label","show-list","max-height","max-width","popover-offset","has-suggestion-list","append-to","transition","onSelect","onHighlight"])}const W=w._(_,[["render",M]]);exports.default=W;
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const b=require("../combobox-with-popover/combobox-with-popover.cjs"),C=require("../input/input.cjs"),y=require("../chip/chip.cjs"),x=require("../validation-messages/validation-messages.cjs"),w=require("../../common/validators/index.cjs"),u=require("../../common/utils/index.cjs"),I=require("../popover/popover-constants.cjs"),c=require("./combobox-multi-select-constants.cjs"),i=require("vue"),_=require("../../_plugin-vue_export-helper-BRilXfQE.cjs"),S={compatConfig:{MODE:3},name:"DtComboboxMultiSelect",components:{DtComboboxWithPopover:b.default,DtInput:C.default,DtChip:y.default,DtValidationMessages:x.default},inheritAttrs:!1,props:{label:{type:String,required:!0},labelVisible:{type:Boolean,default:!0},description:{type:String,default:""},placeholder:{type:String,default:"Select one or start typing"},inputMessages:{type:Array,default:()=>[],validator:e=>w.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,default:"md",validator:e=>Object.values(c.MULTI_SELECT_SIZES).includes(e)},appendTo:{type:[HTMLElement,String],default:"body",validator:e=>I.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}},emits:["input","select","remove","max-selected","keyup","keydown","combobox-highlight"],data(){return{value:"",popoverOffset:[0,4],showValidationMessages:!1,resizeWindowObserver:null,initialInputHeight:null,CHIP_SIZES:c.CHIP_SIZES,hasSlotContent:u.hasSlotContent,inputFocused:!1,hideInputText:!1}},computed:{inputPlaceHolder(){var e;return((e=this.selectedItems)==null?void 0:e.length)>0?"":this.placeholder},chipListeners(){return{keydown:e=>{this.onChipKeyDown(e),this.$emit("keydown",e)}}},inputListeners(){return{...u.extractVueListeners(this.$attrs),onInput:e=>{this.$emit("input",e),this.hasSuggestionList&&this.showComboboxList()},onKeydown:e=>{this.onInputKeyDown(e)},onKeyup:e=>{this.$emit("keyup",e)},onClick:()=>{this.hasSuggestionList&&this.showComboboxList()}}},chipWrapperClass(){return{[`d-recipe-combobox-multi-select__chip-wrapper-${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();const e=this.getInput();this.revertInputPadding(e),this.initialInputHeight=e.getBoundingClientRect().height,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(){var e;(e=this.resizeWindowObserver)==null||e.unobserve(document.body)},methods:{extractNonListeners:u.extractNonListeners,comboboxHighlight(e){this.$emit("combobox-highlight",e)},async initSelectedItems(){await this.$nextTick(),this.setInputPadding(),this.setChipsTopPosition(),this.setInputMinWidth(),this.checkMaxSelected()},onChipRemove(e){var s;this.$emit("remove",e),(s=this.$refs.input)==null||s.focus()},onComboboxSelect(e){this.loading||(this.value="",this.$emit("select",e))},showComboboxList(){var e;this.showList==null&&((e=this.$refs.comboboxWithPopover)==null||e.showComboboxList())},closeComboboxList(){var e;this.showList==null&&((e=this.$refs.comboboxWithPopover)==null||e.closeComboboxList())},getChips(){if(!this.selectedItems.length||!this.$refs.chips)return null;const e=new Set;return this.selectedItems.map(t=>this.$refs.chips.find((l,o)=>{var r,h,p;return e.has(o)?!1:((p=(h=(r=u.returnFirstEl(l.$el))==null?void 0:r.querySelector(".d-chip__label"))==null?void 0:h.textContent)==null?void 0:p.trim())===t?(e.add(o),!0):!1})).filter(Boolean).map(t=>u.returnFirstEl(t.$el))},getChipButtons(){const e=this.getChips();return e&&e.map(s=>u.returnFirstEl(s).querySelector("button"))},getLastChipButton(){const e=this.getChipButtons();return e&&e[e.length-1]},getLastChip(){const e=this.getChips();return e&&e[e.length-1]},getFirstChip(){const e=this.getChips();return e&&e[0]},getInput(){var e;return(e=this.$refs.input)==null?void 0:e.$refs.input},onChipKeyDown(e){var t;const s=(t=e.code)==null?void 0:t.toLowerCase();s==="arrowleft"?this.navigateBetweenChips(e.target,!0):s==="arrowright"&&(e.target.id===this.getLastChipButton().id?this.moveFromChipToInput():this.navigateBetweenChips(e.target,!1))},onInputKeyDown(e){var t;const s=(t=e.code)==null?void 0:t.toLowerCase();if(this.selectedItems.length>0&&e.target.selectionStart===0){if(e.target.selectionEnd!==e.target.selectionStart)return;(s==="backspace"||s==="arrowleft")&&this.moveFromInputToChip()}},moveFromInputToChip(){var e;this.getLastChipButton().focus(),(e=this.$refs.input)==null||e.blur(),this.closeComboboxList()},moveFromChipToInput(){var e;this.getLastChipButton().blur(),(e=this.$refs.input)==null||e.focus(),this.showComboboxList()},navigateBetweenChips(e,s){var o;const t=this.getChipButtons().indexOf(e),l=s?t-1:t+1;l<0||l>=((o=this.$refs.chips)==null?void 0:o.length)||(this.getChipButtons()[t].blur(),this.getChipButtons()[l].focus(),this.closeComboboxList())},setChipsTopPosition(){const e=this.getInput();if(!e)return;const s=this.$refs.inputSlotWrapper,t=e.getBoundingClientRect().top-s.getBoundingClientRect().top,l=this.$refs.chipsWrapper;l.style.top=t-c.CHIP_TOP_POSITION[this.size]+"px"},setInputPadding(){const e=this.getLastChip(),s=this.getInput(),t=this.$refs.chipsWrapper;if(!s||(this.revertInputPadding(s),this.popoverOffset=[0,4],!e)||this.collapseOnFocusOut&&!this.inputFocused)return;const l=e.offsetLeft+this.getFullWidth(e),o=s.getBoundingClientRect().width-l;o>this.reservedRightSpace?s.style.paddingLeft=l+"px":s.style.paddingLeft="4px";const n=t.getBoundingClientRect().height-4,r=e.getBoundingClientRect().height-4,h=o>this.reservedRightSpace?e.offsetTop+2:n+r-9;s.style.paddingTop=`${h}px`},revertInputPadding(e){e.style.paddingLeft="",e.style.paddingTop="",e.style.paddingBottom=""},getFullWidth(e){const s=window.getComputedStyle(e);return e.offsetWidth+parseInt(s.marginLeft)+parseInt(s.marginRight)},setInputMinWidth(){const e=this.getFirstChip(),s=this.getInput();s&&(e?s.style.minWidth=this.getFullWidth(e)+4+"px":s.style.minWidth="")},checkMaxSelected(){this.maxSelected!==0&&(this.selectedItems.length>this.maxSelected?(this.showValidationMessages=!0,this.$emit("max-selected")):this.showValidationMessages=!1)},setInitialInputHeight(){const e=this.getInput();e&&(this.initialInputHeight=e.getBoundingClientRect().height)},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;const e=this.getInput();if(!e||!e.style.paddingTop)return;this.revertInputPadding(e)}}}},v={ref:"header"},L={key:1,class:"d-recipe-combobox-multi-select__list--loading"},M={ref:"footer"};function W(e,s,t,l,o,n){const r=i.resolveComponent("dt-chip"),h=i.resolveComponent("dt-input"),p=i.resolveComponent("dt-validation-messages"),d=i.resolveComponent("dt-combobox-with-popover");return i.openBlock(),i.createBlock(d,i.mergeProps({ref:"comboboxWithPopover",label:t.label,"show-list":t.showList,"max-height":t.listMaxHeight,"max-width":t.listMaxWidth,"popover-offset":o.popoverOffset,"has-suggestion-list":t.hasSuggestionList,"content-width":"anchor","append-to":t.appendTo,transition:t.transition},n.extractNonListeners(e.$attrs),{onSelect:n.onComboboxSelect,onHighlight:n.comboboxHighlight}),i.createSlots({input:i.withCtx(({onInput:g})=>[i.createElementVNode("span",{ref:"inputSlotWrapper",class:"d-recipe-combobox-multi-select__input-wrapper",onFocusin:s[1]||(s[1]=(...a)=>n.handleInputFocusIn&&n.handleInputFocusIn(...a)),onFocusout:s[2]||(s[2]=(...a)=>n.handleInputFocusOut&&n.handleInputFocusOut(...a))},[i.createElementVNode("span",{ref:"chipsWrapper",class:i.normalizeClass(["d-recipe-combobox-multi-select__chip-wrapper",n.chipWrapperClass])},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(t.selectedItems,(a,m)=>(i.openBlock(),i.createBlock(r,i.mergeProps({ref_for:!0,ref:"chips",key:`${m}-${a}`,"label-class":["d-chip__label"],class:["d-recipe-combobox-multi-select__chip",{"d-recipe-combobox-multi-select__chip--truncate":!!t.chipMaxWidth}],style:{maxWidth:t.chipMaxWidth},size:o.CHIP_SIZES[t.size],disabled:t.disabled},i.toHandlers(n.chipListeners),{onKeydown:i.withKeys(f=>n.onChipRemove(a),["backspace"]),onClose:f=>n.onChipRemove(a)}),{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(a),1)]),_:2},1040,["class","style","size","disabled","onKeydown","onClose"]))),128))],2),i.createVNode(h,i.mergeProps({ref:"input",modelValue:o.value,"onUpdate:modelValue":s[0]||(s[0]=a=>o.value=a),class:"d-recipe-combobox-multi-select__input","input-class":[t.inputClass,{"d-recipe-combobox-multi-select__input--hidden":o.hideInputText}],"input-wrapper-class":t.inputWrapperClass,disabled:t.disabled,"aria-label":t.label,label:t.labelVisible?t.label:"",description:t.description,placeholder:n.inputPlaceHolder,"show-messages":t.showInputMessages,messages:t.inputMessages,size:t.size},n.inputListeners,{onInput:g}),null,16,["modelValue","input-class","input-wrapper-class","disabled","aria-label","label","description","placeholder","show-messages","messages","size","onInput"]),i.createVNode(p,{"validation-messages":t.maxSelectedMessage,"show-messages":o.showValidationMessages},null,8,["validation-messages","show-messages"])],544)]),list:i.withCtx(()=>[i.createElementVNode("div",{ref:"list",class:"d-recipe-combobox-multi-select__list",onMousedown:s[3]||(s[3]=i.withModifiers(()=>{},["prevent"]))},[t.loading?(i.openBlock(),i.createElementBlock("div",L,i.toDisplayString(t.loadingMessage),1)):i.renderSlot(e.$slots,"list",{key:0})],544)]),_:2},[o.hasSlotContent(e.$slots.header)?{name:"header",fn:i.withCtx(()=>[i.createElementVNode("div",v,[i.renderSlot(e.$slots,"header")],512)]),key:"0"}:void 0,o.hasSlotContent(e.$slots.footer)?{name:"footer",fn:i.withCtx(()=>[i.createElementVNode("div",M,[i.renderSlot(e.$slots,"footer")],512)]),key:"1"}:void 0]),1040,["label","show-list","max-height","max-width","popover-offset","has-suggestion-list","append-to","transition","onSelect","onHighlight"])}const B=_._(S,[["render",W]]);exports.default=B;
|
|
2
2
|
//# sourceMappingURL=combobox-multi-select.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"combobox-multi-select.cjs","sources":["../../../components/combobox_multi_select/combobox_multi_select.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 :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-recipe-combobox-multi-select__input-wrapper\"\n @focusin=\"handleInputFocusIn\"\n @focusout=\"handleInputFocusOut\"\n >\n <span\n ref=\"chipsWrapper\"\n :class=\"['d-recipe-combobox-multi-select__chip-wrapper', chipWrapperClass]\"\n >\n <dt-chip\n v-for=\"item in selectedItems\"\n ref=\"chips\"\n :key=\"item\"\n :label-class=\"['d-chip__label']\"\n :class=\"[\n 'd-recipe-combobox-multi-select__chip',\n { 'd-recipe-combobox-multi-select__chip--truncate': !!chipMaxWidth },\n ]\"\n :style=\"{ maxWidth: chipMaxWidth }\"\n :size=\"CHIP_SIZES[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-recipe-combobox-multi-select__input\"\n :input-class=\"[\n inputClass, {\n 'd-recipe-combobox-multi-select__input--hidden': hideInputText,\n }]\"\n :input-wrapper-class=\"inputWrapperClass\"\n :disabled=\"disabled\"\n :aria-label=\"label\"\n :label=\"labelVisible ? label : ''\"\n :description=\"description\"\n :placeholder=\"inputPlaceHolder\"\n :show-messages=\"showInputMessages\"\n :messages=\"inputMessages\"\n :size=\"size\"\n v-bind=\"inputListeners\"\n @input=\"onInput\"\n />\n\n <dt-validation-messages\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 ref=\"header\">\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-recipe-combobox-multi-select__list\"\n @mousedown.prevent\n >\n <slot\n v-if=\"!loading\"\n name=\"list\"\n />\n <div\n v-else\n class=\"d-recipe-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 ref=\"footer\">\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/combobox_with_popover/combobox_with_popover.vue';\nimport DtInput from '@/components/input/input.vue';\nimport DtChip from '@/components/chip/chip.vue';\nimport DtValidationMessages from '@/components/validation_messages/validation_messages.vue';\nimport { validationMessageValidator } from '@/common/validators';\nimport { extractVueListeners, extractNonListeners, hasSlotContent, returnFirstEl } from '@/common/utils';\nimport {\n POPOVER_APPEND_TO_VALUES,\n} from '@/components/popover/popover_constants';\nimport {\n MULTI_SELECT_SIZES,\n CHIP_SIZES,\n CHIP_TOP_POSITION,\n} from './combobox_multi_select_constants';\n\nexport default {\n compatConfig: { MODE: 3 },\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 labelVisible: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Description for the input\n */\n description: {\n type: String,\n default: '',\n },\n\n /**\n * 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, one of `xs`, `sm`, `md`\n */\n size: {\n type: String,\n default: 'md',\n validator: (t) => Object.values(MULTI_SELECT_SIZES).includes(t),\n },\n\n /**\n * Sets the element to which the popover is going to append to.\n * 'body' will append to the nearest body (supports shadow DOM).\n * @values 'body', 'parent', HTMLElement,\n */\n appendTo: {\n type: [HTMLElement, String],\n default: 'body',\n validator: appendTo => {\n return POPOVER_APPEND_TO_VALUES.includes(appendTo) ||\n (appendTo instanceof HTMLElement);\n },\n },\n\n /**\n * 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 emits: [\n /**\n * Native input event\n *\n * @event input\n * @type {String }\n */\n 'input',\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 keyup event\n *\n * @event keyup\n * @type {KeyboardEvent}\n */\n 'keyup',\n\n /**\n * Native keydown event\n *\n * @event keydown\n * @type {KeyboardEvent}\n */\n 'keydown',\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 };\n },\n\n computed: {\n inputPlaceHolder () {\n return this.selectedItems?.length > 0 ? '' : this.placeholder;\n },\n\n chipListeners () {\n return {\n keydown: event => {\n this.onChipKeyDown(event);\n this.$emit('keydown', event);\n },\n };\n },\n\n inputListeners () {\n return {\n ...extractVueListeners(this.$attrs),\n onInput: event => {\n this.$emit('input', event);\n if (this.hasSuggestionList) {\n this.showComboboxList();\n }\n },\n\n onKeydown: event => {\n this.onInputKeyDown(event);\n },\n\n onKeyup: event => {\n this.$emit('keyup', event);\n },\n\n onClick: () => {\n if (this.hasSuggestionList) {\n this.showComboboxList();\n }\n },\n };\n },\n\n chipWrapperClass () {\n return {\n [`d-recipe-combobox-multi-select__chip-wrapper-${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.initialInputHeight = input.getBoundingClientRect().height;\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 const chips = this.selectedItems.map(item => {\n return this.$refs.chips.find(chip => {\n const chipLabel = returnFirstEl(chip.$el)?.querySelector('.d-chip__label')?.textContent?.trim();\n return chipLabel === item;\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.code?.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[this.size]) + 'px';\n },\n\n setInputPadding () {\n const lastChip = this.getLastChip();\n const input = this.getInput();\n const chipsWrapper = this.$refs.chipsWrapper;\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 // input.style.paddingLeft = left + 'px';\n\n if (spaceLeft > this.reservedRightSpace) {\n input.style.paddingLeft = left + 'px';\n } else {\n input.style.paddingLeft = '4px';\n }\n\n // Get the chip wrapper height minus the 4px padding\n const chipsWrapperHeight = chipsWrapper.getBoundingClientRect().height - 4;\n const lastChipHeight = lastChip.getBoundingClientRect().height - 4;\n\n // Get lastChip offsetTop plus 2px of the input padding.\n const top = spaceLeft > this.reservedRightSpace\n ? lastChip.offsetTop + 2\n : (chipsWrapperHeight + lastChipHeight - 9);\n\n input.style.paddingTop = `${top}px`;\n },\n\n revertInputPadding (input) {\n input.style.paddingLeft = '';\n input.style.paddingTop = '';\n input.style.paddingBottom = '';\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 this.initialInputHeight = input.getBoundingClientRect().height;\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"],"names":["_sfc_main","DtComboboxWithPopover","DtInput","DtChip","DtValidationMessages","inputMessages","validationMessageValidator","t","MULTI_SELECT_SIZES","appendTo","POPOVER_APPEND_TO_VALUES","CHIP_SIZES","hasSlotContent","_a","event","extractVueListeners","input","extractNonListeners","highlightIndex","item","i","chip","returnFirstEl","chips","chipButtons","key","target","toLeft","from","to","inputSlotWrapper","top","chipsWrapper","CHIP_TOP_POSITION","lastChip","left","spaceLeft","chipsWrapperHeight","lastChipHeight","el","styles","firstChip","_hoisted_1","_hoisted_3","_openBlock","_createBlock","_component_dt_combobox_with_popover","_mergeProps","$props","$data","$options","_ctx","_withCtx","onInput","_createElementVNode","args","_createElementBlock","_Fragment","_renderList","_component_dt_chip","_toHandlers","_withKeys","$event","_createVNode","_component_dt_input","_component_dt_validation_messages","_hoisted_2","_toDisplayString","_renderSlot"],"mappings":"ijBAuIKA,EAAU,CACb,aAAc,CAAE,KAAM,GACtB,KAAM,wBAEN,WAAY,CACV,sBAAAC,EAAAA,QACA,QAAAC,EAAAA,QACA,OAAAC,EAAAA,QACA,qBAAAC,EAAAA,SAGF,aAAc,GAEd,MAAO,CAIL,MAAO,CACL,KAAM,OACN,SAAU,IAOZ,aAAc,CACZ,KAAM,QACN,QAAS,IAMX,YAAa,CACX,KAAM,OACN,QAAS,IAMX,YAAa,CACX,KAAM,OACN,QAAS,8BAMX,cAAe,CACb,KAAM,MACN,QAAS,IAAM,CAAA,EACf,UAAWC,GACFC,EAAAA,2BAA2BD,CAAa,GAOnD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AA,WAAA,aAAA,QAAA,cAAA,cAAA,gBAAA,WAAA,OAAA,SAAA,CAAA,EAGjBU,EAAAA,YAGEE,EAAA,CAFC,sBAAqBjB,EAAA,mBACrB,gBAAeC,EAAA,gFAgBX,eACT,IAeM,CAfNK,EAAAA,mBAeM,MAAA,CAdJ,IAAI,OACJ,MAAM,uCACL,wCAAD,IAAA,CAAA,EAAkB,CAAA,SAAA,CAAA,KAGTN,EAAA,uBAGTQ,EAAAA,mBAKM,MALNU,EAKMC,EAAAA,gBADDnB,EAAA,cAAc,EAAA,CAAA,GARnBoB,EAAAA,WAGEjB,EAAA,OAAA,OAAA,CAAA,IAAA,CAAA,CAAA,gBAlBEF,EAAA,eAAeE,EAAA,OAAO,MAAM,QACjC,sBAED,IAEM,CAFNG,EAAAA,mBAEM,MAFNZ,EAEM,CADJ0B,aAAsBjB,EAAA,OAAA,QAAA,0BA0BlBF,EAAA,eAAeE,EAAA,OAAO,MAAM,QACjC,sBAED,IAEM,CAFNG,EAAAA,mBAEM,MAFNX,EAEM,CADJyB,aAAsBjB,EAAA,OAAA,QAAA"}
|
|
1
|
+
{"version":3,"file":"combobox-multi-select.cjs","sources":["../../../components/combobox_multi_select/combobox_multi_select.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 :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-recipe-combobox-multi-select__input-wrapper\"\n @focusin=\"handleInputFocusIn\"\n @focusout=\"handleInputFocusOut\"\n >\n <span\n ref=\"chipsWrapper\"\n :class=\"['d-recipe-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 :label-class=\"['d-chip__label']\"\n :class=\"[\n 'd-recipe-combobox-multi-select__chip',\n { 'd-recipe-combobox-multi-select__chip--truncate': !!chipMaxWidth },\n ]\"\n :style=\"{ maxWidth: chipMaxWidth }\"\n :size=\"CHIP_SIZES[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-recipe-combobox-multi-select__input\"\n :input-class=\"[\n inputClass, {\n 'd-recipe-combobox-multi-select__input--hidden': hideInputText,\n }]\"\n :input-wrapper-class=\"inputWrapperClass\"\n :disabled=\"disabled\"\n :aria-label=\"label\"\n :label=\"labelVisible ? label : ''\"\n :description=\"description\"\n :placeholder=\"inputPlaceHolder\"\n :show-messages=\"showInputMessages\"\n :messages=\"inputMessages\"\n :size=\"size\"\n v-bind=\"inputListeners\"\n @input=\"onInput\"\n />\n\n <dt-validation-messages\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 ref=\"header\">\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-recipe-combobox-multi-select__list\"\n @mousedown.prevent\n >\n <slot\n v-if=\"!loading\"\n name=\"list\"\n />\n <div\n v-else\n class=\"d-recipe-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 ref=\"footer\">\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/combobox_with_popover/combobox_with_popover.vue';\nimport DtInput from '@/components/input/input.vue';\nimport DtChip from '@/components/chip/chip.vue';\nimport DtValidationMessages from '@/components/validation_messages/validation_messages.vue';\nimport { validationMessageValidator } from '@/common/validators';\nimport { extractVueListeners, extractNonListeners, hasSlotContent, returnFirstEl } from '@/common/utils';\nimport {\n POPOVER_APPEND_TO_VALUES,\n} from '@/components/popover/popover_constants';\nimport {\n MULTI_SELECT_SIZES,\n CHIP_SIZES,\n CHIP_TOP_POSITION,\n} from './combobox_multi_select_constants';\n\nexport default {\n compatConfig: { MODE: 3 },\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 labelVisible: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Description for the input\n */\n description: {\n type: String,\n default: '',\n },\n\n /**\n * 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, one of `xs`, `sm`, `md`\n */\n size: {\n type: String,\n default: 'md',\n validator: (t) => Object.values(MULTI_SELECT_SIZES).includes(t),\n },\n\n /**\n * Sets the element to which the popover is going to append to.\n * 'body' will append to the nearest body (supports shadow DOM).\n * @values 'body', 'parent', HTMLElement,\n */\n appendTo: {\n type: [HTMLElement, String],\n default: 'body',\n validator: appendTo => {\n return POPOVER_APPEND_TO_VALUES.includes(appendTo) ||\n (appendTo instanceof HTMLElement);\n },\n },\n\n /**\n * 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 emits: [\n /**\n * Native input event\n *\n * @event input\n * @type {String }\n */\n 'input',\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 keyup event\n *\n * @event keyup\n * @type {KeyboardEvent}\n */\n 'keyup',\n\n /**\n * Native keydown event\n *\n * @event keydown\n * @type {KeyboardEvent}\n */\n 'keydown',\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 };\n },\n\n computed: {\n inputPlaceHolder () {\n return this.selectedItems?.length > 0 ? '' : this.placeholder;\n },\n\n chipListeners () {\n return {\n keydown: event => {\n this.onChipKeyDown(event);\n this.$emit('keydown', event);\n },\n };\n },\n\n inputListeners () {\n return {\n ...extractVueListeners(this.$attrs),\n onInput: event => {\n this.$emit('input', event);\n if (this.hasSuggestionList) {\n this.showComboboxList();\n }\n },\n\n onKeydown: event => {\n this.onInputKeyDown(event);\n },\n\n onKeyup: event => {\n this.$emit('keyup', event);\n },\n\n onClick: () => {\n if (this.hasSuggestionList) {\n this.showComboboxList();\n }\n },\n };\n },\n\n chipWrapperClass () {\n return {\n [`d-recipe-combobox-multi-select__chip-wrapper-${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.initialInputHeight = input.getBoundingClientRect().height;\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.code?.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[this.size]) + 'px';\n },\n\n setInputPadding () {\n const lastChip = this.getLastChip();\n const input = this.getInput();\n const chipsWrapper = this.$refs.chipsWrapper;\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 // input.style.paddingLeft = left + 'px';\n\n if (spaceLeft > this.reservedRightSpace) {\n input.style.paddingLeft = left + 'px';\n } else {\n input.style.paddingLeft = '4px';\n }\n\n // Get the chip wrapper height minus the 4px padding\n const chipsWrapperHeight = chipsWrapper.getBoundingClientRect().height - 4;\n const lastChipHeight = lastChip.getBoundingClientRect().height - 4;\n\n // Get lastChip offsetTop plus 2px of the input padding.\n const top = spaceLeft > this.reservedRightSpace\n ? lastChip.offsetTop + 2\n : (chipsWrapperHeight + lastChipHeight - 9);\n\n input.style.paddingTop = `${top}px`;\n },\n\n revertInputPadding (input) {\n input.style.paddingLeft = '';\n input.style.paddingTop = '';\n input.style.paddingBottom = '';\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 this.initialInputHeight = input.getBoundingClientRect().height;\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"],"names":["_sfc_main","DtComboboxWithPopover","DtInput","DtChip","DtValidationMessages","inputMessages","validationMessageValidator","t","MULTI_SELECT_SIZES","appendTo","POPOVER_APPEND_TO_VALUES","CHIP_SIZES","hasSlotContent","_a","event","extractVueListeners","input","extractNonListeners","highlightIndex","item","i","matched","chip","index","returnFirstEl","chips","chipButtons","key","target","toLeft","from","to","inputSlotWrapper","top","chipsWrapper","CHIP_TOP_POSITION","lastChip","left","spaceLeft","chipsWrapperHeight","lastChipHeight","el","styles","firstChip","_hoisted_1","_hoisted_3","_openBlock","_createBlock","_component_dt_combobox_with_popover","_mergeProps","$props","$data","$options","_ctx","_withCtx","onInput","_createElementVNode","args","_createElementBlock","_Fragment","_renderList","_component_dt_chip","_toHandlers","_withKeys","$event","_createVNode","_component_dt_input","_component_dt_validation_messages","_hoisted_2","_toDisplayString","_renderSl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X,EAEM,CADJyB,aAAsBjB,EAAA,OAAA,QAAA"}
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import { validationMessageValidator as
|
|
6
|
-
import { extractNonListeners as
|
|
7
|
-
import { POPOVER_APPEND_TO_VALUES as
|
|
8
|
-
import { CHIP_TOP_POSITION as
|
|
9
|
-
import { resolveComponent as
|
|
10
|
-
import { _ as
|
|
11
|
-
const
|
|
1
|
+
import v from "../combobox-with-popover/combobox-with-popover.js";
|
|
2
|
+
import L from "../input/input.js";
|
|
3
|
+
import W from "../chip/chip.js";
|
|
4
|
+
import M from "../validation-messages/validation-messages.js";
|
|
5
|
+
import { validationMessageValidator as B } from "../../common/validators/index.js";
|
|
6
|
+
import { extractNonListeners as O, returnFirstEl as g, extractVueListeners as T, hasSlotContent as P } from "../../common/utils/index.js";
|
|
7
|
+
import { POPOVER_APPEND_TO_VALUES as F } from "../popover/popover-constants.js";
|
|
8
|
+
import { CHIP_TOP_POSITION as k, CHIP_SIZES as H, MULTI_SELECT_SIZES as V } from "./combobox-multi-select-constants.js";
|
|
9
|
+
import { resolveComponent as c, openBlock as d, createBlock as b, mergeProps as m, createSlots as z, withCtx as h, createElementVNode as p, withModifiers as R, renderSlot as f, createElementBlock as C, toDisplayString as y, normalizeClass as E, Fragment as D, renderList as K, toHandlers as N, withKeys as A, createTextVNode as U, createVNode as I } from "vue";
|
|
10
|
+
import { _ as j } from "../../_plugin-vue_export-helper-CHgC5LLL.js";
|
|
11
|
+
const q = {
|
|
12
12
|
compatConfig: { MODE: 3 },
|
|
13
13
|
name: "DtComboboxMultiSelect",
|
|
14
14
|
components: {
|
|
15
|
-
DtComboboxWithPopover:
|
|
16
|
-
DtInput:
|
|
17
|
-
DtChip:
|
|
18
|
-
DtValidationMessages:
|
|
15
|
+
DtComboboxWithPopover: v,
|
|
16
|
+
DtInput: L,
|
|
17
|
+
DtChip: W,
|
|
18
|
+
DtValidationMessages: M
|
|
19
19
|
},
|
|
20
20
|
inheritAttrs: !1,
|
|
21
21
|
props: {
|
|
@@ -54,7 +54,7 @@ const j = {
|
|
|
54
54
|
inputMessages: {
|
|
55
55
|
type: Array,
|
|
56
56
|
default: () => [],
|
|
57
|
-
validator: (t) =>
|
|
57
|
+
validator: (t) => B(t)
|
|
58
58
|
},
|
|
59
59
|
/**
|
|
60
60
|
* Show input validation message
|
|
@@ -141,7 +141,7 @@ const j = {
|
|
|
141
141
|
size: {
|
|
142
142
|
type: String,
|
|
143
143
|
default: "md",
|
|
144
|
-
validator: (t) => Object.values(
|
|
144
|
+
validator: (t) => Object.values(V).includes(t)
|
|
145
145
|
},
|
|
146
146
|
/**
|
|
147
147
|
* Sets the element to which the popover is going to append to.
|
|
@@ -151,7 +151,7 @@ const j = {
|
|
|
151
151
|
appendTo: {
|
|
152
152
|
type: [HTMLElement, String],
|
|
153
153
|
default: "body",
|
|
154
|
-
validator: (t) =>
|
|
154
|
+
validator: (t) => F.includes(t) || t instanceof HTMLElement
|
|
155
155
|
},
|
|
156
156
|
/**
|
|
157
157
|
* Named transition when the content display is toggled.
|
|
@@ -279,8 +279,8 @@ const j = {
|
|
|
279
279
|
showValidationMessages: !1,
|
|
280
280
|
resizeWindowObserver: null,
|
|
281
281
|
initialInputHeight: null,
|
|
282
|
-
CHIP_SIZES:
|
|
283
|
-
hasSlotContent:
|
|
282
|
+
CHIP_SIZES: H,
|
|
283
|
+
hasSlotContent: P,
|
|
284
284
|
inputFocused: !1,
|
|
285
285
|
hideInputText: !1
|
|
286
286
|
};
|
|
@@ -299,7 +299,7 @@ const j = {
|
|
|
299
299
|
},
|
|
300
300
|
inputListeners() {
|
|
301
301
|
return {
|
|
302
|
-
...
|
|
302
|
+
...T(this.$attrs),
|
|
303
303
|
onInput: (t) => {
|
|
304
304
|
this.$emit("input", t), this.hasSuggestionList && this.showComboboxList();
|
|
305
305
|
},
|
|
@@ -356,7 +356,7 @@ const j = {
|
|
|
356
356
|
(t = this.resizeWindowObserver) == null || t.unobserve(document.body);
|
|
357
357
|
},
|
|
358
358
|
methods: {
|
|
359
|
-
extractNonListeners:
|
|
359
|
+
extractNonListeners: O,
|
|
360
360
|
comboboxHighlight(t) {
|
|
361
361
|
this.$emit("combobox-highlight", t);
|
|
362
362
|
},
|
|
@@ -364,8 +364,8 @@ const j = {
|
|
|
364
364
|
await this.$nextTick(), this.setInputPadding(), this.setChipsTopPosition(), this.setInputMinWidth(), this.checkMaxSelected();
|
|
365
365
|
},
|
|
366
366
|
onChipRemove(t) {
|
|
367
|
-
var
|
|
368
|
-
this.$emit("remove", t), (
|
|
367
|
+
var i;
|
|
368
|
+
this.$emit("remove", t), (i = this.$refs.input) == null || i.focus();
|
|
369
369
|
},
|
|
370
370
|
onComboboxSelect(t) {
|
|
371
371
|
this.loading || (this.value = "", this.$emit("select", t));
|
|
@@ -379,14 +379,16 @@ const j = {
|
|
|
379
379
|
this.showList == null && ((t = this.$refs.comboboxWithPopover) == null || t.closeComboboxList());
|
|
380
380
|
},
|
|
381
381
|
getChips() {
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
382
|
+
if (!this.selectedItems.length || !this.$refs.chips) return null;
|
|
383
|
+
const t = /* @__PURE__ */ new Set();
|
|
384
|
+
return this.selectedItems.map((e) => this.$refs.chips.find((o, s) => {
|
|
385
|
+
var a, r, u;
|
|
386
|
+
return t.has(s) ? !1 : ((u = (r = (a = g(o.$el)) == null ? void 0 : a.querySelector(".d-chip__label")) == null ? void 0 : r.textContent) == null ? void 0 : u.trim()) === e ? (t.add(s), !0) : !1;
|
|
387
|
+
})).filter(Boolean).map((e) => g(e.$el));
|
|
386
388
|
},
|
|
387
389
|
getChipButtons() {
|
|
388
390
|
const t = this.getChips();
|
|
389
|
-
return t && t.map((
|
|
391
|
+
return t && t.map((i) => g(i).querySelector("button"));
|
|
390
392
|
},
|
|
391
393
|
getLastChipButton() {
|
|
392
394
|
const t = this.getChipButtons();
|
|
@@ -405,17 +407,17 @@ const j = {
|
|
|
405
407
|
return (t = this.$refs.input) == null ? void 0 : t.$refs.input;
|
|
406
408
|
},
|
|
407
409
|
onChipKeyDown(t) {
|
|
408
|
-
var
|
|
409
|
-
const
|
|
410
|
-
|
|
410
|
+
var e;
|
|
411
|
+
const i = (e = t.code) == null ? void 0 : e.toLowerCase();
|
|
412
|
+
i === "arrowleft" ? this.navigateBetweenChips(t.target, !0) : i === "arrowright" && (t.target.id === this.getLastChipButton().id ? this.moveFromChipToInput() : this.navigateBetweenChips(t.target, !1));
|
|
411
413
|
},
|
|
412
414
|
onInputKeyDown(t) {
|
|
413
|
-
var
|
|
414
|
-
const
|
|
415
|
+
var e;
|
|
416
|
+
const i = (e = t.code) == null ? void 0 : e.toLowerCase();
|
|
415
417
|
if (this.selectedItems.length > 0 && t.target.selectionStart === 0) {
|
|
416
418
|
if (t.target.selectionEnd !== t.target.selectionStart)
|
|
417
419
|
return;
|
|
418
|
-
(
|
|
420
|
+
(i === "backspace" || i === "arrowleft") && this.moveFromInputToChip();
|
|
419
421
|
}
|
|
420
422
|
},
|
|
421
423
|
moveFromInputToChip() {
|
|
@@ -426,35 +428,35 @@ const j = {
|
|
|
426
428
|
var t;
|
|
427
429
|
this.getLastChipButton().blur(), (t = this.$refs.input) == null || t.focus(), this.showComboboxList();
|
|
428
430
|
},
|
|
429
|
-
navigateBetweenChips(t,
|
|
430
|
-
var
|
|
431
|
-
const
|
|
432
|
-
|
|
431
|
+
navigateBetweenChips(t, i) {
|
|
432
|
+
var s;
|
|
433
|
+
const e = this.getChipButtons().indexOf(t), o = i ? e - 1 : e + 1;
|
|
434
|
+
o < 0 || o >= ((s = this.$refs.chips) == null ? void 0 : s.length) || (this.getChipButtons()[e].blur(), this.getChipButtons()[o].focus(), this.closeComboboxList());
|
|
433
435
|
},
|
|
434
436
|
setChipsTopPosition() {
|
|
435
437
|
const t = this.getInput();
|
|
436
438
|
if (!t) return;
|
|
437
|
-
const
|
|
438
|
-
|
|
439
|
+
const i = this.$refs.inputSlotWrapper, e = t.getBoundingClientRect().top - i.getBoundingClientRect().top, o = this.$refs.chipsWrapper;
|
|
440
|
+
o.style.top = e - k[this.size] + "px";
|
|
439
441
|
},
|
|
440
442
|
setInputPadding() {
|
|
441
|
-
const t = this.getLastChip(),
|
|
442
|
-
if (!
|
|
443
|
-
const
|
|
444
|
-
|
|
445
|
-
const
|
|
446
|
-
|
|
443
|
+
const t = this.getLastChip(), i = this.getInput(), e = this.$refs.chipsWrapper;
|
|
444
|
+
if (!i || (this.revertInputPadding(i), this.popoverOffset = [0, 4], !t) || this.collapseOnFocusOut && !this.inputFocused) return;
|
|
445
|
+
const o = t.offsetLeft + this.getFullWidth(t), s = i.getBoundingClientRect().width - o;
|
|
446
|
+
s > this.reservedRightSpace ? i.style.paddingLeft = o + "px" : i.style.paddingLeft = "4px";
|
|
447
|
+
const n = e.getBoundingClientRect().height - 4, a = t.getBoundingClientRect().height - 4, r = s > this.reservedRightSpace ? t.offsetTop + 2 : n + a - 9;
|
|
448
|
+
i.style.paddingTop = `${r}px`;
|
|
447
449
|
},
|
|
448
450
|
revertInputPadding(t) {
|
|
449
451
|
t.style.paddingLeft = "", t.style.paddingTop = "", t.style.paddingBottom = "";
|
|
450
452
|
},
|
|
451
453
|
getFullWidth(t) {
|
|
452
|
-
const
|
|
453
|
-
return t.offsetWidth + parseInt(
|
|
454
|
+
const i = window.getComputedStyle(t);
|
|
455
|
+
return t.offsetWidth + parseInt(i.marginLeft) + parseInt(i.marginRight);
|
|
454
456
|
},
|
|
455
457
|
setInputMinWidth() {
|
|
456
|
-
const t = this.getFirstChip(),
|
|
457
|
-
|
|
458
|
+
const t = this.getFirstChip(), i = this.getInput();
|
|
459
|
+
i && (t ? i.style.minWidth = this.getFullWidth(t) + 4 + "px" : i.style.minWidth = "");
|
|
458
460
|
},
|
|
459
461
|
checkMaxSelected() {
|
|
460
462
|
this.maxSelected !== 0 && (this.selectedItems.length > this.maxSelected ? (this.showValidationMessages = !0, this.$emit("max-selected")) : this.showValidationMessages = !1);
|
|
@@ -476,121 +478,121 @@ const j = {
|
|
|
476
478
|
}
|
|
477
479
|
}
|
|
478
480
|
}
|
|
479
|
-
},
|
|
481
|
+
}, Z = { ref: "header" }, G = {
|
|
480
482
|
key: 1,
|
|
481
483
|
class: "d-recipe-combobox-multi-select__list--loading"
|
|
482
|
-
},
|
|
483
|
-
function
|
|
484
|
-
const a =
|
|
485
|
-
return
|
|
484
|
+
}, J = { ref: "footer" };
|
|
485
|
+
function Q(t, i, e, o, s, n) {
|
|
486
|
+
const a = c("dt-chip"), r = c("dt-input"), u = c("dt-validation-messages"), x = c("dt-combobox-with-popover");
|
|
487
|
+
return d(), b(x, m({
|
|
486
488
|
ref: "comboboxWithPopover",
|
|
487
|
-
label:
|
|
488
|
-
"show-list":
|
|
489
|
-
"max-height":
|
|
490
|
-
"max-width":
|
|
491
|
-
"popover-offset":
|
|
492
|
-
"has-suggestion-list":
|
|
489
|
+
label: e.label,
|
|
490
|
+
"show-list": e.showList,
|
|
491
|
+
"max-height": e.listMaxHeight,
|
|
492
|
+
"max-width": e.listMaxWidth,
|
|
493
|
+
"popover-offset": s.popoverOffset,
|
|
494
|
+
"has-suggestion-list": e.hasSuggestionList,
|
|
493
495
|
"content-width": "anchor",
|
|
494
|
-
"append-to":
|
|
495
|
-
transition:
|
|
496
|
-
},
|
|
497
|
-
onSelect:
|
|
498
|
-
onHighlight:
|
|
499
|
-
}),
|
|
500
|
-
input:
|
|
501
|
-
|
|
496
|
+
"append-to": e.appendTo,
|
|
497
|
+
transition: e.transition
|
|
498
|
+
}, n.extractNonListeners(t.$attrs), {
|
|
499
|
+
onSelect: n.onComboboxSelect,
|
|
500
|
+
onHighlight: n.comboboxHighlight
|
|
501
|
+
}), z({
|
|
502
|
+
input: h(({ onInput: w }) => [
|
|
503
|
+
p("span", {
|
|
502
504
|
ref: "inputSlotWrapper",
|
|
503
505
|
class: "d-recipe-combobox-multi-select__input-wrapper",
|
|
504
|
-
onFocusin:
|
|
505
|
-
onFocusout:
|
|
506
|
+
onFocusin: i[1] || (i[1] = (...l) => n.handleInputFocusIn && n.handleInputFocusIn(...l)),
|
|
507
|
+
onFocusout: i[2] || (i[2] = (...l) => n.handleInputFocusOut && n.handleInputFocusOut(...l))
|
|
506
508
|
}, [
|
|
507
|
-
|
|
509
|
+
p("span", {
|
|
508
510
|
ref: "chipsWrapper",
|
|
509
|
-
class:
|
|
511
|
+
class: E(["d-recipe-combobox-multi-select__chip-wrapper", n.chipWrapperClass])
|
|
510
512
|
}, [
|
|
511
|
-
(
|
|
513
|
+
(d(!0), C(D, null, K(e.selectedItems, (l, S) => (d(), b(a, m({
|
|
512
514
|
ref_for: !0,
|
|
513
515
|
ref: "chips",
|
|
514
|
-
key: l
|
|
516
|
+
key: `${S}-${l}`,
|
|
515
517
|
"label-class": ["d-chip__label"],
|
|
516
518
|
class: [
|
|
517
519
|
"d-recipe-combobox-multi-select__chip",
|
|
518
|
-
{ "d-recipe-combobox-multi-select__chip--truncate": !!
|
|
520
|
+
{ "d-recipe-combobox-multi-select__chip--truncate": !!e.chipMaxWidth }
|
|
519
521
|
],
|
|
520
|
-
style: { maxWidth:
|
|
521
|
-
size:
|
|
522
|
-
disabled:
|
|
523
|
-
},
|
|
524
|
-
onKeydown:
|
|
525
|
-
onClose: (
|
|
522
|
+
style: { maxWidth: e.chipMaxWidth },
|
|
523
|
+
size: s.CHIP_SIZES[e.size],
|
|
524
|
+
disabled: e.disabled
|
|
525
|
+
}, N(n.chipListeners), {
|
|
526
|
+
onKeydown: A((_) => n.onChipRemove(l), ["backspace"]),
|
|
527
|
+
onClose: (_) => n.onChipRemove(l)
|
|
526
528
|
}), {
|
|
527
|
-
default:
|
|
528
|
-
|
|
529
|
+
default: h(() => [
|
|
530
|
+
U(y(l), 1)
|
|
529
531
|
]),
|
|
530
532
|
_: 2
|
|
531
533
|
}, 1040, ["class", "style", "size", "disabled", "onKeydown", "onClose"]))), 128))
|
|
532
534
|
], 2),
|
|
533
|
-
|
|
535
|
+
I(r, m({
|
|
534
536
|
ref: "input",
|
|
535
|
-
modelValue:
|
|
536
|
-
"onUpdate:modelValue":
|
|
537
|
+
modelValue: s.value,
|
|
538
|
+
"onUpdate:modelValue": i[0] || (i[0] = (l) => s.value = l),
|
|
537
539
|
class: "d-recipe-combobox-multi-select__input",
|
|
538
540
|
"input-class": [
|
|
539
|
-
|
|
541
|
+
e.inputClass,
|
|
540
542
|
{
|
|
541
|
-
"d-recipe-combobox-multi-select__input--hidden":
|
|
543
|
+
"d-recipe-combobox-multi-select__input--hidden": s.hideInputText
|
|
542
544
|
}
|
|
543
545
|
],
|
|
544
|
-
"input-wrapper-class":
|
|
545
|
-
disabled:
|
|
546
|
-
"aria-label":
|
|
547
|
-
label:
|
|
548
|
-
description:
|
|
549
|
-
placeholder:
|
|
550
|
-
"show-messages":
|
|
551
|
-
messages:
|
|
552
|
-
size:
|
|
553
|
-
},
|
|
554
|
-
|
|
555
|
-
"validation-messages":
|
|
556
|
-
"show-messages":
|
|
546
|
+
"input-wrapper-class": e.inputWrapperClass,
|
|
547
|
+
disabled: e.disabled,
|
|
548
|
+
"aria-label": e.label,
|
|
549
|
+
label: e.labelVisible ? e.label : "",
|
|
550
|
+
description: e.description,
|
|
551
|
+
placeholder: n.inputPlaceHolder,
|
|
552
|
+
"show-messages": e.showInputMessages,
|
|
553
|
+
messages: e.inputMessages,
|
|
554
|
+
size: e.size
|
|
555
|
+
}, n.inputListeners, { onInput: w }), null, 16, ["modelValue", "input-class", "input-wrapper-class", "disabled", "aria-label", "label", "description", "placeholder", "show-messages", "messages", "size", "onInput"]),
|
|
556
|
+
I(u, {
|
|
557
|
+
"validation-messages": e.maxSelectedMessage,
|
|
558
|
+
"show-messages": s.showValidationMessages
|
|
557
559
|
}, null, 8, ["validation-messages", "show-messages"])
|
|
558
560
|
], 544)
|
|
559
561
|
]),
|
|
560
|
-
list:
|
|
561
|
-
|
|
562
|
+
list: h(() => [
|
|
563
|
+
p("div", {
|
|
562
564
|
ref: "list",
|
|
563
565
|
class: "d-recipe-combobox-multi-select__list",
|
|
564
|
-
onMousedown:
|
|
566
|
+
onMousedown: i[3] || (i[3] = R(() => {
|
|
565
567
|
}, ["prevent"]))
|
|
566
568
|
}, [
|
|
567
|
-
|
|
569
|
+
e.loading ? (d(), C("div", G, y(e.loadingMessage), 1)) : f(t.$slots, "list", { key: 0 })
|
|
568
570
|
], 544)
|
|
569
571
|
]),
|
|
570
572
|
_: 2
|
|
571
573
|
}, [
|
|
572
|
-
|
|
574
|
+
s.hasSlotContent(t.$slots.header) ? {
|
|
573
575
|
name: "header",
|
|
574
|
-
fn:
|
|
575
|
-
|
|
576
|
-
|
|
576
|
+
fn: h(() => [
|
|
577
|
+
p("div", Z, [
|
|
578
|
+
f(t.$slots, "header")
|
|
577
579
|
], 512)
|
|
578
580
|
]),
|
|
579
581
|
key: "0"
|
|
580
582
|
} : void 0,
|
|
581
|
-
|
|
583
|
+
s.hasSlotContent(t.$slots.footer) ? {
|
|
582
584
|
name: "footer",
|
|
583
|
-
fn:
|
|
584
|
-
|
|
585
|
-
|
|
585
|
+
fn: h(() => [
|
|
586
|
+
p("div", J, [
|
|
587
|
+
f(t.$slots, "footer")
|
|
586
588
|
], 512)
|
|
587
589
|
]),
|
|
588
590
|
key: "1"
|
|
589
591
|
} : void 0
|
|
590
592
|
]), 1040, ["label", "show-list", "max-height", "max-width", "popover-offset", "has-suggestion-list", "append-to", "transition", "onSelect", "onHighlight"]);
|
|
591
593
|
}
|
|
592
|
-
const
|
|
594
|
+
const at = /* @__PURE__ */ j(q, [["render", Q]]);
|
|
593
595
|
export {
|
|
594
|
-
|
|
596
|
+
at as default
|
|
595
597
|
};
|
|
596
598
|
//# sourceMappingURL=combobox-multi-select.js.map
|