@dialpad/dialtone-vue 2.198.0 → 2.198.2

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.
Files changed (53) hide show
  1. package/dist/component-documentation.json +1 -1
  2. package/dist/lib/input/input.cjs +1 -1
  3. package/dist/lib/input/input.cjs.map +1 -1
  4. package/dist/lib/input/input.js +24 -16
  5. package/dist/lib/input/input.js.map +1 -1
  6. package/dist/lib/loader/loader.cjs +1 -1
  7. package/dist/lib/loader/loader.cjs.map +1 -1
  8. package/dist/lib/loader/loader.js +1 -1
  9. package/dist/lib/loader/loader.js.map +1 -1
  10. package/dist/lib/split-button/split-button.cjs +1 -1
  11. package/dist/lib/split-button/split-button.cjs.map +1 -1
  12. package/dist/lib/split-button/split-button.js +7 -4
  13. package/dist/lib/split-button/split-button.js.map +1 -1
  14. package/dist/localization/de-DE.cjs +16 -1
  15. package/dist/localization/de-DE.cjs.map +1 -1
  16. package/dist/localization/de-DE.js +16 -1
  17. package/dist/localization/de-DE.js.map +1 -1
  18. package/dist/localization/es-LA.cjs +13 -5
  19. package/dist/localization/es-LA.cjs.map +1 -1
  20. package/dist/localization/es-LA.js +13 -5
  21. package/dist/localization/es-LA.js.map +1 -1
  22. package/dist/localization/fr-FR.cjs +16 -1
  23. package/dist/localization/fr-FR.cjs.map +1 -1
  24. package/dist/localization/fr-FR.js +16 -1
  25. package/dist/localization/fr-FR.js.map +1 -1
  26. package/dist/localization/it-IT.cjs +16 -1
  27. package/dist/localization/it-IT.cjs.map +1 -1
  28. package/dist/localization/it-IT.js +16 -1
  29. package/dist/localization/it-IT.js.map +1 -1
  30. package/dist/localization/ja-JP.cjs +9 -1
  31. package/dist/localization/ja-JP.cjs.map +1 -1
  32. package/dist/localization/ja-JP.js +9 -1
  33. package/dist/localization/ja-JP.js.map +1 -1
  34. package/dist/localization/nl-NL.cjs +16 -1
  35. package/dist/localization/nl-NL.cjs.map +1 -1
  36. package/dist/localization/nl-NL.js +16 -1
  37. package/dist/localization/nl-NL.js.map +1 -1
  38. package/dist/localization/pt-BR.cjs +16 -1
  39. package/dist/localization/pt-BR.cjs.map +1 -1
  40. package/dist/localization/pt-BR.js +16 -1
  41. package/dist/localization/pt-BR.js.map +1 -1
  42. package/dist/localization/ru-RU.cjs +26 -1
  43. package/dist/localization/ru-RU.cjs.map +1 -1
  44. package/dist/localization/ru-RU.js +26 -1
  45. package/dist/localization/ru-RU.js.map +1 -1
  46. package/dist/localization/zh-CN.cjs +11 -1
  47. package/dist/localization/zh-CN.cjs.map +1 -1
  48. package/dist/localization/zh-CN.js +11 -1
  49. package/dist/localization/zh-CN.js.map +1 -1
  50. package/dist/types/components/input/input.vue.d.ts +9 -0
  51. package/dist/types/components/split_button/split_button.vue.d.ts +1 -0
  52. package/dist/types/components/split_button/split_button.vue.d.ts.map +1 -1
  53. package/package.json +4 -4
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("../../common/constants/index.cjs"),s=require("./input-constants.cjs"),h=require("../../common/utils/index.cjs"),c=require("../../common/mixins/input.cjs"),g=require("../../_plugin-vue2_normalizer-e_CkxkSV.cjs"),f=require("../validation-messages/validation-messages.cjs"),_={name:"DtInput",components:{DtValidationMessages:f.default},mixins:[c.MessagesMixin],inheritAttrs:!1,props:{name:{type:String,default:""},type:{type:String,default:s.INPUT_TYPES.TEXT,validator:e=>Object.values(s.INPUT_TYPES).includes(e)},value:{type:[String,Number],default:""},disabled:{type:Boolean,default:!1},label:{type:String,default:""},labelVisible:{type:Boolean,default:!0},description:{type:String,default:""},size:{type:String,default:"md",validator:e=>Object.values(s.INPUT_SIZES).includes(e)},inputClass:{type:[String,Object,Array],default:""},inputWrapperClass:{type:[String,Object,Array],default:""},currentLength:{type:Number,default:null},retainWarning:{type:Boolean,default:!1},validate:{type:Object,default:null},hidden:{type:Boolean,default:!1}},emits:["input","blur","clear","focus","focusin","focusout","update:length","update:invalid"],data(){return{isInputFocused:!1,isInvalid:!1,defaultLength:0}},computed:{isTextarea(){return this.type===s.INPUT_TYPES.TEXTAREA},isDefaultSize(){return this.size===s.INPUT_SIZES.DEFAULT},iconSize(){return s.INPUT_ICON_SIZES[this.size]},isValidSize(){return Object.values(s.INPUT_SIZES).includes(this.size)},isValidDescriptionSize(){return Object.values(a.DESCRIPTION_SIZE_TYPES).includes(this.size)},inputComponent(){return this.isTextarea?"textarea":"input"},inputListeners(){return{...this.$listeners,input:e=>this.$emit("input",e.target.value),focus:e=>{this.isInputFocused=!0,this.$emit("focus",e)},blur:e=>{this.isInputFocused=!1,this.onBlur(e)}}},descriptionKey(){return`input-description-${h.getUniqueString()}`},inputState(){return h.getValidationState(this.validationMessages)},defaultLengthCalculation(){return this.calculateLength(this.value)},validationProps(){var e,t,i,n,l,r,u,d,o,p;return{length:{description:(t=(e=this==null?void 0:this.validate)==null?void 0:e.length)==null?void 0:t.description,max:(n=(i=this==null?void 0:this.validate)==null?void 0:i.length)==null?void 0:n.max,warn:(r=(l=this==null?void 0:this.validate)==null?void 0:l.length)==null?void 0:r.warn,message:(d=(u=this==null?void 0:this.validate)==null?void 0:u.length)==null?void 0:d.message,limitMaxLength:(p=(o=this==null?void 0:this.validate)==null?void 0:o.length)!=null&&p.limitMaxLength?this.validate.length.limitMaxLength:!1}}},validationMessages(){return this.showLengthLimitValidation?this.formattedMessages.concat([this.inputLengthErrorMessage()]):this.formattedMessages},showInputState(){return this.showMessages&&this.inputState},inputLength(){return this.currentLength?this.currentLength:this.defaultLengthCalculation},inputLengthState(){return this.inputLength<this.validationProps.length.warn?null:this.inputLength<=this.validationProps.length.max?this.validationProps.length.warn?a.VALIDATION_MESSAGE_TYPES.WARNING:null:a.VALIDATION_MESSAGE_TYPES.ERROR},shouldValidateLength(){return!!(this.validationProps.length.description&&this.validationProps.length.max)},shouldLimitMaxLength(){return this.shouldValidateLength&&this.validationProps.length.limitMaxLength},showLengthLimitValidation(){return this.shouldValidateLength&&this.inputLengthState!==null&&this.validationProps.length.message&&(this.retainWarning||this.isInputFocused||this.isInvalid)},sizeModifierClass(){return this.isDefaultSize||!this.isValidSize?"":s.INPUT_SIZE_CLASSES[this.inputComponent][this.size]},stateClass(){return[s.INPUT_STATE_CLASSES[this.inputState]]}},watch:{isInvalid(e){this.$emit("update:invalid",e)},value:{immediate:!0,handler(e){this.shouldValidateLength&&this.validateLength(this.inputLength),this.currentLength==null&&this.$emit("update:length",this.calculateLength(e))}}},beforeMount(){this.descriptionSizeClasses=s.DESCRIPTION_SIZE_CLASSES,this.labelSizeClasses=s.LABEL_SIZE_CLASSES},methods:{inputClasses(){return["d-input__input",this.inputComponent==="input"?"d-input":"d-textarea",{[this.stateClass]:this.showInputState,"d-input-icon--left":this.$slots.leftIcon,"d-input-icon--right":this.$slots.rightIcon},this.sizeModifierClass,this.inputClass]},inputWrapperClasses(){return this.hidden?[]:["d-input__wrapper",{[this.stateClass]:this.showInputState},this.inputWrapperClass]},calculateLength(e){return typeof e!="string"?0:[...e].length},inputLengthErrorMessage(){return{message:this.validationProps.length.message,type:this.inputLengthState}},onBlur(e){var t;(t=this.$refs.container)!=null&&t.contains(e.relatedTarget)||this.$emit("blur",e)},emitClearEvents(){this.$emit("input",""),this.$emit("clear"),this.$emit("update:modelValue","")},blur(){this.$refs.input.blur()},focus(){this.$refs.input.focus()},select(){this.$refs.input.select()},getMessageKey(e,t){return`message-${e}-${t}`},validateLength(e){this.isInvalid=e>this.validationProps.length.max},clearInput(){this.$refs.input.value="",this.$refs.input.focus(),this.emitClearEvents()}}};var m=function(){var t=this,i=t._self._c;return i("div",{ref:"container",class:["d-input__root",{"d-input--hidden":t.hidden}],attrs:{"data-qa":"dt-input"}},[i("label",{staticClass:"d-input__label",attrs:{"aria-details":t.$slots.description||t.description?t.descriptionKey:void 0,"data-qa":"dt-input-label-wrapper"}},[t._t("labelSlot",function(){return[t.labelVisible&&t.label?i("div",{ref:"label",class:["d-input__label-text","d-label",t.labelSizeClasses[t.size]],attrs:{"data-qa":"dt-input-label"}},[t._v(" "+t._s(t.label)+" ")]):t._e()]}),t.$slots.description||t.description||t.shouldValidateLength?i("div",{ref:"description",class:["d-input__description","d-description",t.descriptionSizeClasses[t.size]],attrs:{id:t.descriptionKey,"data-qa":"dt-input-description"}},[t.$slots.description||t.description?i("div",[t._t("description",function(){return[t._v(t._s(t.description))]})],2):t._e(),t.shouldValidateLength?i("div",{staticClass:"d-input__length-description",attrs:{"data-qa":"dt-input-length-description"}},[t._v(" "+t._s(t.validationProps.length.description)+" ")]):t._e()]):t._e(),i("div",{class:t.inputWrapperClasses(),attrs:{"read-only":t.disabled}},[i("span",{staticClass:"d-input-icon d-input-icon--left",attrs:{"data-qa":"dt-input-left-icon-wrapper"},on:{focusout:t.onBlur}},[t._t("leftIcon",null,{iconSize:t.iconSize})],2),t.isTextarea?i("textarea",t._g(t._b({ref:"input",class:t.inputClasses(),attrs:{name:t.name,disabled:t.disabled,autocomplete:t.$attrs.autocomplete??"off",maxlength:t.shouldLimitMaxLength?t.validationProps.length.max:null,"data-qa":t.$attrs["data-qa"]??"dt-input-input"},domProps:{value:t.value}},"textarea",t.$attrs,!1),t.inputListeners)):i("input",t._g(t._b({ref:"input",class:t.inputClasses(),attrs:{name:t.name,type:t.type,disabled:t.disabled,autocomplete:t.$attrs.autocomplete??"off",maxlength:t.shouldLimitMaxLength?t.validationProps.length.max:null,"data-qa":t.$attrs["data-qa"]??"dt-input-input"},domProps:{value:t.value}},"input",t.$attrs,!1),t.inputListeners)),i("span",{staticClass:"d-input-icon d-input-icon--right",attrs:{"data-qa":"dt-input-right-icon-wrapper"},on:{focusout:t.onBlur}},[t._t("rightIcon",null,{iconSize:t.iconSize,clear:t.clearInput})],2)])],2),i("dt-validation-messages",t._b({class:t.messagesClass,attrs:{"validation-messages":t.validationMessages,"show-messages":t.showMessages,"data-qa":"dt-input-messages"}},"dt-validation-messages",t.messagesChildProps,!1))],1)},S=[],v=g.n(_,m,S);const L=v.exports;exports.default=L;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("../../common/constants/index.cjs"),s=require("./input-constants.cjs"),h=require("../../common/utils/index.cjs"),c=require("../../common/mixins/input.cjs"),g=require("../../_plugin-vue2_normalizer-e_CkxkSV.cjs"),f=require("../validation-messages/validation-messages.cjs"),_={name:"DtInput",components:{DtValidationMessages:f.default},mixins:[c.MessagesMixin],inheritAttrs:!1,props:{name:{type:String,default:""},type:{type:String,default:s.INPUT_TYPES.TEXT,validator:e=>Object.values(s.INPUT_TYPES).includes(e)},value:{type:[String,Number],default:""},disabled:{type:Boolean,default:!1},label:{type:String,default:""},labelVisible:{type:Boolean,default:!0},description:{type:String,default:""},size:{type:String,default:"md",validator:e=>Object.values(s.INPUT_SIZES).includes(e)},inputClass:{type:[String,Object,Array],default:""},inputWrapperClass:{type:[String,Object,Array],default:""},rootClass:{type:[String,Object,Array],default:""},currentLength:{type:Number,default:null},retainWarning:{type:Boolean,default:!1},validate:{type:Object,default:null},hidden:{type:Boolean,default:!1}},emits:["input","blur","clear","focus","focusin","focusout","update:length","update:invalid"],data(){return{isInputFocused:!1,isInvalid:!1,defaultLength:0}},computed:{isTextarea(){return this.type===s.INPUT_TYPES.TEXTAREA},isDefaultSize(){return this.size===s.INPUT_SIZES.DEFAULT},iconSize(){return s.INPUT_ICON_SIZES[this.size]},isValidSize(){return Object.values(s.INPUT_SIZES).includes(this.size)},isValidDescriptionSize(){return Object.values(a.DESCRIPTION_SIZE_TYPES).includes(this.size)},inputComponent(){return this.isTextarea?"textarea":"input"},inputListeners(){return{...this.$listeners,input:e=>this.$emit("input",e.target.value),focus:e=>{this.isInputFocused=!0,this.$emit("focus",e)},blur:e=>{this.isInputFocused=!1,this.onBlur(e)}}},descriptionKey(){return`input-description-${h.getUniqueString()}`},inputState(){return h.getValidationState(this.validationMessages)},defaultLengthCalculation(){return this.calculateLength(this.value)},validationProps(){var e,t,i,n,l,r,u,d,o,p;return{length:{description:(t=(e=this==null?void 0:this.validate)==null?void 0:e.length)==null?void 0:t.description,max:(n=(i=this==null?void 0:this.validate)==null?void 0:i.length)==null?void 0:n.max,warn:(r=(l=this==null?void 0:this.validate)==null?void 0:l.length)==null?void 0:r.warn,message:(d=(u=this==null?void 0:this.validate)==null?void 0:u.length)==null?void 0:d.message,limitMaxLength:(p=(o=this==null?void 0:this.validate)==null?void 0:o.length)!=null&&p.limitMaxLength?this.validate.length.limitMaxLength:!1}}},validationMessages(){return this.showLengthLimitValidation?this.formattedMessages.concat([this.inputLengthErrorMessage()]):this.formattedMessages},showInputState(){return this.showMessages&&this.inputState},inputLength(){return this.currentLength?this.currentLength:this.defaultLengthCalculation},inputLengthState(){return this.inputLength<this.validationProps.length.warn?null:this.inputLength<=this.validationProps.length.max?this.validationProps.length.warn?a.VALIDATION_MESSAGE_TYPES.WARNING:null:a.VALIDATION_MESSAGE_TYPES.ERROR},shouldValidateLength(){return!!(this.validationProps.length.description&&this.validationProps.length.max)},shouldLimitMaxLength(){return this.shouldValidateLength&&this.validationProps.length.limitMaxLength},showLengthLimitValidation(){return this.shouldValidateLength&&this.inputLengthState!==null&&this.validationProps.length.message&&(this.retainWarning||this.isInputFocused||this.isInvalid)},sizeModifierClass(){return this.isDefaultSize||!this.isValidSize?"":s.INPUT_SIZE_CLASSES[this.inputComponent][this.size]},stateClass(){return[s.INPUT_STATE_CLASSES[this.inputState]]}},watch:{isInvalid(e){this.$emit("update:invalid",e)},value:{immediate:!0,handler(e){this.shouldValidateLength&&this.validateLength(this.inputLength),this.currentLength==null&&this.$emit("update:length",this.calculateLength(e))}}},beforeMount(){this.descriptionSizeClasses=s.DESCRIPTION_SIZE_CLASSES,this.labelSizeClasses=s.LABEL_SIZE_CLASSES},methods:{inputClasses(){return["d-input__input",this.inputComponent==="input"?"d-input":"d-textarea",{[this.stateClass]:this.showInputState,"d-input-icon--left":this.$slots.leftIcon,"d-input-icon--right":this.$slots.rightIcon},this.sizeModifierClass,this.inputClass]},inputWrapperClasses(){return this.hidden?[]:["d-input__wrapper",{[this.stateClass]:this.showInputState},this.inputWrapperClass]},calculateLength(e){return typeof e!="string"?0:[...e].length},inputLengthErrorMessage(){return{message:this.validationProps.length.message,type:this.inputLengthState}},onBlur(e){var t;(t=this.$refs.container)!=null&&t.contains(e.relatedTarget)||this.$emit("blur",e)},emitClearEvents(){this.$emit("input",""),this.$emit("clear"),this.$emit("update:modelValue","")},blur(){this.$refs.input.blur()},focus(){this.$refs.input.focus()},select(){this.$refs.input.select()},getMessageKey(e,t){return`message-${e}-${t}`},validateLength(e){this.isInvalid=e>this.validationProps.length.max},clearInput(){this.$refs.input.value="",this.$refs.input.focus(),this.emitClearEvents()}}};var m=function(){var t=this,i=t._self._c;return i("div",{ref:"container",class:[t.rootClass,"d-input__root",{"d-input--hidden":t.hidden}],attrs:{"data-qa":"dt-input"}},[i("label",{staticClass:"d-input__label",attrs:{"aria-details":t.$slots.description||t.description?t.descriptionKey:void 0,"data-qa":"dt-input-label-wrapper"}},[t._t("labelSlot",function(){return[t.labelVisible&&t.label?i("div",{ref:"label",class:["d-input__label-text","d-label",t.labelSizeClasses[t.size]],attrs:{"data-qa":"dt-input-label"}},[t._v(" "+t._s(t.label)+" ")]):t._e()]}),t.$slots.description||t.description||t.shouldValidateLength?i("div",{ref:"description",class:["d-input__description","d-description",t.descriptionSizeClasses[t.size]],attrs:{id:t.descriptionKey,"data-qa":"dt-input-description"}},[t.$slots.description||t.description?i("div",[t._t("description",function(){return[t._v(t._s(t.description))]})],2):t._e(),t.shouldValidateLength?i("div",{staticClass:"d-input__length-description",attrs:{"data-qa":"dt-input-length-description"}},[t._v(" "+t._s(t.validationProps.length.description)+" ")]):t._e()]):t._e(),i("div",{class:t.inputWrapperClasses(),attrs:{"read-only":t.disabled}},[i("span",{staticClass:"d-input-icon d-input-icon--left",attrs:{"data-qa":"dt-input-left-icon-wrapper"},on:{focusout:t.onBlur}},[t._t("leftIcon",null,{iconSize:t.iconSize})],2),t.isTextarea?i("textarea",t._g(t._b({ref:"input",class:t.inputClasses(),attrs:{name:t.name,disabled:t.disabled,autocomplete:t.$attrs.autocomplete??"off",maxlength:t.shouldLimitMaxLength?t.validationProps.length.max:null,"data-qa":t.$attrs["data-qa"]??"dt-input-input"},domProps:{value:t.value}},"textarea",t.$attrs,!1),t.inputListeners)):i("input",t._g(t._b({ref:"input",class:t.inputClasses(),attrs:{name:t.name,type:t.type,disabled:t.disabled,autocomplete:t.$attrs.autocomplete??"off",maxlength:t.shouldLimitMaxLength?t.validationProps.length.max:null,"data-qa":t.$attrs["data-qa"]??"dt-input-input"},domProps:{value:t.value}},"input",t.$attrs,!1),t.inputListeners)),i("span",{staticClass:"d-input-icon d-input-icon--right",attrs:{"data-qa":"dt-input-right-icon-wrapper"},on:{focusout:t.onBlur}},[t._t("rightIcon",null,{iconSize:t.iconSize,clear:t.clearInput})],2)])],2),i("dt-validation-messages",t._b({class:t.messagesClass,attrs:{"validation-messages":t.validationMessages,"show-messages":t.showMessages,"data-qa":"dt-input-messages"}},"dt-validation-messages",t.messagesChildProps,!1))],1)},S=[],v=g.n(_,m,S);const L=v.exports;exports.default=L;
2
2
  //# sourceMappingURL=input.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"input.cjs","sources":["../../../components/input/input.vue"],"sourcesContent":["<template>\n <div\n ref=\"container\"\n :class=\"['d-input__root', { 'd-input--hidden': hidden }]\"\n data-qa=\"dt-input\"\n >\n <label\n class=\"d-input__label\"\n :aria-details=\"$slots.description || description ? descriptionKey : undefined\"\n data-qa=\"dt-input-label-wrapper\"\n >\n <!-- @slot Slot for label, defaults to label prop -->\n <slot name=\"labelSlot\">\n <div\n v-if=\"labelVisible && label\"\n ref=\"label\"\n data-qa=\"dt-input-label\"\n :class=\"[\n 'd-input__label-text',\n 'd-label',\n labelSizeClasses[size],\n ]\"\n >\n {{ label }}\n </div>\n </slot>\n <div\n v-if=\"$slots.description || description || shouldValidateLength\"\n :id=\"descriptionKey\"\n ref=\"description\"\n :class=\"[\n 'd-input__description',\n 'd-description',\n descriptionSizeClasses[size],\n ]\"\n data-qa=\"dt-input-description\"\n >\n <div\n v-if=\"$slots.description || description\"\n >\n <!-- @slot Slot for description, defaults to description prop -->\n <slot name=\"description\">{{ description }}</slot>\n </div>\n <div\n v-if=\"shouldValidateLength\"\n data-qa=\"dt-input-length-description\"\n class=\"d-input__length-description\"\n >\n {{ validationProps.length.description }}\n </div>\n </div>\n <div\n :class=\"inputWrapperClasses()\"\n :read-only=\"disabled\"\n >\n <span\n class=\"d-input-icon d-input-icon--left\"\n data-qa=\"dt-input-left-icon-wrapper\"\n @focusout=\"onBlur\"\n >\n <!-- @slot Slot for left icon -->\n <slot\n name=\"leftIcon\"\n :icon-size=\"iconSize\"\n />\n </span>\n <textarea\n v-if=\"isTextarea\"\n ref=\"input\"\n :value=\"value\"\n :name=\"name\"\n :disabled=\"disabled\"\n :autocomplete=\"$attrs.autocomplete ?? 'off'\"\n :class=\"inputClasses()\"\n :maxlength=\"shouldLimitMaxLength ? validationProps.length.max : null\"\n :data-qa=\"$attrs['data-qa'] ?? 'dt-input-input'\"\n v-bind=\"$attrs\"\n v-on=\"inputListeners\"\n />\n <input\n v-else\n ref=\"input\"\n :value=\"value\"\n :name=\"name\"\n :type=\"type\"\n :disabled=\"disabled\"\n :autocomplete=\"$attrs.autocomplete ?? 'off'\"\n :class=\"inputClasses()\"\n :maxlength=\"shouldLimitMaxLength ? validationProps.length.max : null\"\n :data-qa=\"$attrs['data-qa'] ?? 'dt-input-input'\"\n v-bind=\"$attrs\"\n v-on=\"inputListeners\"\n >\n <span\n class=\"d-input-icon d-input-icon--right\"\n data-qa=\"dt-input-right-icon-wrapper\"\n @focusout=\"onBlur\"\n >\n <!-- @slot Slot for right icon -->\n <slot\n name=\"rightIcon\"\n :icon-size=\"iconSize\"\n :clear=\"clearInput\"\n />\n </span>\n </div>\n </label>\n <dt-validation-messages\n :validation-messages=\"validationMessages\"\n :show-messages=\"showMessages\"\n :class=\"messagesClass\"\n v-bind=\"messagesChildProps\"\n data-qa=\"dt-input-messages\"\n />\n </div>\n</template>\n\n<script>\n/* eslint-disable max-lines */\nimport { DESCRIPTION_SIZE_TYPES, VALIDATION_MESSAGE_TYPES } from '@/common/constants';\nimport {\n INPUT_TYPES,\n INPUT_SIZES,\n INPUT_SIZE_CLASSES,\n INPUT_ICON_SIZES,\n INPUT_STATE_CLASSES,\n DESCRIPTION_SIZE_CLASSES,\n LABEL_SIZE_CLASSES,\n} from './input_constants';\nimport {\n getUniqueString,\n getValidationState,\n} from '@/common/utils';\nimport { DtValidationMessages } from '@/components/validation_messages';\nimport { MessagesMixin } from '@/common/mixins/input';\n\n/**\n * An input field is an input control that allows users to enter alphanumeric information.\n * It can have a range of options and supports single line and multi-line lengths,\n * as well as varying formats, including numbers, masked passwords, etc.\n * @property {Boolean} placeholder attribute\n * @see https://dialtone.dialpad.com/components/input.html\n */\nexport default {\n name: 'DtInput',\n\n components: { DtValidationMessages },\n\n mixins: [MessagesMixin],\n\n inheritAttrs: false,\n\n props: {\n /**\n * Name property of the input element\n */\n name: {\n type: String,\n default: '',\n },\n\n /**\n * Type of the input.\n * When `textarea` a `<textarea>` element will be rendered instead of an `<input>` element.\n * @values text, password, email, number, textarea, date, time, file, tel, search\n * @default 'text'\n */\n type: {\n type: String,\n default: INPUT_TYPES.TEXT,\n validator: (t) => Object.values(INPUT_TYPES).includes(t),\n },\n\n /**\n * Value of the input\n */\n value: {\n type: [String, Number],\n default: '',\n },\n\n /**\n * Disables the input\n * @values true, false\n */\n disabled: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Label for the input\n */\n label: {\n type: String,\n default: '',\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 * Size of the input, one of `xs`, `sm`, `md`, `lg`, `xl`\n * @values xs, sm, md, lg, xl\n */\n size: {\n type: String,\n default: 'md',\n validator: (t) => Object.values(INPUT_SIZES).includes(t),\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 * The current character length that the user has entered into the input.\n * This will only need to be used if you are using `validate.length` and\n * the string contains abnormal characters.\n * For example, an emoji could take up many characters in the input, but should only count as 1 character.\n * If no number is provided, a built-in length calculation will be used for the length validation.\n */\n currentLength: {\n type: Number,\n default: null,\n },\n\n /**\n * Whether the input will continue to display a warning validation message even if the input has lost focus.\n */\n retainWarning: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Validation for the input. Supports maximum length validation with the structure:\n * `{ \"length\": {\"description\": string, \"max\": number, \"warn\": number, \"message\": string,\n * \"limitMaxLength\": boolean }}`\n */\n validate: {\n type: Object,\n default: null,\n },\n\n /**\n * hidden allows to use input without the element visually present in DOM\n */\n hidden: {\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 * Native input blur event\n *\n * @event blur\n * @type {FocusEvent}\n */\n 'blur',\n\n /**\n * Input clear event\n *\n * @event clear\n */\n 'clear',\n\n /**\n * Native input focus event\n *\n * @event focus\n * @type {FocusEvent}\n */\n 'focus',\n\n /**\n * Native input focusin event\n *\n * @event focusin\n * @type {FocusEvent}\n */\n 'focusin',\n\n /**\n * Native input focusout event\n *\n * @event focusout\n * @type {FocusEvent}\n */\n 'focusout',\n\n /**\n * Length of the input when currentLength prop is not passed\n *\n * @event update:length\n * @type {Number}\n */\n 'update:length',\n\n /**\n * Result of the input validation\n *\n * @event update:invalid\n * @type {Boolean}\n */\n 'update:invalid',\n ],\n\n data () {\n return {\n isInputFocused: false,\n isInvalid: false,\n defaultLength: 0,\n };\n },\n\n computed: {\n\n isTextarea () {\n return this.type === INPUT_TYPES.TEXTAREA;\n },\n\n isDefaultSize () {\n return this.size === INPUT_SIZES.DEFAULT;\n },\n\n iconSize () {\n return INPUT_ICON_SIZES[this.size];\n },\n\n isValidSize () {\n return Object.values(INPUT_SIZES).includes(this.size);\n },\n\n isValidDescriptionSize () {\n return Object.values(DESCRIPTION_SIZE_TYPES).includes(this.size);\n },\n\n inputComponent () {\n if (this.isTextarea) {\n return 'textarea';\n }\n\n return 'input';\n },\n\n inputListeners () {\n return {\n /* TODO\n Check if any usages of this component leverage $listeners and either remove if unused or scope the removal\n and migration prior to upgrading to Vue 3.x\n */\n ...this.$listeners,\n input: event => this.$emit('input', event.target.value),\n focus: event => {\n this.isInputFocused = true;\n this.$emit('focus', event);\n },\n\n blur: event => {\n this.isInputFocused = false;\n this.onBlur(event);\n },\n };\n },\n\n descriptionKey () {\n return `input-description-${getUniqueString()}`;\n },\n\n inputState () {\n return getValidationState(this.validationMessages);\n },\n\n defaultLengthCalculation () {\n return this.calculateLength(this.value);\n },\n\n validationProps () {\n return {\n length: {\n description: this?.validate?.length?.description,\n max: this?.validate?.length?.max,\n warn: this?.validate?.length?.warn,\n message: this?.validate?.length?.message,\n limitMaxLength: this?.validate?.length?.limitMaxLength ? this.validate.length.limitMaxLength : false,\n },\n };\n },\n\n validationMessages () {\n // Add length validation message if exists\n if (this.showLengthLimitValidation) {\n return this.formattedMessages.concat([this.inputLengthErrorMessage()]);\n }\n\n return this.formattedMessages;\n },\n\n showInputState () {\n return this.showMessages && this.inputState;\n },\n\n inputLength () {\n return this.currentLength ? this.currentLength : this.defaultLengthCalculation;\n },\n\n inputLengthState () {\n if (this.inputLength < this.validationProps.length.warn) {\n return null;\n } else if (this.inputLength <= this.validationProps.length.max) {\n return this.validationProps.length.warn ? VALIDATION_MESSAGE_TYPES.WARNING : null;\n } else {\n return VALIDATION_MESSAGE_TYPES.ERROR;\n }\n },\n\n shouldValidateLength () {\n // eslint-disable-next-line max-lines\n return !!(\n this.validationProps.length.description &&\n this.validationProps.length.max\n );\n },\n\n shouldLimitMaxLength () {\n return this.shouldValidateLength && this.validationProps.length.limitMaxLength;\n },\n\n // eslint-disable-next-line complexity\n showLengthLimitValidation () {\n return (\n this.shouldValidateLength &&\n this.inputLengthState !== null &&\n this.validationProps.length.message &&\n (this.retainWarning || this.isInputFocused || this.isInvalid)\n );\n },\n\n sizeModifierClass () {\n if (this.isDefaultSize || !this.isValidSize) {\n return '';\n }\n\n return INPUT_SIZE_CLASSES[this.inputComponent][this.size];\n },\n\n stateClass () {\n return [INPUT_STATE_CLASSES[this.inputState]];\n },\n },\n\n watch: {\n isInvalid (val) {\n this.$emit('update:invalid', val);\n },\n\n value: {\n immediate: true,\n handler (newValue) {\n if (this.shouldValidateLength) {\n this.validateLength(this.inputLength);\n }\n\n if (this.currentLength == null) {\n this.$emit('update:length', this.calculateLength(newValue));\n }\n },\n },\n },\n\n beforeMount () {\n this.descriptionSizeClasses = DESCRIPTION_SIZE_CLASSES;\n this.labelSizeClasses = LABEL_SIZE_CLASSES;\n },\n\n methods: {\n inputClasses () {\n return [\n 'd-input__input',\n this.inputComponent === 'input' ? 'd-input' : 'd-textarea',\n {\n [this.stateClass]: this.showInputState,\n 'd-input-icon--left': this.$slots.leftIcon,\n 'd-input-icon--right': this.$slots.rightIcon,\n },\n this.sizeModifierClass,\n this.inputClass,\n ];\n },\n\n inputWrapperClasses () {\n if (this.hidden) {\n return [];\n }\n return [\n 'd-input__wrapper',\n { [this.stateClass]: this.showInputState },\n this.inputWrapperClass,\n ];\n },\n\n calculateLength (value) {\n if (typeof value !== 'string') {\n return 0;\n }\n\n return [...value].length;\n },\n\n inputLengthErrorMessage () {\n return {\n message: this.validationProps.length.message,\n type: this.inputLengthState,\n };\n },\n\n onBlur (e) {\n // Do not emit a blur event if the target element is a child of this component\n if (!this.$refs.container?.contains(e.relatedTarget)) {\n this.$emit('blur', e);\n }\n },\n\n emitClearEvents () {\n this.$emit('input', '');\n this.$emit('clear');\n this.$emit('update:modelValue', '');\n },\n\n blur () {\n this.$refs.input.blur();\n },\n\n focus () {\n this.$refs.input.focus();\n },\n\n select () {\n this.$refs.input.select();\n },\n\n getMessageKey (type, index) {\n return `message-${type}-${index}`;\n },\n\n validateLength (length) {\n this.isInvalid = (length > this.validationProps.length.max);\n },\n\n clearInput () {\n this.$refs.input.value = '';\n this.$refs.input.focus();\n this.emitClearEvents();\n },\n },\n};\n</script>\n"],"names":["_sfc_main","DtValidationMessages","MessagesMixin","INPUT_TYPES","t","INPUT_SIZES","INPUT_ICON_SIZES","DESCRIPTION_SIZE_TYPES","event","getUniqueString","getValidationState","_b","_a","_d","_c","_f","_e","_h","_g","_j","_i","VALIDATION_MESSAGE_TYPES","INPUT_SIZE_CLASSES","INPUT_STATE_CLASSES","val","newValue","DESCRIPTION_SIZE_CLASSES","LABEL_SIZE_CLASSES","value","type","index","length"],"mappings":"4YA+IAA,EAAA,CACA,KAAA,UAEA,WAAA,CAAA,qBAAAC,EAAAA,OAAA,EAEA,OAAA,CAAAC,EAAAA,aAAA,EAEA,aAAA,GAEA,MAAA,CAIA,KAAA,CACA,KAAA,OACA,QAAA,EACA,EAQA,KAAA,CACA,KAAA,OACA,QAAAC,EAAAA,YAAA,KACA,UAAAC,GAAA,OAAA,OAAAD,aAAA,EAAA,SAAAC,CAAA,CACA,EAKA,MAAA,CACA,KAAA,CAAA,OAAA,MAAA,EACA,QAAA,EACA,EAMA,SAAA,CACA,KAAA,QACA,QAAA,EACA,EAKA,MAAA,CACA,KAAA,OACA,QAAA,EACA,EAMA,aAAA,CACA,KAAA,QACA,QAAA,EACA,EAKA,YAAA,CACA,KAAA,OACA,QAAA,EACA,EAMA,KAAA,CACA,KAAA,OACA,QAAA,KACA,UAAAA,GAAA,OAAA,OAAAC,aAAA,EAAA,SAAAD,CAAA,CACA,EAOA,WAAA,CACA,KAAA,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AAA,KAAA,gBAAA,OAAA,GACA,EAEA,YAAA,CACA,KAAA,MAAA,MAAA,MAAA,GACA,KAAA,MAAA,MAAA,MAAA,EACA,KAAA,gBAAA,CACA,CACA,CACA"}
