@dialpad/dialtone-vue 2.104.0 → 2.104.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.json +1 -1
- package/CHANGELOG.md +21 -0
- package/dist/dialtone-vue.cjs +6 -6
- package/dist/dialtone-vue.js +10577 -2511
- package/dist/directives.cjs +1 -1
- package/dist/directives.js +3 -4
- package/dist/emoji-93ca59dc.cjs +1 -0
- package/dist/emoji-ee881dc6.js +48703 -0
- package/dist/emoji.cjs +1 -1
- package/dist/emoji.js +24 -26
- package/dist/tooltip-4c644605.js +2542 -0
- package/dist/tooltip-7199e960.cjs +25 -0
- package/dist/types/components/icon/icon.vue.d.ts +1 -1
- package/dist/types/components/icon/icon.vue.d.ts.map +1 -1
- package/dist/types/components/tooltip/tooltip.vue.d.ts +1 -1
- package/package.json +3 -4
- package/dist/emoji-098966fd.js +0 -911
- package/dist/emoji-d5a5af5e.cjs +0 -1
- package/dist/tooltip-da61b649.cjs +0 -1
- package/dist/tooltip-fceff4af.js +0 -706
package/dist/emoji-d5a5af5e.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const P=require("/home/runner/work/dialtone-vue/dialtone-vue/node_modules/emoji-regex/index.mjs"),R=require("/home/runner/work/dialtone-vue/dialtone-vue/node_modules/emoji-toolkit/emoji_strategy.json"),r=require("./_plugin-vue2_normalizer-d59b995e.cjs"),d={100:"d-icon--size-100",200:"d-icon--size-200",300:"d-icon--size-300",400:"d-icon--size-400",500:"d-icon--size-500",600:"d-icon--size-600",700:"d-icon--size-700",800:"d-icon--size-800"},y=3e6,c={circle:"d-bar-circle",square:"d-bar2"},k=["body","heading"],v={sm:"24px",md:"32px",lg:"48px"},f={sm:"d-h16",md:"d-h24",lg:"d-h32"},D={computed:{skeletonOffset(){const e=this.$refs.skeleton;if(!e)return this.offset;const{top:t,height:n}=e.getBoundingClientRect();return t+n/2},skeletonStyle(){const e={};if(this.skeletonOffset===-1||!this.animate&&this.animationDuration===-1)return e;const t=this.skeletonOffset*y/1e3,n=this.animationDuration===-1?1e3:this.animationDuration;return e.animationDelay=`${t}ms`,e.animationDuration=`${n}ms`,e}}},U={name:"DtSkeletonShape",mixins:[D],props:{shape:{type:String,default:"circle",validator:e=>Object.keys(c).includes(e)},size:{type:String,default:"md"},animationDuration:{type:Number,default:-1},animate:{type:Boolean,default:!0},offset:{type:Number,default:1},contentClass:{type:[String,Object,Array],default:""}},data(){return{SKELETON_SHAPES:c}},computed:{shapeStyles(){const e=v[this.size]||this.size;return{...this.skeletonStyle,"min-width":e,"max-width":e,"min-height":e,"max-height":e}}}};var W=function(){var t=this,n=t._self._c;return n("div",{ref:"skeleton",class:["skeleton-placeholder",t.SKELETON_SHAPES[t.shape],{"skeleton-placeholder--animate":t.animate},t.contentClass],style:t.shapeStyles,attrs:{"data-qa":"skeleton-shape"}})},q=[],H=r.normalizeComponent(U,W,q,!1,null,null,null,null);const h=H.exports,F={name:"DtSkeletonText",mixins:[D],props:{type:{type:String,default:"body",validator:e=>k.includes(e)},headingHeight:{type:String,default:"md",validator:e=>Object.keys(f).includes(e)},width:{type:String,default:"100%"},animationDuration:{type:Number,default:-1},animate:{type:Boolean,default:!1},offset:{type:Number,default:1},contentClass:{type:String,default:""}},data(){return{SKELETON_HEADING_HEIGHTS:f}}};var K=function(){var t=this,n=t._self._c;return t.type==="body"?n("div",{ref:"skeleton",class:["d-h8","d-bar2","skeleton-placeholder",{"skeleton-placeholder--animate":t.animate},t.contentClass],style:{width:t.width,...t.skeletonStyle},attrs:{"data-qa":"skeleton-text-body"}}):t.type==="heading"?n("div",{ref:"skeleton",class:[t.SKELETON_HEADING_HEIGHTS[t.headingHeight],"d-bar2","skeleton-placeholder",{"skeleton-placeholder--animate":t.animate},t.contentClass],style:{width:t.width,...t.skeletonStyle},attrs:{"data-qa":"skeleton-text-heading"}}):t._e()},B=[],J=r.normalizeComponent(F,K,B,!1,null,null,null,null);const _=J.exports,u=e=>e!==""&&!Number.isNaN(Number(e)),V={name:"DtSkeletonParagraph",components:{DtSkeletonText:_},props:{rows:{type:[Number,String],default:3,validator:u},animate:{type:Boolean,default:!0},minWidth:{type:[Number,String],default:30,validator:u},maxWidth:{type:[Number,String],default:100,validator:u},width:{type:[String,Array],default:null},randomWidth:{type:Boolean,default:!1},offset:{type:Number,default:1},animationDuration:{type:Number,default:-1},contentClass:{type:String,default:""},rowClass:{type:String,default:""}},computed:{integerRows(){return Number(this.rows)}},methods:{randomWidthPercentage(){const e=Math.min(this.minWidth,this.maxWidth),t=Math.max(this.minWidth,this.maxWidth);return`${Math.round(Math.random()*(t-e))+e}%`},getSizeParagraphRow(e){const t=this.width,n=Array.isArray(t),a=t==null?void 0:t[e-1],i=e===this.rows;return this.randomWidth?this.randomWidthPercentage():t&&!n?t:t&&n&&a?a:i?"38%":"100%"}}};var M=function(){var t=this,n=t._self._c;return n("div",{class:["d-w100p",t.contentClass],attrs:{contentClass:"","data-qa":"skeleton-paragraph"}},t._l(t.integerRows,function(a){return n("dt-skeleton-text",{key:a,class:[{"d-mb12":a!==t.integerRows}],attrs:{"data-qa":"skeleton-paragraph-row","content-class":t.rowClass,animate:t.animate,offset:t.offset,"animation-duration":t.animationDuration,width:t.getSizeParagraphRow(a)}})}),1)},G=[],Z=r.normalizeComponent(V,M,G,!1,null,null,null,null);const g=Z.exports,X={name:"DtSkeletonListItem",components:{DtSkeletonShape:h,DtSkeletonParagraph:g},props:{shape:{type:String,default:"circle",validator:e=>Object.keys(c).includes(e)},shapeSize:{type:String,default:"md"},paragraphs:{type:Object,default:()=>({rows:3,randomWidth:!0})},animationDuration:{type:Number,default:-1},animate:{type:Boolean,default:!0},offset:{type:Number,default:1},shapeClass:{type:String,default:""},contentClass:{type:String,default:""}}};var Y=function(){var t=this,n=t._self._c;return n("div",{class:["d-d-flex",{"d-ai-center":t.paragraphs.rows===1},t.contentClass],attrs:{"data-qa":"skeleton-list-item"}},[n("dt-skeleton-shape",{staticClass:"d-mr8",attrs:{size:t.shapeSize,shape:t.shape,"animation-duration":t.animationDuration,animate:t.animate,offset:t.offset,"content-class":t.shapeClass}}),n("div",{staticClass:"d-d-flex d-fd-column d-w100p"},[n("dt-skeleton-paragraph",t._b({attrs:{"animation-duration":t.animationDuration,animate:t.animate,offset:t.offset}},"dt-skeleton-paragraph",t.paragraphs,!1))],1)],1)},Q=[],tt=r.normalizeComponent(X,Y,Q,!1,null,null,null,null);const O=tt.exports;const et={name:"DtSkeleton",components:{DtSkeletonText:_,DtSkeletonShape:h,DtSkeletonListItem:O,DtSkeletonParagraph:g},props:{paragraphOption:{type:[Object,Boolean],default:null},listItemOption:{type:[Object,Boolean],default:null},textOption:{type:Object,default:null},shapeOption:{type:[Object,Boolean],default:null},animationDuration:{type:Number,default:-1},ariaLabel:{type:String,default:""},animate:{type:Boolean,default:!0},offset:{type:Number,default:1}},computed:{validationOptions(){return{paragraphOption:this.paragraphOption,listItemOption:this.listItemOption,textOption:this.textOption,shapeOption:this.shapeOption}}},watch:{$props:{immediate:!0,handler:"validator"}},methods:{validator(){const e=Object.entries(this.validationOptions).filter(([t,n])=>n);if(e.length>=2){const t=`Use only one of ${e.map(([n])=>n).join(" | ")} options at the same time`;console.error(t)}}}};var nt=function(){var t=this,n=t._self._c;return n("div",{attrs:{"aria-busy":"true",role:"status","aria-label":t.ariaLabel}},[t.listItemOption?n("dt-skeleton-list-item",t._b({attrs:{"animation-duration":t.animationDuration,animate:t.animate,offset:t.offset}},"dt-skeleton-list-item",t.listItemOption===!0?{}:t.listItemOption,!1)):t.shapeOption?n("dt-skeleton-shape",t._b({attrs:{"animation-duration":t.animationDuration,animate:t.animate,offset:t.offset}},"dt-skeleton-shape",t.shapeOption===!0?{}:t.shapeOption,!1)):t.paragraphOption?n("dt-skeleton-paragraph",t._b({attrs:{"animation-duration":t.animationDuration,animate:t.animate,offset:t.offset}},"dt-skeleton-paragraph",t.paragraphOption===!0?{}:t.paragraphOption,!1)):n("dt-skeleton-text",t._b({attrs:{"animation-duration":t.animationDuration,animate:t.animate,offset:t.offset}},"dt-skeleton-text",t.textOption||{},!1))],1)},at=[],it=r.normalizeComponent(et,nt,at,!1,null,null,null,null);const b=it.exports,x="6.6",S="https://cdn.jsdelivr.net/joypixels/assets/"+x+"/png/unicode/32/";exports.customEmojiAssetUrl=null;exports.emojiImageUrlSmall=S;exports.emojiFileExtensionSmall=".png";exports.emojiImageUrlLarge=S;exports.emojiFileExtensionLarge=".png";const l=R;function L(){return l}function ot(e,t=".png"){e.endsWith("/")||(e=e+"/"),exports.emojiImageUrlSmall=e,exports.emojiFileExtensionSmall=t}function st(e,t=".svg"){e.endsWith("/")||(e=e+"/"),exports.emojiImageUrlLarge=e,exports.emojiFileExtensionLarge=t}function rt(e){exports.customEmojiAssetUrl=e}function lt(e){C(e)}function C(e){const t=["extension","custom"],n=["name","category","shortname","extension","custom"],a=(i,o,s)=>{if(i[o]===void 0){if(!t.includes(o))return;i[o]=s}else Array.isArray(i[o])?i[o]=i[o].concat(s):i[o]=s};Object.entries(e).forEach(i=>{const[o,s]=i;if(o in l){const E=l[o];for(const m in s){const N=s[m];a(E,m,N)}}else(()=>n.every(m=>s[m]!==void 0))()?l[o]=s:console.error("The following custom emoji doesn't contain the required properties:",s)})}function j(e){function t(a,i){if(!(!a||typeof a!="object")){if("shortname"in a&&(a.shortname===e||a.shortname_alternates.includes(e)))return a.key=i,n=a,!0;Object.keys(a).some(function(o){return t(a[o],o)})}}let n;return t(L(),null),n}function T(e){let t="";for(const n of e){const a=n.codePointAt(0).toString(16);["200d","fe0f"].includes(a)||(t!==""&&(t=t+"-"),t=t+n.codePointAt(0).toString(16))}return t}function w(e){const t=e.split("-");let n="";return t.forEach(a=>{n=n+String.fromCodePoint(parseInt(a,16))}),n}function I(e){if(e.startsWith(":")&&e.endsWith(":"))return j(e);{const t=T(e),n=l[t];return n&&(n.key=t),n}}function z(e){const t=e.match(/:\w+:/g);return $(t)}function $(e){const t=e?e.filter(n=>j(n)):[];return new Set(t)}function A(e){const t=[...e.matchAll(P())],n=t.length?t.map(a=>a[0]):[];return new Set(n)}const mt={name:"DtEmoji",components:{DtSkeleton:b},props:{code:{type:String,required:!0},size:{type:String,default:"500",validator:e=>Object.keys(d).includes(e)},imgClass:{type:[String,Object,Array],default:""},ariaLabel:{type:String,default:null},showSkeleton:{type:Boolean,default:!0}},data(){return{emojiData:null,imgLoading:!1}},computed:{emojiDataValid(){return!!this.emojiData},emojiSrc(){var e;return this.emojiDataValid?(e=this.emojiData)!=null&&e.custom?exports.customEmojiAssetUrl+this.emojiData.key+this.emojiData.extension:["100","200"].includes(this.size)?exports.emojiImageUrlSmall+this.emojiData.key+exports.emojiFileExtensionSmall:exports.emojiImageUrlLarge+this.emojiData.key+exports.emojiFileExtensionLarge:"invalid"},emojiAlt(){if(this.emojiDataValid)return this.emojiData.unicode_output?w(this.emojiData.unicode_output):this.emojiData.name},emojiLabel(){return this.emojiDataValid?this.ariaLabel?this.ariaLabel:this.emojiData.name:"Invalid Emoji"},emojiSize(){return d[this.size]}},watch:{code:{handler:function(){this.getEmojiData()},immediate:!0},emojiSrc:{handler:async function(){this.imgLoading=!0}}},methods:{getEmojiData(){this.emojiData=I(this.code)},imageLoaded(){this.imgLoading=!1},imageErrored(){this.imgLoading=!1}}};var dt=function(){var t=this,n=t._self._c;return n("span",{class:["dt-emoji","d-icon",t.emojiSize]},[n("dt-skeleton",{directives:[{name:"show",rawName:"v-show",value:t.imgLoading&&t.showSkeleton,expression:"imgLoading && showSkeleton"}],class:t.emojiSize,attrs:{offset:0,"shape-option":{shape:"square",contentClass:t.emojiSize,size:"auto"}}}),n("img",{directives:[{name:"show",rawName:"v-show",value:!t.imgLoading,expression:"!imgLoading"}],ref:"emojiImg",class:["d-icon",t.emojiSize,t.imgClass],attrs:{"aria-label":t.emojiLabel,alt:t.emojiAlt,title:t.emojiLabel,src:t.emojiSrc},on:{load:t.imageLoaded,error:t.imageErrored}})],1)},ct=[],ut=r.normalizeComponent(mt,dt,ct,!1,null,"6ad3e149",null,null);const p=ut.exports,ft={name:"DtEmojiTextWrapper",components:{DtEmoji:p},inheritAttrs:!1,props:{elementType:{type:String,default:"div"},size:{type:String,default:"500",validator:e=>Object.keys(d).includes(e)}},data(){return{loadingEmojiJson:!0}},async created(){this.loadingEmojiJson=!1},methods:{replaceDtEmojis(e,t){const n=new RegExp(`(${e.join("|")})`,"g");return t.split(n).map(i=>e.includes(i)?this.$createElement(p,{attrs:{class:"d-mx4 d-d-inline-block"},props:{code:i,size:this.size,...this.$attrs}}):i)},searchVNodes(e){if(!e.tag&&e.text)return this.searchCodes(e.text);const t=e.children?e.children.map(n=>this.searchVNodes(n)):[];return this.$createElement(e.tag,e.data,t)},replaceVueComponentVNodeContent(e){},searchCodes(e){const t=z(e),n=A(e),a=[...t,...n];return a.length===0?e:this.replaceDtEmojis(a,e)}},render(e){const t=this.$slots.default||[];return e(this.elementType,this.loadingEmojiJson?t:t.map(n=>this.searchVNodes(n)))}},pt=null,ht=null;var _t=r.normalizeComponent(ft,pt,ht,!1,null,null,null,null);const gt=_t.exports;exports.DtEmoji=p;exports.DtEmojiTextWrapper=gt;exports.DtSkeleton=b;exports.DtSkeletonListItem=O;exports.DtSkeletonParagraph=g;exports.DtSkeletonShape=h;exports.DtSkeletonText=_;exports.ICON_SIZE_MODIFIERS=d;exports.SKELETON_HEADING_HEIGHTS=f;exports.SKELETON_RIPPLE_DURATION=y;exports.SKELETON_SHAPES=c;exports.SKELETON_SHAPE_SIZES=v;exports.SKELETON_TEXT_TYPES=k;exports.codeToEmojiData=I;exports.defaultEmojiAssetUrl=S;exports.emojiJson=l;exports.emojiVersion=x;exports.filterValidShortCodes=$;exports.findEmojis=A;exports.findShortCodes=z;exports.getEmojiData=L;exports.setCustomEmojiJson=lt;exports.setCustomEmojiUrl=rt;exports.setEmojiAssetUrlLarge=st;exports.setEmojiAssetUrlSmall=ot;exports.shortcodeToEmojiData=j;exports.stringToUnicode=w;exports.unicodeToString=T;exports.validateCustomEmojiJson=C;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const c=require("/home/runner/work/dialtone-vue/dialtone-vue/node_modules/tippy.js/dist/tippy.esm.js"),k=require("vue"),h=require("./_plugin-vue2_normalizer-d59b995e.cjs"),r={ERROR:"error",WARNING:"warning",SUCCESS:"success"},z={LARGE:"lg",EXTRA_LARGE:"xl"},M={xs:"",sm:"",md:"",lg:"d-description--lg",xl:"d-description--xl"},U={xs:"d-label--xs",sm:"d-label--sm",md:"",lg:"d-label--lg",xl:"d-label--xl"},V={esc:"Esc",escape:"Escape",tab:"Tab",enter:"Enter",space:"Space",spacebar:"Spacebar",up:"Up",arrowup:"ArrowUp",left:"Left",arrowleft:"ArrowLeft",right:"Right",arrowright:"ArrowRight",down:"Down",arrowdown:"ArrowDown",home:"Home",end:"End"},d=r.ERROR,F="dt";let Y=0,u;const j=typeof setImmediate=="function"?setImmediate:setTimeout;function s(e=F){return`${e}${Y++}`}function p(e,t){if(t){const n=B(t);return e[Math.abs(n)%e.length]}else return e[f(e.length)]}function B(e){let t;for(let n=0;n<e.length;n++)t=Math.imul(31,t)+e.charCodeAt(n)|0;return t}function f(e){return Math.floor(Math.random()*e)}function m(e){return e?e.map(t=>typeof t=="string"?{message:t,type:d}:t):[]}function E(e){const t=a(e);return!e||!t?[]:e.filter(n=>!!n.message&&n.type===t)}function a(e){return e?i(e,r.ERROR)?r.ERROR:i(e,r.WARNING)?r.WARNING:i(e,r.SUCCESS)?r.SUCCESS:null:null}function i(e,t){return!e||!t?!1:e.some(n=>(n==null?void 0:n.type)===t)}const q={name:"html-fragment",functional:!0,props:["html"],render(e,t){return new k({name:"Inner",beforeCreate(){this.$createElement=e},template:`<div>${t.props.html}</div>`}).$mount()._vnode.children}},K=()=>new Promise(e=>{j(e)}),H=e=>e==null?void 0:e.toLowerCase().split("-").map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join("");function G(e,t=300){clearTimeout(u),u=setTimeout(e,t)}function _(e){const t=e.getBoundingClientRect(),n={top:t.top<0,left:t.left<0,bottom:t.bottom>(window.innerHeight||document.documentElement.clientHeight),right:t.right>(window.innerWidth||document.documentElement.clientWidth)};return n.any=Object.values(n).some(o=>o),n.all=Object.values(n).every(o=>o),n}const Z=/(?:(?:[^\s!@#$%^&*()_=+[\]{}\\|;:'",.<>/?]+)\.)/,W=new RegExp("(?:com|ru|org|net|de|jp|uk|br|it|pl|fr|in|au|ir|info|nl|cn|es|cz|kr|ca|eu|ua|co|gr|za|ro|biz|ch|se|tw|mx|vn|hu|be|tr|at|dk|tv|me|ar|sk|no|us|fi|id|cl|xyz|io|pt|by|il|ie|nz|kz|hk|lt|cc|my|sg|club|bg|edu|рф|pk|su|top|th|hr|rs|pe|pro|si|az|lv|pw|ae|ph|online|ng|ee|ws|ve|cat)"),Q=new RegExp("(?:(?:[0-9]|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])\\.){3}(?:[0-9]|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])"),g=new RegExp("(?:"+[[Z.source,W.source].join("+"),Q.source].join("|")+")"),X=/(?:(?:[;/][^#?<>\s]*)?)/,S=/(?:(?:\?[^#<>\s]+)?(?:#[^<>\s]+)?)/,w=new RegExp("\\b"+[g.source,X.source,S.source,"(?!\\w)"].join("+")),I=/\b[a-z\d.-]+:\/\/[^<>\s]+/,T=new RegExp("(?:mailto:)?[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@"+[g.source,S.source].join("+")+"(?!\\w)");function A(e=7,t=15){let n=!0;try{RegExp("(?<=\\W)")}catch{n=!1}return new RegExp(`${n?"(?:^|(?<=\\W))":""}(?![\\s\\-])\\+?(?:[0-9()\\- \\t]{${e},${t}})(?=\\b)(?=\\W(?=\\W|$)|\\s|$)`)}const y=A(),J=new RegExp([w.source,I.source,T.source,y.source].join("|"),"gi");function ee(e){var t;return!e||!["string","number"].includes(typeof e)?!1:(e=e.toString(),((t=y.exec(e))==null?void 0:t[0])===e)}function te(e){var t,n;return!e||typeof e!="string"?!1:((t=w.exec(e))==null?void 0:t[0])===e||((n=I.exec(e))==null?void 0:n[0])===e}function ne(e){var t;return!e||typeof e!="string"?!1:((t=T.exec(e))==null?void 0:t[0])===e}function v(e){return e.filter(t=>!!t).join(" ")}function R(e,t="en-US"){return e.replace(/^\p{CWU}/u,n=>n.toLocaleUpperCase(t))}const oe={getUniqueString:s,getRandomElement:p,getRandomInt:f,formatMessages:m,filterFormattedMessages:E,hasFormattedMessageOfType:i,getValidationState:a,htmlFragment:q,flushPromises:K,kebabCaseToPascalCase:H,debounce:G,isOutOfViewPort:_,getPhoneNumberRegex:A,linkRegex:J,isEmailAddress:ne,isPhoneNumber:ee,isURL:te,safeConcatStrings:v,capitalizeFirstLetter:R},re={name:"DtLazyShow",props:{show:{type:Boolean,default:!1},transition:{type:String,default:null},appear:{type:Boolean,default:!1}},data(){return{initialized:!!this.show}},computed:{isCSSEnabled(){return process.env.NODE_ENV!=="test"}},watch:{show:function(e){!e||this.initialized||(this.initialized=!0)}}};var ie=function(){var t=this,n=t._self._c;return n("transition",t._g({attrs:{name:t.transition,appear:t.appear,css:t.isCSSEnabled}},t.$listeners),[n("div",t._g({directives:[{name:"show",rawName:"v-show",value:t.show,expression:"show"}]},t.$listeners),[t.initialized?t._t("default"):t._e()],2)])},se=[],ae=h.normalizeComponent(re,ie,se,!1,null,null,null,null);const O=ae.exports,le=e=>({name:"arrowDetected",enabled:!0,phase:"main",fn:e,requiresIfExists:["offset"]}),ce=["bottom","bottom-start","bottom-end","right","right-start","right-end","left","left-start","left-end","top","top-start","top-end"],L=[!0,!1,"reference","popper"],P=(e,t)=>{const{contentElement:n}={...t};return delete t.contentElement,c(e,{...t,plugins:[c.sticky],render:()=>de(n)})},x=({boundary:e="clippingParents",fallbackPlacements:t=[],onChangePlacement:n=()=>{},hasHideModifierEnabled:o=!1,tether:l=!0}={})=>({modifiers:[{name:"flip",options:{fallbackPlacements:t,boundary:e}},{name:"hide",enabled:o},{name:"preventOverflow",options:{altAxis:!l,tether:l}},le(({state:$})=>{n($.placement)})]}),ue=e=>{const t=document.createElement("span");return t.innerText=e.innerText||"",e.innerText="",e.appendChild(t),t},he=e=>{const t=e==null?void 0:e.children[0];return t||ue(e)},de=e=>{const t=document.createElement("div");return t.className="tippy-box d-ps-absolute",t.appendChild(e),{popper:t}},b=[...ce],C=300,D={hover:"d-tooltip--hover",show:"d-tooltip--show",inverted:"d-tooltip--inverted",hide:"d-tooltip--hide"},N=[...L],pe=[!0,!1,"toggle"];const fe={name:"DtTooltip",components:{DtLazyShow:O},props:{id:{type:String,default(){return s()}},fallbackPlacements:{type:Array,default:()=>["auto"]},inverted:{type:Boolean,default:!1},offset:{type:Array,default:()=>[0,-4]},placement:{type:String,default:"top",validator(e){return b.includes(e)}},sticky:{type:[Boolean,String],default:!1,validator:e=>N.includes(e)},contentClass:{type:[String,Object,Array],default:""},message:{type:String,default:""},enabled:{type:Boolean,default:!0},show:{type:Boolean,default:null},transition:{type:String,default:"fade"},delay:{type:Boolean,default:!0},externalAnchor:{type:String,default:null}},emits:["shown","update:show"],data(){return{TOOLTIP_KIND_MODIFIERS:D,tip:null,inTimer:null,isShown:!1,currentPlacement:this.placement}},computed:{isVisible(){return this.isShown&&this.enabled&&(!!this.message.trim()||!!this.$slots.default)},tooltipListeners(){return{...this.$listeners,"after-leave":()=>{this.onLeaveTransitionComplete()},"after-enter":()=>{this.onEnterTransitionComplete()}}},tippyProps(){return{offset:this.offset,interactive:!1,trigger:"manual",placement:this.placement,sticky:this.sticky,popperOptions:x({fallbackPlacements:this.fallbackPlacements,hasHideModifierEnabled:!0,onChangePlacement:this.onChangePlacement})}},anchor(){return this.externalAnchor?document.body.querySelector(this.externalAnchor):he(this.$refs.anchor)}},watch:{tippyProps:{handler:"setProps",deep:!0},show:{handler:function(e){e!==null&&(this.isShown=e)},immediate:!0},isShown(e){e?(this.setProps(),this.tip.show()):this.tip.hide()},sticky(e){this.tip.setProps({sticky:e})}},mounted(){!this.enabled&&this.show!=null&&(console.warn("Tooltip: You cannot use both the enabled and show props at the same time."),console.warn("The show prop will be ignored.")),this.externalAnchor&&this.addExternalAnchorEventListeners(),this.tip=P(this.anchor,this.initOptions()),this.isShown&&this.tip.show()},beforeDestroy(){var e;this.externalAnchor&&this.removeExternalAnchorEventListeners(),this.tip&&((e=this.tip)==null||e.destroy())},methods:{calculateAnchorZindex(){return this.$el.getRootNode().querySelector('.d-modal[aria-hidden="false"], .d-modal--transparent[aria-hidden="false"]')||this.$el.closest(".d-zi-drawer")?651:400},hasVisibleFocus(){return this.anchor.matches(":focus-visible")},onEnterAnchor(e){this.delay?this.inTimer=setTimeout((function(t){this.triggerShow(t)}).bind(this,e),C):this.triggerShow(e)},triggerShow(e){e.type==="focusin"?this.show===null&&this.hasVisibleFocus()&&(this.isShown=!0):this.show===null&&(this.isShown=!0)},onLeaveAnchor(e){e.type==="keydown"&&e.code!=="Escape"||(clearTimeout(this.inTimer),this.triggerHide())},triggerHide(){this.show===null&&(this.isShown=!1)},onChangePlacement(e){this.currentPlacement=e},onLeaveTransitionComplete(){var e;(e=this.tip)==null||e.unmount(),this.$emit("shown",!1),this.show!==null&&this.$emit("update:show",!1)},onEnterTransitionComplete(){this.$emit("shown",!0),this.show!==null&&this.$emit("update:show",!0)},setProps(){this.tip&&this.tip.setProps&&this.tip.setProps({...this.tippyProps,zIndex:this.calculateAnchorZindex()})},onMount(){this.setProps()},initOptions(){return{contentElement:this.$refs.content.$el,allowHTML:!0,zIndex:this.calculateAnchorZindex(),onMount:this.onMount,...this.tippyProps}},addExternalAnchorEventListeners(){["focusin","mouseenter"].forEach(e=>{this.anchor.addEventListener(e,t=>this.onEnterAnchor(t))}),["focusout","mouseleave","keydown"].forEach(e=>{this.anchor.addEventListener(e,t=>this.onLeaveAnchor(t))})},removeExternalAnchorEventListeners(){["focusin","mouseenter"].forEach(e=>{this.anchor.removeEventListener(e,t=>this.onEnterAnchor(t))}),["focusout","mouseleave","keydown"].forEach(e=>{this.anchor.removeEventListener(e,t=>this.onLeaveAnchor(t))})}}};var me=function(){var t=this,n=t._self._c;return n("div",{attrs:{"data-qa":"dt-tooltip-container"}},[t.externalAnchor?t._e():n("span",{ref:"anchor",attrs:{"data-qa":"dt-tooltip-anchor"},on:{focusin:t.onEnterAnchor,focusout:t.onLeaveAnchor,mouseenter:t.onEnterAnchor,mouseleave:t.onLeaveAnchor,keydown:function(o){return!o.type.indexOf("key")&&t._k(o.keyCode,"esc",27,o.key,["Esc","Escape"])?null:t.onLeaveAnchor.apply(null,arguments)}}},[t._t("anchor")],2),n("dt-lazy-show",t._g({ref:"content",class:["d-tooltip",`d-tooltip__arrow-tippy--${t.currentPlacement}`,{[t.TOOLTIP_KIND_MODIFIERS.inverted]:t.inverted},t.contentClass],attrs:{id:t.id,show:t.isVisible,role:"tooltip","aria-hidden":"false","data-qa":"dt-tooltip",appear:"",transition:t.transition}},t.tooltipListeners),[t._t("default",function(){return[t._v(" "+t._s(t.message)+" ")]})],2)],1)},Ee=[],_e=h.normalizeComponent(fe,me,Ee,!1,null,null,null,null);const ge=_e.exports;exports.DEFAULT_VALIDATION_MESSAGE_TYPE=d;exports.DESCRIPTION_SIZE_MODIFIERS=M;exports.DESCRIPTION_SIZE_TYPES=z;exports.DtLazyShow=O;exports.DtTooltip=ge;exports.EVENT_KEYNAMES=V;exports.LABEL_SIZE_MODIFIERS=U;exports.TIPPY_STICKY_VALUES=L;exports.TOOLTIP_DELAY_MS=C;exports.TOOLTIP_DIRECTIONS=b;exports.TOOLTIP_HIDE_ON_CLICK_VARIANTS=pe;exports.TOOLTIP_KIND_MODIFIERS=D;exports.TOOLTIP_STICKY_VALUES=N;exports.VALIDATION_MESSAGE_TYPES=r;exports.capitalizeFirstLetter=R;exports.createTippy=P;exports.filterFormattedMessages=E;exports.formatMessages=m;exports.getPopperOptions=x;exports.getRandomElement=p;exports.getUniqueString=s;exports.getValidationState=a;exports.isOutOfViewPort=_;exports.safeConcatStrings=v;exports.utils=oe;
|