@dialpad/dialtone 9.11.5 → 9.11.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/css/dialtone.css +2 -2
- package/dist/tokens/android/java/tokens-dark.kt +1 -1
- package/dist/tokens/android/java/tokens-light.kt +1 -1
- package/dist/tokens/android/res/values/colors-dark.xml +1 -1
- package/dist/tokens/android/res/values/colors-light.xml +1 -1
- package/dist/tokens/android/res/values/dimens.xml +1 -1
- package/dist/tokens/css/variables-dark.css +1 -1
- package/dist/tokens/css/variables-light.css +1 -1
- package/dist/tokens/ios/tokens-dark.swift +1 -1
- package/dist/tokens/ios/tokens-light.swift +1 -1
- package/dist/tokens/less/variables-dark.less +1 -1
- package/dist/tokens/less/variables-light.less +1 -1
- package/dist/vue2/dialtone-vue.cjs +1 -1
- package/dist/vue2/dialtone-vue.js +7 -7
- package/dist/vue2/directives.cjs +1 -1
- package/dist/vue2/directives.js +1 -1
- package/dist/vue2/emoji.cjs +1 -1
- package/dist/vue2/emoji.js +4 -4
- package/dist/vue2/{emoji_picker-G_dpCtLb.cjs → emoji_picker-Bqtgrc_-.cjs} +1 -1
- package/dist/vue2/{emoji_picker-H4Qp2wF5.js → emoji_picker-H8MCLDWD.js} +2 -2
- package/dist/vue2/{emoji_text_wrapper-B6LYaq-4.js → emoji_text_wrapper-FIY8SE_T.js} +2 -2
- package/dist/vue2/{emoji_text_wrapper-HXzlY5eZ.cjs → emoji_text_wrapper-L5BvowDe.cjs} +1 -1
- package/dist/vue2/{index-Fi4GXrPf.cjs → index-Ay3JqEew.cjs} +1 -1
- package/dist/vue2/{index-ASOzBdZi.js → index-Fb937CbY.js} +1 -1
- package/dist/vue2/message_input.cjs +1 -1
- package/dist/vue2/message_input.js +4 -4
- package/dist/vue2/{rich_text_editor-hvsobGV1.js → rich_text_editor-C4iSjnMg.js} +2 -2
- package/dist/vue2/{rich_text_editor-HGWAxljc.cjs → rich_text_editor-CJiLXSVv.cjs} +1 -1
- package/dist/vue2/{tooltip-R7LTeOZf.cjs → tooltip-SCB4w509.cjs} +5 -5
- package/dist/vue2/{tooltip-vREVnN_1.js → tooltip-ZAaMbL96.js} +288 -281
- package/dist/vue2/types/components/tooltip/tooltip.vue.d.ts +2 -1
- package/dist/vue2/types/components/tooltip/tooltip.vue.d.ts.map +1 -1
- package/dist/vue3/dialtone-vue.cjs +1 -1
- package/dist/vue3/dialtone-vue.js +7 -7
- package/dist/vue3/directives.cjs +1 -1
- package/dist/vue3/directives.js +1 -1
- package/dist/vue3/{emoji-BTNutvt9.js → emoji-9trlIcvP.js} +1 -1
- package/dist/vue3/{emoji-rlL92lZG.cjs → emoji-i0_qg0UW.cjs} +1 -1
- package/dist/vue3/emoji.cjs +1 -1
- package/dist/vue3/emoji.js +4 -4
- package/dist/vue3/{emoji_picker-yry3pYOn.cjs → emoji_picker-LTVMMASh.cjs} +1 -1
- package/dist/vue3/{emoji_picker-nmJ2h6aY.js → emoji_picker-Y2qCr8ss.js} +2 -2
- package/dist/vue3/{emoji_text_wrapper--VteZTud.js → emoji_text_wrapper-BDupkpRi.js} +1 -1
- package/dist/vue3/{emoji_text_wrapper-c3aPthCy.cjs → emoji_text_wrapper-o1rL3f2U.cjs} +1 -1
- package/dist/vue3/message_input.cjs +1 -1
- package/dist/vue3/message_input.js +4 -4
- package/dist/vue3/{rich_text_editor-rl8EpCt1.cjs → rich_text_editor-B6o2QYBc.cjs} +1 -1
- package/dist/vue3/{rich_text_editor-2sh3YgmO.js → rich_text_editor-K4i01tLL.js} +2 -2
- package/dist/vue3/{tooltip-3O-FaSCC.js → tooltip-p1QaufTw.js} +84 -76
- package/dist/vue3/{tooltip-POX7tOJg.cjs → tooltip-qNCn2WEt.cjs} +4 -4
- package/dist/vue3/types/components/tooltip/tooltip.vue.d.ts +2 -1
- package/dist/vue3/types/components/tooltip/tooltip.vue.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/css/dialtone.css
CHANGED
|
@@ -7401,7 +7401,7 @@ body {
|
|
|
7401
7401
|
}
|
|
7402
7402
|
/**
|
|
7403
7403
|
* Do not edit directly
|
|
7404
|
-
* Generated on Wed, 07 Feb 2024
|
|
7404
|
+
* Generated on Wed, 07 Feb 2024 23:34:19 GMT
|
|
7405
7405
|
*/
|
|
7406
7406
|
|
|
7407
7407
|
.dialtone-theme-light {
|
|
@@ -8198,7 +8198,7 @@ body {
|
|
|
8198
8198
|
|
|
8199
8199
|
/**
|
|
8200
8200
|
* Do not edit directly
|
|
8201
|
-
* Generated on Wed, 07 Feb 2024
|
|
8201
|
+
* Generated on Wed, 07 Feb 2024 23:34:20 GMT
|
|
8202
8202
|
*/
|
|
8203
8203
|
|
|
8204
8204
|
.dialtone-theme-dark {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./rich_text_editor-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./rich_text_editor-CJiLXSVv.cjs"),l=require("./index-Ay3JqEew.cjs"),o=require("./tooltip-SCB4w509.cjs"),Q=require("vue"),Ut=require("./emoji_text_wrapper-L5BvowDe.cjs"),It={default:"",info:"d-badge--info",success:"d-badge--success",warning:"d-badge--warning",critical:"d-badge--critical",bulletin:"d-badge--bulletin",ai:"d-badge--ai"},Dt={label:"",count:"d-badge--count"},Tt={"black-400":"d-badge--decorate-black-400","black-500":"d-badge--decorate-black-500","black-900":"d-badge--decorate-black-900","red-200":"d-badge--decorate-red-200","red-300":"d-badge--decorate-red-300","red-400":"d-badge--decorate-red-400","purple-200":"d-badge--decorate-purple-200","purple-300":"d-badge--decorate-purple-300","purple-400":"d-badge--decorate-purple-400","purple-500":"d-badge--decorate-purple-500","blue-200":"d-badge--decorate-blue-200","blue-300":"d-badge--decorate-blue-300","blue-400":"d-badge--decorate-blue-400","green-300":"d-badge--decorate-green-300","green-400":"d-badge--decorate-green-400","green-500":"d-badge--decorate-green-500","gold-300":"d-badge--decorate-gold-300","gold-400":"d-badge--decorate-gold-400","gold-500":"d-badge--decorate-gold-500","magenta-200":"d-badge--decorate-magenta-200","magenta-300":"d-badge--decorate-magenta-300","magenta-400":"d-badge--decorate-magenta-400"},rn={name:"DtBadge",components:{DtIcon:l.DtIcon},props:{iconLeft:{type:String,default:""},iconRight:{type:String,default:""},text:{type:String,default:""},kind:{type:String,default:"label",validator:e=>Object.keys(Dt).includes(e)},type:{type:String,default:"default",validator:e=>Object.keys(It).includes(e)},decoration:{type:String,default:void 0,validator:e=>Object.keys(Tt).includes(e)},labelClass:{type:[String,Array,Object],default:""}},data(){return{BADGE_TYPE_MODIFIERS:It,BADGE_KIND_MODIFIERS:Dt,BADGE_DECORATION_MODIFIERS:Tt}},computed:{hasIcons(){return this.iconLeft!==""||this.iconRight!==""}},watch:{$props:{immediate:!0,deep:!0,handler(){this.validateProps()}}},methods:{validateProps(){this.validateTypePropCombination(),this.validateDecorationPropCombination()},validateTypePropCombination(){this.type==="ai"&&this.kind==="count"&&console.error("DtBadge error: type: 'ai' with kind: 'count' is an invalid combination.")},validateDecorationPropCombination(){this.decoration&&((this.kind!=="label"||this.type!=="default")&&console.error("DtBadge error: decoration prop can only be used with kind: 'label' and type: 'default'."),this.hasIcons&&console.error("DtBadge error: decoration prop cannot be used with iconLeft or iconRight."))}}};var sn=function(){var t=this,n=t._self._c;return n("span",{class:["d-badge",t.BADGE_TYPE_MODIFIERS[t.type],t.BADGE_KIND_MODIFIERS[t.kind],t.BADGE_DECORATION_MODIFIERS[t.decoration]],attrs:{"data-qa":"dt-badge"}},[t.decoration?n("span",{staticClass:"d-badge__decorative"}):t._e(),t.iconLeft||t.type==="ai"?n("span",{staticClass:"d-badge__icon-left"},[n("dt-icon",{attrs:{name:t.iconLeft||"dialpad-ai",size:"200"}})],1):t._e(),n("span",{class:["d-badge__label",t.labelClass]},[t._t("default",function(){return[t._v(" "+t._s(t.text)+" ")]})],2),t.iconRight?n("span",{staticClass:"d-badge__icon-right"},[n("dt-icon",{attrs:{name:t.iconRight,size:"200"}})],1):t._e()])},on=[],ln=o.normalizeComponent(rn,sn,on,!1,null,null,null,null);const st=ln.exports,V=["base","error","info","success","warning"],le=["alert","alertdialog","status"],dn=new Map([["info","info"],["success","check-circle"],["warning","alert-triangle"],["error","alert-circle"],["base","bell"]]),cn={name:"DtNoticeIcon",components:{DtIcon:l.DtIcon},props:{kind:{type:String,default:"base",validate(e){return V.includes(e)}}},computed:{defaultIcon(){return dn.get(this.kind)}}};var un=function(){var t=this,n=t._self._c;return t.defaultIcon||t.$slots.default?n("div",{staticClass:"d-notice__icon",attrs:{"aria-hidden":"true"}},[t._t("default",function(){return[n("dt-icon",{attrs:{name:t.defaultIcon,size:"400"}})]})],2):t._e()},fn=[],pn=o.normalizeComponent(cn,un,fn,!1,null,null,null,null);const ot=pn.exports,hn={name:"DtNoticeContent",props:{title:{type:String,default:""},titleId:{type:String,default:void 0},contentId:{type:String,default:void 0}}};var mn=function(){var t=this,n=t._self._c;return n("div",{staticClass:"d-notice__content",attrs:{"data-qa":"notice-content"}},[t.title||t.$slots.titleOverride?n("p",{staticClass:"d-notice__title",attrs:{id:t.titleId,"data-qa":"notice-content-title"}},[t._t("titleOverride",function(){return[t._v(" "+t._s(t.title)+" ")]})],2):t._e(),n("p",{staticClass:"d-notice__message",attrs:{id:t.contentId,"data-qa":"notice-content-message"}},[t._t("default")],2)])},_n=[],gn=o.normalizeComponent(hn,mn,_n,!1,null,null,null,null);const lt=gn.exports,bn={name:"DtNoticeAction",components:{DtIcon:l.DtIcon,DtButton:l.DtButton,SrOnlyCloseButton:u.SrOnlyCloseButton},mixins:[u.SrOnlyCloseButtonMixin],props:{closeButtonProps:{type:Object,default:()=>({})},hideClose:{type:Boolean,default:!1}},emits:["close"],computed:{noticeActionListeners(){return{...this.$listeners,click:e=>{this.close(),this.$emit("click",e)}}}},created(){!this.hideClose&&!this.closeButtonProps.ariaLabel&&console.error("Invalid props: you must pass in closeButtonProps.ariaLabel if the close button is displayed.")},mounted(){this.hideClose||(this.lastFocusedElement=document.activeElement)},beforeDestroy(){var e;(e=this.lastFocusedElement)==null||e.focus()},methods:{close(){this.$emit("close")}}};var vn=function(){var t=this,n=t._self._c;return n("div",{staticClass:"d-notice__actions",attrs:{"data-qa":"notice-content-actions"}},[t._t("default"),t.hideClose?t._e():n("dt-button",t._g(t._b({ref:"closeButton",attrs:{"data-qa":"dt-notice-action-close-button",size:"sm",importance:"clear",circle:"","aria-label":t.closeButtonProps.ariaLabel?t.closeButtonProps.ariaLabel:"Close"},scopedSlots:t._u([{key:"icon",fn:function(){return[n("dt-icon",{attrs:{name:"close",size:"200"}})]},proxy:!0}],null,!1,1154370889)},"dt-button",t.closeButtonProps,!1),t.noticeActionListeners)),t.showVisuallyHiddenClose?n("sr-only-close-button",{attrs:{"visually-hidden-close-label":t.visuallyHiddenCloseLabel},on:{close:t.close}}):t._e()],2)},yn=[],Sn=o.normalizeComponent(bn,vn,yn,!1,null,null,null,null);const dt=Sn.exports,Cn={name:"DtNotice",components:{DtNoticeIcon:ot,DtNoticeContent:lt,DtNoticeAction:dt},mixins:[u.SrOnlyCloseButtonMixin],props:{titleId:{type:String,default:void 0},contentId:{type:String,default:void 0},title:{type:String,default:""},role:{type:String,default:"status",validate(e){return le.includes(e)}},important:{type:Boolean,default:!1},kind:{type:String,default:"base",validate(e){return V.includes(e)}},closeButtonProps:{type:Object,default:()=>({})},hideClose:{type:Boolean,default:!1}},emits:["close"],computed:{noticeClass(){return["d-notice",{error:"d-notice--error",info:"d-notice--info",success:"d-notice--success",warning:"d-notice--warning",base:"d-notice--base"}[this.kind],{"d-notice--important":this.important}]}}};var In=function(){var t=this,n=t._self._c;return n("aside",{class:t.noticeClass,attrs:{"data-qa":"notice"}},[n("dt-notice-icon",{attrs:{kind:t.kind}},[t._t("icon")],2),n("dt-notice-content",t._g({attrs:{"title-id":t.titleId,"content-id":t.contentId,title:t.title,role:t.role},scopedSlots:t._u([{key:"titleOverride",fn:function(){return[t._t("titleOverride")]},proxy:!0}],null,!0)},t.$listeners),[t._t("default")],2),n("dt-notice-action",t._g({attrs:{"hide-close":t.hideClose,"close-button-props":t.closeButtonProps,"visually-hidden-close":t.visuallyHiddenClose,"visually-hidden-close-label":t.visuallyHiddenCloseLabel}},t.$listeners),[t._t("action")],2)],1)},Dn=[],Tn=o.normalizeComponent(Cn,In,Dn,!1,null,null,null,null);const wn=Tn.exports,En={name:"DtBanner",components:{DtNoticeIcon:ot,DtNoticeContent:lt,DtNoticeAction:dt},mixins:[u.Modal,u.SrOnlyCloseButtonMixin],props:{titleId:{type:String,default(){return o.utils.getUniqueString()}},contentId:{type:String,default(){return o.utils.getUniqueString()}},title:{type:String,default:""},important:{type:Boolean,default:!1},pinned:{type:Boolean,default:!1},kind:{type:String,default:"base",validate(e){return V.includes(e)}},closeButtonProps:{type:Object,default:()=>({})},hideClose:{type:Boolean,default:!1},hideIcon:{type:Boolean,default:!1},dialogClass:{type:String,default:""},backgroundImage:{type:String,default:""},backgroundSize:{type:String,default:"cover"}},emits:["close"],computed:{role(){return this.important?"alertdialog":"status"},bannerClass(){return["d-banner",{error:"d-banner--error",info:"d-banner--info",success:"d-banner--success",warning:"d-banner--warning",base:"d-banner--base"}[this.kind],{"d-banner--important":this.important,"d-banner--pinned":this.pinned}]},bannerBackgroundImage(){return this.backgroundImage===""?null:`background-image: url(${this.backgroundImage});
|
|
2
2
|
background-size: ${this.backgroundSize};`}},mounted(){this.important&&this.focusFirstElement()},methods:{trapFocus(e){this.important&&this.focusTrappedTabPress(e)}}};var On=function(){var t=this,n=t._self._c;return n("aside",{class:t.bannerClass,style:t.bannerBackgroundImage,on:{keydown:function(a){return!a.type.indexOf("key")&&t._k(a.keyCode,"tab",9,a.key,"Tab")?null:t.trapFocus.apply(null,arguments)}}},[n("div",{staticClass:"d-banner__dialog",class:t.dialogClass,attrs:{role:t.role,"aria-labelledby":t.titleId,"aria-describedby":t.contentId}},[t.hideIcon?t._e():n("dt-notice-icon",t._g({attrs:{kind:t.kind}},t.$listeners),[t._t("icon")],2),n("dt-notice-content",t._g({attrs:{"title-id":t.titleId,"content-id":t.contentId,title:t.title},scopedSlots:t._u([{key:"titleOverride",fn:function(){return[t._t("titleOverride")]},proxy:!0}],null,!0)},t.$listeners),[t._t("default")],2),n("dt-notice-action",t._g({attrs:{"hide-close":t.hideClose,"close-button-props":t.closeButtonProps,"visually-hidden-close":t.visuallyHiddenClose,"visually-hidden-close-label":t.visuallyHiddenCloseLabel}},t.$listeners),[t._t("action")],2)],1)])},kn=[],Ln=o.normalizeComponent(En,On,kn,!1,null,null,null,null);const xn=Ln.exports,de="d-breadcrumbs__item--selected",ce="d-breadcrumbs--inverted",An={name:"DtBreadcrumbItem",components:{DtLink:u.DtLink},inheritAttrs:!1,props:{inverted:{type:Boolean,default:!1},selected:{type:Boolean,default:!1},label:{type:String,default:""}},data(){return{BREADCRUMB_ITEM_SELECTED_MODIFIER:de}},computed:{linkKind(){return this.inverted?l.INVERTED:l.MUTED},ariaCurrent(){return this.selected?"location":void 0}}};var $n=function(){var t=this,n=t._self._c;return n("li",{class:["d-breadcrumbs__item",{[t.BREADCRUMB_ITEM_SELECTED_MODIFIER]:t.selected}],attrs:{"data-qa":"dt-breadcrumb-item"}},[n("dt-link",t._b({attrs:{kind:t.linkKind,"aria-current":t.ariaCurrent,"data-qa":"breadcrumb-item"}},"dt-link",t.$attrs,!1),[t._t("default",function(){return[t._v(" "+t._s(t.label)+" ")]})],2)],1)},Rn=[],Mn=o.normalizeComponent(An,$n,Rn,!1,null,null,null,null);const ue=Mn.exports,Nn={name:"DtBreadcrumbs",components:{DtBreadcrumbItem:ue},props:{breadcrumbs:{type:Array,default:()=>[],validate(e){return e.every(({href:t,label:n})=>t!==void 0&&n!==void 0)}},inverted:{type:Boolean,default:!1},ariaLabel:{type:String,default:"breadcrumb"}},data(){return{BREADCRUMBS_INVERTED_MODIFIER:ce}},methods:{getBreadcrumbItemKey(e){return`breadcrumbs-item-${e}-${o.utils.getUniqueString()}`}}};var Pn=function(){var t=this,n=t._self._c;return n("nav",{class:["d-breadcrumbs",{[t.BREADCRUMBS_INVERTED_MODIFIER]:t.inverted}],attrs:{"aria-label":t.ariaLabel,"data-qa":"dt-breadcrumbs"}},[n("ol",[t._t("default",function(){return t._l(t.breadcrumbs,function(a,r){return n("dt-breadcrumb-item",t._g(t._b({key:t.getBreadcrumbItemKey(r),attrs:{inverted:t.inverted}},"dt-breadcrumb-item",a,!1),t.$listeners))})})],2)])},Bn=[],Fn=o.normalizeComponent(Nn,Pn,Bn,!1,null,null,null,null);const Vn=Fn.exports,wt={start:"d-btn-group--start",end:"d-btn-group--end","space-between":"d-btn-group--space-between"},qn={name:"DtButtonGroup",props:{alignment:{type:String,default:"start",validator:e=>Object.keys(wt).includes(e)}},data(){return{BUTTON_GROUP_ALIGNMENT:wt}}};var Un=function(){var t=this,n=t._self._c;return n("div",{class:["d-btn-group",t.BUTTON_GROUP_ALIGNMENT[t.alignment]],attrs:{role:"group"}},[t._t("default")],2)},Hn=[],Wn=o.normalizeComponent(qn,Un,Hn,!1,null,null,null,null);const zn=Wn.exports,Yn={name:"DtCard",props:{maxHeight:{type:String,default:null},containerClass:{type:[String,Array,Object],default:""},contentClass:{type:[String,Array,Object],default:""},headerClass:{type:[String,Array,Object],default:""},footerClass:{type:[String,Array,Object],default:""}}};var Kn=function(){var t=this,n=t._self._c;return n("div",{class:["d-card",t.containerClass],attrs:{"data-qa":"dt-card"}},[t.$slots.header?n("div",{class:["d-card__header",t.headerClass]},[t._t("header")],2):t._e(),n("div",{class:["d-card__content",t.contentClass],style:{"max-height":t.maxHeight}},[t._t("content")],2),t.$slots.footer?n("div",{class:["d-card__footer",t.footerClass]},[t._t("footer")],2):t._e()])},jn=[],Gn=o.normalizeComponent(Yn,Kn,jn,!1,null,null,null,null);const fe=Gn.exports,Qn={name:"DtCodeblock",props:{text:{type:String,required:!0}}};var Zn=function(){var t=this,n=t._self._c;return n("pre",[t._v(" "),n("code",{staticClass:"d-codeblock"},[t._v(t._s(t.text))]),t._v(`
|
|
3
3
|
`)])},Xn=[],Jn=o.normalizeComponent(Qn,Zn,Xn,!1,null,null,null,null);const ta=Jn.exports,ea={methods:{scrollElementIntoViewIfNeeded(e,t,n,a){e.scrollIntoViewIfNeeded?this.scrollIntoViewIfNeeded(e,t,n,a):this.scrollIntoView(e,"bottom",!1,n,a)},scrollElementIntoView(e,t,n,a){if(t==="center"){this.scrollIntoView(e,"center",!1,n,a);return}t===!1?this.scrollIntoView(e,"bottom",!1,n,a):this.scrollIntoView(e,"top",!1,n,a)},scrollIntoViewIfNeeded(e,t,n,a){const r=t?"center":void 0;this.scrollIntoView(e,r,!0,n,a)},scrollIntoView(e,t,n,a,r){if(!e||!e.parentElement)return;const i=e.offsetTop,s=r||e.parentElement,d=this._getScrollBounds(s),f=d.bottom-d.top,p=this._getElementHeight(e),b=i+p;let c=-1;switch(t){case"top":c=i;break;case"center":c=i+(p-f)/2;break;case"bottom":c=c=b-f;break;default:i-d.top<=f/2?c=i:c=b-f;break}this._setScrollTop(s,c,d,i,b,n,a)},_setScrollTop(e,t,n,a,r,i,s){n=n||this._getScrollBounds(e);const d=n.bottom-n.top;if(i&&this._inScrollBounds(a,r,n))if(a<n.top)t=a;else if(r>n.bottom)t=r-d;else return;s?e.scrollTo({top:t,behavior:s}):e.scrollTop=t},_getElementHeight(e){return e.getBoundingClientRect().height},_getScrollBounds(e){const t=this._getElementHeight(e),n=e.scrollTop;return{top:n,bottom:n+t}},_inScrollBounds(e,t,n){const a=t-e;return t<=n.bottom+3*a/4&&e>=n.top-a/4}}},na="listElementKey is required or the referenced element doesn't exist. Received listElement: ",Ht=({listItemRole:e="option",indexKey:t="highlightIndex",idKey:n="highlightId",listElementKey:a="listRef",activeItemKey:r="",openMethod:i=null,afterHighlightMethod:s=null,beginningOfListMethod:d=null,endOfListMethod:f=null,scrollToOnHighlight:p=!0,focusOnKeyboardNavigation:b=!1}={})=>({mixins:[ea],data(){return{[t]:-1,[n]:"",scrollToOnHighlight:p,focusOnKeyboardNavigation:b}},provide(){return{highlightId:()=>this[n]}},methods:{_getListElement(){var c;return((c=this[a]())==null?void 0:c.$el)||this[a]()},_itemsLength(){const c=this._getListItemNodes();return c===null?0:c.length},_getListItemNodes(){const c=this._getListElement();return c?Array.from(c.querySelectorAll(`[role="${e}"], #sr-only-close-button`)):(console.error(na,c),null)},onUpKey(){i&&this[i](!0),this[t]>0?this.setHighlightIndex(this[t]-1):d&&this[d](),this.scrollActiveItemIntoViewIfNeeded(),this.focusActiveItemIfNeeded()},onDownKey(){i&&this[i](!0),this[t]<this._itemsLength()-1?this.setHighlightIndex(this[t]+1):f&&this[f](),this.scrollActiveItemIntoViewIfNeeded(),this.focusActiveItemIfNeeded()},onHomeKey(){this.jumpToBeginning(),this.scrollActiveItemIntoViewIfNeeded(),this.focusActiveItemIfNeeded()},onEndKey(){this.jumpToEnd(),this.scrollActiveItemIntoViewIfNeeded(),this.focusActiveItemIfNeeded()},onNavigationKey(c){const g=this._getListItemNodes(),_=g.filter(I=>I.textContent.trim().toLowerCase().startsWith(c.toLowerCase()));if(_.length<=0)return;const v=_.findIndex(I=>this[t]===g.indexOf(I)),D=g.indexOf(v<_.length-1?_[v+1]:_[0]);this.setHighlightIndex(D),this.scrollActiveItemIntoViewIfNeeded(),this.focusActiveItemIfNeeded()},isValidLetter(c){return c.length>1?!1:c>="a"&&c<="z"||c>="A"&&c<="Z"},jumpToBeginning(){this.setHighlightIndex(0)},jumpToEnd(){this.setHighlightIndex(this._itemsLength()-1)},setHighlightIndex(c){this[t]=c,this[n]=this._getItemId(c),this._itemsLength()&&s&&this[s](c)},setHighlightId(c){this[n]=c,this[t]=this._getItemIndex(c),this._itemsLength()&&s&&this[s](this._getItemIndex(c))},_getItemIndex(c){const g=this._getListElement();return g?Array.from(g.querySelectorAll(`[role="${e}"], #sr-only-close-button`)).indexOf(g.querySelector(`#${c}`)):void 0},_getItemId(c){var _;const g=this._getListElement();if(g)return(_=g.querySelectorAll(`[role="${e}"], #sr-only-close-button`)[c])==null?void 0:_.id},scrollActiveItemIntoViewIfNeeded(){if(!this.scrollToOnHighlight)return;const c=this[r];if(c){const g=this._getListElement();this.scrollElementIntoViewIfNeeded(c,null,null,g)}},focusActiveItemIfNeeded(){if(!this.focusOnKeyboardNavigation)return;const c=this[r];c&&c.focus()}}}),aa={name:"ComboboxLoadingList",components:{DtListItem:u.DtListItem,DtSkeleton:l.DtSkeleton}};var ra=function(){var t=this,n=t._self._c;return n("ol",{staticClass:"d-combobox__loading-list",attrs:{"aria-busy":"true"}},t._l(7,function(a){return n("dt-list-item",{key:a,attrs:{role:"option","navigation-type":"none"}},[n("dt-skeleton",{attrs:{"text-option":{type:"body"},offset:0}})],1)}),1)},ia=[],sa=o.normalizeComponent(aa,ra,ia,!1,null,null,null,null);const pe=sa.exports,oa={name:"ComboboxEmptyList",components:{DtListItem:u.DtListItem},props:{message:{type:String,required:!0},itemClass:{type:[String,Object,Array],default:""}}};var la=function(){var t=this,n=t._self._c;return n("ol",{staticClass:"d-combobox__empty-list",attrs:{"data-qa":"dt-combobox-empty-list"}},[t._t("default",function(){return[n("dt-list-item",{class:["dt-empty-list-item",t.itemClass],attrs:{role:"option","navigation-type":"none",type:"custom"}},[n("span",[t._v(t._s(t.message))])])]})],2)},da=[],ca=o.normalizeComponent(oa,la,da,!1,null,null,null,null);const he=ca.exports,Wt={EXTRA_SMALL:"xs",SMALL:"sm",DEFAULT:"md",LARGE:"lg",EXTRA_LARGE:"xl"},ua={name:"DtCombobox",components:{ComboboxLoadingList:pe,ComboboxEmptyList:he},mixins:[Ht({indexKey:"highlightIndex",idKey:"highlightId",listElementKey:"getListElement",afterHighlightMethod:"afterHighlight",beginningOfListMethod:"beginningOfListMethod",endOfListMethod:"endOfListMethod",activeItemKey:"activeItemEl"})],props:{label:{type:String,required:!0},labelVisible:{type:Boolean,default:!0},size:{type:String,default:null,validator:e=>Object.values(Wt).includes(e)},description:{type:String,default:""},listId:{type:String,default(){return o.getUniqueString()}},onBeginningOfList:{type:Function,default:null},onEndOfList:{type:Function,default:null},showList:{type:Boolean,default:!1},listRenderedOutside:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},emptyList:{type:Boolean,default:!1},emptyStateMessage:{type:String,default:""},emptyStateClass:{type:[String,Object,Array],default:""},clickOnSelect:{type:Boolean,default:!1}},emits:["select","escape","highlight","opened"],data(){return{outsideRenderedListRef:null}},computed:{inputProps(){return{label:this.label,labelVisible:this.labelVisible,size:this.size,description:this.description,role:"combobox","aria-label":this.label,"aria-expanded":this.showList.toString(),"aria-owns":this.listId,"aria-haspopup":"listbox","aria-activedescendant":this.activeItemId,"aria-controls":this.listId}},listProps(){return{role:"listbox",id:this.listId,class:"d-ps-relative","aria-label":this.label}},beginningOfListMethod(){return this.onBeginningOfList||this.jumpToEnd},endOfListMethod(){return this.onEndOfList||this.jumpToBeginning},activeItemId(){if(!(!this.showList||this.highlightIndex<0||this.loading))return this.highlightId},activeItemEl(){return this.highlightId?this.getListElement().querySelector("#"+this.highlightId):""}},watch:{showList(e){this.listRenderedOutside||(this.setInitialHighlightIndex(),this.$emit("opened",e)),!e&&this.outsideRenderedListRef&&(this.outsideRenderedListRef.removeEventListener("mousemove",this.onMouseHighlight),this.outsideRenderedListRef=null)},loading(e){this.$nextTick(()=>{this.setInitialHighlightIndex()})},$props:{deep:!0,immediate:!0,handler(){this.validateEmptyListProps()}}},created(){this.validateEmptyListProps()},methods:{onMouseHighlight(e){if(this.loading)return;const t=e.target.closest("li");t&&this.highlightId!==t.id&&this.setHighlightId(t.id)},getListElement(){var e;return this.outsideRenderedListRef??((e=this.$refs.listWrapper)==null?void 0:e.querySelector(`#${this.listId}`))},clearHighlightIndex(){this.showList&&this.setHighlightIndex(-1)},afterHighlight(){this.loading||this.$emit("highlight",this.highlightIndex)},onEnterKey(){var e;this.loading||this.emptyList||this.highlightIndex>=0&&(this.$emit("select",this.highlightIndex),this.clickOnSelect&&((e=this.activeItemEl)==null||e.click()))},onEscapeKey(){this.$emit("escape")},onOpen(e,t){var n;this.outsideRenderedListRef=t,(n=this.outsideRenderedListRef)==null||n.addEventListener("mousemove",this.onMouseHighlight),this.$emit("opened",e),e&&this.setInitialHighlightIndex()},onKeyValidation(e,t){!this.showList||!this.getListElement()||this[t](e)},setInitialHighlightIndex(){this.showList&&this.$nextTick(()=>{this.setHighlightIndex(this.loading?-1:0)})},validateEmptyListProps(){this.$slots.emptyListItem||(this.emptyList&&!this.emptyStateMessage||!this.emptyList&&this.emptyStateMessage)&&console.error(`Invalid props: you must pass both props emptyList and emptyStateMessage to show the
|
|
4
4
|
empty message.`)}}};var fa=function(){var t=this,n=t._self._c;return n("div",{on:{keydown:[function(a){return!a.type.indexOf("key")&&t._k(a.keyCode,"esc",27,a.key,["Esc","Escape"])?null:(a.stopPropagation(),t.onKeyValidation(a,"onEscapeKey"))},function(a){return!a.type.indexOf("key")&&t._k(a.keyCode,"enter",13,a.key,"Enter")||a.ctrlKey||a.shiftKey||a.altKey||a.metaKey?null:t.onKeyValidation(a,"onEnterKey")},function(a){return!a.type.indexOf("key")&&t._k(a.keyCode,"up",38,a.key,["Up","ArrowUp"])?null:(a.stopPropagation(),a.preventDefault(),t.onKeyValidation(a,"onUpKey"))},function(a){return!a.type.indexOf("key")&&t._k(a.keyCode,"down",40,a.key,["Down","ArrowDown"])?null:(a.stopPropagation(),a.preventDefault(),t.onKeyValidation(a,"onDownKey"))},function(a){return!a.type.indexOf("key")&&t._k(a.keyCode,"home",void 0,a.key,void 0)?null:(a.stopPropagation(),a.preventDefault(),t.onKeyValidation(a,"onHomeKey"))},function(a){return!a.type.indexOf("key")&&t._k(a.keyCode,"end",void 0,a.key,void 0)?null:(a.stopPropagation(),a.preventDefault(),t.onKeyValidation(a,"onEndKey"))}]}},[n("div",{attrs:{"data-qa":"dt-combobox-input-wrapper"}},[t._t("input",null,{inputProps:t.inputProps})],2),t.showList?n("div",{ref:"listWrapper",attrs:{"data-qa":"dt-combobox-list-wrapper"},on:{mouseleave:t.clearHighlightIndex,focusout:t.clearHighlightIndex,"!mousemove":function(a){return t.onMouseHighlight.apply(null,arguments)}}},[t.loading&&!t.listRenderedOutside?n("combobox-loading-list",t._b({},"combobox-loading-list",t.listProps,!1)):t.emptyList&&(t.emptyStateMessage||t.$slots.emptyListItem)&&!t.listRenderedOutside?n("combobox-empty-list",t._b({attrs:{message:t.emptyStateMessage,"item-class":t.emptyStateClass}},"combobox-empty-list",t.listProps,!1),[t._t("emptyListItem")],2):t._t("list",null,{listProps:t.listProps,opened:t.onOpen,clearHighlightIndex:t.clearHighlightIndex})],2):t._e()])},pa=[],ha=o.normalizeComponent(ua,fa,pa,!1,null,null,null,null);const me=ha.exports,ma={name:"DtCollapsibleLazyShow",props:{show:{type:Boolean,default:null},appear:{type:Boolean,default:!1},elementType:{type:String,default:"div"}},data(){return{initialized:!!this.show}},computed:{isCSSEnabled(){return process.env.NODE_ENV!=="test"}},watch:{show:function(e){!e||this.initialized||(this.initialized=!0)}},methods:{beforeEnter(e){requestAnimationFrame(()=>{e.style.height||(e.style.height="0px")})},enter(e){requestAnimationFrame(()=>{requestAnimationFrame(()=>{e.style.height=`${e.scrollHeight}px`})})},afterEnter(e){e.style.height=null},beforeLeave(e){requestAnimationFrame(()=>{e.style.height||(e.style.height=`${e.offsetHeight}px`)})},leave(e){requestAnimationFrame(()=>{requestAnimationFrame(()=>{e.style.height="0px"})})},afterLeave(e){e.style.height=null}}};var _a=function(){var t=this,n=t._self._c;return n("transition",t._g({attrs:{appear:t.appear,"enter-active-class":"enter-active","leave-active-class":"leave-active",css:t.isCSSEnabled},on:{"before-enter":t.beforeEnter,enter:t.enter,"after-enter":t.afterEnter,"before-leave":t.beforeLeave,leave:t.leave,"after-leave":t.afterLeave}},t.$listeners),[n(t.elementType,t._g({directives:[{name:"show",rawName:"v-show",value:t.show,expression:"show"}],tag:"component"},t.$listeners),[t.initialized?t._t("default"):t._e()],2)],1)},ga=[],ba=o.normalizeComponent(ma,_a,ga,!1,null,null,null,null);const va=ba.exports,ya={name:"DtCollapsible",components:{DtButton:l.DtButton,DtCollapsibleLazyShow:va,DtLazyShow:o.DtLazyShow,DtIcon:l.DtIcon},props:{anchorText:{type:String,default:null},open:{type:Boolean,default:null},id:{type:String,default(){return o.getUniqueString()}},elementType:{type:String,default:"div"},contentElementType:{type:String,default:"div"},anchorClass:{type:[String,Array,Object],default:null},contentClass:{type:[String,Array,Object],default:null},maxWidth:{type:String,default:null},maxHeight:{type:String,default:null},ariaLabel:{type:String,default:null},ariaLabelledBy:{type:String,default:null}},emits:["update:open","opened"],data(){return{isOpen:!0}},computed:{labelledBy(){return this.ariaLabelledBy||!this.ariaLabel&&o.getUniqueString("DtCollapsible__anchor")}},watch:{open:{handler:function(e){e!==null&&(this.isOpen=e)},immediate:!0}},mounted(){this.validateProperAnchor()},methods:{onLeaveTransitionComplete(){this.$emit("opened",!1),this.open!==null&&this.$emit("update:open",!1)},onEnterTransitionComplete(){this.$emit("opened",!0,this.$refs.content),this.open!==null&&this.$emit("update:open",!0)},defaultToggleOpen(){this.open===null&&this.toggleOpen()},toggleOpen(){this.isOpen=!this.isOpen},validateProperAnchor(){!this.anchorText&&!this.$scopedSlots.anchor&&console.error("anchor text and anchor slot content cannot both be falsy")}}};var Sa=function(){var t=this,n=t._self._c;return n(t.elementType,t._g({ref:"collapsible",tag:"component"},t.$listeners),[n("div",{ref:"anchor",class:t.anchorClass,attrs:{id:!t.ariaLabelledBy&&t.labelledBy}},[t._t("anchor",function(){return[n("dt-button",{style:{width:t.maxWidth},attrs:{importance:"clear",kind:"muted","aria-controls":t.id,"aria-expanded":`${t.isOpen}`},on:{click:t.defaultToggleOpen}},[n("dt-icon",{staticClass:"d-collapsible__icon",attrs:{name:t.isOpen?"chevron-down":"chevron-right",size:"300"}}),n("span",{staticClass:"d-collapsible__anchor-text",attrs:{title:t.anchorText}},[t._v(" "+t._s(t.anchorText)+" ")])],1)]},{attrs:{"aria-controls":t.id,"aria-expanded":t.isOpen.toString(),role:"button"}})],2),n("dt-collapsible-lazy-show",t._g({ref:"contentWrapper",class:t.contentClass,style:{"max-height":t.maxHeight,"max-width":t.maxWidth},attrs:{id:t.id,"aria-hidden":`${!t.isOpen}`,"aria-labelledby":t.labelledBy,"aria-label":t.ariaLabel,show:t.isOpen,"element-type":t.contentElementType,"data-qa":"dt-collapsible--content",tabindex:"-1",appear:""},on:{"after-leave":t.onLeaveTransitionComplete,"after-enter":t.onEnterTransitionComplete}},t.$listeners),[t._t("content")],2)],1)},Ca=[],Ia=o.normalizeComponent(ya,Sa,Ca,!1,null,null,null,null);const _e=Ia.exports,ge=["row","column"],Da=e=>e.term?typeof e.term=="string":!1,Ta=e=>e.description?typeof e.description=="string":!1,wa=e=>Array.isArray(e)?e.every(t=>!(typeof t!="object"||!Da(t)||!Ta(t))):!1,Ea={name:"DtDescriptionList",props:{direction:{type:String,default:"row",validator:e=>ge.includes(e)},items:{type:Array,default:()=>[],validator:e=>wa(e),required:!0},gap:{type:String,default:"400",validator:e=>u.DT_STACK_GAP.includes(e)},termClass:{type:[String,Array,Object],default:""},descriptionClass:{type:[String,Array,Object],default:""}},computed:{dtClass(){return["dt-description-list__term",this.termClass]},ddClass(){return["dt-description-list__description",this.descriptionClass]},getDirectionClass(){return`dt-description-list--${this.direction}`},getGapClass(){return`dt-description-list--gap-${this.gap}`}}};var Oa=function(){var t=this,n=t._self._c;return n("dl",{class:["dt-description-list",t.getDirectionClass,t.getGapClass]},[t._l(t.items,function(a){return[n("dt",{key:`dt-${a.term}`,class:t.dtClass},[t._v(" "+t._s(a.term)+" ")]),n("dd",{key:`dd-${a.term}`,class:t.ddClass},[t._v(" "+t._s(a.description)+" ")])]})],2)},ka=[],La=o.normalizeComponent(Ea,Oa,ka,!1,null,null,null,null);const xa=La.exports,B={none:void 0,small:"d-py0",large:"d-py4"},Aa={name:"DtDropdown",components:{DtPopover:u.DtPopover,SrOnlyCloseButton:u.SrOnlyCloseButton},mixins:[Ht({indexKey:"highlightIndex",idKey:"highlightId",listElementKey:"getListElement",listItemRole:"menuitem",afterHighlightMethod:"afterHighlight",beginningOfListMethod:"beginningOfListMethod",endOfListMethod:"endOfListMethod",activeItemKey:"activeItemEl",focusOnKeyboardNavigation:!0}),u.SrOnlyCloseButtonMixin],props:{open:{type:Boolean,default:null},openOnContext:{type:Boolean,default:!1},padding:{type:String,default:"small",validator:e=>Object.keys(B).some(t=>t===e)},modal:{type:Boolean,default:!0},contentWidth:{type:String,default:null},maxHeight:{type:String,default:""},maxWidth:{type:String,default:""},listId:{type:String,default(){return o.getUniqueString()}},navigationType:{type:String,default:u.LIST_ITEM_NAVIGATION_TYPES.ARROW_KEYS,validator:e=>Object.values(u.LIST_ITEM_NAVIGATION_TYPES).includes(e)},fallbackPlacements:{type:Array,default:()=>["auto"]},placement:{type:String,default:"bottom"},onBeginningOfList:{type:Function,default:null},onEndOfList:{type:Function,default:null},listClass:{type:[String,Array,Object],default:""},appendTo:{type:[HTMLElement,String],default:"body",validator:e=>u.POPOVER_APPEND_TO_VALUES.includes(e)||e instanceof HTMLElement},tether:{type:Boolean,default:!0},transition:{type:String,default:"fade"}},emits:["highlight","opened","update:open"],data(){return{LIST_ITEM_NAVIGATION_TYPES:u.LIST_ITEM_NAVIGATION_TYPES,DROPDOWN_PADDING_CLASSES:B,EVENT_KEYNAMES:o.EVENT_KEYNAMES,openedWithKeyboard:!1,isOpen:null}},computed:{dropdownListeners(){return{...this.$listeners,opened:e=>{this.updateInitialHighlightIndex(e)},keydown:e=>{switch(e.code){case o.EVENT_KEYNAMES.up:case o.EVENT_KEYNAMES.arrowup:this.onUpKeyPress(e),e.stopPropagation(),e.preventDefault();break;case o.EVENT_KEYNAMES.down:case o.EVENT_KEYNAMES.arrowdown:this.onDownKeyPress(e),e.stopPropagation(),e.preventDefault();break;case o.EVENT_KEYNAMES.space:case o.EVENT_KEYNAMES.spacebar:this.onSpaceKey();break;case o.EVENT_KEYNAMES.enter:this.onEnterKey();break;case o.EVENT_KEYNAMES.home:this.onHomeKeyPress(e),e.stopPropagation(),e.preventDefault();break;case o.EVENT_KEYNAMES.end:this.onEndKeyPress(e),e.stopPropagation(),e.preventDefault();break;default:this.onKeyPress(e);break}this.$emit("keydown",e)}}},beginningOfListMethod(){return this.onBeginningOfList||this.jumpToEnd},endOfListMethod(){return this.onEndOfList||this.jumpToBeginning},activeItemEl(){return this.getListElement().querySelector("#"+this.highlightId)},isArrowKeyNav(){return this.navigationType===this.LIST_ITEM_NAVIGATION_TYPES.ARROW_KEYS},listClasses(){return["d-dropdown-list",B[this.padding],this.listClass,{"d-context-menu-list":this.openOnContext}]},shouldOpenWithArrowKeys(){return!this.openOnContext}},methods:{onMouseHighlight(e){const t=e.target.closest("li");t&&t.role&&this.highlightId!==t.id&&(this.setHighlightId(t.id),t.focus())},getListElement(){return this.$refs.listWrapper},clearHighlightIndex(){this.setHighlightIndex(-1)},afterHighlight(){this.visuallyHiddenClose&&this.highlightIndex===this._itemsLength()-1||this.$emit("highlight",this.highlightIndex)},updateInitialHighlightIndex(e){this.isOpen=e,e?(this.openedWithKeyboard&&this.isArrowKeyNav&&this.setHighlightIndex(0),this.$emit("opened",!0)):(this.clearHighlightIndex(),this.openedWithKeyboard=!1,this.$emit("opened",!1))},onSpaceKey(){this.open||(this.openedWithKeyboard=!0)},onEnterKey(){this.open||(this.openedWithKeyboard=!0)},onUpKeyPress(){if(!this.isOpen){this.openedWithKeyboard=!0;return}if(this.isArrowKeyNav)return this.onUpKey()},onDownKeyPress(){if(!this.isOpen){this.openedWithKeyboard=!0;return}if(this.isArrowKeyNav)return this.onDownKey()},onHomeKeyPress(){if(!(!this.isOpen||!this.isArrowKeyNav))return this.onHomeKey()},onEndKeyPress(){if(!(!this.isOpen||!this.isArrowKeyNav))return this.onEndKey()},onKeyPress(e){if(!(!this.isOpen||!this.isArrowKeyNav||!this.isValidLetter(e.key)))return e.stopPropagation(),e.preventDefault(),this.onNavigationKey(e.key)}}};var $a=function(){var t=this,n=t._self._c;return n("dt-popover",t._g({ref:"popover",attrs:{"content-width":t.contentWidth,open:t.open,placement:t.placement,"initial-focus-element":t.openedWithKeyboard?"first":"dialog","fallback-placements":t.fallbackPlacements,padding:"none",role:"menu","append-to":t.appendTo,modal:t.modal,"max-height":t.maxHeight,"max-width":t.maxWidth,"open-with-arrow-keys":t.shouldOpenWithArrowKeys,"open-on-context":t.openOnContext,tether:t.tether,transition:t.transition},scopedSlots:t._u([{key:"anchor",fn:function({attrs:a}){return[t._t("anchor",null,null,a)]}},{key:"content",fn:function({close:a}){return[n("ul",{ref:"listWrapper",class:t.listClasses,attrs:{id:t.listId,"data-qa":"dt-dropdown-list-wrapper"},on:{mouseleave:t.clearHighlightIndex,"!mousemove":function(r){return t.onMouseHighlight.apply(null,arguments)}}},[t._t("list",null,{close:a}),t.showVisuallyHiddenClose?n("sr-only-close-button",{attrs:{"visually-hidden-close-label":t.visuallyHiddenCloseLabel,tabindex:t.isArrowKeyNav?-1:0},on:{close:a}}):t._e()],2)]}}],null,!0)},t.dropdownListeners))},Ra=[],Ma=o.normalizeComponent(Aa,$a,Ra,!1,null,null,null,null);const be=Ma.exports,Na={name:"DtDropdownSeparator"};var Pa=function(){var t=this,n=t._self._c;return n("li",{staticClass:"dt-list-separator",attrs:{"aria-hidden":"true"}})},Ba=[],Fa=o.normalizeComponent(Na,Pa,Ba,!1,null,null,null,null);const Va=Fa.exports,qa=function(){const e={value:null};let t,n,a=null,r=null;function i(f){if(r){const p=Date.now()-a+100;t&&clearTimeout(t),r!==f&&(t=setTimeout(()=>{e.value!==null&&(a=Date.now()),e.value=null},p),n&&clearTimeout(n),n=setTimeout(()=>{e.value=f,r=f},p))}else n=setTimeout(()=>{e.value=f,r=f},o.TOOLTIP_DELAY_MS)}function s(){n&&(clearTimeout(n),n=null),a=Date.now(),t=setTimeout(()=>{e.value=null,r=null},o.TOOLTIP_DELAY_MS)}let d=null;return()=>(d===null&&(d={current:e,enter:i,leave:s}),d)}(),Ua={name:"DtHovercard",components:{DtPopover:u.DtPopover},props:{transition:{type:Boolean,default:!1},fallbackPlacements:{type:Array,default:()=>["auto"]},placement:{type:String,default:"top-start",validator(e){return o.TOOLTIP_DIRECTIONS.includes(e)}},padding:{type:String,default:"large",validator:e=>Object.keys(u.POPOVER_PADDING_CLASSES).some(t=>t===e)},offset:{type:Array,default:()=>[0,16]},id:{type:String,default(){return o.getUniqueString()}},headerClass:{type:[String,Array,Object],default:""},footerClass:{type:[String,Array,Object],default:""},dialogClass:{type:[String,Array,Object],default:""},contentClass:{type:[String,Array,Object],default:""},appendTo:{type:[HTMLElement,String],default:"body",validator:e=>u.POPOVER_APPEND_TO_VALUES.includes(e)||e instanceof HTMLElement}},emits:["opened"],data(){return{timer:Q.reactive(qa())}}};var Ha=function(){var t=this,n=t._self._c;return n("dt-popover",{attrs:{id:t.id,placement:t.placement,"content-class":t.contentClass,"fallback-placements":t.fallbackPlacements,padding:t.padding,transition:t.transition?"fade":null,offset:t.offset,modal:!1,"initial-focus-element":"none","header-class":t.headerClass,"footer-class":t.footerClass,"append-to":t.appendTo,hovercard:!0,timer:t.timer,"data-qa":"dt-hovercard"},on:{opened:a=>t.$emit("opened",a)},scopedSlots:t._u([{key:"anchor",fn:function({attrs:a}){return[t._t("anchor",null,null,a)]}},{key:"content",fn:function(){return[t._t("content")]},proxy:!0},{key:"headerContent",fn:function(){return[t._t("headerContent")]},proxy:!0},{key:"footerContent",fn:function(){return[t._t("footerContent")]},proxy:!0}],null,!0)})},Wa=[],za=o.normalizeComponent(Ua,Ha,Wa,!1,null,null,null,null);const Ya=za.exports,Ka={name:"DtImageViewer",components:{Portal:u.Portal,DtButton:l.DtButton,DtIcon:l.DtIcon},mixins:[u.Modal],props:{open:{type:Boolean,default:null},imageSrc:{type:String,required:!0},imageAlt:{type:String,required:!0},imageButtonClass:{type:String,required:!1,default:""},ariaLabel:{type:String,required:!0},closeAriaLabel:{type:String,required:!0}},emits:["opened","update:open"],data(){return{showCloseButton:!0,isOpen:!1}},computed:{modalListeners(){return{...this.$listeners,click:e=>{e.target===e.currentTarget&&this.close()},keydown:e=>{switch(e.code){case o.EVENT_KEYNAMES.esc:case o.EVENT_KEYNAMES.escape:this.close();break;case o.EVENT_KEYNAMES.tab:this.trapFocus(e);break}}}}},watch:{isOpen:{immediate:!0,handler(e){var t;e?this.previousActiveElement=document.activeElement:((t=this.previousActiveElement)==null||t.focus(),this.previousActiveElement=null)}},open:{handler:function(e){e!==null&&(this.isOpen=e)},immediate:!0}},methods:{openModal(){this.open===null&&(this.isOpen=!0,this.showCloseButton=!0,this.$emit("opened",!0),setTimeout(()=>{this.focusAfterOpen()}))},close(){this.isOpen=!1,this.$emit("opened",!1),this.open!==null&&this.$emit("update:open",!1)},focusAfterOpen(){var e;(e=this.$refs.closeImage)==null||e.$el.focus()},trapFocus(e){this.isOpen&&this.focusTrappedTabPress(e)}}};var ja=function(){var t=this,n=t._self._c;return n("div",[n("dt-button",{staticClass:"d-image-viewer__preview-button",attrs:{"data-qa":"dt-image-viewer-preview","aria-label":t.ariaLabel,importance:"clear"},on:{click:t.openModal}},[n("img",{class:t.imageButtonClass,attrs:{src:t.imageSrc,alt:t.imageAlt}})]),t.isOpen?n("portal",[n("div",t._g({staticClass:"d-modal",attrs:{"aria-hidden":t.isOpen?"false":"true","data-qa":"dt-modal"},on:{mouseover:function(a){t.showCloseButton=!0},mouseleave:function(a){t.showCloseButton=!1},focusin:function(a){t.showCloseButton=!0},focusout:function(a){t.showCloseButton=!1}}},t.modalListeners),[n("div",{staticClass:"d-image-viewer__full",attrs:{"data-qa":"dt-image-viewer-full",role:"dialog","aria-modal":"true"}},[n("img",{staticClass:"d-image-viewer__full__image",attrs:{src:t.imageSrc,alt:t.imageAlt}})]),n("transition",{attrs:{name:"fade"}},[t.showCloseButton?n("dt-button",{ref:"closeImage",staticClass:"d-modal__close",attrs:{"data-qa":"dt-image-viewer-close-btn",circle:"",size:"lg",importance:"clear",kind:"inverted","aria-label":t.closeAriaLabel},on:{click:t.close},scopedSlots:t._u([{key:"icon",fn:function(){return[n("dt-icon",{staticClass:"d-image-viewer__close-button",attrs:{name:"close",size:"400"}})]},proxy:!0}],null,!1,1620344283)}):t._e()],1)],1)]):t._e()],1)},Ga=[],Qa=o.normalizeComponent(Ka,ja,Ga,!1,null,null,null,null);const ve=Qa.exports,ye={components:{DtValidationMessages:l.DtValidationMessages},provide(){return{groupContext:this.provideObj,setGroupValue:this.setGroupValue}},props:{id:{type:String,default(){return o.getUniqueString()}},value:{type:[String,Number,Boolean,Object],default:null},name:{type:String,required:!0},legend:{type:String,default:""},disabled:{type:Boolean,default:!1},messages:{type:Array,default:()=>[],validator:e=>l.validationMessageValidator(e)},showMessages:{type:Boolean,default:!0},legendClass:{type:[String,Array,Object],default:""},messagesClass:{type:[String,Array,Object],default:""},legendChildProps:{type:Object,default:()=>({})},messagesChildProps:{type:Object,default:()=>({})}},data(){const e=o.formatMessages(this.messages);return{provideObj:{name:this.name,disabled:this.disabled,validationState:o.getValidationState(e)}}},computed:{formattedMessages(){return o.formatMessages(this.messages)},validationState(){return o.getValidationState(this.formattedMessages)}},watch:{disabled(e){this.provideObj.disabled=e},validationState(e){this.provideObj.validationState=e}},methods:{setGroupValue(e){this.internalValue=e,this.$emit("input",e)}},mounted(){!this.legend&&!this.$slots.legend&&!this.$attrs["aria-label"]&&Q.util.warn("It is expected that an aria-label is provided when there is no legend.",this)}},Za={name:"DtInputGroup",components:{DtValidationMessages:l.DtValidationMessages},mixins:[ye],props:{dataQaGroup:{type:String,default:"input-group"},dataQaGroupLegend:{type:String,default:"input-group-legend"},dataQaGroupMessages:{type:String,default:"input-group-messages"}},emits:["input"],data(){return{internalValue:this.value,provideObj:{value:this.value}}},watch:{value(e){this.internalValue=e},internalValue(e){this.provideObj.value=e}},methods:{getMessageKey(e,t){return`input-group-message-${e}-${t}-${this.id}`}}};var Xa=function(){var t=this,n=t._self._c;return n("fieldset",{staticClass:"d-input-group__fieldset",attrs:{"data-qa":t.dataQaGroup}},[t.$slots.legend||t.legend?n("legend",t._b({class:["d-label",t.legendClass],attrs:{"data-qa":t.dataQaGroupLegend}},"legend",t.legendChildProps,!1),[t._t("legend",function(){return[t._v(" "+t._s(t.legend)+" ")]})],2):t._e(),t._t("default"),n("dt-validation-messages",t._b({class:t.messagesClass,attrs:{"validation-messages":t.formattedMessages,"show-messages":t.showMessages,"data-qa":t.dataQaGroupMessages}},"dt-validation-messages",t.messagesChildProps,!1))],2)},Ja=[],tr=o.normalizeComponent(Za,Xa,Ja,!1,null,null,null,null);const zt=tr.exports,Et={default:"",danger:"d-modal--danger"},Ot={default:"",full:"d-modal--full"},kt={error:"d-modal__banner--critical",info:"d-modal__banner--info",success:"d-modal__banner--success",warning:"d-modal__banner--warning",base:"d-modal__banner--general"},er={name:"DtModal",components:{DtLazyShow:o.DtLazyShow,DtButton:l.DtButton,DtIcon:l.DtIcon,SrOnlyCloseButton:u.SrOnlyCloseButton},mixins:[u.Modal,u.SrOnlyCloseButtonMixin],props:{closeButtonProps:{type:Object,required:!0,validator:e=>!!e.ariaLabel},copy:{type:String,default:""},describedById:{type:String,default:""},labelledById:{type:String,default:function(){return o.getUniqueString()}},show:{type:Boolean,default:!1},title:{type:String,default:""},bannerTitle:{type:String,default:""},kind:{type:String,default:"default",validator:e=>Object.keys(Et).includes(e)},size:{type:String,default:"default",validator:e=>Object.keys(Ot).includes(e)},modalClass:{type:[String,Object,Array],default:""},dialogClass:{type:[String,Object,Array],default:""},contentClass:{type:[String,Object,Array],default:""},bannerKind:{type:String,default:"warning",validate(e){return V.includes(e)}},bannerClass:{type:[String,Object,Array],default:""},hideClose:{type:Boolean,default:!1},closeOnClick:{type:Boolean,default:!0},fixedHeaderFooter:{type:Boolean,default:!0},initialFocusElement:{type:[String,HTMLElement],default:"first",validator:e=>e==="first"||e instanceof HTMLElement||e.startsWith("#")}},emits:["update:show"],data(){return{MODAL_KIND_MODIFIERS:Et,MODAL_SIZE_MODIFIERS:Ot,MODAL_BANNER_KINDS:kt,EVENT_KEYNAMES:o.EVENT_KEYNAMES}},computed:{modalListeners(){return{...this.$listeners,click:e=>{this.closeOnClick&&(e.target===e.currentTarget&&this.close(),this.$emit("click",e))},keydown:e=>{switch(e.code){case o.EVENT_KEYNAMES.esc:case o.EVENT_KEYNAMES.escape:this.close();break;case o.EVENT_KEYNAMES.tab:this.trapFocus(e);break}this.$emit("keydown",e)},"after-enter":e=>{this.$emit("update:show",!0),e.target===e.currentTarget&&this.setFocusAfterTransition()}}},open(){return`${!this.show}`},hasFooterSlot(){return!!this.$slots.footer},bannerKindClass(){return kt[this.bannerKind]}},watch:{show:{immediate:!0,handler(e){var t;e?this.previousActiveElement=document.activeElement:((t=this.previousActiveElement)==null||t.focus(),this.previousActiveElement=null)}},$props:{immediate:!0,deep:!0,handler(){this.validateProps()}}},methods:{close(){this.$emit("update:show",!1)},setFocusAfterTransition(){this.initialFocusElement==="first"?this.focusFirstElement():this.initialFocusElement.startsWith("#")?this.focusElementById(this.initialFocusElement):this.initialFocusElement instanceof HTMLElement&&this.initialFocusElement.focus()},trapFocus(e){this.show&&this.focusTrappedTabPress(e)},validateProps(){this.hideClose&&!this.visuallyHiddenClose&&console.error(`If hideClose prop is true, visuallyHiddenClose and visuallyHiddenCloseLabel props
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { S as De, c as A, M as Z, d as Xt, e as fe, f as Zt, D as J, L as we, P as he, g as Jt, h as ea, i as Oe, j as ta, k as pe, l as aa, a as na, R as ra, b as sa } from "./rich_text_editor-
|
|
2
|
-
import { q as tu, r as au, p as nu, m as ru, n as su, o as iu, A as ou, C as lu, E as du, y as cu, s as uu, x as fu, t as hu, v as pu, u as mu, w as gu, z as _u, B as bu } from "./rich_text_editor-
|
|
3
|
-
import { w as y, t as S, F as ia, M as oa, G as la, H as W, J as Ct, K as St, N as kt, O as It, P as Le, x as xt, D as da } from "./index-
|
|
4
|
-
import { W as yu, S as wu, R as Cu, Q as Su, T as ku, a1 as Iu, a4 as xu, a3 as Tu, a2 as Du, z as Ou, y as Lu, U as $u, I as Eu, Y as Au, X as Mu, V as Ru, C as Bu, L as Pu, a9 as Nu, a5 as Fu, a6 as qu, a8 as Hu, a7 as Wu, a0 as Vu, $ as Uu, Z as ju, _ as Yu } from "./index-
|
|
5
|
-
import { n as c, u as O, g as T, c as $e, E as C, f as Qe, T as ca, j as Xe, k as ke, L as ua, m as fa, D as ee, s as Ee, o as ha } from "./tooltip-
|
|
6
|
-
import { q as zu, p as Gu, x as Qu, v as Xu, w as Zu, V as Ju, r as ef } from "./tooltip-
|
|
1
|
+
import { S as De, c as A, M as Z, d as Xt, e as fe, f as Zt, D as J, L as we, P as he, g as Jt, h as ea, i as Oe, j as ta, k as pe, l as aa, a as na, R as ra, b as sa } from "./rich_text_editor-C4iSjnMg.js";
|
|
2
|
+
import { q as tu, r as au, p as nu, m as ru, n as su, o as iu, A as ou, C as lu, E as du, y as cu, s as uu, x as fu, t as hu, v as pu, u as mu, w as gu, z as _u, B as bu } from "./rich_text_editor-C4iSjnMg.js";
|
|
3
|
+
import { w as y, t as S, F as ia, M as oa, G as la, H as W, J as Ct, K as St, N as kt, O as It, P as Le, x as xt, D as da } from "./index-Fb937CbY.js";
|
|
4
|
+
import { W as yu, S as wu, R as Cu, Q as Su, T as ku, a1 as Iu, a4 as xu, a3 as Tu, a2 as Du, z as Ou, y as Lu, U as $u, I as Eu, Y as Au, X as Mu, V as Ru, C as Bu, L as Pu, a9 as Nu, a5 as Fu, a6 as qu, a8 as Hu, a7 as Wu, a0 as Vu, $ as Uu, Z as ju, _ as Yu } from "./index-Fb937CbY.js";
|
|
5
|
+
import { n as c, u as O, g as T, c as $e, E as C, f as Qe, T as ca, j as Xe, k as ke, L as ua, m as fa, D as ee, s as Ee, o as ha } from "./tooltip-ZAaMbL96.js";
|
|
6
|
+
import { q as zu, p as Gu, x as Qu, v as Xu, w as Zu, V as Ju, r as ef } from "./tooltip-ZAaMbL96.js";
|
|
7
7
|
import me, { reactive as pa } from "vue";
|
|
8
|
-
import { D as Ae } from "./emoji_text_wrapper-
|
|
8
|
+
import { D as Ae } from "./emoji_text_wrapper-FIY8SE_T.js";
|
|
9
9
|
const Ze = {
|
|
10
10
|
default: "",
|
|
11
11
|
info: "d-badge--info",
|
package/dist/vue2/directives.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./tooltip-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./tooltip-SCB4w509.cjs");require("vue");const u={name:"dt-tooltip-directive",install(l){const p=document.createElement("div");document.body.appendChild(p);const n="top",r=new l({name:"DtTooltipDirectiveApp",components:{DtTooltip:i.DtTooltip},data(){return{tooltips:[]}},methods:{addTooltip(t,o,e){this.tooltips.push({id:t,message:o,placement:e})},removeTooltip(t){this.tooltips=this.tooltips.filter(o=>o.id!==t)}},render(t){return t("div",{domProps:{id:"dt-tooltip-directive-app"}},[this.tooltips.map(({id:o,message:e,placement:d})=>t(i.DtTooltip,{key:o,props:{message:e,placement:d,delay:process.env.NODE_ENV!=="test",externalAnchor:`[data-dt-tooltip-id="${o}"]`}}))])}});r.$mount(p);const s=t=>typeof t=="string"&&(t==null?void 0:t.trim()),a=t=>t===void 0||i.TOOLTIP_DIRECTIONS.includes(t);l.directive("dt-tooltip",{bind(t,o){if(!s(o.value)){console.warn("Missing value for v-dt-tooltip directive on: ",t,"received value: ",o.value);return}if(!a(o.arg)){console.warn("Wrong placement value provided for v-dt-tooltip directive on: ",t,"received value: ",o.arg);return}const e=i.getUniqueString(),d=o.value,c=o.arg||n;t.setAttribute("data-dt-tooltip-id",e),r.addTooltip(e,d,c)},unbind(t){r.removeTooltip(t.getAttribute("data-dt-tooltip-id"))}})}};exports.DtTooltipDirective=u;
|
package/dist/vue2/directives.js
CHANGED
package/dist/vue2/emoji.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-Ay3JqEew.cjs"),t=require("./emoji_text_wrapper-L5BvowDe.cjs"),o=require("./emoji_picker-Bqtgrc_-.cjs");require("./tooltip-SCB4w509.cjs");require("vue");exports.DtEmoji=e.DtEmoji;exports.codeToEmojiData=e.codeToEmojiData;Object.defineProperty(exports,"customEmojiAssetUrl",{enumerable:!0,get:()=>e.customEmojiAssetUrl});exports.defaultEmojiAssetUrl=e.defaultEmojiAssetUrl;Object.defineProperty(exports,"emojiFileExtensionLarge",{enumerable:!0,get:()=>e.emojiFileExtensionLarge});Object.defineProperty(exports,"emojiFileExtensionSmall",{enumerable:!0,get:()=>e.emojiFileExtensionSmall});Object.defineProperty(exports,"emojiImageUrlLarge",{enumerable:!0,get:()=>e.emojiImageUrlLarge});Object.defineProperty(exports,"emojiImageUrlSmall",{enumerable:!0,get:()=>e.emojiImageUrlSmall});exports.emojiJson=e.emojiJson;exports.emojiVersion=e.emojiVersion;exports.filterValidShortCodes=e.filterValidShortCodes;exports.findEmojis=e.findEmojis;exports.findShortCodes=e.findShortCodes;exports.getEmojiData=e.getEmojiData;exports.setCustomEmojiJson=e.setCustomEmojiJson;exports.setCustomEmojiUrl=e.setCustomEmojiUrl;exports.setEmojiAssetUrlLarge=e.setEmojiAssetUrlLarge;exports.setEmojiAssetUrlSmall=e.setEmojiAssetUrlSmall;exports.shortcodeToEmojiData=e.shortcodeToEmojiData;exports.stringToUnicode=e.stringToUnicode;exports.unicodeToString=e.unicodeToString;exports.validateCustomEmojiJson=e.validateCustomEmojiJson;exports.DtEmojiTextWrapper=t.DtEmojiTextWrapper;exports.CDN_URL=o.CDN_URL;exports.DtEmojiPicker=o.DtEmojiPicker;exports.EMOJIS_PER_ROW=o.EMOJIS_PER_ROW;exports.EMOJI_PICKER_CATEGORIES=o.EMOJI_PICKER_CATEGORIES;exports.EMOJI_PICKER_SKIN_TONE_MODIFIERS=o.EMOJI_PICKER_SKIN_TONE_MODIFIERS;
|
package/dist/vue2/emoji.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { D as i, o as m, c as t, d as r, g as E, b as j, f as l, a as n, h as d, e as D, q as I, r as C, p as S, i as g, l as U, k as _, j as f, s as p, m as c, n as u, u as O, v as R } from "./index-
|
|
2
|
-
import { D as x } from "./emoji_text_wrapper-
|
|
3
|
-
import { C as A, D as h, E as L, b as M, a as P } from "./emoji_picker-
|
|
4
|
-
import "./tooltip-
|
|
1
|
+
import { D as i, o as m, c as t, d as r, g as E, b as j, f as l, a as n, h as d, e as D, q as I, r as C, p as S, i as g, l as U, k as _, j as f, s as p, m as c, n as u, u as O, v as R } from "./index-Fb937CbY.js";
|
|
2
|
+
import { D as x } from "./emoji_text_wrapper-FIY8SE_T.js";
|
|
3
|
+
import { C as A, D as h, E as L, b as M, a as P } from "./emoji_picker-H8MCLDWD.js";
|
|
4
|
+
import "./tooltip-ZAaMbL96.js";
|
|
5
5
|
import "vue";
|
|
6
6
|
export {
|
|
7
7
|
A as CDN_URL,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const d=require("./index-Fi4GXrPf.cjs"),m=require("./tooltip-R7LTeOZf.cjs");require("vue");const b={name:"EmojiTabset",components:{DtTabGroup:d.DtTabGroup,DtTab:d.DtTab,DtIcon:d.DtIcon},props:{showRecentlyUsedTab:{type:Boolean,default:!1},scrollIntoTab:{type:Number,required:!0},isScrolling:{type:Boolean,default:!1},emojiFilter:{type:String,default:""},tabSetLabels:{type:Array,required:!0}},data(){return{selectedTab:"1",tabsetRef:[],TABS_DATA:[{label:u.MOST_RECENTLY_USED,icon:"clock"},{label:u.SMILEYS_AND_PEOPLE,icon:"satisfied"},{label:u.NATURE,icon:"living-thing"},{label:u.FOOD,icon:"food"},{label:u.ACTIVITY,icon:"object"},{label:u.TRAVEL,icon:"transportation"},{label:u.OBJECTS,icon:"lightbulb"},{label:u.SYMBOLS,icon:"heart"},{label:u.FLAGS,icon:"flag"}]}},computed:{tabs(){return(this.showRecentlyUsedTab?this.TABS_DATA:this.TABS_DATA.slice(1)).map((e,i)=>({...e,label:this.tabSetLabels[i],id:(i+1).toString(),panelId:(i+1).toString()}))},isSearching(){return this.emojiFilter.length>0}},watch:{scrollIntoTab:function(t){!this.isScrolling&&!this.isSearching&&(this.selectedTab=(t+1).toString())},isSearching:function(t){t&&(this.selectedTab=null)}},mounted(){this.$nextTick(()=>{this.setTabsetRef()})},methods:{selectTabset(t){this.isScrolling||(this.selectedTab=t),this.$emit("selected-tabset",t)},setTabsetRef(){this.tabs.forEach((t,e)=>{const i=`tabsetRef-${e}`;this.$refs[i]&&this.$set(this.tabsetRef,e,this.$refs[i][0].$el)})},focusTabset(){this.tabsetRef[0]&&this.tabsetRef[0].focus()},handleKeyDown(t,e){t.key==="Enter"&&(this.selectTabset(e),this.tabsetRef[e-1]&&this.tabsetRef[e-1].blur()),t.key==="Tab"&&(t.preventDefault(),t.shiftKey?this.$emit("focus-skin-selector"):this.$emit("focus-search-input")),t.key==="ArrowDown"&&this.$emit("focus-search-input")}}};var _=function(){var e=this,i=e._self._c;return i("div",{staticClass:"d-emoji-picker__tabset"},[i("dt-tab-group",{attrs:{"tab-list-class":"d-emoji-picker__tabset-list",selected:e.selectedTab},scopedSlots:e._u([{key:"tabs",fn:function(){return e._l(e.tabs,function(s,n){return i("dt-tab",{key:s.id,ref:`tabsetRef-${n}`,refInFor:!0,attrs:{id:s.id,"panel-id":s.panelId,label:s.label,"aria-controls":"d-emoji-picker-list",tabindex:n+1},on:{"!click":function(o){return o.stopPropagation(),e.selectTabset(s.id)},keydown:function(o){return e.handleKeyDown(o,s.id)}}},[i("dt-icon",{attrs:{size:"400",name:s.icon}})],1)})},proxy:!0}])})],1)},k=[],j=m.normalizeComponent(b,_,k,!1,null,null,null,null);const g=j.exports,y={name:"EmojiSearch",components:{DtInput:d.DtInput,DtIcon:d.DtIcon},props:{searchPlaceholderLabel:{type:String,required:!0},modelValue:{type:String,default:""}},mounted(){this.focusSearchInput()},methods:{updateModelValue(t){this.$emit("update:model-value",t)},focusEmojiSelector(){this.$emit("focus-emoji-selector")},focusTabset(){this.$emit("focus-tabset")},selectFirstEmoji(){this.$emit("select-first-emoji")},clearSearch(){this.$emit("update:model-value",""),this.focusSearchInput()},focusSearchInput(){this.$refs.searchInputRef.focus()}}};var R=function(){var e=this,i=e._self._c;return i("div",{staticClass:"d-emoji-picker__search d-emoji-picker__alignment"},[i("dt-input",{ref:"searchInputRef",attrs:{id:"searchInput",placeholder:e.searchPlaceholderLabel,value:e.modelValue},on:{input:e.updateModelValue,keydown:[function(s){return!s.type.indexOf("key")&&e._k(s.keyCode,"up",38,s.key,["Up","ArrowUp"])?null:e.focusTabset.apply(null,arguments)},function(s){return!s.type.indexOf("key")&&e._k(s.keyCode,"down",40,s.key,["Down","ArrowDown"])?null:(s.preventDefault(),e.focusEmojiSelector.apply(null,arguments))},function(s){return!s.type.indexOf("key")&&e._k(s.keyCode,"enter",13,s.key,"Enter")?null:e.selectFirstEmoji.apply(null,arguments)}]},scopedSlots:e._u([{key:"leftIcon",fn:function(){return[i("dt-icon",{attrs:{name:"search"}})]},proxy:!0},e.modelValue.length>0?{key:"rightIcon",fn:function(){return[i("button",{staticClass:"d-emoji-picker__search-button",on:{click:e.clearSearch,keydown:function(s){return!s.type.indexOf("key")&&e._k(s.keyCode,"enter",13,s.key,"Enter")?null:e.clearSearch.apply(null,arguments)}}},[i("dt-icon",{attrs:{name:"close"}})],1)]},proxy:!0}:null],null,!0)})],1)},S=[],E=m.normalizeComponent(y,R,S,!1,null,null,null,null);const $=E.exports,T={name:"EmojiSelector",props:{emojiFilter:{type:String,default:""},skinTone:{type:String,required:!0},tabSetLabels:{type:Array,required:!0},selectedTabset:{type:Object,required:!0},searchResultsLabel:{type:String,required:!0},searchNoResultsLabel:{type:String,required:!0},recentlyUsedEmojis:{type:Array,default:()=>[]}},data(){return{emojiRefs:[],emojiFilteredRefs:[],isFiltering:!1,hoverFirstEmoji:!0,fixedLabel:"",filteredEmojis:[],TABS_DATA:["Recently used","People","Nature","Food","Activity","Travel","Objects","Symbols","Flags"],tabLabelObserver:null}},computed:{currentEmojis(){return[...this.emojis[`People${this.skinTone}`]||[],...this.emojis.Nature||[],...this.emojis.Food||[],...this.emojis[`Activity${this.skinTone}`]||[],...this.emojis.Travel||[],...this.emojis[`Objects${this.skinTone}`]||[],...this.emojis.Symbols||[],...this.emojis.Flags||[]]},emojis(){return d.emojisGrouped},CDN_URL(){return p},tabLabels(){return this.recentlyUsedEmojis.length?this.tabSetLabels.map((t,e)=>({label:t,ref:this.$refs[`tabLabelRef-${e}`]})):this.tabSetLabels.slice(1).map((t,e)=>({label:t,ref:this.$refs[`tabLabelRef-${e}`]}))},tabs(){return this.recentlyUsedEmojis.length?this.TABS_DATA:this.TABS_DATA.slice(1)}},watch:{currentEmojis:{handler(){this.searchByNameAndKeywords()},immediate:!0},recentlyUsedEmojis:{handler(t){this.emojis["Recently used"]=t},immediate:!0},emojiFilter:{handler(t){this.resetScroll(),t?this.isFiltering=!0:(this.isFiltering=!1,this.$emit("highlighted-emoji",null)),this.debouncedSearch()}},selectedTabset:{handler(t){this.scrollToTab(t.tabId)},deep:!0}},created(){this.debouncedSearch=this.debounce(this.searchByNameAndKeywords,300)},mounted(){this.$nextTick(()=>{this.setupEmojiRefs(),this.setupFilteredRefs(),this.setupTabLabelRefs(),this.setTabLabelObserver()})},beforeDestroy(){this.tabLabelObserver&&this.tabLabelObserver.disconnect()},methods:{setupTabLabelRefs(){var t;(t=this.tabSetLabels)==null||t.forEach((e,i)=>{const s=`tabLabelRef-${i}`;this.$refs[s]&&this.$set(this.tabLabels,i,{label:e,ref:this.$refs[s]})})},setupFilteredRefs(){this.emojiFilteredRefs=[],this.filteredEmojis.forEach((t,e)=>{const i=`filteredEmoji-${e}`;this.$refs[i]&&this.setFilteredRef(this.$refs[i],e)})},setupEmojiRefs(){for(let t=0;t<this.tabs.length;t++){const e=`emojiRef-${t}`;this.$refs[e]&&this.$refs[e].forEach((i,s)=>{i&&this.setEmojiRef(i,t,s)})}},searchByNameAndKeywords(){const t=this.emojiFilter.toLowerCase();this.filteredEmojis=this.currentEmojis.filter(function(e){const i=e.name.toLowerCase().includes(t),s=e.keywords.some(function(n){return n.toLowerCase().includes(t)});return i||s}),this.$nextTick(function(){t&&(this.hoverEmoji(this.filteredEmojis[0],!0),this.setupFilteredRefs())})},debounce:function(t,e){e===void 0&&(e=300);let i;return function(){const s=[];let n=arguments.length;for(;n--;)s[n]=arguments[n];clearTimeout(i),i=setTimeout(function(){t.apply(void 0,s)},e)}},getImgSrc:function(t){return this.CDN_URL+t+".png"},handleImageError:function(t){t.target.parentNode.style.display="none"},scrollToTab:function(t,e){const i=this;e===void 0&&(e=!0);const n=i.tabLabels[t-1].ref[0];i.$nextTick(function(){const o=i.$refs.listRef,r=t==="1"?0:n.offsetTop-20;let l=!0,c=o.scrollTop;i.$emit("is-scrolling",!0),o.addEventListener("scroll",function(){if(l){const f=o.scrollTop;(c<f&&f>=r||c>f&&f<=r)&&(l=!1,i.$emit("is-scrolling",!1)),c=f}}),o.scrollTop=r,e&&i.focusEmoji(t-1,0)})},resetScroll:function(){const t=this.$refs.listRef;t.scrollTop=0},focusEmojiSelector:function(){this.focusEmoji(0,0)},hoverEmoji(t,e){e===void 0&&(e=!1),this.hoverFirstEmoji=e,this.$emit("highlighted-emoji",t)},setEmojiRef:function(t,e,i){this.emojiRefs[e]||this.$set(this.emojiRefs,e,[]),this.$set(this.emojiRefs[e],i,t)},setFilteredRef:function(t,e){this.$set(this.emojiFilteredRefs,e,t)},focusEmoji:function(t,e){var s;const i=this.isFiltering?(s=this.emojiFilteredRefs[e])==null?void 0:s[0]:this.emojiRefs[t]&&this.emojiRefs[t][e];return i?(i.focus(),!0):!1},handleKeyDown:function(t,e,i,s){var n,o;if(t.preventDefault(),t.key==="ArrowUp"){const r=i%a;if(e===0){const l=a-this.emojiRefs[this.emojiRefs.length-1].length%a,c=this.emojiRefs[this.emojiRefs.length-1].length+l-(a-r);this.focusEmoji(this.emojiRefs.length-1,c)||this.focusEmoji(this.emojiRefs.length-1,this.emojiRefs[this.emojiRefs.length-1].length-1);return}if(!this.focusEmoji(e,i-a)){const l=e-1<0?0:e-1,c=this.emojiRefs[l].length,f=c-c%a+r;this.focusEmoji(l,f)||this.focusEmoji(e-1,this.emojiRefs[e-1].length-1)}}if(t.key==="ArrowDown"&&!this.focusEmoji(e,i+a)){const r=i%a;(o=(n=this.emojiRefs)==null?void 0:n[e])!=null&&o[i+(a-r)]?this.focusEmoji(e,this.emojiRefs[e].length-1):this.focusEmoji(e+1,r)||this.focusEmoji(0,r)||this.focusEmoji(0,this.emojiRefs[0].length-1)}t.key==="ArrowLeft"&&this.handleHorizontalNavigation("left",e,i),t.key==="ArrowRight"&&this.handleHorizontalNavigation("right",e,i),t.key==="Tab"&&(this.focusEmoji(e+1,0)?this.scrollToTab(e+1+1,!1):this.$emit("focus-skin-selector")),t.key==="Tab"&&t.shiftKey&&(this.focusEmoji(e,0)&&e>0?this.scrollToTab(e,!0):(this.scrollToTab(1,!1),this.$emit("focus-search-input"))),t.key==="Enter"&&this.$emit("selected-emoji",s)},handleHorizontalNavigation:function(t,e,i){this.isFiltering?t==="left"?this.handleArrowLeftFiltered(e,i):t==="right"&&this.handleArrowRightFiltered(e,i):t==="left"?this.handleArrowLeft(e,i):t==="right"&&this.handleArrowRight(e,i)},handleArrowLeftFiltered:function(t,e){this.focusEmoji(0,e-1)||this.focusEmoji(0,this.emojiFilteredRefs.length-1)},handleArrowRightFiltered:function(t,e){this.focusEmoji(0,e+1)||this.focusEmoji(0,0)},handleArrowLeft:function(t,e){this.focusEmoji(t,e-1)||(this.emojiRefs[t-1]?this.focusEmoji(t-1,this.emojiRefs[t-1].length-1):this.focusEmoji(this.emojiRefs.length-1,this.emojiRefs[this.emojiRefs.length-1].length-1))},handleArrowRight:function(t,e){this.focusEmoji(t,e+1)||this.focusEmoji(t+1,0)||this.focusEmoji(0,0)},handleKeyDownFilteredEmojis(t,e,i){var s;if(t.preventDefault(),this.hoverFirstEmoji=!1,t.key==="ArrowUp"){const n=e%a;if(!this.focusEmoji(0,e-a)){const o=this.emojiFilteredRefs.length-this.emojiFilteredRefs.length%a+n;this.focusEmoji(0,o),this.focusEmoji(0,o)||this.focusEmoji(0,this.emojiFilteredRefs.length-1)}}if(t.key==="ArrowDown"&&!this.focusEmoji(0,e+a)){const n=e%a;(s=this.emojiFilteredRefs)!=null&&s[e+(a-n)]?this.focusEmoji(0,this.emojiFilteredRefs.length-1):this.focusEmoji(0,n)}t.key==="ArrowLeft"&&this.handleHorizontalNavigation("left",0,e),t.key==="ArrowRight"&&this.handleHorizontalNavigation("right",0,e),t.key==="Tab"&&this.$emit("focus-skin-selector"),t.key==="Enter"&&this.$emit("selected-emoji",i)},setTabLabelObserver(){this.tabLabelObserver=new IntersectionObserver(t=>{t.forEach(e=>{var n,o,r,l,c,f;const{target:i}=e,s=parseInt(i.dataset.index);e.isIntersecting&&i.offsetTop<=((n=this.$refs.tabCategoryRef)==null?void 0:n.offsetTop)+50?(this.fixedLabel=((o=this.tabLabels[s-1])==null?void 0:o.label)??((r=this.tabLabels[0])==null?void 0:r.label),this.$emit("scroll-into-tab",s-1)):e.boundingClientRect.bottom<=((l=this.$refs.tabCategoryRef)==null?void 0:l.getBoundingClientRect().bottom)?(this.$emit("scroll-into-tab",s),this.fixedLabel=(c=this.tabLabels[s])==null?void 0:c.label):s===1&&(this.$emit("scroll-into-tab",s),this.fixedLabel=(f=this.tabLabels[0])==null?void 0:f.label)})}),this.tabLabelObserver.observe(this.$refs.tabCategoryRef),Array.from(this.$refs.listRef.children).forEach((t,e)=>{this.tabLabelObserver.observe(t),t.dataset.index=e})},focusLastEmoji(){this.focusEmoji(this.tabs.length-1,0)}}};var v=function(){var e=this,i=e._self._c;return i("div",{staticClass:"d-emoji-picker__selector"},[i("div",{ref:"listRef",staticClass:"d-emoji-picker__list",attrs:{id:"d-emoji-picker-list"}},[e.emojiFilter?i("p",{staticClass:"d-emoji-picker__search-label d-emoji-picker__alignment"},[e._v(" "+e._s(e.filteredEmojis.length>0?e.searchResultsLabel:e.searchNoResultsLabel)+" ")]):i("div",{ref:"tabCategoryRef",staticClass:"d-emoji-picker__category d-emoji-picker__alignment"},[i("p",[e._v(" "+e._s(e.fixedLabel)+" ")])]),e._l(e.tabLabels,function(s,n){return i("div",{directives:[{name:"show",rawName:"v-show",value:!e.emojiFilter,expression:"!emojiFilter"}],key:n,ref:`tabLabelRef-${n}`,refInFor:!0,staticClass:"d-emoji-picker__alignment"},[n?i("p",[e._v(" "+e._s(s.label)+" ")]):e._e(),i("div",{staticClass:"d-emoji-picker__tab"},e._l(e.emojis[e.tabs[n]+e.skinTone]?e.emojis[e.tabs[n]+e.skinTone]:e.emojis[e.tabs[n]],function(o,r){return i("button",{key:o.shortname,ref:`emojiRef-${n}`,refInFor:!0,attrs:{type:"button","aria-label":o.name},on:{click:function(l){return e.$emit("selected-emoji",o)},focusin:function(l){return e.$emit("highlighted-emoji",o)},focusout:function(l){return e.$emit("highlighted-emoji",null)},mouseover:function(l){return e.$emit("highlighted-emoji",o)},mouseleave:function(l){return e.$emit("highlighted-emoji",null)},keydown:l=>e.handleKeyDown(l,n,r,o)}},[i("img",{staticClass:"d-icon d-icon--size-500",attrs:{alt:o.name,"aria-label":o.name,title:o.name,src:e.getImgSrc(o.unicode_character)},on:{error:e.handleImageError}})])}),0)])}),e.emojiFilter?i("div",{staticClass:"d-emoji-picker__alignment"},[i("div",{staticClass:"d-emoji-picker__tab",attrs:{"data-qa":"filtered-emojis"}},e._l(e.filteredEmojis,function(s,n){return i("button",{key:s.shortname,ref:`filteredEmoji-${n}`,refInFor:!0,class:{"hover-emoji":n===0&&e.hoverFirstEmoji},attrs:{type:"button","aria-label":s.name},on:{click:function(o){return e.$emit("selected-emoji",s)},focusin:function(o){return e.$emit("highlighted-emoji",s)},focusout:function(o){return e.$emit("highlighted-emoji",null)},mouseover:function(o){return e.hoverEmoji(s)},mouseleave:function(o){return e.hoverEmoji(null)},keydown:o=>e.handleKeyDownFilteredEmojis(o,n,s)}},[i("img",{staticClass:"d-icon d-icon--size-500",attrs:{alt:s.name,"aria-label":s.name,title:s.name,src:`${e.CDN_URL+s.unicode_character}.png`}})])}),0)]):e._e()],2)])},L=[],w=m.normalizeComponent(T,v,L,!1,null,null,null,null);const I=w.exports,p="https://static.dialpadcdn.com/joypixels/png/unicode/32/",a=9,h={DEFAULT:"Default",LIGHT:"Light",MEDIUM_LIGHT:"MediumLight",MEDIUM:"Medium",MEDIUM_DARK:"MediumDark",DARK:"Dark"},u={MOST_RECENTLY_USED:"Most recently used",SMILEYS_AND_PEOPLE:"Smileys and people",NATURE:"Nature",FOOD:"Food",ACTIVITY:"Activity",TRAVEL:"Travel",OBJECTS:"Objects",SYMBOLS:"Symbols",FLAGS:"Flags"},D={name:"EmojiDescription",props:{emoji:{type:Object,default:()=>null}},data(){return{CDN_URL:p}}};var C=function(){var s;var e=this,i=e._self._c;return i("div",{staticClass:"d-emoji-picker__data"},[e.emoji?i("img",{staticClass:"d-icon d-icon--size-500",attrs:{alt:e.emoji.name,"aria-label":e.emoji.name,title:e.emoji.name,src:`${e.CDN_URL+e.emoji.unicode_character}.png`}}):e._e(),e._v(" "+e._s((s=e.emoji)==null?void 0:s.name)+" ")])},A=[],F=m.normalizeComponent(D,C,A,!1,null,null,null,null);const O=F.exports,N={name:"EmojiSkinSelector",components:{DtTooltip:m.DtTooltip},props:{skinTone:{type:String,required:!0},isHovering:{type:Boolean,default:!1},skinSelectorButtonTooltipLabel:{type:String,required:!0}},data(){return{isOpen:!1,skinSelected:null,skinsRef:[],cdnUrl:p}},computed:{skinPassedIn(){return this.skinList.find(t=>t.skinTone===this.skinTone)},skinList(){return[{name:":wave_tone1:",unicode_output:"1f44b-1f3fb",skinTone:h.LIGHT,skinCode:"_tone1"},{name:":wave_tone2:",unicode_output:"1f44b-1f3fc",skinTone:h.MEDIUM_LIGHT,skinCode:"_tone2"},{name:":wave_tone3:",unicode_output:"1f44b-1f3fd",skinTone:h.MEDIUM,skinCode:"_tone3"},{name:":wave_tone4:",unicode_output:"1f44b-1f3fe",skinTone:h.MEDIUM_DARK,skinCode:"_tone4"},{name:":wave_tone5:",unicode_output:"1f44b-1f3ff",skinTone:h.DARK,skinCode:"_tone5"},{name:":wave:",unicode_output:"1f44b",skinTone:h.DEFAULT,skinCode:""}]}},watch:{isHovering(t){t&&(this.isOpen=!1)},skinTone(t,e){t!==e&&(this.skinSelected=this.skinPassedIn)}},mounted(){this.skinSelected=this.skinPassedIn,this.$nextTick(()=>{this.setupSkinRefs()})},methods:{setupSkinRefs(){this.skinList.forEach((t,e)=>{const i=`skinRef-${e}`;this.$refs[i]&&this.$set(this.skinsRef,e,this.$refs[i][0])})},focusSkinSelector(){this.$refs.skinSelectorRef&&this.$refs.skinSelectorRef.focus()},selectSkin(t){this.skinSelected=t,this.isOpen=!1,this.$emit("skin-tone",t.skinTone),this.$nextTick(()=>{this.focusSkinSelector()})},handleKeyDown(t,e,i){var s,n,o,r;t.preventDefault(),t.key==="ArrowLeft"&&(i===0&&((s=this.skinsRef[this.skinsRef.length-1])==null||s.focus()),(n=this.skinsRef[i-1])==null||n.focus()),t.key==="ArrowRight"&&(this.skinsRef.length&&((o=this.skinsRef[0])==null||o.focus()),(r=this.skinsRef[i+1])==null||r.focus()),t.key==="Enter"&&(e?this.selectSkin(e):this.toggleSkinList()),t.key==="Tab"&&(t.shiftKey?this.$emit("focus-last-emoji"):this.$emit("focus-tabset"))},toggleSkinList(){this.isOpen=!this.isOpen,this.$nextTick(()=>{this.skinsRef[0]&&this.skinsRef[0].focus()})}}};var U=function(){var e=this,i=e._self._c;return i("div",{attrs:{"data-qa":"skin-selector"}},[i("div",{directives:[{name:"show",rawName:"v-show",value:e.isOpen,expression:"isOpen"}],staticClass:"d-emoji-picker__skin-list"},e._l(e.skinList,function(s,n){var o;return i("button",{key:s.name,ref:`skinRef-${n}`,refInFor:!0,class:{selected:((o=e.skinSelected)==null?void 0:o.skinCode)===s.skinCode},on:{click:function(r){return e.selectSkin(s)},keydown:r=>e.handleKeyDown(r,s,n)}},[i("img",{staticClass:"d-icon d-icon--size-500",attrs:{alt:s.name,"aria-label":s.name,title:s.name,src:`${e.cdnUrl+s.unicode_output}.png`}})])}),0),i("div",{directives:[{name:"show",rawName:"v-show",value:!e.isOpen,expression:"!isOpen"}],staticClass:"d-emoji-picker__skin-selected"},[i("dt-tooltip",{attrs:{placement:"top-end"},scopedSlots:e._u([{key:"anchor",fn:function(){var s,n,o,r;return[i("button",{ref:"skinSelectorRef",attrs:{"aria-label":e.skinSelectorButtonTooltipLabel,tabindex:"-1"},on:{click:e.toggleSkinList,keydown:l=>e.handleKeyDown(l)}},[i("img",{staticClass:"d-icon d-icon--size-500",attrs:{alt:(s=e.skinSelected)==null?void 0:s.name,"aria-label":(n=e.skinSelected)==null?void 0:n.name,title:(o=e.skinSelected)==null?void 0:o.name,src:`${e.cdnUrl+((r=e.skinSelected)==null?void 0:r.unicode_output)}.png`}})])]},proxy:!0}])},[e._v(" "+e._s(e.skinSelectorButtonTooltipLabel)+" ")])],1)])},M=[],K=m.normalizeComponent(N,U,M,!1,null,null,null,null);const P=K.exports,B={name:"DtEmojiPicker",components:{EmojiTabset:g,EmojiSearch:$,EmojiSelector:I,EmojiDescription:O,EmojiSkinSelector:P},props:{recentlyUsedEmojis:{type:Array},searchPlaceholderLabel:{type:String,required:!0},searchResultsLabel:{type:String,required:!0},searchNoResultsLabel:{type:String,required:!0},tabSetLabels:{type:Array,required:!0},skinTone:{type:String},skinSelectorButtonTooltipLabel:{type:String,required:!0}},data(){return{searchQuery:"",highlightedEmoji:null,selectedTabset:{},scrollIntoTab:0,isScrolling:!1}},computed:{showRecentlyUsedTab(){var t;return((t=this.recentlyUsedEmojis)==null?void 0:t.length)>0}},methods:{scrollToSelectedTabset(t){this.searchQuery="",this.selectedTabset={...this.selectedTabset,tabId:t}},updateScrollIntoTab(t){this.scrollIntoTab=t},updateIsScrolling(t){this.isScrolling=t},updateHighlightedEmoji(t){this.highlightedEmoji=t}}};var q=function(){var e=this,i=e._self._c;return i("div",{staticClass:"d-emoji-picker"},[i("div",{staticClass:"d-emoji-picker--header"},[i("emoji-tabset",{ref:"tabsetRef",attrs:{"emoji-filter":e.searchQuery,"show-recently-used-tab":e.showRecentlyUsedTab,"scroll-into-tab":e.scrollIntoTab,"tab-set-labels":e.tabSetLabels,"is-scrolling":e.isScrolling},on:{"focus-search-input":function(s){return e.$refs.searchInputRef.focusSearchInput()},"focus-skin-selector":function(s){return e.$refs.skinSelectorRef.focusSkinSelector()},"selected-tabset":e.scrollToSelectedTabset},nativeOn:{keydown:function(s){return!s.type.indexOf("key")&&e._k(s.keyCode,"esc",27,s.key,["Esc","Escape"])?null:e.$emit("close")}}})],1),i("div",{staticClass:"d-emoji-picker--body"},[i("emoji-search",{ref:"searchInputRef",attrs:{"model-value":e.searchQuery,"search-placeholder-label":e.searchPlaceholderLabel},on:{"update:model-value":s=>e.searchQuery=s,"select-first-emoji":function(s){return e.$emit("selected-emoji",e.highlightedEmoji)},"focus-tabset":function(s){return e.$refs.tabsetRef.focusTabset()},"focus-emoji-selector":function(s){return e.$refs.emojiSelectorRef.focusEmojiSelector()}},nativeOn:{keydown:function(s){return!s.type.indexOf("key")&&e._k(s.keyCode,"esc",27,s.key,["Esc","Escape"])?null:e.$emit("close")}}}),i("emoji-selector",{ref:"emojiSelectorRef",attrs:{"emoji-filter":e.searchQuery,"skin-tone":e.skinTone,"tab-set-labels":e.tabSetLabels,"search-results-label":e.searchResultsLabel,"search-no-results-label":e.searchNoResultsLabel,"recently-used-emojis":e.recentlyUsedEmojis,"selected-tabset":e.selectedTabset},on:{"scroll-into-tab":e.updateScrollIntoTab,"is-scrolling":e.updateIsScrolling,"highlighted-emoji":e.updateHighlightedEmoji,"selected-emoji":function(s){return e.$emit("selected-emoji",s)},"focus-skin-selector":function(s){return e.$refs.skinSelectorRef.focusSkinSelector()},"focus-search-input":function(s){return e.$refs.searchInputRef.focusSearchInput()}},nativeOn:{keydown:function(s){return!s.type.indexOf("key")&&e._k(s.keyCode,"esc",27,s.key,["Esc","Escape"])?null:e.$emit("close")}}})],1),i("div",{staticClass:"d-emoji-picker--footer"},[i("emoji-description",{attrs:{emoji:e.highlightedEmoji}}),i("emoji-skin-selector",{ref:"skinSelectorRef",attrs:{"is-hovering":!!e.highlightedEmoji,"skin-selector-button-tooltip-label":e.skinSelectorButtonTooltipLabel,"skin-tone":e.skinTone},on:{"skin-tone":function(s){return e.$emit("skin-tone",s)},"focus-tabset":function(s){return e.$refs.tabsetRef.focusTabset()},"focus-last-emoji":function(s){return e.$refs.emojiSelectorRef.focusLastEmoji()}},nativeOn:{keydown:function(s){return!s.type.indexOf("key")&&e._k(s.keyCode,"esc",27,s.key,["Esc","Escape"])?null:e.$emit("close")}}})],1)])},z=[],H=m.normalizeComponent(B,q,z,!1,null,null,null,null);const G=H.exports;exports.CDN_URL=p;exports.DtEmojiPicker=G;exports.EMOJIS_PER_ROW=a;exports.EMOJI_PICKER_CATEGORIES=u;exports.EMOJI_PICKER_SKIN_TONE_MODIFIERS=h;
|
|
1
|
+
"use strict";const d=require("./index-Ay3JqEew.cjs"),m=require("./tooltip-SCB4w509.cjs");require("vue");const b={name:"EmojiTabset",components:{DtTabGroup:d.DtTabGroup,DtTab:d.DtTab,DtIcon:d.DtIcon},props:{showRecentlyUsedTab:{type:Boolean,default:!1},scrollIntoTab:{type:Number,required:!0},isScrolling:{type:Boolean,default:!1},emojiFilter:{type:String,default:""},tabSetLabels:{type:Array,required:!0}},data(){return{selectedTab:"1",tabsetRef:[],TABS_DATA:[{label:u.MOST_RECENTLY_USED,icon:"clock"},{label:u.SMILEYS_AND_PEOPLE,icon:"satisfied"},{label:u.NATURE,icon:"living-thing"},{label:u.FOOD,icon:"food"},{label:u.ACTIVITY,icon:"object"},{label:u.TRAVEL,icon:"transportation"},{label:u.OBJECTS,icon:"lightbulb"},{label:u.SYMBOLS,icon:"heart"},{label:u.FLAGS,icon:"flag"}]}},computed:{tabs(){return(this.showRecentlyUsedTab?this.TABS_DATA:this.TABS_DATA.slice(1)).map((e,i)=>({...e,label:this.tabSetLabels[i],id:(i+1).toString(),panelId:(i+1).toString()}))},isSearching(){return this.emojiFilter.length>0}},watch:{scrollIntoTab:function(t){!this.isScrolling&&!this.isSearching&&(this.selectedTab=(t+1).toString())},isSearching:function(t){t&&(this.selectedTab=null)}},mounted(){this.$nextTick(()=>{this.setTabsetRef()})},methods:{selectTabset(t){this.isScrolling||(this.selectedTab=t),this.$emit("selected-tabset",t)},setTabsetRef(){this.tabs.forEach((t,e)=>{const i=`tabsetRef-${e}`;this.$refs[i]&&this.$set(this.tabsetRef,e,this.$refs[i][0].$el)})},focusTabset(){this.tabsetRef[0]&&this.tabsetRef[0].focus()},handleKeyDown(t,e){t.key==="Enter"&&(this.selectTabset(e),this.tabsetRef[e-1]&&this.tabsetRef[e-1].blur()),t.key==="Tab"&&(t.preventDefault(),t.shiftKey?this.$emit("focus-skin-selector"):this.$emit("focus-search-input")),t.key==="ArrowDown"&&this.$emit("focus-search-input")}}};var _=function(){var e=this,i=e._self._c;return i("div",{staticClass:"d-emoji-picker__tabset"},[i("dt-tab-group",{attrs:{"tab-list-class":"d-emoji-picker__tabset-list",selected:e.selectedTab},scopedSlots:e._u([{key:"tabs",fn:function(){return e._l(e.tabs,function(s,n){return i("dt-tab",{key:s.id,ref:`tabsetRef-${n}`,refInFor:!0,attrs:{id:s.id,"panel-id":s.panelId,label:s.label,"aria-controls":"d-emoji-picker-list",tabindex:n+1},on:{"!click":function(o){return o.stopPropagation(),e.selectTabset(s.id)},keydown:function(o){return e.handleKeyDown(o,s.id)}}},[i("dt-icon",{attrs:{size:"400",name:s.icon}})],1)})},proxy:!0}])})],1)},k=[],j=m.normalizeComponent(b,_,k,!1,null,null,null,null);const g=j.exports,y={name:"EmojiSearch",components:{DtInput:d.DtInput,DtIcon:d.DtIcon},props:{searchPlaceholderLabel:{type:String,required:!0},modelValue:{type:String,default:""}},mounted(){this.focusSearchInput()},methods:{updateModelValue(t){this.$emit("update:model-value",t)},focusEmojiSelector(){this.$emit("focus-emoji-selector")},focusTabset(){this.$emit("focus-tabset")},selectFirstEmoji(){this.$emit("select-first-emoji")},clearSearch(){this.$emit("update:model-value",""),this.focusSearchInput()},focusSearchInput(){this.$refs.searchInputRef.focus()}}};var R=function(){var e=this,i=e._self._c;return i("div",{staticClass:"d-emoji-picker__search d-emoji-picker__alignment"},[i("dt-input",{ref:"searchInputRef",attrs:{id:"searchInput",placeholder:e.searchPlaceholderLabel,value:e.modelValue},on:{input:e.updateModelValue,keydown:[function(s){return!s.type.indexOf("key")&&e._k(s.keyCode,"up",38,s.key,["Up","ArrowUp"])?null:e.focusTabset.apply(null,arguments)},function(s){return!s.type.indexOf("key")&&e._k(s.keyCode,"down",40,s.key,["Down","ArrowDown"])?null:(s.preventDefault(),e.focusEmojiSelector.apply(null,arguments))},function(s){return!s.type.indexOf("key")&&e._k(s.keyCode,"enter",13,s.key,"Enter")?null:e.selectFirstEmoji.apply(null,arguments)}]},scopedSlots:e._u([{key:"leftIcon",fn:function(){return[i("dt-icon",{attrs:{name:"search"}})]},proxy:!0},e.modelValue.length>0?{key:"rightIcon",fn:function(){return[i("button",{staticClass:"d-emoji-picker__search-button",on:{click:e.clearSearch,keydown:function(s){return!s.type.indexOf("key")&&e._k(s.keyCode,"enter",13,s.key,"Enter")?null:e.clearSearch.apply(null,arguments)}}},[i("dt-icon",{attrs:{name:"close"}})],1)]},proxy:!0}:null],null,!0)})],1)},S=[],E=m.normalizeComponent(y,R,S,!1,null,null,null,null);const $=E.exports,T={name:"EmojiSelector",props:{emojiFilter:{type:String,default:""},skinTone:{type:String,required:!0},tabSetLabels:{type:Array,required:!0},selectedTabset:{type:Object,required:!0},searchResultsLabel:{type:String,required:!0},searchNoResultsLabel:{type:String,required:!0},recentlyUsedEmojis:{type:Array,default:()=>[]}},data(){return{emojiRefs:[],emojiFilteredRefs:[],isFiltering:!1,hoverFirstEmoji:!0,fixedLabel:"",filteredEmojis:[],TABS_DATA:["Recently used","People","Nature","Food","Activity","Travel","Objects","Symbols","Flags"],tabLabelObserver:null}},computed:{currentEmojis(){return[...this.emojis[`People${this.skinTone}`]||[],...this.emojis.Nature||[],...this.emojis.Food||[],...this.emojis[`Activity${this.skinTone}`]||[],...this.emojis.Travel||[],...this.emojis[`Objects${this.skinTone}`]||[],...this.emojis.Symbols||[],...this.emojis.Flags||[]]},emojis(){return d.emojisGrouped},CDN_URL(){return p},tabLabels(){return this.recentlyUsedEmojis.length?this.tabSetLabels.map((t,e)=>({label:t,ref:this.$refs[`tabLabelRef-${e}`]})):this.tabSetLabels.slice(1).map((t,e)=>({label:t,ref:this.$refs[`tabLabelRef-${e}`]}))},tabs(){return this.recentlyUsedEmojis.length?this.TABS_DATA:this.TABS_DATA.slice(1)}},watch:{currentEmojis:{handler(){this.searchByNameAndKeywords()},immediate:!0},recentlyUsedEmojis:{handler(t){this.emojis["Recently used"]=t},immediate:!0},emojiFilter:{handler(t){this.resetScroll(),t?this.isFiltering=!0:(this.isFiltering=!1,this.$emit("highlighted-emoji",null)),this.debouncedSearch()}},selectedTabset:{handler(t){this.scrollToTab(t.tabId)},deep:!0}},created(){this.debouncedSearch=this.debounce(this.searchByNameAndKeywords,300)},mounted(){this.$nextTick(()=>{this.setupEmojiRefs(),this.setupFilteredRefs(),this.setupTabLabelRefs(),this.setTabLabelObserver()})},beforeDestroy(){this.tabLabelObserver&&this.tabLabelObserver.disconnect()},methods:{setupTabLabelRefs(){var t;(t=this.tabSetLabels)==null||t.forEach((e,i)=>{const s=`tabLabelRef-${i}`;this.$refs[s]&&this.$set(this.tabLabels,i,{label:e,ref:this.$refs[s]})})},setupFilteredRefs(){this.emojiFilteredRefs=[],this.filteredEmojis.forEach((t,e)=>{const i=`filteredEmoji-${e}`;this.$refs[i]&&this.setFilteredRef(this.$refs[i],e)})},setupEmojiRefs(){for(let t=0;t<this.tabs.length;t++){const e=`emojiRef-${t}`;this.$refs[e]&&this.$refs[e].forEach((i,s)=>{i&&this.setEmojiRef(i,t,s)})}},searchByNameAndKeywords(){const t=this.emojiFilter.toLowerCase();this.filteredEmojis=this.currentEmojis.filter(function(e){const i=e.name.toLowerCase().includes(t),s=e.keywords.some(function(n){return n.toLowerCase().includes(t)});return i||s}),this.$nextTick(function(){t&&(this.hoverEmoji(this.filteredEmojis[0],!0),this.setupFilteredRefs())})},debounce:function(t,e){e===void 0&&(e=300);let i;return function(){const s=[];let n=arguments.length;for(;n--;)s[n]=arguments[n];clearTimeout(i),i=setTimeout(function(){t.apply(void 0,s)},e)}},getImgSrc:function(t){return this.CDN_URL+t+".png"},handleImageError:function(t){t.target.parentNode.style.display="none"},scrollToTab:function(t,e){const i=this;e===void 0&&(e=!0);const n=i.tabLabels[t-1].ref[0];i.$nextTick(function(){const o=i.$refs.listRef,r=t==="1"?0:n.offsetTop-20;let l=!0,c=o.scrollTop;i.$emit("is-scrolling",!0),o.addEventListener("scroll",function(){if(l){const f=o.scrollTop;(c<f&&f>=r||c>f&&f<=r)&&(l=!1,i.$emit("is-scrolling",!1)),c=f}}),o.scrollTop=r,e&&i.focusEmoji(t-1,0)})},resetScroll:function(){const t=this.$refs.listRef;t.scrollTop=0},focusEmojiSelector:function(){this.focusEmoji(0,0)},hoverEmoji(t,e){e===void 0&&(e=!1),this.hoverFirstEmoji=e,this.$emit("highlighted-emoji",t)},setEmojiRef:function(t,e,i){this.emojiRefs[e]||this.$set(this.emojiRefs,e,[]),this.$set(this.emojiRefs[e],i,t)},setFilteredRef:function(t,e){this.$set(this.emojiFilteredRefs,e,t)},focusEmoji:function(t,e){var s;const i=this.isFiltering?(s=this.emojiFilteredRefs[e])==null?void 0:s[0]:this.emojiRefs[t]&&this.emojiRefs[t][e];return i?(i.focus(),!0):!1},handleKeyDown:function(t,e,i,s){var n,o;if(t.preventDefault(),t.key==="ArrowUp"){const r=i%a;if(e===0){const l=a-this.emojiRefs[this.emojiRefs.length-1].length%a,c=this.emojiRefs[this.emojiRefs.length-1].length+l-(a-r);this.focusEmoji(this.emojiRefs.length-1,c)||this.focusEmoji(this.emojiRefs.length-1,this.emojiRefs[this.emojiRefs.length-1].length-1);return}if(!this.focusEmoji(e,i-a)){const l=e-1<0?0:e-1,c=this.emojiRefs[l].length,f=c-c%a+r;this.focusEmoji(l,f)||this.focusEmoji(e-1,this.emojiRefs[e-1].length-1)}}if(t.key==="ArrowDown"&&!this.focusEmoji(e,i+a)){const r=i%a;(o=(n=this.emojiRefs)==null?void 0:n[e])!=null&&o[i+(a-r)]?this.focusEmoji(e,this.emojiRefs[e].length-1):this.focusEmoji(e+1,r)||this.focusEmoji(0,r)||this.focusEmoji(0,this.emojiRefs[0].length-1)}t.key==="ArrowLeft"&&this.handleHorizontalNavigation("left",e,i),t.key==="ArrowRight"&&this.handleHorizontalNavigation("right",e,i),t.key==="Tab"&&(this.focusEmoji(e+1,0)?this.scrollToTab(e+1+1,!1):this.$emit("focus-skin-selector")),t.key==="Tab"&&t.shiftKey&&(this.focusEmoji(e,0)&&e>0?this.scrollToTab(e,!0):(this.scrollToTab(1,!1),this.$emit("focus-search-input"))),t.key==="Enter"&&this.$emit("selected-emoji",s)},handleHorizontalNavigation:function(t,e,i){this.isFiltering?t==="left"?this.handleArrowLeftFiltered(e,i):t==="right"&&this.handleArrowRightFiltered(e,i):t==="left"?this.handleArrowLeft(e,i):t==="right"&&this.handleArrowRight(e,i)},handleArrowLeftFiltered:function(t,e){this.focusEmoji(0,e-1)||this.focusEmoji(0,this.emojiFilteredRefs.length-1)},handleArrowRightFiltered:function(t,e){this.focusEmoji(0,e+1)||this.focusEmoji(0,0)},handleArrowLeft:function(t,e){this.focusEmoji(t,e-1)||(this.emojiRefs[t-1]?this.focusEmoji(t-1,this.emojiRefs[t-1].length-1):this.focusEmoji(this.emojiRefs.length-1,this.emojiRefs[this.emojiRefs.length-1].length-1))},handleArrowRight:function(t,e){this.focusEmoji(t,e+1)||this.focusEmoji(t+1,0)||this.focusEmoji(0,0)},handleKeyDownFilteredEmojis(t,e,i){var s;if(t.preventDefault(),this.hoverFirstEmoji=!1,t.key==="ArrowUp"){const n=e%a;if(!this.focusEmoji(0,e-a)){const o=this.emojiFilteredRefs.length-this.emojiFilteredRefs.length%a+n;this.focusEmoji(0,o),this.focusEmoji(0,o)||this.focusEmoji(0,this.emojiFilteredRefs.length-1)}}if(t.key==="ArrowDown"&&!this.focusEmoji(0,e+a)){const n=e%a;(s=this.emojiFilteredRefs)!=null&&s[e+(a-n)]?this.focusEmoji(0,this.emojiFilteredRefs.length-1):this.focusEmoji(0,n)}t.key==="ArrowLeft"&&this.handleHorizontalNavigation("left",0,e),t.key==="ArrowRight"&&this.handleHorizontalNavigation("right",0,e),t.key==="Tab"&&this.$emit("focus-skin-selector"),t.key==="Enter"&&this.$emit("selected-emoji",i)},setTabLabelObserver(){this.tabLabelObserver=new IntersectionObserver(t=>{t.forEach(e=>{var n,o,r,l,c,f;const{target:i}=e,s=parseInt(i.dataset.index);e.isIntersecting&&i.offsetTop<=((n=this.$refs.tabCategoryRef)==null?void 0:n.offsetTop)+50?(this.fixedLabel=((o=this.tabLabels[s-1])==null?void 0:o.label)??((r=this.tabLabels[0])==null?void 0:r.label),this.$emit("scroll-into-tab",s-1)):e.boundingClientRect.bottom<=((l=this.$refs.tabCategoryRef)==null?void 0:l.getBoundingClientRect().bottom)?(this.$emit("scroll-into-tab",s),this.fixedLabel=(c=this.tabLabels[s])==null?void 0:c.label):s===1&&(this.$emit("scroll-into-tab",s),this.fixedLabel=(f=this.tabLabels[0])==null?void 0:f.label)})}),this.tabLabelObserver.observe(this.$refs.tabCategoryRef),Array.from(this.$refs.listRef.children).forEach((t,e)=>{this.tabLabelObserver.observe(t),t.dataset.index=e})},focusLastEmoji(){this.focusEmoji(this.tabs.length-1,0)}}};var v=function(){var e=this,i=e._self._c;return i("div",{staticClass:"d-emoji-picker__selector"},[i("div",{ref:"listRef",staticClass:"d-emoji-picker__list",attrs:{id:"d-emoji-picker-list"}},[e.emojiFilter?i("p",{staticClass:"d-emoji-picker__search-label d-emoji-picker__alignment"},[e._v(" "+e._s(e.filteredEmojis.length>0?e.searchResultsLabel:e.searchNoResultsLabel)+" ")]):i("div",{ref:"tabCategoryRef",staticClass:"d-emoji-picker__category d-emoji-picker__alignment"},[i("p",[e._v(" "+e._s(e.fixedLabel)+" ")])]),e._l(e.tabLabels,function(s,n){return i("div",{directives:[{name:"show",rawName:"v-show",value:!e.emojiFilter,expression:"!emojiFilter"}],key:n,ref:`tabLabelRef-${n}`,refInFor:!0,staticClass:"d-emoji-picker__alignment"},[n?i("p",[e._v(" "+e._s(s.label)+" ")]):e._e(),i("div",{staticClass:"d-emoji-picker__tab"},e._l(e.emojis[e.tabs[n]+e.skinTone]?e.emojis[e.tabs[n]+e.skinTone]:e.emojis[e.tabs[n]],function(o,r){return i("button",{key:o.shortname,ref:`emojiRef-${n}`,refInFor:!0,attrs:{type:"button","aria-label":o.name},on:{click:function(l){return e.$emit("selected-emoji",o)},focusin:function(l){return e.$emit("highlighted-emoji",o)},focusout:function(l){return e.$emit("highlighted-emoji",null)},mouseover:function(l){return e.$emit("highlighted-emoji",o)},mouseleave:function(l){return e.$emit("highlighted-emoji",null)},keydown:l=>e.handleKeyDown(l,n,r,o)}},[i("img",{staticClass:"d-icon d-icon--size-500",attrs:{alt:o.name,"aria-label":o.name,title:o.name,src:e.getImgSrc(o.unicode_character)},on:{error:e.handleImageError}})])}),0)])}),e.emojiFilter?i("div",{staticClass:"d-emoji-picker__alignment"},[i("div",{staticClass:"d-emoji-picker__tab",attrs:{"data-qa":"filtered-emojis"}},e._l(e.filteredEmojis,function(s,n){return i("button",{key:s.shortname,ref:`filteredEmoji-${n}`,refInFor:!0,class:{"hover-emoji":n===0&&e.hoverFirstEmoji},attrs:{type:"button","aria-label":s.name},on:{click:function(o){return e.$emit("selected-emoji",s)},focusin:function(o){return e.$emit("highlighted-emoji",s)},focusout:function(o){return e.$emit("highlighted-emoji",null)},mouseover:function(o){return e.hoverEmoji(s)},mouseleave:function(o){return e.hoverEmoji(null)},keydown:o=>e.handleKeyDownFilteredEmojis(o,n,s)}},[i("img",{staticClass:"d-icon d-icon--size-500",attrs:{alt:s.name,"aria-label":s.name,title:s.name,src:`${e.CDN_URL+s.unicode_character}.png`}})])}),0)]):e._e()],2)])},L=[],w=m.normalizeComponent(T,v,L,!1,null,null,null,null);const I=w.exports,p="https://static.dialpadcdn.com/joypixels/png/unicode/32/",a=9,h={DEFAULT:"Default",LIGHT:"Light",MEDIUM_LIGHT:"MediumLight",MEDIUM:"Medium",MEDIUM_DARK:"MediumDark",DARK:"Dark"},u={MOST_RECENTLY_USED:"Most recently used",SMILEYS_AND_PEOPLE:"Smileys and people",NATURE:"Nature",FOOD:"Food",ACTIVITY:"Activity",TRAVEL:"Travel",OBJECTS:"Objects",SYMBOLS:"Symbols",FLAGS:"Flags"},D={name:"EmojiDescription",props:{emoji:{type:Object,default:()=>null}},data(){return{CDN_URL:p}}};var C=function(){var s;var e=this,i=e._self._c;return i("div",{staticClass:"d-emoji-picker__data"},[e.emoji?i("img",{staticClass:"d-icon d-icon--size-500",attrs:{alt:e.emoji.name,"aria-label":e.emoji.name,title:e.emoji.name,src:`${e.CDN_URL+e.emoji.unicode_character}.png`}}):e._e(),e._v(" "+e._s((s=e.emoji)==null?void 0:s.name)+" ")])},A=[],F=m.normalizeComponent(D,C,A,!1,null,null,null,null);const O=F.exports,N={name:"EmojiSkinSelector",components:{DtTooltip:m.DtTooltip},props:{skinTone:{type:String,required:!0},isHovering:{type:Boolean,default:!1},skinSelectorButtonTooltipLabel:{type:String,required:!0}},data(){return{isOpen:!1,skinSelected:null,skinsRef:[],cdnUrl:p}},computed:{skinPassedIn(){return this.skinList.find(t=>t.skinTone===this.skinTone)},skinList(){return[{name:":wave_tone1:",unicode_output:"1f44b-1f3fb",skinTone:h.LIGHT,skinCode:"_tone1"},{name:":wave_tone2:",unicode_output:"1f44b-1f3fc",skinTone:h.MEDIUM_LIGHT,skinCode:"_tone2"},{name:":wave_tone3:",unicode_output:"1f44b-1f3fd",skinTone:h.MEDIUM,skinCode:"_tone3"},{name:":wave_tone4:",unicode_output:"1f44b-1f3fe",skinTone:h.MEDIUM_DARK,skinCode:"_tone4"},{name:":wave_tone5:",unicode_output:"1f44b-1f3ff",skinTone:h.DARK,skinCode:"_tone5"},{name:":wave:",unicode_output:"1f44b",skinTone:h.DEFAULT,skinCode:""}]}},watch:{isHovering(t){t&&(this.isOpen=!1)},skinTone(t,e){t!==e&&(this.skinSelected=this.skinPassedIn)}},mounted(){this.skinSelected=this.skinPassedIn,this.$nextTick(()=>{this.setupSkinRefs()})},methods:{setupSkinRefs(){this.skinList.forEach((t,e)=>{const i=`skinRef-${e}`;this.$refs[i]&&this.$set(this.skinsRef,e,this.$refs[i][0])})},focusSkinSelector(){this.$refs.skinSelectorRef&&this.$refs.skinSelectorRef.focus()},selectSkin(t){this.skinSelected=t,this.isOpen=!1,this.$emit("skin-tone",t.skinTone),this.$nextTick(()=>{this.focusSkinSelector()})},handleKeyDown(t,e,i){var s,n,o,r;t.preventDefault(),t.key==="ArrowLeft"&&(i===0&&((s=this.skinsRef[this.skinsRef.length-1])==null||s.focus()),(n=this.skinsRef[i-1])==null||n.focus()),t.key==="ArrowRight"&&(this.skinsRef.length&&((o=this.skinsRef[0])==null||o.focus()),(r=this.skinsRef[i+1])==null||r.focus()),t.key==="Enter"&&(e?this.selectSkin(e):this.toggleSkinList()),t.key==="Tab"&&(t.shiftKey?this.$emit("focus-last-emoji"):this.$emit("focus-tabset"))},toggleSkinList(){this.isOpen=!this.isOpen,this.$nextTick(()=>{this.skinsRef[0]&&this.skinsRef[0].focus()})}}};var U=function(){var e=this,i=e._self._c;return i("div",{attrs:{"data-qa":"skin-selector"}},[i("div",{directives:[{name:"show",rawName:"v-show",value:e.isOpen,expression:"isOpen"}],staticClass:"d-emoji-picker__skin-list"},e._l(e.skinList,function(s,n){var o;return i("button",{key:s.name,ref:`skinRef-${n}`,refInFor:!0,class:{selected:((o=e.skinSelected)==null?void 0:o.skinCode)===s.skinCode},on:{click:function(r){return e.selectSkin(s)},keydown:r=>e.handleKeyDown(r,s,n)}},[i("img",{staticClass:"d-icon d-icon--size-500",attrs:{alt:s.name,"aria-label":s.name,title:s.name,src:`${e.cdnUrl+s.unicode_output}.png`}})])}),0),i("div",{directives:[{name:"show",rawName:"v-show",value:!e.isOpen,expression:"!isOpen"}],staticClass:"d-emoji-picker__skin-selected"},[i("dt-tooltip",{attrs:{placement:"top-end"},scopedSlots:e._u([{key:"anchor",fn:function(){var s,n,o,r;return[i("button",{ref:"skinSelectorRef",attrs:{"aria-label":e.skinSelectorButtonTooltipLabel,tabindex:"-1"},on:{click:e.toggleSkinList,keydown:l=>e.handleKeyDown(l)}},[i("img",{staticClass:"d-icon d-icon--size-500",attrs:{alt:(s=e.skinSelected)==null?void 0:s.name,"aria-label":(n=e.skinSelected)==null?void 0:n.name,title:(o=e.skinSelected)==null?void 0:o.name,src:`${e.cdnUrl+((r=e.skinSelected)==null?void 0:r.unicode_output)}.png`}})])]},proxy:!0}])},[e._v(" "+e._s(e.skinSelectorButtonTooltipLabel)+" ")])],1)])},M=[],K=m.normalizeComponent(N,U,M,!1,null,null,null,null);const P=K.exports,B={name:"DtEmojiPicker",components:{EmojiTabset:g,EmojiSearch:$,EmojiSelector:I,EmojiDescription:O,EmojiSkinSelector:P},props:{recentlyUsedEmojis:{type:Array},searchPlaceholderLabel:{type:String,required:!0},searchResultsLabel:{type:String,required:!0},searchNoResultsLabel:{type:String,required:!0},tabSetLabels:{type:Array,required:!0},skinTone:{type:String},skinSelectorButtonTooltipLabel:{type:String,required:!0}},data(){return{searchQuery:"",highlightedEmoji:null,selectedTabset:{},scrollIntoTab:0,isScrolling:!1}},computed:{showRecentlyUsedTab(){var t;return((t=this.recentlyUsedEmojis)==null?void 0:t.length)>0}},methods:{scrollToSelectedTabset(t){this.searchQuery="",this.selectedTabset={...this.selectedTabset,tabId:t}},updateScrollIntoTab(t){this.scrollIntoTab=t},updateIsScrolling(t){this.isScrolling=t},updateHighlightedEmoji(t){this.highlightedEmoji=t}}};var q=function(){var e=this,i=e._self._c;return i("div",{staticClass:"d-emoji-picker"},[i("div",{staticClass:"d-emoji-picker--header"},[i("emoji-tabset",{ref:"tabsetRef",attrs:{"emoji-filter":e.searchQuery,"show-recently-used-tab":e.showRecentlyUsedTab,"scroll-into-tab":e.scrollIntoTab,"tab-set-labels":e.tabSetLabels,"is-scrolling":e.isScrolling},on:{"focus-search-input":function(s){return e.$refs.searchInputRef.focusSearchInput()},"focus-skin-selector":function(s){return e.$refs.skinSelectorRef.focusSkinSelector()},"selected-tabset":e.scrollToSelectedTabset},nativeOn:{keydown:function(s){return!s.type.indexOf("key")&&e._k(s.keyCode,"esc",27,s.key,["Esc","Escape"])?null:e.$emit("close")}}})],1),i("div",{staticClass:"d-emoji-picker--body"},[i("emoji-search",{ref:"searchInputRef",attrs:{"model-value":e.searchQuery,"search-placeholder-label":e.searchPlaceholderLabel},on:{"update:model-value":s=>e.searchQuery=s,"select-first-emoji":function(s){return e.$emit("selected-emoji",e.highlightedEmoji)},"focus-tabset":function(s){return e.$refs.tabsetRef.focusTabset()},"focus-emoji-selector":function(s){return e.$refs.emojiSelectorRef.focusEmojiSelector()}},nativeOn:{keydown:function(s){return!s.type.indexOf("key")&&e._k(s.keyCode,"esc",27,s.key,["Esc","Escape"])?null:e.$emit("close")}}}),i("emoji-selector",{ref:"emojiSelectorRef",attrs:{"emoji-filter":e.searchQuery,"skin-tone":e.skinTone,"tab-set-labels":e.tabSetLabels,"search-results-label":e.searchResultsLabel,"search-no-results-label":e.searchNoResultsLabel,"recently-used-emojis":e.recentlyUsedEmojis,"selected-tabset":e.selectedTabset},on:{"scroll-into-tab":e.updateScrollIntoTab,"is-scrolling":e.updateIsScrolling,"highlighted-emoji":e.updateHighlightedEmoji,"selected-emoji":function(s){return e.$emit("selected-emoji",s)},"focus-skin-selector":function(s){return e.$refs.skinSelectorRef.focusSkinSelector()},"focus-search-input":function(s){return e.$refs.searchInputRef.focusSearchInput()}},nativeOn:{keydown:function(s){return!s.type.indexOf("key")&&e._k(s.keyCode,"esc",27,s.key,["Esc","Escape"])?null:e.$emit("close")}}})],1),i("div",{staticClass:"d-emoji-picker--footer"},[i("emoji-description",{attrs:{emoji:e.highlightedEmoji}}),i("emoji-skin-selector",{ref:"skinSelectorRef",attrs:{"is-hovering":!!e.highlightedEmoji,"skin-selector-button-tooltip-label":e.skinSelectorButtonTooltipLabel,"skin-tone":e.skinTone},on:{"skin-tone":function(s){return e.$emit("skin-tone",s)},"focus-tabset":function(s){return e.$refs.tabsetRef.focusTabset()},"focus-last-emoji":function(s){return e.$refs.emojiSelectorRef.focusLastEmoji()}},nativeOn:{keydown:function(s){return!s.type.indexOf("key")&&e._k(s.keyCode,"esc",27,s.key,["Esc","Escape"])?null:e.$emit("close")}}})],1)])},z=[],H=m.normalizeComponent(B,q,z,!1,null,null,null,null);const G=H.exports;exports.CDN_URL=p;exports.DtEmojiPicker=G;exports.EMOJIS_PER_ROW=a;exports.EMOJI_PICKER_CATEGORIES=u;exports.EMOJI_PICKER_SKIN_TONE_MODIFIERS=h;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { y as b, z as k, w as p, x as _, A as j } from "./index-
|
|
2
|
-
import { n as m, D as g } from "./tooltip-
|
|
1
|
+
import { y as b, z as k, w as p, x as _, A as j } from "./index-Fb937CbY.js";
|
|
2
|
+
import { n as m, D as g } from "./tooltip-ZAaMbL96.js";
|
|
3
3
|
import "vue";
|
|
4
4
|
const y = {
|
|
5
5
|
name: "EmojiTabset",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { D as o, I as i, p as a, r as l } from "./index-
|
|
2
|
-
import { n as c } from "./tooltip-
|
|
1
|
+
import { D as o, I as i, p as a, r as l } from "./index-Fb937CbY.js";
|
|
2
|
+
import { n as c } from "./tooltip-ZAaMbL96.js";
|
|
3
3
|
const p = {
|
|
4
4
|
name: "DtEmojiTextWrapper",
|
|
5
5
|
components: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const n=require("./index-
|
|
1
|
+
"use strict";const n=require("./index-Ay3JqEew.cjs"),o=require("./tooltip-SCB4w509.cjs"),a={name:"DtEmojiTextWrapper",components:{DtEmoji:n.DtEmoji},props:{elementType:{type:String,default:"div"},size:{type:String,default:"500",validator:e=>Object.keys(n.ICON_SIZE_MODIFIERS).includes(e)}},data(){return{loadingEmojiJson:!0}},async created(){this.loadingEmojiJson=!1},methods:{replaceDtEmojis(e,t){const s=new RegExp(`(${e.join("|")})`,"g");return t.split(s).map(i=>e.includes(i)?this.$createElement(n.DtEmoji,{props:{code:i,size:this.size,...this.$attrs}}):this.$createElement("span",i))},searchVNodes(e){if(!e.tag&&e.text)return this.searchCodes(e.text);const t=e.children?e.children.map(s=>this.searchVNodes(s)):[];return this.$createElement(e.tag,e.data,t)},replaceVueComponentVNodeContent(e){},searchCodes(e){const t=n.findShortCodes(e),s=n.findEmojis(e),r=[...t,...s];return r.length===0?e:this.replaceDtEmojis(r,e)}},render(e){const t=this.$slots.default||[];return e(this.elementType,{class:"d-emoji-text-wrapper"},this.loadingEmojiJson?t:t.map(s=>this.searchVNodes(s)))}},l=null,c=null;var p=o.normalizeComponent(a,l,c,!1,null,null,null,null);const d=p.exports;exports.DtEmojiTextWrapper=d;
|