1
+ {"version":3,"file":"input.cjs","sources":["../../../components/input/input.vue"],"sourcesContent":["<template>\n <div\n ref=\"container\"\n :class=\"[rootClass, 'd-input__root', { 'd-input--hidden': hidden }]\"\n data-qa=\"dt-input\"\n >\n <label\n class=\"d-input__label\"\n :aria-details=\"$slots.description || description ? descriptionKey : undefined\"\n data-qa=\"dt-input-label-wrapper\"\n >\n <!-- @slot Slot for label, defaults to label prop -->\n <slot name=\"labelSlot\">\n <div\n v-if=\"labelVisible && label\"\n ref=\"label\"\n data-qa=\"dt-input-label\"\n :class=\"[\n 'd-input__label-text',\n 'd-label',\n labelSizeClasses[size],\n ]\"\n >\n {{ label }}\n </div>\n </slot>\n <div\n v-if=\"$slots.description || description || shouldValidateLength\"\n :id=\"descriptionKey\"\n ref=\"description\"\n :class=\"[\n 'd-input__description',\n 'd-description',\n descriptionSizeClasses[size],\n ]\"\n data-qa=\"dt-input-description\"\n >\n <div\n v-if=\"$slots.description || description\"\n >\n <!-- @slot Slot for description, defaults to description prop -->\n <slot name=\"description\">{{ description }}</slot>\n </div>\n <div\n v-if=\"shouldValidateLength\"\n data-qa=\"dt-input-length-description\"\n class=\"d-input__length-description\"\n >\n {{ validationProps.length.description }}\n </div>\n </div>\n <div\n :class=\"inputWrapperClasses()\"\n :read-only=\"disabled\"\n >\n <span\n class=\"d-input-icon d-input-icon--left\"\n data-qa=\"dt-input-left-icon-wrapper\"\n @focusout=\"onBlur\"\n >\n <!-- @slot Slot for left icon -->\n <slot\n name=\"leftIcon\"\n :icon-size=\"iconSize\"\n />\n </span>\n <textarea\n v-if=\"isTextarea\"\n ref=\"input\"\n :value=\"value\"\n :name=\"name\"\n :disabled=\"disabled\"\n :autocomplete=\"$attrs.autocomplete ?? 'off'\"\n :class=\"inputClasses()\"\n :maxlength=\"shouldLimitMaxLength ? validationProps.length.max : null\"\n :data-qa=\"$attrs['data-qa'] ?? 'dt-input-input'\"\n v-bind=\"$attrs\"\n v-on=\"inputListeners\"\n />\n <input\n v-else\n ref=\"input\"\n :value=\"value\"\n :name=\"name\"\n :type=\"type\"\n :disabled=\"disabled\"\n :autocomplete=\"$attrs.autocomplete ?? 'off'\"\n :class=\"inputClasses()\"\n :maxlength=\"shouldLimitMaxLength ? validationProps.length.max : null\"\n :data-qa=\"$attrs['data-qa'] ?? 'dt-input-input'\"\n v-bind=\"$attrs\"\n v-on=\"inputListeners\"\n >\n <span\n class=\"d-input-icon d-input-icon--right\"\n data-qa=\"dt-input-right-icon-wrapper\"\n @focusout=\"onBlur\"\n >\n <!-- @slot Slot for right icon -->\n <slot\n name=\"rightIcon\"\n :icon-size=\"iconSize\"\n :clear=\"clearInput\"\n />\n </span>\n </div>\n </label>\n <dt-validation-messages\n :validation-messages=\"validationMessages\"\n :show-messages=\"showMessages\"\n :class=\"messagesClass\"\n v-bind=\"messagesChildProps\"\n data-qa=\"dt-input-messages\"\n />\n </div>\n</template>\n\n<script>\n/* eslint-disable max-lines */\nimport { DESCRIPTION_SIZE_TYPES, VALIDATION_MESSAGE_TYPES } from '@/common/constants';\nimport {\n INPUT_TYPES,\n INPUT_SIZES,\n INPUT_SIZE_CLASSES,\n INPUT_ICON_SIZES,\n INPUT_STATE_CLASSES,\n DESCRIPTION_SIZE_CLASSES,\n LABEL_SIZE_CLASSES,\n} from './input_constants';\nimport {\n getUniqueString,\n getValidationState,\n} from '@/common/utils';\nimport { DtValidationMessages } from '@/components/validation_messages';\nimport { MessagesMixin } from '@/common/mixins/input';\n\n/**\n * An input field is an input control that allows users to enter alphanumeric information.\n * It can have a range of options and supports single line and multi-line lengths,\n * as well as varying formats, including numbers, masked passwords, etc.\n * @property {Boolean} placeholder attribute\n * @see https://dialtone.dialpad.com/components/input.html\n */\nexport default {\n name: 'DtInput',\n\n components: { DtValidationMessages },\n\n mixins: [MessagesMixin],\n\n inheritAttrs: false,\n\n props: {\n /**\n * Name property of the input element\n */\n name: {\n type: String,\n default: '',\n },\n\n /**\n * Type of the input.\n * When `textarea` a `<textarea>` element will be rendered instead of an `<input>` element.\n * @values text, password, email, number, textarea, date, time, file, tel, search\n * @default 'text'\n */\n type: {\n type: String,\n default: INPUT_TYPES.TEXT,\n validator: (t) => Object.values(INPUT_TYPES).includes(t),\n },\n\n /**\n * Value of the input\n */\n value: {\n type: [String, Number],\n default: '',\n },\n\n /**\n * Disables the input\n * @values true, false\n */\n disabled: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Label for the input\n */\n label: {\n type: String,\n default: '',\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 * Size of the input, one of `xs`, `sm`, `md`, `lg`, `xl`\n * @values xs, sm, md, lg, xl\n */\n size: {\n type: String,\n default: 'md',\n validator: (t) => Object.values(INPUT_SIZES).includes(t),\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 * Additional class name for the root 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 rootClass: {\n type: [String, Object, Array],\n default: '',\n },\n\n /**\n * The current character length that the user has entered into the input.\n * This will only need to be used if you are using `validate.length` and\n * the string contains abnormal characters.\n * For example, an emoji could take up many characters in the input, but should only count as 1 character.\n * If no number is provided, a built-in length calculation will be used for the length validation.\n */\n currentLength: {\n type: Number,\n default: null,\n },\n\n /**\n * Whether the input will continue to display a warning validation message even if the input has lost focus.\n */\n retainWarning: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Validation for the input. Supports maximum length validation with the structure:\n * `{ \"length\": {\"description\": string, \"max\": number, \"warn\": number, \"message\": string,\n * \"limitMaxLength\": boolean }}`\n */\n validate: {\n type: Object,\n default: null,\n },\n\n /**\n * hidden allows to use input without the element visually present in DOM\n */\n hidden: {\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 * Native input blur event\n *\n * @event blur\n * @type {FocusEvent}\n */\n 'blur',\n\n /**\n * Input clear event\n *\n * @event clear\n */\n 'clear',\n\n /**\n * Native input focus event\n *\n * @event focus\n * @type {FocusEvent}\n */\n 'focus',\n\n /**\n * Native input focusin event\n *\n * @event focusin\n * @type {FocusEvent}\n */\n 'focusin',\n\n /**\n * Native input focusout event\n *\n * @event focusout\n * @type {FocusEvent}\n */\n 'focusout',\n\n /**\n * Length of the input when currentLength prop is not passed\n *\n * @event update:length\n * @type {Number}\n */\n 'update:length',\n\n /**\n * Result of the input validation\n *\n * @event update:invalid\n * @type {Boolean}\n */\n 'update:invalid',\n ],\n\n data () {\n return {\n isInputFocused: false,\n isInvalid: false,\n defaultLength: 0,\n };\n },\n\n computed: {\n\n isTextarea () {\n return this.type === INPUT_TYPES.TEXTAREA;\n },\n\n isDefaultSize () {\n return this.size === INPUT_SIZES.DEFAULT;\n },\n\n iconSize () {\n return INPUT_ICON_SIZES[this.size];\n },\n\n isValidSize () {\n return Object.values(INPUT_SIZES).includes(this.size);\n },\n\n isValidDescriptionSize () {\n return Object.values(DESCRIPTION_SIZE_TYPES).includes(this.size);\n },\n\n inputComponent () {\n if (this.isTextarea) {\n return 'textarea';\n }\n\n return 'input';\n },\n\n inputListeners () {\n return {\n /* TODO\n Check if any usages of this component leverage $listeners and either remove if unused or scope the removal\n and migration prior to upgrading to Vue 3.x\n */\n ...this.$listeners,\n input: event => this.$emit('input', event.target.value),\n focus: event => {\n this.isInputFocused = true;\n this.$emit('focus', event);\n },\n\n blur: event => {\n this.isInputFocused = false;\n this.onBlur(event);\n },\n };\n },\n\n descriptionKey () {\n return `input-description-${getUniqueString()}`;\n },\n\n inputState () {\n return getValidationState(this.validationMessages);\n },\n\n defaultLengthCalculation () {\n return this.calculateLength(this.value);\n },\n\n validationProps () {\n return {\n length: {\n description: this?.validate?.length?.description,\n max: this?.validate?.length?.max,\n warn: this?.validate?.length?.warn,\n message: this?.validate?.length?.message,\n limitMaxLength: this?.validate?.length?.limitMaxLength ? this.validate.length.limitMaxLength : false,\n },\n };\n },\n\n validationMessages () {\n // Add length validation message if exists\n if (this.showLengthLimitValidation) {\n return this.formattedMessages.concat([this.inputLengthErrorMessage()]);\n }\n\n return this.formattedMessages;\n },\n\n showInputState () {\n return this.showMessages && this.inputState;\n },\n\n inputLength () {\n return this.currentLength ? this.currentLength : this.defaultLengthCalculation;\n },\n\n inputLengthState () {\n if (this.inputLength < this.validationProps.length.warn) {\n return null;\n } else if (this.inputLength <= this.validationProps.length.max) {\n return this.validationProps.length.warn ? VALIDATION_MESSAGE_TYPES.WARNING : null;\n } else {\n return VALIDATION_MESSAGE_TYPES.ERROR;\n }\n },\n\n shouldValidateLength () {\n return !!(\n this.validationProps.length.description &&\n this.validationProps.length.max\n );\n },\n\n shouldLimitMaxLength () {\n return this.shouldValidateLength && this.validationProps.length.limitMaxLength;\n },\n\n showLengthLimitValidation () {\n return (\n this.shouldValidateLength &&\n this.inputLengthState !== null &&\n this.validationProps.length.message &&\n (this.retainWarning || this.isInputFocused || this.isInvalid)\n );\n },\n\n sizeModifierClass () {\n if (this.isDefaultSize || !this.isValidSize) {\n return '';\n }\n\n return INPUT_SIZE_CLASSES[this.inputComponent][this.size];\n },\n\n stateClass () {\n return [INPUT_STATE_CLASSES[this.inputState]];\n },\n },\n\n watch: {\n isInvalid (val) {\n this.$emit('update:invalid', val);\n },\n\n value: {\n immediate: true,\n handler (newValue) {\n if (this.shouldValidateLength) {\n this.validateLength(this.inputLength);\n }\n\n if (this.currentLength == null) {\n this.$emit('update:length', this.calculateLength(newValue));\n }\n },\n },\n },\n\n beforeMount () {\n this.descriptionSizeClasses = DESCRIPTION_SIZE_CLASSES;\n this.labelSizeClasses = LABEL_SIZE_CLASSES;\n },\n\n methods: {\n inputClasses () {\n return [\n 'd-input__input',\n this.inputComponent === 'input' ? 'd-input' : 'd-textarea',\n {\n [this.stateClass]: this.showInputState,\n 'd-input-icon--left': this.$slots.leftIcon,\n 'd-input-icon--right': this.$slots.rightIcon,\n },\n this.sizeModifierClass,\n this.inputClass,\n ];\n },\n\n inputWrapperClasses () {\n if (this.hidden) {\n return [];\n }\n return [\n 'd-input__wrapper',\n { [this.stateClass]: this.showInputState },\n this.inputWrapperClass,\n ];\n },\n\n calculateLength (value) {\n if (typeof value !== 'string') {\n return 0;\n }\n\n return [...value].length;\n },\n\n inputLengthErrorMessage () {\n return {\n message: this.validationProps.length.message,\n type: this.inputLengthState,\n };\n },\n\n onBlur (e) {\n // Do not emit a blur event if the target element is a child of this component\n if (!this.$refs.container?.contains(e.relatedTarget)) {\n this.$emit('blur', e);\n }\n },\n\n emitClearEvents () {\n this.$emit('input', '');\n this.$emit('clear');\n this.$emit('update:modelValue', '');\n },\n\n blur () {\n this.$refs.input.blur();\n },\n\n focus () {\n this.$refs.input.focus();\n },\n\n select () {\n this.$refs.input.select();\n },\n\n getMessageKey (type, index) {\n return `message-${type}-${index}`;\n },\n\n validateLength (length) {\n this.isInvalid = (length > this.validationProps.length.max);\n },\n\n clearInput () {\n this.$refs.input.value = '';\n this.$refs.input.focus();\n this.emitClearEvents();\n },\n },\n};\n</script>\n"],"names":["_sfc_main","DtValidationMessages","MessagesMixin","INPUT_TYPES","t","INPUT_SIZES","INPUT_ICON_SIZES","DESCRIPTION_SIZE_TYPES","event","getUniqueString","getValidationState","_b","_a","_d","_c","_f","_e","_h","_g","_j","_i","VALIDATION_MESSAGE_TYPES","INPUT_SIZE_CLASSES","INPUT_STATE_CLASSES","val","newValue","DESCRIPTION_SIZE_CLASSES","LABEL_SIZE_CLASSES","value","type","index","length"],"mappings":"4YA+IAA,EAAA,CACA,KAAA,UAEA,WAAA,CAAA,qBAAAC,EAAAA,OAAA,EAEA,OAAA,CAAAC,EAAAA,aAAA,EAEA,aAAA,GAEA,MAAA,CAIA,KAAA,CACA,KAAA,OACA,QAAA,EACA,EAQA,KAAA,CACA,KAAA,OACA,QAAAC,EAAAA,YAAA,KACA,UAAAC,GAAA,OAAA,OAAAD,aAAA,EAAA,SAAAC,CAAA,CACA,EAKA,MAAA,CACA,KAAA,CAAA,OAAA,MAAA,EACA,QAAA,EACA,EAMA,SAAA,CACA,KAAA,QACA,QAAA,EACA,EAKA,MAAA,CACA,KAAA,OACA,QAAA,EACA,EAMA,aAAA,CACA,KAAA,QACA,QAAA,EACA,EAKA,YAAA,CACA,KAAA,OACA,QAAA,EACA,EAMA,KAAA,CACA,KAAA,OACA,QAAA,KACA,UAAAA,GAAA,OAAA,OAAAC,aAAA,EAAA,SAAAD,CAAA,CACA,EAOA,WAAA,CACA,KAAA,CAAA,OAAA,OAAA,KAAA,EACA,QAAA,EACA,EAOA,kBAAA,CACA,KAAA,CAAA,OAAA,OAAA,KAAA,EACA,QAAA,EACA,EAOA,UAAA,CACA,KAAA,CAAA,OAAA,OAAA,KAAA,EACA,QAAA,EACA,EASA,cAAA,CACA,KAAA,OACA,QAAA,IACA,EAKA,cAAA,CACA,KAAA,QACA,QAAA,EACA,EAOA,SAAA,CACA,KAAA,OACA,QAAA,IACA,EAKA,OAAA,CACA,KAAA,QACA,QAAA,EACA,CACA,EAEA,MAAA,CAOA,QAQA,OAOA,QAQA,QAQA,UAQA,WAQA,gBAQA,gBACA,EAEA,MAAA,CACA,MAAA,CACA,eAAA,GACA,UAAA,GACA,cAAA,CACA,CACA,EAEA,SAAA,CAEA,YAAA,CACA,OAAA,KAAA,OAAAD,EAAAA,YAAA,QACA,EAEA,eAAA,CACA,OAAA,KAA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AEA,qBAAA,CACA,OAAA,KAAA,OACA,CAAA,EAEA,CACA,mBACA,CAAA,CAAA,KAAA,UAAA,EAAA,KAAA,cAAA,EACA,KAAA,iBACA,CACA,EAEA,gBAAAC,EAAA,CACA,OAAA,OAAAA,GAAA,SACA,EAGA,CAAA,GAAAA,CAAA,EAAA,MACA,EAEA,yBAAA,CACA,MAAA,CACA,QAAA,KAAA,gBAAA,OAAA,QACA,KAAA,KAAA,gBACA,CACA,EAEA,OAAA,EAAA,QAEAhB,EAAA,KAAA,MAAA,YAAA,MAAAA,EAAA,SAAA,EAAA,gBACA,KAAA,MAAA,OAAA,CAAA,CAEA,EAEA,iBAAA,CACA,KAAA,MAAA,QAAA,EAAA,EACA,KAAA,MAAA,OAAA,EACA,KAAA,MAAA,oBAAA,EAAA,CACA,EAEA,MAAA,CACA,KAAA,MAAA,MAAA,KAAA,CACA,EAEA,OAAA,CACA,KAAA,MAAA,MAAA,MAAA,CACA,EAEA,QAAA,CACA,KAAA,MAAA,MAAA,OAAA,CACA,EAEA,cAAAiB,EAAAC,EAAA,CACA,MAAA,WAAAD,CAAA,IAAAC,CAAA,EACA,EAEA,eAAAC,EAAA,CACA,KAAA,UAAAA,EAAA,KAAA,gBAAA,OAAA,GACA,EAEA,YAAA,CACA,KAAA,MAAA,MAAA,MAAA,GACA,KAAA,MAAA,MAAA,MAAA,EACA,KAAA,gBAAA,CACA,CACA,CACA"}
@@ -1,10 +1,10 @@
1
1
  import { VALIDATION_MESSAGE_TYPES as h, DESCRIPTION_SIZE_TYPES as c } from "../../common/constants/index.js";
