@jobber/components 6.68.2 → 6.69.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/dist/Autocomplete/Autocomplete.types.d.ts +1 -1
- package/dist/Autocomplete/Menu/DefaultMenu.d.ts +3 -3
- package/dist/Autocomplete/Menu/MenuWrapper.d.ts +2 -3
- package/dist/Autocomplete/constants.d.ts +2 -0
- package/dist/Autocomplete/index.cjs +16 -26
- package/dist/Autocomplete/index.mjs +16 -26
- package/dist/Autocomplete/useRepositionMenu.d.ts +5 -18
- package/dist/Autocomplete-cjs.js +62 -46
- package/dist/Autocomplete-es.js +63 -47
- package/dist/Popover-es.js +1 -1
- package/dist/floating-ui.react-cjs.js +94 -0
- package/dist/floating-ui.react-es.js +94 -1
- package/dist/index.cjs +3 -3
- package/dist/index.mjs +3 -3
- package/dist/styles.css +1276 -1277
- package/package.json +2 -2
|
@@ -2920,6 +2920,88 @@ const shift$1 = function (options) {
|
|
|
2920
2920
|
};
|
|
2921
2921
|
};
|
|
2922
2922
|
|
|
2923
|
+
/**
|
|
2924
|
+
* Provides data that allows you to change the size of the floating element —
|
|
2925
|
+
* for instance, prevent it from overflowing the clipping boundary or match the
|
|
2926
|
+
* width of the reference element.
|
|
2927
|
+
* @see https://floating-ui.com/docs/size
|
|
2928
|
+
*/
|
|
2929
|
+
const size$1 = function (options) {
|
|
2930
|
+
if (options === void 0) {
|
|
2931
|
+
options = {};
|
|
2932
|
+
}
|
|
2933
|
+
return {
|
|
2934
|
+
name: 'size',
|
|
2935
|
+
options,
|
|
2936
|
+
async fn(state) {
|
|
2937
|
+
const {
|
|
2938
|
+
placement,
|
|
2939
|
+
rects,
|
|
2940
|
+
platform,
|
|
2941
|
+
elements
|
|
2942
|
+
} = state;
|
|
2943
|
+
const {
|
|
2944
|
+
apply = () => {},
|
|
2945
|
+
...detectOverflowOptions
|
|
2946
|
+
} = evaluate(options, state);
|
|
2947
|
+
const overflow = await detectOverflow(state, detectOverflowOptions);
|
|
2948
|
+
const side = getSide(placement);
|
|
2949
|
+
const alignment = getAlignment(placement);
|
|
2950
|
+
const isYAxis = getSideAxis(placement) === 'y';
|
|
2951
|
+
const {
|
|
2952
|
+
width,
|
|
2953
|
+
height
|
|
2954
|
+
} = rects.floating;
|
|
2955
|
+
let heightSide;
|
|
2956
|
+
let widthSide;
|
|
2957
|
+
if (side === 'top' || side === 'bottom') {
|
|
2958
|
+
heightSide = side;
|
|
2959
|
+
widthSide = alignment === ((await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating))) ? 'start' : 'end') ? 'left' : 'right';
|
|
2960
|
+
} else {
|
|
2961
|
+
widthSide = side;
|
|
2962
|
+
heightSide = alignment === 'end' ? 'top' : 'bottom';
|
|
2963
|
+
}
|
|
2964
|
+
const overflowAvailableHeight = height - overflow[heightSide];
|
|
2965
|
+
const overflowAvailableWidth = width - overflow[widthSide];
|
|
2966
|
+
const noShift = !state.middlewareData.shift;
|
|
2967
|
+
let availableHeight = overflowAvailableHeight;
|
|
2968
|
+
let availableWidth = overflowAvailableWidth;
|
|
2969
|
+
if (isYAxis) {
|
|
2970
|
+
const maximumClippingWidth = width - overflow.left - overflow.right;
|
|
2971
|
+
availableWidth = alignment || noShift ? min(overflowAvailableWidth, maximumClippingWidth) : maximumClippingWidth;
|
|
2972
|
+
} else {
|
|
2973
|
+
const maximumClippingHeight = height - overflow.top - overflow.bottom;
|
|
2974
|
+
availableHeight = alignment || noShift ? min(overflowAvailableHeight, maximumClippingHeight) : maximumClippingHeight;
|
|
2975
|
+
}
|
|
2976
|
+
if (noShift && !alignment) {
|
|
2977
|
+
const xMin = max(overflow.left, 0);
|
|
2978
|
+
const xMax = max(overflow.right, 0);
|
|
2979
|
+
const yMin = max(overflow.top, 0);
|
|
2980
|
+
const yMax = max(overflow.bottom, 0);
|
|
2981
|
+
if (isYAxis) {
|
|
2982
|
+
availableWidth = width - 2 * (xMin !== 0 || xMax !== 0 ? xMin + xMax : max(overflow.left, overflow.right));
|
|
2983
|
+
} else {
|
|
2984
|
+
availableHeight = height - 2 * (yMin !== 0 || yMax !== 0 ? yMin + yMax : max(overflow.top, overflow.bottom));
|
|
2985
|
+
}
|
|
2986
|
+
}
|
|
2987
|
+
await apply({
|
|
2988
|
+
...state,
|
|
2989
|
+
availableWidth,
|
|
2990
|
+
availableHeight
|
|
2991
|
+
});
|
|
2992
|
+
const nextDimensions = await platform.getDimensions(elements.floating);
|
|
2993
|
+
if (width !== nextDimensions.width || height !== nextDimensions.height) {
|
|
2994
|
+
return {
|
|
2995
|
+
reset: {
|
|
2996
|
+
rects: true
|
|
2997
|
+
}
|
|
2998
|
+
};
|
|
2999
|
+
}
|
|
3000
|
+
return {};
|
|
3001
|
+
}
|
|
3002
|
+
};
|
|
3003
|
+
};
|
|
3004
|
+
|
|
2923
3005
|
function getNodeName(node) {
|
|
2924
3006
|
if (isNode(node)) {
|
|
2925
3007
|
return (node.nodeName || '').toLowerCase();
|
|
@@ -3940,6 +4022,17 @@ const flip = (options, deps) => ({
|
|
|
3940
4022
|
options: [options, deps]
|
|
3941
4023
|
});
|
|
3942
4024
|
|
|
4025
|
+
/**
|
|
4026
|
+
* Provides data that allows you to change the size of the floating element —
|
|
4027
|
+
* for instance, prevent it from overflowing the clipping boundary or match the
|
|
4028
|
+
* width of the reference element.
|
|
4029
|
+
* @see https://floating-ui.com/docs/size
|
|
4030
|
+
*/
|
|
4031
|
+
const size = (options, deps) => ({
|
|
4032
|
+
...size$1(options),
|
|
4033
|
+
options: [options, deps]
|
|
4034
|
+
});
|
|
4035
|
+
|
|
3943
4036
|
/**
|
|
3944
4037
|
* Optimizes the visibility of the floating element by choosing the placement
|
|
3945
4038
|
* that has the most space available automatically, without needing to specify a
|
|
@@ -5892,6 +5985,7 @@ exports.autoUpdate = autoUpdate;
|
|
|
5892
5985
|
exports.flip = flip;
|
|
5893
5986
|
exports.offset = offset;
|
|
5894
5987
|
exports.shift = shift;
|
|
5988
|
+
exports.size = size;
|
|
5895
5989
|
exports.useClick = useClick;
|
|
5896
5990
|
exports.useDismiss = useDismiss;
|
|
5897
5991
|
exports.useFloating = useFloating;
|
|
@@ -2899,6 +2899,88 @@ const shift$1 = function (options) {
|
|
|
2899
2899
|
};
|
|
2900
2900
|
};
|
|
2901
2901
|
|
|
2902
|
+
/**
|
|
2903
|
+
* Provides data that allows you to change the size of the floating element —
|
|
2904
|
+
* for instance, prevent it from overflowing the clipping boundary or match the
|
|
2905
|
+
* width of the reference element.
|
|
2906
|
+
* @see https://floating-ui.com/docs/size
|
|
2907
|
+
*/
|
|
2908
|
+
const size$1 = function (options) {
|
|
2909
|
+
if (options === void 0) {
|
|
2910
|
+
options = {};
|
|
2911
|
+
}
|
|
2912
|
+
return {
|
|
2913
|
+
name: 'size',
|
|
2914
|
+
options,
|
|
2915
|
+
async fn(state) {
|
|
2916
|
+
const {
|
|
2917
|
+
placement,
|
|
2918
|
+
rects,
|
|
2919
|
+
platform,
|
|
2920
|
+
elements
|
|
2921
|
+
} = state;
|
|
2922
|
+
const {
|
|
2923
|
+
apply = () => {},
|
|
2924
|
+
...detectOverflowOptions
|
|
2925
|
+
} = evaluate(options, state);
|
|
2926
|
+
const overflow = await detectOverflow(state, detectOverflowOptions);
|
|
2927
|
+
const side = getSide(placement);
|
|
2928
|
+
const alignment = getAlignment(placement);
|
|
2929
|
+
const isYAxis = getSideAxis(placement) === 'y';
|
|
2930
|
+
const {
|
|
2931
|
+
width,
|
|
2932
|
+
height
|
|
2933
|
+
} = rects.floating;
|
|
2934
|
+
let heightSide;
|
|
2935
|
+
let widthSide;
|
|
2936
|
+
if (side === 'top' || side === 'bottom') {
|
|
2937
|
+
heightSide = side;
|
|
2938
|
+
widthSide = alignment === ((await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating))) ? 'start' : 'end') ? 'left' : 'right';
|
|
2939
|
+
} else {
|
|
2940
|
+
widthSide = side;
|
|
2941
|
+
heightSide = alignment === 'end' ? 'top' : 'bottom';
|
|
2942
|
+
}
|
|
2943
|
+
const overflowAvailableHeight = height - overflow[heightSide];
|
|
2944
|
+
const overflowAvailableWidth = width - overflow[widthSide];
|
|
2945
|
+
const noShift = !state.middlewareData.shift;
|
|
2946
|
+
let availableHeight = overflowAvailableHeight;
|
|
2947
|
+
let availableWidth = overflowAvailableWidth;
|
|
2948
|
+
if (isYAxis) {
|
|
2949
|
+
const maximumClippingWidth = width - overflow.left - overflow.right;
|
|
2950
|
+
availableWidth = alignment || noShift ? min(overflowAvailableWidth, maximumClippingWidth) : maximumClippingWidth;
|
|
2951
|
+
} else {
|
|
2952
|
+
const maximumClippingHeight = height - overflow.top - overflow.bottom;
|
|
2953
|
+
availableHeight = alignment || noShift ? min(overflowAvailableHeight, maximumClippingHeight) : maximumClippingHeight;
|
|
2954
|
+
}
|
|
2955
|
+
if (noShift && !alignment) {
|
|
2956
|
+
const xMin = max(overflow.left, 0);
|
|
2957
|
+
const xMax = max(overflow.right, 0);
|
|
2958
|
+
const yMin = max(overflow.top, 0);
|
|
2959
|
+
const yMax = max(overflow.bottom, 0);
|
|
2960
|
+
if (isYAxis) {
|
|
2961
|
+
availableWidth = width - 2 * (xMin !== 0 || xMax !== 0 ? xMin + xMax : max(overflow.left, overflow.right));
|
|
2962
|
+
} else {
|
|
2963
|
+
availableHeight = height - 2 * (yMin !== 0 || yMax !== 0 ? yMin + yMax : max(overflow.top, overflow.bottom));
|
|
2964
|
+
}
|
|
2965
|
+
}
|
|
2966
|
+
await apply({
|
|
2967
|
+
...state,
|
|
2968
|
+
availableWidth,
|
|
2969
|
+
availableHeight
|
|
2970
|
+
});
|
|
2971
|
+
const nextDimensions = await platform.getDimensions(elements.floating);
|
|
2972
|
+
if (width !== nextDimensions.width || height !== nextDimensions.height) {
|
|
2973
|
+
return {
|
|
2974
|
+
reset: {
|
|
2975
|
+
rects: true
|
|
2976
|
+
}
|
|
2977
|
+
};
|
|
2978
|
+
}
|
|
2979
|
+
return {};
|
|
2980
|
+
}
|
|
2981
|
+
};
|
|
2982
|
+
};
|
|
2983
|
+
|
|
2902
2984
|
function getNodeName(node) {
|
|
2903
2985
|
if (isNode(node)) {
|
|
2904
2986
|
return (node.nodeName || '').toLowerCase();
|
|
@@ -3919,6 +4001,17 @@ const flip = (options, deps) => ({
|
|
|
3919
4001
|
options: [options, deps]
|
|
3920
4002
|
});
|
|
3921
4003
|
|
|
4004
|
+
/**
|
|
4005
|
+
* Provides data that allows you to change the size of the floating element —
|
|
4006
|
+
* for instance, prevent it from overflowing the clipping boundary or match the
|
|
4007
|
+
* width of the reference element.
|
|
4008
|
+
* @see https://floating-ui.com/docs/size
|
|
4009
|
+
*/
|
|
4010
|
+
const size = (options, deps) => ({
|
|
4011
|
+
...size$1(options),
|
|
4012
|
+
options: [options, deps]
|
|
4013
|
+
});
|
|
4014
|
+
|
|
3922
4015
|
/**
|
|
3923
4016
|
* Optimizes the visibility of the floating element by choosing the placement
|
|
3924
4017
|
* that has the most space available automatically, without needing to specify a
|
|
@@ -5860,4 +5953,4 @@ function useRole(context, props) {
|
|
|
5860
5953
|
} : {}, [enabled, reference, floating, item]);
|
|
5861
5954
|
}
|
|
5862
5955
|
|
|
5863
|
-
export { FloatingTree as F, useFloatingNodeId as a, useFloating as b, autoPlacement as c, autoUpdate as d, useDismiss as e, useInteractions as f, FloatingNode as g, FloatingPortal as h,
|
|
5956
|
+
export { FloatingTree as F, useFloatingNodeId as a, useFloating as b, autoPlacement as c, autoUpdate as d, useDismiss as e, useInteractions as f, FloatingNode as g, FloatingPortal as h, flip as i, arrow as j, useClick as k, useRole as l, FloatingOverlay as m, FloatingFocusManager as n, offset as o, size as p, shift as s, useFloatingParentNodeId as u };
|
package/dist/index.cjs
CHANGED
|
@@ -12,9 +12,7 @@ var Heading = require('./Heading-cjs.js');
|
|
|
12
12
|
var Text = require('./Text-cjs.js');
|
|
13
13
|
var Icon = require('./Icon-cjs.js');
|
|
14
14
|
require('./useSafeLayoutEffect-cjs.js');
|
|
15
|
-
require('react-popper');
|
|
16
15
|
require('./useIsMounted-cjs.js');
|
|
17
|
-
require('react-dom');
|
|
18
16
|
var Avatar = require('./Avatar-cjs.js');
|
|
19
17
|
var Banner = require('./Banner-cjs.js');
|
|
20
18
|
var Box = require('./Box-cjs.js');
|
|
@@ -112,6 +110,8 @@ require('./keysIn-cjs.js');
|
|
|
112
110
|
require('./_isIterateeCall-cjs.js');
|
|
113
111
|
require('./_setToString-cjs.js');
|
|
114
112
|
require('./tslib.es6-cjs.js');
|
|
113
|
+
require('./floating-ui.react-cjs.js');
|
|
114
|
+
require('react-dom');
|
|
115
115
|
require('./useOnKeyDown-cjs.js');
|
|
116
116
|
require('./useDebounce-cjs.js');
|
|
117
117
|
require('./debounce-cjs.js');
|
|
@@ -129,8 +129,8 @@ require('./_baseFlatten-cjs.js');
|
|
|
129
129
|
require('./_baseGet-cjs.js');
|
|
130
130
|
require('./_getTag-cjs.js');
|
|
131
131
|
require('./_baseEach-cjs.js');
|
|
132
|
+
require('react-popper');
|
|
132
133
|
require('./ComboboxContent-cjs.js');
|
|
133
|
-
require('./floating-ui.react-cjs.js');
|
|
134
134
|
require('./ComboboxContentSearch-cjs.js');
|
|
135
135
|
require('./ComboboxContentList-cjs.js');
|
|
136
136
|
require('./ComboboxOption-cjs.js');
|
package/dist/index.mjs
CHANGED
|
@@ -10,9 +10,7 @@ export { H as Heading } from './Heading-es.js';
|
|
|
10
10
|
export { T as Text } from './Text-es.js';
|
|
11
11
|
export { I as Icon } from './Icon-es.js';
|
|
12
12
|
import './useSafeLayoutEffect-es.js';
|
|
13
|
-
import 'react-popper';
|
|
14
13
|
import './useIsMounted-es.js';
|
|
15
|
-
import 'react-dom';
|
|
16
14
|
export { A as Avatar } from './Avatar-es.js';
|
|
17
15
|
export { B as Banner } from './Banner-es.js';
|
|
18
16
|
export { B as Box } from './Box-es.js';
|
|
@@ -110,6 +108,8 @@ import './keysIn-es.js';
|
|
|
110
108
|
import './_isIterateeCall-es.js';
|
|
111
109
|
import './_setToString-es.js';
|
|
112
110
|
import './tslib.es6-es.js';
|
|
111
|
+
import './floating-ui.react-es.js';
|
|
112
|
+
import 'react-dom';
|
|
113
113
|
import './useOnKeyDown-es.js';
|
|
114
114
|
import './useDebounce-es.js';
|
|
115
115
|
import './debounce-es.js';
|
|
@@ -127,8 +127,8 @@ import './_baseFlatten-es.js';
|
|
|
127
127
|
import './_baseGet-es.js';
|
|
128
128
|
import './_getTag-es.js';
|
|
129
129
|
import './_baseEach-es.js';
|
|
130
|
+
import 'react-popper';
|
|
130
131
|
import './ComboboxContent-es.js';
|
|
131
|
-
import './floating-ui.react-es.js';
|
|
132
132
|
import './ComboboxContentSearch-es.js';
|
|
133
133
|
import './ComboboxContentList-es.js';
|
|
134
134
|
import './ComboboxOption-es.js';
|