@dialpad/dialtone-vue 2.123.1 → 2.124.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.json +1 -1
- package/CHANGELOG.md +16 -0
- package/dist/dialtone-vue.cjs +1 -1
- package/dist/dialtone-vue.js +2 -2
- package/dist/message_input.cjs +1 -1
- package/dist/message_input.js +44 -28
- package/dist/{rich_text_editor-tzOBsCIH.js → rich_text_editor-9sMob7ck.js} +5 -5
- package/dist/{rich_text_editor-hUaQyiPu.cjs → rich_text_editor-Eh5kYokw.cjs} +15 -15
- package/dist/types/components/rich_text_editor/extensions/mentions/suggestion.d.ts +1 -0
- package/dist/types/components/rich_text_editor/extensions/mentions/suggestion.d.ts.map +1 -1
- package/dist/types/recipes/conversation_view/message_input/message_input.vue.d.ts +2 -1
- package/dist/types/recipes/conversation_view/message_input/message_input.vue.d.ts.map +1 -1
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
# [2.124.0](https://github.com/dialpad/dialtone/compare/dialtone-vue2/v2.123.1...dialtone-vue2/v2.124.0) (2024-03-26)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **Message Input:** DLT-1672 allow spaces in mention suggestions ([#236](https://github.com/dialpad/dialtone/issues/236)) ([ca796d9](https://github.com/dialpad/dialtone/commit/ca796d960738b5cc837879edeb08ff35174ccf58))
|
|
7
|
+
* **Message Input:** send complete files on add media ([#230](https://github.com/dialpad/dialtone/issues/230)) ([15c609f](https://github.com/dialpad/dialtone/commit/15c609fe5b66bc6ed71d42514feaf517f467b0bb))
|
|
8
|
+
* **Message Input:** update mention suggestions rendering ([#229](https://github.com/dialpad/dialtone/issues/229)) ([5535e1f](https://github.com/dialpad/dialtone/commit/5535e1fac39f9b20398b03442645986760e36ac2))
|
|
9
|
+
* NO-JIRA release not working with new commit convention ([#235](https://github.com/dialpad/dialtone/issues/235)) ([28ff27c](https://github.com/dialpad/dialtone/commit/28ff27cffac5e751eaf8496b7c716710a0153a61))
|
|
10
|
+
* rich text editor warning/error cleanup ([#227](https://github.com/dialpad/dialtone/issues/227)) ([a60badb](https://github.com/dialpad/dialtone/commit/a60badba71b6ca93a8d9721875e0f3e6576f3479))
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
|
|
15
|
+
* **Message Input:** DLT-1665 add paste event ([#233](https://github.com/dialpad/dialtone/issues/233)) ([d35bf6e](https://github.com/dialpad/dialtone/commit/d35bf6e84dd46c7bd0f56195d5fad448be1912ba))
|
|
16
|
+
|
|
1
17
|
## [2.123.1](https://github.com/dialpad/dialtone/compare/dialtone-vue2/v2.123.0...dialtone-vue2/v2.123.1) (2024-03-22)
|
|
2
18
|
|
|
3
19
|
|
package/dist/dialtone-vue.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("./rich_text_editor-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("./rich_text_editor-Eh5kYokw.cjs"),l=require("./index-Wx7Jagcr.cjs"),o=require("./tooltip-i2wxFIIi.cjs"),Q=require("vue"),Ut=require("./emoji_text_wrapper-ZlynvHnd.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:f.SrOnlyCloseButton},mixins:[f.SrOnlyCloseButtonMixin],props:{closeButtonProps:{type:Object,default:()=>({})},hideClose:{type:Boolean,default:!1},hideAction:{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.hideAction?t._e():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:[f.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},hideIcon:{type:Boolean,default:!1},hideAction:{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"}},[t.hideIcon?t._e():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-action":t.hideAction,"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:[f.Modal,f.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},hideAction:{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-action":t.hideAction,"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:f.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),u=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-u)/2;break;case"bottom":c=c=b-u;break;default:i-d.top<=u/2?c=i:c=b-u;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:u=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):u&&this[u](),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:f.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:f.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=>f.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:f.DtPopover,SrOnlyCloseButton:f.SrOnlyCloseButton},mixins:[Ht({indexKey:"highlightIndex",idKey:"highlightId",listElementKey:"getListElement",listItemRole:"menuitem",afterHighlightMethod:"afterHighlight",beginningOfListMethod:"beginningOfListMethod",endOfListMethod:"endOfListMethod",activeItemKey:"activeItemEl",focusOnKeyboardNavigation:!0}),f.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:f.LIST_ITEM_NAVIGATION_TYPES.ARROW_KEYS,validator:e=>Object.values(f.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=>o.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:f.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(u){if(r){const p=Date.now()-a+100;t&&clearTimeout(t),r!==u&&(t=setTimeout(()=>{e.value!==null&&(a=Date.now()),e.value=null},p),n&&clearTimeout(n),n=setTimeout(()=>{e.value=u,r=u},p))}else n=setTimeout(()=>{e.value=u,r=u},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:f.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(o.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=>o.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:f.Portal,DtButton:l.DtButton,DtIcon:l.DtIcon},mixins:[f.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:f.SrOnlyCloseButton},mixins:[f.Modal,f.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
|
package/dist/dialtone-vue.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { S as Te, c as A, M as Z, d as Zt, e as De, f as Jt, D as J, L as ye, P as ea, g as Oe, h as fe, i as Ct, a as ta, R as aa, b as na } from "./rich_text_editor-
|
|
2
|
-
import { n as tu, o as au, m as nu, j as ru, k as su, l as iu, A as ou, t as lu, u as du, q as cu, p as uu, r as fu, s as hu } from "./rich_text_editor-
|
|
1
|
+
import { S as Te, c as A, M as Z, d as Zt, e as De, f as Jt, D as J, L as ye, P as ea, g as Oe, h as fe, i as Ct, a as ta, R as aa, b as na } from "./rich_text_editor-9sMob7ck.js";
|
|
2
|
+
import { n as tu, o as au, m as nu, j as ru, k as su, l as iu, A as ou, t as lu, u as du, q as cu, p as uu, r as fu, s as hu } from "./rich_text_editor-9sMob7ck.js";
|
|
3
3
|
import { w as y, t as S, F as ra, M as sa, G as ia, H as W, J as St, K as kt, N as It, O as xt, P as Le, x as Tt, D as oa } from "./index-OF94C6nQ.js";
|
|
4
4
|
import { W as mu, S as gu, R as _u, Q as bu, T as vu, a1 as yu, a4 as wu, a3 as Cu, a2 as Su, z as ku, y as Iu, U as xu, I as Tu, Y as Du, X as Ou, V as Lu, C as $u, L as Eu, a9 as Au, a5 as Mu, a6 as Ru, a8 as Bu, a7 as Pu, a0 as Nu, $ as Fu, Z as qu, _ as Hu } from "./index-OF94C6nQ.js";
|
|
5
5
|
import { n as c, u as E, g as T, e as $e, l as he, E as C, T as Qe, v as la, h as da, b as Xe, a as Se, L as ca, w as ua, D as ee, i as fa, x as Ee, y as ha } from "./tooltip-88U5vFMA.js";
|
package/dist/message_input.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./rich_text_editor-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./rich_text_editor-Eh5kYokw.cjs"),o=require("./index-Wx7Jagcr.cjs"),l=require("./emoji_picker-njWWAm6V.cjs"),r=require("./tooltip-i2wxFIIi.cjs");require("vue");const u={name:"DtRecipeMessageInput",components:{DtButton:o.DtButton,DtEmojiPicker:l.DtEmojiPicker,DtIcon:o.DtIcon,DtInput:o.DtInput,DtPopover:a.DtPopover,DtRichTextEditor:a.DtRichTextEditor,DtTooltip:r.DtTooltip},mixins:[],inheritAttrs:!1,props:{value:{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(t){return typeof t=="string"?a.RICH_TEXT_EDITOR_AUTOFOCUS_TYPES.includes(t):!0}},outputFormat:{type:String,default:"text",validator(t){return a.RICH_TEXT_EDITOR_OUTPUT_FORMATS.includes(t)}},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(t){return["searchNoResultsLabel","searchResultsLabel","searchPlaceholderLabel","skinSelectorButtonTooltipLabel","tabSetLabels"].every(e=>t[e]!=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"})},mentionSuggestion:{type:Object,default:null}},emits:["submit","select-media","add-media","paste-media","cancel","skin-tone","selected-emoji","focus","blur","input"],data(){return{internalInputValue:this.value,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.disableSend||this.showCharacterLimit&&this.inputLength>this.showCharacterLimit.count},computedCloseButtonProps(){return{ariaLabel:"Close"}},emojiPickerHovered(){return this.emojiPickerFocus||this.emojiPickerOpened}},watch:{value(t){this.internalInputValue=t}},methods:{onDrag(t){t.stopPropagation(),t.preventDefault()},onDrop(t){t.stopPropagation(),t.preventDefault();const e=t.dataTransfer,n=Array.from(e.files);this.$emit("add-media",n)},onPaste(t){if(t.clipboardData.files.length){t.stopPropagation(),t.preventDefault();const e=[...t.clipboardData.files];this.$emit("paste-media",e)}},onSkinTone(t){this.$emit("skin-tone",t)},onSelectEmoji(t){if(!t){this.emojiPickerOpened=!1;return}this.$refs.richTextEditor.editor.commands.insertContent({type:"emoji",attrs:{code:t.shortname}}),this.emojiPickerOpened=!1,this.$emit("selected-emoji",t)},onSelectImage(){this.$refs.messageInputImageUpload.$refs.input.click()},onImageUpload(){this.$emit("select-media",this.$refs.messageInputImageUpload.$refs.input.files)},toggleEmojiPicker(){this.emojiPickerOpened=!this.emojiPickerOpened},onSend(){this.isSendDisabled||this.$emit("submit",this.internalInputValue)},onCancel(){this.$emit("cancel")},onFocus(t){var e;this.hasFocus=!0,(e=this.$refs.richTextEditor)==null||e.focusEditor(),this.$emit("focus",t)},onBlur(t){this.hasFocus=!1,this.$emit("blur",t)},onInput(t){this.$emit("input",t)}}};var c=function(){var e=this,n=e._self._c;return n("div",{class:["d-d-flex","d-fd-column","d-bar8","d-baw1","d-ba","d-c-text",{"d-bc-bold d-bs-sm":e.hasFocus,"d-bc-default":!e.hasFocus}],attrs:{"data-qa":"dt-message-input",role:"presentation"},on:{click:function(i){var s;(s=e.$refs.richTextEditor)==null||s.focusEditor()},"drag-enter":e.onDrag,"drag-over":e.onDrag,drop:e.onDrop,keydown:function(i){return!i.type.indexOf("key")&&e._k(i.keyCode,"enter",13,i.key,"Enter")||i.ctrlKey||i.shiftKey||i.altKey||i.metaKey?null:e.onSend.apply(null,arguments)},paste:e.onPaste}},[n("div",{staticClass:"d-of-auto d-mx16 d-mt8 d-mb4",style:{"max-height":e.maxHeight}},[n("dt-rich-text-editor",e._b({ref:"richTextEditor",attrs:{editable:e.editable,"input-aria-label":e.inputAriaLabel,"input-class":e.inputClass,"output-format":e.outputFormat,"auto-focus":e.autoFocus,link:e.link,placeholder:e.placeholder,"mention-suggestion":e.mentionSuggestion},on:{focus:e.onFocus,blur:e.onBlur,input:function(i){return e.onInput(i)}},model:{value:e.internalInputValue,callback:function(i){e.internalInputValue=i},expression:"internalInputValue"}},"dt-rich-text-editor",e.$attrs,!1))],1),e._t("middle"),n("section",{staticClass:"d-d-flex d-jc-space-between d-mx8 d-my4"},[n("div",{staticClass:"d-d-flex"},[e.showImagePicker?n("dt-tooltip",{attrs:{placement:"top-start",message:e.showImagePicker.tooltipLabel,offset:[-4,-4]},scopedSlots:e._u([{key:"anchor",fn:function(){return[n("dt-button",{attrs:{"data-qa":"dt-message-input-image-btn",size:"sm",circle:"",kind:e.imagePickerFocus?"default":"muted",importance:"clear","aria-label":e.showImagePicker.ariaLabel},on:{click:e.onSelectImage,mouseenter:function(i){e.imagePickerFocus=!0},mouseleave:function(i){e.imagePickerFocus=!1},focus:function(i){e.imagePickerFocus=!0},blur:function(i){e.imagePickerFocus=!1}},scopedSlots:e._u([{key:"icon",fn:function(){return[n("dt-icon",{attrs:{name:"image",size:"300"}})]},proxy:!0}],null,!1,2561380377)}),n("dt-input",{ref:"messageInputImageUpload",staticClass:"d-ps-absolute",attrs:{"data-qa":"dt-message-input-image-input",type:"file",multiple:"",hidden:""},on:{input:e.onImageUpload}})]},proxy:!0}],null,!1,3687934814)}):e._e(),e.showEmojiPicker?n("dt-popover",{attrs:{"data-qa":"dt-message-input-emoji-picker-popover",open:e.emojiPickerOpened,"initial-focus-element":"#searchInput",padding:"none"},on:{opened:i=>{e.emojiPickerOpened=i}},scopedSlots:e._u([{key:"anchor",fn:function(){return[n("dt-tooltip",{attrs:{message:e.emojiTooltipMessage,offset:[0,-4]},scopedSlots:e._u([{key:"anchor",fn:function(){return[n("dt-button",{attrs:{"data-qa":"dt-message-input-emoji-picker-btn",size:"sm",circle:"",kind:e.emojiPickerHovered?"default":"muted",importance:"clear","aria-label":e.emojiButtonAriaLabel,offset:[0,0]},on:{click:e.toggleEmojiPicker,mouseenter:function(i){e.emojiPickerFocus=!0},mouseleave:function(i){e.emojiPickerFocus=!1},focus:function(i){e.emojiPickerFocus=!0},blur:function(i){e.emojiPickerFocus=!1}},scopedSlots:e._u([{key:"icon",fn:function(){return[n("dt-icon",{attrs:{name:e.emojiPickerHovered?"very-satisfied":"satisfied",size:"300"}})]},proxy:!0}],null,!1,352772906)})]},proxy:!0}],null,!1,3933528398)})]},proxy:!0},{key:"content",fn:function(){return[n("dt-emoji-picker",e._b({on:{"skin-tone":e.onSkinTone,"selected-emoji":e.onSelectEmoji}},"dt-emoji-picker",e.emojiPickerProps,!1))]},proxy:!0}],null,!1,1278205067)}):e._e()],1),n("div",{staticClass:"d-d-flex"},[e.showCharacterLimit?n("dt-tooltip",{staticClass:"dt-message-input--remaining-char-tooltip",attrs:{placement:"top-end",enabled:e.characterLimitTooltipEnabled,message:e.showCharacterLimit.message,offset:[10,-8]},scopedSlots:e._u([{key:"anchor",fn:function(){return[n("p",{directives:[{name:"show",rawName:"v-show",value:e.displayCharacterLimitWarning,expression:"displayCharacterLimitWarning"}],staticClass:"d-fc-error d-mr16 dt-message-input--remaining-char",attrs:{"data-qa":"dt-message-input-character-limit"}},[e._v(" "+e._s(e.showCharacterLimit.count-e.inputLength)+" ")])]},proxy:!0}],null,!1,2591914334)}):e._e(),e.showCancel?n("dt-button",{staticClass:"dt-message-input--cancel-button",attrs:{"data-qa":"dt-message-input-cancel-button",size:"sm",kind:"muted",importance:"clear","aria-label":e.showCancel.ariaLabel},on:{click:e.onCancel}},[n("p",[e._v(e._s(e.showCancel.text))])]):e._e(),e.showSend?n("dt-tooltip",{attrs:{placement:"top-end",enabled:!e.showSend,message:e.showSend.tooltipLabel,show:!e.isSendDisabled&&e.sendButtonFocus,offset:[6,-8]},scopedSlots:e._u([{key:"anchor",fn:function(){return[n("dt-button",{class:["d-btn--circle",{"message-input-button__disabled d-fc-muted":e.isSendDisabled}],attrs:{"data-qa":"dt-message-input-send-btn",size:"sm",kind:"default",importance:"primary","aria-label":e.showSend.ariaLabel,"aria-disabled":e.isSendDisabled},on:{click:e.onSend,mouseenter:function(i){e.sendButtonFocus=!0},mouseleave:function(i){e.sendButtonFocus=!1},focus:function(i){e.sendButtonFocus=!0},blur:function(i){e.sendButtonFocus=!1}},scopedSlots:e._u([e.showSend.icon?{key:"icon",fn:function(){return[n("dt-icon",{attrs:{name:e.showSend.icon,size:"300"}})]},proxy:!0}:null],null,!0)},[e.showSend.text?[n("p",[e._v(e._s(e.showSend.text))])]:e._e()],2)]},proxy:!0}],null,!1,2968465028)}):e._e()],1)])],2)},d=[],p=r.normalizeComponent(u,c,d,!1,null,null,null,null);const m=p.exports;exports.DtRichTextEditor=a.DtRichTextEditor;exports.RICH_TEXT_EDITOR_AUTOFOCUS_TYPES=a.RICH_TEXT_EDITOR_AUTOFOCUS_TYPES;exports.RICH_TEXT_EDITOR_OUTPUT_FORMATS=a.RICH_TEXT_EDITOR_OUTPUT_FORMATS;exports.DtRecipeMessageInput=m;
|
package/dist/message_input.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { D as o, a as s, R as r, b as l } from "./rich_text_editor-
|
|
1
|
+
import { D as o, a as s, R as r, b as l } from "./rich_text_editor-9sMob7ck.js";
|
|
2
2
|
import { t as u, w as c, x as d } from "./index-OF94C6nQ.js";
|
|
3
3
|
import { D as m } from "./emoji_picker-kiTOKaq8.js";
|
|
4
4
|
import { n as p, D as f } from "./tooltip-88U5vFMA.js";
|
|
@@ -208,6 +208,13 @@ const h = {
|
|
|
208
208
|
* @type {Array}
|
|
209
209
|
*/
|
|
210
210
|
"add-media",
|
|
211
|
+
/**
|
|
212
|
+
* Fires when media is pasted into the message input
|
|
213
|
+
*
|
|
214
|
+
* @event paste-media
|
|
215
|
+
* @type {Array}
|
|
216
|
+
*/
|
|
217
|
+
"paste-media",
|
|
211
218
|
/**
|
|
212
219
|
* Fires when cancel button is pressed (only on edit mode)
|
|
213
220
|
*
|
|
@@ -292,8 +299,15 @@ const h = {
|
|
|
292
299
|
},
|
|
293
300
|
onDrop(t) {
|
|
294
301
|
t.stopPropagation(), t.preventDefault();
|
|
295
|
-
const e = t.dataTransfer,
|
|
296
|
-
this.$emit("add-media",
|
|
302
|
+
const e = t.dataTransfer, i = Array.from(e.files);
|
|
303
|
+
this.$emit("add-media", i);
|
|
304
|
+
},
|
|
305
|
+
onPaste(t) {
|
|
306
|
+
if (t.clipboardData.files.length) {
|
|
307
|
+
t.stopPropagation(), t.preventDefault();
|
|
308
|
+
const e = [...t.clipboardData.files];
|
|
309
|
+
this.$emit("paste-media", e);
|
|
310
|
+
}
|
|
297
311
|
},
|
|
298
312
|
onSkinTone(t) {
|
|
299
313
|
this.$emit("skin-tone", t);
|
|
@@ -326,7 +340,8 @@ const h = {
|
|
|
326
340
|
this.$emit("cancel");
|
|
327
341
|
},
|
|
328
342
|
onFocus(t) {
|
|
329
|
-
|
|
343
|
+
var e;
|
|
344
|
+
this.hasFocus = !0, (e = this.$refs.richTextEditor) == null || e.focusEditor(), this.$emit("focus", t);
|
|
330
345
|
},
|
|
331
346
|
onBlur(t) {
|
|
332
347
|
this.hasFocus = !1, this.$emit("blur", t);
|
|
@@ -346,37 +361,38 @@ var g = function() {
|
|
|
346
361
|
"d-ba",
|
|
347
362
|
"d-c-text",
|
|
348
363
|
{ "d-bc-bold d-bs-sm": e.hasFocus, "d-bc-default": !e.hasFocus }
|
|
349
|
-
], attrs: { "data-qa": "dt-message-input", role: "presentation" }, on: { click: function(
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
364
|
+
], attrs: { "data-qa": "dt-message-input", role: "presentation" }, on: { click: function(a) {
|
|
365
|
+
var n;
|
|
366
|
+
(n = e.$refs.richTextEditor) == null || n.focusEditor();
|
|
367
|
+
}, "drag-enter": e.onDrag, "drag-over": e.onDrag, drop: e.onDrop, keydown: function(a) {
|
|
368
|
+
return !a.type.indexOf("key") && e._k(a.keyCode, "enter", 13, a.key, "Enter") || a.ctrlKey || a.shiftKey || a.altKey || a.metaKey ? null : e.onSend.apply(null, arguments);
|
|
369
|
+
}, paste: e.onPaste } }, [i("div", { staticClass: "d-of-auto d-mx16 d-mt8 d-mb4", style: { "max-height": e.maxHeight } }, [i("dt-rich-text-editor", e._b({ ref: "richTextEditor", attrs: { editable: e.editable, "input-aria-label": e.inputAriaLabel, "input-class": e.inputClass, "output-format": e.outputFormat, "auto-focus": e.autoFocus, link: e.link, placeholder: e.placeholder, "mention-suggestion": e.mentionSuggestion }, on: { focus: e.onFocus, blur: e.onBlur, input: function(a) {
|
|
370
|
+
return e.onInput(a);
|
|
371
|
+
} }, model: { value: e.internalInputValue, callback: function(a) {
|
|
372
|
+
e.internalInputValue = a;
|
|
357
373
|
}, expression: "internalInputValue" } }, "dt-rich-text-editor", e.$attrs, !1))], 1), e._t("middle"), i("section", { staticClass: "d-d-flex d-jc-space-between d-mx8 d-my4" }, [i("div", { staticClass: "d-d-flex" }, [e.showImagePicker ? i("dt-tooltip", { attrs: { placement: "top-start", message: e.showImagePicker.tooltipLabel, offset: [-4, -4] }, scopedSlots: e._u([{ key: "anchor", fn: function() {
|
|
358
|
-
return [i("dt-button", { attrs: { "data-qa": "dt-message-input-image-btn", size: "sm", circle: "", kind: e.imagePickerFocus ? "default" : "muted", importance: "clear", "aria-label": e.showImagePicker.ariaLabel }, on: { click: e.onSelectImage, mouseenter: function(
|
|
374
|
+
return [i("dt-button", { attrs: { "data-qa": "dt-message-input-image-btn", size: "sm", circle: "", kind: e.imagePickerFocus ? "default" : "muted", importance: "clear", "aria-label": e.showImagePicker.ariaLabel }, on: { click: e.onSelectImage, mouseenter: function(a) {
|
|
359
375
|
e.imagePickerFocus = !0;
|
|
360
|
-
}, mouseleave: function(
|
|
376
|
+
}, mouseleave: function(a) {
|
|
361
377
|
e.imagePickerFocus = !1;
|
|
362
|
-
}, focus: function(
|
|
378
|
+
}, focus: function(a) {
|
|
363
379
|
e.imagePickerFocus = !0;
|
|
364
|
-
}, blur: function(
|
|
380
|
+
}, blur: function(a) {
|
|
365
381
|
e.imagePickerFocus = !1;
|
|
366
382
|
} }, scopedSlots: e._u([{ key: "icon", fn: function() {
|
|
367
383
|
return [i("dt-icon", { attrs: { name: "image", size: "300" } })];
|
|
368
384
|
}, proxy: !0 }], null, !1, 2561380377) }), i("dt-input", { ref: "messageInputImageUpload", staticClass: "d-ps-absolute", attrs: { "data-qa": "dt-message-input-image-input", type: "file", multiple: "", hidden: "" }, on: { input: e.onImageUpload } })];
|
|
369
|
-
}, proxy: !0 }], null, !1, 3687934814) }) : e._e(), e.showEmojiPicker ? i("dt-popover", { attrs: { "data-qa": "dt-message-input-emoji-picker-popover", open: e.emojiPickerOpened, "initial-focus-element": "#searchInput", padding: "none" }, on: { opened: (
|
|
370
|
-
e.emojiPickerOpened =
|
|
385
|
+
}, proxy: !0 }], null, !1, 3687934814) }) : e._e(), e.showEmojiPicker ? i("dt-popover", { attrs: { "data-qa": "dt-message-input-emoji-picker-popover", open: e.emojiPickerOpened, "initial-focus-element": "#searchInput", padding: "none" }, on: { opened: (a) => {
|
|
386
|
+
e.emojiPickerOpened = a;
|
|
371
387
|
} }, scopedSlots: e._u([{ key: "anchor", fn: function() {
|
|
372
388
|
return [i("dt-tooltip", { attrs: { message: e.emojiTooltipMessage, offset: [0, -4] }, scopedSlots: e._u([{ key: "anchor", fn: function() {
|
|
373
|
-
return [i("dt-button", { attrs: { "data-qa": "dt-message-input-emoji-picker-btn", size: "sm", circle: "", kind: e.emojiPickerHovered ? "default" : "muted", importance: "clear", "aria-label": e.emojiButtonAriaLabel, offset: [0, 0] }, on: { click: e.toggleEmojiPicker, mouseenter: function(
|
|
389
|
+
return [i("dt-button", { attrs: { "data-qa": "dt-message-input-emoji-picker-btn", size: "sm", circle: "", kind: e.emojiPickerHovered ? "default" : "muted", importance: "clear", "aria-label": e.emojiButtonAriaLabel, offset: [0, 0] }, on: { click: e.toggleEmojiPicker, mouseenter: function(a) {
|
|
374
390
|
e.emojiPickerFocus = !0;
|
|
375
|
-
}, mouseleave: function(
|
|
391
|
+
}, mouseleave: function(a) {
|
|
376
392
|
e.emojiPickerFocus = !1;
|
|
377
|
-
}, focus: function(
|
|
393
|
+
}, focus: function(a) {
|
|
378
394
|
e.emojiPickerFocus = !0;
|
|
379
|
-
}, blur: function(
|
|
395
|
+
}, blur: function(a) {
|
|
380
396
|
e.emojiPickerFocus = !1;
|
|
381
397
|
} }, scopedSlots: e._u([{ key: "icon", fn: function() {
|
|
382
398
|
return [i("dt-icon", { attrs: { name: e.emojiPickerHovered ? "very-satisfied" : "satisfied", size: "300" } })];
|
|
@@ -392,13 +408,13 @@ var g = function() {
|
|
|
392
408
|
{
|
|
393
409
|
"message-input-button__disabled d-fc-muted": e.isSendDisabled
|
|
394
410
|
}
|
|
395
|
-
], attrs: { "data-qa": "dt-message-input-send-btn", size: "sm", kind: "default", importance: "primary", "aria-label": e.showSend.ariaLabel, "aria-disabled": e.isSendDisabled }, on: { click: e.onSend, mouseenter: function(
|
|
411
|
+
], attrs: { "data-qa": "dt-message-input-send-btn", size: "sm", kind: "default", importance: "primary", "aria-label": e.showSend.ariaLabel, "aria-disabled": e.isSendDisabled }, on: { click: e.onSend, mouseenter: function(a) {
|
|
396
412
|
e.sendButtonFocus = !0;
|
|
397
|
-
}, mouseleave: function(
|
|
413
|
+
}, mouseleave: function(a) {
|
|
398
414
|
e.sendButtonFocus = !1;
|
|
399
|
-
}, focus: function(
|
|
415
|
+
}, focus: function(a) {
|
|
400
416
|
e.sendButtonFocus = !0;
|
|
401
|
-
}, blur: function(
|
|
417
|
+
}, blur: function(a) {
|
|
402
418
|
e.sendButtonFocus = !1;
|
|
403
419
|
} }, scopedSlots: e._u([e.showSend.icon ? { key: "icon", fn: function() {
|
|
404
420
|
return [i("dt-icon", { attrs: { name: e.showSend.icon, size: "300" } })];
|
|
@@ -414,9 +430,9 @@ var g = function() {
|
|
|
414
430
|
null,
|
|
415
431
|
null
|
|
416
432
|
);
|
|
417
|
-
const
|
|
433
|
+
const v = k.exports;
|
|
418
434
|
export {
|
|
419
|
-
|
|
435
|
+
v as DtRecipeMessageInput,
|
|
420
436
|
s as DtRichTextEditor,
|
|
421
437
|
r as RICH_TEXT_EDITOR_AUTOFOCUS_TYPES,
|
|
422
438
|
l as RICH_TEXT_EDITOR_OUTPUT_FORMATS
|
|
@@ -15559,7 +15559,7 @@ const hy = {
|
|
|
15559
15559
|
this.command(e);
|
|
15560
15560
|
return;
|
|
15561
15561
|
case "mention":
|
|
15562
|
-
this.command({ name: e.name, id: e.
|
|
15562
|
+
this.command({ name: e.name, id: e.id, avatarSrc: e.avatarSrc });
|
|
15563
15563
|
break;
|
|
15564
15564
|
}
|
|
15565
15565
|
}
|
|
@@ -16060,7 +16060,7 @@ const qy = Vy.exports, Wy = Fy.extend({
|
|
|
16060
16060
|
};
|
|
16061
16061
|
},
|
|
16062
16062
|
renderText({ node: n }) {
|
|
16063
|
-
return
|
|
16063
|
+
return `@${n.attrs.id}`;
|
|
16064
16064
|
},
|
|
16065
16065
|
renderHTML({ HTMLAttributes: n }) {
|
|
16066
16066
|
return ["mention-component", B(this.options.HTMLAttributes, n), 0];
|
|
@@ -16103,7 +16103,7 @@ const qy = Vy.exports, Wy = Fy.extend({
|
|
|
16103
16103
|
};
|
|
16104
16104
|
var Yy = function() {
|
|
16105
16105
|
var e = this, t = e._self._c;
|
|
16106
|
-
return t("dt-stack", { attrs: { direction: "row", gap: "400" } }, [t("dt-avatar", { attrs: { "full-name": e.name, "image-src": e.avatarSrc, "image-alt":
|
|
16106
|
+
return t("dt-stack", { attrs: { direction: "row", gap: "400" } }, [t("dt-avatar", { attrs: { "full-name": e.name, "image-src": e.avatarSrc, "image-alt": e.name, size: "xs" } }), e._v(" " + e._s(e.name) + " ")], 1);
|
|
16107
16107
|
}, Xy = [], Qy = /* @__PURE__ */ ee(
|
|
16108
16108
|
Gy,
|
|
16109
16109
|
Yy,
|
|
@@ -16118,6 +16118,7 @@ const Zy = Qy.exports, e0 = {
|
|
|
16118
16118
|
// This function comes from the user and passed to the editor directly.
|
|
16119
16119
|
// This will also activate the mention plugin on the editor
|
|
16120
16120
|
// items: ({ query }) => { return [] },
|
|
16121
|
+
allowSpaces: !0,
|
|
16121
16122
|
render: () => {
|
|
16122
16123
|
let n, e;
|
|
16123
16124
|
return {
|
|
@@ -16146,8 +16147,7 @@ const Zy = Qy.exports, e0 = {
|
|
|
16146
16147
|
});
|
|
16147
16148
|
},
|
|
16148
16149
|
onKeyDown(t) {
|
|
16149
|
-
|
|
16150
|
-
return t.event.key === "Escape" ? (e[0].hide(), !0) : (r = n.ref) == null ? void 0 : r.onKeyDown(t);
|
|
16150
|
+
return t.event.key === "Escape" ? (e[0].hide(), !0) : n == null ? void 0 : n.ref.onKeyDown(t);
|
|
16151
16151
|
},
|
|
16152
16152
|
onExit() {
|
|
16153
16153
|
e[0].destroy(), n.destroy();
|