@dialpad/dialtone-vue 3.196.3 → 3.197.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/component-documentation.json +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 +48 -34
- package/dist/lib/chip/chip.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 +47 -38
- package/dist/lib/combobox-multi-select/combobox-multi-select.js.map +1 -1
- package/dist/types/components/chip/chip.vue.d.ts +9 -0
- package/dist/types/components/chip/chip.vue.d.ts.map +1 -1
- package/dist/types/recipes/comboboxes/combobox_multi_select/combobox_multi_select.vue.d.ts.map +1 -1
- package/package.json +3 -3
package/dist/lib/chip/chip.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("@dialpad/dialtone-icons/vue3"),n=require("./chip-constants.cjs"),o=require("../../common/utils/index.cjs"),u=require("../../localization/index.cjs"),e=require("vue"),h=require("../../_plugin-vue_export-helper-BRilXfQE.cjs"),_=require("../button/button.cjs"),b={compatConfig:{MODE:3},name:"DtChip",components:{DtButton:_.default,DtIconClose:r.DtIconClose},props:{disabled:{type:Boolean,default:!1},hideClose:{type:Boolean,default:!1},size:{type:String,default:"md",validator:t=>Object.keys(n.CHIP_SIZE_MODIFIERS).includes(t)},interactive:{type:Boolean,default:!0},id:{type:String,default:function(){return o.getUniqueString()}},ariaLabel:{type:String,default:""},contentClass:{type:[String,Array,Object],default:""},labelClass:{type:[String,Array,Object],default:""}},emits:["click","close","keyup","keydown"],data(){return{isActive:!1,hasSlotContent:o.hasSlotContent,i18n:new u.DialtoneLocalization}},computed:{chipListeners(){return{click:t=>{this.interactive&&this.$emit("click",t)},keydown:t=>{var a;((a=t.code)==null?void 0:a.toLowerCase())==="delete"?this.onClose():this.$emit("keydown",t)},keyup:t=>{this.$emit("keyup",t)}}},closeButtonIconSize(){return n.CHIP_ICON_SIZES[this.size]},closeButtonTitle(){return this.i18n.$t("DIALTONE_CLOSE_BUTTON")}},methods:{chipClasses(){return[this.$attrs["grouped-chip"]?"d-chip":"d-chip__label",n.CHIP_SIZE_MODIFIERS[this.size],this.labelClass,this.disabled&&"d-chip--disabled"]},chipCloseButtonClasses(){return["d-chip__close",n.CHIP_CLOSE_BUTTON_SIZE_MODIFIERS[this.size],this.disabled&&"d-chip__close--disabled"]},onClose(){this.hideClose||this.$emit("close")}}},C={class:"d-chip"},p={key:0,class:"d-chip__icon","data-qa":"dt-chip-icon"},m={key:1,"data-qa":"dt-chip-avatar"},S=["id"];function k(t,a,i,f,s,l){const c=e.resolveComponent("dt-icon-close"),d=e.resolveComponent("dt-button");return e.openBlock(),e.createElementBlock("span",C,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(i.interactive?"button":"span"),e.mergeProps({id:i.id,"aria-label":i.ariaLabel,"aria-labelledby":i.ariaLabel?void 0:`${i.id}-content`,"aria-disabled":i.disabled,class:l.chipClasses(),type:i.interactive&&"button","data-qa":"dt-chip",tabindex:i.disabled?-1:null},e.toHandlers(l.chipListeners)),{default:e.withCtx(()=>[s.hasSlotContent(t.$slots.icon)?(e.openBlock(),e.createElementBlock("span",p,[e.renderSlot(t.$slots,"icon")])):s.hasSlotContent(t.$slots.avatar)?(e.openBlock(),e.createElementBlock("span",m,[e.renderSlot(t.$slots,"avatar")])):e.createCommentVNode("",!0),s.hasSlotContent(t.$slots.default)?(e.openBlock(),e.createElementBlock("span",{key:2,id:`${i.id}-content`,class:e.normalizeClass(["d-chip__text",i.contentClass]),"data-qa":"dt-chip-label"},[e.renderSlot(t.$slots,"default")],10,S)):e.createCommentVNode("",!0)]),_:3},16,["id","aria-label","aria-labelledby","aria-disabled","class","type","tabindex"])),i.hideClose?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(d,{key:0,class:e.normalizeClass(l.chipCloseButtonClasses()),"data-qa":"dt-chip-close","aria-label":l.closeButtonTitle,"aria-disabled":i.disabled,title:l.closeButtonTitle,tabindex:i.disabled?-1:null,onClick:a[0]||(a[0]=B=>t.$emit("close"))},{icon:e.withCtx(()=>[e.createVNode(c,{size:l.closeButtonIconSize},null,8,["size"])]),_:1},8,["class","aria-label","aria-disabled","title","tabindex"]))])}const y=h._(b,[["render",k]]);exports.default=y;
|
|
2
2
|
//# sourceMappingURL=chip.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chip.cjs","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 :class=\"chipClasses()\"\n :type=\"interactive && 'button'\"\n data-qa=\"dt-chip\"\n v-on=\"chipListeners\"\n >\n <span\n v-if=\"hasSlotContent($slots.icon)\"\n class=\"d-chip__icon\"\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 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=\"!hideClose\"\n :class=\"chipCloseButtonClasses()\"\n data-qa=\"dt-chip-close\"\n :aria-label=\"closeButtonTitle\"\n :title=\"closeButtonTitle\"\n @click=\"$emit('close')\"\n >\n <template #icon>\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/vue3';\nimport {\n CHIP_CLOSE_BUTTON_SIZE_MODIFIERS,\n CHIP_SIZE_MODIFIERS,\n CHIP_ICON_SIZES,\n} from './chip_constants';\nimport { getUniqueString, hasSlotContent } from '@/common/utils';\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 compatConfig: { MODE: 3 },\n name: 'DtChip',\n\n components: {\n DtButton,\n DtIconClose,\n },\n\n props: {\n /**\n * Hides the close button on the chip\n * @values true, false\n */\n hideClose: {\n type: Boolean,\n default: false,\n },\n\n /**\n * The size of the chip.\n * @values xs, sm, md\n */\n size: {\n type: String,\n default: 'md',\n validator: (s) => Object.keys(CHIP_SIZE_MODIFIERS).includes(s),\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: true,\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 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[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[this.size],\n this.labelClass,\n ];\n },\n\n chipCloseButtonClasses () {\n return [\n 'd-chip__close',\n CHIP_CLOSE_BUTTON_SIZE_MODIFIERS[this.size],\n ];\n },\n\n onClose () {\n if (!this.hideClose) {\n this.$emit('close');\n }\n },\n },\n};\n</script>\n"],"names":["_sfc_main","DtButton","DtIconClose","s","CHIP_SIZE_MODIFIERS","getUniqueString","hasSlotContent","DialtoneLocalization","event","_a","CHIP_ICON_SIZES","CHIP_CLOSE_BUTTON_SIZE_MODIFIERS","_hoisted_1","_hoisted_4","_openBlock","_createElementBlock","_createBlock","_resolveDynamicComponent","$props","_mergeProps","$options","_toHandlers","_withCtx","$data","_ctx","_hoisted_2","_renderSlot","_hoisted_3","_createCommentVNode","_normalizeClass","_component_dt_button","_createVNode","_component_dt_icon_close"],"mappings":"+
|
|
1
|
+
{"version":3,"file":"chip.cjs","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\"\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 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=\"!hideClose\"\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 #icon>\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/vue3';\nimport {\n CHIP_CLOSE_BUTTON_SIZE_MODIFIERS,\n CHIP_SIZE_MODIFIERS,\n CHIP_ICON_SIZES,\n} from './chip_constants';\nimport { getUniqueString, hasSlotContent } from '@/common/utils';\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 compatConfig: { MODE: 3 },\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 * Hides the close button on the chip\n * @values true, false\n */\n hideClose: {\n type: Boolean,\n default: false,\n },\n\n /**\n * The size of the chip.\n * @values xs, sm, md\n */\n size: {\n type: String,\n default: 'md',\n validator: (s) => Object.keys(CHIP_SIZE_MODIFIERS).includes(s),\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: true,\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 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[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[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[this.size],\n this.disabled && 'd-chip__close--disabled',\n ];\n },\n\n onClose () {\n if (!this.hideClose) {\n this.$emit('close');\n }\n },\n },\n};\n</script>\n"],"names":["_sfc_main","DtButton","DtIconClose","s","CHIP_SIZE_MODIFIERS","getUniqueString","hasSlotContent","DialtoneLocalization","event","_a","CHIP_ICON_SIZES","CHIP_CLOSE_BUTTON_SIZE_MODIFIERS","_hoisted_1","_hoisted_4","_openBlock","_createElementBlock","_createBlock","_resolveDynamicComponent","$props","_mergeProps","$options","_toHandlers","_withCtx","$data","_ctx","_hoisted_2","_renderSlot","_hoisted_3","_createCommentVNode","_normalizeClass","_component_dt_button","_createVNode","_component_dt_icon_close"],"mappings":"+XA2EKA,EAAU,CACb,aAAc,CAAE,KAAM,GACtB,KAAM,SAEN,WAAY,CACV,SAAAC,EAAAA,oBACAC,EAAAA,aAGF,MAAO,CAKL,SAAU,CACR,KAAM,QACN,QAAS,IAOX,UAAW,CACT,KAAM,QACN,QAAS,IAOX,KAAM,CACJ,KAAM,OACN,QAAS,KACT,UAAYC,GAAM,OAAO,KAAKC,qBAAmB,EAAE,SAASD,CAAC,GAQ/D,YAAa,CACX,KAAM,QACN,QAAS,IAMX,GAAI,CACF,KAAM,OACN,QAAS,UAAY,CAAE,OAAOE,EAAAA,gBAAe,CAAI,GAOnD,UAAW,CACT,KAAM,OACN,QAAS,IAMX,aAAc,CACZ,KAAM,CAAC,OAAQ,MAAO,MAAM,EAC5B,QAAS,IAMX,WAAY,CACV,KAAM,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BUTTON_SIZE_MODIFIERS as
|
|
3
|
-
import { hasSlotContent as
|
|
1
|
+
import { DtIconClose as C } from "@dialpad/dialtone-icons/vue3";
|
|
2
|
+
import { CHIP_CLOSE_BUTTON_SIZE_MODIFIERS as p, CHIP_SIZE_MODIFIERS as c, CHIP_ICON_SIZES as f } from "./chip-constants.js";
|
|
3
|
+
import { hasSlotContent as y, getUniqueString as S } from "../../common/utils/index.js";
|
|
4
4
|
import { DialtoneLocalization as k } from "../../localization/index.js";
|
|
5
|
-
import { resolveComponent as
|
|
5
|
+
import { resolveComponent as r, createElementBlock as l, openBlock as a, createBlock as u, createCommentVNode as o, resolveDynamicComponent as B, mergeProps as I, toHandlers as O, withCtx as h, renderSlot as d, normalizeClass as b, createVNode as v } from "vue";
|
|
6
6
|
import { _ as g } from "../../_plugin-vue_export-helper-CHgC5LLL.js";
|
|
7
7
|
import z from "../button/button.js";
|
|
8
8
|
const D = {
|
|
@@ -10,9 +10,17 @@ const D = {
|
|
|
10
10
|
name: "DtChip",
|
|
11
11
|
components: {
|
|
12
12
|
DtButton: z,
|
|
13
|
-
DtIconClose:
|
|
13
|
+
DtIconClose: C
|
|
14
14
|
},
|
|
15
15
|
props: {
|
|
16
|
+
/**
|
|
17
|
+
* Whether the chip is disabled
|
|
18
|
+
* @values true, false
|
|
19
|
+
*/
|
|
20
|
+
disabled: {
|
|
21
|
+
type: Boolean,
|
|
22
|
+
default: !1
|
|
23
|
+
},
|
|
16
24
|
/**
|
|
17
25
|
* Hides the close button on the chip
|
|
18
26
|
* @values true, false
|
|
@@ -28,7 +36,7 @@ const D = {
|
|
|
28
36
|
size: {
|
|
29
37
|
type: String,
|
|
30
38
|
default: "md",
|
|
31
|
-
validator: (e) => Object.keys(
|
|
39
|
+
validator: (e) => Object.keys(c).includes(e)
|
|
32
40
|
},
|
|
33
41
|
/**
|
|
34
42
|
* The interactivity of the chip.
|
|
@@ -103,7 +111,7 @@ const D = {
|
|
|
103
111
|
data() {
|
|
104
112
|
return {
|
|
105
113
|
isActive: !1,
|
|
106
|
-
hasSlotContent:
|
|
114
|
+
hasSlotContent: y,
|
|
107
115
|
i18n: new k()
|
|
108
116
|
};
|
|
109
117
|
},
|
|
@@ -114,8 +122,8 @@ const D = {
|
|
|
114
122
|
this.interactive && this.$emit("click", e);
|
|
115
123
|
},
|
|
116
124
|
keydown: (e) => {
|
|
117
|
-
var
|
|
118
|
-
((
|
|
125
|
+
var s;
|
|
126
|
+
((s = e.code) == null ? void 0 : s.toLowerCase()) === "delete" ? this.onClose() : this.$emit("keydown", e);
|
|
119
127
|
},
|
|
120
128
|
keyup: (e) => {
|
|
121
129
|
this.$emit("keyup", e);
|
|
@@ -123,7 +131,7 @@ const D = {
|
|
|
123
131
|
};
|
|
124
132
|
},
|
|
125
133
|
closeButtonIconSize() {
|
|
126
|
-
return
|
|
134
|
+
return f[this.size];
|
|
127
135
|
},
|
|
128
136
|
closeButtonTitle() {
|
|
129
137
|
return this.i18n.$t("DIALTONE_CLOSE_BUTTON");
|
|
@@ -133,14 +141,16 @@ const D = {
|
|
|
133
141
|
chipClasses() {
|
|
134
142
|
return [
|
|
135
143
|
this.$attrs["grouped-chip"] ? "d-chip" : "d-chip__label",
|
|
136
|
-
|
|
137
|
-
this.labelClass
|
|
144
|
+
c[this.size],
|
|
145
|
+
this.labelClass,
|
|
146
|
+
this.disabled && "d-chip--disabled"
|
|
138
147
|
];
|
|
139
148
|
},
|
|
140
149
|
chipCloseButtonClasses() {
|
|
141
150
|
return [
|
|
142
151
|
"d-chip__close",
|
|
143
|
-
|
|
152
|
+
p[this.size],
|
|
153
|
+
this.disabled && "d-chip__close--disabled"
|
|
144
154
|
];
|
|
145
155
|
},
|
|
146
156
|
onClose() {
|
|
@@ -155,51 +165,55 @@ const D = {
|
|
|
155
165
|
key: 1,
|
|
156
166
|
"data-qa": "dt-chip-avatar"
|
|
157
167
|
}, q = ["id"];
|
|
158
|
-
function w(e,
|
|
159
|
-
const m =
|
|
160
|
-
return
|
|
161
|
-
(
|
|
168
|
+
function w(e, s, t, N, n, i) {
|
|
169
|
+
const m = r("dt-icon-close"), _ = r("dt-button");
|
|
170
|
+
return a(), l("span", E, [
|
|
171
|
+
(a(), u(B(t.interactive ? "button" : "span"), I({
|
|
162
172
|
id: t.id,
|
|
163
173
|
"aria-label": t.ariaLabel,
|
|
164
174
|
"aria-labelledby": t.ariaLabel ? void 0 : `${t.id}-content`,
|
|
175
|
+
"aria-disabled": t.disabled,
|
|
165
176
|
class: i.chipClasses(),
|
|
166
177
|
type: t.interactive && "button",
|
|
167
|
-
"data-qa": "dt-chip"
|
|
178
|
+
"data-qa": "dt-chip",
|
|
179
|
+
tabindex: t.disabled ? -1 : null
|
|
168
180
|
}, O(i.chipListeners)), {
|
|
169
181
|
default: h(() => [
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
])) :
|
|
173
|
-
|
|
174
|
-
])) :
|
|
175
|
-
|
|
182
|
+
n.hasSlotContent(e.$slots.icon) ? (a(), l("span", L, [
|
|
183
|
+
d(e.$slots, "icon")
|
|
184
|
+
])) : n.hasSlotContent(e.$slots.avatar) ? (a(), l("span", T, [
|
|
185
|
+
d(e.$slots, "avatar")
|
|
186
|
+
])) : o("", !0),
|
|
187
|
+
n.hasSlotContent(e.$slots.default) ? (a(), l("span", {
|
|
176
188
|
key: 2,
|
|
177
189
|
id: `${t.id}-content`,
|
|
178
|
-
class:
|
|
190
|
+
class: b(["d-chip__text", t.contentClass]),
|
|
179
191
|
"data-qa": "dt-chip-label"
|
|
180
192
|
}, [
|
|
181
|
-
|
|
182
|
-
], 10, q)) :
|
|
193
|
+
d(e.$slots, "default")
|
|
194
|
+
], 10, q)) : o("", !0)
|
|
183
195
|
]),
|
|
184
196
|
_: 3
|
|
185
|
-
}, 16, ["id", "aria-label", "aria-labelledby", "class", "type"])),
|
|
186
|
-
t.hideClose ?
|
|
197
|
+
}, 16, ["id", "aria-label", "aria-labelledby", "aria-disabled", "class", "type", "tabindex"])),
|
|
198
|
+
t.hideClose ? o("", !0) : (a(), u(_, {
|
|
187
199
|
key: 0,
|
|
188
|
-
class:
|
|
200
|
+
class: b(i.chipCloseButtonClasses()),
|
|
189
201
|
"data-qa": "dt-chip-close",
|
|
190
202
|
"aria-label": i.closeButtonTitle,
|
|
203
|
+
"aria-disabled": t.disabled,
|
|
191
204
|
title: i.closeButtonTitle,
|
|
192
|
-
|
|
205
|
+
tabindex: t.disabled ? -1 : null,
|
|
206
|
+
onClick: s[0] || (s[0] = (A) => e.$emit("close"))
|
|
193
207
|
}, {
|
|
194
208
|
icon: h(() => [
|
|
195
209
|
v(m, { size: i.closeButtonIconSize }, null, 8, ["size"])
|
|
196
210
|
]),
|
|
197
211
|
_: 1
|
|
198
|
-
}, 8, ["class", "aria-label", "title"]))
|
|
212
|
+
}, 8, ["class", "aria-label", "aria-disabled", "title", "tabindex"]))
|
|
199
213
|
]);
|
|
200
214
|
}
|
|
201
|
-
const
|
|
215
|
+
const F = /* @__PURE__ */ g(D, [["render", w]]);
|
|
202
216
|
export {
|
|
203
|
-
|
|
217
|
+
F as default
|
|
204
218
|
};
|
|
205
219
|
//# sourceMappingURL=chip.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chip.js","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 :class=\"chipClasses()\"\n :type=\"interactive && 'button'\"\n data-qa=\"dt-chip\"\n v-on=\"chipListeners\"\n >\n <span\n v-if=\"hasSlotContent($slots.icon)\"\n class=\"d-chip__icon\"\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 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=\"!hideClose\"\n :class=\"chipCloseButtonClasses()\"\n data-qa=\"dt-chip-close\"\n :aria-label=\"closeButtonTitle\"\n :title=\"closeButtonTitle\"\n @click=\"$emit('close')\"\n >\n <template #icon>\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/vue3';\nimport {\n CHIP_CLOSE_BUTTON_SIZE_MODIFIERS,\n CHIP_SIZE_MODIFIERS,\n CHIP_ICON_SIZES,\n} from './chip_constants';\nimport { getUniqueString, hasSlotContent } from '@/common/utils';\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 compatConfig: { MODE: 3 },\n name: 'DtChip',\n\n components: {\n DtButton,\n DtIconClose,\n },\n\n props: {\n /**\n * Hides the close button on the chip\n * @values true, false\n */\n hideClose: {\n type: Boolean,\n default: false,\n },\n\n /**\n * The size of the chip.\n * @values xs, sm, md\n */\n size: {\n type: String,\n default: 'md',\n validator: (s) => Object.keys(CHIP_SIZE_MODIFIERS).includes(s),\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: true,\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 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[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[this.size],\n this.labelClass,\n ];\n },\n\n chipCloseButtonClasses () {\n return [\n 'd-chip__close',\n CHIP_CLOSE_BUTTON_SIZE_MODIFIERS[this.size],\n ];\n },\n\n onClose () {\n if (!this.hideClose) {\n this.$emit('close');\n }\n },\n },\n};\n</script>\n"],"names":["_sfc_main","DtButton","DtIconClose","s","CHIP_SIZE_MODIFIERS","getUniqueString","hasSlotContent","DialtoneLocalization","event","_a","CHIP_ICON_SIZES","CHIP_CLOSE_BUTTON_SIZE_MODIFIERS","_hoisted_1","_hoisted_4","_openBlock","_createElementBlock","_createBlock","_resolveDynamicComponent","$props","_mergeProps","$options","_toHandlers","_withCtx","$data","_ctx","_hoisted_2","_renderSlot","_hoisted_3","_createCommentVNode","_normalizeClass","_component_dt_button","_createVNode","_component_dt_icon_close"],"mappings":";;;;;;;
|
|
1
|
+
{"version":3,"file":"chip.js","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\"\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 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=\"!hideClose\"\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 #icon>\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/vue3';\nimport {\n CHIP_CLOSE_BUTTON_SIZE_MODIFIERS,\n CHIP_SIZE_MODIFIERS,\n CHIP_ICON_SIZES,\n} from './chip_constants';\nimport { getUniqueString, hasSlotContent } from '@/common/utils';\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 compatConfig: { MODE: 3 },\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 * Hides the close button on the chip\n * @values true, false\n */\n hideClose: {\n type: Boolean,\n default: false,\n },\n\n /**\n * The size of the chip.\n * @values xs, sm, md\n */\n size: {\n type: String,\n default: 'md',\n validator: (s) => Object.keys(CHIP_SIZE_MODIFIERS).includes(s),\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: true,\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 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[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[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[this.size],\n this.disabled && 'd-chip__close--disabled',\n ];\n },\n\n onClose () {\n if (!this.hideClose) {\n this.$emit('close');\n }\n },\n },\n};\n</script>\n"],"names":["_sfc_main","DtButton","DtIconClose","s","CHIP_SIZE_MODIFIERS","getUniqueString","hasSlotContent","DialtoneLocalization","event","_a","CHIP_ICON_SIZES","CHIP_CLOSE_BUTTON_SIZE_MODIFIERS","_hoisted_1","_hoisted_4","_openBlock","_createElementBlock","_createBlock","_resolveDynamicComponent","$props","_mergeProps","$options","_toHandlers","_withCtx","$data","_ctx","_hoisted_2","_renderSlot","_hoisted_3","_createCommentVNode","_normalizeClass","_component_dt_button","_createVNode","_component_dt_icon_close"],"mappings":";;;;;;;AA2EA,MAAKA,IAAU;AAAA,EACb,cAAc,EAAE,MAAM;EACtB,MAAM;AAAA,EAEN,YAAY;AAAA,IACV,UAAAC;AAAA,IACA,aAAAC;AAAA;EAGF,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA,IAKL,UAAU;AAAA,MACR,MAAM;AAAA,MACN,SAAS;AAAA;;;;;IAOX,WAAW;AAAA,MACT,MAAM;A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,eAAeC,EAAA,OAAO,MAAM,KADzCV,KAAAC,EAMO,QANPY,GAMO;AAAA,UADLD,EAAsBF,EAAA,QAAA,QAAA;AAAA,cA3B9BI,EAAA,IAAA,EAAA;AAAA,QA8BcL,EAAA,eAAeC,EAAA,OAAO,OAAO,UADrCT,EAQO,QAAA;AAAA,UArCb,KAAA;AAAA,UA+BS,OAAOG,EAAA,EAAE;AAAA,UACT,OAhCTW,mBAgCiCX,EAAA,YAAY,CAAA;AAAA,UACrC,WAAQ;AAAA;UAGRQ,EAAQF,EAAA,QAAA,SAAA;AAAA,QApChB,GAAA,IAAAX,CAAA,KAAAe,EAAA,IAAA,EAAA;AAAA;MAAA,GAAA;AAAA;IAwCaV,EAAA,YAxCbU,EAAA,IAAA,EAAA,UAuCIZ,EAeYc,GAAA;AAAA,MAtDhB,KAAA;AAAA,MAyCO,OAzCPD,EAyCcT,EAAA,wBAAsB;AAAA,MAC9B,WAAQ;AAAA,MACP,cAAYA,EAAA;AAAA,MACZ,iBAAeF,EAAA;AAAA,MACf,OAAOE,EAAA;AAAA,MACP,UAAUF,EAAA,WAAQ,KAAA;AAAA,MAClB,gCAAOM,EAAA,MAAK,OAAA;AAAA;MAEF,QACT,MAEE;AAAA,QAFFO,EAEEC,GAAA,EADC,MAAMZ,EAAA,oBAAmB,GAAA,MAAA,GAAA,CAAA,MAAA,CAAA;AAAA;MAnDpC,GAAA;AAAA;;;;"}
|
|
@@ -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"),a=require("../../common/utils/index.cjs"),I=require("../popover/popover-constants.cjs"),p=require("./combobox-multi-select-constants.cjs"),t=require("vue"),w=require("../../_plugin-vue_export-helper-BRilXfQE.cjs"),_={compatConfig:{MODE:3},name:"DtRecipeComboboxMultiSelect",components:{DtRecipeComboboxWithPopover: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:""}},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:a.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{...a.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(){this.initSelectedItems()}},chipMaxWidth:{async handler(){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()}}},mounted(){this.setInitialInputHeight(),this.resizeWindowObserver=new ResizeObserver(async()=>{this.setChipsTopPosition(),this.setInputPadding()}),this.resizeWindowObserver.observe(document.body),this.initSelectedItems()},beforeUnmount(){var e;(e=this.resizeWindowObserver)==null||e.unobserve(document.body)},methods:{extractNonListeners:a.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())},getChipButtons(){return this.$refs.chips&&this.$refs.chips.map(e=>a.returnFirstEl(e.$el).querySelector("button"))},getChips(){return this.$refs.chips&&this.$refs.chips.map(e=>a.returnFirstEl(e.$el))},getLastChipButton(){return this.$refs.chips&&this.getChipButtons()[this.getChipButtons().length-1]},getLastChip(){return this.$refs.chips&&this.getChips()[this.getChips().length-1]},getFirstChip(){return this.$refs.chips&&this.getChips()[0]},getInput(){var e;return(e=this.$refs.input)==null?void 0:e.$refs.input},onChipKeyDown(e){var i;const s=(i=e.code)==null?void 0:i.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 i;const s=(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;(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 n;const i=this.getChipButtons().indexOf(e),r=s?i-1:i+1;r<0||r>=((n=this.$refs.chips)==null?void 0:n.length)||(this.getChipButtons()[i].blur(),this.getChipButtons()[r].focus(),this.closeComboboxList())},setChipsTopPosition(){const e=this.getInput();if(!e)return;const s=this.$refs.inputSlotWrapper,i=e.getBoundingClientRect().top-s.getBoundingClientRect().top,r=this.$refs.chipsWrapper;r.style.top=i-p.CHIP_TOP_POSITION[this.size]+"px"},setInputPadding(){const e=this.getLastChip(),s=this.getInput(),i=this.$refs.chipsWrapper;if(!s||(this.revertInputPadding(s),this.popoverOffset=[0,4],!e)||this.collapseOnFocusOut&&!this.inputFocused)return;const r=e.offsetLeft+this.getFullWidth(e),n=s.getBoundingClientRect().width-r;n>this.reservedRightSpace?s.style.paddingLeft=r+"px":s.style.paddingLeft="4px";const o=i.getBoundingClientRect().height-4,h=e.getBoundingClientRect().height-4,u=n>this.reservedRightSpace?e.offsetTop+2:o+h-9;s.style.paddingTop=`${u}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)}}}},S={ref:"header"},v={key:1,class:"d-recipe-combobox-multi-select__list--loading"},L={ref:"footer"};function M(e,s,i,r,n,o){const h=t.resolveComponent("dt-chip"),u=t.resolveComponent("dt-input"),c=t.resolveComponent("dt-validation-messages"),d=t.resolveComponent("dt-recipe-combobox-with-popover");return t.openBlock(),t.createBlock(d,t.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}),t.createSlots({input:t.withCtx(({onInput:g})=>[t.createElementVNode("span",{ref:"inputSlotWrapper",class:"d-recipe-combobox-multi-select__input-wrapper",onFocusin:s[1]||(s[1]=(...l)=>o.handleInputFocusIn&&o.handleInputFocusIn(...l)),onFocusout:s[2]||(s[2]=(...l)=>o.handleInputFocusOut&&o.handleInputFocusOut(...l))},[t.createElementVNode("span",{ref:"chipsWrapper",class:t.normalizeClass(["d-recipe-combobox-multi-select__chip-wrapper",o.chipWrapperClass])},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(i.selectedItems,l=>(t.openBlock(),t.createBlock(h,t.mergeProps({ref_for:!0,ref:"chips",key:l,"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]},t.toHandlers(o.chipListeners),{onKeydown:t.withKeys(m=>o.onChipRemove(l),["backspace"]),onClose:m=>o.onChipRemove(l)}),{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(l),1)]),_:2},1040,["class","style","size","onKeydown","onClose"]))),128))],2),t.createVNode(u,t.mergeProps({ref:"input",modelValue:n.value,"onUpdate:modelValue":s[0]||(s[0]=l=>n.value=l),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,"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","aria-label","label","description","placeholder","show-messages","messages","size","onInput"]),t.createVNode(c,{"validation-messages":i.maxSelectedMessage,"show-messages":n.showValidationMessages},null,8,["validation-messages","show-messages"])],544)]),list:t.withCtx(()=>[t.createElementVNode("div",{ref:"list",class:"d-recipe-combobox-multi-select__list",onMousedown:s[3]||(s[3]=t.withModifiers(()=>{},["prevent"]))},[i.loading?(t.openBlock(),t.createElementBlock("div",v,t.toDisplayString(i.loadingMessage),1)):t.renderSlot(e.$slots,"list",{key:0})],544)]),_:2},[n.hasSlotContent(e.$slots.header)?{name:"header",fn:t.withCtx(()=>[t.createElementVNode("div",S,[t.renderSlot(e.$slots,"header")],512)]),key:"0"}:void 0,n.hasSlotContent(e.$slots.footer)?{name:"footer",fn:t.withCtx(()=>[t.createElementVNode("div",L,[t.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 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"),a=require("../../common/utils/index.cjs"),I=require("../popover/popover-constants.cjs"),p=require("./combobox-multi-select-constants.cjs"),t=require("vue"),w=require("../../_plugin-vue_export-helper-BRilXfQE.cjs"),_={compatConfig:{MODE:3},name:"DtRecipeComboboxMultiSelect",components:{DtRecipeComboboxWithPopover: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:a.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{...a.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(){this.initSelectedItems()}},chipMaxWidth:{async handler(){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()}}},mounted(){this.setInitialInputHeight(),this.resizeWindowObserver=new ResizeObserver(async()=>{this.setChipsTopPosition(),this.setInputPadding()}),this.resizeWindowObserver.observe(document.body),this.initSelectedItems()},beforeUnmount(){var e;(e=this.resizeWindowObserver)==null||e.unobserve(document.body)},methods:{extractNonListeners:a.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())},getChipButtons(){return this.$refs.chips&&this.$refs.chips.map(e=>a.returnFirstEl(e.$el).querySelector("button"))},getChips(){return this.$refs.chips&&this.$refs.chips.map(e=>a.returnFirstEl(e.$el))},getLastChipButton(){return this.$refs.chips&&this.getChipButtons()[this.getChipButtons().length-1]},getLastChip(){return this.$refs.chips&&this.getChips()[this.getChips().length-1]},getFirstChip(){return this.$refs.chips&&this.getChips()[0]},getInput(){var e;return(e=this.$refs.input)==null?void 0:e.$refs.input},onChipKeyDown(e){var i;const s=(i=e.code)==null?void 0:i.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 i;const s=(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;(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 n;const i=this.getChipButtons().indexOf(e),r=s?i-1:i+1;r<0||r>=((n=this.$refs.chips)==null?void 0:n.length)||(this.getChipButtons()[i].blur(),this.getChipButtons()[r].focus(),this.closeComboboxList())},setChipsTopPosition(){const e=this.getInput();if(!e)return;const s=this.$refs.inputSlotWrapper,i=e.getBoundingClientRect().top-s.getBoundingClientRect().top,r=this.$refs.chipsWrapper;r.style.top=i-p.CHIP_TOP_POSITION[this.size]+"px"},setInputPadding(){const e=this.getLastChip(),s=this.getInput(),i=this.$refs.chipsWrapper;if(!s||(this.revertInputPadding(s),this.popoverOffset=[0,4],!e)||this.collapseOnFocusOut&&!this.inputFocused)return;const r=e.offsetLeft+this.getFullWidth(e),n=s.getBoundingClientRect().width-r;n>this.reservedRightSpace?s.style.paddingLeft=r+"px":s.style.paddingLeft="4px";const o=i.getBoundingClientRect().height-4,h=e.getBoundingClientRect().height-4,u=n>this.reservedRightSpace?e.offsetTop+2:o+h-9;s.style.paddingTop=`${u}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)}}}},S={ref:"header"},v={key:1,class:"d-recipe-combobox-multi-select__list--loading"},L={ref:"footer"};function M(e,s,i,r,n,o){const h=t.resolveComponent("dt-chip"),u=t.resolveComponent("dt-input"),c=t.resolveComponent("dt-validation-messages"),d=t.resolveComponent("dt-recipe-combobox-with-popover");return t.openBlock(),t.createBlock(d,t.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}),t.createSlots({input:t.withCtx(({onInput:g})=>[t.createElementVNode("span",{ref:"inputSlotWrapper",class:"d-recipe-combobox-multi-select__input-wrapper",onFocusin:s[1]||(s[1]=(...l)=>o.handleInputFocusIn&&o.handleInputFocusIn(...l)),onFocusout:s[2]||(s[2]=(...l)=>o.handleInputFocusOut&&o.handleInputFocusOut(...l))},[t.createElementVNode("span",{ref:"chipsWrapper",class:t.normalizeClass(["d-recipe-combobox-multi-select__chip-wrapper",o.chipWrapperClass])},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(i.selectedItems,l=>(t.openBlock(),t.createBlock(h,t.mergeProps({ref_for:!0,ref:"chips",key:l,"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},t.toHandlers(o.chipListeners),{onKeydown:t.withKeys(m=>o.onChipRemove(l),["backspace"]),onClose:m=>o.onChipRemove(l)}),{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(l),1)]),_:2},1040,["class","style","size","disabled","onKeydown","onClose"]))),128))],2),t.createVNode(u,t.mergeProps({ref:"input",modelValue:n.value,"onUpdate:modelValue":s[0]||(s[0]=l=>n.value=l),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"]),t.createVNode(c,{"validation-messages":i.maxSelectedMessage,"show-messages":n.showValidationMessages},null,8,["validation-messages","show-messages"])],544)]),list:t.withCtx(()=>[t.createElementVNode("div",{ref:"list",class:"d-recipe-combobox-multi-select__list",onMousedown:s[3]||(s[3]=t.withModifiers(()=>{},["prevent"]))},[i.loading?(t.openBlock(),t.createElementBlock("div",v,t.toDisplayString(i.loadingMessage),1)):t.renderSlot(e.$slots,"list",{key:0})],544)]),_:2},[n.hasSlotContent(e.$slots.header)?{name:"header",fn:t.withCtx(()=>[t.createElementVNode("div",S,[t.renderSlot(e.$slots,"header")],512)]),key:"0"}:void 0,n.hasSlotContent(e.$slots.footer)?{name:"footer",fn:t.withCtx(()=>[t.createElementVNode("div",L,[t.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;
|
|
2
2
|
//# sourceMappingURL=combobox-multi-select.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"combobox-multi-select.cjs","sources":["../../../recipes/comboboxes/combobox_multi_select/combobox_multi_select.vue"],"sourcesContent":["<!-- eslint-disable vue/no-static-inline-styles -->\n<template>\n <dt-recipe-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 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 :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-recipe-combobox-with-popover>\n</template>\n\n<script>\n/* eslint-disable max-lines */\nimport DtRecipeComboboxWithPopover from '@/recipes/comboboxes/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: 'DtRecipeComboboxMultiSelect',\n\n components: {\n DtRecipeComboboxWithPopover,\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 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 this.initSelectedItems();\n },\n },\n\n chipMaxWidth: {\n async handler () {\n 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 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 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 getChipButtons () {\n return this.$refs.chips && this.$refs.chips.map(chip => returnFirstEl(chip.$el).querySelector('button'));\n },\n\n getChips () {\n return this.$refs.chips && this.$refs.chips.map(chip => returnFirstEl(chip.$el));\n },\n\n getLastChipButton () {\n return this.$refs.chips && this.getChipButtons()[this.getChipButtons().length - 1];\n },\n\n getLastChip () {\n return this.$refs.chips && this.getChips()[this.getChips().length - 1];\n },\n\n getFirstChip () {\n return this.$refs.chips && this.getChips()[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","DtRecipeComboboxWithPopover","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","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_recipe_combobox_with_popover","_mergeProps","$props","$data","$options","_ctx","_createSlots","_withCtx","onInput","_createElementVNode","args","_normalizeClass","_createElementBlock","_Fragment","_renderList","_component_dt_chip","_toHandlers","_withKeys","$event","_createTextVNode","_toDisplayString","_createVNode","_component_dt_input","_cache","_component_dt_validation_messages","_withModifiers","_hoisted_2","_renderSlot"],"mappings":"ijBAqIKA,EAAU,CACb,aAAc,CAAE,KAAM,GACtB,KAAM,8BAEN,WAAY,6BACVC,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,kBAAmB,CACjB,KAAM,QACN,QAAS,IAaX,QAAS,CACP,KAAM,QACN,QAAS,IAMX,eAAgB,CACd,KAAM,OACN,QAAS,cASX,SAAU,CACR,KAAM,QACN,QAAS,MAOX,cAAe,CACb,KAAM,OACN,QAAS,SAMX,cAAe,CACb,KAAM,MACN,QAAS,UAAY,CAAE,MAAO,CAAA,CAA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AAA,cAAc,EAAA,CAAA,GARnByB,EAAAA,WAGEtB,iBA9FV,IAAA,CAAA,CAAA,UAAA,EAAA,IA4EYF,EAAA,eAAeE,EAAA,OAAO,MAAM,GA5ExC,KA6EO,SA7EP,GAAAE,EAAAA,QA+EM,IAEM,CAFNE,EAAAA,mBAEM,MAFNb,EAEM,CADJ+B,aAAsBtB,EAAA,OAAA,QAAA,UAhF9B,IAAA,KAAA,OA0GYF,EAAA,eAAeE,EAAA,OAAO,MAAM,GA1GxC,KA2GO,SA3GP,GAAAE,EAAAA,QA6GM,IAEM,CAFNE,EAAAA,mBAEM,MAFNZ,EAEM,CADJ8B,aAAsBtB,EAAA,OAAA,QAAA,UA9G9B,IAAA,KAAA"}
|
|
1
|
+
{"version":3,"file":"combobox-multi-select.cjs","sources":["../../../recipes/comboboxes/combobox_multi_select/combobox_multi_select.vue"],"sourcesContent":["<!-- eslint-disable vue/no-static-inline-styles -->\n<template>\n <dt-recipe-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-recipe-combobox-with-popover>\n</template>\n\n<script>\n/* eslint-disable max-lines */\nimport DtRecipeComboboxWithPopover from '@/recipes/comboboxes/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: 'DtRecipeComboboxMultiSelect',\n\n components: {\n DtRecipeComboboxWithPopover,\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 this.initSelectedItems();\n },\n },\n\n chipMaxWidth: {\n async handler () {\n 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 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 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 getChipButtons () {\n return this.$refs.chips && this.$refs.chips.map(chip => returnFirstEl(chip.$el).querySelector('button'));\n },\n\n getChips () {\n return this.$refs.chips && this.$refs.chips.map(chip => returnFirstEl(chip.$el));\n },\n\n getLastChipButton () {\n return this.$refs.chips && this.getChipButtons()[this.getChipButtons().length - 1];\n },\n\n getLastChip () {\n return this.$refs.chips && this.getChips()[this.getChips().length - 1];\n },\n\n getFirstChip () {\n return this.$refs.chips && this.getChips()[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","DtRecipeComboboxWithPopover","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","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_recipe_combobox_with_popover","_mergeProps","$props","$data","$options","_ctx","_createSlots","_withCtx","onInput","_createElementVNode","args","_normalizeClass","_createElementBlock","_Fragment","_renderList","_component_dt_chip","_toHandlers","_withKeys","$event","_createTextVNode","_toDisplayString","_createVNode","_component_dt_input","_cache","_component_dt_validation_messages","_withModifiers","_hoisted_2","_renderSlot"],"mappings":"ijBAuIKA,EAAU,CACb,aAAc,CAAE,KAAM,GACtB,KAAM,8BAEN,WAAY,6BACVC,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,kBAAmB,CACjB,KAAM,QACN,QAAS,IAaX,QAAS,CACP,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