@dialpad/dialtone 9.151.0 → 9.153.9
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/README.md +1 -34
- package/dist/css/dialtone-default-theme.css +8 -2
- package/dist/css/dialtone-default-theme.min.css +1 -1
- package/dist/css/dialtone.css +8 -2
- package/dist/css/dialtone.min.css +1 -1
- package/dist/tokens/css/tokens-botany-dark.css +1 -1
- package/dist/tokens/css/tokens-buttercream-dark.css +1 -1
- package/dist/tokens/css/tokens-deca-light.css +3 -3
- package/dist/tokens/css/tokens-dp-dark.css +1 -1
- package/dist/tokens/css/tokens-expressive-dark.css +1 -1
- package/dist/tokens/css/tokens-expressive-sm-dark.css +1 -1
- package/dist/tokens/css/tokens-high-desert-dark.css +1 -1
- package/dist/tokens/css/tokens-plum-dark.css +1 -1
- package/dist/tokens/css/tokens-sunflower-dark.css +1 -1
- package/dist/tokens/css/tokens-tmo-dark.css +2 -2
- package/dist/tokens/doc.json +78308 -78308
- package/dist/tokens/themes/botany-dark.cjs +1 -1
- package/dist/tokens/themes/botany-dark.js +1 -1
- package/dist/tokens/themes/buttercream-dark.cjs +1 -1
- package/dist/tokens/themes/buttercream-dark.js +1 -1
- package/dist/tokens/themes/dp-dark.cjs +1 -1
- package/dist/tokens/themes/dp-dark.js +1 -1
- package/dist/tokens/themes/dp-deca-light.cjs +1 -1
- package/dist/tokens/themes/dp-deca-light.js +1 -1
- package/dist/tokens/themes/expressive-dark.cjs +1 -1
- package/dist/tokens/themes/expressive-dark.js +1 -1
- package/dist/tokens/themes/high-desert-dark.cjs +1 -1
- package/dist/tokens/themes/high-desert-dark.js +1 -1
- package/dist/tokens/themes/plum-dark.cjs +1 -1
- package/dist/tokens/themes/plum-dark.js +1 -1
- package/dist/tokens/themes/sunflower-dark.cjs +1 -1
- package/dist/tokens/themes/sunflower-dark.js +1 -1
- package/dist/tokens/themes/tmo-dark.cjs +1 -1
- package/dist/tokens/themes/tmo-dark.js +1 -1
- package/dist/vue2/lib/tab/tab-group.cjs +1 -1
- package/dist/vue2/lib/tab/tab-group.cjs.map +1 -1
- package/dist/vue2/lib/tab/tab-group.js +4 -4
- package/dist/vue2/lib/tab/tab-group.js.map +1 -1
- package/dist/vue2/localization/index.cjs +1 -1
- package/dist/vue2/localization/index.cjs.map +1 -1
- package/dist/vue2/localization/index.js +46 -42
- package/dist/vue2/localization/index.js.map +1 -1
- package/dist/vue2/types/common/sr_only_close_button.vue.d.ts +2 -3
- package/dist/vue2/types/common/sr_only_close_button.vue.d.ts.map +1 -1
- package/dist/vue2/types/components/breadcrumbs/breadcrumbs.vue.d.ts +1 -2
- package/dist/vue2/types/components/breadcrumbs/breadcrumbs.vue.d.ts.map +1 -1
- package/dist/vue2/types/components/button/button.vue.d.ts +1 -2
- package/dist/vue2/types/components/button/button.vue.d.ts.map +1 -1
- package/dist/vue2/types/components/chip/chip.vue.d.ts +2 -3
- package/dist/vue2/types/components/chip/chip.vue.d.ts.map +1 -1
- package/dist/vue2/types/components/datepicker/modules/calendar.vue.d.ts +1 -2
- package/dist/vue2/types/components/datepicker/modules/calendar.vue.d.ts.map +1 -1
- package/dist/vue2/types/components/datepicker/modules/month-year-picker.vue.d.ts +1 -2
- package/dist/vue2/types/components/datepicker/modules/month-year-picker.vue.d.ts.map +1 -1
- package/dist/vue2/types/components/image_viewer/image_viewer.vue.d.ts +2 -3
- package/dist/vue2/types/components/image_viewer/image_viewer.vue.d.ts.map +1 -1
- package/dist/vue2/types/components/loader/loader.vue.d.ts +1 -2
- package/dist/vue2/types/components/loader/loader.vue.d.ts.map +1 -1
- package/dist/vue2/types/components/modal/modal.vue.d.ts +2 -3
- package/dist/vue2/types/components/modal/modal.vue.d.ts.map +1 -1
- package/dist/vue2/types/components/notice/notice_action.vue.d.ts +2 -3
- package/dist/vue2/types/components/notice/notice_action.vue.d.ts.map +1 -1
- package/dist/vue2/types/components/pagination/pagination.vue.d.ts +3 -4
- package/dist/vue2/types/components/pagination/pagination.vue.d.ts.map +1 -1
- package/dist/vue2/types/components/popover/popover_header_footer.vue.d.ts +2 -3
- package/dist/vue2/types/components/popover/popover_header_footer.vue.d.ts.map +1 -1
- package/dist/vue2/types/components/rich_text_editor/rich_text_editor.vue.d.ts +1 -2
- package/dist/vue2/types/components/rich_text_editor/rich_text_editor.vue.d.ts.map +1 -1
- package/dist/vue2/types/recipes/buttons/callbar_button_with_dropdown/callbar_button_with_dropdown.vue.d.ts +2 -3
- package/dist/vue2/types/recipes/buttons/callbar_button_with_dropdown/callbar_button_with_dropdown.vue.d.ts.map +1 -1
- package/dist/vue2/types/recipes/buttons/callbar_button_with_popover/callbar_button_with_popover.vue.d.ts +2 -3
- package/dist/vue2/types/recipes/buttons/callbar_button_with_popover/callbar_button_with_popover.vue.d.ts.map +1 -1
- package/dist/vue2/types/recipes/cards/ivr_node/ivr_node.vue.d.ts +3 -4
- package/dist/vue2/types/recipes/cards/ivr_node/ivr_node.vue.d.ts.map +1 -1
- package/dist/vue2/types/recipes/conversation_view/attachment_carousel/attachment_carousel.vue.d.ts +1 -2
- package/dist/vue2/types/recipes/conversation_view/attachment_carousel/attachment_carousel.vue.d.ts.map +1 -1
- package/dist/vue2/types/recipes/conversation_view/attachment_carousel/media_components/image_carousel.vue.d.ts +2 -3
- package/dist/vue2/types/recipes/conversation_view/attachment_carousel/media_components/image_carousel.vue.d.ts.map +1 -1
- package/dist/vue2/types/recipes/conversation_view/editor/editor.vue.d.ts +14 -15
- package/dist/vue2/types/recipes/conversation_view/editor/editor.vue.d.ts.map +1 -1
- package/dist/vue2/types/recipes/conversation_view/emoji_row/emoji_row.vue.d.ts +2 -3
- package/dist/vue2/types/recipes/conversation_view/emoji_row/emoji_row.vue.d.ts.map +1 -1
- package/dist/vue2/types/recipes/conversation_view/feed_item_pill/feed_item_pill.vue.d.ts +2 -3
- package/dist/vue2/types/recipes/conversation_view/feed_item_pill/feed_item_pill.vue.d.ts.map +1 -1
- package/dist/vue2/types/recipes/conversation_view/message_input/message_input.vue.d.ts +5 -6
- package/dist/vue2/types/recipes/conversation_view/message_input/message_input.vue.d.ts.map +1 -1
- package/dist/vue2/types/recipes/conversation_view/message_input/message_input_link.vue.d.ts +8 -9
- package/dist/vue2/types/recipes/conversation_view/message_input/message_input_link.vue.d.ts.map +1 -1
- package/dist/vue2/types/recipes/conversation_view/message_input/message_input_topbar.vue.d.ts +9 -10
- package/dist/vue2/types/recipes/conversation_view/message_input/message_input_topbar.vue.d.ts.map +1 -1
- package/dist/vue2/types/recipes/leftbar/contact_centers_row/contact_centers_row.vue.d.ts +2 -3
- package/dist/vue2/types/recipes/leftbar/contact_centers_row/contact_centers_row.vue.d.ts.map +1 -1
- package/dist/vue2/types/recipes/leftbar/general_row/general_row.vue.d.ts +2 -3
- package/dist/vue2/types/recipes/leftbar/general_row/general_row.vue.d.ts.map +1 -1
- package/dist/vue2/types/recipes/leftbar/group_row/group_row.vue.d.ts +1 -2
- package/dist/vue2/types/recipes/leftbar/group_row/group_row.vue.d.ts.map +1 -1
- package/dist/vue2/types/recipes/leftbar/unread_pill/unread_pill.vue.d.ts +2 -3
- package/dist/vue2/types/recipes/leftbar/unread_pill/unread_pill.vue.d.ts.map +1 -1
- package/dist/vue3/component-documentation.json +1 -1
- package/dist/vue3/lib/combobox-multi-select/combobox-multi-select.cjs +1 -1
- package/dist/vue3/lib/combobox-multi-select/combobox-multi-select.cjs.map +1 -1
- package/dist/vue3/lib/combobox-multi-select/combobox-multi-select.js +100 -93
- package/dist/vue3/lib/combobox-multi-select/combobox-multi-select.js.map +1 -1
- package/dist/vue3/lib/radio/radio.cjs +1 -1
- package/dist/vue3/lib/radio/radio.cjs.map +1 -1
- package/dist/vue3/lib/radio/radio.js +7 -14
- package/dist/vue3/lib/radio/radio.js.map +1 -1
- package/dist/vue3/lib/rich-text-editor/mention-suggestion.cjs +1 -1
- package/dist/vue3/lib/rich-text-editor/mention-suggestion.cjs.map +1 -1
- package/dist/vue3/lib/rich-text-editor/mention-suggestion.js +12 -2
- package/dist/vue3/lib/rich-text-editor/mention-suggestion.js.map +1 -1
- package/dist/vue3/lib/rich-text-editor/rich-text-editor.cjs +4 -4
- package/dist/vue3/lib/rich-text-editor/rich-text-editor.cjs.map +1 -1
- package/dist/vue3/lib/rich-text-editor/rich-text-editor.js +95 -73
- package/dist/vue3/lib/rich-text-editor/rich-text-editor.js.map +1 -1
- package/dist/vue3/lib/tab/tab-group.cjs +1 -1
- package/dist/vue3/lib/tab/tab-group.cjs.map +1 -1
- package/dist/vue3/lib/tab/tab-group.js +1 -1
- package/dist/vue3/lib/tab/tab-group.js.map +1 -1
- package/dist/vue3/lib/tooltip-directive/tooltip.cjs +1 -1
- package/dist/vue3/lib/tooltip-directive/tooltip.cjs.map +1 -1
- package/dist/vue3/lib/tooltip-directive/tooltip.js +21 -21
- package/dist/vue3/lib/tooltip-directive/tooltip.js.map +1 -1
- package/dist/vue3/localization/index.cjs +1 -1
- package/dist/vue3/localization/index.cjs.map +1 -1
- package/dist/vue3/localization/index.js +48 -46
- package/dist/vue3/localization/index.js.map +1 -1
- package/dist/vue3/types/common/sr_only_close_button.vue.d.ts +2 -3
- package/dist/vue3/types/common/sr_only_close_button.vue.d.ts.map +1 -1
- package/dist/vue3/types/components/breadcrumbs/breadcrumbs.vue.d.ts +1 -2
- package/dist/vue3/types/components/breadcrumbs/breadcrumbs.vue.d.ts.map +1 -1
- package/dist/vue3/types/components/button/button.vue.d.ts +1 -2
- package/dist/vue3/types/components/button/button.vue.d.ts.map +1 -1
- package/dist/vue3/types/components/chip/chip.vue.d.ts +2 -3
- package/dist/vue3/types/components/chip/chip.vue.d.ts.map +1 -1
- package/dist/vue3/types/components/image_viewer/image_viewer.vue.d.ts +2 -3
- package/dist/vue3/types/components/image_viewer/image_viewer.vue.d.ts.map +1 -1
- package/dist/vue3/types/components/modal/modal.vue.d.ts +2 -3
- package/dist/vue3/types/components/modal/modal.vue.d.ts.map +1 -1
- package/dist/vue3/types/components/notice/notice_action.vue.d.ts +2 -3
- package/dist/vue3/types/components/notice/notice_action.vue.d.ts.map +1 -1
- package/dist/vue3/types/components/pagination/pagination.vue.d.ts +3 -4
- package/dist/vue3/types/components/pagination/pagination.vue.d.ts.map +1 -1
- package/dist/vue3/types/components/popover/popover_header_footer.vue.d.ts +2 -3
- package/dist/vue3/types/components/popover/popover_header_footer.vue.d.ts.map +1 -1
- package/dist/vue3/types/components/radio/radio.vue.d.ts +1 -2
- package/dist/vue3/types/components/radio/radio.vue.d.ts.map +1 -1
- package/dist/vue3/types/components/rich_text_editor/extensions/mentions/MentionComponent.vue.d.ts +3 -1
- package/dist/vue3/types/components/rich_text_editor/extensions/mentions/MentionComponent.vue.d.ts.map +1 -1
- package/dist/vue3/types/components/rich_text_editor/mention_suggestion.d.ts +3 -0
- package/dist/vue3/types/components/rich_text_editor/mention_suggestion.d.ts.map +1 -1
- package/dist/vue3/types/components/rich_text_editor/rich_text_editor.vue.d.ts +3 -3
- package/dist/vue3/types/components/rich_text_editor/rich_text_editor.vue.d.ts.map +1 -1
- package/dist/vue3/types/recipes/buttons/callbar_button_with_dropdown/callbar_button_with_dropdown.vue.d.ts +2 -3
- package/dist/vue3/types/recipes/buttons/callbar_button_with_dropdown/callbar_button_with_dropdown.vue.d.ts.map +1 -1
- package/dist/vue3/types/recipes/buttons/callbar_button_with_popover/callbar_button_with_popover.vue.d.ts +2 -3
- package/dist/vue3/types/recipes/buttons/callbar_button_with_popover/callbar_button_with_popover.vue.d.ts.map +1 -1
- package/dist/vue3/types/recipes/cards/ivr_node/ivr_node.vue.d.ts +3 -4
- package/dist/vue3/types/recipes/cards/ivr_node/ivr_node.vue.d.ts.map +1 -1
- package/dist/vue3/types/recipes/conversation_view/attachment_carousel/attachment_carousel.vue.d.ts +1 -2
- package/dist/vue3/types/recipes/conversation_view/attachment_carousel/attachment_carousel.vue.d.ts.map +1 -1
- package/dist/vue3/types/recipes/conversation_view/attachment_carousel/media_components/image_carousel.vue.d.ts +2 -3
- package/dist/vue3/types/recipes/conversation_view/attachment_carousel/media_components/image_carousel.vue.d.ts.map +1 -1
- package/dist/vue3/types/recipes/conversation_view/editor/editor.vue.d.ts +14 -15
- package/dist/vue3/types/recipes/conversation_view/editor/editor.vue.d.ts.map +1 -1
- package/dist/vue3/types/recipes/conversation_view/emoji_row/composables/useMockReactions.d.ts +2 -0
- package/dist/vue3/types/recipes/conversation_view/emoji_row/composables/useMockReactions.d.ts.map +1 -0
- package/dist/vue3/types/recipes/conversation_view/emoji_row/emoji_row.vue.d.ts +2 -3
- package/dist/vue3/types/recipes/conversation_view/emoji_row/emoji_row.vue.d.ts.map +1 -1
- package/dist/vue3/types/recipes/conversation_view/feed_item_pill/feed_item_pill.vue.d.ts +2 -3
- package/dist/vue3/types/recipes/conversation_view/feed_item_pill/feed_item_pill.vue.d.ts.map +1 -1
- package/dist/vue3/types/recipes/conversation_view/message_input/extensions/meeting_pill/MeetingPill.vue.d.ts +2 -3
- package/dist/vue3/types/recipes/conversation_view/message_input/extensions/meeting_pill/MeetingPill.vue.d.ts.map +1 -1
- package/dist/vue3/types/recipes/conversation_view/message_input/message_input.vue.d.ts +5 -6
- package/dist/vue3/types/recipes/conversation_view/message_input/message_input.vue.d.ts.map +1 -1
- package/dist/vue3/types/recipes/conversation_view/message_input/message_input_link.vue.d.ts +8 -9
- package/dist/vue3/types/recipes/conversation_view/message_input/message_input_link.vue.d.ts.map +1 -1
- package/dist/vue3/types/recipes/conversation_view/message_input/message_input_topbar.vue.d.ts +9 -10
- package/dist/vue3/types/recipes/conversation_view/message_input/message_input_topbar.vue.d.ts.map +1 -1
- package/dist/vue3/types/recipes/leftbar/contact_centers_row/contact_centers_row.vue.d.ts +2 -3
- package/dist/vue3/types/recipes/leftbar/contact_centers_row/contact_centers_row.vue.d.ts.map +1 -1
- package/dist/vue3/types/recipes/leftbar/general_row/general_row.vue.d.ts +2 -3
- package/dist/vue3/types/recipes/leftbar/general_row/general_row.vue.d.ts.map +1 -1
- package/dist/vue3/types/recipes/leftbar/group_row/group_row.vue.d.ts +1 -2
- package/dist/vue3/types/recipes/leftbar/group_row/group_row.vue.d.ts.map +1 -1
- package/dist/vue3/types/recipes/leftbar/unread_pill/unread_pill.vue.d.ts +2 -3
- package/dist/vue3/types/recipes/leftbar/unread_pill/unread_pill.vue.d.ts.map +1 -1
- package/package.json +4 -4
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("./tabs-constants.cjs"),a=require("vue"),b=require("../../_plugin-vue_export-helper-BRilXfQE.cjs"),o={compatConfig:{MODE:3},name:"DtTabGroup",provide(){return{groupContext:this.provideObj,setFocus:this.setFocus}},props:{label:{type:String,default:""},selected:{type:String,default:""},disabled:{type:Boolean,default:!1},inverted:{type:Boolean,default:!1},borderless:{type:Boolean,default:!1},size:{type:String,default:"default",validate(t){return n.TAB_LIST_SIZES.includes(t)}},tabListClass:{type:[String,Array,Object],default:""},tabListChildProps:{type:Object,default:()=>({})}},emits:["change","before-change"],data(){return{provideObj:{selected:"",disabled:!1},focusId:null,tabs:[],TAB_LIST_SIZE_MODIFIERS:n.TAB_LIST_SIZE_MODIFIERS,TAB_LIST_KIND_MODIFIERS:n.TAB_LIST_KIND_MODIFIERS,TAB_LIST_IMPORTANCE_MODIFIERS:n.TAB_LIST_IMPORTANCE_MODIFIERS}},watch:{disabled:{immediate:!0,handler(){this.provideObj.disabled=this.disabled}},selected:{immediate:!0,handler(){this.provideObj.selected=this.selected}}},mounted(){this.updateSelected()},
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("./tabs-constants.cjs"),a=require("vue"),b=require("../../_plugin-vue_export-helper-BRilXfQE.cjs"),o={compatConfig:{MODE:3},name:"DtTabGroup",provide(){return{groupContext:this.provideObj,setFocus:this.setFocus}},props:{label:{type:String,default:""},selected:{type:String,default:""},disabled:{type:Boolean,default:!1},inverted:{type:Boolean,default:!1},borderless:{type:Boolean,default:!1},size:{type:String,default:"default",validate(t){return n.TAB_LIST_SIZES.includes(t)}},tabListClass:{type:[String,Array,Object],default:""},tabListChildProps:{type:Object,default:()=>({})}},emits:["change","before-change"],data(){return{provideObj:{selected:"",disabled:!1},focusId:null,tabs:[],TAB_LIST_SIZE_MODIFIERS:n.TAB_LIST_SIZE_MODIFIERS,TAB_LIST_KIND_MODIFIERS:n.TAB_LIST_KIND_MODIFIERS,TAB_LIST_IMPORTANCE_MODIFIERS:n.TAB_LIST_IMPORTANCE_MODIFIERS}},watch:{disabled:{immediate:!0,handler(){this.provideObj.disabled=this.disabled}},selected:{immediate:!0,handler(){this.provideObj.selected=this.selected}}},mounted(){this.updateSelected()},updated(){this.updateSelected()},methods:{updateSelected(){this.provideObj.selected||(this.provideObj.selected=this.selected),this.tabs=this.getTabChildren()},setFocus(t){this.focusId=t},getTabChildren(){return Array.from(this.$refs.tabs.querySelectorAll(".d-tab")).map(e=>{var d,l;return{context:e,panelId:(d=e.getAttribute("aria-controls"))==null?void 0:d.replace("dt-panel-",""),tabId:(l=e.getAttribute("id"))==null?void 0:l.replace("dt-tab-",""),isSelected:e.getAttribute("aria-selected")==="true"}})},onChange(){this.$emit("change",{...this.provideObj})},tabLeft(){const t=this.getFocusedTabIndex();if(t===-1)return;const e=t-1<0?this.tabs.length-1:t-1;this.selectFocusOnTab(e)},tabRight(){const t=this.getFocusedTabIndex();if(t===-1)return;const e=t+1>this.tabs.length-1?0:t+1;this.selectFocusOnTab(e)},selectFocusOnTab(t){const{context:e}=this.tabs[t];e.focus()},selectTab(t){if(this.isSameTabClicked()||(this.$emit("before-change",t),t.defaultPrevented))return;const e=this.getFocusedTabIndex();this.selectTabByIndex(e),this.onChange()},selectTabByIndex(t){const{context:e,panelId:d}=this.tabs[t];this.provideObj.selected=d,e.focus()},getFocusedTabIndex(){const t=this.tabs.findIndex(e=>this.focusId?e.tabId===`${this.focusId}`:e.isSelected);return t===-1?0:t},onHomeButton(){var t,e;this.tabs.length!==0&&((e=(t=this.tabs[0])==null?void 0:t.context)==null||e.focus())},onEndButton(){var t,e;this.tabs.length!==0&&((e=(t=this.tabs[this.tabs.length-1])==null?void 0:t.context)==null||e.focus())},isSameTabClicked(){const t=this.tabs[this.getFocusedTabIndex()];return this.provideObj.selected===t.panelId}}},u={"data-qa":"dt-tab-group"},c=["aria-label"];function h(t,e,d,l,r,s){return a.openBlock(),a.createElementBlock("div",u,[a.createElementVNode("div",a.mergeProps({ref:"tabs",class:["d-tablist",r.TAB_LIST_SIZE_MODIFIERS[d.size],{[r.TAB_LIST_KIND_MODIFIERS.inverted]:d.inverted,[r.TAB_LIST_IMPORTANCE_MODIFIERS.borderless]:d.borderless},d.tabListClass]},d.tabListChildProps,{role:"tablist","aria-label":d.label,onKeyup:[e[0]||(e[0]=a.withKeys((...i)=>s.tabLeft&&s.tabLeft(...i),["left"])),e[1]||(e[1]=a.withKeys((...i)=>s.tabRight&&s.tabRight(...i),["right"])),e[2]||(e[2]=a.withKeys((...i)=>s.selectTab&&s.selectTab(...i),["enter"])),e[3]||(e[3]=a.withKeys((...i)=>s.selectTab&&s.selectTab(...i),["space"]))],onClick:e[4]||(e[4]=(...i)=>s.selectTab&&s.selectTab(...i)),onKeydown:[e[5]||(e[5]=a.withKeys((...i)=>s.onHomeButton&&s.onHomeButton(...i),["home"])),e[6]||(e[6]=a.withKeys((...i)=>s.onEndButton&&s.onEndButton(...i),["end"]))]}),[a.renderSlot(t.$slots,"tabs")],16,c),a.renderSlot(t.$slots,"default")])}const I=b._(o,[["render",h]]);exports.default=I;
|
|
2
2
|
//# sourceMappingURL=tab-group.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tab-group.cjs","sources":["../../../components/tab/tab_group.vue"],"sourcesContent":["<template>\n <div\n data-qa=\"dt-tab-group\"\n >\n <!-- eslint-disable-next-line vuejs-accessibility/interactive-supports-focus -->\n <div\n ref=\"tabs\"\n :class=\"[\n 'd-tablist',\n TAB_LIST_SIZE_MODIFIERS[size],\n {\n [TAB_LIST_KIND_MODIFIERS.inverted]: inverted,\n [TAB_LIST_IMPORTANCE_MODIFIERS.borderless]: borderless,\n },\n tabListClass,\n ]\"\n v-bind=\"tabListChildProps\"\n role=\"tablist\"\n :aria-label=\"label\"\n @keyup.left=\"tabLeft\"\n @keyup.right=\"tabRight\"\n @keyup.enter=\"selectTab\"\n @keyup.space=\"selectTab\"\n @click=\"selectTab\"\n @keydown.home=\"onHomeButton\"\n @keydown.end=\"onEndButton\"\n >\n <!-- @slot Slot for Tabs -->\n <slot name=\"tabs\" />\n </div>\n <!-- @slot Default slot for Panel -->\n <slot />\n </div>\n</template>\n\n<script>\nimport {\n TAB_LIST_SIZES,\n TAB_LIST_KIND_MODIFIERS,\n TAB_LIST_IMPORTANCE_MODIFIERS,\n TAB_LIST_SIZE_MODIFIERS,\n} from './tabs_constants';\n\n/**\n * Tabs allow users to navigation between grouped content in different views while within the same page context.\n * @see https://dialtone.dialpad.com/components/tabs.html\n */\nexport default {\n compatConfig: { MODE: 3 },\n name: 'DtTabGroup',\n\n provide () {\n return {\n groupContext: this.provideObj,\n setFocus: this.setFocus,\n };\n },\n\n props: {\n /**\n * Identifies the tab group\n */\n label: {\n type: String,\n default: '',\n },\n\n /**\n * The id of the selected tab panel which should be displayed\n */\n selected: {\n type: String,\n default: '',\n },\n\n /**\n * If true, disables the tab group\n * @values true, false\n */\n disabled: {\n type: Boolean,\n default: false,\n },\n\n /**\n * If true, applies inverted styles to the tab group\n * @values true, false\n */\n inverted: {\n type: Boolean,\n default: false,\n },\n\n /**\n * If true, applies borderless styles to the tab group\n * @values true, false\n */\n borderless: {\n type: Boolean,\n default: false,\n },\n\n /**\n * If provided, applies size styles to the tab group\n * @values default, sm\n */\n size: {\n type: String,\n default: 'default',\n validate (size) {\n return TAB_LIST_SIZES.includes(size);\n },\n },\n\n /**\n * Pass through classes, used to customize the tab list\n */\n tabListClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Pass through props, used to customize the tab list\n */\n tabListChildProps: {\n type: Object,\n default: () => ({}),\n },\n },\n\n emits: [\n /**\n * Change tab event with the arguments: selected id of the current tab and disabled value\n *\n * @event change\n * @type {Object}\n */\n 'change',\n\n /**\n * Before change tab event with the event argument, useful to perform validations and prevent changing tabs if neccessary.\n *\n * @event before-change\n * @type {Event}\n */\n 'before-change',\n ],\n\n data () {\n return {\n provideObj: {\n selected: '', // the currently displayed tab id\n disabled: false, // disable group\n },\n\n focusId: null,\n tabs: [],\n TAB_LIST_SIZE_MODIFIERS,\n TAB_LIST_KIND_MODIFIERS,\n TAB_LIST_IMPORTANCE_MODIFIERS,\n };\n },\n\n watch: {\n disabled: {\n immediate: true,\n handler () {\n this.provideObj.disabled = this.disabled;\n },\n },\n\n selected: {\n immediate: true,\n handler () {\n this.provideObj.selected = this.selected;\n },\n },\n },\n\n mounted () {\n this.updateSelected();\n },\n\n beforeUpdate () {\n this.updateSelected();\n },\n\n methods: {\n updateSelected () {\n /**\n * Prevent override tab selected by default\n */\n if (!this.provideObj.selected) {\n this.provideObj.selected = this.selected;\n }\n this.tabs = this.getTabChildren();\n },\n\n setFocus (focusId) {\n this.focusId = focusId;\n },\n\n getTabChildren () {\n const tabs = Array.from(this.$refs.tabs.querySelectorAll('.d-tab'));\n return tabs\n .map(el => {\n return ({\n context: el,\n panelId: el.getAttribute('aria-controls')?.replace('dt-panel-', ''),\n tabId: el.getAttribute('id')?.replace('dt-tab-', ''),\n isSelected: el.getAttribute('aria-selected') === 'true',\n });\n });\n },\n\n onChange () {\n this.$emit('change', { ...this.provideObj });\n },\n\n tabLeft () {\n const index = this.getFocusedTabIndex();\n if (index === -1) return;\n\n const indexElement = index - 1 < 0 ? this.tabs.length - 1 : index - 1;\n this.selectFocusOnTab(indexElement);\n },\n\n tabRight () {\n const index = this.getFocusedTabIndex();\n if (index === -1) return;\n\n const indexElement = index + 1 > this.tabs.length - 1 ? 0 : index + 1;\n this.selectFocusOnTab(indexElement);\n },\n\n selectFocusOnTab (index) {\n const { context } = this.tabs[index];\n context.focus();\n },\n\n selectTab (event) {\n if (this.isSameTabClicked()) return;\n\n this.$emit('before-change', event);\n if (event.defaultPrevented) return;\n\n const index = this.getFocusedTabIndex();\n\n this.selectTabByIndex(index);\n this.onChange();\n },\n\n selectTabByIndex (index) {\n const { context, panelId } = this.tabs[index];\n this.provideObj.selected = panelId;\n context.focus();\n },\n\n getFocusedTabIndex () {\n // Hot fix https://github.com/dialpad/dialtone/pull/849\n // The main issue is that this.tabs is not being updated at the time this is being triggered.\n\n const index = this.tabs.findIndex((context) =>\n this.focusId ? context.tabId === `${this.focusId}` : context.isSelected,\n );\n\n return index === -1 ? 0 : index;\n },\n\n onHomeButton () {\n if (this.tabs.length === 0) return;\n this.tabs[0]?.context?.focus();\n },\n\n onEndButton () {\n if (this.tabs.length === 0) return;\n this.tabs[this.tabs.length - 1]?.context?.focus();\n },\n\n isSameTabClicked () {\n const tab = this.tabs[this.getFocusedTabIndex()];\n return this.provideObj.selected === tab.panelId;\n },\n },\n};\n</script>\n"],"names":["_sfc_main","size","TAB_LIST_SIZES","TAB_LIST_SIZE_MODIFIERS","TAB_LIST_KIND_MODIFIERS","TAB_LIST_IMPORTANCE_MODIFIERS","focusId","el","_a","_b","index","indexElement","context","event","panelId","tab","_hoisted_1","_hoisted_2","_openBlock","_createElementBlock","_createElementVNode","_mergeProps","$data","$props","_cache","_withKeys","args","$options","_renderSlot","_ctx"],"mappings":"+NA+CKA,EAAU,CACb,aAAc,CAAE,KAAM,GACtB,KAAM,aAEN,SAAW,CACT,MAAO,CACL,aAAc,KAAK,WACnB,SAAU,KAAK,SAEnB,EAEA,MAAO,CAIL,MAAO,CACL,KAAM,OACN,QAAS,IAMX,SAAU,CACR,KAAM,OACN,QAAS,IAOX,SAAU,CACR,KAAM,QACN,QAAS,IAOX,SAAU,CACR,KAAM,QACN,QAAS,IAOX,WAAY,CACV,KAAM,QACN,QAAS,IAOX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AA,EAAA,YAAA,GAAAD,CAAA,EAAW,CAAA,KAAA,CAAA,OAGzBE,aAAoBC,EAAA,OAAA,MAAA,CA5B1B,EAAA,GAAAZ,CAAA,EA+BIW,aAAQC,EAAA,OAAA,SAAA"}
|
|
1
|
+
{"version":3,"file":"tab-group.cjs","sources":["../../../components/tab/tab_group.vue"],"sourcesContent":["<template>\n <div\n data-qa=\"dt-tab-group\"\n >\n <!-- eslint-disable-next-line vuejs-accessibility/interactive-supports-focus -->\n <div\n ref=\"tabs\"\n :class=\"[\n 'd-tablist',\n TAB_LIST_SIZE_MODIFIERS[size],\n {\n [TAB_LIST_KIND_MODIFIERS.inverted]: inverted,\n [TAB_LIST_IMPORTANCE_MODIFIERS.borderless]: borderless,\n },\n tabListClass,\n ]\"\n v-bind=\"tabListChildProps\"\n role=\"tablist\"\n :aria-label=\"label\"\n @keyup.left=\"tabLeft\"\n @keyup.right=\"tabRight\"\n @keyup.enter=\"selectTab\"\n @keyup.space=\"selectTab\"\n @click=\"selectTab\"\n @keydown.home=\"onHomeButton\"\n @keydown.end=\"onEndButton\"\n >\n <!-- @slot Slot for Tabs -->\n <slot name=\"tabs\" />\n </div>\n <!-- @slot Default slot for Panel -->\n <slot />\n </div>\n</template>\n\n<script>\nimport {\n TAB_LIST_SIZES,\n TAB_LIST_KIND_MODIFIERS,\n TAB_LIST_IMPORTANCE_MODIFIERS,\n TAB_LIST_SIZE_MODIFIERS,\n} from './tabs_constants';\n\n/**\n * Tabs allow users to navigation between grouped content in different views while within the same page context.\n * @see https://dialtone.dialpad.com/components/tabs.html\n */\nexport default {\n compatConfig: { MODE: 3 },\n name: 'DtTabGroup',\n\n provide () {\n return {\n groupContext: this.provideObj,\n setFocus: this.setFocus,\n };\n },\n\n props: {\n /**\n * Identifies the tab group\n */\n label: {\n type: String,\n default: '',\n },\n\n /**\n * The id of the selected tab panel which should be displayed\n */\n selected: {\n type: String,\n default: '',\n },\n\n /**\n * If true, disables the tab group\n * @values true, false\n */\n disabled: {\n type: Boolean,\n default: false,\n },\n\n /**\n * If true, applies inverted styles to the tab group\n * @values true, false\n */\n inverted: {\n type: Boolean,\n default: false,\n },\n\n /**\n * If true, applies borderless styles to the tab group\n * @values true, false\n */\n borderless: {\n type: Boolean,\n default: false,\n },\n\n /**\n * If provided, applies size styles to the tab group\n * @values default, sm\n */\n size: {\n type: String,\n default: 'default',\n validate (size) {\n return TAB_LIST_SIZES.includes(size);\n },\n },\n\n /**\n * Pass through classes, used to customize the tab list\n */\n tabListClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Pass through props, used to customize the tab list\n */\n tabListChildProps: {\n type: Object,\n default: () => ({}),\n },\n },\n\n emits: [\n /**\n * Change tab event with the arguments: selected id of the current tab and disabled value\n *\n * @event change\n * @type {Object}\n */\n 'change',\n\n /**\n * Before change tab event with the event argument, useful to perform validations and prevent changing tabs if neccessary.\n *\n * @event before-change\n * @type {Event}\n */\n 'before-change',\n ],\n\n data () {\n return {\n provideObj: {\n selected: '', // the currently displayed tab id\n disabled: false, // disable group\n },\n\n focusId: null,\n tabs: [],\n TAB_LIST_SIZE_MODIFIERS,\n TAB_LIST_KIND_MODIFIERS,\n TAB_LIST_IMPORTANCE_MODIFIERS,\n };\n },\n\n watch: {\n disabled: {\n immediate: true,\n handler () {\n this.provideObj.disabled = this.disabled;\n },\n },\n\n selected: {\n immediate: true,\n handler () {\n this.provideObj.selected = this.selected;\n },\n },\n },\n\n mounted () {\n this.updateSelected();\n },\n\n updated () {\n this.updateSelected();\n },\n\n methods: {\n updateSelected () {\n /**\n * Prevent override tab selected by default\n */\n if (!this.provideObj.selected) {\n this.provideObj.selected = this.selected;\n }\n this.tabs = this.getTabChildren();\n },\n\n setFocus (focusId) {\n this.focusId = focusId;\n },\n\n getTabChildren () {\n const tabs = Array.from(this.$refs.tabs.querySelectorAll('.d-tab'));\n return tabs\n .map(el => {\n return ({\n context: el,\n panelId: el.getAttribute('aria-controls')?.replace('dt-panel-', ''),\n tabId: el.getAttribute('id')?.replace('dt-tab-', ''),\n isSelected: el.getAttribute('aria-selected') === 'true',\n });\n });\n },\n\n onChange () {\n this.$emit('change', { ...this.provideObj });\n },\n\n tabLeft () {\n const index = this.getFocusedTabIndex();\n if (index === -1) return;\n\n const indexElement = index - 1 < 0 ? this.tabs.length - 1 : index - 1;\n this.selectFocusOnTab(indexElement);\n },\n\n tabRight () {\n const index = this.getFocusedTabIndex();\n if (index === -1) return;\n\n const indexElement = index + 1 > this.tabs.length - 1 ? 0 : index + 1;\n this.selectFocusOnTab(indexElement);\n },\n\n selectFocusOnTab (index) {\n const { context } = this.tabs[index];\n context.focus();\n },\n\n selectTab (event) {\n if (this.isSameTabClicked()) return;\n\n this.$emit('before-change', event);\n if (event.defaultPrevented) return;\n\n const index = this.getFocusedTabIndex();\n\n this.selectTabByIndex(index);\n this.onChange();\n },\n\n selectTabByIndex (index) {\n const { context, panelId } = this.tabs[index];\n this.provideObj.selected = panelId;\n context.focus();\n },\n\n getFocusedTabIndex () {\n // Hot fix https://github.com/dialpad/dialtone/pull/849\n // The main issue is that this.tabs is not being updated at the time this is being triggered.\n\n const index = this.tabs.findIndex((context) =>\n this.focusId ? context.tabId === `${this.focusId}` : context.isSelected,\n );\n\n return index === -1 ? 0 : index;\n },\n\n onHomeButton () {\n if (this.tabs.length === 0) return;\n this.tabs[0]?.context?.focus();\n },\n\n onEndButton () {\n if (this.tabs.length === 0) return;\n this.tabs[this.tabs.length - 1]?.context?.focus();\n },\n\n isSameTabClicked () {\n const tab = this.tabs[this.getFocusedTabIndex()];\n return this.provideObj.selected === tab.panelId;\n },\n },\n};\n</script>\n"],"names":["_sfc_main","size","TAB_LIST_SIZES","TAB_LIST_SIZE_MODIFIERS","TAB_LIST_KIND_MODIFIERS","TAB_LIST_IMPORTANCE_MODIFIERS","focusId","el","_a","_b","index","indexElement","context","event","panelId","tab","_hoisted_1","_hoisted_2","_openBlock","_createElementBlock","_createElementVNode","_mergeProps","$data","$props","_cache","_withKeys","args","$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AD,CAAA,EAAS,CAAA,OAAA,CAAA,IACtB,4BAAOC,EAAA,WAAAA,EAAA,UAAA,GAAAD,CAAA,GACP,UAAO,CAxBdF,EAAA,CAAA,IAAAA,EAAA,CAAA,EAAAC,EAAAA,SAAA,IAAAC,IAwBqBC,EAAA,cAAAA,EAAA,aAAA,GAAAD,CAAA,EAAY,CAAA,MAAA,CAAA,GAxBjCF,EAAA,CAAA,IAAAA,EAAA,CAAA,EAAAC,EAAAA,SAAA,IAAAC,IAyBoBC,EAAA,aAAAA,EAAA,YAAA,GAAAD,CAAA,EAAW,CAAA,KAAA,CAAA,OAGzBE,aAAoBC,EAAA,OAAA,MAAA,CA5B1B,EAAA,GAAAZ,CAAA,EA+BIW,aAAQC,EAAA,OAAA,SAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tab-group.js","sources":["../../../components/tab/tab_group.vue"],"sourcesContent":["<template>\n <div\n data-qa=\"dt-tab-group\"\n >\n <!-- eslint-disable-next-line vuejs-accessibility/interactive-supports-focus -->\n <div\n ref=\"tabs\"\n :class=\"[\n 'd-tablist',\n TAB_LIST_SIZE_MODIFIERS[size],\n {\n [TAB_LIST_KIND_MODIFIERS.inverted]: inverted,\n [TAB_LIST_IMPORTANCE_MODIFIERS.borderless]: borderless,\n },\n tabListClass,\n ]\"\n v-bind=\"tabListChildProps\"\n role=\"tablist\"\n :aria-label=\"label\"\n @keyup.left=\"tabLeft\"\n @keyup.right=\"tabRight\"\n @keyup.enter=\"selectTab\"\n @keyup.space=\"selectTab\"\n @click=\"selectTab\"\n @keydown.home=\"onHomeButton\"\n @keydown.end=\"onEndButton\"\n >\n <!-- @slot Slot for Tabs -->\n <slot name=\"tabs\" />\n </div>\n <!-- @slot Default slot for Panel -->\n <slot />\n </div>\n</template>\n\n<script>\nimport {\n TAB_LIST_SIZES,\n TAB_LIST_KIND_MODIFIERS,\n TAB_LIST_IMPORTANCE_MODIFIERS,\n TAB_LIST_SIZE_MODIFIERS,\n} from './tabs_constants';\n\n/**\n * Tabs allow users to navigation between grouped content in different views while within the same page context.\n * @see https://dialtone.dialpad.com/components/tabs.html\n */\nexport default {\n compatConfig: { MODE: 3 },\n name: 'DtTabGroup',\n\n provide () {\n return {\n groupContext: this.provideObj,\n setFocus: this.setFocus,\n };\n },\n\n props: {\n /**\n * Identifies the tab group\n */\n label: {\n type: String,\n default: '',\n },\n\n /**\n * The id of the selected tab panel which should be displayed\n */\n selected: {\n type: String,\n default: '',\n },\n\n /**\n * If true, disables the tab group\n * @values true, false\n */\n disabled: {\n type: Boolean,\n default: false,\n },\n\n /**\n * If true, applies inverted styles to the tab group\n * @values true, false\n */\n inverted: {\n type: Boolean,\n default: false,\n },\n\n /**\n * If true, applies borderless styles to the tab group\n * @values true, false\n */\n borderless: {\n type: Boolean,\n default: false,\n },\n\n /**\n * If provided, applies size styles to the tab group\n * @values default, sm\n */\n size: {\n type: String,\n default: 'default',\n validate (size) {\n return TAB_LIST_SIZES.includes(size);\n },\n },\n\n /**\n * Pass through classes, used to customize the tab list\n */\n tabListClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Pass through props, used to customize the tab list\n */\n tabListChildProps: {\n type: Object,\n default: () => ({}),\n },\n },\n\n emits: [\n /**\n * Change tab event with the arguments: selected id of the current tab and disabled value\n *\n * @event change\n * @type {Object}\n */\n 'change',\n\n /**\n * Before change tab event with the event argument, useful to perform validations and prevent changing tabs if neccessary.\n *\n * @event before-change\n * @type {Event}\n */\n 'before-change',\n ],\n\n data () {\n return {\n provideObj: {\n selected: '', // the currently displayed tab id\n disabled: false, // disable group\n },\n\n focusId: null,\n tabs: [],\n TAB_LIST_SIZE_MODIFIERS,\n TAB_LIST_KIND_MODIFIERS,\n TAB_LIST_IMPORTANCE_MODIFIERS,\n };\n },\n\n watch: {\n disabled: {\n immediate: true,\n handler () {\n this.provideObj.disabled = this.disabled;\n },\n },\n\n selected: {\n immediate: true,\n handler () {\n this.provideObj.selected = this.selected;\n },\n },\n },\n\n mounted () {\n this.updateSelected();\n },\n\n beforeUpdate () {\n this.updateSelected();\n },\n\n methods: {\n updateSelected () {\n /**\n * Prevent override tab selected by default\n */\n if (!this.provideObj.selected) {\n this.provideObj.selected = this.selected;\n }\n this.tabs = this.getTabChildren();\n },\n\n setFocus (focusId) {\n this.focusId = focusId;\n },\n\n getTabChildren () {\n const tabs = Array.from(this.$refs.tabs.querySelectorAll('.d-tab'));\n return tabs\n .map(el => {\n return ({\n context: el,\n panelId: el.getAttribute('aria-controls')?.replace('dt-panel-', ''),\n tabId: el.getAttribute('id')?.replace('dt-tab-', ''),\n isSelected: el.getAttribute('aria-selected') === 'true',\n });\n });\n },\n\n onChange () {\n this.$emit('change', { ...this.provideObj });\n },\n\n tabLeft () {\n const index = this.getFocusedTabIndex();\n if (index === -1) return;\n\n const indexElement = index - 1 < 0 ? this.tabs.length - 1 : index - 1;\n this.selectFocusOnTab(indexElement);\n },\n\n tabRight () {\n const index = this.getFocusedTabIndex();\n if (index === -1) return;\n\n const indexElement = index + 1 > this.tabs.length - 1 ? 0 : index + 1;\n this.selectFocusOnTab(indexElement);\n },\n\n selectFocusOnTab (index) {\n const { context } = this.tabs[index];\n context.focus();\n },\n\n selectTab (event) {\n if (this.isSameTabClicked()) return;\n\n this.$emit('before-change', event);\n if (event.defaultPrevented) return;\n\n const index = this.getFocusedTabIndex();\n\n this.selectTabByIndex(index);\n this.onChange();\n },\n\n selectTabByIndex (index) {\n const { context, panelId } = this.tabs[index];\n this.provideObj.selected = panelId;\n context.focus();\n },\n\n getFocusedTabIndex () {\n // Hot fix https://github.com/dialpad/dialtone/pull/849\n // The main issue is that this.tabs is not being updated at the time this is being triggered.\n\n const index = this.tabs.findIndex((context) =>\n this.focusId ? context.tabId === `${this.focusId}` : context.isSelected,\n );\n\n return index === -1 ? 0 : index;\n },\n\n onHomeButton () {\n if (this.tabs.length === 0) return;\n this.tabs[0]?.context?.focus();\n },\n\n onEndButton () {\n if (this.tabs.length === 0) return;\n this.tabs[this.tabs.length - 1]?.context?.focus();\n },\n\n isSameTabClicked () {\n const tab = this.tabs[this.getFocusedTabIndex()];\n return this.provideObj.selected === tab.panelId;\n },\n },\n};\n</script>\n"],"names":["_sfc_main","size","TAB_LIST_SIZES","TAB_LIST_SIZE_MODIFIERS","TAB_LIST_KIND_MODIFIERS","TAB_LIST_IMPORTANCE_MODIFIERS","focusId","el","_a","_b","index","indexElement","context","event","panelId","tab","_hoisted_1","_hoisted_2","_openBlock","_createElementBlock","_createElementVNode","_mergeProps","$data","$props","_cache","_withKeys","args","$options","_renderSlot","_ctx"],"mappings":";;;AA+CA,MAAKA,IAAU;AAAA,EACb,cAAc,EAAE,MAAM;EACtB,MAAM;AAAA,EAEN,UAAW;AACT,WAAO;AAAA,MACL,cAAc,KAAK;AAAA,MACnB,UAAU,KAAK;AAAA;EAEnB;AAAA,EAEA,OAAO;AAAA;AAAA;AAAA;AAAA,IAIL,OAAO;AAAA,MACL,MAAM;AAAA,MACN,SAAS;AAAA;;;;IAMX,UAAU;AAAA,MACR,MAAM;AAAA,MACN,SAAS;AAAA;;;;;IAOX,UAAU;AAAA,MACR,MAAM;AAAA,MACN,SAAS;AAAA;;;;;IAOX,UAAU;AAAA,MACR,MAAM;AAAA,MACN,SAAS;AAAA;;;;;IAOX,YAAY;AAAA,MACV,MAAM;AAAA,MACN,SAAS;AAAA;;;;;IAOX,MAAM;AAAA,MACJ,MAAM;AAAA,MACN,SAAS;AAAA,MACT,SAAUC,GAAM;AACd,eAAOC,EAAe,SAASD,CAAI;AAAA,MACrC;AAAA;;;;IAMF,cAAc;AAAA,MACZ,MAAM,CAAC,QAAQ,OAAO,MAAM;AAAA,MAC5B,SAAS;AAAA;;;;IAMX,mBAAmB;AAAA,MACjB,MAAM;AAAA,MACN,SAAS,OAAO,CAAA;AAAA;;EAIpB,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOL;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,I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A;AAAA,MACP,WAAO;AAAA,QAxBdF,EAAA,CAAA,MAAAA,EAAA,CAAA,IAAAC,EAAA,IAAAC,MAwBqBC,EAAA,gBAAAA,EAAA,aAAA,GAAAD,CAAA,GAAY,CAAA,MAAA,CAAA;AAAA,QAxBjCF,EAAA,CAAA,MAAAA,EAAA,CAAA,IAAAC,EAAA,IAAAC,MAyBoBC,EAAA,eAAAA,EAAA,YAAA,GAAAD,CAAA,GAAW,CAAA,KAAA,CAAA;AAAA;;MAGzBE,EAAoBC,EAAA,QAAA,MAAA;AAAA,IA5B1B,GAAA,IAAAZ,CAAA;AAAA,IA+BIW,EAAQC,EAAA,QAAA,SAAA;AAAA;;;"}
|
|
1
|
+
{"version":3,"file":"tab-group.js","sources":["../../../components/tab/tab_group.vue"],"sourcesContent":["<template>\n <div\n data-qa=\"dt-tab-group\"\n >\n <!-- eslint-disable-next-line vuejs-accessibility/interactive-supports-focus -->\n <div\n ref=\"tabs\"\n :class=\"[\n 'd-tablist',\n TAB_LIST_SIZE_MODIFIERS[size],\n {\n [TAB_LIST_KIND_MODIFIERS.inverted]: inverted,\n [TAB_LIST_IMPORTANCE_MODIFIERS.borderless]: borderless,\n },\n tabListClass,\n ]\"\n v-bind=\"tabListChildProps\"\n role=\"tablist\"\n :aria-label=\"label\"\n @keyup.left=\"tabLeft\"\n @keyup.right=\"tabRight\"\n @keyup.enter=\"selectTab\"\n @keyup.space=\"selectTab\"\n @click=\"selectTab\"\n @keydown.home=\"onHomeButton\"\n @keydown.end=\"onEndButton\"\n >\n <!-- @slot Slot for Tabs -->\n <slot name=\"tabs\" />\n </div>\n <!-- @slot Default slot for Panel -->\n <slot />\n </div>\n</template>\n\n<script>\nimport {\n TAB_LIST_SIZES,\n TAB_LIST_KIND_MODIFIERS,\n TAB_LIST_IMPORTANCE_MODIFIERS,\n TAB_LIST_SIZE_MODIFIERS,\n} from './tabs_constants';\n\n/**\n * Tabs allow users to navigation between grouped content in different views while within the same page context.\n * @see https://dialtone.dialpad.com/components/tabs.html\n */\nexport default {\n compatConfig: { MODE: 3 },\n name: 'DtTabGroup',\n\n provide () {\n return {\n groupContext: this.provideObj,\n setFocus: this.setFocus,\n };\n },\n\n props: {\n /**\n * Identifies the tab group\n */\n label: {\n type: String,\n default: '',\n },\n\n /**\n * The id of the selected tab panel which should be displayed\n */\n selected: {\n type: String,\n default: '',\n },\n\n /**\n * If true, disables the tab group\n * @values true, false\n */\n disabled: {\n type: Boolean,\n default: false,\n },\n\n /**\n * If true, applies inverted styles to the tab group\n * @values true, false\n */\n inverted: {\n type: Boolean,\n default: false,\n },\n\n /**\n * If true, applies borderless styles to the tab group\n * @values true, false\n */\n borderless: {\n type: Boolean,\n default: false,\n },\n\n /**\n * If provided, applies size styles to the tab group\n * @values default, sm\n */\n size: {\n type: String,\n default: 'default',\n validate (size) {\n return TAB_LIST_SIZES.includes(size);\n },\n },\n\n /**\n * Pass through classes, used to customize the tab list\n */\n tabListClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Pass through props, used to customize the tab list\n */\n tabListChildProps: {\n type: Object,\n default: () => ({}),\n },\n },\n\n emits: [\n /**\n * Change tab event with the arguments: selected id of the current tab and disabled value\n *\n * @event change\n * @type {Object}\n */\n 'change',\n\n /**\n * Before change tab event with the event argument, useful to perform validations and prevent changing tabs if neccessary.\n *\n * @event before-change\n * @type {Event}\n */\n 'before-change',\n ],\n\n data () {\n return {\n provideObj: {\n selected: '', // the currently displayed tab id\n disabled: false, // disable group\n },\n\n focusId: null,\n tabs: [],\n TAB_LIST_SIZE_MODIFIERS,\n TAB_LIST_KIND_MODIFIERS,\n TAB_LIST_IMPORTANCE_MODIFIERS,\n };\n },\n\n watch: {\n disabled: {\n immediate: true,\n handler () {\n this.provideObj.disabled = this.disabled;\n },\n },\n\n selected: {\n immediate: true,\n handler () {\n this.provideObj.selected = this.selected;\n },\n },\n },\n\n mounted () {\n this.updateSelected();\n },\n\n updated () {\n this.updateSelected();\n },\n\n methods: {\n updateSelected () {\n /**\n * Prevent override tab selected by default\n */\n if (!this.provideObj.selected) {\n this.provideObj.selected = this.selected;\n }\n this.tabs = this.getTabChildren();\n },\n\n setFocus (focusId) {\n this.focusId = focusId;\n },\n\n getTabChildren () {\n const tabs = Array.from(this.$refs.tabs.querySelectorAll('.d-tab'));\n return tabs\n .map(el => {\n return ({\n context: el,\n panelId: el.getAttribute('aria-controls')?.replace('dt-panel-', ''),\n tabId: el.getAttribute('id')?.replace('dt-tab-', ''),\n isSelected: el.getAttribute('aria-selected') === 'true',\n });\n });\n },\n\n onChange () {\n this.$emit('change', { ...this.provideObj });\n },\n\n tabLeft () {\n const index = this.getFocusedTabIndex();\n if (index === -1) return;\n\n const indexElement = index - 1 < 0 ? this.tabs.length - 1 : index - 1;\n this.selectFocusOnTab(indexElement);\n },\n\n tabRight () {\n const index = this.getFocusedTabIndex();\n if (index === -1) return;\n\n const indexElement = index + 1 > this.tabs.length - 1 ? 0 : index + 1;\n this.selectFocusOnTab(indexElement);\n },\n\n selectFocusOnTab (index) {\n const { context } = this.tabs[index];\n context.focus();\n },\n\n selectTab (event) {\n if (this.isSameTabClicked()) return;\n\n this.$emit('before-change', event);\n if (event.defaultPrevented) return;\n\n const index = this.getFocusedTabIndex();\n\n this.selectTabByIndex(index);\n this.onChange();\n },\n\n selectTabByIndex (index) {\n const { context, panelId } = this.tabs[index];\n this.provideObj.selected = panelId;\n context.focus();\n },\n\n getFocusedTabIndex () {\n // Hot fix https://github.com/dialpad/dialtone/pull/849\n // The main issue is that this.tabs is not being updated at the time this is being triggered.\n\n const index = this.tabs.findIndex((context) =>\n this.focusId ? context.tabId === `${this.focusId}` : context.isSelected,\n );\n\n return index === -1 ? 0 : index;\n },\n\n onHomeButton () {\n if (this.tabs.length === 0) return;\n this.tabs[0]?.context?.focus();\n },\n\n onEndButton () {\n if (this.tabs.length === 0) return;\n this.tabs[this.tabs.length - 1]?.context?.focus();\n },\n\n isSameTabClicked () {\n const tab = this.tabs[this.getFocusedTabIndex()];\n return this.provideObj.selected === tab.panelId;\n },\n },\n};\n</script>\n"],"names":["_sfc_main","size","TAB_LIST_SIZES","TAB_LIST_SIZE_MODIFIERS","TAB_LIST_KIND_MODIFIERS","TAB_LIST_IMPORTANCE_MODIFIERS","focusId","el","_a","_b","index","indexElement","context","event","panelId","tab","_hoisted_1","_hoisted_2","_openBlock","_createElementBlock","_createElementVNode","_mergeProps","$data","$props","_cache","_withKeys","args","$options","_renderSlot","_ctx"],"mappings":";;;AA+CA,MAAKA,IAAU;AAAA,EACb,cAAc,EAAE,MAAM;EACtB,MAAM;AAAA,EAEN,UAAW;AACT,WAAO;AAAA,MACL,cAAc,KAAK;AAAA,MACnB,UAAU,KAAK;AAAA;EAEnB;AAAA,EAEA,OAAO;AAAA;AAAA;AAAA;AAAA,IAIL,OAAO;AAAA,MACL,MAAM;AAAA,MACN,SAAS;AAAA;;;;IAMX,UAAU;AAAA,MACR,MAAM;AAAA,MACN,SAAS;AAAA;;;;;IAOX,UAAU;AAAA,MACR,MAAM;AAAA,MACN,SAAS;AAAA;;;;;IAOX,UAAU;AAAA,MACR,MAAM;AAAA,MACN,SAAS;AAAA;;;;;IAOX,YAAY;AAAA,MACV,MAAM;AAAA,MACN,SAAS;AAAA;;;;;IAOX,MAAM;AAAA,MACJ,MAAM;AAAA,MACN,SAAS;AAAA,MACT,SAAUC,GAAM;AACd,eAAOC,EAAe,SAASD,CAAI;AAAA,MACrC;AAAA;;;;IAMF,cAAc;AAAA,MACZ,MAAM,CAAC,QAAQ,OAAO,MAAM;AAAA,MAC5B,SAAS;AAAA;;;;IAMX,mBAAmB;AAAA,MACjB,MAAM;AAAA,MACN,SAAS,OAAO,CAAA;AAAA;;EAIpB,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOL;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAQA;AAAA;EAGF,OAAQ;AACN,WAAO;AAAA,MACL,YAAY;AAAA,QACV,UAAU;AAAA;AAA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AAAC,MAwBqBC,EAAA,gBAAAA,EAAA,aAAA,GAAAD,CAAA,GAAY,CAAA,MAAA,CAAA;AAAA,QAxBjCF,EAAA,CAAA,MAAAA,EAAA,CAAA,IAAAC,EAAA,IAAAC,MAyBoBC,EAAA,eAAAA,EAAA,YAAA,GAAAD,CAAA,GAAW,CAAA,KAAA,CAAA;AAAA;;MAGzBE,EAAoBC,EAAA,QAAA,MAAA;AAAA,IA5B1B,GAAA,IAAAZ,CAAA;AAAA,IA+BIW,EAAQC,EAAA,QAAA,SAAA;AAAA;;;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const v=require("../../common/utils/index.cjs"),r=require("vue"),f=require("deep-equal"),n=require("../tooltip/tooltip.cjs"),m=require("../tooltip/tooltip-constants.cjs"),p={name:"dt-tooltip-directive",install(c){let a;const s=document.createElement("div");document.body.appendChild(s);const u="top";r.createApp({name:"DtTooltipDirectiveApp",components:{DtTooltip:n.default},data(){return{tooltips:[]}},created(){a=r.getCurrentInstance()},methods:{addOrUpdateTooltip(e,t){const i=this.tooltips.findIndex(o=>o.id===e);i!==-1?this.tooltips.splice(i,1,{id:e,...t}):this.tooltips.push({id:e,...t})},removeTooltip(e){this.tooltips=this.tooltips.filter(t=>t.id!==e)}},render(){return r.h("div",this.tooltips.map(({id:e,...t})=>r.h(n.default,{key:e,...t,sticky:t.sticky!==void 0?t.sticky:!0,delay:t.delay!==void 0?t.delay:process.env.NODE_ENV!=="test",externalAnchor:`[data-dt-tooltip-id="${e}"]`})))}}).mount(s),c.directive("dt-tooltip",{beforeMount(e,t){d(e,t)},updated(e,t){f(t.value,t.oldValue)||d(e,t)},unmounted(e){a.ctx.removeTooltip(e.getAttribute("data-dt-tooltip-id"))}});function d(e,t){if(t.value===null||t.value===void 0){const l=e.getAttribute("data-dt-tooltip-id");l&&a.ctx.removeTooltip(l);return}const i=e.getAttribute("data-dt-tooltip-id")||v.getUniqueString();let o;if(typeof t.value=="string")o={message:t.value,placement:t.arg||u};else if(typeof t.value=="object"&&t.value!==null)o={placement:t.arg||t.value.placement||u,...t.value};else{console.error("DtTooltipDirective: binding value must be string, object, null or undefined");return}Object.keys(t.modifiers).forEach(l=>{switch(l){case"inverted":o.inverted=!0;break;case"no-delay":o.delay=!1;break;case"no-transition":o.transition=!1;break;default:m.TOOLTIP_DIRECTIONS.includes(l)&&(o.placement=l);break}}),e.setAttribute("data-dt-tooltip-id",i),a.ctx.addOrUpdateTooltip(i,o)}}};exports.DtTooltipDirective=p;exports.default=p;
|
|
2
2
|
//# sourceMappingURL=tooltip.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tooltip.cjs","sources":["../../../directives/tooltip_directive/tooltip.js"],"sourcesContent":["import { DtTooltip, TOOLTIP_DIRECTIONS } from '@/components/tooltip';\nimport { getUniqueString } from '@/common/utils';\nimport { createApp, getCurrentInstance, h } from 'vue';\nimport deepEqual from 'deep-equal';\n\nexport const DtTooltipDirective = {\n name: 'dt-tooltip-directive',\n install (app) {\n let tooltipInstance;\n const mountPoint = document.createElement('div');\n document.body.appendChild(mountPoint);\n\n const DEFAULT_PLACEMENT = 'top';\n const DtTooltipDirectiveApp = createApp({\n name: 'DtTooltipDirectiveApp',\n components: { DtTooltip },\n data () {\n return {\n tooltips: [],\n };\n },\n\n created () {\n tooltipInstance = getCurrentInstance();\n },\n\n methods: {\n addOrUpdateTooltip (id, tooltipConfig) {\n const index = this.tooltips.findIndex(tooltip => tooltip.id === id);\n if (index !== -1) {\n // Update existing tooltip\n this.tooltips.splice(index, 1, { id, ...tooltipConfig });\n } else {\n // Add new tooltip\n this.tooltips.push({ id, ...tooltipConfig });\n }\n },\n\n removeTooltip (id) {\n this.tooltips = this.tooltips.filter(tooltip => tooltip.id !== id);\n },\n },\n\n render () {\n return h('div',\n this.tooltips.map(({ id, ...tooltipProps }) => {\n return h(DtTooltip, {\n key: id,\n ...tooltipProps,\n sticky: tooltipProps.sticky !== undefined ? tooltipProps.sticky : true,\n /**\n * Set the delay to false when running tests only.\n */\n delay: tooltipProps.delay !== undefined ? tooltipProps.delay : (process.env.NODE_ENV !== 'test'),\n externalAnchor: `[data-dt-tooltip-id=\"${id}\"]`,\n });\n }),\n );\n },\n });\n\n DtTooltipDirectiveApp.mount(mountPoint);\n\n app.directive('dt-tooltip', {\n beforeMount (anchor, binding) {\n // Initial tooltip setup\n setupTooltip(anchor, binding);\n },\n updated (anchor, binding) {\n // Update tooltip on binding value change\n // Use deep equality check to prevent infinite loops when objects are passed\n if (!deepEqual(binding.value, binding.oldValue)) {\n setupTooltip(anchor, binding);\n }\n },\n unmounted (anchor) {\n tooltipInstance.ctx.removeTooltip(anchor.getAttribute('data-dt-tooltip-id'));\n },\n });\n\n function setupTooltip (anchor, binding) {\n if (binding.value === null || binding.value === undefined) {\n const tooltipId = anchor.getAttribute('data-dt-tooltip-id');\n if (tooltipId) {\n
|
|
1
|
+
{"version":3,"file":"tooltip.cjs","sources":["../../../directives/tooltip_directive/tooltip.js"],"sourcesContent":["import { DtTooltip, TOOLTIP_DIRECTIONS } from '@/components/tooltip';\nimport { getUniqueString } from '@/common/utils';\nimport { createApp, getCurrentInstance, h } from 'vue';\nimport deepEqual from 'deep-equal';\n\nexport const DtTooltipDirective = {\n name: 'dt-tooltip-directive',\n install (app) {\n let tooltipInstance;\n const mountPoint = document.createElement('div');\n document.body.appendChild(mountPoint);\n\n const DEFAULT_PLACEMENT = 'top';\n const DtTooltipDirectiveApp = createApp({\n name: 'DtTooltipDirectiveApp',\n components: { DtTooltip },\n data () {\n return {\n tooltips: [],\n };\n },\n\n created () {\n tooltipInstance = getCurrentInstance();\n },\n\n methods: {\n addOrUpdateTooltip (id, tooltipConfig) {\n const index = this.tooltips.findIndex(tooltip => tooltip.id === id);\n if (index !== -1) {\n // Update existing tooltip\n this.tooltips.splice(index, 1, { id, ...tooltipConfig });\n } else {\n // Add new tooltip\n this.tooltips.push({ id, ...tooltipConfig });\n }\n },\n\n removeTooltip (id) {\n this.tooltips = this.tooltips.filter(tooltip => tooltip.id !== id);\n },\n },\n\n render () {\n return h('div',\n this.tooltips.map(({ id, ...tooltipProps }) => {\n return h(DtTooltip, {\n key: id,\n ...tooltipProps,\n sticky: tooltipProps.sticky !== undefined ? tooltipProps.sticky : true,\n /**\n * Set the delay to false when running tests only.\n */\n delay: tooltipProps.delay !== undefined ? tooltipProps.delay : (process.env.NODE_ENV !== 'test'),\n externalAnchor: `[data-dt-tooltip-id=\"${id}\"]`,\n });\n }),\n );\n },\n });\n\n DtTooltipDirectiveApp.mount(mountPoint);\n\n app.directive('dt-tooltip', {\n beforeMount (anchor, binding) {\n // Initial tooltip setup\n setupTooltip(anchor, binding);\n },\n updated (anchor, binding) {\n // Update tooltip on binding value change\n // Use deep equality check to prevent infinite loops when objects are passed\n if (!deepEqual(binding.value, binding.oldValue)) {\n setupTooltip(anchor, binding);\n }\n },\n unmounted (anchor) {\n tooltipInstance.ctx.removeTooltip(anchor.getAttribute('data-dt-tooltip-id'));\n },\n });\n\n function setupTooltip (anchor, binding) {\n if (binding.value === null || binding.value === undefined) {\n const tooltipId = anchor.getAttribute('data-dt-tooltip-id');\n if (tooltipId) {\n tooltipInstance.ctx.removeTooltip(tooltipId);\n }\n return;\n }\n const tooltipId = anchor.getAttribute('data-dt-tooltip-id') || getUniqueString();\n\n let tooltipConfig;\n if (typeof binding.value === 'string') {\n tooltipConfig = {\n message: binding.value,\n placement: binding.arg || DEFAULT_PLACEMENT,\n };\n } else if (typeof binding.value === 'object' && binding.value !== null) {\n tooltipConfig = {\n placement: binding.arg || binding.value.placement || DEFAULT_PLACEMENT,\n ...binding.value,\n };\n } else {\n console.error('DtTooltipDirective: binding value must be string, object, null or undefined');\n return;\n }\n\n Object.keys(binding.modifiers).forEach(modifier => {\n switch (modifier) {\n case 'inverted':\n tooltipConfig.inverted = true;\n break;\n case 'no-delay':\n tooltipConfig.delay = false;\n break;\n case 'no-transition':\n tooltipConfig.transition = false;\n break;\n default:\n if (TOOLTIP_DIRECTIONS.includes(modifier)) {\n tooltipConfig.placement = modifier;\n }\n break;\n }\n });\n\n anchor.setAttribute('data-dt-tooltip-id', tooltipId);\n tooltipInstance.ctx.addOrUpdateTooltip(tooltipId, tooltipConfig);\n }\n },\n};\n\nexport default DtTooltipDirective;\n"],"names":["DtTooltipDirective","app","tooltipInstance","mountPoint","DEFAULT_PLACEMENT","createApp","DtTooltip","getCurrentInstance","id","tooltipConfig","index","tooltip","h","tooltipProps","anchor","binding","setupTooltip","deepEqual","tooltipId","getUniqueString","modifier","TOOLTIP_DIRECTIONS"],"mappings":"uRAKaA,EAAqB,CAChC,KAAM,uBACN,QAASC,EAAK,CACZ,IAAIC,EACJ,MAAMC,EAAa,SAAS,cAAc,KAAK,EAC/C,SAAS,KAAK,YAAYA,CAAU,EAEpC,MAAMC,EAAoB,MACIC,EAAAA,UAAU,CACtC,KAAM,wBACN,WAAY,CAAA,UAAEC,EAAAA,OAAS,EACvB,MAAQ,CACN,MAAO,CACL,SAAU,CAAA,CACpB,CACM,EAEA,SAAW,CACTJ,EAAkBK,EAAAA,mBAAkB,CACtC,EAEA,QAAS,CACP,mBAAoBC,EAAIC,EAAe,CACrC,MAAMC,EAAQ,KAAK,SAAS,UAAUC,GAAWA,EAAQ,KAAOH,CAAE,EAC9DE,IAAU,GAEZ,KAAK,SAAS,OAAOA,EAAO,EAAG,CAAE,GAAAF,EAAI,GAAGC,EAAe,EAGvD,KAAK,SAAS,KAAK,CAAE,GAAAD,EAAI,GAAGC,CAAa,CAAE,CAE/C,EAEA,cAAeD,EAAI,CACjB,KAAK,SAAW,KAAK,SAAS,OAAOG,GAAWA,EAAQ,KAAOH,CAAE,CACnE,CACR,EAEM,QAAU,CACR,OAAOI,EAAAA,EAAE,MACP,KAAK,SAAS,IA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WACHA,EAAc,MAAQ,GACtB,MACF,IAAK,gBACHA,EAAc,WAAa,GAC3B,MACF,QACMY,EAAAA,mBAAmB,SAASD,CAAQ,IACtCX,EAAc,UAAYW,GAE5B,KACZ,CACM,CAAC,EAEDN,EAAO,aAAa,qBAAsBI,CAAS,EACnDhB,EAAgB,IAAI,mBAAmBgB,EAAWT,CAAa,CACjE,CACF,CACF"}
|
|
@@ -1,24 +1,25 @@
|
|
|
1
|
-
import { getUniqueString as
|
|
2
|
-
import { createApp as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import { TOOLTIP_DIRECTIONS as
|
|
1
|
+
import { getUniqueString as c } from "../../common/utils/index.js";
|
|
2
|
+
import { createApp as m, h as d, getCurrentInstance as f } from "vue";
|
|
3
|
+
import v from "deep-equal";
|
|
4
|
+
import u from "../tooltip/tooltip.js";
|
|
5
|
+
import { TOOLTIP_DIRECTIONS as T } from "../tooltip/tooltip-constants.js";
|
|
6
6
|
const I = {
|
|
7
7
|
name: "dt-tooltip-directive",
|
|
8
|
-
install(
|
|
8
|
+
install(n) {
|
|
9
9
|
let a;
|
|
10
10
|
const r = document.createElement("div");
|
|
11
11
|
document.body.appendChild(r);
|
|
12
|
-
const
|
|
12
|
+
const p = "top";
|
|
13
|
+
m({
|
|
13
14
|
name: "DtTooltipDirectiveApp",
|
|
14
|
-
components: { DtTooltip:
|
|
15
|
+
components: { DtTooltip: u },
|
|
15
16
|
data() {
|
|
16
17
|
return {
|
|
17
18
|
tooltips: []
|
|
18
19
|
};
|
|
19
20
|
},
|
|
20
21
|
created() {
|
|
21
|
-
a =
|
|
22
|
+
a = f();
|
|
22
23
|
},
|
|
23
24
|
methods: {
|
|
24
25
|
addOrUpdateTooltip(e, t) {
|
|
@@ -30,9 +31,9 @@ const I = {
|
|
|
30
31
|
}
|
|
31
32
|
},
|
|
32
33
|
render() {
|
|
33
|
-
return
|
|
34
|
+
return d(
|
|
34
35
|
"div",
|
|
35
|
-
this.tooltips.map(({ id: e, ...t }) => u
|
|
36
|
+
this.tooltips.map(({ id: e, ...t }) => d(u, {
|
|
36
37
|
key: e,
|
|
37
38
|
...t,
|
|
38
39
|
sticky: t.sticky !== void 0 ? t.sticky : !0,
|
|
@@ -44,34 +45,33 @@ const I = {
|
|
|
44
45
|
}))
|
|
45
46
|
);
|
|
46
47
|
}
|
|
47
|
-
})
|
|
48
|
-
d.mount(r), c.directive("dt-tooltip", {
|
|
48
|
+
}).mount(r), n.directive("dt-tooltip", {
|
|
49
49
|
beforeMount(e, t) {
|
|
50
|
-
|
|
50
|
+
s(e, t);
|
|
51
51
|
},
|
|
52
52
|
updated(e, t) {
|
|
53
|
-
|
|
53
|
+
v(t.value, t.oldValue) || s(e, t);
|
|
54
54
|
},
|
|
55
55
|
unmounted(e) {
|
|
56
56
|
a.ctx.removeTooltip(e.getAttribute("data-dt-tooltip-id"));
|
|
57
57
|
}
|
|
58
58
|
});
|
|
59
|
-
function
|
|
59
|
+
function s(e, t) {
|
|
60
60
|
if (t.value === null || t.value === void 0) {
|
|
61
61
|
const l = e.getAttribute("data-dt-tooltip-id");
|
|
62
|
-
l &&
|
|
62
|
+
l && a.ctx.removeTooltip(l);
|
|
63
63
|
return;
|
|
64
64
|
}
|
|
65
|
-
const i = e.getAttribute("data-dt-tooltip-id") ||
|
|
65
|
+
const i = e.getAttribute("data-dt-tooltip-id") || c();
|
|
66
66
|
let o;
|
|
67
67
|
if (typeof t.value == "string")
|
|
68
68
|
o = {
|
|
69
69
|
message: t.value,
|
|
70
|
-
placement: t.arg ||
|
|
70
|
+
placement: t.arg || p
|
|
71
71
|
};
|
|
72
72
|
else if (typeof t.value == "object" && t.value !== null)
|
|
73
73
|
o = {
|
|
74
|
-
placement: t.arg || t.value.placement ||
|
|
74
|
+
placement: t.arg || t.value.placement || p,
|
|
75
75
|
...t.value
|
|
76
76
|
};
|
|
77
77
|
else {
|
|
@@ -90,7 +90,7 @@ const I = {
|
|
|
90
90
|
o.transition = !1;
|
|
91
91
|
break;
|
|
92
92
|
default:
|
|
93
|
-
|
|
93
|
+
T.includes(l) && (o.placement = l);
|
|
94
94
|
break;
|
|
95
95
|
}
|
|
96
96
|
}), e.setAttribute("data-dt-tooltip-id", i), a.ctx.addOrUpdateTooltip(i, o);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tooltip.js","sources":["../../../directives/tooltip_directive/tooltip.js"],"sourcesContent":["import { DtTooltip, TOOLTIP_DIRECTIONS } from '@/components/tooltip';\nimport { getUniqueString } from '@/common/utils';\nimport { createApp, getCurrentInstance, h } from 'vue';\nimport deepEqual from 'deep-equal';\n\nexport const DtTooltipDirective = {\n name: 'dt-tooltip-directive',\n install (app) {\n let tooltipInstance;\n const mountPoint = document.createElement('div');\n document.body.appendChild(mountPoint);\n\n const DEFAULT_PLACEMENT = 'top';\n const DtTooltipDirectiveApp = createApp({\n name: 'DtTooltipDirectiveApp',\n components: { DtTooltip },\n data () {\n return {\n tooltips: [],\n };\n },\n\n created () {\n tooltipInstance = getCurrentInstance();\n },\n\n methods: {\n addOrUpdateTooltip (id, tooltipConfig) {\n const index = this.tooltips.findIndex(tooltip => tooltip.id === id);\n if (index !== -1) {\n // Update existing tooltip\n this.tooltips.splice(index, 1, { id, ...tooltipConfig });\n } else {\n // Add new tooltip\n this.tooltips.push({ id, ...tooltipConfig });\n }\n },\n\n removeTooltip (id) {\n this.tooltips = this.tooltips.filter(tooltip => tooltip.id !== id);\n },\n },\n\n render () {\n return h('div',\n this.tooltips.map(({ id, ...tooltipProps }) => {\n return h(DtTooltip, {\n key: id,\n ...tooltipProps,\n sticky: tooltipProps.sticky !== undefined ? tooltipProps.sticky : true,\n /**\n * Set the delay to false when running tests only.\n */\n delay: tooltipProps.delay !== undefined ? tooltipProps.delay : (process.env.NODE_ENV !== 'test'),\n externalAnchor: `[data-dt-tooltip-id=\"${id}\"]`,\n });\n }),\n );\n },\n });\n\n DtTooltipDirectiveApp.mount(mountPoint);\n\n app.directive('dt-tooltip', {\n beforeMount (anchor, binding) {\n // Initial tooltip setup\n setupTooltip(anchor, binding);\n },\n updated (anchor, binding) {\n // Update tooltip on binding value change\n // Use deep equality check to prevent infinite loops when objects are passed\n if (!deepEqual(binding.value, binding.oldValue)) {\n setupTooltip(anchor, binding);\n }\n },\n unmounted (anchor) {\n tooltipInstance.ctx.removeTooltip(anchor.getAttribute('data-dt-tooltip-id'));\n },\n });\n\n function setupTooltip (anchor, binding) {\n if (binding.value === null || binding.value === undefined) {\n const tooltipId = anchor.getAttribute('data-dt-tooltip-id');\n if (tooltipId) {\n
|
|
1
|
+
{"version":3,"file":"tooltip.js","sources":["../../../directives/tooltip_directive/tooltip.js"],"sourcesContent":["import { DtTooltip, TOOLTIP_DIRECTIONS } from '@/components/tooltip';\nimport { getUniqueString } from '@/common/utils';\nimport { createApp, getCurrentInstance, h } from 'vue';\nimport deepEqual from 'deep-equal';\n\nexport const DtTooltipDirective = {\n name: 'dt-tooltip-directive',\n install (app) {\n let tooltipInstance;\n const mountPoint = document.createElement('div');\n document.body.appendChild(mountPoint);\n\n const DEFAULT_PLACEMENT = 'top';\n const DtTooltipDirectiveApp = createApp({\n name: 'DtTooltipDirectiveApp',\n components: { DtTooltip },\n data () {\n return {\n tooltips: [],\n };\n },\n\n created () {\n tooltipInstance = getCurrentInstance();\n },\n\n methods: {\n addOrUpdateTooltip (id, tooltipConfig) {\n const index = this.tooltips.findIndex(tooltip => tooltip.id === id);\n if (index !== -1) {\n // Update existing tooltip\n this.tooltips.splice(index, 1, { id, ...tooltipConfig });\n } else {\n // Add new tooltip\n this.tooltips.push({ id, ...tooltipConfig });\n }\n },\n\n removeTooltip (id) {\n this.tooltips = this.tooltips.filter(tooltip => tooltip.id !== id);\n },\n },\n\n render () {\n return h('div',\n this.tooltips.map(({ id, ...tooltipProps }) => {\n return h(DtTooltip, {\n key: id,\n ...tooltipProps,\n sticky: tooltipProps.sticky !== undefined ? tooltipProps.sticky : true,\n /**\n * Set the delay to false when running tests only.\n */\n delay: tooltipProps.delay !== undefined ? tooltipProps.delay : (process.env.NODE_ENV !== 'test'),\n externalAnchor: `[data-dt-tooltip-id=\"${id}\"]`,\n });\n }),\n );\n },\n });\n\n DtTooltipDirectiveApp.mount(mountPoint);\n\n app.directive('dt-tooltip', {\n beforeMount (anchor, binding) {\n // Initial tooltip setup\n setupTooltip(anchor, binding);\n },\n updated (anchor, binding) {\n // Update tooltip on binding value change\n // Use deep equality check to prevent infinite loops when objects are passed\n if (!deepEqual(binding.value, binding.oldValue)) {\n setupTooltip(anchor, binding);\n }\n },\n unmounted (anchor) {\n tooltipInstance.ctx.removeTooltip(anchor.getAttribute('data-dt-tooltip-id'));\n },\n });\n\n function setupTooltip (anchor, binding) {\n if (binding.value === null || binding.value === undefined) {\n const tooltipId = anchor.getAttribute('data-dt-tooltip-id');\n if (tooltipId) {\n tooltipInstance.ctx.removeTooltip(tooltipId);\n }\n return;\n }\n const tooltipId = anchor.getAttribute('data-dt-tooltip-id') || getUniqueString();\n\n let tooltipConfig;\n if (typeof binding.value === 'string') {\n tooltipConfig = {\n message: binding.value,\n placement: binding.arg || DEFAULT_PLACEMENT,\n };\n } else if (typeof binding.value === 'object' && binding.value !== null) {\n tooltipConfig = {\n placement: binding.arg || binding.value.placement || DEFAULT_PLACEMENT,\n ...binding.value,\n };\n } else {\n console.error('DtTooltipDirective: binding value must be string, object, null or undefined');\n return;\n }\n\n Object.keys(binding.modifiers).forEach(modifier => {\n switch (modifier) {\n case 'inverted':\n tooltipConfig.inverted = true;\n break;\n case 'no-delay':\n tooltipConfig.delay = false;\n break;\n case 'no-transition':\n tooltipConfig.transition = false;\n break;\n default:\n if (TOOLTIP_DIRECTIONS.includes(modifier)) {\n tooltipConfig.placement = modifier;\n }\n break;\n }\n });\n\n anchor.setAttribute('data-dt-tooltip-id', tooltipId);\n tooltipInstance.ctx.addOrUpdateTooltip(tooltipId, tooltipConfig);\n }\n },\n};\n\nexport default DtTooltipDirective;\n"],"names":["DtTooltipDirective","app","tooltipInstance","mountPoint","DEFAULT_PLACEMENT","createApp","DtTooltip","getCurrentInstance","id","tooltipConfig","index","tooltip","h","tooltipProps","anchor","binding","setupTooltip","deepEqual","tooltipId","getUniqueString","modifier","TOOLTIP_DIRECTIONS"],"mappings":";;;;;AAKY,MAACA,IAAqB;AAAA,EAChC,MAAM;AAAA,EACN,QAASC,GAAK;AACZ,QAAIC;AACJ,UAAMC,IAAa,SAAS,cAAc,KAAK;AAC/C,aAAS,KAAK,YAAYA,CAAU;AAEpC,UAAMC,IAAoB;AAiD1B,IAhD8BC,EAAU;AAAA,MACtC,MAAM;AAAA,MACN,YAAY,EAAE,WAAAC,EAAS;AAAA,MACvB,OAAQ;AACN,eAAO;AAAA,UACL,UAAU,CAAA;AAAA,QACpB;AAAA,MACM;AAAA,MAEA,UAAW;AACT,QAAAJ,IAAkBK,EAAkB;AAAA,MACtC;AAAA,MAEA,SAAS;AAAA,QACP,mBAAoBC,GAAIC,GAAe;AACrC,gBAAMC,IAAQ,KAAK,SAAS,UAAU,CAAAC,MAAWA,EAAQ,OAAOH,CAAE;AAClE,UAAIE,MAAU,KAEZ,KAAK,SAAS,OAAOA,GAAO,GAAG,EAAE,IAAAF,GAAI,GAAGC,GAAe,IAGvD,KAAK,SAAS,KAAK,EAAE,IAAAD,GAAI,GAAGC,EAAa,CAAE;AAAA,QAE/C;AAAA,QAEA,cAAeD,GAAI;AACjB,eAAK,WAAW,KAAK,SAAS,OAAO,CAAAG,MAAWA,EAAQ,OAAOH,CAAE;AAAA,QACnE;AAAA,MACR;AAAA,MAEM,SAAU;AACR,eAAOI;AAAA,UAAE;AAAA,UACP,KAAK,SAAS,IAAI,CAAC,EAAE,IAAAJ,GAAI,GAAGK,QACnBD,EAAEN,GAAW;AAAA,YAClB,KAAKE;AAAA,YACL,GAAGK;AAAA,YACH,QAAQA,EAAa,WAAW,SAAYA,EAAa,SAAS;AAAA;AAAA;AAAA;AAAA,YAIlE,OAAOA,EAAa,UAAU,SAAYA,EAAa,Q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,KAAK;AACH,YAAAA,EAAc,QAAQ;AACtB;AAAA,UACF,KAAK;AACH,YAAAA,EAAc,aAAa;AAC3B;AAAA,UACF;AACE,YAAIY,EAAmB,SAASD,CAAQ,MACtCX,EAAc,YAAYW;AAE5B;AAAA,QACZ;AAAA,MACM,CAAC,GAEDN,EAAO,aAAa,sBAAsBI,CAAS,GACnDhB,EAAgB,IAAI,mBAAmBgB,GAAWT,CAAa;AAAA,IACjE;AAAA,EACF;AACF;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("@dialpad/i18n"),u=require("./en-US.cjs"),d=require("./zh-CN.cjs"),f=require("./nl-NL.cjs"),g=require("./fr-FR.cjs"),S=require("./de-DE.cjs"),h=require("./it-IT.cjs"),w=require("./ja-JP.cjs"),L=require("./pt-BR.cjs"),N=require("./ru-RU.cjs"),R=require("./es-LA.cjs"),t="dialtone",o={ENGLISH:"en-US",CHINESE:"zh-CN",DUTCH:"nl-NL",FRENCH:"fr-FR",GERMAN:"de-DE",ITALIAN:"it-IT",JAPANESE:"ja-JP",PORTUGUESE:"pt-BR",RUSSIAN:"ru-RU",SPANISH:"es-LA"},i="en-US",s="user-locale";class a{constructor(e=null){if(typeof a.instance=="object")return a.instance;this._locale=e||a.getPreferredLocale();const l=new n.RawBundleSource({resources:n.RawBundleSource.builtResources([["en-US",t,u.default],["zh-CN",t,d.default],["nl-NL",t,f.default],["fr-FR",t,g.default],["de-DE",t,S.default],["it-IT",t,h.default],["ja-JP",t,w.default],["pt-BR",t,L.default],["ru-RU",t,N.default],["es-LA",t,R.default]])}),r=new n.LocaleManager({bundleSource:l,allowedLocales:Object.values(o),fallbackLocale:i,preferredLocale:this._locale,namespaces:[t]});return a.instance=this,this.i18n=r.useI18N(t),typeof window<"u"&&(window.onstorage=c=>{c.key===s&&(this.currentLocale=c.newValue)}),this}static getPreferredLocale(){if(typeof window>"u"||!window.localStorage)return i;const e=window.localStorage.getItem(s),l=Object.values(o).find(r=>r.startsWith(navigator.language.slice(0,2)));return e||l||i}static getAllowedLocales(){return o}$t(...e){return this.i18n.$t(...e)}$ta(...e){return this.i18n.$ta(...e)}get currentLocale(){return this._locale}set currentLocale(e){if(e!==this._locale){if(!Object.values(o).includes(e))throw new Error(`Locale ${e} is not allowed, please use one of the following: ${Object.values(o).join(", ")}`);this._locale=e,this.i18n.setI18N({preferredLocale:e},t)}}}exports.DialtoneLocalization=a;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../localization/index.js"],"sourcesContent":["import { LocaleManager, RawBundleSource
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../localization/index.js"],"sourcesContent":["import { LocaleManager, RawBundleSource } from '@dialpad/i18n';\n\nimport enUS from './en-US.ftl?raw';\nimport zhCN from './zh-CN.ftl?raw';\nimport nlNL from './nl-NL.ftl?raw';\nimport frFR from './fr-FR.ftl?raw';\nimport deDE from './de-DE.ftl?raw';\nimport itIT from './it-IT.ftl?raw';\nimport jaJP from './ja-JP.ftl?raw';\nimport ptBR from './pt-BR.ftl?raw';\nimport ruRU from './ru-RU.ftl?raw';\nimport esLA from './es-LA.ftl?raw';\n\nconst dialtoneNamespace = 'dialtone';\nconst allowedLocales = {\n ENGLISH: 'en-US',\n CHINESE: 'zh-CN',\n DUTCH: 'nl-NL',\n FRENCH: 'fr-FR',\n GERMAN: 'de-DE',\n ITALIAN: 'it-IT',\n JAPANESE: 'ja-JP',\n PORTUGUESE: 'pt-BR',\n RUSSIAN: 'ru-RU',\n SPANISH: 'es-LA',\n};\nconst fallbackLocale = 'en-US';\n/**\n * Default key name used by the LocaleManager to store the user's preferred locale in localStorage\n */\nconst localeManagerStorageKey = 'user-locale';\n\n/**\n * Dialtone localization class, follows the singleton pattern to make sure only one instance of the class is created.\n * Initializes the localeManager and looks for changes on the browser storage to update the current locale.\n * https://github.com/dialpad/goblin-client-tools/tree/main/packages/i18n#i18n-vue-3-compatible\n */\nexport class DialtoneLocalization {\n /**\n * @prop {import('@dialpad/i18n').UseI18N} i18n\n * @private\n */\n constructor (locale = null) {\n if (typeof DialtoneLocalization.instance === 'object') {\n return DialtoneLocalization.instance;\n }\n\n this._locale = locale || DialtoneLocalization.getPreferredLocale();\n\n const bundleSource = new RawBundleSource({\n resources: RawBundleSource.builtResources([\n ['en-US', dialtoneNamespace, enUS],\n ['zh-CN', dialtoneNamespace, zhCN],\n ['nl-NL', dialtoneNamespace, nlNL],\n ['fr-FR', dialtoneNamespace, frFR],\n ['de-DE', dialtoneNamespace, deDE],\n ['it-IT', dialtoneNamespace, itIT],\n ['ja-JP', dialtoneNamespace, jaJP],\n ['pt-BR', dialtoneNamespace, ptBR],\n ['ru-RU', dialtoneNamespace, ruRU],\n ['es-LA', dialtoneNamespace, esLA],\n ]),\n });\n\n const localeManager = new LocaleManager({\n bundleSource,\n allowedLocales: Object.values(allowedLocales),\n fallbackLocale,\n preferredLocale: this._locale,\n namespaces: [dialtoneNamespace],\n });\n\n DialtoneLocalization.instance = this;\n this.i18n = localeManager.useI18N(dialtoneNamespace);\n\n if (typeof window !== 'undefined') {\n /**\n * @description\n * When the browser storage changes, update the current locale\n * @param event\n */\n window.onstorage = (event) => {\n if (event.key === localeManagerStorageKey) {\n this.currentLocale = event.newValue;\n }\n };\n }\n\n return this;\n }\n\n /**\n * Gets the preferred locale from user's locale stored in localStorage or the browser language\n * @returns { string }\n */\n static getPreferredLocale () {\n /**\n * Early return if we're not in the browser or if localStorage is not available\n */\n if (typeof window === 'undefined' || !window.localStorage) {\n return fallbackLocale;\n }\n\n const localStorageLanguage = window.localStorage.getItem(localeManagerStorageKey);\n\n // Get the first two letters of the navigator language and check if it's in the allowed locales\n const navigatorLanguage = Object.values(allowedLocales)\n .find(locale => locale.startsWith(navigator.language.slice(0, 2)));\n\n return localStorageLanguage || navigatorLanguage || fallbackLocale;\n }\n\n static getAllowedLocales () {\n return allowedLocales;\n }\n\n /**\n * Passthrough function to the i18n $t function including the dialtone namespace\n * Returns a translated string based on a key and optional variables.\n * It’s used for simple text translations.\n * https://github.com/dialpad/goblin-client-tools/tree/main/packages/i18n#t\n */\n $t (...args) {\n return this.i18n.$t(...args);\n }\n\n /**\n * Passthrough function to the i18n $ta function including the dialtone namespace\n * Returns an object containing translated attributes to pass directly as props to components, it can contain\n * aria-label, title, etc, rather than just a plain text. It’s useful for handling element attributes in the UI.\n * https://github.com/dialpad/goblin-client-tools/tree/main/packages/i18n#ta\n */\n $ta (...args) {\n return this.i18n.$ta(...args);\n }\n\n get currentLocale () {\n return this._locale;\n }\n\n set currentLocale (newLocale) {\n if (newLocale === this._locale) return;\n if (!Object.values(allowedLocales).includes(newLocale)) {\n throw new Error(`Locale ${newLocale} is not allowed, please use one of the following: ${Object.values(allowedLocales).join(', ')}`);\n }\n\n this._locale = newLocale;\n this.i18n.setI18N({ preferredLocale: newLocale }, dialtoneNamespace);\n }\n}\n"],"names":["dialtoneNamespace","allowedLocales","fallbackLocale","localeManagerStorageKey","DialtoneLocalization","locale","bundleSource","RawBundleSource","enUS","zhCN","nlNL","frFR","deDE","itIT","jaJP","ptBR","ruRU","esLA","localeManager","LocaleManager","event","localStorageLanguage","navigatorLanguage","args","newLocale"],"mappings":"2WAaMA,EAAoB,WACpBC,EAAiB,CACrB,QAAS,QACT,QAAS,QACT,MAAO,QACP,OAAQ,QACR,OAAQ,QACR,QAAS,QACT,SAAU,QACV,WAAY,QACZ,QAAS,QACT,QAAS,OACX,EACMC,EAAiB,QAIjBC,EAA0B,cAOzB,MAAMC,CAAqB,CAKhC,YAAaC,EAAS,KAAM,CAC1B,GAAI,OAAOD,EAAqB,UAAa,SAC3C,OAAOA,EAAqB,SAG9B,KAAK,QAAUC,GAAUD,EAAqB,mBAAkB,EAEhE,MAAME,EAAe,IAAIC,kBAAgB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eC,EAAW,CAC5B,GAAIA,IAAc,KAAK,QACvB,IAAI,CAAC,OAAO,OAAOvB,CAAc,EAAE,SAASuB,CAAS,EACnD,MAAM,IAAI,MAAM,UAAUA,CAAS,qDAAqD,OAAO,OAAOvB,CAAc,EAAE,KAAK,IAAI,CAAC,EAAE,EAGpI,KAAK,QAAUuB,EACf,KAAK,KAAK,QAAQ,CAAE,gBAAiBA,CAAS,EAAIxB,CAAiB,EACrE,CACF"}
|
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
import { RawBundleSource as i, LocaleManager as
|
|
2
|
-
import
|
|
3
|
-
import m from "./en-US.js";
|
|
1
|
+
import { RawBundleSource as i, LocaleManager as u } from "@dialpad/i18n";
|
|
2
|
+
import f from "./en-US.js";
|
|
4
3
|
import d from "./zh-CN.js";
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
const
|
|
4
|
+
import m from "./nl-NL.js";
|
|
5
|
+
import p from "./fr-FR.js";
|
|
6
|
+
import g from "./de-DE.js";
|
|
7
|
+
import h from "./it-IT.js";
|
|
8
|
+
import S from "./ja-JP.js";
|
|
9
|
+
import w from "./pt-BR.js";
|
|
10
|
+
import N from "./ru-RU.js";
|
|
11
|
+
import L from "./es-LA.js";
|
|
12
|
+
const r = "dialtone", t = {
|
|
14
13
|
ENGLISH: "en-US",
|
|
15
14
|
CHINESE: "zh-CN",
|
|
16
15
|
DUTCH: "nl-NL",
|
|
@@ -21,35 +20,38 @@ const e = "dialtone", t = {
|
|
|
21
20
|
PORTUGUESE: "pt-BR",
|
|
22
21
|
RUSSIAN: "ru-RU",
|
|
23
22
|
SPANISH: "es-LA"
|
|
24
|
-
},
|
|
23
|
+
}, l = "en-US", c = "user-locale";
|
|
25
24
|
class o {
|
|
26
|
-
|
|
25
|
+
/**
|
|
26
|
+
* @prop {import('@dialpad/i18n').UseI18N} i18n
|
|
27
|
+
* @private
|
|
28
|
+
*/
|
|
29
|
+
constructor(e = null) {
|
|
27
30
|
if (typeof o.instance == "object")
|
|
28
31
|
return o.instance;
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
const n = new i({
|
|
32
|
+
this._locale = e || o.getPreferredLocale();
|
|
33
|
+
const a = new i({
|
|
32
34
|
resources: i.builtResources([
|
|
33
|
-
["en-US",
|
|
34
|
-
["zh-CN",
|
|
35
|
-
["nl-NL",
|
|
36
|
-
["fr-FR",
|
|
37
|
-
["de-DE",
|
|
38
|
-
["it-IT",
|
|
39
|
-
["ja-JP",
|
|
40
|
-
["pt-BR",
|
|
41
|
-
["ru-RU",
|
|
42
|
-
["es-LA",
|
|
35
|
+
["en-US", r, f],
|
|
36
|
+
["zh-CN", r, d],
|
|
37
|
+
["nl-NL", r, m],
|
|
38
|
+
["fr-FR", r, p],
|
|
39
|
+
["de-DE", r, g],
|
|
40
|
+
["it-IT", r, h],
|
|
41
|
+
["ja-JP", r, S],
|
|
42
|
+
["pt-BR", r, w],
|
|
43
|
+
["ru-RU", r, N],
|
|
44
|
+
["es-LA", r, L]
|
|
43
45
|
])
|
|
44
|
-
})
|
|
45
|
-
|
|
46
|
-
bundleSource: n,
|
|
46
|
+
}), n = new u({
|
|
47
|
+
bundleSource: a,
|
|
47
48
|
allowedLocales: Object.values(t),
|
|
48
|
-
fallbackLocale:
|
|
49
|
+
fallbackLocale: l,
|
|
49
50
|
preferredLocale: this._locale,
|
|
50
|
-
namespaces: [
|
|
51
|
-
})
|
|
52
|
-
|
|
51
|
+
namespaces: [r]
|
|
52
|
+
});
|
|
53
|
+
return o.instance = this, this.i18n = n.useI18N(r), typeof window < "u" && (window.onstorage = (s) => {
|
|
54
|
+
s.key === c && (this.currentLocale = s.newValue);
|
|
53
55
|
}), this;
|
|
54
56
|
}
|
|
55
57
|
/**
|
|
@@ -58,9 +60,9 @@ class o {
|
|
|
58
60
|
*/
|
|
59
61
|
static getPreferredLocale() {
|
|
60
62
|
if (typeof window > "u" || !window.localStorage)
|
|
61
|
-
return
|
|
62
|
-
const
|
|
63
|
-
return
|
|
63
|
+
return l;
|
|
64
|
+
const e = window.localStorage.getItem(c), a = Object.values(t).find((n) => n.startsWith(navigator.language.slice(0, 2)));
|
|
65
|
+
return e || a || l;
|
|
64
66
|
}
|
|
65
67
|
static getAllowedLocales() {
|
|
66
68
|
return t;
|
|
@@ -71,8 +73,8 @@ class o {
|
|
|
71
73
|
* It’s used for simple text translations.
|
|
72
74
|
* https://github.com/dialpad/goblin-client-tools/tree/main/packages/i18n#t
|
|
73
75
|
*/
|
|
74
|
-
$t(...
|
|
75
|
-
return
|
|
76
|
+
$t(...e) {
|
|
77
|
+
return this.i18n.$t(...e);
|
|
76
78
|
}
|
|
77
79
|
/**
|
|
78
80
|
* Passthrough function to the i18n $ta function including the dialtone namespace
|
|
@@ -80,17 +82,17 @@ class o {
|
|
|
80
82
|
* aria-label, title, etc, rather than just a plain text. It’s useful for handling element attributes in the UI.
|
|
81
83
|
* https://github.com/dialpad/goblin-client-tools/tree/main/packages/i18n#ta
|
|
82
84
|
*/
|
|
83
|
-
$ta(...
|
|
84
|
-
return
|
|
85
|
+
$ta(...e) {
|
|
86
|
+
return this.i18n.$ta(...e);
|
|
85
87
|
}
|
|
86
88
|
get currentLocale() {
|
|
87
89
|
return this._locale;
|
|
88
90
|
}
|
|
89
|
-
set currentLocale(
|
|
90
|
-
if (
|
|
91
|
-
if (!Object.values(t).includes(
|
|
92
|
-
throw new Error(`Locale ${
|
|
93
|
-
this._locale =
|
|
91
|
+
set currentLocale(e) {
|
|
92
|
+
if (e !== this._locale) {
|
|
93
|
+
if (!Object.values(t).includes(e))
|
|
94
|
+
throw new Error(`Locale ${e} is not allowed, please use one of the following: ${Object.values(t).join(", ")}`);
|
|
95
|
+
this._locale = e, this.i18n.setI18N({ preferredLocale: e }, r);
|
|
94
96
|
}
|
|
95
97
|
}
|
|
96
98
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../localization/index.js"],"sourcesContent":["import { LocaleManager, RawBundleSource
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../localization/index.js"],"sourcesContent":["import { LocaleManager, RawBundleSource } from '@dialpad/i18n';\n\nimport enUS from './en-US.ftl?raw';\nimport zhCN from './zh-CN.ftl?raw';\nimport nlNL from './nl-NL.ftl?raw';\nimport frFR from './fr-FR.ftl?raw';\nimport deDE from './de-DE.ftl?raw';\nimport itIT from './it-IT.ftl?raw';\nimport jaJP from './ja-JP.ftl?raw';\nimport ptBR from './pt-BR.ftl?raw';\nimport ruRU from './ru-RU.ftl?raw';\nimport esLA from './es-LA.ftl?raw';\n\nconst dialtoneNamespace = 'dialtone';\nconst allowedLocales = {\n ENGLISH: 'en-US',\n CHINESE: 'zh-CN',\n DUTCH: 'nl-NL',\n FRENCH: 'fr-FR',\n GERMAN: 'de-DE',\n ITALIAN: 'it-IT',\n JAPANESE: 'ja-JP',\n PORTUGUESE: 'pt-BR',\n RUSSIAN: 'ru-RU',\n SPANISH: 'es-LA',\n};\nconst fallbackLocale = 'en-US';\n/**\n * Default key name used by the LocaleManager to store the user's preferred locale in localStorage\n */\nconst localeManagerStorageKey = 'user-locale';\n\n/**\n * Dialtone localization class, follows the singleton pattern to make sure only one instance of the class is created.\n * Initializes the localeManager and looks for changes on the browser storage to update the current locale.\n * https://github.com/dialpad/goblin-client-tools/tree/main/packages/i18n#i18n-vue-3-compatible\n */\nexport class DialtoneLocalization {\n /**\n * @prop {import('@dialpad/i18n').UseI18N} i18n\n * @private\n */\n constructor (locale = null) {\n if (typeof DialtoneLocalization.instance === 'object') {\n return DialtoneLocalization.instance;\n }\n\n this._locale = locale || DialtoneLocalization.getPreferredLocale();\n\n const bundleSource = new RawBundleSource({\n resources: RawBundleSource.builtResources([\n ['en-US', dialtoneNamespace, enUS],\n ['zh-CN', dialtoneNamespace, zhCN],\n ['nl-NL', dialtoneNamespace, nlNL],\n ['fr-FR', dialtoneNamespace, frFR],\n ['de-DE', dialtoneNamespace, deDE],\n ['it-IT', dialtoneNamespace, itIT],\n ['ja-JP', dialtoneNamespace, jaJP],\n ['pt-BR', dialtoneNamespace, ptBR],\n ['ru-RU', dialtoneNamespace, ruRU],\n ['es-LA', dialtoneNamespace, esLA],\n ]),\n });\n\n const localeManager = new LocaleManager({\n bundleSource,\n allowedLocales: Object.values(allowedLocales),\n fallbackLocale,\n preferredLocale: this._locale,\n namespaces: [dialtoneNamespace],\n });\n\n DialtoneLocalization.instance = this;\n this.i18n = localeManager.useI18N(dialtoneNamespace);\n\n if (typeof window !== 'undefined') {\n /**\n * @description\n * When the browser storage changes, update the current locale\n * @param event\n */\n window.onstorage = (event) => {\n if (event.key === localeManagerStorageKey) {\n this.currentLocale = event.newValue;\n }\n };\n }\n\n return this;\n }\n\n /**\n * Gets the preferred locale from user's locale stored in localStorage or the browser language\n * @returns { string }\n */\n static getPreferredLocale () {\n /**\n * Early return if we're not in the browser or if localStorage is not available\n */\n if (typeof window === 'undefined' || !window.localStorage) {\n return fallbackLocale;\n }\n\n const localStorageLanguage = window.localStorage.getItem(localeManagerStorageKey);\n\n // Get the first two letters of the navigator language and check if it's in the allowed locales\n const navigatorLanguage = Object.values(allowedLocales)\n .find(locale => locale.startsWith(navigator.language.slice(0, 2)));\n\n return localStorageLanguage || navigatorLanguage || fallbackLocale;\n }\n\n static getAllowedLocales () {\n return allowedLocales;\n }\n\n /**\n * Passthrough function to the i18n $t function including the dialtone namespace\n * Returns a translated string based on a key and optional variables.\n * It’s used for simple text translations.\n * https://github.com/dialpad/goblin-client-tools/tree/main/packages/i18n#t\n */\n $t (...args) {\n return this.i18n.$t(...args);\n }\n\n /**\n * Passthrough function to the i18n $ta function including the dialtone namespace\n * Returns an object containing translated attributes to pass directly as props to components, it can contain\n * aria-label, title, etc, rather than just a plain text. It’s useful for handling element attributes in the UI.\n * https://github.com/dialpad/goblin-client-tools/tree/main/packages/i18n#ta\n */\n $ta (...args) {\n return this.i18n.$ta(...args);\n }\n\n get currentLocale () {\n return this._locale;\n }\n\n set currentLocale (newLocale) {\n if (newLocale === this._locale) return;\n if (!Object.values(allowedLocales).includes(newLocale)) {\n throw new Error(`Locale ${newLocale} is not allowed, please use one of the following: ${Object.values(allowedLocales).join(', ')}`);\n }\n\n this._locale = newLocale;\n this.i18n.setI18N({ preferredLocale: newLocale }, dialtoneNamespace);\n }\n}\n"],"names":["dialtoneNamespace","allowedLocales","fallbackLocale","localeManagerStorageKey","DialtoneLocalization","locale","bundleSource","RawBundleSource","enUS","zhCN","nlNL","frFR","deDE","itIT","jaJP","ptBR","ruRU","esLA","localeManager","LocaleManager","event","localStorageLanguage","navigatorLanguage","args","newLocale"],"mappings":";;;;;;;;;;;AAaA,MAAMA,IAAoB,YACpBC,IAAiB;AAAA,EACrB,SAAS;AAAA,EACT,SAAS;AAAA,EACT,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,UAAU;AAAA,EACV,YAAY;AAAA,EACZ,SAAS;AAAA,EACT,SAAS;AACX,GACMC,IAAiB,SAIjBC,IAA0B;AAOzB,MAAMC,EAAqB;AAAA;AAAA;AAAA;AAAA;AAAA,EAKhC,YAAaC,IAAS,MAAM;AAC1B,QAAI,OAAOD,EAAqB,YAAa;AAC3C,aAAOA,EAAqB;AAG9B,SAAK,UAAUC,KAAUD,EAAqB,mBAAkB;AAEhE,UAAME,IAAe,IAAIC,EAAgB;AAAA,MACvC,WAAWA,EAAgB,eAAe;AAAA,QACxC,CAAC,SAASP,GAAmBQ,CAAI;AAAA,QACjC,CAAC,SAASR,GAAmBS,CAAI;AAAA,QACjC,CAAC,SAAST,GAAmBU,CAAI;AAAA,QACjC,CAAC,SAASV,GAAmBW,CAAI;AAAA,QACjC,CAAC,SAASX,GAAmBY,CAAI;AAAA,QACjC,CAAC,SAASZ,GAAmBa,CAAI;AAAA,QACjC,CAAC,SAASb,GAAmBc,CAAI;AAAA,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AAC5B,QAAIA,MAAc,KAAK,SACvB;AAAA,UAAI,CAAC,OAAO,OAAOvB,CAAc,EAAE,SAASuB,CAAS;AACnD,cAAM,IAAI,MAAM,UAAUA,CAAS,qDAAqD,OAAO,OAAOvB,CAAc,EAAE,KAAK,IAAI,CAAC,EAAE;AAGpI,WAAK,UAAUuB,GACf,KAAK,KAAK,QAAQ,EAAE,iBAAiBA,EAAS,GAAIxB,CAAiB;AAAA;AAAA,EACrE;AACF;"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { DialtoneLocalization } from '../localization';
|
|
2
1
|
declare const _default: import('vue').DefineComponent<{}, {}, {
|
|
3
|
-
i18n:
|
|
2
|
+
i18n: any;
|
|
4
3
|
}, {
|
|
5
|
-
closeButtonTitle():
|
|
4
|
+
closeButtonTitle(): any;
|
|
6
5
|
}, {
|
|
7
6
|
close(): void;
|
|
8
7
|
}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, "close"[], "close", import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{}>> & {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sr_only_close_button.vue.d.ts","sourceRoot":"","sources":["../../../common/sr_only_close_button.vue"],"names":[],"mappings":"AAaA
|
|
1
|
+
{"version":3,"file":"sr_only_close_button.vue.d.ts","sourceRoot":"","sources":["../../../common/sr_only_close_button.vue"],"names":[],"mappings":"AAaA;"}
|