@jobber/components 6.86.0 → 6.86.2
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/Autocomplete/index.cjs +6 -6
- package/dist/Autocomplete/index.mjs +11 -11
- package/dist/Banner-cjs.js +1 -1
- package/dist/Banner-es.js +1 -1
- package/dist/Chip-cjs.js +2 -2
- package/dist/Chip-es.js +3 -3
- package/dist/Combobox-cjs.js +1 -1
- package/dist/Combobox-es.js +2 -2
- package/dist/ComboboxContent-cjs.js +2 -2
- package/dist/ComboboxContent-es.js +5 -5
- package/dist/ComboboxLoadMore-cjs.js +1 -1
- package/dist/ComboboxLoadMore-es.js +2 -2
- package/dist/ConfirmationModal-cjs.js +1 -1
- package/dist/ConfirmationModal-es.js +2 -2
- package/dist/ContentBlock-cjs.js +1 -1
- package/dist/ContentBlock-es.js +2 -2
- package/dist/DataListActionsMenu-cjs.js +4 -4
- package/dist/DataListActionsMenu-es.js +8 -8
- package/dist/DataListHeaderTile-cjs.js +1 -1
- package/dist/DataListHeaderTile-es.js +2 -2
- package/dist/DataListLoadMore-cjs.js +1 -1
- package/dist/DataListLoadMore-es.js +2 -2
- package/dist/DataListOverflowFade-cjs.js +2 -2
- package/dist/DataListOverflowFade-es.js +3 -3
- package/dist/DataListSearch-cjs.js +1 -1
- package/dist/DataListSearch-es.js +2 -2
- package/dist/DataListSortingOptions-cjs.js +2 -2
- package/dist/DataListSortingOptions-es.js +4 -4
- package/dist/DataTable/test-utilities/index.cjs +1 -1
- package/dist/DataTable/test-utilities/index.mjs +1 -1
- package/dist/DataTable-cjs.js +3 -3
- package/dist/DataTable-es.js +4 -4
- package/dist/DatePicker-cjs.js +1 -1
- package/dist/DatePicker-es.js +2 -2
- package/dist/Disclosure-cjs.js +2 -2
- package/dist/Disclosure-es.js +3 -3
- package/dist/FormField-cjs.js +1 -5
- package/dist/FormField-es.js +1 -5
- package/dist/InputText/InputText.d.ts +2 -2
- package/dist/InputText/index.cjs +2 -2
- package/dist/InputText/index.mjs +3 -3
- package/dist/LightBox-cjs.js +51 -67
- package/dist/LightBox-es.js +57 -73
- package/dist/Menu-cjs.js +6 -11
- package/dist/Menu-es.js +11 -16
- package/dist/Modal/index.cjs +3 -3
- package/dist/Modal/index.mjs +7 -7
- package/dist/Page-cjs.js +4 -4
- package/dist/Page-es.js +5 -5
- package/dist/Popover-cjs.js +1 -1
- package/dist/Popover-es.js +3 -3
- package/dist/SideDrawer-cjs.js +6 -6
- package/dist/SideDrawer-es.js +10 -10
- package/dist/Tooltip-cjs.js +2 -2
- package/dist/Tooltip-es.js +5 -5
- package/dist/floating-ui.react-es.js +1 -1
- package/dist/index.cjs +5 -5
- package/dist/index.mjs +5 -5
- package/dist/styles.css +27 -6
- package/dist/throttle-cjs.js +0 -1
- package/dist/throttle-es.js +1 -1
- package/dist/useDebounce-cjs.js +69 -4381
- package/dist/useDebounce-es.js +71 -4383
- package/dist/useFocusTrap-cjs.js +3 -8
- package/dist/useFocusTrap-es.js +4 -9
- package/dist/useInView-cjs.js +5 -10
- package/dist/useInView-es.js +6 -11
- package/dist/useIsMounted-cjs.js +4 -19
- package/dist/useIsMounted-es.js +5 -20
- package/dist/useOnKeyDown-cjs.js +2 -7
- package/dist/useOnKeyDown-es.js +3 -8
- package/dist/useRefocusOnActivator-cjs.js +2 -7
- package/dist/useRefocusOnActivator-es.js +3 -8
- package/dist/useResizeObserver-cjs.js +64 -92
- package/dist/useResizeObserver-es.js +65 -94
- package/dist/useSafeLayoutEffect-cjs.js +3 -8
- package/dist/useSafeLayoutEffect-es.js +5 -10
- package/dist/useScrollToActive-cjs.js +4 -9
- package/dist/useScrollToActive-es.js +6 -11
- package/package.json +3 -3
package/dist/useFocusTrap-cjs.js
CHANGED
|
@@ -2,11 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
var React = require('react');
|
|
4
4
|
|
|
5
|
-
var useFocusTrap$1 = {};
|
|
6
|
-
|
|
7
|
-
Object.defineProperty(useFocusTrap$1, "__esModule", { value: true });
|
|
8
|
-
var useFocusTrap_2 = useFocusTrap$1.useFocusTrap = useFocusTrap;
|
|
9
|
-
const react_1 = React;
|
|
10
5
|
/**
|
|
11
6
|
* Traps the focus within the children of the ref element.
|
|
12
7
|
*
|
|
@@ -19,7 +14,7 @@ function useFocusTrap(active) {
|
|
|
19
14
|
// There's an ongoing issue with useRef return type clashing with an element's
|
|
20
15
|
// ref prop type. TLDR: Use null because useRef doesn't expect undefined.
|
|
21
16
|
// https://github.com/DefinitelyTyped/DefinitelyTyped/issues/35572
|
|
22
|
-
const ref =
|
|
17
|
+
const ref = React.useRef(null);
|
|
23
18
|
function handleKeyDown(event) {
|
|
24
19
|
if (!(active && ref.current) || event.key !== "Tab") {
|
|
25
20
|
return;
|
|
@@ -38,7 +33,7 @@ function useFocusTrap(active) {
|
|
|
38
33
|
}
|
|
39
34
|
}
|
|
40
35
|
}
|
|
41
|
-
|
|
36
|
+
React.useEffect(() => {
|
|
42
37
|
if (active && ref.current) {
|
|
43
38
|
const { firstElement } = getElements(ref.current);
|
|
44
39
|
firstElement.focus();
|
|
@@ -72,4 +67,4 @@ function getElements(ref) {
|
|
|
72
67
|
return { firstElement, lastElement };
|
|
73
68
|
}
|
|
74
69
|
|
|
75
|
-
exports.
|
|
70
|
+
exports.useFocusTrap = useFocusTrap;
|
package/dist/useFocusTrap-es.js
CHANGED
|
@@ -1,10 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { useRef, useEffect } from 'react';
|
|
2
2
|
|
|
3
|
-
var useFocusTrap$1 = {};
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(useFocusTrap$1, "__esModule", { value: true });
|
|
6
|
-
var useFocusTrap_2 = useFocusTrap$1.useFocusTrap = useFocusTrap;
|
|
7
|
-
const react_1 = React__default;
|
|
8
3
|
/**
|
|
9
4
|
* Traps the focus within the children of the ref element.
|
|
10
5
|
*
|
|
@@ -17,7 +12,7 @@ function useFocusTrap(active) {
|
|
|
17
12
|
// There's an ongoing issue with useRef return type clashing with an element's
|
|
18
13
|
// ref prop type. TLDR: Use null because useRef doesn't expect undefined.
|
|
19
14
|
// https://github.com/DefinitelyTyped/DefinitelyTyped/issues/35572
|
|
20
|
-
const ref =
|
|
15
|
+
const ref = useRef(null);
|
|
21
16
|
function handleKeyDown(event) {
|
|
22
17
|
if (!(active && ref.current) || event.key !== "Tab") {
|
|
23
18
|
return;
|
|
@@ -36,7 +31,7 @@ function useFocusTrap(active) {
|
|
|
36
31
|
}
|
|
37
32
|
}
|
|
38
33
|
}
|
|
39
|
-
|
|
34
|
+
useEffect(() => {
|
|
40
35
|
if (active && ref.current) {
|
|
41
36
|
const { firstElement } = getElements(ref.current);
|
|
42
37
|
firstElement.focus();
|
|
@@ -70,4 +65,4 @@ function getElements(ref) {
|
|
|
70
65
|
return { firstElement, lastElement };
|
|
71
66
|
}
|
|
72
67
|
|
|
73
|
-
export {
|
|
68
|
+
export { useFocusTrap as u };
|
package/dist/useInView-cjs.js
CHANGED
|
@@ -2,16 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
var React = require('react');
|
|
4
4
|
|
|
5
|
-
var useInView$1 = {};
|
|
6
|
-
|
|
7
|
-
Object.defineProperty(useInView$1, "__esModule", { value: true });
|
|
8
|
-
var useInView_2 = useInView$1.useInView = useInView;
|
|
9
|
-
const react_1 = React;
|
|
10
5
|
function useInView() {
|
|
11
|
-
const ref =
|
|
12
|
-
const [isInView, setIsInView] =
|
|
13
|
-
const handleIntersection =
|
|
14
|
-
|
|
6
|
+
const ref = React.useRef(null);
|
|
7
|
+
const [isInView, setIsInView] = React.useState(false);
|
|
8
|
+
const handleIntersection = React.useCallback(entries => setIsInView(entries[0].isIntersecting), [setIsInView]);
|
|
9
|
+
React.useEffect(() => {
|
|
15
10
|
if (!window.IntersectionObserver)
|
|
16
11
|
return;
|
|
17
12
|
const observer = new IntersectionObserver(handleIntersection);
|
|
@@ -23,4 +18,4 @@ function useInView() {
|
|
|
23
18
|
return [ref, isInView];
|
|
24
19
|
}
|
|
25
20
|
|
|
26
|
-
exports.
|
|
21
|
+
exports.useInView = useInView;
|
package/dist/useInView-es.js
CHANGED
|
@@ -1,15 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { useRef, useState, useCallback, useEffect } from 'react';
|
|
2
2
|
|
|
3
|
-
var useInView$1 = {};
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(useInView$1, "__esModule", { value: true });
|
|
6
|
-
var useInView_2 = useInView$1.useInView = useInView;
|
|
7
|
-
const react_1 = React__default;
|
|
8
3
|
function useInView() {
|
|
9
|
-
const ref =
|
|
10
|
-
const [isInView, setIsInView] =
|
|
11
|
-
const handleIntersection =
|
|
12
|
-
|
|
4
|
+
const ref = useRef(null);
|
|
5
|
+
const [isInView, setIsInView] = useState(false);
|
|
6
|
+
const handleIntersection = useCallback(entries => setIsInView(entries[0].isIntersecting), [setIsInView]);
|
|
7
|
+
useEffect(() => {
|
|
13
8
|
if (!window.IntersectionObserver)
|
|
14
9
|
return;
|
|
15
10
|
const observer = new IntersectionObserver(handleIntersection);
|
|
@@ -21,4 +16,4 @@ function useInView() {
|
|
|
21
16
|
return [ref, isInView];
|
|
22
17
|
}
|
|
23
18
|
|
|
24
|
-
export {
|
|
19
|
+
export { useInView as u };
|
package/dist/useIsMounted-cjs.js
CHANGED
|
@@ -1,23 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var React = require('react');
|
|
4
|
-
var useSafeLayoutEffect
|
|
4
|
+
var useSafeLayoutEffect = require('./useSafeLayoutEffect-cjs.js');
|
|
5
5
|
|
|
6
|
-
var useIsMounted$1 = {};
|
|
7
|
-
|
|
8
|
-
var useSafeLayoutEffect = {};
|
|
9
|
-
|
|
10
|
-
(function (exports) {
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.useSafeLayoutEffect = void 0;
|
|
13
|
-
var useSafeLayoutEffect_1 = useSafeLayoutEffect$1.useSafeLayoutEffect;
|
|
14
|
-
Object.defineProperty(exports, "useSafeLayoutEffect", { enumerable: true, get: function () { return useSafeLayoutEffect_1.useSafeLayoutEffect; } });
|
|
15
|
-
} (useSafeLayoutEffect));
|
|
16
|
-
|
|
17
|
-
Object.defineProperty(useIsMounted$1, "__esModule", { value: true });
|
|
18
|
-
var useIsMounted_2 = useIsMounted$1.useIsMounted = useIsMounted;
|
|
19
|
-
const react_1 = React;
|
|
20
|
-
const useSafeLayoutEffect_1 = useSafeLayoutEffect;
|
|
21
6
|
/**
|
|
22
7
|
* If you are using this hook in order to only perform an action once after mounting (for example sending
|
|
23
8
|
* analytics events), use `useOnMount` instead
|
|
@@ -38,8 +23,8 @@ const useSafeLayoutEffect_1 = useSafeLayoutEffect;
|
|
|
38
23
|
* This `useLayoutEffect` hook will only be run once.
|
|
39
24
|
*/
|
|
40
25
|
function useIsMounted() {
|
|
41
|
-
const isMounted =
|
|
42
|
-
|
|
26
|
+
const isMounted = React.useRef(false);
|
|
27
|
+
useSafeLayoutEffect.useSafeLayoutEffect(() => {
|
|
43
28
|
isMounted.current = true;
|
|
44
29
|
return () => {
|
|
45
30
|
isMounted.current = false;
|
|
@@ -48,4 +33,4 @@ function useIsMounted() {
|
|
|
48
33
|
return isMounted;
|
|
49
34
|
}
|
|
50
35
|
|
|
51
|
-
exports.
|
|
36
|
+
exports.useIsMounted = useIsMounted;
|
package/dist/useIsMounted-es.js
CHANGED
|
@@ -1,21 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import { useRef } from 'react';
|
|
2
|
+
import { u as useSafeLayoutEffect } from './useSafeLayoutEffect-es.js';
|
|
3
3
|
|
|
4
|
-
var useIsMounted$1 = {};
|
|
5
|
-
|
|
6
|
-
var useSafeLayoutEffect = {};
|
|
7
|
-
|
|
8
|
-
(function (exports) {
|
|
9
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.useSafeLayoutEffect = void 0;
|
|
11
|
-
var useSafeLayoutEffect_1 = useSafeLayoutEffect$1;
|
|
12
|
-
Object.defineProperty(exports, "useSafeLayoutEffect", { enumerable: true, get: function () { return useSafeLayoutEffect_1.useSafeLayoutEffect; } });
|
|
13
|
-
} (useSafeLayoutEffect));
|
|
14
|
-
|
|
15
|
-
Object.defineProperty(useIsMounted$1, "__esModule", { value: true });
|
|
16
|
-
var useIsMounted_2 = useIsMounted$1.useIsMounted = useIsMounted;
|
|
17
|
-
const react_1 = React__default;
|
|
18
|
-
const useSafeLayoutEffect_1 = useSafeLayoutEffect;
|
|
19
4
|
/**
|
|
20
5
|
* If you are using this hook in order to only perform an action once after mounting (for example sending
|
|
21
6
|
* analytics events), use `useOnMount` instead
|
|
@@ -36,8 +21,8 @@ const useSafeLayoutEffect_1 = useSafeLayoutEffect;
|
|
|
36
21
|
* This `useLayoutEffect` hook will only be run once.
|
|
37
22
|
*/
|
|
38
23
|
function useIsMounted() {
|
|
39
|
-
const isMounted =
|
|
40
|
-
|
|
24
|
+
const isMounted = useRef(false);
|
|
25
|
+
useSafeLayoutEffect(() => {
|
|
41
26
|
isMounted.current = true;
|
|
42
27
|
return () => {
|
|
43
28
|
isMounted.current = false;
|
|
@@ -46,4 +31,4 @@ function useIsMounted() {
|
|
|
46
31
|
return isMounted;
|
|
47
32
|
}
|
|
48
33
|
|
|
49
|
-
export {
|
|
34
|
+
export { useIsMounted as u };
|
package/dist/useOnKeyDown-cjs.js
CHANGED
|
@@ -2,13 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
var React = require('react');
|
|
4
4
|
|
|
5
|
-
var useOnKeyDown$1 = {};
|
|
6
|
-
|
|
7
|
-
Object.defineProperty(useOnKeyDown$1, "__esModule", { value: true });
|
|
8
|
-
var useOnKeyDown_2 = useOnKeyDown$1.useOnKeyDown = useOnKeyDown;
|
|
9
|
-
const react_1 = React;
|
|
10
5
|
function useOnKeyDown(callback, keys) {
|
|
11
|
-
|
|
6
|
+
React.useEffect(() => {
|
|
12
7
|
window.addEventListener("keydown", handler);
|
|
13
8
|
return () => {
|
|
14
9
|
window.removeEventListener("keydown", handler);
|
|
@@ -38,4 +33,4 @@ function useOnKeyDown(callback, keys) {
|
|
|
38
33
|
}
|
|
39
34
|
}
|
|
40
35
|
|
|
41
|
-
exports.
|
|
36
|
+
exports.useOnKeyDown = useOnKeyDown;
|
package/dist/useOnKeyDown-es.js
CHANGED
|
@@ -1,12 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { useEffect } from 'react';
|
|
2
2
|
|
|
3
|
-
var useOnKeyDown$1 = {};
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(useOnKeyDown$1, "__esModule", { value: true });
|
|
6
|
-
var useOnKeyDown_2 = useOnKeyDown$1.useOnKeyDown = useOnKeyDown;
|
|
7
|
-
const react_1 = React__default;
|
|
8
3
|
function useOnKeyDown(callback, keys) {
|
|
9
|
-
|
|
4
|
+
useEffect(() => {
|
|
10
5
|
window.addEventListener("keydown", handler);
|
|
11
6
|
return () => {
|
|
12
7
|
window.removeEventListener("keydown", handler);
|
|
@@ -36,4 +31,4 @@ function useOnKeyDown(callback, keys) {
|
|
|
36
31
|
}
|
|
37
32
|
}
|
|
38
33
|
|
|
39
|
-
export {
|
|
34
|
+
export { useOnKeyDown as u };
|
|
@@ -2,11 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
var React = require('react');
|
|
4
4
|
|
|
5
|
-
var useRefocusOnActivator$1 = {};
|
|
6
|
-
|
|
7
|
-
Object.defineProperty(useRefocusOnActivator$1, "__esModule", { value: true });
|
|
8
|
-
var useRefocusOnActivator_2 = useRefocusOnActivator$1.useRefocusOnActivator = useRefocusOnActivator;
|
|
9
|
-
const react_1 = React;
|
|
10
5
|
/**
|
|
11
6
|
* Brings back the focus to the element that opened an overlaid element once
|
|
12
7
|
* said overlaid element is dismissed.
|
|
@@ -14,7 +9,7 @@ const react_1 = React;
|
|
|
14
9
|
* @param active - Determines if it should focus or not
|
|
15
10
|
*/
|
|
16
11
|
function useRefocusOnActivator(active) {
|
|
17
|
-
|
|
12
|
+
React.useEffect(() => {
|
|
18
13
|
let activator;
|
|
19
14
|
if (active && !activator) {
|
|
20
15
|
activator = document.activeElement;
|
|
@@ -30,4 +25,4 @@ function useRefocusOnActivator(active) {
|
|
|
30
25
|
}, [active]);
|
|
31
26
|
}
|
|
32
27
|
|
|
33
|
-
exports.
|
|
28
|
+
exports.useRefocusOnActivator = useRefocusOnActivator;
|
|
@@ -1,10 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { useEffect } from 'react';
|
|
2
2
|
|
|
3
|
-
var useRefocusOnActivator$1 = {};
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(useRefocusOnActivator$1, "__esModule", { value: true });
|
|
6
|
-
var useRefocusOnActivator_2 = useRefocusOnActivator$1.useRefocusOnActivator = useRefocusOnActivator;
|
|
7
|
-
const react_1 = React__default;
|
|
8
3
|
/**
|
|
9
4
|
* Brings back the focus to the element that opened an overlaid element once
|
|
10
5
|
* said overlaid element is dismissed.
|
|
@@ -12,7 +7,7 @@ const react_1 = React__default;
|
|
|
12
7
|
* @param active - Determines if it should focus or not
|
|
13
8
|
*/
|
|
14
9
|
function useRefocusOnActivator(active) {
|
|
15
|
-
|
|
10
|
+
useEffect(() => {
|
|
16
11
|
let activator;
|
|
17
12
|
if (active && !activator) {
|
|
18
13
|
activator = document.activeElement;
|
|
@@ -28,4 +23,4 @@ function useRefocusOnActivator(active) {
|
|
|
28
23
|
}, [active]);
|
|
29
24
|
}
|
|
30
25
|
|
|
31
|
-
export {
|
|
26
|
+
export { useRefocusOnActivator as u };
|
|
@@ -1,26 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var _commonjsHelpers = require('./_commonjsHelpers-cjs.js');
|
|
4
3
|
var React = require('react');
|
|
4
|
+
var _commonjsHelpers = require('./_commonjsHelpers-cjs.js');
|
|
5
5
|
var throttle$1 = require('./throttle-cjs.js');
|
|
6
6
|
|
|
7
|
-
function _mergeNamespaces(n, m) {
|
|
8
|
-
m.forEach(function (e) {
|
|
9
|
-
e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) {
|
|
10
|
-
if (k !== 'default' && !(k in n)) {
|
|
11
|
-
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
12
|
-
Object.defineProperty(n, k, d.get ? d : {
|
|
13
|
-
enumerable: true,
|
|
14
|
-
get: function () { return e[k]; }
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
});
|
|
19
|
-
return Object.freeze(n);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
var useResizeObserver$2 = {};
|
|
23
|
-
|
|
24
7
|
/**
|
|
25
8
|
* A collection of shims that provide minimal functionality of the ES6 collections.
|
|
26
9
|
*
|
|
@@ -1050,82 +1033,71 @@ function useResizeObserver$1(opts) {
|
|
|
1050
1033
|
|
|
1051
1034
|
var polyfilled = useResizeObserver$1;
|
|
1052
1035
|
|
|
1053
|
-
|
|
1054
|
-
var __importDefault = (_commonjsHelpers.commonjsGlobal && _commonjsHelpers.commonjsGlobal.__importDefault) || function (mod) {
|
|
1055
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
1056
|
-
};
|
|
1057
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1058
|
-
exports.Breakpoints = void 0;
|
|
1059
|
-
exports.useResizeObserver = useResizeObserver;
|
|
1060
|
-
const react_1 = React;
|
|
1061
|
-
// Importing the polyfilled version of ResizeObserver
|
|
1062
|
-
// eslint-disable-next-line import/no-internal-modules
|
|
1063
|
-
const polyfilled_1 = __importDefault(polyfilled);
|
|
1064
|
-
const throttle_1 = __importDefault(throttle$1.throttle_1);
|
|
1065
|
-
exports.Breakpoints = {
|
|
1066
|
-
base: 640,
|
|
1067
|
-
small: 500,
|
|
1068
|
-
smaller: 265,
|
|
1069
|
-
large: 750,
|
|
1070
|
-
larger: 1024,
|
|
1071
|
-
};
|
|
1072
|
-
const wait = 100;
|
|
1073
|
-
function useResizeObserver({ widths = exports.Breakpoints, heights = exports.Breakpoints, } = {}) {
|
|
1074
|
-
const [exactSize, setSize] = (0, react_1.useState)({
|
|
1075
|
-
width: undefined,
|
|
1076
|
-
height: undefined,
|
|
1077
|
-
});
|
|
1078
|
-
const onResize = (0, react_1.useMemo)(() => {
|
|
1079
|
-
return (0, throttle_1.default)(({ width, height }) => {
|
|
1080
|
-
if (!width || width <= 1) {
|
|
1081
|
-
// Ignore invalid values. ResizeObserver is unexpectedly looping between 1 and the actual
|
|
1082
|
-
// width of the element. This is only happening in playwright chromium.
|
|
1083
|
-
// Soon we need to replace this unmaintained package with a more reliable one.
|
|
1084
|
-
return;
|
|
1085
|
-
}
|
|
1086
|
-
setSize({ width, height });
|
|
1087
|
-
}, wait);
|
|
1088
|
-
}, []);
|
|
1089
|
-
const { ref } = (0, polyfilled_1.default)({
|
|
1090
|
-
onResize,
|
|
1091
|
-
});
|
|
1092
|
-
const exactWidth = exactSize.width;
|
|
1093
|
-
const exactHeight = exactSize.height;
|
|
1094
|
-
const sizes = {
|
|
1095
|
-
width: getSize(widths, exactSize.width),
|
|
1096
|
-
height: getSize(heights, exactSize.height),
|
|
1097
|
-
exactWidth,
|
|
1098
|
-
exactHeight,
|
|
1099
|
-
};
|
|
1100
|
-
return [ref, sizes];
|
|
1101
|
-
}
|
|
1102
|
-
/**
|
|
1103
|
-
* To get the proper size we want to make sure that our value is greater
|
|
1104
|
-
* then the comparable, but less then the next largest number in our
|
|
1105
|
-
* object.
|
|
1106
|
-
*/
|
|
1107
|
-
function getSize(sizes, comparable) {
|
|
1108
|
-
if (!comparable || !sizes) {
|
|
1109
|
-
return undefined;
|
|
1110
|
-
}
|
|
1111
|
-
/**
|
|
1112
|
-
* Sort the values of our object so that we know they are in proper
|
|
1113
|
-
* order to be compared by
|
|
1114
|
-
*/
|
|
1115
|
-
const sortedSizes = Object.values(sizes)
|
|
1116
|
-
.sort((a, b) => a - b)
|
|
1117
|
-
.reverse();
|
|
1118
|
-
return (sortedSizes.find(value => value <= comparable) ||
|
|
1119
|
-
sortedSizes[sortedSizes.length - 1]);
|
|
1120
|
-
}
|
|
1121
|
-
} (useResizeObserver$2));
|
|
1036
|
+
var useResizeObserverPackage = /*@__PURE__*/_commonjsHelpers.getDefaultExportFromCjs(polyfilled);
|
|
1122
1037
|
|
|
1123
|
-
|
|
1038
|
+
const Breakpoints = {
|
|
1039
|
+
base: 640,
|
|
1040
|
+
small: 500,
|
|
1041
|
+
smaller: 265,
|
|
1042
|
+
large: 750,
|
|
1043
|
+
larger: 1024,
|
|
1044
|
+
};
|
|
1045
|
+
const wait = 100;
|
|
1046
|
+
function useResizeObserver({ widths = Breakpoints, heights = Breakpoints, } = {}) {
|
|
1047
|
+
const [exactSize, setSize] = React.useState({
|
|
1048
|
+
width: undefined,
|
|
1049
|
+
height: undefined,
|
|
1050
|
+
});
|
|
1051
|
+
const onResize = React.useMemo(() => {
|
|
1052
|
+
return throttle$1.throttle(({ width, height }) => {
|
|
1053
|
+
if (!width || width <= 1) {
|
|
1054
|
+
// Ignore invalid values. ResizeObserver is unexpectedly looping between 1 and the actual
|
|
1055
|
+
// width of the element. This is only happening in playwright chromium.
|
|
1056
|
+
// Soon we need to replace this unmaintained package with a more reliable one.
|
|
1057
|
+
return;
|
|
1058
|
+
}
|
|
1059
|
+
setSize({ width, height });
|
|
1060
|
+
}, wait);
|
|
1061
|
+
}, []);
|
|
1062
|
+
const { ref } = useResizeObserverPackage({
|
|
1063
|
+
onResize,
|
|
1064
|
+
});
|
|
1065
|
+
const exactWidth = exactSize.width;
|
|
1066
|
+
const exactHeight = exactSize.height;
|
|
1067
|
+
const sizes = {
|
|
1068
|
+
width: getSize(widths, exactSize.width),
|
|
1069
|
+
height: getSize(heights, exactSize.height),
|
|
1070
|
+
exactWidth,
|
|
1071
|
+
exactHeight,
|
|
1072
|
+
};
|
|
1073
|
+
return [ref, sizes];
|
|
1074
|
+
}
|
|
1075
|
+
/**
|
|
1076
|
+
* To get the proper size we want to make sure that our value is greater
|
|
1077
|
+
* then the comparable, but less then the next largest number in our
|
|
1078
|
+
* object.
|
|
1079
|
+
*/
|
|
1080
|
+
function getSize(sizes, comparable) {
|
|
1081
|
+
if (!comparable || !sizes) {
|
|
1082
|
+
return undefined;
|
|
1083
|
+
}
|
|
1084
|
+
/**
|
|
1085
|
+
* Sort the values of our object so that we know they are in proper
|
|
1086
|
+
* order to be compared by
|
|
1087
|
+
*/
|
|
1088
|
+
const sortedSizes = Object.values(sizes)
|
|
1089
|
+
.sort((a, b) => a - b)
|
|
1090
|
+
.reverse();
|
|
1091
|
+
return (sortedSizes.find(value => value <= comparable) ||
|
|
1092
|
+
sortedSizes[sortedSizes.length - 1]);
|
|
1093
|
+
}
|
|
1124
1094
|
|
|
1125
|
-
var jobberHooks = /*#__PURE__*/
|
|
1095
|
+
var jobberHooks = /*#__PURE__*/Object.freeze({
|
|
1126
1096
|
__proto__: null,
|
|
1127
|
-
|
|
1128
|
-
|
|
1097
|
+
Breakpoints: Breakpoints,
|
|
1098
|
+
useResizeObserver: useResizeObserver
|
|
1099
|
+
});
|
|
1129
1100
|
|
|
1101
|
+
exports.Breakpoints = Breakpoints;
|
|
1130
1102
|
exports.jobberHooks = jobberHooks;
|
|
1131
|
-
exports.useResizeObserver = useResizeObserver
|
|
1103
|
+
exports.useResizeObserver = useResizeObserver;
|
|
@@ -1,23 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
function _mergeNamespaces(n, m) {
|
|
6
|
-
m.forEach(function (e) {
|
|
7
|
-
e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) {
|
|
8
|
-
if (k !== 'default' && !(k in n)) {
|
|
9
|
-
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
10
|
-
Object.defineProperty(n, k, d.get ? d : {
|
|
11
|
-
enumerable: true,
|
|
12
|
-
get: function () { return e[k]; }
|
|
13
|
-
});
|
|
14
|
-
}
|
|
15
|
-
});
|
|
16
|
-
});
|
|
17
|
-
return Object.freeze(n);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
var useResizeObserver$2 = {};
|
|
1
|
+
import React__default, { useState, useMemo } from 'react';
|
|
2
|
+
import { a as getAugmentedNamespace, g as getDefaultExportFromCjs } from './_commonjsHelpers-es.js';
|
|
3
|
+
import { t as throttle$1 } from './throttle-es.js';
|
|
21
4
|
|
|
22
5
|
/**
|
|
23
6
|
* A collection of shims that provide minimal functionality of the ES6 collections.
|
|
@@ -1048,81 +1031,69 @@ function useResizeObserver$1(opts) {
|
|
|
1048
1031
|
|
|
1049
1032
|
var polyfilled = useResizeObserver$1;
|
|
1050
1033
|
|
|
1051
|
-
|
|
1052
|
-
var __importDefault = (commonjsGlobal && commonjsGlobal.__importDefault) || function (mod) {
|
|
1053
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
1054
|
-
};
|
|
1055
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1056
|
-
exports.Breakpoints = void 0;
|
|
1057
|
-
exports.useResizeObserver = useResizeObserver;
|
|
1058
|
-
const react_1 = React__default;
|
|
1059
|
-
// Importing the polyfilled version of ResizeObserver
|
|
1060
|
-
// eslint-disable-next-line import/no-internal-modules
|
|
1061
|
-
const polyfilled_1 = __importDefault(polyfilled);
|
|
1062
|
-
const throttle_1$1 = __importDefault(throttle_1);
|
|
1063
|
-
exports.Breakpoints = {
|
|
1064
|
-
base: 640,
|
|
1065
|
-
small: 500,
|
|
1066
|
-
smaller: 265,
|
|
1067
|
-
large: 750,
|
|
1068
|
-
larger: 1024,
|
|
1069
|
-
};
|
|
1070
|
-
const wait = 100;
|
|
1071
|
-
function useResizeObserver({ widths = exports.Breakpoints, heights = exports.Breakpoints, } = {}) {
|
|
1072
|
-
const [exactSize, setSize] = (0, react_1.useState)({
|
|
1073
|
-
width: undefined,
|
|
1074
|
-
height: undefined,
|
|
1075
|
-
});
|
|
1076
|
-
const onResize = (0, react_1.useMemo)(() => {
|
|
1077
|
-
return (0, throttle_1$1.default)(({ width, height }) => {
|
|
1078
|
-
if (!width || width <= 1) {
|
|
1079
|
-
// Ignore invalid values. ResizeObserver is unexpectedly looping between 1 and the actual
|
|
1080
|
-
// width of the element. This is only happening in playwright chromium.
|
|
1081
|
-
// Soon we need to replace this unmaintained package with a more reliable one.
|
|
1082
|
-
return;
|
|
1083
|
-
}
|
|
1084
|
-
setSize({ width, height });
|
|
1085
|
-
}, wait);
|
|
1086
|
-
}, []);
|
|
1087
|
-
const { ref } = (0, polyfilled_1.default)({
|
|
1088
|
-
onResize,
|
|
1089
|
-
});
|
|
1090
|
-
const exactWidth = exactSize.width;
|
|
1091
|
-
const exactHeight = exactSize.height;
|
|
1092
|
-
const sizes = {
|
|
1093
|
-
width: getSize(widths, exactSize.width),
|
|
1094
|
-
height: getSize(heights, exactSize.height),
|
|
1095
|
-
exactWidth,
|
|
1096
|
-
exactHeight,
|
|
1097
|
-
};
|
|
1098
|
-
return [ref, sizes];
|
|
1099
|
-
}
|
|
1100
|
-
/**
|
|
1101
|
-
* To get the proper size we want to make sure that our value is greater
|
|
1102
|
-
* then the comparable, but less then the next largest number in our
|
|
1103
|
-
* object.
|
|
1104
|
-
*/
|
|
1105
|
-
function getSize(sizes, comparable) {
|
|
1106
|
-
if (!comparable || !sizes) {
|
|
1107
|
-
return undefined;
|
|
1108
|
-
}
|
|
1109
|
-
/**
|
|
1110
|
-
* Sort the values of our object so that we know they are in proper
|
|
1111
|
-
* order to be compared by
|
|
1112
|
-
*/
|
|
1113
|
-
const sortedSizes = Object.values(sizes)
|
|
1114
|
-
.sort((a, b) => a - b)
|
|
1115
|
-
.reverse();
|
|
1116
|
-
return (sortedSizes.find(value => value <= comparable) ||
|
|
1117
|
-
sortedSizes[sortedSizes.length - 1]);
|
|
1118
|
-
}
|
|
1119
|
-
} (useResizeObserver$2));
|
|
1034
|
+
var useResizeObserverPackage = /*@__PURE__*/getDefaultExportFromCjs(polyfilled);
|
|
1120
1035
|
|
|
1121
|
-
|
|
1036
|
+
const Breakpoints = {
|
|
1037
|
+
base: 640,
|
|
1038
|
+
small: 500,
|
|
1039
|
+
smaller: 265,
|
|
1040
|
+
large: 750,
|
|
1041
|
+
larger: 1024,
|
|
1042
|
+
};
|
|
1043
|
+
const wait = 100;
|
|
1044
|
+
function useResizeObserver({ widths = Breakpoints, heights = Breakpoints, } = {}) {
|
|
1045
|
+
const [exactSize, setSize] = useState({
|
|
1046
|
+
width: undefined,
|
|
1047
|
+
height: undefined,
|
|
1048
|
+
});
|
|
1049
|
+
const onResize = useMemo(() => {
|
|
1050
|
+
return throttle$1(({ width, height }) => {
|
|
1051
|
+
if (!width || width <= 1) {
|
|
1052
|
+
// Ignore invalid values. ResizeObserver is unexpectedly looping between 1 and the actual
|
|
1053
|
+
// width of the element. This is only happening in playwright chromium.
|
|
1054
|
+
// Soon we need to replace this unmaintained package with a more reliable one.
|
|
1055
|
+
return;
|
|
1056
|
+
}
|
|
1057
|
+
setSize({ width, height });
|
|
1058
|
+
}, wait);
|
|
1059
|
+
}, []);
|
|
1060
|
+
const { ref } = useResizeObserverPackage({
|
|
1061
|
+
onResize,
|
|
1062
|
+
});
|
|
1063
|
+
const exactWidth = exactSize.width;
|
|
1064
|
+
const exactHeight = exactSize.height;
|
|
1065
|
+
const sizes = {
|
|
1066
|
+
width: getSize(widths, exactSize.width),
|
|
1067
|
+
height: getSize(heights, exactSize.height),
|
|
1068
|
+
exactWidth,
|
|
1069
|
+
exactHeight,
|
|
1070
|
+
};
|
|
1071
|
+
return [ref, sizes];
|
|
1072
|
+
}
|
|
1073
|
+
/**
|
|
1074
|
+
* To get the proper size we want to make sure that our value is greater
|
|
1075
|
+
* then the comparable, but less then the next largest number in our
|
|
1076
|
+
* object.
|
|
1077
|
+
*/
|
|
1078
|
+
function getSize(sizes, comparable) {
|
|
1079
|
+
if (!comparable || !sizes) {
|
|
1080
|
+
return undefined;
|
|
1081
|
+
}
|
|
1082
|
+
/**
|
|
1083
|
+
* Sort the values of our object so that we know they are in proper
|
|
1084
|
+
* order to be compared by
|
|
1085
|
+
*/
|
|
1086
|
+
const sortedSizes = Object.values(sizes)
|
|
1087
|
+
.sort((a, b) => a - b)
|
|
1088
|
+
.reverse();
|
|
1089
|
+
return (sortedSizes.find(value => value <= comparable) ||
|
|
1090
|
+
sortedSizes[sortedSizes.length - 1]);
|
|
1091
|
+
}
|
|
1122
1092
|
|
|
1123
|
-
var jobberHooks = /*#__PURE__*/
|
|
1093
|
+
var jobberHooks = /*#__PURE__*/Object.freeze({
|
|
1124
1094
|
__proto__: null,
|
|
1125
|
-
|
|
1126
|
-
|
|
1095
|
+
Breakpoints: Breakpoints,
|
|
1096
|
+
useResizeObserver: useResizeObserver
|
|
1097
|
+
});
|
|
1127
1098
|
|
|
1128
|
-
export { jobberHooks as j, useResizeObserver
|
|
1099
|
+
export { Breakpoints as B, jobberHooks as j, useResizeObserver as u };
|
|
@@ -2,13 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
var React = require('react');
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
exports.useSafeLayoutEffect_1 = useSafeLayoutEffect.useSafeLayoutEffect = void 0;
|
|
9
|
-
const react_1 = React;
|
|
10
|
-
exports.useSafeLayoutEffect_1 = useSafeLayoutEffect.useSafeLayoutEffect = (globalThis === null || globalThis === void 0 ? void 0 : globalThis.document)
|
|
11
|
-
? react_1.useLayoutEffect
|
|
12
|
-
: react_1.useEffect;
|
|
5
|
+
const useSafeLayoutEffect = (globalThis === null || globalThis === void 0 ? void 0 : globalThis.document)
|
|
6
|
+
? React.useLayoutEffect
|
|
7
|
+
: React.useEffect;
|
|
13
8
|
|
|
14
9
|
exports.useSafeLayoutEffect = useSafeLayoutEffect;
|