@progress/kendo-vue-tooltip 2.7.1-dev.202112201049

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.
@@ -0,0 +1,104 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.isTooltipElement = exports.toolTipSelectors = exports.getDomRect = exports.getTopPosition = exports.getLeftPosition = void 0;
7
+ var arrowWidth = 10;
8
+ var arrowHeight = 10;
9
+ /**
10
+ * @hidden
11
+ */
12
+
13
+ exports.getLeftPosition = function (left, elementWidth, targetElement, anchorElement, position) {
14
+ switch (position) {
15
+ case 'bottom':
16
+ return anchorElement === 'pointer' ? left - elementWidth / 2 : targetElement.left - elementWidth / 2 + targetElement.width / 2;
17
+
18
+ case 'left':
19
+ return anchorElement === 'pointer' ? left - elementWidth - arrowWidth : targetElement.left - elementWidth - arrowWidth;
20
+
21
+ case 'right':
22
+ return anchorElement === 'pointer' ? left + arrowWidth : targetElement.right + arrowWidth;
23
+
24
+ case 'top':
25
+ return anchorElement === 'pointer' ? left - elementWidth / 2 : targetElement.left - elementWidth / 2 + targetElement.width / 2;
26
+
27
+ default:
28
+ if (anchorElement === 'pointer') {
29
+ return left < window.screen.availWidth / 2 ? left - arrowWidth : left - elementWidth + arrowWidth;
30
+ } else {
31
+ return left < window.screen.availWidth / 2 ? targetElement.left : targetElement.right - elementWidth;
32
+ }
33
+
34
+ }
35
+ };
36
+ /**
37
+ * @hidden
38
+ */
39
+
40
+
41
+ exports.getTopPosition = function (top, targetElement, elementHeight, anchorElement, position) {
42
+ switch (position) {
43
+ case 'bottom':
44
+ return anchorElement === 'pointer' ? top + arrowHeight : targetElement.bottom + arrowHeight;
45
+
46
+ case 'left':
47
+ return anchorElement === 'pointer' ? top - elementHeight / 2 : targetElement.top - elementHeight / 2 + targetElement.height / 2;
48
+
49
+ case 'right':
50
+ return anchorElement === 'pointer' ? top - elementHeight / 2 : targetElement.top - elementHeight / 2 + targetElement.height / 2;
51
+
52
+ case 'top':
53
+ return anchorElement === 'pointer' ? top - elementHeight - arrowHeight : targetElement.top - elementHeight - arrowHeight;
54
+
55
+ default:
56
+ if (anchorElement === 'pointer') {
57
+ return top < window.innerHeight / 2 ? top + arrowWidth : top - elementHeight - arrowWidth;
58
+ } else {
59
+ return top < window.innerHeight / 2 ? targetElement.bottom + arrowHeight : targetElement.top - elementHeight - arrowHeight;
60
+ }
61
+
62
+ }
63
+ };
64
+ /**
65
+ * @hidden
66
+ */
67
+
68
+
69
+ exports.getDomRect = function (currentTarget) {
70
+ if (currentTarget !== null) {
71
+ return currentTarget.getBoundingClientRect();
72
+ }
73
+
74
+ return document.body.getBoundingClientRect();
75
+ };
76
+ /**
77
+ * @hidden
78
+ */
79
+
80
+
81
+ exports.toolTipSelectors = ['k-tooltip-content', 'k-animation-container', 'k-tooltip', 'k-tooltip-title', 'k-tooltip k-tooltip-closable', 'k-icon k-i-close'];
82
+ /**
83
+ * @hidden
84
+ */
85
+
86
+ exports.isTooltipElement = function (element) {
87
+ if (element === null) {
88
+ return false;
89
+ }
90
+
91
+ var node = element;
92
+
93
+ while (node) {
94
+ if (node !== null && node.classList && node.classList.contains('k-tooltip')) {
95
+ return true;
96
+ }
97
+
98
+ node.parentNode !== null ? node = node.parentNode : node = false;
99
+ }
100
+
101
+ return exports.toolTipSelectors.filter(function (t) {
102
+ return t === element.className;
103
+ }).length > 0;
104
+ };
package/package.json ADDED
@@ -0,0 +1,53 @@
1
+ {
2
+ "name": "@progress/kendo-vue-tooltip",
3
+ "version": "2.7.1-dev.202112201049",
4
+ "description": "Kendo UI for Vue Tooltip package",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "https://github.com/telerik/kendo-vue.git"
8
+ },
9
+ "main": "dist/npm/main.js",
10
+ "types": "dist/npm/main.d.ts",
11
+ "module": "dist/es/main.js",
12
+ "jsnext:main": "dist/es/main.js",
13
+ "scripts": {
14
+ "test": "cd ../../ && npm run test -- --testPathPattern=/packages/tooltip/.*",
15
+ "start": "gulp start",
16
+ "build-package": "gulp build-package"
17
+ },
18
+ "homepage": "https://www.telerik.com/kendo-vue-ui/",
19
+ "keywords": [
20
+ "Kendo UI",
21
+ "Vue",
22
+ "Progress",
23
+ "Tooltip",
24
+ "Kendo UI for Vue",
25
+ "vuejs",
26
+ "UI",
27
+ "components",
28
+ "Vue component",
29
+ "Telerik"
30
+ ],
31
+ "peerDependencies": {
32
+ "@progress/kendo-licensing": "^1.0.1",
33
+ "vue": "^2.6.12 || ^3.0.2"
34
+ },
35
+ "dependencies": {
36
+ "@progress/kendo-vue-common": "2.7.1-dev.202112201049"
37
+ },
38
+ "devDependencies": {
39
+ "@progress/kendo-licensing": "^1.0.1",
40
+ "@progress/kendo-vue-dialogs": "2.7.1-dev.202112201049",
41
+ "@progress/kendo-vue-grid": "2.7.1-dev.202112201049",
42
+ "@progress/kendo-vue-intl": "2.7.1-dev.202112201049"
43
+ },
44
+ "@progress": {
45
+ "friendlyName": "Tooltip",
46
+ "framework": "Kendo UI for Vue"
47
+ },
48
+ "author": "Progress",
49
+ "license": "SEE LICENSE IN LICENSE.md",
50
+ "publishConfig": {
51
+ "access": "public"
52
+ }
53
+ }