@dialpad/dialtone 9.139.0 → 9.139.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/tokens/doc.json +48827 -48827
- package/dist/vue2/lib/emoji-row/emoji-row.cjs +1 -1
- package/dist/vue2/lib/emoji-row/emoji-row.cjs.map +1 -1
- package/dist/vue2/lib/emoji-row/emoji-row.js +1 -1
- package/dist/vue2/lib/emoji-row/emoji-row.js.map +1 -1
- package/dist/vue2/lib/pagination/pagination.cjs +1 -1
- package/dist/vue2/lib/pagination/pagination.cjs.map +1 -1
- package/dist/vue2/lib/pagination/pagination.js +6 -3
- package/dist/vue2/lib/pagination/pagination.js.map +1 -1
- package/dist/vue2/lib/tooltip/tooltip.cjs +1 -1
- package/dist/vue2/lib/tooltip/tooltip.cjs.map +1 -1
- package/dist/vue2/lib/tooltip/tooltip.js +1 -1
- package/dist/vue2/lib/tooltip/tooltip.js.map +1 -1
- package/dist/vue2/lib/tooltip-directive/tooltip.cjs +1 -1
- package/dist/vue2/lib/tooltip-directive/tooltip.cjs.map +1 -1
- package/dist/vue2/lib/tooltip-directive/tooltip.js +19 -14
- package/dist/vue2/lib/tooltip-directive/tooltip.js.map +1 -1
- package/dist/vue2/localization/ja-JP.cjs +2 -0
- package/dist/vue2/localization/ja-JP.cjs.map +1 -1
- package/dist/vue2/localization/ja-JP.js +2 -0
- package/dist/vue2/localization/ja-JP.js.map +1 -1
- package/dist/vue2/types/components/pagination/pagination.vue.d.ts.map +1 -1
- package/dist/vue2/types/directives/tooltip_directive/tooltip.d.ts.map +1 -1
- package/dist/vue2/types/recipes/conversation_view/emoji_row/emoji_row.vue.d.ts.map +1 -1
- package/dist/vue3/lib/emoji-row/emoji-row.cjs +1 -1
- package/dist/vue3/lib/emoji-row/emoji-row.cjs.map +1 -1
- package/dist/vue3/lib/emoji-row/emoji-row.js +5 -4
- package/dist/vue3/lib/emoji-row/emoji-row.js.map +1 -1
- package/dist/vue3/lib/pagination/pagination.cjs +1 -1
- package/dist/vue3/lib/pagination/pagination.cjs.map +1 -1
- package/dist/vue3/lib/pagination/pagination.js +37 -32
- package/dist/vue3/lib/pagination/pagination.js.map +1 -1
- package/dist/vue3/lib/tooltip/tooltip.cjs +1 -1
- package/dist/vue3/lib/tooltip/tooltip.cjs.map +1 -1
- package/dist/vue3/lib/tooltip/tooltip.js +1 -1
- package/dist/vue3/lib/tooltip/tooltip.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 +19 -14
- package/dist/vue3/lib/tooltip-directive/tooltip.js.map +1 -1
- package/dist/vue3/localization/ja-JP.cjs +2 -0
- package/dist/vue3/localization/ja-JP.cjs.map +1 -1
- package/dist/vue3/localization/ja-JP.js +2 -0
- package/dist/vue3/localization/ja-JP.js.map +1 -1
- package/dist/vue3/types/components/pagination/pagination.vue.d.ts.map +1 -1
- package/dist/vue3/types/components/tooltip/tooltip.vue.d.ts.map +1 -1
- package/dist/vue3/types/directives/tooltip_directive/tooltip.d.ts.map +1 -1
- package/dist/vue3/types/recipes/conversation_view/emoji_row/emoji_row.vue.d.ts.map +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pagination.js","sources":["../../../components/pagination/pagination.vue"],"sourcesContent":["<template>\n <nav\n :aria-label=\"ariaLabel\"\n class=\"d-pagination\"\n >\n <dt-button\n class=\"d-pagination__button\"\n data-qa=\"dt-pagination-prev\"\n :aria-label=\"prevAriaLabel\"\n kind=\"muted\"\n importance=\"clear\"\n :disabled=\"isFirstPage\"\n @click=\"changePage(currentPage - 1)\"\n >\n <template #icon>\n <dt-icon-chevron-left\n size=\"300\"\n />\n </template>\n </dt-button>\n <div\n v-for=\"(page, index) in pages\"\n :key=\"`page-${page}-${index}`\"\n :class=\"{ 'd-pagination__separator': isNaN(Number(page)) }\"\n >\n <!-- eslint-disable vue/no-bare-strings-in-template -->\n <div\n v-if=\"isNaN(Number(page))\"\n class=\"d-pagination__separator-icon\"\n data-qa=\"dt-pagination-separator\"\n >\n <dt-icon-more-horizontal\n size=\"300\"\n />\n <!-- … -->\n </div>\n <dt-button\n v-else\n :aria-label=\"pageNumberAriaLabel(page)\"\n :kind=\"currentPage === page ? 'default' : 'muted'\"\n :importance=\"currentPage === page ? 'primary' : 'clear'\"\n label-class=\"\"\n @click=\"changePage(page)\"\n >\n {{ page }}\n </dt-button>\n </div>\n <dt-button\n class=\"d-pagination__button\"\n data-qa=\"dt-pagination-next\"\n :aria-label=\"nextAriaLabel\"\n :disabled=\"isLastPage\"\n kind=\"muted\"\n importance=\"clear\"\n @click=\"changePage(currentPage + 1)\"\n >\n <template #icon>\n <dt-icon-chevron-right\n size=\"300\"\n />\n </template>\n </dt-button>\n </nav>\n</template>\n\n<script>\nimport { DtButton } from '@/components/button';\nimport { DtIconChevronLeft, DtIconChevronRight, DtIconMoreHorizontal } from '@dialpad/dialtone-icons/vue3';\nimport { DialtoneLocalization } from '@/localization';\n\n/**\n * Pagination allows you to divide large amounts of content into smaller chunks across multiple pages.\n * @see https://dialtone.dialpad.com/components/pagination.html\n */\nexport default {\n compatConfig: { MODE: 3 },\n name: 'DtPagination',\n\n components: {\n DtButton,\n DtIconChevronLeft,\n DtIconChevronRight,\n DtIconMoreHorizontal,\n },\n\n props: {\n /**\n * Descriptive label for the pagination content.\n */\n ariaLabel: {\n type: String,\n required: true,\n },\n\n /**\n * The total number of the pages\n */\n totalPages: {\n type: Number,\n required: true,\n },\n\n /**\n * The active current page in the list of pages, defaults to the first page\n */\n activePage: {\n type: Number,\n default: 1,\n },\n\n /**\n * Determines the max pages to be shown in the list. Using an odd number is recommended.\n * If an even number is given, then it will be rounded down to the nearest odd number to always\n * keep current page in the middle when current page is in the mid-range.\n */\n maxVisible: {\n type: Number,\n default: 5,\n },\n\n /**\n * Sometimes you may need to hide start and end page number buttons when moving in between.\n * This prop will be used to hide the first and last page buttons when not near the edges.\n * This is useful when your backend does not support offset and you can only use cursor based pagination.\n */\n hideEdges: {\n type: Boolean,\n default: false,\n },\n },\n\n emits: [\n /**\n * Page change event\n *\n * @event change\n * @type {Number}\n */\n 'change',\n ],\n\n data () {\n return {\n currentPage: this.activePage,\n i18n: new DialtoneLocalization(),\n };\n },\n\n computed: {\n isFirstPage () {\n return this.currentPage === 1;\n },\n\n isLastPage () {\n return this.currentPage === this.totalPages;\n },\n\n // eslint-disable-next-line complexity\n pages () {\n if (this.maxVisible === 0) {\n return [];\n }\n if (this.totalPages <= this.maxVisible) {\n return this.range(1, this.totalPages);\n }\n\n let start = this.maxVisible - 1;\n let end = this.totalPages - start + 1;\n\n // if hideEdges is true, modify the start and\n // end to account for the hidden pages\n if (this.hideEdges) {\n start = start + 1;\n end = end - 1;\n }\n\n if (this.currentPage < start) {\n const pages = [...this.range(1, start), '...'];\n if (!this.hideEdges) {\n // add last page to the end\n pages.push(this.totalPages);\n }\n return pages;\n }\n\n if (this.currentPage > end) {\n const pages = ['...', ...this.range(end, this.totalPages)];\n if (!this.hideEdges) {\n // add first page to the beginning\n pages.unshift(1);\n }\n return pages;\n }\n\n // rounding to the nearest odd according to the maxlength to always show the page number in the middle.\n const total = this.maxVisible - (3 - this.maxVisible % 2);\n const centerIndex = Math.floor(total / 2);\n let left = this.currentPage - centerIndex;\n let right = this.currentPage + centerIndex;\n\n // if hideEdge is true, modify the left and right to account for the hidden pages\n if (this.hideEdges) {\n left = left - 1;\n right = right + 1;\n }\n\n const pages = ['...', ...this.range(left, right), '...'];\n if (!this.hideEdges) {\n return [1, ...pages, this.totalPages];\n }\n return pages;\n },\n\n prevAriaLabel () {\n return this.isFirstPage ? this.i18n.$t('DIALTONE_PAGINATION_FIRST_PAGE') : this.i18n.$t('DIALTONE_PAGINATION_PREVIOUS_PAGE');\n },\n\n nextAriaLabel () {\n return this.isLastPage ? this.i18n.$t('DIALTONE_PAGINATION_LAST_PAGE') : this.i18n.$t('DIALTONE_PAGINATION_NEXT_PAGE');\n },\n\n pageNumberAriaLabel () {\n return (page) => {\n return page === this.totalPages ? `${this.i18n.$t('DIALTONE_PAGINATION_LAST_PAGE')} ${page}` : `${this.i18n.$t('DIALTONE_PAGINATION_PAGE_NUMBER', { page })}`;\n };\n },\n },\n\n watch: {\n activePage () {\n this.currentPage = this.activePage;\n },\n },\n\n methods: {\n range (from, to) {\n const range = [];\n from = from > 0 ? from : 1;\n for (let i = from; i <= to; i++) {\n range.push(i);\n }\n return range;\n },\n\n changePage (page) {\n this.currentPage = page;\n this.$emit('change', this.currentPage);\n },\n },\n};\n</script>\n"],"names":["_sfc_main","DtButton","DtIconChevronLeft","DtIconChevronRight","DtIconMoreHorizontal","DialtoneLocalization","start","end","pages","total","centerIndex","left","right","page","from","to","range","i","_hoisted_1","_createElementBlock","$props","_createVNode","_component_dt_button","$options","_cache","$event","$data","_component_dt_icon_chevron_left","_openBlock","_Fragment","_renderList","index","_normalizeClass","_hoisted_2","_component_dt_icon_more_horizontal","_createBlock","_withCtx","_createTextVNode","_toDisplayString","_component_dt_icon_chevron_right"],"mappings":";;;;;AA0EA,MAAKA,IAAU;AAAA,EACb,cAAc,EAAE,MAAM;EACtB,MAAM;AAAA,EAEN,YAAY;AAAA,IACV,UAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,oBAAAC;AAAA,IACA,sBAAAC;AAAA;EAGF,OAAO;AAAA;AAAA;AAAA;AAAA,IAIL,WAAW;AAAA,MACT,MAAM;AAAA,MACN,UAAU;AAAA;;;;IAMZ,YAAY;AAAA,MACV,MAAM;AAAA,MACN,UAAU;AAAA;;;;IAMZ,YAAY;AAAA,MACV,MAAM;AAAA,MACN,SAAS;AAAA;;;;;;IAQX,YAAY;AAAA,MACV,MAAM;AAAA,MACN,SAAS;AAAA;;;;;;IAQX,WAAW;AAAA,MACT,MAAM;AAAA,MACN,SAAS;AAAA;;EAIb,OAAO;AAAA;AAAA;AAAA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ourcesContent":["<template>\n <nav\n v-show=\"totalPages > 0\"\n :aria-label=\"ariaLabel\"\n class=\"d-pagination\"\n >\n <dt-button\n class=\"d-pagination__button\"\n data-qa=\"dt-pagination-prev\"\n :aria-label=\"prevAriaLabel\"\n kind=\"muted\"\n importance=\"clear\"\n :disabled=\"isFirstPage\"\n @click=\"changePage(currentPage - 1)\"\n >\n <template #icon>\n <dt-icon-chevron-left\n size=\"300\"\n />\n </template>\n </dt-button>\n <div\n v-for=\"(page, index) in pages\"\n :key=\"`page-${page}-${index}`\"\n :class=\"{ 'd-pagination__separator': isNaN(Number(page)) }\"\n >\n <!-- eslint-disable vue/no-bare-strings-in-template -->\n <div\n v-if=\"isNaN(Number(page))\"\n class=\"d-pagination__separator-icon\"\n data-qa=\"dt-pagination-separator\"\n >\n <dt-icon-more-horizontal\n size=\"300\"\n />\n <!-- … -->\n </div>\n <dt-button\n v-else\n :aria-label=\"pageNumberAriaLabel(page)\"\n :kind=\"currentPage === page ? 'default' : 'muted'\"\n :importance=\"currentPage === page ? 'primary' : 'clear'\"\n label-class=\"\"\n @click=\"changePage(page)\"\n >\n {{ page }}\n </dt-button>\n </div>\n <dt-button\n class=\"d-pagination__button\"\n data-qa=\"dt-pagination-next\"\n :aria-label=\"nextAriaLabel\"\n :disabled=\"isLastPage\"\n kind=\"muted\"\n importance=\"clear\"\n @click=\"changePage(currentPage + 1)\"\n >\n <template #icon>\n <dt-icon-chevron-right\n size=\"300\"\n />\n </template>\n </dt-button>\n </nav>\n</template>\n\n<script>\nimport { DtButton } from '@/components/button';\nimport { DtIconChevronLeft, DtIconChevronRight, DtIconMoreHorizontal } from '@dialpad/dialtone-icons/vue3';\nimport { DialtoneLocalization } from '@/localization';\n\n/**\n * Pagination allows you to divide large amounts of content into smaller chunks across multiple pages.\n * @see https://dialtone.dialpad.com/components/pagination.html\n */\nexport default {\n compatConfig: { MODE: 3 },\n name: 'DtPagination',\n\n components: {\n DtButton,\n DtIconChevronLeft,\n DtIconChevronRight,\n DtIconMoreHorizontal,\n },\n\n props: {\n /**\n * Descriptive label for the pagination content.\n */\n ariaLabel: {\n type: String,\n required: true,\n },\n\n /**\n * The total number of the pages\n */\n totalPages: {\n type: Number,\n required: true,\n },\n\n /**\n * The active current page in the list of pages, defaults to the first page\n */\n activePage: {\n type: Number,\n default: 1,\n },\n\n /**\n * Determines the max pages to be shown in the list. Using an odd number is recommended.\n * If an even number is given, then it will be rounded down to the nearest odd number to always\n * keep current page in the middle when current page is in the mid-range.\n */\n maxVisible: {\n type: Number,\n default: 5,\n },\n\n /**\n * Sometimes you may need to hide start and end page number buttons when moving in between.\n * This prop will be used to hide the first and last page buttons when not near the edges.\n * This is useful when your backend does not support offset and you can only use cursor based pagination.\n */\n hideEdges: {\n type: Boolean,\n default: false,\n },\n },\n\n emits: [\n /**\n * Page change event\n *\n * @event change\n * @type {Number}\n */\n 'change',\n ],\n\n data () {\n return {\n currentPage: this.activePage,\n i18n: new DialtoneLocalization(),\n };\n },\n\n computed: {\n isFirstPage () {\n return this.currentPage === 1;\n },\n\n isLastPage () {\n return this.currentPage === this.totalPages;\n },\n\n // eslint-disable-next-line complexity\n pages () {\n if (this.maxVisible === 0) {\n return [];\n }\n if (this.totalPages <= this.maxVisible) {\n return this.range(1, this.totalPages);\n }\n\n let start = this.maxVisible - 1;\n let end = this.totalPages - start + 1;\n\n // if hideEdges is true, modify the start and\n // end to account for the hidden pages\n if (this.hideEdges) {\n start = start + 1;\n end = end - 1;\n }\n\n if (this.currentPage < start) {\n const pages = [...this.range(1, start), '...'];\n if (!this.hideEdges) {\n // add last page to the end\n pages.push(this.totalPages);\n }\n return pages;\n }\n\n if (this.currentPage > end) {\n const pages = ['...', ...this.range(end, this.totalPages)];\n if (!this.hideEdges) {\n // add first page to the beginning\n pages.unshift(1);\n }\n return pages;\n }\n\n // rounding to the nearest odd according to the maxlength to always show the page number in the middle.\n const total = this.maxVisible - (3 - this.maxVisible % 2);\n const centerIndex = Math.floor(total / 2);\n let left = this.currentPage - centerIndex;\n let right = this.currentPage + centerIndex;\n\n // if hideEdge is true, modify the left and right to account for the hidden pages\n if (this.hideEdges) {\n left = left - 1;\n right = right + 1;\n }\n\n const pages = ['...', ...this.range(left, right), '...'];\n if (!this.hideEdges) {\n return [1, ...pages, this.totalPages];\n }\n return pages;\n },\n\n prevAriaLabel () {\n return this.isFirstPage ? this.i18n.$t('DIALTONE_PAGINATION_FIRST_PAGE') : this.i18n.$t('DIALTONE_PAGINATION_PREVIOUS_PAGE');\n },\n\n nextAriaLabel () {\n return this.isLastPage ? this.i18n.$t('DIALTONE_PAGINATION_LAST_PAGE') : this.i18n.$t('DIALTONE_PAGINATION_NEXT_PAGE');\n },\n\n pageNumberAriaLabel () {\n return (page) => {\n return page === this.totalPages ? `${this.i18n.$t('DIALTONE_PAGINATION_LAST_PAGE')} ${page}` : `${this.i18n.$t('DIALTONE_PAGINATION_PAGE_NUMBER', { page })}`;\n };\n },\n },\n\n watch: {\n activePage () {\n this.currentPage = this.activePage;\n },\n\n totalPages (pages) {\n if (this.currentPage > pages || this.currentPage <= 0){\n this.currentPage = pages;\n }\n },\n },\n\n methods: {\n range (from, to) {\n const range = [];\n from = from > 0 ? from : 1;\n for (let i = from; i <= to; i++) {\n range.push(i);\n }\n return range;\n },\n\n changePage (page) {\n this.currentPage = page;\n this.$emit('change', this.currentPage);\n },\n },\n};\n</script>\n"],"names":["_sfc_main","DtButton","DtIconChevronLeft","DtIconChevronRight","DtIconMoreHorizontal","DialtoneLocalization","start","end","pages","total","centerIndex","left","right","page","from","to","range","i","_hoisted_1","_createElementBlock","$props","_createVNode","_component_dt_button","$options","_cache","$event","$data","_component_dt_icon_chevron_left","_openBlock","_Fragment","_renderList","index","_normalizeClass","_hoisted_2","_component_dt_icon_more_horizontal","_createBlock","_withCtx","_createTextVNode","_toDisplayString","_component_dt_icon_chevron_right"],"mappings":";;;;;AA2EA,MAAKA,IAAU;AAAA,EACb,cAAc,EAAE,MAAM;EACtB,MAAM;AAAA,E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A3C/B,SAAAuB,EA6CQ,MAAU;AAAA,UA7ClBC,EAAAC,EA6CWzB,CAAI,GAAA,CAAA;AAAA;QA7Cf,GAAA;AAAA;;IAgDIQ,EAcYC,GAAA;AAAA,MAbV,OAAM;AAAA,MACN,WAAQ;AAAA,MACP,cAAYC,EAAA;AAAA,MACZ,UAAUA,EAAA;AAAA,MACX,MAAK;AAAA,MACL,YAAW;AAAA,MACV,SAAKC,EAAA,CAAA,MAAAA,EAAA,CAAA,IAAA,CAAAC,MAAEF,EAAA,WAAWG,EAAA,cAAW,CAAA;AAAA;MAEnB,QACT,MAEE;AAAA,QAFFL,EAEEkB,GAAA,EADA,MAAK,MAAK,CAAA;AAAA;MA3DpB,GAAA;AAAA;EAAA,GAAA,GAAArB,CAAA,IAAA;AAAA,QAEYE,EAAA,aAAU,CAAA;AAAA;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("./tooltip-constants.cjs"),d=require("../popover/popover-constants.cjs"),s=require("../../common/utils/index.cjs"),l=require("../popover/tippy-utils.cjs"),o=require("vue"),u=require("../../_plugin-vue_export-helper-BRilXfQE.cjs"),c={compatConfig:{MODE:3},name:"DtTooltip",props:{id:{type:String,default(){return s.getUniqueString()}},fallbackPlacements:{type:Array,default:()=>["auto"]},inverted:{type:Boolean,default:!1},offset:{type:Array,default:()=>[0,12]},placement:{type:String,default:"top",validator(e){return a.TOOLTIP_DIRECTIONS.includes(e)}},sticky:{type:[Boolean,String],default:!0,validator:e=>a.TOOLTIP_STICKY_VALUES.includes(e)},appendTo:{type:[HTMLElement,String],default:"body",validator:e=>d.POPOVER_APPEND_TO_VALUES.includes(e)||e instanceof HTMLElement},contentClass:{type:[String,Object,Array],default:""},message:{type:String,default:""},enabled:{type:Boolean,default:!0},show:{type:Boolean,default:null},transition:{type:Boolean,default:!0},delay:{type:Boolean,default:!0},theme:{type:String,default:null},externalAnchor:{type:String,default:null}},emits:["shown","update:show"],data(){return{TOOLTIP_KIND_MODIFIERS:a.TOOLTIP_KIND_MODIFIERS,hasSlotContent:s.hasSlotContent,tip:null,inTimer:null,internalShow:!1,currentPlacement:this.placement}},computed:{tippyProps(){return{offset:this.offset,delay:this.delay?a.TOOLTIP_DELAY_MS:!1,placement:this.placement,sticky:this.sticky,theme:this.inverted?"inverted":this.theme,animation:this.transition?"fade":!1,onShown:e=>this.onShow(e,"onShown"),onShow:e=>this.onShow(e,"onShow"),onHidden:this.onHide,popperOptions:l.getPopperOptions({fallbackPlacements:this.fallbackPlacements,hasHideModifierEnabled:!0})}},anchor(){return this.externalAnchor?document.body.querySelector(this.externalAnchor):l.getAnchor(this.$refs.anchor)}},watch:{tippyProps:{handler:"setProps",deep:!0},show:{handler:function(e){e!==null&&this.enabled&&(this.internalShow=e)},immediate:!0},internalShow(e){e?(this.setProps(),this.tip.show()):this.tip.hide()},sticky(e){this.tip.setProps({sticky:e})}},async mounted(){!this.enabled&&this.show!=null&&(console.warn("Tooltip: You cannot use both the enabled and show props at the same time."),console.warn("The show prop will be ignored.")),this.tip=l.createTippy(this.anchor,this.initOptions()),this.externalAnchor&&(await s.flushPromises(),this.addExternalAnchorEventListeners()),s.warnIfUnmounted(s.returnFirstEl(this.$el),this.$options.name)},beforeUnmount(){var e,t;this.externalAnchor&&this.removeExternalAnchorEventListeners(),(e=this.anchor)!=null&&e._tippy&&((t=this.tip)==null||t.destroy())},methods:{calculateAnchorZindex(){return s.returnFirstEl(this.$el).getRootNode().querySelector(`.d-modal[aria-hidden="false"],
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("./tooltip-constants.cjs"),d=require("../popover/popover-constants.cjs"),s=require("../../common/utils/index.cjs"),l=require("../popover/tippy-utils.cjs"),o=require("vue"),u=require("../../_plugin-vue_export-helper-BRilXfQE.cjs"),c={compatConfig:{MODE:3},name:"DtTooltip",props:{id:{type:String,default(){return s.getUniqueString()}},fallbackPlacements:{type:Array,default:()=>["auto"]},inverted:{type:Boolean,default:!1},offset:{type:Array,default:()=>[0,12]},placement:{type:String,default:"top",validator(e){return a.TOOLTIP_DIRECTIONS.includes(e)}},sticky:{type:[Boolean,String],default:!0,validator:e=>a.TOOLTIP_STICKY_VALUES.includes(e)},appendTo:{type:[HTMLElement,String],default:"body",validator:e=>d.POPOVER_APPEND_TO_VALUES.includes(e)||e instanceof HTMLElement},contentClass:{type:[String,Object,Array],default:""},message:{type:String,default:""},enabled:{type:Boolean,default:!0},show:{type:Boolean,default:null},transition:{type:Boolean,default:!0},delay:{type:Boolean,default:!0},theme:{type:String,default:null},externalAnchor:{type:String,default:null}},emits:["shown","update:show"],data(){return{TOOLTIP_KIND_MODIFIERS:a.TOOLTIP_KIND_MODIFIERS,hasSlotContent:s.hasSlotContent,tip:null,inTimer:null,internalShow:!1,currentPlacement:this.placement}},computed:{tippyProps(){return{offset:this.offset,delay:this.delay?a.TOOLTIP_DELAY_MS:!1,placement:this.placement,sticky:this.sticky,theme:this.inverted?"inverted":this.theme,animation:this.transition?"fade":!1,onShown:e=>this.onShow(e,"onShown"),onShow:e=>this.onShow(e,"onShow"),onHidden:this.onHide,popperOptions:l.getPopperOptions({fallbackPlacements:this.fallbackPlacements,hasHideModifierEnabled:!0})}},anchor(){return this.externalAnchor?document.body.querySelector(this.externalAnchor):l.getAnchor(this.$refs.anchor)}},watch:{tippyProps:{handler:"setProps",deep:!0},show:{handler:function(e){e!==null&&this.enabled&&(this.internalShow=e)},immediate:!0},internalShow(e){this.tip&&(e?(this.setProps(),this.tip.show()):this.tip.hide())},sticky(e){this.tip.setProps({sticky:e})}},async mounted(){!this.enabled&&this.show!=null&&(console.warn("Tooltip: You cannot use both the enabled and show props at the same time."),console.warn("The show prop will be ignored.")),this.tip=l.createTippy(this.anchor,this.initOptions()),this.externalAnchor&&(await s.flushPromises(),this.addExternalAnchorEventListeners()),s.warnIfUnmounted(s.returnFirstEl(this.$el),this.$options.name)},beforeUnmount(){var e,t;this.externalAnchor&&this.removeExternalAnchorEventListeners(),(e=this.anchor)!=null&&e._tippy&&((t=this.tip)==null||t.destroy())},methods:{calculateAnchorZindex(){return s.returnFirstEl(this.$el).getRootNode().querySelector(`.d-modal[aria-hidden="false"],
|
|
2
2
|
.d-modal--transparent[aria-hidden="false"],
|
|
3
3
|
.d-modal:not([aria-hidden]),
|
|
4
4
|
.d-modal--transparent:not([aria-hidden])`)||s.returnFirstEl(this.$el).closest(".d-zi-drawer")?651:400},hasVisibleFocus(){return this.anchor.matches(":focus-visible")},onEnterAnchor(e){this.enabled&&(this.delay&&this.inTimer===null?this.inTimer=setTimeout(()=>{this.triggerShow(e)},a.TOOLTIP_DELAY_MS):this.triggerShow(e))},triggerShow(e){e.type==="focusin"?this.show===null&&this.hasVisibleFocus()&&(this.internalShow=!0):this.show===null&&(this.internalShow=!0)},onLeaveAnchor(e){e.type==="keydown"&&e.code!=="Escape"||(clearTimeout(this.inTimer),this.inTimer=null,this.triggerHide())},triggerHide(){this.show===null&&(this.internalShow=!1)},onChangePlacement(e){this.currentPlacement=e},onHide(){var e;(e=this.tip)==null||e.unmount(),this.$emit("shown",!1),this.show!==null&&this.$emit("update:show",!1)},onShow(e,t){if(!this.tooltipHasContent(e))return!1;this.transition&&t==="onShow"||(this.$emit("shown",!0),this.show!==null&&this.$emit("update:show",!0))},setProps(){var e,t;this.tip&&this.tip.setProps&&this.tip.setProps({...this.tippyProps,appendTo:this.appendTo==="body"?(t=(e=this.anchor)==null?void 0:e.getRootNode())==null?void 0:t.querySelector("body"):this.appendTo,zIndex:this.calculateAnchorZindex()})},onMount(){this.setProps()},tooltipHasContent(e){return e.props.content.textContent.trim().length!==0},initOptions(){return{content:this.$refs.content,arrow:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="7"><path d="M 14.5,7 8,0 1.5,7 Z"/></svg>',duration:180,interactive:!1,trigger:"manual",hideOnClick:!1,touch:!1,onMount:this.onMount,showOnCreate:this.internalShow,popperOptions:l.getPopperOptions({hasHideModifierEnabled:!0})}},addExternalAnchorEventListeners(){["focusin","mouseenter"].forEach(e=>{var t;(t=this.anchor)==null||t.addEventListener(e,n=>this.onEnterAnchor(n))}),["focusout","mouseleave","keydown"].forEach(e=>{var t;(t=this.anchor)==null||t.addEventListener(e,n=>this.onLeaveAnchor(n))})},removeExternalAnchorEventListeners(){["focusin","mouseenter"].forEach(e=>{var t;(t=this.anchor)==null||t.removeEventListener(e,n=>this.onEnterAnchor(n))}),["focusout","mouseleave","keydown"].forEach(e=>{var t;(t=this.anchor)==null||t.removeEventListener(e,n=>this.onLeaveAnchor(n))})}}},p={"data-qa":"dt-tooltip-container"},f=["id"];function m(e,t,n,y,h,i){return o.openBlock(),o.createElementBlock("div",p,[n.externalAnchor?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("span",{key:0,ref:"anchor","data-qa":"dt-tooltip-anchor",onFocusin:t[0]||(t[0]=(...r)=>i.onEnterAnchor&&i.onEnterAnchor(...r)),onFocusout:t[1]||(t[1]=(...r)=>i.onLeaveAnchor&&i.onLeaveAnchor(...r)),onMouseenter:t[2]||(t[2]=(...r)=>i.onEnterAnchor&&i.onEnterAnchor(...r)),onMouseleave:t[3]||(t[3]=(...r)=>i.onLeaveAnchor&&i.onLeaveAnchor(...r)),onKeydown:t[4]||(t[4]=o.withKeys((...r)=>i.onLeaveAnchor&&i.onLeaveAnchor(...r),["esc"]))},[o.renderSlot(e.$slots,"anchor")],544)),o.createElementVNode("div",{id:n.id,ref:"content","data-qa":"dt-tooltip",class:o.normalizeClass(["d-tooltip",{[h.TOOLTIP_KIND_MODIFIERS.inverted]:n.inverted},n.contentClass])},[o.renderSlot(e.$slots,"default",{},()=>[o.createTextVNode(o.toDisplayString(n.message),1)])],10,f)])}const w=u._(c,[["render",m]]);exports.default=w;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tooltip.cjs","sources":["../../../components/tooltip/tooltip.vue"],"sourcesContent":["<template>\n <div data-qa=\"dt-tooltip-container\">\n <!-- disabling as the below events are for capturing events from interactive\n elements within the span rather than on the span itself -->\n <!-- eslint-disable-next-line vuejs-accessibility/no-static-element-interactions -->\n <span\n v-if=\"!externalAnchor\"\n ref=\"anchor\"\n data-qa=\"dt-tooltip-anchor\"\n @focusin=\"onEnterAnchor\"\n @focusout=\"onLeaveAnchor\"\n @mouseenter=\"onEnterAnchor\"\n @mouseleave=\"onLeaveAnchor\"\n @keydown.esc=\"onLeaveAnchor\"\n >\n <!-- @slot Slot for the anchor element -->\n <slot\n name=\"anchor\"\n />\n </span>\n <div\n :id=\"id\"\n ref=\"content\"\n data-qa=\"dt-tooltip\"\n :class=\"[\n 'd-tooltip',\n {\n [ TOOLTIP_KIND_MODIFIERS.inverted ]: inverted,\n },\n contentClass,\n ]\"\n >\n <!-- In case when transitionend event doesn't work correct (for ex. tooltip component with custom trigger) -->\n <!-- after-leave event can be used instead of transitionend -->\n <!-- @slot Slot for the content, defaults to message prop -->\n <slot>\n {{ message }}\n </slot>\n </div>\n </div>\n</template>\n\n<script>\nimport {\n TOOLTIP_KIND_MODIFIERS,\n TOOLTIP_DIRECTIONS,\n TOOLTIP_STICKY_VALUES,\n TOOLTIP_DELAY_MS,\n} from './tooltip_constants.js';\nimport {\n POPOVER_APPEND_TO_VALUES,\n} from '../popover/popover_constants';\nimport { flushPromises, getUniqueString, hasSlotContent, warnIfUnmounted, returnFirstEl } from '@/common/utils';\nimport {\n createTippy,\n getAnchor,\n getPopperOptions,\n} from '@/components/popover/tippy_utils';\n\n/**\n * A tooltip is a floating label that briefly explains an action, function, or an element.\n * Its content is exclusively text and shouldn't be vital information for users.\n * If richer media is desired, consider using a popover instead.\n * @see https://dialtone.dialpad.com/components/tooltip.html\n */\nexport default {\n compatConfig: { MODE: 3 },\n name: 'DtTooltip',\n\n props: {\n /**\n * The id of the tooltip\n */\n id: {\n type: String,\n default () { return getUniqueString(); },\n },\n\n /**\n * If the popover does not fit in the direction described by \"placement\",\n * it will attempt to change its direction to the \"fallbackPlacements\"\n * if defined, otherwise it will automatically position to a new location\n * as it sees best fit. See\n * <a\n * class=\"d-link\"\n * href=\"https://popper.js.org/docs/v2/modifiers/flip/#fallbackplacements\"\n * target=\"_blank\"\n * >\n * Popper.js docs\n * </a>\n * */\n fallbackPlacements: {\n type: Array,\n default: () => ['auto'],\n },\n\n /**\n * If true, applies inverted styles to the tooltip\n * @values true, false\n */\n inverted: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Displaces the tooltip from its reference element\n * by the specified number of pixels. See\n * <a\n * class=\"d-link\"\n * href=\"https://atomiks.github.io/tippyjs/v6/all-props/#offset\"\n * target=\"_blank\"\n * >\n * Tippy.js docs\n * </a>\n */\n offset: {\n type: Array,\n default: () => [0, 12],\n },\n\n /**\n * The direction the popover displays relative to the anchor. See\n * <a\n * class=\"d-link\"\n * href=\"https://atomiks.github.io/tippyjs/v6/all-props/#placement\"\n * target=\"_blank\"\n * >\n * Tippy.js docs\n * </a>\n * @values top, top-start, top-end,\n * right, right-start, right-end,\n * left, left-start, left-end,\n * bottom, bottom-start, bottom-end,\n * auto, auto-start, auto-end\n */\n placement: {\n type: String,\n default: 'top',\n validator (placement) {\n return TOOLTIP_DIRECTIONS.includes(placement);\n },\n },\n\n /**\n * If the tooltip sticks to the anchor. This is usually not needed, but can be needed\n * if the reference element's position is animating, or to automatically update the popover\n * position in those cases the DOM layout changes the reference element's position.\n * `true` enables it, `reference` only checks the \"reference\" rect for changes and `popper` only\n * checks the \"popper\" rect for changes. See\n * <a\n * class=\"d-link\"\n * href=\"https://atomiks.github.io/tippyjs/v6/all-props/#sticky\"\n * target=\"_blank\"\n * >\n * Tippy.js docs\n * </a>\n * @values true, false, reference, popper\n */\n sticky: {\n type: [Boolean, String],\n default: true,\n validator: (sticky) => {\n return TOOLTIP_STICKY_VALUES.includes(sticky);\n },\n },\n\n /**\n * Sets the element to which the tooltip is going to append to.\n * 'body' will append to the nearest body (supports shadow DOM).\n * This prop is not reactive, must be set on initial render.\n * @values 'body', 'parent', HTMLElement,\n */\n appendTo: {\n type: [HTMLElement, String],\n default: 'body',\n validator: appendTo => {\n return POPOVER_APPEND_TO_VALUES.includes(appendTo) ||\n (appendTo instanceof HTMLElement);\n },\n },\n\n /**\n * Additional css classes for the tooltip content element.\n * Can accept all of String, Object, and Array, i.e. has the\n * same api as Vue's built-in handling of the class attribute.\n */\n contentClass: {\n type: [String, Object, Array],\n default: '',\n },\n\n /**\n * A provided message for the tooltip content\n */\n message: {\n type: String,\n default: '',\n },\n\n /**\n * Controls whether hover/focus causes the tooltip to appear.\n * Cannot be combined with the show prop. show value will be ignored.\n * by default this is true, if you override with false, the tooltip will never show up.\n */\n enabled: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Controls whether the tooltip is shown. Leaving this null will have the tooltip trigger on mouseover by default.\n * If you set this value, the default mouseover behavior will be disabled and you can control it as you need.\n * Supports .sync modifier\n * @values null, true, false\n */\n show: {\n type: Boolean,\n default: null,\n },\n\n /**\n * Whether the tooltip should have a transition effect (fade).\n */\n transition: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Whether the tooltip will have a delay when being focused or moused over.\n * @values true, false\n */\n delay: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Set a custom theme on the tooltip. See https://atomiks.github.io/tippyjs/v6/themes/\n */\n theme: {\n type: String,\n default: null,\n },\n\n /**\n * External anchor id to use in those cases the anchor can't be provided via the slot.\n * For instance, using the combobox's input as the anchor for the popover.\n */\n externalAnchor: {\n type: String,\n default: null,\n },\n },\n\n emits: [\n /**\n * Emitted when tooltip is shown or hidden\n *\n * @event shown\n * @type {Boolean}\n */\n 'shown',\n\n /**\n * Sync show value\n *\n * @event update:show\n */\n 'update:show',\n ],\n\n data () {\n return {\n TOOLTIP_KIND_MODIFIERS,\n hasSlotContent,\n tip: null,\n\n inTimer: null,\n\n // Internal state for whether the tooltip is shown. Changing the prop\n // will update this.\n internalShow: false,\n\n // this is where the placement currently is, this can be different than\n // the placement prop when there is not enough available room for the tip\n // to display and it uses a fallback placement.\n currentPlacement: this.placement,\n };\n },\n\n computed: {\n \n tippyProps () {\n return {\n offset: this.offset,\n delay: this.delay ? TOOLTIP_DELAY_MS : false,\n placement: this.placement,\n sticky: this.sticky,\n theme: this.inverted ? 'inverted' : this.theme,\n animation: this.transition ? 'fade' : false,\n // onShown only triggers when transition is truthy\n onShown: (tooltipInstance) => this.onShow(tooltipInstance, 'onShown'),\n // onShown will always be called, but it will be called before the animation is complete\n onShow: (tooltipInstance) => this.onShow(tooltipInstance, 'onShow'),\n onHidden: this.onHide,\n\n popperOptions: getPopperOptions({\n fallbackPlacements: this.fallbackPlacements,\n hasHideModifierEnabled: true,\n onChangePlacement: this.onChangePlacement,\n }),\n };\n },\n\n anchor () {\n return this.externalAnchor ? document.body.querySelector(this.externalAnchor) : getAnchor(this.$refs.anchor);\n },\n },\n\n watch: {\n\n tippyProps: {\n handler: 'setProps',\n deep: true,\n },\n\n show: {\n handler: function (show) {\n if (show !== null && this.enabled) {\n this.internalShow = show;\n }\n },\n\n immediate: true,\n },\n\n internalShow (value) {\n if (value) {\n this.setProps();\n this.tip.show();\n } else {\n this.tip.hide();\n }\n },\n\n sticky (sticky) {\n this.tip.setProps({\n sticky,\n });\n },\n },\n\n async mounted () {\n if (!this.enabled && this.show != null) {\n console.warn('Tooltip: You cannot use both the enabled and show props at the same time.');\n console.warn('The show prop will be ignored.');\n }\n\n this.tip = createTippy(this.anchor, this.initOptions());\n if (this.externalAnchor) {\n await flushPromises();\n this.addExternalAnchorEventListeners();\n }\n warnIfUnmounted(returnFirstEl(this.$el), this.$options.name);\n },\n\n beforeUnmount () {\n this.externalAnchor && this.removeExternalAnchorEventListeners();\n\n if (this.anchor?._tippy) {\n this.tip?.destroy();\n }\n },\n\n methods: {\n calculateAnchorZindex () {\n // if a modal is currently active render at modal-element z-index, otherwise at tooltip z-index\n if (returnFirstEl(this.$el).getRootNode()\n .querySelector(\n `.d-modal[aria-hidden=\"false\"],\n .d-modal--transparent[aria-hidden=\"false\"],\n .d-modal:not([aria-hidden]),\n .d-modal--transparent:not([aria-hidden])`) ||\n // Special case because we don't have any dialtone drawer component yet. Render at 651 when\n // anchor of popover is within a drawer.\n returnFirstEl(this.$el).closest('.d-zi-drawer')) {\n return 651;\n } else {\n return 400;\n }\n },\n\n hasVisibleFocus () {\n return this.anchor.matches(':focus-visible');\n },\n\n onEnterAnchor (e) {\n if (!this.enabled) return;\n if (this.delay && this.inTimer === null) {\n this.inTimer = setTimeout(() => {\n this.triggerShow(e);\n }, TOOLTIP_DELAY_MS);\n } else {\n this.triggerShow(e);\n }\n },\n\n triggerShow (e) {\n if (e.type === 'focusin') {\n // only show tooltips on visible focus when triggered via focus.\n // when the user is using the mouse they only want tooltips to display\n // on mouseover.\n //\n // Example: anchor of a popover is a button with tooltip.\n // closing it with the mouse would trigger the tooltip to display as\n // the anchor is focused on close. Not what we want.\n if (this.show === null && this.hasVisibleFocus()) {\n this.internalShow = true;\n }\n } else {\n if (this.show === null) this.internalShow = true;\n }\n },\n\n onLeaveAnchor (e) {\n if (e.type === 'keydown' && e.code !== 'Escape') return;\n\n clearTimeout(this.inTimer);\n this.inTimer = null;\n this.triggerHide();\n },\n\n triggerHide () {\n if (this.show === null) this.internalShow = false;\n },\n\n onChangePlacement (placement) {\n this.currentPlacement = placement;\n },\n\n onHide () {\n this.tip?.unmount();\n this.$emit('shown', false);\n if (this.show !== null) {\n this.$emit('update:show', false);\n }\n },\n\n onShow (tooltipInstance, callingMethod) {\n if (!this.tooltipHasContent(tooltipInstance)) {\n return false;\n }\n if (this.transition && callingMethod === 'onShow') {\n return;\n }\n this.$emit('shown', true);\n if (this.show !== null) {\n this.$emit('update:show', true);\n }\n },\n\n setProps () {\n if (this.tip && this.tip.setProps) {\n this.tip.setProps({\n ...this.tippyProps,\n // these need to be set here rather than in tippyProps because they are non-reactive\n appendTo: this.appendTo === 'body' ? this.anchor?.getRootNode()?.querySelector('body') : this.appendTo,\n zIndex: this.calculateAnchorZindex(),\n });\n }\n },\n\n onMount () {\n this.setProps();\n },\n\n tooltipHasContent (tooltipInstance) {\n // don't show tooltip when no content\n if (tooltipInstance.props.content.textContent.trim().length === 0) {\n return false;\n }\n return true;\n },\n\n // set initial options here. If any of the options need to dynamically change, they should be put in\n // tippyProps instead.\n initOptions () {\n const template = this.$refs.content;\n return {\n content: template,\n arrow: '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"7\"><path d=\"M 14.5,7 8,0 1.5,7 Z\"/></svg>',\n // transition duration - same as our custom fade delay in dialtone-globals.less\n duration: 180,\n interactive: false,\n trigger: 'manual',\n hideOnClick: false,\n // disable tooltip from displaying on touch devices\n touch: false,\n onMount: this.onMount,\n showOnCreate: this.internalShow,\n popperOptions: getPopperOptions({\n hasHideModifierEnabled: true,\n }),\n };\n },\n\n addExternalAnchorEventListeners () {\n ['focusin', 'mouseenter'].forEach(listener => {\n this.anchor?.addEventListener(listener, (event) => this.onEnterAnchor(event));\n });\n ['focusout', 'mouseleave', 'keydown'].forEach(listener => {\n this.anchor?.addEventListener(listener, (event) => this.onLeaveAnchor(event));\n });\n },\n\n removeExternalAnchorEventListeners () {\n ['focusin', 'mouseenter'].forEach(listener => {\n this.anchor?.removeEventListener(listener, (event) => this.onEnterAnchor(event));\n });\n ['focusout', 'mouseleave', 'keydown'].forEach(listener => {\n this.anchor?.removeEventListener(listener, (event) => this.onLeaveAnchor(event));\n });\n },\n },\n};\n</script>\n"],"names":["_sfc_main","getUniqueString","placement","TOOLTIP_DIRECTIONS","sticky","TOOLTIP_STICKY_VALUES","appendTo","POPOVER_APPEND_TO_VALUES","TOOLTIP_KIND_MODIFIERS","hasSlotContent","TOOLTIP_DELAY_MS","tooltipInstance","getPopperOptions","getAnchor","show","value","createTippy","flushPromises","warnIfUnmounted","returnFirstEl","_a","_b","callingMethod","listener","event","_hoisted_1","_hoisted_2","_openBlock","_createElementBlock","$props","_createCommentVNode","$options","args","_cache","_withKeys","_renderSlot","_ctx","_createElementVNode","_normalizeClass","$data","_createTextVNode","_toDisplayString"],"mappings":"kWAiEKA,EAAU,CACb,aAAc,CAAE,KAAM,GACtB,KAAM,YAEN,MAAO,CAIL,GAAI,CACF,KAAM,OACN,SAAW,CAAE,OAAOC,EAAAA,gBAAe,CAAI,GAgBzC,mBAAoB,CAClB,KAAM,MACN,QAAS,IAAM,CAAC,MAAM,GAOxB,SAAU,CACR,KAAM,QACN,QAAS,IAcX,OAAQ,CACN,KAAM,MACN,QAAS,IAAM,CAAC,EAAG,EAAE,GAkBvB,UAAW,CACT,KAAM,OACN,QAAS,MACT,UAAWC,EAAW,CACpB,OAAOC,EAAAA,mBAAmB,SAASD,CAAS,CAC9C,GAkBF,OAAQ,CACN,KAAM,CAAC,QAAS,MAAM,EACtB,QAAS,GACT,UAAYE,GACHC,EAAAA,sBAAsB,SAASD,CAAM,GAUhD,SAAU,CACR,KAAM,CAAC,YAAa,MAAM,EAC1B,QAAS,OACT,UAAWE,GACFC,EAAAA,yBAAyB,SAASD,CAAQ,GAC5CA,aAAoB,aAS7B,aAAc,CACZ,KAAM,CAAC,OAAQ,OAAQ,KAAK,EAC5B,QAAS,IAMX,QAAS,CACP,KAAM,OACN,QAAS,IAQX,QAAS,CACP,KAAM,QACN,QAAS,IASX,KAAM,CACJ,KAAM,QACN,QAAS,MAMX,WAAY,CACV,KAAM,QACN,QAAS,IAOX,MAAO,CACL,KAAM,QACN,QAAS,IAMX,MAAO,CACL,KAAM,OACN,QAAS,MAOX,eAAgB,CACd,KAAM,OACN,QAAS,OAIb,MAAO,CAOL,QAOA,eAGF,MAAQ,CACN,MAAO,wBACLE,EAAAA,uBACA,eAAAC,EAAAA,eACA,IAAK,KAEL,QAAS,KAIT,aAAc,GAKd,iBAAkB,KAAK,UAE3B,EAEA,SAAU,CAER,YAAc,CACZ,MAAO,CACL,OAAQ,KAAK,OACb,MAAO,KAAK,MAAQC,EAAAA,iBAAmB,GAC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,cAAA,GAAAC,CAAA,GACT,+BAAUD,EAAA,eAAAA,EAAA,cAAA,GAAAC,CAAA,GACV,iCAAYD,EAAA,eAAAA,EAAA,cAAA,GAAAC,CAAA,GACZ,iCAAYD,EAAA,eAAAA,EAAA,cAAA,GAAAC,CAAA,GACZ,UAAOC,EAAA,CAAA,IAAAA,EAAA,CAAA,EAbdC,EAAAA,iBAaoBH,EAAA,eAAAA,EAAA,cAAA,GAAAC,CAAA,EAAa,CAAA,KAAA,CAAA,KAG3BG,aAEEC,EAAA,OAAA,QAAA,SAEJC,EAAAA,mBAkBM,MAAA,CAjBH,GAAIR,EAAA,GACL,IAAI,UACJ,UAAQ,aACP,MAxBPS,EAAAA,eAAA,eAwB2DC,EAAA,uBAAuB,QAAQ,EAAIV,EAAA,UAA6BA,EAAA,iBAWrHM,EAAAA,WAEOC,sBAFP,IAEO,CArCbI,EAAAA,gBAAAC,EAAAA,gBAoCWZ,EAAA,OAAO,EAAA,CAAA,GApClB,EAAA,GAAAH,CAAA"}
|
|
1
|
+
{"version":3,"file":"tooltip.cjs","sources":["../../../components/tooltip/tooltip.vue"],"sourcesContent":["<template>\n <div data-qa=\"dt-tooltip-container\">\n <!-- disabling as the below events are for capturing events from interactive\n elements within the span rather than on the span itself -->\n <!-- eslint-disable-next-line vuejs-accessibility/no-static-element-interactions -->\n <span\n v-if=\"!externalAnchor\"\n ref=\"anchor\"\n data-qa=\"dt-tooltip-anchor\"\n @focusin=\"onEnterAnchor\"\n @focusout=\"onLeaveAnchor\"\n @mouseenter=\"onEnterAnchor\"\n @mouseleave=\"onLeaveAnchor\"\n @keydown.esc=\"onLeaveAnchor\"\n >\n <!-- @slot Slot for the anchor element -->\n <slot\n name=\"anchor\"\n />\n </span>\n <div\n :id=\"id\"\n ref=\"content\"\n data-qa=\"dt-tooltip\"\n :class=\"[\n 'd-tooltip',\n {\n [ TOOLTIP_KIND_MODIFIERS.inverted ]: inverted,\n },\n contentClass,\n ]\"\n >\n <!-- In case when transitionend event doesn't work correct (for ex. tooltip component with custom trigger) -->\n <!-- after-leave event can be used instead of transitionend -->\n <!-- @slot Slot for the content, defaults to message prop -->\n <slot>\n {{ message }}\n </slot>\n </div>\n </div>\n</template>\n\n<script>\nimport {\n TOOLTIP_KIND_MODIFIERS,\n TOOLTIP_DIRECTIONS,\n TOOLTIP_STICKY_VALUES,\n TOOLTIP_DELAY_MS,\n} from './tooltip_constants.js';\nimport {\n POPOVER_APPEND_TO_VALUES,\n} from '../popover/popover_constants';\nimport { flushPromises, getUniqueString, hasSlotContent, warnIfUnmounted, returnFirstEl } from '@/common/utils';\nimport {\n createTippy,\n getAnchor,\n getPopperOptions,\n} from '@/components/popover/tippy_utils';\n\n/**\n * A tooltip is a floating label that briefly explains an action, function, or an element.\n * Its content is exclusively text and shouldn't be vital information for users.\n * If richer media is desired, consider using a popover instead.\n * @see https://dialtone.dialpad.com/components/tooltip.html\n */\nexport default {\n compatConfig: { MODE: 3 },\n name: 'DtTooltip',\n\n props: {\n /**\n * The id of the tooltip\n */\n id: {\n type: String,\n default () { return getUniqueString(); },\n },\n\n /**\n * If the popover does not fit in the direction described by \"placement\",\n * it will attempt to change its direction to the \"fallbackPlacements\"\n * if defined, otherwise it will automatically position to a new location\n * as it sees best fit. See\n * <a\n * class=\"d-link\"\n * href=\"https://popper.js.org/docs/v2/modifiers/flip/#fallbackplacements\"\n * target=\"_blank\"\n * >\n * Popper.js docs\n * </a>\n * */\n fallbackPlacements: {\n type: Array,\n default: () => ['auto'],\n },\n\n /**\n * If true, applies inverted styles to the tooltip\n * @values true, false\n */\n inverted: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Displaces the tooltip from its reference element\n * by the specified number of pixels. See\n * <a\n * class=\"d-link\"\n * href=\"https://atomiks.github.io/tippyjs/v6/all-props/#offset\"\n * target=\"_blank\"\n * >\n * Tippy.js docs\n * </a>\n */\n offset: {\n type: Array,\n default: () => [0, 12],\n },\n\n /**\n * The direction the popover displays relative to the anchor. See\n * <a\n * class=\"d-link\"\n * href=\"https://atomiks.github.io/tippyjs/v6/all-props/#placement\"\n * target=\"_blank\"\n * >\n * Tippy.js docs\n * </a>\n * @values top, top-start, top-end,\n * right, right-start, right-end,\n * left, left-start, left-end,\n * bottom, bottom-start, bottom-end,\n * auto, auto-start, auto-end\n */\n placement: {\n type: String,\n default: 'top',\n validator (placement) {\n return TOOLTIP_DIRECTIONS.includes(placement);\n },\n },\n\n /**\n * If the tooltip sticks to the anchor. This is usually not needed, but can be needed\n * if the reference element's position is animating, or to automatically update the popover\n * position in those cases the DOM layout changes the reference element's position.\n * `true` enables it, `reference` only checks the \"reference\" rect for changes and `popper` only\n * checks the \"popper\" rect for changes. See\n * <a\n * class=\"d-link\"\n * href=\"https://atomiks.github.io/tippyjs/v6/all-props/#sticky\"\n * target=\"_blank\"\n * >\n * Tippy.js docs\n * </a>\n * @values true, false, reference, popper\n */\n sticky: {\n type: [Boolean, String],\n default: true,\n validator: (sticky) => {\n return TOOLTIP_STICKY_VALUES.includes(sticky);\n },\n },\n\n /**\n * Sets the element to which the tooltip is going to append to.\n * 'body' will append to the nearest body (supports shadow DOM).\n * This prop is not reactive, must be set on initial render.\n * @values 'body', 'parent', HTMLElement,\n */\n appendTo: {\n type: [HTMLElement, String],\n default: 'body',\n validator: appendTo => {\n return POPOVER_APPEND_TO_VALUES.includes(appendTo) ||\n (appendTo instanceof HTMLElement);\n },\n },\n\n /**\n * Additional css classes for the tooltip content element.\n * Can accept all of String, Object, and Array, i.e. has the\n * same api as Vue's built-in handling of the class attribute.\n */\n contentClass: {\n type: [String, Object, Array],\n default: '',\n },\n\n /**\n * A provided message for the tooltip content\n */\n message: {\n type: String,\n default: '',\n },\n\n /**\n * Controls whether hover/focus causes the tooltip to appear.\n * Cannot be combined with the show prop. show value will be ignored.\n * by default this is true, if you override with false, the tooltip will never show up.\n */\n enabled: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Controls whether the tooltip is shown. Leaving this null will have the tooltip trigger on mouseover by default.\n * If you set this value, the default mouseover behavior will be disabled and you can control it as you need.\n * Supports .sync modifier\n * @values null, true, false\n */\n show: {\n type: Boolean,\n default: null,\n },\n\n /**\n * Whether the tooltip should have a transition effect (fade).\n */\n transition: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Whether the tooltip will have a delay when being focused or moused over.\n * @values true, false\n */\n delay: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Set a custom theme on the tooltip. See https://atomiks.github.io/tippyjs/v6/themes/\n */\n theme: {\n type: String,\n default: null,\n },\n\n /**\n * External anchor id to use in those cases the anchor can't be provided via the slot.\n * For instance, using the combobox's input as the anchor for the popover.\n */\n externalAnchor: {\n type: String,\n default: null,\n },\n },\n\n emits: [\n /**\n * Emitted when tooltip is shown or hidden\n *\n * @event shown\n * @type {Boolean}\n */\n 'shown',\n\n /**\n * Sync show value\n *\n * @event update:show\n */\n 'update:show',\n ],\n\n data () {\n return {\n TOOLTIP_KIND_MODIFIERS,\n hasSlotContent,\n tip: null,\n\n inTimer: null,\n\n // Internal state for whether the tooltip is shown. Changing the prop\n // will update this.\n internalShow: false,\n\n // this is where the placement currently is, this can be different than\n // the placement prop when there is not enough available room for the tip\n // to display and it uses a fallback placement.\n currentPlacement: this.placement,\n };\n },\n\n computed: {\n\n tippyProps () {\n return {\n offset: this.offset,\n delay: this.delay ? TOOLTIP_DELAY_MS : false,\n placement: this.placement,\n sticky: this.sticky,\n theme: this.inverted ? 'inverted' : this.theme,\n animation: this.transition ? 'fade' : false,\n // onShown only triggers when transition is truthy\n onShown: (tooltipInstance) => this.onShow(tooltipInstance, 'onShown'),\n // onShown will always be called, but it will be called before the animation is complete\n onShow: (tooltipInstance) => this.onShow(tooltipInstance, 'onShow'),\n onHidden: this.onHide,\n\n popperOptions: getPopperOptions({\n fallbackPlacements: this.fallbackPlacements,\n hasHideModifierEnabled: true,\n onChangePlacement: this.onChangePlacement,\n }),\n };\n },\n\n anchor () {\n return this.externalAnchor ? document.body.querySelector(this.externalAnchor) : getAnchor(this.$refs.anchor);\n },\n },\n\n watch: {\n\n tippyProps: {\n handler: 'setProps',\n deep: true,\n },\n\n show: {\n handler: function (show) {\n if (show !== null && this.enabled) {\n this.internalShow = show;\n }\n },\n\n immediate: true,\n },\n\n internalShow (value) {\n if (!this.tip) return;\n\n if (value) {\n this.setProps();\n this.tip.show();\n } else {\n this.tip.hide();\n }\n },\n\n sticky (sticky) {\n this.tip.setProps({\n sticky,\n });\n },\n },\n\n async mounted () {\n if (!this.enabled && this.show != null) {\n console.warn('Tooltip: You cannot use both the enabled and show props at the same time.');\n console.warn('The show prop will be ignored.');\n }\n\n this.tip = createTippy(this.anchor, this.initOptions());\n if (this.externalAnchor) {\n await flushPromises();\n this.addExternalAnchorEventListeners();\n }\n warnIfUnmounted(returnFirstEl(this.$el), this.$options.name);\n },\n\n beforeUnmount () {\n this.externalAnchor && this.removeExternalAnchorEventListeners();\n\n if (this.anchor?._tippy) {\n this.tip?.destroy();\n }\n },\n\n methods: {\n calculateAnchorZindex () {\n // if a modal is currently active render at modal-element z-index, otherwise at tooltip z-index\n if (returnFirstEl(this.$el).getRootNode()\n .querySelector(\n `.d-modal[aria-hidden=\"false\"],\n .d-modal--transparent[aria-hidden=\"false\"],\n .d-modal:not([aria-hidden]),\n .d-modal--transparent:not([aria-hidden])`) ||\n // Special case because we don't have any dialtone drawer component yet. Render at 651 when\n // anchor of popover is within a drawer.\n returnFirstEl(this.$el).closest('.d-zi-drawer')) {\n return 651;\n } else {\n return 400;\n }\n },\n\n hasVisibleFocus () {\n return this.anchor.matches(':focus-visible');\n },\n\n onEnterAnchor (e) {\n if (!this.enabled) return;\n if (this.delay && this.inTimer === null) {\n this.inTimer = setTimeout(() => {\n this.triggerShow(e);\n }, TOOLTIP_DELAY_MS);\n } else {\n this.triggerShow(e);\n }\n },\n\n triggerShow (e) {\n if (e.type === 'focusin') {\n // only show tooltips on visible focus when triggered via focus.\n // when the user is using the mouse they only want tooltips to display\n // on mouseover.\n //\n // Example: anchor of a popover is a button with tooltip.\n // closing it with the mouse would trigger the tooltip to display as\n // the anchor is focused on close. Not what we want.\n if (this.show === null && this.hasVisibleFocus()) {\n this.internalShow = true;\n }\n } else {\n if (this.show === null) this.internalShow = true;\n }\n },\n\n onLeaveAnchor (e) {\n if (e.type === 'keydown' && e.code !== 'Escape') return;\n\n clearTimeout(this.inTimer);\n this.inTimer = null;\n this.triggerHide();\n },\n\n triggerHide () {\n if (this.show === null) this.internalShow = false;\n },\n\n onChangePlacement (placement) {\n this.currentPlacement = placement;\n },\n\n onHide () {\n this.tip?.unmount();\n this.$emit('shown', false);\n if (this.show !== null) {\n this.$emit('update:show', false);\n }\n },\n\n onShow (tooltipInstance, callingMethod) {\n if (!this.tooltipHasContent(tooltipInstance)) {\n return false;\n }\n if (this.transition && callingMethod === 'onShow') {\n return;\n }\n this.$emit('shown', true);\n if (this.show !== null) {\n this.$emit('update:show', true);\n }\n },\n\n setProps () {\n if (this.tip && this.tip.setProps) {\n this.tip.setProps({\n ...this.tippyProps,\n // these need to be set here rather than in tippyProps because they are non-reactive\n appendTo: this.appendTo === 'body' ? this.anchor?.getRootNode()?.querySelector('body') : this.appendTo,\n zIndex: this.calculateAnchorZindex(),\n });\n }\n },\n\n onMount () {\n this.setProps();\n },\n\n tooltipHasContent (tooltipInstance) {\n // don't show tooltip when no content\n if (tooltipInstance.props.content.textContent.trim().length === 0) {\n return false;\n }\n return true;\n },\n\n // set initial options here. If any of the options need to dynamically change, they should be put in\n // tippyProps instead.\n initOptions () {\n const template = this.$refs.content;\n return {\n content: template,\n arrow: '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"7\"><path d=\"M 14.5,7 8,0 1.5,7 Z\"/></svg>',\n // transition duration - same as our custom fade delay in dialtone-globals.less\n duration: 180,\n interactive: false,\n trigger: 'manual',\n hideOnClick: false,\n // disable tooltip from displaying on touch devices\n touch: false,\n onMount: this.onMount,\n showOnCreate: this.internalShow,\n popperOptions: getPopperOptions({\n hasHideModifierEnabled: true,\n }),\n };\n },\n\n addExternalAnchorEventListeners () {\n ['focusin', 'mouseenter'].forEach(listener => {\n this.anchor?.addEventListener(listener, (event) => this.onEnterAnchor(event));\n });\n ['focusout', 'mouseleave', 'keydown'].forEach(listener => {\n this.anchor?.addEventListener(listener, (event) => this.onLeaveAnchor(event));\n });\n },\n\n removeExternalAnchorEventListeners () {\n ['focusin', 'mouseenter'].forEach(listener => {\n this.anchor?.removeEventListener(listener, (event) => this.onEnterAnchor(event));\n });\n ['focusout', 'mouseleave', 'keydown'].forEach(listener => {\n this.anchor?.removeEventListener(listener, (event) => this.onLeaveAnchor(event));\n });\n },\n },\n};\n</script>\n"],"names":["_sfc_main","getUniqueString","placement","TOOLTIP_DIRECTIONS","sticky","TOOLTIP_STICKY_VALUES","appendTo","POPOVER_APPEND_TO_VALUES","TOOLTIP_KIND_MODIFIERS","hasSlotContent","TOOLTIP_DELAY_MS","tooltipInstance","getPopperOptions","getAnchor","show","value","createTippy","flushPromises","warnIfUnmounted","returnFirstEl","_a","_b","callingMethod","listener","event","_hoisted_1","_hoisted_2","_openBlock","_createElementBlock","$props","_createCommentVNode","$options","args","_cache","_withKeys","_renderSlot","_ctx","_createElementVNode","_normalizeClass","$data","_createTextVNode","_toDisplayString"],"mappings":"kWAiEKA,EAAU,CACb,aAAc,CAAE,KAAM,GACtB,KAAM,YAEN,MAAO,CAIL,GAAI,CACF,KAAM,OACN,SAAW,CAAE,OAAOC,EAAAA,gBAAe,CAAI,GAgBzC,mBAAoB,CAClB,KAAM,MACN,QAAS,IAAM,CAAC,MAAM,GAOxB,SAAU,CACR,KAAM,QACN,QAAS,IAcX,OAAQ,CACN,KAAM,MACN,QAAS,IAAM,CAAC,EAAG,EAAE,GAkBvB,UAAW,CACT,KAAM,OACN,QAAS,MACT,UAAWC,EAAW,CACpB,OAAOC,EAAAA,mBAAmB,SAASD,CAAS,CAC9C,GAkBF,OAAQ,CACN,KAAM,CAAC,QAAS,MAAM,EACtB,QAAS,GACT,U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OC,sBAFP,IAEO,CArCbI,EAAAA,gBAAAC,EAAAA,gBAoCWZ,EAAA,OAAO,EAAA,CAAA,GApClB,EAAA,GAAAH,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tooltip.js","sources":["../../../components/tooltip/tooltip.vue"],"sourcesContent":["<template>\n <div data-qa=\"dt-tooltip-container\">\n <!-- disabling as the below events are for capturing events from interactive\n elements within the span rather than on the span itself -->\n <!-- eslint-disable-next-line vuejs-accessibility/no-static-element-interactions -->\n <span\n v-if=\"!externalAnchor\"\n ref=\"anchor\"\n data-qa=\"dt-tooltip-anchor\"\n @focusin=\"onEnterAnchor\"\n @focusout=\"onLeaveAnchor\"\n @mouseenter=\"onEnterAnchor\"\n @mouseleave=\"onLeaveAnchor\"\n @keydown.esc=\"onLeaveAnchor\"\n >\n <!-- @slot Slot for the anchor element -->\n <slot\n name=\"anchor\"\n />\n </span>\n <div\n :id=\"id\"\n ref=\"content\"\n data-qa=\"dt-tooltip\"\n :class=\"[\n 'd-tooltip',\n {\n [ TOOLTIP_KIND_MODIFIERS.inverted ]: inverted,\n },\n contentClass,\n ]\"\n >\n <!-- In case when transitionend event doesn't work correct (for ex. tooltip component with custom trigger) -->\n <!-- after-leave event can be used instead of transitionend -->\n <!-- @slot Slot for the content, defaults to message prop -->\n <slot>\n {{ message }}\n </slot>\n </div>\n </div>\n</template>\n\n<script>\nimport {\n TOOLTIP_KIND_MODIFIERS,\n TOOLTIP_DIRECTIONS,\n TOOLTIP_STICKY_VALUES,\n TOOLTIP_DELAY_MS,\n} from './tooltip_constants.js';\nimport {\n POPOVER_APPEND_TO_VALUES,\n} from '../popover/popover_constants';\nimport { flushPromises, getUniqueString, hasSlotContent, warnIfUnmounted, returnFirstEl } from '@/common/utils';\nimport {\n createTippy,\n getAnchor,\n getPopperOptions,\n} from '@/components/popover/tippy_utils';\n\n/**\n * A tooltip is a floating label that briefly explains an action, function, or an element.\n * Its content is exclusively text and shouldn't be vital information for users.\n * If richer media is desired, consider using a popover instead.\n * @see https://dialtone.dialpad.com/components/tooltip.html\n */\nexport default {\n compatConfig: { MODE: 3 },\n name: 'DtTooltip',\n\n props: {\n /**\n * The id of the tooltip\n */\n id: {\n type: String,\n default () { return getUniqueString(); },\n },\n\n /**\n * If the popover does not fit in the direction described by \"placement\",\n * it will attempt to change its direction to the \"fallbackPlacements\"\n * if defined, otherwise it will automatically position to a new location\n * as it sees best fit. See\n * <a\n * class=\"d-link\"\n * href=\"https://popper.js.org/docs/v2/modifiers/flip/#fallbackplacements\"\n * target=\"_blank\"\n * >\n * Popper.js docs\n * </a>\n * */\n fallbackPlacements: {\n type: Array,\n default: () => ['auto'],\n },\n\n /**\n * If true, applies inverted styles to the tooltip\n * @values true, false\n */\n inverted: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Displaces the tooltip from its reference element\n * by the specified number of pixels. See\n * <a\n * class=\"d-link\"\n * href=\"https://atomiks.github.io/tippyjs/v6/all-props/#offset\"\n * target=\"_blank\"\n * >\n * Tippy.js docs\n * </a>\n */\n offset: {\n type: Array,\n default: () => [0, 12],\n },\n\n /**\n * The direction the popover displays relative to the anchor. See\n * <a\n * class=\"d-link\"\n * href=\"https://atomiks.github.io/tippyjs/v6/all-props/#placement\"\n * target=\"_blank\"\n * >\n * Tippy.js docs\n * </a>\n * @values top, top-start, top-end,\n * right, right-start, right-end,\n * left, left-start, left-end,\n * bottom, bottom-start, bottom-end,\n * auto, auto-start, auto-end\n */\n placement: {\n type: String,\n default: 'top',\n validator (placement) {\n return TOOLTIP_DIRECTIONS.includes(placement);\n },\n },\n\n /**\n * If the tooltip sticks to the anchor. This is usually not needed, but can be needed\n * if the reference element's position is animating, or to automatically update the popover\n * position in those cases the DOM layout changes the reference element's position.\n * `true` enables it, `reference` only checks the \"reference\" rect for changes and `popper` only\n * checks the \"popper\" rect for changes. See\n * <a\n * class=\"d-link\"\n * href=\"https://atomiks.github.io/tippyjs/v6/all-props/#sticky\"\n * target=\"_blank\"\n * >\n * Tippy.js docs\n * </a>\n * @values true, false, reference, popper\n */\n sticky: {\n type: [Boolean, String],\n default: true,\n validator: (sticky) => {\n return TOOLTIP_STICKY_VALUES.includes(sticky);\n },\n },\n\n /**\n * Sets the element to which the tooltip is going to append to.\n * 'body' will append to the nearest body (supports shadow DOM).\n * This prop is not reactive, must be set on initial render.\n * @values 'body', 'parent', HTMLElement,\n */\n appendTo: {\n type: [HTMLElement, String],\n default: 'body',\n validator: appendTo => {\n return POPOVER_APPEND_TO_VALUES.includes(appendTo) ||\n (appendTo instanceof HTMLElement);\n },\n },\n\n /**\n * Additional css classes for the tooltip content element.\n * Can accept all of String, Object, and Array, i.e. has the\n * same api as Vue's built-in handling of the class attribute.\n */\n contentClass: {\n type: [String, Object, Array],\n default: '',\n },\n\n /**\n * A provided message for the tooltip content\n */\n message: {\n type: String,\n default: '',\n },\n\n /**\n * Controls whether hover/focus causes the tooltip to appear.\n * Cannot be combined with the show prop. show value will be ignored.\n * by default this is true, if you override with false, the tooltip will never show up.\n */\n enabled: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Controls whether the tooltip is shown. Leaving this null will have the tooltip trigger on mouseover by default.\n * If you set this value, the default mouseover behavior will be disabled and you can control it as you need.\n * Supports .sync modifier\n * @values null, true, false\n */\n show: {\n type: Boolean,\n default: null,\n },\n\n /**\n * Whether the tooltip should have a transition effect (fade).\n */\n transition: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Whether the tooltip will have a delay when being focused or moused over.\n * @values true, false\n */\n delay: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Set a custom theme on the tooltip. See https://atomiks.github.io/tippyjs/v6/themes/\n */\n theme: {\n type: String,\n default: null,\n },\n\n /**\n * External anchor id to use in those cases the anchor can't be provided via the slot.\n * For instance, using the combobox's input as the anchor for the popover.\n */\n externalAnchor: {\n type: String,\n default: null,\n },\n },\n\n emits: [\n /**\n * Emitted when tooltip is shown or hidden\n *\n * @event shown\n * @type {Boolean}\n */\n 'shown',\n\n /**\n * Sync show value\n *\n * @event update:show\n */\n 'update:show',\n ],\n\n data () {\n return {\n TOOLTIP_KIND_MODIFIERS,\n hasSlotContent,\n tip: null,\n\n inTimer: null,\n\n // Internal state for whether the tooltip is shown. Changing the prop\n // will update this.\n internalShow: false,\n\n // this is where the placement currently is, this can be different than\n // the placement prop when there is not enough available room for the tip\n // to display and it uses a fallback placement.\n currentPlacement: this.placement,\n };\n },\n\n computed: {\n \n tippyProps () {\n return {\n offset: this.offset,\n delay: this.delay ? TOOLTIP_DELAY_MS : false,\n placement: this.placement,\n sticky: this.sticky,\n theme: this.inverted ? 'inverted' : this.theme,\n animation: this.transition ? 'fade' : false,\n // onShown only triggers when transition is truthy\n onShown: (tooltipInstance) => this.onShow(tooltipInstance, 'onShown'),\n // onShown will always be called, but it will be called before the animation is complete\n onShow: (tooltipInstance) => this.onShow(tooltipInstance, 'onShow'),\n onHidden: this.onHide,\n\n popperOptions: getPopperOptions({\n fallbackPlacements: this.fallbackPlacements,\n hasHideModifierEnabled: true,\n onChangePlacement: this.onChangePlacement,\n }),\n };\n },\n\n anchor () {\n return this.externalAnchor ? document.body.querySelector(this.externalAnchor) : getAnchor(this.$refs.anchor);\n },\n },\n\n watch: {\n\n tippyProps: {\n handler: 'setProps',\n deep: true,\n },\n\n show: {\n handler: function (show) {\n if (show !== null && this.enabled) {\n this.internalShow = show;\n }\n },\n\n immediate: true,\n },\n\n internalShow (value) {\n if (value) {\n this.setProps();\n this.tip.show();\n } else {\n this.tip.hide();\n }\n },\n\n sticky (sticky) {\n this.tip.setProps({\n sticky,\n });\n },\n },\n\n async mounted () {\n if (!this.enabled && this.show != null) {\n console.warn('Tooltip: You cannot use both the enabled and show props at the same time.');\n console.warn('The show prop will be ignored.');\n }\n\n this.tip = createTippy(this.anchor, this.initOptions());\n if (this.externalAnchor) {\n await flushPromises();\n this.addExternalAnchorEventListeners();\n }\n warnIfUnmounted(returnFirstEl(this.$el), this.$options.name);\n },\n\n beforeUnmount () {\n this.externalAnchor && this.removeExternalAnchorEventListeners();\n\n if (this.anchor?._tippy) {\n this.tip?.destroy();\n }\n },\n\n methods: {\n calculateAnchorZindex () {\n // if a modal is currently active render at modal-element z-index, otherwise at tooltip z-index\n if (returnFirstEl(this.$el).getRootNode()\n .querySelector(\n `.d-modal[aria-hidden=\"false\"],\n .d-modal--transparent[aria-hidden=\"false\"],\n .d-modal:not([aria-hidden]),\n .d-modal--transparent:not([aria-hidden])`) ||\n // Special case because we don't have any dialtone drawer component yet. Render at 651 when\n // anchor of popover is within a drawer.\n returnFirstEl(this.$el).closest('.d-zi-drawer')) {\n return 651;\n } else {\n return 400;\n }\n },\n\n hasVisibleFocus () {\n return this.anchor.matches(':focus-visible');\n },\n\n onEnterAnchor (e) {\n if (!this.enabled) return;\n if (this.delay && this.inTimer === null) {\n this.inTimer = setTimeout(() => {\n this.triggerShow(e);\n }, TOOLTIP_DELAY_MS);\n } else {\n this.triggerShow(e);\n }\n },\n\n triggerShow (e) {\n if (e.type === 'focusin') {\n // only show tooltips on visible focus when triggered via focus.\n // when the user is using the mouse they only want tooltips to display\n // on mouseover.\n //\n // Example: anchor of a popover is a button with tooltip.\n // closing it with the mouse would trigger the tooltip to display as\n // the anchor is focused on close. Not what we want.\n if (this.show === null && this.hasVisibleFocus()) {\n this.internalShow = true;\n }\n } else {\n if (this.show === null) this.internalShow = true;\n }\n },\n\n onLeaveAnchor (e) {\n if (e.type === 'keydown' && e.code !== 'Escape') return;\n\n clearTimeout(this.inTimer);\n this.inTimer = null;\n this.triggerHide();\n },\n\n triggerHide () {\n if (this.show === null) this.internalShow = false;\n },\n\n onChangePlacement (placement) {\n this.currentPlacement = placement;\n },\n\n onHide () {\n this.tip?.unmount();\n this.$emit('shown', false);\n if (this.show !== null) {\n this.$emit('update:show', false);\n }\n },\n\n onShow (tooltipInstance, callingMethod) {\n if (!this.tooltipHasContent(tooltipInstance)) {\n return false;\n }\n if (this.transition && callingMethod === 'onShow') {\n return;\n }\n this.$emit('shown', true);\n if (this.show !== null) {\n this.$emit('update:show', true);\n }\n },\n\n setProps () {\n if (this.tip && this.tip.setProps) {\n this.tip.setProps({\n ...this.tippyProps,\n // these need to be set here rather than in tippyProps because they are non-reactive\n appendTo: this.appendTo === 'body' ? this.anchor?.getRootNode()?.querySelector('body') : this.appendTo,\n zIndex: this.calculateAnchorZindex(),\n });\n }\n },\n\n onMount () {\n this.setProps();\n },\n\n tooltipHasContent (tooltipInstance) {\n // don't show tooltip when no content\n if (tooltipInstance.props.content.textContent.trim().length === 0) {\n return false;\n }\n return true;\n },\n\n // set initial options here. If any of the options need to dynamically change, they should be put in\n // tippyProps instead.\n initOptions () {\n const template = this.$refs.content;\n return {\n content: template,\n arrow: '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"7\"><path d=\"M 14.5,7 8,0 1.5,7 Z\"/></svg>',\n // transition duration - same as our custom fade delay in dialtone-globals.less\n duration: 180,\n interactive: false,\n trigger: 'manual',\n hideOnClick: false,\n // disable tooltip from displaying on touch devices\n touch: false,\n onMount: this.onMount,\n showOnCreate: this.internalShow,\n popperOptions: getPopperOptions({\n hasHideModifierEnabled: true,\n }),\n };\n },\n\n addExternalAnchorEventListeners () {\n ['focusin', 'mouseenter'].forEach(listener => {\n this.anchor?.addEventListener(listener, (event) => this.onEnterAnchor(event));\n });\n ['focusout', 'mouseleave', 'keydown'].forEach(listener => {\n this.anchor?.addEventListener(listener, (event) => this.onLeaveAnchor(event));\n });\n },\n\n removeExternalAnchorEventListeners () {\n ['focusin', 'mouseenter'].forEach(listener => {\n this.anchor?.removeEventListener(listener, (event) => this.onEnterAnchor(event));\n });\n ['focusout', 'mouseleave', 'keydown'].forEach(listener => {\n this.anchor?.removeEventListener(listener, (event) => this.onLeaveAnchor(event));\n });\n },\n },\n};\n</script>\n"],"names":["_sfc_main","getUniqueString","placement","TOOLTIP_DIRECTIONS","sticky","TOOLTIP_STICKY_VALUES","appendTo","POPOVER_APPEND_TO_VALUES","TOOLTIP_KIND_MODIFIERS","hasSlotContent","TOOLTIP_DELAY_MS","tooltipInstance","getPopperOptions","getAnchor","show","value","createTippy","flushPromises","warnIfUnmounted","returnFirstEl","_a","_b","callingMethod","listener","event","_hoisted_1","_hoisted_2","_openBlock","_createElementBlock","$props","_createCommentVNode","$options","args","_cache","_withKeys","_renderSlot","_ctx","_createElementVNode","_normalizeClass","$data","_createTextVNode","_toDisplayString"],"mappings":";;;;;;AAiEA,MAAKA,IAAU;AAAA,EACb,cAAc,EAAE,MAAM;EACtB,MAAM;AAAA,EAEN,OAAO;AAAA;AAAA;AAAA;AAAA,IAIL,IAAI;AAAA,MACF,MAAM;AAAA,MACN,UAAW;AAAE,eAAOC,EAAe;AAAA,MAAI;AAAA;;;;;;;;;;;;;;IAgBzC,oBAAoB;AAAA,MAClB,MAAM;AAAA,MACN,SAAS,MAAM,CAAC,MAAM;AAAA;;;;;IAOxB,UAAU;AAAA,MACR,MAAM;AAAA,MACN,SAAS;AAAA;;;;;;;;;;;;IAcX,QAAQ;AAAA,MACN,MAAM;AAAA,MACN,SAAS,MAAM,CAAC,GAAG,EAAE;AAAA;;;;;;;;;;;;;;;;IAkBvB,WAAW;AAAA,MACT,MAAM;AAAA,MACN,SAAS;AAAA,MACT,UAAWC,GAAW;AACpB,eAAOC,EAAmB,SAASD,CAAS;AAAA,MAC9C;AAAA;;;;;;;;;;;;;;;;IAkBF,QAAQ;AAAA,MACN,MAAM,CAAC,SAAS,MAAM;AAAA,MACtB,SAAS;AAAA,MACT,WAAW,CAACE,MACHC,EAAsB,SAASD,CAAM;AAAA;;;;;;;IAUhD,UAAU;AAAA,MACR,MAAM,CAAC,aAAa,MAAM;AAAA,MAC1B,SAAS;AAAA,MACT,WAAW,CAAAE,MACFC,EAAyB,SAASD,CAAQ,KAC5CA,aAAoB;AAAA;;;;;;IAS7B,cAAc;AAAA,MACZ,MAAM,CAAC,QAAQ,QAAQ,KAAK;AAAA,MAC5B,SAAS;AAAA;;;;IAMX,SAAS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,uBAAsB,GADrCC,IAAA,CAAA,IAAA;;AACE,SAAAC,EAAA,GAAAC,EAsCM,OAtCNH,GAsCM;AAAA,IAjCKI,EAAA,iBANbC,EAAA,IAAA,EAAA,UAKIF,EAcO,QAAA;AAAA,MAnBX,KAAA;AAAA,MAOM,KAAI;AAAA,MACJ,WAAQ;AAAA,MACP,qCAASG,EAAA,iBAAAA,EAAA,cAAA,GAAAC,CAAA;AAAA,MACT,sCAAUD,EAAA,iBAAAA,EAAA,cAAA,GAAAC,CAAA;AAAA,MACV,wCAAYD,EAAA,iBAAAA,EAAA,cAAA,GAAAC,CAAA;AAAA,MACZ,wCAAYD,EAAA,iBAAAA,EAAA,cAAA,GAAAC,CAAA;AAAA,MACZ,WAAOC,EAAA,CAAA,MAAAA,EAAA,CAAA,IAbdC,YAaoBH,EAAA,iBAAAA,EAAA,cAAA,GAAAC,CAAA,GAAa,CAAA,KAAA,CAAA;AAAA;MAG3BG,EAEEC,EAAA,QAAA,QAAA;AAAA;IAEJC,EAkBM,OAAA;AAAA,MAjBH,IAAIR,EAAA;AAAA,MACL,KAAI;AAAA,MACJ,WAAQ;AAAA,MACP,OAxBPS,EAAA;AAAA;;WAwB2DC,EAAA,uBAAuB,QAAQ,GAAIV,EAAA;AAAA;QAA6BA,EAAA;AAAA;;MAWrHM,EAEOC,yBAFP,MAEO;AAAA,QArCbI,EAAAC,EAoCWZ,EAAA,OAAO,GAAA,CAAA;AAAA;IApClB,GAAA,IAAAH,CAAA;AAAA;;;"}
|
|
1
|
+
{"version":3,"file":"tooltip.js","sources":["../../../components/tooltip/tooltip.vue"],"sourcesContent":["<template>\n <div data-qa=\"dt-tooltip-container\">\n <!-- disabling as the below events are for capturing events from interactive\n elements within the span rather than on the span itself -->\n <!-- eslint-disable-next-line vuejs-accessibility/no-static-element-interactions -->\n <span\n v-if=\"!externalAnchor\"\n ref=\"anchor\"\n data-qa=\"dt-tooltip-anchor\"\n @focusin=\"onEnterAnchor\"\n @focusout=\"onLeaveAnchor\"\n @mouseenter=\"onEnterAnchor\"\n @mouseleave=\"onLeaveAnchor\"\n @keydown.esc=\"onLeaveAnchor\"\n >\n <!-- @slot Slot for the anchor element -->\n <slot\n name=\"anchor\"\n />\n </span>\n <div\n :id=\"id\"\n ref=\"content\"\n data-qa=\"dt-tooltip\"\n :class=\"[\n 'd-tooltip',\n {\n [ TOOLTIP_KIND_MODIFIERS.inverted ]: inverted,\n },\n contentClass,\n ]\"\n >\n <!-- In case when transitionend event doesn't work correct (for ex. tooltip component with custom trigger) -->\n <!-- after-leave event can be used instead of transitionend -->\n <!-- @slot Slot for the content, defaults to message prop -->\n <slot>\n {{ message }}\n </slot>\n </div>\n </div>\n</template>\n\n<script>\nimport {\n TOOLTIP_KIND_MODIFIERS,\n TOOLTIP_DIRECTIONS,\n TOOLTIP_STICKY_VALUES,\n TOOLTIP_DELAY_MS,\n} from './tooltip_constants.js';\nimport {\n POPOVER_APPEND_TO_VALUES,\n} from '../popover/popover_constants';\nimport { flushPromises, getUniqueString, hasSlotContent, warnIfUnmounted, returnFirstEl } from '@/common/utils';\nimport {\n createTippy,\n getAnchor,\n getPopperOptions,\n} from '@/components/popover/tippy_utils';\n\n/**\n * A tooltip is a floating label that briefly explains an action, function, or an element.\n * Its content is exclusively text and shouldn't be vital information for users.\n * If richer media is desired, consider using a popover instead.\n * @see https://dialtone.dialpad.com/components/tooltip.html\n */\nexport default {\n compatConfig: { MODE: 3 },\n name: 'DtTooltip',\n\n props: {\n /**\n * The id of the tooltip\n */\n id: {\n type: String,\n default () { return getUniqueString(); },\n },\n\n /**\n * If the popover does not fit in the direction described by \"placement\",\n * it will attempt to change its direction to the \"fallbackPlacements\"\n * if defined, otherwise it will automatically position to a new location\n * as it sees best fit. See\n * <a\n * class=\"d-link\"\n * href=\"https://popper.js.org/docs/v2/modifiers/flip/#fallbackplacements\"\n * target=\"_blank\"\n * >\n * Popper.js docs\n * </a>\n * */\n fallbackPlacements: {\n type: Array,\n default: () => ['auto'],\n },\n\n /**\n * If true, applies inverted styles to the tooltip\n * @values true, false\n */\n inverted: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Displaces the tooltip from its reference element\n * by the specified number of pixels. See\n * <a\n * class=\"d-link\"\n * href=\"https://atomiks.github.io/tippyjs/v6/all-props/#offset\"\n * target=\"_blank\"\n * >\n * Tippy.js docs\n * </a>\n */\n offset: {\n type: Array,\n default: () => [0, 12],\n },\n\n /**\n * The direction the popover displays relative to the anchor. See\n * <a\n * class=\"d-link\"\n * href=\"https://atomiks.github.io/tippyjs/v6/all-props/#placement\"\n * target=\"_blank\"\n * >\n * Tippy.js docs\n * </a>\n * @values top, top-start, top-end,\n * right, right-start, right-end,\n * left, left-start, left-end,\n * bottom, bottom-start, bottom-end,\n * auto, auto-start, auto-end\n */\n placement: {\n type: String,\n default: 'top',\n validator (placement) {\n return TOOLTIP_DIRECTIONS.includes(placement);\n },\n },\n\n /**\n * If the tooltip sticks to the anchor. This is usually not needed, but can be needed\n * if the reference element's position is animating, or to automatically update the popover\n * position in those cases the DOM layout changes the reference element's position.\n * `true` enables it, `reference` only checks the \"reference\" rect for changes and `popper` only\n * checks the \"popper\" rect for changes. See\n * <a\n * class=\"d-link\"\n * href=\"https://atomiks.github.io/tippyjs/v6/all-props/#sticky\"\n * target=\"_blank\"\n * >\n * Tippy.js docs\n * </a>\n * @values true, false, reference, popper\n */\n sticky: {\n type: [Boolean, String],\n default: true,\n validator: (sticky) => {\n return TOOLTIP_STICKY_VALUES.includes(sticky);\n },\n },\n\n /**\n * Sets the element to which the tooltip is going to append to.\n * 'body' will append to the nearest body (supports shadow DOM).\n * This prop is not reactive, must be set on initial render.\n * @values 'body', 'parent', HTMLElement,\n */\n appendTo: {\n type: [HTMLElement, String],\n default: 'body',\n validator: appendTo => {\n return POPOVER_APPEND_TO_VALUES.includes(appendTo) ||\n (appendTo instanceof HTMLElement);\n },\n },\n\n /**\n * Additional css classes for the tooltip content element.\n * Can accept all of String, Object, and Array, i.e. has the\n * same api as Vue's built-in handling of the class attribute.\n */\n contentClass: {\n type: [String, Object, Array],\n default: '',\n },\n\n /**\n * A provided message for the tooltip content\n */\n message: {\n type: String,\n default: '',\n },\n\n /**\n * Controls whether hover/focus causes the tooltip to appear.\n * Cannot be combined with the show prop. show value will be ignored.\n * by default this is true, if you override with false, the tooltip will never show up.\n */\n enabled: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Controls whether the tooltip is shown. Leaving this null will have the tooltip trigger on mouseover by default.\n * If you set this value, the default mouseover behavior will be disabled and you can control it as you need.\n * Supports .sync modifier\n * @values null, true, false\n */\n show: {\n type: Boolean,\n default: null,\n },\n\n /**\n * Whether the tooltip should have a transition effect (fade).\n */\n transition: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Whether the tooltip will have a delay when being focused or moused over.\n * @values true, false\n */\n delay: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Set a custom theme on the tooltip. See https://atomiks.github.io/tippyjs/v6/themes/\n */\n theme: {\n type: String,\n default: null,\n },\n\n /**\n * External anchor id to use in those cases the anchor can't be provided via the slot.\n * For instance, using the combobox's input as the anchor for the popover.\n */\n externalAnchor: {\n type: String,\n default: null,\n },\n },\n\n emits: [\n /**\n * Emitted when tooltip is shown or hidden\n *\n * @event shown\n * @type {Boolean}\n */\n 'shown',\n\n /**\n * Sync show value\n *\n * @event update:show\n */\n 'update:show',\n ],\n\n data () {\n return {\n TOOLTIP_KIND_MODIFIERS,\n hasSlotContent,\n tip: null,\n\n inTimer: null,\n\n // Internal state for whether the tooltip is shown. Changing the prop\n // will update this.\n internalShow: false,\n\n // this is where the placement currently is, this can be different than\n // the placement prop when there is not enough available room for the tip\n // to display and it uses a fallback placement.\n currentPlacement: this.placement,\n };\n },\n\n computed: {\n\n tippyProps () {\n return {\n offset: this.offset,\n delay: this.delay ? TOOLTIP_DELAY_MS : false,\n placement: this.placement,\n sticky: this.sticky,\n theme: this.inverted ? 'inverted' : this.theme,\n animation: this.transition ? 'fade' : false,\n // onShown only triggers when transition is truthy\n onShown: (tooltipInstance) => this.onShow(tooltipInstance, 'onShown'),\n // onShown will always be called, but it will be called before the animation is complete\n onShow: (tooltipInstance) => this.onShow(tooltipInstance, 'onShow'),\n onHidden: this.onHide,\n\n popperOptions: getPopperOptions({\n fallbackPlacements: this.fallbackPlacements,\n hasHideModifierEnabled: true,\n onChangePlacement: this.onChangePlacement,\n }),\n };\n },\n\n anchor () {\n return this.externalAnchor ? document.body.querySelector(this.externalAnchor) : getAnchor(this.$refs.anchor);\n },\n },\n\n watch: {\n\n tippyProps: {\n handler: 'setProps',\n deep: true,\n },\n\n show: {\n handler: function (show) {\n if (show !== null && this.enabled) {\n this.internalShow = show;\n }\n },\n\n immediate: true,\n },\n\n internalShow (value) {\n if (!this.tip) return;\n\n if (value) {\n this.setProps();\n this.tip.show();\n } else {\n this.tip.hide();\n }\n },\n\n sticky (sticky) {\n this.tip.setProps({\n sticky,\n });\n },\n },\n\n async mounted () {\n if (!this.enabled && this.show != null) {\n console.warn('Tooltip: You cannot use both the enabled and show props at the same time.');\n console.warn('The show prop will be ignored.');\n }\n\n this.tip = createTippy(this.anchor, this.initOptions());\n if (this.externalAnchor) {\n await flushPromises();\n this.addExternalAnchorEventListeners();\n }\n warnIfUnmounted(returnFirstEl(this.$el), this.$options.name);\n },\n\n beforeUnmount () {\n this.externalAnchor && this.removeExternalAnchorEventListeners();\n\n if (this.anchor?._tippy) {\n this.tip?.destroy();\n }\n },\n\n methods: {\n calculateAnchorZindex () {\n // if a modal is currently active render at modal-element z-index, otherwise at tooltip z-index\n if (returnFirstEl(this.$el).getRootNode()\n .querySelector(\n `.d-modal[aria-hidden=\"false\"],\n .d-modal--transparent[aria-hidden=\"false\"],\n .d-modal:not([aria-hidden]),\n .d-modal--transparent:not([aria-hidden])`) ||\n // Special case because we don't have any dialtone drawer component yet. Render at 651 when\n // anchor of popover is within a drawer.\n returnFirstEl(this.$el).closest('.d-zi-drawer')) {\n return 651;\n } else {\n return 400;\n }\n },\n\n hasVisibleFocus () {\n return this.anchor.matches(':focus-visible');\n },\n\n onEnterAnchor (e) {\n if (!this.enabled) return;\n if (this.delay && this.inTimer === null) {\n this.inTimer = setTimeout(() => {\n this.triggerShow(e);\n }, TOOLTIP_DELAY_MS);\n } else {\n this.triggerShow(e);\n }\n },\n\n triggerShow (e) {\n if (e.type === 'focusin') {\n // only show tooltips on visible focus when triggered via focus.\n // when the user is using the mouse they only want tooltips to display\n // on mouseover.\n //\n // Example: anchor of a popover is a button with tooltip.\n // closing it with the mouse would trigger the tooltip to display as\n // the anchor is focused on close. Not what we want.\n if (this.show === null && this.hasVisibleFocus()) {\n this.internalShow = true;\n }\n } else {\n if (this.show === null) this.internalShow = true;\n }\n },\n\n onLeaveAnchor (e) {\n if (e.type === 'keydown' && e.code !== 'Escape') return;\n\n clearTimeout(this.inTimer);\n this.inTimer = null;\n this.triggerHide();\n },\n\n triggerHide () {\n if (this.show === null) this.internalShow = false;\n },\n\n onChangePlacement (placement) {\n this.currentPlacement = placement;\n },\n\n onHide () {\n this.tip?.unmount();\n this.$emit('shown', false);\n if (this.show !== null) {\n this.$emit('update:show', false);\n }\n },\n\n onShow (tooltipInstance, callingMethod) {\n if (!this.tooltipHasContent(tooltipInstance)) {\n return false;\n }\n if (this.transition && callingMethod === 'onShow') {\n return;\n }\n this.$emit('shown', true);\n if (this.show !== null) {\n this.$emit('update:show', true);\n }\n },\n\n setProps () {\n if (this.tip && this.tip.setProps) {\n this.tip.setProps({\n ...this.tippyProps,\n // these need to be set here rather than in tippyProps because they are non-reactive\n appendTo: this.appendTo === 'body' ? this.anchor?.getRootNode()?.querySelector('body') : this.appendTo,\n zIndex: this.calculateAnchorZindex(),\n });\n }\n },\n\n onMount () {\n this.setProps();\n },\n\n tooltipHasContent (tooltipInstance) {\n // don't show tooltip when no content\n if (tooltipInstance.props.content.textContent.trim().length === 0) {\n return false;\n }\n return true;\n },\n\n // set initial options here. If any of the options need to dynamically change, they should be put in\n // tippyProps instead.\n initOptions () {\n const template = this.$refs.content;\n return {\n content: template,\n arrow: '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"7\"><path d=\"M 14.5,7 8,0 1.5,7 Z\"/></svg>',\n // transition duration - same as our custom fade delay in dialtone-globals.less\n duration: 180,\n interactive: false,\n trigger: 'manual',\n hideOnClick: false,\n // disable tooltip from displaying on touch devices\n touch: false,\n onMount: this.onMount,\n showOnCreate: this.internalShow,\n popperOptions: getPopperOptions({\n hasHideModifierEnabled: true,\n }),\n };\n },\n\n addExternalAnchorEventListeners () {\n ['focusin', 'mouseenter'].forEach(listener => {\n this.anchor?.addEventListener(listener, (event) => this.onEnterAnchor(event));\n });\n ['focusout', 'mouseleave', 'keydown'].forEach(listener => {\n this.anchor?.addEventListener(listener, (event) => this.onLeaveAnchor(event));\n });\n },\n\n removeExternalAnchorEventListeners () {\n ['focusin', 'mouseenter'].forEach(listener => {\n this.anchor?.removeEventListener(listener, (event) => this.onEnterAnchor(event));\n });\n ['focusout', 'mouseleave', 'keydown'].forEach(listener => {\n this.anchor?.removeEventListener(listener, (event) => this.onLeaveAnchor(event));\n });\n },\n },\n};\n</script>\n"],"names":["_sfc_main","getUniqueString","placement","TOOLTIP_DIRECTIONS","sticky","TOOLTIP_STICKY_VALUES","appendTo","POPOVER_APPEND_TO_VALUES","TOOLTIP_KIND_MODIFIERS","hasSlotContent","TOOLTIP_DELAY_MS","tooltipInstance","getPopperOptions","getAnchor","show","value","createTippy","flushPromises","warnIfUnmounted","returnFirstEl","_a","_b","callingMethod","listener","event","_hoisted_1","_hoisted_2","_openBlock","_createElementBlock","$props","_createCommentVNode","$options","args","_cache","_withKeys","_renderSlot","_ctx","_createElementVNode","_normalizeClass","$data","_createTextVNode","_toDisplayString"],"mappings":";;;;;;AAiEA,MAAKA,IAAU;AAAA,EACb,cAAc,EAAE,MAAM;EACtB,MAAM;AAAA,EAEN,OAAO;AAAA;AAAA;AAAA;AAAA,IAIL,IAAI;AAAA,MACF,MAAM;AAAA,M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EAAA,iBAAAA,EAAA,cAAA,GAAAC,CAAA;AAAA,MACZ,WAAOC,EAAA,CAAA,MAAAA,EAAA,CAAA,IAbdC,YAaoBH,EAAA,iBAAAA,EAAA,cAAA,GAAAC,CAAA,GAAa,CAAA,KAAA,CAAA;AAAA;MAG3BG,EAEEC,EAAA,QAAA,QAAA;AAAA;IAEJC,EAkBM,OAAA;AAAA,MAjBH,IAAIR,EAAA;AAAA,MACL,KAAI;AAAA,MACJ,WAAQ;AAAA,MACP,OAxBPS,EAAA;AAAA;;WAwB2DC,EAAA,uBAAuB,QAAQ,GAAIV,EAAA;AAAA;QAA6BA,EAAA;AAAA;;MAWrHM,EAEOC,yBAFP,MAEO;AAAA,QArCbI,EAAAC,EAoCWZ,EAAA,OAAO,GAAA,CAAA;AAAA;IApClB,GAAA,IAAAH,CAAA;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 f=require("../../common/utils/index.cjs"),a=require("vue"),c=require("../tooltip/tooltip.cjs"),m=require("../tooltip/tooltip-constants.cjs"),p={name:"dt-tooltip-directive",install(v){let r;const s=document.createElement("div");document.body.appendChild(s);const u="top",d=a.createApp({name:"DtTooltipDirectiveApp",components:{DtTooltip:c.default},data(){return{tooltips:[]}},created(){r=a.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 a.h("div",this.tooltips.map(({id:e,...t})=>a.h(c.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}"]`})))}});d.mount(s),v.directive("dt-tooltip",{beforeMount(e,t){n(e,t)},updated(e,t){t.value!==t.oldValue&&n(e,t)},unmounted(e){r.ctx.removeTooltip(e.getAttribute("data-dt-tooltip-id"))}});function n(e,t){if(t.value===null||t.value===void 0){const l=e.getAttribute("data-dt-tooltip-id");l&&d.removeTooltip(l);return}const i=e.getAttribute("data-dt-tooltip-id")||f.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),r.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';\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 if (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 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
|
|
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';\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 if (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 DtTooltipDirectiveApp.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","DtTooltipDirectiveApp","createApp","DtTooltip","getCurrentInstance","id","tooltipConfig","index","tooltip","h","tooltipProps","anchor","binding","setupTooltip","tooltipId","getUniqueString","modifier","TOOLTIP_DIRECTIONS"],"mappings":"+PAIaA,EAAqB,CAChC,KAAM,uBACN,QAASC,EAAK,CACZ,IAAIC,EACJ,MAAMC,EAAa,SAAS,cAAc,KAAK,EAC/C,SAAS,KAAK,YAAYA,CAAU,EAEpC,MAAMC,EAAoB,MACpBC,EAAwBC,EAAAA,UAAU,CACtC,KAAM,wBACN,WAAY,CAAA,UAAEC,EAAAA,OAAS,EACvB,MAAQ,CACN,MAAO,CACL,SAAU,CAAA,CACpB,CACM,EAEA,SAAW,CACTL,EAAkBM,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,EAA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,EAAgB,CACd,UAAWM,EAAQ,KAAOA,EAAQ,MAAM,WAAaZ,EACrD,GAAGY,EAAQ,KACrB,MACa,CACL,QAAQ,MAAM,6EAA6E,EAC3F,MACF,CAEA,OAAO,KAAKA,EAAQ,SAAS,EAAE,QAAQI,GAAY,CACjD,OAAQA,EAAQ,CACd,IAAK,WACHV,EAAc,SAAW,GACzB,MACF,IAAK,WACHA,EAAc,MAAQ,GACtB,MACF,IAAK,gBACHA,EAAc,WAAa,GAC3B,MACF,QACMW,EAAAA,mBAAmB,SAASD,CAAQ,IACtCV,EAAc,UAAYU,GAE5B,KACZ,CACM,CAAC,EAEDL,EAAO,aAAa,qBAAsBG,CAAS,EACnDhB,EAAgB,IAAI,mBAAmBgB,EAAWR,CAAa,CACjE,CACF,CACF"}
|
|
@@ -1,17 +1,16 @@
|
|
|
1
|
-
import { getUniqueString as
|
|
2
|
-
import { createApp as
|
|
3
|
-
import
|
|
4
|
-
import { TOOLTIP_DIRECTIONS as
|
|
1
|
+
import { getUniqueString as m } from "../../common/utils/index.js";
|
|
2
|
+
import { createApp as f, h as n, getCurrentInstance as v } from "vue";
|
|
3
|
+
import u from "../tooltip/tooltip.js";
|
|
4
|
+
import { TOOLTIP_DIRECTIONS as T } from "../tooltip/tooltip-constants.js";
|
|
5
5
|
const k = {
|
|
6
6
|
name: "dt-tooltip-directive",
|
|
7
|
-
install(
|
|
7
|
+
install(c) {
|
|
8
8
|
let a;
|
|
9
9
|
const r = document.createElement("div");
|
|
10
10
|
document.body.appendChild(r);
|
|
11
|
-
const s = "top"
|
|
12
|
-
m({
|
|
11
|
+
const s = "top", d = f({
|
|
13
12
|
name: "DtTooltipDirectiveApp",
|
|
14
|
-
components: { DtTooltip:
|
|
13
|
+
components: { DtTooltip: u },
|
|
15
14
|
data() {
|
|
16
15
|
return {
|
|
17
16
|
tooltips: []
|
|
@@ -30,9 +29,9 @@ const k = {
|
|
|
30
29
|
}
|
|
31
30
|
},
|
|
32
31
|
render() {
|
|
33
|
-
return
|
|
32
|
+
return n(
|
|
34
33
|
"div",
|
|
35
|
-
this.tooltips.map(({ id: e, ...t }) =>
|
|
34
|
+
this.tooltips.map(({ id: e, ...t }) => n(u, {
|
|
36
35
|
key: e,
|
|
37
36
|
...t,
|
|
38
37
|
sticky: t.sticky !== void 0 ? t.sticky : !0,
|
|
@@ -44,7 +43,8 @@ const k = {
|
|
|
44
43
|
}))
|
|
45
44
|
);
|
|
46
45
|
}
|
|
47
|
-
})
|
|
46
|
+
});
|
|
47
|
+
d.mount(r), c.directive("dt-tooltip", {
|
|
48
48
|
beforeMount(e, t) {
|
|
49
49
|
p(e, t);
|
|
50
50
|
},
|
|
@@ -56,7 +56,12 @@ const k = {
|
|
|
56
56
|
}
|
|
57
57
|
});
|
|
58
58
|
function p(e, t) {
|
|
59
|
-
|
|
59
|
+
if (t.value === null || t.value === void 0) {
|
|
60
|
+
const l = e.getAttribute("data-dt-tooltip-id");
|
|
61
|
+
l && d.removeTooltip(l);
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
const i = e.getAttribute("data-dt-tooltip-id") || m();
|
|
60
65
|
let o;
|
|
61
66
|
if (typeof t.value == "string")
|
|
62
67
|
o = {
|
|
@@ -69,7 +74,7 @@ const k = {
|
|
|
69
74
|
...t.value
|
|
70
75
|
};
|
|
71
76
|
else {
|
|
72
|
-
console.error("DtTooltipDirective: binding value must be
|
|
77
|
+
console.error("DtTooltipDirective: binding value must be string, object, null or undefined");
|
|
73
78
|
return;
|
|
74
79
|
}
|
|
75
80
|
Object.keys(t.modifiers).forEach((l) => {
|
|
@@ -84,7 +89,7 @@ const k = {
|
|
|
84
89
|
o.transition = !1;
|
|
85
90
|
break;
|
|
86
91
|
default:
|
|
87
|
-
|
|
92
|
+
T.includes(l) && (o.placement = l);
|
|
88
93
|
break;
|
|
89
94
|
}
|
|
90
95
|
}), 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';\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 if (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 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
|
|
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';\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 if (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 DtTooltipDirectiveApp.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","DtTooltipDirectiveApp","createApp","DtTooltip","getCurrentInstance","id","tooltipConfig","index","tooltip","h","tooltipProps","an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B,SAASD,CAAQ,MACtCV,EAAc,YAAYU;AAE5B;AAAA,QACZ;AAAA,MACM,CAAC,GAEDL,EAAO,aAAa,sBAAsBG,CAAS,GACnDhB,EAAgB,IAAI,mBAAmBgB,GAAWR,CAAa;AAAA,IACjE;AAAA,EACF;AACF;"}
|
|
@@ -157,5 +157,7 @@ STORYBOOK_LANGUAGE_RUSSIAN = ロシア語
|
|
|
157
157
|
STORYBOOK_LANGUAGE_SPANISH = スペイン語
|
|
158
158
|
STORYBOOK_SET_LANGUAGE = 言語を設定
|
|
159
159
|
STORYBOOK_YOU = 自分
|
|
160
|
+
STORYBOOK_REACTION_NAMES_2 = Olivia Chen、Benjamin Carter、Sophia Rodriguez、William KimとIsabella Garcia
|
|
161
|
+
STORYBOOK_REACTION_NAMES_3 = Olivia Chenと{ STORYBOOK_YOU }
|
|
160
162
|
`;exports.default=_;
|
|
161
163
|
//# sourceMappingURL=ja-JP.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ja-JP.cjs","sources":["../../../dialtone-vue2/localization/ja-JP.ftl?raw"],"sourcesContent":["export default \"# Dialtone\\nDIALTONE_CLOSE_BUTTON = クリックして閉じる\\nDIALTONE_BREADCRUMBS_ARIA_LABEL = ブレッドクラム\\nDIALTONE_LOADING = 読み込んでいます\\nDIALTONE_UNREAD_MESSAGE_COUNT_TEXT =\\n { $unreadCount ->\\n [0] 未読メッセージはありません\\n [1] 1件の未読メッセージ\\n *[other] { $unreadCount }件の未読メッセージ\\n }\\nDIALTONE_UNREAD_MENTION_COUNT_TEXT =\\n { $unreadCount ->\\n [0] 未読メンションはありません\\n [1] 1件の未読メンション\\n *[other] { $unreadCount }件の未読メンション\\n }\\nDIALTONE_TYPING_TEXT = 入力中\\nDIALTONE_ATTACHMENT_CAROUSEL_CLICK_TO_OPEN_ARIA_LABEL = クリックして開く\\nDIALTONE_ATTACHMENT_CAROUSEL_PROGRESS_BAR_ARIA_LABEL = アップロードしています...\\nDIALTONE_ATTACHMENT_CAROUSEL_LEFT_ARROW_ARIA_LABEL = 前へ\\nDIALTONE_ATTACHMENT_CAROUSEL_RIGHT_ARROW_ARIA_LABEL = 次へ\\nDIALTONE_CALLBAR_BUTTON_WITH_DROPDOWN_ARROW_BUTTON_ARIA_LABEL = ドロップダウンを開く\\nDIALTONE_CALLBAR_BUTTON_WITH_POPOVER_ARROW_BUTTON_ARIA_LABEL = ポップオーバーを開く\\nDIALTONE_CONTACT_CENTERS_ROW_MENU_BUTTON_LABEL = メニューを開く\\nDIALTONE_DATEPICKER_PREVIOUS_MONTH = 前月\\nDIALTONE_DATEPICKER_NEXT_MONTH = 来月\\nDIALTONE_DATEPICKER_PREVIOUS_YEAR = 前年\\nDIALTONE_DATEPICKER_NEXT_YEAR = 来年\\nDIALTONE_DATEPICKER_SELECT_DAY = 曜日を選択\\nDIALTONE_DATEPICKER_CHANGE_TO = 次に変更 :\\nDIALTONE_EDITOR_CONFIRM_SET_LINK_BUTTON =\\n .title = 確認\\n .aria-label = 設定リンクを確定\\nDIALTONE_EDITOR_REMOVE_LINK_BUTTON =\\n .title = 削除\\n .aria-label = リンクを削除\\nDIALTONE_EDITOR_CANCEL_SET_LINK_BUTTON =\\n .title = キャンセル\\n .aria-label = 設定リンクをキャンセル\\nDIALTONE_EDITOR_QUICK_REPLY_BUTTON_LABEL = テンプレート\\nDIALTONE_EDITOR_BOLD_BUTTON_LABEL = 太字\\nDIALTONE_EDITOR_ITALICS_BUTTON_LABEL = 斜体\\nDIALTONE_EDITOR_UNDERLINE_BUTTON_LABEL = 下線\\nDIALTONE_EDITOR_STRIKE_BUTTON_LABEL = 取り消し線\\nDIALTONE_EDITOR_ALIGN_LEFT_BUTTON_LABEL = 左揃え\\nDIALTONE_EDITOR_ALIGN_CENTER_BUTTON_LABEL = 中央揃え\\nDIALTONE_EDITOR_ALIGN_RIGHT_BUTTON_LABEL = 右揃え\\nDIALTONE_EDITOR_ALIGN_JUSTIFY_BUTTON_LABEL = 両端揃え\\nDIALTONE_EDITOR_BULLET_LIST_BUTTON_LABEL = 箇条書きリスト\\nDIALTONE_EDITOR_ORDERED_LIST_BUTTON_LABEL = 番号付きリスト\\nDIALTONE_EDITOR_QUOTE_BUTTON_LABEL = 引用\\nDIALTONE_EDITOR_CODE_BUTTON_LABEL = コード\\nDIALTONE_EDITOR_IMAGE_BUTTON_LABEL = 画像\\nDIALTONE_EDITOR_LINK_BUTTON_LABEL = リンク\\nDIALTONE_EDITOR_ADD_LINK_BUTTON =\\n .title = リンクを追加\\n .aria-label = リンクを追加するための入力フィールド\\nDIALTONE_EMOJI_ROW_REACTION_LABEL =\\n { $personCount ->\\n *[other] が { $reaction } で反応しました\\n }\\nDIALTONE_EMOJI_PICKER_ADD_EMOJI_LABEL = 絵文字を追加\\nDIALTONE_EMOJI_PICKER_SEARCH_NO_RESULTS_LABEL = 見つかりません\\nDIALTONE_EMOJI_PICKER_SEARCH_RESULTS_LABEL = 検索結果\\nDIALTONE_EMOJI_PICKER_SEARCH_PLACEHOLDER_LABEL = 検索...\\nDIALTONE_EMOJI_PICKER_SKIN_SELECTOR_BUTTON_TOOLTIP_LABEL = デフォルトの肌の色を変更\\nDIALTONE_EMOJI_PICKER_TABSET_RECENTLY_USED_LABEL = 最近使用\\nDIALTONE_EMOJI_PICKER_TABSET_SMILEYS_AND_PEOPLE_LABEL = スマイリー&人物\\nDIALTONE_EMOJI_PICKER_TABSET_NATURE_LABEL = 自然\\nDIALTONE_EMOJI_PICKER_TABSET_FOOD_LABEL = 食べ物\\nDIALTONE_EMOJI_PICKER_TABSET_ACTIVITY_LABEL = アクティビティ\\nDIALTONE_EMOJI_PICKER_TABSET_TRAVEL_LABEL = 旅行\\nDIALTONE_EMOJI_PICKER_TABSET_OBJECTS_LABEL = オブジェクト\\nDIALTONE_EMOJI_PICKER_TABSET_SYMBOLS_LABEL = 記号\\nDIALTONE_EMOJI_PICKER_TABSET_FLAGS_LABEL = フラグ\\nDIALTONE_EMOJI_PICKER_TABSET_CUSTOM_LABEL = カスタム\\nDIALTONE_FEED_ITEM_PILL_ARIA_LABEL = クリックして展開\\nDIALTONE_GENERAL_ROW_ACTIVE_VOICE_CHAT_TEXT = 進行中の音声チャット\\nDIALTONE_GENERAL_ROW_CALL_BUTTON_TOOLTIP = 発信\\nDIALTONE_GENERAL_ROW_DND_TEXT_TOOLTIP = プライバシーモード\\nDIALTONE_GROUP_ROW_GROUP_COUNT_TEXT =\\n { $count ->\\n [1] 1ユーザー\\n *[other] { $count } ユーザー\\n }\\nDIALTONE_IVR_NODE_MENU_BUTTON_ARIA_LABEL = メニューを開く\\nDIALTONE_IVR_NODE_PROMPTMENU_ARIA_LABEL = プロンプトメニューノード\\nDIALTONE_IVR_NODE_PROMPTCOLLECT_ARIA_LABEL = プロンプト収集ノード\\nDIALTONE_IVR_NODE_PROMPTPLAY_ARIA_LABEL = プロンプト再生ノード\\nDIALTONE_IVR_NODE_GOTOEXPERT_ARIA_LABEL = Expertノードへ移動\\nDIALTONE_IVR_NODE_BRANCH_ARIA_LABEL = ブランチノード\\nDIALTONE_IVR_NODE_GOTO_ARIA_LABEL = ノードへ\\nDIALTONE_IVR_NODE_ASSIGN_ARIA_LABEL = ノードを割り当て\\nDIALTONE_IVR_NODE_CUSTOMERDATA_ARIA_LABEL = 顧客データノード\\nDIALTONE_IVR_NODE_TRANSFER_ARIA_LABEL = 転送ノード\\nDIALTONE_IVR_NODE_HANGUP_ARIA_LABEL = 通話終了ノード\\nDIALTONE_MESSAGE_INPUT_SEND_BUTTON_ARIA_LABEL = 送信\\nDIALTONE_MESSAGE_INPUT_IMAGE_PICKER_BUTTON_ARIA_LABEL = 画像を添付\\nDIALTONE_MESSAGE_INPUT_EMOJI_PICKER_BUTTON_ARIA_LABEL = 絵文字を選択\\nDIALTONE_MESSAGE_INPUT_CANCEL_BUTTON_ARIA_LABEL = キャンセル\\nDIALTONE_MESSAGE_INPUT_BOLD_BUTTON_LABEL =\\n .aria-label = 選択したテキストの太字を切り替え\\n .tooltip-text = 太字\\nDIALTONE_MESSAGE_INPUT_ITALIC_BUTTON_LABEL =\\n .aria-label = 選択したテキストの斜体を切り替え\\n .tooltip-text = 斜体\\nDIALTONE_MESSAGE_INPUT_STRIKETHROUGH_BUTTON_LABEL =\\n .aria-label = 選択したテキストの取り消し線を切り替え\\n .tooltip-text = 取り消し線\\nDIALTONE_MESSAGE_INPUT_BULLET_LIST_BUTTON_LABEL =\\n .aria-label = 選択したテキストの箇条書きを作成・編集\\n .tooltip-text = 箇条書きリスト\\nDIALTONE_MESSAGE_INPUT_ORDERED_LIST_BUTTON_LABEL =\\n .aria-label = 選択したテキストの番号付きリストを作成・編集\\n .tooltip-text = 番号付きリスト\\nDIALTONE_MESSAGE_INPUT_BLOCK_QUOTE_BUTTON_LABEL =\\n .aria-label = 選択したテキストの引用ブロックを作成・編集\\n .tooltip-text = 引用ブロック\\nDIALTONE_MESSAGE_INPUT_CODE_BUTTON_LABEL =\\n .aria-label = 選択したテキストのコードを作成・編集\\n .tooltip-text = コード\\nDIALTONE_MESSAGE_INPUT_CODE_BLOCK_BUTTON_LABEL =\\n .aria-label = 選択したテキストのコードブロックを作成・編集\\n .tooltip-text = コードブロック\\nDIALTONE_MESSAGE_INPUT_LINK_BUTTON_LABEL =\\n .aria-label = 選択したテキストのリンクを作成・編集\\n .tooltip-text = リンク\\nDIALTONE_MESSAGE_INPUT_LINK_DIALOG_TITLE = リンクを追加\\nDIALTONE_MESSAGE_INPUT_LINK_TEXT_LABEL = 表示するテキスト (任意)\\nDIALTONE_MESSAGE_INPUT_LINK_LINK_LABEL = リンク\\nDIALTONE_MESSAGE_INPUT_LINK_LINK_PLACEHOLDER = 例 : https://www.dialpad.com\\nDIALTONE_MESSAGE_INPUT_LINK_REMOVE_LABEL = 削除\\nDIALTONE_MESSAGE_INPUT_LINK_CANCEL_LABEL = キャンセル\\nDIALTONE_MESSAGE_INPUT_LINK_CONFIRM_LABEL = 完了\\nDIALTONE_PAGINATION_FIRST_PAGE = 最初のページ\\nDIALTONE_PAGINATION_PREVIOUS_PAGE = 前のページ\\nDIALTONE_PAGINATION_NEXT_PAGE = 次のページ\\nDIALTONE_PAGINATION_LAST_PAGE = 最後のページ\\nDIALTONE_PAGINATION_PAGE_NUMBER = ページ番号 { $page }\\nDIALTONE_RICH_TEXT_EDITOR_EDIT_BUTTON_LABEL = 編集\\nDIALTONE_RICH_TEXT_EDITOR_OPEN_LINK_BUTTON_LABEL = リンクを開く\\nDIALTONE_RICH_TEXT_EDITOR_REMOVE_BUTTON_LABEL = 削除\\nDIALTONE_SETTINGS_MENU_DEFAULT_BUTTON_LABEL = 設定\\nDIALTONE_SETTINGS_MENU_UPDATE_BUTTON_LABEL = アップデート\\nDIALTONE_UNREAD_PILL_MENTIONS_TEXT = 未読のメンション\\nDIALTONE_UNREAD_PILL_MESSAGES_TEXT = 未読メッセージ\\n# Storybook only\\nSTORYBOOK_LANGUAGE_ENGLISH = 英語\\nSTORYBOOK_LANGUAGE_CHINESE = 中国語\\nSTORYBOOK_LANGUAGE_DUTCH = オランダ語\\nSTORYBOOK_LANGUAGE_FRENCH = フランス語\\nSTORYBOOK_LANGUAGE_GERMAN = ドイツ語\\nSTORYBOOK_LANGUAGE_ITALIAN = イタリア語\\nSTORYBOOK_LANGUAGE_JAPANESE = 日本語\\nSTORYBOOK_LANGUAGE_PORTUGUESE = ポルトガル語\\nSTORYBOOK_LANGUAGE_RUSSIAN = ロシア語\\nSTORYBOOK_LANGUAGE_SPANISH = スペイン語\\nSTORYBOOK_SET_LANGUAGE = 言語を設定\\nSTORYBOOK_YOU = 自分\\n\""],"names":["jaJP"],"mappings":"4GAAA,MAAAA,EAAe;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA"}
|
|
1
|
+
{"version":3,"file":"ja-JP.cjs","sources":["../../../dialtone-vue2/localization/ja-JP.ftl?raw"],"sourcesContent":["export default \"# Dialtone\\nDIALTONE_CLOSE_BUTTON = クリックして閉じる\\nDIALTONE_BREADCRUMBS_ARIA_LABEL = ブレッドクラム\\nDIALTONE_LOADING = 読み込んでいます\\nDIALTONE_UNREAD_MESSAGE_COUNT_TEXT =\\n { $unreadCount ->\\n [0] 未読メッセージはありません\\n [1] 1件の未読メッセージ\\n *[other] { $unreadCount }件の未読メッセージ\\n }\\nDIALTONE_UNREAD_MENTION_COUNT_TEXT =\\n { $unreadCount ->\\n [0] 未読メンションはありません\\n [1] 1件の未読メンション\\n *[other] { $unreadCount }件の未読メンション\\n }\\nDIALTONE_TYPING_TEXT = 入力中\\nDIALTONE_ATTACHMENT_CAROUSEL_CLICK_TO_OPEN_ARIA_LABEL = クリックして開く\\nDIALTONE_ATTACHMENT_CAROUSEL_PROGRESS_BAR_ARIA_LABEL = アップロードしています...\\nDIALTONE_ATTACHMENT_CAROUSEL_LEFT_ARROW_ARIA_LABEL = 前へ\\nDIALTONE_ATTACHMENT_CAROUSEL_RIGHT_ARROW_ARIA_LABEL = 次へ\\nDIALTONE_CALLBAR_BUTTON_WITH_DROPDOWN_ARROW_BUTTON_ARIA_LABEL = ドロップダウンを開く\\nDIALTONE_CALLBAR_BUTTON_WITH_POPOVER_ARROW_BUTTON_ARIA_LABEL = ポップオーバーを開く\\nDIALTONE_CONTACT_CENTERS_ROW_MENU_BUTTON_LABEL = メニューを開く\\nDIALTONE_DATEPICKER_PREVIOUS_MONTH = 前月\\nDIALTONE_DATEPICKER_NEXT_MONTH = 来月\\nDIALTONE_DATEPICKER_PREVIOUS_YEAR = 前年\\nDIALTONE_DATEPICKER_NEXT_YEAR = 来年\\nDIALTONE_DATEPICKER_SELECT_DAY = 曜日を選択\\nDIALTONE_DATEPICKER_CHANGE_TO = 次に変更 :\\nDIALTONE_EDITOR_CONFIRM_SET_LINK_BUTTON =\\n .title = 確認\\n .aria-label = 設定リンクを確定\\nDIALTONE_EDITOR_REMOVE_LINK_BUTTON =\\n .title = 削除\\n .aria-label = リンクを削除\\nDIALTONE_EDITOR_CANCEL_SET_LINK_BUTTON =\\n .title = キャンセル\\n .aria-label = 設定リンクをキャンセル\\nDIALTONE_EDITOR_QUICK_REPLY_BUTTON_LABEL = テンプレート\\nDIALTONE_EDITOR_BOLD_BUTTON_LABEL = 太字\\nDIALTONE_EDITOR_ITALICS_BUTTON_LABEL = 斜体\\nDIALTONE_EDITOR_UNDERLINE_BUTTON_LABEL = 下線\\nDIALTONE_EDITOR_STRIKE_BUTTON_LABEL = 取り消し線\\nDIALTONE_EDITOR_ALIGN_LEFT_BUTTON_LABEL = 左揃え\\nDIALTONE_EDITOR_ALIGN_CENTER_BUTTON_LABEL = 中央揃え\\nDIALTONE_EDITOR_ALIGN_RIGHT_BUTTON_LABEL = 右揃え\\nDIALTONE_EDITOR_ALIGN_JUSTIFY_BUTTON_LABEL = 両端揃え\\nDIALTONE_EDITOR_BULLET_LIST_BUTTON_LABEL = 箇条書きリスト\\nDIALTONE_EDITOR_ORDERED_LIST_BUTTON_LABEL = 番号付きリスト\\nDIALTONE_EDITOR_QUOTE_BUTTON_LABEL = 引用\\nDIALTONE_EDITOR_CODE_BUTTON_LABEL = コード\\nDIALTONE_EDITOR_IMAGE_BUTTON_LABEL = 画像\\nDIALTONE_EDITOR_LINK_BUTTON_LABEL = リンク\\nDIALTONE_EDITOR_ADD_LINK_BUTTON =\\n .title = リンクを追加\\n .aria-label = リンクを追加するための入力フィールド\\nDIALTONE_EMOJI_ROW_REACTION_LABEL =\\n { $personCount ->\\n *[other] が { $reaction } で反応しました\\n }\\nDIALTONE_EMOJI_PICKER_ADD_EMOJI_LABEL = 絵文字を追加\\nDIALTONE_EMOJI_PICKER_SEARCH_NO_RESULTS_LABEL = 見つかりません\\nDIALTONE_EMOJI_PICKER_SEARCH_RESULTS_LABEL = 検索結果\\nDIALTONE_EMOJI_PICKER_SEARCH_PLACEHOLDER_LABEL = 検索...\\nDIALTONE_EMOJI_PICKER_SKIN_SELECTOR_BUTTON_TOOLTIP_LABEL = デフォルトの肌の色を変更\\nDIALTONE_EMOJI_PICKER_TABSET_RECENTLY_USED_LABEL = 最近使用\\nDIALTONE_EMOJI_PICKER_TABSET_SMILEYS_AND_PEOPLE_LABEL = スマイリー&人物\\nDIALTONE_EMOJI_PICKER_TABSET_NATURE_LABEL = 自然\\nDIALTONE_EMOJI_PICKER_TABSET_FOOD_LABEL = 食べ物\\nDIALTONE_EMOJI_PICKER_TABSET_ACTIVITY_LABEL = アクティビティ\\nDIALTONE_EMOJI_PICKER_TABSET_TRAVEL_LABEL = 旅行\\nDIALTONE_EMOJI_PICKER_TABSET_OBJECTS_LABEL = オブジェクト\\nDIALTONE_EMOJI_PICKER_TABSET_SYMBOLS_LABEL = 記号\\nDIALTONE_EMOJI_PICKER_TABSET_FLAGS_LABEL = フラグ\\nDIALTONE_EMOJI_PICKER_TABSET_CUSTOM_LABEL = カスタム\\nDIALTONE_FEED_ITEM_PILL_ARIA_LABEL = クリックして展開\\nDIALTONE_GENERAL_ROW_ACTIVE_VOICE_CHAT_TEXT = 進行中の音声チャット\\nDIALTONE_GENERAL_ROW_CALL_BUTTON_TOOLTIP = 発信\\nDIALTONE_GENERAL_ROW_DND_TEXT_TOOLTIP = プライバシーモード\\nDIALTONE_GROUP_ROW_GROUP_COUNT_TEXT =\\n { $count ->\\n [1] 1ユーザー\\n *[other] { $count } ユーザー\\n }\\nDIALTONE_IVR_NODE_MENU_BUTTON_ARIA_LABEL = メニューを開く\\nDIALTONE_IVR_NODE_PROMPTMENU_ARIA_LABEL = プロンプトメニューノード\\nDIALTONE_IVR_NODE_PROMPTCOLLECT_ARIA_LABEL = プロンプト収集ノード\\nDIALTONE_IVR_NODE_PROMPTPLAY_ARIA_LABEL = プロンプト再生ノード\\nDIALTONE_IVR_NODE_GOTOEXPERT_ARIA_LABEL = Expertノードへ移動\\nDIALTONE_IVR_NODE_BRANCH_ARIA_LABEL = ブランチノード\\nDIALTONE_IVR_NODE_GOTO_ARIA_LABEL = ノードへ\\nDIALTONE_IVR_NODE_ASSIGN_ARIA_LABEL = ノードを割り当て\\nDIALTONE_IVR_NODE_CUSTOMERDATA_ARIA_LABEL = 顧客データノード\\nDIALTONE_IVR_NODE_TRANSFER_ARIA_LABEL = 転送ノード\\nDIALTONE_IVR_NODE_HANGUP_ARIA_LABEL = 通話終了ノード\\nDIALTONE_MESSAGE_INPUT_SEND_BUTTON_ARIA_LABEL = 送信\\nDIALTONE_MESSAGE_INPUT_IMAGE_PICKER_BUTTON_ARIA_LABEL = 画像を添付\\nDIALTONE_MESSAGE_INPUT_EMOJI_PICKER_BUTTON_ARIA_LABEL = 絵文字を選択\\nDIALTONE_MESSAGE_INPUT_CANCEL_BUTTON_ARIA_LABEL = キャンセル\\nDIALTONE_MESSAGE_INPUT_BOLD_BUTTON_LABEL =\\n .aria-label = 選択したテキストの太字を切り替え\\n .tooltip-text = 太字\\nDIALTONE_MESSAGE_INPUT_ITALIC_BUTTON_LABEL =\\n .aria-label = 選択したテキストの斜体を切り替え\\n .tooltip-text = 斜体\\nDIALTONE_MESSAGE_INPUT_STRIKETHROUGH_BUTTON_LABEL =\\n .aria-label = 選択したテキストの取り消し線を切り替え\\n .tooltip-text = 取り消し線\\nDIALTONE_MESSAGE_INPUT_BULLET_LIST_BUTTON_LABEL =\\n .aria-label = 選択したテキストの箇条書きを作成・編集\\n .tooltip-text = 箇条書きリスト\\nDIALTONE_MESSAGE_INPUT_ORDERED_LIST_BUTTON_LABEL =\\n .aria-label = 選択したテキストの番号付きリストを作成・編集\\n .tooltip-text = 番号付きリスト\\nDIALTONE_MESSAGE_INPUT_BLOCK_QUOTE_BUTTON_LABEL =\\n .aria-label = 選択したテキストの引用ブロックを作成・編集\\n .tooltip-text = 引用ブロック\\nDIALTONE_MESSAGE_INPUT_CODE_BUTTON_LABEL =\\n .aria-label = 選択したテキストのコードを作成・編集\\n .tooltip-text = コード\\nDIALTONE_MESSAGE_INPUT_CODE_BLOCK_BUTTON_LABEL =\\n .aria-label = 選択したテキストのコードブロックを作成・編集\\n .tooltip-text = コードブロック\\nDIALTONE_MESSAGE_INPUT_LINK_BUTTON_LABEL =\\n .aria-label = 選択したテキストのリンクを作成・編集\\n .tooltip-text = リンク\\nDIALTONE_MESSAGE_INPUT_LINK_DIALOG_TITLE = リンクを追加\\nDIALTONE_MESSAGE_INPUT_LINK_TEXT_LABEL = 表示するテキスト (任意)\\nDIALTONE_MESSAGE_INPUT_LINK_LINK_LABEL = リンク\\nDIALTONE_MESSAGE_INPUT_LINK_LINK_PLACEHOLDER = 例 : https://www.dialpad.com\\nDIALTONE_MESSAGE_INPUT_LINK_REMOVE_LABEL = 削除\\nDIALTONE_MESSAGE_INPUT_LINK_CANCEL_LABEL = キャンセル\\nDIALTONE_MESSAGE_INPUT_LINK_CONFIRM_LABEL = 完了\\nDIALTONE_PAGINATION_FIRST_PAGE = 最初のページ\\nDIALTONE_PAGINATION_PREVIOUS_PAGE = 前のページ\\nDIALTONE_PAGINATION_NEXT_PAGE = 次のページ\\nDIALTONE_PAGINATION_LAST_PAGE = 最後のページ\\nDIALTONE_PAGINATION_PAGE_NUMBER = ページ番号 { $page }\\nDIALTONE_RICH_TEXT_EDITOR_EDIT_BUTTON_LABEL = 編集\\nDIALTONE_RICH_TEXT_EDITOR_OPEN_LINK_BUTTON_LABEL = リンクを開く\\nDIALTONE_RICH_TEXT_EDITOR_REMOVE_BUTTON_LABEL = 削除\\nDIALTONE_SETTINGS_MENU_DEFAULT_BUTTON_LABEL = 設定\\nDIALTONE_SETTINGS_MENU_UPDATE_BUTTON_LABEL = アップデート\\nDIALTONE_UNREAD_PILL_MENTIONS_TEXT = 未読のメンション\\nDIALTONE_UNREAD_PILL_MESSAGES_TEXT = 未読メッセージ\\n# Storybook only\\nSTORYBOOK_LANGUAGE_ENGLISH = 英語\\nSTORYBOOK_LANGUAGE_CHINESE = 中国語\\nSTORYBOOK_LANGUAGE_DUTCH = オランダ語\\nSTORYBOOK_LANGUAGE_FRENCH = フランス語\\nSTORYBOOK_LANGUAGE_GERMAN = ドイツ語\\nSTORYBOOK_LANGUAGE_ITALIAN = イタリア語\\nSTORYBOOK_LANGUAGE_JAPANESE = 日本語\\nSTORYBOOK_LANGUAGE_PORTUGUESE = ポルトガル語\\nSTORYBOOK_LANGUAGE_RUSSIAN = ロシア語\\nSTORYBOOK_LANGUAGE_SPANISH = スペイン語\\nSTORYBOOK_SET_LANGUAGE = 言語を設定\\nSTORYBOOK_YOU = 自分\\nSTORYBOOK_REACTION_NAMES_2 = Olivia Chen、Benjamin Carter、Sophia Rodriguez、William KimとIsabella Garcia\\nSTORYBOOK_REACT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U = 自分
|
|
160
|
+
STORYBOOK_REACTION_NAMES_2 = Olivia Chen、Benjamin Carter、Sophia Rodriguez、William KimとIsabella Garcia
|
|
161
|
+
STORYBOOK_REACTION_NAMES_3 = Olivia Chenと{ STORYBOOK_YOU }
|
|
160
162
|
`;
|
|
161
163
|
export {
|
|
162
164
|
_ as default
|