@react-hive/honey-layout 12.0.0 → 13.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/HoneyFlex/HoneyFlex.d.ts +1 -1
- package/dist/components/HoneyGrid/HoneyGridStyled.d.ts +1 -1
- package/dist/components/HoneyGridColumn/HoneyGridColumn.types.d.ts +1 -1
- package/dist/components/HoneyGridColumn/HoneyGridColumnStyled.d.ts +12 -3
- package/dist/components/HoneyLayerRegistry/HoneyLayerRegistry.d.ts +18 -0
- package/dist/components/HoneyLayerRegistry/HoneyLayerRegistry.types.d.ts +27 -0
- package/dist/components/HoneyLayerRegistry/HoneyLayerRegistryContext.d.ts +43 -0
- package/dist/components/HoneyLayerRegistry/hooks/index.d.ts +1 -0
- package/dist/components/HoneyLayerRegistry/hooks/use-honey-layer-registry-context.d.ts +9 -0
- package/dist/components/HoneyLayerRegistry/index.d.ts +3 -0
- package/dist/components/HoneyPopup/HoneyPopupContent.d.ts +1 -2
- package/dist/components/HoneyPopup/hooks/use-honey-popup-context.d.ts +1 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/contexts/HoneyLayoutContext.d.ts +1 -1
- package/dist/hooks/use-register-honey-overlay.d.ts +2 -2
- package/dist/index.cjs +16 -16
- package/dist/index.cjs.map +1 -1
- package/dist/index.dev.cjs +1415 -1425
- package/dist/index.dev.cjs.map +1 -1
- package/dist/index.mjs +16 -16
- package/dist/index.mjs.map +1 -1
- package/dist/providers/HoneyLayoutProvider.d.ts +1 -1
- package/dist/providers/hooks/use-honey-overlays.d.ts +2 -2
- package/dist/types/data.types.d.ts +1 -33
- package/dist/types/utility.types.d.ts +0 -67
- package/dist/utils/index.d.ts +0 -1
- package/package.json +2 -2
- package/dist/utils/data-utils.d.ts +0 -91
package/dist/index.dev.cjs
CHANGED
|
@@ -83,6 +83,71 @@ function computeCoordsFromPlacement(_ref, placement, rtl) {
|
|
|
83
83
|
return coords;
|
|
84
84
|
}
|
|
85
85
|
|
|
86
|
+
/**
|
|
87
|
+
* Resolves with an object of overflow side offsets that determine how much the
|
|
88
|
+
* element is overflowing a given clipping boundary on each side.
|
|
89
|
+
* - positive = overflowing the boundary by that number of pixels
|
|
90
|
+
* - negative = how many pixels left before it will overflow
|
|
91
|
+
* - 0 = lies flush with the boundary
|
|
92
|
+
* @see https://floating-ui.com/docs/detectOverflow
|
|
93
|
+
*/
|
|
94
|
+
async function detectOverflow(state, options) {
|
|
95
|
+
var _await$platform$isEle;
|
|
96
|
+
if (options === void 0) {
|
|
97
|
+
options = {};
|
|
98
|
+
}
|
|
99
|
+
const {
|
|
100
|
+
x,
|
|
101
|
+
y,
|
|
102
|
+
platform,
|
|
103
|
+
rects,
|
|
104
|
+
elements,
|
|
105
|
+
strategy
|
|
106
|
+
} = state;
|
|
107
|
+
const {
|
|
108
|
+
boundary = 'clippingAncestors',
|
|
109
|
+
rootBoundary = 'viewport',
|
|
110
|
+
elementContext = 'floating',
|
|
111
|
+
altBoundary = false,
|
|
112
|
+
padding = 0
|
|
113
|
+
} = (0,_floating_ui_utils__WEBPACK_IMPORTED_MODULE_0__.evaluate)(options, state);
|
|
114
|
+
const paddingObject = (0,_floating_ui_utils__WEBPACK_IMPORTED_MODULE_0__.getPaddingObject)(padding);
|
|
115
|
+
const altContext = elementContext === 'floating' ? 'reference' : 'floating';
|
|
116
|
+
const element = elements[altBoundary ? altContext : elementContext];
|
|
117
|
+
const clippingClientRect = (0,_floating_ui_utils__WEBPACK_IMPORTED_MODULE_0__.rectToClientRect)(await platform.getClippingRect({
|
|
118
|
+
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))),
|
|
119
|
+
boundary,
|
|
120
|
+
rootBoundary,
|
|
121
|
+
strategy
|
|
122
|
+
}));
|
|
123
|
+
const rect = elementContext === 'floating' ? {
|
|
124
|
+
x,
|
|
125
|
+
y,
|
|
126
|
+
width: rects.floating.width,
|
|
127
|
+
height: rects.floating.height
|
|
128
|
+
} : rects.reference;
|
|
129
|
+
const offsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating));
|
|
130
|
+
const offsetScale = (await (platform.isElement == null ? void 0 : platform.isElement(offsetParent))) ? (await (platform.getScale == null ? void 0 : platform.getScale(offsetParent))) || {
|
|
131
|
+
x: 1,
|
|
132
|
+
y: 1
|
|
133
|
+
} : {
|
|
134
|
+
x: 1,
|
|
135
|
+
y: 1
|
|
136
|
+
};
|
|
137
|
+
const elementClientRect = (0,_floating_ui_utils__WEBPACK_IMPORTED_MODULE_0__.rectToClientRect)(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
138
|
+
elements,
|
|
139
|
+
rect,
|
|
140
|
+
offsetParent,
|
|
141
|
+
strategy
|
|
142
|
+
}) : rect);
|
|
143
|
+
return {
|
|
144
|
+
top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,
|
|
145
|
+
bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,
|
|
146
|
+
left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,
|
|
147
|
+
right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
|
|
86
151
|
/**
|
|
87
152
|
* Computes the `x` and `y` coordinates that will place the floating element
|
|
88
153
|
* next to a given reference element.
|
|
@@ -112,6 +177,7 @@ const computePosition = async (reference, floating, config) => {
|
|
|
112
177
|
let middlewareData = {};
|
|
113
178
|
let resetCount = 0;
|
|
114
179
|
for (let i = 0; i < validMiddleware.length; i++) {
|
|
180
|
+
var _platform$detectOverf;
|
|
115
181
|
const {
|
|
116
182
|
name,
|
|
117
183
|
fn
|
|
@@ -129,7 +195,10 @@ const computePosition = async (reference, floating, config) => {
|
|
|
129
195
|
strategy,
|
|
130
196
|
middlewareData,
|
|
131
197
|
rects,
|
|
132
|
-
platform
|
|
198
|
+
platform: {
|
|
199
|
+
...platform,
|
|
200
|
+
detectOverflow: (_platform$detectOverf = platform.detectOverflow) != null ? _platform$detectOverf : detectOverflow
|
|
201
|
+
},
|
|
133
202
|
elements: {
|
|
134
203
|
reference,
|
|
135
204
|
floating
|
|
@@ -174,71 +243,6 @@ const computePosition = async (reference, floating, config) => {
|
|
|
174
243
|
};
|
|
175
244
|
};
|
|
176
245
|
|
|
177
|
-
/**
|
|
178
|
-
* Resolves with an object of overflow side offsets that determine how much the
|
|
179
|
-
* element is overflowing a given clipping boundary on each side.
|
|
180
|
-
* - positive = overflowing the boundary by that number of pixels
|
|
181
|
-
* - negative = how many pixels left before it will overflow
|
|
182
|
-
* - 0 = lies flush with the boundary
|
|
183
|
-
* @see https://floating-ui.com/docs/detectOverflow
|
|
184
|
-
*/
|
|
185
|
-
async function detectOverflow(state, options) {
|
|
186
|
-
var _await$platform$isEle;
|
|
187
|
-
if (options === void 0) {
|
|
188
|
-
options = {};
|
|
189
|
-
}
|
|
190
|
-
const {
|
|
191
|
-
x,
|
|
192
|
-
y,
|
|
193
|
-
platform,
|
|
194
|
-
rects,
|
|
195
|
-
elements,
|
|
196
|
-
strategy
|
|
197
|
-
} = state;
|
|
198
|
-
const {
|
|
199
|
-
boundary = 'clippingAncestors',
|
|
200
|
-
rootBoundary = 'viewport',
|
|
201
|
-
elementContext = 'floating',
|
|
202
|
-
altBoundary = false,
|
|
203
|
-
padding = 0
|
|
204
|
-
} = (0,_floating_ui_utils__WEBPACK_IMPORTED_MODULE_0__.evaluate)(options, state);
|
|
205
|
-
const paddingObject = (0,_floating_ui_utils__WEBPACK_IMPORTED_MODULE_0__.getPaddingObject)(padding);
|
|
206
|
-
const altContext = elementContext === 'floating' ? 'reference' : 'floating';
|
|
207
|
-
const element = elements[altBoundary ? altContext : elementContext];
|
|
208
|
-
const clippingClientRect = (0,_floating_ui_utils__WEBPACK_IMPORTED_MODULE_0__.rectToClientRect)(await platform.getClippingRect({
|
|
209
|
-
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))),
|
|
210
|
-
boundary,
|
|
211
|
-
rootBoundary,
|
|
212
|
-
strategy
|
|
213
|
-
}));
|
|
214
|
-
const rect = elementContext === 'floating' ? {
|
|
215
|
-
x,
|
|
216
|
-
y,
|
|
217
|
-
width: rects.floating.width,
|
|
218
|
-
height: rects.floating.height
|
|
219
|
-
} : rects.reference;
|
|
220
|
-
const offsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating));
|
|
221
|
-
const offsetScale = (await (platform.isElement == null ? void 0 : platform.isElement(offsetParent))) ? (await (platform.getScale == null ? void 0 : platform.getScale(offsetParent))) || {
|
|
222
|
-
x: 1,
|
|
223
|
-
y: 1
|
|
224
|
-
} : {
|
|
225
|
-
x: 1,
|
|
226
|
-
y: 1
|
|
227
|
-
};
|
|
228
|
-
const elementClientRect = (0,_floating_ui_utils__WEBPACK_IMPORTED_MODULE_0__.rectToClientRect)(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
229
|
-
elements,
|
|
230
|
-
rect,
|
|
231
|
-
offsetParent,
|
|
232
|
-
strategy
|
|
233
|
-
}) : rect);
|
|
234
|
-
return {
|
|
235
|
-
top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,
|
|
236
|
-
bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,
|
|
237
|
-
left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,
|
|
238
|
-
right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x
|
|
239
|
-
};
|
|
240
|
-
}
|
|
241
|
-
|
|
242
246
|
/**
|
|
243
247
|
* Provides data to position an inner element of the floating element so that it
|
|
244
248
|
* appears centered to the reference element.
|
|
@@ -360,7 +364,7 @@ const autoPlacement = function (options) {
|
|
|
360
364
|
...detectOverflowOptions
|
|
361
365
|
} = (0,_floating_ui_utils__WEBPACK_IMPORTED_MODULE_0__.evaluate)(options, state);
|
|
362
366
|
const placements$1 = alignment !== undefined || allowedPlacements === _floating_ui_utils__WEBPACK_IMPORTED_MODULE_0__.placements ? getPlacementList(alignment || null, autoAlignment, allowedPlacements) : allowedPlacements;
|
|
363
|
-
const overflow = await detectOverflow(state, detectOverflowOptions);
|
|
367
|
+
const overflow = await platform.detectOverflow(state, detectOverflowOptions);
|
|
364
368
|
const currentIndex = ((_middlewareData$autoP = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP.index) || 0;
|
|
365
369
|
const currentPlacement = placements$1[currentIndex];
|
|
366
370
|
if (currentPlacement == null) {
|
|
@@ -474,7 +478,7 @@ const flip = function (options) {
|
|
|
474
478
|
fallbackPlacements.push(...(0,_floating_ui_utils__WEBPACK_IMPORTED_MODULE_0__.getOppositeAxisPlacements)(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));
|
|
475
479
|
}
|
|
476
480
|
const placements = [initialPlacement, ...fallbackPlacements];
|
|
477
|
-
const overflow = await detectOverflow(state, detectOverflowOptions);
|
|
481
|
+
const overflow = await platform.detectOverflow(state, detectOverflowOptions);
|
|
478
482
|
const overflows = [];
|
|
479
483
|
let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];
|
|
480
484
|
if (checkMainAxis) {
|
|
@@ -581,7 +585,8 @@ const hide = function (options) {
|
|
|
581
585
|
options,
|
|
582
586
|
async fn(state) {
|
|
583
587
|
const {
|
|
584
|
-
rects
|
|
588
|
+
rects,
|
|
589
|
+
platform
|
|
585
590
|
} = state;
|
|
586
591
|
const {
|
|
587
592
|
strategy = 'referenceHidden',
|
|
@@ -590,7 +595,7 @@ const hide = function (options) {
|
|
|
590
595
|
switch (strategy) {
|
|
591
596
|
case 'referenceHidden':
|
|
592
597
|
{
|
|
593
|
-
const overflow = await detectOverflow(state, {
|
|
598
|
+
const overflow = await platform.detectOverflow(state, {
|
|
594
599
|
...detectOverflowOptions,
|
|
595
600
|
elementContext: 'reference'
|
|
596
601
|
});
|
|
@@ -604,7 +609,7 @@ const hide = function (options) {
|
|
|
604
609
|
}
|
|
605
610
|
case 'escaped':
|
|
606
611
|
{
|
|
607
|
-
const overflow = await detectOverflow(state, {
|
|
612
|
+
const overflow = await platform.detectOverflow(state, {
|
|
608
613
|
...detectOverflowOptions,
|
|
609
614
|
altBoundary: true
|
|
610
615
|
});
|
|
@@ -858,7 +863,8 @@ const shift = function (options) {
|
|
|
858
863
|
const {
|
|
859
864
|
x,
|
|
860
865
|
y,
|
|
861
|
-
placement
|
|
866
|
+
placement,
|
|
867
|
+
platform
|
|
862
868
|
} = state;
|
|
863
869
|
const {
|
|
864
870
|
mainAxis: checkMainAxis = true,
|
|
@@ -881,7 +887,7 @@ const shift = function (options) {
|
|
|
881
887
|
x,
|
|
882
888
|
y
|
|
883
889
|
};
|
|
884
|
-
const overflow = await detectOverflow(state, detectOverflowOptions);
|
|
890
|
+
const overflow = await platform.detectOverflow(state, detectOverflowOptions);
|
|
885
891
|
const crossAxis = (0,_floating_ui_utils__WEBPACK_IMPORTED_MODULE_0__.getSideAxis)((0,_floating_ui_utils__WEBPACK_IMPORTED_MODULE_0__.getSide)(placement));
|
|
886
892
|
const mainAxis = (0,_floating_ui_utils__WEBPACK_IMPORTED_MODULE_0__.getOppositeAxis)(crossAxis);
|
|
887
893
|
let mainAxisCoord = coords[mainAxis];
|
|
@@ -1013,7 +1019,7 @@ const size = function (options) {
|
|
|
1013
1019
|
apply = () => {},
|
|
1014
1020
|
...detectOverflowOptions
|
|
1015
1021
|
} = (0,_floating_ui_utils__WEBPACK_IMPORTED_MODULE_0__.evaluate)(options, state);
|
|
1016
|
-
const overflow = await detectOverflow(state, detectOverflowOptions);
|
|
1022
|
+
const overflow = await platform.detectOverflow(state, detectOverflowOptions);
|
|
1017
1023
|
const side = (0,_floating_ui_utils__WEBPACK_IMPORTED_MODULE_0__.getSide)(placement);
|
|
1018
1024
|
const alignment = (0,_floating_ui_utils__WEBPACK_IMPORTED_MODULE_0__.getAlignment)(placement);
|
|
1019
1025
|
const isYAxis = (0,_floating_ui_utils__WEBPACK_IMPORTED_MODULE_0__.getSideAxis)(placement) === 'y';
|
|
@@ -1077,10 +1083,10 @@ const size = function (options) {
|
|
|
1077
1083
|
|
|
1078
1084
|
/***/ },
|
|
1079
1085
|
|
|
1080
|
-
/***/ "./node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs"
|
|
1081
|
-
|
|
1082
|
-
!*** ./node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs ***!
|
|
1083
|
-
|
|
1086
|
+
/***/ "./node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.mjs"
|
|
1087
|
+
/*!****************************************************************************!*\
|
|
1088
|
+
!*** ./node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.mjs ***!
|
|
1089
|
+
\****************************************************************************/
|
|
1084
1090
|
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
1085
1091
|
|
|
1086
1092
|
"use strict";
|
|
@@ -1088,1107 +1094,1112 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
1088
1094
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1089
1095
|
/* harmony export */ arrow: () => (/* binding */ arrow),
|
|
1090
1096
|
/* harmony export */ autoPlacement: () => (/* binding */ autoPlacement),
|
|
1091
|
-
/* harmony export */ autoUpdate: () => (/*
|
|
1092
|
-
/* harmony export */ computePosition: () => (/*
|
|
1093
|
-
/* harmony export */ detectOverflow: () => (/*
|
|
1097
|
+
/* harmony export */ autoUpdate: () => (/* reexport safe */ _floating_ui_dom__WEBPACK_IMPORTED_MODULE_0__.autoUpdate),
|
|
1098
|
+
/* harmony export */ computePosition: () => (/* reexport safe */ _floating_ui_dom__WEBPACK_IMPORTED_MODULE_0__.computePosition),
|
|
1099
|
+
/* harmony export */ detectOverflow: () => (/* reexport safe */ _floating_ui_dom__WEBPACK_IMPORTED_MODULE_0__.detectOverflow),
|
|
1094
1100
|
/* harmony export */ flip: () => (/* binding */ flip),
|
|
1095
|
-
/* harmony export */ getOverflowAncestors: () => (/* reexport safe */
|
|
1101
|
+
/* harmony export */ getOverflowAncestors: () => (/* reexport safe */ _floating_ui_dom__WEBPACK_IMPORTED_MODULE_1__.getOverflowAncestors),
|
|
1096
1102
|
/* harmony export */ hide: () => (/* binding */ hide),
|
|
1097
1103
|
/* harmony export */ inline: () => (/* binding */ inline),
|
|
1098
1104
|
/* harmony export */ limitShift: () => (/* binding */ limitShift),
|
|
1099
1105
|
/* harmony export */ offset: () => (/* binding */ offset),
|
|
1100
|
-
/* harmony export */ platform: () => (/*
|
|
1106
|
+
/* harmony export */ platform: () => (/* reexport safe */ _floating_ui_dom__WEBPACK_IMPORTED_MODULE_0__.platform),
|
|
1101
1107
|
/* harmony export */ shift: () => (/* binding */ shift),
|
|
1102
|
-
/* harmony export */ size: () => (/* binding */ size)
|
|
1108
|
+
/* harmony export */ size: () => (/* binding */ size),
|
|
1109
|
+
/* harmony export */ useFloating: () => (/* binding */ useFloating)
|
|
1103
1110
|
/* harmony export */ });
|
|
1104
|
-
/* harmony import */ var
|
|
1105
|
-
/* harmony import */ var
|
|
1106
|
-
/* harmony import */ var
|
|
1107
|
-
|
|
1108
|
-
|
|
1111
|
+
/* harmony import */ var _floating_ui_dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @floating-ui/dom */ "./node_modules/@floating-ui/react-dom/node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs");
|
|
1112
|
+
/* harmony import */ var _floating_ui_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @floating-ui/dom */ "./node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs");
|
|
1113
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "react");
|
|
1114
|
+
/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react-dom */ "./node_modules/react-dom/index.js");
|
|
1109
1115
|
|
|
1110
1116
|
|
|
1111
1117
|
|
|
1112
|
-
function getCssDimensions(element) {
|
|
1113
|
-
const css = (0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_2__.getComputedStyle)(element);
|
|
1114
|
-
// In testing environments, the `width` and `height` properties are empty
|
|
1115
|
-
// strings for SVG elements, returning NaN. Fallback to `0` in this case.
|
|
1116
|
-
let width = parseFloat(css.width) || 0;
|
|
1117
|
-
let height = parseFloat(css.height) || 0;
|
|
1118
|
-
const hasOffset = (0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_2__.isHTMLElement)(element);
|
|
1119
|
-
const offsetWidth = hasOffset ? element.offsetWidth : width;
|
|
1120
|
-
const offsetHeight = hasOffset ? element.offsetHeight : height;
|
|
1121
|
-
const shouldFallback = (0,_floating_ui_core__WEBPACK_IMPORTED_MODULE_1__.round)(width) !== offsetWidth || (0,_floating_ui_core__WEBPACK_IMPORTED_MODULE_1__.round)(height) !== offsetHeight;
|
|
1122
|
-
if (shouldFallback) {
|
|
1123
|
-
width = offsetWidth;
|
|
1124
|
-
height = offsetHeight;
|
|
1125
|
-
}
|
|
1126
|
-
return {
|
|
1127
|
-
width,
|
|
1128
|
-
height,
|
|
1129
|
-
$: shouldFallback
|
|
1130
|
-
};
|
|
1131
|
-
}
|
|
1132
1118
|
|
|
1133
|
-
function unwrapElement(element) {
|
|
1134
|
-
return !(0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_2__.isElement)(element) ? element.contextElement : element;
|
|
1135
|
-
}
|
|
1136
1119
|
|
|
1137
|
-
function getScale(element) {
|
|
1138
|
-
const domElement = unwrapElement(element);
|
|
1139
|
-
if (!(0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_2__.isHTMLElement)(domElement)) {
|
|
1140
|
-
return (0,_floating_ui_core__WEBPACK_IMPORTED_MODULE_1__.createCoords)(1);
|
|
1141
|
-
}
|
|
1142
|
-
const rect = domElement.getBoundingClientRect();
|
|
1143
|
-
const {
|
|
1144
|
-
width,
|
|
1145
|
-
height,
|
|
1146
|
-
$
|
|
1147
|
-
} = getCssDimensions(domElement);
|
|
1148
|
-
let x = ($ ? (0,_floating_ui_core__WEBPACK_IMPORTED_MODULE_1__.round)(rect.width) : rect.width) / width;
|
|
1149
|
-
let y = ($ ? (0,_floating_ui_core__WEBPACK_IMPORTED_MODULE_1__.round)(rect.height) : rect.height) / height;
|
|
1150
1120
|
|
|
1151
|
-
|
|
1121
|
+
var isClient = typeof document !== 'undefined';
|
|
1152
1122
|
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
}
|
|
1156
|
-
if (!y || !Number.isFinite(y)) {
|
|
1157
|
-
y = 1;
|
|
1158
|
-
}
|
|
1159
|
-
return {
|
|
1160
|
-
x,
|
|
1161
|
-
y
|
|
1162
|
-
};
|
|
1163
|
-
}
|
|
1123
|
+
var noop = function noop() {};
|
|
1124
|
+
var index = isClient ? react__WEBPACK_IMPORTED_MODULE_2__.useLayoutEffect : noop;
|
|
1164
1125
|
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
if (
|
|
1169
|
-
return
|
|
1170
|
-
}
|
|
1171
|
-
return {
|
|
1172
|
-
x: win.visualViewport.offsetLeft,
|
|
1173
|
-
y: win.visualViewport.offsetTop
|
|
1174
|
-
};
|
|
1175
|
-
}
|
|
1176
|
-
function shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) {
|
|
1177
|
-
if (isFixed === void 0) {
|
|
1178
|
-
isFixed = false;
|
|
1126
|
+
// Fork of `fast-deep-equal` that only does the comparisons we need and compares
|
|
1127
|
+
// functions
|
|
1128
|
+
function deepEqual(a, b) {
|
|
1129
|
+
if (a === b) {
|
|
1130
|
+
return true;
|
|
1179
1131
|
}
|
|
1180
|
-
if (
|
|
1132
|
+
if (typeof a !== typeof b) {
|
|
1181
1133
|
return false;
|
|
1182
1134
|
}
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) {
|
|
1187
|
-
if (includeScale === void 0) {
|
|
1188
|
-
includeScale = false;
|
|
1189
|
-
}
|
|
1190
|
-
if (isFixedStrategy === void 0) {
|
|
1191
|
-
isFixedStrategy = false;
|
|
1192
|
-
}
|
|
1193
|
-
const clientRect = element.getBoundingClientRect();
|
|
1194
|
-
const domElement = unwrapElement(element);
|
|
1195
|
-
let scale = (0,_floating_ui_core__WEBPACK_IMPORTED_MODULE_1__.createCoords)(1);
|
|
1196
|
-
if (includeScale) {
|
|
1197
|
-
if (offsetParent) {
|
|
1198
|
-
if ((0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_2__.isElement)(offsetParent)) {
|
|
1199
|
-
scale = getScale(offsetParent);
|
|
1200
|
-
}
|
|
1201
|
-
} else {
|
|
1202
|
-
scale = getScale(element);
|
|
1203
|
-
}
|
|
1135
|
+
if (typeof a === 'function' && a.toString() === b.toString()) {
|
|
1136
|
+
return true;
|
|
1204
1137
|
}
|
|
1205
|
-
|
|
1206
|
-
let
|
|
1207
|
-
let
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
const css = (0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_2__.getComputedStyle)(currentIFrame);
|
|
1219
|
-
const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x;
|
|
1220
|
-
const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y;
|
|
1221
|
-
x *= iframeScale.x;
|
|
1222
|
-
y *= iframeScale.y;
|
|
1223
|
-
width *= iframeScale.x;
|
|
1224
|
-
height *= iframeScale.y;
|
|
1225
|
-
x += left;
|
|
1226
|
-
y += top;
|
|
1227
|
-
currentWin = (0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_2__.getWindow)(currentIFrame);
|
|
1228
|
-
currentIFrame = (0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_2__.getFrameElement)(currentWin);
|
|
1138
|
+
let length;
|
|
1139
|
+
let i;
|
|
1140
|
+
let keys;
|
|
1141
|
+
if (a && b && typeof a === 'object') {
|
|
1142
|
+
if (Array.isArray(a)) {
|
|
1143
|
+
length = a.length;
|
|
1144
|
+
if (length !== b.length) return false;
|
|
1145
|
+
for (i = length; i-- !== 0;) {
|
|
1146
|
+
if (!deepEqual(a[i], b[i])) {
|
|
1147
|
+
return false;
|
|
1148
|
+
}
|
|
1149
|
+
}
|
|
1150
|
+
return true;
|
|
1229
1151
|
}
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
x,
|
|
1235
|
-
y
|
|
1236
|
-
});
|
|
1237
|
-
}
|
|
1238
|
-
|
|
1239
|
-
// If <html> has a CSS width greater than the viewport, then this will be
|
|
1240
|
-
// incorrect for RTL.
|
|
1241
|
-
function getWindowScrollBarX(element, rect) {
|
|
1242
|
-
const leftScroll = (0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_2__.getNodeScroll)(element).scrollLeft;
|
|
1243
|
-
if (!rect) {
|
|
1244
|
-
return getBoundingClientRect((0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_2__.getDocumentElement)(element)).left + leftScroll;
|
|
1245
|
-
}
|
|
1246
|
-
return rect.left + leftScroll;
|
|
1247
|
-
}
|
|
1248
|
-
|
|
1249
|
-
function getHTMLOffset(documentElement, scroll) {
|
|
1250
|
-
const htmlRect = documentElement.getBoundingClientRect();
|
|
1251
|
-
const x = htmlRect.left + scroll.scrollLeft - getWindowScrollBarX(documentElement, htmlRect);
|
|
1252
|
-
const y = htmlRect.top + scroll.scrollTop;
|
|
1253
|
-
return {
|
|
1254
|
-
x,
|
|
1255
|
-
y
|
|
1256
|
-
};
|
|
1257
|
-
}
|
|
1258
|
-
|
|
1259
|
-
function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
|
|
1260
|
-
let {
|
|
1261
|
-
elements,
|
|
1262
|
-
rect,
|
|
1263
|
-
offsetParent,
|
|
1264
|
-
strategy
|
|
1265
|
-
} = _ref;
|
|
1266
|
-
const isFixed = strategy === 'fixed';
|
|
1267
|
-
const documentElement = (0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_2__.getDocumentElement)(offsetParent);
|
|
1268
|
-
const topLayer = elements ? (0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_2__.isTopLayer)(elements.floating) : false;
|
|
1269
|
-
if (offsetParent === documentElement || topLayer && isFixed) {
|
|
1270
|
-
return rect;
|
|
1271
|
-
}
|
|
1272
|
-
let scroll = {
|
|
1273
|
-
scrollLeft: 0,
|
|
1274
|
-
scrollTop: 0
|
|
1275
|
-
};
|
|
1276
|
-
let scale = (0,_floating_ui_core__WEBPACK_IMPORTED_MODULE_1__.createCoords)(1);
|
|
1277
|
-
const offsets = (0,_floating_ui_core__WEBPACK_IMPORTED_MODULE_1__.createCoords)(0);
|
|
1278
|
-
const isOffsetParentAnElement = (0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_2__.isHTMLElement)(offsetParent);
|
|
1279
|
-
if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
|
|
1280
|
-
if ((0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_2__.getNodeName)(offsetParent) !== 'body' || (0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_2__.isOverflowElement)(documentElement)) {
|
|
1281
|
-
scroll = (0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_2__.getNodeScroll)(offsetParent);
|
|
1152
|
+
keys = Object.keys(a);
|
|
1153
|
+
length = keys.length;
|
|
1154
|
+
if (length !== Object.keys(b).length) {
|
|
1155
|
+
return false;
|
|
1282
1156
|
}
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1157
|
+
for (i = length; i-- !== 0;) {
|
|
1158
|
+
if (!{}.hasOwnProperty.call(b, keys[i])) {
|
|
1159
|
+
return false;
|
|
1160
|
+
}
|
|
1161
|
+
}
|
|
1162
|
+
for (i = length; i-- !== 0;) {
|
|
1163
|
+
const key = keys[i];
|
|
1164
|
+
if (key === '_owner' && a.$$typeof) {
|
|
1165
|
+
continue;
|
|
1166
|
+
}
|
|
1167
|
+
if (!deepEqual(a[key], b[key])) {
|
|
1168
|
+
return false;
|
|
1169
|
+
}
|
|
1288
1170
|
}
|
|
1171
|
+
return true;
|
|
1289
1172
|
}
|
|
1290
|
-
|
|
1291
|
-
return {
|
|
1292
|
-
width: rect.width * scale.x,
|
|
1293
|
-
height: rect.height * scale.y,
|
|
1294
|
-
x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x + htmlOffset.x,
|
|
1295
|
-
y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y + htmlOffset.y
|
|
1296
|
-
};
|
|
1297
|
-
}
|
|
1298
|
-
|
|
1299
|
-
function getClientRects(element) {
|
|
1300
|
-
return Array.from(element.getClientRects());
|
|
1173
|
+
return a !== a && b !== b;
|
|
1301
1174
|
}
|
|
1302
1175
|
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
const html = (0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_2__.getDocumentElement)(element);
|
|
1307
|
-
const scroll = (0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_2__.getNodeScroll)(element);
|
|
1308
|
-
const body = element.ownerDocument.body;
|
|
1309
|
-
const width = (0,_floating_ui_core__WEBPACK_IMPORTED_MODULE_1__.max)(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth);
|
|
1310
|
-
const height = (0,_floating_ui_core__WEBPACK_IMPORTED_MODULE_1__.max)(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight);
|
|
1311
|
-
let x = -scroll.scrollLeft + getWindowScrollBarX(element);
|
|
1312
|
-
const y = -scroll.scrollTop;
|
|
1313
|
-
if ((0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_2__.getComputedStyle)(body).direction === 'rtl') {
|
|
1314
|
-
x += (0,_floating_ui_core__WEBPACK_IMPORTED_MODULE_1__.max)(html.clientWidth, body.clientWidth) - width;
|
|
1176
|
+
function getDPR(element) {
|
|
1177
|
+
if (typeof window === 'undefined') {
|
|
1178
|
+
return 1;
|
|
1315
1179
|
}
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
height,
|
|
1319
|
-
x,
|
|
1320
|
-
y
|
|
1321
|
-
};
|
|
1180
|
+
const win = element.ownerDocument.defaultView || window;
|
|
1181
|
+
return win.devicePixelRatio || 1;
|
|
1322
1182
|
}
|
|
1323
1183
|
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
const SCROLLBAR_MAX = 25;
|
|
1328
|
-
function getViewportRect(element, strategy) {
|
|
1329
|
-
const win = (0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_2__.getWindow)(element);
|
|
1330
|
-
const html = (0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_2__.getDocumentElement)(element);
|
|
1331
|
-
const visualViewport = win.visualViewport;
|
|
1332
|
-
let width = html.clientWidth;
|
|
1333
|
-
let height = html.clientHeight;
|
|
1334
|
-
let x = 0;
|
|
1335
|
-
let y = 0;
|
|
1336
|
-
if (visualViewport) {
|
|
1337
|
-
width = visualViewport.width;
|
|
1338
|
-
height = visualViewport.height;
|
|
1339
|
-
const visualViewportBased = (0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_2__.isWebKit)();
|
|
1340
|
-
if (!visualViewportBased || visualViewportBased && strategy === 'fixed') {
|
|
1341
|
-
x = visualViewport.offsetLeft;
|
|
1342
|
-
y = visualViewport.offsetTop;
|
|
1343
|
-
}
|
|
1344
|
-
}
|
|
1345
|
-
const windowScrollbarX = getWindowScrollBarX(html);
|
|
1346
|
-
// <html> `overflow: hidden` + `scrollbar-gutter: stable` reduces the
|
|
1347
|
-
// visual width of the <html> but this is not considered in the size
|
|
1348
|
-
// of `html.clientWidth`.
|
|
1349
|
-
if (windowScrollbarX <= 0) {
|
|
1350
|
-
const doc = html.ownerDocument;
|
|
1351
|
-
const body = doc.body;
|
|
1352
|
-
const bodyStyles = getComputedStyle(body);
|
|
1353
|
-
const bodyMarginInline = doc.compatMode === 'CSS1Compat' ? parseFloat(bodyStyles.marginLeft) + parseFloat(bodyStyles.marginRight) || 0 : 0;
|
|
1354
|
-
const clippingStableScrollbarWidth = Math.abs(html.clientWidth - body.clientWidth - bodyMarginInline);
|
|
1355
|
-
if (clippingStableScrollbarWidth <= SCROLLBAR_MAX) {
|
|
1356
|
-
width -= clippingStableScrollbarWidth;
|
|
1357
|
-
}
|
|
1358
|
-
} else if (windowScrollbarX <= SCROLLBAR_MAX) {
|
|
1359
|
-
// If the <body> scrollbar is on the left, the width needs to be extended
|
|
1360
|
-
// by the scrollbar amount so there isn't extra space on the right.
|
|
1361
|
-
width += windowScrollbarX;
|
|
1362
|
-
}
|
|
1363
|
-
return {
|
|
1364
|
-
width,
|
|
1365
|
-
height,
|
|
1366
|
-
x,
|
|
1367
|
-
y
|
|
1368
|
-
};
|
|
1184
|
+
function roundByDPR(element, value) {
|
|
1185
|
+
const dpr = getDPR(element);
|
|
1186
|
+
return Math.round(value * dpr) / dpr;
|
|
1369
1187
|
}
|
|
1370
1188
|
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
const scale = (0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_2__.isHTMLElement)(element) ? getScale(element) : (0,_floating_ui_core__WEBPACK_IMPORTED_MODULE_1__.createCoords)(1);
|
|
1378
|
-
const width = element.clientWidth * scale.x;
|
|
1379
|
-
const height = element.clientHeight * scale.y;
|
|
1380
|
-
const x = left * scale.x;
|
|
1381
|
-
const y = top * scale.y;
|
|
1382
|
-
return {
|
|
1383
|
-
width,
|
|
1384
|
-
height,
|
|
1385
|
-
x,
|
|
1386
|
-
y
|
|
1387
|
-
};
|
|
1388
|
-
}
|
|
1389
|
-
function getClientRectFromClippingAncestor(element, clippingAncestor, strategy) {
|
|
1390
|
-
let rect;
|
|
1391
|
-
if (clippingAncestor === 'viewport') {
|
|
1392
|
-
rect = getViewportRect(element, strategy);
|
|
1393
|
-
} else if (clippingAncestor === 'document') {
|
|
1394
|
-
rect = getDocumentRect((0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_2__.getDocumentElement)(element));
|
|
1395
|
-
} else if ((0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_2__.isElement)(clippingAncestor)) {
|
|
1396
|
-
rect = getInnerBoundingClientRect(clippingAncestor, strategy);
|
|
1397
|
-
} else {
|
|
1398
|
-
const visualOffsets = getVisualOffsets(element);
|
|
1399
|
-
rect = {
|
|
1400
|
-
x: clippingAncestor.x - visualOffsets.x,
|
|
1401
|
-
y: clippingAncestor.y - visualOffsets.y,
|
|
1402
|
-
width: clippingAncestor.width,
|
|
1403
|
-
height: clippingAncestor.height
|
|
1404
|
-
};
|
|
1405
|
-
}
|
|
1406
|
-
return (0,_floating_ui_core__WEBPACK_IMPORTED_MODULE_1__.rectToClientRect)(rect);
|
|
1407
|
-
}
|
|
1408
|
-
function hasFixedPositionAncestor(element, stopNode) {
|
|
1409
|
-
const parentNode = (0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_2__.getParentNode)(element);
|
|
1410
|
-
if (parentNode === stopNode || !(0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_2__.isElement)(parentNode) || (0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_2__.isLastTraversableNode)(parentNode)) {
|
|
1411
|
-
return false;
|
|
1412
|
-
}
|
|
1413
|
-
return (0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_2__.getComputedStyle)(parentNode).position === 'fixed' || hasFixedPositionAncestor(parentNode, stopNode);
|
|
1189
|
+
function useLatestRef(value) {
|
|
1190
|
+
const ref = react__WEBPACK_IMPORTED_MODULE_2__.useRef(value);
|
|
1191
|
+
index(() => {
|
|
1192
|
+
ref.current = value;
|
|
1193
|
+
});
|
|
1194
|
+
return ref;
|
|
1414
1195
|
}
|
|
1415
1196
|
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
if (
|
|
1422
|
-
|
|
1197
|
+
/**
|
|
1198
|
+
* Provides data to position a floating element.
|
|
1199
|
+
* @see https://floating-ui.com/docs/useFloating
|
|
1200
|
+
*/
|
|
1201
|
+
function useFloating(options) {
|
|
1202
|
+
if (options === void 0) {
|
|
1203
|
+
options = {};
|
|
1423
1204
|
}
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1205
|
+
const {
|
|
1206
|
+
placement = 'bottom',
|
|
1207
|
+
strategy = 'absolute',
|
|
1208
|
+
middleware = [],
|
|
1209
|
+
platform,
|
|
1210
|
+
elements: {
|
|
1211
|
+
reference: externalReference,
|
|
1212
|
+
floating: externalFloating
|
|
1213
|
+
} = {},
|
|
1214
|
+
transform = true,
|
|
1215
|
+
whileElementsMounted,
|
|
1216
|
+
open
|
|
1217
|
+
} = options;
|
|
1218
|
+
const [data, setData] = react__WEBPACK_IMPORTED_MODULE_2__.useState({
|
|
1219
|
+
x: 0,
|
|
1220
|
+
y: 0,
|
|
1221
|
+
strategy,
|
|
1222
|
+
placement,
|
|
1223
|
+
middlewareData: {},
|
|
1224
|
+
isPositioned: false
|
|
1225
|
+
});
|
|
1226
|
+
const [latestMiddleware, setLatestMiddleware] = react__WEBPACK_IMPORTED_MODULE_2__.useState(middleware);
|
|
1227
|
+
if (!deepEqual(latestMiddleware, middleware)) {
|
|
1228
|
+
setLatestMiddleware(middleware);
|
|
1229
|
+
}
|
|
1230
|
+
const [_reference, _setReference] = react__WEBPACK_IMPORTED_MODULE_2__.useState(null);
|
|
1231
|
+
const [_floating, _setFloating] = react__WEBPACK_IMPORTED_MODULE_2__.useState(null);
|
|
1232
|
+
const setReference = react__WEBPACK_IMPORTED_MODULE_2__.useCallback(node => {
|
|
1233
|
+
if (node !== referenceRef.current) {
|
|
1234
|
+
referenceRef.current = node;
|
|
1235
|
+
_setReference(node);
|
|
1435
1236
|
}
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
// Record last containing block for next iteration.
|
|
1442
|
-
currentContainingBlockComputedStyle = computedStyle;
|
|
1237
|
+
}, []);
|
|
1238
|
+
const setFloating = react__WEBPACK_IMPORTED_MODULE_2__.useCallback(node => {
|
|
1239
|
+
if (node !== floatingRef.current) {
|
|
1240
|
+
floatingRef.current = node;
|
|
1241
|
+
_setFloating(node);
|
|
1443
1242
|
}
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1243
|
+
}, []);
|
|
1244
|
+
const referenceEl = externalReference || _reference;
|
|
1245
|
+
const floatingEl = externalFloating || _floating;
|
|
1246
|
+
const referenceRef = react__WEBPACK_IMPORTED_MODULE_2__.useRef(null);
|
|
1247
|
+
const floatingRef = react__WEBPACK_IMPORTED_MODULE_2__.useRef(null);
|
|
1248
|
+
const dataRef = react__WEBPACK_IMPORTED_MODULE_2__.useRef(data);
|
|
1249
|
+
const hasWhileElementsMounted = whileElementsMounted != null;
|
|
1250
|
+
const whileElementsMountedRef = useLatestRef(whileElementsMounted);
|
|
1251
|
+
const platformRef = useLatestRef(platform);
|
|
1252
|
+
const openRef = useLatestRef(open);
|
|
1253
|
+
const update = react__WEBPACK_IMPORTED_MODULE_2__.useCallback(() => {
|
|
1254
|
+
if (!referenceRef.current || !floatingRef.current) {
|
|
1255
|
+
return;
|
|
1256
|
+
}
|
|
1257
|
+
const config = {
|
|
1258
|
+
placement,
|
|
1259
|
+
strategy,
|
|
1260
|
+
middleware: latestMiddleware
|
|
1261
|
+
};
|
|
1262
|
+
if (platformRef.current) {
|
|
1263
|
+
config.platform = platformRef.current;
|
|
1264
|
+
}
|
|
1265
|
+
(0,_floating_ui_dom__WEBPACK_IMPORTED_MODULE_0__.computePosition)(referenceRef.current, floatingRef.current, config).then(data => {
|
|
1266
|
+
const fullData = {
|
|
1267
|
+
...data,
|
|
1268
|
+
// The floating element's position may be recomputed while it's closed
|
|
1269
|
+
// but still mounted (such as when transitioning out). To ensure
|
|
1270
|
+
// `isPositioned` will be `false` initially on the next open, avoid
|
|
1271
|
+
// setting it to `true` when `open === false` (must be specified).
|
|
1272
|
+
isPositioned: openRef.current !== false
|
|
1273
|
+
};
|
|
1274
|
+
if (isMountedRef.current && !deepEqual(dataRef.current, fullData)) {
|
|
1275
|
+
dataRef.current = fullData;
|
|
1276
|
+
react_dom__WEBPACK_IMPORTED_MODULE_3__.flushSync(() => {
|
|
1277
|
+
setData(fullData);
|
|
1278
|
+
});
|
|
1279
|
+
}
|
|
1280
|
+
});
|
|
1281
|
+
}, [latestMiddleware, placement, strategy, platformRef, openRef]);
|
|
1282
|
+
index(() => {
|
|
1283
|
+
if (open === false && dataRef.current.isPositioned) {
|
|
1284
|
+
dataRef.current.isPositioned = false;
|
|
1285
|
+
setData(data => ({
|
|
1286
|
+
...data,
|
|
1287
|
+
isPositioned: false
|
|
1288
|
+
}));
|
|
1289
|
+
}
|
|
1290
|
+
}, [open]);
|
|
1291
|
+
const isMountedRef = react__WEBPACK_IMPORTED_MODULE_2__.useRef(false);
|
|
1292
|
+
index(() => {
|
|
1293
|
+
isMountedRef.current = true;
|
|
1294
|
+
return () => {
|
|
1295
|
+
isMountedRef.current = false;
|
|
1296
|
+
};
|
|
1297
|
+
}, []);
|
|
1298
|
+
index(() => {
|
|
1299
|
+
if (referenceEl) referenceRef.current = referenceEl;
|
|
1300
|
+
if (floatingEl) floatingRef.current = floatingEl;
|
|
1301
|
+
if (referenceEl && floatingEl) {
|
|
1302
|
+
if (whileElementsMountedRef.current) {
|
|
1303
|
+
return whileElementsMountedRef.current(referenceEl, floatingEl, update);
|
|
1304
|
+
}
|
|
1305
|
+
update();
|
|
1306
|
+
}
|
|
1307
|
+
}, [referenceEl, floatingEl, update, whileElementsMountedRef, hasWhileElementsMounted]);
|
|
1308
|
+
const refs = react__WEBPACK_IMPORTED_MODULE_2__.useMemo(() => ({
|
|
1309
|
+
reference: referenceRef,
|
|
1310
|
+
floating: floatingRef,
|
|
1311
|
+
setReference,
|
|
1312
|
+
setFloating
|
|
1313
|
+
}), [setReference, setFloating]);
|
|
1314
|
+
const elements = react__WEBPACK_IMPORTED_MODULE_2__.useMemo(() => ({
|
|
1315
|
+
reference: referenceEl,
|
|
1316
|
+
floating: floatingEl
|
|
1317
|
+
}), [referenceEl, floatingEl]);
|
|
1318
|
+
const floatingStyles = react__WEBPACK_IMPORTED_MODULE_2__.useMemo(() => {
|
|
1319
|
+
const initialStyles = {
|
|
1320
|
+
position: strategy,
|
|
1321
|
+
left: 0,
|
|
1322
|
+
top: 0
|
|
1323
|
+
};
|
|
1324
|
+
if (!elements.floating) {
|
|
1325
|
+
return initialStyles;
|
|
1326
|
+
}
|
|
1327
|
+
const x = roundByDPR(elements.floating, data.x);
|
|
1328
|
+
const y = roundByDPR(elements.floating, data.y);
|
|
1329
|
+
if (transform) {
|
|
1330
|
+
return {
|
|
1331
|
+
...initialStyles,
|
|
1332
|
+
transform: "translate(" + x + "px, " + y + "px)",
|
|
1333
|
+
...(getDPR(elements.floating) >= 1.5 && {
|
|
1334
|
+
willChange: 'transform'
|
|
1335
|
+
})
|
|
1336
|
+
};
|
|
1337
|
+
}
|
|
1338
|
+
return {
|
|
1339
|
+
position: strategy,
|
|
1340
|
+
left: x,
|
|
1341
|
+
top: y
|
|
1342
|
+
};
|
|
1343
|
+
}, [strategy, transform, elements.floating, data.x, data.y]);
|
|
1344
|
+
return react__WEBPACK_IMPORTED_MODULE_2__.useMemo(() => ({
|
|
1345
|
+
...data,
|
|
1346
|
+
update,
|
|
1347
|
+
refs,
|
|
1348
|
+
elements,
|
|
1349
|
+
floatingStyles
|
|
1350
|
+
}), [data, update, refs, elements, floatingStyles]);
|
|
1448
1351
|
}
|
|
1449
1352
|
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
}
|
|
1353
|
+
/**
|
|
1354
|
+
* Provides data to position an inner element of the floating element so that it
|
|
1355
|
+
* appears centered to the reference element.
|
|
1356
|
+
* This wraps the core `arrow` middleware to allow React refs as the element.
|
|
1357
|
+
* @see https://floating-ui.com/docs/arrow
|
|
1358
|
+
*/
|
|
1359
|
+
const arrow$1 = options => {
|
|
1360
|
+
function isRef(value) {
|
|
1361
|
+
return {}.hasOwnProperty.call(value, 'current');
|
|
1362
|
+
}
|
|
1363
|
+
return {
|
|
1364
|
+
name: 'arrow',
|
|
1365
|
+
options,
|
|
1366
|
+
fn(state) {
|
|
1367
|
+
const {
|
|
1368
|
+
element,
|
|
1369
|
+
padding
|
|
1370
|
+
} = typeof options === 'function' ? options(state) : options;
|
|
1371
|
+
if (element && isRef(element)) {
|
|
1372
|
+
if (element.current != null) {
|
|
1373
|
+
return (0,_floating_ui_dom__WEBPACK_IMPORTED_MODULE_0__.arrow)({
|
|
1374
|
+
element: element.current,
|
|
1375
|
+
padding
|
|
1376
|
+
}).fn(state);
|
|
1377
|
+
}
|
|
1378
|
+
return {};
|
|
1379
|
+
}
|
|
1380
|
+
if (element) {
|
|
1381
|
+
return (0,_floating_ui_dom__WEBPACK_IMPORTED_MODULE_0__.arrow)({
|
|
1382
|
+
element,
|
|
1383
|
+
padding
|
|
1384
|
+
}).fn(state);
|
|
1385
|
+
}
|
|
1386
|
+
return {};
|
|
1387
|
+
}
|
|
1388
|
+
};
|
|
1389
|
+
};
|
|
1390
|
+
|
|
1391
|
+
/**
|
|
1392
|
+
* Modifies the placement by translating the floating element along the
|
|
1393
|
+
* specified axes.
|
|
1394
|
+
* A number (shorthand for `mainAxis` or distance), or an axes configuration
|
|
1395
|
+
* object may be passed.
|
|
1396
|
+
* @see https://floating-ui.com/docs/offset
|
|
1397
|
+
*/
|
|
1398
|
+
const offset = (options, deps) => ({
|
|
1399
|
+
...(0,_floating_ui_dom__WEBPACK_IMPORTED_MODULE_0__.offset)(options),
|
|
1400
|
+
options: [options, deps]
|
|
1401
|
+
});
|
|
1402
|
+
|
|
1403
|
+
/**
|
|
1404
|
+
* Optimizes the visibility of the floating element by shifting it in order to
|
|
1405
|
+
* keep it in view when it will overflow the clipping boundary.
|
|
1406
|
+
* @see https://floating-ui.com/docs/shift
|
|
1407
|
+
*/
|
|
1408
|
+
const shift = (options, deps) => ({
|
|
1409
|
+
...(0,_floating_ui_dom__WEBPACK_IMPORTED_MODULE_0__.shift)(options),
|
|
1410
|
+
options: [options, deps]
|
|
1411
|
+
});
|
|
1412
|
+
|
|
1413
|
+
/**
|
|
1414
|
+
* Built-in `limiter` that will stop `shift()` at a certain point.
|
|
1415
|
+
*/
|
|
1416
|
+
const limitShift = (options, deps) => ({
|
|
1417
|
+
...(0,_floating_ui_dom__WEBPACK_IMPORTED_MODULE_0__.limitShift)(options),
|
|
1418
|
+
options: [options, deps]
|
|
1419
|
+
});
|
|
1420
|
+
|
|
1421
|
+
/**
|
|
1422
|
+
* Optimizes the visibility of the floating element by flipping the `placement`
|
|
1423
|
+
* in order to keep it in view when the preferred placement(s) will overflow the
|
|
1424
|
+
* clipping boundary. Alternative to `autoPlacement`.
|
|
1425
|
+
* @see https://floating-ui.com/docs/flip
|
|
1426
|
+
*/
|
|
1427
|
+
const flip = (options, deps) => ({
|
|
1428
|
+
...(0,_floating_ui_dom__WEBPACK_IMPORTED_MODULE_0__.flip)(options),
|
|
1429
|
+
options: [options, deps]
|
|
1430
|
+
});
|
|
1431
|
+
|
|
1432
|
+
/**
|
|
1433
|
+
* Provides data that allows you to change the size of the floating element —
|
|
1434
|
+
* for instance, prevent it from overflowing the clipping boundary or match the
|
|
1435
|
+
* width of the reference element.
|
|
1436
|
+
* @see https://floating-ui.com/docs/size
|
|
1437
|
+
*/
|
|
1438
|
+
const size = (options, deps) => ({
|
|
1439
|
+
...(0,_floating_ui_dom__WEBPACK_IMPORTED_MODULE_0__.size)(options),
|
|
1440
|
+
options: [options, deps]
|
|
1441
|
+
});
|
|
1442
|
+
|
|
1443
|
+
/**
|
|
1444
|
+
* Optimizes the visibility of the floating element by choosing the placement
|
|
1445
|
+
* that has the most space available automatically, without needing to specify a
|
|
1446
|
+
* preferred placement. Alternative to `flip`.
|
|
1447
|
+
* @see https://floating-ui.com/docs/autoPlacement
|
|
1448
|
+
*/
|
|
1449
|
+
const autoPlacement = (options, deps) => ({
|
|
1450
|
+
...(0,_floating_ui_dom__WEBPACK_IMPORTED_MODULE_0__.autoPlacement)(options),
|
|
1451
|
+
options: [options, deps]
|
|
1452
|
+
});
|
|
1453
|
+
|
|
1454
|
+
/**
|
|
1455
|
+
* Provides data to hide the floating element in applicable situations, such as
|
|
1456
|
+
* when it is not in the same clipping context as the reference element.
|
|
1457
|
+
* @see https://floating-ui.com/docs/hide
|
|
1458
|
+
*/
|
|
1459
|
+
const hide = (options, deps) => ({
|
|
1460
|
+
...(0,_floating_ui_dom__WEBPACK_IMPORTED_MODULE_0__.hide)(options),
|
|
1461
|
+
options: [options, deps]
|
|
1462
|
+
});
|
|
1463
|
+
|
|
1464
|
+
/**
|
|
1465
|
+
* Provides improved positioning for inline reference elements that can span
|
|
1466
|
+
* over multiple lines, such as hyperlinks or range selections.
|
|
1467
|
+
* @see https://floating-ui.com/docs/inline
|
|
1468
|
+
*/
|
|
1469
|
+
const inline = (options, deps) => ({
|
|
1470
|
+
...(0,_floating_ui_dom__WEBPACK_IMPORTED_MODULE_0__.inline)(options),
|
|
1471
|
+
options: [options, deps]
|
|
1472
|
+
});
|
|
1473
|
+
|
|
1474
|
+
/**
|
|
1475
|
+
* Provides data to position an inner element of the floating element so that it
|
|
1476
|
+
* appears centered to the reference element.
|
|
1477
|
+
* This wraps the core `arrow` middleware to allow React refs as the element.
|
|
1478
|
+
* @see https://floating-ui.com/docs/arrow
|
|
1479
|
+
*/
|
|
1480
|
+
const arrow = (options, deps) => ({
|
|
1481
|
+
...arrow$1(options),
|
|
1482
|
+
options: [options, deps]
|
|
1483
|
+
});
|
|
1484
|
+
|
|
1485
|
+
|
|
1486
|
+
|
|
1487
|
+
|
|
1488
|
+
/***/ },
|
|
1489
|
+
|
|
1490
|
+
/***/ "./node_modules/@floating-ui/react-dom/node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs"
|
|
1491
|
+
/*!****************************************************************************************************!*\
|
|
1492
|
+
!*** ./node_modules/@floating-ui/react-dom/node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs ***!
|
|
1493
|
+
\****************************************************************************************************/
|
|
1494
|
+
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
1495
|
+
|
|
1496
|
+
"use strict";
|
|
1497
|
+
__webpack_require__.r(__webpack_exports__);
|
|
1498
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1499
|
+
/* harmony export */ arrow: () => (/* binding */ arrow),
|
|
1500
|
+
/* harmony export */ autoPlacement: () => (/* binding */ autoPlacement),
|
|
1501
|
+
/* harmony export */ autoUpdate: () => (/* binding */ autoUpdate),
|
|
1502
|
+
/* harmony export */ computePosition: () => (/* binding */ computePosition),
|
|
1503
|
+
/* harmony export */ detectOverflow: () => (/* binding */ detectOverflow),
|
|
1504
|
+
/* harmony export */ flip: () => (/* binding */ flip),
|
|
1505
|
+
/* harmony export */ getOverflowAncestors: () => (/* reexport safe */ _floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_2__.getOverflowAncestors),
|
|
1506
|
+
/* harmony export */ hide: () => (/* binding */ hide),
|
|
1507
|
+
/* harmony export */ inline: () => (/* binding */ inline),
|
|
1508
|
+
/* harmony export */ limitShift: () => (/* binding */ limitShift),
|
|
1509
|
+
/* harmony export */ offset: () => (/* binding */ offset),
|
|
1510
|
+
/* harmony export */ platform: () => (/* binding */ platform),
|
|
1511
|
+
/* harmony export */ shift: () => (/* binding */ shift),
|
|
1512
|
+
/* harmony export */ size: () => (/* binding */ size)
|
|
1513
|
+
/* harmony export */ });
|
|
1514
|
+
/* harmony import */ var _floating_ui_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @floating-ui/core */ "./node_modules/@floating-ui/core/dist/floating-ui.core.mjs");
|
|
1515
|
+
/* harmony import */ var _floating_ui_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @floating-ui/utils */ "./node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs");
|
|
1516
|
+
/* harmony import */ var _floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @floating-ui/utils/dom */ "./node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs");
|
|
1517
|
+
|
|
1477
1518
|
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1519
|
+
|
|
1520
|
+
|
|
1521
|
+
|
|
1522
|
+
function getCssDimensions(element) {
|
|
1523
|
+
const css = (0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_2__.getComputedStyle)(element);
|
|
1524
|
+
// In testing environments, the `width` and `height` properties are empty
|
|
1525
|
+
// strings for SVG elements, returning NaN. Fallback to `0` in this case.
|
|
1526
|
+
let width = parseFloat(css.width) || 0;
|
|
1527
|
+
let height = parseFloat(css.height) || 0;
|
|
1528
|
+
const hasOffset = (0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_2__.isHTMLElement)(element);
|
|
1529
|
+
const offsetWidth = hasOffset ? element.offsetWidth : width;
|
|
1530
|
+
const offsetHeight = hasOffset ? element.offsetHeight : height;
|
|
1531
|
+
const shouldFallback = (0,_floating_ui_core__WEBPACK_IMPORTED_MODULE_1__.round)(width) !== offsetWidth || (0,_floating_ui_core__WEBPACK_IMPORTED_MODULE_1__.round)(height) !== offsetHeight;
|
|
1532
|
+
if (shouldFallback) {
|
|
1533
|
+
width = offsetWidth;
|
|
1534
|
+
height = offsetHeight;
|
|
1535
|
+
}
|
|
1483
1536
|
return {
|
|
1484
1537
|
width,
|
|
1485
|
-
height
|
|
1538
|
+
height,
|
|
1539
|
+
$: shouldFallback
|
|
1486
1540
|
};
|
|
1487
1541
|
}
|
|
1488
1542
|
|
|
1489
|
-
function
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
const isFixed = strategy === 'fixed';
|
|
1493
|
-
const rect = getBoundingClientRect(element, true, isFixed, offsetParent);
|
|
1494
|
-
let scroll = {
|
|
1495
|
-
scrollLeft: 0,
|
|
1496
|
-
scrollTop: 0
|
|
1497
|
-
};
|
|
1498
|
-
const offsets = (0,_floating_ui_core__WEBPACK_IMPORTED_MODULE_1__.createCoords)(0);
|
|
1543
|
+
function unwrapElement(element) {
|
|
1544
|
+
return !(0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_2__.isElement)(element) ? element.contextElement : element;
|
|
1545
|
+
}
|
|
1499
1546
|
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1547
|
+
function getScale(element) {
|
|
1548
|
+
const domElement = unwrapElement(element);
|
|
1549
|
+
if (!(0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_2__.isHTMLElement)(domElement)) {
|
|
1550
|
+
return (0,_floating_ui_core__WEBPACK_IMPORTED_MODULE_1__.createCoords)(1);
|
|
1504
1551
|
}
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1552
|
+
const rect = domElement.getBoundingClientRect();
|
|
1553
|
+
const {
|
|
1554
|
+
width,
|
|
1555
|
+
height,
|
|
1556
|
+
$
|
|
1557
|
+
} = getCssDimensions(domElement);
|
|
1558
|
+
let x = ($ ? (0,_floating_ui_core__WEBPACK_IMPORTED_MODULE_1__.round)(rect.width) : rect.width) / width;
|
|
1559
|
+
let y = ($ ? (0,_floating_ui_core__WEBPACK_IMPORTED_MODULE_1__.round)(rect.height) : rect.height) / height;
|
|
1560
|
+
|
|
1561
|
+
// 0, NaN, or Infinity should always fallback to 1.
|
|
1562
|
+
|
|
1563
|
+
if (!x || !Number.isFinite(x)) {
|
|
1564
|
+
x = 1;
|
|
1516
1565
|
}
|
|
1517
|
-
if (
|
|
1518
|
-
|
|
1566
|
+
if (!y || !Number.isFinite(y)) {
|
|
1567
|
+
y = 1;
|
|
1519
1568
|
}
|
|
1520
|
-
const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : (0,_floating_ui_core__WEBPACK_IMPORTED_MODULE_1__.createCoords)(0);
|
|
1521
|
-
const x = rect.left + scroll.scrollLeft - offsets.x - htmlOffset.x;
|
|
1522
|
-
const y = rect.top + scroll.scrollTop - offsets.y - htmlOffset.y;
|
|
1523
1569
|
return {
|
|
1524
1570
|
x,
|
|
1525
|
-
y
|
|
1526
|
-
width: rect.width,
|
|
1527
|
-
height: rect.height
|
|
1571
|
+
y
|
|
1528
1572
|
};
|
|
1529
1573
|
}
|
|
1530
1574
|
|
|
1531
|
-
|
|
1532
|
-
|
|
1575
|
+
const noOffsets = /*#__PURE__*/(0,_floating_ui_core__WEBPACK_IMPORTED_MODULE_1__.createCoords)(0);
|
|
1576
|
+
function getVisualOffsets(element) {
|
|
1577
|
+
const win = (0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_2__.getWindow)(element);
|
|
1578
|
+
if (!(0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_2__.isWebKit)() || !win.visualViewport) {
|
|
1579
|
+
return noOffsets;
|
|
1580
|
+
}
|
|
1581
|
+
return {
|
|
1582
|
+
x: win.visualViewport.offsetLeft,
|
|
1583
|
+
y: win.visualViewport.offsetTop
|
|
1584
|
+
};
|
|
1585
|
+
}
|
|
1586
|
+
function shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) {
|
|
1587
|
+
if (isFixed === void 0) {
|
|
1588
|
+
isFixed = false;
|
|
1589
|
+
}
|
|
1590
|
+
if (!floatingOffsetParent || isFixed && floatingOffsetParent !== (0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_2__.getWindow)(element)) {
|
|
1591
|
+
return false;
|
|
1592
|
+
}
|
|
1593
|
+
return isFixed;
|
|
1533
1594
|
}
|
|
1534
1595
|
|
|
1535
|
-
function
|
|
1536
|
-
if (
|
|
1537
|
-
|
|
1596
|
+
function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) {
|
|
1597
|
+
if (includeScale === void 0) {
|
|
1598
|
+
includeScale = false;
|
|
1538
1599
|
}
|
|
1539
|
-
if (
|
|
1540
|
-
|
|
1600
|
+
if (isFixedStrategy === void 0) {
|
|
1601
|
+
isFixedStrategy = false;
|
|
1541
1602
|
}
|
|
1542
|
-
|
|
1603
|
+
const clientRect = element.getBoundingClientRect();
|
|
1604
|
+
const domElement = unwrapElement(element);
|
|
1605
|
+
let scale = (0,_floating_ui_core__WEBPACK_IMPORTED_MODULE_1__.createCoords)(1);
|
|
1606
|
+
if (includeScale) {
|
|
1607
|
+
if (offsetParent) {
|
|
1608
|
+
if ((0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_2__.isElement)(offsetParent)) {
|
|
1609
|
+
scale = getScale(offsetParent);
|
|
1610
|
+
}
|
|
1611
|
+
} else {
|
|
1612
|
+
scale = getScale(element);
|
|
1613
|
+
}
|
|
1614
|
+
}
|
|
1615
|
+
const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : (0,_floating_ui_core__WEBPACK_IMPORTED_MODULE_1__.createCoords)(0);
|
|
1616
|
+
let x = (clientRect.left + visualOffsets.x) / scale.x;
|
|
1617
|
+
let y = (clientRect.top + visualOffsets.y) / scale.y;
|
|
1618
|
+
let width = clientRect.width / scale.x;
|
|
1619
|
+
let height = clientRect.height / scale.y;
|
|
1620
|
+
if (domElement) {
|
|
1621
|
+
const win = (0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_2__.getWindow)(domElement);
|
|
1622
|
+
const offsetWin = offsetParent && (0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_2__.isElement)(offsetParent) ? (0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_2__.getWindow)(offsetParent) : offsetParent;
|
|
1623
|
+
let currentWin = win;
|
|
1624
|
+
let currentIFrame = (0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_2__.getFrameElement)(currentWin);
|
|
1625
|
+
while (currentIFrame && offsetParent && offsetWin !== currentWin) {
|
|
1626
|
+
const iframeScale = getScale(currentIFrame);
|
|
1627
|
+
const iframeRect = currentIFrame.getBoundingClientRect();
|
|
1628
|
+
const css = (0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_2__.getComputedStyle)(currentIFrame);
|
|
1629
|
+
const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x;
|
|
1630
|
+
const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y;
|
|
1631
|
+
x *= iframeScale.x;
|
|
1632
|
+
y *= iframeScale.y;
|
|
1633
|
+
width *= iframeScale.x;
|
|
1634
|
+
height *= iframeScale.y;
|
|
1635
|
+
x += left;
|
|
1636
|
+
y += top;
|
|
1637
|
+
currentWin = (0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_2__.getWindow)(currentIFrame);
|
|
1638
|
+
currentIFrame = (0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_2__.getFrameElement)(currentWin);
|
|
1639
|
+
}
|
|
1640
|
+
}
|
|
1641
|
+
return (0,_floating_ui_core__WEBPACK_IMPORTED_MODULE_1__.rectToClientRect)({
|
|
1642
|
+
width,
|
|
1643
|
+
height,
|
|
1644
|
+
x,
|
|
1645
|
+
y
|
|
1646
|
+
});
|
|
1647
|
+
}
|
|
1543
1648
|
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
if (
|
|
1549
|
-
|
|
1649
|
+
// If <html> has a CSS width greater than the viewport, then this will be
|
|
1650
|
+
// incorrect for RTL.
|
|
1651
|
+
function getWindowScrollBarX(element, rect) {
|
|
1652
|
+
const leftScroll = (0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_2__.getNodeScroll)(element).scrollLeft;
|
|
1653
|
+
if (!rect) {
|
|
1654
|
+
return getBoundingClientRect((0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_2__.getDocumentElement)(element)).left + leftScroll;
|
|
1550
1655
|
}
|
|
1551
|
-
return
|
|
1656
|
+
return rect.left + leftScroll;
|
|
1552
1657
|
}
|
|
1553
1658
|
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
const
|
|
1558
|
-
|
|
1559
|
-
|
|
1659
|
+
function getHTMLOffset(documentElement, scroll) {
|
|
1660
|
+
const htmlRect = documentElement.getBoundingClientRect();
|
|
1661
|
+
const x = htmlRect.left + scroll.scrollLeft - getWindowScrollBarX(documentElement, htmlRect);
|
|
1662
|
+
const y = htmlRect.top + scroll.scrollTop;
|
|
1663
|
+
return {
|
|
1664
|
+
x,
|
|
1665
|
+
y
|
|
1666
|
+
};
|
|
1667
|
+
}
|
|
1668
|
+
|
|
1669
|
+
function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
|
|
1670
|
+
let {
|
|
1671
|
+
elements,
|
|
1672
|
+
rect,
|
|
1673
|
+
offsetParent,
|
|
1674
|
+
strategy
|
|
1675
|
+
} = _ref;
|
|
1676
|
+
const isFixed = strategy === 'fixed';
|
|
1677
|
+
const documentElement = (0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_2__.getDocumentElement)(offsetParent);
|
|
1678
|
+
const topLayer = elements ? (0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_2__.isTopLayer)(elements.floating) : false;
|
|
1679
|
+
if (offsetParent === documentElement || topLayer && isFixed) {
|
|
1680
|
+
return rect;
|
|
1560
1681
|
}
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1682
|
+
let scroll = {
|
|
1683
|
+
scrollLeft: 0,
|
|
1684
|
+
scrollTop: 0
|
|
1685
|
+
};
|
|
1686
|
+
let scale = (0,_floating_ui_core__WEBPACK_IMPORTED_MODULE_1__.createCoords)(1);
|
|
1687
|
+
const offsets = (0,_floating_ui_core__WEBPACK_IMPORTED_MODULE_1__.createCoords)(0);
|
|
1688
|
+
const isOffsetParentAnElement = (0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_2__.isHTMLElement)(offsetParent);
|
|
1689
|
+
if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
|
|
1690
|
+
if ((0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_2__.getNodeName)(offsetParent) !== 'body' || (0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_2__.isOverflowElement)(documentElement)) {
|
|
1691
|
+
scroll = (0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_2__.getNodeScroll)(offsetParent);
|
|
1692
|
+
}
|
|
1693
|
+
if ((0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_2__.isHTMLElement)(offsetParent)) {
|
|
1694
|
+
const offsetRect = getBoundingClientRect(offsetParent);
|
|
1695
|
+
scale = getScale(offsetParent);
|
|
1696
|
+
offsets.x = offsetRect.x + offsetParent.clientLeft;
|
|
1697
|
+
offsets.y = offsetRect.y + offsetParent.clientTop;
|
|
1568
1698
|
}
|
|
1569
|
-
return win;
|
|
1570
|
-
}
|
|
1571
|
-
let offsetParent = getTrueOffsetParent(element, polyfill);
|
|
1572
|
-
while (offsetParent && (0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_2__.isTableElement)(offsetParent) && isStaticPositioned(offsetParent)) {
|
|
1573
|
-
offsetParent = getTrueOffsetParent(offsetParent, polyfill);
|
|
1574
|
-
}
|
|
1575
|
-
if (offsetParent && (0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_2__.isLastTraversableNode)(offsetParent) && isStaticPositioned(offsetParent) && !(0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_2__.isContainingBlock)(offsetParent)) {
|
|
1576
|
-
return win;
|
|
1577
1699
|
}
|
|
1578
|
-
|
|
1579
|
-
}
|
|
1580
|
-
|
|
1581
|
-
const getElementRects = async function (data) {
|
|
1582
|
-
const getOffsetParentFn = this.getOffsetParent || getOffsetParent;
|
|
1583
|
-
const getDimensionsFn = this.getDimensions;
|
|
1584
|
-
const floatingDimensions = await getDimensionsFn(data.floating);
|
|
1700
|
+
const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : (0,_floating_ui_core__WEBPACK_IMPORTED_MODULE_1__.createCoords)(0);
|
|
1585
1701
|
return {
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
width: floatingDimensions.width,
|
|
1591
|
-
height: floatingDimensions.height
|
|
1592
|
-
}
|
|
1702
|
+
width: rect.width * scale.x,
|
|
1703
|
+
height: rect.height * scale.y,
|
|
1704
|
+
x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x + htmlOffset.x,
|
|
1705
|
+
y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y + htmlOffset.y
|
|
1593
1706
|
};
|
|
1594
|
-
};
|
|
1595
|
-
|
|
1596
|
-
function isRTL(element) {
|
|
1597
|
-
return (0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_2__.getComputedStyle)(element).direction === 'rtl';
|
|
1598
1707
|
}
|
|
1599
1708
|
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
getDocumentElement: _floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_2__.getDocumentElement,
|
|
1603
|
-
getClippingRect,
|
|
1604
|
-
getOffsetParent,
|
|
1605
|
-
getElementRects,
|
|
1606
|
-
getClientRects,
|
|
1607
|
-
getDimensions,
|
|
1608
|
-
getScale,
|
|
1609
|
-
isElement: _floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_2__.isElement,
|
|
1610
|
-
isRTL
|
|
1611
|
-
};
|
|
1612
|
-
|
|
1613
|
-
function rectsAreEqual(a, b) {
|
|
1614
|
-
return a.x === b.x && a.y === b.y && a.width === b.width && a.height === b.height;
|
|
1709
|
+
function getClientRects(element) {
|
|
1710
|
+
return Array.from(element.getClientRects());
|
|
1615
1711
|
}
|
|
1616
1712
|
|
|
1617
|
-
//
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
const
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
if (skip === void 0) {
|
|
1630
|
-
skip = false;
|
|
1631
|
-
}
|
|
1632
|
-
if (threshold === void 0) {
|
|
1633
|
-
threshold = 1;
|
|
1634
|
-
}
|
|
1635
|
-
cleanup();
|
|
1636
|
-
const elementRectForRootMargin = element.getBoundingClientRect();
|
|
1637
|
-
const {
|
|
1638
|
-
left,
|
|
1639
|
-
top,
|
|
1640
|
-
width,
|
|
1641
|
-
height
|
|
1642
|
-
} = elementRectForRootMargin;
|
|
1643
|
-
if (!skip) {
|
|
1644
|
-
onMove();
|
|
1645
|
-
}
|
|
1646
|
-
if (!width || !height) {
|
|
1647
|
-
return;
|
|
1648
|
-
}
|
|
1649
|
-
const insetTop = (0,_floating_ui_core__WEBPACK_IMPORTED_MODULE_1__.floor)(top);
|
|
1650
|
-
const insetRight = (0,_floating_ui_core__WEBPACK_IMPORTED_MODULE_1__.floor)(root.clientWidth - (left + width));
|
|
1651
|
-
const insetBottom = (0,_floating_ui_core__WEBPACK_IMPORTED_MODULE_1__.floor)(root.clientHeight - (top + height));
|
|
1652
|
-
const insetLeft = (0,_floating_ui_core__WEBPACK_IMPORTED_MODULE_1__.floor)(left);
|
|
1653
|
-
const rootMargin = -insetTop + "px " + -insetRight + "px " + -insetBottom + "px " + -insetLeft + "px";
|
|
1654
|
-
const options = {
|
|
1655
|
-
rootMargin,
|
|
1656
|
-
threshold: (0,_floating_ui_core__WEBPACK_IMPORTED_MODULE_1__.max)(0, (0,_floating_ui_core__WEBPACK_IMPORTED_MODULE_1__.min)(1, threshold)) || 1
|
|
1657
|
-
};
|
|
1658
|
-
let isFirstUpdate = true;
|
|
1659
|
-
function handleObserve(entries) {
|
|
1660
|
-
const ratio = entries[0].intersectionRatio;
|
|
1661
|
-
if (ratio !== threshold) {
|
|
1662
|
-
if (!isFirstUpdate) {
|
|
1663
|
-
return refresh();
|
|
1664
|
-
}
|
|
1665
|
-
if (!ratio) {
|
|
1666
|
-
// If the reference is clipped, the ratio is 0. Throttle the refresh
|
|
1667
|
-
// to prevent an infinite loop of updates.
|
|
1668
|
-
timeoutId = setTimeout(() => {
|
|
1669
|
-
refresh(false, 1e-7);
|
|
1670
|
-
}, 1000);
|
|
1671
|
-
} else {
|
|
1672
|
-
refresh(false, ratio);
|
|
1673
|
-
}
|
|
1674
|
-
}
|
|
1675
|
-
if (ratio === 1 && !rectsAreEqual(elementRectForRootMargin, element.getBoundingClientRect())) {
|
|
1676
|
-
// It's possible that even though the ratio is reported as 1, the
|
|
1677
|
-
// element is not actually fully within the IntersectionObserver's root
|
|
1678
|
-
// area anymore. This can happen under performance constraints. This may
|
|
1679
|
-
// be a bug in the browser's IntersectionObserver implementation. To
|
|
1680
|
-
// work around this, we compare the element's bounding rect now with
|
|
1681
|
-
// what it was at the time we created the IntersectionObserver. If they
|
|
1682
|
-
// are not equal then the element moved, so we refresh.
|
|
1683
|
-
refresh();
|
|
1684
|
-
}
|
|
1685
|
-
isFirstUpdate = false;
|
|
1686
|
-
}
|
|
1687
|
-
|
|
1688
|
-
// Older browsers don't support a `document` as the root and will throw an
|
|
1689
|
-
// error.
|
|
1690
|
-
try {
|
|
1691
|
-
io = new IntersectionObserver(handleObserve, {
|
|
1692
|
-
...options,
|
|
1693
|
-
// Handle <iframe>s
|
|
1694
|
-
root: root.ownerDocument
|
|
1695
|
-
});
|
|
1696
|
-
} catch (_e) {
|
|
1697
|
-
io = new IntersectionObserver(handleObserve, options);
|
|
1698
|
-
}
|
|
1699
|
-
io.observe(element);
|
|
1713
|
+
// Gets the entire size of the scrollable document area, even extending outside
|
|
1714
|
+
// of the `<html>` and `<body>` rect bounds if horizontally scrollable.
|
|
1715
|
+
function getDocumentRect(element) {
|
|
1716
|
+
const html = (0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_2__.getDocumentElement)(element);
|
|
1717
|
+
const scroll = (0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_2__.getNodeScroll)(element);
|
|
1718
|
+
const body = element.ownerDocument.body;
|
|
1719
|
+
const width = (0,_floating_ui_core__WEBPACK_IMPORTED_MODULE_1__.max)(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth);
|
|
1720
|
+
const height = (0,_floating_ui_core__WEBPACK_IMPORTED_MODULE_1__.max)(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight);
|
|
1721
|
+
let x = -scroll.scrollLeft + getWindowScrollBarX(element);
|
|
1722
|
+
const y = -scroll.scrollTop;
|
|
1723
|
+
if ((0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_2__.getComputedStyle)(body).direction === 'rtl') {
|
|
1724
|
+
x += (0,_floating_ui_core__WEBPACK_IMPORTED_MODULE_1__.max)(html.clientWidth, body.clientWidth) - width;
|
|
1700
1725
|
}
|
|
1701
|
-
|
|
1702
|
-
|
|
1726
|
+
return {
|
|
1727
|
+
width,
|
|
1728
|
+
height,
|
|
1729
|
+
x,
|
|
1730
|
+
y
|
|
1731
|
+
};
|
|
1703
1732
|
}
|
|
1704
1733
|
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
const referenceEl = unwrapElement(reference);
|
|
1725
|
-
const ancestors = ancestorScroll || ancestorResize ? [...(referenceEl ? (0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_2__.getOverflowAncestors)(referenceEl) : []), ...(0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_2__.getOverflowAncestors)(floating)] : [];
|
|
1726
|
-
ancestors.forEach(ancestor => {
|
|
1727
|
-
ancestorScroll && ancestor.addEventListener('scroll', update, {
|
|
1728
|
-
passive: true
|
|
1729
|
-
});
|
|
1730
|
-
ancestorResize && ancestor.addEventListener('resize', update);
|
|
1731
|
-
});
|
|
1732
|
-
const cleanupIo = referenceEl && layoutShift ? observeMove(referenceEl, update) : null;
|
|
1733
|
-
let reobserveFrame = -1;
|
|
1734
|
-
let resizeObserver = null;
|
|
1735
|
-
if (elementResize) {
|
|
1736
|
-
resizeObserver = new ResizeObserver(_ref => {
|
|
1737
|
-
let [firstEntry] = _ref;
|
|
1738
|
-
if (firstEntry && firstEntry.target === referenceEl && resizeObserver) {
|
|
1739
|
-
// Prevent update loops when using the `size` middleware.
|
|
1740
|
-
// https://github.com/floating-ui/floating-ui/issues/1740
|
|
1741
|
-
resizeObserver.unobserve(floating);
|
|
1742
|
-
cancelAnimationFrame(reobserveFrame);
|
|
1743
|
-
reobserveFrame = requestAnimationFrame(() => {
|
|
1744
|
-
var _resizeObserver;
|
|
1745
|
-
(_resizeObserver = resizeObserver) == null || _resizeObserver.observe(floating);
|
|
1746
|
-
});
|
|
1747
|
-
}
|
|
1748
|
-
update();
|
|
1749
|
-
});
|
|
1750
|
-
if (referenceEl && !animationFrame) {
|
|
1751
|
-
resizeObserver.observe(referenceEl);
|
|
1752
|
-
}
|
|
1753
|
-
resizeObserver.observe(floating);
|
|
1754
|
-
}
|
|
1755
|
-
let frameId;
|
|
1756
|
-
let prevRefRect = animationFrame ? getBoundingClientRect(reference) : null;
|
|
1757
|
-
if (animationFrame) {
|
|
1758
|
-
frameLoop();
|
|
1759
|
-
}
|
|
1760
|
-
function frameLoop() {
|
|
1761
|
-
const nextRefRect = getBoundingClientRect(reference);
|
|
1762
|
-
if (prevRefRect && !rectsAreEqual(prevRefRect, nextRefRect)) {
|
|
1763
|
-
update();
|
|
1734
|
+
// Safety check: ensure the scrollbar space is reasonable in case this
|
|
1735
|
+
// calculation is affected by unusual styles.
|
|
1736
|
+
// Most scrollbars leave 15-18px of space.
|
|
1737
|
+
const SCROLLBAR_MAX = 25;
|
|
1738
|
+
function getViewportRect(element, strategy) {
|
|
1739
|
+
const win = (0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_2__.getWindow)(element);
|
|
1740
|
+
const html = (0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_2__.getDocumentElement)(element);
|
|
1741
|
+
const visualViewport = win.visualViewport;
|
|
1742
|
+
let width = html.clientWidth;
|
|
1743
|
+
let height = html.clientHeight;
|
|
1744
|
+
let x = 0;
|
|
1745
|
+
let y = 0;
|
|
1746
|
+
if (visualViewport) {
|
|
1747
|
+
width = visualViewport.width;
|
|
1748
|
+
height = visualViewport.height;
|
|
1749
|
+
const visualViewportBased = (0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_2__.isWebKit)();
|
|
1750
|
+
if (!visualViewportBased || visualViewportBased && strategy === 'fixed') {
|
|
1751
|
+
x = visualViewport.offsetLeft;
|
|
1752
|
+
y = visualViewport.offsetTop;
|
|
1764
1753
|
}
|
|
1765
|
-
prevRefRect = nextRefRect;
|
|
1766
|
-
frameId = requestAnimationFrame(frameLoop);
|
|
1767
1754
|
}
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
if (
|
|
1779
|
-
|
|
1755
|
+
const windowScrollbarX = getWindowScrollBarX(html);
|
|
1756
|
+
// <html> `overflow: hidden` + `scrollbar-gutter: stable` reduces the
|
|
1757
|
+
// visual width of the <html> but this is not considered in the size
|
|
1758
|
+
// of `html.clientWidth`.
|
|
1759
|
+
if (windowScrollbarX <= 0) {
|
|
1760
|
+
const doc = html.ownerDocument;
|
|
1761
|
+
const body = doc.body;
|
|
1762
|
+
const bodyStyles = getComputedStyle(body);
|
|
1763
|
+
const bodyMarginInline = doc.compatMode === 'CSS1Compat' ? parseFloat(bodyStyles.marginLeft) + parseFloat(bodyStyles.marginRight) || 0 : 0;
|
|
1764
|
+
const clippingStableScrollbarWidth = Math.abs(html.clientWidth - body.clientWidth - bodyMarginInline);
|
|
1765
|
+
if (clippingStableScrollbarWidth <= SCROLLBAR_MAX) {
|
|
1766
|
+
width -= clippingStableScrollbarWidth;
|
|
1780
1767
|
}
|
|
1768
|
+
} else if (windowScrollbarX <= SCROLLBAR_MAX) {
|
|
1769
|
+
// If the <body> scrollbar is on the left, the width needs to be extended
|
|
1770
|
+
// by the scrollbar amount so there isn't extra space on the right.
|
|
1771
|
+
width += windowScrollbarX;
|
|
1772
|
+
}
|
|
1773
|
+
return {
|
|
1774
|
+
width,
|
|
1775
|
+
height,
|
|
1776
|
+
x,
|
|
1777
|
+
y
|
|
1781
1778
|
};
|
|
1782
1779
|
}
|
|
1783
1780
|
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
const
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
* for instance, prevent it from overflowing the clipping boundary or match the
|
|
1829
|
-
* width of the reference element.
|
|
1830
|
-
* @see https://floating-ui.com/docs/size
|
|
1831
|
-
*/
|
|
1832
|
-
const size = _floating_ui_core__WEBPACK_IMPORTED_MODULE_0__.size;
|
|
1833
|
-
|
|
1834
|
-
/**
|
|
1835
|
-
* Provides data to hide the floating element in applicable situations, such as
|
|
1836
|
-
* when it is not in the same clipping context as the reference element.
|
|
1837
|
-
* @see https://floating-ui.com/docs/hide
|
|
1838
|
-
*/
|
|
1839
|
-
const hide = _floating_ui_core__WEBPACK_IMPORTED_MODULE_0__.hide;
|
|
1840
|
-
|
|
1841
|
-
/**
|
|
1842
|
-
* Provides data to position an inner element of the floating element so that it
|
|
1843
|
-
* appears centered to the reference element.
|
|
1844
|
-
* @see https://floating-ui.com/docs/arrow
|
|
1845
|
-
*/
|
|
1846
|
-
const arrow = _floating_ui_core__WEBPACK_IMPORTED_MODULE_0__.arrow;
|
|
1781
|
+
const absoluteOrFixed = /*#__PURE__*/new Set(['absolute', 'fixed']);
|
|
1782
|
+
// Returns the inner client rect, subtracting scrollbars if present.
|
|
1783
|
+
function getInnerBoundingClientRect(element, strategy) {
|
|
1784
|
+
const clientRect = getBoundingClientRect(element, true, strategy === 'fixed');
|
|
1785
|
+
const top = clientRect.top + element.clientTop;
|
|
1786
|
+
const left = clientRect.left + element.clientLeft;
|
|
1787
|
+
const scale = (0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_2__.isHTMLElement)(element) ? getScale(element) : (0,_floating_ui_core__WEBPACK_IMPORTED_MODULE_1__.createCoords)(1);
|
|
1788
|
+
const width = element.clientWidth * scale.x;
|
|
1789
|
+
const height = element.clientHeight * scale.y;
|
|
1790
|
+
const x = left * scale.x;
|
|
1791
|
+
const y = top * scale.y;
|
|
1792
|
+
return {
|
|
1793
|
+
width,
|
|
1794
|
+
height,
|
|
1795
|
+
x,
|
|
1796
|
+
y
|
|
1797
|
+
};
|
|
1798
|
+
}
|
|
1799
|
+
function getClientRectFromClippingAncestor(element, clippingAncestor, strategy) {
|
|
1800
|
+
let rect;
|
|
1801
|
+
if (clippingAncestor === 'viewport') {
|
|
1802
|
+
rect = getViewportRect(element, strategy);
|
|
1803
|
+
} else if (clippingAncestor === 'document') {
|
|
1804
|
+
rect = getDocumentRect((0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_2__.getDocumentElement)(element));
|
|
1805
|
+
} else if ((0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_2__.isElement)(clippingAncestor)) {
|
|
1806
|
+
rect = getInnerBoundingClientRect(clippingAncestor, strategy);
|
|
1807
|
+
} else {
|
|
1808
|
+
const visualOffsets = getVisualOffsets(element);
|
|
1809
|
+
rect = {
|
|
1810
|
+
x: clippingAncestor.x - visualOffsets.x,
|
|
1811
|
+
y: clippingAncestor.y - visualOffsets.y,
|
|
1812
|
+
width: clippingAncestor.width,
|
|
1813
|
+
height: clippingAncestor.height
|
|
1814
|
+
};
|
|
1815
|
+
}
|
|
1816
|
+
return (0,_floating_ui_core__WEBPACK_IMPORTED_MODULE_1__.rectToClientRect)(rect);
|
|
1817
|
+
}
|
|
1818
|
+
function hasFixedPositionAncestor(element, stopNode) {
|
|
1819
|
+
const parentNode = (0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_2__.getParentNode)(element);
|
|
1820
|
+
if (parentNode === stopNode || !(0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_2__.isElement)(parentNode) || (0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_2__.isLastTraversableNode)(parentNode)) {
|
|
1821
|
+
return false;
|
|
1822
|
+
}
|
|
1823
|
+
return (0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_2__.getComputedStyle)(parentNode).position === 'fixed' || hasFixedPositionAncestor(parentNode, stopNode);
|
|
1824
|
+
}
|
|
1847
1825
|
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1826
|
+
// A "clipping ancestor" is an `overflow` element with the characteristic of
|
|
1827
|
+
// clipping (or hiding) child elements. This returns all clipping ancestors
|
|
1828
|
+
// of the given element up the tree.
|
|
1829
|
+
function getClippingElementAncestors(element, cache) {
|
|
1830
|
+
const cachedResult = cache.get(element);
|
|
1831
|
+
if (cachedResult) {
|
|
1832
|
+
return cachedResult;
|
|
1833
|
+
}
|
|
1834
|
+
let result = (0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_2__.getOverflowAncestors)(element, [], false).filter(el => (0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_2__.isElement)(el) && (0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_2__.getNodeName)(el) !== 'body');
|
|
1835
|
+
let currentContainingBlockComputedStyle = null;
|
|
1836
|
+
const elementIsFixed = (0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_2__.getComputedStyle)(element).position === 'fixed';
|
|
1837
|
+
let currentNode = elementIsFixed ? (0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_2__.getParentNode)(element) : element;
|
|
1854
1838
|
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
const
|
|
1839
|
+
// https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
|
|
1840
|
+
while ((0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_2__.isElement)(currentNode) && !(0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_2__.isLastTraversableNode)(currentNode)) {
|
|
1841
|
+
const computedStyle = (0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_2__.getComputedStyle)(currentNode);
|
|
1842
|
+
const currentNodeIsContaining = (0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_2__.isContainingBlock)(currentNode);
|
|
1843
|
+
if (!currentNodeIsContaining && computedStyle.position === 'fixed') {
|
|
1844
|
+
currentContainingBlockComputedStyle = null;
|
|
1845
|
+
}
|
|
1846
|
+
const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === 'static' && !!currentContainingBlockComputedStyle && absoluteOrFixed.has(currentContainingBlockComputedStyle.position) || (0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_2__.isOverflowElement)(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode);
|
|
1847
|
+
if (shouldDropCurrentNode) {
|
|
1848
|
+
// Drop non-containing blocks.
|
|
1849
|
+
result = result.filter(ancestor => ancestor !== currentNode);
|
|
1850
|
+
} else {
|
|
1851
|
+
// Record last containing block for next iteration.
|
|
1852
|
+
currentContainingBlockComputedStyle = computedStyle;
|
|
1853
|
+
}
|
|
1854
|
+
currentNode = (0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_2__.getParentNode)(currentNode);
|
|
1855
|
+
}
|
|
1856
|
+
cache.set(element, result);
|
|
1857
|
+
return result;
|
|
1858
|
+
}
|
|
1859
1859
|
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
const
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1860
|
+
// Gets the maximum area that the element is visible in due to any number of
|
|
1861
|
+
// clipping ancestors.
|
|
1862
|
+
function getClippingRect(_ref) {
|
|
1863
|
+
let {
|
|
1864
|
+
element,
|
|
1865
|
+
boundary,
|
|
1866
|
+
rootBoundary,
|
|
1867
|
+
strategy
|
|
1868
|
+
} = _ref;
|
|
1869
|
+
const elementClippingAncestors = boundary === 'clippingAncestors' ? (0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_2__.isTopLayer)(element) ? [] : getClippingElementAncestors(element, this._c) : [].concat(boundary);
|
|
1870
|
+
const clippingAncestors = [...elementClippingAncestors, rootBoundary];
|
|
1871
|
+
const firstClippingAncestor = clippingAncestors[0];
|
|
1872
|
+
const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => {
|
|
1873
|
+
const rect = getClientRectFromClippingAncestor(element, clippingAncestor, strategy);
|
|
1874
|
+
accRect.top = (0,_floating_ui_core__WEBPACK_IMPORTED_MODULE_1__.max)(rect.top, accRect.top);
|
|
1875
|
+
accRect.right = (0,_floating_ui_core__WEBPACK_IMPORTED_MODULE_1__.min)(rect.right, accRect.right);
|
|
1876
|
+
accRect.bottom = (0,_floating_ui_core__WEBPACK_IMPORTED_MODULE_1__.min)(rect.bottom, accRect.bottom);
|
|
1877
|
+
accRect.left = (0,_floating_ui_core__WEBPACK_IMPORTED_MODULE_1__.max)(rect.left, accRect.left);
|
|
1878
|
+
return accRect;
|
|
1879
|
+
}, getClientRectFromClippingAncestor(element, firstClippingAncestor, strategy));
|
|
1880
|
+
return {
|
|
1881
|
+
width: clippingRect.right - clippingRect.left,
|
|
1882
|
+
height: clippingRect.bottom - clippingRect.top,
|
|
1883
|
+
x: clippingRect.left,
|
|
1884
|
+
y: clippingRect.top
|
|
1876
1885
|
};
|
|
1877
|
-
|
|
1878
|
-
...mergedOptions,
|
|
1879
|
-
platform: platformWithCache
|
|
1880
|
-
});
|
|
1881
|
-
};
|
|
1882
|
-
|
|
1883
|
-
|
|
1886
|
+
}
|
|
1884
1887
|
|
|
1888
|
+
function getDimensions(element) {
|
|
1889
|
+
const {
|
|
1890
|
+
width,
|
|
1891
|
+
height
|
|
1892
|
+
} = getCssDimensions(element);
|
|
1893
|
+
return {
|
|
1894
|
+
width,
|
|
1895
|
+
height
|
|
1896
|
+
};
|
|
1897
|
+
}
|
|
1885
1898
|
|
|
1886
|
-
|
|
1899
|
+
function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
|
|
1900
|
+
const isOffsetParentAnElement = (0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_2__.isHTMLElement)(offsetParent);
|
|
1901
|
+
const documentElement = (0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_2__.getDocumentElement)(offsetParent);
|
|
1902
|
+
const isFixed = strategy === 'fixed';
|
|
1903
|
+
const rect = getBoundingClientRect(element, true, isFixed, offsetParent);
|
|
1904
|
+
let scroll = {
|
|
1905
|
+
scrollLeft: 0,
|
|
1906
|
+
scrollTop: 0
|
|
1907
|
+
};
|
|
1908
|
+
const offsets = (0,_floating_ui_core__WEBPACK_IMPORTED_MODULE_1__.createCoords)(0);
|
|
1887
1909
|
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1910
|
+
// If the <body> scrollbar appears on the left (e.g. RTL systems). Use
|
|
1911
|
+
// Firefox with layout.scrollbar.side = 3 in about:config to test this.
|
|
1912
|
+
function setLeftRTLScrollbarOffset() {
|
|
1913
|
+
offsets.x = getWindowScrollBarX(documentElement);
|
|
1914
|
+
}
|
|
1915
|
+
if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
|
|
1916
|
+
if ((0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_2__.getNodeName)(offsetParent) !== 'body' || (0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_2__.isOverflowElement)(documentElement)) {
|
|
1917
|
+
scroll = (0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_2__.getNodeScroll)(offsetParent);
|
|
1918
|
+
}
|
|
1919
|
+
if (isOffsetParentAnElement) {
|
|
1920
|
+
const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent);
|
|
1921
|
+
offsets.x = offsetRect.x + offsetParent.clientLeft;
|
|
1922
|
+
offsets.y = offsetRect.y + offsetParent.clientTop;
|
|
1923
|
+
} else if (documentElement) {
|
|
1924
|
+
setLeftRTLScrollbarOffset();
|
|
1925
|
+
}
|
|
1926
|
+
}
|
|
1927
|
+
if (isFixed && !isOffsetParentAnElement && documentElement) {
|
|
1928
|
+
setLeftRTLScrollbarOffset();
|
|
1929
|
+
}
|
|
1930
|
+
const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : (0,_floating_ui_core__WEBPACK_IMPORTED_MODULE_1__.createCoords)(0);
|
|
1931
|
+
const x = rect.left + scroll.scrollLeft - offsets.x - htmlOffset.x;
|
|
1932
|
+
const y = rect.top + scroll.scrollTop - offsets.y - htmlOffset.y;
|
|
1933
|
+
return {
|
|
1934
|
+
x,
|
|
1935
|
+
y,
|
|
1936
|
+
width: rect.width,
|
|
1937
|
+
height: rect.height
|
|
1938
|
+
};
|
|
1939
|
+
}
|
|
1893
1940
|
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
/* harmony export */ arrow: () => (/* binding */ arrow),
|
|
1898
|
-
/* harmony export */ autoPlacement: () => (/* binding */ autoPlacement),
|
|
1899
|
-
/* harmony export */ autoUpdate: () => (/* reexport safe */ _floating_ui_dom__WEBPACK_IMPORTED_MODULE_0__.autoUpdate),
|
|
1900
|
-
/* harmony export */ computePosition: () => (/* reexport safe */ _floating_ui_dom__WEBPACK_IMPORTED_MODULE_0__.computePosition),
|
|
1901
|
-
/* harmony export */ detectOverflow: () => (/* reexport safe */ _floating_ui_dom__WEBPACK_IMPORTED_MODULE_0__.detectOverflow),
|
|
1902
|
-
/* harmony export */ flip: () => (/* binding */ flip),
|
|
1903
|
-
/* harmony export */ getOverflowAncestors: () => (/* reexport safe */ _floating_ui_dom__WEBPACK_IMPORTED_MODULE_1__.getOverflowAncestors),
|
|
1904
|
-
/* harmony export */ hide: () => (/* binding */ hide),
|
|
1905
|
-
/* harmony export */ inline: () => (/* binding */ inline),
|
|
1906
|
-
/* harmony export */ limitShift: () => (/* binding */ limitShift),
|
|
1907
|
-
/* harmony export */ offset: () => (/* binding */ offset),
|
|
1908
|
-
/* harmony export */ platform: () => (/* reexport safe */ _floating_ui_dom__WEBPACK_IMPORTED_MODULE_0__.platform),
|
|
1909
|
-
/* harmony export */ shift: () => (/* binding */ shift),
|
|
1910
|
-
/* harmony export */ size: () => (/* binding */ size),
|
|
1911
|
-
/* harmony export */ useFloating: () => (/* binding */ useFloating)
|
|
1912
|
-
/* harmony export */ });
|
|
1913
|
-
/* harmony import */ var _floating_ui_dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @floating-ui/dom */ "./node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs");
|
|
1914
|
-
/* harmony import */ var _floating_ui_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @floating-ui/dom */ "./node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs");
|
|
1915
|
-
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "react");
|
|
1916
|
-
/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react-dom */ "./node_modules/react-dom/index.js");
|
|
1941
|
+
function isStaticPositioned(element) {
|
|
1942
|
+
return (0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_2__.getComputedStyle)(element).position === 'static';
|
|
1943
|
+
}
|
|
1917
1944
|
|
|
1945
|
+
function getTrueOffsetParent(element, polyfill) {
|
|
1946
|
+
if (!(0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_2__.isHTMLElement)(element) || (0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_2__.getComputedStyle)(element).position === 'fixed') {
|
|
1947
|
+
return null;
|
|
1948
|
+
}
|
|
1949
|
+
if (polyfill) {
|
|
1950
|
+
return polyfill(element);
|
|
1951
|
+
}
|
|
1952
|
+
let rawOffsetParent = element.offsetParent;
|
|
1918
1953
|
|
|
1954
|
+
// Firefox returns the <html> element as the offsetParent if it's non-static,
|
|
1955
|
+
// while Chrome and Safari return the <body> element. The <body> element must
|
|
1956
|
+
// be used to perform the correct calculations even if the <html> element is
|
|
1957
|
+
// non-static.
|
|
1958
|
+
if ((0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_2__.getDocumentElement)(element) === rawOffsetParent) {
|
|
1959
|
+
rawOffsetParent = rawOffsetParent.ownerDocument.body;
|
|
1960
|
+
}
|
|
1961
|
+
return rawOffsetParent;
|
|
1962
|
+
}
|
|
1919
1963
|
|
|
1964
|
+
// Gets the closest ancestor positioned element. Handles some edge cases,
|
|
1965
|
+
// such as table ancestors and cross browser bugs.
|
|
1966
|
+
function getOffsetParent(element, polyfill) {
|
|
1967
|
+
const win = (0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_2__.getWindow)(element);
|
|
1968
|
+
if ((0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_2__.isTopLayer)(element)) {
|
|
1969
|
+
return win;
|
|
1970
|
+
}
|
|
1971
|
+
if (!(0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_2__.isHTMLElement)(element)) {
|
|
1972
|
+
let svgOffsetParent = (0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_2__.getParentNode)(element);
|
|
1973
|
+
while (svgOffsetParent && !(0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_2__.isLastTraversableNode)(svgOffsetParent)) {
|
|
1974
|
+
if ((0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_2__.isElement)(svgOffsetParent) && !isStaticPositioned(svgOffsetParent)) {
|
|
1975
|
+
return svgOffsetParent;
|
|
1976
|
+
}
|
|
1977
|
+
svgOffsetParent = (0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_2__.getParentNode)(svgOffsetParent);
|
|
1978
|
+
}
|
|
1979
|
+
return win;
|
|
1980
|
+
}
|
|
1981
|
+
let offsetParent = getTrueOffsetParent(element, polyfill);
|
|
1982
|
+
while (offsetParent && (0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_2__.isTableElement)(offsetParent) && isStaticPositioned(offsetParent)) {
|
|
1983
|
+
offsetParent = getTrueOffsetParent(offsetParent, polyfill);
|
|
1984
|
+
}
|
|
1985
|
+
if (offsetParent && (0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_2__.isLastTraversableNode)(offsetParent) && isStaticPositioned(offsetParent) && !(0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_2__.isContainingBlock)(offsetParent)) {
|
|
1986
|
+
return win;
|
|
1987
|
+
}
|
|
1988
|
+
return offsetParent || (0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_2__.getContainingBlock)(element) || win;
|
|
1989
|
+
}
|
|
1920
1990
|
|
|
1991
|
+
const getElementRects = async function (data) {
|
|
1992
|
+
const getOffsetParentFn = this.getOffsetParent || getOffsetParent;
|
|
1993
|
+
const getDimensionsFn = this.getDimensions;
|
|
1994
|
+
const floatingDimensions = await getDimensionsFn(data.floating);
|
|
1995
|
+
return {
|
|
1996
|
+
reference: getRectRelativeToOffsetParent(data.reference, await getOffsetParentFn(data.floating), data.strategy),
|
|
1997
|
+
floating: {
|
|
1998
|
+
x: 0,
|
|
1999
|
+
y: 0,
|
|
2000
|
+
width: floatingDimensions.width,
|
|
2001
|
+
height: floatingDimensions.height
|
|
2002
|
+
}
|
|
2003
|
+
};
|
|
2004
|
+
};
|
|
1921
2005
|
|
|
2006
|
+
function isRTL(element) {
|
|
2007
|
+
return (0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_2__.getComputedStyle)(element).direction === 'rtl';
|
|
2008
|
+
}
|
|
1922
2009
|
|
|
1923
|
-
|
|
2010
|
+
const platform = {
|
|
2011
|
+
convertOffsetParentRelativeRectToViewportRelativeRect,
|
|
2012
|
+
getDocumentElement: _floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_2__.getDocumentElement,
|
|
2013
|
+
getClippingRect,
|
|
2014
|
+
getOffsetParent,
|
|
2015
|
+
getElementRects,
|
|
2016
|
+
getClientRects,
|
|
2017
|
+
getDimensions,
|
|
2018
|
+
getScale,
|
|
2019
|
+
isElement: _floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_2__.isElement,
|
|
2020
|
+
isRTL
|
|
2021
|
+
};
|
|
1924
2022
|
|
|
1925
|
-
|
|
1926
|
-
|
|
2023
|
+
function rectsAreEqual(a, b) {
|
|
2024
|
+
return a.x === b.x && a.y === b.y && a.width === b.width && a.height === b.height;
|
|
2025
|
+
}
|
|
1927
2026
|
|
|
1928
|
-
//
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
return true;
|
|
2027
|
+
// https://samthor.au/2021/observing-dom/
|
|
2028
|
+
function observeMove(element, onMove) {
|
|
2029
|
+
let io = null;
|
|
2030
|
+
let timeoutId;
|
|
2031
|
+
const root = (0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_2__.getDocumentElement)(element);
|
|
2032
|
+
function cleanup() {
|
|
2033
|
+
var _io;
|
|
2034
|
+
clearTimeout(timeoutId);
|
|
2035
|
+
(_io = io) == null || _io.disconnect();
|
|
2036
|
+
io = null;
|
|
1939
2037
|
}
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
if (a && b && typeof a === 'object') {
|
|
1944
|
-
if (Array.isArray(a)) {
|
|
1945
|
-
length = a.length;
|
|
1946
|
-
if (length !== b.length) return false;
|
|
1947
|
-
for (i = length; i-- !== 0;) {
|
|
1948
|
-
if (!deepEqual(a[i], b[i])) {
|
|
1949
|
-
return false;
|
|
1950
|
-
}
|
|
1951
|
-
}
|
|
1952
|
-
return true;
|
|
2038
|
+
function refresh(skip, threshold) {
|
|
2039
|
+
if (skip === void 0) {
|
|
2040
|
+
skip = false;
|
|
1953
2041
|
}
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
if (length !== Object.keys(b).length) {
|
|
1957
|
-
return false;
|
|
2042
|
+
if (threshold === void 0) {
|
|
2043
|
+
threshold = 1;
|
|
1958
2044
|
}
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
2045
|
+
cleanup();
|
|
2046
|
+
const elementRectForRootMargin = element.getBoundingClientRect();
|
|
2047
|
+
const {
|
|
2048
|
+
left,
|
|
2049
|
+
top,
|
|
2050
|
+
width,
|
|
2051
|
+
height
|
|
2052
|
+
} = elementRectForRootMargin;
|
|
2053
|
+
if (!skip) {
|
|
2054
|
+
onMove();
|
|
1963
2055
|
}
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
2056
|
+
if (!width || !height) {
|
|
2057
|
+
return;
|
|
2058
|
+
}
|
|
2059
|
+
const insetTop = (0,_floating_ui_core__WEBPACK_IMPORTED_MODULE_1__.floor)(top);
|
|
2060
|
+
const insetRight = (0,_floating_ui_core__WEBPACK_IMPORTED_MODULE_1__.floor)(root.clientWidth - (left + width));
|
|
2061
|
+
const insetBottom = (0,_floating_ui_core__WEBPACK_IMPORTED_MODULE_1__.floor)(root.clientHeight - (top + height));
|
|
2062
|
+
const insetLeft = (0,_floating_ui_core__WEBPACK_IMPORTED_MODULE_1__.floor)(left);
|
|
2063
|
+
const rootMargin = -insetTop + "px " + -insetRight + "px " + -insetBottom + "px " + -insetLeft + "px";
|
|
2064
|
+
const options = {
|
|
2065
|
+
rootMargin,
|
|
2066
|
+
threshold: (0,_floating_ui_core__WEBPACK_IMPORTED_MODULE_1__.max)(0, (0,_floating_ui_core__WEBPACK_IMPORTED_MODULE_1__.min)(1, threshold)) || 1
|
|
2067
|
+
};
|
|
2068
|
+
let isFirstUpdate = true;
|
|
2069
|
+
function handleObserve(entries) {
|
|
2070
|
+
const ratio = entries[0].intersectionRatio;
|
|
2071
|
+
if (ratio !== threshold) {
|
|
2072
|
+
if (!isFirstUpdate) {
|
|
2073
|
+
return refresh();
|
|
2074
|
+
}
|
|
2075
|
+
if (!ratio) {
|
|
2076
|
+
// If the reference is clipped, the ratio is 0. Throttle the refresh
|
|
2077
|
+
// to prevent an infinite loop of updates.
|
|
2078
|
+
timeoutId = setTimeout(() => {
|
|
2079
|
+
refresh(false, 1e-7);
|
|
2080
|
+
}, 1000);
|
|
2081
|
+
} else {
|
|
2082
|
+
refresh(false, ratio);
|
|
2083
|
+
}
|
|
1968
2084
|
}
|
|
1969
|
-
if (!
|
|
1970
|
-
|
|
2085
|
+
if (ratio === 1 && !rectsAreEqual(elementRectForRootMargin, element.getBoundingClientRect())) {
|
|
2086
|
+
// It's possible that even though the ratio is reported as 1, the
|
|
2087
|
+
// element is not actually fully within the IntersectionObserver's root
|
|
2088
|
+
// area anymore. This can happen under performance constraints. This may
|
|
2089
|
+
// be a bug in the browser's IntersectionObserver implementation. To
|
|
2090
|
+
// work around this, we compare the element's bounding rect now with
|
|
2091
|
+
// what it was at the time we created the IntersectionObserver. If they
|
|
2092
|
+
// are not equal then the element moved, so we refresh.
|
|
2093
|
+
refresh();
|
|
1971
2094
|
}
|
|
2095
|
+
isFirstUpdate = false;
|
|
1972
2096
|
}
|
|
1973
|
-
return true;
|
|
1974
|
-
}
|
|
1975
|
-
return a !== a && b !== b;
|
|
1976
|
-
}
|
|
1977
2097
|
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
2098
|
+
// Older browsers don't support a `document` as the root and will throw an
|
|
2099
|
+
// error.
|
|
2100
|
+
try {
|
|
2101
|
+
io = new IntersectionObserver(handleObserve, {
|
|
2102
|
+
...options,
|
|
2103
|
+
// Handle <iframe>s
|
|
2104
|
+
root: root.ownerDocument
|
|
2105
|
+
});
|
|
2106
|
+
} catch (_e) {
|
|
2107
|
+
io = new IntersectionObserver(handleObserve, options);
|
|
2108
|
+
}
|
|
2109
|
+
io.observe(element);
|
|
1981
2110
|
}
|
|
1982
|
-
|
|
1983
|
-
return
|
|
1984
|
-
}
|
|
1985
|
-
|
|
1986
|
-
function roundByDPR(element, value) {
|
|
1987
|
-
const dpr = getDPR(element);
|
|
1988
|
-
return Math.round(value * dpr) / dpr;
|
|
1989
|
-
}
|
|
1990
|
-
|
|
1991
|
-
function useLatestRef(value) {
|
|
1992
|
-
const ref = react__WEBPACK_IMPORTED_MODULE_2__.useRef(value);
|
|
1993
|
-
index(() => {
|
|
1994
|
-
ref.current = value;
|
|
1995
|
-
});
|
|
1996
|
-
return ref;
|
|
2111
|
+
refresh(true);
|
|
2112
|
+
return cleanup;
|
|
1997
2113
|
}
|
|
1998
2114
|
|
|
1999
2115
|
/**
|
|
2000
|
-
*
|
|
2001
|
-
*
|
|
2116
|
+
* Automatically updates the position of the floating element when necessary.
|
|
2117
|
+
* Should only be called when the floating element is mounted on the DOM or
|
|
2118
|
+
* visible on the screen.
|
|
2119
|
+
* @returns cleanup function that should be invoked when the floating element is
|
|
2120
|
+
* removed from the DOM or hidden from the screen.
|
|
2121
|
+
* @see https://floating-ui.com/docs/autoUpdate
|
|
2002
2122
|
*/
|
|
2003
|
-
function
|
|
2123
|
+
function autoUpdate(reference, floating, update, options) {
|
|
2004
2124
|
if (options === void 0) {
|
|
2005
2125
|
options = {};
|
|
2006
2126
|
}
|
|
2007
2127
|
const {
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
reference: externalReference,
|
|
2014
|
-
floating: externalFloating
|
|
2015
|
-
} = {},
|
|
2016
|
-
transform = true,
|
|
2017
|
-
whileElementsMounted,
|
|
2018
|
-
open
|
|
2128
|
+
ancestorScroll = true,
|
|
2129
|
+
ancestorResize = true,
|
|
2130
|
+
elementResize = typeof ResizeObserver === 'function',
|
|
2131
|
+
layoutShift = typeof IntersectionObserver === 'function',
|
|
2132
|
+
animationFrame = false
|
|
2019
2133
|
} = options;
|
|
2020
|
-
const
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2134
|
+
const referenceEl = unwrapElement(reference);
|
|
2135
|
+
const ancestors = ancestorScroll || ancestorResize ? [...(referenceEl ? (0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_2__.getOverflowAncestors)(referenceEl) : []), ...(0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_2__.getOverflowAncestors)(floating)] : [];
|
|
2136
|
+
ancestors.forEach(ancestor => {
|
|
2137
|
+
ancestorScroll && ancestor.addEventListener('scroll', update, {
|
|
2138
|
+
passive: true
|
|
2139
|
+
});
|
|
2140
|
+
ancestorResize && ancestor.addEventListener('resize', update);
|
|
2027
2141
|
});
|
|
2028
|
-
const
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
floatingRef.current = node;
|
|
2043
|
-
_setFloating(node);
|
|
2044
|
-
}
|
|
2045
|
-
}, []);
|
|
2046
|
-
const referenceEl = externalReference || _reference;
|
|
2047
|
-
const floatingEl = externalFloating || _floating;
|
|
2048
|
-
const referenceRef = react__WEBPACK_IMPORTED_MODULE_2__.useRef(null);
|
|
2049
|
-
const floatingRef = react__WEBPACK_IMPORTED_MODULE_2__.useRef(null);
|
|
2050
|
-
const dataRef = react__WEBPACK_IMPORTED_MODULE_2__.useRef(data);
|
|
2051
|
-
const hasWhileElementsMounted = whileElementsMounted != null;
|
|
2052
|
-
const whileElementsMountedRef = useLatestRef(whileElementsMounted);
|
|
2053
|
-
const platformRef = useLatestRef(platform);
|
|
2054
|
-
const openRef = useLatestRef(open);
|
|
2055
|
-
const update = react__WEBPACK_IMPORTED_MODULE_2__.useCallback(() => {
|
|
2056
|
-
if (!referenceRef.current || !floatingRef.current) {
|
|
2057
|
-
return;
|
|
2058
|
-
}
|
|
2059
|
-
const config = {
|
|
2060
|
-
placement,
|
|
2061
|
-
strategy,
|
|
2062
|
-
middleware: latestMiddleware
|
|
2063
|
-
};
|
|
2064
|
-
if (platformRef.current) {
|
|
2065
|
-
config.platform = platformRef.current;
|
|
2066
|
-
}
|
|
2067
|
-
(0,_floating_ui_dom__WEBPACK_IMPORTED_MODULE_0__.computePosition)(referenceRef.current, floatingRef.current, config).then(data => {
|
|
2068
|
-
const fullData = {
|
|
2069
|
-
...data,
|
|
2070
|
-
// The floating element's position may be recomputed while it's closed
|
|
2071
|
-
// but still mounted (such as when transitioning out). To ensure
|
|
2072
|
-
// `isPositioned` will be `false` initially on the next open, avoid
|
|
2073
|
-
// setting it to `true` when `open === false` (must be specified).
|
|
2074
|
-
isPositioned: openRef.current !== false
|
|
2075
|
-
};
|
|
2076
|
-
if (isMountedRef.current && !deepEqual(dataRef.current, fullData)) {
|
|
2077
|
-
dataRef.current = fullData;
|
|
2078
|
-
react_dom__WEBPACK_IMPORTED_MODULE_3__.flushSync(() => {
|
|
2079
|
-
setData(fullData);
|
|
2142
|
+
const cleanupIo = referenceEl && layoutShift ? observeMove(referenceEl, update) : null;
|
|
2143
|
+
let reobserveFrame = -1;
|
|
2144
|
+
let resizeObserver = null;
|
|
2145
|
+
if (elementResize) {
|
|
2146
|
+
resizeObserver = new ResizeObserver(_ref => {
|
|
2147
|
+
let [firstEntry] = _ref;
|
|
2148
|
+
if (firstEntry && firstEntry.target === referenceEl && resizeObserver) {
|
|
2149
|
+
// Prevent update loops when using the `size` middleware.
|
|
2150
|
+
// https://github.com/floating-ui/floating-ui/issues/1740
|
|
2151
|
+
resizeObserver.unobserve(floating);
|
|
2152
|
+
cancelAnimationFrame(reobserveFrame);
|
|
2153
|
+
reobserveFrame = requestAnimationFrame(() => {
|
|
2154
|
+
var _resizeObserver;
|
|
2155
|
+
(_resizeObserver = resizeObserver) == null || _resizeObserver.observe(floating);
|
|
2080
2156
|
});
|
|
2081
2157
|
}
|
|
2158
|
+
update();
|
|
2082
2159
|
});
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
if (open === false && dataRef.current.isPositioned) {
|
|
2086
|
-
dataRef.current.isPositioned = false;
|
|
2087
|
-
setData(data => ({
|
|
2088
|
-
...data,
|
|
2089
|
-
isPositioned: false
|
|
2090
|
-
}));
|
|
2160
|
+
if (referenceEl && !animationFrame) {
|
|
2161
|
+
resizeObserver.observe(referenceEl);
|
|
2091
2162
|
}
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
if (
|
|
2102
|
-
if (floatingEl) floatingRef.current = floatingEl;
|
|
2103
|
-
if (referenceEl && floatingEl) {
|
|
2104
|
-
if (whileElementsMountedRef.current) {
|
|
2105
|
-
return whileElementsMountedRef.current(referenceEl, floatingEl, update);
|
|
2106
|
-
}
|
|
2163
|
+
resizeObserver.observe(floating);
|
|
2164
|
+
}
|
|
2165
|
+
let frameId;
|
|
2166
|
+
let prevRefRect = animationFrame ? getBoundingClientRect(reference) : null;
|
|
2167
|
+
if (animationFrame) {
|
|
2168
|
+
frameLoop();
|
|
2169
|
+
}
|
|
2170
|
+
function frameLoop() {
|
|
2171
|
+
const nextRefRect = getBoundingClientRect(reference);
|
|
2172
|
+
if (prevRefRect && !rectsAreEqual(prevRefRect, nextRefRect)) {
|
|
2107
2173
|
update();
|
|
2108
2174
|
}
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
top: 0
|
|
2125
|
-
};
|
|
2126
|
-
if (!elements.floating) {
|
|
2127
|
-
return initialStyles;
|
|
2128
|
-
}
|
|
2129
|
-
const x = roundByDPR(elements.floating, data.x);
|
|
2130
|
-
const y = roundByDPR(elements.floating, data.y);
|
|
2131
|
-
if (transform) {
|
|
2132
|
-
return {
|
|
2133
|
-
...initialStyles,
|
|
2134
|
-
transform: "translate(" + x + "px, " + y + "px)",
|
|
2135
|
-
...(getDPR(elements.floating) >= 1.5 && {
|
|
2136
|
-
willChange: 'transform'
|
|
2137
|
-
})
|
|
2138
|
-
};
|
|
2175
|
+
prevRefRect = nextRefRect;
|
|
2176
|
+
frameId = requestAnimationFrame(frameLoop);
|
|
2177
|
+
}
|
|
2178
|
+
update();
|
|
2179
|
+
return () => {
|
|
2180
|
+
var _resizeObserver2;
|
|
2181
|
+
ancestors.forEach(ancestor => {
|
|
2182
|
+
ancestorScroll && ancestor.removeEventListener('scroll', update);
|
|
2183
|
+
ancestorResize && ancestor.removeEventListener('resize', update);
|
|
2184
|
+
});
|
|
2185
|
+
cleanupIo == null || cleanupIo();
|
|
2186
|
+
(_resizeObserver2 = resizeObserver) == null || _resizeObserver2.disconnect();
|
|
2187
|
+
resizeObserver = null;
|
|
2188
|
+
if (animationFrame) {
|
|
2189
|
+
cancelAnimationFrame(frameId);
|
|
2139
2190
|
}
|
|
2140
|
-
|
|
2141
|
-
position: strategy,
|
|
2142
|
-
left: x,
|
|
2143
|
-
top: y
|
|
2144
|
-
};
|
|
2145
|
-
}, [strategy, transform, elements.floating, data.x, data.y]);
|
|
2146
|
-
return react__WEBPACK_IMPORTED_MODULE_2__.useMemo(() => ({
|
|
2147
|
-
...data,
|
|
2148
|
-
update,
|
|
2149
|
-
refs,
|
|
2150
|
-
elements,
|
|
2151
|
-
floatingStyles
|
|
2152
|
-
}), [data, update, refs, elements, floatingStyles]);
|
|
2191
|
+
};
|
|
2153
2192
|
}
|
|
2154
2193
|
|
|
2155
2194
|
/**
|
|
2156
|
-
*
|
|
2157
|
-
*
|
|
2158
|
-
*
|
|
2159
|
-
*
|
|
2195
|
+
* Resolves with an object of overflow side offsets that determine how much the
|
|
2196
|
+
* element is overflowing a given clipping boundary on each side.
|
|
2197
|
+
* - positive = overflowing the boundary by that number of pixels
|
|
2198
|
+
* - negative = how many pixels left before it will overflow
|
|
2199
|
+
* - 0 = lies flush with the boundary
|
|
2200
|
+
* @see https://floating-ui.com/docs/detectOverflow
|
|
2160
2201
|
*/
|
|
2161
|
-
const
|
|
2162
|
-
function isRef(value) {
|
|
2163
|
-
return {}.hasOwnProperty.call(value, 'current');
|
|
2164
|
-
}
|
|
2165
|
-
return {
|
|
2166
|
-
name: 'arrow',
|
|
2167
|
-
options,
|
|
2168
|
-
fn(state) {
|
|
2169
|
-
const {
|
|
2170
|
-
element,
|
|
2171
|
-
padding
|
|
2172
|
-
} = typeof options === 'function' ? options(state) : options;
|
|
2173
|
-
if (element && isRef(element)) {
|
|
2174
|
-
if (element.current != null) {
|
|
2175
|
-
return (0,_floating_ui_dom__WEBPACK_IMPORTED_MODULE_0__.arrow)({
|
|
2176
|
-
element: element.current,
|
|
2177
|
-
padding
|
|
2178
|
-
}).fn(state);
|
|
2179
|
-
}
|
|
2180
|
-
return {};
|
|
2181
|
-
}
|
|
2182
|
-
if (element) {
|
|
2183
|
-
return (0,_floating_ui_dom__WEBPACK_IMPORTED_MODULE_0__.arrow)({
|
|
2184
|
-
element,
|
|
2185
|
-
padding
|
|
2186
|
-
}).fn(state);
|
|
2187
|
-
}
|
|
2188
|
-
return {};
|
|
2189
|
-
}
|
|
2190
|
-
};
|
|
2191
|
-
};
|
|
2202
|
+
const detectOverflow = _floating_ui_core__WEBPACK_IMPORTED_MODULE_0__.detectOverflow;
|
|
2192
2203
|
|
|
2193
2204
|
/**
|
|
2194
2205
|
* Modifies the placement by translating the floating element along the
|
|
@@ -2197,28 +2208,22 @@ const arrow$1 = options => {
|
|
|
2197
2208
|
* object may be passed.
|
|
2198
2209
|
* @see https://floating-ui.com/docs/offset
|
|
2199
2210
|
*/
|
|
2200
|
-
const offset =
|
|
2201
|
-
...(0,_floating_ui_dom__WEBPACK_IMPORTED_MODULE_0__.offset)(options),
|
|
2202
|
-
options: [options, deps]
|
|
2203
|
-
});
|
|
2211
|
+
const offset = _floating_ui_core__WEBPACK_IMPORTED_MODULE_0__.offset;
|
|
2204
2212
|
|
|
2205
2213
|
/**
|
|
2206
|
-
* Optimizes the visibility of the floating element by
|
|
2207
|
-
*
|
|
2208
|
-
*
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
options: [options, deps]
|
|
2213
|
-
});
|
|
2214
|
+
* Optimizes the visibility of the floating element by choosing the placement
|
|
2215
|
+
* that has the most space available automatically, without needing to specify a
|
|
2216
|
+
* preferred placement. Alternative to `flip`.
|
|
2217
|
+
* @see https://floating-ui.com/docs/autoPlacement
|
|
2218
|
+
*/
|
|
2219
|
+
const autoPlacement = _floating_ui_core__WEBPACK_IMPORTED_MODULE_0__.autoPlacement;
|
|
2214
2220
|
|
|
2215
2221
|
/**
|
|
2216
|
-
*
|
|
2222
|
+
* Optimizes the visibility of the floating element by shifting it in order to
|
|
2223
|
+
* keep it in view when it will overflow the clipping boundary.
|
|
2224
|
+
* @see https://floating-ui.com/docs/shift
|
|
2217
2225
|
*/
|
|
2218
|
-
const
|
|
2219
|
-
...(0,_floating_ui_dom__WEBPACK_IMPORTED_MODULE_0__.limitShift)(options),
|
|
2220
|
-
options: [options, deps]
|
|
2221
|
-
});
|
|
2226
|
+
const shift = _floating_ui_core__WEBPACK_IMPORTED_MODULE_0__.shift;
|
|
2222
2227
|
|
|
2223
2228
|
/**
|
|
2224
2229
|
* Optimizes the visibility of the floating element by flipping the `placement`
|
|
@@ -2226,10 +2231,7 @@ const limitShift = (options, deps) => ({
|
|
|
2226
2231
|
* clipping boundary. Alternative to `autoPlacement`.
|
|
2227
2232
|
* @see https://floating-ui.com/docs/flip
|
|
2228
2233
|
*/
|
|
2229
|
-
const flip =
|
|
2230
|
-
...(0,_floating_ui_dom__WEBPACK_IMPORTED_MODULE_0__.flip)(options),
|
|
2231
|
-
options: [options, deps]
|
|
2232
|
-
});
|
|
2234
|
+
const flip = _floating_ui_core__WEBPACK_IMPORTED_MODULE_0__.flip;
|
|
2233
2235
|
|
|
2234
2236
|
/**
|
|
2235
2237
|
* Provides data that allows you to change the size of the floating element —
|
|
@@ -2237,52 +2239,56 @@ const flip = (options, deps) => ({
|
|
|
2237
2239
|
* width of the reference element.
|
|
2238
2240
|
* @see https://floating-ui.com/docs/size
|
|
2239
2241
|
*/
|
|
2240
|
-
const size =
|
|
2241
|
-
...(0,_floating_ui_dom__WEBPACK_IMPORTED_MODULE_0__.size)(options),
|
|
2242
|
-
options: [options, deps]
|
|
2243
|
-
});
|
|
2244
|
-
|
|
2245
|
-
/**
|
|
2246
|
-
* Optimizes the visibility of the floating element by choosing the placement
|
|
2247
|
-
* that has the most space available automatically, without needing to specify a
|
|
2248
|
-
* preferred placement. Alternative to `flip`.
|
|
2249
|
-
* @see https://floating-ui.com/docs/autoPlacement
|
|
2250
|
-
*/
|
|
2251
|
-
const autoPlacement = (options, deps) => ({
|
|
2252
|
-
...(0,_floating_ui_dom__WEBPACK_IMPORTED_MODULE_0__.autoPlacement)(options),
|
|
2253
|
-
options: [options, deps]
|
|
2254
|
-
});
|
|
2242
|
+
const size = _floating_ui_core__WEBPACK_IMPORTED_MODULE_0__.size;
|
|
2255
2243
|
|
|
2256
2244
|
/**
|
|
2257
2245
|
* Provides data to hide the floating element in applicable situations, such as
|
|
2258
2246
|
* when it is not in the same clipping context as the reference element.
|
|
2259
2247
|
* @see https://floating-ui.com/docs/hide
|
|
2260
2248
|
*/
|
|
2261
|
-
const hide =
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
|
|
2249
|
+
const hide = _floating_ui_core__WEBPACK_IMPORTED_MODULE_0__.hide;
|
|
2250
|
+
|
|
2251
|
+
/**
|
|
2252
|
+
* Provides data to position an inner element of the floating element so that it
|
|
2253
|
+
* appears centered to the reference element.
|
|
2254
|
+
* @see https://floating-ui.com/docs/arrow
|
|
2255
|
+
*/
|
|
2256
|
+
const arrow = _floating_ui_core__WEBPACK_IMPORTED_MODULE_0__.arrow;
|
|
2265
2257
|
|
|
2266
2258
|
/**
|
|
2267
2259
|
* Provides improved positioning for inline reference elements that can span
|
|
2268
2260
|
* over multiple lines, such as hyperlinks or range selections.
|
|
2269
2261
|
* @see https://floating-ui.com/docs/inline
|
|
2270
2262
|
*/
|
|
2271
|
-
const inline =
|
|
2272
|
-
...(0,_floating_ui_dom__WEBPACK_IMPORTED_MODULE_0__.inline)(options),
|
|
2273
|
-
options: [options, deps]
|
|
2274
|
-
});
|
|
2263
|
+
const inline = _floating_ui_core__WEBPACK_IMPORTED_MODULE_0__.inline;
|
|
2275
2264
|
|
|
2276
2265
|
/**
|
|
2277
|
-
*
|
|
2278
|
-
* appears centered to the reference element.
|
|
2279
|
-
* This wraps the core `arrow` middleware to allow React refs as the element.
|
|
2280
|
-
* @see https://floating-ui.com/docs/arrow
|
|
2266
|
+
* Built-in `limiter` that will stop `shift()` at a certain point.
|
|
2281
2267
|
*/
|
|
2282
|
-
const
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
|
|
2268
|
+
const limitShift = _floating_ui_core__WEBPACK_IMPORTED_MODULE_0__.limitShift;
|
|
2269
|
+
|
|
2270
|
+
/**
|
|
2271
|
+
* Computes the `x` and `y` coordinates that will place the floating element
|
|
2272
|
+
* next to a given reference element.
|
|
2273
|
+
*/
|
|
2274
|
+
const computePosition = (reference, floating, options) => {
|
|
2275
|
+
// This caches the expensive `getClippingElementAncestors` function so that
|
|
2276
|
+
// multiple lifecycle resets re-use the same result. It only lives for a
|
|
2277
|
+
// single call. If other functions become expensive, we can add them as well.
|
|
2278
|
+
const cache = new Map();
|
|
2279
|
+
const mergedOptions = {
|
|
2280
|
+
platform,
|
|
2281
|
+
...options
|
|
2282
|
+
};
|
|
2283
|
+
const platformWithCache = {
|
|
2284
|
+
...mergedOptions.platform,
|
|
2285
|
+
_c: cache
|
|
2286
|
+
};
|
|
2287
|
+
return (0,_floating_ui_core__WEBPACK_IMPORTED_MODULE_0__.computePosition)(reference, floating, {
|
|
2288
|
+
...mergedOptions,
|
|
2289
|
+
platform: platformWithCache
|
|
2290
|
+
});
|
|
2291
|
+
};
|
|
2286
2292
|
|
|
2287
2293
|
|
|
2288
2294
|
|
|
@@ -2358,7 +2364,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
2358
2364
|
/* harmony import */ var tabbable__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! tabbable */ "./node_modules/tabbable/dist/index.esm.js");
|
|
2359
2365
|
/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react-dom */ "./node_modules/react-dom/index.js");
|
|
2360
2366
|
/* harmony import */ var _floating_ui_react_dom__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @floating-ui/react-dom */ "./node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.mjs");
|
|
2361
|
-
/* harmony import */ var _floating_ui_react_dom__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @floating-ui/react-dom */ "./node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs");
|
|
2367
|
+
/* harmony import */ var _floating_ui_react_dom__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @floating-ui/react-dom */ "./node_modules/@floating-ui/react-dom/node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs");
|
|
2362
2368
|
/* harmony import */ var _floating_ui_utils__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @floating-ui/utils */ "./node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs");
|
|
2363
2369
|
|
|
2364
2370
|
|
|
@@ -7932,96 +7938,100 @@ function rectToClientRect(rect) {
|
|
|
7932
7938
|
"use strict";
|
|
7933
7939
|
__webpack_require__.r(__webpack_exports__);
|
|
7934
7940
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
7935
|
-
/* harmony export */ FOCUSABLE_HTML_TAGS: () => (/* binding */
|
|
7936
|
-
/* harmony export */ applyInertiaStep: () => (/* binding */
|
|
7937
|
-
/* harmony export */ assert: () => (/* binding */
|
|
7938
|
-
/* harmony export */ blobToFile: () => (/* binding */
|
|
7939
|
-
/* harmony export */ calculateCenterOffset: () => (/* binding */
|
|
7940
|
-
/* harmony export */ calculateEuclideanDistance: () => (/* binding */
|
|
7941
|
-
/* harmony export */ calculateMovingSpeed: () => (/* binding */
|
|
7942
|
-
/* harmony export */ calculatePercentage: () => (/* binding */
|
|
7943
|
-
/* harmony export */ camelToDashCase: () => (/* binding */
|
|
7944
|
-
/* harmony export */ camelToWords: () => (/* binding */
|
|
7945
|
-
/* harmony export */ centerElementInContainer: () => (/* binding */
|
|
7946
|
-
/* harmony export */ chunk: () => (/* binding */
|
|
7947
|
-
/* harmony export */ cloneBlob: () => (/* binding */
|
|
7948
|
-
/* harmony export */ compact: () => (/* binding */
|
|
7949
|
-
/* harmony export */ compose: () => (/* binding */
|
|
7950
|
-
/* harmony export */ definedProps: () => (/* binding */
|
|
7951
|
-
/* harmony export */ delay: () => (/* binding */
|
|
7952
|
-
/* harmony export */ difference: () => (/* binding */
|
|
7953
|
-
/* harmony export */ downloadFile: () => (/* binding */
|
|
7954
|
-
/* harmony export */ everyAsync: () => (/* binding */
|
|
7955
|
-
/* harmony export */ fileListToFiles: () => (/* binding */
|
|
7956
|
-
/* harmony export */ filterParallel: () => (/* binding */
|
|
7957
|
-
/* harmony export */ filterSequential: () => (/* binding */
|
|
7958
|
-
/* harmony export */ findAsync: () => (/* binding */
|
|
7959
|
-
/* harmony export */ findCharIndices: () => (/* binding */
|
|
7960
|
-
/* harmony export */
|
|
7961
|
-
/* harmony export */
|
|
7962
|
-
/* harmony export */
|
|
7963
|
-
/* harmony export */
|
|
7964
|
-
/* harmony export */
|
|
7965
|
-
/* harmony export */
|
|
7966
|
-
/* harmony export */
|
|
7967
|
-
/* harmony export */
|
|
7968
|
-
/* harmony export */
|
|
7969
|
-
/* harmony export */
|
|
7970
|
-
/* harmony export */
|
|
7971
|
-
/* harmony export */
|
|
7972
|
-
/* harmony export */
|
|
7973
|
-
/* harmony export */
|
|
7974
|
-
/* harmony export */
|
|
7975
|
-
/* harmony export */
|
|
7976
|
-
/* harmony export */
|
|
7977
|
-
/* harmony export */
|
|
7978
|
-
/* harmony export */
|
|
7979
|
-
/* harmony export */
|
|
7980
|
-
/* harmony export */
|
|
7981
|
-
/* harmony export */
|
|
7982
|
-
/* harmony export */
|
|
7983
|
-
/* harmony export */
|
|
7984
|
-
/* harmony export */
|
|
7985
|
-
/* harmony export */
|
|
7986
|
-
/* harmony export */
|
|
7987
|
-
/* harmony export */
|
|
7988
|
-
/* harmony export */
|
|
7989
|
-
/* harmony export */
|
|
7990
|
-
/* harmony export */
|
|
7991
|
-
/* harmony export */
|
|
7992
|
-
/* harmony export */
|
|
7993
|
-
/* harmony export */
|
|
7994
|
-
/* harmony export */
|
|
7995
|
-
/* harmony export */
|
|
7996
|
-
/* harmony export */
|
|
7997
|
-
/* harmony export */
|
|
7998
|
-
/* harmony export */
|
|
7999
|
-
/* harmony export */
|
|
8000
|
-
/* harmony export */
|
|
8001
|
-
/* harmony export */
|
|
8002
|
-
/* harmony export */
|
|
8003
|
-
/* harmony export */
|
|
8004
|
-
/* harmony export */
|
|
8005
|
-
/* harmony export */
|
|
8006
|
-
/* harmony export */
|
|
8007
|
-
/* harmony export */
|
|
8008
|
-
/* harmony export */
|
|
8009
|
-
/* harmony export */
|
|
8010
|
-
/* harmony export */
|
|
8011
|
-
/* harmony export */
|
|
8012
|
-
/* harmony export */
|
|
8013
|
-
/* harmony export */
|
|
8014
|
-
/* harmony export */
|
|
8015
|
-
/* harmony export */
|
|
8016
|
-
/* harmony export */
|
|
8017
|
-
/* harmony export */
|
|
8018
|
-
/* harmony export */
|
|
8019
|
-
/* harmony export */
|
|
8020
|
-
/* harmony export */
|
|
8021
|
-
/* harmony export */
|
|
8022
|
-
/* harmony export */
|
|
7941
|
+
/* harmony export */ FOCUSABLE_HTML_TAGS: () => (/* binding */ a),
|
|
7942
|
+
/* harmony export */ applyInertiaStep: () => (/* binding */ ye),
|
|
7943
|
+
/* harmony export */ assert: () => (/* binding */ s),
|
|
7944
|
+
/* harmony export */ blobToFile: () => (/* binding */ fe),
|
|
7945
|
+
/* harmony export */ calculateCenterOffset: () => (/* binding */ le),
|
|
7946
|
+
/* harmony export */ calculateEuclideanDistance: () => (/* binding */ Me),
|
|
7947
|
+
/* harmony export */ calculateMovingSpeed: () => (/* binding */ Se),
|
|
7948
|
+
/* harmony export */ calculatePercentage: () => (/* binding */ Ae),
|
|
7949
|
+
/* harmony export */ camelToDashCase: () => (/* binding */ ke),
|
|
7950
|
+
/* harmony export */ camelToWords: () => (/* binding */ Ee),
|
|
7951
|
+
/* harmony export */ centerElementInContainer: () => (/* binding */ ie),
|
|
7952
|
+
/* harmony export */ chunk: () => (/* binding */ T),
|
|
7953
|
+
/* harmony export */ cloneBlob: () => (/* binding */ e),
|
|
7954
|
+
/* harmony export */ compact: () => (/* binding */ P),
|
|
7955
|
+
/* harmony export */ compose: () => (/* binding */ Y),
|
|
7956
|
+
/* harmony export */ definedProps: () => (/* binding */ Ce),
|
|
7957
|
+
/* harmony export */ delay: () => (/* binding */ q),
|
|
7958
|
+
/* harmony export */ difference: () => (/* binding */ _),
|
|
7959
|
+
/* harmony export */ downloadFile: () => (/* binding */ ee),
|
|
7960
|
+
/* harmony export */ everyAsync: () => (/* binding */ V),
|
|
7961
|
+
/* harmony export */ fileListToFiles: () => (/* binding */ he),
|
|
7962
|
+
/* harmony export */ filterParallel: () => (/* binding */ B),
|
|
7963
|
+
/* harmony export */ filterSequential: () => (/* binding */ H),
|
|
7964
|
+
/* harmony export */ findAsync: () => (/* binding */ G),
|
|
7965
|
+
/* harmony export */ findCharIndices: () => (/* binding */ Te),
|
|
7966
|
+
/* harmony export */ flattenTree: () => (/* binding */ ze),
|
|
7967
|
+
/* harmony export */ forEachChar: () => (/* binding */ Xe),
|
|
7968
|
+
/* harmony export */ generateEphemeralId: () => (/* binding */ we),
|
|
7969
|
+
/* harmony export */ getDOMRectIntersectionRatio: () => (/* binding */ be),
|
|
7970
|
+
/* harmony export */ getElementOffsetRect: () => (/* binding */ t),
|
|
7971
|
+
/* harmony export */ getFocusableHtmlElements: () => (/* binding */ i),
|
|
7972
|
+
/* harmony export */ getLocalStorageCapabilities: () => (/* binding */ ce),
|
|
7973
|
+
/* harmony export */ getTreeChildren: () => (/* binding */ Ye),
|
|
7974
|
+
/* harmony export */ getWordsInitials: () => (/* binding */ _e),
|
|
7975
|
+
/* harmony export */ getXOverflowWidth: () => (/* binding */ ne),
|
|
7976
|
+
/* harmony export */ getYOverflowHeight: () => (/* binding */ ae),
|
|
7977
|
+
/* harmony export */ hasXOverflow: () => (/* binding */ te),
|
|
7978
|
+
/* harmony export */ hasYOverflow: () => (/* binding */ re),
|
|
7979
|
+
/* harmony export */ hashString: () => (/* binding */ ve),
|
|
7980
|
+
/* harmony export */ intersection: () => (/* binding */ X),
|
|
7981
|
+
/* harmony export */ invokeIfFunction: () => (/* binding */ pe),
|
|
7982
|
+
/* harmony export */ isAnchorHtmlElement: () => (/* binding */ n),
|
|
7983
|
+
/* harmony export */ isArray: () => (/* binding */ E),
|
|
7984
|
+
/* harmony export */ isBlob: () => (/* binding */ w),
|
|
7985
|
+
/* harmony export */ isBool: () => (/* binding */ m),
|
|
7986
|
+
/* harmony export */ isContentEditableHtmlElement: () => (/* binding */ r),
|
|
7987
|
+
/* harmony export */ isDate: () => (/* binding */ y),
|
|
7988
|
+
/* harmony export */ isDecimal: () => (/* binding */ k),
|
|
7989
|
+
/* harmony export */ isDefined: () => (/* binding */ h),
|
|
7990
|
+
/* harmony export */ isEmptyArray: () => (/* binding */ L),
|
|
7991
|
+
/* harmony export */ isEmptyObject: () => (/* binding */ g),
|
|
7992
|
+
/* harmony export */ isError: () => (/* binding */ b),
|
|
7993
|
+
/* harmony export */ isFile: () => (/* binding */ ue),
|
|
7994
|
+
/* harmony export */ isFiniteNumber: () => (/* binding */ C),
|
|
7995
|
+
/* harmony export */ isFunction: () => (/* binding */ N),
|
|
7996
|
+
/* harmony export */ isHtmlElementFocusable: () => (/* binding */ l),
|
|
7997
|
+
/* harmony export */ isInteger: () => (/* binding */ I),
|
|
7998
|
+
/* harmony export */ isLocalStorageReadable: () => (/* binding */ se),
|
|
7999
|
+
/* harmony export */ isMap: () => (/* binding */ S),
|
|
8000
|
+
/* harmony export */ isNil: () => (/* binding */ u),
|
|
8001
|
+
/* harmony export */ isNilOrEmptyString: () => (/* binding */ Pe),
|
|
8002
|
+
/* harmony export */ isNull: () => (/* binding */ c),
|
|
8003
|
+
/* harmony export */ isNumber: () => (/* binding */ d),
|
|
8004
|
+
/* harmony export */ isObject: () => (/* binding */ p),
|
|
8005
|
+
/* harmony export */ isPromise: () => (/* binding */ j),
|
|
8006
|
+
/* harmony export */ isRegExp: () => (/* binding */ M),
|
|
8007
|
+
/* harmony export */ isSet: () => (/* binding */ A),
|
|
8008
|
+
/* harmony export */ isString: () => (/* binding */ Q),
|
|
8009
|
+
/* harmony export */ isSymbol: () => (/* binding */ v),
|
|
8010
|
+
/* harmony export */ isUndefined: () => (/* binding */ f),
|
|
8011
|
+
/* harmony export */ isValidDate: () => (/* binding */ x),
|
|
8012
|
+
/* harmony export */ moveFocusWithinContainer: () => (/* binding */ o),
|
|
8013
|
+
/* harmony export */ noop: () => (/* binding */ R),
|
|
8014
|
+
/* harmony export */ not: () => (/* binding */ $),
|
|
8015
|
+
/* harmony export */ once: () => (/* binding */ F),
|
|
8016
|
+
/* harmony export */ parse2DMatrix: () => (/* binding */ oe),
|
|
8017
|
+
/* harmony export */ parseFileName: () => (/* binding */ Oe),
|
|
8018
|
+
/* harmony export */ pipe: () => (/* binding */ z),
|
|
8019
|
+
/* harmony export */ readFilesFromDataTransfer: () => (/* binding */ me),
|
|
8020
|
+
/* harmony export */ reduceAsync: () => (/* binding */ Z),
|
|
8021
|
+
/* harmony export */ resolveAxisDelta: () => (/* binding */ xe),
|
|
8022
|
+
/* harmony export */ resolveBoundedDelta: () => (/* binding */ ge),
|
|
8023
|
+
/* harmony export */ retry: () => (/* binding */ K),
|
|
8024
|
+
/* harmony export */ runParallel: () => (/* binding */ W),
|
|
8025
|
+
/* harmony export */ runSequential: () => (/* binding */ U),
|
|
8026
|
+
/* harmony export */ searchTree: () => (/* binding */ Re),
|
|
8027
|
+
/* harmony export */ someAsync: () => (/* binding */ D),
|
|
8028
|
+
/* harmony export */ splitStringIntoWords: () => (/* binding */ Le),
|
|
8029
|
+
/* harmony export */ timeout: () => (/* binding */ J),
|
|
8030
|
+
/* harmony export */ toKebabCase: () => (/* binding */ Ie),
|
|
8031
|
+
/* harmony export */ traverseFileSystemDirectory: () => (/* binding */ de),
|
|
8032
|
+
/* harmony export */ unique: () => (/* binding */ O)
|
|
8023
8033
|
/* harmony export */ });
|
|
8024
|
-
|
|
8034
|
+
const e=e=>new Blob([e],{type:e.type}),t=e=>new DOMRect(e.offsetLeft,e.offsetTop,e.clientWidth,e.clientHeight),n=e=>"A"===e.tagName,r=e=>"true"===e.getAttribute("contenteditable"),a=["INPUT","SELECT","TEXTAREA","BUTTON","A"],l=e=>{if(!e)return!1;const t=window.getComputedStyle(e);if("hidden"===t.visibility||"none"===t.display)return!1;if("disabled"in e&&e.disabled)return!1;const l=e.getAttribute("tabindex");return"-1"!==l&&(a.includes(e.tagName)?!n(e)||""!==e.href:!!r(e)||null!==l)},i=e=>Array.from(e.querySelectorAll("*")).filter(l),o=(e,t=null,{wrap:n=!0,getNextIndex:r}={})=>{const a=document.activeElement,l=t??a?.parentElement;if(!a||!l)return;const o=i(l);if(0===o.length)return;const s=o.indexOf(a);if(-1===s)return;let c;r?c=r(s,e,o):"next"===e?(c=s+1,c>=o.length&&(c=n?0:null)):(c=s-1,c<0&&(c=n?o.length-1:null)),null!==c&&o[c]?.focus()};function s(e,t){if(!e)throw new Error(t)}const c=e=>null===e,u=e=>null==e,h=e=>null!=e,f=e=>void 0===e,d=e=>"number"==typeof e,m=e=>"boolean"==typeof e,p=e=>"object"==typeof e,g=e=>p(e)&&!c(e)&&0===Object.keys(e).length,y=e=>e instanceof Date,w=e=>e instanceof Blob,b=e=>e instanceof Error,x=e=>y(e)&&!isNaN(e.getTime()),M=e=>e instanceof RegExp,S=e=>e instanceof Map,A=e=>e instanceof Set,v=e=>"symbol"==typeof e,C=e=>d(e)&&isFinite(e),I=e=>d(e)&&Number.isInteger(e),k=e=>C(e)&&!Number.isInteger(e),E=e=>Array.isArray(e),L=e=>E(e)&&0===e.length,P=e=>e.filter(Boolean),O=e=>[...new Set(e)],T=(e,t)=>(s(t>0,"Chunk size must be greater than 0"),Array.from({length:Math.ceil(e.length/t)},(n,r)=>e.slice(r*t,(r+1)*t))),X=(...e)=>{if(0===e.length)return[];if(1===e.length)return[...e[0]];const[t,...n]=e;return O(t).filter(e=>n.every(t=>t.includes(e)))},_=(e,t)=>e.filter(e=>!t.includes(e)),z=(...e)=>t=>e.reduce((e,t)=>t(e),t),Y=(...e)=>t=>e.reduceRight((e,t)=>t(e),t),R=()=>{},N=e=>"function"==typeof e,$=e=>(...t)=>!e(...t),F=e=>{let t,n=!1;return function(...r){return n||(n=!0,t=e.apply(this,r)),t}},j=e=>N(e?.then),U=async(e,t)=>{const n=[];for(let r=0;r<e.length;r++)n.push(await t(e[r],r,e));return n},W=async(e,t)=>Promise.all(e.map(t)),H=async(e,t)=>{const n=[];for(let r=0;r<e.length;r++){const a=e[r];await t(a,r,e)&&n.push(a)}return n},B=async(e,t)=>{const n=await W(e,async(e,n,r)=>!!await t(e,n,r)&&e);return P(n)},D=async(e,t)=>{for(let n=0;n<e.length;n++)if(await t(e[n],n,e))return!0;return!1},V=async(e,t)=>{for(let n=0;n<e.length;n++)if(!await t(e[n],n,e))return!1;return!0},Z=async(e,t,n)=>{let r=n;for(let n=0;n<e.length;n++)r=await t(r,e[n],n,e);return r},G=async(e,t)=>{for(let n=0;n<e.length;n++)if(await t(e[n],n,e))return e[n];return null},q=e=>new Promise(t=>setTimeout(t,e)),J=async(e,t,n="Operation timed out")=>{try{return await Promise.race([e,q(t).then(()=>Promise.reject(new Error(n)))])}finally{}},K=(e,{maxAttempts:t=3,delayMs:n=300,backoff:r=!0,onRetry:a}={})=>async(...l)=>{let i;for(let o=1;o<=t;o++)try{return await e(...l)}catch(e){if(i=e,o<t){a?.(o,e);const t=r?n*2**(o-1):n;await q(t)}}throw i},Q=e=>"string"==typeof e,ee=(e,{fileName:t,target:n}={})=>{if(f(document))return;const r=document.createElement("a");let a=null;try{const l=Q(e)?e:a=URL.createObjectURL(e);r.href=l,t&&(r.download=t),n&&(r.target=n),document.body.appendChild(r),r.click()}finally{r.remove(),a&&setTimeout(()=>{s(a,"Object URL should not be null"),URL.revokeObjectURL(a)},0)}},te=e=>e.scrollWidth>e.clientWidth,ne=e=>Math.max(0,e.scrollWidth-e.clientWidth),re=e=>e.scrollHeight>e.clientHeight,ae=e=>Math.max(0,e.scrollHeight-e.clientHeight),le=({overflowSize:e,containerSize:t,elementOffset:n,elementSize:r})=>{if(e<=0)return 0;const a=n+r/2-t/2;return-Math.max(0,Math.min(a,e))},ie=(e,t,{axis:n="both"}={})=>{let r=0,a=0;"x"!==n&&"both"!==n||(r=le({overflowSize:ne(e),containerSize:e.clientWidth,elementOffset:t.offsetLeft,elementSize:t.clientWidth})),"y"!==n&&"both"!==n||(a=le({overflowSize:ae(e),containerSize:e.clientHeight,elementOffset:t.offsetTop,elementSize:t.clientHeight})),e.style.transform=`translate(${r}px, ${a}px)`},oe=e=>{const t=window.getComputedStyle(e).getPropertyValue("transform").match(/^matrix\((.+)\)$/);if(!t)return{translateX:0,translateY:0,scaleX:1,scaleY:1,skewX:0,skewY:0};const[n,r,a,l,i,o]=t[1].split(", ").map(parseFloat);return{translateX:i,translateY:o,scaleX:n,scaleY:l,skewX:a,skewY:r}},se=()=>{if("undefined"==typeof window||!window.localStorage)return!1;try{return window.localStorage.getItem("__non_existing_key__"),!0}catch{return!1}},ce=()=>{if(!se())return{readable:!1,writable:!1};try{const e="__test_write__";return window.localStorage.setItem(e,"1"),window.localStorage.removeItem(e),{readable:!0,writable:!0}}catch{}return{readable:!0,writable:!1}},ue=e=>e instanceof File,he=e=>{if(!e)return[];const t=[];for(let n=0;n<e.length;n++)t.push(e[n]);return t},fe=(e,t)=>new File([e],t,{type:e.type}),de=async(e,{skipFiles:t=[".DS_Store","Thumbs.db","desktop.ini","ehthumbs.db",".Spotlight-V100",".Trashes",".fseventsd","__MACOSX"]}={})=>{const n=new Set(t),r=await(async e=>{const t=e.createReader(),n=async()=>new Promise((e,r)=>{t.readEntries(async t=>{if(t.length)try{const r=await n();e([...t,...r])}catch(e){r(e)}else e([])},r)});return n()})(e);return(await W(r,async e=>e.isDirectory?de(e,{skipFiles:t}):n.has(e.name)?[]:[await new Promise((t,n)=>{e.file(t,n)})])).flat()},me=async(e,t={})=>{const n=e?.items;if(!n)return[];const r=[];for(let e=0;e<n.length;e++){const a=n[e];if("webkitGetAsEntry"in a){const e=a.webkitGetAsEntry?.();if(e?.isDirectory){r.push(de(e,t));continue}if(e?.isFile){r.push(new Promise((t,n)=>e.file(e=>t([e]),n)));continue}}const l=a.getAsFile();l&&r.push(Promise.resolve([l]))}return(await Promise.all(r)).flat()},pe=(e,...t)=>"function"==typeof e?e(...t):e,ge=({delta:e,value:t,min:n,max:r})=>{if(0===e)return null;const a=t+e;return e<0?t<=n?null:Math.max(a,n):e>0?t>=r?null:Math.min(a,r):null},ye=({value:e,min:t,max:n,velocityPxMs:r,deltaTimeMs:a,friction:l=.002,minVelocityPxMs:i=.01,emaAlpha:o=.2})=>{if(Math.abs(r)<i)return null;const s=ge({delta:r*a,value:e,min:t,max:n});if(null===s)return null;const c=r*Math.exp(-l*a),u=o>0?r*(1-o)+c*o:c;return Math.abs(u)<i?null:{value:s,velocityPxMs:u}},we=()=>`${Math.floor(1e3*performance.now()).toString(36)}${Math.random().toString(36).slice(2,10)}`,be=(e,t)=>Math.max(0,Math.min(e.right,t.right)-Math.max(e.left,t.left))*Math.max(0,Math.min(e.bottom,t.bottom)-Math.max(e.top,t.top))/(t.width*t.height),xe=(e,t,{allowFallback:n=!0,invert:r=!0}={})=>{const a=r?-1:1;switch(t){case"x":return{deltaX:a*(0!==e.deltaX?e.deltaX:n?e.deltaY:0),deltaY:0};case"y":return{deltaX:0,deltaY:a*e.deltaY};default:return{deltaX:a*e.deltaX,deltaY:a*e.deltaY}}},Me=(e,t,n,r)=>{const a=n-e,l=r-t;return Math.hypot(a,l)},Se=(e,t)=>Math.abs(e/t),Ae=(e,t)=>e*t/100,ve=e=>{let t=5381;for(let n=0;n<e.length;n++)t=33*t^e.charCodeAt(n);return(t>>>0).toString(36)},Ce=e=>Object.entries(e).reduce((e,[t,n])=>(void 0!==n&&(e[t]=n),e),{}),Ie=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),ke=e=>{const t=e.charAt(0),n=e.slice(1);return t.toLowerCase()+n.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)},Ee=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1 $2"),Le=e=>0===e.length?[]:e.split(" ").filter(Boolean),Pe=e=>""===e||u(e),Oe=e=>{const t=e.lastIndexOf(".");return t<=0||t===e.length-1?[e,""]:[e.slice(0,t),e.slice(t+1).toLowerCase()]},Te=(e,t)=>{if(0===e.length)return[];const n=t.charCodeAt(0),r=[];for(let t=0;t<e.length;t++)e.charCodeAt(t)===n&&r.push(t);return r},Xe=(e,t,n)=>{if(0===e.length)return;const r=e.length;for(let a=0;a<r;a++){const l=e[a],i={charIndex:a,prevChar:a>0?e[a-1]:null,nextChar:a<r-1?e[a+1]:null};n?.(l,i)||t(l,i)}},_e=(e,t=1/0)=>0===e.length?"":Le(e).slice(0,t).map(e=>e[0]).join("").toUpperCase(),ze=(e,t,n,r=[],a=void 0,l=0)=>(e?.forEach(e=>{const{[n]:i,...o}=e,s=e[n],c=Array.isArray(s);if(r.push({...o,parentId:a,depthLevel:l,childCount:c?s.length:0}),c){const a=e[t];ze(s,t,n,r,a,l+1)}}),r),Ye=(e,t,n)=>e.filter(e=>e.parentId===t&&(!n||n(e))),Re=(e,t,n,r)=>{const a=Le(r.toLowerCase());if(!a.length)return e;const l=e.reduce((e,n,r)=>(e[n[t]]=r,e),{});return e.reduce((r,i)=>{const o=i[n];if(!o)return r;if(r.some(e=>e[t]===i[t]))return r;const u=Le(o.toLowerCase());if(a.every(e=>u.some(t=>t.startsWith(e))))if(f(i.parentId)){r.push(i);const n=a=>{a.childCount&&e.forEach(e=>{e.parentId===a[t]&&(r.push(e),n(e))})};n(i)}else{const t=n=>{const a=l[n.parentId],i=e[a];f(i.parentId)||t(i);const o=r.length?r[r.length-1].parentId:null;(c(o)||o!==n.parentId)&&(s(i,"[@react-hive/honey-utils]: Parent node was not found."),r.push(i))};t(i),r.push(i)}return r},[])};
|
|
8025
8035
|
//# sourceMappingURL=index.mjs.map
|
|
8026
8036
|
|
|
8027
8037
|
/***/ },
|
|
@@ -10888,7 +10898,7 @@ module.exports = throttle;
|
|
|
10888
10898
|
exports.useFormStatus = function () {
|
|
10889
10899
|
return resolveDispatcher().useHostTransitionStatus();
|
|
10890
10900
|
};
|
|
10891
|
-
exports.version = "19.2.
|
|
10901
|
+
exports.version = "19.2.4";
|
|
10892
10902
|
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
|
|
10893
10903
|
"function" ===
|
|
10894
10904
|
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
|
|
@@ -12433,7 +12443,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
12433
12443
|
/* harmony export */ });
|
|
12434
12444
|
/* harmony import */ var _react_hive_honey_style__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @react-hive/honey-style */ "@react-hive/honey-style");
|
|
12435
12445
|
/* harmony import */ var _react_hive_honey_style__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_react_hive_honey_style__WEBPACK_IMPORTED_MODULE_0__);
|
|
12436
|
-
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*!
|
|
12446
|
+
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ~/helpers */ "./src/helpers/index.ts");
|
|
12437
12447
|
/* harmony import */ var _HoneyFlex__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../HoneyFlex */ "./src/components/HoneyFlex/index.ts");
|
|
12438
12448
|
|
|
12439
12449
|
|
|
@@ -12444,12 +12454,15 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
12444
12454
|
* and the spacing between columns.
|
|
12445
12455
|
*/
|
|
12446
12456
|
const HoneyGridColumnStyled = (0,_react_hive_honey_style__WEBPACK_IMPORTED_MODULE_0__.styled)((0,_HoneyFlex__WEBPACK_IMPORTED_MODULE_2__.HoneyFlex)) `
|
|
12447
|
-
${({ columns, takeColumns = 1, spacing = 0, applyMaxWidth, theme }) => {
|
|
12448
|
-
|
|
12449
|
-
|
|
12450
|
-
|
|
12451
|
-
|
|
12452
|
-
|
|
12457
|
+
${({ columns, takeColumns = 1, spacing = 0, applyMaxWidth, applyBasis = true, theme }) => {
|
|
12458
|
+
let columnWidth = null;
|
|
12459
|
+
if (applyBasis) {
|
|
12460
|
+
const fractionalWidth = 100 / columns;
|
|
12461
|
+
const columnSpacing = (0,_react_hive_honey_style__WEBPACK_IMPORTED_MODULE_0__.resolveSpacing)(spacing, null)({ theme });
|
|
12462
|
+
const columnWidthPercent = takeColumns * fractionalWidth;
|
|
12463
|
+
const columnGap = (columns - takeColumns) * (columnSpacing / columns);
|
|
12464
|
+
columnWidth = `calc(${columnWidthPercent}% - ${columnGap}px)`;
|
|
12465
|
+
}
|
|
12453
12466
|
return (0,_react_hive_honey_style__WEBPACK_IMPORTED_MODULE_0__.css) `
|
|
12454
12467
|
flex-basis: ${columnWidth};
|
|
12455
12468
|
|
|
@@ -12486,6 +12499,177 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
12486
12499
|
|
|
12487
12500
|
|
|
12488
12501
|
|
|
12502
|
+
/***/ },
|
|
12503
|
+
|
|
12504
|
+
/***/ "./src/components/HoneyLayerRegistry/HoneyLayerRegistry.tsx"
|
|
12505
|
+
/*!******************************************************************!*\
|
|
12506
|
+
!*** ./src/components/HoneyLayerRegistry/HoneyLayerRegistry.tsx ***!
|
|
12507
|
+
\******************************************************************/
|
|
12508
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
12509
|
+
|
|
12510
|
+
"use strict";
|
|
12511
|
+
__webpack_require__.r(__webpack_exports__);
|
|
12512
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
12513
|
+
/* harmony export */ HoneyLayerRegistry: () => (/* binding */ HoneyLayerRegistry)
|
|
12514
|
+
/* harmony export */ });
|
|
12515
|
+
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
|
|
12516
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
|
|
12517
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
|
|
12518
|
+
/* harmony import */ var _react_hive_honey_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @react-hive/honey-utils */ "./node_modules/@react-hive/honey-utils/dist/index.mjs");
|
|
12519
|
+
/* harmony import */ var _HoneyLayerRegistryContext__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./HoneyLayerRegistryContext */ "./src/components/HoneyLayerRegistry/HoneyLayerRegistryContext.ts");
|
|
12520
|
+
|
|
12521
|
+
|
|
12522
|
+
|
|
12523
|
+
|
|
12524
|
+
/**
|
|
12525
|
+
* Provides a stack-based registry for managing layered UI elements.
|
|
12526
|
+
*
|
|
12527
|
+
* This component is intentionally generic and UI-agnostic.
|
|
12528
|
+
* It can be used to manage:
|
|
12529
|
+
* - curtains
|
|
12530
|
+
* - modals
|
|
12531
|
+
* - drawers
|
|
12532
|
+
* - tooltips
|
|
12533
|
+
* - popovers
|
|
12534
|
+
* - any ordered overlay system
|
|
12535
|
+
*
|
|
12536
|
+
* If a parent {@link HoneyLayerRegistry} already exists in the tree,
|
|
12537
|
+
* this component becomes a no-op and does not create a nested registry.
|
|
12538
|
+
*/
|
|
12539
|
+
const HoneyLayerRegistry = ({ children }) => {
|
|
12540
|
+
const parentRegistry = (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(_HoneyLayerRegistryContext__WEBPACK_IMPORTED_MODULE_3__.HoneyLayerRegistryContext);
|
|
12541
|
+
const [layers, setLayers] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]);
|
|
12542
|
+
const contextValue = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => ({
|
|
12543
|
+
layers,
|
|
12544
|
+
registerLayer: payload => {
|
|
12545
|
+
const layerId = (0,_react_hive_honey_utils__WEBPACK_IMPORTED_MODULE_2__.generateEphemeralId)();
|
|
12546
|
+
setLayers(layers => [
|
|
12547
|
+
...layers,
|
|
12548
|
+
{
|
|
12549
|
+
id: layerId,
|
|
12550
|
+
payload,
|
|
12551
|
+
},
|
|
12552
|
+
]);
|
|
12553
|
+
return layerId;
|
|
12554
|
+
},
|
|
12555
|
+
unregisterLayer: layerId => {
|
|
12556
|
+
setLayers(layers => layers.filter(layer => layer.id !== layerId));
|
|
12557
|
+
},
|
|
12558
|
+
getLayerIndex: layerId => layers.findIndex(layer => layer.id === layerId),
|
|
12559
|
+
}), [layers]);
|
|
12560
|
+
if (parentRegistry) {
|
|
12561
|
+
// Prevent multiple registries in the same subtree
|
|
12562
|
+
return children;
|
|
12563
|
+
}
|
|
12564
|
+
return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_HoneyLayerRegistryContext__WEBPACK_IMPORTED_MODULE_3__.HoneyLayerRegistryContext, { value: contextValue, children: children });
|
|
12565
|
+
};
|
|
12566
|
+
|
|
12567
|
+
|
|
12568
|
+
/***/ },
|
|
12569
|
+
|
|
12570
|
+
/***/ "./src/components/HoneyLayerRegistry/HoneyLayerRegistry.types.ts"
|
|
12571
|
+
/*!***********************************************************************!*\
|
|
12572
|
+
!*** ./src/components/HoneyLayerRegistry/HoneyLayerRegistry.types.ts ***!
|
|
12573
|
+
\***********************************************************************/
|
|
12574
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
12575
|
+
|
|
12576
|
+
"use strict";
|
|
12577
|
+
__webpack_require__.r(__webpack_exports__);
|
|
12578
|
+
|
|
12579
|
+
|
|
12580
|
+
|
|
12581
|
+
/***/ },
|
|
12582
|
+
|
|
12583
|
+
/***/ "./src/components/HoneyLayerRegistry/HoneyLayerRegistryContext.ts"
|
|
12584
|
+
/*!************************************************************************!*\
|
|
12585
|
+
!*** ./src/components/HoneyLayerRegistry/HoneyLayerRegistryContext.ts ***!
|
|
12586
|
+
\************************************************************************/
|
|
12587
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
12588
|
+
|
|
12589
|
+
"use strict";
|
|
12590
|
+
__webpack_require__.r(__webpack_exports__);
|
|
12591
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
12592
|
+
/* harmony export */ HoneyLayerRegistryContext: () => (/* binding */ HoneyLayerRegistryContext)
|
|
12593
|
+
/* harmony export */ });
|
|
12594
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
|
|
12595
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
12596
|
+
|
|
12597
|
+
const HoneyLayerRegistryContext = (0,react__WEBPACK_IMPORTED_MODULE_0__.createContext)(undefined);
|
|
12598
|
+
|
|
12599
|
+
|
|
12600
|
+
/***/ },
|
|
12601
|
+
|
|
12602
|
+
/***/ "./src/components/HoneyLayerRegistry/hooks/index.ts"
|
|
12603
|
+
/*!**********************************************************!*\
|
|
12604
|
+
!*** ./src/components/HoneyLayerRegistry/hooks/index.ts ***!
|
|
12605
|
+
\**********************************************************/
|
|
12606
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
12607
|
+
|
|
12608
|
+
"use strict";
|
|
12609
|
+
__webpack_require__.r(__webpack_exports__);
|
|
12610
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
12611
|
+
/* harmony export */ useHoneyLayerRegistryContext: () => (/* reexport safe */ _use_honey_layer_registry_context__WEBPACK_IMPORTED_MODULE_0__.useHoneyLayerRegistryContext)
|
|
12612
|
+
/* harmony export */ });
|
|
12613
|
+
/* harmony import */ var _use_honey_layer_registry_context__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./use-honey-layer-registry-context */ "./src/components/HoneyLayerRegistry/hooks/use-honey-layer-registry-context.ts");
|
|
12614
|
+
|
|
12615
|
+
|
|
12616
|
+
|
|
12617
|
+
/***/ },
|
|
12618
|
+
|
|
12619
|
+
/***/ "./src/components/HoneyLayerRegistry/hooks/use-honey-layer-registry-context.ts"
|
|
12620
|
+
/*!*************************************************************************************!*\
|
|
12621
|
+
!*** ./src/components/HoneyLayerRegistry/hooks/use-honey-layer-registry-context.ts ***!
|
|
12622
|
+
\*************************************************************************************/
|
|
12623
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
12624
|
+
|
|
12625
|
+
"use strict";
|
|
12626
|
+
__webpack_require__.r(__webpack_exports__);
|
|
12627
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
12628
|
+
/* harmony export */ useHoneyLayerRegistryContext: () => (/* binding */ useHoneyLayerRegistryContext)
|
|
12629
|
+
/* harmony export */ });
|
|
12630
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
|
|
12631
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
12632
|
+
/* harmony import */ var _react_hive_honey_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @react-hive/honey-utils */ "./node_modules/@react-hive/honey-utils/dist/index.mjs");
|
|
12633
|
+
/* harmony import */ var _HoneyLayerRegistryContext__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../HoneyLayerRegistryContext */ "./src/components/HoneyLayerRegistry/HoneyLayerRegistryContext.ts");
|
|
12634
|
+
|
|
12635
|
+
|
|
12636
|
+
|
|
12637
|
+
/**
|
|
12638
|
+
* Hook for accessing the nearest {@link HoneyLayerRegistry}.
|
|
12639
|
+
*
|
|
12640
|
+
* @template TPayload - Expected payload type of the registry.
|
|
12641
|
+
*
|
|
12642
|
+
* @throws If used outside of a {@link HoneyLayerRegistry} provider.
|
|
12643
|
+
*/
|
|
12644
|
+
const useHoneyLayerRegistryContext = () => {
|
|
12645
|
+
const context = (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(_HoneyLayerRegistryContext__WEBPACK_IMPORTED_MODULE_2__.HoneyLayerRegistryContext);
|
|
12646
|
+
(0,_react_hive_honey_utils__WEBPACK_IMPORTED_MODULE_1__.assert)(context, 'The `useHoneyLayerRegistryContext()` hook can only be used inside <HoneyLayerRegistry/> component!');
|
|
12647
|
+
return context;
|
|
12648
|
+
};
|
|
12649
|
+
|
|
12650
|
+
|
|
12651
|
+
/***/ },
|
|
12652
|
+
|
|
12653
|
+
/***/ "./src/components/HoneyLayerRegistry/index.ts"
|
|
12654
|
+
/*!****************************************************!*\
|
|
12655
|
+
!*** ./src/components/HoneyLayerRegistry/index.ts ***!
|
|
12656
|
+
\****************************************************/
|
|
12657
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
12658
|
+
|
|
12659
|
+
"use strict";
|
|
12660
|
+
__webpack_require__.r(__webpack_exports__);
|
|
12661
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
12662
|
+
/* harmony export */ HoneyLayerRegistry: () => (/* reexport safe */ _HoneyLayerRegistry__WEBPACK_IMPORTED_MODULE_2__.HoneyLayerRegistry),
|
|
12663
|
+
/* harmony export */ useHoneyLayerRegistryContext: () => (/* reexport safe */ _hooks__WEBPACK_IMPORTED_MODULE_0__.useHoneyLayerRegistryContext)
|
|
12664
|
+
/* harmony export */ });
|
|
12665
|
+
/* harmony import */ var _hooks__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./hooks */ "./src/components/HoneyLayerRegistry/hooks/index.ts");
|
|
12666
|
+
/* harmony import */ var _HoneyLayerRegistry_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./HoneyLayerRegistry.types */ "./src/components/HoneyLayerRegistry/HoneyLayerRegistry.types.ts");
|
|
12667
|
+
/* harmony import */ var _HoneyLayerRegistry__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./HoneyLayerRegistry */ "./src/components/HoneyLayerRegistry/HoneyLayerRegistry.tsx");
|
|
12668
|
+
|
|
12669
|
+
|
|
12670
|
+
|
|
12671
|
+
|
|
12672
|
+
|
|
12489
12673
|
/***/ },
|
|
12490
12674
|
|
|
12491
12675
|
/***/ "./src/components/HoneyLazyContent/HoneyLazyContent.tsx"
|
|
@@ -12680,8 +12864,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
12680
12864
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
|
|
12681
12865
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
|
|
12682
12866
|
/* harmony import */ var _react_hive_honey_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @react-hive/honey-utils */ "./node_modules/@react-hive/honey-utils/dist/index.mjs");
|
|
12683
|
-
/* harmony import */ var _hooks__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*!
|
|
12684
|
-
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*!
|
|
12867
|
+
/* harmony import */ var _hooks__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ~/hooks */ "./src/hooks/index.ts");
|
|
12868
|
+
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ~/helpers */ "./src/helpers/index.ts");
|
|
12685
12869
|
/* harmony import */ var _HoneyFlex__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./HoneyFlex */ "./src/components/HoneyFlex/index.ts");
|
|
12686
12870
|
|
|
12687
12871
|
|
|
@@ -12790,12 +12974,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
12790
12974
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
|
|
12791
12975
|
/* harmony import */ var _floating_ui_react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @floating-ui/react */ "./node_modules/@floating-ui/react/dist/floating-ui.react.mjs");
|
|
12792
12976
|
/* harmony import */ var _react_hive_honey_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @react-hive/honey-utils */ "./node_modules/@react-hive/honey-utils/dist/index.mjs");
|
|
12793
|
-
/* harmony import */ var
|
|
12794
|
-
/* harmony import */ var
|
|
12795
|
-
/* harmony import */ var
|
|
12796
|
-
/* harmony import */ var
|
|
12797
|
-
/* harmony import */ var _hooks__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./hooks */ "./src/components/HoneyPopup/hooks/index.ts");
|
|
12798
|
-
|
|
12977
|
+
/* harmony import */ var _components__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ~/components */ "./src/components/index.ts");
|
|
12978
|
+
/* harmony import */ var _HoneyPopupStyled__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./HoneyPopupStyled */ "./src/components/HoneyPopup/HoneyPopupStyled.ts");
|
|
12979
|
+
/* harmony import */ var _HoneyPopupPortal__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./HoneyPopupPortal */ "./src/components/HoneyPopup/HoneyPopupPortal.tsx");
|
|
12980
|
+
/* harmony import */ var _hooks__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./hooks */ "./src/components/HoneyPopup/hooks/index.ts");
|
|
12799
12981
|
|
|
12800
12982
|
|
|
12801
12983
|
|
|
@@ -12806,7 +12988,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
12806
12988
|
|
|
12807
12989
|
const HoneyPopupContent = ({ children, referenceProps, content, contentProps, focusManagerProps, arrowProps, portalProps, adjustStyles, context, ...popupOptions }) => {
|
|
12808
12990
|
const { useArrow, onClose } = popupOptions;
|
|
12809
|
-
const { nodeId, floating, isOpen, arrowRef, interactions, transition } = (0,
|
|
12991
|
+
const { nodeId, floating, isOpen, arrowRef, interactions, transition } = (0,_hooks__WEBPACK_IMPORTED_MODULE_7__.useHoneyPopup)(popupOptions);
|
|
12810
12992
|
const handleDeactivateOverlay = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(() => {
|
|
12811
12993
|
onClose?.('escape-key');
|
|
12812
12994
|
}, [onClose]);
|
|
@@ -12814,7 +12996,7 @@ const HoneyPopupContent = ({ children, referenceProps, content, contentProps, fo
|
|
|
12814
12996
|
context,
|
|
12815
12997
|
floatingContext: floating.context,
|
|
12816
12998
|
}), [context, floating.context]);
|
|
12817
|
-
return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
|
|
12999
|
+
return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_HoneyPopupStyled__WEBPACK_IMPORTED_MODULE_5__.HoneyPopupStyled, { ref: floating.refs.setReference, ...interactions.getReferenceProps(), ...referenceProps, "data-testid": "honey-popup", children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_components__WEBPACK_IMPORTED_MODULE_4__.HoneyPopupContext, { value: popupContext, children: [(0,_react_hive_honey_utils__WEBPACK_IMPORTED_MODULE_3__.invokeIfFunction)(children, popupContext), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_floating_ui_react__WEBPACK_IMPORTED_MODULE_2__.FloatingNode, { id: nodeId, children: transition.isMounted && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_HoneyPopupPortal__WEBPACK_IMPORTED_MODULE_6__.HoneyPopupPortal, { ...portalProps, children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_floating_ui_react__WEBPACK_IMPORTED_MODULE_2__.FloatingFocusManager, { context: floating.context, disabled: !isOpen, ...focusManagerProps, children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_components__WEBPACK_IMPORTED_MODULE_4__.HoneyOverlay, { ref: floating.refs.setFloating, active: isOpen, style: adjustStyles?.({
|
|
12818
13000
|
...floating.floatingStyles,
|
|
12819
13001
|
...transition.styles,
|
|
12820
13002
|
}, {
|
|
@@ -12957,12 +13139,12 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
12957
13139
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
|
|
12958
13140
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
12959
13141
|
/* harmony import */ var _react_hive_honey_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @react-hive/honey-utils */ "./node_modules/@react-hive/honey-utils/dist/index.mjs");
|
|
12960
|
-
/* harmony import */ var
|
|
13142
|
+
/* harmony import */ var _components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ~/components */ "./src/components/index.ts");
|
|
12961
13143
|
|
|
12962
13144
|
|
|
12963
13145
|
|
|
12964
13146
|
const useHoneyPopupContext = () => {
|
|
12965
|
-
const context = (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(
|
|
13147
|
+
const context = (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(_components__WEBPACK_IMPORTED_MODULE_2__.HoneyPopupContext);
|
|
12966
13148
|
(0,_react_hive_honey_utils__WEBPACK_IMPORTED_MODULE_1__.assert)(context, 'The `useHoneyPopupContext()` hook can only be used inside <HoneyPopup/> component!');
|
|
12967
13149
|
return context;
|
|
12968
13150
|
};
|
|
@@ -13027,7 +13209,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
13027
13209
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
|
|
13028
13210
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
13029
13211
|
/* harmony import */ var _floating_ui_react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @floating-ui/react */ "./node_modules/@floating-ui/react/dist/floating-ui.react.mjs");
|
|
13030
|
-
/* harmony import */ var _floating_ui_react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @floating-ui/react */ "./node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs");
|
|
13212
|
+
/* harmony import */ var _floating_ui_react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @floating-ui/react */ "./node_modules/@floating-ui/react-dom/node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs");
|
|
13031
13213
|
/* harmony import */ var _floating_ui_react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @floating-ui/react */ "./node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.mjs");
|
|
13032
13214
|
/* harmony import */ var _react_hive_honey_utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @react-hive/honey-utils */ "./node_modules/@react-hive/honey-utils/dist/index.mjs");
|
|
13033
13215
|
/* harmony import */ var _hooks__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../hooks */ "./src/hooks/index.ts");
|
|
@@ -13265,6 +13447,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
13265
13447
|
/* harmony export */ HoneyGrid: () => (/* reexport safe */ _HoneyGrid__WEBPACK_IMPORTED_MODULE_2__.HoneyGrid),
|
|
13266
13448
|
/* harmony export */ HoneyGridColumn: () => (/* reexport safe */ _HoneyGridColumn__WEBPACK_IMPORTED_MODULE_3__.HoneyGridColumn),
|
|
13267
13449
|
/* harmony export */ HoneyGridColumnStyled: () => (/* reexport safe */ _HoneyGridColumn__WEBPACK_IMPORTED_MODULE_3__.HoneyGridColumnStyled),
|
|
13450
|
+
/* harmony export */ HoneyLayerRegistry: () => (/* reexport safe */ _HoneyLayerRegistry__WEBPACK_IMPORTED_MODULE_10__.HoneyLayerRegistry),
|
|
13268
13451
|
/* harmony export */ HoneyLazyContent: () => (/* reexport safe */ _HoneyLazyContent__WEBPACK_IMPORTED_MODULE_6__.HoneyLazyContent),
|
|
13269
13452
|
/* harmony export */ HoneyList: () => (/* reexport safe */ _HoneyList__WEBPACK_IMPORTED_MODULE_4__.HoneyList),
|
|
13270
13453
|
/* harmony export */ HoneyOverlay: () => (/* reexport safe */ _HoneyOverlay__WEBPACK_IMPORTED_MODULE_7__.HoneyOverlay),
|
|
@@ -13273,6 +13456,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
13273
13456
|
/* harmony export */ HoneyStatusContent: () => (/* reexport safe */ _HoneyStatusContent__WEBPACK_IMPORTED_MODULE_5__.HoneyStatusContent),
|
|
13274
13457
|
/* harmony export */ getHoneyListItemId: () => (/* reexport safe */ _HoneyList__WEBPACK_IMPORTED_MODULE_4__.getHoneyListItemId),
|
|
13275
13458
|
/* harmony export */ useHoneyGridContext: () => (/* reexport safe */ _HoneyGrid__WEBPACK_IMPORTED_MODULE_2__.useHoneyGridContext),
|
|
13459
|
+
/* harmony export */ useHoneyLayerRegistryContext: () => (/* reexport safe */ _HoneyLayerRegistry__WEBPACK_IMPORTED_MODULE_10__.useHoneyLayerRegistryContext),
|
|
13276
13460
|
/* harmony export */ useHoneyPopup: () => (/* reexport safe */ _HoneyPopup__WEBPACK_IMPORTED_MODULE_8__.useHoneyPopup),
|
|
13277
13461
|
/* harmony export */ useHoneyPopupContext: () => (/* reexport safe */ _HoneyPopup__WEBPACK_IMPORTED_MODULE_8__.useHoneyPopupContext)
|
|
13278
13462
|
/* harmony export */ });
|
|
@@ -13286,6 +13470,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
13286
13470
|
/* harmony import */ var _HoneyOverlay__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./HoneyOverlay */ "./src/components/HoneyOverlay.tsx");
|
|
13287
13471
|
/* harmony import */ var _HoneyPopup__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./HoneyPopup */ "./src/components/HoneyPopup/index.ts");
|
|
13288
13472
|
/* harmony import */ var _HoneyContextMenu__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./HoneyContextMenu */ "./src/components/HoneyContextMenu/index.ts");
|
|
13473
|
+
/* harmony import */ var _HoneyLayerRegistry__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./HoneyLayerRegistry */ "./src/components/HoneyLayerRegistry/index.ts");
|
|
13474
|
+
|
|
13289
13475
|
|
|
13290
13476
|
|
|
13291
13477
|
|
|
@@ -13555,7 +13741,7 @@ const hasBreakpointStyles = (breakpoint, props) => Object.entries(props).some(([
|
|
|
13555
13741
|
const bpMedia = (breakpoint, ruleOptions = {}) => {
|
|
13556
13742
|
const resolveBpValue = (theme) => {
|
|
13557
13743
|
const value = theme.breakpoints[breakpoint];
|
|
13558
|
-
(0,_react_hive_honey_utils__WEBPACK_IMPORTED_MODULE_1__.assert)(value, `[honey-layout]: Setup for breakpoint "${breakpoint}" was not found.`);
|
|
13744
|
+
(0,_react_hive_honey_utils__WEBPACK_IMPORTED_MODULE_1__.assert)(value, `[@react-hive/honey-layout]: Setup for breakpoint "${breakpoint}" was not found.`);
|
|
13559
13745
|
return value;
|
|
13560
13746
|
};
|
|
13561
13747
|
const down = ({ theme }) => (0,_react_hive_honey_style__WEBPACK_IMPORTED_MODULE_0__.mediaQuery)([
|
|
@@ -14983,16 +15169,16 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
14983
15169
|
/**
|
|
14984
15170
|
* A hook for registering and managing an overlay in the layout system.
|
|
14985
15171
|
*
|
|
14986
|
-
* @param
|
|
15172
|
+
* @param shouldRegister - A flag indicating whether the overlay should be registered.
|
|
14987
15173
|
* @param overlayConfig - Configuration object specifying overlay behavior.
|
|
14988
15174
|
*
|
|
14989
15175
|
* @returns The registered overlay instance, or null if not registered.
|
|
14990
15176
|
*/
|
|
14991
|
-
const useRegisterHoneyOverlay = (
|
|
15177
|
+
const useRegisterHoneyOverlay = (shouldRegister, overlayConfig) => {
|
|
14992
15178
|
const { registerOverlay, unregisterOverlay } = (0,_hooks__WEBPACK_IMPORTED_MODULE_1__.useHoneyLayout)();
|
|
14993
15179
|
const overlayRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
|
|
14994
15180
|
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
|
|
14995
|
-
if (!
|
|
15181
|
+
if (!shouldRegister) {
|
|
14996
15182
|
return;
|
|
14997
15183
|
}
|
|
14998
15184
|
const overlay = registerOverlay(overlayConfig);
|
|
@@ -15001,7 +15187,7 @@ const useRegisterHoneyOverlay = (isRegister, overlayConfig) => {
|
|
|
15001
15187
|
overlayRef.current = null;
|
|
15002
15188
|
unregisterOverlay(overlay.id);
|
|
15003
15189
|
};
|
|
15004
|
-
}, [
|
|
15190
|
+
}, [shouldRegister, overlayConfig.onKeyUp]);
|
|
15005
15191
|
return overlayRef.current;
|
|
15006
15192
|
};
|
|
15007
15193
|
|
|
@@ -15024,8 +15210,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
15024
15210
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
|
|
15025
15211
|
/* harmony import */ var _react_hive_honey_style__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @react-hive/honey-style */ "@react-hive/honey-style");
|
|
15026
15212
|
/* harmony import */ var _react_hive_honey_style__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_react_hive_honey_style__WEBPACK_IMPORTED_MODULE_2__);
|
|
15027
|
-
/* harmony import */ var _hooks__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*!
|
|
15028
|
-
/* harmony import */ var _contexts__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*!
|
|
15213
|
+
/* harmony import */ var _hooks__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ~/hooks */ "./src/hooks/index.ts");
|
|
15214
|
+
/* harmony import */ var _contexts__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ~/contexts */ "./src/contexts/index.ts");
|
|
15029
15215
|
/* harmony import */ var _hooks__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./hooks */ "./src/providers/hooks/index.ts");
|
|
15030
15216
|
|
|
15031
15217
|
|
|
@@ -15067,7 +15253,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
15067
15253
|
/* harmony import */ var lodash_merge__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash_merge__WEBPACK_IMPORTED_MODULE_2__);
|
|
15068
15254
|
/* harmony import */ var _react_hive_honey_style__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @react-hive/honey-style */ "@react-hive/honey-style");
|
|
15069
15255
|
/* harmony import */ var _react_hive_honey_style__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_react_hive_honey_style__WEBPACK_IMPORTED_MODULE_3__);
|
|
15070
|
-
/* harmony import */ var _contexts__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*!
|
|
15256
|
+
/* harmony import */ var _contexts__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ~/contexts */ "./src/contexts/index.ts");
|
|
15071
15257
|
|
|
15072
15258
|
|
|
15073
15259
|
|
|
@@ -15120,7 +15306,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
15120
15306
|
/* harmony export */ });
|
|
15121
15307
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
|
|
15122
15308
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
15123
|
-
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*!
|
|
15309
|
+
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ~/helpers */ "./src/helpers/index.ts");
|
|
15124
15310
|
|
|
15125
15311
|
|
|
15126
15312
|
/**
|
|
@@ -15318,196 +15504,6 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
15318
15504
|
|
|
15319
15505
|
|
|
15320
15506
|
|
|
15321
|
-
/***/ },
|
|
15322
|
-
|
|
15323
|
-
/***/ "./src/utils/data-utils.ts"
|
|
15324
|
-
/*!*********************************!*\
|
|
15325
|
-
!*** ./src/utils/data-utils.ts ***!
|
|
15326
|
-
\*********************************/
|
|
15327
|
-
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
15328
|
-
|
|
15329
|
-
"use strict";
|
|
15330
|
-
__webpack_require__.r(__webpack_exports__);
|
|
15331
|
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
15332
|
-
/* harmony export */ filterFlattenedItems: () => (/* binding */ filterFlattenedItems),
|
|
15333
|
-
/* harmony export */ flattenNestedList: () => (/* binding */ flattenNestedList),
|
|
15334
|
-
/* harmony export */ searchFlattenedItems: () => (/* binding */ searchFlattenedItems)
|
|
15335
|
-
/* harmony export */ });
|
|
15336
|
-
/* harmony import */ var _react_hive_honey_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @react-hive/honey-utils */ "./node_modules/@react-hive/honey-utils/dist/index.mjs");
|
|
15337
|
-
|
|
15338
|
-
/**
|
|
15339
|
-
* Recursively converts a nested list structure into a flat list. It excludes the nested list key from the result
|
|
15340
|
-
* while adding hierarchical metadata, such as `depthLevel`, `parentId`, and `totalNestedItems` to each flattened item.
|
|
15341
|
-
*
|
|
15342
|
-
* This function is useful for flattening deeply nested tree-like structures (e.g., categories, folders)
|
|
15343
|
-
* while preserving their relationships and depth levels in the hierarchy.
|
|
15344
|
-
*
|
|
15345
|
-
* @template OriginItem - The type of the items in the nested list.
|
|
15346
|
-
*
|
|
15347
|
-
* @param items - The array of items to be flattened. If undefined, it returns an empty array.
|
|
15348
|
-
* @param itemIdKey - The key in each item that uniquely identifies it (e.g., 'id').
|
|
15349
|
-
* @param nestedItemsKey - The key in each item that contains the nested items or list (e.g., 'children').
|
|
15350
|
-
* @param flattenedItemsResult - An array that accumulates the flattened items. Defaults to an empty array.
|
|
15351
|
-
* @param parentId - Optional. The ID of the parent item in the flattened structure. Defaults to undefined for top-level items.
|
|
15352
|
-
* @param depthLevel - Optional. The current depth level of the item in the nested structure. Defaults to 0 for top-level items.
|
|
15353
|
-
*
|
|
15354
|
-
* @returns A flat array of items, where the nested list key is removed, and each item includes:
|
|
15355
|
-
* - `parentId`: ID of its parent item in the flattened structure (undefined for top-level items).
|
|
15356
|
-
* - `depthLevel`: The depth level of the item in the hierarchy, with 0 being the top-level.
|
|
15357
|
-
* - `totalNestedItems`: The total number of direct child items within the current item (defaults to 0 for leaf nodes).
|
|
15358
|
-
*
|
|
15359
|
-
* @example
|
|
15360
|
-
* ```ts
|
|
15361
|
-
* const nestedData = [
|
|
15362
|
-
* { id: 1, name: 'Item 1', children: [{ id: 2, name: 'Item 1.1' }] },
|
|
15363
|
-
* { id: 3, name: 'Item 2', children: [] },
|
|
15364
|
-
* ];
|
|
15365
|
-
*
|
|
15366
|
-
* const flatList = flattenNestedList(nestedData, 'id', 'children');
|
|
15367
|
-
*
|
|
15368
|
-
* // Output:
|
|
15369
|
-
* // [
|
|
15370
|
-
* // { id: 1, name: 'Item 1', parentId: undefined, depthLevel: 0, totalNestedItems: 1 },
|
|
15371
|
-
* // { id: 2, name: 'Item 1.1', parentId: 1, depthLevel: 1, totalNestedItems: 0 },
|
|
15372
|
-
* // { id: 3, name: 'Item 2', parentId: undefined, depthLevel: 0, totalNestedItems: 0 }
|
|
15373
|
-
* // ]
|
|
15374
|
-
* ```
|
|
15375
|
-
*/
|
|
15376
|
-
const flattenNestedList = (items, itemIdKey, nestedItemsKey,
|
|
15377
|
-
///
|
|
15378
|
-
flattenedItemsResult = [], parentId = undefined, depthLevel = 0) => {
|
|
15379
|
-
items?.forEach(item => {
|
|
15380
|
-
const { [nestedItemsKey]: _, ...itemWithoutNestedListKey } = item;
|
|
15381
|
-
const nestedItems = item[nestedItemsKey];
|
|
15382
|
-
const isNestedItemArray = Array.isArray(nestedItems);
|
|
15383
|
-
flattenedItemsResult.push({
|
|
15384
|
-
...itemWithoutNestedListKey,
|
|
15385
|
-
parentId,
|
|
15386
|
-
depthLevel,
|
|
15387
|
-
totalNestedItems: isNestedItemArray ? nestedItems.length : 0,
|
|
15388
|
-
});
|
|
15389
|
-
if (isNestedItemArray) {
|
|
15390
|
-
const parentId = item[itemIdKey];
|
|
15391
|
-
flattenNestedList(nestedItems, itemIdKey, nestedItemsKey, flattenedItemsResult, parentId, depthLevel + 1);
|
|
15392
|
-
}
|
|
15393
|
-
});
|
|
15394
|
-
return flattenedItemsResult;
|
|
15395
|
-
};
|
|
15396
|
-
/**
|
|
15397
|
-
* Filters a list of flattened items based on a specified parent ID and an optional predicate function.
|
|
15398
|
-
*
|
|
15399
|
-
* This utility is useful for extracting items that share the same parent in a flattened hierarchical
|
|
15400
|
-
* structure, such as categories or tree-like data. Optionally, it allows further filtering through a
|
|
15401
|
-
* custom predicate function.
|
|
15402
|
-
*
|
|
15403
|
-
* @template OriginItem - The type of the items in the flattened list.
|
|
15404
|
-
* @template NestedListKey - The key within `OriginItem` that contains nested items or lists.
|
|
15405
|
-
*
|
|
15406
|
-
* @param flattenedItems - The array of flattened items to filter, which contains items with hierarchical metadata.
|
|
15407
|
-
* @param parentId - The parent ID to filter the items by. Only items with this parent ID will be included in the result.
|
|
15408
|
-
* @param predicate - Optional. A custom function to apply additional filtering logic on items that match the parent ID.
|
|
15409
|
-
*
|
|
15410
|
-
* @returns An array of flattened items that match the specified `parentId`, and if provided, the `predicate` function.
|
|
15411
|
-
*
|
|
15412
|
-
* @example
|
|
15413
|
-
* ```ts
|
|
15414
|
-
* const filteredItems = filterFlattenedItems(flatList, 1, item => item.depthLevel > 1);
|
|
15415
|
-
*
|
|
15416
|
-
* // This would return items with `parentId` equal to 1, and where `depthLevel` is greater than 1.
|
|
15417
|
-
* ```
|
|
15418
|
-
*/
|
|
15419
|
-
const filterFlattenedItems = (flattenedItems, parentId, predicate) => flattenedItems.filter(flattenedItem => flattenedItem.parentId === parentId && (!predicate || predicate(flattenedItem)));
|
|
15420
|
-
/**
|
|
15421
|
-
* Searches through a list of flattened items to find matches based on a search query.
|
|
15422
|
-
* This function considers both the items themselves and their parents in the hierarchy, ensuring that
|
|
15423
|
-
* any matching items and their respective parents are included in the result.
|
|
15424
|
-
*
|
|
15425
|
-
* The search is case-insensitive and can handle partial matches, making it useful for dynamic filtering
|
|
15426
|
-
* of hierarchical data such as categories or trees.
|
|
15427
|
-
*
|
|
15428
|
-
* @template OriginItem - The type of the original item.
|
|
15429
|
-
* @template NestedListKey - The key within `OriginItem` that contains nested items or lists.
|
|
15430
|
-
*
|
|
15431
|
-
* @param flattenedItems - The array of flattened items to search through, which may include hierarchical metadata.
|
|
15432
|
-
* @param itemIdKey - The key used to uniquely identify each item (e.g., 'id').
|
|
15433
|
-
* @param valueKey - The key in each item that contains the value to be searched (e.g., 'name').
|
|
15434
|
-
* @param searchQuery - The query string used to filter items. Supports partial matches.
|
|
15435
|
-
*
|
|
15436
|
-
* @returns An array of matched flattened items, including their parent items if applicable.
|
|
15437
|
-
*
|
|
15438
|
-
* @example
|
|
15439
|
-
* ```ts
|
|
15440
|
-
* const searchResults = searchFlattenedItems(flatList, 'id', 'name', 'search term');
|
|
15441
|
-
*
|
|
15442
|
-
* // This will return items where the 'name' field matches the search term,
|
|
15443
|
-
* // including any relevant parent items in the hierarchy.
|
|
15444
|
-
* ```
|
|
15445
|
-
*/
|
|
15446
|
-
const searchFlattenedItems = (flattenedItems, itemIdKey, valueKey, searchQuery) => {
|
|
15447
|
-
const searchWords = (0,_react_hive_honey_utils__WEBPACK_IMPORTED_MODULE_0__.splitStringIntoWords)(searchQuery.toLowerCase());
|
|
15448
|
-
if (!searchWords.length) {
|
|
15449
|
-
return flattenedItems;
|
|
15450
|
-
}
|
|
15451
|
-
const itemIdToIndexMap = flattenedItems.reduce((result, flattenedItem, flattenedItemIndex) => {
|
|
15452
|
-
// Item ID -> Item index
|
|
15453
|
-
result[flattenedItem[itemIdKey]] = flattenedItemIndex;
|
|
15454
|
-
return result;
|
|
15455
|
-
}, {});
|
|
15456
|
-
return flattenedItems.reduce((matchedFlattenedItems, flattenedItem) => {
|
|
15457
|
-
const flattenedItemValue = flattenedItem[valueKey];
|
|
15458
|
-
// If item value is null, undefined or empty string
|
|
15459
|
-
if (!flattenedItemValue) {
|
|
15460
|
-
return matchedFlattenedItems;
|
|
15461
|
-
}
|
|
15462
|
-
if (matchedFlattenedItems.some(matchedItem => matchedItem[itemIdKey] === flattenedItem[itemIdKey])) {
|
|
15463
|
-
return matchedFlattenedItems;
|
|
15464
|
-
}
|
|
15465
|
-
const itemWords = (0,_react_hive_honey_utils__WEBPACK_IMPORTED_MODULE_0__.splitStringIntoWords)(flattenedItemValue.toLowerCase());
|
|
15466
|
-
const isItemMatched = searchWords.every(searchWord => itemWords.some(word => word.startsWith(searchWord)));
|
|
15467
|
-
if (isItemMatched) {
|
|
15468
|
-
if (flattenedItem.parentId === undefined) {
|
|
15469
|
-
matchedFlattenedItems.push(flattenedItem);
|
|
15470
|
-
const insertNestedItems = (targetFlattenedItem) => {
|
|
15471
|
-
// If parent item does not have nested items, so do not iterate through the list
|
|
15472
|
-
if (!targetFlattenedItem.totalNestedItems) {
|
|
15473
|
-
return;
|
|
15474
|
-
}
|
|
15475
|
-
flattenedItems.forEach(flattenedItem => {
|
|
15476
|
-
if (flattenedItem.parentId === targetFlattenedItem[itemIdKey]) {
|
|
15477
|
-
matchedFlattenedItems.push(flattenedItem);
|
|
15478
|
-
insertNestedItems(flattenedItem);
|
|
15479
|
-
}
|
|
15480
|
-
});
|
|
15481
|
-
};
|
|
15482
|
-
insertNestedItems(flattenedItem);
|
|
15483
|
-
}
|
|
15484
|
-
else {
|
|
15485
|
-
const insertParentItems = (targetFlattenedItem) => {
|
|
15486
|
-
const parentItemIndex = itemIdToIndexMap[targetFlattenedItem.parentId];
|
|
15487
|
-
const parentItem = flattenedItems[parentItemIndex];
|
|
15488
|
-
if (parentItem.parentId !== undefined) {
|
|
15489
|
-
insertParentItems(parentItem);
|
|
15490
|
-
}
|
|
15491
|
-
const prevItemParentId = matchedFlattenedItems.length
|
|
15492
|
-
? matchedFlattenedItems[matchedFlattenedItems.length - 1].parentId
|
|
15493
|
-
: null;
|
|
15494
|
-
const shouldInsertParentItem = prevItemParentId === null || prevItemParentId !== targetFlattenedItem.parentId;
|
|
15495
|
-
if (shouldInsertParentItem) {
|
|
15496
|
-
if (!parentItem) {
|
|
15497
|
-
throw new Error('[honey-layout]: Parent item was not found.');
|
|
15498
|
-
}
|
|
15499
|
-
matchedFlattenedItems.push(parentItem);
|
|
15500
|
-
}
|
|
15501
|
-
};
|
|
15502
|
-
insertParentItems(flattenedItem);
|
|
15503
|
-
matchedFlattenedItems.push(flattenedItem);
|
|
15504
|
-
}
|
|
15505
|
-
}
|
|
15506
|
-
return matchedFlattenedItems;
|
|
15507
|
-
}, []);
|
|
15508
|
-
};
|
|
15509
|
-
|
|
15510
|
-
|
|
15511
15507
|
/***/ },
|
|
15512
15508
|
|
|
15513
15509
|
/***/ "./src/utils/feedback.ts"
|
|
@@ -15542,14 +15538,9 @@ const warnOnce = (key, message) => {
|
|
|
15542
15538
|
"use strict";
|
|
15543
15539
|
__webpack_require__.r(__webpack_exports__);
|
|
15544
15540
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
15545
|
-
/* harmony export */ filterFlattenedItems: () => (/* reexport safe */ _data_utils__WEBPACK_IMPORTED_MODULE_1__.filterFlattenedItems),
|
|
15546
|
-
/* harmony export */ flattenNestedList: () => (/* reexport safe */ _data_utils__WEBPACK_IMPORTED_MODULE_1__.flattenNestedList),
|
|
15547
|
-
/* harmony export */ searchFlattenedItems: () => (/* reexport safe */ _data_utils__WEBPACK_IMPORTED_MODULE_1__.searchFlattenedItems),
|
|
15548
15541
|
/* harmony export */ warnOnce: () => (/* reexport safe */ _feedback__WEBPACK_IMPORTED_MODULE_0__.warnOnce)
|
|
15549
15542
|
/* harmony export */ });
|
|
15550
15543
|
/* harmony import */ var _feedback__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./feedback */ "./src/utils/feedback.ts");
|
|
15551
|
-
/* harmony import */ var _data_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./data-utils */ "./src/utils/data-utils.ts");
|
|
15552
|
-
|
|
15553
15544
|
|
|
15554
15545
|
|
|
15555
15546
|
|
|
@@ -15720,6 +15711,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
15720
15711
|
/* harmony export */ HoneyGrid: () => (/* reexport safe */ _components__WEBPACK_IMPORTED_MODULE_3__.HoneyGrid),
|
|
15721
15712
|
/* harmony export */ HoneyGridColumn: () => (/* reexport safe */ _components__WEBPACK_IMPORTED_MODULE_3__.HoneyGridColumn),
|
|
15722
15713
|
/* harmony export */ HoneyGridColumnStyled: () => (/* reexport safe */ _components__WEBPACK_IMPORTED_MODULE_3__.HoneyGridColumnStyled),
|
|
15714
|
+
/* harmony export */ HoneyLayerRegistry: () => (/* reexport safe */ _components__WEBPACK_IMPORTED_MODULE_3__.HoneyLayerRegistry),
|
|
15723
15715
|
/* harmony export */ HoneyLayoutProvider: () => (/* reexport safe */ _providers__WEBPACK_IMPORTED_MODULE_4__.HoneyLayoutProvider),
|
|
15724
15716
|
/* harmony export */ HoneyLayoutThemeOverride: () => (/* reexport safe */ _providers__WEBPACK_IMPORTED_MODULE_4__.HoneyLayoutThemeOverride),
|
|
15725
15717
|
/* harmony export */ HoneyLazyContent: () => (/* reexport safe */ _components__WEBPACK_IMPORTED_MODULE_3__.HoneyLazyContent),
|
|
@@ -15732,8 +15724,6 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
15732
15724
|
/* harmony export */ applyBreakpointStyles: () => (/* reexport safe */ _helpers__WEBPACK_IMPORTED_MODULE_7__.applyBreakpointStyles),
|
|
15733
15725
|
/* harmony export */ bpMedia: () => (/* reexport safe */ _helpers__WEBPACK_IMPORTED_MODULE_7__.bpMedia),
|
|
15734
15726
|
/* harmony export */ createStyles: () => (/* reexport safe */ _helpers__WEBPACK_IMPORTED_MODULE_7__.createStyles),
|
|
15735
|
-
/* harmony export */ filterFlattenedItems: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_6__.filterFlattenedItems),
|
|
15736
|
-
/* harmony export */ flattenNestedList: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_6__.flattenNestedList),
|
|
15737
15727
|
/* harmony export */ generateUniqueId: () => (/* reexport safe */ _helpers__WEBPACK_IMPORTED_MODULE_7__.generateUniqueId),
|
|
15738
15728
|
/* harmony export */ getHoneyListItemId: () => (/* reexport safe */ _components__WEBPACK_IMPORTED_MODULE_3__.getHoneyListItemId),
|
|
15739
15729
|
/* harmony export */ honeyVisibilityTransitionEffect: () => (/* reexport safe */ _effects__WEBPACK_IMPORTED_MODULE_8__.honeyVisibilityTransitionEffect),
|
|
@@ -15741,12 +15731,12 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
15741
15731
|
/* harmony export */ resolveAxisTranslate: () => (/* reexport safe */ _hooks__WEBPACK_IMPORTED_MODULE_5__.resolveAxisTranslate),
|
|
15742
15732
|
/* harmony export */ resolveScreenState: () => (/* reexport safe */ _helpers__WEBPACK_IMPORTED_MODULE_7__.resolveScreenState),
|
|
15743
15733
|
/* harmony export */ resolveSpacing: () => (/* binding */ resolveSpacing),
|
|
15744
|
-
/* harmony export */ searchFlattenedItems: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_6__.searchFlattenedItems),
|
|
15745
15734
|
/* harmony export */ useHoneyDecay: () => (/* reexport safe */ _hooks__WEBPACK_IMPORTED_MODULE_5__.useHoneyDecay),
|
|
15746
15735
|
/* harmony export */ useHoneyDocumentKeyUp: () => (/* reexport safe */ _hooks__WEBPACK_IMPORTED_MODULE_5__.useHoneyDocumentKeyUp),
|
|
15747
15736
|
/* harmony export */ useHoneyDrag: () => (/* reexport safe */ _hooks__WEBPACK_IMPORTED_MODULE_5__.useHoneyDrag),
|
|
15748
15737
|
/* harmony export */ useHoneyGridContext: () => (/* reexport safe */ _components__WEBPACK_IMPORTED_MODULE_3__.useHoneyGridContext),
|
|
15749
15738
|
/* harmony export */ useHoneyLatest: () => (/* reexport safe */ _hooks__WEBPACK_IMPORTED_MODULE_5__.useHoneyLatest),
|
|
15739
|
+
/* harmony export */ useHoneyLayerRegistryContext: () => (/* reexport safe */ _components__WEBPACK_IMPORTED_MODULE_3__.useHoneyLayerRegistryContext),
|
|
15750
15740
|
/* harmony export */ useHoneyLayout: () => (/* reexport safe */ _hooks__WEBPACK_IMPORTED_MODULE_5__.useHoneyLayout),
|
|
15751
15741
|
/* harmony export */ useHoneyMediaQuery: () => (/* reexport safe */ _hooks__WEBPACK_IMPORTED_MODULE_5__.useHoneyMediaQuery),
|
|
15752
15742
|
/* harmony export */ useHoneyOnChange: () => (/* reexport safe */ _hooks__WEBPACK_IMPORTED_MODULE_5__.useHoneyOnChange),
|