@dialpad/dialtone-vue 2.200.2 → 2.200.3
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/lib/split-button/split-button-alpha.cjs +1 -1
- package/dist/lib/split-button/split-button-alpha.cjs.map +1 -1
- package/dist/lib/split-button/split-button-alpha.js +16 -8
- package/dist/lib/split-button/split-button-alpha.js.map +1 -1
- package/dist/lib/tooltip-directive/tooltip.cjs +1 -1
- package/dist/lib/tooltip-directive/tooltip.cjs.map +1 -1
- package/dist/lib/tooltip-directive/tooltip.js +17 -16
- package/dist/lib/tooltip-directive/tooltip.js.map +1 -1
- package/dist/types/components/split_button/split_button-alpha.vue.d.ts +6 -1
- package/dist/types/directives/tooltip_directive/tooltip.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("../../_plugin-vue2_normalizer-e_CkxkSV.cjs"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("../../_plugin-vue2_normalizer-e_CkxkSV.cjs"),i=require("../button/button.cjs"),n=require("../button/button-constants.cjs"),o={name:"SplitButtonAlpha",components:{DtButton:i.default},props:{active:{type:Boolean,default:!1},ariaLabel:{type:String,default:null},iconPosition:{type:String,default:"left"},labelClass:{type:[String,Array,Object],default:""},loading:{type:Boolean,default:!1},tooltipText:{type:String,default:""},assertiveOnFocus:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},importance:{type:String,default:"primary"},kind:{type:String,default:"default"},size:{type:String,default:"md"}},data(){return{BUTTON_ICON_SIZES:n.BUTTON_ICON_SIZES}},computed:{tooltipConfig(){return{message:this.tooltipText,inverted:this.kind==="inverted"}}}};var l=function(){var t=this,e=t._self._c;return e("dt-button",{directives:[{name:"dt-tooltip",rawName:"v-dt-tooltip",value:t.tooltipConfig,expression:"tooltipConfig"}],class:`d-split-btn__alpha d-split-btn__alpha--${t.size}`,attrs:{"data-qa":"dt-split-button-alpha",active:t.active,"aria-label":t.ariaLabel,"assertive-on-focus":t.assertiveOnFocus,disabled:t.disabled,"icon-position":t.iconPosition,importance:t.importance,kind:t.kind,"label-class":t.labelClass,loading:t.loading,size:t.size},scopedSlots:t._u([{key:"icon",fn:function(){return[t._t("icon",null,{size:t.BUTTON_ICON_SIZES[t.size]})]},proxy:!0}],null,!0)},[t._t("default")],2)},s=[],r=a.n(o,l,s);const u=r.exports;exports.default=u;
|
|
2
2
|
//# sourceMappingURL=split-button-alpha.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"split-button-alpha.cjs","sources":["../../../components/split_button/split_button-alpha.vue"],"sourcesContent":["<template>\n <dt-button\n v-dt-tooltip=\"
|
|
1
|
+
{"version":3,"file":"split-button-alpha.cjs","sources":["../../../components/split_button/split_button-alpha.vue"],"sourcesContent":["<template>\n <dt-button\n v-dt-tooltip=\"tooltipConfig\"\n data-qa=\"dt-split-button-alpha\"\n :active=\"active\"\n :aria-label=\"ariaLabel\"\n :assertive-on-focus=\"assertiveOnFocus\"\n :class=\"`d-split-btn__alpha d-split-btn__alpha--${size}`\"\n :disabled=\"disabled\"\n :icon-position=\"iconPosition\"\n :importance=\"importance\"\n :kind=\"kind\"\n :label-class=\"labelClass\"\n :loading=\"loading\"\n :size=\"size\"\n >\n <template #icon>\n <slot\n name=\"icon\"\n :size=\"BUTTON_ICON_SIZES[size]\"\n />\n </template>\n <slot name=\"default\" />\n </dt-button>\n</template>\n\n<script>\nimport { BUTTON_ICON_SIZES, DtButton } from '@/components/button';\n\nexport default {\n name: 'SplitButtonAlpha',\n\n components: {\n DtButton,\n },\n\n props: {\n /**\n * Determines whether the button should have active styling\n */\n active: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Descriptive label for the button\n */\n ariaLabel: {\n type: String,\n default: null,\n },\n\n /**\n * The position of the icon slot within the button.\n */\n iconPosition: {\n type: String,\n default: 'left',\n },\n\n /**\n * Used to customize the label container\n */\n labelClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Whether the button should display a loading animation or not.\n */\n loading: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Text shown in tooltip when you hover the button\n */\n tooltipText: {\n type: String,\n default: '',\n },\n\n /**\n * Determines whether a screenreader reads live updates of\n * the button content to the user while the button is in focus.\n */\n assertiveOnFocus: {\n type: Boolean,\n default: false,\n },\n\n /**\n * HTML button disabled attribute\n */\n disabled: {\n type: Boolean,\n default: false,\n },\n\n /**\n * The fill and outline of the button associated with its visual importance.\n */\n importance: {\n type: String,\n default: 'primary',\n },\n\n /**\n * The color of the button.\n */\n kind: {\n type: String,\n default: 'default',\n },\n\n /**\n * The size of the button.\n */\n size: {\n type: String,\n default: 'md',\n },\n },\n\n data () {\n return {\n BUTTON_ICON_SIZES,\n };\n },\n\n computed: {\n tooltipConfig () {\n return {\n message: this.tooltipText,\n inverted: this.kind === 'inverted',\n };\n },\n },\n};\n</script>\n"],"names":["_sfc_main","DtButton","BUTTON_ICON_SIZES"],"mappings":"wPA6BAA,EAAA,CACA,KAAA,mBAEA,WAAA,CACA,SAAAC,EAAAA,OACA,EAEA,MAAA,CAIA,OAAA,CACA,KAAA,QACA,QAAA,EACA,EAKA,UAAA,CACA,KAAA,OACA,QAAA,IACA,EAKA,aAAA,CACA,KAAA,OACA,QAAA,MACA,EAKA,WAAA,CACA,KAAA,CAAA,OAAA,MAAA,MAAA,EACA,QAAA,EACA,EAKA,QAAA,CACA,KAAA,QACA,QAAA,EACA,EAKA,YAAA,CACA,KAAA,OACA,QAAA,EACA,EAMA,iBAAA,CACA,KAAA,QACA,QAAA,EACA,EAKA,SAAA,CACA,KAAA,QACA,QAAA,EACA,EAKA,WAAA,CACA,KAAA,OACA,QAAA,SACA,EAKA,KAAA,CACA,KAAA,OACA,QAAA,SACA,EAKA,KAAA,CACA,KAAA,OACA,QAAA,IACA,CACA,EAEA,MAAA,CACA,MAAA,CACA,kBAAAC,EAAAA,iBACA,CACA,EAEA,SAAA,CACA,eAAA,CACA,MAAA,CACA,QAAA,KAAA,YACA,SAAA,KAAA,OAAA,UACA,CACA,CACA,CACA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { n as a } from "../../_plugin-vue2_normalizer-DSLOjnn3.js";
|
|
2
2
|
import i from "../button/button.js";
|
|
3
|
-
import { BUTTON_ICON_SIZES as
|
|
4
|
-
const
|
|
3
|
+
import { BUTTON_ICON_SIZES as o } from "../button/button-constants.js";
|
|
4
|
+
const n = {
|
|
5
5
|
name: "SplitButtonAlpha",
|
|
6
6
|
components: {
|
|
7
7
|
DtButton: i
|
|
@@ -88,22 +88,30 @@ const l = {
|
|
|
88
88
|
},
|
|
89
89
|
data() {
|
|
90
90
|
return {
|
|
91
|
-
BUTTON_ICON_SIZES:
|
|
91
|
+
BUTTON_ICON_SIZES: o
|
|
92
92
|
};
|
|
93
|
+
},
|
|
94
|
+
computed: {
|
|
95
|
+
tooltipConfig() {
|
|
96
|
+
return {
|
|
97
|
+
message: this.tooltipText,
|
|
98
|
+
inverted: this.kind === "inverted"
|
|
99
|
+
};
|
|
100
|
+
}
|
|
93
101
|
}
|
|
94
102
|
};
|
|
95
|
-
var
|
|
103
|
+
var l = function() {
|
|
96
104
|
var t = this, e = t._self._c;
|
|
97
|
-
return e("dt-button", { directives: [{ name: "dt-tooltip", rawName: "v-dt-tooltip", value:
|
|
105
|
+
return e("dt-button", { directives: [{ name: "dt-tooltip", rawName: "v-dt-tooltip", value: t.tooltipConfig, expression: "tooltipConfig" }], class: `d-split-btn__alpha d-split-btn__alpha--${t.size}`, attrs: { "data-qa": "dt-split-button-alpha", active: t.active, "aria-label": t.ariaLabel, "assertive-on-focus": t.assertiveOnFocus, disabled: t.disabled, "icon-position": t.iconPosition, importance: t.importance, kind: t.kind, "label-class": t.labelClass, loading: t.loading, size: t.size }, scopedSlots: t._u([{ key: "icon", fn: function() {
|
|
98
106
|
return [t._t("icon", null, { size: t.BUTTON_ICON_SIZES[t.size] })];
|
|
99
107
|
}, proxy: !0 }], null, !0) }, [t._t("default")], 2);
|
|
100
108
|
}, s = [], r = /* @__PURE__ */ a(
|
|
109
|
+
n,
|
|
101
110
|
l,
|
|
102
|
-
o,
|
|
103
111
|
s
|
|
104
112
|
);
|
|
105
|
-
const
|
|
113
|
+
const c = r.exports;
|
|
106
114
|
export {
|
|
107
|
-
|
|
115
|
+
c as default
|
|
108
116
|
};
|
|
109
117
|
//# sourceMappingURL=split-button-alpha.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"split-button-alpha.js","sources":["../../../components/split_button/split_button-alpha.vue"],"sourcesContent":["<template>\n <dt-button\n v-dt-tooltip=\"
|
|
1
|
+
{"version":3,"file":"split-button-alpha.js","sources":["../../../components/split_button/split_button-alpha.vue"],"sourcesContent":["<template>\n <dt-button\n v-dt-tooltip=\"tooltipConfig\"\n data-qa=\"dt-split-button-alpha\"\n :active=\"active\"\n :aria-label=\"ariaLabel\"\n :assertive-on-focus=\"assertiveOnFocus\"\n :class=\"`d-split-btn__alpha d-split-btn__alpha--${size}`\"\n :disabled=\"disabled\"\n :icon-position=\"iconPosition\"\n :importance=\"importance\"\n :kind=\"kind\"\n :label-class=\"labelClass\"\n :loading=\"loading\"\n :size=\"size\"\n >\n <template #icon>\n <slot\n name=\"icon\"\n :size=\"BUTTON_ICON_SIZES[size]\"\n />\n </template>\n <slot name=\"default\" />\n </dt-button>\n</template>\n\n<script>\nimport { BUTTON_ICON_SIZES, DtButton } from '@/components/button';\n\nexport default {\n name: 'SplitButtonAlpha',\n\n components: {\n DtButton,\n },\n\n props: {\n /**\n * Determines whether the button should have active styling\n */\n active: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Descriptive label for the button\n */\n ariaLabel: {\n type: String,\n default: null,\n },\n\n /**\n * The position of the icon slot within the button.\n */\n iconPosition: {\n type: String,\n default: 'left',\n },\n\n /**\n * Used to customize the label container\n */\n labelClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Whether the button should display a loading animation or not.\n */\n loading: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Text shown in tooltip when you hover the button\n */\n tooltipText: {\n type: String,\n default: '',\n },\n\n /**\n * Determines whether a screenreader reads live updates of\n * the button content to the user while the button is in focus.\n */\n assertiveOnFocus: {\n type: Boolean,\n default: false,\n },\n\n /**\n * HTML button disabled attribute\n */\n disabled: {\n type: Boolean,\n default: false,\n },\n\n /**\n * The fill and outline of the button associated with its visual importance.\n */\n importance: {\n type: String,\n default: 'primary',\n },\n\n /**\n * The color of the button.\n */\n kind: {\n type: String,\n default: 'default',\n },\n\n /**\n * The size of the button.\n */\n size: {\n type: String,\n default: 'md',\n },\n },\n\n data () {\n return {\n BUTTON_ICON_SIZES,\n };\n },\n\n computed: {\n tooltipConfig () {\n return {\n message: this.tooltipText,\n inverted: this.kind === 'inverted',\n };\n },\n },\n};\n</script>\n"],"names":["_sfc_main","DtButton","BUTTON_ICON_SIZES"],"mappings":";;;AA6BA,MAAAA,IAAA;AAAA,EACA,MAAA;AAAA,EAEA,YAAA;AAAA,IACA,UAAAC;AAAA,EACA;AAAA,EAEA,OAAA;AAAA;AAAA;AAAA;AAAA,IAIA,QAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,WAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,cAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,YAAA;AAAA,MACA,MAAA,CAAA,QAAA,OAAA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,SAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,aAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,kBAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,UAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,YAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,MAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,MAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,OAAA;AACA,WAAA;AAAA,MACA,mBAAAC;AAAA,IACA;AAAA,EACA;AAAA,EAEA,UAAA;AAAA,IACA,gBAAA;AACA,aAAA;AAAA,QACA,SAAA,KAAA;AAAA,QACA,UAAA,KAAA,SAAA;AAAA,MACA;AAAA,IACA;AAAA,EACA;AACA;;;;;;;;;;;;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const c=require("../../common/utils/index.cjs"),p=require("../tooltip/tooltip.cjs"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const c=require("../../common/utils/index.cjs"),v=require("deep-equal"),p=require("../tooltip/tooltip.cjs"),f=require("../tooltip/tooltip-constants.cjs"),n={name:"dt-tooltip-directive",install(r){const s=document.createElement("div");document.body.appendChild(s);const d="top",a=new r({name:"DtTooltipDirectiveApp",components:{DtTooltip:p.default},data(){return{tooltips:[]}},methods:{addOrUpdateTooltip(e,t){const o=this.tooltips.findIndex(i=>i.id===e);o!==-1?this.tooltips.splice(o,1,{id:e,...t}):this.tooltips.push({id:e,...t})},removeTooltip(e){this.tooltips=this.tooltips.filter(t=>t.id!==e)}},render(e){return e("div",{domProps:{id:"dt-tooltip-directive-app"}},[this.tooltips.map(({id:t,...o})=>e(p.default,{key:t,props:{...o,sticky:o.sticky!==void 0?o.sticky:!0,delay:o.delay!==void 0?o.delay:process.env.NODE_ENV!=="test",externalAnchor:`[data-dt-tooltip-id="${t}"]`}}))])}});a.$mount(s),r.directive("dt-tooltip",{bind(e,t){u(e,t)},update(e,t){v(t.value,t.oldValue)||u(e,t)},unbind(e){a.removeTooltip(e.getAttribute("data-dt-tooltip-id"))}});function u(e,t){if(t.value===null||t.value===void 0){const l=e.getAttribute("data-dt-tooltip-id");l&&a.removeTooltip(l);return}const o=e.getAttribute("data-dt-tooltip-id")||c.getUniqueString();let i;if(typeof t.value=="string")i={message:t.value,placement:t.arg||d};else if(typeof t.value=="object"&&t.value!==null)i={placement:t.arg||t.value.placement||d,...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":i.inverted=!0;break;case"no-delay":i.delay=!1;break;case"no-transition":i.transition=!1;break;default:f.TOOLTIP_DIRECTIONS.includes(l)&&(i.placement=l);break}}),e.setAttribute("data-dt-tooltip-id",o),a.addOrUpdateTooltip(o,i)}}};exports.DtTooltipDirective=n;exports.default=n;
|
|
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';\n\nexport const DtTooltipDirective = {\n name: 'dt-tooltip-directive',\n install (Vue) {\n const mountPoint = document.createElement('div');\n document.body.appendChild(mountPoint);\n\n const DEFAULT_PLACEMENT = 'top';\n const DtTooltipDirectiveApp = new Vue({\n name: 'DtTooltipDirectiveApp',\n components: { DtTooltip },\n data () {\n return {\n tooltips: [],\n };\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 (h) {\n return h('div',\n {\n domProps: { id: 'dt-tooltip-directive-app' },\n },\n [\n this.tooltips.map(({ id, ...tooltipProps }) => {\n return h(DtTooltip, {\n key: id,\n props: {\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 });\n\n DtTooltipDirectiveApp.$mount(mountPoint);\n\n Vue.directive('dt-tooltip', {\n bind (anchor, binding) {\n // Initial tooltip setup\n setupTooltip(anchor, binding);\n },\n update (anchor, binding) {\n // Update tooltip on binding value change\n if (binding.value
|
|
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 deepEqual from 'deep-equal';\n\nexport const DtTooltipDirective = {\n name: 'dt-tooltip-directive',\n install (Vue) {\n const mountPoint = document.createElement('div');\n document.body.appendChild(mountPoint);\n\n const DEFAULT_PLACEMENT = 'top';\n const DtTooltipDirectiveApp = new Vue({\n name: 'DtTooltipDirectiveApp',\n components: { DtTooltip },\n data () {\n return {\n tooltips: [],\n };\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 (h) {\n return h('div',\n {\n domProps: { id: 'dt-tooltip-directive-app' },\n },\n [\n this.tooltips.map(({ id, ...tooltipProps }) => {\n return h(DtTooltip, {\n key: id,\n props: {\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 });\n\n DtTooltipDirectiveApp.$mount(mountPoint);\n\n Vue.directive('dt-tooltip', {\n bind (anchor, binding) {\n // Initial tooltip setup\n setupTooltip(anchor, binding);\n },\n update (anchor, binding) {\n // Update tooltip on binding value change\n // Use deep equality check to prevent infinite loops when objects are passed\n if (!deepEqual(binding.value, binding.oldValue)) {\n setupTooltip(anchor, binding);\n }\n },\n unbind (anchor) {\n DtTooltipDirectiveApp.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\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 DtTooltipDirectiveApp.addOrUpdateTooltip(tooltipId, tooltipConfig);\n }\n },\n};\n\nexport default DtTooltipDirective;\n"],"names":["DtTooltipDirective","Vue","mountPoint","DEFAULT_PLACEMENT","DtTooltipDirectiveApp","DtTooltip","id","tooltipConfig","index","tooltip","h","tooltipProps","anchor","binding","setupTooltip","deepEqual","tooltipId","getUniqueString","modifier","TOOLTIP_DIRECTIONS"],"mappings":"sQAIaA,EAAqB,CAChC,KAAM,uBACN,QAASC,EAAK,CACZ,MAAMC,EAAa,SAAS,cAAc,KAAK,EAC/C,SAAS,KAAK,YAAYA,CAAU,EAEpC,MAAMC,EAAoB,MACpBC,EAAwB,IAAIH,EAAI,CACpC,KAAM,wBACN,WAAY,CAAA,UAAEI,EAAAA,OAAS,EACvB,MAAQ,CACN,MAAO,CACL,SAAU,CAAA,CACpB,CACM,EAEA,QAAS,CACP,mBAAoBC,EAAIC,EAAe,CACrC,MAAMC,EAAQ,KAAK,SAAS,UAAUC,GAAWA,EAAQ,KAAOH,CAAE,EAC9DE,IAAU,GAEZ,KAAK,SAAS,OAAOA,EAAO,EAAG,CAAE,GAAAF,EAAI,GAAGC,EAAe,EAGvD,KAAK,SAAS,KAAK,CAAE,GAAAD,EAAI,GAAGC,CAAa,CAAE,CAE/C,EAEA,cAAeD,EAAI,CACjB,KAAK,SAAW,KAAK,SAAS,OAAOG,GAAWA,EAAQ,KAAOH,CAAE,CACnE,CACR,EAEM,OAAQI,EAAG,CACT,OAAOA,EAAE,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QK,GAAY,CACjD,OAAQA,EAAQ,CACd,IAAK,WACHX,EAAc,SAAW,GACzB,MACF,IAAK,WACHA,EAAc,MAAQ,GACtB,MACF,IAAK,gBACHA,EAAc,WAAa,GAC3B,MACF,QACMY,EAAAA,mBAAmB,SAASD,CAAQ,IACtCX,EAAc,UAAYW,GAE5B,KACZ,CACM,CAAC,EAEDN,EAAO,aAAa,qBAAsBI,CAAS,EACnDZ,EAAsB,mBAAmBY,EAAWT,CAAa,CACnE,CACF,CACF"}
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import { getUniqueString as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
1
|
+
import { getUniqueString as n } from "../../common/utils/index.js";
|
|
2
|
+
import c from "deep-equal";
|
|
3
|
+
import u from "../tooltip/tooltip.js";
|
|
4
|
+
import { TOOLTIP_DIRECTIONS as m } from "../tooltip/tooltip-constants.js";
|
|
5
|
+
const D = {
|
|
5
6
|
name: "dt-tooltip-directive",
|
|
6
7
|
install(r) {
|
|
7
8
|
const d = document.createElement("div");
|
|
8
9
|
document.body.appendChild(d);
|
|
9
|
-
const
|
|
10
|
+
const p = "top", a = new r({
|
|
10
11
|
name: "DtTooltipDirectiveApp",
|
|
11
|
-
components: { DtTooltip:
|
|
12
|
+
components: { DtTooltip: u },
|
|
12
13
|
data() {
|
|
13
14
|
return {
|
|
14
15
|
tooltips: []
|
|
@@ -30,7 +31,7 @@ const T = {
|
|
|
30
31
|
domProps: { id: "dt-tooltip-directive-app" }
|
|
31
32
|
},
|
|
32
33
|
[
|
|
33
|
-
this.tooltips.map(({ id: t, ...o }) => e(
|
|
34
|
+
this.tooltips.map(({ id: t, ...o }) => e(u, {
|
|
34
35
|
key: t,
|
|
35
36
|
props: {
|
|
36
37
|
...o,
|
|
@@ -48,31 +49,31 @@ const T = {
|
|
|
48
49
|
});
|
|
49
50
|
a.$mount(d), r.directive("dt-tooltip", {
|
|
50
51
|
bind(e, t) {
|
|
51
|
-
|
|
52
|
+
s(e, t);
|
|
52
53
|
},
|
|
53
54
|
update(e, t) {
|
|
54
|
-
t.value
|
|
55
|
+
c(t.value, t.oldValue) || s(e, t);
|
|
55
56
|
},
|
|
56
57
|
unbind(e) {
|
|
57
58
|
a.removeTooltip(e.getAttribute("data-dt-tooltip-id"));
|
|
58
59
|
}
|
|
59
60
|
});
|
|
60
|
-
function
|
|
61
|
+
function s(e, t) {
|
|
61
62
|
if (t.value === null || t.value === void 0) {
|
|
62
63
|
const l = e.getAttribute("data-dt-tooltip-id");
|
|
63
64
|
l && a.removeTooltip(l);
|
|
64
65
|
return;
|
|
65
66
|
}
|
|
66
|
-
const o = e.getAttribute("data-dt-tooltip-id") ||
|
|
67
|
+
const o = e.getAttribute("data-dt-tooltip-id") || n();
|
|
67
68
|
let i;
|
|
68
69
|
if (typeof t.value == "string")
|
|
69
70
|
i = {
|
|
70
71
|
message: t.value,
|
|
71
|
-
placement: t.arg ||
|
|
72
|
+
placement: t.arg || p
|
|
72
73
|
};
|
|
73
74
|
else if (typeof t.value == "object" && t.value !== null)
|
|
74
75
|
i = {
|
|
75
|
-
placement: t.arg || t.value.placement ||
|
|
76
|
+
placement: t.arg || t.value.placement || p,
|
|
76
77
|
...t.value
|
|
77
78
|
};
|
|
78
79
|
else {
|
|
@@ -91,7 +92,7 @@ const T = {
|
|
|
91
92
|
i.transition = !1;
|
|
92
93
|
break;
|
|
93
94
|
default:
|
|
94
|
-
|
|
95
|
+
m.includes(l) && (i.placement = l);
|
|
95
96
|
break;
|
|
96
97
|
}
|
|
97
98
|
}), e.setAttribute("data-dt-tooltip-id", o), a.addOrUpdateTooltip(o, i);
|
|
@@ -99,7 +100,7 @@ const T = {
|
|
|
99
100
|
}
|
|
100
101
|
};
|
|
101
102
|
export {
|
|
102
|
-
|
|
103
|
-
|
|
103
|
+
D as DtTooltipDirective,
|
|
104
|
+
D as default
|
|
104
105
|
};
|
|
105
106
|
//# sourceMappingURL=tooltip.js.map
|
|
@@ -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';\n\nexport const DtTooltipDirective = {\n name: 'dt-tooltip-directive',\n install (Vue) {\n const mountPoint = document.createElement('div');\n document.body.appendChild(mountPoint);\n\n const DEFAULT_PLACEMENT = 'top';\n const DtTooltipDirectiveApp = new Vue({\n name: 'DtTooltipDirectiveApp',\n components: { DtTooltip },\n data () {\n return {\n tooltips: [],\n };\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 (h) {\n return h('div',\n {\n domProps: { id: 'dt-tooltip-directive-app' },\n },\n [\n this.tooltips.map(({ id, ...tooltipProps }) => {\n return h(DtTooltip, {\n key: id,\n props: {\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 });\n\n DtTooltipDirectiveApp.$mount(mountPoint);\n\n Vue.directive('dt-tooltip', {\n bind (anchor, binding) {\n // Initial tooltip setup\n setupTooltip(anchor, binding);\n },\n update (anchor, binding) {\n // Update tooltip on binding value change\n if (binding.value
|
|
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 deepEqual from 'deep-equal';\n\nexport const DtTooltipDirective = {\n name: 'dt-tooltip-directive',\n install (Vue) {\n const mountPoint = document.createElement('div');\n document.body.appendChild(mountPoint);\n\n const DEFAULT_PLACEMENT = 'top';\n const DtTooltipDirectiveApp = new Vue({\n name: 'DtTooltipDirectiveApp',\n components: { DtTooltip },\n data () {\n return {\n tooltips: [],\n };\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 (h) {\n return h('div',\n {\n domProps: { id: 'dt-tooltip-directive-app' },\n },\n [\n this.tooltips.map(({ id, ...tooltipProps }) => {\n return h(DtTooltip, {\n key: id,\n props: {\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 });\n\n DtTooltipDirectiveApp.$mount(mountPoint);\n\n Vue.directive('dt-tooltip', {\n bind (anchor, binding) {\n // Initial tooltip setup\n setupTooltip(anchor, binding);\n },\n update (anchor, binding) {\n // Update tooltip on binding value change\n // Use deep equality check to prevent infinite loops when objects are passed\n if (!deepEqual(binding.value, binding.oldValue)) {\n setupTooltip(anchor, binding);\n }\n },\n unbind (anchor) {\n DtTooltipDirectiveApp.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\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 DtTooltipDirectiveApp.addOrUpdateTooltip(tooltipId, tooltipConfig);\n }\n },\n};\n\nexport default DtTooltipDirective;\n"],"names":["DtTooltipDirective","Vue","mountPoint","DEFAULT_PLACEMENT","DtTooltipDirectiveApp","DtTooltip","id","tooltipConfig","index","tooltip","h","tooltipProps","anchor","binding","setupTooltip","deepEqual","tooltipId","getUniqueString","modifier","TOOLTIP_DIRECTIONS"],"mappings":";;;;AAIY,MAACA,IAAqB;AAAA,EAChC,MAAM;AAAA,EACN,QAASC,GAAK;AACZ,UAAMC,IAAa,SAAS,cAAc,KAAK;AAC/C,aAAS,KAAK,YAAYA,CAAU;AAEpC,UAAMC,IAAoB,OACpBC,IAAwB,IAAIH,EAAI;AAAA,MACpC,MAAM;AAAA,MACN,YAAY,EAAE,WAAAI,EAAS;AAAA,MACvB,OAAQ;AACN,eAAO;AAAA,UACL,UAAU,CAAA;AAAA,QACpB;AAAA,MACM;AAAA,MAEA,SAAS;AA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tooltipConfig(): {
|
|
56
|
+
message: any;
|
|
57
|
+
inverted: boolean;
|
|
58
|
+
};
|
|
59
|
+
}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, Readonly<import('vue').ExtractPropTypes<{
|
|
55
60
|
active: {
|
|
56
61
|
type: BooleanConstructor;
|
|
57
62
|
default: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tooltip.d.ts","sourceRoot":"","sources":["../../../../directives/tooltip_directive/tooltip.js"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"tooltip.d.ts","sourceRoot":"","sources":["../../../../directives/tooltip_directive/tooltip.js"],"names":[],"mappings":";;IAME,iCA4HC"}
|