@dialpad/dialtone-vue 2.101.1 → 2.102.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/CHANGELOG.json +1 -1
- package/CHANGELOG.md +16 -0
- package/dist/_plugin-vue2_normalizer-71e2aa87.js +32 -0
- package/dist/_plugin-vue2_normalizer-d59b995e.cjs +1 -0
- package/dist/component-documentation.json +1 -1
- package/dist/dialtone-vue.cjs +6 -30
- package/dist/dialtone-vue.js +2430 -4901
- package/dist/directives.cjs +1 -0
- package/dist/directives.js +109 -0
- package/dist/emoji-9ef04a92.cjs +1 -0
- package/dist/{emoji-c718e3bb.js → emoji-efd28b85.js} +3180 -3152
- package/dist/emoji.cjs +1 -1
- package/dist/emoji.js +21 -20
- package/dist/style.css +1 -1
- package/dist/tooltip-6726b38f.cjs +25 -0
- package/dist/tooltip-dc246ca8.js +2515 -0
- package/dist/types/components/tooltip/tooltip.vue.d.ts +20 -4
- package/dist/types/components/tooltip/tooltip.vue.d.ts.map +1 -1
- package/dist/types/components/tooltip/tooltip_variants.vue.d.ts +1 -0
- package/dist/types/directives/tooltip/index.d.ts +2 -0
- package/dist/types/directives/tooltip/index.d.ts.map +1 -0
- package/dist/types/directives/tooltip/tooltip.d.ts +6 -0
- package/dist/types/directives/tooltip/tooltip.d.ts.map +1 -0
- package/dist/types/directives.d.ts +2 -0
- package/dist/types/directives.d.ts.map +1 -0
- package/package.json +16 -6
- package/dist/emoji-4797a56d.cjs +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./tooltip-6726b38f.cjs");require("vue");require("./_plugin-vue2_normalizer-d59b995e.cjs");const T={name:"dt-tooltip-directive",install(d){const l=document.createElement("div");document.body.appendChild(l);const a="top",i=new d({el:l,name:"DtTooltipDirectiveApp",components:{DtTooltip:n.DtTooltip},data(){return{tooltips:[]}},methods:{addTooltip(t,o,e){this.tooltips.push({id:t,message:o,placement:e,show:!1})},hideTooltip(t){const o=this.tooltips.findIndex(e=>e.id===t);this.tooltips[o].show=!1},removeTooltip(t){this.tooltips=this.tooltips.filter(o=>o.id!==t)},showTooltip(t){const o=this.tooltips.findIndex(e=>e.id===t);this.tooltips[o].show=!0}},render(t){return t("div",{domProps:{id:"dt-tooltip-directive-app"}},[this.tooltips.map(({id:o,message:e,placement:r,show:s})=>t(n.DtTooltip,{key:o,props:{message:e,placement:r,show:s,externalAnchor:`[data-dt-tooltip-id="${o}"]`}}))])}}),u=t=>typeof t=="string"&&(t==null?void 0:t.trim()),v=t=>t===void 0||n.TOOLTIP_DIRECTIONS.includes(t);function p(t){const o=t.target.getAttribute("data-dt-tooltip-id");i.showTooltip(o)}function c(t){if(t.type==="keydown"&&t.code!=="Escape")return;const o=t.target.getAttribute("data-dt-tooltip-id");i.hideTooltip(o)}function f(t){["focusin","mouseenter"].forEach(o=>{t.addEventListener(o,e=>p(e))}),["focusout","mouseleave","keydown"].forEach(o=>{t.addEventListener(o,e=>c(e))})}function m(t){["focusin","mouseenter"].forEach(o=>{t.removeEventListener(o,e=>p(e))}),["focusout","mouseleave","keydown"].forEach(o=>{t.removeEventListener(o,e=>c(e))})}d.directive("dt-tooltip",{bind(t,o){if(!u(o.value)){console.warn("Missing value for v-dt-tooltip directive on: ",t,"received value: ",o.value);return}if(!v(o.arg)){console.warn("Wrong placement value provided for v-dt-tooltip directive on: ",t,"received value: ",o.arg);return}const e=n.getUniqueString(),r=o.value,s=o.arg||a;t.setAttribute("data-dt-tooltip-id",e),i.addTooltip(e,r,s),f(t)},unbind(t){m(t),i.removeTooltip(t.getAttribute("data-dt-tooltip-id"))}})}};exports.DtTooltipDirective=T;
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { D as a, g as T, T as h } from "./tooltip-dc246ca8.js";
|
|
2
|
+
import "vue";
|
|
3
|
+
import "./_plugin-vue2_normalizer-71e2aa87.js";
|
|
4
|
+
const A = {
|
|
5
|
+
name: "dt-tooltip-directive",
|
|
6
|
+
install(d) {
|
|
7
|
+
const r = document.createElement("div");
|
|
8
|
+
document.body.appendChild(r);
|
|
9
|
+
const c = "top", i = new d({
|
|
10
|
+
el: r,
|
|
11
|
+
name: "DtTooltipDirectiveApp",
|
|
12
|
+
components: { DtTooltip: a },
|
|
13
|
+
data() {
|
|
14
|
+
return {
|
|
15
|
+
tooltips: []
|
|
16
|
+
};
|
|
17
|
+
},
|
|
18
|
+
methods: {
|
|
19
|
+
addTooltip(t, o, e) {
|
|
20
|
+
this.tooltips.push({ id: t, message: o, placement: e, show: !1 });
|
|
21
|
+
},
|
|
22
|
+
hideTooltip(t) {
|
|
23
|
+
const o = this.tooltips.findIndex((e) => e.id === t);
|
|
24
|
+
this.tooltips[o].show = !1;
|
|
25
|
+
},
|
|
26
|
+
removeTooltip(t) {
|
|
27
|
+
this.tooltips = this.tooltips.filter((o) => o.id !== t);
|
|
28
|
+
},
|
|
29
|
+
showTooltip(t) {
|
|
30
|
+
const o = this.tooltips.findIndex((e) => e.id === t);
|
|
31
|
+
this.tooltips[o].show = !0;
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
render(t) {
|
|
35
|
+
return t(
|
|
36
|
+
"div",
|
|
37
|
+
{
|
|
38
|
+
domProps: { id: "dt-tooltip-directive-app" }
|
|
39
|
+
},
|
|
40
|
+
[
|
|
41
|
+
this.tooltips.map(({ id: o, message: e, placement: n, show: s }) => t(a, {
|
|
42
|
+
key: o,
|
|
43
|
+
props: {
|
|
44
|
+
message: e,
|
|
45
|
+
placement: n,
|
|
46
|
+
show: s,
|
|
47
|
+
externalAnchor: `[data-dt-tooltip-id="${o}"]`
|
|
48
|
+
}
|
|
49
|
+
}))
|
|
50
|
+
]
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
}), u = (t) => typeof t == "string" && (t == null ? void 0 : t.trim()), m = (t) => t === void 0 || h.includes(t);
|
|
54
|
+
function p(t) {
|
|
55
|
+
const o = t.target.getAttribute("data-dt-tooltip-id");
|
|
56
|
+
i.showTooltip(o);
|
|
57
|
+
}
|
|
58
|
+
function l(t) {
|
|
59
|
+
if (t.type === "keydown" && t.code !== "Escape")
|
|
60
|
+
return;
|
|
61
|
+
const o = t.target.getAttribute("data-dt-tooltip-id");
|
|
62
|
+
i.hideTooltip(o);
|
|
63
|
+
}
|
|
64
|
+
function v(t) {
|
|
65
|
+
["focusin", "mouseenter"].forEach((o) => {
|
|
66
|
+
t.addEventListener(o, (e) => p(e));
|
|
67
|
+
}), ["focusout", "mouseleave", "keydown"].forEach((o) => {
|
|
68
|
+
t.addEventListener(o, (e) => l(e));
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
function f(t) {
|
|
72
|
+
["focusin", "mouseenter"].forEach((o) => {
|
|
73
|
+
t.removeEventListener(o, (e) => p(e));
|
|
74
|
+
}), ["focusout", "mouseleave", "keydown"].forEach((o) => {
|
|
75
|
+
t.removeEventListener(o, (e) => l(e));
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
d.directive("dt-tooltip", {
|
|
79
|
+
bind(t, o) {
|
|
80
|
+
if (!u(o.value)) {
|
|
81
|
+
console.warn(
|
|
82
|
+
"Missing value for v-dt-tooltip directive on: ",
|
|
83
|
+
t,
|
|
84
|
+
"received value: ",
|
|
85
|
+
o.value
|
|
86
|
+
);
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
if (!m(o.arg)) {
|
|
90
|
+
console.warn(
|
|
91
|
+
"Wrong placement value provided for v-dt-tooltip directive on: ",
|
|
92
|
+
t,
|
|
93
|
+
"received value: ",
|
|
94
|
+
o.arg
|
|
95
|
+
);
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
const e = T(), n = o.value, s = o.arg || c;
|
|
99
|
+
t.setAttribute("data-dt-tooltip-id", e), i.addTooltip(e, n, s), v(t);
|
|
100
|
+
},
|
|
101
|
+
unbind(t) {
|
|
102
|
+
f(t), i.removeTooltip(t.getAttribute("data-dt-tooltip-id"));
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
export {
|
|
108
|
+
A as DtTooltipDirective
|
|
109
|
+
};
|