@dialpad/dialtone 9.14.1 → 9.14.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/css/CHANGELOG.json +1 -1
- package/dist/css/dialtone.css +6 -6
- package/dist/css/dialtone.min.css +1 -1
- 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 +2 -2
- package/dist/vue2/directives.cjs +1 -1
- package/dist/vue2/directives.js +23 -16
- package/dist/vue2/message_input.cjs +1 -1
- package/dist/vue2/message_input.js +1 -1
- package/dist/vue2/{rich_text_editor-Clr7o_AW.cjs → rich_text_editor-DhEmmg9W.cjs} +1 -1
- package/dist/vue2/{rich_text_editor-a7U8J5Ft.js → rich_text_editor-WaW2IVbb.js} +4 -2
- package/dist/vue2/types/directives/tooltip/tooltip.d.ts.map +1 -1
- package/dist/vue3/dialtone-vue.cjs +1 -1
- package/dist/vue3/dialtone-vue.js +2 -2
- package/dist/vue3/directives.cjs +1 -1
- package/dist/vue3/directives.js +30 -23
- package/dist/vue3/message_input.cjs +1 -1
- package/dist/vue3/message_input.js +1 -1
- package/dist/vue3/{rich_text_editor-0vqsSbEc.cjs → rich_text_editor-CkZ82uQY.cjs} +1 -1
- package/dist/vue3/{rich_text_editor-j80_b13f.js → rich_text_editor-G1GLwWlk.js} +4 -2
- package/dist/vue3/types/directives/tooltip/tooltip.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _=require("./rich_text_editor-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _=require("./rich_text_editor-CkZ82uQY.cjs"),m=require("./emoji-HI8urLsM.cjs"),e=require("vue"),c=require("./tooltip-8utqWHHH.cjs"),_t=require("./emoji_text_wrapper-U7jKFbg1.cjs"),Xe={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"},Je={label:"",count:"d-badge--count"},et={"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"},Un={name:"DtBadge",components:{DtIcon:m.DtIcon},props:{iconLeft:{type:String,default:""},iconRight:{type:String,default:""},text:{type:String,default:""},kind:{type:String,default:"label",validator:t=>Object.keys(Je).includes(t)},type:{type:String,default:"default",validator:t=>Object.keys(Xe).includes(t)},decoration:{type:String,default:void 0,validator:t=>Object.keys(et).includes(t)},labelClass:{type:[String,Array,Object],default:""}},data(){return{BADGE_TYPE_MODIFIERS:Xe,BADGE_KIND_MODIFIERS:Je,BADGE_DECORATION_MODIFIERS:et}},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."))}}},Wn={key:0,class:"d-badge__decorative"},Kn={key:1,class:"d-badge__icon-left"},jn={key:2,class:"d-badge__icon-right"};function Yn(t,a,n,r,i,o){const s=e.resolveComponent("dt-icon");return e.openBlock(),e.createElementBlock("span",{class:e.normalizeClass(["d-badge",i.BADGE_TYPE_MODIFIERS[n.type],i.BADGE_KIND_MODIFIERS[n.kind],i.BADGE_DECORATION_MODIFIERS[n.decoration]]),"data-qa":"dt-badge"},[n.decoration?(e.openBlock(),e.createElementBlock("span",Wn)):e.createCommentVNode("",!0),n.iconLeft||n.type==="ai"?(e.openBlock(),e.createElementBlock("span",Kn,[e.createVNode(s,{name:n.iconLeft||"dialpad-ai",size:"200"},null,8,["name"])])):e.createCommentVNode("",!0),e.createElementVNode("span",{class:e.normalizeClass(["d-badge__label",n.labelClass])},[e.renderSlot(t.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(n.text),1)])],2),n.iconRight?(e.openBlock(),e.createElementBlock("span",jn,[e.createVNode(s,{name:n.iconRight,size:"200"},null,8,["name"])])):e.createCommentVNode("",!0)],2)}const Ae=c._export_sfc(Un,[["render",Yn]]),ue=["base","error","info","success","warning"],Qt=["alert","alertdialog","status"],Gn=new Map([["info","info"],["success","check-circle"],["warning","alert-triangle"],["error","alert-circle"],["base","bell"]]),Qn={name:"DtNoticeIcon",components:{DtIcon:m.DtIcon},props:{kind:{type:String,default:"base",validate(t){return ue.includes(t)}}},data(){return{hasSlotContent:c.hasSlotContent}},computed:{defaultIcon(){return Gn.get(this.kind)}}},Zn={key:0,"aria-hidden":"true",class:"d-notice__icon"};function Xn(t,a,n,r,i,o){const s=e.resolveComponent("dt-icon");return o.defaultIcon||i.hasSlotContent(t.$slots.default)?(e.openBlock(),e.createElementBlock("div",Zn,[e.renderSlot(t.$slots,"default",{},()=>[e.createVNode(s,{name:o.defaultIcon,size:"400"},null,8,["name"])])])):e.createCommentVNode("",!0)}const xe=c._export_sfc(Qn,[["render",Xn]]),Jn={name:"DtNoticeContent",props:{title:{type:String,default:""},titleId:{type:String,default:void 0},contentId:{type:String,default:void 0}},data(){return{hasSlotContent:c.hasSlotContent}}},ea={class:"d-notice__content","data-qa":"notice-content"},ta=["id"],na=["id"];function aa(t,a,n,r,i,o){return e.openBlock(),e.createElementBlock("div",ea,[n.title||i.hasSlotContent(t.$slots.titleOverride)?(e.openBlock(),e.createElementBlock("p",{key:0,id:n.titleId,class:"d-notice__title","data-qa":"notice-content-title"},[e.renderSlot(t.$slots,"titleOverride",{},()=>[e.createTextVNode(e.toDisplayString(n.title),1)])],8,ta)):e.createCommentVNode("",!0),e.createElementVNode("p",{id:n.contentId,class:"d-notice__message","data-qa":"notice-content-message"},[e.renderSlot(t.$slots,"default")],8,na)])}const Me=c._export_sfc(Jn,[["render",aa]]),oa={name:"DtNoticeAction",components:{DtIcon:m.DtIcon,DtButton:m.DtButton,SrOnlyCloseButton:_.SrOnlyCloseButton},mixins:[_.SrOnlyCloseButtonMixin],props:{closeButtonProps:{type:Object,default:()=>({})},hideClose:{type:Boolean,default:!1}},emits:["close"],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)},beforeUnmount(){var t;(t=this.lastFocusedElement)==null||t.focus()},methods:{close(){this.$emit("close")}}},ra={class:"d-notice__actions","data-qa":"notice-content-actions"};function ia(t,a,n,r,i,o){const s=e.resolveComponent("dt-icon"),d=e.resolveComponent("dt-button"),l=e.resolveComponent("sr-only-close-button");return e.openBlock(),e.createElementBlock("div",ra,[e.renderSlot(t.$slots,"default"),n.hideClose?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(d,e.mergeProps({key:0,ref:"closeButton","data-qa":"dt-notice-action-close-button",size:"sm",importance:"clear",circle:"","aria-label":n.closeButtonProps.ariaLabel?n.closeButtonProps.ariaLabel:"Close"},n.closeButtonProps,{onClick:o.close}),{icon:e.withCtx(()=>[e.createVNode(s,{name:"close",size:"200"})]),_:1},16,["aria-label","onClick"])),t.showVisuallyHiddenClose?(e.openBlock(),e.createBlock(l,{key:1,"visually-hidden-close-label":t.visuallyHiddenCloseLabel,onClose:o.close},null,8,["visually-hidden-close-label","onClose"])):e.createCommentVNode("",!0)])}const Pe=c._export_sfc(oa,[["render",ia]]),sa={name:"DtNotice",components:{DtNoticeIcon:xe,DtNoticeContent:Me,DtNoticeAction:Pe},mixins:[_.SrOnlyCloseButtonMixin],props:{titleId:{type:String,default:void 0},contentId:{type:String,default:void 0},title:{type:String,default:""},role:{type:String,default:"status",validate(t){return Qt.includes(t)}},important:{type:Boolean,default:!1},kind:{type:String,default:"base",validate(t){return ue.includes(t)}},closeButtonProps:{type:Object,default:()=>({})},hideClose:{type:Boolean,default:!1}},emits:["close","click"],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}]}}};function la(t,a,n,r,i,o){const s=e.resolveComponent("dt-notice-icon"),d=e.resolveComponent("dt-notice-content"),l=e.resolveComponent("dt-notice-action");return e.openBlock(),e.createElementBlock("aside",{class:e.normalizeClass(o.noticeClass),"data-qa":"notice"},[e.createVNode(s,{kind:n.kind},{default:e.withCtx(()=>[e.renderSlot(t.$slots,"icon")]),_:3},8,["kind"]),e.createVNode(d,{"title-id":n.titleId,"content-id":n.contentId,title:n.title,role:n.role},{titleOverride:e.withCtx(()=>[e.renderSlot(t.$slots,"titleOverride")]),default:e.withCtx(()=>[e.renderSlot(t.$slots,"default")]),_:3},8,["title-id","content-id","title","role"]),e.createVNode(l,{"hide-close":n.hideClose,"close-button-props":n.closeButtonProps,"visually-hidden-close":t.visuallyHiddenClose,"visually-hidden-close-label":t.visuallyHiddenCloseLabel,onClose:a[0]||(a[0]=u=>t.$emit("close"))},{default:e.withCtx(()=>[e.renderSlot(t.$slots,"action")]),_:3},8,["hide-close","close-button-props","visually-hidden-close","visually-hidden-close-label"])],2)}const da=c._export_sfc(sa,[["render",la]]),ca={name:"DtBanner",components:{DtNoticeIcon:xe,DtNoticeContent:Me,DtNoticeAction:Pe},mixins:[_.Modal,_.SrOnlyCloseButtonMixin],props:{titleId:{type:String,default(){return c.utils.getUniqueString()}},contentId:{type:String,default(){return c.utils.getUniqueString()}},title:{type:String,default:""},important:{type:Boolean,default:!1},pinned:{type:Boolean,default:!1},kind:{type:String,default:"base",validate(t){return ue.includes(t)}},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(t){this.important&&this.focusTrappedTabPress(t)}}},ua=["role","aria-labelledby","aria-describedby"];function ha(t,a,n,r,i,o){const s=e.resolveComponent("dt-notice-icon"),d=e.resolveComponent("dt-notice-content"),l=e.resolveComponent("dt-notice-action");return e.openBlock(),e.createElementBlock("aside",{class:e.normalizeClass(o.bannerClass),style:e.normalizeStyle(o.bannerBackgroundImage),onKeydown:a[1]||(a[1]=e.withKeys((...u)=>o.trapFocus&&o.trapFocus(...u),["tab"]))},[e.createElementVNode("div",{class:e.normalizeClass(["d-banner__dialog",n.dialogClass]),role:o.role,"aria-labelledby":n.titleId,"aria-describedby":n.contentId},[n.hideIcon?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(s,{key:0,kind:n.kind},{default:e.withCtx(()=>[e.renderSlot(t.$slots,"icon")]),_:3},8,["kind"])),e.createVNode(d,{"title-id":n.titleId,"content-id":n.contentId,title:n.title},{titleOverride:e.withCtx(()=>[e.renderSlot(t.$slots,"titleOverride")]),default:e.withCtx(()=>[e.renderSlot(t.$slots,"default")]),_:3},8,["title-id","content-id","title"]),e.createVNode(l,{"hide-close":n.hideClose,"close-button-props":n.closeButtonProps,"visually-hidden-close":t.visuallyHiddenClose,"visually-hidden-close-label":t.visuallyHiddenCloseLabel,onClose:a[0]||(a[0]=u=>t.$emit("close"))},{default:e.withCtx(()=>[e.renderSlot(t.$slots,"action")]),_:3},8,["hide-close","close-button-props","visually-hidden-close","visually-hidden-close-label"])],10,ua)],38)}const ma=c._export_sfc(ca,[["render",ha]]),Zt="d-breadcrumbs__item--selected",Xt="d-breadcrumbs--inverted",fa={name:"DtBreadcrumbItem",components:{DtLink:_.DtLink},inheritAttrs:!1,props:{inverted:{type:Boolean,default:!1},selected:{type:Boolean,default:!1},label:{type:String,default:""}},data(){return{BREADCRUMB_ITEM_SELECTED_MODIFIER:Zt}},computed:{linkKind(){return this.inverted?m.INVERTED:m.MUTED},ariaCurrent(){return this.selected?"location":void 0}}};function pa(t,a,n,r,i,o){const s=e.resolveComponent("dt-link");return e.openBlock(),e.createElementBlock("li",{"data-qa":"dt-breadcrumb-item",class:e.normalizeClass(["d-breadcrumbs__item",{[i.BREADCRUMB_ITEM_SELECTED_MODIFIER]:n.selected}])},[e.createVNode(s,e.mergeProps({kind:o.linkKind,"aria-current":o.ariaCurrent,"data-qa":"breadcrumb-item"},t.$attrs),{default:e.withCtx(()=>[e.renderSlot(t.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(n.label),1)])]),_:3},16,["kind","aria-current"])],2)}const Jt=c._export_sfc(fa,[["render",pa]]),ga={name:"DtBreadcrumbs",components:{DtBreadcrumbItem:Jt},props:{breadcrumbs:{type:Array,default:()=>[],validate(t){return t.every(({href:a,label:n})=>a!==void 0&&n!==void 0)}},inverted:{type:Boolean,default:!1},ariaLabel:{type:String,default:"breadcrumb"}},data(){return{BREADCRUMBS_INVERTED_MODIFIER:Xt}},methods:{getBreadcrumbItemKey(t){return`breadcrumbs-item-${t}-${c.utils.getUniqueString()}`}}},_a=["aria-label"];function ba(t,a,n,r,i,o){const s=e.resolveComponent("dt-breadcrumb-item");return e.openBlock(),e.createElementBlock("nav",{"aria-label":n.ariaLabel,"data-qa":"dt-breadcrumbs",class:e.normalizeClass(["d-breadcrumbs",{[i.BREADCRUMBS_INVERTED_MODIFIER]:n.inverted}])},[e.createElementVNode("ol",null,[e.renderSlot(t.$slots,"default",{},()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.breadcrumbs,(d,l)=>(e.openBlock(),e.createBlock(s,e.mergeProps({key:o.getBreadcrumbItemKey(l),inverted:n.inverted},d),null,16,["inverted"]))),128))])])],10,_a)}const va=c._export_sfc(ga,[["render",ba]]),tt={start:"d-btn-group--start",end:"d-btn-group--end","space-between":"d-btn-group--space-between"},ya={name:"DtButtonGroup",props:{alignment:{type:String,default:"start",validator:t=>Object.keys(tt).includes(t)}},data(){return{BUTTON_GROUP_ALIGNMENT:tt}}};function Sa(t,a,n,r,i,o){return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["d-btn-group",i.BUTTON_GROUP_ALIGNMENT[n.alignment]]),role:"group"},[e.renderSlot(t.$slots,"default")],2)}const Ca=c._export_sfc(ya,[["render",Sa]]),ka={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:""}},data(){return{hasSlotContent:c.hasSlotContent}}};function wa(t,a,n,r,i,o){return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["d-card",n.containerClass]),"data-qa":"dt-card"},[i.hasSlotContent(t.$slots.header)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["d-card__header",n.headerClass])},[e.renderSlot(t.$slots,"header")],2)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["d-card__content",n.contentClass]),style:e.normalizeStyle({"max-height":n.maxHeight})},[e.renderSlot(t.$slots,"content")],6),i.hasSlotContent(t.$slots.footer)?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["d-card__footer",n.footerClass])},[e.renderSlot(t.$slots,"footer")],2)):e.createCommentVNode("",!0)],2)}const en=c._export_sfc(ka,[["render",wa]]),Ea={name:"DtCodeblock",props:{text:{type:String,required:!0}}},Ia={class:"d-codeblock"};function Da(t,a,n,r,i,o){return e.openBlock(),e.createElementBlock("pre",null,[e.createTextVNode(" "),e.createElementVNode("code",Ia,e.toDisplayString(n.text),1),e.createTextVNode(`
|
|
3
3
|
`)])}const Ta=c._export_sfc(Ea,[["render",Da]]),Oa={methods:{scrollElementIntoViewIfNeeded(t,a,n,r){t.scrollIntoViewIfNeeded?this.scrollIntoViewIfNeeded(t,a,n,r):this.scrollIntoView(t,"bottom",!1,n,r)},scrollElementIntoView(t,a,n,r){if(a==="center"){this.scrollIntoView(t,"center",!1,n,r);return}a===!1?this.scrollIntoView(t,"bottom",!1,n,r):this.scrollIntoView(t,"top",!1,n,r)},scrollIntoViewIfNeeded(t,a,n,r){const i=a?"center":void 0;this.scrollIntoView(t,i,!0,n,r)},scrollIntoView(t,a,n,r,i){if(!t||!t.parentElement)return;const o=t.offsetTop,s=i||t.parentElement,d=this._getScrollBounds(s),l=d.bottom-d.top,u=this._getElementHeight(t),f=o+u;let h=-1;switch(a){case"top":h=o;break;case"center":h=o+(u-l)/2;break;case"bottom":h=h=f-l;break;default:o-d.top<=l/2?h=o:h=f-l;break}this._setScrollTop(s,h,d,o,f,n,r)},_setScrollTop(t,a,n,r,i,o,s){n=n||this._getScrollBounds(t);const d=n.bottom-n.top;if(o&&this._inScrollBounds(r,i,n))if(r<n.top)a=r;else if(i>n.bottom)a=i-d;else return;s?t.scrollTo({top:a,behavior:s}):t.scrollTop=a},_getElementHeight(t){return t.getBoundingClientRect().height},_getScrollBounds(t){const a=this._getElementHeight(t),n=t.scrollTop;return{top:n,bottom:n+a}},_inScrollBounds(t,a,n){const r=a-t;return a<=n.bottom+3*r/4&&t>=n.top-r/4}}},Ba="listElementKey is required or the referenced element doesn't exist. Received listElement: ",bt=({listItemRole:t="option",indexKey:a="highlightIndex",idKey:n="highlightId",listElementKey:r="listRef",activeItemKey:i="",openMethod:o=null,afterHighlightMethod:s=null,beginningOfListMethod:d=null,endOfListMethod:l=null,scrollToOnHighlight:u=!0,focusOnKeyboardNavigation:f=!1}={})=>({mixins:[Oa],data(){return{[a]:-1,[n]:"",scrollToOnHighlight:u,focusOnKeyboardNavigation:f}},provide(){return{highlightId:()=>this[n]}},methods:{_getListElement(){var h;return((h=this[r]())==null?void 0:h.$el)||this[r]()},_itemsLength(){const h=this._getListItemNodes();return h===null?0:h.length},_getListItemNodes(){const h=this._getListElement();return h?Array.from(h.querySelectorAll(`[role="${t}"], #sr-only-close-button`)):(console.error(Ba,h),null)},onUpKey(){o&&this[o](!0),this[a]>0?this.setHighlightIndex(this[a]-1):d&&this[d](),this.scrollActiveItemIntoViewIfNeeded(),this.focusActiveItemIfNeeded()},onDownKey(){o&&this[o](!0),this[a]<this._itemsLength()-1?this.setHighlightIndex(this[a]+1):l&&this[l](),this.scrollActiveItemIntoViewIfNeeded(),this.focusActiveItemIfNeeded()},onHomeKey(){this.jumpToBeginning(),this.scrollActiveItemIntoViewIfNeeded(),this.focusActiveItemIfNeeded()},onEndKey(){this.jumpToEnd(),this.scrollActiveItemIntoViewIfNeeded(),this.focusActiveItemIfNeeded()},onNavigationKey(h){const p=this._getListItemNodes(),g=p.filter(y=>y.textContent.trim().toLowerCase().startsWith(h.toLowerCase()));if(g.length<=0)return;const b=g.findIndex(y=>this[a]===p.indexOf(y)),T=p.indexOf(b<g.length-1?g[b+1]:g[0]);this.setHighlightIndex(T),this.scrollActiveItemIntoViewIfNeeded(),this.focusActiveItemIfNeeded()},isValidLetter(h){return h.length>1?!1:h>="a"&&h<="z"||h>="A"&&h<="Z"},jumpToBeginning(){this.setHighlightIndex(0)},jumpToEnd(){this.setHighlightIndex(this._itemsLength()-1)},setHighlightIndex(h){this[a]=h,this[n]=this._getItemId(h),this._itemsLength()&&s&&this[s](h)},setHighlightId(h){this[n]=h,this[a]=this._getItemIndex(h),this._itemsLength()&&s&&this[s](this._getItemIndex(h))},_getItemIndex(h){const p=this._getListElement();return p?Array.from(p.querySelectorAll(`[role="${t}"], #sr-only-close-button`)).indexOf(p.querySelector(`#${h}`)):void 0},_getItemId(h){var g;const p=this._getListElement();if(p)return(g=p.querySelectorAll(`[role="${t}"], #sr-only-close-button`)[h])==null?void 0:g.id},scrollActiveItemIntoViewIfNeeded(){if(!this.scrollToOnHighlight)return;const h=this[i];if(h){const p=this._getListElement();this.scrollElementIntoViewIfNeeded(h,null,null,p)}},focusActiveItemIfNeeded(){if(!this.focusOnKeyboardNavigation)return;const h=this[i];h&&h.focus()}}}),Na={name:"ComboboxLoadingList",components:{DtListItem:_.DtListItem,DtSkeleton:m.DtSkeleton}},La={class:"d-combobox__loading-list","aria-busy":"true"};function Aa(t,a,n,r,i,o){const s=e.resolveComponent("dt-skeleton"),d=e.resolveComponent("dt-list-item");return e.openBlock(),e.createElementBlock("ol",La,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(7,l=>e.createVNode(d,{key:l,role:"option","navigation-type":"none"},{default:e.withCtx(()=>[e.createVNode(s,{"text-option":{type:"body"},offset:0})]),_:2},1024)),64))])}const tn=c._export_sfc(Na,[["render",Aa]]),xa={name:"ComboboxEmptyList",components:{DtListItem:_.DtListItem},props:{message:{type:String,required:!0},itemClass:{type:[String,Object,Array],default:""}}},Ma={class:"d-combobox__empty-list","data-qa":"dt-combobox-empty-list"};function Pa(t,a,n,r,i,o){const s=e.resolveComponent("dt-list-item");return e.openBlock(),e.createElementBlock("ol",Ma,[e.renderSlot(t.$slots,"default",{},()=>[e.createVNode(s,{role:"option","navigation-type":"none",type:"custom",class:e.normalizeClass(["dt-empty-list-item",n.itemClass])},{default:e.withCtx(()=>[e.createElementVNode("span",null,e.toDisplayString(n.message),1)]),_:1},8,["class"])])])}const nn=c._export_sfc(xa,[["render",Pa]]),vt={EXTRA_SMALL:"xs",SMALL:"sm",DEFAULT:"md",LARGE:"lg",EXTRA_LARGE:"xl"},Va={name:"DtCombobox",components:{ComboboxLoadingList:tn,ComboboxEmptyList:nn},mixins:[bt({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:t=>Object.values(vt).includes(t)},description:{type:String,default:""},listId:{type:String,default(){return c.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,hasSlotContent:c.hasSlotContent}},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(t){this.listRenderedOutside||(this.setInitialHighlightIndex(),this.$emit("opened",t)),!t&&this.outsideRenderedListRef&&(this.outsideRenderedListRef.removeEventListener("mousemove",this.onMouseHighlight),this.outsideRenderedListRef=null)},loading(t){this.$nextTick(()=>{this.setInitialHighlightIndex()})},$props:{deep:!0,immediate:!0,handler(){this.validateEmptyListProps()}}},created(){this.validateEmptyListProps()},methods:{onMouseHighlight(t){if(this.loading)return;const a=t.target.closest("li");a&&this.highlightId!==a.id&&this.setHighlightId(a.id)},getListElement(){var t;return this.outsideRenderedListRef??((t=this.$refs.listWrapper)==null?void 0:t.querySelector(`#${this.listId}`))},clearHighlightIndex(){this.showList&&this.setHighlightIndex(-1)},afterHighlight(){this.loading||this.$emit("highlight",this.highlightIndex)},onEnterKey(){var t;this.loading||this.emptyList||this.highlightIndex>=0&&(this.$emit("select",this.highlightIndex),this.clickOnSelect&&((t=this.activeItemEl)==null||t.click()))},onEscapeKey(){this.$emit("escape")},onOpen(t,a){var n;this.outsideRenderedListRef=a,(n=this.outsideRenderedListRef)==null||n.addEventListener("mousemove",this.onMouseHighlight),this.$emit("opened",t),t&&this.setInitialHighlightIndex()},onKeyValidation(t,a){!this.showList||!this.getListElement()||this[a](t)},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.`)}}},Ra={"data-qa":"dt-combobox-input-wrapper"};function $a(t,a,n,r,i,o){const s=e.resolveComponent("combobox-loading-list"),d=e.resolveComponent("combobox-empty-list");return e.openBlock(),e.createElementBlock("div",{onKeydown:[a[3]||(a[3]=e.withKeys(e.withModifiers(l=>o.onKeyValidation(l,"onEscapeKey"),["stop"]),["esc"])),a[4]||(a[4]=e.withKeys(e.withModifiers(l=>o.onKeyValidation(l,"onEnterKey"),["exact"]),["enter"])),a[5]||(a[5]=e.withKeys(e.withModifiers(l=>o.onKeyValidation(l,"onUpKey"),["stop","prevent"]),["up"])),a[6]||(a[6]=e.withKeys(e.withModifiers(l=>o.onKeyValidation(l,"onDownKey"),["stop","prevent"]),["down"])),a[7]||(a[7]=e.withKeys(e.withModifiers(l=>o.onKeyValidation(l,"onHomeKey"),["stop","prevent"]),["home"])),a[8]||(a[8]=e.withKeys(e.withModifiers(l=>o.onKeyValidation(l,"onEndKey"),["stop","prevent"]),["end"]))]},[e.createElementVNode("div",Ra,[e.renderSlot(t.$slots,"input",{inputProps:o.inputProps})]),n.showList?(e.openBlock(),e.createElementBlock("div",{key:0,ref:"listWrapper","data-qa":"dt-combobox-list-wrapper",onMouseleave:a[0]||(a[0]=(...l)=>o.clearHighlightIndex&&o.clearHighlightIndex(...l)),onFocusout:a[1]||(a[1]=(...l)=>o.clearHighlightIndex&&o.clearHighlightIndex(...l)),onMousemoveCapture:a[2]||(a[2]=(...l)=>o.onMouseHighlight&&o.onMouseHighlight(...l))},[n.loading&&!n.listRenderedOutside?(e.openBlock(),e.createBlock(s,e.normalizeProps(e.mergeProps({key:0},o.listProps)),null,16)):n.emptyList&&(n.emptyStateMessage||i.hasSlotContent(t.$slots.emptyListItem))&&!n.listRenderedOutside?(e.openBlock(),e.createBlock(d,e.mergeProps({key:1},o.listProps,{message:n.emptyStateMessage,"item-class":n.emptyStateClass}),{default:e.withCtx(()=>[e.renderSlot(t.$slots,"emptyListItem")]),_:3},16,["message","item-class"])):e.renderSlot(t.$slots,"list",{key:2,listProps:o.listProps,opened:o.onOpen,clearHighlightIndex:o.clearHighlightIndex})],544)):e.createCommentVNode("",!0)],32)}const an=c._export_sfc(Va,[["render",$a]]),za={name:"DtCollapsibleLazyShow",inheritAttrs:!1,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(t){!t||this.initialized||(this.initialized=!0)}},methods:{beforeEnter(t){requestAnimationFrame(()=>{t.style.height||(t.style.height="0px")})},enter(t){requestAnimationFrame(()=>{requestAnimationFrame(()=>{t.style.height=`${t.scrollHeight}px`})})},afterEnter(t){t.style.height=null},beforeLeave(t){requestAnimationFrame(()=>{t.style.height||(t.style.height=`${t.offsetHeight}px`)})},leave(t){requestAnimationFrame(()=>{requestAnimationFrame(()=>{t.style.height="0px"})})},afterLeave(t){t.style.height=null}}};function Fa(t,a,n,r,i,o){return e.openBlock(),e.createBlock(e.Transition,e.mergeProps({appear:n.appear,"enter-active-class":"enter-active","leave-active-class":"leave-active"},t.$attrs,{css:o.isCSSEnabled,onBeforeEnter:o.beforeEnter,onEnter:o.enter,onAfterEnter:o.afterEnter,onBeforeLeave:o.beforeLeave,onLeave:o.leave,onAfterLeave:o.afterLeave}),{default:e.withCtx(()=>[e.withDirectives((e.openBlock(),e.createBlock(e.resolveDynamicComponent(n.elementType),e.normalizeProps(e.guardReactiveProps(t.$attrs)),{default:e.withCtx(()=>[i.initialized?e.renderSlot(t.$slots,"default",{key:0}):e.createCommentVNode("",!0)]),_:3},16)),[[e.vShow,n.show]])]),_:3},16,["appear","css","onBeforeEnter","onEnter","onAfterEnter","onBeforeLeave","onLeave","onAfterLeave"])}const qa=c._export_sfc(za,[["render",Fa]]),Ha={name:"DtCollapsible",components:{DtButton:m.DtButton,DtCollapsibleLazyShow:qa,DtLazyShow:c.DtLazyShow,DtIcon:m.DtIcon},props:{anchorText:{type:String,default:null},open:{type:Boolean,default:null},id:{type:String,default(){return c.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&&c.getUniqueString("DtCollapsible__anchor")},collapsibleListeners(){return c.extractVueListeners(this.$attrs)}},watch:{open:{handler:function(t){t!==null&&(this.isOpen=t)},immediate:!0}},created(){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&&!c.hasSlotContent(this.$slots.anchor)&&console.error("anchor text and anchor slot content cannot both be falsy")}}},Ua=["id"],Wa=["title"];function Ka(t,a,n,r,i,o){const s=e.resolveComponent("dt-icon"),d=e.resolveComponent("dt-button"),l=e.resolveComponent("dt-collapsible-lazy-show");return e.openBlock(),e.createBlock(e.resolveDynamicComponent(n.elementType),e.mergeProps({ref:"collapsible"},e.toHandlers(o.collapsibleListeners)),{default:e.withCtx(()=>[e.createElementVNode("div",{id:!n.ariaLabelledBy&&o.labelledBy,ref:"anchor",class:e.normalizeClass(n.anchorClass)},[e.renderSlot(t.$slots,"anchor",{attrs:{"aria-controls":n.id,"aria-expanded":i.isOpen.toString(),role:"button"}},()=>[e.createVNode(d,{importance:"clear",kind:"muted","aria-controls":n.id,"aria-expanded":`${i.isOpen}`,style:e.normalizeStyle({width:n.maxWidth}),onClick:o.defaultToggleOpen},{default:e.withCtx(()=>[e.createVNode(s,{name:i.isOpen?"chevron-down":"chevron-right",class:"d-collapsible__icon",size:"300"},null,8,["name"]),e.createElementVNode("span",{class:"d-collapsible__anchor-text",title:n.anchorText},e.toDisplayString(n.anchorText),9,Wa)]),_:1},8,["aria-controls","aria-expanded","style","onClick"])])],10,Ua),e.createVNode(l,e.mergeProps({id:n.id,ref:"contentWrapper","aria-hidden":`${!i.isOpen}`,"aria-labelledby":o.labelledBy,"aria-label":n.ariaLabel,show:i.isOpen,"element-type":n.contentElementType,class:n.contentClass,style:{"max-height":n.maxHeight,"max-width":n.maxWidth},"data-qa":"dt-collapsible--content",tabindex:"-1",appear:""},e.toHandlers(o.collapsibleListeners),{onAfterLeave:o.onLeaveTransitionComplete,onAfterEnter:o.onEnterTransitionComplete}),{default:e.withCtx(()=>[e.renderSlot(t.$slots,"content")]),_:3},16,["id","aria-hidden","aria-labelledby","aria-label","show","element-type","class","style","onAfterLeave","onAfterEnter"])]),_:3},16)}const on=c._export_sfc(Ha,[["render",Ka]]),rn=["row","column"],ja=t=>t.term?typeof t.term=="string":!1,Ya=t=>t.description?typeof t.description=="string":!1,Ga=t=>Array.isArray(t)?t.every(a=>!(typeof a!="object"||!ja(a)||!Ya(a))):!1,Qa={name:"DtDescriptionList",props:{direction:{type:String,default:"row",validator:t=>rn.includes(t)},items:{type:Array,default:()=>[],validator:t=>Ga(t),required:!0},gap:{type:String,default:"400",validator:t=>_.DT_STACK_GAP.includes(t)},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}`}}};function Za(t,a,n,r,i,o){return e.openBlock(),e.createElementBlock("dl",{class:e.normalizeClass(["dt-description-list",o.getDirectionClass,o.getGapClass])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.items,s=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:s.term},[e.createElementVNode("dt",{class:e.normalizeClass(o.dtClass)},e.toDisplayString(s.term),3),e.createElementVNode("dd",{class:e.normalizeClass(o.ddClass)},e.toDisplayString(s.description),3)],64))),128))],2)}const Xa=c._export_sfc(Qa,[["render",Za]]),de={none:void 0,small:"d-py0",large:"d-py4"},Ja={name:"DtDropdown",components:{DtPopover:_.DtPopover,SrOnlyCloseButton:_.SrOnlyCloseButton},mixins:[bt({indexKey:"highlightIndex",idKey:"highlightId",listElementKey:"getListElement",listItemRole:"menuitem",afterHighlightMethod:"afterHighlight",beginningOfListMethod:"beginningOfListMethod",endOfListMethod:"endOfListMethod",activeItemKey:"activeItemEl",focusOnKeyboardNavigation:!0}),_.SrOnlyCloseButtonMixin],inheritAttrs:!1,props:{open:{type:Boolean,default:null},openOnContext:{type:Boolean,default:!1},padding:{type:String,default:"small",validator:t=>Object.keys(de).some(a=>a===t)},modal:{type:Boolean,default:!0},contentWidth:{type:String,default:null},maxHeight:{type:String,default:""},maxWidth:{type:String,default:""},listId:{type:String,default(){return c.getUniqueString()}},navigationType:{type:String,default:_.LIST_ITEM_NAVIGATION_TYPES.ARROW_KEYS,validator:t=>Object.values(_.LIST_ITEM_NAVIGATION_TYPES).includes(t)},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:t=>_.POPOVER_APPEND_TO_VALUES.includes(t)||t instanceof HTMLElement},tether:{type:Boolean,default:!0},transition:{type:String,default:"fade"}},emits:["keydown","highlight","update:open","opened","update:open"],data(){return{LIST_ITEM_NAVIGATION_TYPES:_.LIST_ITEM_NAVIGATION_TYPES,DROPDOWN_PADDING_CLASSES:de,EVENT_KEYNAMES:c.EVENT_KEYNAMES,openedWithKeyboard:!1,isOpen:null}},computed:{dropdownListeners(){return{opened:t=>{this.updateInitialHighlightIndex(t)},keydown:t=>{switch(t.code){case c.EVENT_KEYNAMES.up:case c.EVENT_KEYNAMES.arrowup:this.onUpKeyPress(t),t.stopPropagation(),t.preventDefault();break;case c.EVENT_KEYNAMES.down:case c.EVENT_KEYNAMES.arrowdown:this.onDownKeyPress(t),t.stopPropagation(),t.preventDefault();break;case c.EVENT_KEYNAMES.space:case c.EVENT_KEYNAMES.spacebar:this.onSpaceKey();break;case c.EVENT_KEYNAMES.enter:this.onEnterKey();break;case c.EVENT_KEYNAMES.home:this.onHomeKeyPress(t),t.stopPropagation(),t.preventDefault();break;case c.EVENT_KEYNAMES.end:this.onEndKeyPress(t),t.stopPropagation(),t.preventDefault();break;default:this.onKeyPress(t);break}this.$emit("keydown",t)}}},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",de[this.padding],this.listClass,{"d-context-menu-list":this.openOnContext}]},shouldOpenWithArrowKeys(){return!this.openOnContext}},methods:{onMouseHighlight(t){const a=t.target.closest("li");a&&a.role&&this.highlightId!==a.id&&(this.setHighlightId(a.id),a.focus())},getListElement(){return this.$refs.listWrapper},clearHighlightIndex(){this.setHighlightIndex(-1)},afterHighlight(){this.visuallyHiddenClose&&this.highlightIndex===this._itemsLength()-1||this.$emit("highlight",this.highlightIndex)},updateInitialHighlightIndex(t){this.isOpen=t,t?(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(t){if(!(!this.isOpen||!this.isArrowKeyNav||!this.isValidLetter(t.key)))return t.stopPropagation(),t.preventDefault(),this.onNavigationKey(t.key)}}},eo=["id"];function to(t,a,n,r,i,o){const s=e.resolveComponent("sr-only-close-button"),d=e.resolveComponent("dt-popover");return e.openBlock(),e.createBlock(d,e.mergeProps({ref:"popover","content-width":n.contentWidth,open:n.open,placement:n.placement,"initial-focus-element":i.openedWithKeyboard?"first":"dialog","fallback-placements":n.fallbackPlacements,padding:"none",role:"menu","append-to":n.appendTo,modal:n.modal,"max-height":n.maxHeight,"max-width":n.maxWidth,"open-with-arrow-keys":o.shouldOpenWithArrowKeys,"open-on-context":n.openOnContext},t.$attrs,{tether:n.tether,transition:n.transition},e.toHandlers(o.dropdownListeners)),{anchor:e.withCtx(({attrs:l})=>[e.renderSlot(t.$slots,"anchor",e.mergeProps({ref:"anchor"},l))]),content:e.withCtx(({close:l})=>[e.createElementVNode("ul",{id:n.listId,ref:"listWrapper",class:e.normalizeClass(o.listClasses),"data-qa":"dt-dropdown-list-wrapper",onMouseleave:a[0]||(a[0]=(...u)=>o.clearHighlightIndex&&o.clearHighlightIndex(...u)),onMousemoveCapture:a[1]||(a[1]=(...u)=>o.onMouseHighlight&&o.onMouseHighlight(...u))},[e.renderSlot(t.$slots,"list",{close:l}),t.showVisuallyHiddenClose?(e.openBlock(),e.createBlock(s,{key:0,"visually-hidden-close-label":t.visuallyHiddenCloseLabel,tabindex:o.isArrowKeyNav?-1:0,onClose:l},null,8,["visually-hidden-close-label","tabindex","onClose"])):e.createCommentVNode("",!0)],42,eo)]),_:3},16,["content-width","open","placement","initial-focus-element","fallback-placements","append-to","modal","max-height","max-width","open-with-arrow-keys","open-on-context","tether","transition"])}const sn=c._export_sfc(Ja,[["render",to]]),no={name:"DtDropdownSeparator"},ao={"aria-hidden":"true",class:"dt-list-separator"};function oo(t,a,n,r,i,o){return e.openBlock(),e.createElementBlock("li",ao)}const ro=c._export_sfc(no,[["render",oo]]),io=function(){const t=e.ref(null);let a,n,r=null,i=null;function o(l){if(i){const u=Date.now()-r+100;a&&clearTimeout(a),i!==l&&(a=setTimeout(()=>{t.value!==null&&(r=Date.now()),t.value=null},u),n&&clearTimeout(n),n=setTimeout(()=>{t.value=l,i=l},u))}else n=setTimeout(()=>{t.value=l,i=l},c.TOOLTIP_DELAY_MS)}function s(){n&&(clearTimeout(n),n=null),r=Date.now(),a=setTimeout(()=>{t.value=null,i=null},c.TOOLTIP_DELAY_MS)}let d=null;return()=>(d===null&&(d={current:t,enter:o,leave:s}),d)}(),so={__name:"hovercard",props:{transition:{type:Boolean,default:!1},fallbackPlacements:{type:Array,default:()=>["auto"]},placement:{type:String,default:"top-start",validator(t){return c.TOOLTIP_DIRECTIONS.includes(t)}},padding:{type:String,default:"large",validator:t=>Object.keys(_.POPOVER_PADDING_CLASSES).some(a=>a===t)},offset:{type:Array,default:()=>[0,16]},id:{type:String,default(){return c.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:t=>_.POPOVER_APPEND_TO_VALUES.includes(t)||t instanceof HTMLElement}},emits:["opened"],setup(t){const a=e.reactive(io());return(n,r)=>(e.openBlock(),e.createBlock(e.unref(_.DtPopover),{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:a,"data-qa":"dt-hovercard",onOpened:r[0]||(r[0]=i=>n.$emit("opened",i))},{anchor:e.withCtx(({attrs:i})=>[e.renderSlot(n.$slots,"anchor",e.normalizeProps(e.guardReactiveProps(i)))]),content:e.withCtx(()=>[e.renderSlot(n.$slots,"content")]),headerContent:e.withCtx(()=>[e.renderSlot(n.$slots,"headerContent")]),footerContent:e.withCtx(()=>[e.renderSlot(n.$slots,"footerContent")]),_:3},8,["id","placement","content-class","fallback-placements","padding","transition","offset","header-class","footer-class","append-to","timer"]))}},lo={name:"DtImageViewer",components:{DtButton:m.DtButton,DtIcon:m.DtIcon},mixins:[_.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{click:t=>{t.target===t.currentTarget&&this.close()},keydown:t=>{switch(t.code){case c.EVENT_KEYNAMES.esc:case c.EVENT_KEYNAMES.escape:this.close();break;case c.EVENT_KEYNAMES.tab:this.trapFocus(t);break}}}}},watch:{isOpen:{immediate:!0,handler(t){var a;t?this.previousActiveElement=document.activeElement:((a=this.previousActiveElement)==null||a.focus(),this.previousActiveElement=null)}},open:{handler:function(t){t!==null&&(this.isOpen=t)},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 t;(t=this.$refs.closeImage)==null||t.$el.focus()},trapFocus(t){this.isOpen&&this.focusTrappedTabPress(t)}}},co=["src","alt"],uo=["aria-hidden"],ho={"data-qa":"dt-image-viewer-full",class:"d-image-viewer__full",role:"dialog","aria-modal":"true"},mo=["src","alt"];function fo(t,a,n,r,i,o){const s=e.resolveComponent("dt-button"),d=e.resolveComponent("dt-icon");return e.openBlock(),e.createElementBlock("div",null,[e.createVNode(s,{"data-qa":"dt-image-viewer-preview",class:"d-image-viewer__preview-button","aria-label":n.ariaLabel,importance:"clear",onClick:o.openModal},{default:e.withCtx(()=>[e.createElementVNode("img",{class:e.normalizeClass(n.imageButtonClass),src:n.imageSrc,alt:n.imageAlt},null,10,co)]),_:1},8,["aria-label","onClick"]),i.isOpen?(e.openBlock(),e.createBlock(e.Teleport,{key:0,to:"body"},[e.createElementVNode("div",e.mergeProps({"aria-hidden":i.isOpen?"false":"true",class:"d-modal","data-qa":"dt-modal"},e.toHandlers(o.modalListeners,!0),{onMouseover:a[0]||(a[0]=l=>i.showCloseButton=!0),onMouseleave:a[1]||(a[1]=l=>i.showCloseButton=!1),onFocusin:a[2]||(a[2]=l=>i.showCloseButton=!0),onFocusout:a[3]||(a[3]=l=>i.showCloseButton=!1)}),[e.createElementVNode("div",ho,[e.createElementVNode("img",{class:"d-image-viewer__full__image",src:n.imageSrc,alt:n.imageAlt},null,8,mo)]),e.createVNode(e.Transition,{name:"fade"},{default:e.withCtx(()=>[i.showCloseButton?(e.openBlock(),e.createBlock(s,{key:0,ref:"closeImage","data-qa":"dt-image-viewer-close-btn",class:"d-modal__close",circle:"",size:"lg",importance:"clear",kind:"inverted","aria-label":n.closeAriaLabel,onClick:o.close},{icon:e.withCtx(()=>[e.createVNode(d,{class:"d-image-viewer__close-button",name:"close",size:"400"})]),_:1},8,["aria-label","onClick"])):e.createCommentVNode("",!0)]),_:1})],16,uo)])):e.createCommentVNode("",!0)])}const ln=c._export_sfc(lo,[["render",fo]]),dn={components:{DtValidationMessages:m.DtValidationMessages},provide(){return{groupContext:this.provideObj,setGroupValue:this.setGroupValue}},props:{id:{type:String,default(){return c.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:t=>m.validationMessageValidator(t)},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:()=>({})}},emits:["input"],data(){const t=c.formatMessages(this.messages);return{provideObj:{name:this.name,disabled:this.disabled,validationState:c.getValidationState(t)}}},computed:{formattedMessages(){return c.formatMessages(this.messages)},validationState(){return c.getValidationState(this.formattedMessages)}},watch:{disabled(t){this.provideObj.disabled=t},validationState(t){this.provideObj.validationState=t}},methods:{setGroupValue(t){this.internalValue=t,this.$emit("input",t)}},mounted(){!this.legend&&!this.$slots.legend&&!this.$attrs["aria-label"]&&e.warn("It is expected that an aria-label is provided when there is no legend.",this)}},po={name:"DtInputGroup",components:{DtValidationMessages:m.DtValidationMessages},mixins:[dn],props:{dataQaGroup:{type:String,default:"input-group"},dataQaGroupLegend:{type:String,default:"input-group-legend"},dataQaGroupMessages:{type:String,default:"input-group-messages"}},data(){return{internalValue:this.value,hasSlotContent:c.hasSlotContent}},watch:{value(t){this.internalValue=t},internalValue:{immediate:!0,handler(t){this.provideObj.value=t}}},methods:{getMessageKey(t,a){return`input-group-message-${t}-${a}-${this.id}`}}},go=["data-qa"],_o=["data-qa"];function bo(t,a,n,r,i,o){const s=e.resolveComponent("dt-validation-messages");return e.openBlock(),e.createElementBlock("fieldset",{class:"d-input-group__fieldset","data-qa":n.dataQaGroup},[i.hasSlotContent(t.$slots.legend)||t.legend?(e.openBlock(),e.createElementBlock("legend",e.mergeProps({key:0,class:["d-label",t.legendClass]},t.legendChildProps,{"data-qa":n.dataQaGroupLegend}),[e.renderSlot(t.$slots,"legend",{},()=>[e.createTextVNode(e.toDisplayString(t.legend),1)])],16,_o)):e.createCommentVNode("",!0),e.renderSlot(t.$slots,"default"),e.createVNode(s,e.mergeProps({"validation-messages":t.formattedMessages,"show-messages":t.showMessages,class:t.messagesClass,"data-qa":n.dataQaGroupMessages},t.messagesChildProps),null,16,["validation-messages","show-messages","class","data-qa"])],8,go)}const yt=c._export_sfc(po,[["render",bo]]),nt={default:"",danger:"d-modal--danger"},at={default:"",full:"d-modal--full"},ot={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"},vo={name:"DtModal",components:{DtLazyShow:c.DtLazyShow,DtButton:m.DtButton,DtIcon:m.DtIcon,SrOnlyCloseButton:_.SrOnlyCloseButton},mixins:[_.Modal,_.SrOnlyCloseButtonMixin],props:{closeButtonProps:{type:Object,required:!0,validator:t=>!!t.ariaLabel},copy:{type:String,default:""},describedById:{type:String,default:""},labelledById:{type:String,default:function(){return c.getUniqueString()}},show:{type:Boolean,default:!1},title:{type:String,default:""},bannerTitle:{type:String,default:""},kind:{type:String,default:"default",validator:t=>Object.keys(nt).includes(t)},size:{type:String,default:"default",validator:t=>Object.keys(at).includes(t)},modalClass:{type:[String,Object,Array],default:""},dialogClass:{type:[String,Object,Array],default:""},contentClass:{type:[String,Object,Array],default:""},bannerKind:{type:String,default:"warning",validate(t){return ue.includes(t)}},bannerClass:{type:[String,Object,Array],default:""},hideClose:{type:Boolean,default:!1},closeOnClick:{type:Boolean,default:!0},fixedHeaderFooter:{type:Boolean,default:!0}},emits:["click","keydown","update:show"],data(){return{MODAL_KIND_MODIFIERS:nt,MODAL_SIZE_MODIFIERS:at,MODAL_BANNER_KINDS:ot,EVENT_KEYNAMES:c.EVENT_KEYNAMES,hasSlotContent:c.hasSlotContent}},computed:{modalListeners(){return{click:t=>{this.closeOnClick&&(t.target===t.currentTarget&&this.close(),this.$emit("click",t))},keydown:t=>{switch(t.code){case c.EVENT_KEYNAMES.esc:case c.EVENT_KEYNAMES.escape:this.close();break;case c.EVENT_KEYNAMES.tab:this.trapFocus(t);break}this.$emit("keydown",t)},"after-enter":t=>{t.target===t.currentTarget&&this.setFocusAfterTransition()}}},open(){return`${!this.show}`},hasFooterSlot(){return!!this.$slots.footer},bannerKindClass(){return ot[this.bannerKind]}},watch:{show:{immediate:!0,handler(t){var a;t?this.previousActiveElement=document.activeElement:((a=this.previousActiveElement)==null||a.focus(),this.previousActiveElement=null)}},$props:{immediate:!0,deep:!0,handler(){this.validateProps()}}},methods:{close(){this.$emit("update:show",!1)},setFocusAfterTransition(){this.focusFirstElement()},trapFocus(t){this.show&&this.focusTrappedTabPress(t)},validateProps(){this.hideClose&&!this.visuallyHiddenClose&&console.error(`If hideClose prop is true, visuallyHiddenClose and visuallyHiddenCloseLabel props
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { S as Rt, c as Ce, M as et, d as vn, e as pt, f as yn, D as tt, L as Dt, P as bt, g as _n, h as Qe, i as Sn, j as vt, k as wn, a as Cn, R as kn, b as In } from "./rich_text_editor-
|
|
2
|
-
import { p as Ah, q as Mh, o as xh, l as Bh, m as Ph, n as Rh, A as $h, B as Nh, C as Fh, x as zh, r as qh, w as Hh, s as Vh, u as Wh, t as Uh, v as jh, y as Kh, z as Yh } from "./rich_text_editor-
|
|
1
|
+
import { S as Rt, c as Ce, M as et, d as vn, e as pt, f as yn, D as tt, L as Dt, P as bt, g as _n, h as Qe, i as Sn, j as vt, k as wn, a as Cn, R as kn, b as In } from "./rich_text_editor-G1GLwWlk.js";
|
|
2
|
+
import { p as Ah, q as Mh, o as xh, l as Bh, m as Ph, n as Rh, A as $h, B as Nh, C as Fh, x as zh, r as qh, w as Hh, s as Vh, u as Wh, t as Uh, v as jh, y as Kh, z as Yh } from "./rich_text_editor-G1GLwWlk.js";
|
|
3
3
|
import { w as V, t as j, F as Tn, M as Dn, G as On, H as Fe, J as Wa, K as Ua, N as ja, O as Ka, P as $t, x as Ya, D as Ln } from "./emoji-ppApZXjY.js";
|
|
4
4
|
import { W as Qh, S as Xh, R as Zh, Q as Jh, T as ef, a1 as tf, a4 as af, a3 as nf, a2 as sf, z as rf, y as of, U as lf, I as df, Y as cf, X as uf, V as hf, C as ff, L as mf, a9 as gf, a5 as pf, a6 as bf, a8 as vf, a7 as yf, a0 as _f, $ as Sf, Z as wf, _ as Cf } from "./emoji-ppApZXjY.js";
|
|
5
5
|
import { resolveComponent as p, openBlock as d, createElementBlock as u, normalizeClass as C, createCommentVNode as w, createVNode as g, createElementVNode as b, renderSlot as m, createTextVNode as z, toDisplayString as M, createBlock as D, mergeProps as A, withCtx as c, normalizeStyle as ke, withKeys as de, Fragment as Q, renderList as J, withModifiers as ce, normalizeProps as ze, Transition as Nt, withDirectives as Ae, resolveDynamicComponent as Se, guardReactiveProps as yt, vShow as Me, toHandlers as K, ref as Z, reactive as At, unref as L, Teleport as En, warn as _t, computed as Le, watch as Ze, onMounted as Ga, nextTick as Ye, markRaw as An, shallowReactive as Mn, h as xn, provide as Bn, createSlots as Ft, pushScopeId as Pn, popScopeId as Rn } from "vue";
|
package/dist/vue3/directives.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./tooltip-8utqWHHH.cjs"),d=require("vue"),T={name:"dt-tooltip-directive",install(c){const n=document.createElement("div");document.body.appendChild(n);const u="top",r=d.createApp({name:"DtTooltipDirectiveApp",components:{DtTooltip:l.DtTooltip},data(){return{tooltips:[]}},methods:{addOrUpdateTooltip(t,e,o){const i=this.tooltips.findIndex(p=>p.id===t);i!==-1?(this.tooltips[i].message=e,this.tooltips[i].placement=o):this.tooltips.push({id:t,message:e,placement:o})},removeTooltip(t){this.tooltips=this.tooltips.filter(e=>e.id!==t)}},render(){return d.h("div",this.tooltips.map(({id:t,message:e,placement:o})=>d.h(l.DtTooltip,{key:t,message:e,placement:o,delay:process.env.NODE_ENV!=="test",externalAnchor:`[data-dt-tooltip-id="${t}"]`})))}});r.mount(n);const v=t=>typeof t=="string"&&(t==null?void 0:t.trim()),m=t=>t===void 0||l.TOOLTIP_DIRECTIONS.includes(t);c.directive("dt-tooltip",{beforeMount(t,e){if(!v(e.value)){console.warn("Missing value for v-dt-tooltip directive on: ",t,"received value: ",e.value);return}if(!m(e.arg)){console.warn("Wrong placement value provided for v-dt-tooltip directive on: ",t,"received value: ",e.arg);return}s(t,e)},updated(t,e){e.value!==e.oldValue&&s(t,e)},unmounted(t){var e;(e=r._instance)==null||e.ctx.removeTooltip(t.getAttribute("data-dt-tooltip-id"))}});function s(t,e){var a;const o=t.getAttribute("data-dt-tooltip-id")||l.getUniqueString(),i=e.value,p=e.arg||u;t.setAttribute("data-dt-tooltip-id",o),(a=r._instance)==null||a.ctx.addOrUpdateTooltip(o,i,p)}}};exports.DtTooltipDirective=T;
|
package/dist/vue3/directives.js
CHANGED
|
@@ -1,48 +1,48 @@
|
|
|
1
|
-
import { D as
|
|
2
|
-
import { createApp as D, h as
|
|
3
|
-
const
|
|
1
|
+
import { D as n, g as T, T as f } from "./tooltip-Ooi51wOv.js";
|
|
2
|
+
import { createApp as D, h as a } from "vue";
|
|
3
|
+
const g = {
|
|
4
4
|
name: "dt-tooltip-directive",
|
|
5
|
-
install(
|
|
6
|
-
const
|
|
7
|
-
document.body.appendChild(
|
|
8
|
-
const
|
|
5
|
+
install(c) {
|
|
6
|
+
const d = document.createElement("div");
|
|
7
|
+
document.body.appendChild(d);
|
|
8
|
+
const u = "top", p = D({
|
|
9
9
|
name: "DtTooltipDirectiveApp",
|
|
10
|
-
components: { DtTooltip:
|
|
10
|
+
components: { DtTooltip: n },
|
|
11
11
|
data() {
|
|
12
12
|
return {
|
|
13
13
|
tooltips: []
|
|
14
14
|
};
|
|
15
15
|
},
|
|
16
16
|
methods: {
|
|
17
|
-
|
|
18
|
-
this.tooltips.
|
|
17
|
+
addOrUpdateTooltip(t, e, o) {
|
|
18
|
+
const i = this.tooltips.findIndex((s) => s.id === t);
|
|
19
|
+
i !== -1 ? (this.tooltips[i].message = e, this.tooltips[i].placement = o) : this.tooltips.push({ id: t, message: e, placement: o });
|
|
19
20
|
},
|
|
20
21
|
removeTooltip(t) {
|
|
21
22
|
this.tooltips = this.tooltips.filter((e) => e.id !== t);
|
|
22
23
|
}
|
|
23
24
|
},
|
|
24
25
|
render() {
|
|
25
|
-
return
|
|
26
|
+
return a(
|
|
26
27
|
"div",
|
|
27
|
-
this.tooltips.map(({ id: t, message: e, placement: o }) =>
|
|
28
|
+
this.tooltips.map(({ id: t, message: e, placement: o }) => a(n, {
|
|
28
29
|
key: t,
|
|
29
30
|
message: e,
|
|
30
31
|
placement: o,
|
|
31
32
|
/**
|
|
32
33
|
* Set the delay to false when running tests only.
|
|
33
|
-
|
|
34
|
+
*/
|
|
34
35
|
delay: process.env.NODE_ENV !== "test",
|
|
35
36
|
externalAnchor: `[data-dt-tooltip-id="${t}"]`
|
|
36
37
|
}))
|
|
37
38
|
);
|
|
38
39
|
}
|
|
39
40
|
});
|
|
40
|
-
|
|
41
|
-
const
|
|
42
|
-
|
|
41
|
+
p.mount(d);
|
|
42
|
+
const m = (t) => typeof t == "string" && (t == null ? void 0 : t.trim()), v = (t) => t === void 0 || f.includes(t);
|
|
43
|
+
c.directive("dt-tooltip", {
|
|
43
44
|
beforeMount(t, e) {
|
|
44
|
-
|
|
45
|
-
if (!a(e.value)) {
|
|
45
|
+
if (!m(e.value)) {
|
|
46
46
|
console.warn(
|
|
47
47
|
"Missing value for v-dt-tooltip directive on: ",
|
|
48
48
|
t,
|
|
@@ -51,7 +51,7 @@ const A = {
|
|
|
51
51
|
);
|
|
52
52
|
return;
|
|
53
53
|
}
|
|
54
|
-
if (!
|
|
54
|
+
if (!v(e.arg)) {
|
|
55
55
|
console.warn(
|
|
56
56
|
"Wrong placement value provided for v-dt-tooltip directive on: ",
|
|
57
57
|
t,
|
|
@@ -60,16 +60,23 @@ const A = {
|
|
|
60
60
|
);
|
|
61
61
|
return;
|
|
62
62
|
}
|
|
63
|
-
|
|
64
|
-
|
|
63
|
+
r(t, e);
|
|
64
|
+
},
|
|
65
|
+
updated(t, e) {
|
|
66
|
+
e.value !== e.oldValue && r(t, e);
|
|
65
67
|
},
|
|
66
68
|
unmounted(t) {
|
|
67
69
|
var e;
|
|
68
|
-
(e =
|
|
70
|
+
(e = p._instance) == null || e.ctx.removeTooltip(t.getAttribute("data-dt-tooltip-id"));
|
|
69
71
|
}
|
|
70
72
|
});
|
|
73
|
+
function r(t, e) {
|
|
74
|
+
var l;
|
|
75
|
+
const o = t.getAttribute("data-dt-tooltip-id") || T(), i = e.value, s = e.arg || u;
|
|
76
|
+
t.setAttribute("data-dt-tooltip-id", o), (l = p._instance) == null || l.ctx.addOrUpdateTooltip(o, i, s);
|
|
77
|
+
}
|
|
71
78
|
}
|
|
72
79
|
};
|
|
73
80
|
export {
|
|
74
|
-
|
|
81
|
+
g as DtTooltipDirective
|
|
75
82
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./rich_text_editor-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./rich_text_editor-CkZ82uQY.cjs"),c=require("./emoji-HI8urLsM.cjs"),b=require("./emoji_picker-mKaAu1dm.cjs"),h=require("./tooltip-8utqWHHH.cjs"),e=require("vue"),C={name:"DtRecipeMessageInput",components:{DtButton:c.DtButton,DtEmojiPicker:b._sfc_main,DtIcon:c.DtIcon,DtInput:c.DtInput,DtPopover:r.DtPopover,DtRichTextEditor:r.DtRichTextEditor,DtTooltip:h.DtTooltip},mixins:[],inheritAttrs:!1,props:{modelValue:{type:[Object,String],default:""},editable:{type:Boolean,default:!0},inputAriaLabel:{type:String,required:!0,default:""},inputClass:{type:String,default:""},autoFocus:{type:[Boolean,String,Number],default:!1,validator(n){return typeof n=="string"?r.RICH_TEXT_EDITOR_AUTOFOCUS_TYPES.includes(n):!0}},outputFormat:{type:String,default:"text",validator(n){return r.RICH_TEXT_EDITOR_OUTPUT_FORMATS.includes(n)}},link:{type:[Boolean,Object],default:!1},placeholder:{type:String,default:""},disableSend:{type:Boolean,default:!1},maxHeight:{type:String,default:"unset"},showEmojiPicker:{type:Boolean,default:!0},emojiPickerProps:{type:Object,default:()=>({}),validate(n){return["searchNoResultsLabel","searchResultsLabel","searchPlaceholderLabel","skinSelectorButtonTooltipLabel","tabSetLabels"].every(t=>n[t]!=null)}},emojiTooltipMessage:{type:String,default:"Emoji"},emojiButtonAriaLabel:{type:String,default:"emoji button"},showCharacterLimit:{type:[Boolean,Object],default:()=>({count:1500,warning:500,message:""})},showImagePicker:{type:[Boolean,Object],default:()=>({tooltipLabel:"Attach Image",ariaLabel:"image button"})},showSend:{type:[Boolean,Object],default:()=>({icon:"send"})},showCancel:{type:[Boolean,Object],default:()=>({text:"Cancel"})}},emits:["submit","select-media","add-media","cancel","skin-tone","selected-emoji","focus","blur","input"],data(){return{internalInputValue:this.modelValue,hasFocus:!1,imagePickerFocus:!1,emojiPickerFocus:!1,sendButtonFocus:!1,emojiPickerOpened:!1}},computed:{inputLength(){return this.internalInputValue.length},displayCharacterLimitWarning(){return!!this.showCharacterLimit&&this.showCharacterLimit.count-this.inputLength<=this.showCharacterLimit.warning},characterLimitTooltipEnabled(){return this.showCharacterLimit.message&&this.showCharacterLimit.count-this.inputLength<0},isSendDisabled(){return this.inputLength===0||this.disableSend||this.showCharacterLimit&&this.inputLength>this.showCharacterLimit.count},computedCloseButtonProps(){return{ariaLabel:"Close"}},emojiPickerHovered(){return this.emojiPickerFocus||this.emojiPickerOpened},sendButtonKind(){return this.isSendDisabled?"muted":"default"}},watch:{modelValue(n){this.internalInputValue=n}},methods:{onDrag(n){n.stopPropagation(),n.preventDefault()},onDrop(n){n.stopPropagation(),n.preventDefault();const t=n.dataTransfer,m=Array.from(t.files).map(s=>s.name);this.$emit("add-media",m)},onSkinTone(n){this.$emit("skin-tone",n)},onSelectEmoji(n){if(!n){this.emojiPickerOpened=!1;return}this.$refs.richTextEditor.editor.commands.insertContent({type:"emoji",attrs:{code:n.shortname}}),this.emojiPickerOpened=!1,this.$emit("selected-emoji",n)},onSelectImage(){this.$refs.messageInputImageUpload.$refs.input.click()},onImageUpload(n){this.$emit("select-media",n)},toggleEmojiPicker(){this.emojiPickerOpened=!this.emojiPickerOpened},onSend(){this.isSendDisabled||this.$emit("submit",this.internalInputValue)},onCancel(){this.$emit("cancel")},onFocus(n){this.hasFocus=!0,this.$refs.richTextEditor.focusEditor(),this.$emit("focus",n)},onBlur(n){this.hasFocus=!1,this.$emit("blur",n)},onInput(n){this.$emit("input",n)}}},S={class:"d-d-flex d-jc-space-between d-mx8 d-my4"},w={class:"d-d-flex"},T={class:"d-d-flex"},P={key:0};function j(n,t,o,m,s,i){const p=e.resolveComponent("dt-rich-text-editor"),u=e.resolveComponent("dt-icon"),l=e.resolveComponent("dt-button"),f=e.resolveComponent("dt-input"),d=e.resolveComponent("dt-tooltip"),g=e.resolveComponent("dt-emoji-picker"),k=e.resolveComponent("dt-popover");return e.openBlock(),e.createElementBlock("div",{"data-qa":"dt-message-input",role:"presentation",class:e.normalizeClass(["d-d-flex","d-fd-column","d-bar8","d-baw1","d-ba","d-c-text",{"d-bc-black-500 d-bs-sm":s.hasFocus,"d-bc-default":!s.hasFocus}]),onClick:t[15]||(t[15]=a=>n.$refs.richTextEditor.focusEditor()),onDragEnter:t[16]||(t[16]=(...a)=>i.onDrag&&i.onDrag(...a)),onDragOver:t[17]||(t[17]=(...a)=>i.onDrag&&i.onDrag(...a)),onDrop:t[18]||(t[18]=(...a)=>i.onDrop&&i.onDrop(...a)),onKeydown:t[19]||(t[19]=e.withKeys(e.withModifiers((...a)=>i.onSend&&i.onSend(...a),["exact"]),["enter"]))},[e.createElementVNode("div",{class:"d-of-auto d-mx16 d-mt8 d-mb4",style:e.normalizeStyle({"max-height":o.maxHeight})},[e.createVNode(p,e.mergeProps({ref:"richTextEditor",modelValue:s.internalInputValue,"onUpdate:modelValue":t[0]||(t[0]=a=>s.internalInputValue=a),editable:o.editable,"input-aria-label":o.inputAriaLabel,"input-class":o.inputClass,"output-format":o.outputFormat,"auto-focus":o.autoFocus,link:o.link,placeholder:o.placeholder},n.$attrs,{onFocus:i.onFocus,onBlur:i.onBlur,onInput:t[1]||(t[1]=a=>i.onInput(a))}),null,16,["modelValue","editable","input-aria-label","input-class","output-format","auto-focus","link","placeholder","onFocus","onBlur"])],4),e.renderSlot(n.$slots,"middle"),e.createElementVNode("section",S,[e.createElementVNode("div",w,[o.showImagePicker?(e.openBlock(),e.createBlock(d,{key:0,placement:"top-start",message:o.showImagePicker.tooltipLabel,offset:[-4,-4]},{anchor:e.withCtx(()=>[e.createVNode(l,{"data-qa":"dt-message-input-image-btn",size:"sm",circle:"",kind:s.imagePickerFocus?"default":"muted",importance:"clear","aria-label":o.showImagePicker.ariaLabel,onClick:i.onSelectImage,onMouseenter:t[2]||(t[2]=a=>s.imagePickerFocus=!0),onMouseleave:t[3]||(t[3]=a=>s.imagePickerFocus=!1),onFocus:t[4]||(t[4]=a=>s.imagePickerFocus=!0),onBlur:t[5]||(t[5]=a=>s.imagePickerFocus=!1)},{icon:e.withCtx(()=>[e.createVNode(u,{name:"image",size:"300"})]),_:1},8,["kind","aria-label","onClick"]),e.createVNode(f,{ref:"messageInputImageUpload","data-qa":"dt-message-input-image-input",type:"file",class:"d-ps-absolute",multiple:"",hidden:"",onInput:i.onImageUpload},null,8,["onInput"])]),_:1},8,["message"])):e.createCommentVNode("",!0),o.showEmojiPicker?(e.openBlock(),e.createBlock(k,{key:1,"data-qa":"dt-message-input-emoji-picker-popover",open:s.emojiPickerOpened,"initial-focus-element":"#searchInput",padding:"none",onOpened:t[10]||(t[10]=a=>{s.emojiPickerOpened=a})},{anchor:e.withCtx(()=>[e.createVNode(d,{message:o.emojiTooltipMessage,offset:[0,-4]},{anchor:e.withCtx(()=>[e.createVNode(l,{"data-qa":"dt-message-input-emoji-picker-btn",size:"sm",circle:"",kind:i.emojiPickerHovered?"default":"muted",importance:"clear","aria-label":o.emojiButtonAriaLabel,offset:[0,0],onClick:i.toggleEmojiPicker,onMouseenter:t[6]||(t[6]=a=>s.emojiPickerFocus=!0),onMouseleave:t[7]||(t[7]=a=>s.emojiPickerFocus=!1),onFocus:t[8]||(t[8]=a=>s.emojiPickerFocus=!0),onBlur:t[9]||(t[9]=a=>s.emojiPickerFocus=!1)},{icon:e.withCtx(()=>[e.createVNode(u,{name:i.emojiPickerHovered?"very-satisfied":"satisfied",size:"300"},null,8,["name"])]),_:1},8,["kind","aria-label","onClick"])]),_:1},8,["message"])]),content:e.withCtx(()=>[e.createVNode(g,e.mergeProps(o.emojiPickerProps,{onSkinTone:i.onSkinTone,onSelectedEmoji:i.onSelectEmoji}),null,16,["onSkinTone","onSelectedEmoji"])]),_:1},8,["open"])):e.createCommentVNode("",!0)]),e.createElementVNode("div",T,[o.showCharacterLimit?(e.openBlock(),e.createBlock(d,{key:0,class:"dt-message-input--remaining-char-tooltip",placement:"top-end",enabled:i.characterLimitTooltipEnabled,message:o.showCharacterLimit.message,offset:[10,-8]},{anchor:e.withCtx(()=>[e.withDirectives(e.createElementVNode("p",{class:"d-fc-error d-mr16 dt-message-input--remaining-char","data-qa":"dt-message-input-character-limit"},e.toDisplayString(o.showCharacterLimit.count-i.inputLength),513),[[e.vShow,i.displayCharacterLimitWarning]])]),_:1},8,["enabled","message"])):e.createCommentVNode("",!0),o.showCancel?(e.openBlock(),e.createBlock(l,{key:1,"data-qa":"dt-message-input-cancel-button",class:"dt-message-input--cancel-button",size:"sm",kind:"muted",importance:"clear","aria-label":o.showCancel.ariaLabel,onClick:i.onCancel},{default:e.withCtx(()=>[e.createElementVNode("p",null,e.toDisplayString(o.showCancel.text),1)]),_:1},8,["aria-label","onClick"])):e.createCommentVNode("",!0),o.showSend?(e.openBlock(),e.createBlock(d,{key:2,placement:"top-end",enabled:!o.showSend,message:o.showSend.tooltipLabel,show:!i.isSendDisabled&&s.sendButtonFocus,offset:[6,-8]},{anchor:e.withCtx(()=>[e.createVNode(l,{"data-qa":"dt-message-input-send-btn",size:"sm",kind:i.sendButtonKind,circle:!!o.showSend.icon,importance:"primary",class:e.normalizeClass({"message-input-button__disabled d-fc-muted":i.isSendDisabled}),"aria-label":o.showSend.ariaLabel,"aria-disabled":i.isSendDisabled,onClick:i.onSend,onMouseenter:t[11]||(t[11]=a=>s.sendButtonFocus=!0),onMouseleave:t[12]||(t[12]=a=>s.sendButtonFocus=!1),onFocus:t[13]||(t[13]=a=>s.sendButtonFocus=!0),onBlur:t[14]||(t[14]=a=>s.sendButtonFocus=!1)},e.createSlots({default:e.withCtx(()=>[o.showSend.text?(e.openBlock(),e.createElementBlock("p",P,e.toDisplayString(o.showSend.text),1)):e.createCommentVNode("",!0)]),_:2},[o.showSend.icon?{name:"icon",fn:e.withCtx(()=>[e.createVNode(u,{name:o.showSend.icon,size:"300"},null,8,["name"])]),key:"0"}:void 0]),1032,["kind","circle","class","aria-label","aria-disabled","onClick"])]),_:1},8,["enabled","message","show"])):e.createCommentVNode("",!0)])])],34)}const v=h._export_sfc(C,[["render",j]]);exports.DtRichTextEditor=r.DtRichTextEditor;exports.RICH_TEXT_EDITOR_AUTOFOCUS_TYPES=r.RICH_TEXT_EDITOR_AUTOFOCUS_TYPES;exports.RICH_TEXT_EDITOR_OUTPUT_FORMATS=r.RICH_TEXT_EDITOR_OUTPUT_FORMATS;exports.DtRecipeMessageInput=v;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { D as v, a as L, R as B, b as F } from "./rich_text_editor-
|
|
1
|
+
import { D as v, a as L, R as B, b as F } from "./rich_text_editor-G1GLwWlk.js";
|
|
2
2
|
import { t as D, w as I, x as E } from "./emoji-ppApZXjY.js";
|
|
3
3
|
import { _ as T } from "./emoji_picker-XHD9NN0X.js";
|
|
4
4
|
import { _ as x, D as O } from "./tooltip-Ooi51wOv.js";
|