2
- import { INPUT_TYPES as s, DESCRIPTION_SIZE_CLASSES as g, LABEL_SIZE_CLASSES as f, INPUT_STATE_CLASSES as m, INPUT_SIZE_CLASSES as v, INPUT_SIZES as a, INPUT_ICON_SIZES as _ } from "./input-constants.js";
3
- import { getValidationState as S, getUniqueString as L } from "../../common/utils/index.js";
2
+ import { INPUT_TYPES as s, DESCRIPTION_SIZE_CLASSES as g, LABEL_SIZE_CLASSES as f, INPUT_STATE_CLASSES as m, INPUT_SIZE_CLASSES as v, INPUT_SIZES as a, INPUT_ICON_SIZES as S } from "./input-constants.js";
3
+ import { getValidationState as _, getUniqueString as L } from "../../common/utils/index.js";
4
4
  import { MessagesMixin as b } from "../../common/mixins/input.js";
5
5
  import { n as C } from "../../_plugin-vue2_normalizer-DSLOjnn3.js";
6
6
  import I from "../validation-messages/validation-messages.js";
7
- const $ = {
7
+ const y = {
8
8
  name: "DtInput",
9
9
  components: { DtValidationMessages: I },
10
10
  mixins: [b],
@@ -92,6 +92,15 @@ const $ = {
92
92
  type: [String, Object, Array],
93
93
  default: ""
94
94
  },
95
+ /**
96
+ * Additional class name for the root element.
97
+ * Can accept all of String, Object, and Array, i.e. has the
98
+ * same api as Vue's built-in handling of the class attribute.
99
+ */
100
+ rootClass: {
101
+ type: [String, Object, Array],
102
+ default: ""
103
+ },
95
104
  /**
96
105
  * The current character length that the user has entered into the input.
97
106
  * This will only need to be used if you are using `validate.length` and
@@ -199,7 +208,7 @@ const $ = {
199
208
  return this.size === a.DEFAULT;
200
209
  },
201
210
  iconSize() {
202
- return _[this.size];
211
+ return S[this.size];
203
212
  },
204
213
  isValidSize() {
205
214
  return Object.values(a).includes(this.size);
@@ -230,20 +239,20 @@ const $ = {
230
239
  return `input-description-${L()}`;
231
240
  },
232
241
  inputState() {
233
- return S(this.validationMessages);
242
+ return _(this.validationMessages);
234
243
  },
235
244
  defaultLengthCalculation() {
236
245
  return this.calculateLength(this.value);
237
246
  },
238
247
  validationProps() {
239
- var e, t, i, n, l, r, u, d, o, p;
248
+ var e, t, i, n, l, r, u, o, d, p;
240
249
  return {
241
250
  length: {
242
251
  description: (t = (e = this == null ? void 0 : this.validate) == null ? void 0 : e.length) == null ? void 0 : t.description,
243
252
  max: (n = (i = this == null ? void 0 : this.validate) == null ? void 0 : i.length) == null ? void 0 : n.max,
244
253
  warn: (r = (l = this == null ? void 0 : this.validate) == null ? void 0 : l.length) == null ? void 0 : r.warn,
245
- message: (d = (u = this == null ? void 0 : this.validate) == null ? void 0 : u.length) == null ? void 0 : d.message,
246
- limitMaxLength: (p = (o = this == null ? void 0 : this.validate) == null ? void 0 : o.length) != null && p.limitMaxLength ? this.validate.length.limitMaxLength : !1
254
+ message: (o = (u = this == null ? void 0 : this.validate) == null ? void 0 : u.length) == null ? void 0 : o.message,
255
+ limitMaxLength: (p = (d = this == null ? void 0 : this.validate) == null ? void 0 : d.length) != null && p.limitMaxLength ? this.validate.length.limitMaxLength : !1
247
256
  }
248
257
  };
249
258
  },
@@ -265,7 +274,6 @@ const $ = {
265
274
  shouldLimitMaxLength() {
266
275
  return this.shouldValidateLength && this.validationProps.length.limitMaxLength;
267
276
  },
268
- // eslint-disable-next-line complexity
269
277
  showLengthLimitValidation() {
270
278
  return this.shouldValidateLength && this.inputLengthState !== null && this.validationProps.length.message && (this.retainWarning || this.isInputFocused || this.isInvalid);
271
279
  },
@@ -347,9 +355,9 @@ const $ = {
347
355
  }
348
356
  }
349
357
  };
350
- var x = function() {
358
+ var $ = function() {
351
359
  var t = this, i = t._self._c;
352
- return i("div", { ref: "container", class: ["d-input__root", { "d-input--hidden": t.hidden }], attrs: { "data-qa": "dt-input" } }, [i("label", { staticClass: "d-input__label", attrs: { "aria-details": t.$slots.description || t.description ? t.descriptionKey : void 0, "data-qa": "dt-input-label-wrapper" } }, [t._t("labelSlot", function() {
360
+ return i("div", { ref: "container", class: [t.rootClass, "d-input__root", { "d-input--hidden": t.hidden }], attrs: { "data-qa": "dt-input" } }, [i("label", { staticClass: "d-input__label", attrs: { "aria-details": t.$slots.description || t.description ? t.descriptionKey : void 0, "data-qa": "dt-input-label-wrapper" } }, [t._t("labelSlot", function() {
353
361
  return [t.labelVisible && t.label ? i("div", { ref: "label", class: [
354
362
  "d-input__label-text",
355
363
  "d-label",
@@ -362,13 +370,13 @@ var x = function() {
362
370
  ], attrs: { id: t.descriptionKey, "data-qa": "dt-input-description" } }, [t.$slots.description || t.description ? i("div", [t._t("description", function() {
363
371
  return [t._v(t._s(t.description))];
364
372
  })], 2) : t._e(), t.shouldValidateLength ? i("div", { staticClass: "d-input__length-description", attrs: { "data-qa": "dt-input-length-description" } }, [t._v(" " + t._s(t.validationProps.length.description) + " ")]) : t._e()]) : t._e(), i("div", { class: t.inputWrapperClasses(), attrs: { "read-only": t.disabled } }, [i("span", { staticClass: "d-input-icon d-input-icon--left", attrs: { "data-qa": "dt-input-left-icon-wrapper" }, on: { focusout: t.onBlur } }, [t._t("leftIcon", null, { iconSize: t.iconSize })], 2), t.isTextarea ? i("textarea", t._g(t._b({ ref: "input", class: t.inputClasses(), attrs: { name: t.name, disabled: t.disabled, autocomplete: t.$attrs.autocomplete ?? "off", maxlength: t.shouldLimitMaxLength ? t.validationProps.length.max : null, "data-qa": t.$attrs["data-qa"] ?? "dt-input-input" }, domProps: { value: t.value } }, "textarea", t.$attrs, !1), t.inputListeners)) : i("input", t._g(t._b({ ref: "input", class: t.inputClasses(), attrs: { name: t.name, type: t.type, disabled: t.disabled, autocomplete: t.$attrs.autocomplete ?? "off", maxlength: t.shouldLimitMaxLength ? t.validationProps.length.max : null, "data-qa": t.$attrs["data-qa"] ?? "dt-input-input" }, domProps: { value: t.value } }, "input", t.$attrs, !1), t.inputListeners)), i("span", { staticClass: "d-input-icon d-input-icon--right", attrs: { "data-qa": "dt-input-right-icon-wrapper" }, on: { focusout: t.onBlur } }, [t._t("rightIcon", null, { iconSize: t.iconSize, clear: t.clearInput })], 2)])], 2), i("dt-validation-messages", t._b({ class: t.messagesClass, attrs: { "validation-messages": t.validationMessages, "show-messages": t.showMessages, "data-qa": "dt-input-messages" } }, "dt-validation-messages", t.messagesChildProps, !1))], 1);
365
- }, E = [], y = /* @__PURE__ */ C(
373
+ }, x = [], E = /* @__PURE__ */ C(
374
+ y,
366
375
  $,
367
- x,
368
- E
376
+ x
369
377
  );
370
- const A = y.exports;
378
+ const V = E.exports;
371
379
  export {
372
- A as default
380
+ V as default
373
381
  };
374
382
  //# sourceMappingURL=input.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"input.js","sources":["../../../components/input/input.vue"],"sourcesContent":["<template>\n <div\n ref=\"container\"\n :class=\"['d-input__root', { 'd-input--hidden': hidden }]\"\n data-qa=\"dt-input\"\n >\n <label\n class=\"d-input__label\"\n :aria-details=\"$slots.description || description ? descriptionKey : undefined\"\n data-qa=\"dt-input-label-wrapper\"\n >\n <!-- @slot Slot for label, defaults to label prop -->\n <slot name=\"labelSlot\">\n <div\n v-if=\"labelVisible && label\"\n ref=\"label\"\n data-qa=\"dt-input-label\"\n :class=\"[\n 'd-input__label-text',\n 'd-label',\n labelSizeClasses[size],\n ]\"\n >\n {{ label }}\n </div>\n </slot>\n <div\n v-if=\"$slots.description || description || shouldValidateLength\"\n :id=\"descriptionKey\"\n ref=\"description\"\n :class=\"[\n 'd-input__description',\n 'd-description',\n descriptionSizeClasses[size],\n ]\"\n data-qa=\"dt-input-description\"\n >\n <div\n v-if=\"$slots.description || description\"\n >\n <!-- @slot Slot for description, defaults to description prop -->\n <slot name=\"description\">{{ description }}</slot>\n </div>\n <div\n v-if=\"shouldValidateLength\"\n data-qa=\"dt-input-length-description\"\n class=\"d-input__length-description\"\n >\n {{ validationProps.length.description }}\n </div>\n </div>\n <div\n :class=\"inputWrapperClasses()\"\n :read-only=\"disabled\"\n >\n <span\n class=\"d-input-icon d-input-icon--left\"\n data-qa=\"dt-input-left-icon-wrapper\"\n @focusout=\"onBlur\"\n >\n <!-- @slot Slot for left icon -->\n <slot\n name=\"leftIcon\"\n :icon-size=\"iconSize\"\n />\n </span>\n <textarea\n v-if=\"isTextarea\"\n ref=\"input\"\n :value=\"value\"\n :name=\"name\"\n :disabled=\"disabled\"\n :autocomplete=\"$attrs.autocomplete ?? 'off'\"\n :class=\"inputClasses()\"\n :maxlength=\"shouldLimitMaxLength ? validationProps.length.max : null\"\n :data-qa=\"$attrs['data-qa'] ?? 'dt-input-input'\"\n v-bind=\"$attrs\"\n v-on=\"inputListeners\"\n />\n <input\n v-else\n ref=\"input\"\n :value=\"value\"\n :name=\"name\"\n :type=\"type\"\n :disabled=\"disabled\"\n :autocomplete=\"$attrs.autocomplete ?? 'off'\"\n :class=\"inputClasses()\"\n :maxlength=\"shouldLimitMaxLength ? validationProps.length.max : null\"\n :data-qa=\"$attrs['data-qa'] ?? 'dt-input-input'\"\n v-bind=\"$attrs\"\n v-on=\"inputListeners\"\n >\n <span\n class=\"d-input-icon d-input-icon--right\"\n data-qa=\"dt-input-right-icon-wrapper\"\n @focusout=\"onBlur\"\n >\n <!-- @slot Slot for right icon -->\n <slot\n name=\"rightIcon\"\n :icon-size=\"iconSize\"\n :clear=\"clearInput\"\n />\n </span>\n </div>\n </label>\n <dt-validation-messages\n :validation-messages=\"validationMessages\"\n :show-messages=\"showMessages\"\n :class=\"messagesClass\"\n v-bind=\"messagesChildProps\"\n data-qa=\"dt-input-messages\"\n />\n </div>\n</template>\n\n<script>\n/* eslint-disable max-lines */\nimport { DESCRIPTION_SIZE_TYPES, VALIDATION_MESSAGE_TYPES } from '@/common/constants';\nimport {\n INPUT_TYPES,\n INPUT_SIZES,\n INPUT_SIZE_CLASSES,\n INPUT_ICON_SIZES,\n INPUT_STATE_CLASSES,\n DESCRIPTION_SIZE_CLASSES,\n LABEL_SIZE_CLASSES,\n} from './input_constants';\nimport {\n getUniqueString,\n getValidationState,\n} from '@/common/utils';\nimport { DtValidationMessages } from '@/components/validation_messages';\nimport { MessagesMixin } from '@/common/mixins/input';\n\n/**\n * An input field is an input control that allows users to enter alphanumeric information.\n * It can have a range of options and supports single line and multi-line lengths,\n * as well as varying formats, including numbers, masked passwords, etc.\n * @property {Boolean} placeholder attribute\n * @see https://dialtone.dialpad.com/components/input.html\n */\nexport default {\n name: 'DtInput',\n\n components: { DtValidationMessages },\n\n mixins: [MessagesMixin],\n\n inheritAttrs: false,\n\n props: {\n /**\n * Name property of the input element\n */\n name: {\n type: String,\n default: '',\n },\n\n /**\n * Type of the input.\n * When `textarea` a `<textarea>` element will be rendered instead of an `<input>` element.\n * @values text, password, email, number, textarea, date, time, file, tel, search\n * @default 'text'\n */\n type: {\n type: String,\n default: INPUT_TYPES.TEXT,\n validator: (t) => Object.values(INPUT_TYPES).includes(t),\n },\n\n /**\n * Value of the input\n */\n value: {\n type: [String, Number],\n default: '',\n },\n\n /**\n * Disables the input\n * @values true, false\n */\n disabled: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Label for the input\n */\n label: {\n type: String,\n default: '',\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 * Size of the input, one of `xs`, `sm`, `md`, `lg`, `xl`\n * @values xs, sm, md, lg, xl\n */\n size: {\n type: String,\n default: 'md',\n validator: (t) => Object.values(INPUT_SIZES).includes(t),\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 * The current character length that the user has entered into the input.\n * This will only need to be used if you are using `validate.length` and\n * the string contains abnormal characters.\n * For example, an emoji could take up many characters in the input, but should only count as 1 character.\n * If no number is provided, a built-in length calculation will be used for the length validation.\n */\n currentLength: {\n type: Number,\n default: null,\n },\n\n /**\n * Whether the input will continue to display a warning validation message even if the input has lost focus.\n */\n retainWarning: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Validation for the input. Supports maximum length validation with the structure:\n * `{ \"length\": {\"description\": string, \"max\": number, \"warn\": number, \"message\": string,\n * \"limitMaxLength\": boolean }}`\n */\n validate: {\n type: Object,\n default: null,\n },\n\n /**\n * hidden allows to use input without the element visually present in DOM\n */\n hidden: {\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 * Native input blur event\n *\n * @event blur\n * @type {FocusEvent}\n */\n 'blur',\n\n /**\n * Input clear event\n *\n * @event clear\n */\n 'clear',\n\n /**\n * Native input focus event\n *\n * @event focus\n * @type {FocusEvent}\n */\n 'focus',\n\n /**\n * Native input focusin event\n *\n * @event focusin\n * @type {FocusEvent}\n */\n 'focusin',\n\n /**\n * Native input focusout event\n *\n * @event focusout\n * @type {FocusEvent}\n */\n 'focusout',\n\n /**\n * Length of the input when currentLength prop is not passed\n *\n * @event update:length\n * @type {Number}\n */\n 'update:length',\n\n /**\n * Result of the input validation\n *\n * @event update:invalid\n * @type {Boolean}\n */\n 'update:invalid',\n ],\n\n data () {\n return {\n isInputFocused: false,\n isInvalid: false,\n defaultLength: 0,\n };\n },\n\n computed: {\n\n isTextarea () {\n return this.type === INPUT_TYPES.TEXTAREA;\n },\n\n isDefaultSize () {\n return this.size === INPUT_SIZES.DEFAULT;\n },\n\n iconSize () {\n return INPUT_ICON_SIZES[this.size];\n },\n\n isValidSize () {\n return Object.values(INPUT_SIZES).includes(this.size);\n },\n\n isValidDescriptionSize () {\n return Object.values(DESCRIPTION_SIZE_TYPES).includes(this.size);\n },\n\n inputComponent () {\n if (this.isTextarea) {\n return 'textarea';\n }\n\n return 'input';\n },\n\n inputListeners () {\n return {\n /* TODO\n Check if any usages of this component leverage $listeners and either remove if unused or scope the removal\n and migration prior to upgrading to Vue 3.x\n */\n ...this.$listeners,\n input: event => this.$emit('input', event.target.value),\n focus: event => {\n this.isInputFocused = true;\n this.$emit('focus', event);\n },\n\n blur: event => {\n this.isInputFocused = false;\n this.onBlur(event);\n },\n };\n },\n\n descriptionKey () {\n return `input-description-${getUniqueString()}`;\n },\n\n inputState () {\n return getValidationState(this.validationMessages);\n },\n\n defaultLengthCalculation () {\n return this.calculateLength(this.value);\n },\n\n validationProps () {\n return {\n length: {\n description: this?.validate?.length?.description,\n max: this?.validate?.length?.max,\n warn: this?.validate?.length?.warn,\n message: this?.validate?.length?.message,\n limitMaxLength: this?.validate?.length?.limitMaxLength ? this.validate.length.limitMaxLength : false,\n },\n };\n },\n\n validationMessages () {\n // Add length validation message if exists\n if (this.showLengthLimitValidation) {\n return this.formattedMessages.concat([this.inputLengthErrorMessage()]);\n }\n\n return this.formattedMessages;\n },\n\n showInputState () {\n return this.showMessages && this.inputState;\n },\n\n inputLength () {\n return this.currentLength ? this.currentLength : this.defaultLengthCalculation;\n },\n\n inputLengthState () {\n if (this.inputLength < this.validationProps.length.warn) {\n return null;\n } else if (this.inputLength <= this.validationProps.length.max) {\n return this.validationProps.length.warn ? VALIDATION_MESSAGE_TYPES.WARNING : null;\n } else {\n return VALIDATION_MESSAGE_TYPES.ERROR;\n }\n },\n\n shouldValidateLength () {\n // eslint-disable-next-line max-lines\n return !!(\n this.validationProps.length.description &&\n this.validationProps.length.max\n );\n },\n\n shouldLimitMaxLength () {\n return this.shouldValidateLength && this.validationProps.length.limitMaxLength;\n },\n\n // eslint-disable-next-line complexity\n showLengthLimitValidation () {\n return (\n this.shouldValidateLength &&\n this.inputLengthState !== null &&\n this.validationProps.length.message &&\n (this.retainWarning || this.isInputFocused || this.isInvalid)\n );\n },\n\n sizeModifierClass () {\n if (this.isDefaultSize || !this.isValidSize) {\n return '';\n }\n\n return INPUT_SIZE_CLASSES[this.inputComponent][this.size];\n },\n\n stateClass () {\n return [INPUT_STATE_CLASSES[this.inputState]];\n },\n },\n\n watch: {\n isInvalid (val) {\n this.$emit('update:invalid', val);\n },\n\n value: {\n immediate: true,\n handler (newValue) {\n if (this.shouldValidateLength) {\n this.validateLength(this.inputLength);\n }\n\n if (this.currentLength == null) {\n this.$emit('update:length', this.calculateLength(newValue));\n }\n },\n },\n },\n\n beforeMount () {\n this.descriptionSizeClasses = DESCRIPTION_SIZE_CLASSES;\n this.labelSizeClasses = LABEL_SIZE_CLASSES;\n },\n\n methods: {\n inputClasses () {\n return [\n 'd-input__input',\n this.inputComponent === 'input' ? 'd-input' : 'd-textarea',\n {\n [this.stateClass]: this.showInputState,\n 'd-input-icon--left': this.$slots.leftIcon,\n 'd-input-icon--right': this.$slots.rightIcon,\n },\n this.sizeModifierClass,\n this.inputClass,\n ];\n },\n\n inputWrapperClasses () {\n if (this.hidden) {\n return [];\n }\n return [\n 'd-input__wrapper',\n { [this.stateClass]: this.showInputState },\n this.inputWrapperClass,\n ];\n },\n\n calculateLength (value) {\n if (typeof value !== 'string') {\n return 0;\n }\n\n return [...value].length;\n },\n\n inputLengthErrorMessage () {\n return {\n message: this.validationProps.length.message,\n type: this.inputLengthState,\n };\n },\n\n onBlur (e) {\n // Do not emit a blur event if the target element is a child of this component\n if (!this.$refs.container?.contains(e.relatedTarget)) {\n this.$emit('blur', e);\n }\n },\n\n emitClearEvents () {\n this.$emit('input', '');\n this.$emit('clear');\n this.$emit('update:modelValue', '');\n },\n\n blur () {\n this.$refs.input.blur();\n },\n\n focus () {\n this.$refs.input.focus();\n },\n\n select () {\n this.$refs.input.select();\n },\n\n getMessageKey (type, index) {\n return `message-${type}-${index}`;\n },\n\n validateLength (length) {\n this.isInvalid = (length > this.validationProps.length.max);\n },\n\n clearInput () {\n this.$refs.input.value = '';\n this.$refs.input.focus();\n this.emitClearEvents();\n },\n },\n};\n</script>\n"],"names":["_sfc_main","DtValidationMessages","MessagesMixin","INPUT_TYPES","t","INPUT_SIZES","INPUT_ICON_SIZES","DESCRIPTION_SIZE_TYPES","event","getUniqueString","getValidationState","_b","_a","_d","_c","_f","_e","_h","_g","_j","_i","VALIDATION_MESSAGE_TYPES","INPUT_SIZE_CLASSES","INPUT_STATE_CLASSES","val","newValue","DESCRIPTION_SIZE_CLASSES","LABEL_SIZE_CLASSES","value","type","index","length"],"mappings":";;;;;;AA+IA,MAAAA,IAAA;AAAA,EACA,MAAA;AAAA,EAEA,YAAA,EAAA,sBAAAC,EAAA;AAAA,EAEA,QAAA,CA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,uBAAA,KAAA,OAAA;AAAA,QACA;AAAA,QACA,KAAA;AAAA,QACA,KAAA;AAAA,MACA;AAAA,IACA;AAAA,IAEA,sBAAA;AACA,aAAA,KAAA,SACA,CAAA,IAEA;AAAA,QACA;AAAA,QACA,EAAA,CAAA,KAAA,UAAA,GAAA,KAAA,eAAA;AAAA,QACA,KAAA;AAAA,MACA;AAAA,IACA;AAAA,IAEA,gBAAAC,GAAA;AACA,aAAA,OAAAA,KAAA,WACA,IAGA,CAAA,GAAAA,CAAA,EAAA;AAAA,IACA;AAAA,IAEA,0BAAA;AACA,aAAA;AAAA,QACA,SAAA,KAAA,gBAAA,OAAA;AAAA,QACA,MAAA,KAAA;AAAA,MACA;AAAA,IACA;AAAA,IAEA,OAAA,GAAA;;AAEA,OAAAhB,IAAA,KAAA,MAAA,cAAA,QAAAA,EAAA,SAAA,EAAA,kBACA,KAAA,MAAA,QAAA,CAAA;AAAA,IAEA;AAAA,IAEA,kBAAA;AACA,WAAA,MAAA,SAAA,EAAA,GACA,KAAA,MAAA,OAAA,GACA,KAAA,MAAA,qBAAA,EAAA;AAAA,IACA;AAAA,IAEA,OAAA;AACA,WAAA,MAAA,MAAA,KAAA;AAAA,IACA;AAAA,IAEA,QAAA;AACA,WAAA,MAAA,MAAA,MAAA;AAAA,IACA;AAAA,IAEA,SAAA;AACA,WAAA,MAAA,MAAA,OAAA;AAAA,IACA;AAAA,IAEA,cAAAiB,GAAAC,GAAA;AACA,aAAA,WAAAD,CAAA,IAAAC,CAAA;AAAA,IACA;AAAA,IAEA,eAAAC,GAAA;AACA,WAAA,YAAAA,IAAA,KAAA,gBAAA,OAAA;AAAA,IACA;AAAA,IAEA,aAAA;AACA,WAAA,MAAA,MAAA,QAAA,IACA,KAAA,MAAA,MAAA,MAAA,GACA,KAAA,gBAAA;AAAA,IACA;AAAA,EACA;AACA;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"input.js","sources":["../../../components/input/input.vue"],"sourcesContent":["<template>\n <div\n ref=\"container\"\n :class=\"[rootClass, 'd-input__root', { 'd-input--hidden': hidden }]\"\n data-qa=\"dt-input\"\n >\n <label\n class=\"d-input__label\"\n :aria-details=\"$slots.description || description ? descriptionKey : undefined\"\n data-qa=\"dt-input-label-wrapper\"\n >\n <!-- @slot Slot for label, defaults to label prop -->\n <slot name=\"labelSlot\">\n <div\n v-if=\"labelVisible && label\"\n ref=\"label\"\n data-qa=\"dt-input-label\"\n :class=\"[\n 'd-input__label-text',\n 'd-label',\n labelSizeClasses[size],\n ]\"\n >\n {{ label }}\n </div>\n </slot>\n <div\n v-if=\"$slots.description || description || shouldValidateLength\"\n :id=\"descriptionKey\"\n ref=\"description\"\n :class=\"[\n 'd-input__description',\n 'd-description',\n descriptionSizeClasses[size],\n ]\"\n data-qa=\"dt-input-description\"\n >\n <div\n v-if=\"$slots.description || description\"\n >\n <!-- @slot Slot for description, defaults to description prop -->\n <slot name=\"description\">{{ description }}</slot>\n </div>\n <div\n v-if=\"shouldValidateLength\"\n data-qa=\"dt-input-length-description\"\n class=\"d-input__length-description\"\n >\n {{ validationProps.length.description }}\n </div>\n </div>\n <div\n :class=\"inputWrapperClasses()\"\n :read-only=\"disabled\"\n >\n <span\n class=\"d-input-icon d-input-icon--left\"\n data-qa=\"dt-input-left-icon-wrapper\"\n @focusout=\"onBlur\"\n >\n <!-- @slot Slot for left icon -->\n <slot\n name=\"leftIcon\"\n :icon-size=\"iconSize\"\n />\n </span>\n <textarea\n v-if=\"isTextarea\"\n ref=\"input\"\n :value=\"value\"\n :name=\"name\"\n :disabled=\"disabled\"\n :autocomplete=\"$attrs.autocomplete ?? 'off'\"\n :class=\"inputClasses()\"\n :maxlength=\"shouldLimitMaxLength ? validationProps.length.max : null\"\n :data-qa=\"$attrs['data-qa'] ?? 'dt-input-input'\"\n v-bind=\"$attrs\"\n v-on=\"inputListeners\"\n />\n <input\n v-else\n ref=\"input\"\n :value=\"value\"\n :name=\"name\"\n :type=\"type\"\n :disabled=\"disabled\"\n :autocomplete=\"$attrs.autocomplete ?? 'off'\"\n :class=\"inputClasses()\"\n :maxlength=\"shouldLimitMaxLength ? validationProps.length.max : null\"\n :data-qa=\"$attrs['data-qa'] ?? 'dt-input-input'\"\n v-bind=\"$attrs\"\n v-on=\"inputListeners\"\n >\n <span\n class=\"d-input-icon d-input-icon--right\"\n data-qa=\"dt-input-right-icon-wrapper\"\n @focusout=\"onBlur\"\n >\n <!-- @slot Slot for right icon -->\n <slot\n name=\"rightIcon\"\n :icon-size=\"iconSize\"\n :clear=\"clearInput\"\n />\n </span>\n </div>\n </label>\n <dt-validation-messages\n :validation-messages=\"validationMessages\"\n :show-messages=\"showMessages\"\n :class=\"messagesClass\"\n v-bind=\"messagesChildProps\"\n data-qa=\"dt-input-messages\"\n />\n </div>\n</template>\n\n<script>\n/* eslint-disable max-lines */\nimport { DESCRIPTION_SIZE_TYPES, VALIDATION_MESSAGE_TYPES } from '@/common/constants';\nimport {\n INPUT_TYPES,\n INPUT_SIZES,\n INPUT_SIZE_CLASSES,\n INPUT_ICON_SIZES,\n INPUT_STATE_CLASSES,\n DESCRIPTION_SIZE_CLASSES,\n LABEL_SIZE_CLASSES,\n} from './input_constants';\nimport {\n getUniqueString,\n getValidationState,\n} from '@/common/utils';\nimport { DtValidationMessages } from '@/components/validation_messages';\nimport { MessagesMixin } from '@/common/mixins/input';\n\n/**\n * An input field is an input control that allows users to enter alphanumeric information.\n * It can have a range of options and supports single line and multi-line lengths,\n * as well as varying formats, including numbers, masked passwords, etc.\n * @property {Boolean} placeholder attribute\n * @see https://dialtone.dialpad.com/components/input.html\n */\nexport default {\n name: 'DtInput',\n\n components: { DtValidationMessages },\n\n mixins: [MessagesMixin],\n\n inheritAttrs: false,\n\n props: {\n /**\n * Name property of the input element\n */\n name: {\n type: String,\n default: '',\n },\n\n /**\n * Type of the input.\n * When `textarea` a `<textarea>` element will be rendered instead of an `<input>` element.\n * @values text, password, email, number, textarea, date, time, file, tel, search\n * @default 'text'\n */\n type: {\n type: String,\n default: INPUT_TYPES.TEXT,\n validator: (t) => Object.values(INPUT_TYPES).includes(t),\n },\n\n /**\n * Value of the input\n */\n value: {\n type: [String, Number],\n default: '',\n },\n\n /**\n * Disables the input\n * @values true, false\n */\n disabled: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Label for the input\n */\n label: {\n type: String,\n default: '',\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 * Size of the input, one of `xs`, `sm`, `md`, `lg`, `xl`\n * @values xs, sm, md, lg, xl\n */\n size: {\n type: String,\n default: 'md',\n validator: (t) => Object.values(INPUT_SIZES).includes(t),\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 * Additional class name for the root 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 rootClass: {\n type: [String, Object, Array],\n default: '',\n },\n\n /**\n * The current character length that the user has entered into the input.\n * This will only need to be used if you are using `validate.length` and\n * the string contains abnormal characters.\n * For example, an emoji could take up many characters in the input, but should only count as 1 character.\n * If no number is provided, a built-in length calculation will be used for the length validation.\n */\n currentLength: {\n type: Number,\n default: null,\n },\n\n /**\n * Whether the input will continue to display a warning validation message even if the input has lost focus.\n */\n retainWarning: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Validation for the input. Supports maximum length validation with the structure:\n * `{ \"length\": {\"description\": string, \"max\": number, \"warn\": number, \"message\": string,\n * \"limitMaxLength\": boolean }}`\n */\n validate: {\n type: Object,\n default: null,\n },\n\n /**\n * hidden allows to use input without the element visually present in DOM\n */\n hidden: {\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 * Native input blur event\n *\n * @event blur\n * @type {FocusEvent}\n */\n 'blur',\n\n /**\n * Input clear event\n *\n * @event clear\n */\n 'clear',\n\n /**\n * Native input focus event\n *\n * @event focus\n * @type {FocusEvent}\n */\n 'focus',\n\n /**\n * Native input focusin event\n *\n * @event focusin\n * @type {FocusEvent}\n */\n 'focusin',\n\n /**\n * Native input focusout event\n *\n * @event focusout\n * @type {FocusEvent}\n */\n 'focusout',\n\n /**\n * Length of the input when currentLength prop is not passed\n *\n * @event update:length\n * @type {Number}\n */\n 'update:length',\n\n /**\n * Result of the input validation\n *\n * @event update:invalid\n * @type {Boolean}\n */\n 'update:invalid',\n ],\n\n data () {\n return {\n isInputFocused: false,\n isInvalid: false,\n defaultLength: 0,\n };\n },\n\n computed: {\n\n isTextarea () {\n return this.type === INPUT_TYPES.TEXTAREA;\n },\n\n isDefaultSize () {\n return this.size === INPUT_SIZES.DEFAULT;\n },\n\n iconSize () {\n return INPUT_ICON_SIZES[this.size];\n },\n\n isValidSize () {\n return Object.values(INPUT_SIZES).includes(this.size);\n },\n\n isValidDescriptionSize () {\n return Object.values(DESCRIPTION_SIZE_TYPES).includes(this.size);\n },\n\n inputComponent () {\n if (this.isTextarea) {\n return 'textarea';\n }\n\n return 'input';\n },\n\n inputListeners () {\n return {\n /* TODO\n Check if any usages of this component leverage $listeners and either remove if unused or scope the removal\n and migration prior to upgrading to Vue 3.x\n */\n ...this.$listeners,\n input: event => this.$emit('input', event.target.value),\n focus: event => {\n this.isInputFocused = true;\n this.$emit('focus', event);\n },\n\n blur: event => {\n this.isInputFocused = false;\n this.onBlur(event);\n },\n };\n },\n\n descriptionKey () {\n return `input-description-${getUniqueString()}`;\n },\n\n inputState () {\n return getValidationState(this.validationMessages);\n },\n\n defaultLengthCalculation () {\n return this.calculateLength(this.value);\n },\n\n validationProps () {\n return {\n length: {\n description: this?.validate?.length?.description,\n max: this?.validate?.length?.max,\n warn: this?.validate?.length?.warn,\n message: this?.validate?.length?.message,\n limitMaxLength: this?.validate?.length?.limitMaxLength ? this.validate.length.limitMaxLength : false,\n },\n };\n },\n\n validationMessages () {\n // Add length validation message if exists\n if (this.showLengthLimitValidation) {\n return this.formattedMessages.concat([this.inputLengthErrorMessage()]);\n }\n\n return this.formattedMessages;\n },\n\n showInputState () {\n return this.showMessages && this.inputState;\n },\n\n inputLength () {\n return this.currentLength ? this.currentLength : this.defaultLengthCalculation;\n },\n\n inputLengthState () {\n if (this.inputLength < this.validationProps.length.warn) {\n return null;\n } else if (this.inputLength <= this.validationProps.length.max) {\n return this.validationProps.length.warn ? VALIDATION_MESSAGE_TYPES.WARNING : null;\n } else {\n return VALIDATION_MESSAGE_TYPES.ERROR;\n }\n },\n\n shouldValidateLength () {\n return !!(\n this.validationProps.length.description &&\n this.validationProps.length.max\n );\n },\n\n shouldLimitMaxLength () {\n return this.shouldValidateLength && this.validationProps.length.limitMaxLength;\n },\n\n showLengthLimitValidation () {\n return (\n this.shouldValidateLength &&\n this.inputLengthState !== null &&\n this.validationProps.length.message &&\n (this.retainWarning || this.isInputFocused || this.isInvalid)\n );\n },\n\n sizeModifierClass () {\n if (this.isDefaultSize || !this.isValidSize) {\n return '';\n }\n\n return INPUT_SIZE_CLASSES[this.inputComponent][this.size];\n },\n\n stateClass () {\n return [INPUT_STATE_CLASSES[this.inputState]];\n },\n },\n\n watch: {\n isInvalid (val) {\n this.$emit('update:invalid', val);\n },\n\n value: {\n immediate: true,\n handler (newValue) {\n if (this.shouldValidateLength) {\n this.validateLength(this.inputLength);\n }\n\n if (this.currentLength == null) {\n this.$emit('update:length', this.calculateLength(newValue));\n }\n },\n },\n },\n\n beforeMount () {\n this.descriptionSizeClasses = DESCRIPTION_SIZE_CLASSES;\n this.labelSizeClasses = LABEL_SIZE_CLASSES;\n },\n\n methods: {\n inputClasses () {\n return [\n 'd-input__input',\n this.inputComponent === 'input' ? 'd-input' : 'd-textarea',\n {\n [this.stateClass]: this.showInputState,\n 'd-input-icon--left': this.$slots.leftIcon,\n 'd-input-icon--right': this.$slots.rightIcon,\n },\n this.sizeModifierClass,\n this.inputClass,\n ];\n },\n\n inputWrapperClasses () {\n if (this.hidden) {\n return [];\n }\n return [\n 'd-input__wrapper',\n { [this.stateClass]: this.showInputState },\n this.inputWrapperClass,\n ];\n },\n\n calculateLength (value) {\n if (typeof value !== 'string') {\n return 0;\n }\n\n return [...value].length;\n },\n\n inputLengthErrorMessage () {\n return {\n message: this.validationProps.length.message,\n type: this.inputLengthState,\n };\n },\n\n onBlur (e) {\n // Do not emit a blur event if the target element is a child of this component\n if (!this.$refs.container?.contains(e.relatedTarget)) {\n this.$emit('blur', e);\n }\n },\n\n emitClearEvents () {\n this.$emit('input', '');\n this.$emit('clear');\n this.$emit('update:modelValue', '');\n },\n\n blur () {\n this.$refs.input.blur();\n },\n\n focus () {\n this.$refs.input.focus();\n },\n\n select () {\n this.$refs.input.select();\n },\n\n getMessageKey (type, index) {\n return `message-${type}-${index}`;\n },\n\n validateLength (length) {\n this.isInvalid = (length > this.validationProps.length.max);\n },\n\n clearInput () {\n this.$refs.input.value = '';\n this.$refs.input.focus();\n this.emitClearEvents();\n },\n },\n};\n</script>\n"],"names":["_sfc_main","DtValidationMessages","MessagesMixin","INPUT_TYPES","t","INPUT_SIZES","INPUT_ICON_SIZES","DESCRIPTION_SIZE_TYPES","event","getUniqueString","getValidationState","_b","_a","_d","_c","_f","_e","_h","_g","_j","_i","VALIDATION_MESSAGE_TYPES","INPUT_SIZE_CLASSES","INPUT_STATE_CLASSES","val","newValue","DESCRIPTION_SIZE_CLASSES","LABEL_SIZE_CLASSES","value","type","index","length"],"mappings":";;;;;;AA+IA,MAAAA,IAAA;AAAA,EACA,MAAA;AAAA,EAEA,YAAA,EAAA,sBAAAC,EAAA;AAAA,EAEA,QAAA,CAAAC,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IACA;AAAA,EACA;AACA;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("@dialpad/dialtone-icons/vue2"),r=require("../../localization/index.cjs"),i=require("../../_plugin-vue2_normalizer-e_CkxkSV.cjs"),o=require("../icon/icon-constants.cjs"),s={name:"DtLoader",components:{DtIconLoading:n.DtIconLoading},props:{ariaLabel:{type:String,default:""},size:{type:String,default:"500",validator:t=>Object.keys(o.ICON_SIZE_MODIFIERS).includes(t)}},data(){return{i18n:new r.DialtoneLocalization}},computed:{loaderText(){return this.ariaLabel||this.i18n.$t("DIALTONE_LOADING")}}};var d=function(){var e=this,a=e._self._c;return a("div",{staticClass:"d-loader",attrs:{"aria-label":e.loaderText,"data-qa":"dt-loader"}},[a("dt-icon-loading",{staticClass:"d-loader-icon",attrs:{"data-qa":"dt-loader-icon",size:e.size}})],1)},l=[],c=i.n(s,d,l);const _=c.exports;exports.default=_;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("@dialpad/dialtone-icons/vue2"),r=require("../../localization/index.cjs"),i=require("../../_plugin-vue2_normalizer-e_CkxkSV.cjs"),o=require("../icon/icon-constants.cjs"),s={name:"DtLoader",components:{DtIconLoading:n.DtIconLoading},props:{ariaLabel:{type:String,default:""},size:{type:String,default:"500",validator:t=>Object.keys(o.ICON_SIZE_MODIFIERS).includes(t)}},data(){return{i18n:new r.DialtoneLocalization}},computed:{loaderText(){return this.ariaLabel||this.i18n.$t("DIALTONE_LOADING")}}};var d=function(){var e=this,a=e._self._c;return a("div",{staticClass:"d-loader",attrs:{"aria-label":e.loaderText,"data-qa":"dt-loader"}},[a("dt-icon-loading",{staticClass:"d-loader__icon",attrs:{"data-qa":"dt-loader-icon",size:e.size}})],1)},l=[],c=i.n(s,d,l);const _=c.exports;exports.default=_;
2
2
  //# sourceMappingURL=loader.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"loader.cjs","sources":["../../../components/loader/loader.vue"],"sourcesContent":["<template>\n <div\n class=\"d-loader\"\n :aria-label=\"loaderText\"\n data-qa=\"dt-loader\"\n >\n <dt-icon-loading\n class=\"d-loader-icon\"\n data-qa=\"dt-loader-icon\"\n :size=\"size\"\n />\n </div>\n</template>\n\n<script>\nimport { DtIconLoading } from '@dialpad/dialtone-icons/vue2';\nimport { ICON_SIZE_MODIFIERS } from '@/components/icon';\nimport { DialtoneLocalization } from '@/localization';\n\nexport default {\n name: 'DtLoader',\n\n components: {\n DtIconLoading,\n },\n\n props: {\n /**\n * The label of the loader as read out by a screen reader.\n * Default is \"loading\"\n */\n ariaLabel: {\n type: String,\n default: '',\n },\n\n /**\n * The size of the icon.\n * @values 100, 200, 300, 400, 500, 600, 700, 800\n */\n size: {\n type: String,\n default: '500',\n validator: (s) => Object.keys(ICON_SIZE_MODIFIERS).includes(s),\n },\n },\n\n data () {\n return {\n i18n: new DialtoneLocalization(),\n };\n },\n\n computed: {\n loaderText () {\n return this.ariaLabel || this.i18n.$t('DIALTONE_LOADING');\n },\n },\n};\n</script>\n"],"names":["_sfc_main","DtIconLoading","s","ICON_SIZE_MODIFIERS","DialtoneLocalization"],"mappings":"sSAmBAA,EAAA,CACA,KAAA,WAEA,WAAA,CACA,cAAAC,EAAAA,aACA,EAEA,MAAA,CAKA,UAAA,CACA,KAAA,OACA,QAAA,EACA,EAMA,KAAA,CACA,KAAA,OACA,QAAA,MACA,UAAAC,GAAA,OAAA,KAAAC,qBAAA,EAAA,SAAAD,CAAA,CACA,CACA,EAEA,MAAA,CACA,MAAA,CACA,KAAA,IAAAE,EAAAA,oBACA,CACA,EAEA,SAAA,CACA,YAAA,CACA,OAAA,KAAA,WAAA,KAAA,KAAA,GAAA,kBAAA,CACA,CACA,CACA"}
1
+ {"version":3,"file":"loader.cjs","sources":["../../../components/loader/loader.vue"],"sourcesContent":["<template>\n <div\n class=\"d-loader\"\n :aria-label=\"loaderText\"\n data-qa=\"dt-loader\"\n >\n <dt-icon-loading\n class=\"d-loader__icon\"\n data-qa=\"dt-loader-icon\"\n :size=\"size\"\n />\n </div>\n</template>\n\n<script>\nimport { DtIconLoading } from '@dialpad/dialtone-icons/vue2';\nimport { ICON_SIZE_MODIFIERS } from '@/components/icon';\nimport { DialtoneLocalization } from '@/localization';\n\nexport default {\n name: 'DtLoader',\n\n components: {\n DtIconLoading,\n },\n\n props: {\n /**\n * The label of the loader as read out by a screen reader.\n * Default is \"loading\"\n */\n ariaLabel: {\n type: String,\n default: '',\n },\n\n /**\n * The size of the icon.\n * @values 100, 200, 300, 400, 500, 600, 700, 800\n */\n size: {\n type: String,\n default: '500',\n validator: (s) => Object.keys(ICON_SIZE_MODIFIERS).includes(s),\n },\n },\n\n data () {\n return {\n i18n: new DialtoneLocalization(),\n };\n },\n\n computed: {\n loaderText () {\n return this.ariaLabel || this.i18n.$t('DIALTONE_LOADING');\n },\n },\n};\n</script>\n"],"names":["_sfc_main","DtIconLoading","s","ICON_SIZE_MODIFIERS","DialtoneLocalization"],"mappings":"sSAmBAA,EAAA,CACA,KAAA,WAEA,WAAA,CACA,cAAAC,EAAAA,aACA,EAEA,MAAA,CAKA,UAAA,CACA,KAAA,OACA,QAAA,EACA,EAMA,KAAA,CACA,KAAA,OACA,QAAA,MACA,UAAAC,GAAA,OAAA,KAAAC,qBAAA,EAAA,SAAAD,CAAA,CACA,CACA,EAEA,MAAA,CACA,MAAA,CACA,KAAA,IAAAE,EAAAA,oBACA,CACA,EAEA,SAAA,CACA,YAAA,CACA,OAAA,KAAA,WAAA,KAAA,KAAA,GAAA,kBAAA,CACA,CACA,CACA"}
@@ -39,7 +39,7 @@ const s = {
39
39
  };
40
40
  var d = function() {
41
41
  var a = this, e = a._self._c;
42
- return e("div", { staticClass: "d-loader", attrs: { "aria-label": a.loaderText, "data-qa": "dt-loader" } }, [e("dt-icon-loading", { staticClass: "d-loader-icon", attrs: { "data-qa": "dt-loader-icon", size: a.size } })], 1);
42
+ return e("div", { staticClass: "d-loader", attrs: { "aria-label": a.loaderText, "data-qa": "dt-loader" } }, [e("dt-icon-loading", { staticClass: "d-loader__icon", attrs: { "data-qa": "dt-loader-icon", size: a.size } })], 1);
43
43
  }, l = [], c = /* @__PURE__ */ n(
44
44
  s,
45
45
  d,
@@ -1 +1 @@
1
- {"version":3,"file":"loader.js","sources":["../../../components/loader/loader.vue"],"sourcesContent":["<template>\n <div\n class=\"d-loader\"\n :aria-label=\"loaderText\"\n data-qa=\"dt-loader\"\n >\n <dt-icon-loading\n class=\"d-loader-icon\"\n data-qa=\"dt-loader-icon\"\n :size=\"size\"\n />\n </div>\n</template>\n\n<script>\nimport { DtIconLoading } from '@dialpad/dialtone-icons/vue2';\nimport { ICON_SIZE_MODIFIERS } from '@/components/icon';\nimport { DialtoneLocalization } from '@/localization';\n\nexport default {\n name: 'DtLoader',\n\n components: {\n DtIconLoading,\n },\n\n props: {\n /**\n * The label of the loader as read out by a screen reader.\n * Default is \"loading\"\n */\n ariaLabel: {\n type: String,\n default: '',\n },\n\n /**\n * The size of the icon.\n * @values 100, 200, 300, 400, 500, 600, 700, 800\n */\n size: {\n type: String,\n default: '500',\n validator: (s) => Object.keys(ICON_SIZE_MODIFIERS).includes(s),\n },\n },\n\n data () {\n return {\n i18n: new DialtoneLocalization(),\n };\n },\n\n computed: {\n loaderText () {\n return this.ariaLabel || this.i18n.$t('DIALTONE_LOADING');\n },\n },\n};\n</script>\n"],"names":["_sfc_main","DtIconLoading","s","ICON_SIZE_MODIFIERS","DialtoneLocalization"],"mappings":";;;;AAmBA,MAAAA,IAAA;AAAA,EACA,MAAA;AAAA,EAEA,YAAA;AAAA,IACA,eAAAC;AAAA,EACA;AAAA,EAEA,OAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAKA,WAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,MAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,MACA,WAAA,CAAAC,MAAA,OAAA,KAAAC,CAAA,EAAA,SAAAD,CAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,OAAA;AACA,WAAA;AAAA,MACA,MAAA,IAAAE,EAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,UAAA;AAAA,IACA,aAAA;AACA,aAAA,KAAA,aAAA,KAAA,KAAA,GAAA,kBAAA;AAAA,IACA;AAAA,EACA;AACA;;;;;;;;;;"}
1
+ {"version":3,"file":"loader.js","sources":["../../../components/loader/loader.vue"],"sourcesContent":["<template>\n <div\n class=\"d-loader\"\n :aria-label=\"loaderText\"\n data-qa=\"dt-loader\"\n >\n <dt-icon-loading\n class=\"d-loader__icon\"\n data-qa=\"dt-loader-icon\"\n :size=\"size\"\n />\n </div>\n</template>\n\n<script>\nimport { DtIconLoading } from '@dialpad/dialtone-icons/vue2';\nimport { ICON_SIZE_MODIFIERS } from '@/components/icon';\nimport { DialtoneLocalization } from '@/localization';\n\nexport default {\n name: 'DtLoader',\n\n components: {\n DtIconLoading,\n },\n\n props: {\n /**\n * The label of the loader as read out by a screen reader.\n * Default is \"loading\"\n */\n ariaLabel: {\n type: String,\n default: '',\n },\n\n /**\n * The size of the icon.\n * @values 100, 200, 300, 400, 500, 600, 700, 800\n */\n size: {\n type: String,\n default: '500',\n validator: (s) => Object.keys(ICON_SIZE_MODIFIERS).includes(s),\n },\n },\n\n data () {\n return {\n i18n: new DialtoneLocalization(),\n };\n },\n\n computed: {\n loaderText () {\n return this.ariaLabel || this.i18n.$t('DIALTONE_LOADING');\n },\n },\n};\n</script>\n"],"names":["_sfc_main","DtIconLoading","s","ICON_SIZE_MODIFIERS","DialtoneLocalization"],"mappings":";;;;AAmBA,MAAAA,IAAA;AAAA,EACA,MAAA;AAAA,EAEA,YAAA;AAAA,IACA,eAAAC;AAAA,EACA;AAAA,EAEA,OAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAKA,WAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,MAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,MACA,WAAA,CAAAC,MAAA,OAAA,KAAAC,CAAA,EAAA,SAAAD,CAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,OAAA;AACA,WAAA;AAAA,MACA,MAAA,IAAAE,EAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,UAAA;AAAA,IACA,aAAA;AACA,aAAA,KAAA,aAAA,KAAA,KAAA,GAAA,kBAAA;AAAA,IACA;AAAA,EACA;AACA;;;;;;;;;;"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const l=require("./split-button-alpha.cjs"),s=require("./split-button-omega.cjs"),r=require("../../common/utils/index.cjs"),u=require("../../_plugin-vue2_normalizer-e_CkxkSV.cjs"),p=require("../dropdown/dropdown.cjs"),i=require("../button/button-constants.cjs");require("./split-button-constants.cjs");const d={name:"DtSplitButton",components:{SplitButtonOmega:s.default,DtDropdown:p.default,SplitButtonAlpha:l.default},inheritAttrs:!1,props:{alphaActive:{type:Boolean,default:!1},alphaAriaLabel:{type:String,default:null},alphaIconPosition:{type:String,default:"left",validator:e=>Object.keys(i.ICON_POSITION_MODIFIERS).includes(e)},alphaLabelClass:{type:[String,Array,Object],default:""},alphaLoading:{type:Boolean,default:!1},alphaTooltipText:{type:String,default:void 0},assertiveOnFocus:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},dropdownPlacement:{type:String,default:"bottom-end"},importance:{type:String,default:"primary",validator:e=>Object.keys(i.BUTTON_IMPORTANCE_MODIFIERS).includes(e)},kind:{type:String,default:"default",validator:e=>Object.keys(i.BUTTON_KIND_MODIFIERS).includes(e)},omegaActive:{type:Boolean,default:!1},omegaAriaLabel:{type:String,default:null},omegaId:{type:String,default:void 0},omegaTooltipText:{type:String,default:void 0},size:{type:String,default:"md",validator:e=>Object.keys(i.BUTTON_SIZE_MODIFIERS).includes(e)},width:{type:String,default:null}},emits:["alpha-clicked","omega-clicked"],data(){return{isDropdownOpen:!1}},computed:{alphaButtonProps(){return{active:this.alphaActive,ariaLabel:this.alphaAriaLabel,assertiveOnFocus:this.assertiveOnFocus,disabled:this.disabled,iconPosition:this.alphaIconPosition,labelClass:this.alphaLabelClass,loading:this.alphaLoading,importance:this.importance,kind:this.kind,size:this.size,tooltipText:this.alphaTooltipText,class:this.$attrs.class}},omegaButtonProps(){return{id:this.omegaId,active:this.omegaActive,ariaLabel:this.omegaAriaLabel,disabled:this.disabled,importance:this.importance,kind:this.kind,size:this.size,tooltipText:this.omegaTooltipText,class:this.$attrs.class}},defaultSlotHasContent(){var e,t;return this.$scopedSlots.default&&this.$scopedSlots.default()&&((t=(e=this.$scopedSlots.default()[0])==null?void 0:e.text)==null?void 0:t.trim())},omegaSlotIsSet(){return this.$scopedSlots.omega&&this.$scopedSlots.omega()}},created(){this.validateProps()},updated(){this.validateProps()},mounted(){r.warnIfUnmounted(this.$el,this.$options.name)},methods:{validateProps(){this.validateAlphaButtonProps(),this.validateOmegaButtonProps()},validateAlphaButtonProps(){var t;if(this.defaultSlotHasContent)return;((t=this.$refs.alphaButton)==null?void 0:t.$scopedSlots.icon)&&this.$refs.alphaButton.$scopedSlots.icon()&&!this.alphaTooltipText&&console.warn("alpha-tooltip-text prop must be set if alpha button has an icon only")},validateOmegaButtonProps(){this.omegaSlotIsSet||this.omegaTooltipText||console.warn("omega-tooltip-text prop is required as it is an icon-only button")}}};var c=function(){var t=this,a=t._self._c;return a("span",{staticClass:"d-split-btn",style:{width:t.width},attrs:{"data-qa":"dt-split-button"}},[a("split-button-alpha",t._b({ref:"alphaButton",nativeOn:{click:function(o){return t.$emit("alpha-clicked")}},scopedSlots:t._u([{key:"icon",fn:function({size:o}){return[t._t("alphaIcon",null,{size:o})]}}],null,!0)},"split-button-alpha",t.alphaButtonProps,!1),[t._t("default")],2),t._t("omega",function(){return[t.$slots.dropdownList?a("dt-dropdown",{attrs:{placement:t.dropdownPlacement},on:{click:function(o){t.isDropdownOpen=!0},opened:o=>t.isDropdownOpen=o},scopedSlots:t._u([{key:"anchor",fn:function(o){return[a("split-button-omega",t._b({attrs:{active:t.isDropdownOpen},nativeOn:{click:function(n){return t.$emit("omega-clicked")}},scopedSlots:t._u([{key:"icon",fn:function({size:n}){return[t._t("omegaIcon",null,{size:n})]}}],null,!0)},"split-button-omega",{...o,...t.omegaButtonProps},!1))]}},{key:"list",fn:function({close:o}){return[t._t("dropdownList",null,{close:o})]}}],null,!0)}):a("split-button-omega",t._b({nativeOn:{click:function(o){return t.$emit("omega-clicked")}},scopedSlots:t._u([{key:"icon",fn:function({size:o}){return[t._t("omegaIcon",null,{size:o})]}}],null,!0)},"split-button-omega",t.omegaButtonProps,!1))]})],2)},h=[],f=u.n(d,c,h);const m=f.exports;exports.default=m;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("./split-button-alpha.cjs"),l=require("./split-button-omega.cjs"),r=require("../../common/utils/index.cjs"),p=require("../../_plugin-vue2_normalizer-e_CkxkSV.cjs"),u=require("../dropdown/dropdown.cjs"),i=require("../button/button-constants.cjs");require("./split-button-constants.cjs");const d={name:"DtSplitButton",components:{SplitButtonOmega:l.default,DtDropdown:u.default,SplitButtonAlpha:s.default},inheritAttrs:!1,props:{alphaActive:{type:Boolean,default:!1},alphaAriaLabel:{type:String,default:null},alphaIconPosition:{type:String,default:"left",validator:e=>Object.keys(i.ICON_POSITION_MODIFIERS).includes(e)},alphaLabelClass:{type:[String,Array,Object],default:""},alphaLoading:{type:Boolean,default:!1},alphaTooltipText:{type:String,default:void 0},assertiveOnFocus:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},dropdownPlacement:{type:String,default:"bottom-end"},importance:{type:String,default:"primary",validator:e=>Object.keys(i.BUTTON_IMPORTANCE_MODIFIERS).includes(e)},kind:{type:String,default:"default",validator:e=>Object.keys(i.BUTTON_KIND_MODIFIERS).includes(e)},omegaActive:{type:Boolean,default:!1},omegaAriaLabel:{type:String,default:null},omegaId:{type:String,default:void 0},omegaTooltipText:{type:String,default:void 0},size:{type:String,default:"md",validator:e=>Object.keys(i.BUTTON_SIZE_MODIFIERS).includes(e)},width:{type:String,default:null}},emits:["alpha-clicked","omega-clicked"],data(){return{isDropdownOpen:!1}},computed:{alphaButtonProps(){return{active:this.alphaActive,ariaLabel:this.alphaAriaLabel,assertiveOnFocus:this.assertiveOnFocus,disabled:this.disabled,iconPosition:this.alphaIconPosition,labelClass:this.alphaLabelClass,loading:this.alphaLoading,importance:this.importance,kind:this.kind,size:this.size,tooltipText:this.alphaTooltipText,class:this.$attrs.class}},omegaButtonProps(){return{id:this.omegaId,active:this.omegaActive,ariaLabel:this.omegaAriaLabel,disabled:this.disabled,importance:this.importance,kind:this.kind,size:this.size,tooltipText:this.omegaTooltipText,class:this.$attrs.class}},defaultSlotHasContent(){var e,t;return this.$scopedSlots.default&&this.$scopedSlots.default()&&((t=(e=this.$scopedSlots.default()[0])==null?void 0:e.text)==null?void 0:t.trim())},omegaSlotIsSet(){return this.$scopedSlots.omega&&this.$scopedSlots.omega()},dropdownSlotIsSet(){return this.$scopedSlots.dropdownList&&this.$scopedSlots.dropdownList()}},created(){this.validateProps()},updated(){this.validateProps()},mounted(){r.warnIfUnmounted(this.$el,this.$options.name)},methods:{validateProps(){this.validateAlphaButtonProps(),this.validateOmegaButtonProps()},validateAlphaButtonProps(){var t;if(this.defaultSlotHasContent)return;((t=this.$refs.alphaButton)==null?void 0:t.$scopedSlots.icon)&&this.$refs.alphaButton.$scopedSlots.icon()&&!this.alphaTooltipText&&console.warn("alpha-tooltip-text prop must be set if alpha button has an icon only")},validateOmegaButtonProps(){this.omegaSlotIsSet||this.omegaTooltipText||console.warn("omega-tooltip-text prop is required as it is an icon-only button")}}};var c=function(){var t=this,a=t._self._c;return a("span",{staticClass:"d-split-btn",style:{width:t.width},attrs:{"data-qa":"dt-split-button"}},[a("split-button-alpha",t._b({ref:"alphaButton",nativeOn:{click:function(o){return t.$emit("alpha-clicked")}},scopedSlots:t._u([{key:"icon",fn:function({size:o}){return[t._t("alphaIcon",null,{size:o})]}}],null,!0)},"split-button-alpha",t.alphaButtonProps,!1),[t._t("default")],2),t._t("omega",function(){return[t.dropdownSlotIsSet?a("dt-dropdown",{attrs:{placement:t.dropdownPlacement},on:{click:function(o){t.isDropdownOpen=!0},opened:o=>t.isDropdownOpen=o},scopedSlots:t._u([{key:"anchor",fn:function(o){return[a("split-button-omega",t._b({attrs:{active:t.isDropdownOpen},nativeOn:{click:function(n){return t.$emit("omega-clicked")}},scopedSlots:t._u([{key:"icon",fn:function({size:n}){return[t._t("omegaIcon",null,{size:n})]}}],null,!0)},"split-button-omega",{...o,...t.omegaButtonProps},!1))]}},{key:"list",fn:function({close:o}){return[t._t("dropdownList",null,{close:o})]}}],null,!0)}):a("split-button-omega",t._b({nativeOn:{click:function(o){return t.$emit("omega-clicked")}},scopedSlots:t._u([{key:"icon",fn:function({size:o}){return[t._t("omegaIcon",null,{size:o})]}}],null,!0)},"split-button-omega",t.omegaButtonProps,!1))]})],2)},h=[],f=p.n(d,c,h);const m=f.exports;exports.default=m;
2
2
  //# sourceMappingURL=split-button.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"split-button.cjs","sources":["../../../components/split_button/split_button.vue"],"sourcesContent":["<template>\n <span\n data-qa=\"dt-split-button\"\n class=\"d-split-btn\"\n :style=\"{ width }\"\n >\n <split-button-alpha\n v-bind=\"alphaButtonProps\"\n ref=\"alphaButton\"\n @click.native=\"$emit('alpha-clicked')\"\n >\n <template #icon=\"{ size: iconSize }\">\n <!-- @slot Alpha (left) button icon slot -->\n <slot\n name=\"alphaIcon\"\n :size=\"iconSize\"\n />\n </template>\n <!-- @slot Default content slot -->\n <slot name=\"default\" />\n </split-button-alpha>\n <!-- @slot Omega (right) content slot, overrides omega button styling and functionality completely -->\n <slot name=\"omega\">\n <dt-dropdown\n v-if=\"$slots.dropdownList\"\n :placement=\"dropdownPlacement\"\n @click=\"isDropdownOpen = true\"\n @opened=\"open => isDropdownOpen = open\"\n >\n <template #anchor=\"attrs\">\n <split-button-omega\n v-bind=\"{ ...attrs, ...omegaButtonProps }\"\n :active=\"isDropdownOpen\"\n @click.native=\"$emit('omega-clicked')\"\n >\n <template #icon=\"{ size: iconSize }\">\n <!-- @slot Omega (right) button icon slot -->\n <slot\n name=\"omegaIcon\"\n :size=\"iconSize\"\n />\n </template>\n </split-button-omega>\n </template>\n <template #list=\"{ close }\">\n <!-- @slot Built-in dropdown content slot, use of dt-list-item is highly recommended here. -->\n <slot\n name=\"dropdownList\"\n :close=\"close\"\n />\n </template>\n </dt-dropdown>\n\n <split-button-omega\n v-else\n v-bind=\"omegaButtonProps\"\n @click.native=\"$emit('omega-clicked')\"\n >\n <template #icon=\"{ size: iconSize }\">\n <!-- @slot Omega (right) button icon slot -->\n <slot\n name=\"omegaIcon\"\n :size=\"iconSize\"\n />\n </template>\n </split-button-omega>\n </slot>\n </span>\n</template>\n\n<script>\nimport {\n BUTTON_IMPORTANCE_MODIFIERS,\n BUTTON_KIND_MODIFIERS,\n BUTTON_SIZE_MODIFIERS,\n ICON_POSITION_MODIFIERS,\n} from '@/components/button';\nimport SplitButtonAlpha from './split_button-alpha.vue';\nimport SplitButtonOmega from './split_button-omega.vue';\nimport { DtDropdown } from '@/components/dropdown';\nimport { warnIfUnmounted } from '@/common/utils';\n\nexport default {\n name: 'DtSplitButton',\n\n components: {\n SplitButtonOmega,\n DtDropdown,\n SplitButtonAlpha,\n },\n\n inheritAttrs: false,\n\n props: {\n /**\n * Determines whether the alpha button should have active styling\n * @values true, false\n */\n alphaActive: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Descriptive label for the alpha button\n */\n alphaAriaLabel: {\n type: String,\n default: null,\n },\n\n /**\n * The position of the icon slot within the alpha button.\n * @values left, right, top, bottom\n */\n alphaIconPosition: {\n type: String,\n default: 'left',\n validator: (position) => Object.keys(ICON_POSITION_MODIFIERS).includes(position),\n },\n\n /**\n * Used to customize the alpha label container\n */\n alphaLabelClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Whether the alpha button should display a loading animation or not.\n * @values true, false\n */\n alphaLoading: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Text shown in tooltip when you hover the alpha button,\n * required if no content is passed to default slot\n */\n alphaTooltipText: {\n type: String,\n default: undefined,\n },\n\n /**\n * Determines whether a screenreader reads live updates of\n * the button content to the user while the button\n * is in focus.\n * @values true, false\n */\n assertiveOnFocus: {\n type: Boolean,\n default: false,\n },\n\n /**\n * HTML button disabled attribute\n * <a class=\"d-link\" href=\"https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#disabled\" target=\"_blank\">\n * (Reference)\n * </a>\n * @values true, false\n */\n disabled: {\n type: Boolean,\n default: false,\n },\n\n /**\n * The direction the dropdown displays relative to the anchor.\n * @values top, top-start, top-end, right, right-start, right-end, left, left-start, left-end, bottom, bottom-start, bottom-end, auto, auto-start, auto-end\n */\n dropdownPlacement: {\n type: String,\n default: 'bottom-end',\n },\n\n /**\n * The fill and outline of the button associated with its visual importance.\n * @values clear, outlined, primary\n */\n importance: {\n type: String,\n default: 'primary',\n validator: (i) => Object.keys(BUTTON_IMPORTANCE_MODIFIERS).includes(i),\n },\n\n /**\n * The color of the button.\n * @values default, muted, danger, inverted\n */\n kind: {\n type: String,\n default: 'default',\n validator: (k) => Object.keys(BUTTON_KIND_MODIFIERS).includes(k),\n },\n\n /**\n * Determines whether the omega button should have active styling\n * @values true, false\n */\n omegaActive: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Descriptive label for the omega button\n */\n omegaAriaLabel: {\n type: String,\n default: null,\n },\n\n /**\n * Element ID, useful in case you need to reference the button\n * as an external anchor for popover\n */\n omegaId: {\n type: String,\n default: undefined,\n },\n\n /**\n * Text shown in tooltip when you hover the omega button,\n * required as it is an icon only button\n */\n omegaTooltipText: {\n type: String,\n default: undefined,\n },\n\n /**\n * The size of the button.\n * @values xs, sm, md, lg, xl\n */\n size: {\n type: String,\n default: 'md',\n validator: (s) => Object.keys(BUTTON_SIZE_MODIFIERS).includes(s),\n },\n\n /**\n * Button width, accepts\n * <a class=\"d-link\" href=\"https://developer.mozilla.org/en-US/docs/Web/CSS/width\" target=\"_blank\">\n * CSS width attribute\n * </a>\n * values\n */\n width: {\n type: String,\n default: null,\n },\n },\n\n emits: [\n /**\n * Native alpha button click event\n *\n * @event click\n * @type {PointerEvent | KeyboardEvent}\n */\n 'alpha-clicked',\n\n /**\n * Native omega button click event\n *\n * @event click\n * @type {PointerEvent | KeyboardEvent}\n */\n 'omega-clicked',\n ],\n\n data () {\n return {\n isDropdownOpen: false,\n };\n },\n\n computed: {\n alphaButtonProps () {\n return {\n active: this.alphaActive,\n ariaLabel: this.alphaAriaLabel,\n assertiveOnFocus: this.assertiveOnFocus,\n disabled: this.disabled,\n iconPosition: this.alphaIconPosition,\n labelClass: this.alphaLabelClass,\n loading: this.alphaLoading,\n importance: this.importance,\n kind: this.kind,\n size: this.size,\n tooltipText: this.alphaTooltipText,\n class: this.$attrs.class,\n };\n },\n\n omegaButtonProps () {\n return {\n id: this.omegaId,\n active: this.omegaActive,\n ariaLabel: this.omegaAriaLabel,\n disabled: this.disabled,\n importance: this.importance,\n kind: this.kind,\n size: this.size,\n tooltipText: this.omegaTooltipText,\n class: this.$attrs.class,\n };\n },\n\n defaultSlotHasContent () {\n return this.$scopedSlots.default && this.$scopedSlots.default() && this.$scopedSlots.default()[0]?.text?.trim();\n },\n\n omegaSlotIsSet () {\n return this.$scopedSlots.omega && this.$scopedSlots.omega();\n },\n },\n\n created () {\n this.validateProps();\n },\n\n updated () {\n this.validateProps();\n },\n\n mounted () {\n warnIfUnmounted(this.$el, this.$options.name);\n },\n\n methods: {\n validateProps () {\n this.validateAlphaButtonProps();\n this.validateOmegaButtonProps();\n },\n\n validateAlphaButtonProps () {\n if (this.defaultSlotHasContent) return;\n\n // This can't be a computed prop due to reactivity issues.\n const isAlphaIconSet = this.$refs.alphaButton?.$scopedSlots.icon && this.$refs.alphaButton.$scopedSlots.icon();\n\n if (isAlphaIconSet && !this.alphaTooltipText) {\n console.warn('alpha-tooltip-text prop must be set if alpha button has an icon only');\n }\n },\n\n validateOmegaButtonProps () {\n if (this.omegaSlotIsSet) return;\n\n if (!this.omegaTooltipText) {\n console.warn('omega-tooltip-text prop is required as it is an icon-only button');\n }\n },\n },\n};\n</script>\n"],"names":["_sfc_main","SplitButtonOmega","DtDropdown","SplitButtonAlpha","position","ICON_POSITION_MODIFIERS","i","BUTTON_IMPORTANCE_MODIFIERS","k","BUTTON_KIND_MODIFIERS","s","BUTTON_SIZE_MODIFIERS","_b","_a","warnIfUnmounted"],"mappings":"0ZAkFA,MAAAA,EAAA,CACA,KAAA,gBAEA,WAAA,CACA,iBAAAC,EAAAA,QACA,WAAAC,EAAAA,QACA,iBAAAC,EAAAA,OACA,EAEA,aAAA,GAEA,MAAA,CAKA,YAAA,CACA,KAAA,QACA,QAAA,EACA,EAKA,eAAA,CACA,KAAA,OACA,QAAA,IACA,EAMA,kBAAA,CACA,KAAA,OACA,QAAA,OACA,UAAAC,GAAA,OAAA,KAAAC,yBAAA,EAAA,SAAAD,CAAA,CACA,EAKA,gBAAA,CACA,KAAA,CAAA,OAAA,MAAA,MAAA,EACA,QAAA,EACA,EAMA,aAAA,CACA,KAAA,QACA,QAAA,EACA,EAMA,iBAAA,CACA,KAAA,OACA,QAAA,MACA,EAQA,iBAAA,CACA,KAAA,QACA,QAAA,EACA,EASA,SAAA,CACA,KAAA,QACA,QAAA,EACA,EAMA,kBAAA,CACA,KAAA,OACA,QAAA,YACA,EAMA,WAAA,CACA,KAAA,OACA,QAAA,UACA,UAAAE,GAAA,OAAA,KAAAC,6BAAA,EAAA,SAAAD,CAAA,CACA,EAMA,KAAA,CACA,KAAA,OAC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AAA,IAAA,CACA,EAEA,QAAA,CACA,eAAA,CACA,KAAA,yBAAA,EACA,KAAA,yBAAA,CACA,EAEA,0BAAA,OACA,GAAA,KAAA,sBAAA,SAGAD,EAAA,KAAA,MAAA,cAAA,YAAAA,EAAA,aAAA,OAAA,KAAA,MAAA,YAAA,aAAA,KAAA,GAEA,CAAA,KAAA,kBACA,QAAA,KAAA,sEAAA,CAEA,EAEA,0BAAA,CACA,KAAA,gBAEA,KAAA,kBACA,QAAA,KAAA,kEAAA,CAEA,CACA,CACA"}
1
+ {"version":3,"file":"split-button.cjs","sources":["../../../components/split_button/split_button.vue"],"sourcesContent":["<template>\n <span\n data-qa=\"dt-split-button\"\n class=\"d-split-btn\"\n :style=\"{ width }\"\n >\n <split-button-alpha\n v-bind=\"alphaButtonProps\"\n ref=\"alphaButton\"\n @click.native=\"$emit('alpha-clicked')\"\n >\n <template #icon=\"{ size: iconSize }\">\n <!-- @slot Alpha (left) button icon slot -->\n <slot\n name=\"alphaIcon\"\n :size=\"iconSize\"\n />\n </template>\n <!-- @slot Default content slot -->\n <slot name=\"default\" />\n </split-button-alpha>\n <!-- @slot Omega (right) content slot, overrides omega button styling and functionality completely -->\n <slot name=\"omega\">\n <dt-dropdown\n v-if=\"dropdownSlotIsSet\"\n :placement=\"dropdownPlacement\"\n @click=\"isDropdownOpen = true\"\n @opened=\"open => isDropdownOpen = open\"\n >\n <template #anchor=\"attrs\">\n <split-button-omega\n v-bind=\"{ ...attrs, ...omegaButtonProps }\"\n :active=\"isDropdownOpen\"\n @click.native=\"$emit('omega-clicked')\"\n >\n <template #icon=\"{ size: iconSize }\">\n <!-- @slot Omega (right) button icon slot -->\n <slot\n name=\"omegaIcon\"\n :size=\"iconSize\"\n />\n </template>\n </split-button-omega>\n </template>\n <template #list=\"{ close }\">\n <!-- @slot Built-in dropdown content slot, use of dt-list-item is highly recommended here. -->\n <slot\n name=\"dropdownList\"\n :close=\"close\"\n />\n </template>\n </dt-dropdown>\n <split-button-omega\n v-else\n v-bind=\"omegaButtonProps\"\n @click.native=\"$emit('omega-clicked')\"\n >\n <template #icon=\"{ size: iconSize }\">\n <!-- @slot Omega (right) button icon slot -->\n <slot\n name=\"omegaIcon\"\n :size=\"iconSize\"\n />\n </template>\n </split-button-omega>\n </slot>\n </span>\n</template>\n\n<script>\nimport {\n BUTTON_IMPORTANCE_MODIFIERS,\n BUTTON_KIND_MODIFIERS,\n BUTTON_SIZE_MODIFIERS,\n ICON_POSITION_MODIFIERS,\n} from '@/components/button';\nimport SplitButtonAlpha from './split_button-alpha.vue';\nimport SplitButtonOmega from './split_button-omega.vue';\nimport { DtDropdown } from '@/components/dropdown';\nimport { warnIfUnmounted } from '@/common/utils';\n\nexport default {\n name: 'DtSplitButton',\n\n components: {\n SplitButtonOmega,\n DtDropdown,\n SplitButtonAlpha,\n },\n\n inheritAttrs: false,\n\n props: {\n /**\n * Determines whether the alpha button should have active styling\n * @values true, false\n */\n alphaActive: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Descriptive label for the alpha button\n */\n alphaAriaLabel: {\n type: String,\n default: null,\n },\n\n /**\n * The position of the icon slot within the alpha button.\n * @values left, right, top, bottom\n */\n alphaIconPosition: {\n type: String,\n default: 'left',\n validator: (position) => Object.keys(ICON_POSITION_MODIFIERS).includes(position),\n },\n\n /**\n * Used to customize the alpha label container\n */\n alphaLabelClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Whether the alpha button should display a loading animation or not.\n * @values true, false\n */\n alphaLoading: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Text shown in tooltip when you hover the alpha button,\n * required if no content is passed to default slot\n */\n alphaTooltipText: {\n type: String,\n default: undefined,\n },\n\n /**\n * Determines whether a screenreader reads live updates of\n * the button content to the user while the button\n * is in focus.\n * @values true, false\n */\n assertiveOnFocus: {\n type: Boolean,\n default: false,\n },\n\n /**\n * HTML button disabled attribute\n * <a class=\"d-link\" href=\"https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#disabled\" target=\"_blank\">\n * (Reference)\n * </a>\n * @values true, false\n */\n disabled: {\n type: Boolean,\n default: false,\n },\n\n /**\n * The direction the dropdown displays relative to the anchor.\n * @values top, top-start, top-end, right, right-start, right-end, left, left-start, left-end, bottom, bottom-start, bottom-end, auto, auto-start, auto-end\n */\n dropdownPlacement: {\n type: String,\n default: 'bottom-end',\n },\n\n /**\n * The fill and outline of the button associated with its visual importance.\n * @values clear, outlined, primary\n */\n importance: {\n type: String,\n default: 'primary',\n validator: (i) => Object.keys(BUTTON_IMPORTANCE_MODIFIERS).includes(i),\n },\n\n /**\n * The color of the button.\n * @values default, muted, danger, inverted\n */\n kind: {\n type: String,\n default: 'default',\n validator: (k) => Object.keys(BUTTON_KIND_MODIFIERS).includes(k),\n },\n\n /**\n * Determines whether the omega button should have active styling\n * @values true, false\n */\n omegaActive: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Descriptive label for the omega button\n */\n omegaAriaLabel: {\n type: String,\n default: null,\n },\n\n /**\n * Element ID, useful in case you need to reference the button\n * as an external anchor for popover\n */\n omegaId: {\n type: String,\n default: undefined,\n },\n\n /**\n * Text shown in tooltip when you hover the omega button,\n * required as it is an icon only button\n */\n omegaTooltipText: {\n type: String,\n default: undefined,\n },\n\n /**\n * The size of the button.\n * @values xs, sm, md, lg, xl\n */\n size: {\n type: String,\n default: 'md',\n validator: (s) => Object.keys(BUTTON_SIZE_MODIFIERS).includes(s),\n },\n\n /**\n * Button width, accepts\n * <a class=\"d-link\" href=\"https://developer.mozilla.org/en-US/docs/Web/CSS/width\" target=\"_blank\">\n * CSS width attribute\n * </a>\n * values\n */\n width: {\n type: String,\n default: null,\n },\n },\n\n emits: [\n /**\n * Native alpha button click event\n *\n * @event click\n * @type {PointerEvent | KeyboardEvent}\n */\n 'alpha-clicked',\n\n /**\n * Native omega button click event\n *\n * @event click\n * @type {PointerEvent | KeyboardEvent}\n */\n 'omega-clicked',\n ],\n\n data () {\n return {\n isDropdownOpen: false,\n };\n },\n\n computed: {\n alphaButtonProps () {\n return {\n active: this.alphaActive,\n ariaLabel: this.alphaAriaLabel,\n assertiveOnFocus: this.assertiveOnFocus,\n disabled: this.disabled,\n iconPosition: this.alphaIconPosition,\n labelClass: this.alphaLabelClass,\n loading: this.alphaLoading,\n importance: this.importance,\n kind: this.kind,\n size: this.size,\n tooltipText: this.alphaTooltipText,\n class: this.$attrs.class,\n };\n },\n\n omegaButtonProps () {\n return {\n id: this.omegaId,\n active: this.omegaActive,\n ariaLabel: this.omegaAriaLabel,\n disabled: this.disabled,\n importance: this.importance,\n kind: this.kind,\n size: this.size,\n tooltipText: this.omegaTooltipText,\n class: this.$attrs.class,\n };\n },\n\n defaultSlotHasContent () {\n return this.$scopedSlots.default && this.$scopedSlots.default() && this.$scopedSlots.default()[0]?.text?.trim();\n },\n\n omegaSlotIsSet () {\n return this.$scopedSlots.omega && this.$scopedSlots.omega();\n },\n\n dropdownSlotIsSet () {\n return this.$scopedSlots.dropdownList && this.$scopedSlots.dropdownList();\n },\n },\n\n created () {\n this.validateProps();\n },\n\n updated () {\n this.validateProps();\n },\n\n mounted () {\n warnIfUnmounted(this.$el, this.$options.name);\n },\n\n methods: {\n validateProps () {\n this.validateAlphaButtonProps();\n this.validateOmegaButtonProps();\n },\n\n validateAlphaButtonProps () {\n if (this.defaultSlotHasContent) return;\n\n // This can't be a computed prop due to reactivity issues.\n const isAlphaIconSet = this.$refs.alphaButton?.$scopedSlots.icon && this.$refs.alphaButton.$scopedSlots.icon();\n\n if (isAlphaIconSet && !this.alphaTooltipText) {\n console.warn('alpha-tooltip-text prop must be set if alpha button has an icon only');\n }\n },\n\n validateOmegaButtonProps () {\n if (this.omegaSlotIsSet) return;\n\n if (!this.omegaTooltipText) {\n console.warn('omega-tooltip-text prop is required as it is an icon-only button');\n }\n },\n },\n};\n</script>\n"],"names":["_sfc_main","SplitButtonOmega","DtDropdown","SplitButtonAlpha","position","ICON_POSITION_MODIFIERS","i","BUTTON_IMPORTANCE_MODIFIERS","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scopedSlots.omega && this.$scopedSlots.omega();
220
+ },
221
+ dropdownSlotIsSet() {
222
+ return this.$scopedSlots.dropdownList && this.$scopedSlots.dropdownList();
220
223
  }
221
224
  },
222
225
  created() {
@@ -249,7 +252,7 @@ var m = function() {
249
252
  } }, scopedSlots: t._u([{ key: "icon", fn: function({ size: o }) {
250
253
  return [t._t("alphaIcon", null, { size: o })];
251
254
  } }], null, !0) }, "split-button-alpha", t.alphaButtonProps, !1), [t._t("default")], 2), t._t("omega", function() {
252
- return [t.$slots.dropdownList ? a("dt-dropdown", { attrs: { placement: t.dropdownPlacement }, on: { click: function(o) {
255
+ return [t.dropdownSlotIsSet ? a("dt-dropdown", { attrs: { placement: t.dropdownPlacement }, on: { click: function(o) {
253
256
  t.isDropdownOpen = !0;
254
257
  }, opened: (o) => t.isDropdownOpen = o }, scopedSlots: t._u([{ key: "anchor", fn: function(o) {
255
258
  return [a("split-button-omega", t._b({ attrs: { active: t.isDropdownOpen }, nativeOn: { click: function(i) {
@@ -265,12 +268,12 @@ var m = function() {
265
268
  return [t._t("omegaIcon", null, { size: o })];
266
269
  } }], null, !0) }, "split-button-omega", t.omegaButtonProps, !1))];
267
270
  })], 2);
268
- }, g = [], S = /* @__PURE__ */ r(
271
+ }, S = [], g = /* @__PURE__ */ r(
269
272
  f,
270
273
  m,
271
- g
274
+ S
272
275
  );
273
- const B = S.exports;
276
+ const B = g.exports;
274
277
  export {
275
278
  B as default
276
279
  };