@jobber/components 6.122.0 → 6.123.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/index.cjs +1 -0
- package/dist/Autocomplete/index.mjs +2 -1
- package/dist/BottomSheet-cjs.js +66 -0
- package/dist/BottomSheet-es.js +64 -0
- package/dist/Card/index.cjs +3 -2
- package/dist/Card/index.mjs +3 -2
- package/dist/Chip/index.cjs +3 -2
- package/dist/Chip/index.mjs +3 -2
- package/dist/Chips/InternalChipDismissible/hooks/index.cjs +3 -2
- package/dist/Chips/InternalChipDismissible/hooks/index.mjs +3 -2
- package/dist/Chips/InternalChipDismissible/index.cjs +3 -2
- package/dist/Chips/InternalChipDismissible/index.mjs +3 -2
- package/dist/Chips/index.cjs +3 -2
- package/dist/Chips/index.mjs +3 -2
- package/dist/Combobox/components/ComboboxActivator/index.cjs +3 -2
- package/dist/Combobox/components/ComboboxActivator/index.mjs +3 -2
- package/dist/Combobox/components/ComboboxContent/index.cjs +3 -2
- package/dist/Combobox/components/ComboboxContent/index.mjs +3 -2
- package/dist/Combobox/components/ComboboxTrigger/index.cjs +3 -2
- package/dist/Combobox/components/ComboboxTrigger/index.mjs +3 -2
- package/dist/Combobox/index.cjs +3 -2
- package/dist/Combobox/index.mjs +3 -2
- package/dist/ComboboxContent-es.js +1 -1
- package/dist/ConfirmationModal/index.cjs +2 -1
- package/dist/ConfirmationModal/index.mjs +2 -1
- package/dist/DataDump/index.cjs +3 -2
- package/dist/DataDump/index.mjs +3 -2
- package/dist/DataList/components/DataListActions/index.cjs +3 -2
- package/dist/DataList/components/DataListActions/index.mjs +3 -2
- package/dist/DataList/components/DataListBulkActions/index.cjs +3 -2
- package/dist/DataList/components/DataListBulkActions/index.mjs +3 -2
- package/dist/DataList/components/DataListFilters/components/DataListSort/index.cjs +3 -2
- package/dist/DataList/components/DataListFilters/components/DataListSort/index.mjs +3 -2
- package/dist/DataList/components/DataListFilters/index.cjs +3 -2
- package/dist/DataList/components/DataListFilters/index.mjs +3 -2
- package/dist/DataList/components/DataListHeader/index.cjs +3 -2
- package/dist/DataList/components/DataListHeader/index.mjs +3 -2
- package/dist/DataList/components/DataListItem/index.cjs +3 -2
- package/dist/DataList/components/DataListItem/index.mjs +3 -2
- package/dist/DataList/components/DataListItemActions/index.cjs +3 -2
- package/dist/DataList/components/DataListItemActions/index.mjs +3 -2
- package/dist/DataList/components/DataListItemActionsOverflow/index.cjs +3 -2
- package/dist/DataList/components/DataListItemActionsOverflow/index.mjs +3 -2
- package/dist/DataList/components/DataListItems/index.cjs +3 -2
- package/dist/DataList/components/DataListItems/index.mjs +3 -2
- package/dist/DataList/components/DataListLayout/index.cjs +3 -2
- package/dist/DataList/components/DataListLayout/index.mjs +3 -2
- package/dist/DataList/components/DataListLayoutActions/index.cjs +3 -2
- package/dist/DataList/components/DataListLayoutActions/index.mjs +3 -2
- package/dist/DataList/index.cjs +3 -2
- package/dist/DataList/index.mjs +3 -2
- package/dist/DatePicker/index.cjs +3 -2
- package/dist/DatePicker/index.mjs +3 -2
- package/dist/DatePicker-es.js +1 -1
- package/dist/DrawerRoot-cjs.js +6181 -0
- package/dist/DrawerRoot-es.js +6056 -0
- package/dist/FormatFile/index.cjs +2 -1
- package/dist/FormatFile/index.mjs +2 -1
- package/dist/Gallery/index.cjs +2 -1
- package/dist/Gallery/index.mjs +2 -1
- package/dist/InputDate/index.cjs +3 -2
- package/dist/InputDate/index.mjs +3 -2
- package/dist/LightBox/index.cjs +2 -1
- package/dist/LightBox/index.mjs +2 -1
- package/dist/Menu/index.cjs +3 -2
- package/dist/Menu/index.mjs +3 -2
- package/dist/Menu-es.js +1 -1
- package/dist/Modal/index.cjs +2 -1
- package/dist/Modal/index.mjs +2 -1
- package/dist/OverlaySeparator-cjs.js +15 -0
- package/dist/OverlaySeparator-es.js +13 -0
- package/dist/Page/index.cjs +2 -1
- package/dist/Page/index.mjs +2 -1
- package/dist/Popover/index.cjs +3 -2
- package/dist/Popover/index.mjs +3 -2
- package/dist/Popover-es.js +1 -1
- package/dist/Separator-cjs.js +53 -0
- package/dist/Separator-es.js +32 -0
- package/dist/Tooltip/index.cjs +3 -2
- package/dist/Tooltip/index.mjs +3 -2
- package/dist/Tooltip-es.js +1 -1
- package/dist/floating-ui.react-cjs.js +45 -44
- package/dist/floating-ui.react-dom-cjs.js +155 -1053
- package/dist/floating-ui.react-dom-es.js +2 -876
- package/dist/floating-ui.react-es.js +2 -1
- package/dist/index.cjs +3 -2
- package/dist/index.esm-cjs.js +921 -0
- package/dist/index.esm-es.js +876 -0
- package/dist/index.mjs +3 -2
- package/dist/primitives/BottomSheet/BottomSheet.d.ts +15 -0
- package/dist/primitives/BottomSheet/index.cjs +16 -0
- package/dist/primitives/BottomSheet/index.d.ts +1 -0
- package/dist/primitives/BottomSheet/index.mjs +10 -0
- package/dist/primitives/OverlaySeparator/OverlaySeparator.d.ts +6 -0
- package/dist/primitives/OverlaySeparator/index.cjs +12 -0
- package/dist/primitives/OverlaySeparator/index.d.ts +1 -0
- package/dist/primitives/OverlaySeparator/index.mjs +6 -0
- package/dist/primitives/index.cjs +17 -0
- package/dist/primitives/index.d.ts +2 -0
- package/dist/primitives/index.mjs +12 -1
- package/dist/unstyledPrimitives/index.cjs +7676 -9833
- package/dist/unstyledPrimitives/index.d.ts +6 -9
- package/dist/unstyledPrimitives/index.mjs +7551 -9711
- package/dist/useRenderElement-cjs.js +598 -0
- package/dist/useRenderElement-es.js +569 -0
- package/dist/useScrollToActive-es.js +1 -1
- package/package.json +2 -2
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
var index_esm = require('./index.esm-cjs.js');
|
|
3
4
|
var React = require('react');
|
|
4
5
|
var ReactDOM = require('react-dom');
|
|
5
6
|
|
|
@@ -23,890 +24,15 @@ function _interopNamespaceDefault(e) {
|
|
|
23
24
|
var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
|
|
24
25
|
var ReactDOM__namespace = /*#__PURE__*/_interopNamespaceDefault(ReactDOM);
|
|
25
26
|
|
|
26
|
-
function hasWindow() {
|
|
27
|
-
return typeof window !== 'undefined';
|
|
28
|
-
}
|
|
29
|
-
function getNodeName(node) {
|
|
30
|
-
if (isNode(node)) {
|
|
31
|
-
return (node.nodeName || '').toLowerCase();
|
|
32
|
-
}
|
|
33
|
-
// Mocked nodes in testing environments may not be instances of Node. By
|
|
34
|
-
// returning `#document` an infinite loop won't occur.
|
|
35
|
-
// https://github.com/floating-ui/floating-ui/issues/2317
|
|
36
|
-
return '#document';
|
|
37
|
-
}
|
|
38
|
-
function getWindow(node) {
|
|
39
|
-
var _node$ownerDocument;
|
|
40
|
-
return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;
|
|
41
|
-
}
|
|
42
|
-
function getDocumentElement(node) {
|
|
43
|
-
var _ref;
|
|
44
|
-
return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement;
|
|
45
|
-
}
|
|
46
|
-
function isNode(value) {
|
|
47
|
-
if (!hasWindow()) {
|
|
48
|
-
return false;
|
|
49
|
-
}
|
|
50
|
-
return value instanceof Node || value instanceof getWindow(value).Node;
|
|
51
|
-
}
|
|
52
|
-
function isElement(value) {
|
|
53
|
-
if (!hasWindow()) {
|
|
54
|
-
return false;
|
|
55
|
-
}
|
|
56
|
-
return value instanceof Element || value instanceof getWindow(value).Element;
|
|
57
|
-
}
|
|
58
|
-
function isHTMLElement(value) {
|
|
59
|
-
if (!hasWindow()) {
|
|
60
|
-
return false;
|
|
61
|
-
}
|
|
62
|
-
return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement;
|
|
63
|
-
}
|
|
64
|
-
function isShadowRoot(value) {
|
|
65
|
-
if (!hasWindow() || typeof ShadowRoot === 'undefined') {
|
|
66
|
-
return false;
|
|
67
|
-
}
|
|
68
|
-
return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;
|
|
69
|
-
}
|
|
70
|
-
function isOverflowElement(element) {
|
|
71
|
-
const {
|
|
72
|
-
overflow,
|
|
73
|
-
overflowX,
|
|
74
|
-
overflowY,
|
|
75
|
-
display
|
|
76
|
-
} = getComputedStyle$1(element);
|
|
77
|
-
return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && display !== 'inline' && display !== 'contents';
|
|
78
|
-
}
|
|
79
|
-
function isTableElement(element) {
|
|
80
|
-
return /^(table|td|th)$/.test(getNodeName(element));
|
|
81
|
-
}
|
|
82
|
-
function isTopLayer(element) {
|
|
83
|
-
try {
|
|
84
|
-
if (element.matches(':popover-open')) {
|
|
85
|
-
return true;
|
|
86
|
-
}
|
|
87
|
-
} catch (_e) {
|
|
88
|
-
// no-op
|
|
89
|
-
}
|
|
90
|
-
try {
|
|
91
|
-
return element.matches(':modal');
|
|
92
|
-
} catch (_e) {
|
|
93
|
-
return false;
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
const willChangeRe = /transform|translate|scale|rotate|perspective|filter/;
|
|
97
|
-
const containRe = /paint|layout|strict|content/;
|
|
98
|
-
const isNotNone = value => !!value && value !== 'none';
|
|
99
|
-
let isWebKitValue;
|
|
100
|
-
function isContainingBlock(elementOrCss) {
|
|
101
|
-
const css = isElement(elementOrCss) ? getComputedStyle$1(elementOrCss) : elementOrCss;
|
|
102
|
-
|
|
103
|
-
// https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
|
|
104
|
-
// https://drafts.csswg.org/css-transforms-2/#individual-transforms
|
|
105
|
-
return isNotNone(css.transform) || isNotNone(css.translate) || isNotNone(css.scale) || isNotNone(css.rotate) || isNotNone(css.perspective) || !isWebKit() && (isNotNone(css.backdropFilter) || isNotNone(css.filter)) || willChangeRe.test(css.willChange || '') || containRe.test(css.contain || '');
|
|
106
|
-
}
|
|
107
|
-
function getContainingBlock(element) {
|
|
108
|
-
let currentNode = getParentNode(element);
|
|
109
|
-
while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) {
|
|
110
|
-
if (isContainingBlock(currentNode)) {
|
|
111
|
-
return currentNode;
|
|
112
|
-
} else if (isTopLayer(currentNode)) {
|
|
113
|
-
return null;
|
|
114
|
-
}
|
|
115
|
-
currentNode = getParentNode(currentNode);
|
|
116
|
-
}
|
|
117
|
-
return null;
|
|
118
|
-
}
|
|
119
|
-
function isWebKit() {
|
|
120
|
-
if (isWebKitValue == null) {
|
|
121
|
-
isWebKitValue = typeof CSS !== 'undefined' && CSS.supports && CSS.supports('-webkit-backdrop-filter', 'none');
|
|
122
|
-
}
|
|
123
|
-
return isWebKitValue;
|
|
124
|
-
}
|
|
125
|
-
function isLastTraversableNode(node) {
|
|
126
|
-
return /^(html|body|#document)$/.test(getNodeName(node));
|
|
127
|
-
}
|
|
128
|
-
function getComputedStyle$1(element) {
|
|
129
|
-
return getWindow(element).getComputedStyle(element);
|
|
130
|
-
}
|
|
131
|
-
function getNodeScroll(element) {
|
|
132
|
-
if (isElement(element)) {
|
|
133
|
-
return {
|
|
134
|
-
scrollLeft: element.scrollLeft,
|
|
135
|
-
scrollTop: element.scrollTop
|
|
136
|
-
};
|
|
137
|
-
}
|
|
138
|
-
return {
|
|
139
|
-
scrollLeft: element.scrollX,
|
|
140
|
-
scrollTop: element.scrollY
|
|
141
|
-
};
|
|
142
|
-
}
|
|
143
|
-
function getParentNode(node) {
|
|
144
|
-
if (getNodeName(node) === 'html') {
|
|
145
|
-
return node;
|
|
146
|
-
}
|
|
147
|
-
const result =
|
|
148
|
-
// Step into the shadow DOM of the parent of a slotted node.
|
|
149
|
-
node.assignedSlot ||
|
|
150
|
-
// DOM Element detected.
|
|
151
|
-
node.parentNode ||
|
|
152
|
-
// ShadowRoot detected.
|
|
153
|
-
isShadowRoot(node) && node.host ||
|
|
154
|
-
// Fallback.
|
|
155
|
-
getDocumentElement(node);
|
|
156
|
-
return isShadowRoot(result) ? result.host : result;
|
|
157
|
-
}
|
|
158
|
-
function getNearestOverflowAncestor(node) {
|
|
159
|
-
const parentNode = getParentNode(node);
|
|
160
|
-
if (isLastTraversableNode(parentNode)) {
|
|
161
|
-
return node.ownerDocument ? node.ownerDocument.body : node.body;
|
|
162
|
-
}
|
|
163
|
-
if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {
|
|
164
|
-
return parentNode;
|
|
165
|
-
}
|
|
166
|
-
return getNearestOverflowAncestor(parentNode);
|
|
167
|
-
}
|
|
168
|
-
function getOverflowAncestors(node, list, traverseIframes) {
|
|
169
|
-
var _node$ownerDocument2;
|
|
170
|
-
if (list === void 0) {
|
|
171
|
-
list = [];
|
|
172
|
-
}
|
|
173
|
-
if (traverseIframes === void 0) {
|
|
174
|
-
traverseIframes = true;
|
|
175
|
-
}
|
|
176
|
-
const scrollableAncestor = getNearestOverflowAncestor(node);
|
|
177
|
-
const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);
|
|
178
|
-
const win = getWindow(scrollableAncestor);
|
|
179
|
-
if (isBody) {
|
|
180
|
-
const frameElement = getFrameElement(win);
|
|
181
|
-
return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []);
|
|
182
|
-
} else {
|
|
183
|
-
return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
function getFrameElement(win) {
|
|
187
|
-
return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null;
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
/**
|
|
191
|
-
* Custom positioning reference element.
|
|
192
|
-
* @see https://floating-ui.com/docs/virtual-elements
|
|
193
|
-
*/
|
|
194
|
-
|
|
195
|
-
const sides = ['top', 'right', 'bottom', 'left'];
|
|
196
|
-
const alignments = ['start', 'end'];
|
|
197
|
-
const placements = /*#__PURE__*/sides.reduce((acc, side) => acc.concat(side, side + "-" + alignments[0], side + "-" + alignments[1]), []);
|
|
198
|
-
const min = Math.min;
|
|
199
|
-
const max = Math.max;
|
|
200
|
-
const round = Math.round;
|
|
201
|
-
const floor = Math.floor;
|
|
202
|
-
const createCoords = v => ({
|
|
203
|
-
x: v,
|
|
204
|
-
y: v
|
|
205
|
-
});
|
|
206
|
-
const oppositeSideMap = {
|
|
207
|
-
left: 'right',
|
|
208
|
-
right: 'left',
|
|
209
|
-
bottom: 'top',
|
|
210
|
-
top: 'bottom'
|
|
211
|
-
};
|
|
212
|
-
function clamp(start, value, end) {
|
|
213
|
-
return max(start, min(value, end));
|
|
214
|
-
}
|
|
215
|
-
function evaluate(value, param) {
|
|
216
|
-
return typeof value === 'function' ? value(param) : value;
|
|
217
|
-
}
|
|
218
|
-
function getSide(placement) {
|
|
219
|
-
return placement.split('-')[0];
|
|
220
|
-
}
|
|
221
|
-
function getAlignment(placement) {
|
|
222
|
-
return placement.split('-')[1];
|
|
223
|
-
}
|
|
224
|
-
function getOppositeAxis(axis) {
|
|
225
|
-
return axis === 'x' ? 'y' : 'x';
|
|
226
|
-
}
|
|
227
|
-
function getAxisLength(axis) {
|
|
228
|
-
return axis === 'y' ? 'height' : 'width';
|
|
229
|
-
}
|
|
230
|
-
function getSideAxis(placement) {
|
|
231
|
-
const firstChar = placement[0];
|
|
232
|
-
return firstChar === 't' || firstChar === 'b' ? 'y' : 'x';
|
|
233
|
-
}
|
|
234
|
-
function getAlignmentAxis(placement) {
|
|
235
|
-
return getOppositeAxis(getSideAxis(placement));
|
|
236
|
-
}
|
|
237
|
-
function getAlignmentSides(placement, rects, rtl) {
|
|
238
|
-
if (rtl === void 0) {
|
|
239
|
-
rtl = false;
|
|
240
|
-
}
|
|
241
|
-
const alignment = getAlignment(placement);
|
|
242
|
-
const alignmentAxis = getAlignmentAxis(placement);
|
|
243
|
-
const length = getAxisLength(alignmentAxis);
|
|
244
|
-
let mainAlignmentSide = alignmentAxis === 'x' ? alignment === (rtl ? 'end' : 'start') ? 'right' : 'left' : alignment === 'start' ? 'bottom' : 'top';
|
|
245
|
-
if (rects.reference[length] > rects.floating[length]) {
|
|
246
|
-
mainAlignmentSide = getOppositePlacement(mainAlignmentSide);
|
|
247
|
-
}
|
|
248
|
-
return [mainAlignmentSide, getOppositePlacement(mainAlignmentSide)];
|
|
249
|
-
}
|
|
250
|
-
function getExpandedPlacements(placement) {
|
|
251
|
-
const oppositePlacement = getOppositePlacement(placement);
|
|
252
|
-
return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)];
|
|
253
|
-
}
|
|
254
|
-
function getOppositeAlignmentPlacement(placement) {
|
|
255
|
-
return placement.includes('start') ? placement.replace('start', 'end') : placement.replace('end', 'start');
|
|
256
|
-
}
|
|
257
|
-
const lrPlacement = ['left', 'right'];
|
|
258
|
-
const rlPlacement = ['right', 'left'];
|
|
259
|
-
const tbPlacement = ['top', 'bottom'];
|
|
260
|
-
const btPlacement = ['bottom', 'top'];
|
|
261
|
-
function getSideList(side, isStart, rtl) {
|
|
262
|
-
switch (side) {
|
|
263
|
-
case 'top':
|
|
264
|
-
case 'bottom':
|
|
265
|
-
if (rtl) return isStart ? rlPlacement : lrPlacement;
|
|
266
|
-
return isStart ? lrPlacement : rlPlacement;
|
|
267
|
-
case 'left':
|
|
268
|
-
case 'right':
|
|
269
|
-
return isStart ? tbPlacement : btPlacement;
|
|
270
|
-
default:
|
|
271
|
-
return [];
|
|
272
|
-
}
|
|
273
|
-
}
|
|
274
|
-
function getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {
|
|
275
|
-
const alignment = getAlignment(placement);
|
|
276
|
-
let list = getSideList(getSide(placement), direction === 'start', rtl);
|
|
277
|
-
if (alignment) {
|
|
278
|
-
list = list.map(side => side + "-" + alignment);
|
|
279
|
-
if (flipAlignment) {
|
|
280
|
-
list = list.concat(list.map(getOppositeAlignmentPlacement));
|
|
281
|
-
}
|
|
282
|
-
}
|
|
283
|
-
return list;
|
|
284
|
-
}
|
|
285
|
-
function getOppositePlacement(placement) {
|
|
286
|
-
const side = getSide(placement);
|
|
287
|
-
return oppositeSideMap[side] + placement.slice(side.length);
|
|
288
|
-
}
|
|
289
|
-
function expandPaddingObject(padding) {
|
|
290
|
-
return {
|
|
291
|
-
top: 0,
|
|
292
|
-
right: 0,
|
|
293
|
-
bottom: 0,
|
|
294
|
-
left: 0,
|
|
295
|
-
...padding
|
|
296
|
-
};
|
|
297
|
-
}
|
|
298
|
-
function getPaddingObject(padding) {
|
|
299
|
-
return typeof padding !== 'number' ? expandPaddingObject(padding) : {
|
|
300
|
-
top: padding,
|
|
301
|
-
right: padding,
|
|
302
|
-
bottom: padding,
|
|
303
|
-
left: padding
|
|
304
|
-
};
|
|
305
|
-
}
|
|
306
|
-
function rectToClientRect(rect) {
|
|
307
|
-
const {
|
|
308
|
-
x,
|
|
309
|
-
y,
|
|
310
|
-
width,
|
|
311
|
-
height
|
|
312
|
-
} = rect;
|
|
313
|
-
return {
|
|
314
|
-
width,
|
|
315
|
-
height,
|
|
316
|
-
top: y,
|
|
317
|
-
left: x,
|
|
318
|
-
right: x + width,
|
|
319
|
-
bottom: y + height,
|
|
320
|
-
x,
|
|
321
|
-
y
|
|
322
|
-
};
|
|
323
|
-
}
|
|
324
|
-
|
|
325
|
-
/*!
|
|
326
|
-
* tabbable 6.4.0
|
|
327
|
-
* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
|
|
328
|
-
*/
|
|
329
|
-
// NOTE: separate `:not()` selectors has broader browser support than the newer
|
|
330
|
-
// `:not([inert], [inert] *)` (Feb 2023)
|
|
331
|
-
var candidateSelectors = ['input:not([inert]):not([inert] *)', 'select:not([inert]):not([inert] *)', 'textarea:not([inert]):not([inert] *)', 'a[href]:not([inert]):not([inert] *)', 'button:not([inert]):not([inert] *)', '[tabindex]:not(slot):not([inert]):not([inert] *)', 'audio[controls]:not([inert]):not([inert] *)', 'video[controls]:not([inert]):not([inert] *)', '[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)', 'details>summary:first-of-type:not([inert]):not([inert] *)', 'details:not([inert]):not([inert] *)'];
|
|
332
|
-
var candidateSelector = /* #__PURE__ */candidateSelectors.join(',');
|
|
333
|
-
var NoElement = typeof Element === 'undefined';
|
|
334
|
-
var matches = NoElement ? function () {} : Element.prototype.matches || Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector;
|
|
335
|
-
var getRootNode = !NoElement && Element.prototype.getRootNode ? function (element) {
|
|
336
|
-
var _element$getRootNode;
|
|
337
|
-
return element === null || element === void 0 ? void 0 : (_element$getRootNode = element.getRootNode) === null || _element$getRootNode === void 0 ? void 0 : _element$getRootNode.call(element);
|
|
338
|
-
} : function (element) {
|
|
339
|
-
return element === null || element === void 0 ? void 0 : element.ownerDocument;
|
|
340
|
-
};
|
|
341
|
-
|
|
342
|
-
/**
|
|
343
|
-
* Determines if a node is inert or in an inert ancestor.
|
|
344
|
-
* @param {Node} [node]
|
|
345
|
-
* @param {boolean} [lookUp] If true and `node` is not inert, looks up at ancestors to
|
|
346
|
-
* see if any of them are inert. If false, only `node` itself is considered.
|
|
347
|
-
* @returns {boolean} True if inert itself or by way of being in an inert ancestor.
|
|
348
|
-
* False if `node` is falsy.
|
|
349
|
-
*/
|
|
350
|
-
var _isInert = function isInert(node, lookUp) {
|
|
351
|
-
var _node$getAttribute;
|
|
352
|
-
if (lookUp === void 0) {
|
|
353
|
-
lookUp = true;
|
|
354
|
-
}
|
|
355
|
-
// CAREFUL: JSDom does not support inert at all, so we can't use the `HTMLElement.inert`
|
|
356
|
-
// JS API property; we have to check the attribute, which can either be empty or 'true';
|
|
357
|
-
// if it's `null` (not specified) or 'false', it's an active element
|
|
358
|
-
var inertAtt = node === null || node === void 0 ? void 0 : (_node$getAttribute = node.getAttribute) === null || _node$getAttribute === void 0 ? void 0 : _node$getAttribute.call(node, 'inert');
|
|
359
|
-
var inert = inertAtt === '' || inertAtt === 'true';
|
|
360
|
-
|
|
361
|
-
// NOTE: this could also be handled with `node.matches('[inert], :is([inert] *)')`
|
|
362
|
-
// if it weren't for `matches()` not being a function on shadow roots; the following
|
|
363
|
-
// code works for any kind of node
|
|
364
|
-
var result = inert || lookUp && node && (
|
|
365
|
-
// closest does not exist on shadow roots, so we fall back to a manual
|
|
366
|
-
// lookup upward, in case it is not defined.
|
|
367
|
-
typeof node.closest === 'function' ? node.closest('[inert]') : _isInert(node.parentNode));
|
|
368
|
-
return result;
|
|
369
|
-
};
|
|
370
|
-
|
|
371
|
-
/**
|
|
372
|
-
* Determines if a node's content is editable.
|
|
373
|
-
* @param {Element} [node]
|
|
374
|
-
* @returns True if it's content-editable; false if it's not or `node` is falsy.
|
|
375
|
-
*/
|
|
376
|
-
var isContentEditable = function isContentEditable(node) {
|
|
377
|
-
var _node$getAttribute2;
|
|
378
|
-
// CAREFUL: JSDom does not support the `HTMLElement.isContentEditable` API so we have
|
|
379
|
-
// to use the attribute directly to check for this, which can either be empty or 'true';
|
|
380
|
-
// if it's `null` (not specified) or 'false', it's a non-editable element
|
|
381
|
-
var attValue = node === null || node === void 0 ? void 0 : (_node$getAttribute2 = node.getAttribute) === null || _node$getAttribute2 === void 0 ? void 0 : _node$getAttribute2.call(node, 'contenteditable');
|
|
382
|
-
return attValue === '' || attValue === 'true';
|
|
383
|
-
};
|
|
384
|
-
|
|
385
|
-
/**
|
|
386
|
-
* @param {Element} el container to check in
|
|
387
|
-
* @param {boolean} includeContainer add container to check
|
|
388
|
-
* @param {(node: Element) => boolean} filter filter candidates
|
|
389
|
-
* @returns {Element[]}
|
|
390
|
-
*/
|
|
391
|
-
var getCandidates = function getCandidates(el, includeContainer, filter) {
|
|
392
|
-
// even if `includeContainer=false`, we still have to check it for inertness because
|
|
393
|
-
// if it's inert (either by itself or via its parent), then all its children are inert
|
|
394
|
-
if (_isInert(el)) {
|
|
395
|
-
return [];
|
|
396
|
-
}
|
|
397
|
-
var candidates = Array.prototype.slice.apply(el.querySelectorAll(candidateSelector));
|
|
398
|
-
if (includeContainer && matches.call(el, candidateSelector)) {
|
|
399
|
-
candidates.unshift(el);
|
|
400
|
-
}
|
|
401
|
-
candidates = candidates.filter(filter);
|
|
402
|
-
return candidates;
|
|
403
|
-
};
|
|
404
|
-
|
|
405
|
-
/**
|
|
406
|
-
* @callback GetShadowRoot
|
|
407
|
-
* @param {Element} element to check for shadow root
|
|
408
|
-
* @returns {ShadowRoot|boolean} ShadowRoot if available or boolean indicating if a shadowRoot is attached but not available.
|
|
409
|
-
*/
|
|
410
|
-
|
|
411
|
-
/**
|
|
412
|
-
* @callback ShadowRootFilter
|
|
413
|
-
* @param {Element} shadowHostNode the element which contains shadow content
|
|
414
|
-
* @returns {boolean} true if a shadow root could potentially contain valid candidates.
|
|
415
|
-
*/
|
|
416
|
-
|
|
417
|
-
/**
|
|
418
|
-
* @typedef {Object} CandidateScope
|
|
419
|
-
* @property {Element} scopeParent contains inner candidates
|
|
420
|
-
* @property {Element[]} candidates list of candidates found in the scope parent
|
|
421
|
-
*/
|
|
422
|
-
|
|
423
|
-
/**
|
|
424
|
-
* @typedef {Object} IterativeOptions
|
|
425
|
-
* @property {GetShadowRoot|boolean} getShadowRoot true if shadow support is enabled; falsy if not;
|
|
426
|
-
* if a function, implies shadow support is enabled and either returns the shadow root of an element
|
|
427
|
-
* or a boolean stating if it has an undisclosed shadow root
|
|
428
|
-
* @property {(node: Element) => boolean} filter filter candidates
|
|
429
|
-
* @property {boolean} flatten if true then result will flatten any CandidateScope into the returned list
|
|
430
|
-
* @property {ShadowRootFilter} shadowRootFilter filter shadow roots;
|
|
431
|
-
*/
|
|
432
|
-
|
|
433
|
-
/**
|
|
434
|
-
* @param {Element[]} elements list of element containers to match candidates from
|
|
435
|
-
* @param {boolean} includeContainer add container list to check
|
|
436
|
-
* @param {IterativeOptions} options
|
|
437
|
-
* @returns {Array.<Element|CandidateScope>}
|
|
438
|
-
*/
|
|
439
|
-
var _getCandidatesIteratively = function getCandidatesIteratively(elements, includeContainer, options) {
|
|
440
|
-
var candidates = [];
|
|
441
|
-
var elementsToCheck = Array.from(elements);
|
|
442
|
-
while (elementsToCheck.length) {
|
|
443
|
-
var element = elementsToCheck.shift();
|
|
444
|
-
if (_isInert(element, false)) {
|
|
445
|
-
// no need to look up since we're drilling down
|
|
446
|
-
// anything inside this container will also be inert
|
|
447
|
-
continue;
|
|
448
|
-
}
|
|
449
|
-
if (element.tagName === 'SLOT') {
|
|
450
|
-
// add shadow dom slot scope (slot itself cannot be focusable)
|
|
451
|
-
var assigned = element.assignedElements();
|
|
452
|
-
var content = assigned.length ? assigned : element.children;
|
|
453
|
-
var nestedCandidates = _getCandidatesIteratively(content, true, options);
|
|
454
|
-
if (options.flatten) {
|
|
455
|
-
candidates.push.apply(candidates, nestedCandidates);
|
|
456
|
-
} else {
|
|
457
|
-
candidates.push({
|
|
458
|
-
scopeParent: element,
|
|
459
|
-
candidates: nestedCandidates
|
|
460
|
-
});
|
|
461
|
-
}
|
|
462
|
-
} else {
|
|
463
|
-
// check candidate element
|
|
464
|
-
var validCandidate = matches.call(element, candidateSelector);
|
|
465
|
-
if (validCandidate && options.filter(element) && (includeContainer || !elements.includes(element))) {
|
|
466
|
-
candidates.push(element);
|
|
467
|
-
}
|
|
468
|
-
|
|
469
|
-
// iterate over shadow content if possible
|
|
470
|
-
var shadowRoot = element.shadowRoot ||
|
|
471
|
-
// check for an undisclosed shadow
|
|
472
|
-
typeof options.getShadowRoot === 'function' && options.getShadowRoot(element);
|
|
473
|
-
|
|
474
|
-
// no inert look up because we're already drilling down and checking for inertness
|
|
475
|
-
// on the way down, so all containers to this root node should have already been
|
|
476
|
-
// vetted as non-inert
|
|
477
|
-
var validShadowRoot = !_isInert(shadowRoot, false) && (!options.shadowRootFilter || options.shadowRootFilter(element));
|
|
478
|
-
if (shadowRoot && validShadowRoot) {
|
|
479
|
-
// add shadow dom scope IIF a shadow root node was given; otherwise, an undisclosed
|
|
480
|
-
// shadow exists, so look at light dom children as fallback BUT create a scope for any
|
|
481
|
-
// child candidates found because they're likely slotted elements (elements that are
|
|
482
|
-
// children of the web component element (which has the shadow), in the light dom, but
|
|
483
|
-
// slotted somewhere _inside_ the undisclosed shadow) -- the scope is created below,
|
|
484
|
-
// _after_ we return from this recursive call
|
|
485
|
-
var _nestedCandidates = _getCandidatesIteratively(shadowRoot === true ? element.children : shadowRoot.children, true, options);
|
|
486
|
-
if (options.flatten) {
|
|
487
|
-
candidates.push.apply(candidates, _nestedCandidates);
|
|
488
|
-
} else {
|
|
489
|
-
candidates.push({
|
|
490
|
-
scopeParent: element,
|
|
491
|
-
candidates: _nestedCandidates
|
|
492
|
-
});
|
|
493
|
-
}
|
|
494
|
-
} else {
|
|
495
|
-
// there's not shadow so just dig into the element's (light dom) children
|
|
496
|
-
// __without__ giving the element special scope treatment
|
|
497
|
-
elementsToCheck.unshift.apply(elementsToCheck, element.children);
|
|
498
|
-
}
|
|
499
|
-
}
|
|
500
|
-
}
|
|
501
|
-
return candidates;
|
|
502
|
-
};
|
|
503
|
-
|
|
504
|
-
/**
|
|
505
|
-
* @private
|
|
506
|
-
* Determines if the node has an explicitly specified `tabindex` attribute.
|
|
507
|
-
* @param {HTMLElement} node
|
|
508
|
-
* @returns {boolean} True if so; false if not.
|
|
509
|
-
*/
|
|
510
|
-
var hasTabIndex = function hasTabIndex(node) {
|
|
511
|
-
return !isNaN(parseInt(node.getAttribute('tabindex'), 10));
|
|
512
|
-
};
|
|
513
|
-
|
|
514
|
-
/**
|
|
515
|
-
* Determine the tab index of a given node.
|
|
516
|
-
* @param {HTMLElement} node
|
|
517
|
-
* @returns {number} Tab order (negative, 0, or positive number).
|
|
518
|
-
* @throws {Error} If `node` is falsy.
|
|
519
|
-
*/
|
|
520
|
-
var getTabIndex = function getTabIndex(node) {
|
|
521
|
-
if (!node) {
|
|
522
|
-
throw new Error('No node provided');
|
|
523
|
-
}
|
|
524
|
-
if (node.tabIndex < 0) {
|
|
525
|
-
// in Chrome, <details/>, <audio controls/> and <video controls/> elements get a default
|
|
526
|
-
// `tabIndex` of -1 when the 'tabindex' attribute isn't specified in the DOM,
|
|
527
|
-
// yet they are still part of the regular tab order; in FF, they get a default
|
|
528
|
-
// `tabIndex` of 0; since Chrome still puts those elements in the regular tab
|
|
529
|
-
// order, consider their tab index to be 0.
|
|
530
|
-
// Also browsers do not return `tabIndex` correctly for contentEditable nodes;
|
|
531
|
-
// so if they don't have a tabindex attribute specifically set, assume it's 0.
|
|
532
|
-
if ((/^(AUDIO|VIDEO|DETAILS)$/.test(node.tagName) || isContentEditable(node)) && !hasTabIndex(node)) {
|
|
533
|
-
return 0;
|
|
534
|
-
}
|
|
535
|
-
}
|
|
536
|
-
return node.tabIndex;
|
|
537
|
-
};
|
|
538
|
-
|
|
539
|
-
/**
|
|
540
|
-
* Determine the tab index of a given node __for sort order purposes__.
|
|
541
|
-
* @param {HTMLElement} node
|
|
542
|
-
* @param {boolean} [isScope] True for a custom element with shadow root or slot that, by default,
|
|
543
|
-
* has tabIndex -1, but needs to be sorted by document order in order for its content to be
|
|
544
|
-
* inserted into the correct sort position.
|
|
545
|
-
* @returns {number} Tab order (negative, 0, or positive number).
|
|
546
|
-
*/
|
|
547
|
-
var getSortOrderTabIndex = function getSortOrderTabIndex(node, isScope) {
|
|
548
|
-
var tabIndex = getTabIndex(node);
|
|
549
|
-
if (tabIndex < 0 && isScope && !hasTabIndex(node)) {
|
|
550
|
-
return 0;
|
|
551
|
-
}
|
|
552
|
-
return tabIndex;
|
|
553
|
-
};
|
|
554
|
-
var sortOrderedTabbables = function sortOrderedTabbables(a, b) {
|
|
555
|
-
return a.tabIndex === b.tabIndex ? a.documentOrder - b.documentOrder : a.tabIndex - b.tabIndex;
|
|
556
|
-
};
|
|
557
|
-
var isInput = function isInput(node) {
|
|
558
|
-
return node.tagName === 'INPUT';
|
|
559
|
-
};
|
|
560
|
-
var isHiddenInput = function isHiddenInput(node) {
|
|
561
|
-
return isInput(node) && node.type === 'hidden';
|
|
562
|
-
};
|
|
563
|
-
var isDetailsWithSummary = function isDetailsWithSummary(node) {
|
|
564
|
-
var r = node.tagName === 'DETAILS' && Array.prototype.slice.apply(node.children).some(function (child) {
|
|
565
|
-
return child.tagName === 'SUMMARY';
|
|
566
|
-
});
|
|
567
|
-
return r;
|
|
568
|
-
};
|
|
569
|
-
var getCheckedRadio = function getCheckedRadio(nodes, form) {
|
|
570
|
-
for (var i = 0; i < nodes.length; i++) {
|
|
571
|
-
if (nodes[i].checked && nodes[i].form === form) {
|
|
572
|
-
return nodes[i];
|
|
573
|
-
}
|
|
574
|
-
}
|
|
575
|
-
};
|
|
576
|
-
var isTabbableRadio = function isTabbableRadio(node) {
|
|
577
|
-
if (!node.name) {
|
|
578
|
-
return true;
|
|
579
|
-
}
|
|
580
|
-
var radioScope = node.form || getRootNode(node);
|
|
581
|
-
var queryRadios = function queryRadios(name) {
|
|
582
|
-
return radioScope.querySelectorAll('input[type="radio"][name="' + name + '"]');
|
|
583
|
-
};
|
|
584
|
-
var radioSet;
|
|
585
|
-
if (typeof window !== 'undefined' && typeof window.CSS !== 'undefined' && typeof window.CSS.escape === 'function') {
|
|
586
|
-
radioSet = queryRadios(window.CSS.escape(node.name));
|
|
587
|
-
} else {
|
|
588
|
-
try {
|
|
589
|
-
radioSet = queryRadios(node.name);
|
|
590
|
-
} catch (err) {
|
|
591
|
-
// eslint-disable-next-line no-console
|
|
592
|
-
console.error('Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s', err.message);
|
|
593
|
-
return false;
|
|
594
|
-
}
|
|
595
|
-
}
|
|
596
|
-
var checked = getCheckedRadio(radioSet, node.form);
|
|
597
|
-
return !checked || checked === node;
|
|
598
|
-
};
|
|
599
|
-
var isRadio = function isRadio(node) {
|
|
600
|
-
return isInput(node) && node.type === 'radio';
|
|
601
|
-
};
|
|
602
|
-
var isNonTabbableRadio = function isNonTabbableRadio(node) {
|
|
603
|
-
return isRadio(node) && !isTabbableRadio(node);
|
|
604
|
-
};
|
|
605
|
-
|
|
606
|
-
// determines if a node is ultimately attached to the window's document
|
|
607
|
-
var isNodeAttached = function isNodeAttached(node) {
|
|
608
|
-
var _nodeRoot;
|
|
609
|
-
// The root node is the shadow root if the node is in a shadow DOM; some document otherwise
|
|
610
|
-
// (but NOT _the_ document; see second 'If' comment below for more).
|
|
611
|
-
// If rootNode is shadow root, it'll have a host, which is the element to which the shadow
|
|
612
|
-
// is attached, and the one we need to check if it's in the document or not (because the
|
|
613
|
-
// shadow, and all nodes it contains, is never considered in the document since shadows
|
|
614
|
-
// behave like self-contained DOMs; but if the shadow's HOST, which is part of the document,
|
|
615
|
-
// is hidden, or is not in the document itself but is detached, it will affect the shadow's
|
|
616
|
-
// visibility, including all the nodes it contains). The host could be any normal node,
|
|
617
|
-
// or a custom element (i.e. web component). Either way, that's the one that is considered
|
|
618
|
-
// part of the document, not the shadow root, nor any of its children (i.e. the node being
|
|
619
|
-
// tested).
|
|
620
|
-
// To further complicate things, we have to look all the way up until we find a shadow HOST
|
|
621
|
-
// that is attached (or find none) because the node might be in nested shadows...
|
|
622
|
-
// If rootNode is not a shadow root, it won't have a host, and so rootNode should be the
|
|
623
|
-
// document (per the docs) and while it's a Document-type object, that document does not
|
|
624
|
-
// appear to be the same as the node's `ownerDocument` for some reason, so it's safer
|
|
625
|
-
// to ignore the rootNode at this point, and use `node.ownerDocument`. Otherwise,
|
|
626
|
-
// using `rootNode.contains(node)` will _always_ be true we'll get false-positives when
|
|
627
|
-
// node is actually detached.
|
|
628
|
-
// NOTE: If `nodeRootHost` or `node` happens to be the `document` itself (which is possible
|
|
629
|
-
// if a tabbable/focusable node was quickly added to the DOM, focused, and then removed
|
|
630
|
-
// from the DOM as in https://github.com/focus-trap/focus-trap-react/issues/905), then
|
|
631
|
-
// `ownerDocument` will be `null`, hence the optional chaining on it.
|
|
632
|
-
var nodeRoot = node && getRootNode(node);
|
|
633
|
-
var nodeRootHost = (_nodeRoot = nodeRoot) === null || _nodeRoot === void 0 ? void 0 : _nodeRoot.host;
|
|
634
|
-
|
|
635
|
-
// in some cases, a detached node will return itself as the root instead of a document or
|
|
636
|
-
// shadow root object, in which case, we shouldn't try to look further up the host chain
|
|
637
|
-
var attached = false;
|
|
638
|
-
if (nodeRoot && nodeRoot !== node) {
|
|
639
|
-
var _nodeRootHost, _nodeRootHost$ownerDo, _node$ownerDocument;
|
|
640
|
-
attached = !!((_nodeRootHost = nodeRootHost) !== null && _nodeRootHost !== void 0 && (_nodeRootHost$ownerDo = _nodeRootHost.ownerDocument) !== null && _nodeRootHost$ownerDo !== void 0 && _nodeRootHost$ownerDo.contains(nodeRootHost) || node !== null && node !== void 0 && (_node$ownerDocument = node.ownerDocument) !== null && _node$ownerDocument !== void 0 && _node$ownerDocument.contains(node));
|
|
641
|
-
while (!attached && nodeRootHost) {
|
|
642
|
-
var _nodeRoot2, _nodeRootHost2, _nodeRootHost2$ownerD;
|
|
643
|
-
// since it's not attached and we have a root host, the node MUST be in a nested shadow DOM,
|
|
644
|
-
// which means we need to get the host's host and check if that parent host is contained
|
|
645
|
-
// in (i.e. attached to) the document
|
|
646
|
-
nodeRoot = getRootNode(nodeRootHost);
|
|
647
|
-
nodeRootHost = (_nodeRoot2 = nodeRoot) === null || _nodeRoot2 === void 0 ? void 0 : _nodeRoot2.host;
|
|
648
|
-
attached = !!((_nodeRootHost2 = nodeRootHost) !== null && _nodeRootHost2 !== void 0 && (_nodeRootHost2$ownerD = _nodeRootHost2.ownerDocument) !== null && _nodeRootHost2$ownerD !== void 0 && _nodeRootHost2$ownerD.contains(nodeRootHost));
|
|
649
|
-
}
|
|
650
|
-
}
|
|
651
|
-
return attached;
|
|
652
|
-
};
|
|
653
|
-
var isZeroArea = function isZeroArea(node) {
|
|
654
|
-
var _node$getBoundingClie = node.getBoundingClientRect(),
|
|
655
|
-
width = _node$getBoundingClie.width,
|
|
656
|
-
height = _node$getBoundingClie.height;
|
|
657
|
-
return width === 0 && height === 0;
|
|
658
|
-
};
|
|
659
|
-
var isHidden = function isHidden(node, _ref) {
|
|
660
|
-
var displayCheck = _ref.displayCheck,
|
|
661
|
-
getShadowRoot = _ref.getShadowRoot;
|
|
662
|
-
if (displayCheck === 'full-native') {
|
|
663
|
-
if ('checkVisibility' in node) {
|
|
664
|
-
// Chrome >= 105, Edge >= 105, Firefox >= 106, Safari >= 17.4
|
|
665
|
-
// @see https://developer.mozilla.org/en-US/docs/Web/API/Element/checkVisibility#browser_compatibility
|
|
666
|
-
var visible = node.checkVisibility({
|
|
667
|
-
// Checking opacity might be desirable for some use cases, but natively,
|
|
668
|
-
// opacity zero elements _are_ focusable and tabbable.
|
|
669
|
-
checkOpacity: false,
|
|
670
|
-
opacityProperty: false,
|
|
671
|
-
contentVisibilityAuto: true,
|
|
672
|
-
visibilityProperty: true,
|
|
673
|
-
// This is an alias for `visibilityProperty`. Contemporary browsers
|
|
674
|
-
// support both. However, this alias has wider browser support (Chrome
|
|
675
|
-
// >= 105 and Firefox >= 106, vs. Chrome >= 121 and Firefox >= 122), so
|
|
676
|
-
// we include it anyway.
|
|
677
|
-
checkVisibilityCSS: true
|
|
678
|
-
});
|
|
679
|
-
return !visible;
|
|
680
|
-
}
|
|
681
|
-
// Fall through to manual visibility checks
|
|
682
|
-
}
|
|
683
|
-
|
|
684
|
-
// NOTE: visibility will be `undefined` if node is detached from the document
|
|
685
|
-
// (see notes about this further down), which means we will consider it visible
|
|
686
|
-
// (this is legacy behavior from a very long way back)
|
|
687
|
-
// NOTE: we check this regardless of `displayCheck="none"` because this is a
|
|
688
|
-
// _visibility_ check, not a _display_ check
|
|
689
|
-
if (getComputedStyle(node).visibility === 'hidden') {
|
|
690
|
-
return true;
|
|
691
|
-
}
|
|
692
|
-
var isDirectSummary = matches.call(node, 'details>summary:first-of-type');
|
|
693
|
-
var nodeUnderDetails = isDirectSummary ? node.parentElement : node;
|
|
694
|
-
if (matches.call(nodeUnderDetails, 'details:not([open]) *')) {
|
|
695
|
-
return true;
|
|
696
|
-
}
|
|
697
|
-
if (!displayCheck || displayCheck === 'full' ||
|
|
698
|
-
// full-native can run this branch when it falls through in case
|
|
699
|
-
// Element#checkVisibility is unsupported
|
|
700
|
-
displayCheck === 'full-native' || displayCheck === 'legacy-full') {
|
|
701
|
-
if (typeof getShadowRoot === 'function') {
|
|
702
|
-
// figure out if we should consider the node to be in an undisclosed shadow and use the
|
|
703
|
-
// 'non-zero-area' fallback
|
|
704
|
-
var originalNode = node;
|
|
705
|
-
while (node) {
|
|
706
|
-
var parentElement = node.parentElement;
|
|
707
|
-
var rootNode = getRootNode(node);
|
|
708
|
-
if (parentElement && !parentElement.shadowRoot && getShadowRoot(parentElement) === true // check if there's an undisclosed shadow
|
|
709
|
-
) {
|
|
710
|
-
// node has an undisclosed shadow which means we can only treat it as a black box, so we
|
|
711
|
-
// fall back to a non-zero-area test
|
|
712
|
-
return isZeroArea(node);
|
|
713
|
-
} else if (node.assignedSlot) {
|
|
714
|
-
// iterate up slot
|
|
715
|
-
node = node.assignedSlot;
|
|
716
|
-
} else if (!parentElement && rootNode !== node.ownerDocument) {
|
|
717
|
-
// cross shadow boundary
|
|
718
|
-
node = rootNode.host;
|
|
719
|
-
} else {
|
|
720
|
-
// iterate up normal dom
|
|
721
|
-
node = parentElement;
|
|
722
|
-
}
|
|
723
|
-
}
|
|
724
|
-
node = originalNode;
|
|
725
|
-
}
|
|
726
|
-
// else, `getShadowRoot` might be true, but all that does is enable shadow DOM support
|
|
727
|
-
// (i.e. it does not also presume that all nodes might have undisclosed shadows); or
|
|
728
|
-
// it might be a falsy value, which means shadow DOM support is disabled
|
|
729
|
-
|
|
730
|
-
// Since we didn't find it sitting in an undisclosed shadow (or shadows are disabled)
|
|
731
|
-
// now we can just test to see if it would normally be visible or not, provided it's
|
|
732
|
-
// attached to the main document.
|
|
733
|
-
// NOTE: We must consider case where node is inside a shadow DOM and given directly to
|
|
734
|
-
// `isTabbable()` or `isFocusable()` -- regardless of `getShadowRoot` option setting.
|
|
735
|
-
|
|
736
|
-
if (isNodeAttached(node)) {
|
|
737
|
-
// this works wherever the node is: if there's at least one client rect, it's
|
|
738
|
-
// somehow displayed; it also covers the CSS 'display: contents' case where the
|
|
739
|
-
// node itself is hidden in place of its contents; and there's no need to search
|
|
740
|
-
// up the hierarchy either
|
|
741
|
-
return !node.getClientRects().length;
|
|
742
|
-
}
|
|
743
|
-
|
|
744
|
-
// Else, the node isn't attached to the document, which means the `getClientRects()`
|
|
745
|
-
// API will __always__ return zero rects (this can happen, for example, if React
|
|
746
|
-
// is used to render nodes onto a detached tree, as confirmed in this thread:
|
|
747
|
-
// https://github.com/facebook/react/issues/9117#issuecomment-284228870)
|
|
748
|
-
//
|
|
749
|
-
// It also means that even window.getComputedStyle(node).display will return `undefined`
|
|
750
|
-
// because styles are only computed for nodes that are in the document.
|
|
751
|
-
//
|
|
752
|
-
// NOTE: THIS HAS BEEN THE CASE FOR YEARS. It is not new, nor is it caused by tabbable
|
|
753
|
-
// somehow. Though it was never stated officially, anyone who has ever used tabbable
|
|
754
|
-
// APIs on nodes in detached containers has actually implicitly used tabbable in what
|
|
755
|
-
// was later (as of v5.2.0 on Apr 9, 2021) called `displayCheck="none"` mode -- essentially
|
|
756
|
-
// considering __everything__ to be visible because of the innability to determine styles.
|
|
757
|
-
//
|
|
758
|
-
// v6.0.0: As of this major release, the default 'full' option __no longer treats detached
|
|
759
|
-
// nodes as visible with the 'none' fallback.__
|
|
760
|
-
if (displayCheck !== 'legacy-full') {
|
|
761
|
-
return true; // hidden
|
|
762
|
-
}
|
|
763
|
-
// else, fallback to 'none' mode and consider the node visible
|
|
764
|
-
} else if (displayCheck === 'non-zero-area') {
|
|
765
|
-
// NOTE: Even though this tests that the node's client rect is non-zero to determine
|
|
766
|
-
// whether it's displayed, and that a detached node will __always__ have a zero-area
|
|
767
|
-
// client rect, we don't special-case for whether the node is attached or not. In
|
|
768
|
-
// this mode, we do want to consider nodes that have a zero area to be hidden at all
|
|
769
|
-
// times, and that includes attached or not.
|
|
770
|
-
return isZeroArea(node);
|
|
771
|
-
}
|
|
772
|
-
|
|
773
|
-
// visible, as far as we can tell, or per current `displayCheck=none` mode, we assume
|
|
774
|
-
// it's visible
|
|
775
|
-
return false;
|
|
776
|
-
};
|
|
777
|
-
|
|
778
|
-
// form fields (nested) inside a disabled fieldset are not focusable/tabbable
|
|
779
|
-
// unless they are in the _first_ <legend> element of the top-most disabled
|
|
780
|
-
// fieldset
|
|
781
|
-
var isDisabledFromFieldset = function isDisabledFromFieldset(node) {
|
|
782
|
-
if (/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(node.tagName)) {
|
|
783
|
-
var parentNode = node.parentElement;
|
|
784
|
-
// check if `node` is contained in a disabled <fieldset>
|
|
785
|
-
while (parentNode) {
|
|
786
|
-
if (parentNode.tagName === 'FIELDSET' && parentNode.disabled) {
|
|
787
|
-
// look for the first <legend> among the children of the disabled <fieldset>
|
|
788
|
-
for (var i = 0; i < parentNode.children.length; i++) {
|
|
789
|
-
var child = parentNode.children.item(i);
|
|
790
|
-
// when the first <legend> (in document order) is found
|
|
791
|
-
if (child.tagName === 'LEGEND') {
|
|
792
|
-
// if its parent <fieldset> is not nested in another disabled <fieldset>,
|
|
793
|
-
// return whether `node` is a descendant of its first <legend>
|
|
794
|
-
return matches.call(parentNode, 'fieldset[disabled] *') ? true : !child.contains(node);
|
|
795
|
-
}
|
|
796
|
-
}
|
|
797
|
-
// the disabled <fieldset> containing `node` has no <legend>
|
|
798
|
-
return true;
|
|
799
|
-
}
|
|
800
|
-
parentNode = parentNode.parentElement;
|
|
801
|
-
}
|
|
802
|
-
}
|
|
803
|
-
|
|
804
|
-
// else, node's tabbable/focusable state should not be affected by a fieldset's
|
|
805
|
-
// enabled/disabled state
|
|
806
|
-
return false;
|
|
807
|
-
};
|
|
808
|
-
var isNodeMatchingSelectorFocusable = function isNodeMatchingSelectorFocusable(options, node) {
|
|
809
|
-
if (node.disabled || isHiddenInput(node) || isHidden(node, options) ||
|
|
810
|
-
// For a details element with a summary, the summary element gets the focus
|
|
811
|
-
isDetailsWithSummary(node) || isDisabledFromFieldset(node)) {
|
|
812
|
-
return false;
|
|
813
|
-
}
|
|
814
|
-
return true;
|
|
815
|
-
};
|
|
816
|
-
var isNodeMatchingSelectorTabbable = function isNodeMatchingSelectorTabbable(options, node) {
|
|
817
|
-
if (isNonTabbableRadio(node) || getTabIndex(node) < 0 || !isNodeMatchingSelectorFocusable(options, node)) {
|
|
818
|
-
return false;
|
|
819
|
-
}
|
|
820
|
-
return true;
|
|
821
|
-
};
|
|
822
|
-
var isShadowRootTabbable = function isShadowRootTabbable(shadowHostNode) {
|
|
823
|
-
var tabIndex = parseInt(shadowHostNode.getAttribute('tabindex'), 10);
|
|
824
|
-
if (isNaN(tabIndex) || tabIndex >= 0) {
|
|
825
|
-
return true;
|
|
826
|
-
}
|
|
827
|
-
// If a custom element has an explicit negative tabindex,
|
|
828
|
-
// browsers will not allow tab targeting said element's children.
|
|
829
|
-
return false;
|
|
830
|
-
};
|
|
831
|
-
|
|
832
|
-
/**
|
|
833
|
-
* @param {Array.<Element|CandidateScope>} candidates
|
|
834
|
-
* @returns Element[]
|
|
835
|
-
*/
|
|
836
|
-
var _sortByOrder = function sortByOrder(candidates) {
|
|
837
|
-
var regularTabbables = [];
|
|
838
|
-
var orderedTabbables = [];
|
|
839
|
-
candidates.forEach(function (item, i) {
|
|
840
|
-
var isScope = !!item.scopeParent;
|
|
841
|
-
var element = isScope ? item.scopeParent : item;
|
|
842
|
-
var candidateTabindex = getSortOrderTabIndex(element, isScope);
|
|
843
|
-
var elements = isScope ? _sortByOrder(item.candidates) : element;
|
|
844
|
-
if (candidateTabindex === 0) {
|
|
845
|
-
isScope ? regularTabbables.push.apply(regularTabbables, elements) : regularTabbables.push(element);
|
|
846
|
-
} else {
|
|
847
|
-
orderedTabbables.push({
|
|
848
|
-
documentOrder: i,
|
|
849
|
-
tabIndex: candidateTabindex,
|
|
850
|
-
item: item,
|
|
851
|
-
isScope: isScope,
|
|
852
|
-
content: elements
|
|
853
|
-
});
|
|
854
|
-
}
|
|
855
|
-
});
|
|
856
|
-
return orderedTabbables.sort(sortOrderedTabbables).reduce(function (acc, sortable) {
|
|
857
|
-
sortable.isScope ? acc.push.apply(acc, sortable.content) : acc.push(sortable.content);
|
|
858
|
-
return acc;
|
|
859
|
-
}, []).concat(regularTabbables);
|
|
860
|
-
};
|
|
861
|
-
var tabbable = function tabbable(container, options) {
|
|
862
|
-
options = options || {};
|
|
863
|
-
var candidates;
|
|
864
|
-
if (options.getShadowRoot) {
|
|
865
|
-
candidates = _getCandidatesIteratively([container], options.includeContainer, {
|
|
866
|
-
filter: isNodeMatchingSelectorTabbable.bind(null, options),
|
|
867
|
-
flatten: false,
|
|
868
|
-
getShadowRoot: options.getShadowRoot,
|
|
869
|
-
shadowRootFilter: isShadowRootTabbable
|
|
870
|
-
});
|
|
871
|
-
} else {
|
|
872
|
-
candidates = getCandidates(container, options.includeContainer, isNodeMatchingSelectorTabbable.bind(null, options));
|
|
873
|
-
}
|
|
874
|
-
return _sortByOrder(candidates);
|
|
875
|
-
};
|
|
876
|
-
var focusable = function focusable(container, options) {
|
|
877
|
-
options = options || {};
|
|
878
|
-
var candidates;
|
|
879
|
-
if (options.getShadowRoot) {
|
|
880
|
-
candidates = _getCandidatesIteratively([container], options.includeContainer, {
|
|
881
|
-
filter: isNodeMatchingSelectorFocusable.bind(null, options),
|
|
882
|
-
flatten: true,
|
|
883
|
-
getShadowRoot: options.getShadowRoot
|
|
884
|
-
});
|
|
885
|
-
} else {
|
|
886
|
-
candidates = getCandidates(container, options.includeContainer, isNodeMatchingSelectorFocusable.bind(null, options));
|
|
887
|
-
}
|
|
888
|
-
return candidates;
|
|
889
|
-
};
|
|
890
|
-
var isTabbable = function isTabbable(node, options) {
|
|
891
|
-
options = options || {};
|
|
892
|
-
if (!node) {
|
|
893
|
-
throw new Error('No node provided');
|
|
894
|
-
}
|
|
895
|
-
if (matches.call(node, candidateSelector) === false) {
|
|
896
|
-
return false;
|
|
897
|
-
}
|
|
898
|
-
return isNodeMatchingSelectorTabbable(options, node);
|
|
899
|
-
};
|
|
900
|
-
|
|
901
27
|
function computeCoordsFromPlacement(_ref, placement, rtl) {
|
|
902
28
|
let {
|
|
903
29
|
reference,
|
|
904
30
|
floating
|
|
905
31
|
} = _ref;
|
|
906
|
-
const sideAxis = getSideAxis(placement);
|
|
907
|
-
const alignmentAxis = getAlignmentAxis(placement);
|
|
908
|
-
const alignLength = getAxisLength(alignmentAxis);
|
|
909
|
-
const side = getSide(placement);
|
|
32
|
+
const sideAxis = index_esm.getSideAxis(placement);
|
|
33
|
+
const alignmentAxis = index_esm.getAlignmentAxis(placement);
|
|
34
|
+
const alignLength = index_esm.getAxisLength(alignmentAxis);
|
|
35
|
+
const side = index_esm.getSide(placement);
|
|
910
36
|
const isVertical = sideAxis === 'y';
|
|
911
37
|
const commonX = reference.x + reference.width / 2 - floating.width / 2;
|
|
912
38
|
const commonY = reference.y + reference.height / 2 - floating.height / 2;
|
|
@@ -943,7 +69,7 @@ function computeCoordsFromPlacement(_ref, placement, rtl) {
|
|
|
943
69
|
y: reference.y
|
|
944
70
|
};
|
|
945
71
|
}
|
|
946
|
-
switch (getAlignment(placement)) {
|
|
72
|
+
switch (index_esm.getAlignment(placement)) {
|
|
947
73
|
case 'start':
|
|
948
74
|
coords[alignmentAxis] -= commonAlign * (rtl && isVertical ? -1 : 1);
|
|
949
75
|
break;
|
|
@@ -981,11 +107,11 @@ async function detectOverflow(state, options) {
|
|
|
981
107
|
elementContext = 'floating',
|
|
982
108
|
altBoundary = false,
|
|
983
109
|
padding = 0
|
|
984
|
-
} = evaluate(options, state);
|
|
985
|
-
const paddingObject = getPaddingObject(padding);
|
|
110
|
+
} = index_esm.evaluate(options, state);
|
|
111
|
+
const paddingObject = index_esm.getPaddingObject(padding);
|
|
986
112
|
const altContext = elementContext === 'floating' ? 'reference' : 'floating';
|
|
987
113
|
const element = elements[altBoundary ? altContext : elementContext];
|
|
988
|
-
const clippingClientRect = rectToClientRect(await platform.getClippingRect({
|
|
114
|
+
const clippingClientRect = index_esm.rectToClientRect(await platform.getClippingRect({
|
|
989
115
|
element: ((_await$platform$isEle = await (platform.isElement == null ? void 0 : platform.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || (await (platform.getDocumentElement == null ? void 0 : platform.getDocumentElement(elements.floating))),
|
|
990
116
|
boundary,
|
|
991
117
|
rootBoundary,
|
|
@@ -1005,7 +131,7 @@ async function detectOverflow(state, options) {
|
|
|
1005
131
|
x: 1,
|
|
1006
132
|
y: 1
|
|
1007
133
|
};
|
|
1008
|
-
const elementClientRect = rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
134
|
+
const elementClientRect = index_esm.rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
1009
135
|
elements,
|
|
1010
136
|
rect,
|
|
1011
137
|
offsetParent,
|
|
@@ -1139,17 +265,17 @@ const arrow$3 = options => ({
|
|
|
1139
265
|
const {
|
|
1140
266
|
element,
|
|
1141
267
|
padding = 0
|
|
1142
|
-
} = evaluate(options, state) || {};
|
|
268
|
+
} = index_esm.evaluate(options, state) || {};
|
|
1143
269
|
if (element == null) {
|
|
1144
270
|
return {};
|
|
1145
271
|
}
|
|
1146
|
-
const paddingObject = getPaddingObject(padding);
|
|
272
|
+
const paddingObject = index_esm.getPaddingObject(padding);
|
|
1147
273
|
const coords = {
|
|
1148
274
|
x,
|
|
1149
275
|
y
|
|
1150
276
|
};
|
|
1151
|
-
const axis = getAlignmentAxis(placement);
|
|
1152
|
-
const length = getAxisLength(axis);
|
|
277
|
+
const axis = index_esm.getAlignmentAxis(placement);
|
|
278
|
+
const length = index_esm.getAxisLength(axis);
|
|
1153
279
|
const arrowDimensions = await platform.getDimensions(element);
|
|
1154
280
|
const isYAxis = axis === 'y';
|
|
1155
281
|
const minProp = isYAxis ? 'top' : 'left';
|
|
@@ -1169,21 +295,21 @@ const arrow$3 = options => ({
|
|
|
1169
295
|
// If the padding is large enough that it causes the arrow to no longer be
|
|
1170
296
|
// centered, modify the padding so that it is centered.
|
|
1171
297
|
const largestPossiblePadding = clientSize / 2 - arrowDimensions[length] / 2 - 1;
|
|
1172
|
-
const minPadding = min(paddingObject[minProp], largestPossiblePadding);
|
|
1173
|
-
const maxPadding = min(paddingObject[maxProp], largestPossiblePadding);
|
|
298
|
+
const minPadding = index_esm.min(paddingObject[minProp], largestPossiblePadding);
|
|
299
|
+
const maxPadding = index_esm.min(paddingObject[maxProp], largestPossiblePadding);
|
|
1174
300
|
|
|
1175
301
|
// Make sure the arrow doesn't overflow the floating element if the center
|
|
1176
302
|
// point is outside the floating element's bounds.
|
|
1177
303
|
const min$1 = minPadding;
|
|
1178
304
|
const max = clientSize - arrowDimensions[length] - maxPadding;
|
|
1179
305
|
const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference;
|
|
1180
|
-
const offset = clamp(min$1, center, max);
|
|
306
|
+
const offset = index_esm.clamp(min$1, center, max);
|
|
1181
307
|
|
|
1182
308
|
// If the reference is small enough that the arrow's padding causes it to
|
|
1183
309
|
// to point to nothing for an aligned placement, adjust the offset of the
|
|
1184
310
|
// floating element itself. To ensure `shift()` continues to take action,
|
|
1185
311
|
// a single reset is performed when this is true.
|
|
1186
|
-
const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center !== offset && rects.reference[length] / 2 - (center < min$1 ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0;
|
|
312
|
+
const shouldAddOffset = !middlewareData.arrow && index_esm.getAlignment(placement) != null && center !== offset && rects.reference[length] / 2 - (center < min$1 ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0;
|
|
1187
313
|
const alignmentOffset = shouldAddOffset ? center < min$1 ? center - min$1 : center - max : 0;
|
|
1188
314
|
return {
|
|
1189
315
|
[axis]: coords[axis] + alignmentOffset,
|
|
@@ -1200,10 +326,10 @@ const arrow$3 = options => ({
|
|
|
1200
326
|
});
|
|
1201
327
|
|
|
1202
328
|
function getPlacementList(alignment, autoAlignment, allowedPlacements) {
|
|
1203
|
-
const allowedPlacementsSortedByAlignment = alignment ? [...allowedPlacements.filter(placement => getAlignment(placement) === alignment), ...allowedPlacements.filter(placement => getAlignment(placement) !== alignment)] : allowedPlacements.filter(placement => getSide(placement) === placement);
|
|
329
|
+
const allowedPlacementsSortedByAlignment = alignment ? [...allowedPlacements.filter(placement => index_esm.getAlignment(placement) === alignment), ...allowedPlacements.filter(placement => index_esm.getAlignment(placement) !== alignment)] : allowedPlacements.filter(placement => index_esm.getSide(placement) === placement);
|
|
1204
330
|
return allowedPlacementsSortedByAlignment.filter(placement => {
|
|
1205
331
|
if (alignment) {
|
|
1206
|
-
return getAlignment(placement) === alignment || (autoAlignment ? getOppositeAlignmentPlacement(placement) !== placement : false);
|
|
332
|
+
return index_esm.getAlignment(placement) === alignment || (autoAlignment ? index_esm.getOppositeAlignmentPlacement(placement) !== placement : false);
|
|
1207
333
|
}
|
|
1208
334
|
return true;
|
|
1209
335
|
});
|
|
@@ -1233,18 +359,18 @@ const autoPlacement$2 = function (options) {
|
|
|
1233
359
|
const {
|
|
1234
360
|
crossAxis = false,
|
|
1235
361
|
alignment,
|
|
1236
|
-
allowedPlacements = placements,
|
|
362
|
+
allowedPlacements = index_esm.placements,
|
|
1237
363
|
autoAlignment = true,
|
|
1238
364
|
...detectOverflowOptions
|
|
1239
|
-
} = evaluate(options, state);
|
|
1240
|
-
const placements$1 = alignment !== undefined || allowedPlacements === placements ? getPlacementList(alignment || null, autoAlignment, allowedPlacements) : allowedPlacements;
|
|
365
|
+
} = index_esm.evaluate(options, state);
|
|
366
|
+
const placements$1 = alignment !== undefined || allowedPlacements === index_esm.placements ? getPlacementList(alignment || null, autoAlignment, allowedPlacements) : allowedPlacements;
|
|
1241
367
|
const overflow = await platform.detectOverflow(state, detectOverflowOptions);
|
|
1242
368
|
const currentIndex = ((_middlewareData$autoP = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP.index) || 0;
|
|
1243
369
|
const currentPlacement = placements$1[currentIndex];
|
|
1244
370
|
if (currentPlacement == null) {
|
|
1245
371
|
return {};
|
|
1246
372
|
}
|
|
1247
|
-
const alignmentSides = getAlignmentSides(currentPlacement, rects, await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating)));
|
|
373
|
+
const alignmentSides = index_esm.getAlignmentSides(currentPlacement, rects, await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating)));
|
|
1248
374
|
|
|
1249
375
|
// Make `computeCoords` start from the right place.
|
|
1250
376
|
if (placement !== currentPlacement) {
|
|
@@ -1254,7 +380,7 @@ const autoPlacement$2 = function (options) {
|
|
|
1254
380
|
}
|
|
1255
381
|
};
|
|
1256
382
|
}
|
|
1257
|
-
const currentOverflows = [overflow[getSide(currentPlacement)], overflow[alignmentSides[0]], overflow[alignmentSides[1]]];
|
|
383
|
+
const currentOverflows = [overflow[index_esm.getSide(currentPlacement)], overflow[alignmentSides[0]], overflow[alignmentSides[1]]];
|
|
1258
384
|
const allOverflows = [...(((_middlewareData$autoP2 = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP2.overflows) || []), {
|
|
1259
385
|
placement: currentPlacement,
|
|
1260
386
|
overflows: currentOverflows
|
|
@@ -1274,7 +400,7 @@ const autoPlacement$2 = function (options) {
|
|
|
1274
400
|
};
|
|
1275
401
|
}
|
|
1276
402
|
const placementsSortedByMostSpace = allOverflows.map(d => {
|
|
1277
|
-
const alignment = getAlignment(d.placement);
|
|
403
|
+
const alignment = index_esm.getAlignment(d.placement);
|
|
1278
404
|
return [d.placement, alignment && crossAxis ?
|
|
1279
405
|
// Check along the mainAxis and main crossAxis side.
|
|
1280
406
|
d.overflows.slice(0, 2).reduce((acc, v) => acc + v, 0) :
|
|
@@ -1284,7 +410,7 @@ const autoPlacement$2 = function (options) {
|
|
|
1284
410
|
const placementsThatFitOnEachSide = placementsSortedByMostSpace.filter(d => d[2].slice(0,
|
|
1285
411
|
// Aligned placements should not check their opposite crossAxis
|
|
1286
412
|
// side.
|
|
1287
|
-
getAlignment(d[0]) ? 2 : 3).every(v => v <= 0));
|
|
413
|
+
index_esm.getAlignment(d[0]) ? 2 : 3).every(v => v <= 0));
|
|
1288
414
|
const resetPlacement = ((_placementsThatFitOnE = placementsThatFitOnEachSide[0]) == null ? void 0 : _placementsThatFitOnE[0]) || placementsSortedByMostSpace[0][0];
|
|
1289
415
|
if (resetPlacement !== placement) {
|
|
1290
416
|
return {
|
|
@@ -1333,7 +459,7 @@ const flip$2 = function (options) {
|
|
|
1333
459
|
fallbackAxisSideDirection = 'none',
|
|
1334
460
|
flipAlignment = true,
|
|
1335
461
|
...detectOverflowOptions
|
|
1336
|
-
} = evaluate(options, state);
|
|
462
|
+
} = index_esm.evaluate(options, state);
|
|
1337
463
|
|
|
1338
464
|
// If a reset by the arrow was caused due to an alignment offset being
|
|
1339
465
|
// added, we should skip any logic now since `flip()` has already done its
|
|
@@ -1342,14 +468,14 @@ const flip$2 = function (options) {
|
|
|
1342
468
|
if ((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {
|
|
1343
469
|
return {};
|
|
1344
470
|
}
|
|
1345
|
-
const side = getSide(placement);
|
|
1346
|
-
const initialSideAxis = getSideAxis(initialPlacement);
|
|
1347
|
-
const isBasePlacement = getSide(initialPlacement) === initialPlacement;
|
|
471
|
+
const side = index_esm.getSide(placement);
|
|
472
|
+
const initialSideAxis = index_esm.getSideAxis(initialPlacement);
|
|
473
|
+
const isBasePlacement = index_esm.getSide(initialPlacement) === initialPlacement;
|
|
1348
474
|
const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));
|
|
1349
|
-
const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement));
|
|
475
|
+
const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [index_esm.getOppositePlacement(initialPlacement)] : index_esm.getExpandedPlacements(initialPlacement));
|
|
1350
476
|
const hasFallbackAxisSideDirection = fallbackAxisSideDirection !== 'none';
|
|
1351
477
|
if (!specifiedFallbackPlacements && hasFallbackAxisSideDirection) {
|
|
1352
|
-
fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));
|
|
478
|
+
fallbackPlacements.push(...index_esm.getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));
|
|
1353
479
|
}
|
|
1354
480
|
const placements = [initialPlacement, ...fallbackPlacements];
|
|
1355
481
|
const overflow = await platform.detectOverflow(state, detectOverflowOptions);
|
|
@@ -1359,7 +485,7 @@ const flip$2 = function (options) {
|
|
|
1359
485
|
overflows.push(overflow[side]);
|
|
1360
486
|
}
|
|
1361
487
|
if (checkCrossAxis) {
|
|
1362
|
-
const sides = getAlignmentSides(placement, rects, rtl);
|
|
488
|
+
const sides = index_esm.getAlignmentSides(placement, rects, rtl);
|
|
1363
489
|
overflows.push(overflow[sides[0]], overflow[sides[1]]);
|
|
1364
490
|
}
|
|
1365
491
|
overflowsData = [...overflowsData, {
|
|
@@ -1373,11 +499,11 @@ const flip$2 = function (options) {
|
|
|
1373
499
|
const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1;
|
|
1374
500
|
const nextPlacement = placements[nextIndex];
|
|
1375
501
|
if (nextPlacement) {
|
|
1376
|
-
const ignoreCrossAxisOverflow = checkCrossAxis === 'alignment' ? initialSideAxis !== getSideAxis(nextPlacement) : false;
|
|
502
|
+
const ignoreCrossAxisOverflow = checkCrossAxis === 'alignment' ? initialSideAxis !== index_esm.getSideAxis(nextPlacement) : false;
|
|
1377
503
|
if (!ignoreCrossAxisOverflow ||
|
|
1378
504
|
// We leave the current main axis only if every placement on that axis
|
|
1379
505
|
// overflows the main axis.
|
|
1380
|
-
overflowsData.every(d => getSideAxis(d.placement) === initialSideAxis ? d.overflows[0] > 0 : true)) {
|
|
506
|
+
overflowsData.every(d => index_esm.getSideAxis(d.placement) === initialSideAxis ? d.overflows[0] > 0 : true)) {
|
|
1381
507
|
// Try next placement and re-run the lifecycle.
|
|
1382
508
|
return {
|
|
1383
509
|
data: {
|
|
@@ -1403,7 +529,7 @@ const flip$2 = function (options) {
|
|
|
1403
529
|
var _overflowsData$filter2;
|
|
1404
530
|
const placement = (_overflowsData$filter2 = overflowsData.filter(d => {
|
|
1405
531
|
if (hasFallbackAxisSideDirection) {
|
|
1406
|
-
const currentSideAxis = getSideAxis(d.placement);
|
|
532
|
+
const currentSideAxis = index_esm.getSideAxis(d.placement);
|
|
1407
533
|
return currentSideAxis === initialSideAxis ||
|
|
1408
534
|
// Create a bias to the `y` side axis due to horizontal
|
|
1409
535
|
// reading directions favoring greater width.
|
|
@@ -1443,7 +569,7 @@ function getSideOffsets(overflow, rect) {
|
|
|
1443
569
|
};
|
|
1444
570
|
}
|
|
1445
571
|
function isAnySideFullyClipped(overflow) {
|
|
1446
|
-
return sides.some(side => overflow[side] >= 0);
|
|
572
|
+
return index_esm.sides.some(side => overflow[side] >= 0);
|
|
1447
573
|
}
|
|
1448
574
|
/**
|
|
1449
575
|
* Provides data to hide the floating element in applicable situations, such as
|
|
@@ -1465,7 +591,7 @@ const hide$2 = function (options) {
|
|
|
1465
591
|
const {
|
|
1466
592
|
strategy = 'referenceHidden',
|
|
1467
593
|
...detectOverflowOptions
|
|
1468
|
-
} = evaluate(options, state);
|
|
594
|
+
} = index_esm.evaluate(options, state);
|
|
1469
595
|
switch (strategy) {
|
|
1470
596
|
case 'referenceHidden':
|
|
1471
597
|
{
|
|
@@ -1516,12 +642,12 @@ async function convertValueToCoords(state, options) {
|
|
|
1516
642
|
elements
|
|
1517
643
|
} = state;
|
|
1518
644
|
const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));
|
|
1519
|
-
const side = getSide(placement);
|
|
1520
|
-
const alignment = getAlignment(placement);
|
|
1521
|
-
const isVertical = getSideAxis(placement) === 'y';
|
|
645
|
+
const side = index_esm.getSide(placement);
|
|
646
|
+
const alignment = index_esm.getAlignment(placement);
|
|
647
|
+
const isVertical = index_esm.getSideAxis(placement) === 'y';
|
|
1522
648
|
const mainAxisMulti = originSides.has(side) ? -1 : 1;
|
|
1523
649
|
const crossAxisMulti = rtl && isVertical ? -1 : 1;
|
|
1524
|
-
const rawValue = evaluate(options, state);
|
|
650
|
+
const rawValue = index_esm.evaluate(options, state);
|
|
1525
651
|
|
|
1526
652
|
// eslint-disable-next-line prefer-const
|
|
1527
653
|
let {
|
|
@@ -1625,14 +751,14 @@ const shift$2 = function (options) {
|
|
|
1625
751
|
}
|
|
1626
752
|
},
|
|
1627
753
|
...detectOverflowOptions
|
|
1628
|
-
} = evaluate(options, state);
|
|
754
|
+
} = index_esm.evaluate(options, state);
|
|
1629
755
|
const coords = {
|
|
1630
756
|
x,
|
|
1631
757
|
y
|
|
1632
758
|
};
|
|
1633
759
|
const overflow = await platform.detectOverflow(state, detectOverflowOptions);
|
|
1634
|
-
const crossAxis = getSideAxis(getSide(placement));
|
|
1635
|
-
const mainAxis = getOppositeAxis(crossAxis);
|
|
760
|
+
const crossAxis = index_esm.getSideAxis(index_esm.getSide(placement));
|
|
761
|
+
const mainAxis = index_esm.getOppositeAxis(crossAxis);
|
|
1636
762
|
let mainAxisCoord = coords[mainAxis];
|
|
1637
763
|
let crossAxisCoord = coords[crossAxis];
|
|
1638
764
|
if (checkMainAxis) {
|
|
@@ -1640,14 +766,14 @@ const shift$2 = function (options) {
|
|
|
1640
766
|
const maxSide = mainAxis === 'y' ? 'bottom' : 'right';
|
|
1641
767
|
const min = mainAxisCoord + overflow[minSide];
|
|
1642
768
|
const max = mainAxisCoord - overflow[maxSide];
|
|
1643
|
-
mainAxisCoord = clamp(min, mainAxisCoord, max);
|
|
769
|
+
mainAxisCoord = index_esm.clamp(min, mainAxisCoord, max);
|
|
1644
770
|
}
|
|
1645
771
|
if (checkCrossAxis) {
|
|
1646
772
|
const minSide = crossAxis === 'y' ? 'top' : 'left';
|
|
1647
773
|
const maxSide = crossAxis === 'y' ? 'bottom' : 'right';
|
|
1648
774
|
const min = crossAxisCoord + overflow[minSide];
|
|
1649
775
|
const max = crossAxisCoord - overflow[maxSide];
|
|
1650
|
-
crossAxisCoord = clamp(min, crossAxisCoord, max);
|
|
776
|
+
crossAxisCoord = index_esm.clamp(min, crossAxisCoord, max);
|
|
1651
777
|
}
|
|
1652
778
|
const limitedCoords = limiter.fn({
|
|
1653
779
|
...state,
|
|
@@ -1689,16 +815,16 @@ const limitShift$2 = function (options) {
|
|
|
1689
815
|
offset = 0,
|
|
1690
816
|
mainAxis: checkMainAxis = true,
|
|
1691
817
|
crossAxis: checkCrossAxis = true
|
|
1692
|
-
} = evaluate(options, state);
|
|
818
|
+
} = index_esm.evaluate(options, state);
|
|
1693
819
|
const coords = {
|
|
1694
820
|
x,
|
|
1695
821
|
y
|
|
1696
822
|
};
|
|
1697
|
-
const crossAxis = getSideAxis(placement);
|
|
1698
|
-
const mainAxis = getOppositeAxis(crossAxis);
|
|
823
|
+
const crossAxis = index_esm.getSideAxis(placement);
|
|
824
|
+
const mainAxis = index_esm.getOppositeAxis(crossAxis);
|
|
1699
825
|
let mainAxisCoord = coords[mainAxis];
|
|
1700
826
|
let crossAxisCoord = coords[crossAxis];
|
|
1701
|
-
const rawOffset = evaluate(offset, state);
|
|
827
|
+
const rawOffset = index_esm.evaluate(offset, state);
|
|
1702
828
|
const computedOffset = typeof rawOffset === 'number' ? {
|
|
1703
829
|
mainAxis: rawOffset,
|
|
1704
830
|
crossAxis: 0
|
|
@@ -1720,7 +846,7 @@ const limitShift$2 = function (options) {
|
|
|
1720
846
|
if (checkCrossAxis) {
|
|
1721
847
|
var _middlewareData$offse, _middlewareData$offse2;
|
|
1722
848
|
const len = mainAxis === 'y' ? 'width' : 'height';
|
|
1723
|
-
const isOriginSide = originSides.has(getSide(placement));
|
|
849
|
+
const isOriginSide = originSides.has(index_esm.getSide(placement));
|
|
1724
850
|
const limitMin = rects.reference[crossAxis] - rects.floating[len] + (isOriginSide ? ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse[crossAxis]) || 0 : 0) + (isOriginSide ? 0 : computedOffset.crossAxis);
|
|
1725
851
|
const limitMax = rects.reference[crossAxis] + rects.reference[len] + (isOriginSide ? 0 : ((_middlewareData$offse2 = middlewareData.offset) == null ? void 0 : _middlewareData$offse2[crossAxis]) || 0) - (isOriginSide ? computedOffset.crossAxis : 0);
|
|
1726
852
|
if (crossAxisCoord < limitMin) {
|
|
@@ -1761,11 +887,11 @@ const size$2 = function (options) {
|
|
|
1761
887
|
const {
|
|
1762
888
|
apply = () => {},
|
|
1763
889
|
...detectOverflowOptions
|
|
1764
|
-
} = evaluate(options, state);
|
|
890
|
+
} = index_esm.evaluate(options, state);
|
|
1765
891
|
const overflow = await platform.detectOverflow(state, detectOverflowOptions);
|
|
1766
|
-
const side = getSide(placement);
|
|
1767
|
-
const alignment = getAlignment(placement);
|
|
1768
|
-
const isYAxis = getSideAxis(placement) === 'y';
|
|
892
|
+
const side = index_esm.getSide(placement);
|
|
893
|
+
const alignment = index_esm.getAlignment(placement);
|
|
894
|
+
const isYAxis = index_esm.getSideAxis(placement) === 'y';
|
|
1769
895
|
const {
|
|
1770
896
|
width,
|
|
1771
897
|
height
|
|
@@ -1781,8 +907,8 @@ const size$2 = function (options) {
|
|
|
1781
907
|
}
|
|
1782
908
|
const maximumClippingHeight = height - overflow.top - overflow.bottom;
|
|
1783
909
|
const maximumClippingWidth = width - overflow.left - overflow.right;
|
|
1784
|
-
const overflowAvailableHeight = min(height - overflow[heightSide], maximumClippingHeight);
|
|
1785
|
-
const overflowAvailableWidth = min(width - overflow[widthSide], maximumClippingWidth);
|
|
910
|
+
const overflowAvailableHeight = index_esm.min(height - overflow[heightSide], maximumClippingHeight);
|
|
911
|
+
const overflowAvailableWidth = index_esm.min(width - overflow[widthSide], maximumClippingWidth);
|
|
1786
912
|
const noShift = !state.middlewareData.shift;
|
|
1787
913
|
let availableHeight = overflowAvailableHeight;
|
|
1788
914
|
let availableWidth = overflowAvailableWidth;
|
|
@@ -1793,14 +919,14 @@ const size$2 = function (options) {
|
|
|
1793
919
|
availableHeight = maximumClippingHeight;
|
|
1794
920
|
}
|
|
1795
921
|
if (noShift && !alignment) {
|
|
1796
|
-
const xMin = max(overflow.left, 0);
|
|
1797
|
-
const xMax = max(overflow.right, 0);
|
|
1798
|
-
const yMin = max(overflow.top, 0);
|
|
1799
|
-
const yMax = max(overflow.bottom, 0);
|
|
922
|
+
const xMin = index_esm.max(overflow.left, 0);
|
|
923
|
+
const xMax = index_esm.max(overflow.right, 0);
|
|
924
|
+
const yMin = index_esm.max(overflow.top, 0);
|
|
925
|
+
const yMax = index_esm.max(overflow.bottom, 0);
|
|
1800
926
|
if (isYAxis) {
|
|
1801
|
-
availableWidth = width - 2 * (xMin !== 0 || xMax !== 0 ? xMin + xMax : max(overflow.left, overflow.right));
|
|
927
|
+
availableWidth = width - 2 * (xMin !== 0 || xMax !== 0 ? xMin + xMax : index_esm.max(overflow.left, overflow.right));
|
|
1802
928
|
} else {
|
|
1803
|
-
availableHeight = height - 2 * (yMin !== 0 || yMax !== 0 ? yMin + yMax : max(overflow.top, overflow.bottom));
|
|
929
|
+
availableHeight = height - 2 * (yMin !== 0 || yMax !== 0 ? yMin + yMax : index_esm.max(overflow.top, overflow.bottom));
|
|
1804
930
|
}
|
|
1805
931
|
}
|
|
1806
932
|
await apply({
|
|
@@ -1822,15 +948,15 @@ const size$2 = function (options) {
|
|
|
1822
948
|
};
|
|
1823
949
|
|
|
1824
950
|
function getCssDimensions(element) {
|
|
1825
|
-
const css = getComputedStyle
|
|
951
|
+
const css = index_esm.getComputedStyle(element);
|
|
1826
952
|
// In testing environments, the `width` and `height` properties are empty
|
|
1827
953
|
// strings for SVG elements, returning NaN. Fallback to `0` in this case.
|
|
1828
954
|
let width = parseFloat(css.width) || 0;
|
|
1829
955
|
let height = parseFloat(css.height) || 0;
|
|
1830
|
-
const hasOffset = isHTMLElement(element);
|
|
956
|
+
const hasOffset = index_esm.isHTMLElement(element);
|
|
1831
957
|
const offsetWidth = hasOffset ? element.offsetWidth : width;
|
|
1832
958
|
const offsetHeight = hasOffset ? element.offsetHeight : height;
|
|
1833
|
-
const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight;
|
|
959
|
+
const shouldFallback = index_esm.round(width) !== offsetWidth || index_esm.round(height) !== offsetHeight;
|
|
1834
960
|
if (shouldFallback) {
|
|
1835
961
|
width = offsetWidth;
|
|
1836
962
|
height = offsetHeight;
|
|
@@ -1843,13 +969,13 @@ function getCssDimensions(element) {
|
|
|
1843
969
|
}
|
|
1844
970
|
|
|
1845
971
|
function unwrapElement(element) {
|
|
1846
|
-
return !isElement(element) ? element.contextElement : element;
|
|
972
|
+
return !index_esm.isElement(element) ? element.contextElement : element;
|
|
1847
973
|
}
|
|
1848
974
|
|
|
1849
975
|
function getScale(element) {
|
|
1850
976
|
const domElement = unwrapElement(element);
|
|
1851
|
-
if (!isHTMLElement(domElement)) {
|
|
1852
|
-
return createCoords(1);
|
|
977
|
+
if (!index_esm.isHTMLElement(domElement)) {
|
|
978
|
+
return index_esm.createCoords(1);
|
|
1853
979
|
}
|
|
1854
980
|
const rect = domElement.getBoundingClientRect();
|
|
1855
981
|
const {
|
|
@@ -1857,8 +983,8 @@ function getScale(element) {
|
|
|
1857
983
|
height,
|
|
1858
984
|
$
|
|
1859
985
|
} = getCssDimensions(domElement);
|
|
1860
|
-
let x = ($ ? round(rect.width) : rect.width) / width;
|
|
1861
|
-
let y = ($ ? round(rect.height) : rect.height) / height;
|
|
986
|
+
let x = ($ ? index_esm.round(rect.width) : rect.width) / width;
|
|
987
|
+
let y = ($ ? index_esm.round(rect.height) : rect.height) / height;
|
|
1862
988
|
|
|
1863
989
|
// 0, NaN, or Infinity should always fallback to 1.
|
|
1864
990
|
|
|
@@ -1874,10 +1000,10 @@ function getScale(element) {
|
|
|
1874
1000
|
};
|
|
1875
1001
|
}
|
|
1876
1002
|
|
|
1877
|
-
const noOffsets = /*#__PURE__*/createCoords(0);
|
|
1003
|
+
const noOffsets = /*#__PURE__*/index_esm.createCoords(0);
|
|
1878
1004
|
function getVisualOffsets(element) {
|
|
1879
|
-
const win = getWindow(element);
|
|
1880
|
-
if (!isWebKit() || !win.visualViewport) {
|
|
1005
|
+
const win = index_esm.getWindow(element);
|
|
1006
|
+
if (!index_esm.isWebKit() || !win.visualViewport) {
|
|
1881
1007
|
return noOffsets;
|
|
1882
1008
|
}
|
|
1883
1009
|
return {
|
|
@@ -1889,7 +1015,7 @@ function shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) {
|
|
|
1889
1015
|
if (isFixed === void 0) {
|
|
1890
1016
|
isFixed = false;
|
|
1891
1017
|
}
|
|
1892
|
-
if (!floatingOffsetParent || isFixed && floatingOffsetParent !== getWindow(element)) {
|
|
1018
|
+
if (!floatingOffsetParent || isFixed && floatingOffsetParent !== index_esm.getWindow(element)) {
|
|
1893
1019
|
return false;
|
|
1894
1020
|
}
|
|
1895
1021
|
return isFixed;
|
|
@@ -1904,30 +1030,30 @@ function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetPar
|
|
|
1904
1030
|
}
|
|
1905
1031
|
const clientRect = element.getBoundingClientRect();
|
|
1906
1032
|
const domElement = unwrapElement(element);
|
|
1907
|
-
let scale = createCoords(1);
|
|
1033
|
+
let scale = index_esm.createCoords(1);
|
|
1908
1034
|
if (includeScale) {
|
|
1909
1035
|
if (offsetParent) {
|
|
1910
|
-
if (isElement(offsetParent)) {
|
|
1036
|
+
if (index_esm.isElement(offsetParent)) {
|
|
1911
1037
|
scale = getScale(offsetParent);
|
|
1912
1038
|
}
|
|
1913
1039
|
} else {
|
|
1914
1040
|
scale = getScale(element);
|
|
1915
1041
|
}
|
|
1916
1042
|
}
|
|
1917
|
-
const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : createCoords(0);
|
|
1043
|
+
const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : index_esm.createCoords(0);
|
|
1918
1044
|
let x = (clientRect.left + visualOffsets.x) / scale.x;
|
|
1919
1045
|
let y = (clientRect.top + visualOffsets.y) / scale.y;
|
|
1920
1046
|
let width = clientRect.width / scale.x;
|
|
1921
1047
|
let height = clientRect.height / scale.y;
|
|
1922
1048
|
if (domElement) {
|
|
1923
|
-
const win = getWindow(domElement);
|
|
1924
|
-
const offsetWin = offsetParent && isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;
|
|
1049
|
+
const win = index_esm.getWindow(domElement);
|
|
1050
|
+
const offsetWin = offsetParent && index_esm.isElement(offsetParent) ? index_esm.getWindow(offsetParent) : offsetParent;
|
|
1925
1051
|
let currentWin = win;
|
|
1926
|
-
let currentIFrame = getFrameElement(currentWin);
|
|
1052
|
+
let currentIFrame = index_esm.getFrameElement(currentWin);
|
|
1927
1053
|
while (currentIFrame && offsetParent && offsetWin !== currentWin) {
|
|
1928
1054
|
const iframeScale = getScale(currentIFrame);
|
|
1929
1055
|
const iframeRect = currentIFrame.getBoundingClientRect();
|
|
1930
|
-
const css = getComputedStyle
|
|
1056
|
+
const css = index_esm.getComputedStyle(currentIFrame);
|
|
1931
1057
|
const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x;
|
|
1932
1058
|
const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y;
|
|
1933
1059
|
x *= iframeScale.x;
|
|
@@ -1936,11 +1062,11 @@ function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetPar
|
|
|
1936
1062
|
height *= iframeScale.y;
|
|
1937
1063
|
x += left;
|
|
1938
1064
|
y += top;
|
|
1939
|
-
currentWin = getWindow(currentIFrame);
|
|
1940
|
-
currentIFrame = getFrameElement(currentWin);
|
|
1065
|
+
currentWin = index_esm.getWindow(currentIFrame);
|
|
1066
|
+
currentIFrame = index_esm.getFrameElement(currentWin);
|
|
1941
1067
|
}
|
|
1942
1068
|
}
|
|
1943
|
-
return rectToClientRect({
|
|
1069
|
+
return index_esm.rectToClientRect({
|
|
1944
1070
|
width,
|
|
1945
1071
|
height,
|
|
1946
1072
|
x,
|
|
@@ -1951,9 +1077,9 @@ function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetPar
|
|
|
1951
1077
|
// If <html> has a CSS width greater than the viewport, then this will be
|
|
1952
1078
|
// incorrect for RTL.
|
|
1953
1079
|
function getWindowScrollBarX(element, rect) {
|
|
1954
|
-
const leftScroll = getNodeScroll(element).scrollLeft;
|
|
1080
|
+
const leftScroll = index_esm.getNodeScroll(element).scrollLeft;
|
|
1955
1081
|
if (!rect) {
|
|
1956
|
-
return getBoundingClientRect(getDocumentElement(element)).left + leftScroll;
|
|
1082
|
+
return getBoundingClientRect(index_esm.getDocumentElement(element)).left + leftScroll;
|
|
1957
1083
|
}
|
|
1958
1084
|
return rect.left + leftScroll;
|
|
1959
1085
|
}
|
|
@@ -1976,8 +1102,8 @@ function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
|
|
|
1976
1102
|
strategy
|
|
1977
1103
|
} = _ref;
|
|
1978
1104
|
const isFixed = strategy === 'fixed';
|
|
1979
|
-
const documentElement = getDocumentElement(offsetParent);
|
|
1980
|
-
const topLayer = elements ? isTopLayer(elements.floating) : false;
|
|
1105
|
+
const documentElement = index_esm.getDocumentElement(offsetParent);
|
|
1106
|
+
const topLayer = elements ? index_esm.isTopLayer(elements.floating) : false;
|
|
1981
1107
|
if (offsetParent === documentElement || topLayer && isFixed) {
|
|
1982
1108
|
return rect;
|
|
1983
1109
|
}
|
|
@@ -1985,12 +1111,12 @@ function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
|
|
|
1985
1111
|
scrollLeft: 0,
|
|
1986
1112
|
scrollTop: 0
|
|
1987
1113
|
};
|
|
1988
|
-
let scale = createCoords(1);
|
|
1989
|
-
const offsets = createCoords(0);
|
|
1990
|
-
const isOffsetParentAnElement = isHTMLElement(offsetParent);
|
|
1114
|
+
let scale = index_esm.createCoords(1);
|
|
1115
|
+
const offsets = index_esm.createCoords(0);
|
|
1116
|
+
const isOffsetParentAnElement = index_esm.isHTMLElement(offsetParent);
|
|
1991
1117
|
if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
|
|
1992
|
-
if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {
|
|
1993
|
-
scroll = getNodeScroll(offsetParent);
|
|
1118
|
+
if (index_esm.getNodeName(offsetParent) !== 'body' || index_esm.isOverflowElement(documentElement)) {
|
|
1119
|
+
scroll = index_esm.getNodeScroll(offsetParent);
|
|
1994
1120
|
}
|
|
1995
1121
|
if (isOffsetParentAnElement) {
|
|
1996
1122
|
const offsetRect = getBoundingClientRect(offsetParent);
|
|
@@ -1999,7 +1125,7 @@ function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
|
|
|
1999
1125
|
offsets.y = offsetRect.y + offsetParent.clientTop;
|
|
2000
1126
|
}
|
|
2001
1127
|
}
|
|
2002
|
-
const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);
|
|
1128
|
+
const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : index_esm.createCoords(0);
|
|
2003
1129
|
return {
|
|
2004
1130
|
width: rect.width * scale.x,
|
|
2005
1131
|
height: rect.height * scale.y,
|
|
@@ -2015,15 +1141,15 @@ function getClientRects(element) {
|
|
|
2015
1141
|
// Gets the entire size of the scrollable document area, even extending outside
|
|
2016
1142
|
// of the `<html>` and `<body>` rect bounds if horizontally scrollable.
|
|
2017
1143
|
function getDocumentRect(element) {
|
|
2018
|
-
const html = getDocumentElement(element);
|
|
2019
|
-
const scroll = getNodeScroll(element);
|
|
1144
|
+
const html = index_esm.getDocumentElement(element);
|
|
1145
|
+
const scroll = index_esm.getNodeScroll(element);
|
|
2020
1146
|
const body = element.ownerDocument.body;
|
|
2021
|
-
const width = max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth);
|
|
2022
|
-
const height = max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight);
|
|
1147
|
+
const width = index_esm.max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth);
|
|
1148
|
+
const height = index_esm.max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight);
|
|
2023
1149
|
let x = -scroll.scrollLeft + getWindowScrollBarX(element);
|
|
2024
1150
|
const y = -scroll.scrollTop;
|
|
2025
|
-
if (getComputedStyle
|
|
2026
|
-
x += max(html.clientWidth, body.clientWidth) - width;
|
|
1151
|
+
if (index_esm.getComputedStyle(body).direction === 'rtl') {
|
|
1152
|
+
x += index_esm.max(html.clientWidth, body.clientWidth) - width;
|
|
2027
1153
|
}
|
|
2028
1154
|
return {
|
|
2029
1155
|
width,
|
|
@@ -2038,8 +1164,8 @@ function getDocumentRect(element) {
|
|
|
2038
1164
|
// Most scrollbars leave 15-18px of space.
|
|
2039
1165
|
const SCROLLBAR_MAX = 25;
|
|
2040
1166
|
function getViewportRect(element, strategy) {
|
|
2041
|
-
const win = getWindow(element);
|
|
2042
|
-
const html = getDocumentElement(element);
|
|
1167
|
+
const win = index_esm.getWindow(element);
|
|
1168
|
+
const html = index_esm.getDocumentElement(element);
|
|
2043
1169
|
const visualViewport = win.visualViewport;
|
|
2044
1170
|
let width = html.clientWidth;
|
|
2045
1171
|
let height = html.clientHeight;
|
|
@@ -2048,7 +1174,7 @@ function getViewportRect(element, strategy) {
|
|
|
2048
1174
|
if (visualViewport) {
|
|
2049
1175
|
width = visualViewport.width;
|
|
2050
1176
|
height = visualViewport.height;
|
|
2051
|
-
const visualViewportBased = isWebKit();
|
|
1177
|
+
const visualViewportBased = index_esm.isWebKit();
|
|
2052
1178
|
if (!visualViewportBased || visualViewportBased && strategy === 'fixed') {
|
|
2053
1179
|
x = visualViewport.offsetLeft;
|
|
2054
1180
|
y = visualViewport.offsetTop;
|
|
@@ -2085,7 +1211,7 @@ function getInnerBoundingClientRect(element, strategy) {
|
|
|
2085
1211
|
const clientRect = getBoundingClientRect(element, true, strategy === 'fixed');
|
|
2086
1212
|
const top = clientRect.top + element.clientTop;
|
|
2087
1213
|
const left = clientRect.left + element.clientLeft;
|
|
2088
|
-
const scale = isHTMLElement(element) ? getScale(element) : createCoords(1);
|
|
1214
|
+
const scale = index_esm.isHTMLElement(element) ? getScale(element) : index_esm.createCoords(1);
|
|
2089
1215
|
const width = element.clientWidth * scale.x;
|
|
2090
1216
|
const height = element.clientHeight * scale.y;
|
|
2091
1217
|
const x = left * scale.x;
|
|
@@ -2102,8 +1228,8 @@ function getClientRectFromClippingAncestor(element, clippingAncestor, strategy)
|
|
|
2102
1228
|
if (clippingAncestor === 'viewport') {
|
|
2103
1229
|
rect = getViewportRect(element, strategy);
|
|
2104
1230
|
} else if (clippingAncestor === 'document') {
|
|
2105
|
-
rect = getDocumentRect(getDocumentElement(element));
|
|
2106
|
-
} else if (isElement(clippingAncestor)) {
|
|
1231
|
+
rect = getDocumentRect(index_esm.getDocumentElement(element));
|
|
1232
|
+
} else if (index_esm.isElement(clippingAncestor)) {
|
|
2107
1233
|
rect = getInnerBoundingClientRect(clippingAncestor, strategy);
|
|
2108
1234
|
} else {
|
|
2109
1235
|
const visualOffsets = getVisualOffsets(element);
|
|
@@ -2114,14 +1240,14 @@ function getClientRectFromClippingAncestor(element, clippingAncestor, strategy)
|
|
|
2114
1240
|
height: clippingAncestor.height
|
|
2115
1241
|
};
|
|
2116
1242
|
}
|
|
2117
|
-
return rectToClientRect(rect);
|
|
1243
|
+
return index_esm.rectToClientRect(rect);
|
|
2118
1244
|
}
|
|
2119
1245
|
function hasFixedPositionAncestor(element, stopNode) {
|
|
2120
|
-
const parentNode = getParentNode(element);
|
|
2121
|
-
if (parentNode === stopNode || !isElement(parentNode) || isLastTraversableNode(parentNode)) {
|
|
1246
|
+
const parentNode = index_esm.getParentNode(element);
|
|
1247
|
+
if (parentNode === stopNode || !index_esm.isElement(parentNode) || index_esm.isLastTraversableNode(parentNode)) {
|
|
2122
1248
|
return false;
|
|
2123
1249
|
}
|
|
2124
|
-
return getComputedStyle
|
|
1250
|
+
return index_esm.getComputedStyle(parentNode).position === 'fixed' || hasFixedPositionAncestor(parentNode, stopNode);
|
|
2125
1251
|
}
|
|
2126
1252
|
|
|
2127
1253
|
// A "clipping ancestor" is an `overflow` element with the characteristic of
|
|
@@ -2132,19 +1258,19 @@ function getClippingElementAncestors(element, cache) {
|
|
|
2132
1258
|
if (cachedResult) {
|
|
2133
1259
|
return cachedResult;
|
|
2134
1260
|
}
|
|
2135
|
-
let result = getOverflowAncestors(element, [], false).filter(el => isElement(el) && getNodeName(el) !== 'body');
|
|
1261
|
+
let result = index_esm.getOverflowAncestors(element, [], false).filter(el => index_esm.isElement(el) && index_esm.getNodeName(el) !== 'body');
|
|
2136
1262
|
let currentContainingBlockComputedStyle = null;
|
|
2137
|
-
const elementIsFixed = getComputedStyle
|
|
2138
|
-
let currentNode = elementIsFixed ? getParentNode(element) : element;
|
|
1263
|
+
const elementIsFixed = index_esm.getComputedStyle(element).position === 'fixed';
|
|
1264
|
+
let currentNode = elementIsFixed ? index_esm.getParentNode(element) : element;
|
|
2139
1265
|
|
|
2140
1266
|
// https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
|
|
2141
|
-
while (isElement(currentNode) && !isLastTraversableNode(currentNode)) {
|
|
2142
|
-
const computedStyle = getComputedStyle
|
|
2143
|
-
const currentNodeIsContaining = isContainingBlock(currentNode);
|
|
1267
|
+
while (index_esm.isElement(currentNode) && !index_esm.isLastTraversableNode(currentNode)) {
|
|
1268
|
+
const computedStyle = index_esm.getComputedStyle(currentNode);
|
|
1269
|
+
const currentNodeIsContaining = index_esm.isContainingBlock(currentNode);
|
|
2144
1270
|
if (!currentNodeIsContaining && computedStyle.position === 'fixed') {
|
|
2145
1271
|
currentContainingBlockComputedStyle = null;
|
|
2146
1272
|
}
|
|
2147
|
-
const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === 'static' && !!currentContainingBlockComputedStyle && (currentContainingBlockComputedStyle.position === 'absolute' || currentContainingBlockComputedStyle.position === 'fixed') || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode);
|
|
1273
|
+
const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === 'static' && !!currentContainingBlockComputedStyle && (currentContainingBlockComputedStyle.position === 'absolute' || currentContainingBlockComputedStyle.position === 'fixed') || index_esm.isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode);
|
|
2148
1274
|
if (shouldDropCurrentNode) {
|
|
2149
1275
|
// Drop non-containing blocks.
|
|
2150
1276
|
result = result.filter(ancestor => ancestor !== currentNode);
|
|
@@ -2152,7 +1278,7 @@ function getClippingElementAncestors(element, cache) {
|
|
|
2152
1278
|
// Record last containing block for next iteration.
|
|
2153
1279
|
currentContainingBlockComputedStyle = computedStyle;
|
|
2154
1280
|
}
|
|
2155
|
-
currentNode = getParentNode(currentNode);
|
|
1281
|
+
currentNode = index_esm.getParentNode(currentNode);
|
|
2156
1282
|
}
|
|
2157
1283
|
cache.set(element, result);
|
|
2158
1284
|
return result;
|
|
@@ -2167,7 +1293,7 @@ function getClippingRect(_ref) {
|
|
|
2167
1293
|
rootBoundary,
|
|
2168
1294
|
strategy
|
|
2169
1295
|
} = _ref;
|
|
2170
|
-
const elementClippingAncestors = boundary === 'clippingAncestors' ? isTopLayer(element) ? [] : getClippingElementAncestors(element, this._c) : [].concat(boundary);
|
|
1296
|
+
const elementClippingAncestors = boundary === 'clippingAncestors' ? index_esm.isTopLayer(element) ? [] : getClippingElementAncestors(element, this._c) : [].concat(boundary);
|
|
2171
1297
|
const clippingAncestors = [...elementClippingAncestors, rootBoundary];
|
|
2172
1298
|
const firstRect = getClientRectFromClippingAncestor(element, clippingAncestors[0], strategy);
|
|
2173
1299
|
let top = firstRect.top;
|
|
@@ -2176,10 +1302,10 @@ function getClippingRect(_ref) {
|
|
|
2176
1302
|
let left = firstRect.left;
|
|
2177
1303
|
for (let i = 1; i < clippingAncestors.length; i++) {
|
|
2178
1304
|
const rect = getClientRectFromClippingAncestor(element, clippingAncestors[i], strategy);
|
|
2179
|
-
top = max(rect.top, top);
|
|
2180
|
-
right = min(rect.right, right);
|
|
2181
|
-
bottom = min(rect.bottom, bottom);
|
|
2182
|
-
left = max(rect.left, left);
|
|
1305
|
+
top = index_esm.max(rect.top, top);
|
|
1306
|
+
right = index_esm.min(rect.right, right);
|
|
1307
|
+
bottom = index_esm.min(rect.bottom, bottom);
|
|
1308
|
+
left = index_esm.max(rect.left, left);
|
|
2183
1309
|
}
|
|
2184
1310
|
return {
|
|
2185
1311
|
width: right - left,
|
|
@@ -2201,15 +1327,15 @@ function getDimensions(element) {
|
|
|
2201
1327
|
}
|
|
2202
1328
|
|
|
2203
1329
|
function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
|
|
2204
|
-
const isOffsetParentAnElement = isHTMLElement(offsetParent);
|
|
2205
|
-
const documentElement = getDocumentElement(offsetParent);
|
|
1330
|
+
const isOffsetParentAnElement = index_esm.isHTMLElement(offsetParent);
|
|
1331
|
+
const documentElement = index_esm.getDocumentElement(offsetParent);
|
|
2206
1332
|
const isFixed = strategy === 'fixed';
|
|
2207
1333
|
const rect = getBoundingClientRect(element, true, isFixed, offsetParent);
|
|
2208
1334
|
let scroll = {
|
|
2209
1335
|
scrollLeft: 0,
|
|
2210
1336
|
scrollTop: 0
|
|
2211
1337
|
};
|
|
2212
|
-
const offsets = createCoords(0);
|
|
1338
|
+
const offsets = index_esm.createCoords(0);
|
|
2213
1339
|
|
|
2214
1340
|
// If the <body> scrollbar appears on the left (e.g. RTL systems). Use
|
|
2215
1341
|
// Firefox with layout.scrollbar.side = 3 in about:config to test this.
|
|
@@ -2217,8 +1343,8 @@ function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
|
|
|
2217
1343
|
offsets.x = getWindowScrollBarX(documentElement);
|
|
2218
1344
|
}
|
|
2219
1345
|
if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
|
|
2220
|
-
if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {
|
|
2221
|
-
scroll = getNodeScroll(offsetParent);
|
|
1346
|
+
if (index_esm.getNodeName(offsetParent) !== 'body' || index_esm.isOverflowElement(documentElement)) {
|
|
1347
|
+
scroll = index_esm.getNodeScroll(offsetParent);
|
|
2222
1348
|
}
|
|
2223
1349
|
if (isOffsetParentAnElement) {
|
|
2224
1350
|
const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent);
|
|
@@ -2231,7 +1357,7 @@ function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
|
|
|
2231
1357
|
if (isFixed && !isOffsetParentAnElement && documentElement) {
|
|
2232
1358
|
setLeftRTLScrollbarOffset();
|
|
2233
1359
|
}
|
|
2234
|
-
const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);
|
|
1360
|
+
const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : index_esm.createCoords(0);
|
|
2235
1361
|
const x = rect.left + scroll.scrollLeft - offsets.x - htmlOffset.x;
|
|
2236
1362
|
const y = rect.top + scroll.scrollTop - offsets.y - htmlOffset.y;
|
|
2237
1363
|
return {
|
|
@@ -2243,11 +1369,11 @@ function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
|
|
|
2243
1369
|
}
|
|
2244
1370
|
|
|
2245
1371
|
function isStaticPositioned(element) {
|
|
2246
|
-
return getComputedStyle
|
|
1372
|
+
return index_esm.getComputedStyle(element).position === 'static';
|
|
2247
1373
|
}
|
|
2248
1374
|
|
|
2249
1375
|
function getTrueOffsetParent(element, polyfill) {
|
|
2250
|
-
if (!isHTMLElement(element) || getComputedStyle
|
|
1376
|
+
if (!index_esm.isHTMLElement(element) || index_esm.getComputedStyle(element).position === 'fixed') {
|
|
2251
1377
|
return null;
|
|
2252
1378
|
}
|
|
2253
1379
|
if (polyfill) {
|
|
@@ -2259,7 +1385,7 @@ function getTrueOffsetParent(element, polyfill) {
|
|
|
2259
1385
|
// while Chrome and Safari return the <body> element. The <body> element must
|
|
2260
1386
|
// be used to perform the correct calculations even if the <html> element is
|
|
2261
1387
|
// non-static.
|
|
2262
|
-
if (getDocumentElement(element) === rawOffsetParent) {
|
|
1388
|
+
if (index_esm.getDocumentElement(element) === rawOffsetParent) {
|
|
2263
1389
|
rawOffsetParent = rawOffsetParent.ownerDocument.body;
|
|
2264
1390
|
}
|
|
2265
1391
|
return rawOffsetParent;
|
|
@@ -2268,28 +1394,28 @@ function getTrueOffsetParent(element, polyfill) {
|
|
|
2268
1394
|
// Gets the closest ancestor positioned element. Handles some edge cases,
|
|
2269
1395
|
// such as table ancestors and cross browser bugs.
|
|
2270
1396
|
function getOffsetParent(element, polyfill) {
|
|
2271
|
-
const win = getWindow(element);
|
|
2272
|
-
if (isTopLayer(element)) {
|
|
1397
|
+
const win = index_esm.getWindow(element);
|
|
1398
|
+
if (index_esm.isTopLayer(element)) {
|
|
2273
1399
|
return win;
|
|
2274
1400
|
}
|
|
2275
|
-
if (!isHTMLElement(element)) {
|
|
2276
|
-
let svgOffsetParent = getParentNode(element);
|
|
2277
|
-
while (svgOffsetParent && !isLastTraversableNode(svgOffsetParent)) {
|
|
2278
|
-
if (isElement(svgOffsetParent) && !isStaticPositioned(svgOffsetParent)) {
|
|
1401
|
+
if (!index_esm.isHTMLElement(element)) {
|
|
1402
|
+
let svgOffsetParent = index_esm.getParentNode(element);
|
|
1403
|
+
while (svgOffsetParent && !index_esm.isLastTraversableNode(svgOffsetParent)) {
|
|
1404
|
+
if (index_esm.isElement(svgOffsetParent) && !isStaticPositioned(svgOffsetParent)) {
|
|
2279
1405
|
return svgOffsetParent;
|
|
2280
1406
|
}
|
|
2281
|
-
svgOffsetParent = getParentNode(svgOffsetParent);
|
|
1407
|
+
svgOffsetParent = index_esm.getParentNode(svgOffsetParent);
|
|
2282
1408
|
}
|
|
2283
1409
|
return win;
|
|
2284
1410
|
}
|
|
2285
1411
|
let offsetParent = getTrueOffsetParent(element, polyfill);
|
|
2286
|
-
while (offsetParent && isTableElement(offsetParent) && isStaticPositioned(offsetParent)) {
|
|
1412
|
+
while (offsetParent && index_esm.isTableElement(offsetParent) && isStaticPositioned(offsetParent)) {
|
|
2287
1413
|
offsetParent = getTrueOffsetParent(offsetParent, polyfill);
|
|
2288
1414
|
}
|
|
2289
|
-
if (offsetParent && isLastTraversableNode(offsetParent) && isStaticPositioned(offsetParent) && !isContainingBlock(offsetParent)) {
|
|
1415
|
+
if (offsetParent && index_esm.isLastTraversableNode(offsetParent) && isStaticPositioned(offsetParent) && !index_esm.isContainingBlock(offsetParent)) {
|
|
2290
1416
|
return win;
|
|
2291
1417
|
}
|
|
2292
|
-
return offsetParent || getContainingBlock(element) || win;
|
|
1418
|
+
return offsetParent || index_esm.getContainingBlock(element) || win;
|
|
2293
1419
|
}
|
|
2294
1420
|
|
|
2295
1421
|
const getElementRects = async function (data) {
|
|
@@ -2308,19 +1434,19 @@ const getElementRects = async function (data) {
|
|
|
2308
1434
|
};
|
|
2309
1435
|
|
|
2310
1436
|
function isRTL(element) {
|
|
2311
|
-
return getComputedStyle
|
|
1437
|
+
return index_esm.getComputedStyle(element).direction === 'rtl';
|
|
2312
1438
|
}
|
|
2313
1439
|
|
|
2314
1440
|
const platform = {
|
|
2315
1441
|
convertOffsetParentRelativeRectToViewportRelativeRect,
|
|
2316
|
-
getDocumentElement,
|
|
1442
|
+
getDocumentElement: index_esm.getDocumentElement,
|
|
2317
1443
|
getClippingRect,
|
|
2318
1444
|
getOffsetParent,
|
|
2319
1445
|
getElementRects,
|
|
2320
1446
|
getClientRects,
|
|
2321
1447
|
getDimensions,
|
|
2322
1448
|
getScale,
|
|
2323
|
-
isElement,
|
|
1449
|
+
isElement: index_esm.isElement,
|
|
2324
1450
|
isRTL
|
|
2325
1451
|
};
|
|
2326
1452
|
|
|
@@ -2332,7 +1458,7 @@ function rectsAreEqual(a, b) {
|
|
|
2332
1458
|
function observeMove(element, onMove) {
|
|
2333
1459
|
let io = null;
|
|
2334
1460
|
let timeoutId;
|
|
2335
|
-
const root = getDocumentElement(element);
|
|
1461
|
+
const root = index_esm.getDocumentElement(element);
|
|
2336
1462
|
function cleanup() {
|
|
2337
1463
|
var _io;
|
|
2338
1464
|
clearTimeout(timeoutId);
|
|
@@ -2360,14 +1486,14 @@ function observeMove(element, onMove) {
|
|
|
2360
1486
|
if (!width || !height) {
|
|
2361
1487
|
return;
|
|
2362
1488
|
}
|
|
2363
|
-
const insetTop = floor(top);
|
|
2364
|
-
const insetRight = floor(root.clientWidth - (left + width));
|
|
2365
|
-
const insetBottom = floor(root.clientHeight - (top + height));
|
|
2366
|
-
const insetLeft = floor(left);
|
|
1489
|
+
const insetTop = index_esm.floor(top);
|
|
1490
|
+
const insetRight = index_esm.floor(root.clientWidth - (left + width));
|
|
1491
|
+
const insetBottom = index_esm.floor(root.clientHeight - (top + height));
|
|
1492
|
+
const insetLeft = index_esm.floor(left);
|
|
2367
1493
|
const rootMargin = -insetTop + "px " + -insetRight + "px " + -insetBottom + "px " + -insetLeft + "px";
|
|
2368
1494
|
const options = {
|
|
2369
1495
|
rootMargin,
|
|
2370
|
-
threshold: max(0, min(1, threshold)) || 1
|
|
1496
|
+
threshold: index_esm.max(0, index_esm.min(1, threshold)) || 1
|
|
2371
1497
|
};
|
|
2372
1498
|
let isFirstUpdate = true;
|
|
2373
1499
|
function handleObserve(entries) {
|
|
@@ -2436,7 +1562,7 @@ function autoUpdate(reference, floating, update, options) {
|
|
|
2436
1562
|
animationFrame = false
|
|
2437
1563
|
} = options;
|
|
2438
1564
|
const referenceEl = unwrapElement(reference);
|
|
2439
|
-
const ancestors = ancestorScroll || ancestorResize ? [...(referenceEl ? getOverflowAncestors(referenceEl) : []), ...(floating ? getOverflowAncestors(floating) : [])] : [];
|
|
1565
|
+
const ancestors = ancestorScroll || ancestorResize ? [...(referenceEl ? index_esm.getOverflowAncestors(referenceEl) : []), ...(floating ? index_esm.getOverflowAncestors(floating) : [])] : [];
|
|
2440
1566
|
ancestors.forEach(ancestor => {
|
|
2441
1567
|
ancestorScroll && ancestor.addEventListener('scroll', update, {
|
|
2442
1568
|
passive: true
|
|
@@ -2967,34 +2093,10 @@ const arrow = (options, deps) => {
|
|
|
2967
2093
|
exports.arrow = arrow;
|
|
2968
2094
|
exports.autoPlacement = autoPlacement;
|
|
2969
2095
|
exports.autoUpdate = autoUpdate;
|
|
2970
|
-
exports.clamp = clamp;
|
|
2971
|
-
exports.evaluate = evaluate;
|
|
2972
2096
|
exports.flip = flip;
|
|
2973
|
-
exports.floor = floor;
|
|
2974
|
-
exports.focusable = focusable;
|
|
2975
|
-
exports.getAlignment = getAlignment;
|
|
2976
|
-
exports.getAlignmentAxis = getAlignmentAxis;
|
|
2977
|
-
exports.getAxisLength = getAxisLength;
|
|
2978
|
-
exports.getComputedStyle = getComputedStyle$1;
|
|
2979
|
-
exports.getNodeName = getNodeName;
|
|
2980
|
-
exports.getOverflowAncestors = getOverflowAncestors;
|
|
2981
|
-
exports.getPaddingObject = getPaddingObject;
|
|
2982
|
-
exports.getParentNode = getParentNode;
|
|
2983
|
-
exports.getSide = getSide;
|
|
2984
|
-
exports.getSideAxis = getSideAxis;
|
|
2985
|
-
exports.getWindow = getWindow;
|
|
2986
2097
|
exports.hide = hide;
|
|
2987
|
-
exports.isElement = isElement;
|
|
2988
|
-
exports.isHTMLElement = isHTMLElement;
|
|
2989
|
-
exports.isLastTraversableNode = isLastTraversableNode;
|
|
2990
|
-
exports.isNode = isNode;
|
|
2991
|
-
exports.isOverflowElement = isOverflowElement;
|
|
2992
|
-
exports.isShadowRoot = isShadowRoot;
|
|
2993
|
-
exports.isTabbable = isTabbable;
|
|
2994
|
-
exports.isWebKit = isWebKit;
|
|
2995
2098
|
exports.limitShift = limitShift;
|
|
2996
2099
|
exports.offset = offset;
|
|
2997
2100
|
exports.shift = shift;
|
|
2998
2101
|
exports.size = size;
|
|
2999
|
-
exports.tabbable = tabbable;
|
|
3000
2102
|
exports.useFloating = useFloating;
|