@workday/canvas-kit-react 5.2.10 → 5.2.11
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/commonjs/tooltip/lib/OverflowTooltip.d.ts +10 -0
- package/dist/commonjs/tooltip/lib/OverflowTooltip.d.ts.map +1 -1
- package/dist/commonjs/tooltip/lib/OverflowTooltip.js +8 -6
- package/dist/es6/tooltip/lib/OverflowTooltip.d.ts +10 -0
- package/dist/es6/tooltip/lib/OverflowTooltip.d.ts.map +1 -1
- package/dist/es6/tooltip/lib/OverflowTooltip.js +5 -3
- package/package.json +5 -5
- package/tooltip/lib/OverflowTooltip.tsx +5 -3
- package/ts3.5/dist/commonjs/tooltip/lib/OverflowTooltip.d.ts +10 -0
- package/ts3.5/dist/es6/tooltip/lib/OverflowTooltip.d.ts +10 -0
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { Placement } from '@workday/canvas-kit-react/popup';
|
|
3
|
+
/**
|
|
4
|
+
* Look for an element within the tree for an overflow element (auto, scroll, clip, or hidden).
|
|
5
|
+
* This could be the passed element, or a descendant. If no element is found, `null` is returned.
|
|
6
|
+
*/
|
|
7
|
+
export declare const findOverflowElement: (element: Element) => Element | null;
|
|
8
|
+
/**
|
|
9
|
+
* Look for an element within the tree for a `text-overflow` CSS property of `ellipsis`.
|
|
10
|
+
* This could be the passed element, or a descendant. If no element is found, `null` is returned.
|
|
11
|
+
*/
|
|
12
|
+
export declare const findEllipsisElement: (element: Element) => Element | null;
|
|
3
13
|
export interface OverflowTooltipProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'title'> {
|
|
4
14
|
/**
|
|
5
15
|
* The target (anchor element) for the Tooltip.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OverflowTooltip.d.ts","sourceRoot":"","sources":["../../../../tooltip/lib/OverflowTooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAA4B,SAAS,EAAS,MAAM,iCAAiC,CAAC;
|
|
1
|
+
{"version":3,"file":"OverflowTooltip.d.ts","sourceRoot":"","sources":["../../../../tooltip/lib/OverflowTooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAA4B,SAAS,EAAS,MAAM,iCAAiC,CAAC;AAM7F;;;GAGG;AACH,eAAO,MAAM,mBAAmB,sCAoB/B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,mBAAmB,sCAe/B,CAAC;AAcF,MAAM,WAAW,oBAAqB,SAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,OAAO,CAAC;IAC/F;;;;;;;OAOG;IACH,QAAQ,EAAE,KAAK,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC;IAClC;;;OAGG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB;AAiBD,eAAO,MAAM,eAAe,8EA4C3B,CAAC"}
|
|
@@ -38,7 +38,7 @@ var useTooltip_1 = require("./useTooltip");
|
|
|
38
38
|
* Look for an element within the tree for an overflow element (auto, scroll, clip, or hidden).
|
|
39
39
|
* This could be the passed element, or a descendant. If no element is found, `null` is returned.
|
|
40
40
|
*/
|
|
41
|
-
|
|
41
|
+
exports.findOverflowElement = function (element) {
|
|
42
42
|
var style = getComputedStyle(element);
|
|
43
43
|
if (style.overflow === 'auto' ||
|
|
44
44
|
style.overflow === 'scroll' ||
|
|
@@ -49,7 +49,7 @@ var findOverflowElement = function (element) {
|
|
|
49
49
|
else if (element.children) {
|
|
50
50
|
// `children` is not defined for SVGElement in IE11
|
|
51
51
|
for (var i = 0; i < element.children.length; i++) {
|
|
52
|
-
var overflowElement = findOverflowElement(element.children[i]);
|
|
52
|
+
var overflowElement = exports.findOverflowElement(element.children[i]);
|
|
53
53
|
if (overflowElement) {
|
|
54
54
|
return overflowElement;
|
|
55
55
|
}
|
|
@@ -62,23 +62,25 @@ var findOverflowElement = function (element) {
|
|
|
62
62
|
* Look for an element within the tree for a `text-overflow` CSS property of `ellipsis`.
|
|
63
63
|
* This could be the passed element, or a descendant. If no element is found, `null` is returned.
|
|
64
64
|
*/
|
|
65
|
-
|
|
65
|
+
exports.findEllipsisElement = function (element) {
|
|
66
66
|
var style = getComputedStyle(element);
|
|
67
67
|
if (style.textOverflow === 'ellipsis' || Number(style.webkitLineClamp) > 0) {
|
|
68
68
|
return element;
|
|
69
69
|
}
|
|
70
|
-
else {
|
|
70
|
+
else if (element.children) {
|
|
71
|
+
// `children` is not defined for SVGElement in IE11
|
|
71
72
|
for (var i = 0; i < element.children.length; i++) {
|
|
72
|
-
var overflowElement = findEllipsisElement(element.children[i]);
|
|
73
|
+
var overflowElement = exports.findEllipsisElement(element.children[i]);
|
|
73
74
|
if (overflowElement) {
|
|
74
75
|
return overflowElement;
|
|
75
76
|
}
|
|
76
77
|
}
|
|
77
78
|
return null;
|
|
78
79
|
}
|
|
80
|
+
return null;
|
|
79
81
|
};
|
|
80
82
|
var isOverflowed = function (element) {
|
|
81
|
-
var overflowElement = findEllipsisElement(element) || findOverflowElement(element);
|
|
83
|
+
var overflowElement = exports.findEllipsisElement(element) || exports.findOverflowElement(element);
|
|
82
84
|
if (overflowElement) {
|
|
83
85
|
return (overflowElement.scrollWidth > overflowElement.clientWidth ||
|
|
84
86
|
overflowElement.scrollHeight > overflowElement.clientHeight);
|
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { Placement } from '@workday/canvas-kit-react/popup';
|
|
3
|
+
/**
|
|
4
|
+
* Look for an element within the tree for an overflow element (auto, scroll, clip, or hidden).
|
|
5
|
+
* This could be the passed element, or a descendant. If no element is found, `null` is returned.
|
|
6
|
+
*/
|
|
7
|
+
export declare const findOverflowElement: (element: Element) => Element | null;
|
|
8
|
+
/**
|
|
9
|
+
* Look for an element within the tree for a `text-overflow` CSS property of `ellipsis`.
|
|
10
|
+
* This could be the passed element, or a descendant. If no element is found, `null` is returned.
|
|
11
|
+
*/
|
|
12
|
+
export declare const findEllipsisElement: (element: Element) => Element | null;
|
|
3
13
|
export interface OverflowTooltipProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'title'> {
|
|
4
14
|
/**
|
|
5
15
|
* The target (anchor element) for the Tooltip.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OverflowTooltip.d.ts","sourceRoot":"","sources":["../../../../tooltip/lib/OverflowTooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAA4B,SAAS,EAAS,MAAM,iCAAiC,CAAC;
|
|
1
|
+
{"version":3,"file":"OverflowTooltip.d.ts","sourceRoot":"","sources":["../../../../tooltip/lib/OverflowTooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAA4B,SAAS,EAAS,MAAM,iCAAiC,CAAC;AAM7F;;;GAGG;AACH,eAAO,MAAM,mBAAmB,sCAoB/B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,mBAAmB,sCAe/B,CAAC;AAcF,MAAM,WAAW,oBAAqB,SAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,OAAO,CAAC;IAC/F;;;;;;;OAOG;IACH,QAAQ,EAAE,KAAK,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC;IAClC;;;OAGG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB;AAiBD,eAAO,MAAM,eAAe,8EA4C3B,CAAC"}
|
|
@@ -29,7 +29,7 @@ import { useTooltip } from './useTooltip';
|
|
|
29
29
|
* Look for an element within the tree for an overflow element (auto, scroll, clip, or hidden).
|
|
30
30
|
* This could be the passed element, or a descendant. If no element is found, `null` is returned.
|
|
31
31
|
*/
|
|
32
|
-
var findOverflowElement = function (element) {
|
|
32
|
+
export var findOverflowElement = function (element) {
|
|
33
33
|
var style = getComputedStyle(element);
|
|
34
34
|
if (style.overflow === 'auto' ||
|
|
35
35
|
style.overflow === 'scroll' ||
|
|
@@ -53,12 +53,13 @@ var findOverflowElement = function (element) {
|
|
|
53
53
|
* Look for an element within the tree for a `text-overflow` CSS property of `ellipsis`.
|
|
54
54
|
* This could be the passed element, or a descendant. If no element is found, `null` is returned.
|
|
55
55
|
*/
|
|
56
|
-
var findEllipsisElement = function (element) {
|
|
56
|
+
export var findEllipsisElement = function (element) {
|
|
57
57
|
var style = getComputedStyle(element);
|
|
58
58
|
if (style.textOverflow === 'ellipsis' || Number(style.webkitLineClamp) > 0) {
|
|
59
59
|
return element;
|
|
60
60
|
}
|
|
61
|
-
else {
|
|
61
|
+
else if (element.children) {
|
|
62
|
+
// `children` is not defined for SVGElement in IE11
|
|
62
63
|
for (var i = 0; i < element.children.length; i++) {
|
|
63
64
|
var overflowElement = findEllipsisElement(element.children[i]);
|
|
64
65
|
if (overflowElement) {
|
|
@@ -67,6 +68,7 @@ var findEllipsisElement = function (element) {
|
|
|
67
68
|
}
|
|
68
69
|
return null;
|
|
69
70
|
}
|
|
71
|
+
return null;
|
|
70
72
|
};
|
|
71
73
|
var isOverflowed = function (element) {
|
|
72
74
|
var overflowElement = findEllipsisElement(element) || findOverflowElement(element);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@workday/canvas-kit-react",
|
|
3
|
-
"version": "5.2.
|
|
3
|
+
"version": "5.2.11",
|
|
4
4
|
"description": "The parent module that contains all Workday Canvas Kit React components",
|
|
5
5
|
"author": "Workday, Inc. (https://www.workday.com)",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -57,9 +57,9 @@
|
|
|
57
57
|
"@popperjs/core": "^2.5.4",
|
|
58
58
|
"@workday/canvas-colors-web": "^2.0.0",
|
|
59
59
|
"@workday/canvas-depth-web": "^0.16.4",
|
|
60
|
-
"@workday/canvas-kit-labs-react": "^5.2.
|
|
61
|
-
"@workday/canvas-kit-popup-stack": "^5.2.
|
|
62
|
-
"@workday/canvas-kit-preview-react": "^5.2.
|
|
60
|
+
"@workday/canvas-kit-labs-react": "^5.2.11",
|
|
61
|
+
"@workday/canvas-kit-popup-stack": "^5.2.11",
|
|
62
|
+
"@workday/canvas-kit-preview-react": "^5.2.11",
|
|
63
63
|
"@workday/canvas-system-icons-web": "1.0.41",
|
|
64
64
|
"@workday/design-assets-types": "^0.2.4",
|
|
65
65
|
"chroma-js": "^2.1.0",
|
|
@@ -75,5 +75,5 @@
|
|
|
75
75
|
"@workday/canvas-accent-icons-web": "^1.0.0",
|
|
76
76
|
"@workday/canvas-applet-icons-web": "^0.17.50"
|
|
77
77
|
},
|
|
78
|
-
"gitHead": "
|
|
78
|
+
"gitHead": "1fba31836daf2b965432b99a4bd857694fda7e0c"
|
|
79
79
|
}
|
|
@@ -10,7 +10,7 @@ import {useTooltip} from './useTooltip';
|
|
|
10
10
|
* Look for an element within the tree for an overflow element (auto, scroll, clip, or hidden).
|
|
11
11
|
* This could be the passed element, or a descendant. If no element is found, `null` is returned.
|
|
12
12
|
*/
|
|
13
|
-
const findOverflowElement = (element: Element): Element | null => {
|
|
13
|
+
export const findOverflowElement = (element: Element): Element | null => {
|
|
14
14
|
const style = getComputedStyle(element);
|
|
15
15
|
if (
|
|
16
16
|
style.overflow === 'auto' ||
|
|
@@ -36,11 +36,12 @@ const findOverflowElement = (element: Element): Element | null => {
|
|
|
36
36
|
* Look for an element within the tree for a `text-overflow` CSS property of `ellipsis`.
|
|
37
37
|
* This could be the passed element, or a descendant. If no element is found, `null` is returned.
|
|
38
38
|
*/
|
|
39
|
-
const findEllipsisElement = (element: Element): Element | null => {
|
|
39
|
+
export const findEllipsisElement = (element: Element): Element | null => {
|
|
40
40
|
const style = getComputedStyle(element);
|
|
41
41
|
if (style.textOverflow === 'ellipsis' || Number(style.webkitLineClamp) > 0) {
|
|
42
42
|
return element;
|
|
43
|
-
} else {
|
|
43
|
+
} else if (element.children) {
|
|
44
|
+
// `children` is not defined for SVGElement in IE11
|
|
44
45
|
for (let i = 0; i < element.children.length; i++) {
|
|
45
46
|
const overflowElement = findEllipsisElement(element.children[i]);
|
|
46
47
|
if (overflowElement) {
|
|
@@ -49,6 +50,7 @@ const findEllipsisElement = (element: Element): Element | null => {
|
|
|
49
50
|
}
|
|
50
51
|
return null;
|
|
51
52
|
}
|
|
53
|
+
return null;
|
|
52
54
|
};
|
|
53
55
|
|
|
54
56
|
const isOverflowed = (element: Element) => {
|
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { Placement } from '@workday/canvas-kit-react/popup';
|
|
3
|
+
/**
|
|
4
|
+
* Look for an element within the tree for an overflow element (auto, scroll, clip, or hidden).
|
|
5
|
+
* This could be the passed element, or a descendant. If no element is found, `null` is returned.
|
|
6
|
+
*/
|
|
7
|
+
export declare const findOverflowElement: (element: Element) => Element | null;
|
|
8
|
+
/**
|
|
9
|
+
* Look for an element within the tree for a `text-overflow` CSS property of `ellipsis`.
|
|
10
|
+
* This could be the passed element, or a descendant. If no element is found, `null` is returned.
|
|
11
|
+
*/
|
|
12
|
+
export declare const findEllipsisElement: (element: Element) => Element | null;
|
|
3
13
|
export interface OverflowTooltipProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'title'> {
|
|
4
14
|
/**
|
|
5
15
|
* The target (anchor element) for the Tooltip.
|
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { Placement } from '@workday/canvas-kit-react/popup';
|
|
3
|
+
/**
|
|
4
|
+
* Look for an element within the tree for an overflow element (auto, scroll, clip, or hidden).
|
|
5
|
+
* This could be the passed element, or a descendant. If no element is found, `null` is returned.
|
|
6
|
+
*/
|
|
7
|
+
export declare const findOverflowElement: (element: Element) => Element | null;
|
|
8
|
+
/**
|
|
9
|
+
* Look for an element within the tree for a `text-overflow` CSS property of `ellipsis`.
|
|
10
|
+
* This could be the passed element, or a descendant. If no element is found, `null` is returned.
|
|
11
|
+
*/
|
|
12
|
+
export declare const findEllipsisElement: (element: Element) => Element | null;
|
|
3
13
|
export interface OverflowTooltipProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'title'> {
|
|
4
14
|
/**
|
|
5
15
|
* The target (anchor element) for the Tooltip.
|