@dynatrace/strato-components 0.85.110 → 1.0.0
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/buttons/button/Button.css +17 -17
- package/buttons/button/Button.js +1 -1
- package/buttons/button/Button.sty.js +4 -4
- package/content/progress/ProgressBar.css +71 -71
- package/content/progress/ProgressBar.d.ts +0 -7
- package/content/progress/ProgressBar.js +19 -45
- package/content/progress/ProgressBar.sty.js +5 -5
- package/content/progress/ProgressBarIcon.css +2 -2
- package/content/progress/ProgressBarIcon.sty.js +1 -1
- package/content/progress/ProgressBarLabel.css +3 -3
- package/content/progress/ProgressBarLabel.js +1 -1
- package/content/progress/ProgressBarLabel.sty.js +1 -1
- package/content/progress/ProgressBarValue.css +5 -5
- package/content/progress/ProgressBarValue.js +1 -1
- package/content/progress/ProgressBarValue.sty.js +1 -1
- package/content/progress/ProgressCircle.css +40 -40
- package/content/progress/ProgressCircle.d.ts +0 -7
- package/content/progress/ProgressCircle.js +2 -10
- package/content/progress/ProgressCircle.sty.js +5 -5
- package/content/progress/hooks/useProgressBarPropsContext.d.ts +5 -2
- package/content/progress/hooks/useProgressBarPropsContext.js +2 -2
- package/content/skeleton/Skeleton.css +6 -6
- package/content/skeleton/Skeleton.sty.js +1 -1
- package/core/components/app-root/AppRoot.css +0 -57
- package/core/hooks/useFontsUpdated.d.ts +1 -1
- package/core/hooks/useFontsUpdated.js +2 -2
- package/core/index.d.ts +0 -2
- package/core/index.js +0 -2
- package/core/styles/focusRing.css +66 -66
- package/core/styles/focusRing.sty.js +2 -2
- package/core/utils/colorUtils.css +60 -60
- package/core/utils/colorUtils.sty.js +2 -2
- package/esm/buttons/button/Button.css +17 -17
- package/esm/buttons/button/Button.js +1 -1
- package/esm/buttons/button/Button.js.map +2 -2
- package/esm/buttons/button/Button.sty.js +4 -4
- package/esm/buttons/button/Button.sty.js.map +2 -2
- package/esm/content/progress/ProgressBar.css +71 -71
- package/esm/content/progress/ProgressBar.js +19 -45
- package/esm/content/progress/ProgressBar.js.map +2 -2
- package/esm/content/progress/ProgressBar.sty.js +5 -5
- package/esm/content/progress/ProgressBar.sty.js.map +2 -2
- package/esm/content/progress/ProgressBarIcon.css +2 -2
- package/esm/content/progress/ProgressBarIcon.sty.js +1 -1
- package/esm/content/progress/ProgressBarIcon.sty.js.map +1 -1
- package/esm/content/progress/ProgressBarLabel.css +3 -3
- package/esm/content/progress/ProgressBarLabel.js +2 -2
- package/esm/content/progress/ProgressBarLabel.js.map +2 -2
- package/esm/content/progress/ProgressBarLabel.sty.js +1 -1
- package/esm/content/progress/ProgressBarLabel.sty.js.map +2 -2
- package/esm/content/progress/ProgressBarValue.css +5 -5
- package/esm/content/progress/ProgressBarValue.js +2 -2
- package/esm/content/progress/ProgressBarValue.js.map +2 -2
- package/esm/content/progress/ProgressBarValue.sty.js +1 -1
- package/esm/content/progress/ProgressBarValue.sty.js.map +2 -2
- package/esm/content/progress/ProgressCircle.css +40 -40
- package/esm/content/progress/ProgressCircle.js +2 -10
- package/esm/content/progress/ProgressCircle.js.map +2 -2
- package/esm/content/progress/ProgressCircle.sty.js +5 -5
- package/esm/content/progress/ProgressCircle.sty.js.map +2 -2
- package/esm/content/progress/hooks/useProgressBarPropsContext.js +2 -2
- package/esm/content/progress/hooks/useProgressBarPropsContext.js.map +2 -2
- package/esm/content/skeleton/Skeleton.css +6 -6
- package/esm/content/skeleton/Skeleton.sty.js +1 -1
- package/esm/content/skeleton/Skeleton.sty.js.map +2 -2
- package/esm/core/components/app-root/AppRoot.css +0 -57
- package/esm/core/hooks/useFontsUpdated.js +2 -2
- package/esm/core/hooks/useFontsUpdated.js.map +2 -2
- package/esm/core/index.js +0 -2
- package/esm/core/index.js.map +2 -2
- package/esm/core/styles/focusRing.css +66 -66
- package/esm/core/styles/focusRing.sty.js +2 -2
- package/esm/core/styles/focusRing.sty.js.map +2 -2
- package/esm/core/utils/colorUtils.css +60 -60
- package/esm/core/utils/colorUtils.sty.js +2 -2
- package/esm/core/utils/colorUtils.sty.js.map +2 -2
- package/esm/layouts/container/Container.css +4 -4
- package/esm/layouts/container/Container.sty.js +1 -1
- package/esm/layouts/container/Container.sty.js.map +1 -1
- package/esm/layouts/divider/Divider.css +6 -6
- package/esm/layouts/divider/Divider.sty.js +1 -1
- package/esm/layouts/divider/Divider.sty.js.map +2 -2
- package/esm/layouts/input-group/InputGroup.css +4 -4
- package/esm/layouts/input-group/InputGroup.sty.js +2 -2
- package/esm/layouts/input-group/InputGroup.sty.js.map +1 -1
- package/esm/layouts/surface/Surface.css +39 -39
- package/esm/layouts/surface/Surface.sty.js +2 -2
- package/esm/layouts/surface/Surface.sty.js.map +2 -2
- package/esm/layouts/surface/variables.sty.js +1 -1
- package/esm/layouts/surface/variables.sty.js.map +1 -1
- package/esm/styles/colorUtils.css +60 -60
- package/esm/styles/colorUtils.sty.js +2 -2
- package/esm/styles/colorUtils.sty.js.map +2 -2
- package/esm/styles/container.css +47 -47
- package/esm/styles/container.sty.js +2 -2
- package/esm/styles/container.sty.js.map +2 -2
- package/esm/styles/ellipsis.css +1 -1
- package/esm/styles/ellipsis.sty.js +1 -1
- package/esm/styles/ellipsis.sty.js.map +1 -1
- package/esm/styles/field.css +153 -153
- package/esm/styles/field.sty.js +2 -2
- package/esm/styles/field.sty.js.map +2 -2
- package/esm/styles/sprinkles.css +262 -262
- package/esm/styles/sprinkles.sty.js +1 -1
- package/esm/styles/sprinkles.sty.js.map +2 -2
- package/esm/styles/textStyle.css +8 -8
- package/esm/styles/textStyle.sty.js +1 -1
- package/esm/styles/textStyle.sty.js.map +2 -2
- package/esm/typography/block-quote/Blockquote.css +2 -2
- package/esm/typography/block-quote/Blockquote.sty.js +1 -1
- package/esm/typography/block-quote/Blockquote.sty.js.map +1 -1
- package/esm/typography/code/Code.css +1 -1
- package/esm/typography/code/Code.sty.js +1 -1
- package/esm/typography/code/Code.sty.js.map +1 -1
- package/esm/typography/emphasis/Emphasis.css +1 -1
- package/esm/typography/emphasis/Emphasis.sty.js +1 -1
- package/esm/typography/emphasis/Emphasis.sty.js.map +1 -1
- package/esm/typography/external-link/ExternalLink.css +6 -6
- package/esm/typography/external-link/ExternalLink.sty.js +1 -1
- package/esm/typography/external-link/ExternalLink.sty.js.map +1 -1
- package/esm/typography/heading/Heading.css +7 -7
- package/esm/typography/heading/Heading.sty.js +1 -1
- package/esm/typography/heading/Heading.sty.js.map +2 -2
- package/esm/typography/highlight/Highlight.css +1 -1
- package/esm/typography/highlight/Highlight.sty.js +1 -1
- package/esm/typography/highlight/Highlight.sty.js.map +1 -1
- package/esm/typography/index.js +12 -12
- package/esm/typography/index.js.map +2 -2
- package/esm/typography/link/Link.css +4 -4
- package/esm/typography/link/Link.sty.js +1 -1
- package/esm/typography/link/Link.sty.js.map +1 -1
- package/esm/typography/list/List.css +4 -4
- package/esm/typography/list/List.sty.js +2 -2
- package/esm/typography/list/List.sty.js.map +1 -1
- package/esm/typography/paragraph/Paragraph.css +3 -3
- package/esm/typography/paragraph/Paragraph.sty.js +1 -1
- package/esm/typography/paragraph/Paragraph.sty.js.map +2 -2
- package/esm/typography/strikethrough/Strikethrough.css +1 -1
- package/esm/typography/strikethrough/Strikethrough.sty.js +1 -1
- package/esm/typography/strikethrough/Strikethrough.sty.js.map +1 -1
- package/esm/typography/strong/Strong.css +1 -1
- package/esm/typography/strong/Strong.sty.js +1 -1
- package/esm/typography/strong/Strong.sty.js.map +1 -1
- package/esm/typography/text/Text.css +3 -3
- package/esm/typography/text/Text.sty.js +1 -1
- package/esm/typography/text/Text.sty.js.map +2 -2
- package/esm/typography/text-ellipsis/TextEllipsis.css +4 -4
- package/esm/typography/text-ellipsis/TextEllipsis.js +45 -45
- package/esm/typography/text-ellipsis/TextEllipsis.js.map +2 -2
- package/esm/typography/text-ellipsis/TextEllipsis.sty.js +1 -1
- package/esm/typography/text-ellipsis/TextEllipsis.sty.js.map +2 -2
- package/esm/typography/utils.js +19 -19
- package/esm/typography/utils.js.map +2 -2
- package/layouts/container/Container.css +4 -4
- package/layouts/container/Container.sty.js +1 -1
- package/layouts/divider/Divider.css +6 -6
- package/layouts/divider/Divider.sty.js +1 -1
- package/layouts/input-group/InputGroup.css +4 -4
- package/layouts/input-group/InputGroup.sty.js +2 -2
- package/layouts/surface/Surface.css +39 -39
- package/layouts/surface/Surface.sty.js +2 -2
- package/layouts/surface/variables.sty.js +1 -1
- package/package.json +15 -26
- package/styles/colorUtils.css +60 -60
- package/styles/colorUtils.sty.js +2 -2
- package/styles/container.css +47 -47
- package/styles/container.sty.js +2 -2
- package/styles/ellipsis.css +1 -1
- package/styles/ellipsis.sty.js +1 -1
- package/styles/field.css +153 -153
- package/styles/field.sty.js +2 -2
- package/styles/sprinkles.css +262 -262
- package/styles/sprinkles.sty.js +1 -1
- package/styles/textStyle.css +8 -8
- package/styles/textStyle.sty.js +1 -1
- package/typography/block-quote/Blockquote.css +2 -2
- package/typography/block-quote/Blockquote.sty.js +1 -1
- package/typography/code/Code.css +1 -1
- package/typography/code/Code.sty.js +1 -1
- package/typography/emphasis/Emphasis.css +1 -1
- package/typography/emphasis/Emphasis.sty.js +1 -1
- package/typography/external-link/ExternalLink.css +6 -6
- package/typography/external-link/ExternalLink.sty.js +1 -1
- package/typography/heading/Heading.css +7 -7
- package/typography/heading/Heading.sty.js +1 -1
- package/typography/highlight/Highlight.css +1 -1
- package/typography/highlight/Highlight.sty.js +1 -1
- package/typography/index.d.ts +3 -3
- package/typography/index.js +6 -6
- package/typography/link/Link.css +4 -4
- package/typography/link/Link.sty.js +1 -1
- package/typography/list/List.css +4 -4
- package/typography/list/List.sty.js +2 -2
- package/typography/paragraph/Paragraph.css +3 -3
- package/typography/paragraph/Paragraph.sty.js +1 -1
- package/typography/strikethrough/Strikethrough.css +1 -1
- package/typography/strikethrough/Strikethrough.sty.js +1 -1
- package/typography/strong/Strong.css +1 -1
- package/typography/strong/Strong.sty.js +1 -1
- package/typography/text/Text.css +3 -3
- package/typography/text/Text.sty.js +1 -1
- package/typography/text-ellipsis/TextEllipsis.css +4 -4
- package/typography/text-ellipsis/TextEllipsis.d.ts +2 -2
- package/typography/text-ellipsis/TextEllipsis.js +44 -44
- package/typography/text-ellipsis/TextEllipsis.sty.js +1 -1
- package/typography/utils.d.ts +14 -11
- package/typography/utils.js +19 -19
- package/core/types/role-variant.d.ts +0 -12
- package/core/types/role-variant.js +0 -30
- package/esm/core/types/role-variant.js +0 -12
- package/esm/core/types/role-variant.js.map +0 -7
- package/testing/custom-render.d.ts +0 -12
- package/testing/custom-render.js +0 -62
- package/testing/index.d.ts +0 -22
- package/testing/index.js +0 -91
- package/testing/jest/index.d.ts +0 -1
- package/testing/jest/index.js +0 -5
- package/testing/jest/jest-preset.d.ts +0 -10
- package/testing/jest/jest-preset.js +0 -13
- package/testing/jest/resolver.d.ts +0 -0
- package/testing/jest/resolver.js +0 -27
- package/testing/mocks/bounding-client-rect-mock.d.ts +0 -8
- package/testing/mocks/bounding-client-rect-mock.js +0 -36
- package/testing/mocks/canvas-mock.d.ts +0 -14
- package/testing/mocks/canvas-mock.js +0 -192
- package/testing/mocks/create-mock-element.d.ts +0 -14
- package/testing/mocks/create-mock-element.js +0 -99
- package/testing/mocks/create-range-mock.d.ts +0 -10
- package/testing/mocks/create-range-mock.js +0 -47
- package/testing/mocks/dom-rect-mock.d.ts +0 -19
- package/testing/mocks/dom-rect-mock.js +0 -56
- package/testing/mocks/fetch-mock.d.ts +0 -9
- package/testing/mocks/fetch-mock.js +0 -38
- package/testing/mocks/intersection-observer-mock.d.ts +0 -10
- package/testing/mocks/intersection-observer-mock.js +0 -58
- package/testing/mocks/match-media-mock.d.ts +0 -10
- package/testing/mocks/match-media-mock.js +0 -45
- package/testing/mocks/offset-height-mock.d.ts +0 -8
- package/testing/mocks/offset-height-mock.js +0 -39
- package/testing/mocks/offset-width-mock.d.ts +0 -8
- package/testing/mocks/offset-width-mock.js +0 -39
- package/testing/mocks/pointer-event-mock.d.ts +0 -8
- package/testing/mocks/pointer-event-mock.js +0 -42
- package/testing/mocks/resize-observer-mock.d.ts +0 -11
- package/testing/mocks/resize-observer-mock.js +0 -42
- package/testing/mocks/screen-size-mock.d.ts +0 -8
- package/testing/mocks/screen-size-mock.js +0 -34
- package/testing/mocks/scroll-into-view-mock.d.ts +0 -10
- package/testing/mocks/scroll-into-view-mock.js +0 -34
- package/testing/mocks/scroll-width-mock.d.ts +0 -8
- package/testing/mocks/scroll-width-mock.js +0 -39
- package/testing/mocks/select-mock.d.ts +0 -11
- package/testing/mocks/select-mock.js +0 -45
- package/testing/mocks/table-virtualization-mock.d.ts +0 -10
- package/testing/mocks/table-virtualization-mock.js +0 -50
- package/testing/mocks/text-ellipsis-mock.d.ts +0 -8
- package/testing/mocks/text-ellipsis-mock.js +0 -43
- package/testing/setup.d.ts +0 -8
- package/testing/setup.js +0 -57
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
var bounding_client_rect_mock_exports = {};
|
|
19
|
-
__export(bounding_client_rect_mock_exports, {
|
|
20
|
-
clearGetBoundingClientRectMock: () => clearGetBoundingClientRectMock,
|
|
21
|
-
setupGetBoundingClientRectMock: () => setupGetBoundingClientRectMock
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(bounding_client_rect_mock_exports);
|
|
24
|
-
var import_dom_rect_mock = require("./dom-rect-mock.js");
|
|
25
|
-
const pristineGetBoundingClientRect = Element.prototype.getBoundingClientRect;
|
|
26
|
-
function setupGetBoundingClientRectMock(widthOrMockFn, height, x, y, top, right, bottom, left) {
|
|
27
|
-
Object.defineProperty(Element.prototype, "getBoundingClientRect", {
|
|
28
|
-
writable: true,
|
|
29
|
-
value: typeof widthOrMockFn === "number" ? () => (0, import_dom_rect_mock.createDOMRect)(widthOrMockFn, height, x, y, top, right, bottom, left) : function getBoundingClientRectMock() {
|
|
30
|
-
return widthOrMockFn.call(this) ?? import_dom_rect_mock.FALLBACK_DOM_RECT;
|
|
31
|
-
}
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
function clearGetBoundingClientRectMock() {
|
|
35
|
-
Element.prototype.getBoundingClientRect = pristineGetBoundingClientRect;
|
|
36
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Mocks the `getContext()` function of HTMLCanvasElements so it returns an
|
|
3
|
-
* object with an implementation of `measureText()`. If no `mockTextWidth` is
|
|
4
|
-
* set, it will fall back to a default implementation that attempts to calculate
|
|
5
|
-
* a reasonable value for each given string.
|
|
6
|
-
*
|
|
7
|
-
* @param mockTextWidth - The value returned by the `measureText()` mock for all strings
|
|
8
|
-
* @deprecated The testing subpackage is deprecated. Please switch to the `@dynatrace/strato-components-testing` package.
|
|
9
|
-
*/
|
|
10
|
-
export declare function setupCanvasMeasureTextMock(mockTextWidth?: number): void;
|
|
11
|
-
/** Clears mocked `getContext()` function on HTMLCanvasElements.
|
|
12
|
-
* @deprecated The testing subpackage is deprecated. Please switch to the `@dynatrace/strato-components-testing` package.
|
|
13
|
-
*/
|
|
14
|
-
export declare function clearCanvasMeasureTextMock(): void;
|
|
@@ -1,192 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
var canvas_mock_exports = {};
|
|
19
|
-
__export(canvas_mock_exports, {
|
|
20
|
-
clearCanvasMeasureTextMock: () => clearCanvasMeasureTextMock,
|
|
21
|
-
setupCanvasMeasureTextMock: () => setupCanvasMeasureTextMock
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(canvas_mock_exports);
|
|
24
|
-
const AVG_CHARACTER_WIDTH = 8;
|
|
25
|
-
const TEXT_WIDTH_MAPPINGS = {
|
|
26
|
-
"\u2026": 11,
|
|
27
|
-
"0": 9,
|
|
28
|
-
"1": 7,
|
|
29
|
-
"2": 9,
|
|
30
|
-
"3": 8,
|
|
31
|
-
"4": 9,
|
|
32
|
-
"5": 10,
|
|
33
|
-
"6": 10,
|
|
34
|
-
"7": 9,
|
|
35
|
-
"8": 9,
|
|
36
|
-
"9": 8,
|
|
37
|
-
" ": 0,
|
|
38
|
-
"!": 4,
|
|
39
|
-
'"': 6,
|
|
40
|
-
"#": 10,
|
|
41
|
-
$: 9,
|
|
42
|
-
"%": 12,
|
|
43
|
-
"&": 10,
|
|
44
|
-
"'": 2,
|
|
45
|
-
"(": 7,
|
|
46
|
-
")": 5,
|
|
47
|
-
"*": 7,
|
|
48
|
-
"+": 9,
|
|
49
|
-
",": 3,
|
|
50
|
-
"-": 5,
|
|
51
|
-
".": 4,
|
|
52
|
-
"/": 7,
|
|
53
|
-
":": 4,
|
|
54
|
-
";": 3,
|
|
55
|
-
"<": 7,
|
|
56
|
-
"=": 9,
|
|
57
|
-
">": 9,
|
|
58
|
-
"?": 7,
|
|
59
|
-
"@": 14,
|
|
60
|
-
A: 11,
|
|
61
|
-
B: 11,
|
|
62
|
-
C: 10,
|
|
63
|
-
D: 11,
|
|
64
|
-
E: 10,
|
|
65
|
-
F: 10,
|
|
66
|
-
G: 10,
|
|
67
|
-
H: 12,
|
|
68
|
-
I: 4,
|
|
69
|
-
J: 8,
|
|
70
|
-
K: 12,
|
|
71
|
-
L: 10,
|
|
72
|
-
M: 14,
|
|
73
|
-
N: 12,
|
|
74
|
-
O: 11,
|
|
75
|
-
P: 11,
|
|
76
|
-
Q: 11,
|
|
77
|
-
R: 11,
|
|
78
|
-
S: 9,
|
|
79
|
-
T: 10,
|
|
80
|
-
U: 11,
|
|
81
|
-
V: 10,
|
|
82
|
-
W: 14,
|
|
83
|
-
X: 10,
|
|
84
|
-
Y: 10,
|
|
85
|
-
Z: 9,
|
|
86
|
-
"[": 6,
|
|
87
|
-
"\\": 7,
|
|
88
|
-
"]": 4,
|
|
89
|
-
"^": 7,
|
|
90
|
-
_: 8,
|
|
91
|
-
"`": 4,
|
|
92
|
-
a: 8,
|
|
93
|
-
b: 10,
|
|
94
|
-
c: 8,
|
|
95
|
-
d: 8,
|
|
96
|
-
e: 8,
|
|
97
|
-
f: 6,
|
|
98
|
-
g: 8,
|
|
99
|
-
h: 9,
|
|
100
|
-
i: 4,
|
|
101
|
-
j: 4,
|
|
102
|
-
k: 10,
|
|
103
|
-
l: 4,
|
|
104
|
-
m: 14,
|
|
105
|
-
n: 9,
|
|
106
|
-
o: 9,
|
|
107
|
-
p: 10,
|
|
108
|
-
q: 8,
|
|
109
|
-
r: 7,
|
|
110
|
-
s: 8,
|
|
111
|
-
t: 5,
|
|
112
|
-
u: 9,
|
|
113
|
-
v: 8,
|
|
114
|
-
w: 12,
|
|
115
|
-
x: 8,
|
|
116
|
-
y: 8,
|
|
117
|
-
z: 8,
|
|
118
|
-
"{": 6,
|
|
119
|
-
"|": 4,
|
|
120
|
-
"}": 5,
|
|
121
|
-
"~": 11
|
|
122
|
-
};
|
|
123
|
-
function getCharWidth(character) {
|
|
124
|
-
return TEXT_WIDTH_MAPPINGS[character] ?? AVG_CHARACTER_WIDTH;
|
|
125
|
-
}
|
|
126
|
-
const pristineGetContext = HTMLCanvasElement.prototype.getContext;
|
|
127
|
-
function setupCanvasMeasureTextMock(mockTextWidth) {
|
|
128
|
-
Object.defineProperty(HTMLCanvasElement.prototype, "getContext", {
|
|
129
|
-
writable: true,
|
|
130
|
-
value: () => ({
|
|
131
|
-
measureText: (text) => {
|
|
132
|
-
const charWidth = mockTextWidth !== void 0 ? mockTextWidth : [...text].reduce((prev, curr) => prev + getCharWidth(curr), 0);
|
|
133
|
-
return {
|
|
134
|
-
width: charWidth,
|
|
135
|
-
actualBoundingBoxLeft: 0,
|
|
136
|
-
actualBoundingBoxRight: charWidth,
|
|
137
|
-
fontBoundingBoxAscent: 0,
|
|
138
|
-
fontBoundingBoxDescent: 0,
|
|
139
|
-
actualBoundingBoxAscent: 0,
|
|
140
|
-
actualBoundingBoxDescent: 0,
|
|
141
|
-
alphabeticBaseline: 0,
|
|
142
|
-
emHeightAscent: 0,
|
|
143
|
-
emHeightDescent: 0,
|
|
144
|
-
hangingBaseline: 0,
|
|
145
|
-
ideographicBaseline: 0
|
|
146
|
-
};
|
|
147
|
-
},
|
|
148
|
-
scale: () => {
|
|
149
|
-
return null;
|
|
150
|
-
},
|
|
151
|
-
clearRect: () => {
|
|
152
|
-
return null;
|
|
153
|
-
},
|
|
154
|
-
draw: () => {
|
|
155
|
-
return null;
|
|
156
|
-
},
|
|
157
|
-
beginPath: () => {
|
|
158
|
-
return null;
|
|
159
|
-
},
|
|
160
|
-
stroke: () => {
|
|
161
|
-
return null;
|
|
162
|
-
},
|
|
163
|
-
closePath: () => {
|
|
164
|
-
return null;
|
|
165
|
-
},
|
|
166
|
-
moveTo: () => {
|
|
167
|
-
return null;
|
|
168
|
-
},
|
|
169
|
-
lineTo: () => {
|
|
170
|
-
return null;
|
|
171
|
-
},
|
|
172
|
-
arc: () => {
|
|
173
|
-
return null;
|
|
174
|
-
},
|
|
175
|
-
fill: () => {
|
|
176
|
-
return null;
|
|
177
|
-
},
|
|
178
|
-
rect: () => {
|
|
179
|
-
return null;
|
|
180
|
-
},
|
|
181
|
-
save: () => {
|
|
182
|
-
return null;
|
|
183
|
-
},
|
|
184
|
-
restore: () => {
|
|
185
|
-
return null;
|
|
186
|
-
}
|
|
187
|
-
})
|
|
188
|
-
});
|
|
189
|
-
}
|
|
190
|
-
function clearCanvasMeasureTextMock() {
|
|
191
|
-
HTMLCanvasElement.prototype.getContext = pristineGetContext;
|
|
192
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/** Creates a mock element: https://github.com/jsdom/jsdom/issues/653
|
|
2
|
-
* @deprecated The testing subpackage is deprecated.
|
|
3
|
-
*/
|
|
4
|
-
export declare function createMockElement(
|
|
5
|
-
/** Element tag name */
|
|
6
|
-
elementOrTag: HTMLElement | string,
|
|
7
|
-
/** Horizontal offset */
|
|
8
|
-
left: number,
|
|
9
|
-
/** Vertical offset */
|
|
10
|
-
top: number,
|
|
11
|
-
/** Element width */
|
|
12
|
-
width: number,
|
|
13
|
-
/** Element height */
|
|
14
|
-
height: number): HTMLElement;
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
var create_mock_element_exports = {};
|
|
19
|
-
__export(create_mock_element_exports, {
|
|
20
|
-
createMockElement: () => createMockElement
|
|
21
|
-
});
|
|
22
|
-
module.exports = __toCommonJS(create_mock_element_exports);
|
|
23
|
-
function createMockElement(elementOrTag, left, top, width, height) {
|
|
24
|
-
const el = typeof elementOrTag === "string" ? document.createElement(elementOrTag) : elementOrTag;
|
|
25
|
-
Object.assign(el.style, {
|
|
26
|
-
width: `${width}px`,
|
|
27
|
-
height: `${height}px`
|
|
28
|
-
});
|
|
29
|
-
el.getBoundingClientRect = () => ({
|
|
30
|
-
x: left,
|
|
31
|
-
y: top,
|
|
32
|
-
width,
|
|
33
|
-
height,
|
|
34
|
-
top,
|
|
35
|
-
left,
|
|
36
|
-
right: width + left,
|
|
37
|
-
bottom: height + top,
|
|
38
|
-
toJSON: () => null
|
|
39
|
-
});
|
|
40
|
-
Object.defineProperties(el, {
|
|
41
|
-
offsetWidth: {
|
|
42
|
-
get() {
|
|
43
|
-
return parseFloat(this.style.width) || 0;
|
|
44
|
-
}
|
|
45
|
-
},
|
|
46
|
-
offsetHeight: {
|
|
47
|
-
get() {
|
|
48
|
-
return parseFloat(this.style.height) || 0;
|
|
49
|
-
}
|
|
50
|
-
},
|
|
51
|
-
offsetTop: {
|
|
52
|
-
get() {
|
|
53
|
-
return parseFloat(this.style.marginTop) || 0;
|
|
54
|
-
}
|
|
55
|
-
},
|
|
56
|
-
offsetLeft: {
|
|
57
|
-
get() {
|
|
58
|
-
return parseFloat(this.style.marginLeft) || 0;
|
|
59
|
-
}
|
|
60
|
-
},
|
|
61
|
-
clientWidth: {
|
|
62
|
-
configurable: true,
|
|
63
|
-
get: function() {
|
|
64
|
-
return this._jsdomMockClientWidth || this._clientWidth || 0;
|
|
65
|
-
},
|
|
66
|
-
set(val) {
|
|
67
|
-
this._clientWidth = val;
|
|
68
|
-
}
|
|
69
|
-
},
|
|
70
|
-
clientHeight: {
|
|
71
|
-
configurable: true,
|
|
72
|
-
get: function() {
|
|
73
|
-
return this._jsdomMockClientHight || this._clientHeight || 0;
|
|
74
|
-
},
|
|
75
|
-
set(val) {
|
|
76
|
-
this._clientHeight = val;
|
|
77
|
-
}
|
|
78
|
-
},
|
|
79
|
-
scrollWidth: {
|
|
80
|
-
configurable: true,
|
|
81
|
-
get: function() {
|
|
82
|
-
return this._scrollWidth || 0;
|
|
83
|
-
},
|
|
84
|
-
set(val) {
|
|
85
|
-
this._scrollWidth = val;
|
|
86
|
-
}
|
|
87
|
-
},
|
|
88
|
-
scrollHeight: {
|
|
89
|
-
configurable: true,
|
|
90
|
-
get: function() {
|
|
91
|
-
return this._scrollHeight || 0;
|
|
92
|
-
},
|
|
93
|
-
set(val) {
|
|
94
|
-
this._scrollHeight = val;
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
});
|
|
98
|
-
return el;
|
|
99
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Mocks the `document.createRange()` function so it returns
|
|
3
|
-
* a valid `Range` object.
|
|
4
|
-
* @deprecated The testing subpackage is deprecated.
|
|
5
|
-
*/
|
|
6
|
-
export declare function setupCreateRangeMock(): void;
|
|
7
|
-
/** Clears mocked `document.createRange()` function.
|
|
8
|
-
* @deprecated The testing subpackage is deprecated.
|
|
9
|
-
*/
|
|
10
|
-
export declare function clearCreateRangeMock(): void;
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
var create_range_mock_exports = {};
|
|
19
|
-
__export(create_range_mock_exports, {
|
|
20
|
-
clearCreateRangeMock: () => clearCreateRangeMock,
|
|
21
|
-
setupCreateRangeMock: () => setupCreateRangeMock
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(create_range_mock_exports);
|
|
24
|
-
var import_globals = require("@jest/globals");
|
|
25
|
-
const pristineCreateRange = global.document.createRange;
|
|
26
|
-
function setupCreateRangeMock() {
|
|
27
|
-
Object.defineProperty(global.document, "createRange", {
|
|
28
|
-
writable: true,
|
|
29
|
-
value: () => {
|
|
30
|
-
const range = new Range();
|
|
31
|
-
range.getBoundingClientRect = import_globals.jest.fn();
|
|
32
|
-
range.getClientRects = () => {
|
|
33
|
-
return {
|
|
34
|
-
item: () => null,
|
|
35
|
-
length: 0,
|
|
36
|
-
[Symbol.iterator]: {
|
|
37
|
-
next: () => ({ done: true })
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
|
-
};
|
|
41
|
-
return range;
|
|
42
|
-
}
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
function clearCreateRangeMock() {
|
|
46
|
-
global.document.createRange = pristineCreateRange;
|
|
47
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/** Creates a DOMRect instance. Unspecified values default to `0`.
|
|
2
|
-
* @deprecated The testing subpackage is deprecated. Please switch to the `@dynatrace/strato-components-testing` package.
|
|
3
|
-
*/
|
|
4
|
-
export declare function createDOMRect(width: number, height?: number, x?: number, y?: number, top?: number, right?: number, bottom?: number, left?: number): DOMRect;
|
|
5
|
-
/**
|
|
6
|
-
* @deprecated The testing subpackage is deprecated. Please switch to the `@dynatrace/strato-components-testing` package.
|
|
7
|
-
*/
|
|
8
|
-
export declare const FALLBACK_DOM_RECT: DOMRect;
|
|
9
|
-
/**
|
|
10
|
-
* Mock the domRect since jsdom doesn't provide it
|
|
11
|
-
* @param mockDomRect - Override values for DOMRect
|
|
12
|
-
* @deprecated The testing subpackage is deprecated. Please switch to the `@dynatrace/strato-components-testing` package.
|
|
13
|
-
*/
|
|
14
|
-
export declare function setupDomRectMock(mockDomRect?: DOMRect): void;
|
|
15
|
-
/**
|
|
16
|
-
* reset the DomRect
|
|
17
|
-
* @deprecated The testing subpackage is deprecated. Please switch to the `@dynatrace/strato-components-testing` package.
|
|
18
|
-
*/
|
|
19
|
-
export declare function clearDomRectMock(): void;
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
var dom_rect_mock_exports = {};
|
|
19
|
-
__export(dom_rect_mock_exports, {
|
|
20
|
-
FALLBACK_DOM_RECT: () => FALLBACK_DOM_RECT,
|
|
21
|
-
clearDomRectMock: () => clearDomRectMock,
|
|
22
|
-
createDOMRect: () => createDOMRect,
|
|
23
|
-
setupDomRectMock: () => setupDomRectMock
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(dom_rect_mock_exports);
|
|
26
|
-
function createDOMRect(width, height, x, y, top, right, bottom, left) {
|
|
27
|
-
return {
|
|
28
|
-
width,
|
|
29
|
-
height: height ?? 0,
|
|
30
|
-
x: x ?? 0,
|
|
31
|
-
y: y ?? 0,
|
|
32
|
-
top: top ?? 0,
|
|
33
|
-
right: right ?? 0,
|
|
34
|
-
bottom: bottom ?? 0,
|
|
35
|
-
left: left ?? 0,
|
|
36
|
-
toJSON: function() {
|
|
37
|
-
const { toJSON, ...remainingProps } = this;
|
|
38
|
-
return remainingProps;
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
const FALLBACK_DOM_RECT = Object.freeze(createDOMRect(0));
|
|
43
|
-
const prisitineDomRect = window.DOMRect;
|
|
44
|
-
function setupDomRectMock(mockDomRect = FALLBACK_DOM_RECT) {
|
|
45
|
-
Object.defineProperties(window, {
|
|
46
|
-
DOMRect: {
|
|
47
|
-
writable: true,
|
|
48
|
-
value: {
|
|
49
|
-
fromRect: () => mockDomRect
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
function clearDomRectMock() {
|
|
55
|
-
window.DOMRect = prisitineDomRect;
|
|
56
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Mocks the global `fetch` function since JSDom has no implementation
|
|
3
|
-
* @deprecated The testing subpackage is deprecated.
|
|
4
|
-
*/
|
|
5
|
-
export declare function setupFetchMock(mockedValue?: any): void;
|
|
6
|
-
/** Clears mocked `fetch` function.
|
|
7
|
-
* @deprecated The testing subpackage is deprecated.
|
|
8
|
-
*/
|
|
9
|
-
export declare function clearFetchMock(): void;
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
var fetch_mock_exports = {};
|
|
19
|
-
__export(fetch_mock_exports, {
|
|
20
|
-
clearFetchMock: () => clearFetchMock,
|
|
21
|
-
setupFetchMock: () => setupFetchMock
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(fetch_mock_exports);
|
|
24
|
-
var import_globals = require("@jest/globals");
|
|
25
|
-
const pristineFetch = global.fetch;
|
|
26
|
-
function setupFetchMock(mockedValue = {
|
|
27
|
-
ok: true,
|
|
28
|
-
status: 200,
|
|
29
|
-
json: () => {
|
|
30
|
-
return {};
|
|
31
|
-
}
|
|
32
|
-
}) {
|
|
33
|
-
const mockedFetchPromise = Promise.resolve(mockedValue);
|
|
34
|
-
global.fetch = import_globals.jest.fn(() => mockedFetchPromise);
|
|
35
|
-
}
|
|
36
|
-
function clearFetchMock() {
|
|
37
|
-
global.fetch = pristineFetch;
|
|
38
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Mocks the IntersectionObserver
|
|
3
|
-
* @param entries - entries for the callback function which is called when IntersectionObserver.observe is invoked
|
|
4
|
-
* @deprecated The testing subpackage is deprecated.
|
|
5
|
-
*/
|
|
6
|
-
export declare function setupIntersectionObserverMock(entries?: any): void;
|
|
7
|
-
/** Clears `IntersectionObserver` mock.
|
|
8
|
-
* @deprecated The testing subpackage is deprecated.
|
|
9
|
-
*/
|
|
10
|
-
export declare function clearIntersectionObserverMock(): void;
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
var intersection_observer_mock_exports = {};
|
|
19
|
-
__export(intersection_observer_mock_exports, {
|
|
20
|
-
clearIntersectionObserverMock: () => clearIntersectionObserverMock,
|
|
21
|
-
setupIntersectionObserverMock: () => setupIntersectionObserverMock
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(intersection_observer_mock_exports);
|
|
24
|
-
var import_globals = require("@jest/globals");
|
|
25
|
-
const pristineIntersectionObserver = window.IntersectionObserver;
|
|
26
|
-
function setupIntersectionObserverMock(entries = [
|
|
27
|
-
{
|
|
28
|
-
isIntersecting: true,
|
|
29
|
-
intersectionRatio: 1
|
|
30
|
-
}
|
|
31
|
-
]) {
|
|
32
|
-
class MockIntersectionObserver {
|
|
33
|
-
root = null;
|
|
34
|
-
rootMargin = "";
|
|
35
|
-
thresholds = [];
|
|
36
|
-
callback;
|
|
37
|
-
/**
|
|
38
|
-
* Mock constructor
|
|
39
|
-
* @param callback - callback function
|
|
40
|
-
* @param options - options
|
|
41
|
-
*/
|
|
42
|
-
constructor(callback, options) {
|
|
43
|
-
this.callback = callback;
|
|
44
|
-
}
|
|
45
|
-
disconnect = import_globals.jest.fn();
|
|
46
|
-
observe = import_globals.jest.fn(() => this.callback(entries));
|
|
47
|
-
takeRecords = import_globals.jest.fn();
|
|
48
|
-
unobserve = import_globals.jest.fn();
|
|
49
|
-
}
|
|
50
|
-
Object.defineProperty(global, "IntersectionObserver", {
|
|
51
|
-
writable: true,
|
|
52
|
-
configurable: true,
|
|
53
|
-
value: MockIntersectionObserver
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
function clearIntersectionObserverMock() {
|
|
57
|
-
global.IntersectionObserver = pristineIntersectionObserver;
|
|
58
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Mock the match media on the window object
|
|
3
|
-
* @param isMatching - whether or not the match query matches
|
|
4
|
-
* @deprecated The testing subpackage is deprecated.
|
|
5
|
-
*/
|
|
6
|
-
export declare function setupMatchMediaMock(isMatching?: boolean): void;
|
|
7
|
-
/** Clear the Match Media mock
|
|
8
|
-
* @deprecated The testing subpackage is deprecated.
|
|
9
|
-
*/
|
|
10
|
-
export declare function clearMatchMediaMock(): void;
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
var match_media_mock_exports = {};
|
|
19
|
-
__export(match_media_mock_exports, {
|
|
20
|
-
clearMatchMediaMock: () => clearMatchMediaMock,
|
|
21
|
-
setupMatchMediaMock: () => setupMatchMediaMock
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(match_media_mock_exports);
|
|
24
|
-
var import_globals = require("@jest/globals");
|
|
25
|
-
const prisitineMatchMedia = window.matchMedia;
|
|
26
|
-
function setupMatchMediaMock(isMatching = false) {
|
|
27
|
-
Object.defineProperty(window, "matchMedia", {
|
|
28
|
-
writable: true,
|
|
29
|
-
value: import_globals.jest.fn().mockImplementation((query) => ({
|
|
30
|
-
matches: isMatching,
|
|
31
|
-
media: query,
|
|
32
|
-
onchange: null,
|
|
33
|
-
addListener: import_globals.jest.fn(),
|
|
34
|
-
// Deprecated
|
|
35
|
-
removeListener: import_globals.jest.fn(),
|
|
36
|
-
// Deprecated
|
|
37
|
-
addEventListener: import_globals.jest.fn(),
|
|
38
|
-
removeEventListener: import_globals.jest.fn(),
|
|
39
|
-
dispatchEvent: import_globals.jest.fn()
|
|
40
|
-
}))
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
function clearMatchMediaMock() {
|
|
44
|
-
window.matchMedia = prisitineMatchMedia;
|
|
45
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/** Mocks the return value of the offsetHeight property on all HTMLElements.
|
|
2
|
-
* @deprecated The testing subpackage is deprecated.
|
|
3
|
-
*/
|
|
4
|
-
export declare function setupOffsetHeightMock(containerHeightOrMockFn: number | (() => number)): void;
|
|
5
|
-
/** Clears mocked offsetHeight property on HTMLElements.
|
|
6
|
-
* @deprecated The testing subpackage is deprecated.
|
|
7
|
-
*/
|
|
8
|
-
export declare function clearOffsetHeightMock(): void;
|