@jobber/components 6.110.0 → 6.110.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/dist/Autocomplete/index.mjs +1 -1
- package/dist/ComboboxContent-es.js +1 -1
- package/dist/DatePicker-es.js +1 -1
- package/dist/Modal/index.mjs +1 -1
- package/dist/Popover-es.js +1 -1
- package/dist/Tooltip/useTooltipPositioning.d.ts +1 -0
- package/dist/Tooltip-cjs.js +8 -5
- package/dist/Tooltip-es.js +9 -6
- package/dist/floating-ui.react-cjs.js +87 -0
- package/dist/floating-ui.react-es.js +87 -1
- package/dist/styles.css +4 -0
- package/package.json +2 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React__default, { useState, useRef, useEffect, useCallback, useMemo, forwardRef } from 'react';
|
|
2
|
-
import { u as useFloating, b as autoUpdate, o as offset, f as flip, c as size,
|
|
2
|
+
import { u as useFloating, b as autoUpdate, o as offset, f as flip, c as size, t as useClick, e as useListNavigation, d as useDismiss, g as useInteractions, v as useTransitionStyles, F as FloatingPortal, q as FloatingFocusManager } from '../floating-ui.react-es.js';
|
|
3
3
|
import classnames from 'classnames';
|
|
4
4
|
import { tokens } from '@jobber/design';
|
|
5
5
|
import { useCallbackRef, useDebounce, useSafeLayoutEffect, useIsMounted, useOnKeyDown } from '@jobber/hooks';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React__default, { useContext, useRef, useEffect, useMemo } from 'react';
|
|
2
2
|
import classnames from 'classnames';
|
|
3
|
-
import {
|
|
3
|
+
import { i as useFloatingParentNodeId, j as useFloatingNodeId, u as useFloating, o as offset, f as flip, d as useDismiss, g as useInteractions, b as autoUpdate, k as FloatingTree, m as FloatingNode, F as FloatingPortal } from './floating-ui.react-es.js';
|
|
4
4
|
import { C as ComboboxContentSearch } from './ComboboxContentSearch-es.js';
|
|
5
5
|
import { C as ComboboxContentList } from './ComboboxContentList-es.js';
|
|
6
6
|
import { C as ComboboxContentHeader } from './ComboboxContentHeader-es.js';
|
package/dist/DatePicker-es.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React__default, { cloneElement, Component, createRef, useRef, useCallback, useEffect, createElement, forwardRef, isValidElement, useState } from 'react';
|
|
2
2
|
import classnames from 'classnames';
|
|
3
3
|
import { c as clsx } from './clsx-es.js';
|
|
4
|
-
import { u as useFloating, b as autoUpdate, f as flip, o as offset, a as arrow,
|
|
4
|
+
import { u as useFloating, b as autoUpdate, f as flip, o as offset, a as arrow, w as FloatingArrow } from './floating-ui.react-es.js';
|
|
5
5
|
import ReactDOM__default from 'react-dom';
|
|
6
6
|
import { useRefocusOnActivator } from '@jobber/hooks';
|
|
7
7
|
import { T as Typography } from './Typography-es.js';
|
package/dist/Modal/index.mjs
CHANGED
|
@@ -7,7 +7,7 @@ import { H as Heading } from '../Heading-es.js';
|
|
|
7
7
|
import { B as Button } from '../Button-es.js';
|
|
8
8
|
import { B as ButtonDismiss } from '../ButtonDismiss-es.js';
|
|
9
9
|
import { n as noop } from '../noop-es.js';
|
|
10
|
-
import {
|
|
10
|
+
import { j as useFloatingNodeId, u as useFloating, d as useDismiss, p as useRole, g as useInteractions, i as useFloatingParentNodeId, k as FloatingTree, m as FloatingNode, F as FloatingPortal, q as FloatingFocusManager, r as FloatingOverlay } from '../floating-ui.react-es.js';
|
|
11
11
|
import { b as identity } from '../identity-es.js';
|
|
12
12
|
import { A as AtlantisPortalContent } from '../AtlantisPortalContent-es.js';
|
|
13
13
|
import '../Typography-es.js';
|
package/dist/Popover-es.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { _ as __rest } from './tslib.es6-es.js';
|
|
2
2
|
import React__default, { useState, useMemo, createContext, useContext } from 'react';
|
|
3
3
|
import classnames from 'classnames';
|
|
4
|
-
import { a as arrow, u as useFloating, b as autoUpdate, o as offset, s as shift, l as limitShift,
|
|
4
|
+
import { a as arrow, u as useFloating, b as autoUpdate, o as offset, s as shift, l as limitShift, n as autoPlacement, f as flip, F as FloatingPortal } from './floating-ui.react-es.js';
|
|
5
5
|
import { useRefocusOnActivator } from '@jobber/hooks';
|
|
6
6
|
import { A as AtlantisPortalContent } from './AtlantisPortalContent-es.js';
|
|
7
7
|
import { B as ButtonDismiss } from './ButtonDismiss-es.js';
|
|
@@ -10,6 +10,7 @@ export declare function useTooltipPositioning({ preferredPlacement, }: ToolTipPo
|
|
|
10
10
|
alignmentOffset?: number;
|
|
11
11
|
}) | undefined;
|
|
12
12
|
};
|
|
13
|
+
isHidden: boolean;
|
|
13
14
|
placement: import("@floating-ui/utils").Placement;
|
|
14
15
|
shadowRef: import("react").RefObject<HTMLSpanElement | null>;
|
|
15
16
|
setArrowRef: import("react").Dispatch<import("react").SetStateAction<HTMLDivElement | null | undefined>>;
|
package/dist/Tooltip-cjs.js
CHANGED
|
@@ -6,12 +6,12 @@ var floatingUi_react = require('./floating-ui.react-cjs.js');
|
|
|
6
6
|
var framerMotion = require('framer-motion');
|
|
7
7
|
var jobberHooks = require('@jobber/hooks');
|
|
8
8
|
|
|
9
|
-
var styles = {"shadowActivator":"sZQ1M6tj8-c-","tooltipWrapper":"_0o-yEgfXmSQ-","tooltip":"Q1YfFqI71cw-","arrow":"ZP3ev-wT-OI-","top":"jlEmO6f6uHg-","bottom":"z9JQ-DR-QYc-","left":"zWATWgq3bS4-","right":"-tDm6lNCCic-","tooltipMessage":"djrmr4mADlA-","spinning":"bobYmlUMnuY-"};
|
|
9
|
+
var styles = {"shadowActivator":"sZQ1M6tj8-c-","tooltipWrapper":"_0o-yEgfXmSQ-","tooltip":"Q1YfFqI71cw-","arrow":"ZP3ev-wT-OI-","top":"jlEmO6f6uHg-","bottom":"z9JQ-DR-QYc-","left":"zWATWgq3bS4-","right":"-tDm6lNCCic-","tooltipMessage":"djrmr4mADlA-","hidden":"p92TIli5Sgw-","spinning":"bobYmlUMnuY-"};
|
|
10
10
|
|
|
11
11
|
const TOOLTIP_SHIFT_PADDING = 8;
|
|
12
12
|
const TOOLTIP_ARROW_PADDING = 6;
|
|
13
13
|
function useTooltipPositioning({ preferredPlacement, }) {
|
|
14
|
-
var _a;
|
|
14
|
+
var _a, _b, _c;
|
|
15
15
|
const shadowRef = React.useRef(null);
|
|
16
16
|
const [arrowElement, setArrowRef] = React.useState();
|
|
17
17
|
const referenceElement = (_a = shadowRef.current) === null || _a === void 0 ? void 0 : _a.nextElementSibling;
|
|
@@ -30,17 +30,20 @@ function useTooltipPositioning({ preferredPlacement, }) {
|
|
|
30
30
|
element: arrowElement || null,
|
|
31
31
|
padding: TOOLTIP_ARROW_PADDING,
|
|
32
32
|
}),
|
|
33
|
+
floatingUi_react.hide(),
|
|
33
34
|
],
|
|
34
35
|
elements: {
|
|
35
36
|
reference: referenceElement || null,
|
|
36
37
|
},
|
|
37
38
|
whileElementsMounted: floatingUi_react.autoUpdate,
|
|
38
39
|
});
|
|
40
|
+
const isHidden = (_c = (_b = middlewareData.hide) === null || _b === void 0 ? void 0 : _b.referenceHidden) !== null && _c !== void 0 ? _c : false;
|
|
39
41
|
return {
|
|
40
42
|
styles: {
|
|
41
43
|
float: floatingStyles,
|
|
42
44
|
arrow: middlewareData.arrow,
|
|
43
45
|
},
|
|
46
|
+
isHidden,
|
|
44
47
|
placement: placement,
|
|
45
48
|
shadowRef,
|
|
46
49
|
setArrowRef,
|
|
@@ -55,9 +58,9 @@ const variation = {
|
|
|
55
58
|
function Tooltip({ message, children, preferredPlacement = "top", setTabIndex = true, }) {
|
|
56
59
|
var _a, _b, _c, _d;
|
|
57
60
|
const [show, setShow] = React.useState(false);
|
|
58
|
-
const { placement, shadowRef, styles: floatingStyles, setArrowRef, setTooltipRef, } = useTooltipPositioning({ preferredPlacement: preferredPlacement });
|
|
61
|
+
const { placement, shadowRef, styles: floatingStyles, setArrowRef, setTooltipRef, isHidden, } = useTooltipPositioning({ preferredPlacement: preferredPlacement });
|
|
59
62
|
initializeListeners();
|
|
60
|
-
const toolTipClassNames = classnames(styles.tooltipWrapper, placement === "bottom" && styles.bottom, placement === "top" && styles.top, placement === "left" && styles.left, placement === "right" && styles.right);
|
|
63
|
+
const toolTipClassNames = classnames(styles.tooltipWrapper, placement === "bottom" && styles.bottom, placement === "top" && styles.top, placement === "left" && styles.left, placement === "right" && styles.right, isHidden && styles.hidden);
|
|
61
64
|
const arrowX = (_a = floatingStyles.arrow) === null || _a === void 0 ? void 0 : _a.x;
|
|
62
65
|
const arrowY = (_b = floatingStyles.arrow) === null || _b === void 0 ? void 0 : _b.y;
|
|
63
66
|
const arrowStyles = {
|
|
@@ -72,7 +75,7 @@ function Tooltip({ message, children, preferredPlacement = "top", setTabIndex =
|
|
|
72
75
|
return (React.createElement(React.Fragment, null,
|
|
73
76
|
React.createElement("span", { className: styles.shadowActivator, ref: shadowRef }),
|
|
74
77
|
children,
|
|
75
|
-
React.createElement(TooltipPortal, null, show && Boolean(message) && (React.createElement("div", { className: toolTipClassNames, style: floatingStyles.float, ref: setTooltipRef, role: "tooltip", "data-placement": placement },
|
|
78
|
+
React.createElement(TooltipPortal, null, show && Boolean(message) && (React.createElement("div", { className: toolTipClassNames, style: floatingStyles.float, ref: setTooltipRef, role: "tooltip", hidden: isHidden, "data-placement": placement },
|
|
76
79
|
React.createElement(framerMotion.motion.div, { className: styles.tooltip, variants: variation, initial: "startOrStop", animate: "done", exit: "startOrStop", transition: {
|
|
77
80
|
ease: "easeOut",
|
|
78
81
|
duration: 0.15,
|
package/dist/Tooltip-es.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import React__default, { useRef, useState } from 'react';
|
|
2
2
|
import classnames from 'classnames';
|
|
3
|
-
import { u as useFloating, s as shift, f as flip, a as arrow, b as autoUpdate, l as limitShift, F as FloatingPortal } from './floating-ui.react-es.js';
|
|
3
|
+
import { u as useFloating, s as shift, f as flip, a as arrow, h as hide, b as autoUpdate, l as limitShift, F as FloatingPortal } from './floating-ui.react-es.js';
|
|
4
4
|
import { motion } from 'framer-motion';
|
|
5
5
|
import { useSafeLayoutEffect, useIsMounted } from '@jobber/hooks';
|
|
6
6
|
|
|
7
|
-
var styles = {"shadowActivator":"sZQ1M6tj8-c-","tooltipWrapper":"_0o-yEgfXmSQ-","tooltip":"Q1YfFqI71cw-","arrow":"ZP3ev-wT-OI-","top":"jlEmO6f6uHg-","bottom":"z9JQ-DR-QYc-","left":"zWATWgq3bS4-","right":"-tDm6lNCCic-","tooltipMessage":"djrmr4mADlA-","spinning":"bobYmlUMnuY-"};
|
|
7
|
+
var styles = {"shadowActivator":"sZQ1M6tj8-c-","tooltipWrapper":"_0o-yEgfXmSQ-","tooltip":"Q1YfFqI71cw-","arrow":"ZP3ev-wT-OI-","top":"jlEmO6f6uHg-","bottom":"z9JQ-DR-QYc-","left":"zWATWgq3bS4-","right":"-tDm6lNCCic-","tooltipMessage":"djrmr4mADlA-","hidden":"p92TIli5Sgw-","spinning":"bobYmlUMnuY-"};
|
|
8
8
|
|
|
9
9
|
const TOOLTIP_SHIFT_PADDING = 8;
|
|
10
10
|
const TOOLTIP_ARROW_PADDING = 6;
|
|
11
11
|
function useTooltipPositioning({ preferredPlacement, }) {
|
|
12
|
-
var _a;
|
|
12
|
+
var _a, _b, _c;
|
|
13
13
|
const shadowRef = useRef(null);
|
|
14
14
|
const [arrowElement, setArrowRef] = useState();
|
|
15
15
|
const referenceElement = (_a = shadowRef.current) === null || _a === void 0 ? void 0 : _a.nextElementSibling;
|
|
@@ -28,17 +28,20 @@ function useTooltipPositioning({ preferredPlacement, }) {
|
|
|
28
28
|
element: arrowElement || null,
|
|
29
29
|
padding: TOOLTIP_ARROW_PADDING,
|
|
30
30
|
}),
|
|
31
|
+
hide(),
|
|
31
32
|
],
|
|
32
33
|
elements: {
|
|
33
34
|
reference: referenceElement || null,
|
|
34
35
|
},
|
|
35
36
|
whileElementsMounted: autoUpdate,
|
|
36
37
|
});
|
|
38
|
+
const isHidden = (_c = (_b = middlewareData.hide) === null || _b === void 0 ? void 0 : _b.referenceHidden) !== null && _c !== void 0 ? _c : false;
|
|
37
39
|
return {
|
|
38
40
|
styles: {
|
|
39
41
|
float: floatingStyles,
|
|
40
42
|
arrow: middlewareData.arrow,
|
|
41
43
|
},
|
|
44
|
+
isHidden,
|
|
42
45
|
placement: placement,
|
|
43
46
|
shadowRef,
|
|
44
47
|
setArrowRef,
|
|
@@ -53,9 +56,9 @@ const variation = {
|
|
|
53
56
|
function Tooltip({ message, children, preferredPlacement = "top", setTabIndex = true, }) {
|
|
54
57
|
var _a, _b, _c, _d;
|
|
55
58
|
const [show, setShow] = useState(false);
|
|
56
|
-
const { placement, shadowRef, styles: floatingStyles, setArrowRef, setTooltipRef, } = useTooltipPositioning({ preferredPlacement: preferredPlacement });
|
|
59
|
+
const { placement, shadowRef, styles: floatingStyles, setArrowRef, setTooltipRef, isHidden, } = useTooltipPositioning({ preferredPlacement: preferredPlacement });
|
|
57
60
|
initializeListeners();
|
|
58
|
-
const toolTipClassNames = classnames(styles.tooltipWrapper, placement === "bottom" && styles.bottom, placement === "top" && styles.top, placement === "left" && styles.left, placement === "right" && styles.right);
|
|
61
|
+
const toolTipClassNames = classnames(styles.tooltipWrapper, placement === "bottom" && styles.bottom, placement === "top" && styles.top, placement === "left" && styles.left, placement === "right" && styles.right, isHidden && styles.hidden);
|
|
59
62
|
const arrowX = (_a = floatingStyles.arrow) === null || _a === void 0 ? void 0 : _a.x;
|
|
60
63
|
const arrowY = (_b = floatingStyles.arrow) === null || _b === void 0 ? void 0 : _b.y;
|
|
61
64
|
const arrowStyles = {
|
|
@@ -70,7 +73,7 @@ function Tooltip({ message, children, preferredPlacement = "top", setTabIndex =
|
|
|
70
73
|
return (React__default.createElement(React__default.Fragment, null,
|
|
71
74
|
React__default.createElement("span", { className: styles.shadowActivator, ref: shadowRef }),
|
|
72
75
|
children,
|
|
73
|
-
React__default.createElement(TooltipPortal, null, show && Boolean(message) && (React__default.createElement("div", { className: toolTipClassNames, style: floatingStyles.float, ref: setTooltipRef, role: "tooltip", "data-placement": placement },
|
|
76
|
+
React__default.createElement(TooltipPortal, null, show && Boolean(message) && (React__default.createElement("div", { className: toolTipClassNames, style: floatingStyles.float, ref: setTooltipRef, role: "tooltip", hidden: isHidden, "data-placement": placement },
|
|
74
77
|
React__default.createElement(motion.div, { className: styles.tooltip, variants: variation, initial: "startOrStop", animate: "done", exit: "startOrStop", transition: {
|
|
75
78
|
ease: "easeOut",
|
|
76
79
|
duration: 0.15,
|
|
@@ -1923,6 +1923,75 @@ const flip$2 = function (options) {
|
|
|
1923
1923
|
};
|
|
1924
1924
|
};
|
|
1925
1925
|
|
|
1926
|
+
function getSideOffsets(overflow, rect) {
|
|
1927
|
+
return {
|
|
1928
|
+
top: overflow.top - rect.height,
|
|
1929
|
+
right: overflow.right - rect.width,
|
|
1930
|
+
bottom: overflow.bottom - rect.height,
|
|
1931
|
+
left: overflow.left - rect.width
|
|
1932
|
+
};
|
|
1933
|
+
}
|
|
1934
|
+
function isAnySideFullyClipped(overflow) {
|
|
1935
|
+
return sides.some(side => overflow[side] >= 0);
|
|
1936
|
+
}
|
|
1937
|
+
/**
|
|
1938
|
+
* Provides data to hide the floating element in applicable situations, such as
|
|
1939
|
+
* when it is not in the same clipping context as the reference element.
|
|
1940
|
+
* @see https://floating-ui.com/docs/hide
|
|
1941
|
+
*/
|
|
1942
|
+
const hide$2 = function (options) {
|
|
1943
|
+
if (options === void 0) {
|
|
1944
|
+
options = {};
|
|
1945
|
+
}
|
|
1946
|
+
return {
|
|
1947
|
+
name: 'hide',
|
|
1948
|
+
options,
|
|
1949
|
+
async fn(state) {
|
|
1950
|
+
const {
|
|
1951
|
+
rects
|
|
1952
|
+
} = state;
|
|
1953
|
+
const {
|
|
1954
|
+
strategy = 'referenceHidden',
|
|
1955
|
+
...detectOverflowOptions
|
|
1956
|
+
} = evaluate(options, state);
|
|
1957
|
+
switch (strategy) {
|
|
1958
|
+
case 'referenceHidden':
|
|
1959
|
+
{
|
|
1960
|
+
const overflow = await detectOverflow(state, {
|
|
1961
|
+
...detectOverflowOptions,
|
|
1962
|
+
elementContext: 'reference'
|
|
1963
|
+
});
|
|
1964
|
+
const offsets = getSideOffsets(overflow, rects.reference);
|
|
1965
|
+
return {
|
|
1966
|
+
data: {
|
|
1967
|
+
referenceHiddenOffsets: offsets,
|
|
1968
|
+
referenceHidden: isAnySideFullyClipped(offsets)
|
|
1969
|
+
}
|
|
1970
|
+
};
|
|
1971
|
+
}
|
|
1972
|
+
case 'escaped':
|
|
1973
|
+
{
|
|
1974
|
+
const overflow = await detectOverflow(state, {
|
|
1975
|
+
...detectOverflowOptions,
|
|
1976
|
+
altBoundary: true
|
|
1977
|
+
});
|
|
1978
|
+
const offsets = getSideOffsets(overflow, rects.floating);
|
|
1979
|
+
return {
|
|
1980
|
+
data: {
|
|
1981
|
+
escapedOffsets: offsets,
|
|
1982
|
+
escaped: isAnySideFullyClipped(offsets)
|
|
1983
|
+
}
|
|
1984
|
+
};
|
|
1985
|
+
}
|
|
1986
|
+
default:
|
|
1987
|
+
{
|
|
1988
|
+
return {};
|
|
1989
|
+
}
|
|
1990
|
+
}
|
|
1991
|
+
}
|
|
1992
|
+
};
|
|
1993
|
+
};
|
|
1994
|
+
|
|
1926
1995
|
const originSides = /*#__PURE__*/new Set(['left', 'top']);
|
|
1927
1996
|
|
|
1928
1997
|
// For type backwards-compatibility, the `OffsetOptions` type was also
|
|
@@ -2951,6 +3020,13 @@ const flip$1 = flip$2;
|
|
|
2951
3020
|
*/
|
|
2952
3021
|
const size$1 = size$2;
|
|
2953
3022
|
|
|
3023
|
+
/**
|
|
3024
|
+
* Provides data to hide the floating element in applicable situations, such as
|
|
3025
|
+
* when it is not in the same clipping context as the reference element.
|
|
3026
|
+
* @see https://floating-ui.com/docs/hide
|
|
3027
|
+
*/
|
|
3028
|
+
const hide$1 = hide$2;
|
|
3029
|
+
|
|
2954
3030
|
/**
|
|
2955
3031
|
* Provides data to position an inner element of the floating element so that it
|
|
2956
3032
|
* appears centered to the reference element.
|
|
@@ -3319,6 +3395,16 @@ const autoPlacement = (options, deps) => ({
|
|
|
3319
3395
|
options: [options, deps]
|
|
3320
3396
|
});
|
|
3321
3397
|
|
|
3398
|
+
/**
|
|
3399
|
+
* Provides data to hide the floating element in applicable situations, such as
|
|
3400
|
+
* when it is not in the same clipping context as the reference element.
|
|
3401
|
+
* @see https://floating-ui.com/docs/hide
|
|
3402
|
+
*/
|
|
3403
|
+
const hide = (options, deps) => ({
|
|
3404
|
+
...hide$1(options),
|
|
3405
|
+
options: [options, deps]
|
|
3406
|
+
});
|
|
3407
|
+
|
|
3322
3408
|
/**
|
|
3323
3409
|
* Provides data to position an inner element of the floating element so that it
|
|
3324
3410
|
* appears centered to the reference element.
|
|
@@ -6053,6 +6139,7 @@ exports.arrow = arrow;
|
|
|
6053
6139
|
exports.autoPlacement = autoPlacement;
|
|
6054
6140
|
exports.autoUpdate = autoUpdate;
|
|
6055
6141
|
exports.flip = flip;
|
|
6142
|
+
exports.hide = hide;
|
|
6056
6143
|
exports.limitShift = limitShift;
|
|
6057
6144
|
exports.offset = offset;
|
|
6058
6145
|
exports.shift = shift;
|
|
@@ -1902,6 +1902,75 @@ const flip$2 = function (options) {
|
|
|
1902
1902
|
};
|
|
1903
1903
|
};
|
|
1904
1904
|
|
|
1905
|
+
function getSideOffsets(overflow, rect) {
|
|
1906
|
+
return {
|
|
1907
|
+
top: overflow.top - rect.height,
|
|
1908
|
+
right: overflow.right - rect.width,
|
|
1909
|
+
bottom: overflow.bottom - rect.height,
|
|
1910
|
+
left: overflow.left - rect.width
|
|
1911
|
+
};
|
|
1912
|
+
}
|
|
1913
|
+
function isAnySideFullyClipped(overflow) {
|
|
1914
|
+
return sides.some(side => overflow[side] >= 0);
|
|
1915
|
+
}
|
|
1916
|
+
/**
|
|
1917
|
+
* Provides data to hide the floating element in applicable situations, such as
|
|
1918
|
+
* when it is not in the same clipping context as the reference element.
|
|
1919
|
+
* @see https://floating-ui.com/docs/hide
|
|
1920
|
+
*/
|
|
1921
|
+
const hide$2 = function (options) {
|
|
1922
|
+
if (options === void 0) {
|
|
1923
|
+
options = {};
|
|
1924
|
+
}
|
|
1925
|
+
return {
|
|
1926
|
+
name: 'hide',
|
|
1927
|
+
options,
|
|
1928
|
+
async fn(state) {
|
|
1929
|
+
const {
|
|
1930
|
+
rects
|
|
1931
|
+
} = state;
|
|
1932
|
+
const {
|
|
1933
|
+
strategy = 'referenceHidden',
|
|
1934
|
+
...detectOverflowOptions
|
|
1935
|
+
} = evaluate(options, state);
|
|
1936
|
+
switch (strategy) {
|
|
1937
|
+
case 'referenceHidden':
|
|
1938
|
+
{
|
|
1939
|
+
const overflow = await detectOverflow(state, {
|
|
1940
|
+
...detectOverflowOptions,
|
|
1941
|
+
elementContext: 'reference'
|
|
1942
|
+
});
|
|
1943
|
+
const offsets = getSideOffsets(overflow, rects.reference);
|
|
1944
|
+
return {
|
|
1945
|
+
data: {
|
|
1946
|
+
referenceHiddenOffsets: offsets,
|
|
1947
|
+
referenceHidden: isAnySideFullyClipped(offsets)
|
|
1948
|
+
}
|
|
1949
|
+
};
|
|
1950
|
+
}
|
|
1951
|
+
case 'escaped':
|
|
1952
|
+
{
|
|
1953
|
+
const overflow = await detectOverflow(state, {
|
|
1954
|
+
...detectOverflowOptions,
|
|
1955
|
+
altBoundary: true
|
|
1956
|
+
});
|
|
1957
|
+
const offsets = getSideOffsets(overflow, rects.floating);
|
|
1958
|
+
return {
|
|
1959
|
+
data: {
|
|
1960
|
+
escapedOffsets: offsets,
|
|
1961
|
+
escaped: isAnySideFullyClipped(offsets)
|
|
1962
|
+
}
|
|
1963
|
+
};
|
|
1964
|
+
}
|
|
1965
|
+
default:
|
|
1966
|
+
{
|
|
1967
|
+
return {};
|
|
1968
|
+
}
|
|
1969
|
+
}
|
|
1970
|
+
}
|
|
1971
|
+
};
|
|
1972
|
+
};
|
|
1973
|
+
|
|
1905
1974
|
const originSides = /*#__PURE__*/new Set(['left', 'top']);
|
|
1906
1975
|
|
|
1907
1976
|
// For type backwards-compatibility, the `OffsetOptions` type was also
|
|
@@ -2930,6 +2999,13 @@ const flip$1 = flip$2;
|
|
|
2930
2999
|
*/
|
|
2931
3000
|
const size$1 = size$2;
|
|
2932
3001
|
|
|
3002
|
+
/**
|
|
3003
|
+
* Provides data to hide the floating element in applicable situations, such as
|
|
3004
|
+
* when it is not in the same clipping context as the reference element.
|
|
3005
|
+
* @see https://floating-ui.com/docs/hide
|
|
3006
|
+
*/
|
|
3007
|
+
const hide$1 = hide$2;
|
|
3008
|
+
|
|
2933
3009
|
/**
|
|
2934
3010
|
* Provides data to position an inner element of the floating element so that it
|
|
2935
3011
|
* appears centered to the reference element.
|
|
@@ -3298,6 +3374,16 @@ const autoPlacement = (options, deps) => ({
|
|
|
3298
3374
|
options: [options, deps]
|
|
3299
3375
|
});
|
|
3300
3376
|
|
|
3377
|
+
/**
|
|
3378
|
+
* Provides data to hide the floating element in applicable situations, such as
|
|
3379
|
+
* when it is not in the same clipping context as the reference element.
|
|
3380
|
+
* @see https://floating-ui.com/docs/hide
|
|
3381
|
+
*/
|
|
3382
|
+
const hide = (options, deps) => ({
|
|
3383
|
+
...hide$1(options),
|
|
3384
|
+
options: [options, deps]
|
|
3385
|
+
});
|
|
3386
|
+
|
|
3301
3387
|
/**
|
|
3302
3388
|
* Provides data to position an inner element of the floating element so that it
|
|
3303
3389
|
* appears centered to the reference element.
|
|
@@ -6022,4 +6108,4 @@ function useTransitionStyles(context, props) {
|
|
|
6022
6108
|
};
|
|
6023
6109
|
}
|
|
6024
6110
|
|
|
6025
|
-
export { FloatingPortal as F, arrow as a, autoUpdate as b, size as c, useDismiss as d, useListNavigation as e, flip as f, useInteractions as g,
|
|
6111
|
+
export { FloatingPortal as F, arrow as a, autoUpdate as b, size as c, useDismiss as d, useListNavigation as e, flip as f, useInteractions as g, hide as h, useFloatingParentNodeId as i, useFloatingNodeId as j, FloatingTree as k, limitShift as l, FloatingNode as m, autoPlacement as n, offset as o, useRole as p, FloatingFocusManager as q, FloatingOverlay as r, shift as s, useClick as t, useFloating as u, useTransitionStyles as v, FloatingArrow as w };
|
package/dist/styles.css
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jobber/components",
|
|
3
|
-
"version": "6.110.
|
|
3
|
+
"version": "6.110.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.cjs",
|
|
@@ -538,5 +538,5 @@
|
|
|
538
538
|
"> 1%",
|
|
539
539
|
"IE 10"
|
|
540
540
|
],
|
|
541
|
-
"gitHead": "
|
|
541
|
+
"gitHead": "e3b22e719eadef5d682e75700a590438e700b227"
|
|
542
542
|
}
|